query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
zeroing out the values above and below the pivot
public static void zeroOutValuesAboveAndBelowThePivot(float[][] matrix, int column, int dimension){ float zeroValue; // the coefficient that we want to 0 out for (int i = 0; i <dimension; i++){ if (column == i){ // if we are in the same row as the pivot, skip (because we don't want to zero out the pivot) continue;} zeroValue = matrix[i][column]; System.out.print("Replacing row" + (i+1) + " with row" + (i+1) + " - " + Math.round(zeroValue*1000)/1000.0d + "*" + "row" + (column+1) + " to give us:\n\n"); for (int j = 0; j <= dimension; j++){ matrix[i][j] -= zeroValue*matrix[column][j];} printMatrix(matrix, dimension); } // doing operations on the whole row }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int getPivot(int left, int right) {\n\t\treturn (left+right)/2;\n\t}", "protected void pivot() {\n\t\twhile (seenColor != ev3.SUIVRE && c < 10) {\n\t\t\tif (first) {// on indique la futur direction pour tourne que la\n\t\t\t\t\t\t// premiere fois\n\t\t\t\tc = lastC % 2;// on recuperere la derniere valeur de c pour\n\t\t\t\t\t\t\t\t// d'abord tester cette direction\n\t\t\t\tswitch (c) {\n\t\t\t\tcase 0:\n\t\t\t\t\tev3.setDirection(0);\n\t\t\t\t\tgeorges++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tev3.setDirection(2);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfirst = false;\n\t\t\t} else {\n\t\t\t\tif (c % 2 == 0) {// en fonction de la direction je vais à gauche\n\t\t\t\t\t\t\t\t\t// ou droite\n\t\t\t\t\tev3.avance(\"droite\");\n\t\t\t\t} else {\n\t\t\t\t\tev3.avance(\"gauche\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// si on a effectue un pivot dun certain temps, on alterne la\n\t\t\t// direction et augmente le temps du pivot\n\t\t\tif (System.currentTimeMillis() - times > times2) {\n\t\t\t\tc++;// je vais tester la direction opposee\n\t\t\t\tlastC = c;\n\t\t\t\tfirst = true;// ca sera la prochaine fois la premiere fois pivot\n\t\t\t\t\t\t\t\t// de plus en plus grand, donc on augmente le\n\t\t\t\t\t\t\t\t// temps d'un pivot\n\t\t\t\ttimes2 += (c < 3) ? (c % 2 == 0) ? 250 : 260 : (c % 2 == 0) ? 500 : 520;\n\t\t\t\t// on reprend comme referentiel le temps courant\n\t\t\t\ttimes = System.currentTimeMillis();\n\t\t\t}\n\t\t\tseenColor = find.whatColor(ev3.lireColor());\n\t\t}\n\t}", "public int trap_old(int[] height) {\n if(height.length <=2){\n return 0;\n }\n int result = 0;\n List<Integer> peaks = new ArrayList<>();\n for(int i=0; i<height.length; i++){\n //if(i+1==height.length && height[i-1]<height[i]){\n // peaks.add(i);\n if(i<height.length-1 && height[i]!=height[i+1]){\n peaks.add(i);\n }\n }\n List<Integer> remove = new ArrayList<>();\n //merge top\n for(int i=0; i<peaks.size(); i++){\n boolean left = false;\n boolean right = false;\n for(int j=0; j<i; j++){ //left\n if(height[peaks.get(j)]>height[peaks.get(i)]){\n left = true;\n }\n }\n for(int j=i+1; j<peaks.size(); j++){ //right\n if(height[peaks.get(j)]>height[peaks.get(i)]){\n right = true;\n }\n }\n if(left&&right){\n remove.add(peaks.get(i));\n }\n }\n System.out.println(Arrays.toString(remove.toArray()));\n peaks.removeAll(remove);\n System.out.println(\"=============\");\n System.out.println(Arrays.toString(peaks.toArray()));\n for(int i=0; i<peaks.size()-1; i++){\n Integer a = peaks.get(i);\n Integer b = peaks.get(i+1);\n int min = Math.min(height[a],height[b]);\n for(int j=a+1; j<b; j++){\n int df = min - height[j];\n if(df > 0 ){\n result += df;\n }\n }\n }\n return result;\n }", "public int[] ZeroOutNegs(int[] arr) {\r\n for (int x = 0; x < arr.length; x++) {\r\n if (arr[x] < 0) {\r\n arr[x] = 0;\r\n }\r\n }\r\n return arr;\r\n }", "public static void getBubbleSortwithoutOutput(int range) {\n\n Integer[] number = GetRandomArray.getIntegerArray(range);\n\n //pivot to indicate current cursor\n int pivot = 0;\n\n //get initial value of array to start\n int init = number[pivot];\n\n //first and last element of array\n int last = 0, first = 0;\n\n //length of array\n int array_lenght = number.length - 1;\n\n for (int i = 0; i < number.length; i++) {\n\n //get last number of modified array\n last = number[number.length - 1];\n\n //get first number of modified array\n first = number[0];\n\n //increase pivot by 1\n pivot = pivot + 1;\n\n //if current number is is greater than next right to it\n if (init > number[pivot]) {\n\n //swap number\n number[i] = number[pivot];\n number[pivot] = init;\n\n //set pivot to 0,init to first number,i to less than 0, if its length is equal to array size\n if (pivot == array_lenght) {\n init = first;\n pivot = 0;\n i = -1;\n }\n }\n\n //if current number is is less than next right to it\n if (init < number[pivot]) {\n //do nothing and set current number as pivot\n init = number[pivot];\n }\n\n //if init number is equal last number of array\n if (init == last) {\n\n //set pivot to 0,init to first number,i to less than 0, if its length is equal to array size\n init = first;\n pivot = 0;\n i = -1;\n }\n System.out.println(Arrays.toString(number));\n }\n }", "public void setPivot(int x, int y) {\n pivot = new Point(x, y);\n }", "public void moveZeroes(int[] nums) \n {\n if ( nums == null || nums.length < 2 ) return;\n \n int pivot = nums.length - 1;\n int curr = 0;\n while ( curr < pivot )\n {\n if ( nums[curr] == 0 )\n {\n shiftLeft(nums, curr);\n pivot--;\n }\n else\n {\n curr++;\n }\n }\n }", "@Nonnull\n public int [] getPivot ()\n {\n return Arrays.copyOf (m_aPivot, m_nRows);\n }", "public void pivotTo(float targetAngle){\n float currentAngle = tracker.getAbsoluteAngle();\n if(Math.abs(currentAngle - targetAngle) > 180){ // must cross the line theta = 0\n if(currentAngle > targetAngle){\n pivotClockwise(360 - (currentAngle - targetAngle)); } else if(targetAngle > currentAngle){\n pivotCounterclockwise(360 - (targetAngle - currentAngle));\n }\n } else{\n if(currentAngle > targetAngle){\n pivotCounterclockwise(currentAngle - targetAngle);\n } else if(targetAngle > currentAngle){\n pivotClockwise(targetAngle - currentAngle);\n }\n }\n }", "protected double[] clampV(double nextVabs, double nextVarg)\r\n\t\t{\r\n//\t\t\tif(nextVabs < v_min)\r\n//\t\t\t\tnextVabs = v_min;\r\n//\t\t\telse if(nextVabs > v_max)\r\n//\t\t\t\tnextVabs = v_max;\r\n\t\t\t\r\n\t\t\treturn new double[]{nextVabs, nextVarg};\r\n\t\t}", "@Override\n public void accVertical(int value, int timestamp) {\n }", "public void quicksort(ArrayList<Node> array, int low, int high)\n {\n Node pivot = new Node(array.get(low).element);\n //Start value for pivot index\n int pivotIndex = low;\n //Define index in list where values start being higher than the pivot \n int higherThan = -1;\n //Begin the for loop after the first element\n for (int i = low + 1; i <= high; i++)\n \n { int gap = Math.abs(pivotIndex - i);\n if (array.get(i).element.compareTo(pivot.element) <= 0 && gap == 1)\n { switchPosition(i,pivotIndex);\n pivotIndex = i;\n }\n else if (array.get(i).element.compareTo(pivot.element) <= 0 && gap > 1)\n { //higherThan = i;\n switchPosition(i, pivotIndex);\n int temp = i;\n i = pivotIndex;\n pivotIndex = temp;\n switchPosition(i+1, pivotIndex); \n pivotIndex = i+1;\n //i++;\n //pivotIndex = higherThan;\n //higherThan++;\n }\n else // (array.get(i).element.compareTo(pivot.element) > 0 )\n { //Do nothing, element should stay in its position greater than the pivot\n }\n \n }\n System.out.println(\"Pivot index: \" + pivotIndex + \"\\n\");\n for (int i = 0; i < array.size(); i++)\n {\n System.out.println(\" \" + array.get(i).element.toString());\n }\n if ((pivotIndex - 1) >= 1)\n { quicksort(array, 0, pivotIndex - 1);\n System.out.println(\"\\n low index call, pivot element \" + array.get(pivotIndex).element.toString());\n }\n if ((high - pivotIndex) >= 1)\n {\n quicksort(array, pivotIndex + 1, high-1); \n }\n }", "private int pivotIndex(int left, int right){\n\t\treturn left+ (int)(Math.random()*(right - left + 1));\n\t}", "@Override\n\tprotected double getLowerBound() {\n\t\treturn 0;\n\t}", "static int findPivot(int[] arr){\n int start = 0;\n int end = arr.length-1;\n\n while(start<=end){\n int mid = start + (end - start) / 2;\n\n if(mid < end && arr[mid] > arr[mid+1]){\n return mid;\n }\n else if(mid > start && arr[mid] < arr[mid-1]){\n return mid - 1;\n }\n// Pivot lies on the left-hand side and mid is currently in section 2\n else if(arr[start] >= arr[mid]){\n end = mid - 1;\n }\n// Pivot lies on the right-hand side and mid is currently in section1\n// arr[start] < arr[mid]\n else {\n start = mid + 1;\n }\n }\n return -1;\n }", "public boolean pivot(int fromEdge, int toEdge, int fromLayer, int toLayer, int flags) throws EdgeOutOfRangeException, LayerOutOfRangeException, DataDirectorException {\n return false;\n }", "public static void correctForZeroInitialEstimate( double[] array, int upperlim ) {\r\n int intzero = findZeroCrossing(array, upperlim, 0);\r\n if (intzero > 1) {\r\n double[] arrset = Arrays.copyOfRange( array, 1, intzero );\r\n ArrayStats arrsub = new ArrayStats( arrset );\r\n removeValue(array, arrsub.getMean());\r\n }\r\n }", "public PointF getRotationPivot()\n {\n return rotationPivot;\n }", "public void set_AllSpreadIndexToZero(){\r\n\tGRASS=0; \r\n\tTIMBER=0;\r\n}", "public static double[] deadZone(double[] axis){\n\t\tfor (int i = 0; i< axis.length; i++){\n\t\t\tif ((axis[i] <= 0.05) && (axis[i] >= -0.05)) {//i will iterate to 0,1,2 since axis array size is 3\n\t\t\t\taxis[i] = 0;//if the condition is satisfies, round it to zero\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(axis.length);\n\t\treturn axis;\n\t}", "private int adjust(int val) {\r\n if(sortDescending == false) return val;\r\n return 0 - val;\r\n }", "private static int pickPivot(int[] A, int lo, int hi){\n\t\tint[] arr = new int[A.length-1];\n\t\tfor(int i = 0; i < arr.length; i++){\n\t\t\tarr[i] = A[i];\n\t\t}\n\t\t\n\t\tif((hi - lo) < 5){\n\t\t\treturn findMedian(arr, lo, hi);\n\t\t}\n\t\t\n\t\tint index = lo;\n\t\tfor(int i = lo; i < hi; i += 5){\n\t\t\tint rightEnd = i + 4;\n\t\t\t\n\t\t\tif(rightEnd > hi){\n\t\t\t\trightEnd = hi;\n\t\t\t}\n\t\t\t\n\t\t\tint median = findMedian(arr, i, rightEnd);\n\t\t\tswap(arr, median, index);\n\t\t\tindex++;\n\t\t}\n\t\t\n\t\treturn pickPivot(arr, lo, (lo + (int)Math.ceil((hi-lo)/5)));\n\t}", "private void updatePivot(int objIndex) {\n if (haveChanged[objIndex]){\n return;\n }\n int parentIndex=parentIndexes[objIndex];\n if (parentIndex!=-1){\n updatePivot(parentIndex);\n }\n pivots[objIndex].interpolateTransforms(beginPointTime.look[objIndex],endPointTime.look[objIndex],delta);\n if (parentIndex!=-1)\n pivots[objIndex].combineWithParent(pivots[parentIndex]);\n haveChanged[objIndex]=true;\n }", "public void setScoreZero() {\n this.points = 10000;\n }", "@Override\n\tprotected double getUpperBound() {\n\t\treturn 0;\n\t}", "public double[][] backElim()\n\t{ \t\n\t\tint pivR;\n\t\tfor(pivR = rows-1; pivR >= 0; pivR--)\n\t\t{\n\t\t\tboolean found = false; ///\n\t\t\tfor(int pivC = 0; pivC < cols && pivR >= 0; pivC++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(A[pivR][pivC] != 0 && found == false) ///\n\t\t\t\t{\n\t\t\t\t\tfound = true; ///\n\t\t\t\t\tfor(int i = pivR-1; i >= 0; i--) //for each row above pivot\n\t\t\t\t\t{\t\t\n\t\t\t\t\t\tdouble L = (A[i][pivC])/(A[pivR][pivC]); //sets the (+) L-factor\n\t\t\t\t\t\tfor(int j = cols-1; j >= pivC; j--) //work on elmts of (A's) row\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tA[i][j] = A[i][j] - ((A[pivR][j])*L); //mutates matrix elmt\n\t\t\t\t\t\t}\n\t\t\t\t\t\tA[i][cols] = A[i][cols] - ((A[pivR][cols])*L); //vector b (in col n)\n\t\t\t\t\t}\n\t\t\t\t\t//pivR--; //\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\t\n\t\treturn A;\n\t}", "private static int partion(int[] arr, int lo, int hi) {\n int pivot = arr[hi];\n int i = lo;\n for (int j = lo; j <= hi; j++) {\n if (arr[j] < pivot) {\n int tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n i++;\n }\n }\n int tmp = arr[i];\n arr[i] = arr[hi];\n arr[hi] = tmp;\n return i;\n }", "public void setPivotX(float f) {\n this.pivotX = f;\n }", "private Matrix gaussianEliminate(){\r\n\t\t//Start from the 0, 0 (top left)\r\n\t\tint rowPoint = 0;\r\n\t\tint colPoint = 0;\r\n\t\t// instantiate the array storing values for new Matrix\r\n\t\tDouble[][] newVal = deepCopy(AllVal);\r\n\t\twhile (rowPoint < row && colPoint < col) {\r\n\t\t\t// find the index with max number (absolute value) from rowPoint to row\r\n\t\t\tDouble max = Math.abs(newVal[rowPoint][colPoint]);\r\n\t\t\tint index = rowPoint;\r\n\t\t\tint maxindex = rowPoint;\r\n\t\t\twhile (index < row) {\r\n\t\t\t\tif (max < Math.abs(newVal[index][colPoint])) {\r\n\t\t\t\t\tmax = newVal[index][colPoint];\r\n\t\t\t\t\tmaxindex = index;\r\n\t\t\t\t}\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\t\t\t// if max is 0 then that must mean there are no pivots\r\n\t\t\tif (max == 0) {\r\n\t\t\t\tcolPoint++;\r\n\t\t\t}else {\r\n\t\t\t\t//TODO: refactor into method\r\n\t\t\t\tDouble[] Temp = newVal[rowPoint];\r\n\t\t\t\tnewVal[rowPoint] = newVal[maxindex];\r\n\t\t\t\tnewVal[maxindex] = Temp;\r\n\t\t\t\t// Fill 0 lower part of pivot\r\n\t\t\t\tfor(int lower = rowPoint + 1; lower < row; lower++) {\r\n\t\t\t\t\tDouble ratio = newVal[lower][colPoint]/newVal[rowPoint][colPoint];\r\n\t\t\t\t\tnewVal[lower][colPoint] = (Double) 0.0;\r\n\t\t\t\t\t// adjust for the remaining element\r\n\t\t\t\t\tfor (int remain = colPoint + 1; remain < col; remain++) {\r\n\t\t\t\t\t\tnewVal[lower][remain] = newVal[lower][remain] - newVal[lower][remain]*ratio;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trowPoint++;\r\n\t\t\t\tcolPoint++;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new Matrix(newVal);\r\n\t}", "private void updateTempVisiblePoints() {\n for (int[] point : tempVisiblePoints) {\n point[3] -= 1;\n if (point[3] <= 0) {\n map.setPointHidden(point[0], point[1]);\n }\n }\n }", "protected void setValues() {\n values = new double[size];\n int pi = 0; // pixelIndex\n int siz = size - nanW - negW - posW;\n int biw = min < max ? negW : posW;\n int tiw = min < max ? posW : negW;\n double bv = min < max ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;\n double tv = min < max ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY;\n double f = siz > 1 ? (max - min) / (siz - 1.) : 0.;\n for (int i = 0; i < biw && pi < size; i++,pi++) {\n values[pi] = bv;\n }\n for (int i = 0; i < siz && pi < size; i++,pi++) {\n double v = min + i * f;\n values[pi] = v;\n }\n for (int i = 0; i < tiw && pi < size; i++,pi++) {\n values[pi] = tv;\n }\n for (int i = 0; i < nanW && pi < size; i++,pi++) {\n values[pi] = Double.NaN;\n }\n }", "public int trapRainWater(int[][] arr) {\n if(arr.length==0||arr[0].length==0) return 0;\n int n=arr.length;\n int m=arr[0].length;\n PriorityQueue<Integer> pq=new PriorityQueue<>((a,b)->{\n return arr[a/m][a%m]-arr[b/m][b%m];\n });\n boolean vis[][]=new boolean[n][m];\n int ans=0;\n int bound=0;\n for(int i=0;i<n;i++){\n for(int j=0;j<m;j++){\n if(i==0||i==n-1||j==0||j==m-1){\n pq.add(i*m+j);\n vis[i][j]=true;\n }\n }\n }\n int dir[][]={{1,0},{-1,0},{0,1},{0,-1}};\n while(pq.size()>0){\n int idx=pq.remove();\n int r=idx/m;\n int c=idx%m;\n bound=Math.max(bound,arr[r][c]);\n if(arr[r][c]<bound) ans+=bound-arr[r][c];\n for(int d=0;d<4;d++){\n int x=r+dir[d][0];\n int y=c+dir[d][1];\n if(x>=0&&y>=0&&x<n&&y<m&& !vis[x][y]){\n vis[x][y]=true;\n pq.add(x*m+y);\n }\n }\n }\n return ans;\n }", "@Override\n\tprotected void setLowerBound() {\n\t\t\n\t}", "public void forzerocount() {\r\n val = new BigDecimal[zerocntretobj.getRowCount()];\r\n for (int cnt = 0; cnt < zerocntretobj.getRowCount(); cnt++) {\r\n int zerocountct = 0;\r\n BigDecimal bdcross = null;\r\n int mcnt = Qrycolumns.size();\r\n int n = 0;\r\n for (int i = 0; i < mcnt; i++) {\r\n zerocountct = 0;\r\n\r\n for (int j = n; j < zerocntretobj.getColumnCount(); j = j + mcnt) {\r\n\r\n Object Obj = zerocntretobj.getFieldValue(cnt, j);\r\n\r\n if (zerocntretobj.columnTypes[j] != null) {\r\n if (zerocntretobj.columnTypesInt[j] == Types.BIGINT\r\n || zerocntretobj.columnTypesInt[j] == Types.DECIMAL || zerocntretobj.columnTypesInt[j] == Types.DOUBLE\r\n || zerocntretobj.columnTypesInt[j] == Types.FLOAT || zerocntretobj.columnTypesInt[j] == Types.INTEGER\r\n || zerocntretobj.columnTypesInt[j] == Types.NUMERIC || zerocntretobj.columnTypesInt[j] == Types.REAL\r\n || zerocntretobj.columnTypesInt[j] == Types.SMALLINT || zerocntretobj.columnTypesInt[j] == Types.TINYINT\r\n || zerocntretobj.columnTypes[j].equalsIgnoreCase(\"NUMBER\")) {\r\n\r\n BigDecimal bdecimal = null;\r\n\r\n if (Obj != null) {\r\n bdecimal = zerocntretobj.getFieldValueBigDecimal(cnt, j);\r\n BigDecimal bd = new BigDecimal(\"0\");\r\n if (bdecimal == null || bdecimal.compareTo(bd) == 0) {\r\n zerocountct = zerocountct + 1;\r\n bdcross = new BigDecimal(zerocountct);\r\n\r\n }\r\n }\r\n }\r\n }\r\n }\r\n n = n + 1;\r\n zerocntmsr.add(zerocountct);\r\n }\r\n\r\n }\r\n }", "static int findPivot(int[] a) {\n int start = 0, end = a.length - 1;\n\n while (start <= end) {\n int mid = start + (end - start) / 2;\n\n if (mid < end && a[mid] > a[mid + 1])\n return mid;\n if (mid > start && a[mid] < a[mid - 1])\n return mid - 1;\n if (a[mid] <= a[start])\n end = mid - 1;\n else\n start = mid + 1;\n }\n\n return -1;\n }", "private boolean priorsGotNegativeValues(NumericDataset priors) {\n for (FeatureSequenceData data:priors.getAllSequences()) {\n NumericSequenceData priorsequence=(NumericSequenceData)data;\n for (int i=0;i<priorsequence.getSize();i++) {\n if (priorsequence.getValueAtRelativePosition(i)<0) return true;\n }\n }\n return false;\n }", "public V getLowerBound();", "public Matrix ref() {\n\t\tMatrix m = copy();\n\t\tint pivotRow = 0;\n\t\tfor (int col = 0; col < m.N; col++) {\n\t\t\tif (pivotRow < m.M) {\n\t\t\t\tint switchTo = m.M - 1;\n\t\t\t\twhile (pivotRow != switchTo && \n\t\t\t\t\t\tm.ROWS[pivotRow][col].equals(new ComplexNumber(0))) {\n\t\t\t\t\tm = m.rowSwitch(pivotRow, switchTo);\n\t\t\t\t\tswitchTo--;\n\t\t\t\t}\n\t\t\t\tif (!m.ROWS[pivotRow][col].equals(new ComplexNumber(0))) {\n\t\t\t\t\t// We got a non-zero pivot\n\t\t\t\t\tfor (int lowerRow = pivotRow + 1; lowerRow < m.M;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlowerRow++) {\n\t\t\t\t\t\tComplexNumber factor1 = new ComplexNumber(-1);\n\t\t\t\t\t\tComplexNumber factor2 = m.ROWS[lowerRow][col];\n\t\t\t\t\t\tComplexNumber factor3 = m.ROWS[pivotRow][col];\n\t\t\t\t\t\tComplexNumber factor4 = new ComplexNumber(1);\n\t\t\t\t\t\tComplexNumber factor5 = factor1.multiply(factor2);\n\t\t\t\t\t\tComplexNumber factor6 = factor4.divide(factor3);\n\t\t\t\t\t\tComplexNumber weight = factor5.multiply(factor6);\n\n\t\t\t\t\t\tm = m.rowAdd(lowerRow, pivotRow, weight);\n\t\t\t\t\t}\n\t\t\t\t\tpivotRow++;\n\t\t\t\t\t/* Keep the same pivot row if we currently have a\n\t\t\t\t\t * zero-pivot. Move on to see if there's a pivot in the\n\t\t\t\t\t * next column.\n\t\t\t\t\t */\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\treturn m;\n\t}", "boolean hasPivot();", "private int partition(MyNode[] arr, int lo, int hi) {\n MyNode pivot = arr[lo];\n int left = lo + 1;\n int right = hi;\n transitions.add(colorNode(arr, PIVOT_COLOR, lo));\n while (true)\n {\n while ((left <= right) && arr[left].getValue() < pivot.getValue())\n {\n transitions.add(colorNode(arr, LEFT_COLOR, left));\n transitions.add(colorNode(arr, START_COLOR, left));\n left++;\n }\n while ((left <= right) && arr[right].getValue() >= pivot.getValue())\n {\n transitions.add(colorNode(arr, RIGHT_COLOR, right));\n transitions.add(colorNode(arr, START_COLOR, right));\n right--;\n }\n if (left < right)\n {\n transitions.add(colorNode(arr, SELECT_COLOR, left, right));\n transitions.add(swap(arr, left, right));\n transitions.add(colorNode(arr, START_COLOR, left, right));\n left++;\n right--;\n }\n else\n {\n break;\n }\n }\n transitions.add(colorNode(arr, SELECT_COLOR, lo, right));\n transitions.add(swap(arr, lo, right));\n transitions.add(colorNode(arr, START_COLOR, lo, right));\n return right;\n }", "public void setToZero() {\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n data[i][j] = 0;\n }\n }\n }", "private boolean rowSwap(int pr, int pc)\n\t{\n\t\tif(A[pr][pc] == 0) //if pivot is 0\n\t\t{\n\t\t\tfor(int i = pr+1; i < rows; i++) //for everything underneath pivot\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(A[i][pc] != 0) //if non-0 underneath pivot\n\t\t\t\t{\n\t\t\t\t\t//find max in row ie half-pivot\n\t\t\t\t\tint maxI = i;\n\t\t\t\t\tfor(int p = i+1; p < rows; p++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(A[p][pc] > A[i][pc])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmaxI = p;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//swap rows\t\n\t\t\t\t\t\n\t\t\t\t\tdouble[] temp = A[pr];\n\t\t\t\t\tA[pr] = A[maxI];\n\t\t\t\t\tA[maxI] = temp;\n\t\n\t\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t//else { return false; } //whole col is 0's\n\t\t\t}\n\t\t\treturn false; //whole col is 0's\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t}", "private void getInitialSeekBarPositions() {\n final ContentResolver resolver = getActivity().getContentResolver();\n portColumnsValue = Settings.System.getIntForUser(resolver,\n Settings.System.QS_COLUMNS_PORTRAIT, 3, UserHandle.USER_CURRENT);\n portRowsValue = Settings.System.getIntForUser(resolver,\n Settings.System.QS_ROWS_PORTRAIT, 3, UserHandle.USER_CURRENT);\n landColumnsValue = Settings.System.getIntForUser(resolver,\n Settings.System.QS_COLUMNS_LANDSCAPE, 4, UserHandle.USER_CURRENT);\n landRowsValue = Settings.System.getIntForUser(resolver,\n Settings.System.QS_ROWS_LANDSCAPE, 2, UserHandle.USER_CURRENT);\n }", "private void setPointsAs0() {\n\n for (int counter = 0; counter < countOfPoints; counter++) {\n points[counter] = new Point(0,0);\n }\n\n }", "public Matrix[] palu() {\n\t\tHashMap<Integer, Integer> permutations = new HashMap<Integer,Integer>();\n\t\tMatrix m = copy();\n\t\tint pivotRow = 0;\n\t\tfor (int col = 0; col < m.N; col++) {\n\t\t\tif (pivotRow < m.M) {\n\t\t\t\tint switchTo = m.M - 1;\n\t\t\t\twhile (pivotRow != switchTo && \n\t\t\t\t\t\tm.ROWS[pivotRow][col].equals(new ComplexNumber(0))) {\n\t\t\t\t\tm = m.rowSwitch(pivotRow, switchTo);\n\t\t\t\t\tpermutations.put(pivotRow, switchTo);\n\t\t\t\t\tswitchTo--;\n\t\t\t\t}\n\t\t\t\tif (!m.ROWS[pivotRow][col].equals(new ComplexNumber(0))) {\n\t\t\t\t\t// We got a non-zero pivot\n\t\t\t\t\tfor (int lowerRow = pivotRow + 1; lowerRow < m.M;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlowerRow++) {\n\t\t\t\t\t\tComplexNumber factor1 = new ComplexNumber(-1);\n\t\t\t\t\t\tComplexNumber factor2 = m.ROWS[lowerRow][col];\n\t\t\t\t\t\tComplexNumber factor3 = m.ROWS[pivotRow][col];\n\t\t\t\t\t\tComplexNumber factor4 = new ComplexNumber(1);\n\t\t\t\t\t\tComplexNumber factor5 = factor1.multiply(factor2);\n\t\t\t\t\t\tComplexNumber factor6 = factor4.divide(factor3);\n\t\t\t\t\t\tComplexNumber weight = factor5.multiply(factor6);\n\n\t\t\t\t\t\tm = m.rowAdd(lowerRow, pivotRow, weight);\n\t\t\t\t\t}\n\t\t\t\t\tpivotRow++;\n\t\t\t\t\t/* Keep the same pivot row if we currently have a\n\t\t\t\t\t * zero-pivot. Move on to see if there's a pivot in the\n\t\t\t\t\t * next column.\n\t\t\t\t\t */\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tMatrix p = identity(m.M);\n\t\tfor (Integer rowI : permutations.keySet()) {\n\t\t\tp.rowSwitch(rowI, permutations.get(rowI));\n\t\t}\n\t\tMatrix l = identity(m.M);\n\t\tMatrix u = p.multiply(copy());\n\t\t\n\t\tpivotRow = 0;\n\t\tfor (int col = 0; col < u.N; col++) {\n\t\t\tif (pivotRow < u.M) {\n\t\t\t\t// Should not have to do any permutations\n\t\t\t\tif (!u.ROWS[pivotRow][col].equals(new ComplexNumber(0))) {\n\t\t\t\t\t// We got a non-zero pivot\n\t\t\t\t\tfor (int lowerRow = pivotRow + 1; lowerRow < u.M;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlowerRow++) {\n\t\t\t\t\t\tComplexNumber factor1 = new ComplexNumber(-1);\n\t\t\t\t\t\tComplexNumber factor2 = u.ROWS[lowerRow][col];\n\t\t\t\t\t\tComplexNumber factor3 = u.ROWS[pivotRow][col];\n\t\t\t\t\t\tComplexNumber factor4 = new ComplexNumber(1);\n\t\t\t\t\t\tComplexNumber factor5 = factor1.multiply(factor2);\n\t\t\t\t\t\tComplexNumber factor6 = factor4.divide(factor3);\n\t\t\t\t\t\tComplexNumber weight = factor5.multiply(factor6);\n\n\t\t\t\t\t\tu = u.rowAdd(lowerRow, pivotRow, weight);\n\t\t\t\t\t\tl = l.rowAdd(lowerRow, pivotRow, weight);\n\t\t\t\t\t}\n\t\t\t\t\tpivotRow++;\n\t\t\t\t\t/* Keep the same pivot row if we currently have a\n\t\t\t\t\t * zero-pivot. Move on to see if there's a pivot in the\n\t\t\t\t\t * next column.\n\t\t\t\t\t */\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tl = l.inverse();\n\t\tMatrix[] palu = {p, this, l, u};\n\t\treturn palu;\n\t}", "public interface IPivotStrategy<T>\r\n{\r\n /**\r\n * Returns the index of the element selected as the pivot value\r\n * within the subarray between first and last (inclusive).\r\n * \r\n * @param arr the array in which to select the pivot\r\n * @param first beginning of the subarray\r\n * @param last end of the subarray\r\n * @param comp the comparator to be used\r\n * @return index of the element selected as the pivot value\r\n * @throws IllegalArgumentException if the length of the subarray\r\n * (last - first + 1) is less than the value returned by minLength().\r\n */\r\n int indexOfPivotElement(T[] arr, int first, int last, Comparator<? super T> comp);\r\n\r\n /**\r\n * Returns the minimum length of the subarray to which this \r\n * partitioning strategy can be applied.\r\n * \r\n * @return minimum size of the subarray required to apply this\r\n * pivot selection strategy\r\n */\r\n int minLength();\r\n\r\n /**\r\n * Returns the number of comparisons performed in the most recent call\r\n * to indexOfPivotElement\r\n * @return number of comparisons\r\n */\r\n int getComparisons();\r\n \r\n /**\r\n * Returns the number of swaps performed in the most recent call\r\n * to indexOfPivotElement. For algorithms that do not use swapping, \r\n * this method returns an estimate of swaps equivalent to one-third\r\n * the number of times that an array element was assigned.\r\n * @return equivalent number of swaps\r\n */\r\n int getSwaps();\r\n \r\n}", "public void zeroValues()\n {\n fx = 0.0f;\n fy = 0.0f;\n fz = 0.0f;\n magnitude = 0.0f;\n }", "private void setInitialSeekBarPositions() {\n portColumns.setProgress(portColumnsValue);\n portRows.setProgress(portRowsValue);\n landColumns.setProgress(landColumnsValue);\n landRows.setProgress(landRowsValue);\n }", "public static void getBubbleSort(int range) {\n\n Integer[] number = GetRandomArray.getIntegerArray(range);\n\n //main cursor to run across array\n int pivot_main = 0;\n\n //secondary cursor to run of each index of array\n int pivot_check = 0;\n\n //variable to hold current check number\n int check_num = 0;\n\n //run loop for array length time\n for (int i = number.length; i > 0; i--) {\n\n //set cursor to first number\n pivot_main = number[0];\n\n //loop size decreases with main loop (i - 1234 | j - 4321)\n for (int j = 0; j < i - 1; j++) {\n\n //set cursor to next number in loop\n pivot_check = j + 1;\n\n //get number at above cursor\n check_num = number[j + 1];\n\n //check if number at current cursor is less than number at main cursor\n if (check_num < pivot_main) {\n //swap there position\n number[pivot_check] = pivot_main;\n number[j] = check_num;\n }\n\n //check if number at current cursor is greater than number at main cursor\n if (check_num > pivot_main) {\n //transfer current number to main cursor\n pivot_main = check_num;\n }\n }\n System.out.println(Arrays.toString(number));\n }\n }", "@Override\r\n\tpublic double alapterulet() {\n\t\treturn 0;\r\n\t}", "public final AstValidator.pivot_clause_return pivot_clause() throws RecognitionException {\n AstValidator.pivot_clause_return retval = new AstValidator.pivot_clause_return();\n retval.start = input.LT(1);\n\n\n CommonTree root_0 = null;\n\n CommonTree _first_0 = null;\n CommonTree _last = null;\n\n CommonTree PIVOT123=null;\n CommonTree INTEGER124=null;\n\n CommonTree PIVOT123_tree=null;\n CommonTree INTEGER124_tree=null;\n\n try {\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:304:5: ( ^( PIVOT INTEGER ) )\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:304:7: ^( PIVOT INTEGER )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n PIVOT123=(CommonTree)match(input,PIVOT,FOLLOW_PIVOT_in_pivot_clause1319); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n PIVOT123_tree = (CommonTree)adaptor.dupNode(PIVOT123);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(PIVOT123_tree, root_1);\n }\n\n\n match(input, Token.DOWN, null); if (state.failed) return retval;\n _last = (CommonTree)input.LT(1);\n INTEGER124=(CommonTree)match(input,INTEGER,FOLLOW_INTEGER_in_pivot_clause1321); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n INTEGER124_tree = (CommonTree)adaptor.dupNode(INTEGER124);\n\n\n adaptor.addChild(root_1, INTEGER124_tree);\n }\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n }\n\n }\n\n catch(RecognitionException re) {\n throw re;\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }", "public void clearZeros(GridElement original){\n\t\tStack<GridElement> zerosToClear = new Stack<>();\n\t\tzerosToClear.push(original);\n\t\t\n\t\twhile(!zerosToClear.isEmpty()){\n\t\t\tGridElement temp = zerosToClear.pop();\n\t\t\tint x = temp.getxPosition();\n\t\t\tint y = temp.getyPosition();\n\t\t\t\n\t\t\t//up left\n\t\t\tif (x > 0 && y > 0){\n\t\t\t\tJButton upLeftButton = grid[x-1][y-1].getButton();\n\t\t\t\tupLeftButton.setText(neighborCounts[x-1][y-1] + \"\");\n\t\t\t\thandleButton(upLeftButton);\n\t\t\t\tif(neighborCounts[x-1][y-1] == 0 && upLeftButton.isEnabled()){\n\t\t\t\t\tzerosToClear.push(grid[x-1][y-1]);\n\t\t\t\t}\n\t\t\t\tupLeftButton.setEnabled(false);\n\t\t\t}\n\t\t\t//up\n\t\t\tif (y > 0){\n\t\t\t\tJButton upButton = grid[x][y-1].getButton();\n\t\t\t\tupButton.setText(neighborCounts[x][y-1] + \"\");\n\t\t\t\thandleButton(upButton);\n\t\t\t\tif(neighborCounts[x][y-1] == 0 && upButton.isEnabled()){\n\t\t\t\t\tzerosToClear.push(grid[x][y-1]);\n\t\t\t\t}\n\t\t\t\tupButton.setEnabled(false);\n\t\t\t}\n\t\t\t//up right\n\t\t\tif (x < width-1 && y > 0){\n\t\t\t\tJButton upRightButton = grid[x+1][y-1].getButton();\n\t\t\t\tupRightButton.setText(neighborCounts[x+1][y-1] + \"\");\n\t\t\t\thandleButton(upRightButton);\n\t\t\t\tif(neighborCounts[x+1][y-1] == 0 && upRightButton.isEnabled()){\n\t\t\t\t\tzerosToClear.push(grid[x+1][y-1]);\n\t\t\t\t}\n\t\t\t\tupRightButton.setEnabled(false);\n\t\t\t}\n\t\t\t//left\n\t\t\tif (x > 0){\n\t\t\t\tJButton leftButton = grid[x-1][y].getButton();\n\t\t\t\tleftButton.setText(neighborCounts[x-1][y] + \"\");\n\t\t\t\thandleButton(leftButton);\n\t\t\t\tif(neighborCounts[x-1][y] == 0 && leftButton.isEnabled()){\n\t\t\t\t\tzerosToClear.push(grid[x-1][y]);\n\t\t\t\t}\n\t\t\t\tleftButton.setEnabled(false);\n\t\t\t}\n\t\t\t//right\n\t\t\tif (x < width-1){\n\t\t\t\tJButton rightButton = grid[x+1][y].getButton();\n\t\t\t\trightButton.setText(neighborCounts[x+1][y] + \"\");\n\t\t\t\thandleButton(rightButton);\n\t\t\t\tif(neighborCounts[x+1][y] == 0 && rightButton.isEnabled()){\n\t\t\t\t\tzerosToClear.push(grid[x+1][y]);\n\t\t\t\t}\n\t\t\t\trightButton.setEnabled(false);\n\t\t\t}\n\t\t\t//down left\n\t\t\tif (x > 0 && y < height-1){\n\t\t\t\tJButton downLeftButton = grid[x-1][y+1].getButton();\n\t\t\t\tdownLeftButton.setText(neighborCounts[x-1][y+1] + \"\");\n\t\t\t\thandleButton(downLeftButton);\n\t\t\t\tif(neighborCounts[x-1][y+1] == 0 && downLeftButton.isEnabled()){\n\t\t\t\t\tzerosToClear.push(grid[x-1][y+1]);\n\t\t\t\t}\n\t\t\t\tdownLeftButton.setEnabled(false);\n\t\t\t}\n\t\t\t//down\n\t\t\tif (y < height-1){\n\t\t\t\tJButton downButton = grid[x][y+1].getButton();\n\t\t\t\tdownButton.setText(neighborCounts[x][y+1] + \"\");\n\t\t\t\thandleButton(downButton);\n\t\t\t\tif(neighborCounts[x][y+1] == 0 && downButton.isEnabled()){\n\t\t\t\t\tzerosToClear.push(grid[x][y+1]);\n\t\t\t\t}\n\t\t\t\tdownButton.setEnabled(false);\n\t\t\t}\n\t\t\t//down right\n\t\t\tif (x < width-1 && y < height-1){\n\t\t\t\tJButton downRightButton = grid[x+1][y+1].getButton();\n\t\t\t\tdownRightButton.setText(neighborCounts[x+1][y+1] + \"\");\n\t\t\t\thandleButton(downRightButton);\n\t\t\t\tif(neighborCounts[x+1][y+1] == 0 && downRightButton.isEnabled()){\n\t\t\t\t\tzerosToClear.push(grid[x+1][y+1]);\n\t\t\t\t}\n\t\t\t\tdownRightButton.setEnabled(false);\n\t\t\t}\n\t\t}\n\t}", "public static void quickSort(ArrayList<Integer> S){\n\t\t\n\t\tif (S.isEmpty()) { //if empty just return itself \n\t\t\treturn; \n\t\t}\n\t\t\n\t\tint pivot = S.get(S.size()-1); //creating a pivot point for the sort \n\t\t\n\t\tArrayList<Integer> L = new ArrayList<Integer>(); //Creating array list for Less than\n\t\tArrayList<Integer> E = new ArrayList<Integer>(); //Creating array list for Equal than\n\t\tArrayList<Integer> G = new ArrayList<Integer>(); //Creating array list for Greater than \n\t\t\n\t\twhile (!S.isEmpty()) { //run while the array list isn't empty \n\t\t\t\n\t\t\tif (S.get(0)< pivot) { //if its less than the pivot, add less than \n\t\t\t\t\n\t\t\t\tL.add(S.get(0)); //adds the less than \n\t\t\t\tS.remove(0); //removes the elements at that index position \n\t\t\t}\n\t\t\telse if(S.get(0) == pivot) { //if its equal to the pivot, add equal to \n\t\t\t\t\n\t\t\t\tE.add(S.get(0));\n\t\t\t\tS.remove(0);\n\t\t\t}\n\t\t\t\n\t\t\telse if (S.get(0) > pivot) { //if its greater than the pivot point, add greater than \n\t\t\t\t\n\t\t\t\tG.add(S.get(0));\n\t\t\t\tS.remove(0);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tif (!L.isEmpty()) { //if Less than isn't empty, call quick sort on less than \n\t\t\t\n\t\t\tquickSort(L); //calls the quick sort for less than \n\t\t}\n\t\t\n\t\tif (!G.isEmpty()) { //if Greater than isn't empty, call quick sort on greater than \n\t\t\t\n\t\t\tquickSort(G); //calls quick sort for greater than \n\t\t}\n\t\t\n\t\tS.addAll(L); //Shifting all of the elements to the right \n\t\tS.addAll(E); //Shifting all of the elements to the right \n\t\tS.addAll(G); //Shifting all of the elements to the right \n\t}", "public int[] shitArrayValuesToFront(int[] arr){\n for(int i = 0; i < arr.length; i++){\n if(i == arr.length - 1){\n arr[i] = 0;\n }else{\n arr[i] = arr[i + 1];\n }\n }\n return arr;\n }", "@Test\n public void testQuicksortWithNegativeValues() {\n Integer[] testArray = new Integer[]{7, -10, 17, 4, 1, 5};\n Quicksort.<Integer>quicksort(testArray, 0, testArray.length - 1);\n Integer[] expectedResult = {-10, 1, 4, 5, 7, 17};\n assertArrayEquals(expectedResult, testArray);\n }", "public double[] getUpperLeft() {\n this.upperLeft = new double[]{minX, maxY};\n return upperLeft;\n }", "private static int partitionArray(int left, int right, int pivot) {\r\n\t\tint leftPointer = left - 1;\r\n\t\t// Exclude pivot so take the last index as right pointer\r\n\t\tint rightPointer = right;\r\n\t\twhile (true) {\r\n\t\t\twhile (leftPointer < right && array[++leftPointer] < pivot) {\r\n\t\t\t\tcomparisons++;\r\n\t\t\t\t// Do nothing, only check the pointer where number is greater\r\n\t\t\t\t// than pivot.\r\n\t\t\t}\r\n\t\t\twhile (rightPointer > left && array[--rightPointer] > pivot) {\r\n\t\t\t\tcomparisons++;\r\n\t\t\t\t// Do nothing, only check the pointer where number is greater\r\n\t\t\t\t// than pivot.\r\n\t\t\t}\r\n\t\t\tif (rightPointer <= leftPointer)\r\n\t\t\t\tbreak;\r\n\t\t\telse \t\t\t// Swap the elements\r\n\t\t\t\tswap(leftPointer, rightPointer);\r\n\t\t}\r\n\t\t// place pivot to the actual position by swapping it to last element of\r\n\t\t// left array.\r\n\t\tswap(leftPointer, right);\r\n\t\treturn leftPointer;\r\n\t}", "@Override\n public double getMyRidingOffset()\n {\n return 0D;\n }", "public static int[] moveZero(int[] nums) {\n int j = 0; // This pointer is similar to quick sort?\n for (int i = 0; i < nums.length; i++) {\n if (nums[i] != 0) {\n int tmp = nums[i];\n nums[i] = nums[j];\n nums[j] = tmp;\n j++;\n }\n System.out.println(Arrays.toString(nums));\n }\n return nums;\n }", "public static int partition(int[] arr, int pivot, int lo, int hi) {\n System.out.println(\"pivot -> \" + pivot);\n int i = lo, j = lo;\n while (i <= hi) {\n if (arr[i] <= pivot) {\n swap(arr, i, j);\n i++;\n j++;\n } else {\n i++;\n }\n }\n System.out.println(\"pivot index -> \" + (j - 1));\n return (j - 1);\n }", "@Override\n public int apply(int[][] region) {\n return 0;\n }", "private boolean priorsGotNegativeValues(NumericSequenceData priorsequence) {\n for (int i=0;i<priorsequence.getSize();i++) {\n if (priorsequence.getValueAtRelativePosition(i)<0) return true;\n }\n return false;\n }", "private static void sortImpl(int[] indices, double[] values, int low, int high) {\n int pivotPos = (low + high) / 2;\n int pivot = indices[pivotPos];\n swapIndexAndValue(indices, values, pivotPos, high);\n\n int pos = low - 1;\n for (int i = low; i <= high; i++) {\n if (indices[i] <= pivot) {\n pos++;\n swapIndexAndValue(indices, values, pos, i);\n }\n }\n if (high > pos + 1) {\n sortImpl(indices, values, pos + 1, high);\n }\n if (pos - 1 > low) {\n sortImpl(indices, values, low, pos - 1);\n }\n }", "@Override\r\n\tprotected Integer zero() {\n\t\treturn 0;\r\n\t}", "private int chooseInitialPivot(int beginIndex, int endIndex) {\n\t\treturn beginIndex + (endIndex - beginIndex) / 2; // Guard against\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// boundary\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// overflows\n\n\t}", "public V getUpperBound();", "@Override\n\tpublic float getHeightInPoints() {\n\t\treturn 0;\n\t}", "public void cleanUp(){\n\t\t//offset(-1*bounds.left, -1*bounds.top);\n\t}", "public void zero() {\r\n\t\tthis.x = 0.0f;\r\n\t\tthis.y = 0.0f;\r\n\t}", "public void reorder(int low, int high) {\n if (low < high) {\n // Select pivot position and put all the elements smaller\n // than pivot on left and greater than pivot on right\n int pi = partition(low, high);\n\n // Sort the elements on the left of pivot\n reorder(low, pi - 1);\n\n // Sort the elements on the right of pivot\n reorder(pi + 1, high);\n }\n }", "private static int partition(Array A, int iStart, int iEnd, int pivot)\n\t{\n\t\tA.swap(iStart, pivot);\n\t\tint p = A.get(iStart); // the value of the pivot element\n\t\tint i = iStart + 1;\n\t\tfor (int j = iStart + 1; j <= iEnd; ++j)\n\t\t{\n\t\t\tif (A.get(j) < p)\n\t\t\t{\n\t\t\t\tA.swap(i,j);\n\t\t\t\t++i;\n\t\t\t}\n\t\t}\n\t\tA.swap(iStart, i - 1);\n\t\treturn i - 1; // return the final position of the pivot\n\t}", "private void deductGamePoints(List<Integer> prevGamePoints) {\n for (int i = 0; i < numAlive; i++) {\n int playerTrickPoints = trickPoints.get(i);\n if (playerTrickPoints < 0) {\n int prevPoints = prevGamePoints.get(i);\n int newPoints = prevPoints + playerTrickPoints;\n \n if (newPoints < 0) {\n // Cannot have negative points\n gamePoints.set(i, 0);\n } else {\n gamePoints.set(i, newPoints);\n }\n }\n }\n }", "private Function<IDancingLinksMatrix, IUpdater> inferBasesEqualities(int pivot) {\n return matrix -> {\n IDancingLinksMatrix m = (IDancingLinksMatrix) matrix;\n int baseVar = m.baseVariableOf(pivot);\n assert baseVar != -1;\n UpdaterList sameVar = new UpdaterList(\"InferBasesEqualities\");\n if (m.isTrue(baseVar)) {\n int firstOffBase = m.firstOffBase(pivot);\n inferThatOtherBaseAreEqualsToThisBase(m, sameVar, pivot, firstOffBase);\n }\n return sameVar;\n };\n }", "private static int partitionAssumingPivotIsLastElement(int arr[], int startIndex, int endIndex) {\n if (startIndex < 0 || endIndex > arr.length - 1) {\n return -1;\n }\n int pivotIndex = endIndex;\n int i = -1; //i holds the index whose left is smaller and right side is bigger than arr[i]\n int pivotVal = arr[pivotIndex];\n for ( int j = startIndex ; j <= endIndex; j++) {\n if (arr[j] > pivotVal && i == -1) {\n i = j;\n continue;\n }\n\n if(arr[j] < pivotVal && j != endIndex && i != -1) {\n swap(arr, i, j);\n i++;\n }\n }\n// shiftRightByOnePosition(arr, i);\n// if (i != -1) {\n// arr[i] = pivotVal;\n// }\n swap(arr, i, pivotIndex);\n return i;\n }", "private void setZero(){\r\n\t for(int i = 0; i < nodes.size(); i++){\r\n\t Node currentNode = nodes.get(i);\r\n\t for (int j = 0; j < currentNode.getEdges().size(); j++){\r\n\t Edge currentEdge = currentNode.getEdge(j);\r\n\t currentEdge.setResidualFlow(currentEdge.getFlow());\r\n\t currentEdge.setFlow(0);\r\n }\r\n }\r\n }", "public static int findPivot(int[] arr) {\n\t int low=0;\n\t int high=arr.length-1;\n\t while(low<high)\n\t {\n\t int mid= (low+high)/2;\n\t if(arr[mid]<arr[high])\n\t {\n\t high=mid;\n\t }\n\t else\n\t {\n\t low=mid+1;\n\t }\n\t }\n\t return arr[low];\n\t }", "private static void sort(int[] arr) {\n\t\tint lesserIndex=-1;\n\t\tint arrLen = arr.length ; \n\t\tfor(int i=0; i<arrLen; i++){\n\t\t\tif(arr[i]<0){\n\t\t\t\tlesserIndex++; \n\t\t\t\tint tmp = arr[lesserIndex]; \n\t\t\t\tarr[lesserIndex] = arr[i];\n\t\t\t\tarr[i] = tmp; \n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tint negBound = lesserIndex+1;\n\t\tint posIndex = negBound;\n\t\t\n\t\tfor(int negIngex = 0;negIngex<negBound && posIndex<arr.length; negIngex+=2, posIndex+=1){\n\t\t\tint tmp = arr[posIndex]; \n\t\t\tarr[posIndex] = arr[negIngex] ; \n\t\t\tarr[negIngex] = tmp ;\n\t\t\tnegBound++;\n\t\t}\n\t\t\n\t\t\n\t\tfor(int a : arr) {\n\t\t\tSystem.out.print(a);\n\t\t}\n\t\t\n\t}", "public static int findPivot(int[] arr) {\n // write your code here\n /*\n - if arr[rhs]<arr[mid] then min-val will lie in rhs\n else if arr[rhs]>arr[mid] then min-val will lie in lhs\n else if(i==j) means we have found the min-val, so return its value.\n */\n int i=0, j = arr.length-1, mid = (i+j)/2;\n while(i<=j) {\n mid = (i+j)/2;\n if(arr[j]<arr[mid])\n i = mid+1;\n else if(arr[j]>arr[mid])\n j = mid;\n else if(i==j)\n return arr[mid];\n }\n return -1;\n }", "private static int partition2 (List<Point> array, int low, int high)\n {\n int pivot = (int) array.get(high).getX(); \n \n int i = (low - 1); // Index of smaller element\n\n for (int j = low; j <= high- 1; j++)\n {\n // If current element is smaller than or\n // equal to pivot\n if (array.get(j).getX() <= pivot)\n {\n i++; // increment index of smaller element\n swap(array, i, j);\n }\n }\n swap(array, i + 1, high);\n return (i + 1);\n }", "public void resetTBPoints () {\n p1TBPoints = 0;\n p2TBPoints = 0;\n }", "@Override\n\tprotected void setUpperBound() {\n\t\t\n\t}", "static void quickSort (double a[], int lo, int hi){\n int i=lo, j=hi;\r\n\t\tdouble h;\r\n double pivot=a[lo];\r\n\r\n // pembagian\r\n do{\r\n while (a[i]<pivot) i++;\r\n while (a[j]>pivot) j--;\r\n if (i<=j)\r\n {\r\n h=a[i]; a[i]=a[j]; a[j]=h;//tukar\r\n i++; j--;\r\n }\r\n } while (i<=j);\r\n\r\n // pengurutan\r\n if (lo<j) quickSort(a, lo, j);\r\n if (i<hi) quickSort(a, i, hi);\r\n }", "int partition( int low, int high)\n {\n\n String pivotString = this.postList.get(high).getTotalTime();\n int pivot = Integer.parseInt(pivotString);\n\n int i = (low-1); // index of smaller element\n for (int j=low; j<high; j++)\n {\n // If current element is smaller than or\n // equal to pivot\n String jString = this.postList.get(j).getTotalTime();\n int jValue = Integer.parseInt(jString);\n\n if ( jValue > pivot)\n {\n i++;\n\n // swap arr[i] and arr[j]\n\n\n Post temp = this.postList.get(i);\n this.postList.set(i,this.postList.get(j));\n this.postList.set(j,temp);\n }\n }\n\n // swap arr[i+1] and arr[high] (or pivot)\n Post temp = this.postList.get(i+1);\n //int temp = arr[i+1];\n this.postList.set(i+1,this.postList.get(high));\n this.postList.set(high,temp);\n\n return i+1;\n }", "private int choosePivot(int leftPos, int rightPos)\n {\n // iden \n int midPos = (leftPos+rightPos)/2;\n\n int firstCode = cardAry[leftPos].hashCode();\n int midCode = cardAry[midPos].hashCode(); \n int lastCode = cardAry[rightPos].hashCode();\n\n int medianCode = pickMedian(firstCode,midCode,lastCode);\n\n this.nqSortComparisons+=4;\n if( medianCode==firstCode)\n return leftPos;\n if(medianCode==midCode)\n return midPos;\n\n return rightPos; \n }", "@VTID(15)\n com.exceljava.com4j.excel.SlicerPivotTables getPivotTables();", "private static int partition(int[] arr, int low, int high) {\n int pivot = arr[high];\n int temp;\n int partitionIndex = low - 1;\n for (int k = low; k < high; k++) {\n if (arr[k] < pivot) {\n partitionIndex++;\n //swap if index are not same, so as avoid redundant swaps\n swap(arr, partitionIndex, k);\n }\n }\n //swap pivot to correct position\n swap(arr, partitionIndex + 1, high);\n // return correct pivot index\n LOGGER.info(\"Placeed pivot {} : position {}\", arr[partitionIndex + 1], partitionIndex + 1);\n return partitionIndex + 1;\n }", "private static String[] BackSub(Matrix REF){\r\n\t\t// Start at bottom right of Matrix -1 to offset starting from index 0\r\n\t\t// Track two index\r\n\t\t// [1, 2, 3| 1] \r\n\t\t// [1, 2, 3| 1] \r\n\t\t// [1, 2, 3| 1] < (rowPoint, augmentY)\r\n\t\t//\t\t ^\r\n\t\t//(rowPoint, colPoint)\r\n\t\t//\t REF.col\r\n\t\t// ------------\r\n\t\t// [ ] |\r\n\t\t// [ ] | REF.row\r\n\t\t// [ ] |\r\n\t\tint rowPoint = REF.row() - 1;\r\n\t\tint colPoint = REF.col() - 2;\r\n\t\tint augmentY = REF.col() - 1;\r\n\t\tDouble[][] REFval = REF.getAll();\r\n\t\t// if matrix inconsistent the last rows will look like [0,...,0| 1]\r\n\t\tif (REFval[rowPoint][colPoint] == 0 && REFval[rowPoint][augmentY] != 0) {\r\n\t\t\treturn null;\r\n\t\t}else {\r\n\t\t\tString[] Solution = new String[REF.col - 1];\r\n\t\t\t// find first pivot\r\n\t\t\t// we now have form ax + b + .. + c = d\r\n\t\t\t// x = (d - b - .. - c)/a\r\n\t\t\twhile (rowPoint >= 0) {\r\n\t\t\t\tDouble[] row = REFval[rowPoint];\r\n\t\t\t\tMatrix.processRow(Solution, row);\r\n\t\t\t\trowPoint--;\r\n\t\t\t}\r\n\t\t\treturn Solution;\r\n\t\t}\r\n\t}", "public int getLowerBound ();", "public void narrowRange(int min, int max, Boolean axis) {\n\t\tint counter=0; // how much points we erasing total ?\n\t\tboolean erasingAll=false; // if we eventually erasing all the database\n\t\t// by axis X-----------------------------------------//\n\t\tif (axis){ \n\t\t\tthis.current = this.minx;\n\t\t\twhile (!erasingAll && this.current.getData().getX()<min){\n\t\t\t\tnarrowOppPoint(this.current,axis); // deleting this point in y axis\n\t\t\t\tthis.current = this.current.getNextX(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setPrevX(null);\n\t\t\tthis.minx = this.current; // the actual erasing\n\t\t\t//---//\n\t\t\tthis.current = this.maxx;\n\t\t\twhile (!erasingAll && this.current.getData().getX() > max){\n\t\t\t\tnarrowOppPoint(this.current,axis);\n\t\t\t\tthis.current = this.current.getPrevX(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setNextX(null);\n\t\t\tthis.maxx = this.current; //the actual erasing\n\t\t}\n\t\t// by axis Y -----------------------------------------------------------//\n\t\telse{ \n\t\t\tthis.current = this.miny;\n\t\t\twhile (!erasingAll && this.current.getData().getY()<min){\n\t\t\t\tnarrowOppPoint(this.current,axis);\n\t\t\t\tthis.current = this.current.getNextY(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setPrevY(null);\n\t\t\tthis.miny = this.current; //the actual erasing\n\t\t\t//--//\n\t\t\tthis.current = this.maxy;\n\t\t\twhile (!erasingAll && this.current.getData().getY() > max){\n\t\t\t\tnarrowOppPoint(this.current,axis);\n\t\t\t\tthis.current = this.current.getPrevY(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setNextY(null);\n\t\t\tthis.maxy = this.current; //the actual erasing\n\t\t}\n\t\tthis.size = this.size - counter; // Update the size of the DS\n\t}", "public void initialiseExtremeValues() {\n for (int i = 0; i < numberOfObj; i++) {\n minimumValues[i] = Double.MAX_VALUE;\n maximumValues[i] = -Double.MAX_VALUE;\n }\n }", "public abstract double[] getLowerBound();", "static int findMissingPositive(int arr[], int size)\n {\n int i;\n for(i = 0; i < size; i++)\n {\n if(Math.abs(arr[i]) - 1 < size && arr[Math.abs(arr[i]) - 1] > 0)\n arr[Math.abs(arr[i]) - 1] = -arr[Math.abs(arr[i]) - 1];\n }\n // Return the first index value at which is positive \n for(i = 0; i < size; i++)\n if (arr[i] > 0)// 1 is added because indexes start from 0 \n return i+1;\n return size+1;\n }", "public void prune(double belowThreshold) {\n \n for(T first : getFirstDimension()) {\n \n for(T second : getMatches(first)) {\n \n if(get(first, second)<belowThreshold) {\n set(first, second, 0.0);\n }\n \n }\n \n }\n \n }", "private static void zero(int[] x)\n {\n for (int i = 0; i != x.length; i++)\n {\n x[i] = 0;\n }\n }", "private int deadZone(int value, int minValue)\n\t{\n\t\tif (Math.abs(value) < minValue) value = 0;\n\t\t\n\t\treturn value;\n\t}", "public int currentFirstIndexSetRelativeToZero() {\n return calculateIndexRelativeToZero(currentFirstIndexSet());\n }", "public float getDistanceToLeftPivot() {\n return leftDist;\n }", "private void sort(T[] arr, int lo, int hi) {\n if (lo >= hi) return; // we return if the size of the part equals 1\n int pivot = partition(arr, lo, hi); // receiving the index of the pivot element\n sort(arr, lo, pivot - 1); // sorting the left part\n sort(arr, pivot + 1, hi); // sorting the right part\n }", "private int pour(int left, int right, int max) {\r\n int fill = max-right;\r\n if(left<=fill) {\r\n return left;\r\n }else {\r\n return fill;\r\n }\r\n }", "private int getRelativeRow() {\n\t\treturn direction == OUT ? -row : row;\n\t}" ]
[ "0.5319276", "0.5301632", "0.52926373", "0.5253565", "0.5236052", "0.52118933", "0.5157639", "0.51568246", "0.51560664", "0.50840497", "0.50470376", "0.501451", "0.5008219", "0.49830046", "0.49643847", "0.49540523", "0.49300975", "0.49282306", "0.4915142", "0.4868144", "0.4861407", "0.48540968", "0.48454094", "0.48432198", "0.48420504", "0.48416358", "0.4833445", "0.4812159", "0.4763114", "0.47629935", "0.47412488", "0.47379306", "0.47226775", "0.47120795", "0.4710213", "0.4697762", "0.4674392", "0.46637553", "0.46627358", "0.4650529", "0.46462855", "0.46331224", "0.46267813", "0.46184433", "0.46058795", "0.46053156", "0.4600372", "0.45991582", "0.45947537", "0.4584968", "0.45806614", "0.4578598", "0.45513546", "0.45412627", "0.45390195", "0.45348606", "0.45341727", "0.4530686", "0.452985", "0.45265174", "0.45253655", "0.45196593", "0.45148456", "0.45044276", "0.4499872", "0.44981384", "0.4495789", "0.44955033", "0.44939196", "0.44905478", "0.4487926", "0.44870973", "0.44831946", "0.4480592", "0.44731757", "0.44713542", "0.44705695", "0.44675198", "0.44659585", "0.44651437", "0.4462886", "0.4460808", "0.44574028", "0.44545177", "0.4441696", "0.44411743", "0.443919", "0.44356972", "0.44347778", "0.44343218", "0.44339418", "0.44335955", "0.4427803", "0.4425728", "0.442229", "0.44179422", "0.44140428", "0.4413251", "0.441092", "0.44097024" ]
0.6292645
0
do all necessary row operations to complete all steps on one column
public static void solveColumn(float[][] matrix, int column, int dimension){ System.out.print("Working on column " + (column+1) + " now\n\n"); checkPivot(matrix, column, dimension); // make sure the entry where we want the pivot is non-zero divideRow(matrix, column, dimension); // divide the row by the value we want to make a pivot zeroOutValuesAboveAndBelowThePivot(matrix, column, dimension); // zero'ing out everything about and below the pivot }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void populateDynamicCells(int resultsRow) {\n }", "private void transformRows() {\n this.rowCounts = this.rowDeduplicator.values().toIntArray();\n }", "public void doStep() {\n\t\ttry {\n\t\t\tLifeMatrix newMatrix = new LifeMatrix(_numRows, _numColumns);\n\t\t\tfor (int row=0; row<_numRows; ++row) {\n\t\t\t\tfor (int column=0; column<_numColumns; ++column) {\n\t\t\t\t\tupdateCell(_matrix, newMatrix, row, column);\n\t\t\t\t}\n\t\t\t}\n\t\t\t_matrix = newMatrix; // update to the new matrix (the old one is discarded)\n\t\t} catch (Exception e) {\n\t\t\t// This is not supposed to happend because we use only legal row and column numbers\n\t\t\tSystem.out.println(\"Unexpected Error in doStep()\");\n\t\t}\n\t}", "private void Step() {\n\t\tif (numberOfColumns == currentCycle) {\n\t\t\treturn;\n\t\t}\n\t\tif (numberOfRows != 1) {\n\n\t\t\tstall = 0;\n\t\t\tx = 0;\n\n\t\t\twhile (x < numberOfRows) {\n\t\t\t\tif (lstInstructionsPipeLine.get(x).issue_cycle == null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (stall == 1) {\n\t\t\t\t\tDisplay_Stall(x, currentCycle);\n\t\t\t\t} else {\n\t\t\t\t\tswitch (lstInstructionsPipeLine.get(x).pipeline_stage) {\n\n\t\t\t\t\tcase \"IF\":\n\t\t\t\t\t\tlstInstructionsPipeLine.get(x).pipeline_stage = \"ID\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"ID\":\n\t\t\t\t\t\tfor (int i = (x - 1); i >= 0; i--) {\n\n\t\t\t\t\t\t\tif (lstInstructionsPipeLine.get(i).pipeline_stage.equals(\"EX\")\n\t\t\t\t\t\t\t\t\t&& lstInstructionsPipeLine.get(i).operator.functional_unit\n\t\t\t\t\t\t\t\t\t\t\t.equals(lstInstructionsPipeLine.get(x).operator.functional_unit)) {\n\t\t\t\t\t\t\t\t// *** Structural Hazard ***\n\t\t\t\t\t\t\t\tstall = 1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\telse if ((lstInstructionsPipeLine.get(i).destination_register\n\t\t\t\t\t\t\t\t\t.equals(lstInstructionsPipeLine.get(x).source_register1)\n\t\t\t\t\t\t\t\t\t|| lstInstructionsPipeLine.get(i).destination_register\n\t\t\t\t\t\t\t\t\t\t\t.equals(lstInstructionsPipeLine.get(x).source_register2))) {\n\t\t\t\t\t\t\t\tif (dataForwarding == 1) {\n\n\t\t\t\t\t\t\t\t\tif (lstInstructionsPipeLine.get(i).operator.name.equals(\"ld\")\n\t\t\t\t\t\t\t\t\t\t\t|| lstInstructionsPipeLine.get(i).operator.name.equals(\"sd\")) {\n\t\t\t\t\t\t\t\t\t\tif (!lstInstructionsPipeLine.get(i).pipeline_stage.equals(\"WB\")\n\t\t\t\t\t\t\t\t\t\t\t\t&& !lstInstructionsPipeLine.get(i).pipeline_stage.equals(\" \")) {\n\t\t\t\t\t\t\t\t\t\t\t// ** RAW Hazard **\n\t\t\t\t\t\t\t\t\t\t\tstall = 1;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tif (!lstInstructionsPipeLine.get(i).pipeline_stage.equals(\"MEM\")\n\t\t\t\t\t\t\t\t\t\t\t\t&& !lstInstructionsPipeLine.get(i).pipeline_stage.equals(\"WB\")\n\t\t\t\t\t\t\t\t\t\t\t\t&& !lstInstructionsPipeLine.get(i).pipeline_stage.equals(\" \")) {\n\t\t\t\t\t\t\t\t\t\t\t// *** RAW Hazard **\n\t\t\t\t\t\t\t\t\t\t\tstall = 1;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\telse if (dataForwarding == 0) {\n\t\t\t\t\t\t\t\t\t// If forwarding is disabled and the\n\t\t\t\t\t\t\t\t\t// previous instruction is not completed,\n\t\t\t\t\t\t\t\t\t// stall.\n\t\t\t\t\t\t\t\t\tif (!lstInstructionsPipeLine.get(i).pipeline_stage.equals(\" \")) {\n\t\t\t\t\t\t\t\t\t\t// *** RAW Hazard **\n\t\t\t\t\t\t\t\t\t\tstall = 1;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\telse if ((lstInstructionsPipeLine.get(i).destination_register\n\t\t\t\t\t\t\t\t\t.equals(lstInstructionsPipeLine.get(x).destination_register))\n\t\t\t\t\t\t\t\t\t&& (!lstInstructionsPipeLine.get(i).destination_register.equals(\"null\"))) {\n\n\t\t\t\t\t\t\t\tif ((lstInstructionsPipeLine.get(i).pipeline_stage.equals(\"EX\"))\n\t\t\t\t\t\t\t\t\t\t&& ((lstInstructionsPipeLine.get(i).operator.execution_cycles\n\t\t\t\t\t\t\t\t\t\t\t\t- lstInstructionsPipeLine\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.get(i).execute_counter) >= (lstInstructionsPipeLine\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.get(x).operator.execution_cycles - 1))) {\n\t\t\t\t\t\t\t\t\t// *** WAW Hazard ***\n\t\t\t\t\t\t\t\t\tstall = 1;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\telse if ((lstInstructionsPipeLine.get(i).pipeline_stage.equals(\"EX\"))\n\t\t\t\t\t\t\t\t\t&& ((lstInstructionsPipeLine.get(i).operator.execution_cycles\n\t\t\t\t\t\t\t\t\t\t\t- lstInstructionsPipeLine\n\t\t\t\t\t\t\t\t\t\t\t\t\t.get(i).execute_counter) == (lstInstructionsPipeLine\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.get(x).operator.execution_cycles - 1))) {\n\n\t\t\t\t\t\t\t\t// *** WB will happen at the same time ***\n\t\t\t\t\t\t\t\tstall = 1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (stall != 1) {\n\t\t\t\t\t\t\tif (lstInstructionsPipeLine.get(x).operator.name == \"br_taken\") {\n\t\t\t\t\t\t\t\tlstInstructionsPipeLine.get(x).pipeline_stage = \" \";\n\t\t\t\t\t\t\t\tlstInstructionsPipeLine.get(x).execute_counter++;\n\t\t\t\t\t\t\t\tif ((x + 1) < numberOfRows) {\n\t\t\t\t\t\t\t\t\tlstInstructionsPipeLine.get(x + 1).pipeline_stage = \" \";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Complete the execution of the branch.\n\t\t\t\t\t\t\telse if (lstInstructionsPipeLine.get(x).operator.name == \"br_untaken\") {\n\t\t\t\t\t\t\t\tlstInstructionsPipeLine.get(x).pipeline_stage = \" \";\n\t\t\t\t\t\t\t\tlstInstructionsPipeLine.get(x).execute_counter++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Move the instruction into the EX stage.\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tlstInstructionsPipeLine.get(x).pipeline_stage = \"EX\";\n\t\t\t\t\t\t\t\tlstInstructionsPipeLine.get(x).execute_counter++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"EX\":\n\t\t\t\t\t\tif (lstInstructionsPipeLine\n\t\t\t\t\t\t\t\t.get(x).execute_counter < lstInstructionsPipeLine.get(x).operator.execution_cycles) {\n\t\t\t\t\t\t\tlstInstructionsPipeLine.get(x).pipeline_stage = \"EX\";\n\t\t\t\t\t\t\tlstInstructionsPipeLine.get(x).execute_counter++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlstInstructionsPipeLine.get(x).pipeline_stage = \"MEM\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"MEM\":\n\t\t\t\t\t\tlstInstructionsPipeLine.get(x).pipeline_stage = \"WB\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"WB\":\n\t\t\t\t\t\tlstInstructionsPipeLine.get(x).pipeline_stage = \" \";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \" \":\n\t\t\t\t\t\tlstInstructionsPipeLine.get(x).pipeline_stage = \" \";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tJOptionPane.showMessageDialog(new JFrame(), \"Unrecognized Pipeline Stage!\", \"Dialog\",\n\t\t\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (stall == 1) {\n\t\t\t\t\t\tDisplay_Stall(x, currentCycle);\n\t\t\t\t\t} else if (lstInstructionsPipeLine.get(x).pipeline_stage == \"EX\") {\n\t\t\t\t\t\tSystem.out.println(lstInstructionsPipeLine.get(x).operator.display_value + \" - row=\" + x\n\t\t\t\t\t\t\t\t+ \" col=\" + currentCycle);\n\t\t\t\t\t\tJPanel pnl_EXE_tmp = new JPanel();\n\t\t\t\t\t\tpnl_EXE_tmp.setBackground(col_EXE);\n\t\t\t\t\t\tpnl_EXE_tmp.setBounds(currentCycle * 40 + (50 + 100), x * 20 + 20, 40, 20);// (w+row_x)\n\t\t\t\t\t\tpanelShowResult.add(pnl_EXE_tmp);\n\t\t\t\t\t\tJLabel lblExe_tmp = new JLabel(lstInstructionsPipeLine.get(x).operator.display_value);\n\t\t\t\t\t\tpnl_EXE_tmp.add(lblExe_tmp);\n\t\t\t\t\t\tpanelShowResult.revalidate();\n\t\t\t\t\t\tpanelShowResult.repaint();\n\n\t\t\t\t\t\tmapAnswer.put(\"txt_\" + currentCycle + \"_\" + x,\"EX\");/// k,v\n\t\t\t\t\t}\n\t\t\t\t\t// Output the pipeline stage.\n\t\t\t\t\telse {\n\t\t\t\t\t\tJPanel pnl_tmp = new JPanel();\n\t\t\t\t\t\tswitch (lstInstructionsPipeLine.get(x).pipeline_stage) {\n\t\t\t\t\t\tcase \"ID\":\n\t\t\t\t\t\t\tpnl_tmp.setBackground(col_ID);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"MEM\":\n\t\t\t\t\t\t\tpnl_tmp.setBackground(col_MEM);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"WB\":\n\t\t\t\t\t\t\tpnl_tmp.setBackground(col_WB);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// pnl_tmp.setBackground(col_EXE);\n\t\t\t\t\t\tpnl_tmp.setBounds(currentCycle * 40 + (50 + 100), x * 20 + 20, 40, 20);// (w+row_x)\n\t\t\t\t\t\tpanelShowResult.add(pnl_tmp);\n\t\t\t\t\t\tJLabel lbl_tmp = new JLabel(lstInstructionsPipeLine.get(x).pipeline_stage);\n\t\t\t\t\t\tpnl_tmp.add(lbl_tmp);\n\t\t\t\t\t\tpanelShowResult.revalidate();\n\t\t\t\t\t\tpanelShowResult.repaint();\n\n\t\t\t\t\t\tmapAnswer.put(\"txt_\" + currentCycle + \"_\" + x, lstInstructionsPipeLine.get(x).pipeline_stage);/// k\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/// ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/// v\n\n\t\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\tlstInstructionsPipeLine.get(x).pipeline_stage + \" - row=\" + x + \" col=\" + currentCycle);\n\t\t\t\t\t}\n\t\t\t\t\t;\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"x:\" + x);\n\t\t\t\tx++;\n\t\t\t} // End of while loop\n\n\t\t\tif (stall != 1 && x < numberOfRows) {\n\t\t\t\t// Issue a new instruction.\n\t\t\t\tlstInstructionsPipeLine.get(x).issue_cycle = Integer.toString(currentCycle);\n\t\t\t\tlstInstructionsPipeLine.get(x).pipeline_stage = \"IF\";\n\t\t\t\tJPanel pnl_IF_tmp = new JPanel();\n\t\t\t\tpnl_IF_tmp.setBackground(col_IF);\n\t\t\t\tpnl_IF_tmp.setBounds(currentCycle * 40 + (50 + 100), x * 20 + 20, 40, 20);// (w+row_x)\n\t\t\t\tpanelShowResult.add(pnl_IF_tmp);\n\t\t\t\tJLabel lblIF_tmp = new JLabel(lstInstructionsPipeLine.get(x).pipeline_stage);\n\t\t\t\tpnl_IF_tmp.add(lblIF_tmp);\n\t\t\t\tpanelShowResult.revalidate();\n\t\t\t\tpanelShowResult.repaint();\n\t\t\t\tmapAnswer.put(\"txt_\" + currentCycle + \"_\" + x, lstInstructionsPipeLine.get(x).pipeline_stage);/// k\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/// ,v\n\n\t\t\t\tSystem.out.println(\n\t\t\t\t\t\tlstInstructionsPipeLine.get(x).pipeline_stage + \" - row=\" + x + \" col=\" + currentCycle);\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Clk:\" + currentCycle);\n\t\t\tcurrentCycle++;\n\t\t} else {\n\n\t\t\tif (currentCycle == 0) {\n\t\t\t\tlstInstructionsPipeLine.get(0).issue_cycle = Integer.toString(currentCycle);\n\t\t\t\tlstInstructionsPipeLine.get(0).pipeline_stage = \"IF\";\n\t\t\t\tJPanel pnl_IF_tmp = new JPanel();\n\t\t\t\tpnl_IF_tmp.setBackground(col_IF);\n\t\t\t\tpnl_IF_tmp.setBounds(x * 40 + x, currentCycle * 20 + (20), 40, 20);// (w+row_x)\n\t\t\t\tpanelShowResult.add(pnl_IF_tmp);\n\t\t\t\tJLabel lblIF_tmp = new JLabel(lstInstructionsPipeLine.get(0).getPipeline_stage());\n\t\t\t\tpnl_IF_tmp.add(lblIF_tmp);\n\t\t\t\tpanelShowResult.revalidate();\n\t\t\t\tpanelShowResult.repaint();\n\t\t\t\tmapAnswer.put(\"txt_\" + currentCycle + \"_\" + x, lstInstructionsPipeLine.get(0).pipeline_stage);/// k\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/// ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/// v\n\n\t\t\t\tSystem.out.println(\n\t\t\t\t\t\tlstInstructionsPipeLine.get(0).pipeline_stage + \" - row=\" + x + \" col=\" + currentCycle);\n\t\t\t\tSystem.out.println(\"Clk:\" + currentCycle);\n\t\t\t\tcurrentCycle++;\n\t\t\t} else {\n\t\t\t\tswitch (lstInstructionsPipeLine.get(0).pipeline_stage) {\n\t\t\t\tcase \"IF\":\n\t\t\t\t\tlstInstructionsPipeLine.get(0).pipeline_stage = \"ID\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"ID\":\n\n\t\t\t\t\t// If branch is taken, complete this instruction.\n\t\t\t\t\tif (lstInstructionsPipeLine.get(0).operator.name.substring(0, 2) == \"br\") {\n\t\t\t\t\t\tlstInstructionsPipeLine.get(0).pipeline_stage = \" \";\n\t\t\t\t\t\tlstInstructionsPipeLine.get(0).execute_counter++;\n\t\t\t\t\t}\n\t\t\t\t\t// Move the instruction into the EX stage.\n\t\t\t\t\telse {\n\t\t\t\t\t\tlstInstructionsPipeLine.get(0).pipeline_stage = \"EX\";\n\t\t\t\t\t\tlstInstructionsPipeLine.get(0).execute_counter++;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"EX\":\n\t\t\t\t\t// If the instruction hasn't completed.\n\t\t\t\t\tif (lstInstructionsPipeLine\n\t\t\t\t\t\t\t.get(0).execute_counter < lstInstructionsPipeLine.get(0).operator.execution_cycles) {\n\t\t\t\t\t\tlstInstructionsPipeLine.get(0).pipeline_stage = \"EX\";\n\t\t\t\t\t\tlstInstructionsPipeLine.get(0).execute_counter++;\n\t\t\t\t\t}\n\t\t\t\t\t// Move the instruction to the MEM stage.\n\t\t\t\t\telse {\n\t\t\t\t\t\tlstInstructionsPipeLine.get(0).pipeline_stage = \"MEM\";\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"MEM\":\n\t\t\t\t\tlstInstructionsPipeLine.get(0).pipeline_stage = \"WB\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"WB\":\n\t\t\t\t\tlstInstructionsPipeLine.get(0).pipeline_stage = \" \";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \" \":\n\t\t\t\t\tlstInstructionsPipeLine.get(0).pipeline_stage = \" \";\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tJOptionPane.showMessageDialog(new JFrame(), \"Unrecognized Pipeline Stage!\", \"Dialog\",\n\t\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t\t\t}\n\n\t\t\t\t// If the instruction is in the EX stage, display the functional\n\t\t\t\t// unit.\n\t\t\t\tif (lstInstructionsPipeLine.get(0).pipeline_stage == \"EX\") {\n\t\t\t\t\tJPanel pnl_IF_tmp = new JPanel();\n\t\t\t\t\tpnl_IF_tmp.setBackground(col_EXE);\n\t\t\t\t\tpnl_IF_tmp.setBounds(x * 40 + x, currentCycle * 20 + (20), 40, 20);// (w+row_x)\n\t\t\t\t\tpanelShowResult.add(pnl_IF_tmp);\n\t\t\t\t\tJLabel lblIF_tmp = new JLabel(lstInstructionsPipeLine.get(0).pipeline_stage);\n\t\t\t\t\tpnl_IF_tmp.add(lblIF_tmp);\n\t\t\t\t\tpanelShowResult.revalidate();\n\t\t\t\t\tpanelShowResult.repaint();\n\t\t\t\t\tmapAnswer.put(\"txt_\" + currentCycle + \"_\" + x,\"EX\");/// k\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/// ,v\n\n\t\t\t\t\tSystem.out.println(lstInstructionsPipeLine.get(0).operator.display_value + \" - row=\" + x + \" col=\"\n\t\t\t\t\t\t\t+ currentCycle);\n\t\t\t\t} else {\n\t\t\t\t\tJPanel pnl_IF_tmp = new JPanel();\n\t\t\t\t\tswitch (lstInstructionsPipeLine.get(0).pipeline_stage) {\n\t\t\t\t\tcase \"ID\":\n\t\t\t\t\t\tpnl_IF_tmp.setBackground(col_ID);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"MEM\":\n\t\t\t\t\t\tpnl_IF_tmp.setBackground(col_MEM);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"WB\":\n\t\t\t\t\t\tpnl_IF_tmp.setBackground(col_WB);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// pnl_IF_tmp.setBackground(col_IF);\n\t\t\t\t\tpnl_IF_tmp.setBounds(x * 40 + x, currentCycle * 20 + (20), 40, 20);// (w+row_x)\n\t\t\t\t\tpanelShowResult.add(pnl_IF_tmp);\n\t\t\t\t\tJLabel lblIF_tmp = new JLabel(lstInstructionsPipeLine.get(0).pipeline_stage);\n\t\t\t\t\tpnl_IF_tmp.add(lblIF_tmp);\n\t\t\t\t\tpanelShowResult.revalidate();\n\t\t\t\t\tpanelShowResult.repaint();\n\t\t\t\t\tmapAnswer.put(\"txt_\" + currentCycle + \"_\" + x, lstInstructionsPipeLine.get(x).pipeline_stage);/// k\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/// ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/// v\n\n\t\t\t\t\t// s = \"document.instruction_table.column\" + currentCycle +\n\t\t\t\t\t// \".value =\n\t\t\t\t\t// parent.top_frame.lstInstructions[0].pipeline_stage;\";\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\tlstInstructionsPipeLine.get(0).pipeline_stage + \" - row=\" + x + \" col=\" + currentCycle);\n\t\t\t\t}\n\t\t\t\t// eval(s);\n\t\t\t\tSystem.out.println(\"Clk:\" + currentCycle);\n\t\t\t\tcurrentCycle++;\n\t\t\t}\n\t\t}\n\t}", "protected abstract Object calcJoinRow();", "public void run() {\n runOneColumn( tmeta1_ );\n runSomeColumns( tmeta2_ );\n runJustMeta( tmeta3_ );\n }", "@Override\n\tpublic void populateRowDataAfter(FunctionItem fi) throws Exception {\n\t\t\n\t}", "public void expandCells() {\n\t\t//For the first pollutant create a new set of files\n\t\tString[] pollutants = factorsTable.keySet().toArray(new String[1]);\n\t\t\n\t\t//Now, for each row, we need to expand the total flow for each \n\t\t//type of day and for each hour of the day.\n\t\tdouble[] factorsRow = null;\n\t\tString key = null;\n\t\tfor(String type:types){\n\t\t\ttotalsTable = new TableTotal(0, 83, 84);\n\t\t\ttotalsTable.setLabels(pollutants);\n\t\t\tfor(int i=0;i<nHours;i++){\t\n\t\t\t\tkey = pollutants[0];\n\t\t\t\tfactorsRow = factorsTable.get(key);\n\t\t\t\t//Open the output file\n\t\t\t\tOutputSheet outputSheet =new OutputSheet(outputModel);\n\t\t\t\toutputSheet.setPost(\"_\"+key+\"_\"+type+\"_\"+(i*100));\n\t\t\t\t\n\t\t\t\t//Get iterator to all the rows in current sheet\n\t\t\t\tIterator<Row> rowIterator = cells.iterator();\n\t\t\t\trowIterator.next();//Ignore the column names. We actually know it.\n\t\t\t\tRow row = null;//The current cell\n\t\t\t\t//int k=0;\n\t\t\t\twhile(rowIterator.hasNext()){\n\t\t\t\t\t//System.out.println(k++);\n\t\t\t\t\trow = rowIterator.next();\n\t\t\t\t\tdouble sharedKey = row.getCell(CELLKEY).getNumericCellValue();\n\t\t\t\t\tint fidGrid = (int)row.getCell(CELL_FID_GRID).getNumericCellValue();\n\t\t\t\t\t//double total = row.getCell(CELLQUERY).getNumericCellValue();\n\t\t\t\t\tdouble longitude = row.getCell(CELL_LONGUITUDE).getNumericCellValue();\n\t\t\t\t\t\n\t\t\t\t\tString fullKey = Math.round(sharedKey)+type+i*100;\n\t\t\t\t\tdouble[] values = null;\n\t\t\t\t\tif(tableValues.containsKey(fullKey)){\n\t\t\t\t\t\tvalues = tableValues.get(fullKey);\n\t\t\t\t\t\toutputSheet.push(values, fidGrid, longitude);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toutputSheet.replaceFactors(factorsRow);\n\t\t\t\toutputSheet.save();\n\t\t\t\t//Update the total\n\t\t\t\ttotalsTable.updateTotals(outputSheet.getSheet(), 0);\n\t\t\t\t\n\t\t\t\t//Now, for each other contaminant a new set of files have to be created\n\t\t\t\tfor(int k=pollutants.length-1;k>0;k--){\n\t\t\t\t\tkey=pollutants[k];\n\t\t\t\t\tfactorsRow = factorsTable.get(key);\n\t\t\t\t\toutputSheet.setPost(\"_\"+key+\"_\"+type+\"_\"+(i*100));\n\t\t\t\t\toutputSheet.replaceFactors(factorsRow);\n\t\t\t\t\toutputSheet.save();\n\t\t\t\t\t\n\t\t\t\t\t//Update the total\n\t\t\t\t\ttotalsTable.updateTotals(outputSheet.getSheet(), k);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry {\n\t\t\t\ttotalsTable.save(new File(outputModel.getAbsolutePath().replace(\"output.xlsx\", \"outputTotals_\"+type+\".csv\")));\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"The totals file could not be saved\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void run() {\n CsvParser parser = this.initializeParser();\n\n // Initialize data structures\n String[] firstLine = parser.parseNext();\n List<MutableRoaringBitmap> dataset = new ArrayList<>(firstLine.length);\n for (int i = 0; i < firstLine.length; i++) {\n dataset.add(new MutableRoaringBitmap());\n this.columnPlisMutable = ImmutableList.copyOf(dataset);\n }\n\n // Start parsing the file\n if (this.configuration.isNoHeader()) {\n this.addRow(firstLine);\n } else {\n this.columnIndexToNameMapping = firstLine;\n }\n\n String[] nextRow;\n while ((nextRow = parser.parseNext()) != null) {\n this.addRow(nextRow);\n this.nRows++;\n }\n\n this.transformRows();\n this.transformColumns();\n log.info(\"Deduplicated {} rows to {}, {} columns to {}\", this.nRows, this.nRowsDistinct,\n this.columnPlisMutable.size(), this.columnPlis.size());\n }", "private static void processOneRow(int[] rowSize, String[] values, StringBuilder result, boolean finished){\n\t\t//stopping case \n\t\tif(finished){\n\t\t\treturn; \n\t\t}\n\t\tint done =0; \n\t\t//put everything that fits into result array\n\t\t//and keep track if finished \n\t\tfor(int i =0; i< values.length; i++){\n\t\t\t//if it fits \n\t\t\tif(values[i].length() <= rowSize[i]){\n\t\t\t\t//put padding and then put it result\n\t\t\t\tresult.append(makeCorrectSize(values[i], rowSize[i])); \n\t\t\t\tvalues[i] = \"\"; \t\n\t\t\t\tdone++; \n\t\t\t} else {\t\n\t\t\t\t//if it doesn't fit only put the part that fits and save the rest in array\n\t\t\t\tresult.append(makeCorrectSize(values[i].substring(0,rowSize[i]-2), rowSize[i] ));\n\t\t\t\tvalues[i] = values[i].substring(rowSize[i]-2);\t\n\t\t\t}\n\t\t}\n\t\tresult.append(\"\\n\"); \n\t\tif(done == values.length) finished = true; \t\n\t\t//recurse\n\t\tprocessOneRow(rowSize, values, result, finished); \n\t}", "public void harvestRow()\n {\n this.hopAndPick();\n this.hop();\n this.plant();\n this.hopAndPick();\n this.hop();\n this.plant();\n this.hopAndPick();\n this.hop();\n this.plant();\n }", "private void multiLeafUpdate()\r\n {\n \t\tfor (int i=0;i<this.allCols.size();i++)\r\n \t{\r\n \t\t\tif (this.allCols.get(i).endsWith(HEADER))\r\n \t\t\t{\r\n \t\t\t\tString headerCol=this.allCols.get(i);\r\n \t\t\t\tString col=this.allCols.get(i).replace(HEADER, \"\");\r\n \t\t\t\t\r\n \t\t\t\tthis.requete.append(\"\\n UPDATE \"+this.tempTableA+\" SET i_\"+headerCol+\"=i_\"+col+\" WHERE i_\"+headerCol+\" IS NULL and i_\"+col+\" IS NOT NULL;\");\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n }", "private void endRow() throws TableFormatException {\n if ( readCol == 0 ) {\n return;\n }\n int nrow = rows.size();\n if ( nrow == 1 ) {\n ncol = ((List) rows.get( 0 )).size();\n }\n else if ( readCol != ncol ) {\n throw new TableFormatException( \n \"Column number mismatch in row \" + ( nrow - 1 ) +\n \" (\" + readCol + \" != \" + ncol + \")\" );\n }\n readCol = 0;\n }", "@Override\n protected void moveToNextRow(){\n incrementRow();\n resetXPos();\n if(getRow()%2 == 1){\n incrementYPos(getHeight()+getHeight());\n }\n resetCol();\n setPointDirection();\n }", "private void doFirstRow(){\n\t\twhile (frontIsClear()){\n\t\t\talternateBeeper();\n\t\t}\n\t\tcheckPreviousSquare();\n\t}", "void row_Modify(String[] col, int row_id){\n\t\tString values=\"\";\n\t\tStatement stm=null;\n\t\t//Change tuple by executing SQL command\n\t\tfor(int i=1;i<colNum;i++){\n\t\t\tif(col[i]!=\"\"){\n\t\t\t\tif(i!=1 && values!=\"\") values+=\", \";\n\t\t\t\tif(i==1) values+=\"Type='\"+col[i]+\"' \";\n\t\t\t\telse if(i==2) values+=\"Address='\"+col[i]+\"' \";\n\t\t\t\telse if(i==3) values+=\"City='\"+col[i]+\"' \";\n\t\t\t\telse if(i==4) values+=\"State='\"+col[i]+\"' \";\n\t\t\t\telse if(i==5) values+=\"Zip='\"+col[i]+\"' \";\n\t\t\t\telse if(i==6) values+=\"Price=\"+col[i]+\" \";\n\t\t\t\telse if(i==7) values+=\"Beds=\"+col[i]+\" \";\n\t\t\t\telse if(i==8) values+=\"Baths=\"+col[i]+\" \";\n\t\t\t\telse if(i==9) values+=\"SQFT=\"+col[i]+\" \";\n\t\t\t\telse if(i==10) values+=\"Year_built=\"+col[i]+\" \";\n\t\t\t\telse if(i==11) values+=\"Parking_spot=\"+col[i]+\" \";\n\t\t\t\telse if(i==12) values+=\"Days_on_market=\"+col[i]+\" \";\n\t\t\t\telse if(i==13) values+=\"Status='\"+col[i]+\"' \";\n\t\t\t\telse if(i==14) values+=\"Agency='\"+col[i]+\"' \";\n\t\t\t\t\n\t\t\t}\n\t\t}//end of for loop\n\t\t\n\t\tif(values!=\"\"){\n\t\t String sql=\"update \"+tableName+\" set \"+values+\" where id=\"+row_id;\n\t\t System.out.println(\"sql: \"+sql); \n\t\t try{\n\t\t \t stm=con.createStatement(); \n\t\t \t stm.executeUpdate(sql);\n\t\t \t //Append SQL command and time stamp on log file\n\t\t \t outfile.write(\"TIMESTAMP: \"+getTimestamp());\n\t\t\t\t outfile.newLine();\n\t\t\t\t outfile.write(sql);\n\t\t\t\t outfile.newLine();\n\t\t\t\t outfile.newLine();\n\t\t\t //Catch SQL exception\t \n\t\t }catch (SQLException e ) {\n\t\t \t e.printStackTrace();\n\t\t //Catch I/O exception \t \n\t\t }catch(IOException ioe){ \n\t\t \t ioe.printStackTrace();\n\t\t } finally {\n\t\t \t try{\n\t\t if (stm != null) stm.close(); \n\t\t }\n\t\t \t catch (SQLException e ) {\n\t\t \t\t e.printStackTrace();\n\t\t\t }\n\t\t }\t\n\t\t}\n\t}", "private void advanceRow(){\n\t\tfaceBackwards();\n\t\twhile(frontIsClear()){\n\t\t\tmove();\n\t\t}\n\t\tturnRight();\n\t\tif(frontIsClear()){\n\t\t\tmove();\n\t\t\tturnRight();\n\t\t}\n\t}", "public void expandAll() {\n\t\tint row = 0;\n\t\twhile (row < super.getRowCount()) {\n\t\t\tsuper.expandRow(row);\n\t\t\trow++;\n\t\t}\n\t}", "void fill(Row row) {\n if (row == null) return;\n for (Column column : getColumns()) {\n String name = column.getName();\n Object value = row.get(name);\n Classes.setFieldValue(this, name, value);\n }\n }", "void calculateLobColumnPositionsForRow() {\n int currentPosition = 0;\n\n for (int i = 0; i < columns_; i++) {\n if ((isNonTrivialDataLob(i))\n && (locator(i + 1) == -1)) // Lob.INVALID_LOCATOR))\n // key = column position, data = index to corresponding data in extdtaData_\n // ASSERT: the server always returns the EXTDTA objects in ascending order\n {\n extdtaPositions_.put(i + 1, currentPosition++);\n }\n }\n }", "public void traspose() {\n for (int row = 0; row < this.numberOfRows(); row++) {\n for (int col = row; col < this.numberOfCols(); col++) {\n double value = this.get(row, col);\n this.set(row, col, this.get(col, row));\n this.set(col, row, value);\n }\n }\n }", "private void setValuesForTheColumn(ColumnValueAnalysisResult result,\n Tuple next, Integer columnOrder) throws ExecException {\n/*\n\t\t\"StarCount\",\t//0\n\t\t\t\t\"Count\",\t\t//1\n\t\t\t\t\"Null\",\t\t\t//2\n\t\t\t\t\"Zero\",\t\t\t//3\n\t\t\t\t\"Positive\",\t\t//4\n\t\t\t\t\"Negative\",\t\t//5\n\t\t\t\t\"Sum\",\t\t\t//6\n\t\t\t\t\"Distinct\",\t\t//7\n\t\t\t\t\"Min\",\t\t\t//8\n\t\t\t\t\"25%\",\t\t\t//9\n\t\t\t\t\"50%\",\t\t\t//10\n\t\t\t\t\"75%\",\t\t\t//11\n\t\t\t\t\"Max\",\t\t\t//12\n\t\t\t\t\"Mean\"\t\t\t// 13\n\t\t*/\n result.setNullCount(null==next.get(columnOrder+2)?0:DataType.toLong(next.get(columnOrder+2)));\n result.setCount(null==next.get(columnOrder+1)?0:DataType.toLong(next.get(columnOrder+1)));\n result.setMax(null==next.get(columnOrder+12)?0:DataType.toDouble(next.get(columnOrder+12)));\n result.setMin(null==next.get(columnOrder+8)?0:DataType.toDouble(next.get(columnOrder+8)));\n result.setPositiveValueCount(null==next.get(columnOrder+4)?0:DataType.toLong(next.get(columnOrder+4)));\n result.setNegativeValueCount(null==next.get(columnOrder+5)?0:DataType.toLong(next.get(columnOrder+5)));\n result.setZeroCount(null==next.get(columnOrder+3)?0:DataType.toLong(next.get(columnOrder+3)));\n result.setUniqueValueCount(null==next.get(columnOrder+7)?0:DataType.toLong(next.get(columnOrder+7)));\n\t\tresult.setQ1(null == next.get(columnOrder + 9) ? 0 : DataType.toDouble(next.get(columnOrder + 9)));\n\t\tresult.setMedian(null == next.get(columnOrder + 10) ? 0 : DataType.toDouble(next.get(columnOrder + 10)));\n\t\tresult.setQ3(null == next.get(columnOrder + 11) ? 0 : DataType.toDouble(next.get(columnOrder + 11)));\n\t\tresult.setAvg((null==next.get(columnOrder+6)?0:DataType.toDouble(next.get(columnOrder+6)))/\n (null==next.get(columnOrder+1)?0:DataType.toDouble(next.get(columnOrder+1))));\n\n\t\tresult.setTop01Value(null == next.get(columnOrder + 14) ? 0 : (next.get(columnOrder + 14)));\n\t\tresult.setTop01Count(null == next.get(columnOrder + 15) ? 0 : DataType.toLong(next.get(columnOrder + 15)));\n\t\tresult.setTop02Value(null == next.get(columnOrder + 16) ? 0 : (next.get(columnOrder + 16)));\n\t\tresult.setTop02Count(null == next.get(columnOrder + 17) ? 0 : DataType.toLong(next.get(columnOrder + 17)));\n\t\tresult.setTop03Value(null == next.get(columnOrder + 18) ? 0 : (next.get(columnOrder + 18)));\n\t\tresult.setTop03Count(null == next.get(columnOrder + 19) ? 0 : DataType.toLong(next.get(columnOrder + 19)));\n\t\tresult.setTop04Value(null == next.get(columnOrder + 20) ? 0 : (next.get(columnOrder + 20)));\n\t\tresult.setTop04Count(null == next.get(columnOrder + 21) ? 0 : DataType.toLong(next.get(columnOrder + 21)));\n\t\tresult.setTop05Value(null == next.get(columnOrder + 22) ? 0 : (next.get(columnOrder + 22)));\n\t\tresult.setTop05Count(null == next.get(columnOrder + 23) ? 0 : DataType.toLong(next.get(columnOrder + 23)));\n\t\tresult.setTop06Value(null == next.get(columnOrder + 24) ? 0 : (next.get(columnOrder + 24)));\n\t\tresult.setTop06Count(null == next.get(columnOrder + 25) ? 0 : DataType.toLong(next.get(columnOrder + 25)));\n\t\tresult.setTop07Value(null == next.get(columnOrder + 26) ? 0 : (next.get(columnOrder + 26)));\n\t\tresult.setTop07Count(null == next.get(columnOrder + 27) ? 0 : DataType.toLong(next.get(columnOrder + 27)));\n\t\tresult.setTop08Value(null == next.get(columnOrder + 28) ? 0 : (next.get(columnOrder + 28)));\n\t\tresult.setTop08Count(null == next.get(columnOrder + 29) ? 0 : DataType.toLong(next.get(columnOrder + 29)));\n\t\tresult.setTop09Value(null == next.get(columnOrder + 30) ? 0 : (next.get(columnOrder + 30)));\n\t\tresult.setTop09Count(null == next.get(columnOrder + 31) ? 0 : DataType.toLong(next.get(columnOrder + 31)));\n\t\tresult.setTop10Value(null == next.get(columnOrder + 32) ? 0 : (next.get(columnOrder + 32)));\n\t\tresult.setTop10Count(null == next.get(columnOrder + 33) ? 0 : DataType.toLong(next.get(columnOrder + 33)));\n\n\t\tif(-1==result.getUniqueValueCount()){\n result.setUniqueValueCountNA(true);\n }\n\n }", "public void step() {\n\t\tcellSizes.clear();\n\t\tupsetNeighbors = new ArrayList<Neighbor>();\n\t\tavailableSpaces = new ArrayList<Cell>();\n\t\tfor (int r = 0; r < grid.getRows(); r++) {\n\t\t\tfor (int c = 0; c < grid.getColumns(); c++) {\n\t\t\t\tupdateStatus(r, c);\n\t\t\t}\n\t\t}\n\t\tupdateGrid();\n\t}", "public int method3(int row) {\n return 0;\n }", "private static String processOneRow(int[] rowSize, String[] values){\n\t\tStringBuilder result = new StringBuilder();\t\t\n\t\tprocessOneRow(rowSize, values, result, false); \n\t\treturn result.toString(); \t\n\n\t}", "private void preprocess() {\n\t\t// do the whole process for the rows\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tint sumOfHints = rowHints.get(i).stream().mapToInt(Integer::valueOf).sum();\n\t\t\tint minimalOccupiedSpace = sumOfHints + rowHints.get(i).size() - 1; // always 1 space between blocks\n\t\t\tint pos = 0;\n\t\t\tfor (int k = 0; k < rowHints.get(i).size(); k++) {\n\t\t\t\tpos = pos + rowHints.get(i).get(k) - 1;\n\t\t\t\tint difference = width - minimalOccupiedSpace - rowHints.get(i).get(k);\n\t\t\t\t// if the difference is < 0: we can certainly fill a part of the matrix!\n\t\t\t\tif (difference < 0) {\n\t\t\t\t\tfor (int j = pos; j > pos + difference; j--) {\n\t\t\t\t\t\tpreprocessed[i][j] = FILLED;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpos += 2; // +2 because there is at least 1 space in between\n\t\t\t}\n\t\t}\n\t\t// now repeat the same for the columns\n\t\tfor (int j = 0; j < width; j++) {\n\t\t\tint sumOfHints = colHints.get(j).stream().mapToInt(Integer::valueOf).sum();\n\t\t\tint minimalOccupiedSpace = sumOfHints + colHints.get(j).size() - 1; // always 1 space between blocks\n\t\t\tint pos = 0;\n\t\t\tfor (int k = 0; k < colHints.get(j).size(); k++) {\n\t\t\t\tpos = pos + colHints.get(j).get(k) - 1;\n\t\t\t\tint difference = height - minimalOccupiedSpace - colHints.get(j).get(k);\n\t\t\t\tif (difference < 0) {\n\t\t\t\t\tfor (int i = pos; i > pos + difference; i--) {\n\t\t\t\t\t\tpreprocessed[i][j] = FILLED;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpos += 2;\n\t\t\t}\n\t\t}\n\t}", "public void run(){\n\t\twhile(frontIsClear()){\n\t\t\tdoFirstRow();\n\t\t\tif (leftIsClear()){\n\t\t\t\tadvanceRow();\n\t\t\t\tdoNextRow();\t\t\t\t\n\t\t\t}\t\n\t\t\tadvanceRow();\n\t\t}\t\n\t\t//Handles checkerboard by AVENUE only if STREET algorithm does not \n\t\tif (!frontIsClear() && leftIsClear()){\n\t\t\tturnLeft();\n\t\t\tdoFirstRow();\n\t\t}\n\t}", "@Override void apply(Env env) {\n if( !env.isAry() ) { // Single point\n double d = env.peekDbl();\n if( !Double.isNaN(d) ) d = op(new MutableDateTime((long)d));\n env.poppush(1, new ValNum(d));\n return;\n }\n // Whole column call\n Frame fr = env.peekAry();\n final ASTTimeOp uni = this;\n Frame fr2 = new MRTask() {\n @Override public void map( Chunk chks[], NewChunk nchks[] ) {\n MutableDateTime dt = new MutableDateTime(0);\n for( int i=0; i<nchks.length; i++ ) {\n NewChunk n =nchks[i];\n Chunk c = chks[i];\n int rlen = c._len;\n for( int r=0; r<rlen; r++ ) {\n double d = c.atd(r);\n if( !Double.isNaN(d) ) {\n dt.setMillis((long)d);\n d = uni.op(dt);\n }\n n.addNum(d);\n }\n }\n }\n }.doAll(fr.numCols(),fr).outputFrame(fr._names, factors());\n env.poppush(1, new ValFrame(fr2));\n }", "public abstract void rowsUpdated(int firstRow, int endRow, int column);", "void incrementColumnIndex();", "void incrementColumnIndex();", "private Object[] buildResult(RowMetaInterface rowMeta, Object[] rowData) throws KettleValueException\n { Deleting objects: we need to create a new object array\n\t\t// It's useless to call RowDataUtil.resizeArray\n\t\t//\n\t\tObject[] outputRowData = RowDataUtil.allocateRowData( data.outputRowMeta.size() );\n\t\tint outputIndex = 0;\n\t\t\n\t\t// Copy the data from the incoming row, but remove the unwanted fields in the same loop...\n\t\t//\n\t\tint removeIndex=0;\n\t\tfor (int i=0;i<rowMeta.size();i++) {\n\t\t\tif (removeIndex<data.removeNrs.length && i==data.removeNrs[removeIndex]) {\n\t\t\t\tremoveIndex++;\n\t\t\t} else\n\t\t\t{\n\t\t\t\toutputRowData[outputIndex++]=rowData[i];\n\t\t\t}\n\t\t}\n\n // Add the unpivoted fields...\n\t\t//\n for (int i=0;i<data.targetResult.length;i++)\n {\n Object resultValue = data.targetResult[i];\n DenormaliserTargetField field = meta.getDenormaliserTargetField()[i];\n switch(field.getTargetAggregationType())\n {\n case DenormaliserTargetField.TYPE_AGGR_AVERAGE :\n long count = data.counters[i];\n Object sum = data.sum[i];\n if (count>0)\n {\n \tif (sum instanceof Long) resultValue = (long)((Long)sum / count);\n \telse if (sum instanceof Double) resultValue = (double)((Double)sum / count);\n \telse if (sum instanceof BigDecimal) resultValue = ((BigDecimal)sum).divide(new BigDecimal(count));\n \telse resultValue = null; // TODO: perhaps throw an exception here?<\n }\n break;\n case DenormaliserTargetField.TYPE_AGGR_COUNT_ALL :\n if (resultValue == null) resultValue = Long.valueOf(0);\n if (field.getTargetType() != ValueMetaInterface.TYPE_INTEGER)\n {\n resultValue = data.outputRowMeta.getValueMeta(outputIndex).convertData(new ValueMeta(\"num_values_aggregation\", ValueMetaInterface.TYPE_INTEGER), resultValue);\n }\n break;\n default: break;\n }\n outputRowData[outputIndex++] = resultValue;\n }\n \n return outputRowData;\n }", "private TableColumn<Object, ?> fillColumns() {\n\t\t\n\t\treturn null;\n\t}", "private void fillFirstRow() {\n\t\tputBeeper();\n\t\tputEveryOtherBeeper();\t\t\n\t}", "public void prepareNextPhase() {\n if (evaluatedCells != null) {\n log.info(\"Preparing Next Phase \" + evaluatedCells.size());\n for (Cell cell : evaluatedCells) {\n cell.prepareNextPhase();\n }\n evaluatedCells.clear();\n }\n }", "public void update() {\n // If no previous columns, use new columns and return\n if(this.columns == null || this.columns.size() == 0) {\n if(this.newColumns.size() > 0){\n finish(newColumns);\n }\n return;\n }\n \n // If no new columns, retain previous columns and return\n if(this.newColumns.size() == 0) {\n this.index = 0;\n this.column = this.columns.get(index);\n return;\n }\n \n // Merge previous columns with new columns\n // There will be no overlapping\n List<ColumnCount> mergeColumns = new ArrayList<ColumnCount>(\n columns.size() + newColumns.size());\n index = 0;\n newIndex = 0;\n column = columns.get(0);\n newColumn = newColumns.get(0);\n while(true) {\n int ret = Bytes.compareTo(\n column.getBuffer(), column.getOffset(),column.getLength(), \n newColumn.getBuffer(), newColumn.getOffset(), newColumn.getLength());\n \n // Existing is smaller than new, add existing and iterate it\n if(ret <= -1) {\n mergeColumns.add(column);\n if(++index == columns.size()) {\n // No more existing left, merge down rest of new and return \n mergeDown(mergeColumns, newColumns, newIndex);\n finish(mergeColumns);\n return;\n }\n column = columns.get(index);\n continue;\n }\n \n // New is smaller than existing, add new and iterate it\n mergeColumns.add(newColumn);\n if(++newIndex == newColumns.size()) {\n // No more new left, merge down rest of existing and return\n mergeDown(mergeColumns, columns, index);\n finish(mergeColumns);\n return;\n }\n newColumn = newColumns.get(newIndex);\n continue;\n }\n }", "private void readData () throws SQLException {\n int currentFetchSize = getFetchSize();\n setFetchSize(0);\n close();\n setFetchSize(currentFetchSize);\n moveToInsertRow();\n\n CSVRecord record;\n\n for (int i = 1; i <= getFetchSize(); i++) {\n lineNumber++;\n try {\n\n if (this.records.iterator().hasNext()) {\n record = this.records.iterator().next();\n\n for (int j = 0; j <= this.columnsTypes.length - 1; j++) {\n\n switch (this.columnsTypes[j]) {\n case \"VARCHAR\":\n case \"CHAR\":\n case \"LONGVARCHAR\":\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateString(j + 1, record.get(j));\n break;\n case \"INTEGER\":\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateInt(j + 1, Integer.parseInt(record.get(j)));\n break;\n case \"TINYINT\":\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateByte(j + 1, Byte.parseByte(record.get(j)));\n break;\n case \"SMALLINT\":\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateShort(j + 1, Short.parseShort(record.get(j)));\n break;\n case \"BIGINT\":\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateLong(j + 1, Long.parseLong(record.get(j)));\n break;\n case \"NUMERIC\":\n case \"DECIMAL\":\n /*\n * \"0\" [0,0]\n * \"0.00\" [0,2]\n * \"123\" [123,0]\n * \"-123\" [-123,0]\n * \"1.23E3\" [123,-1]\n * \"1.23E+3\" [123,-1]\n * \"12.3E+7\" [123,-6]\n * \"12.0\" [120,1]\n * \"12.3\" [123,1]\n * \"0.00123\" [123,5]\n * \"-1.23E-12\" [-123,14]\n * \"1234.5E-4\" [12345,5]\n * \"0E+7\" [0,-7]\n * \"-0\" [0,0]\n */\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateBigDecimal(j + 1, new BigDecimal(record.get(j)));\n break;\n case \"DOUBLE\":\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateDouble(j + 1, Double.parseDouble(record.get(j)));\n break;\n case \"FLOAT\":\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateFloat(j + 1, Float.parseFloat(record.get(j)));\n break;\n case \"DATE\":\n // yyyy-[m]m-[d]d\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateDate(j + 1, Date.valueOf(record.get(j)));\n break;\n case \"TIMESTAMP\":\n // yyyy-[m]m-[d]d hh:mm:ss[.f...]\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateTimestamp(j + 1, Timestamp.valueOf(record.get(j)));\n break;\n case \"TIME\":\n // hh:mm:ss\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateTime(j + 1, Time.valueOf(record.get(j)));\n break;\n case \"BOOLEAN\":\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateBoolean(j + 1, convertToBoolean(record.get(j)));\n break;\n default:\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateString(j + 1, record.get(j));\n break;\n }\n }\n\n insertRow();\n incrementRowCount();\n }\n } catch (Exception e) {\n LOG.error(\"An error has occurred reading line number {} of the CSV file\", lineNumber, e);\n throw e;\n }\n }\n\n moveToCurrentRow();\n beforeFirst(); \n }", "public void run() {\r\n\r\n SQLRow rowPrefCompte = tablePrefCompte.getRow(2);\r\n this.rowPrefCompteVals.loadAbsolutelyAll(rowPrefCompte);\r\n // TVA Coll\r\n int idCompteTVACol = this.rowPrefCompteVals.getInt(\"ID_COMPTE_PCE_TVA_VENTE\");\r\n if (idCompteTVACol <= 1) {\r\n String compte;\r\n try {\r\n compte = ComptePCESQLElement.getComptePceDefault(\"TVACollectee\");\r\n idCompteTVACol = ComptePCESQLElement.getId(compte);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n SQLRow rowCompteTVACol = tableCompte.getRow(idCompteTVACol);\r\n\r\n // TVA Ded\r\n int idCompteTVADed = this.rowPrefCompteVals.getInt(\"ID_COMPTE_PCE_TVA_ACHAT\");\r\n if (idCompteTVADed <= 1) {\r\n try {\r\n String compte = ComptePCESQLElement.getComptePceDefault(\"TVADeductible\");\r\n idCompteTVADed = ComptePCESQLElement.getId(compte);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n SQLRow rowCompteTVADed = tableCompte.getRow(idCompteTVADed);\r\n\r\n // TVA intracomm\r\n int idCompteTVAIntra = this.rowPrefCompteVals.getInt(\"ID_COMPTE_PCE_TVA_INTRA\");\r\n if (idCompteTVAIntra <= 1) {\r\n try {\r\n String compte = ComptePCESQLElement.getComptePceDefault(\"TVAIntraComm\");\r\n idCompteTVAIntra = ComptePCESQLElement.getId(compte);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n SQLRow rowCompteTVAIntra = tableCompte.getRow(idCompteTVAIntra);\r\n\r\n // Achats intracomm\r\n int idCompteAchatsIntra = this.rowPrefCompteVals.getInt(\"ID_COMPTE_PCE_ACHAT_INTRA\");\r\n if (idCompteAchatsIntra <= 1) {\r\n try {\r\n String compte = ComptePCESQLElement.getComptePceDefault(\"AchatsIntra\");\r\n idCompteAchatsIntra = ComptePCESQLElement.getId(compte);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n SQLRow rowCompteAchatIntra = tableCompte.getRow(idCompteAchatsIntra);\r\n\r\n // TVA immo\r\n int idCompteTVAImmo = this.rowPrefCompteVals.getInt(\"ID_COMPTE_PCE_TVA_IMMO\");\r\n if (idCompteTVAImmo <= 1) {\r\n try {\r\n String compte = ComptePCESQLElement.getComptePceDefault(\"TVAImmo\");\r\n idCompteTVAImmo = ComptePCESQLElement.getId(compte);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n SQLRow rowCompteTVAImmo = tableCompte.getRow(idCompteTVAImmo);\r\n\r\n PdfGenerator_3310 p = new PdfGenerator_3310();\r\n this.m = new HashMap<String, Object>();\r\n\r\n long v010 = -this.sommeCompte.soldeCompte(70, 70, true, this.dateDebut, this.dateFin);\r\n this.m.put(\"A01\", GestionDevise.round(v010));\r\n\r\n // long vA02 = this.sommeCompte.soldeCompte(70, 70, true, this.dateDebut, this.dateFin);\r\n this.m.put(\"A02\", \"\");\r\n long tvaIntra = -this.sommeCompte.sommeCompteFils(rowCompteTVAIntra.getString(\"NUMERO\"), this.dateDebut, this.dateFin);\r\n long achatsIntra = this.sommeCompte.sommeCompteFils(rowCompteAchatIntra.getString(\"NUMERO\"), this.dateDebut, this.dateFin);\r\n this.m.put(\"A03\", GestionDevise.round(achatsIntra));\r\n this.m.put(\"A04\", \"\");\r\n this.m.put(\"A05\", \"\");\r\n this.m.put(\"A06\", \"\");\r\n this.m.put(\"A07\", \"\");\r\n\r\n long tvaCol = -this.sommeCompte.sommeCompteFils(rowCompteTVACol.getString(\"NUMERO\"), this.dateDebut, this.dateFin) + tvaIntra;\r\n this.m.put(\"B08\", GestionDevise.round(tvaCol));\r\n this.m.put(\"B08HT\", GestionDevise.round(Math.round(tvaCol / 0.196)));\r\n this.m.put(\"B09\", \"\");\r\n this.m.put(\"B09HT\", \"\");\r\n this.m.put(\"B09B\", \"\");\r\n this.m.put(\"B09BHT\", \"\");\r\n\r\n this.m.put(\"B10\", \"\");\r\n this.m.put(\"B10HT\", \"\");\r\n this.m.put(\"B11\", \"\");\r\n this.m.put(\"B11HT\", \"\");\r\n this.m.put(\"B12\", \"\");\r\n this.m.put(\"B12HT\", \"\");\r\n this.m.put(\"B13\", \"\");\r\n this.m.put(\"B13HT\", \"\");\r\n this.m.put(\"B14\", \"\");\r\n this.m.put(\"B14HT\", \"\");\r\n\r\n this.m.put(\"B15\", \"\");\r\n this.m.put(\"B16\", GestionDevise.round(tvaCol));\r\n this.m.put(\"B17\", GestionDevise.round(tvaIntra));\r\n this.m.put(\"B18\", \"\");\r\n final String numeroCptTVAImmo = rowCompteTVAImmo.getString(\"NUMERO\");\r\n long tvaImmo = this.sommeCompte.sommeCompteFils(numeroCptTVAImmo, this.dateDebut, this.dateFin);\r\n this.m.put(\"B19\", GestionDevise.round(tvaImmo));\r\n\r\n final String numeroCptTVADed = rowCompteTVADed.getString(\"NUMERO\");\r\n long tvaAutre = this.sommeCompte.sommeCompteFils(numeroCptTVADed, this.dateDebut, this.dateFin);\r\n\r\n // Déduction de la tva sur immo si elle fait partie des sous comptes\r\n if (numeroCptTVAImmo.startsWith(numeroCptTVADed)) {\r\n tvaAutre -= tvaImmo;\r\n }\r\n\r\n this.m.put(\"B20\", GestionDevise.round(tvaAutre));\r\n this.m.put(\"B21\", \"\");\r\n this.m.put(\"B22\", \"\");\r\n this.m.put(\"B23\", \"\");\r\n long tvaDed = tvaAutre + tvaImmo;\r\n this.m.put(\"B24\", GestionDevise.round(tvaDed));\r\n\r\n this.m.put(\"C25\", \"\");\r\n this.m.put(\"C26\", \"\");\r\n this.m.put(\"C27\", \"\");\r\n this.m.put(\"C28\", GestionDevise.round(tvaCol - tvaDed));\r\n this.m.put(\"C29\", \"\");\r\n this.m.put(\"C30\", \"\");\r\n this.m.put(\"C31\", \"\");\r\n this.m.put(\"C32\", GestionDevise.round(tvaCol - tvaDed));\r\n\r\n p.generateFrom(this.m);\r\n\r\n SwingUtilities.invokeLater(new Runnable() {\r\n public void run() {\r\n Map3310.this.bar.setValue(95);\r\n }\r\n });\r\n\r\n SwingUtilities.invokeLater(new Runnable() {\r\n public void run() {\r\n\r\n String file = TemplateNXProps.getInstance().getStringProperty(\"Location3310PDF\") + File.separator + String.valueOf(Calendar.getInstance().get(Calendar.YEAR)) + File.separator\r\n + \"result_3310_2.pdf\";\r\n System.err.println(file);\r\n File f = new File(file);\r\n Gestion.openPDF(f);\r\n Map3310.this.bar.setValue(100);\r\n }\r\n });\r\n\r\n }", "private synchronized void performOperations() {\r\n\t\ttry {\r\n\t\t\tswitch (operationStatus) {\r\n\t\t\tcase TRUNCATE_DATA:\r\n\t\t\t\tHibernateUtil.rawQuery(\"TRUNCATE csv;\");\r\n\t\t\t\tif (DEBUG) {\r\n\t\t\t\t\tUtil.writeLog(toString());\r\n\t\t\t\t\tLogger.getLogger(Scheduler.class.getName()).log(Level.INFO, toString());\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\tcase APPEND_DATA:\r\n\t\t\t\tparseData(false);\r\n\t\t\t\tif (DEBUG) {\r\n\t\t\t\t\tUtil.writeLog(toString());\r\n\t\t\t\t\tLogger.getLogger(Scheduler.class.getName()).log(Level.INFO, toString());\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase UPDATE_DATA:\r\n\t\t\t\tparseData(true);\r\n\t\t\t\tif (DEBUG) {\r\n\t\t\t\t\tUtil.writeLog(toString());\r\n\t\t\t\t\tLogger.getLogger(Scheduler.class.getName()).log(Level.INFO, toString());\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase ARRANGE_DATA:\r\n\t\t\t\tarrangeData();\r\n\t\t\t\tif (DEBUG) {\r\n\t\t\t\t\tUtil.writeLog(toString());\r\n\t\t\t\t\tLogger.getLogger(Scheduler.class.getName()).log(Level.INFO, toString());\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void incrementRow() {\n setRowAndColumn(row + 1, column);\n }", "void completeCell(Sheet sheet, Row row, Cell cell, ExcelField excelField, Field field, int index, int colIndex, boolean isHead);", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\tpublic void migrateDataByBatch() {\n\t\tpool = new HTablePool(conf, 1024);\n\t\tSQLExporter sqlExporter = \n\t\t\tnew SQLExporter(url, username, password, catalog);\n\t\twhile(sqlExporter.hasNextDataTable()) {\n\t\t\tEntry entry = sqlExporter.next();\n\t\t\tString tableName = REGION + \".\" + (String) entry.getKey();\n\t\t\tList<Map<String, Object>> list = (List<Map<String, Object>>) entry.getValue();\n\t\t\t/**\n\t\t\t * table to migrate data.\n\t\t\t */\n\t\t\tHTable table = (HTable) pool.getTable(tableName);\n\t\t\t\n\t\t\t/**\n\t\t\t * set write buffer size.\n\t\t\t */\n\t\t\ttry {\n\t\t\t\ttable.setWriteBufferSize(WRITE_BUFFER_SIZE);\n\t\t\t\ttable.setAutoFlush(false);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tint counter = 0;\n\t\t\tList<Put> puts = new ArrayList<Put>();\n\t\t\tint size = list.size();\n\t\t\tfor (int i = 0; i < size; i++) {\n\t\t\t\t\n\t\t\t\tPut put = new Put((new Integer(i)).toString().getBytes());\n\t\t\t\t\n\t\t\t\tMap<String, Object> map = list.get(i);\n\t\t\t\tcounter ++;\n\t\t\t\t/**\n\t\t\t\t * add one row to be put.\n\t\t\t\t */\n\t\t\t\tfor (Map.Entry<String, Object> m : map.entrySet()) {\t\n\t\t\t\t\tput.add(FAMILY.getBytes(), m.getKey().getBytes(), \n\t\t\t\t\t\t\tm.getValue().toString().getBytes());\t\n\t\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * add `put` to list puts. \n\t\t\t\t */\n\t\t\t\tputs.add(put);\n\t\t\t\t\n\t\t\t\tif ((counter % LIST_PUTS_COUNTER == 0) || (i == size - 1)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttable.put(puts);\n\t\t\t\t\t\ttable.flushCommits();\n\t\t\t\t\t\tputs.clear();\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t} else continue;\n\t\t\t}\n\t\t}\n\t}", "private void clearCompletedRows()\n {\n int count = 0;\n for(int i = 0; i < grid.getNumRows(); i++)\n {\n if(isCompletedRow(i))\n {\n clearRow(i);\n for(int r = i - 1; r >= 0; r--)\n {\n for(int c = 0; c < grid.getNumCols(); c++)\n {\n if(grid.get(new Location(r, c)) != null)\n {\n grid.get(new Location(r, c)).moveTo(new Location(r + 1, c));\n }\n }\n }\n count++;\n }\n }\n if (count == 1)\n score+=40*level;\n else if (count==2)\n score+=100*level;\n else if (count==3)\n score+=300*level;\n else if (count==4)\n score+=1200*level;\n rowsCleared+=count;\n level = rowsCleared/10 + 1;\n }", "protected final void collect(T row) {\n collector.collect(row);\n }", "private void makePrediction(int row) {\n \tif (row == 0) return;\n \tfor (int j = 0; j < width; j++) {\n\t \tIterator<Integer> hints = colHints.get(j).iterator();\n\t \tint blockSize = 0;\n\t \tint hint = hints.next();\n\t \tfor (int i = 0; i < row; i++) {\n\t \t\tif (matrix[i][j] == FILLED || preprocessed[i][j] == FILLED) {\n\t \t\t\tblockSize++;\n\t \t\t}\n\t \t\telse if (matrix[i][j] == EMPTY || preprocessed[i][j] == EMPTY) {\n\t \t\t\tif (blockSize > 0) hint = hints.hasNext() ? hints.next() : 0;\n\t \t\t\tblockSize = 0;\n\t \t\t}\n\t \t}\n\t \t// if a block already started and is not completed: this field certainly needs to be FILLED\n \t\tif (blockSize > 0 && blockSize < hint) {\n \t\t\tpredictions[row][j] = FILLED;\n \t\t}\n \t\t// if the block is exactly completed: next field is certainly EMTPY\n \t\telse if (blockSize == hint) {\n \t\t\tpredictions[row][j] = EMPTY;\n \t\t}\n \t\t// otherwise we cannot make a prediction\n \t\telse {\n \t\t\tpredictions[row][j] = UNKNOWN;\n \t\t}\n \t}\n }", "private void checkForSplitRowAndComplete(int length, int index) {\n // For singleton select, the complete row always comes back, even if\n // multiple query blocks are required, so there is no need to drive a\n // flowFetch (continue query) request for singleton select.\n //while ((position_ + length) > lastValidBytePosition_) {\n while (dataBuffer_.readableBytes() > lastValidBytePosition_) {\n // Check for ENDQRYRM, throw SQLException if already received one.\n checkAndThrowReceivedEndqryrm();\n\n // Send CNTQRY to complete the row/rowset.\n int lastValidByteBeforeFetch = completeSplitRow(index);\n\n // If lastValidBytePosition_ has not changed, and an ENDQRYRM was\n // received, throw a SQLException for the ENDQRYRM.\n checkAndThrowReceivedEndqryrm(lastValidByteBeforeFetch);\n }\n }", "private void evaluateData () {\n long rows = DatabaseUtils.longForQuery(sqliteDBHelper.openSqlDatabaseReadable(), \"SELECT COUNT(*) FROM \" + SqliteDBStructure.DATA_AGGREGATE\r\n + \" JOIN \" + SqliteDBStructure.INFO_AT_ACCESSTIME + \" ON \"\r\n + SqliteDBStructure.DATA_AGGREGATE + \".\" + SqliteDBStructure.ACCESS_TIME + \" = \" + SqliteDBStructure.INFO_AT_ACCESSTIME + \".\" + SqliteDBStructure.ACCESS_TIME, null);\r\n // calculate the amount of tasks (thread) depending on the MaxBatchSize\r\n tasks = rows >= MaxBatchSize? (int)(rows/MaxBatchSize + 1):1;\r\n // set the amount of finished tasks to 0\r\n finished = 0;\r\n // send the amount of task to the main activity so it can be displayed in the progress dialog\r\n sendTaskAmount(tasks + 1);\r\n // create a thread pool with tasks amount of threads\r\n final ExecutorService executorService = Executors.newFixedThreadPool(tasks);\r\n // create a list which holds all the tasks to be executed\r\n final List<ProcessingDataHandler> taskList = new LinkedList<>();\r\n // for each task create a batch of MaxBatchSize rows to evaluate\r\n for (int i = 0; i < tasks; i++) {\r\n // pass the offset (where to start) and the limit (how many rows)\r\n taskList.add(new ProcessingDataHandler(i*MaxBatchSize, MaxBatchSize));\r\n }\r\n // invoke all the task at once\r\n new Thread(new Runnable() {\r\n @Override\r\n public void run() {\r\n try {\r\n executorService.invokeAll(taskList);\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }).start();\r\n\r\n updateProgressDialog();\r\n }", "public static void write(List<Individual> rows, List<Column> allColumns) {\n\t\tConnection c = null;\n\t\tPreparedStatement stmt = null;\n\t\ttry {\n\t\t\tClass.forName(\"org.postgresql.Driver\");\n\t\t\tc = DriverManager.getConnection(\"jdbc:postgresql://localhost:5432/microsim\", \"postgres\", \"microsim2016\");\n\t\t\tc.setAutoCommit(false);\n\t\t\n\t\t\tString create = \"CREATE TABLE TOTAL(\";\n\t\t\tMap<Column, String> values = rows.get(0).getValues();\n\t\t\tfor (Column col : values.keySet()) {\n\t\t\t\tSource s = col.source;\n\t\t\t\tif (!s.equals(Source.MULTI_VALUE) && !s.equals(Source.MULTI_VALUE_2)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tInteger.parseInt(values.get(col));\n\t\t\t\t\t\tcreate = create + col.datatype + \" BIGINT \" + \"NOT NULL, \";\n\t\t\t\t\t} catch(NumberFormatException e) {\n\t\t\t\t\t\tcreate = create + col.datatype + \" VARCHAR \" + \"NOT NULL, \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcreate = create + \" PRIMARY KEY(id));\"; \n\t\t\tstmt = c.prepareStatement(create);\t\t\t\n\t\t\tstmt.executeUpdate();\n\t\t\tfor (Individual i : rows) {\n\t\t\t\tString insert = \"INSERT INTO TOTAL \" +\n\t\t\t\t\t\t\t\t\"VALUES (\";\n\t\t\t\t\n\t\t\t\tMap<Column, String> iValues = i.getValues();\n\t\t\t\tfor (Column col : iValues.keySet()) {\n\t\t\t\t\tSource sc = col.source;\n\t\t\t\t\tif (!sc.equals(Source.MULTI_VALUE) && !sc.equals(Source.MULTI_VALUE_2)) {\n\t\t\t\t\t\tString s = iValues.get(col);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tInteger.parseInt(s);\n\t\t\t\t\t\t\tinsert = insert + \" \" + s + \",\"; \n\t\t\t\t\t\t} catch(NumberFormatException e) {\n\t\t\t\t\t\tinsert = insert + \" '\" + s + \"', \"; //doing this each time because need to add '' if a string and no user input\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\tinsert = insert.substring(0, insert.length() - 2); //cut off last , \n\t\t\t\tinsert = insert + \");\"; \n\t\t\t\tstmt = c.prepareStatement(insert);\n\t\t\t\tstmt.executeUpdate();\t\t\t\n\t\t\t}\n\t\t\tstmt.close();\n\t\t\tsubTables(rows, c, allColumns);\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n\t System.exit(0);\n\t\t}\t\t\t\t\n\t}", "public void populateMetaDataUponCompletion() {\r\n\r\n\t\tCTTbl cTTbl = docxTable.getCTTbl();\r\n\t\tList<CTTblGridCol> cols = null;\r\n\t\tCTTblGrid grid = null;\r\n\r\n\t\tif (cTTbl != null) {\r\n\r\n\t\t\tthis.getCTTblPr();\r\n\r\n\t\t\tgrid = this.getCTTblGrid(cTTbl);\r\n\t\t\tcols = grid.getGridColList();\r\n\r\n\t\t}\r\n\r\n\t\tfor (XWPFTableRow row : this.docxTable.getRows()) {\r\n\r\n\t\t\tint diff = row.getTableCells().size() - cols.size();\r\n\r\n\t\t\tfor (int i = 0; i < diff; i++) {\r\n\t\t\t\tgrid.addNewGridCol();\r\n\t\t\t}\r\n\r\n\t\t\tint i = 0;\r\n\r\n\t\t\tfor (XWPFTableCell cell : row.getTableCells()) {\r\n\r\n\t\t\t\tCTTblGridCol gridColumn = cols.get(i);\r\n\r\n\t\t\t\tif (cell.getCTTc().getTcPr().getTcW().getW().intValue() == 0) {\r\n\t\t\t\t\tBigInteger columnWidth = this.getDocumentWidth().divide(\r\n\t\t\t\t\t\t\tBigInteger.valueOf(row.getTableCells().size()));\r\n\t\t\t\t\tcell.getCTTc().getTcPr().getTcW().setW(columnWidth);\r\n\t\t\t\t\tcell.getCTTc().getTcPr().getTcW().setType(STTblWidth.DXA);\r\n\t\t\t\t\tgridColumn.setW(columnWidth);\r\n\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tList<CTTblGridCol> tableCols = grid.getGridColList();\r\n\t\tfor (CTTblGridCol col : tableCols) {\r\n\t\t\t// System.out.println(\"tblGridCol.getW()=\" + col.getW());\r\n\t\t\tif (col.getW() == null) {\r\n\t\t\t\tBigInteger columnWidth = this.getDocumentWidth().divide(\r\n\t\t\t\t\t\tBigInteger.valueOf(tableCols.size()));\r\n\t\t\t\tcol.setW(columnWidth);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public void onRowMajorFillButtonClick()\n {\n for ( int row = 0; row < theGrid.numRows(); row++ )\n {\n for ( int column = 0; column < theGrid.numCols(); column++ )\n {\n placeColorBlock(row, column);\n }\n }\n }", "protected void postProcessTable(TableImpl t) \n\t{\n\t\t((ExcelTableImpl)t).excelColumns().forEach(c -> c.getLabel());\n\t\t((ExcelTableImpl)t).excelRows().forEach(r -> r.getLabel());\n\t}", "public void readTableData2() {\n\t\tint colCount = driver.findElements(By.xpath(\"//*[@id='industry-filter-results']/div[2]/table/tbody/tr[1]/th\"))\n\t\t\t\t.size();\n\t\tSystem.out.println(\"colCount\" + colCount);\n\t\t// Find row size\n\t\tint rowCount = driver\n\t\t\t\t.findElements(By.xpath(\"//*[@id='industry-filter-results']/div[2]/table/tbody/tr/td/parent::*\")).size();\n\t\tSystem.out.println(\"rowCount\" + rowCount);\n\t\t// Find xpath for 1st row and 1st column. Break into multiple parts such\n\t\t// that row and column no can be iterated.\n\t\tString firstPart = \"(//*[@id='industry-filter-results']/div[2]/table/tbody/tr/td[2]/parent::tr)[\";\n\t\tString secondPart = \"]\";\n\t\t// Loop through rows one by one. Start from 1st row till row count.\n\t\tfor (int i = 1; i <= rowCount; i++) {\n\t\t\t\tString finalPart = firstPart + i + secondPart;\n\t\t\t\tSystem.out.println(finalPart);\n\t\t\t\tString text = driver.findElement(By.xpath(finalPart)).getText();\n\t\t\t\tSystem.out.print(text + \" | \");\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void updateMultiRunInventory() {\n\n\t\tExcelFileUtils excelFileUtils = new ExcelFileUtils();\n\t\texcelFileUtils.setSpreadsheetFilePath(spreadsheetFilePath);\n\t\texcelFileUtils.setSheetFormat(sheetFormat);\n\t\texcelFileUtils.setSheetName(sheetName);\n\t\texcelFileUtils.setDebug(true /* this.debug */ );\n\t\texcelFileUtils.setTableData(tableData);\n\t\tif (!appendData) {\n\t\t\tcolumnHeaders = excelFileUtils.readColumnHeaders();\n\t\t\tnewColumnHeader = String.format(\"Run %d\", columnHeaders.size());\n\t\t\texcelFileUtils.appendColumnHeader(newColumnHeader);\n\n\t\t\tcolumnHeaders = excelFileUtils.readColumnHeaders();\n\t\t\tif (debug) {\n\t\t\t\tSystem.err.println(\"Appended column: \" + columnHeaders.toString());\n\t\t\t}\n\t\t\trowData = new HashMap<>();\n\t\t\t// Note: row 0 is reserved for headers\n\t\t\t// for FILLO SQL query based data access\n\t\t\tfor (int column = 0; column != columnHeaders.size(); column++) {\n\t\t\t\trowData.put(column, columnHeaders.get(column));\n\t\t\t}\n\t\t\ttableData.add(rowData);\n\t\t\t// columnHeaders\n\t\t\tfor (String testMethodName : testInventoryData.keySet()) {\n\t\t\t\trowData = new HashMap<>();\n\t\t\t\trowData.put(0, testMethodName);\n\t\t\t\trowData.put(1, testInventoryData.get(testMethodName).toString());\n\t\t\t\ttableData.add(rowData);\n\t\t\t}\n\t\t\texcelFileUtils.setTableData(tableData);\n\t\t} else {\n\t\t\tList<Map<Integer, String>> existingData = new ArrayList<>();\n\t\t\t// NOTE: no need to wrap into an Optional\n\t\t\texcelFileUtils.readSpreadsheet(Optional.of(existingData));\n\t\t\tif (verbose) {\n\t\t\t\tSystem.err.println(\"Adding extra column\");\n\t\t\t}\n\n\t\t\ttableData = new ArrayList<>(); // reset tableData\n\t\t\tfor (Map<Integer, String> rowData : existingData) {\n\t\t\t\tString testMethodName = rowData.get(0); // \"Test Method\"\n\t\t\t\tInteger newColumn = rowData.size();\n\t\t\t\tif (testMethodName.matches(\"Test Method\")) {\n\t\t\t\t\t// continue;\n\t\t\t\t\trowData.put(rowData.size(), String.format(\"Run %d\", newColumn));\n\t\t\t\t} else {\n\t\t\t\t\tif (verbose) {\n\t\t\t\t\t\tSystem.err\n\t\t\t\t\t\t\t\t.println(\"Adding extra column for test \" + testMethodName);\n\t\t\t\t\t}\n\t\t\t\t\tBoolean testStatus = Boolean\n\t\t\t\t\t\t\t.parseBoolean(testInventoryData.get(testMethodName).toString());\n\t\t\t\t\trowData.put(newColumn, testStatus.toString());\n\t\t\t\t}\n\t\t\t\ttableData.add(rowData);\n\t\t\t\tif (verbose) {\n\t\t\t\t\tfor (Map.Entry<Integer, String> columnData : rowData.entrySet()) {\n\t\t\t\t\t\tSystem.err.println(columnData.getKey().toString() + \" => \"\n\t\t\t\t\t\t\t\t+ columnData.getValue());\n\t\t\t\t\t}\n\t\t\t\t\tSystem.err.println(\"---\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\texcelFileUtils.setTableData(tableData);\n\t\t\texcelFileUtils.writeSpreadsheet();\n\t\t}\n\t}", "private void addRows() {\n this.SaleList.forEach(Factura -> {\n this.modelo.addRow(new Object[]{\n Factura.getId_Factura(),\n Factura.getPersona().getNombre(),\n Factura.getFecha().getTimestamp(),\n Factura.getCorreo(),\n Factura.getGran_Total()});\n });\n }", "private void repopulateTableForAdd()\n {\n clearTable();\n populateTable(null);\n }", "public void stepCompleted() {\n\t\tfor (int i = 0; i < r; i++) {\n\t\t\tfor (int j = 0; j < c; j++) {\n\t\t\t\tgrid[i][j] += (grid[i][j] >= 0 ? 1 : 0);\n\t\t\t}\n\t\t}\n\t}", "public void addValuesToEachRow(Object[] values) {\n for(int i= 0; i < calculators.length; i++){\n for(int j = 0; j < calculators[i].length; j++){\n calculators[i][j].compute(values[j]);\n }\n }\n }", "public abstract void processCell(int rowIndex, int colIndex);", "private void rowToRenddet(Row row) {\n Cell cell;\n int lastCellNum;\n List<String> strCells = new ArrayList<>();\n\n //List<String> csvLine = new ArrayList<>();\n\n // Check to ensure that a row was recovered from the sheet as it is\n // possible that one or more rows between other populated rows could be\n // missing - blank. If the row does contain cells then...\n if (row != null) {\n\n // Get the index for the right most cell on the row and then\n // step along the row from left to right recovering the contents\n // of each cell, converting that into a formatted String and\n // then storing the String into the csvLine ArrayList.\n lastCellNum = row.getLastCellNum();\n //rendDetalles.add()\n\n for (int i = 0; i <= lastCellNum; i++) {\n cell = row.getCell(i);\n if (cell == null) {\n strCells.add(\"\");\n } else {\n if (cell.getCellType() != CellType.FORMULA) {\n strCells.add(this.formatter.formatCellValue(cell));\n } else {\n strCells.add(this.formatter.formatCellValue(cell, this.evaluator));\n }\n }\n }\n // Make a note of the index number of the right most cell. This value\n // will later be used to ensure that the matrix of data in the CSV file\n // is square.\n if (lastCellNum > this.maxRowWidth) {\n this.maxRowWidth = lastCellNum;\n }\n\n ScpRendiciondetalle det = strCellToDetalle(strCells);\n if (det!=null) rendDetalles.add(det);\n }\n }", "void coverRows()\n {\n System.out.println(\".... covering cols...\"+name); \n for (Node i = top.down; i!=top; i=i.down)\n {\n System.out.println(\"iterating vertically at \" + i.rowNum+i.colName());\n i.coverColumnsss();\n //save i;\n //recurse\n //restore i\n //uncover i;\n }\n }", "private void setUsedValuesbyRow() {\n \n //Loop through each row.\n IntStream.rangeClosed(1,9).forEach(i -> {\n //Loop through each position in the row.\n IntStream.rangeClosed(1,9).forEach(j -> {\n //If this value is not set find all the other values in the row and set \n //the possible values of this item to those that are not currently set.\n int row = i;\n Number currentNumber = numbers.stream()\n .filter(n -> n.getRow() == row)\n .filter(n -> n.getColumn() == j)\n .findAny().get();\n //If the value is 0 it is not set\n if (currentNumber.getValue() < 1) {\n //Used numbers in this row\n List<Integer> usedNumbers = numbers.stream()\n .filter(n -> n.getValue() > 0)\n .filter(n -> n.getRow() == row)\n .filter(n -> n.getColumn() != j)\n .map(Number::getValue)\n .collect(Collectors.toList());\n\n //If position currently doesn't have used values then set them to \n //the ones that were found.\n if (currentNumber.getUsedValues() == null){\n currentNumber.setUsedValues(usedNumbers);\n }\n else {\n //Set the position's used values to the union of what it currently has and the\n //identifed used values.\n currentNumber.setUsedValues(\n CollectionUtils.union(currentNumber.getUsedValues(), usedNumbers)\n .stream().collect(Collectors.toList()));\n }\n }\n });\n });\n }", "public void readTableData() {\n\t\tint colCount = driver.findElements(By.xpath(\"//*[@id='industry-filter-results']/div[2]/table/tbody/tr[1]/th\"))\n\t\t\t\t.size();\n\t\tSystem.out.println(\"colCount\" + colCount);\n\t\t// Find row size\n\t\tint rowCount = driver\n\t\t\t\t.findElements(By.xpath(\"//*[@id='industry-filter-results']/div[2]/table/tbody/tr/td/parent::*\")).size();\n\t\tSystem.out.println(\"rowCount\" + rowCount);\n\t\t// Find xpath for 1st row and 1st column. Break into multiple parts such\n\t\t// that row and column no can be iterated.\n\t\tString firstPart = \"(//*[@id='industry-filter-results']/div[2]/table/tbody/tr/td[2]/parent::tr)[\";\n\t\tString secondPart = \"1\";\n\t\tString thirdPart = \"]\";\n\t\tboolean flag = false;\n\t\t// Loop through rows one by one. Start from 1st row till row count.\n\t\tfor (int i = 1; i <= rowCount; i++) {\n\t\t\t// For every row, loop through columns one by one. Start from 1st\n\t\t\t// column till column count.\n\t\t\tfor (int j = 1; j <= colCount; j++) {\n\t\t\t\tString finalPart = firstPart + i + secondPart + j + thirdPart;\n\t\t\t\tSystem.out.println(finalPart);\n\t\t\t\tString text = driver.findElement(By.xpath(finalPart)).getText();\n\t\t\t\tSystem.out.print(text + \" | \");\n\t\t\t\t//If we need to stop after a particular text is matched use if condition\n\t\t\t\tif(text.contains(\"abc\")){\n\t\t\t\t\tSystem.out.println(text);\n\t\t\t\t\tflag = true;//Set flag as true(Logic from Naveen automation labs)\n\t\t\t\t\tbreak;//This will stop iterating the columns.(https://www.youtube.com/watch?v=Rjs9qLRP9tM&list=PLFGoYjJG_fqo4oVsa6l_V-_7-tzBnlulT&index=18)\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\tif(flag){\n\t\t\t\tbreak;//This will break outer loop only if flag is true. i.e. we have retrieved the text that we need. If not it will continue with next iteration.\n\t\t\t}\n\t\t}\n\t}", "private void tampilkan() {\n int row = table.getRowCount();\n for(int a= 0; a<row;a++){\n model.removeRow(0);\n }\n \n \n }", "@SuppressWarnings({ \"deprecation\", \"serial\" })\n\tprivate void doBatchCompute() {\n\t\tHConnection hConnection = null;\n\t\tHTableInterface hTableInterface = null;\n\t\tHBaseAdmin admin = null;\n\t\ttry {\n\t\t\t//scan the events table\n\t\t\thConnection = HConnectionManager.createConnection(conf);\n\t\t\thTableInterface = hConnection.getTable(DashboardUtils.curatedEvents);\n\t\t\tadmin = new HBaseAdmin(conf);\n\t\t\t\n\t\t\t//create an empty dataset here and do union or intersections in subsequent nested iterations\n\t\t\tList<DatasetBean> emptyFeed = new ArrayList<DatasetBean>();\n\t\t\tDatasetBean datasetBean = new DatasetBean();\n\t\t\t\n\t\t\t//start scanning through the table\n\t\t\tScan scan = new Scan();\n\t\t\tResultScanner scanner = hTableInterface.getScanner(scan);\n\t\t\tfor(Result r = scanner.next(); r != null; r = scanner.next()) {\n\t\t\t\t//to stop scanner from creating too many threads\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(3000);\n\t\t\t\t} catch(InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//cumulative set which is empty containing the DatasetBean class object\n\t\t\t\tDataset<Row> cumulativeSet = sparkSession.createDataFrame(emptyFeed, datasetBean.getClass());\n\t\t\t\t\n\t\t\t\t//scan through every row of feedEvents table and process each corresponding event\n\t\t\t\tif(!r.isEmpty()) {\n\t\t\t\t\teventTable = Bytes.toString(r.getRow());\n\t\t\t\t\t\n\t\t\t\t\t//create table if it didn't already exist\n\t\t\t\t\tif(!admin.tableExists(eventTable)) {\n\t\t\t\t\t\tHTableDescriptor creator = new HTableDescriptor(eventTable);\n\t\t\t\t\t\tcreator.addFamily(new HColumnDescriptor(DashboardUtils.eventTab_cf));\n\t\t\t\t\t\tadmin.createTable(creator);\n\t\t\t\t\t\tlogger.info(\"**************** just created the following table in batch process since it didn't exist: \" + eventTable);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//declare the dataset storing the data from betaFeed\n\t\t\t\t\tDataset<Row> feedDataSet;\n\t\t\t\t\t//long eventdatacount = eventmap.get(eventTable);\n\t\t\t\t\t\n\t\t\t\t\tcurrentStore = RSSFeedUtils.betatable;\n\t\t\t\t\t//this dataset is populated with betaFeed data\n\t\t\t\t\tfeedDataSet = loadbetaFeed();\n\t\t\t\t\t\n\t\t\t\t\t//store the data as a temporary table to process via sparkSQL\n\t\t\t\t\tfeedDataSet.createOrReplaceTempView(currentStore);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tfeedevents = Job.getInstance(conf);\n\t\t\t\t\tfeedevents.getConfiguration().set(TableOutputFormat.OUTPUT_TABLE, eventTable);\n\t\t\t\t\tfeedevents.setOutputFormatClass(TableOutputFormat.class);\n\t\t\t\t\t\n\t\t\t\t\t//read the tags attribute of the event, and start reading it from left to right....tags are in format as in the documentation\n\t\t\t\t\t//break the OR tag, followed by breaking the AND tag, followed by processing each tag or event contained in it\n\t\t\t\t\tString tags = \"\";\n\t\t\t\t\tif(r.containsColumn(Bytes.toBytes(DashboardUtils.curatedEvents_cf), Bytes.toBytes(DashboardUtils.curatedTags))) {\n\t\t\t\t\t\ttags = Bytes.toString(r.getValue(Bytes.toBytes(DashboardUtils.curatedEvents_cf), Bytes.toBytes(DashboardUtils.curatedTags)));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tString backupTagStr = tags;\n\t\t\t\t\t\n\t\t\t\t\twhile(tags.contains(\")\")) {\n\t\t\t\t\t\tString threstr=null;\n\t\t\t\t\t\tSystem.out.println(\"tags:\" + tags.trim());\n\t\t\t\t\t\t\n\t\t\t\t\t\tString[] ortagstrings = tags.trim().split(\"OR\");\n\t\t\t\t\t\tfor(String ortag : ortagstrings) {\n\t\t\t\t\t\t\tSystem.out.println(\"val of ortag:\" + ortag);\n\t\t\t\t\t\t\tthrestr = ortag.trim();\n\t\t\t\t\t\t\t//these are the parameters being fetched and populated in the events...i.e, feedname,totle,link,description,categories and date\n\t\t\t\t\t\t\tString qry =\"SELECT rssFeed, title, articleLink, description, categories, articleDate FROM \" + currentStore + \" WHERE \";\n\t\t\t\t\t\t\tStringBuilder querybuilder = new StringBuilder(qry);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tSystem.out.println(\"tag:\"+ortag.trim());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] andtagstrings = ortag.trim().split(\"AND\");\n\t\t\t\t\t\t\tDataset<Row> andSet = sparkSession.createDataFrame(emptyFeed, datasetBean.getClass());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString proctag=null;\n\t\t\t\t\t\t\tfor(int i=0; i<andtagstrings.length; i++) {\n\t\t\t\t\t\t\t\tproctag = andtagstrings[i];\n\t\t\t\t\t\t\t\tSystem.out.println(\"process tag:\" + proctag);\n\t\t\t\t\t\t\t\t//if the part of the tag being processed is an event, open up a second stream to load data from corresponding table\n\t\t\t\t\t\t\t\tif(proctag.trim().replaceAll(\"\\\\(\", \"\").startsWith(\"EVENT\")) {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"qwerty:\" + proctag.trim());\n\t\t\t\t\t\t\t\t\tString curatedevent = proctag.trim().substring(6, proctag.trim().length()).trim().replaceAll(\" \", \"__\").replaceAll(\"\\\\)\", \"\");\n\t\t\t\t\t\t\t\t\tlogger.info(\"################################################################################# event:\"+curatedevent);\n\t\t\t\t\t\t\t\t\t//dataset comes here\n\t\t\t\t\t\t\t\t\tif(admin.tableExists(curatedevent)) {\n\t\t\t\t\t\t\t\t\t\tDataset<Row> eventdataset = loadcuratedEvent(curatedevent);\n\t\t\t\t\t\t\t\t\t\tlogger.info(\"**************************************************** event:\" + curatedevent + \" while processing:\"+eventTable);\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif(i==0) {\n\t\t\t\t\t\t\t\t\t\t\tandSet = eventdataset.union(andSet);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif(andSet.count() == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\tandSet = eventdataset.union(andSet);\n\t\t\t\t\t\t\t\t\t\t\t} else if(andSet.count() > 0) {\n\t\t\t\t\t\t\t\t\t\t\t\tandSet = eventdataset.intersect(andSet);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tlogger.info(\"*************************** event \" + curatedevent + \" does not exist *********************************\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//if it's a normal tag, make a sparkSQL query out of it\n\t\t\t\t\t\t\t\t} else if(!proctag.trim().replaceAll(\"\\\\(\", \"\").startsWith(\"EVENT\")) {\n\t\t\t\t\t\t\t\t\tquerybuilder.append(\"categories RLIKE '\" + proctag.trim().replaceAll(\"\\\\(\", \"\").replaceAll(\"\\\\)\", \"\") + \"' AND \");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//once the tag is fully processed, merge all data points and store in a resultant dataset\n\t\t\t\t\t\t\tif(querybuilder.toString().length() > qry.length()) {\n\t\t\t\t\t\t\t\t//logger.info(\"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ inside query string ###############################\");\n\t\t\t\t\t\t\t\tquerybuilder = new StringBuilder(querybuilder.toString().substring(0, querybuilder.toString().length() -5));\n\t\t\t\t\t\t\t\t//dataset comes here\n\t\t\t\t\t\t\t\tDataset<Row> queryset = sparkSession.sql(querybuilder.toString());\n\n\t\t\t\t\t\t\t\t//id the set it empty, fill it with the single data point\n\t\t\t\t\t\t\t\tif(andSet.count() == 0 && !backupTagStr.contains(\"EVENT\")) {\n\t\t\t\t\t\t\t\t\tandSet = queryset.union(andSet);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tlogger.info(\"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ doing query string with zero count:\" + eventTable);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tlogger.info(\"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ doing intersect for query:\" + eventTable);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tandSet.createOrReplaceTempView(\"andSet1\");\n\t\t\t\t\t\t\t\t\tqueryset.createOrReplaceTempView(\"querySet1\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tDataset<Row> fSet = sparkSession.sql(\"SELECT DISTINCT(a.*) FROM andSet1 a INNER JOIN querySet1 b ON a.title = b.title\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tandSet = fSet;\n\t\t\t\t\t\t\t\t\tqueryset.unpersist();\n\t\t\t\t\t\t\t\t\tfSet.unpersist();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcumulativeSet = andSet.union(cumulativeSet);\n\t\t\t\t\t\t\tandSet.unpersist();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\ttags = tags.substring(threstr.length(), tags.length()).trim().replaceAll(\"\\\\)\", \"\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tlogger.info(\"########################################################################################################### table:\"+eventTable);\n\t\t\t\t\t\n\t\t\t\t\tcumulativeSet.createOrReplaceTempView(\"cumulativeEvent\");\n\t\t\t\t\n\t\t\t\t\t//as a double check, only fetch distinct records from all the merges...done via sparkSQL\n\t\t\t\t\tDataset<Row> finalSet = sparkSession.sql(\"SELECT DISTINCT(*) FROM cumulativeEvent\");\n\t\t\t\t\t\n\t\t\t\t\tJavaRDD<Row> eventRDD = finalSet.toJavaRDD();\n\t\t\t\t\tJavaPairRDD<ImmutableBytesWritable, Put> eventpairRDD = eventRDD.mapToPair(new PairFunction<Row, ImmutableBytesWritable, Put>() {\n\n\t\t\t\t\t\tpublic Tuple2<ImmutableBytesWritable, Put> call(Row arg0) throws Exception {\n\t\t\t\t\t\t\tObject link = arg0.getAs(\"articleLink\");\n\t\t\t\t\t\t\tif((String)link != null) {\n\t\t\t\t\t\t\t\t//parameters being populated into the events table\n\t\t\t\t\t\t\t\treturn DashboardUtils.objectsofCuratedEvents(arg0.getAs(\"rssFeed\"), arg0.getAs(\"title\"), link, arg0.getAs(\"description\"), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\targ0.getAs(\"categories\"), arg0.getAs(\"articleDate\"));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn DashboardUtils.objectsofCuratedEvents(arg0.getAs(\"rssFeed\"), arg0.getAs(\"title\"), \"link not available\", arg0.getAs(\"description\"), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\targ0.getAs(\"categories\"), arg0.getAs(\"articleDate\"));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tlogger.info(\"******************************** going to dump curated events data in hbase for event: \" + eventTable);\n\t\t\t\t\teventpairRDD.saveAsNewAPIHadoopDataset(feedevents.getConfiguration());\n\t\t\t\t\t\n\t\t\t\t\teventRDD.unpersist();\n\t\t\t\t\tfinalSet.unpersist();\n\t\t\t\t\tcumulativeSet.unpersist();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tscanner.close();\n\t\t\thTableInterface.close();\n\t\t\thConnection.close();\n\t\t\t\n\t\t} catch(IOException e) {\n\t\t\tlogger.info(\"error while establishing Hbase connection...\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void incremetColumn() {\n setRowAndColumn(row, column + 1);\n }", "private void runOneColumn( TableMeta tmeta ) {\n if ( ! checkHasColumns( tmeta ) ) {\n return;\n }\n final int nr0 = 10;\n String tname = tmeta.getName();\n\n /* Prepare an array of column specifiers corresponding to\n * the first single column in the table. */\n ColumnMeta cmeta1 = tmeta.getColumns()[ 0 ];\n ColSpec cspec1 = new ColSpec( cmeta1 );\n\n /* Check that limiting using TOP works. */\n String tAdql = new StringBuilder()\n .append( \"SELECT TOP \" )\n .append( nr0 )\n .append( \" \" )\n .append( cspec1.getQueryText() )\n .append( \" FROM \" )\n .append( tname )\n .toString();\n StarTable t1 =\n runCheckedQuery( tAdql, -1, new ColSpec[] { cspec1 }, nr0 );\n long nr1 = t1 != null ? t1.getRowCount() : 0;\n assert nr1 >= 0;\n\n /* Check that limiting using MAXREC works. */\n if ( nr1 > 0 ) {\n int nr2 = Math.min( (int) nr1 - 1, nr0 - 1 );\n String mAdql = new StringBuilder()\n .append( \"SELECT \" )\n .append( cspec1.getQueryText() )\n .append( \" FROM \" )\n .append( tname )\n .toString();\n StarTable t2 =\n runCheckedQuery( mAdql, nr2, new ColSpec[] { cspec1 }, -1 );\n if ( t2 != null && ! tapRunner_.isOverflow( t2 ) ) {\n String msg = \"Overflow not marked - no \"\n + \"<INFO name='QUERY_STATUS' value='OVERFLOW'/> \"\n + \"after TABLE\";\n reporter_.report( ReportType.ERROR, \"OVNO\", msg );\n }\n }\n\n /* Check that all known variants (typically \"ADQL\" and \"ADQL-2.0\")\n * work the same. */\n if ( adqlLangs_ != null && adqlLangs_.length > 1 ) {\n List<String> okLangList = new ArrayList<String>();\n List<String> failLangList = new ArrayList<String>();\n for ( int il = 0; il < adqlLangs_.length; il++ ) {\n String lang = adqlLangs_[ il ];\n String vAdql = new StringBuilder()\n .append( \"SELECT TOP 1 \" )\n .append( cspec1.getQueryText() )\n .append( \" FROM \" )\n .append( tname )\n .toString();\n Map<String,String> extraParams =\n new HashMap<String,String>();\n extraParams.put( \"LANG\", lang );\n StarTable result;\n try {\n TapQuery tq = new TapQuery( serviceUrl_, vAdql,\n extraParams, null, 0 );\n result = tapRunner_.getResultTable( reporter_, tq );\n }\n catch ( IOException e ) {\n result = null;\n }\n ( result == null ? failLangList\n : okLangList ).add( lang );\n }\n if ( ! failLangList.isEmpty() && ! okLangList.isEmpty() ) {\n String msg = new StringBuilder()\n .append( \"Some ADQL language variants fail: \" )\n .append( okLangList )\n .append( \" works, but \" )\n .append( failLangList )\n .append( \" doesn't\" )\n .toString();\n reporter_.report( ReportType.ERROR, \"LVER\", msg );\n }\n }\n }", "private void updateRowColumnDisplay() {\n rowAndColumnIndicator.setText(row + \":\" + column);\n }", "private void doNextRow(){\n\t\tmove();\n\t\twhile (frontIsClear()){\n\t\t\talternateBeeper();\n\t\t}\n\t\tcheckPreviousSquare();\t\n\t}", "public void normalizeTable() {\r\n for (int i = 0; i < this.getLogicalColumnCount(); i++) {\r\n normalizeColumn(i);\r\n }\r\n }", "private void setUsedValuesByColumns() {\n //Loop through each column.\n IntStream.rangeClosed(1,9).forEach(i -> {\n //Loop through each position in the row.\n IntStream.rangeClosed(1,9).forEach(j -> {\n //If this value is not set find all the other values in the row and set \n //the possible values of this item to those that are not currently set.\n int column = i;\n Number currentNumber = numbers.stream()\n .filter(n -> n.getRow() == j)\n .filter(n -> n.getColumn() == column)\n .findAny().get();\n if (currentNumber.getValue() < 1) {\n //Used numbers in this column\n List<Integer> usedNumbers = numbers.stream()\n .filter(n -> n.getValue() > 0)\n .filter(n -> n.getRow() != j)\n .filter(n -> n.getColumn() == column)\n .map(Number::getValue)\n .collect(Collectors.toList());\n\n //Figure out where the numbers are different\n if (currentNumber.getUsedValues() == null){\n currentNumber.setUsedValues(usedNumbers);\n }\n else {\n currentNumber.setUsedValues(\n CollectionUtils.union(currentNumber.getUsedValues(), usedNumbers)\n .stream().collect(Collectors.toList()));\n }\n }\n });\n });\n\n }", "@Test\n public void testKeyColumnIndex() throws Exception {\n \tfor(Row r : project.rows) {\n \t\tr.cells.add(0, null);\n \t}\n \tList<Column> newColumns = new ArrayList<>();\n \tfor(Column c : project.columnModel.columns) {\n \t\tnewColumns.add(new Column(c.getCellIndex()+1, c.getName()));\n \t}\n \tproject.columnModel.columns.clear();\n \tproject.columnModel.columns.addAll(newColumns);\n \tproject.columnModel.update();\n \t\n \tAbstractOperation op = new FillDownOperation(\n EngineConfig.reconstruct(\"{\\\"mode\\\":\\\"record-based\\\",\\\"facets\\\":[]}\"),\n \"second\");\n Process process = op.createProcess(project, new Properties());\n process.performImmediate();\n\n Assert.assertEquals(\"c\", project.rows.get(0).cells.get(3).value);\n Assert.assertEquals(\"c\", project.rows.get(1).cells.get(3).value);\n Assert.assertNull(project.rows.get(2).cells.get(3));\n Assert.assertEquals(\"h\", project.rows.get(3).cells.get(3).value);\n }", "protected void updateMeasureValue(Object[] row) {\n for (int i = 0; i < aggregators.length; i++) {\n if (null != row[i]) {\n aggregators[i].agg(row[i]);\n }\n }\n calculateMaxMinUnique();\n }", "public abstract void rowsUpdated(int firstRow, int endRow);", "public void populateDataToTable() throws SQLException {\n model = (DefaultTableModel) tblOutcome.getModel();\n List<Outcome> ouc = conn.loadOutcome();\n int i = 1;\n for (Outcome oc : ouc) {\n Object[] row = new Object[5];\n row[0] = i++;\n row[1] = oc.getCode_outcome();\n row[2] = oc.getTgl_outcome();\n row[3] = oc.getJml_outcome();\n row[4] = oc.getKet_outcome();\n model.addRow(row);\n }\n }", "public final void collapsePlaceHolderCells(final int row){\n\t\tint currentRow = row;\n\t\tint tableSize = table.size();\n\t\twhile (currentRow < (tableSize - 1)){\n\t\t\tRow rowObj = table.get(currentRow);\n\t\t\tRow replacementRow = new Row<T>();\n\t\t\tint columns = rowObj.asList().size();\n\t\t\tfor (int i = 0; i < columns; ++i){\n\t\t\t\tCell cell = rowObj.get(i);\n\t\t\t\tif ((cell != null) && cell.isPlaceholder()){\n\t\t\t\t\treplacementRow.add(table.get(currentRow + 1).get(i));\n\t\t\t\t\ttable.get(currentRow + 1).insert(i, new Cell<T>());\n\t\t\t\t}else{\n\t\t\t\t\treplacementRow.add(table.get(currentRow).get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\ttable.set(currentRow, replacementRow);\n\t\t\t++currentRow;\n\t\t}\n\n\t}", "private void deNormalise(RowMetaInterface rowMeta, Object[] rowData) throws KettleValueException\n\t{\n\t\tValueMetaInterface valueMeta = rowMeta.getValueMeta(data.keyFieldNr);\n\t\tObject valueData = rowData[data.keyFieldNr];\n\t\tString key = valueMeta.getCompatibleString(valueData);\n if ( !Const.isEmpty(key) )\n {\n // Get all the indexes for the given key value...\n \t// \n List<Integer> indexes = data.keyValue.get(key);\n if (indexes!=null) // otherwise we're not interested.\n {\n for (int i=0;i<indexes.size();i++)\n {\n Integer keyNr = indexes.get(i);\n if (keyNr!=null)\n {\n // keyNr is the field in DenormaliserTargetField[]\n //\n int idx = keyNr.intValue();\n DenormaliserTargetField field = meta.getDenormaliserTargetField()[idx];\n \n // This is the value we need to de-normalise, convert, aggregate.\n //\n ValueMetaInterface sourceMeta = rowMeta.getValueMeta(data.fieldNameIndex[idx]);\n Object sourceData = rowData[data.fieldNameIndex[idx]];\n Object targetData;\n // What is the target value metadata??\n // \n ValueMetaInterface targetMeta = data.outputRowMeta.getValueMeta(data.inputRowMeta.size()-data.removeNrs.length+idx);\n // What was the previous target in the result row?\n //\n Object prevTargetData = data.targetResult[idx];\n \n switch(field.getTargetAggregationType())\n {\n case DenormaliserTargetField.TYPE_AGGR_SUM:\n targetData = targetMeta.convertData(sourceMeta, sourceData);\n \tif (prevTargetData!=null)\n \t{\n \t\tprevTargetData = ValueDataUtil.plus(targetMeta, prevTargetData, targetMeta, targetData);\n \t}\n \telse\n \t{\n \t\tprevTargetData = targetData;\n \t}\n break;\n case DenormaliserTargetField.TYPE_AGGR_MIN:\n if (sourceMeta.compare(sourceData, targetMeta, prevTargetData)<0) {\n \tprevTargetData = targetMeta.convertData(sourceMeta, sourceData);\n }\n break;\n case DenormaliserTargetField.TYPE_AGGR_MAX:\n if (sourceMeta.compare(sourceData, targetMeta, prevTargetData)>0) {\n \tprevTargetData = targetMeta.convertData(sourceMeta, sourceData);\n }\n break;\n case DenormaliserTargetField.TYPE_AGGR_COUNT_ALL:\n prevTargetData = ++data.counters[idx];\n break;\n case DenormaliserTargetField.TYPE_AGGR_AVERAGE:\n targetData = targetMeta.convertData(sourceMeta, sourceData);\n if (!sourceMeta.isNull(sourceData)) \n {\n prevTargetData = data.counters[idx]++;\n if (data.sum[idx]==null)\n {\n \tdata.sum[idx] = targetData;\n }\n else\n {\n \tdata.sum[idx] = ValueDataUtil.plus(targetMeta, data.sum[idx], targetMeta, targetData);\n }\n // data.sum[idx] = (Integer)data.sum[idx] + (Integer)sourceData;\n }\n break;\n case DenormaliserTargetField.TYPE_AGGR_CONCAT_COMMA:\n String separator=\",\";\n\n targetData = targetMeta.convertData(sourceMeta, sourceData);\n if (prevTargetData!=null)\n {\n prevTargetData = prevTargetData+separator+targetData;\n }\n else\n {\n prevTargetData = targetData;\n }\n break;\n case DenormaliserTargetField.TYPE_AGGR_NONE:\n default:\n targetData = targetMeta.convertData(sourceMeta, sourceData);\n prevTargetData = targetMeta.convertData(sourceMeta, sourceData); // Overwrite the previous\n break;\n }\n \n // Update the result row too\n //\n data.targetResult[idx] = prevTargetData;\n }\n }\n }\n }\n\t}", "private void expandTree() {\n for (int i=0; i<tree.getRowCount(); i++) {\n tree.expandRow(i);\n }\n }", "@Override\r\n public Entity row(Entity entity) {\n int estimated = EntityTools.getIntField(entity, \"estimated\");\r\n int dayWhenInProgress = EntityTools.removeIntField(entity, \"day-when-in-progress\");\r\n int newEstimated = EntityTools.removeIntField(entity, \"new-estimated\");\r\n int newRemaining = EntityTools.removeIntField(entity, \"new-remaining\");\r\n int dayWhenCompleted = EntityTools.removeIntField(entity, \"day-when-completed\");\r\n String originalTeamId = EntityTools.removeField(entity, \"team-id\");\r\n Entity response = super.row(entity);\r\n String agmId;\r\n try {\r\n agmId = response.getId().toString();\r\n } catch (FieldNotFoundException e) {\r\n throw new IllegalStateException(e);\r\n }\r\n\r\n if (dayWhenCompleted >= 0 && dayWhenInProgress >= 0) {\r\n if (dayWhenCompleted <= dayWhenInProgress) {\r\n log.warn(\"Day to be in progress (\"+dayWhenInProgress+\") is after the day to be completed (\"+dayWhenCompleted+\")\");\r\n }\r\n }\r\n if (dayWhenInProgress > 0) {\r\n List<Object> work = workCalendar.get(dayWhenInProgress);\r\n if (work == null) {\r\n work = new LinkedList<>();\r\n workCalendar.put(dayWhenInProgress, work);\r\n }\r\n work.add(\"In Progress\");\r\n work.add(agmId);\r\n work.add(estimated);\r\n work.add(newEstimated);\r\n work.add(newRemaining);\r\n work.add(originalTeamId);\r\n log.debug(\"On day \"+dayWhenInProgress+\" task \"+agmId+\" belonging to \"+originalTeamId+\" switching to In Progress; remaining set to \"+newRemaining);\r\n }\r\n if (dayWhenCompleted > 0) {\r\n List<Object> work = workCalendar.get(dayWhenCompleted);\r\n if (work == null) {\r\n work = new LinkedList<>();\r\n workCalendar.put(dayWhenCompleted, work);\r\n }\r\n work.add(\"Completed\");\r\n work.add(agmId);\r\n work.add(newEstimated);\r\n work.add(originalTeamId);\r\n log.debug(\"On day \"+dayWhenCompleted+\" task \"+agmId+\" belonging to \"+originalTeamId+\" switching to Completed; remaining set to \"+0);\r\n }\r\n return response;\r\n }", "static void Do(){\n \trow1.start(); \n \trow2.start();\t \n \trow3.start(); \n \t}", "@Override\r\n\t public void onEachRow(String rowID, O2GRow rowData) {\n\t O2GTableColumnCollection collection = rowData.getColumns();\r\n\t for (int i = 0; i < collection.size(); i++) {\r\n\t O2GTableColumn column = collection.get(i);\r\n\t System.out.println(column.getId() + \"=\" + rowData.getCell(i) + \";\");\r\n\t }\r\n\t\t}", "public void compactUp() {\n\t// Iteramos a través del tablero partiendo de la primera fila\n\t// y primera columna. Si esta contiene un 0 y la fila posterior\n\t// de la misma columna es distinta de 0, el valor se intercambia.\n\t// El proceso se repite hasta que todas las posiciones susceptibles\n\t// al cambio se hayan comprobado.\n\tfor (int i = 0; i < board.length; i++) {\n\t for (int j = 0; j < board.length - 1; j++) {\n\t\tif (board[j][i] == EMPTY && board[j + 1][i] != EMPTY) {\n\t\t board[j][i] = board[j + 1][i];\n\t\t board[j + 1][i] = EMPTY;\n\t\t compactUp();\n\t\t}\n\t }\n\t}\n }", "private void buildRowMapping() {\n final Map<String, ColumnDescriptor> targetSource = new TreeMap<>();\n\n // build a DB path .. find parent node that terminates the joint group...\n PrefetchTreeNode jointRoot = this;\n while (jointRoot.getParent() != null && !jointRoot.isDisjointPrefetch()\n && !jointRoot.isDisjointByIdPrefetch()) {\n jointRoot = jointRoot.getParent();\n }\n\n final String prefix;\n if (jointRoot != this) {\n Expression objectPath = ExpressionFactory.pathExp(getPath(jointRoot));\n ASTPath translated = (ASTPath) ((PrefetchProcessorNode) jointRoot)\n .getResolver()\n .getEntity()\n .translateToDbPath(objectPath);\n\n // make sure we do not include \"db:\" prefix\n prefix = translated.getOperand(0) + \".\";\n } else {\n prefix = \"\";\n }\n\n // find propagated keys, assuming that only one-step joins\n // share their column(s) with parent\n\n if (getParent() != null\n && !getParent().isPhantom()\n && getIncoming() != null\n && !getIncoming().getRelationship().isFlattened()) {\n\n DbRelationship r = getIncoming()\n .getRelationship()\n .getDbRelationships()\n .get(0);\n for (final DbJoin join : r.getJoins()) {\n appendColumn(targetSource, join.getTargetName(), prefix\n + join.getTargetName());\n }\n }\n\n ClassDescriptor descriptor = resolver.getDescriptor();\n\n descriptor.visitAllProperties(new PropertyVisitor() {\n\n public boolean visitAttribute(AttributeProperty property) {\n String target = property.getAttribute().getDbAttributePath();\n if(!property.getAttribute().isLazy()) {\n appendColumn(targetSource, target, prefix + target);\n }\n return true;\n }\n\n public boolean visitToMany(ToManyProperty property) {\n return visitRelationship(property);\n }\n\n public boolean visitToOne(ToOneProperty property) {\n return visitRelationship(property);\n }\n\n private boolean visitRelationship(ArcProperty arc) {\n DbRelationship dbRel = arc.getRelationship().getDbRelationships().get(0);\n for (DbAttribute attribute : dbRel.getSourceAttributes()) {\n String target = attribute.getName();\n\n appendColumn(targetSource, target, prefix + target);\n }\n return true;\n }\n });\n\n // append id columns ... (some may have been appended already via relationships)\n for (String pkName : descriptor.getEntity().getPrimaryKeyNames()) {\n appendColumn(targetSource, pkName, prefix + pkName);\n }\n\n // append inheritance discriminator columns...\n for (ObjAttribute column : descriptor.getDiscriminatorColumns()) {\n String target = column.getDbAttributePath();\n appendColumn(targetSource, target, prefix + target);\n }\n\n int size = targetSource.size();\n this.rowCapacity = (int) Math.ceil(size / 0.75);\n this.columns = new ColumnDescriptor[size];\n targetSource.values().toArray(columns);\n }", "private void populateMatrixCursorRow(int row, Cursor cursor) {\n cursor.moveToFirst();\n String name = cursor.getString(QUERY_DISPLAY_NAME_INDEX);\n int type = cursor.getInt(QUERY_LABEL_INDEX);\n String label = \"\";\n if (type == 0) {\n label = cursor.getString(QUERY_CUSTOM_LABEL_INDEX);\n } else {\n label = (String) CommonDataKinds.Phone.getTypeLabel(getResources(), type, null);\n }\n String number = cursor.getString(QUERY_NUMBER_INDEX);\n long photoId = cursor.getLong(QUERY_PHOTO_ID_INDEX);\n int simId = -1;\n if (!cursor.isNull(QUERY_INDICATE_PHONE_SIM_INDEX)) {\n simId = cursor.getInt(QUERY_INDICATE_PHONE_SIM_INDEX);\n }\n Log.i(TAG, \"populateMatrixCursorRow(), name = \" + name + \", label = \" + label\n + \", number = \" + number + \" photoId:\" + photoId + \"simId: \" + simId);\n\t\t\n if(simId > 0){\n photoId = getSimType(simId);\n }\n\t\t\n if (TextUtils.isEmpty(number)) {\n populateMatrixCursorEmpty(this, mMatrixCursor, row, row + 1);\n mPrefNumState[row] = mPref.getString(String.valueOf(row), \"\");\n mPrefMarkState[row] = mPref.getInt(String.valueOf(offset(row)), -1);\n return;\n }\n mMatrixCursor.addRow(new String[] {\n String.valueOf(row + 1), name, label, \n //PhoneNumberUtils.formatNumber(number),\n number,\n String.valueOf(photoId), String.valueOf(simId)\n });\n }", "private void reduce(){\n int min;\n //Subtract min value from rows\n for (int i = 0; i < rows; i++) {\n min = source[i][0];\n for (int j = 1; j < cols; j++)\n if(source[i][j] < min) min = source[i][j];\n\n for (int j = 0; j < cols; j++)\n source[i][j] -= min;\n }\n\n //Subtract min value from cols\n for (int j = 0; j < cols; j++) {\n min = source[0][j];\n for (int i = 1; i < rows; i++)\n if(source[i][j] < min) min = source[i][j];\n\n for (int i = 0; i < rows; i++)\n source[i][j] -= min;\n\n }\n }", "@Override\n\tprotected void runData(Query query) throws SQLException {\n\t\tStringBuilder q = new StringBuilder();\n\t\tArrayList<Integer> destinationList = new ArrayList<Integer>();\n\t\tquery.inc(2);\n\t\twhile (!isData(query.part()) || !isComment(query.part()) || !isCode(query.part())) {\n\t\t\tq.append(query.part());\n\t\t\tq.append(\" \");\n\t\t\tquery.inc();\n\t\t}\n\t\tArrayList<Integer> originList = getLinesFromData(q.toString());\n\t\tparseSecondCondition(query, originList, destinationList);\n\t}", "public void buildRows(View view, String rowTemplate, UifFormBase model) {\r\n if (StringUtils.isBlank(rowTemplate)) {\r\n return;\r\n }\r\n\r\n rowTemplate = StringUtils.removeEnd(rowTemplate, \",\");\r\n rowTemplate = rowTemplate.replace(\"\\n\", \"\");\r\n rowTemplate = rowTemplate.replace(\"\\r\", \"\");\r\n\r\n StringBuffer rows = new StringBuffer();\r\n List<Object> collectionObjects = ObjectPropertyUtils.getPropertyValue(model, bindingInfo.getBindingPath());\r\n\r\n //uncheck any checked checkboxes globally for this row\r\n rowTemplate = rowTemplate.replace(\"checked=\\\"checked\\\"\", \"\");\r\n\r\n //init token patterns\r\n Pattern idPattern = Pattern.compile(ID_TOKEN + \"(.*?)\" + ID_TOKEN);\r\n Pattern expressionPattern = Pattern.compile(EXPRESSION_TOKEN + \"(.*?)\" + EXPRESSION_TOKEN);\r\n\r\n ExpressionEvaluator expressionEvaluator = ViewLifecycle.getExpressionEvaluator();\r\n expressionEvaluator.initializeEvaluationContext(model);\r\n\r\n int lineIndex = 0;\r\n for (Object obj : collectionObjects) {\r\n //add line index to all ids\r\n String row = idPattern.matcher(rowTemplate).replaceAll(\"$1\" + UifConstants.IdSuffixes.LINE + lineIndex);\r\n\r\n //create the expanded context\r\n Map<String, Object> expandedContext = new HashMap<String, Object>();\r\n expandedContext.put(UifConstants.ContextVariableNames.LINE, obj);\r\n expandedContext.put(UifConstants.ContextVariableNames.INDEX, lineIndex);\r\n expandedContext.put(UifConstants.ContextVariableNames.VIEW, view);\r\n\r\n currentColumnValue = \"\";\r\n\r\n int itemIndex = 0;\r\n for (Component item : this.getItems()) {\r\n //determine original id for this component\r\n String originalId = initialComponentIds.get(itemIndex);\r\n\r\n //special DataField handling\r\n row = handleDataFieldInRow(item, obj, row, lineIndex, originalId);\r\n\r\n //special InputField handling\r\n row = handleInputFieldInRow(item, obj, row, lineIndex, originalId);\r\n\r\n //add item context\r\n if (item.getContext() != null) {\r\n expandedContext.putAll(item.getContext());\r\n }\r\n\r\n //evaluate expressions found by the pattern\r\n row = evaluateAndReplaceExpressionValues(row, lineIndex, model, expandedContext, expressionPattern,\r\n expressionEvaluator);\r\n\r\n if (currentColumnValue == null) {\r\n currentColumnValue = \"\";\r\n }\r\n\r\n row = row.replace(SORT_VALUE + itemIndex + A_TOKEN, currentColumnValue);\r\n\r\n itemIndex++;\r\n }\r\n\r\n // get rowCss class\r\n boolean isOdd = lineIndex % 2 == 0;\r\n String rowCss = KRADUtils.generateRowCssClassString(conditionalRowCssClasses, lineIndex, isOdd,\r\n expandedContext, expressionEvaluator);\r\n\r\n row = row.replace(\"\\\"\", \"\\\\\\\"\");\r\n row = row.replace(ROW_CLASS, rowCss);\r\n row = \"{\" + row + \"},\";\r\n\r\n //special render property expression handling\r\n row = evaluateRenderExpressions(row, lineIndex, model, expandedContext, expressionEvaluator);\r\n\r\n //append row\r\n rows.append(row);\r\n lineIndex++;\r\n }\r\n\r\n StringBuffer tableToolsColumnOptions = new StringBuffer(\"[\");\r\n for (int index = 0; index < this.getItems().size(); index++) {\r\n String colOptions = richTable.constructTableColumnOptions(index, true, false, String.class, null);\r\n tableToolsColumnOptions.append(colOptions + \" , \");\r\n }\r\n\r\n String aoColumnDefs = StringUtils.removeEnd(tableToolsColumnOptions.toString(), \" , \") + \"]\";\r\n Map<String, String> rtTemplateOptions = richTable.getTemplateOptions();\r\n \r\n if (rtTemplateOptions == null) {\r\n richTable.setTemplateOptions(rtTemplateOptions = new HashMap<String, String>());\r\n }\r\n \r\n rtTemplateOptions.put(UifConstants.TableToolsKeys.AO_COLUMN_DEFS, aoColumnDefs);\r\n\r\n // construct aaData option to set data in dataTable options (speed enhancement)\r\n String aaData = StringUtils.removeEnd(rows.toString(), \",\");\r\n aaData = \"[\" + aaData + \"]\";\r\n aaData = aaData.replace(KRADConstants.QUOTE_PLACEHOLDER, \"\\\"\");\r\n\r\n //set the aaData option on datatable for faster rendering\r\n rtTemplateOptions.put(UifConstants.TableToolsKeys.AA_DATA, aaData);\r\n\r\n //make sure deferred rendering is forced whether set or not\r\n rtTemplateOptions.put(UifConstants.TableToolsKeys.DEFER_RENDER,\r\n UifConstants.TableToolsValues.TRUE);\r\n }", "protected abstract E modifyRow(E rowObject);", "private void execute() throws IOException {\n\n\t\t//////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t// Gets the info from the file and puts in in an arraylist of arraylists\n\t\t//////////////////////////////////////////////////////////////////////////////////////////////////////\n\n\t\tStringTokenizer st;\n\t\tBufferedReader TSVFile = new BufferedReader(new FileReader(inputFile));\n\t\tString dataRow = TSVFile.readLine(); // Read first line.\n\n\t\tArrayList<ArrayList<String>> data = new ArrayList<ArrayList<String>>();\n\n\t\twhile (dataRow != null) {\n\t\t\tst = new StringTokenizer(dataRow, \"\\t\");\n\t\t\tArrayList<String> dataArray = new ArrayList<String>();\n\t\t\twhile (st.hasMoreElements()) {\n\t\t\t\tdataArray.add(st.nextElement().toString());\n\t\t\t}\n\n\t\t\tdata.add(dataArray);\n\n\t\t\tdataRow = TSVFile.readLine(); // Read next line of data.\n\t\t}\n\t\tTSVFile.close();\n\n\t\tfor (int i = 1; i < data.size(); i++) {\n\t\t\tdata.get(i).remove(3);\n\t\t\tdata.get(i).remove(3);\n\t\t\tdata.get(i).remove(3);\n\t\t}\n\t\t//////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t//////////////////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t// removes time and position from title\n\t\tdata.get(0).remove(3);\n\t\tdata.get(0).remove(3);\n\n\t\t// creates the null element to replace unnecessary info in arraylist\n\t\tArrayList<String> nullElement = new ArrayList<String>();\n\t\tnullElement.add(\"null\");\n\n\t\t// replaces unnecessary info with the null element\n\t\tfor (int i = 1; i < data.size(); i += 1) {\n\t\t\tif (!(Double.parseDouble(data.get(i).get(2)) == num1) && !(Double.parseDouble(data.get(i).get(2)) == num2))\n\t\t\t\tdata.set(i, nullElement);\n\t\t}\n\n\t\t// removes all null elements\n\t\tdata.removeIf(nullElement::equals);\n\n\t\t// zeros the data\n\t\tdata = zeroingData(data);\n\n\t\t// adds the area under the curve to the header\n\t\tdata = addAreaUnderCurve(data);\n\n\t\t// saves the data\n\t\tresult = data;\n\n\t\t// prints the table\n\t\tprintTable(data);\n\n\t}", "public void addColumns(Column[] cols) {\n\n\t\t//\t\t\tAllocate a new array.\n\t\tint number = cols.length;\n\t\tint cnt = columns.length + number;\n\t\tColumn[] newColumns = new Column[cnt];\n\n\t\t// copy current columns.\n\t\tSystem.arraycopy(columns, 0, newColumns, 0, columns.length);\n\n\t\t//\t\t\tANCA: need to expand the Column[] cols\n\n\t\tfor (int k = 0; k < cols.length; k++) {\n\n\t\t\tString columnClass = (cols[k].getClass()).getName();\n\t\t\tColumn expandedColumn = null;\n\n\t\t\t//if col is the first column in the table add it as is and initialize subset\n\t\t\tint numRows = super.getNumRows();\n\t\t\tif (columns.length == 0) {\n\t\t\t\tif (subset.length == 0) {\n\t\t\t\t\tnumRows = cols[k].getNumRows();\n\t\t\t\t\tsubset = new int[numRows];\n\t\t\t\t\tfor (int i = 0; i < this.getNumRows(); i++) {\n\t\t\t\t\t\tsubset[i] = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// LAM-tlr, I moved this down from inside the above condition. If it is\n\t\t\t\t// inside the condition above, after the first column is added, the rest of\n\t\t\t\t// the columns are empty.\n\t\t\t\texpandedColumn = cols[k];\n\t\t\t} else {\n\t\t\t\t// LAM-tlr, I moved this down from above. If we are to use the column\n\t\t\t\t// as is, we don't need to reallocate it.\n\t\t\t\ttry {\n\t\t\t\t\texpandedColumn =\n\t\t\t\t\t\t(Column) Class.forName(columnClass).newInstance();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(e);\n\t\t\t\t}\n\t\t\t\texpandedColumn.addRows(numRows);\n\t\t\t\texpandedColumn.setLabel(cols[k].getLabel());\n\t\t\t\texpandedColumn.setComment(cols[k].getComment());\n\t\t\t\texpandedColumn.setIsScalar(cols[k].getIsScalar());\n\t\t\t\texpandedColumn.setIsNominal(cols[k].getIsNominal());\n\n\t\t\t\t//initialize all values as missing for the beginning\n\t\t\t\tfor (int j = 0; j < numRows; j++)\n\t\t\t\t\texpandedColumn.setValueToMissing(true, j);\n\n\t\t\t\t//set the elements of the column where appropriate as determined by subset\n\t\t\t\tObject el;\n\t\t\t\tfor (int i = 0; i < subset.length; i++) {\n\t\t\t\t\tel = cols[k].getObject(i);\n\t\t\t\t\texpandedColumn.setObject(el, subset[i]);\n\t\t\t\t\texpandedColumn.setValueToMissing(false, subset[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tnewColumns[columns.length + k] = expandedColumn;\n\t\t}\n\t\tcolumns = newColumns;\n\n\t}", "public static void method1(int numRows) {\n List<List<Integer>> pt = new ArrayList<>();\n List<Integer> row, pre = null;\n for (int i = 0; i < numRows; ++i) {\n row = new ArrayList<>();\n for (int j = 0; j <= i; ++j) {\n if (j == 0 || j == i) {\n row.add(1);\n } else {\n row.add(pre.get(j - 1) + pre.get(j));\n }\n }\n pre = row;\n pt.add(row);\n }\n\n for (List<Integer> a : pt) {\n for (int i: a) {\n System.out.print(i + \" \");\n }\n System.out.println();\n }\n }", "private static void insertApprovedRows(Table resultTable, String[] requestedColumns, Cursor[] allTables) {\n\n\t\tObject[] resultRow = new Object[requestedColumns.length];\n\n\t\tfor (int i = 0; i < requestedColumns.length; ++i) {\n\t\t\tfor (int table = 0; table < allTables.length; ++table) {\n\t\t\t\ttry {\n\t\t\t\t\tresultRow[i] = allTables[table].column(requestedColumns[i]);\n\t\t\t\t\tbreak; // if the assignment worked, do the next column\n\t\t\t\t} catch (Exception e) { // otherwise, try the next table\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tresultTable.insert( /* requestedColumns, */ resultRow);\n\t}", "private RowData() {\n initFields();\n }", "private void processSelectedOption(int row, int col) {\n if (action.equals(Action.HEAL)) {\n\n processHealing();\n } else {\n desiredField = fields[row][col];\n\n Figure currentFigure = currentField.getCurrentFigure();\n\n int desiredRow = desiredField.getY();\n int desiredCol = desiredField.getX();\n int currentRow = currentField.getY();\n int currentCol = currentField.getX();\n\n if (Action.MOVE.equals(action) && currentFigure.getOwner().equals(currentPlayer)) {\n\n processMoving(currentFigure, desiredRow, desiredCol, currentRow, currentCol);\n\n } else if (Action.ATTACK.equals(action) ) {\n\n processAttack(currentFigure);\n }\n\n }\n }", "@Override\n\t\t\t\tpublic void rowsUpdated(int firstRow, int endRow, int column) {\n\n\t\t\t\t}", "public void shiftRows(int[][] matrix) {\r\n\t\t//initialize and show header\r\n\t\tinitializeAnimalHeader();\r\n\t\tlang.nextStep();\r\n\t\t//initialize and show description\r\n\t\tinitializeDescription();\r\n\t\tlang.nextStep();\r\n\t\t//hide description, initialize and show all elements relevant for the computation\r\n\t\thideDescription();\r\n\t\tinitialzieAnimalMatrix(matrix);\r\n\t\tinitializeAnimalShiftRowSourceCode();\r\n\t\tinitializeAnimalShiftLeftSourceCode();\r\n\t\tinitializeAnimalRowText();\r\n\t\tinitializeAnimalIText();\r\n\t\tinititalzeAnimalMatrixCounter();\r\n\t\t//some source code highlighting to show which java code\r\n\t\t//is equivalent to the current state of the animation\r\n\t\tshiftRowSc.highlight(0);\r\n\t\tshiftRowSc.highlight(4);\r\n\t\tlang.nextStep();\r\n\t\tshiftRowSc.unhighlight(0);\r\n\t\tshiftRowSc.unhighlight(4);\r\n\t\tshiftRowSc.highlight(1);\r\n\t\tshiftRowSc.highlight(3);\r\n\t\t//initialize element that shows current state of loop variable\r\n\t\trowText.setText(\"row = 0\", new TicksTiming(0), new TicksTiming(0));\r\n\t\trowText.show();\r\n\t\thighlightText(rowText);\r\n\t\tseparatorLine.show();\r\n\t\tfor (int row = 0; row < matrix.length; row++) {\r\n\t\t\tlang.nextStep();\r\n\t\t\t//some source code highlighting to show which java code\r\n\t\t\t//is equivalent to the current state of the animation\r\n\t\t\tshiftRowSc.unhighlight(1);\r\n\t\t\tshiftRowSc.unhighlight(3);\r\n\t\t\tshiftRowSc.highlight(2);\r\n\t\t\tunhighlightText(rowText);\r\n\t\t\tlang.nextStep();\r\n\t\t\t//call shifts for each row in. first execute the java code then generate\r\n\t\t\t//the equivalent animal code\r\n\t\t\tshiftLeft(matrix, row);\r\n\t\t\tshiftLeftAnimal(row);\r\n\t\t\t//some source code highlighting to show which java code\r\n\t\t\t//is equivalent to the current state of the animation\r\n\t\t\tshiftRowSc.unhighlight(2);\r\n\t\t\tshiftRowSc.highlight(1);\r\n\t\t\tshiftRowSc.highlight(3);\r\n\t\t\trowText.setText(\"row = \" + (row + 1), new TicksTiming(0),\r\n\t\t\t\t\tnew TicksTiming(0));\r\n\t\t\thighlightText(rowText);\r\n\t\t}\r\n\t\tlang.nextStep();\r\n\t\tshiftRowSc.unhighlight(1);\r\n\t\tshiftRowSc.unhighlight(3);\r\n\t\trowText.hide();\r\n\t\tunhighlightText(rowText);\r\n\t\tseparatorLine.hide();\r\n\t\tlang.nextStep();\r\n\t\t//show final slide hide irrelevant computation elements\r\n\t\thideComputation();\r\n\t\tinitializeFinalSlide();\r\n\t}", "private void forward() {\n index++;\n column++;\n if(column == linecount + 1) {\n line++;\n column = 0;\n linecount = content.getColumnCount(line);\n }\n }", "protected void addNewRow(Object[] row) {\n for (int i = 0; i < aggregators.length; i++) {\n if (null != row[i]) {\n this.isNotNullValue[i] = true;\n aggregators[i].agg(row[i]);\n }\n }\n prvKey = (byte[]) row[this.keyIndex];\n calculateMaxMinUnique();\n }", "public void onColMajorFillButtonClick()\n {\n // Create a warning dialog box (JOptionPane).\n JOptionPane.showMessageDialog(null,\n \"The method for column-major traversals \" +\n \"has not been implemented yet.\",\n \"Under Development\",\n JOptionPane.WARNING_MESSAGE);\n }", "private void repopulateTableForDelete()\n {\n clearTable();\n populateTable(null);\n }", "private void fetchStringValue(Tuple next, String columnName,\n ColumnValueAnalysisResult result) throws IOException,\n AnalysisException, ExecException {\n\t\tInteger order = AlpinePigSummaryStatistics.analyzingColumns.length*generator.getColumnOrder(columnName);\n\t\t//order = 0;\n\n\t\tresult.setMaxNA(true);\n\t\tresult.setQ1NA(true);\n\t\tresult.setMedianNA(true);\n\t\tresult.setQ3NA(true);\n\t\tresult.setMinNA(true);\n\t\tresult.setAvgNA(true);\n\t\tresult.setDeviationNA(true);\n\t\tresult.setZeroCountNA(true);\n\t\tresult.setPositiveValueCountNA(true);\n\t\tresult.setNegativeValueCountNA(true);\n\n\t\tresult.setMinNA(true);\n\n\t\tresult.setCount(null==next.get(order+1)?0:DataType.toLong(next.get(order+1)));\n\t\tresult.setUniqueValueCount(null==next.get(order+7)?0:DataType.toLong(next.get(order+7)));\n\t\tresult.setNullCount(null==next.get(order+2)?0:DataType.toLong(next.get(order+2)));\n\t\tresult.setEmptyCount(null==next.get(order+2)?0:DataType.toLong(next.get(order+2)));\n\t\tif(-1==result.getUniqueValueCount()){\n\t\t\tresult.setUniqueValueCountNA(true);\n\t\t}\n\n\t\tresult.setTop01Value(null == next.get(order + 14) ? 0 : (next.get(order + 14)));\n\t\tresult.setTop01Count(null == next.get(order + 15) ? 0 : DataType.toLong(next.get(order + 15)));\n\t\tresult.setTop02Value(null == next.get(order + 16) ? 0 : (next.get(order + 16)));\n\t\tresult.setTop02Count(null == next.get(order + 17) ? 0 : DataType.toLong(next.get(order + 17)));\n\t\tresult.setTop03Value(null == next.get(order + 18) ? 0 : (next.get(order + 18)));\n\t\tresult.setTop03Count(null == next.get(order + 19) ? 0 : DataType.toLong(next.get(order + 19)));\n\t\tresult.setTop04Value(null == next.get(order + 20) ? 0 : (next.get(order + 20)));\n\t\tresult.setTop04Count(null == next.get(order + 21) ? 0 : DataType.toLong(next.get(order + 21)));\n\t\tresult.setTop05Value(null == next.get(order + 22) ? 0 : (next.get(order + 22)));\n\t\tresult.setTop05Count(null == next.get(order + 23) ? 0 : DataType.toLong(next.get(order + 23)));\n\t\tresult.setTop06Value(null == next.get(order + 24) ? 0 : (next.get(order + 24)));\n\t\tresult.setTop06Count(null == next.get(order + 25) ? 0 : DataType.toLong(next.get(order + 25)));\n\t\tresult.setTop07Value(null == next.get(order + 26) ? 0 : (next.get(order + 26)));\n\t\tresult.setTop07Count(null == next.get(order + 27) ? 0 : DataType.toLong(next.get(order + 27)));\n\t\tresult.setTop08Value(null == next.get(order + 28) ? 0 : (next.get(order + 28)));\n\t\tresult.setTop08Count(null == next.get(order + 29) ? 0 : DataType.toLong(next.get(order + 29)));\n\t\tresult.setTop09Value(null == next.get(order + 30) ? 0 : (next.get(order + 30)));\n\t\tresult.setTop09Count(null == next.get(order + 31) ? 0 : DataType.toLong(next.get(order + 31)));\n\t\tresult.setTop10Value(null == next.get(order + 32) ? 0 : (next.get(order + 32)));\n\t\tresult.setTop10Count(null == next.get(order + 33) ? 0 : DataType.toLong(next.get(order + 33)));\n\n\n\t}", "private void validate() {\n for (DBRow row : rows) {\n for (DBColumn column : columns) {\n Cell cell = Cell.at(row, column);\n DBValue value = values.get(cell);\n notNull(value,\"Cell \" + cell);\n }\n }\n }" ]
[ "0.5806786", "0.57867146", "0.5702131", "0.5677117", "0.56665146", "0.5665352", "0.564499", "0.5643232", "0.5640282", "0.55724794", "0.55243057", "0.55040187", "0.5470449", "0.54140735", "0.541286", "0.5334739", "0.53167003", "0.5299382", "0.5250529", "0.52478737", "0.522936", "0.52281547", "0.52092177", "0.519758", "0.5179138", "0.51529664", "0.5148566", "0.5147216", "0.5145364", "0.5144272", "0.5144272", "0.5143548", "0.5135731", "0.5112921", "0.5106677", "0.5105172", "0.5100825", "0.50972927", "0.50900203", "0.5080403", "0.5076278", "0.5070912", "0.50645643", "0.5063943", "0.506345", "0.5063251", "0.50598514", "0.505357", "0.50443226", "0.5041058", "0.502984", "0.50239414", "0.501702", "0.5005685", "0.49887636", "0.4988502", "0.4984654", "0.49845633", "0.4971996", "0.4968051", "0.49665943", "0.49643663", "0.49619353", "0.49586326", "0.49486747", "0.49454254", "0.49436593", "0.49404374", "0.49376315", "0.4922437", "0.49173146", "0.49166", "0.4913454", "0.4904589", "0.49022073", "0.49020025", "0.49009058", "0.4899344", "0.48975047", "0.48892722", "0.48876345", "0.4886043", "0.48827666", "0.4878566", "0.48729512", "0.48723868", "0.48720938", "0.48707125", "0.48684222", "0.48668364", "0.48644042", "0.48641273", "0.48618892", "0.48602816", "0.48599273", "0.48567015", "0.48521185", "0.4846125", "0.48425496", "0.48413947", "0.48359093" ]
0.0
-1
System.out.println("==>"+new Throwable().getStackTrace()[0].getClassName()+" > "+new Throwable().getStackTrace()[0].getMethodName()); System.out.println("===>Line number: "+new Throwable().getStackTrace()[0].getLineNumber());
public static utilitys getInstance(){ return instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String callMethodAndLine() {\n\t\tStackTraceElement thisMethodStack = (new Exception()).getStackTrace()[4];\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb\n.append(AT)\n\t\t\t\t.append(thisMethodStack.getClassName() + \".\")\n\t\t\t\t.append(thisMethodStack.getMethodName())\n\t\t\t\t.append(\"(\" + thisMethodStack.getFileName())\n\t\t\t\t.append(\":\" + thisMethodStack.getLineNumber() + \") \");\n\t\treturn sb.toString();\n\t}", "public static int getLineNumber() {\n return Thread.currentThread().getStackTrace()[2].getLineNumber();\n }", "private static String getCallingMethodInfo()\r\n\t{\r\n\t\tThrowable fakeException = new Throwable();\r\n\t\tStackTraceElement[] stackTrace = fakeException.getStackTrace();\r\n\r\n\t\tif (stackTrace != null && stackTrace.length >= 2)\r\n\t\t{\r\n\t\t\tStackTraceElement s = stackTrace[2];\r\n\t\t\tif (s != null)\r\n\t\t\t{\r\n\t\t\t\treturn s.getFileName() + \"(\" + s.getMethodName() + \":\" + s.getLineNumber() + \"):\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}", "public static String getStackTrace() {\n Exception e = new Exception();\n return getStackTrace(e);\n }", "public int getStackDepth()\n/* */ {\n/* 139 */ StackTraceElement[] stes = new Exception().getStackTrace();\n/* 140 */ int len = stes.length;\n/* 141 */ for (int i = 0; i < len; i++) {\n/* 142 */ StackTraceElement ste = stes[i];\n/* 143 */ if (ste.getMethodName().equals(\"_runExecute\"))\n/* */ {\n/* 145 */ return i - 1;\n/* */ }\n/* */ }\n/* 148 */ throw new AssertionError(\"Expected task to be run by WorkerThread\");\n/* */ }", "String getLogStackTrace();", "public static String getCurrentMethodName() {\n Exception e = new Exception();\n StackTraceElement trace = e.fillInStackTrace().getStackTrace()[1];\n String name = trace.getMethodName();\n String className = trace.getClassName();\n int line = trace.getLineNumber();\n return \"[CLASS:\" + className + \" - METHOD:\" + name + \" LINE:\" + line + \"]\";\n }", "public void testGetStackTrace() {\n StackTraceElement[] ste = new StackTraceElement[1]; \n ste[0] = new StackTraceElement(\"class\", \"method\", \"file\", -2);\n Throwable th = new Throwable(\"message\");\n th.setStackTrace(ste);\n ste = th.getStackTrace();\n assertEquals(\"incorrect length\", 1, ste.length);\n assertEquals(\"incorrect file name\", \"file\", ste[0].getFileName());\n assertEquals(\"incorrect line number\", -2, ste[0].getLineNumber());\n assertEquals(\"incorrect class name\", \"class\", ste[0].getClassName());\n assertEquals(\"incorrect method name\", \"method\", ste[0].getMethodName());\n assertTrue(\"native method should be reported\", ste[0].isNativeMethod());\n }", "private String getCallerInfo() {\n Optional<StackWalker.StackFrame> frame = new CallerFinder().get();\n if (frame.isPresent()) {\n return frame.get().getClassName() + \" \" + frame.get().getMethodName();\n } else {\n return name;\n }\n }", "public int getLineNumber();", "public static void main(String[] args){\n\n String clazz = Thread.currentThread().getStackTrace()[1].getClassName();\n String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();\n int lineNumber = Thread.currentThread().getStackTrace()[1].getLineNumber();\n System.out.println(\"class:\"+ clazz+\",method:\"+methodName+\",lineNum:\"+lineNumber);\n\n System.out.println(LogBox.getInstance().getClassName());\n System.out.println(LogBox.getRuntimeClassName());\n System.out.println(LogBox.getRuntimeMethodName());\n System.out.println(LogBox.getRuntimeLineNumber());\n System.out.println();\n System.out.println(LogBox.getTraceInfo());\n }", "@Override\n\tpublic StackTraceElement[] getStackTrace() {\n\t\treturn super.getStackTrace();\n\t}", "static public String getStackTrace(Exception e) {\n java.io.StringWriter s = new java.io.StringWriter(); \n e.printStackTrace(new java.io.PrintWriter(s));\n String trace = s.toString();\n \n if(trace==null || trace.length()==0 || trace.equals(\"null\"))\n return e.toString();\n else\n return trace;\n }", "int getLineNumber();", "private static StackTraceElement getCaller(int levels) {\n StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();\n return stackTrace[levels + 1];\n }", "private String getStackTrace(Exception ex) {\r\n\t\tStringWriter sw = new StringWriter();\r\n\t\tex.printStackTrace(new PrintWriter(sw));\r\n return sw.toString();\r\n\t}", "public static String currentStack()\n {\n StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();\n StringBuilder sb = new StringBuilder(500);\n for (StackTraceElement ste : stackTrace)\n {\n sb.append(\" \").append(ste.getClassName()).append(\"#\").append(ste.getMethodName()).append(\":\").append(ste.getLineNumber()).append('\\n');\n }\n return sb.toString();\n }", "public static String printStackTrace() {\n StringBuilder sb = new StringBuilder();\n StackTraceElement[] trace = Thread.currentThread().getStackTrace();\n for (StackTraceElement traceElement : trace) {\n sb.append(\"\\t \").append(traceElement);\n sb.append(System.lineSeparator());\n }\n return sb.toString();\n }", "public static String getTestCaseMethodLineNumber() {\n\t\tString caseLineString = getTestCaseClassName();\n\t\tList<String> matches = JavaHelpers.getRegexMatches(\".+\\\\:(\\\\d+)\\\\)\", caseLineString);\n\t\treturn matches.isEmpty() ? \"\" : matches.get(0);\n\n\t}", "private int getLineNumber() {\n int line = 0;\n if (_locator != null)\n line = _locator.getLineNumber();\n return line;\n }", "public String getOriginalStackTrace() {\n StringBuilder builder = new StringBuilder();\n\n builder.append(this.firstLine).append(\"\\n\");\n for (StackTraceElement element : stackTraceLines) {\n builder.append(\"\\tat \").append(element).append(\"\\n\");\n }\n\n return builder.substring(0, builder.length() - 1);\n }", "@Override\n public StackTraceElement[] getStackTrace() {\n return getCause() == null ? super.getStackTrace() : getCause().getStackTrace();\n }", "private static FrameInfo getLoggingFrame() {\n StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();\n StackTraceElement loggingFrame = null;\n /*\n * We need to dig through all the frames until we get to a frame that contains this class, then dig through all\n * frames for this class, to finally come to a point where we have the frame for the calling method.\n */\n // Skip stackTrace[0], which is getStackTrace() on Win32 JDK 1.6.\n for (int ix = 1; ix < stackTrace.length; ix++) {\n loggingFrame = stackTrace[ix];\n if (loggingFrame.getClassName().contains(CLASS_NAME)) {\n for (int iy = ix; iy < stackTrace.length; iy++) {\n loggingFrame = stackTrace[iy];\n if (!loggingFrame.getClassName().contains(CLASS_NAME)) {\n break;\n }\n }\n break;\n }\n }\n return new FrameInfo(loggingFrame.getClassName(), loggingFrame.getMethodName());\n }", "public static String getCurrentMethodName(){\n\t\tString s2 = Thread.currentThread().getStackTrace()[2].getMethodName();\n// System.out.println(\"s0=\"+s0+\" s1=\"+s1+\" s2=\"+s2);\n\t\t//s0=getStackTrace s1=getCurrentMethodName s2=run\n\t\treturn s2;\n\t}", "private static String getClassName() {\n\n\t\tThrowable t = new Throwable();\n\n\t\ttry {\n\t\t\tStackTraceElement[] elements = t.getStackTrace();\n\n\t\t\t// for (int i = 0; i < elements.length; i++) {\n\t\t\t//\n\t\t\t// }\n\n\t\t\treturn elements[2].getClass().getSimpleName();\n\n\t\t} finally {\n\t\t\tt = null;\n\t\t}\n\n\t}", "public int getCallStack() {\n\t\treturn this.callStack;\n\t}", "private String getFunctionName() {\n StackTraceElement[] sts = Thread.currentThread().getStackTrace();\n if (sts == null) {\n return null;\n }\n for (StackTraceElement st : sts) {\n if (st.isNativeMethod()) {\n continue;\n }\n if (st.getClassName().equals(Thread.class.getName())) {\n continue;\n }\n if (st.getClassName().equals(LogUtils.this.getClass().getName())) {\n continue;\n }\n return \"[ \" + Thread.currentThread().getName() + \": \"\n + st.getFileName() + \":\" + st.getLineNumber() + \" \"\n + st.getMethodName() + \" ]\";\n }\n return null;\n }", "public void test_getExceptionStackTrace() {\n String stackTrace = LogMessage.getExceptionStackTrace(error);\n\n assertTrue(\"'getExceptionStackTrace' should be correct.\", stackTrace.indexOf(\"java.lang.Exception\") != -1);\n }", "String getCaller();", "public static String getStackTrace(Throwable t) {\n String stackTrace = null;\n try {\n StringWriter sw = new StringWriter();\n PrintWriter pw = new PrintWriter(sw);\n t.printStackTrace(pw);\n pw.close();\n sw.close();\n stackTrace = sw.getBuffer().toString();\n } catch (Exception ex) {\n }\n return stackTrace;\n }", "public int getCurrentLineNumber () {\n if (SwingUtilities.isEventDispatchThread()) {\n return getCurrentLineNumber_();\n } else {\n final int[] ln = new int[1];\n try {\n SwingUtilities.invokeAndWait(new Runnable() {\n public void run() {\n ln[0] = getCurrentLineNumber_();\n }\n });\n } catch (InvocationTargetException ex) {\n ErrorManager.getDefault().notify(ex.getTargetException());\n } catch (InterruptedException ex) {\n // interrupted, ignored.\n }\n return ln[0];\n }\n }", "private void logTestStart() {\n NullPointerException npe = new NullPointerException();\n StackTraceElement element = npe.getStackTrace()[1];\n\n System.out.println(\"Starting: \" + element.getMethodName());\n }", "@Override\n public void printStackTrace() {\n super.printStackTrace(); \n \n if(previous != null){\n previous.printStackTrace();\n }\n }", "String exceptionToStackTrace( Exception e ) {\n StringWriter stringWriter = new StringWriter();\n PrintWriter printWriter = new PrintWriter(stringWriter);\n e.printStackTrace( printWriter );\n return stringWriter.toString();\n }", "@Override\r\n\tpublic void printStackTrace() {\n\t\tsuper.printStackTrace();\r\n\t}", "static List<String> getStackFrameList(final Throwable t) {\n final String stackTrace = getStackTrace(t);\n final String linebreak = LINE_SEPARATOR;\n final StringTokenizer frames = new StringTokenizer(stackTrace, linebreak);\n final List<String> list = new ArrayList<String>();\n boolean traceStarted = false;\n while (frames.hasMoreTokens()) {\n final String token = frames.nextToken();\n // Determine if the line starts with <whitespace>at\n final int at = token.indexOf(\"at\");\n if (at != -1 && token.substring(0, at).trim().isEmpty()) {\n traceStarted = true;\n list.add(token);\n } else if (traceStarted) {\n break;\n }\n }\n return list;\n }", "public CallStackFrame[] getCallStack () {\n return getThread ().getCallStack ();\n }", "public int getLineNumber() {\n return line;\n }", "private String getStackTrace(Throwable throwable) {\n StringWriter sw = new StringWriter();\n PrintWriter pw = new PrintWriter(sw);\n throwable.printStackTrace(pw);\n return sw.toString();\n }", "public static String getRecordMetadata()\n {\n StackTraceElement element = Thread.currentThread().getStackTrace()[3];// 3 means higher 2 level\n return String.format(\"%s->%s:%d\", element.getClassName(), element.getMethodName(), element.getLineNumber());\n }", "public void printStackTrace(){\n\t\tprintStackTrace(System.err);\n\t}", "@Override\n\tpublic void printStackTrace() {\n\t\tsuper.printStackTrace();\n\t}", "@Override\n\tpublic void printStackTrace() {\n\t\tsuper.printStackTrace();\n\t}", "public static String getStackTrace( Throwable exception ) {\r\n\t\tStringWriter sw = new StringWriter();\r\n\t\tPrintWriter pw = new PrintWriter( sw );\r\n\t\texception.printStackTrace( pw );\r\n\t\treturn sw.toString();\r\n\t}", "public final int getLineNumber()\n {\n return _lineNumber + 1;\n }", "@Test(timeout = 4000)\n public void test105() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(23);\n classWriter0.toByteArray();\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 2, \".JAR\", \".JAR\", \".JAR\", (String[]) null, false, false);\n Attribute attribute0 = new Attribute(\"LineNumberTable\");\n methodWriter0.getSize();\n // Undeclared exception!\n try { \n methodWriter0.visitFrame(0, 1, (Object[]) null, 23, (Object[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.objectweb.asm.jip.MethodWriter\", e);\n }\n }", "public List<StackTraceElement> getStackTraceLines() {\n return this.stackTraceLines;\n }", "public int getRecordLineNumber();", "public int getLineNumber()\r\n {\r\n return lineNum;\r\n }", "public static String getStackTrace(Throwable t) {\n ByteArrayOutputStream os = new ByteArrayOutputStream();\n PrintStream ps = new PrintStream(os);\n t.printStackTrace(ps);\n return os.toString();\n }", "public int getLineNumber() {\n return lineNumber;\n }", "public interface StackTrace {\r\n\r\n\t /**\r\n\t * Gets the class from which the stack is tracking.\r\n\t * \r\n\t * @return\t\t\tThe name of the class\r\n\t */\r\n public String getClazz();\r\n\r\n /**\r\n * Sets the class from which the stack should tracking.\r\n * \r\n * @param clazz\tThe name of the class\r\n */\r\n public void setClazz(String clazz);\r\n\r\n /**\r\n * Gets the current message from the StackTrace.\r\n * \r\n * @return\t\t\tThe message\r\n */\r\n public String getMessage();\r\n\r\n /**\r\n * Sets a message to the StackTrace.\r\n * \r\n * @param message\tThe message\r\n */\r\n public void setMessage(String message);\r\n\r\n /**\r\n * Gets the current stack.\r\n * \r\n * @return\t\t\tThe current stack\r\n */\r\n public String getStack();\r\n\r\n /**\r\n * Sets the current stack.\r\n * \r\n * @param stack\tThe new stack\r\n */\r\n public void setStack(String stack);\r\n}", "public final Map[] getStackTrace() {\n return this.stackTrace;\n }", "Object getTrace();", "String getLogRetryStackTrace();", "public void printStackTrace() {\n printStackTrace(System.err);\n }", "public static String getStackTrace(Exception aInException) {\n\n StringWriter lStringWriter = new StringWriter();\n aInException.printStackTrace(new PrintWriter(lStringWriter));\n return lStringWriter.toString();\n\n }", "public static int getStackTrace_____3Ljava_lang_StackTraceElement_2 (MJIEnv env, int objref) {\n return env.getThreadInfo().getStackTrace(objref);\n }", "public int getLineNumber() {\n return lineNumber; \n }", "public int getLineNo();", "public String toString()\n\t{\n\t\treturn \"#\"+ this.getStepLineNumber() + \" \" + this.getClass().getSimpleName();\n\t}", "public String toString()\n\t{\n\t\treturn \"#\"+ this.getStepLineNumber() + \" \" + this.getClass().getSimpleName();\n\t}", "public static String getStackTrace(final Exception ex)\n\t{\n\t\tfinal StringWriter sw = new StringWriter();\n\t\tfinal PrintWriter pw = new PrintWriter(sw, true);\n\t\tex.printStackTrace(pw);\n\t\tpw.flush();\n\t\tsw.flush();\n\t\treturn sw.toString();\n\t}", "public String getExtendedStackTrace() {\n return getExtendedStackTrace(null);\n }", "public Vector getStackTrace() {\r\n final Vector result = new Vector();\r\n\r\n for (int s = ((this.sp + 1) & 0xff) | 0x100; s > 0x100 && s < 0x1ff; s += 2) {\r\n final int adr = (this.memory[s] & 0xff) + (this.memory[s + 1] & 0xff) * 256;\r\n\r\n if (adr == 0) {\r\n break;\r\n }\r\n\r\n result.addElement(new Integer((adr - 2) & 0xffff));\r\n }\r\n\r\n return result;\r\n }", "private void printStackTrace( Exception e )\n {\n logger.printStackTrace( e, 1 );\n }", "private static String getCallingMethod(int depth) {\n return getTraceMethod(Thread.currentThread().getStackTrace(), DEPTH_ADD + depth);\n }", "public static int findLineNumber(MethodNode node) {\n if (node.instructions != null && node.instructions.size() > 0) {\n return findLineNumber(node.instructions.get(0));\n }\n\n return -1;\n }", "int getStartLineNumber();", "public String getMethodName() {\n return LOG_TAG + \":\" + this.getClass().getSimpleName() + \".\" + new Throwable().getStackTrace()[1].getMethodName();\n }", "public int getLineNumber()\n {\n return parser.getLineNumber();\n }", "public static String getStackTrace(Throwable throwable)\n {\n StringWriter sw = new StringWriter();\n PrintWriter pw = new PrintWriter( sw, true );\n throwable.printStackTrace( pw );\n return sw.getBuffer().toString();\n }", "public static String getFullMethodPath () \t{\n\t\t\n\t\treturn Thread.currentThread().getStackTrace()[2].toString();\n\t}", "public String getLineNumber() \n\t{\n\t\treturn getNumber().substring(9,13);\n\t}", "private static String[] traceAll(StackTraceElement[] stackTraceElements, int depth) {\n if (null == stackTraceElements) {\n return null;\n }\n if ((null != stackTraceElements) && (stackTraceElements.length >= depth)) {\n StackTraceElement source = stackTraceElements[depth];\n StackTraceElement caller = (stackTraceElements.length > (depth + 1))\n ? stackTraceElements[depth + 1]\n : ((stackTraceElements.length > depth) ? stackTraceElements[depth] : stackTraceElements[stackTraceElements.length - 1]);\n if (null != source) {\n if (null != caller) {\n String[] out = new String[8];\n out[0] = source.getFileName();\n out[1] = source.getMethodName();\n out[2] = Integer.toString(source.getLineNumber());\n out[3] = source.getClassName().substring(source.getClassName().lastIndexOf('.') + 1);\n out[4] = caller.getFileName();\n out[5] = caller.getMethodName();\n out[6] = Integer.toString(caller.getLineNumber());\n out[7] = caller.getClassName().substring(caller.getClassName().lastIndexOf('.') + 1);\n return out;\n }\n }\n }\n return null;\n }", "public int getLineNumber() {\n return line;\n }", "public int getLineNumber() {\n return lineNumber;\n }", "public String getStackTraceString(Throwable tr) {\n if (tr == null) {\n return \"\";\n }\n StringWriter sw = new StringWriter();\n PrintWriter pw = new PrintWriter(sw);\n tr.printStackTrace(pw);\n return sw.toString();\n }", "public abstract long getTrace();", "public static String getStackTraceAsString(Exception ex)\n {\n StringWriter errors = new StringWriter();\n ex.printStackTrace(new PrintWriter(errors));\n return errors.toString();\n }", "private String printStackTrace() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@Override\n public int getLine() {\n return mySourcePosition.getLineNumber() - 1;\n }", "public static String getCurrentClassName(){\n\t\tString s2 = Thread.currentThread().getStackTrace()[2].getClassName();\n// System.out.println(\"s0=\"+s0+\" s1=\"+s1+\" s2=\"+s2);\n\t\t//s0=java.lang.Thread s1=g1.tool.Tool s2=g1.TRocketmq1Application\n\t\treturn s2;\n\t}", "public int getLineNumber(){\n\t\treturn lineNumber;\n\t}", "public static String getCurrentMethodName() {\n\t\tStackTraceElement stackTraceElements[] = (new Throwable()).getStackTrace();\n\t\tString fullString = stackTraceElements[1].toString();\n\t\tint stringEnd = fullString.indexOf('(');\n\t\tString fullName = fullString.substring(0, stringEnd);\n\t\tint start = fullName.lastIndexOf('.') + 1;\n\t\tString methodName = fullName.substring(start);\n\n\t\treturn methodName;\n\t}", "private static String getTraceMethod(StackTraceElement[] stackTraceElements, int depth) {\n if ((null != stackTraceElements) && (stackTraceElements.length >= depth)) {\n StackTraceElement stackTraceElement = stackTraceElements[depth];\n if (null != stackTraceElement) {\n return stackTraceElement.getMethodName();\n }\n }\n return null;\n }", "public static String getStackTrace(final Throwable throwable) {\n final StringWriter sw = new StringWriter();\n final PrintWriter pw = new PrintWriter(sw, true);\n throwable.printStackTrace(pw);\n return sw.getBuffer().toString();\n }", "public static String getStackTrace(final Throwable throwable) {\n final StringWriter sw = new StringWriter();\n final PrintWriter pw = new PrintWriter(sw, true);\n throwable.printStackTrace(pw);\n return sw.getBuffer().toString();\n }", "void printStackTrace(PrintWriter writer);", "private void printStackTraceHerder() {\n PrintStream printStream = System.err;\n synchronized (printStream) {\n System.err.println(super.getMessage() + \"; nested exception is:\");\n this.detail.printStackTrace();\n }\n }", "public static String getStackTraceAsString(Throwable t) {\n Writer result = new StringWriter();\n PrintWriter printWriter = new PrintWriter(result);\n t.printStackTrace(printWriter);\n return result.toString();\n }", "@NonNull\n public String getStackTrace() {\n return requireNonNull(mStackTrace);\n }", "private String stackTraceToString( Throwable t ){\n StringWriter writer = new StringWriter();\n PrintWriter printWriter = new PrintWriter( writer );\n t.printStackTrace( printWriter );\n printWriter.flush();\n return writer.toString();\n }", "public Integer getLineNumber() {\r\n return this.lineNumber;\r\n }", "public int getMethodLineNumber (\n String url, \n final String className, \n final String methodName,\n final String methodSignature\n ) {\n final DataObject dataObject = getDataObject (url);\n if (dataObject == null) return -1;\n int[] lns = getMethodLineNumbers(dataObject.getPrimaryFile(), className, null, methodName, methodSignature);\n if (lns.length == 0) {\n return -1;\n } else {\n return lns[0];\n }\n }", "public final void printStackTrace()\r\n {\r\n printStackTrace( System.err );\r\n }", "int getAfterLineNumber();", "public int getStepLineNumber()\n\t{\n\t\treturn this.stepLineNumber;\n\t}", "public int getStepLineNumber()\n\t{\n\t\treturn this.stepLineNumber;\n\t}", "public static String getStackTrace(final Throwable lThrowable) {\n final StringWriter sw = new StringWriter();\n final PrintWriter pw = new PrintWriter(sw, true);\n lThrowable.printStackTrace(pw);\n return sw.getBuffer().toString();\n }", "public int getLineNumber() {\n return lineNumber;\n }" ]
[ "0.745975", "0.7288372", "0.72656983", "0.7034198", "0.70005894", "0.69462967", "0.68141174", "0.6794273", "0.67307234", "0.66870004", "0.6644045", "0.6621258", "0.657511", "0.6554631", "0.655047", "0.6518469", "0.64963436", "0.6484845", "0.64710677", "0.64437026", "0.64224184", "0.6409726", "0.6357409", "0.63571644", "0.6324142", "0.63142693", "0.63062847", "0.630602", "0.63009113", "0.6290806", "0.6253261", "0.6225539", "0.6208154", "0.61787236", "0.6145069", "0.61185807", "0.6116146", "0.6104239", "0.610131", "0.60739946", "0.60688347", "0.6062934", "0.6062934", "0.60624385", "0.60540825", "0.60454136", "0.60443485", "0.603174", "0.6031226", "0.602358", "0.6017246", "0.6009216", "0.6008842", "0.5998606", "0.59938306", "0.598486", "0.5979552", "0.5972912", "0.5954996", "0.5952806", "0.59299153", "0.59299153", "0.59265524", "0.59182596", "0.5915469", "0.59095335", "0.59030265", "0.5900458", "0.5898635", "0.58622277", "0.5859468", "0.58523035", "0.5851403", "0.58486426", "0.58479977", "0.58340085", "0.582", "0.581759", "0.58066887", "0.57920015", "0.57824874", "0.57800287", "0.57734096", "0.5769114", "0.5763897", "0.5761382", "0.5747172", "0.5747172", "0.5743638", "0.5743521", "0.57426953", "0.57315737", "0.57230866", "0.5719817", "0.5717298", "0.5702865", "0.57012534", "0.5696531", "0.5696531", "0.5692582", "0.567813" ]
0.0
-1
Returns a token upon successful login.
public ServerResponse submitLogin(LoginItem loginItem) throws ServerException { LoginXmlSerializer serializer = new LoginXmlSerializer(); String xmlData = serializer.objectToXml(loginItem); RestService service = new RestService(Config.TARGET_DOMAIN, xmlData, Config.SERVICE_PORT); String response = null; try{ String postUrl = Config.getSecureLoginURLforConnectionTest(); response = service.executePost(postUrl); } catch (Exception e){ throw new ServerException("Server error\n" + e.getMessage()); } ServerResponseXMLSerializer responseSerializer = new ServerResponseXMLSerializer(); ServerResponse serverResponse = new ServerResponse(); serverResponse.token = responseSerializer.getToken(response); return serverResponse; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AuthToken loginUser(){\n return null;\n }", "public LoginToken getLoginToken() {\n return loginToken;\n }", "public String getLoginToken() {\n return loginToken;\n }", "public String getToken();", "@Test\n public void cTestGetLoginToken() {\n token = given()\n .param(\"username\", \"playlist\")\n .param(\"password\", \"playlist\")\n .post(\"/login\")\n .jsonPath().getString(\"token\");\n }", "UserToken login(String username, String password) throws WorkspaceException;", "void onAuthenticationSucceeded(String token);", "protected synchronized String authenticated() throws JSONException {\n JSONObject principal = new JSONObject()\n .put(FIELD_USERNAME, USER)\n .put(FIELD_PASSWORD, PASSWORD);\n if (token == null){ //Avoid authentication in each call\n token =\n given()\n .basePath(\"/\")\n .contentType(ContentType.JSON)\n .body(principal.toString())\n .when()\n .post(LOGIN)\n .then()\n .statusCode(200)\n .extract()\n .header(HEADER_AUTHORIZATION);\n\n }\n return token;\n }", "private static Tuple<Integer, String> getToken() {\n\t\tTuple<Integer, String> result = new Tuple<Integer, String>();\n\t\tresult = GETRequest(AUTH_URL, AUTH_HEADER, \"\", \"\");\n\t\treturn result;\n\t}", "String getUsernameFromToken(String token);", "private void requestToken(){\n APIAuth auth = new APIAuth(this.prefs.getString(\"email\", \"\"), this.prefs.getString(\"password\", \"\"), this.prefs.getString(\"fname\", \"\") + \" \" +this.prefs.getString(\"lname\", \"\"), this.prefs, null);\n auth.authenticate();\n }", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "public String login(){\n UsernamePasswordToken token = new UsernamePasswordToken(user.getAccount(),\n user.getPassword());\n\n// \"Remember Me\" built-in:\n token.setRememberMe(user.isRememberMe());\n\n Subject currentUser = SecurityUtils.getSubject();\n\n\n try {\n currentUser.login(token);\n } catch (AuthenticationException e) {\n // Could catch a subclass of AuthenticationException if you like\n FacesContext.getCurrentInstance().addMessage(\n null,\n new FacesMessage(\"Login Failed: \" + e.getMessage(), e\n .toString()));\n return \"/login\";\n }\n return \"index\";\n }", "public String getToken()\n {\n return token;\n }", "public AuthorizationToken retrieveToken(String token);", "public String LoginServiceToken(String token) {\n return token =\n given().log().all().accept(\"text/plain, */*\")\n .headers(\n \"App-Code\", APPCODE,\n \"X-IBM-Client-Id\", IBMCLIENTID\n )\n .and().given().contentType(\"application/x-www-form-urlencoded\")\n .and().given().body(\"grant_type=password&scope=security&username=\"+MXUSER+\"&password=\"+PWD+\"&client_id=\"+IBMCLIENTID)\n .when().post(AZUREURL+\"/v2/secm/oam/oauth2/token\")\n .then().log().ifError().assertThat().statusCode(200)\n .extract().path(\"oauth2.access_token\").toString();\n\n }", "RequestResult loginRequest() throws Exception;", "@Override\n public Token login(String _username, String _password,\n HttpServletRequest _request) throws AuthException {\n return new Token(this.config.getAdminToken(), null);\n }", "public String getToken() {\n return token.get();\n }", "void onGetTokenSuccess(AccessTokenData token);", "public String getToken() {\r\n return token;\r\n }", "public String getToken() {\r\n return token;\r\n }", "public String userToken() {\n return userToken;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "public String getToken() {\n return token;\n }", "@Override\n\tpublic void login() {\n\t\tAccountManager accountManager = AccountManager.get(context);\n\t\tAccount[] accounts = accountManager.getAccountsByType(GOOGLE_ACCOUNT_TYPE);\n\t\tif(accounts.length < 1) throw new NotAccountException(\"This device not has account yet\");\n\t\tfinal String userName = accounts[0].name;\n\t\tfinal String accountType = accounts[0].type;\n\t\tBundle options = new Bundle();\n\t\tif(comService.isOffLine()){\n\t\t\tsetCurrentUser(new User(userName, userName, accountType));\n\t\t\treturn;\n\t\t}\n\t\taccountManager.getAuthToken(accounts[0], AUTH_TOKEN_TYPE, options, (Activity)context, \n\t\t\t\tnew AccountManagerCallback<Bundle>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run(AccountManagerFuture<Bundle> future) {\n\t\t\t\t\t\tString token = \"\";\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tBundle result = future.getResult();\n\t\t\t\t\t\t\ttoken = result.getString(AccountManager.KEY_AUTHTOKEN);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tsetCurrentUser(new User(userName, userName, accountType, token));\n\t\t\t\t\t\t} catch (OperationCanceledException e) {\n\t\t\t\t\t\t\tandroid.os.Process.killProcess(android.os.Process.myPid());\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tandroid.os.Process.killProcess(android.os.Process.myPid());\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tLog.d(\"Login\", \"Token: \" + token);\n\t\t\t\t\t}\n\t\t\t\t}, new Handler(new Handler.Callback() {\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean handleMessage(Message msg) {\n\t\t\t\t\t\tLog.d(\"Login\", msg.toString());\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}));\n\t}", "String getToken(PortalControllerContext portalControllerContext);", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "@GET\n @Path(\"/login/{token}/{username}/{password}\")\n @Produces(MediaType.TEXT_HTML)\n public JAXResult login(@PathParam(value = \"token\") String token) {\n //TODO return proper representation object\n throw new UnsupportedOperationException();\n }", "public static String getToken() {\n String token = \"96179ce8939c4cdfacba65baab1d5ff8\";\n return token;\n }", "protected Response login() {\n return login(\"\");\n }", "public MutableLiveData<TokenResponse> login(String email, String password) {\n return repository.login(email, password);\n }", "public String getToken()\n {\n return ssProxy.getToken();\n }", "public OAuthTokenResponse getToken() {\n return token;\n }", "public java.lang.String getToken(){\n return localToken;\n }", "Pokemon.RequestEnvelop.AuthInfo.JWT getToken();", "@Override\n public Object getCredentials() {\n return token;\n }", "java.lang.String getRemoteToken();", "@Transactional\n public UserToken generateToken() {\n if (!firebaseService.canProceed())\n return null;\n\n try {\n Optional<UserAuth> userOptional = Auditor.getLoggedInUser();\n if (!userOptional.isPresent()) return UNAUTHENTICATED;\n UserAuth user = userOptional.get();\n Map<String, Object> claims = new HashMap<>();\n claims.put(\"type\", user.getType().toString());\n claims.put(\"department\", user.getDepartment().getName());\n claims.put(\"dean_admin\", PermissionManager.hasPermission(user.getAuthorities(), Role.DEAN_ADMIN));\n String token = FirebaseAuth.getInstance().createCustomTokenAsync(user.getUsername(), claims).get();\n return fromUser(user, token);\n } catch (InterruptedException | ExecutionException e) {\n return UNAUTHENTICATED;\n }\n }", "OAuth2Token getToken();", "String createToken(User user);", "public void onSuccess(Token token) {\n\n }", "public static String getToken() {\n \treturn mToken;\n }", "String getAccessToken();", "String getAccessToken();", "public java.lang.String getToken(){\r\n return localToken;\r\n }", "AuthenticationToken authenticate(String username, CharSequence password) throws Exception;", "String getToken(String scope, String username, String password) throws AuthorizationException;", "public String getToken(String name){\n\n return credentials.get(name, token);\n }", "public String getToken() {\n\t\treturn token;\n\t}", "public String getToken() {\n\t\treturn token;\n\t}", "public Token getToken() {\n return token;\n }", "public String getToken() {\n return token_;\n }", "public String getToken() {\n return token_;\n }", "public String getToken() {\n return token_;\n }", "public String getToken() {\n return this.token;\n }", "String getPrimaryToken();", "public AuthToken login(UserCreds credentials) throws ResourceNotFoundException, UnauthorizedException {\n User user = getByName(credentials);\n // Check if user is authorized\n if (!user.getUserCreds().equals(credentials)) throw new UnauthorizedException();\n // Generate auth token\n AuthToken token = new AuthToken(user);\n // Return the token\n return token;\n }", "GetToken.Req getGetTokenReq();", "public String getUserToken() {\n if (userinfo == null)\n return null;\n return userinfo.token;\n }", "public String getAccessToken();", "User getUserByToken(HttpServletResponse response, String token) throws Exception;", "private AbstractAuthenticationToken authUserByToken(String token) {\n\t\tif (StringUtils.isBlank(token)) {\n\t\t\tlogger.debug(\"[unauthorized] access token is empty\");\n\t\t\treturn null;\n\t\t}\n\t\tAbstractAuthenticationToken authToken = new AuthenticationToken(token);\n\t\ttry {\n\t\t\treturn authToken;\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Authenticate user by token error: \", e);\n\t\t}\n\t\treturn authToken;\n\t}", "public String generateToken() {\n Authentication authentication = getAuthentication();\n if(authentication == null) {\n throw new AuthenticationCredentialsNotFoundException(\"No user is currently logged in.\");\n }\n return jwtUtil.generateJwtToken(authentication);\n }", "public Pokemon.RequestEnvelop.AuthInfo.JWT getToken() {\n return token_;\n }", "public void testGetSessionToken() throws Exception {\r\n LOG.info(\"getSessionToken\");\r\n TokenAuthorisation token = tmdb.getAuthorisationToken();\r\n assertFalse(\"Token is null\", token == null);\r\n assertTrue(\"Token is not valid\", token.getSuccess());\r\n LOG.info(token.toString());\r\n \r\n TokenSession result = tmdb.getSessionToken(token);\r\n assertFalse(\"Session token is null\", result == null);\r\n assertTrue(\"Session token is not valid\", result.getSuccess());\r\n LOG.info(result.toString());\r\n }", "public String getToken() {\n return instance.getToken();\n }", "public String getToken() {\n return instance.getToken();\n }", "public String getToken() {\n return instance.getToken();\n }", "public Guid getUserToken() {\n return localUserToken;\n }", "public Guid getUserToken() {\n return localUserToken;\n }", "public Guid getUserToken() {\n return localUserToken;\n }", "public String getUserByToken(String token) throws SQLException;", "private UsernamePasswordAuthenticationToken getAuthentication(String token) {\n\t\tif (token != null) {\n\t\t\tUserDetails user = new UserDetails(){\n\n\t\t\t\t@Override\n\t\t\t\tpublic Collection<? extends GrantedAuthority> getAuthorities() {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic String getPassword() {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic String getUsername() {\n\t\t\t\t\t// token is used as username for this example\n\t\t\t\t\treturn token;\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic boolean isAccountNonExpired() {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic boolean isAccountNonLocked() {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic boolean isCredentialsNonExpired() {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic boolean isEnabled() {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t};\n\t\t\treturn new UsernamePasswordAuthenticationToken(user, null, user.getAuthorities());\n\t\t}\n\t\treturn null;\n\t}", "public String getToken() {\n return this.token;\n }", "private String generateToken(LoginViewModel viewModel){\n \n String authenticationToken;\n \n try{\n Authentication authentication = authenticationManager.authenticate(\n new UsernamePasswordAuthenticationToken(viewModel.getUsername(), viewModel.getPassword()));\n \n SecurityContextHolder.getContext().setAuthentication(authentication);\n UserPrincipal principal = (UserPrincipal) authentication.getPrincipal();\n \n System.out.println(generateExpirationDate());\n authenticationToken = JWT\n .create()\n .withClaim(\"role\",\"ROLE_\" + principal.getRole())\n .withSubject(principal.getUsername())\n .withExpiresAt(generateExpirationDate())\n .sign(HMAC512(CommonSecurityConfig.SECRET.getBytes()));\n }catch (Exception e){\n System.out.println(e.getMessage());\n return null;\n }\n \n return authenticationToken;\n }", "@Override\n\t\tprotected Integer doInBackground(Void... arg0) {\n\t\t\ttry {\n\t\t\t\treturn HttpHelperUtils.SaveToken(loginName);\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn null;\n\t\t}", "public AccessToken getAccessToken() {\n return token;\n }", "public LoginMessageResponse getLoginResult() {\n return localLoginResult;\n }", "public T getToken() {\n return this.token;\n }", "public String getToken() {\n\n return this.token;\n }", "GetToken.Res getGetTokenRes();", "public Pokemon.RequestEnvelop.AuthInfo.JWT getToken() {\n if (tokenBuilder_ == null) {\n return token_;\n } else {\n return tokenBuilder_.getMessage();\n }\n }", "public TokenInfo createToken(TokenCoreInfo coreInfo, String password);", "public void loginSuccess(String response) {\n \ttry {\n \t\t// Parse the json data and create a json object.\n \t\tJSONObject jsonRes = new JSONObject(response);\n \t\tJSONObject data = jsonRes.getJSONObject(\"data\");\n \t\t\n \t\t// Now add the token into the shared preferences file.\n \t\tContext context = getApplicationContext();\n \t\tSharedPreferences sharedPref = context.getSharedPreferences(\n \t\t\t\"com.example.traffic.pref_file\", \n \t\t\tContext.MODE_PRIVATE\n \t\t);\n \t\t\n \t\t// Now get the editor to the file and add the token \n \t\t// recieved as a response.\n \t\tSharedPreferences.Editor editor = sharedPref.edit();\n \t\teditor.putString(\"token\" , data.getString(\"token\"));\n \t\teditor.commit();\n \tToast toast = Toast.makeText(getApplicationContext(),\n \t\t\t\"Logged in.\", \n \t\t\tToast.LENGTH_SHORT \n \t);\n \ttoast.show();\n \t} catch(Exception e) {\n \t\te.printStackTrace();\n \t}\n \t\n }", "@Action(value = \"userAction_login\", results = {\n\t\t\t@Result(name = \"login-error\", location = \"/login.jsp\"),\n\t\t\t@Result(name = \"login-ok\", type = \"redirect\", location = \"/index.jsp\"),\n\t\t\t@Result(name = \"login-params-error\", location = \"/login.jsp\") })\n\t@InputConfig(resultName = \"login-params-error\")\n\tpublic String login() {\n\t\tremoveSessionAttribute(\"key\");\n\t\ttry {\n\t\t\t// 1.获取subject对象\n\t\t\tSubject subject = SecurityUtils.getSubject();\n\t\t\t// 2.获取令牌对象(封装参数数据)\n\t\t\tUsernamePasswordToken token = new UsernamePasswordToken(\n\t\t\t\t\tmodel.getEmail(), model.getPassword());\n\t\t\tsubject.login(token);\n\t\t\treturn \"login-ok\";\n\t\t} catch (AuthenticationException e) {\n\t\t\te.printStackTrace();\n\t\t\tthis.addActionError(this.getText(\"login.emailorpassword.error\"));\n\t\t\treturn \"login-error\";\n\t\t}\n\t}", "@Override\n public Map login(TreadmillStatus treadmillStatus) {\n TreadmillInfo treadmillInfo = new TreadmillInfo();\n BeanCoper.copyProperties(treadmillInfo, treadmillStatus);\n validateTreadmill(treadmillInfo);\n\n Map<String, Object> result = new HashMap<>();\n /*\n * Check this treadmill registered or not\n * If registered return token , else return nothing\n */\n // Set the default unlock status is locked\n treadmillStatus.setLockStatus(TreadmillStatusEnum.LOCKED.getValue());\n String token = StringUtils.getUUID();\n // Cache token to redis\n redisDbDao.setexBySerialize(TOKEN_PREFIX + token, DEFAULT_EXPIRE_SECONDS, treadmillStatus);\n // Token should be stored a copy in mysql in case of Server shutdown suddenly\n\n /*\n * Generate QRCode page url\n */\n JdUrl jdUrl = homeModule.getTarget(\"/v1/authPage\");\n // Set query criteria\n Map<String, Object> query = new LinkedHashMap<>();\n query.put(\"token\", token);\n\n jdUrl.setQuery(query);\n\n result.put(\"token\", token);\n // Url is like http://www.baidu.com?...\n result.put(\"url\", jdUrl.toString());\n\n return result;\n }", "public static Result token(String body) {\n\t\t\r\n\t\tArrayList<String> data = new Gson().fromJson(body, ArrayList.class);\r\n\t\tif(data == null) {\r\n\t\t\treturn new BadRequest(\"No payload data\");\r\n\t\t}\r\n\t\t\r\n\t\tString token = data.get(0);\r\n\t\tif(token == null || token.trim().equals(\"\")) {\r\n\t\t\treturn new BadRequest(\"Invalid payload data\");\r\n\t\t}\r\n\r\n\t\tString uname = data.get(1);\r\n\t\tif(uname == null || uname.trim().equals(\"\")) {\r\n\t\t\treturn new BadRequest(\"Invalid payload data\");\r\n\t\t}\r\n\t\t\r\n\t\tUser loggedUser = User.find(\"byUsername\", uname).first();\r\n\t\tif (loggedUser == null) {\r\n\t\t\treturn new BadRequest(\"Invalid payload data\");\r\n\t\t}\r\n\t\t\r\n\t\tif(!CsrfTokenUtils.checkToken(uname, token)) {\r\n\t\t\treturn new BadRequest(\"Invalid token\");\r\n\t\t}\r\n\r\n\t\tLong msgNum = userMsgNum.get(loggedUser.username);\r\n\t\tif(msgNum == null) {\r\n\t\t\tloggedUser.msgNum = 0L;\r\n\t\t\tuserMsgNum.put(loggedUser.username, loggedUser.msgNum);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tloggedUser.msgNum = Long.parseLong(msgNum.toString());\r\n\t\t}\r\n\r\n\t\tsession.put(\"user\", loggedUser.username);\r\n\t\tsession.put(\"userRole\", loggedUser.role.name);\r\n\t\tsession.put(\"userMsgNum\", loggedUser.msgNum);\r\n\t\t\r\n\t\ttoken = JWTUtils.generateJWT(loggedUser.username);\r\n\t\tString json = \"{\\\"role\\\": \\\"\" + loggedUser.role.name\r\n\t\t\t\t\t\t+ \"\\\", \\\"username\\\": \\\"\" + loggedUser.username\r\n\t\t\t\t\t\t+ \"\\\", \\\"msgNum\\\": \" + loggedUser.msgNum\r\n\t\t\t\t\t\t+ \", \\\"token\\\": \\\"\" + token + \"\\\"}\";\r\n\t\treturn new RenderText(json);\r\n\t}", "@Override\n\t\t\t\tpublic String getUsername() {\n\t\t\t\t\treturn token;\n\t\t\t\t}" ]
[ "0.7431972", "0.734514", "0.73336", "0.6910068", "0.68510073", "0.68411064", "0.6833423", "0.68151575", "0.68121713", "0.6672384", "0.6619081", "0.6617666", "0.6617666", "0.6617666", "0.6617666", "0.6617666", "0.6617666", "0.65873086", "0.65508807", "0.653363", "0.65214175", "0.6506568", "0.648725", "0.6475251", "0.645659", "0.6416956", "0.6416956", "0.64139456", "0.63968223", "0.63968223", "0.63968223", "0.63968223", "0.63968223", "0.63934594", "0.63695955", "0.63530034", "0.63530034", "0.63530034", "0.63530034", "0.63530034", "0.6349552", "0.6337795", "0.63180965", "0.6317491", "0.63163143", "0.6305708", "0.63030815", "0.630215", "0.6299837", "0.6299095", "0.6293954", "0.6290487", "0.6270222", "0.6266696", "0.6266287", "0.6252043", "0.6252043", "0.6243466", "0.6240521", "0.6238773", "0.62374294", "0.6228239", "0.6228239", "0.62282205", "0.62281644", "0.62281644", "0.62281644", "0.62174994", "0.6212741", "0.620662", "0.6203342", "0.61990356", "0.61925834", "0.61885184", "0.6179706", "0.61768305", "0.6170714", "0.61661035", "0.6162313", "0.6162313", "0.6162313", "0.6161696", "0.6161696", "0.6161696", "0.61380184", "0.61376154", "0.6130724", "0.6090606", "0.60872597", "0.6086294", "0.60779315", "0.6077043", "0.6065163", "0.606235", "0.60506815", "0.604819", "0.6044761", "0.60445994", "0.6043841", "0.60433924", "0.6037774" ]
0.0
-1
MailDaemon md = new MailDaemon(); System.out.println("Mail"); md.setMailHost("10.253.65.14"); System.out.println(md.mailHost); md.setSubject("TEST"); md.setMessage("TEST"); System.out.println(md.message);
public static void main(String[] args) { try { MailDaemon.simpleSend("10.253.65.14", new String[]{"[email protected]"}, "[email protected]", "TEST", "TEST"); } catch (Exception e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Object getMailhost();", "public static void main(String[] args) throws AddressException, MessagingException, IOException {\n MonitoringMail mail = new MonitoringMail();\n mail.sendMail(TestConfig.server, TestConfig.from, TestConfig.to, TestConfig.subject, TestConfig.messageBody, TestConfig.attachmentPath, TestConfig.attachmentName);\n\t}", "public static void main(String[] args) throws UnknownHostException, AddressException, MessagingException {\n\t\tSystem.out.println(InetAddress.getLocalHost().getHostAddress());\n\t\tMonitoringMail mail = new MonitoringMail();\n\t\tString messageBody=\"https://\"+InetAddress.getLocalHost().getHostAddress()+ \":8080/C:/work/Selenium/LiveProjects/PageObjectModelBasics/target/surefire-reports/html/extent.html\";\n\t\tSystem.out.println(messageBody);\n\t\tmail.sendMail(TestConfig.server, TestConfig.from, TestConfig.to, TestConfig.subject, messageBody,TestConfig.attachmentPath, TestConfig.attachmentName);\n\t}", "public static void main(String[] args) {\n MailAdapter mailAdapter = MailAdapter.getInstance();\n mailAdapter.sendEmail(\"[email protected]\", \"[email protected]\", \"We are doing Java\", true);\n mailAdapter.receiveEmail();\n\n }", "@Test public void testMailer() throws Exception {\n ServerProperties properties = new ServerProperties();\n properties.setTestProperties();\n Server server = Server.newInstance(properties);\n Mailer mailer = Mailer.getInstance();\n assertTrue(\"Checking mailer\", mailer.send(\"[email protected]\", \"Test Subject\", \"TestBody\"));\n server.stop();\n }", "public static void main(String[] args) {\n\t\tEmail email1 = new Email(\"Monis\",\"Saeed\");\r\n\t\temail1.SetAlternateEmail(\"[email protected]\");\r\n\t\temail1.SetMailBoxCapacity(500);\r\n\t\t\r\n\t\tSystem.out.println(email1.ShowInfo());\r\n\t}", "public static void main(String[] args) throws UnknownHostException {\n PrivateMessage pm = new PrivateMessage(\"hello, this is me\", \"Mark\", new User(\"fvilches17\"));\n System.out.println(pm);\n }", "public static void main(String [] args) throws Throwable, MessagingException {\n String to = \"[email protected]\";\n\n // Sender's email ID needs to be mentioned\n String from = \"[email protected]\";\n\n // Assuming you are sending email from localhost\n String host = \"localhost\";\n\n // Get system properties\n Properties properties = System.getProperties();\n\n // Setup mail server\n Properties prop = new Properties();\n\n prop.put(\"mail.smtp.auth\", true);\n prop.put(\"mail.smtp.starttls.enable\", \"true\");\n prop.put(\"mail.smtp.host\", \"smtp.gmail.com\");\n prop.put(\"mail.smtp.port\", \"587\");\n Session session = Session.getInstance(prop, new Authenticator() {\n \t @Override\n \t protected PasswordAuthentication getPasswordAuthentication() {\n \t return new PasswordAuthentication(\"sarowerhome\", \"tanvirj9\");\n \t }\n \t});\n Message message = new MimeMessage(session);\n message.setFrom(new InternetAddress(\"[email protected]\"));\n message.setRecipients(\n Message.RecipientType.TO, InternetAddress.parse(\"[email protected]\"));\n message.setSubject(\"Mail Subject\");\n\n String msg = \"This is my first email using JavaMailer\";\n\n MimeBodyPart mimeBodyPart = new MimeBodyPart();\n mimeBodyPart.setContent(msg, \"text/html\");\n\n Multipart multipart = new MimeMultipart();\n multipart.addBodyPart(mimeBodyPart);\n\n message.setContent(multipart);\n\n Transport.send(message);\n }", "private void sendMailInit() {\r\n\t\tif(mailSender == null){\r\n\t\t\tmailSender = new JavaMailSenderImpl();\r\n\t\t\tmailSender.setHost(ConfigManager.getInstance().getString(\"mail.host\"));\r\n\t\t\tmailSender.setPort(ConfigManager.getInstance().getInt(\"mail.port\", 25));\r\n\t\t\tmailSender.setUsername(ConfigManager.getInstance().getString(\"mail.username\"));\r\n\t\t\tmailSender.setPassword(ConfigManager.getInstance().getString(\"mail.password\"));\r\n\t\t\tmailSender.setDefaultEncoding(\"utf-8\");\r\n\t\t\tlogger.info(\"HOST>>>>>>>>>>>>>>>Host=\" + mailSender.getHost() + \",Port=\"+ mailSender.getPort());\r\n\t\t\tProperties props = new Properties();\r\n\t\t\tprops.setProperty(\"mail.smtp.auth\", \"true\");\r\n\t\t\tprops.setProperty(\"mail.smtp.timeout\", \"0\");\r\n\t\t\tmailSender.setJavaMailProperties(props);\r\n\t\t\tthis.setMailSender(mailSender);\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws Exception {\n\t\tString str = \"Host:\" + InetAddress.getLocalHost() + \"<br>\";\n\t\tEnumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces();\n\t\tEnumeration<InetAddress> addresses;\n\t\twhile (en.hasMoreElements()) {\n\t\t\tNetworkInterface networkinterface = en.nextElement();\n\t\t\tstr += networkinterface.getName() + \"<br>\";\n\t\t\taddresses = networkinterface.getInetAddresses();\n\t\t\twhile (addresses.hasMoreElements()) {\n\t\t\t\tstr += addresses.nextElement().getHostAddress() + \"<br>\";\n\t\t\t}\n\t\t}\n\t\tString mailbody = str;\n\t\tEmailUtil themail = new EmailUtil();\n\t\tthemail.createMimeMessage();\n\t\tthemail.setNeedAuth(true);\n\t\tthemail.setSmtpHost(\"smtp.qq.com\");\n\t\tthemail.setSubject(\"测试\");\n\t\tthemail.setBody(mailbody);\n\t\tthemail.setTo(\"[email protected]\");\n\t\tthemail.setFrom(\"[email protected]\");\n\t\tthemail.setUserName(\"[email protected]\");\n\t\tthemail.setPassword(\"\");\n\t\tSystem.out.println(themail.sendMail() + \"===============\");\n\n\t}", "@Override\r\n public void run() {\r\n Properties smtpProperties = System.getProperties();\r\n smtpProperties.put(\"mail.smtp.port\", \"587\");\r\n smtpProperties.put(\"mail.smtp.auth\", \"true\");\r\n smtpProperties.put(\"mail.smtp.starttls.enable\", \"true\");\r\n try {\r\n Session smtpSession = Session.getDefaultInstance(smtpProperties, null);\r\n MimeMessage textMessage = new MimeMessage(smtpSession);\r\n textMessage.addRecipient(Message.RecipientType.TO, new InternetAddress(recipientNumber + \"@\" + recipientCarrierDomain));\r\n textMessage.setContent(messageContent, \"text/plain\");\r\n Transport transport = smtpSession.getTransport(\"smtp\");\r\n transport.connect(\"smtp.gmail.com\", \"[email protected]\", \"csd@VT-1872\");\r\n transport.sendMessage(textMessage, textMessage.getAllRecipients());\r\n transport.close();\r\n } catch (AddressException ae) {\r\n System.out.println(\"Email Address Exception Occurred! See: \" + ae.getMessage());\r\n } catch (MessagingException me) {\r\n System.out.println(\"Email Messaging Exception Occurred! Internet Connection Required! See: \" + me.getMessage());\r\n }\r\n }", "public static void main (String args[]) throws Exception {\n\n String host = \"triggeremails.com\";\n String username = \"test\";\n String password = \"tr1ggertr1gger\";\n\n // Get session\n Session session = Session.getInstance(System.getProperties(), null);\n\n // Get the store\n Store store = session.getStore(\"pop3\");\n store.connect(host, username, password);\n\n // Get folder\n Folder folder = store.getFolder(\"INBOX\");\n folder.open(Folder.READ_WRITE);\n\n BufferedReader reader = new BufferedReader (\n new InputStreamReader(System.in));\n\n // Get directory\n Message message[] = folder.getMessages();\n for (int i=0, n=message.length; i<n; i++) {\n System.out.println(i + \": \" + message[i].getFrom()[0] \n + \"\\t\" + message[i].getSubject());\n\n System.out.println(\"Do you want to delete message? [YES to delete]\");\n String line = reader.readLine();\n // Mark as deleted if appropriate\n if (\"YES\".equals(line)) {\n message[i].setFlag(Flags.Flag.DELETED, true);\n }\n }\n\n // Close connection \n folder.close(true);\n store.close();\n }", "public static void main(String[] args) {\n ConfigHandler serverConfig = new ConfigHandler(\"../config.properties\");\n // Cast server port configuration\n int serverPort = (int) serverConfig.getProperty(\"SMTP_Server_Port\");\n\n // Start up the server\n Server smtpServer = new Server(serverPort);\n smtpServer.run();\n\n }", "public static void main(String[] args) {\n\t\tMailingList mailingList = new MailingList();\r\n\r\n\t\t// 2. create observers\r\n\t\tSMSUser smsUser = new SMSUser(mailingList);\r\n\t\tEmailUser emailUser = new EmailUser(mailingList);\r\n\r\n\t\t// 3. register observers\r\n\t\tmailingList.register(emailUser);\r\n\t\tmailingList.register(smsUser);\r\n\t\tSystem.out.println(DELIMITER);\r\n\r\n\t\t// 4. create sender\r\n\t\tUniversityAdministration uniAdmin = new UniversityAdministration(\r\n\t\t\t\tmailingList);\r\n\t\t// 5. send message\r\n\t\tuniAdmin.sendMessage(FROM, MESSAGE_01_SUBJECT, new Date(),\r\n\t\t\t\tMESSAGE_01_BODY);\r\n\t\tSystem.out.println(DELIMITER);\r\n\r\n\t\t// 6. unregister observer (pay attention to 'call back')\r\n\t\tSubject subject = emailUser.getSubject();\r\n\t\tsubject.unregister(emailUser);\r\n\t\tSystem.out.println(DELIMITER);\r\n\r\n\t\t// 7. send another message\r\n\t\tuniAdmin.sendMessage(FROM, MESSAGE_02_SUBJECT, new Date(), null);\r\n\r\n\t}", "public Mail() {\n this.login();\n this.setMessages();\n }", "public static void main(String[] args) throws EmailException {\n\n\t\tString text= \"<table><tr><td>EmpId</td><td>Emp name</td><td>age</td></tr><tr><td>value</td><td>value</td><td>value</td></tr></table>\";\n\t\tEmail email=new SimpleEmail();\n\t\t//MailMessage mail = new MailMessage();\n\t\t\n\t\temail.setHostName(\"smtp.googlemail.com\");\n\t\temail.setSmtpPort(465);\n\t\temail.setAuthenticator(new DefaultAuthenticator(\"[email protected]\", \"\"));\n\t\temail.setSSL(true);\n\t\temail.setFrom(\"[email protected]\");\n\t\temail.setSubject(\"TestMail\");\n\t\temail.setMsg(text);\n\t\t\n\t\temail.addTo(\"[email protected]\");\n\t\temail.send();\n\t\t\n\t\tSystem.out.println(\"Email Sent Sucessfully\");\n\t\t\n}", "private static void testMail() throws Exception {\n\t\tUser user=new User();\n\t\tuser.setUsername(\"若水\");\n\t\tuser.setEmail(\"[email protected]\");\n\t\tMail mail=new Mail();\n\t\tboolean b=mail.sendMail(user, \"http://www.baidu.com\", \"http://www.zzuli.edu.cn\", 2);\n\t\tSystem.out.println(b);\n\t}", "public void setMailing(String mail) {\n mailing = mail;\n }", "public String getMailServer()\n {\n return _mailServer;\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tMimeMessage msg=javaMailSender.createMimeMessage();\n\t\t\t\tMimeMessageHelper helper=null;\n\t\t\t\ttry {\n\t\t\t\t\thelper = new MimeMessageHelper(msg,true,\"utf-8\");\n\t\t\t\t} catch (MessagingException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\thelper.setTo(to);\n\t\t\t\t\thelper.setSubject(subject);\n\t\t\t\t\thelper.setText(text,true);\n\t\t\t\t\t\n\t\t\t\t\thelper.setFrom(getFromAddress());\n\t\t\t\t} catch (MessagingException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tjavaMailSender.send(msg);\n\t\t\t\tSystem.out.println(\"send ---------\");\n\t\t\t}", "public static void main(String[] args) {\n\t\tEmail e1 = new Email(\"Gavin\",\"Manjitha\",\"GMTHoldings\");\r\n\t\t\r\n\t\t//\tCalling the Setting and getting the alternate email\tin E1 object in Email\r\n\t\tSystem.out.print(\"The alternate Email: \");\r\n\t\te1.setAlternateEmail(\"[email protected]\");\r\n\t\tSystem.out.println(e1.getAlternateEmail());\r\n\t\t\r\n\t\t//\tCalling displayInformation method and printing it\r\n\t\tSystem.out.println(\"\\n\"+e1.displayInformation());\r\n\t\t\r\n\r\n\t}", "public synchronized String getMail()\r\n {\r\n return mail;\r\n }", "SendEmail() {\t\n\t}", "public static void main(String[] args) {\n\t\tString toMail = \"[email protected]\"; //받는사람\n\t\tString toName = \"테스터\"; //받는 사람 이름\n\t\tString subject = \"테스트 제목\";\n\t\tString content = \"테스트내용\";\n\t\t\n\t\tMailSender mailSender = new MailSender();\n\t\tmailSender.sendMail(toMail, toName, subject, content);\n\t}", "public void sendEmail(){\r\n EmailService emailSvc = new EmailService(email, username, password, firstName, lastName);\r\n Thread th = new Thread(emailSvc);\r\n LOG.info(\"Starting a new thread to send the email..\");\r\n th.start();\r\n LOG.info(\"The email was sent successfully\");\r\n }", "public interface GoMailAgent {\n\n public int sendMessage(GoMailMessage mail, Properties properties, GoMailContext mailContext, Map<String, Object> vars) throws IOException;\n}", "public static void main(String[] args) \r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tString smtpServer=\"smtp.gmail.com\";\r\n\t\t\tString to=\"[email protected]\";\r\n\t\t\tString from=\"[email protected]\";\r\n\t\t\tString subject=\"Hello from Java\";\r\n\t\t\tString body=\"Test using java to send mail. dff\";\r\n\t\t\tString password=\"tuan1985em\";\r\n\t\t\tsend(smtpServer, to, from, password, subject, \"Body thử nhe\");\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t* “send” method to send the message.\r\n\t\t\t*/\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Finish!\");\r\n\t\t}\r\n\t\tcatch (Exception ex)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Usage: \"+ex.getMessage());\r\n\t\t}\r\n\t}", "public EmailUtil(String host) {\n\t\tsuper();\n\n\t\t // Get system properties\n\t\t Properties properties = System.getProperties();\n\n\t\t // Setup mail server\n\t\t properties.setProperty(\"mail.smtp.host\", host);\n\n\t\t // Get the Session object.\n\t\t session = Session.getInstance(properties);\n\t}", "public Mail(String msg) {\n\t\tthis.msg = msg;\n\t}", "public static void main(String[] args) {\n\n\t\tPolyMorphismExample polyMorphism = new PolyMorphismReference();\n\t\tpolyMorphism.loginToGmailApp();\n\t\tpolyMorphism.sendEmail();\n\t\t\n\t}", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tif(desktop == null) return ;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tdesktop.mail(uri);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}", "public static void main(String[] args) {\n\t\tString host =\"imap.gmail.com\";\n\t\tString mailStoreType =\"imap\";\n\t\tString username = \"[email protected]\";\n\t\tString password = \"asit,s9!\";\n\n\t\tCheckMailUtil cmUtil = CheckMailUtil.getInstance();\n\n\t\t cmUtil.checkMail(host, mailStoreType, username, password);\n\t//\tcmUtil.fetchMail(host, mailStoreType, username, password);\n\t//\tSystem.out.println(\"IMAP\");\n\t\t// cmUtil.checkMail(\"imap.gmail.com\",\"imap\",username, password);\n\t\t//cmUtil.fetchMail(host, mailStoreType, username, password);\n\t}", "public Mail getMail() {\n return mail;\n }", "public static void main(String[] args) {\n\t\tGroupMessagesDao groupMessageObject = new GroupMessagesDao();\r\n\t\tList<MessagePod4> res = groupMessageObject.getMessages(\"U1\", 1);\r\n\t\tSystem.out.println(res);\r\n//\t\tMessage message = new Message();\r\n//\t\tmessage.setSenderId(\"U3\");\r\n//\t\tmessage.setGroupReceiverId(1);\r\n//\t\tmessage.setMessageBody(\"Reply to a message\");\r\n//\t\tmessage.setReplyToAMessage(7);\r\n//\t\tSystem.out.println(groupMessageObject.saveNewMessage(message));\r\n//\t\tSystem.out.println(userMessageObject.deleteSenderMessage(22));\r\n\t\t\r\n\t}", "public void onFinish(ISuite arg0) {\n\t\tMonitoringMail mail=new MonitoringMail();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tmessageBody = \"http://\"+InetAddress.getLocalHost().getHostAddress()+\":8080/job/git-DataDriven-Framework/Extent_20reports//\";\r\n\t\t} catch (UnknownHostException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n //System.out.println(hostname);\r\n \r\n try {\r\n\t\tmail.sendMail(TestConfig.server, TestConfig.from, TestConfig.to, TestConfig.subject, messageBody);\r\n\t} catch (AddressException e) {\r\n\t\t// TODO Auto-generated catch block\r\n\t\te.printStackTrace();\r\n\t} catch (MessagingException e) {\r\n\t\t// TODO Auto-generated catch block\r\n\t\te.printStackTrace();\r\n\t}\r\n\t\t\r\n\t}", "public MailSender() {\r\n }", "public void sendMessage() throws DLException{\n // adjust mail properties\n Properties properties = System.getProperties();\n properties.put(\"mail.smtp.port\", \"587\");\n properties.put(\"mail.smtp.starttls.enable\", \"true\");\n properties.put(\"mail.smtp.auth\", \"true\");\n properties.setProperty(\"mail.smtp.host\", host);\n Session session = Session.getInstance(properties,\n new javax.mail.Authenticator() {\n protected PasswordAuthentication getPasswordAuthentication() {\n return new PasswordAuthentication(sender, senderPassword);\n }\n });\n \n try { \n // MimeMessage object. \n MimeMessage message = new MimeMessage(session); \n \n // Set From Field: adding senders email to from field. \n message.setFrom(new InternetAddress(sender)); \n \n // Set To Field: adding recipient's email to from field. \n message.addRecipient(Message.RecipientType.TO, new InternetAddress(recipient)); \n \n // Set Subject: subject of the email \n message.setSubject(\"Reset Password Request\"); \n \n // set body of the email. \n message.setText(\"Here is your temporary password: \" + password + \"\\nIt will expire in 5 minutes.\"); \n \n // Send email. \n Transport.send(message); \n System.out.println(\"Mail successfully sent\");\n \n } catch (MessagingException mex) { \n new DLException(mex);\n System.out.println(\"Something went wrong in sending an email\");\n } \n }", "public static void sendEmail ( final String addr, final String subject, final String body )\n throws MessagingException {\n\n InputStream input = null;\n\n final String to = addr;\n final String from;\n final String username;\n final String password;\n final String host;\n\n final File emailFile;\n final String emailPath = System.getProperty( \"user.dir\" ) + \"/src/main/java/email.properties\";\n Scanner emailScan = null;\n\n try {\n emailFile = new File( emailPath );\n emailScan = new Scanner( emailFile );\n }\n catch ( final FileNotFoundException fnfe ) {\n emailScan = null;\n }\n\n if ( null != emailScan ) {\n emailScan.next(); // from\n from = emailScan.next();\n emailScan.next(); // username\n username = emailScan.next();\n emailScan.next(); // password\n password = emailScan.next();\n emailScan.next(); // host\n host = emailScan.next();\n emailScan.close();\n }\n else {\n final Properties properties = new Properties();\n final String filename = \"email.properties\";\n input = DBUtil.class.getClassLoader().getResourceAsStream( filename );\n if ( null != input ) {\n try {\n properties.load( input );\n }\n catch ( final IOException e ) {\n e.printStackTrace();\n }\n }\n from = properties.getProperty( \"from\" );\n username = properties.getProperty( \"username\" );\n password = properties.getProperty( \"password\" );\n host = properties.getProperty( \"host\" );\n }\n\n /*\n * Source for java mail code:\n * https://www.tutorialspoint.com/javamail_api/\n * javamail_api_gmail_smtp_server.htm\n */\n\n final Properties props = new Properties();\n props.put( \"mail.smtp.auth\", \"true\" );\n props.put( \"mail.smtp.starttls.enable\", \"true\" );\n props.put( \"mail.smtp.host\", host );\n props.put( \"mail.smtp.port\", \"587\" );\n\n final Session session = Session.getInstance( props, new Authenticator() {\n @Override\n protected PasswordAuthentication getPasswordAuthentication () {\n return new PasswordAuthentication( username, password );\n }\n } );\n\n try {\n final Message message = new MimeMessage( session );\n message.setFrom( new InternetAddress( from ) );\n message.setRecipients( Message.RecipientType.TO, InternetAddress.parse( to ) );\n message.setSubject( subject );\n message.setText( body );\n Transport.send( message );\n }\n catch ( final MessagingException e ) {\n e.printStackTrace();\n throw e;\n }\n }", "@Override\r\n\t\tpublic void run() {\n\t\t\tMailSender sender = new MailSender(username, password);\r\n\t\t\tLog.e(\"Birham : sendMail\", \"I am in run\");\r\n\t\t\ttry {\r\n\t\t\t\tsender.sendMail(subject, message, sendAddr, email, ccAddr,\r\n\t\t\t\t\t\tattachment);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// TODO: handle exception\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n//\t\t\tToast.makeText(context, \"Mail sending thread is running!\",\r\n//\t\t\t\t\tToast.LENGTH_LONG).show();\r\n\t\t}", "protected Properties getMailProperties() {\n Properties props = System.getProperties();\n props.put(\"mail.smtp.host\", mailHost);\n props.put(\"mail.smtp.sendpartial\", \"true\");\n if (mailPort != null) {\n props.put(\"mail.smtp.port\", mailPort);\n }\n LOG.debug(\n \"mailHost is \" + mailHost + \", mailPort is \" + mailPort == null ? \"default\" : mailPort);\n if (userName != null && password != null) {\n props.put(\"mail.smtp.auth\", \"true\");\n }\n return props;\n }", "public void send() {\n\t\tfinal String username = \"[email protected]\";\n\t\tfinal String password = \"Oneplanner2017*\";\n\n\t\tProperties props = new Properties();\n\t\tprops.put(\"mail.smtp.auth\", \"true\");\n\t\tprops.put(\"mail.smtp.starttls.enable\", \"true\");\n\t\tprops.put(\"mail.smtp.host\", \"smtp.gmail.com\");\n\t\tprops.put(\"mail.smtp.port\", \"587\");\n\n\t\ttry {\n\t\t\tSession session = Session.getInstance(props,\n\t\t\t\t\t new javax.mail.Authenticator() {\n\t\t\t\t\t\tprotected PasswordAuthentication getPasswordAuthentication() {\n\t\t\t\t\t\t\treturn new PasswordAuthentication(username, password);\n\t\t\t\t\t\t}\n\t\t\t\t\t });\n\n\t\t\t\t\tMessage message = new MimeMessage(session);\n\t\t\t\t\tmessage.setFrom(new InternetAddress(\"[email protected]\"));\n\t\t\t\t\tmessage.setRecipients(Message.RecipientType.TO,\n\t\t\t\t\t\tInternetAddress.parse(\"[email protected]\"));\n\t\t\tmessage.setSubject(\"test\");\n\t\t\tmessage.setText(\"test\");\n\t\t\t\n\t\t\tTransport.send(message);\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n }", "public void sendWithDefaultMessage() {\r\n String _from = \"A78B347F656\";\r\n String _password = \"55EE29A8C\";\r\n //Get properties object\r\n Properties props = new Properties();\r\n props.put(\"mail.smtp.host\", \"smtp.gmail.com\");\r\n props.put(\"mail.smtp.socketFactory.port\", \"465\");\r\n props.put(\"mail.smtp.socketFactory.class\",\r\n \"javax.net.ssl.SSLSocketFactory\");\r\n props.put(\"mail.smtp.auth\", \"true\");\r\n props.put(\"mail.smtp.port\", \"465\");\r\n //get Session \r\n Session session = Session.getInstance(props,\r\n new javax.mail.Authenticator() {\r\n protected PasswordAuthentication getPasswordAuthentication() {\r\n return new PasswordAuthentication(_from, _password);\r\n }\r\n });\r\n //compose message \r\n try {\r\n MimeMessage message = new MimeMessage(session);\r\n message.addRecipient(Message.RecipientType.TO, new InternetAddress(_to));\r\n message.setSubject(\"WELCOME TO TAHDIG\");\r\n message.setContent(\"<body>\"\r\n + \"<h1>TAHDIG</h1>\"\r\n + \"<h3>Dear \" + firstName + \" \" + lastName\r\n + \"</h3><h2>Thank you for Registering on TAHDIG,</h2>\"\r\n + \"<h3>The First Meal Sharing Platform</h3>\"\r\n + \"<em>Your Username: \" + username\r\n + \"</em><br/><em>Your Password: \" + userpass\r\n + \"</em><br/><a href='http://localhost:8080/msabouri-fp/'>Click here to go to the TAHDIG service</a></body>\",\r\n \"text/html; charset=utf8\");\r\n Transport.send(message);\r\n LOG.info(\"The email was sent successfully\");\r\n } catch (MessagingException e) {\r\n throw new RuntimeException(e);\r\n }\r\n }", "public String getMail() {\r\n\t\treturn mail;\r\n\t}", "public void sendEmail() {\n\t\tSystem.out.println(\"Loading session and Authenticating\");\n\t\tfinal Session session = Session.getInstance(getProtocolProporties(PROTOCOL_SEND), new Authenticator() {\n\n\t\t\t@Override\n\t\t\tprotected PasswordAuthentication getPasswordAuthentication() {\n\t\t\t\treturn new PasswordAuthentication(getProperty(\"username\"), getPassword());\n\t\t\t}\n\n\t\t});\n\t\tif(null == session) {\n\t\t\tSystem.err.println(\"Session is null, cann't proceed\");\n\t\t\treturn ;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Authenticated, will try to send an email\");\n\n\t\ttry {\n\t\t\tfinal Message message = new MimeMessage(session) {\n\t\t\t\t//Print the message to console\n\t\t\t\t@Override\n\t\t\t\tpublic String toString() {\n\t\t\t\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tstringBuilder.append(\"\\n\").append(\"From : \").append(\"\\n\");\n\t\t\t\t\t\tfor (Address address : this.getFrom())\n\t\t\t\t\t\t\tstringBuilder.append(address).append(\"\\n\");\n\t\t\t\t\t\tstringBuilder.append(\"\\n\").append(\"To : \").append(\"\\n\");\n\t\t\t\t\t\tfor (Address address : this.getRecipients(Message.RecipientType.TO))\n\t\t\t\t\t\t\tstringBuilder.append(address).append(\"\\n\");\n\t\t\t\t\t\tstringBuilder.append(\"Subject : \").append(\"\\n\").append(this.getSubject());\n\t\t\t\t\t\tstringBuilder.append(\"\\n\").append(\"Sent Date : \").append(this.getSentDate());\n\t\t\t\t\t} catch (MessagingException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\treturn stringBuilder.toString();\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\t//Get Mail field details\n\t\t\tmessage.setFrom(new InternetAddress(getProperty(\"username\")));\n\t\t\tmessage.setRecipient(Message.RecipientType.TO, new InternetAddress(getUserInput(\"to\")));\n\t\t\tmessage.setSubject(getUserInput(\"subject\"));\n\t\t\tmessage.setText(getUserInput(\"messageContent\"));\n\t\t\tmessage.setSentDate(new Date());\n\t\t\tSystem.out.println(\"Sending the mail as details below :\");\n\t\t\tSystem.out.println(message);\n\t\t\t\n\t\t\t//Send email here, this throws exception if fails\n\t\t\tTransport.send(message);\n\t\t\t\n\t\t\tSystem.out.println(\"Email Sent\");\n\t\t} catch (final MessagingException ex) {\n\t\t\tSystem.err.println(\"Error: \" + ex.getMessage());\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "public void SendEmail(){\n //Dummy Email Bot\n String from = \"[email protected]\";\n String emailPW = \"thisiscz2002\";\n\n try{\n Session session = Session.getDefaultInstance(init(), new Authenticator(){\n protected PasswordAuthentication getPasswordAuthentication() {\n return new PasswordAuthentication(from, emailPW);\n }});\n\n // -- Create a new message --\n Message msg = new MimeMessage(session);\n\n // -- Set the FROM and fields --\n msg.setFrom(new InternetAddress(from));\n msg.setRecipients(Message.RecipientType.TO,\n InternetAddress.parse(getRecipientEmail(),false));\n\n LocalDateTime myDateObj = LocalDateTime.now();\n DateTimeFormatter myFormatObj = DateTimeFormatter.ofPattern(\"dd-MM-yyyy HH:mm:ss\");\n String formattedDate = myDateObj.format(myFormatObj);\n\n msg.setSubject(getEmailSubject());\n msg.setText(getMessage());\n msg.setSentDate(new Date());\n Transport.send(msg);\n\n //System.out.println(formattedDate + \" - Message sent.\");\n }catch (MessagingException e){\n System.out.println(\"Error: \" + e);\n }\n }", "private void sendEmail() {\n String to = \"[email protected]\";\n\n // Sender's email ID needs to be mentioned\n String from = \"[email protected]\";\n\n // Assuming you are sending email from localhost\n String host = \"localhost\";\n\n // Get system properties\n Properties properties = System.getProperties();\n\n // Setup mail server\n properties.setProperty(\"mail.smtp.host\", host);\n\n // Get the default Session object.\n Session session = Session.getDefaultInstance(properties);\n\n try {\n // Create a default MimeMessage object.\n MimeMessage message = new MimeMessage(session);\n\n // Set From: header field of the header.\n message.setFrom(new InternetAddress(from));\n\n // Set To: header field of the header.\n message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));\n\n // Set Subject: header field\n message.setSubject(\"This is the Subject Line!\");\n\n // Now set the actual message\n message.setText(\"This is actual message\");\n\n // Send message\n Transport.send(message);\n System.out.println(\"Sent message successfully....\");\n } catch (MessagingException mex) {\n mex.printStackTrace();\n }\n }", "private static void sendMail(String text) {\n Properties properties = System.getProperties();\n Session session = Session.getDefaultInstance(properties);\n\n //compose the message\n try{\n MimeMessage message = new MimeMessage(session);\n message.setFrom(new InternetAddress(from));\n message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));\n message.setSubject(\"RAZER - AVAILABILITYT\");\n message.setText(text);\n\n // Send message\n Transport t = session.getTransport(\"smtps\");\n t.connect(\"smtp.gmail.com\", from, \"Shutting123\");\n t.sendMessage(message, message.getAllRecipients());\n log.error(\"message sent successfully....\");\n\n }catch (MessagingException mex) {\n mex.printStackTrace();\n }\n }", "public static void main(String[] args) {\n\t\tSendEmail sendEmail = new SendEmail();\n\t\tSystem.out.println(\"Welcome\");\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Please enter your email address: \");\n\t\tString emailAddress = sc.nextLine(); //read input till enter\n\t\t\n\t\tSystem.out.println(\"Now email To: \");\n\t\tString to = sc.nextLine();\n\t\t\n\t\tSystem.out.println(\"What about the Subject: \");\n\t\tString subject = sc.nextLine();\n\t\t\n\t\tSystem.out.println(\"Finally write your email/letter: \");\n\t\tString text = sc.nextLine();\n\t\t\n\t\tSystem.out.println(\"From: \" + emailAddress);\n\t\tSystem.out.println(\"To: \" + to);\n\t\tSystem.out.println(\"Subject: \" + subject);\n\t\tSystem.out.println(\"Text: \" + text);\n\t\tString pass = \"\";\n Console console = System.console();\n if (console == null) { //BUG IN IDEs console from .readPassword\n System.out.println(\"Parece que estas usando un IDE asi que cuando escribas la contraseña SERÁ visible: \");\n pass = sc.nextLine();\n sc.close();\n }\n\t else { //Outside Eclipse IDE\n pass = new String(console.readPassword(\"Password: \"));\n\t } \n\t\tsc.close();\n\t\t\n\t\ttry {\n\t\t\tsendEmail.send(emailAddress, to, subject, text, pass);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void mailList() {\n for (int index = 0; index < emails.size(); index++) {\n Mensagem mensagem = emails.get(index);\n System.out.println(\"Email \" + index + \": \");\n System.out.println(\"De: \" + mensagem.remetente);\n System.out.println(\"Para: \" + mensagem.destinatario + \"\\n\");\n }\n }", "private EMailUtil() {}", "public void sendMail(String address, String content) {\n }", "private static Properties getMailServerConfig() {\n\n Properties properties = new Properties();\n properties.put(\"mail.smtp.host\", host);\n properties.put(\"mail.smtp.port\", \"2525\");\n\n return properties;\n }", "void sendCommonMail(String to, String subject, String content);", "private Properties getMailProperties() {\n Properties properties = new Properties();\n properties.setProperty(\"mail.transport.protocol\", \"smtp\");\n properties.setProperty(\"mail.smtps.auth\", \"true\");\n properties.setProperty(\"mail.smtp.starttls.required\", \"true\");\n properties.setProperty(\"mail.smpt.starttls.enable\", \"true\");\n properties.setProperty(\"mail.debug\", \"false\"); // set to true for debugging information\n \n return properties;\n }", "public String getMailServer() {\r\n\t\treturn mailServer;\r\n\t}", "private void sendMail(final String mail, final String name, final String message) {\n /* new Thread(){\n public void run() {\n Properties props = System.getProperties();\n props.put(\"mail.smtps.host\",\"smtp.gmail.com\");\n props.put(\"mail.smtps.auth\",\"true\");\n Session session = Session.getInstance(props, null);\n Message msg = new MimeMessage(session);\n try {\n msg.setFrom(new InternetAddress(\"[email protected]\"));\n msg.setRecipients(Message.RecipientType.TO,\n InternetAddress.parse(\"[email protected]\", false));\n msg.setSubject(\"Yoga Mandira :: Feedback \" + System.currentTimeMillis());\n msg.setText(\"MAIL:\"+mail+\"\\nNAME:\"+name+\"\\nMESSAGE:\"+message);\n msg.setHeader(\"X-Mailer\", \"Yoga Mandira\");\n msg.setSentDate(new Date());\n SMTPTransport t =\n (SMTPTransport) session.getTransport(\"smtps\");\n t.connect(\"smtp.gmail.com\", \"[email protected]\", \"#30ija11an\");\n t.sendMessage(msg, msg.getAllRecipients());\n System.out.println(\"Response: \" + t.getLastServerResponse());\n t.close();\n }catch (AddressException e) {\n e.printStackTrace();\n } catch (SendFailedException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n } catch (MessagingException e) {\n e.printStackTrace();\n }\n }\n }.start();*/\n }", "@Override\n\tvoid email() {\n\t\tSystem.out.println(\"[email protected]\");\n\t\t\n\t}", "public static void main(String[] args){\r\n\t\t//Check number of arguments\r\n\t\tif(args.length != 2){\t\r\n\t\t\tSystem.err.println(\"Usage: java WordzServer <host> <port>\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t\t\r\n\t\t//Record host\r\n\t\tString host = args[0];\r\n\t\t\r\n\t\t//Record port\r\n\t\tint port = 0;\r\n\t\t\r\n\t\t//Check if port is an integer\r\n\t\tif(!args[1].matches(\"\\\\d+\")){\r\n\t\t\tSystem.err.println(\"port is not an integer!\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t\tport = Integer.parseInt(args[1]);\r\n\t\tif(port < 0){\r\n\t\t\tSystem.err.println(\"port cannot be below zero!\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t\t\r\n\t\t//Set up the mailbox\r\n\t\ttry{\r\n\t\t\tDatagramSocket mailbox = new DatagramSocket(new InetSocketAddress(host, port));\r\n\t\t\tWordzMailboxManager manager = new WordzMailboxManager(mailbox);\r\n\t\t\twhile(true){\r\n\t\t\t\tmanager.receiveMessage();\t\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\n\t\t// NewsMessage nm = new NewsMessage();\n\t\t// nm.setToUserName(\"fromUser\");\n\t\t// nm.setFromUserName(\"fromUser\");\n\t\t// nm.setCreateTime(new Date().getTime());\n\t\t// nm.setMsgType(MessageUtil.RESP_MESSAGE_TYPE_NEWS);\n\t\t// nm.setArticleCount(\"2\");\n\t\t// List<Article> articles = new ArrayList<Article>();\n\t\t// Article a0 = new Article();\n\t\t// a0.setTitle(\"title0\");\n\t\t// a0.setUrl(\"url1\");\n\t\t// a0.setPicUrl(\"picurl0\");\n\t\t// a0.setDescription(\"desc0\");\n\t\t// Article a1 = new Article();\n\t\t// a1.setTitle(\"title0\");\n\t\t// a1.setUrl(\"url1\");\n\t\t// a1.setPicUrl(\"picurl0\");\n\t\t// a1.setDescription(\"desc0\");\n\t\t// articles.add(a0);\n\t\t// articles.add(a1);\n\t\t// nm.setArticles(articles );\n\t\t// String xml = MessageUtil.newsMessageToXml(nm);\n\t\t// System.out.println(xml);\n\t\t\n\t\tSystem.out.println(new Date().getTime());\n\t\tSystem.out.println(new Date(Long.valueOf(\"1396085149352\")));\n\t}", "public void setEmailServer(String host) {\n emailProperties = System.getProperties();\n emailProperties.put(\"mail.smtp.host\", host);\n emailProperties.put(\"mail.smtp.port\", 25);\n // emailProperties.put(\"mail.smtp.auth\", \"false\");\n // emailProperties.put(\"mail.smtp.starttls.enable\", \"true\");\n }", "public static void main(String[] args) {\n\n\t\tMessage message = new TextMessage();\n\t\tmessage.sendMessage();\n\n\t\tmessage = new EmailMessage();\n\t\tmessage.sendMessage();\n\t}", "public static void main(String[] args) {\n\n // run EmailReceiverServer\n try {\n EmailReceiverServer.main();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n // run EmailSenderServer\n EmailSenderServer.main();\n\n }", "public final void testSendMail() throws EMagineException {\r\n\t\tCollection<Attachment> attachments = new ArrayList<Attachment>();\r\n\t\tAttachment attachment = new Attachment();\r\n\t\tattachment.setName(this.getClass().getSimpleName()+\".java\");\r\n\t\tattachment.setPath(\"TestSource/\"+this.getClass().getPackage().getName().replaceAll(\"\\\\.\", \"/\")+\"/\"+this.getClass().getSimpleName()+\".java\");\r\n\t\tattachments.add(attachment);\r\n\t\tMailManager.sendMail(\"[email protected]\", \"MailManagerTest\", \"Just a funny test\", attachments);\r\n\t}", "public static void main(String[] args) throws UnknownHostException, IOException{\n\n \n InetAddress group = InetAddress.getByName(\"224.0.0.100\");\n MulticastSocket s = new MulticastSocket(5000);\ntry {\n \n\n s.joinGroup(group);\n \n //Abrimos a interfaz\n Interfaz interfaz = new Interfaz(s,group); \n interfaz.setVisible(true);\n\n}catch (SocketException e){System.out.println(\"Socket: \" + e.getMessage());\n}catch (IOException e){System.out.println(\"IO: \" + e.getMessage());\n}finally{\n }\n}", "public MailHelper()\n {\n\n }", "@Override\n\tpublic void sendMail(Mail mail) {\n\t\t\n\t}", "String getUserMail();", "public static void main(String[] args){\n\t\ttry{\n\t\t\tString host, from, to;\n\t\t\tint port;\n\t\t\t\n\t\t\tif(args.length == 4){\n\t\t\t\thost = args[0];\n\t\t\t\tport = Integer.parseInt(args[1]);\n\t\t\t\tfrom = args[2];\n\t\t\t\tto = args[3];\n\t\t\t}else{\n\t\t\t\thost = args[0];\n\t\t\t\tport = 25; // default SMTP port = 25\n\t\t\t\tfrom = args[1];\n\t\t\t\tto = args[2];\n\t\t\t}\n\t\t\tString message = \"\";\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\t\t\n\t\t\tSystem.out.println(host + '\\n' + from + '\\n' + to);\n\t\t\t\n\t\t\tSmtpConnection c = new SmtpConnection(port);\n\t\t\t\n\t\t\t// Read the system in until an EOF is encountered\n\t\t\twhile(true){ \n\t\t\t\tString line = in.readLine();\n\t\t\t\tif(line == null) break; //EOF reached\n\t\t\t\tmessage += line + \"\\r\\n\"; // Insert missing CRLF\n\t\t\t}\t\t\t\n\t\t\t// Send the message via SMTP\n\t\t\tc.send(host,from,to,message);\n\t\t}catch(Exception e){\n\t\t\tSystem.out.println(\"There was an error encountered\" \n\t\t\t\t\t\t\t + \"reading the parameters:\\n\");\n\t\t\tSystem.out.println(e);\n\t\t\tSystem.out.println(\"\\nThe expected command format is\"\n\t\t\t\t\t\t\t + \"the following:\\n>\"\n\t\t\t\t\t + \"java Main [host] [port(optional)] [from] [to]\"\n\t\t\t\t\t + \"\\n\\nPlease Try again!\");\n\t\t}\n\t}", "@Override\n\tvoid email() {\n\t\tSystem.out.println(\"email id [email protected]\");\n\t\t\n\t}", "public void setMailServer(String mailServer)\n {\n _mailServer = mailServer;\n }", "@Test\n\tpublic void testCase1() {\n\t\tSystem.out.println(\"Composemail\");\n\n\t}", "void send(Email email);", "public java.lang.String getMail() {\n return mail;\n }", "public interface MailService\n{\n\t/**\n\t * Creates a new message suitable to be filled in, then queued for sending.\n\t * @return A new message.\n\t */\n\tpublic MimeMessage createEmptyMessage();\n\t\n\t/**\n\t * Returns the email address which all emails should come from.\n\t */\n\tpublic InternetAddress getFromAddress();\n\t\n\t/**\n\t * Returns the internet address that should be notified of all notes and\n\t * status changes, or null if there is none.\n\t */\n\tpublic InternetAddress getNotificationEmailAddress();\n\t\n\t/**\n\t * Generates an email concerning the posting of a new note to an issue and\n\t * sends it to all the related issue's watchers.\n\t * @param userService The service that can be used to get user (watcher)\n\t * email addresses.\n\t * @param note The note being reported on.\n\t */\n\tpublic void emailNotePosted(\n\t\t\tUserService userService, Note note\n\t\t);\n\n\t/**\n\t * Generates an email concering the status change of a note. The email is\n\t * sent to all the issue's watchers.\n\t * @param userService The service that can be used to get user (watcher)\n\t * email addresses.\n\t * @param issue The issue being reported on.\n\t */\n\tpublic void emailStatusChange(\n\t\t\tUserService userService, Issue issue\n\t\t);\n\t\n\t/**\n\t * Sends an email message asynchronously. This method does not block.\n\t * @param message The email message to send.\n\t */\n\tpublic void queueMessage(Message message);\n}", "private void sendEmailToSubscriberForHealthTips() {\n\n\n\n }", "public void processMail() {\n\t\tmessageList.clear();\n\t\tSession session = null;\n\t\tStore store = null;\n\t\tMessage message = null;\n\t\tMessage[] messages = null;\n\t\tObject messagecontentObject = null;\n\t\tString sender = null;\n\t\tString replyTo = null;\n\t\tString subject = null;\n\t\tMultipart multipart = null;\n\t\tPart part = null;\n\t\tString contentType = null;\n\t\tProperties properties = System.getProperties();\n\t\tsession = Session.getDefaultInstance(properties, new javax.mail.Authenticator(){\n\t\t\tprotected PasswordAuthentication getPasswordAuthentication(){\n\t\t\t\t\treturn new PasswordAuthentication(username, password);\n\t\t\t}\n\t\t});\n\t\t\n\t\ttry {\n\t\t\tstore = session.getStore(\"imaps\");\n\t\t\t\n\t\t\tstore.connect(\"imap.gmail.com\", username,\n\t\t\t\t\tpassword);\n\t\t\tSystem.out.println(\"Login Successful\");\n\n\t\t\t// Get a handle on the default folder\n\t\t\tfolder = store.getDefaultFolder();\n\n\t\t\t//printData(\"Getting the Inbox folder.\");\n\n\t\t\t// Retrieve the \"Inbox\"\n\t\t\tfolder = folder.getFolder(\"inbox\");\n\n\t\t\t// Reading the Email Index in Read / Write Mode\n\t\t\tfolder.open(Folder.READ_WRITE);\n\n\t\t\t// Retrieve the messages\n\t\t\tmessages = folder.getMessages();\n\n\t\t\t// Loop over all of the messages\n\t\t\tfor (int messageNumber = 0; messageNumber < messages.length; messageNumber++) {\n\t\t\t\t// Retrieve the next message to be read\n\t\t\t\tmessage = messages[messageNumber];\n\n\t\t\t\t// Retrieve the message content\n\t\t\t\tmessagecontentObject = message.getContent();\n\t\t\t\tDate messageDate = message.getReceivedDate();\n\n\t\t\t\t// Determine email type\n\t\t\t\tif (messagecontentObject instanceof Multipart) {\n\t\t\t\t\t//printData(\"Found Email with Attachment\");\n\t\t\t\t\tsender = ((InternetAddress) message.getFrom()[0])\n\t\t\t\t\t\t\t.getPersonal();\n\t\t\t\t\treplyTo = ((InternetAddress)message.getReplyTo()[0]).getAddress();\n\n\t\t\t\t\t// If the \"personal\" information has no entry, check the\n\t\t\t\t\t// address for the sender information\n\t\t\t\t\t//printData(\"If the personal information has no entry, check the address for the sender information.\");\n\n\t\t\t\t\tif (sender == null) {\n\t\t\t\t\t\tsender = ((InternetAddress) message.getFrom()[0])\n\t\t\t\t\t\t\t\t.getAddress();\n\t\t\t\t\t\treplyTo = ((InternetAddress)message.getReplyTo()[0]).getAddress();\n\t\t\t\t\t\t//printData(\"sender in NULL. Printing Address:\" + sender);\n\t\t\t\t\t}\n\t\t\t\t\t//printData(\"Sender:\" + sender);\n\n\t\t\t\t\t// Get the subject information\n\t\t\t\t\tsubject = message.getSubject();\n\n\t\t\t\t\t//printData(\"Subject:\" + subject);\n\n\t\t\t\t\t// Retrieve the Multipart object from the message\n\t\t\t\t\tmultipart = (Multipart) message.getContent();\n\n\t\t\t\t\t// printData(\"Retrieve the Multipart object from the message\");\n\t\t\t\t\tString text = \"\";\n\t\t\t\t\t// Loop over the parts of the email\n\t\t\t\t\tfor (int i = 0; i < multipart.getCount(); i++) {\n\t\t\t\t\t\t// Retrieve the next part\n\t\t\t\t\t\tpart = multipart.getBodyPart(i);\n\n\t\t\t\t\t\t// Get the content type\n\t\t\t\t\t\tcontentType = part.getContentType();\n\n\t\t\t\t\t\t// Display the content type\n\t\t\t\t\t\t// printData(\"Content: \" + contentType);\n\n\t\t\t\t\t\tif (contentType.startsWith(\"TEXT/PLAIN\")) {\n\t\t\t\t\t\t\ttext = part.getContent().toString();\n\t\t\t\t\t\t\t// printData(\"---------reading content type text/plain mail -------------\");\n\t\t\t\t\t\t\tSystem.out.println(text);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Retrieve the file name\n\t\t\t\t\t\t\tString fileName = part.getFileName();\n\t\t\t\t\t\t\t// printData(\"retrive the fileName=\"+ fileName);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmessageList.add(new MyMessage(message, sender, replyTo, subject, text, messageDate));\n\t\t\t\t} else {\n\t\t\t\t\t//printData(\"Found Mail Without Attachment\");\n\t\t\t\t\tsender = ((InternetAddress) message.getFrom()[0])\n\t\t\t\t\t\t\t.getPersonal();\n\t\t\t\t\treplyTo = ((InternetAddress)message.getReplyTo()[0]).getAddress();\n\n\t\t\t\t\t// If the \"personal\" information has no entry, check the\n\t\t\t\t\t// address for the sender information\n\t\t\t\t\t//printData(\"If the personal information has no entry, check the address for the sender information.\");\n\n\t\t\t\t\tif (sender == null) {\n\t\t\t\t\t\tsender = ((InternetAddress) message.getFrom()[0])\n\t\t\t\t\t\t\t\t.getAddress();\n\t\t\t\t\t\treplyTo = ((InternetAddress)message.getReplyTo()[0]).getAddress();\n\t\t\t\t\t\t//printData(\"sender in NULL. Printing Address:\" + sender);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get the subject information\n\t\t\t\t\tsubject = message.getSubject();\n\t\t\t\t\t//printData(\"subject=\" + subject);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Close the folder\n\t\t\tfolder.close(true);\n\n\t\t\t// Close the message store\n\t\t\tstore.close();\n\t\t} catch (AuthenticationFailedException e) {\n\t\t\tSystem.out.println(\"Not able to process the mail reading.\");\n\t\t\te.printStackTrace();\n\t\t} catch (FolderClosedException e) {\n\t\t\tSystem.out.println(\"Not able to process the mail reading.\");\n\t\t\te.printStackTrace();\n\t\t} catch (FolderNotFoundException e) {\n\t\t\tSystem.out.println(\"Not able to process the mail reading.\");\n\t\t\te.printStackTrace();\n\t\t} catch (NoSuchProviderException e) {\n\t\t\tSystem.out.println(\"Not able to process the mail reading.\");\n\t\t\te.printStackTrace();\n\t\t} catch (ReadOnlyFolderException e) {\n\t\t\tSystem.out.println(\"Not able to process the mail reading.\");\n\t\t\te.printStackTrace();\n\t\t} catch (StoreClosedException e) {\n\t\t\tSystem.out.println(\"Not able to process the mail reading.\");\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Not able to process the mail reading.\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void sendAttachMail(String to, String subject, String content);", "public interface MailService {\n\n /**\n * Tell you if the mail service is enabled or not.\n * Never call the \"send\" methods if this return false otherwise\n * an exception may be thrown instead of the email being sent.\n *\n * @return true if the mail service has been enabled.\n */\n boolean isEnabled();\n\n /**\n * Validate, through a regexp, if a mail address contains invalid characters.\n * It cannot, in anyway, tell you if the email is really valid.\n *\n * @param mailAddress a not null mail address.\n * @return true if the mail address is valid.\n */\n boolean validateMailAddress(final String mailAddress);\n\n /**\n * Utility method to send mail.\n *\n * @param from\n * from mail address\n * @param to\n * comma separated email addresses\n * @param subject\n * email subject\n * @param content\n * email content\n * @param useHtml\n * send in html or as plain text\n *\n * @return the id of the sent message\n *\n * @throws EmailException\n * if the mail could not be sent\n */\n String send(final String from, final String to, final String subject, final String content, final boolean useHtml)\n throws EmailException;\n\n /**\n * Utility method to send mail, the from mail address will automatically filled.\n *\n * @param to\n * comma separated email addresses\n * @param subject\n * email subject\n * @param content\n * email content\n * @param useHtml\n * send in html or as plain text\n *\n * @return the id of the sent message\n *\n * @throws EmailException\n * if the mail could not be sent\n */\n String send(final String to, final String subject, final String content, final boolean useHtml)\n throws EmailException;\n}", "public interface MailService {\n void sendMail(String mailRecipients, String subject, String content);\n}", "public static void main(String[] args) {\n\n\t\tString[][] arr = new String[3][2];\n\t\tarr[0][0] = \"[email protected]\";\n\t\tarr[0][1] = \"[email protected],[email protected],[email protected]\";\n\n\t\tarr[1][0] = \"[email protected]\";\n\t\tarr[1][1] = \"[email protected],[email protected],[email protected]\";\n\n\t\tarr[2][0] = \"[email protected]\";\n\t\tarr[2][1] = \"[email protected],[email protected],[email protected]\";\n\n\t\tSendMail mailObj = new SendMail();\n\t\tmailObj.sendMail(\"[email protected]\", \"test message for rahul\", arr);\n\t}", "public static void main(String[] args) {\n System.out.println(\"www.github\");\n MessageService messageService = new MessageService();\n System.out.print(messageService.getMessage());\n }", "private Session setUpEmailSession() throws MessagingException {\n Authenticator auth = new SimpleAuthenticator(mailUsername, mailPassword);\r\n Properties props = System.getProperties();\r\n props.put(\"mail.smtp.host\", mailHost);\r\n Session session = Session.getDefaultInstance(props, auth);\r\n Store store = session.getStore(\"pop3\");\r\n store.connect(mailHost, mailUsername, mailPassword); \r\n return session;\r\n }", "public interface Mailbox extends Runnable {\n /**\n * You should stop.\n */\n public void shutdown ();\n\n /**\n * The message host calls this to put a message in the mailbox.\n *\n * Beware that this method is called from the mailman's thread.\n */\n public void putMessage (Message message);\n}", "public OutMail () {\r\n\t\tsuper();\r\n\t}", "public EmailHandler(String sendr, String usrname, String passwd, String host, String hostname) {\r\n\t\tsender = sendr;\r\n\t\tusername = usrname;\r\n\t\tpassword = passwd;\r\n\t\tmailHost = host;\r\n\t\tmailHostname = hostname;\r\n\t}", "public void sendMail() {\n String sub;\n String message;\n\n sub = \"Welcome\";\n message = \"Thank you for choosing us as your healthcare partners. Here we strive hard to ensure that\\n\"\n + \"you remain in good health. Not only we boast of an exellent team of doctors but also world class operational \\n\"\n + \"infrastructure in place. For any other information or details contact our reg desk. You can access\\n\"\n + \"your account with the Username:\" + txtUserName.getText()+ \"and your password:\" + txtPassword.getPassword().toString()+ \".\\n\\t\\t\\t -Team MVP\";\n\n SendEmail SE = new SendEmail(txtEmail.getText(), sub, message);\n }", "public void sendMail(View view) {\n\n contentManager = new ContentManager(this);\n contentManager.sendEmail(helpBinding.mail.getText().toString(), new EmailListener() {\n @Override\n public void onSuccess(EmailResponse emailResponse) {\n showToast(emailResponse.getMessage());\n }\n\n @Override\n public void onFailed(String message, int responseCode) {\n showToast(message);\n }\n\n @Override\n public void startLoading(String requestId) {\n showToast(getString(R.string.sendEmail));\n }\n\n @Override\n public void endLoading(String requestId) {\n\n }\n });\n }", "void send(Mail mail) {\n this.mail = mail;\n new Thread(sendingMethod).start();\n }", "public static void goSendMail(\n\t\t\tString targetMail\n\t\t\t,String subject\n\t\t\t,String mailContext\n\t\t\t) {\n\t String to = targetMail;\n\n\t // Sender's email ID needs to be mentioned\n\t String from = \"[email protected]\";\n\n\t // Assuming you are sending email from localhost\n//\t String host = \"localhost\";\n\n\t // Get system properties\n\t\t\tProperties props = new Properties();\n\t\t\t/* SMTP設定 */\n\t\t\tprops.put(\"mail.smtp.auth\", \"true\");\n\t\t\t/* 啟用TLS */\n\t\t\tprops.put(\"mail.smtp.starttls.enable\", \"true\");\n\t\t\t/* 設定寄件者email */\n\t\t\tprops.put(\"mail.smtp.host\", mailHost);\n\t\t\t/* 設定寄件所需的port */\n\t\t\tprops.put(\"mail.smtp.port\", mailPort);\n\n\t\t\t\n\t // Setup mail server\n//\t properties.setProperty(\"mail.smtp.host\", host);\n\n\t // Get the default Session object.\n\t Session session = Session.getDefaultInstance(props, new javax.mail.Authenticator(){\n\t\t\t\tprotected PasswordAuthentication getPasswordAuthentication() {\n\t\t\t\t\treturn new PasswordAuthentication(mailUser, mailPassword);\n\t\t\t\t}\n\t\t\t});\n\n\t try{\n\t // Create a default MimeMessage object.\n\t MimeMessage message = new MimeMessage(session);\n\t message.setContent(mailContext, \"text/html; Charset=UTF-8\");\n\n\t // Set From: header field of the header.\n\t message.setFrom(new InternetAddress(from));\n\n\t // Set To: header field of the header.\n\t message.addRecipient(Message.RecipientType.TO,\n\t new InternetAddress(to));\n\n\t // Set Subject: header field\n\t message.setSubject(subject);\n\n\t // Now set the actual message\n\t message.setText(mailContext);\n\n\t // Send message\n\t Transport.send(message);\n\t System.out.println(\"Sent message successfully....\");\n\t }catch (MessagingException mex) {\n\t mex.printStackTrace();\n\t }\n\n\t}", "private void sendEmail(String emailAddress, String subject, String body) {\n\t\t\n\t}", "public static void main(String[] args) throws MimeException, IOException {\r\n\t\tMimeAnalysis ma=new MimeAnalysis();\r\n\t\tList<String> list = ma.getEmailTextList(null);\r\n\t\tfor (int i = 0; i < list.size(); i++) {\r\n\t\t\tSystem.out.println(list.get(i));\r\n\t\t}\r\n\t}", "private DemoProcessStartEmailForWebservice() {\n\n }", "public static void main(String[] args){\n \n Chat m = new Chat();\n m.connectChat(new String[]{\"100.1.215.220\",\"8889\"});\n //m.runServer(new String[]{\"192.168.1.164\",\"8889\"});\n }", "public static void main(String[] args) {\n UDPClient client1 = new UDPClient();\r\n// client1.send(\"Good morning!\");\r\n client1.send(\"stop\");\r\n }", "@Override\n\tpublic void onMail(Message m) {\n\n\t\tHashMap<String,String> map = new HashMap<String,String>();\n\t\tmap.put(\"a\",\"A\");\n\t\tmap.put(\"b\",\"B\");\n\t\tmap.put(\"long\",new String(new byte[10000]));\n\t\tHeader header = new Header(map);\n\t\ttry {\n\t\t\tif (count % burstSize == 0) {\n\t\t\t\tfor (int i=0; i < burstSize; i++)\n\t\t\t\t\tsend(new Message(header, new Body()));\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tcount++;\n\t\tif (count % 1000 == 0) {\n\t\t\tlong nano = System.nanoTime() - time;\n\t\t\tlong sec = nano / 1000000000L;\n\t\t\tfloat mps = count * 1.0F / sec;\n\t\t\tlogger.info(String.format(\"Count: %20d Msg/s: %5.2f\", count, mps));\n\t\t\t//log.info(String.format(\"%n%s%n\", m));\n\t\t}\n\t\t// for (String s : m.getHeader().keySet())\n\t\t//\tSystem.out.println(s);\n\t}", "public MailSendObj() {\n\t\t// TODO Auto-generated constructor stub\n\t\tprops.setProperty(\"mail.transport.protocol\", \"smtp\"); // 使用的协议(JavaMail规范要求) \n props.put(\"mail.smtp.host\", \"smtp.office365.com\");\n props.put(\"mail.smtp.port\", \"587\");\n props.put(\"mail.smtp.starttls.enable\",\"true\");\n props.put(\"mail.smtp.auth\", \"true\"); \n\t\t\n\t}", "private static Properties init(){\n // Get a Properties object\n Properties props = System.getProperties();\n props.setProperty(\"mail.smtp.host\", \"smtp.gmail.com\");\n props.setProperty(\"mail.smtp.socketFactory.class\", SSL_FACTORY);\n props.setProperty(\"mail.smtp.socketFactory.fallback\", \"false\");\n props.setProperty(\"mail.smtp.port\", \"465\");\n props.setProperty(\"mail.smtp.socketFactory.port\", \"465\");\n props.put(\"mail.smtp.auth\", \"true\");\n //props.put(\"mail.debug\", \"true\");\n props.put(\"mail.store.protocol\", \"pop3\");\n props.put(\"mail.transport.protocol\", \"smtp\");\n\n return props;\n }", "@Test\n\tpublic void EmailUtility() {\n\n\t\tlog.info(\"Testing Starts\");\n\t\tperformCommonMocking();\n\t\t\n\t\tEmail emailMessage = new Email();\n\t\temailMessage.setHostName(\"localhost\");\n\t\temailMessage.setPortName(\"25\");\n\t\tString[] recipients = new String [3];\n\t\trecipients[0] = \"[email protected]\";\n\t\trecipients[1] = \"[email protected]\";\n\t\trecipients[2] = \"[email protected]\";\n\t\temailMessage.setRecipient(recipients);\n\t\temailMessage.setFrom(\"[email protected]\");\n\t\temailMessage.setSubject(\"Test Email\");\n\t\temailMessage.setBody(\"Test Body\");\n\t\tString[] files = new String[1];\n\t\tfiles[0] = \"C:\\\\Users\\\\asara3\\\\Documents\\\\Architecture.jpg\";\n\t\temailMessage.setFile(files);\n\t\t\n\t\tlog.info(\"Email Model Set Successfully\");\n\t\t\n\t\ttry {\n\t\t\tWhitebox.invokeMethod(EmailUtility.class, \"processEmail\", emailMessage);\n\t\t\tlog.info(\"Model Processed Successfully\");\n\t\t} catch (Exception e) {\n\t\t\n\t\t\tlog.error(\"Error in Model processing\");\n\t\t}\n\t\t\n\t}", "public String getMailing() {\n return mailing;\n }", "public IMailService getMailService() {\n\n return mailService;\n }" ]
[ "0.6675899", "0.64098436", "0.62788546", "0.6272377", "0.62495416", "0.62009704", "0.6123334", "0.6097635", "0.6083425", "0.60263914", "0.6004937", "0.5955348", "0.5952856", "0.59265", "0.59253114", "0.58757216", "0.5825059", "0.58205545", "0.57958925", "0.57914853", "0.5775594", "0.57276255", "0.5726689", "0.5700195", "0.56774026", "0.56610733", "0.5648351", "0.5632779", "0.5616116", "0.56127775", "0.5610445", "0.56095064", "0.55971444", "0.55799985", "0.5576525", "0.5558884", "0.5554014", "0.5545155", "0.5544302", "0.55413514", "0.553219", "0.5518099", "0.55164593", "0.55116373", "0.5505056", "0.550094", "0.5498107", "0.5491328", "0.5473465", "0.5451344", "0.5428651", "0.5426826", "0.54232526", "0.54198176", "0.54123837", "0.54053426", "0.53841865", "0.53828585", "0.53816885", "0.5374621", "0.5369284", "0.5362648", "0.53382075", "0.53337985", "0.5323084", "0.53209996", "0.5318826", "0.53175414", "0.53133154", "0.53132033", "0.5305022", "0.530331", "0.5295645", "0.5283676", "0.52787197", "0.52685595", "0.5268246", "0.5266385", "0.5265242", "0.5261274", "0.5254424", "0.52498007", "0.5241012", "0.52278614", "0.5226573", "0.522091", "0.5220202", "0.521208", "0.521179", "0.5204299", "0.5197588", "0.5194797", "0.5190238", "0.5186126", "0.5181662", "0.51807773", "0.51700306", "0.51677287", "0.5159649", "0.51587147" ]
0.65817964
1
Constructs this helperClasses.ListImages object
public ListImages(File directoryOfInterest, CentralController centralController) throws IOException { this.centralController = centralController; directory = directoryOfInterest; imagesInDirectory = new ArrayList<>(); allImagesUnderDirectory = new ArrayList<>(); // updates the imagesInDirectory list fillImagesInDirectory(); // updates the allImagesUnderDirectory list fillAllImagesUnderDirectory(directory); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ImageList() {\n\t\timageList = new ImageIcon[] { ImageList.BALLOON, ImageList.BANANA, ImageList.GENIE, ImageList.HAMSTER,\n\t\t\t\tImageList.HEART, ImageList.LION, ImageList.MONEY, ImageList.SMOOTHIE, ImageList.TREE, ImageList.TRUCK };\n\t}", "public ImageFiles() {\n\t\tthis.listOne = new ArrayList<String>();\n\t\tthis.listTwo = new ArrayList<String>();\n\t\tthis.listThree = new ArrayList<String>();\n\t\tthis.seenImages = new ArrayList<String>();\n\t\tthis.unseenImages = new ArrayList<String>();\n\t}", "public yandex.cloud.api.containerregistry.v1.ImageServiceOuterClass.ListImagesResponse list(yandex.cloud.api.containerregistry.v1.ImageServiceOuterClass.ListImagesRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getListMethod(), getCallOptions(), request);\n }", "private Images() {}", "public ImageHandler(Group nGroup){\n\t /* Set up the group reference */\n\t\tgroup = nGroup;\n\t\t\n\t\t/* Instantiate the list of images */\n\t\timages = new ArrayList<ImageView>();\n\t}", "public com.google.common.util.concurrent.ListenableFuture<yandex.cloud.api.containerregistry.v1.ImageServiceOuterClass.ListImagesResponse> list(\n yandex.cloud.api.containerregistry.v1.ImageServiceOuterClass.ListImagesRequest request) {\n return io.grpc.stub.ClientCalls.futureUnaryCall(\n getChannel().newCall(getListMethod(), getCallOptions()), request);\n }", "private void addImgList() {\n\t\tdogImg.add(\"./data/img/labrador.jpg\");\t\t\t\t\n\t\tdogImg.add(\"./data/img/germanshepherd.jpg\");\t\n\t\tdogImg.add(\"./data/img/bulldog.jpg\");\t\t\t\t\t\t\t\t\n\t\tdogImg.add(\"./data/img/rottweiler.jpg\");\n\t\tdogImg.add(\"./data/img/husky.jpg\");\n\n\t}", "public ImageAdapter(Context c, List<byte[]> listImage){\r\n\t\tmThumbIds = listImage;\r\n\t\tmContext = c;\r\n\t}", "private void initializeImageModels() {\n for(ImageModel model : GalleryFragment.listImageModel){\n imgList.add(model.getImagePath());\n }\n }", "public LiveData<List<ImageModel>> getImageList()\n {\n return mImagesList;\n }", "public VirtualMachineImageResourceList() {\n super();\n this.setResources(new LazyArrayList<VirtualMachineImageResource>());\n }", "Images getImages(){\n return images;\n }", "public DisplayImages(List<MeasurementService.DataPoint> list, MeasurementService.DataPoint center){\n this.list = list;\n this.center = center;\n }", "private void prepareTheList()\n {\n int count = 0;\n for (String imageName : imageNames)\n {\n RecyclerUtils pu = new RecyclerUtils(imageName, imageDescription[count] ,images[count]);\n recyclerUtilsList.add(pu);\n count++;\n }\n }", "public PictureAdapter(List<Picture> pictures) {\n this.picture = pictures;\n }", "public List<HashMap<String, Object>> imgListSel() {\n\t\treturn sql.selectList(\"imageMapper.imgListSel\", null);\n\t}", "public List<Image> getAllImages() {\n\t\treturn list;\n\t}", "public ArrayList<ImageView> getImages() {\n\t return images;\n\t}", "private void initImages() {\n mImageView1WA = findViewById(R.id.comment_OWA);\n mImageView6DA = findViewById(R.id.comment_btn_6DA);\n mImageView5DA = findViewById(R.id.comment_btn_5DA);\n mImageView4DA = findViewById(R.id.comment_btn_4DA);\n mImageView3DA = findViewById(R.id.comment_btn_3DA);\n mImageView2DA = findViewById(R.id.comment_btn_2DA);\n mImageViewY = findViewById(R.id.comment_btn_1DA);\n\n imageList.add(mImageViewY);\n imageList.add(mImageView2DA);\n imageList.add(mImageView3DA);\n imageList.add(mImageView4DA);\n imageList.add(mImageView5DA);\n imageList.add(mImageView6DA);\n imageList.add(mImageView1WA);\n\n }", "@Nullable\n public abstract Image images();", "@GetMapping(path = \"/images\", produces = \"application/json; charset=UTF-8\")\n public @ResponseBody ArrayNode getImageList() {\n final ArrayNode nodes = mapper.createArrayNode();\n for (final Image image : imageRepository.findAllPublic())\n try {\n nodes.add(mapper.readTree(image.toString()));\n } catch (final JsonProcessingException e) {\n e.printStackTrace();\n }\n return nodes;\n }", "public ArrayList<Image> getImages() {\n\t\treturn getPageObjects(Image.class);\n\t}", "@Override\n\tpublic List<URL> getPhotos() {\n\t\timages.clear(); //vide la liste des images\n\t\t\n\t\t\n\t\tList<URL> allImagesURL = new ArrayList<URL>();\n\t\t\n\t\t/* On initialise la liste de toutes les images */\n\t\tList<String> filelocations = null;\n\t\t\n\t\t/*Nous allons retrouver les fichiers images présent dans le répertoire et tous ses sous-répertoires*/\n\t\tPath start = Paths.get(path); //détermine le point de départ \n\t\ttry (Stream<Path> stream = Files.walk(start, Integer.MAX_VALUE)) {\n\t\t filelocations = stream\n\t\t .map(String::valueOf) //transforme les Path en string\n\t\t .filter(filename -> filename.contains(\".jpg\") || filename.contains(\".png\")) //ne prend que les images jpg et png\n\t\t .collect(Collectors.toList());\n\t\t \n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\t/* Pour chaque fichier retrouvé, on essaie de retrouver son chemin absolu pour le stocker dans le allImagesURL */\n\t\tfor (String filelocation : filelocations) {\n\t\t\tString relativeLocation = filelocation.replace(path+\"/\", \"\"); // Pour ne pas partir de src mais de la classe courante\n\t\t\trelativeLocation = relativeLocation.replace(windowspath+\"\\\\\", \"\");\n\t\t\tallImagesURL.add(this.getClass().getResource(relativeLocation)); //on ajoute le chemin absolu dans la liste\n\t\t}\n\t\t\n\t\t\n\t\treturn allImagesURL; //on retourne la liste\n\t}", "public void list(yandex.cloud.api.containerregistry.v1.ImageServiceOuterClass.ListImagesRequest request,\n io.grpc.stub.StreamObserver<yandex.cloud.api.containerregistry.v1.ImageServiceOuterClass.ListImagesResponse> responseObserver) {\n io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListMethod(), responseObserver);\n }", "private ArrayList<ImageItem> getData() {\n final ArrayList<ImageItem> imageItems = new ArrayList<>();\n // TypedArray imgs = getResources().obtainTypedArray(R.array.image_ids);\n for (int i = 0; i < f.size(); i++) {\n Bitmap bitmap = imageLoader.loadImageSync(\"file://\" + f.get(i));;\n imageItems.add(new ImageItem(bitmap, \"Image#\" + i));\n }\n return imageItems;\n }", "ImageAdapter(Context context, ArrayList<Image> list) {\n mContext = context;\n imageList = list;\n// isDownloaded = downloaded;\n\n mNativeAdRequest = new AdRequest.Builder().build();\n\n adView = new NativeExpressAdView(mContext.getApplicationContext());\n String native_ads_id = mContext.getResources().getString(R.string.string_image_list_native_ad_id);\n adView.setAdUnitId(native_ads_id);\n RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,\n ViewGroup.LayoutParams.WRAP_CONTENT);\n params.setMargins(0, (int) context.getResources().getDimension(R.dimen.ad_vertical_margin), 0,\n (int) context.getResources().getDimension(R.dimen.ad_vertical_margin));\n params.addRule(RelativeLayout.CENTER_HORIZONTAL);\n adView.setLayoutParams(params);\n// memorySize = calculateMultipleSize();\n }", "public void list(yandex.cloud.api.containerregistry.v1.ImageServiceOuterClass.ListImagesRequest request,\n io.grpc.stub.StreamObserver<yandex.cloud.api.containerregistry.v1.ImageServiceOuterClass.ListImagesResponse> responseObserver) {\n io.grpc.stub.ClientCalls.asyncUnaryCall(\n getChannel().newCall(getListMethod(), getCallOptions()), request, responseObserver);\n }", "private Images() {\n \n imgView = new ImageIcon(this,\"images/View\");\n\n imgUndo = new ImageIcon(this,\"images/Undo\");\n imgRedo = new ImageIcon(this,\"images/Redo\");\n \n imgCut = new ImageIcon(this,\"images/Cut\");\n imgCopy = new ImageIcon(this,\"images/Copy\");\n imgPaste = new ImageIcon(this,\"images/Paste\");\n \n imgAdd = new ImageIcon(this,\"images/Add\");\n \n imgNew = new ImageIcon(this,\"images/New\");\n imgDel = new ImageIcon(this,\"images/Delete\");\n \n imgShare = new ImageIcon(this,\"images/Share\");\n }", "public Image[] getImages() {\n return images;\n }", "public void init(Context mContext)\n {\n if(mImageRepository!=null)\n {\n return;\n }\n\n mImageRepository=ImageRepository.getInstance(mContext);\n\n //getting list from mImageRepository\n mImagesList=mImageRepository.getImageList();\n }", "public ArrayList<ImageLoader<E>> getImageLoaders();", "public void initImages(ArrayList<Produit> l) {\r\n\r\n if (l.size() > 0) {\r\n loadImage1(l.get(0).getImg_url());\r\n \r\n }\r\n\r\n if (l.size() > 1) {\r\n loadImage2(l.get(1).getImg_url());\r\n }\r\n\r\n if (l.size() > 2) {\r\n loadImage3(l.get(2).getImg_url());\r\n \r\n }\r\n\r\n if (l.size() > 3) {\r\n loadImage4(l.get(3).getImg_url());\r\n \r\n }\r\n\r\n if (l.size() > 4) {\r\n loadImage5(l.get(4).getImg_url());\r\n \r\n }\r\n\r\n if (l.size() > 5) {\r\n loadImage6(l.get(5).getImg_url());\r\n \r\n }\r\n\r\n }", "public List<WebResource> getImages() {\r\n\t\tList<WebResource> result = new Vector<WebResource>();\r\n\t\tList<WebComponent> images = wcDao.getImages();\r\n\t\t// settare l'href corretto...\r\n\t\tfor (Iterator<WebComponent> iter = images.iterator(); iter.hasNext();) {\r\n\t\t\tresult.add((WebResource) iter.next());\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public ArrayList<ImageFile> getImageFiles() {\n return new ArrayList<>(imageFiles);\n }", "public ImageIcon[] getImages() {\n\t\treturn imageList;\n\t}", "public List<Pic> list() {\n\t\treturn picDao.list();\n\t}", "GetImagesResult getImages(GetImagesRequest getImagesRequest);", "@HTTP(\n method = \"GET\",\n path = \"/apis/config.openshift.io/v1/images\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesListCall<ImageList, Image> listImage();", "public AlternateImageRenderer() {\r\n super(\"\");\r\n images = new Image[2];\r\n try {\r\n Resources imageRes = UIDemoMain.getResource(\"images\");\r\n images[0] = imageRes.getImage(\"sady.png\");\r\n images[1] = imageRes.getImage(\"smily.png\");\r\n } catch (IOException ex) {\r\n ex.printStackTrace();\r\n }\r\n setUIID(\"ListRenderer\");\r\n }", "@HTTP(\n method = \"GET\",\n path = \"/apis/config.openshift.io/v1/images\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesListCall<ImageList, Image> listImage(\n @QueryMap ListImage queryParameters);", "private void processImages(List<String> images) {\n setTitle(\"Showing images\");\n mImages = images;\n setListAdapter(new ImagesAdapter());\n }", "public List<Image> getAllImage()\n {\n GetAllImageQuery getAllImageQuery = new GetAllImageQuery();\n return super.queryResult(getAllImageQuery);\n }", "public List<Image> getAllImage() {\n\t\treturn null;\n\t}", "@Override\n\tpublic int getCount() {\n\t\treturn imagelist.length;\n\t}", "public ImageAdapter(Activity localContext, ArrayList<String> paths) {\n context = localContext;\n images = paths;\n }", "public String getImages() {\n\t\treturn this.images;\n\t}", "private LinkedList<Image> loadPhotos(int n){\n\t\tLinkedList<Image> listOfPhotos = new LinkedList<>();\n\t\t\n\t\t\n\t\ttry {\n\n\t\t\tFileInputStream in = new FileInputStream(\"images\");\n\t\t\t//Skipping magic number and array size\n\t\t\tfor (int i = 0; i < 16; i++) {\n\t\t\t\tin.read();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor (int k = 0; k < n; k++) {\n\t\t\t\tImage img = new Image(HEIGHT, WIDTH);\n\t\t\t\t\n\t\t\t\tbyte[][] imageData = new byte[WIDTH][HEIGHT];\n\t\t\t\tfor (int i = k*WIDTH; i < k*WIDTH + WIDTH; i++) {\n\t\t\t\t\tfor (int j = k*HEIGHT; j < k*HEIGHT + HEIGHT; j++) {\n\t\t\t\t\t\timageData[j%28][i%28] = (byte) in.read();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\timg.setData(imageData);\n\t\t\t\tlistOfPhotos.add(img);\n\t\t\t}\n\t\t\tin.close();\n\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\t\n\t\t\n\t\treturn listOfPhotos;\n\t\t\n\t}", "@Override\n\t public int getCount() {\n\t return listImg.size();\n\t }", "public BuildingList() {\n Building temp = new Building(1);\n temp.createSubAreas(6);\n temp.setSystemPass(\"0000\");\n URL url = this.getClass().getClassLoader()\n .getResource(\"singleHouse.jpg\");\n temp.setImage(url);\n\n buildings.add(temp);\n temp = new Building(2);\n url = this.getClass().getClassLoader()\n .getResource(\"commercial.jpg\");\n temp.setImage(url);\n buildings.add(temp);\n }", "public JsonImage() {\n this.fileName = \"untitled\";\n this.numPagesDisplayed = 0;\n this.pageList = new ArrayList<>();\n }", "@Override\n\t\tpublic int getCount() {\n\t\t\treturn imageviewlist.size();\n\t\t}", "public Charlie(ArrayList charlieimages){\n this.charlieimages= charlieimages;\n /*charlieimages=new ArrayList<String>();\n //charlieimages.add(\"06.png\");\n charlieimages.add(\"06.png\");\n charlieimages.add(\"08.png\");\n charlieimages.add(\"08.png\");\n charlieimages.add(\"07.png\"); \n charlieimages.add(\"07.png\");*/\n \n iRepository=new ImageRepository(charlieimages);\n iIterator=iRepository.createIterator();\n observers=new ArrayList();\n lifeobservers=new ArrayList();\n }", "SchoollistAdapter(Context context,List<Integer> imageIds)\n {\n mcontext=context;\n mInflater = LayoutInflater.from(context);\n mImageIds = imageIds;\n\n }", "java.util.List<com.yahoo.xpathproto.TransformTestProtos.ContentImage> \n getImagesByHandlerList();", "@ApiModelProperty(value = \"An image to give an indication of what to expect when renting this vehicle.\")\n public List<Image> getImages() {\n return images;\n }", "@Override\n\tpublic String imageLists(String url, QueryBean param) throws IOException {\n\t\treturn new HttpUtil().getHttp(url + param.toString());\n\t}", "@Override\n\t\tpublic int getCount() {\n\t\t\treturn images.size();\n\t\t}", "@Generated(hash = 1057346450)\n public List<Image> getImageList() {\n if (imageList == null) {\n final DaoSession daoSession = this.daoSession;\n if (daoSession == null) {\n throw new DaoException(\"Entity is detached from DAO context\");\n }\n ImageDao targetDao = daoSession.getImageDao();\n List<Image> imageListNew = targetDao._queryEvent_ImageList(id);\n synchronized (this) {\n if (imageList == null) {\n imageList = imageListNew;\n }\n }\n }\n return imageList;\n }", "public List<String> getImagesUrl() {\n\t\tif (imagesUrl == null) {\n\t\t\timagesUrl = new ArrayList<String>();\n\t\t}\n\t\treturn imagesUrl;\n\t}", "public java.util.List<com.yahoo.xpathproto.TransformTestProtos.ContentImage> getImagesByHandlerList() {\n if (imagesByHandlerBuilder_ == null) {\n return java.util.Collections.unmodifiableList(imagesByHandler_);\n } else {\n return imagesByHandlerBuilder_.getMessageList();\n }\n }", "public ImageAdapter(Context context, List<Attraction> listOfAttractions, List<List<Uri>> imageUri) {\n this.mContext = context;\n this.listOfAttractions = listOfAttractions;\n this.listOfImagesUri = imageUri;\n }", "public InstagramPhotosAdapter(Context context, List<InstagramPhoto> objects) {\n super(context, android.R.layout.simple_list_item_1, objects);\n }", "@Override\n\tpublic List<Image> findAllImage() {\n\t\treturn new ImageDaoImpl().findAllImage();\n\t}", "private static CopyOnWriteArrayList<String> getListOfImages(String username){\r\n\t\treturn getUser(username).getImageList();\r\n\t}", "java.util.List<com.google.protobuf.ByteString> getImgDataList();", "private void fillImageViewList(){\n ImageView imView1 =(ImageView) findViewById(R.id.imgCel1);\n ImageView imView2 =(ImageView) findViewById(R.id.imgCel2);\n ImageView imView3 =(ImageView) findViewById(R.id.imgCel3);\n ImageView imView4 =(ImageView) findViewById(R.id.imgCel4);\n ImageView imView5 =(ImageView) findViewById(R.id.imgCel5);\n ImageView imView6 =(ImageView) findViewById(R.id.imgCel6);\n ImageView imView7 =(ImageView) findViewById(R.id.imgCel7);\n ImageView imView8 =(ImageView) findViewById(R.id.imgCel8);\n ImageView imView9 =(ImageView) findViewById(R.id.imgCel9);\n\n imageList = new ArrayList<>();\n\n imageList.add(imView1); imageList.add(imView2);\n imageList.add(imView3); imageList.add(imView4);\n imageList.add(imView5); imageList.add(imView6);\n imageList.add(imView7); imageList.add(imView8);\n imageList.add(imView9);\n }", "private ImageLoader() {}", "public byte[] getImages() {\n return images;\n }", "@Override\n\t\tpublic int getCount() {\n\t\t\treturn imgs.length;\n\t\t}", "private ArrayList<String> getImagesPathList() {\n String MEDIA_IMAGES_PATH = \"CuraContents/images\";\n File fileImages = new File(Environment.getExternalStorageDirectory(), MEDIA_IMAGES_PATH);\n if (fileImages.isDirectory()) {\n File[] listImagesFile = fileImages.listFiles();\n ArrayList<String> imageFilesPathList = new ArrayList<>();\n for (File file1 : listImagesFile) {\n imageFilesPathList.add(file1.getAbsolutePath());\n }\n return imageFilesPathList;\n }\n return null;\n }", "public static Image unitList()\n\t{\n\t\treturn unitList;\n\t}", "@Override\n public int getCount() {\n return imageIDs.length;\n }", "public List<Image> getImages() {\r\n\t\treturn immutableImageList;\r\n\t}", "java.util.List<? extends com.yahoo.xpathproto.TransformTestProtos.ContentImageOrBuilder> \n getImagesByHandlerOrBuilderList();", "public ThumbnailList(File image_directory, File thumbnail_image_directory, String open_directory_key, IThumbnailListCallback thumbnailListCallback, ThumbnailPanel thumbnailPanel, Frame owner, Component parent) {\r\n\t\tsuper(image_directory, thumbnail_image_directory, ImagePropertyManager.get_instance(),\r\n\t\t\tResourceManager.get( \"application.title\"), \r\n\t\t\tnew String[] { ResourceManager.get( \"thumbnail.load.show.message\"),\r\n\t\t\t\tResourceManager.get( \"thumbnail.make.show.message\"),\r\n\t\t\t\tResourceManager.get( \"thumbnail.confirm.overwrite.message\"),\r\n\t\t\t\tResourceManager.get( \"thumbnail.confirm.remove.message\")},\r\n\t\t\tnew String[] { ResourceManager.get( \"dialog.yes\"),\r\n\t\t\t\tResourceManager.get( \"dialog.no\"),\r\n\t\t\t\tResourceManager.get( \"dialog.yes.to.all\"),\r\n\t\t\t\tResourceManager.get( \"dialog.no.to.all\"),\r\n\t\t\t\tResourceManager.get( \"dialog.cancel\")},\r\n\t\t\tResourceManager.get( \"dialog.cancel\"), owner, parent);\r\n\t\t_max = AnimatorImageManager._thumbnail_max;\r\n\t\t_side = AnimatorImageManager._thumbnail_size;\r\n\t\t_open_directory_key = open_directory_key;\r\n\t\t_thumbnailListCallback = thumbnailListCallback;\r\n\t\t_thumbnailPanel = thumbnailPanel;\r\n\t}", "List<Bitmap> getRecipeImgSmall();", "public List<Image> getItemsList() {\n\n\t\treturn this.itemsList;\n\n\t}", "@Override\n public int getCount() {\n return imgs.length;\n }", "@Override\n\tpublic List<String> getAllImages() {\n\t\t\n\t\treturn jdbcTemplate.query(\"select * from news\", new BeanPropertyRowMapper<News>());\n\t}", "@Generated(hash = 15234777)\n public synchronized void resetImageList() {\n imageList = null;\n }", "public List<Image> parseMainImagesResult(Document doc) {\n\n ArrayList<Image> mainImages = new ArrayList<>();\n Elements mainHtmlImages = doc.select(CSS_IMAGE_QUERY);\n Timber.i(\"Images: %s\", mainHtmlImages.toString());\n String href;\n Image mainImage;\n for (Element mainHtmlImage : mainHtmlImages) {\n href = mainHtmlImage.attr(\"href\");\n Timber.i(\"Link href: %s\", href);\n mainImage = new Image(href);\n mainImages.add(mainImage);\n }\n return mainImages;\n }", "private List<? extends Image> getIconImages(String imgunnamedjpg) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@Override\n\tpublic int getCount() {\n\t\treturn IMAGES.length;\n\t}", "public ImagesLoader(ImageFactory imageFactory) {\n this.imageFactory = imageFactory;\n }", "public ImageGalleryAdapter(Context context,List<String> paths,int width, int height){\n\t\tmContext = context;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t\tmFilepaths = paths; \n\t\tmImages = new ArrayList<ImageView>(); \n \tint index = 0;\n \tif(paths==null||paths.size()==0)\n \t\treturn;\n \tfor (String filepath : paths){ \n \t\tBitmap originalImage = BitmapFactory.decodeFile(filepath);\n \t\t//originalImage = ImageUtil.toRoundCorner(originalImage, 30); 不去圆角\n \t\tImageView imageView = new BorderImageView(mContext); \n \t\timageView.setImageBitmap(originalImage); \n \t\timageView.setLayoutParams(new Gallery.LayoutParams(width, height));\n \t\tmImages.add(index++, imageView); \n \t} \n\t}", "public Image getImg(){\n\t\treturn imgs[count];\n\t}", "public void setImages() {\n\n imgBlock.removeAll();\n imgBlock.revalidate();\n imgBlock.repaint();\n labels = new JLabel[imgs.length];\n for (int i = 0; i < imgs.length; i++) {\n\n labels[i] = new JLabel(new ImageIcon(Toolkit.getDefaultToolkit().createImage(imgs[i].getSource())));\n imgBlock.add(labels[i]);\n\n }\n\n SwingUtilities.updateComponentTreeUI(jf); // refresh\n initialized = true;\n\n }", "private ImageMappings() {}", "public VirtualMachineVMImageListResponse() {\n super();\n this.setVMImages(new LazyArrayList<VirtualMachineVMImageListResponse.VirtualMachineVMImage>());\n }", "@Override\n\t\tpublic int getCount()\n\t\t{\n\t\t\treturn imageIds.length;\n\t\t}", "public void initializeImages() {\n\n File dir = new File(\"Images\");\n if (!dir.exists()) {\n boolean success = dir.mkdir();\n System.out.println(\"Images directory created!\");\n }\n }", "private void getImagesFromDatabase() {\n try {\n mCursor = mDbAccess.getPuzzleImages();\n\n if (mCursor.moveToNext()) {\n for (int i = 0; i < mCursor.getCount(); i++) {\n String imagetitle = mCursor.getString(mCursor.getColumnIndex(\"imagetitle\"));\n String imageurl = mCursor.getString(mCursor.getColumnIndex(\"imageurl\"));\n mImageModel.add(new CustomImageModel(imagetitle, imageurl));\n mCursor.moveToNext();\n }\n } else {\n Toast.makeText(getActivity(), \"databse not created...\", Toast.LENGTH_LONG).show();\n }\n } catch (Exception e) {\n e.printStackTrace();\n\n }\n\n }", "public ArrayList<ImageFile> getImagesInDirectory() throws IOException {\n\n return imagesInDirectory;\n }", "MyRecyclerViewAdapterImage(Context context, ArrayList<String> home_url) {\n this.context = context;\n this.mInflater = LayoutInflater.from(context);\n this.home_url = home_url;\n }", "@Override\r\n\t\tpublic int getCount() {\n\t\t\treturn pictures.length;\r\n\t\t}", "protected Builder() {\n super(new ImageStatisticsElementGroupElementImages());\n }", "public java.util.List<? extends com.yahoo.xpathproto.TransformTestProtos.ContentImageOrBuilder> \n getImagesByHandlerOrBuilderList() {\n if (imagesByHandlerBuilder_ != null) {\n return imagesByHandlerBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(imagesByHandler_);\n }\n }", "List<Photo> homePagePhotos();", "public static List<InputStream> getAllImages(){\n\t\treturn IOHandler.getResourcesIn(IMAGES_DIR);\n\t}", "@Override\n public int getCount() {\n return images.size();\n }" ]
[ "0.7522456", "0.7234399", "0.6887931", "0.6833843", "0.65952617", "0.6563624", "0.6559129", "0.65370756", "0.6531805", "0.6477041", "0.64540887", "0.64514273", "0.6442766", "0.6428296", "0.64199", "0.6408172", "0.6387006", "0.6370418", "0.636462", "0.631759", "0.63080055", "0.6295206", "0.6274696", "0.627118", "0.6256523", "0.6244081", "0.62415475", "0.62339574", "0.62244344", "0.6192189", "0.61374855", "0.61290336", "0.6118791", "0.6114692", "0.6107293", "0.61019987", "0.6096076", "0.60871863", "0.60808724", "0.60693717", "0.60299987", "0.602568", "0.60240895", "0.6019545", "0.6015283", "0.6008449", "0.59949476", "0.59829414", "0.59745705", "0.5958562", "0.5938804", "0.59379953", "0.5930031", "0.59278363", "0.5920851", "0.59206796", "0.5916425", "0.59140337", "0.5902216", "0.5899306", "0.58990455", "0.58989245", "0.5897399", "0.58911484", "0.5889599", "0.5853651", "0.5819216", "0.5796173", "0.57902694", "0.57854706", "0.5784573", "0.5775835", "0.576883", "0.576855", "0.5763672", "0.57632256", "0.5751692", "0.5749971", "0.57380617", "0.57365185", "0.5734815", "0.57337356", "0.5729504", "0.57217145", "0.5717697", "0.5717448", "0.57021844", "0.5699355", "0.56987745", "0.56936985", "0.5692949", "0.56914574", "0.5681204", "0.56618494", "0.56608206", "0.566064", "0.5653806", "0.5653474", "0.56530887", "0.56517553" ]
0.598153
48
Returns all images inside the directory including sub directories
public ArrayList<ImageFile> getAllImagesUnderDirectory() throws IOException { return allImagesUnderDirectory; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<InputStream> getAllImages(){\n\t\treturn IOHandler.getResourcesIn(IMAGES_DIR);\n\t}", "public ArrayList<ImageFile> getImagesInDirectory() throws IOException {\n\n return imagesInDirectory;\n }", "private void fillImagesInDirectory() throws IOException {\n // get the list of all files (including directories) in the directory of interest\n File[] fileArray = directory.listFiles();\n assert fileArray != null;\n for (File file : fileArray) {\n // the file is an image, then add it\n if (isImage(file)) {\n ImageFile imageFile = new ImageFile(file.getAbsolutePath());\n // if the image is already saved, reuse it\n if (centralController.getImageFileController().hasImageFile(imageFile)) {\n imagesInDirectory.add(centralController.getImageFileController().getImageFile(imageFile));\n } else {\n imagesInDirectory.add(imageFile);\n }\n }\n }\n }", "private static ArrayList<String> getImagesInFileSystem() {\n\t\t// get file list in database\n\t\tArrayList<String> fileNameList = new ArrayList<String>();\n\t\t\n\t\tFile folder = new File(IMAGE_DIRECTORY);\n\t File[] listOfFiles = folder.listFiles();\n\t \n\t for (File currFile : listOfFiles) {\n\t if (currFile.isFile() && !currFile.getName().startsWith(\".\")) {\n\t \t fileNameList.add(currFile.getName());\n\t }\n\t }\n\t \n\t return fileNameList;\n\t}", "private static void loadImagesInDirectory(String dir){\n\t\tFile file = new File(Files.localize(\"images\\\\\"+dir));\n\t\tassert file.isDirectory();\n\t\n\t\tFile[] files = file.listFiles();\n\t\tfor(File f : files){\n\t\t\tif(isImageFile(f)){\n\t\t\t\tString name = dir+\"\\\\\"+f.getName();\n\t\t\t\tint i = name.lastIndexOf('.');\n\t\t\t\tassert i != -1;\n\t\t\t\tname = name.substring(0, i).replaceAll(\"\\\\\\\\\", \"/\");\n\t\t\t\t//Image image = load(f,true);\n\t\t\t\tImageIcon image;\n\t\t\t\tFile f2 = new File(f.getAbsolutePath()+\".anim\");\n\t\t\t\tif(f2.exists()){\n\t\t\t\t\timage = evaluateAnimFile(dir,f2,load(f,true));\n\t\t\t\t}else{\n\t\t\t\t\timage = new ImageIcon(f.getAbsolutePath());\n\t\t\t\t}\n\t\t\t\tdebug(\"Loaded image \"+name+\" as \"+f.getAbsolutePath());\n\t\t\t\timages.put(name, image);\n\t\t\t}else if(f.isDirectory()){\n\t\t\t\tloadImagesInDirectory(dir+\"\\\\\"+f.getName());\n\t\t\t}\n\t\t}\n\t}", "private void fillAllImagesUnderDirectory(File directory) throws IOException {\n // get the list of all files (including directories) in the directory of interest\n File[] fileArray = directory.listFiles();\n assert fileArray != null;\n\n for (File file : fileArray) {\n // if the file is an image, then add it\n if (isImage(file)) {\n ImageFile imageFile = new ImageFile(file.getAbsolutePath());\n // if the image is already saved, reuse it\n if (centralController.getImageFileController().hasImageFile(imageFile)) {\n allImagesUnderDirectory\n .add(centralController.getImageFileController().getImageFile(imageFile));\n } else if (imagesInDirectory.contains(imageFile)) {\n allImagesUnderDirectory.add(imagesInDirectory.get(imagesInDirectory.indexOf(imageFile)));\n } else {\n allImagesUnderDirectory.add(imageFile);\n }\n } else if (file.isDirectory()) {\n fillAllImagesUnderDirectory(file);\n }\n }\n }", "public List<Image> getAllImages() {\n\t\treturn list;\n\t}", "private BufferedImage[] loadImages(String directory, BufferedImage[] img) throws Exception {\n\t\tFile dir = new File(directory);\n\t\tFile[] files = dir.listFiles();\n\t\tArrays.sort(files, (s, t) -> s.getName().compareTo(t.getName()));\n\t\t\n\t\timg = new BufferedImage[files.length];\n\t\tfor (int i = 0; i < files.length; i++) {\n\t\t\timg[i] = ImageIO.read(files[i]);\n\t\t}\n\t\treturn img;\n\t}", "@Override\n\tpublic List<Image> findAll() {\n\t\treturn imageRepository.findAll();\n\t}", "@Override\n\tpublic List<Image> findAllImage() {\n\t\treturn new ImageDaoImpl().findAllImage();\n\t}", "private ArrayList<String> getImagesPathList() {\n String MEDIA_IMAGES_PATH = \"CuraContents/images\";\n File fileImages = new File(Environment.getExternalStorageDirectory(), MEDIA_IMAGES_PATH);\n if (fileImages.isDirectory()) {\n File[] listImagesFile = fileImages.listFiles();\n ArrayList<String> imageFilesPathList = new ArrayList<>();\n for (File file1 : listImagesFile) {\n imageFilesPathList.add(file1.getAbsolutePath());\n }\n return imageFilesPathList;\n }\n return null;\n }", "public List<Image> getAllImage() {\n\t\treturn null;\n\t}", "public List<Image> getAllImage()\n {\n GetAllImageQuery getAllImageQuery = new GetAllImageQuery();\n return super.queryResult(getAllImageQuery);\n }", "@Override\n\tpublic List<URL> getPhotos() {\n\t\timages.clear(); //vide la liste des images\n\t\t\n\t\t\n\t\tList<URL> allImagesURL = new ArrayList<URL>();\n\t\t\n\t\t/* On initialise la liste de toutes les images */\n\t\tList<String> filelocations = null;\n\t\t\n\t\t/*Nous allons retrouver les fichiers images présent dans le répertoire et tous ses sous-répertoires*/\n\t\tPath start = Paths.get(path); //détermine le point de départ \n\t\ttry (Stream<Path> stream = Files.walk(start, Integer.MAX_VALUE)) {\n\t\t filelocations = stream\n\t\t .map(String::valueOf) //transforme les Path en string\n\t\t .filter(filename -> filename.contains(\".jpg\") || filename.contains(\".png\")) //ne prend que les images jpg et png\n\t\t .collect(Collectors.toList());\n\t\t \n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\t/* Pour chaque fichier retrouvé, on essaie de retrouver son chemin absolu pour le stocker dans le allImagesURL */\n\t\tfor (String filelocation : filelocations) {\n\t\t\tString relativeLocation = filelocation.replace(path+\"/\", \"\"); // Pour ne pas partir de src mais de la classe courante\n\t\t\trelativeLocation = relativeLocation.replace(windowspath+\"\\\\\", \"\");\n\t\t\tallImagesURL.add(this.getClass().getResource(relativeLocation)); //on ajoute le chemin absolu dans la liste\n\t\t}\n\t\t\n\t\t\n\t\treturn allImagesURL; //on retourne la liste\n\t}", "public void getImagesFromFolder() {\n File file = new File(Environment.getExternalStorageDirectory().toString() + \"/saveclick\");\n if (file.isDirectory()) {\n fileList = file.listFiles();\n for (int i = 0; i < fileList.length; i++) {\n files.add(fileList[i].getAbsolutePath());\n Log.i(\"listVideos\", \"file\" + fileList[0]);\n }\n }\n }", "public ListImages(File directoryOfInterest, CentralController centralController)\n throws IOException {\n\n this.centralController = centralController;\n\n directory = directoryOfInterest;\n imagesInDirectory = new ArrayList<>();\n allImagesUnderDirectory = new ArrayList<>();\n\n // updates the imagesInDirectory list\n fillImagesInDirectory();\n\n // updates the allImagesUnderDirectory list\n fillAllImagesUnderDirectory(directory);\n }", "private static void displayImagesDir(){\n System.out.println(IMAGES_DIR);\n }", "public ArrayList<Image> getImages() {\n\t\treturn getPageObjects(Image.class);\n\t}", "public static List<Path> getImages(final FileSystem fs) {\n return getEntries(fs).stream().filter(ZipReaderUtil::isImage).collect(Collectors.toList());\n }", "public void populateCachedImages(File dir)\n {\n if (dir.exists())\n {\n File[] files = dir.listFiles();\n for (int i = 0; i < files.length; i++)\n {\n File file = files[i];\n if (!file.isDirectory())\n {\n //Record all filenames from the cache so we know which photos to retrieve from database\n cachedFileNames.add(file.getName());\n imageList.add(file);\n }\n }\n }\n }", "private ArrayList<String> getAllShownImagesPath(Activity activity) {\n Uri uri;\n Cursor cursor;\n int column_index_data, column_index_folder_name;\n ArrayList<String> listOfAllImages = new ArrayList<String>();\n String absolutePathOfImage = null;\n uri = android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI;\n\n String[] projection = { MediaStore.MediaColumns.DATA,\n MediaStore.Images.Media.BUCKET_DISPLAY_NAME };\n\n cursor = activity.getContentResolver().query(uri, projection, null,\n null, null);\n\n column_index_data = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DATA);\n column_index_folder_name = cursor\n .getColumnIndexOrThrow(MediaStore.Images.Media.BUCKET_DISPLAY_NAME);\n while (cursor.moveToNext()) {\n absolutePathOfImage = cursor.getString(column_index_data);\n\n listOfAllImages.add(absolutePathOfImage);\n }\n return listOfAllImages;\n }", "@GetMapping(path = \"/images\", produces = \"application/json; charset=UTF-8\")\n public @ResponseBody ArrayNode getImageList() {\n final ArrayNode nodes = mapper.createArrayNode();\n for (final Image image : imageRepository.findAllPublic())\n try {\n nodes.add(mapper.readTree(image.toString()));\n } catch (final JsonProcessingException e) {\n e.printStackTrace();\n }\n return nodes;\n }", "@Override\n\tpublic List<ImageEntity> getAll() {\n\t\treturn DatabaseContext.findAll(ImageEntity.class);\n\t}", "protected Seq<Fi> loadImages(Xml root, Fi tmxFile){\n Seq<Fi> images = new Seq<>();\n\n for(Xml imageLayer : root.getChildrenByName(\"imagelayer\")){\n Xml image = imageLayer.getChildByName(\"image\");\n String source = image.getAttribute(\"source\", null);\n\n if(source != null){\n Fi handle = getRelativeFileHandle(tmxFile, source);\n\n if(!images.contains(handle, false)){\n images.add(handle);\n }\n }\n }\n\n return images;\n }", "public List<WebResource> getImages() {\r\n\t\tList<WebResource> result = new Vector<WebResource>();\r\n\t\tList<WebComponent> images = wcDao.getImages();\r\n\t\t// settare l'href corretto...\r\n\t\tfor (Iterator<WebComponent> iter = images.iterator(); iter.hasNext();) {\r\n\t\t\tresult.add((WebResource) iter.next());\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "static public ObservableList<ImageMetaInfo> getImagesInfo(File path) {\n ObservableList<ImageMetaInfo> observableList = FXCollections.observableArrayList();\n ExtFilter fileFilter = new ExtFilter();\n File[] imageFilesArray = path.listFiles(fileFilter);\n for (File file : imageFilesArray) {\n ImageMetaInfo imageMetaInfo = getImageMetaInfo(file);\n observableList.add(imageMetaInfo);\n }\n return observableList;\n }", "private void loadImages() {\n\t\ttry {\n\t\t\tall_images = new Bitmap[img_files.length];\n\t\t\tfor (int i = 0; i < all_images.length; i++) {\n\t\t\t\tall_images[i] = loadImage(img_files[i] + \".jpg\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tToast.makeText(this, \"Unable to load images\", Toast.LENGTH_LONG)\n\t\t\t\t\t.show();\n\t\t\tfinish();\n\t\t}\n\t}", "public ScanResult getFilesRecursively() {\n\n final ScanResult scanResult = new ScanResult();\n try {\n Files.walkFileTree(this.basePath, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n if (!attrs.isDirectory() && PICTURE_MATCHER.accept(file.toFile())) {\n scanResult.addEntry(convert(file));\n System.out.println(file.toFile());\n }\n return FileVisitResult.CONTINUE;\n }\n });\n } catch (IOException e) {\n // intentional fallthrough\n }\n\n return new ScanResult();\n }", "public void findImages() {\n \t\tthis.mNoteItemModel.findImages(this.mNoteItemModel.getContent());\n \t}", "public ArrayList<ImageFile> getImageFiles() {\n return new ArrayList<>(imageFiles);\n }", "public Collection<GPImageLinkComponent> getImages()\n\t{\n\t\treturn getImages( getSession().getSessionContext() );\n\t}", "private List<String> returnFiles(int selection) {\n\t\tString path = System.getProperty(\"user.dir\");\n\t\tList<String> allImages = new ArrayList<String>();\n\t\tpath += this.setFolderPath(selection);\n\t\tFile[] files = new File(path).listFiles();\n\n\t\tfor (File file : files) {\n\t\t\tif (file.isFile() && isCorrectFile(file)) {\n\t\t\t\tallImages.add(file.getAbsolutePath());\n\t\t\t}\n\t\t}\n\t\treturn allImages;\n\t}", "private void processImages() throws MalformedURLException, IOException {\r\n\r\n\t\tNodeFilter imageFilter = new NodeClassFilter(ImageTag.class);\r\n\t\timageList = fullList.extractAllNodesThatMatch(imageFilter, true);\r\n\t\tthePageImages = new HashMap<String, byte[]>();\r\n\r\n\t\tfor (SimpleNodeIterator nodeIter = imageList.elements(); nodeIter\r\n\t\t\t\t.hasMoreNodes();) {\r\n\t\t\tImageTag tempNode = (ImageTag) nodeIter.nextNode();\r\n\t\t\tString tagText = tempNode.getText();\r\n\r\n\t\t\t// Populate imageUrlText String\r\n\t\t\tString imageUrlText = tempNode.getImageURL();\r\n\r\n\t\t\tif (imageUrlText != \"\") {\r\n\t\t\t\t// Print to console, to verify relative link processing\r\n\t\t\t\tSystem.out.println(\"ImageUrl to Retrieve:\" + imageUrlText);\r\n\r\n\t\t\t\tbyte[] imgArray = downloadBinaryData(imageUrlText);\r\n\r\n\t\t\t\tthePageImages.put(tagText, imgArray);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "@Override\n public List<String> getUserImages(User user) {\n List<Image> images = user.getImageList();\n List<String> paths = new ArrayList<>();\n for (Image image : images) {\n paths.add(image.getImagePath());\n }\n return paths;\n }", "public List<Image> parseMainImagesResult(Document doc) {\n\n ArrayList<Image> mainImages = new ArrayList<>();\n Elements mainHtmlImages = doc.select(CSS_IMAGE_QUERY);\n Timber.i(\"Images: %s\", mainHtmlImages.toString());\n String href;\n Image mainImage;\n for (Element mainHtmlImage : mainHtmlImages) {\n href = mainHtmlImage.attr(\"href\");\n Timber.i(\"Link href: %s\", href);\n mainImage = new Image(href);\n mainImages.add(mainImage);\n }\n return mainImages;\n }", "public void saveImagesFolder(final Path path_of_resource) throws IOException {\n final Path path = path_of_resource;\n Set<String> listImages = new HashSet<>();\n listImages = listFiles(path);\n List<String> found = new ArrayList<>();\n Iterator<Image> image_it = imageRepository.findAll().iterator();\n // Filter images that have the same name in the db and the images in the\n // resource folder.\n while (image_it.hasNext()) {\n Image next_i = image_it.next();\n Iterator<String> list_it = listImages.iterator();\n while (list_it.hasNext()) {\n String next_s = list_it.next();\n if (next_i.getName().equals(Paths.get(next_s).getFileName().toString()))\n found.add(next_s);\n }\n }\n listImages.removeAll(found);\n System.out.println(listImages);\n listImages.forEach(i -> {\n try {\n final byte[] fileContent = Files.readAllBytes(Paths.get(i));\n Image image = new Image(Paths.get(i).getFileName().toString(), fileContent,\n Utils.typeOfFile(Paths.get(i)), Utils.sizeOfImage(Paths.get(i)));\n image.setIsNew(false);\n imageRepository.save(image);\n\n } catch (final IOException e) {\n e.printStackTrace();\n }\n });\n }", "public void initializeImages() {\n\n File dir = new File(\"Images\");\n if (!dir.exists()) {\n boolean success = dir.mkdir();\n System.out.println(\"Images directory created!\");\n }\n }", "public yandex.cloud.api.containerregistry.v1.ImageServiceOuterClass.ListImagesResponse list(yandex.cloud.api.containerregistry.v1.ImageServiceOuterClass.ListImagesRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getListMethod(), getCallOptions(), request);\n }", "private List<String> getAllShownImagesPath(Activity context) {\n String[] columns = {MediaStore.Images.Media.DATA, MediaStore.Images.Media.DATE_ADDED};\n\n Cursor cursor = context.getContentResolver().query(\n MediaStore.Images.Media.EXTERNAL_CONTENT_URI, // Specify the provider\n columns, // The columns we're interested in m\n MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME + \" = \" + \"'Camera'\", // A WHERE-filter query\n null, // The arguments for the filter-query\n MediaStore.Images.Media.DATE_ADDED + \" DESC\" // Order the results, newest first\n );\n //\n\n List<String> result = new ArrayList<String>(cursor.getCount());\n\n if (cursor.moveToFirst()) {\n final int image_path_col = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);\n do {\n result.add(cursor.getString(image_path_col));\n } while (cursor.moveToNext());\n }\n cursor.close();\n\n\n return result;\n\n }", "@Override\n\tpublic List<String> getAllImages() {\n\t\t\n\t\treturn jdbcTemplate.query(\"select * from news\", new BeanPropertyRowMapper<News>());\n\t}", "private void imageSearch(ArrayList<Html> src) {\n // loop through the Html objects\n for(Html page : src) {\n\n // Temp List for improved readability\n ArrayList<Image> images = page.getImages();\n\n // loop through the corresponding images\n for(Image i : images) {\n if(i.getName().equals(this.fileName)) {\n this.numPagesDisplayed++;\n this.pageList.add(page.getLocalPath());\n }\n }\n }\n }", "abstract public String getImageResourcesDir();", "public Image[] getImages() {\n return images;\n }", "@Override\n\tpublic List<ProductGalleries> getAllProductImages() {\n\t\treturn (List<ProductGalleries>) this.productGaleryRepository.findAll();\n\t}", "public static NodeList findAllImages(DocumentFragment df)\n throws Exception {\n // troubble with expath in some dfs\n // do it the hard way:\n try {\n String domstring = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?><\"+WXTROOT+\"></\"+WXTROOT+\">\";\n Document doc = makeDomFromString(domstring,true,null);\n doc.getDocumentElement().appendChild(doc.importNode(df, true));\n return doc.getElementsByTagName(\"img\");\n } catch (Exception ex) {\n throw new Exception(reporter.getBundleString(\"Could_not_extract_images\", ex.getMessage()));\n }\n }", "@Nullable\n public abstract Image images();", "private static List<File> listChildFiles(File dir) throws IOException {\n\t\t List<File> allFiles = new ArrayList<File>();\n\t\t \n\t\t File[] childFiles = dir.listFiles();\n\t\t for (File file : childFiles) {\n\t\t if (file.isFile()) {\n\t\t allFiles.add(file);\n\t\t } else {\n\t\t List<File> files = listChildFiles(file);\n\t\t allFiles.addAll(files);\n\t\t }\n\t\t }\n\t\t return allFiles;\n\t\t }", "public void getPictures(){\n\t\t\ttry{\n\t\t\t\timg = ImageIO.read(new File(\"background.jpg\"));\n\t\t\t\ttank = ImageIO.read(new File(\"Tank.png\"));\n\t\t\t\tbackground2 = ImageIO.read(new File(\"background2.png\"));\n\t\t\t\t\n\t\t\t\trtank = ImageIO.read(new File(\"RTank.png\"));\n\t\t\t\tboom = ImageIO.read(new File(\"Boom.png\"));\n\t\t\t\tboom2 = ImageIO.read(new File(\"Boom2.png\"));\n\t\t\t\tinstructions = ImageIO.read(new File(\"Instructions.png\"));\n\t\t\t\tshotman = ImageIO.read(new File(\"ShotMan.png\"));\n\t\t\t\tlshotman = ImageIO.read(newFile(\"LShotMan.png\"));\n\t\t\t\tboomshotman = ImageIO.read(new File(\"AfterShotMan\"));\n\t\t\t\tlboomshotman = ImageIO.read(new File(\"LAfterShotMan\"));\n\t\t\t\t\n\t\t\t}catch(IOException e){\n\t\t\t\tSystem.err.println(\"d\");\n\t\t\t}\n\t\t}", "private void extractCards() {\n String fileSeparator = System.getProperty(\"file.separator\");\n String path = System.getProperty(\"user.dir\");\n path = path + fileSeparator + \"Client\" + fileSeparator + \"src\" + fileSeparator + \"Images\" + fileSeparator;\n System.out.println(path);\n\n for (Picture p : cardlist) {\n BufferedImage image = null;\n try {\n image = javax.imageio.ImageIO.read(new ByteArrayInputStream(p.getStream()));\n File outputfile = new File(path + p.getName());\n ImageIO.write(image, \"png\", outputfile);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "public List<Path> getAllPaths();", "public String getImages() {\n\t\treturn this.images;\n\t}", "public static File[] getUserImages(String username) {\n File[] userFiles = ImageFactory.getFilePaths(username);\n\n String[] userImageURLs = new String[userFiles.length];\n for(int i = 0; i < userFiles.length; i++) {\n userImageURLs[i] = userFiles[i].toURI().toString();\n }\n\n return userFiles;\n }", "private List<String> getImages(SalonData salonData) {\n List<String> salonImages = new ArrayList<>();\n List<SalonImage> salonImage = salonData.getSalonImage();\n for (int i = 0; i < salonImage.size(); i++) {\n salonImages.add(salonImage.get(i).getImage());\n }\n return salonImages;\n }", "private void getImagesFromServer() {\n trObtainAllPetImages.setUser(user);\n trObtainAllPetImages.execute();\n Map<String, byte[]> petImages = trObtainAllPetImages.getResult();\n Set<String> names = petImages.keySet();\n\n for (String petName : names) {\n byte[] bytes = petImages.get(petName);\n Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, Objects.requireNonNull(bytes).length);\n int index = user.getPets().indexOf(new Pet(petName));\n user.getPets().get(index).setProfileImage(bitmap);\n ImageManager.writeImage(ImageManager.PET_PROFILE_IMAGES_PATH, user.getUsername() + '_' + petName, bytes);\n }\n }", "@Override\n\tpublic ArrayList<ImgRep> getAll(int imgNum) {\n\t\treturn dao.selectAll(imgNum);\n\t}", "static public void readRepository(){\n File cache_file = getCacheFile();\n if (cache_file.exists()) {\n try {\n // Read the cache acutally\n DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n DocumentBuilder builder = factory.newDocumentBuilder();\n Document document = builder.parse(cache_file);\n NodeList images_nodes = document.getElementsByTagName(\"image\");\n for (int i = 0; i < images_nodes.getLength(); i++) {\n Node item = images_nodes.item(i);\n String image_path = item.getTextContent();\n File image_file = new File(image_path);\n if (image_file.exists()){\n AppImage image = Resources.loadAppImage(image_path);\n images.add(image);\n }\n }\n }\n catch (Exception e) {\n throw new RuntimeException(e);\n }\n }\n }", "private List<String> getImages(String query, int id) {\n\t\tResultSet rs=null;\n\t\tList<String> imageList = new ArrayList<String>();\n\t\ttry {\n\t\t\t\n\t\t\t//pstmt = con.prepareStatement(query);\n\t\t\tPreparedStatement pstmt = dataSource.getConnection().prepareStatement(query);\n\t\t\tpstmt.setInt(1, id);\n\t\t\trs = pstmt.executeQuery();\n\t\t\twhile (rs.next()) \n\t\t\t{\n\t\t\t\timageList.add(rs.getString(1));\n\t\t\t}\n\t\t}catch (SQLException e) {\n\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t}\n\t\t\treturn imageList;\n\t}", "GetImagesResult getImages(GetImagesRequest getImagesRequest);", "public static List getAllImgs() {\n List polovniautomobili = new ArrayList<>();\n try {\n CONNECTION = DriverManager.getConnection(URL, USERNAME, PASSWORD);\n String query = \"SELECT imgUrl FROM polovni\";\n try (PreparedStatement ps = CONNECTION.prepareStatement(query)) {\n ResultSet result = ps.executeQuery();\n while (result.next()) {\n String imgUrl = result.getString(\"imgUrl\");\n polovniautomobili.add(imgUrl);\n }\n\n ps.close();\n CONNECTION.close();\n }\n CONNECTION.close();\n } catch (SQLException ex) {\n Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);\n }\n return polovniautomobili;\n }", "private void loadImages(){\n try{\n System.out.println(System.getProperty(\"user.dir\"));\n\n t1img = read(new File(\"resources/tank1.png\"));\n t2img = read(new File(\"resources/tank1.png\"));\n backgroundImg = read(new File(\"resources/background.jpg\"));\n wall1 = read(new File(\"resources/Wall1.gif\"));\n wall2 = read(new File(\"resources/Wall2.gif\"));\n heart = resize(read(new File(\"resources/Hearts/basic/heart.png\")), 35,35);\n heart2 = resize(read( new File(\"resources/Hearts/basic/heart.png\")), 25,25);\n bullet1 = read(new File(\"resources/bullet1.png\"));\n bullet2 = read(new File(\"resources/bullet2.png\"));\n\n }\n catch(IOException e){\n System.out.println(e.getMessage());\n }\n }", "List<File> list(String directory) throws FindException;", "public static File[] searchForImages(String[] searchTags) {\n File[] searchFiles = ImageFactory.searchForImages(searchTags);\n\n String[] searchImageURLs = new String[searchFiles.length];\n for(int i = 0; i < searchFiles.length; i++) {\n searchImageURLs[i] = searchFiles[i].toURI().toString();\n }\n\n return searchFiles;\n }", "public ImageIcon[] getImages() {\n\t\treturn imageList;\n\t}", "public ArrayList<ImageContainer> getAllImageContainers(String username) throws ClassNotFoundException, IOException {\r\n\t\tArrayList<ImageContainer> ics = new ArrayList<ImageContainer>();\r\n\t\tCopyOnWriteArrayList<String> imageNames = getListOfImages(username);\r\n\t\tPoint p;\r\n\t\tString destinationPeerIp;\r\n\t\tfor(String imageName : imageNames) {\r\n\t\t\ttry {\r\n\t\t\t\tp = StaticFunctions.hashToPoint(username, imageName);\r\n\t\t\t\tif(lookup(p)) {\r\n\t\t\t\t\tics.add(loadImageContainer(username, imageName));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdestinationPeerIp = routing(p).getIp_adresse();\r\n\t\t\t\t\t//Load image from destinationPeer\r\n\t\t\t\t\tImage img =new PeerClient().getImage(destinationPeerIp, username , imageName);\r\n\t\t\t\t\tif(img != null) {\r\n\t\t\t\t\t\tics.add(RestUtils.convertImgToIc(img));\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tSystem.out.println(imageName + \" nicht gefunden\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ics;\r\n\t}", "public void testImagesDirectoryAccessible() {\n File file = new File(rootBlog.getRoot(), \"images\");\n assertEquals(file, new File(rootBlog.getImagesDirectory()));\n assertTrue(file.exists());\n }", "List<Path> getFiles();", "private static List<File> rootFiles(final File metaDir) throws IOException {\n File containerFile = new File(metaDir, \"container.xml\");\n if(!containerFile.exists()) {\n throw new IOException(\"Missing 'META-INF/container.xml'\");\n }\n\n List<File> rootFiles = Lists.newArrayListWithExpectedSize(2);\n try(FileInputStream fis = new FileInputStream(containerFile)) {\n Document doc = Jsoup.parse(fis, Charsets.UTF_8.name(), \"\", Parser.xmlParser());\n Elements elements = doc.select(\"rootfile[full-path]\");\n for(Element element : elements) {\n String path = element.attr(\"full-path\").trim();\n if(path.isEmpty()) {\n continue;\n } else if(path.startsWith(\"/\")) {\n path = path.substring(1);\n }\n File rootFile = new File(metaDir.getParent(), path);\n if(!rootFile.exists()) {\n throw new IOException(String.format(\"Missing file, '%s'\", rootFile.getAbsolutePath()));\n }\n rootFiles.add(rootFile);\n }\n }\n\n return rootFiles;\n }", "@Override\n\tpublic void readImages() {\n\t\t\n\t}", "public ArrayList<ImageLoader<E>> getImageLoaders();", "private void addImgList() {\n\t\tdogImg.add(\"./data/img/labrador.jpg\");\t\t\t\t\n\t\tdogImg.add(\"./data/img/germanshepherd.jpg\");\t\n\t\tdogImg.add(\"./data/img/bulldog.jpg\");\t\t\t\t\t\t\t\t\n\t\tdogImg.add(\"./data/img/rottweiler.jpg\");\n\t\tdogImg.add(\"./data/img/husky.jpg\");\n\n\t}", "public String[] getImagePaths() {\n return new String[]{\"/RpgIcons/fire.png\",\n \"/RpgIcons/water.png\",\n \"/RpgIcons/wind.png\",\n \"/RpgIcons/earth.png\",\n \"/RpgIcons/light.png\",\n \"/RpgIcons/dark.png\",\n \"/RpgIcons/lightning.png\"};\n }", "public ArrayList<ImageView> getImages() {\n\t return images;\n\t}", "static BufferedImage getImage(String directory) {\n\t\tClassLoader loader = DrawingUtility.class.getClassLoader();\n\t\tBufferedImage image;\n\t\ttry {\n\n\t\t\timage = ImageIO.read(loader.getResource(directory));\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Fail load image from \" + directory);\n\t\t\timage = null;\n\t\t}\n\t\treturn image;\n\n\t}", "@ApiOperation(value = \"Return all images and tags within supplied registry\", response = DockerImageDataListResponse.class, produces = \"application/json\")\n\t@ApiResponses(value = { @ApiResponse(code = 200, message = \"Successfully retrieved all objects\"),\n\t\t\t@ApiResponse(code = 400, message = \"Images not found in supplied registry\") })\n\t@RequestMapping(path = \"/{registry}/all\", method = RequestMethod.GET)\n\tpublic @ResponseBody DockerImageDataListResponse getAllImagesFromRegistry(@PathVariable String registry) {\n\t\tRegistryConnection localConnection;\n\t\tList<DockerImageData> images = new LinkedList<DockerImageData>();\n\t\ttry {\n\t\t\tlocalConnection = new RegistryConnection(configs.getURLFromName(registry));\n\n\t\t\tRegistryCatalog repos = localConnection.getRegistryCatalog();\n\t\t\t// Iterate over repos to build out DockerImageData objects\n\t\t\tfor (String repo : repos.getRepositories()) {\n\t\t\t\t// Get all tags from specific repo\n\t\t\t\tImageTags tags = localConnection.getTagsByRepoName(repo);\n\n\t\t\t\t// For each tag, get the digest and create the object based on looping values\n\t\t\t\tfor (String tag : tags.getTags()) {\n\t\t\t\t\tDockerImageData image = new DockerImageData();\n\t\t\t\t\timage.setRegistryName(registry);\n\t\t\t\t\timage.setImageName(repo);\n\t\t\t\t\timage.setTag(tag);\n\t\t\t\t\timage.setDigest(new ImageDigest(localConnection.getImageID(repo, tag)));\n\t\t\t\t\timages.add(image);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new DockerImageDataListResponse(HttpServletResponse.SC_OK,\n\t\t\t\t\t\"Successfully pulled all image:tag pairs from \" + registry, images);\n\t\t} catch (RegistryNotFoundException e) {\n\t\t\treturn null;\n\t\t}\n\t}", "static Stream<File> allFilesIn(File folder) \r\n\t{\r\n\t\tFile[] children = folder.listFiles();\r\n\t\tStream<File> descendants = Arrays.stream(children).filter(File::isDirectory).flatMap(Program::allFilesIn);\r\n\t\treturn Stream.concat(descendants, Arrays.stream(children).filter(File::isFile));\r\n\t}", "java.util.List<com.yahoo.xpathproto.TransformTestProtos.ContentImage> \n getImagesByHandlerList();", "public static void loadImages()\n \t{\n \t\tSystem.out.print(\"Loading images... \");\n \t\t\n \t\tallImages = new TreeMap<ImageEnum, ImageIcon>();\n \t\t\n \t\ttry {\n \t\taddImage(ImageEnum.RAISIN, \"images/parts/raisin.png\");\n \t\taddImage(ImageEnum.NUT, \"images/parts/nut.png\");\n \t\taddImage(ImageEnum.PUFF_CHOCOLATE, \"images/parts/puff_chocolate.png\");\n \t\taddImage(ImageEnum.PUFF_CORN, \"images/parts/puff_corn.png\");\n \t\taddImage(ImageEnum.BANANA, \"images/parts/banana.png\");\n \t\taddImage(ImageEnum.CHEERIO, \"images/parts/cheerio.png\");\n \t\taddImage(ImageEnum.CINNATOAST, \"images/parts/cinnatoast.png\");\n\t\taddImage(ImageEnum.CORNFLAKE, \"images/parts/flake_corn.png\");\n \t\taddImage(ImageEnum.FLAKE_BRAN, \"images/parts/flake_bran.png\");\n \t\taddImage(ImageEnum.GOLDGRAHAM, \"images/parts/goldgraham.png\");\n \t\taddImage(ImageEnum.STRAWBERRY, \"images/parts/strawberry.png\");\n \t\t\n \t\taddImage(ImageEnum.PART_ROBOT_HAND, \"images/robots/part_robot_hand.png\");\n \t\taddImage(ImageEnum.KIT_ROBOT_HAND, \"images/robots/kit_robot_hand.png\");\n \t\taddImage(ImageEnum.ROBOT_ARM_1, \"images/robots/robot_arm_1.png\");\n \t\taddImage(ImageEnum.ROBOT_BASE, \"images/robots/robot_base.png\");\n \t\taddImage(ImageEnum.ROBOT_RAIL, \"images/robots/robot_rail.png\");\n \t\t\n \t\taddImage(ImageEnum.KIT, \"images/kit/empty_kit.png\");\n \t\taddImage(ImageEnum.KIT_TABLE, \"images/kit/kit_table.png\");\n \t\taddImage(ImageEnum.KITPORT, \"images/kit/kitport.png\");\n \t\taddImage(ImageEnum.KITPORT_HOOD_IN, \"images/kit/kitport_hood_in.png\");\n \t\taddImage(ImageEnum.KITPORT_HOOD_OUT, \"images/kit/kitport_hood_out.png\");\n \t\taddImage(ImageEnum.PALLET, \"images/kit/pallet.png\");\n \t\t\n \t\taddImage(ImageEnum.FEEDER, \"images/lane/feeder.png\");\n \t\taddImage(ImageEnum.LANE, \"images/lane/lane.png\");\n \t\taddImage(ImageEnum.NEST, \"images/lane/nest.png\");\n \t\taddImage(ImageEnum.DIVERTER, \"images/lane/diverter.png\");\n \t\taddImage(ImageEnum.DIVERTER_ARM, \"images/lane/diverter_arm.png\");\n \t\taddImage(ImageEnum.PARTS_BOX, \"images/lane/partsbox.png\");\n \t\t\n \t\taddImage(ImageEnum.CAMERA_FLASH, \"images/misc/camera_flash.png\");\n \t\taddImage(ImageEnum.SHADOW1, \"images/misc/shadow1.png\");\n \t\taddImage(ImageEnum.SHADOW2, \"images/misc/shadow2.png\");\n \t\t\n \t\taddImage(ImageEnum.GANTRY_BASE, \"images/gantry/gantry_base.png\");\n \t\taddImage(ImageEnum.GANTRY_CRANE, \"images/gantry/gantry_crane.png\");\n \t\taddImage(ImageEnum.GANTRY_TRUSS_H, \"images/gantry/gantry_truss_h.png\");\n \t\taddImage(ImageEnum.GANTRY_TRUSS_V, \"images/gantry/gantry_truss_v.png\");\n \t\taddImage(ImageEnum.GANTRY_WHEEL, \"images/gantry/gantry_wheel.png\");\n \t\t} catch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t\tSystem.exit(1);\n \t\t}\n \t\tSystem.out.println(\"Done\");\n \t}", "private LinkedList<Image> loadPhotos(int n){\n\t\tLinkedList<Image> listOfPhotos = new LinkedList<>();\n\t\t\n\t\t\n\t\ttry {\n\n\t\t\tFileInputStream in = new FileInputStream(\"images\");\n\t\t\t//Skipping magic number and array size\n\t\t\tfor (int i = 0; i < 16; i++) {\n\t\t\t\tin.read();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor (int k = 0; k < n; k++) {\n\t\t\t\tImage img = new Image(HEIGHT, WIDTH);\n\t\t\t\t\n\t\t\t\tbyte[][] imageData = new byte[WIDTH][HEIGHT];\n\t\t\t\tfor (int i = k*WIDTH; i < k*WIDTH + WIDTH; i++) {\n\t\t\t\t\tfor (int j = k*HEIGHT; j < k*HEIGHT + HEIGHT; j++) {\n\t\t\t\t\t\timageData[j%28][i%28] = (byte) in.read();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\timg.setData(imageData);\n\t\t\t\tlistOfPhotos.add(img);\n\t\t\t}\n\t\t\tin.close();\n\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\t\n\t\t\n\t\treturn listOfPhotos;\n\t\t\n\t}", "AntiIterator<FsPath> listFilesAndDirectories(FsPath dir);", "public Collection<GPImageLinkComponent> getImages(final SessionContext ctx)\n\t{\n\t\tfinal List<GPImageLinkComponent> items = getLinkedItems( \n\t\t\tctx,\n\t\t\ttrue,\n\t\t\tGpcommonaddonConstants.Relations.BRANDBAR2GPIMAGELINKRELATION,\n\t\t\t\"GPImageLinkComponent\",\n\t\t\tnull,\n\t\t\tfalse,\n\t\t\tfalse\n\t\t);\n\t\treturn items;\n\t}", "public void loadTileImages() {\n // keep looking for tile A,B,C, etc. this makes it\n // easy to drop new tiles in the images/ directory\n tiles = new ArrayList();\n char ch = 'A';\n while (true) {\n String name = \"tile_\" + ch + \".png\";\n File file = new File(\"images/\" + name);\n if (!file.exists()) {\n break;\n }\n tiles.add(loadImage(name));\n ch++;\n }\n }", "@Override\r\n\tpublic List<EventRollingImage> getAllEventsRollingImages() {\r\n\t\treturn (List<EventRollingImage>) sessionFactory.getCurrentSession().createCriteria(EventRollingImage.class).list();\r\n\t}", "public ArrayList<BufferedImage> getImages(File gif) throws IOException {\r\n\t\tArrayList<BufferedImage> imgs = new ArrayList<BufferedImage>();\r\n\t\tImageReader rdr = new GIFImageReader(new GIFImageReaderSpi());\r\n\t\trdr.setInput(ImageIO.createImageInputStream(gif));\r\n\t\tfor (int i=0;i < rdr.getNumImages(true); i++) {\r\n\t\t\timgs.add(rdr.read(i));\r\n\t\t}\r\n\t\treturn imgs;\r\n\t}", "public static List<String> getAllImageLinks(final String page)\n {\n return getAllMatches(page, IMG_PATTERN, 1);\n }", "public static void loadImages() {\n PonySprite.loadImages(imgKey, \"graphics/ponies/GrannySmith.png\");\n }", "public void populateImages() {\n\t\t// Check if the recipe has any images saved on the sd card and get\n\t\t// the bitmap for the imagebutton\n\n\t\tArrayList<Image> images = ImageController.getAllRecipeImages(\n\t\t\t\tcurrentRecipe.getRecipeId(), currentRecipe.location);\n\n\t\tLog.w(\"*****\", \"outside\");\n\t\tLog.w(\"*****\", String.valueOf(currentRecipe.getRecipeId()));\n\t\tLog.w(\"*****\", String.valueOf(currentRecipe.location));\n\t\tImageButton pictureButton = (ImageButton) findViewById(R.id.ibRecipe);\n\n\t\t// Set the image of the imagebutton to the first image in the folder\n\t\tif (images.size() > 0) {\n\t\t\tpictureButton.setImageBitmap(images.get(0).getBitmap());\n\t\t}\n\n\t}", "public void listFiles(String path) {\r\n String files;\r\n File folder = new File(path);\r\n File[] listOfFiles = folder.listFiles();\r\n\r\n for (int i = 0; i < listOfFiles.length; i++) {\r\n\r\n if (listOfFiles[i].isFile()) {\r\n files = listOfFiles[i].getName();\r\n if (files.endsWith(\".png\") || files.endsWith(\".PNG\")\r\n || files.endsWith(\".gif\") || files.endsWith(\".GIF\")) {\r\n //System.out.println(files);\r\n pathList.add(path+\"\\\\\");\r\n fileList.add(files);\r\n }\r\n }\r\n \r\n else {\r\n listFiles(path+\"\\\\\"+listOfFiles[i].getName());\r\n }\r\n }\r\n }", "@Generated(hash = 1057346450)\n public List<Image> getImageList() {\n if (imageList == null) {\n final DaoSession daoSession = this.daoSession;\n if (daoSession == null) {\n throw new DaoException(\"Entity is detached from DAO context\");\n }\n ImageDao targetDao = daoSession.getImageDao();\n List<Image> imageListNew = targetDao._queryEvent_ImageList(id);\n synchronized (this) {\n if (imageList == null) {\n imageList = imageListNew;\n }\n }\n }\n return imageList;\n }", "private static CopyOnWriteArrayList<String> getListOfImages(String username){\r\n\t\treturn getUser(username).getImageList();\r\n\t}", "public ArrayList<DeviceMediaItem> getAllImagesByFolder(String path, Context contx) {\n ArrayList<DeviceMediaItem> media = new ArrayList<>();\n Uri allImagesuri = android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI;\n String[] projection = {MediaStore.Images.ImageColumns.DATA, MediaStore.Images.Media.DISPLAY_NAME,\n MediaStore.Images.Media.SIZE, MediaStore.Images.Media.DATE_ADDED};\n Cursor cursor = contx.getContentResolver().query(allImagesuri, projection, MediaStore.Images.Media.DATA + \" like ? \", new String[]{\"%\" + path + \"%\"}, null);\n try {\n cursor.moveToFirst();\n do {\n DeviceMediaItem pic = new DeviceMediaItem();\n\n pic.setName(cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DISPLAY_NAME)));\n pic.setPath(cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA)));\n String date = getDate(cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATE_ADDED)));\n pic.setDate(date);\n\n media.add(pic);\n } while (cursor.moveToNext());\n cursor.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n Uri allVideosuri = android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI;\n String[] vidProjection = {MediaStore.Video.VideoColumns.DATA, MediaStore.Video.Media.DISPLAY_NAME,\n MediaStore.Video.Media.SIZE, MediaStore.Video.Media.DATE_ADDED};\n Cursor vidCursor = contx.getContentResolver().query(allVideosuri, vidProjection, MediaStore.Images.Media.DATA + \" like ? \", new String[]{\"%\" + path + \"%\"}, null);\n try {\n vidCursor.moveToFirst();\n do {\n DeviceMediaItem pic = new DeviceMediaItem();\n\n pic.setName(vidCursor.getString(vidCursor.getColumnIndexOrThrow(MediaStore.Video.Media.DISPLAY_NAME)));\n pic.setPath(vidCursor.getString(vidCursor.getColumnIndexOrThrow(MediaStore.Video.Media.DATA)));\n String date = getDate(vidCursor.getLong(vidCursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATE_ADDED)));\n pic.setDate(date);\n\n media.add(pic);\n } while (vidCursor.moveToNext());\n vidCursor.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return media;\n }", "public byte[] getImages() {\n return images;\n }", "@Override\n\tpublic List<Image> findImagesByUserId(int userid) {\n\t\treturn new ImageDaoImpl().findImagesByUserId(userid);\n\t}", "@SuppressLint(\"Recycle\")\n private synchronized ArrayList<String> retriveSavedImages(Context activity) {\n Uri uri;\n Cursor cursor;\n int column_index_data, column_index_folder_name, column_index_file_name;\n ArrayList<String> listOfAllImages = new ArrayList<>();\n uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;\n String[] projection = {MediaStore.MediaColumns.DATA,\n MediaStore.Images.Media.BUCKET_DISPLAY_NAME,\n MediaStore.MediaColumns.DISPLAY_NAME};\n\n cursor = activity.getApplicationContext().getContentResolver().query(uri, projection, null,\n null, MediaStore.Images.Media.DATE_ADDED);//\n\n assert cursor != null;\n column_index_data = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DATA);\n column_index_folder_name = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.BUCKET_DISPLAY_NAME);\n column_index_file_name = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DISPLAY_NAME);\n\n while (cursor.moveToNext()) {\n\n /*Images from CustomCalender folder only*/\n if (cursor.getString(column_index_folder_name).contains(\"CustomCalender\")) {\n listOfAllImages.add(cursor.getString(column_index_data));\n// Log.v(\"Images: \", cursor.getString(column_index_file_name));\n }\n }\n\n /*Testing Glide cache by making duplicates total 768 images*/\n /*listOfAllImages.addAll(listOfAllImages); //24\n listOfAllImages.addAll(listOfAllImages); //48\n listOfAllImages.addAll(listOfAllImages); //96\n listOfAllImages.addAll(listOfAllImages); //192\n listOfAllImages.addAll(listOfAllImages); //384\n listOfAllImages.addAll(listOfAllImages); //768*/\n\n return listOfAllImages;\n }", "public java.util.List<com.yahoo.xpathproto.TransformTestProtos.ContentImage> getImagesByHandlerList() {\n if (imagesByHandlerBuilder_ == null) {\n return java.util.Collections.unmodifiableList(imagesByHandler_);\n } else {\n return imagesByHandlerBuilder_.getMessageList();\n }\n }", "private void loadImages(BufferedImage[] images, String direction) {\n for (int i = 0; i < images.length; i++) {\n String fileName = direction + (i + 1);\n images[i] = GameManager.getResources().getMonsterImages().get(\n fileName);\n }\n\n }", "public String getAllFilles(int n) throws IOException {\n\t\tString x = \"\";\n\t\tString path = \"C:/JEE/workspace/Server/Upload\";\n\t\tString path2 = \"C:/JEE/workspace/Server/Upload/\";\n\t\tFile folder = new File(path);\n\t\tFile[] listOfFiles = folder.listFiles();\n\t\tArrayList listOfPathFiles = new ArrayList();\n\n\t\t// for (int i = 0; i < listOfFiles.length; i++) {\n\t\tif (listOfFiles[n].isFile()) {\n\n\t\t\tInputStream inputStream2 = new FileInputStream(path2 + listOfFiles[n].getName());\n\t\t\tbyte[] buffer = new byte[4096];\n\t\t\tint bytesRead = 0;\n\t\t\tBASE64Encoder encoder = new BASE64Encoder();\n\t\t\tByteArrayOutputStream buffer2 = new ByteArrayOutputStream();\n\t\t\twhile (true) {\n\t\t\t\tbytesRead = inputStream2.read(buffer); \n\t\t\t\tif (bytesRead > 0) {\n\t\t\t\t\tbuffer2.write(buffer, 0, bytesRead);\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuffer2.flush(); \n\t\t\tString codec;\n\t\t\tcodec = encoder.encode(buffer2.toByteArray());\n\t\t\tif (n >= 0) {\n\t\t\t\t// listOfPathFiles.add(\"data:image/png;base64,\"+codec);\n\t\t\t\tx = codec;\n\t\t\t}\n\t\t}\n\t\tif (listOfFiles[n].isDirectory()) {\n\t\t\tSystem.out.println(\"Directory \" + listOfFiles[n].getName());\n\t\t}\n\t\t// }\n\t\treturn x;\n\t\t// return listOfPathFiles;\n\t}", "public List<? extends PictureData> getAllPictures() {\n\t\treturn null;\n\t}", "private static List<Path> listChunkableFiles(FileSystem fs) throws IOException {\r\n\r\n List<Path> resultMediaPathList = new ArrayList<Path>();\r\n\r\n Path mediaFolderInsideZipPath = getMediaDirectoryPath(fs);\r\n // list the contents of the result /media/ folder\r\n try (DirectoryStream<Path> mediaDirectoryStream = Files.newDirectoryStream(mediaFolderInsideZipPath)) {\r\n // for every file in the result /media/ folder\r\n // note: NOT expecting any subfolders\r\n for (Path mediaFilePath : mediaDirectoryStream) {\r\n if (BMPUtils.CHUNKABLE_IMAGE_FILE_EXTENSIONS.contains(FileUtils.getFileExtension(mediaFilePath.toString()))) {\r\n resultMediaPathList.add(mediaFilePath);\r\n }\r\n }\r\n }\r\n\r\n return resultMediaPathList;\r\n }", "@Override\n\tpublic Image[] getStaticImages() {\n\t\treturn null;\n\t}", "@Override\n public List<GEMFile> getLocalFiles(String directory) {\n File dir = new File(directory);\n List<GEMFile> resultList = Lists.newArrayList();\n File[] fList = dir.listFiles();\n if (fList != null) {\n for (File file : fList) {\n if (file.isFile()) {\n resultList.add(new GEMFile(file.getName(), file.getParent()));\n } else {\n resultList.addAll(getLocalFiles(file.getAbsolutePath()));\n }\n }\n gemFileState.put(STATE_SYNC_DIRECTORY, directory);\n }\n return resultList;\n }" ]
[ "0.76984495", "0.7675707", "0.732701", "0.7298585", "0.7141194", "0.70884603", "0.6999617", "0.6911958", "0.6821668", "0.6800525", "0.67931277", "0.6767247", "0.670807", "0.6703817", "0.6665634", "0.66545665", "0.6606171", "0.65891814", "0.64672476", "0.64127165", "0.6345037", "0.63256526", "0.632101", "0.61165434", "0.6109774", "0.6082183", "0.6073212", "0.6065376", "0.6060037", "0.6055578", "0.6047157", "0.6040956", "0.60392934", "0.5993399", "0.59271795", "0.58749926", "0.5864576", "0.586266", "0.58600086", "0.584928", "0.58162177", "0.5787702", "0.57871705", "0.5774614", "0.57593906", "0.57484686", "0.5734523", "0.57344395", "0.5725253", "0.57225966", "0.566899", "0.56665546", "0.5662613", "0.5649346", "0.5624825", "0.5619561", "0.5614022", "0.5608604", "0.5603305", "0.55783004", "0.5574138", "0.5573732", "0.55720407", "0.55718637", "0.55591846", "0.5547871", "0.5545558", "0.55444455", "0.5543075", "0.5532627", "0.55233526", "0.5509288", "0.55042285", "0.55039716", "0.5503732", "0.5497076", "0.5487746", "0.5484337", "0.5473969", "0.5447969", "0.54477173", "0.5441864", "0.54396933", "0.5433759", "0.54337454", "0.54271734", "0.54224384", "0.5411931", "0.54112905", "0.5408534", "0.54075193", "0.5406762", "0.53991127", "0.53901184", "0.5388415", "0.53852564", "0.53843534", "0.53833747", "0.5382602", "0.5381101" ]
0.83887464
0
Returns all images in the directory not considering subdirectories
public ArrayList<ImageFile> getImagesInDirectory() throws IOException { return imagesInDirectory; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<ImageFile> getAllImagesUnderDirectory() throws IOException {\n return allImagesUnderDirectory;\n }", "public static List<InputStream> getAllImages(){\n\t\treturn IOHandler.getResourcesIn(IMAGES_DIR);\n\t}", "private static ArrayList<String> getImagesInFileSystem() {\n\t\t// get file list in database\n\t\tArrayList<String> fileNameList = new ArrayList<String>();\n\t\t\n\t\tFile folder = new File(IMAGE_DIRECTORY);\n\t File[] listOfFiles = folder.listFiles();\n\t \n\t for (File currFile : listOfFiles) {\n\t if (currFile.isFile() && !currFile.getName().startsWith(\".\")) {\n\t \t fileNameList.add(currFile.getName());\n\t }\n\t }\n\t \n\t return fileNameList;\n\t}", "private void fillImagesInDirectory() throws IOException {\n // get the list of all files (including directories) in the directory of interest\n File[] fileArray = directory.listFiles();\n assert fileArray != null;\n for (File file : fileArray) {\n // the file is an image, then add it\n if (isImage(file)) {\n ImageFile imageFile = new ImageFile(file.getAbsolutePath());\n // if the image is already saved, reuse it\n if (centralController.getImageFileController().hasImageFile(imageFile)) {\n imagesInDirectory.add(centralController.getImageFileController().getImageFile(imageFile));\n } else {\n imagesInDirectory.add(imageFile);\n }\n }\n }\n }", "private BufferedImage[] loadImages(String directory, BufferedImage[] img) throws Exception {\n\t\tFile dir = new File(directory);\n\t\tFile[] files = dir.listFiles();\n\t\tArrays.sort(files, (s, t) -> s.getName().compareTo(t.getName()));\n\t\t\n\t\timg = new BufferedImage[files.length];\n\t\tfor (int i = 0; i < files.length; i++) {\n\t\t\timg[i] = ImageIO.read(files[i]);\n\t\t}\n\t\treturn img;\n\t}", "private void fillAllImagesUnderDirectory(File directory) throws IOException {\n // get the list of all files (including directories) in the directory of interest\n File[] fileArray = directory.listFiles();\n assert fileArray != null;\n\n for (File file : fileArray) {\n // if the file is an image, then add it\n if (isImage(file)) {\n ImageFile imageFile = new ImageFile(file.getAbsolutePath());\n // if the image is already saved, reuse it\n if (centralController.getImageFileController().hasImageFile(imageFile)) {\n allImagesUnderDirectory\n .add(centralController.getImageFileController().getImageFile(imageFile));\n } else if (imagesInDirectory.contains(imageFile)) {\n allImagesUnderDirectory.add(imagesInDirectory.get(imagesInDirectory.indexOf(imageFile)));\n } else {\n allImagesUnderDirectory.add(imageFile);\n }\n } else if (file.isDirectory()) {\n fillAllImagesUnderDirectory(file);\n }\n }\n }", "public List<Image> getAllImage() {\n\t\treturn null;\n\t}", "private static void loadImagesInDirectory(String dir){\n\t\tFile file = new File(Files.localize(\"images\\\\\"+dir));\n\t\tassert file.isDirectory();\n\t\n\t\tFile[] files = file.listFiles();\n\t\tfor(File f : files){\n\t\t\tif(isImageFile(f)){\n\t\t\t\tString name = dir+\"\\\\\"+f.getName();\n\t\t\t\tint i = name.lastIndexOf('.');\n\t\t\t\tassert i != -1;\n\t\t\t\tname = name.substring(0, i).replaceAll(\"\\\\\\\\\", \"/\");\n\t\t\t\t//Image image = load(f,true);\n\t\t\t\tImageIcon image;\n\t\t\t\tFile f2 = new File(f.getAbsolutePath()+\".anim\");\n\t\t\t\tif(f2.exists()){\n\t\t\t\t\timage = evaluateAnimFile(dir,f2,load(f,true));\n\t\t\t\t}else{\n\t\t\t\t\timage = new ImageIcon(f.getAbsolutePath());\n\t\t\t\t}\n\t\t\t\tdebug(\"Loaded image \"+name+\" as \"+f.getAbsolutePath());\n\t\t\t\timages.put(name, image);\n\t\t\t}else if(f.isDirectory()){\n\t\t\t\tloadImagesInDirectory(dir+\"\\\\\"+f.getName());\n\t\t\t}\n\t\t}\n\t}", "public List<Image> getAllImages() {\n\t\treturn list;\n\t}", "@Override\n\tpublic List<Image> findAll() {\n\t\treturn imageRepository.findAll();\n\t}", "@Override\n\tpublic List<Image> findAllImage() {\n\t\treturn new ImageDaoImpl().findAllImage();\n\t}", "private ArrayList<String> getImagesPathList() {\n String MEDIA_IMAGES_PATH = \"CuraContents/images\";\n File fileImages = new File(Environment.getExternalStorageDirectory(), MEDIA_IMAGES_PATH);\n if (fileImages.isDirectory()) {\n File[] listImagesFile = fileImages.listFiles();\n ArrayList<String> imageFilesPathList = new ArrayList<>();\n for (File file1 : listImagesFile) {\n imageFilesPathList.add(file1.getAbsolutePath());\n }\n return imageFilesPathList;\n }\n return null;\n }", "public static List<Path> getImages(final FileSystem fs) {\n return getEntries(fs).stream().filter(ZipReaderUtil::isImage).collect(Collectors.toList());\n }", "public ListImages(File directoryOfInterest, CentralController centralController)\n throws IOException {\n\n this.centralController = centralController;\n\n directory = directoryOfInterest;\n imagesInDirectory = new ArrayList<>();\n allImagesUnderDirectory = new ArrayList<>();\n\n // updates the imagesInDirectory list\n fillImagesInDirectory();\n\n // updates the allImagesUnderDirectory list\n fillAllImagesUnderDirectory(directory);\n }", "@Override\n\tpublic List<URL> getPhotos() {\n\t\timages.clear(); //vide la liste des images\n\t\t\n\t\t\n\t\tList<URL> allImagesURL = new ArrayList<URL>();\n\t\t\n\t\t/* On initialise la liste de toutes les images */\n\t\tList<String> filelocations = null;\n\t\t\n\t\t/*Nous allons retrouver les fichiers images présent dans le répertoire et tous ses sous-répertoires*/\n\t\tPath start = Paths.get(path); //détermine le point de départ \n\t\ttry (Stream<Path> stream = Files.walk(start, Integer.MAX_VALUE)) {\n\t\t filelocations = stream\n\t\t .map(String::valueOf) //transforme les Path en string\n\t\t .filter(filename -> filename.contains(\".jpg\") || filename.contains(\".png\")) //ne prend que les images jpg et png\n\t\t .collect(Collectors.toList());\n\t\t \n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\t/* Pour chaque fichier retrouvé, on essaie de retrouver son chemin absolu pour le stocker dans le allImagesURL */\n\t\tfor (String filelocation : filelocations) {\n\t\t\tString relativeLocation = filelocation.replace(path+\"/\", \"\"); // Pour ne pas partir de src mais de la classe courante\n\t\t\trelativeLocation = relativeLocation.replace(windowspath+\"\\\\\", \"\");\n\t\t\tallImagesURL.add(this.getClass().getResource(relativeLocation)); //on ajoute le chemin absolu dans la liste\n\t\t}\n\t\t\n\t\t\n\t\treturn allImagesURL; //on retourne la liste\n\t}", "public List<Image> getAllImage()\n {\n GetAllImageQuery getAllImageQuery = new GetAllImageQuery();\n return super.queryResult(getAllImageQuery);\n }", "public void getImagesFromFolder() {\n File file = new File(Environment.getExternalStorageDirectory().toString() + \"/saveclick\");\n if (file.isDirectory()) {\n fileList = file.listFiles();\n for (int i = 0; i < fileList.length; i++) {\n files.add(fileList[i].getAbsolutePath());\n Log.i(\"listVideos\", \"file\" + fileList[0]);\n }\n }\n }", "public ArrayList<Image> getImages() {\n\t\treturn getPageObjects(Image.class);\n\t}", "private List<String> returnFiles(int selection) {\n\t\tString path = System.getProperty(\"user.dir\");\n\t\tList<String> allImages = new ArrayList<String>();\n\t\tpath += this.setFolderPath(selection);\n\t\tFile[] files = new File(path).listFiles();\n\n\t\tfor (File file : files) {\n\t\t\tif (file.isFile() && isCorrectFile(file)) {\n\t\t\t\tallImages.add(file.getAbsolutePath());\n\t\t\t}\n\t\t}\n\t\treturn allImages;\n\t}", "public void populateCachedImages(File dir)\n {\n if (dir.exists())\n {\n File[] files = dir.listFiles();\n for (int i = 0; i < files.length; i++)\n {\n File file = files[i];\n if (!file.isDirectory())\n {\n //Record all filenames from the cache so we know which photos to retrieve from database\n cachedFileNames.add(file.getName());\n imageList.add(file);\n }\n }\n }\n }", "private static void displayImagesDir(){\n System.out.println(IMAGES_DIR);\n }", "private ArrayList<String> getAllShownImagesPath(Activity activity) {\n Uri uri;\n Cursor cursor;\n int column_index_data, column_index_folder_name;\n ArrayList<String> listOfAllImages = new ArrayList<String>();\n String absolutePathOfImage = null;\n uri = android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI;\n\n String[] projection = { MediaStore.MediaColumns.DATA,\n MediaStore.Images.Media.BUCKET_DISPLAY_NAME };\n\n cursor = activity.getContentResolver().query(uri, projection, null,\n null, null);\n\n column_index_data = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DATA);\n column_index_folder_name = cursor\n .getColumnIndexOrThrow(MediaStore.Images.Media.BUCKET_DISPLAY_NAME);\n while (cursor.moveToNext()) {\n absolutePathOfImage = cursor.getString(column_index_data);\n\n listOfAllImages.add(absolutePathOfImage);\n }\n return listOfAllImages;\n }", "public ArrayList<ImageFile> getImageFiles() {\n return new ArrayList<>(imageFiles);\n }", "@GetMapping(path = \"/images\", produces = \"application/json; charset=UTF-8\")\n public @ResponseBody ArrayNode getImageList() {\n final ArrayNode nodes = mapper.createArrayNode();\n for (final Image image : imageRepository.findAllPublic())\n try {\n nodes.add(mapper.readTree(image.toString()));\n } catch (final JsonProcessingException e) {\n e.printStackTrace();\n }\n return nodes;\n }", "@Override\n\tpublic List<ImageEntity> getAll() {\n\t\treturn DatabaseContext.findAll(ImageEntity.class);\n\t}", "protected Seq<Fi> loadImages(Xml root, Fi tmxFile){\n Seq<Fi> images = new Seq<>();\n\n for(Xml imageLayer : root.getChildrenByName(\"imagelayer\")){\n Xml image = imageLayer.getChildByName(\"image\");\n String source = image.getAttribute(\"source\", null);\n\n if(source != null){\n Fi handle = getRelativeFileHandle(tmxFile, source);\n\n if(!images.contains(handle, false)){\n images.add(handle);\n }\n }\n }\n\n return images;\n }", "private void loadImages() {\n\t\ttry {\n\t\t\tall_images = new Bitmap[img_files.length];\n\t\t\tfor (int i = 0; i < all_images.length; i++) {\n\t\t\t\tall_images[i] = loadImage(img_files[i] + \".jpg\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tToast.makeText(this, \"Unable to load images\", Toast.LENGTH_LONG)\n\t\t\t\t\t.show();\n\t\t\tfinish();\n\t\t}\n\t}", "@Nullable\n public abstract Image images();", "@Override\n public List<String> getUserImages(User user) {\n List<Image> images = user.getImageList();\n List<String> paths = new ArrayList<>();\n for (Image image : images) {\n paths.add(image.getImagePath());\n }\n return paths;\n }", "public ScanResult getFilesRecursively() {\n\n final ScanResult scanResult = new ScanResult();\n try {\n Files.walkFileTree(this.basePath, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n if (!attrs.isDirectory() && PICTURE_MATCHER.accept(file.toFile())) {\n scanResult.addEntry(convert(file));\n System.out.println(file.toFile());\n }\n return FileVisitResult.CONTINUE;\n }\n });\n } catch (IOException e) {\n // intentional fallthrough\n }\n\n return new ScanResult();\n }", "public List<WebResource> getImages() {\r\n\t\tList<WebResource> result = new Vector<WebResource>();\r\n\t\tList<WebComponent> images = wcDao.getImages();\r\n\t\t// settare l'href corretto...\r\n\t\tfor (Iterator<WebComponent> iter = images.iterator(); iter.hasNext();) {\r\n\t\t\tresult.add((WebResource) iter.next());\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "@Override\n\tpublic Image[] getStaticImages() {\n\t\treturn null;\n\t}", "static public ObservableList<ImageMetaInfo> getImagesInfo(File path) {\n ObservableList<ImageMetaInfo> observableList = FXCollections.observableArrayList();\n ExtFilter fileFilter = new ExtFilter();\n File[] imageFilesArray = path.listFiles(fileFilter);\n for (File file : imageFilesArray) {\n ImageMetaInfo imageMetaInfo = getImageMetaInfo(file);\n observableList.add(imageMetaInfo);\n }\n return observableList;\n }", "public void saveImagesFolder(final Path path_of_resource) throws IOException {\n final Path path = path_of_resource;\n Set<String> listImages = new HashSet<>();\n listImages = listFiles(path);\n List<String> found = new ArrayList<>();\n Iterator<Image> image_it = imageRepository.findAll().iterator();\n // Filter images that have the same name in the db and the images in the\n // resource folder.\n while (image_it.hasNext()) {\n Image next_i = image_it.next();\n Iterator<String> list_it = listImages.iterator();\n while (list_it.hasNext()) {\n String next_s = list_it.next();\n if (next_i.getName().equals(Paths.get(next_s).getFileName().toString()))\n found.add(next_s);\n }\n }\n listImages.removeAll(found);\n System.out.println(listImages);\n listImages.forEach(i -> {\n try {\n final byte[] fileContent = Files.readAllBytes(Paths.get(i));\n Image image = new Image(Paths.get(i).getFileName().toString(), fileContent,\n Utils.typeOfFile(Paths.get(i)), Utils.sizeOfImage(Paths.get(i)));\n image.setIsNew(false);\n imageRepository.save(image);\n\n } catch (final IOException e) {\n e.printStackTrace();\n }\n });\n }", "private List<String> getAllShownImagesPath(Activity context) {\n String[] columns = {MediaStore.Images.Media.DATA, MediaStore.Images.Media.DATE_ADDED};\n\n Cursor cursor = context.getContentResolver().query(\n MediaStore.Images.Media.EXTERNAL_CONTENT_URI, // Specify the provider\n columns, // The columns we're interested in m\n MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME + \" = \" + \"'Camera'\", // A WHERE-filter query\n null, // The arguments for the filter-query\n MediaStore.Images.Media.DATE_ADDED + \" DESC\" // Order the results, newest first\n );\n //\n\n List<String> result = new ArrayList<String>(cursor.getCount());\n\n if (cursor.moveToFirst()) {\n final int image_path_col = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);\n do {\n result.add(cursor.getString(image_path_col));\n } while (cursor.moveToNext());\n }\n cursor.close();\n\n\n return result;\n\n }", "public void findImages() {\n \t\tthis.mNoteItemModel.findImages(this.mNoteItemModel.getContent());\n \t}", "public static NodeList findAllImages(DocumentFragment df)\n throws Exception {\n // troubble with expath in some dfs\n // do it the hard way:\n try {\n String domstring = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?><\"+WXTROOT+\"></\"+WXTROOT+\">\";\n Document doc = makeDomFromString(domstring,true,null);\n doc.getDocumentElement().appendChild(doc.importNode(df, true));\n return doc.getElementsByTagName(\"img\");\n } catch (Exception ex) {\n throw new Exception(reporter.getBundleString(\"Could_not_extract_images\", ex.getMessage()));\n }\n }", "public Collection<GPImageLinkComponent> getImages()\n\t{\n\t\treturn getImages( getSession().getSessionContext() );\n\t}", "public static File[] getUserImages(String username) {\n File[] userFiles = ImageFactory.getFilePaths(username);\n\n String[] userImageURLs = new String[userFiles.length];\n for(int i = 0; i < userFiles.length; i++) {\n userImageURLs[i] = userFiles[i].toURI().toString();\n }\n\n return userFiles;\n }", "@Override\n\tpublic List<String> getAllImages() {\n\t\t\n\t\treturn jdbcTemplate.query(\"select * from news\", new BeanPropertyRowMapper<News>());\n\t}", "public List<? extends PictureData> getAllPictures() {\n\t\treturn null;\n\t}", "AntiIterator<FsPath> listFilesAndDirectories(FsPath dir);", "public yandex.cloud.api.containerregistry.v1.ImageServiceOuterClass.ListImagesResponse list(yandex.cloud.api.containerregistry.v1.ImageServiceOuterClass.ListImagesRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getListMethod(), getCallOptions(), request);\n }", "private static List<File> listChildFiles(File dir) throws IOException {\n\t\t List<File> allFiles = new ArrayList<File>();\n\t\t \n\t\t File[] childFiles = dir.listFiles();\n\t\t for (File file : childFiles) {\n\t\t if (file.isFile()) {\n\t\t allFiles.add(file);\n\t\t } else {\n\t\t List<File> files = listChildFiles(file);\n\t\t allFiles.addAll(files);\n\t\t }\n\t\t }\n\t\t return allFiles;\n\t\t }", "public void initializeImages() {\n\n File dir = new File(\"Images\");\n if (!dir.exists()) {\n boolean success = dir.mkdir();\n System.out.println(\"Images directory created!\");\n }\n }", "private List<? extends Image> getIconImages(String imgunnamedjpg) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "private void processImages() throws MalformedURLException, IOException {\r\n\r\n\t\tNodeFilter imageFilter = new NodeClassFilter(ImageTag.class);\r\n\t\timageList = fullList.extractAllNodesThatMatch(imageFilter, true);\r\n\t\tthePageImages = new HashMap<String, byte[]>();\r\n\r\n\t\tfor (SimpleNodeIterator nodeIter = imageList.elements(); nodeIter\r\n\t\t\t\t.hasMoreNodes();) {\r\n\t\t\tImageTag tempNode = (ImageTag) nodeIter.nextNode();\r\n\t\t\tString tagText = tempNode.getText();\r\n\r\n\t\t\t// Populate imageUrlText String\r\n\t\t\tString imageUrlText = tempNode.getImageURL();\r\n\r\n\t\t\tif (imageUrlText != \"\") {\r\n\t\t\t\t// Print to console, to verify relative link processing\r\n\t\t\t\tSystem.out.println(\"ImageUrl to Retrieve:\" + imageUrlText);\r\n\r\n\t\t\t\tbyte[] imgArray = downloadBinaryData(imageUrlText);\r\n\r\n\t\t\t\tthePageImages.put(tagText, imgArray);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "static BufferedImage getImage(String directory) {\n\t\tClassLoader loader = DrawingUtility.class.getClassLoader();\n\t\tBufferedImage image;\n\t\ttry {\n\n\t\t\timage = ImageIO.read(loader.getResource(directory));\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Fail load image from \" + directory);\n\t\t\timage = null;\n\t\t}\n\t\treturn image;\n\n\t}", "public void getPictures(){\n\t\t\ttry{\n\t\t\t\timg = ImageIO.read(new File(\"background.jpg\"));\n\t\t\t\ttank = ImageIO.read(new File(\"Tank.png\"));\n\t\t\t\tbackground2 = ImageIO.read(new File(\"background2.png\"));\n\t\t\t\t\n\t\t\t\trtank = ImageIO.read(new File(\"RTank.png\"));\n\t\t\t\tboom = ImageIO.read(new File(\"Boom.png\"));\n\t\t\t\tboom2 = ImageIO.read(new File(\"Boom2.png\"));\n\t\t\t\tinstructions = ImageIO.read(new File(\"Instructions.png\"));\n\t\t\t\tshotman = ImageIO.read(new File(\"ShotMan.png\"));\n\t\t\t\tlshotman = ImageIO.read(newFile(\"LShotMan.png\"));\n\t\t\t\tboomshotman = ImageIO.read(new File(\"AfterShotMan\"));\n\t\t\t\tlboomshotman = ImageIO.read(new File(\"LAfterShotMan\"));\n\t\t\t\t\n\t\t\t}catch(IOException e){\n\t\t\t\tSystem.err.println(\"d\");\n\t\t\t}\n\t\t}", "private static CopyOnWriteArrayList<String> getListOfImages(String username){\r\n\t\treturn getUser(username).getImageList();\r\n\t}", "public Image[] getImages() {\n return images;\n }", "private void extractCards() {\n String fileSeparator = System.getProperty(\"file.separator\");\n String path = System.getProperty(\"user.dir\");\n path = path + fileSeparator + \"Client\" + fileSeparator + \"src\" + fileSeparator + \"Images\" + fileSeparator;\n System.out.println(path);\n\n for (Picture p : cardlist) {\n BufferedImage image = null;\n try {\n image = javax.imageio.ImageIO.read(new ByteArrayInputStream(p.getStream()));\n File outputfile = new File(path + p.getName());\n ImageIO.write(image, \"png\", outputfile);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "public List<Image> parseMainImagesResult(Document doc) {\n\n ArrayList<Image> mainImages = new ArrayList<>();\n Elements mainHtmlImages = doc.select(CSS_IMAGE_QUERY);\n Timber.i(\"Images: %s\", mainHtmlImages.toString());\n String href;\n Image mainImage;\n for (Element mainHtmlImage : mainHtmlImages) {\n href = mainHtmlImage.attr(\"href\");\n Timber.i(\"Link href: %s\", href);\n mainImage = new Image(href);\n mainImages.add(mainImage);\n }\n return mainImages;\n }", "private static List<File> rootFiles(final File metaDir) throws IOException {\n File containerFile = new File(metaDir, \"container.xml\");\n if(!containerFile.exists()) {\n throw new IOException(\"Missing 'META-INF/container.xml'\");\n }\n\n List<File> rootFiles = Lists.newArrayListWithExpectedSize(2);\n try(FileInputStream fis = new FileInputStream(containerFile)) {\n Document doc = Jsoup.parse(fis, Charsets.UTF_8.name(), \"\", Parser.xmlParser());\n Elements elements = doc.select(\"rootfile[full-path]\");\n for(Element element : elements) {\n String path = element.attr(\"full-path\").trim();\n if(path.isEmpty()) {\n continue;\n } else if(path.startsWith(\"/\")) {\n path = path.substring(1);\n }\n File rootFile = new File(metaDir.getParent(), path);\n if(!rootFile.exists()) {\n throw new IOException(String.format(\"Missing file, '%s'\", rootFile.getAbsolutePath()));\n }\n rootFiles.add(rootFile);\n }\n }\n\n return rootFiles;\n }", "@Override\n\tpublic ArrayList<ImgRep> getAll(int imgNum) {\n\t\treturn dao.selectAll(imgNum);\n\t}", "List<File> list(String directory) throws FindException;", "public ArrayList<ImageContainer> getAllImageContainers(String username) throws ClassNotFoundException, IOException {\r\n\t\tArrayList<ImageContainer> ics = new ArrayList<ImageContainer>();\r\n\t\tCopyOnWriteArrayList<String> imageNames = getListOfImages(username);\r\n\t\tPoint p;\r\n\t\tString destinationPeerIp;\r\n\t\tfor(String imageName : imageNames) {\r\n\t\t\ttry {\r\n\t\t\t\tp = StaticFunctions.hashToPoint(username, imageName);\r\n\t\t\t\tif(lookup(p)) {\r\n\t\t\t\t\tics.add(loadImageContainer(username, imageName));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdestinationPeerIp = routing(p).getIp_adresse();\r\n\t\t\t\t\t//Load image from destinationPeer\r\n\t\t\t\t\tImage img =new PeerClient().getImage(destinationPeerIp, username , imageName);\r\n\t\t\t\t\tif(img != null) {\r\n\t\t\t\t\t\tics.add(RestUtils.convertImgToIc(img));\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tSystem.out.println(imageName + \" nicht gefunden\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ics;\r\n\t}", "@Override\n\tpublic List<File> getListing(File directory, FileFilter filter) {\n\t\tfileIconMap = new HashMap<>();\n\n\t\tif (directory == null) {\n\t\t\treturn List.of();\n\t\t}\n\t\tFile[] files = directory.listFiles(filter);\n\t\treturn (files == null) ? List.of() : List.of(files);\n\t}", "public static List getAllImgs() {\n List polovniautomobili = new ArrayList<>();\n try {\n CONNECTION = DriverManager.getConnection(URL, USERNAME, PASSWORD);\n String query = \"SELECT imgUrl FROM polovni\";\n try (PreparedStatement ps = CONNECTION.prepareStatement(query)) {\n ResultSet result = ps.executeQuery();\n while (result.next()) {\n String imgUrl = result.getString(\"imgUrl\");\n polovniautomobili.add(imgUrl);\n }\n\n ps.close();\n CONNECTION.close();\n }\n CONNECTION.close();\n } catch (SQLException ex) {\n Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);\n }\n return polovniautomobili;\n }", "private List<String> getImages(SalonData salonData) {\n List<String> salonImages = new ArrayList<>();\n List<SalonImage> salonImage = salonData.getSalonImage();\n for (int i = 0; i < salonImage.size(); i++) {\n salonImages.add(salonImage.get(i).getImage());\n }\n return salonImages;\n }", "private List<String> getImages(String query, int id) {\n\t\tResultSet rs=null;\n\t\tList<String> imageList = new ArrayList<String>();\n\t\ttry {\n\t\t\t\n\t\t\t//pstmt = con.prepareStatement(query);\n\t\t\tPreparedStatement pstmt = dataSource.getConnection().prepareStatement(query);\n\t\t\tpstmt.setInt(1, id);\n\t\t\trs = pstmt.executeQuery();\n\t\t\twhile (rs.next()) \n\t\t\t{\n\t\t\t\timageList.add(rs.getString(1));\n\t\t\t}\n\t\t}catch (SQLException e) {\n\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t}\n\t\t\treturn imageList;\n\t}", "private void imageSearch(ArrayList<Html> src) {\n // loop through the Html objects\n for(Html page : src) {\n\n // Temp List for improved readability\n ArrayList<Image> images = page.getImages();\n\n // loop through the corresponding images\n for(Image i : images) {\n if(i.getName().equals(this.fileName)) {\n this.numPagesDisplayed++;\n this.pageList.add(page.getLocalPath());\n }\n }\n }\n }", "private LinkedList<Image> loadPhotos(int n){\n\t\tLinkedList<Image> listOfPhotos = new LinkedList<>();\n\t\t\n\t\t\n\t\ttry {\n\n\t\t\tFileInputStream in = new FileInputStream(\"images\");\n\t\t\t//Skipping magic number and array size\n\t\t\tfor (int i = 0; i < 16; i++) {\n\t\t\t\tin.read();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor (int k = 0; k < n; k++) {\n\t\t\t\tImage img = new Image(HEIGHT, WIDTH);\n\t\t\t\t\n\t\t\t\tbyte[][] imageData = new byte[WIDTH][HEIGHT];\n\t\t\t\tfor (int i = k*WIDTH; i < k*WIDTH + WIDTH; i++) {\n\t\t\t\t\tfor (int j = k*HEIGHT; j < k*HEIGHT + HEIGHT; j++) {\n\t\t\t\t\t\timageData[j%28][i%28] = (byte) in.read();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\timg.setData(imageData);\n\t\t\t\tlistOfPhotos.add(img);\n\t\t\t}\n\t\t\tin.close();\n\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\t\n\t\t\n\t\treturn listOfPhotos;\n\t\t\n\t}", "public void testImagesDirectoryAccessible() {\n File file = new File(rootBlog.getRoot(), \"images\");\n assertEquals(file, new File(rootBlog.getImagesDirectory()));\n assertTrue(file.exists());\n }", "private void getImagesFromServer() {\n trObtainAllPetImages.setUser(user);\n trObtainAllPetImages.execute();\n Map<String, byte[]> petImages = trObtainAllPetImages.getResult();\n Set<String> names = petImages.keySet();\n\n for (String petName : names) {\n byte[] bytes = petImages.get(petName);\n Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, Objects.requireNonNull(bytes).length);\n int index = user.getPets().indexOf(new Pet(petName));\n user.getPets().get(index).setProfileImage(bitmap);\n ImageManager.writeImage(ImageManager.PET_PROFILE_IMAGES_PATH, user.getUsername() + '_' + petName, bytes);\n }\n }", "@Override\n\tpublic List<ProductGalleries> getAllProductImages() {\n\t\treturn (List<ProductGalleries>) this.productGaleryRepository.findAll();\n\t}", "public static File[] searchForImages(String[] searchTags) {\n File[] searchFiles = ImageFactory.searchForImages(searchTags);\n\n String[] searchImageURLs = new String[searchFiles.length];\n for(int i = 0; i < searchFiles.length; i++) {\n searchImageURLs[i] = searchFiles[i].toURI().toString();\n }\n\n return searchFiles;\n }", "abstract public String getImageResourcesDir();", "@Override\n public List<GEMFile> getLocalFiles(String directory) {\n File dir = new File(directory);\n List<GEMFile> resultList = Lists.newArrayList();\n File[] fList = dir.listFiles();\n if (fList != null) {\n for (File file : fList) {\n if (file.isFile()) {\n resultList.add(new GEMFile(file.getName(), file.getParent()));\n } else {\n resultList.addAll(getLocalFiles(file.getAbsolutePath()));\n }\n }\n gemFileState.put(STATE_SYNC_DIRECTORY, directory);\n }\n return resultList;\n }", "public List<CMMedia> getPicturesUnfiltered() {\n return super.getMedia();\n }", "@Override\n\tpublic void readImages() {\n\t\t\n\t}", "private ArrayList<File> getFilesInDirectory(String directoryPath, boolean omitHiddenFiles) {\n //---------- get all files in the provided directory ----------\n ArrayList<File> filesInFolder = new ArrayList<>();\n\n File folder = new File(directoryPath);\n for (File f : folder.listFiles()) {\n if (!f.isHidden() || !omitHiddenFiles)\n filesInFolder.add(f);\n }\n\n //sort the list of files\n Collections.sort(filesInFolder);\n return filesInFolder;\n }", "List<Path> getFiles();", "public String getImages() {\n\t\treturn this.images;\n\t}", "static Stream<File> allFilesIn(File folder) \r\n\t{\r\n\t\tFile[] children = folder.listFiles();\r\n\t\tStream<File> descendants = Arrays.stream(children).filter(File::isDirectory).flatMap(Program::allFilesIn);\r\n\t\treturn Stream.concat(descendants, Arrays.stream(children).filter(File::isFile));\r\n\t}", "@Override\r\n\tpublic List<EventRollingImage> getAllEventsRollingImages() {\r\n\t\treturn (List<EventRollingImage>) sessionFactory.getCurrentSession().createCriteria(EventRollingImage.class).list();\r\n\t}", "@SuppressLint(\"Recycle\")\n private synchronized ArrayList<String> retriveSavedImages(Context activity) {\n Uri uri;\n Cursor cursor;\n int column_index_data, column_index_folder_name, column_index_file_name;\n ArrayList<String> listOfAllImages = new ArrayList<>();\n uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;\n String[] projection = {MediaStore.MediaColumns.DATA,\n MediaStore.Images.Media.BUCKET_DISPLAY_NAME,\n MediaStore.MediaColumns.DISPLAY_NAME};\n\n cursor = activity.getApplicationContext().getContentResolver().query(uri, projection, null,\n null, MediaStore.Images.Media.DATE_ADDED);//\n\n assert cursor != null;\n column_index_data = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DATA);\n column_index_folder_name = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.BUCKET_DISPLAY_NAME);\n column_index_file_name = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DISPLAY_NAME);\n\n while (cursor.moveToNext()) {\n\n /*Images from CustomCalender folder only*/\n if (cursor.getString(column_index_folder_name).contains(\"CustomCalender\")) {\n listOfAllImages.add(cursor.getString(column_index_data));\n// Log.v(\"Images: \", cursor.getString(column_index_file_name));\n }\n }\n\n /*Testing Glide cache by making duplicates total 768 images*/\n /*listOfAllImages.addAll(listOfAllImages); //24\n listOfAllImages.addAll(listOfAllImages); //48\n listOfAllImages.addAll(listOfAllImages); //96\n listOfAllImages.addAll(listOfAllImages); //192\n listOfAllImages.addAll(listOfAllImages); //384\n listOfAllImages.addAll(listOfAllImages); //768*/\n\n return listOfAllImages;\n }", "private void loadImages(BufferedImage[] images, String direction) {\n for (int i = 0; i < images.length; i++) {\n String fileName = direction + (i + 1);\n images[i] = GameManager.getResources().getMonsterImages().get(\n fileName);\n }\n\n }", "List<Bitmap> getFavoriteRecipeImgs();", "@Override\n public List<IPictureDto> getAllVisiblePictures() {\n return new ArrayList<IPictureDto>();\n }", "public static void deleteAllMediaThumbIntStg() {\n File[] subDirectory = PathUtil.INTERNAL_MAIN_DIRECTORY.listFiles();\n for (File aSubDirectory : subDirectory) { //looping sub folders\n String[] files = aSubDirectory.list();\n //if (!aSubDirectory.getName().equals(PathUtil.INTERNAL_SUB_FOLDER_CHAT_IMAGE)) { //except chat image folder\n for (String file : files) {\n File f = new File(aSubDirectory, file);\n delete(f);\n //LogUtil.e(\"StorageUtil\", \"deleteAllMediaThumbIntStg\");\n }\n delete(aSubDirectory);\n //}\n }\n }", "public ArrayList<BufferedImage> getImages(File gif) throws IOException {\r\n\t\tArrayList<BufferedImage> imgs = new ArrayList<BufferedImage>();\r\n\t\tImageReader rdr = new GIFImageReader(new GIFImageReaderSpi());\r\n\t\trdr.setInput(ImageIO.createImageInputStream(gif));\r\n\t\tfor (int i=0;i < rdr.getNumImages(true); i++) {\r\n\t\t\timgs.add(rdr.read(i));\r\n\t\t}\r\n\t\treturn imgs;\r\n\t}", "public void loadTileImages() {\n // keep looking for tile A,B,C, etc. this makes it\n // easy to drop new tiles in the images/ directory\n tiles = new ArrayList();\n char ch = 'A';\n while (true) {\n String name = \"tile_\" + ch + \".png\";\n File file = new File(\"images/\" + name);\n if (!file.exists()) {\n break;\n }\n tiles.add(loadImage(name));\n ch++;\n }\n }", "public ImageIcon[] getImages() {\n\t\treturn imageList;\n\t}", "private void loadImages(){\n try{\n System.out.println(System.getProperty(\"user.dir\"));\n\n t1img = read(new File(\"resources/tank1.png\"));\n t2img = read(new File(\"resources/tank1.png\"));\n backgroundImg = read(new File(\"resources/background.jpg\"));\n wall1 = read(new File(\"resources/Wall1.gif\"));\n wall2 = read(new File(\"resources/Wall2.gif\"));\n heart = resize(read(new File(\"resources/Hearts/basic/heart.png\")), 35,35);\n heart2 = resize(read( new File(\"resources/Hearts/basic/heart.png\")), 25,25);\n bullet1 = read(new File(\"resources/bullet1.png\"));\n bullet2 = read(new File(\"resources/bullet2.png\"));\n\n }\n catch(IOException e){\n System.out.println(e.getMessage());\n }\n }", "private void getBaseImageDockerfiles(){\n ArrayList<String> baseList = new ArrayList<String>();\n InputStream inputStream = brokenJavaNaming(\"base.list\");\n if(inputStream == null){\n System.out.println(\"No base.list file found.\");\n }else{\n InputStreamReader streamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);\n BufferedReader reader = new BufferedReader(streamReader);\n try{\n for (String line; (line = reader.readLine()) != null;) {\n baseList.add(line);\n } \n }catch(IOException ex){\n System.out.println(ex);\n }\n }\n\n // Get list of valid base dockerfiles\n File dockerfileBasesPath = new File(labtainerPath + File.separator +\"scripts\"+ File.separator+\"designer\"+File.separator+\"base_dockerfiles\");\n File[] baseFiles = dockerfileBasesPath.listFiles(new FilenameFilter(){\n public boolean accept(File dockerfileBasesPath, String filename)\n {return filename.startsWith(\"Dockerfile.labtainer.\"); }\n } );\n \n for(int i = 0;i<baseFiles.length;i++){\n String base = baseFiles[i].getName().split(\"Dockerfile.labtainer.\")[1];\n if(!baseList.contains(base)){\n baseList.add(base);\n }\n }\n \n //Set the base image combobox options for making new labs and adding containers\n for(String baseImage : baseList){\n NewLabBaseImageComboBox.addItem(baseImage);\n ContainerAddDialogBaseImageCombobox.addItem(baseImage);\n }\n }", "@Override\n\tpublic List<Image> findImagesByUserId(int userid) {\n\t\treturn new ImageDaoImpl().findImagesByUserId(userid);\n\t}", "static public void readRepository(){\n File cache_file = getCacheFile();\n if (cache_file.exists()) {\n try {\n // Read the cache acutally\n DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n DocumentBuilder builder = factory.newDocumentBuilder();\n Document document = builder.parse(cache_file);\n NodeList images_nodes = document.getElementsByTagName(\"image\");\n for (int i = 0; i < images_nodes.getLength(); i++) {\n Node item = images_nodes.item(i);\n String image_path = item.getTextContent();\n File image_file = new File(image_path);\n if (image_file.exists()){\n AppImage image = Resources.loadAppImage(image_path);\n images.add(image);\n }\n }\n }\n catch (Exception e) {\n throw new RuntimeException(e);\n }\n }\n }", "public String getAllFilles(int n) throws IOException {\n\t\tString x = \"\";\n\t\tString path = \"C:/JEE/workspace/Server/Upload\";\n\t\tString path2 = \"C:/JEE/workspace/Server/Upload/\";\n\t\tFile folder = new File(path);\n\t\tFile[] listOfFiles = folder.listFiles();\n\t\tArrayList listOfPathFiles = new ArrayList();\n\n\t\t// for (int i = 0; i < listOfFiles.length; i++) {\n\t\tif (listOfFiles[n].isFile()) {\n\n\t\t\tInputStream inputStream2 = new FileInputStream(path2 + listOfFiles[n].getName());\n\t\t\tbyte[] buffer = new byte[4096];\n\t\t\tint bytesRead = 0;\n\t\t\tBASE64Encoder encoder = new BASE64Encoder();\n\t\t\tByteArrayOutputStream buffer2 = new ByteArrayOutputStream();\n\t\t\twhile (true) {\n\t\t\t\tbytesRead = inputStream2.read(buffer); \n\t\t\t\tif (bytesRead > 0) {\n\t\t\t\t\tbuffer2.write(buffer, 0, bytesRead);\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuffer2.flush(); \n\t\t\tString codec;\n\t\t\tcodec = encoder.encode(buffer2.toByteArray());\n\t\t\tif (n >= 0) {\n\t\t\t\t// listOfPathFiles.add(\"data:image/png;base64,\"+codec);\n\t\t\t\tx = codec;\n\t\t\t}\n\t\t}\n\t\tif (listOfFiles[n].isDirectory()) {\n\t\t\tSystem.out.println(\"Directory \" + listOfFiles[n].getName());\n\t\t}\n\t\t// }\n\t\treturn x;\n\t\t// return listOfPathFiles;\n\t}", "public void treatAllPhotos() throws IllegalArgumentException {\n for(Long currentID : idsToTest){\n String pathToPhoto = \"photo\\\\\" + currentID.toString();\n File currentPhotosFile = new File(pathToPhoto);\n\n if(currentPhotosFile.exists() && currentPhotosFile.isDirectory()){\n\n File[] listFiles = currentPhotosFile.listFiles();\n\n for(File file : listFiles){\n if (!file.getName().endsWith(\".pgm\")) { //search how to convert all image to .pgm\n throw new IllegalArgumentException(\"The file of the student \" + currentID + \" contains other files than '.pgm'.\");\n }\n else{\n Mat photoToTreat = Imgcodecs.imread(pathToPhoto + \"\\\\\" + file.getName(), Imgcodecs.IMREAD_GRAYSCALE);\n Mat treatedPhoto = recoApp.imageTreatment(photoToTreat);\n if(treatedPhoto != null){\n Imgcodecs.imwrite(pathToPhoto + \"\\\\\" + file.getName(), treatedPhoto);\n }\n }\n }\n }\n else{\n throw new IllegalArgumentException(\"The file of the student \" + currentID + \" do not exist or is not a directory.\");\n }\n }\n }", "@Generated(hash = 1057346450)\n public List<Image> getImageList() {\n if (imageList == null) {\n final DaoSession daoSession = this.daoSession;\n if (daoSession == null) {\n throw new DaoException(\"Entity is detached from DAO context\");\n }\n ImageDao targetDao = daoSession.getImageDao();\n List<Image> imageListNew = targetDao._queryEvent_ImageList(id);\n synchronized (this) {\n if (imageList == null) {\n imageList = imageListNew;\n }\n }\n }\n return imageList;\n }", "List<Bitmap> getRecipeImgSmall();", "public List<Path> getAllPaths();", "@ApiOperation(value = \"Return all images and tags within supplied registry\", response = DockerImageDataListResponse.class, produces = \"application/json\")\n\t@ApiResponses(value = { @ApiResponse(code = 200, message = \"Successfully retrieved all objects\"),\n\t\t\t@ApiResponse(code = 400, message = \"Images not found in supplied registry\") })\n\t@RequestMapping(path = \"/{registry}/all\", method = RequestMethod.GET)\n\tpublic @ResponseBody DockerImageDataListResponse getAllImagesFromRegistry(@PathVariable String registry) {\n\t\tRegistryConnection localConnection;\n\t\tList<DockerImageData> images = new LinkedList<DockerImageData>();\n\t\ttry {\n\t\t\tlocalConnection = new RegistryConnection(configs.getURLFromName(registry));\n\n\t\t\tRegistryCatalog repos = localConnection.getRegistryCatalog();\n\t\t\t// Iterate over repos to build out DockerImageData objects\n\t\t\tfor (String repo : repos.getRepositories()) {\n\t\t\t\t// Get all tags from specific repo\n\t\t\t\tImageTags tags = localConnection.getTagsByRepoName(repo);\n\n\t\t\t\t// For each tag, get the digest and create the object based on looping values\n\t\t\t\tfor (String tag : tags.getTags()) {\n\t\t\t\t\tDockerImageData image = new DockerImageData();\n\t\t\t\t\timage.setRegistryName(registry);\n\t\t\t\t\timage.setImageName(repo);\n\t\t\t\t\timage.setTag(tag);\n\t\t\t\t\timage.setDigest(new ImageDigest(localConnection.getImageID(repo, tag)));\n\t\t\t\t\timages.add(image);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new DockerImageDataListResponse(HttpServletResponse.SC_OK,\n\t\t\t\t\t\"Successfully pulled all image:tag pairs from \" + registry, images);\n\t\t} catch (RegistryNotFoundException e) {\n\t\t\treturn null;\n\t\t}\n\t}", "public java.util.List<com.agbar.service.model.ImgImportadas> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "public void listFiles(String path) {\r\n String files;\r\n File folder = new File(path);\r\n File[] listOfFiles = folder.listFiles();\r\n\r\n for (int i = 0; i < listOfFiles.length; i++) {\r\n\r\n if (listOfFiles[i].isFile()) {\r\n files = listOfFiles[i].getName();\r\n if (files.endsWith(\".png\") || files.endsWith(\".PNG\")\r\n || files.endsWith(\".gif\") || files.endsWith(\".GIF\")) {\r\n //System.out.println(files);\r\n pathList.add(path+\"\\\\\");\r\n fileList.add(files);\r\n }\r\n }\r\n \r\n else {\r\n listFiles(path+\"\\\\\"+listOfFiles[i].getName());\r\n }\r\n }\r\n }", "private void searchImages()\n {\n searchWeb = false;\n search();\n }", "GetImagesResult getImages(GetImagesRequest getImagesRequest);", "private void addImgList() {\n\t\tdogImg.add(\"./data/img/labrador.jpg\");\t\t\t\t\n\t\tdogImg.add(\"./data/img/germanshepherd.jpg\");\t\n\t\tdogImg.add(\"./data/img/bulldog.jpg\");\t\t\t\t\t\t\t\t\n\t\tdogImg.add(\"./data/img/rottweiler.jpg\");\n\t\tdogImg.add(\"./data/img/husky.jpg\");\n\n\t}", "public static void loadImages()\n \t{\n \t\tSystem.out.print(\"Loading images... \");\n \t\t\n \t\tallImages = new TreeMap<ImageEnum, ImageIcon>();\n \t\t\n \t\ttry {\n \t\taddImage(ImageEnum.RAISIN, \"images/parts/raisin.png\");\n \t\taddImage(ImageEnum.NUT, \"images/parts/nut.png\");\n \t\taddImage(ImageEnum.PUFF_CHOCOLATE, \"images/parts/puff_chocolate.png\");\n \t\taddImage(ImageEnum.PUFF_CORN, \"images/parts/puff_corn.png\");\n \t\taddImage(ImageEnum.BANANA, \"images/parts/banana.png\");\n \t\taddImage(ImageEnum.CHEERIO, \"images/parts/cheerio.png\");\n \t\taddImage(ImageEnum.CINNATOAST, \"images/parts/cinnatoast.png\");\n\t\taddImage(ImageEnum.CORNFLAKE, \"images/parts/flake_corn.png\");\n \t\taddImage(ImageEnum.FLAKE_BRAN, \"images/parts/flake_bran.png\");\n \t\taddImage(ImageEnum.GOLDGRAHAM, \"images/parts/goldgraham.png\");\n \t\taddImage(ImageEnum.STRAWBERRY, \"images/parts/strawberry.png\");\n \t\t\n \t\taddImage(ImageEnum.PART_ROBOT_HAND, \"images/robots/part_robot_hand.png\");\n \t\taddImage(ImageEnum.KIT_ROBOT_HAND, \"images/robots/kit_robot_hand.png\");\n \t\taddImage(ImageEnum.ROBOT_ARM_1, \"images/robots/robot_arm_1.png\");\n \t\taddImage(ImageEnum.ROBOT_BASE, \"images/robots/robot_base.png\");\n \t\taddImage(ImageEnum.ROBOT_RAIL, \"images/robots/robot_rail.png\");\n \t\t\n \t\taddImage(ImageEnum.KIT, \"images/kit/empty_kit.png\");\n \t\taddImage(ImageEnum.KIT_TABLE, \"images/kit/kit_table.png\");\n \t\taddImage(ImageEnum.KITPORT, \"images/kit/kitport.png\");\n \t\taddImage(ImageEnum.KITPORT_HOOD_IN, \"images/kit/kitport_hood_in.png\");\n \t\taddImage(ImageEnum.KITPORT_HOOD_OUT, \"images/kit/kitport_hood_out.png\");\n \t\taddImage(ImageEnum.PALLET, \"images/kit/pallet.png\");\n \t\t\n \t\taddImage(ImageEnum.FEEDER, \"images/lane/feeder.png\");\n \t\taddImage(ImageEnum.LANE, \"images/lane/lane.png\");\n \t\taddImage(ImageEnum.NEST, \"images/lane/nest.png\");\n \t\taddImage(ImageEnum.DIVERTER, \"images/lane/diverter.png\");\n \t\taddImage(ImageEnum.DIVERTER_ARM, \"images/lane/diverter_arm.png\");\n \t\taddImage(ImageEnum.PARTS_BOX, \"images/lane/partsbox.png\");\n \t\t\n \t\taddImage(ImageEnum.CAMERA_FLASH, \"images/misc/camera_flash.png\");\n \t\taddImage(ImageEnum.SHADOW1, \"images/misc/shadow1.png\");\n \t\taddImage(ImageEnum.SHADOW2, \"images/misc/shadow2.png\");\n \t\t\n \t\taddImage(ImageEnum.GANTRY_BASE, \"images/gantry/gantry_base.png\");\n \t\taddImage(ImageEnum.GANTRY_CRANE, \"images/gantry/gantry_crane.png\");\n \t\taddImage(ImageEnum.GANTRY_TRUSS_H, \"images/gantry/gantry_truss_h.png\");\n \t\taddImage(ImageEnum.GANTRY_TRUSS_V, \"images/gantry/gantry_truss_v.png\");\n \t\taddImage(ImageEnum.GANTRY_WHEEL, \"images/gantry/gantry_wheel.png\");\n \t\t} catch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t\tSystem.exit(1);\n \t\t}\n \t\tSystem.out.println(\"Done\");\n \t}" ]
[ "0.81187475", "0.7453991", "0.7192897", "0.71125233", "0.69569206", "0.6925639", "0.6834707", "0.683443", "0.6716072", "0.6596815", "0.6561458", "0.65110594", "0.64350474", "0.63970506", "0.6378593", "0.6359459", "0.63360065", "0.6286159", "0.62339944", "0.6233464", "0.6192993", "0.61235535", "0.60987455", "0.6070053", "0.6059693", "0.60310346", "0.60282725", "0.59852904", "0.59252477", "0.58861834", "0.5832965", "0.58091843", "0.5792603", "0.57733464", "0.5761424", "0.5744794", "0.5726962", "0.56917894", "0.5672707", "0.566379", "0.5638628", "0.5634556", "0.5630982", "0.5628865", "0.5617182", "0.5596244", "0.5593608", "0.55748856", "0.55714077", "0.5560427", "0.55469376", "0.5544682", "0.5531515", "0.552269", "0.552243", "0.55198556", "0.55189615", "0.55078167", "0.5507716", "0.5503377", "0.54972166", "0.54943776", "0.547688", "0.5476687", "0.5472047", "0.5450937", "0.5450085", "0.54429173", "0.5441034", "0.54330194", "0.54192996", "0.5418592", "0.5408967", "0.54050636", "0.5399072", "0.5398587", "0.538375", "0.537592", "0.5372268", "0.5366302", "0.5366035", "0.5349029", "0.53468835", "0.5338479", "0.53320163", "0.53253293", "0.53234994", "0.53230244", "0.5315681", "0.53090346", "0.53046083", "0.52988946", "0.52958685", "0.52947366", "0.5293189", "0.52926284", "0.52872694", "0.528473", "0.52793753", "0.5273014" ]
0.73923934
2
idea from Returns true if the File file is an image
private boolean isImage(File file) throws IOException { if (!file.isFile()) { return false; } else if (ImageIO.read(file) == null) // if cannot be read by imageIO, then not image { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isImageType();", "private void isImage(MultipartFile file) {\n if(!Arrays.asList(IMAGE_JPEG.getMimeType(), IMAGE_PNG.getMimeType(), IMAGE_GIF.getMimeType(), IMAGE_BMP.getMimeType(), IMAGE_SVG.getMimeType()).contains(file.getContentType()))\n throw new IllegalStateException(\"File must be an image [\"+ file.getContentType()+\"]\\nExpected Types: [\"+IMAGE_JPEG+\" \"+IMAGE_PNG+\" \"+IMAGE_GIF+\" \"+IMAGE_BMP+\" \"+IMAGE_SVG+\"]\");\n }", "public boolean isImage(File file) {\r\n\t\t\r\n\t\tif (file.getName().endsWith(\".PNG\") || file.getName().endsWith(\".png\") || file.getName().endsWith(\".jpg\")\r\n\t\t\t\t|| file.getName().endsWith(\".JPG\") || file.getName().endsWith(\".jpeg\")\r\n\t\t\t\t|| file.getName().endsWith(\".JPEG\") || file.getName().endsWith(\".bmp\")\r\n\t\t\t\t|| file.getName().endsWith(\".BMP\")) {\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t\t\r\n\t}", "public boolean validImageContent() {\n\t\treturn input.validFile(list);\n\t}", "public static boolean isImageFile(String path) {\n String mimeType = URLConnection.guessContentTypeFromName(path);\n return mimeType != null && mimeType.startsWith(\"image\");\n }", "private boolean isImageType(String source) {\r\n int lastDot = source.lastIndexOf(\".\");\r\n String type = source.substring(lastDot);\r\n if (type.toLowerCase().equals(\".jpg\") || type.toLowerCase().equals(\".tif\") || type.toLowerCase().equals(\".gif\")\r\n || type.toLowerCase().equals(\".png\") || type.toLowerCase().equals(\".bmp\") || type.toLowerCase().equals(\".jpeg\")\r\n || type.toLowerCase().equals(\".jpe\") || type.toLowerCase().equals(\".dib\") || type.toLowerCase().equals(\".jfif\")) {\r\n return true;\r\n }\r\n return false;\r\n }", "private Boolean isImage(PrintDocument printDocument) {\n String url = printDocument.getUrl();\n String filename = url.substring(url.lastIndexOf(\"/\") + 1);\n\n return filename.matches(\"^.*\\\\.(jpg|jpeg|png|gif)$\");\n }", "public static boolean isImageFile(String imageFile) {\n String img = imageFile.toLowerCase().trim();\n if (img.endsWith(\".gif\") || img.endsWith(\".jpg\") || \n img.endsWith(\".png\") || img.endsWith(\".jpeg\")) {\n return true;\n }\n return false;\n }", "boolean isImageTileType();", "boolean hasImagePath();", "public boolean isFile() { return true; }", "private static boolean checkFileType(String filename) {\r\n\t\treturn (filename.matches(\"(.*).bf\") || filename.matches(\"(.*).bmp\"));\r\n\t}", "public boolean hasImage() {\n\t\treturn false;\n\t}", "public boolean accept(File f) {\n if (f.isDirectory()) {\n return true;\n }\n String extension = FilenameUtils.getExtension(f.getName());\n for (String validImageExtension:IMAGE_FILE_EXTENSION) {\n if (validImageExtension.equalsIgnoreCase(extension)) {\n return true;\n }\n }\n return false;\n }", "@Override\r\n\t\t\t\t\tpublic boolean accept(File paramFile, String paramString) {\n\t\t\t\t\t\treturn (paramString.endsWith(\"png\"));\r\n\t\t\t\t\t}", "@Override\r\n\tpublic boolean accept(File f) {\r\n\t\tif (f.isDirectory()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tString extension = FileUtils.getExtension(f);\r\n\t\tif (extension == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (extension.equals(TIFF) || extension.equals(TIF)\r\n\t\t\t\t|| extension.equals(GIF) || extension.equals(JPEG)\r\n\t\t\t\t|| extension.equals(JPG) || extension.equals(PNG)) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean accept(File f) \n \t{\n if (f.isDirectory()) \t\t\t\t\t\t\t return true;\n\n String extension = getExtension(f);\n if (extension != null) \n \t{\n \tif (extension.equals(\"png\")) return true;\n \telse\t\t\t\t\t\t\t return false;\n }\n\n return false;\n \t}", "private boolean isCorrectFile(File file) {\n\t\treturn file.getAbsolutePath().endsWith(\".gif\") || file.getAbsolutePath().endsWith(\".jpeg\")\n\t\t\t\t|| file.getAbsolutePath().endsWith(\".jpg\");\n\t}", "boolean hasPicture();", "public boolean isFile() { return false; }", "private boolean isImageGiven(){\n return captureImage.getDrawable() != null;\n }", "public boolean accept(File f) {\n\t\t// show if it is a directory\n\t\tif (f.isDirectory()) {\n\t\t\treturn true;\n\t\t}\n\t\t// show if it is a file with PNG extension\n\t\tString extension = getExtension(f);\n\t\tif (extension != null) {\n\t\t\tif (extension.equals(\"png\"))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t// otherwise don't show\n\t\treturn false;\n\t}", "boolean hasImageByHandler();", "boolean isFile() throws IOException;", "@Override\n\tpublic boolean isFile() {\n\t\treturn true;\n\t}", "public static boolean hasValidImageFile(String path) {\n boolean good = false;\n if (path.toLowerCase().endsWith(\".png\") || path.toLowerCase().endsWith(\".jpg\")) good = true;\n if (!good) return false;\n try {\n File f = new File(path);\n BufferedImage bi = ImageIO.read(f);\n if (!f.exists() || bi == null) return false;\n } catch (Exception e) {\n return false;\n }\n return true;\n }", "public boolean hasImage() { return ImageResource != NO_IMAGE_PROVIDED; }", "public static boolean isImage(FileExtension fileExtension) {\n if (fileExtension != null) {\n return isImage(fileExtension.getFileExtension());\n }\n return false;\n }", "public void isImagePresent() {\r\n\t\t\t\r\n\t\t}", "@Override\n public boolean accept(File pathname) {\n if (pathname.getName().endsWith(\".jpg\")) {\n return true;\n } else {\n return false;\n }\n\n }", "boolean hasImageByTransform();", "public static boolean isImage(String extension) {\n if (extension != null && (\n \t\textension.equalsIgnoreCase(JPG.toString())\n \t\t|| extension.equalsIgnoreCase(JPEG.toString())\n \t\t|| extension.equalsIgnoreCase(PNG.toString())\n \t\t|| extension.equalsIgnoreCase(BMP.toString()))) {\n return true;\n }\n return false;\n }", "public boolean hasImagePath() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }", "public boolean hasImagePath() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }", "public boolean hasImage(){\n //return true or false\n return mImageResource != NO_IMAGE_PROVIDED;\n }", "@Override\n\tpublic boolean isMyImage() {\n\t\treturn false;\n\t}", "public Boolean testImage(String url) {\r\n\t\ttry {\r\n\t\t\tBufferedImage image = ImageIO.read(new URL(url));\r\n\t\t\tif (image != null) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t} catch (MalformedURLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tSystem.err.println(\"URL error with image\");\r\n\t\t\treturn false;\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"IO error with image\");\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean accept(File f) {\r\n\t if (f.isDirectory()) {\r\n\t return true;\r\n\t }\r\n\t \r\n\t String extension = Utils.getExtension(f);\r\n\t if (extension != null) {\r\n\t if (extension.equals(Utils.tiff) ||\r\n\t extension.equals(Utils.tif) ||\r\n\t extension.equals(Utils.gif) ||\r\n\t extension.equals(Utils.jpeg) ||\r\n\t extension.equals(Utils.jpg)||\r\n\t extension.equals(Utils.png)) {\r\n\t return true;\r\n\t } else {\r\n\t return false;\r\n\t }\r\n\t }\r\n\t \r\n\t return false;\r\n\t }", "public boolean hasImage(){\n return imageResourceID != NO_IMAGE_PROVIED;\n\n }", "public boolean isPic(){\n return this.isPic;\n }", "public boolean shouldImageProcess() {\r\n\t\treturn table.getBoolean(SHOULD_IMAGE_PROCESS_KEY, false);\r\n\t}", "public boolean validImageHeader() {\n\t\treturn input.validHeader(list.get(0));\n\t}", "public boolean isSetFileType() {\n return this.fileType != null;\n }", "@Override\r\n public boolean isFile() throws FileSystemException {\r\n // Use equals instead of == to avoid any class loader worries.\r\n return FileType.FILE.equals(this.getType());\r\n }", "public boolean hasImageByHandler() {\n return ((bitField0_ & 0x00001000) == 0x00001000);\n }", "public boolean hasImage() {\n return !getImageResourceIds().equals(\"\");\n }", "@Override\n public boolean isMyFileType(File file)\n {\n String lower = file.getName().toLowerCase();\n if (lower.endsWith(\".maz\") || lower.endsWith(\".mz2\"))\n return true;\n else\n return false;\n }", "boolean isThumbnail();", "public boolean hasImage() {\n return mImageResourceId != NO_IMAGE_PROVIDED;\n }", "public boolean hasImage() {\n return mImageResourceId != NO_IMAGE_PROVIDED;\n }", "public boolean isSetImg() {\n return this.img != null;\n }", "boolean isMotionImageryType();", "public boolean accept(File f)\n {\n\t\t\t\tif (fileTypeCB.getSelectedItem() == \"PNG\"){\n \n\t if(f.isDirectory())return true;\t\n\t else if(f.getName().endsWith(\".png\"))return true;\n\t \n }\n else if (fileTypeCB.getSelectedItem() == \"JPEG\"){\n \n\t if(f.isDirectory())return true;\t\n\t else if(f.getName().endsWith(\".jpg\"))return true;\n\t else if(f.getName().endsWith(\".jpeg\"))return true;\n\t \n }\n else if (fileTypeCB.getSelectedItem() == \"GIF\"){\n \n\t if(f.isDirectory())return true;\t\n\t else if(f.getName().endsWith(\".gif\"))return true;\n\t \n }\n else if (fileTypeCB.getSelectedItem() == \"BMP\"){\n \n\t if(f.isDirectory())return true;\t\n\t else if(f.getName().endsWith(\".bmp\"))return true;\n\t \n }\n else if (fileTypeCB.getSelectedItem() == \"TIFF\"){\n \n\t if(f.isDirectory())return true;\t\n\t else if(f.getName().endsWith(\".tiff\"))return true;\n\t \n }\n else if (fileTypeCB.getSelectedItem() == \"EPS\"){\n \n\t if(f.isDirectory())return true;\t\n\t else if(f.getName().endsWith(\".eps\"))return true;\n\t \n }\n else if (fileTypeCB.getSelectedItem() == \"SVG\"){\n \n\t if(f.isDirectory())return true;\t\n\t else if(f.getName().endsWith(\".svg\"))return true;\n\t \n }\n\t\t\t\t\n\t\t\t\treturn false;\n }", "private boolean isSupportedFile(Object fileObject) {\n\t\tif (fileObject instanceof IAdaptable)\n\t\t\treturn castToIFile(fileObject).getFileExtension().equals(TestCasePersister.FILE_EXTENSION);\n\t\t\t\n\t\treturn false;\n\t}", "public boolean hasImageByHandler() {\n return ((bitField0_ & 0x00004000) == 0x00004000);\n }", "public boolean isFile(String path);", "private boolean isImageSizeLegal(Uri uri) {\n //Get dimensions of image to check for size\n BitmapFactory.Options options = new BitmapFactory.Options();\n options.inJustDecodeBounds = true;\n ParcelFileDescriptor fd = null;\n try {\n fd = getContentResolver().openFileDescriptor(uri, \"r\");\n }\n catch (FileNotFoundException e) {\n // If the file doesn't exist just return false, shouldn't ever happen though\n return false;\n }\n // Loads file data into options\n BitmapFactory.decodeFileDescriptor(fd.getFileDescriptor(), null, options);\n int scale = BitmapConverter.calculateInSampleSize(options, MAX_IMAGE_UPLOAD_WIDTH,\n MAX_IMAGE_UPLOAD_HEIGHT);\n\n int width = options.outWidth / scale;\n int height = options.outHeight / scale;\n\n // If the image is too short\n if (height < MIN_IMAGE_UPLOAD_HEIGHT) {\n Toast.makeText(CreateGameActivity.this,\n String.format(getString(R.string.image_min_height), MIN_IMAGE_UPLOAD_HEIGHT),\n Toast.LENGTH_LONG).show();\n return false;\n }\n // If the image is too skinny\n else if (width < MIN_IMAGE_UPLOAD_WIDTH) {\n Toast.makeText(CreateGameActivity.this,\n String.format(getString(R.string.image_min_width), MIN_IMAGE_UPLOAD_WIDTH),\n Toast.LENGTH_LONG).show();\n return false;\n }\n // Otherwise the image is okay\n return true;\n }", "private boolean isFittingImage(GraphNode infoBitNode, Integer width, Integer height,\n boolean exact) {\n Lock readLock = infoBitNode.readLock();\n readLock.lock();\n try {\n final Iterator<Literal> mediaTypesIter = infoBitNode.getLiterals(DISCOBITS.mediaType);\n if (!mediaTypesIter.hasNext()) {\n return false;\n }\n if (mediaTypesIter.next().getLexicalForm().startsWith(\"image\")) {\n return getSurfaceSizeIfFitting(infoBitNode, width, height, exact) > -1;\n } else {\n return false;\n }\n } finally {\n readLock.unlock();\n }\n }", "boolean hasMimeType();", "boolean isFile(FsPath path);", "public boolean checkImageComponent(String filename) {\n if (componentMap.containsKey(filename))\n return true;\n else\n return false;\n }", "@Override\n public boolean isRenditionSupported(String mimeType) {\n return mimeType.startsWith(\"image/\");\n }", "public boolean hasImage() {\n return mImageResourceID != NO_IMAGE_PROVIDED;\n }", "boolean isPictureFormatSupported(int format);", "public boolean isSetFileType()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(FILETYPE$8) != 0;\n }\n }", "public boolean isImageAllowed() {\n return mIsImageAllowed;\n }", "@Override\r\n\t\t\tpublic boolean accept(File dir, String name) {\n\t\t\t\treturn isJpg(name); \r\n\t\t\t}", "@Override\r\n\tpublic boolean isFile(String path) {\n\t\treturn false;\r\n\t}", "public boolean hasImageByTransform() {\n return ((bitField0_ & 0x00000800) == 0x00000800);\n }", "boolean isImageDisplayed();", "public boolean isMakeImage() {\n return makeImage;\n }", "ImageType getType();", "private boolean validatePhotoTypes(List<Http.MultipartFormData.FilePart<TemporaryFile>> photos) {\n\n ArrayList<String> validFileTypes = new ArrayList<>();\n validFileTypes.add(\"image/jpeg\");\n validFileTypes.add(\"image/png\");\n\n for (Http.MultipartFormData.FilePart<TemporaryFile> photo : photos) {\n String contentType = photo.getContentType();\n\n if (!(validFileTypes.contains(contentType)))\n return false;\n }\n\n return true;\n }", "static public boolean isImageFormatSupported(String _format) {// for applet mode saveImage\r\n\t\ttry {\r\n\t\t\tString[] names = javax.imageio.ImageIO.getWriterFormatNames();\r\n\t\t\tfor (int i = 0; i < names.length; i++) {\r\n// System.out.println(\"Image format supported = \"+names[i]);\r\n\t\t\t\tif (names[i].equalsIgnoreCase(_format))\r\n\t\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t} catch (Exception ex) {\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "protected abstract boolean isSample(File file);", "public boolean hasImageByTransform() {\n return ((bitField0_ & 0x00001000) == 0x00001000);\n }", "@Override\n public boolean accept(File f) //SELECTING/ACCEPTING THE PARTICULAR FILES\n {\n if(f.isDirectory()) //ACCEPTS ALL DIRECTORY(E.G. C DRIVE)\n return true;\n\n String extension=f.getName().substring(f.getName().lastIndexOf(\".\")+1);//GETTING THE EXTENSION OF IMAGE NAME\n String allowed[]={\"jpg\",\"png\",\"gif\",\"jpeg\",\"bmp\"};\n for(String a:allowed)//FOR EACH LOOP\n {\n if(a.equals(extension))//IF EXTENSION MATCHES,,RETURN TRUE\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n return false;//IF ANYTHING ELSE RETURN FALSE\n }", "protected Boolean hasImageName(Object value) {\n\t return true;\n }", "public native boolean isAnimatedImage() throws MagickException;", "public boolean hasPicture() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }", "public boolean isFileByFile() {\n return fileByFile;\n }", "public String getDescription() {\r\n\t return \"Just accept image file\";\r\n\t }", "public boolean hasImage() {\n return mAttractionImageResourceID != NO_IMAGE_AVAILABLE;\n }", "private boolean getClassificationResult(String imgPath) {\n return false;\n }", "boolean hasPictureUri();", "public boolean hasPicture() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }", "private static boolean isSingleFile(final Context context, final String id)\n \t\tthrows FormatException, IOException\n \t{\n \t\tfinal String fileName =\n \t\t\tnew Location(context, id).getAbsoluteFile().getAbsolutePath();\n \t\tfinal RandomAccessInputStream ras =\n \t\t\tnew RandomAccessInputStream(context, fileName);\n \t\tfinal TiffParser tp = new TiffParser(context, ras);\n \t\tfinal IFD ifd = tp.getFirstIFD();\n \t\tfinal long[] ifdOffsets = tp.getIFDOffsets();\n \t\tras.close();\n \t\tfinal String xml = ifd.getComment();\n \n \t\tif (service == null) setupServices(context);\n \t\tOMEXMLMetadata meta;\n \t\ttry {\n \t\t\tmeta = service.createOMEXMLMetadata(xml);\n \t\t}\n \t\tcatch (final ServiceException se) {\n \t\t\tthrow new FormatException(se);\n \t\t}\n \n \t\tif (meta.getRoot() == null) {\n \t\t\tthrow new FormatException(\"Could not parse OME-XML from TIFF comment\");\n \t\t}\n \n \t\tint nImages = 0;\n \t\tfor (int i = 0; i < meta.getImageCount(); i++) {\n \t\t\tint nChannels = meta.getChannelCount(i);\n \t\t\tif (nChannels == 0) nChannels = 1;\n \t\t\tfinal int z = meta.getPixelsSizeZ(i).getValue().intValue();\n \t\t\tfinal int t = meta.getPixelsSizeT(i).getValue().intValue();\n \t\t\tnImages += z * t * nChannels;\n \t\t}\n \t\treturn nImages <= ifdOffsets.length;\n \t}", "public boolean isImageFormatSupported(String format) {\n if (format != null) {\n String[] formats = com.esri.mo2.map.img.ImageSupport.getListOfWriterByTypeName();\n for (int i=0; i<formats.length; i++)\n if (format.trim().compareToIgnoreCase(formats[i])==0) return true;\n }\n return false;\n }", "boolean safeIsFile(FsPath path);", "public static boolean supportedType(String filePath) {\n\t\tif (filePath.startsWith(\"file:///system/\")) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tboolean supported = false;\n\t\tString contentType = MIMETypeAssociations.getMIMEType(filePath);\n\t\t// Normalize and strip off parameters\n\t\tString normalizedContentType = MIMETypeAssociations\n\t\t\t\t.getNormalizedType(contentType);\n\t\tswitch (MIMETypeAssociations\n\t\t\t\t.getMediaTypeFromMIMEType(normalizedContentType)) {\n\t\tcase MIMETypeAssociations.MEDIA_TYPE_IMAGE:\n\t\t\t// case MIMETypeAssociations.MEDIA_TYPE_AUDIO:\n\t\t\t// case MIMETypeAssociations.MEDIA_TYPE_VIDEO:\n\t\t\tsupported = true;\n\t\t\tbreak;\n\t\t}\n\t\treturn supported;\n\t}", "@Test\n\tpublic void obtenerMimeTypeTest() {\n\t\tArchivo ar = new Imagen(\"test\", \"contenido\");\n\t\tassertEquals(\"image/png\", ar.obtenerMimeType());\n\t}", "public boolean isSupportedFile(String fileName)\r\n {\r\n return fileName.toLowerCase().endsWith(\".gtf\");\r\n }", "private boolean checkBarcodeImg(Barcode barcode) {\n//\t\tif(barcode.getImg())\n\t\treturn true;\n\t}", "public boolean mo12928a(Model model) {\n return model.toString().startsWith(\"data:image\");\n }", "public boolean canEncodeImage(ImageTypeSpecifier type)\n throws IllegalArgumentException\n {\n return true;\n }", "public boolean isRegularFile() {\n\t\treturn isRegularFile;\n\t}", "public boolean validateImages()\n {\n initializeImageCheckList();\n checkImagesForDuplicates();\n if (extractionResult.getInvalidFiles().size() > 0)\n {\n throw UserFailureException.fromTemplate(\"Following invalid files %s have been found.\",\n CollectionUtils.abbreviate(extractionResult.getInvalidFiles(), 10));\n }\n if (extractionResult.getImages().size() == 0)\n {\n throw UserFailureException.fromTemplate(\n \"No extractable files were found inside a dataset '%s'.\"\n + \" Have you changed your naming convention?\",\n incomingDataSetDirectory.getAbsolutePath());\n }\n return checkCompleteness();\n }", "private boolean isValidJpegHeaderBytes(RandomAccessFile file) throws IOException {\n\t\tbyte[] header = new byte[2];\n\t\tfile.read(header, 0, 2);\n\t\treturn (header[0] & 0xFF) == 0xFF && (header[1] & 0xFF) == 0xD8;\n\t}", "boolean hasMediaFile();", "public static void regex(){ \n\t\tPattern pattern = Pattern.compile(\"^.*[.](png|gif|jpg|jpeg|bmp|tif|psd|ICO)$\");\n\t\t Matcher matcher = pattern.matcher(\"/gxps/photo/upload/20160527175815_172.jpg\");\n\t\t \n\t\tboolean b= matcher.matches();\n\t\t //当条件满足时,将返回true,否则返回false\n\t\t System.out.println(b);\n\t\t \n\t}" ]
[ "0.79321057", "0.7875473", "0.7800246", "0.7379953", "0.73147", "0.7257706", "0.718502", "0.7085752", "0.67802286", "0.6753648", "0.6725081", "0.6632555", "0.65914714", "0.654003", "0.65396625", "0.6528686", "0.6517389", "0.64945585", "0.64634943", "0.6444076", "0.64341384", "0.64241725", "0.6402906", "0.6394443", "0.6390598", "0.63818264", "0.6358838", "0.63536453", "0.6328699", "0.6295103", "0.62927735", "0.6291536", "0.62897164", "0.62896776", "0.62725556", "0.62708586", "0.6261598", "0.62499726", "0.6220474", "0.6200432", "0.61896914", "0.6172018", "0.6147676", "0.61053085", "0.6105236", "0.6105171", "0.6102452", "0.6068132", "0.6063133", "0.6063133", "0.6054536", "0.60393006", "0.6036523", "0.60300446", "0.60252213", "0.6018221", "0.59977597", "0.59903514", "0.5989545", "0.5977325", "0.5971161", "0.59577656", "0.5951257", "0.59426177", "0.592877", "0.5927601", "0.5924544", "0.59111565", "0.59002745", "0.5895211", "0.58727074", "0.58684057", "0.58476114", "0.58313787", "0.58203393", "0.58173525", "0.5806576", "0.57822084", "0.5781785", "0.57475495", "0.5744593", "0.5743041", "0.57301617", "0.5727196", "0.5717304", "0.57098407", "0.5707131", "0.5705984", "0.57057863", "0.56925315", "0.5682024", "0.56739634", "0.56721395", "0.5669366", "0.56662965", "0.5652256", "0.56417936", "0.56268644", "0.5619976", "0.5598856" ]
0.8187062
0
Updates imagesInDirectory with all the imageFiles in directory
private void fillImagesInDirectory() throws IOException { // get the list of all files (including directories) in the directory of interest File[] fileArray = directory.listFiles(); assert fileArray != null; for (File file : fileArray) { // the file is an image, then add it if (isImage(file)) { ImageFile imageFile = new ImageFile(file.getAbsolutePath()); // if the image is already saved, reuse it if (centralController.getImageFileController().hasImageFile(imageFile)) { imagesInDirectory.add(centralController.getImageFileController().getImageFile(imageFile)); } else { imagesInDirectory.add(imageFile); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void fillAllImagesUnderDirectory(File directory) throws IOException {\n // get the list of all files (including directories) in the directory of interest\n File[] fileArray = directory.listFiles();\n assert fileArray != null;\n\n for (File file : fileArray) {\n // if the file is an image, then add it\n if (isImage(file)) {\n ImageFile imageFile = new ImageFile(file.getAbsolutePath());\n // if the image is already saved, reuse it\n if (centralController.getImageFileController().hasImageFile(imageFile)) {\n allImagesUnderDirectory\n .add(centralController.getImageFileController().getImageFile(imageFile));\n } else if (imagesInDirectory.contains(imageFile)) {\n allImagesUnderDirectory.add(imagesInDirectory.get(imagesInDirectory.indexOf(imageFile)));\n } else {\n allImagesUnderDirectory.add(imageFile);\n }\n } else if (file.isDirectory()) {\n fillAllImagesUnderDirectory(file);\n }\n }\n }", "private static void loadImagesInDirectory(String dir){\n\t\tFile file = new File(Files.localize(\"images\\\\\"+dir));\n\t\tassert file.isDirectory();\n\t\n\t\tFile[] files = file.listFiles();\n\t\tfor(File f : files){\n\t\t\tif(isImageFile(f)){\n\t\t\t\tString name = dir+\"\\\\\"+f.getName();\n\t\t\t\tint i = name.lastIndexOf('.');\n\t\t\t\tassert i != -1;\n\t\t\t\tname = name.substring(0, i).replaceAll(\"\\\\\\\\\", \"/\");\n\t\t\t\t//Image image = load(f,true);\n\t\t\t\tImageIcon image;\n\t\t\t\tFile f2 = new File(f.getAbsolutePath()+\".anim\");\n\t\t\t\tif(f2.exists()){\n\t\t\t\t\timage = evaluateAnimFile(dir,f2,load(f,true));\n\t\t\t\t}else{\n\t\t\t\t\timage = new ImageIcon(f.getAbsolutePath());\n\t\t\t\t}\n\t\t\t\tdebug(\"Loaded image \"+name+\" as \"+f.getAbsolutePath());\n\t\t\t\timages.put(name, image);\n\t\t\t}else if(f.isDirectory()){\n\t\t\t\tloadImagesInDirectory(dir+\"\\\\\"+f.getName());\n\t\t\t}\n\t\t}\n\t}", "public void populateCachedImages(File dir)\n {\n if (dir.exists())\n {\n File[] files = dir.listFiles();\n for (int i = 0; i < files.length; i++)\n {\n File file = files[i];\n if (!file.isDirectory())\n {\n //Record all filenames from the cache so we know which photos to retrieve from database\n cachedFileNames.add(file.getName());\n imageList.add(file);\n }\n }\n }\n }", "public ArrayList<ImageFile> getAllImagesUnderDirectory() throws IOException {\n return allImagesUnderDirectory;\n }", "public ListImages(File directoryOfInterest, CentralController centralController)\n throws IOException {\n\n this.centralController = centralController;\n\n directory = directoryOfInterest;\n imagesInDirectory = new ArrayList<>();\n allImagesUnderDirectory = new ArrayList<>();\n\n // updates the imagesInDirectory list\n fillImagesInDirectory();\n\n // updates the allImagesUnderDirectory list\n fillAllImagesUnderDirectory(directory);\n }", "public ArrayList<ImageFile> getImagesInDirectory() throws IOException {\n\n return imagesInDirectory;\n }", "public void addObserversToImageFiles(Observer observer) {\n for (ImageFile imageFile : allImagesUnderDirectory) {\n imageFile.addObserver(observer);\n }\n }", "private BufferedImage[] loadImages(String directory, BufferedImage[] img) throws Exception {\n\t\tFile dir = new File(directory);\n\t\tFile[] files = dir.listFiles();\n\t\tArrays.sort(files, (s, t) -> s.getName().compareTo(t.getName()));\n\t\t\n\t\timg = new BufferedImage[files.length];\n\t\tfor (int i = 0; i < files.length; i++) {\n\t\t\timg[i] = ImageIO.read(files[i]);\n\t\t}\n\t\treturn img;\n\t}", "public void initializeImages() {\n\n File dir = new File(\"Images\");\n if (!dir.exists()) {\n boolean success = dir.mkdir();\n System.out.println(\"Images directory created!\");\n }\n }", "public void saveImagesFolder(final Path path_of_resource) throws IOException {\n final Path path = path_of_resource;\n Set<String> listImages = new HashSet<>();\n listImages = listFiles(path);\n List<String> found = new ArrayList<>();\n Iterator<Image> image_it = imageRepository.findAll().iterator();\n // Filter images that have the same name in the db and the images in the\n // resource folder.\n while (image_it.hasNext()) {\n Image next_i = image_it.next();\n Iterator<String> list_it = listImages.iterator();\n while (list_it.hasNext()) {\n String next_s = list_it.next();\n if (next_i.getName().equals(Paths.get(next_s).getFileName().toString()))\n found.add(next_s);\n }\n }\n listImages.removeAll(found);\n System.out.println(listImages);\n listImages.forEach(i -> {\n try {\n final byte[] fileContent = Files.readAllBytes(Paths.get(i));\n Image image = new Image(Paths.get(i).getFileName().toString(), fileContent,\n Utils.typeOfFile(Paths.get(i)), Utils.sizeOfImage(Paths.get(i)));\n image.setIsNew(false);\n imageRepository.save(image);\n\n } catch (final IOException e) {\n e.printStackTrace();\n }\n });\n }", "private void loadImages() {\n\t\ttry {\n\t\t\tall_images = new Bitmap[img_files.length];\n\t\t\tfor (int i = 0; i < all_images.length; i++) {\n\t\t\t\tall_images[i] = loadImage(img_files[i] + \".jpg\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tToast.makeText(this, \"Unable to load images\", Toast.LENGTH_LONG)\n\t\t\t\t\t.show();\n\t\t\tfinish();\n\t\t}\n\t}", "private void processImages() throws MalformedURLException, IOException {\r\n\r\n\t\tNodeFilter imageFilter = new NodeClassFilter(ImageTag.class);\r\n\t\timageList = fullList.extractAllNodesThatMatch(imageFilter, true);\r\n\t\tthePageImages = new HashMap<String, byte[]>();\r\n\r\n\t\tfor (SimpleNodeIterator nodeIter = imageList.elements(); nodeIter\r\n\t\t\t\t.hasMoreNodes();) {\r\n\t\t\tImageTag tempNode = (ImageTag) nodeIter.nextNode();\r\n\t\t\tString tagText = tempNode.getText();\r\n\r\n\t\t\t// Populate imageUrlText String\r\n\t\t\tString imageUrlText = tempNode.getImageURL();\r\n\r\n\t\t\tif (imageUrlText != \"\") {\r\n\t\t\t\t// Print to console, to verify relative link processing\r\n\t\t\t\tSystem.out.println(\"ImageUrl to Retrieve:\" + imageUrlText);\r\n\r\n\t\t\t\tbyte[] imgArray = downloadBinaryData(imageUrlText);\r\n\r\n\t\t\t\tthePageImages.put(tagText, imgArray);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public static List<InputStream> getAllImages(){\n\t\treturn IOHandler.getResourcesIn(IMAGES_DIR);\n\t}", "public void setImageDir(File imageRepDir) {\n\t\tFileDataPersister.getInstance().put(\"gui.configuration\", \"image.repository\", imageRepDir.getPath());\n\t\tRepository.getInstance().setRepository(imageRepDir);\n\t\tthis.getSelectedGraphEditor().repaint();\n\t}", "private void updateFiles() {\n\t}", "public void populateImages() {\n\t\t// Check if the recipe has any images saved on the sd card and get\n\t\t// the bitmap for the imagebutton\n\n\t\tArrayList<Image> images = ImageController.getAllRecipeImages(\n\t\t\t\tcurrentRecipe.getRecipeId(), currentRecipe.location);\n\n\t\tLog.w(\"*****\", \"outside\");\n\t\tLog.w(\"*****\", String.valueOf(currentRecipe.getRecipeId()));\n\t\tLog.w(\"*****\", String.valueOf(currentRecipe.location));\n\t\tImageButton pictureButton = (ImageButton) findViewById(R.id.ibRecipe);\n\n\t\t// Set the image of the imagebutton to the first image in the folder\n\t\tif (images.size() > 0) {\n\t\t\tpictureButton.setImageBitmap(images.get(0).getBitmap());\n\t\t}\n\n\t}", "private void loadImages(BufferedImage[] images, String direction) {\n for (int i = 0; i < images.length; i++) {\n String fileName = direction + (i + 1);\n images[i] = GameManager.getResources().getMonsterImages().get(\n fileName);\n }\n\n }", "abstract public void setImageResourcesDir(String path);", "private static ArrayList<String> getImagesInFileSystem() {\n\t\t// get file list in database\n\t\tArrayList<String> fileNameList = new ArrayList<String>();\n\t\t\n\t\tFile folder = new File(IMAGE_DIRECTORY);\n\t File[] listOfFiles = folder.listFiles();\n\t \n\t for (File currFile : listOfFiles) {\n\t if (currFile.isFile() && !currFile.getName().startsWith(\".\")) {\n\t \t fileNameList.add(currFile.getName());\n\t }\n\t }\n\t \n\t return fileNameList;\n\t}", "private void addImgList() {\n\t\tdogImg.add(\"./data/img/labrador.jpg\");\t\t\t\t\n\t\tdogImg.add(\"./data/img/germanshepherd.jpg\");\t\n\t\tdogImg.add(\"./data/img/bulldog.jpg\");\t\t\t\t\t\t\t\t\n\t\tdogImg.add(\"./data/img/rottweiler.jpg\");\n\t\tdogImg.add(\"./data/img/husky.jpg\");\n\n\t}", "public ArrayList<ImageFile> getImageFiles() {\n return new ArrayList<>(imageFiles);\n }", "private static void displayImagesDir(){\n System.out.println(IMAGES_DIR);\n }", "public void setImages() {\n\n imgBlock.removeAll();\n imgBlock.revalidate();\n imgBlock.repaint();\n labels = new JLabel[imgs.length];\n for (int i = 0; i < imgs.length; i++) {\n\n labels[i] = new JLabel(new ImageIcon(Toolkit.getDefaultToolkit().createImage(imgs[i].getSource())));\n imgBlock.add(labels[i]);\n\n }\n\n SwingUtilities.updateComponentTreeUI(jf); // refresh\n initialized = true;\n\n }", "public List<Image> getAllImages() {\n\t\treturn list;\n\t}", "public static void searchForImageReferences(File rootDir, FilenameFilter fileFilter) {\n \t\tfor (File file : rootDir.listFiles()) {\n \t\t\tif (file.isDirectory()) {\n \t\t\t\tsearchForImageReferences(file, fileFilter);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\ttry {\n \t\t\t\tif (fileFilter.accept(rootDir, file.getName())) {\n \t\t\t\t\tif (MapTool.getFrame() != null) {\n \t\t\t\t\t\tMapTool.getFrame().setStatusMessage(\"Caching image reference: \" + file.getName());\n \t\t\t\t\t}\n \t\t\t\t\trememberLocalImageReference(file);\n \t\t\t\t}\n \t\t\t} catch (IOException ioe) {\n \t\t\t\tioe.printStackTrace();\n \t\t\t}\n \t\t}\n \t\t// Done\n \t\tif (MapTool.getFrame() != null) {\n \t\t\tMapTool.getFrame().setStatusMessage(\"\");\n \t\t}\n \t}", "public void getImagesFromFolder() {\n File file = new File(Environment.getExternalStorageDirectory().toString() + \"/saveclick\");\n if (file.isDirectory()) {\n fileList = file.listFiles();\n for (int i = 0; i < fileList.length; i++) {\n files.add(fileList[i].getAbsolutePath());\n Log.i(\"listVideos\", \"file\" + fileList[0]);\n }\n }\n }", "public void treatAllPhotos() throws IllegalArgumentException {\n for(Long currentID : idsToTest){\n String pathToPhoto = \"photo\\\\\" + currentID.toString();\n File currentPhotosFile = new File(pathToPhoto);\n\n if(currentPhotosFile.exists() && currentPhotosFile.isDirectory()){\n\n File[] listFiles = currentPhotosFile.listFiles();\n\n for(File file : listFiles){\n if (!file.getName().endsWith(\".pgm\")) { //search how to convert all image to .pgm\n throw new IllegalArgumentException(\"The file of the student \" + currentID + \" contains other files than '.pgm'.\");\n }\n else{\n Mat photoToTreat = Imgcodecs.imread(pathToPhoto + \"\\\\\" + file.getName(), Imgcodecs.IMREAD_GRAYSCALE);\n Mat treatedPhoto = recoApp.imageTreatment(photoToTreat);\n if(treatedPhoto != null){\n Imgcodecs.imwrite(pathToPhoto + \"\\\\\" + file.getName(), treatedPhoto);\n }\n }\n }\n }\n else{\n throw new IllegalArgumentException(\"The file of the student \" + currentID + \" do not exist or is not a directory.\");\n }\n }\n }", "private void loadImages() {\n\t\ttry {\n\t\t\timage = ImageIO.read(Pillar.class.getResource(\"/Items/Pillar.png\"));\n\t\t\tscaledImage = image;\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Failed to read Pillar image file: \" + e.getMessage());\n\t\t}\n\t}", "private void initializeImageModels() {\n for(ImageModel model : GalleryFragment.listImageModel){\n imgList.add(model.getImagePath());\n }\n }", "public void refreshImages() {\n\t\tsetContentView(R.layout.activity_overview);\n\t\trow = 0;\n\t\tcolumn = 0;\n\t\t// Open the file\n\t\tFile file = new File(getFilesDir().getAbsoluteFile() + \"/photos.txt\");\n\t\tLog.i(TAG, file.getAbsolutePath());\n\t\t// If there is no file, create a new one\n\t\tif (!file.exists()) {\n\t\t\ttry {\n\t\t\t\tfile.createNewFile();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\t// Open an inputStream for reading the file\n\t\t\tFileInputStream inStream = openFileInput(\"photos.txt\");\n\t\t\tBufferedReader readFile = new BufferedReader(new InputStreamReader(inStream));\n\t\t\tpicturePaths = new ArrayList<String>();\n\t\t\tString receiveString = \"\";\n\t\t\t// Read in each line\n\t\t\twhile ((receiveString = readFile.readLine()) != null) {\n\t\t\t\t// Add the line to picturePaths and add an Image with the path specified\n\t\t\t\tpicturePaths.add(receiveString);\n\t\t\t\tLog.i(\"picture\", receiveString);\n\t\t\t\taddImage(receiveString);\n\t\t\t\treceiveString = \"\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void addNodesImages(IndexNode node)\n {\n int maxImages = spider.getConfig().getMaxImages();\n int n = Math.min(node.getImages().size(), maxImages);\n Iterator<String> iter = node.getImages().iterator();\n int numResultsPerPage = getResultsPerPage();\n \n for(int i = 0; i < n && currentSearchImages.size() <= numResultsPerPage; i++)\n {\n try\n {\n String image_url = iter.next();\n BufferedImage image = ImageIO.read(new URL(image_url));\n \n currentSearchImages.add(new ImageNode(image_url, image));\n }\n \n catch(IOException e) {}\n }\n }", "private void processImages(List<String> images) {\n setTitle(\"Showing images\");\n mImages = images;\n setListAdapter(new ImagesAdapter());\n }", "@Override\n public void onChanged(@Nullable final List<Image> images) {\n adapter.setImages(images);\n }", "public void listFilesFromDirectory(Path path, List<UpdateFile> updateFileList) {\n try (DirectoryStream<Path> stream = Files.newDirectoryStream(path)) {\n for (Path currentPath : stream)\n if (!Files.isDirectory(currentPath)) {\n UpdateFile updateFile = new UpdateFile();\n File file = currentPath.toFile();\n updateFile.setFilePath(cutPrefixFromFilePath(file.getPath()));\n updateFile.setLastModified(String.valueOf(file.lastModified()));\n updateFileList.add(updateFile);\n } else listFilesFromDirectory(currentPath, updateFileList);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void loadStateImages() {\n\t\tif (imageFilename[0][0] != null)\n\t\t\tthis.addStateImage(imageFilename[0][0], 0, 0);\n\t\tif (imageFilename[0][1] != null)\n\t\t\tthis.addStateImage(imageFilename[0][1], 1, 0);\n\t\tif (imageFilename[1][0] != null)\n\t\t\tthis.addStateImage(imageFilename[1][0], 0, 1);\n\t\tif (imageFilename[1][1] != null)\n\t\t\tthis.addStateImage(imageFilename[1][1], 1, 1);\n\t}", "public static void main(String[] args) {\n try {\n File dataFolder = new File(\"data\");\n for (File imageFile : dataFolder.listFiles()) {\n BufferedImage bufferedImage = ImageIO.read(imageFile);\n ImageProcessor.instance.processImage(bufferedImage, imageFile.getName());\n }\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "public void updateImageForIndex(int index) {\n\t\t//Nothing to do\n\t}", "private void loadImages(){\n try{\n System.out.println(System.getProperty(\"user.dir\"));\n\n t1img = read(new File(\"resources/tank1.png\"));\n t2img = read(new File(\"resources/tank1.png\"));\n backgroundImg = read(new File(\"resources/background.jpg\"));\n wall1 = read(new File(\"resources/Wall1.gif\"));\n wall2 = read(new File(\"resources/Wall2.gif\"));\n heart = resize(read(new File(\"resources/Hearts/basic/heart.png\")), 35,35);\n heart2 = resize(read( new File(\"resources/Hearts/basic/heart.png\")), 25,25);\n bullet1 = read(new File(\"resources/bullet1.png\"));\n bullet2 = read(new File(\"resources/bullet2.png\"));\n\n }\n catch(IOException e){\n System.out.println(e.getMessage());\n }\n }", "private void loadAndCacheImages(Node node, FileContext cachedImageFilesystem) throws Exception\n {\n String imagePathBase = \"/\" + node.getTypeCode() + \"/\" + node.getNid();\n ImagesReponse imagesReponse = this.queryRemoteApi(ImagesReponse.class, imagePathBase + ImagesReponse.PATH, null);\n if (imagesReponse != null && imagesReponse.getNodes() != null && imagesReponse.getNodes().getNode() != null) {\n for (Image i : imagesReponse.getNodes().getNode()) {\n node.addImage(i);\n\n URI imageUri = UriBuilder.fromUri(Settings.instance().getTpAccessApiBaseUrl())\n .path(BASE_PATH)\n .path(imagePathBase + \"/image/\" + i.getData().mediaObjectId + \"/original\")\n .replaceQueryParam(ACCESS_TOKEN_PARAM, this.getAccessToken())\n .replaceQueryParam(FORMAT_PARAM, FORMAT_JSON)\n .build();\n\n ClientConfig config = new ClientConfig();\n Client httpClient = ClientBuilder.newClient(config);\n Response response = httpClient.target(imageUri).request().get();\n if (response.getStatus() == Response.Status.OK.getStatusCode()) {\n org.apache.hadoop.fs.Path nodeImages = new org.apache.hadoop.fs.Path(HDFS_CACHE_ROOT_PATH + node.getNid());\n if (!cachedImageFilesystem.util().exists(nodeImages)) {\n cachedImageFilesystem.mkdir(nodeImages, FsPermission.getDirDefault(), true);\n }\n org.apache.hadoop.fs.Path cachedImage = new org.apache.hadoop.fs.Path(nodeImages, i.getData().mediaObjectId);\n i.setCachedUrl(cachedImage.toUri());\n if (!cachedImageFilesystem.util().exists(cachedImage)) {\n try (OutputStream os = cachedImageFilesystem.create(cachedImage, EnumSet.of(CreateFlag.CREATE, CreateFlag.OVERWRITE))) {\n IOUtils.copy(response.readEntity(InputStream.class), os);\n }\n }\n }\n else {\n throw new IOException(\"Error status returned while fetching remote API data;\" + response);\n }\n\n }\n }\n }", "private ArrayList<String> getImagesPathList() {\n String MEDIA_IMAGES_PATH = \"CuraContents/images\";\n File fileImages = new File(Environment.getExternalStorageDirectory(), MEDIA_IMAGES_PATH);\n if (fileImages.isDirectory()) {\n File[] listImagesFile = fileImages.listFiles();\n ArrayList<String> imageFilesPathList = new ArrayList<>();\n for (File file1 : listImagesFile) {\n imageFilesPathList.add(file1.getAbsolutePath());\n }\n return imageFilesPathList;\n }\n return null;\n }", "public Builder setImages(Image... images) {\n this.images = images;\n return this;\n }", "public void updateImage(GameObject.Direction direction) {\n switch (direction) {\n case NORTH:\n currentImage = north;\n break;\n\n case SOUTH:\n currentImage = south;\n break;\n\n case WEST:\n currentImage = west;\n break;\n\n case EAST:\n currentImage = east;\n break;\n }\n }", "public void setImages(byte[] images) {\n this.images = images;\n }", "public void findImages() {\n \t\tthis.mNoteItemModel.findImages(this.mNoteItemModel.getContent());\n \t}", "public static void loadImages() {\n PonySprite.loadImages(imgKey, \"graphics/ponies/GrannySmith.png\");\n }", "public void createImages(){\n for(String s : allPlayerMoves){\n String a = \"Left\";\n for(int i = 0; i < 2; i++) {\n ArrayList<Image> tempImg = new ArrayList();\n boolean done = false;\n int j = 1;\n while(!done){\n try{\n tempImg.add(ImageIO.read(new File(pathToImageFolder+s+a+j+\".png\")));\n j++;\n } catch (IOException ex) {\n done = true;\n }\n }\n String temp = s.replace(\"/\",\"\") + a;\n playerImages.put(temp, tempImg);\n a = \"Right\";\n }\n }\n imagesCreated = true;\n }", "public void reloadFiles()\n {\n for (Reloadable rel : reloadables)\n {\n rel.reload();\n }\n }", "public ImageFiles() {\n\t\tthis.listOne = new ArrayList<String>();\n\t\tthis.listTwo = new ArrayList<String>();\n\t\tthis.listThree = new ArrayList<String>();\n\t\tthis.seenImages = new ArrayList<String>();\n\t\tthis.unseenImages = new ArrayList<String>();\n\t}", "public void loadImages() {\n\t\tcowLeft1 = new ImageIcon(\"images/animal/cow1left.png\");\n\t\tcowLeft2 = new ImageIcon(\"images/animal/cow2left.png\");\n\t\tcowLeft3 = new ImageIcon(\"images/animal/cow1left.png\");\n\t\tcowRight1 = new ImageIcon(\"images/animal/cow1right.png\");\n\t\tcowRight2 = new ImageIcon(\"images/animal/cow2right.png\");\n\t\tcowRight3 = new ImageIcon(\"images/animal/cow1right.png\");\n\t}", "public void setImages(MimsPlus[] images) {\n this.images = images;\n }", "public void testImagesDirectoryAccessible() {\n File file = new File(rootBlog.getRoot(), \"images\");\n assertEquals(file, new File(rootBlog.getImagesDirectory()));\n assertTrue(file.exists());\n }", "static public ObservableList<ImageMetaInfo> getImagesInfo(File path) {\n ObservableList<ImageMetaInfo> observableList = FXCollections.observableArrayList();\n ExtFilter fileFilter = new ExtFilter();\n File[] imageFilesArray = path.listFiles(fileFilter);\n for (File file : imageFilesArray) {\n ImageMetaInfo imageMetaInfo = getImageMetaInfo(file);\n observableList.add(imageMetaInfo);\n }\n return observableList;\n }", "private void getImagesFromServer() {\n trObtainAllPetImages.setUser(user);\n trObtainAllPetImages.execute();\n Map<String, byte[]> petImages = trObtainAllPetImages.getResult();\n Set<String> names = petImages.keySet();\n\n for (String petName : names) {\n byte[] bytes = petImages.get(petName);\n Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, Objects.requireNonNull(bytes).length);\n int index = user.getPets().indexOf(new Pet(petName));\n user.getPets().get(index).setProfileImage(bitmap);\n ImageManager.writeImage(ImageManager.PET_PROFILE_IMAGES_PATH, user.getUsername() + '_' + petName, bytes);\n }\n }", "@Override\n\tpublic List<Image> findAll() {\n\t\treturn imageRepository.findAll();\n\t}", "public void setImages(String images) {\n\t\tthis.images = images;\n\t}", "private void importImages() {\n\n\t\t// Create array of the images. Each image pixel map contains\n\t\t// multiple images of the animate at different time steps\n\n\t\t// Eclipse will look for <path/to/project>/bin/<relative path specified>\n\t\tString img_file_base = \"Game_Sprites/\";\n\t\tString ext = \".png\";\n\n\t\t// Load background\n\t\tbackground = createImage(img_file_base + \"Underwater\" + ext);\n\t}", "public static void loadImages()\n \t{\n \t\tSystem.out.print(\"Loading images... \");\n \t\t\n \t\tallImages = new TreeMap<ImageEnum, ImageIcon>();\n \t\t\n \t\ttry {\n \t\taddImage(ImageEnum.RAISIN, \"images/parts/raisin.png\");\n \t\taddImage(ImageEnum.NUT, \"images/parts/nut.png\");\n \t\taddImage(ImageEnum.PUFF_CHOCOLATE, \"images/parts/puff_chocolate.png\");\n \t\taddImage(ImageEnum.PUFF_CORN, \"images/parts/puff_corn.png\");\n \t\taddImage(ImageEnum.BANANA, \"images/parts/banana.png\");\n \t\taddImage(ImageEnum.CHEERIO, \"images/parts/cheerio.png\");\n \t\taddImage(ImageEnum.CINNATOAST, \"images/parts/cinnatoast.png\");\n\t\taddImage(ImageEnum.CORNFLAKE, \"images/parts/flake_corn.png\");\n \t\taddImage(ImageEnum.FLAKE_BRAN, \"images/parts/flake_bran.png\");\n \t\taddImage(ImageEnum.GOLDGRAHAM, \"images/parts/goldgraham.png\");\n \t\taddImage(ImageEnum.STRAWBERRY, \"images/parts/strawberry.png\");\n \t\t\n \t\taddImage(ImageEnum.PART_ROBOT_HAND, \"images/robots/part_robot_hand.png\");\n \t\taddImage(ImageEnum.KIT_ROBOT_HAND, \"images/robots/kit_robot_hand.png\");\n \t\taddImage(ImageEnum.ROBOT_ARM_1, \"images/robots/robot_arm_1.png\");\n \t\taddImage(ImageEnum.ROBOT_BASE, \"images/robots/robot_base.png\");\n \t\taddImage(ImageEnum.ROBOT_RAIL, \"images/robots/robot_rail.png\");\n \t\t\n \t\taddImage(ImageEnum.KIT, \"images/kit/empty_kit.png\");\n \t\taddImage(ImageEnum.KIT_TABLE, \"images/kit/kit_table.png\");\n \t\taddImage(ImageEnum.KITPORT, \"images/kit/kitport.png\");\n \t\taddImage(ImageEnum.KITPORT_HOOD_IN, \"images/kit/kitport_hood_in.png\");\n \t\taddImage(ImageEnum.KITPORT_HOOD_OUT, \"images/kit/kitport_hood_out.png\");\n \t\taddImage(ImageEnum.PALLET, \"images/kit/pallet.png\");\n \t\t\n \t\taddImage(ImageEnum.FEEDER, \"images/lane/feeder.png\");\n \t\taddImage(ImageEnum.LANE, \"images/lane/lane.png\");\n \t\taddImage(ImageEnum.NEST, \"images/lane/nest.png\");\n \t\taddImage(ImageEnum.DIVERTER, \"images/lane/diverter.png\");\n \t\taddImage(ImageEnum.DIVERTER_ARM, \"images/lane/diverter_arm.png\");\n \t\taddImage(ImageEnum.PARTS_BOX, \"images/lane/partsbox.png\");\n \t\t\n \t\taddImage(ImageEnum.CAMERA_FLASH, \"images/misc/camera_flash.png\");\n \t\taddImage(ImageEnum.SHADOW1, \"images/misc/shadow1.png\");\n \t\taddImage(ImageEnum.SHADOW2, \"images/misc/shadow2.png\");\n \t\t\n \t\taddImage(ImageEnum.GANTRY_BASE, \"images/gantry/gantry_base.png\");\n \t\taddImage(ImageEnum.GANTRY_CRANE, \"images/gantry/gantry_crane.png\");\n \t\taddImage(ImageEnum.GANTRY_TRUSS_H, \"images/gantry/gantry_truss_h.png\");\n \t\taddImage(ImageEnum.GANTRY_TRUSS_V, \"images/gantry/gantry_truss_v.png\");\n \t\taddImage(ImageEnum.GANTRY_WHEEL, \"images/gantry/gantry_wheel.png\");\n \t\t} catch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t\tSystem.exit(1);\n \t\t}\n \t\tSystem.out.println(\"Done\");\n \t}", "private void loadImages(FollowersResponse response) throws IOException {\n for(User user : response.getFollowers()) {\n byte [] bytes = ByteArrayUtils.bytesFromUrl(user.getImageUrl());\n user.setImageBytes(bytes);\n }\n }", "public void writeToDir() {\n\t\ttry{\n\t\t\tString dirPath = Paths.get(\".\").toAbsolutePath().normalize().toString()+\"/\";\n\t\t\tString path = dirPath + filename; //get server dir path\n\t\t\tSystem.out.println(\"output file path is: \" + path);\n\t\t\tFileOutputStream out = new FileOutputStream(path);\n out.write(img);\n out.close();\n PL.fsync();\n\t\t}catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "static public void addImage(AppImage image) {\n boolean already_exists = false;\n for (AppImage cached_image : images) {\n String reposited_path = cached_image.file.getAbsolutePath();\n String image_path = image.file.getAbsolutePath();\n if (reposited_path.equals(image_path)) {\n already_exists = true;\n }\n }\n if (!already_exists) images.add(0, image);\n }", "private void getAllJarFiles(File dir, ArrayList fileList)\n\t{\n\t\tif (dir.exists() && dir.isDirectory())\n\t\t{\n\t\t\tFile[] files = dir.listFiles();\n\t\t\tif (files == null)\n\t\t\t\treturn;\n\n\t\t\tfor (int i = 0; i < files.length; i++)\n\t\t\t{\n\t\t\t\tFile file = files[i];\n\t\t\t\tif (file.isFile())\n\t\t\t\t{\n\t\t\t\t\tif (file.getName().endsWith(\".jar\")) //$NON-NLS-1$\n\t\t\t\t\t\tfileList.add(file);\n\t\t\t\t}\n\t\t\t\telse if (file.isDirectory())\n\t\t\t\t{\n\t\t\t\t\tgetAllJarFiles(file, fileList);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void cleanup(Set<String> currentImages) {\n if (currentImages.size() == 0) return;\n\n Set<String> currentFiles = new HashSet<String>(currentImages.size());\n for (String url : currentImages) currentFiles.add(getFileName(url));\n File[] files = cacheDir.listFiles();\n if (files == null) return;\n for (File f : files) {\n long timestamp = f.lastModified();\n if ((System.currentTimeMillis() > (timestamp + MAX_FILE_AGE_MILLIS)) ||\n (!currentFiles.contains(f.getName()))) {\n f.delete();\n }\n }\n }", "@Override\n\tpublic List<Image> findAllImage() {\n\t\treturn new ImageDaoImpl().findAllImage();\n\t}", "protected abstract void setupImages(Context context);", "List<IbeisImage> uploadImages(List<File> images) throws UnsupportedImageFileTypeException, IOException,\n MalformedHttpRequestException, UnsuccessfulHttpRequestException;", "public void clearImages() {\n\t images.clear();\n\t}", "private void setImageSizeForAllImages() {\n phoneIcon.setFitWidth(ICON_WIDTH);\n phoneIcon.setFitHeight(ICON_HEIGHT);\n\n addressIcon.setFitWidth(ICON_WIDTH);\n addressIcon.setFitHeight(ICON_HEIGHT);\n\n emailIcon.setFitWidth(ICON_WIDTH);\n emailIcon.setFitHeight(ICON_HEIGHT);\n\n groupIcon.setFitWidth(ICON_WIDTH);\n groupIcon.setFitHeight(ICON_HEIGHT);\n\n prefIcon.setFitWidth(ICON_WIDTH);\n prefIcon.setFitHeight(ICON_HEIGHT);\n }", "private void imageSearch(ArrayList<Html> src) {\n // loop through the Html objects\n for(Html page : src) {\n\n // Temp List for improved readability\n ArrayList<Image> images = page.getImages();\n\n // loop through the corresponding images\n for(Image i : images) {\n if(i.getName().equals(this.fileName)) {\n this.numPagesDisplayed++;\n this.pageList.add(page.getLocalPath());\n }\n }\n }\n }", "public void move(Directory directory) throws IOException {\n Path oldPath = Paths.get(photo.getUrl());\n Path newPath =\n Paths.get(directory.getPath() + File.separator + photo.getTagName() + photo.getExtension());\n if (oldPath != newPath) {\n Files.move(oldPath, newPath, ATOMIC_MOVE);\n photo.setUrl(newPath.toString());\n directory.add(photo);\n }\n }", "public static void listOfFiles(File dirPath){\n\t\tFile filesList[] = dirPath.listFiles();\r\n \r\n\t\t// For loop on each item in array \r\n for(File file : filesList) {\r\n if(file.isFile()) {\r\n System.out.println(file.getName());\r\n } else {\r\n \t // Run the method on each nested folder\r\n \t listOfFiles(file);\r\n }\r\n }\r\n }", "public synchronized static void initialiseImages() \n {\n if (images == null) {\n GreenfootImage baseImage = new GreenfootImage(\"explosion-big.png\");\n int maxSize = baseImage.getWidth()/3;\n int delta = maxSize / IMAGE_COUNT;\n int size = 0;\n images = new GreenfootImage[IMAGE_COUNT];\n for (int i=0; i < IMAGE_COUNT; i++) {\n size = size + delta;\n images[i] = new GreenfootImage(baseImage);\n images[i].scale(size, size);\n }\n }\n }", "public void setImages(Bitmap[] images){\n this.images=images;\n currentFrame=0;\n startTime=System.nanoTime();\n }", "public static void refreshIOFiles(@NotNull final Collection<File> files) {\n final long start = System.currentTimeMillis();\n try {\n for (File file1 : files) {\n final VirtualFile file = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file1);\n if (file != null) {\n file.refresh(false, false);\n }\n }\n }\n finally {\n ourRefreshTime += (System.currentTimeMillis() - start);\n }\n }", "public void findImages() {\n URL imgURL = ImageLoader.class.getResource(\"/BackgroundMenu.jpg\");\n this.backgroundImages.put(MenuP.TITLE, loadImage(imgURL));\n\n imgURL = ImageLoader.class.getResource(\"/backgroundGame.png\");\n this.backgroundImages.put(ArenaView.TITLE, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/gameOver.jpg\");\n this.backgroundImages.put(GameOverView.TITLE, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Player.png\");\n this.entityImages.put(ID.PLAYER, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Enemy1.png\");\n this.entityImages.put(ID.BASIC_ENEMY, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/boss.png\");\n this.entityImages.put(ID.BOSS_ENEMY, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/meteorBrown_big1.png\");\n this.entityImages.put(ID.METEOR, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/BlueBullet.png\");\n this.bulletImages.put(new Pair<>(ID.PLAYER_BULLET, ID.PLAYER), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/redBullet.png\");\n this.entityImages.put(ID.ENEMY_BULLET, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_FireBoost.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.FIRE_BOOST), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_Freeze.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.FREEZE), loadImage(imgURL)); \n \n imgURL = ImageLoader.class.getResource(\"/powerup_Health.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.HEALTH), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_Shield.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.SHIELD), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/bulletSpeedUp.png\");\n this.AnimationsPowerUp.put(new Pair<>(ID.POWER_UP, PowerUpT.FIRE_BOOST), loadEffect(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Explosion.png\");\n this.AnimationsEffect.put(new Pair<>(ID.EFFECT, SpecialEffectT.EXPLOSION), loadEffect(imgURL));\n\n imgURL = ImageLoader.class.getResource(\"/freeze.png\");\n this.AnimationsPowerUp.put(new Pair<>(ID.POWER_UP, PowerUpT.FREEZE), loadImage(imgURL));\n }", "private void setImage(){\n if(objects.size() <= 0)\n return;\n\n IImage img = objects.get(0).getImgClass();\n boolean different = false;\n \n //check for different images.\n for(IDataObject object : objects){\n IImage i = object.getImgClass();\n \n if((img == null && i != null) || \n (img != null && i == null)){\n different = true;\n break;\n }else if (img != null && i != null){ \n \n if(!i.getName().equals(img.getName()) ||\n !i.getDir().equals(img.getDir())){\n different = true;\n break;\n }\n } \n }\n \n if(!different){\n image.setText(BUNDLE.getString(\"NoImage\"));\n if(img != null){\n imgName = img.getName();\n imgDir = img.getDir();\n image.setImage(img.getImage());\n }else{\n image.setImage(null);\n }\n }else{\n image.setText(BUNDLE.getString(\"DifferentImages\"));\n }\n \n image.repaint();\n }", "public void setStartingImages() {\n\t\t\n\t}", "public Image[] getImages() {\n return images;\n }", "public void processAll() throws IOException {\n\t\tfor (Iterator i = imageList.iterator(); i.hasNext();) {\n\t\t\tEntry entry = (Entry) i.next();\n\n\t\t\tif (!entry.written) {\n\t\t\t\tentry.written = true;\n\n\t\t\t\tString[] encode;\n\t\t\t\tif (entry.writeAs.equals(ImageConstants.ZLIB)\n\t\t\t\t\t\t|| (entry.maskName != null)) {\n\t\t\t\t\tencode = new String[] { \"Flate\", \"ASCII85\" };\n\t\t\t\t} else if (entry.writeAs.equals(ImageConstants.JPG)) {\n\t\t\t\t\tencode = new String[] { \"DCT\", \"ASCII85\" };\n\t\t\t\t} else {\n\t\t\t\t\tencode = new String[] { null, \"ASCII85\" };\n\t\t\t\t}\n\n\t\t\t\tPDFStream img = pdf.openStream(entry.name);\n\t\t\t\timg.entry(\"Subtype\", pdf.name(\"Image\"));\n\t\t\t\tif (entry.maskName != null) {\n\t\t\t\t\timg.entry(\"SMask\", pdf.ref(entry.maskName));\n\t\t\t\t}\n\t\t\t\timg.image(entry.image, entry.bkg, encode);\n\t\t\t\tpdf.close(img);\n\n\t\t\t\tif (entry.maskName != null) {\n\t\t\t\t\tPDFStream mask = pdf.openStream(entry.maskName);\n\t\t\t\t\tmask.entry(\"Subtype\", pdf.name(\"Image\"));\n\t\t\t\t\tmask.imageMask(entry.image, encode);\n\t\t\t\t\tpdf.close(mask);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void saveAll() {\n try {\n writeObject(IMAGE_DATA_PATH, imageFiles);\n writeObject(EXISTING_TAGS_PATH, existingTags);\n } catch (IOException e) {\n // e.printStackTrace();\n }\n }", "@Override\n\tpublic void readImages() {\n\t\t\n\t}", "List<IbeisImage> uploadImages(List<File> images, File pathToTemporaryZipFile) throws\n UnsupportedImageFileTypeException, IOException, MalformedHttpRequestException, UnsuccessfulHttpRequestException;", "public void updateImage() {\n Graphics2D g = img.createGraphics();\n for (Circle gene : genes) {\n gene.paint(g);\n }\n g.dispose();\n }", "public static ArrayList<BufferedImage> loadTileImages(String folder, int tileWidth, int tileHeight){\n\t\tArrayList<String> fileNames = new ArrayList<String>();\n\t\tFile newFolder = new File(folder);\n\t\tString child [] = newFolder.list();\n\t\tif (child == null){\n\t\t\tSystem.out.println(\"Folder does not exist!\");\n\t\t\tSystem.exit(1);\n\t\t} else {\n\t\t\tfor(int l=0; l<child.length; l++){\n\t\t\t\tfileNames.add(child[l]);\n\t\t\t}\n\t\t}\n\t\tArrayList<BufferedImage> tileImages = new ArrayList<BufferedImage>();\n\t\tfor(int x=0; x<fileNames.size(); x++) {\n\t\t\tBufferedImage tileScale;\n\t\t\ttileScale = readImage(folder + \"/\" +fileNames.get(x));\n\t\t\ttileScale = ScaleImage.scaleImage(tileScale, tileWidth, tileHeight);\n\t\t\ttileImages.add(tileScale);\n\t\t}\n\t\treturn tileImages;\n\t}", "private void createImageFiles() {\n\t\tswitchIconClosed = Icon.createImageIcon(\"/images/events/switchImageClosed.png\");\n\t\tswitchIconOpen = Icon.createImageIcon(\"/images/events/switchImageOpen.png\");\n\t\tswitchIconEmpty = Icon.createImageIcon(\"/images/events/switchImageEmpty.png\");\n\t\tswitchIconOff = Icon.createImageIcon(\"/images/events/switchImageOff.png\");\n\t\tswitchIconOn = Icon.createImageIcon(\"/images/events/switchImageOn.png\");\n\t\tleverIconClean = Icon.createImageIcon(\"/images/events/leverImageClean.png\");\n\t\tleverIconRusty = Icon.createImageIcon(\"/images/events/leverImageRusty.png\");\n\t\tleverIconOn = Icon.createImageIcon(\"/images/events/leverImageOn.png\");\n\t}", "@PostConstruct\n public void onStart() {\n final String path = \"/images/\";\n try {\n final Path path_of_resource = getPathOfResource(path);\n saveImagesFolder(path_of_resource);\n } catch (final IOException e1) {\n e1.printStackTrace();\n }\n }", "private void changeDirectory()\n {\n directory = SlideshowManager.getDirectory(this); //use SlideshowManager to select a directory\n\n if (directory != null) //if a valid directory was selected...\n {\n JFrame loading = new JFrame(\"Loading...\");\n Image icon = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB_PRE);\n loading.setIconImage(icon);\n loading.setResizable(false);\n loading.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);\n loading.setSize(new Dimension(250,30));\n loading.setLocationRelativeTo(null);\n loading.setVisible(true);\n\n timeline.reset();\n timeline.setSlideDurationVisible(automated);\n timeline.setDefaultSlideDuration(slideInterval);\n\n m_ImageLibrary = ImageLibrary.resetLibrary(timeline, directory); //...reset the libraries to purge the current contents...\n JScrollPane spImages = new JScrollPane(m_ImageLibrary);\n spImages.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);\n spImages.getVerticalScrollBar().setUnitIncrement(20);\n libraries.remove(0);\n libraries.add(\"Images\", spImages);\n \n m_AudioLibrary.resetAudio();\n m_AudioLibrary = AudioLibrary.resetLibrary(timeline, directory);\n JScrollPane spAudio = new JScrollPane(m_AudioLibrary);\n spAudio.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);\n spAudio.getVerticalScrollBar().setUnitIncrement(20);\n libraries.remove(0);\n libraries.add(\"Audio\", spAudio);\n\n loading.dispose();\n }\n }", "public List<Image> getAllImage() {\n\t\treturn null;\n\t}", "public void addToCache () {\n ArrayList <Location> gridCache = getGridCache();\n for (Location l : imageLocs) {\n gridCache.add (l);\n }\n }", "@Override\n\tpublic List<URL> getPhotos() {\n\t\timages.clear(); //vide la liste des images\n\t\t\n\t\t\n\t\tList<URL> allImagesURL = new ArrayList<URL>();\n\t\t\n\t\t/* On initialise la liste de toutes les images */\n\t\tList<String> filelocations = null;\n\t\t\n\t\t/*Nous allons retrouver les fichiers images présent dans le répertoire et tous ses sous-répertoires*/\n\t\tPath start = Paths.get(path); //détermine le point de départ \n\t\ttry (Stream<Path> stream = Files.walk(start, Integer.MAX_VALUE)) {\n\t\t filelocations = stream\n\t\t .map(String::valueOf) //transforme les Path en string\n\t\t .filter(filename -> filename.contains(\".jpg\") || filename.contains(\".png\")) //ne prend que les images jpg et png\n\t\t .collect(Collectors.toList());\n\t\t \n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\t/* Pour chaque fichier retrouvé, on essaie de retrouver son chemin absolu pour le stocker dans le allImagesURL */\n\t\tfor (String filelocation : filelocations) {\n\t\t\tString relativeLocation = filelocation.replace(path+\"/\", \"\"); // Pour ne pas partir de src mais de la classe courante\n\t\t\trelativeLocation = relativeLocation.replace(windowspath+\"\\\\\", \"\");\n\t\t\tallImagesURL.add(this.getClass().getResource(relativeLocation)); //on ajoute le chemin absolu dans la liste\n\t\t}\n\t\t\n\t\t\n\t\treturn allImagesURL; //on retourne la liste\n\t}", "private void processFromLastRun() {\n for (String configId : dirsFromLastRunToProcess.keySet()) {\r\n File dirToProcess = dirsFromLastRunToProcess.get(configId);\r\n processContentFiles(dirToProcess, configId);\r\n }\r\n \r\n dirsFromLastRunToProcess = new HashMap<String, File>();\r\n }", "private void getAllFiles(File dir, List<File> fileList) throws IOException {\r\n File[] files = dir.listFiles();\r\n if(files != null){\r\n for (File file : files) {\r\n // Do not add the directories that we need to skip\r\n if(!isDirectoryToSkip(file.getName())){\r\n fileList.add(file);\r\n if (file.isDirectory()) {\r\n getAllFiles(file, fileList);\r\n }\r\n }\r\n }\r\n }\r\n }", "public ArrayList<Image> getImages() {\n\t\treturn getPageObjects(Image.class);\n\t}", "public void loadTileImages() {\n // keep looking for tile A,B,C, etc. this makes it\n // easy to drop new tiles in the images/ directory\n tiles = new ArrayList();\n char ch = 'A';\n while (true) {\n String name = \"tile_\" + ch + \".png\";\n File file = new File(\"images/\" + name);\n if (!file.exists()) {\n break;\n }\n tiles.add(loadImage(name));\n ch++;\n }\n }", "private void disposeAndDeleteAllImages() {\r\n\r\n\t\tPhotoLoadManager.stopImageLoading(true);\r\n\t\tThumbnailStore.cleanupStoreFiles(true, true);\r\n\r\n\t\tPhotoImageCache.disposeAll();\r\n\r\n\t\tExifCache.clear();\r\n\t}", "protected Seq<Fi> loadImages(Xml root, Fi tmxFile){\n Seq<Fi> images = new Seq<>();\n\n for(Xml imageLayer : root.getChildrenByName(\"imagelayer\")){\n Xml image = imageLayer.getChildByName(\"image\");\n String source = image.getAttribute(\"source\", null);\n\n if(source != null){\n Fi handle = getRelativeFileHandle(tmxFile, source);\n\n if(!images.contains(handle, false)){\n images.add(handle);\n }\n }\n }\n\n return images;\n }", "public void loadImages() {\n\t\tpigsty = new ImageIcon(\"images/property/pigsty.png\");\n\t}", "void processContentFiles(final File directoryToProcess, final String configId) {\r\n File[] files = directoryToProcess.listFiles();\r\n for (int fileIndex = 0; fileIndex < files.length; fileIndex++) {\r\n if (!(files[fileIndex].getName().equals(Constants.CONFIGURATION_FILE_NAME) || files[fileIndex]\r\n .getName().startsWith(\"successful_\"))) {\r\n try {\r\n storeContentToInfrastructure(directoryToProcess, configId, files, fileIndex);\r\n }\r\n catch (DepositorException e) {\r\n // FIXME give a message\r\n LOG.error(e.getMessage(), e);\r\n addToFailedConfigurations(configId);\r\n }\r\n }\r\n }\r\n }", "public List<Image> getAllImage()\n {\n GetAllImageQuery getAllImageQuery = new GetAllImageQuery();\n return super.queryResult(getAllImageQuery);\n }", "public ArrayList<ImageView> getImages() {\n\t return images;\n\t}", "private void cacheFoldersFiles() throws Exception {\n\n ArrayList<FileManagerFile> files = new ArrayList<FileManagerFile>();\n if (fileCount > 0) {\n SimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\");\n formatter.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\n int offset = 0;\n int count = 1000;\n List<FileManagerFile> filelist;\n\n do {\n filelist = connection.getFileManager().getFileManagerFiles(count, offset);\n offset += count;\n for (FileManagerFile file : filelist) {\n if (file.getFolderId() == id) {\n files.add(file);\n }\n }\n } while (filelist.size() > 0 && files.size() < fileCount);\n }\n this.files = files;\n }" ]
[ "0.77395254", "0.73937416", "0.7310977", "0.71718806", "0.69413006", "0.68892825", "0.6562517", "0.65044665", "0.63955027", "0.62287384", "0.612646", "0.5886662", "0.57589346", "0.57460743", "0.57246864", "0.5724667", "0.57209796", "0.5659538", "0.56417865", "0.5574104", "0.55497026", "0.5524033", "0.5515609", "0.55082625", "0.55059975", "0.54926836", "0.5378815", "0.5318166", "0.5248171", "0.52454346", "0.52408", "0.52398175", "0.52256864", "0.5192622", "0.5192178", "0.5151399", "0.51378953", "0.5133494", "0.51334715", "0.51070815", "0.5105753", "0.5102819", "0.5102114", "0.5099512", "0.5098187", "0.5096426", "0.5086405", "0.50731087", "0.50694126", "0.5067427", "0.50660455", "0.50523514", "0.5044171", "0.5039285", "0.5032359", "0.5018945", "0.50137", "0.50048834", "0.50010324", "0.49900946", "0.49883464", "0.49804413", "0.4972819", "0.496379", "0.4962908", "0.49539426", "0.49491155", "0.49453685", "0.49225193", "0.4907936", "0.49047628", "0.49025798", "0.49017364", "0.49010223", "0.48788065", "0.48767367", "0.48747942", "0.48707828", "0.48677778", "0.48662618", "0.4865612", "0.48564854", "0.48512876", "0.48495504", "0.48472664", "0.48459592", "0.48441932", "0.48385128", "0.4836558", "0.48354802", "0.48350543", "0.48335007", "0.48247468", "0.48113483", "0.48077238", "0.48052382", "0.4802578", "0.48008147", "0.4790943", "0.47831985" ]
0.82061785
0
Updates allImagesUnderDirectory with all the imageFiles under directory including sub directories
private void fillAllImagesUnderDirectory(File directory) throws IOException { // get the list of all files (including directories) in the directory of interest File[] fileArray = directory.listFiles(); assert fileArray != null; for (File file : fileArray) { // if the file is an image, then add it if (isImage(file)) { ImageFile imageFile = new ImageFile(file.getAbsolutePath()); // if the image is already saved, reuse it if (centralController.getImageFileController().hasImageFile(imageFile)) { allImagesUnderDirectory .add(centralController.getImageFileController().getImageFile(imageFile)); } else if (imagesInDirectory.contains(imageFile)) { allImagesUnderDirectory.add(imagesInDirectory.get(imagesInDirectory.indexOf(imageFile))); } else { allImagesUnderDirectory.add(imageFile); } } else if (file.isDirectory()) { fillAllImagesUnderDirectory(file); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void fillImagesInDirectory() throws IOException {\n // get the list of all files (including directories) in the directory of interest\n File[] fileArray = directory.listFiles();\n assert fileArray != null;\n for (File file : fileArray) {\n // the file is an image, then add it\n if (isImage(file)) {\n ImageFile imageFile = new ImageFile(file.getAbsolutePath());\n // if the image is already saved, reuse it\n if (centralController.getImageFileController().hasImageFile(imageFile)) {\n imagesInDirectory.add(centralController.getImageFileController().getImageFile(imageFile));\n } else {\n imagesInDirectory.add(imageFile);\n }\n }\n }\n }", "public ArrayList<ImageFile> getAllImagesUnderDirectory() throws IOException {\n return allImagesUnderDirectory;\n }", "private static void loadImagesInDirectory(String dir){\n\t\tFile file = new File(Files.localize(\"images\\\\\"+dir));\n\t\tassert file.isDirectory();\n\t\n\t\tFile[] files = file.listFiles();\n\t\tfor(File f : files){\n\t\t\tif(isImageFile(f)){\n\t\t\t\tString name = dir+\"\\\\\"+f.getName();\n\t\t\t\tint i = name.lastIndexOf('.');\n\t\t\t\tassert i != -1;\n\t\t\t\tname = name.substring(0, i).replaceAll(\"\\\\\\\\\", \"/\");\n\t\t\t\t//Image image = load(f,true);\n\t\t\t\tImageIcon image;\n\t\t\t\tFile f2 = new File(f.getAbsolutePath()+\".anim\");\n\t\t\t\tif(f2.exists()){\n\t\t\t\t\timage = evaluateAnimFile(dir,f2,load(f,true));\n\t\t\t\t}else{\n\t\t\t\t\timage = new ImageIcon(f.getAbsolutePath());\n\t\t\t\t}\n\t\t\t\tdebug(\"Loaded image \"+name+\" as \"+f.getAbsolutePath());\n\t\t\t\timages.put(name, image);\n\t\t\t}else if(f.isDirectory()){\n\t\t\t\tloadImagesInDirectory(dir+\"\\\\\"+f.getName());\n\t\t\t}\n\t\t}\n\t}", "public void populateCachedImages(File dir)\n {\n if (dir.exists())\n {\n File[] files = dir.listFiles();\n for (int i = 0; i < files.length; i++)\n {\n File file = files[i];\n if (!file.isDirectory())\n {\n //Record all filenames from the cache so we know which photos to retrieve from database\n cachedFileNames.add(file.getName());\n imageList.add(file);\n }\n }\n }\n }", "public ListImages(File directoryOfInterest, CentralController centralController)\n throws IOException {\n\n this.centralController = centralController;\n\n directory = directoryOfInterest;\n imagesInDirectory = new ArrayList<>();\n allImagesUnderDirectory = new ArrayList<>();\n\n // updates the imagesInDirectory list\n fillImagesInDirectory();\n\n // updates the allImagesUnderDirectory list\n fillAllImagesUnderDirectory(directory);\n }", "public ArrayList<ImageFile> getImagesInDirectory() throws IOException {\n\n return imagesInDirectory;\n }", "public void addObserversToImageFiles(Observer observer) {\n for (ImageFile imageFile : allImagesUnderDirectory) {\n imageFile.addObserver(observer);\n }\n }", "private BufferedImage[] loadImages(String directory, BufferedImage[] img) throws Exception {\n\t\tFile dir = new File(directory);\n\t\tFile[] files = dir.listFiles();\n\t\tArrays.sort(files, (s, t) -> s.getName().compareTo(t.getName()));\n\t\t\n\t\timg = new BufferedImage[files.length];\n\t\tfor (int i = 0; i < files.length; i++) {\n\t\t\timg[i] = ImageIO.read(files[i]);\n\t\t}\n\t\treturn img;\n\t}", "public void saveImagesFolder(final Path path_of_resource) throws IOException {\n final Path path = path_of_resource;\n Set<String> listImages = new HashSet<>();\n listImages = listFiles(path);\n List<String> found = new ArrayList<>();\n Iterator<Image> image_it = imageRepository.findAll().iterator();\n // Filter images that have the same name in the db and the images in the\n // resource folder.\n while (image_it.hasNext()) {\n Image next_i = image_it.next();\n Iterator<String> list_it = listImages.iterator();\n while (list_it.hasNext()) {\n String next_s = list_it.next();\n if (next_i.getName().equals(Paths.get(next_s).getFileName().toString()))\n found.add(next_s);\n }\n }\n listImages.removeAll(found);\n System.out.println(listImages);\n listImages.forEach(i -> {\n try {\n final byte[] fileContent = Files.readAllBytes(Paths.get(i));\n Image image = new Image(Paths.get(i).getFileName().toString(), fileContent,\n Utils.typeOfFile(Paths.get(i)), Utils.sizeOfImage(Paths.get(i)));\n image.setIsNew(false);\n imageRepository.save(image);\n\n } catch (final IOException e) {\n e.printStackTrace();\n }\n });\n }", "public void initializeImages() {\n\n File dir = new File(\"Images\");\n if (!dir.exists()) {\n boolean success = dir.mkdir();\n System.out.println(\"Images directory created!\");\n }\n }", "private void processImages() throws MalformedURLException, IOException {\r\n\r\n\t\tNodeFilter imageFilter = new NodeClassFilter(ImageTag.class);\r\n\t\timageList = fullList.extractAllNodesThatMatch(imageFilter, true);\r\n\t\tthePageImages = new HashMap<String, byte[]>();\r\n\r\n\t\tfor (SimpleNodeIterator nodeIter = imageList.elements(); nodeIter\r\n\t\t\t\t.hasMoreNodes();) {\r\n\t\t\tImageTag tempNode = (ImageTag) nodeIter.nextNode();\r\n\t\t\tString tagText = tempNode.getText();\r\n\r\n\t\t\t// Populate imageUrlText String\r\n\t\t\tString imageUrlText = tempNode.getImageURL();\r\n\r\n\t\t\tif (imageUrlText != \"\") {\r\n\t\t\t\t// Print to console, to verify relative link processing\r\n\t\t\t\tSystem.out.println(\"ImageUrl to Retrieve:\" + imageUrlText);\r\n\r\n\t\t\t\tbyte[] imgArray = downloadBinaryData(imageUrlText);\r\n\r\n\t\t\t\tthePageImages.put(tagText, imgArray);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public static void searchForImageReferences(File rootDir, FilenameFilter fileFilter) {\n \t\tfor (File file : rootDir.listFiles()) {\n \t\t\tif (file.isDirectory()) {\n \t\t\t\tsearchForImageReferences(file, fileFilter);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\ttry {\n \t\t\t\tif (fileFilter.accept(rootDir, file.getName())) {\n \t\t\t\t\tif (MapTool.getFrame() != null) {\n \t\t\t\t\t\tMapTool.getFrame().setStatusMessage(\"Caching image reference: \" + file.getName());\n \t\t\t\t\t}\n \t\t\t\t\trememberLocalImageReference(file);\n \t\t\t\t}\n \t\t\t} catch (IOException ioe) {\n \t\t\t\tioe.printStackTrace();\n \t\t\t}\n \t\t}\n \t\t// Done\n \t\tif (MapTool.getFrame() != null) {\n \t\t\tMapTool.getFrame().setStatusMessage(\"\");\n \t\t}\n \t}", "private void loadImages() {\n\t\ttry {\n\t\t\tall_images = new Bitmap[img_files.length];\n\t\t\tfor (int i = 0; i < all_images.length; i++) {\n\t\t\t\tall_images[i] = loadImage(img_files[i] + \".jpg\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tToast.makeText(this, \"Unable to load images\", Toast.LENGTH_LONG)\n\t\t\t\t\t.show();\n\t\t\tfinish();\n\t\t}\n\t}", "public static List<InputStream> getAllImages(){\n\t\treturn IOHandler.getResourcesIn(IMAGES_DIR);\n\t}", "public void populateImages() {\n\t\t// Check if the recipe has any images saved on the sd card and get\n\t\t// the bitmap for the imagebutton\n\n\t\tArrayList<Image> images = ImageController.getAllRecipeImages(\n\t\t\t\tcurrentRecipe.getRecipeId(), currentRecipe.location);\n\n\t\tLog.w(\"*****\", \"outside\");\n\t\tLog.w(\"*****\", String.valueOf(currentRecipe.getRecipeId()));\n\t\tLog.w(\"*****\", String.valueOf(currentRecipe.location));\n\t\tImageButton pictureButton = (ImageButton) findViewById(R.id.ibRecipe);\n\n\t\t// Set the image of the imagebutton to the first image in the folder\n\t\tif (images.size() > 0) {\n\t\t\tpictureButton.setImageBitmap(images.get(0).getBitmap());\n\t\t}\n\n\t}", "abstract public void setImageResourcesDir(String path);", "public void setImageDir(File imageRepDir) {\n\t\tFileDataPersister.getInstance().put(\"gui.configuration\", \"image.repository\", imageRepDir.getPath());\n\t\tRepository.getInstance().setRepository(imageRepDir);\n\t\tthis.getSelectedGraphEditor().repaint();\n\t}", "public List<Image> getAllImages() {\n\t\treturn list;\n\t}", "private static ArrayList<String> getImagesInFileSystem() {\n\t\t// get file list in database\n\t\tArrayList<String> fileNameList = new ArrayList<String>();\n\t\t\n\t\tFile folder = new File(IMAGE_DIRECTORY);\n\t File[] listOfFiles = folder.listFiles();\n\t \n\t for (File currFile : listOfFiles) {\n\t if (currFile.isFile() && !currFile.getName().startsWith(\".\")) {\n\t \t fileNameList.add(currFile.getName());\n\t }\n\t }\n\t \n\t return fileNameList;\n\t}", "public void getImagesFromFolder() {\n File file = new File(Environment.getExternalStorageDirectory().toString() + \"/saveclick\");\n if (file.isDirectory()) {\n fileList = file.listFiles();\n for (int i = 0; i < fileList.length; i++) {\n files.add(fileList[i].getAbsolutePath());\n Log.i(\"listVideos\", \"file\" + fileList[0]);\n }\n }\n }", "private static void displayImagesDir(){\n System.out.println(IMAGES_DIR);\n }", "public static void listOfFiles(File dirPath){\n\t\tFile filesList[] = dirPath.listFiles();\r\n \r\n\t\t// For loop on each item in array \r\n for(File file : filesList) {\r\n if(file.isFile()) {\r\n System.out.println(file.getName());\r\n } else {\r\n \t // Run the method on each nested folder\r\n \t listOfFiles(file);\r\n }\r\n }\r\n }", "public ArrayList<ImageFile> getImageFiles() {\n return new ArrayList<>(imageFiles);\n }", "public void treatAllPhotos() throws IllegalArgumentException {\n for(Long currentID : idsToTest){\n String pathToPhoto = \"photo\\\\\" + currentID.toString();\n File currentPhotosFile = new File(pathToPhoto);\n\n if(currentPhotosFile.exists() && currentPhotosFile.isDirectory()){\n\n File[] listFiles = currentPhotosFile.listFiles();\n\n for(File file : listFiles){\n if (!file.getName().endsWith(\".pgm\")) { //search how to convert all image to .pgm\n throw new IllegalArgumentException(\"The file of the student \" + currentID + \" contains other files than '.pgm'.\");\n }\n else{\n Mat photoToTreat = Imgcodecs.imread(pathToPhoto + \"\\\\\" + file.getName(), Imgcodecs.IMREAD_GRAYSCALE);\n Mat treatedPhoto = recoApp.imageTreatment(photoToTreat);\n if(treatedPhoto != null){\n Imgcodecs.imwrite(pathToPhoto + \"\\\\\" + file.getName(), treatedPhoto);\n }\n }\n }\n }\n else{\n throw new IllegalArgumentException(\"The file of the student \" + currentID + \" do not exist or is not a directory.\");\n }\n }\n }", "public static void processDirectory(File directory) {\n FlatFileProcessor processor = new FlatFileProcessor(directory);\n processor.processDirectory();\n }", "private void updateFiles() {\n\t}", "private void getAllFiles(File dir, List<File> fileList) throws IOException {\r\n File[] files = dir.listFiles();\r\n if(files != null){\r\n for (File file : files) {\r\n // Do not add the directories that we need to skip\r\n if(!isDirectoryToSkip(file.getName())){\r\n fileList.add(file);\r\n if (file.isDirectory()) {\r\n getAllFiles(file, fileList);\r\n }\r\n }\r\n }\r\n }\r\n }", "private void loadImages(BufferedImage[] images, String direction) {\n for (int i = 0; i < images.length; i++) {\n String fileName = direction + (i + 1);\n images[i] = GameManager.getResources().getMonsterImages().get(\n fileName);\n }\n\n }", "public void listFilesFromDirectory(Path path, List<UpdateFile> updateFileList) {\n try (DirectoryStream<Path> stream = Files.newDirectoryStream(path)) {\n for (Path currentPath : stream)\n if (!Files.isDirectory(currentPath)) {\n UpdateFile updateFile = new UpdateFile();\n File file = currentPath.toFile();\n updateFile.setFilePath(cutPrefixFromFilePath(file.getPath()));\n updateFile.setLastModified(String.valueOf(file.lastModified()));\n updateFileList.add(updateFile);\n } else listFilesFromDirectory(currentPath, updateFileList);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void addImgList() {\n\t\tdogImg.add(\"./data/img/labrador.jpg\");\t\t\t\t\n\t\tdogImg.add(\"./data/img/germanshepherd.jpg\");\t\n\t\tdogImg.add(\"./data/img/bulldog.jpg\");\t\t\t\t\t\t\t\t\n\t\tdogImg.add(\"./data/img/rottweiler.jpg\");\n\t\tdogImg.add(\"./data/img/husky.jpg\");\n\n\t}", "private void getAllJarFiles(File dir, ArrayList fileList)\n\t{\n\t\tif (dir.exists() && dir.isDirectory())\n\t\t{\n\t\t\tFile[] files = dir.listFiles();\n\t\t\tif (files == null)\n\t\t\t\treturn;\n\n\t\t\tfor (int i = 0; i < files.length; i++)\n\t\t\t{\n\t\t\t\tFile file = files[i];\n\t\t\t\tif (file.isFile())\n\t\t\t\t{\n\t\t\t\t\tif (file.getName().endsWith(\".jar\")) //$NON-NLS-1$\n\t\t\t\t\t\tfileList.add(file);\n\t\t\t\t}\n\t\t\t\telse if (file.isDirectory())\n\t\t\t\t{\n\t\t\t\t\tgetAllJarFiles(file, fileList);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void deleteAllMediaThumbIntStg() {\n File[] subDirectory = PathUtil.INTERNAL_MAIN_DIRECTORY.listFiles();\n for (File aSubDirectory : subDirectory) { //looping sub folders\n String[] files = aSubDirectory.list();\n //if (!aSubDirectory.getName().equals(PathUtil.INTERNAL_SUB_FOLDER_CHAT_IMAGE)) { //except chat image folder\n for (String file : files) {\n File f = new File(aSubDirectory, file);\n delete(f);\n //LogUtil.e(\"StorageUtil\", \"deleteAllMediaThumbIntStg\");\n }\n delete(aSubDirectory);\n //}\n }\n }", "private void loadImages() {\n\t\ttry {\n\t\t\timage = ImageIO.read(Pillar.class.getResource(\"/Items/Pillar.png\"));\n\t\t\tscaledImage = image;\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Failed to read Pillar image file: \" + e.getMessage());\n\t\t}\n\t}", "private void addNodesImages(IndexNode node)\n {\n int maxImages = spider.getConfig().getMaxImages();\n int n = Math.min(node.getImages().size(), maxImages);\n Iterator<String> iter = node.getImages().iterator();\n int numResultsPerPage = getResultsPerPage();\n \n for(int i = 0; i < n && currentSearchImages.size() <= numResultsPerPage; i++)\n {\n try\n {\n String image_url = iter.next();\n BufferedImage image = ImageIO.read(new URL(image_url));\n \n currentSearchImages.add(new ImageNode(image_url, image));\n }\n \n catch(IOException e) {}\n }\n }", "public void setImages() {\n\n imgBlock.removeAll();\n imgBlock.revalidate();\n imgBlock.repaint();\n labels = new JLabel[imgs.length];\n for (int i = 0; i < imgs.length; i++) {\n\n labels[i] = new JLabel(new ImageIcon(Toolkit.getDefaultToolkit().createImage(imgs[i].getSource())));\n imgBlock.add(labels[i]);\n\n }\n\n SwingUtilities.updateComponentTreeUI(jf); // refresh\n initialized = true;\n\n }", "@Override\n\tpublic List<Image> findAllImage() {\n\t\treturn new ImageDaoImpl().findAllImage();\n\t}", "@Override\n\tpublic List<Image> findAll() {\n\t\treturn imageRepository.findAll();\n\t}", "public void move(Directory directory) throws IOException {\n Path oldPath = Paths.get(photo.getUrl());\n Path newPath =\n Paths.get(directory.getPath() + File.separator + photo.getTagName() + photo.getExtension());\n if (oldPath != newPath) {\n Files.move(oldPath, newPath, ATOMIC_MOVE);\n photo.setUrl(newPath.toString());\n directory.add(photo);\n }\n }", "public List<Image> getAllImage()\n {\n GetAllImageQuery getAllImageQuery = new GetAllImageQuery();\n return super.queryResult(getAllImageQuery);\n }", "private void initializeImageModels() {\n for(ImageModel model : GalleryFragment.listImageModel){\n imgList.add(model.getImagePath());\n }\n }", "private ArrayList<String> getImagesPathList() {\n String MEDIA_IMAGES_PATH = \"CuraContents/images\";\n File fileImages = new File(Environment.getExternalStorageDirectory(), MEDIA_IMAGES_PATH);\n if (fileImages.isDirectory()) {\n File[] listImagesFile = fileImages.listFiles();\n ArrayList<String> imageFilesPathList = new ArrayList<>();\n for (File file1 : listImagesFile) {\n imageFilesPathList.add(file1.getAbsolutePath());\n }\n return imageFilesPathList;\n }\n return null;\n }", "public List<Image> getAllImage() {\n\t\treturn null;\n\t}", "public void updateImage(GameObject.Direction direction) {\n switch (direction) {\n case NORTH:\n currentImage = north;\n break;\n\n case SOUTH:\n currentImage = south;\n break;\n\n case WEST:\n currentImage = west;\n break;\n\n case EAST:\n currentImage = east;\n break;\n }\n }", "@Override\n\tpublic void loadStateImages() {\n\t\tif (imageFilename[0][0] != null)\n\t\t\tthis.addStateImage(imageFilename[0][0], 0, 0);\n\t\tif (imageFilename[0][1] != null)\n\t\t\tthis.addStateImage(imageFilename[0][1], 1, 0);\n\t\tif (imageFilename[1][0] != null)\n\t\t\tthis.addStateImage(imageFilename[1][0], 0, 1);\n\t\tif (imageFilename[1][1] != null)\n\t\t\tthis.addStateImage(imageFilename[1][1], 1, 1);\n\t}", "public void testImagesDirectoryAccessible() {\n File file = new File(rootBlog.getRoot(), \"images\");\n assertEquals(file, new File(rootBlog.getImagesDirectory()));\n assertTrue(file.exists());\n }", "public void findImages() {\n \t\tthis.mNoteItemModel.findImages(this.mNoteItemModel.getContent());\n \t}", "private static FileDiffDirectory fillDirectoryDiff(String directory, DiffState state) throws IOException {\n \t\n \t\tFile dir = new File(directory);\n \t\t\n\t\tFile[] files = dir.listFiles();\n\t\tArrays.sort(files);\n\t\t\n\t\tList<File> filesWithinDirectory = Arrays.asList(files);\n \t\t\n \t\tFileDiffDirectory diffDirectory = new FileDiffDirectory(directory, state);\n \t\t\n \t\tfor(File file : filesWithinDirectory) {\n \t\t\t\n \t\t\tif (file.isHidden()) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n \t\t\tif (file.isFile()) {\n \t\t\t\tif (state.equals(DiffState.DELETED)) {\n \t\t\t\t\tdiffDirectory.addFile(FileDiffFile.compareFile(file.getAbsolutePath(), null));\n \t\t\t\t} else {\n \t\t\t\t\tdiffDirectory.addFile(FileDiffFile.compareFile(null, file.getAbsolutePath()));\n \t\t\t\t}\n \t\t\t} else {\n \t\t\t\tif (state.equals(DiffState.DELETED)) {\n \t\t\t\t\tdiffDirectory.addDirectory(FileDiffDirectory.compareDirectory(file.getAbsolutePath(), null));\n \t\t\t\t} else {\n \t\t\t\t\tdiffDirectory.addDirectory(FileDiffDirectory.compareDirectory(null, file.getAbsolutePath()));\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\treturn diffDirectory;\n \t}", "protected Seq<Fi> loadImages(Xml root, Fi tmxFile){\n Seq<Fi> images = new Seq<>();\n\n for(Xml imageLayer : root.getChildrenByName(\"imagelayer\")){\n Xml image = imageLayer.getChildByName(\"image\");\n String source = image.getAttribute(\"source\", null);\n\n if(source != null){\n Fi handle = getRelativeFileHandle(tmxFile, source);\n\n if(!images.contains(handle, false)){\n images.add(handle);\n }\n }\n }\n\n return images;\n }", "public static void loadImages()\n \t{\n \t\tSystem.out.print(\"Loading images... \");\n \t\t\n \t\tallImages = new TreeMap<ImageEnum, ImageIcon>();\n \t\t\n \t\ttry {\n \t\taddImage(ImageEnum.RAISIN, \"images/parts/raisin.png\");\n \t\taddImage(ImageEnum.NUT, \"images/parts/nut.png\");\n \t\taddImage(ImageEnum.PUFF_CHOCOLATE, \"images/parts/puff_chocolate.png\");\n \t\taddImage(ImageEnum.PUFF_CORN, \"images/parts/puff_corn.png\");\n \t\taddImage(ImageEnum.BANANA, \"images/parts/banana.png\");\n \t\taddImage(ImageEnum.CHEERIO, \"images/parts/cheerio.png\");\n \t\taddImage(ImageEnum.CINNATOAST, \"images/parts/cinnatoast.png\");\n\t\taddImage(ImageEnum.CORNFLAKE, \"images/parts/flake_corn.png\");\n \t\taddImage(ImageEnum.FLAKE_BRAN, \"images/parts/flake_bran.png\");\n \t\taddImage(ImageEnum.GOLDGRAHAM, \"images/parts/goldgraham.png\");\n \t\taddImage(ImageEnum.STRAWBERRY, \"images/parts/strawberry.png\");\n \t\t\n \t\taddImage(ImageEnum.PART_ROBOT_HAND, \"images/robots/part_robot_hand.png\");\n \t\taddImage(ImageEnum.KIT_ROBOT_HAND, \"images/robots/kit_robot_hand.png\");\n \t\taddImage(ImageEnum.ROBOT_ARM_1, \"images/robots/robot_arm_1.png\");\n \t\taddImage(ImageEnum.ROBOT_BASE, \"images/robots/robot_base.png\");\n \t\taddImage(ImageEnum.ROBOT_RAIL, \"images/robots/robot_rail.png\");\n \t\t\n \t\taddImage(ImageEnum.KIT, \"images/kit/empty_kit.png\");\n \t\taddImage(ImageEnum.KIT_TABLE, \"images/kit/kit_table.png\");\n \t\taddImage(ImageEnum.KITPORT, \"images/kit/kitport.png\");\n \t\taddImage(ImageEnum.KITPORT_HOOD_IN, \"images/kit/kitport_hood_in.png\");\n \t\taddImage(ImageEnum.KITPORT_HOOD_OUT, \"images/kit/kitport_hood_out.png\");\n \t\taddImage(ImageEnum.PALLET, \"images/kit/pallet.png\");\n \t\t\n \t\taddImage(ImageEnum.FEEDER, \"images/lane/feeder.png\");\n \t\taddImage(ImageEnum.LANE, \"images/lane/lane.png\");\n \t\taddImage(ImageEnum.NEST, \"images/lane/nest.png\");\n \t\taddImage(ImageEnum.DIVERTER, \"images/lane/diverter.png\");\n \t\taddImage(ImageEnum.DIVERTER_ARM, \"images/lane/diverter_arm.png\");\n \t\taddImage(ImageEnum.PARTS_BOX, \"images/lane/partsbox.png\");\n \t\t\n \t\taddImage(ImageEnum.CAMERA_FLASH, \"images/misc/camera_flash.png\");\n \t\taddImage(ImageEnum.SHADOW1, \"images/misc/shadow1.png\");\n \t\taddImage(ImageEnum.SHADOW2, \"images/misc/shadow2.png\");\n \t\t\n \t\taddImage(ImageEnum.GANTRY_BASE, \"images/gantry/gantry_base.png\");\n \t\taddImage(ImageEnum.GANTRY_CRANE, \"images/gantry/gantry_crane.png\");\n \t\taddImage(ImageEnum.GANTRY_TRUSS_H, \"images/gantry/gantry_truss_h.png\");\n \t\taddImage(ImageEnum.GANTRY_TRUSS_V, \"images/gantry/gantry_truss_v.png\");\n \t\taddImage(ImageEnum.GANTRY_WHEEL, \"images/gantry/gantry_wheel.png\");\n \t\t} catch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t\tSystem.exit(1);\n \t\t}\n \t\tSystem.out.println(\"Done\");\n \t}", "private void loadAndCacheImages(Node node, FileContext cachedImageFilesystem) throws Exception\n {\n String imagePathBase = \"/\" + node.getTypeCode() + \"/\" + node.getNid();\n ImagesReponse imagesReponse = this.queryRemoteApi(ImagesReponse.class, imagePathBase + ImagesReponse.PATH, null);\n if (imagesReponse != null && imagesReponse.getNodes() != null && imagesReponse.getNodes().getNode() != null) {\n for (Image i : imagesReponse.getNodes().getNode()) {\n node.addImage(i);\n\n URI imageUri = UriBuilder.fromUri(Settings.instance().getTpAccessApiBaseUrl())\n .path(BASE_PATH)\n .path(imagePathBase + \"/image/\" + i.getData().mediaObjectId + \"/original\")\n .replaceQueryParam(ACCESS_TOKEN_PARAM, this.getAccessToken())\n .replaceQueryParam(FORMAT_PARAM, FORMAT_JSON)\n .build();\n\n ClientConfig config = new ClientConfig();\n Client httpClient = ClientBuilder.newClient(config);\n Response response = httpClient.target(imageUri).request().get();\n if (response.getStatus() == Response.Status.OK.getStatusCode()) {\n org.apache.hadoop.fs.Path nodeImages = new org.apache.hadoop.fs.Path(HDFS_CACHE_ROOT_PATH + node.getNid());\n if (!cachedImageFilesystem.util().exists(nodeImages)) {\n cachedImageFilesystem.mkdir(nodeImages, FsPermission.getDirDefault(), true);\n }\n org.apache.hadoop.fs.Path cachedImage = new org.apache.hadoop.fs.Path(nodeImages, i.getData().mediaObjectId);\n i.setCachedUrl(cachedImage.toUri());\n if (!cachedImageFilesystem.util().exists(cachedImage)) {\n try (OutputStream os = cachedImageFilesystem.create(cachedImage, EnumSet.of(CreateFlag.CREATE, CreateFlag.OVERWRITE))) {\n IOUtils.copy(response.readEntity(InputStream.class), os);\n }\n }\n }\n else {\n throw new IOException(\"Error status returned while fetching remote API data;\" + response);\n }\n\n }\n }\n }", "public static ArrayList<BufferedImage> loadTileImages(String folder, int tileWidth, int tileHeight){\n\t\tArrayList<String> fileNames = new ArrayList<String>();\n\t\tFile newFolder = new File(folder);\n\t\tString child [] = newFolder.list();\n\t\tif (child == null){\n\t\t\tSystem.out.println(\"Folder does not exist!\");\n\t\t\tSystem.exit(1);\n\t\t} else {\n\t\t\tfor(int l=0; l<child.length; l++){\n\t\t\t\tfileNames.add(child[l]);\n\t\t\t}\n\t\t}\n\t\tArrayList<BufferedImage> tileImages = new ArrayList<BufferedImage>();\n\t\tfor(int x=0; x<fileNames.size(); x++) {\n\t\t\tBufferedImage tileScale;\n\t\t\ttileScale = readImage(folder + \"/\" +fileNames.get(x));\n\t\t\ttileScale = ScaleImage.scaleImage(tileScale, tileWidth, tileHeight);\n\t\t\ttileImages.add(tileScale);\n\t\t}\n\t\treturn tileImages;\n\t}", "private void setImageSizeForAllImages() {\n phoneIcon.setFitWidth(ICON_WIDTH);\n phoneIcon.setFitHeight(ICON_HEIGHT);\n\n addressIcon.setFitWidth(ICON_WIDTH);\n addressIcon.setFitHeight(ICON_HEIGHT);\n\n emailIcon.setFitWidth(ICON_WIDTH);\n emailIcon.setFitHeight(ICON_HEIGHT);\n\n groupIcon.setFitWidth(ICON_WIDTH);\n groupIcon.setFitHeight(ICON_HEIGHT);\n\n prefIcon.setFitWidth(ICON_WIDTH);\n prefIcon.setFitHeight(ICON_HEIGHT);\n }", "private void processFromLastRun() {\n for (String configId : dirsFromLastRunToProcess.keySet()) {\r\n File dirToProcess = dirsFromLastRunToProcess.get(configId);\r\n processContentFiles(dirToProcess, configId);\r\n }\r\n \r\n dirsFromLastRunToProcess = new HashMap<String, File>();\r\n }", "private static void buildDir (File dir) \n\t\tthrows Exception\n\t{\n\t\tFile[] contents = dir.listFiles();\n\t\tfor (int i = 0; i < contents.length; i++) {\n\t\t\tFile file = contents[i];\n\t\t\tif (file.isDirectory()) {\n\t\t\t\tbuildDir(file);\n\t\t\t} else if (file.getName().endsWith(\".xml\")) {\n\t\t\t\tbuildFile(file);\n\t\t\t}\n\t\t}\n\t}", "public void serveFilesFromDirectory(File directory) {\n serveFilesFromDirectory(directory.getPath());\n }", "void processContentFiles(final File directoryToProcess, final String configId) {\r\n File[] files = directoryToProcess.listFiles();\r\n for (int fileIndex = 0; fileIndex < files.length; fileIndex++) {\r\n if (!(files[fileIndex].getName().equals(Constants.CONFIGURATION_FILE_NAME) || files[fileIndex]\r\n .getName().startsWith(\"successful_\"))) {\r\n try {\r\n storeContentToInfrastructure(directoryToProcess, configId, files, fileIndex);\r\n }\r\n catch (DepositorException e) {\r\n // FIXME give a message\r\n LOG.error(e.getMessage(), e);\r\n addToFailedConfigurations(configId);\r\n }\r\n }\r\n }\r\n }", "public void clearImages() {\n\t images.clear();\n\t}", "public void serveFilesFromDirectory(String directoryPath) {\n try {\n synchronized (mImplMonitor) {\n checkServiceLocked();\n mImpl.serveFilesFromDirectory(directoryPath);\n }\n } catch (RemoteException e) {\n throw new EmbeddedTestServerFailure(\n \"Failed to start serving files from \" + directoryPath + \": \" + e.toString());\n }\n }", "@Override\n public List<GEMFile> getLocalFiles(String directory) {\n File dir = new File(directory);\n List<GEMFile> resultList = Lists.newArrayList();\n File[] fList = dir.listFiles();\n if (fList != null) {\n for (File file : fList) {\n if (file.isFile()) {\n resultList.add(new GEMFile(file.getName(), file.getParent()));\n } else {\n resultList.addAll(getLocalFiles(file.getAbsolutePath()));\n }\n }\n gemFileState.put(STATE_SYNC_DIRECTORY, directory);\n }\n return resultList;\n }", "static public ObservableList<ImageMetaInfo> getImagesInfo(File path) {\n ObservableList<ImageMetaInfo> observableList = FXCollections.observableArrayList();\n ExtFilter fileFilter = new ExtFilter();\n File[] imageFilesArray = path.listFiles(fileFilter);\n for (File file : imageFilesArray) {\n ImageMetaInfo imageMetaInfo = getImageMetaInfo(file);\n observableList.add(imageMetaInfo);\n }\n return observableList;\n }", "public void saveAll() {\n try {\n writeObject(IMAGE_DATA_PATH, imageFiles);\n writeObject(EXISTING_TAGS_PATH, existingTags);\n } catch (IOException e) {\n // e.printStackTrace();\n }\n }", "public void writeToDir() {\n\t\ttry{\n\t\t\tString dirPath = Paths.get(\".\").toAbsolutePath().normalize().toString()+\"/\";\n\t\t\tString path = dirPath + filename; //get server dir path\n\t\t\tSystem.out.println(\"output file path is: \" + path);\n\t\t\tFileOutputStream out = new FileOutputStream(path);\n out.write(img);\n out.close();\n PL.fsync();\n\t\t}catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void getAllFiles(File dir, List<File> fileList) {\n File[] files = dir.listFiles(new FilenameFilter() {\n @Override\n public boolean accept(File dir, String name) {\n return name.endsWith(\".xml\") || name.endsWith(\".kml\");\n }\n });\n for (File file : files) {\n fileList.add(file);\n if (file.isDirectory()) {\n getAllFiles(file, fileList);\n }\n }\n }", "public void processAll() throws IOException {\n\t\tfor (Iterator i = imageList.iterator(); i.hasNext();) {\n\t\t\tEntry entry = (Entry) i.next();\n\n\t\t\tif (!entry.written) {\n\t\t\t\tentry.written = true;\n\n\t\t\t\tString[] encode;\n\t\t\t\tif (entry.writeAs.equals(ImageConstants.ZLIB)\n\t\t\t\t\t\t|| (entry.maskName != null)) {\n\t\t\t\t\tencode = new String[] { \"Flate\", \"ASCII85\" };\n\t\t\t\t} else if (entry.writeAs.equals(ImageConstants.JPG)) {\n\t\t\t\t\tencode = new String[] { \"DCT\", \"ASCII85\" };\n\t\t\t\t} else {\n\t\t\t\t\tencode = new String[] { null, \"ASCII85\" };\n\t\t\t\t}\n\n\t\t\t\tPDFStream img = pdf.openStream(entry.name);\n\t\t\t\timg.entry(\"Subtype\", pdf.name(\"Image\"));\n\t\t\t\tif (entry.maskName != null) {\n\t\t\t\t\timg.entry(\"SMask\", pdf.ref(entry.maskName));\n\t\t\t\t}\n\t\t\t\timg.image(entry.image, entry.bkg, encode);\n\t\t\t\tpdf.close(img);\n\n\t\t\t\tif (entry.maskName != null) {\n\t\t\t\t\tPDFStream mask = pdf.openStream(entry.maskName);\n\t\t\t\t\tmask.entry(\"Subtype\", pdf.name(\"Image\"));\n\t\t\t\t\tmask.imageMask(entry.image, encode);\n\t\t\t\t\tpdf.close(mask);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void loadDirectoryUp() {\n\t\tString s = pathDirsList.remove(pathDirsList.size() - 1);\n\t\t// path modified to exclude present directory\n\t\tpath = new File(path.toString().substring(0,\n\t\t\t\tpath.toString().lastIndexOf(s)));\n\t\tfileList.clear();\n\t}", "private void loadImages(){\n try{\n System.out.println(System.getProperty(\"user.dir\"));\n\n t1img = read(new File(\"resources/tank1.png\"));\n t2img = read(new File(\"resources/tank1.png\"));\n backgroundImg = read(new File(\"resources/background.jpg\"));\n wall1 = read(new File(\"resources/Wall1.gif\"));\n wall2 = read(new File(\"resources/Wall2.gif\"));\n heart = resize(read(new File(\"resources/Hearts/basic/heart.png\")), 35,35);\n heart2 = resize(read( new File(\"resources/Hearts/basic/heart.png\")), 25,25);\n bullet1 = read(new File(\"resources/bullet1.png\"));\n bullet2 = read(new File(\"resources/bullet2.png\"));\n\n }\n catch(IOException e){\n System.out.println(e.getMessage());\n }\n }", "private static void rAddFilesToArray(File workingDirectory, ArrayList<File> result) {\n File[] fileList = workingDirectory.listFiles();\n if (fileList == null) return;\n for (File file : fileList) {\n String name = file.getName();\n int lastDotIndex = name.lastIndexOf('.');\n String ext = (lastDotIndex == -1) ? \"\" : name.substring(lastDotIndex + 1);\n if (file.isDirectory())\n rAddFilesToArray(file, result);\n if (!file.equals(remainderFile) && ext.equals(\"xml\")) {\n result.add(file);\n }\n }\n }", "private void fill( File fileDirectory )\n\t{\n\t\t// title\n\t\tsetTitle( fileDirectory.getAbsolutePath() );\n\n\t\t// file list\n\t\tFile[] aFile = fileDirectory.listFiles( getFileFilter() );\n\t\tList<FileInfo> listFileInfo = new ArrayList<FileInfo>();\n\t\tif( null != aFile )\n\t\t{\n\t\t\tfor( File fileTemp : aFile )\n\t\t\t{\n\t\t\t\tlistFileInfo.add( new FileInfo( fileTemp.getName(), fileTemp ) );\n\t\t\t}\n\t\t\tCollections.sort( listFileInfo );\n\t\t}\n\t\t// Add peth to back to parent folder\n\t\tif( null != fileDirectory.getParent() )\n\t\t{\n\t\t\tlistFileInfo.add( 0, new FileInfo( \"..\", new File( fileDirectory.getParent() ) ) );\n\t\t}\n\n\t\tm_fileinfoarrayadapter = new FileInfoArrayAdapter( this, listFileInfo );\n\t\tm_listview.setAdapter( m_fileinfoarrayadapter );\n\t}", "private static List<File> listChildFiles(File dir) throws IOException {\n\t\t List<File> allFiles = new ArrayList<File>();\n\t\t \n\t\t File[] childFiles = dir.listFiles();\n\t\t for (File file : childFiles) {\n\t\t if (file.isFile()) {\n\t\t allFiles.add(file);\n\t\t } else {\n\t\t List<File> files = listChildFiles(file);\n\t\t allFiles.addAll(files);\n\t\t }\n\t\t }\n\t\t return allFiles;\n\t\t }", "public static void processDirectory(String directory) {\n processDirectory(new File(directory));\n }", "@Override\n public void onChanged(@Nullable final List<Image> images) {\n adapter.setImages(images);\n }", "public void refreshImages() {\n\t\tsetContentView(R.layout.activity_overview);\n\t\trow = 0;\n\t\tcolumn = 0;\n\t\t// Open the file\n\t\tFile file = new File(getFilesDir().getAbsoluteFile() + \"/photos.txt\");\n\t\tLog.i(TAG, file.getAbsolutePath());\n\t\t// If there is no file, create a new one\n\t\tif (!file.exists()) {\n\t\t\ttry {\n\t\t\t\tfile.createNewFile();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\t// Open an inputStream for reading the file\n\t\t\tFileInputStream inStream = openFileInput(\"photos.txt\");\n\t\t\tBufferedReader readFile = new BufferedReader(new InputStreamReader(inStream));\n\t\t\tpicturePaths = new ArrayList<String>();\n\t\t\tString receiveString = \"\";\n\t\t\t// Read in each line\n\t\t\twhile ((receiveString = readFile.readLine()) != null) {\n\t\t\t\t// Add the line to picturePaths and add an Image with the path specified\n\t\t\t\tpicturePaths.add(receiveString);\n\t\t\t\tLog.i(\"picture\", receiveString);\n\t\t\t\taddImage(receiveString);\n\t\t\t\treceiveString = \"\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void reloadFiles()\n {\n for (Reloadable rel : reloadables)\n {\n rel.reload();\n }\n }", "private void changeDirectory()\n {\n directory = SlideshowManager.getDirectory(this); //use SlideshowManager to select a directory\n\n if (directory != null) //if a valid directory was selected...\n {\n JFrame loading = new JFrame(\"Loading...\");\n Image icon = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB_PRE);\n loading.setIconImage(icon);\n loading.setResizable(false);\n loading.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);\n loading.setSize(new Dimension(250,30));\n loading.setLocationRelativeTo(null);\n loading.setVisible(true);\n\n timeline.reset();\n timeline.setSlideDurationVisible(automated);\n timeline.setDefaultSlideDuration(slideInterval);\n\n m_ImageLibrary = ImageLibrary.resetLibrary(timeline, directory); //...reset the libraries to purge the current contents...\n JScrollPane spImages = new JScrollPane(m_ImageLibrary);\n spImages.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);\n spImages.getVerticalScrollBar().setUnitIncrement(20);\n libraries.remove(0);\n libraries.add(\"Images\", spImages);\n \n m_AudioLibrary.resetAudio();\n m_AudioLibrary = AudioLibrary.resetLibrary(timeline, directory);\n JScrollPane spAudio = new JScrollPane(m_AudioLibrary);\n spAudio.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);\n spAudio.getVerticalScrollBar().setUnitIncrement(20);\n libraries.remove(0);\n libraries.add(\"Audio\", spAudio);\n\n loading.dispose();\n }\n }", "private void reloadIconBaseDirs() {\n\t\t\n\t\t// Load dirs from XDG_DATA_DIRS\n\t\tString xdg_dir_env = System.getenv(\"XDG_DATA_DIRS\");\n\t\tif(xdg_dir_env != null && !xdg_dir_env.isEmpty()) {\n\t\t\tString[] xdg_dirs = xdg_dir_env.split(\":\");\n\t\t\tfor(String xdg_dir : xdg_dirs) {\n\t\t\t\taddDirToList(new File(xdg_dir, \"icons\"), iconBaseDirs);\n\t\t\t\taddDirToList(new File(xdg_dir, \"pixmaps\"), iconBaseDirs);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Load user's icon dir\n\t\taddDirToList(new File(System.getProperty(\"user.home\"), \".icons\"), iconBaseDirs);\n\t\taddDirToList(new File(System.getProperty(\"user.home\"), \".local/share/icons\"), iconBaseDirs);\n\t\t\n\t}", "public void cleanup(Set<String> currentImages) {\n if (currentImages.size() == 0) return;\n\n Set<String> currentFiles = new HashSet<String>(currentImages.size());\n for (String url : currentImages) currentFiles.add(getFileName(url));\n File[] files = cacheDir.listFiles();\n if (files == null) return;\n for (File f : files) {\n long timestamp = f.lastModified();\n if ((System.currentTimeMillis() > (timestamp + MAX_FILE_AGE_MILLIS)) ||\n (!currentFiles.contains(f.getName()))) {\n f.delete();\n }\n }\n }", "public void updateImageForIndex(int index) {\n\t\t//Nothing to do\n\t}", "private void refreshTagsTree(){\n List<TreeItem<String>> treeItemsList = new ArrayList<TreeItem<String>>();\n USER.getImagesByTags().forEach((key, value) -> {\n TreeItem<String> tagTreeItem = new TreeItem<>(key);\n tagTreeItem.getChildren().setAll(\n value.stream()\n .map(imageData -> new TreeItem<>(IMAGE_DATA.inverse().get(imageData).getName()))\n .collect(Collectors.toList())\n );\n treeItemsList.add(tagTreeItem);\n });\n ROOT.getChildren().setAll(treeItemsList);\n }", "@Override\n\tpublic List<ImageEntity> getAll() {\n\t\treturn DatabaseContext.findAll(ImageEntity.class);\n\t}", "@Override\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\n\t\t//exposes photos in the user-photo directory\n\t\t\n\t\tString dirName = \"user-photos\";\n\t\t//directory path\n\t\tPath userPhotosDir = Paths.get(dirName);\n\t\t\n\t\t//get absolute path\n\t\tString userPhotosPath = userPhotosDir.toFile().getAbsolutePath();\n\t\t\n\t\tregistry.addResourceHandler(\"/\" + dirName + \"/**\")\n\t\t.addResourceLocations(\"file:/\" + userPhotosPath + \"/\");\n\t\t\n\t\t//exposes images in category-image directory\n\t\tString categoryImagesDirName = \"../category-images\";\n\t\t//directory path\n\t\tPath categoryImagesDir = Paths.get(categoryImagesDirName);\n\t\t\n\t\t//get absolute path\n\t\tString categoryImagesPath = categoryImagesDir.toFile().getAbsolutePath();\n\t\t\n\t\tregistry.addResourceHandler(\"/category-images/**\")\n\t\t.addResourceLocations(\"file:/\" + categoryImagesPath + \"/\");\n\t}", "public void loadImages() {\n\t\tcowLeft1 = new ImageIcon(\"images/animal/cow1left.png\");\n\t\tcowLeft2 = new ImageIcon(\"images/animal/cow2left.png\");\n\t\tcowLeft3 = new ImageIcon(\"images/animal/cow1left.png\");\n\t\tcowRight1 = new ImageIcon(\"images/animal/cow1right.png\");\n\t\tcowRight2 = new ImageIcon(\"images/animal/cow2right.png\");\n\t\tcowRight3 = new ImageIcon(\"images/animal/cow1right.png\");\n\t}", "public void loadTileImages() {\n // keep looking for tile A,B,C, etc. this makes it\n // easy to drop new tiles in the images/ directory\n tiles = new ArrayList();\n char ch = 'A';\n while (true) {\n String name = \"tile_\" + ch + \".png\";\n File file = new File(\"images/\" + name);\n if (!file.exists()) {\n break;\n }\n tiles.add(loadImage(name));\n ch++;\n }\n }", "private void cacheFoldersFiles() throws Exception {\n\n ArrayList<FileManagerFile> files = new ArrayList<FileManagerFile>();\n if (fileCount > 0) {\n SimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\");\n formatter.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\n int offset = 0;\n int count = 1000;\n List<FileManagerFile> filelist;\n\n do {\n filelist = connection.getFileManager().getFileManagerFiles(count, offset);\n offset += count;\n for (FileManagerFile file : filelist) {\n if (file.getFolderId() == id) {\n files.add(file);\n }\n }\n } while (filelist.size() > 0 && files.size() < fileCount);\n }\n this.files = files;\n }", "private static void getFiles(String root, Vector files) {\n Location f = new Location(root);\n String[] subs = f.list();\n if (subs == null) subs = new String[0];\n Arrays.sort(subs);\n \n // make sure that if a config file exists, it is first on the list\n for (int i=0; i<subs.length; i++) {\n if (subs[i].endsWith(\".bioformats\") && i != 0) {\n String tmp = subs[0];\n subs[0] = subs[i];\n subs[i] = tmp;\n break;\n }\n }\n \n if (subs == null) {\n LogTools.println(\"Invalid directory: \" + root);\n return;\n }\n \n ImageReader ir = new ImageReader();\n Vector similarFiles = new Vector();\n \n for (int i=0; i<subs.length; i++) {\n LogTools.println(\"Checking file \" + subs[i]);\n subs[i] = new Location(root, subs[i]).getAbsolutePath();\n if (isBadFile(subs[i]) || similarFiles.contains(subs[i])) {\n LogTools.println(subs[i] + \" is a bad file\");\n String[] matching = new FilePattern(subs[i]).getFiles();\n for (int j=0; j<matching.length; j++) {\n similarFiles.add(new Location(root, matching[j]).getAbsolutePath());\n }\n continue;\n }\n Location file = new Location(subs[i]);\n \n if (file.isDirectory()) getFiles(subs[i], files);\n else if (file.getName().equals(\".bioformats\")) {\n // special config file for the test suite\n configFiles.add(file.getAbsolutePath());\n }\n else {\n if (ir.isThisType(subs[i])) {\n LogTools.println(\"Adding \" + subs[i]);\n files.add(file.getAbsolutePath());\n }\n else LogTools.println(subs[i] + \" has invalid type\");\n }\n file = null;\n }\n }", "private static void replaceAssetsReferencesInDirImpl(Path dir, Path rootDir, Map<String, String> assetSubstitutes,\n Properties generatorSettings) throws IOException {\n // Replace references\n try (var htmlFiles = Files.newDirectoryStream(dir, FileFilters.htmlFilter)) {\n for (Path htmlFile : htmlFiles) {\n Document doc = Jsoup.parse(htmlFile.toFile(), \"UTF-8\");\n URI docURI = URI.create(rootDir.relativize(dir).resolve(htmlFile.getFileName()).toString());\n\n LOG.debug(String.format(\"Replacing asset references in '%s'\", htmlFile));\n replaceAssetsReferencesInDoc(doc, docURI, assetSubstitutes, generatorSettings);\n\n Files.write(htmlFile, doc.outerHtml().getBytes());\n }\n }\n\n // Replace refs in sub directories\n try (var subDirs = FileFilters.subDirStream(dir)) {\n for (var subDir : subDirs) {\n replaceAssetsReferencesInDirImpl(subDir, rootDir, assetSubstitutes, generatorSettings);\n }\n }\n }", "public ArrayList<Image> getImages() {\n\t\treturn getPageObjects(Image.class);\n\t}", "public void findImages() {\n URL imgURL = ImageLoader.class.getResource(\"/BackgroundMenu.jpg\");\n this.backgroundImages.put(MenuP.TITLE, loadImage(imgURL));\n\n imgURL = ImageLoader.class.getResource(\"/backgroundGame.png\");\n this.backgroundImages.put(ArenaView.TITLE, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/gameOver.jpg\");\n this.backgroundImages.put(GameOverView.TITLE, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Player.png\");\n this.entityImages.put(ID.PLAYER, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Enemy1.png\");\n this.entityImages.put(ID.BASIC_ENEMY, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/boss.png\");\n this.entityImages.put(ID.BOSS_ENEMY, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/meteorBrown_big1.png\");\n this.entityImages.put(ID.METEOR, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/BlueBullet.png\");\n this.bulletImages.put(new Pair<>(ID.PLAYER_BULLET, ID.PLAYER), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/redBullet.png\");\n this.entityImages.put(ID.ENEMY_BULLET, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_FireBoost.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.FIRE_BOOST), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_Freeze.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.FREEZE), loadImage(imgURL)); \n \n imgURL = ImageLoader.class.getResource(\"/powerup_Health.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.HEALTH), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_Shield.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.SHIELD), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/bulletSpeedUp.png\");\n this.AnimationsPowerUp.put(new Pair<>(ID.POWER_UP, PowerUpT.FIRE_BOOST), loadEffect(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Explosion.png\");\n this.AnimationsEffect.put(new Pair<>(ID.EFFECT, SpecialEffectT.EXPLOSION), loadEffect(imgURL));\n\n imgURL = ImageLoader.class.getResource(\"/freeze.png\");\n this.AnimationsPowerUp.put(new Pair<>(ID.POWER_UP, PowerUpT.FREEZE), loadImage(imgURL));\n }", "public static void flushImageCache() {\n // Only clear this as normally it will be at least an order of magnitude greater than the\n // other maps used for caching images.\n rotatedImages.clear();\n }", "@Override\n public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {\n if (!this.sourceDirectory.equals(dir)) {\n this.currentTargetDirectory = this.currentTargetDirectory.getParent();\n }\n return FileVisitResult.CONTINUE;\n }", "public ImageFiles() {\n\t\tthis.listOne = new ArrayList<String>();\n\t\tthis.listTwo = new ArrayList<String>();\n\t\tthis.listThree = new ArrayList<String>();\n\t\tthis.seenImages = new ArrayList<String>();\n\t\tthis.unseenImages = new ArrayList<String>();\n\t}", "private void processFolders(List<File> folderList, java.io.File parentFolder) {\n // process each folder to see if it needs to be updated;\n for (File f : folderList) {\n String folderName = f.getTitle();\n java.io.File localFolder = new java.io.File(parentFolder, folderName);\n Log.e(\"folder\",localFolder.getAbsolutePath());\n if (!localFolder.exists())\n localFolder.mkdirs();\n getFolderContents(f, localFolder);\n }\n }", "public void updateImage() {\n Graphics2D g = img.createGraphics();\n for (Circle gene : genes) {\n gene.paint(g);\n }\n g.dispose();\n }", "public static void loadImages() {\n PonySprite.loadImages(imgKey, \"graphics/ponies/GrannySmith.png\");\n }", "public void addToCache () {\n ArrayList <Location> gridCache = getGridCache();\n for (Location l : imageLocs) {\n gridCache.add (l);\n }\n }", "private void disposeAndDeleteAllImages() {\r\n\r\n\t\tPhotoLoadManager.stopImageLoading(true);\r\n\t\tThumbnailStore.cleanupStoreFiles(true, true);\r\n\r\n\t\tPhotoImageCache.disposeAll();\r\n\r\n\t\tExifCache.clear();\r\n\t}", "@ApiOperation(value = \"Return all images and tags within supplied registry\", response = DockerImageDataListResponse.class, produces = \"application/json\")\n\t@ApiResponses(value = { @ApiResponse(code = 200, message = \"Successfully retrieved all objects\"),\n\t\t\t@ApiResponse(code = 400, message = \"Images not found in supplied registry\") })\n\t@RequestMapping(path = \"/{registry}/all\", method = RequestMethod.GET)\n\tpublic @ResponseBody DockerImageDataListResponse getAllImagesFromRegistry(@PathVariable String registry) {\n\t\tRegistryConnection localConnection;\n\t\tList<DockerImageData> images = new LinkedList<DockerImageData>();\n\t\ttry {\n\t\t\tlocalConnection = new RegistryConnection(configs.getURLFromName(registry));\n\n\t\t\tRegistryCatalog repos = localConnection.getRegistryCatalog();\n\t\t\t// Iterate over repos to build out DockerImageData objects\n\t\t\tfor (String repo : repos.getRepositories()) {\n\t\t\t\t// Get all tags from specific repo\n\t\t\t\tImageTags tags = localConnection.getTagsByRepoName(repo);\n\n\t\t\t\t// For each tag, get the digest and create the object based on looping values\n\t\t\t\tfor (String tag : tags.getTags()) {\n\t\t\t\t\tDockerImageData image = new DockerImageData();\n\t\t\t\t\timage.setRegistryName(registry);\n\t\t\t\t\timage.setImageName(repo);\n\t\t\t\t\timage.setTag(tag);\n\t\t\t\t\timage.setDigest(new ImageDigest(localConnection.getImageID(repo, tag)));\n\t\t\t\t\timages.add(image);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new DockerImageDataListResponse(HttpServletResponse.SC_OK,\n\t\t\t\t\t\"Successfully pulled all image:tag pairs from \" + registry, images);\n\t\t} catch (RegistryNotFoundException e) {\n\t\t\treturn null;\n\t\t}\n\t}", "public void processEvents() {\n\t\tfor (;;) {\n\n\t\t\t// wait for key to be signalled\n\t\t\tWatchKey key;\n\t\t\ttry {\n\t\t\t\tkey = watcher.take();\n\t\t\t} catch (InterruptedException x) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tPath dir = keys.get(key);\n\t\t\tif (dir == null) {\n\t\t\t\tSystem.err.println(\"WatchKey not recognized!!\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfor (WatchEvent<?> event : key.pollEvents()) {\n\t\t\t\tKind<?> kind = event.kind();\n\n\t\t\t\t// TBD - provide example of how OVERFLOW event is handled\n\t\t\t\tif (kind == OVERFLOW) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Context for directory entry event is the file name of entry\n\t\t\t\tWatchEvent<Path> ev = cast(event);\n\t\t\t\tPath name = ev.context();\n\t\t\t\tPath child = dir.resolve(name);\n\n\t\t\t\t// print out event\n\t\t\t\tif (logger.isDebugEnabled()) {\n\t\t\t\t\t// logger.debug(String.format(\"%s: %s\\n\", event.kind().name(), child));\n\t\t\t\t}\n\t\t\t\tonFileChanged(ev, child);\n\n\t\t\t\t// if directory is created, and watching recursively, then\n\t\t\t\t// register it and its sub-directories\n\t\t\t\tif (recursive && (kind == ENTRY_CREATE)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (Files.isDirectory(child, NOFOLLOW_LINKS)) {\n\t\t\t\t\t\t\tregisterAll(child);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (IOException x) {\n\t\t\t\t\t\t// ignore to keep sample readbale\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// reset key and remove from set if directory no longer accessible\n\t\t\tboolean valid = key.reset();\n\t\t\tif (!valid) {\n\t\t\t\tkeys.remove(key);\n\n\t\t\t\t// all directories are inaccessible\n\t\t\t\tif (keys.isEmpty()) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public Builder addAllImagesByHandler(\n java.lang.Iterable<? extends com.yahoo.xpathproto.TransformTestProtos.ContentImage> values) {\n if (imagesByHandlerBuilder_ == null) {\n ensureImagesByHandlerIsMutable();\n super.addAll(values, imagesByHandler_);\n onChanged();\n } else {\n imagesByHandlerBuilder_.addAllMessages(values);\n }\n return this;\n }", "private void imageSearch(ArrayList<Html> src) {\n // loop through the Html objects\n for(Html page : src) {\n\n // Temp List for improved readability\n ArrayList<Image> images = page.getImages();\n\n // loop through the corresponding images\n for(Image i : images) {\n if(i.getName().equals(this.fileName)) {\n this.numPagesDisplayed++;\n this.pageList.add(page.getLocalPath());\n }\n }\n }\n }", "private void scanDirectory(final File directory) throws AnalyzerException {\n\t\tFile[] files = directory.listFiles();\n\t\tfor (File f : files) {\n\t\t\t// scan .class file\n\t\t\tif (f.isFile() && f.getName().toLowerCase().endsWith(\".class\")) {\n\t\t\t\tInputStream is = null;\n\t\t\t\ttry {\n\t\t\t\t\tis = new FileInputStream(f);\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\tthrow new AnalyzerException(\n\t\t\t\t\t\t\t\"Cannot read input stream from '\"\n\t\t\t\t\t\t\t\t\t+ f.getAbsolutePath() + \"'.\", e);\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tnew ClassReader(is).accept(scanVisitor,\n\t\t\t\t\t\t\tClassReader.SKIP_CODE);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tthrow new AnalyzerException(\n\t\t\t\t\t\t\t\"Cannot launch class visitor on the file '\"\n\t\t\t\t\t\t\t\t\t+ f.getAbsolutePath() + \"'.\", e);\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tis.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new AnalyzerException(\n\t\t\t\t\t\t\t\"Cannot close input stream on the file '\"\n\t\t\t\t\t\t\t\t\t+ f.getAbsolutePath() + \"'.\", e);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// loop on childs\n\t\t\t\tif (f.isDirectory()) {\n\t\t\t\t\tscanDirectory(f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.8071878", "0.73567533", "0.72230315", "0.70321447", "0.6847166", "0.6623378", "0.63261145", "0.62231773", "0.61737776", "0.60001826", "0.5752656", "0.57161874", "0.56287193", "0.5544961", "0.54636806", "0.54493654", "0.5437295", "0.5434152", "0.5349829", "0.5313424", "0.5298635", "0.52436656", "0.5193899", "0.51905876", "0.5151377", "0.5146338", "0.51269454", "0.5115615", "0.51110464", "0.5110067", "0.5085949", "0.5060972", "0.5048994", "0.50301766", "0.5019099", "0.5011856", "0.49999294", "0.49977037", "0.4970288", "0.4964551", "0.49387074", "0.4938691", "0.493674", "0.49230617", "0.4908759", "0.489891", "0.4894765", "0.4892932", "0.4847625", "0.48443478", "0.4844184", "0.48298094", "0.4821731", "0.47973076", "0.4790994", "0.4786373", "0.47816357", "0.47795334", "0.4776616", "0.47732547", "0.4770147", "0.47683144", "0.47628936", "0.47587237", "0.47456685", "0.4745542", "0.4744755", "0.47343555", "0.47316462", "0.4714352", "0.47137484", "0.4712495", "0.4710727", "0.47048762", "0.4699811", "0.46873912", "0.4686319", "0.46844515", "0.46832624", "0.4677797", "0.46502954", "0.4644355", "0.46430632", "0.46398333", "0.4638372", "0.4636055", "0.46359083", "0.46328536", "0.4631817", "0.46273857", "0.46255106", "0.46221521", "0.46216935", "0.4618855", "0.4617549", "0.46155694", "0.46098644", "0.46054533", "0.46052408", "0.45977408" ]
0.81781566
0
Adds this observer to all the image files
public void addObserversToImageFiles(Observer observer) { for (ImageFile imageFile : allImagesUnderDirectory) { imageFile.addObserver(observer); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void registerObserver(AchieveImageController controller);", "@Override\n public void refreshUI(final List<OIFitsFile> oifitsFiles) {\n for (OIFitsFile oifitsFile : oifitsFiles) {\n // fire OIFitsCollectionChanged:\n addOIFitsFile(oifitsFile);\n }\n }", "private void observerStuff() {\r\n\t\tfor (PirateShip pirate : pirates) {\r\n\t\t\tship.registerObserver(pirate);\r\n\t\t}\r\n\t}", "@Override\n public void onChanged(@Nullable final List<Image> images) {\n adapter.setImages(images);\n }", "@Override\n public void notifyObservers() {\n for (Observer observer : observers){\n // observers will pull the data from the observer when notified\n observer.update(this, null);\n }\n }", "public interface ImageModListener {\n void setImage(ArrayList<Integer> image);\n }", "@Override\n public void addObserver(Observer observer) {\n observers.add(observer);\n }", "@Override\n public void addObserver(IObserver observer) {\n observersList.add(observer);\n }", "@Override\n public void reportMaterializedPictures(Observable<MaterializedPicture> files) {\n \n }", "public void fireImageChange() {\n if (fireRequired) {\n observer.fire(transform());\n fireRequired = false;\n }\n }", "private void notifyListeners(ImageDownloadTask imageDownloadTask) {\n imageDownloadTaskMap.remove(imageDownloadTask.getStringUrl());\n if (imageDownloadTask.getBitmapImage() != null) {\n for (ImageRetrieverListener listener : listeners) {\n listener.newImageAvailable(imageDownloadTask.getStringUrl(), imageDownloadTask.getBitmapImage());\n }\n }\n }", "@Override\n public void notifyObserver() {\n for(Observer o:list){\n o.update(w);\n }\n }", "void addImageViewListeners() {\n\t\tfor (int i=0; i<NUM[TOTAL]; i++) {\n\t\t\tpieceViews.get(i).setOnClickListener(this); //OnClickListener for rotation \n\t\t\tpieceViews.get(i).setOnLongClickListener(this); //OnLongClickListener to start dragging\n\t\t\tpieceViews.get(i).setOnDragListener(new DragListener()); //OnDragListener for dragging\t\t\t\n\t\t}\n\t}", "@Override\r\n\tpublic void notifyObservers() {\n\t\tfor(Observer o : list) {\r\n\t\t\t// Atualiza a informacao no observador\r\n\t\t\to.update(this, this);\r\n\t\t}\r\n\t}", "@Override\n public void run() {\n\n\n try {\n WatchService watchService = FileSystems.getDefault().newWatchService();\n Path path = Paths.get(INPUT_FILES_DIRECTORY);\n\n path.register( watchService, StandardWatchEventKinds.ENTRY_CREATE); //just on create or add no modify?\n\n WatchKey key;\n while ((key = watchService.take()) != null) {\n for (WatchEvent<?> event : key.pollEvents()) {\n\n String fileName = event.context().toString();\n notifyController.processDetectedFile(fileName);\n\n }\n key.reset();\n }\n\n } catch (Exception e) {\n //Logger.getGlobal().setUseParentHandlers(false);\n //Logger.getGlobal().log(Level.SEVERE, e.toString(), e);\n\n }\n }", "@Override\n public void addObserver(Observer obs) {\n drawingTools.addObserver(obs);\n }", "public void addObserver(Object observer, NSSelector selector, File file) {\n if (file == null)\n throw new RuntimeException(\"Attempting to register a null file.\");\n if (observer == null)\n throw new RuntimeException(\"Attempting to register null observer for file: \" + file);\n if (selector == null)\n throw new RuntimeException(\"Attempting to register null selector for file: \" + file);\n if (!developmentMode && checkFilesPeriod() == 0) {\n log.info(\"Registering an observer when file checking is disabled (WOCaching must be \" +\n \"disabled or the er.extensions.ERXFileNotificationCenter.CheckFilesPeriod \" +\n \"property must be set). This observer will not ever by default be called: {}\", file);\n }\n String filePath = cacheKeyForFile(file);\n log.debug(\"Registering Observer for file at path: {}\", filePath);\n // Register last modified date.\n registerLastModifiedDateForFile(file);\n // FIXME: This retains the observer. This is not ideal. With the 1.3 JDK we can use a ReferenceQueue to maintain weak references.\n NSMutableSet observerSet = (NSMutableSet)_observersByFilePath.objectForKey(filePath);\n if (observerSet == null) {\n observerSet = new NSMutableSet();\n _observersByFilePath.setObjectForKey(observerSet, filePath);\n }\n observerSet.addObject(new _ObserverSelectorHolder(observer, selector));\n }", "@Override\n void attach(Observer observer) {\n observers.add(observer);\n }", "public void setImages() {\n\n imgBlock.removeAll();\n imgBlock.revalidate();\n imgBlock.repaint();\n labels = new JLabel[imgs.length];\n for (int i = 0; i < imgs.length; i++) {\n\n labels[i] = new JLabel(new ImageIcon(Toolkit.getDefaultToolkit().createImage(imgs[i].getSource())));\n imgBlock.add(labels[i]);\n\n }\n\n SwingUtilities.updateComponentTreeUI(jf); // refresh\n initialized = true;\n\n }", "public void addObserver(Object observer, NSSelector selector, String filePath) {\n if (filePath == null)\n throw new RuntimeException(\"Attempting to register observer for null filePath.\");\n addObserver(observer, selector, new File(filePath)); \n }", "@Override\n\tpublic void Notify() {\n\t\tfor (Observer observer : obs) {\n\t\t\tobserver.update();\n\t\t}\n\t}", "@Override\n public void refreshUI(final List<OIFitsFile> oifitsFiles) {\n // add OIFits files to collection = fire OIFitsCollectionChanged:\n super.refreshUI(oifitsFiles);\n\n listener.done(false);\n }", "@Override\n public void attach(IObserver observer) {\n listeners.add(observer);\n }", "public Builder addAllImagesByHandler(\n java.lang.Iterable<? extends com.yahoo.xpathproto.TransformTestProtos.ContentImage> values) {\n if (imagesByHandlerBuilder_ == null) {\n ensureImagesByHandlerIsMutable();\n super.addAll(values, imagesByHandler_);\n onChanged();\n } else {\n imagesByHandlerBuilder_.addAllMessages(values);\n }\n return this;\n }", "@Override\r\n\tpublic void notifyObservers() {\n\t for(Observer o : observers){\r\n\t\t o.update();\r\n\t }\r\n\t}", "@PostConstruct\n public void onStart() {\n final String path = \"/images/\";\n try {\n final Path path_of_resource = getPathOfResource(path);\n saveImagesFolder(path_of_resource);\n } catch (final IOException e1) {\n e1.printStackTrace();\n }\n }", "public void addListeners() {\n\t\timages[TOP].setOnClickListener(top);\t\n\t\timages[BOTTOM].setOnClickListener(bottom);\n\t\timages[TOP].setOnLongClickListener(topsave);\t\n\t\timages[BOTTOM].setOnLongClickListener(bottomsave);\n }", "void enableObserver() {\n dataSourcesPanel.addObserver(this);\n }", "public void notifyObservers() {\n for (int i = 0; i < observers.size(); i++) {\n Observer observer = (Observer)observers.get(i);\n observer.update(this.durum);\n }\n }", "@Override\n void notifys() {\n for (Observer o : observers) {\n o.update();\n }\n }", "public void on_append(ActionEvent actionEvent) {\r\n\t\tFile[] files = CommonTool.get_imagefiles( _open_directory_key, _parent);\r\n\t\tif ( null == files)\r\n\t\t\treturn;\r\n\r\n\t\tappend( files);\r\n\t}", "@Override\r\n\tpublic void notifyObservers() {\n\t\tfor (Observer o : this.observers) {\r\n\t\t\to.update();\r\n\t\t}\r\n\t}", "public interface WikiImagesModelObserver {\n\t\tpublic void onStartFetchingImages();\n\t\tpublic void onErrorOccurred();\n\t\tpublic void onEndFetchingImages(Vector<WikiImage> wikiImages);\n\t}", "@Override\n public void refreshUI(final List<OIFitsFile> oifitsFiles) {\n // first reset if this we do not add files only:\n if (!appendOIFitsFilesOnly) {\n reset();\n }\n\n // add OIFits files to collection = fire OIFitsCollectionChanged:\n super.refreshUI(oifitsFiles);\n\n if (!appendOIFitsFilesOnly) {\n postLoadOIFitsCollection(file, oiDataCollection, checker);\n }\n\n listener.done(false);\n }", "public interface addImgListener {\n void onAdd();\n void onChange(int pos);\n void onDelete(int pos);\n}", "@Override\n\tpublic void notifys() {\n\t\tfor(Observer observer : observers) {\n\t\t\tobserver.update(this);\n\t\t}\n\t}", "@Override\n protected void onProgressUpdate(ImageRecord... imageRecords) {\n for(ImageRecord imageRecord : imageRecords) {\n mAdapter.addImageRecord(imageRecord);\n Log.d(\"-------\", \"adding record \" + ++cnt);\n }\n }", "public Charlie(ArrayList charlieimages){\n this.charlieimages= charlieimages;\n /*charlieimages=new ArrayList<String>();\n //charlieimages.add(\"06.png\");\n charlieimages.add(\"06.png\");\n charlieimages.add(\"08.png\");\n charlieimages.add(\"08.png\");\n charlieimages.add(\"07.png\"); \n charlieimages.add(\"07.png\");*/\n \n iRepository=new ImageRepository(charlieimages);\n iIterator=iRepository.createIterator();\n observers=new ArrayList();\n lifeobservers=new ArrayList();\n }", "@Override\n\tpublic void attach(Observer observer) {\n\t\tobs.add(observer);\n\t}", "public void addObserver(jObserver observer);", "@Override\n\tpublic void notifyObservers() {\n\t\tfor (Observer obs : this.observers)\n\t\t{\n\t\t\tobs.update();\n\t\t}\n\t}", "@Override\n public void onBitmapReady(String id, String filePath) {\n if(icons.containsKey(id)){\n icons.get(id).setDrawable(ImageDownloaderService.fetchBitmapDrawable(filePath));\n displayAdapter.notifyIconChanged(id);\n }\n }", "@Override\r\n\tpublic void addObserver(IObserver obs){\r\n\t\tif(obs != null){\r\n\t\t\tobservers.add(obs);\r\n\t\t}\r\n\t}", "private void updateFiles() {\n\t}", "public void addNotify()\n {\n super.addNotify();\n\t\n ib = createImage(width,height);\n ig = ib.getGraphics(); \n }", "@Override\n public void subscribe(Observer observer) {\n this.observers.add(observer);\n }", "public ImageFiles() {\n\t\tthis.listOne = new ArrayList<String>();\n\t\tthis.listTwo = new ArrayList<String>();\n\t\tthis.listThree = new ArrayList<String>();\n\t\tthis.seenImages = new ArrayList<String>();\n\t\tthis.unseenImages = new ArrayList<String>();\n\t}", "public void notifyObservers() {\r\n for (Observer observer: this.observers) {\r\n observer.update(this);\r\n }\r\n\r\n// System.out.println(this);\r\n }", "public void addObserver(IObserver observer)\n {\n observers.add(observer);\n }", "public void notifyObserver() {\n\r\n for (Observer observer : observers) {\r\n\r\n observer.update(stockName, price);\r\n\r\n }\r\n }", "private void addImgList() {\n\t\tdogImg.add(\"./data/img/labrador.jpg\");\t\t\t\t\n\t\tdogImg.add(\"./data/img/germanshepherd.jpg\");\t\n\t\tdogImg.add(\"./data/img/bulldog.jpg\");\t\t\t\t\t\t\t\t\n\t\tdogImg.add(\"./data/img/rottweiler.jpg\");\n\t\tdogImg.add(\"./data/img/husky.jpg\");\n\n\t}", "public void addObservers(List<BiObserver<T, V>> l){\n biObserverList.addAll(l);\n }", "private void runGet() {\n File myFile = new File(\"sdcard/Pictures/Screenshots\");\n //File myFile = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), SCREENSHOTS_DIR_NAME);\n //File myFile = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), \"\");\n //File myFile = new File(\"sdcard/DCIM/Screenshots\"); // L\n Log.i(TAG, \"Observing is clicked... path : \" + myFile.getPath());\n NewScreenshotObserver observer = new NewScreenshotObserver(myFile.getAbsolutePath());\n observer.startWatching();\n Log.i(TAG, \"Oberving is started\");\n\n //monitorAllFiles(myFile);\n Handler handler = new Handler(Looper.getMainLooper());\n co = new MyContentObserver(this, handler);\n getContentResolver().registerContentObserver(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, true, co);\n\n try {\n while(!Thread.currentThread().isInterrupted()) {\n Log.i(TAG, \"I am observer sdcard\");\n Thread.sleep(THREAD_SLEEP_TIME);\n }\n } catch(InterruptedException e) {\n }\n }", "protected void registerObserver(Observer.GraphAttributeChanges observer) {\n observers.add(observer);\n }", "public void addObserver(Observer obs) {\n this.listObserver.add(obs);\n }", "public void run() {\nif(i[0] ==le.size()){\n i[0]=0;}\n File file = new File(\"/var/www/html/PawsAndClaws/web/bundles/uploads/brochures/\" + le.get( i[0]).getBrochure());\n\n Image it = new Image(file.toURI().toString(), 500, 310, false, false);\n eventspicture.setImage(it);\n i[0]++;\n }", "private void notifyObservers() {\n\t\tIterator<Observer> i = observers.iterator();\r\n\t\twhile( i.hasNext() ) {\r\n\t\t\tObserver o = ( Observer ) i.next();\r\n\t\t\to.update( this );\r\n\t\t}\r\n\t}", "protected void initModifiedListeners()\n\t{\n\t\tif (path != null)\n\t\t{\n\t\t\tpath.addModifiedListener(this);\n\t\t}\n\t}", "public void notifyStartRetrievingArtistImages(long id);", "public void fireListenersOnPaths(Collection<IPath> pathList) {\r\n\t\tfor (Pair<IPath, IResourceChangeHandler> entry : trackedResources) {\r\n\t\t\tif (pathList.contains(entry.first)) {\r\n\t\t\t\tentry.second.resourceChanged(entry.first);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}", "private void OnInflated() \r\n { \r\n if (_inflatedList != null)\r\n { \r\n for/*each*/ (ResourceReferenceExpression listener : _inflatedList)\r\n {\r\n listener.OnDeferredResourceInflated(this);\r\n } \r\n }\r\n }", "private void registerObservers() {\n ColorChooser.addObserver(new GeneralObserver() {\n @Override\n public void update() {\n color = ColorChooser.getColor();\n }\n });\n }", "private void notifyidiots() {\n\t\tfor(Observ g:obslist) {\n\t\t\tg.update();\n\t\t}\n\t}", "public void notifyObservers(){\n for (GameObserver g: observers){\n g.handleUpdate(new GameEvent(this,\n currentPlayer,\n genericWorldMap,\n gameState,\n currentTerritoriesOfInterest,\n currentMessage));\n }\n }", "private void addHandlers()\n {\n handlers.add(new FileHTTPRequestHandler());\n }", "private void createImageFiles() {\n\t\tswitchIconClosed = Icon.createImageIcon(\"/images/events/switchImageClosed.png\");\n\t\tswitchIconOpen = Icon.createImageIcon(\"/images/events/switchImageOpen.png\");\n\t\tswitchIconEmpty = Icon.createImageIcon(\"/images/events/switchImageEmpty.png\");\n\t\tswitchIconOff = Icon.createImageIcon(\"/images/events/switchImageOff.png\");\n\t\tswitchIconOn = Icon.createImageIcon(\"/images/events/switchImageOn.png\");\n\t\tleverIconClean = Icon.createImageIcon(\"/images/events/leverImageClean.png\");\n\t\tleverIconRusty = Icon.createImageIcon(\"/images/events/leverImageRusty.png\");\n\t\tleverIconOn = Icon.createImageIcon(\"/images/events/leverImageOn.png\");\n\t}", "private void addFileOpenListener() {\n\t\tview.addFileOpenListener(new FileOpenListener());\n\t}", "public abstract void addObserver(Observer observer);", "@Override\r\n public void addObserver(Observer o) {\r\n observers.add(o);\r\n }", "public void addObservers(List<RegisterObserver> observers){\r\n registerObservers.addAll(observers);\r\n }", "@Override\n\tpublic void NotifyObserver() {\n\n\t}", "@Override\n public void addObserver(Utilities.Observer o) {\n observers.add(o);\n }", "@Override\r\n\tpublic void registerObserver(Observer observer) {\n\t\t\r\n\t}", "private void initImages() {\n mImageView1WA = findViewById(R.id.comment_OWA);\n mImageView6DA = findViewById(R.id.comment_btn_6DA);\n mImageView5DA = findViewById(R.id.comment_btn_5DA);\n mImageView4DA = findViewById(R.id.comment_btn_4DA);\n mImageView3DA = findViewById(R.id.comment_btn_3DA);\n mImageView2DA = findViewById(R.id.comment_btn_2DA);\n mImageViewY = findViewById(R.id.comment_btn_1DA);\n\n imageList.add(mImageViewY);\n imageList.add(mImageView2DA);\n imageList.add(mImageView3DA);\n imageList.add(mImageView4DA);\n imageList.add(mImageView5DA);\n imageList.add(mImageView6DA);\n imageList.add(mImageView1WA);\n\n }", "public void addChangeListener(ChangeListener<BufferedImage> listener) {\n observer.add(listener);\n }", "public void reloadFiles()\n {\n for (Reloadable rel : reloadables)\n {\n rel.reload();\n }\n }", "protected void fileHasChanged(File file) {\n NSMutableSet observers = (NSMutableSet)_observersByFilePath.objectForKey(cacheKeyForFile(file));\n if (observers == null)\n log.warn(\"Unable to find observers for file: {}\", file);\n else {\n NSNotification notification = new NSNotification(FileDidChange, file);\n for (Enumeration e = observers.objectEnumerator(); e.hasMoreElements();) {\n _ObserverSelectorHolder holder = (_ObserverSelectorHolder)e.nextElement();\n try {\n holder.selector.invoke(holder.observer, notification);\n } catch (Exception ex) {\n log.error(\"Catching exception when invoking method on observer: {}\", ex, ex);\n }\n }\n registerLastModifiedDateForFile(file); \n }\n }", "protected void register() {\r\n\t\tif ((audioFile != null) && (audioFile instanceof AudioFileURL)) {\r\n\t\t\t((AudioFileURL) audioFile).addListener(this);\r\n\t\t}\r\n\t}", "@Override\n\tpublic void addPhotos(Iterable<Photo> photos) {\n\t\t\n\t}", "public void findImages() {\n \t\tthis.mNoteItemModel.findImages(this.mNoteItemModel.getContent());\n \t}", "@Override\n public void registerObserver(Observer o) {\n list.add(o);\n \n }", "public abstract void addObserver(IObserver anIObserver);", "public interface ImageLoadedListener\n {\n public void imageLoaded(Bitmap imageBitmap);\n }", "@Override\n public void registerObserver(Observer observer) {\n observers[counterObservers++]=observer;\n\n }", "@Override\n public void addObserver(Observer o) {\n listeObservers.add(o);\n getListeMorceau();\n }", "public void setObservers(ArrayList<Observer> observers) { \n\t\tGame.ui = observers; \n\t}", "@Override\n public void addObserver(Observer o) {\n Gui_producto.observadores.add(o);\n }", "protected void updateDisplay() {\n\t\t\t// this is called when upload is completed\n\n\t\t\tString filename = getLastFileName();\n\t\t\tfor (SetupMapViewListener listener : listeners)\n\t\t\t\tlistener.shapeFileUploadedEvent(filename, new ByteArrayInputStream((byte[]) getValue()));\n\t\t}", "public Builder addImagesByHandler(com.yahoo.xpathproto.TransformTestProtos.ContentImage value) {\n if (imagesByHandlerBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureImagesByHandlerIsMutable();\n imagesByHandler_.add(value);\n onChanged();\n } else {\n imagesByHandlerBuilder_.addMessage(value);\n }\n return this;\n }", "@PostConstruct\r\n\tpublic void init() throws Exception {\r\n\r\n\t\ttry {\r\n\t\t\tgetFileList(FILE_CHANGE_LISTENER_LOC);\r\n\r\n//\t\t\tfor (File file : fileList) {\r\n//\t\t\t\t\tFileChangedListener fileChangedListener = this.fileChangedListener;\r\n//\t\t\t\t\tObject filePropertiesMap = this.filePropertiesMap;\r\n//\t\t\t\t\tMethod m = filePropertiesMap.getClass().getMethod(\r\n//\t\t\t\t\t\t\t\"refresh\", File.class);\r\n//\t\t\t\t\tm.invoke(filePropertiesMap, file);\r\n//\t\t\t\t\tFileMonitor fm = FileMonitor.getInstance();\r\n//\t\t\t\t\tfm.addFileChangedListener(file, fileChangedListener,\r\n//\t\t\t\t\t\t\tloadOnStartup);\r\n//\t\t\t\t\r\n//\t\t\t}\r\n\t\t} catch (Exception ex) {\r\n\t\t\tlogger.error(\"Error creating property map \", ex);\r\n\t\t}\r\n\r\n\t}", "public void addIObserver( IObserver iobs )\n {\n if ( observers.indexOf( iobs ) < 0 ) // only add the observer if it's \n observers.addElement( iobs ); // NOT already there.\n }", "public interface ImagePickListener\n{\n public void onSingleImagePicked(String Str_Path);\n public void onMultipleImagePicked(String[] Str_Path);\n}", "@Override\n public void notifyMapObservers() {\n for(MapObserver mapObserver : mapObservers){\n // needs all the renderInformation to calculate fogOfWar\n System.out.println(\"player map: \" +playerMap);\n mapObserver.update(this.playerNumber, playerMap.returnRenderInformation(), entities.returnUnitRenderInformation(), entities.returnStructureRenderInformation());\n entities.setMapObserver(mapObserver);\n }\n }", "private void loadFiles() {\n User user = ConnectionManager.getInstance().getUser();\n List<NoteFile> files = DatabaseManager.getInstance().getSharedFiles(user);\n ObservableList<GuiFile> guiFiles = FXCollections.observableArrayList();\n\n for (NoteFile file : files)\n guiFiles.add(new GuiFile(file));\n\n tableFiles.setItems(guiFiles);\n GUIUtils.autoResizeColumns(tableFiles);\n }", "public void addObserver(BiObserver<T, V> b){\n biObserverList.add(b);\n }", "public void run() {\n\n List<BasePanel> panels = new ArrayList<BasePanel>();\n for (int i=0; i<frame.baseCount(); i++)\n panels.add(frame.baseAt(i));\n\n int i=0;\n for (BasePanel panel : panels) {\n if (panel.isBaseChanged()) {\n if (panel.getFile() != null) {\n autoSave(panel);\n }\n }\n else {\n }\n i++;\n }\n }", "@Override\n public synchronized void addTileObserver(final TileObserver observer) {\n observers = addTileObserver(observers, observer);\n }", "public void addAll(List<ImageContent> items) {\n _data = items;\n }", "@Override\n public void notifyUnitObservers() {\n for(UnitObserver unitObserver : unitObservers){\n unitObserver.update(entities.returnUnitRenderInformation());\n entities.setUnitObserver(unitObserver);\n }\n }", "public void addObserver(FadingViewObserver observer) {\n mObservers.addObserver(observer);\n }" ]
[ "0.6313556", "0.60854423", "0.60235023", "0.5846483", "0.5793017", "0.5775222", "0.5770505", "0.5755016", "0.572242", "0.5610602", "0.5606776", "0.55949956", "0.55944175", "0.5573651", "0.55624044", "0.5561304", "0.55587626", "0.55384517", "0.552108", "0.54877144", "0.5481136", "0.5454415", "0.544117", "0.5435418", "0.54159784", "0.5386516", "0.5384685", "0.5383875", "0.5382604", "0.53784853", "0.5372453", "0.5363005", "0.5361956", "0.5351095", "0.5347877", "0.5322602", "0.53176224", "0.5307888", "0.5307455", "0.52919185", "0.5285543", "0.5280837", "0.52756476", "0.5272441", "0.52695423", "0.526833", "0.5266395", "0.5261477", "0.5252449", "0.5251112", "0.52451754", "0.52414393", "0.52335656", "0.52306557", "0.522961", "0.52121425", "0.5208397", "0.5196773", "0.51939034", "0.5190118", "0.51863897", "0.5184797", "0.5179441", "0.51790583", "0.51771426", "0.51759833", "0.51680964", "0.5162935", "0.51592535", "0.5153392", "0.5150281", "0.5148162", "0.5145904", "0.5141154", "0.51393175", "0.5137328", "0.51351696", "0.5134269", "0.51302665", "0.5129776", "0.512777", "0.51266605", "0.5126242", "0.51222783", "0.511472", "0.51109636", "0.5104197", "0.5099868", "0.5097179", "0.509471", "0.50937253", "0.5081401", "0.50801504", "0.50777024", "0.5075223", "0.5073737", "0.50649637", "0.5063942", "0.5063077", "0.506067" ]
0.81998515
0
Callback to be invoked when PurpleEntry is selected
public void performAction();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void onValueSelected(Entry e, int dataSetIndex, Highlight h) {\n\t\t\n\t}", "public void onIndividualSelected(Individual individual) {\n\t\t\n\t}", "public void OnRecipeSelected();", "void onItemSelected(Bundle args);", "public void onComidaSelected(int comidaId);", "public void onItemSelected(String summary, String poster);", "@Override\n public void onNothingSelected(AdapterView<?> parent) {\n mColour = PhoneEntry.COLOUR_UNKNOWN;\n }", "protected void onSelect() {\n\n }", "void onItemSelected();", "void onItemSelected();", "protected void onSelectionPerformed(boolean success) {\n }", "@Override\n public void onSelected(BaseSearchDialogCompat dialog,\n SearchModelForPostcode item, int position) {\n\n\n Toast.makeText(RegisterActivity.this, \"postcode selected:\"+item.getTitle(),\n Toast.LENGTH_SHORT).show();\n pc.setText(item.getTitle());\n dialog.dismiss();\n }", "void onPickPhoneNumberAction(HashMap<String,String> pairs);", "@Override\n public void onContactSelected(Contact selected, int rowId)\n {\n contactIndex = rowId;\n selectedContact = selected;\n\n // Visa detaljvyn när en rad i listan klickas\n showDetails();\n }", "public void onSelectedItems(Map<String,Integer> selectedMapPo) {\n\t\t\t\t\n\t\t\t}", "void onSelectProject();", "public void onSelectionChanged();", "@Override\n public void onValueSelected(Entry e, Highlight h) {\n int i = objectIdList.indexOf((int)e.getX());\n String xTvStr = \"objectid: \" + String.valueOf(objectIdList.get(i));\n xTv.setText(xTvStr);\n String yTvStr = classifierTitle + \": \" + String.valueOf(classifiers.get(i));\n yTv.setText(yTvStr);\n String attributeStr = attributeTitle + \": \" + attributes.get(i);\n attrTv.setText(attributeStr);\n if (detailAllLoaded) {\n showJSONDetail(i);\n }\n }", "@Override\n\tpublic void onPicked() {\n\n\t}", "public void widgetSelected(SelectionEvent e) {\n\t\t\t\tif (e.item == null) {\n\t\t\t\t\tif (infoPopup != null)\n\t\t\t\t\t\tinfoPopup.close();\n\t\t\t\t} else {\n\t\t\t\t\tProposal proposal = (Proposal) e.item.getData();\n\t\t\t\t\tif (proposal != null) {\n\t\t\t\t\t\tshowProposalDescription();\n\t\t\t\t\t\tadapter.proposalSelected(proposal);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (infoPopup != null)\n\t\t\t\t\t\t\tinfoPopup.close();\n\t\t\t\t\t\tproposalTable.deselectAll();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "private void selected(ListSelectionEvent e) {\n\t\tProject project = (Project) list.getSelectedValue();\n\t\tif (project != null) {\n\t\t\tinfo.setText(\"Description: \" + project.getDescription());\n\t\t} else {\n\t\t\tinfo.setText(\"Description: \");\n\t\t}\n\t}", "@Override // see item.java\n\tpublic void pickUp() {\n\n\t}", "@Override\n public void onClick(View v) {\n\n new SimpleSearchDialogCompat(RegisterActivity.this, \"Select your new postcode\",\n \"What are you looking for?\", null, createSampleData(),\n new SearchResultListener<SearchModelForPostcode>() {\n @Override\n public void onSelected(BaseSearchDialogCompat dialog,\n SearchModelForPostcode item, int position) {\n\n //SharedPreferences.Editor editor = getSharedPreferences(MY_PREFS_NAME, MODE_PRIVATE).edit();\n //editor.putString(\"postcode\", item.getTitle());\n\n\n Toast.makeText(RegisterActivity.this, \"postcode selected:\"+item.getTitle(),\n Toast.LENGTH_SHORT).show();\n pc.setText(item.getTitle());\n dialog.dismiss();\n }\n }).show();\n\n }", "public void itemStateChanged(ItemEvent e) {\r\n\t\texParValue.set(choice.getSelectedItem());\r\n\t\tcontroller.parameterSet(exParName);\r\n\t\t// System.out.println(\"SingleParEntryPanel.itemStateChanged() \" +\r\n\t\t// exParName + \"=\" + choice.getSelectedItem());\r\n\t}", "@Override\n\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1,\n\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\tToast.makeText(getApplicationContext(), \"Selected Text Is...\"+names[arg2]+\":\"+phones[arg2], 5000).show();\n\t\t\t}", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1,\n int arg2, long arg3) {\n\n\n }", "public void onMergeItemSelected();", "public void onItemSelected(Long id);", "@Override\n public void onValueSelected(Entry e, int dataSetIndex, Highlight h) {\n int indeks = e.getXIndex();\n// if(xData[0].equalsIgnoreCase(\"Kelebihan Kalori\")){\n// indeks += 1;\n// }\n System.out.println(\"Index: \" + indeks);\n if (e == null)\n return;\n\n else {\n if (arrayX.get(indeks).equalsIgnoreCase(\"breakfast\")) {\n Set<String> setPagi = spref.getStringSet(\"SetPagi\", null);\n PlaceholderFragment.showToast(getContext(), setPagi, \"Breakfast\");\n } else if (arrayX.get(indeks).equalsIgnoreCase(\"lunch\")) {\n Set<String> setSiang = spref.getStringSet(\"SetSiang\", null);\n PlaceholderFragment.showToast(getContext(), setSiang, \"Lunch\");\n } else if (arrayX.get(indeks).equalsIgnoreCase(\"dinner\")) {\n Set<String> setMalam = spref.getStringSet(\"SetMalam\", null);\n PlaceholderFragment.showToast(getContext(), setMalam, \"Dinner\");\n } else if (arrayX.get(indeks).equalsIgnoreCase(\"Not consumed\")) {\n\n } else if (arrayX.get(indeks).equalsIgnoreCase(\"Kelebihan Kalori\")) {\n\n }\n }\n }", "@Override\n\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\tlong arg3) {\n\t\t\t\n\t\t}", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,\n long arg3) {\n\n }", "@Override\r\n\t public void onPause() {\n\t \tsuper.onPause();\r\n\t \t StaticStore.LogPrinter('e',\"onPause() ListSelection\");\r\n\t \t StaticStore.midlet.onPauseCalled();\r\n\t }", "public void onItemSelected(int id);", "@Override\n\t\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1,\n\t\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\t\tprefs.edit().putInt(\"CHOOSE\",(int)choose.getSelectedItemId()).commit();\n\n\t\t\t\t\tif(choose.getSelectedItemId()==0)\n\t\t \t\t\tcontacts.setVisibility(View.GONE);\n\t\t\t\t\telse \n\t\t \t\t\tcontacts.setVisibility(View.VISIBLE);\n\t\t\t\t}", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "void pickUp();", "@Override\n public void onClick(Uri uri) {\n callback.onItemSelected(uri);\n\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n expertise_selected = adapterView.getItemAtPosition(i).toString();\n }", "public boolean select(String entry);", "@Override\n public void onItemSelected(OurPlace place) {\n\n Log.i(LOG_TAG, \"YES!\");\n }", "@Override\n\tpublic void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\tlong arg3) {\n\n\t}", "@Override\n\tpublic void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\tlong arg3) {\n\n\t}", "void onItemSelected(int index, T item) throws RemoteException;", "void itemSelected(OutlineItem item);", "protected void onSelectedItemChanged() {\n if (selectedItem == null) {\n anchorLabel();\n getInputWidget().setText(\"\");\n } else {\n String playerName = ((Player)selectedItem).getName();\n getInputWidget().setText(playerName);\n floatLabel();\n }\n\n if (itemChooserListener != null) itemChooserListener.onSelectionChanged(this, selectedItem);\n }", "@Override\n public void onNothingSelected(AdapterView<?> parent) {\n mFruit = FruitEntry.TYPE_NOTSELECTED;\n }", "public void onEntry()\n\t{\n\t}", "@Override\n\t\t\tpublic void onPageSelected(int arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onPageSelected(int arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n Project project = projects.get(position);\n sn = project.getSn();\n\n //Toast.makeText(ContractingInfoActivity.this,Id.toString(),Toast.LENGTH_LONG).show();\n\n getPermitsFollowup();\n }", "@Override\n\tpublic void onItemSelected(AdapterView<?> parent, View view, int pos,\n\t\t\tlong id) {\n\t\t\n\t\t\n\t}", "@Override\n\tpublic void onLandmarkSelected(Marker landmark) {\n\t}", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n\tpublic void onPageSelected(int arg0) {\n\t\t\n\t}", "@Override\n\tpublic void onPageSelected(int arg0) {\n\t\t\n\t}", "public void onPageSelected(int pageSelected) {\n\t\t\t}", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n\t\tpublic void onPageSelected(int arg0)\n\t\t{\n\t\t\t\n\t\t}", "@Override\n\t\t\tpublic void onPageSelected(int arg0) {\n\n\t\t\t}", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position,\n long id) {\n\n }", "void onEntryAdded(Entry entry);", "public IEntry getSelectedEntry()\n {\n return selectedEntry;\n }", "@Override\n\tpublic void onPageSelected(int arg0) {\n\n\t}", "@Override\n\tpublic void onPageSelected(int arg0) {\n\n\t}", "public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\tString selected = plans[arg2];\n \t\t\t\t\t\t\tfinal String pid = selected.substring(0,3);\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\tif (pid.contains(\"--\")) \n \t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\tdisplayText.setText(pid);\n \t\t\t\t\t\t\t} else {\n \t\t\t\t\t\t\t\tToast.makeText(Map1Activity.this, \"Plan: \" + arg0.getSelectedItem().toString(), Toast.LENGTH_LONG).show();\n \t\t\t\t\t\t\t\tString pidBuffer = pid.trim();\n\t \t\t\t\t\t\t\tfinal String xmlPidUrl = \"http://140.128.198.44:408/plandata/\" +Name +\"/\" +pidBuffer;\n \t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\tnew Thread()\n \t\t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\t\tpublic void run()\n \t\t\t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\t\t\tString xmlPidString = getStringByUrl(xmlPidUrl);\n \t\t \t\t\t\t\t\t\t\tplanChosen.obtainMessage(REFRESH_DATA, xmlPidString).sendToTarget();\n \t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t}.start();\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}", "@Override\n public void onContactSelected(Curso curso) {\n Toast.makeText(getApplicationContext(), \"Selected: \" + curso.getCodigo() + \", \" + curso.getNombre(), Toast.LENGTH_LONG).show();\n }", "@Override\n public void onValueSelected(int arcIndex, SliceValue value) {\n }", "@Override\n public void onValueSelected(int arcIndex, SliceValue value) {\n }", "@Override\n public void onEpgItemSelected(int channelPosition, int programPosition) {\n }", "@Override\r\n\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1,\r\n\t\t\t\t\tint arg2, long arg3)\r\n\t\t\t{\n\r\n\t\t\t\tswitch (arg2)\r\n\t\t\t\t{\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\tareaid = \"07\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tareaid = \"23\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view,\n int position, long id) {\n Matter matter = adapter.getItem(position);\n // Here you can do the action you want to...\n Toast.makeText(FilterActivity.this, \"ID: \" + matter.get_projeadi() + \"\\nName: \" + matter.get_projekodu(),\n Toast.LENGTH_SHORT).show();\n }", "@Override\n\tpublic void onSelectionChanged(ListSelectionEvent e, List<ShoppingListObject> values) {\n\n\t}", "@Override\n public void onColorSelected(int selectedColor) {\n }", "public void selectPressed() {\n\t\tif (edit) {\n\t\t\tdisplayCardHelp = !displayCardHelp;\n\t\t} else {\n\t\t\tSoundPlayer.playSound(SoundMap.MENU_ERROR);\n\t\t}\n\t}", "abstract public void cabMultiselectPrimaryAction();", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\r\n public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\r\n long arg3) {\n bqListWindow.dismiss();\r\n DeptWardMapInfo departmentandward = bqlist.get(arg2);\r\n et_bqks.setText(bqlist.get(arg2).getBqmc() + \" | \"\r\n + bqlist.get(arg2).getKsmc());\r\n SharedPreferenceTools.saveInt(Login.this,\"BqSel\",arg2);\r\n GlobalCache.getCache().setBqSel(arg2);\r\n }", "@Override\n public void onPageSelected(int arg0) {\n }", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1,\n int arg2, long arg3) {\n Country selectedCountry;\n country = new Country();\n if (!(ssWholeSale_Imported_Country.getSelectedItem() == null)) {\n selectedCountry = (Country) ssWholeSale_Imported_Country.getSelectedItem();\n app.setImportSugarCountryOfOrigin(selectedCountry);\n\n String country_id = (String) selectedCountry.getC_country_id();\n\n country = selectedCountry;\n\n }\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n }", "@Override\n public void onItemSelected(AdapterView<?> parent4, View view4, int position4, long id4) {\n }", "@Override\n public void onItemSelected(AdapterView<?> parent3, View view3, int position3, long id3) {\n }", "public void onYesButtonClicked() {\n changeAfterClientPick();\n }", "@Override\n public void valueChanged(javax.swing.event.ListSelectionEvent e)\n {\n this.choice = e.getFirstIndex();\n }", "@Override\n \t\t\tpublic void widgetSelected(SelectionEvent e) {\n \t\t\t\t\n \t\t\t\tupdatePageComplete();\n \t\t\t}", "@Override\r\n\t\t\tpublic void onPageSelected(int arg0) {\n\t\t\t}", "void onScoreSelected(String value);", "@Override\n public boolean onPreferenceClick(Preference preference) {\n Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,\n ContactsContract.CommonDataKinds.Phone.CONTENT_URI);\n startActivityForResult(contactPickerIntent,\n CONTACT_PICKER_RESULT);\n return true;\n }", "@Override\n public void onColorSelected(String color) {\n Toast.makeText(MainActivity.this, \"Selected Color HeX:\" + color, Toast.LENGTH_SHORT).show();\n }", "public interface OnPhoneNumberMultiPickerActionListener {\n\n /**\n * Returns the selected phone number to the requester.\n */\n void onPickPhoneNumberAction(HashMap<String,String> pairs);\n void onCancel();\n\n}", "public void onShowMushroomSelectionDialogSelected(Context context);", "@Override\r\n public void valueChanged(ListSelectionEvent e) {\n selectionChanged();\r\n }" ]
[ "0.6189717", "0.6145002", "0.6045539", "0.60326684", "0.6025686", "0.60222846", "0.6012047", "0.59849405", "0.59358025", "0.59358025", "0.5919917", "0.58918804", "0.5839181", "0.5822832", "0.58111185", "0.5799444", "0.57512635", "0.57107943", "0.5709559", "0.57066596", "0.57032806", "0.568469", "0.5669691", "0.5662143", "0.564327", "0.5641303", "0.5640296", "0.5634874", "0.5611429", "0.55983084", "0.55772936", "0.55697316", "0.55612975", "0.5561124", "0.55596393", "0.55596393", "0.55596393", "0.55596393", "0.55596393", "0.5558835", "0.5558835", "0.55415696", "0.5532923", "0.5530354", "0.5517882", "0.5509986", "0.5508857", "0.5508857", "0.54860926", "0.5484922", "0.54798985", "0.5471967", "0.5471656", "0.54711163", "0.54711163", "0.546579", "0.54549295", "0.54522055", "0.5448973", "0.5448973", "0.5444213", "0.5444213", "0.5439462", "0.5436556", "0.5430801", "0.54288155", "0.54275423", "0.54193836", "0.5418026", "0.54178077", "0.54178077", "0.5417447", "0.54147047", "0.54099184", "0.54099184", "0.5409642", "0.5403713", "0.5403529", "0.54005563", "0.5400487", "0.53988093", "0.53921014", "0.53914785", "0.53914785", "0.53914785", "0.53910166", "0.53872734", "0.53866875", "0.5386634", "0.53856426", "0.53837967", "0.5377612", "0.53753215", "0.53748685", "0.5369323", "0.53647035", "0.5361421", "0.5353432", "0.535233", "0.5344527", "0.5343873" ]
0.0
-1
TODO : ajouter les users
public String toString(){ return "ID : "+id+"\nNom : "+nom+"\nMdp : "+mdp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void initUsers() {\n User user1 = new User(\"Alicja\", \"Grzyb\", \"111111\", \"grzyb\");\n User user2 = new User(\"Krzysztof\", \"Kowalski\", \"222222\", \"kowalski\");\n User user3 = new User(\"Karolina\", \"Nowak\", \"333333\", \"nowak\");\n User user4 = new User(\"Zbigniew\", \"Stonoga \", \"444444\", \"stonoga\");\n User user5 = new User(\"Olek\", \"Michnik\", \"555555\", \"michnik\");\n users.add(user1);\n users.add(user2);\n users.add(user3);\n users.add(user4);\n users.add(user5);\n }", "private void createUsers() {\n\n\t\tList<User> UserList = Arrays.asList(new User(\"Kiran\", \"kumar\", \"[email protected]\", 20),\n\t\t\t\tnew User(\"Ram\", \"kumar\", \"[email protected]\", 22), new User(\"RamKiran\", \"LaxmiKiran\", \"[email protected]\", 30),\n\t\t\t\tnew User(\"Lakshamn\", \"Seth\", \"[email protected]\", 50), new User(\"Sita\", \"Kumar\", \"[email protected]\", 50),\n\t\t\t\tnew User(\"Ganesh\", \"Kumar\", \"[email protected]\", 50),\n\t\t\t\tnew User(\"KiranKiran\", \"kumar\", \"[email protected]\", 20),\n\t\t\t\tnew User(\"RamRam\", \"kumar\", \"[email protected]\", 22),\n\t\t\t\tnew User(\"RamKiranRamKiran\", \"LaxmiKiran\", \"[email protected]\", 30),\n\t\t\t\tnew User(\"RamKiranRamKiran\", \"Seth\", \"[email protected]\", 50),\n\t\t\t\tnew User(\"SitaSita\", \"Kumar\", \"[email protected]\", 50),\n\t\t\t\tnew User(\"GaneshSita\", \"Kumar\", \"[email protected]\", 50));\n\n\t\tIterable<User> list = userService.saveAllUsers(UserList);\n\t\tfor (User User : list) {\n\t\t\tSystem.out.println(\"User Object\" + User.toString());\n\n\t\t}\n\n\t}", "public void addUser() {\n\t\tthis.users++;\n\t}", "public void getAllUsers() {\n\t\t\n\t}", "public users() {\n initComponents();\n connect();\n autoID();\n loaduser();\n \n \n }", "protected void getUserList() {\n\t\tmyDatabaseHandler db = new myDatabaseHandler();\n\t\tStatement statement = db.getStatement();\n\t\t// db.createUserTable(statement);\n\t\tuserList = new ArrayList();\n\t\tsearchedUserList = new ArrayList();\n\t\tsearchedUserList = db.getUserList(statement);\n\t\tuserList = db.getUserList(statement);\n\t\tusers.removeAllElements();\n\t\tfor (User u : userList) {\n\t\t\tusers.addElement(u.getName());\n\t\t}\n\t}", "private static void initUsers() {\n\t\tusers = new ArrayList<User>();\n\n\t\tusers.add(new User(\"Majo\", \"abc\", true));\n\t\tusers.add(new User(\"Alvaro\", \"def\", false));\n\t\tusers.add(new User(\"Luis\", \"ghi\", true));\n\t\tusers.add(new User(\"David\", \"jkl\", false));\n\t\tusers.add(new User(\"Juan\", \"mno\", true));\n\t\tusers.add(new User(\"Javi\", \"pqr\", false));\n\t}", "public void setUserMap() {\n ResultSet rs = Business.getInstance().getData().getAllUsers();\n try {\n while (rs.next()) {\n userMap.put(rs.getString(\"username\"), new User(rs.getInt(\"id\"),\n rs.getString(\"name\"),\n rs.getString(\"username\"),\n rs.getString(\"password\"),\n rs.getBoolean(\"log\"),\n rs.getBoolean(\"medicine\"),\n rs.getBoolean(\"appointment\"),\n rs.getBoolean(\"caseAccess\")));\n\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "public void userListStart() {\n\t\tfor (int i = 0; i < userServices.getAllUsers().length; i++) {\n\t\t\tuserList.add(userServices.getAllUsers()[i]);\n\t\t}\n\t}", "private static void multipleUsersExample()\t{\n\t}", "public void addToUsers(Users users) {\n Connection connection = connectionDB.openConnection();\n PreparedStatement preparedStatement;\n try {\n preparedStatement = connection.prepareStatement(WP_USERS_ADD_USER);\n preparedStatement.setString(1, users.getUser_login());\n preparedStatement.setString(2, users.getUser_pass());\n preparedStatement.executeUpdate();\n } catch (SQLException e) {\n e.printStackTrace();\n } finally {\n connectionDB.closeConnection(connection);\n }\n }", "private void setupUsersInRoomDB() {\n Log.d(TAG, \"setupUsersInRoomDB: start to setup list of 200 user\");\n userList = new ArrayList<>();\n int j = 0;\n for (int i = 0; i < 200; i++) {\n switch (j) {\n case 0:\n Log.d(TAG, \"setupUsersInRoomDB: case 0 set the user with image one\");\n userList.add(new User(\"user\" + i, getImageOne()));\n j++;\n break;\n case 1:\n userList.add(new User(\"user\" + i, getImageTwo()));\n j++;\n break;\n case 2:\n userList.add(new User(\"user\" + i, getImageThree()));\n j = 0;\n break;\n }\n }\n\n db.userDao().insertListOfUser(userList);\n Log.d(TAG, \"setupUsersInRoomDB: insert list of users in room database\");\n Shared.sharedSave(MainActivity.this, \"usersdb\", USERS_EXIST);\n Toast.makeText(getApplicationContext(), \"finish set database\", Toast.LENGTH_LONG).show();\n }", "private List<User> createUserList() {\n for (int i = 1; i<=5; i++) {\n User u = new User();\n u.setId(i);\n u.setEmail(\"user\"+i+\"@mail.com\");\n u.setPassword(\"pwd\"+i);\n userList.add(u);\n }\n return userList;\n }", "public void updateUser() {\r\n users.clear();\r\n RestaurantHelper.getCollectionFromARestaurant(currentRest.getPlaceId(), \"luncherId\").addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {\r\n @Override\r\n public void onComplete(@NonNull Task<QuerySnapshot> task) {\r\n for (DocumentSnapshot docSnap : task.getResult()) {\r\n UserHelper.getUser(docSnap.getId()).addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {\r\n @Override\r\n public void onComplete(@NonNull Task<DocumentSnapshot> task) {\r\n if(!task.getResult().getId().equals(currentUser.getUid())){\r\n users.add(task.getResult().toObject(User.class));\r\n mCoworkerAdapter.notifyDataSetChanged();\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }).addOnFailureListener(this.onFailureListener());\r\n }", "public void addUser(User user){\r\n users.add(user);\r\n }", "public Users() {\r\n this.user = new ArrayList<>();\r\n }", "private void createUserList() {\n\t\tif (!userList.isEmpty() && !listUsers.isSelectionEmpty()) {\n\t\t\tlistUsers.clearSelection();\n\t\t}\t\t\n\t\tif (!archivedUserList.isEmpty() && !listArchivedUsers.isSelectionEmpty()) {\n\t\t\tlistArchivedUsers.clearSelection();\n\t\t}\t\t\n\t\tarchivedUserList.clear();\n\t\tuserList.clear();\n\t\tArrayList<User> users = jdbc.get_users();\n\t\tfor (int i = 0; i < users.size(); i++) {\n\t\t\tif (users.get(i).active()) {\n\t\t\t\tuserList.addElement(String.format(\"%s, %s [%s]\", users.get(i).get_lastname(), users.get(i).get_firstname(), users.get(i).get_username()));\n\t\t\t} else {\n\t\t\t\tarchivedUserList.addElement(String.format(\"%s, %s [%s]\", users.get(i).get_lastname(), users.get(i).get_firstname(), users.get(i).get_username()));\n\t\t\t}\t\t\n\t\t}\n\t}", "private void createAllUsersList(){\n\t\tunassignedUsersList.clear();\n\t\tlistedUsersAvailList.clear();\n\t\tArrayList<User> users = jdbc.get_users();\n\t\tfor (int i = 0; i < users.size(); i++) {\n\t\t\tunassignedUsersList.addElement(String.format(\"%s, %s\", users.get(i).get_lastname(), users.get(i).get_firstname()));\n\t\t\tlistedUsersAvailList.addElement(String.format(\"%s, %s\", users.get(i).get_lastname(), users.get(i).get_firstname()));\n\t\t}\n\t}", "public void addUser(ArrayList<User> users) {\n comboCreateBox.removeAllItems();\n for (User usr : users) {\n comboCreateBox.addItem(usr.getUsername());\n }\n }", "private static Set<User> createUsers() {\n\t\tfinal Set<User> users = new HashSet<>();\n\t\tusers.add(new User(\"Max\", \"password\"));\n\t\treturn users;\n\t}", "public void loadUsers() {\n CustomUser userOne = new CustomUser();\n userOne.setUsername(SpringJPABootstrap.MWESTON);\n userOne.setPassword(SpringJPABootstrap.PASSWORD);\n\n CustomUser userTwo = new CustomUser();\n userTwo.setUsername(SpringJPABootstrap.TEST_ACCOUNT_USER_NAME);\n userTwo.setPassword(SpringJPABootstrap.TEST_ACCOUNT_PASSWORD);\n\n String firstUserName = userOne.getUsername();\n\n /*\n * for now I am not checking for a second user because there is no delete method being\n * used so if the first user is created the second user is expected to be created. this\n * could cause a bug later on but I will add in more logic if that is the case in a\n * future build.\n */\n if(userService.isUserNameTaken(firstUserName)) {\n log.debug(firstUserName + \" is already taken\");\n return ;\n }\n userService.save(userOne);\n userService.save(userTwo);\n\n log.debug(\"Test user accounts have been loaded!\");\n }", "public Users(List<User> users) {\r\n this();\r\n user.addAll(users);\r\n }", "@PostConstruct\n public void initUsers() {\n List<MyUser> users = Stream.of(\n new MyUser(\"1\",\"Vaibhav\",\"Vaibhav\"),\n new MyUser(\"2\",\"Abhishek\",\"Abhishek\"),\n new MyUser(\"3\",\"admin\",\"admin\")\n ).collect(Collectors.toList());\n repository.saveAll(users);\n }", "public void addUsers(List<IGuild> guilds){\n for(IGuild g : guilds) {\n for (IUser u : g.getUsers()) {\n if (getUserByID(u) == null) {\n Users.add(new User(u));\n }\n }\n }\n }", "public List getAllUsers();", "public boolean addUsers(List<User> users);", "private void displayUsers(List<User> users) {\n userAdapter.updateList(users);\n\n }", "@Override\n public void initializeUsersForImportation() {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"initializeUsersForImportation\");\n }\n clearAddPanels();\n setRenderImportUserPanel(true);\n\n List<User> users;\n\n usersForImportation = new ArrayList<Pair<Boolean, User>>();\n\n if (Role.isLoggedUserAdmin() || Role.isLoggedUserProjectManager()) {\n choosenInstitutionForAdmin = (Institution) Component.getInstance(CHOOSEN_INSTITUTION_FOR_ADMIN);\n\n if (choosenInstitutionForAdmin != null) {\n users = User.listUsersForCompany(choosenInstitutionForAdmin);\n } else {\n users = User.listAllUsers();\n }\n } else {\n users = User.listUsersForCompany(Institution.getLoggedInInstitution());\n }\n boolean emailAlreadyExists;\n for (User user : users) {\n emailAlreadyExists = false;\n\n for (ConnectathonParticipant cp : connectathonParticipantsDataModel().getAllItems(FacesContext.getCurrentInstance())) {\n\n if (user.getEmail().equals(cp.getEmail())) {\n emailAlreadyExists = true;\n }\n }\n\n if (!emailAlreadyExists) {\n usersForImportation.add(new Pair<Boolean, User>(false, user));\n }\n }\n }", "@Override\r\n\tpublic Utilisateur addUser() {\n\t\treturn null;\r\n\t}", "public void addUser(User user) {\n\t\t\r\n\t}", "private void updateAllUsers() {\n for(IUser user : this.bot.getClient().getUsers()) {\n this.updateUserStatus(user);\n }\n saveJSON();\n }", "public void viewUsers(){\n Database manager = new Database(\n this,\n \"mypets\",\n null,\n 1\n );\n //2. Let write on DB\n SQLiteDatabase mypets = manager.getWritableDatabase();\n //3. Get information from database\n int idAdmin = 1;\n Cursor row = mypets.rawQuery(\n \"SELECT * FROM users WHERE id not in (?)\",\n idAdmin\n );\n\n if (row.getCount() == 0) {\n Toast.makeText(\n this,\n \"::: There isn't any user registered:::\",\n Toast.LENGTH_SHORT\n ).show();\n } else {\n while(row.moveToNext()) {\n listUsers.add(row.getString(1));\n listUsers.add(row.getString(3));\n }\n adapter = new ArrayAdapter<>(\n this,\n android.R.layout.simple_list_item_1,\n listUsers\n );\n userList.setAdapter(adapter);\n }\n }", "@Override\r\n\tpublic void getAllUser() {\n\t\tSystem.out.println(users);\r\n\t\t\r\n\t}", "private void setUsersIntoComboBox() {\n if (mainModel.getUserList() != null) {\n try {\n mainModel.loadUsers();\n cboUsers.getItems().clear();\n cboUsers.getItems().addAll(mainModel.getUserList());\n } catch (ModelException ex) {\n alertManager.showAlert(\"Could not get the users.\", \"An error occured: \" + ex.getMessage());\n }\n }\n }", "public List<UserModel> getAllUsers()\n {\n List<UserModel> userModels =new ArrayList<>();\n //user.findAll().forEach(topics::add);\n for(UserModel userModel : userRepository.findAll())\n {\n userModels.add(userModel);\n }\n return userModels;\n }", "public List<TestUser> getAllUsers(){\n\t\tSystem.out.println(\"getting list of users..\");\n\t\tList<TestUser> user=new ArrayList<TestUser>();\n\t\tuserRepositary.findAll().forEach(user::add);\n\t\t//System.out.println(\"data: \"+userRepositary.FindById(\"ff80818163731aea0163731b190c0000\"));\n\t\treturn user;\n\t}", "public void saveUsers() {\n\t\ttry {\n\t\t\t\n\t\t\tFile xmlFile = new File(\"Users.xml\");\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder builder = factory.newDocumentBuilder();\n\t\t\tDocument document = builder.parse(xmlFile);\n\t\t\tElement users = document.getDocumentElement();\n\t\t\t\n\t\t\tArrayList<Student> u = ManageUsers.getActiveList();\n\t\t\tfor (int i = 0; i < u.size(); i++) {\n\t\t\t\t// Grab the info for a specific student\n\t\t\t\tStudent s = u.get(i);\n\t\t\t\tString fName = s.getFirstName();\n\t\t\t\tString lName = s.getLastName();\n\t\t\t\tint ucid = s.getUcid();\n\t\t\t\tint currentBorrowing = s.getCurrentBorrowing();\n\t\t\t\tboolean isActive = true;\n\t\t\t String username = s.getUsername();\n\t\t\t String password = s.getPassword();\n\t\t\t boolean isLibrarian = s.getIsLibrarian();\n\t\t\t \n\t\t\t Element student = document.createElement(\"student\");\n\t\t\t \n\t\t\t // Make a new element <student>\n\t\t\t // Add the element to the xml as a child of <Users>\n\t\t\t // Add the above fields (fName, etc.) as child nodes to the new student node\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Something went wrong with writing to the xml\");\n\t\t\tSystem.out.println(e);\n\t\t}\n\t}", "@Override\r\n public List<User> darUsers() {\r\n Query q = em.createQuery(\"SELECT u FROM UserEntity u\");\r\n List<UserEntity> l = q.getResultList();\r\n List<User> ltr = new ArrayList();\r\n for(UserEntity te: l)\r\n {\r\n ltr.add(TransformadorEntityDto.getInstance().entityADtoUser(te));\r\n }\r\n return ltr;\r\n }", "public static ArrayList<User> getUsers() {\n users = new ArrayList<User>();\n /*users.add(new User(\"Парковый Гагарина 5а/1\", \"срочный\", \"общий\"));\n users.add(new User(\"Алексеевские планы Ореховая 15 возле шлагбаума\", \"срочный\", \"общий\"));\n users.add(new User(\"Фастовецкая Азина 26\", \"срочный\", \"индивидуальный\"));*/\n //users.add(new User(MainActivity.adres.get(0), \"срочный\", \"общий\"));\n users.add(new User(\"Нет заказов\",\"срочный\",\"общий\"));\n return users;\n }", "private void addUsertoTeams(List<Team> teams) {\n \tfor(Team team: teams) {\n \t\tteam.setUser(getUserFromTeam(team));\n \t}\n }", "public int addUser(Users users);", "private void getUserList() {\n // GET ENTRIES FROM DB AND TURN THEM INTO LIST \n DefaultListModel listModel = new DefaultListModel();\n Iterator itr = DBHandler.getListOfObjects(\"FROM DBUser ORDER BY xname\");\n while (itr.hasNext()) {\n DBUser user = (DBUser) itr.next();\n listModel.addElement(user.getUserLogin());\n }\n // SET THIS LIST FOR INDEX OF ENTRIES\n userList.setModel(listModel);\n }", "public UserList createUsers(Set<User> usersToCreate);", "@Override\n public void mostrarUsuarios(List<UserModel> usuarios) {\n }", "private void listUsers(Request request, Response response) {\r\n\t\tList<UserBean> userList = null;\r\n\r\n\t\ttry {\r\n\t\t\tuserList = userService.findUsers();\r\n\t\t} catch (Exception e) {\r\n\t\t\tresponse.setStatus(Status.SERVER_ERROR_INTERNAL, e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t\tlog.error(e);\r\n\t\t} finally {\r\n\t\t\txmlSerializationService.generateXMLResponse(request, response,\r\n\t\t\t\t\tuserList);\r\n\t\t}\r\n\t}", "public void setUsers( Set<String> users )\n {\n this.users = users;\n }", "public void newUser(User user) {\n users.add(user);\n }", "@Override\n\tpublic List<Object> getAllUsers() {\n\t\tList<Object> usersList = new ArrayList<Object>();\n\t\tList<TestUser> users = dao.getAll();\n\t\tSystem.out.println(dao.exists(5));\n\t\tfor(TestUser user : users){\n\t\t\tMap<String,Object> m = new HashMap<String,Object>();\n\t\t\tm.put(\"id\", user.getId());\n\t\t\tm.put(\"name\", user.getUsername());\n\t\t\tm.put(\"pwd\", user.getPassword());\n\t\t\tJSONObject j = new JSONObject(m);\n\t\t\tusersList.add(j);\n\t\t}\n\t\treturn usersList;\n\t}", "@Override\n public BlueUserContainer getUsers() {\n return users;\n }", "private void listarUsuarios() {\r\n \t\r\n \tfor(String usuario : ConfigureSetup.getUsers()) {\r\n \t\tif(!usuario.equals(ConfigureSetup.getUserName()))\r\n \t\t\tlista_usuarios.getItems().add(usuario);\r\n \t}\r\n \t\r\n \t//lista_usuarios.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);\t\r\n }", "private String users(ModelMap model, Integer user_id) {\n\t\tList<Object> users = userservice.fetchUser(user_id);\n\t\tfor (Iterator<Object> iterator1 = users.iterator(); iterator1.hasNext();) {\n\t\t\tUser user = (User) iterator1.next();\n\t\t\tmodel.addAttribute(\"userdetail\", user);\n\t\t\tmodel.addAttribute(\"addresses\", user.getAddress());\n\t\t\tmodel.addAttribute(\"files\", user.getFile());\n\t\t}\n\t\treturn \"register\";\n\t}", "@Override\r\n\tpublic List<User> users() {\r\n\t\tList<User> ris = new ArrayList<>();\r\n\t\tList< Map <String,String>> maps = getAll(SELECT_USERS);\r\n\t\tfor (Map<String, String> map : maps) {\r\n\t\t\tris.add(IMappable.fromMap(User.class, map));\r\n\t\t}\r\n\t\treturn ris;\r\n\t}", "public void createUser(List<User> list) {\n\n Gson gson = new Gson();\n FileService writerService = new FileService();\n for (User user : list) {\n String userData = gson.toJson(user);\n writerService.writeToUserData(userData);\n }\n\n }", "private void addAllUser(\n Iterable<? extends People> values) {\n ensureUserIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, user_);\n }", "public void addUserBtn(){\n\t\t\n\t\t// TODO: ERROR CHECK\n\t\t\n\t\tUserEntry user = new UserEntry(nameTF.getText(), (String)usertypeCB.getValue(), emailTF.getText());\n\t\tAdminController.userEntryList.add(user);\n\t\t\n\t\t\n\t\t// Create a UserEntry and add it to the observable list\n\t\tAdminController.userList.add(user);\t\t\n\t\t\n\t //AdminController.adminTV.setItems(AdminController.userList);\n\t\t\n\t\t//Close current stage\n\t\tAdminController.addUserStage.close();\n\t\t\n\t}", "@Override\r\n\tpublic void viewAllUsers() {\n\t\tList<User> allUsers = new ArrayList<User>();\r\n\t\tallUsers = udao.getAllUsers();\r\n\t\t\r\n\t\tSystem.out.println(\"ALL USERS:\");\r\n\t\tSystem.out.println(\"ID\\tUsername\\tName\");\r\n\t\t\r\n\t\tfor(int i = 0; i < allUsers.size(); i++) {\r\n\t\t\tUser tempUser = allUsers.get(i);\r\n\t\t\tSystem.out.println(tempUser.getUserID() + \"\\t\" + tempUser.getUsername() + \"\\t\"\r\n\t\t\t\t\t+ tempUser.getFirstName() + \" \" + tempUser.getLastName());\r\n\t\t}\r\n\r\n\t}", "List<User> getAllUsers();", "List<User> getAllUsers();", "public List<Utilizator> listUsers();", "public void popoulaRepositorioUsuarios(){\n Usuario usuario1 = new Usuario();\n usuario1.setUsername(\"EliSilva\");\n usuario1.setEmail(\"[email protected]\");\n usuario1.setSenha(\"123\");\n usuario1.setNome(\"Elineide Silva\");\n usuario1.setCPF(\"12345678\");\n\n\n\n Usuario usuario2 = new Usuario();\n usuario2.setUsername(\"gustavo\");\n usuario2.setEmail(\"[email protected]\");\n usuario2.setSenha(\"12345\");\n usuario2.setNome(\"Gustavo\");\n usuario2.setCPF(\"666\");\n\n Usuario usuario3 = new Usuario();\n usuario1.setUsername(\"peixe\");\n usuario1.setEmail(\"[email protected]\");\n usuario1.setSenha(\"1111\");\n usuario1.setNome(\"quem dera ser um peixe\");\n usuario1.setCPF(\"1111\");\n\n Usuario usuario4 = new Usuario();\n usuario1.setUsername(\"segundo\");\n usuario1.setEmail(\"[email protected]\");\n usuario1.setSenha(\"123\");\n usuario1.setNome(\"Elineide Silva\");\n usuario1.setCPF(\"12345678\");\n\n inserir(usuario1);\n inserir(usuario2);\n inserir(usuario3);\n inserir(usuario4);\n }", "public void setUsers(List<User> users)\r\n/* */ {\r\n/* 221 */ this.users = users;\r\n/* */ }", "public void addUser() {\n\t\tUser user = dataManager.findCurrentUser();\r\n\t\tif (user != null) {\r\n\t\t\tframeManager.addUser(user);\r\n\t\t\tpesquisar();\r\n\t\t} else {\r\n\t\t\tAlertUtils.alertSemPrivelegio();\r\n\t\t}\r\n\t}", "private void updateUserList() {\n\t\tUser u = jdbc.get_user(lastClickedUser);\n\t\tString s = String.format(\"%s, %s [%s]\", u.get_lastname(), u.get_firstname(), u.get_username());\n\t\tuserList.setElementAt(s, lastClickedIndex);\n\t}", "@Override\r\n\tpublic void analizarUsuario() {\n\t\tfor(IAsesoria ia : usuarios) {\r\n\t\t\tia.analizarUsuario();\r\n\t\t}\t\r\n\t}", "public List<User> getAllUsers();", "protected void refreshAllUsers() {}", "public String ListUsers(){\r\n StringBuilder listUsers = new StringBuilder();\r\n for (Utente u: utenti) { // crea la lista degli utenti registrati al servizio\r\n listUsers.append(u.getUsername()).append(\" \");\r\n \tlistUsers.append(u.getStatus()).append(\"\\n\");\r\n }\r\n return listUsers.toString(); \r\n }", "private UserDao() {\n\t\tusersList = new HashMap<String, User>();\n\t\tusersDetails = JsonFilehandling.read();\n\t\tfor (JSONObject obj : usersDetails) {\n\t\t\tusersList.put(obj.get(\"id\").toString(), new User(obj.get(\"id\").toString(),obj.get(\"name\").toString(), obj.get(\"profession\").toString()));\n\t\t}\n\t}", "public void newUserDirectory() {\n\t\tusers = new LinkedAbstractList<User>(100);\n\t}", "@Override\n public void gotUsers(ArrayList<User> usersList) {\n for(int i = 0; i < usersList.size(); i++) {\n User currentUser = usersList.get(i);\n if(currentUser.getUser_name().equals(username) && currentUser.getUser_password()\n .equals(password)) {\n disableButton.setEnabled(true);\n Intent intent = new Intent(NewaccountActivity.this,\n OverviewActivity.class);\n intent.putExtra(\"loggedInUser\", currentUser);\n startActivity(intent);\n }\n }\n }", "public void buildUsers() {\n try (PreparedStatement prep = Database.getConnection().prepareStatement(\n \"CREATE TABLE IF NOT EXISTS users (id TEXT, name TEXT,\"\n + \" cell TEXT, password INT, stripe_id TEXT, url TEXT,\"\n + \" PRIMARY KEY (id));\")) {\n prep.executeUpdate();\n } catch (final SQLException exc) {\n exc.printStackTrace();\n }\n }", "private void addUser(){\r\n\t\ttry{\r\n\t\t\tSystem.out.println(\"Adding a new user\");\r\n\r\n\t\t\tfor(int i = 0; i < commandList.size(); i++){//go through command list\r\n\t\t\t\tSystem.out.print(commandList.get(i) + \"\\t\");//print out the command and params\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\r\n\t\t\t//build SQL statement\r\n\t\t\tString sqlCmd = \"INSERT INTO users VALUES ('\" + commandList.get(1) + \"', '\"\r\n\t\t\t\t\t+ commandList.get(2) + \"', '\" + commandList.get(3) + \"', '\"\r\n\t\t\t\t\t+ commandList.get(4) + \"', '\" + commandList.get(5) + \"', '\"\r\n\t\t\t\t\t+ commandList.get(6) + \"');\";\r\n\t\t\tSystem.out.println(\"sending command:\" + sqlCmd);//print SQL command to console\r\n\t\t\tstmt.executeUpdate(sqlCmd);//send command\r\n\r\n\t\t} catch(SQLException se){\r\n\t\t\t//Handle errors for JDBC\r\n\t\t\terror = true;\r\n\t\t\tse.printStackTrace();\r\n\t\t\tout.println(se.getMessage());//return error message\r\n\t\t} catch(Exception e){\r\n\t\t\t//general error case, Class.forName\r\n\t\t\terror = true;\r\n\t\t\te.printStackTrace();\r\n\t\t\tout.println(e.getMessage());\r\n\t\t} \r\n\t\tif(error == false)\r\n\t\t\tout.println(\"true\");//end try\r\n\t}", "public static List<User> createUserList() {\r\n\t\tList<User> users = new ArrayList<User>();\r\n\t\t\r\n\t\tusers.add(createUser(1, \"Isha\", \"Khandelwal\", \"[email protected]\", \"ishaa\", \"ThinkHR\"));\r\n\t\tusers.add(createUser(2, \"Sharmila\", \"Tagore\", \"[email protected]\", \"stagore\", \"ASI\"));\r\n\t\tusers.add(createUser(3, \"Surabhi\", \"Bhawsar\", \"[email protected]\", \"sbhawsar\", \"Pepcus\"));\r\n\t\tusers.add(createUser(4, \"Shubham\", \"Solanki\", \"[email protected]\", \"ssolanki\", \"Pepcus\"));\r\n\t\tusers.add(createUser(5, \"Ajay\", \"Jain\", \"[email protected]\", \"ajain\", \"TCS\"));\r\n\t\tusers.add(createUser(6, \"Sandeep\", \"Vishwakarma\", \"[email protected]\", \"svishwakarma\", \"CIS\"));\r\n\t\tusers.add(createUser(7, \"Sushil\", \"Mahajan\", \"[email protected]\", \"smahajan\", \"ASI\"));\r\n\t\tusers.add(createUser(8, \"Sumedha\", \"Wani\", \"[email protected]\", \"swani\", \"InfoBeans\"));\r\n\t\tusers.add(createUser(9, \"Mohit\", \"Jain\", \"[email protected]\", \"mjain\", \"Pepcus\"));\r\n\t\tusers.add(createUser(10, \"Avi\", \"Jain\", \"[email protected]\", \"ajain\", \"Pepcus\"));\r\n\t\t\r\n\t\treturn users;\r\n\t}", "public UserList(ArrayList<User> users)\n\t\t{\n\t\t\tthis.users = users;\n\t }", "public sear() {\n initComponents();\n findUsers();\n }", "@Override\n\tpublic void loadUsers(List<UserDto> users) {\n\t\tfor (UserDto userDto : users) {\n\t\t\tuserRepository.save(dte.getUser(userDto));\n\t\t}\n\t}", "static void effacerEnregistrer(){\n users.clear();\n }", "public void addUser(User u){\n\r\n userRef.child(u.getUuid()).setValue(u);\r\n\r\n DatabaseReference zipUserReference;\r\n DatabaseReference zipNotifTokenReference;\r\n List<String> zipList = u.getZipCodes();\r\n\r\n for (String zipCode : zipList) {\r\n zipUserReference = baseRef.child(zipCode).child(ZIPCODE_USERID_REFERENCE_LIST);\r\n // Add uuid to zipcode user list\r\n zipUserReference.child(u.getUuid()).setValue(u.getUuid());\r\n\r\n // Add notifToken to list\r\n zipNotifTokenReference = baseRef.child(zipCode).child(ZIPCODE_NOTIFICATION_TOKENS_LIST);\r\n zipNotifTokenReference.child(u.getNotificationToken()).setValue(u.getNotificationToken());\r\n\r\n }\r\n }", "private void readUsers(String filter) {\n Filter userFilter = Filter.createORFilter(\n Filter.createSubAnyFilter(\"cn\", filter),\n Filter.createSubAnyFilter(\"sn\", filter),\n Filter.createSubAnyFilter(\"givenname\", filter)\n );\n\n SearchResult searchResult = OpenLDAP.searchUser(userFilter);\n for (int i = 0; i < searchResult.getEntryCount(); i++) {\n SearchResultEntry entry = searchResult.getSearchEntries().get(i);\n User user = new User();\n user.setDistinguishedName(entry.getDN());\n user.setUsername(entry.getAttributeValue(\"cn\"));\n user.setFirstname(entry.getAttributeValue(\"givenname\"));\n user.setLastname(entry.getAttributeValue(\"sn\"));\n user.setEmail(entry.getAttributeValue(\"mail\"));\n user.setMobile(entry.getAttributeValue(\"mobile\"));\n getUsers().put(user.getUsername(), user);\n }\n }", "@Override\r\n\tprotected final void objectDataMapping() throws BillingSystemException{\r\n\t\tString[][] data=getDataAsArray(USER_DATA_FILE);\r\n\t\tif(validateData(data,\"Authorised User\",COL_LENGTH)){\r\n\t\tList<User> listUser=new ArrayList<User>();\r\n\t\t\r\n\t\tfor(int i=0;i<data.length;i++){\r\n\t \t\r\n\t \tUser usr=new User();\r\n\t \t\t\r\n\t \tusr.setUsername(data[i][0]);\r\n\t \tusr.setPassword(data[i][1]);\r\n\t \tusr.setRole(getRoleByCode(data[i][2]));\r\n\t \t\r\n\t \tlistUser.add(usr);\t\r\n\t }\r\n\r\n\t\t\r\n\t\tthis.listUser=listUser;\r\n\t\t}\r\n\t}", "List<KingdomUser> getAllUsers();", "List<User> getUsers();", "List<User> getUsers();", "public List<User> getAllUsers(){\n myUsers = loginDAO.getAllUsers();\n return myUsers;\n }", "protected void proccesValues() {\n Users user = new Users();\n user.setName(bean.getName());\n user.setSurname(bean.getSurname());\n user.setUsername(bean.getUsername());\n StrongPasswordEncryptor passwordEncryptor = new StrongPasswordEncryptor();\n String encryptedPassword = passwordEncryptor.encryptPassword(bean.getPassword());\n user.setPassword(encryptedPassword);\n \n usersService.persist(user);\n Notification.show(msgs.getMessage(INFO_REGISTERED), Notification.Type.ERROR_MESSAGE);\n resetValues();\n UI.getCurrent().getNavigator().navigateTo(ViewLogin.NAME);\n }", "@Override\n public void onUserClicked(Users users) {\n\n }", "public void setUsers(ch.ivyteam.ivy.scripting.objects.List<ch.ivyteam.ivy.security.IUser> _users)\n {\n users = _users;\n }", "public void writeUsers() {\n try {\n FileOutputStream fileOut = new FileOutputStream(\"temp/users.ser\");\n ObjectOutputStream out = new ObjectOutputStream(fileOut);\n out.writeObject(users);\n out.close();\n fileOut.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public AllUsers(int datacenterId) {\r\n this.datacenterId = datacenterId;\r\n users= new ArrayList<>();\r\n }", "public String listUsers(){\n \tStringBuilder sb = new StringBuilder();\n \tif(users.isEmpty()){\n \t\tsb.append(\"No existing Users yet\\n\");\n \t}else{\n \t\tsb.append(\"Meeting Manager Users:\\n\");\n \t\tfor(User u : users){\n \t\t\tsb.append(\"*\"+u.getEmail()+\" \"+ u.getPassword()+\" \\n\"+u.listInterests()+\"\\n\");\n \t\t}\n \t}\n \treturn sb.toString();\n }", "public static ArrayList<User> findAllUsers() {\n\n User targetUser = new User();\n IdentityMap<User> userIdentityMap = IdentityMap.getInstance(targetUser);\n\n String findAllUsers = \"SELECT * FROM public.member where type = 0\";\n PreparedStatement stmt = DBConnection.prepare(findAllUsers);\n ArrayList<User> userList = new ArrayList<User>();\n\n try {\n ResultSet rs = stmt.executeQuery();\n\n while(rs.next()) {\n User user = load(rs);\n\n targetUser = userIdentityMap.get(user.getId());\n if (targetUser == null) {\n userList.add(user);\n userIdentityMap.put(user.getId(), user);\n } else {\n userList.add(targetUser);\n }\n }\n DBConnection.close(stmt);\n rs.close();\n\n } catch (SQLException e) {\n System.out.println(\"Exception!\");\n e.printStackTrace();\n }\n return userList;\n }", "private void createUserListQual() {\n\t\tuserListAvailQual.clear();\n\t\tArrayList<User> users = jdbc.get_users();\n\t\tfor (int i = 0; i < users.size(); i++) {\n\t\t\tuserListAvailQual.addElement(String.format(\"%s, %s [%s]\", users.get(i).get_lastname(), users.get(i).get_firstname(), users.get(i).get_username()));\n\t\t}\n\t}", "public void updateUsersList() {\n\t adapter = new UsersAdapter(getActivity(), allUsers);\n setListAdapter(adapter);\n\t getListView().setOnItemClickListener(this);\n\t}", "@Override\r\n\tpublic void add(User user) {\n\r\n\t}", "@Override\n public List<User> selectAllUsers() {\n\n List<User> userList = new ArrayList<>();\n\n try (Connection connection = DriverManager.getConnection(URL, USERNAME, PASSWORD)) {\n\n String sql = \"SELECT * FROM ers_users\";\n\n PreparedStatement ps = connection.prepareStatement(sql);\n\n ResultSet rs = ps.executeQuery();\n\n while (rs.next()) {\n\n userList.add(\n new User(\n rs.getInt(1)\n , rs.getString(2)\n , rs.getString(3)\n , rs.getString(4)\n , rs.getString(5)\n , rs.getString(6)\n , rs.getInt(7)\n )\n );\n }\n }\n\n catch (SQLException e) {\n\n e.printStackTrace();\n }\n\n return userList;\n }", "private void initUser() {\n\t}", "public void addUsers(String[] array) {\n\n boolean existingUser = false;\n int newUser;\n ArrayList<Integer> userList;\n\n if(userObservers.containsKey(array[1])) {\n addObserver(userObservers.get(array[1]));\n users.add(array[1]);\n existingUser = false;\n }\n\n if(array.length > 2){\n String[] otherUsers = array[2].split(nameSeparator);\n\n for(int i = 0; i < otherUsers.length; i++) {\n addObserver(userObservers.get(otherUsers[i]));\n users.add(otherUsers[i]);\n }\n }\n }", "private void fillUserList(UserListMessage msg)\n {\n allUsers = msg.getUsers();\n String userListText = \"Connected users:\\n\";\n\n for (String user : allUsers)\n {\n if(user.equals(nickname))\n userListText += user + \" (YOU)\\n\";\n else\n userListText += user + \"\\n\";\n }\n ChatGUI.getInstance().getUserList().setText(userListText);\n }", "private void createAllUsersList(String s){\n\t\tunassignedUsersList.clear();\n\t\tlistedUsersAddList.clear();\n\t\tArrayList<User> users = jdbc.getUsersWithQual(s);\n\t\tfor (int i = 0; i < users.size(); i++) {\n\t\t\tunassignedUsersList.addElement(String.format(\"%s, %s\", users.get(i).get_lastname(), users.get(i).get_firstname()));\n\t\t\tlistedUsersAvailList.addElement(String.format(\"%s, %s\", users.get(i).get_lastname(), users.get(i).get_firstname()));\n\t\t}\n\t}", "@Override\n public void updateUserJson() {\n synchronized (lockUpdateUserJson) {\n try (PrintWriter printer = new PrintWriter(\"Database/Users.json\")) {\n ArrayList<User> userAsArray = new ArrayList<>();\n for (Map.Entry<String, User> entry : mapOfRegisteredUsersByUsername.entrySet()) {\n userAsArray.add(entry.getValue());\n }\n GsonBuilder gsonBuilder = new GsonBuilder();\n gsonBuilder.setLongSerializationPolicy(LongSerializationPolicy.STRING);\n Gson writer = gsonBuilder.create();\n JsonObject jsonObject = new JsonObject();\n jsonObject.add(\"users\", writer.toJsonTree(userAsArray));\n printer.print(jsonObject);\n } catch (IOException ex) {\n }\n }\n }", "public List createUserList()\r\n{\r\n\tUser madhu=new User(\"[email protected]\", \"madhu\");\r\n\tUser krishna=new User(\"[email protected]\", \"krishna\");\t\r\n\r\n\tList listOfUsers = new ArrayList();\r\n\tlistOfUsers.add(madhu);\r\n\tlistOfUsers.add(krshna);\r\n\treturn listOfUsers;\r\n}" ]
[ "0.7595872", "0.7385698", "0.7212881", "0.71786654", "0.71714824", "0.7103671", "0.70412505", "0.69879633", "0.69850844", "0.6953936", "0.6905544", "0.6897965", "0.6880072", "0.68777484", "0.68756837", "0.6865884", "0.6839848", "0.6824151", "0.68239784", "0.68023646", "0.6755684", "0.6754429", "0.6749978", "0.67489034", "0.6736748", "0.6725063", "0.6712817", "0.66923875", "0.669004", "0.668742", "0.6679617", "0.66782624", "0.6676334", "0.6663039", "0.66476345", "0.6642454", "0.663484", "0.66314185", "0.6621911", "0.6620117", "0.66187936", "0.66090876", "0.66050863", "0.6595636", "0.65881115", "0.6586006", "0.6583351", "0.65809757", "0.6579274", "0.6577085", "0.6569962", "0.65654224", "0.65617216", "0.65594023", "0.65515393", "0.65385985", "0.65381175", "0.65381175", "0.65353245", "0.65352786", "0.65246505", "0.65224487", "0.65224385", "0.65127903", "0.65013504", "0.6491046", "0.6490228", "0.64902234", "0.6486639", "0.64861655", "0.64840645", "0.6483509", "0.6479489", "0.64768195", "0.6474973", "0.64741117", "0.64630705", "0.6449878", "0.6447292", "0.6444569", "0.6443293", "0.6433013", "0.6433013", "0.641918", "0.6414901", "0.6410673", "0.6410365", "0.64077306", "0.640627", "0.6403415", "0.640216", "0.6398294", "0.6394909", "0.6391467", "0.6389026", "0.6384448", "0.6380289", "0.6378011", "0.6376942", "0.63756406", "0.6375287" ]
0.0
-1
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_calculator, container, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.wallpager_layout, null);\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_invit_friends, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_zhuye, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_posts, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return inflater.inflate(R.layout.ilustration_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_sow_drug_cost_per_week, container, false);\n\n db = new DataBaseAdapter(getActivity());\n hc = new HelperClass();\n pop = new FeedSowsFragment();\n\n infltr = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n parent = (LinearLayout) v.findViewById(R.id.layout_for_add);\n tvTotalCost = (TextView) v.findViewById(R.id.totalCost);\n\n getData();\n setData();\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_stream_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_event, container, false);\n\n\n\n\n\n\n\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_feed, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.screen_select_list_student, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_overall, container, false);\n mNamesLayout = (LinearLayout) rootView.findViewById(R.id.fragment_overall_names_layout);\n mOverallView = (OverallView) rootView.findViewById(R.id.fragment_overall_view);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n\n\n view = inflater.inflate(R.layout.fragment_earning_fragmant, container, false);\n ini(view);\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n super.onCreateView(inflater, container, savedInstanceState);\n final View rootview = inflater.inflate(R.layout.activity_email_frag, container, false);\n ConfigInnerElements(rootview);\n return rootview;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\trootView = inflater.inflate(R.layout.fragment_attack_armor, container, false);\r\n\r\n\t\tfindInterfaceElements();\r\n\t\taddRangeSelector();\r\n\t\tupdateHeadings();\r\n\t\tsetListeners();\r\n\r\n\t\tsetFromData();\r\n\r\n\t\treturn rootView;\r\n\t}", "@SuppressLint(\"InflateParams\")\r\n\t@Override\r\n\tpublic View initLayout(LayoutInflater inflater) {\n\t\tView view = inflater.inflate(R.layout.frag_customer_all, null);\r\n\t\treturn view;\r\n\t}", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_fore_cast, container, false);\r\n initView();\r\n mainLayout.setVisibility(View.GONE);\r\n apiInterface = RestClinet.getClient().create(ApiInterface.class);\r\n loadData();\r\n return view;\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_friend, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_detail, container, false);\n image = rootView.findViewById(R.id.fr_image);\n name = rootView.findViewById(R.id.fr_name);\n phoneNumber = rootView.findViewById(R.id.fr_phone_number);\n email = rootView.findViewById(R.id.fr_email);\n street = rootView.findViewById(R.id.fr_street);\n city = rootView.findViewById(R.id.fr_city);\n state = rootView.findViewById(R.id.fr_state);\n zipcode = rootView.findViewById(R.id.fr_zipcode);\n dBrith = rootView.findViewById(R.id.date_brith);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_pm25, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_kkbox_playlist, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_feed_pager, container, false);\n\n// loadData();\n\n findViews(rootView);\n\n setViews();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n layout = (FrameLayout) inflater.inflate(R.layout.fragment_actualites, container, false);\n\n relLayout = (RelativeLayout) layout.findViewById(R.id.relLayoutActus);\n\n initListView();\n getXMLData();\n\n return layout;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.frag_post_prayer_video, container, false);\n setCustomDesign();\n setCustomClickListeners();\n return rootView;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.lf_em4305_fragment, container, false);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_recordings, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate(R.layout.fragment_category, container, false);\n initView(view);\n bindRefreshListener();\n loadParams();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_cm_box_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_layout12, container, false);\n\n iniv();\n\n init();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_details, container, false);\n //return inflater.inflate(R.layout.fragment_details, container, false);\n getIntentValues();\n initViews();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_mem_body_blood, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_qiugouxiaoxi, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_coll_blank, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_attendance_divide, container, false);\n\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.show_program_fragment, parent, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,\n @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.visualization_fragment, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_category_details_page, container, false);\n initializeAll();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n final View v = inflater.inflate(R.layout.fragemnt_reserve, container, false);\n\n\n\n\n return v;\n }", "protected int getLayoutResId() {\n return R.layout.activity_fragment;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_quizs, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n role = getArguments().getInt(\"role\");\n rootview = inflater.inflate(R.layout.fragment_application, container, false);\n layout = rootview.findViewById(R.id.patentDetails);\n progressBar = rootview.findViewById(R.id.progressBar);\n try {\n run();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return rootview;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tview = inflater.inflate(R.layout.fragment_zhu, null);\n\t\tinitView();\n\t\tinitData();\n\t\treturn view;\n\t}", "@Override\n\t\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)\n\t\t{\n\t\t\tView rootView = inflater.inflate(R.layout.maimfragment, container, false);\n\t\t\treturn rootView;\n\t\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n // Inflate the layout for this fragment\n return inflater.inflate(R.layout.fragment__record__week, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_porishongkhan, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_dashboard, container, false);\n resultsRv = view.findViewById(R.id.db_results_rv);\n resultText = view.findViewById(R.id.db_search_empty);\n progressBar = view.findViewById(R.id.db_progressbar);\n lastVisitText = view.findViewById(R.id.db_last_visit);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(getLayoutId(), container, false);\n init(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_feedback, container, false);\n self = getActivity();\n initUI(view);\n initControlUI();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_service_summery, container, false);\n tvVoiceMS = v.findViewById(R.id.tvVoiceValue);\n tvDataMS = v.findViewById(R.id.tvdataValue);\n tvSMSMS = v.findViewById(R.id.tvSMSValue);\n tvVoiceFL = v.findViewById(R.id.tvVoiceFLValue);\n tvDataBS = v.findViewById(R.id.tvDataBRValue);\n tvTotal = v.findViewById(R.id.tvTotalAccountvalue);\n return v;\n }", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_clan_rank_details, container, false);\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_star_wars_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_lei, container, false);\n\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_quotation, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_wode_ragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n\n\n\n\n\n return inflater.inflate(R.layout.fragment_appoint_list, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n if (rootView == null) {\n rootView = inflater.inflate(R.layout.fragment_ip_info, container, false);\n initView();\n }\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_offer, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_rooms, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n View view = inflater.inflate(R.layout.fragment_img_eva, container, false);\n\n getSendData();\n\n initView(view);\n\n initData();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_project_collection, container, false);\n ButterKnife.bind(this, view);\n fragment = this;\n initView();\n getCollectionType();\n // getCategoryList();\n initBroadcastReceiver();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_yzm, container, false);\n initView(view);\n return view;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\tmainLayout = inflater.inflate(R.layout.fragment_play, container, false);\r\n\t\treturn mainLayout;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_invite_request, container, false);\n initialiseVariables();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n getLocationPermission();\n return inflater.inflate(R.layout.centrum_fragment, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_habit_type_details, container, false);\n\n habitTitle = rootView.findViewById(R.id.textViewTitle);\n habitReason = rootView.findViewById(R.id.textViewReason);\n habitStartDate = rootView.findViewById(R.id.textViewStartDate);\n habitWeeklyPlan = rootView.findViewById(R.id.textViewWeeklyPlan);\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_information_friends4, container, false);\n\n if (getArguments() != null) {\n FriendsID = getArguments().getString(\"keyFriends\");\n }\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_post_details, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hotel, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_bus_inquiry, container, false);\n initView();\n initData();\n initDialog();\n getDataFromNet();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_weather, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_srgl, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_ground_detail_frgment, container, false);\n init();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_book_appointment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_wheretogo, container, false);\n ids();\n setup();\n click();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n binding = DataBindingUtil\n .inflate(inflater, R.layout.fragment_learning_leaders, container, false);\n init();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_end_game_tab, container, false);\n\n setupWidgets();\n setupTextFields(view);\n setupSpinners(view);\n\n // Inflate the layout for this fragment\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.memoir_fragment, container, false);\n\n getUserIdFromSharedPref();\n configureUI(view);\n configureSortSpinner();\n configureFilterSpinner();\n\n networkConnection = new NetworkConnection();\n new GetAllMemoirTask().execute();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_jadwal, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_delivery_detail, container, false);\n initialise();\n\n\n\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_4, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_product, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_group_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment06_7, container, false);\n initView(view);\n setLegend();\n setXAxis();\n setYAxis();\n setData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_downloadables, container, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.movie_list_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_like, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hall, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_unit_main, container, false);\n TextView mTxvBusinessAassistant = (TextView) view.findViewById(R.id.txv_business_assistant);\n TextView mTxvCardINformation = (TextView) view.findViewById(R.id.txv_card_information);\n RelativeLayout mRelOfficialWebsite = (RelativeLayout) view.findViewById(R.id.rel_official_website);\n RelativeLayout mRelPictureAblum = (RelativeLayout) view.findViewById(R.id.rel_picture_album);\n TextView mTxvQrCodeCard = (TextView) view.findViewById(R.id.txv_qr_code_card);\n TextView mTxvShareCard = (TextView) view.findViewById(R.id.txv_share_card);\n mTxvBusinessAassistant.setOnClickListener(this.mOnClickListener);\n mTxvCardINformation.setOnClickListener(this.mOnClickListener);\n mRelOfficialWebsite.setOnClickListener(this.mOnClickListener);\n mRelPictureAblum.setOnClickListener(this.mOnClickListener);\n mTxvQrCodeCard.setOnClickListener(this.mOnClickListener);\n mTxvShareCard.setOnClickListener(this.mOnClickListener);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_moviespage, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_s, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_overview, container, false);\n\n initOverviewComponents(view);\n registerListeners();\n initTagListener();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_bahan_ajar, container, false);\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n root = (ViewGroup) inflater.inflate(R.layout.money_main, container, false);\n context = getActivity();\n initHeaderView(root);\n initView(root);\n\n getDate();\n initEvetn();\n return root;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_historical_event, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_event_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_video, container, false);\n unbinder = ButterKnife.bind(this, view);\n initView();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n v= inflater.inflate(R.layout.fragment_post_contacts, container, false);\n this.mapping(v);\n return v;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_measures, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_feed, container, false);\n findViews(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_surah_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_data_binded, container, false);\n }" ]
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.6625158", "0.66195583", "0.66164845", "0.6608733", "0.6596594", "0.65928894", "0.6585293", "0.65842897", "0.65730995", "0.6571248", "0.6569152", "0.65689117", "0.656853", "0.6566686", "0.65652984", "0.6553419", "0.65525705", "0.65432084", "0.6542382", "0.65411425", "0.6538022", "0.65366334", "0.65355957", "0.6535043", "0.65329415", "0.65311074", "0.65310687", "0.6528645", "0.65277404", "0.6525902", "0.6524516", "0.6524048", "0.65232015", "0.65224624", "0.65185034", "0.65130377", "0.6512968", "0.65122765", "0.65116245", "0.65106046", "0.65103024", "0.6509013", "0.65088093", "0.6508651", "0.6508225", "0.6504662", "0.650149", "0.65011525", "0.6500686", "0.64974767", "0.64935696", "0.6492234", "0.6490034", "0.6487609", "0.6487216", "0.64872116", "0.6486594", "0.64861935", "0.6486018", "0.6484269", "0.648366", "0.6481476", "0.6481086", "0.6480985", "0.6480396", "0.64797544", "0.647696", "0.64758915", "0.6475649", "0.6474114", "0.6474004", "0.6470706", "0.6470275", "0.64702207", "0.6470039", "0.6467449", "0.646602", "0.6462256", "0.64617974", "0.6461681", "0.6461214" ]
0.0
-1
Criando um cliente e adicionando os dados a ele.
public static void main(String[] args) throws IOException, ClassNotFoundException { Cliente clienteWriter = new Cliente(); clienteWriter.setNome("Mateus Medeiros"); clienteWriter.setProfissao("Dev Full Stack"); clienteWriter.setCpf("0901231231"); // CRIANDO UM ARQUIVO // Usando o serializable é criado um aquivo com os dados da Classe Cliente, nesse caso do formato .bin // Nele é salvo o ID que está versionado na Classe cliente, e os dados em linguagem de máquina ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("cliente.bin")); oos.writeObject(clienteWriter); oos.close(); //Lendo o arquivo .bin e transformando a linguagem de máquina em objeto Java. //OBS: é verificado o serialUID caso diferente lança excecao e não lê o arquivo. ObjectInputStream ois = new ObjectInputStream(new FileInputStream("cliente.bin")); Cliente clienteReader = (Cliente) ois.readObject(); ois.close(); //Exibindo o arquivo no console. System.out.println(clienteReader.getNome()); System.out.println(clienteReader.getCpf()); System.out.println(clienteReader.getProfissao()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static Cliente llenarDatosCliente() {\r\n\t\tCliente cliente1 = new Cliente();\r\n\t\tcliente1.setApellido(\"De Assis\");\r\n\t\tcliente1.setDni(368638373);\r\n\t\tcliente1.setNombre(\"alexia\");\r\n\t\tcliente1.setId(100001);\r\n\r\n\t\treturn cliente1;\r\n\t}", "public void carregarCliente() {\n\t\tgetConnection();\n\t\ttry {\n\t\t\tString sql = \"SELECT CLIENTE FROM CLIENTE ORDER BY CLIENTE\";\n\t\t\tst = con.createStatement();\n\t\t\trs = st.executeQuery(sql);\n\t\t\twhile(rs.next()) {\n\t\t\t\tcbCliente.addItem(rs.getString(\"CLIENTE\"));\n\t\t\t}\n\t\t}catch(SQLException e) {\n\t\t\tSystem.out.println(\"ERRO\" + e.toString());\n\t\t}\n\t}", "public void carregarCadastro() {\n\n try {\n\n if (codigo != null) {\n\n ClienteDao fdao = new ClienteDao();\n\n cliente = fdao.buscarCodigo(codigo);\n\n } else {\n cliente = new Cliente();\n\n }\n } catch (RuntimeException e) {\n JSFUtil.AdicionarMensagemErro(\"ex.getMessage()\");\n e.printStackTrace();\n }\n\n }", "public Cliente(){\r\n this.nome = \"\";\r\n this.email = \"\";\r\n this.endereco = \"\";\r\n this.id = -1;\r\n }", "private void listaClient() {\n\t\t\r\n\t\tthis.listaClient.add(cliente);\r\n\t}", "@Override\n\tpublic void altaCliente(Cliente cliente) {\n\t}", "@Override\n void create(Cliente cliente);", "public void inserir(Cliente cliente){\n\t\tclientes[indice++] = cliente;\n\t\t\n\t}", "public void salvaCliente() {\n \n \n \n \n String nome = view.getjTextNome().getText(); //Tive que criar getter e setter pra poder acessar os campos da view\n String telefone = view.getjTextTelefone().getText();\n String cpf = view.getjTextCpf().getText();\n String endereco = view.getjTextEndereco().getText();\n\n \n Cliente client = new Cliente( nome, telefone, cpf, endereco);\n \n \n \n try {\n Connection conexao = new Conexao().getConnection();\n ClienteDAO clientedao = new ClienteDAO(conexao);\n clientedao.insert(client);\n \n JOptionPane.showMessageDialog(null, \"Cliente Cadastrado!\");\n \n } catch (SQLException ex) {\n //Logger.getLogger(CadCliente.class.getName()).log(Level.SEVERE, null, ex);\n JOptionPane.showMessageDialog(null, \"Erro ao cadastrar!\"+ex);\n }\n }", "public void recupera() {\n Cliente clienteActual;\n clienteActual=clienteDAO.buscaId(c.getId());\n if (clienteActual!=null) {\n c=clienteActual;\n } else {\n c=new Cliente();\n }\n }", "@Override\n\tpublic int agregarCliente(ClienteBean cliente) throws Exception {\n\t\treturn 0;\n\t}", "Cliente(){}", "public void selecionarCliente() {\n int cod = tabCliente.getSelectionModel().getSelectedItem().getCodigo();\n cli = cli.buscar(cod);\n\n cxCPF.setText(cli.getCpf());\n cxNome.setText(cli.getNome());\n cxRua.setText(cli.getRua());\n cxNumero.setText(Integer.toString(cli.getNumero()));\n cxBairro.setText(cli.getBairro());\n cxComplemento.setText(cli.getComplemento());\n cxTelefone1.setText(cli.getTelefone1());\n cxTelefone2.setText(cli.getTelefone2());\n cxEmail.setText(cli.getEmail());\n btnSalvar.setText(\"Novo\");\n bloquear(false);\n }", "public ClienteModel(String nome,\n String email,\n String cpf,\n String sexo,\n String nascimento,\n String estadoCivil,\n String celular,\n String telefone,\n String endereco) {\n\n clientesCadastrados++;\n this.id = clientesCadastrados;\n this.nome = nome;\n this.email = email;\n this.cpf = cpf;\n this.nascimento = nascimento;\n this.sexo = sexo;\n this.estadoCivil = estadoCivil;\n this.celular = celular;\n this.telefone = telefone;\n this.endereco = endereco;\n }", "public ListaCliente() {\n\t\tClienteRepositorio repositorio = FabricaPersistencia.fabricarCliente();\n\t\tList<Cliente> clientes = null;\n\t\ttry {\n\t\t\tclientes = repositorio.getClientes();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tclientes = new ArrayList<Cliente>();\n\t\t}\n\t\tObject[][] grid = new Object[clientes.size()][3];\n\t\tfor (int ct = 0; ct < clientes.size(); ct++) {\n\t\t\tgrid[ct] = new Object[] {clientes.get(ct).getNome(),\n\t\t\t\t\tclientes.get(ct).getEmail()};\n\t\t}\n\t\tJTable table= new JTable(grid, new String[] {\"NOME\", \"EMAIL\"});\n\t\tJScrollPane scroll = new JScrollPane(table);\n\t\tgetContentPane().add(scroll, BorderLayout.CENTER);\n\t\tsetTitle(\"Clientes Cadastrados\");\n\t\tsetSize(600,400);\n\t\tsetDefaultCloseOperation(DISPOSE_ON_CLOSE);\n\t\tsetLocationRelativeTo(null);\n\t}", "public void cadastrar(Cliente cliente){\n\t\tSystem.out.println(cliente.toString());\r\n\t\tint tamanho = this.clientes.length;\r\n\t\tthis.clientes = Arrays.copyOf(this.clientes, this.clientes.length + 1);\r\n\t\tthis.clientes[tamanho - 1] = cliente;\r\n\t}", "public ClienteDTO(String direcDirecCliente, String codubigeoDirecCliente,\r\n\t\t\tint idTipoEstablec) {\r\n\t\tsuper();\r\n\t\tthis.direcDirecCliente = direcDirecCliente;\r\n\t\tthis.codubigeoDirecCliente = codubigeoDirecCliente;\r\n\t\tthis.idTipoEstablec = idTipoEstablec;\r\n\t}", "public void novo() {\n cliente = new Cliente();\n }", "public ClienteDTO(int idDirecCliente, String idCliente,\r\n\t\t\tString direcDirecCliente, String codubigeoDirecCliente,\r\n\t\t\tint idTipoEstablec, String descTipoEstablec) {\r\n\t\tsuper();\r\n\t\tthis.idDirecCliente = idDirecCliente;\r\n\t\tthis.idCliente = idCliente;\r\n\t\tthis.direcDirecCliente = direcDirecCliente;\r\n\t\tthis.codubigeoDirecCliente = codubigeoDirecCliente;\r\n\t\tthis.idTipoEstablec = idTipoEstablec;\r\n\t\tthis.descTipoEstablec = descTipoEstablec;\r\n\t}", "public ClienteConsultas() {\n listadeClientes = new ArrayList<>();\n clienteSeleccionado = new ArrayList<>();\n }", "public void setCliente(ClienteEntity cliente) {\r\n this.cliente = cliente;\r\n }", "public Cliente(Long id, String nome, int idade) {\n\t\tsuper();\n\t\tthis.id = id;\n\t\tthis.nome = nome;\n\t\tthis.idade = idade;\n\t}", "public Cliente buscarCliente(int codigo) {\n Cliente cliente =new Cliente();\n try{\n\t\tString seleccion = \"SELECT codigo, nit, email, pais, fecharegistro, razonsocial, \"\n + \"idioma, categoria FROM clientes where codigo=? \";\n\t\tPreparedStatement ps = con.prepareStatement(seleccion);\n ps.setInt(1, codigo);\n\t\tSavepoint sp1 = con.setSavepoint(\"SAVE_POINT_ONE\");\n\t\tResultSet rs = ps.executeQuery();\n\t\tcon.commit();\n\t\twhile(rs.next()){\n cliente.setCodigo(rs.getInt(\"codigo\"));\n cliente.setNit(rs.getString(\"nit\"));\n cliente.setEmail(rs.getString(\"email\"));\n cliente.setPais(rs.getString(\"pais\"));\n cliente.setFechaRegistro(rs.getDate(\"fecharegistro\"));\n cliente.setRazonSocial(rs.getString(\"razonsocial\"));\n cliente.setIdioma(rs.getString(\"idioma\"));\n cliente.setCategoria(rs.getString(\"categoria\")); \n\t\t} \n }catch(Exception e){\n System.out.println(e.getMessage());\n e.printStackTrace();\n }\n return cliente;\n\t}", "public void CadastrarCliente(Cliente cliente) throws SQLException {\r\n String query = \"INSERT INTO cliente(nome ,cpf,data_nascimento, sexo,cep,rua,numero,bairro,cidade,estado,telefone_residencial,celular,email,senha) \"\r\n + \"VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)\";\r\n insert(query, cliente.getNome(), cliente.getCpf(), cliente.getData_nascimento(), cliente.getSexo(), cliente.getCep(), cliente.getRua(), cliente.getNumero(), cliente.getBairro(), cliente.getCidade(), cliente.getEstado(), cliente.getTelefone_residencial(), cliente.getCelular(), cliente.getEmail(), cliente.getSenha());\r\n }", "public Client buscarClientePorId(String id){\n Client client = new Client();\n \n // Faltaaaa\n \n \n \n \n \n return client;\n }", "public Interfaz_RegistroClientes() {\n initComponents();\n limpiar();\n }", "@Override\r\n public void crearCliente(Cliente cliente) throws Exception {\r\n entity.getTransaction().begin();//inicia la creacion\r\n entity.persist(cliente);//se crea el cliente\r\n entity.getTransaction().commit();//finaliza la creacion\r\n }", "@Override\r\n public void getCliente(Cliente cliente) {\r\n if (cliente!=null){\r\n this.cliente = cliente;\r\n nomeClientejTextField.setText(cliente.getNome());\r\n }\r\n }", "public Cliente getCliente() {\n return objCliente;\n }", "void grabarCliente(){\n RequestParams params = new RequestParams();\n params.put(\"nombre\",edtNombre.getText().toString().trim());\n params.put(\"apellido\",edtApellido.getText().toString().trim());\n params.put(\"correo\", edtCorreo.getText().toString().trim());\n String claveMD5 = edtClave.getText().toString().trim();\n try {\n params.put(\"clave\", ws.getMD5(claveMD5));\n } catch (Exception e) {\n e.printStackTrace();\n }\n params.put(\"id_cargo\",idCargo);\n params.put(\"autoriza\",validarCheckBoxAutoriza());\n crearUsuarioWS(params);\n }", "private Client createClient() {\n\t\tClient client = null;\n\t\tvar clientsList = clientDAO.getClients();\n\t\tvar name = txtName.getText();\n\t\tvar surnames = txtSurnames.getText();\n\t\tvar dni = txtDni.getText();\n\t\tvar telephone = txtTelephone.getText();\n\n\t\tif (txtDni.getText().isBlank() || txtName.getText().isBlank() || txtSurnames.getText().isBlank()\n\t\t\t\t|| txtTelephone.getText().isBlank()) {\n\t\t\tJOptionPane.showMessageDialog(frame, \"Error, los campos no pueden estar vacios, ni contener solo espacios\",\n\t\t\t\t\t\"Warning!\", JOptionPane.ERROR_MESSAGE);\n\t\t} else {\n\t\t\t// Comprobar si el cliente ya existe\n\t\t\tvar exist = false;\n\t\t\tfor (int i = 0; i < clientsList.size(); ++i) {\n\t\t\t\tif (dni.equalsIgnoreCase(clientsList.get(i).getDni())) {\n\t\t\t\t\texist = true;\n\t\t\t\t\tJOptionPane.showMessageDialog(frame, \"Error, ya existe el DNI introducido\", \"Warning!\",\n\t\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!exist) {\n\t\t\t\tclient = new Client(dni, name, surnames, telephone);\n\t\t\t}\n\t\t}\n\n\t\treturn client;\n\t}", "public Cliente getCliente() {\n return cliente;\n }", "private void criaContaCliente (String cpf) {\n this.contasClientes.put(cpf, new Conta(cpf));\n }", "public Cliente ddCliente(String modo){\n ClienteDAO cd = new ClienteDAO();\n Cliente c = null;\n String rz = txtCliRz.getText()+\"\";\n String nFantasia = txtCliNFant.getText()+\"\";\n String DDDTel = txtCliDDD.getText()+\"\";\n String tel = txtCliTel.getText()+\"\";\n String DDDCel = txtCliDDDTel2.getText()+\"\";\n String cel = txtCliTel2.getText()+\"\";\n String rsp = txtCliResp.getText()+\"\"; \n String cnpj = txtCliCNPJ.getText()+\"\";\n c = new Cliente();\n \n if(modo.equalsIgnoreCase(\"a\")){ \n int cod = Integer.parseInt(txtCliCod.getText());\n c.setId(cod);\n } \n \n c.setCNPJ(cnpj);\n c.setRSocial(rz);\n c.setNFantasia(nFantasia);\n c.setDDDCel(DDDCel);\n c.setTel2(cel);\n c.setRsp(rsp);\n c.setDDDTel(DDDTel);\n c.setTel(tel);\n \n return c;\n }", "public Client(String nom, String prenom, String adresse,CalculerTarif calculerTarif) {\n // Initialisation des données du client.\n this.nom = nom;\n this.prenom = prenom;\n this.adresse = adresse;\n this.calculerTarif = calculerTarif;\n this.listeVehicule = new ArrayList<Vehicule>();\n \n // On ajoute le client à la liste des clients du parking, car le client est forcément un client du parking.\n Parking.getInstance().addClient(this);\n }", "public ControladorClientes(Vista vistaCliente) {\r\n\t\tthis.vistaCliente = vistaCliente;\r\n\t\tthis.clienteDao = new ClienteDAO();\r\n\t}", "@Override\n\tpublic void cadastrar(Cliente o) {\n\t\t\n\t}", "public void makeClient() {\n try {\n clienteFacade.create(cliente);\n FacesContext.getCurrentInstance().addMessage(\"messages\", new FacesMessage(FacesMessage.SEVERITY_INFO, \"Cliente creado exitosamente\", null));\n } catch (Exception e) {\n System.err.println(\"Error en la creacion del usuario: \" + e.getMessage());\n FacesContext.getCurrentInstance().addMessage(\"messages\", new FacesMessage(FacesMessage.SEVERITY_FATAL, e.getMessage(), null));\n }\n }", "public void persistir(Cliente cliente){\n }", "public Cliente(String nombre, String nit, String direccion, String municipio, String departamento) {\n this.nombre = nombre;\n this.nit = nit;\n this.direccion = direccion;\n this.municipio = municipio;\n this.departamento = departamento;\n }", "public void createNewClient(String nom, String prenom, String tel, String mail, String adresse) throws SQLException {\n\t\tint tmp = getLastClientId();\n\t\tSystem.out.println(tmp);\n\t\tif(tmp != 0) {\n\t\t\t//voir generated keys pour l'id\n\t\t\tClient tmpClient = new Client(tmp, nom, prenom, tel, mail, adresse);\n\t\t\tClient tmp2 = create(tmpClient);\n\t\t\tSystem.out.println(tmp2.getLogin());\n\t\t\tSystem.out.println(\"Succès lors de la création de l'utilisateur\");\n\t\t}else\n\t\t\tSystem.out.println(\"Erreur lors de la création de l'utilisateur\");\n\t}", "public JFAgregarCliente() {\n initComponents();\n inicializarCombos();\n }", "public Empresa(){\r\n\t\tclientes = new ArrayList<Cliente>();\r\n\t\tmedidores = new ArrayList<Medidor>();\r\n\t\tmapaClientes = new HashMap<String,String>();\r\n\t}", "public static Cliente insertCliente(int CED_CLIENTE,String NOMB_CLIENTE,\n String DIR_CLIENTE,ArrayList<Long> telefonos_cliente){\n \n Cliente miCliente = new Cliente(CED_CLIENTE,NOMB_CLIENTE,DIR_CLIENTE,telefonos_cliente);\n miCliente.registrarCliente();\n return miCliente;\n }", "@Override\r\n public Cliente buscarCliente(String cedula) throws Exception {\r\n return entity.find(Cliente.class, cedula);//busca el cliente\r\n }", "public clientesBean() {\n this.clie = new Clientes();\n }", "public Cliente(ArrayList<Direccion> v_direcciones, int v_rol, int v_ID, String v_correo, String v_pass, String v_usuario,\n String v_nombre, String v_apellido, String v_segundo_apellido, LocalDate v_fechanac, String genero, String v_telefono, String identificacion) {\n super(v_rol, v_ID, v_correo, v_pass, v_usuario, v_nombre, v_apellido, v_segundo_apellido, v_fechanac, genero, v_telefono, identificacion);\n this.v_direcciones = v_direcciones;\n }", "public ListaCliente() {\n initComponents();\n carregarTabela();\n }", "public ClienteDTO(int idTipoCliente, String nomCliente,\r\n\t\t\tString apePatCliente, String apeMatCliente, String fecNacCliente,\r\n\t\t\tString sexoCliente, String telefonoCliente, String celularCliente,\r\n\t\t\tString correoCliente, String numDocumento, String razSocCliente,\r\n\t\t\tString ciiuCliente, String cargoContacCliente) {\r\n\t\tsuper();\r\n\t\tthis.idTipoCliente = idTipoCliente;\r\n\t\tthis.nomCliente = nomCliente;\r\n\t\tthis.apePatCliente = apePatCliente;\r\n\t\tthis.apeMatCliente = apeMatCliente;\r\n\t\tthis.fecNacCliente = fecNacCliente;\r\n\t\tthis.sexoCliente = sexoCliente;\r\n\t\tthis.telefonoCliente = telefonoCliente;\r\n\t\tthis.celularCliente = celularCliente;\r\n\t\tthis.correoCliente = correoCliente;\r\n\t\tthis.numDocumento = numDocumento;\r\n\t\tthis.razSocCliente = razSocCliente;\r\n\t\tthis.ciiuCliente = ciiuCliente;\r\n\t\tthis.cargoContacCliente = cargoContacCliente;\r\n\t}", "@Override\n\tpublic List<EntidadeDominio> PegarCartoesCliente(EntidadeDominio entidade) throws SQLException {\n\t\treturn null;\n\t}", "public void AfficherListClient() throws Exception{\n laListeClient = Client_Db_Connect.tousLesClients();\n laListeClient.forEach((c) -> {\n modelClient.addRow(new Object[]{ c.getIdent(),\n c.getRaison(),\n c.getTypeSo(),\n c.getDomaine(),\n c.getAdresse(),\n c.getTel(),\n c.getCa(),\n c.getComment(),\n c.getNbrEmp(),\n c.getDateContrat(),\n c.getAdresseMail()});\n });\n }", "private void onCadastrarCliente() {\n prepFieldsNovoCliente();\n mainCliente = null;\n }", "public Cliente(String nombre, String nit, String direccion) {\n this.nombre = nombre;\n this.nit = nit;\n this.direccion = direccion;\n }", "public ClienteDTO(String idCliente, String nomCliente,\r\n\t\t\tString apePatCliente, String apeMatCliente, String fecNacCliente,\r\n\t\t\tString sexoCliente, String telefonoCliente, String celularCliente,\r\n\t\t\tString correoCliente, String numDocumento, String idEstado,\r\n\t\t\tString razSocCliente, String ciiuCliente, String cargoContacCliente) {\r\n\t\tsuper();\r\n\t\tthis.idCliente = idCliente;\r\n\t\tthis.nomCliente = nomCliente;\r\n\t\tthis.apePatCliente = apePatCliente;\r\n\t\tthis.apeMatCliente = apeMatCliente;\r\n\t\tthis.fecNacCliente = fecNacCliente;\r\n\t\tthis.sexoCliente = sexoCliente;\r\n\t\tthis.telefonoCliente = telefonoCliente;\r\n\t\tthis.celularCliente = celularCliente;\r\n\t\tthis.correoCliente = correoCliente;\r\n\t\tthis.numDocumento = numDocumento;\r\n\t\tthis.idEstado = idEstado;\r\n\t\tthis.razSocCliente = razSocCliente;\r\n\t\tthis.ciiuCliente = ciiuCliente;\r\n\t\tthis.cargoContacCliente = cargoContacCliente;\r\n\t}", "public void agregarDatosCliente(Integer codCliente){\n try{\n ClienteDao clienteDao = new ClienteDaoImp();\n //obtenemos la instancia de Cliente en Base a su codigo\n this.cliente = clienteDao.obtenerClientePorCodigo(codCliente);\n //Mensaje de confirmacion de exito de la operacion\n FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO,\"Correcto\", \"Cliente agregado correctamente!\");\n FacesContext.getCurrentInstance().addMessage(null, message);\n }catch(Exception e){\n e.printStackTrace();\n }\n \n }", "private void buscarCliente(String id) {\r\n\t\ttry {\r\n\t\t\tif(txtNif.getText().equals(\"\")){\r\n\t\t\t\tString mensaje = \"Por favor, introduce el nif\";\r\n\t\t\t\tJOptionPane.showMessageDialog(this, mensaje, \"ERROR\", JOptionPane.ERROR_MESSAGE);\t\t\r\n\t\t\t\ttxtNif.setBorder(BorderFactory.createLineBorder(Color.RED));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tCliente cliente = new Cliente();\r\n\t\t\t\tcliente=manager.getClienteById(id);\r\n\t\t\t\tmodel.removeAllElements();\r\n\t\t\t\tif(cliente.getNif().equals(null)) {\r\n\t\t\t\t\tString mensaje = \"No existe ese cliente\";\r\n\t\t\t\t\tJOptionPane.showMessageDialog(this, mensaje, \"NO EXISTE ESE CLIENTE\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t\ttxtNif.setBorder(BorderFactory.createLineBorder(Color.RED));\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\tmodel.addElement(cliente);\t\t\t\t\r\n\t\t\t\tcliente.toString();\r\n\t\t\t\ttxtNif.setText(\"\");\r\n\t\t\t\ttxtNif.setBorder(BorderFactory.createLineBorder(Color.BLACK));\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tString mensaje = \"No existe ese cliente\";\r\n\t\t\tJOptionPane.showMessageDialog(this, mensaje, \"ERROR\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\t}\t\t\r\n\t}", "public MiAhorcadoCliente() throws RemoteException{}", "public void gravarCliente() {\n\t\tCliente cliente = new DAO<Cliente>(Cliente.class)\n\t\t\t\t.buscaPorId(this.clienteId);\n\t\tthis.solicitacao.adicionaCliente(cliente);\n\t\tSystem.out.println(\"Cliente a gravar é \" + cliente.getNome());\n\t}", "public TelaCliente() {\n \n CadCli = new Dao_CadastroCliente();\n initComponents();\n BtPesquisarConsulta.setEnabled(false);\n BtSalvarCli.setEnabled(false);\n BtAlterarCli.setEnabled(false);\n TipodeViaCli.setEnabled(false);\n TxEstadoCli.setEnabled(false);\n BtBuscarCli.setEnabled(false);\n BtLimparCli.setEnabled(false);\n TxTipoPessoa.setEnabled(false);\n PnlPj.setVisible(false);\n PnlPf.setVisible(false);\n centralizarComponente();\n\n }", "public ClientesCadastrados() {\n initComponents();\n tabelaClientes();\n Tabela.setRowSelectionAllowed(false);\n Tabela.getTableHeader().setReorderingAllowed(false);\n setIcone();\n }", "public void añadircliente(ClienteHabitual cliente) throws SQLException{\n Connection conexion = null;\n \n try{\n conexion = GestionSQL.openConnection();\n if(conexion.getAutoCommit()){\n conexion.setAutoCommit(false);\n }\n \n ClientesHabitualesDatos clientesdatos = new ClientesHabitualesDatos(conexion);\n clientesdatos.insert(cliente);\n conexion.commit();\n System.out.println(\"Cliente ingresado con exito\");\n \n }catch(SQLException ex){\n System.out.println(\"Error al insertar \"+ex);\n try{\n //Tratamos la excepcion y se agega un rollback para evitar males mayores en la BD\n conexion.rollback();\n System.out.println(\"Procediendo a rollback\");\n }catch(SQLException ex1){\n System.out.println(\"Error en rollback de insertado \"+ex1);\n }\n }finally{\n if (conexion != null){\n conexion.close();\n }\n }\n }", "public Cliente carregarPorId(int id) throws Exception {\n \n Cliente c = new Cliente();\n String sql = \"SELECT * FROM cliente WHERE idCliente = ?\";\n PreparedStatement pst = conn.prepareStatement(sql);\n pst.setInt(1, id);\n ResultSet rs = pst.executeQuery();\n if (rs.next()) {\n c.setIdCliente(rs.getInt(\"idCliente\"));\n c.setEndereco(rs.getString(\"endereco\"));\n c.setCidade(rs.getString(\"cidade\"));\n c.setDdd(rs.getInt(\"ddd\"));\n c.setNome(rs.getString(\"nome\"));\n c.setUf(rs.getString(\"uf\"));\n c.setTelefone(rs.getString(\"telefone\"));\n Empresa e = new Empresa();\n EmpresaDAO ePB = new EmpresaDAO();\n ePB.conectar();\n e = ePB.carregarPorCnpj(rs.getString(\"Empresa_cnpj\"));\n ePB.desconectar();\n Usuario p = new Usuario();\n UsuarioDAO pPB = new UsuarioDAO();\n pPB.conectar();\n p = pPB.carregarPorId(rs.getInt(\"Usuario_idUsuario\"));\n pPB.desconectar();\n c.setEmpresa(e);\n c.setUsuario(p);\n }\n return c;\n }", "@Override\r\n\tpublic void aggiornaUI() {\r\n\t\tString valore = input_ricerca_cliente.getText();\r\n\t\tthis.clienti.setAll(AppFacadeController.getInstance().getGestisciClientiController().cercaCliente(valore));\r\n\t}", "@Override\n\tpublic void inserir(CLIENTE cliente) {\n\t\t\n\t\tString sql = \"INSERT INTO CLIENTE (NOME_CLIENTE) VALUES (?)\";\n\t\t\n\t\tConnection conexao;\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tconexao = JdbcUtil.getConexao();\n\t\t\t\n\t\t\tPreparedStatement ps = conexao.prepareStatement(sql);\n\t\t\t\n\t\t\tps.setString(1, cliente.getNomeCliente());\n\t\t\t\n\t\t\tps.execute();\n\t\t\tps.close();\n\t\t\tconexao.close();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t}\n\t\t\n\t}", "public frmClienteIncobrable() {\n initComponents();\n \n //CARGAR PROVINCIAS\n ArrayList<clsComboBox> dataProvincia = objProvincia.consultarTipoIncobrable(); \n for(int i=0;i<dataProvincia.size();i=i+1)\n {\n clsComboBox oItem = new clsComboBox(dataProvincia.get(i).getCodigo(), dataProvincia.get(i).getDescripcion());\n cmbTipoIncobrable.addItem(oItem); \n } \n \n \n //CARGAR AUTOCOMPLETAR\n List<String> dataCedula = objCliente.consultarCedulas(); \n SelectAllUtils.install(txtCedula);\n ListDataIntelliHints intellihints = new ListDataIntelliHints(txtCedula, dataCedula); \n intellihints.setCaseSensitive(false);\n \n Date fechaActual = new Date();\n txtFecha.setDate(fechaActual);\n }", "public void addCliente(Cliente cliente) throws SQLException, Exception {\n\n\t\tString sql = String.format(\"INSERT INTO %1$s.CLIENTE (CEDULA, NOMBRE, ROLUNIANDINO) VALUES (%2$s, '%3$s', '%4$s')\", \n\t\t\t\tUSUARIO, \n\t\t\t\tcliente.getCedula(),\n\t\t\t\tcliente.getNombre(),\n\t\t\t\tcliente.getRolUniandino());\n\t\tSystem.out.println(sql);\n\n\t\tPreparedStatement prepStmt = conn.prepareStatement(sql);\n\t\trecursos.add(prepStmt);\n\t\tprepStmt.executeQuery();\n\n\t}", "private static Cliente generarDatosCliente(boolean nuevo) throws ClienteException, DireccionException {\n String codigoCliente = null;\n\n if (!nuevo) {\n System.out.print(\"Introduzca el valor de el codigo de cliente: \");\n codigoCliente = teclado.nextLine();\n }\n\n System.out.print(\"Introduzca el valor de dni: \");\n String dni = teclado.nextLine();\n\n System.out.print(\"Introduzca el valor de nombre: \");\n String nombre = teclado.nextLine();\n\n System.out.print(\"Introduzca el valor de apellidos: \");\n String apellidos = teclado.nextLine();\n\n System.out.print(\"Introduzca el valor de fechaNacimiento: \");\n String fechaNacimiento = teclado.nextLine();\n\n System.out.print(\"Introduzca el valor de telefono: \");\n String telefono = teclado.nextLine();\n\n Cliente cliente = new Cliente(codigoCliente, nombre, apellidos, dni, fechaNacimiento, telefono, generarDatosDireccion(dni));\n clienteController.validarCliente(cliente);\n\n return cliente;\n }", "private Cliente obtenerCliente(Long oidCliente, Solicitud solicitud)\n throws MareException {\n UtilidadesLog.info(\" DAOSolicitudes.obtenerCliente(Long oidCliente,\"\n +\"Solicitud solicitud):Entrada\");\n\n /*Descripcion: este metodo retorna un objeto de la clase Cliente\n con todos sus datos recuperados.\n\n Implementacion:\n\n 1- Invocar al metodo obtenerDatosGeneralesCliente pasandole por\n parametro el oidCliente. Este metodo retornara un objeto de la clase\n Cliente el cual debe ser asignado a la propiedad cliente de la \n Solicitud.\n 2- Invocar al metodo obtenerTipificacionesCliente pasandole por\n parametro el objeto cliente. Este metodo creara un array de objetos\n de la clase TipificacionCliente el cual asignara al atributo\n tipificacionCliente del cliente pasado por parametro.\n 3- Invocar al metodo obtenerHistoricoEstatusCliente pasandole por\n parametro el objeto cliente. Este metodo asignara un array de objetos\n de la clase HistoricoEstatusCliente al atributo \n historicoEstatusCliente\n del cliente pasado por parametro.\n 4- Invocar al metodo obtenerPeriodosConPedidosCliente pasandole por\n parametro el objeto cliente. Este metodo asignara un array de objetos\n de la clase Periodo al atributo periodosConPedidos del cliente pasado\n por parametro.\n 5- Invocar al metodo obtenerClienteRecomendante pasandole por\n parametro el objeto cliente. Este metodo asignara un objeto de la\n calse ClienteRecomendante al atributo clienteRecomendante del cliente\n recibido por parametro.\n 6- Invocar al metodo obtenerDatosGerentes pasandole por parametro el\n objeto cliente.\n */\n\n //1\n Cliente cliente = this.obtenerDatosGeneralesCliente(oidCliente, \n solicitud.getPeriodo());\n solicitud.setCliente(cliente);\n\n //2\n UtilidadesLog.debug(\"****obtenerCliente 1****\");\n this.obtenerTipificacionesCliente(cliente);\n UtilidadesLog.debug(\"****obtenerCliente 2****\");\n\n //3\n this.obtenerHistoricoEstatusCliente(cliente);\n UtilidadesLog.debug(\"****obtenerCliente 3****\");\n\n //4\n this.obtenerPeriodosConPedidosCliente(cliente);\n UtilidadesLog.debug(\"****obtenerCliente 4****\");\n\n //5\n //jrivas 4/7/2005\n //Inc 16978 \n this.obtenerClienteRecomendante(cliente, solicitud.getOidPais());\n\n // 5.1\n // JVM - sicc 20070237, calling obtenerClienteRecomendado\n this.obtenerClienteRecomendado(cliente, solicitud.getOidPais());\n\n //6\n this.obtenerDatosGerentes(cliente, solicitud.getPeriodo());\n if(log.isDebugEnabled()) //sapaza -- cambio Optimizacion Logs -- 23/03/2010 \n UtilidadesLog.debug(\"Salio de obtenerCliente - DAOSolicitudes\");\n \n // vbongiov 22/9/2005 inc 20940\n cliente.setIndRecomendante(this.esClienteRecomendante(cliente.getOidCliente(), solicitud.getPeriodo()));\n\n // jrivas 30/8//2006 inc DBLG5000839\n cliente.setIndRecomendado(this.esClienteRecomendado(cliente.getOidCliente(), solicitud.getPeriodo()));\n \n UtilidadesLog.info(\" DAOSolicitudes.obtenerCliente(Long oidCliente, \"\n +\"Solicitud solicitud):Salida\");\n return cliente;\n }", "public TelaAlterarCliente() {\n\t\tinitComponents();\n\t}", "public AreaClientes() {\n initComponents();\n cargarTabla();\n editarCliente(false);\n \n }", "public ClienteDTO(int idTipoCliente, String nomCliente,\r\n\t\t\tString apePatCliente, String apeMatCliente, String fecNacCliente,\r\n\t\t\tString sexoCliente, String telefonoCliente, String celularCliente,\r\n\t\t\tString correoCliente, String numDocumento) {\r\n\t\tsuper();\r\n\t\tthis.idTipoCliente = idTipoCliente;\r\n\t\tthis.nomCliente = nomCliente;\r\n\t\tthis.apePatCliente = apePatCliente;\r\n\t\tthis.apeMatCliente = apeMatCliente;\r\n\t\tthis.fecNacCliente = fecNacCliente;\r\n\t\tthis.sexoCliente = sexoCliente;\r\n\t\tthis.telefonoCliente = telefonoCliente;\r\n\t\tthis.celularCliente = celularCliente;\r\n\t\tthis.correoCliente = correoCliente;\r\n\t\tthis.numDocumento = numDocumento;\r\n\t}", "@Override\r\n public List<Cliente> listarClientes() throws Exception {\r\n Query consulta = entity.createNamedQuery(Cliente.CONSULTA_TODOS_CLIENTES);\r\n List<Cliente> listaClientes = consulta.getResultList();//retorna una lista\r\n return listaClientes;\r\n }", "public ClienteDTO(String idCliente, String descTipoCliente, String nomCliente,\r\n\t\t\tString apePatCliente, String apeMatCliente, String telefonoCliente,\r\n\t\t\tString celularCliente, String correoCliente, String descEstado) \r\n\t{\r\n\t\tsuper();\r\n\t\tthis.idCliente = idCliente;\r\n\t\tthis.nomCliente = nomCliente;\r\n\t\tthis.apePatCliente = apePatCliente;\r\n\t\tthis.apeMatCliente = apeMatCliente;\r\n\t\tthis.telefonoCliente = telefonoCliente;\r\n\t\tthis.celularCliente = celularCliente;\r\n\t\tthis.correoCliente = correoCliente;\r\n\t\tthis.descEstado = descEstado;\r\n\t\tthis.descTipoCliente = descTipoCliente;\r\n\t}", "public ClienteModel(int id,\n String nome,\n String email,\n String cpf,\n String sexo,\n String nascimento,\n String estadoCivil,\n String celular,\n String telefone,\n String endereco) {\n\n this.id = id;\n this.nome = nome;\n this.email = email;\n this.cpf = cpf;\n this.nascimento = nascimento;\n this.sexo = sexo;\n this.estadoCivil = estadoCivil;\n this.celular = celular;\n this.telefone = telefone;\n this.endereco = endereco;\n }", "public TelaListaCliente(ListadePessoas list) {\n initComponents();\n cli = new ArrayList<>();\n \n for(Cliente c: list.getClientes()){\n cli.add(c);\n }\n \n DefaultTableModel dtm = (DefaultTableModel) jclient.getModel();\n for(Cliente c: cli){ \n Object[] dados = {c.getNome(),c.getCpf(),c.getEndereco(),c.getTelefone()};\n dtm.addRow(dados);\n }\n }", "public Pedido(Cliente cliente, Date fecha, String estado, int importe, int cantidad, String lugar) {\n\t\tsuper();\n\t\tthis.cliente = cliente;\n\t\tthis.fecha = fecha;\n\t\tthis.estado = estado;\n\t\tthis.importe = importe;\n\t\tthis.cantidad = cantidad;\n\t\tthis.lugar = lugar;\n\t}", "@Override\n\tpublic void cargarClienteSinCobrador() {\n\t\tpopup.showPopup();\n\t\tif(UIHomeSesion.usuario!=null){\n\t\tlista = new ArrayList<ClienteProxy>();\n\t\tFACTORY.initialize(EVENTBUS);\n\t\tContextGestionCobranza context = FACTORY.contextGestionCobranza();\n\t\tRequest<List<ClienteProxy>> request = context.listarClienteSinCobrador(UIHomeSesion.usuario.getIdUsuario()).with(\"beanUsuario\");\n\t\trequest.fire(new Receiver<List<ClienteProxy>>() {\n\t\t\t@Override\n\t\t\tpublic void onSuccess(List<ClienteProxy> response) {\n\t\t\t\tlista.addAll(response);\t\t\t\t\n\t\t\t\tgrid.setData(lista);\t\t\t\t\n\t\t\t\tgrid.getSelectionModel().clear();\n\t\t\t\tpopup.hidePopup();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n public void onFailure(ServerFailure error) {\n popup.hidePopup();\n //Window.alert(error.getMessage());\n Notification not=new Notification(Notification.WARNING,error.getMessage());\n not.showPopup();\n }\n\t\t\t\n\t\t});\n\t\t}\n\t}", "@Override\r\n\tpublic void buscarCliente(String dato) {\n\t\tList<Cliente> listaEncontrados = clienteDao.buscarContrato(dato);\r\n\t\tvistaCliente.mostrarClientes(listaEncontrados);\r\n\t}", "private void llenarEntidadConLosDatosDeLosControles() {\n clienteActual.setNombre(txtNombre.getText());\n clienteActual.setApellido(txtApellido.getText());\n clienteActual.setDui(txtDui.getText());\n //clienteActual.setNumero(txtNumero.getText());\n //clienteActual.setNumero(Integer.parseInt(this.txtNumero.getText()));\n clienteActual.setNumero(Integer.parseInt(this.txtNumero.getText()));\n }", "public TelaCliente() {\n\n try {\n Handler console = new ConsoleHandler();\n Handler file = new FileHandler(\"/tmp/roquerou.log\");\n console.setLevel(Level.ALL);\n file.setLevel(Level.ALL);\n file.setFormatter(new SimpleFormatter());\n LOG.addHandler(file);\n LOG.addHandler(console);\n LOG.setUseParentHandlers(false);\n } catch (IOException io) {\n LOG.warning(\"O ficheiro hellologgin.xml não pode ser criado\");\n }\n\n initComponents();\n NivelDAO nd = new NivelDAO();\n if (nd.buscar() == 3) {\n botaoNovoCliente.setEnabled(false);\n buscarcli.setEnabled(false);\n tabelaCliente.setEnabled(false);\n popularCombo();\n setarLabels();\n\n LOG.info(\"Abertura da Tela de Clientes\");\n } else {\n popularCombo();\n setarLabels();\n\n LOG.info(\"Abertura da Tela de Clientes\");\n }\n }", "public ClienteDTO(String idCliente, String nomCliente,\r\n\t\t\tString apePatCliente, String apeMatCliente, String fecNacCliente,\r\n\t\t\tString sexoCliente, String telefonoCliente, String celularCliente,\r\n\t\t\tString correoCliente, String numDocumento, String idEstado) {\r\n\t\tsuper();\r\n\t\tthis.idCliente = idCliente;\r\n\t\tthis.nomCliente = nomCliente;\r\n\t\tthis.apePatCliente = apePatCliente;\r\n\t\tthis.apeMatCliente = apeMatCliente;\r\n\t\tthis.fecNacCliente = fecNacCliente;\r\n\t\tthis.sexoCliente = sexoCliente;\r\n\t\tthis.telefonoCliente = telefonoCliente;\r\n\t\tthis.celularCliente = celularCliente;\r\n\t\tthis.correoCliente = correoCliente;\r\n\t\tthis.numDocumento = numDocumento;\r\n\t\tthis.idEstado = idEstado;\r\n\t}", "@Override\n\tpublic void asignarClienteAcobrador() {\n\t\tSet<ClienteProxy> lista=grid.getMultiSelectionModel().getSelectedSet();\t\t\n\t\tif(!lista.isEmpty()){\n\t\t\tFACTORY.initialize(EVENTBUS);\n\t\t\tContextGestionCobranza context = FACTORY.contextGestionCobranza();\t\t\t\n\t\t\tRequest<Boolean> request=context.asignarClientesAlCobrador(lista, beanGestorCobranza.getIdUsuarioOwner(), beanGestorCobranza.getIdUsuarioCobrador() , beanGestorCobranza.getIdGestorCobranza());\n\t\t\trequest.fire(new Receiver<Boolean>(){\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onSuccess(Boolean response) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\tgoToBack();\n\t\t\t\t}});\n\t\t}else{\n\t\t\tNotification not=new Notification(Notification.ALERT,constants.seleccioneCliente());\n\t\t\tnot.showPopup();\n\t\t}\n\t}", "private static void crearPedidoGenerandoOPCyOrdenInsumo() throws RemoteException {\n\t\tlong[] idVariedades = { 63 };\n\t\tint[] cantidades = { 4 };\n\t\tPedidoClienteDTO pedido = crearPedido(\"20362134596\", \"test 5\", idVariedades, cantidades);\n\n\t\tpedido = PedidoController.getInstance().crearPedido(pedido).toDTO();\n\n\t\tPedidoController.getInstance().cambiarEstadoPedidoCliente(pedido.getNroPedido(), EstadoPedidoCliente.ACEPTADO);\n\t}", "public Cliente(String nome) {\n super(nome);\n }", "public DAOCliente() {\n\t\trecursos = new ArrayList<Object>();\n\t}", "public ArrayList<DataCliente> listarClientes();", "public ClienteEntity getCliente() {\r\n return cliente;\r\n }", "public Cliente getCliente() {\n\t\ttry {\n\t\t\tCalendar d_n = Calendar.getInstance();\n\t\t\td_n.setTime(dateChooser.getDate());\n\t\t\tString data_nascimento = d_n.get(Calendar.DAY_OF_WEEK) + \"-\" + d_n.get(Calendar.MONTH) + \"-\" + d_n.get(Calendar.YEAR);\n\t\t\tString nome = tfEmitente.getText();\n\t\t\tString cpf = ftfCpf.getText();\t\t\t\t\n\t\t\tcpf = cpf.replace('-',' ');\n\t\t\tcpf = cpf.replace('.',' ');\n\t\t\tcpf = cpf.trim();\n\t\t\tString rg = ftfRg.getText();\n\t\t\tString email = tfEmail.getText();\n\t\t\tString tel_fixo = ftfTelResidencial.getText();\n\t\t\ttel_fixo = tel_fixo.replaceAll(\"-\",\"\");\n\t\t\tString telefone_celular = ftfTelCelular.getText();\n\t\t\ttelefone_celular = telefone_celular.replaceAll(\"-\",\"\");\n\t\t\tString cep = ftfCep.getText();\n\t\t\tcep = cep.replaceAll(\"-\",\"\");\n\t\t\tString logradouro = tfLogradouro.getText();\n\t\t\tString numero = ftfNumero.getText();\n\t\t\tString complemento = tfComplemento.getText();\n\t\t\tString cidade = tfCidade.getText();\n\t\t\tString bairro = tfBairro.getText();\n\t\t\tString tipo = ftfTipo.getText();\n\t\t\t\n\t\t\treturn new Cliente(nome, cpf, rg, tel_fixo, telefone_celular, cep, logradouro,\n\t\t\t\t\t numero, complemento, cidade, bairro, tipo.charAt(0), email);\n\t\t} catch (NullPointerException npe) {\n\t\t\treturn null;\n\t\t}\n\n\t}", "public TelaCliente() {\n initComponents();\n conexao=ModuloConexao.conector();\n }", "public VistaConsultarMovimientosPorCliente() {\n initComponents();\n continuarInicializandoComponentes();\n }", "@PostMapping(\"/agregarCliente\")\r\n public @ResponseBody\r\n Map<String, Object> agregarCliente(\r\n @RequestParam(\"tipoDocumento\") String tipoDocumento,\r\n @RequestParam(\"documento\") String documento,\r\n @RequestParam(\"nombre\") String nombre,\r\n @RequestParam(\"pais\") String pais,\r\n @RequestParam(\"ciudad\") String ciudad,\r\n @RequestParam(\"direccion\") String direccion,\r\n @RequestParam(\"telefono\") String telefono,\r\n @RequestParam(\"correo\") String correo) {\r\n try {\r\n\r\n Cliente CL = new Cliente();\r\n\r\n CL.setTipoDocumento(tipoDocumento);\r\n CL.setDocumento(documento);\r\n CL.setNombre(nombre);\r\n CL.setPais(pais);\r\n CL.setCiudad(ciudad);\r\n CL.setDireccion(direccion);\r\n CL.setTelefono(telefono);\r\n CL.setCorreo(correo.toLowerCase());\r\n CL.setUser(usuario());\r\n\r\n clienteRepository.save(CL);\r\n\r\n return ResponseUtil.mapOK(CL);\r\n } catch (Exception e) {\r\n return ResponseUtil.mapError(\"Error en el proceso \" + e);\r\n }\r\n }", "public static List<ClientesVO> listarClientes() throws Exception {\r\n\r\n List<ClientesVO> vetorClientes = new ArrayList<ClientesVO>();\r\n\r\n try {\r\n ConexaoDAO.abreConexao();\r\n } catch (Exception erro) {\r\n throw new Exception(erro.getMessage());\r\n }\r\n\r\n try {\r\n\r\n //Construçao do objeto Statement e ligaçao com a variavel de conexao\r\n stClientes = ConexaoDAO.connSistema.createStatement();\r\n\r\n //SELECT NO BANCO\r\n String sqlLista = \"Select * from clientes\";\r\n\r\n //Executando select e armazenando dados no ResultSet\r\n rsClientes = stClientes.executeQuery(sqlLista);\r\n\r\n while (rsClientes.next()) {//enquanto houver clientes\r\n ClientesVO tmpCliente = new ClientesVO();\r\n\r\n tmpCliente.setIdCliente(rsClientes.getInt(\"id_cliente\"));\r\n tmpCliente.setCodigo(rsClientes.getInt(\"cod_cliente\"));\r\n tmpCliente.setNome(rsClientes.getString(\"nome_cliente\"));\r\n tmpCliente.setCidade(rsClientes.getString(\"cid_cliente\"));\r\n tmpCliente.setTelefone(rsClientes.getString(\"tel_cliente\"));\r\n\r\n vetorClientes.add(tmpCliente);\r\n\r\n }\r\n\r\n } catch (Exception erro) {\r\n throw new Exception(\"Falha na listagem de dados. Verifique a sintaxe da instruçao SQL\\nErro Original:\" + erro.getMessage());\r\n }\r\n\r\n try {\r\n ConexaoDAO.fechaConexao();\r\n } catch (Exception erro) {\r\n throw new Exception(erro.getMessage());\r\n }\r\n\r\n return vetorClientes;\r\n }", "public BCliente obtenerCliente(int codigo)throws SQLException{\r\n\t\tICliente daoCliente = new DCliente();\r\n\t\treturn daoCliente.obtenerCliente(codigo);\r\n\t}", "public void ObtenerCliente(Connection conn, VOCliente voCli){\n\t\tString sqlBuscarCli=consultas.BuscarCliente();\r\n\t\ttry {\r\n\t\t\tPreparedStatement pstmt=conn.prepareStatement(sqlBuscarCli);\r\n\t\t\tpstmt.setString(1, voCli.getsNroCli());\r\n\t\t\tpstmt.setInt(2, voCli.getiIdCli());\r\n\t\t\tResultSet rs=pstmt.executeQuery();\r\n\t\t\t\r\n\t\t\tif(rs.next()){\r\n\t\t\t\tvoCli.setiIdDepto(rs.getInt(\"idDepto\"));\r\n\t\t\t\tvoCli.setiHrCargables(rs.getInt(\"hsCargables\"));\r\n\t\t\t\tvoCli.setiHonorarios(rs.getInt(\"honorarios\"));\r\n\t\t\t\tvoCli.setiMoneda(rs.getInt(\"moneda\"));\r\n\t\t\t\tvoCli.setsRut(rs.getString(\"rut\"));\r\n\t\t\t\tvoCli.setsNroCli(rs.getString(\"nroCli\"));\r\n\t\t\t\tvoCli.setsTel(rs.getString(\"tel\"));\r\n\t\t\t\tvoCli.setsDireccion(rs.getString(\"direccion\"));\r\n\t\t\t\tvoCli.setsNomCli(rs.getString(\"nomCli\"));\r\n\t\t\t}\r\n\t\t\trs.close(); pstmt.close();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "public List<Cliente> getClientes() {\n List<Cliente> cli = new ArrayList<>();\n\n try {\n BufferedReader br = new BufferedReader(new FileReader(\"src/Archivo/archivo.txt\"));\n String record;\n\n while ((record = br.readLine()) != null) {\n\n StringTokenizer st = new StringTokenizer(record, \",\");\n \n String id = st.nextToken();\n String nombreCliente = st.nextToken();\n String nombreEmpresa = st.nextToken();\n String ciudad = st.nextToken();\n String deuda = st.nextToken();\n String precioVentaSaco = st.nextToken();\n\n Cliente cliente = new Cliente(\n Integer.parseInt(id),\n nombreCliente,\n nombreEmpresa,\n ciudad,\n Float.parseFloat(deuda),\n Float.parseFloat(precioVentaSaco)\n );\n\n cli.add(cliente);\n }\n\n br.close();\n } catch (Exception e) {\n System.err.println(e);\n }\n\n return cli;\n }", "public DTOCliente obtenerCliente(DTOOID oid) throws MareException {\n UtilidadesLog.info(\" DAOMAEMaestroClientes.obtenerCliente(DTOOID): Entrada\");\n\n Boolean bUsaGEOREFERENCIADOR = Boolean.FALSE;\n MONMantenimientoSEG mms;\n DTOCliente dtosalida = new DTOCliente();\n BelcorpService bs = UtilidadesEJB.getBelcorpService();\n RecordSet resultado = new RecordSet();\n RecordSet rTipoSubtipo = null;\n RecordSet rIdentificacion = null;\n RecordSet rClienteMarca = null;\n RecordSet rClasificacion = null;\n RecordSet rVinculo = null;\n RecordSet rPreferencias = null;\n RecordSet rObservacion = null;\n RecordSet rComunicaciones = null;\n RecordSet rTarjetas = null;\n RecordSet rProblemaSolucion = null;\n RecordSet rPsicografia = null;\n StringBuffer query = new StringBuffer();\n \n\n try {\n\n DTOCrearClienteBasico dto = new DTOCrearClienteBasico();\n \n query.append(\" SELECT oid_clie_tipo_subt, vtipo.val_i18n, vsubtipo.val_i18n, \");\n query.append(\" ticl_oid_tipo_clie, sbti_oid_subt_clie, ind_ppal \");\n query.append(\" FROM mae_clien_tipo_subti t, \");\n query.append(\" v_gen_i18n_sicc vtipo, \");\n query.append(\" v_gen_i18n_sicc vsubtipo \");\n query.append(\" WHERE t.clie_oid_clie = \" + oid.getOid());\n query.append(\" AND vtipo.attr_enti = 'MAE_TIPO_CLIEN' \");\n query.append(\" AND vtipo.idio_oid_idio = \" + oid.getOidIdioma());\n query.append(\" AND vtipo.attr_num_atri = 1 \");\n query.append(\" AND vtipo.val_oid = t.ticl_oid_tipo_clie \");\n query.append(\" AND vsubtipo.attr_enti = 'MAE_SUBTI_CLIEN' \");\n query.append(\" AND vsubtipo.idio_oid_idio = \" + oid.getOidIdioma());\n query.append(\" AND vsubtipo.attr_num_atri = 1 \");\n query.append(\" AND vsubtipo.val_oid = t.sbti_oid_subt_clie \");\n query.append(\" ORDER BY t.ind_ppal DESC \");\n rTipoSubtipo = bs.dbService.executeStaticQuery(query.toString());\n\n dto.setRTipoSubtipoCliente(rTipoSubtipo);\n\n //DTOIdentificacion[]\n query = new StringBuffer();\n\n query.append(\" SELECT oid_clie_iden, tdoc_oid_tipo_docu, \");\n query.append(\" num_docu_iden, num_docu_iden, \");\n query.append(\" decode (val_iden_docu_prin, 1, 'S', 'N'), val_iden_pers_empr \");\n query.append(\" FROM mae_clien_ident i \");\n query.append(\" WHERE i.clie_oid_clie = \" + oid.getOid()); \n\n rIdentificacion = bs.dbService.executeStaticQuery(query.toString());\n\n dto.setRIdentificacionCliente(rIdentificacion);\n\n query = new StringBuffer();\n query.append(\" select COD_CLIE, COD_DIGI_CTRL, VAL_APE1, VAL_APE2, VAL_APEL_CASA, VAL_NOM1, \");\n query.append(\" VAL_NOM2, VAL_TRAT, COD_SEXO, FEC_INGR, FOPA_OID_FORM_PAGO \");\n query.append(\" from MAE_CLIEN \");\n query.append(\" where OID_CLIE = \" + oid.getOid() + \" \");\n resultado = bs.dbService.executeStaticQuery(query.toString());\n\n if (resultado.getRowCount() > 0) {\n dto.setCodigoCliente((String) resultado.getValueAt(0, 0));\n dto.setDigitoControl((String) resultado.getValueAt(0, 1));\n dto.setApellido1((String) resultado.getValueAt(0, 2));\n dto.setApellido2((String) resultado.getValueAt(0, 3));\n dto.setApellidoCasada((String) resultado.getValueAt(0, 4));\n dto.setNombre1((String) resultado.getValueAt(0, 5));\n dto.setNombre2((String) resultado.getValueAt(0, 6));\n dto.setTratamiento((String) resultado.getValueAt(0, 7));\n dto.setSexo((String) resultado.getValueAt(0, 8));\n dto.setFechaIngreso((Date) resultado.getValueAt(0, 9));\n\n BigDecimal formPago = (BigDecimal) resultado.getValueAt(0, 10);\n\n if (formPago != null) {\n dto.setFormaPago(new Long(formPago.longValue()));\n }\n }\n\n //DTOClienteMarca[]\n query = new StringBuffer();\n query.append(\" select OID_CLIE_MARC, MARC_OID_MARC, IND_PPAL \");\n query.append(\" from MAE_CLIEN_MARCA \");\n query.append(\" where CLIE_OID_CLIE = \" + oid.getOid() + \" \");\n /* rClienteMarca = bs.dbService.executeStaticQuery(query.toString()); */\n resultado = bs.dbService.executeStaticQuery(query.toString()); \n\n DTOClienteMarca[] dtots2 = new DTOClienteMarca[resultado.getRowCount()];\n DTOClienteMarca dtos2;\n\n for (int i = 0; i < resultado.getRowCount(); i++) {\n dtos2 = new DTOClienteMarca();\n dtos2.setOid(new Long(((BigDecimal) resultado.getValueAt(i, 0)).longValue()));\n dtos2.setMarca(new Long(((BigDecimal) resultado.getValueAt(i, 1)).longValue()));\n dtos2.setPrincipal((((BigDecimal) resultado.getValueAt(i, 2)).toString()).equals(\"1\") ? Boolean.TRUE : Boolean.FALSE);\n dtots2[i] = dtos2;\n }\n\n dto.setMarcas(dtots2);\n /* dto.setRClienteMarca(rClienteMarca); */\n \n\n //DTOClasificacionCliente[]\n query = new StringBuffer();\n\n query.append(\" SELECT c.oid_clie_clas, marca.des_marc, v3.val_i18n, v1.val_i18n, \");\n query.append(\" v2.val_i18n, v4.val_i18n, v5.val_i18n, p.marc_oid_marc, \");\n query.append(\" p.cana_oid_cana, ticl_oid_tipo_clie, t.sbti_oid_subt_clie, \");\n query.append(\" c.tccl_oid_tipo_clasi, c.clas_oid_clas, c.ind_ppal \");\n query.append(\" FROM mae_clien_clasi c, \");\n query.append(\" cra_perio p, \");\n query.append(\" mae_clien_tipo_subti t, \");\n query.append(\" v_gen_i18n_sicc v1, \");\n query.append(\" v_gen_i18n_sicc v2, \");\n query.append(\" seg_marca marca, \");\n query.append(\" v_gen_i18n_sicc v3, \");\n query.append(\" v_gen_i18n_sicc v4, \");\n query.append(\" v_gen_i18n_sicc v5 \");\n query.append(\" WHERE c.perd_oid_peri = p.oid_peri \");\n query.append(\" AND t.oid_clie_tipo_subt = c.ctsu_oid_clie_tipo_subt \");\n query.append(\" AND t.clie_oid_clie = \" + oid.getOid().toString());\n query.append(\" AND t.ticl_oid_tipo_clie = v1.val_oid \");\n query.append(\" AND p.marc_oid_marc = marca.oid_marc \");\n query.append(\" AND p.cana_oid_cana = v3.val_oid \");\n query.append(\" AND v3.attr_num_atri = 1 \");\n query.append(\" AND v3.idio_oid_idio = \" + oid.getOidIdioma().toString());\n query.append(\" AND v3.attr_enti = 'SEG_CANAL' \");\n query.append(\" AND t.ticl_oid_tipo_clie = v1.val_oid \");\n query.append(\" AND v1.attr_num_atri = 1 \");\n query.append(\" AND v1.idio_oid_idio = \" + oid.getOidIdioma().toString());\n query.append(\" AND v1.attr_enti = 'MAE_TIPO_CLIEN' \");\n query.append(\" AND t.sbti_oid_subt_clie = v2.val_oid \");\n query.append(\" AND v2.attr_num_atri = 1 \");\n query.append(\" AND v2.idio_oid_idio = \" + oid.getOidIdioma().toString());\n query.append(\" AND v2.attr_enti = 'MAE_SUBTI_CLIEN' \");\n query.append(\" AND c.tccl_oid_tipo_clasi = v4.val_oid \");\n query.append(\" AND v4.attr_num_atri = 1 \");\n query.append(\" AND v4.idio_oid_idio = \" + oid.getOidIdioma().toString());\n query.append(\" AND v4.attr_enti = 'MAE_TIPO_CLASI_CLIEN' \");\n query.append(\" AND c.clas_oid_clas = v5.val_oid \");\n query.append(\" AND v5.attr_num_atri = 1 \");\n query.append(\" AND v5.idio_oid_idio = \" + oid.getOidIdioma().toString());\n query.append(\" AND v5.attr_enti = 'MAE_CLASI' \");\n query.append(\" ORDER BY c.ind_ppal DESC \");\n\n /* rClasificacion = bs.dbService.executeStaticQuery(query.toString());*/\n resultado = bs.dbService.executeStaticQuery(query.toString());\n int cantClasi = resultado.getRowCount();\n UtilidadesLog.debug(\"cantidad de Clasificaciones_\" + cantClasi);\n DTOClasificacionCliente[] dtots3 = new DTOClasificacionCliente[0];\n DTOClasificacionCliente dtos3;\n \n if (!resultado.esVacio()) {\n dtots3 = new DTOClasificacionCliente[cantClasi];\n for (int i = 0; i < cantClasi; i++) {\n dtos3 = new DTOClasificacionCliente();\n dtos3.setOid(new Long(((BigDecimal) resultado.getValueAt(i, 0)).longValue()));\n dtos3.setMarcaDesc((String) resultado.getValueAt(i, 1));\n dtos3.setCanalDesc((String) resultado.getValueAt(i, 2));\n dtos3.setTipoDesc((String) resultado.getValueAt(i, 3));\n dtos3.setSubtipoDesc((String) resultado.getValueAt(i, 4));\n dtos3.setTipoClasificacionDesc((String) resultado.getValueAt(i, 5));\n dtos3.setClasificacionDesc((String) resultado.getValueAt(i, 6));\n\n dtos3.setMarca(new Long(((BigDecimal) resultado.getValueAt(i, 7)).longValue()));\n dtos3.setCanal(new Long(((BigDecimal) resultado.getValueAt(i, 8)).longValue()));\n dtos3.setTipo(new Long(((BigDecimal) resultado.getValueAt(i, 9)).longValue()));\n dtos3.setSubtipo(new Long(((BigDecimal) resultado.getValueAt(i, 10)).longValue()));\n dtos3.setTipoClasificacion(new Long(((BigDecimal) resultado.getValueAt(i, 11)).longValue()));\n dtos3.setClasificacion(new Long(((BigDecimal) resultado.getValueAt(i, 12)).longValue()));\n dtos3.setPrincipal((((BigDecimal) resultado.getValueAt(i, 13)).toString()).equals(\"1\") ? Boolean.TRUE : Boolean.FALSE);\n dtots3[i] = dtos3;\n }\n } else {\n UtilidadesLog.debug(\"sin clasificaciones\");\n // BELC300023061 - 04/07/2006\n // Si no se obtuvo ninguna clasificacion para el cliente en la consulta anterior, \n // insertar una fila en el atributo clasificaciones, con el indicador principal activo, \n // sólo con la marca y el canal\n query = new StringBuffer();\n \n query.append(\" SELECT null OID_CLIE_CLAS, mar.DES_MARC, iCa.VAL_I18N, \");\n query.append(\" null VAL_I18N, null VAL_I18N, null VAL_I18N, null VAL_I18N,\t\");\n query.append(\" per.MARC_OID_MARC, per.CANA_OID_CANA, \");\n query.append(\" null TICL_OID_TIPO_CLIE, null SBTI_OID_SUBT_CLIE, null TCCL_OID_TIPO_CLASI, null CLAS_OID_CLAS, null IND_PPAL \");\n query.append(\" FROM MAE_CLIEN_UNIDA_ADMIN uA, \");\n query.append(\" CRA_PERIO per, \t\");\n query.append(\" SEG_MARCA mar, \");\n query.append(\" V_GEN_I18N_SICC iCa \");\n query.append(\" WHERE uA.CLIE_OID_CLIE = \" + oid.getOid().toString());\n query.append(\" AND uA.IND_ACTI = 1 \");\n query.append(\" AND uA.PERD_OID_PERI_INI = per.OID_PERI \");\n query.append(\" AND per.MARC_OID_MARC = mar.OID_MARC \");\n query.append(\" AND per.CANA_OID_CANA = iCa.VAL_OID \");\n query.append(\" AND iCa.ATTR_NUM_ATRI = 1 \");\n query.append(\" AND iCa.ATTR_ENTI = 'SEG_CANAL' \");\n query.append(\" AND iCa.IDIO_OID_IDIO = \" + oid.getOidIdioma().toString());\n query.append(\" ORDER BY uA.OID_CLIE_UNID_ADMI ASC \");\n\n resultado = bs.dbService.executeStaticQuery(query.toString());\n \n if (!resultado.esVacio()) {\n dtos3 = new DTOClasificacionCliente();\n dtos3.setMarcaDesc((String) resultado.getValueAt(0, 1));\n dtos3.setCanalDesc((String) resultado.getValueAt(0, 2));\n dtos3.setMarca(new Long(((BigDecimal) resultado.getValueAt(0, 7)).longValue()));\n dtos3.setCanal(new Long(((BigDecimal) resultado.getValueAt(0, 8)).longValue()));\n dtos3.setPrincipal(Boolean.TRUE);\n \n dtots3 = new DTOClasificacionCliente[1];\n dtots3[0] = dtos3; \n }\n }\n \n dto.setClasificaciones(dtots3);\n \n /*dto.setRClasificacionCliente(rClasificacion);*/\n\n MONMantenimientoSEGHome mmsHome = SEGEjbLocators.getMONMantenimientoSEGHome();\n mms = mmsHome.create();\n bUsaGEOREFERENCIADOR = mms.usaGeoreferenciador(oid.getOidPais());\n dto.setUsaGeoreferenciador(bUsaGEOREFERENCIADOR);\n\n dtosalida.setBase(dto);\n\n //criterioBusqueda 1 y 2 queda a null\n dtosalida.setCriterioBusqueda1(null);\n dtosalida.setCriterioBusqueda2(null);\n\n //oid: dto.oid \n dtosalida.setOid(oid.getOid());\n\n //-fechaNacimiento, codigoEmpleado, nacionalidad, estadoCivil, \n //ocupacion, profesion, centroTrabajo, cargo, nivelEstudios, centroEstudios, \n //numeroHijos, personasDependientes, NSEP, cicloVida, deseaCorrespondencia, \n //cicloVida, deseaCorrespondencia, importeIngresos \n query = new StringBuffer();\n query.append(\" select FEC_NACI, COD_EMPL, IND_ACTI,SNON_OID_NACI, ESCV_OID_ESTA_CIVI, VAL_OCUP, VAL_PROF, \");\n query.append(\" VAL_CENT_TRAB, VAL_CARG_DESE, NIED_OID_NIVE_ESTU, VAL_CENT_ESTU, \");\n query.append(\" NUM_HIJO, NUM_PERS_DEPE, NSEP_OID_NSEP, TCLV_OID_CICL_VIDA, IND_CORR, IMP_INGR_FAMI \");\n query.append(\" from MAE_CLIEN_DATOS_ADICI \");\n query.append(\" where CLIE_OID_CLIE = \" + oid.getOid() + \" \");\n resultado = bs.dbService.executeStaticQuery(query.toString());\n\n if (resultado.getRowCount() > 0) {\n dtosalida.setFechaNacimiento((Date) resultado.getValueAt(0, 0));\n dtosalida.setCodigoEmpleado((String) resultado.getValueAt(0, 1));\n //SICC-DMCO-MAE-GCC-006 - Cleal\n dtosalida.setIndicadorActivo((resultado.getValueAt(0, 2) != null) ? new Long(((BigDecimal) resultado.getValueAt(0, 2)).longValue()) : null);\n \n \n dtosalida.setNacionalidad((resultado.getValueAt(0, 3) != null) ? new Long(((BigDecimal) resultado.getValueAt(0, 3)).longValue()) : null);\n dtosalida.setEstadoCivil((resultado.getValueAt(0, 4) != null) ? new Long(((BigDecimal) resultado.getValueAt(0, 4)).longValue()) : null);\n \n dtosalida.setOcupacion((String) resultado.getValueAt(0, 5));\n\n dtosalida.setProfesion((String) resultado.getValueAt(0, 6));\n dtosalida.setCentroTrabajo((String) resultado.getValueAt(0, 7));\n dtosalida.setCargo((String) resultado.getValueAt(0, 8));\n dtosalida.setNivelEstudios((resultado.getValueAt(0, 9) != null) ? new Long(((BigDecimal) resultado.getValueAt(0, 9)).longValue()) : null);\n dtosalida.setCentroEstudios((String) resultado.getValueAt(0, 10));\n dtosalida.setNumeroHijos((resultado.getValueAt(0, 11) != null) ? new Byte(((BigDecimal) resultado.getValueAt(0, 11)).byteValue()) : null);\n dtosalida.setPersonasDependientes((resultado.getValueAt(0, 12) != null) ? new Byte(((BigDecimal) resultado.getValueAt(0, 12)).byteValue()) : null);\n dtosalida.setNSEP((resultado.getValueAt(0, 13) != null) ? new Long(((BigDecimal) resultado.getValueAt(0, 13)).longValue()) : null);\n dtosalida.setCicloVida((resultado.getValueAt(0, 14) != null) ? new Long(((BigDecimal) resultado.getValueAt(0, 14)).longValue()) : null);\n\n BigDecimal corres = (BigDecimal) resultado.getValueAt(0, 15);\n Boolean correspondencia = null;\n\n if (corres != null) {\n if (corres.toString().equals(\"1\")) {\n correspondencia = Boolean.TRUE;\n } else {\n correspondencia = Boolean.FALSE;\n }\n }\n\n dtosalida.setDeseaCorrespondencia(correspondencia);\n dtosalida.setImporteIngresos((resultado.getValueAt(0, 16) != null) ? new Double(((BigDecimal) resultado.getValueAt(0, 16)).doubleValue()) : null);\n \n }\n\n //DTOVinculo[]\n query = new StringBuffer();\n\n\n /* \n * Cambios a restriccion por xxx_vnte y vndo hechas por ssantana, \n * 07/04/2006, porque no tenian mucho sentido como estaban antes \n */ \n query.append(\" SELECT oid_clie_vinc, c.cod_clie, \");\n query.append(\" tivc_oid_tipo_vinc, fec_desd, fec_hast, \");\n query.append(\" ind_vinc_ppal \");\n query.append(\" FROM mae_clien_vincu, mae_tipo_vincu tv, seg_pais p, mae_clien c \");\n /*inicio modificado ciglesias 17/11/2006 incidencia 24377*/\n query.append(\" WHERE clie_oid_clie_vndo = \" + oid.getOid());\n query.append(\" AND mae_clien_vincu.tivc_oid_tipo_vinc = tv.oid_tipo_vinc \");\n query.append(\" AND mae_clien_vincu.clie_oid_clie_vnte = c.oid_clie \");\n /*fin modificado ciglesias 17/11/2006 incidencia 24377*/\n query.append(\" AND tv.pais_oid_pais = p.oid_pais \");\n query.append(\" ORDER BY ind_vinc_ppal DESC \");\n\n rVinculo = bs.dbService.executeStaticQuery(query.toString());\n\n\n \n dtosalida.setRVinculo(rVinculo);\n\n //DTOPreferencia[]\t\t\t\n query = new StringBuffer();\n query.append(\" select OID_CLIE_PREF, TIPF_OID_TIPO_PREF, DES_CLIE_PREF \");\n query.append(\" from MAE_CLIEN_PREFE \");\n query.append(\" where CLIE_OID_CLIE = \" + oid.getOid() + \" \");\n rPreferencias = bs.dbService.executeStaticQuery(query.toString());\n\n dtosalida.setRPreferencia(rPreferencias);\n\n //DTOObservacion[]\t\t\t\n query = new StringBuffer();\n query.append(\" select OID_OBSE, MARC_OID_MARC, NUM_OBSE, VAL_TEXT \");\n query.append(\" from MAE_CLIEN_OBSER \");\n query.append(\" where CLIE_OID_CLIE = \" + oid.getOid() + \" \");\n rObservacion = bs.dbService.executeStaticQuery(query.toString());\n\n dtosalida.setRObservaciones(rObservacion);\n\n //paisContactado, clienteContactado, oidClienteContactado, tipoClienteContactado, \n //tipoContacto, fechaPrimerContacto, fechaSiguienteContacto, fechaPrimerPedidoContacto\n query = new StringBuffer();\n\n // Nueva query by ssantana\n query.append(\" SELECT c.pais_oid_pais, c.cod_clie, t.clie_oid_clie, t.ticl_oid_tipo_clie, \");\n query.append(\" p.cod_tipo_cont, p.fec_cont, p.fec_sigu_cont, canal.oid_cana, \");\n query.append(\" marca.oid_marc, perio.oid_peri \");\n query.append(\" FROM mae_clien c, \");\n query.append(\" mae_clien_tipo_subti t, \");\n query.append(\" mae_clien_prime_conta p, \");\n query.append(\" seg_canal canal, \");\n query.append(\" seg_marca marca, \");\n query.append(\" cra_perio perio \");\n query.append(\" WHERE p.ctsu_clie_cont = t.oid_clie_tipo_subt \");\n query.append(\" AND t.clie_oid_clie = c.oid_clie \");\n query.append(\" AND p.clie_oid_clie = \" + oid.getOid().toString());\n \n // modif. - splatas - 25/10/2006 - DBLG700000168\n // query.append(\" AND t.ind_ppal = 1 \");\n \n query.append(\" AND p.cana_oid_cana = canal.oid_cana(+) \");\n query.append(\" AND p.marc_oid_marc = marca.oid_marc(+) \");\n query.append(\" AND p.perd_oid_peri = perio.oid_peri(+) \");\n\n resultado = bs.dbService.executeStaticQuery(query.toString());\n\n if (resultado.getRowCount() > 0) {\n BigDecimal buffer = null;\n dtosalida.setPaisContactado(new Long(((BigDecimal) resultado.getValueAt(0, 0)).longValue()));\n dtosalida.setClienteContactado((String) resultado.getValueAt(0, 1));\n dtosalida.setOidClienteContactado(new Long(((BigDecimal) resultado.getValueAt(0, 2)).longValue()));\n dtosalida.setTipoClienteContactado(new Long(((BigDecimal) resultado.getValueAt(0, 3)).longValue()));\n dtosalida.setTipoContacto((String) (resultado.getValueAt(0, 4)));\n dtosalida.setFechaPrimerContacto((Date) resultado.getValueAt(0, 5));\n dtosalida.setFechaSiguienteContacto((Date) resultado.getValueAt(0, 6));\n\n buffer = (BigDecimal) resultado.getValueAt(0, 7); // Canal Contacto\n\n if (buffer != null) {\n dtosalida.setCanalContacto(Long.valueOf(buffer.toString()));\n } else {\n dtosalida.setCanalContacto(null);\n }\n\n buffer = (BigDecimal) resultado.getValueAt(0, 8); // Marca Contacto\n\n if (buffer != null) {\n dtosalida.setMarcaContacto(new Long(buffer.longValue()));\n } else {\n dtosalida.setMarcaContacto(null);\n }\n\n buffer = (BigDecimal) resultado.getValueAt(0, 9); // Periodo Contacto\n\n if (buffer != null) {\n dtosalida.setPeriodoContacto(new Long(buffer.longValue()));\n } else {\n dtosalida.setPais(null);\n }\n }\n\n //tipoClienteContacto\n query = new StringBuffer();\n query.append(\" SELECT TICL_OID_TIPO_CLIE \");\n query.append(\" FROM MAE_CLIEN_TIPO_SUBTI \");\n query.append(\" WHERE CLIE_OID_CLIE = \" + oid.getOid() + \" \");\n query.append(\" AND IND_PPAL = 1 \");\n resultado = bs.dbService.executeStaticQuery(query.toString());\n\n if (resultado.getRowCount() > 0) {\n dtosalida.setTipoClienteContacto(new Long(((BigDecimal) resultado.getValueAt(0, 0)).longValue()));\n }\n\n // DTODirecciones\n resultado = new RecordSet();\n UtilidadesLog.debug(\" Direcciones \");\n /*\n query = new StringBuffer();\n query.append(\" SELECT dir.OID_CLIE_DIRE, dir.TIDC_OID_TIPO_DIRE, dir.TIVI_OID_TIPO_VIA, \");\n query.append(\" val.OID_VALO_ESTR_GEOP, dir.ZVIA_OID_VIA, dir.NUM_PPAL, dir.VAL_COD_POST, \");\n query.append(\" dir.VAL_OBSE, dir.IND_DIRE_PPAL, dir.VAL_NOMB_VIA, val.DES_GEOG \");\n query.append(\" FROM MAE_CLIEN_DIREC dir, ZON_VALOR_ESTRU_GEOPO val, ZON_TERRI terr \");\n query.append(\" WHERE dir.CLIE_OID_CLIE = \" + oid.getOid() + \" AND \");\n query.append(\" dir.TERR_OID_TERR = terr.OID_TERR AND \");\n query.append(\" terr.VEPO_OID_VALO_ESTR_GEOP = val.OID_VALO_ESTR_GEOP \");\n resultado = bs.dbService.executeStaticQuery(query.toString());\n UtilidadesLog.info(\"resulado Dir: \" + resultado.toString());\n */\n if(Boolean.FALSE.equals(bUsaGEOREFERENCIADOR)){\n UtilidadesLog.debug(\"*** No usa GEO\");\n resultado = obtieneDireccionSinGEOModificar(oid);\n } else{\n UtilidadesLog.debug(\"*** Usa GEO\");\n resultado = obtieneDireccionConGEOModificar(oid);\n }\n if (resultado.getRowCount() == 0) {\n dto.setDirecciones(null);\n } else {\n int cantFilas = resultado.getRowCount();\n DTODireccion[] arrayDirecciones = new DTODireccion[cantFilas];\n DTODireccion dir = null;\n\n for (int i = 0; i < cantFilas; i++) {\n dir = new DTODireccion();\n\n if (resultado.getValueAt(i, 0) == null) {\n dir.setOid(null);\n } else {\n dir.setOid(new Long(((BigDecimal) resultado.getValueAt(i, 0)).longValue()));\n }\n\n if (resultado.getValueAt(i, 1) == null) {\n dir.setTipoDireccion(null);\n } else {\n dir.setTipoDireccion(new Long(((BigDecimal) resultado.getValueAt(i, 1)).longValue()));\n }\n\n if (resultado.getValueAt(i, 2) == null) {\n dir.setTipoVia(null);\n } else {\n dir.setTipoVia(new Long(((BigDecimal) resultado.getValueAt(i, 2)).longValue()));\n }\n\n if (resultado.getValueAt(i, 3) == null) {\n dir.setUnidadGeografica(null);\n } else {\n dir.setUnidadGeografica(new Long(((BigDecimal) resultado.getValueAt(i, 3)).longValue()));\n }\n\n if (resultado.getValueAt(i, 4) == null) {\n dir.setVia(null);\n } else {\n dir.setVia(new Long(((BigDecimal) resultado.getValueAt(i, 4)).longValue()));\n }\n\n if (resultado.getValueAt(i, 5) == null) {\n dir.setNumeroPrincipal(null);\n } else {\n /*\n * V-PED001 - dmorello, 06/10/2006\n * Cambio el tipo de numeroPrincipal de Integer a String\n */\n //dir.setNumeroPrincipal(new Integer(resultado.getValueAt(i, 5).toString()));\n dir.setNumeroPrincipal(resultado.getValueAt(i, 5).toString());\n }\n\n if (resultado.getValueAt(i, 6) == null) {\n dir.setCodigoPostal(null);\n } else {\n dir.setCodigoPostal(resultado.getValueAt(i, 6).toString());\n }\n\n if (resultado.getValueAt(i, 7) == null) {\n dir.setObservaciones(null);\n } else {\n dir.setObservaciones(resultado.getValueAt(i, 7).toString());\n }\n\n if (resultado.getValueAt(i, 8) == null) {\n dir.setEsDireccionPrincipal(null);\n } else {\n if (((BigDecimal) resultado.getValueAt(i, 8)).longValue() == 1) {\n dir.setEsDireccionPrincipal(new Boolean(true));\n } else {\n dir.setEsDireccionPrincipal(new Boolean(false));\n }\n }\n\n if (resultado.getValueAt(i, 9) == null) {\n dir.setNombreVia(null);\n } else {\n dir.setNombreVia(resultado.getValueAt(i, 9).toString());\n }\n\n if (resultado.getValueAt(i, 10) == null) {\n dir.setNombreUnidadGeografica(null);\n } else {\n dir.setNombreUnidadGeografica(resultado.getValueAt(i, 10).toString());\n }\n\n //UtilidadesLog.debug(\"bucle \" + i + \": \" + dir.toString());\n arrayDirecciones[i] = dir;\n }\n\n dto.setDirecciones(arrayDirecciones);\n }\n\n //DTOCliente\n //base: metemos el DTOCrearClienteBasico creado anteriormente \n dtosalida.setBase(dto);\n\n //DTOComunicacion[]\t\t\t\n query = new StringBuffer();\n /*query.append(\" SELECT OID_CLIE_COMU, TICM_OID_TIPO_COMU, VAL_DIA_COMU, VAL_TEXT_COMU, \");\n query.append(\" to_char(FEC_HORA_DESD, 'HH24:MI'), to_char(FEC_HORA_HAST, 'HH24:MI'), VAL_INTE_COMU, IND_COMU_PPAL \");\n query.append(\" FROM MAE_CLIEN_COMUN \");\n query.append(\" WHERE CLIE_OID_CLIE = \" + oid.getOid() + \" \");*/\n \n query.append(\" SELECT oid_clie_comu, ticm_oid_tipo_comu, val_dia_comu, val_text_comu, \");\n query.append(\" ind_comu_ppal, TO_CHAR (fec_hora_desd, 'HH24:MI'), \");\n query.append(\" TO_CHAR (fec_hora_hast, 'HH24:MI'), val_inte_comu \");\n query.append(\" FROM mae_clien_comun \");\n query.append(\" WHERE clie_oid_clie = \" + oid.getOid()); \n query.append(\" order by ind_comu_ppal desc \");\n rComunicaciones = bs.dbService.executeStaticQuery(query.toString());\n /*resultado = bs.dbService.executeStaticQuery(query.toString());\n\n DTOComunicacion[] dtots7 = new DTOComunicacion[resultado.getRowCount()];\n DTOComunicacion dtos7;\n\n for (int i = 0; i < resultado.getRowCount(); i++) {\n dtos7 = new DTOComunicacion();\n dtos7.setOid(new Long(((BigDecimal) resultado.getValueAt(i, 0)).longValue()));\n dtos7.setTipoComunicacion(new Long(((BigDecimal) resultado.getValueAt(i, 1)).longValue()));\n\n String diaComu = (String) resultado.getValueAt(i, 2);\n\n if ((diaComu != null) && !(diaComu.equals(\"\"))) {\n dtos7.setDiaComunicacion(new Character(diaComu.toCharArray()[0]));\n }\n\n dtos7.setTextoComunicacion((String) resultado.getValueAt(i, 3));\n\n String sHoraDesde = (String) resultado.getValueAt(i, 4);\n String sHoraHasta = (String) resultado.getValueAt(i, 5);\n\n UtilidadesLog.debug(\"HoraDesde: \" + sHoraDesde);\n UtilidadesLog.debug(\"HoraHasta: \" + sHoraHasta);\n\n SimpleDateFormat simpleDateHora = new SimpleDateFormat(\"HH:mm\");\n\n if ((sHoraDesde != null) && !sHoraDesde.equals(\"\")) {\n java.util.Date dateHoraDesde = simpleDateHora.parse(sHoraDesde);\n UtilidadesLog.debug(\"dateHoraDesde: \" + dateHoraDesde.toString());\n UtilidadesLog.debug(\"dateHoraDesde Long: \" + dateHoraDesde.getTime());\n\n Long longHoraDesde = new Long(dateHoraDesde.getTime());\n dtos7.setHoraDesde(longHoraDesde);\n }\n\n if ((sHoraHasta != null) && !sHoraHasta.equals(\"\")) {\n java.util.Date dateHoraHasta = simpleDateHora.parse(sHoraHasta);\n UtilidadesLog.debug(\"dateHoraHasta: \" + dateHoraHasta.toString());\n UtilidadesLog.debug(\"dateHoraHasta Long: \" + dateHoraHasta.getTime());\n\n Long longHoraHasta = new Long(dateHoraHasta.getTime());\n dtos7.setHoraHasta(longHoraHasta);\n }\n\n BigDecimal interva = (BigDecimal) resultado.getValueAt(i, 6);\n Boolean intervaloComuni = null;\n\n if (interva != null) {\n if (interva.toString().equals(\"1\")) {\n intervaloComuni = Boolean.TRUE;\n } else {\n intervaloComuni = Boolean.FALSE;\n }\n }\n\n dtos7.setIntervaloComunicacion(intervaloComuni);\n\n BigDecimal pric = (BigDecimal) resultado.getValueAt(i, 7);\n Boolean principal = null;\n\n if (pric != null) {\n if (pric.toString().equals(\"1\")) {\n principal = Boolean.TRUE;\n } else {\n principal = Boolean.FALSE;\n }\n }\n\n dtos7.setPrincipal(principal);\n dtots7[i] = dtos7;\n }\n \n dtosalida.setComunicaciones(dtots7); */\n dtosalida.setRComunicaciones(rComunicaciones);\n\n //DTOTarjeta[]\t\t\t\n query = new StringBuffer();\n query.append(\" SELECT OID_CLIE_TARJ, TITR_OID_TIPO_TARJ, CLTA_OID_CLAS_TARJ, CBAN_OID_BANC \");\n query.append(\" FROM MAE_CLIEN_TARJE \");\n query.append(\" WHERE CLIE_OID_CLIE = \" + oid.getOid() + \" \");\n /* rTarjetas = bs.dbService.executeStaticQuery(query.toString()); */\n\n resultado= bs.dbService.executeStaticQuery(query.toString());\n DTOTarjeta[] dtots8 = new DTOTarjeta[resultado.getRowCount()];\n DTOTarjeta dtos8;\n\n for (int i = 0; i < resultado.getRowCount(); i++) {\n dtos8 = new DTOTarjeta();\n dtos8.setOid(new Long(((BigDecimal) resultado.getValueAt(i, 0)).longValue()));\n dtos8.setTipo(new Long(((BigDecimal) resultado.getValueAt(i, 1)).longValue()));\n dtos8.setClase((resultado.getValueAt(i, 2) != null) ? new Long(((BigDecimal) resultado.getValueAt(i, 2)).longValue()) : null);\n dtos8.setBanco((resultado.getValueAt(i, 3) != null) ? new Long(((BigDecimal) resultado.getValueAt(i, 3)).longValue()) : null);\n dtots8[i] = dtos8;\n }\n\n dtosalida.setTarjetas(dtots8);\n /*dtosalida.setRTarjeta(rTarjetas);*/\n\n //DTOProblemaSolucion\n query = new StringBuffer();\n query.append(\" SELECT OID_CLIE_PROB, DES_PROB, IND_SOLU, \");\n query.append(\" VAL_NEGO_PROD, TIPB_OID_TIPO_PROB, DES_SOLU, TSOC_OID_TIPO_SOLU \");\n query.append(\" FROM MAE_CLIEN_PROBL \");\n query.append(\" WHERE CLIE_OID_CLIE = \" + oid.getOid() + \" \");\n\n /* rProblemaSolucion = bs.dbService.executeStaticQuery(query.toString()); */\n resultado = bs.dbService.executeStaticQuery(query.toString());\n\n DTOProblemaSolucion[] dtots9 = new DTOProblemaSolucion[resultado.getRowCount()];\n DTOProblemaSolucion dtos9;\n\n for (int i = 0; i < resultado.getRowCount(); i++) {\n dtos9 = new DTOProblemaSolucion();\n dtos9.setOid(new Long(((BigDecimal) resultado.getValueAt(i, 0)).longValue()));\n dtos9.setDescripcionProblema((String) resultado.getValueAt(i, 1));\n\n // dtos9.setSolucion(new Boolean((String) (resultado.getValueAt(i, 2))));\n if (resultado.getValueAt(i, 2) != null) {\n \n Long ind = null;\n ind = new Long(((BigDecimal) resultado.getValueAt(i, 2)).longValue());\n\n if (ind.intValue() == 1) {\n dtos9.setSolucion(new Boolean(true));\n } else {\n dtos9.setSolucion(new Boolean(false));\n }\n\n //Boolean valor = new Boolean( ((String)resultado.getValueAt(i, 2)).equals(\"1\") );\n }\n\n \n dtos9.setNegocio((String) resultado.getValueAt(i, 3));\n dtos9.setTipoProblema((resultado.getValueAt(i, 4) != null) ? new Long(((BigDecimal) resultado.getValueAt(i, 4)).longValue()) : null);\n dtos9.setDescripcionSolucion((String) resultado.getValueAt(i, 5));\n dtos9.setTipoSolucion((resultado.getValueAt(i, 6) != null) ? new Long(((BigDecimal) resultado.getValueAt(i, 6)).longValue()) : null);\n\n dtots9[i] = dtos9;\n }\n\n dtosalida.setProblemasSoluciones(dtots9);\n /* dtosalida.setRProblemaSolucion(rProblemaSolucion);*/\n\n //DTOPsicografia\n query = new StringBuffer();\n query.append(\" SELECT OID_PSIC, MARC_OID_MARC, TPOID_TIPO_PERF_PSIC, COD_TEST, FEC_PSIC \");\n query.append(\" FROM MAE_PSICO \");\n query.append(\" WHERE CLIE_OID_CLIE = \" + oid.getOid() + \" \");\n /* rPsicografia = bs.dbService.executeStaticQuery(query.toString());*/\n \n resultado = bs.dbService.executeStaticQuery(query.toString());\n DTOPsicografia[] dtots10 = new DTOPsicografia[resultado.getRowCount()];\n DTOPsicografia dtos10;\n\n for (int i = 0; i < resultado.getRowCount(); i++) {\n dtos10 = new DTOPsicografia();\n dtos10.setOid(new Long(((BigDecimal) resultado.getValueAt(i, 0)).longValue()));\n dtos10.setMarca(new Long(((BigDecimal) resultado.getValueAt(i, 1)).longValue()));\n dtos10.setTipoPerfil(new Long(((BigDecimal) resultado.getValueAt(i, 2)).longValue()));\n dtos10.setCodigoTest((String) (resultado.getValueAt(i, 3)));\n dtos10.setFecha((Date) (resultado.getValueAt(i, 4)));\n dtots10[i] = dtos10;\n }\n\n dtosalida.setPsicografias(dtots10);\n /* dtosalida.setRPsicografia(rPsicografia);*/\n } catch (CreateException re) {\n throw new MareException(re, UtilidadesError.armarCodigoError(CodigosError.ERROR_AL_LOCALIZAR_UN_COMPONENTE_EJB));\n } catch (RemoteException re) {\n throw new MareException(re, UtilidadesError.armarCodigoError(CodigosError.ERROR_AL_LOCALIZAR_UN_COMPONENTE_EJB));\n } catch (Exception e) {\n e.printStackTrace();\n throw new MareException(e, UtilidadesError.armarCodigoError(CodigosError.ERROR_DE_LECTURA_EN_BASE_DE_DATOS));\n }\n\n UtilidadesLog.debug(\"dtoSalida ObtenerCliente: \" + dtosalida);\n UtilidadesLog.info(\" DAOMAEMaestroClientes.obtenerCliente(DTOOID): Salida\");\n\n return dtosalida;\n }", "public TelaConsultaCliente() {\n initComponents();\n DefaultTableModel modelo = (DefaultTableModel) JtClientes.getModel();\n JtClientes.setRowSorter(new TableRowSorter(modelo));\n consultarJt();\n }", "public ArrayList<Cliente> listaDeClientes() {\n\t\t\t ArrayList<Cliente> misClientes = new ArrayList<Cliente>();\n\t\t\t Conexion conex= new Conexion();\n\t\t\t \n\t\t\t try {\n\t\t\t PreparedStatement consulta = conex.getConnection().prepareStatement(\"SELECT * FROM clientes\");\n\t\t\t ResultSet res = consulta.executeQuery();\n\t\t\t while(res.next()){\n\t\t\t \n\t\t\t int cedula_cliente = Integer.parseInt(res.getString(\"cedula_cliente\"));\n\t\t\t String nombre= res.getString(\"nombre_cliente\");\n\t\t\t String direccion = res.getString(\"direccion_cliente\");\n\t\t\t String email = res.getString(\"email_cliente\");\n\t\t\t String telefono = res.getString(\"telefono_cliente\");\n\t\t\t Cliente persona= new Cliente(cedula_cliente, nombre, direccion, email, telefono);\n\t\t\t misClientes.add(persona);\n\t\t\t }\n\t\t\t res.close();\n\t\t\t consulta.close();\n\t\t\t conex.desconectar();\n\t\t\t \n\t\t\t } catch (Exception e) {\n\t\t\t //JOptionPane.showMessageDialog(null, \"no se pudo consultar la Persona\\n\"+e);\n\t\t\t\t System.out.println(\"No se pudo consultar la persona\\n\"+e);\t\n\t\t\t }\n\t\t\t return misClientes; \n\t\t\t }", "public ArrayList<Cliente> listarClientes(){\n ArrayList<Cliente> ls = new ArrayList<Cliente>();\n try{\n\t\tString seleccion = \"SELECT codigo, nit, email, pais, fecharegistro, razonsocial, idioma, categoria FROM clientes\";\n\t\tPreparedStatement ps = con.prepareStatement(seleccion);\n //para marca un punto de referencia en la transacción para hacer un ROLLBACK parcial.\n\t\tResultSet rs = ps.executeQuery();\n\t\tcon.commit();\n\t\twhile(rs.next()){\n Cliente cl = new Cliente();\n cl.setCodigo(rs.getInt(\"codigo\"));\n cl.setNit(rs.getString(\"nit\"));\n cl.setRazonSocial(rs.getString(\"razonsocial\"));\n cl.setCategoria(rs.getString(\"categoria\"));\n cl.setEmail(rs.getString(\"email\"));\n Calendar cal = new GregorianCalendar();\n cal.setTime(rs.getDate(\"fecharegistro\")); \n cl.setFechaRegistro(cal.getTime());\n cl.setIdioma(rs.getString(\"idioma\"));\n cl.setPais(rs.getString(\"pais\"));\n\t\t\tls.add(cl);\n\t\t}\n }catch(Exception e){\n System.out.println(e.getMessage());\n e.printStackTrace();\n } \n return ls;\n\t}", "public Lista obtenerListaClientesAdicionales(int codigoCuenta)throws SQLException{\r\n\t\tLista listadoCliente=null;\r\n\t\tICuenta daoCliente = new DCuenta();\r\n\t\t\r\n\t\tlistadoCliente = daoCliente.obtenerListadoCuentaAdicional(codigoCuenta);\r\n\t\t\r\n\t\treturn listadoCliente;\r\n\t}", "public void createClient(int id, String nume, String prenume, int idPetShop) {\n\t\tif (petShopOperations.checkPetShop(idPetShop) == false)\n\t\t\tSystem.out.println(\"PetShop not found.\");\n\n\t\tClient clientToAdd = new Client(id, nume, prenume, idPetShop);\n\t\tSystem.out.println(\"Before adding...\");\n\t\tList<Client> list = clientOperations.getAllClienti();\n\t\tclientOperations.addClient(clientToAdd);\n\t\tSystem.out.println(\"After adding...\");\n\t\tclientOperations.printListOfClienti(list);\n\t}" ]
[ "0.7468838", "0.7233037", "0.7219738", "0.703807", "0.6988771", "0.6967463", "0.69118327", "0.68429184", "0.68141377", "0.68132114", "0.67816615", "0.6726239", "0.66951984", "0.66741884", "0.6642405", "0.6628796", "0.6587987", "0.6570494", "0.65676844", "0.6566158", "0.653971", "0.6536156", "0.6533966", "0.65264356", "0.6526212", "0.6525807", "0.6523617", "0.65139747", "0.64924586", "0.6485559", "0.6485149", "0.6483531", "0.6480607", "0.64727515", "0.64658314", "0.6462571", "0.64456624", "0.64348483", "0.6430354", "0.64182276", "0.64169097", "0.6409845", "0.64070606", "0.64022297", "0.63977414", "0.6373422", "0.6338903", "0.63389003", "0.63316494", "0.6329711", "0.63286865", "0.63285327", "0.63259405", "0.63252676", "0.6319773", "0.63097084", "0.6304015", "0.6300541", "0.62927943", "0.6292389", "0.6290701", "0.629068", "0.629048", "0.6285766", "0.6280357", "0.6277426", "0.62766236", "0.62693816", "0.62667876", "0.62631875", "0.6249403", "0.6242996", "0.62415344", "0.62317497", "0.62185824", "0.6216391", "0.62152046", "0.62033486", "0.61875296", "0.61820704", "0.6181889", "0.6168528", "0.61582696", "0.6157866", "0.61575395", "0.6147389", "0.6146442", "0.614345", "0.6140253", "0.61340517", "0.6124013", "0.6122483", "0.61212724", "0.61116254", "0.6108325", "0.60895735", "0.6086365", "0.60835713", "0.6078679", "0.6077657", "0.60693294" ]
0.0
-1
Creates an IntentService. Invoked by your subclass's constructor.
public InitService(String name) { super("InitService"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MyIntentService() {\n super(\"MyIntentServiceName\");\n }", "public MyIntentService() {\n super(\"MyIntentService\");\n }", "public MyIntentService() {\n super(\"\");\n }", "public MyIntentService() {\n super(MyIntentService.class.getName());\n }", "public MyIntentService(String name){\n super(name);\n }", "public HelloIntentService() {\n super(\"HelloIntentService\");\n }", "public MyIntentService() {\n //调用父类的构造函数\n //参数 = 工作线程的名字\n super(\"myIntentService\");\n }", "public RegistrationIntentService() {\n super(TAG);\n }", "public IntentStartService(String name) {\n super(name);\n }", "public MessageIntentService(String name) {\n super(name);\n }", "public GCMIntentService() {\n super(\"GCMIntentService\");\n\n }", "private void initService() {\n connection = new AppServiceConnection();\n Intent i = new Intent(this, AppService.class);\n boolean ret = bindService(i, connection, Context.BIND_AUTO_CREATE);\n Log.d(TAG, \"initService() bound with \" + ret);\n }", "@Override\r\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\",\r\n Process.THREAD_PRIORITY_BACKGROUND);\r\n thread.start();\r\n\r\n // Get the HandlerThread's Looper and use it for our Handler\r\n mServiceLooper = thread.getLooper();\r\n mServiceHandler = new ServiceHandler(mServiceLooper);\r\n }", "public FetchAddressIntentService() {\n super(\"FetchAddressIntentService\");\n }", "public StockWidgetIntentService() {\n super(\"StockWidgetIntentService\");\n }", "@Override\r\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\",\r\n 10);\r\n thread.start();\r\n\r\n // Get the HandlerThread's Looper and use it for our Handler\r\n serviceLooper = thread.getLooper();\r\n serviceHandler = new ServiceHandler(serviceLooper);\r\n }", "@Override\n\tpublic void onCreate() {\n\t\t\n\t\tHandlerThread thread = new HandlerThread(\"ServiceStartArguments\",\n\t\t\t\tProcess.THREAD_PRIORITY_BACKGROUND);\n\t\tthread.start();\n\t\t// Get the HandlerThread's Looper and use it for our Handler\n\t\tmServiceLooper = thread.getLooper();\n\t\tmServiceHandler = new ServiceHandler(mServiceLooper);\n\t}", "@Override\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\", Process.THREAD_PRIORITY_BACKGROUND);\n thread.start();\n\n //Get the HandlerThread's Looper and use it for ur Handler\n mServiceLooper = thread.getLooper();\n mServiceHandler = new ServiceHandler(mServiceLooper);\n }", "@Override\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\");\n thread.start();\n\n // Get the HandlerThread's Looper and use it for our Handler\n mLooper = thread.getLooper();\n mServiceHandle = new ServiceHandle(mLooper);\n }", "public AlarmService(String name) {\n super(name);\n }", "@Override\n\tpublic void onCreate() {\n\t\tLog.i(TAG, \"service on create\");\n\t\tsuper.onCreate();\n\t}", "@Override\n public void onClick(View v) {\n startService(new Intent(MainActivity.this, MyService.class));\n }", "@Override\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\", THREAD_PRIORITY_BACKGROUND);\n thread.start();\n Log.d(\"LOG19\", \"DiscoveryService onCreate\");\n\n this.mLocalBroadCastManager = LocalBroadcastManager.getInstance(this);\n // Get the HandlerThread's Looper and use it for our Handler\n mServiceLooper = thread.getLooper();\n\n mServiceHandler = new ServiceHandler(mServiceLooper);\n }", "public LoadIntentService(String name) {\n super(name);\n }", "public GroundyIntentService(String name) {\n super();\n mName = name;\n mAsyncLoopers = new ArrayList<Looper>();\n }", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tIntent i = new Intent(this, M_Service.class);\n\t\tbindService(i, mServiceConn, Context.BIND_AUTO_CREATE);\n\t}", "public Service(){\n\t\t\n\t}", "public void startService() {\r\n Log.d(LOG, \"in startService\");\r\n startService(new Intent(getBaseContext(), EventListenerService.class));\r\n startService(new Intent(getBaseContext(), ActionService.class));\r\n getListenerService();\r\n\r\n }", "public void onCreate() {\n super.onCreate();\n // An Android handler thread internally operates on a looper.\n mHandlerThread = new HandlerThread(\"HandlerThreadService.HandlerThread\", Process.THREAD_PRIORITY_BACKGROUND);\n mHandlerThread.start();\n // An Android service handler is a handler running on a specific background thread.\n mServiceHandler = new ServiceHandler(mHandlerThread.getLooper());\n\n // Get access to local broadcast manager\n mLocalBroadcastManager = LocalBroadcastManager.getInstance(this);\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tLog.e(\"androidtalk\", \"service created\") ;\n\t\tSystem.out.println(\"androidtalk-service created\") ;\n\t\t\n\t}", "public CallService() {\n super(\"My\");\n }", "protected void startService() {\n\t\t//if (!isServiceRunning(Constants.SERVICE_CLASS_NAME))\n\t\tthis.startService(new Intent(this, LottoService.class));\n\t}", "public void createServiceRequest() {\n getMainActivity().startService(new Intent(getMainActivity(), RequestService.class));\n }", "protected void startIntentService() {\n Intent intent = new Intent(this.getActivity(), FetchAddressIntentService.class);\n intent.putExtra(Constants.RECEIVER, mResultReceiver);\n intent.putExtra(Constants.LOCATION_DATA_EXTRA, mLastLocation);\n this.getActivity().startService(intent);\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\t\n\t\tIntent odmIntent = new Intent(this, OdmService.class);\n this.startService(odmIntent); \n\t\tmHandler.post(mStartRunnable);\n\t}", "@Override\r\n public void onStart(Intent intent, int startId) {\n }", "private void initService() {\n \tlog_d( \"initService()\" );\n\t\t// no action if debug\n if ( BT_DEBUG_SERVICE ) return;\n // Initialize the BluetoothChatService to perform bluetooth connections\n if ( mBluetoothService == null ) {\n log_d( \"new BluetoothService\" );\n \t\tmBluetoothService = new BluetoothService( mContext );\n\t }\n\t\tif ( mBluetoothService != null ) {\n log_d( \"set Handler\" );\n \t\tmBluetoothService.setHandler( sendHandler );\n\t }\t\t\n }", "public ReceiveTransitionsIntentService() {\n super(\"ReceiveTransitionsIntentService\");\n }", "@Override\r\n public void onCreate() {\r\n Log.d(TAG, \"on service create\");\r\n }", "public StartedService() {\n super(\"StartedService\");\n }", "private Service() {}", "public UploadReportIntentService() {\n super(TAG);\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.intentdemo);\n\t\tfinal Button button = (Button)findViewById(R.id.btnStart);\n\t\tbutton.setOnClickListener(new OnClickListener()\n\t\t{\n\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tbIsStart = !bIsStart;\n\t\t\t\tif(bIsStart)\n\t\t\t\t{\n\t\t\t\t\tstartMyService();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(service!=null)\n\t\t\t\t\t{\n\t\t\t\t\t\t stopService(intentMyService);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t);\n\t}", "@Override\n public void onStart(Intent intent, int startid) {\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n context.startService(new Intent(context, MyService.class));\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\n\t\tcontext = this;\n\t\tstartService();\n\t}", "private void registerService(Context context) {\r\n Intent intent = new Intent(context, CustomIntentService.class);\r\n\r\n /*\r\n * Step 2: We pass the handler via the intent to the intent service\r\n * */\r\n handler = new CustomHandler(new AppReceiver() {\r\n @Override\r\n public void onReceiveResult(Message message) {\r\n /*\r\n * Step 3: Handle the results from the intent service here!\r\n * */\r\n switch (message.what) {\r\n //TODO\r\n }\r\n }\r\n });\r\n intent.putExtra(\"handler\", new Messenger(handler));\r\n context.startService(intent);\r\n }", "@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n Log.d(TAG, \"Service started\");\n\n self = this;\n\n return super.onStartCommand(intent, flags, startId);\n }", "@Override\n\tpublic void onStart(Intent intent, int startId) {\n\t\tnew RunnableService(new runCallBack(){\n\n\t\t\t@Override\n\t\t\tpublic void start() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tinitResource();\n\t\t\t\t//获取通讯录信息\n\t\t\t\tinitContactsData();\n\t\t\t\t//同步通讯录\n\t\t\t\tupLoadPhones();\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void end() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}, true);\n\t\n\t\t\n\t\tsuper.onStart(intent, startId);\n\t}", "@Override\n\tprotected void onCreate (Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tAndroidApplicationConfiguration config = new AndroidApplicationConfiguration();\n\t\tinitialize(new MainClass(), config);\n\t\tstartService(new Intent(getBaseContext(),MyServices.class));\n\t}", "@Override\n public void onCreate() {\n Log.d(\"ServiceTest\", \"Service created!\");\n workoutID = -1;\n\n }", "public InitService() {\n super(\"InitService\");\n }", "public NotificationReceiverService() {\n }", "@Override\n\tpublic int onStartCommand( Intent intent, int flags, int startId )\n\t{\n\t\tsuper.onStartCommand( intent, flags, startId );\n\n\t\tString action = null;\n\t\tif( intent != null )\n\t\t\taction = intent.getAction();\n\n\t\t\tLog.i(LOG_TAG,\"Received action of \" + action );\n\n\t\tif( action == null )\n\t\t{\n\t\t\tLog.w(LOG_TAG,\"Starting service with no action\\n Probably from a crash, \"\n\t\t\t\t\t+ \"or service had to restart\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tswitch (action)\n\t\t\t{\n\t\t\t\tcase ACTION_START:\n\t\t\t\t\tLog.i(LOG_TAG, \"Received ACTION_START\");\n\t\t\t\t\tstart();\n\t\t\t\t\tbreak;\n\t\t\t\tcase ACTION_STOP:\n\t\t\t\t\tLog.i(LOG_TAG, \"Received ACTION_STOP\");\n\t\t\t\t\tstop();\n\t\t\t\t\tbreak;\n\t\t\t} // switch\n\n\t\t} // if...else\n\n\t\t//return START_REDELIVER_INTENT; // Mqtt version\n\t\treturn START_STICKY; // Notification version - Run until explicitly stopped.\n\n\t}", "public ServiceTask() {\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tmContext = this;\n\t\tLogUtils.i(\"tr069Service onCreate is in >>>>>\");\n\t\tLogUtils.writeSystemLog(\"tr069Service\", \"onCreate\", \"tr069\");\n\t\tinitService();\n\t\tinitData();\n\t\tregisterReceiver();\n\t\t\t\t\n\t\tif(JNILOAD){\n\t\t\tTr069ServiceInit();\n\t\t}\n\t}", "public BroadcastService(String name) {\n super(name);\n }", "@Override\n\tpublic void onCreate() {\n\t\tLog.d(\"MyService\", \"OnCreat() get called\");\n\t\t\n\t\tIntent intent = new Intent(this, MainActivity.class);\n\t\tPendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);\n\t\t\n\t\tNotification.Builder builder = new Notification.Builder(this);\n\t\tbuilder.setSmallIcon(R.drawable.ic_launcher);\n\t\tbuilder.setTicker(\"This is ticker text\");\n\t\tbuilder.setContentTitle(\"This is notification title\");\n\t\tbuilder.setContentText(\"This is content body\");\n\t\tbuilder.setContentIntent(pendingIntent);\n\t\tbuilder.setAutoCancel(true);\n\t\tbuilder.setOngoing(false);\n\t\tbuilder.setSubText(\"This is subtext\");\n\t\tbuilder.setNumber(100);\n\t\tbuilder.setWhen(SystemClock.currentThreadTimeMillis());\n\t\tNotification notification = builder.build();\n\t\tstartForeground(1, notification);\n\t\tsuper.onCreate();\n\t}", "Service newService();", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.test_service_activity);\n\n\t\tIntent intent = new Intent(\n\t\t\t\t\"com.demo.androidontheway.testservice.MSG_ACTION\");\n\t\tbindService(intent, conn, Context.BIND_AUTO_CREATE);\n\n\t\tmProgressBar = (ProgressBar) findViewById(R.id.pro_service);\n\t\tButton mButton = (Button) findViewById(R.id.btn_start_service);\n\t\tmButton.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// start download at service\n\t\t\t\tmsgService.startDownLoad();\n\t\t\t}\n\t\t});\n\t}", "@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n mHandler = new Handler();\n // Execute a runnable task as soon as possible\n mHandler.post(runnableService);\n return START_STICKY;\n }", "public static void startService(Context context, String intentAction) {\n context.startService(new Intent(intentAction));\n }", "@Override\n public void onStart(Intent intent, int startid) {\n Log.d(\"ServiceTest\", \"Service started by user.\");\n }", "public boolean bindService(Intent intent, ServiceConnection connection, int mode);", "@Override\n\tpublic void onStart(Intent intent, int startId) {\n\t\tLog.i(TAG, \"service on start id = \"+startId);\n\t\tsuper.onStart(intent, startId);\n\t}", "@Override\n\tpublic void onStart(Intent intent, int startId) {\n\t\tsuper.onStart(intent, startId);\n\t\tLog.e(\"androidtalk\", \"service started\") ;\n\t\tSystem.out.println(\"androidtalk-service started\") ;\n\t}", "public static Intent newStartIntent(Context context) {\n\n Intent intent = new Intent(context, RadioPlayerService.class);\n intent.setAction(START_SERVICE);\n\n return intent;\n }", "public static Intent makeIntent(Context context) {\n mContext = context;\n return new Intent(context, MagpieService.class);\n }", "@Override\n protected void onCreate(Bundle pSavedInstanceState) {\n\n if (activitiesLaunched.incrementAndGet() > 1) { finish(); }\n\n super.onCreate(pSavedInstanceState);\n\n serviceIntent = new Intent(this, TallyDeviceService.class);\n\n }", "@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n //action set by setAction() in activity\n String action = intent.getAction();\n if (action.equals(START_SERVER)) {\n //start your server thread from here\n this.serverThread = new Thread(new ServerThread());\n this.serverThread.start();\n }\n if (action.equals(STOP_SERVER)) {\n //stop server\n if (serverSocket != null) {\n try {\n serverSocket.close();\n } catch (IOException ignored) {}\n }\n }\n\n //configures behaviour if service is killed by system, see documentation\n return START_REDELIVER_INTENT;\n }", "@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n\n serviceStartNormalMethod = intent.getBooleanExtra(BC_SERVICE_START_METHOD, false);\n\n // This is actually where we receive \"pings\" from activities to start us\n // and keep us running\n pingStamp = System.currentTimeMillis();\n\n // Log.i(TAG, \"SERVICE onStartCommand()\");\n\n return Service.START_NOT_STICKY;\n }", "@Override\n\tpublic IBinder onBind(Intent intent) {\n\t\treturn serviceBinder;\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = new Intent(MainActivity.this, MyService.class);\n//\t\t\t\t// startService(intent);\n\t\t\t\tbindService(intent, conn, BIND_AUTO_CREATE);\n\n\t\t\t}", "@Override\n public void onStart(Intent intent, int startId) {\n\n super.onStart(intent, startId);\n }", "@Override\n\tpublic int onStartCommand(Intent intent, int flags, int startId) {\n\t\tmEngin=new SplEngine(mh, getApplicationContext());\n\t\tmEngin.start_engine();\n\t\t\n\t\treturn START_STICKY;\n\t}", "Intent createNewIntent(Class cls);", "public void startService(View view) {\r\n startService(new Intent(this, CustomService.class));\r\n }", "@Override\n public void onClick(View v) {\n Log.i(\"ServiceExam\",\"start\");\n Intent i = new Intent(\n getApplicationContext(),\n Example17Sub_LifeCycleService.class\n );\n\n i.putExtra(\"MSG\",\"HELLO\");\n // Start Service\n // 만약 서비스 객체가 메모리에 없으면 생성하고 수행\n // onCreate() -> onStartCommand()\n // 만약 서비스 객체가 이미 존재하고 있으면\n // onStartCommand()\n startService(i);\n }", "@Override\n public void onCreate() {\n if (messageServiceUtil == null)\n messageServiceUtil = new MessageServiceUtil();\n messageServiceUtil.startMessageService(this);\n keepService2();\n }", "public NotificationService() {\n super(\"NotificationService\");\n }", "public void InitListener()\n {\n Intent listener = new Intent(this, SmsListener.class);\n listener.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startService(listener);\n }", "@SuppressWarnings({ \"static-access\", \"deprecation\" })\n\t@Override\n\tpublic void onStart(Intent intent, int startId) {\n\t\tsuper.onStart(intent, startId);\n\n\t\tLog.d(\"MAD\", \"Service Started\");\n\t\t\n\t\t\n\t\t// create intent, set a flag\n\t\tIntent alertIntent = new Intent(MyAlarmService.this,\n\t\t\t\tMyAlarmResponse.class);\n\t\talertIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\n\n\t\t//Make a notification sound\n\t\ttry {\n\t\t Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\t\t Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);\n\t\t \n\t\t //play sound\n\t\t r.play();\n\t\t} catch (Exception e) {\n\t\t e.printStackTrace();\n\t\t}\n\t\t\n\t\t// start intent\n\t\tstartActivity(alertIntent);\n\n\t}", "@Override\n\tpublic void onStart(Intent intent, int startId) {\n\t\n\t\tsuper.onStart(intent, startId);\n\t}", "public MySOAPCallActivity()\n {\n }", "protected abstract Intent createOne();", "private void startService() {\n startService(new Intent(this, BackgroundMusicService.class));\n }", "private ServiceFactory() {}", "@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n super.onStartCommand(intent, flags, startId);\n // Tapping the notification will open the specified Activity.\n// Intent activityIntent = new Intent(this, MainActivity.class);\n if (intent == null)\n intent = new Intent(this, RNTrafficStatsModule.class);\n\n pendingIntent = PendingIntent.getActivity(getApplicationContext(), 0,\n intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // This always shows up in the notifications area when this Service is running.\n not = new Notification.Builder(this).\n setContentTitle(\"TrueService\").\n setContentText(\"Running Speed Tests\")\n .setSmallIcon(R.drawable.random_pic).\n setContentIntent(pendingIntent).\n// addAction(action).\n build();\n startForeground(1, not);\n\n // Other code goes here...\n\n return START_REDELIVER_INTENT;//super.onStartCommand(intent, flags, startId);\n }", "@Override\n public void onCreate()\n {\n super.onCreate();\n Toast.makeText(this, \"I am in Service !!!\", Toast.LENGTH_SHORT).show();\n }", "@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n startService(getIntent().setClass(this, MetronomeService.class));\n finish();\n }", "@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n\n return super.onStartCommand(intent, flags, startId);\n }", "@Override\n\tpublic int onStartCommand(Intent intent, int flags, int startId) {\n\t\tBundle bundle = intent.getExtras();\n\t\t\n\t\t// Intents from Main Activity\n\t\tif(bundle.containsKey(SensiLoc.KEY_METHOD)) {\n\t\t\t// Get Intent extras\n\t\t\tutfreq = bundle.getInt(SensiLoc.KEY_UTFREQ);\n\t\t\trdfreq = bundle.getInt(SensiLoc.KEY_RDFREQ);\n\t\t\tmethod = bundle.getString(SensiLoc.KEY_METHOD);\n\t\t\tString filename = bundle.getString(SensiLoc.KEY_RECORD_FILE);\n\t\t\tLog.d(SensiLoc.LOG_TAG, \"LocateService get filename \" + filename);\n\t\t\t\n\t\t\tif(method.equals(\"Adaptive\")) {\n\t\t\t\tturn_delay = bundle.getInt(SensiLoc.KEY_TURN_DELAY);\n\t\t\t}\n\t\t\t// Start HandlerThread for location recording\n\t\t\tif(sdhelper == null) {\n\t\t\t\tsdhelper = new SDRecordHelper();\n\t\t\t\t//sdhelper.createFiles();\n\t\t\t}\n\t\t\tif(!sdhelper.t.isAlive()) {\n\t\t\t\tsdhelper.t.start();\n\t\t\t}\n\t\t\t// Create record files and request update\n\t\t\tif(method.equals(\"GPS\")) {\n\t\t\t\t\n\t\t\t\tlm.requestLocationUpdates(LocationManager.GPS_PROVIDER, utfreq*1000, 0, listener);\n\t\t\t\tcurMethod = LocateMethod.LOCATE_GPS;\n\t\t\t\t\n\t\t\t} else if(method.equals(\"Network\")) {\n\t\t\t\tlm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, utfreq*1000, 0, listener);\n\t\t\t\tcurMethod = LocateMethod.LOCATE_NETWORK;\n\t\t\t\t\n\t\t\t} else { // Adaptive \n\t\t\t\tlm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, utfreq*1000, 0, listener);\n\t\t\t\t\n\t\t\t\tAdaptLocationThread thread = new AdaptLocationThread();\n\t\t\t\tthread.start();\n\t\t\t\tcurMethod = LocateMethod.LOCATE_ADAPTIVE;\n\t\t\t}\n\t\t\t// Create new record file and record start level\n\t\t\tsdhelper = new SDRecordHelper();\n\t\t\tsdhelper.createFiles(filename);\n\t\t/*\tToast.makeText(this, \"Locate service:\\n\\tUpdate frequency: \" + utfreq\n\t\t\t\t\t+ \"\\n\\tmethod: \" + method, Toast.LENGTH_SHORT).show();*/\n\t\t\t\n\t\t\t// Start time task for periodically recording location\n\t\t\tif(locateTimer==null) {\n\t\t\t\t\n\t\t\t\tlocateTimer = new Timer();\n\t\t\t\tlocateTimer.schedule(locateTask, (utfreq+1)*1000, rdfreq*1000);\n\t\t\t\t//locateTimer.schedule(locateTask, 0, rdfreq*1000);\n\t\t\t}\n\t\t} else {\n\t\t\t// Intent from SensiService\n\t\t\t// Change location source\n\t\t\tint moving_status = bundle.getInt(KEY_MOVING_STATUS);\n\t\t\tLog.i(LOG_TAG, \"SensiService moving status \" + moving_status);\n\t\t\t\n\t\t\tif(method.equals(\"Adaptive\") && (moving_status == VAL_TURNING)) {\n\t\t\t\t\n\t\t\t\tif(curStatus == MovingStatus.STRAIGHT) {\n\t\t\t\t\tcurStatus = MovingStatus.TURNING;\n\t\t\t\t\tadaptHandler.sendEmptyMessage(MSG_GPS);\n\t\t\t\t\t\n\t\t\t\t\tturn_timer = new Timer();\n\t\t\t\t\t// Recover to request location update by network after 2 minutes\n\t\t\t\t\tturn_timer.schedule(new TimerTask() {\n\t\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tadaptHandler.sendEmptyMessage(MSG_NETWORK);\n\t\t\t\t\t\t\tcurStatus = MovingStatus.STRAIGHT;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}, turn_delay*1000);\n\t\t\t\t}\n\t\t\t} // VAL_TURNING\n\t\t}\n\t\t\n\t\tsuper.onStartCommand(intent, flags, startId);\n\t\treturn START_REDELIVER_INTENT;\n\t}", "public void startService(View view) {\n startService(new Intent(getBaseContext(), Myservice.class));\n }", "@Override\r\n public int onStartCommand(Intent intent, int flags, int startId) {\n return super.onStartCommand(intent, flags, startId);\r\n }", "@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n return super.onStartCommand(intent, flags, startId);\n }", "public AddFavouriteService() {\n super(\"AddFavouriteService\");\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState){\n\t\tmStart.setOnClickListener(new OnClickListener(){\n\t\t\t@Override\n\t\t\tpublic void onClick(View v){\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif (receiver==null) {\n\t\t\t\t\treceiver = new myReceiver();\n\t\t\t\t\tIntentFilter filter=new IntentFilter();\n\t\t\t\t\tfilter.addAction(\"com.chris.hadoop v\");\n\t\t\t\t\tmActivity.registerReceiver(receiver, filter);\n\t\t\t\t}\n\t\t\t\tIntent intent=new Intent(getActivity(),trafficMonitorService.class);\n\t\t\t\tmActivity.startService(intent);\n\t\t\t\tToast.makeText(mActivity,\" \",Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t});\n\t\tmStop.setOnClickListener(new OnClickListener(){\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v){\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif (receiver!=null) {\n\t\t\t\t\tmActivity.unregisterReceiver(receiver);\n\t\t\t\t\treceiver=null;\n\t\t\t\t}\n\t\t\t\tIntent intent=new Intent(mActivity,trafficMonitorService.class);\n\t\t\t\tmActivity.stopService(intent);\n\t\t\t\tToast.makeText(mActivity, \"ֹͣ\",Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t\t\n\t\t});\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n public void onClick(View v) {\n\n checkAccessibility();\n Intent intent = new Intent(MainActivity.this, FloatBallService.class);\n Bundle data = new Bundle();\n data.putInt(\"type\", FloatBallService.TYPE_ADD);\n intent.putExtras(data);\n startService(intent);\n }", "public static Service newInstance() {\n return newInstance(DEFAULT_PROVIDER_NAME);\n }", "@Override\r\n public int onStartCommand(Intent intent, int flags, int startId) {\n Message msg = mServiceHandler.obtainMessage();\r\n msg.arg1 = startId;\r\n msg.obj = intent;\r\n mServiceHandler.sendMessage(msg);\r\n\r\n // If we get killed, after returning from here, restart\r\n return START_STICKY;\r\n }", "public void startService(View view) {\n startService(new Intent(getBaseContext(), MyFirstService.class));\n }" ]
[ "0.8280781", "0.8213187", "0.80132484", "0.7954963", "0.78675824", "0.7616548", "0.7522625", "0.715798", "0.7155414", "0.6938953", "0.6776343", "0.6630227", "0.66172403", "0.66161776", "0.6569701", "0.65577745", "0.64851856", "0.6444905", "0.64208555", "0.6402491", "0.6334728", "0.6327789", "0.6321244", "0.62654954", "0.62649745", "0.62647265", "0.6250138", "0.62166333", "0.6211399", "0.61940867", "0.6175626", "0.61676186", "0.61629397", "0.6159433", "0.6142708", "0.6135205", "0.61304456", "0.61292315", "0.6121369", "0.61191225", "0.6113512", "0.6109028", "0.60955155", "0.6094938", "0.60943496", "0.6089225", "0.60720783", "0.6052231", "0.60163164", "0.6014727", "0.6000743", "0.5998217", "0.5998011", "0.5995162", "0.5994043", "0.5988922", "0.59859735", "0.59792006", "0.59733176", "0.59724927", "0.59615415", "0.59569865", "0.5955576", "0.5934061", "0.5915367", "0.5911769", "0.5904384", "0.5896932", "0.5887159", "0.5886646", "0.5872944", "0.58643305", "0.5862065", "0.58540666", "0.5837592", "0.5832177", "0.5829355", "0.58276546", "0.58264244", "0.5816874", "0.5815347", "0.57916355", "0.5790486", "0.578955", "0.57877654", "0.57855546", "0.5783855", "0.5778216", "0.5773941", "0.5770529", "0.5762924", "0.5752532", "0.5747055", "0.5746113", "0.5739161", "0.57380325", "0.57324266", "0.5725863", "0.5716827", "0.5707356", "0.5706478" ]
0.0
-1
TODO Autogenerated method stub
public List showAll() { Session session = null; List temp = new ArrayList(); try { session = MyUtility.getSession();// Static Method which makes only // one object as method is // static Query q = session.createQuery("FROM AuctionVO "); temp = q.list(); } catch (Exception e) { //System.out.println(e.getMessage()); e.printStackTrace(); } finally { //session.close(); } return temp; }
{ "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 getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "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.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public List getElementByID(AuctionVO auctionVO) { Session session = null; List temp = null; try { session = MyUtility.getSession();// Static Method which makes only // one object as method is // static Transaction tr = session.beginTransaction(); Query q = session.createQuery("FROM AuctionVO WHERE auction_Id = '" + auctionVO.getAuction_Id() + "'"); temp = q.list(); tr.commit(); } catch (Exception e) { System.out.println(e.getMessage()); } finally { session.close(); } return temp; }
{ "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 getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "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.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public void update(AuctionVO auctionVO) { Session session = null; try{ session = MyUtility.getSession();// Static Method which makes only one object as method is static Transaction tr = session.beginTransaction(); session.update(auctionVO); tr.commit(); }catch(Exception e) { System.out.println(e.getMessage()); } finally { session.close(); } }
{ "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 getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "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.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { int n = 7; for (int i = n; i >= 0; i--) { for(int j=0; j<n-i; j++) { System.out.print(" "); } for (int j = n; j >= n-i; j--) { System.out.print("*"); } System.out.println(""); } }
{ "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 getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "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.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { System.out.println(intToRoman(10)); }
{ "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 getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "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.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); }
{ "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 getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "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.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Make JPQL call to get the inventory items for the shop.
public List<Inventory> getInventory();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<InventoryItem> getInventory();", "List<InventoryItem> getInventory(String username, int appId);", "Collection<Item> getInventory();", "List<InventoryItem> getInventory(int appId);", "List<InventoryItem> getInventory(String username);", "List<SimpleInventory> getInventories();", "public static ArrayList<InventoryItem> getInventoryItems() {\n\n String itemUrl = REST_BASE_URL + ITEMS;\n String inventoryUrl = REST_BASE_URL + INVENTORIES;\n String availableUrl = REST_BASE_URL + INVENTORIES + AVAILABLE + CATEGORIZED;\n\n // List of items\n ArrayList<InventoryItem> items = new ArrayList<>();\n ArrayList<String> itemNames = new ArrayList<>();\n\n URL url = null;\n\n /* Fetch items from \"items\" table. */\n try {\n url = new URL(itemUrl);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n\n JSONArray itemJsonArray = null;\n try {\n Log.d(TAG, \"getInventoryItems: getting items\");\n itemJsonArray = getResponseFromHttpUrl(url);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n try {\n // Store each item into <items>. Store each item name into <itemNames>.\n for (int i = 0; i < itemJsonArray.length(); i++) {\n JSONObject jo = (JSONObject) itemJsonArray.get(i);\n InventoryItem newItem = new InventoryItem(\n jo.getString(ITEM_IMAGE_URL),\n jo.getString(ITEM_NAME),\n jo.getString(ITEM_DESCRIPTION),\n 0,\n 0);\n items.add(newItem);\n itemNames.add(jo.getString(ITEM_NAME));\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n /* Fetch inventory items from \"inventories\" */\n try {\n url = new URL(inventoryUrl);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n\n JSONArray jaResult = null;\n try {\n Log.d(TAG, \"getInventoryItems: getting ivnentories\");\n jaResult = getResponseFromHttpUrl(url);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n try {\n for (int i = 0; i < jaResult.length(); i++) {\n JSONObject jo = (JSONObject) jaResult.get(i);\n int index = itemNames.indexOf(jo.getString(ITEM_NAME));\n if (index > -1) {\n InventoryItem currItem = items.get(index);\n currItem.setItemQuantity(currItem.getItemQuantity()+1);\n items.set(index, currItem);\n } else {\n // TODO: throw an exception here?\n Log.e(TAG, \"getInventoryItems: There is an item in the inventory but not in the item table!\");\n }\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n /* get inventory stocks from \"/available/categorized\" */\n try {\n url = new URL(availableUrl);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n\n\n try {\n Log.d(TAG, \"getInventoryItems: getting inventory stocks\");\n jaResult = getResponseFromHttpUrl(url);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n try {\n for (int i = 0; i < jaResult.length(); i++) {\n JSONObject jo = (JSONObject) jaResult.get(i);\n int index = itemNames.indexOf(jo.getString(ITEM_NAME));\n if (index > -1) {\n InventoryItem currItem = items.get(index);\n currItem.setItemStock(jo.getInt(ITEM_COUNT));\n items.set(index, currItem);\n } else {\n // TODO: throw an exception here?\n Log.e(TAG, \"getInventoryItems: There is an item in the stock but not in the item table!\");\n }\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n return items;\n }", "InventoryItem getInventoryItem();", "@RequestMapping(method = RequestMethod.GET, produces = \"application/json\", headers = \"Accept=application/json\" )\n public ResponseEntity<List<InventoryResponse>> getInventory(){\n List<InventoryResponse> inventoryResponse = new ArrayList<>();\n inventoryService.getInventory().stream().forEach(inventoryItem -> inventoryResponse.add(\n new InventoryResponse(inventoryItem.getProduct().getId(), inventoryItem.getAmount())));\n\n return ResponseEntity.ok(inventoryResponse);\n }", "public Inventory getInventory(){ //needed for InventoryView - Sam\n return inventory;\n }", "@GetMapping ( BASE_PATH + \"/inventory\" )\n public ResponseEntity getInventory () {\n final Inventory inventory = inventoryService.getInventory();\n return new ResponseEntity( inventory, HttpStatus.OK );\n }", "public List<InventoryEntry> getInventoryEntries();", "public abstract List<String> getInventory();", "List<Inventory1> inventory1Search(Inventory1RequestDTO inventory1) throws Exception;", "public List<InventoryEntity> getAllInventory() {\n\t\treturn inventoryDao.getAllInventory();\n\t}", "public Item[] getInventoryItems(){\n\t\treturn inventoryItems;\n\t}", "@Test\n public void testGetInventoryQueryAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.getInventoryQueryAction(\"{productId}\", \"{scope}\", -1, -1);\n List<Integer> expectedResults = Arrays.asList(200, 400);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 200) {\n this.actions.checkResponseJSONSchema(\"#/definitions/PagedResponseInventoryItem\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "List<Item> getItems(IDAOSession session);", "@GET\r\n\t@Path(\"/all\")\r\n\t@Produces(\"application/json\")\r\n\tpublic JsonArray getAllItems(){\r\n\t\t \tConnection database = DBConnecter.getConnection();\r\n\t\t Statement stat = null;\r\n\t\t ResultSet rs = null;\r\n\t\t\ttry {\r\n\t\t\t\tstat = database.createStatement();\r\n\t\t\t\tString sqlQueryString = \"select * from item;\";\r\n\t\t\t\trs = stat.executeQuery(sqlQueryString);\r\n\t\t\t\tstat.executeQuery(sqlQueryString);\r\n\t\t\t\twhile(rs.next()){\r\n\t\t\t\t\tItem itemNew = new Item(\r\n\t\t \t\trs.getInt(idTagString),\r\n\t\t \t\trs.getInt(binNumString),\r\n\t\t \t\trs.getString(departmentString),\r\n\t\t \t\trs.getString(descriptionString),\r\n\t\t \t\trs.getFloat(replacementCostString),\r\n\t\t \t\trs.getFloat(priceString),\r\n\t\t \t\trs.getString(dimensionsString),\r\n\t\t \t\trs.getInt(lengthString),\r\n\t\t \t\trs.getFloat(weightString),\r\n\t\t \t\trs.getString(modelNumberString),\r\n\t\t \t\trs.getInt(purchaseDateString),\r\n\t\t \t\trs.getInt(warrantyEndDateString),\r\n\t\t \t\trs.getString(categoryString)\r\n\t\t \t\t);\r\n\t\t items.add(itemNew);\r\n\t\t\t\t}\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}finally{\r\n\t\t\t\ttry {\r\n\t\t\t\t\trs.close();\r\n\t\t\t\t\tstat.close();\r\n\t\t\t\t\tdatabase.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t \r\n\t\t\t}\r\n\t\t\treturn getListAsJson(items);\r\n\t}", "public List<CartItem> getAllcartitem();", "public void queryAllBuyableItems(){\r\n awsAppSyncClient.query(ListBuyableItemsQuery.builder().build())\r\n .responseFetcher(AppSyncResponseFetchers.CACHE_AND_NETWORK)\r\n .enqueue(getAllBuyableItemsCallback);\r\n }", "public abstract List<String> getUserInventory();", "public void fillInventory(TheGroceryStore g);", "public Inventory searchForItem (TheGroceryStore g, Inventory i, String key);", "public Inventory getInventory(){\n return inventory;\n }", "public Collection<Item> shopItems() {\n\t\treturn this.itemRepository.shopItems();\n\t}", "@RequestMapping(method = RequestMethod.GET, value = \"/{id}\",\n produces = \"application/json\", headers = \"Accept=application/json\" )\n public ResponseEntity<InventoryResponse> getInventoryByProductId(@PathVariable(\"id\") Integer id){\n Inventory inventory = inventoryService.getInventoryItemByProductId(id);\n\n return ResponseEntity.ok(new InventoryResponse(\n inventory.getProduct().getId(), inventory.getAmount()));\n }", "public List<Order> showAllInventory() {\r\n\t\tEntityManager em = emfactory.createEntityManager();\r\n\t\t//I may need to change the query criteria\r\n\t\tTypedQuery<Order> typedQuery = em.createQuery(\"select orderNumber from Order orderNumber\", Order.class);\r\n\t\tList<Order> allInventory = typedQuery.getResultList();\r\n\t\tem.close();\r\n\t\treturn allInventory;\r\n\t}", "public Inventory getInventory() {\n return inventory;\n }", "@RequestMapping(method=RequestMethod.GET, value = \"/item\", produces = \"application/json\")\n public List<Item> getItems()\n {\n return this.itemRepository.getItems();\n }", "@Override\n\t@Transactional(readOnly=true)\n\tpublic List<Inventory> getInventoryUpdates() {\n\t\treturn inventorydao.getInventoryUpdates();\n\t}", "public Product getProductInventory() {\n return productInventory;\n }", "List<InventoryVector> getInventory(long... streams);", "@Override\n\tpublic List<Inventory> getAllInventories() {\n\t\tArrayList<Inventory> inventories = new ArrayList<Inventory>();\n\t\tinventoryDao.findAll().forEach(inventories::add);\n\t\treturn inventories;\n\t}", "@RequestMapping(value = \"/items\", method = RequestMethod.GET)\n\tpublic @ResponseBody List<Item> itemListRest() {\n\t\treturn (List<Item>) repository.findAll();\n\t}", "SimpleInventory getOpenedInventory(Player player);", "public Inventory inventorySearch (TheGroceryStore g, String searchKey);", "public Items[] findAll() throws ItemsDaoException;", "@Override\n\tpublic List<InventoryManagement> findAll() {\n\t\treturn inventoryManagementDao.findAll();\n\t}", "public Items[] findWhereQuantityEquals(double quantity) throws ItemsDaoException;", "public ResultSet getItemList() throws IllegalStateException{\n\t \n\t if(!isLoggedIn())\n\t throw new IllegalStateException(\"MUST BE LOGGED IN FIRST!\");\n\t try{\n\t \t stmt = con.createStatement();\n String queryString = \"SELECT INUMBER , INAME , CATEG, auc_start, auc_end_date , startbid , currentbid,status \" \n \t\t+ \"FROM ITEM \"\n + \" WHERE SELLERNO = '\" + this.id +\"' \";\n\n result = stmt.executeQuery(queryString);\n \n\t }\n\t catch (Exception E) {\n\t E.printStackTrace();\n\t }\n\t return result; \n\t }", "public void onQueryInventoryFinished(IabResult result, Inventory inv);", "@GetMapping(\"/equipment\")\n\tpublic List<Equipment> findAll() {\n\t\treturn inventoryService.findAll();\n\t}", "private int getFromSellableInventoryService() {\n Map<String, String> pathVars = Maps.newHashMap();\n pathVars.put(\"location\", LOCATION);\n pathVars.put(\"sku\", SKU);\n try {\n InventoryDto inventory = restTemplate.getForObject(\n \"http://localhost:9093/inventory/locations/{location}/skus/{sku}\", InventoryDto.class, pathVars);\n\n return inventory.getCount();\n } catch (RestClientException e) {\n return 0;\n }\n }", "List<ItemPedido> findAll();", "Set<String> getInventory();", "public static void items(){\n\t\ttry{\n\t\t\tConnection conn = DriverManager.getConnection(url,username,password);\n\t\t\tStatement query = conn.createStatement();\n\t\t\tResultSet re = query.executeQuery(\"select * from item\");\n\t\t\tString spc = \" \";\n\t\t\twhile (re.next()){\n\t\t\t\tSystem.out.println(re.getInt(\"itemid\")+spc+re.getString(\"title\")+spc+re.getDouble(\"price\"));\n\t\t\t}\n\t\t}catch(Exception ecx){\n\t\t\tecx.printStackTrace();\n\t\t}\n\t}", "public List<ShopItem> getShopItems() {\n\t\treturn myItems;\n\t}", "@Override\r\n\tpublic void setInventoryItems() {\n\t\t\r\n\t}", "public ArrayList<Item> getList() {\r\n\t\treturn inventory;\r\n\t}", "@Override\n\tpublic List<Item> findItemList() {\n\t\tCriteriaBuilder cb=entityManager.getCriteriaBuilder();\n\t\tCriteriaQuery<Item> query = cb.createQuery(Item.class); \n // Root<Item> item = query.from(Item.class);\n List<Item> itemList= entityManager.createQuery(query).getResultList();\n\t\treturn itemList;\n\t}", "ShoppingItem getShoppingItemByGuid(String itemGuid);", "public interface InventoryRepository extends JpaRepository<Inventory,Integer> {\n\n @Query(\"select i from Inventory i ,in(i.good) g where g.goodId=:goodId\")\n public List<Inventory> selectAllGoodId(@Param(\"goodId\") int goodId);\n}", "@Override\n\tpublic List<Item> findItemListByQuery() {\n\t\tCriteriaBuilder cb=entityManager.getCriteriaBuilder();\n\t//\tCriteriaQuery<Item> query = cb.createQuery(Item.class); \n // Root<Item> item = query.from(Item.class);\n TypedQuery<Item> iquery=entityManager.createQuery(\"select i from Item i\", Item.class);\n\t\treturn iquery.getResultList();\n\t\t\n\t}", "public int[] currentProductsInInventory(){\r\n\t\tString sql=\"SELECT Barcode FROM ProductTable WHERE Quantity_In_Store>=0 OR Quantity_In_storeroom>=0 \";\r\n\t\tint[] products=null;\r\n\t\tArrayList<Integer> tmpList = new ArrayList<Integer>();\r\n\t\tint counter = 0;\r\n\t\t try (Connection conn = this.connect();\r\n\t Statement stmt = conn.createStatement();\r\n\t ResultSet rs = stmt.executeQuery(sql)){\r\n\t\t\t while(rs.next()){\r\n\t\t\t\t tmpList.add(rs.getInt(\"Barcode\"));\r\n\t\t\t\t counter++;\r\n\t\t\t }\r\n\t\t\t products= new int[counter];\r\n\t\t\t for(int i=0;i<counter;i++){\r\n\t\t\t\t products[i]=tmpList.get(i);\r\n\t\t\t }\r\n\t\t }\r\n\t\t catch (SQLException e) {\r\n\t\t\t System.out.println(\"currentProductsInInventory: \"+e.getMessage());\r\n\t\t\t return new int[0]; \r\n\t\t }\r\n\t\treturn products;\r\n\t}", "public List<Item> getAllItemsAvailable();", "List<InventoryItem> findByQuantityInStockLessThan(int quantityInStock);", "public List<SalesItems> toListSalesItems(int vendaId){\n \n List<SalesItems> list = new ArrayList<>();\n String sql = \"select i.id, p.descricao, i.qtd, p.preco, \"\n + \"i.subtotal from tb_itensvendas as i \"\n + \"inner join tb_produtos as p on(i.produto_id = p.id) \"\n + \"where i.venda_id = ? \";\n \n try{\n \n PreparedStatement st = conn.prepareStatement(sql);\n \n st.setInt(1, vendaId);\n \n \n ResultSet rs = st.executeQuery();\n \n while(rs.next()){\n SalesItems item = new SalesItems();\n Product product = new Product();\n \n item.setId(rs.getInt(\"i.id\"));\n product.setDescricao(rs.getString(\"p.descricao\"));\n item.setQtd(rs.getInt(\"i.qtd\"));\n product.setPreco(rs.getDouble(\"p.preco\"));\n item.setSubtotal(rs.getDouble(\"i.subtotal\"));\n \n \n \n \n \n item.setProduto(product);\n \n list.add(item);\n \n }\n \n return list;\n \n }\n catch(SQLException error){\n JOptionPane.showMessageDialog(null, \"Erro: \" + error);\n return null;\n }\n }", "public ResultSet getItemListForSold() throws IllegalStateException{\n\t \n\t if(!isLoggedIn())\n\t throw new IllegalStateException(\"MUST BE LOGGED IN FIRST!\");\n\t try{\n\t \t stmt = con.createStatement();\n String queryString = \"SELECT INUMBER , INAME , auc_start, auc_end_date , startbid , currentbid , CURRENTBID-STARTBID \" \n \t\t+ \"FROM ITEM \"\n + \" WHERE SELLERNO = '\" + this.id +\"' AND STATUS = 'SOLD' \"\n \t+\"GROUP BY SELLERNO, INUMBER, INAME, auc_start, auc_end_date,\"+ \n \t\t\" startbid, currentbid, CURRENTBID-STARTBID\";\n\n result = stmt.executeQuery(queryString);\n \n\t }\n\t catch (Exception E) {\n\t E.printStackTrace();\n\t }\n\t return result; \n\t }", "@Query(value = \"SELECT * FROM cmpe275_cartShare.cart_item WHERE pooler_id = ?1\", nativeQuery = true)\n List<CartItem> findAllByPoolerId(Long poolerId);", "ResponseEntity<List<ItemDTO>> getAllCartItems(String cartId);", "public Items getItem(String name)\n {\n return Inventory.get(name);\n }", "java.util.List<io.opencannabis.schema.commerce.OrderItem.Item> \n getItemList();", "List<ItemStockDO> selectAll();", "List<CatalogItem> getAllCatalogItems();", "public ArrayList<Item> getItemList(){\n\t\treturn inventoryList;\n\t}", "public List<Items> list() {\n\t\treturn itemDao.list();\r\n\t}", "public List<EquipmentVO> queryBrokenEquipment(@Param(\"store_id\")String store_id);", "void openInventory(Player player, SimpleInventory inventory);", "public Item getItemById(Integer itemId);", "public List<Stockitem> getItem() {\n\t\treturn (ArrayList<Stockitem>) stockitemDAO.findAllStockitem();\n\t}", "@Override\n public List<Item> viewAllItems() {\n // calls List<Item> itemRepo.findCatalog();\n return itemRepo.findCatalog();\n }", "public List<ShelfItem> getAll(String username, Integer from, Integer to);", "List<EquipmentCategory> getAllEquipment() throws PersistenceException;", "List<Product> getAllProducts() throws PersistenceException;", "com.rpg.framework.database.Protocol.Item getItems(int index);", "public List<StockItem> getStockList();", "public Inventory getInventory() {\r\n\t\treturn inventory;\r\n\t}", "public @NotNull Set<Item> findAllItems() throws BazaarException;", "public void addItemToInventory(Item ... items){\n this.inventory.addItems(items);\n }", "@Override\r\n\tpublic java.util.List<Inventory> findAll(String nameProduct) {\n\t\tsession=HibernateUlits.getSessionFactory().openSession();\r\n\t\t\r\n\t\tInventory inventory = new Inventory();\r\n\t\t\r\n\t\tQuery query = session.createQuery(\"FROM Inventory WHERE invName = '\" + nameProduct + \"'\");\r\n\t\t\r\n\t\tList inventor = query.list();\r\n\t\t\r\n\t\tList<Inventory> invent= new ArrayList<>();\r\n\t\t\r\n\t\tfor (Iterator iter = inventor.iterator();iter.hasNext();) {\r\n\t\t\tInventory in = (Inventory)iter.next();\r\n\t\t\tInteger id= in.getInvId();\r\n\t\t\tString name = in.getInvName();\r\n\t\t\tString description = in.getInvDescription();\r\n\t\t\tString location = in.getInvLocation();\r\n\t\t\tBigDecimal price = in.getInvPrice();\r\n\t\t\tShort stock = in.getInvStock();\r\n\t\t\tShort weight = in.getInvWeight();\r\n\t\t\tShort size = in.getInvSize();\r\n\t\t\t\r\n\t\t\tInventory tempInv = new Inventory(id,name,description,location,price,stock,weight,size);\r\n\t\t\tinvent.add(tempInv);\r\n\t\t }\r\n\t \r\n\t \r\n\t\treturn invent;\r\n\t}", "public void retrieveCardInventoryList() {\n try {\n systemResultViewUtil.setCardInventoryDataBeansList(cardInventoryTransformerBean.retrieveAllCardInventory());\n System.out.println(\"Retrive CardInventory Successfully\");\n } catch (Exception e) {\n System.out.println(e);\n System.out.println(\"Error in Retrive CardInventory\");\n }\n }", "public void list(){\n //loop through all inventory items\n for(int i=0; i<this.items.size(); i++){\n //print listing of each item\n System.out.printf(this.items.get(i).getListing()+\"\\n\");\n }\n }", "@GetMapping(\"/items/{id}\")\n public ResponseEntity<Items> getItems(@PathVariable Long id) {\n log.debug(\"REST request to get Items : {}\", id);\n Optional<Items> items = itemsRepository.findById(id);\n return ResponseUtil.wrapOrNotFound(items);\n }", "public static List<Product> openInventoryDatabase() {\r\n\t\tdbConnect();\r\n\t\tStatement stmt = null;\r\n\t\tResultSet rs = null;\r\n\t\tList<Product> prods = new ArrayList<>();\r\n\t\ttry {\r\n\t\t\tstmt = conn.createStatement();\r\n\t\t\trs = stmt.executeQuery(GET_PRODUCTS_FROM_DB);\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tint productCode = rs.getInt(\"product_code\");\r\n\t\t\t\tString productName = rs.getString(\"product_name\");\r\n\t\t\t\tString productUnit = rs.getString(4);\r\n\t\t\t\tString productDescription = rs.getString(5);\r\n\t\t\t\tdouble priceForPurchase = rs.getDouble(6);\r\n\t\t\t\tdouble priceForSales = rs.getDouble(7);\r\n\t\t\t\tint stockQuantity = rs.getInt(8);\r\n\t\t\t\tprods.add(new Product(productCode, productName, productUnit, productDescription, priceForPurchase,\r\n\t\t\t\t\t\tpriceForSales, stockQuantity));\r\n\t\t\t}\r\n\t\t\tstmt.close();\r\n\t\t\trs.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t// dbClose();\r\n\t\treturn prods;\r\n\t}", "@Query(value = \"SELECT * FROM ITEMS WHERE category_id = ?1\", nativeQuery = true)\n List<Items> findItemsByCategoryId(Long itemCategoryId);", "public List<ItemDTO> getItems()\n\t{\t\n\t\tList<ItemDTO> itemsList = new ArrayList<>();\n\t\tfor (ItemData item : items) \n\t\t\titemsList.add(new ItemDTO(item.idItem,item.description,item.price,item.VAT,item.quantitySold));\t\n\t\treturn itemsList;\n\t}", "@GET\r\n\tpublic JsonObject getItem(@QueryParam(\"id\") int id){\r\n\t\tConnection database = DBConnecter.getConnection();\r\n\t Statement stat = null;\r\n\t ResultSet rs = null;\r\n\t System.out.print(id);\r\n\t\ttry {\r\n\t\t\tItem item = null;\r\n\t\t\tstat = database.createStatement();\r\n\t\t\tString sqlQueryString = \"select * from item where idTag='\" + id+ \"';\";\r\n\t\t\trs = stat.executeQuery(sqlQueryString);\r\n\t\t\tstat.executeQuery(sqlQueryString);\r\n\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\titem = new Item(\r\n\t \t\trs.getInt(idTagString),\r\n\t \t\trs.getInt(binNumString),\r\n\t \t\trs.getString(departmentString),\r\n\t \t\trs.getString(descriptionString),\r\n\t \t\trs.getFloat(replacementCostString),\r\n\t \t\trs.getFloat(priceString),\r\n\t \t\trs.getString(dimensionsString),\r\n\t \t\trs.getInt(lengthString),\r\n\t \t\trs.getFloat(weightString),\r\n\t\t\t \trs.getString(modelNumberString),\r\n\t\t\t \trs.getInt(purchaseDateString),\r\n\t\t\t \trs.getInt(warrantyEndDateString),\r\n\t\t\t \trs.getString(categoryString)\r\n\t \t\t);\r\n\t\t\t}\r\n\t\t\tif(item != null)\r\n\t\t\t\treturn item.toJSON();\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}finally{\r\n\t\t\ttry {\r\n\t\t\t\trs.close();\r\n\t\t\t\tstat.close();\r\n\t\t\t\tdatabase.close();\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t \r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static List<Item> getItems() {\n\n HttpRequest request = HttpRequest.newBuilder().GET().uri(URI.create(\"http://localhost:8080/item/all\")).setHeader(\"Cookie\", Authenticator.SESSION_COOKIE).build();\n HttpResponse<String> response = null;\n try {\n response = client.send(request, HttpResponse.BodyHandlers.ofString());\n } catch (Exception e) {\n e.printStackTrace();\n //return \"Communication with server failed\";\n }\n if (response.statusCode() != 200) {\n System.out.println(\"Status: \" + response.statusCode());\n }\n\n ObjectMapper mapper = new ObjectMapper();\n mapper.registerModule(new JavaTimeModule());\n List<Item> items = null;\n // TODO handle exception\n try {\n items = mapper.readValue(response.body(), new TypeReference<List<Item>>(){});\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return items;\n }", "private static void viewItems() {\r\n\t\tdisplayShops();\r\n\t\tint shopNo = getValidUserInput(scanner, shops.length);\r\n\t\tdisplayItems(shopNo);\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\" Please enter the ID of the element to add to cart. \\\"0\\\" for exit\");\r\n\t\tSystem.out.println();\r\n\t\tint productNo = getValidUserInput(scanner, shops[shopNo].getAllSales().length + 1);\r\n\t\tif (productNo > 0) {\r\n\t\t\tProduct productToBeAdd = shops[shopNo].getAllSales()[productNo - 1];\r\n\t\t\tSystem.out.println();\r\n\t\t\tSystem.out.print(\" Please enter the number of the item you would like to buy: \");\r\n\t\t\tint numberOfTheItems = getUserIntInput();\r\n\t\t\tcart.addProduct(productToBeAdd, numberOfTheItems);\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\" Purchase done, going back to the menu.\");\r\n\t\tSystem.out.println();\r\n\t}", "@Override\n\tpublic void browseItems(Session session){\n\t\t//exception handling block\n\t\ttry{\n\t\t\tbrowseItem=mvc.browseItems(session);\n\t\t\t//displaying items from database\n\t\t\tSystem.out.println(\"<---+++---Your shopping items list here----+++--->\");\n\t\t\tSystem.out.println(\"ItemId\"+\" \"+\"ItemName\"+\" \"+\"ItemType\"+\" \"+\"ItemPrice\"+\" \"+\"ItemQuantity\");\n\t\t\tfor(int i = 0; i < browseItem.size(); i++) {\n\t System.out.println(browseItem.get(i)+\"\\t\"+\"\\t\");\n\t }\n\t System.out.println(\"<------------------------------------------------>\");\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(\"Online Market App Exception- Browse Items: \" +e.getMessage());\n\t\t}\n\t}", "public ItemDTO searchItemInventory(int idItem) {\n\t\tfor (ItemData item : items) {\n\t\t\tif (item.idItem == idItem) {\n\t\t\t\treturn new ItemDTO(item.idItem, item.description, item.price, item.VAT, item.quantitySold);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private void getAllItems() {\n\n try {\n double sellingPrice = 0;\n ArrayList<Item> allItems = ItemController.getAllItems();\n for (Item item : allItems) {\n double selling_margin = item.getSelling_margin();\n if (selling_margin > 0) {\n sellingPrice = item.getSellingPrice() - (item.getSellingPrice() * selling_margin / 100);\n } else {\n sellingPrice = item.getSellingPrice();\n }\n Object row[] = {item.getItemCode(), item.getDescription(), Validator.BuildTwoDecimals(item.getQuantity()), Validator.BuildTwoDecimals(sellingPrice)};\n tableModel.addRow(row);\n }\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(FormItemSearch.class.getName()).log(Level.SEVERE, null, ex);\n } catch (SQLException ex) {\n Logger.getLogger(FormItemSearch.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "MEsShoppingCartDTO selectByPrimaryKey(String shoppingCartId);", "public static List<Item> findAll() {\n\t\treturn getPersistence().findAll();\n\t}", "@RequestMapping(value = \"/items\", method = RequestMethod.GET)\n public ItemResponse getAllReceipts() {\n\n List items = itemsDBService.getItems();\n List itemNew = new ArrayList();\n for (Object i : items) {\n ItemEntity ie = (ItemEntity) i;\n itemNew.add(Item.builder().itemNumber(ie.getItemNumber())\n .itemUnitCount(ie.getItemUnitCount())\n .itemName(ie.getItemName())\n .itemPrice(ie.getItemPrice())\n .itemUnitPrice(ie.getItemUnitPrice())\n .itemCategory(ie.getItemCategory())\n .itemDiscount(ie.getItemDiscount())\n .itemWarantyEndDate(ie.getItemWarantyEndDate())\n .itemTypeCode(ie.getItemTypeCode())\n .build()\n );\n }\n return ItemResponse.builder().items(itemNew).build();\n }", "Sequipment selectByPrimaryKey(Integer id);", "@RequestMapping(method=RequestMethod.GET, value = \"/item/{id}\", produces = \"application/json\")\n public Item getItem(@PathVariable (name = \"id\") UUID id)\n {\n return this.itemRepository.getItem(id);\n }", "@Override\r\n\tpublic List<shopPet> getAll() {\n\t\treturn dao.getAll();\r\n\t}", "public void onInventoryChanged();" ]
[ "0.6952404", "0.6851248", "0.6805953", "0.67643964", "0.6685911", "0.63414764", "0.62356246", "0.61514366", "0.60712355", "0.59704", "0.5861722", "0.5857923", "0.5850549", "0.5828873", "0.58180803", "0.5727921", "0.57093376", "0.5705859", "0.5623164", "0.5622167", "0.5591426", "0.55905336", "0.5554615", "0.5552608", "0.5516391", "0.5515459", "0.55152893", "0.55138665", "0.5503956", "0.5499493", "0.5492562", "0.5490012", "0.54800284", "0.54684734", "0.54528433", "0.5445932", "0.543968", "0.5433611", "0.5426879", "0.5410064", "0.5386387", "0.5373478", "0.5372696", "0.5369487", "0.53477794", "0.5341172", "0.533561", "0.53128076", "0.5305143", "0.53037375", "0.53024817", "0.52902484", "0.5279841", "0.52785116", "0.5272675", "0.52721", "0.5267617", "0.52602476", "0.52586246", "0.5251789", "0.52368283", "0.52356285", "0.5232866", "0.523022", "0.52253985", "0.52225477", "0.5222054", "0.5220835", "0.521544", "0.52077305", "0.52035713", "0.5201875", "0.51968616", "0.5186003", "0.5135764", "0.51329446", "0.5132518", "0.5131478", "0.5131138", "0.5130943", "0.5127916", "0.5124064", "0.5106736", "0.5098571", "0.5093419", "0.5087389", "0.5078702", "0.50742453", "0.50644046", "0.5057539", "0.50543475", "0.5047393", "0.5044644", "0.50268006", "0.50247115", "0.50209606", "0.5014993", "0.5012809", "0.50124615", "0.50121987" ]
0.64543104
5
Imposta l'oggetto che contiene le informazioni relative al cast, necessario per la formattazione corretta dei messaggi
public void setCast(Cast cast) { this.cast = cast; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String converterTemperatura(Medidas medidaUm, Medidas medidaDois) {\n String medidaUmUnidade = medidaUm.getUnidadeDeTemperatura();\n String medidaDoisUnidade = medidaDois.getUnidadeDeTemperatura();\n boolean unidadesIguais = medidaUmUnidade.equals(medidaDoisUnidade) ? true : false;\n String errorMessage = \"Não é possível realizar a conversão, pois as duas medidas já estão na mesma unidade.\";\n\n if (unidadesIguais)\n return errorMessage;\n else {\n int medidaUmTemperaturaNova = (int) ((medidaUmUnidade == \"f\") ? ((medidaUm.getTemperatura() - 32) / 1.8)\n : ((medidaUm.getTemperatura() * 1.8) + 32));\n medidaUm.setTemperatura(medidaUmTemperaturaNova);\n String medidaUmUnidadeDeTemperaturaNova = (medidaUmUnidade == \"f\") ? \"c\" : \"f\";\n medidaUm.setUnidadeDeTemperatura(medidaUmUnidadeDeTemperaturaNova);\n\n int medidaDoisTemperaturaNova = (int) ((medidaDoisUnidade == \"f\") ? ((medidaDois.getTemperatura() - 32) / 1.8)\n : ((medidaDois.getTemperatura() * 1.8) + 32));\n medidaDois.setTemperatura(medidaDoisTemperaturaNova);\n String medidaDoisUnidadeDeTemperaturaNova = (medidaUmUnidade == \"f\") ? \"c\" : \"f\";\n medidaDois.setUnidadeDeTemperatura(medidaDoisUnidadeDeTemperaturaNova);\n }\n\n String medidaUmConvertida = medidaUm.getTemperatura() + \" \" + medidaUm.getUnidadeDeTemperatura();\n String medidaDoisConvertida = medidaDois.getTemperatura() + \" \" + medidaDois.getUnidadeDeTemperatura();\n\n return (\"Temp. 01: \" + medidaUmConvertida + \" | \" + \"Temp. 02: \" + medidaDoisConvertida);\n }", "@Override\n public String toString(){\n return \" Vuelo \"+this.getTipo()+\" \" +this.getIdentificador() +\"\\t \"+ this.getDestino()+ \"\\t salida prevista en \" + timeToHour(this.getTiemposal())+\" y su combustible es de \"+this.getCombustible()+\" litros.( \"+ String.format(\"%.2f\", this.getCombustible()/this.getTankfuel()*100) + \"%).\"; \n }", "public String converterMassa(Medidas medidaUm, Medidas medidaDois) {\n String medidaUmUnidade = medidaUm.getUnidadeDeMassa();\n String medidaDoisUnidade = medidaDois.getUnidadeDeMassa();\n boolean unidadesIguais = medidaUmUnidade.equals(medidaDoisUnidade) ? true : false;\n String errorMessage = \"Não é possível realizar a conversão, pois as duas medidas já estão na mesma unidade.\";\n\n if (unidadesIguais)\n return errorMessage;\n else {\n double medidaUmMassaNova = (medidaUmUnidade == \"lb\") ? (medidaUm.getMassa() / 2.2046)\n : (medidaUm.getMassa() * 2.2046);\n medidaUm.setMassa(medidaUmMassaNova);\n String medidaUmUnidadeDeMassaNova = (medidaUmUnidade == \"lb\") ? \"kg\" : \"lb\";\n medidaUm.setUnidadeDeMassa(medidaUmUnidadeDeMassaNova);\n\n double medidaDoisMassaNova = (medidaDoisUnidade == \"lb\") ? (medidaDois.getMassa() / 2.2046)\n : (medidaDois.getMassa() * 2.2046);\n medidaDois.setMassa(medidaDoisMassaNova);\n String medidaDoisUnidadeDeMassaNova = (medidaUmUnidade == \"lb\") ? \"kg\" : \"lb\";\n medidaDois.setUnidadeDeMassa(medidaDoisUnidadeDeMassaNova);\n }\n\n String medidaUmConvertida = medidaUm.getMassa() + \" \" + medidaUm.getUnidadeDeMassa();\n String medidaDoisConvertida = medidaDois.getMassa() + \" \" + medidaDois.getUnidadeDeMassa();\n\n return (\"Massa 01: \" + medidaUmConvertida + \" | \" + \"Massa 02: \" + medidaDoisConvertida);\n }", "private String TimeConversion() {\n\n int hours, minutes, seconds, dayOfWeek, date, month, year;\n\n seconds = ((raw[27] & 0xF0) >> 4) + ((raw[28] & 0x03) << 4);\n minutes = ((raw[28] & 0xFC) >> 2);\n hours = (raw[29] & 0x1F);\n dayOfWeek = ((raw[29] & 0xE0) >> 5);\n date = (raw[30]) & 0x1F;\n month = ((raw[30] & 0xE0) >> 5) + ((raw[31] & 0x01) << 3);\n year = (((raw[31] & 0xFE) >> 1) & 255) + 2000;\n\n\n\n return hR(month) + \"/\" + hR(date) + \"/\" + year + \" \" + hR(hours) + \":\" + hR(minutes) + \":\" + hR(seconds) + \":00\";\n }", "public String toMessage() {\n String mem = \"Mem: \"+memoryLoad+\"%\";\n String cpu = \" CPU: \"+cpuLoad+\"%\";\n String bat = \" Bat: \"+batteryLevel+\"%\";\n String threads = \"Threads: \"+numberOfThreads;\n String nbCM = \"BCs: \"+numberOfBCs;\n String nbConn = \"Connectors: \"+numberOfConnectors;\n String emiss = \"Sent PF:appli \"+networkPFOutputTraffic+\":\"+networkApplicationInputTraffic+\" KB/s\";\n String rec = \"Rcvd PF:appli \"+networkPFInputTraffic+\":\"+networkApplicationInputTraffic+\" KB/s\";\n return mem+\"|\"+cpu+\"|\"+threads+\"|\"+bat+\"|\"+nbCM+\"|\"+nbConn+\"|\"+emiss+\"|\"+rec; // recuperation de l'etat de l'hote\n }", "@Override // prekrytie danej metody predka\r\n public String toString() {\r\n return super.toString()\r\n + \" vaha: \" + String.format(\"%.1f kg,\", dajVahu())\r\n + \" farba: \" + dajFarbu() + \".\";\r\n }", "public void formatoTiempo() {\n String segundos, minutos, hora;\n\n hora = hrs < 10 ? String.valueOf(\"0\" + hrs) : String.valueOf(hrs);\n\n minutos = min < 10 ? String.valueOf(\"0\" + min) : String.valueOf(min);\n\n jLabel3.setText(hora + \" : \" + minutos + \" \" + tarde);\n }", "private String pedometerConversion() {\n return (record[20] & 255) + \"\";\n }", "@Override\n public String toString(){\n String format = \"%1$-30s %2$-20s %3$-20s %4$-12s %5$-3s %6$-12s\";\n return String.format(format, this.title, this.stream, this.type,\n this.start_date.format(DateTimeFormatter.ofPattern(data.daTiFormat)), \"-\", this.end_date.format(DateTimeFormatter.ofPattern(data.daTiFormat)));}", "public String converterDistancia(Medidas medidaUm, Medidas medidaDois) {\n String medidaUmUnidade = medidaUm.getUnidadeDeDistancia();\n String medidaDoisUnidade = medidaDois.getUnidadeDeDistancia();\n boolean unidadesIguais = medidaUmUnidade.equals(medidaDoisUnidade) ? true : false;\n String errorMessage = \"Não é possível realizar a conversão, pois as duas medidas já estão na mesma unidade.\";\n\n if (unidadesIguais)\n return errorMessage;\n else {\n double medidaUmDistanciaNova = (medidaUmUnidade == \"mi\") ? (medidaUm.getDistancia() * 1.609)\n : (medidaUm.getDistancia() / 1.609);\n medidaUm.setDistancia(medidaUmDistanciaNova);\n String medidaUmUnidadeDeDistanciaNova = (medidaUmUnidade == \"mi\") ? \"km\" : \"mi\";\n medidaUm.setUnidadeDeDistancia(medidaUmUnidadeDeDistanciaNova);\n\n double medidaDoisDistanciaNova = (medidaDoisUnidade == \"mi\") ? (medidaDois.getDistancia() * 1.609)\n : (medidaDois.getDistancia() / 1.609);\n medidaDois.setDistancia(medidaDoisDistanciaNova);\n String medidaDoisUnidadeDeDistanciaNova = (medidaUmUnidade == \"mi\") ? \"km\" : \"mi\";\n medidaDois.setUnidadeDeDistancia(medidaDoisUnidadeDeDistanciaNova);\n }\n\n String medidaUmConvertida = medidaUm.getDistancia() + \" \" + medidaUm.getUnidadeDeDistancia();\n String medidaDoisConvertida = medidaDois.getDistancia() + \" \" + medidaDois.getUnidadeDeDistancia();\n\n return (\"Distancia 01: \" + medidaUmConvertida + \" | \" + \"Distancia 02: \" + medidaDoisConvertida);\n }", "protected abstract String format();", "@NonNull\n public String toString(){\n return this.hora+\":\"+this.minutos+\" \"+this.segundos+\" Sec \"+this.dia+\"/\"+this.mes+\"/\"+this.anno;\n }", "@Override\r\n\tpublic String toString() {\r\n\t\t\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\t\r\n String dataInicioFormatada = this.dataInicio;\r\n\t\t\t\r\n\t\tsb.append(this.designacaoTorneio + \" | \");\r\n\t\tsb.append(dataInicioFormatada + \" | \");\r\n\t\tsb.append(this.jogadorAdversario.getNome() + \"\\t| \");\r\n\t\tsb.append(this.qtdEncontros + \" | \");\r\n\t\t\t\r\n\t\t\t\r\n\t\tdouble diferenca = jogadorCorrente.getPontos() - this.jogadorAdversario.getPontos();\r\n\t\t\t\r\n\t\tif (diferenca < 0.0)\r\n\t\t\tsb.append((Math.round(diferenca * 100) / 100.0) + \"\\n\");\r\n\t\t\t\r\n\t\telse\r\n\t\t\tsb.append(\"+\" + (Math.round(diferenca * 100) / 100.0));\r\n\r\n\t\tif (sb.length() == 0)\r\n\t\t\tsb.append(VisualizarEncontroDTO.NAO_EXISTEM_CONFRONTOS);\r\n\t\t\r\n\t\treturn sb.toString();\r\n\t}", "public void formatarDadosEntidade(){\n\t\tcodigoMunicipioOrigem = Util.completarStringZeroEsquerda(codigoMunicipioOrigem, 10);\n\t\tcodigoClasseConsumo = Util.completarStringZeroEsquerda(codigoClasseConsumo, 2);\n\n\t}", "public void toonFiguur() {\n System.out.format(\"kleur: %-5s oppervlakte: %5.3f inhoud: %5.3f\\n\",\n kleur, oppervlakte(), inhoud());\n }", "@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di friggere un uovo\";\r\n }", "@VTID(8)\r\n java.lang.String format();", "public String comunica() {\r\n// ritorna una stringa\r\n// posso usare il metodo astratto \r\n return msg + AggiungiQualcosa();\r\n }", "public String toString() {\n\t\tString string = sender.getAdresse().getOrt() + \">\" + empfaenger.getAdresse().getOrt() + \"(Start:\"\n\t\t\t\t+ startZeitpunkt + \" Dauer:\" + transportDauer + \")\";\n\t\tif (istAusgeliefert() == true) {\n\t\t\tstring += \" ist ausgeliefert\";\n\t\t} else {\n\t\t\tstring += \"bei \" + (100 * (momentanZeitpunkt - startZeitpunkt) / transportDauer) + \"%\";\n\t\t}\n\t\treturn string;\n\t}", "@Override\r\n\tpublic String toString() {\n\t\tString change = \"\";\r\n\t\tString min_change = \"\";\r\n\t\tString max_change = \"\";\r\n\r\n\t\tif (this.runaway_change != null) {\r\n\t\t\tchange += Unit.getDescriptionByCode(runaway_change);\r\n\t\t}\r\n\r\n\t\tif (this.containsV) {\r\n\t\t\tif (this.min_range_change != null) {\r\n\t\t\t\tmin_change += Unit.getDescriptionByCode(min_range_change);\r\n\t\t\t}\r\n\t\t\tif (this.max_range_change != null) {\r\n\t\t\t\tmax_change += Unit.getDescriptionByCode(max_range_change);\r\n\t\t\t}\r\n\t\t\treturn this.runaway_number + runaway_LCR==null?Unit.getDescriptionByCode(runaway_LCR):\"\" + \"跑道,最小跑道视程\" + this.min_range + \"米,\"\r\n\t\t\t\t\t+ min_change + \",最大跑道视程\" + this.max_range + \"米,\" + max_change + \",\";\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn this.runaway_number + Unit.getDescriptionByCode(runaway_LCR) + \"跑道,跑道视程\" + this.viusal_range + \"米,\"+change;\r\n\t\t}\r\n\t}", "String formatMessage(LogMessage ioM);", "@Override\n public String getAgenciaCodCedenteFormatted() {\n return boleto.getAgencia() + \"/\" + boleto.getContaCorrente() + \" \" + boleto.getDvContaCorrente();\n }", "@Override\n\tpublic String exibirDados() {\n\t\ttoString();\n\t\tString message = toString() + \"\\nimc: \" + calculaImc();\n\t\treturn message;\n\t}", "void stampaMessaggio(String messaggio);", "R format(O value);", "@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di cuocere il pollo\";\r\n }", "@Override\n\tprotected String formatted(Walue _) {\n\t\treturn \"\";\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn String.format(\"Tam giac ten: %s, Do dai ba canh lan luot: %f %f %f\", ten,canhA,canhB,canhC);\n\t}", "@Override\n\tpublic String toString(){\n\t\treturn this.from+\"----\"+this.to; \n\t}", "public String toString(){\n\n\t\tString msg =\"\";\n\t\tmsg += super.toString()+\"\\n\";\n\t\tmsg +=\"El tipo de servicio es: \"+typeOfService+\"\\n\";\n\t\tmsg +=\"La cantidad de kiloWatts registrada es: \"+kiloWatts+\"\\n\";\n\t\tmsg +=\"Cantidad de arboles que deben plantar: \"+calculatedConsuption()+\"\\n\";\n\n\t return msg;\n\t}", "public String dimeTuTiempo()\n {\n String cadResultado=\"\";\n if (horas<10)\n {\n cadResultado=cadResultado+\"0\";\n }\n cadResultado=cadResultado+horas;\n cadResultado=cadResultado+\":\";\n if(minutos<10)\n {\n cadResultado=cadResultado+\"0\";\n }\n cadResultado=cadResultado+minutos;\n \n return cadResultado;\n }", "public String Dime_datos_generales() {\n\t\t\n\t\treturn \"la plataforma del veiculo tiene \"+ rueda+\" ruedas\"+\n\t\t\"\\nmide \"+ largo/1000+\" metros con un ancho de \"+ancho+\n\t\t\"cm\"+\"\\nun peso de platafrorma de \"+peso;\n\t}", "public String toString(){\n\n\tString msg =\"\";\n\n\tmsg += super.toString()+\"\\n\";\n\tmsg +=\"El tipo de servicio es: \"+typeOfService+\"\\n\";\n\tmsg +=\"La cantidad de kiloWatts registrada es: \"+kiloWatts+\"\\n\";\n\tmsg +=\"Cantidad de arboles que deben plantar: \"+calculatedConsuption()+\"\\n\";\n\tmsg += \"---------------------------------------------------------\";\n\n\n return msg;\n}", "private void onConverti()\n\t{\n\n\t\tif ( !input.isCorretto() ) {\n\t\t new AlertDialog.Builder(this)\n\t\t\t .setMessage(getString(R.string.msg_coordinata_non_congruente))\n\t\t\t .setTitle(getString(R.string.app_name))\n\t\t\t .setPositiveButton(getString(R.string.ok), null)\n\t\t\t .show();\n\t\t return;\n\t\t}\n\n\n\t\t// Proietto a Gauss Roma\t\t\n\t\tRisultatoConversione risultato = new RisultatoConversione();\n\t\t\n\t\tPunto3D orig = input.getPunto();\n\t\trisultato.lat = orig.y;\n\t\trisultato.longi = orig.x;\n\t\trisultato.descrizione_punto = editLatLongDescrizione.getText().toString();\n\t\t\n\t\ttry {\n\t\t\tConversioniUtils utils = new ConversioniUtils(this, risultato);\n\t\t\tutils.conversioneInLatLongED50();\n\t\t\tutils.conversioneInGauss();\n\t\t\tutils.conversioneInCassini();\n\t\t\tutils.conversioneInUTM();\n\t\t\tutils.conversioneInMGRS();\n\t\t\tutils.conversioneInWebMercator();\n\t\t} catch(Exception e) {\n\t\t\tnew AlertDialog.Builder(this)\n\t\t\t\t.setMessage(getString(R.string.msg_coordinata_non_congruente))\n\t\t\t\t.setTitle(getString(R.string.app_name))\n\t\t\t\t.setPositiveButton(getString(R.string.ok), null)\n\t\t\t\t.show();\t\t\n\t\t\treturn;\n\t\t}\n\n\t\t// Tipo di conversione\n\t\trisultato.tipo_ingresso = \"Da Latitudine e Longitudine \";\n\t\tif (coordinataDaGps)\n\t\t{\n\t\t\trisultato.tipo_ingresso += \"(GPS)\";\n\t\t}\n\t\trisultato.initPropertiesFromContext(this);\n\t\t\n\t\t// Faccio vedere il risultato\n\t\tIntent passaggioRisultato = new Intent(this, RisultatoConversioneActivity.class);\n\t\tpassaggioRisultato.putExtra(ActivityGlobals.RISULTATO_CONVERSIONE, risultato);\n\t\tstartActivity(passaggioRisultato);\n\t}", "private String lightConversion() {\n int reading = ((record[16] & 255) + ((record[21] & 0xC0) << 2));\n //return reading + \"\";\n return formatter.format(((reading * reading) * (-.0009)) + (2.099 * reading));\n }", "public static void Promedio(){\n int ISumaNotas=0;\n int IFila=0,ICol=0;\n int INota;\n float FltPromedio;\n for(IFila=0;IFila<10;IFila++)\n {\n ISumaNotas+=Integer.parseInt(StrNotas[IFila][1]);\n }\n FltPromedio=ISumaNotas/10;\n System.out.println(\"El promedio de la clase es:\"+FltPromedio);\n }", "private String latitudeConversion() {\n int lat = record[1];\n if (lat >= 0) {\n lat = lat & 255;\n }\n lat = (lat << 8) + (record[0] & 255);\n float flat = Float.parseFloat((\"\" + lat + \".\" + (((record[3] & 255) << 8) + (record[2] & 255))));\n int degs = (int) flat / 100;\n float min = flat - degs * 100;\n String retVal = \"\" + (degs + min / 60);\n\n if (retVal.compareTo(\"200.0\") == 0) {\n return \"\";\n } else {\n return retVal;\n }\n }", "protected String decrisToi(){\r\n return \"\\t\"+this.nomVille+\" est une ville de \"+this.nomPays+ \", elle comporte : \"+this.nbreHabitants+\" habitant(s) => elle est donc de catégorie : \"+this.categorie;\r\n }", "public String toString() {\n\t\tString message;\n\t\tmessage =\"\\nNom: \"+name+\" / Latitut:\"+latitude+\" / Longitut:\"+longitude+\" \\n\"\n\t\t\t\t+\"Els 3 ultims valors de temperatura registrats (de mes actual a mes antic) son: \"+temp1+\"/\"\n\t\t\t\t+temp2+\"/\"+temp3+\"\\nEls 3 ultims valors de pluja registrats (de mes actual a mes antic) son: \"\n\t\t\t\t+rain1+\"/\"+rain2+\"/\"+rain3+\" i el total de pluja acumulat en els tres darrers registres es: \"+raint;\n\t\treturn message;\n\t}", "private String externalConversion() {\n int reading = ((record[19] & 255) + ((record[21] & 0x03) << 8));\n\n Map<String, BigDecimal> variables = new HashMap<String, BigDecimal>();\n variables.put(\"x\", new BigDecimal(reading));\n BigDecimal result = externalConversion.eval(variables);\n\n String x = result + \"\";\n\n if(this.counter){\n x = Integer.parseInt(x) * (60/rate) + \"\";\n }\n\n return x;\n }", "public static String convertirAGrados(String dato) {\n\t\tString g = \"\";\n\t\tString[] info = dato.replace(\".\", \",\").split(\",\");\n\t\tDouble min = Double.valueOf(\"0.\" + info[1]) * 60;\n\t\tString[] i = min.toString().replace(\".\", \",\").split(\",\");\n\t\tDouble seg = Double.valueOf(\"0.\" + i[1]) * 60;\n\t\tg = info[0] + \",\" + i[0] + \",\" + String.valueOf(seg.intValue());\n\t\treturn g;\n\t}", "@Override\n public void affiche(){\n System.out.println(\"Loup : \\n points de vie : \"+this.ptVie+\"\\n pourcentage d'attaque : \"+this.pourcentageAtt+\n \"\\n dégâts d'attaque : \"+this.degAtt+\"\\n pourcentage de parade :\"+this.pourcentagePar+\n \"\\n position : \"+this.pos.toString());\n\n }", "private String tempConversion() {\n int reading = ((record[17] & 255) + ((record[21] & 0x30) << 4));\n\n double voltage = (reading * 3.3) / 1024;\n return formatter.format((voltage - .6) / .01);\n\n }", "@Override\r\n\tpublic String toString()\r\n\t{\r\n\t\treturn \"Macchina a stati finiti di nome \"+nome+\", nello stato \"+corrente.getNome()+\".\";\r\n\t}", "public String messageRenvoyeeUI (int num){\r\n\t\t\r\n\t\tswitch(num){\r\n\t\t\tcase 5 : return \"-\\n\";\r\n\t\t\t\t\r\n\t\t\tcase 4 : return \"-\\n\";\r\n\t\t\t\r\n\t\t\tcase 3 : return \"-Echec de l'enregistrement des RDV\\n\";\r\n\t\t\t\r\n\t\t\tcase 2 : return \"-Enregistrement des RDV terminé\\n\";\r\n\t\t\t\r\n\t\t\tcase -1 : return \"-Un moniteur doit être selectionné pour le RDV surligné.\\n\";\r\n\t\t\t\r\n\t\t\tcase -2 : return \"-La durée du RDV surligné présente un format invalide pour son enregistrement.\\n\";\r\n\t\t\t\r\n\t\t\tcase -3 : return \"-L'horaire du RDV surligné présente un format invalide pour son enregistrement.\\n\";\r\n\t\t\t\r\n\t\t\tcase -4 : return \"-La date de RDV surligné ne peut pas être antérieur à la date actuelle\\n\";\r\n\t\t\t\r\n\t\t\tcase -5 : return \"-La date de RDV surligné présente un format invalide pour son enregistrement.\";\r\n\t\t\t\r\n\t\t\tcase -6 : return \"-L'horaire du RDV surligné est invalide : les heures sont compris entre \"+AUTO_ECOLE_OUVERTURE+\"h et \"+AUTO_ECOLE_FERMETURE+\"h\\n\";\r\n\t\t\t\r\n\t\t\tcase -7 : return \"-L'horaire du RDV surligné est invalide : les minutes sont compris entre 0 et 59.\\n\";\r\n\t\t\t\r\n\t\t\tcase -8 : return \"-Le RDV surligné est chevauché par un autre RDV.\\n\";\r\n\t\t\t\r\n\t\t\tcase -9 : return \"-\"+msgIntegriteMoniteur+\"\\n\";\r\n\t\t}\r\n\t\t\r\n\t\treturn \"\";\r\n\t\t\r\n\t}", "@Override\n public String toString()\n {\n String aDevolver= \"\";\n aDevolver += super.toString();\n aDevolver += \"potenciaCV: \" + potenciaCV + \"\\n\";\n return aDevolver;\n }", "private String peso(long peso,int i)\n {\n DecimalFormat df=new DecimalFormat(\"#.##\");\n //aux para calcular el peso\n float aux=peso;\n //string para guardar el formato\n String auxPeso;\n //verificamos si el peso se puede seguir dividiendo\n if(aux/1024>1024)\n {\n //variable para decidir que tipo es \n i=i+1;\n //si aun se puede seguir dividiendo lo mandamos al mismo metodo\n auxPeso=peso(peso/1024,i);\n }\n else\n {\n //si no se puede dividir devolvemos el formato\n auxPeso=df.format(aux/1024)+\" \"+pesos[i];\n }\n return auxPeso;\n }", "public String toString()\r\n/* 398: */ {\r\n/* 399:351 */ return \"<\" + this.t + \", \" + this.from + \", \" + this.to + \">\";\r\n/* 400: */ }", "Object obtenerPolizasPorFolioSolicitudNoCancelada(int folioSolicitud,String formatoSolicitud);", "private void adjustMessierData()\n\t{\n\t\tfor(int i = 0; i < messierList.size(); i++)\n\t\t{\n\t\t\tMessier aMessier = messierList.get(i);\n\t\t\tdouble rightAsc = aMessier.getRADecimalHour();\n\t\t\tdouble hourAngle = theCalculator.findHourAngle(rightAsc, userLocalTime);\n\t\t\taMessier.setHourAngle(hourAngle);\n\t\t\tmessierList.set(i, aMessier);\n\t\t}\n\t}", "private String getMessageDaide(){\n\t\tString message;\n\t\tmessage = \"Bonjour et bienvenue dans votre application de Gestion de l'amortissement.\\n\\n\" +\n\t\t\"Pour pouvoir generer un tableau d'amortissement il vous faudra connaitre au\\nminimum \" +\n\t\t\"3 valeurs coherentes les unes avec les autres parmis : \\n\" +\n\t\t\" - le montant emprunte\\n\" +\n\t\t\" - le taux d'emprunt\\n\" +\n\t\t\" - la duree du remboursement\\n\" +\n\t\t\" - l'annuitee maximale\\n\\n\" +\n\t\t\"Cependant, si vous souhaitez generer un tableau a partir de 4 valeurs, \\ncelles-ci devront\" +\n\t\t\" etre strictement exactes, au risque de produire une erreur.\\n\\n\" +\n\t\t\"Veuillez ensuite saisir vos valeurs ainsi que le type de remboursement \\nqui vous \" +\n\t\t\"convient puis cliquez sur valider pour generer le tableau \\nd'amortissement, ainsi que la \" +\n\t\t\"valeur inconnue si vous n'en aviez saisi que 3.\\n\\n\" +\n\t\t\"Vous avez de plus la possibilite d'exporter votre tableau d'amortissement au \\nformat Excel (.xls)\" +\n\t\t\"grace au bouton Export.\";\n\t\treturn message;\n\t}", "@Override//sobrescribir metodo\n public String getDescripcion(){\n return hamburguesa.getDescripcion()+\" + lechuga\";//retorna descripcion del oobj hamburguesa y le agrega +lechuga\n }", "@Override\n public String getMessage() {\n String chuoi=\"\";\n if (maCD.length()!=5)\n chuoi=\"MaCD bao gom 5 ki tu\";\n else if (soBaiHat<10)\n chuoi=\"So bai hat phai lon hon 10 bai\";\n return\n chuoi;\n }", "public String format(int par1) {\n\t\tdouble var2 = (double) par1 / 20.0D;\n\t\tdouble var4 = var2 / 60.0D;\n\t\tdouble var6 = var4 / 60.0D;\n\t\tdouble var8 = var6 / 24.0D;\n\t\tdouble var10 = var8 / 365.0D;\n\t\treturn var10 > 0.5D ? StatBase.getDecimalFormat().format(var10) + \" y\"\n\t\t\t\t: (var8 > 0.5D ? StatBase.getDecimalFormat().format(var8) + \" d\" : (var6 > 0.5D ? StatBase.getDecimalFormat().format(var6) + \" h\" : (var4 > 0.5D ? StatBase.getDecimalFormat().format(var4) + \" m\" : var2 + \" s\")));\n\t}", "private String soundConversion() {\n int reading = (record[18] & 255) + ((record[21] & 0x0C) << 6);\n return (reading * 100) / 1024 + \"\";\n }", "@Override\r\n public @Nullable String getFormattedText(RenderContext ctx)\r\n {\n String oorPrefix = getOORPrefix(ctx);\r\n String formattedValue = \"\";\r\n Object value = getDisplayValue(ctx);\r\n if (null != value)\r\n {\r\n formattedValue = super.getFormattedText(ctx);\r\n if (null == formattedValue)\r\n formattedValue = ConvertUtils.convert(value);\r\n }\r\n assert null != formattedValue;\r\n return oorPrefix + formattedValue;\r\n }", "public String toString( )\n\t{\n\t\treturn marca + \" \" + modelo + \" - \" + placa + \" \" + horaIngreso + \":00\";\n\t}", "@Override\npublic String toString() {// PARA MOSTRAR LOS DATOS DE ESTA CLASE\n// TODO Auto-generated method stub\nreturn MuestraCualquiera();\n}", "void format();", "void datos(ConversionesCapsula c) {\n String v;\n\n\n v = d.readString(\"Selecciona opcion de conversion\"\n + \"\\n1 ingles a metrico\"\n + \"\\n2 metrico a ingles\"\n + \"\\n3 metrico a metrico\"\n + \"\\n4 ingles a ingles\");\n c.setopc((Integer.parseInt(v)));\n int opc = (int) conversion.getopc();\n switch (opc) {\n case 1:\n v = d.readString(\"Selecciona la opcion de conversion\"\n + \"\\n1 Pies a metros\"\n + \"\\n2 Pies a centimetros\"\n + \"\\n3 Pies a Metros y Centimetros\"\n + \"\\n4 Pulgadas a metros\"\n + \"\\n5 Pulgadas a centimetros\"\n + \"\\n6 Pulgadas a Metros y Centimetros\"\n + \"\\n7 Pies y Pulgadas a metros\"\n + \"\\n8 Pies y Pulgadas a centimetros\"\n + \"\\n9 Pies y Pulgadas a Metros y Centimetros\");\n c.setopc1((Integer.parseInt(v)));\n\n\n break;\n case 2:\n v = d.readString(\"Selecciona la opcion de conversion\"\n + \"\\n1 Metros a Pies\"\n + \"\\n2 Metros a Pulgadas\"\n + \"\\n3 Metros a Pies y Pulgadas\"\n + \"\\n4 Centimetros a Pies\"\n + \"\\n5 Centimetros a Pulgadas\"\n + \"\\n6 Centimetros a Pies y Pulgadas\"\n + \"\\n7 Metros y Centimetros a Pies\"\n + \"\\n8 Metros y Centimetros a Pulgadas\"\n + \"\\n9 Metros y Centimetros a Pies y Pulgadas\");\n c.setopc1((Integer.parseInt(v)));\n break;\n case 3:\n v = d.readString(\"Selecciona la opcion de conversion\"\n + \"\\n1 Metros a Centimetros\"\n + \"\\n2 Metros a Metros y Centimetros\"\n + \"\\n3 Centimetros a Metros\"\n + \"\\n4 Centimetros a Metros y Centimetros\"\n + \"\\n5 Metros y Centimetros a Centimetros\"\n + \"\\n9 Metros y Centimetros a Metros\");\n c.setopc1((Integer.parseInt(v)));\n break;\n case 4:\n v = d.readString(\"Selecciona la opcion de conversion\"\n + \"\\n1 Pies a Pulgadas\"\n + \"\\n2 Pies a Pies y Pulgadas\"\n + \"\\n3 Pulgadas a Pies\"\n + \"\\n4 Pulgadas a Pies y Pulgadas\"\n + \"\\n5 Pies y Pulgadas a Pies\"\n + \"\\n9 Pies y Pulgadas a Pulgadas\");\n c.setopc1((Integer.parseInt(v)));\n break;\n }\n\n do v = d.readString(\"\\n Ingrese el valor: \\n\");\n while (!isNum(v));\n c.setvalor((Double.parseDouble(v)));\n }", "public String toString(){\n return \"Format: \" + format +\", \" + super.toString(); \n }", "private static String formatFamilyMember (FamilyMemberGuest fmg, Date arrivo, int permanenza) {\n\t\tString res = \"\";\n\n\t\tres += FamilyMemberGuest.CODICE;\n\t\tres += DateUtils.format(arrivo);\n\t\tres += String.format(\"%02d\", permanenza);\n\t\tres += padRight(fmg.getSurname().trim().toUpperCase(),50);\n\t\tres += padRight(fmg.getName().trim().toUpperCase(),30);\n\t\tres += fmg.getSex().equals(\"M\") ? 1 : 2;\n\t\tres += DateUtils.format(fmg.getBirthDate());\n\n\t\t//Setting luogo et other balles is a bit more 'na rottura\n\t\tres += formatPlaceOfBirth(fmg.getPlaceOfBirth());\n\n\t\tPlace cita = fmg.getCittadinanza(); //banana, box\n\t\tres += cita.getId();\n\t\t//Assert.assertEquals(168,res.length()); //if string lenght is 168 we are ok\n\t\tres += padRight(\"\", 34);\n\t\tres += \"\\r\\n\";\n\n\t\treturn res;\n\t}", "@Override\n protected String createEntityAsString(Message entity) {\n String stringToIds = \"\";\n List<User> listUsers = entity.getTo();\n for (User friend : listUsers) {\n stringToIds += friend.getId() + \",\";\n }\n if (stringToIds.length() >= 1)\n stringToIds = stringToIds.substring(0, stringToIds.length() - 1);\n String messageAttributes = \"\";\n messageAttributes += entity.getId() + \";\" +\n entity.getFrom().getId() + \";\" +\n stringToIds + \";\" +\n entity.getMessage() + \";\" +\n entity.getDate().format(Constants.DATE_TIME_FORMATTER);\n return messageAttributes;\n }", "private String geraMensagem(Mensagem msg) {\n\t\treturn new StringBuilder()\n\t\t\t.append(msg.remetente.nome)\n\t\t\t.append(\" enviou para \")\n\t\t\t.append(msg.destinatario.nome)\n\t\t\t.append(\" uma mensagem suspeita.\")\n\t\t\t.toString();\n\t}", "@Override\r\n public void convert(int wa) {\n hasil1 = wa / menit;\r\n String wat = Integer.toString(hasil1);\r\n hasil = wat + \" Menit \";\r\n }", "public String conversion() {\n try {\n transactionFailure = null;\n amountConverted = converterFacade.conversion(fromCurrencyCode,\n toCurrencyCode, amountToConvert);\n } catch (Exception e) {\n handleException(e);\n }\n return jsf22Bugfix();\n }", "@Override\n public String toString() {\n return \"@(\"+x+\"|\"+y+\") mit Bewegung: \"+bewegung;\n }", "public String toString(){\n\t\tString s = \"\";\n\t\ts += \"El deposito de la moneda \"+nombreMoneda+\" (\" +valor+ \" centimos) contiene \"+cantidad+\" monedas\\n\";\n\t\treturn s;\n\t}", "private static String formatFamily (FamilyCard fc) {\n\t\tString res = \"\";\n\n\t\tFamilyHeadGuest fhg = fc.getCapoFamiglia();\n\t\tres += FamilyHeadGuest.CODICE;\n\t\tres += DateUtils.format(fc.getDate());\n\t\tres += String.format(\"%02d\", fc.getPermanenza());\n\t\tres += padRight(fhg.getSurname().trim().toUpperCase(),50);\n\t\tres += padRight(fhg.getName().trim().toUpperCase(),30);\n\t\tres += fhg.getSex().equals(\"M\") ? 1 : 2;\n\t\tres += DateUtils.format(fhg.getBirthDate());\n\n\t\t//Setting luogo et other balles is a bit more 'na rottura\n\t\tres += formatPlaceOfBirth(fhg.getPlaceOfBirth());\n\n\t\tPlace cita = fhg.getCittadinanza(); //banana, box\n\t\tres += cita.getId();\n\n\t\tres += fhg.getDocumento().getDocType().getCode();\n\t\tres += padRight(fhg.getDocumento().getCodice(),20);\n\t\tres += fhg.getDocumento().getLuogoRilascio().getId();\n\t\t//Assert.assertEquals(168,res.length()); //if string lenght is 168 we are ok\n\t\tres += \"\\r\\n\";\n\n\t\tfor (FamilyMemberGuest fmg : fc.getFamiliari()){\n\t\t\tres += formatFamilyMember(fmg, fc.getDate(), fc.getPermanenza());\n\t\t\t//res += \"\\r\\n\";\n\t\t}\n\n\t\treturn res;\n\t}", "java.lang.String getMoodMessage();", "@Override\r\n public String toString() {\r\n return pontosTimeMandante + \" x \" + pontosTimeVisitante + \" - \" + (isFinalizado() ? \"Finalizado\" : \"Em andamento\");\r\n }", "private String formatarData(Date data)\n {\n String sDate;\n String sDia = \"\";\n String sMes = \"\";\n\n GregorianCalendar calendar = new GregorianCalendar();\n calendar.setTime(data);\n int dia = calendar.get(GregorianCalendar.DAY_OF_MONTH);\n if (dia > 0) {\n if (dia < 10) {\n sDia = \"0\";\n }\n }\n sDia += dia;\n\n int mes = calendar.get(GregorianCalendar.MONTH);\n mes = mes + 1;\n if (mes > 0) {\n if (mes < 10) {\n sMes = \"0\";\n }\n }\n sMes += mes;\n\n int ano = calendar.get(GregorianCalendar.YEAR);\n\n int hora = calendar.get(GregorianCalendar.HOUR);\n // 0 = dia\n // 1 = noite\n int amPm = calendar.get(GregorianCalendar.AM_PM);\n\n if(amPm == 1)\n {\n if(hora>0 && hora < 13)\n {\n if(hora > 11)\n hora = 0;\n else\n hora += 12;\n }\n }\n\n String sHora = \" \";\n if(hora<=9)\n {\n sHora += \"0\";\n }\n String sMin=\":\";\n int min = calendar.get(GregorianCalendar.MINUTE);\n if(min <10)\n sMin += \"0\";\n sMin += String.valueOf(min);\n sHora += String.valueOf(hora) + sMin + \":00\";\n sDate = String.valueOf(ano) + \"-\" + sMes + \"-\" + sDia + sHora;\n return sDate;\n\n }", "public void convertiButton(View view){\n\n //log per controllare il funzionamento del bottone\n Log.i(\"Stato Botone\",\"Premuto\");\n\n //creo una variabile che associo il numero inserito nella barra di text viev\n //cercando l'input tramite id.\n EditText valuta=(EditText) findViewById(R.id.numeroConvertire);\n\n //con questo log riesco a controllare il valore inserito dall'utente\n Log.i(\"Il valore inserito\",valuta.getText().toString());\n\n //Assrgno il valore della variabile valuta alla stringa ammountEuroString.\n String ammoutEuroStringa=valuta.getText().toString();\n\n //converto la stringa in un Double con il metodo parseDouble\n double ammoutnEuroDouble=Double.parseDouble(ammoutEuroStringa);\n\n //effettuo le varie conversioi utilizzando il valore convertito in double\n double ammoutDollari=ammoutnEuroDouble*1.3;\n\n double ammountYen=ammoutnEuroDouble*3.4;\n\n double ammountYuhan=ammoutnEuroDouble*10.4;\n\n //il Toast mi consente di restituire il valore convertito.\n Toast.makeText(this,\"il valore da\"+\" Euro a dollari é=\"+ammoutDollari,Toast.LENGTH_SHORT).show();\n\n Toast.makeText(this,\"il valore da\"+\" Euro a Yen é=\"+ammountYen,Toast.LENGTH_SHORT).show();\n\n Toast.makeText(this,\"il valore da\"+\" Euro a Yuhan é=\"+ammountYuhan,Toast.LENGTH_SHORT).show();\n\n }", "@Override\npublic final String toString() {\n\t if(shortFormat) {\n\t\t return toShortString();\n\t }\n if (calValue != null) {\n return dfMedium.get().format(calValue.getTime());\n }\n else {\n return \"\";\n }\n }", "public String toString(){\n return \"+-----------------------+\\n\" +\n \"| Boleto para el metro |\\n\" +\n \"|derjere0ranfeore |\\n\" +\n \"+-----------------------+\\n\" ;\n }", "private String FormatoHoraDoce(String Hora){\n String HoraFormateada = \"\";\n\n switch (Hora) {\n case \"13\": HoraFormateada = \"1\";\n break;\n case \"14\": HoraFormateada = \"2\";\n break;\n case \"15\": HoraFormateada = \"3\";\n break;\n case \"16\": HoraFormateada = \"4\";\n break;\n case \"17\": HoraFormateada = \"5\";\n break;\n case \"18\": HoraFormateada = \"6\";\n break;\n case \"19\": HoraFormateada = \"7\";\n break;\n case \"20\": HoraFormateada = \"8\";\n break;\n case \"21\": HoraFormateada = \"9\";\n break;\n case \"22\": HoraFormateada = \"10\";\n break;\n case \"23\": HoraFormateada = \"11\";\n break;\n case \"00\": HoraFormateada = \"12\";\n break;\n default:\n int fmat = Integer.parseInt(Hora);\n HoraFormateada = Integer.toString(fmat);\n }\n return HoraFormateada;\n }", "private static String getConversionString(List<Term> conversion) {\n StringBuilder stepsString = new StringBuilder();\n stepsString.append(\"Conversion: \\n\");\n for (int i = 0; i < conversion.size(); i++) {\n stepsString.append(conversion.get(i));\n\n if (i < conversion.size() - 1) {\n stepsString.append(\" = \\n\");\n }\n }\n\n return stepsString.toString();\n }", "@Override\n public String toString() {\n return \"EnviarMensajeProposeUpdatedDemandForecast\";\n }", "public void testTextContentWithFormatAndConverterTypeDTO() {\n TextContentWithFormatAndConverterTypeTestDTO obj = new TextContentWithFormatAndConverterTypeTestDTO();\n obj.textContent = getDateForFormatAndConverter(\"28.02.2007:15:21:27\");\n assertTrue(JSefaTestUtil.serialize(XML, obj).indexOf(\"2007-02-28T14:21:27.000-01:00\") >= 0);\n }", "public void majInformation (String typeMessage, String moduleMessage, String corpsMessage) {\n Date date = new Date();\n listMessageInfo.addFirst(dateFormat.format(date)+\" - \"+typeMessage+\" - \"+moduleMessage+\" - \"+corpsMessage);\n }", "@Override\r\n public String toString() {\r\n return \"Mesa{\" + \"ubicacionSucursal=\" + ubicacionSucursal + \", numeroMesa=\" + numeroMesa + \", numeroPiso=\" + numeroPiso + '}';\r\n }", "private void convertLabelsToInt(){\n String sec = tSec.getText();\n sec = sec.replaceAll(\"[^0-9\\\\s+]\", \"\");\n seconds = Integer.parseInt(sec.trim());\n \n String min = tMin.getText();\n min = min.replaceAll(\"[^0-9\\\\s+]\", \"\");\n minutes = Integer.parseInt(min.trim());\n \n String hour = tHours.getText();\n hour = hour.replaceAll(\"[^0-9\\\\s+]\", \"\");\n hours = Integer.parseInt(hour.trim());\n }", "private String longitudeConversion() {\n int lon = record[5];\n if (lon >= 0) {\n lon = lon & 255;\n }\n lon = (lon << 8) + (record[4] & 255);\n float flon = Float.parseFloat(\"\" + lon + \".\" + (((record[7] & 255) << 8) + (record[6] & 255)));\n int degs = (int) flon / 100;\n float min = flon - degs * 100;\n String retVal = \"\" + (degs + min / 60);\n\n if (retVal.compareTo(\"200.0\") == 0) {\n return \"\";\n } else {\n return retVal;\n }\n }", "public String toString()\n\t{\n\t\tif (m_nType == AT_NONE)\n\t\t\treturn \"ERROR\";\n\n\t\tString str;\n\n\t\t//Format : <type>,<title>,<time>,<zone>,[<date>|<week day>|<month date>]\n\t\t//Time is in \"hh:mm\" format; Date in \"mm-dd-yyyy\" format\n\n\t\tstr = Integer.toString(m_nType);\n\t\tstr = str + FIELD_SEP;\n\n\t\tstr = str + m_strTitle;\n\t\tstr = str + FIELD_SEP;\n\n\t\tstr = str + Integer.toString(m_nTimeHour);\n\t\tstr = str + TIME_SEP;\n\t\tstr = str + Integer.toString(m_nTimeMin);\n\t\tstr = str + FIELD_SEP;\n\t\tstr = str + m_strTimeZone;\n\n\t\tif (m_oData != null)\n\t\t\tstr = str + FIELD_SEP;\n\n\t\tif (m_nType == AT_DATE)\n\t\t\tstr = str + GValidator.DateToString((Date)m_oData);\n\t\telse if (m_nType == AT_WEEK_DAY || m_nType == AT_MONTH_DATE)\n\t\t\tstr = str + ((Integer)m_oData).toString();\n\n\t\treturn str;\n\t}", "public String getReceived(){\n String rec;\n if (received == Received.ON_TIME){\n rec = \"On Time\";\n }else if(received == Received.LATE){\n rec = \"Late\";\n }else if(received == Received.NO){\n rec = \"NO\";\n }else{\n rec = \"N/A\";\n }\n return rec;\n }", "public String getMessage(){\n String messageOut=\"Error\";\n if(this.akun instanceof Savings && akun instanceof Investment==false){\n messageOut=\"Savings\";\n }\n else if (this.akun instanceof Investment && akun instanceof Investment==true){\n messageOut=\"Investment\";\n }\n else if (this.akun instanceof LineOfCredit){\n messageOut=\"Line-Of-Credit\";\n }\n else if (this.akun instanceof OverDraftProtection){\n messageOut=\"Overdraft\";\n }\n return super.getMessage()+ messageOut;\n }", "protected String obterData(String format) {\n\t\tDateFormat formato = new SimpleDateFormat(format);\n\t\tDate data = new Date();\n\t\treturn formato.format(data).toString();\n\t}", "public void afficherMessage () {\r\n System.out.println(\"(\"+valeur+\", \"+type+\")\"); \r\n }", "@RequiresApi(api = Build.VERSION_CODES.O)\n public String obtenerMes(){\n this.mes = java.time.LocalDateTime.now().toString().substring(5,7);\n return this.mes;\n\n }", "private String altitudeConversion() {\n int reading = ((record[9] & 255) << 8) + (record[8] & 255);\n if (reading == 60000) {\n return \" \";\n } else {\n return reading + \"\";\n }\n }", "private void remplirTabNewMess(){\n\t\tCalendar date = Calendar.getInstance();\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);\n\n\t\tString passage[]= new String[7];\n\n\t\tpassage[0]=tab[2]; //sender\n\t\tpassage[1]=tab[1]; //recep\n\t\tpassage[2]=tab[4]; //obj\n\t\tpassage[3]=tab[3]; //txt\n\t\tpassage[4]=\"0\"; //importance\n\t\tpassage[5]=sdf.format(date.getTime()); //date\n\t\tpassage[6]=\"1\"; //non lu\n\n\t\tmessages.add((String[])passage);\n\t\tthis.send(messages);\n\t\tmessagerie.Server.con.closeSocket();\n\n\t}", "private String accelConversion() {\n int reading = record[15] & 255;\n double voltage = (reading * 3.33) / 256;\n //return formatter.format(reading);\n return formatter.format((voltage / .290)*9.806);\n }", "@Override\r\n\tpublic void onReaded(String conversionId, String msgTime) {\n\t}", "String getFormattedString(IRenamable f);", "public String getFormat() {\n/* 206 */ return getValue(\"format\");\n/* */ }", "public String getNombreCasta() {\n\t\treturn this.nombreCasta;\n\t}", "private void formatSystem() {}", "private String getAlertaPorValor(Evento ultimoEvento)\n\t{\n\t\t// O alerta padrao sera o status OK, dependendo do valor do atraso esse alerta pode ser modificado\n\t\tString alerta = Alarme.ALARME_OK;\n\n\t\t// Verifica se o contador classifica como alerta\n\t\tdouble valor = ultimoEvento.getValorContador();\n\t\t// Verifica se o contador classifica como alerta pelo valor minimo ou maximo\n\t\tif ( valor > alarme.getValorMinFalha() && valor < alarme.getValorMinAlerta() )\n\t\t{\n\t\t\talerta = Alarme.ALARME_ALERTA;\n\t\t\talarme.setMotivoAlarme(Alarme.MOTIVO_VALOR_MIN);\n\t\t}\n\t\telse if ( valor > alarme.getValorMaxAlerta() && valor < alarme.getValorMaxFalha() )\n\t\t\t{\n\t\t\t\talerta = Alarme.ALARME_ALERTA;\n\t\t\t\talarme.setMotivoAlarme(Alarme.MOTIVO_VALOR_MAX);\n\t\t\t}\n\n\t\t// Verifica se o contador classifica como falha. Devido a hierarquia de erro\n\t\t// o teste para falha e feito posterior pois logicamente tem uma gravidade superior\n\t\tif ( valor < alarme.getValorMinFalha() )\n\t\t{\n\t\t\talerta = Alarme.ALARME_FALHA;\n\t\t\talarme.setMotivoAlarme(Alarme.MOTIVO_VALOR_MIN);\n\t\t}\n\t\telse if ( valor > alarme.getValorMaxFalha() )\n\t\t\t{\n\t\t\t\talerta = Alarme.ALARME_FALHA;\n\t\t\t\talarme.setMotivoAlarme(Alarme.MOTIVO_VALOR_MAX);\n\t\t\t}\n\n\t\tlogger.debug(alarme.getIdAlarme()+\" - Contador:\"+valor);\n\t\treturn alerta;\n\t}", "public abstract String format(T t);", "private String formatearMonto(String gstrLBL_TIPO, String gstrLBL_MONTO, String gstrLBL_MONEDA) {\n\t\tString montoFormateado=\"\";\n\t\t\n\t\tif(gstrLBL_MONEDA.equals(\"Soles\"))\n\t\t\tmontoFormateado=\"S/ \";\n\t\telse\n\t\t\tmontoFormateado=\"$ \";\n\t\t\n\t\tif(gstrLBL_TIPO.equals(\"Débito\"))\n\t\t\tmontoFormateado=montoFormateado+\"-\";\n\t\telse\n\t\t\tmontoFormateado=montoFormateado+\"+\";\n\t\t\n\t\tdouble prueba2=new Double(gstrLBL_MONTO);\n\t\tDecimalFormatSymbols simbolo=new DecimalFormatSymbols();\n\t\tsimbolo.setGroupingSeparator(',');\n\t\tsimbolo.setDecimalSeparator('.');\n\t\tDecimalFormat formatea=new DecimalFormat(\"###,###.##\",simbolo);\n\t\tgstrLBL_MONTO=formatea.format(prueba2);\n\t\tif(gstrLBL_MONTO.indexOf(\".\")!=-1){\n\t\t\tint decimales=(gstrLBL_MONTO.substring(gstrLBL_MONTO.indexOf(\".\")+1,gstrLBL_MONTO.length())).length();\n\t\t\tif(decimales==1)\n\t\t\t\tgstrLBL_MONTO=gstrLBL_MONTO+\"0\";\n\t\t}else\n\t\t\tgstrLBL_MONTO=gstrLBL_MONTO+\".00\";\n\t\t\n\t\tmontoFormateado=montoFormateado+gstrLBL_MONTO;\n\t\t\n\t\treturn montoFormateado;\n\t}", "public void RealizarDiagnostico() {\n\t\tSystem.out.println(\"realizar dicho diagnostico con los sintomas presentados por el paciente\");\r\n\t}" ]
[ "0.61598575", "0.56428015", "0.5632667", "0.5540711", "0.55390096", "0.55380964", "0.55292153", "0.55157954", "0.5489099", "0.5472298", "0.5441017", "0.5429548", "0.5422333", "0.542213", "0.54067314", "0.5361307", "0.53371626", "0.53319085", "0.52792996", "0.52748394", "0.52632684", "0.5258842", "0.5258821", "0.5258739", "0.5246776", "0.5243409", "0.5242046", "0.5240543", "0.52275205", "0.5218582", "0.5182998", "0.5179454", "0.51777077", "0.51565236", "0.5132922", "0.5129332", "0.5126114", "0.5124062", "0.5120795", "0.5118282", "0.5110492", "0.5106244", "0.50961155", "0.5092463", "0.508837", "0.5087337", "0.5087304", "0.50817734", "0.5080091", "0.5076201", "0.50714153", "0.5060325", "0.50495297", "0.50491774", "0.504829", "0.50465536", "0.5043712", "0.5023174", "0.5022306", "0.5014635", "0.5010255", "0.499138", "0.49833086", "0.49799168", "0.4975115", "0.49732336", "0.4971847", "0.49715707", "0.4966835", "0.4965829", "0.49627817", "0.49616507", "0.49606642", "0.4957806", "0.4957411", "0.4952112", "0.49447605", "0.49428663", "0.49392837", "0.4934294", "0.49336416", "0.49220777", "0.49196967", "0.49107015", "0.49003208", "0.4899088", "0.4897547", "0.4885851", "0.48852694", "0.4882904", "0.4882711", "0.48738965", "0.48730403", "0.48683518", "0.48645365", "0.48618543", "0.4860135", "0.48494872", "0.4847108", "0.48421663", "0.48381618" ]
0.0
-1
Carica un copione, aggiornando lo stato di tutti i tablet
public void caricaCopione(Scena scena) { // recupera l'elenco delle battute ArrayList<Battuta> copione = scena.getBattute(); aggiornaMappeColori(scena); // per ogni battuta for (int i = 0; i < copione.size(); i++) { invia(copione.get(i)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void copiarComprobanteContabilidad() {\r\n if (!tab_tabla1.isFilaInsertada()) {\r\n TablaGenerica tab_cabecera = ser_comprobante.getCabeceraComprobante(tab_tabla1.getValorSeleccionado());\r\n TablaGenerica tab_detalle = ser_comprobante.getDetallesComprobante(tab_tabla1.getValorSeleccionado());\r\n tab_tabla1.insertar();\r\n tab_tabla1.setValor(\"IDE_MODU\", tab_cabecera.getValor(\"IDE_MODU\"));\r\n tab_tabla1.setValor(\"IDE_GEPER\", tab_cabecera.getValor(\"IDE_GEPER\"));\r\n tab_tabla1.setValor(\"OBSERVACION_CNCCC\", tab_cabecera.getValor(\"OBSERVACION_CNCCC\"));\r\n tab_tabla1.setValor(\"ide_cntcm\", tab_cabecera.getValor(\"ide_cntcm\"));\r\n for (int i = 0; i < tab_detalle.getTotalFilas(); i++) {\r\n tab_tabla2.insertar();\r\n tab_tabla2.setValor(\"IDE_CNLAP\", tab_detalle.getValor(i, \"IDE_CNLAP\"));\r\n tab_tabla2.setValor(\"IDE_CNDPC\", tab_detalle.getValor(i, \"IDE_CNDPC\"));\r\n tab_tabla2.setValor(\"VALOR_CNDCC\", tab_detalle.getValor(i, \"VALOR_CNDCC\"));\r\n tab_tabla2.setValor(\"OBSERVACION_CNDCC\", tab_detalle.getValor(i, \"OBSERVACION_CNDCC\"));\r\n }\r\n calcularTotal();\r\n utilitario.addUpdate(\"gri_totales\");\r\n } else {\r\n utilitario.agregarMensajeInfo(\"No se puede copiar el comprobante de contabilidad\", \"El comprobante seleccionado no se encuentra grabado\");\r\n }\r\n }", "public void copiaImg() {\r\n\t\t\r\n\t\ttry {\r\n\t\t\tString tipo = caminhoImagem.replaceAll(\".*\\\\.\", \"\");\r\n\t\t\tSystem.out.println(tipo);\r\n\t\t\tString l = caminhoImagem;\r\n\t\t\tString i = \"../MASProject/imagens/\" + idObra.getText() + \".\" + tipo;\r\n\t\t\tcaminhoImagem = i;\r\n\t\t\t@SuppressWarnings(\"resource\")\r\n\t\t\tFileInputStream fisDe = new FileInputStream(l);\r\n\t\t\t@SuppressWarnings(\"resource\")\r\n\t\t\tFileOutputStream fisPara = new FileOutputStream(i);\r\n\t\t\tFileChannel fcPara = fisDe.getChannel();\r\n\t\t\tFileChannel fcDe = fisPara.getChannel();\r\n\t\t\tif (fcPara.transferTo(0, fcPara.size(), fcDe) == 0L) {\r\n\t\t\t\tfcPara.close();\r\n\t\t\t\tfcDe.close();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tJOptionPane.showMessageDialog(null, e);\r\n\t\t}\r\n\t}", "private void copiaTabuleiro () {\n\t\tTabuleiro tab = Tabuleiro.getTabuleiro ();\n\t\t\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tfor (int j = 0; j < 8; j++)\n\t\t\t\tCasa.copia (casa[i][j], tab.getCasa (i, j));\n\t\t}\n\t}", "public void moverCeldaArriba(){\n if (laberinto.celdas[item.x][item.y-1].tipo != 'O' && laberinto.celdas[item.x][item.y-1].tipo !='J'&& laberinto.celdas[item.x][item.y-1].tipo !='P' && laberinto.celdas[item.x][item.y-1].tipo !='A') {\n laberinto.celdas[item.x][item.y].tipo = 'V';\n item.y=item.y-1;\n laberinto.celdas[item.x][item.y].tipo = 'I';\n }\n if (laberinto.celdas[item.x][item.y-1].tipo == 'C') {\n \n laberinto.celdas[item.x][item.y].tipo = 'V';\n laberinto.celdas[anchuraMundoVirtual/2][alturaMundoVirtual/2].tipo = 'I';\n \n player1.run();\n player2.run();\n }\n /* if (item.y > 0) {\n if (laberinto.celdas[item.x][item.y-1].tipo != 'O' && laberinto.celdas[item.x][item.y-1].tipo !='J' && laberinto.celdas[item.x][item.y-1].tipo !='A') {\n if (laberinto.celdas[item.x][item.y-1].tipo == 'I') {\n if (item.y-2 > 0) {\n laberinto.celdas[item.x][item.y-2].tipo = 'I';\n laberinto.celdas[item.x][item.y-1].tipo = 'V';\n }\n }else{\n laberinto.celdas[item.x][item.y].tipo = 'V';\n item.y=item.y-1;\n laberinto.celdas[item.x][item.y].tipo = 'I';\n // laberinto.celdas[item.x][item.y].indexSprite=Rand_Mod_Sprite()+3;\n } \n } \n }*/\n }", "public void anuncio() {\n\n\t\tapp.image(pantallaEncontrado, 197, 115, 300, 150);\n\n\t\tapp.image(botonContinuar, 253, 285);\n\n\t}", "public void start() {\n boolean continua = true;\n Dati datiRMP;\n int codPiatto;\n int codRiga;\n int quantiCoperti;\n int quanteComande;\n String descPiatto;\n String catPiatto;\n Modulo modRMP = RMPModulo.get();\n Modulo modPiatto = PiattoModulo.get();\n Modulo modCategoria = CategoriaModulo.get();\n ModuloRisultati modRisultati = getModuloRisultati();\n Campo chiaveRMP;\n int codRMP;\n int codMenu;\n int[] codici;\n double qtaOff;\n double qtaCom;\n double gradimento = 0.0;\n PanCoperti panCoperti;\n\n try { // prova ad eseguire il codice\n\n /* azzera il numero di coperti serviti */\n panCoperti = getPanCoperti();\n panCoperti.setNumCopertiPranzo(0);\n panCoperti.setNumCopertiCena(0);\n\n /* svuota i dati del modulo risultati */\n getModuloRisultati().query().eliminaRecords();\n\n datiRMP = this.getDati();\n chiaveRMP = modRMP.getCampoChiave();\n\n /* spazzola le RMP trovate */\n for (int k = 0; k < datiRMP.getRowCount(); k++) {\n\n this.quanti++;\n\n codRMP = datiRMP.getIntAt(k, chiaveRMP);\n codPiatto = datiRMP.getIntAt(k, modRMP.getCampo(RMP.CAMPO_PIATTO));\n descPiatto = datiRMP.getStringAt(k,\n modPiatto.getCampo(Piatto.CAMPO_NOME_ITALIANO));\n catPiatto = datiRMP.getStringAt(k,\n modCategoria.getCampo(Categoria.CAMPO_SIGLA));\n\n codRiga = addPiatto(codPiatto, descPiatto, catPiatto);\n\n if (codRiga <= 0) {\n continua = false;\n break;\n }// fine del blocco if\n\n /* incrementa di 1 il numero di volte in cui il piatto è stato proposto\n * per questa riga risultati */\n incrementaCampo(codRiga, Campi.Ris.quanteVolte, 1);\n\n /* determina il numero dei coperti presenti nel menu al\n * quale questa RMP appartiene */\n codMenu = datiRMP.getIntAt(k, modRMP.getCampo(RMP.CAMPO_MENU));\n quantiCoperti = getQuantiCoperti(codMenu);\n\n /* incrementa il numero di coperti potenziali per questa riga risultati */\n incrementaCampo(codRiga, Campi.Ris.quantiCoperti, quantiCoperti);\n\n /* determina il numero di comande effettuate\n * per questa RMP */\n quanteComande = getQuanteComande(codRMP);\n\n /* incrementa il numero di comande effettuate per questa riga risultati */\n incrementaCampo(codRiga, Campi.Ris.quanteComande, quanteComande);\n\n /* interruzione nella superclasse */\n if (super.isInterrompi()) {\n continua = false;\n break;\n }// fine del blocco if\n\n } // fine del ciclo for\n\n /* spazzola le righe dei risultati per regolare il gradimento */\n if (continua) {\n codici = modRisultati.query().valoriChiave();\n for (int k = 0; k < codici.length; k++) {\n codRiga = codici[k];\n gradimento = 0.0;\n qtaOff = modRisultati.query()\n .valoreDouble(Campi.Ris.quantiCoperti.getCampo(), codRiga);\n qtaCom = modRisultati.query()\n .valoreDouble(Campi.Ris.quanteComande.getCampo(), codRiga);\n if (qtaOff != 0) {\n gradimento = qtaCom / qtaOff;\n gradimento = Lib.Mat.arrotonda(gradimento, 4);\n }// fine del blocco if\n modRisultati.query().registraRecordValore(codRiga,\n Campi.Ris.gradimento.getCampo(),\n gradimento);\n } // fine del ciclo for\n }// fine del blocco if\n\n datiRMP.close();\n\n getNavigatore().aggiornaLista();\n\n /* aggiorna il numero di coperti serviti */\n Filtro filtro;\n Number numero;\n Modulo moduloRMT = RMTModulo.get();\n Filtro filtroMenu = getFiltroMenu();\n Filtro filtroPranzo = FiltroFactory.crea(MenuModulo.get().getCampo(Menu.Cam.pasto), Ristorante.COD_DB_PRANZO);\n Filtro filtroCena = FiltroFactory.crea(MenuModulo.get().getCampo(Menu.Cam.pasto), Ristorante.COD_DB_CENA);\n filtro = new Filtro();\n filtro.add(filtroMenu);\n filtro.add(filtroPranzo);\n numero = moduloRMT.query().somma(RMT.Cam.coperti.get(), filtro);\n panCoperti.setNumCopertiPranzo(Libreria.getInt(numero));\n filtro = new Filtro();\n filtro.add(filtroMenu);\n filtro.add(filtroCena);\n numero = moduloRMT.query().somma(RMT.Cam.coperti.get(), filtro);\n panCoperti.setNumCopertiCena(Libreria.getInt(numero));\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n }", "public void getSconti() {\r\n\t\tsconti = ac.getScontiDisponibili();\r\n\t\t//la tabella sara' non nulla quando sara' caricato il file VisualizzaLog.fxml\r\n\t\tif(tabellaSconti!= null) {\r\n\t\t\tvaloreScontiCol.setCellValueFactory(new PropertyValueFactory<Sconto, Integer>(\"valore\"));\r\n\t puntiRichiestiCol.setCellValueFactory(new PropertyValueFactory<Sconto, String>(\"puntiRichiesti\"));\r\n\t spesaMinimaCol.setCellValueFactory(new PropertyValueFactory<Sconto, String>(\"spesaMinima\"));\r\n\t \r\n\t Collections.sort(sconti);\r\n\t tabellaSconti.getItems().setAll(sconti);\r\n\t \r\n\t tabellaSconti.setOnMouseClicked(e -> {\r\n\t \tif(aggiungi.isDisabled() && elimina.isDisabled()) \r\n\t \t\ttotale.setText(\"\" + ac.applicaSconto(tabellaSconti.getSelectionModel().getSelectedItem()));\r\n\t });\r\n\t }\r\n\t}", "public void copiar() {\n for (int i = 0; i < F; i++) {\n for (int j = 0; j < C; j++) {\n old[i][j]=nou[i][j];\n }\n }\n }", "@Override\n\tpublic void doCommand() {\n\t\tif (device==null) { /// uslov da se napravi samo ako nije bio napravljen, ako je bio napravljen dodace se\n\t\t\tif (deviceType==PageView.CIRCLE){\n\t\t\t\tdevice=CircleElement.createDefault(lastPosition,model.getElementCount());\n\t\t\t\t\n\t\t\t}else if (deviceType==PageView.RECTANGLE){\n\t\t\t\tdevice=RectangleElement.createDefault(lastPosition,model.getElementCount());\n\t\t\t\t\n\t\t\t}else if(deviceType==PageView.TRIANGLE) {\n\t\t\t\tdevice=TriangleElement.createDefault(lastPosition, model.getElementCount());\n\t\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t}\n\t\tselectionModel.removeAllFromSelectionList();\n\t\tmodel.addDiagramElement(device);\n\t\tselectionModel.addToSelectionList(device);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public void modificarCompraComic();", "public static void copyCat() throws IOException {\n byte[] bytes = Files.readAllBytes(Paths.get(RESOURCES_FOLDER + \"\\\\cat.jpeg\"));\n FileInputStream inputStream = new FileInputStream(RESOURCES_FOLDER + \"\\\\cat.jpeg\");\n FileOutputStream outputStream = new FileOutputStream(COPY_FOLDER + \"\\\\cat_copy.jpeg\");\n// outputStream.write(bytes);\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); // cand nu avem nevoie sa cream fisierul - ci doar sa mutam dintr o parte in alta bytes\n byteArrayOutputStream.write(bytes);\n byteArrayOutputStream.writeTo(outputStream);\n inputStream.close();\n byteArrayOutputStream.close();\n outputStream.close();\n }", "@Override\r\n\t/**\r\n\t * Actionne l'effet de la carte.\r\n\t * \r\n\t * @param listejoueur\r\n\t * \t\t\tLa liste des joueurs de la partie.\r\n\t * @param cible\r\n\t * \t\t\tLa joueur contre qui l'effet sera joué.\r\n\t * @param table\r\n\t * \t\t\tCollection de cartes situées au centre de la table de jeu.\r\n\t * @param carte\r\n\t * \t\t\tLa carte qui joue l'effet.\r\n\t * @param j\r\n\t * \t\t\tLe joueur qui joue la carte.\r\n\t * @param collection\r\n\t * \t\t\tLe deck de cartes.\r\n\t * @param tourjoueur\r\n\t * \t\t\tLa liste des joueurs selon l'ordre de jeu.\r\n\t */\r\n\tpublic void utiliserEffet(ArrayList<Joueur> listejoueur, int cible, ArrayList<Carte> table, Carte carte,\r\n\t\t\tint j, ArrayList<Carte> collection,ArrayList<Joueur> tourjoueur) {\n\t\tcont = Controller.getInstance();\r\n\t\tint id = carte.getIdentifiantCarte();\r\n\t\tif (id ==9 || id ==10 || id==22 || id==23){\r\n\t\t\tif (tourjoueur.get(j) == listejoueur.get(0)){\r\n\t\t\t\tSystem.out.println(\"Choisissez le Divinité qui sera forcer de sacrifier un croyant\");\r\n\t\t\t\t\r\n\t\t\t\tcont.setChoisirCible(true);\r\n\t\t\t\t\r\n\t\t\t\twhile(cont.getChoixCible()==-1){\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tThread.sleep(200);\r\n\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"Effet: Le \" +tourjoueur.get(j).getNom() + \" force le \" +listejoueur.get(cont.getChoixCible()).getNom() + \" à sacrifier un Croyant\");\r\n\t\t\t\t\r\n\t\t\t\tif (listejoueur.get(cont.getChoixCible()).getNombreCroyantTotal()>0){\r\n\t\t\t\t\tfor(int i=0;i<listejoueur.get(cont.getChoixCible()).getGuidePossede().size();i++){\r\n\t\t\t\t\t\tfor (int k=0;k<listejoueur.get(cont.getChoixCible()).getGuidePossede().get(i).getCroyantPossede().size();k++){\r\n\t\t\t\t\t\t\tlistejoueur.get(cont.getChoixCible()).getGuidePossede().get(i).getCroyantPossede().get(k).setSelectionnee(true); // On rend possible l'utilisation de la carte\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tlistejoueur.get(cont.getChoixCible()).setDoitSacrifierCroyant(true);\r\n\t\t\t\ttourjoueur.get(j).forcerAction(cont.getChoixCible(),listejoueur.get(cont.getChoixCible()).isDoitSacrifierCroyant(), listejoueur,0,table,collection,tourjoueur);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.println(\"Info : Le \" +listejoueur.get(cont.getChoixCible()).getNom() + \" n'a aucun croyant a sacrifier \");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\t max = 0;\r\n\t\t\t\t\tjoueurCible =-1;;\r\n\t\t\t\tfor (int i=0; i<listejoueur.size();i++){\r\n\t\t\t\t\r\n\t\t\t\t\tif (listejoueur.get(i).getGuidePossede().size() > max){\r\n\t\t\t\t\tmax = listejoueur.get(i).getGuidePossede().size();\r\n\t\t\t\t\tjoueurCible = i;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Effet: Le \" +tourjoueur.get(j).getNom() + \" force le \" +listejoueur.get(joueurCible).getNom() + \" à sacrifier un Croyant\");\r\n\t\t\tif (listejoueur.get(joueurCible).getNombreCroyantTotal()>0){\r\n\t\t\t\t\r\n\t\t\t\t\tfor(int i=0;i<listejoueur.get(joueurCible).getGuidePossede().size();i++){\r\n\t\t\t\t\t\tfor (int k=0;k<listejoueur.get(joueurCible).getGuidePossede().get(i).getCroyantPossede().size();k++){\r\n\t\t\t\t\t\t\tlistejoueur.get(joueurCible).getGuidePossede().get(i).getCroyantPossede().get(k).setSelectionnee(true); // On rend possible l'utilisation de la carte\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tlistejoueur.get(joueurCible).setDoitSacrifierCroyant(true);\r\n\t\t\ttourjoueur.get(j).forcerAction(joueurCible,listejoueur.get(joueurCible).isDoitSacrifierCroyant(), listejoueur,0,table,collection,tourjoueur);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tSystem.out.println(\"Info : Le \" +listejoueur.get(joueurCible).getNom() + \" n'a aucun croyant à sacrifier\");\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if ( id==11){\r\n\t\t\tif (tourjoueur.get(j) == listejoueur.get(0)){\r\n\t\t\t\tSystem.out.println(\"Choisissez le Divinité qui sera forcer de sacrifier un guide\");\r\n\t\t\t\twhile(cont.getChoixCible()==-1){\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tThread.sleep(200);\r\n\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"Effet: Le \" +tourjoueur.get(j).getNom() + \" force le \" +listejoueur.get(cont.getChoixCible()).getNom() + \" à sacrifier un Guide\");\r\n\t\t\t\t\r\n\t\t\t\tif(listejoueur.get(cont.getChoixCible()).getGuidePossede().size()>0){\r\n\t\t\t\t\tfor (int i=0;i<listejoueur.get(cont.getChoixCible()).getGuidePossede().size();i++){\r\n\t\t\t\t\t\tfor(int k=0;k<listejoueur.get(cont.getChoixCible()).getGuidePossede().get(i).getCroyantPossede().size();k++){\r\n\t\t\t\t\t\t\tlistejoueur.get(cont.getChoixCible()).getGuidePossede().get(i).getCroyantPossede().get(k).setSelectionnee(true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlistejoueur.get(cont.getChoixCible()).setDoitSacrifierGuide(true);\r\n\t\t\t\t\ttourjoueur.get(j).forcerAction(cont.getChoixCible(),listejoueur.get(cont.getChoixCible()).isDoitSacrifierGuide(), listejoueur,0,table,collection,tourjoueur);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.println(\"Info : Le \" +listejoueur.get(joueurCible).getNom() + \" n'a aucun guide à sacrifier\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\t max = 0;\r\n\t\t\t\t\tjoueurCible =-1;;\r\n\t\t\t\tfor (int i=0; i<listejoueur.size();i++){\r\n\t\t\t\t\r\n\t\t\t\t\tif (listejoueur.get(i).getGuidePossede().size() > max){\r\n\t\t\t\t\tmax = listejoueur.get(i).getGuidePossede().size();\r\n\t\t\t\t\tjoueurCible = i;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Effet: Le \" +tourjoueur.get(j).getNom() + \" force le \" +listejoueur.get(joueurCible).getNom() + \" à sacrifier un Guide\");\r\n\t\t\t\tif (listejoueur.get(joueurCible).getGuidePossede().size()>0){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tfor(int i=0;i<listejoueur.get(joueurCible).getGuidePossede().size();i++){\r\n\t\t\t\t\t\t\tlistejoueur.get(joueurCible).getGuidePossede().get(i).setSelectionnee(true); // On rend possible l'utilisation de la carte\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tlistejoueur.get(joueurCible).setDoitSacrifierGuide(true);\r\n\t\t\t\ttourjoueur.get(j).forcerAction(joueurCible,listejoueur.get(joueurCible).isDoitSacrifierGuide(), listejoueur,0,table,collection,tourjoueur);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.println(\"Info : Le \" +listejoueur.get(joueurCible).getNom() + \" n'a aucun guide à sacrifier\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t\r\n\t}", "public void touche() {\n if (theme==0) { //Changer les couleurs ici et dans Option\n couleurNote1=0xff00FF00;\n couleurNote2=0xffFF0000;\n couleurNote3=0xffFFFF00;\n couleurNote4=0xff0000FF;\n }\n if (theme==1) {\n couleurNote1=0xffFF0000;\n couleurNote2=0xffFFFF00;\n couleurNote3=0xff0081FF;\n couleurNote4=0xff973EFF;\n }\n if (theme==2) {\n couleurNote1=0xff8FF5F2;\n couleurNote2=0xffFAACE3;\n couleurNote3=0xffF5E8A6;\n couleurNote4=0xffD9F074;\n }\n if (theme==3) {\n couleurNote1=0xffD4AF37;\n couleurNote2=0xffD4AF37;\n couleurNote3=0xffD4AF37;\n couleurNote4=0xffD4AF37;\n }\n\n if (theme==4) {\n couleurNote1=PApplet.parseInt(random(0xff000000, 0xffFFFFFF));\n couleurNote2=PApplet.parseInt(random(0xff000000, 0xffFFFFFF));\n couleurNote3=PApplet.parseInt(random(0xff000000, 0xffFFFFFF));\n couleurNote4=PApplet.parseInt(random(0xff000000, 0xffFFFFFF));\n }\n //#3F48CC\n\n if (touche1) {\n cc1=0xffFFFFFF;\n } else cc1=couleurNote1;\n fill(cc1);\n rect(420, 593, taille+14, taille+13);\n\n if (touche2) {\n cc2=0xffFFFFFF;\n } else cc2=couleurNote2;\n fill(cc2);\n rect(490, 593, taille+14, taille+13);\n\n if (touche3) {\n cc3=0xffFFFFFF;\n } else cc3=couleurNote3;\n fill(cc3);\n rect(560, 593, taille+14, taille+13);\n\n if (touche4) {\n cc4=0xffFFFFFF;\n } else cc4=couleurNote4;\n fill(cc4);\n rect(630, 593, taille+14, taille+13);\n}", "public Contenido copiar() {\n\t\tthrow new NotImplementedException();\r\n\t}", "public void verComprobante() {\r\n if (tab_tabla1.getValorSeleccionado() != null) {\r\n if (!tab_tabla1.isFilaInsertada()) {\r\n Map parametros = new HashMap();\r\n parametros.put(\"ide_cnccc\", Long.parseLong(tab_tabla1.getValorSeleccionado()));\r\n parametros.put(\"ide_cnlap_debe\", p_con_lugar_debe);\r\n parametros.put(\"ide_cnlap_haber\", p_con_lugar_haber);\r\n vpdf_ver.setVisualizarPDF(\"rep_contabilidad/rep_comprobante_contabilidad.jasper\", parametros);\r\n vpdf_ver.dibujar();\r\n } else {\r\n utilitario.agregarMensajeInfo(\"Debe guardar el comprobante\", \"\");\r\n }\r\n\r\n } else {\r\n utilitario.agregarMensajeInfo(\"No hay ningun comprobante seleccionado\", \"\");\r\n }\r\n }", "public void actionsTouches () {\n\t\t//Gestion des deplacements du mineur si demande\n\t\tif (Partie.touche == 'g' || Partie.touche == 'd' || Partie.touche == 'h' || Partie.touche == 'b') deplacements();\n\n\t\t//Affichage du labyrinthe et des instructions, puis attente de consignes clavier.\n\t\tpartie.affichageLabyrinthe();\n\n\t\t//Quitte la partie si demande.\n\t\tif (Partie.touche == 'q') partie.quitter();\n\n\t\t//Trouve et affiche une solution si demande.\n\t\tif (Partie.touche == 's') affichageSolution();\n\n\t\t//Recommence la partie si demande.\n\t\tif (Partie.touche == 'r') {\n\t\t\tgrille.removeAll();\n\t\t\tpartie.initialisation();\n\t\t}\n\n\t\t//Affichage de l'aide si demande\n\t\tif (Partie.touche == 'a') {\n\t\t\tString texteAide = new String();\n\t\t\tswitch(themeJeu) {\n\t\t\tcase 2 : texteAide = \"Le but du jeu est d'aider Link à trouver la sortie du donjon tout en récupérant le(s) coffre(s).\\n Link doit egalement recuperer la Master Sword qui permet de tuer le monstre bloquant le chemin.\\n\\nLink se déplace à l'aide des touches directionnelles.\\nUne solution peut-être affichée en appuyant sur la touche (s).\\nLa touche (r) permet de recommencer, (q) de quitter.\\n\\n Bon jeu !\"; break;\n\t\t\tcase 3 : texteAide = \"Le but du jeu est d'aider Samus à trouver la sortie du vaisseau tout en récupérant le(s) émeraude(s).\\nSamus doit egalement recuperer la bombe qui permet de tuer le metroid qui bloque l'accès à la sortie.\\n\\nSamus se déplace à l'aide des touches directionnelles.\\nUne solution peut-être affichée en appuyant sur la touche (s).\\nLa touche (r) permet de recommencer, (q) de quitter.\\n\\n Bon jeu !\"; break;\n\t\t\tcase 4 : texteAide = \"Le but du jeu est d'aider le pompier à trouver la sortie du batiment tout en sauvant le(s) rescapé(s).\\nLe pompier doit egalement recuperer l'extincteur qui permet d'éteindre le feu qui bloque l'accès à la sortie.\\n\\nLe pompier se déplace à l'aide des touches directionnelles.\\nUne solution peut-être affichée en appuyant sur la touche (s).\\nLa touche (r) permet de recommencer, (q) de quitter.\\n\\n Bon jeu !\"; break;\n\t\t\tcase 5 : texteAide = \"Le but du jeu est d'aider Mario à trouver le drapeau de sortie tout en ramassant le(s) pièce(s).\\nMario doit egalement recuperer l'étoile d'invincibilité qui permet de se débarasser du Goomba qui l'empêche de sortir.\\n\\nMario se déplace à l'aide des touches directionnelles.\\nUne solution peut-être affichée en appuyant sur la touche (s).\\nLa touche (r) permet de recommencer, (q) de quitter.\\n\\n Here we gooo !\"; break;\n\t\t\tdefault : texteAide = \"Le but du jeu est d'aider le mineur à trouver la sortie du labyrinthe tout en extrayant le(s) filon(s).\\nLe mineur doit egalement recuperer la clef qui permet l'ouverture de le porte qui bloque l'accès à la sortie.\\n\\nLe mineur se déplace à l'aide des touches directionnelles.\\nUne solution peut-être affichée en appuyant sur la touche (s).\\nLa touche (r) permet de recommencer, (q) de quitter.\\n\\n Bon jeu !\"; break;\n\t\t\t}\n\t\t\tSystem.out.println(\"\\n============================================ AIDE ========================================\\n\\n\" + texteAide + \"\\n\\n==========================================================================================\\n\");\n\t\t\tJOptionPane.showMessageDialog(null, texteAide, \"Aide\", JOptionPane.QUESTION_MESSAGE);\n\t\t\tPartie.touche = ' ';\n\t\t}\n\n\t\t//Affichage de les infos si demande\n\t\tif (Partie.touche == 'i') {\n\t\t\tSystem.out.println(\"\\n============================================ INFOS =======================================\\n\\nCe jeu a ete developpe par Francois ADAM et Benjamin Rancinangue\\ndans le cadre du projet IPIPIP 2015.\\n\\n==========================================================================================\\n\");\n\t\t\tPartie.touche = ' ';\n\t\t\tJOptionPane.showMessageDialog(null, \"Ce jeu a été développé par François Adam et Benjamin Rancinangue\\ndans le cadre du projet IPIPIP 2015.\", \"Infos\", JOptionPane.INFORMATION_MESSAGE, new ImageIcon(getClass().getResource(\"/images/EMN.png\")));\n\t\t}\n\n\t\t//Nettoyage de l'ecran de console\n\t\tSystem.out.println(\"\\n==========================================================================================\\n\");\n\t}", "public static void poder(){\n System.out.print(\"\\033[H\\033[2J\");//limpia pantalla\n System.out.flush();\n if(experiencia>=100){ //condicion de aumento de nivel\n nivel=nivel+1;\n System.out.println(\"Aumento de nivel exitoso\");\n }\n else{\n System.out.println(\"carece de experiencia para subir su nivel\");\n }\n }", "public void sincronizza() {\n boolean abilita;\n\n super.sincronizza();\n\n try { // prova ad eseguire il codice\n\n /* abilitazione bottone Esegui */\n abilita = false;\n if (!Lib.Data.isVuota(this.getDataInizio())) {\n if (!Lib.Data.isVuota(this.getDataFine())) {\n if (Lib.Data.isSequenza(this.getDataInizio(), this.getDataFine())) {\n abilita = true;\n }// fine del blocco if\n }// fine del blocco if\n }// fine del blocco if\n this.getBottoneEsegui().setEnabled(abilita);\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }", "public void visualizzaCampo(){\r\n\t\tInputOutput.stampaCampo(nome, descrizione, obbligatorio);\r\n\t}", "public void comportement() {\n\t\tif (compteurPas > 0) {\n seDeplacer(deplacementEnCours);\n compteurPas--;\n\n // sinon charge le prochain deplacement\n\t\t} else {\n\t\t // recalcul le chemin si la cible a bouge\n boolean cibleBouger = calculPosCible();\n if (cibleBouger)\n calculerChemin();\n\n if (suiteDeDeplacement.size() > 0) {\n deplacementEnCours = suiteDeDeplacement.pollFirst();\n compteurPas = Case.TAILLE / vitesse;\n // pour le sprite\n if (deplacementEnCours == 'E')\n direction = true;\n else if (deplacementEnCours == 'O')\n direction = false;\n }\n }\n\t\tattaque = attaquer();\n\t}", "private static void statistique(){\n\t\tfor(int i = 0; i<7; i++){\n\t\t\tfor(int j = 0; j<7; j++){\n\t\t\t\tfor(int l=0; l<jeu.getJoueurs().length; l++){\n\t\t\t\t\tif(jeu.cases[i][j].getCouleurTapis() == jeu.getJoueurs()[l].getNumJoueur()){\n\t\t\t\t\t\tjeu.getJoueurs()[l].setTapis(jeu.getJoueurs()[l].getTapisRest()+1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tJoueur j;\n\t\tSystem.out.println(\"// Fin de la partie //\");\n\t\tfor(int i=0; i<jeu.getJoueurs().length; i++) {\n\t\t\tj =jeu.getJoueurs()[i];\n\t\t\tSystem.out.println(\"Joueur \"+ (j.getNumJoueur()+1) + \" a obtenue \"+j.getTapisRest()+j.getMonnaie()+\" points\" );\n\t\t}\n\t}", "@Override\n public void cantidad_Punteria(){\n punteria=69.5+05*nivel+aumentoP;\n }", "public static void dormir(){\n System.out.print(\"\\033[H\\033[2J\");//limpia pantalla\n System.out.flush();\n int restoDeMana; //variables locales a utilizar\n int restoDeVida;\n if(oro>=30){ //condicion de oro para recuperar vida y mana\n restoDeMana=10-puntosDeMana;\n puntosDeMana=puntosDeMana+restoDeMana;\n restoDeVida=150-puntosDeVida;\n puntosDeVida=puntosDeVida+restoDeVida;\n //descotando oro al jugador\n oro=oro-30;\n System.out.println(\"\\nrecuperacion satisfactoria\");\n }\n else{\n System.out.println(\"no cuentas con 'Oro' para recuperarte\");\n }\n }", "private static void muta(Cromosoma c)\n\t{\n\t}", "public void borra() {\n dib.borra();\n dib.dibujaImagen(limiteX-60,limiteY-60,\"tierra.png\");\n dib.pinta(); \n }", "public boolean action(Event e, Object o){\n \n \n if(e.target==guardar){\n RandomAccessFile archi;\n \n try {\n \n File ff = new File (\"Notas.dat\"); \n \n if (ff.exists()== false){\n \n archi = new RandomAccessFile(\"Notas.dat\",\"rw\");\n \n }\n else{\n archi = new RandomAccessFile(\"Notas.dat\",\"rw\");\n archi.seek(archi.length());\n \n }\n \n String code = caja1.getText();\n int L1 = code.length();\n byte [ ]x1 = new byte [5];\n code.getBytes(0,L1,x1,0);\n \n String name = caja2.getText();\n int L2 = name.length();\n byte [ ]x2 = new byte [10];\n name.getBytes(0,L2,x2,0);\n \n int tipo=Integer.parseInt(caja3.getText());\n String pc=\"\";\n \n if (tipo==1) {\n pc=\"Computadores\";\n }else{\n if (tipo==2) {\n pc=\"Audiovisuales\";\n }else{\n if (tipo==3) {\n pc=\"Moviles\";\n }else{\n pc=\"No valido\";\n }\n }\n }\n \n int L3 = pc.length();\n byte [ ]x3 = new byte [13];\n pc.getBytes(0,L3,x3,0);\n \n \n archi.write(x1,0,5);\n archi.write(x2,0,10);\n archi.write(x3,0,13);\n \n caja1.setText(\"\");\n caja2.setText(\"\");\n caja3.setText(\"\");\n \n archi.close();\n return true;\n }//\n catch(IOException q){\n }\n \n return true;\n \n }\n if(e.target==buscar){ //Para mostrar los Datos y/o Resultados\n RandomAccessFile archi;\n try{\n \n archi = new RandomAccessFile(\"Notas.dat\",\"rw\");\n \n byte []h1 = new byte[5];\n byte []h2= new byte[10];\n byte []h3 = new byte[13];\n Datos.setText(\"\");\n \n archi.length();\n Datos.appendText(\" \"+\" ID dispositivo \"+\" Nombre del Dispositivo \"+\" Tipo de Dispositivo \"+\"\\n\");\n for(int i=0; i<archi.length()/28;i++){\n archi.seek(28*i);\n \n archi.read(h1,0,5);\n String id =new String(h1);\n \n archi.read(h2,0,10);\n String Name = new String(h2);\n \n archi.read(h3,0,13);\n String TP = new String(h3);\n \n Datos.appendText(\" \"+id);\n Datos.appendText(\" \"+Name);\n Datos.appendText(\" \"+TP);\n Datos.appendText(\"\\n\");\n }\n \n \n \n }\n catch(IOException q){}\n return true;\n }\n \n \n if(e.target==Limpiar){\n Datos.setText(\"\");\n return true;\n }\n return true;\n //Cierre del Public...\n }", "public void daiGioco() {\n System.out.println(\"Scrivere 1 per giocare al PC, al costo di 200 Tam\\nSeleziona 2 per a Calcio, al costo di 100 Tam\\nSeleziona 3 per Disegnare, al costo di 50 Tam\");\n\n switch (creaturaIn.nextInt()) {\n case 1 -> {\n puntiFelicita += 60;\n puntiVita -= 30;\n soldiTam -= 200;\n }\n case 2 -> {\n puntiFelicita += 40;\n puntiVita -= 20;\n soldiTam -= 100;\n }\n case 3 -> {\n puntiFelicita += 30;\n puntiVita -= 10;\n soldiTam -= 50;\n }\n }\n checkStato();\n }", "private void actualizaPuntuacion() {\n if(cambiosFondo <= 10){\n puntos+= 1*0.03f;\n }\n if(cambiosFondo > 10 && cambiosFondo <= 20){\n puntos+= 1*0.04f;\n }\n if(cambiosFondo > 20 && cambiosFondo <= 30){\n puntos+= 1*0.05f;\n }\n if(cambiosFondo > 30 && cambiosFondo <= 40){\n puntos+= 1*0.07f;\n }\n if(cambiosFondo > 40 && cambiosFondo <= 50){\n puntos+= 1*0.1f;\n }\n if(cambiosFondo > 50) {\n puntos += 1 * 0.25f;\n }\n }", "public void daiMedicina() {\n System.out.println(\"Vuoi curare \" + nome + \" per 200 Tam? S/N\");\n String temp = creaturaIn.next();\n if (temp.equals(\"s\") || temp.equals(\"S\")) {\n puntiVita += 60;\n soldiTam -= 200;\n }\n checkStato();\n }", "public void MoverPieza(CuadroPieza cuadroActual, CuadroPieza cuadroDestino) {\n try {\n if (suspenderJuego) {//Si el juego no esta suspendido\n return;\n }\n if (cuadroActual.getPieza().MoverPieza(cuadroDestino, this)) {//Si el movimiento es valido\n for (int x = 0; x < 8; x++) {\n for (int y = 0; y < 8; y++) {\n tablero[x][y].opacarPieza();//Regreso todos los cuadros a su estado inicial, para que no esten resaltados.\n }\n }\n setTurno(getTurno() * -1);//Cambio de turno.\n if (getRey(getTurno()).isInJacke(this)) {//Pregunto si el rey del turno actual, o sea al que le toca mover despues de este metodo, esta en jacke\n if (Pieza.isJugadorAhogado(getTurno(), this)) {//Si esta en jacke, pregunto si esta ahogado(Quiere decir que no tiene opcion.)\n //Si esta en jacke y esta ahogado a la vez, quiere decir que esta en jacke mate.\n JOptionPane.showMessageDialog(null, \"Hacke Mate!!!\\nComputadora: Parece que me ganaste=(\");\n if (JOptionPane.showConfirmDialog(null, \"Computadora: Te reto a que lo vuelvas a hacer, Otra¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n JOptionPane.showMessageDialog(null, \"Computadora: Cobarde ¬¬\");\n suspenderJuego = true;\n }\n return;\n } else {\n //Si no esta ahogado, simplemente es un jacke.\n JOptionPane.showMessageDialog(null, \"Rey en Hacke \\nComputadora: Y ahora que hago¿? =(\");\n }\n } else {\n if (Pieza.isJugadorAhogado(getTurno(), this)) {\n //Si solo esta ahogado, es un empate.\n JOptionPane.showMessageDialog(null, \"Empate!!!\\nComputadora: Vamos que andamos parchis, me has ahogado!!!\");\n\n if (JOptionPane.showConfirmDialog(null, \"Deseas Empezar una nueva Partida¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n suspenderJuego = true;\n }\n return;\n }\n if (Pieza.getCantMovimientosSinCambios() >= 50) {\n //Si han pasado 50 movimientos sin ningun cambio, tambien se considera empate.\n JOptionPane.showMessageDialog(null, \"Empate!!! \\nComputadora: Vaya, han pasado 50 turnos sin comernos jeje!!!\");\n if (JOptionPane.showConfirmDialog(null, \"Otra Partida Amistosa¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n suspenderJuego = true;\n }\n }\n }\n\n if (getTurno() == turnoComputadora) {//Si le toca a la computadora, le toca jugar a ella.\n jugarMaquinaSola(getTurno());\n }\n } else {\n if (getRey(getTurno()).isInJacke(this)) {//Si el movimiento es invalido, y encima el rey esta en jacke, pues es un movimiento invalido, el rey tiene que librarse del jacke\n JOptionPane.showMessageDialog(null, \"Movimiento invalido\");\n }\n }\n } catch (Exception e) {\n System.out.print(\"Error: \" + e.getMessage());\n }\n }", "@Override\r\n public void combattre(Creature c) {\r\n System.out.println(\"Tour de combat de \" + getNom() + \" :\");\r\n if (this.getPtMana() > 0) {\r\n this.setPtMana(this.getPtMana() - 1);\r\n Random rand = new Random();\r\n int success = rand.nextInt(100), distance;\r\n distance = this.getPos().distance(c.getPos());\r\n if (distance <= this.getDistAttMax()) {//On vérifie que l'on peut toucher l'adversaire\r\n if (success < this.getPourcentageMag()) { // L'attaque réussie\r\n c.setPtVie(c.getPtVie() - this.getDegAtt()); //on inflige des dégats à l'adversaire.\r\n System.out.println(\"Attaque réussie de \" + getNom() + \" : \" + this.getDegAtt() + \" dégats infligés.\");\r\n } else {\r\n System.out.println(\"Dans le vide!\");\r\n }\r\n } else {\r\n System.out.println(\"Trop loin.\");\r\n }\r\n } else {\r\n System.out.println(\"Oups... plus de mana.\");\r\n }\r\n }", "public void contabilizarConMesYProfesor(ProfesorBean profesor, int mes){\r\n GestionDetallesInformesBD.deleteDetallesInforme(profesor, mes); \r\n\r\n //Preparamos todos los datos. Lista de fichas de horario.\r\n ArrayList<FichajeBean> listaFichajes = GestionFichajeBD.getListaFichajesProfesor(profesor,mes);\r\n ArrayList<FichajeRecuentoBean> listaFichajesRecuento= UtilsContabilizar.convertirFichajes(listaFichajes);\r\n\r\n /**\r\n * Contabilizar horas en eventos de día completo\r\n */\r\n \r\n int segundosEventosCompletos=contabilizarEventosCompletos(listaFichajesRecuento, profesor,mes);\r\n \r\n /**\r\n * Contabilizar horas en eventos de tiempo parcial\r\n */\r\n \r\n ArrayList<EventoBean> listaEventos=GestionEventosBD.getListaEventosProfesor(false, profesor, mes);\r\n int segundosEventosParciales=contabilizarEventosParciales(listaFichajesRecuento,listaEventos, profesor, mes, \"C\");\r\n \r\n /**\r\n * Contabilizamos las horas lectivas\r\n */\r\n ArrayList<FichaBean> listaFichasLectivas=UtilsContabilizar.getHorarioCompacto(profesor, \"L\");\r\n int segundosLectivos=contabilizaHorasLectivasOCmplementarias(listaFichajesRecuento, listaFichasLectivas, profesor,\"L\", mes);\r\n \r\n /**\r\n * Contabilizar horas complementarias\r\n */\r\n ArrayList<FichaBean> listaFichasComplementarias=UtilsContabilizar.getHorarioCompacto(profesor, \"C\");\r\n int segundosComplementarios=contabilizaHorasLectivasOCmplementarias(listaFichajesRecuento, listaFichasComplementarias, profesor,\"C\", mes);\r\n \r\n /**\r\n * Contabilizamos la horas no lectivas (el resto de lo que quede en los fichajes.\r\n */\r\n int segundosNLectivos=contabilizaHorasNoLectivas(listaFichajesRecuento, profesor, true, mes);\r\n \r\n /**\r\n * Contabilizamos las horas extra añadidas al profesor\r\n */\r\n ArrayList<HoraExtraBean> listaHorasExtra=GestionHorasExtrasBD.getHorasExtraProfesor(profesor, mes);\r\n HashMap<String, Integer> tablaHorasExtra = contabilizaHorasExtra(listaHorasExtra, profesor, mes);\r\n \r\n System.out.println(\"Segundos de horas lectivas: \"+Utils.convierteSegundos(segundosLectivos));\r\n System.out.println(\"Segundos de horas complementarias: \"+Utils.convierteSegundos(segundosComplementarios));\r\n System.out.println(\"Segundos de horas no lectivas: \"+Utils.convierteSegundos(segundosNLectivos));\r\n System.out.println(\"Segundos eventos completos: \"+Utils.convierteSegundos(segundosEventosCompletos));\r\n System.out.println(\"Segundos eventos parciales: \"+Utils.convierteSegundos(segundosEventosParciales));\r\n System.out.println(\"Total: \"+Utils.convierteSegundos((segundosComplementarios+segundosLectivos+segundosNLectivos+segundosEventosCompletos+segundosEventosParciales)));\r\n \r\n /**\r\n * Comprobacion\r\n */\r\n listaFichajes = GestionFichajeBD.getListaFichajesProfesor(profesor,mes);\r\n listaFichajesRecuento= UtilsContabilizar.convertirFichajes(listaFichajes);\r\n int segundosValidacion=contabilizaHorasNoLectivas(listaFichajesRecuento, profesor, false, mes);\r\n int segundosValidacion2=segundosComplementarios+segundosLectivos+segundosNLectivos+segundosEventosCompletos+segundosEventosParciales;\r\n System.out.println(\"Comprobacion: \"+Utils.convierteSegundos(segundosValidacion));\r\n String obser=segundosValidacion==segundosValidacion2?\"Correcto\":\"No coinciden las horas en el colegio, con las horas calculadas de cada tipo.\";\r\n \r\n segundosComplementarios+=segundosEventosCompletos;\r\n segundosComplementarios+=segundosEventosParciales;\r\n\r\n //Guardamos en la base de datos\r\n GestionInformesBD.guardaInforme(profesor, obser, segundosLectivos, segundosNLectivos, segundosComplementarios,mes);\r\n \r\n }", "@Override\n\tpublic void chocoContraPared() {}", "public void changeDisk(){\n if(isFull==true) {\n if (this.type == TYPE.WHITE) {\n this.type = TYPE.BLACK;\n } else {\n type = TYPE.WHITE;\n }\n }\n return;\n }", "private void updateMemTableTomasulo() {\n\t\t// Get a copy of the memory stations\n\t\tMemStation[] temp_ms = MemReservationTomasulo;\n\n\t\t// Update the table with current values for the stations\n\t\tfor (int i = 0; i < temp_ms.length; i++) {\n\t\t\t// generate a meaningfull representation of busy\n\t\t\tString busy_desc = (temp_ms[i].isBusy() ? \"Yes\" : \"No\");\n\n\t\t\tMemoryModelTomasulo.setValueAt(temp_ms[i].getName(), i, 0);\n\t\t\tMemoryModelTomasulo.setValueAt(busy_desc, i, 1);\n\t\t\tMemoryModelTomasulo.setValueAt(temp_ms[i].getAddress(), i, 2);\n\t\t}\n\t}", "public void completarTarea()\n {\n tareaCompletada = true;\n }", "@Override\n\t\t\tpublic void onPrimaryClipChanged() {\n\t\t\t\tClipData data = mClipboard.getPrimaryClip();\n\t\t\t\tItem item = data.getItemAt(0);\n\t\t\t\tLog.e(ClientSocketThread.TAG, \"复制文字========:\"+item.getText());\t\n \t\t\t\tsendSocketDataTotalLen = item.getText().toString().getBytes().length+4;\n\t\t\t\tsendTotalLen = FileUtil.intToByte(sendSocketDataTotalLen);\n\t\t\t\tsendSocketDataCategories =7;\n\t\t\t\tsendCategories = FileUtil.intToByte(sendSocketDataCategories);\n\t\t\t\tbyte[] sendDataBuffer = new byte[sendSocketDataTotalLen+4];\n\t\t\t\tSystem.arraycopy(sendTotalLen, 0, sendDataBuffer, 0, 4);\n\t\t\t\tSystem.arraycopy(sendCategories, 0, sendDataBuffer, 4, 4);\n\t\t\t\tSystem.arraycopy(item.getText().toString().getBytes(), 0, sendDataBuffer, 8, item.getText().toString().getBytes().length);\n\t\t\t\tThreadReadWriterIOSocket.writeDataToSocket(sendDataBuffer);\n\t\t\t}", "private void creaModuloMem() {\n /* variabili e costanti locali di lavoro */\n ArrayList<Campo> campi = new ArrayList<Campo>();\n ModuloRisultati modulo;\n Campo campo;\n\n try { // prova ad eseguire il codice\n\n campo = CampoFactory.intero(Campi.Ris.codicePiatto.getNome());\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.nomePiatto.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"piatto\");\n campo.setToolTipLista(\"nome del piatto\");\n campo.decora()\n .etichetta(\"nome del piatto\"); // le etichette servono per il dialogo ricerca\n campo.setLarghezza(250);\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.categoria.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"categoria\");\n campo.setToolTipLista(\"categoria del piatto\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteVolte.getNome());\n campo.setVisibileVistaDefault();\n campo.setLarghezza(80);\n campo.setTitoloColonna(\"quante volte\");\n campo.setToolTipLista(\n \"quante volte questo piatto è stato offerto nel periodo analizzato\");\n campo.decora().etichetta(\"quante volte\");\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quantiCoperti.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"coperti\");\n campo.setToolTipLista(\"numero di coperti che avrebbero potuto ordinare\");\n campo.decora().etichetta(\"n. coperti\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteComande.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"comande\");\n campo.setToolTipLista(\"numero di comande effettive\");\n campo.decora().etichetta(\"n. comande\");\n campo.setLarghezza(80);\n campo.setTotalizzabile(true);\n campi.add(campo);\n\n campo = CampoFactory.percentuale(Campi.Ris.gradimento.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"gradimento\");\n campo.setToolTipLista(\n \"percentuale di gradimento (è il 100% se tutti i coperti potenziali lo hanno ordinato)\");\n campo.decora().etichetta(\"% gradimento\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n modulo = new ModuloRisultati(campi);\n setModuloRisultati(modulo);\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n }", "@Override\n public void cantidad_Ataque(){\n ataque=5+2*nivel+aumentoT;\n }", "public void actionPerformed(ActionEvent e) {\n\t\tJButton b = (JButton)(e.getSource());\n\n\t\t// Traccia il perimetro con dei muri e svuota l'interno della mappa.\n\t\tif(b.getText().equals(\"Pulisci\")) {\n\t\t\tfor (int i = 0; i < nr; i++) {\n\t\t\t\tfor (int j = 0; j < nc; j++) {\n\t\t\t\t\tif ((j == nc - 1) || (j == 0) || (i == 0) || (i == nr - 1)) {\n\t\t\t\t\t\tcells[i][j].setIcon(iconWall);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcells[i][j].setIcon(iconNull);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Randomize della mappa\n\t\tif(b.getText().equals(\"Randomize\")) {\n\t\t\tint percWall;\n\t\t\tint percExit;\n\t\t\tint percDebris;\n\t\t\tint percSurvivor;\n\t\t}\n\t\t// Crea il file CLIPS del mondo creato e fa partire l'interfaccia per l'esecuzione di RubyRescue.\n\t\tif(b.getText().equals(\"Fatto\")) {\n\t\t\tif (controlMap()) {\n\t\t\t\tString debrisContent = \"\";\n\t\t\t\tString world = \"\";\n\t\t\t\tString contains;\n\t\t\t\tImageIcon icon;\n\t\t\t\ttry {\n\t\t\t\t\t// Le parti STATICHE del programma CLIPS. Le altre vengono aggiornate automaticamente\n\t\t\t\t\tFileReader in1 = new FileReader(getClass().getResource(\"/clp/Parte1.clp\").getPath());\n\t\t\t\t\tFileReader in3 = new FileReader(getClass().getResource(\"/clp/Parte3.clp\").getPath());\n\t\t\t\t\tFileReader in5 = new FileReader(getClass().getResource(\"/clp/Parte5.clp\").getPath());\n\t\t\t\t\tFileReader in7 = new FileReader(getClass().getResource(\"/clp/Parte7.clp\").getPath());\n\n\t\t\t\t\tFileReader in1c = new FileReader(getClass().getResource(\"/clpclips/Parte1.clp\").getPath());\n\t\t\t\t\tFileReader in3c = new FileReader(getClass().getResource(\"/clpclips/Parte3.clp\").getPath());\n\t\t\t\t\tFileReader in5c = new FileReader(getClass().getResource(\"/clpclips/Parte5.clp\").getPath());\n\t\t\t\t\tFileReader in7c = new FileReader(getClass().getResource(\"/clpclips/Parte7.clp\").getPath());\n\n\t\t\t\t\t// File di output.\n\t\t\t\t\tout = new FileWriter(getClass().getResource(\"/rules/Ruby.clp\").getPath());\n\t\t\t\t\toutClips = new FileWriter(getClass().getResource(\"/rules/RubyClips.clp\").getPath());\n\t\t\t\t\t// Scrittura parte statica 1.\n\t\t\t\t\tint c, cc;\n\t\t\t\t\tc = in1.read();\n\t\t\t\t\twhile (c != -1) {\n\t\t\t\t\t\tout.write(c);\n\t\t\t\t\t\tc = in1.read();\n\t\t\t\t\t}\n\t\t\t\t\tin1.close();\n\t\t\t\t\tcc = in1c.read();\n\t\t\t\t\twhile (cc != -1) {\n\t\t\t\t\t\toutClips.write(cc);\n\t\t\t\t\t\tcc = in1c.read();\n\t\t\t\t\t}\n\t\t\t\t\tin1c.close();\n\n\t\t\t\t\t// Scrittura parte dinamica 2. Trasformazione del mondo in codice CLIPS\n\t\t\t\t\tout.write(\"\\n;Mondo creato con RubyRescueWorldCreation.java\\n\");\n\t\t\t\t\tDate date = new Date();\n\t\t\t\t\tout.write(\";Data: \"+ date +\"\\n\");\n\t\t\t\t\toutClips.write(\"\\n;Mondo creato con RubyRescueWorldCreation.java\\n\");\n\t\t\t\t\toutClips.write(\";Data: \"+ date +\"\\n\");\n\t\t\t\t\tint entryR = 0;\n\t\t\t\t\tint entryC = 0;\n\t\t\t\t\tString direction = \"\";\n\t\t\t\t\tfor (int i = 0; i < nr; i++) {\n\t\t\t\t\t\tfor (int j = 0; j < nc; j++) {\n\t\t\t\t\t\t\ticon = (ImageIcon) (cells[i][j].getIcon());\n\t\t\t\t\t\t\tcontains = icon.getDescription();\n\n\t\t\t\t\t\t\tif (contains.equals(\"entry\")) {\n\t\t\t\t\t\t\t\tentryR = i;\n\t\t\t\t\t\t\t\tentryC = j;\n\t\t\t\t\t\t\t\tif (i == 0) {\n\t\t\t\t\t\t\t\t\tdirection = \"down\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\t\t\tdirection = \"right\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (i == (nr - 1)) {\n\t\t\t\t\t\t\t\t\tdirection = \"up\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (j == (nc - 1)) {\n\t\t\t\t\t\t\t\t\tdirection = \"left\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (contains.equals(\"debris\")) {\n\t\t\t\t\t\t\t\tdebrisContent = debrisContent + \"\\n(debriscontent (pos-r \" + i + \") \";\n\t\t\t\t\t\t\t\tdebrisContent = debrisContent + \"(pos-c \" + j + \") \";\n\t\t\t\t\t\t\t\tdebrisContent = debrisContent + \"(person no) \";\n\t\t\t\t\t\t\t\tdebrisContent = debrisContent + \"(digged no))\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (contains.equals(\"debrisYes\")) {\n\t\t\t\t\t\t\t\tcontains = \"debris\";\n\t\t\t\t\t\t\t\tdebrisContent = debrisContent + \"\\n(debriscontent (pos-r \" + i + \") \";\n\t\t\t\t\t\t\t\tdebrisContent = debrisContent + \"(pos-c \" + j + \") \";\n\t\t\t\t\t\t\t\tdebrisContent = debrisContent + \"(person Person-\" + i + \"-\" + j + \") \";\n\t\t\t\t\t\t\t\tdebrisContent = debrisContent + \"(digged no))\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tworld = world + \"\\n(cell (pos-r \" + i + \") \";\n\t\t\t\t\t\t\tworld = world + \"(pos-c \" + j + \") \";\n\t\t\t\t\t\t\tworld = world + \"(contains \" + contains + \"))\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tworld = world + debrisContent;\n\t\t\t\t\tout.write(world);\n\t\t\t\t\toutClips.write(world);\n\n\t\t\t\t\t// Scrittura parte statica 3.\n\t\t\t\t\tc = in3.read();\n\t\t\t\t\twhile (c != -1) {\n\t\t\t\t\t\tout.write(c);\n\t\t\t\t\t\tc = in3.read();\n\t\t\t\t\t}\n\t\t\t\t\tin3.close();\n\t\t\t\t\tcc = in3c.read();\n\t\t\t\t\twhile (cc != -1) {\n\t\t\t\t\t\toutClips.write(cc);\n\t\t\t\t\t\tcc = in3c.read();\n\t\t\t\t\t}\n\t\t\t\t\tin3c.close();\n\n\t\t\t\t\t// Inserimento parte dinamica 4.\n\t\t\t\t\tString agentStatus = \"(agentstatus (pos-r \"+entryR+\") (pos-c \"+entryC+\")\";\n\t\t\t\t\tagentStatus = agentStatus + \"(time 0)(direction \"+direction+\") (load no)))\\n\";\n\t\t\t\t\tout.write(agentStatus);\n\t\t\t\t\toutClips.write(agentStatus);\n\n\t\t\t\t\t// Scrittura parte statica 5\n\t\t\t\t\tc = in5.read();\n\t\t\t\t\twhile (c != -1) {\n\t\t\t\t\t\tout.write(c);\n\t\t\t\t\t\tc = in5.read();\n\t\t\t\t\t}\n\t\t\t\t\tin5.close();\n\t\t\t\t\tcc = in5c.read();\n\t\t\t\t\twhile (cc != -1) {\n\t\t\t\t\t\toutClips.write(cc);\n\t\t\t\t\t\tcc = in5c.read();\n\t\t\t\t\t}\n\t\t\t\t\tin5c.close();\n\n\t\t\t\t\t// Scrittura parte dinamica 6.\n\t\t\t\t\tString mapEntry = \"(assert (map (pos-r \"+entryR+\")(pos-c \"+entryC+\")\";\n\t\t\t\t\tmapEntry = mapEntry + \"(contains entry)))\\n\";\n\t\t\t\t\tout.write(mapEntry);\n\t\t\t\t\toutClips.write(mapEntry);\n\n\t\t\t\t\t// Scrittura parte statica 7.\n\t\t\t\t\tc = in7.read();\n\t\t\t\t\twhile (c != -1) {\n\t\t\t\t\t\tout.write(c);\n\t\t\t\t\t\tc = in7.read();\n\t\t\t\t\t}\n\t\t\t\t\tin7.close();\n\t\t\t\t\tcc = in7c.read();\n\t\t\t\t\twhile (cc != -1) {\n\t\t\t\t\t\toutClips.write(cc);\n\t\t\t\t\t\tcc = in7c.read();\n\t\t\t\t\t}\n\t\t\t\t\tin7c.close();\n\n\t\t\t\t\t// Chiusura file di output.\n\t\t\t\t\tout.close();\n\t\t\t\t\toutClips.close();\n\n\t\t\t\t\tsetVisible(false);\n\n\t\t\t\t\t// Parte l'esecuzione del programma CLIPS\n\t\t\t\t\tString titleFrame = e.getActionCommand();\n\t\t\t\t\tif (titleFrame.equals(\"Fatto\")) {\n\t\t\t\t\t\ttitleFrame = \"(mappa non salvata)\";\n\t\t\t\t\t}\n\t\t\t\t\trrwe = new RubyRescueWorldExecution(cells, titleFrame);\n\t\t\t\t} catch(Exception eee) {\n\t\t\t\t\tSystem.out.println(eee.getMessage());\n\t\t\t\t}\n\t\t\t}//if (controlMap == true)\n\t\t\telse {\n\t\t\t\tJOptionPane op = new JOptionPane();\n\t\t\t\top.showMessageDialog(null, errorMapMessage, \"Attento\", 2);\n\t\t\t}\n\t\t}\n\n\t\t// Risettaggio dei parametri del mondo.\n\t\tif(b.getText().equals(\"Reimposta\")) {\n\t\t\tsetVisible(false);\n\t\t\tnew RubyRescueWorldParameters();\n\t\t}\n\n\t\t// Uscita.\n\t\tif(b.getText().equals(\"Esci\")) {\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public void faiBagnetto() {\n System.out.println(\"Scrivere 1 per Bagno lungo, al costo di 150 Tam\\nSeleziona 2 per Bagno corto, al costo di 70 Tam\\nSeleziona 3 per Bide', al costo di 40 Tam\");\n\n switch (creaturaIn.nextInt()) {\n case 1 -> {\n puntiVita += 50;\n puntiFelicita -= 30;\n soldiTam -= 150;\n }\n case 2 -> {\n puntiVita += 30;\n puntiFelicita -= 15;\n soldiTam -= 70;\n }\n case 3 -> {\n puntiVita += 10;\n puntiFelicita -= 5;\n soldiTam -= 40;\n }\n }\n checkStato();\n }", "public void tambahIsi(){\n status();\n //kondisi jika air penuh\n if(level==6){\n Toast.makeText(this,\"Air Penuh\",Toast.LENGTH_SHORT).show();return;}\n progress.setImageLevel(++level);\n }", "public void jugarMaquinaSola(int turno) {\n if (suspenderJuego) {\n return;\n }\n CuadroPieza cuadroActual;\n CuadroPieza cuadroDestino;\n CuadroPieza MovDestino = null;\n CuadroPieza MovActual = null;\n for (int x = 0; x < 8; x++) {\n for (int y = 0; y < 8; y++) {\n cuadroActual = tablero[x][y];\n if (cuadroActual.getPieza() != null) {\n if (cuadroActual.getPieza().getColor() == turno) {\n for (int x1 = 0; x1 < 8; x1++) {\n for (int y1 = 0; y1 < 8; y1++) {\n cuadroDestino = tablero[x1][y1];\n if (cuadroDestino.getPieza() != null) {\n if (cuadroActual.getPieza().validarMovimiento(cuadroDestino, this)) {\n if (MovDestino == null) {\n MovActual = cuadroActual;\n MovDestino = cuadroDestino;\n } else {\n if (cuadroDestino.getPieza().getPeso() > MovDestino.getPieza().getPeso()) {\n MovActual = cuadroActual;\n MovDestino = cuadroDestino;\n }\n if (cuadroDestino.getPieza().getPeso() == MovDestino.getPieza().getPeso()) {\n //Si es el mismo, elijo al azar si moverlo o no\n if (((int) (Math.random() * 3) == 1)) {\n MovActual = cuadroActual;\n MovDestino = cuadroDestino;\n }\n }\n }\n }\n\n }\n }\n }\n }\n }\n }\n }\n if (MovActual == null) {\n boolean b = true;\n do {//Si no hay mov recomendado, entonces genero uno al azar\n int x = (int) (Math.random() * 8);\n int y = (int) (Math.random() * 8);\n tablero[x][y].getPieza();\n int x1 = (int) (Math.random() * 8);\n int y1 = (int) (Math.random() * 8);\n\n MovActual = tablero[x][y];\n MovDestino = tablero[x1][y1];\n if (MovActual.getPieza() != null) {\n if (MovActual.getPieza().getColor() == turno) {\n b = !MovActual.getPieza().validarMovimiento(MovDestino, this);\n //Si mueve la pieza, sale del while.\n }\n }\n } while (b);\n }\n if (MovActual.getPieza().MoverPieza(MovDestino, this)) {\n this.setTurno(this.getTurno() * -1);\n if (getRey(this.getTurno()).isInJacke(this)) {\n if (Pieza.isJugadorAhogado(turno, this)) {\n JOptionPane.showMessageDialog(null, \"Hacke Mate!!! - te lo dije xD\");\n if (JOptionPane.showConfirmDialog(null, \"Deseas Empezar una nueva Partida¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n suspenderJuego = true;\n }\n return;\n } else {\n JOptionPane.showMessageDialog(null, \"Rey en Hacke - ya t kgste\");\n }\n } else {\n if (Pieza.isJugadorAhogado(turno, this)) {\n JOptionPane.showMessageDialog(null, \"Empate!!!\\nComputadora: Solo por que te ahogaste...!!!\");\n if (JOptionPane.showConfirmDialog(null, \"Deseas Empezar una nueva Partida¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n suspenderJuego = true;\n }\n return;\n }\n if (Pieza.getCantMovimientosSinCambios() >= 50) {\n JOptionPane.showMessageDialog(null, \"Empate!!! \\nComputadora: Vaya, han pasado 50 turnos sin comernos jeje!!!\");\n if (JOptionPane.showConfirmDialog(null, \"Otra Partida Amistosa¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n suspenderJuego = true;\n }\n return;\n }\n }\n }\n if (this.getTurno() == turnoComputadora) {\n jugarMaquinaSola(this.getTurno());\n }\n }", "public void prosesBawahTiga(int banyakGenerasi, int popSize, double pm, double pc) {\n }", "private void esegui() {\n /* variabili e costanti locali di lavoro */\n OperazioneMonitorabile operazione;\n\n try { // prova ad eseguire il codice\n\n /**\n * Lancia l'operazione di analisi dei dati in un thread asincrono\n * al termine il thread aggiorna i dati del dialogo\n */\n operazione = new OpAnalisi(this.getProgressBar());\n operazione.avvia();\n\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n }", "@Override\n\tpublic void concentrarse() {\n\t\tSystem.out.println(\"Se centra en sacar lo mejor del Equipo\");\n\t\t\n\t}", "public void Caracteristicas(){\n System.out.println(\"La resbaladilla tiene las siguientes caracteristicas: \");\r\n if (escaleras==true) {\r\n System.out.println(\"Tiene escaleras\");\r\n }else System.out.println(\"No tiene escaleras\");\r\n System.out.println(\"Esta hecho de \"+material);\r\n System.out.println(\"Tiene una altura de \"+altura);\r\n }", "public void updateProgress(Land land){\n String wiltedString = \"[ wilted ]\";\n StringBuilder progressBar = new StringBuilder();\n String percentageCompleted = \"\";\n int finalStatus = land.getCurrentStatus();\n\n if (land.getCropName() != null){\n Crop crop = cropDAO.retrieveCrop(land.getCropName());\n double timeToGrow = crop.getTime();\n\n Date plantTime = land.getPlantTime();\n Date finishedTime = land.getFinishedTime();\n Date witherTime = land.getWitherTime();\n Date timeNow = new Date();\n\n int timeAfterWilt = (int) (timeNow.getTime() - witherTime.getTime());\n int timeAfterFinished = (int) (timeNow.getTime() - finishedTime.getTime());\n// double timeElapsed =(double) (timeNow.getTime() - plantTime.getTime());\n double timeElapsed =(double) ((timeNow.getTime() - plantTime.getTime()) / 60000);\n\n if (timeAfterWilt > 0){ //withered\n land.setCurrentStatus(-1);\n finalStatus = -1;\n progressBar = new StringBuilder(wiltedString);\n } else if (timeAfterFinished > 0 ){\n land.setCurrentStatus(2);\n finalStatus = 2;\n progressBar = new StringBuilder(\"[##########]\");\n percentageCompleted = \"100%\";\n } else {\n double percentage = (timeElapsed / timeToGrow )* 100;\n int intPercentage = (int) percentage;\n percentageCompleted = intPercentage + \"%\";\n progressBar = new StringBuilder(\"[\");\n int display = intPercentage/10 ;\n for (int i =1; i<= 10; i++){\n if (i <= display){\n progressBar.append(\"#\");\n } else {\n progressBar.append(\"-\");\n }\n }\n progressBar.append(\"]\");\n }\n }\n\n String finalProgressBar = progressBar + \" \"+ percentageCompleted;\n land.setProgressBar(finalProgressBar);\n\n Connection conn = controller.getConnection();\n PreparedStatement stmt = null;\n String sql = \"UPDATE magnet.land SET currentStatus = ?, progressBar = ? WHERE owner = ? AND plotNumber = ?;\";\n\n try {\n stmt = conn.prepareStatement(sql);\n stmt.setInt(1, finalStatus);\n stmt.setString(2, finalProgressBar);\n stmt.setString(3, land.getOwner());\n stmt.setInt(4, land.getPlotNumber());\n stmt.executeUpdate();\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public static void verMensagens() throws IOException, InterruptedException {\n\n clearScreen();\n\n Scanner input = new Scanner(System.in);\n System.out.println(\"Qual tópico quer ver? (Sair 0)\");\n System.out.print(\"> \");\n String topico = input.next();\n\n if(!topico.equals(\"0\")){\n\n File file = new File(topico+\".txt\");\n\n if(!file.exists()){ // verificar se o topico que foi introduzido pelo cliente existe, caso nao exista executa este codigo\n System.out.println(\"\\033[1mO tópico não existe!\\033[0m\");\n TimeUnit.SECONDS.sleep(2);\n verMensagens();\n return;\n }\n BufferedReader reader = new BufferedReader(new FileReader(file));\n\n \n try\n {\n \n String line = \"\", oldtext = \"\",linha=\"\", newTexto=\"\";\n while((line = reader.readLine()) != null)\n {\n oldtext += line + \"\\r\\n\"; // ler o conteudo do topico\n }\n reader.close();\n System.out.println(oldtext); // imprimir o conteudo do texto\n }\n \n catch (IOException ioe)\n {\n ioe.printStackTrace();\n }\n }\n}", "public void procesarTramaEasyFuel(){\n switch (bufferRecepcion[4]){\n //TRAMA DE CONFIGURACION\n case 0x06:\n if(bufferRecepcion[5] == 0x01 || bufferRecepcion[5] == 0x02){\n //TRAMA DE CONFIGURACION\n //Log.v(\"NOMBRE EMBEDDED\", \"\" + hexToAscii(byteArrayToHexString(bufferRecepcion,bufferRecepcion.length)));\n //Log.v(\"NOMBRE EMBEDDED\", \"\" + hexToAscii(byteArrayToHexString(tramaNombreEmbedded,tramaNombreEmbedded.length)));\n //Log.v(\"TRAMA EMBEDDED\", \"\" + hexToAscii(byteArrayToHexString(tramaMACEmbedded,tramaMACEmbedded.length)));\n //Log.v(\"PING HOST EMBEDDED\", \"\" + hexToAscii(byteArrayToHexString(tramaPingHost,tramaPingHost.length)));\n //Log.v(\"NÚMERO DE BOMBAS\", \"\" + byteArrayToHexInt(numeroBombas,1));\n\n llenarDatosConfiguracion();\n insertarMaestrosSQLite();\n agregarImagenEstaciones();\n //inicializarMangueras();\n clientTCPThread.write(EmbeddedPtcl.b_ext_configuracion); //0x06\n\n //inicializarMangueras();\n /*try {\n Thread.sleep(3000);\n } catch (InterruptedException ie) {\n ie.printStackTrace();\n }*/\n\n //cambiarEstadoIniciaAbastecimiento(1);\n\n }\n break;\n\n //CAMBIO DE ESTADO\n case 0x01:\n int indiceLayoutHose=0;\n //Capturar idBomba\n int[] arrayIdBomba = new int[1];\n int idBomba = 0;\n arrayIdBomba[0] = bufferRecepcion[7];\n idBomba = Integer.parseInt(byteArrayToHexIntGeneral(arrayIdBomba,1));\n\n for(int i=0;i<hoseEntities.size();i++ ){\n if(hoseEntities.get(i).idBomba==idBomba) {\n indiceLayoutHose = i;\n break;\n }\n }\n\n switch (bufferRecepcion[5]){\n case 0x01:\n //Cambio de estado\n if(hoseEntities.size() > 0){\n cambioEstado(indiceLayoutHose, bufferRecepcion[8]);\n }\n clientTCPThread.write(EmbeddedPtcl.b_ext_cambio_estado);//0x01\n break;\n case 0x02:\n //Estado actual de Mangueras\n cambioEstado(indiceLayoutHose, bufferRecepcion[8]);\n clientTCPThread.write(EmbeddedPtcl.b_ext_cambio_estado);//0x01\n //mConnectedThread.write(EmbeddedPtcl.b_ext_cambio_estado); //0x01\n break;\n case 0x03:\n //Cambio de Pulsos\n switch (bufferRecepcion[9]){\n case 0x01:\n // FLUJO\n if(hoseEntities.size() > 0){\n cambiarPulsos(indiceLayoutHose);\n }\n break;\n case 0x02:\n // INICIO NO FLUJO\n if(hoseEntities.size() > 0){\n cambiarEstadoSinFlujo(indiceLayoutHose);\n }\n break;\n case 0x03:\n // NO FLUJO\n if(hoseEntities.size() > 0){\n cambiarEstadoCierreHook(indiceLayoutHose);\n }\n break;\n }\n break;\n case 0x04:\n //Vehiculo Leido\n if(hoseEntities.size() > 0){\n cambiarPlaca(indiceLayoutHose);\n }\n\n clientTCPThread.write(EmbeddedPtcl.b_ext_cambio_estado);//0x01\n break;\n case 0x07:\n //Ultima transaccion\n\n if(hoseEntities.size() > 0){\n\n /*for(int j = 0; j< hoseEntities.size(); j++){\n if(hoseEntities.get(j).idBomba == idBomba){\n //llenarDatosTransaccion(hoseEntities.get(j));\n break;\n }\n }*/\n\n llenarDatosTransaccion(hoseEntities.get(indiceLayoutHose),indiceLayoutHose);\n\n }\n clientTCPThread.write(EmbeddedPtcl.b_ext_cambio_estado);//0x01\n //mConnectedThread.write(EmbeddedPtcl.b_ext_cambio_estado); //0x01\n break;\n }\n break;\n\n case 0x07:\n switch(bufferRecepcion[5]){\n case 0x01:\n break;\n }\n break;\n }\n changeFragment=true;\n }", "public void TesteCompleto() {\n\n\n TectoySunmiPrint.getInstance().initPrinter();\n TectoySunmiPrint.getInstance().setSize(24);\n\n // Alinhamento do texto\n\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Alinhamento\\n\");\n TectoySunmiPrint.getInstance().printText(\"--------------------------------\\n\");\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_RIGTH);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n\n // Formas de impressão\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Formas de Impressão\\n\");\n TectoySunmiPrint.getInstance().printText(\"--------------------------------\\n\");\n TectoySunmiPrint.getInstance().setSize(28);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printStyleBold(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleAntiWhite(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleDoubleHeight(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleDoubleWidth(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleInvert(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleItalic(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleStrikethRough(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleUnderLine(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printTextWithSize(\"TecToy Automação\\n\", 35);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printTextWithSize(\"TecToy Automação\\n\", 28);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_RIGTH);\n TectoySunmiPrint.getInstance().printTextWithSize(\"TecToy Automação\\n\",50);\n // TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().setSize(24);\n\n\n // Impressão de BarCode\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Imprime BarCode\\n\");\n TectoySunmiPrint.getInstance().printText(\"--------------------------------\\n\");\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printBarCode(\"7894900700046\", TectoySunmiPrint.BarCodeModels_EAN13, 162, 2,\n TectoySunmiPrint.BarCodeTextPosition_INFORME_UM_TEXTO);\n TectoySunmiPrint.getInstance().printAdvanceLines(2);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printBarCode(\"7894900700046\", TectoySunmiPrint.BarCodeModels_EAN13, 162, 2,\n TectoySunmiPrint.BarCodeTextPosition_ABAIXO_DO_CODIGO_DE_BARRAS);\n TectoySunmiPrint.getInstance().printAdvanceLines(2);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_RIGTH);\n TectoySunmiPrint.getInstance().printBarCode(\"7894900700046\", TectoySunmiPrint.BarCodeModels_EAN13, 162, 2,\n TectoySunmiPrint.BarCodeTextPosition_ACIMA_DO_CODIGO_DE_BARRAS_BARCODE);\n TectoySunmiPrint.getInstance().printAdvanceLines(2);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printBarCode(\"7894900700046\", TectoySunmiPrint.BarCodeModels_EAN13, 162, 2,\n TectoySunmiPrint.BarCodeTextPosition_ACIMA_E_ABAIXO_DO_CODIGO_DE_BARRAS);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().print3Line();\n // Impressão de BarCode\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Imprime QrCode\\n\");\n TectoySunmiPrint.getInstance().printText(\"--------------------------------\\n\");\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printQr(\"www.tectoysunmi.com.br\", 8, 1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printQr(\"www.tectoysunmi.com.br\", 8, 1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_RIGTH);\n TectoySunmiPrint.getInstance().printQr(\"www.tectoysunmi.com.br\", 8, 1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printDoubleQRCode(\"www.tectoysunmi.com.br\",\"tectoysunmi\", 7, 1);\n //TectoySunmiPrint.getInstance().feedPaper();\n\n\n // Impresão Imagem\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Imprime Imagem\\n\");\n TectoySunmiPrint.getInstance().printText(\"-------------------------------\\n\");\n BitmapFactory.Options options = new BitmapFactory.Options();\n options.inTargetDensity = 160;\n options.inDensity = 160;\n Bitmap bitmap1 = null;\n Bitmap bitmap = null;\n if (bitmap == null) {\n bitmap = BitmapFactory.decodeResource(getResources(), test, options);\n }\n if (bitmap1 == null) {\n bitmap1 = BitmapFactory.decodeResource(getResources(), test1, options);\n bitmap1 = scaleImage(bitmap1);\n }\n TectoySunmiPrint.getInstance().printBitmap(bitmap1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().print3Line();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printBitmap(bitmap1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().print3Line();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_RIGTH);\n TectoySunmiPrint.getInstance().printBitmap(bitmap1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().print3Line();\n\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Imprime Tabela\\n\");\n TectoySunmiPrint.getInstance().printText(\"--------------------------------\\n\");\n\n String[] prod = new String[3];\n int[] width = new int[3];\n int[] align = new int[3];\n\n width[0] = 100;\n width[1] = 50;\n width[2] = 50;\n\n align[0] = TectoySunmiPrint.Alignment_LEFT;\n align[1] = TectoySunmiPrint.Alignment_CENTER;\n align[2] = TectoySunmiPrint.Alignment_RIGTH;\n\n prod[0] = \"Produto 001\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n prod[0] = \"Produto 002\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n prod[0] = \"Produto 003\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n prod[0] = \"Produto 004\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n prod[0] = \"Produto 005\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n prod[0] = \"Produto 006\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n TectoySunmiPrint.getInstance().print3Line();\n TectoySunmiPrint.getInstance().openCashBox();\n TectoySunmiPrint.getInstance().cutpaper();\n\n }", "private void savePinchazos(String estado) {\n int c = mPinchazos.size();\n for (Pinchazo pinchazo : mPinchazos) {\n pinchazo.setEstado(estado);\n estudioAdapter.updatePinchazosSent(pinchazo);\n publishProgress(\"Actualizando Pinchazos\", Integer.valueOf(mPinchazos.indexOf(pinchazo)).toString(), Integer\n .valueOf(c).toString());\n }\n //actualizar.close();\n }", "private void aumentaCapacidade(){\n\t\tif(this.tamanho == this.elementos.length){\n\t\t\tObject[] elementosNovos = new Object[this.elementos.length*2];\n\t\t\tfor(int i =0; i<this.elementos.length;i++){\n\t\t\t\telementosNovos[i]=this.elementos[i];\n\t\t\t}\n\t\t\tthis.elementos=elementosNovos;\n\t\t}\n\t}", "public static void TroskoviPredjenogPuta() {\n\t\tUtillMethod.izlistavanjeVozila();\n\t\tSystem.out.println(\"Unesite redni broj vozila za koje zelite da racunate predjeni put!\");\n\t\tint redniBroj = UtillMethod.unesiteInt();\n\t\tif (redniBroj < Main.getVozilaAll().size()) {\n\t\t\tif (!Main.getVozilaAll().get(redniBroj).isVozObrisano()) {\n\t\t\t\tSystem.out.println(\"Unesite broj kilometara koje ste presli sa odgovarajucim vozilom\");\n\t\t\t\tdouble km = UtillMethod.unesiteBroj();\n\t\t\t\tVozilo v = Main.getVozilaAll().get(redniBroj);\n\t\t\t\tdouble rezultat;\n\t\t\t\tif(v.getGorivaVozila().size()>1) {\n\t\t\t\t\tGorivo g = UtillMethod.izabirGoriva();\n\t\t\t\t\trezultat = cenaTroskaVoz(v,km,g);\n\t\t\t\t}else {\n\t\t\t\t\t rezultat = cenaTroskaVoz(v,km,v.getGorivaVozila().get(0));\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Cena troskova za predjeni put je \" + rezultat + \"Dinara!\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Ovo vozilo je obrisano i ne moze da se koristi!\");\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"Uneli ste pogresan redni broj!\");\n\t\t}\n\t}", "public void run() {\r\n\r\n SQLRow rowPrefCompte = tablePrefCompte.getRow(2);\r\n this.rowPrefCompteVals.loadAbsolutelyAll(rowPrefCompte);\r\n // TVA Coll\r\n int idCompteTVACol = this.rowPrefCompteVals.getInt(\"ID_COMPTE_PCE_TVA_VENTE\");\r\n if (idCompteTVACol <= 1) {\r\n String compte;\r\n try {\r\n compte = ComptePCESQLElement.getComptePceDefault(\"TVACollectee\");\r\n idCompteTVACol = ComptePCESQLElement.getId(compte);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n SQLRow rowCompteTVACol = tableCompte.getRow(idCompteTVACol);\r\n\r\n // TVA Ded\r\n int idCompteTVADed = this.rowPrefCompteVals.getInt(\"ID_COMPTE_PCE_TVA_ACHAT\");\r\n if (idCompteTVADed <= 1) {\r\n try {\r\n String compte = ComptePCESQLElement.getComptePceDefault(\"TVADeductible\");\r\n idCompteTVADed = ComptePCESQLElement.getId(compte);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n SQLRow rowCompteTVADed = tableCompte.getRow(idCompteTVADed);\r\n\r\n // TVA intracomm\r\n int idCompteTVAIntra = this.rowPrefCompteVals.getInt(\"ID_COMPTE_PCE_TVA_INTRA\");\r\n if (idCompteTVAIntra <= 1) {\r\n try {\r\n String compte = ComptePCESQLElement.getComptePceDefault(\"TVAIntraComm\");\r\n idCompteTVAIntra = ComptePCESQLElement.getId(compte);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n SQLRow rowCompteTVAIntra = tableCompte.getRow(idCompteTVAIntra);\r\n\r\n // Achats intracomm\r\n int idCompteAchatsIntra = this.rowPrefCompteVals.getInt(\"ID_COMPTE_PCE_ACHAT_INTRA\");\r\n if (idCompteAchatsIntra <= 1) {\r\n try {\r\n String compte = ComptePCESQLElement.getComptePceDefault(\"AchatsIntra\");\r\n idCompteAchatsIntra = ComptePCESQLElement.getId(compte);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n SQLRow rowCompteAchatIntra = tableCompte.getRow(idCompteAchatsIntra);\r\n\r\n // TVA immo\r\n int idCompteTVAImmo = this.rowPrefCompteVals.getInt(\"ID_COMPTE_PCE_TVA_IMMO\");\r\n if (idCompteTVAImmo <= 1) {\r\n try {\r\n String compte = ComptePCESQLElement.getComptePceDefault(\"TVAImmo\");\r\n idCompteTVAImmo = ComptePCESQLElement.getId(compte);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n SQLRow rowCompteTVAImmo = tableCompte.getRow(idCompteTVAImmo);\r\n\r\n PdfGenerator_3310 p = new PdfGenerator_3310();\r\n this.m = new HashMap<String, Object>();\r\n\r\n long v010 = -this.sommeCompte.soldeCompte(70, 70, true, this.dateDebut, this.dateFin);\r\n this.m.put(\"A01\", GestionDevise.round(v010));\r\n\r\n // long vA02 = this.sommeCompte.soldeCompte(70, 70, true, this.dateDebut, this.dateFin);\r\n this.m.put(\"A02\", \"\");\r\n long tvaIntra = -this.sommeCompte.sommeCompteFils(rowCompteTVAIntra.getString(\"NUMERO\"), this.dateDebut, this.dateFin);\r\n long achatsIntra = this.sommeCompte.sommeCompteFils(rowCompteAchatIntra.getString(\"NUMERO\"), this.dateDebut, this.dateFin);\r\n this.m.put(\"A03\", GestionDevise.round(achatsIntra));\r\n this.m.put(\"A04\", \"\");\r\n this.m.put(\"A05\", \"\");\r\n this.m.put(\"A06\", \"\");\r\n this.m.put(\"A07\", \"\");\r\n\r\n long tvaCol = -this.sommeCompte.sommeCompteFils(rowCompteTVACol.getString(\"NUMERO\"), this.dateDebut, this.dateFin) + tvaIntra;\r\n this.m.put(\"B08\", GestionDevise.round(tvaCol));\r\n this.m.put(\"B08HT\", GestionDevise.round(Math.round(tvaCol / 0.196)));\r\n this.m.put(\"B09\", \"\");\r\n this.m.put(\"B09HT\", \"\");\r\n this.m.put(\"B09B\", \"\");\r\n this.m.put(\"B09BHT\", \"\");\r\n\r\n this.m.put(\"B10\", \"\");\r\n this.m.put(\"B10HT\", \"\");\r\n this.m.put(\"B11\", \"\");\r\n this.m.put(\"B11HT\", \"\");\r\n this.m.put(\"B12\", \"\");\r\n this.m.put(\"B12HT\", \"\");\r\n this.m.put(\"B13\", \"\");\r\n this.m.put(\"B13HT\", \"\");\r\n this.m.put(\"B14\", \"\");\r\n this.m.put(\"B14HT\", \"\");\r\n\r\n this.m.put(\"B15\", \"\");\r\n this.m.put(\"B16\", GestionDevise.round(tvaCol));\r\n this.m.put(\"B17\", GestionDevise.round(tvaIntra));\r\n this.m.put(\"B18\", \"\");\r\n final String numeroCptTVAImmo = rowCompteTVAImmo.getString(\"NUMERO\");\r\n long tvaImmo = this.sommeCompte.sommeCompteFils(numeroCptTVAImmo, this.dateDebut, this.dateFin);\r\n this.m.put(\"B19\", GestionDevise.round(tvaImmo));\r\n\r\n final String numeroCptTVADed = rowCompteTVADed.getString(\"NUMERO\");\r\n long tvaAutre = this.sommeCompte.sommeCompteFils(numeroCptTVADed, this.dateDebut, this.dateFin);\r\n\r\n // Déduction de la tva sur immo si elle fait partie des sous comptes\r\n if (numeroCptTVAImmo.startsWith(numeroCptTVADed)) {\r\n tvaAutre -= tvaImmo;\r\n }\r\n\r\n this.m.put(\"B20\", GestionDevise.round(tvaAutre));\r\n this.m.put(\"B21\", \"\");\r\n this.m.put(\"B22\", \"\");\r\n this.m.put(\"B23\", \"\");\r\n long tvaDed = tvaAutre + tvaImmo;\r\n this.m.put(\"B24\", GestionDevise.round(tvaDed));\r\n\r\n this.m.put(\"C25\", \"\");\r\n this.m.put(\"C26\", \"\");\r\n this.m.put(\"C27\", \"\");\r\n this.m.put(\"C28\", GestionDevise.round(tvaCol - tvaDed));\r\n this.m.put(\"C29\", \"\");\r\n this.m.put(\"C30\", \"\");\r\n this.m.put(\"C31\", \"\");\r\n this.m.put(\"C32\", GestionDevise.round(tvaCol - tvaDed));\r\n\r\n p.generateFrom(this.m);\r\n\r\n SwingUtilities.invokeLater(new Runnable() {\r\n public void run() {\r\n Map3310.this.bar.setValue(95);\r\n }\r\n });\r\n\r\n SwingUtilities.invokeLater(new Runnable() {\r\n public void run() {\r\n\r\n String file = TemplateNXProps.getInstance().getStringProperty(\"Location3310PDF\") + File.separator + String.valueOf(Calendar.getInstance().get(Calendar.YEAR)) + File.separator\r\n + \"result_3310_2.pdf\";\r\n System.err.println(file);\r\n File f = new File(file);\r\n Gestion.openPDF(f);\r\n Map3310.this.bar.setValue(100);\r\n }\r\n });\r\n\r\n }", "private void visualizarm(){\r\n switch(this.opc){\r\n case 1:\r\n System.out.printf(\"0\\t1\\t2\\t3\\t4\\t\\t\\t\\t\"+min+\":\"+seg+\"\\n\");\r\n System.out.printf(\"-----------------------------------------------------\\n\");\r\n for(int i=0;i<2;i++){\r\n for(int j=0;j<5;j++){\r\n System.out.printf(\"%s\\t\",mfacil[i][j]);\r\n }\r\n System.out.printf(\"|\"+i+\"\\n\");\r\n }\r\n break;\r\n case 2:\r\n System.out.printf(\"0\\t1\\t2\\t3\\t4\\t5\\n\");\r\n System.out.printf(\"-----------------------------------------------------\\n\");\r\n for(int i=0;i<3;i++){\r\n for(int j=0;j<6;j++){\r\n System.out.printf(\"%s\\t\",mmedio[i][j]);\r\n }\r\n System.out.printf(\"|\"+i+\"\\n\");\r\n }\r\n break;\r\n case 3:\r\n System.out.printf(\"0\\t1\\t2\\t3\\t4\\t5\\t6\\n\");\r\n System.out.printf(\"------------------------------------------------------------------------\\n\");\r\n for(int i=0;i<4;i++){\r\n for(int j=0;j<7;j++){\r\n System.out.printf(\"%s\\t\",mdificil[i][j]);\r\n }\r\n System.out.printf(\"|\"+i+\"\\n\");\r\n }\r\n break;\r\n }\r\n }", "@Override\n public void memoria() {\n \n }", "private void EstablecerVistas(TipoGestion tGestion){\n\t\tCantEjecutada=Utilitarios.round(activ.getCantidadEjecutada(),4);\n\t\n\t\tcantContratada=Utilitarios.round(activ.getCantidadContratada(),4);\n\t\t\n\t\t//CantPendienteDeEjecutar = Utilitarios.round((activ.getCantidadContratada()-activ.getCantidadEjecutada()),4);\n\n\n\t\tif ( activ.getCantidadEjecutada() > activ.getCantidadContratada()){\n\t\t\tCantPendienteDeEjecutar = 0;\n\t\t\tCantExcendete = Utilitarios.round((activ.getCantidadEjecutada()-activ.getCantidadContratada()),4);\n\t\t\tPorcExcedente = Utilitarios.round((CantExcendete / cantContratada * 100),2);\n\t\t\t((TextView) getActivity().findViewById(R.id.tv_fragAgregarAvancesRenglon_PorcCantidadExcedente)).setTextColor(getResources().getColorStateList(R.color.graphRed));\n\t\t}\n\t\telse{\n\t\t\tCantPendienteDeEjecutar = Utilitarios.round((activ.getCantidadContratada()-activ.getCantidadEjecutada()),4);\n\t\t\t((TextView) getActivity().findViewById(R.id.tv_fragAgregarAvancesRenglon_PorcCantidadExcedente)).setTextColor(getResources().getColorStateList(R.color.graphGreen));\n\t\t}\n\n\t\t\n\t\tif ( activ.getCantidadContratada() > 0){\n\t\t\t\tPorcEjecutado=Utilitarios.round((activ.getCantidadEjecutada()/cantContratada) * 100,2);\n\t\t\t\tPorcPendienteDeEjecutar = Utilitarios.round((CantPendienteDeEjecutar / cantContratada * 100),2);\n\t\t\t}\n\t\telse{\n\t\t\tPorcPendienteDeEjecutar\t= 0.00;\n\t\t\tPorcPendienteDeEjecutar = 0.00;\n\t\t}\n\n\t\t((TextView) getActivity()\n\t\t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_Actividad))\n\t\t\t\t.setText(String.valueOf(cantContratada));\n\n\t\t((TextView) getActivity()\n \t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_CantidadContratada))\n \t\t\t.setText(String.valueOf(cantContratada));\n\n \t((TextView) getActivity()\n \t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_CantidadEjecutada))\n \t\t\t.setText(String.valueOf(CantEjecutada));\n\n \t((TextView) getActivity()\n \t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_PorcCantidadEjecutada))\n \t\t\t.setText( String.valueOf(PorcEjecutado) + \"%\");\n\n\n \ttvEtiquetaAgregarAvances.setText(getActivity().getString(R.string.fragment_agregar_avances_renglon_4));\n\n\t\tdesActividad.setText(\"[\" + activ.getCodigoInstitucional() + \"] - \" + activ.getDescripcion());\n \t\n\t\tif(tGestion == TipoGestion.Por_Cantidades){\n\t\t\t((TextView) getActivity()\n \t\t\t.findViewById(R.id.et_fragAgregarAvancesEtiquetaPorc))\n \t\t\t.setVisibility(0);\n \t}\n \telse{\n \t\t\n \t\t((TextView) getActivity()\n \t\t\t.findViewById(R.id.et_fragAgregarAvancesEtiquetaPorc))\n \t\t\t.setText(\"%\");\n\n \t}\n\n\t\t\n\t\t//Se deshabilitara el widget de ingreso del avance para cuando la cantidad\n\t\t//pendiente de ejecutar sea igual o menor a 0\n\t\t/*if (CantPendienteDeEjecutar>0){\n \t((TextView) getActivity()\n \t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_FechaActualizo))\n \t\t\t.setText(getActivity().getResources().getString(R.string.fragment_agregar_avances_renglon_2)\n \t\t\t\t\t+ \" \" + String.valueOf(activ.getFechaActualizacion()));\n \t}\n \telse\n \t{\n \t\tToast.makeText(getActivity(), getActivity().getString(R.string.fragment_agregar_avances_renglon_5), Toast.LENGTH_LONG).show();\n \t\tetNuevoAvance.setText(\"0.00\");\n \t\tetNuevoAvance.setEnabled(false);\n \t}*/\n \t\n \t((TextView) getActivity()\n \t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_CantidadPorEjecutar))\n \t\t\t.setText(String.valueOf(Utilitarios.round(CantPendienteDeEjecutar, 4)));\n \t((TextView) getActivity()\n \t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_PorcCantidadPorEjecutar))\n \t\t\t.setText(String.valueOf(Utilitarios.round(PorcPendienteDeEjecutar, 2)) + \"%\");\n\n\t\t((TextView) getActivity()\n\t\t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_CantidadExcedente))\n\t\t\t\t.setText(String.valueOf(Utilitarios.round(CantExcendete, 4)));\n\n\t\t((TextView) getActivity()\n\t\t\t\t.findViewById(R.id.tv_fragAgregarAvancesRenglon_PorcCantidadExcedente))\n\t\t\t\t.setText(String.valueOf(Utilitarios.round(PorcExcedente, 2)) + \"%\");\n\n\t\tvalidarAvance(String.valueOf(etNuevoAvance.getText()));\n \t\n \tetNuevoAvance.addTextChangedListener(new TextWatcher() {\n \t\t\n\t\t\t@Override\n\t\t\tpublic void beforeTextChanged(CharSequence s, int start,\n\t\t\t\t\tint count, int after) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onTextChanged(CharSequence s, int start,\n\t\t\t\t\tint before, int count) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tvalidarAvance(s.toString());\n\t\t\t\t\t\t\t\t\t\n\t\t\t}\n \t});\n\t\t\n\t}", "private void procedureBasePrDessin(){\n if(courante == null){\n reset();\n courante = new Tortue(simpleLogo.getFeuille(), true);\n simpleLogo.setBarreOutilsVisible(true);\n }\n }", "public frmMovimenti() {\n initComponents();\n\n MicroBench mb = new MicroBench();\n mb.start();\n\n// griglia.setNoTnxResize(true);\n //apro la combo pagamenti\n this.comCausale.dbOpenList(Db.getConn(), \"select descrizione, codice from tipi_causali_magazzino order by codice\", null, false);\n mb.out(\"frmMovimenti mb due openlist piccoli 1\");\n\n deposito.dbOpenList(Db.getConn(), \"select CONCAT(nome, ' [', id, ']'), id from depositi order by nome\");\n filtro_deposito.dbOpenList(Db.getConn(), \"select CONCAT(nome, ' [', id, ']'), id from depositi order by nome\");\n\n mb.out(\"frmMovimenti mb due openlist piccoli 2\");\n\n //associo il panel ai dati\n this.dati.dbNomeTabella = \"movimenti_magazzino\";\n this.dati.dbNomeTabellaAlias = \"m\";\n\n Vector chiave = new Vector();\n chiave.add(\"id\");\n this.dati.dbChiave = chiave;\n this.dati.butSave = this.butSave;\n this.dati.butUndo = this.butUndo;\n this.dati.butFind = this.butFind;\n this.dati.butNew = this.butNew;\n this.dati.butDele = this.butDele;\n this.dati.tipo_permesso = Permesso.PERMESSO_MAGAZZINO;\n\n this.dati.dbChiaveAutoInc = true;\n this.dati.dbOpen(Db.getConn(), \"select * from movimenti_magazzino order by data desc, id desc limit 1\");\n this.dati.dbRefresh();\n\n mb.out(\"frmMovimenti mb apertura dati\");\n\n //apro la griglia\n //this.griglia.dbEditabile = true;\n this.griglia.dbChiave = chiave;\n this.griglia.flagUsaThread = false;\n\n java.util.Hashtable colsWidthPerc = new java.util.Hashtable();\n\n// griglia.dbOpen(Db.getConn(), \"select m.*, a.codice_fornitore, a.codice_a_barre from movimenti_magazzino m left join articoli a on m.articolo = a.codice order by id desc\", Db.INSTANCE, true);\n refresh();\n\n griglia.dbPanel = this.dati;\n\n mb.out(\"frmMovimenti mb apertura griglia\");\n\n DelayedExecutor articolo_select = new DelayedExecutor(new Runnable() {\n public void run() {\n System.out.println(\"articolo_select this = \" + this);\n texCodiArti.setText(\"\");\n try {\n texCodiArti.setText(articolo_ref.get().codice);\n } catch (Exception e) {\n e.printStackTrace();\n }\n dati.dbForzaModificati();\n }\n }, 100);\n InvoicexUtil.getArticoloIntelliHints(articolo, this, articolo_ref, articolo_select, null);\n\n dati.addDbListener(new DbListener() {\n\n public void statusFired(DbEvent event) {\n if (event.getStatus() == tnxDbPanel.STATUS_REFRESHING || event.getStatus() == tnxDbPanel.STATUS_ADDING) {\n //carico dati articolo\n labDatiArticolo.setText(\"\");\n articolo.setText(\"\");\n List<Map> l;\n try {\n l = DbUtils.getListMap(Db.getConn(), \"select * from articoli where codice = '\" + Db.aa(texCodiArti.getText()) + \"'\");\n String da = \"Cod. fornitore \" + l.get(0).get(\"codice_fornitore\") + \" / Cod. a barre \" + l.get(0).get(\"codice_a_barre\");\n labDatiArticolo.setText(da);\n articolo.setText(cu.s(l.get(0).get(\"descrizione\")));\n } catch (Exception ex) {\n }\n\n //controllo provenienza\n String tab = cu.s(dati.dbGetField(\"da_tabella\"));\n String da_id = cu.s(dati.dbGetField(\"da_id\"));\n String da_id_riga = cu.s(dati.dbGetField(\"da_id_riga\"));\n if (StringUtils.isBlank(tab) || event.getStatus() == tnxDbPanel.STATUS_ADDING) {\n// dati.setDbReadOnly(false);\n setReadonly(false);\n\n labGenerato.setVisible(false);\n labProv.setVisible(false);\n } else {\n// dati.setDbReadOnly(true);\n setReadonly(true);\n\n labGenerato.setVisible(true);\n String tipodoc = Db.getTipoDocDaNomeTabT(tab);\n Map rec = null;\n String numero = \"\";\n try {\n rec = dbu.getListMap(Db.getConn(), \"select serie, numero, data from \" + tab + \" where id = \" + da_id).get(0);\n numero = cu.s(rec.get(\"serie\")) + cu.s(rec.get(\"numero\")) + \" del \" + DateUtils.formatDateIta(cu.toDate(rec.get(\"data\")));\n } catch (Exception e) {\n }\n labProv.setText(Db.getDescTipoDocBreve(tipodoc) + \" \" + numero);\n labProv.setVisible(true);\n }\n }\n }\n\n private void setReadonly(boolean come) {\n Component[] comps = dati.getComponents();\n for (Component comp : comps) {\n if (comp instanceof tnxTextField || comp instanceof tnxComboField) {\n if (!cu.s(comp.getName()).equals(\"lotto\")\n && !cu.s(comp.getName()).equals(\"matricola\")\n && !cu.s(comp.getName()).equals(\"note\")) {\n comp.setEnabled(!come);\n }\n }\n }\n articolo.setEnabled(!come);\n }\n });\n\n dati.griglia = griglia;\n dati.dbRefresh();\n\n InvoicexUtil.getArticoloIntelliHints(filtro_articolo, this, articolo_selezionato_filtro_ref, delay_filtro, null);\n\n mb.out(\"frmMovimenti mb refresh dati\");\n\n }", "public Proyectil(){\n disparar=false;\n ubicacion= new Rectangle(0,0,ancho,alto);\n try {\n look = ImageIO.read(new File(\"src/Disparo/disparo.png\"));\n } catch (IOException ex) {\n System.out.println(\"error la imagen del proyectil no se encuentra en la ruta por defecto\");\n }\n }", "public static void promedioBoletaCliente() {\r\n\t\tPailTap clienteBoleta = getDataTap(\"C:/Paula/masterset/data/9\");\r\n\t\tPailTap boletaProperty = getDataTap(\"C:/Paula/masterset/data/4\");\r\n\t\t\r\n\t\tSubquery promedio = new Subquery(\"?Cliente_id\", \"?Promedio\", \"?Dia\")\r\n\t\t\t\t.predicate(clienteBoleta, \"_\", \"?data\")\r\n\t\t\t\t.predicate(boletaProperty, \"_\", \"?data2\")\r\n\t\t\t\t.predicate(new ExtractClienteBoleta(), \"?data\").out(\"?Cliente_id\", \"?Boleta_id\", \"?Dia\")\r\n\t\t\t\t.predicate(new ExtractBoletaTotal(), \"?data2\").out(\"?Boleta_id\",\"?Total\")\r\n\t\t\t\t.predicate(new Avg(), \"?Total\").out(\"?Promedio\");\r\n\t\t\r\n\t\tSubquery tobatchview = new Subquery(\"?json\")\r\n\t\t\t\t.predicate(promedio, \"?Cliente\", \"?Promedio\", \"?Dia\")\r\n\t\t\t\t.predicate(new ToJSON(), \"?Cliente\", \"?Promedio\", \"?Dia\").out(\"?json\");\r\n\t\tApi.execute(new batchview(), tobatchview);\r\n\t\t//Api.execute(new StdoutTap(), promedio);\r\n\t}", "public void switchSmart(){\n\r\n for (int i = 0; i < item.getDevices().size(); i++) {\r\n write(parseBrightnessCmd(seekBarBrightness.getProgress()), 3, seekBarBrightness.getProgress(), item.getDevices().get(i).getSocket(), item.getDevices().get(i).getBos());\r\n }\r\n\r\n //String CMD_HSV = \"{\\\"id\\\":1,\\\"method\\\":\\\"set_hsv\\\",\\\"params\\\":[0, 0, \\\"smooth\\\", 30]}\\r\\n\";\r\n //write(CMD_HSV, 0, 0);\r\n\r\n for (int i = 0; i < item.getDevices().size(); i++) {\r\n write(parseRGBCmd(msAccessColor(Color.WHITE)), 0, 0, item.getDevices().get(i).getSocket(), item.getDevices().get(i).getBos());\r\n }\r\n\r\n }", "@Override\n protected Void doInBackground(Void... params) {\n suResult = Shell.SU.run(new String[] {\n \"wm density 120\"\n });\n return null;\n }", "@Override\n\tpublic void manejoVida(int cantVida, int tipCambio) {\n\t\t\n\t}", "public void actualiza() {\n //Si el indice de bloque a mover no es -1(no hay que mover bloque)...\n if(bAvanzaBloque) {\n for (Object objeBloque : lnkBloques) {\n Objeto objBloque = (Objeto) objeBloque;\n //Mueves los bloques que hay que mover\n if(objBloque.getVelocidad()!=0) {\n objBloque.abajo();\n }\n }\n }\n //Si la direccion X es true(el proyectil va a la derecha)\n if (bDireccionX) {\n objProyectil.derecha();\n } //Si es false (va ala izquierda)\n else {\n objProyectil.izquierda();\n }\n\n //Si la direccion Y es true(el proyectil va hacia arriba)\n if (!bDireccionY) {\n objProyectil.arriba();\n } //Si es false (va hacia abajo)\n else {\n objProyectil.abajo();\n }\n\n if (iNumBloques == 0) { // Si se acaban los bloques\n iNumBloques = 54; // Se reinicia la variable de los bloques\n iNivel++; // Aumenta el nivel\n // Se reposiciona el proyectil\n objProyectil.reposiciona((objBarra.getX() + objBarra.getAncho() / 2\n - (objProyectil.getAncho() / 2)), (objBarra.getY()\n - objProyectil.getAlto()));\n // Se aumenta la velocidad del proyectil\n objProyectil.setVelocidad(objProyectil.getVelocidad() + 3);\n // Se reposiciona la barra\n objBarra.reposiciona(((getWidth() / 2)\n - (objProyectil.getAncho() / 2)), (getHeight()\n - objBarra.getAlto()));\n // se limpia la lista de bloques\n lnkBloques.clear();\n // se vuelve a llenar y se acomoda\n try {\n acomodaBloques();\n } catch (IOException ioeError) {\n System.out.println(\"Hubo un error al cargar el juego: \"\n + ioeError.toString());\n }\n // se mueve hacia arriba el proyectil\n bDireccionY = false;\n bDireccionX = true;\n }\n\n if (iVidas == 0) {\n bPerdio = true;\n }\n /*if (iVidas == 0) {\n bPerdio = true;\n bPausado = true;\n iNumBloques = 54; // se reinicia la cantidad de bloques\n iNivel = 1; // vuelve al nivel 1\n // La direccion del proyectil sera para arrib\n bDireccionY = false;\n // La direccion que nos interesa es: false: Izq. true: Dererecha\n bDireccionX = true;\n // Se reposiciona el proyectil\n objProyectil.reposiciona((objBarra.getX() + objBarra.getAncho() / 2\n - (objProyectil.getAncho() / 2)), (objBarra.getY()\n - objProyectil.getAlto()));\n // Se reincia la velocidad del proyectil\n objProyectil.setVelocidad(5);\n // Se reposiciona la barra\n objBarra.reposiciona(((getWidth() / 2) \n - (objProyectil.getAncho() / 2)), (getHeight() \n - objBarra.getAlto()));\n // se limpia la lista de bloques\n lnkBloques.clear();\n // se vuelve a llenar y se acomoda\n try {\n acomodaBloques();\n } catch (IOException ioeError) {\n System.out.println(\"Hubo un error al cargar el juego: \"\n + ioeError.toString());\n }\n }\n \n if (!bPerdio) {\n iVidas = 3; // se reinicia la cantidad de vidas\n iScore = 0; // se reincia el score\n }*/\n }", "public void aplicarDescuento();", "private void tallennaTiedostoon() {\n viitearkisto.tallenna();\n }", "public void carroPulando() {\n\t\tpulos++;\n\t\tpulo = (int) (PULO_MAXIMO/10);\n\t\tdistanciaCorrida += pulo;\n\t\tif (distanciaCorrida > distanciaTotalCorrida) {\n\t\t\tdistanciaCorrida = distanciaTotalCorrida;\n\t\t}\n\t}", "public void transferir(double valor, ContaBancaria contaDestino) {\n this.saldo -= valor;\n\n //colocando na conta destino\n contaDestino.saldo += valor;\n }", "private static void dodajClanaUTabelu(Clan c) {\r\n\t\tDefaultTableModel dtm = (DefaultTableModel) teretanaGui.getTable().getModel();\r\n\t\tdtm.addRow(new Object[] { c.getBrojClanskeKarte(), c.getIme(), c.getPrezime(), c.getPol() });\r\n\t\tcentrirajTabelu();\r\n\t}", "@Override\n protected Void doInBackground(Void... params) {\n suResult = Shell.SU.run(new String[] {\n \"wm density 160\"\n });\n return null;\n }", "public void transferPatty(Patty p)\r\n {\r\n if (stillRunning)\r\n {\r\n // stop cooking it\r\n p.cooking = false;\r\n p.draggable = false;\r\n \r\n // change the img to a 150x15 rectangle of the right color (side view)\r\n GreenfootImage newPattyImage = new GreenfootImage(150, 15);\r\n newPattyImage.setColor(pickPattyColor(p));\r\n newPattyImage.fillRect(0, 0, 150, 15);\r\n p.setImage(newPattyImage);\r\n \r\n // put it in the right place\r\n p.setLocation(prepTable.burger.getX(), prepTable.burger.getY());\r\n \r\n // remove it from the grill\r\n grill.patties[p.index] = null;\r\n \r\n // put it on the table\r\n prepTable.burger.patty = p;\r\n }\r\n }", "protected void choixModeTri(){\r\n boolean choix = false;\r\n OPMode.menuChoix=true;\r\n OPMode.telemetryProxy.addLine(\"**** CHOIX DU MODE DE TRI ****\");\r\n OPMode.telemetryProxy.addLine(\" Bouton X : GAUCHE\");\r\n OPMode.telemetryProxy.addLine(\" Bouton B : DROITE\");\r\n OPMode.telemetryProxy.addLine(\" Bouton Y : UNE SEULE COULEUR\");\r\n OPMode.telemetryProxy.addLine(\" Bouton A : MANUEL\");\r\n OPMode.telemetryProxy.addLine(\" CHOIX ? .........\");\r\n OPMode.telemetryProxy.update();\r\n while (!choix){\r\n if (gamepad.x){\r\n OPMode.modeTri = ModeTri.GAUCHE;\r\n choix = true;\r\n }\r\n if (gamepad.b){\r\n OPMode.modeTri = ModeTri.DROITE;\r\n choix = true;\r\n }\r\n if (gamepad.y){\r\n OPMode.modeTri = ModeTri.UNI;\r\n choix = true;\r\n }\r\n if (gamepad.a){\r\n OPMode.modeTri = ModeTri.MANUEL;\r\n choix = true;\r\n }\r\n }\r\n OPMode.menuChoix = false;\r\n\r\n }", "public void actionPerformed(ActionEvent e) {\n if (e.getActionCommand().compareTo(\"Copy\")==0) {\n StringBuilder sbf=new StringBuilder();\n // Check to ensure we have selected only a contiguous block of\n // cells\n int numcols=jTable1.getSelectedColumnCount();\n int numrows=jTable1.getSelectedRowCount();\n int[] rowsselected=jTable1.getSelectedRows();\n int[] colsselected=jTable1.getSelectedColumns();\n if (rowsselected.length==0 || colsselected.length==0) return;\n if (!((numrows-1==rowsselected[rowsselected.length-1]-rowsselected[0] &&\n numrows==rowsselected.length) &&\n (numcols-1==colsselected[colsselected.length-1]-colsselected[0] &&\n numcols==colsselected.length)))\n {\n JOptionPane.showMessageDialog(null, \"Invalid Copy Selection\",\n \"Invalid Copy Selection\",\n JOptionPane.ERROR_MESSAGE);\n return;\n }\n for (int i=0;i<numrows;i++) {\n for (int j=0;j<numcols;j++) {\n sbf.append(jTable1.getValueAt(rowsselected[i],colsselected[j]));\n if (j<numcols-1) sbf.append(\"\\t\");\n }\n sbf.append(\"\\n\");\n }\n stsel = new StringSelection(sbf.toString());\n system = Toolkit.getDefaultToolkit().getSystemClipboard();\n system.setContents(stsel,stsel);\n }\n if (e.getActionCommand().compareTo(\"Paste\")==0) {\n int[] rows=jTable1.getSelectedRows();\n int[] cols=jTable1.getSelectedColumns();\n if (rows.length==0 || cols.length==0) return;\n int startRow=rows[0];\n int startCol=cols[0];\n try\n {\n String trstring= (String)(system.getContents(this).getTransferData(DataFlavor.stringFlavor));\n //System.out.println(\"String is:\"+trstring);\n StringTokenizer st1=new StringTokenizer(trstring,\"\\n\");\n for(int i=0;st1.hasMoreTokens();i++)\n {\n rowstring=st1.nextToken();\n StringTokenizer st2=new StringTokenizer(rowstring,\"\\t\");\n for(int j=0;st2.hasMoreTokens();j++)\n {\n value=(String)st2.nextToken();\n if (startRow+i==jTable1.getRowCount() && expandable) { // add row if necessary\n TableModel model = jTable1.getModel();\n if (model instanceof DefaultTableModel) {\n Object[] newrow=new Object[jTable1.getColumnCount()];\n for (int k=0;k<newrow.length;k++) newrow[k]=\"\";\n ((DefaultTableModel)model).addRow(newrow);\n }\n }\n if (startRow+i<jTable1.getRowCount()&& startCol+j<jTable1.getColumnCount()) {\n Object typeValue=value;\n if (value!=null && convertNumerical!=CONVERT_NONE) {\n try {\n Double doubleval=Double.parseDouble(value);\n if (convertNumerical==CONVERT_TO_INTEGER || (convertNumerical==CONVERT_TO_DOUBLE_OR_INTEGER && doubleval.intValue()==doubleval.doubleValue())) typeValue=new Integer(doubleval.intValue());\n else typeValue=doubleval;\n } catch (NumberFormatException ex) {}\n }\n if (jTable1.isCellEditable(startRow+i,startCol+j)) {\n jTable1.setValueAt(typeValue,startRow+i,startCol+j);\n //System.out.println(\"Convert[\"+typeValue.getClass().getSimpleName()+\"] \"+value+\"=>\"+typeValue+\" at row=\"+startRow+i+\" column=\"+startCol+j+\" convertNumerical=\"+convertNumerical);\n }\n }\n }\n }\n }\n catch(Exception ex){}\n } \n if (e.getActionCommand().compareTo(\"Delete\")==0) {\n int[] rows=jTable1.getSelectedRows();\n int[] cols=jTable1.getSelectedColumns(); \n if (cols.length==jTable1.getColumnCount() && (jTable1.getModel() instanceof DefaultTableModel) && expandable) { // delete complete rows\n DefaultTableModel model = (DefaultTableModel)jTable1.getModel();\n for (int i=0;i<rows.length;i++) {\n model.removeRow(rows[i]-i);\n } \n if (model.getRowCount()==0) {\n Object[] newrow=new Object[jTable1.getColumnCount()];\n for (int k=0;k<newrow.length;k++) newrow[k]=null;\n model.addRow(newrow); \n }\n } else { // delete only cell content\n for (int i=0;i<rows.length;i++) {\n for (int j=0;j<cols.length;j++) {\n jTable1.setValueAt(null,rows[i],cols[j]);\n }\n }\n }\n }\n if (e.getActionCommand().compareTo(\"PressedTab\")==0) {\n if (jTable1.getModel() instanceof DefaultTableModel && expandable) {\n int currentRow=jTable1.getSelectedRow();\n int currentColumn=jTable1.getSelectedColumn();\n if (currentRow+1==jTable1.getRowCount() && currentColumn+1==jTable1.getColumnCount()) {\n Object[] newrow=new Object[jTable1.getColumnCount()];\n for (int k=0;k<newrow.length;k++) newrow[k]=null;\n ((DefaultTableModel)jTable1.getModel()).addRow(newrow);\n }\n }\n oldTabAction.actionPerformed(e);\n }\n if (e.getActionCommand().compareTo(\"PressedArrowdown\")==0) {\n if (jTable1.getModel() instanceof DefaultTableModel && expandable) {\n int currentRow=jTable1.getSelectedRow();\n if (currentRow+1==jTable1.getRowCount()) {\n Object[] newrow=new Object[jTable1.getColumnCount()];\n for (int k=0;k<newrow.length;k++) newrow[k]=null;\n ((DefaultTableModel)jTable1.getModel()).addRow(newrow);\n }\n }\n oldArrowdownAction.actionPerformed(e);\n } \n }", "@Override\n protected Void doInBackground(Void... params) {\n suResult = Shell.SU.run(new String[] {\n \"wm density 240\"\n });\n return null;\n }", "private void botol() {\n if (liter==0){\n\n wliter.setText(\"1L\");\n wbattery.setImageResource(R.drawable.ic_battery_20);\n Toast.makeText(this,\"Air Sedikit\", Toast.LENGTH_SHORT).show();\n }\n else if (liter==1){\n wliter.setText(\"2L\");\n wbattery.setImageResource(R.drawable.ic_battery_50);\n\n }\n else if (liter==2){\n wliter.setText(\"3L\");\n wbattery.setImageResource(R.drawable.ic_battery_60);\n\n }\n else if (liter==3){\n wliter.setText(\"4L\");\n wbattery.setImageResource(R.drawable.ic_battery_80);\n ;\n }\n else if (liter==4){\n wliter.setText(\"5L\");\n wbattery.setImageResource(R.drawable.ic_battery_90);\n\n }\n else if (liter==5){\n wliter.setText(\"6L\");\n wbattery.setImageResource(R.drawable.ic_battery_full);\n Toast.makeText(this,\"Air Sudah Penuh\", Toast.LENGTH_SHORT).show();\n }\n\n }", "private void aumentarPilha() {\n this.pilhaMovimentos++;\n }", "public void copy() {\n\t\tcmd = new CopyCommand(editor);\n\t\tinvoker = new MiniEditorInvoker(cmd);\n\t\tinvoker.action();\n\t}", "private void moverJogadorDaVez(int dado1, int dado2) throws Exception {\n // System.out.println(\"moverJogadorDaVez\" + dado1 + \" , \" + dado2);\n\n print(\"\\ttirou nos dados: \" + dado1 + \" , \" + dado2);\n int valorDados = dado1 + dado2;\n\n int jogador = this.jogadorAtual();\n\n boolean ValoresIguais = false;\n\n\n //preciso saber se o jogador vai passar pela posição 40, o que significa\n //ganhar dinheiro\n this.completouVolta(jogador, valorDados);\n\n if (dado1 == dado2) {\n ValoresIguais = true;\n } else {\n ValoresIguais = false;\n }\n\n //movendo à posição\n this.moverJogadorAPosicao(jogador, valorDados, ValoresIguais);\n this.print(\"\\tAtual dinheiro antes de ver a compra:\" + this.listaJogadores.get(jogador).getDinheiro());\n this.print(\"\\tVai até a posição \" + this.posicoes[jogador]);\n\n //vendo se caiu na prisao\n if (this.posicoes[this.jogadorAtual()] == 30 && this.prisao == true) {\n adicionaNaPrisao(listaJogadores.get(jogadorAtual()));\n DeslocarJogador(jogador, 10);\n listaJogadores.get(jogadorAtual()).adicionarComandoPay();\n }\n\n\n\n Lugar lugar = this.tabuleiro.get(this.posicoes[jogador] - 1);//busca em -1, pois eh um vetor\n\n\n if (this.isCompraAutomatica()) {\n this.realizarCompra(jogador, lugar);\n }\n\n if (!this.posicaoCompravel(this.posicoes[jogador])) {\n this.print(\"\\t\" + lugar.getNome() + \" não está à venda!\");\n\n\n String nomeDono = (String) Donos.get(this.posicoes[jogador]);\n //não cobrar aluguel de si mesmo\n if (!nomeDono.equals(this.listaJogadores.get(this.jogadorAtual()).getNome())) {\n\n if (this.isUmJogador(nomeDono)) {\n Jogador possivelDono = this.getJogadorByName(nomeDono);\n\n if (this.isPosicaoFerrovia(this.posicoes[jogador])) {\n this.print(\"\\tO dono eh \" + possivelDono.getNome());\n if (!lugar.estaHipotecada()) {\n this.pagarFerrovia(possivelDono.getId(), jogador, 25, lugar.getNome());\n }\n } else {\n\n this.print(\"\\tO dono eh \" + possivelDono.getNome());\n int valorAluguel = 0;\n if (this.posicoes[this.jogadorAtual()] != 12 && this.posicoes[this.jogadorAtual()] != 28) {\n valorAluguel = this.tabuleiro.getLugarPrecoAluguel(this.posicoes[jogador]);\n\n } else {\n if (possivelDono.getQuantidadeCompanhias() == 1) {\n valorAluguel = 4 * valorDados;\n\n }\n if (possivelDono.getQuantidadeCompanhias() == 2) {\n valorAluguel = 10 * valorDados;\n\n }\n }\n if (!lugar.estaHipotecada()) {\n this.pagarAluguel(possivelDono.getId(), jogador, valorAluguel, lugar.getNome());\n }\n\n }\n\n }\n }\n\n }\n\n\n this.pagarEventuaisTaxas(jogador);\n\n if ((this.posicoes[this.jogadorAtual()] == 2 || this.posicoes[jogadorAtual()] == 17 || this.posicoes[jogadorAtual()] == 33) && cards == true) {\n realizaProcessamentoCartaoChest();\n }\n\n if ((this.posicoes[this.jogadorAtual()] == 7 || this.posicoes[jogadorAtual()] == 22 || this.posicoes[jogadorAtual()] == 36) && cards == true) {\n realizaProcessamentoCartaoChance();\n }\n\n\n\n\n this.print(\"\\tAtual dinheiro depois:\" + this.listaJogadores.get(jogador).getDinheiro());\n\n\n\n }", "@Override\n protected Void doInBackground(Void... params) {\n suResult = Shell.SU.run(new String[] {\n \"wm density 320\"\n });\n return null;\n }", "private void BajarPiezaRapido() {\n if (!Mover(piezaActual, posicionX, posicionY - 1)) {\r\n BajarPieza1posicion();\r\n }\r\n }", "private void cargarTablaConPaquetes() {\n tcId.setCellValueFactory(\n new PropertyValueFactory<Paquete, String>(\"codigo\"));\n tcdescripcion.setCellValueFactory(\n new PropertyValueFactory<Paquete, String>(\"descripcion\"));\n tcDestino.setCellValueFactory(\n new PropertyValueFactory<Paquete, String>(\"destino\"));\n tcEntregado.setCellValueFactory(\n new PropertyValueFactory<Paquete, Boolean>(\"entregado\"));\n\n tbPaqueteria.setItems(data);\n tbPaqueteria.getSelectionModel().selectFirst();\n\n //TODO futura implementacion\n //setDobleClickFila();\n }", "void Comunicasiones() { \t\r\n /* Comunicacion */\r\n Button dComunicacion01 = new Button();\r\n dComunicacion01.setWidth(\"73px\");\r\n dComunicacion01.setHeight(\"47px\");\r\n dComunicacion01.setIcon(ByosImagenes.icon[133]);\r\n dComunicacion01.setStyleName(EstiloCSS + \"BotonComunicacion\");\r\n layout.addComponent(dComunicacion01, \"left: 661px; top: 403px;\"); \r\n\r\n /* Comunicacion */\r\n Button iComunicacion01 = new Button();\r\n iComunicacion01.setWidth(\"73px\");\r\n iComunicacion01.setHeight(\"47px\");\r\n iComunicacion01.setIcon(ByosImagenes.icon[132]);\r\n iComunicacion01.setStyleName(EstiloCSS + \"BotonComunicacion\");\r\n layout.addComponent(iComunicacion01, \"left: 287px; top: 403px;\"); \r\n \r\n }", "@SuppressWarnings(\"deprecation\")\n @Override\n public void onClick(View arg0) {\n CopyText4 = copyTxt4.getText().toString();\n if (CopyText4.length() != 0) {\n if (sdk < android.os.Build.VERSION_CODES.HONEYCOMB) {\n android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);\n clipboard.setText(CopyText4);\n Toast.makeText(getApplicationContext(), \"Text Telah Ter-Copy ke Clipboard\", Toast.LENGTH_SHORT).show();\n } else {\n android.content.ClipboardManager clipboard = (android.content.ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);\n android.content.ClipData clip = android.content.ClipData.newPlainText(\"Clip\", CopyText4);\n Toast.makeText(getApplicationContext(), \"Text Telah Ter-Copy ke Clipboard\", Toast.LENGTH_SHORT).show();\n clipboard.setPrimaryClip(clip);\n }\n } else {\n Toast.makeText(getApplicationContext(), \"Text Kosong, Tidak ada apapun yang ter-Copy\", Toast.LENGTH_SHORT).show();\n }\n }", "public void cargarTitulos1() throws SQLException {\n\n tabla1.addColumn(\"CLAVE\");\n tabla1.addColumn(\"NOMBRE\");\n tabla1.addColumn(\"DIAS\");\n tabla1.addColumn(\"ESTATUS\");\n\n this.tbpercep.setModel(tabla1);\n\n TableColumnModel columnModel = tbpercep.getColumnModel();\n\n columnModel.getColumn(0).setPreferredWidth(15);\n columnModel.getColumn(1).setPreferredWidth(150);\n columnModel.getColumn(2).setPreferredWidth(50);\n columnModel.getColumn(3).setPreferredWidth(70);\n\n }", "@Override\n public void updateScreen() {\n if (dirty) {\n Alkahestry.logger.info(((ContainerMoleculeSplitter) container).moleculeSplitterTileEntity.progress);\n// String name = String.valueOf(((ContainerMoleculeSplitter) container).moleculeSplitterTileEntity.progress);\n// fontRenderer.drawString(name, xSize / 2 - fontRenderer.getStringWidth(name) / 2, 6, 0x404040);\n// fontRenderer.drawString(playerInv.getDisplayName().getUnformattedText(), 8, ySize - 94, 0x404040);\n dirty = false;\n }\n// ((ContainerMoleculeSplitter) container)\n// .moleculeSplitterTileEntity\n// .\n super.updateScreen();\n }", "public void accionAtaques(int i) throws SQLException{\r\n if(turno ==0){\r\n if(pokemon_activo1.getCongelado() == false || pokemon_activo1.getDormido() == false){\r\n if(pokemon_activo1.getConfuso() == true && (int)(Math.random()*100) > 50){\r\n// inflingirDaño(pokemon_activo1.getMovimientos()[i], pokemon_activo1, pokemon_activo1);\r\n// System.out.println(\"El pokemon se ha hecho daño a si mismo!\");\r\n// try {\r\n// creg.guardarRegistroSimulacion(\"El pokemon se ha hecho daño a si mismo\");\r\n// } catch (IOException ex) {\r\n// Logger.getLogger(ControladorCombate.class.getName()).log(Level.SEVERE, null, ex);\r\n// }\r\n }\r\n else{\r\n inflingirDaño(pokemon_activo1.getMovimientos()[i], pokemon_activo2, pokemon_activo1);\r\n if(pokemon_activo2.getVida_restante() <= 0){\r\n pokemon_activo2.setVida_restante(0);\r\n pokemon_activo2.setDebilitado(true);\r\n JOptionPane.showMessageDialog(this.vc, \"El Pokemon: \"+ pokemon_activo2.getPseudonimo()+\" se ha Debilitado\", \"Debilitado\", JOptionPane.INFORMATION_MESSAGE);\r\n System.out.println(\"El Pokemon: \"+ pokemon_activo2.getPseudonimo()+\" se ha Debilitado\");\r\n try {\r\n creg.guardarRegistroSimulacion(\"El Pokemon: \"+ pokemon_activo2.getPseudonimo()+\" se ha Debilitado\");\r\n } catch (IOException ex) {\r\n Logger.getLogger(ControladorCombate.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n if(condicionVictoria(getEquipo1(), getEquipo2()) == true){\r\n JOptionPane.showMessageDialog(this.vc, \"El Ganador de este Combate es:\"+ entrenador1.getNombre(), \"Ganador\", JOptionPane.INFORMATION_MESSAGE);\r\n System.out.println(\"El Ganador de este Combate es:\"+ entrenador1.getNombre());\r\n try {\r\n creg.guardarRegistroSimulacion(\"El Ganador de este Combate es:\"+ entrenador1.getNombre());\r\n } catch (IOException ex) {\r\n Logger.getLogger(ControladorCombate.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n vc.dispose();\r\n vpc.dispose();\r\n combate.setGanador(entrenador1);\r\n combate.setPerdedor(entrenador2);\r\n termino = true;\r\n if(esLider == true){\r\n cmed.ganoCombate();\r\n }\r\n }\r\n else if(getEquipo2()[0].getDebilitado() == false){\r\n pokemon_activo2 = getEquipo2()[0]; \r\n }\r\n else if(getEquipo2()[1].getDebilitado() == false){\r\n pokemon_activo2 = getEquipo2()[1]; \r\n }\r\n else if(getEquipo2()[2].getDebilitado() == false){\r\n pokemon_activo2 = getEquipo2()[2]; \r\n }\r\n else if(getEquipo2()[3].getDebilitado() == false){\r\n pokemon_activo2 = getEquipo2()[3]; \r\n }\r\n else if(getEquipo2()[4].getDebilitado() == false){\r\n pokemon_activo2 = getEquipo2()[4]; \r\n }\r\n else if(getEquipo2()[5].getDebilitado() == false){\r\n pokemon_activo2 = getEquipo2()[5]; \r\n }\r\n vc.setjL_nombrepokemon2(pokemon_activo2.getPseudonimo());\r\n vc.setjL_especie2(pokemon_activo2.getNombre_especie());\r\n vc.setjL_Nivel2(pokemon_activo2.getNivel());\r\n \r\n }\r\n va.setVisible(false);\r\n vc.setjL_Turno_actual(entrenador2.getNombre());\r\n vc.setjL_vida_actual1(pokemon_activo1.getVida_restante(), pokemon_activo1.getVida());\r\n vc.setjL_vida_actual2(pokemon_activo2.getVida_restante(), pokemon_activo2.getVida());\r\n if(tipo_simulacion == 1){\r\n JOptionPane.showMessageDialog(this.vc, \"Turno\"+\" \"+entrenador2.getNombre(), \"Tu Turno\", JOptionPane.INFORMATION_MESSAGE);\r\n System.out.println(\"Turno\"+\" \"+entrenador2.getNombre());\r\n try {\r\n creg.guardarRegistroSimulacion(\"Turno\"+\" \"+entrenador2.getNombre());\r\n } catch (IOException ex) {\r\n Logger.getLogger(ControladorCombate.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n vc.turnoJugador2();\r\n this.turno = 1;\r\n }\r\n else if(tipo_simulacion == 2){\r\n if(termino==false){\r\n turnoSistema();\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n System.out.println(\"El pokemon no puede atacar\");\r\n try {\r\n creg.guardarRegistroSimulacion(\"El pokemon no puede atacar\");\r\n } catch (IOException ex) {\r\n Logger.getLogger(ControladorCombate.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n if((int)(Math.random()*3) == 1){ //1/3 de probabilidad de desactivar el efecto\r\n pokemon_activo1.setCongelado(false);\r\n pokemon_activo1.setDormido(false);\r\n }\r\n }\r\n \r\n }\r\n else if(turno ==1){\r\n if(pokemon_activo2.getCongelado() == false || pokemon_activo2.getDormido() == false){\r\n if(pokemon_activo2.getConfuso() == true && (int)(Math.random()*100) > 50){\r\n// inflingirDaño(pokemon_activo2.getMovimientos()[i], pokemon_activo2, pokemon_activo2);\r\n// System.out.println(\"El pokemon se ha hecho daño a si mismo!\");\r\n// try {\r\n// creg.guardarRegistroSimulacion(\"El pokemon se ha hecho daño a si mismo!\");\r\n// } catch (IOException ex) {\r\n// Logger.getLogger(ControladorCombate.class.getName()).log(Level.SEVERE, null, ex);\r\n// }\r\n }\r\n else{\r\n inflingirDaño(pokemon_activo2.getMovimientos()[i], pokemon_activo1, pokemon_activo2);\r\n if(pokemon_activo1.getVida_restante() <= 0){\r\n pokemon_activo1.setVida_restante(0);\r\n pokemon_activo1.setDebilitado(true);\r\n JOptionPane.showMessageDialog(this.vc, \"El Pokemon: \"+ pokemon_activo1.getPseudonimo()+\" se ha Debilitado\", \"Debilitado\", JOptionPane.INFORMATION_MESSAGE);\r\n System.out.println(\"El Pokemon: \"+ pokemon_activo1.getPseudonimo()+\" se ha Debilitado\");\r\n try {\r\n creg.guardarRegistroSimulacion(\"El Pokemon: \"+ pokemon_activo1.getPseudonimo()+\" se ha Debilitado\");\r\n } catch (IOException ex) {\r\n Logger.getLogger(ControladorCombate.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n if(condicionVictoria(getEquipo1(), getEquipo2()) == true){\r\n JOptionPane.showMessageDialog(this.vc, \"El Ganador de este Combate es:\"+ entrenador2.getNombre(), \"Ganador\", JOptionPane.INFORMATION_MESSAGE);\r\n System.out.println(\"El Ganador de este Combate es:\"+ entrenador2.getNombre());\r\n try {\r\n creg.guardarRegistroSimulacion(\"El Ganador de este Combate es:\"+ entrenador2.getNombre());\r\n } catch (IOException ex) {\r\n Logger.getLogger(ControladorCombate.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n vc.dispose();\r\n vpc.dispose();\r\n combate.setGanador(entrenador2);\r\n combate.setPerdedor(entrenador1);\r\n }\r\n else if(getEquipo1()[0].getDebilitado() == false){\r\n pokemon_activo1 = getEquipo1()[0]; \r\n }\r\n else if(getEquipo1()[1].getDebilitado() == false){\r\n pokemon_activo1 = getEquipo1()[1]; \r\n }\r\n else if(getEquipo1()[2].getDebilitado() == false){\r\n pokemon_activo1 = getEquipo1()[2]; \r\n }\r\n else if(getEquipo1()[3].getDebilitado() == false){\r\n pokemon_activo1 = getEquipo1()[3]; \r\n }\r\n else if(getEquipo1()[4].getDebilitado() == false){\r\n pokemon_activo1 = getEquipo1()[4]; \r\n }\r\n else if(getEquipo1()[5].getDebilitado() == false){\r\n pokemon_activo1 = getEquipo1()[5]; \r\n }\r\n vc.setjL_nombrepokemon1(pokemon_activo1.getPseudonimo());\r\n vc.setjL_especie1(pokemon_activo1.getNombre_especie());\r\n vc.setjL_Nivel1(pokemon_activo1.getNivel());\r\n }\r\n va.setVisible(false);\r\n vc.setjL_Turno_actual(entrenador1.getNombre());\r\n vc.setjL_vida_actual1(pokemon_activo1.getVida_restante(), pokemon_activo1.getVida());\r\n vc.setjL_vida_actual2(pokemon_activo2.getVida_restante(), pokemon_activo2.getVida());\r\n JOptionPane.showMessageDialog(this.vc, \"Turno\"+\" \"+entrenador1.getNombre(), \"Tu Turno\", JOptionPane.INFORMATION_MESSAGE);\r\n System.out.println(\"Turno\"+\" \"+entrenador1.getNombre());\r\n try {\r\n creg.guardarRegistroSimulacion(\"Turno\"+\" \"+entrenador1.getNombre());\r\n } catch (IOException ex) {\r\n Logger.getLogger(ControladorCombate.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n vc.turnoJugador1();\r\n this.turno = 0;\r\n }\r\n }\r\n else {\r\n System.out.println(\"El pokemon no puede atacar\");\r\n try {\r\n creg.guardarRegistroSimulacion(\"El pokemon no puede atacar\");\r\n } catch (IOException ex) {\r\n Logger.getLogger(ControladorCombate.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n if((int)(Math.random()*3) == 1){ //1/3 de probabilidad de desactivar el efecto\r\n pokemon_activo2.setCongelado(false);\r\n pokemon_activo2.setDormido(false);\r\n }\r\n }\r\n }\r\n setLabelEstados(1);\r\n setLabelEstados(0); \r\n \r\n }", "public void seleccionarTipoComprobante() {\r\n if (com_tipo_comprobante.getValue() != null) {\r\n tab_tabla1.setCondicion(\"fecha_trans_cnccc between '\" + cal_fecha_inicio.getFecha() + \"' and '\" + cal_fecha_fin.getFecha() + \"' and ide_cntcm=\" + com_tipo_comprobante.getValue());\r\n tab_tabla1.ejecutarSql();\r\n tab_tabla2.ejecutarValorForanea(tab_tabla1.getValorSeleccionado());\r\n } else {\r\n tab_tabla1.limpiar();\r\n tab_tabla2.limpiar();\r\n }\r\n tex_num_transaccion.setValue(null);\r\n calcularTotal();\r\n utilitario.addUpdate(\"gri_totales,tex_num_transaccion\");\r\n }", "private static void popuniTabelu() {\r\n\t\tDefaultTableModel dfm = (DefaultTableModel) teretanaGui.getTable().getModel();\r\n\r\n\t\tdfm.setRowCount(0);\r\n\r\n\t\tfor (int i = 0; i < listaClanova.size(); i++) {\r\n\t\t\tClan c = listaClanova.getClan(i);\r\n\t\t\tdfm.addRow(new Object[] { c.getBrojClanskeKarte(), c.getIme(), c.getPrezime(), c.getPol() });\r\n\t\t}\r\n\t\tcentrirajTabelu();\r\n\t}", "@Override // Métodos que fazem a anulação\n\tpublic void vota() {\n\t\t\n\t}", "private void supprAffichage() {\n switch (afficheChoix) {\n case AFFICHE_SPOOL :\n ecranSpool.deleteContents();\n break;\n case AFFICHE_USER :\n ecranUser.deleteContents();\n break;\n case AFFICHE_CONFIG :\n ecranConfig.deleteContents();\n break;\n default: break;\n }\n afficheChoix = AFFICHE_RIEN;\n }", "public void mostrarFatura() {\n\n int i;\n System.err.println(\"Fatura do contrato:\\n\");\n\n if (hospedesCadastrados.isEmpty()) {//caso nao existam hospedes\n System.err.println(\"Nao existe hospedes cadastrados\\n\");\n\n } else {\n System.err.println(\"Digite o cpf do hospede:\\n\");\n\n listarHospedes();\n int cpf = verifica();\n for (i = 0; i < hospedesCadastrados.size(); i++) {//roda os hospedes cadastrados\n if (hospedesCadastrados.get(i).getCpf() == cpf) {//pega o hospede pelo cpf\n if (hospedesCadastrados.get(i).getContrato().isSituacao()) {//caso a situacao do contrato ainda estaja ativa\n\n System.err.println(\"Nome do hospede:\" + hospedesCadastrados.get(i).getNome());\n System.err.println(\"CPF:\" + hospedesCadastrados.get(i).getCpf() + \"\\n\");\n System.err.println(\"Servicos pedidos:\\nCarros:\");\n if (!(hospedesCadastrados.get(i).getContrato().getCarrosCadastrados() == null)) {\n System.err.println(hospedesCadastrados.get(i).getContrato().getCarrosCadastrados().toString());\n System.err.println(\"Total do serviço de aluguel de carros R$:\" + hospedesCadastrados.get(i).getContrato().getContaFinalCarros() + \"\\n\");//;\n } else {\n System.err.println(\"\\nO hospede nao possui carros cadastrados!\\n\");\n }\n System.err.println(\"Quartos:\");\n if (!(hospedesCadastrados.get(i).getContrato().getQuartosCadastrados() == null)) {\n System.err.println(hospedesCadastrados.get(i).getContrato().getQuartosCadastrados().toString());\n System.err.println(\"Total do servico de quartos R$:\" + hospedesCadastrados.get(i).getContrato().getContaFinalQuartos() + \"\\n\");//;\n } else {\n System.err.println(\"\\nO hospede nao possui Quartos cadastrados!\\n\");\n }\n System.err.println(\"Restaurante:\");\n System.err.println(\"Total do servico de restaurante R$: \" + hospedesCadastrados.get(i).getContrato().getValorRestaurante() + \"\\n\");\n System.err.println(\"Total de horas de BabySitter contratatas:\" + hospedesCadastrados.get(i).getContrato().getHorasBaby() / 45 + \"\\n\"\n + \"Total do servico de BabySitter R$:\" + hospedesCadastrados.get(i).getContrato().getHorasBaby() + \"\\n\");\n System.err.println(\"Total Fatura final: R$\" + hospedesCadastrados.get(i).getContrato().getContaFinal());\n //para limpar as disponibilidades dos servicos\n //carros, quarto, contrato e hospede\n //é necessario remover o hospede?\n// \n\n } else {//caso o contrato esteja fechado\n System.err.println(\"O hospede encontra-se com o contrato fechado!\");\n }\n }\n\n }\n }\n }", "private void moverFondo() {\n ActualizaPosicionesFondos();\n noAleatorio = MathUtils.random(1, 5); // crea los numeros para cambiar los mapas de manera aleatoria\n if (xFondo == -texturaFondoBase.getWidth()){\n //Cambio de fondo base\n texturaFondoBase= mapaAleatorio(noAleatorio);\n modificacionFondoBase= true; //Avisa que ya se modifico los fondos de inicio.\n }\n if (xFondo == -(texturaFondoApoyo.getWidth()+texturaFondoBase.getWidth())){\n //Cambio fondo de apoyo\n texturaFondoApoyo= mapaAleatorio(noAleatorio);\n xFondo= 0; //al pasar el segundo fondo regresa el puntero al primer fondo.\n modificacionFondoBase= true; //Avisa que ya se modifico los fondos de inicio.\n }\n }", "public void clicTable(View v) {\n try {\n conteoTab ct = clc.get(tb.getIdTabla() - 1);\n\n if(ct.getEstado().equals(\"0\")) {\n String variedad = ct.getVariedad();\n String bloque = ct.getBloque();\n Long idSiembra = ct.getIdSiembra();\n String idSiempar = String.valueOf(idSiembra);\n\n long idReg = ct.getIdConteo();\n int cuadro = ct.getCuadro();\n int conteo1 = ct.getConteo1();\n int conteo4 = ct.getConteo4();\n int total = ct.getTotal();\n\n txtidReg.setText(\"idReg:\" + idReg);\n txtCuadro.setText(\"Cuadro: \" + cuadro);\n cap_1.setText(String.valueOf(conteo1));\n cap_2.setText(String.valueOf(conteo4));\n cap_ct.setText(String.valueOf(total));\n txtId.setText(\"Siembra: \" + idSiempar);\n txtVariedad.setText(\"Variedad: \" + variedad);\n txtBloque.setText(\"Bloque: \" + bloque);\n }else{\n Toast.makeText(this, \"No se puede cargar el registro por que ya ha sido enviado\", Toast.LENGTH_SHORT).show();\n }\n\n } catch (Exception E) {\n Toast.makeText(getApplicationContext(), \"No has seleccionado aún una fila \\n\" + E, Toast.LENGTH_LONG).show();\n }\n }", "public static void tienda(){\n System.out.print(\"\\033[H\\033[2J\");//limpia pantalla\n System.out.flush();\n int opcionCompra; //variables locales a utilizar\n Scanner scannerDos=new Scanner(System.in);\n //mostrando en pantalla las opciones de la tienda\n System.out.println(\"Bienvenido a la tienda, que deceas adquirir:\\n\");\n\tSystem.out.println(\"PRODUCTO \\tPRECIO \\tBENEFICIO\");\n\tSystem.out.println(\"1.Potion \\t50 oro \\tcura 25 HP\");\n\tSystem.out.println(\"2.Hi-Potion\\t100 oro \\tcura 75 HP\");\n\tSystem.out.println(\"3.M-Potion \\t75 oro \\trecupera 10 MP\");\n //ingresando numero de opcion\n System.out.println(\"\\n\\nIngrese numero de opcion:\");\n opcionCompra=scannerDos.nextInt();\n //comparando la opcion de compra\n switch(opcionCompra){\n case 1:{//condicion de oro necesario para el articulo1 \n\t\t\tif(oro>=50){\n articulo1=articulo1+1;\n System.out.println(\"compra exitosa\");\n }else {\n System.out.println(\"oro insuficiente!!!\");\n }\n break;\n }\n\t\tcase 2:{//condicion de oro necesario para el articulo2\n if(oro>=100){\n articulo2=articulo2+1;\n }else{ \n System.out.println(\"oro insuficiente!!!\");\n }\n break;\n }\n\t default:{//condicion de oro necesario para el articulo3\n if(oro>=75){\n articulo3=articulo3+1;\n }else{ \n System.out.println(\"oro insuficiente!!!\"); //poner while para ,ejora\n \t\t}\n break;\n }\n }\n }", "@Override\n\tpublic void coba() {\n\t\t\n\t}", "private void AtulizaBanco(String cod, int matricula, double valor, int qte) {\n try {\n venda.Atualizar(cod, matricula, valor);\n Produto.ProdAtualizarQte(cod, qte);\n } catch (Exception ex) {\n Logger.getLogger(ViewCaixa.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void provocarEvolucion(Tribu tribuJugador, Tribu tribuDerrotada){\r\n System.out.println(\"\\n\");\r\n System.out.println(\"-------------------Fase de evolución ----------------------\");\r\n int indiceAtributo;\r\n int indiceAtributo2;\r\n double golpeViejo = determinarGolpe(tribuJugador);\r\n for(int i = 1; i <= 10 ; i++){\r\n System.out.println(\"Iteración número: \" + i);\r\n indiceAtributo = (int)(Math.random() * 8);\r\n indiceAtributo2 = (int)(Math.random() * 8);\r\n String nombreAtributo1 = determinarNombrePosicion(indiceAtributo);\r\n String nombreAtributo2 = determinarNombrePosicion(indiceAtributo2);\r\n if((tribuJugador.getArray()[indiceAtributo] < tribuDerrotada.getArray()[indiceAtributo] \r\n && (tribuJugador.getArray()[indiceAtributo2] < tribuDerrotada.getArray()[indiceAtributo2]))){\r\n System.out.println(\"Se cambió el atributo \" + nombreAtributo1 + \" de la tribu del jugador porque\"\r\n + \" el valor era \" + tribuJugador.getArray()[indiceAtributo] + \" y el de la tribu enemeiga era de \"\r\n + tribuDerrotada.getArray()[indiceAtributo] + \" esto permite hacer más fuerte la tribu del jugador.\");\r\n \r\n tribuJugador.getArray()[indiceAtributo] = tribuDerrotada.getArray()[indiceAtributo];\r\n \r\n System.out.println(\"Se cambió el atributo \" + nombreAtributo2 + \" de la tribu del jugador porque\"\r\n + \" el valor era \" + tribuJugador.getArray()[indiceAtributo2] + \" y el de la tribu enemeiga era de \"\r\n + tribuDerrotada.getArray()[indiceAtributo2] + \" esto permite hacer más fuerte la tribu del jugador.\");\r\n \r\n tribuJugador.getArray()[indiceAtributo2] = tribuDerrotada.getArray()[indiceAtributo2];\r\n }\r\n }\r\n double golpeNuevo = determinarGolpe(tribuJugador);\r\n if(golpeNuevo > golpeViejo){\r\n tribus.replace(tribuJugador.getNombre(), determinarGolpe(tribuJugador));\r\n System.out.println(\"\\nTribu evolucionada\");\r\n imprimirAtributos(tribuJugador);\r\n System.out.println(\"\\n\");\r\n System.out.println(tribus);\r\n }\r\n else{\r\n System.out.println(\"\\nTribu sin evolucionar\");\r\n System.out.println(\"La tribu no evolucionó porque no se encontraron atributos\"\r\n + \" que permitiesen crecer su golpe\");\r\n imprimirAtributos(tribuJugador);\r\n System.out.println(\"\\n\");\r\n System.out.println(tribus);\r\n }\r\n }", "private void copyToClipboard(int contentType) {\n\n String clipboardText = null;\n ClipData clip;\n\n switch (contentType) {\n case COPY_STATION_ALL:\n // set clip text\n if (mThisStation.getMetadata() != null) {\n clipboardText = mThisStation.getStationName() + \" - \" + mThisStation.getMetadata() + \" (\" + mThisStation.getStreamUri().toString() + \")\";\n } else {\n clipboardText = mThisStation.getStationName() + \" (\" + mThisStation.getStreamUri().toString() + \")\";\n }\n // notify user\n Toast.makeText(mActivity, mActivity.getString(R.string.toastmessage_station_copied), Toast.LENGTH_SHORT).show();\n break;\n\n case COPY_STATION_METADATA:\n // set clip text and notify user\n if (mThisStation.getMetadata() != null) {\n clipboardText = mThisStation.getMetadata();\n }\n Toast.makeText(mActivity, mActivity.getString(R.string.toastmessage_copied_to_clipboard_metadata), Toast.LENGTH_SHORT).show();\n break;\n\n case COPY_STREAM_URL:\n // set clip text and notify user\n if (mThisStation.getStreamUri() != null) {\n clipboardText = mThisStation.getStreamUri().toString();\n }\n Toast.makeText(mActivity, mActivity.getString(R.string.toastmessage_copied_to_clipboard_url), Toast.LENGTH_SHORT).show();\n break;\n\n }\n\n // create clip and to clipboard\n if (clipboardText != null) {\n clip = ClipData.newPlainText(\"simple text\", clipboardText);\n ClipboardManager cm = (ClipboardManager) mActivity.getSystemService(Context.CLIPBOARD_SERVICE);\n cm.setPrimaryClip(clip);\n }\n\n }" ]
[ "0.6368378", "0.5974035", "0.584916", "0.54508835", "0.53885376", "0.5360996", "0.5354695", "0.53187966", "0.5314489", "0.5252827", "0.5251571", "0.5237816", "0.52239645", "0.5215037", "0.52063674", "0.52032536", "0.5202613", "0.5190457", "0.5185493", "0.5167521", "0.5151023", "0.5143031", "0.5137904", "0.51313484", "0.5129343", "0.51246274", "0.5123232", "0.51218224", "0.51063263", "0.51047796", "0.5100234", "0.50979733", "0.50966996", "0.50810385", "0.5073285", "0.5050685", "0.5050482", "0.5034691", "0.5033807", "0.50337523", "0.5028455", "0.502532", "0.5025138", "0.502274", "0.5014516", "0.50135916", "0.50066173", "0.5001438", "0.49861306", "0.49797434", "0.49759403", "0.49743783", "0.49716982", "0.49629626", "0.4962074", "0.49610955", "0.49583295", "0.49548227", "0.49513966", "0.49486476", "0.49443337", "0.49436772", "0.49345848", "0.49334764", "0.49282122", "0.49280003", "0.4926584", "0.49241042", "0.49237034", "0.49219093", "0.4921908", "0.49155495", "0.49114966", "0.4910527", "0.49080864", "0.4907622", "0.49047363", "0.4903592", "0.48991486", "0.48954678", "0.4895108", "0.48946378", "0.4892098", "0.48908243", "0.48883733", "0.48836282", "0.48808238", "0.48785093", "0.4878001", "0.4875848", "0.48751804", "0.4874299", "0.487355", "0.48711923", "0.48704413", "0.48673636", "0.4866449", "0.48602733", "0.48596677", "0.485706" ]
0.5570766
3
associa ad ogni personaggio della scena un colore creando una mappa di colori
private void aggiornaMappeColori(Scena scena) { MappaColori colori=creaMappaColoriCompleta(scena.getPersonaggiPrincipali()); // pulisce l'elenco delle mappe di colori associate ad ogni // visualizzatore aggiornaColori(colori); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void colorearSecuencialAlternativo() {\n\t\tint color;\n\t\tcantColores = 0;\n\t\tfor (int i = 0; i < cantNodos; i++) {\n\t\t\tcolor = 1;\n\t\t\t/** Mientras el color no se pueda usar, elijo otro color **/\n\t\t\twhile (!sePuedeColorear(i, color))\n\t\t\t\tcolor++;\n\n\t\t\tnodos.get(i).setColor(color);\n\n\t\t\tif (color > cantColores)\n\t\t\t\tcantColores = color;\n\t\t}\n\t}", "private void changeColors(){\n \n Color vaccanceColor = vaccance.getValue();\n String vaccRGB = getRGB(vaccanceColor);\n databaseHandler.setTermColor(\"vaccance\", vaccRGB);\n \n Color travailColor = travail.getValue();\n String travailRGB = getRGB(travailColor);\n databaseHandler.setTermColor(\"travail\", travailRGB);\n \n Color AnnivColor = anniverssaire.getValue();\n String summerSemRGB = getRGB(AnnivColor);\n databaseHandler.setTermColor(\"annivessaire\", summerSemRGB);\n \n Color formationColor = formation.getValue();\n String formationRGB = getRGB(formationColor);\n databaseHandler.setTermColor(\"formation\", formationRGB);\n \n Color workshopColor = workshop.getValue();\n String workshopRGB = getRGB(workshopColor);\n databaseHandler.setTermColor(\"workshop\", workshopRGB);\n \n Color certifColor = certif.getValue();\n String certifRGB = getRGB(certifColor);\n databaseHandler.setTermColor(\"certif\", certifRGB);\n \n Color importantColor = important.getValue();\n String importantRGB = getRGB(importantColor);\n databaseHandler.setTermColor(\"important\", importantRGB);\n \n Color urgentColor = urgent.getValue();\n String allHolidayRGB = getRGB(urgentColor);\n databaseHandler.setTermColor(\"urgent\", allHolidayRGB);\n \n \n \n }", "private void initRelationsColors() {\n for (int i=0;i<20;i++) {\n int r = 255-(i*12);\n int gb = 38-(i*2);\n relationsC[i] = newColor(r,gb,gb);\n }\n // do green.. 20-39, dark to bright\n for (int i=0;i<20;i++) {\n int g = 17+(i*12);\n int rb = i*2;\n relationsC[20+i] = newColor(rb,g,rb);\n }\n }", "@Override\n public Map<String,String> getMapGloablCommunityColor(){\n return icommunityColors.getMapGloablCommunityColor();\n }", "@Override\n protected void elaboraMappaBiografie() {\n if (mappaCognomi == null) {\n mappaCognomi = Cognome.findMappaTaglioListe();\n }// end of if cycle\n }", "private void generarColor() {\r\n\t\tthis.color = COLORES[(int) (Math.random() * COLORES.length)];\r\n\t}", "public static void main(String[] args) {\n\n Sviesoforas s1 = new Sviesoforas(44,55,Color.RED);\n Sviesoforas s2 = new Sviesoforas(44,55,Color.GREEN);\n Sviesoforas s3 = new Sviesoforas(44,55,Color.YELLOW);\n\n System.out.println(Color.RED);\n\n// Color.red = Color.yellow;\n// System.out.println(Color.red);\n\n// class ColorEx extends Color {\n//\n// public ColorEx() {\n// }\n// }\n s1.setTipas(Tipas.A);\n s2.setTipas(Tipas.B);\n s3.setTipas(Tipas.C);\n\n// if ( s3.getTipas().equals(Tipas.C)) {\n if ( s3.getTipas() == Tipas.C) {\n System.out.println(\"s3 yra tipo C \");\n\n }\n }", "public Piezas(String color) {\r\n this.color = color;\r\n }", "private Color couleurOfficiel( int numeroDeCouleur) {\n\t\tif(numeroDeCouleur ==1) {\n\n\t\t\treturn new Color(230,57,70);\n\t\t}\n\n\t\tif(numeroDeCouleur ==2) {\n\n\t\t\treturn new Color(241,250,238);\n\t\t}\n\t\tif(numeroDeCouleur ==3) {\n\n\t\t\treturn new Color(168,218,220);\n\t\t}\n\t\tif(numeroDeCouleur ==4) {\n\n\t\t\treturn new Color(168,218,220);\n\t\t}\n\t\telse {\n\t\t\treturn new Color(29,53,87);\n\t\t}\n\n\t}", "private void generaMappa() {\n\t\t// lettura e acquisizione del file sorgente\n\t\tdecoder.leggiFile(filePath);\n\t\tStrutturaDati file = decoder.getFile();\n\n\t\t// creazione della mappa seguendo il sorgente\n\t\tfor (StrutturaDati map : file.getAttributi()) {\n\t\t\tif (map.getNome().equals(TAG_MAP_MAP)) {\n\t\t\t\tnomeMappa = map.getTag(TAG_MAP_TITLE);\n\t\t\t}\n\t\t}\n\n\t\t// creo tutte le celle\n\t\tfor (StrutturaDati map : file.getAttributi()) {\n\t\t\tif (map.getNome().equals(TAG_MAP_MAP)) {\n\t\t\t\tfor (StrutturaDati cell : map.getAttributi()) {\n\t\t\t\t\tif (cell.getNome().equals(TAG_MAP_CELL)) {\n\t\t\t\t\t\tint id = Integer.valueOf(cell.getTag(TAG_MAP_CELL_ID));\n\t\t\t\t\t\tint tipo = getTipo(cell.getTag(TAG_MAP_CELL_TYPE));\n\t\t\t\t\t\tString desc = getDescrizione(cell);\n\t\t\t\t\t\tCella newCella = new Cella(id, tipo, desc);\n\t\t\t\t\t\tif (tipo == TAG_C_GATE || tipo == TAG_C_LOOT) {// nel caso la casella sia un gate\n\t\t\t\t\t\t\tnewCella.setOggetto(getOggetto(cell));\n\t\t\t\t\t\t\tif (tipo == TAG_C_LOOT) {//creazione bivio anomalo l\n\t\t\t\t\t\t\t\tBivio biv = new Bivio(\"\", Integer.valueOf(cell.getTag(TAG_MAP_CELL_OPTION_DESTINATION)),false, 0, true);\n\t\t\t\t\t\t\t\tnewCella.addBivio(biv);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcelle.add(newCella);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// creazione dei bivi\n\t\tfor (StrutturaDati map : file.getAttributi()) {\n\t\t\t// ciclo gli attributi di rpg\n\t\t\tif (map.getNome().equals(TAG_MAP_MAP)) {\n\t\t\t\tfor (StrutturaDati cell : map.getAttributi()) {\n\t\t\t\t\t// ciclo gli attributi di map\n\t\t\t\t\tif (cell.getNome().equals(TAG_MAP_CELL)) {\n\t\t\t\t\t\t// acquisizione cella attuale\n\t\t\t\t\t\tint idCellaAtt = Integer.valueOf(cell.getTag(TAG_MAP_CELL_ID));\n\t\t\t\t\t\tCella cellaAtt = cercaCella(idCellaAtt);\n\t\t\t\t\t\tfor (StrutturaDati bivio : cell.getAttributi()) {\n\t\t\t\t\t\t\t// ciclo gli attributi della cella\n\t\t\t\t\t\t\tif (bivio.getNome().equals(TAG_MAP_CELL_OPTION)) {// se l'attributo e' un opzione\n\t\t\t\t\t\t\t\tint idBivio = Integer.valueOf(bivio.getTag(TAG_MAP_CELL_OPTION_DESTINATION));\n\t\t\t\t\t\t\t\tString intro = getIntroduzione(bivio);\n\t\t\t\t\t\t\t\t// set effetto se necessario ovvero la cella è una cella effetto\n\t\t\t\t\t\t\t\tif (cellaAtt.getTipo() == TAG_C_EFFETTO) {\n\t\t\t\t\t\t\t\t\tboolean hasObj = false;\n\t\t\t\t\t\t\t\t\tint effetto = getEffetto(bivio);\n\t\t\t\t\t\t\t\t\tif (bivio.getTag().containsKey(TAG_CELL_HAS_OBG)) {\n\t\t\t\t\t\t\t\t\t\tif (bivio.getTag(TAG_CELL_HAS_OBG).equals(OBJ_POSITIVE)) {\n\t\t\t\t\t\t\t\t\t\t\thasObj = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tBivio newBivio = new Bivio(intro, idBivio, true, effetto, hasObj);\n\t\t\t\t\t\t\t\t\tcellaAtt.addBivio(newBivio);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tboolean hasObj = false;\n\t\t\t\t\t\t\t\t\tif (bivio.getTag().containsKey(TAG_CELL_HAS_OBG)) {\n\t\t\t\t\t\t\t\t\t\tif (bivio.getTag(TAG_CELL_HAS_OBG).equals(OBJ_POSITIVE)) {\n\t\t\t\t\t\t\t\t\t\t\thasObj = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tBivio newBivio = new Bivio(intro, idBivio, false, 0, hasObj);\n\t\t\t\t\t\t\t\t\tcellaAtt.addBivio(newBivio);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private static void determineColor(Scene scene, RayIntersection ri, short[] rgb, Point3D eye) {\r\n\t\tfinal double PRECISION = 1e-3;\r\n\r\n\t\t// ambient component\r\n\t\tfor (int i = 0; i < 3; i++) {\r\n\t\t\trgb[i] = AMBIENT_COMPONENT;\r\n\t\t}\r\n\r\n\t\t// we add to final result contribution from all lights, if light\r\n\t\t// actually lights the object\r\n\t\tfor (LightSource ls : scene.getLights()) {\r\n\t\t\tRay ray = Ray.fromPoints(ls.getPoint(), ri.getPoint());\r\n\t\t\tRayIntersection closest = findClosestIntersection(scene, ray);\r\n\t\t\tdouble dist = ls.getPoint().sub(ri.getPoint()).norm();\r\n\r\n\t\t\t// if closest exists, skip this light (it's ray is intercepted by\r\n\t\t\t// other intersection)\r\n\t\t\tif (closest != null && closest.getDistance() + PRECISION < dist) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else {\r\n\t\t\t\t\r\n\t\t\t\t// diffusion component\r\n\t\t\t\tdouble scalarProduct = Math.max(0,\r\n\t\t\t\t\t\tri.getNormal().scalarProduct(ls.getPoint().sub(ri.getPoint()).normalize()));\r\n\t\t\t\trgb[0] += ls.getR() * ri.getKdr() * scalarProduct;\r\n\t\t\t\trgb[1] += ls.getG() * ri.getKdg() * scalarProduct;\r\n\t\t\t\trgb[2] += ls.getB() * ri.getKdb() * scalarProduct;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// reflection component\r\n\t\t\t\tPoint3D n = ri.getNormal();\r\n\t\t\t\tPoint3D v = eye.sub(ri.getPoint()).normalize();\r\n\t\t\t\tPoint3D l = ri.getPoint().sub(ls.getPoint());\r\n\t\t\t\tPoint3D r = l.sub(n.scalarMultiply(2 * n.scalarProduct(l))).normalize();\r\n\t\t\t\tscalarProduct = Math.max(0, v.scalarProduct(r));\r\n\r\n\t\t\t\trgb[0] += ls.getR() * ri.getKrr() * Math.pow(scalarProduct, ri.getKrn());\r\n\t\t\t\trgb[1] += ls.getG() * ri.getKrg() * Math.pow(scalarProduct, ri.getKrn());\r\n\t\t\t\trgb[2] += ls.getB() * ri.getKrb() * Math.pow(scalarProduct, ri.getKrn());\r\n\t\t\t\t \r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "private void createNodeColor(NodeAppearanceCalculator nac) {\r\n\t DiscreteMapping discreteMapping = new DiscreteMapping\r\n\t (Color.WHITE,\r\n\t NODE_TYPE,\r\n\t ObjectMapping.NODE_MAPPING);\r\n\t \r\n\t discreteMapping.putMapValue(\"biochemicalReaction\",\r\n\t new Color (204, 0, 61));\r\n\t discreteMapping.putMapValue(\"catalyst\",\r\n\t new Color(0, 163, 0));\r\n\t discreteMapping.putMapValue(\"protein\",\r\n\t new Color (0, 102, 255));\r\n\t discreteMapping.putMapValue(\"smallMolecule\",\r\n\t new Color (193, 249, 36));\r\n\r\n\t NodeColorCalculator nodeColorCalculator =\r\n\t new GenericNodeColorCalculator(\"SimpleBioMoleculeEditor Node Color Calculator\"\r\n\t , discreteMapping);\r\n\t nac.setNodeFillColorCalculator(nodeColorCalculator);\r\n\t }", "public Coche (String color, String modelo) {\r\n\t super(color, modelo);\r\n\t numeroDeRuedas = 4;\r\n\t }", "public void caricaCopione(Scena scena) {\n\t\t// recupera l'elenco delle battute\n\t\tArrayList<Battuta> copione = scena.getBattute();\n\t\taggiornaMappeColori(scena);\n\t\t// per ogni battuta\n\t\tfor (int i = 0; i < copione.size(); i++) {\n\t\t\tinvia(copione.get(i));\n\t\t}\n\t}", "public static void Agrupar() {\n\t\tArrayList<ArrayList<Double>> distancias_centroids = new ArrayList<ArrayList<Double>>();\n\t\tfor (int i=0;i<centroids.size();i++) {\n\t\t\tArrayList<Double> distancias= new ArrayList<Double>();\n\t\t\tfor (int j=0;j<petalas.size();j++) {\n\t\t\t\tdouble x1= centroids.get(i).petal_length;\n\t\t\t\tdouble x2= petalas.get(j).petal_length;\n\t\t\t\tdouble y1= centroids.get(i).petal_width;\n\t\t\t\tdouble y2= petalas.get(j).petal_width;\n\t\t\t\tdouble cateto1= x1-x2;\n\t\t\t\tdouble cateto2= y1-y2;\n\t\t\t\tdouble hipotenusa = Math.sqrt(cateto1*cateto1+cateto2*cateto2);\n\t\t\t\tdistancias.add(hipotenusa);\n\t\t\t\t/*\n\t\t\t\tSystem.out.println(\"cateto1: \"+cateto1);\n\t\t\t\tSystem.out.println(\"cateto2: \"+cateto2);\n\t\t\t\tSystem.out.println(\"hipotenusa: \"+hipotenusa);\n\t\t\t\t*/\n\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\tdistancias_centroids.add(distancias);\t\t\t\n\t\t}\n\t\t/*\n\t\tSystem.out.println(\"Distancias Centroids:\");\n\t\tfor (int i=0;i<distancias_centroids.size();i++) {\n\t\t\tSystem.out.println(\"Centroid \"+i);\n\t\t\tfor (int j=0;j<distancias_centroids.get(i).size();j++) {\n\t\t\t\tSystem.out.println(distancias_centroids.get(i).get(j));\n\t\t\t}\n\t\t}\n\t\t*/\n\t\t//Para qual centroid pertece cada ponto\n\t\tArrayList<ArrayList<Petala>> pontos_de_cada_centroid = new ArrayList<ArrayList<Petala>>();\n\t\tfor (int i=0;i<centroids.size();i++) {\n\t\t\tArrayList<Petala> p = new ArrayList<Petala>();\n\t\t\tpontos_de_cada_centroid.add(p); \n\t\t}\n\t\tfor (int i=0;i<petalas.size();i++) {\n\t\t\tdouble menor =100;\n\t\t\tint centroid_menor=0;\n\t\t\tfor (int j=0;j<centroids.size();j++) {\n\t\t\t\tif (distancias_centroids.get(j).get(i)<menor) {\n\t\t\t\t\tmenor = distancias_centroids.get(j).get(i);\n\t\t\t\t\tcentroid_menor=j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpontos_de_cada_centroid.get(centroid_menor).add(petalas.get(i));\n\t\t}\n\t\t/*\n\t\tfor (int i=0;i<pontos_de_cada_centroid.size();i++) {\n\t\t\tSystem.out.println(\"Centroid \"+i);\n\t\t\tSystem.out.println(\"Petalas: \");\n\t\t\tSystem.out.println(pontos_de_cada_centroid.get(i));\n\t\t}\n\t\t*/\n\t\t//Novos centroids\n\t\tArrayList<Petala> novos_centroids = new ArrayList<Petala>();\n\t\tfor (int i=0;i<pontos_de_cada_centroid.size();i++) {\n\t\t\tdouble soma_x=0;\n\t\t\tdouble soma_y=0;\n\t\t\tfor (int j=0;j<pontos_de_cada_centroid.get(i).size();j++) {\n\t\t\t\tsoma_x+=pontos_de_cada_centroid.get(i).get(j).petal_length;\n\t\t\t\tsoma_y+=pontos_de_cada_centroid.get(i).get(j).petal_width;\n\t\t\t}\n\t\t\tdouble novo_x=soma_x/pontos_de_cada_centroid.get(i).size();\n\t\t\tdouble novo_y=soma_y/pontos_de_cada_centroid.get(i).size();\n\t\t\tPetala novo_centroid = new Petala(novo_x,novo_y);\n\t\t\tnovos_centroids.add(novo_centroid);\n \t\t}\n\t\t\n\t\t//Gravar Geracao\n\t\tArrayList<Petala> gc= new ArrayList<Petala>();\n\t\tfor (int i=0;i<centroids.size();i++) {\n\t\t\tgc.add(centroids.get(i));\n\t\t}\n\t\tGeracao geracao = new Geracao(gc,pontos_de_cada_centroid);\n\t\tgeracoes.add(geracao);\n\t\t//Condicao de Parada\n\t\tboolean terminou = true;\n\t\tfor (int i=0; i<centroids.size();i++) {\n\t\t\tif (centroids.get(i).petal_length!=novos_centroids.get(i).petal_length) {\n\t\t\t\tterminou = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (centroids.get(i).petal_width!=novos_centroids.get(i).petal_width) {\n\t\t\t\tterminou = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (terminou) {\n\t\t\t/*\n\t\t\tSystem.out.println(\"Novos centroids:\");\n\t\t\tSystem.out.println(novos_centroids);\n\t\t\t\n\t\t\tSystem.out.println(\"FIM!\");\n\t\t*/\n\t\t}else {\n\t\t\tcentroids.clear();\n\t\t\tfor (int i=0;i<novos_centroids.size();i++) {\n\t\t\t\tcentroids.add(novos_centroids.get(i));\n\t\t\t}\n\t\tgeracao_atual++;\n\t\t\tAgrupar();\n\t\t}\n\t}", "private void colorizeCore() {\n\n\t\tfor (Class c : this.core) {\n\n\t\t\tint color = 0;\n\t\t\tboolean colored = false;\n\n\t\t\t// Get conflict graph\n\t\t\tHashSet<Class> relatedTo = c.getRelatedTo();\n\t\t\tif (this.conflictGraph.containsKey(c)) {\n\t\t\t\tfor (Class rel : this.conflictGraph.get(c)) {\n\t\t\t\t\trelatedTo.add(rel);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Lookup for a free color\n\t\t\twhile (!colored) {\n\n\t\t\t\tboolean colorBusy = false;\n\t\t\t\tfor (Class rel : relatedTo) {\n\t\t\t\t\tif (rel.getColor() != null && rel.getColor() == color)\n\t\t\t\t\t\tcolorBusy = true;\n\t\t\t\t}\n\n\t\t\t\tif (!colorBusy) {\n\t\t\t\t\tc.setColor(color);\n\t\t\t\t\tcolored = true;\n\t\t\t\t} else {\n\t\t\t\t\tcolor++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcomputeAdaptations(c);\n\t\t}\n\t}", "public static void main(String[] args) {\nPeon peonBlanco1=new Peon();\npeonBlanco1.setColor(\"Blanco\");\npeonBlanco1.setFigura(\"Peon\");\n\nPeon peonBlanco2=new Peon();\npeonBlanco2.setColor(\"Blanco\");\npeonBlanco2.setFigura(\"Peon\");\n\nPeon peonBlanco3=new Peon();\npeonBlanco3.setColor(\"Blanco\");\npeonBlanco3.setFigura(\"Peon\");\n\nPeon peonBlanco4=new Peon();\npeonBlanco4.setColor(\"Blanco\");\npeonBlanco4.setFigura(\"Peon\");\n\nPeon peonBlanco5=new Peon();\npeonBlanco5.setColor(\"Blanco\");\npeonBlanco5.setFigura(\"Peon\");\n\nPeon peonBlanco6=new Peon();\npeonBlanco6.setColor(\"Blanco\");\npeonBlanco6.setFigura(\"Peon\");\n\nPeon peonBlanco7=new Peon();\npeonBlanco7.setColor(\"Blanco\");\npeonBlanco7.setFigura(\"Peon\");\n\nPeon peonBlanco8=new Peon();\npeonBlanco8.setColor(\"Blanco\");\npeonBlanco8.setFigura(\"Peon\");\n\n\n\nPeon peonNegro1=new Peon();\npeonNegro1.setColor(\"Negro\");\npeonNegro1.setFigura(\"Peon\");\n\nPeon peonNegro2=new Peon();\npeonNegro2.setColor(\"Negro\");\npeonNegro2.setFigura(\"Peon\");\n\nPeon peonNegro3=new Peon();\npeonNegro3.setColor(\"Negro\");\npeonNegro3.setFigura(\"Peon\");\n\nPeon peonNegro4=new Peon();\npeonNegro4.setColor(\"Negro\");\npeonNegro4.setFigura(\"Peon\");\n\nPeon peonNegro5=new Peon();\npeonNegro5.setColor(\"Negro\");\npeonNegro5.setFigura(\"Peon\");\n\nPeon peonNegro6=new Peon();\npeonNegro6.setColor(\"Negro\");\npeonNegro6.setFigura(\"Peon\");\n\nPeon peonNegro7=new Peon();\npeonNegro7.setColor(\"Negro\");\npeonNegro7.setFigura(\"Peon\");\n\nPeon peonNegro8=new Peon();\npeonNegro8.setColor(\"Negro\");\npeonNegro8.setFigura(\"Peon\");\n\nAlfil alfilBlancoA=new Alfil();\nalfilBlancoA.setColor(\"Blanco\");\nalfilBlancoA.setFigura(\"Alfil\");\n\nAlfil alfilBlancoB=new Alfil();\nalfilBlancoB.setColor(\"Blanco\");\nalfilBlancoB.setFigura(\"Alfil\");\n\nAlfil alfilNegroA=new Alfil();\nalfilNegroA.setColor(\"Negro\");\nalfilNegroA.setFigura(\"Alfil\");\n\nAlfil alfilNegroB=new Alfil();\nalfilNegroB.setColor(\"Negro\");\nalfilNegroB.setFigura(\"Alfil\");\n\nCaballo caballoBlancoA=new Caballo();\ncaballoBlancoA.setColor(\"Blanco\");\ncaballoBlancoA.setFigura(\"Caballo\");\n\nCaballo caballoBlancoB=new Caballo();\ncaballoBlancoB.setColor(\"Blanco\");\ncaballoBlancoB.setFigura(\"Caballo\");\n\nCaballo caballoNegroA=new Caballo();\ncaballoNegroA.setColor(\"Negro\");\ncaballoNegroA.setFigura(\"Caballo\");\n\nCaballo caballoNegroB=new Caballo();\ncaballoNegroB.setColor(\"Negro\");\ncaballoNegroB.setFigura(\"Caballo\");\n\nTorre TorreBalncaA=new Torre();\nTorreBalncaA.setColor(\"Blanca\");\nTorreBalncaA.setFigura(\"Torre\");\n\nTorre TorreBlancaB=new Torre();\nTorreBlancaB.setColor(\"Blanca\");\nTorreBlancaB.setFigura(\"Torre\");\n\nTorre TorreNegraA=new Torre();\nTorreNegraA.setColor(\"Negro\");\nTorreNegraA.setFigura(\"Torre\");\n\nTorre TorreNegraB=new Torre();\nTorreNegraB.setColor(\"Blanca\");\nTorreNegraB.setFigura(\"Torre\");\n\nDama damaBlanca=new Dama();\ndamaBlanca.setColor(\"Blanco\");\ndamaBlanca.setFigura(\"Dama\");\n\nDama damaNegra=new Dama();\ndamaNegra.setColor(\"Negra\");\ndamaNegra.setFigura(\"Dama\");\n\n\nRey reyBlanco=new Rey();\nreyBlanco.setColor(\"Blanco\");\nreyBlanco.setFigura(\"Rey\");\n\nRey reyNegro= new Rey();\nreyNegro.setColor(\"Negro\");\nreyNegro.setFigura(\"Rey\");\n\nPieza figura[][]=new Pieza[8][8];\nfigura[0][0]=TorreBalncaA;\nfigura[0][1]=caballoBlancoA;\nfigura[0][2]=alfilBlancoA;\nfigura[0][3]=damaBlanca;\nfigura[0][4]=reyBlanco;\nfigura[0][5]=alfilBlancoB;\nfigura[0][6]=caballoBlancoB;\nfigura[0][7]=TorreBlancaB;\n\nfigura[1][0]=peonBlanco1;\nfigura[1][1]=peonBlanco2;\nfigura[1][2]=peonBlanco3;\nfigura[1][3]=peonBlanco4;\nfigura[1][4]=peonBlanco5;\nfigura[1][5]=peonBlanco6;\nfigura[1][6]=peonBlanco7;\nfigura[1][7]=peonBlanco8;\n\n\nfigura[6][0]=peonNegro1;\nfigura[6][1]=peonNegro2;\nfigura[6][2]=peonNegro3;\nfigura[6][3]=peonNegro4;\nfigura[6][4]=peonNegro5;\nfigura[6][5]=peonNegro6;\nfigura[6][6]=peonNegro7;\nfigura[6][7]=peonNegro8;\n\n\nfigura[7][0]=TorreNegraA;\nfigura[7][1]=caballoNegroA;\nfigura[7][2]=alfilNegroA;\nfigura[7][3]=damaNegra;\nfigura[7][4]=reyNegro;\nfigura[7][5]=alfilNegroB;\nfigura[7][6]=caballoNegroB;\nfigura[7][7]=TorreNegraB;\n\nfor (int x=0; x < figura.length; x++) {\n\t System.out.print(\" \");\n\t for (int y=0; y < figura[x].length; y++) {\n\t System.out.print(figura[x][y]+\" \");\n\t if (y!=figura[x].length-1) System.out.print(\" \");\n\t }\n\t System.out.println(\" \");\n\t}\n\t}", "public void majAffichageConnectes() {\n effacerConnectes(); // on efface ce qui est deja ecrit dans la zone reservees a la liste des\n // connectes\n\n choixMessage.removeAllItems(); // Suppression de tous les items de la comboBox\n choixMessage.addItem(\"Tout le monde\");\n choixMessage.setSelectedIndex(0); // Par defaut => envoi a tout le monde\n\n // Parcours de la liste des personnes connectees\n for (Map.Entry<String, Color> entry : couleurs.entrySet()) {\n String nom = entry.getKey(); // recuperation du nom\n Color rgb = new Color(chercherCouleur(nom)); // recuperation de la couleur correspondante\n\n // Mise a jour de la combobox\n if(!fenetre.getClient().getNom().equals(nom)){\n choixMessage.addItem(nom);\n }\n\n // Mise a jour de l'affichage dans le panneau \"Connectes\"\n StyledDocument doc = connectes.getStyledDocument();\n StyleContext style = StyleContext.getDefaultStyleContext();\n // Modification de la couleur\n AttributeSet aset = style.addAttribute(style.getEmptySet(), StyleConstants.Foreground, rgb);\n // Mettre en gras\n aset = style.addAttributes(aset, style.addAttribute(style.getEmptySet(), StyleConstants.Bold, true));\n\n // ajout de la personne dans la liste avec la couleur correspondante\n try {\n doc.insertString(doc.getLength(), nom+\"\\n\", aset);\n } catch (BadLocationException e) {\n e.printStackTrace();\n }\n }\n\n System.out.println(\"maj de l'affichage de la liste des connectes\");\n }", "private void addColors() {\n colors.add(Color.GRAY);\n colors.add(Color.BLUE);\n colors.add(Color.DKGRAY);\n colors.add(Color.CYAN);\n colors.add(Color.MAGENTA);\n //Zijn voorlopig maar 5 kleuren, kan altijd makkelijk meer doen, wil ook liever hex-based kleuren gaan gebruiken.\n }", "private void colorizeGrid() {\n for (int x = 0; x < field.length; x++) {\n for (int y = 0; y < field[0].length; y++) {\n field[x][y].setStyle(intersection.getColorCode(x, y));\n }\n }\n }", "@FXML\r\n private void CambiarColor(ActionEvent event){\r\n \r\n \r\n \r\n g.setFill(Color.rgb((int) (Math.random()*255),(int) (Math.random()*255),(int) (Math.random()*255)));\r\n g.fillPolygon(x, y, 3); // Triangulo //\r\n g.fillOval(150, 70, 90, 90); // Circulo //\r\n g.strokeRect(10, 45, 45, 45); // Cuadrado todavia no funciona //\r\n \r\n \r\n }", "Rey(){\r\n \r\n color_rey=Color.BLANCO;\r\n posicion_rey.fila=1;\r\n posicion_rey.columna='e';\r\n \r\n }", "private static void associaGraphAresta(Graph grafo) {\r\n\t\tfor (int i = 0; i < grafo.getArestas().size(); i++) {\r\n\t\t\tgrafo.getArestas().get(i).getV1().getArestas().add(grafo.getArestas().get(i));\r\n\t\t\tgrafo.getArestas().get(i).getV2().getArestas().add(grafo.getArestas().get(i));\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void howToColor() {\n\t\t\r\n\t}", "public void PonerColor(JTextPane modif, String str){\n ChangeColor=new CuadroTexto();\n ChangeColor.setPrueva(modif);\n String an =\"\"; \n int d = 0;\n while(d < str.length()){\n if(str.charAt(d) == ';'){\n for(int i = d; i < str.length();i++){\n if(str.charAt(d+1) != '('){\n an += str.charAt(d);\n d++;\n }\n }\n ChangeColor.append(new Color(153,102,0), an);\n an = \"\";\n }\n if(str.charAt(d) == '('){\n ChangeColor.append(new Color(205, 92, 92), Character.toString(str.charAt(d)));\n d++;\n for(int i = d; i < str.length();i++){ \n if(d < str.length()){\n if(str.charAt(d) == '('){\n ChangeColor.append(new Color(205, 92, 92), Character.toString(str.charAt(d)));\n d = (d++ < str.length())? d++ : d;\n i = (i++ < str.length())? i++ : i;\n }\n }\n /*if(d < str.length()){\n if(str.charAt(d) == '\"'){\n d = (d++ < str.length())? d++ : d;\n i = (i++ < str.length())? i++ : i;\n for(int q = d; (str.charAt(d) != '\"') && (str.charAt(d+1) != ' '); q++){\n \n System.out.println(\"si estoy mucho\");\n an += str.charAt(d);\n i++;\n d++;\n\n }\n ChangeColor.append(new Color(0,0,0), an);\n an = \"\";\n }\n }*/\n /*if(d < str.length()){\n for(int z = d; z < str.length(); z++)\n if(((str.charAt(d) == '0') && (str.charAt(d) == ' ')) || ((str.charAt(d) == '1') && (str.charAt(d) == ' '))){\n ChangeColor.append(new Color(0,102,0), Character.toString(str.charAt(d)));\n d = (d++ < str.length())? d++ : d;\n i = (i++ < str.length())? i++ : i;\n }\n if(((str.charAt(d) == '2') && (str.charAt(d-1) == ' ')) || ((str.charAt(d) == '3') && (str.charAt(d-1) == ' '))){\n ChangeColor.append(new Color(0,102,0), Character.toString(str.charAt(d)));\n d = (d++ < str.length())? d++ : d;\n i = (i++ < str.length())? i++ : i;\n }\n if(((str.charAt(d) == '4') && (str.charAt(d-1) == ' ')) || ((str.charAt(d) == '5') && (str.charAt(d-1) == ' '))){\n ChangeColor.append(new Color(0,102,0), Character.toString(str.charAt(d)));\n d = (d++ < str.length())? d++ : d;\n i = (i++ < str.length())? i++ : i;\n }\n if(((str.charAt(d) == '6') && (str.charAt(d-1) == ' ')) || ((str.charAt(d) == '7') && (str.charAt(d-1) == ' '))){\n ChangeColor.append(new Color(0,102,0), Character.toString(str.charAt(d)));\n d = (d++ < str.length())? d++ : d;\n i = (i++ < str.length())? i++ : i;\n }\n if(((str.charAt(d) == '8') && (str.charAt(d-1) == ' ')) || ((str.charAt(d) == '9') && (str.charAt(d-1) == ' '))){\n ChangeColor.append(new Color(0,102,0), Character.toString(str.charAt(d)));\n d = (d++ < str.length())? d++ : d;\n i = (i++ < str.length())? i++ : i;\n }\n \n }*/\n if(d < str.length()){\n for(int b = d; b < str.length();b++){\n if(str.charAt(d) == ')'){\n ChangeColor.append(new Color(205, 92, 92), Character.toString(str.charAt(d)));\n d = (d++ < str.length())? d++ : d;\n i = (i++ < str.length())? i++ : i;\n }\n }\n\n }\n \n if(d < str.length()){\n ChangeColor.append(new Color(25, 25, 112), Character.toString(str.charAt(d)));\n }\n \n d++;\n }\n an = \"\";\n }\n d++;\n } \n }", "void setOccupier(PRColor color) {\n c = color;\n }", "@Override\n public void calculateCommunityColors(Set<String> setCommunities, TimeFrame tf){\n \n icommunityColors.calculateCommunityColor(tf, setCommunities);\n\n }", "public void gossipGirl(){\n\t\tfor(Point p: currentPiece){\n\t\t\twell[p.x + pieceOrigin.x][p.y + pieceOrigin.y] = currentColor;\n\t\t}\n\t\trowChecked();\n\n\t\tsetNewPiece();\n\t\tgetNewPiece();\n\t}", "public Color recupColor(int nb){\r\n\t\tColor color;\r\n\t\tif(nb == 1){\r\n\t\t\tcolor = Config.colorJ1;\r\n\t\t}\r\n\t\telse if(nb == 2){\r\n\t\t\tcolor = Config.colorJ2;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tcolor =\tConfig.colorVide;\r\n\t\t}\r\n\t\treturn color;\r\n\t}", "public ColourAutoCorrelogram(BufferedImage image) {\r\n\t\timageRaster = image.getData();\r\n\t\tdistanceSet = new int[]{1,3,5,7};\r\n\t}", "private void colorDetermine(PGraphics pg) {\r\n\t\tfloat depth = getDepth();\r\n\t\t\r\n\t\tif (depth < THRESHOLD_INTERMEDIATE) {\r\n\t\t\tpg.fill(255, 255, 0);\r\n\t\t}\r\n\t\telse if (depth < THRESHOLD_DEEP) {\r\n\t\t\tpg.fill(0, 0, 255);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tpg.fill(255, 0, 0);\r\n\t\t}\r\n\t}", "public ConcelhosInterior(){\n this.concelhos = new HashMap<>();\n this.concelhos.put(\"PENALVA DO CASTELO\", 0.1);\n this.concelhos.put(\"VINHAIS\", 0.08);\n this.concelhos.put(\"RESENDE\", 0.09);\n this.concelhos.put(\"RIBEIRA DE PENA\", 0.07);\n this.concelhos.put(\"BAIÃO\", 0.1);\n this.concelhos.put(\"CELORICO DE BASTOS\", 0.1);\n this.concelhos.put(\"TABUAÇO\", 0.08);\n this.concelhos.put(\"CINFÃES\", 0.07);\n this.concelhos.put(\"MIRANDELA\", 0.06);\n }", "public void statoIniziale()\n {\n int r, c;\n for (r=0; r<DIM_LATO; r++)\n for (c=0; c<DIM_LATO; c++)\n {\n if (eNera(r,c))\n {\n if (r<3) // le tre righe in alto\n contenutoCaselle[r][c] = PEDINA_NERA;\n else if (r>4) // le tre righe in basso\n contenutoCaselle[r][c] = PEDINA_BIANCA;\n else contenutoCaselle[r][c] = VUOTA; // le 2 righe centrali\n }\n else contenutoCaselle[r][c] = VUOTA; // caselle bianche\n }\n }", "public void setColor(final String culoare, final int opacitate,\n final int dont, final int need) {\n this.contur = new ColorLevel(culoare, opacitate);\n }", "public void ajoutPions() {\n for (int i = 0; i < 4; i++) {\n for (int j = 0; j < 10; j += 2) {\n if (i % 2 == 0) {\n this.ajoutPieces(new Pion(i, j, true, (String) JouerIA.getColor1().first()));\n\n } else {\n this.ajoutPieces(new Pion(i, j+1, true, (String) JouerIA.getColor1().first()));\n }\n }\n\n }\n\n for (int i = 6; i < 10; i++) {\n for (int j = 0; j < 10; j += 2) {\n if (i % 2 == 0) {\n this.ajoutPieces(new Pion(i, j, false, (String) JouerIA.getColor2().first()));\n } else {\n this.ajoutPieces(new Pion(i, j + 1, false, (String) JouerIA.getColor2().first()));\n }\n }\n\n }\n }", "private void colorDetermine(PGraphics pg) {\n\t\tif(this.getDepth() < 70){\n\t\t\tpg.fill(255,255,0);\n\t\t}else if(this.getDepth() >= 70 && this.getDepth() < 300){\n\t\t\tpg.fill(0, 0, 255);\n\t\t}else if(this.getDepth() >= 300){\n\t\t\tpg.fill(255, 0, 0);\n\t\t}\n\t}", "public void drawPoligono(Color c, Color f){\n int xPoints[] = new int[nPoints];\n int yPoints[] = new int[nPoints];\n \n // Copia pontos de arraylist para arrays\n for(int i = 0; i < nPoints; i++){\n xPoints[i] = pointsX.get(i);\n yPoints[i] = pointsY.get(i);\n System.out.println(xPoints[i] + \", \" + yPoints[i]);\n }\n Poligono k = new Poligono(xPoints, yPoints, nPoints, c, f);\n k.draw(canvas, info);\n \n // Limpa os pontos e reseta contador\n pointsX.clear();\n pointsY.clear();\n nPoints = 0;\n }", "private Color geraCorAleatoria() {\n\t\tColor cor = null; Random rc = new Random();\n\t\tint codCor = rc.nextInt(6);\n\t\tswitch (codCor) {\n\t\tcase 0:\n\t\t\tcor = Color.BLUE;\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tcor = Color.CYAN;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcor = Color.RED;\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tcor = Color.GREEN;\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tcor = Color.MAGENTA;\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tcor = Color.ORANGE;\n\t\t\tbreak;\n\t\t}\n\t\treturn cor;\n\t}", "@Override\n public void setCommunityColor(String strCommunity, String strColor, TimeFrame tf){\n icommunityColors.setCommunityColor(strCommunity, strColor, tf);\n }", "private void colorNodes() {\n for (NodeImpl n : supervisedNodes) {\n colorNode(n);\n }\n }", "private void initPieceColors(){\n\t\tfor(Piece p : this.pieces)\n\t\t\tpieceColors.put(p, Utils.randomColor());\n\t}", "public Map<String, PDSeparation> getColorants() throws IOException {\n/* 72 */ Map<String, PDSeparation> actuals = new HashMap<String, PDSeparation>();\n/* 73 */ COSDictionary colorants = (COSDictionary)this.dictionary.getDictionaryObject(COSName.COLORANTS);\n/* 74 */ if (colorants == null) {\n/* */ \n/* 76 */ colorants = new COSDictionary();\n/* 77 */ this.dictionary.setItem(COSName.COLORANTS, (COSBase)colorants);\n/* */ } \n/* 79 */ for (COSName name : colorants.keySet()) {\n/* */ \n/* 81 */ COSBase value = colorants.getDictionaryObject(name);\n/* 82 */ actuals.put(name.getName(), (PDSeparation)PDColorSpace.create(value));\n/* */ } \n/* 84 */ return (Map<String, PDSeparation>)new COSDictionaryMap(actuals, colorants);\n/* */ }", "public static void main(String[] args)\n {\n \n //opens selfie picture \n /**/ \n //relative path\n //og pics\n Picture apic = new Picture(\"images/selfie.jpg\");\n Picture obama = new Picture(\"images/obama.jpg\");\n apic.explore();\n obama.explore();\n\n //change with selfie picture\n Picture me = new Picture(\"images/selfie.jpg\"); \n Picture me1 = new Picture(\"images/selfie.jpg\");\n Picture me2 = new Picture(\"images/selfie.jpg\");\n \n //initializes array pix\n Pixel[] pix;\n \n /**\n * method 1 change\n * divides colors into 4 equal groups\n */\n //initializes vars for rgb values\n int red;\n int blue;\n int green;\n pix = me.getPixels(); \n \n for (Pixel spot: pix) {\n //gets rgb values of colors\n red = spot.getRed();\n blue = spot.getBlue();\n green = spot.getGreen();\n \n //if pixel under a certain value then the color is changed\n if (red < 63 && blue < 63 && green < 63) {\n spot.setColor(new Color(2, 32, 62));\n }\n else if (red < 127 && blue < 127 && green < 127) {\n spot.setColor(new Color(198, 37, 8));\n }\n else if (red < 191 && blue < 191 && green < 191) {\n spot.setColor(new Color(102, 157, 160));\n }\n else {\n spot.setColor(new Color(250, 238, 192));\n }\n }\n me.explore();\n me.write(\"images/selfie1.jpg\");\n\n /**\n * method 2 change\n * changes color based on intensity using max and min grayscale values\n */\n pix = me1.getPixels(); \n int s = 0; //smallest pix value\n int b = 255; //largest pix value\n int ave;\n int quads; //size of four equal range of colors\n \n for (Pixel spot: pix) {\n red = spot.getRed();\n blue = spot.getBlue();\n green = spot.getGreen();\n \n ave = (red + blue + green)/3;\n if (ave > b) { //gets maximum grayscale\n b = ave;\n }\n if (ave < s) { //gets min grayscale\n s = ave;\n }\n quads = (b-s)/4; //divides range of pix values into 4\n \n //sees if pixel value is less than the factor of quad\n if (red < quads && blue < quads && green < quads) {\n spot.setColor(new Color(2, 32, 62));\n }\n else if (red < quads*2 && blue < quads*2 && green < quads*2 ) {\n spot.setColor(new Color(198, 37, 8));\n }\n else if (red < quads*3 && blue < quads*3 && green < quads*3) {\n spot.setColor(new Color(102, 157, 160));\n }\n else {\n spot.setColor(new Color(250, 238, 192));\n }\n }\n me1.explore();\n me1.write(\"images/selfie2.jpg\");\n \n /**\n * custom color palette\n */\n pix = me2.getPixels();\n \n for (Pixel spot: pix) {\n red = spot.getRed();\n blue = spot.getBlue();\n green = spot.getGreen();\n \n //sets color to new value if under a certain value\n if (red < 63 && blue < 63 && green < 63) {\n spot.setColor(new Color(77, 105, 170));\n }\n else if (red < 127 && blue < 127 && green < 127) {\n spot.setColor(new Color(71, 183, 116));\n }\n else if (red < 191 && blue < 191 && green < 191) {\n spot.setColor(new Color(254, 129, 99));\n }\n else {\n spot.setColor(new Color(254, 202, 99));\n }\n }\n me2.explore();\n me2.write(\"images/selfie3.jpg\");\n \n }", "public void crearSala(String color, int SalaoLab, String nombre, String actividad, int capacidad, int computadores, int datas, int mesas,\n int pizarras, int telones, int sillas) {\n for (int i = 0; i < edificios.size(); i++) {\n Edificio edificioActual = edificios.get(i);\n if (edificioActual.getColor().equals(color)) {\n if (SalaoLab == 0){\n edificioActual.agregarSalaClases(nombre, actividad, capacidad, computadores, datas, mesas,\n pizarras, telones, sillas);\n }\n else{\n edificioActual.agregarLaboratorio(nombre, actividad, capacidad, computadores, datas, mesas, pizarras,\n telones, sillas);\n }\n }\n }\n\n }", "public void setColorants(Map<String, PDColorSpace> colorants) {\n/* 116 */ COSDictionary colorantDict = null;\n/* 117 */ if (colorants != null)\n/* */ {\n/* 119 */ colorantDict = COSDictionaryMap.convert(colorants);\n/* */ }\n/* 121 */ this.dictionary.setItem(COSName.COLORANTS, (COSBase)colorantDict);\n/* */ }", "public String getColor() {\n\t\treturn \"Elcolor del vehiculo es: \"+color; \n\t }", "public static void main(String[] args) {\n\t\t\n\t\tProvaCollezioni pc = new ProvaCollezioni();\n\t\t\n\t\tpc.spesa.add(\"latte\");\n\t\tpc.spesa.add(\"pane\");\n\t\tpc.spesa.add(\"biscotti\");\n\t\tpc.spesa.add(\"olio\");\n\t\tpc.spesa.add(\"biscotti\");\n\t\t\n\n\t\tSystem.out.println(pc.spesa.size());\n\t\t\n\t\tfor (String voce : pc.spesa) {\n\t\t\tpc.spesaFiltrata.add(voce);\n\t\t\tpc.spesaOrdinata.add(voce);\n\t\t}\n\n\t\tSystem.out.println(pc.spesaFiltrata.size());\n\t\tfor (String string : pc.spesaOrdinata) {\n\t\t\tSystem.out.println(string);\n\t\t}\n\t\t\n\t\tMap<String, String> regioni = new TreeMap<>();\n\t\t\n\t\tregioni.put(\"Piemonte\", \"Torino\");\n\t\tregioni.put(\"Lombardia\", \"Milano\");\n\t\tregioni.put(\"Toscana\", \"Firenze\");\n\t\tregioni.put(\"Puglia\", \"Bari\");\n\t\t\n\t\tSystem.out.println(regioni.size());\n\t\t\n\t\tSystem.out.println(regioni.get(\"Piemonte\"));\n\t\t\n\t\tSystem.out.println(regioni.keySet());\n\t\t\n\t\tSystem.out.println(regioni.values());\n\t\t\n//\t\tfor (String regione : regioni.keySet()) {\n//\t\t\tSystem.out.println(\"Il capoluogo della regione \" \n//\t\t\t\t\t\t\t+ regione \n//\t\t\t\t\t\t\t+ \" è: \" \n//\t\t\t\t\t\t\t+ regioni.get(regione));\n//\t\t}\n//\t\t\n\t\t\n\t\tfor (Entry<String, String> regione : regioni.entrySet()) {\n\t\t\tSystem.out.print(\"Il capoluogo della regione \" + regione.getKey());\n\t\t\tSystem.out.println(\" è: \" + regione.getValue());\n\t\t\tSystem.out.println(regione);\n\t\t}\n\t\t\n\t\t\n\t}", "abstract Color linkColor(String link);", "@Override\n public Boolean colisionoCon(Grafico gr) {\n return true;\n }", "private void initGrille() {\n this.setLayout(new GridLayout(8, 8));\n Color backgroundColor = Color.WHITE;\n for (int i = 7; i >= 0; i--) {\n for (int j = 0; j < 8; j++) {\n CaseJeu c = new CaseJeu(j, i, backgroundColor, fenetre);\n if (j != 7) {\n backgroundColor = (backgroundColor.equals(Color.GRAY)) ? Color.WHITE : Color.GRAY;\n }\n this.add(c);\n }\n }\n }", "private void green(){\n\t\tthis.arretes_fG();\n\t\tthis.coins_fG();\n\t\tthis.coins_a1G();\n\t\tthis.coins_a2G();\n\t\tthis.aretes_aG();\n\t\tthis.cube[31] = \"G\";\n\t}", "public Nodo dosNoSeguidos(Nodo nodo) throws IOException{\n System.out.println(\"----------------inicio heuristica dosnoseguidos--------------\");\n Operadores operadores = new Operadores();\n //variables de matriz\n int numFilas,numColumnas,numColores;\n \n numColumnas = nodo.getnColumnas();\n numFilas = nodo.getnFilas();\n numColores = nodo.getnColores();\n \n String [][] matriz = new String [numFilas][numColumnas];\n matriz = operadores.clonarMatriz(nodo.getMatriz());\n //-------------------\n \n //variables de filas y columnas\n ArrayList<ArrayListColumna> columnas = new ArrayList<ArrayListColumna>();\n columnas = (ArrayList<ArrayListColumna>)nodo.getColumnas();\n \n ArrayList<ArrayListFila> filas = new ArrayList<ArrayListFila>();\n filas = (ArrayList<ArrayListFila>)nodo.getFilas();\n //---------------------------\n \n ArrayListFila auxListFila = new ArrayListFila();\n ArrayListColumna auxListColumna = new ArrayListColumna();\n \n int cambio=1;\n \n while(cambio!=0){\n cambio=0;\n \n nodo.setCambio(0);\n for(int i = 0;i<numFilas;i++){\n if(operadores.isFilaVacia(nodo.getMatriz(), i) == true){\n //filas\n auxListFila = (ArrayListFila)filas.get(i);\n\n int contadorColores = 0;\n for(int j=0;j<numColores;j++){\n Color auxColor = new Color();\n auxColor = auxListFila.getColor(j);\n if(auxColor.getNumero() > 0){\n contadorColores++;\n }\n }//fin color\n\n\n if(contadorColores == 2){//esto quiere decir que hay dos colores disponibles para usar en la matriz\n //ahora hay que ver si uno de los dos es igual a 2 y false\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListFila.getColor(j1);\n\n if(auxColor1.getNumero() == 2 && auxColor1.isSeguido() == false){\n for(int j2=0;j2<numColores;j2++){\n Color auxColor2 = new Color();\n auxColor2 = auxListFila.getColor(j2);\n\n if(auxColor2.isSeguido() == true){\n cambio=1;\n nodo.setCambio(1);\n //pinta los extremos de la fila\n matriz = operadores.pintarPosicion(matriz,i, (numColumnas-1), auxColor1.getColor());\n \n matriz = operadores.pintarPosicion(matriz, i, 0, auxColor1.getColor());\n \n //pinta el resto de la fila\n matriz = operadores.pintarFilaCompleta(matriz, auxColor2.getColor(), i);\n //descuenta los colores en las filas\n auxColor1.setNumero(0);\n auxColor2.setNumero(0);\n \n //descontar colores en las columnas\n for(int c=0;c<numColumnas;c++){\n auxListColumna = (ArrayListColumna)columnas.get(c);\n \n if(c == 0){\n for(int c1=0;c1<numColores;c1++){\n Color auxColorc1 = new Color();\n auxColorc1 = auxListColumna.getColor(c1);\n \n if(auxColorc1.getColor().equals(auxColor1.getColor())){\n auxColorc1.setNumero(auxColorc1.getNumero()-1);\n }\n \n }\n }else if(c == (numColumnas-1)){\n for(int c1=0;c1<numColores;c1++){\n Color auxColorc1 = new Color();\n auxColorc1 = auxListColumna.getColor(c1);\n \n if(auxColorc1.getColor().equals(auxColor1.getColor())){\n auxColorc1.setNumero(auxColorc1.getNumero()-1);\n }\n }\n }else{\n for(int c1=0;c1<numColores;c1++){\n Color auxColorc1 = new Color();\n auxColorc1 = auxListColumna.getColor(c1);\n \n if(auxColorc1.getColor().equals(auxColor2.getColor())){\n auxColorc1.setNumero(auxColorc1.getNumero()-1);\n }\n }\n \n }\n \n }\n \n nodo.setMatriz(matriz.clone());\n System.out.println(\"-----\");\n operadores.imprimirMatriz(nodo.getMatriz());\n System.out.println(\"-----\");\n }\n }\n }\n }//fin color\n }\n }//fin isfilaVacia\n }//fin filas\n \n \n //---------columnas\n for(int i = 0;i<numColumnas;i++){\n if(operadores.isColumnaVacia(nodo.getMatriz(), i) == true){ \n //columnas\n auxListColumna = (ArrayListColumna)columnas.get(i);\n\n int contadorColores = 0;\n for(int j=0;j<numColores;j++){\n Color auxColor = new Color();\n auxColor = auxListColumna.getColor(j);\n if(auxColor.getNumero() > 0){\n contadorColores++;\n } \n }//fin color\n if(contadorColores == 2){//esto quiere decir que hay dos colores disponibles para usar en la matriz\n //ahora hay que ver si uno de los dos es igual a 2 y false\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListColumna.getColor(j1);\n\n if(auxColor1.getNumero() == 2 && auxColor1.isSeguido() == false){\n for(int j2=0;j2<numColores;j2++){\n Color auxColor2 = new Color();\n auxColor2 = auxListColumna.getColor(j2);\n if(auxColor2.isSeguido() == true){\n cambio=1;\n nodo.setCambio(1);\n matriz = operadores.pintarPosicion(matriz,(numFilas-1), i, auxColor1.getColor());\n matriz = operadores.pintarPosicion(matriz, 0, i, auxColor1.getColor());\n \n matriz = operadores.pintarColumnaCompleta(matriz, auxColor2.getColor(), i);\n \n auxColor1.setNumero(0);\n auxColor2.setNumero(0);\n \n \n //descontar colores en las columnas\n for(int f=0;f<numFilas;f++){\n auxListFila = (ArrayListFila)filas.get(f);\n \n if(f == 0){\n for(int f1=0;f1<numColores;f1++){\n Color auxColorf1 = new Color();\n auxColorf1 = auxListFila.getColor(f1);\n \n if(auxColorf1.getColor().equals(auxColor1.getColor())){\n auxColorf1.setNumero(auxColorf1.getNumero()-1);\n }\n \n }\n }else if(f == (numColumnas-1)){\n for(int f1=0;f1<numColores;f1++){\n Color auxColorf1 = new Color();\n auxColorf1 = auxListFila.getColor(f1);\n \n if(auxColorf1.getColor().equals(auxColor1.getColor())){\n auxColorf1.setNumero(auxColorf1.getNumero()-1);\n }\n \n }\n }else{\n for(int f1=0;f1<numColores;f1++){\n Color auxColorf1 = new Color();\n auxColorf1 = auxListFila.getColor(f1);\n \n if(auxColorf1.getColor().equals(auxColor2.getColor())){\n auxColorf1.setNumero(auxColorf1.getNumero()-1);\n }\n }\n \n }\n \n }\n \n nodo.setMatriz(matriz.clone());\n System.out.println(\"-----\");\n operadores.imprimirMatriz(nodo.getMatriz());\n System.out.println(\"-----\");\n }\n }\n }\n }//fin color\n }\n }\n }//fin columnas\n }//fin while principal\n \n System.out.println(\"---------------final heuristica dosnoseguidos---------------\");\n return nodo;\n }", "public Nodo espaciosJustos(Nodo nodo){\n System.out.println(\"----------------inicio heuristica espaciosJustos--------------\");\n Operadores operadores = new Operadores();\n //variables de matriz\n int numFilas,numColumnas,numColores;\n \n numColumnas = nodo.getnColumnas();\n numFilas = nodo.getnFilas();\n numColores = nodo.getnColores();\n \n String [][] matriz = new String [numFilas][numColumnas];\n matriz = operadores.clonarMatriz(nodo.getMatriz());\n //-------------------\n \n //variables de filas y columnas\n ArrayList<ArrayListColumna> columnas = new ArrayList<ArrayListColumna>();\n columnas = (ArrayList<ArrayListColumna>)nodo.getColumnas();\n \n ArrayList<ArrayListFila> filas = new ArrayList<ArrayListFila>();\n filas = (ArrayList<ArrayListFila>)nodo.getFilas();\n //---------------------------\n \n ArrayListFila auxListFila = new ArrayListFila();\n ArrayListColumna auxListColumna = new ArrayListColumna();\n \n int cambio=1;\n int changue=0;\n while(cambio!=0){\n cambio=0;\n \n nodo.setCambio(0);\n for(int i=0;i<numFilas;i++){\n auxListFila = (ArrayListFila)filas.get(i);\n for(int j=0;j<numColores;j++){\n Color auxColor = new Color();\n auxColor = auxListFila.getColor(j);\n\n if(auxColor.getNumero() > 0){\n int contador=0;\n for(int c=0;c<numColumnas;c++){\n auxListColumna=(ArrayListColumna)columnas.get(c);\n\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListColumna.getColor(j1);\n if(auxColor1.getNumero() > 0){\n if(auxColor.getColor().equals(auxColor1.getColor()) && operadores.isPosicionVaciaFila(nodo.getMatriz(), i, c)){\n contador++;\n }\n }\n }\n }\n \n if(auxColor.getNumero() == contador){\n changue=1;\n cambio=1;\n auxColor.setNumero(0);\n for(int c=0;c<numColumnas;c++){\n auxListColumna=(ArrayListColumna)columnas.get(c);\n\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListColumna.getColor(j1);\n if(auxColor1.getNumero() > 0){\n if(auxColor.getColor().equals(auxColor1.getColor()) && operadores.isPosicionVaciaFila(nodo.getMatriz(), i, c)){\n \n auxColor1.setNumero(auxColor1.getNumero()-1);\n\n matriz = operadores.pintarPosicion(matriz, i, c, auxColor.getColor());\n\n nodo.setMatriz(matriz);\n }\n }\n }\n }\n System.out.println(\"-----\");\n operadores.imprimirMatriz(nodo.getMatriz());\n System.out.println(\"-----\");\n \n \n }\n }\n }\n }\n \n }\n if(changue==1) nodo.setCambio(1);\n System.out.println(\"----------------fin heuristica espaciosJustos-------------- \");\n return (Nodo)nodo;\n }", "private String comprobarColor(String color) {\r\n String colores[] = { \"blanco\", \"negro\", \"rojo\", \"azul\", \"gris\" };\r\n boolean encontrado = false;\r\n for (int i = 0; i < colores.length && !encontrado; i++) {\r\n if (colores[i].equals(color)) {\r\n encontrado = true;\r\n }\r\n }\r\n if (encontrado) {\r\n this.color = color;\r\n } else {\r\n this.color = COLOR_POR_DEFECTO;\r\n }\r\n return this.color;\r\n }", "public void ajouterClientListe(String nom){\n if (!couleurs.containsKey(nom)){\n Color couleur = new Color(chercherCouleur(nom));\n couleurs.put(nom, couleur);\n }\n }", "public void grabarGrafoColoreado(String archivo) {\n\t\tPrintWriter salida = null;\n\t\ttry {\n\n\t\t\tsalida = new PrintWriter(new FileWriter(archivo));\n\t\t\tsalida.println(cantNodos + \" \" + cantColores);\n\n\t\t\tfor (int i = 0; i < cantNodos; i++)\n\t\t\t\tsalida.println(nodos.get(i).getNumero() + \" \" + nodos.get(i).getColor());\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tsalida.close();\n\t\t}\n\t}", "private boolean sePuedeColorear(int indice, int color) {\n\t\tint i = 0;\n\t\tboolean sePuede = true;\n\t\tif (nodos.get(indice).getColor() != 0) // si el nodo fue coloreado\n\t\t\tsePuede = false;\n\t\twhile (i < cantNodos && sePuede) {\n\t\t\t// Si hay un nodo adyacente con ese color, no se puede colorear. Si el nodo fue\n\t\t\t// coloreado tampoco se puede.\n\t\t\tif (nodos.get(i).getColor() == color && i != indice) {\n\t\t\t\tif (esAdyacente(nodos.get(i).getNumero() - 1, nodos.get(indice).getNumero() - 1))\n\t\t\t\t\tsePuede = false;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn sePuede;\n\t}", "String getColor();", "public void attrito(){\n yCord[0]+=4;\n yCord[1]+=4;\n yCord[2]+=4;\n //e riaggiorna i propulsori (che siano attivati o no) ricalcolandoli sulla base delle coordinate dell'astronave, cambiate\n aggiornaPropulsori();\n \n }", "public String toString (){\r\n \r\n String mensaje=\"El rey color \"+color_rey+\" esta en la fila \"+posicion_rey.fila+\" y columna \"+posicion_rey.columna+\".\";\r\n \r\n return mensaje;\r\n \r\n }", "public void bolita2() {\n fill(colores[f]); // Color random seg\\u00fan array anteriormente mencionado.\n noStroke();\n ellipse(y, x, a, b);\n }", "public static void obtenerInfoColisionJugador(Jugador jugador, Objeto col,String[] direccion, ArrayList<Objeto> obj_colision) {\n Rectangle[] lados_ente = jugador.objeto_ente.getRectangle();\n Rectangle[] lados_col = col.getRectangle();\n\n \n if (col.getTag().compareToIgnoreCase(Objeto.Tag.COMIDA) == 0 || col.getTag().compareToIgnoreCase(Objeto.Tag.MONEDA) == 0) {\n //System.out.println(\"COMIDA\");\n for(int i=0;i<4;i++)\n if (lados_ente[i].intersects(lados_col[0])) {\n obj_colision.add(col);\n return;\n }\n }\n\n \n \n if (col.getTag().compareToIgnoreCase(Objeto.Tag.ENEMIGO) == 0) {\n\n //System.out.println(lados_ente[0].x + \" con \" + lados_col[0].x + \" tag: \" + col.getId());\n if (lados_ente[0].intersects(lados_col[2])) {\n //\"arriba\";\n obj_colision.add(col);\n direccion[0] = \"enemigo_arriba\";\n }\n //else\n // System.out.println(lados_ente[0].y + \" con \" + lados_col[2].y + \" tag: \" + col.getId());\n if (lados_ente[1].intersects(lados_col[3])) {\n //\"derecha\";\n obj_colision.add(col);\n direccion[1] = \"enemigo_derecha\";\n\n }\n if (lados_ente[2].intersects(lados_col[0])) {\n //\"abajo\";\n obj_colision.add(col);\n direccion[2] = \"enemigo_abajo\";\n }\n if (lados_ente[3].intersects(lados_col[1])) {\n //\"izquierda\";\n obj_colision.add(col);\n direccion[3] = \"enemigo_izquierda\";\n }\n\n }\n \n if (col.getTag().compareToIgnoreCase(Objeto.Tag.NPC) == 0) {\n\n //System.out.println(lados_ente[0].x + \" con \" + lados_col[0].x + \" tag: \" + col.getId());\n if (lados_ente[0].intersects(lados_col[0])) {\n //\"arriba\";\n obj_colision.add(col);\n direccion[0] = \"npc_arriba\";\n }\n //else\n // System.out.println(lados_ente[0].y + \" con \" + lados_col[2].y + \" tag: \" + col.getId());\n if (lados_ente[1].intersects(lados_col[0])) {\n //\"derecha\";\n obj_colision.add(col);\n direccion[1] = \"npc_derecha\";\n\n }\n if (lados_ente[2].intersects(lados_col[0])) {\n //\"abajo\";\n obj_colision.add(col);\n direccion[2] = \"npc_abajo\";\n }\n if (lados_ente[3].intersects(lados_col[0])) {\n //\"izquierda\";\n obj_colision.add(col);\n direccion[3] = \"npc_izquierda\";\n }\n\n }\n\n if (lados_ente[0].intersects(lados_col[0])) {\n //\"arriba\";\n obj_colision.add(col);\n direccion[0] = \"entorno_arriba\";\n }\n if (lados_ente[1].intersects(lados_col[0])) {\n //\"derecha\";\n obj_colision.add(col);\n direccion[1] = \"entorno_derecha\";\n }\n if (lados_ente[2].intersects(lados_col[0])) {\n //\"abajo\";\n obj_colision.add(col);\n direccion[2] = \"entorno_abajo\";\n }\n if (lados_ente[3].intersects(lados_col[0])) {\n //\"izquierda\";\n obj_colision.add(col);\n direccion[3] = \"entorno_izquierda\";\n }\n }", "public int getColor();", "public int getColor();", "public static void obtenerInfoColisionEnemigo(Enemigo enemigo, Objeto col,String[] direccion, ArrayList<Objeto> obj_colision) {\n Rectangle[] lados_ente = enemigo.objeto_ente.getRectangle();\n Rectangle[] lados_col = col.getRectangle();\n\n if (col.getTag().compareToIgnoreCase(Objeto.Tag.JUGADOR) == 0) {\n if (lados_ente[0].intersects(lados_col[2])) {\n //\"arriba\";\n obj_colision.add(col);\n direccion[0] = \"jugador_arriba\";\n }\n if (lados_ente[1].intersects(lados_col[3])) {\n //\"derecha\";\n obj_colision.add(col);\n direccion[1] = \"jugador_derecha\";\n\n }\n if (lados_ente[2].intersects(lados_col[0])) {\n //\"abajo\";\n obj_colision.add(col);\n direccion[2] = \"jugador_abajo\";\n }\n if (lados_ente[3].intersects(lados_col[1])) {\n //\"izquierda\";\n obj_colision.add(col);\n direccion[3] = \"jugador_izquierda\";\n }\n }\n\n if (lados_ente[0].intersects(lados_col[0])) {\n //\"arriba\";\n obj_colision.add(col);\n direccion[0] = \"entorno_arriba\";\n }\n if (lados_ente[1].intersects(lados_col[0])) {\n //\"derecha\";\n obj_colision.add(col);\n direccion[1] = \"entorno_derecha\";\n }\n if (lados_ente[2].intersects(lados_col[0])) {\n //\"abajo\";\n obj_colision.add(col);\n direccion[2] = \"entorno_abajo\";\n }\n if (lados_ente[3].intersects(lados_col[0])) {\n //\"izquierda\";\n obj_colision.add(col);\n direccion[3] = \"entorno_izquierda\";\n }\n }", "@Override\n public void setGlobalCommunityColorMap(Map<String, String> mapGloablCommunityColor) {\n icommunityColors.setGlobalCommunityColorMap(mapGloablCommunityColor);\n }", "public void cambia_color(String color) {\n\t\tif (color.equals(\"azul\")||color.equals(\"rojo\")) {\n\t\t\tthis.color=color;\n\t\t}else {\n\t\t\t\n\t\t\tJOptionPane.showMessageDialog(null,\"color incorrecto\");\n\t\t\t\n\t\t}\n\t\t \n\t\t \n\t\t\n\t\t}", "@Override\n public String getCommunityColor(String strCommunity, TimeFrame tf){\n return icommunityColors.getCommunityColor(strCommunity, tf);\n }", "private void red(){\n\t\tthis.arretes_fR();\n\t\tthis.coins_fR();\n\t\tthis.coins_a1R();\n\t\tthis.coins_a2R();\n\t\tthis.aretes_aR();\n\t\tthis.cube[13] = \"R\";\n\t}", "public void setExperimentColor(int [] indices, Color color);", "public String prenda() {\r\n\t\tif(this.getColorSecundario()==null)\r\n\t\t\treturn this.getTipo().tipo+\" de \"+this.getTela().toString() +\" de color \"+this.getColorPrimario().toString();\r\n\t\telse\r\n\t\t\treturn this.getTipo().tipo+\" de \"+this.getTela().toString() +\" de color \"+this.getColorPrimario()+\" y \"+this.getColorSecundario().toString();\r\n\r\n\t}", "private void createHighlight() {\n\n // Create the new highlighted route\n for (Node node : routeList) {\n Point2D tileLocation = new Point2D(node.getX(), node.getY());\n highlightGroup.getChildren().add(new CircleTile(tileLocation, color, 2));\n }\n\n // Create product highlights\n int i = 1;\n for (Point2D point : productPositions) {\n CircleTile circle = new CircleTile(point, color, 8);\n Text text = new Text(\"\" + i);\n PaneCircleText pane = new PaneCircleText(circle, text);\n highlightGroup.getChildren().add(pane);\n i++;\n }\n\n }", "public void setColor()\n {\n if(eyeL != null) // only if it's painted already...\n {\n eyeL.changeColor(\"yellow\");\n eyeR.changeColor(\"yellow\");\n nose.changeColor(\"green\");\n mouthM.changeColor(\"red\");\n mouthL.changeColor(\"red\");\n mouthR.changeColor(\"red\");\n }\n }", "public ColouredFeature(IGeometry geom) {\n super(geom);\n this.setId(idCounter.getAndIncrement());\n this.symbolColour = Color.RED;\n }", "public static void main(String[] args) throws IOException {\n BufferedReader f = new BufferedReader(new FileReader(\"fcolor.in\"));\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"fcolor.out\")));\n StringTokenizer st = new StringTokenizer(f.readLine());\n numNode = Integer.parseInt(st.nextToken());\n numEdge = Integer.parseInt(st.nextToken());\n fans = new ArrayList[numNode];\n for (int i = 0; i < numNode; i++) {\n fans[i] = new ArrayList<>();\n }\n for (int i = 0; i < numEdge; i++) {\n st = new StringTokenizer(f.readLine());\n int star = Integer.parseInt(st.nextToken()) - 1;\n int fan = Integer.parseInt(st.nextToken()) - 1;\n fans[star].add(fan);\n }\n visited = new boolean[numNode];\n finder = new int[numNode];\n for (int i = 0; i < finder.length; i++) {\n finder[i] = i;\n }\n headFan = new int[numNode];\n Arrays.fill(headFan, -1);\n for (int i = 0; i < numNode; i++) {\n if (visited[i])\n continue;\n dfs(i);\n }\n\n HashMap<Integer, Integer> group2Col = new HashMap<>();\n int counter = 1;\n for (int i = 0; i < numNode; i++) {\n int father = find(i);\n if (group2Col.containsKey(father)) {\n out.println(group2Col.get(father));\n } else {\n group2Col.put(father, counter);\n out.println(counter);\n counter++;\n }\n }\n out.close();\n }", "private void colorizeCrown() {\n\t\tfor (Class c : this.crown) {\n\t\t\tif (c.getColor() != null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tboolean colorized = false;\n\n\t\t\tAdaptation[] superAdapt = new Adaptation[0];\n\t\t\tif(c.getSuperClasses().size() > 0) {\n\t\t\t\tsuperAdapt = c.getSuperClasses().get(0)\n\t\t\t\t\t.getAdaptationsTable();\n\t\t\t} else {\n\t\t\t\tc.setColor(0);\n\t\t\t\tcolorized = true;\n\t\t\t}\n\t\t\t\n\n\t\t\t\n\t\t\tfor (int i = 0; i < superAdapt.length; i++) {\n\t\t\t\tif (superAdapt[i] == null) {\n\t\t\t\t\tc.setColor(i);\n\t\t\t\t\tcolorized = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!colorized) {\n\t\t\t\tc.setColor(c.getSuperClasses().get(0).getColor() + 1);\n\t\t\t}\n\n\t\t\t// Computation is based on classe's parents discovery\n\t\t\tcomputeAdaptations(c);\n\t\t}\n\t}", "private void selectNovelColors(IMapColor mapColor, Histogram hist, int interestingColors,\n \t\t\tint usedColors, int[] paletteSelections) {\n \t\t\n \t\tInteger[] indices = (Integer[]) hist.getColorIndices().toArray(new Integer[hist.getColorIndices().size()]);\n \t\tSet<Integer> visited = new HashSet<Integer>();\n \t\t\n \t\tbyte[] rgb = { 0, 0, 0 };\n \t\tfloat[] hsv = { 0, 0, 0 };\n \t\t\n \t\tfloat[] lastHSV = { 0, 0, 0 };\n \t\tint[] lastRGB = { 0, 0, 0 };\n \t\tint lastPixel = Integer.MIN_VALUE;\n \t\t\n \t\tint directMap = usedColors / 3;\n \t\tint distance = interestingColors / 3;\n \t\t\n \t\tfor (int i = 0; i < usedColors; i++) {\n \t\t\tfloat maxDiff = -Float.MAX_VALUE;\n \t\t\tint farthestIndex = 0;\n \t\t\tint farthestPixel = 0;\n \t\t\t\n \t\t\tint searchDist = Math.max(1, Math.min(indices.length, (distance * (i + 1) / usedColors)));\n \t\t\tfor (int j = 0; j < searchDist && j < indices.length; j++) {\n \t\t\t\tif (visited.contains(j)) {\n \t\t\t\t\tsearchDist++;\n \t\t\t\t\tcontinue;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tint idx = indices[j];\n \t\t\t\tint pixel = mapColor.getPalettePixel(idx);\n \t\t\t\tpixelToRGB(pixel, rgb);\n \t\t\t\trgbToHsv(rgb[0] & 0xff, rgb[1] & 0xff, rgb[2] & 0xff, hsv);\n \t\t\t\t\n \t\t\t\t\n \t\t\t\tfloat diff = //(hsv[0] - lastHSV[0]) * (hsv[0] - lastHSV[0])\n \t\t\t\t\t//+ ((hsv[1] - lastHSV[1]) * (hsv[1] - lastHSV[1])) * 100000\n \t\t\t\t\t+ (hsv[2] - lastHSV[2]) * (hsv[2] - lastHSV[2])\n \t\t\t\t;\n \t\t\t\t\n \t\t\t\t//float diff = getRGBDistance(rgb, lastRGB);\n \t\t\t\tif (diff >= maxDiff) {\n \t\t\t\t\tmaxDiff = diff;\n \t\t\t\t\tfarthestPixel = pixel;\n \t\t\t\t\tfarthestIndex = j;\n \t\t\t\t\tif (i < directMap) {\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t} \n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t// winner!\n \t\t\tpaletteSelections[i] = farthestIndex;\n \t\t\tvisited.add(farthestIndex);\n \t\t\t\n \t\t\tlastPixel = farthestPixel;\n \t\t\tpixelToRGB(lastPixel, lastRGB);\n \t\t\trgbToHsv(lastRGB[0] & 0xff, lastRGB[1] & 0xff, lastRGB[2] & 0xff, lastHSV);\n \t\t}\n \t}", "public void changerTailleMotsEtCouleur(int tailleMin, int tailleMax, String couleur){\n ArrayList<Integer> listeFreqDuCorpus = new ArrayList<Integer>(); \r\n for (int i=0; i<this.corpus.getListeMot().size(); i++){\r\n int freqDuMotActuel = this.corpus.getListeMot().get(i).getFrequence();\r\n if (!listeFreqDuCorpus.contains(freqDuMotActuel)){\r\n listeFreqDuCorpus.add(freqDuMotActuel); //On change la taille du mot proportionnellement à sa fréquence d'apparition\r\n }\r\n }\r\n \r\n int freqMax = listeFreqDuCorpus.get(0);\r\n if (couleur.equals(\"ROUGE\")){\r\n this.corpusEnWordGraph.set(0, new WordGraph(this.corpus.getListeMot().get(0),this.font,this.g2d, tailleMax, new Color(255,0,0)));\r\n } else if (couleur.equals(\"VERT\")){\r\n this.corpusEnWordGraph.set(0, new WordGraph(this.corpus.getListeMot().get(0),this.font,this.g2d, tailleMax, new Color(0,255,0)));\r\n } else if (couleur.equals(\"BLEU\")) {\r\n this.corpusEnWordGraph.set(0, new WordGraph(this.corpus.getListeMot().get(0),this.font,this.g2d, tailleMax, new Color(0,0,255)));\r\n } else if (couleur.equals(\"NOIR\")) {\r\n this.corpusEnWordGraph.set(0, new WordGraph(this.corpus.getListeMot().get(0),this.font,this.g2d, tailleMax, new Color(0,0,0)));\r\n for (int i=1; i<this.corpus.getListeMot().size(); i++){\r\n Mot motActuel = this.corpus.getListeMot().get(i);\r\n int tailleDuMotActuel =(int) (((double)motActuel.getFrequence()/(double)freqMax)*(tailleMax-tailleMin) + tailleMin);\r\n this.corpusEnWordGraph.set(i, new WordGraph(motActuel, this.font, this.g2d, tailleDuMotActuel, new Color(0,0,0)));\r\n }\r\n }\r\n if (!couleur.equals(\"NOIR\")){ //Si la couleur n'est pas noir, on change la couleur des mots en nuance de la couleur choisie\r\n for (int i=1; i<this.corpus.getListeMot().size(); i++){\r\n Mot motActuel = this.corpus.getListeMot().get(i);\r\n int tailleDuMotActuel =(int) (((double)motActuel.getFrequence()/(double)freqMax)*(tailleMax-tailleMin) + tailleMin);\r\n this.corpusEnWordGraph.set(i, new WordGraph(motActuel, this.font, this.g2d, tailleDuMotActuel, this.nuanceCouleur(couleur)));\r\n }\r\n }\r\n \r\n }", "void createIndex(){\n int index=0;\n for(int i=0;i<ancogs.size();i++)\n if(!cogToIndex.containsKey(ancogs.get(i).getValue2()))\n cogToIndex.put(ancogs.get(i).getValue2(), index++);\n}", "public Electrodomestico() {\r\n this.color = Colores.BLANCO;\r\n this.consumoEnergetico = Letra.F;\r\n this.precioBase = precioDefecto;\r\n this.peso = pesoDefecto;\r\n }", "public void setProbesColor(int[] rows, Color color);", "private void setFillMapColor(String color) {\r\n for (String s: fillKListColor) {\r\n if (s.startsWith(\"color\")) {\r\n color = s.substring(6, s.length() - 1);\r\n String tempColor = (!color.startsWith(\"RGB\")) ? color : color.substring(4, color.length() - 1);\r\n Color fillKColor = new ColorsParser().colorFromString(tempColor);\r\n fillKMapColor.put(kListColor.get(fillKListColor.indexOf(s)), fillKColor);\r\n }\r\n }\r\n }", "protected String comprobarColor(Colores color){\r\n if(getColor() == Colores.AZUL | getColor() == Colores.BLANCO | getColor() == Colores.GRIS | getColor() == Colores.NEGRO\r\n | getColor() == Colores.ROJO){\r\n return \"Color correcto\";\r\n }\r\n else{\r\n return \"Color erroneo\";\r\n }\r\n }", "@Override\n public Boolean colisionoCon(Policia gr) {\n return true;\n }", "private void yellow(){\n\t\tthis.arretes_fY();\n\t\tthis.coins_fY();\n\t\tthis.coins_a1Y();\n\t\tthis.coins_a2Y();\n\t\tthis.aretes_aY();\n\t\tthis.cube[49] = \"Y\";\n\t}", "private Igralec cigavaVrsta(Vrsta vrsta) {\n int count_BELO = 0;\n int count_CRNO = 0;\n for (int k = 0; k < M && (count_BELO == 0 || count_CRNO == 0); k++) {\n switch (plosca[vrsta.x[k]][vrsta.y[k]]) {\n case BELO:\n count_BELO += 1;\n break;\n case CRNO:\n count_CRNO += 1;\n break;\n case PRAZNO:\n break;\n }\n }\n if (count_BELO == M) {\n return Igralec.BEL;\n } else if (count_CRNO == M) {\n return Igralec.CRN;\n } else {\n return null;\n }\n }", "public void chooseColor() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t}", "@Override\n public void setCommunityColorMap(TimeFrame tf, Map<String, String> mapCommunityColorMap) {\n icommunityColors.setCommunityColorMap(tf, mapCommunityColorMap);\n }", "void setColorSelection() {\r\n for (int i = 0; i < chooser.length; i++) {\r\n\r\n if (mainclass.getGraphTyp()\r\n == AbstractGraph.GRAPHTYP_RESIDUAL) {\r\n\r\n switch (i) {\r\n case COLOR_EDGE_ONE:\r\n chooser[i].setColorSelected(colors[COLOR_EDGE_FLOW]);\r\n break;\r\n case COLOR_EDGE_TWO:\r\n chooser[i].setColorSelected(colors[COLOR_EDGE_CAP]);\r\n break;\r\n case COLOR_EDGE_TOP:\r\n chooser[i].setColorSelected(colors[COLOR_EDGE_RTOP]);\r\n break;\r\n default:\r\n chooser[i].setColorSelected(colors[i]);\r\n }\r\n } else {\r\n chooser[i].setColorSelected(colors[i]);\r\n }\r\n }\r\n }", "public Color choixCouleur(String s) {\n\t\tif(s.equals(\"ROUGE\")) return Color.RED;\n\t\telse if(s.equals(\"VERT\")) return Color.GREEN;\n\t\telse if(s.equals(\"BLEU\")) return Color.BLUE;\n\t\telse if(s.equals(\"ROSE\")) return Color.PINK;\n\t\telse if(s.equals(\"BLANC\")) return Color.WHITE;\n\t\telse if(s.equals(\"VIOLET\")) return Color.PURPLE;\n\t\telse if(s.equals(\"JAUNE\")) return Color.YELLOW;\n\t\telse if(s.equals(\"ORANGE\")) return Color.ORANGE;\n\t\telse if(s.equals(\"MARRON\")) return Color.BROWN;\n\t\telse if(s.equals(\"GRIS\")) return Color.GREY;\n\t\telse if(s.equals(\"ROUGE\")) return Color.RED;\n\t\telse return Color.BLACK;\n\t}", "public void movimiento(Point inicio,Point llegada, String color, int nomFicha){\n \n /*if(this.tablero[inicio.x][inicio.y]==0){\n JOptionPane.showMessageDialog(null, \"no hay nada en esa posición\");\n }*/\n \n this.tablero[inicio.x][inicio.y]=0;\n this.tablero[llegada.x][llegada.y]=nomFicha;\n if (color==\"blanco\"){\n this.posiBlancas[inicio.x][inicio.y]=0;\n this.posiBlancas[llegada.x][llegada.y]=nomFicha;\n this.posiNegras[llegada.x][llegada.y]=0;\n }else{\n this.posiNegras[inicio.x][inicio.y]=0;\n this.posiNegras[llegada.x][llegada.y]=nomFicha;\n this.posiBlancas[llegada.x][llegada.y]=0;\n }\n\n }", "public static void main(String[] args) \n\t{\n\t\ttry\n\t\t{\n\t\t\tScanner inFile = new Scanner(new FileReader(args[0]));\n\t\t\tBufferedWriter outFile = new BufferedWriter(new FileWriter(args[1]));\t\t\n\t\t\t\n\t\t\tif(args.length < 1) \n\t\t {\n\t\t System.out.println(\"Error to open file\");\n\t\t System.exit(1);\n\t\t }\n\t\t\t\n\t\t\tint numNodes = inFile.nextInt();\n\t\t\t\t\t\n\t\t\tgraphColoring graphColor = new graphColoring(numNodes);\n\t\t\tint i, j;\n\t\t\n\t\t\twhile(inFile.hasNext())\n\t\t\t{\n\t\t\t \ti = inFile.nextInt();\n\t\t \tj = inFile.nextInt();\n\t\t \tgraphColor.loadMatrix(i, j);\n\t\t \tNode newNode = new Node(i, j);\n\t\t \t\n\t\t\t}\n\t\t\tgraphColor.constructNodeList();\n\t\t\tgraphColor.printNodeList(outFile);\n\t\t\tgraphColor.newColor = 0;\n\t\t\tgraphColor.printMatrix(outFile);\n\t\t\t\n\t\t\twhile(graphColor.findUncolorNode())\n\t\t\t{\n\t\t\t\tgraphColor.newColor++; \n\t\t\t\n\t\t\t\tNode current = graphColor.listHead.next;\n\t\t\t\t\n\t\t\t\twhile(current != null)\n\t\t\t\t{\n\t\t\t\t\tif(current.color == 0 && graphColor.checkAdjacent(current.ID, graphColor.newColor) == 0)\n\t\t\t\t\t{\t\n\t\t\t\t\t\tgraphColor.adjacencyMatrix[current.ID][current.ID] = graphColor.newColor;\n\t\t\t\t\t\tcurrent.color = graphColor.newColor;\n\t\t\t\t\t\tcurrent = current.next;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrent = current.next;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\toutFile.write(\"Number of colors used is: \" + graphColor.newColor + \"\\n\");\n\n\t\t\t\n\t\t\tgraphColor.printNodeList(outFile);\n\t\t\tgraphColor.printMatrix(outFile);\n\t\t\t\n\t\t\tinFile.close();\n\t\t\toutFile.close();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void initColors() {\n\n int i;\n float j;\n\n int start;\n int numShades = 5;\n float shadeInc = 1 / (float) numShades;\n\n\n aColors = new Color[glb.MAXCOLORS]; /* set array size */\n\n\n /* White to Black */\n start = 0;\n for (i = start, j = 1; i < start + 6; j -= shadeInc, i++) {\n aColors[i] = new Color(j, j, j);\n }\n\n start = 6;\n /* Red to almost Magenta */\n for (i = start, j = 0; i < start + 5; j += shadeInc, i++) {\n aColors[i] = new Color((float) 1, (float) 0, j);\n }\n\n\n /* Magenta to almost Blue */\n start += 5;\n for (i = start, j = 1; i < start + 5; j -= shadeInc, i++) {\n aColors[i] = new Color(j, (float) 0, (float) 1);\n }\n\n\n /* Blue to almost Cyan */\n start += 5;\n for (i = start, j = 0; i < start + 5; j += shadeInc, i++) {\n aColors[i] = new Color((float) 0, j, (float) 1);\n }\n\n /* Cyan to almost Green */\n start += 5;\n for (i = start, j = 1; i < start + 5; j -= shadeInc, i++) {\n aColors[i] = new Color((float) 0, (float) 1, j);\n }\n\n\n\n /* Green to almost Yellow */\n start += 5;\n for (i = start, j = 0; i < start + 5; j += shadeInc, i++) {\n aColors[i] = new Color(j, (float) 1, (float) 0);\n }\n\n /* Yellow to almost Red */\n start += 5;\n for (i = start, j = 1; i < start + 5; j -= shadeInc, i++) {\n aColors[i] = new Color((float) 1, j, (float) 0);\n }\n\n }", "private void colorObject(String node, Color color) {\r\n pMap.get(node).changeColor(\"\", color, null, null);\r\n }", "public void rankColorByDegree() {\r\n\t\tthis.rankColorByDegree( new Color[] { new Color( 0xff55d0 ), new Color( 0xB30000 ) } );\r\n\t}", "public int colorVertices();", "public void generateColor() {\n if (army < 0)\n color = Color.getHSBColor(0f, 1 - (float) Math.random() * 0.2f, 0.5f + (float) Math.random() * 0.5f);\n else if (army > 0)\n color = Color.getHSBColor(0.7f - (float) Math.random() * 0.2f, 1 - (float) Math.random() * 0.2f, 0.4f + (float) Math.random() * 0.25f);\n else color = Color.getHSBColor(0f, 0, 0.55f + (float) Math.random() * 0.25f);\n }", "public void addNeighbour() {\n for (int i = 0; i < getNumberPoney(); i++) {\n if (i == 0) {\n System.out.println(this.getPoney()[0].getPoneyColor());\n this.getPoney()[i].addVoisin(this.getPoney()[i + 1]);\n } else if (i == getNumberPoney() - 1) {\n this.getPoney()[i].addVoisin(this.getPoney()[i - 1]);\n } else {\n this.getPoney()[i].addVoisin(this.getPoney()[i + 1]);\n this.getPoney()[i].addVoisin(this.getPoney()[i - 1]);\n }\n }\n }", "public abstract void collectorHelp(FloodItWorld w, Color c);", "@Override\n public Boolean colisionoCon(MV gr) {\n return true;\n }" ]
[ "0.6472919", "0.60227346", "0.59486157", "0.5778852", "0.56138027", "0.5594463", "0.5566299", "0.55555856", "0.55333704", "0.55295104", "0.5522828", "0.55154175", "0.5487578", "0.5452056", "0.5433769", "0.5420743", "0.5419102", "0.5391007", "0.53805375", "0.53764546", "0.53735447", "0.537107", "0.53608197", "0.53596467", "0.5357837", "0.5348962", "0.5346559", "0.5317591", "0.530208", "0.5276274", "0.52676815", "0.52671343", "0.5258644", "0.5254408", "0.5250412", "0.52397096", "0.5231129", "0.52284074", "0.5218828", "0.5190458", "0.5181817", "0.51793164", "0.51717716", "0.5169035", "0.51644224", "0.51626176", "0.5156706", "0.51468784", "0.51394516", "0.5138963", "0.5135529", "0.5133149", "0.51215976", "0.51169556", "0.5107087", "0.510422", "0.50902635", "0.50897324", "0.50848687", "0.50847226", "0.508307", "0.5080425", "0.50795627", "0.50795627", "0.5076441", "0.5076391", "0.5075747", "0.5071347", "0.5059319", "0.5058786", "0.5051188", "0.5049967", "0.5049661", "0.5047175", "0.5042817", "0.5038432", "0.5037266", "0.5026482", "0.502331", "0.502068", "0.50171745", "0.5013086", "0.5010796", "0.5009717", "0.50017995", "0.4992706", "0.4991281", "0.49895698", "0.49889365", "0.4988751", "0.49885726", "0.49789512", "0.49741182", "0.49735907", "0.49664566", "0.4963222", "0.4962843", "0.49606466", "0.49596825", "0.4955171" ]
0.77253294
0
Invia una battuta a tutti i visualizzatori
private void invia(Battuta battuta) { String nomePersonaggio = battuta.getNomePersonaggio(); String nomeAttore = cast.getAttore(nomePersonaggio); String battuta_ = battuta.getBattuta(); String messaggio = formattaBattuta(nomePersonaggio, nomeAttore, battuta_); for (int j = 0; j < visualizzatori.size(); j++) { // recupera il colore da associare alla battuta ColoreMessaggio colore = mappaColori.get(j).getColore( nomePersonaggio); // carica il messaggio sul visualizzatore visualizzatori.get(j).addMessaggio( new Messaggio(colore, messaggio)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void visualChange();", "public static void launchVisualEffect() {\n\n Object[][] multiDimensionalTrailTracker = new Object[trackAmount][individualEffectsPerTrack];\n\n for (int i = 0; i < multiDimensionalTrailTracker.length; i++) {\n ArrayList<Object> localObjects = new ArrayList<>();\n for (int a = 0; a < multiDimensionalTrailTracker.length; a++)\n localObjects.addAll(addObfuscatedEffects());\n for (int j = 0; j < multiDimensionalTrailTracker[0].length; j++)\n if (localObjects.get(j) != null)\n multiDimensionalTrailTracker[i][j] = localObjects.get(j);\n\n }\n\n VisualItemProcessor visualItemProcessor = new VisualItemProcessor(multiDimensionalTrailTracker,\n RotationCacher.cachedVectors, RotationCacher.NUMBER_OF_POINTS_PER_FULL_ROTATION);\n\n return;\n\n\n }", "public abstract String visualizar();", "public visualizar_camas() {\n initComponents();\n }", "private void visualizarm(){\r\n switch(this.opc){\r\n case 1:\r\n System.out.printf(\"0\\t1\\t2\\t3\\t4\\t\\t\\t\\t\"+min+\":\"+seg+\"\\n\");\r\n System.out.printf(\"-----------------------------------------------------\\n\");\r\n for(int i=0;i<2;i++){\r\n for(int j=0;j<5;j++){\r\n System.out.printf(\"%s\\t\",mfacil[i][j]);\r\n }\r\n System.out.printf(\"|\"+i+\"\\n\");\r\n }\r\n break;\r\n case 2:\r\n System.out.printf(\"0\\t1\\t2\\t3\\t4\\t5\\n\");\r\n System.out.printf(\"-----------------------------------------------------\\n\");\r\n for(int i=0;i<3;i++){\r\n for(int j=0;j<6;j++){\r\n System.out.printf(\"%s\\t\",mmedio[i][j]);\r\n }\r\n System.out.printf(\"|\"+i+\"\\n\");\r\n }\r\n break;\r\n case 3:\r\n System.out.printf(\"0\\t1\\t2\\t3\\t4\\t5\\t6\\n\");\r\n System.out.printf(\"------------------------------------------------------------------------\\n\");\r\n for(int i=0;i<4;i++){\r\n for(int j=0;j<7;j++){\r\n System.out.printf(\"%s\\t\",mdificil[i][j]);\r\n }\r\n System.out.printf(\"|\"+i+\"\\n\");\r\n }\r\n break;\r\n }\r\n }", "public void ocultaBotoesDeSegundoPlanoAtd(){\n JButton[] botSegPlan = botoesDeSegPlanoAtd();\n \n for(int i = 0; i<botSegPlan.length; i++){\n botSegPlan[i].setVisible(false);\n }\n }", "public void visualizzaCampo(){\r\n\t\tInputOutput.stampaCampo(nome, descrizione, obbligatorio);\r\n\t}", "public static String _btnfrasco_click() throws Exception{\nmostCurrent._activity.RemoveAllViews();\n //BA.debugLineNum = 126;BA.debugLine=\"Activity.LoadLayout(\\\"lay_mosquito_Ciclo\\\")\";\nmostCurrent._activity.LoadLayout(\"lay_mosquito_Ciclo\",mostCurrent.activityBA);\n //BA.debugLineNum = 128;BA.debugLine=\"utilidades.CreateHaloEffect(Activity, butPaso1, C\";\nmostCurrent._vvvvvvvvvvvvvvvvvvvvv7._vvvvvvvvv3 /*void*/ (mostCurrent.activityBA,(anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(mostCurrent._activity.getObject())),mostCurrent._butpaso1,anywheresoftware.b4a.keywords.Common.Colors.Red);\n //BA.debugLineNum = 130;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "public void anuncio() {\n\n\t\tapp.image(pantallaEncontrado, 197, 115, 300, 150);\n\n\t\tapp.image(botonContinuar, 253, 285);\n\n\t}", "public void majGui(){\n gui.reset();\n ArrayList<Ball> ballsArray = balls.getBalls();\n for (Ball b: ballsArray){\n Vector location = b.getLocation();\n gui.addGraphicalElement(\n new Oval(\n (int) location.x, (int) location.y, Color.decode(\"#FF77b4\"), Color.decode(\"#00FF48\"), 50));\n }\n }", "private void actualizarVisor()\n {\n visor.setText(\"\" + calc.getValorEnVisor());\n }", "public void inicio(){\r\n Ventana v = new Ventana();\r\n v.setVisible(true); //se hace visible la ventana\r\n }", "private void visualize(guiStatistics statistics) {\r\n\t\tstatistics.pack();\r\n RefineryUtilities.centerFrameOnScreen(statistics);\r\n statistics.setVisible(true);\r\n\r\n\t}", "@Override\n public void visualize() {\n if (this.count() > 0){\n for (int i = 0; i < this.count(); i++){\n System.out.println(i + \".- \" + this.bench.get(i).getName() + \" (ID: \" + this.bench.get(i).getId() + \")\");\n }\n } else {\n System.out.println(\"La banca está vacía.\");\n }\n\n }", "public void showArming();", "public void limpiarPuntos(Graphics g, int s){\n Color repaint = new Color(102, 102, 102);\n g.setColor(repaint);\n g.fillRect(0, 35, 550, 560);\n limpiarTabla();\n // btnSegmentos.setEnabled(false);\n if (s==1)DibujarPlano(jpPlano.getGraphics(), 1);\n else if (s==2) DibujarPlano(jpPlano.getGraphics(), 2);\n }", "protected void graphicProgramation(Graphics2D g2) throws InterruptedException, IOException {\n double yPosition = this.getSize().getHeight();\n // se cambian las propiedades de los graficos\n this.setOpaque(true);\n // si no ha cambiado de programacion y no hay canales, se crea la nueva programacion\n if (!alreadyChange && channelGraphics.size() == 0) {\n // carga la programacion del dia\n programation = new Programacion(getFileOftheDay());\n // recargando imagenes\n for (int channel = 0; channel < programation.getCantCanalesProg(); channel++) {\n // se crea una imagen del canal grafico\n BufferedImage bufferedImage = new BufferedImage(this.getSize().width,\n (int) SIBAConst.CHANNEL_GRAPHIC_HEIGHT, BufferedImage.TYPE_INT_RGB);\n Graphics2D big = bufferedImage.createGraphics();\n // se crea una instancia de un canal grafico\n ChannelGraphic channelGraphic = new ChannelGraphic(big, programation.getCanalInd(channel));\n // referencia la posicion donde quedara el grafico cuando sea graficado\n channelGraphic.setyPosition(yPosition);\n // se setea la altura del canal\n channelGraphic.setHeight(SIBAConst.CHANNEL_GRAPHIC_HEIGHT);\n // el ancho del canal grafico es el ancho del componente\n channelGraphic.setWidthComponent(this.getSize().getWidth());\n // se referencia la imagen\n channelGraphic.setBufferedImage(bufferedImage);\n // grafica el canal\n \n if ( this.qtyBackgounds < 0){\n \t\n \tSystem.out.println(\"Vá a operar con categorias fondos\");\n \tchannelGraphic.paintChannel(-1,ViewerHoursControl.getStartHour(), ViewerHoursControl.getStartHour() + SIBAConst.SUM_HOUR);\n \t\n }\n else if (this.qtyBackgounds == 0)\t\n {\n \tSystem.out.println(\"No vá a operar con múltiples fondos\");\n \tchannelGraphic.paintChannel(ViewerHoursControl.getStartHour(), ViewerHoursControl.getStartHour() + SIBAConst.SUM_HOUR);\n }\t\n else\n {\n \tSystem.out.println(\"Si vá a operar con múltiples fondos\");\n \tchannelGraphic.paintChannel(this.bkgActivo,ViewerHoursControl.getStartHour(), ViewerHoursControl.getStartHour() + SIBAConst.SUM_HOUR);\n \tthis.moveToNextInd();\n }\n \n \n \n // se adjunta el canal grafico a la coleccion\n channelGraphics.add(channelGraphic);\n bufferedImage.flush();\n yPosition += SIBAConst.CHANNEL_GRAPHIC_HEIGHT;\n System.out.println(channelGraphic.getyPosition());\n }\n alreadyChange = true;\n }\n if (activatedScheduleChange) {\n // recargando imagenes\n for (ChannelGraphic channelGraphic : channelGraphics) {\n // grafica el canal\n channelGraphic.paintChannel(ViewerHoursControl.getStartHour(), ViewerHoursControl.getStartHour() + SIBAConst.SUM_HOUR);\n }\n activatedScheduleChange = false;\n }\n \n //System.out.println(\"Already Change: \"+alreadyChange+\" / Remove Last Programation: \"+removeLastProgramation);\n for (Iterator<ChannelGraphic> iteratorChannel = channelGraphics.iterator(); iteratorChannel.hasNext();) {\n ChannelGraphic channelGraphicScroll = iteratorChannel.next();\n \n // si el componente ya fue visualizado, pasa a la cordenada del canal grafico que contiene la\n // cordenada \"Y\" mas alta\n if (channelGraphicScroll.getyPosition() + SIBAConst.CHANNEL_GRAPHIC_HEIGHT < 0) {\n channelGraphicScroll.setyPosition(getChannelYPositionLast() + SIBAConst.CHANNEL_GRAPHIC_HEIGHT);\n }\n channelGraphicScroll.setyPosition(channelGraphicScroll.getyPosition() - 1.0);\n // borrar anterior imagen\n g2.clearRect(0, (int) channelGraphicScroll.getyPosition(), (int) channelGraphicScroll.getWidthComponent(),\n (int) channelGraphicScroll.getHeight() + 1);\n // animar la imagen\n g2.drawImage(channelGraphicScroll.getBufferedImage(), 0, (int) channelGraphicScroll.getyPosition(), this);\n // Cada canal que sobrepase los limites de la pantalla en el sentido Norte, sera eliminara\n // de la programacion del dia, (debido a que se hara cambio a una nueva programacion de otro dia)\n // si el componente ya fue visualizado, pasa a la cordenada del canal grafico que contiene la\n // cordenada \"Y\" mas alta\n if (channelGraphicScroll.getyPosition() + SIBAConst.CHANNEL_GRAPHIC_HEIGHT < 0) {\n // verifica si se van a eliminar los programas a medida que se hayan visto\n if (!alreadyChange && removeLastProgramation) {\n \tSystem.out.println(\"Se ha definido iteratorChannel.remove()\");\n iteratorChannel.remove();\n }\n }\n }\n \n }", "public Visualizador() {\n initComponents();\n inicializar();\n }", "private JButton getJButtonVisualizar() {\r\n\t\tif (jButtonVisualizar == null) {\r\n\t\t\tjButtonVisualizar = new JButton();\r\n\t\t\tjButtonVisualizar.setText(\"Visualizar\");\r\n\t\t\tjButtonVisualizar.setIcon(new ImageIcon(getClass().getResource(\"img\" + File.separator + \"run.gif\")));\r\n\t\t\tjButtonVisualizar.addActionListener(this);\r\n\t\t}\r\n\t\treturn jButtonVisualizar;\r\n\t}", "public void q2(int op)\n {\n if(op==1)\n {\n Ventana_Principal.arrow.setVisible(true);\n cambio();\n }else\n {\n if(opBebidad==1)\n {\n actualizarStockB(\"Coca-Cola\");\n JOptionPane.showMessageDialog(null, \"¡Disfruta de tu Coca-Cola...!\");\n VentanaCC obj=new VentanaCC();\n obj.setVisible(true);\n\n }else\n if(opBebidad==2)\n {\n actualizarStockB(\"Sprite\");\n JOptionPane.showMessageDialog(null, \"¡Disfruta de tu Sprite...!\");\n VentanaSprite obj=new VentanaSprite();\n obj.setVisible(true);\n\n }else\n if(opBebidad==3)\n {\n actualizarStockB(\"Fanta\");\n JOptionPane.showMessageDialog(null, \"¡Disfruta de tu Fanta...!\");\n VentanaFanta obj=new VentanaFanta();\n obj.setVisible(true);\n }else\n if(opBebidad==4)\n {\n actualizarStockB(\"Pepsi\");\n JOptionPane.showMessageDialog(null, \"¡Disfruta de tu Pepsi...!\");\n VentanaPepsi obj=new VentanaPepsi();\n obj.setVisible(true); \n }\n }\n }", "private void esegui() {\n /* variabili e costanti locali di lavoro */\n OperazioneMonitorabile operazione;\n\n try { // prova ad eseguire il codice\n\n /**\n * Lancia l'operazione di analisi dei dati in un thread asincrono\n * al termine il thread aggiorna i dati del dialogo\n */\n operazione = new OpAnalisi(this.getProgressBar());\n operazione.avvia();\n\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n }", "@Override\r\n public void prenderVehiculo() {\r\n System.out.println(\"___________________________________________________\");\r\n System.out.println(\"prender Jet\");\r\n }", "public VisualizarLlamada() {\n initComponents();\n }", "public interface TVisualization{\n\t/**\n\t * Visualize detected beats with lower pitch.\n\t */\n\tpublic void kick();\n\t/**\n\t * Visualize detected beats with high pitch.\n\t */\n\tpublic void hat();\n\t/**\n\t * Visualize detected beats with medium pitch.\n\t */\n\tpublic void snare();\n\t/**\n\t * Draws visualization to the main application.\n\t */\n\tpublic void draw();\n}", "void showPlaceholderGui() {\n this.game.a(new da());\n }", "public void superPacman(){\n setSuperPacman(true);\n\n for(VisualObject v : Map.visualObjects){\n if(v.getClass().getGenericSuperclass() == Fantome.class){\n ((Fantome)v).changeSpriteAnimation(\"./data/SpriteMouvement/FantomePeur/\");\n ((Fantome)v).initAnimation();\n }\n }\n new Thread(() -> {\n //mettre la nouvelle image du superpacman\n try {\n TimeUnit.SECONDS.sleep(10);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n setSuperPacman(false);\n for(VisualObject v : Map.getVisualObjects()){\n if(v.getClass().getGenericSuperclass() == Fantome.class){\n ((Fantome)v).initSpriteAnimation();\n ((Fantome)v).initAnimation();\n }\n }\n }).start();\n\n }", "public void act() \n {\n setImage(new GreenfootImage(\"== Total Pembayaran ==\",50,Color.yellow,Color.black));\n }", "public void prenderVehiculo();", "public void drawButtons(){\r\n\t\tGuiBooleanButton showDirection = new GuiBooleanButton(1, 10, 20, 150, 20, \"Show Direction\", ((InfoMod)speicher.getMod(ModData.InfoMod.name())).isShowdir(), \"showdir\", ModData.InfoMod, speicher,LiteModMain.lconfig.getData(\"InfoMod.showdir\").split(\";\"));\r\n\t\tGuiChooseStringButton dirpos = new GuiChooseStringButton(2, width/2+50, 20, 150, 20, \"Dir-Position\", GuiPositions.getPosList(), \"posdir\", ModData.InfoMod, speicher,GuiPositions.getPos(((InfoMod)speicher.getMod(ModData.InfoMod.name())).getPosDir()),LiteModMain.lconfig.getData(\"Main.choosepos\").split(\";\"));\r\n\t\t\r\n\t\tGuiBooleanButton showFPS= new GuiBooleanButton(3, 10, 45, 150, 20, \"Show FPS\", ((InfoMod)speicher.getMod(ModData.InfoMod.name())).isShowfps(), \"showfps\", ModData.InfoMod, speicher,LiteModMain.lconfig.getData(\"InfoMod.showfps\").split(\";\"));\r\n\t\tGuiChooseStringButton fpspos = new GuiChooseStringButton(4, width/2+50, 45, 150, 20, \"FPS-Position\", GuiPositions.getPosList(), \"posfps\", ModData.InfoMod, speicher,GuiPositions.getPos(((InfoMod)speicher.getMod(ModData.InfoMod.name())).getPosFPS()),LiteModMain.lconfig.getData(\"Main.choosepos\").split(\";\"));\r\n\t\t\r\n\t\tGuiBooleanButton showCoor = new GuiBooleanButton(5, 10, 70, 150, 20, \"Show Coor\", ((InfoMod)speicher.getMod(ModData.InfoMod.name())).isShowcoor(), \"showcoor\", ModData.InfoMod, speicher,LiteModMain.lconfig.getData(\"InfoMod.showcoor\").split(\";\"));\r\n\t\tGuiChooseStringButton coorpos = new GuiChooseStringButton(6, width/2+50, 70, 150, 20, \"Coor-Position\", GuiPositions.getPosList(), \"poscoor\", ModData.InfoMod, speicher,GuiPositions.getPos(((InfoMod)speicher.getMod(ModData.InfoMod.name())).getPosCoor()),LiteModMain.lconfig.getData(\"Main.choosepos\").split(\";\"));\r\n\t\t\r\n\t\tGuiBooleanButton showworldage = new GuiBooleanButton(7, 10, 95, 150, 20, \"Show WorldAge\", ((InfoMod)speicher.getMod(ModData.InfoMod.name())).isShowWorldAge(), \"showworldage\", ModData.InfoMod, speicher,LiteModMain.lconfig.getData(\"InfoMod.showworldage\").split(\";\"));\r\n\t\tGuiChooseStringButton worldagepos = new GuiChooseStringButton(8, width/2+50, 95, 150, 20, \"WorldAge-Position\", GuiPositions.getPosList(), \"posworldage\", ModData.InfoMod, speicher,GuiPositions.getPos(((InfoMod)speicher.getMod(ModData.InfoMod.name())).getPosWorldAge()),LiteModMain.lconfig.getData(\"Main.choosepos\").split(\";\"));\r\n\t\t\r\n\t\t\r\n\t\tGuiBooleanButton showFriendly = new GuiBooleanButton(7, 10, 120, 150, 20, \"Mark friendly spawns\", ((InfoMod)speicher.getMod(ModData.InfoMod.name())).isShowingFriendlySpawns(), \"showfmobspawn\", ModData.InfoMod, speicher,LiteModMain.lconfig.getData(\"InfoMod.showfriendlymobspawn\").split(\";\"));\r\n\t\tGuiBooleanButton showAggressiv = new GuiBooleanButton(7, 10, 145, 150, 20, \"Mark aggressiv spawns\", ((InfoMod)speicher.getMod(ModData.InfoMod.name())).isShowingAggressivSpawns(), \"showamobspawn\", ModData.InfoMod, speicher,LiteModMain.lconfig.getData(\"InfoMod.showaggressivmobspawn\").split(\";\"));\r\n\t\t\r\n\t\tGuiBooleanButton dynamic = new GuiBooleanButton(7, width/2+50, 120, 150, 20, \"dynamic selection\", ((InfoMod)speicher.getMod(ModData.InfoMod.name())).isDynamic(), \"dynamichsel\", ModData.InfoMod, speicher,LiteModMain.lconfig.getData(\"InfoMod.dynamicselection\").split(\";\"));\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tGuiButton back = new GuiButton(9, width/2-100,height-50 , \"back to game\");\r\n\t\t\r\n\t\tbuttonList.add(showworldage);\r\n\t\tbuttonList.add(worldagepos);\r\n\t\tbuttonList.add(dirpos);\r\n\t\tbuttonList.add(fpspos);\r\n\t\tbuttonList.add(coorpos);\r\n\t\tbuttonList.add(showCoor);\r\n\t\tbuttonList.add(showFPS);\r\n\t\tbuttonList.add(showDirection);\r\n\t\t\r\n\t\tbuttonList.add(showFriendly);\r\n\t\tbuttonList.add(showAggressiv);\r\n\t\tbuttonList.add(dynamic);\r\n\t\t\r\n\t\tbuttonList.add(back);\r\n\t}", "public static String _btnmosquito_click() throws Exception{\nmostCurrent._activity.RemoveAllViews();\n //BA.debugLineNum = 75;BA.debugLine=\"Activity.LoadLayout(\\\"lay_mosquito_Mosquito\\\")\";\nmostCurrent._activity.LoadLayout(\"lay_mosquito_Mosquito\",mostCurrent.activityBA);\n //BA.debugLineNum = 76;BA.debugLine=\"scrollExtraMosquito.Panel.LoadLayout(\\\"lay_mosquit\";\nmostCurrent._scrollextramosquito.getPanel().LoadLayout(\"lay_mosquito_Paneles\",mostCurrent.activityBA);\n //BA.debugLineNum = 77;BA.debugLine=\"scrollExtraMosquito.Panel.Width = 600dip\";\nmostCurrent._scrollextramosquito.getPanel().setWidth(anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (600)));\n //BA.debugLineNum = 78;BA.debugLine=\"scrollExtraMosquito.FullScroll(True)\";\nmostCurrent._scrollextramosquito.FullScroll(anywheresoftware.b4a.keywords.Common.True);\n //BA.debugLineNum = 79;BA.debugLine=\"utilidades.CreateHaloEffect(Activity, butPatas, C\";\nmostCurrent._vvvvvvvvvvvvvvvvvvvvv7._vvvvvvvvv3 /*void*/ (mostCurrent.activityBA,(anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(mostCurrent._activity.getObject())),mostCurrent._butpatas,anywheresoftware.b4a.keywords.Common.Colors.Yellow);\n //BA.debugLineNum = 80;BA.debugLine=\"utilidades.CreateHaloEffect(Activity, butColor, C\";\nmostCurrent._vvvvvvvvvvvvvvvvvvvvv7._vvvvvvvvv3 /*void*/ (mostCurrent.activityBA,(anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(mostCurrent._activity.getObject())),mostCurrent._butcolor,anywheresoftware.b4a.keywords.Common.Colors.Yellow);\n //BA.debugLineNum = 81;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "public void draw() {\n background(0); // Color de Fondo - Negro\n // Se mencionan cada una de las funciones a utilizar en la class.\n a.movbolitas1(); // a.funcion es para las funciones principales.\n a.bolita2();\n a.movbolitas();\n a.bolita1();\n a.triangulo();\n a.triangulo1();\n c.movbolitas(); // c.funcion y m.funci\\u00f3n es para las mismas\n // funciones anteriores que se repetir\\u00e1n\n c.bolita1();\n c.movbolitas();\n c.bolita2();\n m.movbolitas();\n m.bolita1();\n m.movbolitas1();\n m.bolita2();\n a.circulos();\n}", "private void inizializzazione()\n {\n //Costruzione della Istanza display\n display = new Display(titolo,larghezza,altezza);\n \n /*Viene aggiunto il nostro gestore degli input da tastiera\n * alla nostra cornice.*/\n display.getCornice().addKeyListener(gestoreTasti);\n display.getCornice().addMouseListener(gestoreMouse);\n display.getCornice().addMouseMotionListener(gestoreMouse);\n display.getTelaGrafica().addMouseListener(gestoreMouse);\n display.getTelaGrafica().addMouseMotionListener(gestoreMouse);\n \n //Codice temporaneo per caricare la nostra immagine nel nostro programma\n /*testImmagine = CaricatoreImmagini.caricaImmagini(\"/Textures/Runner Stickman.png\");*/\n \n //Inizializzazione dell'attributo \"foglio\". Gli viene passato come parametro \n //\"testImmagine\" contenente l'immagine del nostro sprite sheet.\n /*foglio = new FoglioSprite(testImmagine);*/\n \n /*Inizializzazione della classe Risorse.*/\n Risorse.inizializzazione();\n \n maneggiatore = new Maneggiatore(this);\n /*Inizializzazione Camera di Gioco*/\n camera = new Camera(maneggiatore,0,0);\n \n /*Inizializzazione degli stati di gioco.*/\n statoMenu = new StatoMenù(maneggiatore);\n Stato.setStato(statoMenu);\n }", "private void visualizaPersonajes() {\r\n\r\n\t\t// Recogemos nuestro personaje y comprobamos su personaje para mostrar una\r\n\t\t// imagen u\r\n\t\t// otra.\r\n\t\tthis.personaje = DatabaseOperaciones.getPersonaje();\r\n\r\n\t\tString clase = (personaje == null) ? null : personaje.getClass().toString().substring(24);\r\n\r\n\t\tif (clase != null) {\r\n\r\n\t\t\tthis.character1.setStyle(\"visibility: visible;\" + \"-fx-background-image: url('\"\r\n\t\t\t\t\t+ this.personaje.getAspecto() + \"'); \" + \"-fx-background-size: cover;\");\r\n\r\n\t\t}\r\n\r\n\t\telse {\r\n\r\n\t\t\tthis.character1.setStyle(\"visibility: hidden;\");\r\n\t\t}\r\n\r\n\t\tcompruebaPersonajes();\r\n\t}", "@Listen(\"onClick =#asignarEspacio\")\n\tpublic void Planificacion() {\n\t\tString dir = \"gc/espacio/frm-asignar-espacio-recursos-catalogo.zul\";\n\t\tclearDivApp(dir);\n\t\t// Clients.evalJavaScript(\"document.title = 'ServiAldanas'; \");\n\t}", "private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {\n if(serializa.CargarTfg().isEmpty()){\n JOptionPane.showMessageDialog(this, \"TODAVÍA NO HAY TFGS REGISTRADOS\", \"INFORMACION\", JOptionPane.INFORMATION_MESSAGE);\n }else{\n InterfazVisualizarTfg lt = new InterfazVisualizarTfg(this.u, this.serializa){\n @Override\n public void dispose(){\n //Hacemos visible la principal\n getFrame().setVisible(true);\n //Cerramos\n super.dispose();\n }\n };\n this.setVisible(false);\n lt.setVisible(true); \n }\n \n }", "public Visualize() {\n initComponents();\n \n }", "public void med1() {\n DrawingPanel win = new DrawingPanel(WIDTH, HEIGHT);\n java.awt.Graphics g = win.getGraphics();\n win.setTitle(\"Med. 1\");\n win.setLocation(300, 10);\n win.setBackground(java.awt.Color.red);\n for(int y = -10; y < HEIGHT; y += 24) {\n for(int x = -10; x < WIDTH; x += 24) {\n octagon(x, y, g);\n }\n }\n }", "public void launchExplorer() {\n SimulatedEnvironment env = new SimulatedEnvironment(this.domain, this.initialState);\n VisualExplorer exp = new VisualExplorer(this.domain, env, this.v, 800, 800);\n exp.addKeyAction(\"w\", GridWorldDomain.ACTION_NORTH, \"\");\n exp.addKeyAction(\"s\", GridWorldDomain.ACTION_SOUTH, \"\");\n exp.addKeyAction(\"d\", GridWorldDomain.ACTION_EAST, \"\");\n exp.addKeyAction(\"a\", GridWorldDomain.ACTION_WEST, \"\");\n\n //exp.enableEpisodeRecording(\"r\", \"f\", \"irlDemo\");\n\n exp.initGUI();\n }", "public void verVerConvocatorias()\r\n\t{\r\n\t\tactualizarFinalizacionConvocatorias();\r\n\t\tverconvocatorias = new VerConvocatorias(this);\r\n\t\tverconvocatorias.setVisible(true);\r\n\t}", "public void borra() {\n dib.borra();\n dib.dibujaImagen(limiteX-60,limiteY-60,\"tierra.png\");\n dib.pinta(); \n }", "@Override\n\tpublic void EjecutaGui() {\n\t\tVentanaEj1 inicio = new VentanaEj1();\n\t\tinicio.setVisible(true);\n\t}", "public static String _imglarvas_click() throws Exception{\nmostCurrent._butpaso2.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 211;BA.debugLine=\"butPaso3.Visible = False\";\nmostCurrent._butpaso3.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 212;BA.debugLine=\"butPaso4.Visible = False\";\nmostCurrent._butpaso4.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 213;BA.debugLine=\"lblLabelPaso1.Visible = False\";\nmostCurrent._lbllabelpaso1.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 214;BA.debugLine=\"lblPaso2a.Visible = False\";\nmostCurrent._lblpaso2a.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 215;BA.debugLine=\"lblPaso2b.Visible = False\";\nmostCurrent._lblpaso2b.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 216;BA.debugLine=\"lblPaso3.Visible = False\";\nmostCurrent._lblpaso3.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 217;BA.debugLine=\"lblPaso3a.Visible = False\";\nmostCurrent._lblpaso3a.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 218;BA.debugLine=\"lblPaso4.Visible = False\";\nmostCurrent._lblpaso4.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 219;BA.debugLine=\"imgPupas.Visible = False\";\nmostCurrent._imgpupas.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 220;BA.debugLine=\"imgLarvas.Visible = False\";\nmostCurrent._imglarvas.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 221;BA.debugLine=\"imgMosquito.Visible = False\";\nmostCurrent._imgmosquito.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 222;BA.debugLine=\"imgMosquito1.Visible = False\";\nmostCurrent._imgmosquito1.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 223;BA.debugLine=\"imgHuevos.Visible = False\";\nmostCurrent._imghuevos.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 224;BA.debugLine=\"lblEstadio.Visible = False\";\nmostCurrent._lblestadio.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 226;BA.debugLine=\"lblFondo.Initialize(\\\"\\\")\";\nmostCurrent._lblfondo.Initialize(mostCurrent.activityBA,\"\");\n //BA.debugLineNum = 227;BA.debugLine=\"lblFondo.Color = Colors.ARGB(30,255,94,94)\";\nmostCurrent._lblfondo.setColor(anywheresoftware.b4a.keywords.Common.Colors.ARGB((int) (30),(int) (255),(int) (94),(int) (94)));\n //BA.debugLineNum = 228;BA.debugLine=\"Activity.AddView(lblFondo,0,0,100%x,100%y)\";\nmostCurrent._activity.AddView((android.view.View)(mostCurrent._lblfondo.getObject()),(int) (0),(int) (0),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (100),mostCurrent.activityBA));\n //BA.debugLineNum = 230;BA.debugLine=\"panelPopUps_2.Initialize(\\\"\\\")\";\nmostCurrent._panelpopups_2.Initialize(mostCurrent.activityBA,\"\");\n //BA.debugLineNum = 231;BA.debugLine=\"panelPopUps_2.LoadLayout(\\\"lay_Mosquito_PopUps\\\")\";\nmostCurrent._panelpopups_2.LoadLayout(\"lay_Mosquito_PopUps\",mostCurrent.activityBA);\n //BA.debugLineNum = 233;BA.debugLine=\"lblPopUp_Descripcion.Text = \\\"\\\"\";\nmostCurrent._lblpopup_descripcion.setText(BA.ObjectToCharSequence(\"\"));\n //BA.debugLineNum = 234;BA.debugLine=\"imgPopUp.Visible = True\";\nmostCurrent._imgpopup.setVisible(anywheresoftware.b4a.keywords.Common.True);\n //BA.debugLineNum = 235;BA.debugLine=\"imgPopUp.RemoveView\";\nmostCurrent._imgpopup.RemoveView();\n //BA.debugLineNum = 236;BA.debugLine=\"imgPopUp.Initialize(\\\"\\\")\";\nmostCurrent._imgpopup.Initialize(mostCurrent.activityBA,\"\");\n //BA.debugLineNum = 237;BA.debugLine=\"imgPopUp.Bitmap = LoadBitmap(File.DirAssets, \\\"mos\";\nmostCurrent._imgpopup.setBitmap((android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.LoadBitmap(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),\"mosquito_larvaFoto.png\").getObject()));\n //BA.debugLineNum = 238;BA.debugLine=\"imgPopUp.Gravity = Gravity.FILL\";\nmostCurrent._imgpopup.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.FILL);\n //BA.debugLineNum = 239;BA.debugLine=\"btnCerrarPopUp.RemoveView\";\nmostCurrent._btncerrarpopup.RemoveView();\n //BA.debugLineNum = 240;BA.debugLine=\"btnCerrarPopUp.Initialize(\\\"btnCerrarPopUp_Larvas\\\"\";\nmostCurrent._btncerrarpopup.Initialize(mostCurrent.activityBA,\"btnCerrarPopUp_Larvas\");\n //BA.debugLineNum = 241;BA.debugLine=\"btnCerrarPopUp.Typeface = Typeface.FONTAWESOME\";\nmostCurrent._btncerrarpopup.setTypeface(anywheresoftware.b4a.keywords.Common.Typeface.getFONTAWESOME());\n //BA.debugLineNum = 242;BA.debugLine=\"btnCerrarPopUp.Text = \\\"\\\"\";\nmostCurrent._btncerrarpopup.setText(BA.ObjectToCharSequence(\"\"));\n //BA.debugLineNum = 243;BA.debugLine=\"btnCerrarPopUp.TextSize = 30\";\nmostCurrent._btncerrarpopup.setTextSize((float) (30));\n //BA.debugLineNum = 244;BA.debugLine=\"btnCerrarPopUp.Color = Colors.ARGB(150,255,255,25\";\nmostCurrent._btncerrarpopup.setColor(anywheresoftware.b4a.keywords.Common.Colors.ARGB((int) (150),(int) (255),(int) (255),(int) (255)));\n //BA.debugLineNum = 245;BA.debugLine=\"btnCerrarPopUp.TextColor = Colors.ARGB(255,255,11\";\nmostCurrent._btncerrarpopup.setTextColor(anywheresoftware.b4a.keywords.Common.Colors.ARGB((int) (255),(int) (255),(int) (117),(int) (117)));\n //BA.debugLineNum = 246;BA.debugLine=\"panelPopUps_2.AddView(imgPopUp, 0%x, 0%y, 70%x, 7\";\nmostCurrent._panelpopups_2.AddView((android.view.View)(mostCurrent._imgpopup.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (70),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (70),mostCurrent.activityBA));\n //BA.debugLineNum = 247;BA.debugLine=\"panelPopUps_2.AddView(btnCerrarPopUp, 56%x, 0%y,\";\nmostCurrent._panelpopups_2.AddView((android.view.View)(mostCurrent._btncerrarpopup.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (56),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (50)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (50)));\n //BA.debugLineNum = 248;BA.debugLine=\"Activity.AddView(panelPopUps_2, 15%x, 15%y, 70%x,\";\nmostCurrent._activity.AddView((android.view.View)(mostCurrent._panelpopups_2.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (15),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (15),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (70),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (70),mostCurrent.activityBA));\n //BA.debugLineNum = 249;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "private void hitGraphic(GObject element) {\r\n\t\tfor(int i = 0; i < 10; i++) {\r\n\t\t\telement.setVisible(true);\r\n\t\t\tmoveGame();\r\n\t\t\telement.setVisible(false);\r\n\t\t\tmoveGame();\r\n\t\t\telement.setVisible(true);\r\n\t\t}\r\n\t}", "public finestrabenvinguda() {\n //inciem componets misatge ,la seva localitzacio, i diem que sigui un misatge que ens apareixi de manera temporal\n initComponents();\n this.setLocationRelativeTo(null);\n ac = new ActionListener() {\n\n @Override\n /**\n * Controlem la barra de carregue la cual li diem el que socceix una vegada\n * tenim el temps establert en el qual volem carreguar el nostre projecte,es a di,\n * que fara una vegada tenim carreguada completament la carregua de la taula\n */\n public void actionPerformed(ActionEvent e) {\n x = x + 1;\n jProgressBar1.setValue(x);\n if (jProgressBar1.getValue() == 100) {\n dispose();\n t.stop();\n }\n }\n };\n // seleccionem el temps que tardara aquesta barra en carregar completament\n t = new Timer(50, ac);\n t.start();\n }", "public void mostrar() {\n\t\t\n\t\tdibujarFondo();\n\t\tdibujarMarcador();\n\t\t\n\t\tScene escena = new Scene(panel, panel.getPrefWidth(), panel.getPrefHeight());\n\n\t\tescenario.setScene(escena);\n\t\tescenario.setResizable(false);\n\t\tescenario.setTitle(Aplicacion.TITULO);\n\t\t\n\t\tdibujar();\n\n\t\tescenario.show();\n\t}", "public void activarEscudo() {\n\t\tif(escudo) {\n\t\t\twidth = 40;\n\t\t\theight = 40;\n\t\t\tescudo = false;\n\t\t\tsetGrafico(0);\n\t\t}\n\t\telse {\n\t\t\tescudo = true;\n\t\t\twidth = 50;\n\t\t\theight = 50;\n\t\t\tsetGrafico(1);\n\t\t}\n\t}", "private void mostrarEmenta (){\n }", "private void generaVentana()\n {\n // Crea la ventana\n ventana = new JFrame(\"SpaceInvaders\");\n panel = (JPanel) ventana.getContentPane();\n \n // Establece el tamaño del panel\n panel.setPreferredSize(new Dimension(anchoVentana, altoVentana));\n\n // Establece el layout por defecto\n panel.setLayout(null);\n\n // Establece el fondo para el panel\n panel.setBackground(Color.black);\n\n // Establece el tamaño de Canvas y lo añade a la ventana\n setBounds(0,0,altoVentana,anchoVentana);\n panel.add(this);\n\n // Establece que el programa se cerrará cuando la ventana se cierre\n ventana.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n // Establece el tamaño de la ventana\n ventana.pack();\n\n // La ventana no se cambia de tamaño\n ventana.setResizable(false);\n\n // Centra la ventana en la pantalla\n ventana.setLocationRelativeTo(null);\n\n // Muestra la ventana\n ventana.setVisible(true);\n\n // Mantine el foco en la ventana\n requestFocusInWindow();\n }", "public void infoBase()\n {\n this.menu.setBackground(new java.awt.Color(179, 204, 204));\n this.menu.setOpaque(true);\n \n this.semaine.setBackground(new java.awt.Color(224, 235, 235));\n this.semaine.setOpaque(true);\n \n ImageIcon cours_icon = new ImageIcon(new ImageIcon(\"src/Icones/book.png\").getImage().getScaledInstance(20, 20, Image.SCALE_DEFAULT));\n mes_cours = new JButton(\"Cours\", cours_icon);\n this.iconFont(mes_cours);\n\n ImageIcon search_icon = new ImageIcon(new ImageIcon(\"src/Icones/search.png\").getImage().getScaledInstance(20, 20, Image.SCALE_DEFAULT));\n rechercher = new JButton(\"Rechercher\", search_icon);\n this.iconFont(rechercher);\n\n ImageIcon delete_icon = new ImageIcon(new ImageIcon(\"src/Icones/quit.png\").getImage().getScaledInstance(20, 20, Image.SCALE_DEFAULT));\n this.annule = new JButton(\"Cours annulé(s)\", delete_icon);\n this.iconFont(annule);\n\n ImageIcon report_icon = new ImageIcon(new ImageIcon(\"src/Icones/report.png\").getImage().getScaledInstance(20, 20, Image.SCALE_DEFAULT));\n this.report = new JButton(\"Reporting\", report_icon);\n this.iconFont(report);\n\n ImageIcon recap_icon = new ImageIcon(new ImageIcon(\"src/Icones/news-admin.png\").getImage().getScaledInstance(20, 20, Image.SCALE_DEFAULT));\n this.summary = new JButton(\"Récapitulatif des cours\", recap_icon);\n this.iconFont(summary);\n \n ImageIcon logout_icon = new ImageIcon(new ImageIcon(\"src/Icones/logout.png\").getImage().getScaledInstance(20, 20, Image.SCALE_DEFAULT));\n this.logout = new JButton(\"Se déconnecter\", logout_icon);\n this.iconFont(logout);\n \n ///Affiche le numéro de semaine\n Calendar cal = new GregorianCalendar();\n Date d = new Date();\n cal.setTime(d);\n\n this.num_semaine = cal.get(Calendar.WEEK_OF_YEAR); //Numéro de semaine actuel\n\n JLabel week = new JLabel(\"SEMAINE\");\n f = week.getFont();\n week.setFont(f.deriveFont(f.getStyle() | Font.BOLD));\n semaine.add(week);\n this.week_button = new ArrayList();\n \n //On ajoute les 52 boutons pour chaque numéro de semaine\n for (int i = 0; i < 52; i++) {\n week_button.add(new JButton(Integer.toString(i + 1))); //Dans la arrayList\n semaine.add(week_button.get(i)); //Dans la toolbar\n if (i == num_semaine) { //Si égal à la semaine actuelle\n week_button.get(i - 1).setBackground(Color.red);\n week_button.get(i - 1).setOpaque(true);\n }\n\n }\n JPanel toolbars = new JPanel(new GridLayout(0, 1));\n toolbars.add(menu);\n toolbars.add(semaine);\n\n this.add(toolbars, BorderLayout.NORTH);\n\n String mesInfos = \"HYPERPLANNING 2019-2020\";\n \n info = new JLabel(mesInfos, JLabel.CENTER);\n info.setPreferredSize(new Dimension(20,50));\n info.setBackground( new java.awt.Color(153, 230, 230));\n info.setOpaque(true);\n info.setFont(new Font(\"Verdana\", Font.PLAIN, 18));\n\n this.add(info, BorderLayout.SOUTH);\n\n this.add(panel);\n panel.setLayout(new OverlayLayout(panel));\n this.panel.setBackground(new java.awt.Color(112, 219, 219));\n this.panel.setOpaque(true);\n\n this.setVisible(true);\n }", "public void uruchomGre()\n\t{\n\t\tustawPojazdNaPoczatek();\n\t\tplanszaWidokHND.repaint();\n\t\twToku = true;\n\t\tzegar.start();\n\t\tpauza = false;\n\t}", "public void Circulo() {\r\n Circulo crc = new Circulo();\r\n crc.setBounds(0, 0, 765, 588);\r\n crc.setResizable(false);\r\n crc.setVisible(true);\r\n crc.setLocationRelativeTo(null);\r\n ImageIcon fig = new ImageIcon(\"src/images/figurative.png\");\r\n crc.setIconImage(fig.getImage());\r\n }", "public void accionCambios(int i){\r\n \r\n if(turno == 0){\r\n pokemon_activo1.setConfuso(false);\r\n pokemon_activo1.setDormido(false);\r\n this.pokemon_activo1 = this.getEquipo1()[i];\r\n ve.setVisible(false);\r\n vc.setjL_especie1(pokemon_activo1.getNombre_especie());\r\n vc.setjL_nombrepokemon1(pokemon_activo1.getPseudonimo());\r\n vc.setjL_vida_actual1(pokemon_activo1.getVida_restante(), pokemon_activo1.getVida());\r\n vc.setjL_Nivel1(pokemon_activo1.getNivel());\r\n vc.setjL_Turno_actual(entrenador2.getNombre());\r\n ve.setVisible(false);\r\n if(tipo_simulacion == 2){\r\n turnoSistema();\r\n }\r\n else{\r\n JOptionPane.showMessageDialog(this.vc, \"Turno\"+\" \"+entrenador2.getNombre(), \"Tu Turno\", JOptionPane.INFORMATION_MESSAGE);\r\n System.out.println(\"Turno\"+\" \"+entrenador2.getNombre());\r\n try {\r\n creg.guardarRegistroSimulacion(\"Turno\"+\" \"+entrenador2.getNombre());\r\n } catch (IOException ex) {\r\n Logger.getLogger(ControladorCombate.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n vc.turnoJugador2();\r\n this.turno = 1;\r\n }\r\n setLabelEstados(1);\r\n setLabelEstados(0);\r\n }\r\n else if(turno == 1){\r\n pokemon_activo2.setConfuso(false);\r\n pokemon_activo2.setDormido(false);\r\n this.pokemon_activo2 = this.getEquipo2()[i];\r\n ve.setVisible(false);\r\n vc.setjL_especie2(pokemon_activo2.getNombre_especie());\r\n vc.setjL_nombrepokemon2(pokemon_activo2.getPseudonimo());\r\n vc.setjL_vida_actual2(pokemon_activo2.getVida_restante(), pokemon_activo2.getVida());\r\n vc.setjL_Nivel2(pokemon_activo2.getNivel());\r\n vc.setjL_Turno_actual(entrenador1.getNombre());\r\n ve.setVisible(false);\r\n JOptionPane.showMessageDialog(this.vc, \"Turno\"+\" \"+entrenador1.getNombre(), \"Tu Turno\", JOptionPane.INFORMATION_MESSAGE);\r\n System.out.println(\"Turno\"+\" \"+entrenador1.getNombre());\r\n try {\r\n creg.guardarRegistroSimulacion(\"Turno\"+\" \"+entrenador1.getNombre());\r\n } catch (IOException ex) {\r\n Logger.getLogger(ControladorCombate.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n vc.turnoJugador1();\r\n this.turno = 0;\r\n setLabelEstados(1);\r\n setLabelEstados(0);\r\n }\r\n }", "public void display() {\n startPreview();\n }", "public Control(CuerpoCeleste universe) {\n initComponents();\n // Atributos de referencia\n this.universe = universe;\n \n // Atributos de la ventana\n setTitle (\"Control Window\");\n setLocation (820, 100);\n \n // Se construye y se abre la ventana de visualizacion\n Visualization visualizationWindow = new Visualization (universe.getCanvas(), this, false);\n visualizationWindow.setVisible(true);\n \n \n // Cuando se cierra esta ventana se llama al método encargado del cierre\n addWindowListener(new WindowAdapter() {\n @Override\n public void windowClosing(WindowEvent e) {\n exit (0);\n }\n });\n \n repaint();\n }", "public void atacar() {\n texture = new Texture(Gdx.files.internal(\"recursos/ataques.png\"));\n rectangle=new Rectangle(x,y,texture.getWidth(),texture.getHeight());\n tmp = TextureRegion.split(texture, texture.getWidth() / 4, texture.getHeight() / 4);\n switch (jugadorVista) {\n case \"Derecha\":\n for (int b = 0; b < regions.length; b++) {\n regions[b] = tmp[2][b];\n animation = new Animation((float) 0.1, regions);\n tiempo = 0f;\n }\n break;\n case \"Izquierda\":\n for (int b = 0; b < regions.length; b++) {\n regions[b] = tmp[3][b];\n animation = new Animation((float) 0.1, regions);\n tiempo = 0f;\n }\n break;\n case \"Abajo\":\n for (int b = 0; b < regions.length; b++) {\n regions[b] = tmp[0][b];\n animation = new Animation((float) 0.1, regions);\n tiempo = 0f;\n }\n break;\n case \"Arriba\":\n for (int b = 0; b < regions.length; b++) {\n regions[b] = tmp[1][b];\n animation = new Animation((float) 0.1, regions);\n tiempo = 0f;\n }\n break;\n }\n }", "private void plantarseMouseClicked(MouseEvent evt) {\n\t\t\tpedirCarta.setEnabled(false);\n\t\t\tplantarse.setEnabled(false);\n\t\t\tjugarOtraVez.setVisible(true);\n\t\t\tint jugJugador = Jugador.getJugador().sumaMano();\n\t\t\tBanca.getBanca().considerarJugada(jugJugador);\n\t\t\tCarta quitarOculta = Banca.getBanca().getCartaDeLaMano(0);\n\t\t\tbCarta1.setIcon(new ImageIcon(getClass().getResource(quitarOculta.devolverNamePng())));\n\t\t\t\n\t\t\tint tamMano = Banca.getBanca().tamanoMano();\n\t\t\tif (tamMano > 2){\n\t\t\t\tint aux = 2;\n\t\t\t\twhile (aux < tamMano){\n\t\t\t\t\tCarta cart2 = Banca.getBanca().getCartaDeLaMano(aux);\n\t\t\t\t\tif(aux == 2){\n\t\t\t\t\t\tbCarta3.setIcon(new ImageIcon(getClass().getResource(cart2.devolverNamePng())));\n\t\t\t\t\t}\n\t\t\t\t\telse if(aux == 3){\n\t\t\t\t\t\tbCarta4.setIcon(new ImageIcon(getClass().getResource(cart2.devolverNamePng())));\n\t\t\t\t\t}\n\t\t\t\t\telse if(aux==4){\n\t\t\t\t\t\tbCarta5.setIcon(new ImageIcon(getClass().getResource(cart2.devolverNamePng())));\n\t\t\t\t\t}\n\t\t\t\t\telse if(aux==5){\n\t\t\t\t\t\tbCarta6.setIcon(new ImageIcon(getClass().getResource(cart2.devolverNamePng())));\n\t\t\t\t\t}\n\t\t\t\t\telse if(aux==6){\n\t\t\t\t\t\tbCarta7.setIcon(new ImageIcon(getClass().getResource(cart2.devolverNamePng())));\n\t\t\t\t\t}\n\t\t\t\t\taux++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//se hace la comprobacion de quien ha ganado. Si gana el jugador se cobra la apuesta\n\t\t\tdouble dineroInicial = Jugador.getJugador().getDinero();\n\t\t\tJugador.getJugador().getApBlackjack().cobrarApuesta(jugJugador);\n\t\t\tdouble ganancia = Jugador.getJugador().getDinero()-dineroInicial;\n\t\t\tif(ganancia > 0){\n\t\t\t\tJOptionPane.showMessageDialog(null,\"HAS GANADO \"+((Jugador.getJugador().getDinero() - dineroInicial) / 2)+\" Û\", \"RESULTADO\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\tJugador.getJugador().realizarApuestaBlackJack(0);\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Has ganado \"+ (Jugador.getJugador().getDinero()-dineroInicial));\n\t\t\t}\n\t\t\telse{\n\t\t\t\tJOptionPane.showMessageDialog(null,\"HAS PERDIDO\", \"RESULTADO\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\tif(Jugador.getJugador().getDinero() <= 0){\n\t\t\t\t\tjugarOtraVez.setEnabled(false);\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"YA NO TE QUEDA DINERO\", \"AVISO\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void act(){\n if(mainMenu!=null){\n if((Greenfoot.mouseClicked(callMenu.getCallMenu()))) {\n Greenfoot.setWorld(mainMenu); \n }\n }\n if(pauseMenu!=null){\n if((Greenfoot.mouseClicked(callMenu.getCallMenu()))) {\n Greenfoot.setWorld(pauseMenu); \n }\n }\n if(choiceMenu!=null){\n if((Greenfoot.mouseClicked(callMenu.getCallMenu()))) {\n Greenfoot.setWorld(choiceMenu); \n }\n }\n if(actual == 1){\n prePage.setImage(new GreenfootImage(\"\", 0, null, null));\n nextPage.setImagine(\"sipka1\");\n if((Greenfoot.mouseClicked(nextPage.getLabel()))) {\n setBackground(\"images/manual2.png\");\n actual = 2;\n }\n }\n else if(actual == 2){\n nextPage.setImagine(\"sipka1\");\n prePage.setImagine(\"sipka0\");\n if((Greenfoot.mouseClicked(nextPage.getLabel()))) {\n setBackground(\"images/manual3.png\");\n actual = 3;\n }\n if((Greenfoot.mouseClicked(prePage.getLabel()))) {\n setBackground(\"images/manual1.png\");\n actual = 1;\n }\n }\n else if(actual == 3){\n nextPage.setImagine(\"sipka1\");\n if((Greenfoot.mouseClicked(nextPage.getLabel()))) {\n setBackground(\"images/manual4.png\");\n actual = 4;\n }\n if((Greenfoot.mouseClicked(prePage.getLabel()))) {\n setBackground(\"images/manual2.png\");\n actual = 2;\n }\n }\n else if(actual == 4){\n nextPage.setImagine(\"sipka1\");\n if((Greenfoot.mouseClicked(nextPage.getLabel()))) {\n setBackground(\"images/manual5.png\");\n actual = 5;\n }\n if((Greenfoot.mouseClicked(prePage.getLabel()))) {\n setBackground(\"images/manual3.png\");\n actual = 3;\n }\n }\n else if(actual == 5){\n nextPage.setImage(new GreenfootImage(\"\", 0, null, null));\n if((Greenfoot.mouseClicked(prePage.getLabel()))) {\n setBackground(\"images/manual4.png\");\n actual = 4;\n }\n }\n }", "public void stampa() {\n GridPane matrice = new GridPane();\n buildGriglia(matrice);\n Text scritta;\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n if (getElementAt(griglia, i, j).cerchio.isVisible()) {\n scritta = new Text(\"1\");\n }\n else {\n scritta = new Text(\"0\");\n }\n matrice.add(scritta, j, i);\n }\n }\n Scene scene3 = new Scene(matrice, N * 100, N * 100);\n Stage stage3 = new Stage();\n stage3.setTitle(\"Matrice di occupazione:\");\n stage3.setScene(scene3);\n stage3.show();\n }", "Lab refresh();", "private void displayResults() {\r\n\t\tGImage results;\r\n\t\tif(mehran == null ) {\r\n\t\t\tresults = new GImage(\"WinImage.png\");\r\n\t\t\tresults.scale(.7);\r\n\t\t} else {\r\n\t\t\tresults = new GImage(\"LoseImage.png\");\r\n\t\t\tresults.scale(1.5);\r\n\t\t}\r\n\t\tresults.setLocation((getWidth() - results.getWidth()) / 2.0, (getHeight() - results.getHeight()) / 2.0);\r\n\t\tadd(results);\r\n\t}", "public void voroDiagram() {\n\t\tPowerDiagram diagram = new PowerDiagram();\n\t\tdiagram.setSites(sites);\n\t\tdiagram.setClipPoly(clipPolygon);\n\t\tdiagram.computeDiagram();\n\t}", "ZHDraweeView mo91981h();", "@FXML\r\n private void mostrarSolicitudes() {\r\n try {\r\n //Carga la vista \r\n FXMLLoader loader = new FXMLLoader();\r\n loader.setLocation(Principal.class.getResource(\"/vista/MostrarRma.fxml\"));\r\n VBox vistaMostrar = (VBox) loader.load();\r\n\r\n //Crea un dialogo para mostrar la vista\r\n Stage dialogo = new Stage();\r\n dialogo.setTitle(\"Solicitudes enviadas\");\r\n dialogo.initModality(Modality.WINDOW_MODAL);\r\n dialogo.initOwner(primerStage);\r\n Scene escena = new Scene(vistaMostrar);\r\n dialogo.setScene(escena);\r\n\r\n //Annadir controlador y datos\r\n ControladorMostrarRma controlador = loader.getController();\r\n controlador.setDialogs(primerStage, dialogo);\r\n\r\n //Modifica el dialogo para que no se pueda cambiar el tamaño y lo muestra\r\n dialogo.setResizable(false);\r\n dialogo.showAndWait();\r\n\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "private void reiniciarVentana() {\n ventana.setVisible(false);\n ventana.setVisible(true);\n }", "public void showNet()\n/* */ {\n/* 482 */ update(getGraphics());\n/* */ }", "@Override\n\tpublic void EjecutaGui() {\n\t\tSystem.out.println(\"Ejecucion en ventana del ejercicio 2 del grupo 3\");\n\t}", "public static void setButton(String nameOfButton,int x,int y,int width,int heigth, JFrame frame) {\r\n //tozi metod suzdava butonut s negovite parametri - ime,koordinati,razmeri,frame\r\n\t JButton Button = new JButton(nameOfButton);\r\n\t Button.setBounds(x, y, width, heigth);\r\n\t colorOfButton(153,204,255,Button); //izpolzvam metodite ot po-gore\r\n\t colorOfTextInButton(60,0,150,Button);\r\n\t frame.getContentPane().add(Button);\r\n Button.addActionListener(new ActionListener(){ \r\n \tpublic void actionPerformed(ActionEvent e){ \r\n\t frame.setVisible(false);\r\n\t if(nameOfButton == \"Action\") { //kogato imeto na butona suvpada sus Stringa \"Action\",to tova e nashiqt janr\r\n\t \t Genre action = new Genre(\"Action\", //chrez klasa Genre zadavam vseki buton kakuv nov prozorec shte otvori\r\n\t \t\t\t \"Black Panther (2018)\", //kakvi filmi shte sudurja vseki janr \r\n\t \t\t\t \"Avengers: Endgame (2019)\",\r\n\t \t\t\t \" Mission: Impossible - Fallout (2018)\",\r\n\t \t\t\t \"Mad Max: Fury Road (2015)\",\r\n\t \t\t\t \"Spider-Man: Into the Spider-Verse (2018)\", \"MoviesWindow.png\" //kakvo fonovo izobrajenie shte ima\r\n);\r\n\t\t \t\r\n\t\t \taction.displayWindow(); \r\n//chrez metoda showWindow(); ,koito vseki obekt ot klasa Genre ima, otvarqme sledvashtiq(posleden) prozorec\r\n\t\t \t\r\n\t\t \t\r\n\t }else if (nameOfButton == \"Comedy\") { //i taka za vsichki filmovi janri\r\n\t \t Genre comedy = new Genre(\"Comedy\",\r\n\t \t\t\t \"The General (1926)\",\r\n\t \t\t\t \"It Happened One Night (1934)\",\r\n\t \t\t\t \"Bridesmaids (2011)\",\r\n\t \t\t\t \"Eighth Grade (2018)\",\r\n\t \t\t\t \"We're the Millers (2013)\",\"MoviesWindow.png\");\r\n\t\t \t\r\n\t\t \tcomedy.displayWindow();\r\n\t }else if (nameOfButton == \"Drama\") {\r\n\t \t Genre drama2 = new Genre(\"Drama\",\r\n\t \t\t\t \"Parasite (Gisaengchung) (2019)\",\r\n\t\t \t\t\t \" Moonlight (2016)\",\r\n\t\t \t\t\t \" A Star Is Born (2018)\",\r\n\t\t \t\t\t \" The Shape of Water (2017)\",\r\n\t\t \t\t\t \" Marriage Story (2019)\",\"MoviesWindow.png\");\r\n\t\t \t\r\n\t\t \tdrama2.displayWindow();\r\n\t }else if (nameOfButton == \"Fantasy\") {\r\n\t \t Genre fantasy2 = new Genre(\"Fantasy\",\r\n\t \t\t\t \"The Lord of the Rings Trilogy\",\r\n\t \t\t\t \"Metropolis (2016)\",\r\n\t \t\t\t \"Gravity (2013)\",\r\n\t \t\t\t \" Pan's Labyrinth (2006)\",\r\n\t \t\t\t \"The Shape of Water (2017)\",\"MoviesWindow.png\");\r\n\t\t \t\r\n\t\t \tfantasy2.displayWindow();\r\n\t }else if (nameOfButton == \"Horror\") {\r\n\t \t Genre horror = new Genre(\"Horror\",\r\n\t \t\t\t \" Host (2020)\",\r\n\t \t\t\t \" Saw (2004)\",\r\n\t \t\t\t \" The Birds (1963)\",\r\n\t \t\t\t \" Dawn of the Dead (1978)\",\r\n\t \t\t\t \" Shaun of the Dead (2004)\",\"MoviesWindow.png\");\r\n\t\t \t\r\n\t\t \thorror.displayWindow();\r\n\t }else if (nameOfButton == \"Romance\") {\r\n\t \tGenre romance2 = new Genre(\"Romance\",\r\n\t \t\t\t\"Titanic (1997)\",\r\n\t \t\t\t\"La La Land(2016)\",\r\n\t \t\t\t\"The Vow (2012)\",\r\n\t \t\t\t\"The Notebook (2004)\",\r\n\t \t\t\t\"Carol (2015)\",\"MoviesWindow.png\");\r\n\t \t\r\n\t \tromance2.displayWindow();\r\n\t \t\r\n\t \t\r\n\t \t\r\n\t }else if (nameOfButton == \"Mystery\") {\r\n\t \t Genre mystery = new Genre(\"Mystery\",\r\n\t \t\t\t \" Knives Out (2019)\",\r\n\t \t\t\t \" The Girl With the Dragon Tattoo (2011)\",\r\n\t \t\t\t \" Before I Go to Sleep (2014)\",\r\n\t \t\t\t \" Kiss the Girls (1997)\",\r\n\t \t\t\t \" The Girl on the Train (2016)\",\"MoviesWindow.png\"\r\n\t \t\t\t );\r\n\t\t \t\r\n\t\t \tmystery.displayWindow();\r\n\t }\r\n\r\n \t}\r\n });\r\n\t}", "private void setDisplay(Graph graph){\r\n\r\n if(currentGraph!=null) {\r\n resetHintButtons();\r\n int v=graph.getVertices();\r\n if(v<=10){\r\n Parameters.maxPushOf=30;\r\n }\r\n if(10<v&&v<=20){\r\n Parameters.maxPushOf=20;\r\n }\r\n if(20<v&&v<=30){\r\n Parameters.maxPushOf=10;\r\n }\r\n if(30<v&&v<=40){\r\n Parameters.maxPushOf=9;\r\n }\r\n if(v>40){\r\n Parameters.maxPushOf=8;\r\n }\r\n upper1Label.setText(\"\");\r\n upper2Label.setText(\"\");\r\n upper3Label.setText(\"\");\r\n\r\n if (timer != null) {\r\n timer.stop();\r\n }\r\n\t //for the second gamemode (fixed time):\r\n if (gamemode == 2) {\r\n double time = currentGraph.getVertices()*10;\r\n timing = (int) time;\r\n timer = new Timeline(new KeyFrame(Duration.seconds(1), event -> {\r\n timing--;\r\n upper3Label.setText(\"Time: \"+Double.toString(timing));\r\n }));\r\n\r\n timer.setCycleCount((int) time);\r\n timer.setOnFinished(event -> {\r\n timing = 0;\r\n timerUp();\r\n });\r\n timer.play();\r\n\r\n }\r\n clear();\r\n double myWidth = canvas.getWidth();\r\n double myHeight = canvas.getHeight();\r\n System.out.println(myWidth + \" \" + myHeight);\r\n ArrayList<Dot> list = graph.getList();\r\n Random random = new Random();\r\n for (int i = 0; i < list.size(); i++) {\r\n int x = random.nextInt((int) Math.round(myWidth / 4)) + (int) Math.round((myWidth / 2) - myWidth / 8);\r\n int y = random.nextInt((int) Math.round(myHeight / 4)) + (int) Math.round((myHeight / 2) - myHeight / 8);\r\n list.get(i).setPosition(new Position(x, y));\r\n list.get(i).setParent(this);\r\n if (gamemode == 3) {\r\n list.get(i).gameMode = 3;\r\n list.get(i).removeMain();\r\n }\r\n //list.get(i).setOnAction(graphHandeler);\r\n list.get(i).getStyleClass().add(\"graphButton\");\r\n pane.getChildren().add(list.get(i));\r\n }\r\n Timeline timeline = new Timeline(new KeyFrame(Duration.millis(1), ev -> {\r\n canvas.getGraphicsContext2D().clearRect(0, 0, canvas.getWidth(), canvas.getHeight());\r\n ArrayList<Position> positionArrayList = new ArrayList();\r\n for (int i = 0; i < list.size(); i++) {\r\n Dot d = list.remove(i);\r\n positionArrayList.add(d.calculateVectors(list, d.giveList(), canvas.getWidth(), canvas.getHeight()));\r\n list.add(i, d);\r\n }\r\n for (int i = 0; i < list.size(); i++) {\r\n list.get(i).setPosition(positionArrayList.get(i));\r\n }\r\n for (int i = 0; i < list.size(); i++) {\r\n printDot(list.get(i), true);\r\n printDot(list.get(i), false);\r\n }\r\n }));\r\n timeline.setCycleCount(Parameters.trys);\r\n timeline.play();\r\n if (gamemode == 3) {\r\n list.get(0).getChildren().add(list.get(0).hBox);\r\n\t\thintButtonClick(hintButton5);\r\n \thintButtonClick(hintButton7);\r\n }\r\n }\r\n\r\n }", "public void screenShot() {\n\n\t}", "public void visualizarDatos(View view) {\n Intent datos = new Intent(this, vistualiazrDatosTotales.class);\n datos.putExtra(\"id\", id);\n startActivity(datos);\n finish();\n }", "private void initSelectedAlgoVisuals()\r\n\t{\r\n\t String searchText = useKDTreeToSearch ? \"Using KDTree for Nearest Neighbour Search\" : \"Using Linear Search for Nearest Neighbour Search\";\r\n\t String hullText = useConcaveHull ? \"Using Concave Hull with digDecider=\"+ConcaveHull.decision : \"Using Convex Hull\";\r\n\t \r\n\t usedAlgorithms.addCodeLine(searchText, null, 0, null);\r\n\t usedAlgorithms.addCodeLine(hullText, null, 0, null);\r\n\t \r\n\t RectProperties rectProps = new RectProperties();\r\n\t rectProps.set(AnimationPropertiesKeys.FILLED_PROPERTY, true);\r\n\t rectProps.set(AnimationPropertiesKeys.FILL_PROPERTY, new Color(100, 200, 100));\r\n\t rectProps.set(AnimationPropertiesKeys.DEPTH_PROPERTY, 2);\r\n\t\tusingRect = lang.newRect(new Offset(-5, -5, \"usedAlgorithmsSourceCode\", AnimalScript.DIRECTION_NW), new Offset(10, 5, \"usedAlgorithmsSourceCode\", AnimalScript.DIRECTION_SE), \"usingInfoBackground\", null, rectProps);\r\n\t}", "public void mostrarGrafo() {\n\t\tmatriz.mostrarMatriz();\n\t}", "public void visualizarMensaje(Object pila);", "public static String _butpaso1_click() throws Exception{\nif (mostCurrent._imgmosquito.getVisible()==anywheresoftware.b4a.keywords.Common.True) { \n //BA.debugLineNum = 134;BA.debugLine=\"lblPaso4.Visible = False\";\nmostCurrent._lblpaso4.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 135;BA.debugLine=\"TimerAnimacion.Initialize(\\\"TimerAnimacion\\\", 10)\";\n_vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv5.Initialize(processBA,\"TimerAnimacion\",(long) (10));\n //BA.debugLineNum = 136;BA.debugLine=\"TimerAnimacion.Enabled = True\";\n_vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv5.setEnabled(anywheresoftware.b4a.keywords.Common.True);\n }else {\n //BA.debugLineNum = 138;BA.debugLine=\"imgMosquito1.Left = -60dip\";\nmostCurrent._imgmosquito1.setLeft((int) (-anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (60))));\n //BA.debugLineNum = 139;BA.debugLine=\"imgMosquito1.Top = 50dip\";\nmostCurrent._imgmosquito1.setTop(anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (50)));\n //BA.debugLineNum = 140;BA.debugLine=\"imgMosquito1.Visible = True\";\nmostCurrent._imgmosquito1.setVisible(anywheresoftware.b4a.keywords.Common.True);\n //BA.debugLineNum = 141;BA.debugLine=\"TimerAnimacionEntrada.Initialize(\\\"TimerAnimacion\";\n_vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv6.Initialize(processBA,\"TimerAnimacion_Entrada\",(long) (10));\n //BA.debugLineNum = 142;BA.debugLine=\"TimerAnimacionEntrada.Enabled = True\";\n_vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv6.setEnabled(anywheresoftware.b4a.keywords.Common.True);\n };\n //BA.debugLineNum = 149;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "public void display ( GameObject obj ) {\n Screen tempScreen = Screen.getScreen();\n\n // I could script this! Quickly change the colors\n\n tempScreen.fill(color); //set color\n\n\n tempScreen.noStroke(); //no stroke\n tempScreen.rect(obj.x, obj.y, obj.width, obj.height); //make a rectangle\n }", "public void vision()\n {\n NIVision.IMAQdxGrab(session, colorFrame, 1);\t\t\t\t\n RETRO_HUE_RANGE.minValue = (int)SmartDashboard.getNumber(\"Retro hue min\", RETRO_HUE_RANGE.minValue);\n\t\tRETRO_HUE_RANGE.maxValue = (int)SmartDashboard.getNumber(\"Retro hue max\", RETRO_HUE_RANGE.maxValue);\n\t\tRETRO_SAT_RANGE.minValue = (int)SmartDashboard.getNumber(\"Retro sat min\", RETRO_SAT_RANGE.minValue);\n\t\tRETRO_SAT_RANGE.maxValue = (int)SmartDashboard.getNumber(\"Retro sat max\", RETRO_SAT_RANGE.maxValue);\n\t\tRETRO_VAL_RANGE.minValue = (int)SmartDashboard.getNumber(\"Retro val min\", RETRO_VAL_RANGE.minValue);\n\t\tRETRO_VAL_RANGE.maxValue = (int)SmartDashboard.getNumber(\"Retro val max\", RETRO_VAL_RANGE.maxValue);\n\t\tAREA_MINIMUM = SmartDashboard.getNumber(\"Area min %\");\n\t\t//MIN_RECT_WIDTH = SmartDashboard.getNumber(\"Min Rect Width\", MIN_RECT_WIDTH);\n\t\t//MAX_RECT_WIDTH = SmartDashboard.getNumber(\"Max Rect Width\", MAX_RECT_WIDTH);\n\t\t//MIN_RECT_HEIGHT = SmartDashboard.getNumber(\"Min Rect Height\", MIN_RECT_HEIGHT);\n\t\t//MAX_RECT_HEIGHT= SmartDashboard.getNumber(\"Max Rect Height\", MAX_RECT_HEIGHT);\n\t\t\n\t\t//SCALE_RANGE.minValue = (int)SmartDashboard.getNumber(\"Scale Range Min\");\n\t\t//SCALE_RANGE.maxValue = (int)SmartDashboard.getNumber(\"Scale Range Max\");\n\t\t//MIN_MATCH_SCORE = (int)SmartDashboard.getNumber(\"Min Match Score\");\n //Look at the color frame for colors that fit the range. Colors that fit the range will be transposed as a 1 to the binary frame.\n\t\t\n\t\tNIVision.imaqColorThreshold(binaryFrame, colorFrame, 255, ColorMode.HSV, RETRO_HUE_RANGE, RETRO_SAT_RANGE, RETRO_VAL_RANGE);\n\t\t//Send the binary image to the cameraserver\n\t\tif(cameraView.getSelected() == BINARY)\n\t\t{\n\t\t\tCameraServer.getInstance().setImage(binaryFrame);\n\t\t}\n\n\t\tcriteria[0] = new NIVision.ParticleFilterCriteria2(NIVision.MeasurementType.MT_AREA_BY_IMAGE_AREA, AREA_MINIMUM, 100.0, 0, 0);\t\t\n\t\t\n NIVision.imaqParticleFilter4(binaryFrame, binaryFrame, criteria, filterOptions, null);\n\n // NIVision.RectangleDescriptor rectangleDescriptor = new NIVision.RectangleDescriptor(MIN_RECT_WIDTH, MAX_RECT_WIDTH, MIN_RECT_HEIGHT, MAX_RECT_HEIGHT);\n// \n// //I don't know\n// NIVision.CurveOptions curveOptions = new NIVision.CurveOptions(NIVision.ExtractionMode.NORMAL_IMAGE, 0, NIVision.EdgeFilterSize.NORMAL, 0, 1, 1, 100, 1,1);\n// NIVision.ShapeDetectionOptions shapeDetectionOptions = new NIVision.ShapeDetectionOptions(1, rectAngleRanges, SCALE_RANGE, MIN_MATCH_SCORE);\n// NIVision.ROI roi = NIVision.imaqCreateROI();\n//\n// NIVision.DetectRectanglesResult result = NIVision.imaqDetectRectangles(binaryFrame, rectangleDescriptor, curveOptions, shapeDetectionOptions, roi);\n// //Dummy rectangle to start\n// \n// NIVision.RectangleMatch bestMatch = new NIVision.RectangleMatch(new PointFloat[]{new PointFloat(0.0, 0.0)}, 0, 0, 0, 0);\n// \n// //Find the best matching rectangle\n// for(NIVision.RectangleMatch match : result.array)\n// {\n// \tif(match.score > bestMatch.score)\n// \t{\n// \t\tbestMatch = match;\n// \t}\n// }\n// SmartDashboard.putNumber(\"Rect height\", bestMatch.height);\n// SmartDashboard.putNumber(\"Rect Width\", bestMatch.width);\n// SmartDashboard.putNumber(\"Rect rotation\", bestMatch.rotation);\n// SmartDashboard.putNumber(\"Rect Score\", bestMatch.score);\n \n //Report how many particles there are\n\t\tint numParticles = NIVision.imaqCountParticles(binaryFrame, 1);\n\t\tSmartDashboard.putNumber(\"Masked particles\", numParticles);\n\t\t\n \n\t\tif(numParticles > 0)\n\t\t{\n\t\t\t//Measure particles and sort by particle size\n\t\t\tVector<ParticleReport> particles = new Vector<ParticleReport>();\n\t\t\tfor(int particleIndex = 0; particleIndex < numParticles; particleIndex++)\n\t\t\t{\n\t\t\t\tParticleReport par = new ParticleReport();\n\t\t\t\tpar.Area = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_AREA);\n\t\t\t\tpar.AreaByImageArea = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_AREA_BY_IMAGE_AREA);\n\t\t\t\tpar.BoundingRectTop = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_BOUNDING_RECT_TOP);\n\t\t\t\tpar.BoundingRectLeft = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_BOUNDING_RECT_LEFT);\n\t\t\t\tpar.BoundingRectHeight = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_BOUNDING_RECT_HEIGHT);\n\t\t\t\tpar.BoundingRectWidth = NIVision.imaqMeasureParticle(binaryFrame, particleIndex, 0, NIVision.MeasurementType.MT_BOUNDING_RECT_WIDTH);\n\t\t\t\tparticles.add(par);\n\n\t\t\t}\n\t\t\tparticles.sort(null);\n\n\t\t\t//This example only scores the largest particle. Extending to score all particles and choosing the desired one is left as an exercise\n\t\t\t//for the reader. Note that this scores and reports information about a single particle (single L shaped target). To get accurate information \n\t\t\t//about the location of the tote (not just the distance) you will need to correlate two adjacent targets in order to find the true center of the tote.\n//\t\t\tscores.Aspect = AspectScore(particles.elementAt(0));\n//\t\t\tSmartDashboard.putNumber(\"Aspect\", scores.Aspect);\n//\t\t\tscores.Area = AreaScore(particles.elementAt(0));\n//\t\t\tSmartDashboard.putNumber(\"Area\", scores.Area);\n//\t\t\tboolean isTote = scores.Aspect > SCORE_MIN && scores.Area > SCORE_MIN;\n//\n\t\t\tParticleReport bestParticle = particles.elementAt(0);\n\t\t NIVision.Rect particleRect = new NIVision.Rect((int)bestParticle.BoundingRectTop, (int)bestParticle.BoundingRectLeft, (int)bestParticle.BoundingRectHeight, (int)bestParticle.BoundingRectWidth);\n\t\t \n\t\t //NIVision.imaqOverlayRect(colorFrame, particleRect, new NIVision.RGBValue(0, 0, 0, 255), DrawMode.PAINT_VALUE, \"a\");//;(colorFrame, colorFrame, particleRect, DrawMode.DRAW_VALUE, ShapeMode.SHAPE_OVAL, 20);\n\t\t NIVision.imaqDrawShapeOnImage(colorFrame, colorFrame, particleRect, NIVision.DrawMode.DRAW_VALUE, ShapeMode.SHAPE_RECT, 0.0f);\n\t\t SmartDashboard.putNumber(\"Rect Top\", bestParticle.BoundingRectTop);\n\t\t SmartDashboard.putNumber(\"Rect Left\", bestParticle.BoundingRectLeft);\n\t\t SmartDashboard.putNumber(\"Rect Width\", bestParticle.BoundingRectWidth);\n\t\t SmartDashboard.putNumber(\"Area by image area\", bestParticle.AreaByImageArea);\n\t\t SmartDashboard.putNumber(\"Area\", bestParticle.Area);\n\t\t double bestParticleMidpoint = bestParticle.BoundingRectLeft + bestParticle.BoundingRectWidth/2.0;\n\t\t double bestParticleMidpointAimingCoordnates = pixelCoordnateToAimingCoordnate(bestParticleMidpoint, CAMERA_RESOLUTION_X);\n\t\t angleToTarget = aimingCoordnateToAngle(bestParticleMidpointAimingCoordnates, VIEW_ANGLE);\n\t\t \n\t\t}\n\t\telse\n\t\t{\n\t\t\tangleToTarget = 0.0;\n\t\t}\n\n if(cameraView.getSelected() == COLOR)\n {\n \tCameraServer.getInstance().setImage(colorFrame);\n }\n\t SmartDashboard.putNumber(\"Angle to target\", angleToTarget);\n\n }", "protected void actionPerformed(GuiButton par1GuiButton)\n {\n if (par1GuiButton.id == 0)\n {\n this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));\n }\n\n if (par1GuiButton.id == 5)\n {\n this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings));\n }\n\n if (par1GuiButton.id == 1)\n {\n this.mc.displayGuiScreen(new GuiSelectWorld(this));\n }\n\n if (par1GuiButton.id == 2)\n {\n this.mc.displayGuiScreen(new GuiMultiplayer(this));\n }\n\n if (par1GuiButton.id == 3)\n {\n this.mc.displayGuiScreen(new GuiTexturePacks(this));\n }\n\n if (par1GuiButton.id == 4)\n {\n this.mc.shutdown();\n }\n }", "private void treinRepaint()\r\n {\r\n if(treinaantal != 0){\r\n for(int i =0; i < treinaantal; i++){\r\n int[] id = {treinlijst[i].getId()};\r\n int[] arg = {treinlijst[i].getPositie()};\r\n main.updateGui(\"trein\", id, arg);\r\n }\r\n }\r\n }", "private void renderObjetos()\n {\n for (int i=0;i<NCONSUMIBLES;i++)\n {\n //EDIT:Ruta de Inventario\n Consumible consumible=(Consumible)VenganzaBelial.atributoGestion.getInv().getItems().get(i);\n if(eleccionJugador==i)\n {\n opcionesJugadorTTF.drawString(10,i*20+400,consumible.getNombre()+\" \"+consumible.getNumero()+\"/10\");\n }\n else{\n opcionesJugadorTTF.drawString(10, i * 20 + 400, consumible.getNombre()+\" \"+consumible.getNumero()+\"/10\", notChosen);\n }\n }\n }", "public void updateVisibility(Camera cam) {\n int i = 0;\n \n for(WE_Face face : listaDeFaces){\n WE_Aresta arestaFace = face.getArestaDaFace();\n \n Vertice third = null;\n searchForAnyArestaParaEsquerda:\n for (WE_Aresta aresta : listaDeArestas){\n if (!aresta.equals(arestaFace)){\n if (face.ID == aresta.getFaceEsquerda().ID){\n third = aresta.getvFinal();\n break searchForAnyArestaParaEsquerda;\n } else if (face.ID == aresta.getFaceDireita().ID){\n third = aresta.getvInicial();\n break searchForAnyArestaParaEsquerda;\n }\n }\n }\n \n Vertice normal = VMath.obterNormal(arestaFace.getvFinal(), arestaFace.getvInicial(), third);\n VMath.normalizar(normal);\n double mult = VMath.produtoEscalar(cam.getVetorN(), normal);\n System.out.println(\"Normal: \" + normal + \" Mult: \" + mult);\n visibilidade_faces[i] = mult > 0; //Se mult>0, face[i] é visível\n i++;\n }\n throw new UnsupportedOperationException(\"This doesn't work and programmer should feel bad. :(\");\n //<editor-fold defaultstate=\"collapsed\" desc=\"Testes que não funcionaram\">\n /*System.out.println(\"Lista vertices: \" + listaDeVertices);\n System.out.println(\"Lista arestas: \" + listaDeArestas);\n System.out.println(\"Lista faces: \" + listaDeFaces);\n\n for (WE_Face face : listaDeFaces){\n WE_Aresta arestaFace = face.getArestaDaFace();\n System.out.println(\"ARESTA FACE: \" + arestaFace);\n WE_Aresta next;\n Vertice third;\n if (arestaFace.getFaceEsquerda().ID == face.ID){\n next = arestaFace.getEsquerdaPredecessora();\n } else {\n next = arestaFace.getDireitaSucessora();\n }\n\n if (next.getvInicial().equals(arestaFace.getvInicial())\n ||next.getvInicial().equals(arestaFace.getvFinal ()))\n third = next.getvFinal();\n else\n third = next.getvInicial();\n\n System.out.println(\"POINTS (\" + face.ID + \"): \");\n System.out.println(\"One: \" + arestaFace.getvFinal());\n System.out.println(\"Two: \" + arestaFace.getvInicial());\n System.out.println(\"Thr: \" + third);\n\n Vertice normal = VMath.obterNormal(arestaFace.getvFinal(), arestaFace.getvInicial(), third);\n VMath.normalizar(normal);\n double mult = VMath.produtoEscalar(cam.getVetorN(), normal);\n System.out.println(\"Normal: \" + normal + \" Mult: \" + mult);\n visibilidade_faces[i] = mult > 0; //Se mult>0, face[i] é visível\n\n i++;\n }*/\n\n /*for (WE_Face face : listaDeFaces){\n WE_Aresta arestaFace = null;\n\n searchForAnyArestaParaEsquerda:\n for (WE_Aresta aresta : listaDeArestas){\n if (face.ID == aresta.getFaceEsquerda().ID){\n arestaFace = aresta;\n break searchForAnyArestaParaEsquerda;\n }\n }\n\n Vertice one = arestaFace.getvInicial();\n Vertice two = arestaFace.getvFinal();\n Vertice three;\n\n arestaFace = arestaFace.getEsquerdaSucessora();\n if (arestaFace.getvInicial().equals(two)){\n three = arestaFace.getvFinal();\n } else {\n three = arestaFace.getvInicial();\n }\n\n Vertice normal = VMath.obterNormal(two, one, three);\n VMath.normalizar(normal);\n double mult = VMath.produtoEscalar(cam.getVetorN(), normal);\n System.out.println(\"Normal: \" + normal + \" Mult: \" + mult);\n visibilidade_faces[i] = mult > 0; //Se mult>0, face[i] é visível\n }*/\n //</editor-fold>\n }", "public void iniciarPartida() {\n\t\tJuego juegoActual = controladorJuego.getJuego();\n\t\t// Recuperamos Tablero de juego para obtener las dimensiones\n\t\tTablero tableroActual = juegoActual.getTablero();\n\n\t\t// Creamos el layout para introducir la matriz con las casillas\n\t\tthis.setLayout(new BorderLayout());\n\t\tpaneltablero = new JPanel(new GridLayout(tableroActual.getNumFilas(), tableroActual.getNumCols()));\n\t\tthis.add(paneltablero);\n\n\t\t// Creamos la matriz de JButton que nos permetira interacctuar\n\t\ttablero = new JButton[tableroActual.getNumFilas()][tableroActual.getNumCols()];\n\t\tfor (int x = 0; x < tableroActual.getNumFilas(); x++) {\n\t\t\tfor (int y = 0; y < tableroActual.getNumCols(); y++) {\n\t\t\t\ttablero[x][y] = new JButton();\n\t\t\t\ttablero[x][y].setName(\"Casilla\");\n\t\t\t\ttablero[x][y].setPreferredSize(new Dimension(32, 32));\n\t\t\t\ttablero[x][y].addMouseListener((MouseListener) this.getControladorJuego());\n\t\t\t\tpaneltablero.add(tablero[x][y]);\n\t\t\t}\n\t\t}\n\t\t\n\t\tbarraMenu();\n\n\t\tventana.setContentPane(this);\n\t\tventana.setResizable(false);\n\t\tventana.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tventana.pack();\n\t\tventana.setVisible(true);\n\t}", "public abstract void executeFightButton();", "public void actionsTouches () {\n\t\t//Gestion des deplacements du mineur si demande\n\t\tif (Partie.touche == 'g' || Partie.touche == 'd' || Partie.touche == 'h' || Partie.touche == 'b') deplacements();\n\n\t\t//Affichage du labyrinthe et des instructions, puis attente de consignes clavier.\n\t\tpartie.affichageLabyrinthe();\n\n\t\t//Quitte la partie si demande.\n\t\tif (Partie.touche == 'q') partie.quitter();\n\n\t\t//Trouve et affiche une solution si demande.\n\t\tif (Partie.touche == 's') affichageSolution();\n\n\t\t//Recommence la partie si demande.\n\t\tif (Partie.touche == 'r') {\n\t\t\tgrille.removeAll();\n\t\t\tpartie.initialisation();\n\t\t}\n\n\t\t//Affichage de l'aide si demande\n\t\tif (Partie.touche == 'a') {\n\t\t\tString texteAide = new String();\n\t\t\tswitch(themeJeu) {\n\t\t\tcase 2 : texteAide = \"Le but du jeu est d'aider Link à trouver la sortie du donjon tout en récupérant le(s) coffre(s).\\n Link doit egalement recuperer la Master Sword qui permet de tuer le monstre bloquant le chemin.\\n\\nLink se déplace à l'aide des touches directionnelles.\\nUne solution peut-être affichée en appuyant sur la touche (s).\\nLa touche (r) permet de recommencer, (q) de quitter.\\n\\n Bon jeu !\"; break;\n\t\t\tcase 3 : texteAide = \"Le but du jeu est d'aider Samus à trouver la sortie du vaisseau tout en récupérant le(s) émeraude(s).\\nSamus doit egalement recuperer la bombe qui permet de tuer le metroid qui bloque l'accès à la sortie.\\n\\nSamus se déplace à l'aide des touches directionnelles.\\nUne solution peut-être affichée en appuyant sur la touche (s).\\nLa touche (r) permet de recommencer, (q) de quitter.\\n\\n Bon jeu !\"; break;\n\t\t\tcase 4 : texteAide = \"Le but du jeu est d'aider le pompier à trouver la sortie du batiment tout en sauvant le(s) rescapé(s).\\nLe pompier doit egalement recuperer l'extincteur qui permet d'éteindre le feu qui bloque l'accès à la sortie.\\n\\nLe pompier se déplace à l'aide des touches directionnelles.\\nUne solution peut-être affichée en appuyant sur la touche (s).\\nLa touche (r) permet de recommencer, (q) de quitter.\\n\\n Bon jeu !\"; break;\n\t\t\tcase 5 : texteAide = \"Le but du jeu est d'aider Mario à trouver le drapeau de sortie tout en ramassant le(s) pièce(s).\\nMario doit egalement recuperer l'étoile d'invincibilité qui permet de se débarasser du Goomba qui l'empêche de sortir.\\n\\nMario se déplace à l'aide des touches directionnelles.\\nUne solution peut-être affichée en appuyant sur la touche (s).\\nLa touche (r) permet de recommencer, (q) de quitter.\\n\\n Here we gooo !\"; break;\n\t\t\tdefault : texteAide = \"Le but du jeu est d'aider le mineur à trouver la sortie du labyrinthe tout en extrayant le(s) filon(s).\\nLe mineur doit egalement recuperer la clef qui permet l'ouverture de le porte qui bloque l'accès à la sortie.\\n\\nLe mineur se déplace à l'aide des touches directionnelles.\\nUne solution peut-être affichée en appuyant sur la touche (s).\\nLa touche (r) permet de recommencer, (q) de quitter.\\n\\n Bon jeu !\"; break;\n\t\t\t}\n\t\t\tSystem.out.println(\"\\n============================================ AIDE ========================================\\n\\n\" + texteAide + \"\\n\\n==========================================================================================\\n\");\n\t\t\tJOptionPane.showMessageDialog(null, texteAide, \"Aide\", JOptionPane.QUESTION_MESSAGE);\n\t\t\tPartie.touche = ' ';\n\t\t}\n\n\t\t//Affichage de les infos si demande\n\t\tif (Partie.touche == 'i') {\n\t\t\tSystem.out.println(\"\\n============================================ INFOS =======================================\\n\\nCe jeu a ete developpe par Francois ADAM et Benjamin Rancinangue\\ndans le cadre du projet IPIPIP 2015.\\n\\n==========================================================================================\\n\");\n\t\t\tPartie.touche = ' ';\n\t\t\tJOptionPane.showMessageDialog(null, \"Ce jeu a été développé par François Adam et Benjamin Rancinangue\\ndans le cadre du projet IPIPIP 2015.\", \"Infos\", JOptionPane.INFORMATION_MESSAGE, new ImageIcon(getClass().getResource(\"/images/EMN.png\")));\n\t\t}\n\n\t\t//Nettoyage de l'ecran de console\n\t\tSystem.out.println(\"\\n==========================================================================================\\n\");\n\t}", "private GUIAltaHabitacion() {\r\n\t initComponents();\r\n\t }", "private void renderGuiExtraLive (SpriteBatch batch)\n\t{\n\t\t//float x = cameraGUI.viewportWidth - 50 -\n\t\t//\t\tConstants.LIVES_START * 50;\n\t\t//float y = -15;\n\t\t//for (int i = 0; i < Constants.LIVES_START; i++)\n\t\t//{\n\t\t//\tif (worldController.lives <= i)\n\t\t//\t\tbatch.setColor(0.5f, 0.5f, 0.5f, 0.5f);\n\t\t//\tbatch.draw(Assets.instance.bird.character, \n\t\t//\t\t\tx + i * 50, y, 50, 50, 120, 100, 0.35f, -0.35f, 0);\n\t\t//\tbatch.setColor(1, 1, 1, 1);\n\t\t//}\n\t\t\n\t\tfloat x = cameraGUI.viewportWidth - 50 -\n\t\t\t\t1 * 50;\n\t\tfloat y = -15;\n\t\tfor (int i = 0; i < 1; i++)//Constants.LIVES_START; i++)\n\t\t{\n\t\t\tif (worldController.lives <= i)\n\t\t\t\tbatch.setColor(0.5f, 0.5f, 0.5f, 0.5f);\n\t\t\tbatch.draw(Assets.instance.bird.character, \n\t\t\t\t\tx + i * 50, y, 50, 50, 120, 100, 0.35f, -0.35f, 0);\n\t\t\tbatch.setColor(1, 1, 1, 1);\n\t\t}\n\t\tif (worldController.lives>= 0 &&worldController.livesVisual>worldController.lives) \n\t\t{ \n\t\t\t\n\t\t\tint i = worldController.lives;\n\t\t float alphaColor = Math.max(0, worldController.livesVisual- worldController.lives - 0.5f);\n\t\t float alphaScale = 0.35f * (2 + worldController.lives - worldController.livesVisual) * 2;\n\t\t float alphaRotate = -45 * alphaColor;\n\t\t batch.setColor(1.0f, 0.7f, 0.7f, alphaColor);\n\t\t batch.draw(Assets.instance.bird.character, x + i * 50, y, 50, 50, 120, 100, alphaScale, -alphaScale,alphaRotate);\n\t\t batch.setColor(1, 1, 1, 1);\n\t\t }\n\t}", "public void bulleVerte() {\r\n\t\tIcon icon = null;\r\n\t\ticon = new ImageIcon(\"../_Images/Bouton/bulle_verte.png\");\r\n\t\tif (icon != null)\r\n\t\t\tbulleAide.setIcon(icon);\r\n\t}", "public VistaGraficaQytetet() {\n ArrayList <String> nombres = obtenerNombreJugadores();\n modelo = Qytetet.getInstance();\n controlador = ControladorQytetet.getInstance(nombres);\n initComponents();\n creaMenuOperacion();\n creaMenuCasilla();\n update();\n }", "public void deplacements () {\n\t\t//Efface de la fenetre le mineur\n\t\t((JLabel)grille.getComponents()[this.laby.getMineur().getY()*this.laby.getLargeur()+this.laby.getMineur().getX()]).setIcon(this.laby.getLabyrinthe()[this.laby.getMineur().getY()][this.laby.getMineur().getX()].imageCase(themeJeu));\n\t\t//Deplace et affiche le mineur suivant la touche pressee\n\t\tpartie.laby.deplacerMineur(Partie.touche);\n\t\tPartie.touche = ' ';\n\n\t\t//Operations effectuees si la case ou se trouve le mineur est une sortie\n\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Sortie) {\n\t\t\t//On verifie en premier lieu que tous les filons ont ete extraits\n\t\t\tboolean tousExtraits = true;\t\t\t\t\t\t\t\n\t\t\tfor (int i = 0 ; i < partie.laby.getHauteur() && tousExtraits == true ; i++) {\n\t\t\t\tfor (int j = 0 ; j < partie.laby.getLargeur() && tousExtraits == true ; j++) {\n\t\t\t\t\tif (partie.laby.getLabyrinthe()[i][j] instanceof Filon) {\n\t\t\t\t\t\ttousExtraits = ((Filon)partie.laby.getLabyrinthe()[i][j]).getExtrait();\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Si c'est le cas alors la partie est terminee et le joueur peut recommencer ou quitter, sinon le joueur est averti qu'il n'a pas recupere tous les filons\n\t\t\tif (tousExtraits == true) {\n\t\t\t\tpartie.affichageLabyrinthe ();\n\t\t\t\tSystem.out.println(\"\\nFelicitations, vous avez trouvé la sortie, ainsi que tous les filons en \" + partie.laby.getNbCoups() + \" coups !\\n\\nQue voulez-vous faire à present : [r]ecommencer ou [q]uitter ?\");\n\t\t\t\tString[] choixPossiblesFin = {\"Quitter\", \"Recommencer\"};\n\t\t\t\tint choixFin = JOptionPane.showOptionDialog(null, \"Felicitations, vous avez trouve la sortie, ainsi que tous les filons en \" + partie.laby.getNbCoups() + \" coups !\\n\\nQue voulez-vous faire a present :\", \"Fin de la partie\", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, choixPossiblesFin, choixPossiblesFin[0]);\n\t\t\t\tif ( choixFin == 1) {\n\t\t\t\t\tPartie.touche = 'r';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tPartie.touche = 'q';\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpartie.enTete.setText(\"Tous les filons n'ont pas ete extraits !\");\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t//Si la case ou se trouve le mineur est un filon qui n'est pas extrait, alors ce dernier est extrait.\n\t\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Filon && ((Filon)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).getExtrait() == false) {\n\t\t\t\t((Filon)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).setExtrait();\n\t\t\t\tSystem.out.println(\"\\nFilon extrait !\");\n\t\t\t}\n\t\t\t//Sinon si la case ou se trouve le mineur est une clef, alors on indique que la clef est ramassee, puis on cherche la porte et on l'efface de la fenetre, avant de rendre la case quelle occupe vide\n\t\t\telse {\n\t\t\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Clef && ((Clef)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).getRamassee() == false) {\n\t\t\t\t\t((Clef)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).setRamassee();\n\t\t\t\t\tint[] coordsPorte = {-1,-1};\n\t\t\t\t\tfor (int i = 0 ; i < this.laby.getHauteur() && coordsPorte[1] == -1 ; i++) {\n\t\t\t\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() && coordsPorte[1] == -1 ; j++) {\n\t\t\t\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Porte) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcoordsPorte[0] = j;\n\t\t\t\t\t\t\t\tcoordsPorte[1] = i;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpartie.laby.getLabyrinthe()[coordsPorte[1]][coordsPorte[0]].setEtat(true);\n\t\t\t\t\t((JLabel)grille.getComponents()[coordsPorte[1]*this.laby.getLargeur()+coordsPorte[0]]).setIcon(this.laby.getLabyrinthe()[coordsPorte[1]][coordsPorte[0]].imageCase(themeJeu));\n\t\t\t\t\tSystem.out.println(\"\\nClef ramassee !\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void previsualizar(CtrlVista CV) {\n\t\tCV.cargarParaVerTablero(list.getSelectedValue());\n\t\tsetPrevisualizarTablero(CV,CV.getMapaActual());\n\t}", "public void activar(){\n\n }", "private void btnFarmaciasActionPerformed(java.awt.event.ActionEvent evt) {\n ControlaInstancia(objF);\n\n }", "private void render()\n {\n //Applicazione di un buffer \"davanti\" alla tela grafica. Prima di disegnare \n //sulla tela grafica il programma disegnerà i nostri oggetti grafici sul buffer \n //che, in seguito, andrà a disegnare i nostri oggetti grafici sulla tela\n bufferStrategico = display.getTelaGrafica().getBufferStrategy();\n \n //Se il buffer è vuoto (== null) vengono creati 3 buffer \"strategici\"\n if(bufferStrategico == null)\n {\n display.getTelaGrafica().createBufferStrategy(3);\n return;\n }\n \n //Viene definito l'oggetto \"disegnatore\" di tipo Graphic che disegnerà i\n //nostri oggetti grafici sui nostri buffer. Può disegnare qualsiasi forma\n //geometrica\n disegnatore = bufferStrategico.getDrawGraphics();\n \n //La riga seguente pulisce lo schermo\n disegnatore.clearRect(0, 0, larghezza, altezza);\n \n //Comando per cambiare colore dell'oggetto \"disegnatore\". Qualsiasi cosa\n //disengata dal disegnatore dopo questo comando avrà questo colore.\n \n /*disegnatore.setColor(Color.orange);*/\n \n //Viene disegnato un rettangolo ripieno. Le prime due cifre indicano la posizione \n //da cui il nostro disegnatore dovrà iniziare a disegnare il rettangolo\n //mentre le altre due cifre indicano le dimensioni del rettangolo\n \n /*disegnatore.fillRect(10, 50, 50, 70);*/\n \n //Viene disegnato un rettangolo vuoto. I parametri hanno gli stessi valori\n //del comando \"fillRect()\"\n \n /*disegnatore.setColor(Color.blue);\n disegnatore.drawRect(0,0,10,10);*/\n \n //I comandi seguenti disegnano un cerchio seguendo la stessa logica dei\n //rettangoli, di colore verde\n \n /*disegnatore.setColor(Color.green);\n disegnatore.fillOval(50, 10, 50, 50);*/\n \n /*Utilizziamo il disegnatore per caricare un'immagine. Il primo parametro\n del comando è l'immagine stessa, il secondo e il terzo parametro sono \n le coordinate dell'immagine (x,y) mentre l'ultimo parametro è l'osservatore\n dell'immagine (utilizzo ignoto, verrà impostato a \"null\" in quanto non\n viene usato)*/\n //disegnatore.drawImage(testImmagine,10,10,null);\n \n /*Comando che disegna uno dei nostri sprite attraverso la classe \"FoglioSprite\".*/\n //disegnatore.drawImage(foglio.taglio(32, 0, 32, 32), 10, 10,null);\n \n /*Viene disegnato un albero dalla classe \"Risorse\" attraverso il disegnatore.*/\n //disegnatore.drawImage(Risorse.omino, x, y,null);\n \n /*Se lo stato di gioco esiste eseguiamo la sua renderizzazione.*/\n if(Stato.getStato() != null)\n {\n \t Stato.getStato().renderizzazione(disegnatore);\n }\n \n //Viene mostrato il rettangolo\n bufferStrategico.show();\n disegnatore.dispose();\n }", "public void toutDessiner(Graphics g);", "public void recallPaint() { advw.showResearchersPanel();}", "private void moverCamionetas() {\n for (Camioneta cam : arrEnemigosCamioneta) {\n cam.render(batch);\n\n cam.moverIzquierda();\n }\n }", "@SuppressWarnings(\"LeakingThisInConstructor\")\r\n public OperationViewer(CollectorGUI gui) {\r\n WindowsStyle ws = new WindowsStyle();\r\n FrameIcons ic = new FrameIcons();\r\n ws.SetStyle();\r\n ic.SetIcon();\r\n this.setIconImages(ic.GetIcon());\r\n initComponents();\r\n this.setLocationRelativeTo(null);\r\n operaciones = \"\";\r\n this.gui = gui;\r\n exit = false;\r\n }", "public void mostrarCompra() {\n }", "public void run() {\n\t\t\t\tVerticalPanel panelCompteRendu = new VerticalPanel();\r\n\t\t\t\thtmlCompteRendu = new HTML();\r\n\t\t\t\tpanelCompteRendu.add(htmlCompteRendu);\r\n\t\t\t\tRootPanel.get(\"compteRendu\").add(panelCompteRendu);\r\n\t\t\t\t\r\n\t\t\t\tVerticalPanel panelLegende = new VerticalPanel();\r\n\t\t\t\thtmlLegende = new HTML();\r\n\t\t\t\tpanelLegende.add(htmlLegende);\r\n\t\t\t\tRootPanel.get(\"legende\").add(htmlLegende);\r\n\t\t\t\t\r\n\t\t\t\t// temps d'intˇgration restant\r\n\t\t\t\tLabel tempsDIntegrationRestant = new Label();\r\n\t\t\t\tRootPanel.get(\"tempsDIntegrationRestant\").add(tempsDIntegrationRestant);\r\n\t\t\t\t\r\n\t\t\t\t// ajout de la carte\r\n\t\t\t\twMap = new MapFaWidget2(htmlCompteRendu);\r\n\t\t\t\tRootPanel.get(\"carte\").add(wMap);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// ajout du bouton reset\r\n\t\t\t\tButton boutonReset = new Button(\"Nettoyer la carte\");\r\n\t\t\t\tboutonReset.addClickHandler(actionBoutonReset());\r\n\t\t\t\tRootPanel.get(\"boutonReset\").add(boutonReset);\r\n\r\n\t\t\t\t// ajout du formulaire d'intˇgration\r\n\t\t\t\tnew FileUploadView(wMap,htmlLegende, htmlCompteRendu,tempsDIntegrationRestant);\r\n\r\n\t\t\t}", "@SuppressWarnings(\"unused\")\r\n private void drawPicture() {\r\n // initialize variables\r\n Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();\r\n BufferedImage screenShot = null;\r\n\r\n // create screenshot\r\n Rectangle screenShotRect = new Rectangle(0, 0, dimension.width, dimension.height);\r\n try {\r\n screenShot = new Robot().createScreenCapture(screenShotRect);\r\n } catch (AWTException e1) {\r\n e1.printStackTrace();\r\n return;\r\n }\r\n File file = new File(\"tmp/warp_V3_\" + System.currentTimeMillis() + \".png\");\r\n\r\n try {\r\n // create screenshot graphic\r\n Graphics2D graphic = screenShot.createGraphics();\r\n graphic.setFont(graphic.getFont().deriveFont(5));\r\n\r\n // visualize fixation point\r\n graphic.setColor(new Color(255, 0, 0, 255));\r\n graphic.drawOval(this.fixation.x - 5, this.fixation.y - 5, 10, 10);\r\n graphic.drawChars((\"fixation point\").toCharArray(), 0, 14, 12 + this.fixation.x, 12 + this.fixation.y);\r\n graphic.drawChars((\"\" + this.angleStartEnd).toCharArray(), 0, (\"\" + this.angleStartEnd).toCharArray().length, 12 + this.fixation.x, 24 + this.fixation.y);\r\n graphic.setColor(new Color(255, 0, 0, 32));\r\n graphic.fillOval(this.fixation.x - 5, this.fixation.y - 5, 10, 10);\r\n\r\n // visualize mouse vector\r\n // TODO add for-loop do iterate through mousepositions\r\n for (int i = 0; i < this.mousePositions.size() - 2; i++) {\r\n graphic.setColor(new Color(0, 0, 255, 255));\r\n graphic.drawOval((int) this.mousePositions.get(i).getX() - 5, (int) this.mousePositions.get(i).getY() - 5, 10, 10);\r\n graphic.drawChars((\"\" + i).toCharArray(), 0, (\"\" + i).toCharArray().length, (int) this.mousePositions.get(i).getX() + 12, (int) this.mousePositions.get(i).getY() + 12);\r\n graphic.setColor(new Color(0, 0, 255, 32));\r\n graphic.fillOval((int) this.mousePositions.get(i).getX() - 5, (int) this.mousePositions.get(i).getY() - 5, 10, 10);\r\n graphic.drawLine((int) this.mousePositions.get(i).getX(), (int) this.mousePositions.get(i).getY(), (int) this.mousePositions.get(i + 1).getX(), (int) this.mousePositions.get(i + 1).getY());\r\n }\r\n graphic.setColor(new Color(0, 0, 255, 255));\r\n graphic.drawOval((int) this.mousePositions.get(this.mousePositions.size() - 1).getX() - 5, (int) this.mousePositions.get(this.mousePositions.size() - 1).getY() - 5, 10, 10);\r\n graphic.drawChars((\"\" + (this.mousePositions.size() - 1)).toCharArray(), 0, (\"\" + (this.mousePositions.size() - 1)).toCharArray().length, (int) this.mousePositions.get(this.mousePositions.size() - 1).getX() + 12, (int) this.mousePositions.get(this.mousePositions.size() - 1).getY() + 12);\r\n graphic.setColor(new Color(0, 0, 255, 32));\r\n graphic.fillOval((int) this.mousePositions.get(this.mousePositions.size() - 1).getX() - 5, (int) this.mousePositions.get(this.mousePositions.size() - 1).getY() - 5, 10, 10);\r\n\r\n // calculate and visualize setpoint\r\n graphic.setColor(new Color(0, 255, 0, 255));\r\n graphic.drawOval(this.setPoint.x - 5, this.setPoint.y - 5, 10, 10);\r\n graphic.drawChars((\"set point\").toCharArray(), 0, 9, 12 + this.setPoint.x, 12 + this.setPoint.y);\r\n graphic.setColor(new Color(0, 255, 0, 32));\r\n graphic.fillOval(this.setPoint.x - 5, this.setPoint.y - 5, 10, 10);\r\n\r\n // write the image\r\n file.mkdirs();\r\n ImageIO.write(screenShot, \"png\", file);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "private void MostrarSombra()\n {\n // Si tiene el valor por defecto\n if (EsDefecto())\n {\n // Si tenemos establecida la sombra \"defecto\"\n if (m_SombraD.m_nShadowColor != Color.TRANSPARENT)\n {\n setShadowLayer(m_SombraD.m_nShadowRadius, m_SombraD.m_nShadowDx,\n m_SombraD.m_nShadowDy, m_SombraD.m_nShadowColor);\n }\n else setShadowLayer(0, 0, 0, Color.TRANSPARENT);\n }\n else\n {\n // Si tenemos establecida la sombra \"normal\"\n if (m_SombraN.m_nShadowColor != Color.TRANSPARENT)\n {\n setShadowLayer(m_SombraN.m_nShadowRadius, m_SombraN.m_nShadowDx,\n m_SombraN.m_nShadowDy, m_SombraN.m_nShadowColor);\n }\n else setShadowLayer(0, 0, 0, Color.TRANSPARENT);\n }\n }" ]
[ "0.6558939", "0.61309993", "0.6117068", "0.6094386", "0.6021353", "0.59938174", "0.58898747", "0.58861816", "0.58823895", "0.5843054", "0.5840851", "0.580068", "0.57905525", "0.57643545", "0.57213074", "0.5719768", "0.57194364", "0.5719087", "0.57040495", "0.5677352", "0.56768566", "0.5661866", "0.5656595", "0.5650458", "0.5646697", "0.56429404", "0.56425184", "0.56362504", "0.56326693", "0.56272995", "0.56221914", "0.5606113", "0.55827427", "0.55747944", "0.5574404", "0.5571199", "0.55678284", "0.55520934", "0.55516255", "0.55367804", "0.5522844", "0.5519881", "0.55183214", "0.5516483", "0.5502097", "0.54971904", "0.54954123", "0.5493448", "0.5487059", "0.5481184", "0.54769886", "0.5476369", "0.5471503", "0.5455448", "0.5453622", "0.5447539", "0.54451853", "0.5440831", "0.5439214", "0.5432938", "0.5407283", "0.54071903", "0.5406576", "0.54022384", "0.5395065", "0.5393638", "0.5392151", "0.53898925", "0.53886765", "0.5385614", "0.5385481", "0.538133", "0.5380632", "0.53801715", "0.53779304", "0.537438", "0.5367932", "0.5363535", "0.53598726", "0.5358727", "0.535851", "0.53565323", "0.53521955", "0.5352125", "0.53395", "0.53317904", "0.5331133", "0.53202283", "0.53172433", "0.5315791", "0.5302806", "0.5301718", "0.5301693", "0.53008556", "0.52978516", "0.5291198", "0.52899265", "0.5288961", "0.5288261", "0.5283768" ]
0.6346966
1
ToDO use apache kafka, spark and a nosql cassandra db for persistence
public void analyze(AnalyticsRequest request){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CassandraService(JavaSparkContext sparkContext) {\n this.sparkContext = sparkContext;\n\n //Создаю коннектор к Cassandra для native запроса\n CassandraConnector connector = CassandraConnector.apply(sparkContext.getConf());\n\n try (CqlSession session = connector.openSession()) {\n session.execute(\"CREATE KEYSPACE IF NOT EXISTS hw2 WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1}\");\n //Создаю таблицу для результата\n session.execute(\"CREATE TABLE IF NOT EXISTS hw2.result (id int, time timestamp, scale varchar, value int, \" +\n \"PRIMARY KEY ((id), time, scale))\");\n }\n }", "public ConnexionClass(){\n\n //sparkSession = SparkSession.builder().master(\"local[*]\").appName(\"BigDATA\").config(\"spark.master\", \"local\").getOrCreate();\n sparkSession = SparkSession\n .builder()\n .config(\"spark.master\", \"local\")\n .getOrCreate();\n }", "@Override\n public void run() {\n SparkConf conf = new SparkConf().setAppName(\"yb.wordcount\")\n .setMaster(\"local[\" + appConfig.numWriterThreads + \"]\")\n .set(\"spark.cassandra.connection.host\", getRandomContactPoint().getHost());\n\n // Create the Java Spark context object.\n JavaSparkContext sc = new JavaSparkContext(conf);\n\n // Create the Cassandra connector to Spark.\n CassandraConnector connector = CassandraConnector.apply(conf);\n\n // Create a Cassandra session, and initialize the keyspace.\n Session session = connector.openSession();\n\n //------------------------------------------- Input ------------------------------------------\\\\\n JavaRDD<String> rows;\n if (useCassandraInput) {\n // Read rows from table and convert them to an RDD.\n rows = javaFunctions(sc).cassandraTable(getKeyspace(), inputTableName)\n .select(\"line\").map(row -> row.getString(\"line\"));\n } else {\n // Read the input file and convert it to an RDD.\n rows = sc.textFile(inputFile);\n }\n\n // Perform the word count.\n JavaPairRDD<String, Integer> counts =\n rows.flatMap(line -> Arrays.asList(line.split(\" \")).iterator())\n .mapToPair(word -> new Tuple2<String, Integer>(word, 1))\n .reduceByKey((x, y) -> x + y);\n\n //------------------------------------------- Output -----------------------------------------\\\\\n\n String outTable = getKeyspace() + \".\" + outputTableName;\n\n // Drop the output table if it already exists.\n dropCassandraTable(outTable);\n\n // Create the output table.\n session.execute(\"CREATE TABLE IF NOT EXISTS \" + outTable +\n \" (word VARCHAR PRIMARY KEY, count INT);\");\n\n // Save the output to the CQL table.\n javaFunctions(counts).writerBuilder(getKeyspace(),\n outputTableName,\n mapTupleToRow(String.class, Integer.class))\n .withColumnSelector(someColumns(\"word\", \"count\"))\n .saveToCassandra();\n\n session.close();\n sc.close();\n }", "public static void main(String[] args) throws Exception {\n JavaStreamingContext jssc = CommSparkContext.getJssc();\n\n Map<String, Object> kafkaParams = new HashMap<>();\n kafkaParams.put(\"bootstrap.servers\", \"bigdata-pro-m01.kfk.com:9092\");\n kafkaParams.put(\"key.deserializer\", StringDeserializer.class);\n kafkaParams.put(\"value.deserializer\", StringDeserializer.class);\n kafkaParams.put(\"group.id\", \"streaming_kafka_1\");\n kafkaParams.put(\"auto.offset.reset\", \"latest\");\n kafkaParams.put(\"enable.auto.commit\", false);\n\n Collection<String> topics = Arrays.asList(\"spark\");\n JavaInputDStream<ConsumerRecord<String, String>> stream =\n KafkaUtils.createDirectStream(\n jssc,\n LocationStrategies.PreferConsistent(),\n ConsumerStrategies.<String, String>Subscribe(topics, kafkaParams)\n );\n\n JavaDStream<String> accessDStream = stream.map(x -> x.value());\n\n JavaDStream<String> filterDStream = accessDStream.filter(x -> {\n String[] lines = x.split(\" \");\n String action = lines[5];\n if (\"view\".equals(action)) {\n return true;\n } else {\n return false;\n }\n });\n\n //calculatePagePV(filterDStream) ;\n\n //calculatePageUV(filterDStream);\n //calculateRegistercount(accessDStream);\n //calculateUserJumpCount(filterDStream);\n calculateUserSectionPV(filterDStream);\n\n jssc.start();\n jssc.awaitTermination();\n jssc.close();\n }", "DatastoreSession createSession();", "public static void main(String[] args) {\n Logger.getLogger(\"org\").setLevel(Level.ERROR);\n Logger.getLogger(\"akka\").setLevel(Level.ERROR);\n\n SparkSession spark = SparkSession.builder()\n .master(\"local\")\n .appName(\"MongoSparkConnectorIntro\")\n .config(\"spark.mongodb.input.uri\", \"mongodb://127.0.0.1/test.myCollection\")\n .config(\"spark.mongodb.output.uri\", \"mongodb://127.0.0.1/test.myCollection\")\n .getOrCreate();\n\n JavaSparkContext jsc = new JavaSparkContext(spark.sparkContext());\n\n // Create a custom WriteConfig\n Map<String, String> writeOverrides = new HashMap<>();\n writeOverrides.put(\"collection\", \"spark\");\n writeOverrides.put(\"writeConcern.w\", \"majority\");\n WriteConfig writeConfig = WriteConfig.create(jsc).withOptions(writeOverrides);\n\n // Create a RDD of 10 documents\n JavaRDD<Document> sparkDocuments = jsc.parallelize(asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)).map\n (i -> Document.parse(\"{spark: \" + i + \"}\"));\n\n /*Start Example: Save data from RDD to MongoDB*****************/\n MongoSpark.save(sparkDocuments, writeConfig);\n /*End Example**************************************************/\n\n jsc.close();\n\n }", "public interface CassandraClusterWrapper {\n CassandraSession open();\n Collection<String> getTableNames();\n void close();\n}", "private static Dataset<Row> loadbetaFeed() {\n\t\tconf.set(TableInputFormat.INPUT_TABLE, RSSFeedUtils.betatable);\n\t\tconf.set(TableInputFormat.SCAN_COLUMN_FAMILY, RSSFeedUtils.hbaseTab_cf);\n\t\t\n\t\tString feedCols = RSSFeedUtils.hbaseTab_cf + \":rssFeed \" + RSSFeedUtils.hbaseTab_cf + \":title \" + RSSFeedUtils.hbaseTab_cf + \":articleLink \" \n\t\t\t\t\t\t+ RSSFeedUtils.hbaseTab_cf + \":description \" + RSSFeedUtils.hbaseTab_cf + \":articleDate \" + RSSFeedUtils.hbaseTab_cf + \":categories\";\n\t\t\n\t\tconf.set(TableInputFormat.SCAN_COLUMNS, feedCols);\n\t\tJavaPairRDD<ImmutableBytesWritable, Result> feedPairRDD = jsc.newAPIHadoopRDD(conf, TableInputFormat.class, ImmutableBytesWritable.class, Result.class);\n\t\t\n\t\tJavaRDD<DatasetBean> feedRDD = feedPairRDD.map(new Function<Tuple2<ImmutableBytesWritable,Result>, DatasetBean>() {\n\t\t\t\n\t\t\tprivate static final long serialVersionUID = 1L;\n\t\t\tpublic DatasetBean call(Tuple2<ImmutableBytesWritable, Result> arg0) throws Exception {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tResult r = arg0._2;\n\t\t\t\t//keylist.add(new Delete(r.getRow())); \n\t\t\t\t\n\t\t\t\tDatasetBean databean = new DatasetBean();\n\t\t\t\tdatabean.setRssFeed(Bytes.toString(r.getValue(Bytes.toBytes(RSSFeedUtils.hbaseTab_cf), Bytes.toBytes(\"rssFeed\"))));\n\t\t\t\tdatabean.setTitle(Bytes.toString(r.getValue(Bytes.toBytes(RSSFeedUtils.hbaseTab_cf), Bytes.toBytes(\"title\"))));\n\t\t\t\tdatabean.setArticleLink(Bytes.toString(r.getValue(Bytes.toBytes(RSSFeedUtils.hbaseTab_cf), Bytes.toBytes(\"articleLink\"))));\n\t\t\t\tdatabean.setDescription(Bytes.toString(r.getValue(Bytes.toBytes(RSSFeedUtils.hbaseTab_cf), Bytes.toBytes(\"description\"))));\n\t\t\t\tdatabean.setCategories(Bytes.toString(r.getValue(Bytes.toBytes(RSSFeedUtils.hbaseTab_cf), Bytes.toBytes(\"categories\"))));\n\t\t\t\tdatabean.setArticleDate(Bytes.toString(r.getValue(Bytes.toBytes(RSSFeedUtils.hbaseTab_cf), Bytes.toBytes(\"articleDate\"))));\n\t\t\t\t\n\t\t\t\treturn databean;\n\t\t\t}\n\t\t});\n\t\t\n\t\tDataset<Row> feeddataset = sparkSession.createDataFrame(feedRDD, DatasetBean.class);\n\t\treturn feeddataset;\n\t}", "private boolean start() {\n log.debug(\"-> start()\");\n long t0 = System.currentTimeMillis();\n\n // Creates a session on a local master\n SparkSession spark = SparkSession.builder()\n .appName(\"Pax with 2021 imputation to Delta\")\n .master(\"local[*]\")\n .getOrCreate();\n\n long tc = System.currentTimeMillis();\n log.info(\"Spark master available in {} ms.\", (tc - t0));\n t0 = tc;\n\n // Creates the schema\n StructType schema = DataTypes.createStructType(new StructField[] {\n DataTypes.createStructField(\n \"month\",\n DataTypes.DateType,\n false),\n DataTypes.createStructField(\n \"pax\",\n DataTypes.IntegerType,\n true) });\n\n // International Pax\n Dataset<Row> internationalPaxDf = spark.read().format(\"csv\")\n .option(\"header\", true)\n .option(\"dateFormat\", \"MMMM yyyy\")\n .schema(schema)\n .load(\n \"data/bts/International USCarrier_Traffic_20210902163435.csv\");\n internationalPaxDf = internationalPaxDf\n .withColumnRenamed(\"pax\", \"internationalPax\")\n // Very simple data quality\n .filter(col(\"month\").isNotNull())\n .filter(col(\"internationalPax\").isNotNull());\n\n tc = System.currentTimeMillis();\n log.info(\"International pax ingested in {} ms.\", (tc - t0));\n t0 = tc;\n\n // Domestic Pax\n Dataset<Row> domesticPaxDf = spark.read().format(\"csv\")\n .option(\"header\", true)\n .option(\"dateFormat\", \"MMMM yyyy\")\n .schema(schema)\n .load(\n \"data/bts/Domestic USCarrier_Traffic_20210902163435.csv\");\n domesticPaxDf = domesticPaxDf\n .withColumnRenamed(\"pax\", \"domesticPax\")\n // Very simple data quality\n .filter(col(\"month\").isNotNull())\n .filter(col(\"domesticPax\").isNotNull());\n tc = System.currentTimeMillis();\n log.info(\"Domestic pax ingested in {} ms.\", (tc - t0));\n t0 = tc;\n\n // Combining datasets\n Dataset<Row> df = internationalPaxDf\n .join(domesticPaxDf,\n internationalPaxDf.col(\"month\")\n .equalTo(domesticPaxDf.col(\"month\")),\n \"outer\")\n .withColumn(\"pax\", expr(\"internationalPax + domesticPax\"))\n\n // Make a copy of the original BTS data\n .withColumn(\"paxBts\", col(\"pax\"))\n .drop(domesticPaxDf.col(\"month\"))\n\n // Very simple data quality\n .orderBy(col(\"month\"))\n .cache();\n tc = System.currentTimeMillis();\n log.info(\"Join in {} ms.\", (tc - t0));\n t0 = tc;\n\n // Imputation of missing data\n Dataset<Row> df2021 =\n df.filter(expr(\n \"month >= TO_DATE('2021-01-01') and month <= TO_DATE('2021-12-31')\"));\n df2021.show();\n int monthCount = (int) df2021.count();\n log.info(\n \"We only have {} months for 2021, let's impute the {} others.\",\n monthCount, (12 - monthCount));\n\n df2021 = df2021\n .agg(sum(\"pax\").as(\"pax\"),\n sum(\"internationalPax\").as(\"internationalPax\"),\n sum(\"domesticPax\").as(\"domesticPax\"));\n int pax = DataframeUtils.maxAsInt(df2021, \"pax\") / (12 - monthCount);\n int intPax =\n DataframeUtils.maxAsInt(df2021, \"internationalPax\")\n / (12 - monthCount);\n int domPax =\n DataframeUtils.maxAsInt(df2021, \"domesticPax\") / (12 - monthCount);\n\n List<String> data = new ArrayList();\n for (int i = monthCount + 1; i <= 12; i++) {\n data.add(\"2021-\" + i + \"-01\");\n }\n Dataset<Row> dfImputation2021 = spark\n .createDataset(data, Encoders.STRING()).toDF()\n .withColumn(\"month\", col(\"value\").cast(DataTypes.DateType))\n .withColumn(\"pax\", lit(pax))\n .withColumn(\"internationalPax\", lit(intPax))\n .withColumn(\"domesticPax\", lit(domPax))\n .drop(\"value\");\n log.info(\"Imputation done:\");\n dfImputation2021.show();\n\n tc = System.currentTimeMillis();\n log.info(\"Imputation in {} ms.\", (tc - t0));\n t0 = tc;\n\n // Combine data with imputated data\n df = df.unionByName(dfImputation2021, true);\n\n df.orderBy(col(\"month\").desc()).show(15);\n df.write()\n .format(\"delta\")\n .mode(\"overwrite\")\n .save(\"./data/tmp/airtrafficmonth_all\");\n\n tc = System.currentTimeMillis();\n log.info(\"Data save for in {} ms.\", (tc - t0));\n\n spark.stop();\n return true;\n }", "DataSet toDataSet(SQLContext context, JavaRDD<?> rdd, Class<?> beanClass);", "public static JavaStreamingContext processStream() throws SparkException {\n SparkConf streamingConf = new SparkConf().setMaster(\"local[2]\").setAppName(\"voting\");\r\n streamingConf.set(\"spark.streaming.stopGracefullyOnShutdown\", \"true\");\r\n\r\n // create a Spark Java streaming context, with stream batch interval\r\n JavaStreamingContext jssc = new JavaStreamingContext(streamingConf, Durations.milliseconds(1000));\r\n\r\n // set checkpoint for demo\r\n jssc.checkpoint(System.getProperty(\"java.io.tmpdir\"));\r\n\r\n jssc.sparkContext().setLogLevel(Level.OFF.toString()); // turn off Spark logging\r\n\r\n // set up receive data stream from kafka\r\n final Set<String> topicsSet = new HashSet<>(Arrays.asList(topic));\r\n final Map<String, String> kafkaParams = new HashMap<>();\r\n kafkaParams.put(\"metadata.broker.list\", broker);\r\n\r\n // create a Discretized Stream of Java String objects\r\n // as a direct stream from kafka (zookeeper is not an intermediate)\r\n JavaPairInputDStream<String, String> rawDataLines =\r\n KafkaUtils.createDirectStream(\r\n jssc,\r\n String.class,\r\n String.class,\r\n StringDecoder.class,\r\n StringDecoder.class,\r\n kafkaParams,\r\n topicsSet\r\n );\r\n\r\n JavaDStream<String> lines = rawDataLines.map((Function<Tuple2<String, String>, String>) Tuple2::_2);\r\n System.out.println(lines);\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n return jssc;\r\n }", "public static void main(String[] args) throws Exception {\n\t\tProperties props = new Properties();\n\t\tprops.put(\"bootstrap.servers\", \"127.0.0.1:9092\");\n\t\tprops.put(\"acks\", \"all\");\n\t\tprops.put(\"retries\", 0);\n\t\tprops.put(\"batch.size\", 16384);\n\t\tprops.put(\"linger.ms\", 1);\n\t\tprops.put(\"buffer.memory\", 33554432);\n\t\tprops.put(\"key.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n\t\tprops.put(\"value.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n\n\t\t/*\n\t\t * Define new Kafka producer\n\t\t */\n\t\t@SuppressWarnings(\"resource\")\n\t\tProducer<String, String> producer = new KafkaProducer<>(props);\n\n\t\t/*\n\t\t * parallel generation of JSON messages on Transaction topic\n\t\t * \n\t\t * this could also include business logic, projection, aggregation, etc.\n\t\t */\n\t\tThread transactionThread = new Thread(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tString topic = \"Transaction\";\n\t\t\t\tList<JSONObject> transactions = new ArrayList<JSONObject>();\n\t\t\t\tinitJSONData(\"ETLSpark_Transactions.json\", transactions);\n\t\t\t\tfor (int i = 0; i < transactions.size(); i++) {\n\t\t\t\t\tif (i % 200 == 0) {\n\t\t\t\t\t\tSystem.out.println(\"200 Transaction Messages procuded\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tproducer.send(new ProducerRecord<String, String>(topic, Integer.toString(i), transactions.get(i).toString()));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t/*\n\t\t * parallel generation of customer topic messages \n\t\t */\n\t\tThread customerThread = new Thread(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tString topic = \"Customer\";\n\t\t\t\tList<JSONObject> customer = new ArrayList<JSONObject>();\n\t\t\t\tinitJSONData(\"ETLSpark_Customer.json\", customer);\n\t\t\t\tfor (int i = 0; i < customer.size(); i++) {\n\t\t\t\t\tif (i % 200 == 0) {\n\t\t\t\t\t\tSystem.out.println(\"200 Customer Messages procuded\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tproducer.send(new ProducerRecord<String, String>(topic, Integer.toString(i), customer.get(i).toString()));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t/*\n\t\t * parallel generation of messages (variable produceMessages)\n\t\t * \n\t\t * generated messages are based on mockaroo api\n\t\t */\n\t\tint produceMessages = 100000;\n\t\tThread accountThread = new Thread(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tString topic = \"Account\";\n\t\t\t\tfor (int i = 0; i < produceMessages; i++) {\n//\t\t\t\t\tSystem.out.println(\"Account procuded\");\n\t\t\t\t\tproducer.send(new ProducerRecord<String, String>(topic, Integer.toString(i), getRandomTransactionJSON(i)));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\ttransactionThread.start();\n\t\tcustomerThread.start();\n\t\taccountThread.start();\n\n\t}", "public static void main(String[] args) throws Exception {\n StreamExecutionEnvironment stenv = StreamExecutionEnvironment.getExecutionEnvironment();\n EnvironmentSettings settings = EnvironmentSettings.newInstance().useBlinkPlanner().inStreamingMode().build();\n\n StreamTableEnvironment fsTableEnv = StreamTableEnvironment.create(stenv, settings);\n stenv.setStreamTimeCharacteristic(TimeCharacteristic.EventTime);\n FlinkKafkaConsumer<String> consumer = new FlinkKafkaConsumer<String>(\"my_topic_flink4\",\n new SimpleStringSchema(),\n PropertiesUtil.getConsumerProperties());\n consumer.assignTimestampsAndWatermarks(WatermarkStrategy.forBoundedOutOfOrderness(Duration.ofSeconds(1000)));\n\n DataStreamSource<String> dataStream = stenv.addSource(consumer);\n\n TableEnvironment tableEnv = TableEnvironment.create(settings);\n String name = \"hive\";\n String defaultDatabase = \"myflink\";\n String hiveConfDir = \"flink/src/main/resources/\";\n\n Catalog hive = new HiveCatalog(name, defaultDatabase, hiveConfDir);\n tableEnv.registerCatalog(name, hive);\n\n\n// tableEnv.executeSql(\"create table order_db (userId string ,userName string,productName string,producrdate string) \").print();\n\n\n dataStream.map(new MapFunction<String, Object>() {\n @Override\n public Object map(String s) throws Exception {\n List<Order> list = JSON.parseArray(s, Order.class);\n for (Order order : list) {\n String sql=\"insert into order_db(userId ,userName,productName,productdate)values(\" + order.getUserId() + \",\" + order.getUserName() + \",\" + order.getProductName()\n + \",\" + order.getDate() + \")\";\n System.out.println(sql);\n tableEnv.executeSql(sql).print();\n }\n tableEnv.executeSql(\"select * from order_db\").print();\n return \"\";\n }\n }).addSink(new SinkFunction<Object>() {\n @Override\n public void invoke(Object value, Context context) throws Exception {\n\n }\n });\n stenv.execute(\"flinkkafkastart\");\n\n\n }", "public void initializeConnection() {\n\n cluster = Cluster.builder().addContactPoint(host).build();\n session = cluster.connect(keyspaceName);\n session.execute(\"USE \".concat(keyspaceName));\n }", "public static void main(String[] args) throws Exception {\n\t\tZkHosts zkHosts = new ZkHosts(\"192.168.0.111:2181\");\n\t\t//Create the KafkaSpout configuration\n\t\t//Second argument -> topic name\n\t\t//Third argument -> zk root for Kafka\n\t\t//Forth argument -> consumer group id\n\t\t\n\t\tSpoutConfig kafkaConfig = new SpoutConfig(zkHosts, \"words_topic\", \"\", \"id111\");\n\t\t//Specify kafka message type\n\t\tkafkaConfig.scheme = new SchemeAsMultiScheme(new StringScheme());\n\t\t//We want to consume all the first message in the topic every time\n\t\t//方便debug,在生产环境应该设置为false not sure used to be `forceFromStart`\n\t\tkafkaConfig.useStartOffsetTimeIfOffsetOutOfRange = true;\n\t\t//create the topology\n\t\tTopologyBuilder builder = new TopologyBuilder();\n\t\t//set kafka spout class\n\t\tbuilder.setSpout(\"KafkaSpout\", new KafkaSpout(kafkaConfig), 1);\n\t\t//configure bolts ##after update not work\n//\t\tbuilder.setBolt(\"SentenceBolt\", new SentenceBolt(), 1).globalGrouping(\"KafkaSpout\");\n//\t\tbuilder.setBolt(\"PrintBolt\", new PrintBolt(), 1).globalGrouping(\"SentenceBolt\");\n\t\t\n\t\tLocalCluster cluster = new LocalCluster();\n\t\tConfig conf = new Config();\n\t\t\n\t\tcluster.submitTopology(\"KafkaTopology\", conf, builder.createTopology());\n\t\t\n\t\ttry {\n\t\t\tSystem.out.println(\"Waiting to consume from kafka\");\n\t\t\tTimeUnit.SECONDS.sleep(100);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tcluster.killTopology(\"KafkaTopology\");\n\t\tcluster.shutdown();\n\t}", "public static void main(String[] args) {\n SparkSession spark =\n SparkSession.builder()\n .master(\"local\")\n .getOrCreate();\n\n // Set the loglevel to ERROR\n SparkContext sc = SparkContext.getOrCreate();\n sc.setLogLevel(\"ERROR\");\n\n Encoder<Person> personEncoder = Encoders.bean(Person.class);\n Dataset<Person> personDataset = spark.createDataset(\n Arrays.asList(\n new Person(0, \"Suzannah Oneal\", 43, 0, Arrays.asList(200, 150)),\n new Person(1, \"Nida Partridge\", 34, 1, Arrays.asList(100, 150, 200)),\n new Person(2, \"Angelo Osborne\", 25, 1, Arrays.asList(100))\n ),\n personEncoder);\n personDataset.show();\n\n Encoder<Company> companyEncoder = Encoders.bean(Company.class);\n Dataset<Company> companyDataset = spark.createDataset(\n Arrays.asList(\n new Company(0, \"Zurich\", \"IT\", \"Sparkz\"),\n new Company(1, \"Zurich\", \"Consulting\", \"BigData4All\"),\n new Company(2, \"New York\", \"IT\", \"WorkHardPlayHard\")\n ),\n companyEncoder);\n companyDataset.show();\n\n Encoder<PositionStatus> positionStatusEncoder = Encoders.bean(PositionStatus.class);\n Dataset<PositionStatus> positionStatusDataset = spark.createDataset(\n Arrays.asList(\n new PositionStatus(100, \"Data Scientist\"),\n new PositionStatus(150, \"Data Engineer\"),\n new PositionStatus(200, \"Software Engineer\")\n ),\n positionStatusEncoder);\n positionStatusDataset.show();\n\n Column sameCompanyJoinExpr = personDataset.col(\"company\").equalTo(companyDataset.col(\"id\"));\n personDataset.join(companyDataset, sameCompanyJoinExpr).show();\n personDataset.join(companyDataset, sameCompanyJoinExpr, \"outer\").show();\n companyDataset.join(personDataset, sameCompanyJoinExpr, \"left_outer\").show();\n companyDataset.join(personDataset, sameCompanyJoinExpr, \"left_semi\").show();\n companyDataset.join(personDataset, sameCompanyJoinExpr, \"left_anti\").show();\n\n Dataset<Row> personPosition = personDataset.withColumnRenamed(\"id\", \"personId\")\n .join(positionStatusDataset, expr(\"array_contains(positionStatus, status)\"));\n personPosition.show();\n personPosition.join(companyDataset, personPosition.col(\"company\").equalTo(companyDataset.col(\"id\"))).show();\n }", "@PostConstruct\n private void init() {\n Properties props = new Properties();\n props.put(\"oracle.user.name\", user);\n props.put(\"oracle.password\", pwd);\n props.put(\"oracle.service.name\", serviceName);\n //props.put(\"oracle.instance.name\", instanceName);\n props.put(\"oracle.net.tns_admin\", tnsAdmin); //eg: \"/user/home\" if ojdbc.properies file is in home \n props.put(\"security.protocol\", protocol);\n props.put(\"bootstrap.servers\", broker);\n //props.put(\"group.id\", group);\n props.put(\"enable.auto.commit\", \"true\");\n props.put(\"auto.commit.interval.ms\", \"10000\");\n props.put(\"linger.ms\", 1000);\n // Set how to serialize key/value pairs\n props.setProperty(\"key.serializer\", \"org.oracle.okafka.common.serialization.StringSerializer\");\n props.setProperty(\"value.serializer\", \"org.oracle.okafka.common.serialization.StringSerializer\");\n\n producer = new KafkaProducer<>(props);\n }", "public static void main(String[] args) throws Exception {\n STCCliParser parser = new STCCliParser(args);\n parser.parse();\n\n if(parser.getCmd() == null) {\n System.exit(1);\n }\n initParams(parser);\n\n // setup the property parser\n PropertyFileParser propertyParser = new PropertyFileParser(args[0]);\n propertyParser.parseFile();\n\n SparkConf sparkConf = new SparkConf()\n .setAppName(\"StreamingTCFinder\");\n if(debugMode) sparkConf.setMaster(\"local[*]\");\n\n int batchInterval = Integer.parseInt(propertyParser.getProperty(Config.SPARK_BATCH_INTERVAL));\n JavaStreamingContext ssc = new JavaStreamingContext(sparkConf, Durations.seconds(batchInterval));\n ssc.checkpoint(propertyParser.getProperty(Config.SPARK_CHECKPOINT_DIR));\n\n Set<String> topics = new HashSet(Arrays.asList(\n propertyParser.getProperty(Config.KAFKA_TOPICS).split(\",\")));\n Map<String, String> kafkaParams = new HashMap<>();\n kafkaParams.put(\"metadata.broker.list\", propertyParser.getProperty(Config.KAFKA_BROKERS));\n\n // create direct kafka stream with brokers and topics\n JavaPairInputDStream<String, String> inputDStream =\n KafkaUtils.createDirectStream(\n ssc, String.class, String.class,\n StringDecoder.class, StringDecoder.class,\n kafkaParams, topics);\n\n JavaPairDStream windowedInputRDD = inputDStream.window(Durations.seconds(batchInterval));\n JavaDStream<String> lines = windowedInputRDD.\n map(new InputDStreamValueMapper());\n lines.foreach(new BatchCountFunc());\n\n // partition the entire common.data set into trajectory slots\n // format: <slot_id, { pi, pj,... }>\n JavaPairDStream<Long, Iterable<TCPoint>> slotsRDD =\n lines.mapToPair(new stc.TrajectorySlotMapper())\n .groupByKey();\n\n // partition each slot into sub-partitions\n // format: <slot_id, TCRegion>\n JavaDStream<Tuple2<Long, TCRegion>> subPartitionsRDD =\n slotsRDD.flatMap(new KDTreeSubPartitionMapper(numSubPartitions)).cache();\n\n // get each point per partition\n // format: <(slotId, regionId), <objectId, point>>\n JavaPairDStream<String, Tuple2<Integer, TCPoint>> pointsRDD =\n subPartitionsRDD.flatMapToPair(new SubPartitionToPointsFlatMapper());\n\n // get all polylines per partition\n // format: <(slotId, regionId), {<objectId, polyline>}\n JavaPairDStream<String, Map<Integer, TCPolyline>> polylinesRDD =\n subPartitionsRDD.mapToPair(new SubPartitionToPolylinesMapper());\n\n // get density reachable per sub partition\n // format: <(slotId, regionId, objectId), {objectId}>\n JavaPairDStream<String, Iterable<Integer>> densityReachableRDD =\n pointsRDD.join(polylinesRDD)\n .flatMapToPair(new CoverageDensityReachableMapper(distanceThreshold))\n .groupByKey().filter(new CoverageDensityReachableFilter(densityThreshold));\n\n // remove objectId from key\n // format: <(slotId, regionId), {objectId}>\n JavaPairDStream<String, Iterable<Integer>> densityConnectionRDD\n = densityReachableRDD\n .mapToPair(new SubPartitionRemoveObjectIDMapper());\n\n // merge density connection sub-partitions\n // format: <(slotId, regionId), {{objectId}}>\n JavaPairDStream<String, Iterable<Integer>> subpartMergeConnectionRDD =\n densityConnectionRDD\n .reduceByKey(new CoverageDensityConnectionReducer());\n\n // remove regionId from key\n // format: <slotId, {objectId}>\n JavaPairDStream<Integer, Iterable<Integer>> slotConnectionRDD =\n subpartMergeConnectionRDD\n .mapToPair(new SlotRemoveSubPartitionIDMapper())\n .reduceByKey(new CoverageDensityConnectionReducer());\n\n JavaPairDStream<Integer, Iterable<Integer>> windowedSlotConnectionRDD =\n slotConnectionRDD.window(Durations.seconds(batchInterval * durationThreshold));\n\n // obtain trajectory companion\n // format: <{objectId}, {slotId}>\n JavaPairDStream<String, Iterable<Integer>> companionRDD =\n windowedSlotConnectionRDD\n .flatMapToPair(new CoverageDensityConnectionSubsetMapper(sizeThreshold))\n .mapToPair(new CoverageDensityConnectionMapper())\n .groupByKey()\n .filter(new TrajectoryCompanionFilter(durationThreshold));\n\n if(debugMode)\n companionRDD.print();\n else\n companionRDD.saveAsHadoopFiles(outputDir, \"csv\",\n String.class, String.class, TextOutputFormat.class);\n\n ssc.start();\n ssc.awaitTermination();\n }", "public static synchronized void init() {\n\n if (serverRunning.get()) {\n\n LOG.info(\"Initializing the Cassandra server with a default schema and default values\");\n\n String[] createKeySpace = new String[]{\n // \"USE \" + KEY_SPACE + \";\\n\", -> rather specify the key space explicitly for the generic session object we use here\n \"DROP TABLE IF EXISTS \" + KEY_SPACE + \".events;\\n\",\n \"CREATE TABLE \" + KEY_SPACE + \".events (\\n\" +\n \" eventId ASCII PRIMARY KEY,\\n\" +\n \" auditStream ASCII,\\n\" +\n \" eventJson VARCHAR\\n\" +\n \");\"\n };\n\n try {\n for (String cql : createKeySpace) {\n session.execute(cql);\n }\n } catch (Exception e) {\n LOG.error(\"The Cassandra server cannot be initialized\", e.getCause(), e.getStackTrace());\n }\n } else {\n LOG.info(\"The Cassandra server cannot be initialized because it is not running\");\n }\n\n }", "public static void main(String[] args) {\n\t\tfinal SparkConf sparkConf = new SparkConf().setAppName(\"Twitter Data Processing\").setMaster(\"local[10]\");\r\n\t\t// Create Streaming context using spark configuration and duration for which messages will be batched and fed to Spark Core\r\n\t\tfinal JavaStreamingContext streamingContext = new JavaStreamingContext(sparkConf, Duration.apply(10000));\r\n\t\t\r\n\t\t// Prepare configuration for Twitter authentication and authorization\r\n\t\tfinal Configuration conf = new ConfigurationBuilder().setDebugEnabled(false)\r\n\t\t\t\t\t\t\t\t\t\t.setOAuthConsumerKey(\"MxQCTyFaITn01Jde4SLof7ZfR\")\r\n\t\t\t\t\t\t\t\t\t\t.setOAuthConsumerSecret(\"4eL6g2Iv2dJgei0iBIaowMsEfbG1q14dhwimE3kpBT9VcYGoAG\")\r\n\t\t\t\t\t\t\t\t\t\t.setOAuthAccessToken(\"3457451234-rv4lhFAYg0t20pq0pswXLR1G0mtUKjZlmv7jH4x\")\r\n\t\t\t\t\t\t\t\t\t\t.setOAuthAccessTokenSecret(\"o3yz45UqwxclV0mUwLM8XQveQEh0yYFATZBrQnag0z1Zx\")\r\n\t\t\t\t\t\t\t\t\t\t.build();\r\n\t\t// Create Twitter authorization object by passing prepared configuration containing consumer and access keys and tokens\r\n\t\tfinal Authorization twitterAuth = new OAuthAuthorization(conf);\r\n\t\t// Create a data stream using streaming context and Twitter authorization\r\n\t\tfinal JavaReceiverInputDStream<Status> inputDStream = TwitterUtils.createStream(streamingContext, twitterAuth, new String[]{});\r\n\t\t/* JavaDStream<String> statuses = inputDStream.map(\r\n\t new Function<Status, String>() {\r\n\t public String call(Status status) { return status.getText(); }\r\n\t }\r\n\t ); */\r\n\t\t \r\n\t\t// Create a new stream by filtering the non english tweets from earlier streams\r\n\t\tfinal JavaDStream<Status> enTweetsDStream = inputDStream.filter((status) -> \"en\".equalsIgnoreCase(status.getLang()));\r\n\t\t// Convert stream to pair stream with key as user screen name and value as tweet text\r\n\t\tfinal JavaPairDStream<String, String> userTweetsStream = \r\n\t\t\t\t\t\t\t\tenTweetsDStream.mapToPair(\r\n\t\t\t\t\t\t\t\t\t(status) -> new Tuple2<String, String>(status.getUser().getScreenName(), status.getText())\r\n\t\t\t\t\t\t\t\t);\r\n\t\t/*\r\n\t\t// Group the tweets for each user\r\n\t\tfinal JavaPairDStream<String, Iterable<String>> tweetsReducedByUser = userTweetsStream.groupByKey();\r\n\t\t// Create a new pair stream by replacing iterable of tweets in older pair stream to number of tweets\r\n\t\tfinal JavaPairDStream<String, Integer> tweetsMappedByUser = tweetsReducedByUser.mapToPair(\r\n\t\t\t\t\tuserTweets -> new Tuple2<String, Integer>(userTweets._1, Iterables.size(userTweets._2))\r\n\t\t\t\t);\r\n\t\t// Iterate over the stream's RDDs and print each element on console\r\n\t\ttweetsMappedByUser.foreachRDD((VoidFunction<JavaPairRDD<String, Integer>>)pairRDD -> {\r\n\t\t\tpairRDD.foreach(new VoidFunction<Tuple2<String,Integer>>() {\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void call(Tuple2<String, Integer> t) throws Exception {\r\n\t\t\t\t\tSystem.out.println(t._1() + \",\" + t._2());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t});*/\r\n\t\tuserTweetsStream.print();\r\n\t\t// Triggers the start of processing. Nothing happens if streaming context is not started\r\n\t\tstreamingContext.start();\r\n\t\t// Keeps the processing live by halting here unless terminated manually\r\n\t\t\t/* Sleep for some seconds. */\r\n\t\tstreamingContext.awaitTermination();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "void setup( File storeDir, Consumer<GraphDatabaseService> create );", "@Tags({\"cassandra\", \"connection\", \"database\"})\n@CapabilityDescription(\"Provides Cassandra Connection Pooling Service.\")\npublic interface CassandraService extends ControllerService{\n Session getSession() throws Exception;\n Cluster getCluster() throws Exception;\n}", "@Override\r\n\tpublic void onMessage(ConsumerRecord<String, String> data) {\n\t\t\r\n\t\tString value = data.value();\r\n\t\t\r\n\r\n\t\tif(data.key().equals(\"add1\")) {\r\n\t\t\tarticleService.addHot(Integer.parseInt(data.value()));\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"浏览量增加\");\r\n\t\t\t\r\n\t\t}else if(data.key().equals(\"shuju\")){\r\n\t\t\tGson gson = new Gson();\r\n\t\t\tArticle fromJson = gson.fromJson(value, Article.class);\r\n\t\t\t\r\n\t\t\tarticleService.kafkaSave(fromJson);\r\n\t\t}else if(data.key().equals(\"shizhichao_redis\")) {\r\n\t\t\tValueOperations<String, Article> opsForValue = redisTemplate.opsForValue();\r\n\t\t\t\r\n\t\t\tArticle article = opsForValue.get(value);\r\n\t\t\t\r\n\t\t\tint i = articleService.kafkaSave(article);\r\n\t\t\t\r\n\t\t\tif(i>0) {\r\n\t\t\t\tredisTemplate.delete(value);\r\n\t\t\t\tSystem.out.println( data.value() + \"已导入完毕\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\r\n\t\t\r\n\t\t\r\n\t}", "public void doBuild() throws TorqueException\n {\n dbMap = Torque.getDatabaseMap(\"cream\");\n\n dbMap.addTable(\"OPPORTUNITY\");\n TableMap tMap = dbMap.getTable(\"OPPORTUNITY\");\n\n tMap.setPrimaryKeyMethod(TableMap.NATIVE);\n\n\n tMap.addPrimaryKey(\"OPPORTUNITY.OPPORTUNITY_ID\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.OPPORTUNITY_CODE\", \"\");\n tMap.addColumn(\"OPPORTUNITY.STATUS\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.PRIORITY\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.OPPORTUNITY_TYPE\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.OPPORTUNITY_NAME\", \"\");\n tMap.addForeignKey(\n \"OPPORTUNITY.OPPORTUNITY_CAT_ID\", new Integer(0) , \"OPPORTUNITY_CATEGORY\" ,\n \"OPPORTUNITY_CAT_ID\");\n tMap.addForeignKey(\n \"OPPORTUNITY.LEAD_SOURCE_ID\", new Integer(0) , \"LEAD_SOURCE\" ,\n \"LEAD_SOURCE_ID\");\n tMap.addColumn(\"OPPORTUNITY.ISSUED_DATE\", new Date());\n tMap.addColumn(\"OPPORTUNITY.EXPECTED_DATE\", new Date());\n tMap.addColumn(\"OPPORTUNITY.CLOSED_DATE\", new Date());\n tMap.addForeignKey(\n \"OPPORTUNITY.CUSTOMER_ID\", new Integer(0) , \"CUSTOMER\" ,\n \"CUSTOMER_ID\");\n tMap.addForeignKey(\n \"OPPORTUNITY.PROJECT_ID\", new Integer(0) , \"PROJECT\" ,\n \"PROJECT_ID\");\n tMap.addForeignKey(\n \"OPPORTUNITY.CURRENCY_ID\", new Integer(0) , \"CURRENCY\" ,\n \"CURRENCY_ID\");\n tMap.addColumn(\"OPPORTUNITY.CURRENCY_AMOUNT\", new BigDecimal(0));\n tMap.addColumn(\"OPPORTUNITY.SALES_STAGE\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.PROBABILITY\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.SUBJECT\", \"\");\n tMap.addColumn(\"OPPORTUNITY.NEXT_STEPS\", \"\");\n tMap.addColumn(\"OPPORTUNITY.NOTES\", \"\");\n tMap.addColumn(\"OPPORTUNITY.CREATED\", new Date());\n tMap.addColumn(\"OPPORTUNITY.MODIFIED\", new Date());\n tMap.addColumn(\"OPPORTUNITY.CREATED_BY\", \"\");\n tMap.addColumn(\"OPPORTUNITY.MODIFIED_BY\", \"\");\n }", "public interface ClientTokenRepository extends CassandraRepository<ClientToken, UUID> {\n}", "public static void main(String[] args) {\n String master = args[0];\n String topic = args[1];\n String partitionCount = args[2];\n String zkServers = args[3];\n String duration = args[4];\n String maxRate = args[5];\n String maxCores = args[6];\n\n System.out.println(\"Master: \" + master);\n System.out.println(\"Topic: \" + topic);\n System.out.println(\"Partitions: \" + partitionCount);\n System.out.println(\"Zookeeper: \" + zkServers);\n System.out.println(\"Duration: \" + duration);\n System.out.println(\"Max Rate: \" + maxRate);\n System.out.println(\"Max Cores: \" + maxCores); \n\n Map<String, Integer> topicMap = new HashMap<String, Integer>();\n topicMap.put(topic, Integer.parseInt(partitionCount));\n\n // Create the context with a 1 second batch size\n SparkConf sparkConf = new SparkConf();\n sparkConf.setMaster(master);\n sparkConf.setAppName(\"EventMonitor\");\n sparkConf.setSparkHome(System.getenv(\"SPARK_HOME\"));\n sparkConf.setJars(JavaStreamingContext.jarOfClass(EventMonitor.class));\n sparkConf.set(\"spark.streaming.receiver.maxRate\", maxRate);\n sparkConf.set(\"spark.cores.max\", maxCores);\n\n JavaStreamingContext ssc = new JavaStreamingContext(sparkConf, new Duration(Integer.parseInt(duration)));\n\n JavaPairReceiverInputDStream<String, String> messages = KafkaUtils.createStream(ssc, zkServers, GROUP_ID, topicMap);\n messages.print();\n ssc.start();\n ssc.awaitTermination();\n }", "public AppModel() throws SQLException, ClassNotFoundException, IOException {\n modelLogger.debug(\"Mode logger\");\n dataBaseConnector = new DataBaseDownloader(\"jdbc:mysql://mysql.agh.edu.pl:3306/mtobiasz\",\"mtobiasz\", \"csjH6UN5BPS7VvYY\");\n String buyTableName = \"exchange_buy\";\n String sellTableName = \"exchange_sell\";\n buyMap = dataBaseConnector.getKeysAndVals(buyTableName);\n sellMap = dataBaseConnector.getKeysAndVals(sellTableName);\n }", "public FlinkConsumerFromKafkaUtil(){\n env = StreamExecutionEnvironment.getExecutionEnvironment();\n }", "@Before\n public void setUp() {\n topic = USER_TOPIC + KsqlIdentifierTestUtil.uniqueIdentifierName();\n TEST_HARNESS.ensureTopics(1, topic);\n\n TEST_HARNESS.produceRows(\n topic,\n USER_PROVIDER,\n FormatFactory.KAFKA,\n FormatFactory.JSON,\n timestampSupplier::getAndIncrement\n );\n\n //Create stream\n makeAdminRequest(\n REST_APP_0,\n \"CREATE STREAM \" + USERS_STREAM\n + \" (\" + USER_PROVIDER.ksqlSchemaString(false) + \")\"\n + \" WITH (\"\n + \" kafka_topic='\" + topic + \"', \"\n + \" value_format='JSON');\"\n );\n //Create table\n output = KsqlIdentifierTestUtil.uniqueIdentifierName();\n sql = \"SELECT * FROM \" + output + \" WHERE USERID = '\" + KEY + \"';\";\n sqlMultipleKeys = \"SELECT * FROM \" + output + \" WHERE USERID IN ('\"\n + KEY + \"', '\" + KEY1 + \"');\";\n List<KsqlEntity> res = makeAdminRequestWithResponse(\n REST_APP_0,\n \"CREATE TABLE \" + output + \" AS\"\n + \" SELECT \" + USER_PROVIDER.key() + \", COUNT(1) AS COUNT FROM \" + USERS_STREAM\n + \" GROUP BY \" + USER_PROVIDER.key() + \";\"\n );\n queryId = extractQueryId(res.get(0).toString());\n queryId = queryId.substring(0, queryId.length() - 1);\n waitForTableRows();\n\n waitForStreamsMetadataToInitialize(\n REST_APP_0, ImmutableList.of(HOST0, HOST1, HOST2), queryId);\n }", "public static void main(String[] args) {\n\t\tSparkConf sparkConf = JavaRDDSparkContextMain.sparkConf(\"Spark Streaming Cient\", \"local[*]\");\n\t JavaStreamingContext streamingContext = new JavaStreamingContext(sparkConf, new Duration(1000));\n\t\tSystem.out.println(\"-----streamingContext: \" + streamingContext);\n\t\t\n\t\t// need linux install nc command\n\t\t// CentOS: yum -y install nmap-ncat; nc -lk 9999 \n\t\t// input string streaming to Iterator<String>\n\t\tJavaReceiverInputDStream<String> streamingLine = streamingContext.socketTextStream(\"192.168.1.105\", 9999);\n\t\t\n\t\tJavaDStream<String> streamingWords = streamingLine.flatMap(input -> {\n\t\t\tString[] wordArray = input.split(\" \");\n\t\t\tList<String> wordList = Arrays.asList(wordArray);\n\t\t\treturn wordList.iterator();\n\t\t});\n\t\t\n\t\tSystem.out.println(\"-----print streamingWords: \");\n\t\tstreamingWords.print();\n\t\t\n\t\t// \n\t\tJavaPairDStream<String, Integer> wordTuple = streamingWords.mapToPair(word -> {\n\t\t\tTuple2<String, Integer> tuple2 = new Tuple2<String, Integer>(word, 1);\n\t\t\treturn tuple2;\n\t\t});\n\t\tSystem.out.println(\"-----wordTuple count: \" + wordTuple.count() + \", wordTuple: \" + wordTuple);\n\t\twordTuple.print();\n\t\t\n\t\t// work count \n\t\tJavaPairDStream<String, Integer> wordCount = wordTuple.reduceByKey((v1, v2) -> {\n\t\t\treturn v1 + v2;\n\t\t});\n\t\tSystem.out.println(\"-----wordCount count: \" + wordCount.count() + \", wordCount: \" + wordCount);\n\t\twordCount.print();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"-----streamingWords: \" + streamingWords.toString());\n\t\tstreamingContext.start();\n\t\t\n\t\t\n\t\ttry{\n\t\t\t// streamingContext.awaitTermination();\n\t\t\t\n\t\t\tThread.sleep(1000 * 30);\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tstreamingContext.stop();\n\t\tstreamingContext.close();\n\n\t}", "private JavaPairRDD<Map<String, ByteBuffer>, List<ByteBuffer>> userEvtSummaryService(\n\t\t\tJavaPairRDD<Map<String, ByteBuffer>, Map<String, ByteBuffer>> cassandraRDD,\n\t\t\tUserEvtSummaryService userSummaryService,\n\t\t\tUserEvtSummaryConfig userSummaryConfig) {\n\t\tlogger.info(\"Preprocessing before executing user summary service\");\n\t\tJavaPairRDD<String, UserEvent> userEventRDD = preprocessingForUserEvtSummary(\n\t\t\t\tcassandraRDD, userSummaryConfig.requiredEvent);\n\n\t\tlogger.info(\"Executing user summary algorithm\");\n\t\tJavaRDD<UserSummary> dayScoreEventRDD = userSummaryService\n\t\t\t\t.calculateUserSummary(userEventRDD);\n\n\t\tlogger.info(\"Postprocessing after executing user summary service - preparing record in the format in which spark-cassandra connector require.\");\n\t\tJavaPairRDD<Map<String, ByteBuffer>, List<ByteBuffer>> cassandraOutputRDD = TrendRecoPostprocessing\n\t\t\t\t.processingForUserSummary(dayScoreEventRDD);\n\t\treturn cassandraOutputRDD;\n\n\t}", "public static void main(String... args) {\n String endpoint = \"cb.<your endpoint address>.dp.cloud.couchbase.com\";\n String bucketName = \"couchbasecloudbucket\";\n String username = \"user\";\n String password = \"password\";\n // User Input ends here.\n\n ClusterEnvironment env = ClusterEnvironment.builder()\n .securityConfig(SecurityConfig.enableTls(true)\n .trustManagerFactory(InsecureTrustManagerFactory.INSTANCE))\n .ioConfig(IoConfig.enableDnsSrv(true))\n .build();\n\n // Initialize the Connection\n Cluster cluster = Cluster.connect(endpoint,\n ClusterOptions.clusterOptions(username, password).environment(env));\n Bucket bucket = cluster.bucket(bucketName);\n bucket.waitUntilReady(Duration.parse(\"PT10S\"));\n Collection collection = bucket.defaultCollection();\n\n cluster.queryIndexes().createPrimaryIndex(bucketName, CreatePrimaryQueryIndexOptions.createPrimaryQueryIndexOptions().ignoreIfExists(true));\n\n // Create a JSON Document\n JsonObject arthur = JsonObject.create()\n .put(\"name\", \"Arthur\")\n .put(\"email\", \"[email protected]\")\n .put(\"interests\", JsonArray.from(\"Holy Grail\", \"African Swallows\"));\n\n // Store the Document\n collection.upsert(\n \"u:king_arthur\",\n arthur\n );\n\n // Load the Document and print it\n // Prints Content and Metadata of the stored Document\n System.out.println(collection.get(\"u:king_arthur\"));\n\n // Perform a N1QL Query\n QueryResult result = cluster.query(\n String.format(\"SELECT name FROM `%s` WHERE $1 IN interests\", bucketName),\n queryOptions().parameters(JsonArray.from(\"African Swallows\"))\n );\n\n // Print each found Row\n for (JsonObject row : result.rowsAsObject()) {\n System.out.println(row);\n }\n }", "@Override\n\t\tpublic void prepare(Map conf, TopologyContext context, OutputCollector collector) {\n\t\t\ttry {\n\t\t\t\tcluster = Cluster.builder().addContactPoint(\"192.168.2.10\").build(); //vagrant cassandra cluster\n\t\t\t\tsession = cluster.connect(); \n\t\t\t}catch(NoHostAvailableException et){\n\t\t\t\ttry{\n\t\t\t\t\tcluster = Cluster.builder().addContactPoint(\"127.0.0.1\").build(); //localhost\n\t\t\t\t\tsession = cluster.connect();\n\t\t\t\t}catch(NoHostAvailableException et1){\n\t\t\t\t\t//can't get to a cassandra cluster bug out\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\t\t\t} \n\t\t\tKeyspaces kp = new Keyspaces();\n\t\t\tkp.SetUpKeySpaces(cluster);\n\t\t\tInsertStatement = session.prepare(\"insert into mzMLKeyspace.mzml (name,scan,mzarray,intensityarray)\" +\n\t\t\t\t\t\" VALUES (?, ?, ?,?);\");\n\t\t\t_collector = collector;\n\t\t\tComponentId=context.getThisComponentId();\n\t\t}", "DataSet toDataSet(SQLContext context, JavaRDD<Row> rdd, StructType schema);", "private static void run( final BC_SETTINGS settings,\n final String list_to_run,\n final Logger logger )\n {\n /* create and configure the spark-context */\n SparkConf sc = BC_SETTINGS_READER.createSparkConfAndConfigure( settings );\n JavaSparkContext jsc = new JavaSparkContext( sc );\n jsc.addFile( \"libblastjni.so\" );\n jsc.setLogLevel( settings.spark_log_level );\n\n logger.info( String.format( \"running on Spark-version: '%s'\", jsc.sc().version() ) );\n\n /* create the application-context, lives only on the master */\n BC_CONTEXT context = new BC_CONTEXT( settings );\n\n // reader thread for console commands\n BC_CONSOLE console = new BC_CONSOLE( context );\n console.start();\n\n // listen for debug-events\n BC_DEBUG_RECEIVER debug_receiver = null;\n if ( settings.debug.events_selected() )\n {\n debug_receiver = new BC_DEBUG_RECEIVER( context );\n debug_receiver.start();\n }\n\n /* broadcast the Debug-settings */\n Broadcast< BC_DEBUG_SETTINGS > DEBUG_SETTINGS = jsc.broadcast( settings.debug );\n\n Map< String, JavaRDD< BC_DATABASE_RDD_ENTRY > > db_dict = new HashMap<>();\n\n /* populate db_dict */\n for ( String key : settings.dbs.keySet() )\n {\n BC_DATABASE_SETTING db_setting = settings.dbs.get( key );\n\n /* get a list of entries from the source ( bucket )\n each file\n */\n List< BC_NAME_SIZE > files = BC_GCP_TOOLS.list( db_setting.source_location );\n\n /* get a list of unique names ( without the extension ) */\n List< BC_CHUNK_VALUES > all_chunks = BC_GCP_TOOLS.unique_by_extension( files, db_setting.extensions );\n if ( db_setting.limit > 0 )\n logger.info( String.format( \"%s has %d chunks, using %d of them\", key, all_chunks.size(), db_setting.limit ) );\n else\n logger.info( String.format( \"%s has %d chunks\", key, all_chunks.size() ) );\n\n List< BC_CHUNK_VALUES > used_chunks = db_setting.limit > 0 ? all_chunks.subList( 0, db_setting.limit ) : all_chunks;\n\n /* create a list of Database-RDD-entries using a static method of this class */\n List< BC_DATABASE_RDD_ENTRY > entries = BC_DATABASE_RDD_ENTRY.make_rdd_entry_list( db_setting, used_chunks );\n\n /* ask the spark-context to distribute the RDD to the workers\n * 16 parallel jobs, 64 partitions each = 1024\n * 16 workers, 64 cores each = 1024\n */\n JavaRDD< BC_DATABASE_RDD_ENTRY > rdd = settings.num_partitions > 0 ?\n jsc.parallelize( entries, settings.num_partitions ) :\n jsc.parallelize( entries );\n\n if (settings.predownload_dbs) {\n rdd = rdd.map(item -> {\n\n List<String> error_list = new ArrayList<String>();\n List<String> info_list = new ArrayList<String>();\n item.downloadAndScan(error_list, info_list);\n return item;\n }).cache();\n\n rdd.collect();\n }\n /* put the RDD in the database-dictionary */\n db_dict.put( key, rdd );\n }\n\n /* create the job-pool to process jobs in parallel */\n BC_JOBS jobs = new BC_JOBS( context, jsc, DEBUG_SETTINGS, db_dict );\n\n logger.info( \"ready\" );\n\n /* if we have a list to run at startup... */\n if ( list_to_run != null )\n context.addRequestList( list_to_run, 0 );\n\n /* we are handling commands, which originate form the master-console or from a socket */\n while ( context.is_running() )\n {\n try\n {\n BC_COMMAND cmd = context.pull_cmd();\n if ( cmd != null )\n cmd.handle( context );\n else\n Thread.sleep( 250 );\n }\n catch ( InterruptedException e ) {}\n }\n\n int errors = 0;\n /* join the different threads we have created... */\n try\n {\n errors = jobs.errors();\n jobs.join();\n if ( debug_receiver != null )\n debug_receiver.join_clients();\n console.join();\n context.join(); /* because context owns request-list-threads */\n }\n catch( Exception e ) { e.printStackTrace(); }\n\n logger.info( String.format( \"done, %d errors\", errors ) );\n }", "public static void main(String args[]) throws ConnectionException {\n\t\tString[] products1 = { \"1\", \"2\", \"3\", \"1\", \"2\" };\n\t\t// productos visitados por el usuario 2\n\t\tString[] products2 = { \"1\", \"1\", \"3\", \"1\", \"6\" };\n\t\t// productos visitados por el usuario 3\n\t\tString[] products3 = { \"1\", \"2\", \"5\", \"7\", \"8\" };\n\t\t// productos visitados por el usuario 4\n\t\tString[] products4 = { \"1\", \"2\", \"2\", \"8\", \"9\" };\n\t\t// productos visitados por el usuario 5\n\t\tString[] products5 = { \"4\", \"5\", \"6\", \"7\", \"7\" };\n\n\t\tString[][] userVisitsProduct = { products1, products2, products3,\n\t\t\t\tproducts4, products5 };\n\n\t\tKeyspace ksUsers = Utils.getKeyspace(keySpaceName);\n\n\t\t// ksUsers.dropColumnFamily(\"UserVisitsProduct2\");\n\n\t\tColumnFamily<String, String> cfUsers = new ColumnFamily<String, String>(\n\t\t\t\tcolumnFamilyName, StringSerializer.get(),\n\t\t\t\tStringSerializer.get());\n\n\t\t// Inserci�n de los datos en Cassandra\n\t\ttry {\n\t\t\tksUsers.createColumnFamily(\n\t\t\t\t\tcfUsers,\n\t\t\t\t\tImmutableMap\n\t\t\t\t\t\t\t.<String, Object> builder()\n\t\t\t\t\t\t\t.put(\"default_validation_class\",\n\t\t\t\t\t\t\t\t\t\"CounterColumnType\")\n\t\t\t\t\t\t\t.put(\"replicate_on_write\", true).build());\n\n\t\t\tMutationBatch m = ksUsers.prepareMutationBatch();\n\n\t\t\tColumnListMutation<String> clm = m.withRow(cfUsers, rowKey);\n\n\t\t\tfor (int i = 0; i < userVisitsProduct.length; i++) {\n\t\t\t\tString user = (i + 1) + \"\";\n\t\t\t\tfor (String p : userVisitsProduct[i]) {\n\t\t\t\t\tString key = user + \":\" + p;\n\t\t\t\t\tclm.incrementCounterColumn(key, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tm.execute();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out\n\t\t\t\t\t.println(\"Ya existe el column family \" + columnFamilyName);\n\t\t}\n\n\t\t// Lectura de datos insertados.\n\t\tRowQuery<String, String> query = ksUsers.prepareQuery(cfUsers)\n\t\t\t\t.getKey(rowKey).autoPaginate(true);\n\n\t\tColumnList<String> columns = query.execute().getResult();\n\n\t\tfor (Column<String> c : columns) {\n\t\t\tString key = c.getName();\n\t\t\tLong value = c.getLongValue();\n\n\t\t\tString user = key.split(\":\")[0];\n\t\t\tString prod = key.split(\":\")[1];\n\n\t\t\tSystem.out.println(\"user \" + user + \" has visited product \" + prod\n\t\t\t\t\t+ \" \" + value + \" times\");\n\t\t}\n\n\t}", "public static void main(String[] args) {\n SparkConf sparkConf = new SparkConf().setAppName(\"basic log query\");\n JavaSparkContext sc = new JavaSparkContext(sparkConf);\n\n // create the logs RDD as JavaRDD<String>\n JavaRDD<String> logs = null;\n if (args.length == 1) {\n logs = sc.textFile(args[0]);\n }\n else {\n logs = sc.parallelize(EXAMPLE_LOGS);\n }\n\n // extract all essential log data\n JavaPairRDD<Tuple3<String, String, String>, LogStatistics> extracted = \n logs.mapToPair(new PairFunction<String, Tuple3<String, String, String>, LogStatistics>() {\n @Override\n public Tuple2<Tuple3<String, String, String>, LogStatistics> call(String logRecord) {\n String[] tokens = logRecord.split(\",\");\n Tuple3<String, String, String> key = createKey(tokens);\n LogStatistics value = createLogStatistics(tokens);\n return new Tuple2<Tuple3<String, String, String>, LogStatistics>(key, value);\n }\n });\n \n // filter the ones where userID is undefined\n JavaPairRDD<Tuple3<String, String, String>, LogStatistics> filtered = \n extracted.filter(new Function<\n Tuple2<Tuple3<String, String, String>, LogStatistics>, \n Boolean\n >() {\n public Boolean call(Tuple2<Tuple3<String, String, String>, LogStatistics> s) { \n Tuple3<String, String, String> t3 = s._1;\n return (t3._1() != null); // exclude Tuple3(null,null,null)\n }\n });\n\n // reduce by key\n JavaPairRDD<Tuple3<String, String, String>, LogStatistics> counts = \n filtered.reduceByKey(new Function2<LogStatistics, LogStatistics, LogStatistics>() {\n @Override\n public LogStatistics call(LogStatistics stats, LogStatistics stats2) {\n return stats.merge(stats2);\n }\n });\n\n // emit final output\n List<Tuple2<Tuple3<String, String, String>, LogStatistics>> output = counts.collect();\n for (Tuple2<?,?> t : output) {\n System.out.println(t._1() + \"\\t\" + t._2());\n }\n \n // done\n sc.stop();\n System.exit(0);\n }", "public static void main(String[] args) throws Exception {\n final StreamExecutionEnvironment env =\n StreamExecutionEnvironment.getExecutionEnvironment();\n\n env.setRestartStrategy(RestartStrategies.fixedDelayRestart(1000, 1000));\n env.enableCheckpointing(1000);\n env.setParallelism(1);\n env.disableOperatorChaining();\n\n boolean useEventTime = true;\n if(useEventTime){\n env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime);\n }\n\n // Data Processor\n // Kafka consumer properties\n Properties kafkaProperties = new Properties();\n kafkaProperties.setProperty(\"bootstrap.servers\", \"localhost:9092\");\n kafkaProperties.setProperty(\"group.id\", \"oscon-demo-group\");\n\n // Create Kafka Consumer\n FlinkKafkaConsumer09<KeyedDataPoint<Double>> kafkaConsumer =\n new FlinkKafkaConsumer09<>(\"sensors\", new DataPointSerializationSchema(), kafkaProperties);\n\n // Add it as a source\n SingleOutputStreamOperator<KeyedDataPoint<Double>> sensorStream = env.addSource(kafkaConsumer);\n\n if(useEventTime){\n sensorStream = sensorStream.assignTimestampsAndWatermarks(new SensorDataWatermarkAssigner());\n }\n\n // Write this sensor stream out to InfluxDB\n sensorStream\n .addSink(new InfluxDBSink<>(\"sensors\"));\n\n // Compute a windowed sum over this data and write that to InfluxDB as well.\n sensorStream\n .keyBy(\"key\")\n .timeWindow(Time.seconds(1))\n .sum(\"value\")\n .addSink(new InfluxDBSink<>(\"summedSensors\"));\n\n // execute program\n env.execute(\"OSCON Example\");\n }", "public void setup(){\n this.cluster = Cluster.builder().addContactPoint(\"127.0.0.1\").build();\n this.session = this.cluster.connect(\"demo\");\n }", "public static void main(String args[]) throws Exception\n\t{\n\t\tLogger.getLogger(\"org.apache\").setLevel(Level.OFF);\t\n\t\t//This part is the initialization of the spark context . I have given the app name as \"CountTemperature\" and set the master to \n\t\t//Local as it os running locally.\n\t\tSparkConf sparkConf = new SparkConf().setAppName(\"TwitterAnalysis\").setMaster(\"local[4]\").set(\"spark.executor.memory\",\n\t\t\t\t\"1g\");\n\n\t\t//To connect to my developer twitter account I have set up the keys in system property to connect\n\t\tSystem.setProperty(\"twitter4j.oauth.consumerKey\", \"*********************\");\n\t\tSystem.setProperty(\"twitter4j.oauth.consumerSecret\", \"**************************\");\n\t\tSystem.setProperty(\"twitter4j.oauth.accessToken\", \"*********\");\n\t\tSystem.setProperty(\"twitter4j.oauth.accessTokenSecret\", \"*********\");\n\t\t\n\t\t//Here I am initiating the Javastreamingcotext saying that the context duration will be of 1 second\n\t\tJavaStreamingContext ssc = new JavaStreamingContext(sparkConf, new Duration(1000));\n\t\t//Here I am initiating the a DStream which is representing a stream of tweet data in that window duration\n\t\tJavaDStream<Status> tweets = TwitterUtils.createStream(ssc);\n\n\t\t//This part is the Dstream of String which will hold the text of every tweet Dstream and mapping it so that I can get the i\n\t\t//individual tweets text.\n\t\tJavaDStream<String> statuses = tweets.map(\n\n\t\t\t\tx ->x .getText()\n\t\t\t\t);\n\n\t\t// print first 10 records in each RDD in a DStream\n\t\t//If you want to print more than 10 tweets please specifiy the number to be printed\n\t\tstatuses.print();\n\n\t\t//This is Dstream of type integers which holds the number of words per tweet. This is based on the space splitting and taking the \n\t\t//size of the number of the data in the array where the words are stored\n\t\tJavaDStream<Integer> words1 = tweets.map(\n\n\t\t\t\tx -> Arrays.asList(x.getText().split(\" \")).size());\n\n\t\twords1.print();\n\t\t\n\t\t//This is Dstream of type integers which holds the number of words per tweet. This is based on the space splitting and taking the \n\t\t//size of the number of the data in the array where the words are stored\n\t\tJavaDStream<Integer> characters1 = tweets.map(\n\n\t\t\t\tx -> Arrays.asList(x.getText().split(\"\")).size());\n\n\t\tcharacters1.print();\n\n\t\t \n\n\t\t//This part is to get the hashtags. To do this we have checked the wors of the text of the tweets and checked the words which\n\t\t//has been started with '#'\n\t\tJavaDStream<String> wordsTotal = statuses.flatMap((String x) -> Arrays.asList(x.split(\" \")).iterator());\n\t\tJavaDStream<String> hashtagsTotal = wordsTotal.filter(x -> x.startsWith(\"#\"));\n\t\thashtagsTotal.print();\n\t\t//This is the part which is getting the average number of words per tweet. We are getting by dividing the total number of words\n\t\t//and total number of tweets\n\t\tstatuses.foreachRDD(f ->\n\t\t{\n\t\t\tif(f.count()>0)\n\t\t\t{\n\t\t\t\tJavaRDD<String> words5 = f.flatMap((String x) -> Arrays.asList(x.split(\" \")).iterator());\n\t\t\t\tLong countstatus = f.count();\n\t\t\t\t//System.out.println(countstatus);\n\t\t\t\tSystem.out.println(\"Average Number of Words per tweet is : \" +words5.count()/countstatus);\n\t\t\t}\n\n\t\t}\n\t\t\t\t);\n\t\t\n\t\t//This is the part which is getting the average number of chracters per tweet. We are getting by dividing the total number of words\n\t\t//and total number of tweets\n\n\t\tstatuses.foreachRDD(f ->\n\t\t{\n\t\t\tif(f.count()>0)\n\t\t\t{\n\t\t\t\tJavaRDD<String> words6 = f.flatMap((String x) -> Arrays.asList(x.split(\"\")).iterator());\n\t\t\t\tlong countstatus = f.count();\n\t\t\t\tSystem.out.println(\"Average Number of characters per tweet is : \" +words6.count()/countstatus);\n\t\t\t}\n\n\t\t}\n\t\t\t\t);\n\n\n\n\t\t//This is the part which gives the top 10 hastags in the tweets stream. We are first reducing the data with the number\n\t\t//counts. Then mapping as pair. Then it is getting sorted taking the number of counts as key.\n\t\tJavaPairDStream<String, Integer> ones = hashtagsTotal.mapToPair((String s) -> new Tuple2<String, Integer>(s, 1));\n\t\tJavaPairDStream<String, Integer> counts = ones.reduceByKey((Integer i1, Integer i2) -> i1 + i2);\n\n\t\tJavaPairDStream<Integer, String> swappedCounts = counts.map(f -> f.swap()).mapToPair(x -> new Tuple2<Integer, String>(x._1(),x._2()));\n\t\tJavaPairDStream<Integer, String> sortedCounts =swappedCounts.transformToPair(\n\t\t\t\tnew Function<JavaPairRDD<Integer, String>, JavaPairRDD<Integer, String>>() {\n\t\t\t\t\tpublic JavaPairRDD<Integer, String> call(JavaPairRDD<Integer, String> in) throws Exception {\n\t\t\t\t\t\treturn in.sortByKey(false);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\n\t\tsortedCounts.foreachRDD(f ->\n\t\t{\n\n\t\t\tif(f.count()>0)\n\t\t\t{\n\t\t\t\tJavaPairRDD<Integer, String> topList = f;\n\t\t\t\tString out = \"\\nTop 10 hashtags:\\n\";\n\t\t\t\tfor (Tuple2<Integer, String> t : topList.take(10)) {\n\t\t\t\t\tout = out + t.toString() + \"\\n\";\n\t\t\t\t}\n\t\t\t\tSystem.out.println(out);\n\t\t\t}\n\t\t});\n\t\t\n\t\t//This s the tweets Dstream of texts base don the window size .\n\t\tJavaDStream<String> statuseswithWindow = statuses.window(new Duration(60 * 5 * 1000), new Duration(30 * 1000));\n\t\t//This is the part which is getting the average number of words per tweet. We are getting by dividing the total number of words\n\t\t//and total number of tweets. Only thing is we have given the wins=dow size and time spam now according to question.\n\t\tstatuseswithWindow.foreachRDD(f ->\n\t\t{\n\t\t\tif(f.count()>0)\n\t\t\t{\n\t\t\t\tJavaRDD<String> words5 = f.flatMap((String x) -> Arrays.asList(x.split(\" \")).iterator());\n\t\t\t\tLong countstatus = f.count();\n\t\t\t\tSystem.out.println(countstatus);\n\t\t\t\tSystem.out.println(\"Average Number of Words per tweet is : \" +words5.count()/countstatus);\n\t\t\t}\n\n\t\t}\n\t\t\t\t);\n\t\t\n\t\t//This is the part which is getting the average number of characters per tweet. We are getting by dividing the total number of words\n\t\t//and total number of tweets. Only thing is we have given the wins=dow size and time spam now according to question.\n\n\t\tstatuseswithWindow.foreachRDD(f ->\n\t\t{\n\t\t\tif(f.count()>0)\n\t\t\t{\n\t\t\t\tJavaRDD<String> words6 = f.flatMap((String x) -> Arrays.asList(x.split(\"\")).iterator());\n\t\t\t\tlong countstatus = f.count();\n\t\t\t\tSystem.out.println(\"Average Number of characters per tweet is : \" +words6.count()/countstatus);\n\t\t\t}\n\n\t\t}\n\t\t\t\t);\n\t\t\n\t\t\n\n\t\t//This is the part which gives the top 10 hastags in the tweets stream. We are first reducing the data with the number\n\t\t//counts. Then mapping as pair. Then it is getting sorted taking the number of counts as key.Only thing is we are setting the window\n\t\t//Value now as per the question \n\t\tJavaPairDStream<String, Integer> countsWithWindow = ones.reduceByKeyAndWindow((Integer i1, Integer i2) -> i1 + i2\n\t\t\t\t, new Duration(60 * 5 * 1000),\n\t\t\t\tnew Duration(30 * 1000));\n\n\t\tJavaPairDStream<Integer, String> swappedCountsWithWindow = countsWithWindow.map(f -> f.swap()).mapToPair(x -> new Tuple2<Integer, String>(x._1(),x._2()));\n\t\tJavaPairDStream<Integer, String> sortedCountsWithWindow =swappedCountsWithWindow.transformToPair(\n\t\t\t\tnew Function<JavaPairRDD<Integer, String>, JavaPairRDD<Integer, String>>() {\n\t\t\t\t\tpublic JavaPairRDD<Integer, String> call(JavaPairRDD<Integer, String> in) throws Exception {\n\t\t\t\t\t\treturn in.sortByKey(false);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\tsortedCountsWithWindow.foreachRDD(f ->\n\n\t\t{\n\t\t\tif(f.count()>0)\n\t\t\t{\n\t\t\t\tJavaPairRDD<Integer, String> topList = f;\n\t\t\t\tString out = \"\\nTop 10 hashtags for the window size mentioned:\\n\";\n\t\t\t\tfor (Tuple2<Integer, String> t : topList.take(10)) {\n\t\t\t\t\tout = out + t.toString() + \"\\n\";\n\t\t\t\t}\n\t\t\t\tSystem.out.println(out);\n\t\t\t}\n\n\t\t});\n\n\n\n\n\n\t\tssc.start();\n\t\tssc.awaitTermination();\n\n\t}", "private DatabaseContext() {\r\n datastore = createDatastore();\r\n init();\r\n }", "@Override\n public boolean storeConsumer(consumer consumer)\n {\n \n boolean status = true;\n log.info(\"-------------------------------\");\n log.info(\"Using Hibernate Implementation\");\n log.info(\"-------------------------------\");\n log.info (\"storeConsumer - ConsumerSvcHibernateImpl.java\");\n consumer appdb = consumer;\n Transaction tx = null;\n Session session = fetchSession();\n log.info (\"fetched session\");\n \n try \n { \n tx = session.beginTransaction();\n log.info (\"beginTransaction\");\n session.save(appdb);\n log.info (\"session.saved\");\n log.info(\"consumer saved. Check database for data!\");\n tx.commit();\n }\n catch(Exception e)\n {\n if (session.getTransaction() != null) {\n session.getTransaction().rollback();\n log.error (e.getClass() + \": \" + e.getMessage(), e);\n }\n }\n finally{\n session.close(); // added this line to fix session closing\n }\n return status;\n }", "public void run() throws Exception {\n JsonObject jsonConfig = new JsonObject()\n .put(\"database.url\", \"jdbc:hsqldb:file:target/hsqldb;shutdown=true\");\n\n // Set up Vertx and database access\n Vertx vertx = Vertx.vertx();\n Config config = ConfigFrom.firstOf().custom(jsonConfig::getString).get();\n Builder dbb = DatabaseProviderVertx.pooledBuilder(vertx, config)\n .withSqlInExceptionMessages()\n .withSqlParameterLogging();\n\n // Set up a table with some data we can query later\n dbb.transact(db -> {\n db.get().dropTableQuietly(\"t\");\n new Schema().addTable(\"t\")\n .addColumn(\"pk\").primaryKey().table()\n .addColumn(\"message\").asString(80).schema().execute(db);\n\n db.get().toInsert(\"insert into t (pk,message) values (?,?)\")\n .argInteger(1).argString(\"Hello World!\").batch()\n .argInteger(2).argString(\"Goodbye!\").insertBatch();\n });\n\n // Start our server\n vertx.createHttpServer().requestHandler(request -> {\n Metric metric = new Metric(true);\n\n // Read the query parameter from the request\n String pkParam = request.getParam(\"pk\");\n if (pkParam == null) {\n // Probably a favicon or similar request we ignore for now\n request.response().setStatusCode(404).end();\n return;\n }\n int pk = Integer.parseInt(pkParam);\n\n // Lookup the message from the database\n dbb.transactAsync(db -> {\n // Note this part happens on a worker thread\n metric.checkpoint(\"worker\");\n String s = db.get().toSelect(\"select message from t where pk=?\").argInteger(pk).queryStringOrEmpty();\n metric.checkpoint(\"db\");\n return s;\n }, result -> {\n // Now we are back on the event loop thread\n metric.checkpoint(\"result\");\n request.response().bodyEndHandler(h -> {\n metric.done(\"sent\", request.response().bytesWritten());\n log.debug(\"Served request: \" + metric.getMessage());\n });\n if (result.succeeded()) {\n request.response().setStatusCode(200).putHeader(\"content-type\", \"text/plain\").end(result.result());\n } else {\n log.error(\"Returning 500 to client\", result.cause());\n request.response().setStatusCode(500).end();\n }\n });\n }).listen(8123, result ->\n log.info(\"Started server. Go to http://localhost:8123/?pk=1 or http://localhost:8123/?pk=2\")\n );\n\n // Attempt to do a clean shutdown on JVM exit\n Runtime.getRuntime().addShutdownHook(new Thread(() -> {\n log.debug(\"Trying to stop the server nicely\");\n try {\n synchronized (lock) {\n // First shutdown Vert.x\n vertx.close(h -> {\n log.debug(\"Vert.x stopped, now closing the connection pool\");\n synchronized (lock) {\n // Then shutdown the database pool\n dbb.close();\n log.debug(\"Server stopped\");\n lock.notify();\n }\n });\n lock.wait(30000);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }));\n }", "String getCassandraName();", "@SuppressWarnings(\"serial\")\n\tprivate static Dataset<Row> loadcuratedEvent(String curatedEvent) {\n\t\tconf.set(TableInputFormat.INPUT_TABLE, curatedEvent);\n\t\tconf.set(TableInputFormat.SCAN_COLUMN_FAMILY, DashboardUtils.curatedEvents_cf);\n\t\t\n\t\tString eventcols = DashboardUtils.curatedEvents_cf + \":rssFeed \" + DashboardUtils.curatedEvents_cf + \":title \" + DashboardUtils.curatedEvents_cf + \n\t\t\t\t\t\t\t\":link \" + DashboardUtils.curatedEvents_cf + \":description \" + DashboardUtils.curatedEvents_cf + \":categories \" +\n\t\t\t\t\t\t\tDashboardUtils.curatedEvents_cf + \":articleDate\";\n\t\t\n\t\tconf.set(TableInputFormat.SCAN_COLUMNS, eventcols);\n\t\tJavaPairRDD<ImmutableBytesWritable, Result> eventPairRDD = jsc.newAPIHadoopRDD(conf, TableInputFormat.class, ImmutableBytesWritable.class, Result.class);\n\t\t\n\t\t//logger.info(\"`````````````````````````````````````````````````````````````````````````````````` event:\" + curatedEvent);\n\t\tJavaRDD<DatasetBean> eventRDD = eventPairRDD.map(new Function<Tuple2<ImmutableBytesWritable,Result>, DatasetBean>() {\n\n\t\t\tpublic DatasetBean call(Tuple2<ImmutableBytesWritable, Result> arg0) throws Exception {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t//using the Datasetbean class object to load the data from events table into spark dataset\n\t\t\t\tResult r = arg0._2;\n\t\t\t\tDatasetBean databean = new DatasetBean();\t\t\t\n\t\t\t\tdatabean.setRssFeed(Bytes.toString(r.getValue(Bytes.toBytes(DashboardUtils.curatedEvents_cf), Bytes.toBytes(\"rssFeed\"))));\n\t\t\t\tdatabean.setTitle(Bytes.toString(r.getValue(Bytes.toBytes(DashboardUtils.curatedEvents_cf), Bytes.toBytes(\"title\"))));\n\t\t\t\tdatabean.setArticleLink(Bytes.toString(r.getValue(Bytes.toBytes(DashboardUtils.curatedEvents_cf), Bytes.toBytes(\"link\"))));\n\t\t\t\tdatabean.setDescription(Bytes.toString(r.getValue(Bytes.toBytes(DashboardUtils.curatedEvents_cf), Bytes.toBytes(\"description\"))));\n\t\t\t\tdatabean.setCategories(Bytes.toString(r.getValue(Bytes.toBytes(DashboardUtils.curatedEvents_cf), Bytes.toBytes(\"categories\"))));\n\t\t\t\tdatabean.setArticleDate(Bytes.toString(r.getValue(Bytes.toBytes(DashboardUtils.curatedEvents_cf), Bytes.toBytes(\"articleDate\"))));\n\t\t\t\t\n\t\t\t\treturn databean;\n\t\t\t}\n\t\t});\n\t\t\n\t\t//eventmap.put(curatedEvent, eventRDD.count());\n\t\tDataset<Row> eventdataset = sparkSession.createDataFrame(eventRDD, DatasetBean.class);\n\t\treturn eventdataset;\n\t}", "public static void prepDb(Configuration conf) throws Exception {\n\n Connection conn = null;\n Statement stmt = null;\n try {\n conn = getConnection(conf);\n stmt = conn.createStatement();\n stmt.execute(\"CREATE TABLE TXNS (\" +\n \" TXN_ID bigint PRIMARY KEY,\" +\n \" TXN_STATE char(1) NOT NULL,\" +\n \" TXN_STARTED bigint NOT NULL,\" +\n \" TXN_LAST_HEARTBEAT bigint NOT NULL,\" +\n \" TXN_USER varchar(128) NOT NULL,\" +\n \" TXN_HOST varchar(128) NOT NULL,\" +\n \" TXN_TYPE integer)\");\n\n stmt.execute(\"CREATE TABLE TXN_COMPONENTS (\" +\n \" TC_TXNID bigint NOT NULL REFERENCES TXNS (TXN_ID),\" +\n \" TC_DATABASE varchar(128) NOT NULL,\" +\n \" TC_TABLE varchar(128),\" +\n \" TC_PARTITION varchar(767),\" +\n \" TC_OPERATION_TYPE char(1) NOT NULL,\" +\n \" TC_WRITEID bigint)\");\n stmt.execute(\"CREATE TABLE COMPLETED_TXN_COMPONENTS (\" +\n \" CTC_TXNID bigint NOT NULL,\" +\n \" CTC_DATABASE varchar(128) NOT NULL,\" +\n \" CTC_TABLE varchar(128),\" +\n \" CTC_PARTITION varchar(767),\" +\n \" CTC_TIMESTAMP timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,\" +\n \" CTC_WRITEID bigint,\" +\n \" CTC_UPDATE_DELETE char(1) NOT NULL)\");\n stmt.execute(\"CREATE TABLE NEXT_TXN_ID (\" + \" NTXN_NEXT bigint NOT NULL)\");\n stmt.execute(\"INSERT INTO NEXT_TXN_ID VALUES(1)\");\n\n stmt.execute(\"CREATE TABLE TXN_TO_WRITE_ID (\" +\n \" T2W_TXNID bigint NOT NULL,\" +\n \" T2W_DATABASE varchar(128) NOT NULL,\" +\n \" T2W_TABLE varchar(256) NOT NULL,\" +\n \" T2W_WRITEID bigint NOT NULL)\");\n stmt.execute(\"CREATE TABLE NEXT_WRITE_ID (\" +\n \" NWI_DATABASE varchar(128) NOT NULL,\" +\n \" NWI_TABLE varchar(256) NOT NULL,\" +\n \" NWI_NEXT bigint NOT NULL)\");\n\n stmt.execute(\"CREATE TABLE MIN_HISTORY_LEVEL (\" +\n \" MHL_TXNID bigint NOT NULL,\" +\n \" MHL_MIN_OPEN_TXNID bigint NOT NULL,\" +\n \" PRIMARY KEY(MHL_TXNID))\");\n\n stmt.execute(\"CREATE TABLE HIVE_LOCKS (\" +\n \" HL_LOCK_EXT_ID bigint NOT NULL,\" +\n \" HL_LOCK_INT_ID bigint NOT NULL,\" +\n \" HL_TXNID bigint NOT NULL,\" +\n \" HL_DB varchar(128) NOT NULL,\" +\n \" HL_TABLE varchar(128),\" +\n \" HL_PARTITION varchar(767),\" +\n \" HL_LOCK_STATE char(1) NOT NULL,\" +\n \" HL_LOCK_TYPE char(1) NOT NULL,\" +\n \" HL_LAST_HEARTBEAT bigint NOT NULL,\" +\n \" HL_ACQUIRED_AT bigint,\" +\n \" HL_USER varchar(128) NOT NULL,\" +\n \" HL_HOST varchar(128) NOT NULL,\" +\n \" HL_HEARTBEAT_COUNT integer,\" +\n \" HL_AGENT_INFO varchar(128),\" +\n \" HL_BLOCKEDBY_EXT_ID bigint,\" +\n \" HL_BLOCKEDBY_INT_ID bigint,\" +\n \" PRIMARY KEY(HL_LOCK_EXT_ID, HL_LOCK_INT_ID))\");\n stmt.execute(\"CREATE INDEX HL_TXNID_INDEX ON HIVE_LOCKS (HL_TXNID)\");\n\n stmt.execute(\"CREATE TABLE NEXT_LOCK_ID (\" + \" NL_NEXT bigint NOT NULL)\");\n stmt.execute(\"INSERT INTO NEXT_LOCK_ID VALUES(1)\");\n\n stmt.execute(\"CREATE TABLE COMPACTION_QUEUE (\" +\n \" CQ_ID bigint PRIMARY KEY,\" +\n \" CQ_DATABASE varchar(128) NOT NULL,\" +\n \" CQ_TABLE varchar(128) NOT NULL,\" +\n \" CQ_PARTITION varchar(767),\" +\n \" CQ_STATE char(1) NOT NULL,\" +\n \" CQ_TYPE char(1) NOT NULL,\" +\n \" CQ_TBLPROPERTIES varchar(2048),\" +\n \" CQ_WORKER_ID varchar(128),\" +\n \" CQ_START bigint,\" +\n \" CQ_RUN_AS varchar(128),\" +\n \" CQ_HIGHEST_WRITE_ID bigint,\" +\n \" CQ_META_INFO varchar(2048) for bit data,\" +\n \" CQ_HADOOP_JOB_ID varchar(32))\");\n\n stmt.execute(\"CREATE TABLE NEXT_COMPACTION_QUEUE_ID (NCQ_NEXT bigint NOT NULL)\");\n stmt.execute(\"INSERT INTO NEXT_COMPACTION_QUEUE_ID VALUES(1)\");\n\n stmt.execute(\"CREATE TABLE COMPLETED_COMPACTIONS (\" +\n \" CC_ID bigint PRIMARY KEY,\" +\n \" CC_DATABASE varchar(128) NOT NULL,\" +\n \" CC_TABLE varchar(128) NOT NULL,\" +\n \" CC_PARTITION varchar(767),\" +\n \" CC_STATE char(1) NOT NULL,\" +\n \" CC_TYPE char(1) NOT NULL,\" +\n \" CC_TBLPROPERTIES varchar(2048),\" +\n \" CC_WORKER_ID varchar(128),\" +\n \" CC_START bigint,\" +\n \" CC_END bigint,\" +\n \" CC_RUN_AS varchar(128),\" +\n \" CC_HIGHEST_WRITE_ID bigint,\" +\n \" CC_META_INFO varchar(2048) for bit data,\" +\n \" CC_HADOOP_JOB_ID varchar(32))\");\n\n stmt.execute(\"CREATE TABLE AUX_TABLE (\" +\n \" MT_KEY1 varchar(128) NOT NULL,\" +\n \" MT_KEY2 bigint NOT NULL,\" +\n \" MT_COMMENT varchar(255),\" +\n \" PRIMARY KEY(MT_KEY1, MT_KEY2))\");\n\n stmt.execute(\"CREATE TABLE WRITE_SET (\" +\n \" WS_DATABASE varchar(128) NOT NULL,\" +\n \" WS_TABLE varchar(128) NOT NULL,\" +\n \" WS_PARTITION varchar(767),\" +\n \" WS_TXNID bigint NOT NULL,\" +\n \" WS_COMMIT_ID bigint NOT NULL,\" +\n \" WS_OPERATION_TYPE char(1) NOT NULL)\"\n );\n\n stmt.execute(\"CREATE TABLE REPL_TXN_MAP (\" +\n \" RTM_REPL_POLICY varchar(256) NOT NULL, \" +\n \" RTM_SRC_TXN_ID bigint NOT NULL, \" +\n \" RTM_TARGET_TXN_ID bigint NOT NULL, \" +\n \" PRIMARY KEY (RTM_REPL_POLICY, RTM_SRC_TXN_ID))\"\n );\n\n stmt.execute(\"CREATE TABLE MATERIALIZATION_REBUILD_LOCKS (\" +\n \" MRL_TXN_ID BIGINT NOT NULL, \" +\n \" MRL_DB_NAME VARCHAR(128) NOT NULL, \" +\n \" MRL_TBL_NAME VARCHAR(256) NOT NULL, \" +\n \" MRL_LAST_HEARTBEAT BIGINT NOT NULL, \" +\n \" PRIMARY KEY(MRL_TXN_ID))\"\n );\n\n try {\n stmt.execute(\"CREATE TABLE \\\"APP\\\".\\\"SEQUENCE_TABLE\\\" (\\\"SEQUENCE_NAME\\\" VARCHAR(256) NOT \" +\n\n \"NULL, \\\"NEXT_VAL\\\" BIGINT NOT NULL)\"\n );\n } catch (SQLException e) {\n if (e.getMessage() != null && e.getMessage().contains(\"already exists\")) {\n LOG.info(\"SEQUENCE_TABLE table already exist, ignoring\");\n } else {\n throw e;\n }\n }\n\n try {\n stmt.execute(\"CREATE TABLE \\\"APP\\\".\\\"NOTIFICATION_SEQUENCE\\\" (\\\"NNI_ID\\\" BIGINT NOT NULL, \" +\n\n \"\\\"NEXT_EVENT_ID\\\" BIGINT NOT NULL)\"\n );\n } catch (SQLException e) {\n if (e.getMessage() != null && e.getMessage().contains(\"already exists\")) {\n LOG.info(\"NOTIFICATION_SEQUENCE table already exist, ignoring\");\n } else {\n throw e;\n }\n }\n\n try {\n stmt.execute(\"CREATE TABLE \\\"APP\\\".\\\"NOTIFICATION_LOG\\\" (\\\"NL_ID\\\" BIGINT NOT NULL, \" +\n \"\\\"DB_NAME\\\" VARCHAR(128), \\\"EVENT_ID\\\" BIGINT NOT NULL, \\\"EVENT_TIME\\\" INTEGER NOT\" +\n\n \" NULL, \\\"EVENT_TYPE\\\" VARCHAR(32) NOT NULL, \\\"MESSAGE\\\" CLOB, \\\"TBL_NAME\\\" \" +\n \"VARCHAR\" +\n \"(256), \\\"MESSAGE_FORMAT\\\" VARCHAR(16))\"\n );\n } catch (SQLException e) {\n if (e.getMessage() != null && e.getMessage().contains(\"already exists\")) {\n LOG.info(\"NOTIFICATION_LOG table already exist, ignoring\");\n } else {\n throw e;\n }\n }\n\n stmt.execute(\"INSERT INTO \\\"APP\\\".\\\"SEQUENCE_TABLE\\\" (\\\"SEQUENCE_NAME\\\", \\\"NEXT_VAL\\\") \" +\n \"SELECT * FROM (VALUES ('org.apache.hadoop.hive.metastore.model.MNotificationLog', \" +\n \"1)) tmp_table WHERE NOT EXISTS ( SELECT \\\"NEXT_VAL\\\" FROM \\\"APP\\\"\" +\n \".\\\"SEQUENCE_TABLE\\\" WHERE \\\"SEQUENCE_NAME\\\" = 'org.apache.hadoop.hive.metastore\" +\n \".model.MNotificationLog')\");\n\n stmt.execute(\"INSERT INTO \\\"APP\\\".\\\"NOTIFICATION_SEQUENCE\\\" (\\\"NNI_ID\\\", \\\"NEXT_EVENT_ID\\\")\" +\n \" SELECT * FROM (VALUES (1,1)) tmp_table WHERE NOT EXISTS ( SELECT \" +\n \"\\\"NEXT_EVENT_ID\\\" FROM \\\"APP\\\".\\\"NOTIFICATION_SEQUENCE\\\")\");\n } catch (SQLException e) {\n try {\n conn.rollback();\n } catch (SQLException re) {\n LOG.error(\"Error rolling back: \" + re.getMessage());\n }\n\n // Another thread might have already created these tables.\n if (e.getMessage() != null && e.getMessage().contains(\"already exists\")) {\n LOG.info(\"Txn tables already exist, returning\");\n return;\n }\n\n // This might be a deadlock, if so, let's retry\n if (e instanceof SQLTransactionRollbackException && deadlockCnt++ < 5) {\n LOG.warn(\"Caught deadlock, retrying db creation\");\n prepDb(conf);\n } else {\n throw e;\n }\n } finally {\n deadlockCnt = 0;\n closeResources(conn, stmt, null);\n }\n }", "public DataBaseConnector()\n {\n dataSource = new SQLServerDataSource();\n dataSource.setServerName(\"EASV-DB2\");\n dataSource.setPortNumber(1433);\n dataSource.setDatabaseName(\"AutistMovies\");\n dataSource.setUser(\"CS2017A_15\");\n dataSource.setPassword(\"Bjoernhart1234\");\n }", "public void upload(JavaSparkContext jsc) throws IOException {\n int partitions = conf.getInt(PARTITIONS, 48);\n String docDelimiter = StringEscapeUtils.unescapeJava(conf.get(DOC_DELIMITER));\n\n /* load training data */\n List<String> resource = IOUtils\n .readLines(getClass().getClassLoader().getResourceAsStream(conf.get(TRAININGDATA_RESOURCE)));\n\n Broadcast<List<String>> broadcastRes = jsc.broadcast(resource);\n\n JavaPairRDD<String, Tuple2<String, String>> doc = jsc\n .parallelize(broadcastRes.value())\n .persist(StorageLevel.MEMORY_AND_DISK_SER_2())\n .repartition(partitions)\n .filter(line -> line.split(docDelimiter).length >= 2)\n .mapToPair(line -> new Tuple2<>(line.split(docDelimiter)[0],\n new Tuple2<>(line.split(docDelimiter)[1], line.split(docDelimiter)[2])));\n /* save */\n save(doc);\n }", "@KafkaListener(topics = \"product-info\", groupId = \"test\")\n public void listen(String message) {\n Gson gson = new Gson();\n Product product = productRepository.save(gson.fromJson(message,Product.class));\n logger.info(\"*=*=*>Saving product =+=+=+==>\" +product.toString());\n categorySync(product);\n\n\n }", "public static void main(String[] args) {\n Properties configs = new Properties();\r\n //commit\r\n // 환경 변수 설정\r\n configs.put(\"bootstrap.servers\", \"localhost:9092\");\t\t// kafka server host 및 port\r\n configs.put(\"session.timeout.ms\", \"10000\");\t\t\t\t// session 설정\r\n configs.put(\"group.id\", \"test191031\");\t\t\t\t\t// topic 설정\r\n configs.put(\"key.deserializer\", \"org.apache.kafka.common.serialization.StringDeserializer\");\t// key deserializer\r\n configs.put(\"value.deserializer\", \"org.apache.kafka.common.serialization.StringDeserializer\"); // value deserializer\r\n \r\n @SuppressWarnings(\"resource\")\r\n\t\tKafkaConsumer<String, String> consumer = new KafkaConsumer<>(configs);\t// consumer 생성\r\n consumer.subscribe(Arrays.asList(\"test191031\"));\t\t// topic 설정\r\n \r\n SimpleDateFormat format1 = new SimpleDateFormat ( \"yyyy-MM-dd HH:mm:ss\");\r\n\r\n while (true) {\t// 계속 loop를 돌면서 producer의 message를 띄운다.\r\n ConsumerRecords<String, String> records = consumer.poll(500);\r\n for (ConsumerRecord<String, String> record : records) {\r\n \t\r\n \tDate time = new Date();\r\n \tString time1 = format1.format(time);\r\n \t\r\n String s = record.topic();\r\n if (\"test191031\".equals(s)) {\r\n System.out.println(time1 + \" | \" + record.value());\r\n } else {\r\n throw new IllegalStateException(\"get message on topic \" + record.topic());\r\n\r\n }\r\n }\r\n }\r\n \r\n\t}", "DatabaseClient newStagingClient();", "DataSet sql(HiveContext context, String sql);", "public static void saveAndRead(SparkSession spark, Dataset<Row> flights) {\n flights.show();\n flights\n .write()\n .partitionBy(\"CARRIER\")\n .format(\"parquet\")\n .mode(SaveMode.Overwrite)\n .save(\"CARRIER.parquet\");\n\n flights.printSchema();\n\n Dataset<Row> parquetFileDF = spark.read().parquet(\"CARRIER.parquet\");\n parquetFileDF.printSchema();\n parquetFileDF.show(200);\n\n }", "public static void main(String[] args) {\n\t\tCluster cluster = CouchbaseCluster.create();\n\t\t// Open the default bucket and the \"beer-sample\" one\n\t\tBucket defaultBucket = cluster.openBucket();\n\t\t// Disconnect and clear all allocated resources\n\n\t\t/*JsonObject productJson = JsonObject.empty().put(\"name\", \"An ice sculpture\").put(\"price\", 12.50)\n\t\t\t\t.put(\"length\", 7.0).put(\"width\", 12.0).put(\"height\", 9.5)\n\t\t\t\t.put(\"description\", \"This product is not for sale\");\n\n\t\tJsonDocument productJsonToBeStored = JsonDocument.create(\"productKey\", productJson);\n\t\tJsonDocument productRecievedFromDB = defaultBucket.upsert(productJsonToBeStored);*/\n\t\t\n\t\t\n\n\t\tcluster.disconnect();\n\t}", "public static void main(String[] args) {\n String master = \"spark://10.211.55.101:7077\";\n SparkConf conf = new SparkConf()\n .setMaster(master)\n// .set(\"spark.driver.memory\", \"512m\")\n// .set(\"spark.worker.memory\", \"512m\")\n .set(\"spark.executor.memory\", \"1g\")\n// .set(\"spark.task.cpus\", \"2\")\n .set(\"spark.cores.max\", \"3\")\n .setAppName(\"Simple Application\");\n\n JavaSparkContext sc = new JavaSparkContext(conf);\n sc.addJar(\"target/SparkTraining-1.0-SNAPSHOT.jar\");\n\n// JavaRDD<String> rdd = sc.textFile(\"file:///home/pi/raspberry/Notes.txt\");\n// JavaPairRDD<String, Integer> reducedRDD = rdd.flatMap(s -> Arrays.asList(s.split(\"\\\\s+\")))\n// .mapToPair(s -> new Tuple2<>(s, 1))\n// .reduceByKey((a, b) -> a + b);\n// System.out.println(reducedRDD.take(10));\n\n JavaRDD<String> rdd = sc.parallelize(Arrays.asList(\n \"//vagrant/raspberry/Notes.txt\",\n \"/vagrant/raspberry/run-hadoop.sh\",\n \"/vagrant/raspberry/run-hadoop.sh\"));\n// rdd = rdd.repartition(2);\n List<String> collect = rdd.map(new ClusterExecutor()).collect();\n System.out.println(collect);\n }", "public static void main(String[] args) {\n String bootstrapServer = \"localhost:6667\";\n String kafkaTopic = \"test_topic\";\n\n /*\n * Use file:// if your file is in local filesystem\n * Remove file:// or use hdfs:// if your file is in HDFS\n */\n String filePath = \"file:///home/malik/humidity.json\";\n\n // Instantiate spark without config because spark config will be set in running command\n SparkSession sparkSession = SparkSession.builder()\n .appName(\"ProducerTest\")\n .getOrCreate();\n\n JavaSparkContext sparkContext = new JavaSparkContext(sparkSession.sparkContext());\n\n kafkaProducer = new KafkaProducer<>(new KafkaConfig().producerConfig(bootstrapServer));\n\n // Read file then send the value to kafka\n sparkContext\n .textFile(filePath)\n .foreach(stringJSON -> {\n kafkaProducer.send(new ProducerRecord<>(kafkaTopic, stringJSON));\n });\n\n kafkaProducer.close();\n }", "public SparkSession createSparkSession() {\n logger.info(\"------ Create new SparkSession {} -------\", getProperty(\"master\"));\n\n if (null != SnappyContext.globalSparkContext()) {\n SparkSession.Builder sessionBuilder = SparkSession.builder().sparkContext(SnappyContext.globalSparkContext());\n SparkSession session = sessionBuilder.getOrCreate();\n return session;\n } else {\n //This is needed is user is using Snappydata interpreter without installing cluster\n String execUri = System.getenv(\"SPARK_EXECUTOR_URI\");\n conf.setAppName(getProperty(\"spark.app.name\"));\n\n conf.set(\"spark.repl.class.outputDir\", outputDir.getAbsolutePath());\n\n if (execUri != null) {\n conf.set(\"spark.executor.uri\", execUri);\n }\n\n if (System.getenv(\"SPARK_HOME\") != null) {\n conf.setSparkHome(System.getenv(\"SPARK_HOME\"));\n }\n\n conf.set(\"spark.scheduler.mode\", \"FAIR\");\n conf.setMaster(getProperty(\"master\"));\n\n Properties interpreterProperties = getProperties();\n\n for (Object k : interpreterProperties.keySet()) {\n String key = (String) k;\n String val = toString(interpreterProperties.get(key));\n if (!key.startsWith(\"spark.\") || !val.trim().isEmpty()) {\n logger.debug(String.format(\"SparkConf: key = [%s], value = [%s]\", key, val));\n conf.set(key, val);\n }\n }\n\n //Class SparkSession = ZeppelinIntpUtil.findClass(\"org.apache.spark.sql.SparkSession\");\n SparkSession.Builder builder = SparkSession.builder();\n builder.config(conf);\n\n sparkSession = builder.getOrCreate();\n\n return sparkSession;\n\n }\n\n }", "public ClientLibrary(Map<String, Integer> localServerIPAndPorts, String keyspace, ConsistencyLevel consistencyLevel)\n throws Exception\n {\n // if (logger.isTraceEnabled()) {\n // logger.trace(\"ClientLibrary(localServerIPAndPorts = {}, keyspace = {}, consistencyLevel = {})\", new Object[]{localServerIPAndPorts, keyspace, consistencyLevel});\n //}\n\n for (Entry<String, Integer> ipAndPort : localServerIPAndPorts.entrySet()) {\n String ip = ipAndPort.getKey();\n Integer port = ipAndPort.getValue();\n\n TTransport tFramedTransport = new TFramedTransport(new TSocket(ip, port));\n TProtocol binaryProtoOnFramed = new TBinaryProtocol(tFramedTransport);\n Cassandra.Client client = new Cassandra.Client(binaryProtoOnFramed);\n tFramedTransport.open();\n addressToClient.put(InetAddress.getByName(ip), client);\n\n TNonblockingTransport tNonblockingTransport = new TNonblockingSocket(ip, port);\n //TODO: 1 or many clientManagers?!?\n TAsyncClientManager clientManager = new TAsyncClientManager();\n Cassandra.AsyncClient asyncClient = new Cassandra.AsyncClient(new TBinaryProtocol.Factory(), clientManager, tNonblockingTransport);\n addressToAsyncClient.put(InetAddress.getByName(ip), asyncClient);\n\n // Set the keyspace for both synchronous and asynchronous clients\n client.set_keyspace(keyspace, LamportClock.sendTimestamp());\n\n BlockingQueueCallback<set_keyspace_call> callback = new BlockingQueueCallback<set_keyspace_call>();\n asyncClient.set_keyspace(keyspace, LamportClock.sendTimestamp(), callback);\n callback.getResponseNoInterruption();\n }\n\n String partitionerName = addressToClient.values().iterator().next().describe_partitioner();\n\n this.partitioner = FBUtilities.newPartitioner(partitionerName);\n\n Configuration conf = new Configuration();\n ConfigHelper.setOutputPartitioner(conf, partitionerName);\n ConfigHelper.setOutputInitialAddress(conf, localServerIPAndPorts.entrySet().iterator().next().getKey());\n ConfigHelper.setOutputRpcPort(conf, localServerIPAndPorts.entrySet().iterator().next().getValue().toString());\n ConfigHelper.setOutputColumnFamily(conf, keyspace, \"ColumnFamilyEntryIgnored\");\n this.ringCache = new RingCache(conf);\n\n this.consistencyLevel = consistencyLevel;\n }", "public void setup(){\n CassandraDriver driver = CassandraDriver.getInstance();\n ArrayList<byte[]> arr = driver.queryData(\"Forest\", \"tree\");\n\n ArrayList<RealDecisionTree> trees = new ArrayList<RealDecisionTree>();\n for (byte[] b : arr){\n trees.add(deserialize(b));\n }\n RandomForest forest = new RandomForest(trees, \"test\", new String[]{\"min, mav, avg, label\"});\n forest.TestForest(trees, forest.testdata);\n }", "public static void main(String[] args) throws Exception {\n\t\tfinal StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();\n\n Person person = new Person();\n person.setId(42);\n person.setName(\"Felix\");\n person.setEmail(\"[email protected]\");\n\n\n Properties properties = new Properties();\n properties.setProperty(\"bootstrap.servers\", kafkaPort);\n properties.setProperty(\"group.id\", topicId);\n //properties.setProperty(\"zookeeper.connect\", zkPort);\n properties.setProperty(\"batch.size\", \"0\");\n\n TypeInformation<Person> typeInfo = TypeExtractor.getForClass(Person.class);\n DataStream<Person> stream = env.fromCollection(Arrays.asList(person), typeInfo);\n stream.addSink(new FlinkKafkaProducer<Person>(topicId, ser, properties));\n\n DataStreamSource<Person> messageStream = env\n .addSource(new FlinkKafkaConsumer<Person>(topicId, deser, properties));\n messageStream.print();\n\n\n\n\t\t// execute program\n\t\tenv.execute(\"Flink Streaming Java API Skeleton\");\n\t}", "@Inject\r\n protected CassandraEmbBackend(final CassandraEmbConfig theConfig) {\r\n this.config = theConfig;\r\n startCluster();\r\n server = new CassandraServer();\r\n }", "private CassandraServer() {\n }", "DataStore getDataStore ();", "public interface KafkaService {\n\n /**\n * 发消息\n * @param topic 主题\n * @param obj 发送内容\n */\n boolean sendUserInfo(String topic, Object obj);\n}", "void connect(String servers) throws InterruptedException,\n ClassNotFoundException, SQLException {\n connection = DBConnection.getJDBCConnection(servers);\n\n periodicStatsContext = ((IVoltDBConnection) connection).createStatsContext();\n fullStatsContext = ((IVoltDBConnection) connection).createStatsContext();\n }", "public static void main(String[] args) {\n\t\tString DB_DRIVER = \"com.mysql.cj.jdbc.Driver\";\r\n\t\tString DB_URL = \"jdbc:mysql://192.168.150.128:3306/testdb\";\r\n\t\tString DB_USERNAME = \"lrjmysql\"; \r\n\t\tString DB_PASSWORD = \"Qwer.1234\";\r\n\t\t\r\n\t\t//创建连接池实例\r\n ComboPooledDataSource ds = new ComboPooledDataSource();\r\n try {\r\n \t//设置连接池连接数据库所需的驱动\r\n\t\t\tds.setDriverClass(DB_DRIVER);\r\n\t\t\t//设置连接数据库的URL\r\n\t\t\tds.setJdbcUrl(DB_URL);\r\n\t\t\t//设置接连数据库的用户名\r\n\t\t\tds.setUser(DB_USERNAME);\r\n\t\t\t//设置连接数据库的密码\r\n\t\t\tds.setPassword(DB_PASSWORD);\r\n\t\t\t//设置连接池的最大连接数\r\n\t\t\tds.setMaxPoolSize(40);\r\n\t\t\t//设置连接池的最小连接数\r\n\t\t\tds.setMinPoolSize(10);\r\n\t\t\t//设置连接池的初始连接数\r\n\t\t\tds.setInitialPoolSize(10);\r\n\t\t\t//设置连接池的缓存Statement的最大数\r\n\t\t\tds.setMaxStatements(180);\r\n\t\t\t//以上也可以通过新建一个配置文件,命名必须为c3p0-config.xml,\r\n\t\t\t//必须放在src目录下,c3p0包会默认加载src目录下的c3p0-config.xml文件。来实现相关设置\r\n\t\t\t//可参考 https://blog.csdn.net/qq_42035966/article/details/81332343\r\n\t\t\t\r\n\t\t\t//获取数据库连接\r\n\t\t\tConnection conn = ds.getConnection();\r\n\t\t\tSystem.out.println(\"获取数据库连接成功\");\r\n\t\t\t\r\n\t\t} catch (PropertyVetoException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n \r\n \r\n\t}", "public static SparkContext getSparkContex() {\n\t\tSparkConf conf = new SparkConf().setMaster(\"local\").setAppName(\n\t\t\t\t\"DQIntegrator\");\n\t\tLogger log = Logger.getLogger(\"org\");\n\t\tLogger log1 = Logger.getLogger(\"akka\");\n\t\tlog.setLevel(Level.WARN);\n\t\tlog1.setLevel(Level.WARN);\n\t\tconf.set(\"spark.driver.allowMultipleContexts\", \"true\");\n\t\tconf.set(\"spark.logConf\", \"true\");\n\t\tSparkContext sc = new SparkContext(conf);\n\t\treturn sc;\n\t}", "public static void start()\n throws Exception {\n\n LOG.info(\"Checking if the Cassandra server can be started\");\n\n // start the server only if there is not already a server running\n if (serverRunning.compareAndSet(false, true)) {\n\n try {\n LOG.info(\"Starting the Cassandra server\");\n EmbeddedCassandraServerHelper.startEmbeddedCassandra(20000L);\n Cluster cluster = new Cluster.Builder()\n .addContactPoint(HOST)\n .withPort(PORT)\n .build();\n\n session = cluster.connect();\n\n // create the key space\n LOG.info(\"Creating the Cassandra key space\");\n String[] createDb = new String[]{\n \"DROP KEYSPACE IF EXISTS \" + KEY_SPACE + \";\\n\",\n \"CREATE KEYSPACE \" + KEY_SPACE + \" WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor' : 1};\\n\",\n };\n\n try {\n for (String cql : createDb) {\n session.execute(cql);\n }\n } catch (Exception e) {\n LOG.error(\"The keyspace cannot be created on the Cassandra server\", e.getCause(), e.getStackTrace());\n }\n\n sessionWithKeyspace = cluster.connect(KEY_SPACE);\n keyspaceCreated.set(true);\n\n LOG.info(\"Cassandra server started\");\n } catch (IOException | TTransportException | InterruptedException e) {\n serverRunning.set(false);\n LOG.warn(\"Cassandra server not started due to error\");\n throw new Exception(e);\n }\n } else {\n LOG.info(\"Cassandra server already running\");\n }\n }", "public interface EntryStoreDb<K> {\n\n void serializeKey(final ByteBuffer keyBuffer, K key);\n\n /**\n * @param writeTxn\n * @param keyBuffer\n * @param valueBuffer\n * @param overwriteExisting\n * @param isAppending Only set to true if you are sure that the key will be at the end of the db\n * @return\n */\n PutOutcome put(final Txn<ByteBuffer> writeTxn,\n final ByteBuffer keyBuffer,\n final ByteBuffer valueBuffer,\n final boolean overwriteExisting,\n final boolean isAppending);\n\n boolean delete(final Txn<ByteBuffer> writeTxn, final ByteBuffer keyBuffer);\n\n Optional<ByteBuffer> getAsBytes(Txn<ByteBuffer> txn, final ByteBuffer keyBuffer);\n\n Optional<UID> getMaxUid(final Txn<ByteBuffer> txn, PooledByteBuffer pooledByteBuffer);\n}", "public static void main(String[] args) throws Exception {\n //加载bean\n String[] configLocations = new String[]{\"beans.xml\"};\n ClassPathXmlApplicationContext appContext\n = new ClassPathXmlApplicationContext(configLocations);\n SessionFactory sessionFactory = (SessionFactory)appContext.getBean(\"sessionFactory\");\n ComboPooledDataSource dataSource= (ComboPooledDataSource)appContext.getBean(\"dataSource\");\n// Properties properties = new Properties();\n// // 使用InPutStream流读取properties文件\n// BufferedReader bufferedReader = new BufferedReader(new FileReader(\"config/datasource.properties\"));\n// properties.load(bufferedReader);\n// // 获取key对应的value值\n// String driverClass = properties.getProperty(\"mysql.driverClassName\");\n// String jdbcUrl = properties.getProperty(\"mysql.url\");\n// String user = properties.getProperty(\"mysql.username\");\n// String password = properties.getProperty(\"mysql.password\");\n\n// dataSource.setDriverClass(driverClass);\n// dataSource.setJdbcUrl(driverClass);\n// dataSource.setUser(driverClass);\n// dataSource.setPassword(driverClass);\n Session session = sessionFactory.openSession();\n\n\n // session\n// Session session = sessionFactory;\n// User user = new User();\n// user.setName(\"lgd\");\n// user.setAge(22);\n// session.save(user);\n System.out.println(\"userInsert is done.\");\n ClearTable clearTable = JsonIO.getClearTable();\n Boolean single;\n String dept;\n if(clearTable.isAll()){\n single = false;\n dept = \"all\";\n } else if(clearTable.isSmt()){\n single = false;\n dept = \"smt\";\n } else if(clearTable.isDip()){\n single = false;\n dept = \"dip\";\n } else {\n single = true;\n dept = \"single\";\n }\n List<String> tableNameList = JsonIO.getTableNames(dept, single);\n StringBuilder allSingle = new StringBuilder();\n for(String tableName: tableNameList){\n String singleSQL = \"\";\n singleSQL = \"truncate table \" + tableName + \";\";\n Transaction ts = session.beginTransaction();\n Query query = session.createSQLQuery(singleSQL.toString());\n query.executeUpdate();\n ts.commit();\n }\n }", "public CMySQLDataStore(String Sname, int Pnumber) {\r\n \r\n MysqlDataSource objDs = new MysqlDataSource();\r\n\r\n objDs.setServerName(Sname);\r\n objDs.setPortNumber(Pnumber);\r\n \r\n objDs.setUser(CSettingManager.getSetting(\"DB_User\"));\r\n objDs.setPassword(CSettingManager.getSetting(\"DB_Pwd\"));\r\n objDs.setDatabaseName(CSettingManager.getSetting(\"DB_Database\"));\r\n\r\n ds = objDs;\r\n\r\n }", "public static void main(String[] args) throws Exception {\n //Used to build the topology\n TopologyBuilder builder = new TopologyBuilder();\n\n MongoClient mongo = new MongoClient(new ServerAddress(\"localhost\", 27017));\n final CreateCollectionOptions options = new CreateCollectionOptions();\n options.capped(true);\n options.sizeInBytes(10000);\n\n final MongoCollection coll = mongo.getDatabase(\"test\").getCollection(\"xdrs_crudos_reducida\");\n\n\n FrankestainAdapterSpout spout = new FrankestainAdapterSpout(\"localhost\", 27017, \"test\", \"xdrs_crudos_reducida\", new Document()) {\n\n private static final long serialVersionUID = 1L;\n\n @Override\n public void declareOutputFields(OutputFieldsDeclarer declarer) {\n\n declarer.declare(new Fields(\"id\"));\n }\n\n @Override\n public List<Object> dbObjectToStormTuple(Document document) {\n\n return tuple(document);\n }\n\n };\n // mongo.getDatabase(\"test\").createCollection(\"xdrs_crudos_reducida\", options);\n //mongo.dropDatabase(\"mongo_storm_tailable_cursor\");\n //Add the spout, with a name of 'spout'\n //and parallelism hint of 5 executors\n\n builder.setSpout(\"frank_spout\", spout);\n //builder.setSpout(\"frank_spout\", spout, 1);\n //Add the SplitSentence bolt, with a name of 'split'\n //and parallelism hint of 8 executors\n //shufflegrouping subscribes to the spout, and equally distributes\n //tuples (sentences) across instances of the SplitSentence bolt\n builder.setBolt(\"franktree_bolt_1\", new FrankestainTree()).shuffleGrouping(\"frank_spout\");\n // builder.setBolt(\"franktree_bolt_1\", new FrankestainTree(), 4).fieldsGrouping(\"frank_spout\", \"xdrs\", new Fields(\"fieldline\"));\n //builder.setBolt(\"franktree_bolt_1\", new FrankestainTree(), 1).shuffleGrouping(\"frank_spout\").shuffleGrouping(\"frankSpSons_bolt_7\");\n //Add the counter, with a name of 'count'\n //and parallelism hint of 12 executors\n //fieldsgrouping subscribes to the split bolt, and\n //ensures that the same word is sent to the same instance (group by field 'word')\n builder.setBolt(\"franksetint_bolt_2\", new FrankestainSetInterval()).shuffleGrouping(\"franktree_bolt_1\");\n/*\n builder.setBolt(\"franksearPM_bolt_3\", new FrankestainSearchPM(), 1).shuffleGrouping(\"franksetint_bolt_2\");\n\n builder.setBolt(\"frankIM_bolt_4\", new FrankestainIM(), 1).shuffleGrouping(\"franksearPM_bolt_3\");\n\n builder.setBolt(\"frankSwit_bolt_5\", new FrankestainSwitch(), 1).shuffleGrouping(\"frankIM_bolt_4\");\n\n builder.setBolt(\"frankSaGr_bolt_6\", new FrankestainSaveGroup(), 1).shuffleGrouping(\"frankSwit_bolt_5\");\n\n builder.setBolt(\"frankSpSons_bolt_7\", new FrankestainSplitSons(), 1).shuffleGrouping(\"frankSwit_bolt_5\").shuffleGrouping(\"franksearPM_bolt_3\");\n*/\n //new configuration\n Config conf = new Config();\n conf.setDebug(true);\n\n //If there are arguments, we are running on a cluster\n if (args != null && args.length > 0) {\n //parallelism hint to set the number of workers\n conf.setNumWorkers(3);\n //submit the topology\n StormSubmitter.submitTopology(args[0], conf, builder.createTopology());\n\n /*\n Manera de ejecutarlo modo remoto con StormSubmitter\n storm jar target/WordCount-1.0-SNAPSHOT.jar com.ayscom.example.WordCountTopology Mytopology_name\n */\n\n }\n //Otherwise, we are running locally\n else {\n //Cap the maximum number of executors that can be spawned\n //for a component to 3\n conf.setMaxTaskParallelism(3);\n //LocalCluster is used to run locally\n LocalCluster cluster = new LocalCluster();\n //submit the topology\n cluster.submitTopology(\"frankLocalTest\", conf, builder.createTopology());\n /*\n Manera de ejecutarlo manera local con LocalCluster, no se envia parametros.\n storm jar target/WordCount-1.0-SNAPSHOT.jar com.ayscom.example.WordCountTopology\n */\n //sleep\n Thread.sleep(5000);\n //shut down the cluster\n cluster.shutdown();\n }\n }", "DatabaseClient newJobDbClient();", "KTable<K, V> through(String topic, Serializer<K> keySerializer, Serializer<V> valSerializer, Deserializer<K> keyDeserializer, Deserializer<V> valDeserializer);", "public JavaRDD<MetricDto> readMetrics() {\n Date windowStartTime = DateUtil.getWindowStartTime();\n Date windowEndTime = DateUtil.getWindowEndTime();\n return CassandraJavaUtil.javaFunctions(sparkContext)\n .cassandraTable(\"hw2\", \"metric\", CassandraJavaUtil.mapRowTo(MetricDto.class))\n //Select only log message time and priority\n .select(\"id\", \"time\", \"value\")\n .where(\"time >= ? and time <= ?\", windowStartTime, windowEndTime);\n }", "private Conexao() {\r\n\t\ttry {\r\n\t\t\tconnection = DriverManager.getConnection(\"jdbc:hsqldb:mem:.\", \"sa\", \"\");\r\n\t\t\tnew LoadTables().creatScherma(connection);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(\"Erro ao conectar com o banco: \"+e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "<W extends V> DataCache<K, W> getCache(AvroTopic<K, W> topic);", "void init(Dataset ds, Session sess);", "public static void main(String[] args) {\n\n\t\t\n\t\tJavaSparkContext context = new JavaSparkContext(\"local[*]\", \"hello\");\n\t\tSparkSession session = SparkSession.builder().getOrCreate();\n\t\tjava.util.List<StructField> fields = new ArrayList<StructField>();\n\t\n\t\tStructType schema = DataTypes.createStructType(fields);\n\t\tDataset<Row> customer = session.read().option(\"delimiter\", \"|\").option(\"header\", true).csv(\"/home/student/DBDA_CHEATS/Hadoop/import-northwind-master/customers.csv\");\n\t\t\n\t\tlong cnt = customer.filter(new Column(\"Country\").equalTo(\"Brazil\")).count();\n\t\tSystem.out.println(\"Total\" +cnt);\n\t}", "public KafkaConfig() { }", "public KafkaAvroSerializer() {\n super();\n }", "public void connect() {\n\n DatabaseGlobalAccess.getInstance().setEmf(Persistence.createEntityManagerFactory(\"PU_dashboarddb\"));\n DatabaseGlobalAccess.getInstance().setEm(DatabaseGlobalAccess.getInstance().getEmf().createEntityManager());\n DatabaseGlobalAccess.getInstance().getDatabaseData();\n DatabaseGlobalAccess.getInstance().setDbReachable(true);\n }", "@Before\n public void setupDatabase() {\n graphDb = new TestGraphDatabaseFactory().newImpermanentDatabaseBuilder().newGraphDatabase();\n registerShutdownHook(graphDb);\n \n// server = new WrappingNeoServerBootstrapper((GraphDatabaseAPI) graphDb);\n// server.start();\n \n ProcessEngineConfiguration processEngineConfiguration = new ProcessEngineConfiguration();\n processEngineConfiguration.setGraphDatabaseService(graphDb);\n processEngine = processEngineConfiguration.buildProcessEngine();\n }", "public void performSourceMapReduce(JavaRDD<KeyValueObject<KEYIN, VALUEIN>> pInputs) {\n // if not commented out this line forces mappedKeys to be realized\n // pInputs = SparkUtilities.realizeAndReturn(pInputs,getCtx());\n JavaSparkContext ctx2 = SparkUtilities.getCurrentContext();\n System.err.println(\"Starting Score Mapping\");\n JavaPairRDD<K, Tuple2<K, V>> kkv = performMappingPart(pInputs);\n // kkv = SparkUtilities.realizeAndReturn(kkv, ctx2);\n\n// mappedKeys = mappedKeys.persist(StorageLevel.MEMORY_AND_DISK_2());\n// // if not commented out this line forces mappedKeys to be realized\n// mappedKeys = SparkUtilities.realizeAndReturn(mappedKeys, ctx2);\n//\n// // convert to tuples\n// // JavaPairRDD<K, Tuple2<K, V>> kkv = mappedKeys.mapToPair(new KeyValuePairFunction<K, V>());\n//\n// kkv = kkv.persist(StorageLevel.MEMORY_AND_DISK_2());\n// // if not commented out this line forces mappedKeys to be realized\n// kkv = SparkUtilities.realizeAndReturn(kkv, ctx2);\n\n // if not commented out this line forces kvJavaPairRDD to be realized\n // kkv = SparkUtilities.realizeAndReturn(kkv );\n\n System.err.println(\"Starting Score Reduce\");\n IReducerFunction reduce = getReduce();\n // for some reason the compiler thnks K or V is not Serializable\n JavaPairRDD<K, Tuple2<K, V>> kkv1 = kkv;\n\n // JavaPairRDD<? extends Serializable, Tuple2<? extends Serializable, ? extends Serializable>> kkv1 = (JavaPairRDD<? extends Serializable, Tuple2<? extends Serializable, ? extends Serializable>>)kkv;\n //noinspection unchecked\n JavaPairRDD<K, KeyAndValues<K, V>> reducedSets = (JavaPairRDD<K, KeyAndValues<K, V>>) KeyAndValues.combineByKey(kkv1);\n\n\n // if not commented out this line forces kvJavaPairRDD to be realized\n reducedSets = SparkUtilities.realizeAndReturn(reducedSets );\n\n PartitionAdaptor<K> prt = new PartitionAdaptor<K>(getPartitioner());\n reducedSets = reducedSets.partitionBy(prt);\n reducedSets = reducedSets.sortByKey();\n\n\n // if not commented out this line forces kvJavaPairRDD to be realized\n reducedSets = SparkUtilities.realizeAndReturn(reducedSets );\n\n ReduceFunctionAdaptor f = new ReduceFunctionAdaptor(ctx2, reduce);\n\n JavaRDD<KeyValueObject<KOUT, VOUT>> reducedOutput = reducedSets.flatMap(f);\n\n\n // JavaPairRDD<K, V> kvJavaPairRDD = asTuples.partitionBy(sparkPartitioner);\n\n // if not commented out this line forces kvJavaPairRDD to be realized\n //kvJavaPairRDD = SparkUtilities.realizeAndReturn(kvJavaPairRDD,getCtx());\n\n\n // if not commented out this line forces kvJavaPairRDD to be realized\n // reducedOutput = SparkUtilities.realizeAndReturn(reducedOutput, ctx2);\n\n output = reducedOutput;\n }", "public org.apache.spark.rdd.RDD<org.apache.spark.sql.catalyst.expressions.Row> toRdd () { throw new RuntimeException(); }", "public static void main(String[] args) throws MalformedURLException {\n HttpClient httpClient = new StdHttpClient.Builder() \n .url(\"http://localhost:5984\") \n .build(); \n //Connect to CouchDB instance\n CouchDbInstance dbInstance = new StdCouchDbInstance(httpClient);\n //Point to Person database\n CouchDbConnector db = dbInstance.createConnector(\"person\", true);\n //Student Object\n Student s = new Student();\n s.setFirstname(\"aoifes\");\n s.setSurname(\"sayers\");\n s.setEmail(\"[email protected]\");\n\n List<String> listOfIds = db.getAllDocIds();\n System.out.println(listOfIds);\n System.out.println(listOfIds.get(0));\n String firstStud = listOfIds.get(0);\n Student stud = db.get(Student.class, firstStud);\n System.out.println(stud.getTnumber());\n\n db.create((s));\n\n\n\n HttpClient httpClient1 = new StdHttpClient.Builder() \n .url(\"http://localhost:5984\") \n .build(); \n\n }", "public interface PersistenceFactory {\n /* Fields */\n\n /**\n * The property name for all classes stored at the column:row level to introspect the entity that contains the\n * properties persisted in a row's columns\n */\n String CLASS_PROPERTY = \"___class\";\n\n /* Misc */\n\n /**\n * Deletes columns by name from column family\n *\n * @param columnFamily the column family\n * @param key the key\n * @param columns the columns to be deleted by name\n */\n void deleteColumns(String columnFamily, String key, String... columns);\n\n /**\n * Executes a query\n *\n * @param expectedResult the result expected from the query execution\n * @param query the query\n * @param <T> the result type\n * @return the result\n */\n <T> T executeQuery(Class<T> expectedResult, Query query);\n\n /**\n * @param entityClass the class\n * @param key the id\n * @param <T> the entity type\n * @return an entity from the data store looked up by its id\n */\n <T> T get(Class<T> entityClass, String key);\n\n /**\n * Fetch a map of columns and their values\n *\n * @param columnFamily the column family\n * @param key the column family key\n * @param reversed if the order should be reversed\n * @param columns the column names\n * @return a map of columns and their values\n */\n Map<String, ByteBuffer> getColumns(String columnFamily, String key, boolean reversed, String... columns);\n\n /**\n * Fetch a map of columns and their values\n *\n * @param columnFamily the column family\n * @param key the column family key\n * @param limit of columns\n * @param reversed if the order should be reversed\n * @param fromColumn from column\n * @param toColumn to column\n * @return a map of columns and their values\n */\n Map<String, ByteBuffer> getColumns(String columnFamily, String key, int limit, boolean reversed, String fromColumn, String toColumn);\n\n /**\n * @return the default consistency level\n */\n ConsistencyLevel getDefaultConsistencyLevel();\n\n /**\n * @return the default keyspace\n */\n String getDefaultKeySpace();\n\n /**\n * @param entityClass the class type for this instance\n * @param <T> the type of class to be returned\n * @return an instance of this type after transformation of its accessors to notify the persistence context that there are ongoing changes\n */\n <T> T getInstance(Class<T> entityClass);\n\n /**\n * Obtains an entity key\n *\n * @param entity the entity\n * @return the key\n */\n String getKey(Object entity);\n\n /**\n * The list of managed class by this factory\n *\n * @return The list of managed class by this factory\n */\n List<Class<?>> getManagedClasses();\n\n /**\n * Get a list of entities given a query\n *\n * @param type the type of objects to expect back\n * @param query the query\n * @param <T> the result type\n * @return the list of entities\n */\n <T> List<T> getResultList(Class<T> type, Query query);\n\n /**\n * Get a single result from a CQL query\n *\n * @param type the type of objects to expect back\n * @param query the query\n * @param <T> the entity type\n * @return the resulting entity\n */\n <T> T getSingleResult(Class<T> type, Query query);\n\n /**\n * Inserts columns based on a map representing keys with properties and their corresponding values\n *\n * @param columnFamily the column family\n * @param key the column family key\n * @param keyValuePairs the map with keys and values\n */\n void insertColumns(String columnFamily, String key, Map<String, Object> keyValuePairs);\n\n /**\n * Entry point method to persist and arbitrary list of objects into the datastore\n *\n * @param entities the entities to be persisted\n */\n <T> void persist(T... entities);\n\n /**\n * @param entities the entities to be removed from the data store\n */\n <T> void remove(T... entities);\n \n /**\n * return cluster\n */\n Cluster getCluster(); \n}", "DBConnect() {\n \n }", "private void multipleSessionsWithJoin(SparkSession spark) {\n\n\t\tDataset<Row> empDataset = readEmployeeData(spark);\n\n\t\tlog.info(\"Spark Session old :: \" + spark);\n\n\t\tlog.info(\"Spark Context old :: \" + spark.sparkContext());\n\n\t\tSparkSession.clearActiveSession();\n\t\tSparkSession.clearDefaultSession();\n\n\t\tSparkSession newSession = SparkSession\n\t\t\t\t.builder()\n\t\t\t\t.appName(\"Spark New Session\")\n\t\t\t\t.config(\"spark.eventLog.enabled\", \"true\")\n\t\t\t\t.config(\"spark.driver.cores\", \"2\")\n\t\t\t\t.getOrCreate();\n\n\t\tSparkSession.setDefaultSession(newSession);\n\n\t\tDataset<Row> deptDataset = readDepartmentData(newSession);\n\n\t\tdeptDataset\n\t\t\t\t.join(\n\t\t\t\t\t\tempDataset,\n\t\t\t\t\t\tdeptDataset.col(\"deptno\").equalTo(empDataset.col(\"deptno\")),\n\t\t\t\t\t\t\"inner\"\n\t\t\t\t)\n\t\t\t\t.show();\n\n\t\tlog.info(\"Spark Session new :: \" + newSession);\n\n\t\tlog.info(\"Spark Context new :: \" + newSession.sparkContext());\n\n\t}", "public CommonDataServiceForAppsSink() {}", "public JavaRDD<SensorRecord> sampleAvroRead(JavaSparkContext sc, String hdfsAddress, Integer house_id) {\n\n // prepare SparkSession and set the compression codec\n SparkSession sparkSession = new SparkSession(sc.sc());\n sparkSession.conf().set(\"spark.sql.avro.compression.codec\", \"snappy\");\n\n\n // retrieving data\n // per-house data\n Dataset<Row> load = null;\n if (house_id != -1) {\n load = sparkSession.read()\n .format(\"com.databricks.spark.avro\")\n .load(\"hdfs://\" + hdfsAddress + \"/ingestNiFi/house\" + house_id + \"/d14_filtered.csv\");\n } else { // or all data\n load = sparkSession.read()\n .format(\"com.databricks.spark.avro\")\n .load(\"hdfs://\" + hdfsAddress + \"/ingestNiFi/d14_filtered.csv\");\n }\n\n // obtaining an RDD of sensor records\n JavaRDD<SensorRecord> sensorData = load.toJavaRDD().map(new Function<Row, SensorRecord>() {\n public SensorRecord call(Row row) throws Exception {\n // splitting csv line\n SensorRecord sr = new SensorRecord(\n (Long) row.getAs(\"id\"), //id_record\n (Long) row.getAs(\"timestamp\"), //timestamp\n (Double) row.getAs(\"value\"), //value - measure\n (Integer) row.getAs(\"property\"), //property - cumulative energy\n //or power snapshot\n (Long) row.getAs(\"plug_id\"), //plug_id\n (Long) row.getAs(\"household_id\"), //household_id\n (Long) row.getAs(\"house_id\")); //house_id\n return sr;\n }\n });\n\n /* DEBUG */\n// final LongAccumulator accumulator = sc.sc().longAccumulator();\n//\n// sensorData.foreach(new VoidFunction<SensorRecord>() {\n// public void call(SensorRecord sensorRecord) throws Exception {\n// accumulator.add(1);\n// }\n// });\n\n return sensorData;\n }", "private DataStaxConnection(String cassandraAddress, String keySpaceName) {\r\n\t\ttry {\r\n\t\t if (instance != null)\r\n\t\t return;\r\n\t\t \r\n\t\t this.address = cassandraAddress;\r\n\t\t this.keyspace = keySpaceName;\r\n\t\t \r\n\t\t Cluster.Builder builder = Cluster.builder();\r\n\t\t \r\n\t\t String[] clusterAddress = cassandraAddress.split(\",\");\r\n\t\t for (String nodeAddress: clusterAddress) {\r\n\t\t builder = builder.addContactPoint(nodeAddress);\r\n\t\t }\r\n\t\t \r\n\t\t\tthis.cluster = builder.build();\t\t\t\r\n\t\t\tLogService.appLog.debug(\"DataStaxConnection: Cluster build is successful\");\r\n\t\t\tthis.session = cluster.connect(keySpaceName);\r\n\t\t\tLogService.appLog.debug(\"DataStaxConnection: Session established successfully\");\r\n\t\t\tinstance = this;\r\n\t\t} catch (Exception e) {\r\n\t\t\tLogService.appLog.debug(\"DataStaxConnection: Encoutnered exception:\",e);\r\n\t\t\tthrow new RuntimeException(e);\r\n\t\t}\r\n\t}", "@Test\n public void testFacetPersistence() throws AnalyticsException {\n System.out.println(testString(\"START : Facet Persistence tester\"));\n final int INFO_MESSAGES = 10;\n final int ERROR_MESSAGES = 0;\n SparkAnalyticsExecutor ex = ServiceHolder.getAnalyticskExecutor();\n List<Record> records =\n generateRecords(1, \"Log\", System.currentTimeMillis(),\n ERROR_MESSAGES, INFO_MESSAGES);\n this.service.deleteTable(1, \"Log\");\n this.service.createTable(1, \"Log\");\n this.service.put(records);\n ex.executeQuery(1,\n \"CREATE TEMPORARY TABLE Log USING CarbonAnalytics \"\n + \"OPTIONS\"\n + \"(tableName \\\"Log\\\",\"\n + \" schema \\\"log_level STRING, message STRING, tenant INTEGER\\\"\"\n + \")\");\n\n ex.executeQuery(1,\n \"CREATE TEMPORARY TABLE facetTest USING CarbonAnalytics \"\n + \"OPTIONS\"\n + \"(tableName \\\"facetTest\\\",\"\n + \" schema \\\"log_level STRING, message STRING, tenant INTEGER, composite FACET -i\\\"\"\n + \")\");\n\n ex.executeQuery(1, \"INSERT INTO TABLE facetTest SELECT log_level,message,tenant,\" +\n \" facet2(tenant,log_level) from Log\");\n\n // testing the facet persistence\n AnalyticsQueryResult result = ex.executeQuery(1, \"SELECT * from facetTest where composite = '1,INFO'\");\n Assert.assertEquals(result.getRows().size(), INFO_MESSAGES);\n this.service.deleteTable(1, \"Log\");\n this.service.deleteTable(1, \"facetTest\");\n System.out.println(testString(\"END: Facet Persistence tester\"));\n }", "DatabaseClient newTraceDbClient();", "public static void main(String[] args) {\n StreamsConfig config = new StreamsConfig(AppConfiguration.getProperties(APP_ID));\n final Serde<String> stringSerde = Serdes.String();\n final Serde<Long> longSerde = Serdes.Long();\n\n // building Kafka Streams Model\n KStreamBuilder kStreamBuilder = new KStreamBuilder();\n\n Map<String, Object> serdeProps = new HashMap<>();\n\n // Commits\n final PojoJsonSerializer<GithubCommit> commitSerializer = new PojoJsonSerializer<>(\"GithubCommit\");\n serdeProps.put(\"GithubCommit\", GithubCommit.class);\n commitSerializer.configure(serdeProps, false);\n\n final Serde<GithubCommit> commitSerde = Serdes.serdeFrom(commitSerializer, commitSerializer);\n\n final KStream<String, GithubCommit> commitStream = kStreamBuilder.stream(stringSerde, commitSerde, \"commits\");\n\n final KTable<Windowed<String>, Long> countCommitsByAuthor = run(stringSerde, longSerde, commitStream);\n\n countCommitsByAuthor.print();\n\n System.out.println(\"Starting Kafka Streams Windowed KV Store Example\");\n KafkaStreams kafkaStreams = new KafkaStreams(kStreamBuilder, config);\n kafkaStreams.cleanUp();\n kafkaStreams.start();\n System.out.println(\"Now started Windowed KV Store Example\");\n }", "public ResultSet app(Long broker_id)throws SQLException {\n\trs=DbConnect.getStatement().executeQuery(\"select * from broker where broker_id=\"+broker_id+\"\");\r\n\treturn rs;\r\n}", "@Test public void buildManaged_persistentZone() {\n // Restart.\n Location loc = Location.create(ZONE_DIR);\n Zone zone = Zone.connect(loc);\n\n Quad q1 = SSE.parseQuad(\"(:g :s :p 1)\");\n Quad q2 = SSE.parseQuad(\"(:g :s :p 2)\");\n\n {\n DatasetGraph dsg = ManagedDatasetBuilder.create()\n .deltaLink(deltaLink)\n .logName(\"ABD\")\n .zone(zone)\n .syncPolicy(SyncPolicy.TXN_RW)\n .storageType(LocalStorageType.TDB2)\n .build();\n\n DeltaConnection conn = (DeltaConnection)(dsg.getContext().get(symDeltaConnection));\n Txn.executeWrite(dsg, ()->dsg.add(q1));\n Txn.executeRead( conn.getDatasetGraph(), ()->assertTrue(conn.getDatasetGraph().contains(q1)) );\n }\n\n // Same zone\n Zone.clearZoneCache();\n zone = Zone.connect(loc);\n // Storage should be recovered from the on-disk state.\n\n {\n DatasetGraph dsg1 = ManagedDatasetBuilder.create()\n .deltaLink(deltaLink)\n .logName(\"ABD\")\n .zone(zone)\n .syncPolicy(SyncPolicy.TXN_RW)\n //.storageType(LocalStorageType.TDB2) // Storage required. Should detect [FIXME]\n .build();\n DatasetGraph dsg2 = ManagedDatasetBuilder.create()\n .deltaLink(deltaLink)\n .logName(\"ABD\")\n .zone(zone)\n .syncPolicy(SyncPolicy.TXN_RW)\n //.storageType(LocalStorageType.TDB) // Wrong storage - does not matter; dsg1 setup choice applies\n .build();\n DeltaConnection conn1 = (DeltaConnection)(dsg1.getContext().get(symDeltaConnection));\n DeltaConnection conn2 = (DeltaConnection)(dsg2.getContext().get(symDeltaConnection));\n\n Txn.executeRead(conn1.getDatasetGraph(), ()->assertTrue(conn1.getDatasetGraph().contains(q1)) );\n Txn.executeWrite(conn2.getDatasetGraph(), ()->conn2.getDatasetGraph().add(q2));\n Txn.executeRead(conn1.getDatasetGraph(), ()->assertTrue(conn1.getDatasetGraph().contains(q2)) );\n }\n }", "@Override\n public Cassandra.Client getAPI() {\n return client;\n }", "private JsonObject callSpark(JsonObject o, String coords) {\n\t\t\r\n\t\tlong startTime = System.currentTimeMillis();\r\n\t\t\r\n\t\tString sparkMasterIp = context.getInitParameter(\"sparkMasterIp\");\r\n\t\tString cassandraIp = context.getInitParameter(\"cassandraIp\");\r\n\t\t\r\n\t\tString url = \"http://\"+sparkMasterIp+\":6066/v1/submissions/create\";\r\n\r\n\t\tString payload = \"{\"+\"\\\"action\\\" : \\\"CreateSubmissionRequest\\\",\"+\r\n \"\\\"appArgs\\\" : [ \\\"\"+coords+\"\\\", \\\"1\\\" ],\"+\r\n \"\\\"appResource\\\" : \\\"file:/job-dependencies/CVSTSparkJobEngine-0.0.1-SNAPSHOT.jar\\\",\"+\r\n \"\\\"clientSparkVersion\\\" : \\\"1.3.0\\\",\"+\r\n \"\\\"environmentVariables\\\" : {\"+\r\n \"\\\"SPARK_ENV_LOADED\\\" : \\\"1\\\"\"+\r\n \"},\"+\r\n \"\\\"mainClass\\\" : \\\"ca.yorku.ceras.cvstsparkjobengine.job.LegisJob\\\",\"+\r\n \"\\\"sparkProperties\\\" : {\"+\r\n\t\"\\\"spark.jars\\\" : \\\"file:/job-dependencies/CVSTSparkJobEngine-0.0.1-SNAPSHOT.jar\\\",\"+\r\n \"\\\"spark.driver.extraClassPath\\\" : \\\"file:/job-dependencies/RoaringBitmap-0.4.5.jar:file:/job-dependencies/activation-1.1.jar:file:/job-dependencies/akka-actor_2.10-2.2.3-shaded-protobuf.jar:file:/job-dependencies/akka-remote_2.10-2.2.3-shaded-protobuf.jar:file:/job-dependencies/akka-slf4j_2.10-2.2.3-shaded-protobuf.jar:file:/job-dependencies/apacheds-i18n-2.0.0-M15.jar:file:/job-dependencies/apacheds-kerberos-codec-2.0.0-M15.jar:file:/job-dependencies/api-asn1-api-1.0.0-M20.jar:file:/job-dependencies/api-util-1.0.0-M20.jar:file:/job-dependencies/asm-3.1.jar:file:/job-dependencies/asm-5.0.3.jar:file:/job-dependencies/asm-analysis-5.0.3.jar:file:/job-dependencies/asm-commons-5.0.3.jar:file:/job-dependencies/asm-tree-5.0.3.jar:file:/job-dependencies/asm-util-5.0.3.jar:file:/job-dependencies/avro-1.7.6-cdh5.3.0.jar:file:/job-dependencies/aws-java-sdk-1.7.14.jar:file:/job-dependencies/cassandra-clientutil-2.1.5.jar:file:/job-dependencies/cassandra-driver-core-2.1.10.jar:file:/job-dependencies/chill-java-0.5.0.jar:file:/job-dependencies/chill_2.10-0.5.0.jar:file:/job-dependencies/commons-beanutils-1.7.0.jar:file:/job-dependencies/commons-beanutils-core-1.8.0.jar:file:/job-dependencies/commons-cli-1.2.jar:file:/job-dependencies/commons-codec-1.7.jar:file:/job-dependencies/commons-collections-3.2.1.jar:file:/job-dependencies/commons-compress-1.4.1.jar:file:/job-dependencies/commons-configuration-1.6.jar:file:/job-dependencies/commons-daemon-1.0.13.jar:file:/job-dependencies/commons-digester-1.8.jar:file:/job-dependencies/commons-el-1.0.jar:file:/job-dependencies/commons-httpclient-3.1.jar:file:/job-dependencies/commons-io-2.4.jar:file:/job-dependencies/commons-lang-2.6.jar:file:/job-dependencies/commons-lang3-3.3.2.jar:file:/job-dependencies/commons-logging-1.1.1.jar:file:/job-dependencies/commons-math-2.1.jar:file:/job-dependencies/commons-math3-3.2.jar:file:/job-dependencies/commons-net-2.2.jar:file:/job-dependencies/compress-lzf-1.0.0.jar:file:/job-dependencies/config-1.0.2.jar:file:/job-dependencies/core-3.1.1.jar:file:/job-dependencies/curator-client-2.6.0.jar:file:/job-dependencies/curator-framework-2.4.0.jar:file:/job-dependencies/curator-recipes-2.4.0.jar:file:/job-dependencies/findbugs-annotations-1.3.9-1.jar:file:/job-dependencies/gson-2.4.jar:file:/job-dependencies/guava-16.0.1.jar:file:/job-dependencies/hadoop-annotations-2.5.0-cdh5.3.0.jar:file:/job-dependencies/hadoop-auth-2.5.0-cdh5.3.0.jar:file:/job-dependencies/hadoop-aws-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-client-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-common-2.5.0-cdh5.3.0.jar:file:/job-dependencies/hadoop-core-2.5.0-mr1-cdh5.3.0.jar:file:/job-dependencies/hadoop-hdfs-2.5.0-cdh5.3.0-tests.jar:file:/job-dependencies/hadoop-hdfs-2.5.0-cdh5.3.0.jar:file:/job-dependencies/hadoop-mapreduce-client-app-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-mapreduce-client-common-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-mapreduce-client-core-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-mapreduce-client-jobclient-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-mapreduce-client-shuffle-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-yarn-api-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-yarn-client-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-yarn-common-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-yarn-server-common-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hamcrest-core-1.3.jar:file:/job-dependencies/hbase-client-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-common-0.98.6-cdh5.3.0-tests.jar:file:/job-dependencies/hbase-common-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-hadoop-compat-0.98.6-cdh5.3.0-tests.jar:file:/job-dependencies/hbase-hadoop-compat-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-hadoop2-compat-0.98.6-cdh5.3.0-tests.jar:file:/job-dependencies/hbase-hadoop2-compat-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-prefix-tree-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-protocol-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-server-0.98.6-cdh5.3.0-tests.jar:file:/job-dependencies/hbase-server-0.98.6-cdh5.3.0.jar:file:/job-dependencies/high-scale-lib-1.1.1.jar:file:/job-dependencies/hsqldb-1.8.0.10.jar:file:/job-dependencies/htrace-core-2.04.jar:file:/job-dependencies/httpclient-4.1.2.jar:file:/job-dependencies/httpcore-4.1.2.jar:file:/job-dependencies/ivy-2.4.0.jar:file:/job-dependencies/jackson-annotations-2.2.3.jar:file:/job-dependencies/jackson-core-2.2.3.jar:file:/job-dependencies/jackson-core-asl-1.8.8.jar:file:/job-dependencies/jackson-databind-2.2.3.jar:file:/job-dependencies/jackson-jaxrs-1.8.8.jar:file:/job-dependencies/jackson-mapper-asl-1.8.8.jar:file:/job-dependencies/jackson-module-scala_2.10-2.2.3.jar:file:/job-dependencies/jackson-xc-1.7.1.jar:file:/job-dependencies/jamon-runtime-2.3.1.jar:file:/job-dependencies/jasper-compiler-5.5.23.jar:file:/job-dependencies/jasper-runtime-5.5.23.jar:file:/job-dependencies/java-xmlbuilder-0.4.jar:file:/job-dependencies/javax.servlet-3.0.0.v201112011016.jar:file:/job-dependencies/jaxb-api-2.1.jar:file:/job-dependencies/jaxb-impl-2.2.3-1.jar:file:/job-dependencies/jcl-over-slf4j-1.7.5.jar:file:/job-dependencies/jersey-client-1.9.jar:file:/job-dependencies/jersey-core-1.8.jar:file:/job-dependencies/jersey-json-1.8.jar:file:/job-dependencies/jersey-server-1.8.jar:file:/job-dependencies/jets3t-0.9.0.jar:file:/job-dependencies/jettison-1.1.jar:file:/job-dependencies/jetty-6.1.26.cloudera.4.jar:file:/job-dependencies/jetty-continuation-8.1.14.v20131031.jar:file:/job-dependencies/jetty-http-8.1.14.v20131031.jar:file:/job-dependencies/jetty-io-8.1.14.v20131031.jar:file:/job-dependencies/jetty-server-8.1.14.v20131031.jar:file:/job-dependencies/jetty-sslengine-6.1.26.cloudera.4.jar:file:/job-dependencies/jetty-util-6.1.26.cloudera.4.jar:file:/job-dependencies/jetty-util-8.1.14.v20131031.jar:file:/job-dependencies/jffi-1.2.10-native.jar:file:/job-dependencies/jffi-1.2.10.jar:file:/job-dependencies/jnr-constants-0.9.0.jar:file:/job-dependencies/jnr-ffi-2.0.7.jar:file:/job-dependencies/jnr-posix-3.0.27.jar:file:/job-dependencies/jnr-x86asm-1.0.2.jar:file:/job-dependencies/joda-convert-1.2.jar:file:/job-dependencies/joda-time-2.3.jar:file:/job-dependencies/jodd-core-3.6.3.jar:file:/job-dependencies/jsch-0.1.42.jar:file:/job-dependencies/json4s-ast_2.10-3.2.10.jar:file:/job-dependencies/json4s-core_2.10-3.2.10.jar:file:/job-dependencies/json4s-jackson_2.10-3.2.10.jar:file:/job-dependencies/jsp-2.1-6.1.14.jar:file:/job-dependencies/jsp-api-2.1-6.1.14.jar:file:/job-dependencies/jsp-api-2.1.jar:file:/job-dependencies/jsr166e-1.1.0.jar:file:/job-dependencies/jsr305-1.3.9.jar:file:/job-dependencies/jul-to-slf4j-1.7.5.jar:file:/job-dependencies/junit-4.11.jar:file:/job-dependencies/kryo-2.21.jar:file:/job-dependencies/leveldbjni-all-1.8.jar:file:/job-dependencies/log4j-1.2.17.jar:file:/job-dependencies/lz4-1.2.0.jar:file:/job-dependencies/mesos-0.21.0-shaded-protobuf.jar:file:/job-dependencies/metrics-core-2.2.0.jar:file:/job-dependencies/metrics-core-3.0.2.jar:file:/job-dependencies/metrics-core-3.1.0.jar:file:/job-dependencies/metrics-graphite-3.1.0.jar:file:/job-dependencies/metrics-json-3.1.0.jar:file:/job-dependencies/metrics-jvm-3.1.0.jar:file:/job-dependencies/minlog-1.2.jar:file:/job-dependencies/netty-3.9.0.Final.jar:file:/job-dependencies/netty-all-4.0.23.Final.jar:file:/job-dependencies/netty-buffer-4.0.33.Final.jar:file:/job-dependencies/netty-codec-4.0.33.Final.jar:file:/job-dependencies/netty-common-4.0.33.Final.jar:file:/job-dependencies/netty-handler-4.0.33.Final.jar:file:/job-dependencies/netty-transport-4.0.33.Final.jar:file:/job-dependencies/objenesis-1.2.jar:file:/job-dependencies/oro-2.0.8.jar:file:/job-dependencies/paranamer-2.3.jar:file:/job-dependencies/parquet-column-1.6.0rc3.jar:file:/job-dependencies/parquet-common-1.6.0rc3.jar:file:/job-dependencies/parquet-encoding-1.6.0rc3.jar:file:/job-dependencies/parquet-format-2.2.0-rc1.jar:file:/job-dependencies/parquet-generator-1.6.0rc3.jar:file:/job-dependencies/parquet-hadoop-1.6.0rc3.jar:file:/job-dependencies/parquet-jackson-1.6.0rc3.jar:file:/job-dependencies/protobuf-java-2.4.1-shaded.jar:file:/job-dependencies/protobuf-java-2.5.0.jar:file:/job-dependencies/py4j-0.8.2.1.jar:file:/job-dependencies/pyrolite-2.0.1.jar:file:/job-dependencies/quasiquotes_2.10-2.0.1.jar:file:/job-dependencies/reflectasm-1.07-shaded.jar:file:/job-dependencies/scala-compiler-2.10.4.jar:file:/job-dependencies/scala-library-2.10.4.jar:file:/job-dependencies/scala-reflect-2.10.5.jar:file:/job-dependencies/scalap-2.10.0.jar:file:/job-dependencies/scalatest_2.10-2.1.5.jar:file:/job-dependencies/servlet-api-2.5-6.1.14.jar:file:/job-dependencies/servlet-api-2.5.jar:file:/job-dependencies/slf4j-api-1.7.5.jar:file:/job-dependencies/slf4j-log4j12-1.7.5.jar:file:/job-dependencies/snappy-java-1.0.4.1.jar:file:/job-dependencies/spark-cassandra-connector-java_2.10-1.3.1.jar:file:/job-dependencies/spark-cassandra-connector_2.10-1.3.1.jar:file:/job-dependencies/spark-catalyst_2.10-1.3.0.jar:file:/job-dependencies/spark-core_2.10-1.3.0-cdh5.4.7.jar:file:/job-dependencies/spark-hbase-0.0.2-clabs.jar:file:/job-dependencies/spark-network-common_2.10-1.3.0-cdh5.4.7.jar:file:/job-dependencies/spark-network-shuffle_2.10-1.3.0-cdh5.4.7.jar:file:/job-dependencies/spark-sql_2.10-1.3.0.jar:file:/job-dependencies/spark-streaming_2.10-1.2.0-cdh5.3.0-tests.jar:file:/job-dependencies/spark-streaming_2.10-1.2.0-cdh5.3.0.jar:file:/job-dependencies/stream-2.7.0.jar:file:/job-dependencies/tachyon-0.5.0.jar:file:/job-dependencies/tachyon-client-0.5.0.jar:file:/job-dependencies/uncommons-maths-1.2.2a.jar:file:/job-dependencies/unused-1.0.0.jar:file:/job-dependencies/xmlenc-0.52.jar:file:/job-dependencies/xz-1.0.jar:file:/job-dependencies/zookeeper-3.4.5-cdh5.3.0.jar\\\",\"+\r\n\t\"\\\"spark.executor.extraClassPath\\\" : \\\"file:/job-dependencies/RoaringBitmap-0.4.5.jar:file:/job-dependencies/activation-1.1.jar:file:/job-dependencies/akka-actor_2.10-2.2.3-shaded-protobuf.jar:file:/job-dependencies/akka-remote_2.10-2.2.3-shaded-protobuf.jar:file:/job-dependencies/akka-slf4j_2.10-2.2.3-shaded-protobuf.jar:file:/job-dependencies/apacheds-i18n-2.0.0-M15.jar:file:/job-dependencies/apacheds-kerberos-codec-2.0.0-M15.jar:file:/job-dependencies/api-asn1-api-1.0.0-M20.jar:file:/job-dependencies/api-util-1.0.0-M20.jar:file:/job-dependencies/asm-3.1.jar:file:/job-dependencies/asm-5.0.3.jar:file:/job-dependencies/asm-analysis-5.0.3.jar:file:/job-dependencies/asm-commons-5.0.3.jar:file:/job-dependencies/asm-tree-5.0.3.jar:file:/job-dependencies/asm-util-5.0.3.jar:file:/job-dependencies/avro-1.7.6-cdh5.3.0.jar:file:/job-dependencies/aws-java-sdk-1.7.14.jar:file:/job-dependencies/cassandra-clientutil-2.1.5.jar:file:/job-dependencies/cassandra-driver-core-2.1.10.jar:file:/job-dependencies/chill-java-0.5.0.jar:file:/job-dependencies/chill_2.10-0.5.0.jar:file:/job-dependencies/commons-beanutils-1.7.0.jar:file:/job-dependencies/commons-beanutils-core-1.8.0.jar:file:/job-dependencies/commons-cli-1.2.jar:file:/job-dependencies/commons-codec-1.7.jar:file:/job-dependencies/commons-collections-3.2.1.jar:file:/job-dependencies/commons-compress-1.4.1.jar:file:/job-dependencies/commons-configuration-1.6.jar:file:/job-dependencies/commons-daemon-1.0.13.jar:file:/job-dependencies/commons-digester-1.8.jar:file:/job-dependencies/commons-el-1.0.jar:file:/job-dependencies/commons-httpclient-3.1.jar:file:/job-dependencies/commons-io-2.4.jar:file:/job-dependencies/commons-lang-2.6.jar:file:/job-dependencies/commons-lang3-3.3.2.jar:file:/job-dependencies/commons-logging-1.1.1.jar:file:/job-dependencies/commons-math-2.1.jar:file:/job-dependencies/commons-math3-3.2.jar:file:/job-dependencies/commons-net-2.2.jar:file:/job-dependencies/compress-lzf-1.0.0.jar:file:/job-dependencies/config-1.0.2.jar:file:/job-dependencies/core-3.1.1.jar:file:/job-dependencies/curator-client-2.6.0.jar:file:/job-dependencies/curator-framework-2.4.0.jar:file:/job-dependencies/curator-recipes-2.4.0.jar:file:/job-dependencies/findbugs-annotations-1.3.9-1.jar:file:/job-dependencies/gson-2.4.jar:file:/job-dependencies/guava-16.0.1.jar:file:/job-dependencies/hadoop-annotations-2.5.0-cdh5.3.0.jar:file:/job-dependencies/hadoop-auth-2.5.0-cdh5.3.0.jar:file:/job-dependencies/hadoop-aws-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-client-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-common-2.5.0-cdh5.3.0.jar:file:/job-dependencies/hadoop-core-2.5.0-mr1-cdh5.3.0.jar:file:/job-dependencies/hadoop-hdfs-2.5.0-cdh5.3.0-tests.jar:file:/job-dependencies/hadoop-hdfs-2.5.0-cdh5.3.0.jar:file:/job-dependencies/hadoop-mapreduce-client-app-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-mapreduce-client-common-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-mapreduce-client-core-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-mapreduce-client-jobclient-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-mapreduce-client-shuffle-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-yarn-api-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-yarn-client-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-yarn-common-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hadoop-yarn-server-common-2.6.0-cdh5.4.7.jar:file:/job-dependencies/hamcrest-core-1.3.jar:file:/job-dependencies/hbase-client-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-common-0.98.6-cdh5.3.0-tests.jar:file:/job-dependencies/hbase-common-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-hadoop-compat-0.98.6-cdh5.3.0-tests.jar:file:/job-dependencies/hbase-hadoop-compat-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-hadoop2-compat-0.98.6-cdh5.3.0-tests.jar:file:/job-dependencies/hbase-hadoop2-compat-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-prefix-tree-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-protocol-0.98.6-cdh5.3.0.jar:file:/job-dependencies/hbase-server-0.98.6-cdh5.3.0-tests.jar:file:/job-dependencies/hbase-server-0.98.6-cdh5.3.0.jar:file:/job-dependencies/high-scale-lib-1.1.1.jar:file:/job-dependencies/hsqldb-1.8.0.10.jar:file:/job-dependencies/htrace-core-2.04.jar:file:/job-dependencies/httpclient-4.1.2.jar:file:/job-dependencies/httpcore-4.1.2.jar:file:/job-dependencies/ivy-2.4.0.jar:file:/job-dependencies/jackson-annotations-2.2.3.jar:file:/job-dependencies/jackson-core-2.2.3.jar:file:/job-dependencies/jackson-core-asl-1.8.8.jar:file:/job-dependencies/jackson-databind-2.2.3.jar:file:/job-dependencies/jackson-jaxrs-1.8.8.jar:file:/job-dependencies/jackson-mapper-asl-1.8.8.jar:file:/job-dependencies/jackson-module-scala_2.10-2.2.3.jar:file:/job-dependencies/jackson-xc-1.7.1.jar:file:/job-dependencies/jamon-runtime-2.3.1.jar:file:/job-dependencies/jasper-compiler-5.5.23.jar:file:/job-dependencies/jasper-runtime-5.5.23.jar:file:/job-dependencies/java-xmlbuilder-0.4.jar:file:/job-dependencies/javax.servlet-3.0.0.v201112011016.jar:file:/job-dependencies/jaxb-api-2.1.jar:file:/job-dependencies/jaxb-impl-2.2.3-1.jar:file:/job-dependencies/jcl-over-slf4j-1.7.5.jar:file:/job-dependencies/jersey-client-1.9.jar:file:/job-dependencies/jersey-core-1.8.jar:file:/job-dependencies/jersey-json-1.8.jar:file:/job-dependencies/jersey-server-1.8.jar:file:/job-dependencies/jets3t-0.9.0.jar:file:/job-dependencies/jettison-1.1.jar:file:/job-dependencies/jetty-6.1.26.cloudera.4.jar:file:/job-dependencies/jetty-continuation-8.1.14.v20131031.jar:file:/job-dependencies/jetty-http-8.1.14.v20131031.jar:file:/job-dependencies/jetty-io-8.1.14.v20131031.jar:file:/job-dependencies/jetty-server-8.1.14.v20131031.jar:file:/job-dependencies/jetty-sslengine-6.1.26.cloudera.4.jar:file:/job-dependencies/jetty-util-6.1.26.cloudera.4.jar:file:/job-dependencies/jetty-util-8.1.14.v20131031.jar:file:/job-dependencies/jffi-1.2.10-native.jar:file:/job-dependencies/jffi-1.2.10.jar:file:/job-dependencies/jnr-constants-0.9.0.jar:file:/job-dependencies/jnr-ffi-2.0.7.jar:file:/job-dependencies/jnr-posix-3.0.27.jar:file:/job-dependencies/jnr-x86asm-1.0.2.jar:file:/job-dependencies/joda-convert-1.2.jar:file:/job-dependencies/joda-time-2.3.jar:file:/job-dependencies/jodd-core-3.6.3.jar:file:/job-dependencies/jsch-0.1.42.jar:file:/job-dependencies/json4s-ast_2.10-3.2.10.jar:file:/job-dependencies/json4s-core_2.10-3.2.10.jar:file:/job-dependencies/json4s-jackson_2.10-3.2.10.jar:file:/job-dependencies/jsp-2.1-6.1.14.jar:file:/job-dependencies/jsp-api-2.1-6.1.14.jar:file:/job-dependencies/jsp-api-2.1.jar:file:/job-dependencies/jsr166e-1.1.0.jar:file:/job-dependencies/jsr305-1.3.9.jar:file:/job-dependencies/jul-to-slf4j-1.7.5.jar:file:/job-dependencies/junit-4.11.jar:file:/job-dependencies/kryo-2.21.jar:file:/job-dependencies/leveldbjni-all-1.8.jar:file:/job-dependencies/log4j-1.2.17.jar:file:/job-dependencies/lz4-1.2.0.jar:file:/job-dependencies/mesos-0.21.0-shaded-protobuf.jar:file:/job-dependencies/metrics-core-2.2.0.jar:file:/job-dependencies/metrics-core-3.0.2.jar:file:/job-dependencies/metrics-core-3.1.0.jar:file:/job-dependencies/metrics-graphite-3.1.0.jar:file:/job-dependencies/metrics-json-3.1.0.jar:file:/job-dependencies/metrics-jvm-3.1.0.jar:file:/job-dependencies/minlog-1.2.jar:file:/job-dependencies/netty-3.9.0.Final.jar:file:/job-dependencies/netty-all-4.0.23.Final.jar:file:/job-dependencies/netty-buffer-4.0.33.Final.jar:file:/job-dependencies/netty-codec-4.0.33.Final.jar:file:/job-dependencies/netty-common-4.0.33.Final.jar:file:/job-dependencies/netty-handler-4.0.33.Final.jar:file:/job-dependencies/netty-transport-4.0.33.Final.jar:file:/job-dependencies/objenesis-1.2.jar:file:/job-dependencies/oro-2.0.8.jar:file:/job-dependencies/paranamer-2.3.jar:file:/job-dependencies/parquet-column-1.6.0rc3.jar:file:/job-dependencies/parquet-common-1.6.0rc3.jar:file:/job-dependencies/parquet-encoding-1.6.0rc3.jar:file:/job-dependencies/parquet-format-2.2.0-rc1.jar:file:/job-dependencies/parquet-generator-1.6.0rc3.jar:file:/job-dependencies/parquet-hadoop-1.6.0rc3.jar:file:/job-dependencies/parquet-jackson-1.6.0rc3.jar:file:/job-dependencies/protobuf-java-2.4.1-shaded.jar:file:/job-dependencies/protobuf-java-2.5.0.jar:file:/job-dependencies/py4j-0.8.2.1.jar:file:/job-dependencies/pyrolite-2.0.1.jar:file:/job-dependencies/quasiquotes_2.10-2.0.1.jar:file:/job-dependencies/reflectasm-1.07-shaded.jar:file:/job-dependencies/scala-compiler-2.10.4.jar:file:/job-dependencies/scala-library-2.10.4.jar:file:/job-dependencies/scala-reflect-2.10.5.jar:file:/job-dependencies/scalap-2.10.0.jar:file:/job-dependencies/scalatest_2.10-2.1.5.jar:file:/job-dependencies/servlet-api-2.5-6.1.14.jar:file:/job-dependencies/servlet-api-2.5.jar:file:/job-dependencies/slf4j-api-1.7.5.jar:file:/job-dependencies/slf4j-log4j12-1.7.5.jar:file:/job-dependencies/snappy-java-1.0.4.1.jar:file:/job-dependencies/spark-cassandra-connector-java_2.10-1.3.1.jar:file:/job-dependencies/spark-cassandra-connector_2.10-1.3.1.jar:file:/job-dependencies/spark-catalyst_2.10-1.3.0.jar:file:/job-dependencies/spark-core_2.10-1.3.0-cdh5.4.7.jar:file:/job-dependencies/spark-hbase-0.0.2-clabs.jar:file:/job-dependencies/spark-network-common_2.10-1.3.0-cdh5.4.7.jar:file:/job-dependencies/spark-network-shuffle_2.10-1.3.0-cdh5.4.7.jar:file:/job-dependencies/spark-sql_2.10-1.3.0.jar:file:/job-dependencies/spark-streaming_2.10-1.2.0-cdh5.3.0-tests.jar:file:/job-dependencies/spark-streaming_2.10-1.2.0-cdh5.3.0.jar:file:/job-dependencies/stream-2.7.0.jar:file:/job-dependencies/tachyon-0.5.0.jar:file:/job-dependencies/tachyon-client-0.5.0.jar:file:/job-dependencies/uncommons-maths-1.2.2a.jar:file:/job-dependencies/unused-1.0.0.jar:file:/job-dependencies/xmlenc-0.52.jar:file:/job-dependencies/xz-1.0.jar:file:/job-dependencies/zookeeper-3.4.5-cdh5.3.0.jar\\\",\"+\r\n \"\\\"spark.driver.supervise\\\" : \\\"false\\\",\"+\r\n \"\\\"spark.app.name\\\" : \\\"ca.yorku.ceras.cvstsparkjobengine.job.LegisJob\\\",\"+\r\n \"\\\"spark.eventLog.enabled\\\": \\\"false\\\",\"+\r\n \"\\\"spark.submit.deployMode\\\" : \\\"cluster\\\",\"+\r\n \"\\\"spark.master\\\" : \\\"spark://\"+sparkMasterIp+\":6066\\\",\"+\r\n\t\"\\\"spark.cassandra.connection.host\\\" : \\\"\"+cassandraIp+\"\\\",\"+\r\n \"\\\"spark.executor.cores\\\" : \\\"1\\\",\"+\r\n \"\\\"spark.cores.max\\\" : \\\"1\\\"\"+\r\n \"}\"+\r\n\"}'\";\r\n\t\t\r\n\t\tClient client = ClientBuilder.newClient();\r\n\t\tResponse response = client.target(url).request(MediaType.APPLICATION_JSON_TYPE).post(Entity.json(payload));\r\n\t\t\r\n\t\t// check response status code\r\n if (response.getStatus() != 200) {\r\n throw new RuntimeException(\"Failed : HTTP error code : \" + response.getStatus());\r\n }\r\n \r\n\t\tJsonReader reader = new JsonReader(new StringReader(response.readEntity(String.class)));\r\n\t\treader.setLenient(true);\r\n\t\tJsonObject jsonResponse = new JsonParser().parse(reader).getAsJsonObject();\r\n\t\t\r\n\t\tString submissionId = jsonResponse.get(\"submissionId\").getAsString();\r\n\t\t\r\n\t\turl = \"http://\"+sparkMasterIp+\":6066/v1/submissions/status/\" + submissionId;\r\n\t\t\r\n\t\tString status = \"\";\r\n\t\t\r\n\t\tint attempts = 0;\r\n\t\t\r\n\t\twhile (attempts < 600) {\t\t\t\r\n\t\t\tresponse = client.target(url).request(MediaType.APPLICATION_JSON_TYPE).get();\r\n\t\t\t\r\n\t\t\t// check response status code\r\n\t if (response.getStatus() != 200) {\r\n\t throw new RuntimeException(\"Failed : HTTP error code : \" + response.getStatus());\r\n\t }\r\n\t \r\n\t String result = response.readEntity(String.class);\r\n\t \r\n\t //System.out.println(\"RESULT: \" + result);\r\n\t \r\n\t if (result.contains(\"FINISHED\")) {\r\n\t \tstatus = \"FINISHED\";\r\n\t \tbreak;\r\n\t } else if (result.contains(\"FAILED\")) {\r\n\t \tstatus = \"FAILED\";\r\n\t \tbreak;\r\n\t }\r\n\t \r\n\t try {\r\n\t\t\t\tThread.sleep(1000);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t \r\n\t attempts++;\r\n\t\t}\r\n\t\t\r\n\t\tif (status.equals(\"\"))\r\n\t\t\tthrow new RuntimeException(\"Failed to retrieve Spark job status\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\treader.close();\r\n\t\t\tclient.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\tint cont = 0;\r\n\t\t\r\n\t\tfor (JsonElement route : o.get(\"routes\").getAsJsonArray()) {\r\n\t\t\tfor (JsonElement leg : route.getAsJsonObject().get(\"legs\").getAsJsonArray()) {\r\n\t\t\t\tfor (JsonElement step : leg.getAsJsonObject().get(\"steps\").getAsJsonArray()) {\r\n\t\t\t\t\tJsonObject stepObject = step.getAsJsonObject();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (status.equals(\"FINISHED\")) {\r\n\t\t\t\t\t\tstepObject.addProperty(\"score\", \"\"+SCORES[cont]);\r\n\t\t\t\t\t\tcont++;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tstepObject.addProperty(\"score\", \"FAILED\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tlong endTime = System.currentTimeMillis();\r\n\t\t\r\n\t\tServletContextInitializer.logger.info(\"TIME SPENT WITH SPARK: \" + (endTime-startTime) + \" milliseconds\");\r\n\t\t\r\n\t\treturn o;\r\n\t}", "public static void main(String... args) throws SQLException {\n new CreateCluster().runTool(args);\n }", "public KafkaBacksideEnvironment() {\n\t\tConfigPullParser p = new ConfigPullParser(\"kafka-props.xml\");\n\t\tproperties = p.getProperties();\n\t\tconnectors = new HashMap<String, IPluginConnector>();\n\t\t//chatApp = new SimpleChatApp(this);\n\t\t//mainChatApp = new ChatApp(this);\n\t\t//elizaApp = new ElizaApp(this);\n\t\tbootPlugins();\n\t\t//TODO other stuff?\n\t\tSystem.out.println(\"Booted\");\n\t\t//Register a shutdown hook so ^c will properly close things\n\t\tRuntime.getRuntime().addShutdownHook(new Thread() {\n\t\t public void run() { shutDown(); }\n\t\t});\n\t}" ]
[ "0.6696586", "0.6308521", "0.5783878", "0.572291", "0.5377468", "0.5362381", "0.5322494", "0.52574575", "0.5169701", "0.5162803", "0.51132464", "0.50916463", "0.5090302", "0.5037158", "0.50306636", "0.4972052", "0.49719727", "0.49650073", "0.49632132", "0.4956117", "0.4925552", "0.49248", "0.49225384", "0.4917527", "0.49133372", "0.49101454", "0.48681316", "0.4858356", "0.48264337", "0.48258084", "0.47891334", "0.4789104", "0.47880405", "0.47857958", "0.4784641", "0.47712478", "0.47605285", "0.4751533", "0.47410187", "0.47403046", "0.47395402", "0.47325632", "0.47198573", "0.471304", "0.4694866", "0.46908015", "0.46642578", "0.4661453", "0.46526337", "0.46465966", "0.46270278", "0.46252385", "0.462402", "0.46166953", "0.46094075", "0.46071357", "0.4603347", "0.45978263", "0.4586756", "0.45825225", "0.45661646", "0.4560309", "0.45544827", "0.45493072", "0.45466465", "0.45450556", "0.45382237", "0.45332614", "0.45268884", "0.45214278", "0.45211354", "0.4515586", "0.45105138", "0.4486983", "0.44831836", "0.44815016", "0.448109", "0.4472547", "0.44681576", "0.44677413", "0.44655997", "0.44647747", "0.44501734", "0.4449767", "0.44451413", "0.44399074", "0.4439657", "0.44348744", "0.44345766", "0.44331867", "0.44289705", "0.44245976", "0.44232807", "0.44230056", "0.4411966", "0.44116518", "0.44042873", "0.44034797", "0.4400752", "0.44005585", "0.43882224" ]
0.0
-1
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / /
public static GlyphLayout get(LayoutEngineFactory paramLayoutEngineFactory) /* */ { /* 184 */ if (paramLayoutEngineFactory == null) { /* 185 */ paramLayoutEngineFactory = SunLayoutEngine.instance(); /* */ } /* 187 */ GlyphLayout localGlyphLayout = null; /* 188 */ synchronized (GlyphLayout.class) { /* 189 */ if (cache != null) { /* 190 */ localGlyphLayout = cache; /* 191 */ cache = null; /* */ } /* */ } /* 194 */ if (localGlyphLayout == null) { /* 195 */ localGlyphLayout = new GlyphLayout(); /* */ } /* 197 */ localGlyphLayout._lef = paramLayoutEngineFactory; /* 198 */ return localGlyphLayout; /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static int getNumPatterns() { return 64; }", "double passer();", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "void mo33732Px();", "public void method_4270() {}", "public void gored() {\n\t\t\n\t}", "public Integer getWidth(){return this.width;}", "public int getBlockLength()\r\n/* 45: */ {\r\n/* 46:107 */ return -32;\r\n/* 47: */ }", "@Override\n\tpublic int sount() {\n\t\treturn 0;\n\t}", "public int getInternalBlockLength()\r\n/* 40: */ {\r\n/* 41: 95 */ return 32;\r\n/* 42: */ }", "private int parent(int i){return (i-1)/2;}", "double seBlesser();", "int getSize ();", "private void poetries() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "static int size_of_inx(String passed){\n\t\treturn 1;\n\t}", "@Override\n public void perish() {\n \n }", "int getWidth() {return width;}", "@Override\n public void func_104112_b() {\n \n }", "static int size_of_xra(String passed){\n\t\treturn 1;\n\t}", "int width();", "@Override\n public int getSize() {\n return 1;\n }", "private int leftChild(int i){return 2*i+1;}", "int getTribeSize();", "public byte[] initialValue() {\n return new byte[]{(byte) -1, (byte) -40, (byte) -1, (byte) -37, (byte) 0, (byte) 67, (byte) 0, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -64, (byte) 0, (byte) 17, (byte) 8, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 3, (byte) 1, (byte) 34, (byte) 0, (byte) 2, (byte) 17, (byte) 0, (byte) 3, (byte) 17, (byte) 0, (byte) -1, (byte) -60, (byte) 0, (byte) 31, (byte) 0, (byte) 0, (byte) 1, (byte) 5, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10, (byte) 11, (byte) -1, (byte) -60, (byte) 0, (byte) -75, (byte) 16, (byte) 0, (byte) 2, (byte) 1, (byte) 3, (byte) 3, (byte) 2, (byte) 4, (byte) 3, (byte) 5, (byte) 5, (byte) 4, (byte) 4, (byte) 0, (byte) 0, (byte) 1, (byte) 125, (byte) 1, (byte) 2, (byte) 3, (byte) 0, (byte) 4, (byte) 17, (byte) 5, (byte) 18, (byte) 33, (byte) 49, (byte) 65, (byte) 6, (byte) 19, (byte) 81, (byte) 97, (byte) 7, (byte) 34, (byte) 113, (byte) 20, (byte) 50, (byte) -127, (byte) -111, (byte) -95, (byte) 8, (byte) 35, (byte) 66, (byte) -79, (byte) -63, (byte) 21, (byte) 82, (byte) -47, (byte) -16, (byte) 36, (byte) 51, (byte) 98, (byte) 114, (byte) -126, (byte) 9, (byte) 10, (byte) 22, (byte) 23, (byte) 24, (byte) 25, (byte) 26, (byte) 37, (byte) 38, (byte) 39, (byte) 40, (byte) 41, (byte) 42, (byte) 52, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 58, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) -125, (byte) -124, (byte) -123, (byte) -122, (byte) -121, (byte) -120, (byte) -119, (byte) -118, (byte) -110, (byte) -109, (byte) -108, (byte) -107, (byte) -106, (byte) -105, (byte) -104, (byte) -103, (byte) -102, (byte) -94, (byte) -93, (byte) -92, (byte) -91, (byte) -90, (byte) -89, (byte) -88, (byte) -87, (byte) -86, (byte) -78, (byte) -77, (byte) -76, (byte) -75, (byte) -74, (byte) -73, (byte) -72, (byte) -71, (byte) -70, (byte) -62, (byte) -61, (byte) -60, (byte) -59, (byte) -58, (byte) -57, (byte) -56, (byte) -55, (byte) -54, (byte) -46, (byte) -45, (byte) -44, (byte) -43, (byte) -42, (byte) -41, (byte) -40, (byte) -39, (byte) -38, (byte) -31, (byte) -30, (byte) -29, (byte) -28, (byte) -27, (byte) -26, (byte) -25, (byte) -24, (byte) -23, (byte) -22, (byte) -15, (byte) -14, (byte) -13, (byte) -12, (byte) -11, (byte) -10, (byte) -9, (byte) -8, (byte) -7, (byte) -6, (byte) -1, (byte) -60, (byte) 0, (byte) 31, (byte) 1, (byte) 0, (byte) 3, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10, (byte) 11, (byte) -1, (byte) -60, (byte) 0, (byte) -75, (byte) 17, (byte) 0, (byte) 2, (byte) 1, (byte) 2, (byte) 4, (byte) 4, (byte) 3, (byte) 4, (byte) 7, (byte) 5, (byte) 4, (byte) 4, (byte) 0, (byte) 1, (byte) 2, (byte) 119, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 17, (byte) 4, (byte) 5, (byte) 33, (byte) 49, (byte) 6, (byte) 18, (byte) 65, (byte) 81, (byte) 7, (byte) 97, (byte) 113, (byte) 19, (byte) 34, (byte) 50, (byte) -127, (byte) 8, (byte) 20, (byte) 66, (byte) -111, (byte) -95, (byte) -79, (byte) -63, (byte) 9, (byte) 35, (byte) 51, (byte) 82, (byte) -16, (byte) 21, (byte) 98, (byte) 114, (byte) -47, (byte) 10, (byte) 22, (byte) 36, (byte) 52, (byte) -31, (byte) 37, (byte) -15, (byte) 23, (byte) 24, (byte) 25, (byte) 26, (byte) 38, (byte) 39, (byte) 40, (byte) 41, (byte) 42, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 58, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) -126, (byte) -125, (byte) -124, (byte) -123, (byte) -122, (byte) -121, (byte) -120, (byte) -119, (byte) -118, (byte) -110, (byte) -109, (byte) -108, (byte) -107, (byte) -106, (byte) -105, (byte) -104, (byte) -103, (byte) -102, (byte) -94, (byte) -93, (byte) -92, (byte) -91, (byte) -90, (byte) -89, (byte) -88, (byte) -87, (byte) -86, (byte) -78, (byte) -77, (byte) -76, (byte) -75, (byte) -74, (byte) -73, (byte) -72, (byte) -71, (byte) -70, (byte) -62, (byte) -61, (byte) -60, (byte) -59, (byte) -58, (byte) -57, (byte) -56, (byte) -55, (byte) -54, (byte) -46, (byte) -45, (byte) -44, (byte) -43, (byte) -42, (byte) -41, (byte) -40, (byte) -39, (byte) -38, (byte) -30, (byte) -29, (byte) -28, (byte) -27, (byte) -26, (byte) -25, (byte) -24, (byte) -23, (byte) -22, (byte) -14, (byte) -13, (byte) -12, (byte) -11, (byte) -10, (byte) -9, (byte) -8, (byte) -7, (byte) -6, (byte) -1, (byte) -38, (byte) 0, (byte) 12, (byte) 3, (byte) 1, (byte) 0, (byte) 2, (byte) 17, (byte) 3, (byte) 17, (byte) 0, (byte) 63, (byte) 0, (byte) -114, (byte) -118, (byte) 40, (byte) -96, (byte) 15, (byte) -1, (byte) -39};\n }", "public int length() { return 1+maxidx; }", "private void m50366E() {\n }", "public abstract void mo56925d();", "int memSize() {\n return super.memSize() + 4 * 4; }", "public int getTakeSpace() {\n return 0;\n }", "int fixedSize();", "static int size_of_xthl(String passed){\n\t\treturn 1;\n\t}", "public abstract int mo9754s();", "@Override\r\n\tpublic int size() {\n\t\treturn 27;\r\n\t}", "public abstract void bepaalGrootte();", "public int generateRoshambo(){\n ;]\n\n }", "public void skystonePos4() {\n }", "public void getTile_B8();", "static int size_of_rpo(String passed){\n\t\treturn 1;\n\t}", "public interface Probing {\r\n\t/**\r\n\t * Get an alternate hash position\r\n\t * @param key The original key\r\n\t * @param i How many spaces are occupied already\r\n\t * @param max How many spaces are available\r\n\t * @return A new position for the key\r\n\t */\r\n\tpublic int getHash(int key, int i, int max);\r\n}", "public int getSize(){return _size;}", "@Override\n public int getSize() {\n return 64;\n }", "public int getEdgeCount() \n {\n return 3;\n }", "public abstract int getSpotsNeeded();", "public interface ITechLinker extends ITechByteObject {\r\n \r\n /**\r\n * \r\n */\r\n public static final int LINKER_BASIC_SIZE = A_OBJECT_BASIC_SIZE + 5;\r\n\r\n /**\r\n * \r\n */\r\n public static final int LINKER_OFFSET_01_TYPE1 = A_OBJECT_BASIC_SIZE;\r\n\r\n /**\r\n * \r\n */\r\n public static final int LINKER_OFFSET_02_DATA4 = A_OBJECT_BASIC_SIZE + 1;\r\n\r\n}", "@Override\n public int getSize() {\n\treturn 0;\n }", "static int size_of_shld(String passed){\n\t\treturn 3;\n\t}", "public void verliesLeven() {\r\n\t\t\r\n\t}", "public int getWidth() {\r\n\treturn this.width;\r\n}", "static int size_of_rp(String passed){\n\t\treturn 1;\n\t}", "public void mo21877s() {\n }", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "@Override\n\tpublic int computeSize() {\n\t\treturn 36;\n\t}", "static int size_of_xri(String passed){\n\t\treturn 2;\n\t}", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "default int getCompositeBitLength() {\n return getHighBitLength() + getLowBitLength();\n }", "public double getWidth() {\n return this.size * 2.0; \n }", "int align();", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "public int getSize(){return this.size;}", "@Override\n public int width()\n {\n return widthCent; //Charlie Gao helped me debug the issue here\n }", "public int get_resource_distance() {\n return 1;\r\n }", "private void level7() {\n }", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public abstract String mo118046b();", "public static int size_parentId() {\n return (16 / 8);\n }", "long getWidth();", "int size() {\n int basic = ((offset() + 4) & ~3) - offset() + 8;\n /* Add 8*number of offsets */\n return basic + targetsOp.length*8;\n }", "int getSpriteArraySize();", "void mo57277b();", "public abstract String mo9239aw();", "private void kk12() {\n\n\t}", "long getSize();", "int getKeySize();", "@Override\n protected long advanceH(final long k) {\n return 5 * k - 2;\n }", "double getNewWidth();", "private void m50367F() {\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public abstract int mo8526p();", "public static int size_parent() {\n return (8 / 8);\n }", "long getMid();", "long getMid();", "static int size_of_rz(String passed){\n\t\treturn 1;\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "public abstract int mo123248g();" ]
[ "0.5152037", "0.51435435", "0.51153874", "0.5099663", "0.5029635", "0.5000243", "0.49967322", "0.49762234", "0.49753973", "0.49611163", "0.49578944", "0.4940019", "0.4934584", "0.49266502", "0.49256295", "0.49233234", "0.49209163", "0.4920168", "0.49131197", "0.4900526", "0.48984635", "0.4888303", "0.48872644", "0.48826844", "0.48797435", "0.48735228", "0.48654023", "0.48581564", "0.4854315", "0.48509613", "0.48492184", "0.48474982", "0.48399058", "0.4839271", "0.48370326", "0.4836597", "0.4836287", "0.48344952", "0.48331547", "0.483276", "0.48283958", "0.48214498", "0.48098597", "0.48087084", "0.480528", "0.48030126", "0.48002362", "0.4799919", "0.47965488", "0.47916403", "0.4788169", "0.4787041", "0.47854853", "0.47819582", "0.47809884", "0.47753206", "0.47724262", "0.47713277", "0.47686058", "0.4764319", "0.47633636", "0.4763278", "0.47593", "0.4758803", "0.47500426", "0.47471547", "0.47471547", "0.47471547", "0.47471547", "0.47471547", "0.47471547", "0.47471547", "0.47471547", "0.47471547", "0.47471547", "0.47471547", "0.47471547", "0.47471547", "0.4744506", "0.47406253", "0.47400004", "0.47399628", "0.47397834", "0.4738548", "0.4736972", "0.47353473", "0.47318628", "0.47304595", "0.47273597", "0.472642", "0.47238463", "0.47181976", "0.47170132", "0.47167152", "0.47146475", "0.47101063", "0.47101063", "0.47085735", "0.47078723", "0.47069752", "0.47043473" ]
0.0
-1
/ / / / /
public static void done(GlyphLayout paramGlyphLayout) /* */ { /* 206 */ paramGlyphLayout._lef = null; /* 207 */ cache = paramGlyphLayout; /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void divide() {\n\t\t\n\t}", "private int parent(int i){return (i-1)/2;}", "public abstract void bepaalGrootte();", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "public void gored() {\n\t\t\n\t}", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "public abstract String division();", "private int leftChild(int i){return 2*i+1;}", "public static void slashes() {\n\t\tSystem.out.println(\"//////////////////////\");\r\n\r\n\t}", "double passer();", "public String ring();", "private int rightChild(int i){return 2*i+2;}", "public String toString(){ return \"DIV\";}", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public void division() {\n\t\tx=1;\n\t\ty=0;\n\t\tz=x/y;\n\t\t\t\t\n\t}", "static void pyramid(){\n\t}", "public static void main(String[] args) {\n\n\n for(int a=0; a<7;a++){\n for(int b=0;b<7-a;b++){\n System.out.print(\" \");\n }\n for(int c=0; c<=a;c++){\n System.out.print(\"* \");\n }\n System.out.println(\" \");\n }\n\n }", "public void stg() {\n\n\t}", "void mo33732Px();", "Operations operations();", "void sharpen();", "void sharpen();", "public void skystonePos4() {\n }", "private static void breadcrumbArrow(int width, int height, int indent, int c1, int c2) {\n\n\t\tdouble x0 = 0, y0 = height / 2d;\n\t\tdouble x1 = indent, y1 = 0;\n\t\tdouble x2 = indent, y2 = height / 2d;\n\t\tdouble x3 = indent, y3 = height;\n\t\tdouble x4 = width, y4 = 0;\n\t\tdouble x5 = width, y5 = height / 2d;\n\t\tdouble x6 = width, y6 = height;\n\t\tdouble x7 = indent + width, y7 = 0;\n\t\tdouble x8 = indent + width, y8 = height;\n\n\t\tint fc1 = ColorHelper.mixAlphaColors(c1, c2, 0);\n\t\tint fc2 = ColorHelper.mixAlphaColors(c1, c2, (indent)/(width + 2f * indent));\n\t\tint fc3 = ColorHelper.mixAlphaColors(c1, c2, (indent + width)/(width + 2f * indent));\n\t\tint fc4 = ColorHelper.mixAlphaColors(c1, c2, 1);\n\n\t\tRenderSystem.disableTexture();\n\t\tRenderSystem.enableBlend();\n\t\tRenderSystem.disableAlphaTest();\n\t\tRenderSystem.defaultBlendFunc();\n\t\tRenderSystem.shadeModel(GL11.GL_SMOOTH);\n\n\t\tTessellator tessellator = Tessellator.getInstance();\n\t\tBufferBuilder bufferbuilder = tessellator.getBuffer();\n\t\tbufferbuilder.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR);\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x7, y7, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x8, y8, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\ttessellator.draw();\n\t\tRenderSystem.shadeModel(GL11.GL_FLAT);\n\t\tRenderSystem.disableBlend();\n\t\tRenderSystem.enableAlphaTest();\n\t\tRenderSystem.enableTexture();\n\t}", "double volume(){\n return width*height*depth;\n }", "private void pointer(Graphics image,int x,int y,int height,int b,int dir) {\n\n\t\tint[] xt=new int[3];\n\t\tint[] yt=new int[3];\n\n\t\tif(dir==0) {\n\t\t\txt[0]=x;\n\t\t\txt[1]=xt[2]=x+height;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=y+b/2;\n\t\t\tyt[2]=y-b/2;\n\t\t} else {\n\t\t\txt[0]=x;\n\t\t\txt[1]=x+b/2;\n\t\t\txt[2]=x-b/2;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=yt[2]=y-height;\n\t\t}\n\t\timage.fillPolygon(xt,yt,3);\n\t}", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "public int generateRoshambo(){\n ;]\n\n }", "@Override\n public void bfs() {\n\n }", "public static void part2(){\n\t\n System.out.println(\"\\\\\"); //Outer wall\n System.out.println(\"\\\\\");\n System.out.println(\"\\\\\");\n for(int i = 0; i <= 16; i++){ //loop created to display top of the door\n\n \tSystem.out.print(\"-\");\n\n\t}\n System.out.println(\"\");\n System.out.println(\"\\\\\\t\\t| \\t(\\\")\"); //The door and the stick figure\n System.out.println(\"\\\\\\t\\t|\\t-|-\");\n System.out.println(\"\\\\\\t o | \\t |\");\n System.out.println(\"\\\\\\t\\t|\\t /\\\\\");\n System.out.println(\"\\\\\\t\\t|\\t/ \\\\\");\n\t\t\n }", "public static void main(String[] args) {\n\t\tfor(int j=0;j<8;j++){\n\t\t\tfor(int i=0;i<8;i++){\n\t\t\t\t//上下两侧\n\t\t\t\tif(j==0||j==7){\n\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}else{\n\t\t\t\t\t//中间\n\t\t\t\t\tif(i>0&&i<7){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "int getWidth() {return width;}", "public void draw(){\n for(int i = 1; i <= height; i++){\n for(int s = 1; s <= i; s++)\n System.out.print(\"*\");\n System.out.println();\n }\n }", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "Parallelogram(){\n length = width = height = 0;\n }", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "void ringBell() {\n\n }", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "public static void unionPathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze two = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\tSystem.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = two.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber+n) != S.findAndCompress(randomNumber)){\n\t\t\t\t\t\tS.union(randomNumber+n, randomNumber);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'u');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.union(randomNumber, randomNumber+1);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(two, n);\n\t\tuserSelection_SolveMaze(n);\n\n\n\t\tStdDraw.show(0);\n\t\ttwo.draw();\n\t\ttwo.printCellNumbers();\n\t}", "void doubleBox(int sides, float x1, float y1, float z1, float x2, float y2, float z2)\r\n/* 100: */ {\r\n/* 101: 99 */ int s2 = sides << 1 & 0x2A | sides >> 1 & 0x15;\r\n/* 102: */ \r\n/* 103:101 */ this.context.renderBox(sides, x1, y1, z1, x2, y2, z2);\r\n/* 104:102 */ this.context.renderBox(s2, x2, y2, z2, x1, y1, z1);\r\n/* 105: */ }", "int width();", "private boolean slash() {\r\n return MARK(OPERATOR) && CHAR('/') && gap();\r\n }", "private void traversePath()\n\t{\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t}", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "void walk() {\n\t\t\n\t}", "double getPerimeter(){\n return 2*height+width;\n }", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "public double getWidth() { return _width<0? -_width : _width; }", "public static void main(String[] args) {\n\t\tint n=5;\n\t\tfor(int i=n-1;i>=0;i--)\n\t\t{\n\t\t\tfor(int space=0;space<n-1-i;space++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tfor(int j=0;j<=i*2;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"* \");\n\t\t\t}\n\t\t\n\t\tSystem.out.println();\n\t}\n\n}", "public void draw4x4 (char design){\n System.out.println(\"\"+design+design+design+design);\n System.out.println(design+\" \"+design);\n System.out.println(design+\" \"+design);\n System.out.println(\"\"+design+design+design+design);\n}", "private void createPath(Direction d, int width, Point p1, Point p2) {\n\t\t// Determine how far away from the center the corners are\n\t\tint sideOneOffset = 0;\t// Top or Left depending on path direction\n\t\tint sideTwoOffset = 0;\t// Bot or Right depending on path direction\n\t\t// If the width is odd, balance the offsets\n\t\tif (width % 2 != 0) {\t\n\t\t\tsideOneOffset = sideTwoOffset = ((width / 2) + 1);\n\t\t} else {\n\t\t\t// If the width is even, the offsets will be off by 1\n\t\t\tsideOneOffset = width;\n\t\t\tsideTwoOffset = width - 1;\n\t\t}\n\t\tif (d == Direction.LEFT || d == Direction.RIGHT) {\n\t\t\t// If the direction is left then we want to swap the points\n\t\t\t// to pretend like the direction was right (so the following code works)\n\t\t\tif (d == Direction.LEFT) {\n\t\t\t\tPoint tempP = p2;\n\t\t\t\tp2 = p1;\n\t\t\t\tp1 = tempP;\n\t\t\t}\n\t\t\t// Set the four corners\n\t\t\tpathSquares.add(new PathSquare(\"top-left\", new Point(p1.x, p1.y - sideOneOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-left\", new Point(p1.x, p1.y + sideTwoOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"top-right\", new Point(p2.x, p1.y - sideOneOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-right\", new Point(p2.x, p1.y + sideTwoOffset)));\n\t\t\t// Set the left and right walls\n\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t// (i - width/2) ensures that p1.y is the center of the path (top to bottom)\n\t\t\t\tpathSquares.add(new PathSquare(\"left\", new Point(p1.x, p1.y + (i - width/2))));\n\t\t\t\tpathSquares.add(new PathSquare(\"right\", new Point(p2.x, p2.y + (i - width/2))));\n\t\t\t}\n\t\t\t// Set middle path and top/bottom padding (horizontal Oreo!)\n\t\t\tfor (int col = p1.x + 1, endCol = p2.x; col < endCol; col++) {\n\t\t\t\t// Add the top wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"top\", new Point(col, p1.y - sideOneOffset)));\t\t\t\t\n\t\t\t\t// Add the delicious cream filling\n\t\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t\tpathSquares.add(new PathSquare(\"middle\", new Point(col, p1.y + (i - width /2))));\n\t\t\t\t}\t\t\t\t\n\t\t\t\t// Add the bottom wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"bot\", new Point(col, p1.y + sideTwoOffset)));\n\t\t\t}\n\t\t} else {\n\t\t\t// If the direction is up then we want to swap the points\n\t\t\t// to pretend like the direction was down (so the following code works)\n\t\t\tif (d == Direction.UP) {\n\t\t\t\tPoint tempP = p2;\n\t\t\t\tp2 = p1;\n\t\t\t\tp1 = tempP;\n\t\t\t}\n\t\t\t// Set the four corners\n\t\t\tpathSquares.add(new PathSquare(\"top-left\", new Point(p1.x - sideOneOffset, p1.y)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-left\", new Point(p2.x - sideOneOffset, p2.y)));\n\t\t\tpathSquares.add(new PathSquare(\"top-right\", new Point(p1.x + sideTwoOffset, p1.y)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-right\", new Point(p2.x + sideTwoOffset, p2.y)));\n\t\t\t// Set the top and bottom walls\n\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t// (i - width/2) ensures that p1.x is the center of the path (left to right)\n\t\t\t\tpathSquares.add(new PathSquare(\"top\", new Point(p1.x + (i - width /2), p1.y)));\n\t\t\t\tpathSquares.add(new PathSquare(\"bot\", new Point(p2.x + (i - width /2), p2.y)));\n\t\t\t}\n\t\t\t// Set middle path and left/right padding (vertical Oreo!)\n\t\t\tfor (int row = p1.y + 1, endRow = p2.y; row < endRow; row++) {\n\t\t\t\t// Add the left wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"left\", new Point(p1.x - sideOneOffset, row)));\t\t\t\t\n\t\t\t\t// Add the delicious cream filling\n\t\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t\tpathSquares.add(new PathSquare(\"middle\", new Point(p1.x + (i - width /2), row)));\n\t\t\t\t}\t\t\t\t\n\t\t\t\t// Add the right wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"right\", new Point(p1.x + sideTwoOffset, row)));\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "@Override\npublic void processDirection() {\n\t\n}", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "public void renderCenterBlock(int cons, int side, int end)\r\n/* 143: */ {\r\n/* 144:135 */ if (cons == 0)\r\n/* 145: */ {\r\n/* 146:136 */ this.context.setTex(end);\r\n/* 147:137 */ doubleBox(63, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 148:138 */ return;\r\n/* 149: */ }\r\n/* 150:139 */ if (cons == 3)\r\n/* 151: */ {\r\n/* 152:140 */ this.context.setTexFlags(1773);\r\n/* 153:141 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 154:142 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 155:143 */ return;\r\n/* 156: */ }\r\n/* 157:144 */ if (cons == 12)\r\n/* 158: */ {\r\n/* 159:145 */ this.context.setTexFlags(184365);\r\n/* 160:146 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 161:147 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F);\r\n/* 162:148 */ return;\r\n/* 163: */ }\r\n/* 164:149 */ if (cons == 48)\r\n/* 165: */ {\r\n/* 166:150 */ this.context.setTexFlags(187200);\r\n/* 167:151 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 168:152 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 169:153 */ return;\r\n/* 170: */ }\r\n/* 171:155 */ this.context.setTex(end);\r\n/* 172:156 */ doubleBox(0x3F ^ cons, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 173:157 */ if ((cons & 0x1) > 0)\r\n/* 174: */ {\r\n/* 175:158 */ this.context.setTexFlags(1773);\r\n/* 176:159 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 177:160 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 0.375F, 0.625F);\r\n/* 178: */ }\r\n/* 179:162 */ if ((cons & 0x2) > 0)\r\n/* 180: */ {\r\n/* 181:163 */ this.context.setTexFlags(1773);\r\n/* 182:164 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 183:165 */ doubleBox(60, 0.375F, 0.625F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 184: */ }\r\n/* 185:167 */ if ((cons & 0x4) > 0)\r\n/* 186: */ {\r\n/* 187:168 */ this.context.setTexFlags(184365);\r\n/* 188:169 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 189:170 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 0.375F);\r\n/* 190: */ }\r\n/* 191:172 */ if ((cons & 0x8) > 0)\r\n/* 192: */ {\r\n/* 193:173 */ this.context.setTexFlags(184365);\r\n/* 194:174 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 195:175 */ doubleBox(51, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F, 1.0F);\r\n/* 196: */ }\r\n/* 197:177 */ if ((cons & 0x10) > 0)\r\n/* 198: */ {\r\n/* 199:178 */ this.context.setTexFlags(187200);\r\n/* 200:179 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 201:180 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F);\r\n/* 202: */ }\r\n/* 203:182 */ if ((cons & 0x20) > 0)\r\n/* 204: */ {\r\n/* 205:183 */ this.context.setTexFlags(187200);\r\n/* 206:184 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 207:185 */ doubleBox(15, 0.625F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 208: */ }\r\n/* 209: */ }", "public static String makeShapeA() {\n\tString result = \"\";\n\t\tfor (int i = 0; i < 8 ; i++) {\n\t\t\tresult+=printHash(i);\n\t\t\t\n\t\t}return result;\n\t\t\t//System.out.println(printHash(i));\n\t\t}", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "public void foundLeaf(int width, int height, int level, int currX, int currY, int location) {\n level = level +2;\n if (location == 1) {\n\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - ( (new Double(spatialHeight / Math.pow(2, level ))).intValue()),\n currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY * 2,\n Color.BLACK);\n\n\n canvas.addLine(((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue())) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n currX,\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n\n }\n\n if (location == 2) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n ( currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n (currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n\n\n }\n\n if (location == 3) {\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY,\n Color.BLACK);\n\n\n\n canvas.addLine((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n\tcurrY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n (currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n }\n\n if (location == 4) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY,\n Color.BLACK);\n\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue() + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), Color.BLACK);\n\n\n }\n\n\n\n\n }", "double volume() {\n\treturn width*height*depth;\n}", "@Override\r\n public void draw()\r\n {\n\r\n }", "@Override\n protected void paint2d(Graphics2D g) {\n \n }", "public static void method1(){\n System.out.println(\"*****\");\n System.out.println(\"*****\");\n System.out.println(\" * *\");\n System.out.println(\" *\");\n System.out.println(\" * *\");\n }", "@Override\n\tpublic void draw3() {\n\n\t}", "private void renderPath(Node n)\n {\n\tGraphics g = getGraphics();\n\tboolean painting;\n\tColor nc,lc;\n\n\tpainting = (n.paths_passing==0);\n\twhile (n != null) {\n\t if (painting)\n\t\tn.paths_passing++;\n\t else {\n\t\tn.paths_passing--;\n\t }\n\t \n// \t nc = (n.paths_passing > 0)?hilitcolor:normalcolor;\n// \t lc = (n.paths_passing > 0)?hilitcolor:linecolor;\n\t nc = (n.paths_passing > 0)?n.path_color:normalcolor;\n\t lc = (n.paths_passing > 0)?n.path_color:linecolor;\n\t \n\t if (n.parent == null) {\n\t\tsetRenderColor(g,nc);\n\t\trenderNode(g,n);\n\t\tbreak;\n\t }\n\n\t // Double line width\n\t //setRenderColor(g,(n.paths_passing>0)?hilitcolor:Color.white);\n\t setRenderColor(g,(n.paths_passing>0)?n.path_color:Color.white);\n\t renderLine(g,n.x-1,n.y,n.parent.x-1,n.parent.y);\t\n\n\t setRenderColor(g,lc);\n\t renderLine(g,n.x,n.y,n.parent.x,n.parent.y);\n\n\t setRenderColor(g,nc);\n\t renderNode(g,n);\n\t n = n.parent;\n\t}\n }", "int fi(int x, int y) {\n\t\treturn (x + 1) + (width + 2) * (y + 1);\n\t}", "double defendre();", "public void getTile_B8();", "public void SubRect(){\n\t\n}", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "void mo21076g();", "@Override\n\tpublic void draw() {\n\n\t}", "@Override\n\tpublic void draw() {\n\n\t}", "public double getWidth() {\n return this.size * 2.0; \n }", "public void skystonePos2() {\n }", "public void skystonePos5() {\n }", "public double getPerimiter(){return (2*height +2*width);}", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "public static void topHalf() {\n \t\n for( int i = 1; i <= SIZE; i++){\n for(int spaces = 1; spaces <= 3*SIZE - 3*i; spaces++) {\n System.out.print(\" \"); \n }\n \n for(int j = 1; j <= 1; j++) {\n System.out.print(\"__/\");\n }\n \n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\":::\");\n }\n \n System.out.print(\"||\");\n \n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\":::\");\n }\n \n for(int j = 1; j <= 1; j++) {\n System.out.print(\"\\\\__\");\n }\n \n System.out.println();\n }\n \n System.out.print(\"|\");\n \n for(int i = 1; i <= 6 * SIZE; i++) {\n System.out.print(\"\\\"\");\n }\n \n System.out.println(\"|\");\n }", "public static void body() {\n \tfor(int i = 1; i <= SIZE*SIZE; i++) {\n for(int j = 1; j <= 3*SIZE-(SIZE-1); j++) {\n System.out.print(\" \");\n }\n \n System.out.print(\"|\");\n for(int j = 1; j <= SIZE-2; j++) {\n \tSystem.out.print(\"%\");\n }\n System.out.print(\"||\");\n for(int j = 1; j <= SIZE-2; j++) {\n \tSystem.out.print(\"%\");\n }\n System.out.print(\"|\");\n \n System.out.println();\n }\n }", "public void skystonePos3() {\n }", "double seBlesser();", "public wall() { //default constructor makes a 10x10 square extending right and down from the pixel located at 5,5\r\n x = 5;\r\n y = 5;\r\n height = 10;\r\n width = 10;\r\n }", "void block(Directions dir);", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "public static void main(String[] args) {\nint i,j,k;\r\nint num=5;\r\nfor(i=0;i<num;i++){\r\n\tfor(j=0;j<i;j++){\r\n\t\tSystem.out.print(\" \");\r\n\t}\r\n\tfor(k=num; k>=2*i-1; k--){\r\n\t\tSystem.out.print(\"*\");\r\n\t}\r\n\t\r\n\tSystem.out.println();\r\n}\r\n\t}", "public RMPath getPath() { return RMPath.unitRectPath; }", "public int upright();", "private int uniquePaths(int x, int y, int[][] dp) {\n \t\tif (x == 0 || y == 0) return 1;\n \t\tif (dp[x][y] == 0)\n \t\t\tdp[x][y] = uniquePaths(x - 1, y, dp) + uniquePaths(x, y - 1, dp);\n \t\treturn dp[x][y];\n \t}", "public Integer getWidth(){return this.width;}", "public void skystonePos6() {\n }", "void GenerateBoardPath() {\n\t\t\t\n\t\t\tint rows = board.getRowsNum();\n\t\t\tint columns = board.getColsNum();\n\t\t\tint space_number = 1; \n\t\t\t\n\t\t\t\n\t\t\tfor (int i = rows - 1; i >= 0; i--) \n\t\t\t\t//If the row is an odd-number, move L-R\n\t\t\t\tif (i % 2 != 0) {\n\t\t\t\t\tfor (int j = 0; j < columns; j++) \n\t\t\t\t\t\tBoardPathRepository.put(space_number++, board.getTile(i, j));}\n\t\t\t\telse {\n\t\t\t\t\tfor (int j = columns-1; j >=0; j--) \n\t\t\t\t\t\tBoardPathRepository.put(space_number++, board.getTile(i, j));\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t}", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "private void render() {\n StringBuilder builder = new StringBuilder();\n builder.append(horizontalEdge).append(\"\\n\");\n for (int i = 0; i < this.height; i++) {\n builder.append(VERTICAL_CHAR);\n for (int j = 0; j < this.width; j++) {\n builder.append(pixels[i][j]);\n }\n builder.append(VERTICAL_CHAR);\n builder.append(\"\\n\");\n }\n builder.append(horizontalEdge);\n System.out.printf(builder.toString());\n }", "@Override\n\tpublic void breath() {\n\n\t}", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "public\nstatic\nvoid\nmain(String args[]) \n\n{ \n\nBinaryTree tree = \nnew\nBinaryTree(); \n\ntree.root = \nnew\nNode(\n20\n); \n\ntree.root.left = \nnew\nNode(\n8\n); \n\ntree.root.left.left = \nnew\nNode(\n4\n); \n\ntree.root.left.right = \nnew\nNode(\n12\n); \n\ntree.root.left.right.left = \nnew\nNode(\n10\n); \n\ntree.root.left.right.right = \nnew\nNode(\n14\n); \n\ntree.root.right = \nnew\nNode(\n22\n); \n\ntree.root.right.right = \nnew\nNode(\n25\n); \n\ntree.printBoundary(tree.root); \n\n}", "public static void main(String[] args) {\n\r\n\t\t\r\n\t\tint n = 7;\r\n\t\tfor (int i = n; i >= 0; i--) {\r\n\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t for(int j=0; j<n-i; j++) {\r\n\t\t\t \r\n\t\t\t System.out.print(\" \");\r\n\t\t\t \r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t \r\n\r\n\t\t\tfor (int j = n; j >= n-i; j--) {\r\n\r\n\t\t\t\tSystem.out.print(\"*\");\r\n\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t}\r\n\r\n\t\t\r\n\t}", "@Override\n\tpublic void draw() {\n\t}", "private void division()\n\t{\n\t\tFun = Function.DIVIDE; //Function set to determine what action should be taken later.\n\t\t\n\t\t\tsetLeftValue();\n\t\t\tentry.grabFocus();\n\t\t\n\t}" ]
[ "0.5654086", "0.5282051", "0.5270874", "0.5268489", "0.5230159", "0.5229372", "0.5205559", "0.51923394", "0.51524484", "0.50993294", "0.50948834", "0.5071109", "0.5043058", "0.5009983", "0.5006536", "0.49739555", "0.49691963", "0.4959123", "0.49568397", "0.49425906", "0.49421698", "0.49421698", "0.4903223", "0.4897176", "0.48879617", "0.48803073", "0.48741165", "0.48718095", "0.48679698", "0.48646608", "0.48598114", "0.48402584", "0.48362267", "0.48321876", "0.48310882", "0.4825809", "0.48227587", "0.48175377", "0.48045233", "0.48045233", "0.48002362", "0.47911668", "0.47906598", "0.4776121", "0.47734705", "0.47673976", "0.475685", "0.47517157", "0.47446346", "0.47364715", "0.47353277", "0.47321412", "0.47242466", "0.4721296", "0.47190621", "0.47164857", "0.47148356", "0.47142458", "0.47103566", "0.47027764", "0.47023293", "0.4701804", "0.46992764", "0.46985114", "0.46954885", "0.4695406", "0.46914175", "0.4690724", "0.46901584", "0.4686765", "0.4682771", "0.46786475", "0.46786475", "0.4676364", "0.46714565", "0.46710065", "0.46701837", "0.46698236", "0.46671712", "0.466633", "0.4663725", "0.46617198", "0.46599096", "0.46593648", "0.4654308", "0.46481097", "0.46472353", "0.46443266", "0.46441418", "0.46438584", "0.4642061", "0.46387514", "0.46382058", "0.46375832", "0.4636777", "0.46365395", "0.46365395", "0.46359038", "0.4635539", "0.46332848", "0.46326485" ]
0.0
-1
/ / / / / / /
public static SDCache get(Font paramFont, FontRenderContext paramFontRenderContext) /* */ { /* 310 */ if (paramFontRenderContext.isTransformed()) { /* 311 */ localObject = paramFontRenderContext.getTransform(); /* 312 */ if ((((AffineTransform)localObject).getTranslateX() != 0.0D) || /* 313 */ (((AffineTransform)localObject).getTranslateY() != 0.0D)) /* */ { /* */ /* */ /* 317 */ localObject = new AffineTransform(((AffineTransform)localObject).getScaleX(), ((AffineTransform)localObject).getShearY(), ((AffineTransform)localObject).getShearX(), ((AffineTransform)localObject).getScaleY(), 0.0D, 0.0D); /* */ /* */ /* */ /* 321 */ paramFontRenderContext = new FontRenderContext((AffineTransform)localObject, paramFontRenderContext.getAntiAliasingHint(), paramFontRenderContext.getFractionalMetricsHint()); /* */ } /* */ } /* */ /* */ /* 326 */ Object localObject = new SDKey(paramFont, paramFontRenderContext); /* 327 */ ConcurrentHashMap localConcurrentHashMap = null; /* 328 */ SDCache localSDCache = null; /* 329 */ if (cacheRef != null) { /* 330 */ localConcurrentHashMap = (ConcurrentHashMap)cacheRef.get(); /* 331 */ if (localConcurrentHashMap != null) { /* 332 */ localSDCache = (SDCache)localConcurrentHashMap.get(localObject); /* */ } /* */ } /* 335 */ if (localSDCache == null) { /* 336 */ localSDCache = new SDCache(paramFont, paramFontRenderContext); /* 337 */ if (localConcurrentHashMap == null) { /* 338 */ localConcurrentHashMap = new ConcurrentHashMap(10); /* 339 */ cacheRef = new SoftReference(localConcurrentHashMap); /* */ } /* 341 */ else if (localConcurrentHashMap.size() >= 512) { /* 342 */ localConcurrentHashMap.clear(); /* */ } /* 344 */ localConcurrentHashMap.put(localObject, localSDCache); /* */ } /* 346 */ return localSDCache; /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "public void divide() {\n\t\t\n\t}", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "private int rightChild(int i){return 2*i+2;}", "public abstract void bepaalGrootte();", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "double passer();", "public void gored() {\n\t\t\n\t}", "public String ring();", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public abstract String division();", "public String toString(){ return \"DIV\";}", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "int getWidth() {return width;}", "private void pointer(Graphics image,int x,int y,int height,int b,int dir) {\n\n\t\tint[] xt=new int[3];\n\t\tint[] yt=new int[3];\n\n\t\tif(dir==0) {\n\t\t\txt[0]=x;\n\t\t\txt[1]=xt[2]=x+height;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=y+b/2;\n\t\t\tyt[2]=y-b/2;\n\t\t} else {\n\t\t\txt[0]=x;\n\t\t\txt[1]=x+b/2;\n\t\t\txt[2]=x-b/2;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=yt[2]=y-height;\n\t\t}\n\t\timage.fillPolygon(xt,yt,3);\n\t}", "public void getTile_B8();", "public double getWidth() {\n return this.size * 2.0; \n }", "double volume(){\n return width*height*depth;\n }", "@Override\n public void bfs() {\n\n }", "public static void main(String[] args) {\n\n\n for(int a=0; a<7;a++){\n for(int b=0;b<7-a;b++){\n System.out.print(\" \");\n }\n for(int c=0; c<=a;c++){\n System.out.print(\"* \");\n }\n System.out.println(\" \");\n }\n\n }", "int width();", "Operations operations();", "void sharpen();", "void sharpen();", "private static void breadcrumbArrow(int width, int height, int indent, int c1, int c2) {\n\n\t\tdouble x0 = 0, y0 = height / 2d;\n\t\tdouble x1 = indent, y1 = 0;\n\t\tdouble x2 = indent, y2 = height / 2d;\n\t\tdouble x3 = indent, y3 = height;\n\t\tdouble x4 = width, y4 = 0;\n\t\tdouble x5 = width, y5 = height / 2d;\n\t\tdouble x6 = width, y6 = height;\n\t\tdouble x7 = indent + width, y7 = 0;\n\t\tdouble x8 = indent + width, y8 = height;\n\n\t\tint fc1 = ColorHelper.mixAlphaColors(c1, c2, 0);\n\t\tint fc2 = ColorHelper.mixAlphaColors(c1, c2, (indent)/(width + 2f * indent));\n\t\tint fc3 = ColorHelper.mixAlphaColors(c1, c2, (indent + width)/(width + 2f * indent));\n\t\tint fc4 = ColorHelper.mixAlphaColors(c1, c2, 1);\n\n\t\tRenderSystem.disableTexture();\n\t\tRenderSystem.enableBlend();\n\t\tRenderSystem.disableAlphaTest();\n\t\tRenderSystem.defaultBlendFunc();\n\t\tRenderSystem.shadeModel(GL11.GL_SMOOTH);\n\n\t\tTessellator tessellator = Tessellator.getInstance();\n\t\tBufferBuilder bufferbuilder = tessellator.getBuffer();\n\t\tbufferbuilder.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR);\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x7, y7, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x8, y8, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\ttessellator.draw();\n\t\tRenderSystem.shadeModel(GL11.GL_FLAT);\n\t\tRenderSystem.disableBlend();\n\t\tRenderSystem.enableAlphaTest();\n\t\tRenderSystem.enableTexture();\n\t}", "static void pyramid(){\n\t}", "public Integer getWidth(){return this.width;}", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "@Override\npublic void processDirection() {\n\t\n}", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "public int generateRoshambo(){\n ;]\n\n }", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "public void skystonePos4() {\n }", "void mo33732Px();", "private void traversePath()\n\t{\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t}", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "public void SubRect(){\n\t\n}", "public static void unionPathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze two = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\tSystem.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = two.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber+n) != S.findAndCompress(randomNumber)){\n\t\t\t\t\t\tS.union(randomNumber+n, randomNumber);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'u');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.union(randomNumber, randomNumber+1);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(two, n);\n\t\tuserSelection_SolveMaze(n);\n\n\n\t\tStdDraw.show(0);\n\t\ttwo.draw();\n\t\ttwo.printCellNumbers();\n\t}", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "void walk() {\n\t\t\n\t}", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "public double getWidth() { return _width<0? -_width : _width; }", "public void draw(){\n for(int i = 1; i <= height; i++){\n for(int s = 1; s <= i; s++)\n System.out.print(\"*\");\n System.out.println();\n }\n }", "public void stg() {\n\n\t}", "Parallelogram(){\n length = width = height = 0;\n }", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "public void foundLeaf(int width, int height, int level, int currX, int currY, int location) {\n level = level +2;\n if (location == 1) {\n\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - ( (new Double(spatialHeight / Math.pow(2, level ))).intValue()),\n currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY * 2,\n Color.BLACK);\n\n\n canvas.addLine(((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue())) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n currX,\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n\n }\n\n if (location == 2) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n ( currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n (currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n\n\n }\n\n if (location == 3) {\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY,\n Color.BLACK);\n\n\n\n canvas.addLine((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n\tcurrY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n (currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n }\n\n if (location == 4) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY,\n Color.BLACK);\n\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue() + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), Color.BLACK);\n\n\n }\n\n\n\n\n }", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tfor(int j=0;j<8;j++){\n\t\t\tfor(int i=0;i<8;i++){\n\t\t\t\t//上下两侧\n\t\t\t\tif(j==0||j==7){\n\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}else{\n\t\t\t\t\t//中间\n\t\t\t\t\tif(i>0&&i<7){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "double getPerimeter(){\n return 2*height+width;\n }", "public static void part2(){\n\t\n System.out.println(\"\\\\\"); //Outer wall\n System.out.println(\"\\\\\");\n System.out.println(\"\\\\\");\n for(int i = 0; i <= 16; i++){ //loop created to display top of the door\n\n \tSystem.out.print(\"-\");\n\n\t}\n System.out.println(\"\");\n System.out.println(\"\\\\\\t\\t| \\t(\\\")\"); //The door and the stick figure\n System.out.println(\"\\\\\\t\\t|\\t-|-\");\n System.out.println(\"\\\\\\t o | \\t |\");\n System.out.println(\"\\\\\\t\\t|\\t /\\\\\");\n System.out.println(\"\\\\\\t\\t|\\t/ \\\\\");\n\t\t\n }", "public double getPerimiter(){return (2*height +2*width);}", "@Override\r\n\tpublic void walk() {\n\r\n\t}", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "void doubleBox(int sides, float x1, float y1, float z1, float x2, float y2, float z2)\r\n/* 100: */ {\r\n/* 101: 99 */ int s2 = sides << 1 & 0x2A | sides >> 1 & 0x15;\r\n/* 102: */ \r\n/* 103:101 */ this.context.renderBox(sides, x1, y1, z1, x2, y2, z2);\r\n/* 104:102 */ this.context.renderBox(s2, x2, y2, z2, x1, y1, z1);\r\n/* 105: */ }", "@Override\n protected void paint2d(Graphics2D g) {\n \n }", "public static String makeShapeA() {\n\tString result = \"\";\n\t\tfor (int i = 0; i < 8 ; i++) {\n\t\t\tresult+=printHash(i);\n\t\t\t\n\t\t}return result;\n\t\t\t//System.out.println(printHash(i));\n\t\t}", "double getNewWidth();", "public void draw4x4 (char design){\n System.out.println(\"\"+design+design+design+design);\n System.out.println(design+\" \"+design);\n System.out.println(design+\" \"+design);\n System.out.println(\"\"+design+design+design+design);\n}", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "int fi(int x, int y) {\n\t\treturn (x + 1) + (width + 2) * (y + 1);\n\t}", "private void createPath(Direction d, int width, Point p1, Point p2) {\n\t\t// Determine how far away from the center the corners are\n\t\tint sideOneOffset = 0;\t// Top or Left depending on path direction\n\t\tint sideTwoOffset = 0;\t// Bot or Right depending on path direction\n\t\t// If the width is odd, balance the offsets\n\t\tif (width % 2 != 0) {\t\n\t\t\tsideOneOffset = sideTwoOffset = ((width / 2) + 1);\n\t\t} else {\n\t\t\t// If the width is even, the offsets will be off by 1\n\t\t\tsideOneOffset = width;\n\t\t\tsideTwoOffset = width - 1;\n\t\t}\n\t\tif (d == Direction.LEFT || d == Direction.RIGHT) {\n\t\t\t// If the direction is left then we want to swap the points\n\t\t\t// to pretend like the direction was right (so the following code works)\n\t\t\tif (d == Direction.LEFT) {\n\t\t\t\tPoint tempP = p2;\n\t\t\t\tp2 = p1;\n\t\t\t\tp1 = tempP;\n\t\t\t}\n\t\t\t// Set the four corners\n\t\t\tpathSquares.add(new PathSquare(\"top-left\", new Point(p1.x, p1.y - sideOneOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-left\", new Point(p1.x, p1.y + sideTwoOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"top-right\", new Point(p2.x, p1.y - sideOneOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-right\", new Point(p2.x, p1.y + sideTwoOffset)));\n\t\t\t// Set the left and right walls\n\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t// (i - width/2) ensures that p1.y is the center of the path (top to bottom)\n\t\t\t\tpathSquares.add(new PathSquare(\"left\", new Point(p1.x, p1.y + (i - width/2))));\n\t\t\t\tpathSquares.add(new PathSquare(\"right\", new Point(p2.x, p2.y + (i - width/2))));\n\t\t\t}\n\t\t\t// Set middle path and top/bottom padding (horizontal Oreo!)\n\t\t\tfor (int col = p1.x + 1, endCol = p2.x; col < endCol; col++) {\n\t\t\t\t// Add the top wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"top\", new Point(col, p1.y - sideOneOffset)));\t\t\t\t\n\t\t\t\t// Add the delicious cream filling\n\t\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t\tpathSquares.add(new PathSquare(\"middle\", new Point(col, p1.y + (i - width /2))));\n\t\t\t\t}\t\t\t\t\n\t\t\t\t// Add the bottom wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"bot\", new Point(col, p1.y + sideTwoOffset)));\n\t\t\t}\n\t\t} else {\n\t\t\t// If the direction is up then we want to swap the points\n\t\t\t// to pretend like the direction was down (so the following code works)\n\t\t\tif (d == Direction.UP) {\n\t\t\t\tPoint tempP = p2;\n\t\t\t\tp2 = p1;\n\t\t\t\tp1 = tempP;\n\t\t\t}\n\t\t\t// Set the four corners\n\t\t\tpathSquares.add(new PathSquare(\"top-left\", new Point(p1.x - sideOneOffset, p1.y)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-left\", new Point(p2.x - sideOneOffset, p2.y)));\n\t\t\tpathSquares.add(new PathSquare(\"top-right\", new Point(p1.x + sideTwoOffset, p1.y)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-right\", new Point(p2.x + sideTwoOffset, p2.y)));\n\t\t\t// Set the top and bottom walls\n\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t// (i - width/2) ensures that p1.x is the center of the path (left to right)\n\t\t\t\tpathSquares.add(new PathSquare(\"top\", new Point(p1.x + (i - width /2), p1.y)));\n\t\t\t\tpathSquares.add(new PathSquare(\"bot\", new Point(p2.x + (i - width /2), p2.y)));\n\t\t\t}\n\t\t\t// Set middle path and left/right padding (vertical Oreo!)\n\t\t\tfor (int row = p1.y + 1, endRow = p2.y; row < endRow; row++) {\n\t\t\t\t// Add the left wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"left\", new Point(p1.x - sideOneOffset, row)));\t\t\t\t\n\t\t\t\t// Add the delicious cream filling\n\t\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t\tpathSquares.add(new PathSquare(\"middle\", new Point(p1.x + (i - width /2), row)));\n\t\t\t\t}\t\t\t\t\n\t\t\t\t// Add the right wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"right\", new Point(p1.x + sideTwoOffset, row)));\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void walk() {\n\t\t\n\t}", "public void renderCenterBlock(int cons, int side, int end)\r\n/* 143: */ {\r\n/* 144:135 */ if (cons == 0)\r\n/* 145: */ {\r\n/* 146:136 */ this.context.setTex(end);\r\n/* 147:137 */ doubleBox(63, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 148:138 */ return;\r\n/* 149: */ }\r\n/* 150:139 */ if (cons == 3)\r\n/* 151: */ {\r\n/* 152:140 */ this.context.setTexFlags(1773);\r\n/* 153:141 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 154:142 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 155:143 */ return;\r\n/* 156: */ }\r\n/* 157:144 */ if (cons == 12)\r\n/* 158: */ {\r\n/* 159:145 */ this.context.setTexFlags(184365);\r\n/* 160:146 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 161:147 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F);\r\n/* 162:148 */ return;\r\n/* 163: */ }\r\n/* 164:149 */ if (cons == 48)\r\n/* 165: */ {\r\n/* 166:150 */ this.context.setTexFlags(187200);\r\n/* 167:151 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 168:152 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 169:153 */ return;\r\n/* 170: */ }\r\n/* 171:155 */ this.context.setTex(end);\r\n/* 172:156 */ doubleBox(0x3F ^ cons, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 173:157 */ if ((cons & 0x1) > 0)\r\n/* 174: */ {\r\n/* 175:158 */ this.context.setTexFlags(1773);\r\n/* 176:159 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 177:160 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 0.375F, 0.625F);\r\n/* 178: */ }\r\n/* 179:162 */ if ((cons & 0x2) > 0)\r\n/* 180: */ {\r\n/* 181:163 */ this.context.setTexFlags(1773);\r\n/* 182:164 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 183:165 */ doubleBox(60, 0.375F, 0.625F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 184: */ }\r\n/* 185:167 */ if ((cons & 0x4) > 0)\r\n/* 186: */ {\r\n/* 187:168 */ this.context.setTexFlags(184365);\r\n/* 188:169 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 189:170 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 0.375F);\r\n/* 190: */ }\r\n/* 191:172 */ if ((cons & 0x8) > 0)\r\n/* 192: */ {\r\n/* 193:173 */ this.context.setTexFlags(184365);\r\n/* 194:174 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 195:175 */ doubleBox(51, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F, 1.0F);\r\n/* 196: */ }\r\n/* 197:177 */ if ((cons & 0x10) > 0)\r\n/* 198: */ {\r\n/* 199:178 */ this.context.setTexFlags(187200);\r\n/* 200:179 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 201:180 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F);\r\n/* 202: */ }\r\n/* 203:182 */ if ((cons & 0x20) > 0)\r\n/* 204: */ {\r\n/* 205:183 */ this.context.setTexFlags(187200);\r\n/* 206:184 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 207:185 */ doubleBox(15, 0.625F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 208: */ }\r\n/* 209: */ }", "double seBlesser();", "long getWidth();", "public int getWidth() {\r\n\treturn this.width;\r\n}", "private void render() {\n StringBuilder builder = new StringBuilder();\n builder.append(horizontalEdge).append(\"\\n\");\n for (int i = 0; i < this.height; i++) {\n builder.append(VERTICAL_CHAR);\n for (int j = 0; j < this.width; j++) {\n builder.append(pixels[i][j]);\n }\n builder.append(VERTICAL_CHAR);\n builder.append(\"\\n\");\n }\n builder.append(horizontalEdge);\n System.out.printf(builder.toString());\n }", "public void leerPlanesDietas();", "@Override\r\n public void draw()\r\n {\n\r\n }", "private void buildPath() {\r\n int xNext = 1;\r\n int yNext = map.getStartPos() + 1;\r\n CellLayered before = cells[yNext][xNext];\r\n while(true)\r\n {\r\n Byte[] xy = map.getDirection(xNext-1, yNext-1);\r\n xNext = xNext + xy[0];\r\n yNext = yNext + xy[1];\r\n\r\n CellLayered next = cells[yNext][xNext];\r\n\r\n if(xy[0]==-1)\r\n before.setRight(false);\r\n else\r\n before.setRight(true);\r\n before.setPath(true);\r\n if(next==null)\r\n break;\r\n\r\n before.setNextInPath(next);\r\n before = next;\r\n }\r\n }", "void block(Directions dir);", "public static void slashes() {\n\t\tSystem.out.println(\"//////////////////////\");\r\n\r\n\t}", "public String getRing();", "@Override\r\n\tpublic double perimeter() {\n\t\treturn 2*length*breadth;\r\n\t}", "public\nstatic\nvoid\nmain(String args[]) \n\n{ \n\nBinaryTree tree = \nnew\nBinaryTree(); \n\ntree.root = \nnew\nNode(\n20\n); \n\ntree.root.left = \nnew\nNode(\n8\n); \n\ntree.root.left.left = \nnew\nNode(\n4\n); \n\ntree.root.left.right = \nnew\nNode(\n12\n); \n\ntree.root.left.right.left = \nnew\nNode(\n10\n); \n\ntree.root.left.right.right = \nnew\nNode(\n14\n); \n\ntree.root.right = \nnew\nNode(\n22\n); \n\ntree.root.right.right = \nnew\nNode(\n25\n); \n\ntree.printBoundary(tree.root); \n\n}", "public int getEdgeCount() \n {\n return 3;\n }", "public int getWidth(){\n return width;\n }", "public int upright();", "protected int parent(int i) { return (i - 1) / 2; }", "@Override\n\tpublic void draw() {\n\n\t}", "@Override\n\tpublic void draw() {\n\n\t}", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "public int getDireccion(Pixel p) {\r\n\t\tif (x == p.x && y < p.y)\r\n\t\t\treturn DIR_N;\r\n\t\tif (x > p.x && y < p.y){\r\n\t\t\tdouble distancia = this.distancia(p);\r\n\t\t\tif (distancia <= 1){\r\n\t\t\t\treturn DIR_NE;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tint distanciaX = Math.abs(x - p.x);\r\n\t\t\t\tint distanciaY = Math.abs(y - p.y);\r\n\t\t\t\tif (distanciaX == distanciaY)\r\n\t\t\t\t\treturn DIR_NE;\r\n\t\t\t\telse if (distanciaX > distanciaY)\r\n\t\t\t\t\treturn DIR_E;\r\n\t\t\t\telse \r\n\t\t\t\t\treturn DIR_N;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (x < p.x && y < p.y){\r\n\t\t\tdouble distancia = this.distancia(p);\r\n\t\t\tif (distancia <= 1){\r\n\t\t\t\treturn DIR_NO;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tint distanciaX = Math.abs(x - p.x);\r\n\t\t\t\tint distanciaY = Math.abs(y - p.y);\r\n\t\t\t\tif (distanciaX == distanciaY)\r\n\t\t\t\t\treturn DIR_NO;\r\n\t\t\t\telse if (distanciaX > distanciaY)\r\n\t\t\t\t\treturn DIR_O;\r\n\t\t\t\telse \r\n\t\t\t\t\treturn DIR_N;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (x == p.x && y > p.y)\r\n\t\t\treturn DIR_S;\r\n\t\tif (x > p.x && y > p.y){\r\n\t\t\tdouble distancia = this.distancia(p);\r\n\t\t\tif (distancia <= 1){\r\n\t\t\t\treturn DIR_SE;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tint distanciaX = Math.abs(x - p.x);\r\n\t\t\t\tint distanciaY = Math.abs(y - p.y);\r\n\t\t\t\tif (distanciaX == distanciaY)\r\n\t\t\t\t\treturn DIR_SE;\r\n\t\t\t\telse if (distanciaX > distanciaY)\r\n\t\t\t\t\treturn DIR_E;\r\n\t\t\t\telse \r\n\t\t\t\t\treturn DIR_S;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (x < p.x && y > p.y){\r\n\t\t\tdouble distancia = this.distancia(p);\r\n\t\t\tif (distancia <= 1){\r\n\t\t\t\treturn DIR_SO;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tint distanciaX = Math.abs(x - p.x);\r\n\t\t\t\tint distanciaY = Math.abs(y - p.y);\r\n\t\t\t\tif (distanciaX == distanciaY)\r\n\t\t\t\t\treturn DIR_SO;\r\n\t\t\t\telse if (distanciaX > distanciaY)\r\n\t\t\t\t\treturn DIR_O;\r\n\t\t\t\telse \r\n\t\t\t\t\treturn DIR_S;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (x > p.x && y == p.y)\r\n\t\t\treturn DIR_E;\r\n\t\tif (x < p.x && y == p.y)\r\n\t\t\treturn DIR_O;\r\n\t\treturn -1;\r\n\t}", "private void renderPath(Node n)\n {\n\tGraphics g = getGraphics();\n\tboolean painting;\n\tColor nc,lc;\n\n\tpainting = (n.paths_passing==0);\n\twhile (n != null) {\n\t if (painting)\n\t\tn.paths_passing++;\n\t else {\n\t\tn.paths_passing--;\n\t }\n\t \n// \t nc = (n.paths_passing > 0)?hilitcolor:normalcolor;\n// \t lc = (n.paths_passing > 0)?hilitcolor:linecolor;\n\t nc = (n.paths_passing > 0)?n.path_color:normalcolor;\n\t lc = (n.paths_passing > 0)?n.path_color:linecolor;\n\t \n\t if (n.parent == null) {\n\t\tsetRenderColor(g,nc);\n\t\trenderNode(g,n);\n\t\tbreak;\n\t }\n\n\t // Double line width\n\t //setRenderColor(g,(n.paths_passing>0)?hilitcolor:Color.white);\n\t setRenderColor(g,(n.paths_passing>0)?n.path_color:Color.white);\n\t renderLine(g,n.x-1,n.y,n.parent.x-1,n.parent.y);\t\n\n\t setRenderColor(g,lc);\n\t renderLine(g,n.x,n.y,n.parent.x,n.parent.y);\n\n\t setRenderColor(g,nc);\n\t renderNode(g,n);\n\t n = n.parent;\n\t}\n }", "double volume() {\n\treturn width*height*depth;\n}", "void table(){\n fill(0);\n rect(width/2, height/2, 600, 350); // boarder\n fill(100, 0 ,0);\n rect(width/2, height/2, 550, 300); //Felt\n \n \n}", "public void snare();", "void ringBell() {\n\n }", "public static void main(String[] args) {\n\t\tint n=5;\n\t\tfor(int i=n-1;i>=0;i--)\n\t\t{\n\t\t\tfor(int space=0;space<n-1-i;space++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tfor(int j=0;j<=i*2;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"* \");\n\t\t\t}\n\t\t\n\t\tSystem.out.println();\n\t}\n\n}", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "public void skystonePos2() {\n }", "public int my_leaf_count();", "@Override\n\tpublic void draw3() {\n\n\t}" ]
[ "0.54567957", "0.53680295", "0.53644985", "0.52577376", "0.52142847", "0.51725817", "0.514088", "0.50868535", "0.5072305", "0.504888", "0.502662", "0.50005764", "0.49740013", "0.4944243", "0.4941118", "0.4937142", "0.49095523", "0.48940238", "0.48719338", "0.48613623", "0.48604724", "0.48558092", "0.48546165", "0.48490012", "0.4843668", "0.4843668", "0.48420057", "0.4839597", "0.4832105", "0.4817357", "0.481569", "0.48122767", "0.48085573", "0.48065376", "0.48032433", "0.48032212", "0.4799707", "0.4798766", "0.47978994", "0.47978172", "0.47921672", "0.47903922", "0.4790111", "0.47886384", "0.47843018", "0.47837785", "0.47828907", "0.47826976", "0.4776919", "0.47767594", "0.47767594", "0.47766045", "0.4764252", "0.47560593", "0.4753577", "0.4752732", "0.47510985", "0.47496924", "0.47485355", "0.4748455", "0.4746839", "0.4744132", "0.47203988", "0.4713808", "0.4711382", "0.47113234", "0.47096533", "0.47075558", "0.47029856", "0.4701444", "0.47014076", "0.46973658", "0.46969122", "0.4692372", "0.46897912", "0.4683049", "0.4681391", "0.46810925", "0.46750805", "0.46722633", "0.46681988", "0.466349", "0.46618745", "0.46606532", "0.46533036", "0.46485004", "0.46464643", "0.46447286", "0.46447286", "0.46438906", "0.46405315", "0.46397775", "0.4634643", "0.46339533", "0.4633923", "0.4632826", "0.4631328", "0.46299514", "0.46285036", "0.46276402", "0.4625902" ]
0.0
-1
/ / / / / / / / / / / / / / /
public StandardGlyphVector layout(Font paramFont, FontRenderContext paramFontRenderContext, char[] paramArrayOfChar, int paramInt1, int paramInt2, int paramInt3, StandardGlyphVector paramStandardGlyphVector) /* */ { /* 365 */ if ((paramArrayOfChar == null) || (paramInt1 < 0) || (paramInt2 < 0) || (paramInt2 > paramArrayOfChar.length - paramInt1)) { /* 366 */ throw new IllegalArgumentException(); /* */ } /* */ /* 369 */ init(paramInt2); /* */ /* */ /* */ /* 373 */ if (paramFont.hasLayoutAttributes()) { /* 374 */ localObject1 = ((AttributeMap)paramFont.getAttributes()).getValues(); /* 375 */ if (((AttributeValues)localObject1).getKerning() != 0) this._typo_flags |= 0x1; /* 376 */ if (((AttributeValues)localObject1).getLigatures() != 0) { this._typo_flags |= 0x2; /* */ } /* */ } /* 379 */ this._offset = paramInt1; /* */ /* */ /* */ /* 383 */ Object localObject1 = SDCache.get(paramFont, paramFontRenderContext); /* 384 */ this._mat[0] = ((float)((SDCache)localObject1).gtx.getScaleX()); /* 385 */ this._mat[1] = ((float)((SDCache)localObject1).gtx.getShearY()); /* 386 */ this._mat[2] = ((float)((SDCache)localObject1).gtx.getShearX()); /* 387 */ this._mat[3] = ((float)((SDCache)localObject1).gtx.getScaleY()); /* 388 */ this._pt.setLocation(((SDCache)localObject1).delta); /* */ /* 390 */ int i = paramInt1 + paramInt2; /* */ /* 392 */ int j = 0; /* 393 */ int k = paramArrayOfChar.length; /* 394 */ if (paramInt3 != 0) { /* 395 */ if ((paramInt3 & 0x1) != 0) { /* 396 */ this._typo_flags |= 0x80000000; /* */ } /* */ /* 399 */ if ((paramInt3 & 0x2) != 0) { /* 400 */ j = paramInt1; /* */ } /* */ /* 403 */ if ((paramInt3 & 0x4) != 0) { /* 404 */ k = i; /* */ } /* */ } /* */ /* 408 */ int m = -1; /* */ /* 410 */ Object localObject2 = FontUtilities.getFont2D(paramFont); /* 411 */ if ((localObject2 instanceof FontSubstitution)) { /* 412 */ localObject2 = ((FontSubstitution)localObject2).getCompositeFont2D(); /* */ } /* */ /* 415 */ this._textRecord.init(paramArrayOfChar, paramInt1, i, j, k); /* 416 */ int n = paramInt1; /* 417 */ if ((localObject2 instanceof CompositeFont)) { /* 418 */ this._scriptRuns.init(paramArrayOfChar, paramInt1, paramInt2); /* 419 */ this._fontRuns.init((CompositeFont)localObject2, paramArrayOfChar, paramInt1, i); /* 420 */ while (this._scriptRuns.next()) { /* 421 */ i1 = this._scriptRuns.getScriptLimit(); /* 422 */ i2 = this._scriptRuns.getScriptCode(); /* 423 */ while (this._fontRuns.next(i2, i1)) { /* 424 */ PhysicalFont localPhysicalFont = this._fontRuns.getFont(); /* */ /* */ /* */ /* */ /* */ /* */ /* 431 */ if ((localPhysicalFont instanceof NativeFont)) { /* 432 */ localPhysicalFont = ((NativeFont)localPhysicalFont).getDelegateFont(); /* */ } /* 434 */ int i4 = this._fontRuns.getGlyphMask(); /* 435 */ int i5 = this._fontRuns.getPos(); /* 436 */ nextEngineRecord(n, i5, i2, m, localPhysicalFont, i4); /* 437 */ n = i5; /* */ } /* */ } /* */ } /* 441 */ this._scriptRuns.init(paramArrayOfChar, paramInt1, paramInt2); /* 442 */ while (this._scriptRuns.next()) { /* 443 */ i1 = this._scriptRuns.getScriptLimit(); /* 444 */ i2 = this._scriptRuns.getScriptCode(); /* 445 */ nextEngineRecord(n, i1, i2, m, (Font2D)localObject2, 0); /* 446 */ n = i1; /* */ } /* */ /* */ /* 450 */ int i1 = 0; /* 451 */ int i2 = this._ercount; /* 452 */ int i3 = 1; /* */ /* 454 */ if (this._typo_flags < 0) { /* 455 */ i1 = i2 - 1; /* 456 */ i2 = -1; /* 457 */ i3 = -1; /* */ } /* */ /* */ /* 461 */ this._sd = ((SDCache)localObject1).sd; /* 462 */ Object localObject3; for (; i1 != i2; i1 += i3) { /* 463 */ localObject3 = (EngineRecord)this._erecords.get(i1); /* */ for (;;) { /* */ try { /* 466 */ ((EngineRecord)localObject3).layout(); /* */ } /* */ catch (IndexOutOfBoundsException localIndexOutOfBoundsException) /* */ { /* 470 */ if (this._gvdata._count >= 0) { /* 471 */ this._gvdata.grow(); /* */ } /* */ } /* */ } /* */ /* 476 */ if (this._gvdata._count < 0) { /* */ break; /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 489 */ if (this._gvdata._count < 0) { /* 490 */ localObject3 = new StandardGlyphVector(paramFont, paramArrayOfChar, paramInt1, paramInt2, paramFontRenderContext); /* 491 */ if (FontUtilities.debugFonts()) { /* 492 */ FontUtilities.getLogger().warning("OpenType layout failed on font: " + paramFont); /* */ } /* */ } /* */ else { /* 496 */ localObject3 = this._gvdata.createGlyphVector(paramFont, paramFontRenderContext, paramStandardGlyphVector); /* */ } /* */ /* 499 */ return (StandardGlyphVector)localObject3; /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "double passer();", "int getWidth() {return width;}", "public Integer getWidth(){return this.width;}", "public void divide() {\n\t\t\n\t}", "private int rightChild(int i){return 2*i+2;}", "public abstract void bepaalGrootte();", "int width();", "public double getWidth() {\n return this.size * 2.0; \n }", "public void getTile_B8();", "static int getNumPatterns() { return 64; }", "public void gored() {\n\t\t\n\t}", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public int getEdgeCount() \n {\n return 3;\n }", "public String ring();", "int getTribeSize();", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "public String toString(){ return \"DIV\";}", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "long getWidth();", "void mo33732Px();", "public double getWidth() { return _width<0? -_width : _width; }", "public int getWidth() {\r\n\treturn this.width;\r\n}", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "double getNewWidth();", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "public int generateRoshambo(){\n ;]\n\n }", "double seBlesser();", "public int my_leaf_count();", "public static int size_parent() {\n return (8 / 8);\n }", "public abstract int getSpotsNeeded();", "public abstract String division();", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "@Override\n public void bfs() {\n\n }", "public int getBlockLength()\r\n/* 45: */ {\r\n/* 46:107 */ return -32;\r\n/* 47: */ }", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "@Override\n public String toString()\n {\n\treturn getClass().getSimpleName() + \" (\" + getLength() + \"x\" + getWidth() + \")\";\n }", "long getMid();", "long getMid();", "int getSpriteArraySize();", "public void leerPlanesDietas();", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "@Override\npublic void processDirection() {\n\t\n}", "int expand();", "public int getWidth(){\n return width;\n }", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "public void skystonePos4() {\n }", "int getSize ();", "public static int size_parentId() {\n return (16 / 8);\n }", "public abstract double getBaseWidth();", "public int getTakeSpace() {\n return 0;\n }", "@Override\r\n\tpublic int getWidth() {\n\t\treturn 0;\r\n\t}", "public String getRing();", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "Operations operations();", "private int get_left_child(int index){\r\n return 2 * index + 1;\r\n }", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "public int getWidth()\n {return width;}", "public double getPerimiter(){return (2*height +2*width);}", "double volume(){\n return width*height*depth;\n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic int sount() {\n\t\treturn 0;\n\t}", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "int depth();", "int depth();", "@Override\n\tpublic int taille() {\n\t\treturn 1;\n\t}", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "String directsTo();", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "private int get_parent(int index){\r\n return (index-1)/2;\r\n }", "public String getRingback();", "@Override\n public int width()\n {\n return widthCent; //Charlie Gao helped me debug the issue here\n }", "Parallelogram(){\n length = width = height = 0;\n }", "public static int offset_parent() {\n return (40 / 8);\n }", "public int width();", "protected int parent(int i) { return (i - 1) / 2; }", "@Override\r\n\tpublic void walk() {\n\r\n\t}", "public double width() { return _width; }", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();" ]
[ "0.54599804", "0.5361702", "0.50828", "0.50729156", "0.5065769", "0.50643295", "0.50565934", "0.5055456", "0.5028421", "0.50179166", "0.50039816", "0.499804", "0.49814743", "0.49544477", "0.49448815", "0.49297482", "0.49270833", "0.49128833", "0.49060607", "0.49048623", "0.49025092", "0.48927355", "0.48850867", "0.48793495", "0.4873459", "0.48655418", "0.48652473", "0.48625624", "0.48600852", "0.48540562", "0.4852789", "0.48380706", "0.4837795", "0.48361942", "0.48162308", "0.48144838", "0.48133746", "0.4809166", "0.48090833", "0.4805904", "0.47893128", "0.47792563", "0.477846", "0.47676873", "0.47675538", "0.47675538", "0.47663707", "0.4764925", "0.47641346", "0.47622687", "0.47604173", "0.47586957", "0.4758448", "0.47558358", "0.47437528", "0.4740404", "0.47399476", "0.47302055", "0.47294307", "0.4727397", "0.47248995", "0.47240293", "0.47203907", "0.4720172", "0.47157845", "0.47106573", "0.47105056", "0.47027174", "0.47006288", "0.46993494", "0.4694658", "0.4694658", "0.46940482", "0.4689993", "0.46848714", "0.4680495", "0.4680448", "0.46780542", "0.46775758", "0.467456", "0.46729854", "0.46721813", "0.4664212", "0.4662582", "0.4658465", "0.465841", "0.46579123", "0.46579123", "0.46579123", "0.46579123", "0.46579123", "0.46579123", "0.46579123", "0.46579123", "0.46579123", "0.46579123", "0.46579123", "0.46579123", "0.46579123", "0.46579123", "0.46579123" ]
0.0
-1
/ / / / /
private GlyphLayout() /* */ { /* 507 */ this._gvdata = new GVData(); /* 508 */ this._textRecord = new TextRecord(); /* 509 */ this._scriptRuns = new ScriptRun(); /* 510 */ this._fontRuns = new FontRunIterator(); /* 511 */ this._erecords = new ArrayList(10); /* 512 */ this._pt = new Point2D.Float(); /* 513 */ this._sd = new FontStrikeDesc(); /* 514 */ this._mat = new float[4]; /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void divide() {\n\t\t\n\t}", "private int parent(int i){return (i-1)/2;}", "public abstract void bepaalGrootte();", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "public void gored() {\n\t\t\n\t}", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "public abstract String division();", "private int leftChild(int i){return 2*i+1;}", "public static void slashes() {\n\t\tSystem.out.println(\"//////////////////////\");\r\n\r\n\t}", "double passer();", "public String ring();", "private int rightChild(int i){return 2*i+2;}", "public String toString(){ return \"DIV\";}", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public void division() {\n\t\tx=1;\n\t\ty=0;\n\t\tz=x/y;\n\t\t\t\t\n\t}", "static void pyramid(){\n\t}", "public static void main(String[] args) {\n\n\n for(int a=0; a<7;a++){\n for(int b=0;b<7-a;b++){\n System.out.print(\" \");\n }\n for(int c=0; c<=a;c++){\n System.out.print(\"* \");\n }\n System.out.println(\" \");\n }\n\n }", "public void stg() {\n\n\t}", "void mo33732Px();", "Operations operations();", "void sharpen();", "void sharpen();", "public void skystonePos4() {\n }", "private static void breadcrumbArrow(int width, int height, int indent, int c1, int c2) {\n\n\t\tdouble x0 = 0, y0 = height / 2d;\n\t\tdouble x1 = indent, y1 = 0;\n\t\tdouble x2 = indent, y2 = height / 2d;\n\t\tdouble x3 = indent, y3 = height;\n\t\tdouble x4 = width, y4 = 0;\n\t\tdouble x5 = width, y5 = height / 2d;\n\t\tdouble x6 = width, y6 = height;\n\t\tdouble x7 = indent + width, y7 = 0;\n\t\tdouble x8 = indent + width, y8 = height;\n\n\t\tint fc1 = ColorHelper.mixAlphaColors(c1, c2, 0);\n\t\tint fc2 = ColorHelper.mixAlphaColors(c1, c2, (indent)/(width + 2f * indent));\n\t\tint fc3 = ColorHelper.mixAlphaColors(c1, c2, (indent + width)/(width + 2f * indent));\n\t\tint fc4 = ColorHelper.mixAlphaColors(c1, c2, 1);\n\n\t\tRenderSystem.disableTexture();\n\t\tRenderSystem.enableBlend();\n\t\tRenderSystem.disableAlphaTest();\n\t\tRenderSystem.defaultBlendFunc();\n\t\tRenderSystem.shadeModel(GL11.GL_SMOOTH);\n\n\t\tTessellator tessellator = Tessellator.getInstance();\n\t\tBufferBuilder bufferbuilder = tessellator.getBuffer();\n\t\tbufferbuilder.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR);\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x7, y7, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x8, y8, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\ttessellator.draw();\n\t\tRenderSystem.shadeModel(GL11.GL_FLAT);\n\t\tRenderSystem.disableBlend();\n\t\tRenderSystem.enableAlphaTest();\n\t\tRenderSystem.enableTexture();\n\t}", "double volume(){\n return width*height*depth;\n }", "private void pointer(Graphics image,int x,int y,int height,int b,int dir) {\n\n\t\tint[] xt=new int[3];\n\t\tint[] yt=new int[3];\n\n\t\tif(dir==0) {\n\t\t\txt[0]=x;\n\t\t\txt[1]=xt[2]=x+height;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=y+b/2;\n\t\t\tyt[2]=y-b/2;\n\t\t} else {\n\t\t\txt[0]=x;\n\t\t\txt[1]=x+b/2;\n\t\t\txt[2]=x-b/2;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=yt[2]=y-height;\n\t\t}\n\t\timage.fillPolygon(xt,yt,3);\n\t}", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "public int generateRoshambo(){\n ;]\n\n }", "@Override\n public void bfs() {\n\n }", "public static void part2(){\n\t\n System.out.println(\"\\\\\"); //Outer wall\n System.out.println(\"\\\\\");\n System.out.println(\"\\\\\");\n for(int i = 0; i <= 16; i++){ //loop created to display top of the door\n\n \tSystem.out.print(\"-\");\n\n\t}\n System.out.println(\"\");\n System.out.println(\"\\\\\\t\\t| \\t(\\\")\"); //The door and the stick figure\n System.out.println(\"\\\\\\t\\t|\\t-|-\");\n System.out.println(\"\\\\\\t o | \\t |\");\n System.out.println(\"\\\\\\t\\t|\\t /\\\\\");\n System.out.println(\"\\\\\\t\\t|\\t/ \\\\\");\n\t\t\n }", "public static void main(String[] args) {\n\t\tfor(int j=0;j<8;j++){\n\t\t\tfor(int i=0;i<8;i++){\n\t\t\t\t//上下两侧\n\t\t\t\tif(j==0||j==7){\n\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}else{\n\t\t\t\t\t//中间\n\t\t\t\t\tif(i>0&&i<7){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "int getWidth() {return width;}", "public void draw(){\n for(int i = 1; i <= height; i++){\n for(int s = 1; s <= i; s++)\n System.out.print(\"*\");\n System.out.println();\n }\n }", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "Parallelogram(){\n length = width = height = 0;\n }", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "void ringBell() {\n\n }", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "public static void unionPathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze two = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\tSystem.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = two.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber+n) != S.findAndCompress(randomNumber)){\n\t\t\t\t\t\tS.union(randomNumber+n, randomNumber);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'u');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.union(randomNumber, randomNumber+1);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(two, n);\n\t\tuserSelection_SolveMaze(n);\n\n\n\t\tStdDraw.show(0);\n\t\ttwo.draw();\n\t\ttwo.printCellNumbers();\n\t}", "void doubleBox(int sides, float x1, float y1, float z1, float x2, float y2, float z2)\r\n/* 100: */ {\r\n/* 101: 99 */ int s2 = sides << 1 & 0x2A | sides >> 1 & 0x15;\r\n/* 102: */ \r\n/* 103:101 */ this.context.renderBox(sides, x1, y1, z1, x2, y2, z2);\r\n/* 104:102 */ this.context.renderBox(s2, x2, y2, z2, x1, y1, z1);\r\n/* 105: */ }", "int width();", "private boolean slash() {\r\n return MARK(OPERATOR) && CHAR('/') && gap();\r\n }", "private void traversePath()\n\t{\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t}", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "void walk() {\n\t\t\n\t}", "double getPerimeter(){\n return 2*height+width;\n }", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "public double getWidth() { return _width<0? -_width : _width; }", "public static void main(String[] args) {\n\t\tint n=5;\n\t\tfor(int i=n-1;i>=0;i--)\n\t\t{\n\t\t\tfor(int space=0;space<n-1-i;space++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tfor(int j=0;j<=i*2;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"* \");\n\t\t\t}\n\t\t\n\t\tSystem.out.println();\n\t}\n\n}", "public void draw4x4 (char design){\n System.out.println(\"\"+design+design+design+design);\n System.out.println(design+\" \"+design);\n System.out.println(design+\" \"+design);\n System.out.println(\"\"+design+design+design+design);\n}", "private void createPath(Direction d, int width, Point p1, Point p2) {\n\t\t// Determine how far away from the center the corners are\n\t\tint sideOneOffset = 0;\t// Top or Left depending on path direction\n\t\tint sideTwoOffset = 0;\t// Bot or Right depending on path direction\n\t\t// If the width is odd, balance the offsets\n\t\tif (width % 2 != 0) {\t\n\t\t\tsideOneOffset = sideTwoOffset = ((width / 2) + 1);\n\t\t} else {\n\t\t\t// If the width is even, the offsets will be off by 1\n\t\t\tsideOneOffset = width;\n\t\t\tsideTwoOffset = width - 1;\n\t\t}\n\t\tif (d == Direction.LEFT || d == Direction.RIGHT) {\n\t\t\t// If the direction is left then we want to swap the points\n\t\t\t// to pretend like the direction was right (so the following code works)\n\t\t\tif (d == Direction.LEFT) {\n\t\t\t\tPoint tempP = p2;\n\t\t\t\tp2 = p1;\n\t\t\t\tp1 = tempP;\n\t\t\t}\n\t\t\t// Set the four corners\n\t\t\tpathSquares.add(new PathSquare(\"top-left\", new Point(p1.x, p1.y - sideOneOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-left\", new Point(p1.x, p1.y + sideTwoOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"top-right\", new Point(p2.x, p1.y - sideOneOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-right\", new Point(p2.x, p1.y + sideTwoOffset)));\n\t\t\t// Set the left and right walls\n\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t// (i - width/2) ensures that p1.y is the center of the path (top to bottom)\n\t\t\t\tpathSquares.add(new PathSquare(\"left\", new Point(p1.x, p1.y + (i - width/2))));\n\t\t\t\tpathSquares.add(new PathSquare(\"right\", new Point(p2.x, p2.y + (i - width/2))));\n\t\t\t}\n\t\t\t// Set middle path and top/bottom padding (horizontal Oreo!)\n\t\t\tfor (int col = p1.x + 1, endCol = p2.x; col < endCol; col++) {\n\t\t\t\t// Add the top wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"top\", new Point(col, p1.y - sideOneOffset)));\t\t\t\t\n\t\t\t\t// Add the delicious cream filling\n\t\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t\tpathSquares.add(new PathSquare(\"middle\", new Point(col, p1.y + (i - width /2))));\n\t\t\t\t}\t\t\t\t\n\t\t\t\t// Add the bottom wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"bot\", new Point(col, p1.y + sideTwoOffset)));\n\t\t\t}\n\t\t} else {\n\t\t\t// If the direction is up then we want to swap the points\n\t\t\t// to pretend like the direction was down (so the following code works)\n\t\t\tif (d == Direction.UP) {\n\t\t\t\tPoint tempP = p2;\n\t\t\t\tp2 = p1;\n\t\t\t\tp1 = tempP;\n\t\t\t}\n\t\t\t// Set the four corners\n\t\t\tpathSquares.add(new PathSquare(\"top-left\", new Point(p1.x - sideOneOffset, p1.y)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-left\", new Point(p2.x - sideOneOffset, p2.y)));\n\t\t\tpathSquares.add(new PathSquare(\"top-right\", new Point(p1.x + sideTwoOffset, p1.y)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-right\", new Point(p2.x + sideTwoOffset, p2.y)));\n\t\t\t// Set the top and bottom walls\n\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t// (i - width/2) ensures that p1.x is the center of the path (left to right)\n\t\t\t\tpathSquares.add(new PathSquare(\"top\", new Point(p1.x + (i - width /2), p1.y)));\n\t\t\t\tpathSquares.add(new PathSquare(\"bot\", new Point(p2.x + (i - width /2), p2.y)));\n\t\t\t}\n\t\t\t// Set middle path and left/right padding (vertical Oreo!)\n\t\t\tfor (int row = p1.y + 1, endRow = p2.y; row < endRow; row++) {\n\t\t\t\t// Add the left wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"left\", new Point(p1.x - sideOneOffset, row)));\t\t\t\t\n\t\t\t\t// Add the delicious cream filling\n\t\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t\tpathSquares.add(new PathSquare(\"middle\", new Point(p1.x + (i - width /2), row)));\n\t\t\t\t}\t\t\t\t\n\t\t\t\t// Add the right wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"right\", new Point(p1.x + sideTwoOffset, row)));\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "@Override\npublic void processDirection() {\n\t\n}", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "public void renderCenterBlock(int cons, int side, int end)\r\n/* 143: */ {\r\n/* 144:135 */ if (cons == 0)\r\n/* 145: */ {\r\n/* 146:136 */ this.context.setTex(end);\r\n/* 147:137 */ doubleBox(63, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 148:138 */ return;\r\n/* 149: */ }\r\n/* 150:139 */ if (cons == 3)\r\n/* 151: */ {\r\n/* 152:140 */ this.context.setTexFlags(1773);\r\n/* 153:141 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 154:142 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 155:143 */ return;\r\n/* 156: */ }\r\n/* 157:144 */ if (cons == 12)\r\n/* 158: */ {\r\n/* 159:145 */ this.context.setTexFlags(184365);\r\n/* 160:146 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 161:147 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F);\r\n/* 162:148 */ return;\r\n/* 163: */ }\r\n/* 164:149 */ if (cons == 48)\r\n/* 165: */ {\r\n/* 166:150 */ this.context.setTexFlags(187200);\r\n/* 167:151 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 168:152 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 169:153 */ return;\r\n/* 170: */ }\r\n/* 171:155 */ this.context.setTex(end);\r\n/* 172:156 */ doubleBox(0x3F ^ cons, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 173:157 */ if ((cons & 0x1) > 0)\r\n/* 174: */ {\r\n/* 175:158 */ this.context.setTexFlags(1773);\r\n/* 176:159 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 177:160 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 0.375F, 0.625F);\r\n/* 178: */ }\r\n/* 179:162 */ if ((cons & 0x2) > 0)\r\n/* 180: */ {\r\n/* 181:163 */ this.context.setTexFlags(1773);\r\n/* 182:164 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 183:165 */ doubleBox(60, 0.375F, 0.625F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 184: */ }\r\n/* 185:167 */ if ((cons & 0x4) > 0)\r\n/* 186: */ {\r\n/* 187:168 */ this.context.setTexFlags(184365);\r\n/* 188:169 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 189:170 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 0.375F);\r\n/* 190: */ }\r\n/* 191:172 */ if ((cons & 0x8) > 0)\r\n/* 192: */ {\r\n/* 193:173 */ this.context.setTexFlags(184365);\r\n/* 194:174 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 195:175 */ doubleBox(51, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F, 1.0F);\r\n/* 196: */ }\r\n/* 197:177 */ if ((cons & 0x10) > 0)\r\n/* 198: */ {\r\n/* 199:178 */ this.context.setTexFlags(187200);\r\n/* 200:179 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 201:180 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F);\r\n/* 202: */ }\r\n/* 203:182 */ if ((cons & 0x20) > 0)\r\n/* 204: */ {\r\n/* 205:183 */ this.context.setTexFlags(187200);\r\n/* 206:184 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 207:185 */ doubleBox(15, 0.625F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 208: */ }\r\n/* 209: */ }", "public static String makeShapeA() {\n\tString result = \"\";\n\t\tfor (int i = 0; i < 8 ; i++) {\n\t\t\tresult+=printHash(i);\n\t\t\t\n\t\t}return result;\n\t\t\t//System.out.println(printHash(i));\n\t\t}", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "public void foundLeaf(int width, int height, int level, int currX, int currY, int location) {\n level = level +2;\n if (location == 1) {\n\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - ( (new Double(spatialHeight / Math.pow(2, level ))).intValue()),\n currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY * 2,\n Color.BLACK);\n\n\n canvas.addLine(((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue())) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n currX,\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n\n }\n\n if (location == 2) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n ( currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n (currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n\n\n }\n\n if (location == 3) {\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY,\n Color.BLACK);\n\n\n\n canvas.addLine((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n\tcurrY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n (currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n }\n\n if (location == 4) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY,\n Color.BLACK);\n\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue() + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), Color.BLACK);\n\n\n }\n\n\n\n\n }", "double volume() {\n\treturn width*height*depth;\n}", "@Override\r\n public void draw()\r\n {\n\r\n }", "@Override\n protected void paint2d(Graphics2D g) {\n \n }", "public static void method1(){\n System.out.println(\"*****\");\n System.out.println(\"*****\");\n System.out.println(\" * *\");\n System.out.println(\" *\");\n System.out.println(\" * *\");\n }", "@Override\n\tpublic void draw3() {\n\n\t}", "private void renderPath(Node n)\n {\n\tGraphics g = getGraphics();\n\tboolean painting;\n\tColor nc,lc;\n\n\tpainting = (n.paths_passing==0);\n\twhile (n != null) {\n\t if (painting)\n\t\tn.paths_passing++;\n\t else {\n\t\tn.paths_passing--;\n\t }\n\t \n// \t nc = (n.paths_passing > 0)?hilitcolor:normalcolor;\n// \t lc = (n.paths_passing > 0)?hilitcolor:linecolor;\n\t nc = (n.paths_passing > 0)?n.path_color:normalcolor;\n\t lc = (n.paths_passing > 0)?n.path_color:linecolor;\n\t \n\t if (n.parent == null) {\n\t\tsetRenderColor(g,nc);\n\t\trenderNode(g,n);\n\t\tbreak;\n\t }\n\n\t // Double line width\n\t //setRenderColor(g,(n.paths_passing>0)?hilitcolor:Color.white);\n\t setRenderColor(g,(n.paths_passing>0)?n.path_color:Color.white);\n\t renderLine(g,n.x-1,n.y,n.parent.x-1,n.parent.y);\t\n\n\t setRenderColor(g,lc);\n\t renderLine(g,n.x,n.y,n.parent.x,n.parent.y);\n\n\t setRenderColor(g,nc);\n\t renderNode(g,n);\n\t n = n.parent;\n\t}\n }", "int fi(int x, int y) {\n\t\treturn (x + 1) + (width + 2) * (y + 1);\n\t}", "double defendre();", "public void getTile_B8();", "public void SubRect(){\n\t\n}", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "void mo21076g();", "@Override\n\tpublic void draw() {\n\n\t}", "@Override\n\tpublic void draw() {\n\n\t}", "public double getWidth() {\n return this.size * 2.0; \n }", "public void skystonePos2() {\n }", "public void skystonePos5() {\n }", "public double getPerimiter(){return (2*height +2*width);}", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "public static void topHalf() {\n \t\n for( int i = 1; i <= SIZE; i++){\n for(int spaces = 1; spaces <= 3*SIZE - 3*i; spaces++) {\n System.out.print(\" \"); \n }\n \n for(int j = 1; j <= 1; j++) {\n System.out.print(\"__/\");\n }\n \n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\":::\");\n }\n \n System.out.print(\"||\");\n \n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\":::\");\n }\n \n for(int j = 1; j <= 1; j++) {\n System.out.print(\"\\\\__\");\n }\n \n System.out.println();\n }\n \n System.out.print(\"|\");\n \n for(int i = 1; i <= 6 * SIZE; i++) {\n System.out.print(\"\\\"\");\n }\n \n System.out.println(\"|\");\n }", "public static void body() {\n \tfor(int i = 1; i <= SIZE*SIZE; i++) {\n for(int j = 1; j <= 3*SIZE-(SIZE-1); j++) {\n System.out.print(\" \");\n }\n \n System.out.print(\"|\");\n for(int j = 1; j <= SIZE-2; j++) {\n \tSystem.out.print(\"%\");\n }\n System.out.print(\"||\");\n for(int j = 1; j <= SIZE-2; j++) {\n \tSystem.out.print(\"%\");\n }\n System.out.print(\"|\");\n \n System.out.println();\n }\n }", "public void skystonePos3() {\n }", "double seBlesser();", "public wall() { //default constructor makes a 10x10 square extending right and down from the pixel located at 5,5\r\n x = 5;\r\n y = 5;\r\n height = 10;\r\n width = 10;\r\n }", "void block(Directions dir);", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "public static void main(String[] args) {\nint i,j,k;\r\nint num=5;\r\nfor(i=0;i<num;i++){\r\n\tfor(j=0;j<i;j++){\r\n\t\tSystem.out.print(\" \");\r\n\t}\r\n\tfor(k=num; k>=2*i-1; k--){\r\n\t\tSystem.out.print(\"*\");\r\n\t}\r\n\t\r\n\tSystem.out.println();\r\n}\r\n\t}", "public RMPath getPath() { return RMPath.unitRectPath; }", "public int upright();", "private int uniquePaths(int x, int y, int[][] dp) {\n \t\tif (x == 0 || y == 0) return 1;\n \t\tif (dp[x][y] == 0)\n \t\t\tdp[x][y] = uniquePaths(x - 1, y, dp) + uniquePaths(x, y - 1, dp);\n \t\treturn dp[x][y];\n \t}", "public Integer getWidth(){return this.width;}", "public void skystonePos6() {\n }", "void GenerateBoardPath() {\n\t\t\t\n\t\t\tint rows = board.getRowsNum();\n\t\t\tint columns = board.getColsNum();\n\t\t\tint space_number = 1; \n\t\t\t\n\t\t\t\n\t\t\tfor (int i = rows - 1; i >= 0; i--) \n\t\t\t\t//If the row is an odd-number, move L-R\n\t\t\t\tif (i % 2 != 0) {\n\t\t\t\t\tfor (int j = 0; j < columns; j++) \n\t\t\t\t\t\tBoardPathRepository.put(space_number++, board.getTile(i, j));}\n\t\t\t\telse {\n\t\t\t\t\tfor (int j = columns-1; j >=0; j--) \n\t\t\t\t\t\tBoardPathRepository.put(space_number++, board.getTile(i, j));\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t}", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "private void render() {\n StringBuilder builder = new StringBuilder();\n builder.append(horizontalEdge).append(\"\\n\");\n for (int i = 0; i < this.height; i++) {\n builder.append(VERTICAL_CHAR);\n for (int j = 0; j < this.width; j++) {\n builder.append(pixels[i][j]);\n }\n builder.append(VERTICAL_CHAR);\n builder.append(\"\\n\");\n }\n builder.append(horizontalEdge);\n System.out.printf(builder.toString());\n }", "@Override\n\tpublic void breath() {\n\n\t}", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "public\nstatic\nvoid\nmain(String args[]) \n\n{ \n\nBinaryTree tree = \nnew\nBinaryTree(); \n\ntree.root = \nnew\nNode(\n20\n); \n\ntree.root.left = \nnew\nNode(\n8\n); \n\ntree.root.left.left = \nnew\nNode(\n4\n); \n\ntree.root.left.right = \nnew\nNode(\n12\n); \n\ntree.root.left.right.left = \nnew\nNode(\n10\n); \n\ntree.root.left.right.right = \nnew\nNode(\n14\n); \n\ntree.root.right = \nnew\nNode(\n22\n); \n\ntree.root.right.right = \nnew\nNode(\n25\n); \n\ntree.printBoundary(tree.root); \n\n}", "public static void main(String[] args) {\n\r\n\t\t\r\n\t\tint n = 7;\r\n\t\tfor (int i = n; i >= 0; i--) {\r\n\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t for(int j=0; j<n-i; j++) {\r\n\t\t\t \r\n\t\t\t System.out.print(\" \");\r\n\t\t\t \r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t \r\n\r\n\t\t\tfor (int j = n; j >= n-i; j--) {\r\n\r\n\t\t\t\tSystem.out.print(\"*\");\r\n\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t}\r\n\r\n\t\t\r\n\t}", "@Override\n\tpublic void draw() {\n\t}", "private void division()\n\t{\n\t\tFun = Function.DIVIDE; //Function set to determine what action should be taken later.\n\t\t\n\t\t\tsetLeftValue();\n\t\t\tentry.grabFocus();\n\t\t\n\t}" ]
[ "0.5654086", "0.5282051", "0.5270874", "0.5268489", "0.5230159", "0.5229372", "0.5205559", "0.51923394", "0.51524484", "0.50993294", "0.50948834", "0.5071109", "0.5043058", "0.5009983", "0.5006536", "0.49739555", "0.49691963", "0.4959123", "0.49568397", "0.49425906", "0.49421698", "0.49421698", "0.4903223", "0.4897176", "0.48879617", "0.48803073", "0.48741165", "0.48718095", "0.48679698", "0.48646608", "0.48598114", "0.48402584", "0.48362267", "0.48321876", "0.48310882", "0.4825809", "0.48227587", "0.48175377", "0.48045233", "0.48045233", "0.48002362", "0.47911668", "0.47906598", "0.4776121", "0.47734705", "0.47673976", "0.475685", "0.47517157", "0.47446346", "0.47364715", "0.47353277", "0.47321412", "0.47242466", "0.4721296", "0.47190621", "0.47164857", "0.47148356", "0.47142458", "0.47103566", "0.47027764", "0.47023293", "0.4701804", "0.46992764", "0.46985114", "0.46954885", "0.4695406", "0.46914175", "0.4690724", "0.46901584", "0.4686765", "0.4682771", "0.46786475", "0.46786475", "0.4676364", "0.46714565", "0.46710065", "0.46701837", "0.46698236", "0.46671712", "0.466633", "0.4663725", "0.46617198", "0.46599096", "0.46593648", "0.4654308", "0.46481097", "0.46472353", "0.46443266", "0.46441418", "0.46438584", "0.4642061", "0.46387514", "0.46382058", "0.46375832", "0.4636777", "0.46365395", "0.46365395", "0.46359038", "0.4635539", "0.46332848", "0.46326485" ]
0.0
-1
Add to result collection only items wich suits player's level
private Collection<ExtractedItemsCollection> filterItemsByLevel(Player player, List<ExtractedItemsCollection> itemsCollections) { int playerLevel = player.getLevel(); Collection<ExtractedItemsCollection> result = new ArrayList<ExtractedItemsCollection>(); for (ExtractedItemsCollection collection : itemsCollections) { if (collection.getMinLevel() > playerLevel) { continue; } if (collection.getMaxLevel() > 0 && collection.getMaxLevel() < playerLevel) { continue; } result.add(collection); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Collection<ExtractedItemsCollection> filterItemsByLevel(Player player, List<ExtractedItemsCollection> itemsCollections) {\n int playerLevel = player.getLevel();\n Collection<ExtractedItemsCollection> result = new ArrayList<ExtractedItemsCollection>();\n for (ExtractedItemsCollection collection : itemsCollections) {\n if (collection.getMinLevel() > playerLevel) {\n continue;\n }\n if (collection.getMaxLevel() > 0 && collection.getMaxLevel() < playerLevel) {\n continue;\n }\n result.add(collection);\n }\n return result;\n }", "public List<PlayerItem> getAllPlayerItemById(Player player);", "public void givePlayerLevelBonus() {\n\t\tfor(Player p : playerList) {\n\t\t\tif(p.getType() == PlayerType.Agent) {\n\t\t\t\tp.addScore(5 * (currentLevel-1));\n\t\t\t}\n\t\t}\n\t\tserver.updateHighscoreList();\n\t\tserver.addTextToLoggingWindow(\"Server gives all players level bonus\");\n\t}", "abstract void applyItem(JuggernautPlayer player, int level);", "public void setItemLevel(int level) { this.level = level; }", "public List<PlayerItem> getSpecific(int playerItemId);", "public List<PlayerItem> getAll();", "public void addPlayableLevel(Level level){\r\n if(!currentLevel.isPlayableLevel()){\r\n setCurrentLevel(level);\r\n }else{\r\n currentLevel.addPlayingLevel(level);\r\n }\r\n }", "public LevelFilter(final Collection<Level> includedLevels) {\n this.includedLevels = new HashSet<Level>(includedLevels);\n }", "public void setEnchantLevel(CustomEnchantment ce, Player p, long level){\n ItemStack is;\n ItemMeta im;\n List<String> lore;\n if(p == null || (is = p.getInventory().getItemInMainHand()) == null || (im = is.getItemMeta()) == null || (is.getType() != Material.DIAMOND_PICKAXE)) return;\n lore = im.getLore();\n if(lore == null)\n lore = new ArrayList<>();\n boolean containsEnchant = false;\n for(int i = 0; i < lore.size(); i++){\n if(lore.get(i).contains(ce.getDisplayName())){\n containsEnchant = true;\n lore.set(i, ce.getColor() + ce.getDisplayName() + \" \" + level);\n }\n }\n if(!containsEnchant) lore.add(ce.getColor() + ce.getDisplayName() + \" \" + level);\n im.setLore(lore);\n is.setItemMeta(im);\n\n\n\n\n\n }", "@Override\n\tpublic JSONArray getUserResult(String username, String level) {\n\t\tArrayList<Results> re = (ArrayList<Results>) resultsDAO.getUserResult(\n\t\t\t\tusername, level);\n//\t\tJsonConfig jsonConfig = new JsonConfig();\n//\t\tjsonConfig.setExcludes(new String[] { \"users\", \"exams\", \"shenyans\",\n//\t\t\t\t\"certificates\", \"resultses\", \"achievements\",\n//\t\t\t\t\"prof2sForClass1name\", \"prof2sForC1id\" });\n//\t\treturn JSONArray.fromObject(re, jsonConfig);\n\t\tJSONArray json = new JSONArray();\n\t\tJSONObject jo = null;\n\t\tIterator iter = re.iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\tObject[] data = (Object[]) iter.next();\n\t\t\tjo = new JSONObject();\n\t\t\tjo.put(\"achievement\", data[0]);\n\t\t\tjo.put(\"prof1name\", data[1]);\n\t\t\tjo.put(\"prof2name\", data[2]);\n\t\t\tjo.put(\"writescore\", data[3]);\n\t\t\tjo.put(\"interviewscore\", data[4]);\n\t\t\tjo.put(\"total\", data[5]);\n\t\t\tjo.put(\"canjia\", data[6]);\n\t\t\tjo.put(\"approval\", data[7]);\n\t\t\tjo.put(\"opposition\", data[8]);\n\t\t\tjo.put(\"number\", data[9]);\n\t\t\tjo.put(\"name\", data[10]);\n\t\t\tjo.put(\"gender\", data[11]);\n\t\t\tjo.put(\"birthday\", data[12]);\n\t\t\tjo.put(\"phone\", data[13]);\n\t\t\tjo.put(\"idnumber\", data[14]);\n\t\t\tjo.put(\"proviceName\", data[15]);\n\t\t\tjo.put(\"cityName\", data[16]);\n\t\t\tjo.put(\"countyName\", data[17]);\n\t\t\tjo.put(\"townName\", data[18]);\n\t\t\tjo.put(\"education\", data[19]);\n\t\t\tjo.put(\"picpath\", data[20]);\n\t\t\tjson.add(jo);\n\t\t}\n\t\treturn json;\n\t}", "public List<Result> getPlayerResults(Player player) {\t\n\t\treturn results.stream()\n\t\t\t\t.filter(result -> result.participated(player))\n\t\t\t\t.collect(Collectors.toList());\n\t}", "public void addPlayerToStats(Player player) {\n\t\tfindForPlayer(player);\n\t}", "public static ArrayList<Player> getWinners(){return winners;}", "private boolean canIBuyLevels(int levels){\n return (this.level + levels < 10);\n }", "GameLevel listLevelRanking(Integer levelId) throws LevelNotFoundException;", "ArrayList<Player> getAllPlayer();", "public List<Player> lookForShootPeople(Player player)\n {\n List<Player> playerList = new LinkedList<>();\n\n playerList.addAll(player.getSquare().getRoom().getPlayerRoomList()); //adds all the players in the room\n\n /*\n * Now i have to check if the player is close to a door. In this case i can see all the players in this adiacent room.\n * I will implement the method in this way:\n * 1. I check if the player can move to a different room with a distance 1 using the method squareReachableNoWall\n * 2. If the player can effectively move to a different room it means it is close to a door\n * 3. I will add to the list all the players in this different room\n */\n\n for (Square square : player.getSquare().getGameBoard().getArena().squareReachableNoWall(player.getSquare().getX(), player.getSquare().getY(), 1))\n {\n if (!(player.getSquare().getColor().equals(square.getColor()))) // if the color of the reachable square is different from the color of the square\n // where the player is this means player can see in a different room\n {\n playerList.addAll(player.getSquare().getRoom().getPlayerRoomList()); //adds all the players in the room\n }\n\n }\n\n Set<Player> playerSet = new HashSet<>();\n playerSet.addAll(playerList);\n\n playerList.clear();\n\n playerList.addAll(playerSet);\n playerList.remove(player);\n\n\n return playerList;\n }", "public LevelFilter(final Level includedLevel) {\n includedLevels = Collections.singleton(includedLevel);\n }", "boolean hasNextLevelGold();", "public abstract Collection<PlayerFish> getPlayers();", "public List<Goods> getGoodsGivenBy(Player player) {\n List<Goods> goodsList = new ArrayList<Goods>();\n for (TradeItem ti : items) {\n if (ti instanceof GoodsTradeItem && player == ti.getSource()) {\n goodsList.add(((GoodsTradeItem)ti).getGoods());\n }\n }\n return goodsList;\n }", "public void loadMegaPlayersPack(Context context) {\n PlayerDAO playerDAO = new PlayerDAO(context);\n ArrayList<PackOpenerPlayer> players = playerDAO.getRarePlayers();\n\n Collections.shuffle(players);\n ArrayList<PackOpenerPlayer> tempPlayers = new ArrayList<>();\n int counter = 0;\n boolean higherRatedPlayerIncluded = false;\n while (tempPlayers.size() < 44) {\n if (players.get(counter).getRating() > 85) {\n if (!higherRatedPlayerIncluded) {\n tempPlayers.add(players.get(counter));\n higherRatedPlayerIncluded = true;\n }\n } else {\n tempPlayers.add(players.get(counter));\n }\n counter++;\n }\n Collections.sort(tempPlayers);\n packPlayers = new ArrayList<>(tempPlayers);\n }", "public boolean gainLevel() {\r\n if (this.player.getXp() > 100) {\r\n this.player.setXp(0);\r\n this.player.setMaxHp(this.player.getMaxHp() * 3 / 2);\r\n this.player.setHitPoints(this.player.getMaxHp());\r\n this.player.setLevel(this.player.getLevel() + 1);\r\n return true;\r\n }\r\n return false;\r\n }", "public static boolean inspectItems(Player player) {\n boolean itemExists = false;\n System.out.println(\"You look for items.\");\n System.out.println(\"You see:\");\n ArrayList<Collectable> items = player.getCurrentRoom().getItems();\n if(items.size() > 0) {\n itemExists = true;\n for (int i = 0; i < items.size(); i++) {\n System.out.print(\"\\t(\" + i + \") \");\n System.out.println(items.get(i).toString());\n }\n System.out.println(\"Which item will you take? (-1 to not collect any items)\");\n } else System.out.println(\"Nothing in sight\");\n return itemExists;\n }", "public boolean areAllAtLeast(int level) {\r\n for (int i = 0; i < SKILL_NAME.length; i++) {\r\n if (!ENABLED_SKILLS[i]) {\r\n continue;\r\n }\r\n // TODO CONSTRUCTION\r\n if (Objects.equals(SKILL_NAME[i], \"Construction\")) {\r\n continue;\r\n }\r\n if (getStaticLevel(i) < level) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "@Test\r\n\tpublic final void testAddLevel() {\r\n\t\tlevels.add(lostLevel2);\r\n\t\tgameStatisticsLoss.addLevel(lostLevel2);\r\n\t\tassertTrue(gameStatisticsLoss.getLevels().equals(levels));\r\n\t}", "public ArrayList<BoardGame> filterByPlayer(ArrayList<BoardGame> list) {\n //int playerCount = Integer.parseInt(numPlayers);\n int playerCount = extractInt(numPlayers);\n ArrayList<BoardGame> tempList = new ArrayList<>();\n for (BoardGame game: list) {\n //Debug print out\n Log.i(\"FILTER PLAYERS\", \"Game: \" + game.getName() + \" Min players: \" + game.getMinPlayers() +\n \" Max players: \" + game.getMaxPlayers() + \" Target players: \" + playerCount);\n //TODO: Is there some case for 10+ that would differ from the below?\n if(game.getMinPlayers() <= playerCount && game.getMaxPlayers() >= playerCount) {\n addGameToList(tempList, game);\n }\n }\n return tempList;\n }", "Collection<User> players();", "public void loadPremiumPlayersPack(Context context) {\n PlayerDAO playerDAO = new PlayerDAO(context);\n ArrayList<PackOpenerPlayer> players = playerDAO.get81PlusRatedPlayers();\n\n Collections.shuffle(players);\n ArrayList<PackOpenerPlayer> tempPlayers = new ArrayList<>();\n int counter = 0;\n boolean higherRatedPlayerIncluded = false;\n while (tempPlayers.size() < 8) {\n if (players.get(counter).getRating() > 83) {\n if (!higherRatedPlayerIncluded) {\n tempPlayers.add(players.get(counter));\n higherRatedPlayerIncluded = true;\n }\n } else {\n tempPlayers.add(players.get(counter));\n }\n counter++;\n }\n Collections.sort(tempPlayers);\n packPlayers = new ArrayList<>(tempPlayers);\n }", "private void loadPlayers() {\r\n this.passive_players.clear();\r\n this.clearRoster();\r\n //Map which holds the active and passive players' list\r\n Map<Boolean, List<PlayerFX>> m = ServiceHandler.getInstance().getDbService().getPlayersOfTeam(this.team.getID())\r\n .stream().map(PlayerFX::new)\r\n .collect(Collectors.partitioningBy(x -> x.isActive()));\r\n this.passive_players.addAll(m.get(false));\r\n m.get(true).stream().forEach(E -> {\r\n //System.out.println(\"positioning \"+E.toString());\r\n PlayerRosterPosition pos = this.getPlayerPosition(E.getCapnum());\r\n if (pos != null) {\r\n pos.setPlayer(E);\r\n }\r\n });\r\n }", "private void UpdateAdds() {\n Adds = (Level + CurrentHealth)/10;\n }", "@Override @Basic\r\n\tpublic List<SquareDungeon> getLevelsAndShafts() {\r\n\t\tArrayList<SquareDungeon> res = new ArrayList<SquareDungeon>(1);\r\n\t\tres.add(this);\r\n\t\treturn res;\r\n\t}", "private void levelUp() {\n\t\t\n\t\tfor (ArrayList<Invader> row : enemyArray) {\n\t\t\tfor (Invader a : row) {\n\t\t\t\tif (a.getVisibility()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tresetInvaders();\n\t\taddRow();\n\t\t\n\t\tenemyShotList.add(new Shot(0, 0, SHOT_WIDTH, SHOT_HEIGHT, 15));\n\t\tlevel++;\n\t\t\n\t\tint powerupx = (int) (Math.random()*(WIDTH-PLAYER_WIDTH));\n\t\tdouble poweruprandom = Math.random();\n\t\t\n\t\tif (poweruprandom < 0.25) {\n\t\t\tarmorPiercing.reset(powerupx);\n\t\t}\n\t\t\n\t\tif (poweruprandom >= 0.25 && poweruprandom < 0.5) {\n\t\t\texplosive.reset(powerupx);\n\t\t}\n\t}", "public void addHealthLevel(int points)\n {\n healthLevel = healthLevel + points;\n showHealthLevel();\n if (healthLevel < 0) \n {\n Greenfoot.playSound(\"game-over.wav\");\n Greenfoot.stop();\n }\n }", "@Select(\"select id,item from dicts where id in (23,24,25,26,27)\")\n\tList<Dict> findLevels();", "public Inventory getEnchantInventory(Player p){\n Inventory inv = Bukkit.createInventory(null, 27, \"Enchant Pickaxe\");\n for(CustomEnchantment ce : enchants.keySet()){\n ItemStack item = new ItemStack(ce.getIcon());\n ItemMeta meta = item.getItemMeta();\n meta.setDisplayName(ce.getColor() + ce.getDisplayName());\n List<String> lore = new ArrayList<>();\n lore.add(\"\");\n lore.add(Changeables.CHAT + \"Current Level: \" + Changeables.CHAT_INFO + getEnchantLevel(ce, p));\n lore.add(Changeables.CHAT + \"Max Level: \" + Changeables.CHAT_INFO + ce.getMaxLevel());\n lore.add(Changeables.CHAT + \"Current Price: \" + Changeables.CHAT_INFO + ce.getPrice(getEnchantLevel(ce, p)));\n lore.add(\"\");\n lore.add(Changeables.CHAT + \"Left Click to \" + Changeables.CHAT_INFO + \" Buy 1\");\n lore.add(Changeables.CHAT + \"Right Click to \" + Changeables.CHAT_INFO + \" Buy Max\");\n meta.setLore(lore);\n item.setItemMeta(meta);\n inv.setItem(enchants.get(ce), item);\n }\n\n\n\n\n\n return inv;\n }", "private void refreshPlayerList() {\n List<MarketItem> items = new ArrayList<>();\n EntityRef player = localPlayer.getCharacterEntity();\n for (int i = 0; i < inventoryManager.getNumSlots(player); i++) {\n EntityRef entity = inventoryManager.getItemInSlot(player, i);\n\n if (entity.getParentPrefab() != null) {\n MarketItem item;\n\n if (entity.hasComponent(BlockItemComponent.class)) {\n String itemName = entity.getComponent(BlockItemComponent.class).blockFamily.getURI().toString();\n item = marketItemRegistry.get(itemName, 1);\n } else {\n item = marketItemRegistry.get(entity.getParentPrefab().getName(), 1);\n }\n\n items.add(item);\n }\n }\n\n tradingScreen.setPlayerItems(items);\n }", "public void action(Player myPlayer)\n {\n if (getNbUtilisation() == 0) {\n System.out.println(\"Not possible\");\n } else {\n int nHealthy = getPointsHealthy();\n myPlayer.addLifePoints(nHealthy);\n\n }\n }", "protected abstract Level[] getLevelSet();", "@Override\r\n public Collection<Item> roll() {\r\n Collection<Item> dropItems = new ArrayList();\r\n \r\n for (LootTableItem item : this.items) {\r\n if (random.nextDouble() <= 1 / item.getChance()) {\r\n dropItems.add(item.create());\r\n }\r\n if (dropItems.size() == amount) break;\r\n }\r\n \r\n return dropItems;\r\n }", "public List<TradeItem> getItemsGivenBy(Player player) {\n List<TradeItem> goodsList = new ArrayList<TradeItem>();\n for (TradeItem ti : items) {\n if (player == ti.getSource()) goodsList.add(ti);\n }\n return goodsList;\n }", "public boolean addPlayerVisible(Integer levelIndex) {\n\t\treturn playerVisible.add(levelIndex);\n\t}", "public List<WeaponCard> checkReload(Player player)\n {\n List<WeaponCard> reloadableWeapons = new LinkedList<>(); //This is the weaponcard list i will return\n /*\n * For each weapon i check if the player has enough ammo to reload that weapon.\n * After a player choose a weapon to reload i have to delete the ammo from the player and reiterate this method.\n */\n for (WeaponCard weaponCard: player.getWeaponCardList())\n {\n if (weaponCard.getBlueAmmoCost()<=player.getAmmoBlue() && weaponCard.getRedAmmoCost()<=player.getAmmoRed() && weaponCard.getYellowAmmoCost()<=player.getAmmoYellow() && !weaponCard.isLoaded())\n {\n reloadableWeapons.add(weaponCard);\n }\n }\n\n return reloadableWeapons;\n }", "public static boolean isMaxed(Player player) {\n\t\tif (player.getSkills().getLevelForXp(Skills.ATTACK) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.STRENGTH) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.DEFENCE) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.RANGE) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.PRAYER) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.MAGIC) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.RUNECRAFTING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.HITPOINTS) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.AGILITY) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.HERBLORE) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.THIEVING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.CRAFTING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.FLETCHING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.SLAYER) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.HUNTER) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.MINING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.SMITHING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.FISHING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.COOKING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.FIREMAKING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.WOODCUTTING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.FARMING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.CONSTRUCTION) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.SUMMONING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.DUNGEONEERING) >= 99\n\t\t\t\t&& player.getSkills().getLevelForXp(Skills.DIVINATION) >= 99)\n\t\treturn true;\n\treturn false;\n\t}", "private static boolean smithingLevel(Player player, int level) {\n\t\treturn (player.getSkills().getLevel(Skills.SMITHING) >= level);\n\t}", "private void generateLoot( Integer lootLevel ){\n }", "@Override\n public void applyEffect(Player player) {\n\n player.add(mResourcesGains);\n\n }", "protected int[] levelUp() {\n level = Math.min(level + 1, MAX_LEVEL);\n if (level == MAX_LEVEL) {\n Game.getPlayer().getMedalCase().increase(MedalTheme.LEVEL_100_POKEMON);\n }\n\n // Update stats and return gain\n return this.setStats();\n }", "public int addItemsToPlayer (Player player, int amount, boolean isAdmin) throws InsufficientPermissionException {\r\n\t\tif (!canDo(player, Type.GET, isAdmin))\r\n\t\t\tthrow new InsufficientPermissionException();\r\n\t\t\r\n\t\tif (amount > getAmount())\r\n\t\t\tamount = getAmount();\r\n\t\t\r\n\t\tint added\t= ItemStackHandler.addToInventory(player.getInventory(), getItemStack(), amount);\r\n\t\tsetAmount(getAmount()-added);\r\n\t\treturn added;\r\n\t}", "private void addPlayers(@NotNull MapHandler map, @NotNull NewGameDto newGameDto) {\n ComparableTuple<Integer, Stack<SpawnTile>> result = analyseMap(map);\n flagCount = result.key;\n Stack<SpawnTile> spawnTiles = result.value;\n if (!spawnTiles.isEmpty()) {\n for (PlayerDto player : newGameDto.players) {\n SpawnTile spawnTile = spawnTiles.pop();\n if (player.id == newGameDto.userId) {\n user = new Player(spawnTile.getX(), spawnTile.getY(), Direction.NORTH, map, new ComparableTuple<>(GameGraphics.mainPlayerName + \" (you)\", player.color), player.id);\n user.setDock(spawnTile.getSpawnNumber());\n players.add(user);\n } else {\n IPlayer onlinePlayer = new OnlinePlayer(spawnTile.getX(), spawnTile.getY(), Direction.NORTH, map, new ComparableTuple<>(player.name, player.color), player.id);\n onlinePlayer.setDock(spawnTile.getSpawnNumber());\n players.add(onlinePlayer);\n }\n }\n } else {\n for (int i = 0; i < playerCount; i++) {\n NonPlayer nonPlayer = new NonPlayer(i, 0, Direction.NORTH, map, new ComparableTuple<>(\"blue\", Color.BLUE));\n nonPlayer.setDock(i);\n players.add(nonPlayer);\n }\n }\n }", "@Override\n public void addInfo(CurrentPlayer currentPlayer) {\n godPower.addInfo(currentPlayer);\n }", "private List<Games> findAllCurrentWerewolves(Map<String, List<Games>> rolePlayerTokenMap) {\n List<Games> werewolves = new ArrayList<>();\n if(rolePlayerTokenMap.containsKey(\"WEREWOLF\")) {\n werewolves.addAll(rolePlayerTokenMap.get(\"WEREWOLF\"));\n }\n if(rolePlayerTokenMap.containsKey(\"MYSTICWOLF\")) {\n werewolves.addAll(rolePlayerTokenMap.get(\"MYSTICWOLF\"));\n }\n werewolves.removeIf(werewolf -> werewolf.getPlayerID().length() == 1);\n return werewolves;\n }", "void addLevel(Level level) {\r\n\t\tif (level != null) {\r\n\t\t\tlevelList.addItem(level.toString());\r\n\t\t}\r\n\t}", "private void sortResults(){\r\n this.sortedPlayers = new ArrayList<>();\r\n int size = players.size();\r\n while (size > 0) {\r\n Player lowestPointsPlayer = this.players.get(0);\r\n for(int i = 0; i<this.players.size(); i++){\r\n if(lowestPointsPlayer.getPoints() <= this.players.get(i).getPoints()){\r\n lowestPointsPlayer = this.players.get(i);\r\n }\r\n }\r\n this.sortedPlayers.add(lowestPointsPlayer);\r\n this.players.remove(lowestPointsPlayer);\r\n size--;\r\n }\r\n\r\n\r\n }", "public void loadPrimePlayersPack(Context context) {\n PlayerDAO playerDAO = new PlayerDAO(context);\n ArrayList<PackOpenerPlayer> players = playerDAO.get82PlusRatedPlayers();\n Collections.shuffle(players);\n ArrayList<PackOpenerPlayer> tempPlayers = new ArrayList<>();\n int counter = 0;\n boolean higherRatedPlayerIncluded = false;\n while (tempPlayers.size() < 8) {\n if (players.get(counter).getRating() > 83) {\n if (!higherRatedPlayerIncluded) {\n tempPlayers.add(players.get(counter));\n higherRatedPlayerIncluded = true;\n }\n } else {\n tempPlayers.add(players.get(counter));\n }\n counter++;\n }\n Collections.sort(tempPlayers);\n packPlayers = new ArrayList<>(tempPlayers);\n }", "public Set<Colour> getWinningPlayers();", "public void loadRarePlayersPack(Context context) {\n PlayerDAO playerDAO = new PlayerDAO(context);\n ArrayList<PackOpenerPlayer> players = playerDAO.getRarePlayers();\n\n Collections.shuffle(players);\n ArrayList<PackOpenerPlayer> tempPlayers = new ArrayList<>();\n int counter = 0;\n boolean higherRatedPlayerIncluded = false;\n while (tempPlayers.size() < 9) {\n if (players.get(counter).getRating() > 83) {\n if (!higherRatedPlayerIncluded) {\n tempPlayers.add(players.get(counter));\n higherRatedPlayerIncluded = true;\n }\n } else {\n tempPlayers.add(players.get(counter));\n }\n counter++;\n }\n Collections.sort(tempPlayers);\n packPlayers = new ArrayList<>(tempPlayers);\n }", "@Override\n public ArrayList<Player> getPlayers() {return steadyPlayers;}", "private void applyPowers(HashSet<ElitePower> elitePowers, int availablePowerAmount) {\n\n if (availablePowerAmount < 1) return;\n\n ArrayList<ElitePower> localPowers = new ArrayList<>(elitePowers);\n\n for (ElitePower mobPower : this.powers)\n localPowers.remove(mobPower);\n\n for (int i = 0; i < availablePowerAmount; i++)\n if (localPowers.size() < 1)\n break;\n else {\n ElitePower selectedPower = localPowers.get(ThreadLocalRandom.current().nextInt(localPowers.size()));\n this.powers.add(selectedPower);\n selectedPower.applyPowers(this.eliteMob);\n localPowers.remove(selectedPower);\n if (selectedPower instanceof MajorPower)\n this.majorPowerCount++;\n if (selectedPower instanceof MinorPower)\n this.minorPowerCount++;\n }\n\n }", "public void loadTOTWPlayersPack(Context context) {\n PlayerDAO playerDAO = new PlayerDAO(context);\n ArrayList<PackOpenerPlayer> totwPlayers = playerDAO.getTOTWPlayers();\n ArrayList<PackOpenerPlayer> otherPlayers = playerDAO.getNonTOTWPlayers();\n\n Collections.shuffle(totwPlayers);\n Collections.shuffle(otherPlayers);\n ArrayList<PackOpenerPlayer> tempPlayers = new ArrayList<>();\n //adding one totw player\n tempPlayers.add(totwPlayers.get(0));\n\n //adding other remaining players\n int counter = 0;\n boolean higherRatedPlayerIncluded = false;\n while (tempPlayers.size() < 9) {\n if (otherPlayers.get(counter).getRating() > 82) {\n if (!higherRatedPlayerIncluded) {\n tempPlayers.add(otherPlayers.get(counter));\n higherRatedPlayerIncluded = true;\n }\n } else {\n tempPlayers.add(otherPlayers.get(counter));\n }\n counter++;\n }\n Collections.sort(tempPlayers);\n packPlayers = new ArrayList<>(tempPlayers);\n }", "public void addLevel()\r\n {\r\n tables.addFirst( new HashMap<String,T>() );\r\n counts.addFirst( 0 );\r\n }", "private void updatePlayersWorth(){\n for (Player e : playerList) {\n e.setPlayerWorth(getTotalShareValue(e) + e.getFunds());\n }\n }", "public Collection getLevels(){\n List<String> levels = new ArrayList<>();\n File directoryPath = new File(DATA_PATH+gameName+\"/\");\n for (String s : directoryPath.list()) {\n if (isLevelFile(s)){\n levels.add(getLevelName(s));\n }\n }\n Collections.sort(levels);\n return Collections.unmodifiableList(levels);\n }", "Collection<Item> getInventory();", "@Override\r\n\tpublic List<Achievement> getPlayerAchievements(int id_Entity, int id_Player) {\n\r\n\t\tList<Achievement> listAchievements = new ArrayList<Achievement>();\r\n\r\n\t\tfor (Iterator<Player> iterator = players.iterator(); iterator.hasNext();) {\r\n\t\t\tPlayer player = (Player) iterator.next();\r\n\r\n\t\t\tif (player.getEntity() == id_Entity && player.getId() == id_Player) {\r\n\t\t\t\tfor (Iterator<String> iterator2 = player.getAchievements().iterator(); iterator2.hasNext();) {\r\n\t\t\t\t\tString id_Achievement = (String) iterator2.next();\r\n\r\n\t\t\t\t\tfor (Iterator<Achievement> iterator3 = AchievementsManager.achievements.iterator(); iterator3\r\n\t\t\t\t\t\t\t.hasNext();) {\r\n\t\t\t\t\t\tAchievement achievement = (Achievement) iterator3.next();\r\n\r\n\t\t\t\t\t\tif (achievement.getId() == Integer.parseInt(id_Achievement)) {\r\n\t\t\t\t\t\t\tlistAchievements.add(achievement);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn listAchievements;\r\n\r\n\t}", "private boolean usesies(ActivePokemon p) {\n boolean used = false;\n for (Stat stat : Stat.BATTLE_STATS) {\n if (p.getStage(stat) < 0) {\n p.getStages().setStage(stat, 0);\n used = true;\n }\n }\n return used;\n }", "public void setLevel(String level) {\n this.level = level;\n }", "public void setLevel(String level) {\n this.level = level;\n }", "public int getItemsFromPlayer (Player player, int amount, boolean isAdmin) throws InsufficientPermissionException {\r\n\t\tif (!canDo(player, Type.ADD, isAdmin))\r\n\t\t\tthrow new InsufficientPermissionException();\r\n\t\t\r\n\t\tint removed\t= ItemStackHandler.removeFromInventory(player.getInventory(), getCompatibleItems(), amount, needsEqualNBTTag());\r\n\t\tsetAmount(getAmount()+removed);\r\n\t\treturn removed;\r\n\t}", "private void checkPlayerHealth(){\n if(currentPlayer.getHealth().equals(\"0\")){\n results = new ArrayList<String>();\n results.add(\"You are dead.\");\n ArrayList<Artefacts> inv = currentPlayer.getArifacsts();\n System.out.println(inv.size());\n for(int i = 0; i < inv.size(); i++){\n currentLocation.addArtefactToCurrentLocation(inv.get(i));\n }\n System.out.println(inv.size());\n for(int i = inv.size() - 1; i >= 0; i--){\n inv.remove(i);\n }\n currentPlayer.resetHealth();\n currentPlayer.setCurrentLocation(locations.get(0));\n }\n }", "public void setLevel(String level){\n\t\tthis.level = level;\n\t}", "public int getAddItems(int totalCollected, int totalItemInGame);", "boolean hasLevel();", "boolean hasLevel();", "boolean hasLevel();", "boolean hasLevel();", "public void takeItemsFromChest() {\r\n currentRoom = player.getCurrentRoom();\r\n for (int i = 0; i < currentRoom.getChest().size(); i++) {\r\n player.addToInventory(currentRoom.getChest().get(i));\r\n currentRoom.getChest().remove(i);\r\n }\r\n\r\n }", "public Collection<Item> myItems(final int playerId) {\n\t\treturn this.itemRepository.myItems(playerId);\n\t}", "public boolean isLevelEnabled(int level)\r\n {\r\n return (level >= this.enabled);\r\n }", "public int getLevel(){\n return this.level;\n }", "public int getLevel(){\n return this.level;\n }", "int getOnLevel();", "private void getPlayerList(){\r\n\r\n PlayerDAO playerDAO = new PlayerDAO(Statistics.this);\r\n players = playerDAO.readListofPlayerNameswDefaultFirst();\r\n\r\n }", "@Override\n public void onCrafting(EntityPlayer player, ItemStack item, IInventory craftMatrix) \n {\n if (item.itemID == mod_TFmaterials.RubyPickaxe.itemID)\n {\n \t//player.addStat(mod_TFmaterials.RubyPickAchieve, 1);\n \tplayer.addStat(mod_TFmaterials.RubyPickAchieve, 1);\n }\n }", "public void refresh() {\r\n if (!(entity instanceof Player)) {\r\n return;\r\n }\r\n Player player = (Player) entity;\r\n for (int i = 0; i < 24; i++) {\r\n PacketRepository.send(SkillLevel.class, new SkillContext(player, i));\r\n }\r\n }", "private void addPlayerSheild() {\n this.playerShield += 1;\n }", "private Collection<Player> getPlayers() {\n\t\treturn players;\n\t}", "public Collection<Player> getPlayersChunk() {\n var chunk = new Chunk<Player>();\n var playersChunk = chunk.get(this.players, ALL_PLAYERS_CHUNK_SIZE, allPlayersChunkIndex);\n\n // up to ALL_PLAYERS_CHUNK_SIZE with empty players\n // to have an even view\n var startIndex = playersChunk.size();\n for (var i = startIndex; i < ALL_PLAYERS_CHUNK_SIZE; i++) {\n playersChunk.add(new Player(new Person()));\n }\n\n return playersChunk;\n }", "public static ArrayList<Integer> fetchLevels() {\r\n\r\n\t\tArrayList<Integer> levels = new ArrayList<Integer>();\r\n\r\n\t\tsqlQuery = \"SELECT DISTINCT(level) FROM flipkart_category;\";\r\n\r\n\t\ttry{\r\n\t\t\tconn=DbConnection.getConnection();\r\n\t\t\tps=conn.prepareStatement(sqlQuery);\r\n\t\t\trs=ps.executeQuery();\r\n\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\tint levelTemp;\r\n\t\t\t\tlevelTemp=rs.getInt(1);\r\n\r\n\t\t\t\tlevels.add(levelTemp);\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn levels;\r\n\t}", "public List<LeveledMonster> getSpawnableMonsters(int level, EntityType type, Location location){\n if (enabled){\n List<LeveledMonster> spawnableMonsters = new ArrayList<>();\n for (LeveledMonster m : allMonsters){\n if (m.getEntityType() == type && (m.getLevel() == level || m.doesSpawnWithoutLevel()) && m.isEnabled()){\n if (location != null){\n if (m.getMinYRange() > location.getY() || m.getMaxYRange() < location.getY()){\n continue;\n }\n if (m.getBiomeFilter().size() > 0){\n boolean biomeCompatible = false;\n for (String key : m.getBiomeFilter()){\n Container<List<Biome>, Material> container = BiomeCategoryManager.getInstance().getAllBiomes().get(key);\n if (container != null){\n if (container.getKey().contains(location.getBlock().getBiome())){\n biomeCompatible = true;\n break;\n }\n }\n }\n if (!biomeCompatible) continue;\n }\n if (WorldguardManager.getWorldguardManager().useWorldGuard()){\n if (m.getRegionFilter().size() > 0){\n boolean regionCompatible = false;\n for (String region : m.getRegionFilter()){\n if (WorldguardManager.getWorldguardManager().getLocationRegions(location).contains(region)){\n regionCompatible = true;\n break;\n }\n }\n if (!regionCompatible) continue;\n }\n }\n if (m.getWorldFilter().size() > 0){\n if (!m.getWorldFilter().contains(location.getBlock().getWorld().getName())){\n continue;\n }\n }\n }\n spawnableMonsters.add(m);\n }\n }\n return spawnableMonsters;\n } else {\n return new ArrayList<>();\n }\n }", "public int getItemLevel() {\treturn level; }", "public PlayerInventory load(Player player) {\n return new PlayerInventory(\n player,\n repository.byPlayer(player)\n .stream()\n .map(\n entity -> new LoadedItem(\n entity,\n service.retrieve(entity.itemTemplateId(), entity.effects())\n )\n )\n .collect(Collectors.toList())\n );\n }", "public void addRandoms() {\n //Add random boulders on tiles that aren't Lava\n int tileNumber;\n int selector;\n Tile t;\n String tileTexture;\n Random random = new Random();\n SquareVector playerPos = getPlayerEntity().getPosition();\n int tileCount = GameManager.get().getWorld().getTiles().size();\n AbstractWorld world = GameManager.get().getWorld();\n int randIndex;\n\n for (int i = 0; i < 20; i++) {\n //Get respective volcano tile (5 <= Lava tiles Index <= 8\n do {\n randIndex = random.nextInt(tileCount);\n t = world.getTile(randIndex);\n } while (t.getCoordinates().isCloseEnoughToBeTheSame(playerPos));\n\n tileTexture = t.getTextureName();\n tileNumber = Integer.parseInt(tileTexture.split(\"_\")[1]);\n\n selector = random.nextInt(2);\n if (tileNumber < 5 && tileNumber > 1 && selector == 1 && !t.hasParent()) {\n entities.add(new Rock(t, true));\n } else if (t != null && (tileNumber == 3 || tileNumber == 4) &&\n selector == 0 && !t.hasParent()) {\n entities.add(new VolcanoBurningTree(t, true));\n } else {\n i--;\n }\n }\n }", "private void updatePlayerList() \n\t{\n\t\tplayerStatus.clear();\n\n\t\tfor(Player thisPlayer: players) // Add the status of each player to the default list model.\n\t\t{\n\t\t\tplayerStatus.addElement(thisPlayer.toString());\n\t\t}\n\n\t}", "@Override\n public ArrayList<Coordinate> whereCanBuild(Match match, ClientHandler ch, int id){\n Player player = match.getPlayer(ch.getName());\n if(match.getBoard()[player.getWorker(id).getPosition().getX()][player.getWorker(id).getPosition().getY()].getLevel()<3){\n ArrayList<Coordinate> result = super.whereCanBuild(match,ch,id);\n result.add(player.getWorker(id).getPosition());\n return result;\n }\n return super.whereCanBuild(match,ch,id);\n }", "private void updateShop(List<ItemType> items, int level) {\n\t\tfor (ItemType item : items) {\n\t\t\tString text = item.getTextureString();\n\t\t\ttext = item instanceof SpecialType ? text\n\t\t\t\t\t: text.substring(0, text.length() - 1)\n\t\t\t\t\t\t\t+ Integer.toString(level);\n\t\t\tTexture texture = textureManager.getTexture(text);\n\t\t\tImageButton button = generateItemButton(texture);\n\n\t\t\tbutton.addListener(new ClickListener() {\n\t\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\t\tstatus.setText(item.getName());\n\t\t\t\t\tif (selectedHero == null) {\n\t\t\t\t\t\tstatus.setText(\"Unsuccessful shopping, No hero exist.\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (selectedHero.getHealth() <= 0) {\n\t\t\t\t\t\tstatus.setText(\n\t\t\t\t\t\t\t\t\"Your Commander is dead. Can't buy anything.\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tboolean enoughResources = checkCost(selectedHero.getOwner(),\n\t\t\t\t\t\t\titem);\n\t\t\t\t\tif (enoughResources) {\n\t\t\t\t\t\tif (item instanceof WeaponType) {\n\t\t\t\t\t\t\tWeapon weapon = new Weapon((WeaponType) item,\n\t\t\t\t\t\t\t\t\tlevel);\n\t\t\t\t\t\t\tselectedHero.addItemToInventory(weapon);\n\t\t\t\t\t\t\tstatus.setText(boughtString + weapon.getName()\n\t\t\t\t\t\t\t\t\t+ \"(Weapon) for \"\n\t\t\t\t\t\t\t\t\t+ selectedHero.toString());\n\t\t\t\t\t\t} else if (item instanceof ArmourType) {\n\t\t\t\t\t\t\tArmour armour = new Armour((ArmourType) item,\n\t\t\t\t\t\t\t\t\tlevel);\n\t\t\t\t\t\t\tselectedHero.addItemToInventory(armour);\n\t\t\t\t\t\t\tstatus.setText(boughtString + armour.getName()\n\t\t\t\t\t\t\t\t\t+ \"(Armour) for \"\n\t\t\t\t\t\t\t\t\t+ selectedHero.toString());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tboolean transactSuccess;\n\t\t\t\t\t\t\tSpecial special = new Special((SpecialType) item);\n\t\t\t\t\t\t\ttransactSuccess = selectedHero\n\t\t\t\t\t\t\t\t\t.addItemToInventory(special);\n\t\t\t\t\t\t\tif (transactSuccess) {\n\t\t\t\t\t\t\t\tstatus.setText(boughtString + special.getName()\n\t\t\t\t\t\t\t\t\t\t+ \"(Special) for \"\n\t\t\t\t\t\t\t\t\t\t+ selectedHero.toString());\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tstatus.setText(\n\t\t\t\t\t\t\t\t\t\t\"Unsuccessful Shopping, can only hold 4 specials\");\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tselectedHero.setStatsChange(true);\n\t\t\t\t\t\ttransact(selectedHero.getOwner(), item);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tString mes = \"Not enough resources.\";\n\t\t\t\t\t\tstatus.setText(mes);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tprivate boolean checkCost(int owner, ItemType item) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t\tscrollTable.add(button).width(iconSize).height(iconSize).top();\n\t\t\tString stats = getItemStats(item, level);\n\t\t\tString cost = getItemCost(item, level);\n\t\t\tscrollTable.add(new Label(stats, skin)).width(iconSize).top()\n\t\t\t\t\t.left();\n\t\t\tscrollTable.add(new Label(cost, skin)).width(iconSize).top().left();\n\t\t\tscrollTable.row();\n\t\t}\n\t}", "public ArrayList<Player> getPlayers() {\n return players;\n}", "public void setLevel(int level) {\n this.level = level;\n }", "public void setLevel(int level) {\n this.level = level;\n }" ]
[ "0.6738968", "0.5857044", "0.5766057", "0.5705893", "0.5622191", "0.5591501", "0.55405885", "0.54368514", "0.5350056", "0.5328953", "0.52985424", "0.52645034", "0.5239943", "0.52378356", "0.5237445", "0.5236374", "0.5212557", "0.5182342", "0.5171264", "0.51368415", "0.5125095", "0.5110756", "0.5100694", "0.5091799", "0.50911146", "0.5090285", "0.5080248", "0.5071016", "0.5062056", "0.5026362", "0.5015891", "0.50073606", "0.4984175", "0.49774814", "0.4974111", "0.49688184", "0.49609187", "0.4958324", "0.49565983", "0.49523816", "0.49471667", "0.4947054", "0.49463788", "0.49405026", "0.4939002", "0.4937878", "0.49335986", "0.49266312", "0.49225512", "0.4921742", "0.49184063", "0.49140444", "0.49139476", "0.49043322", "0.48990047", "0.48906195", "0.48795742", "0.48741424", "0.4858024", "0.48468187", "0.48456734", "0.48399323", "0.48372063", "0.48261154", "0.48207545", "0.48190653", "0.48184508", "0.48178396", "0.48178396", "0.4800543", "0.47839072", "0.4783423", "0.47741154", "0.47731012", "0.47731012", "0.47731012", "0.47731012", "0.4773053", "0.47718087", "0.47716063", "0.47707495", "0.47707495", "0.47602227", "0.47593465", "0.4754886", "0.4745935", "0.4745255", "0.47428858", "0.4731212", "0.47292042", "0.4720969", "0.47122332", "0.46977797", "0.46927622", "0.46917102", "0.46900508", "0.46865028", "0.4684145", "0.4683541", "0.4683541" ]
0.6718287
1
Select only 1 item based on chance attributes
private ExtractedItemsCollection selectItemByChance(Collection<ExtractedItemsCollection> itemsCollections) { float sumOfChances = calcSumOfChances(itemsCollections); float currentSum = 0f; float rnd = (float) Rnd.get(0, (int) (sumOfChances - 1) * 1000) / 1000; ExtractedItemsCollection selectedCollection = null; for (ExtractedItemsCollection collection : itemsCollections) { currentSum += collection.getChance(); if (rnd < currentSum) { selectedCollection = collection; break; } } return selectedCollection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Item chooseValidItem()\n {\n\n // Sets the intial random value.\n int numberRandom = random.nextInt(items.size());\n\n while (trackItems.contains(items.get(numberRandom).getName())){\n numberRandom = random.nextInt(items.size());\n }\n\n // Loops until a unused value is assigned to numberRandom,\n // within the array list size.\n \n trackItems.push(items.get(numberRandom).getName());\n\n return items.get(numberRandom);\n }", "public int dmg(){\r\n dmg = rand.nextInt(att);\r\n if(att == 1)\r\n dmg = 1;\r\n return dmg;\r\n }", "@Nullable\n public T choose(Predicate<T> predicate, Random random) {\n List<Entry<T>> filteredEntries = entries.stream()\n .filter(t -> predicate.apply(t.getValue()))\n .collect(Collectors.toList());\n if (Iterables.isEmpty(filteredEntries)) {\n return null;\n }\n\n int maximumPriority = Ordering.natural().max(Iterables.transform(filteredEntries, Entry::getPriority));\n filteredEntries = filteredEntries.stream()\n .filter(t -> t.getPriority() == maximumPriority)\n .collect(Collectors.toList());\n\n if(Iterables.isEmpty(filteredEntries)) {\n return null;\n }\n\n double sum = 0;\n for(Entry<T> entry : filteredEntries)\n sum += entry.getWeight();\n\n double selection = random.nextDouble() * sum;\n for(Entry<T> entry : filteredEntries) {\n selection -= entry.getWeight();\n if(selection <= 0)\n return entry.getValue();\n }\n // should not get here.\n throw new IllegalStateException();\n }", "public Item sample() {\n if (N == 0) throw new java.util.NoSuchElementException();\n return collection[rnd.nextInt(N)];\n }", "public Genotype rouletteSelection() {\n // get a number between 0 and 1 to compare against\n double slice = rnd.nextDouble();\n // keep track of the cumulative fitness\n double cumulativeFitness = 0;\n\n // loop through the population to pick a mate\n for (Genotype g : population) {\n // increment the cumulative fitness with the member's normalized fitness\n cumulativeFitness += g.getNormalizedFitness();\n // if the cumulative fitness is greater than the random number,\n if (cumulativeFitness > slice) {\n // select the member for mating\n return g;\n }\n }\n\n // if no members are chosen, pick the one with the highest fitness score\n return population.get(0);\n }", "public Item getRandomItem() {\n int index = 0;\n int i = (int) (Math.random() * getItems().size()) ;\n for (Item item : getItems()) {\n if (index == i) {\n return item;\n }\n index++;\n }\n return null;\n }", "@Override\r\n\tpublic Item sample() {\r\n\t\tint index = StdRandom.uniform(count);\r\n\t\tItem item = arr[index];\r\n\t\treturn item;\r\n\t}", "private static Option pickRandom() {\n\t\treturn Option.values()[rand.nextInt(3)];\n\t}", "public Item sample() {\n\t\t\n\t\tif(isEmpty()) throw new NoSuchElementException();\n\t\t\n\t\tint index = StdRandom.uniform(N);\n\t\t\t\n\t\t\t/*while(items[index] == null) {\n\t\t\t\tindex = StdRandom.uniform(length());\n\t\t\t}*/\n\n\t\treturn items[index];\n\t}", "public ArrayList<RandomItem> getRandomItems();", "@Override\n\t\t\tpublic String pickItem(Map<String, Integer> distribution) {\n\t\t\t\treturn null;\n\t\t\t}", "@Override\n\t\t\tpublic String pickItem(Map<String, Integer> distribution) {\n\t\t\t\treturn null;\n\t\t\t}", "private void chooseBreedToBeIdentified() {\n Random r = new Random();\n int questionBreedIndex = r.nextInt(3);\n\n questionCarMake = displayingCarMakes.get(questionBreedIndex);\n carMakeNameTitle.setText(questionCarMake);\n }", "public Item sample() {\n \t\tif (size == 0) {\n \t\t\tthrow new NoSuchElementException();\n \t\t}\n \t\treturn (Item) items[StdRandom.uniform(size)];\n \t}", "public abstract int getRandomDamage();", "@Override\n protected void dropFewItems(boolean hit, int looting) {\n super.dropFewItems(hit, looting);\n if (hit && (this.rand.nextInt(3) == 0 || this.rand.nextInt(1 + looting) > 0)) {\n Item drop = null;\n switch (this.rand.nextInt(5)) {\n case 0:\n drop = Items.gunpowder;\n break;\n case 1:\n drop = Items.sugar;\n break;\n case 2:\n drop = Items.spider_eye;\n break;\n case 3:\n drop = Items.fermented_spider_eye;\n break;\n case 4:\n drop = Items.speckled_melon;\n break;\n }\n if (drop != null) {\n this.dropItem(drop, 1);\n }\n }\n }", "public T getRandomElement() {\n\t\treturn this.itemList.get(this.getRandomIndex());\n\t}", "public Item sample() {\n if (isEmpty()) {\n throw new NoSuchElementException();\n }\n return a[StdRandom.uniform(N)];\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic T sample(boolean useMostLikely) {\n\t\tif (itemProbs_.isEmpty())\n\t\t\treturn null;\n\n\t\t// If using most likely, just get the highest prob one\n\t\tif (useMostLikely)\n\t\t\treturn getOrderedElements().get(0);\n\n\t\tif (elementArray_ == null) {\n\t\t\tprobArray_ = null;\n\t\t\t// Need to use flexible element array which ignores extremely low\n\t\t\t// probability items\n\t\t\tArrayList<T> elementArray = new ArrayList<T>();\n\t\t\tfor (T element : itemProbs_.keySet()) {\n\t\t\t\tif (itemProbs_.get(element) > MIN_PROB)\n\t\t\t\t\telementArray.add(element);\n\t\t\t}\n\t\t\telementArray_ = (T[]) new Object[elementArray.size()];\n\t\t\telementArray_ = elementArray.toArray(elementArray_);\n\t\t}\n\t\tif (rebuildProbs_ || probArray_ == null)\n\t\t\tbuildProbTree();\n\n\t\tdouble val = random_.nextDouble();\n\t\tint index = Arrays.binarySearch(probArray_, val);\n\t\tif (index < 0)\n\t\t\tindex = Math.min(-index - 1, elementArray_.length - 1);\n\n\t\treturn elementArray_[index];\n\t}", "public Item sample() {\n if (isEmpty()) {\n throw new NoSuchElementException();\n }\n double rand = Math.random() * N;\n int idx = (int) Math.floor(rand);\n Item item = s[idx];\n return item;\n }", "private static ItemType random() {\n return ITEM_TYPES.get(RANDOM.nextInt(SIZE));\n }", "@Override\r\n public Collection<Item> roll() {\r\n Collection<Item> dropItems = new ArrayList();\r\n \r\n for (LootTableItem item : this.items) {\r\n if (random.nextDouble() <= 1 / item.getChance()) {\r\n dropItems.add(item.create());\r\n }\r\n if (dropItems.size() == amount) break;\r\n }\r\n \r\n return dropItems;\r\n }", "public Item sample(){\n if(size == 0){\n throw new NoSuchElementException();\n }\n int ri = StdRandom.uniform(size);\n \n Iterator<Item> it = this.iterator();\n \n for(int i = 0; i < ri; i++){\n it.next();\n }\n \n return it.next();\n }", "public Sample SelectSample() {\n\t\t\n\t\tif(sample_map.size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tfloat sum = 0;\n\t\tfloat min = Float.MAX_VALUE;\n\t\tLinkSample ptr = k_closest;\n\t\twhile(ptr != null) {\n\t\t\tmin = Math.min(min, ptr.s.weight);\n\t\t\tptr = ptr.next_ptr;\n\t\t}\n\t\t\n\t\tmin = Math.abs(min) + 1;\n\t\tptr = k_closest;\n\t\twhile(ptr != null) {\n\t\t\tsum += ptr.s.weight + min;\n\t\t\tif(ptr.s.weight + min < 0) {\n\t\t\t\tSystem.out.println(\"neg val\");System.exit(0);\n\t\t\t}\n\n\t\t\tptr = ptr.next_ptr;\n\t\t}\n\t\t\n\t\tfloat val = (float) (Math.random() * sum);\n\n\t\tsum = 0;\n\t\tptr = k_closest;\n\t\twhile(ptr != null) {\n\t\t\tsum += ptr.s.weight + min;\n\n\t\t\tif(sum >= val) {\n\t\t\t\treturn ptr.s;\n\t\t\t}\n\t\t\t\n\t\t\tptr = ptr.next_ptr;\n\t\t}\n\t\tSystem.out.println(\"error\");System.exit(0);\n\t\treturn null;\n\t}", "public Hazard selectRandom() {\r\n\t\tRandom gen = new Random();\r\n\t\treturn hazards.get(gen.nextInt(hazards.size()));\r\n\t}", "public Item sample() {\n if (this.isEmpty()) {\n throw new NoSuchElementException();\n }\n if (this.size == 1) {\n return this.storage[0];\n }\n else {\n return this.storage[StdRandom.uniform(this.currentIndex)];\n }\n }", "private void selectRandomUnexploredProfile(GameObserver gameObs) {\n if (eGame.getTotalNumSamples() >= eGame.getNumProfiles() ||\n gameObs.numObsLeft() <= 0) return;\n\n eGame.getRandomProfile(currentOutcome);\n while (eGame.getNumSamples(currentOutcome) > 0) {\n eGame.getRandomProfile(currentOutcome);\n }\n\n sampleAndUpdate(currentOutcome, gameObs);\n }", "public void infection() {\n\r\n chance = r.nextInt(100); //Random Integer\r\n found = false; // Boolean Value\r\n for (int i = 0; i < storage.size(); i++) {\r\n if (chance == storage.get(i)) { //if random int is equal to any element in List\r\n found = true; // Set boolean value \r\n break;\r\n\r\n } else {\r\n found = false;\r\n numhealthy.setText(\"\" + (100 - count));\r\n numinfected.setText(\"\" + count);\r\n\r\n }\r\n }\r\n\r\n if (found == false) {\r\n storage.add(chance);\r\n pixellist.get(chance).setBackground(new Color(216, 19, 55));\r\n count++;\r\n numhealthy.setText(\"\" + (100 - count));\r\n numinfected.setText(\"\" + count);\r\n }\r\n\r\n }", "public static TradeGood getRandom() {\n TradeGood[] options = new TradeGood[] {WATER, FURS, ORE, FOOD, GAMES, FIREARMS,\n MEDICINE, NARCOTICS, ROBOTS, MACHINES};\n int index = GameState.getState().rng.nextInt(10);\n return options[index];\n }", "public void setWhoGoesFirstRandom() {\n Random ran = new Random();\n int i = ran.nextInt(2) + 1;\n if(i == 1) {\n setWhoGoesFirst(humanPlayer);\n } else {\n setWhoGoesFirst(aiPlayer);\n }\n }", "public Item sample()\n {\n checkNotEmpty();\n\n return items[nextIndex()];\n }", "public Item sample() {\n if(isEmpty()) throw new NoSuchElementException();\n int idx = StdRandom.uniform(size);\n return arr[idx];\n }", "@Override\n public void dropBlockAsItemWithChance(@Nonnull World worldIn, @Nonnull BlockPos pos, @Nonnull IBlockState state, float chance, int fortune)\n {\n }", "@Override\n protected void dropFewItems(boolean hit, int looting) {\n super.dropFewItems(hit, looting);\n for (int i = this.rand.nextInt(2 + looting); i-- > 0;) {\n this.dropItem(Items.ender_pearl, 1);\n }\n }", "public Item sample() {\n if (n == 0) throw new NoSuchElementException();\n return arr[StdRandom.uniform(n)];\n }", "private void chance(Player currentPlayer) {\n Random rand = new Random();\n int randomNum = rand.nextInt((3 - 1) + 1) + 1;\n\n if(randomNum == 1){\n convertTextToSpeech(\"Advance to Bond Street\");\n currentPlayer.setCurrentPosition(34);\n }\n if(randomNum == 2){\n convertTextToSpeech(\"Unpaid charges. Go to jail\");\n setJail(currentPlayer);\n }\n if(randomNum == 3){\n convertTextToSpeech(\"Build a rooftop swimming pool on your apartment, pay 300\");\n if(m_manageFunds) {\n currentPlayer.subtractMoney(300);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n m_freeParking += 300;\n Log.d(\"chance subtract 300\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance free parking\", String.valueOf(m_freeParking));\n }\n }\n }", "public float getChance()\n {\n return 1.0f;\n }", "public static ChanceItem retrieve() {\r\n int slot = RandomUtil.random(tableRarityRatio);\r\n for (ChanceItem item : TABLE) {\r\n if ((item.getTableSlot() & 0xFFFF) <= slot && (item.getTableSlot() >> 16) > slot) {\r\n return item;\r\n }\r\n }\r\n return null;\r\n }", "public float getChance() {\n return chance;\n }", "public int getRandom() {\r\n if ((itemSize / nextIndexInCache) < 0.25) {\r\n rebuildCache();\r\n }\r\n while (true) {\r\n int i = random.nextInt(nextIndexInCache);\r\n int v = cache[i];\r\n if (contains(v)) {\r\n return v;\r\n }\r\n }\r\n }", "@Override\n public int quantityDroppedWithBonus(int par1, Random par2Random)\n {\n return 1 + par2Random.nextInt(par1 * 2 + 1);\n }", "private Astronaut getRandomAstronaut() {\n\t\twhile(roamingAstronauts > 0) {\n\t\t\tint i = random.nextInt(gameObject.size());\n\t\t\tif (gameObject.get(i) instanceof Astronaut)\n\t\t\t\treturn (Astronaut) gameObject.get(i);\n\t\t}\n\t\treturn null;\n\t}", "public void addRandomItem(double x, double y) {\r\n\r\n\t\tint choice = random.nextInt(3);\r\n\r\n\t\tString weaponchoices = Resources.getString(\"weaponchoices\");\r\n\t\tString delim = Resources.getString(\"delim\");\r\n\r\n\t\tString[] options = weaponchoices.split(delim);\r\n\t\tString option = options[choice];\r\n\r\n\t\tBufferedImage itemimage = Resources.getImage(option);\r\n\t\tSpriteGroup items = playField.getGroup(\"Items\");\r\n\t\tint healthOption = Resources.getInt(\"healthOption\");\r\n\r\n\t\tif (choice == healthOption) {\r\n\t\t\tgetHealthItem(x, y, option, itemimage, items);\r\n\t\t} else {\r\n\t\t\tgetWeaponItem(x, y, option, itemimage, items);\r\n\t\t}\r\n\r\n\t}", "public NCRPNode select() {\n\t\t\t\n\t\t\t//dim number of children + 1 (unallocated mass) \n\t\t\tdouble[] weights = new double[children.size() + 1];\n\t \n\t\t\t//weight of unallocated probability mass\n\t\t\tweights[0] = gamma / (gamma + customers);\n\t\t\t\n\t\t\t//calc weight for each child based on the number of customers on them\n\t\t\tint i = 1;\n\t\t\tfor (NCRPNode child: children) {\n\t\t\t\tweights[i] = (double) child.customers / (gamma + customers);\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\t//sample a child with higher weight\n\t\t\tint choice = random.nextDiscrete(weights);\n\t\t\t//if unallocated mass is sampled, create a new child\n\t\t\tif (choice == 0) {\n\t\t\t\treturn(addChild());\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn children.get(choice - 1);\n\t\t\t}\n\t\t}", "public Item sample() {\n\n\t\tif (isEmpty())\n\t\t\tthrow new NoSuchElementException();\n\n\t\tint random = (int)(StdRandom.uniform() * N);\n\t\treturn arr[random];\n\t}", "float genChance();", "private void useInventoryByAI() {\n\t\tChampion AI = currentTask.getCurrentChamp();\n\t\tArrayList<Collectible> inventory = ((Wizard)AI).getInventory();\n\t\tif(inventory.size()>0){\n\t\t\tint randomPotion = (int)(Math.random()*inventory.size());\n\t\t\tcurrentTask.usePotion((Potion)inventory.get(randomPotion));\n\t\t}\n\n\t\t\n\t}", "public static Object getRandom(Object... kv)\n {\n return getRandom(distributeChance(kv));\n }", "public Card drawFromChance()\n {\n Random draw = new Random();\n \n //if the chance cards are exhausted, re-fill the cards\n if(m_chance.size() == 0)\n {\n m_chance = m_drawnChance;\n m_drawnChance.clear();\n }\n //draw a random card and add it to the list of the cards drawn\n int drawFrom = draw.nextInt(m_chance.size() - 1) + 1;\n Card card = m_chance.remove(drawFrom);\n m_drawnChance.add(card);\n \n return card;\n }", "public static DealSetup pickOneAtRandom() {\n\t\tfinal Random r = ThreadLocalRandom.current();\n\t\tfinal int dex = r.nextInt(3);\n\t\treturn 0 == dex ? DealSetup.ALPHA : (1 == dex ? DealSetup.BETA\n\t\t\t\t: DealSetup.GAMMA);\n\t}", "RandomizedRarestFirstSelector(Random random) {\n this.random = random;\n }", "public Item sample() {\n if (isEmpty())\n throw new NoSuchElementException();\n\n // Get random index [0, elements) and remove from array\n int randomIndex = StdRandom.uniform(0, elements);\n return values[randomIndex];\n }", "public Item getDropType(int paramInt1, Random paramRandom, int paramInt2) {\n/* 27 */ return Items.MELON;\n/* */ }", "@Test\r\n\tpublic void randomTest() {\r\n\t\tItem item = new Item();\r\n\t\ttry {\r\n\t\t\tItem tempSet[] = item.getRandom(0);\r\n\t\t\tassertNotSame(tempSet.length, 0);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tfail(\"Failed to execute search of random items: SQLException\");\r\n\t\t}\r\n\t}", "public void roam(){\r\n Random rand = new Random();\r\n String aniName = this.getName();\r\n String aniType = this.getAniType();\r\n //Chance will be a number between 1 and 100\r\n int chance = rand.nextInt(100) + 1;\r\n //25% chance that the pachyderm will charge\r\n if (chance <= 25){\r\n System.out.println(aniName + \" the \" + aniType + \" charges.\");\r\n }\r\n //75% chance the method works as originally intended.\r\n else{\r\n System.out.println(aniName + \" the \" + aniType + \" roams.\");\r\n }\r\n }", "public Item sample() {\n if (isEmpty()) throw new NoSuchElementException();\n return items[index()];\n }", "private Item createWinItem()\n { \n boolean valid = false;\n int randomNumber = random.nextInt(items.size());\n \n // repeat until the winning situation is reached, and valid is true.\n while (!valid){\n // the winning situation check.\n if(!(items.get(randomNumber).getWeight() > characters.get(0).getCARRYLIMIT()) && trackItems.contains(items.get(randomNumber).getName())){\n valid = true;\n return items.get(randomNumber);\n }\n else{\n randomNumber = random.nextInt(items.size());\n }\n }\n Item winItem = items.get(randomNumber);\n return winItem;\n }", "public int getRandom() {\r\n var list = new ArrayList<>(set);\r\n return list.get(new Random().nextInt(set.size()));\r\n }", "public Item generateItem()\n {\n Random rand = new Random();\n int item = rand.nextInt(itemList.size());\n return itemList.get(item);\n }", "public Item sample() {\n if (size == 0) throw new NoSuchElementException();\n return array[StdRandom.uniform(size)];\n }", "public void takeSomething()\r\n {\r\n \tThing item = room.getRandomThing();\r\n \tif (item != null)\r\n \t\ttake(item);\r\n }", "public Item getItemDropped(IBlockState state, Random rand, int fortune)\n {\n \treturn this == InitBlocksEA.arcanite_ore ? InitItemsEA.arcanite : (this == InitBlocksEA.draconium_ore ? InitItemsEA.draconium_dust : (this == InitBlocksEA.velious_ore ? InitItemsEA.velious : (this == InitBlocksEA.katcheen_ore ? InitItemsEA.katcheen : (this == InitBlocksEA.necrocite_ore ? InitItemsEA.necrocite : (this == InitBlocksEA.soularite_ore ? InitItemsEA.soularite : Item.getItemFromBlock(this))))));\n \t\n //return this == EbonArtsBlocks.arcanite_ore ? EbonArtsItems.arcanite_shard : (this == Blocks.diamond_ore ? Items.diamond : (this == Blocks.lapis_ore ? Items.dye : (this == Blocks.emerald_ore ? Items.emerald : (this == Blocks.quartz_ore ? Items.quartz : Item.getItemFromBlock(this)))));\n }", "private void pickItem() \n {\n if(currentRoom.getShortDescription() == \"in the campus pub\" && i.picked3 == false)\n {\n i.item3 = true;\n i.picked3 = true;\n System.out.println(\"You picked a redbull drink\");\n }\n else if(currentRoom.getShortDescription() == \"in th hallway\" && i.picked2 == false)\n {\n i.item2 = true;\n i.picked2 = true;\n System.out.println(\"You picked a torch\");\n }\n else if(currentRoom.getShortDescription() == \"in the office\" && i.picked1 == false)\n {\n i.item1 = true;\n i.picked1 = true;\n System.out.println(\"You picked a pair of scissors\");\n }\n else\n System.out.println(\"There is no items in the room!\");\n }", "public Item sample()\r\n {\r\n if (isEmpty()) throw new NoSuchElementException(\"Empty randomized queue\");\r\n\r\n int randomizedIdx = StdRandom.uniform(n);\r\n\r\n return a[randomizedIdx];\r\n }", "private void findResourcesFake() {\r\n\t\t\r\n\t\tRandom random = new Random();\t\r\n\t\t\r\n\t\t\t\t\t\t\r\n\t\tif (random.nextInt() % 10 == 0) {PoCOnline.setSelected(true); loadContainerOnline.setSelected(true);}\t\r\n\t\tif (random.nextInt() % 10 == 0) {fillRedOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {fillYellowOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {fillBlueOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {testOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {lidOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {dispatchOnline.setSelected(true);}\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public Item sample() {\n if (N == 0) throw new NoSuchElementException();\n int idx = StdRandom.uniform(N);\n return s[first + idx];\n }", "public float randomQual() {\n\t\treturn((float) getRandomInteger(30,250));\n\t}", "public int getRandom() {\n int x=rand.nextInt(li.size());\n return li.get(x);\n }", "public T sampleWithRemoval(boolean useMostLikely) {\n\t\tT result = sample(useMostLikely);\n\t\tremove(result);\n\t\tnormaliseProbs();\n\t\treturn result;\n\t}", "static boolean getMauled(){\n\t\t\tif (Person.player.inventory.contains(Item.repellent)) //if you have the goose repellent...\n\t\t\t\treturn (MainFile.getRandomNumber(240) == 12); //drastically lowers your chance of being mauled.\n\t\t\treturn (MainFile.getRandomNumber(20) == 12);//generates a random number for if you don't have it, and if it's 12 you get mauled\n\t\t}", "@Override\n public int quantityDroppedWithBonus(int fortune, Random random)\n {\n if (fortune > 0 && Item.getItemFromBlock(this) != this.getItemDropped(this.getBlockState().getValidStates().iterator().next(), random, fortune))\n {\n int i = random.nextInt(fortune + 2) - 1;\n\n if (i < 0)\n {\n i = 0;\n }\n\n return this.quantityDropped(random) * (i + 1);\n }\n else\n {\n return this.quantityDropped(random);\n }\n }", "public Item getItemDropped(int var1, Random var2, int var3)\n {\n if (var2.nextInt(4) == 0)\n {\n return FAItemRegistry.fernSeed;\n }\n return null;\n }", "private List<Card> chooseMulligan() {\n return this.b.getPlayer(this.b.getLocalteam()).getHand().stream()\n .filter(c -> c.finalStats.get(Stat.COST) > 3 && c.finalStats.get(Stat.SPELLBOOSTABLE) == 0)\n .collect(Collectors.toList());\n }", "public int getRandomBreed() {\n Random r = new Random();\n// displayToast(Integer.toString(getRandomBreed())); // not needed. generates another random number\n return r.nextInt(6);\n }", "public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) {}", "public int getRandom() {\n int index = rnd.nextInt(list.size());\n return list.get(index).val;\n }", "private int getRandomWithExclusion(int bound, List<Integer> exclude) {\n int random = Constants.RAND.nextInt(bound - exclude.size());\n for (int ex : exclude) {\n if (random < ex) break;\n random++;\n }\n return random;\n \n }", "public int getRandom() {\n return lst.get(rand.nextInt(lst.size()));\n }", "public int selectRandom(int x) {\n count++; // increment count of numbers seen so far\n\n // If this is the first element from stream, return it\n if (count == 1)\n res = x;\n else {\n // Generate a random number from 0 to count - 1\n Random r = new Random();\n int i = r.nextInt(count);\n\n // Replace the prev random number with new number with 1/count probability\n if (i == count - 1)\n res = x;\n }\n return res;\n }", "public int getRandom() {\n return _list.get( rand.nextInt(_list.size()) );\n }", "public Item sample() {\n if (isEmpty()) {\n throw new java.util.NoSuchElementException();\n }\n int sampleIndex = StdRandom.uniform(1, size + 1);\n Item item;\n //case 1: return first item\n if (sampleIndex == 1) {\n item = first.item;\n }\n //case 2 :return last item\n else if (sampleIndex == size) {\n item = last.item;\n }\n //case 3: general case in between\n else {\n Node temp = first;\n while (sampleIndex != 1) {\n temp = temp.next;\n sampleIndex--;\n }\n item = temp.item;\n }\n return item;\n }", "private void randomBehavior() {\n\t\trandom = rand.nextInt(50);\n\t\tif (random == 0) {\n\t\t\trandom = rand.nextInt(4);\n\t\t\tswitch (random) {\n\t\t\t\tcase 0:\n\t\t\t\t\tchangeFacing(ACTION.DOWN);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tchangeFacing(ACTION.RIGHT);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tchangeFacing(ACTION.UP);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tchangeFacing(ACTION.LEFT);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public static String randomSelection() {\n int min = 1;\n int max = 3;\n String randomSelection;\n Random random = new Random(System.currentTimeMillis());\n int randomNumber = random.nextInt((max - min) +1) +min;\n if(randomNumber == 1) {\n randomSelection = \"rock\";\n } else if (randomNumber == 2) {\n randomSelection = \"paper\";\n } else {\n randomSelection = \"scissors\";\n }\n return randomSelection;\n }", "private void selectRandomPlayer() {\n Random rand = new Random();\n // Restrict random number range to available indexes in the players list.\n // - 1 to offset zero-based index numbering.\n int random = rand.nextInt(players.size());\n activePlayer = players.get(random);\n }", "private Species getRandomSpeciesBaisedAdjustedFitness(Random random) {\r\n\t\tdouble completeWeight = 0.0;\r\n\t\tfor (Species s : species) {\r\n\t\t\tcompleteWeight += s.totalAdjustedFitness;\r\n\t\t}\r\n\t\tdouble r = Math.random() * completeWeight;\r\n\t\tdouble countWeight = 0.0;\r\n\t\tfor (Species s : species) {\r\n\t\t\tcountWeight += s.totalAdjustedFitness;\r\n\t\t\tif (countWeight >= r) {\r\n\t\t\t\treturn s;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthrow new RuntimeException(\"Couldn't find a species... Number is species in total is \" + species.size()\r\n\t\t\t\t+ \", and the toatl adjusted fitness is \" + completeWeight);\r\n\t}", "private <T> T getRandomElement(List<T> list) {\n return list.get(randomInt(0, list.size()));\n }", "private int choose(){\n\t\tdouble temp = 10 * Math.random();\n\t\tint i = (int)temp;\n\t\treturn i;\n\t}", "public Weapon buildWeapon() {\n\t\tRandom rand = new Random();\n\t\tint chance = rand.nextInt(rangeMax - rangeMin) + rangeMin;\n\t\tfor (Weapon weapon: weapons) {\n\t\t\tif (weapon.isInSpawnRange(chance)) {\n\t\t\t\treturn weapon.clone();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public Rule chooseRandomRule () {\n \n double a = Math.random();\n \n double c = 0.0;\n \n for (int i = 0; i < this.size(); i++) {\n \n c = c + this.getRule(i).getProb();\n \n if (c > a) {\n \n return this.getRule(i);\n }\n }\n \n return this.getRule(this.size()-1);\n \n }", "public Item sample() {\n if (isEmpty()) throw new NoSuchElementException(\"Empty queue\");\n\n int rdm = StdRandom.uniform(n);\n return a[rdm];\n }", "public static boolean chance(int prob) {\n Random random = new Random();\n return random.nextInt(prob) == 1;\n // Do I really need to explain this??\n }", "public Individual selectIndividual(Population population) {\n // Get individuals\n List<Individual> individuals = population.getPopulation();\n\n // Spin roulette wheel\n double populationFitness = population.getPopulationFitness();\n double rouletteWheelPosition = Math.random() * populationFitness;\n\n // Find parent\n double spinWheel = 0;\n for (Individual individual : individuals) {\n spinWheel += individual.getFitness();\n if (spinWheel >= rouletteWheelPosition) {\n return individual;\n }\n }\n return individuals.get(population.size() - 1);\n }", "private SocialPractice chooseOnIntentions(\n\t\t\tArrayList<SocialPractice> candidateSocialPractices) {\n\t\tSocialPractice chosenAction = null; //temp\n\t\tHashMap<SocialPractice, Double> needs=new HashMap<SocialPractice, Double>();\n\t\tfor(SocialPractice sp: candidateSocialPractices){\n\t\t\tneeds.put(sp, myValues.get(sp.getPurpose()).getNeed(myContext)); \n\t\t}\n\t\tdouble totalNeed = Helper.sumDouble(needs.values()); //satisfaction can get <0, so need as well, so maybe not getting in while loop\n\t\tdouble randomDeterminer = RandomHelper.nextDoubleFromTo(0, totalNeed);\n\t\t//System.out.println(myContext);\n\t\t//System.out.println(\"Needs:\" + needs);\n\t\t\n\t\tIterator it = needs.entrySet().iterator();\n\t\twhile(randomDeterminer > 0) {\n\t\t\tHashMap.Entry pair = (HashMap.Entry) it.next();\n\t\t\tchosenAction = (SocialPractice) pair.getKey();\n\t\t\trandomDeterminer = randomDeterminer - (double) pair.getValue();\n\t\t}\n\t\treturn chosenAction;\n\t}", "private ActorProfile selectRandomActorProfile(List<ActorProfile> list,\n ActorProfile actorSender)\n throws CannotSelectARandomActorException {\n if(randomSelectorIndex>=MAX_LOOPS_ON_RANDOM_ACTORS){\n throw new CannotSelectARandomActorException(\"The number of tries, \"+randomSelectorIndex+\" is upper than the limit\");\n }\n int randomIndex = (int) (((double)list.size())*Math.random());\n ActorProfile actorSelected = list.get(randomIndex);\n if(actorSelected.getIdentityPublicKey().equals(actorSender.getIdentityPublicKey())){\n randomSelectorIndex++;\n actorSelected = selectRandomActorProfile(list, actorSender);\n }\n /*if(actorSelected.getNsIdentityPublicKey().equals(actorSender.getNsIdentityPublicKey())){\n randomSelectorIndex++;\n actorSelected = selectRandomActorProfile(list, actorSender);\n }*/\n return actorSelected;\n }", "public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) {\n/* 78 */ if (!worldIn.isRemote && worldIn.getGameRules().getGameRuleBooleanValue(\"doTileDrops\")) {\n/* */ \n/* 80 */ EntitySilverfish var6 = new EntitySilverfish(worldIn);\n/* 81 */ var6.setLocationAndAngles(pos.getX() + 0.5D, pos.getY(), pos.getZ() + 0.5D, 0.0F, 0.0F);\n/* 82 */ worldIn.spawnEntityInWorld((Entity)var6);\n/* 83 */ var6.spawnExplosionParticle();\n/* */ } \n/* */ }", "public Item sample() {\n \t if (size==0){\n \t \tthrow new NoSuchElementException();\n \t }\n \t int index = StdRandom.uniform(size);\n // System.out.println(\"The index of the number is: \" + index);\n int k = 0;\n \t Node p=sentinel.next.next;\n \t for (int i = 0; i < index; i++){\n p = p.next; \n \t }\n \t return p.item;\n }", "public LeveledMonster pickRandomMonster(List<LeveledMonster> availableMonsters){\n List<Entry> entries = new ArrayList<>();\n double accumulatedWeight = 0.0;\n\n for (LeveledMonster m : availableMonsters){\n accumulatedWeight += m.getSpawnWeight();\n Entry e = new Entry();\n e.object = m;\n e.accumulatedWeight = accumulatedWeight;\n entries.add(e);\n }\n\n double r = Utils.getRandom().nextDouble() * accumulatedWeight;\n\n for (Entry e : entries){\n if (e.accumulatedWeight >= r){\n return e.object;\n }\n }\n return null;\n }", "@Override\n public int damage(){\n int damage = 0;\n Random rand = new Random();\n int x = rand.nextInt(20) + 1;\n if (x == 1)\n damage = 50;\n return damage; \n }", "public int chooseCard(){\n if(playable.size() == 1)//checks the size\n return searchCard(0);//returns the only playable card\n else{\n int temp = (int) Math.random()*playable.size();//chooses a random one\n return searchCard(temp);//returns that cards position\n }\n }" ]
[ "0.61502117", "0.60203624", "0.60139626", "0.60027", "0.5979687", "0.59475374", "0.59321594", "0.59087867", "0.5887832", "0.58816373", "0.5857283", "0.5857283", "0.58008635", "0.57967687", "0.5769362", "0.57529676", "0.57526654", "0.5745437", "0.57307464", "0.56774706", "0.56720525", "0.56604064", "0.5653496", "0.5598722", "0.5597255", "0.55970895", "0.55875194", "0.5554348", "0.5536155", "0.5535147", "0.5532157", "0.5529703", "0.55286723", "0.5520923", "0.5511996", "0.5505834", "0.5496318", "0.5494156", "0.54928076", "0.54895556", "0.5469887", "0.54651403", "0.5457391", "0.5442716", "0.54427016", "0.5442178", "0.5440541", "0.5436551", "0.54284036", "0.5423459", "0.54183525", "0.54173803", "0.5406313", "0.54036146", "0.53979844", "0.5394966", "0.538631", "0.5384899", "0.5380453", "0.5376985", "0.536892", "0.53685766", "0.53638566", "0.53572494", "0.53525287", "0.53494257", "0.53377664", "0.5334693", "0.53313977", "0.5327272", "0.5325205", "0.53149635", "0.53046715", "0.5302914", "0.53004503", "0.52990884", "0.5296774", "0.5274908", "0.52669114", "0.52547085", "0.5252338", "0.5250398", "0.5248561", "0.5240381", "0.5237676", "0.52344203", "0.5228965", "0.5226215", "0.52246094", "0.5215118", "0.5213995", "0.52135354", "0.5207451", "0.5205325", "0.51911664", "0.5183842", "0.51831377", "0.5178707", "0.51768553" ]
0.69622666
1
insert the query into the list of queries.
public Exact_Period_Count create_query(String word, Date min, Date max) { Exact_Period_Count query = new Exact_Period_Count(word, min, max); if(!m_table.containsKey(word)) m_table.put(word, new LinkedList<Exact_Period_Count>()); m_table.get(word).add(query); m_queryList.add(query); return query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void add(Query query) {\n queries.add(query);\n executeThread();\n }", "private void addQuery(String query){\n this.queries.add( query);\n }", "private void addQueries(String query){\n ArrayList <String> idsFullSet = new ArrayList <String>(searchIDs);\n while(idsFullSet.size() > 0){\n ArrayList <String> idsSmallSet = new ArrayList <String>(); \n if(debugMode) {\n System.out.println(\"\\t Pmids not used in query available : \" + idsFullSet.size());\n }\n idsSmallSet.addAll(idsFullSet.subList(0,Math.min(getSearchIdsLimit(), idsFullSet.size())));\n idsFullSet.removeAll(idsSmallSet);\n String idsConstrain =\"\";\n idsConstrain = idsConstrain(idsSmallSet);\n addQuery(query,idsConstrain);\n }\n }", "private void addQuery(String query, String idsConstrain){\n this.queries.add( idsConstrain + query);\n }", "private void queryList (String query) {\n\t\tmemoListAdapter.query(query);\n\t}", "void insertQuery (String query) throws SQLException\n\t{\n\t\t/* Creiamo lo Statement per l'esecuzione della query */\n\t\tStatement s = conn.createStatement(); \n\t\t\n\t\t/* eseguiamo la query */\n s.executeUpdate(query);\n\t}", "public void insert(SQLStatement statement) {\n queryThread.addQuery(statement);\n }", "public void newQuery(String query){\n\t\tparser = new Parser(query);\n\t\tQueryClass parsedQuery = parser.createQueryClass();\n\t\tqueryList.add(parsedQuery);\n\t\t\n\t\tparsedQuery.matchFpcRegister((TreeRegistry)ps.getRegistry());\n\t\tparsedQuery.matchAggregatorRegister();\n\t\t\n\t\t\n\t}", "public void addOneQuery(QueryInfo queryInfo) {\n\t\tthis.maxQueries.add(queryInfo);\n\t}", "public void start() {\n \n for (Object obj: bufferedQueries) {\n \n switch(obj.getClass().getName()) {\n case \"uzh.tomdb.db.operations.Insert\":\n if (inserts == null) {\n inserts = new ArrayList<>();\n }\n inserts.add((Insert) obj);\n break;\n case \"uzh.tomdb.db.operations.CreateTable\":\n if (creates == null) {\n creates = new ArrayList<>();\n }\n creates.add((CreateTable) obj);\n break;\n case \"uzh.tomdb.db.operations.Update\":\n if (updates == null) {\n updates = new ArrayList<>();\n }\n updates.add((Update) obj);\n break;\n case \"uzh.tomdb.db.operations.Delete\":\n if (deletes == null) {\n deletes = new ArrayList<>();\n }\n deletes.add((Delete) obj);\n break;\n }\n }\n \n if (inserts != null) {\n inserts();\n }\n if (creates != null) {\n creates();\n }\n if (updates != null) {\n updates();\n }\n if (deletes != null) {\n deletes();\n }\n }", "public void callQuery(String query) throws SQLException {\n for(int i = 0; i < queryHistory.size(); i++) {\n if(queryHistory.get(i).equalsIgnoreCase(query))\n data.get(i).OUPUTQUERY(data.get(i).getConversionArray(), data.get(i).getResultSet());\n }\n }", "public abstract ResultList executeQuery(DatabaseQuery query);", "public void startQuery(SQLiteConnection connection, String query) {\n synchronized (connection) {\n if (!connections.contains(connection)) {\n connections.add(connection);\n }\n QueryAndTime qAndTime = currentQueries.get(connection);\n if (qAndTime == null) {\n qAndTime = new QueryAndTime(query, System.currentTimeMillis());\n currentQueries.put(connection, qAndTime);\n } else {\n qAndTime.query = query;\n qAndTime.time = System.currentTimeMillis();\n }\n }\n }", "public List<QueryHit> processQuery(String query) {\n // Do something!\n System.err.println(\"Processing query '\" + query + \"'\");\n return new ArrayList<QueryHit>();\n }", "void runQueries();", "public void newQuery(String query){\n for(RecyclerViewWrapper wrapper : mRecyclerViews){\n wrapper.data.clear();\n wrapper.adapter.notifyDataSetChanged();\n Log.d(TAG, \"Test: \" + wrapper.data.size());\n }\n\n mQueryManager.searchAll(query);\n }", "private void executeQuery() {\n }", "@Override\n public void insert(Iterator<Object[]> batch) {\n while (batch.hasNext()) {\n BoundStatement boundStatement = statement.bind(batch.next());\n ResultSetFuture future = session.executeAsync(boundStatement);\n Futures.addCallback(future, callback, executor);\n }\n }", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int length = in.nextInt();\n ArrayList<Integer> array = new ArrayList<Integer>();\n for (int i = 0; i < length; i++) {\n array.add(in.nextInt());\n }\n int num_queries = in.nextInt();\n String instr = \"\";\n int index, temp;\n for (int i = 0; i < num_queries; i++){\n instr = in.next();\n index = in.nextInt();\n if (instr.equals(\"Insert\")) {\n temp = in.nextInt();\n array.add(index,temp);\n } else if (instr.equals(\"Delete\")) {\n array.remove(index);\n }\n }\n for (int i = 0; i < length; i++) {\n System.out.print(array.get(i));\n System.out.print(\" \");\n }\n }", "@Override\n\t\tpublic void executeQuery(String query) {\n\t\t\t\n\t\t}", "protected synchronized void pureSQLInsert(String query) {\n if(this.connect()) {\n try {\n this.statement = this.connection.createStatement();\n this.statement.executeUpdate(query);\n } catch(SQLException ex) {\n Logger.getLogger(MySQLMariaDBConnector.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n this.close();\n }\n }\n }", "public synchronized void addAll() throws SQLException {\n\t\t\n\t\ttry {\n\n\t\t\tStatement delete = db.createStatement();\n\t\t\tdelete.executeUpdate(\"DELETE FROM search_command_queue\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tif(delete != null) {\n\t\t\t\t\tdelete.close();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (SQLException e) {\n\t\t\t\tlogger.warn(e);\n\t\t\t}\n\t\t\t\n\t\t\tClientSettings client = ClientSettings.getInstance(LocalSettings.getClientKey());\n\n\t\t\tPreparedStatement pst = DBFactory.getPreparedStatement(\"INSERT INTO search_command_queue (obj_id,obj_type,sub_id,sub_type,command,last_update,finished ) \" +\n\t\t\t\"VALUES ( ?, ?, ?, ?, ?, ?, ?) \");\n\n\t\t\tfor(Object def : ObjectDefinitions.getInstance(client.getAbsolutePath()).getDefinitions()) {\n\t\t\t\t\n\t\t\t\tlogger.info(\"Adding reset command for \" + ((ObjectDefinition) def).getType());\n\t\t\t\t\tpst.setInt(1,0);\n\t\t\t\t\tpst.setString(2, ((ObjectDefinition) def).getType());\n\t\t\t\t\tpst.setInt(3,0);\n\t\t\t\t\tpst.setString(4,\"\");\n\t\t\t\t\tpst.setString(5,\"reset_all\");\n\t\t\t\t\tpst.setTimestamp(6,new java.sql.Timestamp(new java.util.Date().getTime()));\n\t\t\t\t\tpst.setInt(7,0);\n\t\t\t\tpst.executeUpdate();\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tlogger.error(\"Cannot add to command queue\",e);\n\t\t}\n\t}", "public void insertarDatos(String query) throws SQLException{\n Statement st = conexion.createStatement(); // creamos el mismo objeto statement para realizar la insercion a la base de datos\n st.executeUpdate(query); // se ejecuta la consulta en la base de datos\n }", "public List<JsonNode> forwardQuery(Query query) throws InvalidQueryException, IOException;", "public void insertClause(int ix, EClause c)\n\t{ clauses.add(ix, c); }", "public void addOneMaxQuery(QueryInfo queryInfo) {\n\t\tthis.maxQueries.add(queryInfo);\n\t}", "private void addStatements(List<Statement> statements) throws LpException {\n outputRdf.execute((connection) -> {\n connection.add(statements);\n });\n statements.clear();\n }", "private void insertOperator() {\n int rowsAff = 0;\n int counter = 0;\n String query = \"\";\n System.out.print(\"Table: \");\n String table = sc.nextLine();\n System.out.print(\"Comma Separated Columns: \");\n String cols = sc.nextLine();\n System.out.print(\"Comma Separated Values: \");\n String[] vals = sc.nextLine().split(\",\");\n //transform the user input into a valid SQL insert statement\n query = \"INSERT INTO \" + table + \" (\" + cols + \") VALUES(\";\n for (counter = 0; counter < vals.length - 1; counter++) {\n query = query.concat(\"'\" + vals[counter] + \"',\");\n }\n query = query.concat(\"'\" + vals[counter] + \"');\");\n System.out.println(query);\n rowsAff = sqlMngr.insertOp(query);\n System.out.println(\"\");\n System.out.println(\"Rows affected: \" + rowsAff);\n System.out.println(\"\");\n }", "public void insert() {\r\n\t\t// In this way we can enjoy work`s deliverable without inheritance.\r\n\t\totherMethod();\r\n\t\twork.insert();\r\n\t}", "public abstract List createQuery(String query);", "private void addInsertOp() {\n\n if (!mIsNewAlert) {\n mValues.put(AlertContentProvider.KEY_ALERT_ID, mRawAlertId);\n }\n ContentProviderOperation.Builder builder =\n newInsertCpo(Data.CONTENT_URI, mIsSyncOperation, mIsYieldAllowed);\n builder.withValues(mValues);\n if (mIsNewAlert) {\n builder.withValueBackReference(AlertContentProvider.KEY_ALERT_ID, mBackReference);\n }\n mIsYieldAllowed = false;\n mBatchOperation.add(builder.build());\n }", "protected String queryInsert() {\n StringBuilder sb = new StringBuilder(\"INSERT INTO \");\n sb.append(tabla).append(\" (\").append(String.join(\",\", campos)).append(\") VALUES (\");\n\n for (int i = 0; i < campos.length; i++) {\n if (i == campos.length -1) {\n sb.append(\"?)\");\n break;\n }\n sb.append(\"?,\");\n }\n\n return sb.toString();\n }", "public void setQuery(DatabaseQuery query) {\n this.query = query;\n }", "public void fetch(){ \n for(int i = 0; i < this.queries.size(); i++){\n fetch(i);\n }\n }", "public void updateRecords(String query) {\n\t\tcurrentQuery = query;\n\t\tThread resultThread = new Thread(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tString workingOnQuery = currentQuery;\n\n\t\t\t\t// Ask for records\n\t\t\t\tfinal ArrayList<Record> records = dataHandler\n\t\t\t\t\t\t.getRecords(workingOnQuery);\n\n\t\t\t\t// Another search have already been made\n\t\t\t\tif (workingOnQuery != currentQuery)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (records == null) {\n\t\t\t\t\t// First use of the app. TODO : Display something useful.\n\t\t\t\t} else {\n\t\t\t\t\trunOnUiThread(new Runnable() {\n\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tadapter.clear();\n\t\t\t\t\t\t\tfor (int i = Math.min(MAX_RECORDS,\n\t\t\t\t\t\t\t\t\trecords.size()) - 1; i >= 0; i--) {\n\t\t\t\t\t\t\t\tadapter.add(records.get(i));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Reset scrolling to top\n\t\t\t\t\t\t\tlistView.setSelectionAfterHeaderView();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tresultThread.start();\n\t}", "private <T, Q extends Query> void executeInsertBatch(Collection<T> objectsToInsert, Function<? super T, ? extends Q> mapFunction) {\n\t\tList<Q> insertStatements = objectsToInsert.stream().map(mapFunction).collect(Collectors.toList());\n\t\tdslContext.batch(insertStatements).execute();\n\t}", "public void add(QueryView view) {\n queryViews.add(view);\n }", "public void addQueryElement(QueryElement element);", "private void populateAdapter(String query) {\n // Create a matrixcursor, add suggtion strings into cursor\n final MatrixCursor c = new MatrixCursor(new String[]{ BaseColumns._ID, SearchManager.SUGGEST_COLUMN_TEXT_1 });\n List<String> suggestions = History.getSuggestion(query);\n String str = \"\";\n for (int i=0;i<suggestions.size();i++){\n c.addRow(new Object[] {i, suggestions.get(i)});\n str += suggestions.get(i);\n }\n Toast.makeText(context, str,Toast.LENGTH_SHORT).show();\n mAdapter.changeCursor(c);\n }", "void setOrderedQueryParameter(Query query, T value);", "@Override\n public boolean onQueryTextSubmit(String query) {\n queryMain = query;\n consultarDb();\n return true;\n }", "private RunQueriesEx setupQueries() {\n RunQueriesEx queries = new RunQueriesEx();\n \n //for each column in our table, update one of our lists\n for(int i = 0; i < this.dataTable.getColumnCount(); i++) {\n this.updateList(i);\n }\n \n updateEmptyLists(); //pads any lists that didn't get updates with empty strings\n \n //add a new query for each row in the table\n for(int i = 0; i < this.dataTable.getRowCount(); i++) {\n queries.add(this.createQueryFromRow(i));\n }\n \n return queries;\n }", "private void performNewQuery(){\n\n // update the label of the Activity\n setLabelForActivity();\n // reset the page number that is being used in queries\n pageNumberBeingQueried = 1;\n // clear the ArrayList of Movie objects\n cachedMovieData.clear();\n // notify our MovieAdapter about this\n movieAdapter.notifyDataSetChanged();\n // reset endless scroll listener when performing a new search\n recyclerViewScrollListener.resetState();\n\n /*\n * Loader call - case 3 of 3\n * We call loader methods as we have just performed reset of the data set\n * */\n // initiate a new query\n manageLoaders();\n\n }", "public void insert()\n\t{\n\t}", "public int addItem(SingleQuery singleQuery)\n {\n int queryIndex;\n queries.put(itemsCount, singleQuery);\n queryIndex = itemsCount;\n itemsCount++;\n return queryIndex;\n }", "public CriteriaQuery query(List<CriteriaGroup> query) {\n this.query = query;\n return this;\n }", "@Override\n\tpublic void executeQuery(String query) {\n\t\tStatement statement;\n\t\ttry {\n\t\t\tstatement=connection.createStatement();\n\t\t\tstatement.executeUpdate(query);\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}", "public void setQuery( String query ) \r\n throws SQLException, IllegalStateException \r\n {\r\n if ( !connectedToDatabase ) \r\n throw new IllegalStateException( \"Not Connected to Database\" );\r\n\r\n resultSet = statement.executeQuery( query );\r\n\r\n metaData = resultSet.getMetaData();\r\n\r\n resultSet.last(); \r\n numberOfRows = resultSet.getRow(); \r\n \r\n fireTableStructureChanged();\r\n }", "public Builder addQueries(WorldUps.UQuery value) {\n if (queriesBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureQueriesIsMutable();\n queries_.add(value);\n onChanged();\n } else {\n queriesBuilder_.addMessage(value);\n }\n return this;\n }", "public void run() {\n String query = \"INSERT INTO CustomData (Server, Plugin, ColumnID, DataPoint, Updated) VALUES\";\n int currentSeconds = (int) (System.currentTimeMillis() / 1000);\n\n // Iterate through each column\n for (Map.Entry<Column, Integer> entry : customData.entrySet()) {\n Column column = entry.getKey();\n int value = entry.getValue();\n\n // append the query\n query += \" (\" + server.getId() + \", \" + plugin.getId() + \", \" + column.getId() + \", \" + value + \", \" + currentSeconds + \"),\";\n }\n\n // Remove the last comma\n query = query.substring(0, query.length() - 1);\n\n // add the duplicate key entry\n query += \" ON DUPLICATE KEY UPDATE DataPoint = VALUES(DataPoint) , Updated = VALUES(Updated)\";\n\n // queue the query\n new RawQuery(mcstats, query).save();\n }", "@Override\n\tvoid executeQuery(String query) {\n\t\tSystem.out.println(\"Mssql ==> \" + query);\n\t}", "public InsertQuery(String tableName) {\r\n\t\tthis.tableName = tableName;\r\n\t\tfieldNames = new ArrayList<String>();\r\n\t\tfieldValues = new ArrayList<String>();\r\n\t}", "public void makeQueryTermList() {\n for (int i = 0; i < this.stemmed_query.size(); i++) {\n boolean added = false;\n String curTerm = this.stemmed_query.get(i);\n for (int j = 0; j < this.query_terms_list.size(); j++) {\n if (this.query_terms_list.get(j).strTerm.compareTo(curTerm) == 0) {\n this.query_terms_list.get(j).timeOccur++;\n added = true;\n break;\n }\n }\n if (added == false) {\n this.query_terms_list.add(new QueryTerm(curTerm));\n }\n }\n }", "private synchronized String processAdd(String query) {\r\n\t\tString[] valuesCommand = query.split(\" \");\r\n\t\tif ( valuesCommand.length != 3 )\r\n\t\t\treturn \"ERROR Bad syntaxe command ADD - USAGE : ADD id number\";\r\n\t\tString id = valuesCommand[1];\r\n\t\tif ( !this.bank.existAccount(id) ) {\r\n\t\t\treturn \"ERROR Account doesn't exist\";\r\n\t\t}\r\n\t\tdouble number = Double.valueOf(valuesCommand[2]);\r\n\t\tthis.bank.add(id, number);\r\n\t\treturn \"OK \" + this.bank.getLastOperation(id);\r\n\t}", "public void splitQuery(){\n for (int i=0;i<stemmed_query.size();i++){\n String stemmed_term = stemmed_query.get(i);\n for (int j=0;j<num_slave_client_threads;j++){\n if (stemmed_term.compareTo(ServerThread.start_terms[j]) >= 0 && stemmed_term.compareTo(ServerThread.end_terms[j]) <= 0){\n slave_queries.set(j, slave_queries.get(j)+\" \"+stemmed_term);\n break;\n }\n }\n }\n }", "static void insert(Queue<Integer> q, int k){\n \n q.add(k);\n \n }", "String buildInsertQuery(String... args);", "void newAnswer (Integer q, Integer a) {\n\t\tif (results.get(q)==null) {\n\t\t\tArrayList<Integer> newEntry = new ArrayList<Integer>();\n\t\t\tnewEntry.add(a);\n\t\t\tresults.put(q, newEntry);\n\t\t} else {\n\t\t\t// append to existing list\n\t\t\tresults.get(q).add(a);\n\t\t}\n\t}", "public void insertCommand(iCommand c){\r\n\t\ttry {\r\n\t\t\tcommandQueue.put(c);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "QueryResult(String... queries) {\n results = new ConcurrentHashMap<>(queries.length);\n for (String query : queries)\n results.put(query.hashCode(), new int[0]);\n }", "@Override\n\tpublic void insert() {\n\t\t\n\t}", "public Builder addQueries(\n int index, WorldUps.UQuery value) {\n if (queriesBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureQueriesIsMutable();\n queries_.add(index, value);\n onChanged();\n } else {\n queriesBuilder_.addMessage(index, value);\n }\n return this;\n }", "private ArrayList<WordDocument> executeRegularQuery(){\n String[] splitedQuery = this.query.split(\" \");\n ArrayList<WordDocument> listOfWordDocuments = new ArrayList<WordDocument>();\n String word = \"\";\n\n for(int i = 0; i < splitedQuery.length; i++){\n if(!isOrderByCommand(splitedQuery[i]) && i == 0) {\n word = splitedQuery[i];\n\n if(cache.isCached(word))\n addWithoutDuplicate(listOfWordDocuments, cache.getCachedResult(word));\n else\n addWithoutDuplicate(listOfWordDocuments, getDocumentsWhereWordExists(word));\n\n }else if(i >= 1 && isOrderByCommand(splitedQuery[i])) {\n subQueries.add(word);\n listOfWordDocuments = orderBy(listOfWordDocuments, splitedQuery[++i], splitedQuery[++i]);\n break;\n }\n else\n throw new IllegalArgumentException();\n }\n\n return listOfWordDocuments;\n }", "public void add(QueryNode child);", "public void searchAndInsert(T searchValue, T InsertValue){\n int index = searchByValue(searchValue) + 1;\n addAtIndex(index, InsertValue);\n }", "protected final void executeQuery() {\n\ttry {\n\t executeQuery(queryBox.getText());\n\t} catch(SQLException e) {\n\t e.printStackTrace();\n\t clearTable();\n\t JOptionPane.showMessageDialog(\n\t\tnull, e.getMessage(),\n\t\t\"Database Error\",\n\t\tJOptionPane.ERROR_MESSAGE);\n\t}\n }", "public void Query() {\n }", "public List<IEntity> query(IQuery query) throws SQLException;", "public void executeQuery_Other(String query) {\n\n \n Connection con = DBconnect.connectdb();\n Statement st;\n\n try {\n st = con.createStatement();\n st.executeUpdate(query);\n\n \n } catch (Exception e) {\n //JOptionPane.showMessageDialog(null, e);\n\n }\n\n }", "@Insert\n long[] insertAll(Task... tasks);", "public void addToDBConsistCheckQueryExecs(entity.DBConsistCheckQueryExec element) {\n __getInternalInterface().addArrayElement(DBCONSISTCHECKQUERYEXECS_PROP.get(), element);\n }", "public void customQuery(String query) {\n sendQuery(query);\n }", "QueryResult(Pair<Integer, String>[] queries) {\n results = new ConcurrentHashMap<>(queries.length);\n for (Pair<Integer, String> query : queries)\n results.put(query.first, new int[0]);\n }", "public void ddlQuery(String query){\n try {\n s = conn.createStatement();\n s.executeUpdate(query);\n\n } catch (SQLException e) {\n System.out.println(\"Error trying to create or modify the database structure \" + e.getSQLState());\n e.printStackTrace();\n }\n }", "@Insert\n void insertAll(Measurement... measurements);", "public void addToMap(){\n\t\tInteger hc = currentQuery.hashCode();\n\t\tif (!hmcache.containsKey(hc)) {\n\t\t\thmcache.put(hc, 0);\n\t\t}else{\n\t\t\tInteger val = hmcache.get(hc) + (currentQuery.getWords().size());\n\t\t\thmcache.put(hc, val);\n\t\t}\n\t}", "public void pre() {\n\t\t//handlePreReset(); //replaced with handlePostReset \n\t\tsendKeepAlive();\n\t\tcurrentQuery = new Query();\n\t\tfastForward = false;\n\n\t\t// System.out.println(\"New query starts now.\");\n\t}", "public void insert(List<T> entity) throws NoSQLException;", "public void add(ContentValues values) {\n long startTime = values.getAsLong(DB.FEED.START_TIME);\n long endTime = startTime;\n if (values.containsKey(DB.FEED.DURATION))\n endTime = startTime + values.getAsLong(DB.FEED.DURATION);\n\n int endIndex = findEndIndex(startTime - TIME_MARGIN);\n int startIndex = findStartIndex(endIndex, endTime + TIME_MARGIN);\n\n for (int i = startIndex; i <= endIndex; i++) {\n ContentValues c = currList.get(i);\n if (match(values, c, filterDuplicates)) {\n // Set already contains matching row...skip this\n discarded++;\n return;\n }\n }\n added++;\n addList.add(values); // no match, add this row\n mDB.insert(DB.FEED.TABLE, null, values);\n }", "public static int insertAll(Connection connection, List<CLRequestHistory> cls) {\n PreparedStatement statement = null;\n\n try {\n // commit at once.\n final boolean ac = connection.getAutoCommit();\n connection.setAutoCommit(false);\n\n // execute statement one by one\n int numUpdate = 0;\n statement = connection.prepareStatement(INSERT);\n for (CLRequestHistory cl : cls) {\n statement.setInt(1, cl.mCL);\n statement.setInt(2, cl.mState);\n numUpdate += statement.executeUpdate();\n }\n\n // commit all changes above\n connection.commit();\n\n // restore previous AutoCommit setting\n connection.setAutoCommit(ac);\n\n // Close Statement to release all resources\n statement.close();\n return numUpdate;\n } catch (SQLException e) {\n Utils.say(\"Not able to insert for CLs : \" + cls.size());\n } finally {\n try {\n if (statement != null)\n statement.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n return 0;\n }", "public void addToDBConsistCheckQueryExecs(entity.DBConsistCheckQueryExec element) {\n __getInternalInterface().addArrayElement(DBCONSISTCHECKQUERYEXECS_PROP.get(), element);\n }", "public void updateFirst( Query q, UpdateOperations ops) {\n \tds.updateFirst(q, ops);\n }", "public QueryCore setup(String query, List<Object> l,Connection c) throws SQLException\n {\n loadQuery(query,l).init(c);\n return this;\n }", "public abstract void applyToQuery(DatabaseQuery theQuery, GenerationContext context);", "@Override\r\n\tpublic String insert() {\n\t\treturn \"insert\";\r\n\t}", "public void insert(List<Event> eventsList);", "private <T> void executeInsert(Object key, T value, String query) {\r\n\t\tlogger.entering(CLASSNAME, \"executeInsert\", new Object[] {key, value, query});\r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement statement = null;\r\n\t\tByteArrayOutputStream baos = null;\r\n\t\tObjectOutputStream oout = null;\r\n\t\tbyte[] b;\r\n\t\ttry {\r\n\t\t\tconn = getConnection();\r\n\t\t\tstatement = conn.prepareStatement(query);\r\n\t\t\tbaos = new ByteArrayOutputStream();\r\n\t\t\toout = new ObjectOutputStream(baos);\r\n\t\t\toout.writeObject(value);\r\n\r\n\t\t\tb = baos.toByteArray();\r\n\r\n\t\t\tstatement.setObject(1, key);\r\n\t\t\tstatement.setBytes(2, b);\r\n\t\t\tstatement.executeUpdate();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new PersistenceException(e);\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new PersistenceException(e);\r\n\t\t} finally {\r\n\t\t\tif (baos != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tbaos.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tthrow new PersistenceException(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (oout != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\toout.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tthrow new PersistenceException(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcleanupConnection(conn, null, statement);\r\n\t\t}\r\n\t\tlogger.exiting(CLASSNAME, \"executeInsert\");\r\n\t}", "private void updateQueryViews() {\n for (QueryView view : queryViews) {\n updateQueryView(view);\n }\n }", "public boolean insertDB(String qryExp, RequestBox rBox) throws Exception {\n\t\treturn false;\n\t}", "public static void executingUpdate(String query1) {\r\n try {\r\n //Apertura de conexion:\r\n Connection con = iniciarConexion();\r\n PreparedStatement pst = con.prepareStatement(query1);\r\n con.setAutoCommit(false);\r\n //Añadimos todas las setencias del ArrayList a la batería de queries:\r\n\r\n pst.addBatch(query1);\r\n\r\n //Recogemos los datos de filas modificadas por cada query y los mostramos:\r\n int[] registrosAfectados = pst.executeBatch();\r\n for (int i = 0; i < registrosAfectados.length; i++) {\r\n System.out.println(\"Filas modificadas: \" + registrosAfectados[i]);\r\n }\r\n //Se confirma la transacción a la base de datos:\r\n con.commit();\r\n con.close();\r\n //Se limpia el ArrayList para una sesión posterior:\r\n\r\n } catch (SQLException ex) {\r\n System.err.print(\"SQLException: \" + ex.getMessage());\r\n }\r\n }", "public void addCommand(String auth, Command command) {\n if(sessionCommandQueue.containsKey(auth)) {\n sessionCommandQueue.get(auth).add(command);\n } else {\n List<Command> list = new ArrayList<>();\n list.add(command);\n sessionCommandQueue.put(auth, list);\n }\n }", "public static void incrInsertions() { ++insertions; }", "public void setQuery(Integer query) {\n this.query = query;\n }", "Query query();", "public void insert(Integer x) {\n pq[++N] = x;\n swim(N);\n }", "public void update_query(TwitterParser tweet)\r\n\t{\r\n\t\tfor(String s : tweet.get_words())\r\n\t\t\tupdate_query(s, tweet.get_date());\r\n\t}", "protected abstract void onQueryStart();", "public void multipleQueriesASync(List<IndexQuery> queries, APIClientListener listener) {\n TaskParams.Client params = new TaskParams.Client(listener, APIMethod.MultipleQueries, queries, \"none\");\n new ASyncClientTask().execute(params);\n }", "public void createQuery(ResultSet rs, String Query) throws SQLException {\n this.data.add(new QueryConversionData(rs));\n this.queryHistory.add(Query);\n }", "public static void importPreviousQueries(StandaloneSupport support, RequiredData content, User user) throws JSONException, IOException {\n\t\tint id = 1;\n\t\tfor (ResourceFile queryResults : content.getPreviousQueryResults()) {\n\t\t\tUUID queryId = new UUID(0L, id++);\n\n\t\t\tfinal CsvParser parser = new CsvParser(support.getConfig().getCsv().withParseHeaders(false).withSkipHeader(false).createCsvParserSettings());\n\t\t\tString[][] data = parser.parseAll(queryResults.stream()).toArray(new String[0][]);\n\n\t\t\tConceptQuery q = new ConceptQuery(new CQExternal(Arrays.asList(FormatColumn.ID, FormatColumn.DATE_SET), data));\n\n\t\t\tManagedExecution<?> managed = ExecutionManager.createQuery(support.getNamespace().getNamespaces(),q, queryId, user.getId(), support.getNamespace().getDataset().getId());\n\t\t\tuser.addPermission(support.getStandaloneCommand().getMaster().getStorage(), QueryPermission.onInstance(AbilitySets.QUERY_CREATOR, managed.getId()));\n\t\t\tmanaged.awaitDone(1, TimeUnit.DAYS);\n\n\t\t\tif (managed.getState() == ExecutionState.FAILED) {\n\t\t\t\tfail(\"Query failed\");\n\t\t\t}\n\t\t}\n\n\t\t// wait only if we actually did anything\n\t\tif (!content.getPreviousQueryResults().isEmpty()) {\n\t\t\tsupport.waitUntilWorkDone();\n\t\t}\n\t}", "public static void ExecuteWriteQuery(String query) {\n\t\ttry {\n\t\t\tStatement st = conn.createStatement();\n\t\t\tst.executeUpdate(query);\n\t\t} catch(SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}" ]
[ "0.7202301", "0.7117388", "0.6814981", "0.6477031", "0.613419", "0.6087786", "0.59718055", "0.5970796", "0.59265864", "0.5770122", "0.5653999", "0.56265986", "0.56216514", "0.5536768", "0.54655063", "0.54340917", "0.53840095", "0.52929956", "0.52869904", "0.52868164", "0.5238218", "0.52327937", "0.52176625", "0.52019185", "0.520032", "0.51979613", "0.51828206", "0.51828104", "0.51720506", "0.5170795", "0.5146461", "0.51456654", "0.51150036", "0.5107506", "0.5098988", "0.50916904", "0.50852513", "0.5083394", "0.50722957", "0.5071981", "0.50479096", "0.5037017", "0.50310874", "0.5028451", "0.5023462", "0.50079334", "0.50016373", "0.4994668", "0.49923778", "0.49919638", "0.49792746", "0.49724612", "0.4957874", "0.49570632", "0.49563092", "0.4949623", "0.49481466", "0.49392983", "0.4936018", "0.4932522", "0.49191135", "0.49184728", "0.49156958", "0.4915051", "0.4907803", "0.49036837", "0.4899948", "0.48925227", "0.48811007", "0.4880813", "0.4858339", "0.48519182", "0.48476556", "0.48469105", "0.48464447", "0.48414096", "0.48386246", "0.48318756", "0.48291895", "0.48287272", "0.48285085", "0.48192048", "0.4802681", "0.47875065", "0.4783092", "0.47818625", "0.4767155", "0.4764674", "0.47576958", "0.47560415", "0.47429416", "0.47367975", "0.47341165", "0.47336563", "0.4732715", "0.47303566", "0.4728896", "0.47252077", "0.47227964", "0.47199896", "0.47187704" ]
0.0
-1
given a single word and the date which that word occurred, update the queries of interest so they count this word.
public void update_query(String word, Date time) { List<Exact_Period_Count> queries = m_table.get(word); if(queries != null) for(Exact_Period_Count i : queries) i.Add_ifInRange(time); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateCount(String word) {\n\t\t\tthis.count += invertedIndex.get(word).get(this.location).size();\n\t\t\tthis.score = (double) this.count / counts.get(this.location);\n\t\t}", "public void addToStatByDay(Date date, String word, int n) {\n\t\tString collection = simpleDateFormat.format(date);\n\t\tConcurrentNavigableMap<String, String> listVocabulary = dbStats\n\t\t\t\t.getTreeMap(collection);\n\t\tString strTimes = listVocabulary.get(word);\n\t\tint times = 0;\n\t\tif (strTimes != null) {\n\t\t\ttimes = Integer.parseInt(strTimes);\n\t\t\ttimes = times + n;\n\t\t} else {\n\t\t\ttimes = n;\n\t\t}\n\t\tlistVocabulary.put(word, Integer.toString(times));\n\t}", "private void update(String person){\n\n\t\tint index = myWords.indexOf(person);\n\t\tif(index == -1){\n\t\t\tmyWords.add(person);\n\t\t\tmyFreqs.add(1);\n\t\t}\n\t\telse{\n\t\t\tint value = myFreqs.get(index);\n\t\t\tmyFreqs.set(index,value+1);\n\t\t}\n\t}", "private static void statsForQuery(String query) {\n\t\tHashMap<String,Integer> oldTerms=newTerms; // record the terms to analyze modified queries\n\t\tnewTerms=new HashMap<String,Integer>();\n\t\t\t\t\n\t\tString terms[]=query.split(\"\\\\s\");\t\t\t\t\n\t\tint matchingTerms=0;\n\t\tint matchingTermsStopwords=0;\n\t\tint matchingTermsOrder=0;\n\t\tfor (int j=0;j<terms.length;j++) {\n\t\t\tif (!terms[j].equals(\"\")) {\n\t\t\t \tif (oldTerms.containsKey(terms[j])) {\n\t\t\t \t\tmatchingTerms++;\t\t\t\t\t \n\t\t\t \t\tif (stopwordsMap.containsKey(terms[j])) { // match if it is stopword\n\t\t\t \t\t\tmatchingTermsStopwords++;\n\t\t\t \t\t}\n\t\t\t \t\tif (oldTerms.get(terms[j])==j) { // match if it has the same order\n\t\t\t \t\t\tmatchingTermsOrder++;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tnewTerms.put(terms[j],j);\n\t\t\t}\n\t\t}\t\n\n\t\tif (newTerms.size()==oldTerms.size() && matchingTerms==oldTerms.size() && matchingTerms>0) { // the queries have the same terms\n\t\t totalEqualTermsQueries++;\n\t\t\t\t \t\t\t\t \t\t\t\t\t\t \t\t\t\t \t\t\t\t \n\t\t if (matchingTermsStopwords==oldTerms.size()) {\n\t\t \ttotalEqualTermsStopwordsQueries++;\n\t\t }\n\t\t if (matchingTermsOrder==oldTerms.size()) {\n\t\t \ttotalEqualTermsOrderQueries++;\n\t\t }\n\t\t if (query.equals(oldQuery)) {\n\t\t \ttotalIdenticalQueries++;\n\t\t }\n\t\t if (sessionQueries.contains(query)) {\n\t\t \ttotalIdenticalSessionQueries++;\n\t\t }\n\t\t}\n\t\telse if (matchingTerms-matchingTermsStopwords>0) { // the queries have at least one term equal and diferent from a stopword\n\t\t totalModifiedQueries++;\n\t\t int index=newTerms.size()-oldTerms.size()+N_MODIFIED_TERMS_RANGE/2;\n\t\t if (index<0) {\n\t\t \tindex=0;\n\t\t }\n\t\t else if (index>N_MODIFIED_TERMS_RANGE-1) {\n\t\t \tindex=N_MODIFIED_TERMS_RANGE-1;\n\t\t }\n\t\t nModifiedTerms[index]++;\n\t\t}\n\t\toldQuery=query; \n\t\t\t\t\t\t\n\t\t// store session query\n\t\tsessionQueries.add(query);\n\t}", "public void update_query(TwitterParser tweet)\r\n\t{\r\n\t\tfor(String s : tweet.get_words())\r\n\t\t\tupdate_query(s, tweet.get_date());\r\n\t}", "public void countWord() {\n\t\tiniStorage();\n\t\tWordTokenizer token = new WordTokenizer(\"models/jvnsensegmenter\",\n\t\t\t\t\"data\", true);\n\t\t// String example =\n\t\t// \"Nếu bạn đang tìm kiếm một chiếc điện thoại Android? Đây là, những smartphone đáng để bạn cân nhắc nhất. Thử linh tinh!\";\n\t\t// token.setString(example);\n\t\t// System.out.println(token.getString());\n\n\t\tSet<Map.Entry<String, String>> crawlData = getCrawlData().entrySet();\n\t\tIterator<Map.Entry<String, String>> i = crawlData.iterator();\n\t\twhile (i.hasNext()) {\n\t\t\tMap.Entry<String, String> pageContent = i.next();\n\t\t\tSystem.out.println(pageContent.getKey());\n\t\t\tPageData pageData = gson.fromJson(pageContent.getValue(),\n\t\t\t\t\tPageData.class);\n\t\t\ttoken.setString(pageData.getContent().toUpperCase());\n\t\t\tString wordSegment = token.getString();\n\t\t\tString[] listWord = wordSegment.split(\" \");\n\t\t\tfor (String word : listWord) {\n\t\t\t\taddToDictionary(word, 1);\n\t\t\t\tDate date;\n\t\t\t\ttry {\n\t\t\t\t\tdate = simpleDateFormat.parse(pageData.getTime().substring(\n\t\t\t\t\t\t\t0, 10));\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\taddToStatByDay(date, word, 1);\n\t\t\t}\n\t\t}\n\t}", "public void updateCounts(WordCounter wordCounter) {\n wordCounter.wordMap.forEach((w, c) -> {\n wordMap.merge(w, c, Double::sum);\n });\n numDocs++;\n }", "public void increment(){\n\t\twordCount += 1;\n\t}", "public void count(String word) {\n if(word.equals(\"\")){\n return;\n }\n\n for (int i=0; i < counters.length; i++) {\n //TODO: If you find the word increment the count and return\n if (counters[i] != null){\n if (counters[i].wordMatches(word)){\n counters[i].incrementCount();\n break;\n }\n } else {\n counters[i] = new SingleWordCounter(word);\n counters[i].incrementCount();\n break;\n }\n }\n\n //TODO: You didn't find the word. Add a new word counter to the array.\n // Don't forget to increment the word's count to get it to 1!\n\n\t}", "private void update(String word, int lineNumber)\n {\n //checks to see if its the first word of concordance or not\n if(this.concordance.size()>0)\n {\n //if it is not the first word it loops through the concordance\n for(int i = 0; i < this.concordance.size();i++)\n {\n int check = 0;\n //if word is in concordance it updates the WordRecord for that word\n if(word.equalsIgnoreCase(concordance.get(i).getWord()))\n {\n concordance.get(i).update(lineNumber);\n check++;\n }\n \n //if the word is not found it adds it to the concordance and breaks out of the loop\n if(check == 0 && i == concordance.size() - 1)\n {\n WordRecord temp = new WordRecord(word,lineNumber);\n this.concordance.add(temp);\n break;\n }\n \n }\n }\n \n else\n //if it is the first word of the concordance it adds it to the concordance\n {\n WordRecord temp = new WordRecord(word,lineNumber);\n this.concordance.add(temp);\n }\n }", "public int updateWordDetails(BaseWord word)\n\t{\n\t\tContentValues values = new ContentValues();\n\t\tvalues.put(DBConstants.WordTable.DAILYGOALCOUNT_KEY, word._dailyGoal);\n\t\tvalues.put(DBConstants.WordTable.DEFINITION_KEY, word.get_definition());\n\t\t\n\t\t//update word data\n\t\treturn _db.update(DBConstants.WordTable.TABLENAME, values, DBConstants.WordTable.WORDID_KEY + \" = \" + word.get_id(), null);\t\t\n\t}", "public int resetAllWords()\n\t{\n\t\t_db.delete(DBConstants.StatsTable.TABLENAME, null, null);\n\n\t\tContentValues values = new ContentValues();\n\t\tvalues.put(DBConstants.WordTable.DAILYGOALCOUNT_KEY, 0);\n\t\n\t\t//reset word data //commented out to set the daily goal back to 0 below...\n\t\treturn 0;//_db.update(DBConstants.WordTable.TABLENAME, values, null, null);\t\t\n\t}", "public void addWordCount(){\r\n\t\twordCount = wordCount + 1;\r\n\t}", "public boolean addDatabase(String datePerNew,String word,int frequency){\n\t\tboolean flagSuccessful;\n\t\tif(!newsCheckerTest.canConvert(datePerNew)) return false;\n\t\tboolean alreadyInsertedToDatabase=mongoDbHelper.contain(datePerNew, word) >= 1;\n\t\tif(alreadyInsertedToDatabase){ \n\t\t\tflagSuccessful=mongoDbHelper.update(datePerNew, word, frequency);\n\t\t}\n\t\telse {\n\t\t\tflagSuccessful=mongoDbHelper.save(datePerNew, word, frequency);\n\t\t}\n\t\treturn flagSuccessful;\n\t}", "private double countWordFrequencyScore(Page page, String[] queryWords) {\n double score = 0;\n for (String word : queryWords) {\n int wordId = this.pb.getIdForWord(word);\n for (double pageWordId : page.getWords()) {\n if (wordId == pageWordId) score++;\n }\n }\n\n return score;\n }", "private void searchHelper(ArrayList<SearchResult> results, String word, Map<String, SearchResult> track) {\n\t\tfor (String location : this.invertedIndex.get(word).keySet()) {\n\t\t\tif (track.containsKey(location)) {\n\t\t\t\ttrack.get(location).updateCount(word);\n\t\t\t} else {\n\t\t\t\tSearchResult result = new SearchResult(location);\n\t\t\t\tresult.updateCount(word);\n\t\t\t\ttrack.put(location, result);\n\t\t\t\tresults.add(result);\n\t\t\t}\n\t\t}\n\t}", "static void ReadQuery(String input) throws FileNotFoundException {\n input = input.replaceAll(\"[^A-Za-z]\",\" \");\n String[] arr = input.split(\" \"); // splitting the whole string into words by split on the basis of white spaces\n\n\n for(int i=0; i<arr.length; i++) {\n String termWord = arr[i].toLowerCase();\t//same pre-processing is applied to all the query word\n //termWord = RemoveSpecialCharacter(termWord);\n termWord = removeStopWords(termWord);\n\n if(!termWord.equalsIgnoreCase(\"\")) { // all the white spaces are removed as if not removed then lemmatization wont be successfully done\n\n termWord = Lemmatize(termWord);\n System.out.println(termWord);\n if(dictionary.containsKey(termWord)) {\n List<Integer> wordList = new ArrayList<>();\n wordList = dictionary.get(termWord);\n int queryWordFrequency = wordList.get(totaldocument);\n queryWordFrequency++;\n wordList.set(totaldocument, queryWordFrequency); // all the frequencies of the query words are stored at the 56th index of the List stored in the\n //hashmap associated with its word-terms\n dictionary.put(termWord, wordList);\n }\n else {\n //if any of the enterd query word not present in all the docs so list will have 0.0 value from 0th index to 55th and 56th index is reserver\n // for query word frequency\n List<Integer> wordList = new ArrayList<>();\n for(int j=0; j<totaldocument+1; j++) {\n wordList.add(0);\n }\n wordList.add(1);\n dictionary.put(termWord, wordList); //updating the dictionary hashmap now containing all the query words frequencies\n }\n }\n }\n save();\n }", "public void indexDocument(String documentName, ArrayList<String> documentTokens) {\n for (String token : documentTokens) {\n if (!this.index.containsKey(token)) {\n // Create a key with that token\n this.index.put(token, new HashMap<>());\n }\n\n // Get the HashMap associated with that term\n HashMap<String, Integer> term = this.index.get(token);\n\n // Check if term has a posting for the document\n if (term.containsKey(documentName)) {\n // Increase its occurrence by 1\n int occurrences = term.get(documentName);\n term.put(documentName, ++occurrences);\n } else {\n // Create a new posting for the term\n term.put(documentName, 1);\n }\n }\n }", "@Override\r\n\tpublic int queryAllCount(String keyWord) {\n\t\treturn mapper.queryAllCount(keyWord);\r\n\t}", "private double countWordLocationScore(Page page, String[] queryWords) {\n double score = 0;\n boolean wasFound = false;\n\n for (String word : queryWords) {\n int queryWordId = this.pb.getIdForWord(word);\n for (int i = 0; i < page.getWords().size(); i++) {\n if (page.getWords().get(i) == queryWordId) {\n score += i;\n wasFound = true;\n break;\n }\n }\n\n if (!wasFound) {\n score += 100000;\n } else {\n wasFound = false;\n }\n }\n return score;\n }", "public void addToDictionary(String word, int n) {\n\t\tConcurrentNavigableMap<String, String> listVocabulary = dbStats\n\t\t\t\t.getTreeMap(\"voca\");\n\t\tString strTimes = listVocabulary.get(word);\n\t\tint times = 0;\n\t\tif (strTimes != null) {\n\t\t\ttimes = Integer.parseInt(strTimes);\n\t\t\ttimes = times + n;\n\t\t} else {\n\t\t\ttimes = n;\n\t\t}\n\t\tlistVocabulary.put(word, Integer.toString(times));\n\t}", "public void addWordCount(int increment){\r\n\t\twordCount = wordCount + increment;\r\n\t}", "private void updateEventAtCount(String postid,int newAttend){\n final String DB_NAME = \"testDB\";\n final String TABLE_NAME = \"EVENT\";\n try (Connection con = ConnectionTest.getConnection(DB_NAME);\n Statement stmt = con.createStatement();\n ) {\n String query = \"UPDATE \" + TABLE_NAME + \" SET eventAttendCount = \" +newAttend+ \" WHERE postID LIKE '\"+postid+\"'\";\n int r = stmt.executeUpdate(query);\n System.out.println(\"Update table \" + TABLE_NAME + \" executed successfully\");\n System.out.println(r + \" row(s) affected\");\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }", "public void addToMap(){\n\t\tInteger hc = currentQuery.hashCode();\n\t\tif (!hmcache.containsKey(hc)) {\n\t\t\thmcache.put(hc, 0);\n\t\t}else{\n\t\t\tInteger val = hmcache.get(hc) + (currentQuery.getWords().size());\n\t\t\thmcache.put(hc, val);\n\t\t}\n\t}", "@Override\n public void processNextSentence(Sentence target) {\n String[] tokens = target.getTokens();\n\n //Create hash of alignments word->frequency:\n HashMap<String, Integer> counts = new HashMap<>();\n\n //Get word counts:\n for (String token : tokens) {\n if (counts.get(token) == null) {\n counts.put(token, 1);\n } else {\n counts.put(token, counts.get(token) + 1);\n }\n }\n\n //Add resource to sentence:\n target.setValue(\"wordcounts\", counts);\n }", "private void wordAdd(String word){\n if (!fileWords.containsKey(word)){\n fileWords.put(word,1);\n if (probabilities.containsKey(word)) {\n double oldCount = probabilities.get(word);\n probabilities.put(word, oldCount+1);\n } else {\n probabilities.put(word, 1.0);\n }\n }\n }", "@Override\n public void incrementDailyCount(int env, int day, int field, int by) {\n if (env == -1) {\n Logger.warn(LOG_TAG, \"Refusing to record with environment = -1.\");\n return;\n }\n \n final SQLiteDatabase db = this.helper.getWritableDatabase();\n final String envString = Integer.toString(env);\n final String fieldIDString = Integer.toString(field, 10);\n final String dayString = Integer.toString(day, 10);\n \n // Can't run a complex UPDATE and get the number of changed rows, so we'll\n // do this the hard way.\n // This relies on being called within a transaction.\n final String[] args = new String[] {dayString, envString, fieldIDString};\n final Cursor c = db.query(EVENTS_INTEGER,\n COLUMNS_VALUE,\n WHERE_DATE_AND_ENV_AND_FIELD,\n args, null, null, null, \"1\");\n \n boolean present = false;\n try {\n present = c.moveToFirst();\n } finally {\n c.close();\n }\n \n if (present) {\n // It's an int, so safe to concatenate. Avoids us having to mess with args.\n db.execSQL(\"UPDATE \" + EVENTS_INTEGER + \" SET value = value + \" + by + \" WHERE \" +\n WHERE_DATE_AND_ENV_AND_FIELD,\n args);\n } else {\n final ContentValues v = new ContentValues();\n v.put(\"env\", env);\n v.put(\"value\", by);\n v.put(\"field\", field);\n v.put(\"date\", day);\n try {\n db.insertOrThrow(EVENTS_INTEGER, null, v);\n } catch (SQLiteConstraintException e) {\n throw new IllegalStateException(\"Event did not reference existing an environment or field.\", e);\n }\n }\n }", "public WordOccurence(final int time) {\n\t\t\toccurences = new ArrayList<Integer>();\n\t\t\toccurences.add(time);\n\t\t\tvDitected = new ArrayList<Integer>();\n\t\t\tvaluesSet = false;\n\t\t}", "public void analyzeDocument(String text) {\n\t\tString[] tokens = m_tokenizer.tokenize(text.toLowerCase());\n\t\tfor (int j = 0; j < tokens.length; j++)\n\t\t\ttokens[j] = SnowballStemmingDemo(NormalizationDemo(tokens[j]));\n\t\tHashMap<String, Integer> document_tf = new HashMap<String, Integer>();\n\t\tfor (String token : tokens) {\n\t\t\tif (!document_tf.containsKey(token))\n\t\t\t\tdocument_tf.put(token, 1);\n\t\t\telse\n\t\t\t\tdocument_tf.put(token, document_tf.get(token) + 1);\n\t\t\tif (!df.containsKey(token))\n\t\t\t\tdf.put(token, 1);\n\t\t\telse\n\t\t\t\tdf.put(token, df.get(token) + 1);\n\t\t}\n\t\ttf.add(document_tf);\n\t\t/*\n\t\t * for(String token : document_tf.keySet()) { if(!df.containsKey(token))\n\t\t * df.put(token, 1); else df.put(token, df.get(token) + 1); if(!) }\n\t\t */\n\t\tm_reviews.add(text);\n\t}", "private void countWords(String text, String ws) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(text.getBytes(StandardCharsets.UTF_8))));\n String line;\n\n // Get words and respective count\n while (true) {\n try {\n if ((line = reader.readLine()) == null)\n break;\n String[] words = line.split(\"[ ,;:.?!“”(){}\\\\[\\\\]<>']+\");\n for (String word : words) {\n word = word.toLowerCase();\n if (\"\".equals(word)) {\n continue;\n }\n if (lista.containsKey(word)){\n lista.get(word).add(ws);\n }else{\n HashSet<String> temp = new HashSet<>();\n temp.add(ws);\n lista.put(word, temp);\n }\n\n /*if (!countMap.containsKey(word)) {\n countMap.put(word, 1);\n }\n else {\n countMap.put(word, countMap.get(word) + 1);\n }*/\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n // Close reader\n try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n // Display words and counts\n /*for (String word : countMap.keySet()) {\n if (word.length() >= 3) { // Shall we ignore small words?\n //System.out.println(word + \"\\t\" + countMap.get(word));\n }\n }*/\n }", "private void updateCommon(List<Status> tweetsList) {\r\n numberOfTweets += tweetsList.size();\r\n \r\n tweetsList.stream().forEach(tweet -> {\r\n final HashtagEntity[] hashtags = tweet.getHashtagEntities();\r\n for (HashtagEntity hashtag : hashtags) {\r\n final String text = hashtag.getText().toLowerCase();\r\n if (!countHashtags.containsKey(text)) {\r\n countHashtags.put(text, 0);\r\n }\r\n countHashtags.put(text, countHashtags.get(text) + 1);\r\n }\r\n \r\n final String[] words = tweet.getText().split(\" \");\r\n for (String word : words) {\r\n word = word.toLowerCase();\r\n if (!wordsFilter.contains(word)) {\r\n if (!countWords.containsKey(word)) {\r\n countWords.put(word, 0);\r\n }\r\n countWords.put(word, countWords.get(word) + 1);\r\n }\r\n }\r\n \r\n final String location = tweet.getUser().getLocation();\r\n if (!countLocation.containsKey(location)) {\r\n countLocation.put(location, 0);\r\n }\r\n countLocation.put(location, countLocation.get(location) + 1);\r\n });\r\n }", "public void updateCounts() {\n\n Map<Feel, Integer> counts_of = new HashMap<>();\n\n for (Feel feeling : Feel.values()) {\n counts_of.put(feeling, 0);\n }\n\n for (FeelingRecord record : this.records) {\n counts_of.put(record.getFeeling(), counts_of.get(record.getFeeling()) + 1);\n }\n\n this.angry_count.setText(\"Anger: \" + counts_of.get(Feel.ANGER).toString());\n this.fear_count.setText(\"Fear: \" + counts_of.get(Feel.FEAR).toString());\n this.joyful_count.setText(\"Joy: \" + counts_of.get(Feel.JOY).toString());\n this.love_count.setText(\"Love: \" + counts_of.get(Feel.LOVE).toString());\n this.sad_count.setText(\"Sad:\" + counts_of.get(Feel.SADNESS).toString());\n this.suprise_count.setText(\"Suprise: \" + counts_of.get(Feel.SURPRISE).toString());\n }", "public static void addKeywordCount(int count)\r\n\t{\t\r\n\t\tsynchronized(keywords)\r\n\t\t{\r\n\t\t\tkeywordCount += count;\r\n\t\t}//sync\r\n\t}", "public void narrowAllSentencesByLastOccurrenceAndUpdate() {\n try {\n List<String> properties = PropertyUtils.getAllProperties();\n for (String property : properties) {\n HashMap<Integer, HashMap<String, String>> sentenceTripleDataMap = PropertyUtils.getSentencesForProperty(property);\n for (Integer sentenceId : sentenceTripleDataMap.keySet()) {\n String subLabel = sentenceTripleDataMap.get(sentenceId).get(\"subLabel\");\n String objLabel = sentenceTripleDataMap.get(sentenceId).get(\"objLabel\");\n String sentence = sentenceTripleDataMap.get(sentenceId).get(\"sentence\");\n\n String newSentence = narrowSentencesByLastOccurrence(sentence, subLabel, objLabel);\n if (!newSentence.equals(sentence)) {\n // replace sentence in DB\n System.out.println(sentenceId);\n updateTripleSentence(sentenceId, newSentence);\n }\n }\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public void updateTermInThisQuery(int relevanceFeedbackMethod) {\n query thisQuery = listDocumentRetrievedForThisQuery.getQuery();\n StringTokenizer token = new StringTokenizer(thisQuery.getQueryContent(), \" %&\\\"*#@$^_<>|`+=-1234567890'(){}[]/.:;?!,\\n\");\n while (token.hasMoreTokens()) {\n String keyTerm = token.nextToken();\n String filteredWord;\n if (invertedFileQuery.isStemmingApplied()) {\n filteredWord = StemmingPorter.stripAffixes(keyTerm);\n } else {\n filteredWord = keyTerm;\n }\n try {\n termWeightingDocument relation = invertedFileQuery.getListTermWeights().get(filteredWord);\n if (relation.getDocumentWeightCounterInOneTerm().get(thisQuery.getIndex()) != null) {\n double oldWeight = relation.getDocumentWeightCounterInOneTerm().get(thisQuery.getIndex()).getWeight();\n double newWeight = computeNewWeightTerm(relevanceFeedbackMethod,filteredWord,oldWeight);\n if (newWeight > 0) {\n newQueryComposition.put(keyTerm, newWeight);\n relation.getDocumentWeightCounterInOneTerm().get(thisQuery.getIndex()).setWeight(newWeight);\n } else {\n relation.getDocumentWeightCounterInOneTerm().get(thisQuery.getIndex()).setWeight(0.0);\n }\n }\n } catch (Exception e) {\n\n }\n }\n }", "@Transactional\n\t@Override\n\tpublic void addDocCommentCount(String dockey) {\n\t\tdocumentsDao.addDocCommentCount(dockey);\n\t}", "public void add(String word) {\n if (hashTable.contains(word)) {\n hashTable.put(word, hashTable.get(word) + 1);\n }\n else {\n hashTable.put(word,1);\n }\n }", "public void put(String word, int count) {\n if (wordToCount.values() != null && wordToCount.values().contains(count)) {\n this.countToWord.get(count).add(word);\n } else {\n Set<String> wordset = new HashSet<String>();\n wordset.add(word);\n this.countToWord.put(count, wordset);\n }\n this.wordToCount.put(word, count);\n this.wordNumber += 1;\n this.cached = false;\n }", "private static void wordCountWithMap() throws FileNotFoundException {\n Map<String, Integer> wordCounts = new HashMap<String, Integer>();\n\n Scanner input = new Scanner(new File(fileLocation));\n while (input.hasNext()) {\n String word = input.next();\n if (!wordCounts.containsKey(word)) {\n wordCounts.put(word, 1);\n } else {\n int oldValue = wordCounts.get(word);\n wordCounts.put(word, oldValue + 1);\n }\n }\n\n String term = \"test\";\n System.out.println(term + \" occurs \" + wordCounts.get(term));\n\n // loop over the map\n for (String word : wordCounts.keySet()) {\n int count = wordCounts.get(word);\n if (count >= 500) {\n System.out.println(word + \", \" + count + \" times\");\n }\n }\n\n }", "public void updateWordPoints() {\n for (String word: myList.keySet()) {\n int wordValue = 0;\n for (int i = 0; i < word.length(); i++) {\n // gets individual characters from word and\n // from that individual character get the value from scrabble list\n int charValue = scrabbleList.get(word.toUpperCase().charAt(i));\n // add character value gotten from character key from scrabble map to word value\n wordValue = wordValue + charValue;\n }\n\n // update the value of the word in myList map\n myList.put(word, wordValue);\n }\n }", "private static void feedMapWithWordList(List<String> wordList, HashMap<String, Long> dataMap) {\n\n\t\tfor(int i = 0, size = wordList.size(); i < size; i++) { // Go through the list of words being fed - if a word already exists, add 1 to its frequency; otherwise, create a new key and give it a value of 1\n\n\t\t\tfinal String word = wordList.get(i);\n\n\t\t\tif(dataMap.containsKey(word))\n\n\t\t\t\tdataMap.replace(word, dataMap.get(word) + 1);\n\n\t\t\telse\n\n\t\t\t\tdataMap.put(word, 1L);\n\t\t}\n\t}", "public static void main (String [] args) {\n WordCount wordCount2 = new WordCount();\r\n \r\n int count = 0;\r\n //creates an new scanner\r\n Scanner input = new Scanner(System.in);\r\n //gets the sentence and splits it at the spaces into an array\r\n String sentence = getSentence (input);\r\n String [] words = sentence.split(\" \");\r\n //parsing through the array and changes the counter\r\n for (int i = 0; i < words.length; i++){\r\n if (words[i].charAt(0) == 'a' || words[i].charAt(0) == 'A') {\r\n count = wordCount2.decrementCounter(count);\r\n } else {\r\n count = wordCount2.incrementCounter(count);\r\n }\r\n \r\n \r\n }\r\n //outputs the results \r\n System.out.println (\"There are \" + count + \" words in this sentence.\"); \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }", "public Exact_Period_Count create_query(String word, Date min, Date max)\r\n\t{\r\n\t\tExact_Period_Count query = new Exact_Period_Count(word, min, max);\r\n\t\tif(!m_table.containsKey(word))\r\n\t\t\tm_table.put(word, new LinkedList<Exact_Period_Count>());\r\n\t\t\r\n\t\tm_table.get(word).add(query);\r\n\t\tm_queryList.add(query);\r\n\t\treturn query;\r\n\t}", "public void count(String dataFile) {\n\t\tScanner fileReader;\n\t\ttry {\n\t\t\tfileReader= new Scanner(new File(dataFile));\n\t\t\twhile(fileReader.hasNextLine()) {\n\t\t\t\tString line= fileReader.nextLine().trim(); \n\t\t\t\tString[] data= line.split(\"[\\\\W]+\");\n\t\t\t\tfor(String word: data) {\n\t\t\t\t\tthis.wordCounter= map.get(word);\n\t\t\t\t\tthis.wordCounter= (this.wordCounter==null)?1: ++this.wordCounter;\n\t\t\t\t\tmap.put(word, this.wordCounter);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfileReader.close();\n\t\t}\n\t\tcatch(FileNotFoundException fnfe) {\n\t\t\tSystem.out.println(\"File\" +dataFile+ \"can not be found.\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "private void update() {\n\t\twhile(words.size()<length) {\n\t\t\twords.add(new Word());\n\t\t}\n\t}", "void updateAllFilteredLists(Set<String> keywords, Calendar startDate, Calendar endDate,\n Entry.State state, Entry.State state2, Search... searches);", "public void updateUnseenTermInThisQuery(int relevanceFeedbackMethod) {\n System.out.println(\"Nomor Query Lama : \" + listDocumentRetrievedForThisQuery.getQuery().getIndex());\n System.out.println(\"Isi Query Lama : \" + listDocumentRetrievedForThisQuery.getQuery().getQueryContent());\n int thisQueryIndex = listDocumentRetrievedForThisQuery.getQuery().getIndex();\n for (Map.Entry m : invertedFile.getListTermWeights().entrySet()) {\n String keyTerm = (String) m.getKey();\n if (!isTermAppearInQuery(keyTerm)) {\n double newWeight = computeNewWeightTerm(relevanceFeedbackMethod,keyTerm,0.0);\n if (newWeight > 0) {\n String filteredWord = \"\";\n if (invertedFile.isStemmingApplied()) {\n filteredWord = invertedFile.getMappingStemmedTermToNormalTerm().get(keyTerm);\n } else {\n filteredWord = keyTerm;\n }\n newQueryComposition.put(filteredWord,newWeight);\n invertedFileQuery.insertRowTable(keyTerm,thisQueryIndex,newWeight);\n normalFileQuery.insertElement(thisQueryIndex,keyTerm);\n }\n }\n }\n System.out.println(\"Nomor Query Baru : \" + convertNewQueryComposition().getIndex());\n System.out.println(\"Isi Query Baru : \" + convertNewQueryComposition().getQueryContent());\n }", "public void updateDocument(Document arg0) throws ContestManagementException {\r\n }", "@Override\n public synchronized Long count(String query) {\n long count = 0L;\n String nQuery = normalizeQuery(query);\n Set<String> keys = suggestIndex.getKeys();\n Map index = suggestIndex.getIndex();\n LinkedHashSet<Long> result = new LinkedHashSet<Long>();\n\n logger.debug(\"IN SEARCH: query={}, keys={}\", query, keys);\n\n StringBuilder patternBuilder;\n List<Pattern> patterns = new ArrayList<Pattern>();\n for (String keyPart : nQuery.split(\" \")) {\n patternBuilder = new StringBuilder(\"^(?iu)\");\n patternBuilder.append(ALLOWED_CHARS_REGEXP);\n keyPart = Normalizer.normalize(keyPart, Normalizer.Form.NFD);\n patternBuilder.append(keyPart)\n .append(ALLOWED_CHARS_REGEXP)\n .append('$');\n patterns.add(Pattern.compile(patternBuilder.toString()));\n }\n\n for (String key : keys) {\n for (Pattern pattern : patterns) {\n\n if (pattern.matcher(key).matches()) {\n result.addAll((LinkedHashSet<Long>) index.get(key));\n count += ((LinkedHashSet<Long>) index.get(key)).size();\n }\n }\n }\n return Long.valueOf(result.size());\n }", "public void IndexADocument(String docno, String content) throws IOException {\n\t\tthis.idWriter.write(docID+\":\"+docno);\n\t\tthis.idWriter.newLine();\n\t\tthis.idWriter.flush();\n\t\tString[] words = content.split(\" \");\n\t\tHashMap<String,Integer> count = new HashMap<>();\n\t\tfor(String s:words){\n\t\t\tcount.put(s,count.getOrDefault(s,0)+1);\n\t\t}\n\t\tfor(String key: count.keySet()){\n\t\t\tif(this.map.containsKey(key)){\n\t\t\t\tthis.map.get(key).append(docID).append(\":\").append(count.get(key)).append(\",\");\n\t\t\t}else {\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\tthis.map.put(key, sb.append(docID).append(\":\").append(count.get(key)).append(\",\"));\n\t\t\t}\n\t\t}\n\t\tdocID++;\n\t}", "public WordCount(String word, int count){\n this.word = word;\n this.count = count;\n }", "private String setDateWordUsed(String source, List<DateGroup> dateGroups) {\n String dateWordUsed = getDateWordUsed(source, dateGroups);\n dateWordUsed = DateStringMassager.removeWordDelimiter(dateWordUsed);\n dateWordUsed = DateStringMassager.removeDigitDelimiters(dateWordUsed);\n\n source = DateStringMassager.removeDigitDelimiters(source);\n source = DateStringMassager.removeWordDelimiter(source);\n\n String dateConnector = DateStringMassager.getFrontDateConnector(source,\n dateWordUsed);\n wordUsed = dateConnector + dateWordUsed;\n\n separatedWordRemainings = StringHandler.getSeparatedWord(source,\n wordUsed);\n wordRemaining = StringHandler.removeFirstMatched(source, wordUsed);\n return dateWordUsed;\n }", "void updateAllFilteredLists(Set<String> keywords, Calendar startDate, Calendar endDate,\n Entry.State state, Search... searches);", "private void getWordCounts() {\n Map<String, List<String>> uniqueWordsInClass = new HashMap<>();\n List<String> uniqueWords = new ArrayList<>();\n\n for (ClassificationClass classificationClass : classificationClasses) {\n uniqueWordsInClass.put(classificationClass.getName(), new ArrayList<>());\n }\n\n for (Document document : documents) {\n String[] terms = document.getContent().split(\" \");\n\n for (String term : terms) {\n if (term.isEmpty()) {\n continue;\n }\n if (!uniqueWords.contains(term)) {\n uniqueWords.add(term);\n }\n\n for (ClassificationClass docClass : document.getClassificationClasses()) {\n if (!uniqueWordsInClass.get(docClass.getName()).contains(term)) {\n uniqueWordsInClass.get(docClass.getName()).add(term);\n }\n if (totalWordsInClass.containsKey(docClass.getName())) {\n this.totalWordsInClass.put(docClass.getName(), this.totalWordsInClass.get(docClass.getName()) + document.getFeatures().get(term));\n } else {\n this.totalWordsInClass.put(docClass.getName(), document.getFeatures().get(term));\n }\n }\n }\n }\n\n this.totalUniqueWords = uniqueWords.size();\n }", "public void setDiarySearchContent(int index, Date newDate, String content)\n\t\t\tthrows SQLIntegrityConstraintViolationException {\n\t\tLong songid = searchDiarylv.get(index).songid;\n\t\tDate originalDate = searchDiarylv.get(index).date;\n\t\tString sqlQuery = \"update diary set content = ?, date = ? where song_id = ? and date= ?;\";\n\n\t\ttry {\n\t\t\tPreparedStatement preparedStmt = connection.prepareStatement(sqlQuery);\n\t\t\tpreparedStmt.setString(1, content);\n\t\t\tpreparedStmt.setDate(2, newDate);\n\t\t\tpreparedStmt.setLong(3, songid);\n\t\t\tpreparedStmt.setDate(4, originalDate);\n\n\t\t\t// execute the java preparedstatement\n\t\t\tpreparedStmt.executeUpdate();\n\n\t\t} catch (SQLIntegrityConstraintViolationException e1) {\n\t\t\tthrow e1;\n\t\t} catch (SQLException e2) {\n\t\t\te2.printStackTrace();\n\t\t}\n\t\t// then: update new recentDiaryvl\n\t}", "public void IncCount(String s) \n\t{\n if(numEntries+1 >= tableSize)\n rehashTable();\n \n HashEntry entry = contains(s);\n \n if(entry == null)\n {\n insert(s);\n numEntries++;\n }\n else\n entry.value++;\n\t}", "public void updateFrequency(String lineWord, String lineType) {\r\n\t\tString oldWordType = \"start\";\r\n\t\tif (lineType != null && lineWord != null) {\r\n\t\t\tString[] wordTypes = lineType.split(\" \");\r\n\t\t\tString[] words = lineWord.split(\" \");\r\n\t\t\tint i = 0;\r\n\t\t\tfor (String currentWordType: wordTypes) {\r\n\r\n\t\t\t\t//if not at first word of sentence\r\n\t\t\t\tif (oldWordType.equals(\"start\")) {\r\n\t\t\t\t\tupdateProbabilities(transMapTemp, oldWordType, currentWordType);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tString word = words[i-1].toLowerCase();\t//\r\n\t\t\t\t\tupdateProbabilities(emissionMapTemp, oldWordType, word);\r\n\t\t\t\t\tupdateProbabilities(transMapTemp, oldWordType, currentWordType);\r\n\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\r\n\t\t\t\toldWordType = currentWordType;\r\n\t\t\t}\r\n\t\t\tupdateProbabilities(emissionMapTemp, oldWordType, words[i-1]);\r\n\t\t\toldWordType = \"\";\t\t//signifies we are now at a new sentence/line\r\n\r\n\t\t}\r\n\t}", "public synchronized void process() \n\t{\n\t\t// for each word in a line, tally-up its frequency.\n\t\t// do sentence-segmentation first.\n\t\tCopyOnWriteArrayList<String> result = textProcessor.sentenceSegmementation(content.get());\n\t\t\n\t\t// then do tokenize each word and count the terms.\n\t\ttextProcessor.tokenizeAndCount(result);\n\t}", "public void countWords(String source) {\n Scanner wordScanner = new Scanner(source);\n// wordScanner.useDelimiter(\"[^A-Za-z]+\");\n wordScanner.useDelimiter(\"(?!')[^A-Za-z]+\");\n addWordToMap(wordScanner);\n }", "public void UpdateCount(String containerName, String filterName, int count) {\n\t\tFilterContainer container = this.GetContainerByName(containerName);\n\t\tif (container == null)\n\t\t\treturn;\n\t\tFilter filter = this.GetFilterByName(container, filterName);\n\t\tif (filter == null)\n\t\t\treturn;\n\t\tif (!(filter instanceof ICountable))\n\t\t\treturn;\n\t\t((ICountable)filter).SetCount(count);\n\t\tfilter.TriggerStateChanged(); // TODO execute with flag? not always..\n\t}", "private String getWordStatsFromList(List<String> wordList) {\n\t\tif (wordList != null && !wordList.isEmpty()) {\n\t\t\tList<String> wordsUsedCaps = new ArrayList<>(); \n\t\t\tList<String> wordsExcludedCaps = new ArrayList<>(); \n\t\t\tListIterator<String> iterator = wordList.listIterator();\n\t\t\tMap<String, Integer> wordToFreqMap = new HashMap<>();\n\t\t\t// iterate on word List using listIterator to enable edits and removals\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tString origWord = iterator.next();\n\t\t\t\t// remove quotes from word e.g. change parents' to parents; \n\t\t\t\t// change children's to children; change mark'd to mark\n\t\t\t\tString curWord = stripQuotes(origWord);\n\t\t\t\tif (!curWord.equals(origWord)) {\n\t\t\t\t\titerator.set(curWord);\n\t\t\t\t}\n\t\t\t\tString curWordCaps = curWord.toUpperCase();\n\t\t\t\t// remove words previously used (to prevent duplicates) or previously\n\t\t\t\t// excluded (compare capitalized version)\n\t\t\t\tif (wordsExcludedCaps.contains(curWordCaps)) {\n\t\t\t\t\titerator.remove();\n\t\t\t\t}\n\t\t\t\telse if (wordsUsedCaps.contains(curWordCaps)) {\n\t\t\t\t\t// if word was previously used then update wordToFreqMap to increment\n\t\t\t\t\t// its usage frequency\n\t\t\t\t\tSet<String> wordKeys = wordToFreqMap.keySet();\n\t\t\t\t\tfor (String word : wordKeys) {\n\t\t\t\t\t\tif (curWord.equalsIgnoreCase(word)) {\n\t\t\t\t\t\t\twordToFreqMap.put(word, wordToFreqMap.get(word).intValue() + 1);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\titerator.remove();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// invoke checkIfEligible() with algorithm described in Challenge 2 to see if word not\n\t\t\t\t\t// previously used/excluded should be kept. If kept in list \n\t\t\t\t\t// then add to wordsUsedCaps list; if not qualified then add to\n\t\t\t\t\t// wordsExcludedCaps list to prevent checkIfEligible() having to be \n\t\t\t\t\t// called again\n\t\t\t\t\tif (checkIfEligible(curWordCaps)) {\n\t\t\t\t\t\twordsUsedCaps.add(curWordCaps);\n\t\t\t\t\t\twordToFreqMap.put(curWord, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\twordsExcludedCaps.add(curWordCaps);\n\t\t\t\t\t\titerator.remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// sort words in list in order of length\n\t\t\twordList.sort(Comparator.comparingInt(String::length));\n\t\t\t// sort wordToFreqMap by value (frequency) and choose the last sorted map element\n\t\t\t// to get most frequently used word\n\t\t\tList<Map.Entry<String, Integer>> mapEntryWtfList = new ArrayList<>(wordToFreqMap.entrySet());\n\t\t\tmapEntryWtfList.sort(Map.Entry.comparingByValue());\n\t\t\tMap<String, Integer> sortedWordToFreqMap = new LinkedHashMap<>();\n\t\t\tsortedWordToFreqMap.put(mapEntryWtfList.get(mapEntryWtfList.size()-1).getKey(), mapEntryWtfList.get(mapEntryWtfList.size()-1).getValue());\t\n\t\t\t// set up Json object to be returned as string\n\t\t\t// the code below is self-explaining\n\t\t\tJSONObject json = new JSONObject();\n\t\t\ttry {\n\t\t\t\tjson.put(\"remaining words ordered by length\", wordList);\n\t\t\t\tjson.put(\"most used word\", mapEntryWtfList.get(mapEntryWtfList.size()-1).getKey());\n\t\t\t\tjson.put(\"number of uses\", mapEntryWtfList.get(mapEntryWtfList.size()-1).getValue());\n\t\t\t} catch(JSONException je) {\n\t\t\t\tje.printStackTrace();\n\t\t\t}\n\t\t\treturn json.toString();\n\t\t\t\n\t\t}\n\t\treturn \"\";\n\t}", "public int count(String word);", "void addWordsToDoc(int doc,List<VocabWord> words);", "int countByExample(WdWordDictExample example);", "public static void logCountedSearches(\n boolean wasPanelSeen, boolean wasDocumentPainted, boolean wasPrefetch) {\n // Get the enum for the category for those seen, and record the category of the search.\n // Default to the simplest Counted enum, which is useful for both histograms.\n @CountedEvent\n int searchEnum = CountedEvent.UNINTELLIGENT_COUNTED;\n if (wasPanelSeen) {\n // Prefetch indicates an intelligent search and might not have been counted through\n // dynamic JavaScript conversion.\n if (wasPrefetch) {\n searchEnum = wasDocumentPainted ? CountedEvent.INTELLIGENT_COUNTED\n : CountedEvent.INTELLIGENT_NOT_COUNTED;\n }\n RecordHistogram.recordEnumeratedHistogram(\n \"Search.ContextualSearch.Counted.Event\", searchEnum, CountedEvent.NUM_ENTRIES);\n }\n boolean wasSeenAndCounted =\n wasPanelSeen && searchEnum != CountedEvent.INTELLIGENT_NOT_COUNTED;\n RecordHistogram.recordBooleanHistogram(\n \"Search.ContextualSearch.Counted.Searches\", wasSeenAndCounted);\n }", "public abstract void substitutedWords(long ms, int n);", "public static void aggregateWordCountsAndPrint(JavaSparkContext sc ,JavaPairDStream<String, Integer> newWordCounts,String outputDir){\n\t\t\n\t\t// Apply the inner function to each RDD in this newWordCounts DStream\n\t\tnewWordCounts.foreachRDD((rdd, time) -> {\n\n\t\n\t\t\tif (rdd.count()==0)\n\t\t\t{\n\t\t\t\t System.out.println(\"No words in this time interval: \" +time);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tJavaPairRDD<Text, IntWritable> result = rdd.mapToPair(new ConvertToWritableTypes());\n\t\t\tresult.saveAsHadoopFile(outputDir+\"/\" + time.toString(), Text.class, IntWritable.class,\n\t\t\t\t\tSequenceFileOutputFormat.class);\n\t\t\t//Print the aggregation word counts \n\t\t\tprintAllWordCounts(sc, outputDir);\n\n\t\t});\n\t\t\n\t\t\n\t\t\n\t}", "public abstract void overallWords(long ms, int n);", "private static void printTable(int numberOfDocs) {\n \n Gson gs = new Gson();\n String json = gs.toJson(wor);\n // System.out.println(json);\n \n List<String> queryWords = new ArrayList();\n //to test it for other query word you can change the following two words\n //queryWords.add(\"carpet\");\n //queryWords.add(\"hous\");\n queryWords.add(\"the\");\n queryWords.add(\"crystallin\");\n queryWords.add(\"len\");\n queryWords.add(\"vertebr\");\n queryWords.add(\"includ\");\n \n \n FrequencySummary frequencySummary = new FrequencySummary();\n frequencySummary.getSummary(json,docName, queryWords);\n \n System.exit(0);\n \n Hashtable<Integer,Integer> g = new Hashtable<>();\n \n /* wor.entrySet().forEach((wordToDocument) -> {\n String currentWord = wordToDocument.getKey();\n Map<String, Integer> documentToWordCount = wordToDocument.getValue();\n freq.set(0);\n df.set(0);\n documentToWordCount.entrySet().forEach((documentToFrequency) -> {\n String document = documentToFrequency.getKey();\n Integer wordCount = documentToFrequency.getValue();\n freq.addAndGet(wordCount);\n System.out.println(\"Word \" + currentWord + \" found \" + wordCount +\n \" times in document \" + document);\n \n if(g.getOrDefault(currentWord.hashCode(), null)==null){\n g.put(currentWord.hashCode(),1);\n \n }else {\n System.out.println(\"Hello\");\n \n int i = g.get(currentWord.hashCode());\n System.out.println(\"i \"+i);\n g.put(currentWord.hashCode(), i++);\n }\n // System.out.println(currentWord+\" \"+ g.get(currentWord.hashCode()));\n // g.put(currentWord.hashCode(), g.getOrDefault(currentWord.hashCode(), 0)+wordCount);\n \n });\n // System.out.println(freq.doubleValue());\n \n // System.out.println(\"IDF for this word: \"+Math.log10( (double)(counter/freq.doubleValue())));\n });\n // System.out.println(g.get(\"plai\".hashCode()));\n //System.out.println(\"IDF for this word: \"+Math.log10( (double)(counter/(double)g.get(\"plai\".hashCode()))));\n */\n }", "public void add(Word d) {\n d.incFrequency();\n root = add(d, root);\n }", "public void analyzequery(JSONObject json) {\n\t\ttry {\n\t\t\t\n\t\t\tJSONArray jarray = json.getJSONArray(\"Reviews\");\n\t\t\t\n\t\t\tfor (int i = 0; i < jarray.length(); i++) {\n\t\t\t\t\n\t\t\t\tPost review = new Post(jarray.getJSONObject(i));\n\t\t\t\tSystem.out.println(\"55\");\n\t\t\t\tString content = review.getContent();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\tHashMap<String, Integer> querytf = new HashMap<String, Integer>();\n\n\t\t\t\tHashSet<String> biminiset = new HashSet<String>();\n\n\t\t\t\tArrayList uniquery = new ArrayList();\n\n\t\t\t\tfor (String token : tokenizer.tokenize(content)) {\n\t\t\t\t\tif (m_stopwords.contains(token))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (token.isEmpty())\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tuniquery.add(PorterStemmingDemo(SnowballStemmingDemo(NormalizationDemo(token))));\n\n\t\t\t\t}\n\n\t\t\t\tfor (int k = 0; k < uniquery.size(); k++) {\n\n\t\t\t\t\tif (querytf.containsKey(uniquery.get(i).toString())) {\n\t\t\t\t\t\tquerytf.put(uniquery.get(i).toString(),\n\t\t\t\t\t\t\t\tquerytf.get(uniquery.get(i).toString()) + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquerytf.put(uniquery.get(i).toString(), 1);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tArrayList<String> N_gram = new ArrayList<String>();\n\n\t\t\t\tfor (String token : tokenizer.tokenize(content)) {\n\n\t\t\t\t\ttoken = PorterStemmingDemo(SnowballStemmingDemo(NormalizationDemo(token)));\n\t\t\t\t\tif (token.isEmpty()) {\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tN_gram.add(token);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tString[] fine = new String[N_gram.size()];\n\n\t\t\t\tfor (int p = 0; p < N_gram.size() - 1; p++) {\n\t\t\t\t\tif (m_stopwords.contains(N_gram.get(p)))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (m_stopwords.contains(N_gram.get(p + 1)))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tfine[p] = N_gram.get(p) + \"-\" + N_gram.get(p + 1);\n\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\tfor (String str2 : fine) {\n\n\t\t\t\t\tif (querytf.containsKey(str2)) {\n\t\t\t\t\t\tquerytf.put(str2, querytf.get(str2) + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquerytf.put(str2, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (String key : querytf.keySet()) {\n\t\t\t\t\tif (m_stats.containsKey(key)) {\n\t\t\t\t\t\tdouble df = (double) m_stats.get(key);\n\n\t\t\t\t\t\tdouble idf = (1 + Math.log(102201 / df));\n\n\t\t\t\t\t\tdouble tf = querytf.get(key);\n\n\t\t\t\t\t\tdouble result = tf * idf;\n\n\t\t\t\t\t\tquery_idf.put(key, result);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquery_idf.put(key, 0.0);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\tcatch (JSONException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t}", "public static void update(Transcription t) throws IOException, SQLException\r\n {\r\n IndexWriter writer = null;\r\n Analyzer analyser;\r\n Directory directory;\r\n /**@TODO parameterize this location*/\r\n String dest = \"/usr/indexTranscriptions\";\r\n\r\n directory = FSDirectory.getDirectory(dest, true);\r\n analyser = new StandardAnalyzer();\r\n writer = new IndexWriter(directory, analyser, true);\r\n Term j=new Term(\"id\",\"\"+t.getLineID());\r\n writer.deleteDocuments(j);\r\n Document doc=new Document();\r\n Field field;\r\n field = new Field(\"text\", t.getText(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"comment\", t.getComment(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"creator\", \"\" + t.UID, Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"security\", \"\" + \"private\", Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"line\", \"\" + t.getLine(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"page\", \"\" + t.getFolio(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"id\", \"\" + t.getLineID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"manuscript\", \"\" + new Manuscript(t.getFolio()).getID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"projectID\", \"\" + t.getProjectID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n writer.addDocument(doc);\r\n writer.commit();\r\n \twriter.close();\r\n\r\n }", "private Map<String, Integer> editDistance(String s, DictionaryModel dictionary, int numberOfAllowedChanges, Set <String> alreadyPresentWords ) {\n\n Map<String, Integer> res = new HashMap<>();\n ArrayList <String> editions = editDistance(s, dictionary);\n ArrayList <String> newWords = new ArrayList<>();\n\n for( String word : editions ) {\n if( !alreadyPresentWords.contains(word) ) {\n res.put(word, numberOfAllowedChanges);\n newWords.add( word );\n }\n }\n alreadyPresentWords.addAll( newWords );\n Timber.d(\"There are %d new words(%d)\", newWords.size() , numberOfAllowedChanges);\n\n for( String word : newWords ) {\n if( numberOfAllowedChanges > 1 )\n res.putAll( editDistance( word, dictionary, numberOfAllowedChanges - 1, alreadyPresentWords ) );\n }\n\n return res;\n }", "@Override\r\n public void actionPerformed(ActionEvent arg0) {\r\n UserDictionaryProvider provider = SpellChecker.getUserDictionaryProvider();\r\n if (provider != null) {\r\n provider.addWord(word);\r\n }\r\n Dictionary dictionary = SpellChecker.getCurrentDictionary();\r\n dictionary.add(word);\r\n dictionary.trimToSize();\r\n AutoSpellChecker.refresh(jText);\r\n }", "private void initiateWordCount(){\n for(String key: DataModel.bloomFilter.keySet()){\n WordCountHam.put(key, 0);\n WordCountSpam.put(key, 0);\n }\n }", "public abstract void insertedWords(long ms, int n);", "void addWordToDoc(int doc,VocabWord word);", "void updateFrequencyCount() {\n //Always increments by 1 so there is no need for a parameter to specify a number\n this.count++;\n }", "public void IndexADocument(String docno, String content) throws IOException {\n\t\tdocid++;\n\t\tdoc2docid.put(docno, docid);\n\t\tdocid2doc.put(docid, docno);\n\n\t\t// Insert every term in this doc into docid2map\n\t\tString[] terms = content.trim().split(\" \");\n\t\tMap<Integer, Integer> docTerm = new HashMap<>();\n\t\tint thisTermid;\n\t\tfor(String term: terms){\n\t\t\t// get termid\n\t\t\tif(term2termid.get(term)!=null) thisTermid = term2termid.get(term);\n\t\t\telse{\n\t\t\t\tthisTermid = ++termid;\n\t\t\t\tterm2termid.put(term, thisTermid);\n\t\t\t}\n\t\t\tdocTerm.put(thisTermid, docTerm.getOrDefault(thisTermid, 0)+1);\n\t\t\t// Merge this term's information into termid2map\n\t\t\tMap<Integer, Integer> temp = termid2map.getOrDefault(thisTermid, new HashMap());\n\t\t\ttemp.put(docid, temp.getOrDefault(docid, 0)+1);\n\t\t\ttermid2map.put(thisTermid, temp);\n\t\t\ttermid2fre.put(thisTermid, termid2fre.getOrDefault(thisTermid, 0)+1);\n\t\t}\n\t\tdocid2map.put(docid, docTerm);\n\n//\t\t// Merge all the terms' information into termid2map\n//\t\tfor(Long tid: docTerm.keySet()){\n//\t\t\tMap<Long, Long> temp = termid2map.getOrDefault(tid, new HashMap());\n//\t\t\ttemp.put(docid,docTerm.get(tid));\n//\t\t\ttermid2map.put(tid, temp);\n//\t\t\t// update this term's frequency\n//\t\t\ttermid2fre.put(tid, termid2fre.getOrDefault(tid,0L)+docTerm.get(tid));\n//\t\t}\n\n\t\t// When termid2map and docid2map is big enough, put it into disk\n\t\tif(docid%blockSize==0){\n\t\t\tWritePostingFile();\n\t\t\tWriteDocFile();\n\t\t}\n\t}", "WordCounter(String inputText){\r\n \r\n wordSource = inputText;\r\n }", "public void setWordCount(int countIn) {\n this.wordCount = countIn;\n }", "private void count(Entry curr)\n {\n \t//Increase Prefix count if any word is found.\n \tif (curr.EndOfWord == true)\n \t\tprefixCnt += 1;\n \t\n \tfor (HashMap.Entry<Character, Entry> entry : curr.child.entrySet())\n \t{\n \t\tcount(entry.getValue());\n \t}\n }", "long count(String query);", "long count(String query);", "public void incrParser(String str){\r\n\r\n String[] words = str.split(\" \");\r\n String word = words[words.length - 1];\r\n word = word.substring(0,word.length() - 1);\r\n this.values.replace(word,values.get(word) + 1);\r\n\r\n }", "private void upgradeDictionary() throws IOException {\n File fileAnnotation = new File(filePathAnnSource);\n FileReader fr = new FileReader(fileAnnotation);\n BufferedReader br = new BufferedReader(fr);\n String line;\n\n if (fileAnnotation.exists()) {\n while ((line = br.readLine()) != null) {\n String[] annotations = line.split(\"[ \\t]\");\n String word = line.substring(line.lastIndexOf(\"\\t\") + 1);\n\n if (!nonDictionaryTerms.contains(word.toLowerCase())) {\n if (dictionaryTerms.containsKey(word.toLowerCase())) {\n if (!dictionaryTerms.get(word.toLowerCase()).equalsIgnoreCase(annotations[1])) {\n System.out.println(\"Conflict: word:: \" + word + \" Dictionary Tag: \" + dictionaryTerms.get(word.toLowerCase()) + \" New Tag: \" + annotations[1]);\n nonDictionaryTerms.add(word.toLowerCase());\n// removeLineFile(dictionaryTerms.get(word.toLowerCase())+\" \"+word.toLowerCase(),filePathDictionaryAuto);\n dictionaryTerms.remove(word.toLowerCase());\n writePrintStream(word, filePathNonDictionaryAuto);\n }\n } else {\n System.out.println(\"Updating Dictionary:: Word: \" + word + \"\\tTag: \" + annotations[1]);\n dictionaryTerms.put(word.toLowerCase(), annotations[1]);\n writePrintStream(annotations[1] + \" \" + word.toLowerCase(), filePathDictionaryAuto);\n }\n }\n\n// if (dictionaryTerms.containsKey(word.toLowerCase())) {\n// if (!dictionaryTerms.get(word.toLowerCase()).equalsIgnoreCase(annotations[1])) {\n// System.out.println(\"Conflict: word: \" + word + \" Dictionary Tag: \" + dictionaryTerms.get(word.toLowerCase()) + \" New Tag: \" + annotations[1]);\n// nonDictionaryTerms.add(word.toLowerCase());\n//\n// }\n// } else {\n// dictionary.add(word.toLowerCase());\n// dictionaryTerms.put(word.toLowerCase(), annotations[1]);\n// System.out.println(\"Updating Dictionary: Word: \" + word + \"\\tTag: \" + annotations[1]);\n// }\n }\n }\n\n\n br.close();\n fr.close();\n }", "@Override\r\n public Integer countingDuplicates(String match) {\r\n if(duplicates == null) { // if it's not already located\r\n duplicates = new HashMap<>();\r\n for (Core str : pondred) {\r\n for (String term:str.abstractTerm){\r\n if (duplicates.containsKey(term) )\r\n duplicates.put(term, duplicates.get(term) + 1);\r\n else {\r\n duplicates.put(term, 1);\r\n }\r\n }\r\n }\r\n }\r\n return duplicates.get(match);\r\n }", "public void dailyMapReduce(Date date, String collectionName) {\n\n\t\tDBCollection tweets = mongoOps.getCollection(collectionName);\n\n\t\tCalendar today = Calendar.getInstance();\n\t\ttoday.setTime(date);\n\n\t\ttoday.set(Calendar.HOUR_OF_DAY, 0);\n\t\ttoday.set(Calendar.MINUTE, 0);\n\t\ttoday.set(Calendar.SECOND, 0);\n\n\t\tlong today_beginning_timestamp = today.getTimeInMillis();\n\t\tSystem.out.println(\"Today beginning:\" + today.getTime());\n\n\t\ttoday.set(Calendar.HOUR_OF_DAY, 23);\n\t\ttoday.set(Calendar.MINUTE, 59);\n\t\ttoday.set(Calendar.SECOND, 59);\n\t\tlong today_ending_timestamp = today.getTimeInMillis();\n\t\tSystem.out.println(\"Today ending:\" + today.getTime());\n\n\t\tDBObject condition = new BasicDBObject(2);\n\t\tcondition.put(\"$gte\", Long.toString(today_beginning_timestamp));\n\t\tcondition.put(\"$lt\", Long.toString(today_ending_timestamp));\n\t\tDBObject q = new BasicDBObject(\"timestamp_ms\", condition);\n\t\tDBObject match = new BasicDBObject(\"$match\", q);\n\t\tDBObject output = new BasicDBObject(\"$out\", \"temp\");\n\n\t\t// run aggregation\n\t\tList<DBObject> pipeline = Arrays.asList(match, output);\n\t\ttweets.aggregate(pipeline);\n\n\t\tDBCollection temp = mongoOps.getCollection(\"temp\");\n\n\t\t// map function\n\t\tStringBuilder mapFunction = new StringBuilder(\"function() {\");\n\t\tfor (Field field : Field.values()) {\n\t\t\tif (field == Field.ALL) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tmapFunction.append(\"var entity = this.\" + field.toString() + \";\");\n\t\t\tmapFunction\n\t\t\t\t\t.append(\"if ( entity ) { entity = entity.toString().toLowerCase().split(',');\");\n\t\t\tmapFunction.append(\"for ( var i = entity.length -1 ; i>=0 ;--i){\");\n\n\t\t\tif (field.toString() == Field.PERSON.toString()) {\n\t\t\t\tmapFunction\n\t\t\t\t\t\t.append(\"entity[i]=entity[i].replace(/[^a-zA-Z]/g, ' ');\");\n\n\t\t\t} else if (field.toString() == Field.HASHTAG.toString()) {\n\t\t\t\tmapFunction\n\t\t\t\t\t\t.append(\"entity[i]=entity[i].replace(/[`~!@$%^&*()_|+\\\\-=?;:\\\\'\\\".<>\\\\{\\\\}\\\\[\\\\]\\\\\\\\/]/gi, '');\");\n\n\t\t\t} else if (field.toString() != Field.URL.toString()) {\n\t\t\t\tmapFunction\n\t\t\t\t\t\t.append(\"entity[i]=entity[i].replace(/[`~!@#$%^&*()_|+\\\\-=?;:\\\\'\\\".<>\\\\{\\\\}\\\\[\\\\]\\\\\\\\/]/gi, '');\");\n\t\t\t}\n\n\t\t\tmapFunction\n\t\t\t\t\t.append(\"if ( entity[i] && entity[i].trim().length > 0 && entity[i] !== '[]') {\");\n\t\t\tmapFunction.append(\"emit( { id: entity[i].trim(), date: \\\"\"\n\t\t\t\t\t+ counterDateFormat.format(date) + \"\\\", type: \\\"\"\n\t\t\t\t\t+ field.toString() + \"\\\"}, 1);}}}\");\n\n\t\t}\n\t\tmapFunction.append(\"};\");\n\t\tString map = mapFunction.toString();\n\t\tSystem.out.println(map);\n\n\t\t// reduce function\n\t\tString reduce = \"function(key, values) {\" + \"var sum = 0;\"\n\t\t\t\t+ \"values.forEach( function(v) {\" + \"sum += v;\" + \"});\"\n\t\t\t\t+ \"return sum;\" + \"}\";\n\n\t\tSystem.out.println(reduce);\n\n\t\t// run map-reduce on the temporary collection, the output is in the file\n\t\t// named outCollection\n\t\tMapReduceCommand cmd = new MapReduceCommand(temp, map, reduce,\n\t\t\t\tDAILY_COLLECT_NAME, MapReduceCommand.OutputType.MERGE, null);\n\t\ttemp.mapReduce(cmd);\n\n\t\t// delete the temporary collection\n\t\ttemp.drop();\n\t\tSystem.out.println(\"Finished daily mapreduce\");\n\t}", "public void countSpelers() {\n if (typeField.getText().equals(\"Toernooi\")) {\n try {\n Connection con = Main.getConnection();\n PreparedStatement st = con.prepareStatement(\"SELECT COUNT (*) as geteld FROM Inschrijvingen where toernooi = ?\");\n st.setInt(1, Integer.parseInt(codeField.getText()));\n ResultSet rs = st.executeQuery();\n if (rs.next()) {\n int geteld = rs.getInt(\"geteld\");\n try {\n Connection con2 = Main.getConnection();\n PreparedStatement update = con2.prepareStatement(\"UPDATE Toernooi SET aantal_spelers = ? where TC = ?\");\n update.setInt(1, geteld);\n update.setInt(1, Integer.valueOf(codeField.getText()));\n update.executeUpdate();\n } catch (Exception e) {\n System.out.println(e);\n System.out.println(\"ERROR: er ging iets mis met de database(updateAantalSpelers)\");\n }\n }\n } catch (Exception e) {\n System.out.println(e);\n System.out.println(\"ERROR: er ging iets mis met de database(updateAantalSpelers)\");\n }\n } else if (typeField.getText().equals(\"Masterclass\")) {\n try {\n Connection con = Main.getConnection();\n PreparedStatement st = con.prepareStatement(\"SELECT COUNT (*) as geteld FROM Inschrijvingen where toernooi = ?\");\n st.setInt(1, Integer.parseInt(codeField.getText()));\n ResultSet rs = st.executeQuery();\n if (rs.next()) {\n int geteld = rs.getInt(\"geteld\");\n try {\n Connection con2 = Main.getConnection();\n PreparedStatement update = con2.prepareStatement(\"UPDATE Masterclass SET aantal_spelers = ? where MasterclassCode = ?\");\n update.setInt(1, geteld);\n update.setInt(2, Integer.parseInt(codeField.getText()));\n update.executeUpdate();\n } catch (Exception e) {\n System.out.println(e);\n System.out.println(\"ERROR: er ging iets mis met de database(updateAantalSpelers)\");\n }\n }\n } catch (Exception e) {\n System.out.println(e);\n System.out.println(\"ERROR: er is een probleem met de database (countSpelers)\");\n }\n }\n }", "private void updateWordsDisplayed() {\n \t\tcurrFirstLetters.remove(wordsList[wordsDisplayed[currWordIndex]].charAt(0));\n \t\twhile (currFirstLetters.contains(wordsList[nextWordIndex].charAt(0))) {\n \t\t\tnextWordIndex++;\n \t\t\tif (nextWordIndex >= wordsList.length) {\n \t\t\t\tnextWordIndex = 0;\n \t\t\t}\n \t\t}\n \t\tcurrFirstLetters.add(wordsList[nextWordIndex].charAt(0));\n \t\twordsDisplayed[currWordIndex] = nextWordIndex;\n \t\tnextWordIndex++;\n \t\tif (nextWordIndex >= wordsList.length) {\n \t\t\tnextWordIndex = 0;\n \t\t}\n \t\tsetChanged();\n \t\tnotifyObservers(States.update.FINISHED_WORD);\n \t}", "private static List<SearchData> booleanSearchWord(Query query, Indexer si) {\n Tokenizer tkn = new SimpleTokenizer();\n tkn.tokenize(query.getStr(), \"[a-zA-Z]{3,}\", true, true);\n List<SearchData> searchList = new ArrayList<>();\n LinkedList<Token> wordsList = tkn.getTokens();\n Iterator<Token> wordsIt = wordsList.iterator();\n HashMap<String, LinkedList<Posting>> indexer = si.getIndexer();\n int idx;\n SearchData searched_doc;\n\n while (wordsIt.hasNext()) {\n String word = wordsIt.next().getSequence();\n if (indexer.containsKey(word)) {\n\n LinkedList<Posting> posting = indexer.get(word);\n\n for (Posting pst : posting) {\n\n SearchData sd = new SearchData(query, pst.getDocId());\n\n if (!searchList.contains(sd)) {\n sd.setScore(1);\n searchList.add(sd);\n } else {\n idx = searchList.indexOf(sd);\n searched_doc = searchList.get(idx);\n searched_doc.setScore(searched_doc.getScore() + 1);\n }\n }\n\n }\n\n\n }\n\n Collections.sort(searchList);\n\n return searchList;\n }", "public void count(String problem2)\n\t\t{\n\t\t\t\t\n\t\t\t//this will begin to run\n\t\t\ttry\n\t\t\t{\n\t\t\t\t\n\t\t\t\t//we create a scanner for input\n\t\t\t\tScanner readUserFile = new Scanner(new File(problem2));\n\t\t\t\t\n\t\t\t\t//a while function that will run as long as the text has more input\n\t\t\t\twhile(readUserFile.hasNext())\n\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tString nextUserWord = readUserFile.next();\n\t\t\t\t\t\n\t\t\t\t\tif (totalOccurence.containsKey(nextUserWord))\n\t\t\t\t\t\t\n\t\t\t\t\t{\n\t\t\t\t\t\tint occurence = totalOccurence.get(nextUserWord);\n\t\t\t\t\t\ttotalOccurence.put(nextUserWord, occurence + 1);\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse totalOccurence.put(nextUserWord, 1);\n\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t//free up used resources\n\t\t\t\treadUserFile.close();\n\t\t\t\n\t\t\t//we have a catch in place for any issues\t\n\t\t\t}\n\t\t\tcatch(IOException e)\n\t\t\t{\n\t\t\t\t//system print out if any error occurs\n\t\t\t\tSystem.out.println(\"Unfourtantly an issue occured when opening the file!\");\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\t\n\t\t}", "public static void keywordHit()\r\n\t{\r\n\t\tkeywordHits++;\r\n\t}", "long countByExample(WordSchoolExample example);", "public void annotate(CoreDocument document){\r\n for(int i=0;i<document.tokens().size();i++){\r\n CoreLabel token = document.tokens().get(i);\r\n if(token.word().equals(sch))\r\n token.set(SearchAnnotation.class,i);\r\n }\r\n }", "public static void countWords(String text, HashMap<String, Integer> counts){\n\t\tStringTokenizer st = new StringTokenizer(text);\n\t\tString currWord = null;\n\t\twhile(st.hasMoreTokens()){\n\t\t\tcurrWord = st.nextToken();\n\t\t\tif(counts.containsKey(currWord)){\n\t\t\t\tcounts.put(currWord, counts.get(currWord)+1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcounts.put(currWord, 1);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void updateStatisticCounts(long topicCoutn, long postCount)\n\t\t\tthrows Exception {\n\n\t}", "public void scoreWord() {\n\t\t// check if valid word\n\t\tif (word.isWord(dictionary)) {\n\t\t\tscore += word.getScore();\n\t\t\tword.start = null;\n\t\t\tword.wordSize = 0;\n\t\t\t// check if word still possible\n\t\t} else if (!word.isPossibleWord(dictionary)) {\n\t\t\tword.start = null;\n\t\t\tword.wordSize = 0;\n\t\t}\n\n\t}", "public void makeQueryTermList() {\n for (int i = 0; i < this.stemmed_query.size(); i++) {\n boolean added = false;\n String curTerm = this.stemmed_query.get(i);\n for (int j = 0; j < this.query_terms_list.size(); j++) {\n if (this.query_terms_list.get(j).strTerm.compareTo(curTerm) == 0) {\n this.query_terms_list.get(j).timeOccur++;\n added = true;\n break;\n }\n }\n if (added == false) {\n this.query_terms_list.add(new QueryTerm(curTerm));\n }\n }\n }", "public void indexCreate()\n {\n try{\n Directory dir = FSDirectory.open(Paths.get(\"indice/\"));\n Analyzer analyzer = new StandardAnalyzer();\n IndexWriterConfig iwc = new IndexWriterConfig(analyzer);\n iwc.setOpenMode(OpenMode.CREATE);\n IndexWriter writer = new IndexWriter(dir,iwc);\n MongoConnection mongo = MongoConnection.getMongo();\n mongo.OpenMongoClient();\n DBCursor cursor = mongo.getTweets();\n Document doc = null;\n\n while (cursor.hasNext()) {\n DBObject cur = cursor.next();\n if (cur.get(\"retweet\").toString().equals(\"false\")) {\n doc = new Document();\n doc.add(new StringField(\"id\", cur.get(\"_id\").toString(), Field.Store.YES));\n doc.add(new TextField(\"text\", cur.get(\"text\").toString(), Field.Store.YES));\n doc.add(new StringField(\"analysis\", cur.get(\"analysis\").toString(), Field.Store.YES));\n //doc.add(new StringField(\"finalCountry\",cur.get(\"finalCountry\").toString(),Field.Store.YES));\n doc.add(new StringField(\"userScreenName\", cur.get(\"userScreenName\").toString(), Field.Store.YES));\n doc.add(new StringField(\"userFollowersCount\", cur.get(\"userFollowersCount\").toString(), Field.Store.YES));\n doc.add(new StringField(\"favoriteCount\", cur.get(\"favoriteCount\").toString(), Field.Store.YES));\n\n if (writer.getConfig().getOpenMode() == OpenMode.CREATE) {\n System.out.println(\"Indexando el tweet: \" + doc.get(\"text\") + \"\\n\");\n writer.addDocument(doc);\n System.out.println(doc);\n } else {\n System.out.println(\"Actualizando el tweet: \" + doc.get(\"text\") + \"\\n\");\n writer.updateDocument(new Term(\"text\" + cur.get(\"text\")), doc);\n System.out.println(doc);\n }\n }\n }\n cursor.close();\n writer.close();\n }\n catch(IOException ioe){\n System.out.println(\" Error en \"+ ioe.getClass() + \"\\n mensaje: \" + ioe.getMessage());\n }\n }" ]
[ "0.6679594", "0.6283755", "0.6060499", "0.6020642", "0.600903", "0.5995564", "0.5875993", "0.5806435", "0.5792307", "0.56529236", "0.5627714", "0.55316556", "0.5507088", "0.5481717", "0.5409441", "0.53621966", "0.5361106", "0.5350937", "0.53137004", "0.52374303", "0.52260447", "0.51957166", "0.51916856", "0.5146366", "0.5122602", "0.5096096", "0.5085762", "0.50651425", "0.5057658", "0.5040344", "0.50365555", "0.5033505", "0.50150484", "0.50122374", "0.5002185", "0.49951226", "0.49916402", "0.4984133", "0.4982837", "0.49799514", "0.49697137", "0.49564168", "0.49546257", "0.49544585", "0.4944806", "0.4939955", "0.49319676", "0.4918706", "0.49174237", "0.4906926", "0.48982245", "0.48947892", "0.4877277", "0.4871058", "0.48687437", "0.48535335", "0.48376122", "0.48367307", "0.48313305", "0.48270038", "0.4826105", "0.48202822", "0.48116714", "0.48098132", "0.4809434", "0.4802527", "0.47984007", "0.4795494", "0.4791496", "0.47909132", "0.47710094", "0.47709405", "0.4770554", "0.47530928", "0.4746474", "0.47357062", "0.47270614", "0.4725706", "0.47254753", "0.47245243", "0.47196528", "0.47162917", "0.47125667", "0.47125667", "0.4695814", "0.4690668", "0.46820825", "0.46818072", "0.46812138", "0.46785048", "0.4675369", "0.4675215", "0.4670358", "0.46683416", "0.46635836", "0.46625057", "0.4661064", "0.46591276", "0.4651483", "0.4642415" ]
0.751059
0
update all the queries with the words in a TwitterParser.
public void update_query(TwitterParser tweet) { for(String s : tweet.get_words()) update_query(s, tweet.get_date()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void statsForQuery(String query) {\n\t\tHashMap<String,Integer> oldTerms=newTerms; // record the terms to analyze modified queries\n\t\tnewTerms=new HashMap<String,Integer>();\n\t\t\t\t\n\t\tString terms[]=query.split(\"\\\\s\");\t\t\t\t\n\t\tint matchingTerms=0;\n\t\tint matchingTermsStopwords=0;\n\t\tint matchingTermsOrder=0;\n\t\tfor (int j=0;j<terms.length;j++) {\n\t\t\tif (!terms[j].equals(\"\")) {\n\t\t\t \tif (oldTerms.containsKey(terms[j])) {\n\t\t\t \t\tmatchingTerms++;\t\t\t\t\t \n\t\t\t \t\tif (stopwordsMap.containsKey(terms[j])) { // match if it is stopword\n\t\t\t \t\t\tmatchingTermsStopwords++;\n\t\t\t \t\t}\n\t\t\t \t\tif (oldTerms.get(terms[j])==j) { // match if it has the same order\n\t\t\t \t\t\tmatchingTermsOrder++;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tnewTerms.put(terms[j],j);\n\t\t\t}\n\t\t}\t\n\n\t\tif (newTerms.size()==oldTerms.size() && matchingTerms==oldTerms.size() && matchingTerms>0) { // the queries have the same terms\n\t\t totalEqualTermsQueries++;\n\t\t\t\t \t\t\t\t \t\t\t\t\t\t \t\t\t\t \t\t\t\t \n\t\t if (matchingTermsStopwords==oldTerms.size()) {\n\t\t \ttotalEqualTermsStopwordsQueries++;\n\t\t }\n\t\t if (matchingTermsOrder==oldTerms.size()) {\n\t\t \ttotalEqualTermsOrderQueries++;\n\t\t }\n\t\t if (query.equals(oldQuery)) {\n\t\t \ttotalIdenticalQueries++;\n\t\t }\n\t\t if (sessionQueries.contains(query)) {\n\t\t \ttotalIdenticalSessionQueries++;\n\t\t }\n\t\t}\n\t\telse if (matchingTerms-matchingTermsStopwords>0) { // the queries have at least one term equal and diferent from a stopword\n\t\t totalModifiedQueries++;\n\t\t int index=newTerms.size()-oldTerms.size()+N_MODIFIED_TERMS_RANGE/2;\n\t\t if (index<0) {\n\t\t \tindex=0;\n\t\t }\n\t\t else if (index>N_MODIFIED_TERMS_RANGE-1) {\n\t\t \tindex=N_MODIFIED_TERMS_RANGE-1;\n\t\t }\n\t\t nModifiedTerms[index]++;\n\t\t}\n\t\toldQuery=query; \n\t\t\t\t\t\t\n\t\t// store session query\n\t\tsessionQueries.add(query);\n\t}", "public void splitQuery(){\n for (int i=0;i<stemmed_query.size();i++){\n String stemmed_term = stemmed_query.get(i);\n for (int j=0;j<num_slave_client_threads;j++){\n if (stemmed_term.compareTo(ServerThread.start_terms[j]) >= 0 && stemmed_term.compareTo(ServerThread.end_terms[j]) <= 0){\n slave_queries.set(j, slave_queries.get(j)+\" \"+stemmed_term);\n break;\n }\n }\n }\n }", "private void updateCommon(List<Status> tweetsList) {\r\n numberOfTweets += tweetsList.size();\r\n \r\n tweetsList.stream().forEach(tweet -> {\r\n final HashtagEntity[] hashtags = tweet.getHashtagEntities();\r\n for (HashtagEntity hashtag : hashtags) {\r\n final String text = hashtag.getText().toLowerCase();\r\n if (!countHashtags.containsKey(text)) {\r\n countHashtags.put(text, 0);\r\n }\r\n countHashtags.put(text, countHashtags.get(text) + 1);\r\n }\r\n \r\n final String[] words = tweet.getText().split(\" \");\r\n for (String word : words) {\r\n word = word.toLowerCase();\r\n if (!wordsFilter.contains(word)) {\r\n if (!countWords.containsKey(word)) {\r\n countWords.put(word, 0);\r\n }\r\n countWords.put(word, countWords.get(word) + 1);\r\n }\r\n }\r\n \r\n final String location = tweet.getUser().getLocation();\r\n if (!countLocation.containsKey(location)) {\r\n countLocation.put(location, 0);\r\n }\r\n countLocation.put(location, countLocation.get(location) + 1);\r\n });\r\n }", "public void search(Indexer indexer, CityIndexer cityIndexer, Ranker ranker, String query, boolean withSemantic, ArrayList<String> chosenCities, ObservableList<String> citiesByTag, boolean withStemming, String saveInPath, String queryId, String queryDescription) {\n String[] originalQueryTerms = query.split(\" \");\n String originQuery = query;\n docsResults = new HashMap<>();\n parser = new Parse(withStemming, saveInPath, saveInPath);\n HashSet<String> docsOfChosenCities = new HashSet<>();\n query = \"\" + query + queryDescription;\n HashMap<String, Integer> queryTerms = parser.parseQuery(query);\n HashMap<String, ArrayList<Integer>> dictionary = indexer.getDictionary();\n if (!withStemming){\n setDocsInfo(saveInPath + \"\\\\docsInformation.txt\");\n }\n else{\n setDocsInfo(saveInPath + \"\\\\docsInformation_stemming.txt\");\n }\n\n\n //add semantic words of each term in query to 'queryTerms'\n if(withSemantic) {\n HashMap<String,ArrayList<String>> semanticWords = ws.connectToApi(originQuery);\n }\n\n //give an ID to query if it's a regular query (not queries file)\n if(queryId.equals(\"\")){\n queryId = \"\" + Searcher.queryID;\n Searcher.queryID++;\n }\n\n String postingDir;\n if (!withStemming) {\n postingDir = \"\\\\indexResults\\\\postingFiles\";\n } else {\n postingDir = \"\\\\indexResults\\\\postingFiles_Stemming\";\n }\n int pointer = 0;\n\n //find docs that contain the terms in the query in their text\n HashMap<String, Integer> queryTermsIgnoreCase = new HashMap<>();\n for (String term : queryTerms.keySet()) {\n String originTerm = term;\n if (!dictionary.containsKey(term.toUpperCase()) && !dictionary.containsKey(term.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(term.toLowerCase())){\n term = term.toLowerCase();\n }\n else {\n term = term.toUpperCase();\n }\n queryTermsIgnoreCase.put(term,queryTerms.get(originTerm));\n pointer = dictionary.get(term).get(2);\n String chunk = (\"\" + term.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsResults'\n if(line != null) {\n findDocsFromLine(line, term);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their text\n for (String cityTerm : chosenCities) {\n if (!dictionary.containsKey(cityTerm) && !dictionary.containsKey(cityTerm.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(cityTerm.toLowerCase())){\n cityTerm = cityTerm.toLowerCase();\n }\n pointer = dictionary.get(cityTerm).get(2);\n // char chunk = indexer.classifyToPosting(term).charAt(0);\n String chunk = (\"\" + cityTerm.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(0, line.indexOf(\"[\") - 1); //get 'docsListStr'\n String[] docsArr = docs.split(\";\");\n for (String docInfo : docsArr) {\n String doc = docInfo.substring(0, docInfo.indexOf(\": \"));\n while(doc.charAt(0) == ' '){\n doc = doc.substring(1);\n }\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their city tag\n if(!chosenCities.isEmpty()){\n for (String cityDicRec: chosenCities) {\n //get pointer to posting from cityDictionary\n try {\n pointer = cityIndexer.getCitiesDictionary().get(cityDicRec);\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + \"\\\\cityIndexResults\" + \"\\\\posting_city\" + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(line.indexOf(\"[\") + 1, line.indexOf(\"]\")); //get 'docsListStr'\n String[] docsArr = docs.split(\"; \");\n for (String doc : docsArr) {\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n\n ranker.rank(docsResults, docsOfChosenCities, queryTermsIgnoreCase, dictionary, docsInfo,entities, queryId);\n }", "private void updateKeywords()\n {\n String[] enteredKeywords = getKeywordsFromBar();\n if(enteredKeywords == null)\n JOptionPane.showMessageDialog(null, \"Please enter some keywords to search for\");\n else\n spider.initKeywords(enteredKeywords);\n }", "public void run() {\n\n /**\n * Replace all delimiters with single space so that words can be\n * tokenized with space as delimiter.\n */\n for (int x : delimiters) {\n text = text.replace((char) x, ' ');\n }\n\n StringTokenizer tokenizer = new StringTokenizer(text, \" \");\n boolean findCompoundWords = PrefsHelper.isFindCompoundWordsEnabled();\n ArrayList<String> ufl = new ArrayList<String>();\n for (; tokenizer.hasMoreTokens();) {\n String word = tokenizer.nextToken().trim();\n boolean endsWithPunc = word.matches(\".*[,.!?;]\");\n \n // Remove punctuation marks from both ends\n String prevWord = null;\n while (!word.equals(prevWord)) {\n prevWord = word;\n word = removePunctuation(word);\n }\n \n // Check spelling in word lists\n boolean found = checkSpelling(word);\n if (findCompoundWords) {\n if (!found) {\n ufl.add(word);\n if (endsWithPunc) pushErrorToListener(ufl);\n } else {\n pushErrorToListener(ufl);\n }\n } else {\n if (!found) listener.addWord(word);\n }\n }\n pushErrorToListener(ufl);\n }", "public void makeQueryTermList() {\n for (int i = 0; i < this.stemmed_query.size(); i++) {\n boolean added = false;\n String curTerm = this.stemmed_query.get(i);\n for (int j = 0; j < this.query_terms_list.size(); j++) {\n if (this.query_terms_list.get(j).strTerm.compareTo(curTerm) == 0) {\n this.query_terms_list.get(j).timeOccur++;\n added = true;\n break;\n }\n }\n if (added == false) {\n this.query_terms_list.add(new QueryTerm(curTerm));\n }\n }\n }", "private void update() {\n\t\twhile(words.size()<length) {\n\t\t\twords.add(new Word());\n\t\t}\n\t}", "private void updateQueryViews() {\n for (QueryView view : queryViews) {\n updateQueryView(view);\n }\n }", "public void update_query(String word, Date time)\r\n\t{\r\n\t\tList<Exact_Period_Count> queries = m_table.get(word);\r\n\t\tif(queries != null)\r\n\t\t\tfor(Exact_Period_Count i : queries)\r\n\t\t\t\ti.Add_ifInRange(time);\r\n\t}", "void updateAllFilteredLists(Set<String> keywords, Calendar startDate, Calendar endDate,\n Entry.State state, Entry.State state2, Search... searches);", "public void updateTermInThisQuery(int relevanceFeedbackMethod) {\n query thisQuery = listDocumentRetrievedForThisQuery.getQuery();\n StringTokenizer token = new StringTokenizer(thisQuery.getQueryContent(), \" %&\\\"*#@$^_<>|`+=-1234567890'(){}[]/.:;?!,\\n\");\n while (token.hasMoreTokens()) {\n String keyTerm = token.nextToken();\n String filteredWord;\n if (invertedFileQuery.isStemmingApplied()) {\n filteredWord = StemmingPorter.stripAffixes(keyTerm);\n } else {\n filteredWord = keyTerm;\n }\n try {\n termWeightingDocument relation = invertedFileQuery.getListTermWeights().get(filteredWord);\n if (relation.getDocumentWeightCounterInOneTerm().get(thisQuery.getIndex()) != null) {\n double oldWeight = relation.getDocumentWeightCounterInOneTerm().get(thisQuery.getIndex()).getWeight();\n double newWeight = computeNewWeightTerm(relevanceFeedbackMethod,filteredWord,oldWeight);\n if (newWeight > 0) {\n newQueryComposition.put(keyTerm, newWeight);\n relation.getDocumentWeightCounterInOneTerm().get(thisQuery.getIndex()).setWeight(newWeight);\n } else {\n relation.getDocumentWeightCounterInOneTerm().get(thisQuery.getIndex()).setWeight(0.0);\n }\n }\n } catch (Exception e) {\n\n }\n }\n }", "public void updateQuery(String query) {\n\t\tUpdateAction.parseExecute(query, model);\n\t}", "public void separateFileToQueries(Indexer indexer, CityIndexer cityIndexer, Ranker ranker, File queriesFile, boolean withSemantic, ArrayList<String> chosenCities, ObservableList<String> citiesByTag, boolean withStemming, String saveInPath) {\n try {\n String allQueries = new String(Files.readAllBytes(Paths.get(queriesFile.getAbsolutePath())), Charset.defaultCharset());\n String[] allQueriesArr = allQueries.split(\"<top>\");\n\n for (String query : allQueriesArr) {\n if(query.equals(\"\")){\n continue;\n }\n String queryId = \"\", queryText = \"\", queryDescription = \"\";\n String[] lines = query.toString().split(\"\\n\");\n for (int i = 0; i < lines.length; i++){\n if(lines[i].contains(\"<num>\")){\n queryId = lines[i].substring(lines[i].indexOf(\":\") + 2);\n }\n else if(lines[i].contains(\"<title>\")){\n queryText = lines[i].substring(8);\n }\n else if(lines[i].contains(\"<desc>\")){\n i++;\n while(i < lines.length && !lines[i].equals(\"\")){\n queryDescription += lines[i];\n i++;\n }\n }\n }\n search(indexer, cityIndexer, ranker, queryText, withSemantic, chosenCities, citiesByTag, withStemming, saveInPath, queryId, queryDescription);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "static void ReadQuery(String input) throws FileNotFoundException {\n input = input.replaceAll(\"[^A-Za-z]\",\" \");\n String[] arr = input.split(\" \"); // splitting the whole string into words by split on the basis of white spaces\n\n\n for(int i=0; i<arr.length; i++) {\n String termWord = arr[i].toLowerCase();\t//same pre-processing is applied to all the query word\n //termWord = RemoveSpecialCharacter(termWord);\n termWord = removeStopWords(termWord);\n\n if(!termWord.equalsIgnoreCase(\"\")) { // all the white spaces are removed as if not removed then lemmatization wont be successfully done\n\n termWord = Lemmatize(termWord);\n System.out.println(termWord);\n if(dictionary.containsKey(termWord)) {\n List<Integer> wordList = new ArrayList<>();\n wordList = dictionary.get(termWord);\n int queryWordFrequency = wordList.get(totaldocument);\n queryWordFrequency++;\n wordList.set(totaldocument, queryWordFrequency); // all the frequencies of the query words are stored at the 56th index of the List stored in the\n //hashmap associated with its word-terms\n dictionary.put(termWord, wordList);\n }\n else {\n //if any of the enterd query word not present in all the docs so list will have 0.0 value from 0th index to 55th and 56th index is reserver\n // for query word frequency\n List<Integer> wordList = new ArrayList<>();\n for(int j=0; j<totaldocument+1; j++) {\n wordList.add(0);\n }\n wordList.add(1);\n dictionary.put(termWord, wordList); //updating the dictionary hashmap now containing all the query words frequencies\n }\n }\n }\n save();\n }", "private ArrayList<TweetData> query(QueryTargetInfo info) {\n String url;\n ArrayList<TweetData> tweets = new ArrayList<TweetData>();\n InputStream is = null;\n\n // lastSeenId should have been set earlier.\n // However, if it is still null, just use \"0\".\n if (info.lastSeenId == null) {\n url = String.format(\"%s?q=%s&count=%d&result_type=recent&since_id=0\",\n URL_BASE, info.query, RPP);\n } else if (info.smallestId == null) {\n url = String.format(\"%s?q=%s&count=%d&result_type=recent&since_id=%s\",\n URL_BASE, info.query, RPP, info.lastSeenId);\n } else {\n url = String.format(\"%s?q=%s&count=%d&result_type=recent&since_id=%s&max_id=%s\",\n URL_BASE, info.query, RPP, info.lastSeenId, info.smallestId);\n }\n\n try {\n do {\n URL searchURL = new URL(url);\n HttpsURLConnection searchConnection = (HttpsURLConnection)searchURL.openConnection();\n\n searchConnection.setRequestProperty(\"Host\", \"api.twitter.com\");\n searchConnection.setRequestProperty(\"User-Agent\", \"BirdCatcher\");\n searchConnection.setRequestProperty(\"Authorization\", \"Bearer \" + kBearerToken);\n\n is = searchConnection.getInputStream();\n\n JSONTokener jsonTokener = new JSONTokener(is);\n\n JSONObject json = new JSONObject(jsonTokener);\n\n is.close();\n\n url = getNextLink(json, url, info);\n\n tweets.addAll(getTweets(json, info));\n\n Thread.sleep(1000);\n\n is = null;\n } while (url != null);\n } catch (Exception e) {\n Logger.logError(\"Error performing query\", e);\n\n if (is != null) {\n try {\n java.io.BufferedReader in =\n new java.io.BufferedReader(new java.io.InputStreamReader(is));\n\n String response = \"Response from Twitter:\\n\";\n String temp;\n\n while ((temp = in.readLine()) != null) {\n response += (temp + \"\\n\");\n }\n\n Logger.logDebug(response);\n\n response = null;\n temp = null;\n } catch (Exception ex) {\n }\n }\n\n return tweets;\n }\n\n return tweets;\n }", "public void analyzequery(JSONObject json) {\n\t\ttry {\n\t\t\t\n\t\t\tJSONArray jarray = json.getJSONArray(\"Reviews\");\n\t\t\t\n\t\t\tfor (int i = 0; i < jarray.length(); i++) {\n\t\t\t\t\n\t\t\t\tPost review = new Post(jarray.getJSONObject(i));\n\t\t\t\tSystem.out.println(\"55\");\n\t\t\t\tString content = review.getContent();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\tHashMap<String, Integer> querytf = new HashMap<String, Integer>();\n\n\t\t\t\tHashSet<String> biminiset = new HashSet<String>();\n\n\t\t\t\tArrayList uniquery = new ArrayList();\n\n\t\t\t\tfor (String token : tokenizer.tokenize(content)) {\n\t\t\t\t\tif (m_stopwords.contains(token))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (token.isEmpty())\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tuniquery.add(PorterStemmingDemo(SnowballStemmingDemo(NormalizationDemo(token))));\n\n\t\t\t\t}\n\n\t\t\t\tfor (int k = 0; k < uniquery.size(); k++) {\n\n\t\t\t\t\tif (querytf.containsKey(uniquery.get(i).toString())) {\n\t\t\t\t\t\tquerytf.put(uniquery.get(i).toString(),\n\t\t\t\t\t\t\t\tquerytf.get(uniquery.get(i).toString()) + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquerytf.put(uniquery.get(i).toString(), 1);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tArrayList<String> N_gram = new ArrayList<String>();\n\n\t\t\t\tfor (String token : tokenizer.tokenize(content)) {\n\n\t\t\t\t\ttoken = PorterStemmingDemo(SnowballStemmingDemo(NormalizationDemo(token)));\n\t\t\t\t\tif (token.isEmpty()) {\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tN_gram.add(token);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tString[] fine = new String[N_gram.size()];\n\n\t\t\t\tfor (int p = 0; p < N_gram.size() - 1; p++) {\n\t\t\t\t\tif (m_stopwords.contains(N_gram.get(p)))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (m_stopwords.contains(N_gram.get(p + 1)))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tfine[p] = N_gram.get(p) + \"-\" + N_gram.get(p + 1);\n\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\tfor (String str2 : fine) {\n\n\t\t\t\t\tif (querytf.containsKey(str2)) {\n\t\t\t\t\t\tquerytf.put(str2, querytf.get(str2) + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquerytf.put(str2, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (String key : querytf.keySet()) {\n\t\t\t\t\tif (m_stats.containsKey(key)) {\n\t\t\t\t\t\tdouble df = (double) m_stats.get(key);\n\n\t\t\t\t\t\tdouble idf = (1 + Math.log(102201 / df));\n\n\t\t\t\t\t\tdouble tf = querytf.get(key);\n\n\t\t\t\t\t\tdouble result = tf * idf;\n\n\t\t\t\t\t\tquery_idf.put(key, result);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquery_idf.put(key, 0.0);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\tcatch (JSONException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t}", "public static void query(String q) throws TwitterException, SQLException, ClassNotFoundException {\n\n\t\t//the search object returns a list of all the tweets from the query string q\n\t\tSearch newQuery = new Search(q);\n\t\t\n\t\tClass.forName(\"org.h2.Driver\");\n\t\tConnection conn = DriverManager.getConnection(DB, user, pass);\n\t\t\n\t\t//authentication allows a user to have up to 350 requests per hour over the normal 150\n\t\tTwitter a = OAuth.authenticate();\n\n\t\ttry {\n\t\t\tArrayList<Long> sid = new ArrayList<Long>();\n\t\t\tfor (Tweet tweets : newQuery.statusList) {\n\t\t\t\tlong statusID = tweets.getId();\n\t\t\t\t//this checks for redudant statuses then inserts new ones into the DB\n\t\t\t\tif (!(DB_Interface.exist_Status(statusID, conn))) {\n\t\t\t\t\tSystem.out.println(\"Preparin new insert of status \"\n\t\t\t\t\t\t\t+ statusID);\n\t\t\t\t\tsid.add(statusID);\n\t\t\t\t\t\n\t\t\t\t\t/* a.showStatus transforms a query tweet into a normal status this takes up a rate limit\n\t\t\t\t\t * this is a difficult problem to address because scraped tweets and streamed tweets are\n\t\t\t\t\t * formatted as a normal status, but only queried tweets are structured this way\n\t\t\t\t\t */\n\t\t\t\t\tDB_Interface.insertTweet(conn, a.showStatus(statusID));\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Status Already exists!!!!\");\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (JdbcSQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tconn.close();\n\n\t}", "void updateAllFilteredLists(Set<String> keywords, Calendar startDate, Calendar endDate,\n Entry.State state, Search... searches);", "public PostingsList phrase_query(Query query){\n\n LinkedList<PostingsList> listQueriedPostings = new LinkedList<PostingsList>();\n // List with postings corresponding to the queries\n for (int i = 0; i<query.size(); i++){\n // If any query has zero matches, return 0 results\n //if(!(new File(\"postings/t\"+hash(query.terms.get(i))+\".json\")).exists()){\n if (!this.index.containsKey(query.terms.get(i))){\n return null;\n }\n // Otherwise store postings in the list\n listQueriedPostings.add(this.getPostings(query.terms.get(i)));\n }\n\n PostingsList result = new PostingsList();\n result = listQueriedPostings.get(0);\n\n // In case only one word is queried\n if (listQueriedPostings.size() == 1){\n return result;\n }\n\n // Apply algorithm as many times as words in the query\n for(int i = 1; i < listQueriedPostings.size(); i++){\n result = phrase_query(result, listQueriedPostings.get(i));\n if (result.isEmpty()){\n return null;\n }\n }\n return result;\n }", "private List<String> buildUpAlternateQueries(SolrParams solrParams, List<List<TextInQuery>> textsInQueryLists) {\n \n String originalUserQuery = getQueryStringFromParser();\n \n if (textsInQueryLists.isEmpty()) {\n return Collections.emptyList();\n }\n \n // initialize results\n List<AlternateQuery> alternateQueries = new ArrayList<>();\n for (TextInQuery textInQuery : textsInQueryLists.get(0)) {\n // add the text before the first user query token, e.g. a space or a \"\n StringBuilder stringBuilder = new StringBuilder(\n originalUserQuery.subSequence(0, textInQuery.getStartPosition()))\n .append(textInQuery.getText());\n alternateQueries.add(new AlternateQuery(stringBuilder, textInQuery.getEndPosition()));\n }\n \n for (int i = 1; i < textsInQueryLists.size(); i++) {\n List<TextInQuery> textsInQuery = textsInQueryLists.get(i);\n \n // compute the length in advance, because we'll be adding new ones as we go\n int alternateQueriesLength = alternateQueries.size();\n \n for (int j = 0; j < alternateQueriesLength; j++) {\n \n // When we're working with a lattice, assuming there's only one path to take in the next column,\n // we can (and MUST) use all the original objects in the current column.\n // It's only when we have >1 paths in the next column that we need to start taking copies.\n // So if a lot of this logic seems tortured, it's only because I'm trying to minimize object\n // creation.\n AlternateQuery originalAlternateQuery = alternateQueries.get(j);\n \n boolean usedFirst = false;\n \n for (int k = 0; k < textsInQuery.size(); k++) {\n \n TextInQuery textInQuery = textsInQuery.get(k);\n if (originalAlternateQuery.getEndPosition() > textInQuery.getStartPosition()) {\n // cannot be appended, e.g. \"canis\" token in \"canis familiaris\"\n continue;\n }\n \n AlternateQuery currentAlternateQuery;\n \n if (!usedFirst) {\n // re-use the existing object\n usedFirst = true;\n currentAlternateQuery = originalAlternateQuery;\n \n if (k < textsInQuery.size() - 1) {\n // make a defensive clone for future usage\n originalAlternateQuery = (AlternateQuery) currentAlternateQuery.clone();\n }\n } else if (k == textsInQuery.size() - 1) {\n // we're sure we're the last one to use it, so we can just use the original clone\n currentAlternateQuery = originalAlternateQuery;\n alternateQueries.add(currentAlternateQuery);\n } else {\n // need to clone to a new object\n currentAlternateQuery = (AlternateQuery) originalAlternateQuery.clone();\n alternateQueries.add(currentAlternateQuery);\n }\n // text in the original query between the two tokens, usually a space, comma, etc.\n CharSequence betweenTokens = originalUserQuery.subSequence(\n currentAlternateQuery.getEndPosition(), textInQuery.getStartPosition());\n currentAlternateQuery.getStringBuilder().append(betweenTokens).append(textInQuery.getText());\n currentAlternateQuery.setEndPosition(textInQuery.getEndPosition());\n }\n }\n }\n \n //Make sure result is unique\n HashSet<String> result = new LinkedHashSet<>();\n \n for (AlternateQuery alternateQuery : alternateQueries) {\n \n StringBuilder sb = alternateQuery.getStringBuilder();\n \n // append whatever text followed the last token, e.g. '\"'\n sb.append(originalUserQuery.subSequence(alternateQuery.getEndPosition(), originalUserQuery.length()));\n \n result.add(sb.toString());\n }\n return new ArrayList<>(result);\n }", "public void updateUnseenTermInThisQuery(int relevanceFeedbackMethod) {\n System.out.println(\"Nomor Query Lama : \" + listDocumentRetrievedForThisQuery.getQuery().getIndex());\n System.out.println(\"Isi Query Lama : \" + listDocumentRetrievedForThisQuery.getQuery().getQueryContent());\n int thisQueryIndex = listDocumentRetrievedForThisQuery.getQuery().getIndex();\n for (Map.Entry m : invertedFile.getListTermWeights().entrySet()) {\n String keyTerm = (String) m.getKey();\n if (!isTermAppearInQuery(keyTerm)) {\n double newWeight = computeNewWeightTerm(relevanceFeedbackMethod,keyTerm,0.0);\n if (newWeight > 0) {\n String filteredWord = \"\";\n if (invertedFile.isStemmingApplied()) {\n filteredWord = invertedFile.getMappingStemmedTermToNormalTerm().get(keyTerm);\n } else {\n filteredWord = keyTerm;\n }\n newQueryComposition.put(filteredWord,newWeight);\n invertedFileQuery.insertRowTable(keyTerm,thisQueryIndex,newWeight);\n normalFileQuery.insertElement(thisQueryIndex,keyTerm);\n }\n }\n }\n System.out.println(\"Nomor Query Baru : \" + convertNewQueryComposition().getIndex());\n System.out.println(\"Isi Query Baru : \" + convertNewQueryComposition().getQueryContent());\n }", "public void newQuery(String query){\n for(RecyclerViewWrapper wrapper : mRecyclerViews){\n wrapper.data.clear();\n wrapper.adapter.notifyDataSetChanged();\n Log.d(TAG, \"Test: \" + wrapper.data.size());\n }\n\n mQueryManager.searchAll(query);\n }", "private void updateAll() {\n updateAction();\n updateQueryViews();\n }", "public void getTweets() {\r\n\t\t\r\n\t\tConfigurationBuilder cb = new ConfigurationBuilder();\r\n\t\tcb.setDebugEnabled(true);\r\n\t\t\r\n\t\t//provide your own keys\r\n\t cb.setOAuthConsumerKey(\"ConsumerKey\");\r\n\t cb.setOAuthConsumerSecret(\"ConsumerSecret\");\r\n\t cb.setOAuthAccessToken(\"AccessToken\");\r\n\t cb.setOAuthAccessTokenSecret(\"TokenSecret\");\r\n\r\n TwitterStream twitterStream = new TwitterStreamFactory(cb.build()).getInstance(); \r\n \r\n //Check for live status updates\r\n StatusListener listener = new StatusListener() {\r\n\r\n @Override\r\n public void onException(Exception arg0) {\r\n \tSystem.out.println(\"Exception!! Data Not Inserted Into Database\");\r\n }\r\n\r\n @Override\r\n public void onDeletionNotice(StatusDeletionNotice arg0) {\r\n \tSystem.out.println(\"Got a status deletion notice id:\" + arg0.getStatusId());\r\n }\r\n \r\n @Override\r\n public void onScrubGeo(long userId, long upToStatusId) {\r\n System.out.println(\"Got scrub_geo event userId:\" + userId + \" upToStatusId:\" + upToStatusId);\r\n }\r\n \r\n @Override\r\n public void onStatus(Status status) {\r\n \t\r\n \t User user = status.getUser();\r\n \t \r\n String username = status.getUser().getScreenName();\r\n String profileLocation = user.getLocation();\r\n long tweetId = status.getId(); \r\n String content = status.getText();\r\n \r\n \r\n //Create a model for the live data\r\n TweetModel memoryData = new TweetModel(username, profileLocation, tweetId, content);\r\n \r\n //store to MongoDB if data is correct\r\n System.out.println(++counter + \") username: \" + username + \" location: \" + profileLocation + \" tweetId \" + tweetId + \" Text: \" + content );\r\n data.save(memoryData);\r\n }\r\n \r\n\t\t\t@Override\r\n public void onTrackLimitationNotice(int arg0) {\r\n\t System.out.println(\"Got track limitation notice:\" + arg0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void onStallWarning(StallWarning warning) {}\r\n };\r\n \r\n //Filter the live tweet results\r\n FilterQuery filterQuery = new FilterQuery();\r\n //Search for tweets with specific keywords\r\n String keywords[] = {\"Java\", \"Python\", \"PHP\"};\r\n //Restrict the language to English\r\n String[] lang = {\"en\"}; \r\n //Add the Filters\r\n filterQuery.language(lang);\r\n filterQuery.track(keywords);\r\n //Listen for Live Tweets\r\n twitterStream.addListener(listener);\r\n twitterStream.filter(filterQuery);\r\n\t}", "public void update() {\r\n if (parseStyle == ParseStyle.CHARACTER) {\r\n wrapText();\r\n int begin = getPosition();\r\n int end = getPosition() + 1;\r\n setCurrentItem(new TextItem(begin, end, getText().substring(begin,\r\n end)));\r\n setPosition(end);\r\n } else if (parseStyle == ParseStyle.WORD) {\r\n if (matcher == null) {\r\n return;\r\n }\r\n wrapText();\r\n boolean matchFound = findNextToken();\r\n if (matchFound) {\r\n selectCurrentToken();\r\n } else {\r\n // No match found. Go back to the beginning of the text area\r\n // and select the first token found\r\n setPosition(0);\r\n updateMatcher();\r\n // Having wrapped to the beginning select the next token, if\r\n // there is one.\r\n if (findNextToken()) {\r\n selectCurrentToken();\r\n }\r\n }\r\n }\r\n\r\n }", "@Override\n protected Void doInBackground(Void... params) {\n try {\n Query query = new Query(\"India\"); //\n\n GeoLocation location = new GeoLocation(mLastLocation.getLatitude(), mLastLocation.getLongitude()); //latitude, longitude\n\n query.setGeoCode(location, 1, Query.MILES); //location, radius, unit\n query.setSinceId(latestTweetId);\n QueryResult result;\n\n do {\n result = twitter.search(query);\n\n\n for (twitter4j.Status tweet : result.getTweets()) {\n\n if(tweet.getGeoLocation()!=null){\n\n newTweets.add(tweet);\n long id = tweet.getId();\n\n if(id>latestTweetId){\n\n latestTweetId = id;\n }\n\n }\n\n System.out.println(\"@\" + tweet.getUser().getScreenName() + \" - \" + tweet.getText());\n }\n\n } while ((query = result.nextQuery()) != null);\n\n } catch (TwitterException te) {\n System.out.println(\"Failed to search tweets: \" + te.getMessage());\n }\n return null;\n }", "@Override\n public void run() {\n try {\n\n try {\n mLastLocation = LocationServices.FusedLocationApi.getLastLocation(\n googleApiClient);\n } catch (SecurityException e) {\n e.printStackTrace();\n }\n\n if (mLastLocation != null) {\n\n\n Query query = new Query(\"India\"); //\n\n GeoLocation location = new GeoLocation(mLastLocation.getLatitude(), mLastLocation.getLongitude()); //latitude, longitude\n\n query.setGeoCode(location, 5, Query.MILES); //location, radius, unit\n query.setSinceId(latestTweetId);\n QueryResult result;\n\n do {\n result = twitter.search(query);\n\n for (twitter4j.Status tweet : result.getTweets()) {\n\n if (tweet.getGeoLocation() != null) {\n\n newTweets.add(tweet);\n long id = tweet.getId();\n\n if (id > latestTweetId) {\n\n latestTweetId = id;\n }\n\n }\n\n System.out.println(\"@\" + tweet.getUser().getScreenName() + \" - \" + tweet.getText());\n }\n\n } while ((query = result.nextQuery()) != null);\n\n handler.sendEmptyMessage(1);\n }\n\n }catch(TwitterException te){\n System.out.println(\"Failed to search tweets: \" + te.getMessage());\n }\n\n\n\n\n\n }", "void updateFilteredTaskList(Set<String> keywords);", "public void setSpellQuery(String query) {\n\t\tspellQuery.setText(query);\n\t}", "private void populateAdapter(String query) {\n // Create a matrixcursor, add suggtion strings into cursor\n final MatrixCursor c = new MatrixCursor(new String[]{ BaseColumns._ID, SearchManager.SUGGEST_COLUMN_TEXT_1 });\n List<String> suggestions = History.getSuggestion(query);\n String str = \"\";\n for (int i=0;i<suggestions.size();i++){\n c.addRow(new Object[] {i, suggestions.get(i)});\n str += suggestions.get(i);\n }\n Toast.makeText(context, str,Toast.LENGTH_SHORT).show();\n mAdapter.changeCursor(c);\n }", "private List<Query> generateSynonymQueries(Analyzer synonymAnalyzer, SolrParams solrParams) {\n\n\tString origQuery = getQueryStringFromParser();\n\tint queryLen = origQuery.length();\n\t\n // TODO: make the token stream reusable?\n TokenStream tokenStream = synonymAnalyzer.tokenStream(Const.IMPOSSIBLE_FIELD_NAME,\n new StringReader(origQuery));\n \n SortedSetMultimap<Integer, TextInQuery> startPosToTextsInQuery = TreeMultimap.create();\n \n \n boolean constructPhraseQueries = solrParams.getBool(Params.SYNONYMS_CONSTRUCT_PHRASES, false);\n \n boolean bag = solrParams.getBool(Params.SYNONYMS_BAG, false);\n List<String> synonymBag = new ArrayList<>();\n \n try {\n tokenStream.reset();\n while (tokenStream.incrementToken()) {\n CharTermAttribute term = tokenStream.getAttribute(CharTermAttribute.class);\n OffsetAttribute offsetAttribute = tokenStream.getAttribute(OffsetAttribute.class);\n TypeAttribute typeAttribute = tokenStream.getAttribute(TypeAttribute.class);\n \n if (!typeAttribute.type().equals(\"shingle\")) {\n // ignore shingles; we only care about synonyms and the original text\n // TODO: filter other types as well\n \n String termToAdd = term.toString();\n \n if (typeAttribute.type().equals(\"SYNONYM\")) {\n synonymBag.add(termToAdd); \t\n }\n \n //Don't quote sibgle term term synonyms\n\t\t if (constructPhraseQueries && typeAttribute.type().equals(\"SYNONYM\") &&\n\t\t\ttermToAdd.contains(\" \")) \n\t\t {\n\t\t \t//Don't Quote when original is already surrounded by quotes\n\t\t \tif( offsetAttribute.startOffset()==0 || \n\t\t \t offsetAttribute.endOffset() == queryLen ||\n\t\t \t origQuery.charAt(offsetAttribute.startOffset()-1)!='\"' || \n\t\t \t origQuery.charAt(offsetAttribute.endOffset())!='\"')\n\t\t \t{\n\t\t \t // make a phrase out of the synonym\n\t\t \t termToAdd = new StringBuilder(termToAdd).insert(0,'\"').append('\"').toString();\n\t\t \t}\n\t\t }\n if (!bag) {\n // create a graph of all possible synonym combinations,\n // e.g. dog bite, hound bite, dog nibble, hound nibble, etc.\n\t TextInQuery textInQuery = new TextInQuery(termToAdd, \n\t offsetAttribute.startOffset(), \n\t offsetAttribute.endOffset());\n\t \n\t startPosToTextsInQuery.put(offsetAttribute.startOffset(), textInQuery);\n }\n }\n }\n tokenStream.end();\n } catch (IOException e) {\n throw new RuntimeException(\"uncaught exception in synonym processing\", e);\n } finally {\n try {\n tokenStream.close();\n } catch (IOException e) {\n throw new RuntimeException(\"uncaught exception in synonym processing\", e);\n }\n }\n \n List<String> alternateQueries = synonymBag;\n \n if (!bag) {\n // use a graph rather than a bag\n\t List<List<TextInQuery>> sortedTextsInQuery = new ArrayList<>(\n startPosToTextsInQuery.values().size());\n sortedTextsInQuery.addAll(startPosToTextsInQuery.asMap().values().stream().map(ArrayList::new).collect(Collectors.toList()));\n\t \n\t // have to use the start positions and end positions to figure out all possible combinations\n\t alternateQueries = buildUpAlternateQueries(solrParams, sortedTextsInQuery);\n }\n \n // save for debugging purposes\n expandedSynonyms = alternateQueries;\n \n return createSynonymQueries(solrParams, alternateQueries);\n }", "public void parseAndRankQuery(String stringNumber) throws Exception {\n\n if (this.semantics) { //if the user choose semantic\n semantic=new ArrayList<>();\n Word2VecModel model = Word2VecModel.fromTextFile(new File(\"word2vec.c.output.model.txt\"));\n com.medallia.word2vec.Searcher semanticSearchrt = model.forSearch();\n int num = 10;\n String[] semanQuery = query.split(\" \");\n for (String s : semanQuery)\n {\n try {\n List<com.medallia.word2vec.Searcher.Match> matches = semanticSearchrt.getMatches(s.toLowerCase(), num);\n for (com.medallia.word2vec.Searcher.Match match : matches) {\n match.match();\n }\n if(matches.get(0).equals(s)) {\n query = query + \" \" + matches.get(1);\n String dd=\"\"+matches.get(1);\n semantic.add(dd);\n }\n else {\n query = query + \" \" + matches.get(0); //add to query the high semantics 3 top words score\n String dd=\"\"+matches.get(0);\n semantic.add(dd);\n }\n } catch(com.medallia.word2vec.Searcher.UnknownWordException e){\n }\n }\n }\n\n ranker = new Ranker(this.indexer,stringNumber,path,originalString); // new ranker\n ArrayList<String> cleanQuery;\n ArrayList<String> parsedQueryList;\n ReadFile rd=new ReadFile();\n cleanQuery=rd.cleanLine(stemming,query); //clean the query from dots and other signs\n HashMap<String, Pair<Integer,String>> parsedQuery=new HashMap<>();\n parsedQuery=parser.Tokenizer(cleanQuery,\"\",stemming); //parse the query\n Iterator it = parsedQuery.entrySet().iterator();\n parsedQueryList=new ArrayList<>();\n while (it.hasNext()) {\n Map.Entry pair = (Map.Entry)it.next();\n parsedQueryList.add((String)pair.getKey());\n it.remove(); // avoids a ConcurrentModificationException\n }\n ranker.setParseredQuery(parsedQueryList);\n try {\n ranker.orgByPostFile();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "private void refreshSuggestions() {\n \t\tString text = textBox.getText();\n \t\tif (text.equals(currentText)) {\n \t\t\treturn;\n \t\t} else {\n \t\t\tcurrentText = text;\n \t\t}\n \t\tfindSuggestions(text);\n \t}", "private void updates() {\n \tDBPeer.fetchTableRows();\n DBPeer.fetchTableIndexes();\n \n for (Update update: updates) {\n \tupdate.init();\n }\n }", "private ArrayList<WordDocument> executeRegularQuery(){\n String[] splitedQuery = this.query.split(\" \");\n ArrayList<WordDocument> listOfWordDocuments = new ArrayList<WordDocument>();\n String word = \"\";\n\n for(int i = 0; i < splitedQuery.length; i++){\n if(!isOrderByCommand(splitedQuery[i]) && i == 0) {\n word = splitedQuery[i];\n\n if(cache.isCached(word))\n addWithoutDuplicate(listOfWordDocuments, cache.getCachedResult(word));\n else\n addWithoutDuplicate(listOfWordDocuments, getDocumentsWhereWordExists(word));\n\n }else if(i >= 1 && isOrderByCommand(splitedQuery[i])) {\n subQueries.add(word);\n listOfWordDocuments = orderBy(listOfWordDocuments, splitedQuery[++i], splitedQuery[++i]);\n break;\n }\n else\n throw new IllegalArgumentException();\n }\n\n return listOfWordDocuments;\n }", "private List<Query> createSynonymQueries(SolrParams solrParams, List<String> alternateQueryTexts) {\n \n String nullsafeOriginalString = getQueryStringFromParser();\n \n List<Query> result = new ArrayList<>();\n for (String alternateQueryText : alternateQueryTexts) {\n if (alternateQueryText.equalsIgnoreCase(nullsafeOriginalString)) { \n // alternate query is the same as what the user entered\n continue;\n }\n \n synonymQueryParser.setString(alternateQueryText);\n try {\n result.add(synonymQueryParser.parse());\n } catch (SyntaxError e) {\n // TODO: better error handling - for now just bail out; ignore this synonym\n e.printStackTrace(System.err);\n }\n }\n \n return result;\n }", "private HashMap<String,HashMap<String,Integer>> computeTFForQueryWords(ArrayList<String> queryPostingLines) {\n HashMap<String,HashMap<String,Integer>> queryWordsTF = new HashMap<>();\n HashMap<String,HashMap<String,Integer>> queryWordsTFPerDoc = new HashMap<>();\n String docID,term;\n Integer tf;\n HashSet<String> docIDs = new HashSet<>();\n for(String postingLine : queryPostingLines){\n HashMap<String,Integer> frequenciesInDocuments = new HashMap<>();\n term = postingLine.substring(0,postingLine.indexOf(\"|\"));\n postingLine = postingLine.substring(postingLine.indexOf(\"|\")+1);\n while(!postingLine.equals(\"\")) {\n docID = postingLine.substring(0, postingLine.indexOf(\":\"));\n docIDs.add(docID);\n postingLine = postingLine.substring(postingLine.indexOf(\"_\") + 1);\n tf = Integer.valueOf(postingLine.substring(0, postingLine.indexOf(\"_\")));\n postingLine = postingLine.substring(postingLine.indexOf(\"_\") + 1);\n frequenciesInDocuments.put(docID,tf);\n }\n queryWordsTF.put(term,frequenciesInDocuments);\n }\n\n ArrayList<String> allTermsInQuery = new ArrayList<>(queryWordsTF.keySet());\n for(String doc : docIDs){\n HashMap<String,Integer> tfsInDoc = new HashMap<>();\n for(String termInQuery : allTermsInQuery){\n HashMap<String,Integer> termsTFInDoc = queryWordsTF.get(termInQuery);\n if(termsTFInDoc.containsKey(doc)){\n tfsInDoc.put(termInQuery,termsTFInDoc.get(doc));\n }\n }\n queryWordsTFPerDoc.put(doc,tfsInDoc);\n }\n return queryWordsTFPerDoc;\n }", "private void addQueries(String query){\n ArrayList <String> idsFullSet = new ArrayList <String>(searchIDs);\n while(idsFullSet.size() > 0){\n ArrayList <String> idsSmallSet = new ArrayList <String>(); \n if(debugMode) {\n System.out.println(\"\\t Pmids not used in query available : \" + idsFullSet.size());\n }\n idsSmallSet.addAll(idsFullSet.subList(0,Math.min(getSearchIdsLimit(), idsFullSet.size())));\n idsFullSet.removeAll(idsSmallSet);\n String idsConstrain =\"\";\n idsConstrain = idsConstrain(idsSmallSet);\n addQuery(query,idsConstrain);\n }\n }", "public void initAllPhrases() {\n\t\t// firstly tell the view clear its history content.\n\t\tview.clearPhraseTabelContent();\n\n\t\tfor (Phrase p : selectedLesson.getAllPhrases()) {\n\t\t\tview.addPhrase(p);\n\t\t}\n\n\t}", "public void update() {\n suggestions = model.getDebtRepaymentSuggestions();\n }", "private void populateDictionaryBySynonyms() {\n\n Enumeration e = dictionaryTerms.keys();\n while (e.hasMoreElements()) {\n String word = (String) e.nextElement();\n String tag = dictionaryTerms.get(word);\n\n ArrayList<String> synonyms = PyDictionary.findSynonyms(word);\n\n for (int i = 0; i < synonyms.size(); i++) {\n if (!dictionaryTerms.containsKey(synonyms.get(i))) {\n dictionaryTerms.put(synonyms.get(i), tag);\n }\n }\n }\n }", "public PostingsList phrase_query(PostingsList l1, PostingsList l2){\n\n PostingsList phrase = new PostingsList();\n\n // Counters to iterate docIDs\n int count1 = 0;\n int count2 = 0;\n // Counters to iterate positional indices\n int subcount1 = 0;\n int subcount2 = 0;\n\n // First posting\n PostingsEntry p1 = l1.get(0);\n PostingsEntry p2 = l2.get(0);\n\n // List of positional indices (changes at each iteration)\n LinkedList<Integer> ll1;\n LinkedList<Integer> ll2;\n\n // Used to store positional index\n int pp1;\n int pp2;\n\n while(true){\n // docID match (1/2) //\n if (p1.docID == p2.docID){\n // Obtain list of positional indices\n ll1 = p1.positions;\n ll2 = p2.positions;\n // First positional indices\n pp1 = ll1.get(0);\n pp2 = ll2.get(0);\n // Initialize counter\n subcount1 = 0;\n subcount2 = 0;\n\n // Search if the phrase exists\n while(true){\n // Match, consecutive words (2/2) - EUREKA! //\n if (pp1+1 == pp2){\n // Save found match (docID and positional index of last\n // word)\n phrase.insert(p1.docID, pp2);\n // Increase counters and pos indices if list is not finished\n subcount1++;\n subcount2++;\n if (subcount1<ll1.size() && subcount2<ll2.size()){\n pp1 = ll1.get(subcount1);\n pp2 = ll2.get(subcount2);\n }\n // If list finished, break\n else\n break;\n }\n // Not match\n else if (pp1+1 < pp2){\n subcount1++;\n if (subcount1<ll1.size())\n pp1 = ll1.get(subcount1);\n // If list finished, break\n else\n break;\n }\n // Not match\n else{\n subcount2++;\n if (subcount2<ll2.size())\n pp2 = ll2.get(subcount2);\n else\n break;\n }\n }\n\n // Once we finished looking at the list of positional indices of one\n // posting, increase counters and go to next postings (if there are)\n count1++;\n count2++;\n if (count1<l1.size() && count2<l2.size()){\n p1 = l1.get(count1);\n p2 = l2.get(count2);\n }\n else{\n break;\n }\n }\n // docID not match, increase lowest counter\n else if (p1.docID < p2.docID){\n count1++;\n if (count1<l1.size()){\n p1 = l1.get(count1);\n }\n else{\n break;\n }\n }\n // docID not match, increase lowest counter\n else{\n count2++;\n if (count2<l2.size()){\n p2 = l2.get(count2);\n }\n else{\n break;\n }\n }\n }\n\n return phrase;\n }", "private void updateWordsDisplayed() {\n \t\tcurrFirstLetters.remove(wordsList[wordsDisplayed[currWordIndex]].charAt(0));\n \t\twhile (currFirstLetters.contains(wordsList[nextWordIndex].charAt(0))) {\n \t\t\tnextWordIndex++;\n \t\t\tif (nextWordIndex >= wordsList.length) {\n \t\t\t\tnextWordIndex = 0;\n \t\t\t}\n \t\t}\n \t\tcurrFirstLetters.add(wordsList[nextWordIndex].charAt(0));\n \t\twordsDisplayed[currWordIndex] = nextWordIndex;\n \t\tnextWordIndex++;\n \t\tif (nextWordIndex >= wordsList.length) {\n \t\t\tnextWordIndex = 0;\n \t\t}\n \t\tsetChanged();\n \t\tnotifyObservers(States.update.FINISHED_WORD);\n \t}", "@Override\n public void update(String tweet, Long tweetTime) {\n\tuserFeed.add(tweet);\n\tlastUpdateTime = tweetTime;\n }", "protected void updateTokens(){}", "void updateFilteredPersonList(Set<String> keywords);", "@Test\n public void testUpdateQuery() {\n LayersViewController instance = LayersViewController.getDefault().init(null);\n String queryString1 = \"Type == 'Word'\";\n int index1 = 2;\n Query query1 = new Query(GraphElementType.VERTEX, \"Type == 'Event'\");\n instance.getVxQueryCollection().getQuery(index1).setQuery(query1);\n instance.getTxQueryCollection().getQuery(index1).setQuery(null);\n assertEquals(instance.getVxQueryCollection().getQuery(index1).getQueryString(), \"Type == 'Event'\");\n\n instance.updateQuery(queryString1, index1, \"Vertex Query: \");\n assertEquals(instance.getVxQueryCollection().getQuery(index1).getQueryString(), queryString1);\n\n String queryString2 = \"Type == 'Unknown'\";\n int index2 = 3;\n Query query2 = new Query(GraphElementType.TRANSACTION, \"Type == 'Network'\");\n instance.getTxQueryCollection().getQuery(index2).setQuery(query2);\n instance.getVxQueryCollection().getQuery(index2).setQuery(null);\n assertEquals(instance.getTxQueryCollection().getQuery(index2).getQueryString(), \"Type == 'Network'\");\n \n instance.updateQuery(queryString2, index2, \"Transaction Query: \");\n assertEquals(instance.getTxQueryCollection().getQuery(index2).getQueryString(), queryString2);\n\n }", "public void reloadAll() {\n for (String str : this.mTunableLookup.keySet()) {\n String stringForUser = Settings.Secure.getStringForUser(this.mContentResolver, str, this.mCurrentUser);\n for (TunerService.Tunable tunable : this.mTunableLookup.get(str)) {\n tunable.onTuningChanged(str, stringForUser);\n }\n }\n }", "public void indexCreate()\n {\n try{\n Directory dir = FSDirectory.open(Paths.get(\"indice/\"));\n Analyzer analyzer = new StandardAnalyzer();\n IndexWriterConfig iwc = new IndexWriterConfig(analyzer);\n iwc.setOpenMode(OpenMode.CREATE);\n IndexWriter writer = new IndexWriter(dir,iwc);\n MongoConnection mongo = MongoConnection.getMongo();\n mongo.OpenMongoClient();\n DBCursor cursor = mongo.getTweets();\n Document doc = null;\n\n while (cursor.hasNext()) {\n DBObject cur = cursor.next();\n if (cur.get(\"retweet\").toString().equals(\"false\")) {\n doc = new Document();\n doc.add(new StringField(\"id\", cur.get(\"_id\").toString(), Field.Store.YES));\n doc.add(new TextField(\"text\", cur.get(\"text\").toString(), Field.Store.YES));\n doc.add(new StringField(\"analysis\", cur.get(\"analysis\").toString(), Field.Store.YES));\n //doc.add(new StringField(\"finalCountry\",cur.get(\"finalCountry\").toString(),Field.Store.YES));\n doc.add(new StringField(\"userScreenName\", cur.get(\"userScreenName\").toString(), Field.Store.YES));\n doc.add(new StringField(\"userFollowersCount\", cur.get(\"userFollowersCount\").toString(), Field.Store.YES));\n doc.add(new StringField(\"favoriteCount\", cur.get(\"favoriteCount\").toString(), Field.Store.YES));\n\n if (writer.getConfig().getOpenMode() == OpenMode.CREATE) {\n System.out.println(\"Indexando el tweet: \" + doc.get(\"text\") + \"\\n\");\n writer.addDocument(doc);\n System.out.println(doc);\n } else {\n System.out.println(\"Actualizando el tweet: \" + doc.get(\"text\") + \"\\n\");\n writer.updateDocument(new Term(\"text\" + cur.get(\"text\")), doc);\n System.out.println(doc);\n }\n }\n }\n cursor.close();\n writer.close();\n }\n catch(IOException ioe){\n System.out.println(\" Error en \"+ ioe.getClass() + \"\\n mensaje: \" + ioe.getMessage());\n }\n }", "public void updateResults(String s) {\n ArrayList<String> tempName = new ArrayList<String>();\n ArrayList<String> tempUid = new ArrayList<String>();\n for(int i=0;i<userName.size();i++){\n if(userName.get(i).toLowerCase().contains(s.toLowerCase())){\n tempName.add(userName.get(i));\n tempUid.add(uid.get(i));\n }\n }\n userName.clear();\n uid.clear();\n userName.addAll(tempName);\n uid.addAll(tempUid);\n }", "void findSuggestions(String query) {\n \t\tif (suggestionsLoaderClient != null) {\n \t\t\tif (query.length() == 0) {\n \t\t\t\tsuggestionsLoaderClient.doLoadSuggestions(\"default-query\",\n \t\t\t\t\t\tlimit);\n \t\t\t} else {\n \t\t\t\tsuggestionsLoaderClient.doLoadSuggestions(query, limit);\n \t\t\t}\n \t\t}\n \t}", "private void fillSet() {\r\n\t\tString regex = \"\\\\p{L}+\";\r\n\t\tMatcher matcher = Pattern.compile(regex).matcher(body);\r\n\t\twhile (matcher.find()) {\r\n\t\t\tif (!matcher.group().isEmpty()) {\r\n\t\t\t\twords.add(matcher.group());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected MergeSpellingData()\r\n\t{\r\n\t}", "public void set_graph() throws ParseException, IOException {\n \tg = new WeightedUndirectedGraph(words.length);\n //g = new WeightedUndirectedGraph(most_important_terms.size());\n \n Directory dir = new SimpleFSDirectory(new File(\".\\\\data\\\\lucene_index_r_r\"));\n Analyzer analyzer = new StandardAnalyzer(LUCENE_41);\n \n // creat a map that stores, for each word (in the cluster), a set of all the documents that contain that word\n HashMap<String,HashSet<Integer>> word_to_docs_map = new HashMap<String,HashSet<Integer>>();\n int n_strings = words.length; \n \n // for each word...\n for (int idx = 0; idx < n_strings; idx++) {\n // query the index with that given word and retrieve all the documents that contains that word\n String query = words[idx]; \n QueryParser parser = new QueryParser(Version.LUCENE_41, \"text\", analyzer); \n Query q = parser.parse(query); \n\n IndexReader reader = DirectoryReader.open(dir);\n IndexSearcher searcher = new IndexSearcher(reader);\n TopDocs docs = searcher.search(q, reader.numDocs());\n ScoreDoc[] hits = docs.scoreDocs;\n \n // update map from word to docs it appears in \n //HashSet<Integer> tmp = null;\n // tmp is the set of all the document ids in which the current word is contained\n HashSet<Integer> tmp = new HashSet<>();\n //word_to_docs_map.put(query, tmp);\n \n // for each document, retrieved from the query\n for(Integer i=0;i<hits.length;i++) {\n Integer docId = hits[i].doc;\n // tmp = word_to_docs_map.get(query); \n // if the document is a document written by an user of interest \n if(indices.contains(docId)) {\n tmp.add(docId);\n }\n //word_to_docs_map.put(query, tmp); \n }\n word_to_docs_map.put(query, tmp);\n\t }\n\t \n\t // add edges: iterate over possible term pairs ...\n\t for(int idx_1 = 0; idx_1 < n_strings - 1; idx_1++) {\n\t \n\t for(int idx_2 = idx_1 + 1 ; idx_2 < n_strings ; idx_2 ++ ) {\n\t \n\t // extract document sets associated with the considered terms \n\t HashSet<Integer> set_a = word_to_docs_map.get(words[idx_1]); \n\t HashSet<Integer> set_b = word_to_docs_map.get(words[idx_2]); \n\t \n\t // compute set intersection \n\t int n = intersectionSize(set_a, set_b);\n\t \n\t // if the terms appear in at least one common document\n\t if(n>0) {\n\t // add edge \n\t g.testAndAdd(idx_1, idx_2 , n); \n\t }\n\t } \n\t }\n\t}", "private void termQuerySearch(String[] terms) {\n for (String term : terms) {\n LinkedList<TermPositions> postingLists = indexMap.get(analyzeTerm(term));\n if (postingLists != null) {\n for (TermPositions matches : postingLists) {\n double score = (double) 1 + Math.log((double) matches.getPositionList().size()) *\n Math.log((double) N / (double) postingLists.size());\n resultsCollector.add(new DocCollector(matches.getDocId(), score));\n }\n }\n }\n }", "public void setTwitter(TwitterObject[] data) {\n clearTwitter();\n for (int i=0; i<data.length; i++) {\n this.twitterDB.put(data[i].getId(), data[i]);\n }\n }", "@Override\n\tpublic void apply(TokenStream stream) throws TokenizerException {\n\t\tcreateList();\n\t\tstream.reset();\n\t\twhile(stream.hasNext()){\n\t\t\tString ans=stream.next();\n\t\t\tans=ans.trim();\n\t\t\tif(ans.matches(\"\")){\n\t\t\t\tstream.previous();\n\t\t\t\tstream.remove();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tObject[] key=tokens.keySet().toArray();\n\t\t\tfor(int i=0 ;i<tokens.size(); i++){\n\t\t\t\tif(ans.contains(key[i].toString())){\n\t\t\t\t\tans=ans.replaceAll(key[i].toString(), tokens.get(key[i].toString()));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstream.previous();\n\t\t\tstream.set(ans);\n\t\t\tstream.next();\n\n\t\t}\n\t\t//stream.reset();\n\t}", "static void allDocumentAnalyzer() throws IOException {\n\t\tFile allFiles = new File(\".\"); // current directory\n\t\tFile[] files = allFiles.listFiles(); // file array\n\n\t\t// recurse through all documents\n\t\tfor (File doc : files) {\n\t\t\t// other files we don't need\n\t\t\tif (doc.getName().contains(\".java\") || doc.getName().contains(\"words\") || doc.getName().contains(\"names\")\n\t\t\t\t\t|| doc.getName().contains(\"phrases\") || doc.getName().contains(\".class\")\n\t\t\t\t\t|| doc.getName().contains(\"Data\") || doc.getName().contains(\".sh\") || doc.isDirectory()\n\t\t\t\t\t|| !doc.getName().contains(\".txt\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tString name = doc.getName();\n\t\t\tSystem.out.println(name);\n\t\t\tname = name.substring(0, name.length() - 11);\n\t\t\tSystem.out.println(name);\n\n\t\t\tif (!names.contains(name)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// make readers\n\t\t\tFileReader fr = new FileReader(doc);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\n\t\t\t// phrase list\n\t\t\tArrayList<String> words = new ArrayList<String>();\n\n\t\t\t// retrieve all text, trim, refine and add to phrase list\n\t\t\tString nextLine = br.readLine();\n\t\t\twhile (nextLine != null) {\n\t\t\t\tnextLine = nextLine.replace(\"\\n\", \" \");\n\t\t\t\tnextLine = nextLine.trim();\n\n\t\t\t\tif (nextLine.contains(\"no experience listed\")) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tString[] lineArray = nextLine.split(\"\\\\s+\");\n\n\t\t\t\t// recurse through every word to find phrases\n\t\t\t\tfor (int i = 0; i < lineArray.length - 1; i++) {\n\t\t\t\t\t// get the current word and refine\n\t\t\t\t\tString currentWord = lineArray[i];\n\n\t\t\t\t\tcurrentWord = currentWord.trim();\n\t\t\t\t\tcurrentWord = refineWord(currentWord);\n\n\t\t\t\t\tif (currentWord.equals(\"\") || currentWord.isEmpty()) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\twords.add(currentWord);\n\t\t\t\t}\n\t\t\t\tnextLine = br.readLine();\n\t\t\t}\n\n\t\t\tbr.close();\n\n\t\t\t// continue if empty\n\t\t\tif (words.size() == 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// otherwise, increment number of files in corpus\n\t\t\tsize++;\n\n\t\t\t// updating the phrase count map for tf\n\t\t\tString fileName = doc.getName();\n\t\t\tphraseCountMap.put(fileName, words.size());\n\n\t\t\t// recurse through every word\n\t\t\tfor (String word : words) {\n\t\t\t\t// get map from string to freq\n\t\t\t\tHashMap<String, Integer> textFreqMap = wordFreqMap.get(fileName);\n\n\t\t\t\t// if it's null, make one\n\t\t\t\tif (textFreqMap == null) {\n\t\t\t\t\ttextFreqMap = new HashMap<String, Integer>();\n\t\t\t\t\t// make freq as 1\n\t\t\t\t\ttextFreqMap.put(word, 1);\n\t\t\t\t\t// put that in wordFreq\n\t\t\t\t\twordFreqMap.put(fileName, textFreqMap);\n\t\t\t\t} else {\n\t\t\t\t\t// otherwise, get the current num\n\t\t\t\t\tInteger currentFreq = textFreqMap.get(word);\n\n\t\t\t\t\t// if it's null,\n\t\t\t\t\tif (currentFreq == null) {\n\t\t\t\t\t\t// the frequency is just 0\n\t\t\t\t\t\tcurrentFreq = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t// increment the frequency\n\t\t\t\t\tcurrentFreq++;\n\n\t\t\t\t\t// put it in the textFreqMap\n\t\t\t\t\ttextFreqMap.put(word, currentFreq);\n\n\t\t\t\t\t// put that in the wordFreqMap\n\t\t\t\t\twordFreqMap.put(fileName, textFreqMap);\n\t\t\t\t}\n\n\t\t\t\t// add this to record (map from phrases to docs with that\n\t\t\t\t// phrase)\n\t\t\t\tinvertedMap.addValue(word, doc);\n\t\t\t}\n\t\t}\n\t}", "public void newQuery(String query){\n\t\tparser = new Parser(query);\n\t\tQueryClass parsedQuery = parser.createQueryClass();\n\t\tqueryList.add(parsedQuery);\n\t\t\n\t\tparsedQuery.matchFpcRegister((TreeRegistry)ps.getRegistry());\n\t\tparsedQuery.matchAggregatorRegister();\n\t\t\n\t\t\n\t}", "public void updateWordPoints() {\n for (String word: myList.keySet()) {\n int wordValue = 0;\n for (int i = 0; i < word.length(); i++) {\n // gets individual characters from word and\n // from that individual character get the value from scrabble list\n int charValue = scrabbleList.get(word.toUpperCase().charAt(i));\n // add character value gotten from character key from scrabble map to word value\n wordValue = wordValue + charValue;\n }\n\n // update the value of the word in myList map\n myList.put(word, wordValue);\n }\n }", "private void getSynsets(HashSet<WordProvider.Word> words) {\n HashMap<String, String> synsets_map = new HashMap<>();\n for (WordProvider.Word word: words) {\n ArrayList<String> synsetList = new ArrayList<>(Arrays.asList(word.getSynsets().trim().split(\" \")));\n for (String synset_tag: synsetList)\n synsets_map.put(synset_tag, word.getPos());\n }\n // for each synset load the meanings in the background\n final Object[] params= {synsets_map};\n new FetchRows().execute(params);\n }", "private static String handlePhrases(String PubmedQuery) {\r\n //Find phrases \"between double quotes\"\r\n String[] phrases = PubmedQuery.split(\"\\\"\");\r\n for(int i = 0 ; i < phrases.length ; i++){\r\n phrases[i] = phrases[i].trim();\r\n if(!phrases[i].equals(\"\")){ // String not Empty\r\n if(i%2 != 0){ // String surrounded by quotes, i.e. a phrase\r\n phrases[i] = \"\\\"\" + phrases[i] + \"\\\"\";\r\n } else { // not a phrase, i.e. a bag of terms, operator or [field of index] (inside brackets)\r\n if(phrases[i].startsWith(\"[\")){ //index field of previus component contained (i.e. case: \"...\"[...])\r\n boolean perviusPhraseFound = false; // True if index field was added to previus phrase element\r\n // Get index field of previus component and handle proprietly\r\n String [] tokens = phrases[i].split(\"]\");\r\n String indexField = tokens[0].replace(\"[\", \"\");\r\n String luceneField = supportedIndexFields.get(indexField);\r\n if(luceneField != null){ \r\n //add \"indexField:\" as a prefix in previus (not empty) phrase\r\n int tmp = i-1;\r\n while(!perviusPhraseFound & tmp >= 0){\r\n if(!phrases[tmp].equals(\"\")){\r\n perviusPhraseFound = true;\r\n //TO DO : handle wrong syntax (e.g. ... AND [ArticleTitle])\r\n phrases[tmp] = luceneField + \":\" + phrases[tmp] + \"\";\r\n } else {\r\n tmp--;\r\n }\r\n }\r\n } // else : Lucene counterpart not found, unsupported field - do nothing\r\n // Remove from current phrase this index field (prefix)\r\n phrases[i] = phrases[i].substring(indexField.length()+2 );\r\n } \r\n // Further handling...\r\n phrases[i] = handleNonPhraseToken(phrases[i]);\r\n }\r\n } //else { /* Empty token, do nothing with this */ System.out.println(\"\\t\\t\\t empty\"); }\r\n }\r\n \r\n String luceneQuery = \"\";\r\n boolean fisrtPhrase = true;\r\n for(int i = 0 ; i < phrases.length ; i ++){\r\n if(phrases[i].length() > 0){\r\n if(!phrases[i].startsWith(\" OR \") & !phrases[i].startsWith(\" -\") & !phrases[i].startsWith(\" +\") ){\r\n if(fisrtPhrase){\r\n luceneQuery += \" +\";\r\n fisrtPhrase = false;\r\n } else {\r\n if(!phrases[i-1].endsWith(\" OR \") & !phrases[i-1].endsWith(\" -\") & !phrases[i-1].endsWith(\" +\")){\r\n luceneQuery += \" +\";\r\n }\r\n } \r\n } // add default operator + when required (no OR or - is present for that term)\r\n luceneQuery += phrases[i];\r\n }// else empty phrase : skip\r\n }\r\n return luceneQuery;\r\n }", "private void initialize() {\n\t\t\n\t\t\n\t\tfinal Color twitterDarkBlue = new Color(0,132,180); //From Twitter's Color Palette\n\t\t\n\t\tfrmTweetAnalyser = new JFrame();\n\t\tfrmTweetAnalyser.setTitle(\"SmartTweet Analytics\");\n\t\tfrmTweetAnalyser.setBounds(100, 100, 723, 483);\n\t\tfrmTweetAnalyser.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tfrmTweetAnalyser.getContentPane().setLayout(new FlowLayout());\n\t\tfrmTweetAnalyser.getContentPane().setBackground(new Color(192, 222, 237));\t\n\t\t\n\t\tJLabel lblTag = new JLabel(\"Choose option:\");\n\t\tlblTag.setBounds(25, 22, 46, 14);\n\t\tfrmTweetAnalyser.getContentPane().add(lblTag);\n\t\t\n\t\tcomboBox_2 = new JComboBox();\n\t\tcomboBox_2.setModel(new DefaultComboBoxModel(new String[] {\"@JeeveSobs\" }));\n\t\tcomboBox_2.setBounds(51, 47, 17, 10);\n\t\tfrmTweetAnalyser.getContentPane().add(comboBox_2);\n\t\t\t\t\n\t\tcomboBox = new JComboBox();\n\t\tcomboBox.setModel(new DefaultComboBoxModel(new String[] {\"General Hashtag Data\",\"Most used hashtags\",\"Most used phrases\" }));\n\t\tcomboBox.setBounds(81, 77, 37, 20);\n\t\tfrmTweetAnalyser.getContentPane().add(comboBox);\n\t\t\t\t\n\t\tJButton btnSearch = new JButton(\"Search\");\n\t\tbtnSearch.setBounds(357, 48, 109, 43);\n\t\tbtnSearch.addActionListener(new ActionListener() {\n\t\t\tHiveDatabaseQuery hq=new HiveDatabaseQuery();\n\t\t\t\n\t\t\tString queries_2[]={ \"SELECT YEAR(created_at) as year, MONTH (created_at) as month, entities.hashtags.text[0] as hashtag, COUNT (*) as TweetCount, count(retweeted_status.id) as RetweetCount from tweets WHERE entities.hashtags.text[0] is not null GROUP BY YEAR(created_at), MONTH(created_at), entities.hashtags.text[0] ORDER BY year DESC limit 30\",\n\t\t\t\t\t \"SELECT LOWER(hashtags.text) as Hashtag, COUNT(*) AS total_count FROM tweets LATERAL VIEW EXPLODE(entities.hashtags) t1 AS hashtags GROUP BY LOWER(hashtags.text) ORDER BY total_count DESC limit 30\",\n\t\t\t\t\t \"SELECT explode(ngrams(sentences(lower(text)), 5, 25)) AS x FROM tweets\"};\n\t\t\t\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\ttry \n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\ttable = new JTable();\n\t\t\t\t\ttable.setOpaque(true);\n\t\t\t\t\ttable.setFillsViewportHeight(true);\n\t\t\t\t\ttable.setBackground(Color.WHITE);\n\t\t\t\t\ttable.setForeground(Color.BLACK);\n\t\t\t\t\ttable.setFont(new Font(\"Serif\", Font.PLAIN, 15));\n\t\t\t\t\tfrmTweetAnalyser.getContentPane().add(table);\n\t\t\t\t\tfinal DefaultTableModel dm=new DefaultTableModel();\n\t\t\t\t\t//table.repaint();\n\t\t\t\t\t\n\t\t\t\t\tint itemIndex = comboBox.getSelectedIndex();\n\t\t\t\t\t\n\t\t\t\t\tResultSet res;\n\t\t\t\t\t\n\t\t\t\t\t\tres = hq.QueryME( queries_2[ itemIndex ] );\n\t\t\t\t\tResultSetMetaData rsmd=res.getMetaData();\n\t\t\t\t\tint cols=rsmd.getColumnCount();\n\t\t\t String c[]=new String[cols];\n\t\t\t for(int i=0;i<cols;i++){\n\t\t\t\t c[i]=rsmd.getColumnName(i+1);\n\t\t\t\t dm.addColumn(c[i]);\n\t\t\t }\n\t\t\t \n\t\t\t Object row[]=new Object[cols];\n\t\t\t String month[] = { \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"June\", \"July\", \"Aug\", \"Sept\", \"Nov\", \"Dec\"};\n\t\t\t while(res.next())\n\t\t\t {\n\t\t\t \t for(int i=0;i<cols;i++){\n\t\t row[i]=res.getString(i+1);\n\t\t String s = res.getString(i+1);\n\t\t \t \n\t\t if(itemIndex == 2) {\n\t\t \t String[] temp;\n\t\t\t temp = s.split(\"\\\"\");\n\t\t\t \n\t\t\t String ans = \"\";\n\t\t\t for(int ii =3; ii < temp.length -2; ii++) {\n\t\t\t \t \n\t\t\t \t ans=ans+temp[ii]+\" \";\n\t\t\t }\n\t\t\t String freq = \"\";\n\t\t\t for(int ii=temp.length - 2; ii < temp.length; ii ++) {\n\t\t\t \t freq = freq + temp[ii];\n\t\t\t }\n\t\t\t \n\t\t\t String freqS[] = freq.split(\":\");\n\t\t\t \t\t\t \n\t\t\t String ans_final=\"\";\n\t\t\t for(int x =0; x < ans.length(); x++) {\n\t\t\t \t if(ans.charAt(x) !=',' && ans.charAt(x) != ']')\n\t\t\t \t\t ans_final = ans_final + ans.charAt(x);\n\t\t\t }\n\t\t\t \n\t\t\t String ekdumFinal = \"Phrase: \\\"\" + ans_final + \"\\n\\t\\\" Frequency: \" + freqS[1]; \n\t\t\t \n\t\t\t row[i] = ekdumFinal;\n\t\t\t //row[i] = ans_final\n\t\t }\n\t\t if(itemIndex == 0 && i == 1) {\n\t\t \t int mon = s.charAt(0) - '0';\n\t\t \t row[i] = month[mon];\n\t\t }\n\t\t\t \t }\n\t\t\t \t dm.addRow(row);\n\t\t\t }\n\t\t\t table.setModel(dm);\n\t \n\t\t\t \n\t\t\t /*\n\t\t\t * Uncomment for auto resize of table, based on coloumn value width.\n\t\t\t */\n\t\t\t /*table.setAutoResizeMode( JTable.AUTO_RESIZE_OFF );\n\t\t\t for (int column = 0; column < table.getColumnCount(); column++)\n\t\t\t {\n\t\t\t javax.swing.table.TableColumn tableColumn = table.getColumnModel().getColumn(column);\n\t\t\t int preferredWidth = tableColumn.getMinWidth();\n\t\t\t int maxWidth = tableColumn.getMaxWidth();\n\t\t\n\t\t\t for (int roww = 0; roww < table.getRowCount(); roww++)\n\t\t\t {\n\t\t\t TableCellRenderer cellRenderer = table.getCellRenderer(roww, column);\n\t\t\t Component cc = table.prepareRenderer(cellRenderer, roww, column);\n\t\t\t int width = cc.getPreferredSize().width + table.getIntercellSpacing().width;\n\t\t\t preferredWidth = Math.max(preferredWidth, width);\n\t\t\n\t\t\t // We've exceeded the maximum width, no need to check other rows\n\t\t\n\t\t\t if (preferredWidth >= maxWidth)\n\t\t\t {\n\t\t\t preferredWidth = maxWidth;\n\t\t\t break;\n\t\t\t }\n\t\t\t }\n\t\t\t if( preferredWidth > 100)\n\t\t\t tableColumn.setPreferredWidth( preferredWidth );\n\t\t\t else\n\t\t\t \t tableColumn.setPreferredWidth( 100 );\n\t\t\t \t}*/\n\t\t\t \tJScrollPane sp=new JScrollPane(table);\n\t\t\t\t sp.setSize(table.WIDTH, table.HEIGHT);\n\t\t\t\t frmTweetAnalyser.getContentPane().add(sp, BorderLayout.CENTER);\n\t \n\t\t\t\t} \n\t\t\t\tcatch (Exception e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\t \n\t }\n\t\t});\n\t\tfrmTweetAnalyser.getContentPane().add(btnSearch);\n\t}", "public void countWord() {\n\t\tiniStorage();\n\t\tWordTokenizer token = new WordTokenizer(\"models/jvnsensegmenter\",\n\t\t\t\t\"data\", true);\n\t\t// String example =\n\t\t// \"Nếu bạn đang tìm kiếm một chiếc điện thoại Android? Đây là, những smartphone đáng để bạn cân nhắc nhất. Thử linh tinh!\";\n\t\t// token.setString(example);\n\t\t// System.out.println(token.getString());\n\n\t\tSet<Map.Entry<String, String>> crawlData = getCrawlData().entrySet();\n\t\tIterator<Map.Entry<String, String>> i = crawlData.iterator();\n\t\twhile (i.hasNext()) {\n\t\t\tMap.Entry<String, String> pageContent = i.next();\n\t\t\tSystem.out.println(pageContent.getKey());\n\t\t\tPageData pageData = gson.fromJson(pageContent.getValue(),\n\t\t\t\t\tPageData.class);\n\t\t\ttoken.setString(pageData.getContent().toUpperCase());\n\t\t\tString wordSegment = token.getString();\n\t\t\tString[] listWord = wordSegment.split(\" \");\n\t\t\tfor (String word : listWord) {\n\t\t\t\taddToDictionary(word, 1);\n\t\t\t\tDate date;\n\t\t\t\ttry {\n\t\t\t\t\tdate = simpleDateFormat.parse(pageData.getTime().substring(\n\t\t\t\t\t\t\t0, 10));\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\taddToStatByDay(date, word, 1);\n\t\t\t}\n\t\t}\n\t}", "public void updateRecords(String query) {\n\t\tcurrentQuery = query;\n\t\tThread resultThread = new Thread(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tString workingOnQuery = currentQuery;\n\n\t\t\t\t// Ask for records\n\t\t\t\tfinal ArrayList<Record> records = dataHandler\n\t\t\t\t\t\t.getRecords(workingOnQuery);\n\n\t\t\t\t// Another search have already been made\n\t\t\t\tif (workingOnQuery != currentQuery)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (records == null) {\n\t\t\t\t\t// First use of the app. TODO : Display something useful.\n\t\t\t\t} else {\n\t\t\t\t\trunOnUiThread(new Runnable() {\n\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tadapter.clear();\n\t\t\t\t\t\t\tfor (int i = Math.min(MAX_RECORDS,\n\t\t\t\t\t\t\t\t\trecords.size()) - 1; i >= 0; i--) {\n\t\t\t\t\t\t\t\tadapter.add(records.get(i));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Reset scrolling to top\n\t\t\t\t\t\t\tlistView.setSelectionAfterHeaderView();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tresultThread.start();\n\t}", "public void narrowAllSentencesByLastOccurrenceAndUpdate() {\n try {\n List<String> properties = PropertyUtils.getAllProperties();\n for (String property : properties) {\n HashMap<Integer, HashMap<String, String>> sentenceTripleDataMap = PropertyUtils.getSentencesForProperty(property);\n for (Integer sentenceId : sentenceTripleDataMap.keySet()) {\n String subLabel = sentenceTripleDataMap.get(sentenceId).get(\"subLabel\");\n String objLabel = sentenceTripleDataMap.get(sentenceId).get(\"objLabel\");\n String sentence = sentenceTripleDataMap.get(sentenceId).get(\"sentence\");\n\n String newSentence = narrowSentencesByLastOccurrence(sentence, subLabel, objLabel);\n if (!newSentence.equals(sentence)) {\n // replace sentence in DB\n System.out.println(sentenceId);\n updateTripleSentence(sentenceId, newSentence);\n }\n }\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public void busqueda() {\r\n\r\n try {\r\n\r\n String preg = JOptionPane.showInputDialog(\"Buscar:\");\r\n Query query = new Query(preg);\r\n QueryResult result = twitter.search(query);\r\n for (Status status : result.getTweets()) {\r\n System.out.println(\"@\" + status.getUser().getScreenName() + \":\" + status.getText());\r\n }\r\n } catch (TwitterException ex) {\r\n java.util.logging.Logger.getLogger(MetodosTwit.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "public void updateCounts(WordCounter wordCounter) {\n wordCounter.wordMap.forEach((w, c) -> {\n wordMap.merge(w, c, Double::sum);\n });\n numDocs++;\n }", "public abstract void mergeToGlobalStats(SolrQueryRequest req,\n List<ShardResponse> responses);", "void updateTermsArray() {\n terms.clear();\n terms = getTerms();\n }", "public WordsInfo() {\n\t\tWordsCount = 1;\n\t\tInMailsFound = 1;\n\t\tupdated = true;\n\t}", "public void normalize() {\n // YOUR CODE HERE\n String w1, w2;\n for (int i = 0; i < row; i++) {\n w1 = NDTokens.get(i);\n for (int j = 0; j < column; j++) {\n w2 = NDTokens.get(j);\n if(smooth) {\n bi_grams_normalized[NDTokens.indexOf(w1)][NDTokens.indexOf(w2)] = (getCount(w1, w2))/(uni_grams[NDTokens.indexOf(w1)] + NDTokens_size);\n }else {\n bi_grams_normalized[NDTokens.indexOf(w1)][NDTokens.indexOf(w2)] = getCount(w1, w2)/(uni_grams[NDTokens.indexOf(w1)]);\n }\n }\n }\n }", "public void listenToHashtag(String[] _keyWords){\n TwitterStream ts = new TwitterStreamFactory(c).getInstance();\n FilterQuery filterQuery = new FilterQuery(); \n filterQuery.track(_keyWords);\n // On fait le lien entre le TwitterStream (qui r\\u00e9cup\\u00e8re les messages) et notre \\u00e9couteur \n ts.addListener(new TwitterListener(timerListener));\n // On d\\u00e9marre la recherche !\n ts.filter(filterQuery); \n }", "static private void adjustSynonyms(DataManager manager, SchemaInfo schemaInfo, List<Term> oldTerms, ArrayList<Term> newTerms) throws Exception\r\n\t{\r\n\t\t// Create a hash of all old terms\r\n\t\tHashMap<Integer,Term> oldTermHash = new HashMap<Integer,Term>();\r\n\t\tfor(Term oldTerm : oldTerms) oldTermHash.put(oldTerm.getId(), oldTerm);\r\n\t\t\r\n\t\t// Store the list of new and updated synonyms\r\n\t\tArrayList<AssociatedElement> newElements = new ArrayList<AssociatedElement>();\r\n\t\tArrayList<SchemaElement> updatedSynonyms = new ArrayList<SchemaElement>();\r\n\t\t\r\n\t\t/** Cycle through all terms to examine associated elements */\r\n\t\tfor(Term newTerm : newTerms)\r\n\t\t{\r\n\t\t\t// Get the associated old term\r\n\t\t\tTerm oldTerm = oldTermHash.get(newTerm.getId());\r\n\t\t\t\r\n\t\t\t// Identify which synonyms to add and update\r\n\t\t\tfor(AssociatedElement element : newTerm.getElements())\r\n\t\t\t{\r\n\t\t\t\tif(element.getElementID()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Swap out term names in element already exists\r\n\t\t\t\t\tSchemaElement oldElement = schemaInfo.getElement(element.getElementID());\r\n\t\t\t\t\tString description = element.getDescription()==null ? \"\" : element.getDescription();\r\n\t\t\t\t\tif(!element.getName().equals(oldElement.getName()) || !description.equals(oldElement.getDescription()))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSchemaElement updatedElement = oldElement.copy();\r\n\t\t\t\t\t\tupdatedElement.setName(element.getName());\r\n\t\t\t\t\t\tupdatedElement.setDescription(element.getDescription());\r\n\t\t\t\t\t\tupdatedSynonyms.add(updatedElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\telement.setElementID(newTerm.getId());\r\n\t\t\t\t\tnewElements.add(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Generate a hash map of all new associated elements\r\n\t\t\tHashMap<Integer,AssociatedElement> newElementHash = new HashMap<Integer,AssociatedElement>();\r\n\t\t\tfor(AssociatedElement newElement : newTerm.getElements())\r\n\t\t\t\tnewElementHash.put(newElement.getElementID(), newElement);\r\n\t\t\t\r\n\t\t\t// Delete old synonyms\r\n\t\t\tif(oldTerm!=null)\r\n\t\t\t\tfor(AssociatedElement oldElement : oldTerm.getElements())\r\n\t\t\t\t\tif(!newElementHash.containsKey(oldElement.getElementID()))\r\n\t\t\t\t\t\tif(!manager.getSchemaElementCache().deleteSchemaElement(oldElement.getElementID()))\r\n\t\t\t\t\t\t\tthrow new Exception(\"Failed to delete thesaurus synonym\");\r\n\t\t}\r\n\r\n\t\t// Create the new synonyms\r\n\t\tArrayList<SchemaElement> newSynonyms = new ArrayList<SchemaElement>();\r\n\t\tInteger counter = manager.getUniversalIDs(newElements.size());\r\n\t\tfor(AssociatedElement element : newElements)\r\n\t\t\tnewSynonyms.add(new Synonym(counter++,element.getName(),element.getDescription(),element.getElementID(),schemaInfo.getSchema().getId()));\r\n\t\t\r\n\t\t// Add the new and updated synonyms to the thesaurus schema\r\n\t\tboolean success = manager.getSchemaElementCache().addSchemaElements(newSynonyms);\r\n\t\tif(success) success = manager.getSchemaElementCache().updateSchemaElements(updatedSynonyms);\r\n\t\tif(!success) throw new Exception(\"Failed to update vocabulary schema\");\r\n\t}", "@Override\n protected void onProgressUpdate(String... values) {\n wordMatches.getMatches().add(values[0]);\n //only update the UI for the first page or so of results\n if (wordMatches.getMatches().size()<=TABLE_MAX_COUNT_TO_RELOAD)\n {\n matchObservable.setValue(values[0]);\n }\n }", "private static void addAllSynset(ArrayList<String> synsets, String chw, IDictionary dictionary) {\n\t\tWordnetStemmer stemmer = new WordnetStemmer(dictionary);\n\t\tchw = stemmer.findStems(chw, POS.NOUN).size()==0?chw:stemmer.findStems(chw, POS.NOUN).get(0);\n\t\t\n\t\tIIndexWord indexWord = dictionary.getIndexWord(chw, POS.NOUN);\n\t\tList<IWordID> sensesID = indexWord.getWordIDs();\n\t\tList<ISynsetID> relaWordID = new ArrayList<ISynsetID>();\n\t\tList<IWord> words;\n\t\t\n\t\tfor(IWordID set : sensesID) {\n\t\t\tIWord word = dictionary.getWord(set);\n\t\t\t\n\t\t\t//Add Synonym\n\t\t\trelaWordID.add(word.getSynset().getID());\n\n\t\t\t//Add Antonym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.ANTONYM));\n\t\t\t\n\t\t\t//Add Meronym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.MERONYM_MEMBER));\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.MERONYM_PART));\n\t\t\t\n\t\t\t//Add Hypernym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.HYPERNYM));\n\t\t\t\n\t\t\t//Add Hyponym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.HYPONYM));\n\t\t}\n\t\t\n\t\tfor(ISynsetID sid : relaWordID) {\n\t\t\twords = dictionary.getSynset(sid).getWords();\n\t\t\tfor(Iterator<IWord> i = words.iterator(); i.hasNext();) {\n\t\t\t\tsynsets.add(i.next().getLemma());\n\t\t\t}\n\t\t}\n\t}", "public static void UpdateWfurl()\n\t{\n\t\twfurlInput.setText(\"\");\n\t\tfor (Character item : wfurlArray) { \n\t\t wfurlInput.setText(wfurlInput.getText() + item.toString());\n\t\t}\n\t}", "private void update(String person){\n\n\t\tint index = myWords.indexOf(person);\n\t\tif(index == -1){\n\t\t\tmyWords.add(person);\n\t\t\tmyFreqs.add(1);\n\t\t}\n\t\telse{\n\t\t\tint value = myFreqs.get(index);\n\t\t\tmyFreqs.set(index,value+1);\n\t\t}\n\t}", "public getTweets_args(getTweets_args other) {\n if (other.isSetQuery()) {\n this.query = other.query;\n }\n }", "private void processUrls(){\n // Strip quoted tweet URL\n if(quotedTweetId > 0){\n if(entities.urls.size() > 0 &&\n entities.urls.get(entities.urls.size() - 1)\n .expandedUrl.endsWith(\"/status/\" + String.valueOf(quotedTweetId))){\n // Match! Remove that bastard.\n entities.urls.remove(entities.urls.size() - 1);\n }\n }\n\n // Replace minified URLs\n for(Entities.UrlEntity entity : entities.urls){\n // Find the starting index for this URL\n entity.indexStart = text.indexOf(entity.minifiedUrl);\n // Replace text\n text = text.replace(entity.minifiedUrl, entity.displayUrl);\n // Find the last index for this URL\n entity.indexEnd = entity.indexStart + entity.displayUrl.length();\n }\n }", "private void initiateWordCount(){\n for(String key: DataModel.bloomFilter.keySet()){\n WordCountHam.put(key, 0);\n WordCountSpam.put(key, 0);\n }\n }", "void updateFilteredDoneTaskListNamePred(Set<String> keywords);", "public QueryParser(QueryParserTokenManager tm) {\n token_source = tm;\n token = new Token();\n jj_ntk = -1;\n jj_gen = 0;\n for (int i = 0; i < 117; i++) jj_la1[i] = -1;\n for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\n }", "@Override\n public void onChanged(@Nullable final List<WordDO> words) {\n adapter.setWords(words);\n }", "private void queryList (String query) {\n\t\tmemoListAdapter.query(query);\n\t}", "private static ArrayList<Result> bagOfWords(Query query, DataManager myVocab) {\n\t\tString queryname = query.getQuery();\n\t\t// split on space and punctuation\n\t\tString[] termList = queryname.split(\" \");\n\t\tArrayList<Result> bagResults = new ArrayList<Result>();\n\t\tfor (int i=0; i<termList.length; i++){\n\t\t\tQuery newQuery = new Query(termList[i], query.getLimit(), query.getType(), query.getTypeStrict(), query.properties()) ;\n\t\t\tArrayList<Result> tempResults = new ArrayList<Result>(findMatches(newQuery, myVocab));\n\t\t\tfor(int j=0; j<tempResults.size(); j++){\n\n\t\t\t\ttempResults.get(j).setMatch(false);\n\t\t\t\ttempResults.get(j).decreaseScore(termList.length);\n\t\t\t\tif(tempResults.get(j).getScore()>100){\n\t\t\t\t\ttempResults.get(j).setScore(99.0);\n\t\t\t\t}else if (tempResults.get(j).getScore()<1){\n\t\t\t\t\ttempResults.get(j).setScore(tempResults.get(j).getScore()*10);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbagResults.addAll(tempResults);\n\t\t}\n\t\treturn bagResults;\n\t}", "private void synsetParse(String line) {\n String[] tokens = line.split(\",\");\n Integer key = Integer.parseInt(tokens[0]);\n ArrayList<String> al = new ArrayList<String>();\n String[] words = tokens[1].split(\" \");\n for (String w : words) {\n al.add(w);\n nounSet.add(w); // build nounSet at the same time\n }\n synsetMap.put(key, al);\n }", "private ArrayList<WordDocument> executeAdvancedQuery(){\n ArrayList<WordDocument> documents = customDijkstrasTwoStack(this.query.split(\" \"));\n ArrayList<WordDocument> result = new ArrayList<WordDocument>();\n\n try{\n String[] orderByPart = query.substring(query.indexOf(\"ORDERBY\")).trim().toLowerCase().split(\" \");\n if(isOrderByCommand(orderByPart[0]))\n result = orderBy(documents, orderByPart[1], orderByPart[2]);\n }catch (StringIndexOutOfBoundsException ex){\n result = documents;\n }\n\n return result;\n }", "public HangmanManager(Set<String> words, boolean debugOn) {\r\n \tif (words == null || words.size() <= 0) {\r\n \t\tthrow new IllegalArgumentException();\r\n \t}\r\n \tthis.words = new HashSet<String>();\r\n \tfor (String s : words) {\r\n \t\tthis.words.add(s);\r\n \t}\r\n }", "public static void main(String[] args) {\n\n \tArrayList<Tweet> tweets;\n if (args.length == 1) {\n\t\t // You must check twitter4j documentation to\n\t\t // find ways to modify the basic query.\n\t\t String searchString = new String(args[0]);\n\t\t Query query = new Query(args[0]);\n\t\t query.setCount(100); // upper bound on number of queries returned\n\t\t query.setResultType(Query.ResultType.recent);\n\t\t //System.out.println(\"num \" + query.getCount());\n\t\t\n\t\t GeoLocation gl = new GeoLocation(42.01955,-73.9080); // near Bard\n\t\t query.setGeoCode(gl,100.0,Query.MILES); // limit distance\n\t\n\t\t List<Status> tweet_status = Main.getTweets(query);\n\t\t if (tweet_status == null) System.exit(-1);\n\t\n\t\t tweets = new ArrayList<Tweet>();\n\t\t // Convert tweets into ArrayList of Tweet objects.\n\t\t for (Status stat : tweet_status) {\n\t\t\tTweet t = new Tweet(stat);\n\t\t\tt.setSearchString(searchString);\n\t\t\ttweets.add(t);\n\t\t }\n\t\t Main.save(\"tweets.serialized\",tweets);\t \n } else { // just get tweets from file\n\t\t // Save and reload tweets just to test serialization\n\t\t tweets = Main.load(\"tweets100.serialized\");\n }\n\t\t// Print out the reloaded tweets just to see them\n\t\tIterator<Tweet> iter = tweets.iterator();\n\t\twhile (iter.hasNext()) {\n\t\t p(\"===\");\n\t\t iter.next().print();\n\t\t}\n\t\n\t\tp(\"Number of tweets: \" + tweets.size());\n\t\t\n\t\tBinarySearchTree<Tweet> tweetTree = new BinarySearchTree<Tweet>();\n\t\tBinarySearchTree<Tweet> tweetTree2 = new BinarySearchTree<Tweet>();\n\t\tfor (Tweet t : tweets) { tweetTree.addElement(t); tweetTree2.addElement(t); }\n\t\ttweetTree.computeNodeHeights();\n\t\tp(\"Average depth: \" + tweetTree.avgDepth());\n\t\tp(\"Trees the same: \" + BinarySearchTree.test(tweetTree, tweetTree2));\n\t\tsaveBST(\"bst.save\", tweetTree);\n\t\ttweetTree2 = loadBST(\"bst.save\");\n\t\tp(\"Trees the same: \" + BinarySearchTree.test(tweetTree, tweetTree2));\n }", "public SUMOQueryParser(SUMOQueryParserTokenManager tm) {\n token_source = tm;\n token = new Token();\n jj_ntk = -1;\n jj_gen = 0;\n for (int i = 0; i < 11; i++) jj_la1[i] = -1;\n for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\n }", "public void tweet() {\r\n try {\r\n\r\n String twet = JOptionPane.showInputDialog(\"Tweett:\");\r\n Status status = twitter.updateStatus(twet);\r\n System.out.println(\"Successfully updated the status to [\" + status.getText() + \"].\");\r\n } catch (TwitterException ex) {\r\n java.util.logging.Logger.getLogger(MetodosTwit.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "private void addQuery(String query){\n this.queries.add( query);\n }", "private void parseConfig() {\n try {\n synonymAnalyzers = new HashMap<>();\n\n Object xmlSynonymAnalyzers = args.get(\"synonymAnalyzers\");\n\n if (xmlSynonymAnalyzers != null && xmlSynonymAnalyzers instanceof NamedList) {\n NamedList<?> synonymAnalyzersList = (NamedList<?>) xmlSynonymAnalyzers;\n for (Entry<String, ?> entry : synonymAnalyzersList) {\n String analyzerName = entry.getKey();\n if (!(entry.getValue() instanceof NamedList)) {\n continue;\n }\n NamedList<?> analyzerAsNamedList = (NamedList<?>) entry.getValue();\n\n TokenizerFactory tokenizerFactory = null;\n TokenFilterFactory filterFactory;\n List<TokenFilterFactory> filterFactories = new LinkedList<>();\n\n for (Entry<String, ?> analyzerEntry : analyzerAsNamedList) {\n String key = analyzerEntry.getKey();\n if (!(entry.getValue() instanceof NamedList)) {\n continue;\n }\n Map<String, String> params = convertNamedListToMap((NamedList<?>)analyzerEntry.getValue());\n\n String className = params.get(\"class\");\n if (className == null) {\n continue;\n }\n\n params.put(\"luceneMatchVersion\", luceneMatchVersion.toString());\n\n if (key.equals(\"tokenizer\")) {\n try {\n tokenizerFactory = TokenizerFactory.forName(className, params);\n } catch (IllegalArgumentException iae) {\n if (!className.contains(\".\")) {\n iae.printStackTrace();\n }\n // Now try by classname instead of SPI keyword\n tokenizerFactory = loader.newInstance(className, TokenizerFactory.class, new String[]{}, new Class[] { Map.class }, new Object[] { params });\n }\n if (tokenizerFactory instanceof ResourceLoaderAware) {\n ((ResourceLoaderAware)tokenizerFactory).inform(loader);\n }\n } else if (key.equals(\"filter\")) {\n try {\n filterFactory = TokenFilterFactory.forName(className, params);\n } catch (IllegalArgumentException iae) {\n if (!className.contains(\".\")) {\n iae.printStackTrace();\n }\n // Now try by classname instead of SPI keyword\n filterFactory = loader.newInstance(className, TokenFilterFactory.class, new String[]{}, new Class[] { Map.class }, new Object[] { params });\n }\n if (filterFactory instanceof ResourceLoaderAware) {\n ((ResourceLoaderAware)filterFactory).inform(loader);\n }\n filterFactories.add(filterFactory);\n }\n }\n if (tokenizerFactory == null) {\n throw new SolrException(ErrorCode.SERVER_ERROR,\n \"tokenizer must not be null for synonym analyzer: \" + analyzerName);\n } else if (filterFactories.isEmpty()) {\n throw new SolrException(ErrorCode.SERVER_ERROR,\n \"filter factories must be defined for synonym analyzer: \" + analyzerName);\n }\n\n TokenizerChain analyzer = new TokenizerChain(tokenizerFactory,\n filterFactories.toArray(new TokenFilterFactory[filterFactories.size()]));\n\n synonymAnalyzers.put(analyzerName, analyzer);\n }\n }\n } catch (IOException e) {\n throw new SolrException(ErrorCode.SERVER_ERROR, \"Failed to create parser. Check your config.\", e);\n }\n }", "private void performNewQuery(){\n\n // update the label of the Activity\n setLabelForActivity();\n // reset the page number that is being used in queries\n pageNumberBeingQueried = 1;\n // clear the ArrayList of Movie objects\n cachedMovieData.clear();\n // notify our MovieAdapter about this\n movieAdapter.notifyDataSetChanged();\n // reset endless scroll listener when performing a new search\n recyclerViewScrollListener.resetState();\n\n /*\n * Loader call - case 3 of 3\n * We call loader methods as we have just performed reset of the data set\n * */\n // initiate a new query\n manageLoaders();\n\n }", "private static void populateWordList(Scanner dictScan) {\n\t\tfor(int i=2; i<wordList.length; i++) {\n\t\t\tif(dictScan.hasNext()) {\n\t\t\t\twordList[i] = dictScan.nextLine();\n\t\t\t}\n\t\t}\n\t}", "public HangmanManager(Set<String> words) {\r\n \tif (words == null || words.size() <= 0) {\r\n \t\tthrow new IllegalArgumentException();\r\n \t}\r\n \tthis.words = new HashSet<String>();\r\n \tfor (String s : words) {\r\n \t\tthis.activeWords.add(s);\r\n \t}\r\n }", "public static void runScript() throws twitter4j.TwitterException, java\n\t\t\t .lang.InterruptedException\n\t{\n\t\tint currentIteration = 0;\n\n\t\twhile (currentIteration < REFRESH_ITERATIONS)\n\t\t{\n\n\t\t\tArrayList<Status> searches = getSearch(searchTerm);\n\n\t\t\tif (searches.size() == 0)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"No tweets found with current search term \" +\n\t\t\t\t\t\t searchTerm);\n\t\t\t}\n\n\t\t\tfor (Status status : searches)\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\tPrints out the search\n\t\t\t\t */\n\t\t\t\tSystem.out.println(\"@\" + status.getUser().getScreenName() + \":\" +\n\t\t\t\t\t\t status.getText());\n\n\t\t\t\tStatusUtils sU = new StatusUtils(status);\n\t\t\t\tboolean follow = sU.checkToFollow();\n\t\t\t\tboolean retweet = sU.checkToRetweet();\n\n\t\t\t\tif ((!follow && !retweet) || status.isRetweetedByMe())\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"IGNORE\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (status.isRetweet())\n\t\t\t\t{\n\t\t\t\t\tstatus = status.getRetweetedStatus();\n\t\t\t\t}\n\n\t\t\t\tif (follow)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\ttwitter.createFriendship(sU.getPersonToFollow());\n\t\t\t\t\t\tSystem.out.println(\"FOLLOWED\");\n\t\t\t\t\t\tfixFollowers();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Threw error\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (retweet)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\ttwitter.retweetStatus(status.getId());\n\t\t\t\t\t\tSystem.out.println(\"RETWEETED\");\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Threw error\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcurrentIteration++;\n\n\t\t\t\tif (currentIteration == REFRESH_ITERATIONS)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"sleeping\");\n\t\t\t\t\tThread.sleep(SLEEP_TIME);\n\t\t\t\t\tcurrentIteration = 0;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "public synchronized void process() \n\t{\n\t\t// for each word in a line, tally-up its frequency.\n\t\t// do sentence-segmentation first.\n\t\tCopyOnWriteArrayList<String> result = textProcessor.sentenceSegmementation(content.get());\n\t\t\n\t\t// then do tokenize each word and count the terms.\n\t\ttextProcessor.tokenizeAndCount(result);\n\t}" ]
[ "0.5770663", "0.5483876", "0.54636574", "0.54265904", "0.53978866", "0.53803205", "0.53659815", "0.5358132", "0.5322717", "0.53221047", "0.51714605", "0.51614255", "0.51494277", "0.5146193", "0.51078546", "0.5097823", "0.50634074", "0.5047072", "0.50373644", "0.49558935", "0.4944207", "0.4942428", "0.4932659", "0.4919357", "0.4904007", "0.4900509", "0.48753893", "0.48689622", "0.48621884", "0.48597753", "0.48576474", "0.4845446", "0.48390388", "0.4832272", "0.48159698", "0.48036405", "0.47995326", "0.47980666", "0.477353", "0.476944", "0.47672743", "0.47652313", "0.4764505", "0.47401276", "0.47326034", "0.4729535", "0.4728264", "0.47247523", "0.47202587", "0.47164586", "0.4712534", "0.47116676", "0.47059724", "0.47016516", "0.47002247", "0.46978286", "0.46949086", "0.46882638", "0.46826702", "0.46789837", "0.46787164", "0.46648273", "0.46548367", "0.4644441", "0.46421644", "0.4637499", "0.4634095", "0.463156", "0.46165976", "0.46117374", "0.46089038", "0.4602731", "0.45942038", "0.45633", "0.45600545", "0.45590723", "0.45589805", "0.4558371", "0.45571354", "0.4545231", "0.45374215", "0.4534669", "0.4532998", "0.45273945", "0.45248234", "0.45242405", "0.45117018", "0.45094162", "0.45014372", "0.45010078", "0.44979265", "0.44945687", "0.4488785", "0.44883478", "0.44856203", "0.44856095", "0.44821766", "0.44775766", "0.4472877", "0.44666117" ]
0.8137958
0
return the number of queries registered
public int queries_registered() { return m_queryList.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getQueriesCount();", "public int getQueriesCount() {\n return queries_.size();\n }", "public int size()\n {\n return queries.size();\n }", "public int getQueriesCount() {\n if (queriesBuilder_ == null) {\n return queries_.size();\n } else {\n return queriesBuilder_.getCount();\n }\n }", "public int query() {\n return count;\n }", "int getQueryItemsCount();", "public int query() {\n return totalcount;\n }", "int getConnectionsCount();", "public int getQueriesSize() {\n\t\tint result = 0;\n\t\tfor (QueryInfo oneQ : this.maxQueries) {\n\t\t\tresult += oneQ.getFrequency();\n\t\t}\n\t\treturn result;\n\t}", "@Override\r\n\tpublic int queryListCount() {\n\t\treturn crawlerCronJobDao.queryListCount();\r\n\t}", "public long countAllLots() throws MiddlewareQueryException;", "int getResultsCount();", "int getResultsCount();", "int getConnectionCount();", "int getDatabasesCount();", "long getDbCount();", "public long getAllStatementCount();", "int getNumberOfResults();", "@Override\n\tpublic int queryCount() {\n\t\treturn (int) tBasUnitClassRepository.count();\n\t}", "long count(String query);", "long count(String query);", "@Transactional(propagation=Propagation.SUPPORTS,readOnly=true)\r\n\tpublic Integer queryCount() {\n\t\tInteger count = musicdao.selectCount();\r\n\t\treturn count;\r\n\t}", "int getSessionCount();", "@Override\r\n\tprotected int count() {\n\t\treturn service.count();\r\n\t}", "int getRequestsCount();", "int getRequestsCount();", "Long getAllCount();", "public int get_count();", "Integer getConnectorCount();", "@Override\n\tpublic int queryCountOfRows() {\n\t\treturn parentDao.queryCountOfRows();\n\t}", "int findAllCount() ;", "public long countRecords();", "public int countResults() \n {\n return itsResults_size;\n }", "long getRequestsCount();", "public static int getConnectionCount()\r\n {\r\n return count_; \r\n }", "public int numConnections(){\n return connections.size();\n }", "public int count();", "public int count();", "public int count();", "public int count();", "int getUpdateCountsCount();", "int getReqCount();", "public Integer getAllCount() {\n\t\tString sql=\"select count(*) from statistics\";\n\t\tint count = (int)getCount(sql);\n\t\treturn count;\n\t}", "default long count() {\n\t\treturn select(Wildcard.count).fetchCount();\n\t}", "public static int count() {\n\treturn errorCount;\n }", "public int getResultsCount() {\n return results_.size();\n }", "@Override\n\tpublic int getFindAllCount() {\n\t\tint num = rfi.getFindAllCount();\n\t\tlogger.info(\"select all registration form count:\" + num);\n\t\treturn num;\n\t}", "public static int registeredSize() {\n\t\tInteger count = new Integer(0);\n\t\tObject object = cache.get(FQN_COUNT, LOGGED_COUNT);\n\t\tif (object != null) {\n\t\t\tcount = (Integer) object;\n\t\t}\n\n\t\treturn (count == null ? 0 : count.intValue());\n\t}", "@Override\n\tpublic int incheoncount() throws Exception {\n\t\treturn dao.incheoncount();\n\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}", "public static int countAll() {\n\t\treturn getPersistence().countAll();\n\t}", "int getRecordCount();", "long countNumberOfProductsInDatabase();", "int getStatsCount();", "int getStatsCount();", "int getStatsCount();", "public int getcount() {\n\t\tString countQuery = \"SELECT * FROM \" + DATABASE_TABLE1;\n\t \n\t Cursor cursor = ourDatabase.rawQuery(countQuery, null);\n\t int cnt = cursor.getCount();\n\t cursor.close();\n\t return cnt;\n\t\n\t}", "@java.lang.Override\n public int getResultsCount() {\n return results_.size();\n }", "int getTotalCreatedConnections();", "int getRequestCount();", "public int size() {\n return results.size();\n }", "int getUserCount();", "int getUserCount();", "int getUsersCount();", "int getUsersCount();", "int getUsersCount();", "public int count() {\n\t\treturn count;\n\t}", "public int connectionCount()\n {\n return _connectionCount;\n }", "public int delegateGetCountAllTx() {\r\n return getMyDao().getCountAll();\r\n }", "@java.lang.Override\n public int getResultsCount() {\n return results_.size();\n }", "int getDataScansCount();", "public int getListCount() {\n String countQuery = \"SELECT * FROM \" + TABLE_NAME;\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor cursor = db.rawQuery(countQuery, null);\n cursor.close();\n return cursor.getCount();\n }", "public int count() {\n return Query.count(iterable);\n }", "public int getQueryLength()\n\t{\n\t\treturn myQueryLength;\n\t}", "int getListCount();", "public int resultCount(){\n\n int c = 0;\n\n try{\n if(res.last()){\n c = res.getRow();\n res.beforeFirst();\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return c;\n }", "public int numberOfOccorrence();", "static int numParamsPerQuery(Query query) {\n return Util.parametersCount(query.sql());\n }", "public abstract int getNumSessions();", "int getCommandCount();", "Long recordCount();", "public int getAllCount(){\r\n\t\tString sql=\"select count(*) from board_notice\";\r\n\t\tint result=0;\r\n\t\tConnection conn=null;\r\n\t\tStatement stmt=null;\r\n\t\tResultSet rs=null;\r\n\t\ttry{\r\n\t\t\tconn=DBManager.getConnection();\r\n\t\t\tstmt=conn.createStatement();\r\n\t\t\trs=stmt.executeQuery(sql);\r\n\t\t\trs.next();\r\n\t\t\tresult=rs.getInt(1);\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}finally{\r\n\t\t\tDBManager.close(conn, stmt, rs);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public int getCapteurCount() {\n String countQuery = \"SELECT * FROM \" + TABLE_LOGIN;\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor cursor = db.rawQuery(countQuery, null);\n int rowCount = cursor.getCount();\n cursor.close();\n //db.close();\n return rowCount;\n }", "@Override\n\tpublic int swriteGetCount() throws SQLException {\n\t\treturn sqlSession.selectOne(\"as_writeGetCount\");\n\t}", "public int getResultsCount() {\n if (resultsBuilder_ == null) {\n return results_.size();\n } else {\n return resultsBuilder_.getCount();\n }\n }", "public int SelectCount() {\n return this.StudentDao.SelectCount();\n }", "Long count();", "Long count();", "Long count();", "Long count();", "Long count();", "public int getTotalConnections()\n {\n // return _connections.size();\n return 0;\n }" ]
[ "0.8646373", "0.81842846", "0.7782202", "0.76388067", "0.7520102", "0.7372208", "0.72870225", "0.7141199", "0.71207625", "0.7116052", "0.70357084", "0.6993996", "0.6993996", "0.6966881", "0.6884084", "0.68633187", "0.68469626", "0.6838031", "0.6806354", "0.67756236", "0.67756236", "0.67716706", "0.67445093", "0.6710284", "0.6708845", "0.6708845", "0.67078227", "0.66728824", "0.6638231", "0.66162604", "0.6614023", "0.65968484", "0.6596354", "0.6593718", "0.6583569", "0.6581927", "0.65511274", "0.65511274", "0.65511274", "0.65511274", "0.6545268", "0.65429515", "0.6540181", "0.65369004", "0.6527452", "0.651978", "0.6512914", "0.65010697", "0.64918214", "0.649022", "0.649022", "0.649022", "0.649022", "0.649022", "0.649022", "0.649022", "0.649022", "0.649022", "0.649022", "0.6488884", "0.647896", "0.6460189", "0.6460189", "0.6460189", "0.6455725", "0.64479256", "0.6447819", "0.6434338", "0.6416073", "0.64138675", "0.64138675", "0.6407591", "0.6407591", "0.6407591", "0.6407137", "0.63933635", "0.6383618", "0.6380106", "0.6377131", "0.6376634", "0.63758665", "0.63740885", "0.6357946", "0.63561475", "0.6350992", "0.6345355", "0.63379484", "0.6326841", "0.63268244", "0.6320188", "0.63189703", "0.63162166", "0.6311976", "0.6310972", "0.63081336", "0.63081336", "0.63081336", "0.63081336", "0.63081336", "0.630337" ]
0.83628505
1
return an iterator of the queries which have been inserted into this data structure. The items will be returned in an undefined order.
public Iterator<Exact_Period_Count> get_QueryIterator() { return m_queryList.iterator(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Iterator<SingleQuery> iterator() {\n return new QueryHistoryIterator();\n }", "@Override\n public boolean hasNext() {\n return i+1 < queries.size();\n }", "public Iterator<Map<String, Object>> getQueryResult() {\n return queryResult;\n }", "public Queries queries() {\n return this.queries;\n }", "@Override\n\tpublic final Iterable<R> execute() {\n\t\t\n\t\treturn new Iterable<R>() {\n\t\t\t\n\t\t\t@Override \n\t\t\tpublic Iterator<R> iterator() {\n\t\t\t\t\n\t\t\t\treturn AbstractMultiQuery.this.iterator();\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\t\n\t}", "@Override\n public boolean hasNext() {\n return !query.isEmpty();\n }", "List<RequestHistory> getQueries() throws RemoteException;", "public ListIterator<T> getAllByRowsIterator() {\n\t\tAllByRowsIterator it = new AllByRowsIterator();\n\t\treturn it;\n\t}", "public ListIterator<T> getAllByColumnsIterator() {\n\t\tAllByColumnsIterator it = new AllByColumnsIterator();\n\t\treturn it;\n\t}", "public WorldUps.UQuery getQueries(int index) {\n return queries_.get(index);\n }", "public Iterable<Key> iterator() {\n Queue<Key> queue = new LinkedList<>();\n inorder(root, queue);\n return queue;\n }", "private RunQueriesEx setupQueries() {\n RunQueriesEx queries = new RunQueriesEx();\n \n //for each column in our table, update one of our lists\n for(int i = 0; i < this.dataTable.getColumnCount(); i++) {\n this.updateList(i);\n }\n \n updateEmptyLists(); //pads any lists that didn't get updates with empty strings\n \n //add a new query for each row in the table\n for(int i = 0; i < this.dataTable.getRowCount(); i++) {\n queries.add(this.createQueryFromRow(i));\n }\n \n return queries;\n }", "public int queries_registered()\r\n\t{\r\n\t\treturn m_queryList.size();\r\n\t}", "public Iterator<Item> iterator() {\n RQIterator it = new RQIterator();\n return it;\n }", "java.util.List<WorldUps.UQuery> \n getQueriesList();", "@Transactional(propagation = Propagation.REQUIRED, value = \"jamiTransactionManager\", readOnly = true)\n public Iterator<Experiment> iterateAll() {\n return new IntactQueryResultIterator<Experiment>((ExperimentService) ApplicationContextProvider.getBean(\"experimentService\"));\n }", "@Override\n public Iterator<NFetchMode> iterator() {\n return Arrays.asList(all).iterator();\n }", "@Override\n\tpublic Iterator<Statement> iterator() {\n\t\treturn iterator(null, null, null);\n\t}", "public List<RunningQuery> getRunningQueries() {\n return jdbi.withHandle(handle -> {\n handle.registerRowMapper(ConstructorMapper.factory(RunningQuery.class));\n return handle.createQuery(RunningQuery.extractQuery)\n .mapTo(RunningQuery.class)\n .list();\n });\n }", "public Queries loadQueries() {\r\n\t\tQueries queries = null;\r\n\t try {\r\n queries = Queries.unmarshalAsQueries();\r\n\t } catch (Exception e) {\r\n\t e.printStackTrace();\r\n\t }\r\n\t return queries;\r\n\t}", "@Override\n public SingleQuery next() {\n i++;\n current = queries.get(i);\n\n return current;\n }", "public Iterator<Item> iterator() {\n return new DequeIterator();\n }", "public Iterator<Item> iterator() {\n return new DequeIterator();\n }", "public Iterator<Item> iterator() {\n return new DequeIterator();\n }", "@Override\n\tpublic List<Generator> getAll() {\n\n\t\tList<Generator> result = new ArrayList<>();\n\n\t\ttry (Connection c = context.getConnection(); \n\t\t\tStatement stmt = c.createStatement()) {\n\n\t\t\tResultSet rs = stmt.executeQuery(getAllQuery);\n\n\t\t\twhile (rs.next()) {\n \tGenerator generator = new Generator(\n \t\trs.getInt(1),\n \t\trs.getString(2),\n \t\trs.getString(3),\n \t\trs.getInt(4),\n \t\trs.getInt(5),\n \t\trs.getInt(6)\n \t);\n\t\t\t\tresult.add(generator);\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn result;\n\t\t}\n\t\treturn result;\n\n\t}", "public void fetch(){ \n for(int i = 0; i < this.queries.size(); i++){\n fetch(i);\n }\n }", "public Iterator<Item> iterator() {\n return new DequeIterator();\n }", "public Iterator<ResultItem> iterateItems() {\r\n\t\treturn items.iterator();\r\n\t}", "public ArrayList<QueryInfo> getQueryList()\n\t{\n\t\treturn queryList;\n\t}", "WorldUps.UQuery getQueries(int index);", "public Iterator<Item> iterator() {\n\t\treturn new DequeIterator();\n\t}", "public ReadOnlyIterator<Statement> getAllStatements();", "public Map<String, DataModel> getQuery() {\n if (queries == null) {\n queries = FxSharedUtils.getMappedFunction(new FxSharedUtils.ParameterMapper<String, DataModel>() {\n @Override\n public DataModel get(Object key) {\n try {\n final FxResultSet result = EJBLookup.getSearchEngine().search((String) key, 0, -1, null);\n return new FxResultSetDataModel(result);\n } catch (FxApplicationException e) {\n throw e.asRuntimeException();\n }\n }\n }, true);\n }\n return queries;\n }", "public Iterator iterator() {\n\t return new EntryIterator(set.iterator());\n\t}", "public DbIterator iterator() {\n // some code goes here\n ArrayList<Tuple> tuples = new ArrayList<Tuple>();\n for (Field key : m_aggregateData.keySet()) {\n \tTuple nextTuple = new Tuple(m_td);\n \tint recvValue;\n \t\n \tswitch (m_op) {\n \tcase MIN: case MAX: case SUM:\n \t\trecvValue = m_aggregateData.get(key);\n \t\tbreak;\n \tcase COUNT:\n \t\trecvValue = m_count.get(key);\n \t\tbreak;\n \tcase AVG:\n \t\trecvValue = m_aggregateData.get(key) / m_count.get(key);\n \t\tbreak;\n \tdefault:\n \t\trecvValue = setInitData(); // shouldn't reach here\n \t}\n \t\n \tField recvField = new IntField(recvValue);\n \tif (m_gbfield == NO_GROUPING) {\n \t\tnextTuple.setField(0, recvField);\n \t}\n \telse {\n \t\tnextTuple.setField(0, key);\n \t\tnextTuple.setField(1, recvField);\n \t}\n \ttuples.add(nextTuple);\n }\n return new TupleIterator(m_td, tuples);\n }", "private Iterator getEntries(){\r\n\t\tSet entries = items.entrySet();\r\n\t\treturn entries.iterator();\r\n\t}", "public Iterable<K> inOrder() {\n Queue<K> q = new Queue<>();\n inOrder(root, q);\n return q;\n }", "@Override\n\tpublic boolean hasNext() {\n\t\tthis.res = new Row();\n\t\ttry{\n\t\t\twhile(index < dataCopy.size()){\n\t\t\t\tdata2 = dataCopy.get(index++);\t\t\t\t\t\t\t\n\t\t\t\tif(whereExp != null && !eval1.eval(whereExp).toBool()) continue;\t\n\t\t\t\t\n\t\t\t\tTableContainer.orderByData.add(new Row());\n\t\t\t\tfor(PrimitiveValue v : data2.rowList)\n\t\t\t\t\tTableContainer.orderByData.get(count).rowList.add(v);\t\n\t\t\t\tcount++;\n\t\t\t\n\t\t\t\t/*if the query is SELECT * FROM R*/\n\t\t\t\tif(flag2){\n\t\t\t\t\tres = data2;\n\t\t\t\t}else{\n\t\t\t\t\t/*if it is the regular query*/\n\t\t\t\t\tfor (int i = 0; i < itemLen; i++) res.rowList.add(eval1.eval((selectItemsExpression.get(i))));\n\t\t\t\t}\n\t\t\t\treturn true;\t\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn false;\n\t}", "public java.util.List<WorldUps.UQuery> getQueriesList() {\n return queries_;\n }", "public List<OwnerQueryStatsDTO> getQueries() {\n\t\tif (queries == null) {\n\t\t\ttry (Config config = ConfigFactory.get()) {\n\n\t\t\t queries = DbUtil.getOwnerQueries(config, userBean.getUserId(), getFilterTerms(),\n\t\t\t\t\t flagFilter);\n\t\t\t\tsortQueries();\n\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn queries;\n\t}", "public java.util.List<WorldUps.UQuery> getQueriesList() {\n if (queriesBuilder_ == null) {\n return java.util.Collections.unmodifiableList(queries_);\n } else {\n return queriesBuilder_.getMessageList();\n }\n }", "public List<IEntity> query(IQuery query) throws SQLException;", "@Override\n\tpublic ArrayList<Parent> queryAll() {\n\t\treturn parentDao.queryAll();\n\t}", "public ListIterator<T> listIterator() {\n\t\tAllByRowsIterator it = new AllByRowsIterator();\n\t\treturn it;\n\t}", "public void start() {\n \n for (Object obj: bufferedQueries) {\n \n switch(obj.getClass().getName()) {\n case \"uzh.tomdb.db.operations.Insert\":\n if (inserts == null) {\n inserts = new ArrayList<>();\n }\n inserts.add((Insert) obj);\n break;\n case \"uzh.tomdb.db.operations.CreateTable\":\n if (creates == null) {\n creates = new ArrayList<>();\n }\n creates.add((CreateTable) obj);\n break;\n case \"uzh.tomdb.db.operations.Update\":\n if (updates == null) {\n updates = new ArrayList<>();\n }\n updates.add((Update) obj);\n break;\n case \"uzh.tomdb.db.operations.Delete\":\n if (deletes == null) {\n deletes = new ArrayList<>();\n }\n deletes.add((Delete) obj);\n break;\n }\n }\n \n if (inserts != null) {\n inserts();\n }\n if (creates != null) {\n creates();\n }\n if (updates != null) {\n updates();\n }\n if (deletes != null) {\n deletes();\n }\n }", "@Override\n\tpublic List<WxProcessDefinition> queryAll() {\n\t\tCriteriaBuilder cb = this.getCriteriaBuilder();\n\t\tCriteriaQuery<WxProcessDefinition> c = cb.createQuery(getEntityClass());\n\t\tRoot<WxProcessDefinition> root = c.from(getEntityClass());\n\t\tc.orderBy(cb.asc(root.get(\"index\")));\n\t\treturn super.query(c.select(root), null, null);\n\t}", "private void queryItems() {\n int preferredPageSize = 10;\n CosmosQueryRequestOptions queryOptions = new CosmosQueryRequestOptions();\n //queryOptions.setEnableCrossPartitionQuery(true); //No longer necessary in SDK v4\n // Set populate query metrics to get metrics around query executions\n queryOptions.setQueryMetricsEnabled(true);\n\n CosmosPagedIterable<Family> familiesPagedIterable = container.queryItems(\n \"SELECT * FROM Family WHERE Family.lastName IN ('Andersen', 'Wakefield', 'Johnson')\", queryOptions, Family.class);\n\n familiesPagedIterable.iterableByPage(preferredPageSize).forEach(cosmosItemPropertiesFeedResponse -> {\n logger.info(\"Got a page of query result with \" +\n cosmosItemPropertiesFeedResponse.getResults().size() + \" items(s)\"\n + \" and request charge of \" + cosmosItemPropertiesFeedResponse.getRequestCharge());\n\n logger.info(\"Item Ids \" + cosmosItemPropertiesFeedResponse\n .getResults()\n .stream()\n .map(Family::getId)\n .collect(Collectors.toList()));\n });\n // </QueryItems>\n }", "@Override\n\tpublic List queryAll() throws Exception {\n\t\treturn null;\n\t}", "public int getQueriesCount() {\n return queries_.size();\n }", "public Iterable<String> query(String query) {\n\t\tif (query == null || query == \"\")\n\t\t\treturn null;\n\t\tString request = query;\n\t\tif (query.endsWith(\"*\"))\n\t\t\trequest = query.substring(0, query.indexOf('*'));\n\t\tSystem.out.println(request);\n\t\tString toElement = request.substring(0, request.length() - 1);\n\t\tchar ch = request.charAt(request.length() - 1);\n\t\tch += 1;\n\t\ttoElement += ch;\n\t\tSystem.out.println(toElement);\n\t\treturn sd.subSet(request, true, toElement, false);\n\t}", "@Transactional(propagation = Propagation.REQUIRED, value = \"jamiTransactionManager\", readOnly = true)\n public Iterator<Experiment> iterateAll(String queryCount, String query, Map<String, Object> parameters) {\n return new IntactQueryResultIterator<Experiment>((ExperimentService) ApplicationContextProvider.getBean(\"experimentService\"), query, queryCount, parameters);\n }", "@Override\r\n\tpublic List<String> queryAll() {\n\t\tList<String> list = homePageDao.queryAll();\r\n\t\treturn list;\r\n\t}", "public static Iterator<?> query(QueryLocator locator) {\n return getService().query(locator);\n }", "public DbIterator iterator() {\n \t\tArrayList<Tuple> tuples = new ArrayList<Tuple>(); //tuples to return\n TupleDesc desc;\n String[] names;\n\t \tType[] types;\n\t \t// these will be the TupleDesc to return\n\t \tif (gbfield == Aggregator.NO_GROUPING){\n\t \t\tnames = new String[] {\"aggregateVal\"};\n\t \t\ttypes = new Type[] {Type.INT_TYPE};\n\t \t} else {\n\t \t\tnames = new String[] {\"groupVal\", \"aggregateVal\"};\n\t \t\ttypes = new Type[] {gbfieldtype, Type.INT_TYPE};\n\t \t}\n\t \tdesc = new TupleDesc(types, names);\n\t \t\n\t \tTuple toAdd;\n\t \t// iterate over the GROUP BY entries and make the tuples\n\t \tIterator<Map.Entry<Field, Integer>> it = gbcount.entrySet().iterator();\n\t \tMap.Entry<Field, Integer> nextfield;\n\t \tint aggregateVal = 0;\n\t \twhile(it.hasNext()) {\n\t \t\tnextfield = it.next();\n\t \t\taggregateVal = nextfield.getValue();\n\t \t\ttoAdd = new Tuple(desc);\n\t \t\tif(gbfield == Aggregator.NO_GROUPING) {\n\t \t\t\ttoAdd.setField(0, new IntField(aggregateVal));\n\t \t\t} else {\n\t \t\t\ttoAdd.setField(0, nextfield.getKey());\n\t \t\t\ttoAdd.setField(1, new IntField(aggregateVal));\n\t \t\t}\n\t \t\ttuples.add(toAdd);\n\t \t}\n\t \treturn new TupleIterator(desc, tuples);\n }", "public List<Document> execute(){\n if(!advancedQuery)\n return convertToDocumentsList(executeRegularQuery());\n else\n return convertToDocumentsList(executeAdvancedQuery());\n }", "public Iterator iterator() {\n maintain();\n return new MyIterator(collection.iterator());\n }", "public Iterator<QuantifiedItemDTO> getIterator() {\r\n\t\treturn items.iterator();\r\n\t}", "public Iterator<?> xpathIterator(Collection<?> collection, String query) {\n JXPathContext pathContext = JXPathContext.newContext(collection);\n Iterator<?> result = null;\n try {\n result = pathContext.iteratePointers(query);\n } catch (JXPathNotFoundException e) {\n logger.log(Level.WARNING, \"JXPath exception: {0}\", e.getMessage());\n }\n return result;\n }", "@Override\n public Iterator<Entity> iterator() {\n return entities.iterator();\n }", "@Override\n public Iterator<Item> findAll(Context context) throws SQLException\n {\n return itemDAO.findAll(context, true);\n }", "public Iterator<OpenERPRecord> iterator() {\r\n\t\treturn records.iterator();\r\n\t}", "List<QueryKey> listQueryKeys();", "public DatabaseQuery getQuery() {\n return query;\n }", "public int size()\n {\n return queries.size();\n }", "public Iterator getTransactions() {\n return (transactions.listIterator());\n }", "private SeqIter query(final int db, final int qu) throws Exception {\r\n final int size = qressizes[db * nqueries + qu];\r\n final double qtime = qt[db * nqueries + qu];\r\n \r\n if(size == 0) return new SeqIter();\r\n \r\n // query and cache result\r\n final String que = XQM + \"for $i score $s in \" +\r\n queries.get(qu) + \" order by $s descending \" +\r\n \"return (basex:sum-path($i), $s, base-uri($i))\";\r\n \r\n final Process proc = new XQuery(que);\r\n final CachedOutput res = new CachedOutput();\r\n if(session.execute(proc)) session.output(res);\r\n \r\n final SeqIter sq = new SeqIter();\r\n final StringTokenizer st = new StringTokenizer(res.toString(), \" \");\r\n String lp = \"\";\r\n int z = 0;\r\n while(st.hasMoreTokens() && z < size) {\r\n qtimes[qu] += qtime;\r\n final String p = st.nextToken();\r\n if(!st.hasMoreTokens()) break;\r\n final String s = st.nextToken();\r\n if(!st.hasMoreTokens()) break;\r\n String uri = st.nextToken();\r\n //while(uri.indexOf(\".xml\") == -1) uri = st.nextToken();\r\n uri = uri.substring(uri.lastIndexOf('/') + 1);\r\n final String tmp = uri + \";\" + p;\r\n if(!lp.equals(tmp)) {\r\n final Str str = Str.get(token(uri + \";\" + p));\r\n str.score(Double.parseDouble(s));\r\n sq.add(str);\r\n lp = tmp;\r\n }\r\n z++;\r\n }\r\n \r\n Main.outln(\"Query % on %: %\", qu + 1, databases.get(db), qtime);\r\n return sq;\r\n }", "public List<QueryDescriptor> getSystemQueries()\n {\n List<QueryDescriptor> queries = new ArrayList<QueryDescriptor>();\n Map<String, QueryDescriptor> Queries = ((DemoQueryModel) _queryModel).getQueries();\n Iterator keys = Queries.keySet().iterator();\n while (keys != null && keys.hasNext())\n {\n Object key = keys.next();\n QueryDescriptor qd = Queries.get(key);\n Object queryType = qd.getUIHints().get(QueryDescriptor.UIHINT_IMMUTABLE);\n\n // For SystemQueries, immutable is null or true\n if (queryType == null || queryType.equals(Boolean.TRUE))\n {\n queries.add(qd);\n }\n }\n\n return queries;\n }", "public List<QueryDescriptor> getUserQueries()\n {\n List<QueryDescriptor> queries = new ArrayList<QueryDescriptor>();\n Map<String, QueryDescriptor> Queries = ((DemoQueryModel) _queryModel).getQueries();\n Iterator keys = Queries.keySet().iterator();\n while (keys != null && keys.hasNext())\n {\n Object key = keys.next();\n QueryDescriptor qd = Queries.get(key);\n Object queryType = qd.getUIHints().get(QueryDescriptor.UIHINT_IMMUTABLE);\n\n // For userQueries, immutable is false\n if (queryType != null && queryType.equals(Boolean.FALSE))\n {\n queries.add(qd);\n }\n }\n\n return queries;\n }", "IQuery getQuery();", "@Override\n public Iterator<Item> iterator() {\n return new DequeIterator<Item>(first);\n }", "public IQuestionIterator iterator() {\n\t\treturn getQuestions().iterator();\n\t}", "public DbIterator iterator() {\n \tTupleDesc td = generateTupleDesc();\n List<Tuple> tuples = new ArrayList<Tuple>();\n if(gbField == NO_GROUPING){\n \tTuple tuple = new Tuple(td);\n \ttuple.setField(0, new IntField(tupleCounts.get(null)));\n \ttuples.add(tuple);\n } else {\n \tfor(Object key : tupleCounts.keySet()){\n \t\tTuple tuple = new Tuple(td);\n \t\ttuple.setField(0, (Field)key);\n \t\ttuple.setField(1, new IntField(tupleCounts.get(key)));\n \t\ttuples.add(tuple);\n \t}\n }\n return new TupleIterator(td, tuples);\n }", "public Iterator<Join> iterator()\n {\n return joins.iterator();\n }", "public DbIterator iterator() {\n\t\tif(gbfield==-1)\n\t\t\treturn new AggregateIterator(false);\n\t\treturn new AggregateIterator(true);\n\t}", "@Override\n\tpublic List<Student> queryAll() {\n\t\treturn sDao.queryAll();\n\t}", "public Iterator<Item> iterator() {\n\t\treturn new ListIterator(); \n\t\t}", "public List<SubQueryDef> getSubQueries();", "@Override\r\n public Iterator<Item> iterator() {\r\n return new DequeIterator<Item>(this);\r\n }", "public Iterable<Key> keys() {\n Queue<Key> queue = new Queue<Key>();\n for (int i = 0; i < m; i++) {\n for (Key key : st[i].keys())\n queue.enqueue(key);\n }\n return queue;\n }", "@Override\n public Iterator<Long> iterator() {\n Collection<Long> c = new ArrayList<>();\n synchronized (data) {\n for (int i=0; i<data.length; i++)\n c.add(get(i));\n }\n return c.iterator();\n }", "private ArrayList<WordDocument> executeRegularQuery(){\n String[] splitedQuery = this.query.split(\" \");\n ArrayList<WordDocument> listOfWordDocuments = new ArrayList<WordDocument>();\n String word = \"\";\n\n for(int i = 0; i < splitedQuery.length; i++){\n if(!isOrderByCommand(splitedQuery[i]) && i == 0) {\n word = splitedQuery[i];\n\n if(cache.isCached(word))\n addWithoutDuplicate(listOfWordDocuments, cache.getCachedResult(word));\n else\n addWithoutDuplicate(listOfWordDocuments, getDocumentsWhereWordExists(word));\n\n }else if(i >= 1 && isOrderByCommand(splitedQuery[i])) {\n subQueries.add(word);\n listOfWordDocuments = orderBy(listOfWordDocuments, splitedQuery[++i], splitedQuery[++i]);\n break;\n }\n else\n throw new IllegalArgumentException();\n }\n\n return listOfWordDocuments;\n }", "java.util.List<java.lang.String>\n getQueryItemsList();", "public Iterator<Item> iterator() {\n return new ListIterator();\n\n }", "public Iterator<Item> iterator() {\n return new ListIterator();\n }", "public Iterator<Item> iterator() {\n return new ListIterator();\n }", "public Iterator<Item> iterator() {\n return new ListIterator();\n }", "public Iterator<Item> iterator() {\n return new ListIterator();\n }", "public Iterator<Item> iterator() {\n return new ListIterator();\n }", "public Iterator<Item> iterator() {\n return new ListIterator();\n }", "public List<T> query(QueryObject qo) {\n\t\treturn null;\n\t}", "@SuppressWarnings(\"unchecked\")\r\n public Iterator<Tuple<T>> iterator() {\n Iterator<Tuple<T>> fi = (Iterator<Tuple<T>>) new FilteredIterator<T>(resultTable.iterator(), filterOn);\r\n return fi;\r\n }", "public Cursor fetchAllEntries() {\n return mDb.query(DATABASE_TABLE, null, null, null, null, null, null);\n }", "public JTestDefinition listOfQueries(){\n Iterable<JHttpQuery> queries = Stream.of(\"100\", \"50\", \"25\")\n .map(q -> new JHttpQuery().get().path(\"/sleep\", q))\n .collect(Collectors.toList());\n return JTestDefinition.builder(Id.of(\"queries list\"), getEndpoints())\n .withQueryProvider(queries)\n .build();\n }", "public List<Page> searchAll() {\n return mysqlDao.searchAll();\n }", "Query query();", "List<E> queryAll(String namedQuery);", "public Iterator<Item> iterator() {\n\n return new QueueIterator<>(copy());\n }", "public ArrayList<T> all() throws SQLException {\n\t\tPreparedStatement stmt = DatabaseConnection.get().prepareStatement(\"select * from \"+table_name() + order_string());\n\t\treturn where(stmt);\n\t}", "public ResultSet queryList()\n\t\t\tthrows SQLException\n\t{\n\t\treturn queryList(this.dbColumnNames,\"ID\",true);\n\t}", "@Override\n\tpublic ArrayList<Parent> queryAllOrderPage(int begin, int size) {\n\t\treturn parentDao.queryAllOrderPage(begin, size);\n\t}" ]
[ "0.6601172", "0.63295406", "0.6273219", "0.61868316", "0.6106422", "0.6030237", "0.6017817", "0.6002854", "0.5980338", "0.5969827", "0.5913603", "0.5860767", "0.5841765", "0.58127797", "0.5802413", "0.5791305", "0.5786459", "0.57830966", "0.5754241", "0.5752892", "0.57381386", "0.56669897", "0.56669897", "0.56669897", "0.56488055", "0.5639307", "0.5636321", "0.5630279", "0.56282645", "0.56221503", "0.55982643", "0.5574962", "0.55338943", "0.55248684", "0.55176824", "0.55101305", "0.5502557", "0.549708", "0.54941636", "0.54896677", "0.5488827", "0.5475451", "0.5459363", "0.5446469", "0.54373485", "0.5431062", "0.5406385", "0.5403004", "0.54007685", "0.5393015", "0.53692025", "0.535923", "0.5359203", "0.5357826", "0.5351892", "0.53182125", "0.53179735", "0.53179", "0.5316569", "0.5314105", "0.5301939", "0.52986187", "0.52982795", "0.52756196", "0.5267708", "0.5263014", "0.5262897", "0.5262499", "0.5241674", "0.5239205", "0.5234878", "0.5233492", "0.5229653", "0.522084", "0.5215897", "0.5208556", "0.51912946", "0.518803", "0.51785195", "0.5174868", "0.51743364", "0.51661193", "0.51656896", "0.51653606", "0.51653606", "0.51653606", "0.51653606", "0.51653606", "0.51653606", "0.51653194", "0.5165213", "0.51639694", "0.5163958", "0.51525414", "0.5148955", "0.51470447", "0.5142118", "0.5136802", "0.51301074", "0.5126373" ]
0.6522874
1
Processes requests for both HTTP GET and POST methods.
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); try { out.println("<html>"); out.println("<head>"); out.println("<title>Servlet JSONCollector</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>Servlet JSONCollector at " + request.getContextPath () + "</h1>"); out.println("</body>"); out.println("</html>"); } finally { out.close(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {\n final String method = req.getParameter(METHOD);\n if (GET.equals(method)) {\n doGet(req, resp);\n } else {\n resp.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);\n }\n }", "private void processRequest(HttpServletRequest request, HttpServletResponse response) {\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n // only POST should be used\n doPost(request, response);\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\nSystem.err.println(\"=====================>>>>>123\");\n\t\tString key=req.getParameter(\"method\");\n\t\tswitch (key) {\n\t\tcase \"1\":\n\t\t\tgetProvinces(req,resp);\n\t\t\tbreak;\n\t\tcase \"2\":\n\t\t\tgetCities(req,resp);\t\t\t\n\t\t\tbreak;\n\t\tcase \"3\":\n\t\t\tgetAreas(req,resp);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n\t\tdoPost(req, resp);\r\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\n\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}", "@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t\tdoGet(req, resp);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n processRequest(request, response);\n }", "@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tprocessRequest(request, response);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tprocessRequest(request, response);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t\t\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }" ]
[ "0.7004024", "0.66585696", "0.66031146", "0.6510023", "0.6447109", "0.64421695", "0.64405906", "0.64321136", "0.6428049", "0.6424289", "0.6424289", "0.6419742", "0.6419742", "0.6419742", "0.6418235", "0.64143145", "0.64143145", "0.6400266", "0.63939095", "0.63939095", "0.639271", "0.63919044", "0.63919044", "0.63903785", "0.63903785", "0.63903785", "0.63903785", "0.63887113", "0.63887113", "0.6380285", "0.63783026", "0.63781637", "0.637677", "0.63761306", "0.6370491", "0.63626", "0.63626", "0.63614637", "0.6355308", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896", "0.63546896" ]
0.0
-1
Handles the HTTP GET method.
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doGet( )\n {\n \n }", "@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}", "@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}", "@Override\r\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\r\n\t}", "void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metGet(request, response);\n }", "public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"GET log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) return;\r\n\tif (\"get-response\".equals( requestId )) {\r\n\t try {\r\n\t\tonMEVPollsForResponse( req, resp );\r\n\t } catch (Exception e) {\r\n\t\tlogError( req, resp, e, \"MEV polling error\" );\r\n\t\tsendError( resp, \"MEV polling error: \" + e.toString() );\r\n\t }\r\n\t}\r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n \r\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t\t\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}", "public void doGet() throws IOException {\n\n // search ressource\n byte[] contentByte = null;\n try {\n contentByte = ToolBox.readFileByte(RESOURCE_DIRECTORY, this.url);\n this.statusCode = OK;\n ContentType contentType = new ContentType(this.extension);\n sendHeader(statusCode, contentType.getContentType(), contentByte.length);\n } catch (IOException e) {\n System.out.println(\"Ressource non trouvé\");\n statusCode = NOT_FOUND;\n contentByte = ToolBox.readFileByte(RESPONSE_PAGE_DIRECTORY, \"pageNotFound.html\");\n sendHeader(statusCode, \"text/html\", contentByte.length);\n }\n\n this.sendBodyByte(contentByte);\n }", "public HttpResponseWrapper invokeGET(String path) {\n\t\treturn invokeHttpMethod(HttpMethodType.HTTP_GET, path, \"\");\n\t}", "@Override\n\tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t}", "public Result get(Get get) throws IOException;", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) {\n System.out.println(\"[Servlet] GET request \" + request.getRequestURI());\n\n response.setContentType(FrontEndServiceDriver.APP_TYPE);\n response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);\n\n try {\n String url = FrontEndServiceDriver.primaryEventService +\n request.getRequestURI().replaceFirst(\"/events\", \"\");\n HttpURLConnection connection = doGetRequest(url);\n\n if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n PrintWriter pw = response.getWriter();\n JsonObject responseBody = (JsonObject) parseResponse(connection);\n\n response.setStatus(HttpURLConnection.HTTP_OK);\n pw.println(responseBody.toString());\n }\n }\n catch (Exception ignored) {}\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tSystem.out.println(\"get\");\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \tSystem.out.println(\"---here--get--\");\n processRequest(request, response);\n }", "@Override\n public final void doGet() {\n try {\n checkPermissions(getRequest());\n // GET one\n if (id != null) {\n output(api.runGet(id, getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER)));\n } else if (countParameters() == 0) {\n throw new APIMissingIdException(getRequestURL());\n }\n // Search\n else {\n\n final ItemSearchResult<?> result = api.runSearch(Integer.parseInt(getParameter(PARAMETER_PAGE, \"0\")),\n Integer.parseInt(getParameter(PARAMETER_LIMIT, \"10\")), getParameter(PARAMETER_SEARCH),\n getParameter(PARAMETER_ORDER), parseFilters(getParameterAsList(PARAMETER_FILTER)),\n getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER));\n\n head(\"Content-Range\", result.getPage() + \"-\" + result.getLength() + \"/\" + result.getTotal());\n\n output(result.getResults());\n }\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tthis.service(req, resp);\r\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t}", "@RequestMapping(value = \"/{id}\", method = RequestMethod.GET)\n public void get(@PathVariable(\"id\") String id, HttpServletRequest req){\n throw new NotImplementedException(\"To be implemented\");\n }", "@Override\npublic void get(String url) {\n\t\n}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString action = req.getParameter(\"action\");\r\n\t\t\r\n\t\tif(action == null) {\r\n\t\t\taction = \"List\";\r\n\t\t}\r\n\t\t\r\n\t\tswitch(action) {\r\n\t\t\tcase \"List\":\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest request, \n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tSystem.out.println(\"Routed to doGet\");\n\t}", "@NonNull\n public String getAction() {\n return \"GET\";\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "@Override\r\nprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t process(req,resp);\r\n\t }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\n\tpublic HttpResponse get(final String endpoint) {\n\t\treturn httpRequest(HTTP_GET, endpoint, null);\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste doget\");\r\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/plain\");\n // Actual logic goes here.\n PrintWriter out = response.getWriter();\n out.println(\"Wolken,5534-0848-5100,0299-6830-9164\");\n\ttry \n\t{\n Get g = new Get(Bytes.toBytes(request.getParameter(\"userid\")));\n Result r = table.get(g);\n byte [] value = r.getValue(Bytes.toBytes(\"v\"),\n Bytes.toBytes(\"\"));\n\t\tString valueStr = Bytes.toString(value);\n\t\tout.println(valueStr);\n\t}\n\tcatch (Exception e)\n\t{\n\t\tout.println(e);\n\t}\n }", "@Override\r\n public void doGet(String path, HttpServletRequest request, HttpServletResponse response)\r\n throws Exception {\r\n // throw new UnsupportedOperationException();\r\n System.out.println(\"Inside the get\");\r\n response.setContentType(\"text/xml\");\r\n response.setCharacterEncoding(\"utf-8\");\r\n final Writer w = response.getWriter();\r\n w.write(\"inside the get\");\r\n w.close();\r\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n System.out.println(\"Console: doGET visited\");\n String result = \"\";\n //get the user choice from the client\n String choice = (request.getPathInfo()).substring(1);\n response.setContentType(\"text/plain;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n //methods call appropriate to user calls\n if (Integer.valueOf(choice) == 3) {\n result = theBlockChain.toString();\n if (result != null) {\n out.println(result);\n response.setStatus(200);\n //set status if result output is not generated\n } else {\n response.setStatus(401);\n return;\n }\n }\n //verify chain method\n if (Integer.valueOf(choice) == 2) {\n response.setStatus(200);\n boolean validity = theBlockChain.isChainValid();\n out.print(\"verifying:\\nchain verification: \");\n out.println(validity);\n }\n }", "@Override\n public DataObjectResponse<T> handleGET(DataObjectRequest<T> request)\n {\n if(getRequestValidator() != null) getRequestValidator().validateGET(request);\n\n DefaultDataObjectResponse<T> response = new DefaultDataObjectResponse<>();\n try\n {\n VisibilityFilter<T, DataObjectRequest<T>> visibilityFilter = visibilityFilterMap.get(VisibilityMethod.GET);\n List<Query> queryList = new LinkedList<>();\n if(request.getQueries() != null)\n queryList.addAll(request.getQueries());\n\n if(request.getId() != null)\n {\n // if the id is specified\n queryList.add(new ById(request.getId()));\n }\n\n DataObjectFeed<T> feed = objectPersister.retrieve(queryList);\n if(feed == null)\n feed = new DataObjectFeed<>();\n List<T> filteredObjects = visibilityFilter.filterByVisible(request, feed.getAll());\n response.setCount(feed.getCount());\n response.addAll(filteredObjects);\n }\n catch(PersistenceException e)\n {\n ObjectNotFoundException objectNotFoundException = new ObjectNotFoundException(String.format(OBJECT_NOT_FOUND_EXCEPTION, request.getId()), e);\n response.setErrorResponse(ErrorResponseFactory.objectNotFound(objectNotFoundException, request.getCID()));\n }\n return response;\n }", "public void handleGet( HttpExchange exchange ) throws IOException {\n switch( exchange.getRequestURI().toString().replace(\"%20\", \" \") ) {\n case \"/\":\n print(\"sending /MainPage.html\");\n sendResponse( exchange, FU.readFromFile( getReqDir( exchange )), 200);\n break;\n case \"/lif\":\n // send log in page ( main page )\n sendResponse ( exchange, FU.readFromFile(getReqDir(exchange)), 200);\n //\n break;\n case \"/home.html\":\n\n break;\n case \"/book.html\":\n\n break;\n default:\n //checks if user is logged in\n\n //if not send log in page\n //if user is logged in then\n print(\"Sending\");\n String directory = getReqDir( exchange ); // dont need to do the / replace as no space\n File page = new File( getReqDir( exchange) );\n\n // IMPLEMENT DIFFERENT RESPONSE CODE FOR HERE IF EXISTS IS FALSE OR CAN READ IS FALSE\n sendResponse(exchange, FU.readFromFile(directory), 200);\n break;\n }\n }", "public int handleGET(String requestURL) throws ClientProtocolException, IOException{\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\thttpGet = new HttpGet(requestURL);\t\t\r\n\t\t\t\t\t\t\r\n\t\tinputsource=null;\r\n\t\t\t\r\n\t\toutputString=\"\";\r\n\t\t\r\n\t\t//taking response by executing http GET object\r\n\t\tCloseableHttpResponse response = httpclient.execute(httpGet);\t\t\r\n\t\r\n\t\t/* \r\n\t\t * \tThe underlying HTTP connection is still held by the response object\r\n\t\t\tto allow the response content to be streamed directly from the network socket.\r\n\t\t\tIn order to ensure correct deallocation of system resources\r\n\t\t\tthe user MUST call CloseableHttpResponse.close() from a finally clause.\r\n\t\t\tPlease note that if response content is not fully consumed the underlying\r\n\t\t\tconnection cannot be safely re-used and will be shut down and discarded\r\n\t\t\tby the connection manager.\r\n\t\t */\r\n\t\t\r\n\t\t\tstatusLine= response.getStatusLine().toString();\t\t//status line\r\n\t\t\t\r\n\t\t\tHttpEntity entity1 = response.getEntity();\t\t\t\t//getting response entity from server response \t\r\n\t\t\t\t\t\r\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(entity1.getContent()));\r\n\r\n\t\t\tString line;\r\n\t\t\twhile((line=br.readLine())!=null)\r\n\t\t\t{\r\n\t\t\t\toutputString=outputString+line.toString();\r\n\t }\r\n\t\t\t\r\n\t\t\t//removing spaces around server response string.\r\n\t\t\toutputString.trim();\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t//converting server response string into InputSource.\r\n\t\t\tinputsource = new InputSource(new StringReader(outputString));\t\r\n\t\t\t\r\n\t\t\t// and ensure it is fully consumed\r\n\t\t\tEntityUtils.consume(entity1);\t\t\t//consuming entity.\r\n\t\t\tresponse.close();\t\t\t\t\t\t//closing response.\r\n\t\t\tbr.close();\t\t\t\t\t\t\t\t//closing buffered reader\r\n\t\t\t\r\n\t\t\t//returning response code\r\n\t\t\treturn response.getStatusLine().getStatusCode();\r\n\t\r\n\t}", "@Override\n\tprotected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t logger.error(\"BISHUNNN CALLED\");\n\t\tString category = request.getParameter(\"category\").trim();\n\t\tGetHttpCall getHttpCall = new GetHttpCall();\n\t\turl = APIConstants.baseURL+category.toLowerCase();\n\t\tresponseString = getHttpCall.execute(url);\n\t\tresponse.getWriter().write(responseString);\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n //processRequest(request, response);\r\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tPrintWriter out = resp.getWriter();\n\t\tout.print(\"<h1>Hello from your doGet method!</h1>\");\n\t}", "public void doGet(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException, ServletException {\n response.setContentType(TYPE_TEXT_HTML.label);\n response.setCharacterEncoding(UTF8.label);\n request.setCharacterEncoding(UTF8.label);\n String path = request.getRequestURI();\n logger.debug(RECEIVED_REQUEST + path);\n Command command = null;\n try {\n command = commands.get(path);\n command.execute(request, response);\n } catch (NullPointerException e) {\n logger.error(REQUEST_PATH_NOT_FOUND);\n request.setAttribute(JAVAX_SERVLET_ERROR_STATUS_CODE, 404);\n command = commands.get(EXCEPTION.label);\n command.execute(request, response);\n }\n }", "public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString search = req.getParameter(\"searchBook\");\n\t\tString output=search;\n\n\t\t//redirect output to view search.jsp\n\t\treq.setAttribute(\"output\", output);\n\t\tresp.setContentType(\"text/json\");\n\t\tRequestDispatcher view = req.getRequestDispatcher(\"search.jsp\");\n\t\tview.forward(req, resp);\n\t\t\t\n\t}", "public void doGet( HttpServletRequest request, HttpServletResponse response )\n throws ServletException, IOException\n {\n handleRequest( request, response, false );\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response handleGet() {\n Gson gson = GSONFactory.getInstance();\n List allEmployees = getAllEmployees();\n\n if (allEmployees == null) {\n allEmployees = new ArrayList();\n }\n\n Response response = Response.ok().entity(gson.toJson(allEmployees)).build();\n return response;\n }", "@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows IOException, ServletException {\n\t\tsuper.doGet(request, response);\t\t\t\n\t}", "private static String sendGET(String getURL) throws IOException {\n\t\tURL obj = new URL(getURL);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\t\tcon.setRequestMethod(\"GET\");\n\t\tString finalResponse = \"\";\n\n\t\t//This way we know if the request was processed successfully or there was any HTTP error message thrown.\n\t\tint responseCode = con.getResponseCode();\n\t\tSystem.out.println(\"GET Response Code : \" + responseCode);\n\t\tif (responseCode == HttpURLConnection.HTTP_OK) { // success\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t\tString inputLine;\n\t\t\tStringBuffer buffer = new StringBuffer();\n\n\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\tbuffer.append(inputLine);\n\t\t\t}\n\t\t\tin.close();\n\n\t\t\t// print result\n\t\t\tfinalResponse = buffer.toString();\n\t\t} else {\n\t\t\tSystem.out.println(\"GET request not worked\");\n\t\t}\n\t\treturn finalResponse;\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n //processRequest(request, response);\n }", "@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}", "public BufferedReader reqGet(final String route) throws\n ServerStatusException, IOException {\n System.out.println(\"first reqGet\");\n return reqGet(route, USER_AGENT);\n }", "HttpGet getRequest(HttpServletRequest request, String address) throws IOException;", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override \r\nprotected void doGet(HttpServletRequest request, HttpServletResponse response) \r\nthrows ServletException, IOException { \r\nprocessRequest(request, response); \r\n}", "protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\n String action = request.getParameter(\"action\");\r\n\r\n try {\r\n switch (action)\r\n {\r\n case \"/getUser\":\r\n \tgetUser(request, response);\r\n break;\r\n \r\n }\r\n } catch (Exception ex) {\r\n throw new ServletException(ex);\r\n }\r\n }", "@Override\n protected void doGet\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}", "@Test\r\n\tpublic void doGet() throws Exception {\n\t\tCloseableHttpClient httpClient = HttpClients.createDefault();\r\n\t\t// Create a GET object and pass a url to it\r\n\t\tHttpGet get = new HttpGet(\"http://www.google.com\");\r\n\t\t// make a request\r\n\t\tCloseableHttpResponse response = httpClient.execute(get);\r\n\t\t// get response as result\r\n\t\tSystem.out.println(response.getStatusLine().getStatusCode());\r\n\t\tHttpEntity entity = response.getEntity();\r\n\t\tSystem.out.println(EntityUtils.toString(entity));\r\n\t\t// close HttpClient\r\n\t\tresponse.close();\r\n\t\thttpClient.close();\r\n\t}", "private void requestGet(String endpoint, Map<String, String> params, RequestListener listener) throws Exception {\n String requestUri = Constant.API_BASE_URL + ((endpoint.indexOf(\"/\") == 0) ? endpoint : \"/\" + endpoint);\n get(requestUri, params, listener);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint i = request.getRequestURI().lastIndexOf(\"/\") + 1;\n\t\tString action = request.getRequestURI().substring(i);\n\t\tSystem.out.println(action);\n\t\t\n\t\tString view = \"Error\";\n\t\tObject model = \"service Non disponible\";\n\t\t\n\t\tif (action.equals(\"ProductsList\")) {\n\t\t\tview = productAction.productsList();\n\t\t\tmodel = productAction.getProducts();\n\t\t}\n\t\t\n\t\trequest.setAttribute(\"model\", model);\n\t\trequest.getRequestDispatcher(prefix + view + suffix).forward(request, response); \n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t throws ServletException, IOException {\n\tprocessRequest(request, response);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tcommandAction(request,response);\r\n\t}" ]
[ "0.7589609", "0.71665615", "0.71148175", "0.705623", "0.7030174", "0.70291144", "0.6995984", "0.697576", "0.68883485", "0.6873811", "0.6853569", "0.6843572", "0.6843572", "0.6835363", "0.6835363", "0.6835363", "0.68195957", "0.6817864", "0.6797789", "0.67810035", "0.6761234", "0.6754993", "0.6754993", "0.67394847", "0.6719924", "0.6716244", "0.67054695", "0.67054695", "0.67012346", "0.6684415", "0.6676695", "0.6675696", "0.6675696", "0.66747975", "0.66747975", "0.6669016", "0.66621476", "0.66621476", "0.66476154", "0.66365504", "0.6615004", "0.66130257", "0.6604073", "0.6570195", "0.6551141", "0.65378064", "0.6536579", "0.65357745", "0.64957607", "0.64672184", "0.6453189", "0.6450501", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.64067316", "0.6395873", "0.6379907", "0.63737476", "0.636021", "0.6356937", "0.63410467", "0.6309468", "0.630619", "0.630263", "0.63014317", "0.6283933", "0.62738425", "0.62680805", "0.62585783", "0.62553537", "0.6249043", "0.62457556", "0.6239428", "0.6239428", "0.62376446", "0.62359244", "0.6215947", "0.62125194", "0.6207376", "0.62067443", "0.6204527", "0.6200444", "0.6199078", "0.61876005", "0.6182614", "0.61762017", "0.61755335", "0.61716276", "0.6170575", "0.6170397", "0.616901" ]
0.0
-1
Handles the HTTP POST method.
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }", "public void doPost( )\n {\n \n }", "@Override\n public String getMethod() {\n return \"POST\";\n }", "public String post();", "@Override\n\tpublic void doPost(HttpRequest request, AbstractHttpResponse response)\n\t\t\tthrows IOException {\n\t\t\n\t}", "@Override\n public String getMethod() {\n return \"POST\";\n }", "public ResponseTranslator post() {\n setMethod(\"POST\");\n return doRequest();\n }", "protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n }", "public void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows IOException {\n\n\t}", "public void postData() {\n\n\t}", "@Override\n public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {\n logger.warn(\"doPost Called\");\n handle(req, res);\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metPost(request, response);\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tpublic void postHandle(WebRequest request, ModelMap model) throws Exception {\n\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\r\n\t\t\r\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "@Override\n\tprotected HttpMethod requestMethod() {\n\t\treturn HttpMethod.POST;\n\t}", "@Override\n\tprotected void handlePostBody(HashMap<String, HashMap<String, String>> params, DataFormat format) throws Exception {\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n }", "@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\n\n\tpublic void handlePOST(CoapExchange exchange) {\n\t\tFIleStream read = new FIleStream();\n\t\tread.tempWrite(Temp_Path, exchange.getRequestText());\n\t\texchange.respond(ResponseCode.CREATED, \"POST successfully!\");\n\t\t_Logger.info(\"Receive post request:\" + exchange.getRequestText());\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.getWriter().println(\"go to post method in manager\");\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "public abstract boolean handlePost(FORM form, BindException errors) throws Exception;", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n super.doPost(req, resp);\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\n\t\t\t\n\t\t \n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "public void processPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException\n {\n }", "@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}", "@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\n\t}", "public void doPost(HttpServletRequest request ,HttpServletResponse response){\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "public void post(){\n\t\tHttpClient client = new HttpClient();\n\n\t\tPostMethod post = new PostMethod(\"http://211.138.245.85:8000/sso/POST\");\n//\t\tPostMethod post = new PostMethod(\"/eshopclient/product/show.do?id=111655\");\n//\t\tpost.addRequestHeader(\"Cookie\", cookieHead);\n\n\n\t\ttry {\n\t\t\tSystem.out.println(\"��������====\");\n\t\t\tint status = client.executeMethod(post);\n\t\t\tSystem.out.println(status);\n\t\t} catch (HttpException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n//\t\ttaskCount++;\n//\t\tcountDown--;\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"POST log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) {\r\n\t try {\r\n\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t } catch (IOException ex) {\r\n\t }\r\n\t logError( req, resp, new Exception(\"Unrecognized POST\"), \"\" );\r\n\t sendError(resp, \"Unrecognized POST\");\r\n\t} else\r\n\t if (\"post-request\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onMEVPostsRequest( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"MEV POST error\" );\r\n\t\t sendError( resp, \"MEV POST error: \" + e.toString() );\r\n\t\t}\r\n\t } else if (\"post-response\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onPVMPostsResponse( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"PVM POST error\" );\r\n\t\t sendError( resp, \"PVM POST error: \" + e.toString() );\r\n\t\t}\r\n\t }\r\n }", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest req, HttpServletResponse resp, Object handler, ModelAndView m)\r\n\t\t\tthrows Exception {\n\t\t\r\n\t}", "@Override\n public final void doPost() {\n try {\n checkPermissions(getRequest());\n final IItem jSonStreamAsItem = getJSonStreamAsItem();\n final IItem outputItem = api.runAdd(jSonStreamAsItem);\n\n output(JSonItemWriter.itemToJSON(outputItem));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }", "@Override\n\tvoid post() {\n\t\t\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\t\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\tSystem.out.println(\"=========interCpetor Post=========\");\r\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString method = request.getParameter(\"method\");\n\t\tswitch(method){\n\t\tcase \"Crawl\":\n\t\t\tcrawl(request, response);\n\t\t\tbreak;\n\t\tcase \"Extract\":\n\t\t\textract(request, response);\n\t\t\tbreak;\n\t\tcase \"JDBC\":\n\t\t\tjdbc(request, response);\n\t\t\tbreak;\n\t\tcase \"Indexer\":\n\t\t\tindexer(request, response);\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste dopost\");\r\n }", "protected void doPost(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response)\r\n\t/* 43: */throws ServletException, IOException\r\n\t/* 44: */{\r\n\t\t/* 45:48 */doGet(request, response);\r\n\t\t/* 46: */}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\tprocess(req,resp);\r\n\t}", "public void handlePost(SessionSrvc session, IObjectContext context)\n throws Exception\n {\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\r\n\t\tdoGet(request, response);\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}", "@Override\n protected void doPost\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (JSONException ex) {\r\n Logger.getLogger(PDCBukUpload.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\r\n protected void doPost(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws ServletException,\r\n IOException {\r\n processRequest(request,\r\n response);\r\n\r\n }", "@Override\r\n\tpublic void doPost(CustomHttpRequest request, CustomHttpResponse response) throws Exception {\n\t\tdoGet(request, response);\r\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response,\n\t\t\tObject handler, ModelAndView modelAndView) throws Exception {\n\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoHandle(request, response);\n\t}", "private void postRequest() {\n\t\tSystem.out.println(\"post request, iam playing money\");\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\n public void postHandle(HttpServletRequest request,\n HttpServletResponse response, Object handler,\n ModelAndView modelAndView) throws Exception {\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (Exception ex) {\n Logger.getLogger(PedidoController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }" ]
[ "0.73289514", "0.71383566", "0.7116213", "0.7105215", "0.7100045", "0.70236707", "0.7016248", "0.6964149", "0.6889435", "0.6784954", "0.67733276", "0.67482096", "0.66677034", "0.6558593", "0.65582114", "0.6525548", "0.652552", "0.652552", "0.652552", "0.65229493", "0.6520197", "0.6515622", "0.6513045", "0.6512626", "0.6492367", "0.64817846", "0.6477479", "0.64725804", "0.6472099", "0.6469389", "0.6456206", "0.6452577", "0.6452577", "0.6452577", "0.6450273", "0.6450273", "0.6438126", "0.6437522", "0.64339423", "0.64253825", "0.6422238", "0.6420897", "0.6420897", "0.6420897", "0.6407662", "0.64041835", "0.64041835", "0.639631", "0.6395677", "0.6354875", "0.63334197", "0.6324263", "0.62959254", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6280875", "0.6272104", "0.6272104", "0.62711537", "0.62616795", "0.62544584", "0.6251865", "0.62274224", "0.6214439", "0.62137586", "0.621211", "0.620854", "0.62023044", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61638993", "0.61603814", "0.6148914", "0.61465937", "0.61465937", "0.614548", "0.6141879", "0.6136717", "0.61313903", "0.61300284", "0.6124381", "0.6118381", "0.6118128", "0.61063534", "0.60992104", "0.6098801", "0.6096766" ]
0.0
-1
Handles the HTTP PUT method.
@Override protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { int contentLength = request.getContentLength(); logger.debug("ContentLength: " + contentLength); if (contentLength > MAX_JSON_LENGTH) { String em = "Content length of " + contentLength + " too long, max is " + MAX_JSON_LENGTH; logger.error(em); response.sendError(400, em); return; } String contentType = request.getContentType(); logger.debug("ContentType: " + contentType); if ("application/json".equalsIgnoreCase(contentType)) { JSONHandler jh = new JSONHandler(); jh.handle(request, response); return; } response.sendError(400, "Content type not supported"); response.flushBuffer(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void doPut(HttpRequest request, AbstractHttpResponse response)\n\t\t\tthrows IOException {\n\t\t\n\t}", "public void handlePut( HttpExchange exchange ) throws IOException {\n\n }", "@PUT\n @Path(\"/update\")\n public void put() {\n System.out.println(\"PUT invoked\");\n }", "@Override\n public DataObjectResponse<T> handlePUT(DataObjectRequest<T> request)\n {\n return handlePUT(request, null);\n }", "public ResponseTranslator put() {\n setMethod(\"PUT\");\n return doRequest();\n }", "void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;", "HttpPut putRequest(HttpServletRequest request, String address) throws IOException;", "@Override\n public final void doPut() {\n try {\n checkPermissions(getRequest());\n if (id == null) {\n throw new APIMissingIdException(getRequestURL());\n }\n\n final String inputStream = getInputStream();\n if (inputStream.length() == 0) {\n api.runUpdate(id, new HashMap<String, String>());\n return;\n }\n\n Item.setApplyValidatorMandatoryByDefault(false);\n final IItem item = getJSonStreamAsItem();\n api.runUpdate(id, getAttributesWithDeploysAsJsonString(item));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }", "@RequestMapping(value = \"/{id}\", method = RequestMethod.PUT)\n public void put(@PathVariable(\"id\") String id, HttpServletRequest req){\n throw new NotImplementedException(\"To be implemented\");\n }", "@Override\n public DataObjectResponse<Agenda> handlePUT(DataObjectRequest<Agenda> request)\n {\n return super.handlePUT(request);\n }", "public int handlePUT(String contentPayload, String contentType, String requestURL) throws ClientProtocolException, IOException{\r\n\t\t\r\n\t\tinputsource=null;\r\n\t\t\r\n\t\toutputString=\"\"; \r\n\t\t\r\n\t\thttpPut = new HttpPut(requestURL);\t\t\t\t\t\t// http PUT object\r\n\t\thttpPut.setHeader(\"Content-Type\", contentType);\t\t\t// setting content type\r\n\t\t\r\n\t\t//xml payload\r\n\t\tHttpEntity entity = new ByteArrayEntity(contentPayload.getBytes(\"UTF-8\"));\r\n\t\thttpPut.setEntity(entity);\r\n\t\t\r\n\t\t// creating response object to capture response from server.\r\n\t\tresponse = httpclient.execute(httpPut);\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t//response entity\r\n\t HttpEntity resEntity = response.getEntity();\r\n\t statusLine= response.getStatusLine().toString();\t\t//status line\r\n\t BufferedReader br=new BufferedReader(new InputStreamReader(resEntity.getContent()));\r\n\t \tString line;\r\n\t \t\r\n\t \t//saving response from server in outputString\r\n\t \twhile((line=br.readLine())!=null)\r\n\t \t{\r\n\t \t\toutputString=outputString+line.toString();\r\n\t \t}\r\n\t \toutputString.trim();\r\n\t \tinputsource = new InputSource(new StringReader(outputString));\r\n\t \tbr.close();\t\t\t\t\t\t\t\t\t\t\t\t//close the buffered reader\r\n\t \t\r\n\t \t//returns status code\r\n\t return response.getStatusLine().getStatusCode();\r\n\t\t\r\n\t}", "@Override\n protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n PrintWriter out = resp.getWriter();\n resp.setCharacterEncoding(\"UTF-8\");\n resp.setContentType(\"application/json\");\n resp.addHeader(\"Access-Control-Allow-Origin\", \"*\");\n resp.addHeader(\"Access-Control-Allow-Methods\", \"POST, GET, OPTIONS, PUT, DELETE, HEAD\");\n\n BufferedReader br = new BufferedReader(new InputStreamReader(req.getInputStream()));\n String data = URLDecoder.decode(br.readLine());\n// out.println(data);\n String[] dataParse = data.split(\"&\");\n Map<String, String> mapa = new HashMap<>();\n for (int i = 0; i < dataParse.length; i++) {\n String[] par = dataParse[i].split(\"=\");\n mapa.put(par[0], par[1]);\n }\n\n try {\n Contato contato = new Contato(Integer.parseInt(mapa.get(\"id\")));\n contato.setNome(mapa.get(\"nome\"));\n contato.setEmail(mapa.get(\"email\"));\n contato.setTelefone(mapa.get(\"telefone\"));\n contato.setCelular(mapa.get(\"celular\"));\n contato.altera();\n resp.setStatus(201); // status create\n } catch (SQLException e) {\n e.printStackTrace();\n resp.setStatus(500); // server error\n }\n }", "private int processPUT() throws ServerException {\r\n\t\tint statusCode;\r\n\t\tFile document = new File( request.getURI() );\r\n\t\tsynchronized ( this ) {\r\n\t\t\tif ( !document.exists() ) {\r\n\t\t\t\tBufferedOutputStream out = null;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tout = new BufferedOutputStream( new FileOutputStream( document ) );\r\n\t\t\t\t\tout.write( request.getParameterByteArray() );\r\n\t\t\t\t\tstatusCode = ResponseTable.CREATED;\r\n\t\t\t\t} catch ( IOException ioe ) {\r\n\t\t\t\t\tioe.printStackTrace();\r\n\t\t\t\t\tthrow new ServerException( ResponseTable.INTERNAL_SERVER_ERROR );\r\n\t\t\t\t} finally {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tout.close();\r\n\t\t\t\t\t} catch ( Exception e ) {\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tstatusCode = ResponseTable.NO_CONTENT;\r\n\t\t\t}\r\n\t\t}\r\n\t\tString headerMessage = createBasicHeaderMessage( statusCode ).toString();\r\n\t\twriteHeaderMessage( headerMessage );\r\n\t\treturn statusCode;\r\n\r\n\t}", "public RestUtils setMethodPut()\n\t{\n\t\trestMethodDef.setHttpMethod(HttpMethod.PUT);\n\t\treturn this;\n\t}", "@RequestMapping(value = \"/test\", method = RequestMethod.PUT)\n public void test() {}", "public void doPut(String uri, T t) throws AbstractRequestException, AbstractClientRuntimeException {\n OmcpClient omcpClient = this.osirisConnectionFactory.getConnection();\n Response omcpResponse = omcpClient.doPut(uri, t);\n this.osirisConnectionFactory.closeConnection(omcpClient);\n OmcpUtil.handleOmcpResponse(omcpResponse);\n }", "@Override\n protected void executeLowLevelRequest() {\n doPutItem();\n }", "@Override\n public MockResponse handleUpdate(RecordedRequest request) {\n return process(request, putHandler);\n }", "public void doPut() throws IOException {\n\n String otherContent = \".\";\n\n int contentLength = 0;\n\n while (!otherContent.equals(\"\")) {\n otherContent = in.readLine();\n if (otherContent.startsWith(\"Content-Length\")) {\n contentLength = Integer.parseInt(otherContent.split(\" \")[1]);\n }\n }\n\n char[] buffer = new char[contentLength];\n this.in.read(buffer, 0, contentLength); // read parameter\n\n String parameters = decodeValue(new String(buffer));\n System.out.println(\"Param \" + parameters);\n byte[] contentByte = parameters.getBytes();\n // traiter le buffer\n\n String path = RESOURCE_DIRECTORY + this.url;\n\n File file = new File(path);\n\n if (file.exists() && !file.isDirectory()) {\n Files.write(Paths.get(path), contentByte);\n statusCode = NO_CONTENT;\n } else {\n if (file.createNewFile()) {\n Files.write(Paths.get(path), contentByte);\n statusCode = CREATED;\n } else {\n statusCode = FORBIDEN;\n }\n\n }\n\n //Response to client\n sendHeader(statusCode, \"text/html\", contentByte.length);\n\n }", "public<T> Future<Void> update(String pathinfo) throws APIException, CadiException {\n\t\tfinal int idx = pathinfo.indexOf('?');\n\t\tfinal String qp; \n\t\tif(idx>=0) {\n\t\t\tqp=pathinfo.substring(idx+1);\n\t\t\tpathinfo=pathinfo.substring(0,idx);\n\t\t} else {\n\t\t\tqp=queryParams;\n\t\t}\n\n\t\tEClient<CT> client = client();\n\t\tclient.setMethod(PUT);\n\t\tclient.addHeader(CONTENT_TYPE, typeString(Void.class));\n\t\tclient.setQueryParams(qp);\n\t\tclient.setFragment(fragment);\n\t\tclient.setPathInfo(pathinfo);\n//\t\tclient.setPayload(new EClient.Transfer() {\n//\t\t\t@Override\n//\t\t\tpublic void transfer(OutputStream os) throws IOException, APIException {\n//\t\t\t}\n//\t\t});\n\t\tclient.send();\n\t\tqueryParams = fragment = null;\n\t\treturn client.future(null);\n\t}", "Response put(String repoName, String repoPath, String lockTokenHeader, String ifHeader, String fileNodeTypeHeader,\r\n String contentNodeTypeHeader, String mixinTypes, MediaType mediaType, String userAgent, InputStream inputStream,\r\n UriInfo uriInfo);", "protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException \r\n\t{\n ((HttpServletResponse) response).addHeader(\"Access-Control-Allow-Origin\", \"*\");\r\n \r\n //TODO: create update option\r\n\t}", "public static int doPut(String name, String id) {\n int status = 0;\n try {\n URL url = new URL(\"https://intense-lake-93564.herokuapp.com/menusection/\");\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"PUT\");\n conn.setDoOutput(true);\n // make the request info as an json message\n JSONObject objJson = new JSONObject();\n JSONObject objJsonSend = new JSONObject();\n try {\n objJson.put(\"id\", id);\n objJson.put(\"name\", name);\n objJsonSend.put(\"name\", name);\n } catch (JSONException ex) {\n Logger.getLogger(RestaurantApiClient.class.getName()).log(Level.SEVERE, null, ex);\n }\n String ans = objJson.toString();\n System.out.println(\"Request Body:\");\n System.out.println(objJsonSend.toString());\n OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream());\n out.write(ans);\n out.close();\n // wait for response\n status = conn.getResponseCode();\n conn.disconnect(); \n }\n catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return status;\n }", "@PutMapping\n public ResponseEntity<Track> updateTrack(@Valid @RequestBody Track mySong, @RequestHeader Map<String, String> headers)\n throws RecordNotFoundException, RecordUnauthorizedException{\n if(Utils.apiKey(headers)){\n Track entity = service.updateTrack(mySong);\n \n return new ResponseEntity<Track>(entity, new HttpHeaders(), HttpStatus.OK);\n }else{\n throw new RecordUnauthorizedException(\"API Key ERROR\");\n }\n }", "@PUT\n @Consumes(\"application/json\")\n public void putJson(String content) {\n }", "@PUT\n @Consumes(\"application/json\")\n public void putJson(String content) {\n }", "@PUT\n @Consumes(\"application/json\")\n public void putJson(String content) {\n }", "@PUT\n @Consumes(\"application/json\")\n public void putJson(String content) {\n }", "@PUT\n @Consumes(\"application/json\")\n public void putJson(String content) {\n }", "@PUT\r\n @Consumes(\"application/json\")\r\n public void putJson(String content) {\r\n }", "public void processPutRequest(String request) throws IOException {\n\t\tString[] tokens = request.split(\"\\\\s+\");\n\t\tif (tokens.length != 3) {\n\t\t\tSystem.out.println(\"Incorrect Request\");\n\t\t\tclose();\n\t\t} else {\n\t\t\tString fileName = tokens[1];\n\t\t\tString version = tokens[2];\n\t\t\tif (version.equals(\"HTTP/1.0\") || version.equals(\"HTTP/1.1\")) {\n\t\t\t\tString filePath = \"C:\\\\Users\\\\admin\\\\Desktop\\\\socket\" + fileName.replaceAll(\"/\", \"\\\\\\\\\");\n\t\t\t\t// The path of file that client put\n\t\t\t\tFile file = new File(filePath);\n\t\t\t\tif (file.exists()) {\n\t\t\t\t\t// Send the response\n\t\t\t\t\tStringBuilder putMessage = new StringBuilder();\n\t\t\t\t\tputMessage.append(request);\n\t\t\t\t\tputMessage.append(CRLF);\n\t\t\t\t\tputMessage.append(\"User-Agent: MyClient-1.0\" + CRLF);\n\t\t\t\t\tputMessage.append(\"Accept-Encoding: ISO-8859-1\" + CRLF);\n\t\t\t\t\tputMessage.append(\n\t\t\t\t\t\t\t\"Content-Type: \" + URLConnection.getFileNameMap().getContentTypeFor(fileName) + CRLF);\n\t\t\t\t\tputMessage.append(\"Content-Length: \" + file.length() + CRLF);\n\t\t\t\t\tputMessage.append(\"Connection: close\" + CRLF);\n\t\t\t\t\tputMessage.append(CRLF);\n\t\t\t\t\t// Send to server\n\t\t\t\t\tString message = putMessage + \"\";\n\t\t\t\t\tbyte[] buffer = message.getBytes(ENCODING);\n\t\t\t\t\tostream.write(buffer, 0, message.length());\n\t\t\t\t\tostream.flush();\n\t\t\t\t\tSystem.out.println(message);\n\t\t\t\t\t// Read file and send it to server\n\t\t\t\t\tbyte[] sendData = Files.readAllBytes(file.toPath());\n\t\t\t\t\tostream.write(sendData);\n\t\t\t\t\tostream.flush();\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"File does not exist\");\n\t\t\t\t\tclose();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Bad Request\");\n\t\t\t\tclose();\n\t\t\t}\n\t\t}\n\t\tprocessResponse(\"PUT\");\n\t}", "public PUT(OperatorDescription description) {\n\t\tsuper(description);\n\t\t// TODO Auto-generated constructor stub\n\t}", "@RequestMapping(value=\"/put\", method = RequestMethod.POST, produces=MediaType.APPLICATION_JSON_VALUE)\n\t@ResponseStatus(value = HttpStatus.OK)\n\tpublic void put(@RequestBody ArticleEntity detail) {\n\t\tserviceFactory.getArticleService().update(convertEntity2Vo(detail));\n\t}", "@Override\n protected void doPut(HttpServletRequest requete, HttpServletResponse reponse) throws ServletException, IOException {\n Integer idSousTournoiAValider = tentativeRecuperationIdSousTournoi(requete);\n if (idSousTournoiAValider == null){\n envoyerReponseMauvaisId(reponse);\n }\n else{\n SousTournoiSimplifieDto sousTournoiValide = sousTournoiService.validerSousTournoi(idSousTournoiAValider);\n if(sousTournoiValide != null){\n envoyerReponseRecuperationSousTournoiSimplifie(sousTournoiValide, reponse);\n }\n else{\n envoyerReponseSousTournoiIntrouvable(reponse);\n }\n }\n }", "@PUT\n @Consumes(MediaType.APPLICATION_JSON)\n public void putJson(String content) {\n }", "@PUT\n @Consumes(MediaType.APPLICATION_JSON)\n public void putJson(String content) {\n }", "@PUT\n @Consumes(MediaType.APPLICATION_JSON)\n public void putJson(String content) {\n }", "@PUT\n @Consumes(MediaType.APPLICATION_JSON)\n public void putJson(String content) {\n }", "public void put(Context context, String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {\n put(context, url, paramsToEntity(params), null, responseHandler);\n }", "public com.amazon.s3.PutObjectResponse putObject(com.amazon.s3.PutObject putObject);", "ClientResponse put(URI resourceURI, String jsonFormat) {\n ClientResponse response = _client.put(resourceURI, _vplexSessionId, jsonFormat);\n updateVPLEXSessionId(response);\n return response;\n }", "public DataObjectResponse<T> handlePUT(DataObjectRequest<T> request, T previouslyRetrievedObject)\n {\n if(getRequestValidator() != null) getRequestValidator().validatePUT(request);\n\n T dataObjectToUpdate = request.getDataObject();\n String updatingCustomerId = dataObjectToUpdate.getCustomerId();\n DefaultDataObjectResponse<T> response = new DefaultDataObjectResponse<>();\n try\n {\n // The object specified may not have the id set if the id is specified only in the url, set it now before moving on\n dataObjectToUpdate.setId(request.getId());\n VisibilityFilter<T, DataObjectRequest<T>> visibilityFilter = visibilityFilterMap.get(VisibilityMethod.PUT);\n //Get persisted object to verify visibility.\n T persistedDataObject = previouslyRetrievedObject == null\n ? objectPersister.retrieve(dataObjectToUpdate.getId())\n : previouslyRetrievedObject;\n if (persistedDataObject == null)\n {\n response.setErrorResponse(ErrorResponseFactory.objectNotFound(\n new ObjectNotFoundException(String.format(OBJECT_NOT_FOUND_EXCEPTION, request.getId())), request.getCID()));\n return response;\n }\n if (! visibilityFilter.isVisible(request, persistedDataObject))\n {\n return new DefaultDataObjectResponse<>(ErrorResponseFactory.unauthorized(String.format(AUTHORIZATION_EXCEPTION, persistedDataObject.getCustomerId()),\n request.getCID()));\n }\n\n //check the incoming customerID for visibility\n if (updatingCustomerId != null && !updatingCustomerId.equals(persistedDataObject.getCustomerId()) && !visibilityFilter.isVisible(request, dataObjectToUpdate))\n {\n return new DefaultDataObjectResponse<>(ErrorResponseFactory.unauthorized(String.format(AUTHORIZATION_EXCEPTION, dataObjectToUpdate.getCustomerId()),\n request.getCID()));\n }\n\n // NOTE: the default update implementation is just a persist call\n response.add(objectPersister.update(dataObjectToUpdate));\n return response;\n }\n catch(PersistenceException e)\n {\n final String id = dataObjectToUpdate == null ? \"UNKNOWN\" : dataObjectToUpdate.getId();\n BadRequestException badRequestException = new BadRequestException(String.format(UNABLE_TO_UPDATE_EXCEPTION, id), e);\n response.setErrorResponse(ErrorResponseFactory.badRequest(badRequestException, request.getCID()));\n }\n return response;\n }", "T put(T obj) throws DataElementPutException, RepositoryAccessDeniedException;", "public int put(String json, String path)\n {\n\n Client client = Client.create();\n\n WebResource webResource = client.resource(getHostAddress() + \":\" + getPort() + \"/api/\" + path);\n ClientResponse response = webResource.type(\"application/json\").put(ClientResponse.class, json);\n\n\n int responser = response.getStatus();\n\n return responser;\n }", "@RestAPI\n \t@PreAuthorize(\"hasAnyRole('A')\")\n \t@RequestMapping(value = \"/api/{id}\", params = \"action=update\", method = RequestMethod.PUT)\n \tpublic HttpEntity<String> update(@PathVariable(\"id\") Long id) {\n \t\tagentManagerService.update(id);\n \t\treturn successJsonHttpEntity();\n \t}", "@PUT\n @Produces({ \"application/json\" })\n @Path(\"{id}\")\n @CommitAfter\n public abstract Response update(Person person);", "ClientResponse put(URI resourceURI) {\n return put(resourceURI, VPlexApiConstants.ACCEPT_JSON_FORMAT_0);\n }", "@RequestMapping(method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)\n //Request Body is requesting the student parameter\n public void updateStudent(@RequestBody Student student){\n studentService.updateStudent(student);\n }", "public String putJSON(String urlStr, String putStr) throws Exception{ \n \t/*\n \tURL url = new URL(urlStr);\n \tHttpURLConnection httpCon = (HttpURLConnection) url.openConnection();\n \thttpCon.setDoOutput(true);\n \thttpCon.setRequestMethod(\"PUT\");\n \tOutputStreamWriter out = new OutputStreamWriter(httpCon.getOutputStream());\n \tout.write(putStr);\n \tout.close();\n \t*/\n HttpClient httpClient = new DefaultHttpClient();\n HttpResponse response;\n HttpPut put=new HttpPut();\n HttpEntity httpEntity;\n StringEntity stringEntity=new StringEntity(putStr);\n stringEntity.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, \"application/json\"));\n httpEntity=stringEntity;\n put.setEntity(httpEntity);\n put.setURI(new URI(urlStr));\n put.setHeader(\"Content-type\", \"application/json\");\n response=httpClient.execute(put);\n return parseHttpResponse(response);\n \n }", "public RequestDataBuilder put() {\n\t\tRequest request = new Request(urlPattern, RequestMethod.PUT);\n\t\tmap.put(request, clazz);\n\t\treturn this;\n\t}", "@PUT\n\t@Consumes({\"text/turtle\",\"application/rdf+xml\"})\n\tResponse updateResource(String body, @HeaderParam(\"Accept\") String format);", "public void put(final HttpServletRequest request, final ArrayNode json, final JsonGenerator writer) throws Exception {\n }", "@PUT\n\t@Path(\"/\")\n\t@Nonnull\n\t@Consumes(MediaType.APPLICATION_JSON)\n\t@Produces(MediaType.APPLICATION_JSON)\n\tExercise update(@Nonnull Exercise exercise);", "public void PUT(String line) {\r\n\t\tanalisisURL(line);\r\n\t}", "protected ValidatableResponse updateResource(String path, JSONObject newResource) throws JSONException {\n return given()\n .header(HEADER_AUTHORIZATION, authenticated())\n .contentType(ContentType.JSON)\n .body(newResource.toString())\n .when()\n .put(path)\n .then()\n .statusCode(204);\n }", "@PUT\r\n @Consumes(\"text/plain\")\r\n public void putText(String content) {\r\n }", "@Test\n public void editMeasurementUsingPUTTest() throws ApiException {\n MeasurementDTO measurementDTO = null;\n api.editMeasurementUsingPUT(measurementDTO);\n\n // TODO: test validations\n }", "public final void mT__40() throws RecognitionException {\n try {\n int _type = T__40;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // ../org.xtext.example.mydslsample/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDslSample.g:40:7: ( 'PUT' )\n // ../org.xtext.example.mydslsample/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDslSample.g:40:9: 'PUT'\n {\n match(\"PUT\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public void put(String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {\n put(null, url, params, responseHandler);\n }", "public RestValidator put(String path, HashMap<String, String> headers, String jsonContent, String contentType) {\r\n\t\tHttpPut put = new HttpPut(url + path);\r\n\t\tRestResponse restResponse = new RestResponse();\r\n\t\ttry {\r\n\t\t\tif (headers != null)\r\n\t\t\t\tput.setEntity(getEntities(headers));\r\n\r\n\t\t\tStringEntity input = new StringEntity(jsonContent);\r\n\t\t\tinput.setContentType(contentType);\r\n\t\t\tput.setEntity(input);\r\n\r\n\t\t\tHttpResponse response = client.execute(put);\r\n\t\t\trestResponse = ResponseInfo.getRestResponseInfo(response);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace(); // handle\r\n\t\t}\r\n\t\treturn new RestValidator(restResponse);\r\n\t}", "@Test\n public void putTest(){\n Map<String, Object> putRequestMap = new HashMap<>();\n putRequestMap.put(\"title\", \"Title 3\");\n putRequestMap.put(\"body\", \"Body 3\");\n\n given().contentType(ContentType.JSON)\n .body(putRequestMap)\n .pathParam(\"id\",1)\n .when().put(\"/posts/{id}\")\n .then().statusCode(200)\n .body(\"title\",is(\"Title 3\"),\n \"body\",is(\"Body 3\"),\n \"id\",is(1));\n }", "protected void handlePut(final String filename) {\r\n\t\tboolean success = false;\r\n\r\n\t\ttry {\r\n\t\t\tSystem.out.printf(\"Receiving %s%n\", filename);\r\n\r\n\t\t\t// GET DATA\r\n\t\t\tbyte[] data = receiveData();\r\n\r\n\t\t\t// SAVE DATA\r\n\t\t\tif (data != null) {\r\n\t\t\t\tstoreFile(data, filename);\r\n\t\t\t\tsuccess = true;\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException ioe) {\r\n\t\t\tSystem.err.printf(\"I/O error receiving file: %s%n\", ioe);\r\n\t\t} catch (NumberFormatException nfe) {\r\n\t\t\tSystem.err.printf(\"Invalid length specified: %s%n\", nfe);\r\n\t\t}\r\n\r\n\t\t// SEND REPLY\r\n\t\tSystem.out.printf(\"Sending reply ... \");\r\n\t\tString message = success ? \"PUT OK\" : \"PUT FAILED\";\r\n\t\tsendMessage(message);\r\n\t\tSystem.out.printf(\"done.%n\");\r\n\t}", "public static String PUT(String uri, int port){\n\t\treturn null;\n\t\t\n\t}", "@Override\n public JSONObject fullUpdateHwWalletObject(String urlSegment, String id, String body) {\n HttpHeaders header = constructHttpHeaders();\n // Construct the http URL.\n String baseUrl = ConfigUtil.instants().getValue(\"walletServerBaseUrl\");\n String walletServerUrl = baseUrl + urlSegment + id;\n\n // Send the http request and get response.\n HttpEntity<JSONObject> entity = new HttpEntity<>(JSONObject.parseObject(body), header);\n ResponseEntity<JSONObject> response =\n REST_TEMPLATE.exchange(walletServerUrl, HttpMethod.PUT, entity, JSONObject.class);\n\n // Return the updated model or instance.\n return response.getBody();\n }", "@RequestMapping(method = RequestMethod.PUT)\n public <T extends Pet> void updatePet(@RequestBody T pet) {\n throw new UnsupportedOperationException();\n }", "@Override\r\n\tpublic void doUpdate(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\t\r\n\t}", "public String PUT( String name, String number){\n this.clientData.put(name,number);\n\n return \"OK\";\n }", "@PUT\n @Consumes(\"application/xml\")\n public void put(StorageConverter data) {\n Storage entity = data.getEntity();\n // TODO Fix\n entity.setCurrentStatus(\"TODO\");\n entity.setMessage(null);\n dao.update(entity);\n }", "public Response put(String path, Header[] headers, byte[] content) \n throws IOException {\n return put(cluster, path, headers, content);\n }", "private static void sendPuts(HttpClient httpClient) {\n HttpTextResponse httpResponse = httpClient.put(\"/hello/mom\");\n puts(httpResponse);\n\n\n /* Send one param post. */\n httpResponse = httpClient.putWith1Param(\"/hello/singleParam\", \"hi\", \"mom\");\n puts(\"single param\", httpResponse);\n\n\n /* Send two param post. */\n httpResponse = httpClient.putWith2Params(\"/hello/twoParams\",\n \"hi\", \"mom\", \"hello\", \"dad\");\n puts(\"two params\", httpResponse);\n\n\n /* Send two param post. */\n httpResponse = httpClient.putWith3Params(\"/hello/3params\",\n \"hi\", \"mom\",\n \"hello\", \"dad\",\n \"greetings\", \"kids\");\n puts(\"three params\", httpResponse);\n\n\n /* Send four param post. */\n httpResponse = httpClient.putWith4Params(\"/hello/4params\",\n \"hi\", \"mom\",\n \"hello\", \"dad\",\n \"greetings\", \"kids\",\n \"yo\", \"pets\");\n puts(\"4 params\", httpResponse);\n\n /* Send five param post. */\n httpResponse = httpClient.putWith5Params(\"/hello/5params\",\n \"hi\", \"mom\",\n \"hello\", \"dad\",\n \"greetings\", \"kids\",\n \"yo\", \"pets\",\n \"hola\", \"neighbors\");\n puts(\"5 params\", httpResponse);\n\n\n /* Send six params with post. */\n\n final HttpRequest httpRequest = httpRequestBuilder()\n .setUri(\"/sixPost\")\n .setMethod(\"PUT\")\n .addParam(\"hi\", \"mom\")\n .addParam(\"hello\", \"dad\")\n .addParam(\"greetings\", \"kids\")\n .addParam(\"yo\", \"pets\")\n .addParam(\"hola\", \"pets\")\n .addParam(\"salutations\", \"all\").build();\n\n\n httpResponse = httpClient.sendRequestAndWait(httpRequest);\n puts(\"6 params\", httpResponse);\n\n\n //////////////////\n //////////////////\n\n\n /* Using Async support with lambda. */\n httpClient.putAsync(\"/hi/async\", (code, contentType, body) -> puts(\"Async text with lambda\", body));\n\n Sys.sleep(100);\n\n\n /* Using Async support with lambda. */\n httpClient.putFormAsyncWith1Param(\"/hi/async\", \"hi\", \"mom\", (code, contentType, body) -> puts(\"Async text with lambda 1 param\\n\", body));\n\n Sys.sleep(100);\n\n\n\n /* Using Async support with lambda. */\n httpClient.putFormAsyncWith2Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n (code, contentType, body) -> puts(\"Async text with lambda 2 params\\n\", body));\n\n Sys.sleep(100);\n\n\n\n\n /* Using Async support with lambda. */\n httpClient.putFormAsyncWith3Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n \"p3\", \"v3\",\n (code, contentType, body) -> puts(\"Async text with lambda 3 params\\n\", body));\n\n Sys.sleep(100);\n\n\n /* Using Async support with lambda. */\n httpClient.putFormAsyncWith4Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n \"p3\", \"v3\",\n \"p4\", \"v4\",\n (code, contentType, body) -> puts(\"Async text with lambda 4 params\\n\", body));\n\n Sys.sleep(100);\n\n\n /* Using Async support with lambda. */\n httpClient.putFormAsyncWith5Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n \"p3\", \"v3\",\n \"p4\", \"v4\",\n \"p5\", \"v5\",\n (code, contentType, body) -> {\n puts(\"Async text with lambda 5 params\\n\", body);\n });\n\n Sys.sleep(100);\n\n\n }", "public abstract Response update(Request request, Response response);", "public abstract Object put(String oid, Object obj) throws OIDAlreadyExistsException, ObjectNotSupportedException;", "@RequestMapping(value = \"/enquirys\",\n method = RequestMethod.PUT,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<Void> update(@Valid @RequestBody Enquiry enquiry) throws URISyntaxException {\n log.debug(\"REST request to update Enquiry : {}\", enquiry);\n if (enquiry.getId() == null) {\n return create(enquiry);\n }\n enquiryRepository.save(enquiry);\n return ResponseEntity.ok().build();\n }", "public void putRequest(Request request, Response response) {\n\t\tupdateObject(request, response);\n\t}", "@Override\r\n\tpublic int update(Uri arg0, ContentValues arg1, String arg2, String[] arg3) {\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic int update(Uri arg0, ContentValues arg1, String arg2, String[] arg3) {\n\t\treturn 0;\n\t}", "public String putRest(String uri) {\n WebResource.Builder builder = getClientBuilder(uri);\n ClientResponse response;\n\n try {\n response = builder.put(ClientResponse.class);\n } catch (ClientHandlerException e) {\n log.warn(\"Unable to contact REST server: {}\", e.getMessage());\n return \"\";\n }\n\n if (response.getStatus() != HTTP_OK) {\n log.info(\"REST PUT request returned error code {}\",\n response.getStatus());\n }\n return response.getEntity(String.class);\n }", "public void catalogProductWebsiteLinkRepositoryV1SavePut (String sku, Body1 body, final Response.Listener<Boolean> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = body;\n\n \n // verify the required parameter 'sku' is set\n if (sku == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'sku' when calling catalogProductWebsiteLinkRepositoryV1SavePut\",\n new ApiException(400, \"Missing the required parameter 'sku' when calling catalogProductWebsiteLinkRepositoryV1SavePut\"));\n }\n \n\n // create path and map variables\n String path = \"/v1/products/{sku}/websites\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"sku\" + \"\\\\}\", apiInvoker.escapeString(sku.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"PUT\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((Boolean) ApiInvoker.deserialize(localVarResponse, \"\", Boolean.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }", "private static String sendPUT(final Wine wine) {\n return \"\";\r\n }", "public Response put(Cluster cluster, String path, Header[] headers, \n byte[] content) throws IOException {\n PutMethod method = new PutMethod();\n try {\n method.setRequestEntity(new ByteArrayRequestEntity(content));\n int code = execute(cluster, method, headers, path);\n headers = method.getResponseHeaders();\n content = method.getResponseBody();\n return new Response(code, headers, content);\n } finally {\n method.releaseConnection();\n }\n }", "public interface ResultatMissionRS\n extends GenericService<ResultatMission, Long>\n{\n\n\t@PUT\n @Consumes({MediaType.APPLICATION_JSON})\n @Produces({MediaType.APPLICATION_JSON})\n @Path(\"cloture\")\n public ResultatMission cloture(@Context HttpHeaders headers,ResultatMission entity);\n\n}", "public Response put(String path, String contentType, byte[] content)\n throws IOException {\n return put(cluster, path, contentType, content);\n }", "@PutMapping(value=\"/ticket/{ticketId}\")\n\tpublic Ticket updateTicket(@RequestBody Ticket ticket,@PathVariable(\"ticketId\") Integer ticketId){\n return ticketBookingService.updateTicket(ticket,ticketId);\t\t\n\t}", "public Request<E, T> buildHttpPut ()\n\t{\n\t\treturn new HttpPutRequest<E, T>(this);\n\t}", "public abstract void update(@Nonnull Response response);", "@PUT\n @Consumes({\"application/xml\", \"application/json\"})\n public void put(SourceInterestMapConverter data) {\n PersistenceService persistenceSvc = PersistenceService.getInstance();\n try {\n persistenceSvc.beginTx();\n EntityManager em = persistenceSvc.getEntityManager();\n updateEntity(getEntity(), data.resolveEntity(em));\n persistenceSvc.commitTx();\n } finally {\n persistenceSvc.close();\n }\n }", "@Path(\"/{ID}\")\n @PUT\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n public Response update(@PathParam(\"ID\") String ID, Person person) \n throws NotFoundException, MissingInformationException {\n if(person == null) \n throw new MissingInformationException(\"No Person were found\");\n \n Document found = fetchByObjectId(ID);\n \n UpdateResult result = getCollection().updateOne(found, \n new Document(\"$set\", toDocument(person)));\n if(result.getModifiedCount() == 0)\n return Response.status(Response.Status.GONE).build();\n \n // Indicates nothing was modified at all\n return Response.status(Response.Status.ACCEPTED).build();\n }", "private void executePut() throws NetworkException, IOException,\n StreamException {\n StreamClientMetrics.begin(session);\n try {\n putMethod = new PutMethod(session.getURI());\n try {\n utils.setHeaders(putMethod, session.getHeaders());\n putMethod.setRequestEntity(this);\n switch (utils.execute(putMethod)) {\n case 200:\n break;\n case 400:\n final StreamErrorResponse errorResponse = utils.readErrorResponse(putMethod);\n throw new StreamException(errorResponse.isRecoverable(),\n \"Could not upload stream. {0}:{1}{2}{3}\",\n putMethod.getStatusCode(),\n putMethod.getStatusLine(), \"\\n\\t\",\n putMethod.getStatusText());\n case 503: // service unavailable\n utils.wait(utils.getRetryAfter(putMethod));\n case 500: // internal server error\n case 504: // gateway timeout\n utils.writeError(putMethod);\n throw new StreamException(Boolean.TRUE,\n \"Could not upload stream. {0}:{1}{2}{3}\",\n putMethod.getStatusCode(),\n putMethod.getStatusLine(), \"\\n\\t\",\n putMethod.getStatusText());\n default:\n utils.writeError(putMethod);\n throw new StreamException(\n \"Could not upload stream. {0}:{1}{2}{3}\",\n putMethod.getStatusCode(),\n putMethod.getStatusLine(), \"\\n\\t\",\n putMethod.getStatusText());\n }\n } catch (final UnknownHostException uhx) {\n utils.writeError(putMethod);\n throw new NetworkException(uhx);\n } catch (final SocketException sx) {\n utils.writeError(putMethod);\n throw new NetworkException(sx);\n } catch (final SocketTimeoutException stx) {\n utils.writeError(putMethod);\n throw new NetworkException(stx);\n } catch (final HttpException hx) {\n utils.writeError(putMethod);\n throw new NetworkException(hx);\n } catch (final IOException iox) {\n /* an io exception can be thrown with a network exception cause\n * by the stream's http connection object; and since we want to\n * differentiate between network and local io errors we examine\n * the causality */\n utils.writeError(putMethod);\n if (isNetworkException(iox.getCause())) {\n throw (NetworkException) iox.getCause();\n } else {\n throw iox;\n }\n } finally {\n putMethod.releaseConnection();\n }\n } finally {\n StreamClientMetrics.end(\"PUT\", session);\n }\n }", "protected static void putEventToConsumer(String url, String eventInstance, String contentType) throws RESTException {\n\t\t// Prepare HTTP PUT\n PostMethod postMethod = new PostMethod(url); \n \n if(eventInstance != null) {\n\n \tRequestEntity requestEntity = new ByteArrayRequestEntity(eventInstance.getBytes());\n \tpostMethod.setRequestEntity(requestEntity);\n\n \n\t // Specify content type and encoding\n\t // If content encoding is not explicitly specified\n\t // ISO-8859-1 is assumed\n \t// postMethod.setRequestHeader(\"Content-Type\", contentType+\"; charset=ISO-8859-1\");\n \tpostMethod.setRequestHeader(\"Content-Type\", contentType);\n \t\n\t // Get HTTP client\n\t HttpClient httpclient = new HttpClient();\n\t \n\t // Execute request\n\t try {\n\t \n\t int result = httpclient.executeMethod(postMethod);\n\t \t \n\t if (result < 200 || result >= 300)\n\t {\n\t \tHeader [] reqHeaders = postMethod.getRequestHeaders();\n\t \tStringBuffer headers = new StringBuffer();\n\t \tfor (int i=0; i<reqHeaders.length; i++ ){\n\t \t\theaders.append(reqHeaders[i].toString());\n\t \t\theaders.append(\"\\n\");\n\t \t}\n\t \tthrow new RESTException(\"Could not perform POST of event instance: \\n\"+eventInstance+ \"\\nwith request headers:\\n\" +\n\t \t\t\theaders + \"to consumer \"+ url+\", responce result: \"+result);\n\t }\n\t \n\t } catch(Exception e)\n\t {\n\t \tthrow new RESTException(e);\n\t }\n\t finally {\n\t // Release current connection to the connection pool \n\t // once you are done\n\t postMethod.releaseConnection();\n\t }\n } else\n {\n \tSystem.out.println (\"Invalid request\");\n }\n// PutMethod putMethod = new PutMethod(url); \n// \n// if(eventInstance != null) {\n// \tRequestEntity requestEntity = new ByteArrayRequestEntity(eventInstance.getBytes());\n// \tputMethod.setRequestEntity(requestEntity);\n//\n// \n//\t // Specify content type and encoding\n//\t // If content encoding is not explicitly specified\n//\t // ISO-8859-1 is assumed\n//\t putMethod.setRequestHeader(\n//\t \"Content-type\", contentType+\"; charset=ISO-8859-1\");\n//\t \n//\t // Get HTTP client\n//\t HttpClient httpclient = new HttpClient();\n//\t \n//\t // Execute request\n//\t try {\n//\t \n//\t int result = httpclient.executeMethod(putMethod);\n//\t \t \n//\t if (result < 200 || result >= 300)\n//\t {\n//\t \tthrow new RESTException(\"Could not perform PUT of event instance \"+eventInstance+\" to consumer \"+ url+\", responce result: \"+result);\n//\t }\n//\t \n//\t } catch(Exception e)\n//\t {\n//\t \tthrow new RESTException(e);\n//\t }\n//\t finally {\n//\t // Release current connection to the connection pool \n//\t // once you are done\n//\t putMethod.releaseConnection();\n//\t }\n// } else\n// {\n// \tSystem.out.println (\"Invalid request\");\n// }\n\n\t}", "public void put(String url, AsyncHttpResponseHandler responseHandler) {\n put(null, url, null, responseHandler);\n }", "@PutMapping(\"/products\") \nprivate Products update(@RequestBody Products products) \n{ \nproductsService.saveOrUpdate(products); \nreturn products; \n}", "@PUT\n @Path(\"/{id}\")\n @Produces(MediaType.APPLICATION_JSON)\n @Consumes(MediaType.APPLICATION_JSON)\n public Response handlePut(@PathParam(\"id\") String id, String body) {\n Gson gson = GSONFactory.getInstance();\n\n Employee employee = createEmployee(id, body);\n\n String serializedEmployee = gson.toJson(employee);\n\n Response response = Response.status(201).entity(serializedEmployee).build();\n return response;\n }", "@PUT\n \t@Consumes({MediaType.APPLICATION_JSON })\n \tpublic Response putStep(Step step) {\n \t\tSystem.out.println(\"--> Step gotten: \"+step.toString());\n \t\tSystem.out.println(\"--> Step gotten: \"+step.getDate());\n \t\tSystem.out.println(\"--> Step gotten: \"+step.getId());\n\n \t\tResponse res;;\n \t\t\n \t\tif (step.getId() == 0) { // Create step\n \t\t\tres = Response.noContent().build();\n \t\t\tStep.saveStep(step);\n \t\t} else { // Modify step\n \t\t\tres = Response.created(uriInfo.getAbsolutePath()).build();\n \t\t\tStep.updateStep(step);\n \t\t}\n\n \t\treturn res;\n \t}", "@Override\n protected Response doUpdate(Long id, JSONObject data) {\n return null;\n }", "@PUT\n @Consumes({\"application/xml\", \"application/json\"})\n @Path(\"/{version}\")\n public String commit(@PathParam(\"version\") String version) {\n throw new UnsupportedOperationException();\n }", "E update(ID id, E entity, RequestContext context);", "public static String UpdateEntityDemoMethod(String entityType, String entityId, String jsonFilePath) {\n\n try {\n HashMap<String, String> awsCreds = getApiResponse();\n\n //Create client\n URL url = new URL(BaseConnectionString + entityType + \"/\" + entityId);\n AWS4SignerForAuthorizationHeader auth = new AWS4SignerForAuthorizationHeader(url, \"PUT\", \"execute-api\", \"us-east-1\");\n Map<String, String> headers = new HashMap<>();\n headers.put(\"content-type\", \"application/json\");\n headers.put(\"x-amz-security-token\", awsCreds.get(\"sessionToken\"));\n headers.put(\"x-api-key\", ConfigSetup.getCredentials().get(\"xApiKey\"));\n File file = new File(jsonFilePath);\n\n String jsonFile1 = String.join(\"\\n\", Files.readAllLines(file.toPath()));\n String authorization = auth.computeSignature(headers, null, BinaryUtils.toHex(AWS4SignerBase.hash(jsonFile1.substring(1))), awsCreds.get(\"accessKey\"), awsCreds.get(\"secretKey\"));\n client = (HttpURLConnection) url.openConnection();\n\n headers.put(\"Authorization\", authorization);\n client.setRequestMethod(\"PUT\");\n\n client.connect();\n String response = HttpUtils.invokeHttpRequest(url, \"PUT\", headers, jsonFile1.substring(1));\n return response;\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n } finally {\n if (client != null) {\n client.disconnect();\n }\n }\n }", "@Test\n public void putId() throws Exception {\n Role role = create(new Role(\"roleName\"));\n\n //Change a field of the object that has to be updated\n role.setName(\"roleNameChanged\");\n RESTRole restRole = new RESTRole(role);\n\n //Perform the put request to update the object and check the fields of the returned object\n try {\n mvc.perform(MockMvcRequestBuilders.put(\"/auth/roles/{id}\", UUIDUtil.UUIDToNumberString(role.getUuid()))\n .header(\"Content-Type\", \"application/json\")\n .header(\"Authorization\", authPair[0])\n .header(\"Function\", authPair[1])\n .content(TestUtil.convertObjectToJsonBytes(restRole))\n )\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$.name\", equalTo(restRole.getName())));\n } catch (AssertionError e) {\n remove(role.getUuid());\n throw e;\n }\n\n //Test if changes actually went in effect in the database\n try {\n role = get(role.getUuid());\n try {\n assertEquals(\"name field not updated correctly\", \"roleNameChanged\", role.getName());\n } finally {\n //Clean up database for other tests\n remove(role.getUuid());\n }\n } catch (ObjectNotFoundException e) {\n fail(\"Could not retrieve the put object from the actual database\");\n }\n }", "@ResponseStatus(code=HttpStatus.OK)\r\n\t@RequestMapping(value=\"/update\", method=RequestMethod.GET)\r\n\tpublic void update() {\r\n\t\tSystem.out.println(\"StudentRestController.Update()_________\");\r\n\t}", "private FormValidation putResultFile(PutMethod put) throws IOException, HttpException {\n\n try {\n HttpClient client = new HttpClient();\n int result = client.executeMethod(put);\n String response = \"\";\n if (result != HttpServletResponse.SC_OK) {\n StringBuilder msg = new StringBuilder();\n response = put.getResponseBodyAsString();\n if (response.length() > 0) {\n msg.append(\"Connection failed: \").append(response);\n System.out.println(msg.toString());\n }\n return FormValidation.error(msg.toString());\n } else {\n if (response.length() > 0) {\n return FormValidation.ok(Messages.connectionEstablished() + \": \" + response);\n } else {\n return FormValidation.ok(Messages.connectionEstablished());\n }\n }\n } finally {\n put.releaseConnection();\n }\n }" ]
[ "0.7783537", "0.76511437", "0.7575047", "0.72501165", "0.72248536", "0.72070843", "0.7002999", "0.69825894", "0.6779401", "0.6763341", "0.66422504", "0.6540558", "0.6451364", "0.6425723", "0.6339936", "0.63293314", "0.63282424", "0.63236594", "0.62791616", "0.6270535", "0.6187196", "0.6138933", "0.60352314", "0.6011347", "0.59979004", "0.59979004", "0.59979004", "0.59979004", "0.59979004", "0.59934324", "0.5984493", "0.59542716", "0.59280914", "0.5888415", "0.58689547", "0.58689547", "0.58689547", "0.58689547", "0.58460474", "0.58439726", "0.5834292", "0.5831746", "0.5821972", "0.5812702", "0.5809619", "0.57975173", "0.5779938", "0.5747048", "0.57469916", "0.57398796", "0.5726259", "0.5711985", "0.5699673", "0.5699387", "0.5673544", "0.5649238", "0.56452984", "0.5625181", "0.56175226", "0.5605932", "0.5604525", "0.5603532", "0.5597319", "0.559067", "0.55630827", "0.5562725", "0.5557941", "0.5552647", "0.5546299", "0.5530122", "0.55194694", "0.55156463", "0.5499871", "0.54903287", "0.54889834", "0.54759353", "0.5470375", "0.5457278", "0.54492784", "0.544535", "0.5441281", "0.5441043", "0.5433409", "0.542335", "0.542234", "0.5410168", "0.5402359", "0.54013604", "0.53900164", "0.53886783", "0.5387913", "0.5366365", "0.53652525", "0.5363631", "0.53630406", "0.5357145", "0.5352593", "0.53454316", "0.5340807", "0.533156" ]
0.64461136
13
Find the max element in arr and return it's index
int select(int arr[], int i) { // Your code here int index_of_max; index_of_max = i; //linear search for (int j = 0; j <= i; j++) { if (arr[j] > arr[index_of_max]) { index_of_max = j; } } return index_of_max; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int findMaxInArr(int[] arr) {\n\n\t\tint max = arr[0];\n\t\tfor (int elem : arr) {\n\t\t\tif (elem > max) {\n\t\t\t\tmax = elem;\n\t\t\t}\n\t\t}\n\t\treturn max;\n\t}", "public int findMax(int[] arr) {\n return 0;\n }", "public static <T extends Comparable<T>> int findMaxIndex(T[] arr) {\n if (arr.length == 0 || arr == null) {\n throw new IllegalArgumentException(\"Array null or empty.\");\n }\n return findMaxIndexInRange(arr, arr.length);\n }", "int findMax(int[] arr){\n\t\tint maximum=0;\n\t\tfor (int i=0; i<arr.length; i++) {\n\t\t\tif (arr[i]>maximum) {\n\t\t\t\tmaximum=arr[i];\n\t\t\t}\n\t\t}\n\t\treturn maximum;\n\t}", "public static int getIndexOfMax(double[] array){\n\n int largest = 0;\n for ( int i = 1; i < array.length; i++ )\n {\n if ( array[i] > array[largest] ) largest = i;\n }\n return largest;\n\n }", "private static int maxIndex(int[] vals) {\n \n int indOfMax = 0;\n int maxSoFar = vals[0];\n \n for (int i=1;i<vals.length;i++){\n \n if (vals[i]>maxSoFar) {\n maxSoFar = vals[i];\n indOfMax = i;\n }\n }\n \n return indOfMax;\n }", "public static int max(int[] arr){\n return maxInRange(arr, 0, arr.length-1);\n }", "public static int findMax(int arr[]){\n int max =Integer.MIN_VALUE;\n\n //find max\n for(int i =0;i<arr.length;i++){\n if (arr[i]>max){\n max=arr[i];\n }\n }\n return max;\n }", "public void findMax(int[] arr){\n int max = arr[0];\n for(int val : arr){\n if(max < val){\n max = val;\n }\n }\n System.out.println( \"Maximum values: \" + max );\n }", "private int maxIndex(int[] values){\n int curMaxIndex = 0;\n int curMax = values[0];\n for(int i = 1; i < values.length; i++){\n if(values[i] > curMax){\n curMaxIndex = i;\n curMax = values[i];\n }\n }\n return curMaxIndex;\n }", "public static int indexOfMax(int[] array)\n {\n int max = array[0];\n int maxIndex = 0;\n for(int i = 1; i < array.length; i++)\n {\n if(array[i] > max)\n {\n max = array[i];\n maxIndex = i;\n }\n }\n return maxIndex;\n }", "public int getIndexOfMaxNumber(int[] array) {\n\t\tint left = 0, right = array.length - 1;\n\t\twhile (left < right - 1) {\n\t\t\tint mid = left + (right - left) / 2;\n\t\t\tif (array[mid - 1] > array[mid]) {\n\t\t\t\treturn mid - 1;\n\t\t\t}\n\t\t\tif (array[mid] > array[mid + 1]) {\n\t\t\t\treturn mid;\n\t\t\t}\n\t\t\t// up to this point,\n\t\t\t// mid == right || array[mid] < array[mid + 1] ||\n\t\t\t// mid == left || array[mid - 1] < array[mid]\n\t\t\tif (array[mid] <= array[left]) {\n\t\t\t\tright = mid;\n\t\t\t} else {\n\t\t\t\tleft = mid;\n\t\t\t}\n\t\t}\n\t\t// up to this point, left == right - 1;\n\t\treturn array[left] >= array[right] ? left : right;\n\t}", "public static int getMax(int[] arr) {\r\n\r\n\t\tint max = arr[0];\r\n\r\n\t\tfor (int x = 1; x < arr.length; x++) {\r\n\t\t\tif (arr[x] > max)\r\n\t\t\t\tmax = arr[x];\r\n\r\n\t\t}\r\n\t\treturn max;\r\n\r\n\t}", "private static int getMax(int[] arr, int i) {\n\t\tif (i == 0) {\n\t\t\treturn arr[0];\n\t\t}\n\t\treturn Math.max(getMax(arr,i-1),arr[i]);\n\t}", "int max() {\n\t\t// added my sort method in the beginning to sort out array\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\n\t\t\t\tif (array[j - 1] > array[j]) {\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// finds the last term in the array --> if array is sorted then the last\n\t\t// term should be max\n\t\tint x = array[array.length - 1];\n\t\treturn x;\n\t}", "public static int getMax(int arr[][]) {\n\t\tint maxNum;\n\t\t\n\t\tmaxNum = arr[0][0];\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tfor (int j = 0; j < arr[i].length; j++) {\n\t\t\t\tif (arr[i][j] > maxNum) {\n\t\t\t\t\tmaxNum = arr[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t} // end of outer for\n\t\treturn maxNum;\n\t}", "public int getMaxIndex(int[] paraArray) {\r\n\t\tint maxIndex = 0;\r\n\t\tint tempIndex = 0;\r\n\t\tint max = paraArray[0];\r\n\r\n\t\tfor (int i = 0; i < paraArray.length; i++) {\r\n\t\t\tif (paraArray[i] > max) {\r\n\t\t\t\tmax = paraArray[i];\r\n\t\t\t\ttempIndex = i;\r\n\t\t\t} // of if\r\n\t\t} // of for i\r\n\t\tmaxIndex = tempIndex;\r\n\t\treturn maxIndex;\r\n\t}", "public int calculateMaximumPosition() {\n\t\tdouble[] maxVal = { inputArray[0], 0 };\n\t\tfor (int i = 0; i < inputArray.length; i++) {\n\t\t\tif (inputArray[i] > maxVal[0]) {\n\t\t\t\tmaxVal[0] = inputArray[i];\n\t\t\t\tmaxVal[1] = i;\n\t\t\t}\n\t\t}\n\t\treturn (int) maxVal[1];\n\t}", "static int question1(int[] arr) {\r\n\t\tint index = -1;\r\n\t\tint max = arr[0];\r\n\t\tfor(int i=0;i<arr.length;i++) {\r\n\t\t\tif(arr[i]>=max) {\r\n\t\t\t\tmax = arr[i];\r\n\t\t\t\tindex = i;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn index;\r\n\t}", "include<stdio.h>\nint main()\n{\n int arr_size;\n scanf(\"%d\",&arr_size);\n int arr[10];\n // Get the array elements\n for(int idx = 0; idx <= arr_size - 1; idx++)\n {\n scanf(\"%d\",&arr[idx]);\n }\n // Get the searching element 1\n int max;\n if(arr[0]>arr[1])\n {\n max=arr[0];\n }\n else\n {\n max=arr[1];\n }\n \n for(int idx = 2; idx <= arr_size - 1; idx++)\n {\n if(max< arr[idx])\n {\n max= arr[idx];\n }\n }\n printf(\"%d\\n\",max);\n return 0;\n}", "private static int findIndexOfMaxInside(final int[] hist, int i, final int j) {\n int index = -1;\n for (int max = Integer.MIN_VALUE; ++i < j; ) {\n if (hist[i] > max) {\n max = hist[index = i];\n }\n }\n return index;\n }", "public int getMaxNum(int[] arr) {\n int left = 0, right = arr.length - 1, mid;\n while (left < right) {\n mid = left + (right - left) / 2;\n if (arr[mid] > arr[mid + 1]) right = mid; // in the right half\n else if (arr[mid] < arr[mid + 1]) left = mid + 1; // in the left half\n }\n return arr[left]; // left == right\n }", "public static int getMaxIndex(double[] array)\r\n\t{\r\n\t\tdouble max = Double.NEGATIVE_INFINITY;\r\n\t\tint maxIndex = 0;\r\n\t\tfor (int i = 0; i < array.length; i++)\r\n\t\t\tif (max < array[i]) {\r\n\t\t\t\tmax = array[i];\r\n\t\t\t\tmaxIndex = i;\r\n\t\t\t}\r\n\t\treturn maxIndex;\r\n\t}", "public static int findMax(int[] a) {\r\n int max = a[0];\r\n\r\n //10th error , n = 1\r\n for (int n = 1; n < a.length; n++) {\r\n if (a[n] > max) {\r\n max = a[n];\r\n }\r\n }\r\n return max;\r\n\r\n }", "public static int getMaximum(int[] array) {\n int length = array.length;\n int max = array[0];\n for (int i = 1; i < length; i++) {\n if(max < array[i]) {\n max = array[i];\n }\n }\n\n Arrays.sort(array);\n// return array[length - 1];\n return max;\n }", "public static void main(String[] args) {\n int[] arr = {123,100,200,345,456,678,89,90,10,56};\n Arrays.sort(arr);\n System.out.println(Arrays.toString(arr));\n int lastIndex = arr.length-1;\n int secondIndexNUm =lastIndex-1; //arr.length-1-1;\n int secondMaxNum = arr[secondIndexNUm];\n System.out.println(secondMaxNum);\n\n int[]arr2 = {1,2,3,4,5,6};\n int num2 =secondMax(arr2);\n System.out.println(num2 );\n\n }", "public int getLargestInteger(int[] arr) {\r\n\t\tint ret = arr[0];\r\n\t\tfor (int i = 1; i < arr.length; i++) {\r\n\t\t\tif (arr[i] > ret) {\r\n\t\t\t\tret = arr[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "public static int max(int[] a){\r\n\t\tint m = a[0];\r\n\t\tfor( int i=1; i<a.length; i++ )\r\n\t\t\tif( m < a[i] ) m = a[i];\r\n\t\treturn m;\r\n\t}", "public static int maximo (int[] array) {\n\t\tint max = array[0], i;\n\t\t\n\t\tfor (i = 1; i < array.length; i++) {\n\t\t\tif (array[i] > max) {\n\t\t\t\tmax = array[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn max;\n\t}", "private int maxIndex(int[] sums) {\n\t\tint index = 0;\n\t\tint max = 0;\n\t\tfor(int i = 0; i < sums.length-1; i++) {\n\t\t\tif(sums[i] > max) {\n\t\t\t\tmax = sums[i];\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}", "public static int maxSubArray(int[] arr) {\n\n int arr_size = arr.length;\n int max_curr = Integer.MIN_VALUE, max_global = 0;\n\n for (int i = 0; i < arr_size; ++i)\n {\n max_global += arr[i];\n if (max_curr < max_global)\n max_curr = max_global;\n if (max_global < 0)\n max_global = 0;\n }\n return max_curr;\n }", "private int findIndexOfMax(){\n\t\tint value=0;\n\t\tint indexlocation=0;\n\t\tfor(int i=0; i<myFreqs.size();i++){\n\t\t\tif(myFreqs.get(i)>value){\n\t\t\t\tvalue = myFreqs.get(i);\n\t\t\t\tindexlocation =i;\n\t\t\t}\n\t\t}\n\t\treturn indexlocation;\n\t}", "public static int get_max(Integer[] a){\n int max = Integer.MIN_VALUE;\n\n for (int i = 0; i < a.length; i++){\n if (a[i] > max);\n max = a[i];\n }\n return max;\n }", "int max(){\r\n int auxMax = array[0];\r\n for (int i=1;i<array.length;i++){\r\n if(array[i] > auxMax){\r\n auxMax = array[i];\r\n }\r\n }\r\n return auxMax;\r\n }", "public abstract int maxIndex();", "static int getMax(int[] array) {\n\n\t\tif (array.length > 6 && array.length < 0) {\n\t\t\tthrow new IndexOutOfBoundsException(\"There is no that index in this array.\");\n\t\t}\n\t\tint max = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tif (max < array[i]) {\n\t\t\t\tmax = array[i];\n\t\t\t}\n\t\t}\n\t\treturn max;\n\n\t}", "public static int maxValue(int[] numArr) {\r\n\t\tint temp = numArr[0] > numArr[1] ? numArr[0] : numArr[1];\r\n\t\tfor (int i = 2; i < numArr.length; i++) {\r\n\t\t\ttemp = temp > numArr[i] ? temp : numArr[i];\r\n\t\t}\r\n\t\treturn temp;\r\n\t}", "public static int getMax(int[] array) {\n //TODO: write code here\n int max = array[0];\n for(int a : array) {\n max = a > max ? a : max;\n }\n return max;\n }", "public static int max(int[] a) {\n\t\tint b=a[0];\r\n\t\tfor(int i=0;i<a.length;i++) {\r\n\t\t\tif(a[i]>b) {\r\n\t\t\t\tb=a[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn b;\r\n\t}", "public static int getIndexOfMax(double[] x) {\n Objects.requireNonNull(x, \"The supplied array was null\");\n int index = 0;\n double max = Double.MIN_VALUE;\n for (int i = 0; i < x.length; i++) {\n if (x[i] > max) {\n max = x[i];\n index = i;\n }\n }\n return (index);\n }", "public int getMaximumIndexDifference() {\n int maxIndexDiff = 0;\n \n for(int i = 0; i < array.size() - 1; i++) {\n for(int j = i + 1; j < array.size(); j++) {\n if(array.get(i) <= array.get(j) && maxIndexDiff < j - i) {\n maxIndexDiff = j - i; \n }\n }\n }\n \n return maxIndexDiff;\n }", "private static int max(int[] array) {\n int result = array[0];\n for (int x : array)\n result = Math.max(x, result);\n return result;\n }", "public int max()\n\t{\n\t\tif (arraySize > 0)\n\t\t{\n\t\t\tint maxNumber = array[0];\n\t\t\tfor (int index = 0; index < arraySize; index++) \n\t\t\t{\n\t\t\t\tif (array[index] > maxNumber)\n\t\t\t\t{\n\t\t\t\t\tmaxNumber = array[index];\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\treturn maxNumber;\n\t\t}\n\t\treturn -1;\n\t\t\n\t}", "public static int getMax(int arr[], int n)\n {\n int mx = arr[0];\n for (int i = 1; i < n; i++)\n {\n if (arr[i] > mx)\n {\n mx = arr[i];\n }\n }\n return mx;\n }", "public static int argmax(float[] array) {\n\t\tfloat max = array[0];\n\t\tint re = 0;\n\t\tfor (int i=1; i<array.length; i++) {\n\t\t\tif (array[i]>max) {\n\t\t\t\tmax = array[i];\n\t\t\t\tre = i;\n\t\t\t}\n\t\t}\n\t\treturn re;\n\t}", "public static <T extends Comparable<T>> T findMax(T[] arr) {\n if (arr.length == 0 || arr == null) {\n throw new IllegalArgumentException(\"Array null or empty.\");\n }\n\n T max = arr[0];\n for (int i = 1; i < arr.length; i++) {\n max = MathUtils.max(arr[i], max);\n }\n return max;\n }", "static int maxIndexDiff(int arr[], int n) { \n int max = 0;\n int i = 0;\n int j = n - 1;\n while (i <= j) {\n if (arr[i] <= arr[j]) {\n if (j - i > max) {\n max = j - i;\n }\n i += 1;\n j = n - 1;\n }\n else {\n j -= 1;\n }\n }\n return max;\n // Your code here\n \n }", "public static void main(String[] args) {\nint arr[]=new int[] {10,20,36,50,30};\nint max=0,i;\nfor(i=0;i<arr.length;i++)\n{\n\tif(arr[i]>max)\n\t{\n\t\tmax=arr[i];\n\t}\n}\nSystem.out.println(max);\n\t}", "private static int maxDifference(int[] arr) {\n\t\tint maxDiff = arr[1] - arr[0];\n\t\tint minElement = arr[0];\n\t\t\n\t\tfor(int i = 1 ; i < arr.length; i++)\n\t\t{\n\t\t\tif(arr[i] - minElement > maxDiff)\n\t\t\t{\n\t\t\t\tmaxDiff = arr[i] - minElement;\n\t\t\t}\n\t\t\tif(arr[i] < minElement)\n\t\t\t{\n\t\t\t\tminElement = arr[i];\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn maxDiff;\n\t}", "public static int getMax(int[] inputArray){ \n int maxValue = inputArray[0]; \n for(int i=1;i < inputArray.length;i++){ \n if(inputArray[i] > maxValue){ \n maxValue = inputArray[i]; \n } \n } \n return maxValue; \n }", "public static int findMaxSubarray(int[] array) {\r\n\t\tint max = Integer.MIN_VALUE;\r\n//\t\tint index = 0;\r\n\t\tint currMax = 0;\r\n\t\tfor(int v : array) {\r\n\t\t\tcurrMax += v;\r\n\t\t\tif(currMax > max) {\r\n\t\t\t\tmax = currMax;\r\n\t\t\t} \r\n\t\t\tif(currMax < 0) {\r\n\t\t\t\tcurrMax = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn max;\r\n\t}", "private static Pair<Double, Integer> findMaxEntry(double[] array) {\n int index = 0;\n double max = array[0];\n for (int i = 1; i < array.length; i++) {\n if ( array[i] > max ) {\n max = array[i];\n index = i;\n }\n }\n return new Pair<Double, Integer>(max, index);\n }", "public static int secondLargestNum(int[] arr) {\n int max = 0;\n int secondNum = 0;\n for (int i = 0; i < arr.length; i++) {\n if (arr[i] > max) {\n secondNum = max;\n max = arr[i];\n }\n }\n return secondNum;\n }", "public int findMaxLength(int[] nums) {\n int[] arr = new int[2*nums.length+1];\n Arrays.fill(arr, -2);\n arr[nums.length] = -1;\n int max = 0;\n int count=0;\n for(int i=0;i<nums.length;i++){\n count += (nums[i]==0?-1:1);\n if(arr[count+nums.length]>=-1){\n max = Math.max(max,i-arr[count+nums.length]);\n }else{\n arr[count+nums.length]= i;\n }\n }\n return max;\n }", "public int findMax() {\n\t\tint max = (int)data.get(0);\n\t\tfor (int count = 1; count < data.size(); count++)\n\t\t\tif ( (int)data.get(count) > max)\n\t\t\t\tmax = (int)data.get(count);\n\t\treturn max;\n\t}", "public Integer findMax(int[] arr2){\n\t\tif(arr2.length < 2){\n\t\t\tSystem.out.println(arr2[0]);\n\t\t\treturn 0;\n\t\t}\n\t\tint max = arr2[0];\n\t\tfor(int c = 1; c < arr2.length; c++){\n\t\t\tif(arr2[c] > max){\n\t\t\t\tmax = arr2[c];\n\t\t\t}else{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(max);\n\t\treturn 0;\n\t}", "public static int maxArrayIndex(int[] X, int p, int r)\n {\n int q = 0;\n if (p < r)\n {\n q = (p + r) / 2;\n int left = maxArrayIndex(X, p, q);\n int right = maxArrayIndex(X, q + 1, r);\n if (X[left] > X[right])\n {\n return left;\n }\n else\n {\n return right;\n }\n }\n else\n {\n return p;\n }\n\n }", "public static int max(int[] m) {\n int x = 1;\n int ret = m[0];\n while (x < m.length) {\n if (m[x] > ret) {\n ret = m[x];\n }\n x = x + 1;\n }\n return ret;\n }", "public static int max(int[] m) {\n int max_num = m[0];\n int index = 1;\n\n while(index < m.length) {\n if(m[index] > max_num){\n max_num = m[index];\n }\n index += 1;\n }\n\n return max_num;\n }", "public static int getMax(float[][] storage) {\n float []arr=new float[WINDOW];\n for (int i = 0;i<WINDOW;i++){\n arr[i]=storage[i][1];\n }\n\n if(arr==null||arr.length==0){\n return 0;//如果数组为空 或者是长度为0 就返回null\n }\n int maxIndex=0;//假设第一个元素为最小值 那么下标设为0\n int[] arrnew=new int[2];//设置一个 长度为2的数组 用作记录 规定第一个元素存储最小值 第二个元素存储下标\n for(int i =0;i<arr.length-1;i++){\n if(arr[maxIndex]<arr[i+1]){\n maxIndex=i+1;\n }\n }\n arrnew[0]=(int)arr[maxIndex];\n arrnew[1]=maxIndex;\n\n return arrnew[0];\n }", "public static int argmax(double[] array) {\n\t\tdouble max = array[0];\n\t\tint re = 0;\n\t\tfor (int i=1; i<array.length; i++) {\n\t\t\tif (array[i]>max) {\n\t\t\t\tmax = array[i];\n\t\t\t\tre = i;\n\t\t\t}\n\t\t}\n\t\treturn re;\n\t}", "public static int maxindex(Random rng, int[] values) {\n\t\tint max = 0;\n\t\tList<Integer> maxindices = Lists.newArrayList();\n\t\t\n\t\tfor (int index = 0; index < values.length; index++) {\n\t\t\tif (values[index] > max) {\n\t\t\t\tmax = values[index];\n\t\t\t\tmaxindices.clear();\n\t\t\t\tmaxindices.add(index);\n\t\t\t} else if (values[index] == max) {\n\t\t\t\tmaxindices.add(index);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn maxindices.size() > 1 ? maxindices.get(rng.nextInt(maxindices.size())) : maxindices.get(0);\n\t}", "public static int findLargest(int[] data){\n\t\tint lo=0, hi=data.length-1;\n\t\tint mid = (lo+hi)/2;\n\t\tint N = data.length-1;\n\t\twhile (lo <= hi){\n\t\t\tint val = data[mid];\n\t\t\tif(mid == 0 ) return (val > data[mid+1]) ? mid : -1;\n\t\t\telse if(mid == N) return (val > data[mid-1]) ? mid : -1;\n\t\t\telse{\n\t\t\t\tint prev = data[mid-1];\n\t\t\t\tint next = data[mid+1];\n\t\t\t\tif(prev < val && val < next) lo=mid+1;\n\t\t\t\telse if(prev > val && val > next) hi = mid-1;\n\t\t\t\telse return mid; // prev > val && val > next // is the only other case\n\t\t\t\tmid = (lo+hi)/2;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "private int findLargestIndex(int[] widths) {\n int largestIndex = 0;\n int largestValue = 0;\n for (int i = 0; i < widths.length; i++) {\n if (widths[i] > largestValue) {\n largestIndex = i;\n largestValue = widths[i];\n }\n }\n return largestIndex;\n }", "static int extractHeapMax(int[] ar){\r\n\t\tif(heapSize<1) return -1;\r\n\t\tint max = ar[1];\r\n\t\tswap(ar,1,heapSize);\r\n\t\theapSize-=1;\r\n\t\tmax_heapify(ar, 1);\r\n\t\treturn max;\r\n\t}", "public int largestMirror(int[] arr)\n\t{\n\t\tif(arr.length==0)\n\t\t{\n\t\t\tthrow new AssertionError(\"Array is Empty\");\n\t\t}\n\t\tint i=0,j=0,temp=0,max=0,count=0;\n\t\twhile(i<arr.length-1)\n\t\t{\n\t\t\tcount=0;\n\t\t\ttemp=i;\n\t\t\tj=arr.length-1;\n\t\t\twhile(j>=temp)\n\t\t\t{\n\t\t\t\tif(arr[temp]==arr[j])\n\t\t\t\t{\n\t\t\t\t\tcount++;\n\t\t\t\t\tif(temp==j)count++;\n\t\t\t\t\ttemp++;\n\t\t\t\t}\n\t\t\t\telse if(count>0)break;\n\t\t\t\tif(max<count) \n\t\t\t\t\tmax=count;\n\t\t\t\tj--;\n\t\t\t\t\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn max;\n\t}", "public static int maxOne(int arr[]) {\n\t\tint n =arr.length;\n\t\tint newArr[]= new int[n];\n\t\tint j=0;\n\t\tfor(int i=0; i<n; i++) {\n\t\t\tif (arr[i]== 0) {\n\t\t\t\tnewArr[j]=i;\n\t\t\t\tj++;\n\t\t\t}\n\t\t}\n\t\tint max=0;\n\t\tint temp=0;\n\t\tfor (int i=1; i<=j; i++) {\n\t\t\ttemp=newArr[i]- newArr[i-1];\n\t\t\tmax=Math.max(max, temp);\n\t\t}\n\treturn max+1;\n\t}", "public static int findMax(Integer[] X, int low, int high)\n\t\t{if (low + 1 > high) {return X[low];}\n\t\telse {return Math.max(Math.abs(X[low]), Math.abs(findMax(X, low + 1, high)));}\n\t\t}", "static int findHighestNumber(int [] array){\n int highestNumber = array [0];\n for (int x=0; x< array.length; x++){\n if (highestNumber<array[x]){\n highestNumber=array[x];\n }\n }\nreturn highestNumber;\n}", "int arraykey(int max);", "public static int arrayMax(int[] arr, int starting, int ending) {\n int ans = 0;\n for (int i = starting; i < ending; i++) {\n ans = Math.max(ans, arr[i]);\n }\n return ans;\n }", "public static int findMax(int[] elements) {\n int max = 0;\n for (int i = 0; i < elements.length; i++) {\n int element = elements[i];\n\n if (element > max) {\n max = element;\n }\n }\n return max;\n }", "private static int getMax(int[] original) {\n int max = original[0];\n for(int i = 1; i < original.length; i++) {\n if(original[i] > max) max = original[i];\n }\n return max;\n }", "public abstract int findRowMax(boolean z, int i, int[] iArr);", "public int findHighestTemp() {\n\t\t\n\t\tint max = 0;\n\t\tint indexHigh = 0;\n\t\tfor (int i=0; i<temps.length; i++)\n\t\t\tif (temps[i][0] > max) {\n\t\t\t\tmax = temps[i][0];\n\t\t\t\tindexHigh = i;\n\t\t\t}\n\t\t\n\t\treturn indexHigh;\n\t\t\n\t}", "public static int findIndex(int[] arr, int num) {\n\n if (num < arr[0]) return 0;\n if (num > arr[arr.length - 1]) return arr.length;\n\n int start = 0;\n int end = arr.length - 1;\n /* Binary Search Template , avoid infinity loop */\n while (start < end - 1) {\n int mid = (start + end) >>> 1; // avoid overflow\n if (num == arr[mid]) {\n return mid;\n } else if (num < arr[mid]) {\n end = mid;\n } else {\n start = mid;\n }\n }\n return end;\n }", "public int maxSubArray(int[] nums) {\n int[] dp = new int[nums.length];\n dp[0] = nums[0];\n int res = nums[0];\n for (int i = 1; i < nums.length; i++) {\n dp[i] = nums[i] + (dp[i - 1] < 0 ? 0 : dp[i - 1]);\n res = Math.max(res, dp[i]);\n }\n return res;\n }", "public Integer findLargestNumber() {\r\n\t\t// take base index element as largest number\r\n\t\tInteger largestNumber = numArray[0];\r\n\t\t// smallest number find logic\r\n\t\tfor (int i = 1; i < numArray.length; i++) {\r\n\t\t\tif (numArray[i] != null && numArray[i] > largestNumber) {\r\n\t\t\t\tlargestNumber = numArray[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t// return smallest number from the given array\r\n\t\treturn largestNumber;\r\n\t}", "private static int maxConti(int[] arr) {\n\t\tint sum=0;\n\t\tint maxValue=arr[0];\n\t\tint start=0;int end=0;\n\t\tfor(int i=0;i<arr.length;i++)\n\t\t{ \n\t\t\tsum=Math.max(sum+arr[i], arr[i]);\n\t\t\t\n\t\t\t\n\t\t\tmaxValue=Math.max(maxValue,sum);\n\t\t\t\n\t\t}\n\t\tSystem.out.println(start+\" \"+end);\n\t\treturn maxValue;\n\t}", "private static int findIndexOfLargest(float[] vector) {\n\t\tint index = -1;\n\t\tfloat value = Float.NEGATIVE_INFINITY;\n\t\tfloat temp;\n\t\tfor (int d=0; d<Constants.ACCEL_DIM; ++d) {\n\t\t\ttemp = vector[d];\n\t\t\tif (temp<0.0f)\n\t\t\t\ttemp = -temp;\n\t\t\t\n\t\t\tif (temp>value) {\n\t\t\t\tvalue = temp;\n\t\t\t\tindex = d;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}", "public static double getMax(double[] arr) \n { \n double max = arr[0]; \n for(int i=1;i<arr.length;i++) \n { \n if(arr[i]>max) \n max = arr[i]; \n } \n return max; \n }", "double largestNumber(double[] a) {\n\t\tdouble max = a[0];\n\t\tdouble no = 0;\n\t\tfor (int index = 1; index < a.length; index++) {\n\t\t\tif (max > a[index] && max > a[index + 1]) {\n\t\t\t\tno = max;\n\t\t\t\tbreak;\n\t\t\t} else if (a[index] > max && a[index] > a[index + 1]) {\n\t\t\t\tno = a[index];\n\t\t\t\tbreak;\n\t\t\t} else if (a[index + 1] > max && a[index + 1] > a[index]) {\n\t\t\t\tno = a[index + 1];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn no;\n\t}", "public static int max(int[] theArray) {\n\n int biggest = theArray[0];\n\n //Converts the array to a list\n List<Integer> values = Arrays.stream(theArray).boxed().collect(Collectors.toList());\n\n //get the biggest by streaming the list and using min which gets the min value by using the Integer Comparator.comparing().\n //which means it will loop through the array and compare all the values for the biggest values\n biggest= values.stream().max(Integer::compare).get();\n\n// //Alternative code does the samething\n// for (int number : theArray) {\n//\n// if (biggest < number) {\n// biggest = number;\n// }\n// }\n\n return biggest;\n\n }", "public int highestInterIndex(){\r\n\t\tint index = -1;\r\n\t\tfor (int i = 0; i < this.interVec.length; i++) {\r\n\t\t\tif (index == -1 && this.interVec[i] == true \r\n\t\t\t\t\t&& this.getSwitchState(Model.getInterAt(i).getIRQ()) == true)\r\n\t\t\t\tindex = i;\r\n\t\t\telse if(this.interVec[i] == true &&\r\n\t\t\t\t\t\tthis.getSwitchState(Model.getInterAt(i).getIRQ()) == true &&\r\n\t\t\t\t\t\t\tModel.getInterAt(i).getPriority() < Model.getInterAt(index).getPriority())\r\n\t\t\t\tindex = i;\r\n\t\t}\r\n\t\treturn index;\r\n\t}", "public int maxSubArray(int[] nums) {\n int maxNow = Integer.MIN_VALUE, maxEnd = 0;\n for (int i = 0; i < nums.length; i++) {\n maxEnd = maxEnd + nums[i];\n if (maxNow < maxEnd) {\n maxNow = maxEnd;\n }\n if (maxEnd < 0) {\n maxEnd = 0;\n }\n }\n return maxNow;\n\n }", "public static int secondaryArgmax(double[] a) {\n\t\tint mi = argmax(a);\n\t\t// scan left until increasing\n\t\tint i;\n\t\tfor (i=mi-1; i>=0 && a[i]<=a[i+1]; i--);\n\t\tint l = argmax(a,0,i+1);\n\t\tfor (i=mi+1; i<a.length && a[i]<=a[i-1]; i++);\n\t\tint r = argmax(a,i,a.length);\n\t\tif (l==-1) return r;\n\t\tif (r==-1) return l;\n\t\treturn a[l]>=a[r]?l:r;\n\t}", "public static int maxValue(int [] array){\n int hold = array[0];\n for(int i = 1; i < array.length; i++){\n if(array[i] > hold){\n hold = array[i];\n }\n }\n return hold;\n }", "public T findHighest(){\n T highest = array[0];\n for (int i=0;i<array.length; i++)\n {\n if (array[i].doubleValue()>highest.doubleValue())\n {\n highest = array[i];\n } \n }\n return highest;\n }", "public static int max(int[] array){\n \n if(array == null){\n \n throw new IllegalArgumentException(\"Array cannot be null\");\n }\n else if(array.length==0){\n throw new IllegalArgumentException(\"Array cannot be empty\");\n }\n \n int max = array[0];\n \n for(int i = 1; i < array.length; i++){\n \n if(array[i] > max){\n max = array[i];\n }\n }\n return max;\n }", "public static int getMax(int[] scores) {\r\n\t\r\n\t\tint temp = scores[0];\r\n\t\tfor(int i = 1; i < scores.length; ++i) {\r\n\t\t\r\n\t\t\tif (scores[i] > temp) {\r\n\t\t\t\ttemp = scores[i];\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn temp;\r\n\t\r\n\t}", "public static void main(String[] args) {\n \n Scanner sc = new Scanner(System.in);\n \n int num[] = new int[5];\n int max=0;\n int maxLocation=0;\n \n for (int a=0; a<num.length; a++){\n System.out.println(\"Enter number:\");\n num[a] = sc.nextInt();\n }\n \n for (int b=0; b<num.length; b++){\n if(num[b]>max){\n max=num[b];\n maxLocation=b;\n }\n }\n System.out.print(\"The largest number is \" +max);\n System.out.println(\" and the position of it's index is \" +maxLocation);\n }", "public int maxSubArray(int[] nums) {\n return helper(nums, 0, nums.length - 1);\n }", "static Integer find(int[] arr) {\n\n List<Integer> arrList = Arrays.stream(arr).boxed().collect(Collectors.toList());\n Collections.sort(arrList);\n for(Integer i=0; i<arrList.size(); ++i) {\n if(arrList.get(i) != arrList.get(0) + i)\n return arrList.get(0) + i;\n }\n return -1;\n }", "private static int maxValue(int[] a) {\n\t\tint max_value =0;\r\n\t\tint current_max=0;\r\n\t\t\r\n\t\tfor(int i=0;i<a.length;i++)\r\n\t\t{\r\n\t\t\tcurrent_max += a[i];\r\n\t\t\tmax_value= Math.max(max_value, current_max);\r\n\t\t\tif(a[i]<0)\r\n\t\t\t\tcurrent_max=0;\r\n\t\t}\r\n\t\t\r\n\t\treturn max_value;\r\n\t}", "protected int findMinIndex(int[] arr)\n\t{\n\t\tint minIndex = arr.length;\n\t\tSet<Integer> set = new HashSet<>();\n\n\t\tfor (int i = arr.length - 1; i >= 0; i--) {\n\t\t\tif (set.contains(arr[i])) {\n\t\t\t\tminIndex = i;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tset.add(arr[i]);\n\t\t\t}\n\t\t}\n\t\treturn minIndex;\n\t}", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int[] array = new int[5];\n int max = 0;\n int index = 0;\n for (int i = 0; i < array.length; i++) {\n System.out.println(\"Enter array numbers\");\n array[i] = scanner.nextInt();\n }\n for (int i = 1; i < array.length; i += 2) {\n if (array[i - 1] > array[i] && array[i - 1] > max) {\n max = array[i - 1];\n index = i - 1;\n } else if (array[i - 1] < array[i] && array[i - 1] < max) {\n max = array[i];\n index = i;\n }\n }\n System.out.println(\"Largest number is : \" + max);\n System.out.println(\"index is : \" + index);\n }", "public static int maxSubArrayWithZeroSum(int[] arr) {\r\n\t\tMap<Integer, Integer> sumToIndexMap = new HashMap<>();\r\n\r\n\t\tint sum = 0;\r\n\t\tsumToIndexMap.put(0, -1);\r\n\t\tint max = Integer.MIN_VALUE;\r\n\r\n\t\tfor (int index = 0; index < arr.length; index++) {\r\n\r\n\t\t\tif (arr[index] == 0) {\r\n\t\t\t\tmax = Integer.max(max, 1);\r\n\t\t\t}\r\n\r\n\t\t\tsum = sum + arr[index];\r\n\t\t\tif (sumToIndexMap.containsKey(sum)) {\r\n\r\n\t\t\t\tint prevSumIndex = sumToIndexMap.get(sum);\r\n\t\t\t\tmax = Integer.max(max, index - prevSumIndex);\r\n\t\t\t} else {\r\n\t\t\t\tsumToIndexMap.put(sum, index);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn max;\r\n\t}", "static int find(int[] arr){\n\t\tif(arr.length==1) return -1;\n\t\tint slow = arr[0] , fast = arr[arr[0]];\n\t\twhile(slow!=fast){\n\t\t\tslow = arr[slow];\n\t\t\tfast = arr[arr[fast]];\n\t\t}\n\t\tslow = 0;\n\t\twhile(slow!=fast){\n\t\t\tslow = arr[slow];\n\t\t\tfast = arr[fast];\n\t\t}\n\t\treturn slow;\n\n\t}", "public long max() {\n\t\tif (!this.isEmpty()) {\n\t\t\tlong result = theElements[0];\n\t\t\tfor (int i=1; i<numElements; i++) {\n\t\t\t\tif (theElements[i] > result) {\n\t\t\t\t\tresult = theElements[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\telse {\n\t\t\tthrow new RuntimeException(\"Attempted to find max of empty array\");\n\t\t}\n\t}", "public static int maximumSubArray(int arr[])\n\t{\n\t\tint sum=arr[0];\n\t\tint maxSum = arr[0];\n\t\tint n = arr.length;\n\t\tfor(int i=1;i<n;i++)\n\t\t{\n\t\t\tsum = Math.max(sum+arr[i], arr[i]);\n\t\t\t\n\t\t\tmaxSum = Math.max(maxSum, sum);\n\t\t}\n\t\t\n\t\treturn maxSum;\n\t}" ]
[ "0.80914384", "0.80651814", "0.79477954", "0.77027094", "0.7642541", "0.7633973", "0.7633509", "0.7559472", "0.7537176", "0.7536367", "0.7501793", "0.74220234", "0.74202794", "0.7419712", "0.73471034", "0.72963417", "0.7291788", "0.72717756", "0.7250218", "0.723062", "0.71818006", "0.7177048", "0.71509427", "0.71313417", "0.7098471", "0.70906156", "0.70794827", "0.7071355", "0.70601034", "0.70550424", "0.702579", "0.70071346", "0.6992426", "0.69649017", "0.69638807", "0.69484687", "0.6925686", "0.692355", "0.6917734", "0.6907415", "0.68881637", "0.688298", "0.68687135", "0.68643737", "0.68628585", "0.6857784", "0.68475693", "0.6819763", "0.6816467", "0.6813868", "0.6811334", "0.68092304", "0.68032986", "0.6768558", "0.67576087", "0.6753956", "0.67350614", "0.6700955", "0.669546", "0.6681179", "0.6676331", "0.6668467", "0.66558766", "0.66526794", "0.66455054", "0.66285026", "0.66212016", "0.66185075", "0.661697", "0.6610836", "0.66066253", "0.66057295", "0.6587602", "0.65631306", "0.65590996", "0.6551188", "0.65461", "0.6539471", "0.65381986", "0.6528409", "0.65206105", "0.6520218", "0.6498954", "0.64984405", "0.6485425", "0.6477575", "0.64715594", "0.6455179", "0.64481527", "0.6432149", "0.64270407", "0.64229125", "0.64226884", "0.64216346", "0.64118004", "0.64095056", "0.63758796", "0.6370366", "0.635381", "0.63436294" ]
0.7255945
18
Check if response ok.
public boolean hasFailed () { return exception_ != null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static boolean checkOk(String response) {\n\t\tMatcher m = PAT_ES_SUCCESS.matcher(response);\n\t\tif (m.find()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@SuppressWarnings(\"unchecked\")\n private boolean checkResponse (HttpResponse<?> pResponse) {\n boolean result = false;\n if (pResponse != null\n && pResponse.getStatus() == 200\n && pResponse.getBody() != null) {\n HttpResponse<String> response = (HttpResponse<String>)pResponse;\n JSONObject body = new JSONObject(response.getBody());\n if (body.has(\"result\")) {\n result = Boolean.TRUE.equals(body.getBoolean(\"success\"));\n }\n }\n return result;\n }", "protected boolean isSuccessful(Response response) {\n if (response == null) {\n return false;\n }\n //System.out.println(\" Get Status is \" + response.getStatus());\n return response.getStatus() == 200;\n }", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "public boolean isOK() {\r\n return getPayload().getString(\"status\").equals(\"ok\");\r\n }", "public boolean isHttpOK(){\n return getStatusCode() == HttpURLConnection.HTTP_OK;\n }", "private boolean isSuccessful(SocketMessage response) {\r\n if (\"success\".equals(response.getValue(\"status\"))) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public boolean validateReponse(Response response, int id,int which)\n {\n return response.isSuccessful();\n }", "public boolean validateResponse(Response response) {\n return response.isSuccessful();\n }", "public final boolean isOk() {\n return ok;\n }", "public boolean isOk() {\n\t\treturn ok;\n\t}", "boolean hasIsSuccess();", "public boolean isSuccessful() {\n return responseCode >= 200 && responseCode < 300;\n }", "public boolean isOk() {\n return _type == Type.OK;\n }", "public boolean wasOkay();", "protected abstract boolean isResponseValid(SatelMessage response);", "public static boolean isOK() {return isOK;}", "boolean getIsOk();", "public boolean isSuccessful() {\n return code >= 200 && code < 300;\n }", "Boolean responseHasErrors(MovilizerResponse response);", "public boolean isOk() {\n return this.state == null || this.state.code == 0;\n }", "boolean hasResponseMessage();", "default boolean checkJsonResp(JsonElement response) {\n return false;\n }", "public static boolean isResponseCodeOk(Integer responseCode) {\n\n if (responseCode >= HttpStatus.SC_BAD_REQUEST) return false;\n return true;\n }", "default boolean checkForError(HttpResponse response) {\n parameters.clear();\n\n\n if (response.getStatusCode() == 500) {\n System.out.println(\"Internal server error\");\n return true;\n } else if (response.getStatusCode() == 400) {\n System.out.println(\"Your input was not as expected. Use \\\"help\\\"-command to get more help.\");\n System.out.println(response.getBody());\n return true;\n } else if (response.getStatusCode() == 404) {\n System.out.println(\"The resource you were looking for could not be found. Use \\\"help\\\"-command to get more help.\");\n }\n\n return false;\n\n }", "@Override\n\t\t\tpublic boolean hasError(ClientHttpResponse response) throws IOException {\n\t\t\t\treturn false;\n\t\t\t}", "public boolean isOK() {\n\t\treturn adaptee.isOK();\n\t}", "private boolean checkError(byte[] response) {\n\t\treturn Arrays.equals(response,\"error\".getBytes());\n\t}", "protected abstract boolean isExpectedResponseCode(int httpStatus);", "boolean hasInitialResponse();", "boolean hasListResponse();", "public boolean isOkay() {\n return okay;\n }", "@Test\n\tpublic void verifyStatusCode() {\n\t\tAssert.assertEquals(response.getStatusCode(), 200);\n\t}", "public boolean hasResponse() {\n return response_ != null;\n }", "public boolean repOk();", "boolean isSuccessful();", "protected static boolean ok(int status) {\n return (status >= 200 && status < 300);\n }", "public boolean getResponseStatus();", "private int checkServerResponse(String message) {\n \t\tif (message.substring(0, 2).equalsIgnoreCase(\"ok\")) {\n \t\t\treturn HGDConsts.SUCCESS;\n \t\t}\n \t\treturn HGDConsts.FAILURE;\n \t}", "private static Boolean compareStatusCode(String test, HttpResponse<InputStream> jsonResponse) {\n return test.equalsIgnoreCase(Integer.toString(jsonResponse.getStatus()));\n }", "@java.lang.Override\n public boolean getIsOk() {\n return isOk_;\n }", "private boolean responseAvailable() {\n return (responseBody != null) || (responseStream != null);\n }", "boolean hasRoundEndedResponse();", "public boolean isSuccess();", "public boolean isSuccess();", "public boolean hasResponse() {\n return response_ != null;\n }", "public boolean hasResponse() {\n return response_ != null;\n }", "public boolean hasResponse() {\n return response_ != null;\n }", "boolean hasResponseTimeSec();", "public abstract boolean repOk();", "void ok();", "boolean hasGenericResponse();", "public boolean performOk() {\r\n\t\treturn super.performOk();\r\n\t}", "public boolean isSuccessful()\n\t{\n\t\tif (response.get(\"Result\").equals(\"APPROVED\") && !response.get(\"MESSAGE\").equals(\"DUPLICATE\")) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean isStatusOk() {\r\n return STATUS_OK.equals(this.status);\r\n }", "@java.lang.Override\n public boolean getIsOk() {\n return isOk_;\n }", "public boolean hasListResponse() {\n return msgCase_ == 6;\n }", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean hasTrickEndedResponse();", "@Override\r\n protected Result check() throws Exception {\n try {\r\n Response response = webTarget.request().get();\r\n\r\n if (!response.getStatusInfo().getFamily().equals(Response.Status.Family.SUCCESSFUL)) {\r\n\r\n return Result.unhealthy(\"Received status: \" + response.getStatus());\r\n }\r\n\r\n return Result.healthy();\r\n } catch (Exception e) {\r\n\r\n return Result.unhealthy(e.getMessage());\r\n }\r\n }", "public static void validateResponseStatusCode(Response response) {\n\t\tresponse.then().statusCode(200);\n\n\t}", "public boolean isResponse(){\n return true;\n }", "@Override\n\tpublic boolean repOk() {\n\t\treturn true;\n\t}", "public boolean hasListResponse() {\n return msgCase_ == 6;\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "boolean hasUploadResponse();", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean okReveiced () {\n\t\t\treturn resultDetected[RESULT_INDEX_OK];\n\t\t}", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "@Override\n public void onResponse(String response) {\n Log.i(\"Checking\", response + \" \");\n if(new ServerReply(response).getStatus())\n {\n Toast.makeText(context,new ServerReply(response).getReason(),Toast.LENGTH_LONG).show();\n }\n\n }", "protected abstract void handleOk();", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean mo7249a(HttpURLConnection httpURLConnection) {\n return httpURLConnection.getResponseCode() == 200;\n }", "boolean hasPassCardsResponse();", "private boolean readResponse() throws IOException {\n replyHeaders.responseCode = socketInput.read();\n int packetLength = socketInput.read();\n packetLength = (packetLength << 8) + socketInput.read();\n\n if (packetLength > OBEXConstants.MAX_PACKET_SIZE_INT) {\n if (exceptionMessage != null) {\n abort();\n }\n throw new IOException(\"Received a packet that was too big\");\n }\n\n if (packetLength > BASE_PACKET_LENGTH) {\n int dataLength = packetLength - BASE_PACKET_LENGTH;\n byte[] data = new byte[dataLength];\n int readLength = socketInput.read(data);\n if (readLength != dataLength) {\n throw new IOException(\"Received a packet without data as decalred length\");\n }\n byte[] body = OBEXHelper.updateHeaderSet(replyHeaders, data);\n\n if (body != null) {\n privateInput.writeBytes(body, 1);\n\n /*\n * Determine if a body (0x48) header or an end of body (0x49)\n * was received. If we received an end of body and\n * a response code of OBEX_HTTP_OK, then the operation should\n * end.\n */\n if ((body[0] == 0x49) && (replyHeaders.responseCode == ResponseCodes.OBEX_HTTP_OK)) {\n return false;\n }\n }\n }\n\n if (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE) {\n return true;\n } else {\n return false;\n }\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean hasResponse() {\n return instance.hasResponse();\n }", "public boolean hasResponse() {\n return instance.hasResponse();\n }", "public boolean hasResponse() {\n return instance.hasResponse();\n }", "public boolean hasResponse() {\n return instance.hasResponse();\n }", "public void check() throws IOException {\n Boolean codeIsValid = Boolean.valueOf(res.readEntity(String.class));\n if(codeIsValid) {\n ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();\n context.redirect(context.getRequestContextPath() + \"/business/UseDeals.jsf\");\n codeMessage = \"\";\n } else {\n codeMessage = \"Code is not valid! Please try again!\";\n }\n }", "public void serverSideOk();" ]
[ "0.77896523", "0.76638013", "0.7646322", "0.7612965", "0.7612965", "0.7612965", "0.7612965", "0.7612965", "0.7612965", "0.7612965", "0.7612965", "0.7612965", "0.7497993", "0.7412836", "0.7278467", "0.7221364", "0.7185989", "0.7042344", "0.7031471", "0.6997169", "0.6978525", "0.69529134", "0.6890067", "0.68858206", "0.6877373", "0.6855983", "0.6831155", "0.6816682", "0.6816471", "0.6808261", "0.677864", "0.6771243", "0.6735228", "0.6710093", "0.6612586", "0.6605926", "0.6569959", "0.6547628", "0.6522855", "0.64914024", "0.6480684", "0.6454223", "0.644159", "0.64339584", "0.641644", "0.64108986", "0.64003205", "0.6397532", "0.6394548", "0.63843066", "0.6373761", "0.6362629", "0.6362629", "0.6346137", "0.6346137", "0.6346137", "0.6338805", "0.63325226", "0.63260585", "0.6325861", "0.6319689", "0.6308738", "0.630115", "0.6295721", "0.6284634", "0.6278892", "0.6278892", "0.6278892", "0.6278892", "0.6278892", "0.6278892", "0.6278892", "0.62669563", "0.6266436", "0.626149", "0.6245438", "0.6238675", "0.62333286", "0.62322235", "0.62318736", "0.6219186", "0.6217261", "0.621594", "0.6202074", "0.619941", "0.61985517", "0.6189275", "0.61888516", "0.6188538", "0.61863756", "0.6184681", "0.61771786", "0.61771786", "0.61771786", "0.6173926", "0.6158086", "0.6158086", "0.6158086", "0.6158086", "0.61462086", "0.6141979" ]
0.0
-1
To check if retried for failure case.
public boolean isRetried () { return hasFailed () && retried_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isRetry();", "@Override\n\t\tpublic boolean isRetry() { return true; }", "@Test\n public void testCanRetry() {\n assertEquals(0, rc.getAttempts());\n assertTrue(rc.attempt());\n assertEquals(1, rc.getAttempts());\n assertTrue(rc.attempt());\n assertEquals(2, rc.getAttempts());\n assertTrue(rc.attempt());\n assertEquals(3, rc.getAttempts());\n assertFalse(rc.attempt());\n assertEquals(3, rc.getAttempts());\n assertFalse(rc.attempt());\n assertEquals(3, rc.getAttempts());\n assertFalse(rc.attempt());\n assertEquals(3, rc.getAttempts());\n }", "@Override\n\t\tpublic boolean isRetry() { return false; }", "public boolean retry() {\n return tries++ < MAX_TRY;\n }", "@Override\n\tpublic boolean retry(ITestResult result) \n\t{\n\t\treturn false;\n\t}", "boolean doRetry() {\n synchronized (mHandler) {\n boolean doRetry = currentRetry < MAX_RETRIES;\n boolean futureSync = mHandler.hasMessages(0);\n\n if (doRetry && !futureSync) {\n currentRetry++;\n mHandler.postDelayed(getNewRunnable(), currentRetry * 15_000);\n }\n\n return mHandler.hasMessages(0);\n }\n }", "boolean allowRetry(int retry, long startTimeOfExecution);", "@Override\n\t\tpublic boolean wasRetried()\n\t\t{\n\t\t\treturn false;\n\t\t}", "public boolean willRetry() {\n return willRetry;\n }", "public boolean shouldRetryOnTimeout() {\r\n return configuration.shouldRetryOnTimeout();\r\n }", "void doRetry();", "public boolean retry(ITestResult result) {\n\t\tif (counter < retryMaxLimit) {\n\t\t\tcounter++;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean retry(ITestResult result) {\n //You could mentioned maxRetryCnt (Maximiun Retry Count) as per your requirement. Here I took 2, If any failed testcases then it runs two times\n int maxRetryCnt = 1;\n if (retryCnt < maxRetryCnt) {\n System.out.println(\"Retrying \" + result.getName() + \" again and the count is \" + (retryCnt+1));\n retryCnt++;\n return true;\n }\n return false;\n }", "@Override\npublic boolean retry(ITestResult result) {\n\tif(minretryCount<=maxretryCount){\n\t\t\n\t\tSystem.out.println(\"Following test is failing====\"+result.getName());\n\t\t\n\t\tSystem.out.println(\"Retrying the test Count is=== \"+ (minretryCount+1));\n\t\t\n\t\t//increment counter each time by 1  \n\t\tminretryCount++;\n\n\t\treturn true;\n\t}\n\treturn false;\n}", "@Override\n\tpublic boolean retry(ITestResult result) {\n\n if (!result.isSuccess()) { //Check if test not succeed\n if (count < maxTry) { //Check if maxtry count is reached\n count++; //Increase the maxTry count by 1\n System.out.println(\"is this working?\"); \n result.setStatus(ITestResult.FAILURE); //Mark test as failed\n return true; //Tells TestNG to re-run the test\n } else {\n result.setStatus(ITestResult.FAILURE); //If maxCount reached,test marked as failed\n }\n }\n else {\n result.setStatus(ITestResult.SUCCESS); //If test passes, TestNG marks it as passed\n }\n return false;\n\t}", "boolean shouldRetry(Reply reply) {\n int numErrors = reply.getNumErrors();\n if (numErrors == 0) {\n return false;\n }\n for (int i = 0; i < numErrors; ++i) {\n if (!retryPolicy.canRetry(reply.getError(i).getCode())) {\n return false;\n }\n }\n synchronized (monitor) {\n return !destroyed;\n }\n }", "@Test\n public void testResetAndCanRetry() {\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n rc.reset();\n\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertFalse(rc.attempt());\n assertFalse(rc.attempt());\n assertFalse(rc.attempt());\n }", "public int retry() {\r\n\t\treturn ++retryCount;\r\n\t}", "public boolean needTryAgain() {\n boolean z = this.mRetryConnectCallAppAbilityCount < 6;\n this.mRetryConnectCallAppAbilityCount++;\n return z;\n }", "public abstract long retryAfter();", "public void onTryFails(int currentRetryCount, Exception e) {}", "@Override\n protected boolean isResponseStatusToRetry(Response response)\n {\n return response.getStatus() / 4 != 100;\n }", "@Test\n public void testRetryCountNoRetries() {\n assertEquals(0, rc.getAttempts());\n }", "@Override\n boolean isFailed() {\n return false;\n }", "String getLogRetryAttempted();", "private boolean checkRetryPolicy4Next() {\n\t\ttry {\n\t\t\tRetryPolicy policy = BackupService.getInstance().getRetryPolicy(CommonService.RETRY_BACKUP);\n\t\t\tNextScheduleEvent nextScheduleEvent = BackupService.getInstance().getNextScheduleEvent();\n\t\t\tif (nextScheduleEvent != null) {\n\t\t\t\tDate nextDate = nextScheduleEvent.getDate();\n\t\t\t\tjava.util.Calendar incomingBackup = getUTCNow();\n\t\t\t\tincomingBackup.setTimeInMillis(nextDate.getTime());\n\n\t\t\t\tjava.util.Calendar now = getUTCNow();\n\t\t\t\tnow.add(java.util.Calendar.MINUTE, policy.getNearToNextEvent());\n\n\t\t\t\tif (now.after(incomingBackup)) {\n\t\t\t\t\tlogger.debug(\"dealWithMissedBackup() - end with too near to next event\");\n\t\t\t\t\tString time = BackupConverterUtil.dateToString(nextDate);\n\t\t\t\t\tBackupService\n\t\t\t\t\t\t\t.getInstance()\n\t\t\t\t\t\t\t.getNativeFacade()\n\t\t\t\t\t\t\t.addLogActivity(\n\t\t\t\t\t\t\t\t\tConstants.AFRES_AFALOG_WARNING,\n\t\t\t\t\t\t\t\t\tConstants.AFRES_AFJWBS_JOB_RETRY,\n\t\t\t\t\t\t\t\t\tnew String[] {\n\t\t\t\t\t\t\t\t\t\t\tWebServiceMessages.getResource(Constants.RETRYPOLICY_FOR_MISSED_SKIPPED_NEXT, time,\n\t\t\t\t\t\t\t\t\t\t\t\t\tWebServiceMessages.getResource(Constants.RETRYPOLICY_FOR_MISSED)), \"\", \"\", \"\", \"\" });\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (ServiceException e) {\n\t\t\tlogger.error(\"dealWithMissedBackup() - end\", e);\n\t\t}\n\t\treturn true;\n\t}", "private boolean shouldRetryGetMaster(int tries, Exception e) {\n if (tries == numRetries - 1) {\n // This was our last chance - don't bother sleeping\n LOG.info(\"getMaster attempt \" + tries + \" of \" + numRetries +\n \" failed; no more retrying.\", e);\n return false;\n }\n LOG.info(\"getMaster attempt \" + tries + \" of \" + numRetries +\n \" failed; retrying after sleep of \" +\n ConnectionUtils.getPauseTime(this.pause, tries), e);\n return true;\n }", "public boolean requiresImmediateRetry() {\n return currentItemState == ItemProcessingState.IMMEDIATE_RETRY;\n }", "boolean isFailure();", "@Override\n public void onRetry(int retryNo) {\n }", "private boolean needAbandonRetries(int statusCode, String action) {\n if (statusCode == KeeperException.Code.SESSIONEXPIRED.intValue()) {\n LOG.error(\"ZK session expired. Master is expected to shut down. Abandoning retries for \"\n + \"action=\" + action);\n return true;\n }\n return false;\n }", "public boolean shouldRetry(com.amazonaws.AmazonWebServiceRequest r5, com.amazonaws.AmazonClientException r6, int r7) {\n /*\n r4 = this;\n r2 = 1\n java.lang.Throwable r3 = r6.getCause()\n boolean r3 = r3 instanceof java.io.IOException\n if (r3 == 0) goto L_0x0012\n java.lang.Throwable r3 = r6.getCause()\n boolean r3 = r3 instanceof java.io.InterruptedIOException\n if (r3 != 0) goto L_0x0012\n L_0x0011:\n return r2\n L_0x0012:\n boolean r3 = r6 instanceof com.amazonaws.AmazonServiceException\n if (r3 == 0) goto L_0x0039\n r0 = r6\n com.amazonaws.AmazonServiceException r0 = (com.amazonaws.AmazonServiceException) r0\n int r1 = r0.getStatusCode()\n r3 = 500(0x1f4, float:7.0E-43)\n if (r1 == r3) goto L_0x0011\n r3 = 503(0x1f7, float:7.05E-43)\n if (r1 == r3) goto L_0x0011\n r3 = 502(0x1f6, float:7.03E-43)\n if (r1 == r3) goto L_0x0011\n r3 = 504(0x1f8, float:7.06E-43)\n if (r1 == r3) goto L_0x0011\n boolean r3 = com.amazonaws.retry.RetryUtils.isThrottlingException(r0)\n if (r3 != 0) goto L_0x0011\n boolean r3 = com.amazonaws.retry.RetryUtils.isClockSkewError(r0)\n if (r3 != 0) goto L_0x0011\n L_0x0039:\n r2 = 0\n goto L_0x0011\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.amazonaws.retry.PredefinedRetryPolicies.SDKDefaultRetryCondition.shouldRetry(com.amazonaws.AmazonWebServiceRequest, com.amazonaws.AmazonClientException, int):boolean\");\n }", "private boolean mustTryConnection(int iteration) {\n\t\t\n\t\t//the goal is to not to retry so often when several attempts have been made\n\t\t//the first 3 attemps, will not retry (give time for the system to startup)\n\t\tif (iteration < ITERATIONS_WITHOUT_RETRIES) {\n\t\t\t//here it will enter with iteration 0..2\n\t\t\treturn false;\n\t\t}\n\t\tif (iteration < ITERATIONS_WITH_NORMAL_RATE) {\n\t\t\t//Here it will enter with iteration 3..40\n //Retry every 2 attempts.\n\t\t\t//in iteration 6, 8, 10, 12, 14\n\t\t\treturn iteration % STEPS_AT_NORMAL_RATE == 0;\n\t\t}\n\t\t//between 15 and 40 attempts, only retry every 10 steps\n\t\tif (iteration < ITERATIONS_WITH_MEDIUM_RATE) {\n\t\t\t//here it will enter with iteration 10, 20, 30\n\t\t\treturn iteration % STEPS_AT_MEDIUM_RATE == 0;\n\t\t}\n\t\t\n\t\t//after 40 attempts, retry every 100 * MIN_INTERVAL\n\t\treturn iteration % STEPS_AT_SLOW_RATE == 0;\n\t}", "@Override\n protected RetryConstraint shouldReRunOnThrowable(@NonNull Throwable throwable, int runCount, int maxRunCount) {\n return RetryConstraint.CANCEL;\n }", "protected boolean checkRetryCount(MessageDto messageDto, ConsumerQueueDto pre) {\n return pre.getTopicType() == 1 || (pre.getTopicType() == 2 && pre.getRetryCount() > messageDto.getRetryCount());\n }", "public int getRetryAttempt()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(RETRYATTEMPT$24, 0);\n if (target == null)\n {\n return 0;\n }\n return target.getIntValue();\n }\n }", "private boolean isRetryNeeded(int statusCode, HttpState state, HttpConnection conn) {\n switch (statusCode) {\n case HttpStatus.SC_UNAUTHORIZED:\n case HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED:\n LOG.debug(\"Authorization required\");\n if (doAuthentication) { //process authentication response\n //if the authentication is successful, return the statusCode\n //otherwise, drop through the switch and try again.\n if (processAuthenticationResponse(state, conn)) {\n return false;\n }\n } else { //let the client handle the authenticaiton\n return false;\n }\n break;\n\n case HttpStatus.SC_MOVED_TEMPORARILY:\n case HttpStatus.SC_MOVED_PERMANENTLY:\n case HttpStatus.SC_SEE_OTHER:\n case HttpStatus.SC_TEMPORARY_REDIRECT:\n LOG.debug(\"Redirect required\");\n\n if (!processRedirectResponse(conn)) {\n return false;\n }\n break;\n\n default:\n // neither an unauthorized nor a redirect response\n return false;\n } //end of switch\n\n return true;\n }", "@Override\n\t\tpublic void setWasRetried(boolean wasRetried) {\n\t\t\t\n\t\t}", "@Override\r\n public void onRetry(int retryNo) {\n }", "private void checkRetries(final int counter) throws InterruptedException {\n\t\tif (counter > retries) {\n\t\t\tthrow new IllegalStateException(\"Remote server did not started correctly\");\n\t\t}\n\t\tThread.sleep(2000);\n\t}", "public boolean hasFailed ()\r\n {\r\n return exception_ != null;\r\n }", "void retry(Task task);", "@Test\n @MediumTest\n @DisabledTest(message = \"crbug.com/1182234\")\n @Feature({\"Payments\"})\n public void testRetryWithDefaultError() throws TimeoutException {\n mPaymentRequestTestRule.triggerUIAndWait(\"buy\", mPaymentRequestTestRule.getReadyForInput());\n mPaymentRequestTestRule.clickAndWait(\n R.id.button_primary, mPaymentRequestTestRule.getReadyForUnmaskInput());\n mPaymentRequestTestRule.setTextInCardUnmaskDialogAndWait(\n R.id.card_unmask_input, \"123\", mPaymentRequestTestRule.getReadyToUnmask());\n mPaymentRequestTestRule.clickCardUnmaskButtonAndWait(\n ModalDialogProperties.ButtonType.POSITIVE,\n mPaymentRequestTestRule.getPaymentResponseReady());\n\n mPaymentRequestTestRule.retryPaymentRequest(\"{}\", mPaymentRequestTestRule.getReadyToPay());\n\n Assert.assertEquals(\n mPaymentRequestTestRule.getActivity().getString(R.string.payments_error_message),\n mPaymentRequestTestRule.getRetryErrorMessage());\n }", "@Override\n boolean canFail() {\n return true;\n }", "@Override\r\n public void onRetry(int retryNo) {\n }", "public boolean tryFailure(Throwable cause)\r\n/* 341: */ {\r\n/* 342:424 */ if (setFailure0(cause))\r\n/* 343: */ {\r\n/* 344:425 */ notifyListeners();\r\n/* 345:426 */ return true;\r\n/* 346: */ }\r\n/* 347:428 */ return false;\r\n/* 348: */ }", "@Test\n\tpublic void testRetryTheSuccess() {\n\t\tgenerateValidRequestMock();\n\t\tworker = PowerMockito.spy(new HttpRepublisherWorker(dummyPublisher, actionedRequest));\n\t\tWhitebox.setInternalState(worker, CloseableHttpClient.class, httpClientMock);\n\t\ttry {\n\t\t\twhen(httpClientMock.execute(any(HttpRequestBase.class), any(ResponseHandler.class)))\n\t\t\t\t\t.thenThrow(new IOException(\"Exception to retry on\")).thenReturn(mockResponse);\n\n\t\t} catch (IOException e) {\n\t\t\tfail(\"Should not reach here!\");\n\t\t}\n\t\tworker.run();\n\t\t// verify should attempt to calls\n\t\ttry {\n\t\t\tverify(httpClientMock, times(2)).execute(any(HttpRequestBase.class), any(ResponseHandler.class));\n\t\t\tassertEquals(RequestState.SUCCESS, actionedRequest.getAction());\n\t\t} catch (ClientProtocolException e) {\n\t\t\tfail(\"Should not throw this exception\");\n\t\t} catch (IOException e) {\n\t\t\tfail(\"Should not throw this exception\");\n\t\t}\n\t}", "@Override\n public void onRetry ( int retryNo){\n }", "@Override\n public void onRetry ( int retryNo){\n }", "@Override\n public void onRetry ( int retryNo){\n }", "@Test\n @MediumTest\n @DisabledTest(message = \"crbug.com/1182234\")\n @Feature({\"Payments\"})\n public void testRetryWithCustomError() throws TimeoutException {\n mPaymentRequestTestRule.triggerUIAndWait(\"buy\", mPaymentRequestTestRule.getReadyForInput());\n mPaymentRequestTestRule.clickAndWait(\n R.id.button_primary, mPaymentRequestTestRule.getReadyForUnmaskInput());\n mPaymentRequestTestRule.setTextInCardUnmaskDialogAndWait(\n R.id.card_unmask_input, \"123\", mPaymentRequestTestRule.getReadyToUnmask());\n mPaymentRequestTestRule.clickCardUnmaskButtonAndWait(\n ModalDialogProperties.ButtonType.POSITIVE,\n mPaymentRequestTestRule.getPaymentResponseReady());\n\n mPaymentRequestTestRule.retryPaymentRequest(\"{\"\n + \" error: 'ERROR'\"\n + \"}\",\n mPaymentRequestTestRule.getReadyToPay());\n\n Assert.assertEquals(\"ERROR\", mPaymentRequestTestRule.getRetryErrorMessage());\n }", "int getRetries();", "private void retry() {\n if (catalog == null) {\n if (--retries < 0) {\n inactive = true;\n pendingRequests.clear();\n log.error(\"Maximum retries exceeded while attempting to load catalog for endpoint \" + discoveryEndpoint\n + \".\\nThis service will be unavailabe.\");\n } else {\n try {\n sleep(RETRY_INTERVAL * 1000);\n _loadCatalog();\n } catch (InterruptedException e) {\n log.warn(\"Thread for loading CDS Hooks catalog for \" + discoveryEndpoint + \"has been interrupted\"\n + \".\\nThis service will be unavailable.\");\n }\n }\n }\n }", "int getSleepBeforeRetry();", "@Override\r\n public void onRetry(int retryNo) {\n }", "@Override\r\n public void onRetry(int retryNo) {\n }", "@Override\r\n public void onRetry(int retryNo) {\n }", "private void waitToRetry()\n {\n final int sleepTime = 2000000;\n\n if (keepTrying)\n {\n try\n {\n Thread.sleep(sleepTime);\n }\n catch (Exception error)\n {\n log.error(\"Ignored exception from sleep - probably ok\", error);\n }\n }\n }", "@Override\n public void onRetry(int retryNo) {\n }", "@Override\n public void onRetry(int retryNo) {\n }", "@Override\n public void onRetry(int retryNo) {\n }", "@Override\n public void onRetry(int retryNo) {\n }", "@Override\n public void onRetry(int retryNo) {\n }", "@Override\n public void onRetry(int retryNo) {\n }", "@Override\n public void onRetry(int retryNo) {\n }", "@Override\n public void onRetry(int retryNo) {\n }", "@Override\n public void onRetry(int retryNo) {\n }", "Mono<ShouldRetryResult> shouldRetry(Exception e);", "boolean fail(int rc) {\n if (complete.compareAndSet(false, true)) {\n this.rc = rc;\n submitCallback(rc);\n return true;\n } else {\n return false;\n }\n }", "public boolean isAllowPartialRetryRequests() {\n\t\treturn false;\n\t}", "public boolean failedTick() {\n switch (remainingTicks) {\n case 0:\n return false;\n case -1:\n tickable.tick();\n default:\n remainingTicks--;\n }\n return true;\n }", "public void testHttpFailureRetries() {\n delayTestFinish(RUNASYNC_TIMEOUT);\n runAsync1(0);\n }", "boolean isFail();", "public void incrementRetryCount() {\n this.retryCount++;\n }", "default boolean pollOnExecutionFailed() {\n return false;\n }", "public boolean hasFailed() {\n\t\treturn failed;\n\t}", "@Test\n public void testRetry() throws Exception {\n factory.setSecondsToWait(5L);\n CountDownLatch oneWorkerCreated = factory.getRunCountLatch(1);\n CountDownLatch secondWorkerCreated = factory.getRunCountLatch(2);\n LogFile logFile = tracker.open(\"foo\", \"/biz/baz/%s.log\", DateTime.now());\n manager.start(); //start manager first so it can register to receive notifications\n tracker.written(logFile);\n awaitLatch(oneWorkerCreated);\n logFile.setState(LogFileState.PREP_ERROR); //simulate failure of first prep attempt\n awaitLatch(secondWorkerCreated); //wait for retry\n }", "public final boolean isFailed() {\n return failed;\n }", "public boolean canRunMoreExecutions(JobValidationReference job, boolean retry, long prevId);", "@Override\n public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) {\n if (response.getStatusCode() != 429 || isRateLimitError(response)) {\n return false;\n }\n\n try {\n // Note that this will consume the response body. At this point,\n // subsequent retry handlers or error handlers will not be able to read\n // again the payload, but that should only be attempted when the\n // command is not retryable and an exception should be thrown.\n Error error = parseError.apply(response);\n logger.debug(\"processing error: %s\", error);\n\n boolean isRetryable = RETRYABLE_ERROR_CODE.equals(error.details().code());\n return isRetryable ? super.shouldRetryRequest(command, response) : false;\n } catch (Exception ex) {\n // If we can't parse the error, just assume it is not a retryable error\n logger.warn(\"could not parse error. Request won't be retried: %s\", ex.getMessage());\n return false;\n }\n }", "public void testRetry() throws Exception {\n\n reportFilesProvider.createTestCrashFile();\n\n boolean didCatchException = false;\n\n try {\n // expected to timeout because the send can't complete, so set a very small timeout\n // and interval\n final long timeout = 500L;\n final long interval = 10L;\n\n uploadAndWait(timeout, interval);\n } catch (TimeoutException ex) {\n didCatchException = true;\n }\n assertTrue(didCatchException);\n // Should still be running:\n assertTrue(reportUploader.isUploading());\n assertFalse(reportManager.findReports().isEmpty());\n\n verifyZeroInteractions(mockCall);\n }", "public boolean isFailure( ) {\n\t\treturn failed;\n\t}", "private void fail() {\n mFails++;\n if(mFails > MAX_NUMBER_OF_FAILS) {\n gameOver();\n }\n }", "protected short maxRetries() { return 15; }", "public void onFailure(Throwable caught) {\n if (attempt > 20) {\n fail();\n }\n \n int token = getToken();\n log(\"onFailure: attempt = \" + attempt + \", token = \" + token\n + \", caught = \" + caught);\n new Timer() {\n @Override\n public void run() {\n runAsync1(attempt + 1);\n }\n }.schedule(100);\n }", "@Override\n public void onRetry(int retryNo) {\n super.onRetry(retryNo);\n // 返回重试次数\n }", "protected int retryLimit() {\n return DEFAULT_RETRIES;\n }", "Integer totalRetryAttempts();", "public boolean isIfTaskFails() {\n return getFlow().isIfTaskFails();\n }", "@Override\n public void failure(int rc, Object error)\n {\n task.setReadPoolSelectionContext(getReply().getContext());\n switch (rc) {\n case CacheException.OUT_OF_DATE:\n /* Pool manager asked for a\n * refresh of the request.\n * Retry right away.\n */\n retry(task, 0);\n break;\n case CacheException.FILE_NOT_IN_REPOSITORY:\n case CacheException.PERMISSION_DENIED:\n fail(task, rc, error.toString());\n break;\n default:\n /* Ideally we would delegate the retry to the door,\n * but for the time being the retry is dealed with\n * by pin manager.\n */\n retry(task, RETRY_DELAY);\n break;\n }\n }", "@Test\n public void shouldReturnTotalNumberOfRequestsAs5OnlyFailsChecked() throws IOException {\n\n HelloWorldService helloWorldService = mock(HelloWorldService.class);\n\n Retry retry = Retry.of(\"metrics\", RetryConfig.<String>custom()\n .retryExceptions(Exception.class)\n .maxAttempts(5)\n .failAfterMaxAttempts(true)\n .build());\n\n willThrow(new HelloWorldException()).given(helloWorldService).returnHelloWorldWithException();\n\n Callable<String> retryableCallable = Retry.decorateCallable(retry, helloWorldService::returnHelloWorldWithException);\n\n Try<Void> run = Try.run(retryableCallable::call);\n\n assertThat(retry.getMetrics().getNumberOfTotalCalls()).isEqualTo(5);\n assertThat(run.isFailure()).isTrue();\n }", "public boolean isFailure() {\n return _type == Type.FAILURE;\n }", "public int getRequestRetryCount() {\n \t\treturn 1;\n \t}", "@Test\n public void testDoNotRetryInFlightWork() throws Exception {\n CountDownLatch oneWorkerCreated = factory.getRunCountLatch(1);\n CountDownLatch twoWorkersCreated = factory.getRunCountLatch(2);\n LogFile logFile = tracker.open(\"foo\", \"/biz/baz/%s.log\", DateTime.now());\n manager.start(); //start manager first so it can register to receive notifications\n tracker.written(logFile);\n awaitLatch(oneWorkerCreated); //wait initial worker\n //sigh. This is a slow test because we have to wait for the retry job to get not get scheduled.\n if (twoWorkersCreated.await(2 * RETRY_INTERVAL_SECONDS, TimeUnit.SECONDS)) {\n fail(\"Retry was scheduled for in-flight task!\");\n }\n }", "@Test\n public void testDelay() {\n long future = System.currentTimeMillis() + (rc.getRetryDelay() * 1000L);\n\n rc.delay();\n\n assertTrue(System.currentTimeMillis() >= future);\n }", "public boolean isIgnoreFailed()\n {\n return ignoreFailed;\n }", "public void retryRequired(){\n startFetching(query);\n }", "public boolean isReloadIfFailed() {\r\n\t\treturn mReloadIfFailed;\r\n\t}", "boolean processFailure(Throwable t);" ]
[ "0.7891941", "0.7755065", "0.775157", "0.75943995", "0.7544611", "0.7480066", "0.7166326", "0.7145832", "0.711136", "0.70976824", "0.7088022", "0.7073258", "0.69968355", "0.69838446", "0.6983276", "0.697466", "0.6925689", "0.6853585", "0.6783087", "0.67715406", "0.6661191", "0.6611681", "0.6540535", "0.64511293", "0.64141726", "0.63609046", "0.62853", "0.6283301", "0.6189954", "0.61645174", "0.6163517", "0.61629254", "0.6147492", "0.6145394", "0.61114585", "0.61105394", "0.6107568", "0.61013097", "0.6092365", "0.60903955", "0.60839045", "0.6075501", "0.60700136", "0.6062576", "0.6052903", "0.6043073", "0.6042832", "0.60371304", "0.6036423", "0.6036423", "0.6036423", "0.5994971", "0.5993085", "0.59860224", "0.5978836", "0.5978347", "0.5978347", "0.5978347", "0.59731305", "0.5945922", "0.5945922", "0.5945922", "0.5945922", "0.5945922", "0.5945922", "0.5945922", "0.5945922", "0.5945922", "0.5938481", "0.59281886", "0.5907326", "0.58926046", "0.58910054", "0.589039", "0.5884035", "0.58818287", "0.5880388", "0.58524203", "0.58501977", "0.58498216", "0.5838423", "0.5837632", "0.58329505", "0.5828042", "0.5813198", "0.5801685", "0.5791406", "0.5756805", "0.5745696", "0.5718986", "0.5715585", "0.57106644", "0.56984615", "0.56976867", "0.5687953", "0.56874967", "0.5682477", "0.5677332", "0.567489", "0.566338" ]
0.8073241
0
Get any errors. Not null if hasFailed() is true.
public Exception getException () { return exception_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Exception> getErrors() {\n\t\treturn null;\n\t}", "public List<ErrorResult> getErrorResults()\n {\n \tif(this.errorResults == null) {\n \t\tthis.errorResults = new ArrayList<ErrorResult>();\n \t}\n return errorResults;\n }", "public List<QueryError> getErrors() {\n return errors;\n }", "public int getErrors() {\n return errors;\n }", "public JUnitError[] getErrors() {\n return _errors;\n }", "public noNamespace.ErrordetectiondashletDocument.Errordetectiondashlet.Errors getErrors()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n noNamespace.ErrordetectiondashletDocument.Errordetectiondashlet.Errors target = null;\r\n target = (noNamespace.ErrordetectiondashletDocument.Errordetectiondashlet.Errors)get_store().find_element_user(ERRORS$4, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target;\r\n }\r\n }", "public int getErrors() {\n return errors;\n }", "public List<String> takeErrors() {\n final List<String> result = new ArrayList<String>(errors);\n errors.clear();\n return result;\n }", "public List<String> getErrors()\n {\n return _errors;\n }", "public int getErrorCount() {\n return error_.size();\n }", "public final Map<String, Exception> getErrors() {\n\n\t\treturn this.errors;\n\t}", "public Collection<GmlExceptionReport> getErrors()\r\n {\r\n return myErrorHandler.getExceptionReports();\r\n }", "public Queue<Throwable> getOrCreateErrors() {\n Queue<Throwable> q = this.errors;\n if (q != null) {\n return q;\n }\n ConcurrentLinkedQueue concurrentLinkedQueue = new ConcurrentLinkedQueue();\n if (ERRORS.compareAndSet(this, null, concurrentLinkedQueue)) {\n return concurrentLinkedQueue;\n }\n return this.errors;\n }", "public ValidationErrors getErrors() {\n if (errors == null) errors = new ValidationErrors();\n return errors;\n }", "public java.util.List<WorldUps.UErr> getErrorList() {\n if (errorBuilder_ == null) {\n return java.util.Collections.unmodifiableList(error_);\n } else {\n return errorBuilder_.getMessageList();\n }\n }", "public List<String> getErrors ()\n\t{\n\t\treturn errors;\n\t}", "public boolean hasErrors() {\n return hasErrors;\n }", "public List<ApiError> getErrors() {\n return errors;\n }", "public ArrayList<ArmazenaErroOuAvisoAntigo> getErrados() {\r\n\r\n\t\treturn this.errados;\r\n\r\n\t}", "boolean hadErrors();", "public Vector getErrors() {\n \t\tif (parser.hasErrors()) {\n \t\t\tsetError(parser.getErrors());\n \t\t}\n \t\tVector tmp = errors;\n \t\terrors = new Vector();\n \t\treturn tmp;\n \t}", "public List<Throwable> getErrors() {\n\t\tfinal List<Throwable> retval = new ArrayList<Throwable>();\n\t\tfor (final TestInfo testInfo : contractTestMap.listTestInfo()) {\n\t\t\tretval.addAll(testInfo.getErrors());\n\t\t}\n\t\treturn retval;\n\t}", "public int getErrorCount() {\n\t\treturn errors.size();\n\t}", "Set<ISOAError> getErrors();", "public java.util.List<WorldUps.UErr> getErrorList() {\n return error_;\n }", "public List<String> getErrors() {\n\t\treturn errors;\n\t}", "@Override\r\n\tpublic boolean hasErrors() {\n\t\treturn hasErrors;\r\n\t}", "public static ArrayList<String> getErrorMap() {\n if (errList.isEmpty()) {\n return null;\n } else {\n return errList;\n }\n }", "@Nullable public Throwable error() {\n return err;\n }", "public boolean hasErrors();", "public boolean errorsFound() {\n return _errors.size() > 0;\n }", "public boolean errorsFound() {\n return errorList.size() > 0;\n }", "public boolean hasErrors() {\n return !errors.isEmpty();\n }", "java.util.List<WorldUps.UErr> \n getErrorList();", "@Override\n\tpublic HashMap<String, String> getErrors() {\n\t\treturn errors;\n\t}", "public List<Diagnostic<? extends JavaFileObject>> getErrors() {\n List<Diagnostic<? extends JavaFileObject>> err;\n err = new ArrayList<Diagnostic<? extends JavaFileObject>>();\n for (Diagnostic<? extends JavaFileObject> diagnostic : errors) {\n if (diagnostic.getKind() == Diagnostic.Kind.ERROR) {\n err.add(diagnostic);\n }\n }\n return err;\n }", "public CErrors getErrors() {\n\t\treturn this.mErrors;\n\t}", "public CErrors getErrors() {\n\t\treturn mErrors;\n\t}", "public Long getErrorCount() {\n return this.errorCount;\n }", "public String getErrorStrings() {\n return this.errorStrings;\n }", "String[] getError() {\n return error;\n }", "public List<String> getListOfErrors() {\n return listOfErrors;\n }", "public boolean hasError()\n {\n return data().containsKey(_ERROR);\n }", "public int getErrorCount() {\n if (errorBuilder_ == null) {\n return error_.size();\n } else {\n return errorBuilder_.getCount();\n }\n }", "public int getErrorCount() {\n return this._errorCount;\n }", "public boolean hasFailed(){\n\t\treturn failures;\n\t}", "public boolean hasError()\n {\n return hasError;\n }", "public int getNumberOfErrors() {\n return errors;\n }", "public java.util.List<? extends WorldUps.UErrOrBuilder> \n getErrorOrBuilderList() {\n if (errorBuilder_ != null) {\n return errorBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(error_);\n }\n }", "public noNamespace.ErrordetectiondashletDocument.Errordetectiondashlet.Errors.Error[] getErrorArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n java.util.List targetList = new java.util.ArrayList();\r\n get_store().find_all_element_users(ERROR$0, targetList);\r\n noNamespace.ErrordetectiondashletDocument.Errordetectiondashlet.Errors.Error[] result = new noNamespace.ErrordetectiondashletDocument.Errordetectiondashlet.Errors.Error[targetList.size()];\r\n targetList.toArray(result);\r\n return result;\r\n }\r\n }", "public ErrorResponse getError()\n {\n return data().containsKey(_ERROR) ? new ErrorResponse(data().getDataMap(_ERROR)) : null;\n }", "public java.util.List<? extends WorldUps.UErrOrBuilder> \n getErrorOrBuilderList() {\n return error_;\n }", "public int errorCount() {\n\t\treturn errorCount;\n\t}", "public Map getError() {\n return this.error;\n }", "public RuntimeException getError() {\n if (errors.size() > 0) {\n return errors.get(0);\n }\n return null;\n }", "public Boolean hasErrors() {\n if ((this.hasErrors == null)) {\n this.hasErrors = Boolean.valueOf(this.hasIssuesOfSeverity(Severity.ERROR));\n }\n return this.hasErrors;\n }", "public Integer getErrorCnt() {\r\n return errorCnt;\r\n }", "public boolean getFailOnErr() {\n return mFailonerr;\n }", "boolean hasErrors();", "public Map<Object, Exception> getFailedMessages() {\n\t\treturn failedMessages;\n\t}", "public CErrors getErrors() {\n\treturn this.mErrors;\n}", "public final int getErrorCount()\n\t{\n\t\treturn errorCount_;\n\t}", "public List<ReportType> getErrors() {\n\t\treturn errorList;\n\t}", "public boolean hasError() {\n\t\treturn hasERR;\n\t}", "public int getErrorCount() {\r\n\t\treturn errorHandler.getErrorCount();\r\n\t}", "public boolean hasFailed() {\n\t\treturn failed;\n\t}", "public List fieldErrors() {\n\t\treturn errors;\n\t}", "@Override\n @Nullable\n public Exception getError() {\n return error;\n }", "public int getErrorCount()\r\n {\r\n \treturn errorCount;\r\n }", "Object getFailonerror();", "Object getFailonerror();", "public DataException getLastError() {\n return null;\n }", "public boolean isSetErrors() {\n return this.errors != null;\n }", "public Set<String> getFilmErrorMessage() {\n Set<String> errors = new HashSet<>();\n errors.addAll(errorMessage);\n return errors;\n }", "public boolean hasMoreErrors() {\n return false;\n }", "public ArrayList<WPPost> getRowsWithErrors() {return rowsWithErrors;}", "@XmlElement\n @Nullable\n public ExceptionBean getError() {\n return error;\n }", "public boolean hasErrors(){\n\t\treturn ! errorList.isEmpty();\n\t}", "public noNamespace.ErrorDocument.Error[] getErrorArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n java.util.List targetList = new java.util.ArrayList();\r\n get_store().find_all_element_users(ERROR$0, targetList);\r\n noNamespace.ErrorDocument.Error[] result = new noNamespace.ErrorDocument.Error[targetList.size()];\r\n targetList.toArray(result);\r\n return result;\r\n }\r\n }", "public int getErrorCount() {\r\n return root.getErrorCount();\r\n }", "Set<ExpectedErrorConfig> getExpectedErrors();", "public Collection<ErrorClass> getErrorCol() {\r\n\t\treturn values();\r\n\t}", "public List<String> getErrorMessages();", "public boolean isErrors() {\r\n return errors;\r\n }", "public boolean hasError() {\n\t\treturn results.getErrors().contains( \"ERROR\") ;\n\t}", "int getErrorCount();", "public boolean hasError();", "public PipelineJobError error() {\n return this.innerProperties() == null ? null : this.innerProperties().error();\n }", "public List<RepositoryValidationFailure> getFailures() {\n return failures;\n }", "public int getErrorcount() {\n return errorcount;\n }", "public List<ExcelImportException> getValidationErrors() {\n\t\treturn this.validationErrors;\n\t}", "public boolean hasErrorLog() {\n return result.hasErrorLog();\n }", "List<ExceptionAndTasks> getFailedTasksAndExceptions();", "public List<JobErrorItem> errorDetails() {\n return this.errorDetails;\n }", "public Long getReplayErrors() {\n\t\treturn replayErrors;\n\t}", "public List<DrillPBError> getErrorList() {\n synchronized(errorList) {\n return Collections.unmodifiableList(errorList);\n }\n }", "public static int getErrorTotal() {\n return errorCount;\n }", "public String getErrorsMessages()\n \t{\n \t\treturn errorsMessages;\n \t}", "public boolean containsErrors() {\n\t\treturn !errors.isEmpty();\n\t}", "public List<Failure<T>> getFailures() {\n return failures;\n }", "public String getErrorMsg() {\n return this.state == null ? null : this.state.msg;\n }" ]
[ "0.6926898", "0.67415875", "0.6461089", "0.6456702", "0.6447508", "0.6432412", "0.64152503", "0.63991576", "0.63926595", "0.635077", "0.6349876", "0.63295746", "0.6306296", "0.6262776", "0.6258858", "0.6242463", "0.62344754", "0.6228874", "0.6225439", "0.62233305", "0.6210395", "0.6210085", "0.6209844", "0.6195119", "0.6185023", "0.61610246", "0.611714", "0.6104885", "0.6094061", "0.6069974", "0.6067091", "0.6018796", "0.60029364", "0.5987547", "0.5986386", "0.59269", "0.59217674", "0.590966", "0.5909471", "0.5902555", "0.5889638", "0.5855045", "0.5851171", "0.585065", "0.5849776", "0.5840444", "0.58349663", "0.5832182", "0.58281815", "0.5824192", "0.5810423", "0.5789861", "0.5788984", "0.5786748", "0.57831126", "0.57804686", "0.57783765", "0.5760483", "0.5758493", "0.5755535", "0.5749227", "0.5743401", "0.57411015", "0.5738007", "0.5731865", "0.5716749", "0.5713442", "0.5709715", "0.57005155", "0.5699129", "0.5699129", "0.5694269", "0.5693849", "0.5692418", "0.5691642", "0.56861866", "0.56856483", "0.56824106", "0.56777894", "0.5656798", "0.564568", "0.5643535", "0.5634582", "0.5629136", "0.56207263", "0.5619279", "0.56143117", "0.5608682", "0.5608065", "0.55839247", "0.5580499", "0.55645686", "0.55497944", "0.5535522", "0.5530096", "0.5522438", "0.5519019", "0.5516333", "0.5508358", "0.55019975", "0.5480496" ]
0.0
-1
Get the response. OK if hasFailed() returns false.
public Object getResponse () { return response_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public br.com.sergio.wallet.Response getResponse() {\n br.com.sergio.wallet.Response result = br.com.sergio.wallet.Response.valueOf(response_);\n return result == null ? br.com.sergio.wallet.Response.UNRECOGNIZED : result;\n }", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "public br.com.sergio.wallet.Response getResponse() {\n br.com.sergio.wallet.Response result = br.com.sergio.wallet.Response.valueOf(response_);\n return result == null ? br.com.sergio.wallet.Response.UNRECOGNIZED : result;\n }", "public boolean getResponseStatus();", "private String tryGetResponse(Request request) throws IOException {\n long startTime = System.currentTimeMillis();\n Response response;\n String responseBody;\n do {\n response = client.newCall(request).execute();\n responseBody = response.body().string();\n System.out.println(\"Got response code \" + response.code());\n } while (response.code() != 200\n && System.currentTimeMillis() - startTime < TimeUnit.SECONDS.toMillis(30));\n\n assertEquals(\n 200, response.code(), \"Unexpected response code. Got this response: \" + responseBody);\n return responseBody;\n }", "public int getResponse() {return response;}", "boolean hasResponseMessage();", "java.lang.String getResponse();", "public com.github.yeriomin.playstoreapi.ResponseWrapper getResponse() {\n if (responseBuilder_ == null) {\n return response_;\n } else {\n return responseBuilder_.getMessage();\n }\n }", "public boolean wasOkay();", "public int getResponse() {\r\n return response;\r\n }", "String getResponse(String state, String message, Throwable throwable);", "public com.czht.face.recognition.Czhtdev.Response getResponse() {\n if (responseBuilder_ == null) {\n return response_ == null ? com.czht.face.recognition.Czhtdev.Response.getDefaultInstance() : response_;\n } else {\n return responseBuilder_.getMessage();\n }\n }", "@SuppressWarnings(\"unchecked\")\n private boolean checkResponse (HttpResponse<?> pResponse) {\n boolean result = false;\n if (pResponse != null\n && pResponse.getStatus() == 200\n && pResponse.getBody() != null) {\n HttpResponse<String> response = (HttpResponse<String>)pResponse;\n JSONObject body = new JSONObject(response.getBody());\n if (body.has(\"result\")) {\n result = Boolean.TRUE.equals(body.getBoolean(\"success\"));\n }\n }\n return result;\n }", "boolean getIsOk();", "String getResponse();", "public int getResponseStatus() {\n return responseStatus;\n }", "private String getResponse(){\n\t\tString msg;\n\t\tsynchronized (this){\n\t\t\twhile(!validResponse) {\n\t\t\t\ttry {\n\t\t\t\t\twait();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmsg = response;\n\t\t\tvalidResponse = false;\n\t\t\tnotifyAll();\n\t\t}\n\t\treturn msg;\n\t}", "public boolean hasResponse() {\n return instance.hasResponse();\n }", "public boolean hasResponse() {\n return instance.hasResponse();\n }", "public boolean hasResponse() {\n return instance.hasResponse();\n }", "public boolean hasResponse() {\n return instance.hasResponse();\n }", "@Override\n\tpublic BaseResponse testResponse() {\n\t\treturn setResultSuccess();\n\t}", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public com.google.search.now.wire.feed.ResponseProto.Response getResponse() {\n return response_ == null ? com.google.search.now.wire.feed.ResponseProto.Response.getDefaultInstance() : response_;\n }", "public com.google.search.now.wire.feed.ResponseProto.Response getResponse() {\n return response_ == null ? com.google.search.now.wire.feed.ResponseProto.Response.getDefaultInstance() : response_;\n }", "public com.example.products.ResponseMessage getResponse() {\n return response_ == null ? com.example.products.ResponseMessage.getDefaultInstance() : response_;\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "public ClientResponse getResponse() {\n return r;\n }", "public String getResponse() {\n Object ref = response_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n response_ = s;\n }\n return s;\n }\n }", "public net.iGap.proto.ProtoResponse.Response getResponse() {\n return response_ == null ? net.iGap.proto.ProtoResponse.Response.getDefaultInstance() : response_;\n }", "public net.iGap.proto.ProtoResponse.Response getResponse() {\n return response_ == null ? net.iGap.proto.ProtoResponse.Response.getDefaultInstance() : response_;\n }", "boolean hasIsSuccess();", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public String getResponse()\r\n {\r\n return this.response;\r\n }", "@java.lang.Override\n public boolean getIsOk() {\n return isOk_;\n }", "com.google.protobuf.ByteString\n getResponseBytes();", "public synchronized int getResponseCode() throws IOException {\n //avoid dup validateConnection\n if ((replyHeaders.responseCode == -1)\n || (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE)) {\n validateConnection();\n }\n\n return replyHeaders.responseCode;\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "@Nullable\n public abstract T response();", "public boolean isSuccessful() {\n return responseCode >= 200 && responseCode < 300;\n }", "@java.lang.Override\n public boolean getIsOk() {\n return isOk_;\n }", "com.google.protobuf.ByteString\n getResponseBytes();", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "net.iGap.proto.ProtoResponse.Response getResponse();", "net.iGap.proto.ProtoResponse.Response getResponse();", "public String getResponse() {\n return response;\n }", "public String getResponse() {\n return response;\n }", "public String getResponse() {\n return response;\n }", "public String getResponse() {\n return response;\n }", "public String getResponse() {\n return response;\n }", "public T getResponse() {\n return response;\n }", "public boolean isHttpOK(){\n return getStatusCode() == HttpURLConnection.HTTP_OK;\n }", "protected boolean isSuccessful(Response response) {\n if (response == null) {\n return false;\n }\n //System.out.println(\" Get Status is \" + response.getStatus());\n return response.getStatus() == 200;\n }", "public com.google.search.now.wire.feed.ResponseProto.Response getResponse() {\n return instance.getResponse();\n }", "public com.google.search.now.wire.feed.ResponseProto.Response getResponse() {\n return instance.getResponse();\n }", "public abstract String getResponse();", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "int getStatusCode();", "int getStatusCode();", "public boolean hasResponse() {\n return response_ != null;\n }", "int getStatusCode( );", "@NonNull\n public Response<T> awaitSuccessfulResponse() {\n Response<T> response = awaitResponse();\n if (response == null) {\n if (failureContainer.get() != null) {\n throw new RuntimeException(\"Unexpected failure. \" + failureContainer.get(), failureContainer.get().getCause());\n }\n throw new RuntimeException(\"Null response.\");\n } else if (response.hasErrors()) {\n throw new RuntimeException(\"Response has errors: \" + response.errors());\n } else if (response.data() == null) {\n if (failureContainer.get() != null) {\n throw new RuntimeException(\"Unexpected failure. \" + failureContainer.get(), failureContainer.get().getCause());\n }\n throw new RuntimeException(\"Null response data.\");\n }\n return response;\n }", "public net.iGap.proto.ProtoResponse.Response getResponse() {\n return instance.getResponse();\n }", "public net.iGap.proto.ProtoResponse.Response getResponse() {\n return instance.getResponse();\n }", "public String getResponse() {\n Object ref = response_;\n if (!(ref instanceof String)) {\n String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n response_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public KafkaResponseParam getResponse() {\n if (responseBuilder_ == null) {\n return response_;\n } else {\n return responseBuilder_.getMessage();\n }\n }", "public Integer getIsSuccess() {\n return isSuccess;\n }", "private boolean isSuccessful(SocketMessage response) {\r\n if (\"success\".equals(response.getValue(\"status\"))) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public int getResponseCode() {\n return responseCode;\n }", "public int getResponseCode() {\n return responseCode;\n }", "public int getResponseCode() {\n return responseCode;\n }", "static boolean checkOk(String response) {\n\t\tMatcher m = PAT_ES_SUCCESS.matcher(response);\n\t\tif (m.find()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "boolean getSuccess();", "boolean getSuccess();", "boolean getSuccess();", "boolean getSuccess();", "public com.example.products.ResponseMessage getResponse() {\n if (responseBuilder_ == null) {\n return response_ == null ? com.example.products.ResponseMessage.getDefaultInstance() : response_;\n } else {\n return responseBuilder_.getMessage();\n }\n }", "public String getResponseStatus()\r\n\t{\r\n\t\treturn responseStatus;\r\n\t}", "public boolean hasResponse() {\n return response_ != null;\n }", "public boolean hasResponse() {\n return response_ != null;\n }", "public boolean hasResponse() {\n return response_ != null;\n }", "public int getResponseCode()\r\n {\r\n return this.responseCode;\r\n }", "protected abstract boolean isExpectedResponseCode(int httpStatus);", "public synchronized boolean poll_response(){\n return gotResponse;\n }", "boolean hasGenericResponse();", "public String getResponseMessage();", "public boolean validateReponse(Response response, int id,int which)\n {\n return response.isSuccessful();\n }" ]
[ "0.65462244", "0.64685124", "0.64685124", "0.64685124", "0.64685124", "0.64685124", "0.64685124", "0.64685124", "0.64685124", "0.64685124", "0.64556724", "0.63884383", "0.6374096", "0.620016", "0.6184445", "0.6174047", "0.61561215", "0.60324234", "0.5978566", "0.59542656", "0.5950657", "0.595035", "0.5948261", "0.5931989", "0.5909448", "0.58957094", "0.5893612", "0.5893612", "0.5893612", "0.5893612", "0.5891108", "0.5857956", "0.58571076", "0.5855612", "0.5855612", "0.5842554", "0.58076155", "0.58076155", "0.58076155", "0.57939917", "0.5782895", "0.5776836", "0.5773291", "0.5773291", "0.5772632", "0.5771314", "0.5760612", "0.5759958", "0.57554173", "0.5750255", "0.57445943", "0.5743094", "0.57276225", "0.5720968", "0.57145953", "0.57128966", "0.5712226", "0.5712226", "0.5709037", "0.5709037", "0.5709037", "0.5709037", "0.5709037", "0.5708545", "0.57040846", "0.5682909", "0.5667008", "0.5667008", "0.5665871", "0.56567943", "0.56558996", "0.56558996", "0.5653054", "0.5652188", "0.56490123", "0.56456256", "0.56456256", "0.5635724", "0.56345403", "0.5632185", "0.56306916", "0.56213766", "0.56213766", "0.56213766", "0.56196797", "0.5619346", "0.5619346", "0.5619346", "0.5619346", "0.5610981", "0.56074506", "0.559553", "0.559553", "0.559553", "0.5589858", "0.5586832", "0.557557", "0.5574677", "0.556855", "0.5566634" ]
0.58507067
35
Get the participant who replied this.
public Participant getParticipant () { return participant_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public VitalParticipant getParticipant() {\n\t\treturn this.getAssignmentResponse().getParticipant();\n }", "java.lang.String getParticipant();", "public Integer getParticipant() {\n return participant;\n }", "public String getParticipantId() {\r\n\t\treturn participantId;\r\n\t}", "public int getParticipantId() {\r\n\t\treturn participantId;\r\n\t}", "public final Player getRecipient() {\n return recipient;\n }", "Participant getOwner();", "public String getParticipantInfo() {\n\t\treturn String.format(\"%s (%s) from %s\", getParticipantName(), this.emailAddress,\n\t\t\tthis.company);\n\t}", "public String getParticipantName() {\n\t\treturn String.format(\"%s %s\", this.firstName,\n\t\t\tthis.lastName);\n\t}", "String getResponsible();", "public String getReplier(int messageID){\n Message message = allmessage.get(messageID);\n return message.getReplyer();\n }", "public Object answer() {\n return getParticipantXMLString();\n }", "protected String getRecipient() {\n return parameterService.getParameterValueAsString(AwardDocument.class,\n Constants.REPORT_TRACKING_NOTIFICATIONS_BATCH_RECIPIENT);\n }", "public tudresden.ocl20.core.jmi.uml15.core.Classifier getParticipant()\n {\n \tModelFacade instance = ModelFacade.getInstance(this.refOutermostPackage().refMofId());\n \tif (instance != null && \n \t\tinstance.isRepresentative(this.refMofId())&&\n \t\tinstance.hasRefObject(this.refMofId()))\n \t{ \t\t\n \t\treturn instance.getParticipant(this.refMofId());\n \t} \n \t\n\t\treturn super_getParticipant();\t\n }", "public PeerID getPreviousSender() {\n\t\treturn previousSender;\n\t}", "public Object getRecipient() {\n\t\treturn this.recipient;\n\t}", "public java.lang.String getRecipient() {\n return recipient;\n }", "public Contact findParticipantForNickName(String nickName)\n {\n return participants.get(nickName);\n }", "com.google.protobuf.ByteString getParticipantBytes();", "public final Player getSender() {\n return sender;\n }", "public String getResponsible() {\n\t\treturn this.responsible;\n\t}", "ParticipantId getId();", "public String getPoster() {\n return getElement().getPoster();\n }", "public String getParticipantContactName() {\r\n\t\treturn participantContactName;\r\n\t}", "public ReceiverIdentifier getRecipient() {\n\n // Get the recipient of the missive document\n return this.missiveHeader.getRcv();\n }", "public String getRecipient()\n {\n return recipient;\n }", "java.lang.String getSender();", "java.lang.String getSender();", "java.lang.String getSender();", "java.lang.String getSender();", "java.lang.String getSender();", "java.lang.String getSender();", "public String getReviewer() {\n return reviewer;\n }", "public String getRecipient() {\n\t\treturn recipient;\n\t}", "public String getSender ()\r\n\t{\r\n\t\treturn sender;\r\n\t}", "public java.lang.String getStudent_whoIntroduce() {\n\t\treturn _primarySchoolStudent.getStudent_whoIntroduce();\n\t}", "@Override\n\tpublic Person findSelf() {\n\t\tString pName= ctx.getCallerPrincipal().getName();\n\t\tPerson p=userEJB.findPerson(pName);\n\t\treturn p;\n\t}", "@Override\n\tpublic String getWinkel(){\n\t\tString pName= ctx.getCallerPrincipal().getName();\n\t\tPerson p=userEJB.findPerson(pName);\n\t\tString w=p.getWinkel();\n\t\treturn w;\n\t}", "@Override\n\tpublic java.lang.String getPersonalEmail() {\n\t\treturn _candidate.getPersonalEmail();\n\t}", "public XCN getResponsiblePhysicianID() { \r\n\t\tXCN retVal = this.getTypedField(30, 0);\r\n\t\treturn retVal;\r\n }", "String getSender();", "public IUser getAuthor() {\n\t\treturn message.getAuthor();\n\t}", "public String senderId() {\n return senderId;\n }", "java.lang.String getSenderId();", "public UserModel getUser() {\n return sender;\n }", "java.lang.String getSenderName();", "public long getReplyId() {\n\t\treturn this.replyId;\r\n\t}", "@Override\n\tpublic long getUserId() {\n\t\treturn _paper.getUserId();\n\t}", "public double getAssignee() {\n return assignee;\n }", "public String getSender() {\n\t\treturn senderId;\n\t}", "public String getSender() {\n return sender;\n }", "public Contributor getResponsibleParty() {\n\t\treturn null;\n\t\t// org.dom4j.Document xmlDoc = getXmlDoc();\n\t\t// return getContributor(...);\n\t}", "public java.lang.String getUserId() {\n return instance.getUserId();\n }", "public Recipient getRecipient() {\n return recipient;\n }", "public java.lang.String getSenderLastName() {\r\n return senderLastName;\r\n }", "public String getMyPeerName() throws Exception\n {\n Pdu pdu = this.channel.writeForReply(makePdu(\"get_my_peer\"), replyTimeout, \"recv_pids\");\n return pdu.getString(\"pid\");\n }", "public String getSender() {\n return Sender;\n }", "public String recipientId() {\n return recipientId;\n }", "public String getReplyTo() {\n return replyTo;\n }", "public Player getToPlayer()\n {\n // RETURN the CardMessage's toPlayer\n return this.toPlayer;\n }", "INotificationTraveller getSender();", "private String whoAmI()\n {\n StringBuffer sb = new StringBuffer();\n sb.append(Thread.currentThread().toString());\n sb.append(\"@\");\n sb.append(Integer.toHexString(hashCode()));\n return sb.toString();\n }", "public int getParticipantIdGain() {\r\n return pg;\r\n }", "public String getSender() {\n return msgSender;\n }", "public User getExaminer () {\n\t\treturn examiner;\n\t}", "public String getPlayerEmail () {\n\t\treturn this.playerEmail;\n\t}", "private static PluginMessageRecipient getThroughWhomSendMessage() {\n\t\treturn Remain.getOnlinePlayers().isEmpty() ? Bukkit.getServer() : Remain.getOnlinePlayers().iterator().next();\n\t}", "public String getSubject()\n {\n return chatSubject;\n }", "public String getReceiverUsername() {\n\t\treturn recieverUsername;\n\n\t}", "public Human getPerson() {\n\t\treturn this.person;\n\t}", "public String getSender() {\n return this.sender;\n }", "public Node getSender() {\n return sender;\n }", "public int getSenderId() {\n return messages.get(messages.size()-1).getNodeId();\n }", "public Player getInteractingPlayer() {\n\t\treturn interactWith;\n\t}", "public com.zzsong.netty.protobuff.two.ProtoData.Person getPerson() {\n if (personBuilder_ == null) {\n if (dataBodyCase_ == 2) {\n return (com.zzsong.netty.protobuff.two.ProtoData.Person) dataBody_;\n }\n return com.zzsong.netty.protobuff.two.ProtoData.Person.getDefaultInstance();\n } else {\n if (dataBodyCase_ == 2) {\n return personBuilder_.getMessage();\n }\n return com.zzsong.netty.protobuff.two.ProtoData.Person.getDefaultInstance();\n }\n }", "public int getSenderId() {\n return senderId;\n }", "public ServerPlayer whoWon() {\r\n\t\tif (winner(CROSS)) {\r\n\t\t\treturn getP1();\r\n\t\t} else if (winner(NOUGHT)) {\r\n\t\t\treturn getP2();\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public TriggerRecipient getRecipient () {\n return this.recipient;\n }", "public String getSender() {\n\t\treturn sender;\n\t}", "@Override\n\tpublic String getId() {\n\t\tString pName = ctx.getCallerPrincipal().getName();\n\t\tPerson p = userEJB.findPerson(pName);\n\t\tString id = p.getId()+\"\";\n\t\treturn id;\n\t\t\n\t}", "@Override\n\tpublic long getModifiedBy() {\n\t\treturn _candidate.getModifiedBy();\n\t}", "@Override\n\tpublic long getUserId() {\n\t\treturn _esfTournament.getUserId();\n\t}", "public String getNotificationMessage() {\n if (this.mInvitation != null) return this.mInvitation.getSenderUsername() + \" wants to be your buddy\";\n else if (this.mChatMessageFragment != null) return this.mChatMessageFragment.getMessage();\n else return null;\n }", "public com.zzsong.netty.protobuff.two.ProtoData.Person getPerson() {\n if (dataBodyCase_ == 2) {\n return (com.zzsong.netty.protobuff.two.ProtoData.Person) dataBody_;\n }\n return com.zzsong.netty.protobuff.two.ProtoData.Person.getDefaultInstance();\n }", "public String getTalkingTo() {\n return talkingTo;\n }", "private static Player getThroughWhomSendMessage() {\n\t\treturn Remain.getOnlinePlayers().isEmpty() ? null : Remain.getOnlinePlayers().iterator().next();\n\t}", "public int getEnteredBy() {\n return enteredBy;\n }", "public static Sender getSender() {\n return sender;\n }", "@Override\n\tpublic long getUserId() {\n\t\treturn _second.getUserId();\n\t}", "public String getProposedByMemberId() {\n return this.proposedByMemberId;\n }", "public User getUser(){\n return User.getUser(this.event.getAuthor());\n }", "public String getParticipantContactNumber() {\r\n\t\treturn participantContactNumber;\r\n\t}", "public java.lang.String getReviewerName() {\n return reviewerName;\n }", "@java.lang.Override\n public long getRecipientId() {\n return recipientId_;\n }", "public String submittedBy() {\n return this.submittedBy;\n }", "@Override\n public IPerson getPrincipal() {\n return this.person;\n }", "public People getUser() {\n return instance.getUser();\n }", "public String getAnswerBy() {\n return answerBy;\n }", "public Player getWinner() {\n if (winner == null) {\n winner = winnerStrategy.winner(this);\n }\n return winner;\n }", "public String getAttendeeUserId() {\n\t\treturn attendeeUserId;\n\t}" ]
[ "0.7073355", "0.67800677", "0.6516061", "0.63546085", "0.6300195", "0.62007415", "0.6170338", "0.603594", "0.6014673", "0.59159523", "0.5844882", "0.58255196", "0.5801393", "0.58013785", "0.5732254", "0.5705866", "0.5681438", "0.5668356", "0.56593156", "0.5650143", "0.5588311", "0.5576515", "0.55674183", "0.5561674", "0.5551014", "0.55226666", "0.55100256", "0.55100256", "0.55100256", "0.55100256", "0.55100256", "0.55100256", "0.5504906", "0.55035794", "0.54926205", "0.5476819", "0.5464215", "0.5457133", "0.5451645", "0.54498273", "0.5426825", "0.5416156", "0.5395165", "0.53889763", "0.5386509", "0.53834116", "0.5375653", "0.5361005", "0.5358044", "0.53547084", "0.53487366", "0.5341388", "0.53389096", "0.5336862", "0.5315565", "0.5315367", "0.5314459", "0.52970725", "0.5294042", "0.52912456", "0.5285131", "0.5284072", "0.5273318", "0.5271578", "0.5265901", "0.5261022", "0.5254172", "0.524984", "0.5247468", "0.5246094", "0.52436334", "0.5235465", "0.523365", "0.5223064", "0.5222263", "0.5215583", "0.5211493", "0.52066225", "0.52064395", "0.51885957", "0.5184137", "0.5176723", "0.5172547", "0.517181", "0.5166781", "0.51598597", "0.51503557", "0.51497805", "0.5146381", "0.51461315", "0.5144405", "0.51342136", "0.5132518", "0.51317436", "0.51304954", "0.5127133", "0.51232535", "0.5123074", "0.51192874", "0.5116248" ]
0.68118876
1
/Check for the arguments
@SuppressWarnings({ "deprecation" }) public int run(String[] args) throws IOException { if (args.length < 3 || args.length > 5) { System.err.println("Usage: HBaseStationImporter <file-system> <input> <table-name> <hdfs-master-url>"); System.err.println(args.length); return -1; } String fileSystem = args[0]; String inputPath = args[1]; String hbaseTable = args[2]; boolean isHdfsPath = args.length ==4? true:false ; String hdfsMaster = null; /*Check whether file system is null/empty */ if (fileSystem.length() == 0 || fileSystem == null){ System.err.println("File System cannot be null/empty"); return -1; }else if (fileSystem.equalsIgnoreCase("local") || fileSystem.equalsIgnoreCase("hdfs")){ System.out.println(fileSystem.toUpperCase() + " File system is supported"); }else{ System.err.println("Only Local/HDFS file system is supported"+fileSystem); return -1; } /*Check whether input path is null/empty */ if (inputPath.length() == 0 || inputPath == null){ System.err.println("Input Path cannot be null/empty"); return -1; } /*Check whether HTable name is null/empty */ if (hbaseTable.length() == 0 || hbaseTable == null){ System.err.println("HTable name cannot be null/empty"); return -1; } /*If file is being read from HDFS check whether HDFS Master URL name is null/empty */ if (isHdfsPath){ if(args[3].length() !=0 && args[3] != null){ hdfsMaster = args[3]; }else{ System.err.println("HDFS Master URL cannot be null/empty"); return -1; } } /*System.out.println(args[0]+args[1]+args[2]+isHdfsPath+hdfsMaster); System.exit(1);*/ Configuration config = HBaseConfiguration.create(); Connection connection = ConnectionFactory.createConnection(config); try { /*Get an object for the table we created*/ TableName tableName = TableName.valueOf(hbaseTable); Table table = connection.getTable(tableName); try { NcdcStationMetadata metadata = new NcdcStationMetadata(); metadata.initialize(inputPath, isHdfsPath, hdfsMaster); Map<String, String> stationIdToNameMap = metadata.getStationIdToNameMap(); for (Map.Entry<String, String> entry : stationIdToNameMap.entrySet()) { Put put = new Put(Bytes.toBytes(entry.getKey())); put.add(HBaseStationQuery.INFO_COLUMNFAMILY, HBaseStationQuery.NAME_QUALIFIER, Bytes.toBytes(entry.getValue())); put.add(HBaseStationQuery.INFO_COLUMNFAMILY, HBaseStationQuery.DESCRIPTION_QUALIFIER, Bytes.toBytes("(unknown)")); put.add(HBaseStationQuery.INFO_COLUMNFAMILY, HBaseStationQuery.LOCATION_QUALIFIER, Bytes.toBytes("(unknown)")); table.put(put); } } finally { table.close(); } } finally { connection.close(); } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void argumentChecker(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tif (args.length != 2) {\n\t\t\tSystem.out.println(\"Invalid arguments. \\nExpected:\\tDriver inputFile.txt outputFile.txt\");\n\t\t}\n\t}", "static Boolean verifyArguments(String[] args)\n {\n if (args.length < 2)\n {\n return false;\n }\n \n return true;\n }", "private static void checkPassedInArguments(String[] args, EquationManipulator manipulator) {\n // Convert arguments to a String\n StringBuilder builder = new StringBuilder();\n for (String argument: args) {\n builder.append(argument + \" \");\n }\n \n // check if equation is valid\n String[] equation = manipulator.getEquation(builder.toString());\n if (equation.length == 0) {\n // unable to parse passed in arguments\n printErrorMessage();\n handleUserInput(manipulator);\n } else {\n // arguments were passed in correctly\n System.out.println(\"Wohoo! It looks like everything was passed in correctly!\"\n + \"\\nYour equation is: \" + builder.toString() + \"\\n\");\n handleArguments(equation, manipulator);\n }\n }", "private static void verifyArgs()\r\n\t{\r\n\t\tif(goFile == null)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"Error: you must specify an input GO file.\");\r\n\t\t\texitError();\r\n\t\t}\r\n\t\tif(annotFile == null)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"Error: you must specify an input annotation file.\");\r\n\t\t\texitError();\r\n\t\t}\r\n\t\tif(goSlimFile == null)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"Error: you must specify an input GOslim file.\");\r\n\t\t\texitError();\r\n\t\t}\r\n\t\tif(slimAnnotFile == null)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"Error: you must specify an output file.\");\r\n\t\t\texitError();\r\n\t\t}\r\n\t}", "abstract public boolean argsNotFull();", "private void checkMandatoryArguments() throws ArgBoxException {\n\t\tfinal List<String> errors = registeredArguments.stream()\n\t\t\t\t.filter(arg -> arg.isMandatory())\n\t\t\t\t.filter(arg -> !parsedArguments.containsKey(arg))\n\t\t\t\t.map(arg -> String.format(\"The argument %1s is required !\", arg.getLongCall()))\n\t\t\t\t.collect(Collectors.toList());\n\t\tthrowException(() -> !errors.isEmpty(), getArgBoxExceptionSupplier(\"Some arguments are missing !\", errors));\n\t}", "@Override\n public void verifyArgs(ArrayList<String> args) throws ArgumentFormatException {\n super.checkNumArgs(args);\n _args = true;\n }", "public void checkParameters() {\n }", "private boolean validateArguments() {\n return !isEmpty(getWsConfig()) && !isEmpty(getVirtualServer()) && !isEmpty(getVirtualServer()) && !isEmpty(getAppContext()) && !isEmpty(getWarFile()) && !isEmpty(getUser()) && !isEmpty(getPwdLocation());\n }", "private static void validateInputArguments(String args[]) {\n\n\t\tif (args == null || args.length != 2) {\n\t\t\tthrow new InvalidParameterException(\"invalid Parameters\");\n\t\t}\n\n\t\tString dfaFileName = args[DFA_FILE_ARGS_INDEX];\n\t\tif (dfaFileName == null || dfaFileName.trim().isEmpty()) {\n\t\t\tthrow new InvalidParameterException(\"Invalid file name\");\n\t\t}\n\n\t\tString delimiter = args[DELIMITER_SYMBOL_ARGS_INDEX];\n\t\tif (delimiter == null || delimiter.trim().isEmpty()) {\n\t\t\tthrow new InvalidParameterException(\"Invalid delimiter symbol\");\n\t\t}\n\t}", "private static void checkNumOfArguments(String[] args) throws IllegalArgumentException{\n\t\ttry{\n\t\t\tif(args.length != App.numberOfExpectedArguments ) {\t\n\t\t\t\tthrow new IllegalArgumentException(\"Expected \" + App.numberOfExpectedArguments + \" arguments but received \" + args.length);\n\t\t\t}\n }\n\t\tcatch(Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t\texitArgumentError();\n\t\t}\n\t\t\n\t}", "private void validateInputParameters(){\n\n }", "private void checkArgTypes() {\n Parameter[] methodParams = method.getParameters();\n if(methodParams.length != arguments.length + 1) {\n throw new InvalidCommandException(\"Incorrect number of arguments on command method. Commands must have 1 argument for the sender and one argument per annotated argument\");\n }\n\n Class<?> firstParamType = methodParams[0].getType();\n\n boolean isFirstArgValid = true;\n if(requiresPlayer) {\n if(firstParamType.isAssignableFrom(IPlayerData.class)) {\n usePlayerData = true; // Command methods annotated with a player requirement can also use IPlayerData as their first argument\n } else if(!firstParamType.isAssignableFrom(Player.class)) {\n isFirstArgValid = false; // Otherwise, set it to invalid if we can't assign it from a player\n }\n } else if(!firstParamType.isAssignableFrom(CommandSender.class)) { // Non player requirement annotated commands must just take a CommandSender\n isFirstArgValid = false;\n }\n\n if(!isFirstArgValid) {\n throw new InvalidCommandException(\"The first argument for a command must be a CommandSender. (or a Player/IPlayerData if annotated with a player requirement)\");\n }\n }", "public abstract ValidationResults validArguments(String[] arguments);", "@Test\r\n public void testCheckInput() throws Exception {\r\n System.out.println(\"checkInput\");\r\n System.out.println(\"test1\");\r\n String[] arguments = {\"1k2h3u\",\"test.txt\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\"};\r\n CommandLineArgumentParser instance =new CommandLineArgumentParser(arguments);\r\n String expResult = \"correct\";\r\n String result = instance.checkInput(arguments);\r\n assertEquals(expResult, result);\r\n \r\n System.out.println(\"test 2\");\r\n String[] arguments2 = {\"1k\",\"test.txt\",\"1\"};\r\n String expResult2 = \"correct\";\r\n String result2 = instance.checkInput(arguments2);\r\n assertEquals(expResult2, result2);\r\n \r\n System.out.println(\"test 3\");\r\n String[] arguments3 = {\"chat.txt\"};\r\n String expResult3 = \"correct\";\r\n String result3 = instance.checkInput(arguments3);\r\n assertEquals(expResult3, result3);\r\n \r\n System.out.println(\"test 4\");\r\n String[] arguments4 = {\"1k2h3u\",\"test.txt\",\"1\",\"2\",\"3\",\"4\",\"5\"};\r\n String expResult4 = \"Incorrect number of arguments\";\r\n String result4 = instance.checkInput(arguments4);\r\n assertEquals(expResult4, result4);\r\n \r\n System.out.println(\"test 5\");\r\n String[] arguments5 = {};\r\n String expResult5 = \"Need at least one argument with input file path\";\r\n String result5 = instance.checkInput(arguments5);\r\n assertEquals(expResult5, result5);\r\n }", "private static boolean argsAreValid(String[] args) {\n try {\n if (args.length != NUM_OF_ARGS) {\n System.err.println(TypeTwoErrorException.TYPE_II_GENERAL_MSG +\n BAD_COMMAND_LINE_ARGUMENTS);\n return false;\n }\n File sourceDirectory = new File(args[0]);\n File commandFile = new File(args[1]);\n if ((!sourceDirectory.isDirectory()) || (!commandFile.isFile())) {\n System.err.println(TypeTwoErrorException.TYPE_II_GENERAL_MSG +\n BAD_COMMAND_LINE_ARGUMENTS);\n return false;\n }\n } catch (Exception e) {\n System.err.println(TypeTwoErrorException.TYPE_II_GENERAL_MSG +\n UNKNOWN_ERROR_COMMAND_LINE_ARGUMENTS);\n return false;\n }\n return true;\n }", "public void testGetInputArguments() {\n List<String> args = mb.getInputArguments();\n assertNotNull(args);\n for (String string : args) {\n assertNotNull(string);\n assertTrue(string.length() > 0);\n }\n }", "private static void checkCmdArgs(int numberOfArgs, String[] args) {\n\t\tif (args.length != numberOfArgs) {\n\t\t\tSystem.out.println(\"Wrong number of command line arguments!\");\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t}", "private static void validateCommandLineArguments(AutomationContext context, String extendedCommandLineArgs[])\r\n\t{\r\n\t\t//fetch the argument configuration types required\r\n\t\tCollection<IPlugin<?, ?>> plugins = PluginManager.getInstance().getPlugins();\r\n \t\tList<Class<?>> argBeanTypes = plugins.stream()\r\n\t\t\t\t.map(config -> config.getArgumentBeanType())\r\n\t\t\t\t.filter(type -> (type != null))\r\n\t\t\t\t.collect(Collectors.toList());\r\n\t\t\r\n\t\targBeanTypes = new ArrayList<>(argBeanTypes);\r\n\t\t\r\n\t\t//Add basic arguments type, so that on error its properties are not skipped in error message\r\n\t\targBeanTypes.add(AutoxCliArguments.class);\r\n\r\n\t\t//if any type is required creation command line options and parse command line arguments\r\n\t\tCommandLineOptions commandLineOptions = OptionsFactory.buildCommandLineOptions(argBeanTypes.toArray(new Class<?>[0]));\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tcommandLineOptions.parseBeans(extendedCommandLineArgs);\r\n\t\t} catch(MissingArgumentException e)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"Error: \" + e.getMessage());\r\n\t\t\tSystem.err.println(commandLineOptions.fetchHelpInfo(COMMAND_SYNTAX));\r\n\t\t\tSystem.exit(-1);\r\n\t\t} catch(Exception ex)\r\n\t\t{\r\n\t\t\tex.printStackTrace();\r\n\t\t\tSystem.err.println(commandLineOptions.fetchHelpInfo(COMMAND_SYNTAX));\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "private void scanArgs(String [] args)\n{\n for (int i = 0; i < args.length; ++i) {\n if (args[i].startsWith(\"-\")) {\n\t badArgs();\n }\n else badArgs();\n }\n}", "public static boolean checkArgs(String[] args) {\n\t\tboolean valid = true;\n\t\t\n\t\tfor (int index = 0; valid && index < args.length; index++) {\n\t\t\tif (args[index].equals(\"-help\") || args[index].equals(\"--help\"))\n\t\t\t\tvalid = false;\n\n\t\t\t// All following arguments should have one value that follows each argument\n\t\t\tif (index+1 >= args.length || args[index+1] == null)\n\t\t\t\tvalid = false;\n\n\t\t\telse if (valid && args[index].equals(\"-dir\"))\n\t\t\t\targsMap.put(\"dir\", args[++index]);\n\t\t}\n\t\treturn valid;\n\t}", "public boolean hasValidArgs() {\r\n // if it has has zero argument, it is valid\r\n boolean zeroArgs = this.getCmd().getArguments().size() == 0;\r\n // return the boolean value\r\n return zeroArgs;\r\n }", "private void checkArguments(ArrayList<String> applicationArguments) throws JshException {\n if (applicationArguments.size() > 1) {\n throw new JshException(\"history: too many arguments\");\n }\n }", "private boolean checkingAllArguments() {\n\t\t\n\t\t// test if the four player types have been selected\n\t\tfor(int i=0;i<allButtons.size();i++) {\n\t\t\tif(allButtons.get(i)==null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// test if the seed is in the correct format\n\t\tif(!(seed.textProperty().get().isEmpty())){\n\t\t\ttry {\n\t\t\t\tgameSeed = Long.parseLong(seed.getText());\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\tmenuMessage.setText(\"Given seed is not a valid number\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t}\n\t\t\n\t\t// test if for each of the players the given arguments are correct\n\t\tfor(int i = 0; i < allButtons.size(); ++i) {\n\t\t\tchar playerType = allButtons.get(i).getText().charAt(0);\n\t\t\tString argument = texts.get(2 * i + 1).getText();\n\t\t\t\n\t\t\tif(!argument.isEmpty()) {\n\t\t\t\tswitch(playerType) {\n\t\t\t\t\n\t\t\t\tcase 'S' : \n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlong l = Long.parseLong(texts.get(2 * i + 1).getText());\n\t\t\t\t\t\tif(l < 9) {\n\t\t\t\t\t\t\tmenuMessage.setText(\"The iteration value must be at least 9\");\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\t\tmenuMessage.setText(\"One of the iteration number is not a valid number\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'R' :\n\t\t\t\t\t\n\t\t\t\t\tString[] parts = StringSerializer.split(\"\\\\.\", argument); \n\t\t\t\t\t\n\t\t\t\t\tif (parts.length != 4) { \n\t\t\t\t\t\tmenuMessage.setText(\"One of the IP Address is not a valid address\");\n\t\t\t\t\t\treturn false; \n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t\tfor (String str : parts) { \n\t\t\t\t\t\tint j = Integer.parseInt(str); \n\t\t\t\t\t\tif ((j < 0) || (j > 255)) { \n\t\t\t\t\t\t\tmenuMessage.setText(\"One of the IP Address is not a valid address\");\n\t\t\t\t\t\t\treturn false; \n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t\treturn true;\n\t}", "private void validateParameters() {\r\n if (command == null) {\r\n throw new BuildException(\r\n \"'command' parameter should not be null for coverity task.\");\r\n }\r\n\r\n }", "public void analyseArguments(String[] args) throws ArgumentsException {\n \t\t\n for (int i=0;i<args.length;i++){ \n \n \n if (args[i].matches(\"-s\")){\n affichage = true;\n }\n else if (args[i].matches(\"-seed\")) {\n aleatoireAvecGerme = true;\n i++; \n \t// traiter la valeur associee\n try { \n seed =new Integer(args[i]);\n \n }\n catch (Exception e) {\n throw new ArgumentsException(\"Valeur du parametre -seed invalide :\" + args[i]);\n } \t\t\n }\n \n else if (args[i].matches(\"-mess\")){\n i++; \n \t// traiter la valeur associee\n messageString = args[i];\n if (args[i].matches(\"[0,1]{7,}\")) {\n messageAleatoire = false;\n nbBitsMess = args[i].length();\n \n } \n else if (args[i].matches(\"[0-9]{1,6}\")) {\n messageAleatoire = true;\n nbBitsMess = new Integer(args[i]);\n if (nbBitsMess < 1) \n throw new ArgumentsException (\"Valeur du parametre -mess invalide : \" + nbBitsMess);\n }\n else \n throw new ArgumentsException(\"Valeur du parametre -mess invalide : \" + args[i]);\n }\n \n else throw new ArgumentsException(\"Option invalide :\"+ args[i]);\n \n }\n \n }", "@Override\n protected boolean hasValidNumberOfArguments(int numberOfParametersEntered) {\n return numberOfParametersEntered == 3;\n }", "public static boolean isValid(String args[]){\n \n if(args.length < 2){\n System.out.println(\"Not enough arguments detected. Please enter two\"\n + \" integer arguments.\");\n return false;\n }\n \n Scanner scanin = new Scanner(args[0]);\n Scanner scanin2 = new Scanner(args[1]);\n\t \n if(!scanin.hasNextInt() || !scanin2.hasNextInt()){\n System.out.println(\"Invalid argument type detected. Please enter two\"\n + \" integer arguments.\");\n return false;\n }\n\t else\n return true;\n }", "@Override\n public ValidationResults validArguments(String[] arguments) {\n final int MANDATORY_NUM_OF_ARGUMENTS = 1;\n if (arguments.length == MANDATORY_NUM_OF_ARGUMENTS) {\n // Check if CommandMAN was called on itself (Checker doesn't need to\n // validate CommandMAN twice).\n if (arguments[0].equals(this.getCommandName())) {\n this.toDocument = this; // man will document itself.\n } else {\n // Man will document this command object.\n try {\n this.toDocument = Checker.getCommand(arguments[0], true);\n } catch (Exception ex) {\n return new ValidationResults(false, \"No manual entry for \"\n + arguments[0]); // CMD does not exist.\n }\n }\n return new ValidationResults(true, null);\n }\n return new ValidationResults(false, \"Requires \"\n + MANDATORY_NUM_OF_ARGUMENTS + \" argument.\");\n }", "@Test\n public void testArguments() {\n System.out.println(\"arguments\");\n assertThat(Arguments.valueOf(\"d\"), is(notNullValue()));\n assertThat(Arguments.valueOf(\"i\"), is(notNullValue()));\n assertThat(Arguments.valueOf(\"num\"), is(notNullValue()));\n }", "private static boolean validOptionalArgs (String[] args){\n boolean validChar;\n // Iterate over args\n for (int i = 0; i < args.length; i++){\n if (args[i].charAt(0)!='-')\n \treturn false;\n // Iterate over characters (to read combined arguments)\n for (int charPos = 1; charPos < args[i].length(); charPos++){\n \tvalidChar = false;\n \tfor (int j = 0; j < VALID_OPTIONAL_ARGS.length; j++){\n\t if (args[i].charAt(charPos) == VALID_OPTIONAL_ARGS[j]){\n\t validChar = true;\n\t break;\n\t }\n \t}\n \tif (!validChar)\n \t\treturn false;\n \t}\n }\n return true;\n }", "private boolean isValidQuestionsArgument(ArrayList<String> argArray) {\n boolean isValid = true;\n if (argArray.size() != ADD_NOTE_ARGUMENTS) {\n TerminusLogger.warning(String.format(\"Failed to find %d arguments: %d arguments found\",\n ADD_NOTE_ARGUMENTS, argArray.size()));\n isValid = false;\n } else if (CommonUtils.hasEmptyString(argArray)) {\n TerminusLogger.warning(\"Failed to parse arguments: some arguments found is empty\");\n isValid = false;\n }\n return isValid;\n }", "@Override\n\tpublic void check(String arguments, Map<String, String> defValue, Set<String> errors) {\n\n\t}", "@Test(expectedExceptions=InvalidArgumentValueException.class)\n public void argumentValidationTest() {\n String[] commandLine = new String[] {\"--value\",\"521\"};\n\n parsingEngine.addArgumentSource( ValidatingArgProvider.class );\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n\n ValidatingArgProvider argProvider = new ValidatingArgProvider();\n parsingEngine.loadArgumentsIntoObject( argProvider );\n\n Assert.assertEquals(argProvider.value.intValue(), 521, \"Argument is not correctly initialized\");\n\n // Try some invalid arguments\n commandLine = new String[] {\"--value\",\"foo\"};\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n }", "protected static boolean ensureNumArgs( String param[], int n ) {\n\t\tif ( n >= 0 && param.length != n || n < 0 && param.length < -n ) {\n\t\t\tSystem.err.println( \"Wrong number (\" + param.length + \") of arguments.\" );\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private static boolean processArgs(String[] args){\n\n // Check to see if there are two files names that can be read\n if(args.length != 2){\n\n System.out.println(\"Please enter two file names:\" +\n \" Books, Transactions or Books1, Transaction1\");\n System.out.println(\"Or compatible files\");\n\n return false;\n\n // Check to see if the two files can be opened\n } else {\n for (int x = 0; x < 2; x++){\n // Make a file object to represent txt file to be read\n File inputFile = new File(args[x]);\n if (!inputFile.canRead()) {\n System.out.println(\"The file \" + args[x]\n + \" cannot be opened for input.\");\n return false;\n }\n }\n // At this point we know the files are readable\n return true;\n }\n }", "private static void checkArg(Object s) {\n if (s == null) {\n throw new NullPointerException(\"Argument must not be null\");\n }\n }", "private void checkMandatoryArgs(UserResource target, Errors errors) {\n final String proc = PACKAGE_NAME + \".checkMandatoryArgs.\";\n final String email = target.getEmail();\n final String password = target.getPassword();\n final String lastName = target.getLastName();\n\n logger.debug(\"Entering: \" + proc + \"10\");\n\n if (TestUtils.isEmptyOrWhitespace(email)) {\n errors.rejectValue(\"email\", \"user.email.required\");\n }\n logger.debug(proc + \"20\");\n\n if (TestUtils.isEmptyOrWhitespace(password)) {\n errors.rejectValue(\"password\", \"user.password.required\");\n }\n logger.debug(proc + \"30\");\n\n if (TestUtils.isEmptyOrWhitespace(lastName)) {\n errors.rejectValue(\"lastName\", \"userLastName.required\");\n }\n logger.debug(\"Leaving: \" + proc + \"40\");\n }", "@Override\n public void validateArgs(String[] args, ArgsValidation check) throws ArgsException\n {\n try\n {\n check.validateTwoArgs(args);\n }\n catch(ArgsException exception)\n {\n throw exception;\n }\n }", "@Test\n\tpublic void execute() throws Exception {\n\t\tassertTrue(argumentAnalyzer.getFlags().contains(Context.CHECK.getSyntax()));\n\t}", "public void checkNumberArgs(int argNum) throws WrongNumberArgsException {\n/* 79 */ if (argNum < 2) {\n/* 80 */ reportWrongNumberArgs();\n/* */ }\n/* */ }", "private static void handleArguments(String[] args) {\n\t\t\n\t\tif ( args.length > 0 && args[0].contains(\"--help\")) {\n\t\t\tSystem.err.println (menuString);\n\t\t\tSystem.err.println(\"Example queue name are: *\");\n\t\t\tSystem.exit(0);\n\t\t} else {\n\n\t\t\tint i = 0;\n\t\t\tString arg;\n\n\t\t\twhile (i < args.length && args[i].startsWith(\"--\")) {\n\t\t\t\targ = args[i++];\n\n\t\t\t\tif (arg.contains(ECS_HOSTS_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\tecsHosts = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_HOSTS_CONFIG_ARGUMENT + \" requires hosts value(s)\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.contains(ECS_MGMT_ACCESS_KEY_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\tecsMgmtAccessKey = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_MGMT_ACCESS_KEY_CONFIG_ARGUMENT + \" requires an access-key value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ECS_MGMT_SECRET_KEY_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\tecsMgmtSecretKey = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_MGMT_SECRET_KEY_CONFIG_ARGUMENT + \" requires a secret-key value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ECS_MGMT_PORT_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\tecsMgmtPort = Integer.valueOf(args[i++]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_MGMT_PORT_CONFIG_ARGUMENT + \" requires a mgmt port value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ECS_ALT_MGMT_PORT_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\tecsAlternativeMgmtPort = Integer.valueOf(args[i++]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_ALT_MGMT_PORT_CONFIG_ARGUMENT + \" requires an alternative mgmt port value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ECS_COLLECT_MODIFIED_OBJECT_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\trelativeObjectModifiedSinceOption = true;\n\t\t\t\t\t\tobjectModifiedSinceNoOfDays = Integer.valueOf(args[i++]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_COLLECT_MODIFIED_OBJECT_CONFIG_ARGUMENT + \" requires a specified number of days value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ECS_COLLECT_DATA_CONFIG_ARGUMENT)) {\n\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\tcollectData = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_COLLECT_DATA_CONFIG_ARGUMENT + \" requires a collect data value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.contains(ELASTIC_HOSTS_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\telasticHosts = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ELASTIC_HOSTS_CONFIG_ARGUMENT + \" requires hosts value(s)\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ELASTIC_PORT_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\telasticPort = Integer.valueOf(args[i++]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ELASTIC_PORT_CONFIG_ARGUMENT + \" requires a port value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ELASTIC_CLUSTER_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\telasticCluster = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println( ELASTIC_CLUSTER_CONFIG_ARGUMENT + \" requires a cluster value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ECS_COLLECTION_DAY_SHIFT_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\trelativeDayShift = Integer.valueOf(args[i++]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_COLLECTION_DAY_SHIFT_ARGUMENT + \" requires a day shift value port value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals( ECS_INIT_INDEXES_ONLY_CONFIG_ARGUMENT)) { \n\t\t\t\t\tinitIndexesOnlyOption = true;\n\t\t\t\t} else if (arg.equals( XPACK_SECURITY_USER_ARG)) { \n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\txpackUser = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println( XPACK_SECURITY_USER_ARG + \" requires a value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals( XPACK_SECURITY_USER_PASSWORD_ARG)) { \n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\txpackPassword = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println( XPACK_SECURITY_USER_PASSWORD_ARG + \" requires a value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals( XPACK_SSL_KEY_ARG)) { \n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\txpackSslKey = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println( XPACK_SSL_KEY_ARG + \" requires a value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals( XPACK_SSL_CERTIFICATE_ARG)) { \n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\txpackSslCertificate = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println( XPACK_SSL_CERTIFICATE_ARG + \" requires a value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals( XPACK_SSL_CERTIFICATE_AUTH_ARG)) { \n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\txpackSsslCertificateAuth = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println( XPACK_SSL_CERTIFICATE_AUTH_ARG + \" requires a value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ECS_COLLECT_OBJECT_DATA_NAMESPACE_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\tobjectNamespace = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_COLLECT_OBJECT_DATA_NAMESPACE_ARGUMENT + \" requires namespace\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ECS_COLLECT_OBJECT_DATA_NAME_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\tbucketName = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_COLLECT_OBJECT_DATA_NAME_ARGUMENT + \" requires bucket\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tSystem.err.println(\"Unrecognized option: \" + arg); \n\t\t\t\t\tSystem.err.println(menuString);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t} \n\t\t\t}\n\t\t\tif (bucketName!=null) {\n\t\t\t\tif (objectNamespace==null || \"\".equals(objectNamespace)) {\n\t\t\t\t\tSystem.err.println(ECS_COLLECT_OBJECT_DATA_NAMESPACE_ARGUMENT + \" requires namespace, \" + ECS_COLLECT_OBJECT_DATA_NAME_ARGUMENT + \" requires bucket\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(initIndexesOnlyOption) {\n\t\t\t// Check hosts\n\t\t\tif(elasticHosts.isEmpty()) {\t\n\t\t\t\tSystem.err.println(\"Missing Elastic hostname use \" + ELASTIC_HOSTS_CONFIG_ARGUMENT + \n\t\t\t\t\t\t\t\t\"<host1, host2> to specify a value\" );\n\t\t\t\treturn;\n\t\t\t}\t\n\t\t} else {\n\n\t\t\t// Check hosts\n\t\t\tif(ecsHosts.isEmpty()) {\t\n\t\t\t\tSystem.err.println(\"Missing ECS hostname use \" + ECS_HOSTS_CONFIG_ARGUMENT + \n\t\t\t\t\t\t\"<host1, host2> to specify a value\" );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// management access/user key\n\t\t\tif(ecsMgmtAccessKey.isEmpty()) {\n\t\t\t\tSystem.err.println(\"Missing managment access key use\" + ECS_MGMT_ACCESS_KEY_CONFIG_ARGUMENT +\n\t\t\t\t\t\t\"<admin-username> to specify a value\" );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// management access/user key\n\t\t\tif(ecsMgmtSecretKey.isEmpty()) {\n\t\t\t\tSystem.err.println(\"Missing management secret key use \" + ECS_MGMT_SECRET_KEY_CONFIG_ARGUMENT +\n\t\t\t\t\t\t\"<admin-password> to specify a value\" );\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void wrongArgumentsReturnsNullAndPrintsMessage() {\n String[] inputArgs = new String[] {\"-i\", \"/path/\"};\n ArgumentReader sut = new ArgumentReader(inputArgs);\n\n Arguments args = sut.read();\n\n assertThat(args, nullValue());\n assertThat(errContent.toString(), containsString(\"must be provided!\"));\n assertThat(errContent.toString(), containsString(\"Usage:\"));\n }", "private void inputValidation(String[] args) {\r\n\t\t// Must have two argument inputs - grammar and sample input\r\n\t\tif (args.length != 2) {\r\n\t\t\tSystem.out.println(\"Invalid parameters. Try:\\njava Main <path/to/grammar> <path/to/input>\");\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "private static void processArguments(String[] args) {\r\n if (args.length < 2) {\r\n IO.displayGUI(args.length + \" arguments provided.\\nPlease provide input and output files through the GUI.\");\r\n IO.chooseFiles(); // choose files with GUI\r\n } else {\r\n // Open file streams\r\n IO.openStream(args[0], args[1]);\r\n }\r\n }", "boolean hasParameters();", "protected void validateArguments( Object[] args ) throws ActionExecutionException {\n\n Annotation[][] annotations = method.getParameterAnnotations();\n for (int i = 0; i < annotations.length; i++) {\n\n Annotation[] paramAnnotations = annotations[i];\n\n for (Annotation paramAnnotation : paramAnnotations) {\n if (paramAnnotation instanceof Parameter) {\n Parameter paramDescriptionAnnotation = (Parameter) paramAnnotation;\n ValidationType validationType = paramDescriptionAnnotation.validation();\n\n String[] validationArgs;\n\n // if we are checking for valid constants, then the\n // args array should contain\n // the name of the array holding the valid constants\n if (validationType == ValidationType.STRING_CONSTANT\n || validationType == ValidationType.NUMBER_CONSTANT) {\n try {\n String arrayName = paramDescriptionAnnotation.args()[0];\n\n // get the field and set access level if\n // necessary\n Field arrayField = method.getDeclaringClass().getDeclaredField(arrayName);\n if (!arrayField.isAccessible()) {\n arrayField.setAccessible(true);\n }\n Object arrayValidConstants = arrayField.get(null);\n\n // convert the object array to string array\n String[] arrayValidConstatnsStr = new String[Array.getLength(arrayValidConstants)];\n for (int j = 0; j < Array.getLength(arrayValidConstants); j++) {\n arrayValidConstatnsStr[j] = Array.get(arrayValidConstants, j).toString();\n }\n\n validationArgs = arrayValidConstatnsStr;\n\n } catch (IndexOutOfBoundsException iobe) {\n // this is a fatal error\n throw new ActionExecutionException(\"You need to specify the name of the array with valid constants in the 'args' field of the Parameter annotation\");\n } catch (Exception e) {\n // this is a fatal error\n throw new ActionExecutionException(\"Could not get array with valid constants - action annotations are incorrect\");\n }\n } else {\n validationArgs = paramDescriptionAnnotation.args();\n }\n\n List<BaseType> typeValidators = createBaseTypes(paramDescriptionAnnotation.validation(),\n paramDescriptionAnnotation.name(),\n args[i], validationArgs);\n //perform validation\n for (BaseType baseType : typeValidators) {\n if (baseType != null) {\n try {\n baseType.validate();\n } catch (TypeException e) {\n throw new InvalidInputArgumentsException(\"Validation failed while validating argument \"\n + paramDescriptionAnnotation.name()\n + e.getMessage());\n }\n } else {\n log.warn(\"Could not perform validation on argument \"\n + paramDescriptionAnnotation.name());\n }\n }\n }\n }\n }\n }", "Optional<String[]> arguments();", "private Arguments validateAndReturnType(String[] arguments) {\n\t\tif(arguments == null || arguments.length == 0 || arguments.length > 3)\n \t\treturn Arguments.INVALID;\n\t\tString arg1 = arguments[0].toLowerCase();\n\t\tif(arg1.equals(\"increase\") || arg1.equals(\"reduce\") || arg1.equals(\"inrange\")){\n\t\t\tif(arguments.length != 3)\n\t\t\t\treturn Arguments.INVALID;\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(arg1.equals(\"increase\"))\n\t\t\t\t\treturn Arguments.INCREASE;\n\t\t\t\telse if(arg1.equals(\"reduce\"))\n\t\t\t\t\treturn Arguments.REDUCE;\n\t\t\t\telse if(arg1.equals(\"inrange\"))\n\t\t\t\t\treturn Arguments.INRANGE;\n\t\t\t}\n\t\t} else if(arg1.equals(\"next\") || arg1.equals(\"previous\") || arg1.equals(\"count\")) {\n\t\t\tif(arguments.length != 2)\n\t\t\t\treturn Arguments.INVALID;\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(arg1.equals(\"next\"))\n\t\t\t\t\treturn Arguments.NEXT;\n\t\t\t\telse if(arg1.equals(\"previous\"))\n\t\t\t\t\treturn Arguments.PREVIOUS;\n\t\t\t\telse if(arg1.equals(\"count\"))\n\t\t\t\t\treturn Arguments.COUNT;\n\t\t\t}\n\t\t} else if(arg1.equals(\"quit\")) {\n\t\t\treturn Arguments.QUIT;\n\t\t} else\n\t\t\treturn Arguments.INVALID;\n\t\t\t\n\t\treturn null;\n\t}", "public void testValidateArgs() {\n\t\tString[] args = new String[]{\"name\",\"bob\",\"jones\"};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with 1 argument, should fail\n\t\targs = new String[]{\"name\"};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with 0 arguments, should be a problem\n\t\targs = new String[]{};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with null arguments, should be a problem\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with correct arguments, first one is zero, should work\n\t\targs = new String[]{\"name\",\"bob\"};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tfail(\"An InvalidFunctionArguements exception should have NOT been thrown by the constructor!\");\n\t\t}\n\t}", "public void checkNumberOfArguments3() {\n logger.info(\"Hello {}, {}, {}, {}, {}, {}, {}\", \"world\", 2, \"third argument\", 4, 5, 6, new String(\"last arg\"));\n }", "static void tryReadArgs(String args[]){\n\t\tif(args.length > 0) {\n\t\t\tip = args[0];\n\t\t}\n\t\tif(args.length > 1) {\n\t\t\tport = Integer.parseInt(args[1]);\n\t\t}\n\t}", "public void processArgs(String[] args){\n\t\tPattern pat = Pattern.compile(\"-[a-z]\");\n\t\tSystem.out.println(\"\\n\"+IO.fetchUSeqVersion()+\" Arguments: \"+Misc.stringArrayToString(args, \" \")+\"\\n\");\n\t\tfor (int i = 0; i<args.length; i++){\n\t\t\tString lcArg = args[i].toLowerCase();\n\t\t\tMatcher mat = pat.matcher(lcArg);\n\t\t\tif (mat.matches()){\n\t\t\t\tchar test = args[i].charAt(1);\n\t\t\t\ttry{\n\t\t\t\t\tswitch (test){\n\t\t\t\t\tcase 'b': bedFile = new File (args[i+1]); i++; break;\n\t\t\t\t\tcase 'm': minNumExons = Integer.parseInt(args[i+1]); i++; break;\n\t\t\t\t\tcase 'a': requiredAnnoType = args[i+1]; i++; break;\n\t\t\t\t\tcase 'h': printDocs(); System.exit(0);\n\t\t\t\t\tdefault: System.out.println(\"\\nProblem, unknown option! \" + mat.group());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception e){\n\t\t\t\t\tMisc.printExit(\"\\nSorry, something doesn't look right with this parameter: -\"+test+\"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (bedFile == null || bedFile.canRead() == false) Misc.printExit(\"\\nError: cannot find your bed file!\\n\");\t\n\t}", "private boolean parseArguments(String input) {\r\n\t\tString arguments[] = input.split(\" \");\r\n\t\tif (arguments.length == TWO_ARGUMENTS) {\r\n\t\t\tmailbox = arguments[ARRAY_SECOND_ELEMENT].trim();\r\n\t\t\tpassword = arguments[ARRAY_THIRD_ELEMENT].trim();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\t\t\r\n\t}", "@Test\n public void AppNoParams() {\n try{\n App.main(new String[]{});\n }catch(RuntimeException re){\n assertEquals(re.getMessage(),\"Insufficient arguments given. Needs [input file] [# processors]\");\n }\n }", "public ArgumentChecker(String[] words) {\n\n if (words.length < 1 || words == null) {\n throw new IllegalArgumentException();\n }\n for (String word : words) {\n if (word.isEmpty() || word == null) {\n throw new IllegalArgumentException();\n }\n }\n }", "private boolean validateData() {\r\n TASKAggInfo agg = null;\r\n int index = aggList.getSelectedIndex();\r\n if (index != 0) {\r\n agg = (TASKAggInfo)aggregators.elementAt(aggList.getSelectedIndex()-1);\r\n }\r\n\r\n if (getArgument1() == BAD_ARGUMENT) {\r\n JOptionPane.showMessageDialog(this, \"Argument 1 must be of type: \"+TASKTypes.TypeName[agg.getArgType()], \"Error\", JOptionPane.ERROR_MESSAGE);\r\n return false;\r\n }\r\n else if (getArgument2() == BAD_ARGUMENT) {\r\n JOptionPane.showMessageDialog(this, \"Argument 2 must be of type: \"+TASKTypes.TypeName[agg.getArgType()], \"Error\", JOptionPane.ERROR_MESSAGE);\r\n return false;\r\n }\r\n else if (getOperand() == BAD_ARGUMENT) {\r\n JOptionPane.showMessageDialog(this, \"Filter value must be of type integer\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n return false;\r\n }\r\n return true;\r\n }", "private static void checkArg(Object paramObject) {\n/* 687 */ if (paramObject == null)\n/* 688 */ throw new NullPointerException(\"Argument must not be null\"); \n/* */ }", "protected boolean requireArgument(Node node, int idx, String argName)\n {\n if (!hasArgument(node, idx)) {\n rsvc.error(\"#\" + getName() + \"() error : \" + argName + \" argument required\");\n return false;\n }\n return true;\n }", "public static boolean processArguments(String[] args) {\n\t\t// Based on the argument call appropriate function for processing it.\n\t\tif (args[0].equals(\"-c\")) {\n\t\t\treturn processClient(args);\n\t\t} else if (args[0].equals(\"-s\")) {\n\t\t\treturn processServer(args);\n\t\t} else if (args[0].equals(\"-p\")) {\n\t\t\treturn processProxyServer(args);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private void checkForEmptyLine() throws OutmatchingParametersToMethodCall {\n if (this.params.isEmpty() && method.getParamAmount() != 0) {\n throw new OutmatchingParametersToMethodCall();\n } else if (method.getParamAmount() == 0 && !this.params.isEmpty()) {\n throw new OutmatchingParametersToMethodCall();\n }\n }", "@Test\n public void correctArgumentsReturnsArguments() {\n String projectPath = \"/pathI/\";\n String resultPath = \"/pathO/\";\n String apkPath = apkFile.getAbsolutePath();\n String filtersPath = filterFile.getAbsolutePath();\n String[] inputArgs = new String[] {\"-i\", projectPath, \"-o\", resultPath, \n \"-a\", apkPath, \"-f\", filtersPath};\n ArgumentReader sut = new ArgumentReader(inputArgs);\n\n Arguments args = sut.read();\n\n assertThat(args, notNullValue());\n assertThat(args.getProjectPath(), equalTo(projectPath));\n assertThat(args.getResultPath(), equalTo(resultPath));\n assertThat(args.getApkFilePath(), equalTo(apkPath));\n assertThat(args.getFiltersPath(), equalTo(filtersPath));\n }", "private boolean parseArguments(final String[] args) {\r\n final Args arg = new Args(args);\r\n boolean ok = true;\r\n try {\r\n while(arg.more() && ok) {\r\n if(arg.dash()) {\r\n final char ca = arg.next();\r\n if(ca == 'u') {\r\n final String[] s = new String[args.length - 1];\r\n System.arraycopy(args, 1, s, 0, s.length);\r\n updateTimes(s);\r\n return false;\r\n } else if(ca == 'x') {\r\n convertTopics();\r\n return false;\r\n }\r\n\r\n ok = false;\r\n }\r\n }\r\n session = new ClientSession(ctx);\r\n session.execute(new Set(Prop.INFO, true));\r\n } catch(final Exception ex) {\r\n ok = false;\r\n Main.errln(\"Please run BaseXServer for using server mode.\");\r\n ex.printStackTrace();\r\n }\r\n \r\n if(!ok) {\r\n Main.outln(\"Usage: \" + Main.name(this) + \" [options]\" + NL +\r\n \" -u[...] update submission times\" + NL +\r\n \" -x convert queries\");\r\n }\r\n return ok;\r\n }", "protected void parseArgs(String[] args) {\n // Arguments are pretty simple, so we go with a basic switch instead of having\n // yet another dependency (e.g. commons-cli).\n for (int i = 0; i < args.length; i++) {\n int nextIdx = (i + 1);\n String arg = args[i];\n switch (arg) {\n case \"--prop-file\":\n if (++i < args.length) {\n loadPropertyFile(args[i]);\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--schema-name\":\n if (++i < args.length) {\n DataDefinitionUtil.assertValidName(args[i]);\n\n // Force upper-case to avoid tricky-to-catch errors related to quoting names\n this.schemaName = args[i];\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--grant-to\":\n if (++i < args.length) {\n DataDefinitionUtil.assertValidName(args[i]);\n\n // Force upper-case because user names are case-insensitive\n this.grantTo = args[i].toUpperCase();\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--target\":\n if (++i < args.length) {\n DataDefinitionUtil.assertValidName(args[i]);\n List<String> targets = Arrays.asList(args[i].split(\",\"));\n for (String target : targets) {\n String tmp = target.toUpperCase();\n nextIdx++;\n if (tmp.startsWith(\"BATCH\")) {\n this.grantJavaBatchSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.javaBatchSchemaName = args[nextIdx];\n i++;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n } else if (tmp.startsWith(\"OAUTH\")){\n this.grantOauthSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.oauthSchemaName = args[nextIdx];\n i++;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n } else if (tmp.startsWith(\"DATA\")){\n this.grantFhirSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.schemaName = args[nextIdx];\n i++;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n }\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--add-tenant-key\":\n if (++i < args.length) {\n this.addKeyForTenant = args[i];\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--update-proc\":\n this.updateProc = true;\n break;\n case \"--check-compatibility\":\n this.checkCompatibility = true;\n break;\n case \"--drop-admin\":\n this.dropAdmin = true;\n break;\n case \"--test-tenant\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.testTenant = true;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--tenant-key\":\n if (++i < args.length) {\n this.tenantKey = args[i];\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--tenant-key-file\":\n if (++i < args.length) {\n tenantKeyFileName = args[i];\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--list-tenants\":\n this.listTenants = true;\n break;\n case \"--update-schema\":\n this.updateFhirSchema = true;\n this.updateOauthSchema = true;\n this.updateJavaBatchSchema = true;\n this.dropSchema = false;\n break;\n case \"--update-schema-fhir\":\n this.updateFhirSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.schemaName = args[nextIdx];\n i++;\n } else {\n this.schemaName = DATA_SCHEMANAME;\n }\n break;\n case \"--update-schema-batch\":\n this.updateJavaBatchSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.javaBatchSchemaName = args[nextIdx];\n i++;\n }\n break;\n case \"--update-schema-oauth\":\n this.updateOauthSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.oauthSchemaName = args[nextIdx];\n i++;\n }\n break;\n case \"--create-schemas\":\n this.createFhirSchema = true;\n this.createOauthSchema = true;\n this.createJavaBatchSchema = true;\n break;\n case \"--create-schema-fhir\":\n this.createFhirSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.schemaName = args[nextIdx];\n i++;\n }\n break;\n case \"--create-schema-batch\":\n this.createJavaBatchSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.javaBatchSchemaName = args[nextIdx];\n i++;\n }\n break;\n case \"--create-schema-oauth\":\n this.createOauthSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.oauthSchemaName = args[nextIdx];\n i++;\n }\n break;\n case \"--drop-schema\":\n this.updateFhirSchema = false;\n this.dropSchema = true;\n break;\n case \"--drop-schema-fhir\":\n this.dropFhirSchema = Boolean.TRUE;\n break;\n case \"--drop-schema-batch\":\n this.dropJavaBatchSchema = Boolean.TRUE;\n break;\n case \"--drop-schema-oauth\":\n this.dropOauthSchema = Boolean.TRUE;\n break;\n case \"--pool-size\":\n if (++i < args.length) {\n this.maxConnectionPoolSize = Integer.parseInt(args[i]);\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--prop\":\n if (++i < args.length) {\n // properties are given as name=value\n addProperty(args[i]);\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--confirm-drop\":\n this.confirmDrop = true;\n break;\n case \"--allocate-tenant\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.allocateTenant = true;\n this.dropTenant = false;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--drop-tenant\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.dropTenant = true;\n this.allocateTenant = false;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--freeze-tenant\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.freezeTenant = true;\n this.dropTenant = false;\n this.allocateTenant = false;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--drop-detached\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.dropDetached = true;\n this.dropTenant = false;\n this.allocateTenant = false;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--delete-tenant-meta\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.deleteTenantMeta = true;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--dry-run\":\n this.dryRun = Boolean.TRUE;\n break;\n case \"--db-type\":\n if (++i < args.length) {\n this.dbType = DbType.from(args[i]);\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n switch (dbType) {\n case DERBY:\n translator = new DerbyTranslator();\n // For some reason, embedded derby deadlocks if we use multiple threads\n maxConnectionPoolSize = 1;\n break;\n case POSTGRESQL:\n translator = new PostgreSqlTranslator();\n break;\n case DB2:\n default:\n break;\n }\n break;\n default:\n throw new IllegalArgumentException(\"Invalid argument: \" + arg);\n }\n }\n }", "public void processArgs(String[] args){\n\t\tPattern pat = Pattern.compile(\"-[a-z]\");\n\t\tString useqVersion = IO.fetchUSeqVersion();\n\t\tSystem.out.println(\"\\n\"+useqVersion+\" Arguments: \"+ Misc.stringArrayToString(args, \" \") +\"\\n\");\n\t\tfor (int i = 0; i<args.length; i++){\n\t\t\tString lcArg = args[i].toLowerCase();\n\t\t\tMatcher mat = pat.matcher(lcArg);\n\t\t\tif (mat.matches()){\n\t\t\t\tchar test = args[i].charAt(1);\n\t\t\t\ttry{\n\t\t\t\t\tswitch (test){\n\t\t\t\t\tcase 'r': bedFile = new File(args[++i]); break;\n\t\t\t\t\tcase 's': saveDirectory = new File(args[++i]); break;\n\t\t\t\t\tcase 'c': haploArgs = args[++i]; break;\n\t\t\t\t\tcase 't': numberConcurrentThreads = Integer.parseInt(args[++i]); break;\n\t\t\t\t\tdefault: Misc.printErrAndExit(\"\\nProblem, unknown option! \" + mat.group());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception e){\n\t\t\t\t\tMisc.printErrAndExit(\"\\nSorry, something doesn't look right with this parameter: -\"+test+\"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//check save dir\n\t\tif (saveDirectory == null) Misc.printErrAndExit(\"\\nError: cannot find your save directory!\\n\"+saveDirectory);\n\t\tsaveDirectory.mkdirs();\n\t\tif (saveDirectory.isDirectory() == false) Misc.printErrAndExit(\"\\nError: your save directory does not appear to be a directory?\\n\");\n\n\t\t//check bed\n\t\tif (bedFile == null || bedFile.canRead() == false) Misc.printErrAndExit(\"\\nError: cannot find your bed file of regions to interrogate?\\n\"+bedFile);\n\t\t\n\t\t//check args\n\t\tif (haploArgs == null) Misc.printErrAndExit(\"\\nError: please provide a gatk haplotype caller launch cmd similar to the following where you \"\n\t\t\t\t+ \"replace the $xxx with the correct path to these resources on your system:\\n'java -Xmx4G -jar $GenomeAnalysisTK.jar -T \"\n\t\t\t\t+ \"HaplotypeCaller -stand_call_conf 5 -stand_emit_conf 5 --min_mapping_quality_score 13 -R $fasta --dbsnp $dbsnp -I $bam'\\n\");\n\t\tif (haploArgs.contains(\"~\") || haploArgs.contains(\"./\")) Misc.printErrAndExit(\"\\nError: full paths in the GATK command.\\n\"+haploArgs);\n\t\tif (haploArgs.contains(\"-o\") || haploArgs.contains(\"-L\")) Misc.printErrAndExit(\"\\nError: please don't provide a -o or -L argument to the cmd.\\n\"+haploArgs);\t\n\t\n\t\t//determine number of threads\n\t\tdouble gigaBytesAvailable = ((double)Runtime.getRuntime().maxMemory())/ 1073741824.0;\n\t\t\n\t\n\t}", "public static void checkNumArgs(String[] args, int n) {\r\n if (args.length != n) {\r\n throw new GitletException(\"Incorrect operands.\");\r\n }\r\n return;\r\n }", "public boolean hasArgs() {\n return fieldSetFlags()[3];\n }", "int getArgsCount();", "int getArgsCount();", "int getArgsCount();", "int getArgsCount();", "int getArgsCount();", "private boolean doDescriptorArgsMatch(String expected, String check) {\n String expectedArgs = expected.substring(1, expected.indexOf(\")\"));\n String checkArgs = check.substring(1, check.indexOf(\")\"));\n return expectedArgs.equals(checkArgs);\n }", "private static void processArguments(String[] args) throws UnknownHostException {\n //\n // PROD indicates we should use the production network\n // TEST indicates we should use the test network\n //\n if (args[0].equalsIgnoreCase(\"TEST\")) {\n testNetwork = true;\n } else if (!args[0].equalsIgnoreCase(\"PROD\")) {\n throw new IllegalArgumentException(\"Valid options are PROD and TEST\");\n }\n //\n // A bitcoin URI will be specified if we are processing a payment request\n //\n if (args.length > 1) {\n if (args[1].startsWith(\"bitcoin:\"))\n uriString = args[1];\n else\n throw new IllegalArgumentException(\"Unrecognized command line parameter\");\n }\n }", "private void parseArgs(String[] object) throws IllegalArgumentException {\n Object object2;\n int n;\n int n2;\n int n3 = 0;\n boolean bl = false;\n boolean bl2 = true;\n block6 : do {\n int n4 = ((Object)object).length;\n n2 = 0;\n n = ++n3;\n if (n3 >= n4) break;\n object2 = object[n3];\n if (((String)object2).equals(\"--\")) {\n n = n3 + 1;\n break;\n }\n if (((String)object2).startsWith(\"--setuid=\")) {\n if (this.mUidSpecified) throw new IllegalArgumentException(\"Duplicate arg specified\");\n this.mUidSpecified = true;\n this.mUid = Integer.parseInt(((String)object2).substring(((String)object2).indexOf(61) + 1));\n continue;\n }\n if (((String)object2).startsWith(\"--setgid=\")) {\n if (this.mGidSpecified) throw new IllegalArgumentException(\"Duplicate arg specified\");\n this.mGidSpecified = true;\n this.mGid = Integer.parseInt(((String)object2).substring(((String)object2).indexOf(61) + 1));\n continue;\n }\n if (((String)object2).startsWith(\"--target-sdk-version=\")) {\n if (this.mTargetSdkVersionSpecified) throw new IllegalArgumentException(\"Duplicate target-sdk-version specified\");\n this.mTargetSdkVersionSpecified = true;\n this.mTargetSdkVersion = Integer.parseInt(((String)object2).substring(((String)object2).indexOf(61) + 1));\n continue;\n }\n if (((String)object2).equals(\"--runtime-args\")) {\n bl = true;\n continue;\n }\n if (((String)object2).startsWith(\"--runtime-flags=\")) {\n this.mRuntimeFlags = Integer.parseInt(((String)object2).substring(((String)object2).indexOf(61) + 1));\n continue;\n }\n if (((String)object2).startsWith(\"--seinfo=\")) {\n if (this.mSeInfoSpecified) throw new IllegalArgumentException(\"Duplicate arg specified\");\n this.mSeInfoSpecified = true;\n this.mSeInfo = ((String)object2).substring(((String)object2).indexOf(61) + 1);\n continue;\n }\n if (((String)object2).startsWith(\"--capabilities=\")) {\n if (this.mCapabilitiesSpecified) throw new IllegalArgumentException(\"Duplicate arg specified\");\n this.mCapabilitiesSpecified = true;\n if (((String[])(object2 = ((String)object2).substring(((String)object2).indexOf(61) + 1).split(\",\", 2))).length == 1) {\n this.mPermittedCapabilities = this.mEffectiveCapabilities = Long.decode((String)object2[0]).longValue();\n continue;\n }\n this.mPermittedCapabilities = Long.decode((String)object2[0]);\n this.mEffectiveCapabilities = Long.decode((String)object2[1]);\n continue;\n }\n if (((String)object2).startsWith(\"--rlimit=\")) {\n String[] arrstring = ((String)object2).substring(((String)object2).indexOf(61) + 1).split(\",\");\n if (arrstring.length != 3) throw new IllegalArgumentException(\"--rlimit= should have 3 comma-delimited ints\");\n object2 = new int[arrstring.length];\n for (n = 0; n < arrstring.length; ++n) {\n object2[n] = Integer.parseInt(arrstring[n]);\n }\n if (this.mRLimits == null) {\n this.mRLimits = new ArrayList();\n }\n this.mRLimits.add((int[])object2);\n continue;\n }\n if (((String)object2).startsWith(\"--setgroups=\")) {\n if (this.mGids != null) throw new IllegalArgumentException(\"Duplicate arg specified\");\n object2 = ((String)object2).substring(((String)object2).indexOf(61) + 1).split(\",\");\n this.mGids = new int[((String[])object2).length];\n n = ((Object[])object2).length - 1;\n do {\n if (n < 0) continue block6;\n this.mGids[n] = Integer.parseInt((String)object2[n]);\n --n;\n } while (true);\n }\n if (((String)object2).equals(\"--invoke-with\")) {\n if (this.mInvokeWith != null) throw new IllegalArgumentException(\"Duplicate arg specified\");\n ++n3;\n try {\n this.mInvokeWith = object[n3];\n }\n catch (IndexOutOfBoundsException indexOutOfBoundsException) {\n throw new IllegalArgumentException(\"--invoke-with requires argument\");\n }\n }\n if (((String)object2).startsWith(\"--nice-name=\")) {\n if (this.mNiceName != null) throw new IllegalArgumentException(\"Duplicate arg specified\");\n this.mNiceName = ((String)object2).substring(((String)object2).indexOf(61) + 1);\n continue;\n }\n if (((String)object2).equals(\"--mount-external-default\")) {\n this.mMountExternal = 1;\n continue;\n }\n if (((String)object2).equals(\"--mount-external-read\")) {\n this.mMountExternal = 2;\n continue;\n }\n if (((String)object2).equals(\"--mount-external-write\")) {\n this.mMountExternal = 3;\n continue;\n }\n if (((String)object2).equals(\"--mount-external-full\")) {\n this.mMountExternal = 6;\n continue;\n }\n if (((String)object2).equals(\"--mount-external-installer\")) {\n this.mMountExternal = 5;\n continue;\n }\n if (((String)object2).equals(\"--mount-external-legacy\")) {\n this.mMountExternal = 4;\n continue;\n }\n if (((String)object2).equals(\"--query-abi-list\")) {\n this.mAbiListQuery = true;\n continue;\n }\n if (((String)object2).equals(\"--get-pid\")) {\n this.mPidQuery = true;\n continue;\n }\n if (((String)object2).startsWith(\"--instruction-set=\")) {\n this.mInstructionSet = ((String)object2).substring(((String)object2).indexOf(61) + 1);\n continue;\n }\n if (((String)object2).startsWith(\"--app-data-dir=\")) {\n this.mAppDataDir = ((String)object2).substring(((String)object2).indexOf(61) + 1);\n continue;\n }\n if (((String)object2).equals(\"--preload-app\")) {\n this.mPreloadApp = object[++n3];\n continue;\n }\n if (((String)object2).equals(\"--preload-package\")) {\n this.mPreloadPackage = object[++n3];\n this.mPreloadPackageLibs = object[++n3];\n this.mPreloadPackageLibFileName = object[++n3];\n this.mPreloadPackageCacheKey = object[++n3];\n continue;\n }\n if (((String)object2).equals(\"--preload-default\")) {\n this.mPreloadDefault = true;\n bl2 = false;\n continue;\n }\n if (((String)object2).equals(\"--start-child-zygote\")) {\n this.mStartChildZygote = true;\n continue;\n }\n if (((String)object2).equals(\"--set-api-blacklist-exemptions\")) {\n this.mApiBlacklistExemptions = (String[])Arrays.copyOfRange(object, n3 + 1, ((Object)object).length);\n n3 = ((Object)object).length;\n bl2 = false;\n continue;\n }\n if (((String)object2).startsWith(\"--hidden-api-log-sampling-rate=\")) {\n object2 = ((String)object2).substring(((String)object2).indexOf(61) + 1);\n try {\n this.mHiddenApiAccessLogSampleRate = Integer.parseInt((String)object2);\n bl2 = false;\n }\n catch (NumberFormatException numberFormatException) {\n object = new StringBuilder();\n ((StringBuilder)object).append(\"Invalid log sampling rate: \");\n ((StringBuilder)object).append((String)object2);\n throw new IllegalArgumentException(((StringBuilder)object).toString(), numberFormatException);\n }\n }\n if (((String)object2).startsWith(\"--hidden-api-statslog-sampling-rate=\")) {\n object2 = ((String)object2).substring(((String)object2).indexOf(61) + 1);\n try {\n this.mHiddenApiAccessStatslogSampleRate = Integer.parseInt((String)object2);\n bl2 = false;\n }\n catch (NumberFormatException numberFormatException) {\n object = new StringBuilder();\n ((StringBuilder)object).append(\"Invalid statslog sampling rate: \");\n ((StringBuilder)object).append((String)object2);\n throw new IllegalArgumentException(((StringBuilder)object).toString(), numberFormatException);\n }\n }\n if (((String)object2).startsWith(\"--package-name=\")) {\n if (this.mPackageName != null) throw new IllegalArgumentException(\"Duplicate arg specified\");\n this.mPackageName = ((String)object2).substring(((String)object2).indexOf(61) + 1);\n continue;\n }\n n = n3;\n if (!((String)object2).startsWith(\"--usap-pool-enabled=\")) break;\n this.mUsapPoolStatusSpecified = true;\n this.mUsapPoolEnabled = Boolean.parseBoolean(((String)object2).substring(((String)object2).indexOf(61) + 1));\n bl2 = false;\n } while (true);\n if (!this.mAbiListQuery && !this.mPidQuery) {\n if (this.mPreloadPackage != null) {\n if (((Object)object).length - n > 0) throw new IllegalArgumentException(\"Unexpected arguments after --preload-package.\");\n } else if (this.mPreloadApp != null) {\n if (((Object)object).length - n > 0) throw new IllegalArgumentException(\"Unexpected arguments after --preload-app.\");\n } else if (bl2) {\n if (!bl) {\n object2 = new StringBuilder();\n ((StringBuilder)object2).append(\"Unexpected argument : \");\n ((StringBuilder)object2).append((String)object[n]);\n throw new IllegalArgumentException(((StringBuilder)object2).toString());\n }\n this.mRemainingArgs = new String[((Object)object).length - n];\n object2 = this.mRemainingArgs;\n System.arraycopy(object, n, object2, 0, ((String[])object2).length);\n }\n } else if (((Object)object).length - n > 0) throw new IllegalArgumentException(\"Unexpected arguments after --query-abi-list.\");\n if (!this.mStartChildZygote) return;\n bl = false;\n object = this.mRemainingArgs;\n n = ((Object)object).length;\n n3 = n2;\n do {\n bl2 = bl;\n if (n3 >= n) break;\n if (((String)object[n3]).startsWith(\"--zygote-socket=\")) {\n bl2 = true;\n break;\n }\n ++n3;\n } while (true);\n if (!bl2) throw new IllegalArgumentException(\"--start-child-zygote specified without --zygote-socket=\");\n }", "boolean isVarargs();", "boolean isVarargs();", "boolean isVarargs();", "public ArgumentChecker(String[] titles, String[] wordsRequired, String[] wordsExcluded) {\n for (String word : wordsRequired) {\n if (word.isEmpty() || word == null) {\n throw new IllegalArgumentException();\n }\n }\n for (String word : wordsExcluded) {\n if (word.isEmpty() || word == null) {\n throw new IllegalArgumentException();\n }\n }\n for (String title: titles) {\n if (title.length() < 1 || title == null) {\n throw new IllegalArgumentException();\n }\n }\n }", "public static void main(String[] args) {\n\t\tif (!processArguments(args)) {\n\t\t\tSystem.out.println(\"Invalid Arguments! Please try again..\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "public static void basicCheck(String... args) {\r\n if (args.length == 0) {\r\n throw new GitletException(\"Please enter a command.\");\r\n }\r\n if (!args[0].equals(\"init\") && !MAIN_FOLDER.isDirectory()) {\r\n throw new GitletException(\"Not in \"\r\n + \"an initialized Gitlet directory.\");\r\n }\r\n }", "public ArgumentChecker(String word) {\n\n if (word.isEmpty() || word == null) {\n throw new IllegalArgumentException();\n }\n }", "@Override\n\tpublic boolean checkInput() {\n\t\treturn true;\n\t}", "@Override\n public int getNumberArguments() {\n return 1;\n }", "public static void main(String[] args) {\n\t\t\tmeth(args);\r\n\t\t\targument_test:meth(args);\r\n\t}", "private void checkUserInput() {\n }", "public static void main(String[] args) {\n\t\tcheckNumber(-1);\n\n\t\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(isValid(\"aabbccddeefghi\"));\n\t}", "@Override\n public Map<String, String> getInputArgs() {\n Log.w(TAG, \"Test input args is not supported.\");\n return new HashMap<>();\n }", "Optional<String> validate(String command, List<String> args);", "public boolean takesArgument() {\n if (argumentPresence != null) {\n return true;\n }\n return false;\n }", "protected boolean hasArgument(Node node, int idx)\n {\n return idx < node.jjtGetNumChildren();\n }", "protected abstract boolean checkInput();", "public void processArgs(String[] args){\r\n\t\tPattern pat = Pattern.compile(\"-[a-z]\");\r\n\t\tfor (int i = 0; i<args.length; i++){\r\n\t\t\tString lcArg = args[i].toLowerCase();\r\n\t\t\tMatcher mat = pat.matcher(lcArg);\r\n\t\t\tif (mat.matches()){\r\n\t\t\t\tchar test = args[i].charAt(1);\r\n\t\t\t\ttry{\r\n\t\t\t\t\tswitch (test){\r\n\t\t\t\t\tcase 'f': directory = new File(args[i+1]); i++; break;\r\n\t\t\t\t\tcase 'o': orderedFileNames = args[++i].split(\",\"); break;\r\n\t\t\t\t\tcase 'c': output = new File(args[++i]); break;\r\n\t\t\t\t\tcase 'h': printDocs(); System.exit(0);\r\n\t\t\t\t\tdefault: Misc.printErrAndExit(\"\\nProblem, unknown option! \" + mat.group());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception e){\r\n\t\t\t\t\tSystem.out.print(\"\\nSorry, something doesn't look right with this parameter request: -\"+test);\r\n\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t\tSystem.exit(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//check to see if they entered required params\r\n\t\tif (directory==null || directory.isDirectory() == false){\r\n\t\t\tSystem.out.println(\"\\nCannot find your directory!\\n\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t}", "private static boolean valid(String arg) {\n\n /* check if valid option */\n if ( arg.equals(\"-v\") || arg.equals(\"-i\") || arg.equals(\"-p\") || arg.equals(\"-h\") )\n return true;\n\n /* check if valid port */\n try {\n int port = Integer.parseInt(arg);\n if ( ( 0 < port ) && ( port < 65354 ) )\n return true;\n } catch (NumberFormatException ignored) {}\n\n /* check if valid ip address */\n String[] ips = arg.split(\"\\\\.\");\n if ( ips.length != 4 )\n return false;\n try{\n for (int i=0; i<4; i++){\n int ip = Integer.parseInt(ips[i]);\n if ( ( ip < 0) || (255 < ip ) )\n return false;\n }\n } catch (NumberFormatException ignored) {return false;}\n\n return true;\n }", "@Override\n protected boolean hasValidArgumentValues(@NotNull ImmutableList<Parameter> arguments) {\n boolean valid = true;\n Value rowIndex = arguments.get(0).value();\n Value columnIndex = arguments.get(1).value();\n\n Preconditions.checkValueType(rowIndex, ValueType.NUMBER);\n Preconditions.checkValueType(columnIndex, ValueType.NUMBER);\n\n checkArgument(!rowIndex.hasImaginaryValue(), \"Row index may not be imaginary\");\n checkArgument(!columnIndex.hasImaginaryValue(), \"Column index may not be imaginary\");\n\n // Check for value bounds on row index\n if (!NumberUtil.isInteger(rowIndex.realPart()) || rowIndex.realPart() < 0 || rowIndex.realPart() > getEnvironment().getHomeScreen().getMaxRows()) {\n valid = false;\n }\n\n // Check for value bounds on column index\n if (!NumberUtil.isInteger(columnIndex.realPart()) || columnIndex.realPart() < 0 || columnIndex.realPart() > getEnvironment().getHomeScreen().getMaxColumns()) {\n valid = false;\n }\n\n return valid;\n }", "private void checkGameListenerMethodsArguments(@Nullable Game game, @Nullable ValueEventListener listener) {\n if (game == null) {\n throw new IllegalArgumentException(\"game should not be null.\");\n }\n if (listener == null) {\n throw new IllegalArgumentException(\"event listener should not be null.\");\n }\n }", "public static void CheckIfParametersAreValid(String args[]) {\n if (args.length != 4) {\n System.err.printf(\"usage: %s server_name port\\n\", args[1]);\n System.exit(1);\n }\n\n IP = args[0];\n PORT = Integer.parseInt(args[1]);\n BUFFER_SIZE = Integer.parseInt(args[2]);\n MSG_RATE = Integer.parseInt(args[3]);\n\n\n String[] ipSeparated = args[0].split(\"\\\\.\");\n\n if(ipSeparated.length<4){\n System.out.println(\"Invalid IP format.\");\n System.exit(1);\n }\n if (ipSeparated.length == 4) {\n\n for (int i = 0; i < ipSeparated.length; i++) {\n if (Integer.valueOf(ipSeparated[i]) < 0 || Integer.valueOf(ipSeparated[i]) > 255 ) {//if ip is not complete i get error\n System.out.println(\"Invalid IP format.\");\n System.exit(1);\n }else {\n IP = args[0];\n }\n }\n }\n\n if (Integer.parseInt(args[1])>= 0 && Integer.parseInt(args[1]) < 65535) {\n PORT = Integer.parseInt((args[1]));\n }\n else {\n System.out.println(\"Invalid PORT Number.\");\n System.exit(1);\n }\n if (Integer.parseInt(args[2]) > 0 || Integer.parseInt(args[2]) < 2048) {\n BUFFER_SIZE = Integer.parseInt((args[2]));\n }\n\n else {\n System.out.println(\"Invalid Buffer Size.\");\n System.exit(1);\n }\n if (Integer.parseInt(args[3]) >= 0) {\n MSG_RATE = Integer.parseInt(args[3]);\n } else {\n System.out.println(\"Message RATE Invalid.\");\n System.exit(1);\n }\n\n }", "private int[] checkFunction(String arg, int[] argumentData) throws ParseException {\n\t\tint index = argumentData[0];\n\t\tint end = argumentData[1];\n\t\tint type = argumentData[2];\n\t\t\n\t\tString function = ParsingUtils.nextWord(arg, index + 1);\t\t\n\t\tif(!info.checkForFunction(function)){\n\t\t\tParseException ex=new ParseException(\"could not find function \" + function, index);\n\t\t\tErrorUtils.parseError(arg,\"could not find function \" + function ,ex,verbose);\n\t\t}\n\t\tint numberOfArguments = 0;\n\t\ttry{\n\t\t\tnumberOfArguments = ParsingUtils.numberOfArg(arg, index, end);\n\t\t} catch (ParseException ex) {\n\t\t\tErrorUtils.parseError(arg, \"Could not find the closing index for string\", ex, verbose);\n\t\t}\n\t\ttree.grow(function, numberOfArguments);\n\t\t\n\t\ttype = ensureProperArguments(arg, function, index, end, numberOfArguments);\n\t\t\n\t\tif (type == ERROR){\n\t\t\tParseException ex=new ParseException(\"Something had the wrong type\",index);\n\t\t\tErrorUtils.parseError(arg,\"Something had the wrong type\",ex,verbose);\n\t\t}\n\n\t\treturn new int[] {index,end,type};\n\t}", "private static void checkArgsAndSetUp()\n {{\n File outDir= new File( arg_outDirname );\n\n if ( outDir.exists() ) {\n\t if ( !outDir.isDirectory() ) {\n\t System.err.println( PROGRAM_NAME+ \n\t\t\t\t\": output directory is not a directory; \"); \n\t System.err.println( \"\\t\"+ \"dir=\\\"\"+ arg_outDirname+ \"\\\", \" );\n\t System.err.println( \"\\t\"+ \"please specify an empty directory.\" );\n\t System.exit(-1);\n\t }\n\t if ( outDir.list().length > 0 ) {\n\t System.err.println( PROGRAM_NAME+ \n\t\t\t\t\": output directory is not empty; \"); \n\t System.err.println( \"\\t\"+ \"dir=\\\"\"+ arg_outDirname+ \"\\\", \" );\n\t System.err.println( \"\\t\"+ \"please specify an empty directory.\" );\n\t System.exit(-1);\n\t }\n } else {\n\t outDir.mkdir();\n }\n }}", "@Override\n public final int parseArguments(Parameters params) {\n return 1;\n }" ]
[ "0.7902268", "0.7892112", "0.78161126", "0.78028995", "0.766213", "0.7510147", "0.7436258", "0.7334726", "0.7330368", "0.71006274", "0.70446545", "0.7041946", "0.70226336", "0.7015839", "0.69926804", "0.6920049", "0.6919219", "0.6915273", "0.68846893", "0.6878546", "0.68547535", "0.68325067", "0.68275976", "0.68159574", "0.6783382", "0.67800295", "0.67437696", "0.66981936", "0.66810274", "0.66484195", "0.66327775", "0.658944", "0.6575317", "0.6557357", "0.6534266", "0.6468971", "0.6468308", "0.6466825", "0.6453493", "0.6443206", "0.6398101", "0.6382445", "0.6373215", "0.6372436", "0.63663614", "0.6344352", "0.63430315", "0.6339071", "0.6332035", "0.6322251", "0.6317076", "0.6313763", "0.6271672", "0.62572885", "0.62357074", "0.62170696", "0.621332", "0.62078744", "0.62038636", "0.61989826", "0.61946934", "0.6180792", "0.61750776", "0.6166326", "0.61366546", "0.6134623", "0.61263037", "0.6122017", "0.6122017", "0.6122017", "0.6122017", "0.6122017", "0.6106499", "0.6088405", "0.6073936", "0.6071682", "0.6071682", "0.6071682", "0.60706264", "0.6069803", "0.60565525", "0.60556567", "0.60529906", "0.60526437", "0.604487", "0.60395145", "0.6037659", "0.60314524", "0.6031333", "0.60211676", "0.6020014", "0.6016999", "0.5999917", "0.59887326", "0.59862256", "0.59854245", "0.5977587", "0.59771645", "0.5972847", "0.59696096", "0.5963202" ]
0.0
-1
Read text file, where each line uses "\\r\\n", and parse based on delimiter.
public void read(File file, String sep, boolean bQuoted) throws Exception { BufferedReader reader = new BufferedReader(new FileReader(file)); for (int i=1;;i++) { String line = reader.readLine(); if (line == null) break; String[] ss = parse(line, sep, bQuoted, i); if (ss != null) process(ss, i); } reader.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String[] parseLine() throws IOException, FHIRException {\n\t\tList<String> res = new ArrayList<String>();\n\t\tStringBuilder b = new StringBuilder();\n\t\tboolean inQuote = false;\n\n\t\twhile (more() && !finished(inQuote, res.size())) {\n\t\t\tchar c = peek();\n\t\t\tnext();\n\t\t\tif (c == '\"' && doingQuotes) {\n\t\t\t\tif (ready() && peek() == '\"') {\n\t b.append(c);\n next();\n\t\t\t\t} else {\n\t\t\t inQuote = !inQuote;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (!inQuote && c == delimiter ) {\n\t\t\t\tres.add(b.toString().trim());\n\t\t\t\tb = new StringBuilder();\n\t\t\t}\n\t\t\telse \n\t\t\t\tb.append(c);\n\t\t}\n\t\tres.add(b.toString().trim());\n\t\twhile (ready() && (peek() == '\\r' || peek() == '\\n')) {\n\t\t\tnext();\n\t\t}\n\t\t\n\t\tString[] r = new String[] {};\n\t\tr = res.toArray(r);\n\t\treturn r;\n\t}", "private Token scanNewlineSeparator() {\n Pair<Integer, Integer> pos = new Pair<>(in.line(), in.pos());\n c = in.read();\n return new Token(\"\\n\", TokenType.SEPARATOR, pos);\n }", "private void parse(Reader reader) throws IOException {\n/* 260 */ BufferedReader buf_reader = new BufferedReader(reader);\n/* 261 */ String line = null;\n/* 262 */ String continued = null;\n/* */ \n/* 264 */ while ((line = buf_reader.readLine()) != null) {\n/* */ \n/* */ \n/* 267 */ line = line.trim();\n/* */ \n/* */ try {\n/* 270 */ if (line.charAt(0) == '#')\n/* */ continue; \n/* 272 */ if (line.charAt(line.length() - 1) == '\\\\') {\n/* 273 */ if (continued != null) {\n/* 274 */ continued = continued + line.substring(0, line.length() - 1); continue;\n/* */ } \n/* 276 */ continued = line.substring(0, line.length() - 1); continue;\n/* 277 */ } if (continued != null) {\n/* */ \n/* 279 */ continued = continued + line;\n/* */ \n/* */ try {\n/* 282 */ parseLine(continued);\n/* 283 */ } catch (MailcapParseException e) {}\n/* */ \n/* */ \n/* 286 */ continued = null;\n/* */ \n/* */ continue;\n/* */ } \n/* */ try {\n/* 291 */ parseLine(line);\n/* */ }\n/* 293 */ catch (MailcapParseException e) {}\n/* */ \n/* */ \n/* */ }\n/* 297 */ catch (StringIndexOutOfBoundsException e) {}\n/* */ } \n/* */ }", "public static List<String> splitText(String text) {\n int startLine = 0;\n int i = 0;\n int n = text.length();\n ArrayList<String> rc = new ArrayList<>();\n while (i < n) {\n switch (text.charAt(i)) {\n case '\\n' -> {\n i++;\n if (i < n && text.charAt(i) == '\\r') {\n i++;\n }\n rc.add(text.substring(startLine, i));\n startLine = i;\n }\n case '\\r' -> {\n i++;\n if (i < n && text.charAt(i) == '\\n') {\n i++;\n }\n rc.add(text.substring(startLine, i));\n startLine = i;\n }\n default -> i++;\n }\n }\n if (startLine == text.length()) {\n // still add empty line or previous line wouldn't be treated as completed\n rc.add(\"\");\n } else {\n rc.add(text.substring(startLine, i));\n }\n return rc;\n }", "private static String readTextFile(File file) throws IOException {\n return Files.lines(file.toPath()).collect(Collectors.joining(\"\\n\"));\n }", "private String[] parseLine(final String nextLine, final boolean readLine)\n throws IOException {\n String line = nextLine;\n if (line.length() == 0) {\n return new String[0];\n } else {\n\n final List<String> fields = new ArrayList<String>();\n StringBuilder sb = new StringBuilder();\n boolean inQuotes = false;\n boolean hadQuotes = false;\n do {\n if (inQuotes && readLine) {\n sb.append(\"\\n\");\n line = getNextLine();\n if (line == null) {\n break;\n }\n }\n for (int i = 0; i < line.length(); i++) {\n final char c = line.charAt(i);\n if (c == CsvConstants.QUOTE_CHARACTER) {\n hadQuotes = true;\n if (inQuotes && line.length() > i + 1\n && line.charAt(i + 1) == CsvConstants.QUOTE_CHARACTER) {\n sb.append(line.charAt(i + 1));\n i++;\n } else {\n inQuotes = !inQuotes;\n if (i > 2 && line.charAt(i - 1) != this.fieldSeparator\n && line.length() > i + 1\n && line.charAt(i + 1) != this.fieldSeparator) {\n sb.append(c);\n }\n }\n } else if (c == this.fieldSeparator && !inQuotes) {\n hadQuotes = false;\n if (hadQuotes || sb.length() > 0) {\n fields.add(sb.toString());\n } else {\n fields.add(null);\n }\n sb = new StringBuilder();\n } else {\n sb.append(c);\n }\n }\n } while (inQuotes);\n if (sb.length() > 0 || fields.size() > 0) {\n if (hadQuotes || sb.length() > 0) {\n fields.add(sb.toString());\n } else {\n fields.add(null);\n }\n }\n return fields.toArray(new String[0]);\n }\n }", "private void eatMultiline() {\n int prev = ';';\n int pos = position + 1;\n\n while (pos < length) {\n int c = data.charAt(pos);\n if (c == ';' && (prev == '\\n' || prev == '\\r')) {\n position = pos + 1;\n // get rid of the ;\n tokenStart++;\n\n // remove trailing newlines\n pos--;\n c = data.charAt(pos);\n while (c == '\\n' || c == '\\r') {\n pos--;\n c = data.charAt(pos);\n }\n tokenEnd = pos + 1;\n\n isEscaped = true;\n return;\n } else {\n // handle line numbers\n if (c == '\\r') {\n lineNumber++;\n } else if (c == '\\n' && prev != '\\r') {\n lineNumber++;\n }\n\n prev = c;\n pos++;\n }\n }\n\n position = pos;\n }", "@Override\n public String readLine() throws IOException {\n\n String line = null;\n\n while (true) {\n\n line = super.readLine();\n\n if (line == null) {\n\n return null;\n }\n\n // Get rid of comments\n\n // VT: FIXME: not handling the escaped comments\n\n int hash = line.indexOf(\"#\");\n\n if (hash != -1) {\n\n // Check if the '#' is escaped\n\n if (hash > 0 && line.indexOf(\"\\\\#\") == hash - 1) {\n\n // Yes, it is\n\n // System.err.println( \"Raw: '\"+line+\"'\" );\n line = line.substring(0, hash - 1) + line.substring(hash, line.length());\n // System.err.println( \"Unescaped: '\"+line+\"'\" );\n\n } else {\n\n line = line.substring(0, hash);\n }\n }\n\n // Trim it\n\n line = line.trim();\n\n if (line.length() != 0) {\n\n return line;\n }\n }\n }", "public static String readFileToString (File file) {\n try {\n final var END_OF_FILE = \"\\\\z\";\n var input = new Scanner(file);\n input.useDelimiter(END_OF_FILE);\n var result = input.next();\n input.close();\n return result;\n }\n catch(IOException e){\n return \"\";\n }\n }", "private String readLine(BufferedReader br) throws IOException {\n StringBuffer sb = new StringBuffer();\n boolean haveCR = false;\n boolean done = false;\n int i;\n char c;\n \n while((i = br.read()) != -1) {\n c = (char)i;\n \n if(haveCR) {\n switch(c) {\n case '\\n':\n sb.append(c);\n done = true;\n break;\n default:\n br.reset();\n done = true;\n break;\n }\n }\n else {\n sb.append(c);\n switch(c) {\n case '\\n':\n done = true;\n break;\n case '\\r':\n br.mark(1);\n haveCR = true;\n }\n }\n \n if(done) {\n break;\n }\n }\n\n return sb.length() > 0 ? sb.toString() : null;\n }", "public ReversedLinesFileReader(File file, int blockSize, Charset encoding) throws IOException {\n/* 96 */ this.blockSize = blockSize;\n/* 97 */ this.encoding = encoding;\n/* */ \n/* */ \n/* 100 */ Charset charset = Charsets.toCharset(encoding);\n/* 101 */ CharsetEncoder charsetEncoder = charset.newEncoder();\n/* 102 */ float maxBytesPerChar = charsetEncoder.maxBytesPerChar();\n/* 103 */ if (maxBytesPerChar == 1.0F)\n/* */ \n/* 105 */ { this.byteDecrement = 1; }\n/* 106 */ else if (charset == Charsets.UTF_8)\n/* */ \n/* */ { \n/* 109 */ this.byteDecrement = 1; }\n/* 110 */ else if (charset == Charset.forName(\"Shift_JIS\") || charset == Charset.forName(\"windows-31j\") || charset == Charset.forName(\"x-windows-949\") || charset == Charset.forName(\"gbk\") || charset == Charset.forName(\"x-windows-950\"))\n/* */ \n/* */ { \n/* */ \n/* */ \n/* */ \n/* 116 */ this.byteDecrement = 1; }\n/* 117 */ else if (charset == Charsets.UTF_16BE || charset == Charsets.UTF_16LE)\n/* */ \n/* */ { \n/* 120 */ this.byteDecrement = 2; }\n/* 121 */ else { if (charset == Charsets.UTF_16) {\n/* 122 */ throw new UnsupportedEncodingException(\"For UTF-16, you need to specify the byte order (use UTF-16BE or UTF-16LE)\");\n/* */ }\n/* */ \n/* 125 */ throw new UnsupportedEncodingException(\"Encoding \" + encoding + \" is not supported yet (feel free to \" + \"submit a patch)\"); }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 130 */ this.newLineSequences = new byte[][] { \"\\r\\n\".getBytes(encoding), \"\\n\".getBytes(encoding), \"\\r\".getBytes(encoding) };\n/* */ \n/* 132 */ this.avoidNewlineSplitBufferSize = (this.newLineSequences[0]).length;\n/* */ \n/* */ \n/* 135 */ this.randomAccessFile = new RandomAccessFile(file, \"r\");\n/* 136 */ this.totalByteLength = this.randomAccessFile.length();\n/* 137 */ int lastBlockLength = (int)(this.totalByteLength % blockSize);\n/* 138 */ if (lastBlockLength > 0) {\n/* 139 */ this.totalBlockCount = this.totalByteLength / blockSize + 1L;\n/* */ } else {\n/* 141 */ this.totalBlockCount = this.totalByteLength / blockSize;\n/* 142 */ if (this.totalByteLength > 0L) {\n/* 143 */ lastBlockLength = blockSize;\n/* */ }\n/* */ } \n/* 146 */ this.currentFilePart = new FilePart(this.totalBlockCount, lastBlockLength, null);\n/* */ }", "@Test\n void testRead() throws IOException, URISyntaxException {\n final String[] expectedResult = {\n \"-199\t\\\"hello\\\"\t2013-04-08 13:14:23\t2013-04-08 13:14:23\t2017-06-20\t\\\"2017/06/20\\\"\t0.0\t1\t\\\"2\\\"\t\\\"823478788778713\\\"\",\n \"2\t\\\"Sdfwer\\\"\t2013-04-08 13:14:23\t2013-04-08 13:14:23\t2017-06-20\t\\\"1100/06/20\\\"\tInf\t2\t\\\"NaN\\\"\t\\\",1,2,3\\\"\",\n \"0\t\\\"cjlajfo.\\\"\t2013-04-08 13:14:23\t2013-04-08 13:14:23\t2017-06-20\t\\\"3000/06/20\\\"\t-Inf\t3\t\\\"inf\\\"\t\\\"\\\\casdf\\\"\",\n \"-1\t\\\"Mywer\\\"\t2013-04-08 13:14:23\t2013-04-08 13:14:23\t2017-06-20\t\\\"06-20-2011\\\"\t3.141592653\t4\t\\\"4.8\\\"\t\\\"  \\\\\\\" \\\"\",\n \"266128\t\\\"Sf\\\"\t2013-04-08 13:14:23\t2013-04-08 13:14:23\t2017-06-20\t\\\"06-20-1917\\\"\t0\t5\t\\\"Inf+11\\\"\t\\\"\\\"\",\n \"0\t\\\"null\\\"\t2013-04-08 13:14:23\t2013-04-08 13:14:23\t2017-06-20\t\\\"03/03/1817\\\"\t123\t6.000001\t\\\"11-2\\\"\t\\\"\\\\\\\"adf\\\\0\\\\na\\\\td\\\\nsf\\\\\\\"\\\"\",\n \"-2389\t\\\"\\\"\t2013-04-08 13:14:23\t2013-04-08 13:14:72\t2017-06-20\t\\\"2017-03-12\\\"\tNaN\t2\t\\\"nap\\\"\t\\\"💩⌛👩🏻■\\\"\"};\n BufferedReader result;\n File file = getFile(\"csv/ingest/IngestCSV.csv\");\n try (FileInputStream fileInputStream = new FileInputStream(file);\n BufferedInputStream stream = new BufferedInputStream(fileInputStream)) {\n CSVFileReader instance = createInstance();\n File outFile = instance.read(Tuple.of(stream, file), null).getTabDelimitedFile();\n result = new BufferedReader(new FileReader(outFile));\n }\n\n assertThat(result).isNotNull();\n assertThat(result.lines().collect(Collectors.toList())).isEqualTo(Arrays.asList(expectedResult));\n }", "private String[] readLine(BufferedReader r) throws IOException\r\n\t{\r\n\t\tSystem.out.print(\"> \");\r\n\t\tfinal String line = r.readLine();\r\n\t\treturn line != null ? split(line) : null;\r\n\t}", "@Override\n public String readFile(BufferedReader reader)\n {\n try\n {\n StringBuffer strLine = new StringBuffer();\n String line;\n\n while ((line = reader.readLine()) != null)\n {\n if (!line.startsWith(\"--\", 0))\n {\n strLine.append(line);\n\n // use ; as the command delimiter and execute the query on the database.\n if (line.endsWith(\";\"))\n {\n super.exeQuery(strLine.toString());\n strLine = new StringBuffer();\n }\n }\n }\n\n return strLine.toString();\n }\n catch (IOException ioex)\n {\n logger.error(\"Error reading contents from file.\");\n return null;\n }\n }", "String readText(FsPath path);", "private void ReadInputFile(String filePath){\n String line;\n\n try{\n BufferedReader br = new BufferedReader(new FileReader(filePath));\n while((line = br.readLine()) != null){\n //add a return at each index\n inputFile.add(line + \"\\r\");\n }\n\n\n }catch(IOException ex){\n System.out.print(ex);\n }\n\n }", "private void openAndReadFile() throws IOException {\n\t\tFileReader fr = new FileReader(path);\n\t\tBufferedReader textreader = new BufferedReader(fr);\n\t\tString line;\n\t\tString[] parsedLine;\n\t\twhile ((line = textreader.readLine()) != null) {\n\t\t\tparsedLine = pattern.split(line);\n\t\t\tif (parsedLine.length == 2) {\n\t\t\t\tfileData.put(parsedLine[0], parsedLine[1]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Couldn't read line \" + line + \" in \" + path);\n\t\t\t}\n\t\t}\n\t\ttextreader.close();\n\t\tfr.close();\n\t}", "private static String[] rms(BufferedReader br) throws IOException {\n return br.readLine().split(SPLIT_CHAR);\n }", "private void ReadTextFile(String FilePath) {\n\t\t\n\t\t\n\t}", "List<String[]> readCsv(String inputFilePath, char separator)throws IOException;", "public static String[] parseLines(String text)\n {\n return StringTools.parseStringArray(text, \"\\r\\n\");\n }", "private void parseLrc(String filepathname) throws LrcFileNotFoundException,\n LrcFileUnsupportedEncodingException,\n LrcFileIOException,\n LrcFileInvalidFormatException {\n String file = new String(filepathname);\n\n // dealing with different text file encodings.\n // (1) try reading BOM from text file\n FileInputStream lrcFileStream = null;\n try {\n lrcFileStream = new FileInputStream(new File(file));\n\n } catch (FileNotFoundException e) {\n // if failed to load at the same folder then try /sdcard/Music/Lyrics\n // change the path to specified folder\n Scanner s = new Scanner(file);\n String fileName = s.findInLine(Pattern.compile(\"(?!.*/).*\"));\n String anotherFile = new StringBuilder(mContext.getResources().getString(R.string.lrc_file_path)).append(fileName).toString();\n\n try {\n lrcFileStream = new FileInputStream(new File(anotherFile));\n file = anotherFile;\n\n } catch (FileNotFoundException ee) {\n throw new LrcFileNotFoundException(\n mContext.getResources().getString(R.string.lrc_file_not_found));\n }\n }\n\n BufferedInputStream bin = null;\n String code = null;\n try {\n bin = new BufferedInputStream(lrcFileStream);\n int p = (bin.read() << 8) + bin.read(); // first 2 bytes\n int q = bin.read(); // 3rd byte\n\n // first check to see if it's Unicode Transition Format (UTF-8, UTF-16)\n switch (p) {\n // first check UTF-8 with BOM\n case 0xefbb:\n if (q == 0xbf) {\n code = \"UTF-8\"; // on windows, UTF-8 text files have a BOM: \"EF BB BF\";\n } else {\n code = \"UNKNOWN\"; // however, on linux, there's no BOM for UTF-8\n }\n break;\n\n // UTF-16 with BOM\n case 0xfffe: // little endian\n case 0xfeff: // big endian\n code = \"UTF-16\"; // the Scanner can recognize big endian or little endian\n break;\n\n default:\n code = \"UNKNOWN\";\n break;\n }\n\n } catch (IOException e) {\n MusicLogUtils.d(TAG, \"parseLrc : I/O error when reading .lrc file\");\n throw new LrcFileIOException(\n mContext.getResources().getString(R.string.lrc_file_io_error));\n }\n\n // (2) if no BOM detected, we don't know if it's Unicode or ISO-8859-1 compatible encoding\n // try firstly to detect UTF-8 without BOM\n // by going through all the text file to see if there's one \"character unit\" that does not \n // match the UTF-8 encoding rule.\n if (\"UNKNOWN\".equals(code)) {\n try {\n lrcFileStream = new FileInputStream(new File(file));\n\n } catch (FileNotFoundException e) {\n throw new LrcFileNotFoundException(\n mContext.getResources().getString(R.string.lrc_file_not_found));\n }\n\n try {\n bin = new BufferedInputStream(lrcFileStream);\n byte[] value = new byte[3];\n int result = 1;\n\n boolean isUTF8 = true;\n int byte1 = 0;\n int byte2 = 0;\n int byte3 = 0;\n while (result > 0) {\n result = bin.read(value, 0, 1);\n if (result <= 0) {\n break;\n }\n\n byte1 = value[0] & 0xff;\n if ((byte1 <= 0x7f) && (byte1 >= 0x01)) {\n // matches 1 byte encoding\n continue;\n } else {\n // need read one more byte\n result = bin.read(value, 1, 1);\n if (result <= 0) {\n break;\n }\n\n byte2 = value[1] & 0xff;\n if ((byte1 <= 0xdf) && (byte1 >= 0xc0)\n && (byte2 <= 0xbf) && (byte2 >= 0x80)) {\n // matches 2 bytes encoding\n continue;\n } else {\n // need read one more byte\n result = bin.read(value, 2, 1);\n if (result <= 0) {\n break;\n }\n \n byte3 = value[2] & 0xff;\n if ((byte1 <= 0xef) && (byte1 >= 0xe0) && (byte2 <= 0xbf)\n && (byte2 >= 0x80) && (byte3 <= 0xbf) && (byte3 >= 0x80)) {\n continue;\n } else {\n // don't match any of this it should not be UTF-8\n isUTF8 = false;\n break;\n }\n }\n }\n\n }\n \n\n if (isUTF8) {\n code = \"UTF-8\"; // if detected as UTF-8 then change the \"UNKNOWN\" result\n }\n\n } catch (IOException e) {\n MusicLogUtils.d(TAG, \"parseLrc : I/O error when reading .lrc file\");\n throw new LrcFileIOException(\n mContext.getResources().getString(R.string.lrc_file_io_error));\n }\n }\n\n // if cannot be detected as Unicode series\n // then try with ISO-8859-1 compatible encoding according to device's default locale setting\n // create a scanner object according to the file name\n Scanner s = null;\n try {\n if (\"UNKNOWN\".equals(code)) {\n s = new Scanner(new File(file), LyricsLocale.defLocale2CharSet());\n } else {\n s = new Scanner(new File(file), code); // UTF-8 or UTF-16\n }\n\n } catch (FileNotFoundException e) {\n throw new LrcFileNotFoundException(\n mContext.getResources().getString(R.string.lrc_file_not_found));\n } catch (IllegalArgumentException e) { // when the defLocale2CharSet returns null\n MusicLogUtils.d(TAG, \"parseLrc : unsupported textual encoding\");\n throw new LrcFileUnsupportedEncodingException(\n mContext.getResources().getString(R.string.lrc_file_invalid_encoding));\n }\n\n // (3) scanner success, clean up\n mLyricContent.clear();\n\n // parse and add all possible lyrics sentences & information\n // the unrecognized lines in the file are omitted.\n while (s.hasNextLine()) {\n String next = s.nextLine(); // get a valid line\n if (next.length() < 1) {\n continue; // the empty line is omitted\n }\n\n // try to parse this line as a lyric sentence\n Integer[] integerArray = analyzeLrc(next);\n int len = integerArray.length;\n\n if (0 == len) { // no timeTag, thus it is a line of information or unrecognized line\n Scanner scn = new Scanner(next);\n\n // should match the .lrc file's \"infoTag\" format\n String info = scn.findInLine(\"\\\\[(al|ar|by|re|ti|ve):.*\\\\]\");\n if (null != info) { // if matches one of the info tags\n String tag = info.substring(1, 3);\n LyricSentence tmp = new LyricSentence(info.substring(4, info.length() - 1));\n if (tag.equals(\"al\") || tag.equals(\"AL\")) {\n mAlbumName = tmp;\n } else if (tag.equals(\"ar\") || tag.equals(\"AR\")) {\n mArtistName = tmp;\n } else if (tag.equals(\"by\") || tag.equals(\"BY\")) {\n mLyricAuthor = tmp;\n } else if (tag.equals(\"re\") || tag.equals(\"RE\")) {\n mLyricBuilder = tmp;\n } else if (tag.equals(\"ti\") || tag.equals(\"TI\")) {\n mTrackTitle = tmp;\n } else if (tag.equals(\"ve\") | tag.equals(\"VE\")) {\n mLyricBuilderVer = tmp;\n }\n } else { // it's possible to be \"offset\"\n String offset = scn.findInLine(\"\\\\[offset:[\\\\+|-]{1}\\\\d+\\\\]\");\n if (null != offset) { // if matches offset tag\n mAdjustMilliSec\n = Integer.parseInt(offset.substring(9, offset.length() - 1))\n * ( (offset.charAt(8) == '+') ? 1 : -1 );\n }\n }\n } else { // has time tags, then it's a line of lyrics sentence\n for (int k = 0; k < len; k++) {\n int time = integerArray[k].intValue();\n LyricSentence lrcSentence\n = new LyricSentence(resolveLrc(next), time + mAdjustMilliSec);\n mLyricContent.add(lrcSentence);\n }\n }\n }\n\n // sort the lyrics sentences as the sequence of time tags\n Collections.sort(mLyricContent);\n \n if (mLyricContent.isEmpty()) {\n throw new LrcFileInvalidFormatException(\n mContext.getResources().getString(R.string.lrc_file_invalid_format));\n }\n }", "public static void readWithFileReaderCharByChar(String filePath) throws IOException {\n try(FileReader reader = new FileReader(filePath)){\n int data;\n while((data = reader.read()) != -1){\n System.out.print((char) data);\n }\n }\n }", "protected java.lang.String readTo(char delim, boolean skipEscape) throws java.io.IOException {\n java.lang.StringBuilder result = new java.lang.StringBuilder();\n boolean escape = false;\n char c = curr();\n while (escape || c != delim) {\n if (c == '\\n' || c == '\\r') throw error();\n result.append(c);\n if (escape) escape = false;\n else if (skipEscape && c == '\\\\') escape = true;\n c = next();\n }\n next(); // skip delim\n return result.toString();\n }", "protected abstract Object readFile(BufferedReader buf) throws IOException, FileParseException;", "public String[] parseLine() {\n String[] tokens = null;\n try {\n tokens = csvReader.readNext();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return tokens;\n }", "private void ReadFile(String filePath) throws IOException{\n File file = new File(filePath);\n BufferedReader b = new BufferedReader(new FileReader(file));\n int lineNumber = 1;\n String line = \"\";\n line = b.readLine();\n while (line != null) {\n // analyze the line only when it is not empty and it is not a comment\n String trimLine = line.toString().trim();\n if(trimLine.length() != 0 && !trimLine.substring(0, 1).equals(\"/\") && !trimLine.substring(0, 1).equals(\"#\")){\n // line.toString().trim(): eliminate heading and tailing whitespaces\n // but add one whitespace to the end of the string to facilitate token manipulation\n // under the circumstances that there is only one token on one line, e.g. main\n AnalyzeByLine(line.toString().trim() + \" \", lineNumber);\n }\n lineNumber++;\n line = b.readLine();\n }\n arrL.add(new Token(\"end of file\", 255, lineNumber));\n// for(int i = 0; i < arrL.size(); i++){\n// System.out.println(arrL.get(i).getCharacters() + \" \" + arrL.get(i).getValue() + \" \" + arrL.get(i).getLineNum());\n// }\n }", "private static String readFile(String file) throws IOException {\n\n\t\tString line = null;\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\tString ls = System.getProperty(\"line.separator\");\n\n\t\ttry (BufferedReader reader = new BufferedReader(new FileReader(file))) {\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tstringBuilder.append(line);\n\t\t\t\tstringBuilder.append(ls);\n\t\t\t}\n\t\t}\n\n\t\treturn stringBuilder.toString();\n\t}", "public void readTextFile(String path) throws IOException {\n FileReader fileReader=new FileReader(path);\n BufferedReader bufferedReader=new BufferedReader(fileReader);\n String value=null;\n while((value=bufferedReader.readLine())!=null){\n System.out.println(value);\n }\n }", "private static String[] readFile(String file){\n\t\ttry{\n\t\t\tBufferedReader in = new BufferedReader(new FileReader(file));\n\t\t\tString line;\n\t\t\tString data = \"\";\n\t\t\twhile((line = in.readLine()) != null){\n\t\t\t\tdata = data + '\\n' + line;\t\t\t}\n\t\t\tin.close();\n\t\t\tString[] data_array = data.split(\"\\\\n\");\n\t\t\treturn data_array;\n\t\t}\n\t\tcatch(IOException e){\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\tString[] shouldNeverReturn = new String[1];\n\t\treturn shouldNeverReturn;\n\t}", "public TabbedLineReader(File inFile, char delimiter) throws IOException {\n this.openFile(inFile, delimiter);\n this.readHeader();\n }", "private String[] readFile(BufferedReader reader) throws IOException {\r\n // Read each line in the file, add it to the ArrayList lines\r\n ArrayList<String> lines = new ArrayList<String>();\r\n String line;\r\n while ((line = reader.readLine()) != null) {\r\n lines.add(line);\r\n }\r\n reader.close();\r\n // Convert the list to an array of type String and return\r\n String[] ret = new String[1];\r\n return (lines.toArray(ret));\r\n }", "public String readFromFile(String filePath){\n String fileData = \"\";\n try{\n File myFile = new File(filePath);\n Scanner myReader = new Scanner(myFile);\n while (myReader.hasNextLine()){\n String data = myReader.nextLine();\n fileData += data+\"\\n\";\n }\n myReader.close();\n } catch(FileNotFoundException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n return fileData;\n }", "private String readLine() throws IOException {\n/* 276 */ String line = null;\n/* */ \n/* */ \n/* 279 */ boolean isLastFilePart = (this.no == 1L);\n/* */ \n/* 281 */ int i = this.currentLastBytePos;\n/* 282 */ while (i > -1) {\n/* */ \n/* 284 */ if (!isLastFilePart && i < ReversedLinesFileReader.this.avoidNewlineSplitBufferSize) {\n/* */ \n/* */ \n/* 287 */ createLeftOver();\n/* */ \n/* */ break;\n/* */ } \n/* */ int newLineMatchByteCount;\n/* 292 */ if ((newLineMatchByteCount = getNewLineMatchByteCount(this.data, i)) > 0) {\n/* 293 */ int lineStart = i + 1;\n/* 294 */ int lineLengthBytes = this.currentLastBytePos - lineStart + 1;\n/* */ \n/* 296 */ if (lineLengthBytes < 0) {\n/* 297 */ throw new IllegalStateException(\"Unexpected negative line length=\" + lineLengthBytes);\n/* */ }\n/* 299 */ byte[] lineData = new byte[lineLengthBytes];\n/* 300 */ System.arraycopy(this.data, lineStart, lineData, 0, lineLengthBytes);\n/* */ \n/* 302 */ line = new String(lineData, ReversedLinesFileReader.this.encoding);\n/* */ \n/* 304 */ this.currentLastBytePos = i - newLineMatchByteCount;\n/* */ \n/* */ break;\n/* */ } \n/* */ \n/* 309 */ i -= ReversedLinesFileReader.this.byteDecrement;\n/* */ \n/* */ \n/* 312 */ if (i < 0) {\n/* 313 */ createLeftOver();\n/* */ \n/* */ break;\n/* */ } \n/* */ } \n/* */ \n/* 319 */ if (isLastFilePart && this.leftOver != null) {\n/* */ \n/* 321 */ line = new String(this.leftOver, ReversedLinesFileReader.this.encoding);\n/* 322 */ this.leftOver = null;\n/* */ } \n/* */ \n/* 325 */ return line;\n/* */ }", "public static List<String> readIn(String filename) throws Exception {\r\n Path filePath = new File(filename).toPath();\r\n Charset charset = Charset.defaultCharset(); \r\n List<String> stringList = Files.readAllLines(filePath, charset);\r\n\r\n return stringList;\r\n }", "default String[][] txtReader(String fileString) {\n\t\ttry {\n\t\t\tScanner myReader = new Scanner(new File(fileString));\n\t\t\tArrayList<String[]> lines = new ArrayList<>();\n\n\t\t\twhile (myReader.hasNextLine()) {\n\t\t\t\tString[] splitted = myReader.nextLine().split(\" \");\n\t\t\t\tlines.add(splitted);\n\t\t\t}\n\n\t\t\tString[][] result = new String[lines.size()][];\n\t\t\tfor (int i = 0; i < result.length; i++) {\n\t\t\t\tresult[i] = lines.get(i);\n\t\t\t}\n\t\t\treturn result;\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"file is not occurred \" + e.getMessage());\n\t\t}\n\t\treturn null;\n\n\t}", "public static void copyTextFileExact(String fromFileName, String toFileName) throws IOException {\n Pattern pat = Pattern.compile(\".*\\\\r|.+\\\\z\");\n\n try (var scanner = new Scanner(new BufferedReader(new FileReader(fromFileName)));\n var writer = new BufferedWriter((new FileWriter(toFileName)))) {\n\n String line;\n while ((line = scanner.findWithinHorizon(pat, 0)) != null) {\n writer.write(line);\n }\n }\n }", "public static List<String> readFile(String filepath) {\n BufferedReader reader = null;\n List<String> fileLines = new ArrayList<String>();\n try {\n File file = new File(filepath);\n String encoding = \"UTF8\";\n reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding));\n \n String line = reader.readLine();\n while (line != null) {\n fileLines.add(line);\n line = reader.readLine();\n }\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n reader.close();\n } catch (IOException e) {\n // Ignore exception because reader was not initialized\n }\n }\n return fileLines;\n }", "private String[] loadFile(String filename, String[] skipCharacters, String delimiter) {\n\t\tString path = \"/app/src/main/resources\" + File.separator + filename;\n\n\t\tString regex = \"\";\n\t\tif (skipCharacters.length > 0) {\n\t\t\tString skipString = String.join(\"|\", skipCharacters);\n\t\t\tskipString = skipString.replaceAll(\"(?=[]\\\\[+&!(){}^\\\"~*?:\\\\\\\\])\", \"\\\\\\\\\");\n\t\t\tregex = \"^(\" + skipString + \").*?\";\n\t\t}\n\n\t\tString[] lines = null;\n\t\tStringBuffer sb = new StringBuffer();\n\t\tBufferedReader br = null;\n\t\ttry {\n\t\t\tbr = new BufferedReader(new FileReader(path));\n\n\t\t\tString line = br.readLine();\n\t\t\twhile (line != null) {\n\t\t\t\tif (line.matches(regex)) {\n\t\t\t\t\tline = br.readLine();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tsb.append(line);\n\t\t\t\tsb.append(System.lineSeparator());\n\n\t\t\t\tline = br.readLine();\n\t\t\t}\n\n\t\t\t// Break content by delimiter\n\t\t\tlines = sb.toString().split(delimiter);\n\t\t} catch (IOException ex) {\n\t\t\tlogger.error(ex);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null) {\n\t\t\t\t\tbr.close();\n\t\t\t\t}\n\t\t\t} catch (IOException ex) {\n\t\t\t\tlogger.error(ex);\n\t\t\t}\n\t\t}\n\n\t\treturn lines;\n\t}", "List<String[]> readCsv(String inputFilePath,int skipLine,char separator)throws IOException;", "private static String readFile(String file) throws IOException { //Doesn't work - possible error with FileReader\n //BufferedReader reader = new BufferedReader(new FileReader(file));\n //FileReader reader=new FileReader(file);\n\n\n FileReader file2 = new FileReader(file);\n System.out.println(\"Inside readFile\");\n BufferedReader buffer = new BufferedReader(file2);\n\n\n\n //String line = null;\n String line=\"\";\n\n StringBuilder stringBuilder = new StringBuilder();\n String ls = System.getProperty(\"line.separator\");\n try {\n while ((line = buffer.readLine()) != null) {\n System.out.println(line);\n stringBuilder.append(line);\n stringBuilder.append(ls);\n }\n return stringBuilder.toString();\n\n }finally{\n buffer.close();//https://stackoverflow.com/questions/326390/how-do-i-create-a-java-string-from-the-contents-of-a-file\n }\n /*Scanner scanner = null;\n scanner = new Scanner(file);\n StringBuilder stringBuilder = new StringBuilder();\n while (scanner.hasNextLine()) {\n String line = scanner.nextLine();\n stringBuilder.append(line);\n\n System.out.println(\"line: \"+line);\n }\n return stringBuilder.toString();*/\n\n }", "@SuppressWarnings(\"resource\")\n\tpublic static String readData(String filePath) {\n\n\t\tFile data = new File(filePath); // sets the file data to be the data in the text file\n\t\tBufferedReader br = null; // creates a reference to a buffered reader called 'br' that is not pointing anywhere\n\n\t\tFileReader fr; // creates a reference to a filereader called 'fr'\n\t\ttry {\n\t\t\tfr = new FileReader(data); // creates a new filereader instance\n\t\t\tbr = new BufferedReader(fr); // creates a new bufferedreader\n\t\t\t\t\t\t\t\t\t\t\t// instance\n\t\t\tString line; // create a new String called 'line'\n\t\t\t// ArrayList<String> list = new ArrayList<>();\n\t\t\tString totalInput = \"$\"; // creates a new String called 'totalInput' which is empty\n\n\t\t\twhile ((line = br.readLine()) != null) { // start a while loop that will continue until there is not text left\n\t\t\t\ttotalInput += line + \"-\"; // updates the totalInput String to include the next line of text read in from the file and then start a new line\n\t\t\t}\n\t\t\treturn totalInput; // when the while loop finishes returns the totalInput String\n\t\t}\n\n\t\tcatch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"File not found: \" + data.toString());\n\t\t}\n\n\t\tcatch (IOException e) {\n\t\t\tSystem.out.println(\"Unable to read file: \" + data.toString());\n\t\t}\n\n\t\tfinally {\n\t\t\t\n\t\t}\n\t\treturn null;\n\n\t}", "private static List<String[]> readInput(String filePath) {\n List<String[]> result = new ArrayList<>();\n int numOfObject = 0;\n\n try {\n Scanner sc = new Scanner(new File(filePath));\n sc.useDelimiter(\"\");\n if (sc.hasNext()) {\n numOfObject = Integer.parseInt(sc.nextLine());\n }\n for (int i=0;i<numOfObject;i++) {\n if (sc.hasNext()) {\n String s = sc.nextLine();\n if (s.trim().isEmpty()) {\n continue;\n }\n result.add(s.split(\" \"));\n }\n }\n sc.close();\n }\n catch (FileNotFoundException e) {\n System.out.println(\"FileNotFoundException\");\n }\n return result;\n }", "private static String[] readLines(InputStream f) throws IOException {\n\t\tBufferedReader r = new BufferedReader(new InputStreamReader(f, \"US-ASCII\"));\n\t\tArrayList<String> lines = new ArrayList<String>();\n\t\tString line;\n\t\twhile ((line = r.readLine()) != null)\n\t\t\tlines.add(line);\n\t\treturn lines.toArray(new String[0]);\n\t}", "private ArrayList<String> readStringsFromFile(File f, String stringSeparator)\r\n\t\t\tthrows EasyCorrectionException {\r\n\t\tArrayList<String> contentOfFile = new ArrayList<String>();\r\n\t\tbyte[] buffer = new byte[(int) f.length()];\r\n\t\tBufferedInputStream stream = null;\r\n\t\ttry {\r\n\t\t\tstream = new BufferedInputStream(new FileInputStream(f));\r\n\t\t\tstream.read(buffer);\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new EasyCorrectionException(\"The file \" + f.getName()\r\n\t\t\t\t\t+ \" could not be read during the Output Comparison!\");\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif (stream != null) {\r\n\t\t\t\t\tstream.close();\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tthrow new EasyCorrectionException(\"The file \" + f.getName()\r\n\t\t\t\t\t\t+ \" could not be closed during the Output Comparison!\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (String string : new String(buffer).split(stringSeparator)) {\r\n\t\t\tcontentOfFile.add(string);\r\n\t\t}\r\n\r\n\t\treturn contentOfFile;\r\n\t}", "public String readFile(String filename)\n {\n StringBuilder texts = new StringBuilder();\n \n try \n {\n FileReader inputFile = new FileReader(filename);\n Scanner parser = new Scanner(inputFile);\n \n while (parser.hasNextLine())\n {\n String line = parser.nextLine();\n texts.append(line + \";\");\n }\n \n inputFile.close();\n parser.close();\n return texts.toString();\n \n }\n \n catch(FileNotFoundException exception) \n {\n String error = filename + \" not found\";\n System.out.println(error);\n return error;\n }\n \n catch(IOException exception) \n {\n String error = \"Unexpected I/O error occured\";\n System.out.println(error); \n return error;\n } \n }", "private String readString( InputStream stream ) throws IOException {\n char delimiter = (char) stream.read();\n buffer = new StringBuffer();\n while ( true ) {\n int c = stream.read();\n if ( c == delimiter ) {\n break;\n }\n else {\n switch ( (char) c ) {\n case '\\r':\n case '\\n':\n throw new TableFormatException(\n \"End of line within a string literal\" );\n case '\\\\':\n buffer.append( (char) stream.read() );\n break;\n case END:\n throw new TableFormatException(\n \"End of file within a string literal\" );\n default:\n buffer.append( (char) c );\n }\n }\n }\n return buffer.toString();\n }", "public String readFile(){\r\n StringBuffer str = new StringBuffer(); //StringBuffer is a mutable string\r\n Charset charset = Charset.forName(\"UTF-8\"); //UTF-8 character encoding\r\n Path file = Paths.get(filename + \".txt\");\r\n try (BufferedReader reader = Files.newBufferedReader(file, charset)) { // Buffer: a memory area that buffered streams read\r\n String line = null;\r\n while ((line = reader.readLine()) != null) { //Readers and writers are on top of streams and converts bytes to characters and back, using a character encoding\r\n str.append(line + \"\\n\");\r\n }\r\n }\r\n catch (IOException x) {\r\n System.err.format(\"IOException: %s%n\", x);\r\n }\r\n return str.toString();\r\n }", "@SuppressWarnings(\"unused\")\n private String readFile(File f) throws IOException {\n BufferedReader reader = new BufferedReader(new FileReader(f));\n String line = reader.readLine();\n StringBuilder builder = new StringBuilder();\n while (line != null) {\n builder.append(line).append('\\n');\n line = reader.readLine();\n }\n reader.close();\n return builder.toString();\n }", "public void fileWriterReader() throws Exception {\n\t\tFileReader fr = new FileReader(\"C:\\\\Users\\\\rbajya.ORADEV\\\\Desktop\\\\Testing.txt\");\n//\t\tchar [] arr = {};\n//\t\tfr.read(arr);\n//\t\tSystem.out.println(Arrays.toString(arr));\n\t\t\n\t\tint i=0;\n\t\twhile((i=fr.read())!=-1){\n\t\t\tchar ch = (char)i;\n\t\t\tif(ch=='\\n'){\n\t\t\t\tSystem.out.print(ch);\n\t\t\t}else if(ch=='/'){\n\t\t\t\tchar ch1 = (char)fr.read();\n\t\t\t\tif(ch1=='/'){\n\t\t\t\t\tSystem.out.print(\"//\");\n\t\t\t\t\tint j=0;\n\t\t\t\t\twhile((j=fr.read())!=-1){\n\t\t\t\t\t\tSystem.out.print((char)j);\n\t\t\t\t\t\tif((char)j=='\\n'){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(ch1=='*'){\n\t\t\t\t\tSystem.out.print(\"/*\");\n\t\t\t\t\tint j=0;\n\t\t\t\t\twhile((j=fr.read())!=-1){\n\t\t\t\t\t\tSystem.out.print((char)j);\n\t\t\t\t\t\tif((char)j=='*'){\n\t\t\t\t\t\t\tint k = fr.read();\n\t\t\t\t\t\t\tif('/'==(char)k){\n\t\t\t\t\t\t\t\tSystem.out.println(\"/\");\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tSystem.out.println((char)k);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tSystem.out.print(' ');\n\t\t\t}\n\t\t}\n\t\t\n\t}", "protected String openReadFile(Path filePath) throws IOException{\n\t\tString line;\n\t\tStringBuilder sb = new StringBuilder();\n\t\t// Read the document\n\t\tBufferedReader reader = Files.newBufferedReader(filePath, ENCODING);\n\t\t// Append each line in the document to our string\n\t\twhile ((line = reader.readLine()) != null) {\n\t\t\tsb.append(line);\n\t\t\tsb.append(\"\\n\"); // readLine discards new-row characters, re-append them.\n\t\t}\n\t\tif(sb.length() != 0){\n\t\t\tsb.deleteCharAt(sb.length()-1); // However last line doesn't contain one, remove it.\n\t\t}\n\t\treader.close();\n\t\treturn new String(sb.toString());\n\t}", "public String[] ReadAllFileLines(String sFilePath) throws Exception {\n File f = null;\n FileInputStream fstream = null;\n DataInputStream in = null;\n BufferedReader br = null;\n String strLine = \"\";\n String[] stemp = null;\n StringBuffer strbuff = new StringBuffer();\n try {\n //getting file oject\n f = new File(sFilePath);\n if (f.exists()) {\n //get object for fileinputstream\n fstream = new FileInputStream(f);\n // Get the object of DataInputStream\n in = new DataInputStream(fstream);\n //get object for bufferreader\n br = new BufferedReader(new InputStreamReader(in, \"UTF-8\"));\n //Read File Line By Line\n while ((strLine = br.readLine()) != null) {\n strbuff.append(strLine + \"##NL##\");\n }\n\n stemp = strbuff.toString().split(\"##NL##\");\n } else {\n throw new Exception(\"File Not Found!!\");\n }\n\n return stemp;\n } catch (Exception e) {\n throw new Exception(\"ReadAllFileLines : \" + e.toString());\n } finally {\n //Close the input stream\n try {\n br.close();\n } catch (Exception e) {\n }\n try {\n fstream.close();\n } catch (Exception e) {\n }\n try {\n in.close();\n } catch (Exception e) {\n }\n }\n }", "private Object[] fetchTextFile(String filePathString){\n try (Stream<String> stream = Files.lines(Paths.get(filePathString))) {\n return stream.toArray();\n }\n catch (IOException ioe){\n System.out.println(\"Could not find file at \" + filePathString);\n return null;\n }\n\n }", "protected String[] splitMVSLine(String raw) {\n if (raw == null) {\n return new String[] {};\n }\n StringTokenizer st = new StringTokenizer(raw);\n String[] rtn = new String[st.countTokens()];\n int i = 0;\n while (st.hasMoreTokens()) {\n String nextToken = st.nextToken();\n rtn[i] = nextToken.trim();\n i++;\n }\n return rtn;\n }", "private String scanString(char[] input,\n int offset,\n int end,\n int[] lineNr)\n throws XMLParseException {\n char delim = input[offset];\n\n if ((delim == '\"') || (delim == '\\'')) {\n int begin = offset;\n offset++;\n\n while ((offset < end) && (input[offset] != delim)) {\n if (input[offset] == '\\r') {\n lineNr[0]++;\n\n if ((offset != end) && (input[offset + 1] == '\\n')) {\n offset++;\n }\n }\n else if (input[offset] == '\\n') {\n lineNr[0]++;\n }\n\n offset++;\n }\n\n if (offset == end) {\n return null;\n }\n else {\n return new String(input, begin, offset - begin + 1);\n }\n }\n else {\n return this.scanIdentifier(input, offset, end);\n }\n }", "@Override\n public List<Object> readFile(File file) {\n Scanner scanner = createScanner(file);\n if (Objects.isNull(scanner)) {\n return Collections.emptyList();\n }\n List<Object> readingDTOList = new ArrayList<>();\n scanner.nextLine();\n List<List<String>> allLines = new ArrayList<>();\n while (scanner.hasNext()) {\n List<String> line = parseLine((scanner.nextLine()));\n if (!line.isEmpty()) {\n allLines.add(line);\n }\n }\n if (!allLines.isEmpty()) {\n for (List<String> line : allLines) {\n String sensorId = line.get(0);\n String dateTime = line.get(1);\n String value = line.get(2);\n String unit = line.get(3);\n LocalDateTime readingDateTime;\n if (sensorId.contains(\"RF\")) {\n LocalDate readingDate = LocalDate.parse(dateTime, DateTimeFormatter.ofPattern(\"dd/MM/uuuu\"));\n readingDateTime = readingDate.atStartOfDay();\n } else {\n ZonedDateTime zonedDateTime = ZonedDateTime.parse(dateTime);\n readingDateTime = zonedDateTime.toLocalDateTime();\n }\n double readingValue = Double.parseDouble(value);\n ReadingDTO readingDTO = ReadingMapper.mapToDTOwithIDandUnits(sensorId, readingDateTime, readingValue, unit);\n readingDTOList.add(readingDTO);\n }\n }\n return readingDTOList;\n }", "public static String readWholeFile(String filename) {\n\t\t \n\t\t \n\t\t \n\t\ttry {\n\t\t\tScanner scanner = new Scanner(new File(filename));\n\t\t\t //scanner.useDelimiter(\"\\\\Z\");\n\t\t\t String returnString = \"\";\n\t\t\t while (scanner.hasNextLine()) {\n\t\t\t\t returnString += scanner.nextLine();\n\t\t\t\t returnString += System.lineSeparator();\n\t\t\t }\n\t\t\t \n\t\t\t return returnString;\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t\t \n\t\t \n\t\t }", "protected void handleReaderImport(Reader in, JTextComponent c, boolean useRead)\n throws BadLocationException, IOException {\n if (useRead) {\n int startPosition = c.getSelectionStart();\n int endPosition = c.getSelectionEnd();\n int length = endPosition - startPosition;\n EditorKit kit = c.getUI().getEditorKit(c);\n Document doc = c.getDocument();\n if (length > 0) {\n doc.remove(startPosition, length);\n }\n kit.read(in, doc, startPosition);\n } else {\n char[] buff = new char[1024];\n int nch;\n boolean lastWasCR = false;\n int last;\n StringBuilder sbuff = null;\n\n // Read in a block at a time, mapping \\r\\n to \\n, as well as single\n // \\r to \\n.\n while ((nch = in.read(buff, 0, buff.length)) != -1) {\n if (sbuff == null) {\n sbuff = new StringBuilder(nch);\n }\n last = 0;\n for(int counter = 0; counter < nch; counter++) {\n switch(buff[counter]) {\n case '\\r':\n if (lastWasCR) {\n if (counter == 0) {\n sbuff.append('\\n');\n } else {\n buff[counter - 1] = '\\n';\n }\n } else {\n lastWasCR = true;\n }\n break;\n case '\\n':\n if (lastWasCR) {\n if (counter > (last + 1)) {\n sbuff.append(buff, last, counter - last - 1);\n }\n // else nothing to do, can skip \\r, next write will\n // write \\n\n lastWasCR = false;\n last = counter;\n }\n break;\n default:\n if (lastWasCR) {\n if (counter == 0) {\n sbuff.append('\\n');\n } else {\n buff[counter - 1] = '\\n';\n }\n lastWasCR = false;\n }\n break;\n }\n }\n if (last < nch) {\n if (lastWasCR) {\n if (last < (nch - 1)) {\n sbuff.append(buff, last, nch - last - 1);\n }\n } else {\n sbuff.append(buff, last, nch - last);\n }\n }\n }\n if (lastWasCR) {\n sbuff.append('\\n');\n }\n c.replaceSelection(sbuff != null ? sbuff.toString() : \"\");\n }\n }", "public String[] readLines() {\n\t\tVector linesVector = new Vector(); ;\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(file);\n\t\t\tBufferedReader b = new BufferedReader(fr);\n\t\t\tboolean eof = false;\n\t\t\twhile (!eof) {\n\t\t\t\tString line = b.readLine();\n\t\t\t\tif (line == null) {\n\t\t\t\t\teof = true;\n\t\t\t\t} else {\n\t\t\t\t\tlinesVector.add(line);\n\t\t\t\t}\n\t\t\t}\n\t\t\tb.close();\n\t\t} catch (IOException e) {\n\t\t\tthrow new IllegalArgumentException(\"File \" + file.getName() +\n\t\t\t\t\" is unreadable : \" + e.toString());\n\t\t}\n\t\tString[] lines = new String[linesVector.size()];\n\t\tfor (int i = 0; i < lines.length; i++) {\n\t\t\tlines[i] = (String) (linesVector.get(i));\n\t\t}\n\t\treturn lines;\n\t}", "private void openFile(File inFile, char delimiter) throws IOException {\n this.delim = delimiter;\n this.stream = new FileInputStream(inFile);\n this.reader = new LineReader(this.stream);\n }", "@Test\n public void testReadLineLFCR1() throws IOException {\n try {\n final String BUFFER_INITIAL_CONTENT = \"Debut\\rSuite\\n\\rFin\\n\\r\\nANEPASTOUCHER\";\n ByteBuffer buff = ByteBuffer.wrap(BUFFER_INITIAL_CONTENT.getBytes(\"ASCII\")).compact();\n //HTTPReader reader = new HTTPReader(null, buff);\n //assertEquals(\"Debut\\rSuite\\n\\rFin\\n\", reader.readLineCRLF());\n ByteBuffer buffFinal = ByteBuffer.wrap(\"ANEPASTOUCHER\".getBytes(\"ASCII\")).compact();\n // assertEquals(buffFinal.flip(), buff.flip());\n } catch (NullPointerException e) {\n // fail(\"The socket must not be read until buff is entirely consumed.\");\n }\n }", "private String readFile(File file){\n StringBuilder stringBuffer = new StringBuilder();\n BufferedReader bufferedReader = null;\n\n try {\n\n bufferedReader = new BufferedReader(new FileReader(file));\n\n String text;\n while ((text = bufferedReader.readLine()) != null) {\n stringBuffer.append(text.replaceAll(\"\\t\", miTab) + \"\\n\");\n }\n\n } catch (FileNotFoundException ex) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n try {\n bufferedReader.close();\n } catch (IOException ex) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n\n return stringBuffer.toString();\n }", "private String readString() throws ParseException {\n int stringStart = pos;\n while (pos < length) {\n char c = src.charAt(pos++);\n if (c <= '\\u001F') {\n throw new ParseException(\"String contains control character\");\n } else if (c == '\\\\') {\n break;\n } else if (c == '\"') {\n return src.substring(stringStart, pos - 1);\n }\n }\n\n /*\n * Slow case: string contains escaped characters. Copy a maximal sequence\n * of unescaped characters into a temporary buffer, then an escaped\n * character, and repeat until the entire string is consumed.\n */\n StringBuilder b = new StringBuilder();\n while (pos < length) {\n assert src.charAt(pos - 1) == '\\\\';\n b.append(src, stringStart, pos - 1);\n if (pos >= length) {\n throw new ParseException(\"Unterminated string\");\n }\n char c = src.charAt(pos++);\n switch (c) {\n case '\"':\n b.append('\"');\n break;\n case '\\\\':\n b.append('\\\\');\n break;\n case '/':\n b.append('/');\n break;\n case 'b':\n b.append('\\b');\n break;\n case 'f':\n b.append('\\f');\n break;\n case 'n':\n b.append('\\n');\n break;\n case 'r':\n b.append('\\r');\n break;\n case 't':\n b.append('\\t');\n break;\n case 'u':\n if (length - pos < 5) {\n throw new ParseException(\"Invalid character code: \\\\u\" + src.substring(pos));\n }\n int code = fromHex(src.charAt(pos + 0)) << 12\n | fromHex(src.charAt(pos + 1)) << 8\n | fromHex(src.charAt(pos + 2)) << 4\n | fromHex(src.charAt(pos + 3));\n if (code < 0) {\n throw new ParseException(\"Invalid character code: \" + src.substring(pos, pos + 4));\n }\n pos += 4;\n b.append((char) code);\n break;\n default:\n throw new ParseException(\"Unexpected character in string: '\\\\\" + c + \"'\");\n }\n stringStart = pos;\n while (pos < length) {\n c = src.charAt(pos++);\n if (c <= '\\u001F') {\n throw new ParseException(\"String contains control character\");\n } else if (c == '\\\\') {\n break;\n } else if (c == '\"') {\n b.append(src, stringStart, pos - 1);\n return b.toString();\n }\n }\n }\n throw new ParseException(\"Unterminated string literal\");\n }", "public String readFromFile() throws IOException {\n return br.readLine();\n }", "public static List<String> processFileLineByLine(MultipartFile file) throws IOException {\n try(BufferedReader fileBufferReader = new BufferedReader(new InputStreamReader(file.getInputStream()))) {\n return fileBufferReader.lines().collect(Collectors.toList());\n }\n }", "public String[] openFile() throws IOException\n\t{\n\t\t//Creates a FileReader and BufferedReader to read from the file that you pass it\n\t\tFileReader fr = new FileReader(path);\n\t\tBufferedReader textReader = new BufferedReader(fr);\n\t\t\n\t\t//Set the variable to the number of lines in the text file through the function in this class that is defined below\n\t\tnumberOfLines = readLines();\n\t\t//Creates an array of strings with size of how many lines of data there are in the file\n\t\tString[] textData = new String[numberOfLines];\n\t\t\n\t\t//Loop to read the lines from the text file for the song data\n\t\tfor (int i = 0; i < numberOfLines; i++)\n\t\t{\n\t\t\t//Read data from song file and into the string list\n\t\t\ttextData[i] = textReader.readLine();\n\t\t}\n\t\t\n\t\t//Close the BufferedReader that was opened\n\t\ttextReader.close();\n\t\t\n\t\t//Return the read data from the text file in the form of a string array\n\t\treturn textData;\n\t}", "public final void mLINEBREAK() throws RecognitionException {\n try {\n int _type = LINEBREAK;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // Office.g:984:10: ( ( ( '\\\\r\\\\n' | '\\\\r' | '\\\\n' ) ) )\n // Office.g:985:2: ( ( '\\\\r\\\\n' | '\\\\r' | '\\\\n' ) )\n {\n // Office.g:985:2: ( ( '\\\\r\\\\n' | '\\\\r' | '\\\\n' ) )\n // Office.g:985:3: ( '\\\\r\\\\n' | '\\\\r' | '\\\\n' )\n {\n // Office.g:985:3: ( '\\\\r\\\\n' | '\\\\r' | '\\\\n' )\n int alt10=3;\n int LA10_0 = input.LA(1);\n\n if ( (LA10_0=='\\r') ) {\n int LA10_1 = input.LA(2);\n\n if ( (LA10_1=='\\n') ) {\n alt10=1;\n }\n else {\n alt10=2;\n }\n }\n else if ( (LA10_0=='\\n') ) {\n alt10=3;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 10, 0, input);\n\n throw nvae;\n\n }\n switch (alt10) {\n case 1 :\n // Office.g:985:4: '\\\\r\\\\n'\n {\n match(\"\\r\\n\"); \n\n\n\n }\n break;\n case 2 :\n // Office.g:985:13: '\\\\r'\n {\n match('\\r'); \n\n }\n break;\n case 3 :\n // Office.g:985:20: '\\\\n'\n {\n match('\\n'); \n\n }\n break;\n\n }\n\n\n }\n\n\n _channel = 99; \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n \t// do for sure before leaving\n }\n }", "@Test(timeout = 4000)\n public void test023() throws Throwable {\n StringReader stringReader0 = new StringReader(\"\\\"\\r\\\"\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 43, 43);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n // Undeclared exception!\n try { \n javaParserTokenManager0.getNextToken();\n fail(\"Expecting exception: Error\");\n \n } catch(Error e) {\n //\n // Lexical error at line 43, column 44. Encountered: \\\"\\\\r\\\" (13), after : \\\"\\\\\\\"\\\"\n //\n verifyException(\"com.soops.CEN4010.JMCA.JParser.JavaParserTokenManager\", e);\n }\n }", "public List<String> readFileContents(String filePath) throws APIException;", "public final void mNEWLINE() throws RecognitionException {\n try {\n int _type = NEWLINE;\n // /Users/benjamincoe/HackWars/C.g:168:9: ( ( '\\\\r\\\\n' | '\\\\r' | '\\\\n' ) )\n // /Users/benjamincoe/HackWars/C.g:169:5: ( '\\\\r\\\\n' | '\\\\r' | '\\\\n' )\n {\n // /Users/benjamincoe/HackWars/C.g:169:5: ( '\\\\r\\\\n' | '\\\\r' | '\\\\n' )\n int alt3=3;\n int LA3_0 = input.LA(1);\n\n if ( (LA3_0=='\\r') ) {\n int LA3_1 = input.LA(2);\n\n if ( (LA3_1=='\\n') ) {\n alt3=1;\n }\n else {\n alt3=2;}\n }\n else if ( (LA3_0=='\\n') ) {\n alt3=3;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"169:5: ( '\\\\r\\\\n' | '\\\\r' | '\\\\n' )\", 3, 0, input);\n\n throw nvae;\n }\n switch (alt3) {\n case 1 :\n // /Users/benjamincoe/HackWars/C.g:169:6: '\\\\r\\\\n'\n {\n match(\"\\r\\n\"); \n\n\n }\n break;\n case 2 :\n // /Users/benjamincoe/HackWars/C.g:170:9: '\\\\r'\n {\n match('\\r'); \n\n }\n break;\n case 3 :\n // /Users/benjamincoe/HackWars/C.g:171:9: '\\\\n'\n {\n match('\\n'); \n\n }\n break;\n\n }\n\n //input.setLine(input.getLine()+1); \n \tchannel=HIDDEN;\n\n }\n\n this.type = _type;\n }\n finally {\n }\n }", "private String getTextStructure (String path, String separator) {\r\n\t\tFile file = new File (path);\r\n\t\tBufferedReader input;\r\n\t\tString data = \"\", temp; \r\n\r\n\t\ttry {\r\n\t\t\tinput = new BufferedReader(new FileReader(file));\r\n\t\t\twhile ((temp = input.readLine())!= null) {\r\n\t\t\t\tdata += temp + separator;\r\n\t\t\t}\r\n\t\t\tinput.close();\r\n\t\t} \r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} \r\n\t\tcatch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn data;\r\n\t}", "public TabbedLineReader(File inFile, int fields, char delimiter) throws IOException {\n this.openFile(inFile, delimiter);\n this.clearLabels(fields);\n this.readAhead();\n }", "String[] readFile(String path) {\n ArrayList<String> list = new ArrayList<>();\n String[] output = null;\n Scanner reader;\n File file;\n\n try {\n file = new File(path);\n reader = new Scanner(file);\n while (reader.hasNextLine()) {\n list.add(reader.nextLine());\n }\n output = new String[list.size()];\n for (int i = 0; i < list.size(); i++) output[i] = list.get(i);\n reader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found exception\");\n }\n return output;\n }", "private List<String> readFile(String path) throws IOException {\n return Files.readAllLines (Paths.get (path), StandardCharsets.UTF_8);\n }", "public String getFileText(String filePath) {\n String fileText = \"\"; \n \n File myFile = new File(filePath);\n Scanner myReader; \n \n try {\n myReader = new Scanner(myFile);\n \n while(myReader.hasNext()) {\n fileText+= myReader.nextLine() + \"\\n\"; \n }\n \n } catch (FileNotFoundException ex) {\n logger.log(Level.SEVERE, \"Error getting text from text file\", ex.getMessage()); \n }\n \n return fileText; \n }", "private static String[] readFile(String path) throws FileNotFoundException{\n\t\tjava.io.File file = new java.io.File(path);\n\t\tjava.util.Scanner sc = new java.util.Scanner(file); \n\t\tStringBuilder content = new StringBuilder();\n\t\twhile (sc.hasNextLine()) {\n\t\t String line = sc.nextLine();\n\t\t if (!line.startsWith(\"!--\")){\n\t\t \tline = line.trim();\n\t\t \tString[] lineContent = line.split(\"/\");\n\t\t \tfor (String entry : lineContent){\n\t\t \t\tcontent.append(entry);\n\t\t \t\tcontent.append(\"/\");\n\t\t \t}\n\t\t \tcontent.append(\"!\");\n\t\t }\n\t\t}\n\t\tsc.close();\n\t\treturn content.toString().split(\"!\");\n\t}", "public String readLine() throws IOException {\n/* 176 */ String line = this.currentFilePart.readLine();\n/* 177 */ while (line == null) {\n/* 178 */ this.currentFilePart = this.currentFilePart.rollOver();\n/* 179 */ if (this.currentFilePart != null) {\n/* 180 */ line = this.currentFilePart.readLine();\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 188 */ if (\"\".equals(line) && !this.trailingNewlineOfFileSkipped) {\n/* 189 */ this.trailingNewlineOfFileSkipped = true;\n/* 190 */ line = readLine();\n/* */ } \n/* */ \n/* 193 */ return line;\n/* */ }", "public String readFile(String filePath)\n {\n String result = \"\";\n try {\n\n FileReader reader = new FileReader(filePath);\n Scanner scanner = new Scanner(reader);\n\n while(scanner.hasNextLine())\n {\n result += scanner.nextLine();\n }\n reader.close();\n }\n catch(FileNotFoundException ex)\n {\n System.out.println(\"File not found. Please contact the administrator.\");\n }\n catch (Exception ex)\n {\n System.out.println(\"Some error occurred. Please contact the administrator.\");\n }\n return result;\n }", "public static List<String> readListOfStringsFromFile(String filePath) throws IOException {\n List<String> list = new ArrayList<>();\n Files.lines(Paths.get(filePath), StandardCharsets.UTF_8).forEach(list::add);\n return list;\n }", "public GenericLineByLineParser(InputStreamReader reader) {\n this.br = new BufferedReader(reader);\n }", "private static boolean isLineBased(final ByteBuf[] delimiters) {\n if (delimiters.length != 2) {\n return false;\n }\n ByteBuf a = delimiters[0];\n ByteBuf b = delimiters[1];\n if (a.capacity() < b.capacity()) {\n a = delimiters[1];\n b = delimiters[0];\n }\n return a.capacity() == 2 && b.capacity() == 1\n && a.getByte(0) == '\\r' && a.getByte(1) == '\\n'\n && b.getByte(0) == '\\n';\n }", "public String getExtractLineSeparator ();", "private ArrayList<char[]> getFileAsResourceByCharsNewLineDelineated(Class c){\n ArrayList<char[]> charLines = new ArrayList<char[]>();\n try{\n s = new Scanner(c.getResourceAsStream(resourceName)); \n while (s.hasNextLine()){\n char[] line = s.nextLine().toCharArray();\n charLines.add(line);\n }\n } catch(Exception e){\n e.printStackTrace();\n }\n return charLines;\n }", "public void readFromStream(Reader r) throws IOException\n\t{\n\t\tBufferedReader br=new BufferedReader(r);\n\t\tlines=new ArrayList();\n\n\t\twhile(true) {\n\t\t\tString input=br.readLine();\n\t\t\tif(input==null)\n\t\t\t\tbreak;\n\t\t\tlines.add(input);\n\t\t}\n\t}", "public byte[] readLine(int offset) throws IOException {\n\t\tint lastIndex = -1;\n\t\tint localOffset = offset;\n\t\tint read;\n\t\tdo {\n\t\t\tread = ensureBuffer(localOffset, BUFFER_SIZE);\n\t\t\tif (read <= 0) {\n\t\t\t\t// EOF\n\t\t\t\tthis.pos = this.buffer.length;\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// NOT EOF, search for end of line\n\t\t\tfinal int end = localOffset + read;\n\t\t\tfor (int idx = localOffset; (lastIndex == -1) && (idx < this.buffer.length) && (idx < end); ++idx) {\n\t\t\t\tif ((this.buffer[idx] == '\\n') || (this.buffer[idx] == '\\r')) {\n\t\t\t\t\tlastIndex = idx;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlocalOffset += read;\n\t\t}\n\t\twhile (lastIndex == -1);\n\t\tthis.pos = lastIndex;\n\t\treturn Arrays.copyOfRange(this.buffer, offset, lastIndex);\n\t}", "public char[] newread(String filepath) {\n\n int x;\n char ch;\n numlines = 0;\n BufferedReader br = null;\n BufferedReader cr = null;\n /*stringBuilderdisp for storing data with new lines to display and stringBuilder\n seq for ignoring newlines and getting only sequence chars*/\n StringBuilder stringBuilderdisp = new StringBuilder();\n StringBuilder stringBuilderseq = new StringBuilder();\n String ls = System.getProperty(\"line.separator\");\n\n int f = 0;\n\n try {\n\n String sCurrentLine;\n\n br = new BufferedReader(new FileReader(filepath));\n\n while ((sCurrentLine = br.readLine()) != null) {\n if (f == 0 && sCurrentLine.contains(\">\")) {\n fileinfo = sCurrentLine;\n f = 1;\n } else {\n stringBuilderdisp.append(sCurrentLine);\n numlines++;\n if (!(sCurrentLine.isEmpty())) {\n stringBuilderdisp.append(ls);\n }\n\n stringBuilderseq.append(sCurrentLine);\n\n }\n\n }\n\n } catch (IOException e) {\n JOptionPane.showMessageDialog(null, \"ERROR File not found\");\n e.printStackTrace();\n return null;\n } finally {\n try {\n if (br != null) {\n br.close();\n }\n } catch (IOException ex) {\n JOptionPane.showMessageDialog(null, \"ERROR File not found\");\n //ex.printStackTrace();\n return null;\n\n }\n }\n\n //System.out.println(\"Total lines=\" + numlines);\n\n String seqstr = stringBuilderseq.toString();\n\n sequence = new char[seqstr.length()];\n //extra charflag to indicate that sequence contains charecter other than A,G,C,T\n boolean extracharflag = false, checkindex = false;\n\n for (int i = 0; i < sequence.length; i++) {\n if (seqstr.charAt(i) != '\\n') {\n sequence[i] = seqstr.charAt(i);\n }\n if (extracharflag == false) {\n if ((sequence[i] != 'A') && (sequence[i] != 'T') && (sequence[i] != 'G') && (sequence[i] != 'C')) {//||sequence[i]!='C'||sequence[i]!='G'||sequence[i]!='T'){\n extracharflag = true;\n System.out.print(\"** \" + sequence[i]);\n }\n }\n }\n\n if (extracharflag) {\n // JOptionPane.showMessageDialog(null, \"Sequence Contains Characters other than A G C T\");\n }\n\n int index = 0, flag = 0;\n\n // JOptionPane.showMessageDialog(null, \"Read Successful\");\n //return the sequence with newline properties to display\n //return stringBuilderdisp.toString().toCharArray();\n return sequence;\n\n }", "private void parseFile(IFile file) throws CoreException, IOException {\r\n \t\tBufferedReader reader = new BufferedReader(new InputStreamReader(file.getContents()));\r\n \t\tString nxt = \"\";\r\n \t\tStringBuilder builder = new StringBuilder();\r\n \t\tbuilder.append(reader.readLine());\r\n \t\twhile (nxt!=null) {\r\n \t\t\tnxt = reader.readLine();\r\n \t\t\tif (nxt!=null) {\r\n \t\t\t\tbuilder.append(\"\\n\");\r\n \t\t\t\tbuilder.append(nxt);\r\n \t\t\t}\r\n \t\t}\r\n \t\t// QUESTION: does this trigger the reconcilers?\r\n \t\tset(builder.toString());\r\n \t}", "public void parseFile() throws IOException {\r\n\t\tFileInputStream inputStream = new FileInputStream(FILE_PATH);\r\n\t\tScanner sc = new Scanner(inputStream, \"UTF-8\");\r\n\r\n\t\tString line = \"\";\r\n\t\t\r\n\t\twhile (sc.hasNextLine()) {\r\n\t\t\ttry{line = sc.nextLine();} catch(Exception e){System.out.println(e);}\r\n\t\t\tif(line.indexOf(comment_char)==0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(header == true) {\r\n//\t\t\tline = sc.nextLine();\r\n\t\t\tString[] linee = line.split(delimiter);\r\n\t\t\tthis.fieldNames = linee;\r\n\t\t\tfor(int i = 0; i < linee.length; i++) {\r\n\t\t\t\tcolumnMapping.put(linee[i], i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\twhile (sc.hasNextLine()) {\r\n\t\t\ttry{line = sc.nextLine();} catch(Exception e){System.out.println(e);}\r\n\t\t\tdf.add(line.split(delimiter, -1));\r\n//\t\t\tif(df.get(df.size()-1).length != this.fieldNames.length) {\r\n//\t\t\t\tSystem.out.println(this.FILE_PATH);\r\n//\t\t\t\tSystem.out.println(String.join(\" \", df.get(df.size()-1)));\r\n//\t\t\t}\r\n\t\t\tfor(int i = 0; i < df.get(df.size()-1).length; i++) {\r\n\t\t\t\tif(df.get(df.size()-1)[i].equals(\"\")) {\r\n\t\t\t\t\tdf.get(df.size()-1)[i] = \"0\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tinputStream.close();\r\n\t\tsc.close();\t\r\n\t}", "protected List<String[]> readCsvFile(byte[] bytes, String separator, String quote) {\n\t\ttry (CharSequenceReader seq = new CharSequenceReader(new String(bytes, Charset.forName(DynamoConstants.UTF_8)));\n\t\t CSVReader reader = new CSVReader(seq, separator.charAt(0), quote.charAt(0))) {\n\t\t\treturn reader.readAll();\n\t\t} catch (IOException ex) {\n\t\t\tthrow new OCSImportException(ex.getMessage(), ex);\n\t\t}\n\t}", "public List<String[]> parseCSV(String filename) throws FileNotFoundException {\n Scanner scanner = new Scanner(new File(filename));\n List<String[]> list = new ArrayList<>();\n while (scanner.hasNextLine()) {\n String line = scanner.nextLine();\n list.add(line.split(\", \"));\n }\n scanner.close();\n return list;\n }", "private static String readLine(String filename) throws IOException {\n\t\ttry (BufferedReader reader = new BufferedReader(\n\t\t\t\tnew FileReader(filename), 256)) {\n\t\t\treturn reader.readLine();\n\t\t}\n\t}", "String[] getLegalLineDelimiters();", "public void textFile(String path){\n\t\tBufferedReader br;\r\n\t\ttry {\r\n\t\t\tbr = new BufferedReader(new InputStreamReader(\r\n\t\t\t\t\tnew FileInputStream(path),Charset.forName(\"gbk\")));\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tthrow new IllegalArgumentException(e);\r\n\t\t}\r\n\t\tLineBufferReader myReader=new LineBufferReader(br);\r\n\t}", "public static String[] getLines(String filename)\n throws IOException {\n\n\n try (\n FileInputStream inStream = new FileInputStream(filename);\n InputStreamReader reader = new InputStreamReader(inStream);\n BufferedReader buffer = new BufferedReader(reader)\n ) {\n List<String> lines = new LinkedList<>();\n for (String line = buffer.readLine();\n line != null;\n line = buffer.readLine()) {\n line = line.trim();\n if (!line.isEmpty()) {\n lines.add(line);\n }\n }\n return lines.toArray(new String[0]);\n }\n }", "String getLineDelimiter(int line) throws BadLocationException;", "public String readText(String _filename) {\r\n\t\treturn readText(_filename, \"text\", (java.net.URL) null);\r\n\t}", "public static String getLine(InputStreamReader reader) {\n StringBuffer b = new StringBuffer();\n int c;\n try {\n while ((c = reader.read()) != -1 && c != '\\n') {\n if (c != '\\r')\n b.append((char)c);\n }\n } catch (IOException ioe) {\n c = -1;\n }\n\n if (c == -1 && b.length() == 0)\n return null;\n else\n return b.toString();\n }", "public String readLine() {\n\n String temp = null;\n\n try\n {\n assert this.isValid();\t\t\t//Test that we can read the file\n temp = br.readLine();\t\t\t//Read the next line and store it as temp\n }\n\n\t\t//Catch possible exceptions\n catch(java.io.IOException e) {\n System.out.println(\"Error reading file: \" + e );\n }\n\n return temp;\n }", "public ArrayList<ArrayList<Character> > reader(java.io.InputStream in) throws IOException{\n String s = \"\";\n int data = in.read();\n while(data!=-1){\n s += String.valueOf((char)data);\n data = in.read();\n }\t\t\t\t\t\t\t\t// s now has the input file stored as a string\n ArrayList<ArrayList<Character> > arr = new ArrayList<>();\n for(int i = 0;i<s.length();){\n ArrayList<Character> a = new ArrayList<>();\n while(s.charAt(i)!='\\n'){\n if((s.charAt(i)-'a'>=0&&s.charAt(i)-'a'<=25)||(s.charAt(i)-'0'>=0&&s.charAt(i)-'0'<=9)){ //taking only alphanumerics\n a.add(s.charAt(i));\n }\n i++;\n }\n arr.add(a);\n i++;\n }\n return arr;\n }", "public static List<List<String>> readFile() {\r\n List<List<String>> out = new ArrayList<>();\r\n File dir = new File(\"./tmp/data\");\r\n dir.mkdirs();\r\n File f = new File(dir, \"storage.txt\");\r\n try {\r\n f.createNewFile();\r\n Scanner s = new Scanner(f);\r\n while (s.hasNext()) {\r\n String[] tokens = s.nextLine().split(\"%%%\");\r\n List<String> tokenss = new ArrayList<>(Arrays.asList(tokens));\r\n out.add(tokenss);\r\n }\r\n return out;\r\n } catch (IOException e) {\r\n throw new Error(\"Something went wrong: \" + e.getMessage());\r\n }\r\n }" ]
[ "0.5693465", "0.5472542", "0.5399809", "0.5289674", "0.528553", "0.5281182", "0.5250834", "0.52183306", "0.52131283", "0.5206858", "0.52057856", "0.51863337", "0.51738954", "0.51703733", "0.5159343", "0.5158927", "0.5151643", "0.51470363", "0.51443064", "0.51399285", "0.50983596", "0.50975186", "0.50849706", "0.50748", "0.50521916", "0.50292027", "0.50154066", "0.5011402", "0.49822438", "0.49659243", "0.4963953", "0.49633992", "0.4960573", "0.49522492", "0.4950107", "0.4945365", "0.49279618", "0.49018916", "0.48991856", "0.48936173", "0.48920184", "0.48711285", "0.4862857", "0.4858736", "0.48560706", "0.48445505", "0.4827418", "0.4824385", "0.48227766", "0.4811326", "0.47932744", "0.4788077", "0.47742024", "0.47722197", "0.47664458", "0.4765919", "0.47625569", "0.47588378", "0.47549286", "0.47522825", "0.4749879", "0.47465944", "0.4730096", "0.47146946", "0.4698586", "0.46943167", "0.4677468", "0.46768084", "0.46763316", "0.46752784", "0.46722808", "0.46627483", "0.46514913", "0.46499965", "0.46481395", "0.46373385", "0.4634864", "0.46330458", "0.46261704", "0.46219635", "0.46217403", "0.46189368", "0.46037063", "0.46024165", "0.46023", "0.4600788", "0.45980105", "0.4597392", "0.45951006", "0.45947883", "0.45914525", "0.4589121", "0.4580194", "0.45791253", "0.4575867", "0.45715392", "0.4567287", "0.45637673", "0.4563419", "0.45606026" ]
0.48136342
49
parse line into columns
public String[] parse(String line, String sep, boolean bQuoted, int lineNumber) { int pos = 0; String[] flds = new String[0]; StringTokenizer tok = new StringTokenizer(line, sep, true); for ( ;tok.hasMoreTokens(); ) { String word = tok.nextToken(); if (word.equals(sep)) { pos++; } else { int x = word.length(); if (bQuoted && x > 2) { if ( word.charAt(0) == '"' && word.charAt(x-1) == '"') { word = word.substring(1, x-1); } } flds = Arrays.copyOf(flds, pos+1); flds[pos] = word; } } return flds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String[] readLine( String line ) throws IOException {\n if ( StringUtils.isBlank( line ) ) {\n return null;\n }\n if ( line.startsWith( \"#\" ) ) {\n return null;\n }\n\n String[] fields = StringUtils.splitPreserveAllTokens( line, '\\t' );\n if ( fields.length < 2 ) {\n throw new IOException( \"Illegal format, expected at least 2 columns, got \" + fields.length );\n }\n return fields;\n\n }", "public void processLine(String line){\n\t\tString[] splitted = line.split(\"(\\\\s+|\\\\t+)\");\n\t\tif(splitted.length < FIELDS){\n\t\t\tSystem.err.println(\"DataRow: Cannot process line : \" + line);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tindex \t\t= Integer.parseInt(splitted[0]);\n\t\tparentIndex = Integer.parseInt(splitted[1]);\n\t\tword \t\t= splitted[2].trim();\n\t\tpos\t\t\t= splitted[3].trim();\n\t\tpredicateLabel = splitted[4].trim();\n\t\tintervenes = splitted[5];\n\t\t\n\t\tidentificationLabel = splitted[6];\n\t\tclassificationLabel = splitted[7];\n\t\t\n\t\thmmState = Integer.parseInt(splitted[8]);\n\t\tnaiveState = Integer.parseInt(splitted[9]);\n\t\tchunk = splitted[10];\n\t\tne = splitted[11];\n\t\tif(splitted.length > FIELDS){\n\t\t\tSystem.err.println(\"WARNING: data row has more than required columns: \" + line);\n\t\t}\n\t}", "private void processFirstLine(String line) {\r\n\t\tString[] numsAsStr = line.split(\" \");\r\n\t\tnumRows = Integer.parseInt(numsAsStr[0]);\r\n\t\tnumCols = Integer.parseInt(numsAsStr[1]);\r\n\t\t/**\r\n\t\t * Taken out for time testing\r\n\t\t */\r\n//\t\tSystem.out.println(\"Rows: \" + numRows + \" Cols: \" + numCols);\r\n\t}", "protected abstract void parse(String line);", "private boolean parseLine()\r\n\t{\r\n\t\tString delim = \"\\t\";\r\n\t\tm_tokenizer = new StringTokenizer(m_line, delim, true);\r\n\t\tString token;\r\n\t\t\r\n\t\tint tokCount = m_tokenizer.countTokens();\r\n\t\tif ((fieldIndexArray.length <= tokCount) &&\t(tokCount <= fieldIndexArray.length*2))\r\n\t\t{\r\n\t\t\tint lastDelim = -2; /** case when line has consecutive (>=2) tabs!*/\r\n\t\t\tint columnIndex = 0;\r\n\t\t\t/** Tokenise the chip data file's line to separate the data to be put in various columns*/\r\n\t\t\tfor (int i=0; i< tokCount; i++) \r\n\t\t\t{\r\n\t\t\t\ttoken = m_tokenizer.nextToken();\r\n\t\t\t\tif (token.equalsIgnoreCase(delim)) \r\n\t\t\t\t{\r\n\t\t\t\t\tif (lastDelim + 1 == i) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t/** 2 consecutive tags - empty string value*/\r\n\t\t\t\t\t\tif(columnIndex<fieldIndexArray.length)\r\n\t\t\t\t\t\t\tbaseRecord.fields[fieldIndexArray[columnIndex++]].append(\"\");\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlastDelim = i;\r\n\t\t\t\t} \r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\t/** Each time when new token rrpresenting column data is encountered then columnIndex is \r\n\t\t\t\t\t * incremented and tokens are stored till the token number is less than total number\r\n\t\t\t\t\t * of tokens on one line according to fieldIndexArray */\r\n\t\t\t\t\tif(columnIndex < fieldIndexArray.length)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t/** If total description length exceeds the precision of that field in the table then \r\n\t\t\t\t\t\t * it will be truncated to load it in the description field*/\r\n\t\t\t\t\t\tif(columnIndex == (fieldIndexArray.length-1))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (token.length() > max)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tStringBuffer tokenbuffer = new StringBuffer(token);\r\n\t\t\t\t\t\t\t\ttokenbuffer.setLength(max);\r\n\t\t\t\t\t\t\t\tif(tokenbuffer.charAt(max-1) != '\"')\r\n\t\t\t\t\t\t\t\t\ttokenbuffer.append('\"');\r\n\t\t\t\t\t\t\t\ttoken=tokenbuffer.toString();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/** Here fieldIndexArray will give the actual location of particular token\r\n\t\t\t\t\t\t * in the chipinformation table. This mapping is already done in fieldIndexArray */\r\n\t\t\t\t\t\tbaseRecord.fields[fieldIndexArray[columnIndex++]].append(token);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\tLogger.log(\"Invalid record: \"+ tokCount + \" fields. \",\r\n\t\t\t\t\tLogger.WARNING);\r\n\t\t\tLogger.log(\"Expected tokens = \"+ fieldIndexArray.length,\r\n\t\t\t\t\tLogger.WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public static void countRowCol(){\n\t String line=\"\";\n\t row=0;\n\t col=0;\n try{\n Scanner reader = new Scanner(file);\n while(reader.hasNextLine()){\n row++;\n line=reader.nextLine();\n }\n reader.close();\n }catch (FileNotFoundException e) {\n \t e.printStackTrace();\n }\n String[] seperatedRow = line.split(\"\\t\");\n col=seperatedRow.length;\n\t}", "public void parseFile() throws IOException {\r\n\t\tFileInputStream inputStream = new FileInputStream(FILE_PATH);\r\n\t\tScanner sc = new Scanner(inputStream, \"UTF-8\");\r\n\r\n\t\tString line = \"\";\r\n\t\t\r\n\t\twhile (sc.hasNextLine()) {\r\n\t\t\ttry{line = sc.nextLine();} catch(Exception e){System.out.println(e);}\r\n\t\t\tif(line.indexOf(comment_char)==0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(header == true) {\r\n//\t\t\tline = sc.nextLine();\r\n\t\t\tString[] linee = line.split(delimiter);\r\n\t\t\tthis.fieldNames = linee;\r\n\t\t\tfor(int i = 0; i < linee.length; i++) {\r\n\t\t\t\tcolumnMapping.put(linee[i], i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\twhile (sc.hasNextLine()) {\r\n\t\t\ttry{line = sc.nextLine();} catch(Exception e){System.out.println(e);}\r\n\t\t\tdf.add(line.split(delimiter, -1));\r\n//\t\t\tif(df.get(df.size()-1).length != this.fieldNames.length) {\r\n//\t\t\t\tSystem.out.println(this.FILE_PATH);\r\n//\t\t\t\tSystem.out.println(String.join(\" \", df.get(df.size()-1)));\r\n//\t\t\t}\r\n\t\t\tfor(int i = 0; i < df.get(df.size()-1).length; i++) {\r\n\t\t\t\tif(df.get(df.size()-1)[i].equals(\"\")) {\r\n\t\t\t\t\tdf.get(df.size()-1)[i] = \"0\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tinputStream.close();\r\n\t\tsc.close();\t\r\n\t}", "protected abstract DataTypes[] processLine(MutableCharArrayString line);", "public double[] readVector(String line, int index) {\n\n String[] list = line.split(\" \");\n int numColumns = Integer.parseInt(list[index]);\n double[] res = new double[numColumns];\n\n int num = index + 1;\n for (int j = 0; j < numColumns; j++) {\n res[j] = Double.parseDouble(list[num]);\n num++;\n }\n return res;\n }", "private String[] parseLine(final String nextLine, final boolean readLine)\n throws IOException {\n String line = nextLine;\n if (line.length() == 0) {\n return new String[0];\n } else {\n\n final List<String> fields = new ArrayList<String>();\n StringBuilder sb = new StringBuilder();\n boolean inQuotes = false;\n boolean hadQuotes = false;\n do {\n if (inQuotes && readLine) {\n sb.append(\"\\n\");\n line = getNextLine();\n if (line == null) {\n break;\n }\n }\n for (int i = 0; i < line.length(); i++) {\n final char c = line.charAt(i);\n if (c == CsvConstants.QUOTE_CHARACTER) {\n hadQuotes = true;\n if (inQuotes && line.length() > i + 1\n && line.charAt(i + 1) == CsvConstants.QUOTE_CHARACTER) {\n sb.append(line.charAt(i + 1));\n i++;\n } else {\n inQuotes = !inQuotes;\n if (i > 2 && line.charAt(i - 1) != this.fieldSeparator\n && line.length() > i + 1\n && line.charAt(i + 1) != this.fieldSeparator) {\n sb.append(c);\n }\n }\n } else if (c == this.fieldSeparator && !inQuotes) {\n hadQuotes = false;\n if (hadQuotes || sb.length() > 0) {\n fields.add(sb.toString());\n } else {\n fields.add(null);\n }\n sb = new StringBuilder();\n } else {\n sb.append(c);\n }\n }\n } while (inQuotes);\n if (sb.length() > 0 || fields.size() > 0) {\n if (hadQuotes || sb.length() > 0) {\n fields.add(sb.toString());\n } else {\n fields.add(null);\n }\n }\n return fields.toArray(new String[0]);\n }\n }", "public String[] split(String lineWithoutCmd) {\n String[] fields = new String[2];\n // position of the first space\n int pos = lineWithoutCmd.indexOf(\" \");\n\n // The name of the hashTable\n String tableName = lineWithoutCmd.substring(0, pos);\n // The name of the movie or reviewer\n String name = lineWithoutCmd.substring(pos, lineWithoutCmd.length());\n\n fields[0] = tableName.trim();\n\n fields[1] = name.trim();\n\n return fields;\n }", "private void parseField(String line){\n List<Integer> commaPos = ParserUtils.getCommaPos(line);\n int size = commaPos.size();\n // parse field\n String zip = line.substring(commaPos.get(size-ZIP_CODE_POS-1)+1, commaPos.get(size-ZIP_CODE_POS));\n // if zip is not valid return\n zip = zip.trim();\n if(zip==null || zip.length()<5){\n return;\n }\n // only keep the first 5 digits\n zip = zip.substring(0,5);\n String marketVal = line.substring(commaPos.get(MARKET_VALUE_POS-1)+1, commaPos.get(MARKET_VALUE_POS));\n String liveableArea = line.substring(commaPos.get(size-TOTAL_LIVEABLE_AREA_POS-1)+1, commaPos.get(size-TOTAL_LIVEABLE_AREA_POS));\n // cast those value to Long Double\n Long lZip = ParserUtils.tryCastStrToLong(zip);\n Double DMarketVal = ParserUtils.tryCastStrToDouble(marketVal);\n Double DLiveableArea = ParserUtils.tryCastStrToDouble(liveableArea);\n // update those field into the map\n updatePropertyInfo(lZip,DMarketVal, DLiveableArea);\n }", "private String[] splitLine(String line)\n\t{\n\t\treturn line.split(CSV_SEPARATOR);\n\t}", "public String[] parseLine() {\n String[] tokens = null;\n try {\n tokens = csvReader.readNext();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return tokens;\n }", "private void prepareLine(int line){\n int length = mText.getColumnCount(line);\n if(length >= mChars.length){\n mChars = new char[length + 100];\n }\n for(int i = 0;i < length;i++){\n mChars[i] = mText.charAt(line, i);\n }\n }", "public void getOutData(String line) {\n\t\tMatcher myMatcher = myPattern.matcher(line);\n\t\tmyMatcher.find();\n\t\tmyMatcher.matches();\n\t\tmyMatcher.matches();\n\t\t// *--- GROUP 3(X) 4(Y) 5(Z) --*//\n\t\tif (myMatcher.group(3) != null)\n\t\t\txAxis = Double.parseDouble(myMatcher.group(3));\n\t\telse {\n\t\t\txAxis = Double.NaN;\n\t\t}\n\t\tif (myMatcher.group(4) != null)\n\t\t\tyAxis = Double.parseDouble(myMatcher.group(4));\n\t\telse {\n\t\t\tyAxis = Double.NaN;\n\t\t}\n\t\tif (myMatcher.group(5) != null)\n\t\t\tzAxis = Double.parseDouble(myMatcher.group(5));\n\t\telse {\n\t\t\tzAxis = Double.NaN;\n\t\t}\n\t}", "private List<String> read_level_row(String line){\r\n List<String> row = new ArrayList<>();\r\n try (Scanner rowScanner = new Scanner(line)){\r\n rowScanner.useDelimiter(\",\");\r\n while (rowScanner.hasNext()) {\r\n row.add(rowScanner.next());\r\n }\r\n }\r\n return row;\r\n }", "public void readLine(String line){\n\t\tfields = line.split(\"\\\\s*,\\\\s*\");\n\t\tDate key = parseDate(fields[0]);\n\t\tif(key != null){\n\t\t\tDouble val = parseAverage(fields[6]);\t\t\n\t\t\tdja.put(key, val);\n\t\t}\n\t}", "protected void parseHeader(String line){\n headerMap = new LinkedHashMap<>();\n String[] bits = line.split(delimiter);\n for (int i = 0; i < bits.length; i++){\n headerMap.put(bits[i], i);\n }\n }", "public void parseLine(String line, ParseState parseState) {\n String[] lineElements = line.split(\"\\\\s\");\n if (lineElements.length == 2 && \"attributes\".equals(lineElements[0]) && \"{\".equals(lineElements[1])) {\n SubgraphAttributeDefLineParser contAttrDefLineParser = new SubgraphAttributeDefLineParser(container);\n PopulateDB.parseBlock(parseState, contAttrDefLineParser);\n } else if (lineElements.length == 3 && \"subgraph\".equals(lineElements[0]) && \"{\".equals(lineElements[2])) {\n int subgID = Integer.parseInt(lineElements[1]);\n SubgraphLineParser subgraphLineParser = new SubgraphLineParser(container, subgID);\n PopulateDB.parseBlock(parseState, subgraphLineParser);\n } else {\n throw new IllegalArgumentException(\"Bad attributes or subgraph definition\");\n }\n }", "protected void parseHeaderLine(String unparsedLine) {\r\n\r\n\t\tif (DEBUG)\r\n\t\t\tSystem.out.println(\"HEADER LINE = \" + unparsedLine);\r\n\r\n\t\tStringTokenizer t = new StringTokenizer(unparsedLine, \" ,\\042\\011\");\r\n\t\tString tok = null;\r\n\r\n\t\tfor (int i = 0; t.hasMoreTokens(); i++) {\r\n\t\t\ttok = t.nextToken();\r\n\t\t\tif (DEBUG)\r\n\t\t\t\tSystem.out.println(\"token \" + i + \"=[\" + tok + \"]\");\r\n\t\t\tif (tok.equalsIgnoreCase(CHAN_HEADER)) {\r\n\t\t\t\t_chanIndex = i;\r\n\t\t\t\tif (DEBUG)\r\n\t\t\t\t\tSystem.out.println(\"chan_header=\" + i);\r\n\t\t\t}\r\n\t\t\tif (tok.equalsIgnoreCase(DIST_HEADER)) {\r\n\t\t\t\t_distIndex = i;\r\n\t\t\t\tif (DEBUG)\r\n\t\t\t\t\tSystem.out.println(\"dist_header=\" + i);\r\n\t\t\t}\r\n\t\t\tif (tok.equalsIgnoreCase(FILENAME_HEADER)) {\r\n\t\t\t\t_filenameIndex = i;\r\n\t\t\t\tif (DEBUG)\r\n\t\t\t\t\tSystem.out.println(\"filename_header=\" + i);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (DEBUG)\r\n\t\t\tSystem.out.println(\r\n\t\t\t\t\t\"_chanIndex, _distIndex, _filenameIndex=\" + _chanIndex + \",\" + _distIndex + \",\" + _filenameIndex);\r\n\r\n\t}", "@Override\n protected void processLine(String line) {\n String[] lines = line.split(\",\");\n for (String l : lines) {\n data.add(l);\n }\n }", "@Override\n\tpublic ArrayList<BigDecimal> input(String line) {\n\t\tArrayList<BigDecimal> list = new ArrayList<BigDecimal>();\n\t\tfor (String s : line.split(\"\\\\s+\")) {\n\t\t\tBigDecimal num = new BigDecimal(Double.parseDouble(s));\n\t\t\tlist.add(num);\n\t\t}\n\n\t\treturn list;\n\t}", "@Override\n public boolean processLine(String line) throws IOException {\n if (line == null || line.length() == 0) return true;\n String[] values = line.split(\"\\t\");\n // If there is an entry which is improperly sized, there is a problem so bail\n if (values.length != segment.getOutputParameters().size()) return false;\n ParameterMap.Builder builder = new ParameterMap.Builder();\n for (int i=0; i<parameters.size();i++)\n {\n builder.with(parameters.get(i), values[i]);\n }\n entries.add(builder.build());\n return true;\n }", "public void adjustBeginLineColumn(int newLine, int newCol) {\n/* 511 */ int len, start = this.tokenBegin;\n/* */ \n/* */ \n/* 514 */ if (this.bufpos >= this.tokenBegin) {\n/* 515 */ len = this.bufpos - this.tokenBegin + this.inBuf + 1;\n/* */ } else {\n/* */ \n/* 518 */ len = this.bufsize - this.tokenBegin + this.bufpos + 1 + this.inBuf;\n/* */ } \n/* */ \n/* 521 */ int i = 0, j = 0, k = 0;\n/* 522 */ int nextColDiff = 0, columnDiff = 0;\n/* */ \n/* */ \n/* 525 */ while (i < len && this.bufline[j = start % this.bufsize] == this.bufline[k = ++start % this.bufsize]) {\n/* 526 */ this.bufline[j] = newLine;\n/* 527 */ nextColDiff = columnDiff + this.bufcolumn[k] - this.bufcolumn[j];\n/* 528 */ this.bufcolumn[j] = newCol + columnDiff;\n/* 529 */ columnDiff = nextColDiff;\n/* 530 */ i++;\n/* */ } \n/* */ \n/* 533 */ if (i < len) {\n/* 534 */ this.bufline[j] = newLine++;\n/* 535 */ this.bufcolumn[j] = newCol + columnDiff;\n/* */ \n/* 537 */ while (i++ < len) {\n/* 538 */ if (this.bufline[j = start % this.bufsize] != this.bufline[++start % this.bufsize]) {\n/* 539 */ this.bufline[j] = newLine++; continue;\n/* */ } \n/* 541 */ this.bufline[j] = newLine;\n/* */ } \n/* */ } \n/* */ \n/* 545 */ this.line = this.bufline[j];\n/* 546 */ this.column = this.bufcolumn[j];\n/* */ }", "final public void fieldFromSrc(){\n List<String> lines = readSrc();\n size = Integer.parseInt(lines.get(0));\n Tile[] tiles = new Tile[size*size];\n int count = 0;\n Tile t;\n \n char[][] fieldChars = new char[size][size];\n \n for(int Y=0; Y<size; Y++){\n for(int X=0; X<size; X++){\n try{\n fieldChars[X][Y] = lines.get(Y+1).charAt(X);\n }catch(StringIndexOutOfBoundsException e){\n System.out.println(e);\n }\n }\n }\n \n for(int Y=0; Y<size; Y++){\n for(int X=0; X<size; X++){\n Coordinaat C = new Coordinaat(X,Y); \n switch(fieldChars[X][Y]){\n case 'M' : \n t = new Muur(C); \n break;\n case 'V' :\n t = new Veld(C);\n break;\n case 'E' :\n t = new EindVeld(C);\n break;\n default :\n t = new Tile(C);\n break;\n }\n tiles[count] = t;\n count++;\n }\n }\n \n fillField(tiles,size);\n createMoveAbles(lines.subList(size+2, lines.size()));\n }", "private static List<Integer> parse_line(String line, int d) throws Exception {\n\t List<Integer> ans = new ArrayList<Integer>();\n\t StringTokenizer st = new StringTokenizer(line, \" \");\n\t if (st.countTokens() != d) {\n\t throw new Exception(\"Bad line: [\" + line + \"]\");\n\t }\n\t while (st.hasMoreElements()) {\n\t String s = st.nextToken();\n\t try {\n\t ans.add(Integer.parseInt(s));\n\t } catch (Exception ex) {\n\t throw new Exception(\"Bad Integer in \" + \"[\" + line + \"]. \" + ex.getMessage());\n\t }\n\t }\n\t return ans;\n\t }", "@Override\n public int contentColumn(\n @NotNull CharSequence lineChars,\n int indentColumn,\n @NotNull PsiEditContext editContext\n ) {\n // default 4 leading spaces removed\n int column = indentColumn;\n int leadingSpaces = myLeadingSpaces;\n int i = 0;\n\n while (leadingSpaces > 0 && i < lineChars.length()) {\n switch (lineChars.charAt(i++)) {\n case '\\t':\n int spaces = min(columnsToNextTabStop(column), leadingSpaces);\n leadingSpaces -= spaces;\n column += spaces;\n break;\n\n case ' ':\n leadingSpaces--;\n column++;\n break;\n\n default:\n return column;\n }\n }\n return column;\n }", "List<ThingPackage> parseLines(List<String> line);", "public void initFromRows(SimpleIterator<String> lines) {\n this.reset();\n int rowId = 0;\n Optional<String> lineOpt;\n Int2ObjectMap<IntArrayList> colsMap = new Int2ObjectOpenHashMap<>();\n int maxColId = -1;\n while (true) {\n lineOpt = lines.next();\n if (!lineOpt.isPresent()) {\n break;\n } else {\n String line = lineOpt.get().trim();\n if (!line.isEmpty()) {\n String[] tokens = line.split(\"\\\\s+\");\n int[] row = new int[tokens.length];\n for (int i = 0; i < tokens.length; i++) {\n int colId = Integer.parseInt(tokens[i]) - 1; // convert to 0-based\n if (colId < 0) {\n throw new RuntimeException(\n String.format(\n \"Column %d smaller than 1, in line number %d, line:'%s'\",\n colId + 1, rowId + 1, line\n )\n );\n }\n row[i] = colId;\n if (!colsMap.containsKey(colId)) {\n colsMap.put(colId, new IntArrayList());\n }\n colsMap.get(colId).add(rowId);\n if (colId > maxColId) {\n maxColId = colId;\n }\n }\n Arrays.sort(row);\n this.rows[rowId] = row;\n }\n rowId++;\n if (rowId > this.numRows) {\n throw new RuntimeException(\n \"More rows in input rows file than the expected \" + this.numRows\n );\n }\n }\n }\n if (maxColId > this.numCols) {\n this.numCols = maxColId + 1;\n this.cols = new IntSet[this.numCols];\n }\n for (int colId = 0; colId < this.numCols; colId++) {\n if (colsMap.containsKey(colId) && !colsMap.get(colId).isEmpty()) {\n this.cols[colId] = new IntOpenHashSet(colsMap.get(colId));\n } else {\n this.cols[colId] = new IntOpenHashSet();\n }\n }\n }", "private static void processCatalogLine(String line) {\r\n\r\n\t\tString wordLeft = \"\"; // left side of catalog eqs\r\n\r\n\t\t/*\r\n\t\t * switch for scanning catalogs. -1 = nothing 0 = driver, 1=hostname,\r\n\t\t * 2=username, 3=passwd\r\n\t\t *\r\n\t\t */\r\n\t\tint catalog = -1;\r\n\r\n\t\tfor (int x = 0; x < line.length(); x++) {\r\n\t\t\t// System.out.print(line.charAt(x));\r\n\t\t\t// catalog = compare(wordLeft);\r\n\r\n\t\t\tif (catalog == -1) {\r\n\t\t\t\twordLeft = wordLeft + line.charAt(x);\r\n\t\t\t\tcatalog = catalogCompare(wordLeft);\r\n\t\t\t} else if (catalog == 0) {\r\n\t\t\t\tcatalogDriver = catalogDriver + line.charAt(x);\r\n\t\t\t} else if (catalog == 1) {\r\n\t\t\t\tcatalogHostName = catalogHostName + line.charAt(x);\r\n\t\t\t} else if (catalog == 2) {\r\n\t\t\t\tcatalogUserName = catalogUserName + line.charAt(x);\r\n\t\t\t} else if (catalog == 3) {\r\n\t\t\t\tcatalogPassword = catalogPassword + line.charAt(x);\r\n\t\t\t} else if (catalog == 4) {\r\n\t\t\t\t// numnodes = (int) line.substring(x);\r\n\r\n\t\t\t\tnumnodes = Integer.parseInt(line.substring(x));\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public static int[][] getMatrix(String[] lines, String delimiter) {\n\n int[][] data = new int[lines.length][];\n for(int i = 0; i < lines.length; i++) {\n\n String[] parts = lines[i].split(delimiter);\n int[] row = new int[parts.length];\n for (int j = 0; j < parts.length; j++) {\n row[j] = Integer.parseInt(parts[j]);\n }\n data[i] = row;\n }\n return data;\n }", "private void processToDoItem(String line) {\n String[] items = line.split((\"\\\",\\\"\"));\n // Skip the invalid line\n if (items.length != this.headerMap.size()) {\n System.out.println(String.format(\"The line %s has wrong columns. Please fix it!\", line));\n return;\n }\n\n HashMap<String, String> mappingTable = new HashMap<>();\n for (int i = 0; i < items.length; i++) {\n String item = items[i].replaceAll(\"\\\"\", \"\");\n item = item.equals(\"?\") ? null : item;\n mappingTable.put(headerMap.get(i), item);\n }\n ToDoItem todo = this.parseToDoItem(mappingTable);\n this.toDoList.addExistingToDo(Integer.parseInt(mappingTable.get(\"id\")), todo);\n }", "private static List<TableCell.Alignment> parseSeparator(CharSequence s) {\n List<TableCell.Alignment> columns = new ArrayList<>();\n int pipes = 0;\n boolean valid = false;\n int i = 0;\n while (i < s.length()) {\n char c = s.charAt(i);\n switch (c) {\n case '|':\n i++;\n pipes++;\n if (pipes > 1) {\n // More than one adjacent pipe not allowed\n return null;\n }\n // Need at lest one pipe, even for a one column table\n valid = true;\n break;\n case '-':\n case ':':\n if (pipes == 0 && !columns.isEmpty()) {\n // Need a pipe after the first column (first column doesn't need to start with one)\n return null;\n }\n boolean left = false;\n boolean right = false;\n if (c == ':') {\n left = true;\n i++;\n }\n boolean haveDash = false;\n while (i < s.length() && s.charAt(i) == '-') {\n i++;\n haveDash = true;\n }\n if (!haveDash) {\n // Need at least one dash\n return null;\n }\n if (i < s.length() && s.charAt(i) == ':') {\n right = true;\n i++;\n }\n columns.add(getAlignment(left, right));\n // Next, need another pipe\n pipes = 0;\n break;\n case ' ':\n case '\\t':\n // White space is allowed between pipes and columns\n i++;\n break;\n default:\n // Any other character is invalid\n return null;\n }\n }\n if (!valid) {\n return null;\n }\n return columns;\n }", "private static void processLine(\r\n final String line,\r\n final Map<String, List<String>> sessionsFromCustomer,\r\n Map<String, List<View>> viewsForSessions,\r\n Map<String, List<Buy>> buysForSessions\r\n /* add parameters as needed */\r\n ) {\r\n final String[] words = line.split(\"\\\\h\");\r\n\r\n if (words.length == 0) {\r\n return;\r\n }\r\n\r\n switch (words[0]) {\r\n case START_TAG:\r\n processStartEntry(words, sessionsFromCustomer);\r\n break;\r\n case VIEW_TAG:\r\n processViewEntry(words, viewsForSessions );\r\n break;\r\n case BUY_TAG:\r\n processBuyEntry(words, buysForSessions);\r\n break;\r\n case END_TAG:\r\n processEndEntry(words);\r\n break;\r\n }\r\n }", "public ExpenseEntity parse(String line);", "public void split(String line) {\r\n \r\n String temp[]=line.split(\";\");\r\n String dayno=temp[0];\r\n String itemval=temp[3];\r\n String dayvalues[]=dayno.split(\":\");\r\n String itemvalues[]=itemval.split(\":\");\r\n int dayno1=Integer.parseInt(dayvalues[1]);\r\n \r\n String itemno = itemvalues[1];\r\n \r\n \r\n tcount++;\r\n if(dayno1>dcount)\r\n {\r\n dcount++; \r\n }\r\n \r\n if(itemno.equals(\"Gun\"))\r\n icount++;\r\n else if(itemno.equals(\"NailCutter\"))\r\n icount++;\r\n else if(itemno.equals(\"Blade\"))\r\n icount++;\r\n else if(itemno.equals(\"Knife\"))\r\n icount++;\r\n \r\n \r\n apstate.settravellers(tcount);\r\n apstate.setprohibiteditems(icount);\r\n apstate.setdays(dcount);\r\n \r\n \r\n }", "public static void reformat(BufferedReader input) throws IOException {\n String line = input.readLine();\n\n while (line != null) {\n String[] parts = line.split(\";\", 2);\n for (String part : parts) {\n System.out.println(part);\n }\n line = input.readLine();\n }\n }", "private String[] splitLine (String fileLine){\n String[] ans = new String[5];\n ans[0] = fileLine.substring(0, fileLine.indexOf(\"!\"));\n ans[1] = fileLine.substring(fileLine.indexOf(\"[\") + 1, fileLine.indexOf(\"]\"));\n String dfTf = fileLine.substring(fileLine.indexOf(\"]!\") + 2);\n ans[3] = dfTf;\n ans[2] = dfTf.substring(0, dfTf.indexOf(\"!\"));\n if (dfTf.contains(\"^\")) {\n ans[4] = dfTf.substring(dfTf.length() - 1);\n ans[3] = ans[3].substring(ans[3].indexOf(\"!\") + 1, ans[3].length() - 2);\n } else\n ans[3] = ans[3].substring(dfTf.indexOf(\"!\") + 1);\n\n return ans;\n }", "public int getPointColumn(int line, float x){\n if(x < 0){\n return 0;\n }\n if(line >= getLineCount()) {\n line = getLineCount() - 1;\n }\n float w = 0;\n int i = 0;\n prepareLine(line);\n while(w < x && i < mText.getColumnCount(line)){\n w += measureText(mChars, i, 1);\n i++;\n }\n if(w < x){\n i = mText.getColumnCount(line);\n }\n return i;\n }", "public static List<String> readColumn(File inFile, String string) throws IOException {\n List<String> retVal = new ArrayList<String>(100);\n try (TabbedLineReader inStream = new TabbedLineReader(inFile)) {\n int inCol = inStream.findField(string);\n for (TabbedLineReader.Line line : inStream)\n retVal.add(line.get(inCol));\n }\n return retVal;\n }", "public abstract T parseLine(String inputLine);", "private void processCalculation(String line) {\n\t\t//TODO: fill\n\t}", "private void setDimenstions(String line) throws Exception {\n\t\tScanner dimensions = new Scanner(line);\n\n\t\tsetWidth((short) (2 + Short.parseShort(dimensions.next())));\n\t\tsetHeight((short) (2 + Short.parseShort(dimensions.next())));\n\n\t\tdimensions.close();\n\t}", "public String[] parse() {\n String line = input.nextLine();\n line = line.trim();\n if (StringUtils.isNotEmpty(line)) {\n return StringUtils.split(line, \" \");\n }\n return null;\n }", "public void parseLine(String line, ParseState parseState) {\n String[] lineElements = line.split(\"\\\\s\");\n if (lineElements.length != 3 || !(\"{\".equals(lineElements[2]))) {\n throw new IllegalArgumentException(\"Bad attribute definition\");\n }\n String attrName = lineElements[0];\n String attrType = lineElements[1];\n Attributes attrs = container.getSubgraphAttrs();\n attrs.defineAttribute(attrName, attrType);\n\n // parse the block with attribute value\n NST attrDataNST = attrs.getAttrDataNST(attrName);\n AttributeValueLineParser attributeValueLineParser = new AttributeValueLineParser(attrDataNST);\n PopulateDB.parseBlock(parseState, attributeValueLineParser);\n }", "public void parseFile() {\n File file = new File(inputFile);\n try {\n Scanner scan = new Scanner(file);\n\n while (scan.hasNextLine()) {\n String line = scan.nextLine();\n line = line.replaceAll(\"\\\\s+\", \" \").trim();\n\n if (line.isEmpty()) {\n continue;\n }\n // System.out.println(line);\n String cmd = line.split(\" \")[0];\n String lineWithoutCmd = line.replaceFirst(cmd, \"\").trim();\n // System.out.println(lineWithoutCmd);\n\n // The fields following each command\n String[] fields;\n\n switch (cmd) {\n case (\"add\"):\n fields = lineWithoutCmd.split(\"<SEP>\");\n fields[0] = fields[0].trim();\n fields[1] = fields[1].trim();\n fields[2] = fields[2].trim();\n add(fields);\n break;\n case (\"delete\"):\n\n fields = split(lineWithoutCmd);\n delete(fields[0], fields[1]);\n break;\n case (\"print\"):\n if (lineWithoutCmd.equals(\"ratings\")) {\n printRatings();\n break;\n }\n fields = split(lineWithoutCmd);\n\n print(fields[0], fields[1]);\n\n break;\n case (\"list\"):\n // need to check if it is the movie or reviewer\n fields = split(lineWithoutCmd);\n list(fields[0], fields[1]);\n break;\n case (\"similar\"):\n // need to check if it is the movie or reviewer\n fields = split(lineWithoutCmd);\n similar(fields[0], fields[1]);\n break;\n default:\n break;\n }\n\n }\n\n }\n catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "public String[] parseLine() throws IOException, FHIRException {\n\t\tList<String> res = new ArrayList<String>();\n\t\tStringBuilder b = new StringBuilder();\n\t\tboolean inQuote = false;\n\n\t\twhile (more() && !finished(inQuote, res.size())) {\n\t\t\tchar c = peek();\n\t\t\tnext();\n\t\t\tif (c == '\"' && doingQuotes) {\n\t\t\t\tif (ready() && peek() == '\"') {\n\t b.append(c);\n next();\n\t\t\t\t} else {\n\t\t\t inQuote = !inQuote;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (!inQuote && c == delimiter ) {\n\t\t\t\tres.add(b.toString().trim());\n\t\t\t\tb = new StringBuilder();\n\t\t\t}\n\t\t\telse \n\t\t\t\tb.append(c);\n\t\t}\n\t\tres.add(b.toString().trim());\n\t\twhile (ready() && (peek() == '\\r' || peek() == '\\n')) {\n\t\t\tnext();\n\t\t}\n\t\t\n\t\tString[] r = new String[] {};\n\t\tr = res.toArray(r);\n\t\treturn r;\n\t}", "List<CountryEntity> parseLines(List<String> line);", "private void getEachElementOfTheLine() {\n int nbOfComa = 0;\n String idItemCraft = \"\";\n ArrayList<String> idItemNeeded = new ArrayList<>();\n ArrayList<String> quantityItemNeeded = new ArrayList<>();\n boolean isFinished = false;\n for (int c = 0; c < line.length() && !isFinished; c++) {\n switch (nbOfComa) {\n\n case 2:\n quantityItemNeeded.add(new String(\"\" + line.charAt(c)));\n if (line.charAt(c + 1) == '.') {\n isFinished = true;\n } else if (line.charAt(c + 1) == ';') {\n nbOfComa = 1;\n c++;\n }\n break;\n\n case 1:\n idItemNeeded.add(new String(\"\" + line.charAt(c)));\n if (line.charAt(c + 1) == ',') {\n nbOfComa++;\n c++;\n }\n break;\n\n case 0:\n idItemCraft = idItemCraft + line.charAt(c);\n if (line.charAt(c + 1) == ';') {\n nbOfComa++;\n c++;\n }\n break;\n\n default:\n break;\n }\n }\n this.idItemCraft = idItemCraft;\n this.idItemNeeded = idItemNeeded;\n this.quantityItemNeeded = quantityItemNeeded;\n }", "protected void processLine(String line){}", "private static int[][] processInput (String info) throws FileNotFoundException, IOException\n {\n BufferedReader input = new BufferedReader(new FileReader(info));\n ArrayList<Integer> pointList = new ArrayList<Integer>();\n String point;\n while ((point = input.readLine()) != null)\n {\n StringTokenizer st = new StringTokenizer(point);\n pointList.add(Integer.parseInt(st.nextToken()));\n pointList.add(Integer.parseInt(st.nextToken()));\n }\n int[][] pointSet = new int[2][pointList.size()/2];\n int j = 0;\n for (int i = 0; i<=pointList.size()-1; i=i+2)\n {\n pointSet[0][j] = pointList.get(i);\n pointSet[1][j] = pointList.get(i+1);\n j++;\n }\n return pointSet;\n }", "public static ImmutableList<Coordinate> parseLines(ImmutableList<String> lines) {\r\n Pattern pattern = Pattern.compile(\"(\\\\d+), (\\\\d+)\");\r\n char name = 'a';\r\n\r\n ImmutableList.Builder<Coordinate> coordinates = ImmutableList.builder();\r\n for (String line : lines) {\r\n Matcher matcher = pattern.matcher(line);\r\n if (matcher.matches()) {\r\n coordinates.add(new Coordinate(\r\n name,\r\n Integer.parseInt(matcher.group(1)),\r\n Integer.parseInt(matcher.group(2))\r\n ));\r\n\r\n name++;\r\n if (name > 'z') {\r\n name = 'A';\r\n }\r\n }\r\n }\r\n\r\n return coordinates.build();\r\n }", "private static void parseInput(BufferedReader reader) {\n\t\tString line = \"\";\n\t\tField f;\n\t\ttry {\n\t\t\tline = reader.readLine();\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\twhile (line != null) {\n\t\t\tf = Field.parse(line);\n\t\t\tif (dimension < f.getCoords().getX()) {\n\t\t\t\tdimension = f.getCoords().getX();\n\t\t\t}\n\t\t\tmap.put(f.getCoords(), f);\n\t\t\ttry {\n\t\t\t\tline = reader.readLine();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t}\n\n\t}", "protected String[] parseLine() {\n ArrayList<String> lines = new ArrayList<String>();\n StringBuffer line = new StringBuffer(current);\n while (line.length() > style.lineWidth) {\n int index = split(line);\n lines.add(line.substring(0, index));\n line = new StringBuffer(line.substring(index));\n if (line.length() != 0)\n line.insert(0, continueIndentString());\n }\n if (line.length() != 0)\n lines.add(line.toString());\n return lines.toArray(new String[0]);\n }", "protected int[] parserLine(String source, int Line) {\n\t\tint[] Offset = new int[2];\n\t\tString[] Source = source.split(\"\\n\");\n\t\tint actualLine = 1;\n\t\tint counterChar = 0;\n\t\tfor(String src:Source){\n\t\t\tif(actualLine == Line){ // desired line\n\t\t\t\tOffset[0] = counterChar; //first char\n\t\t\t\tOffset[1] = counterChar+src.length()+1; //last char\n\t\t\t\treturn Offset;\n\t\t\t}\n\t\t\tcounterChar+=src.length()+1;\n\t\t\tactualLine++;\n\t\t}\n\t\treturn null;\n\t}", "public static List<String> parseStringToList(String str) {\n List<String> list = new LinkedList<>();\n if (StringUtils.isEmpty(str)){\n return list;\n }\n String[] tokens = str.trim().split(\"\\\\s*,\\\\s*\");\n if(tokens != null && tokens.length > 0) {\n for (String column : tokens) {\n list.add(column);\n }\n }\n return list;\n }", "public TFRule createTFRuleFromLine(String line) {\n\n line = removeTailComment(line);\n\n //skip blank lines or comments\n line = line.trim();\n\n try (Scanner rowScanner = new Scanner(line)) {\n rowScanner.useDelimiter(\",\");\n\n SensorData lhsExt = null;\n SensorData rhsExt = null;\n\n int[] lhsInt = null;\n String action = \"\\0\";\n\n double conf = -1.0;\n\n String lhsIntData = rowScanner.next().trim();\n\n try {\n lhsInt = getLHSIntFromString(lhsIntData);\n lhsExt = getSDFromString(rowScanner.next().trim());\n action = rowScanner.next().trim();\n rhsExt = getSDFromString(rowScanner.next().trim());\n String dblStr = rowScanner.next().trim();\n conf = Double.parseDouble(dblStr);\n } catch(InputMismatchException ime) {\n System.err.println(\"oh no!\");\n }\n\n return new TFRule(this.agent, action.charAt(0), lhsInt, lhsExt, rhsExt, conf);\n }\n }", "private static String[] parseCSVLine(String line, boolean convertToLowerCase ) {\r\n\t\t\r\n\t\t//split the line om commas, but only if that comma is not between quotes (0 or even nr of quotes ahead)\r\n\t\tString[] tokens = line.split(\",(?=([^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\");\r\n\t\t\r\n\t\tString[] result = new String[tokens.length];\r\n\t\t\r\n\t\t//get rid of spaces and enclosing double quotes\r\n\t\tfor (int i=0; i<tokens.length; i++) {\r\n\t\t\t\r\n\t\t\tString t = tokens[i].trim().replaceAll(\"^\\\"|\\\"$\", \"\");\r\n\t\t\t\r\n\t\t\tif (convertToLowerCase) {\r\n\t\t\t\tt = t.toLowerCase();\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tresult[i] = t;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}", "private void fijarDatos(BufferedReader bf ) throws IOException{\n int col = 0;\n int lin;\n String line;\n do {\n line = bf.readLine();\n if (line != null) {\n StringTokenizer tk2 = new StringTokenizer(line, \"\\t \", true);\n lin = 0;\n while (tk2.hasMoreTokens()) {\n String dato_fichero = tk2.nextToken();\n if (\"\\t\".equals(dato_fichero)) {\n datos[lin][col] = 0;\n lin++;\n } else {\n datos[lin][col] = Float.parseFloat(dato_fichero);\n //Si no estamos en la ultima columna\n if (tk2.hasMoreElements()) {\n //consuminos el \\t adicional\n tk2.nextToken();\n }\n lin++;\n }\n }\n col++;\n }\n } while (line != null);\n }", "private static List<Layout> parseLayout(String source) throws IOException{\n FileReader file = new FileReader(source);\n reader = new BufferedReader(file);\n List<Layout> layouts = new ArrayList<>();\n\n String line;\n\n while((line = reader.readLine()) != null){\n // first line - city + zip\n List<String> verticalStreets = new ArrayList<>();\n List<String> horizontalStreets = new ArrayList<>();\n\n String city = line.substring(line.indexOf(\":\") + 2, line.indexOf(\",\"));\n String zip = line.substring(line.indexOf(\",\") + 2);\n\n getStreets(verticalStreets);\n\n reader.readLine();\n getStreets(horizontalStreets);\n\n layouts.add(new Layout(city, zip, verticalStreets, horizontalStreets));\n }\n\n return layouts;\n }", "void writeLine(Object... columns) throws IOException;", "public void readLine(String line) {\n\t\tif (line.length() < 32) {\n\t\t\twhile (line.length() < 32) {\n\t\t\t\tline += \"0\";\n\t\t\t}\n\t\t}\n\n\t\tint begin = 0;\n\t\tint end = 2;\n\n\t\t\n\t\tfor (int row = 0; row < 4; row++) {\n\t\t\tfor (int col = 0; col < 4; col++) {\n\t\t\t\t// int val = 0;\n\t\t\t\tString hexVal = line.substring(begin, end);\n\t\t\t\thexVal = \"0x\" + hexVal;\n\t\t\t\tchar val; \n\t\t\t\ttry {\n\t\t\t\t\tval = (char) Integer.decode(hexVal).intValue();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// System.out.println(\"Error: Key has non hex characters.\");\n\t\t\t\t\tthis.state = null;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.state[row][col] = val;\n\t\t\t\tbegin += 2;\n\t\t\t\tend += 2;\n\t\t\t}\n\t\t}\n\t}", "private static void processNodeLine(String line, int node) {\r\n\r\n\t\tString wordLeft = \"\"; // left side of catalog eqs\r\n\r\n\t\t/*\r\n\t\t * switch for scanning catalogs. -1 = nothing 0 = driver, 1=hostname,\r\n\t\t * 2=username, 3=passwd\r\n\t\t *\r\n\t\t */\r\n\t\tint catalog = -1;\r\n\r\n\t\tfor (int x = 0; x < line.length(); x++) {\r\n\t\t\t// System.out.print(line.charAt(x));\r\n\t\t\t// catalog = compare(wordLeft);\r\n\r\n\t\t\tif (catalog == -1) {\r\n\t\t\t\twordLeft = wordLeft + line.charAt(x);\r\n\t\t\t\tcatalog = catalogCompare(wordLeft);\r\n\t\t\t} else if (catalog == 0) {\r\n\t\t\t\tcatalogDriver = catalogDriver + line.charAt(x);\r\n\t\t\t} else if (catalog == 1) {\r\n\t\t\t\tcatalogHostName = catalogHostName + line.charAt(x);\r\n\t\t\t} else if (catalog == 2) {\r\n\t\t\t\tcatalogUserName = catalogUserName + line.charAt(x);\r\n\t\t\t} else if (catalog == 3) {\r\n\t\t\t\tcatalogPassword = catalogPassword + line.charAt(x);\r\n\t\t\t} else if (catalog == 4) {\r\n\t\t\t\t// numnodes = (int) line.substring(x);\r\n\r\n\t\t\t\tnumnodes = Integer.parseInt(line.substring(x));\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public String[] parseCsv(Reader reader, String separator, boolean hasHeader) throws IOException {\n List<String> columnNames = new LinkedList<String>();\n String[] nodesInfo = new String[GlobalVar.numberOfNodes];\n int nodeCount=0;\n BufferedReader br = null;\n br = new BufferedReader(reader);\n String line;\n int numLines = 0;\n while ((line = br.readLine()) != null) {\n if (!line.startsWith(\"#\")) {\n String[] tokens = line.split(separator);\n if (tokens != null) {\n if (numLines == 0) {\n for (int i = 0; i < tokens.length; ++i) {\n columnNames.add(hasHeader ? tokens[i] : (\"row_\"+i));\n }\n } else {\n nodesInfo[nodeCount++]= tokens[0]; \n }\n \n }\n ++numLines; \n }\n }\n return nodesInfo;\n }", "private void parseLine(String line) throws ParsingException {\n if (line.startsWith(COMMENT_PREFIX)) //Ignore comments\n return;\n String parts[] = line.split(SEPARATOR_PARAMETER);\n if (parts.length == 2) { //PARAMETER=VALUE\n if (isValidParameter(parts[0])) //If the parameter is present in the config list then add it\n parameters.put(parts[0], parts[1]);\n } else if (parts.length == 1 && parts[0].startsWith(OPTION_PREFIX)) { //-OPTION\n String option = parts[0].substring(OPTION_PREFIX.length());\n if (isValidOption(option))\n parameters.put(option, null); //Null in value differs options from parameters\n } else\n throw new ParsingException(buildErrorMessage(EXCEPTION_BAD_FORMAT));\n }", "private static int[][] parseMatrixInput(String input) throws MatrixException {\n String[] rows = input.trim().split(\"\\n\");\n String[] columns = rows[0].trim().split(\" \");\n\n // Various checks against dimension\n if(rows.length < 1 || columns.length < 1) {\n throw new MatrixException(\"Matrix Exception: Matrix does not have rows or perhaps columns.\");\n }\n\n if(rows.length != columns.length) {\n throw new MatrixException(\"Matrix Exception: Square matrix not provided\");\n }\n\n if(!MatrixHelpers.isAPowerOfTwo(rows.length)) {\n throw new MatrixException(\"Matrix Exception: Matrix dimension is not a power of two.\");\n }\n\n // Should be ideal dimension\n int [][] matrix = new int[rows.length][columns.length];\n\n try {\n for(int i = 0; i < rows.length; i++) {\n // Tokenize horizontally\n String[] rowTokens = rows[i].trim().split(\" \");\n\n // Check for a dodgy line\n if(rowTokens.length != columns.length) {\n throw new MatrixException(\"Matrix Exception: Matrix row length does not conform to original dimension.\");\n }\n\n for(int j = 0; j < rowTokens.length; j++) {\n matrix[i][j] = Integer.parseInt(rowTokens[j]);\n }\n }\n } catch(ArrayIndexOutOfBoundsException | NumberFormatException ex) {\n throw new MatrixException(\"Matrix Exception: Could not parse number.\", ex);\n }\n\n return matrix;\n }", "public void parseLine(String line, ParseState parseState) {\n String[] lineElements = line.split(\"\\\\s\");\n if (lineElements.length != 4 || !(\"{\".equals(lineElements[3]))) {\n throw new IllegalArgumentException(\"Bad attribute definition\");\n }\n boolean isObjectAttr = (\"O\".equals(lineElements[0]));\n String attrName = lineElements[1];\n String attrType = lineElements[2];\n Attributes attrs = (isObjectAttr ? DB.getObjectAttrs() : DB.getLinkAttrs());\n attrs.defineAttribute(attrName, attrType);\n\n // parse the block with attribute value\n NST attrDataNST = attrs.getAttrDataNST(attrName);\n AttributeValueLineParser attributeValueLineParser = new AttributeValueLineParser(attrDataNST);\n PopulateDB.parseBlock(parseState, attributeValueLineParser);\n }", "public int getColumnAmount(BufferedReader br) {\n\n String rowStr;\n\n try {\n //Get into string\n rowStr = br.readLine();\n\n //Split into 1D array\n columns = rowStr.split(\"\\t\");\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n //Return number of elements -1 for id column\n return columns.length - 1;\n }", "public List<ConvertedLine> convert(final String line) {\n if (line.length() > 400) {\n return null;\n }\n\n Matcher match = linePattern.matcher(line);\n\n if (match.matches()) {\n String file = null;\n int lineno = -1;\n\n if (fileGroup >= 0) {\n file = match.group(fileGroup);\n // Make some adjustments - easier to do here than in the regular expression\n // (See 109721 and 109724 for example)\n if (file.startsWith(\"\\\"\")) { // NOI18N\n file = file.substring(1);\n }\n if (file.startsWith(\"./\")) { // NOI18N\n file = file.substring(2);\n }\n if (filePattern != null && !filePattern.matcher(file).matches()) {\n return null;\n }\n }\n\n if (lineGroup >= 0) {\n String linenoStr = match.group(lineGroup);\n\n try {\n lineno = Integer.parseInt(linenoStr);\n } catch (NumberFormatException nfe) {\n LOGGER.log(Level.INFO, null, nfe);\n lineno = 0;\n }\n }\n\n return Collections.<ConvertedLine>singletonList(\n ConvertedLine.forText(line,\n new FileListener(file, lineno, locator, handler)));\n }\n\n return null;\n }", "public int[] decodeFrame(String line) {\n int len = line.length() / 5;\n int[] result = new int[ len ];\n \n for(int i=0; i < len; i++) {\n int start = (i*5)+2;\n String hex = line.substring( start, start+2 );\n int dec = Integer.parseInt( hex, 16 );\n result[i] = dec;\n }\n \n return result;\n }", "static Map.Entry<String, String> splitLine(String line) {\n // TODO: Make this method less gross!\n int count = 0;\n int cur = 0;\n do {\n cur = line.indexOf(' ', cur+1); // Move cursor to next space character.\n count++;\n } while (0 <= cur && count < 4);\n\n String key, value;\n if (0 <= cur && cur < line.length()) {\n // Don't include the separating space in either `key` or `value`:\n key = line.substring(0, cur); //\n value = line.substring(cur+1, line.length());\n } else {\n key = line;\n value = \"\";\n }\n\n return new Map.Entry<String, String>() {\n @Override public String getKey() {\n return key;\n }\n @Override public String getValue() {\n return value;\n }\n @Override public String setValue(String value) {\n throw new UnsupportedOperationException();\n }\n };\n }", "private void parseData() throws IOException {\n // The data section ends with a dashed line...\n //\n while (true) {\n String line = reader.readLine();\n\n if (line == null || isDashedLine(line))\n return;\n else\n parseLine(line);\n }\n }", "protected String[] splitLine(String line) {\n return StringUtils.splitPreserveAllTokens(line, TabbedLineReader.this.delim);\n }", "protected void parseLine(String dataLine) {\n String[] line = dataLine.split(\",\");\n if (validater(line)) {\n try {\n Route route =\n new Route(\n line[airline],\n Integer.parseInt(line[airlineID]),\n line[sourceAirport],\n Integer.parseInt(line[sourceAirportID]),\n line[destinationAirport],\n Integer.parseInt(line[destinationAirportID]),\n line[codeshare],\n Integer.parseInt(line[stops]),\n line[equipment].split(\" \"));\n addRoute(route);\n } catch (Exception e) {\n errorCounter(11);\n }\n }\n }", "private static List<StudentRecord> convert(List<String> lines) {\n\t\tObjects.requireNonNull(lines);\n\t\t\n\t\tArrayList<StudentRecord> result = new ArrayList<>(lines.size());\n\t\t\n\t\tfor(String data : lines) {\n\t\t\tif(data.length() == 0) continue; //preskoci prazne linije\n\t\t\tScanner sc = new Scanner(data);\n\t\t\tsc.useDelimiter(\"\\t\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tresult.add(new StudentRecord(sc.next(), sc.next(), sc.next(), sc.next(), sc.next(), sc.next(), sc.next()));\n\t\t\t}catch(NoSuchElementException e) {\n\t\t\t\tsc.close();\n\t\t\t\tthrow new NoSuchElementException(\"Data not formatted correctly.\");\n\t\t\t}\n\t\t\tsc.close();\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "private int[] getColumnNumbers(String f, String t) throws Exception {\n\t\tint[] numbers = new int[2];\n\t\tBufferedReader br = new BufferedReader(new FileReader(f));\n\t\tString header = br.readLine();\n\t\tbr.close();\n\t\tString[] tokens = header.split(\"\\t\");\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tfor (String token:tokens) {\n\t\t\tif (token.equalsIgnoreCase(t)) {\n\t\t\t\tnumbers[j] = i;\n\t\t\t\tj++;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn numbers;\n\t}", "public static GPSPeak parseLine(Genome g, String gpsLine, int lineNumber) {\n\t\tGPSPeak peak;\n\t\tString[] t = gpsLine.split(\"\\t\");\n\t\tif (t.length == 14 ) {\t\t// with kmer info, and motifId\n\t \t// GEM output format 2016-10-27\t\n\t \t// Position IP Control Fold Expectd Q_-lg10 P_-lg10 P_poiss IPvsEMP Noise KmerGroup MotifId KG_hgp Strand\n\t\t\tStrandedPoint r = StrandedPoint.fromString(g, t[0]);\n peak = new GPSPeak(g, r.getChrom(), r.getLocation(), r.getStrand(), \n Double.parseDouble(t[1]), Double.parseDouble(t[2]), Double.parseDouble(t[4]), Double.parseDouble(t[5]), \n Math.pow(10,-1*Double.parseDouble(t[6])), Double.parseDouble(t[6]), Double.parseDouble(t[7]), Double.parseDouble(t[8]), Double.parseDouble(t[9]),\n t[10], (int)Double.parseDouble(t[12]), t[13].charAt(0), \"\");\n\t } else if (t.length == 15 ) {\t\t// with kmer info\n\t \t// GEM output format 2011-07-25\t\n\t \t// Position\t IP\tControl\t Fold\tExpectd\tQ_-lg10\tP_-lg10\tP_poiss\tIPvsEMP\tIPvsCTR\tKmer\tCount\tStrength\tBoundSequence\tEnrichedHGP\n\t\t\tStrandedPoint r = StrandedPoint.fromString(g, t[0]);\n peak = new GPSPeak(g, r.getChrom(), r.getLocation(), r.getStrand(), \n Double.parseDouble(t[1]), Double.parseDouble(t[2]), Double.parseDouble(t[4]), Double.parseDouble(t[5]), \n Math.pow(10,-1*Double.parseDouble(t[6])), Double.parseDouble(t[6]), Double.parseDouble(t[7]), Double.parseDouble(t[8]), Double.parseDouble(t[9]),\n t[10], (int)Double.parseDouble(t[11]), t[12].charAt(0), t[13]);\n\t } else if (t.length == 13 ) {\t\t// with kmer info\n\t \t// GEM output format 2012-03\t\n\t \t// Position\t IP\tControl\t Fold\tExpectd\tQ_-lg10\tP_-lg10\tP_poiss\tIPvsEMP\tIPvsCTR\tKmer\tCount\tStrength\tBoundSequence\n\t \tStrandedPoint r = StrandedPoint.fromString(g, t[0]);\n peak = new GPSPeak(g, r.getChrom(), r.getLocation(), r.getStrand(), \n Double.parseDouble(t[1]), Double.parseDouble(t[2]), Double.parseDouble(t[4]), Double.parseDouble(t[5]), \n Math.pow(10,-1*Double.parseDouble(t[6])), Double.parseDouble(t[6]), Double.parseDouble(t[7]), Double.parseDouble(t[8]), Double.parseDouble(t[9]),\n t[10], (int)Double.parseDouble(t[11]), t[12].charAt(0), \"\");\n\t } else if (t.length == 10 ) {\t\t// not with kmer info\n\t \t// GPS output format 2011-07-25\t\n\t \t// Position\t IP\tControl\t Fold\tExpectd\tQ_-lg10\tP_-lg10\tP_poiss\tIPvsEMP\tIPvsCTR\t\n\t \tStrandedPoint r = StrandedPoint.fromString(g, t[0]);\n peak = new GPSPeak(g, r.getChrom(), r.getLocation(), r.getStrand(), \n Double.parseDouble(t[1]), Double.parseDouble(t[2]), Double.parseDouble(t[4]), Double.parseDouble(t[5]), \n Math.pow(10,-1*Double.parseDouble(t[6])), Double.parseDouble(t[6]), Double.parseDouble(t[7]), Double.parseDouble(t[8]), Double.parseDouble(t[9]),\n \"\", 0, '*', \"\");\n\t } else {\n throw new RuntimeException(\"Invalid number of fields (\" + t.length + \") on line \" + lineNumber + \": \" + gpsLine);\n }\n return peak;\n }", "private static List<Double> parse_line_double(String line, int d) throws Exception {\n\t List<Double> ans = new ArrayList<Double>();\n\t StringTokenizer st = new StringTokenizer(line, \" \");\n\t if (st.countTokens() != d) {\n\t throw new Exception(\"Bad line: [\" + line + \"]\");\n\t }\n\t while (st.hasMoreElements()) {\n\t String s = st.nextToken();\n\t try {\n\t ans.add(Double.parseDouble(s));\n\t } catch (Exception ex) {\n\t throw new Exception(\"Bad Integer in \" + \"[\" + line + \"]. \" + ex.getMessage());\n\t }\n\t }\n\t return ans;\n\t }", "String getColumn();", "private static void parseBlockSectionLine(String line, int lineNum, int counter, SingleLevel level) {\r\n if (!level.checkLevelValues()) {\r\n System.out.print(\"Missing level information, check the text file\");\r\n System.exit(0);\r\n }\r\n int currentX = level.blocksXPos();\r\n int currentY = level.blocksStartY() + counter * level.rowHeight();\r\n for (int i = 0; i < line.length(); i++) {\r\n String symbol = String.valueOf(line.charAt(i));\r\n if (blocksFromSymbolsFactory.isSpaceSymbol(symbol)) {\r\n currentX += blocksFromSymbolsFactory.getSpaceWidth(symbol);\r\n } else if (blocksFromSymbolsFactory.isBlockSymbol(symbol)) {\r\n Block block = blocksFromSymbolsFactory.getBlock(symbol, currentX, currentY);\r\n level.addBlock(block);\r\n currentX = (int) (currentX + block.getCollisionRectangle().getWidth());\r\n } else {\r\n System.out.println(\"Error in symbol in line: \" + lineNum + \" Check the text file\");\r\n System.exit(0);\r\n }\r\n }\r\n }", "public void parse(InputStream in) throws IOException {\n InputStreamReader isr = null;\n BufferedReader layoutReader = null;\n try {\n isr = new InputStreamReader(in, \"UTF-8\");\n layoutReader = new BufferedReader(isr);\n List<String> rawQualifiers = new ArrayList<String>();\n List<String> rawSchemas = new ArrayList<String>();\n\n String qualifier;\n String json;\n String line = layoutReader.readLine();\n while (line != null) {\n // Skip empty lines.\n if (line.equals(EMPTY_LINE)) {\n line = layoutReader.readLine();\n continue;\n }\n\n if (SKIP_ENTRY_TOKEN.equals(line)) {\n // null entries indicate this column should be skipped.\n qualifier = null;\n json = null;\n } else {\n qualifier = parseName(line);\n json = parseSchema(layoutReader);\n }\n\n rawQualifiers.add(qualifier);\n rawSchemas.add(json);\n\n line = layoutReader.readLine();\n }\n\n mQualifierInfo = Collections.unmodifiableList(makeQualifierInfo(rawQualifiers, rawSchemas));\n\n LOG.info(\"Parsed input layout of size: \" + getQualifierInfo().size());\n } finally {\n IOUtils.closeQuietly(layoutReader);\n IOUtils.closeQuietly(isr);\n }\n }", "protected abstract Operation parseLine(File baseDir, String line, int lineNum) throws IOException;", "public String fixline(String line, float by);", "public static List<Matrix> parseFile(Path path) {\n\t\tList<String> lines = null;\n\t\t\n\t\ttry {\n\t\t\tlines = Files.readAllLines(path);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tint lineCount = lines.size();\n\t\tMatrix A = null;\n\t\tMatrix y = null;\n\t\tint rowIndex = 0;\n\t\tfor (String line : lines) {\n\t\t\t\n\t\t\t// If line is a comment skip\n\t\t\tif (line.startsWith(\"#\")) {\n\t\t\t\tlineCount--;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif (A == null) {\n\t\t\t\tA = new Matrix(lineCount, lineCount);\n\t\t\t}\n\t\t\t\n\t\t\tif (y == null) {\n\t\t\t\ty = new Matrix(lineCount, 1);\n\t\t\t}\n\t\t\t\n\t\t\tList<Double> dList = Util.parseLine(line);\n\t\t\t\n\t\t\t// Extract numbers\n\t\t\tfor (int i = 0, len = dList.size(); i < len; i++) {\n\t\t\t\n\t\t\t\t// Not last number - contained in A\n\t\t\t\tif (i+1 < len) {\n\t\t\t\t\tA.set(rowIndex, i, dList.get(i));\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t// ... else go to y\n\t\t\t\t\ty.set(rowIndex, 0, dList.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\trowIndex++;\n\t\t}\n\t\t\n\t\tList<Matrix> sol = new ArrayList<>();\n\t\tsol.add(A);\n\t\tsol.add(y);\n\t\t\n\t\treturn sol;\n\t}", "private void parseAxiom(String line) throws IllegalArgumentException {\n\t\tString[] tokens = line.split(\"\\\\s+\");\n\t\tif(tokens.length != 2) {\n\t\t\tthrow new IllegalArgumentException(\"Invalid unitLength argument\");\n\t\t}\n\t\tthis.setAxiom(tokens[1]);\n\t}", "java.lang.String getColumn();", "protected String[] splitMVSLine(String raw) {\n if (raw == null) {\n return new String[] {};\n }\n StringTokenizer st = new StringTokenizer(raw);\n String[] rtn = new String[st.countTokens()];\n int i = 0;\n while (st.hasMoreTokens()) {\n String nextToken = st.nextToken();\n rtn[i] = nextToken.trim();\n i++;\n }\n return rtn;\n }", "public void parseLine(String line, int lineNumber) {\n // Do stuff with line here\n System.out.println(line);\n }", "private void parseUnitLength(String line) throws IllegalArgumentException {\n\t\tString[] tokens = line.split(\"\\\\s+\");\n\t\tif(tokens.length != 2) {\n\t\t\tthrow new IllegalArgumentException(\"Invalid unitLength argument\");\n\t\t}\n\t\tthis.setUnitLength(Double.parseDouble(tokens[1]));\n\t}", "private static void readLine(BufferedReader br, String field, String line, int pos, GameFile gameFile) throws IOException {\r\n\t\t\r\n\t\tString[] s = line.split(\"=\"); //splits the current line at equal sines\r\n\t\t\r\n\t\tString n = s[0];\r\n\t\t\r\n\t\tif(n.isEmpty()) return;\r\n\t\tif(n.startsWith(\"#\")) return; //if the line is a comment, skip the line\r\n\t\t\r\n\t\tString f = field + \".\" + n; //add the field name to the end of the field chain\r\n\t\t\r\n\t\t//if the line does not contain an equales sine than just add the line to the gamefile\r\n\t\tif(s.length == 1) {\r\n\t\t\tgameFile.add(field, n, pos);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//if the rest of the current line starts with a currly bracket than read that line\r\n\t\tif(s[1].startsWith(\"{\")) {\r\n\t\t\tString newLine = line.substring(line.indexOf(\"{\")+1); //gets the line after the currly bracket\r\n\t\t\tif(f.contains(\"?\"))\r\n\t\t\t\tf = f.replace(\"?\", \":\");\r\n\t\t\tread(br, f, newLine.replace(\"\\\\}\", \"}\"), pos+1, gameFile); //replases the exscaped end currly bracket with a nonecaped one\r\n\t\t} else { //else add the line to the gamefile\r\n\t\t\t//if the line contains commas, run through whats between the commas as sepret entrys\r\n\t\t\tif(line.contains(\",\")) {\r\n\t\t\t\tString[] split = line.split(\",\");\r\n\t\t\t\tfor(String l: split) {\r\n\t\t\t\t\treadLine(br, field, l, pos, gameFile);\r\n\t\t\t\t}\r\n\t\t\t} else { //else add the line with out currly brackets\r\n\t\t\t\tgameFile.add(f, s[1].replace(\"}\", \"\"), pos);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn;\r\n\t\t\r\n\t}", "private void createParseTable() {\n parseTableHeader = new HashMap<String, Integer>();\n parseTable = new ArrayList<ArrayList<String>>();\n pHeader = new ArrayList<String>();\n\n String inputLine = null;\n int fileLine = 1;\n int headerCount = 0;\n\n try {\n FileReader reader = new FileReader(parseTableFile);\n BufferedReader bufferedReader = new BufferedReader(reader);\n\n while((inputLine = bufferedReader.readLine()) != null) {\n\n // removes all leading and trailing whitespaces and leading tabs\n String line = inputLine.trim().replaceFirst(\"\\\\t\", \"\");\n\n // these are header rows for terminals and variables\n if(fileLine == 1 || fileLine == 40) {\n String[] cells = line.replaceFirst(\"&\", \"\").split(\"&\");\n for(String cell : cells) {\n// System.out.println(cell);\n if(!parseTableHeader.containsKey(cell) && cell != \"\") {\n parseTableHeader.put(cell, headerCount);\n// System.out.println(headerCount);\n pHeader.add(cell);\n headerCount++;\n }\n }\n }\n else {\n String[] parsedRow = line.split(\"&\",-1);\n // get actual SLR parse table's row number\n int row = Integer.parseInt(parsedRow[0]);\n\n// System.out.println(\"Parsing row number \\t\\t\" + row);\n\n // create a new Array that excludes the row number column\n String[] tempRow = Arrays.copyOfRange(parsedRow, 1, parsedRow.length);\n // remove null / empty entries from Array\n replaceBlanks(tempRow);\n // convert to ArrayList for easier handling\n ArrayList<String> cells = new ArrayList<>(Arrays.asList(tempRow));\n\n// System.out.print(\"Parsed row content \\t\\t\");\n// printArrayList(cells);\n// System.out.println();\n\n // add above ArrayList to the table at the correct row number.\n // because there's two parts to the parse table's row, only\n // add right away if we haven't added anything before\n // otherwise combine the previous entry with this one to create\n // complete entry for this row\n try {\n ArrayList<String> current = parseTable.get(row);\n\n// System.out.print(\"Contents of row \" + row + \"\\t\\t\");\n// printArrayList(current);\n// System.out.println();\n\n // temporary ArrayList to hold previous entry and new entry\n ArrayList<String> temp = new ArrayList<String>();\n temp.addAll(current);\n temp.addAll(cells);\n\n// System.out.print(\"New combined row \\t\\t\");\n// printArrayList(temp);\n// System.out.println();\n\n // add combined ArrayList to the parse table\n parseTable.set(row, temp);\n } catch (IndexOutOfBoundsException e) {\n parseTable.add(row, cells);\n }\n\n// System.out.print(\"Final row \\t\\t\\t\\t\");\n// printArrayList(parseTable.get(row));\n// System.out.println();\n// System.out.println();\n\n }\n\n fileLine++;\n\n }\n if(printPTABLE == \"Y\") {\n printTable();\n }\n bufferedReader.close();\n\n } catch(FileNotFoundException e) {\n System.out.println(\n parseTableFile + \" not found\"\n );\n } catch(IOException e) {\n System.out.println(\n \"Error reading file \" + parseTableFile\n );\n }\n\n }", "public static Vector<String> parseLine(String line, String separator)\n\t{\n\t\tVector<String> partes=new Vector<>();\n\t\tint index = 0,offset = 0;\n\t\tint indexComillas;\n\t\tboolean startingComillas = true;\n\t\tif(line==null)return partes;\n\t\tif(!line.endsWith(separator))line+=separator;\n\t\tif((indexComillas = line.indexOf('\\\"')) == -1)indexComillas = Integer.MAX_VALUE;\n\t\twhile((index=line.indexOf(separator,startingComillas ? offset : indexComillas))!=-1)\n\t\t{\n\t\t\tif(index > indexComillas)\n\t\t\t{\n\t\t\t\tif((indexComillas = line.indexOf('\\\"', index)) == -1)indexComillas = Integer.MAX_VALUE;\n\t\t\t\tif(startingComillas)\n\t\t\t\t{\n\t\t\t\t\tstartingComillas = false;\n\t\t\t\t\toffset++;\n\t\t\t\t\tif(indexComillas == Integer.MAX_VALUE)break;\n\t\t\t\t\telse continue;\n\t\t\t\t}\n\t\t\t\telse startingComillas = true;\n\t\t\t\tindex--;\n\t\t\t}\n\t\t\tpartes.addElement(line.substring(offset,index));\n\t\t\toffset=index;\n\t\t\twhile(line.startsWith(separator,++offset)&&offset<line.length()); // Elimino separadores seguidos\n\t\t}\n\t\tif(!startingComillas) // Si faltan las comillas de cierre, igual pongo esa parte\n\t\t\tpartes.addElement(line.substring(offset, line.length() - separator.length()));\n\t\treturn partes;\n\t}", "public void parse(){\n\t\t//Read next line in content; timestamp++\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(instructionfile))) {\n\t\t String line;\n\t\t while ((line = br.readLine()) != null) {\n\t\t \t//divide the line by semicolons\n\t\t \tString[] lineParts = line.split(\";\");\n\t\t \tfor(String aPart: lineParts){\n\t\t\t \tSystem.out.println(\"Parser:\"+aPart);\n\n\t\t\t \t// process the partial line.\n\t\t\t \tString[] commands = parseNextInstruction(aPart);\n\t\t\t \tif(commands!=null){\n\t\t\t\t\t\t\n\t\t\t \t\t//For each instruction in line: TransactionManager.processOperation()\n\t\t\t \t\ttm.processOperation(commands, currentTimestamp);\n\t\t\t \t}\n\t\t \t}\n\t\t \t//Every new line, time stamp increases\n\t \t\tcurrentTimestamp++;\n\t\t }\n\t\t} catch (FileNotFoundException e) {\n \t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n \t\t\te.printStackTrace();\n\t\t}\n\t}", "private MadisRecord processMadis(String[] headerType, String line) {\n\n MadisRecord rec = null;\n\n if (!line.isEmpty() && (headerType != null)) {\n\n if (headerType.length == typeDHeader.length) {\n rec = processTypeD(line, headerType);\n } else if (headerType.length == typeFHeader.length) {\n rec = processTypeF(line, headerType);\n } else {\n throw new UnsupportedOperationException(\n \"Unknown Header format for MADIS file! \" + headerType);\n }\n }\n\n return rec;\n\n }", "public Task parseLine(String line) {\n assert(line != null && !line.equals(\"\"));\n\n String[] x = line.split(\"\\\\|\");\n String taskType = x[0].strip();\n boolean isDone = !x[1].strip().equals(\"0\");\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"d MMM yyyy HH:mm\");\n\n if (taskType.equals(\"T\")) {\n return new ToDo(x[2].strip(), isDone);\n } else if (taskType.equals(\"D\")) {\n String by = x[x.length - 1].strip();\n LocalDateTime byy = LocalDateTime.parse(by, formatter);\n return new Deadline(x[2].strip(), isDone, byy);\n } else { // Event\n String at = x[x.length - 1].strip();\n LocalDateTime att = LocalDateTime.parse(at, formatter);\n return new Event(x[2].strip(), isDone, att);\n }\n }", "private static double[] extractRainfallInformation(String[] line){\n int index = line.length - 2;\n double[] out = new double[ index ]; // Without the first two elements(City & Country)\n\n for(int i = 0; i < index ;i++){\n out[i] = Double.parseDouble(line[i + 2]);// \"3.55\" => 3.55\n }\n\n return out;\n }", "private ImportCommand parseLinesFromFile(BufferedReader br) {\n boolean hasContactWithInvalidField = false;\n boolean hasContactWithoutName = false;\n try {\n String line = br.readLine();\n while (line != null) {\n String[] attributes = line.split(\",\", -1);\n int numAttributes = attributes.length;\n\n if (attributes[NAME_FIELD].equalsIgnoreCase(\"Name\")\n || attributes[NAME_FIELD].equalsIgnoreCase(\"Name:\")) { // ignore headers\n line = br.readLine();\n continue;\n }\n\n if (contactHasNoName(attributes, numAttributes)) {\n hasContactWithoutName = true;\n line = br.readLine();\n continue;\n }\n\n Name name = null;\n Optional<Phone> phone = Optional.empty();\n Optional<Email> email = Optional.empty();\n Optional<Address> address = Optional.empty();\n Meeting meeting = null;\n\n try {\n name = ParserUtil.parseName(attributes[NAME_FIELD]);\n if (!attributes[PHONE_FIELD].matches(\"\")) {\n phone = Optional.of(ParserUtil.parsePhone(attributes[PHONE_FIELD]));\n }\n if (!attributes[EMAIL_FIELD].matches(\"\")) {\n email = Optional.of(ParserUtil.parseEmail(attributes[EMAIL_FIELD]));\n }\n if (!attributes[ADDRESS_FIELD].matches(\"\")) {\n address = Optional.of(ParserUtil.parseAddress(attributes[ADDRESS_FIELD]));\n }\n if (!attributes[MEETING_FIELD].matches(\"\")) {\n meeting = ParserUtil.parseMeeting(attributes[MEETING_FIELD]);\n }\n } catch (ParseException pe) {\n hasContactWithInvalidField = true;\n line = br.readLine();\n continue;\n }\n\n ArrayList<String> tags = new ArrayList<>();\n //Check for tags\n if (numAttributes > TAG_FIELD_START) {\n for (int i = TAG_FIELD_START; i < numAttributes; i++) {\n if (!attributes[i].matches(\"\")) {\n tags.add(attributes[i]);\n }\n }\n }\n\n Set<Tag> tagList = null;\n try {\n tagList = ParserUtil.parseTags(tags);\n } catch (ParseException e) {\n line = br.readLine();\n continue;\n }\n if (meeting == null) {\n persons.add(new Person(name, phone, email, address, tagList));\n } else {\n persons.add(new Person(name, phone, email, address, tagList, meeting));\n }\n line = br.readLine();\n }\n br.close();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n return new ImportCommand(persons, hasContactWithInvalidField, hasContactWithoutName);\n }", "protected void processLine(String aLine){\n\t\t \t\t String temp=aLine.substring(0, 7);\n\t\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t\t \t\t int ID=Integer.parseInt(temp);\n\t \t\t String name=aLine.substring(7, 12);\n\t \t\t //int forget=;//epoch\n\t \t\t temp=aLine.substring(31, 42);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t double a=Double.parseDouble(temp);//TODO determine what the scale of simulation should be\n\t \t\t temp=aLine.substring(42, 53);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t double e=Double.parseDouble(temp);\n\t \t\t \n\t \t\t asteriod newBody=new asteriod(a,e);//TODO find asteriodal angular shit\n\t \t\t \n\t \t\t double temp2;\n\t \t\t //54 to 63 for inclination\n\t \t\t temp=aLine.substring(54,63);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t temp2=Double.parseDouble(temp);\n\t \t\t newBody.Inclination=Math.toRadians(temp2);\n\t \t\t //64 for argument of periapsis\n\t \t\t temp=aLine.substring(63, 74);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t temp2=Double.parseDouble(temp);\n\t \t\t newBody.ArgPeriapsis=Math.toRadians(temp2);\n\t \t\t //Longitude of ascending node\n\t \t\t temp=aLine.substring(73, 84);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t temp2=Double.parseDouble(temp);\n\t \t\t newBody.LongAscenNode=Math.toRadians(temp2);\n\t \t\t //Mean Anommally/PHI\n\t \t\t temp=aLine.substring(83,96);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t temp2=Double.parseDouble(temp);\n\t \t\t temp2=Math.toRadians(temp2);\n\t \t\t newBody.meanAnomaly0=temp2;\n\t \t\t \n\t \t\t temp=aLine.substring(95,100);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t temp2=Double.parseDouble(temp);\n\t \t\t newBody.H=temp2;\n\t \t\t \n\t \t\t newBody.ID=ID;\n\t \t\t newBody.name=name;\n\t \t\t newBody.setType();\n\t \t\t runnerMain.bodies.add(newBody);\n\t \t\t System.out.println(\"e:\"+newBody.eccentricity+\" ID:\"+ID+\" name: \"+name+\" LongAsnNd: \"+newBody.LongAscenNode+\" Peri: \"+newBody.ArgPeriapsis+\" MeanAn0: \"+newBody.meanAnomaly0);\n\t\t }", "@Test\n\t@SuppressWarnings(\"unchecked\")\n\tpublic void test_headerSplitOnNofLinesWithRegex() throws StageException, IOException {\n\t\tprocessor.headerConfig = getHeaderConfig(null, NOF_HEADER_LINES);\n\n\t\t// prepare details config\n\t\tprocessor.detailsConfig.detailsColumnHeaderType = DetailsColumnHeaderType.USE_HEADER;\n\t\tprocessor.detailsConfig.separatorAsRegex = true;\n\t\tprocessor.parserConfig.splitDetails = true;\n\t\t\n\t\trunner = new ProcessorRunner.Builder(HeaderDetailParserDProcessor.class, processor)\n\t\t\t\t.setExecutionMode(ExecutionMode.STANDALONE)\n\t\t\t\t.setResourcesDir(\"/tmp\")\n\t\t\t\t.addOutputLane(\"header\").addOutputLane(\"headerDetails\")\n\t\t\t\t.build();\n\t\trunner.runInit();\n\n\t\t// run the test\n\t\tList<Record> op = null;\n\t\ttry {\n\t\t\tList<Record> input = prepareInput(TEST_FILE_WITH_HEADER_AND_DETAILS_HEADER);\n\t\t \n\t\t\tlong startTime = System.currentTimeMillis();\n\t\t\t\n\t\t\tStageRunner.Output output = runner.runProcess(input);\n\t\t\t\n\t\t System.out.println(\"test_headerSplitOnNofLinesWithRegex - Total execution time: \" + (System.currentTimeMillis()-startTime) + \"ms\"); \n\t\t\t\n\t\t op = output.getRecords().get(\"headerDetails\");\n\n\t\t} finally {\n\t\t\trunner.runDestroy();\n\t\t}\n\n\t\t// assert\n\t\tassertEquals(42324, op.size());\n//\t\tassertEquals(\"11:02:12.000\", StringUtils.substring(op.get(0).get(\"/detail\").getValueAsString(), 0, 12));\n\t}" ]
[ "0.7137207", "0.68578094", "0.62982637", "0.5977439", "0.593722", "0.58405757", "0.572389", "0.5715253", "0.56843793", "0.56830716", "0.56508213", "0.56328136", "0.5564758", "0.55202264", "0.55176425", "0.5506241", "0.5441957", "0.5401197", "0.5399271", "0.5388428", "0.53717804", "0.53178185", "0.53024924", "0.52713495", "0.52594507", "0.52507544", "0.52452093", "0.5245056", "0.52246356", "0.5209663", "0.51915896", "0.51843023", "0.5183959", "0.5182148", "0.5177067", "0.51675034", "0.51495993", "0.5130553", "0.51206475", "0.5102279", "0.5100982", "0.50926983", "0.50691074", "0.505857", "0.5054672", "0.5052104", "0.5049266", "0.5043854", "0.50144565", "0.5010486", "0.50102067", "0.50004286", "0.49949133", "0.49855834", "0.4985294", "0.49849278", "0.49814832", "0.4979161", "0.4978121", "0.49711034", "0.4970615", "0.496989", "0.49696347", "0.49592572", "0.49462742", "0.49451783", "0.4944131", "0.4921105", "0.49209768", "0.49206558", "0.49121794", "0.49090073", "0.49086332", "0.4905171", "0.48988643", "0.48828968", "0.48763347", "0.48699787", "0.48609245", "0.48588043", "0.4857562", "0.48487648", "0.48390654", "0.48376065", "0.48373434", "0.48344713", "0.48338094", "0.48319656", "0.48318186", "0.48210597", "0.48157364", "0.48154894", "0.48136958", "0.48125634", "0.48115268", "0.4811252", "0.48001295", "0.47947", "0.4794554", "0.47916216" ]
0.5231
28
How many successive recognition are failed
public BluetoothService(Activity activity){ mActivity = activity; mUserWarningService = new UserWarningService(mActivity.getApplicationContext()); /* float [][] testdata ={{1},{2},{6},{4},{5},{6},{7},{8},{9},{10}}; float f1 = Mean(testdata, 0,10); float f2 = Var(testdata, 0,10); float f3 = Rms(testdata, 0,10); float f4 = Skew(testdata, 0,10); int x = 1; */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getErrorCount();", "private int calculateImagesNotFound() {\n int imagesNotFound = 0;\n for (int count : countImagesNotFound) {\n imagesNotFound += count;\n }\n\n return imagesNotFound;\n }", "public float testAll(){\n List<Long> allIdsToTest = new ArrayList<>();\n allIdsToTest = idsToTest;\n //allIdsToTest.add(Long.valueOf(11));\n //allIdsToTest.add(Long.valueOf(12));\n //allIdsToTest.add(Long.valueOf(13));\n\n float totalTested = 0;\n float totalCorrect = 0;\n float totalUnrecognized = 0;\n\n for(Long currentID : allIdsToTest) {\n String pathToPhoto = \"photo\\\\testing\\\\\" + currentID.toString();\n File currentPhotosFile = new File(pathToPhoto);\n\n if(currentPhotosFile.exists() && currentPhotosFile.isDirectory()) {\n\n File[] listFiles = currentPhotosFile.listFiles();\n\n for(File file : listFiles){\n if (!file.getName().endsWith(\".pgm\")) { //search how to convert all image to .pgm\n throw new IllegalArgumentException(\"The file of the student \" + currentID + \" contains other files than '.pgm'.\");\n }\n else{\n Mat photoToTest = Imgcodecs.imread(pathToPhoto + \"\\\\\" + file.getName(), Imgcodecs.IMREAD_GRAYSCALE);\n try {\n RecognitionResult testResult = recognize(photoToTest);\n\n if(testResult.label[0] == currentID){\n totalCorrect++;\n }\n }\n catch (IllegalArgumentException e){\n System.out.println(\"One face unrecognized!\");\n totalUnrecognized++;\n }\n\n totalTested++;\n }\n }\n }\n }\n\n System.out.println(totalUnrecognized + \" face unrecognized!\");\n\n System.out.println(totalCorrect + \" face correct!\");\n System.out.println(totalTested + \" face tested!\");\n\n float percentCorrect = totalCorrect / totalTested;\n return percentCorrect;\n }", "public int numMatches();", "public static int count() {\n\treturn errorCount;\n }", "public static int getFailCount()\r\n\t{\r\n\t\treturn failCount;\r\n\t}", "public int getProblemCount();", "public Byte getNumChargedFail() {\n return numChargedFail;\n }", "int countByExample(RepStuLearningExample example);", "int getDetectionRulesCount();", "public int getTried()\n\t{\n\t\treturn tried;\t\n\t}", "public int getMissedCallsCount();", "int getCompletedTutorialsCount();", "public int getCheckCount(boolean passed) {\r\n int result = 0;\r\n Iterator iterator = checkResults.iterator();\r\n while (iterator.hasNext()) {\r\n CheckResult check = (CheckResult) iterator.next();\r\n if (check.getPassed() == passed) {\r\n result++;\r\n }\r\n }\r\n if (!passed && error != null) {\r\n result++; // count stacktrace as a failure\r\n }\r\n return result;\r\n }", "public double getNumberOfIncorrectClassified() {\n\t\treturn numberOfFalsePositives + numberOfFalseNegatives;\n\t}", "private int computeCount() {\n \n int count;\n try{\n count = this.clippingFeatures.size() * this.featuresToClip.size();\n }catch(ArithmeticException e ){\n \n count = Integer.MAX_VALUE;\n }\n return count;\n }", "public int numberOfResult() throws Exception;", "public int getFailedCheckCount() {\n return iFailedCheckCount;\n }", "int countFeatures();", "int countFeatures();", "public int getFailureCount() {\r\n return root.getFailureCount();\r\n }", "public int getNumberOfValidatedSpectra() {\n int lCount = 0;\n for (Object lPeptideIdentification : iPeptideIdentifications) {\n // Raise the count if the identification is validated.\n if (((PeptideIdentification) lPeptideIdentification).isValidated()) {\n lCount++;\n }\n }\n return lCount;\n }", "public int getExpectedNumber() {\n return getWholeProcessCount();\n }", "private boolean tryCounterExample(BDD reachableStates){\n\t\tBDD counterExample = reachableStates.andWith(buildEndGame());\n\t\t\n\t\treturn counterExample.satCount(this.dimension * this.dimension - 1) == 0 ? true : false;\n\t}", "public int getNumberOfErrors() {\n return errors;\n }", "int getNumberOfDetectedDuplicates();", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "public int getProbOfFailure() {\n return this.probOfFailure;\n }", "int getTries();", "public void incrementErrorCount() {\n\t\terrorCount++;\n\t}", "private void calculateError() {\n this.error = this.elementCount - this.strippedPartition.size64();\n }", "@Override\n\t\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\t\n\t\t}", "public int failed() {\n return this.failed;\n }", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "private int getTotalTestCase() {\n\t\treturn passedtests.size() + failedtests.size() + skippedtests.size();\n\t}", "public long numSimilarities();", "int getGrammarMatchCount();", "public long getNumberOfDetectedConcepts() {\n return numberOfDetectedConcepts;\n }", "public int getErrorCount()\r\n {\r\n \treturn errorCount;\r\n }", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult Result) {\n\t\t\r\n\t}", "private void incrementFailures() {\n totalFailures++;\n totalTunitFailures++;\n }", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "private int getFailCount() {\n\t\t\t\t\treturn record.getIntProperty(DatabasePasswordComposite.PASSWORD_FAILS, 0);\n\t\t\t\t}", "long getNumberOfComparisons();", "int imageCount();", "@DISPID(48)\r\n\t// = 0x30. The runtime will prefer the VTID if present\r\n\t@VTID(46)\r\n\tint instancesFailed();", "@java.lang.Override\n public int getFailures() {\n return failures_;\n }", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t}", "public native int getNumFrames() throws MagickException;", "public double getTotalSignalEstBackCount(){\n\t\tdouble total=0;\n\t\tfor(ControlledExperiment r : replicates){\n\t\t\ttotal+=r.getNoiseCount();\n\t\t}\n\t\treturn total;\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\n }", "@Override\n public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\n }", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\n\t}", "long getMisses();", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\n}", "public Integer getErrorCnt() {\r\n return errorCnt;\r\n }", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "@java.lang.Override\n public int getSuccesses() {\n return successes_;\n }", "public String dlMaxFailures();", "public int getMatchedPeaks() {\r\n return numMatchedPeaks;\r\n }", "public int getErrorCountByRepeat() {\n\t\t\n\t\tif (!hasERR) {\n\t\t\treturn -1;\n\t\t}\n\t\ttry {\n\t\t\treturn getSegments().getByCodeAndIndex(ERR, 1).getFields().item(0).getNonEmptyCount();\n\t\t} catch (HL7V2Exception e) {\n\t\t\treturn -1;\n\t\t}\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n }", "public int errorCount() {\n\t\treturn errorCount;\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\n\t}", "public int getErrorCount() {\n return this._errorCount;\n }", "@java.lang.Override\n public int getSuccesses() {\n return successes_;\n }", "@java.lang.Override\n public int getFailures() {\n return failures_;\n }", "public int getNumberOfFailedFiles() {\n return numberOfFailedFiles;\n }", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "public int getErrorCount() {\n return error_.size();\n }", "public List<Recognition> recognizeImage(Bitmap bitmap) {\n Bitmap croppedBitmap = Bitmap.createScaledBitmap(bitmap, cropSize, cropSize, true);\n// Bitmap croppedBitmap = Bitmap.createBitmap(cropSize, cropSize, Bitmap.Config.ARGB_8888);\n// final Canvas canvas = new Canvas(croppedBitmap);\n// canvas.drawBitmap(bitmap, frameToCropTransform, null);\n final List<Recognition> ret = new LinkedList<>();\n List<Recognition> recognitions = detector.recognizeImage(croppedBitmap);\n// long before=System.currentTimeMillis();\n// for (int k=0; k<100; k++) {\n// recognitions = detector.recognizeImage(croppedBitmap);\n// int a = 0;\n// }\n// long after=System.currentTimeMillis();\n// String log = String.format(\"tensorflow takes %.03f s\\n\", ((float)(after-before)/1000/100));\n// Log.d(\"MATCH TEST\", log);\n for (Recognition r : recognitions) {\n if (r.getConfidence() < minConfidence)\n continue;\n// RectF location = r.getLocation();\n// cropToFrameTransform.mapRect(location);\n// r.setOriginalLoc(location);\n// Bitmap cropped = Bitmap.createBitmap(bitmap, (int)location.left, (int)location.top, (int)location.width(), (int)location.height());\n// r.setObjectImage(cropped);\n BoxPosition bp = r.getLocation();\n// r.rectF = new RectF(bp.getLeft(), bp.getTop(), bp.getRight(), bp.getBottom());\n// cropToFrameTransform.mapRect(r.rectF);\n ret.add(r);\n }\n\n return ret;\n }", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n\t}", "int getExamplesCount();", "int getExamplesCount();", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\n\t}", "public int getErrorcount() {\n return errorcount;\n }", "public int getTotalInfected() {\n\t\treturn _nTotalInfected;\n\t}", "@Override\npublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\n}", "public double getNumberOfCorrectlyClassified() {\n\t\treturn numberOfTruePositives + numberOfTrueNegatives;\n\t}", "@Override\n\tpublic int countExam() {\n\t\treturn 0;\n\t}" ]
[ "0.6402401", "0.61018664", "0.60938275", "0.60829276", "0.6051124", "0.5920897", "0.5871161", "0.58671546", "0.58668494", "0.58400095", "0.5822749", "0.58099616", "0.576827", "0.5765409", "0.57520086", "0.57497376", "0.5723696", "0.5720103", "0.5712351", "0.5712351", "0.5697285", "0.56929237", "0.56662244", "0.56511104", "0.56459975", "0.564288", "0.56377244", "0.56377244", "0.56377244", "0.5637144", "0.562214", "0.5614584", "0.5611038", "0.56099397", "0.5602245", "0.5598783", "0.5598783", "0.5598783", "0.5598783", "0.5598783", "0.55948824", "0.5586396", "0.5586011", "0.5584195", "0.5578286", "0.55715334", "0.55703634", "0.55667335", "0.55667335", "0.55667335", "0.55667335", "0.556481", "0.5563888", "0.55628604", "0.5562253", "0.55598605", "0.5547558", "0.5545583", "0.5545156", "0.553953", "0.553953", "0.553953", "0.553953", "0.553953", "0.553953", "0.553953", "0.55388737", "0.55388737", "0.5533774", "0.5533774", "0.5528073", "0.5526703", "0.55170023", "0.55143315", "0.55143315", "0.5512226", "0.5509819", "0.55080277", "0.5504877", "0.55022687", "0.5500288", "0.54948145", "0.5494568", "0.5494346", "0.549261", "0.5491082", "0.54823416", "0.54823416", "0.54823416", "0.5481684", "0.547768", "0.5477239", "0.5477239", "0.5475298", "0.5475298", "0.5469517", "0.54617673", "0.5445892", "0.5428692", "0.5425498", "0.5424559" ]
0.0
-1
preprocess + let data come into your model
public void process(){ for(int i = 0; i < STEP_SIZE; i++){ String tmp = "" + accData[i][0] + "," + accData[i][1] + ","+accData[i][2] + "," + gyData[i][0] + "," + gyData[i][1] + "," + gyData[i][2] + "\n"; try{ stream.write(tmp.getBytes()); }catch(Exception e){ //Log.d(TAG,"!!!"); } } /** * currently we don't apply zero-mean, unit-variance operation * to the data */ // only accelerator's data is using, currently 200 * 3 floats // parse the 1D-array to 2D if(recognizer.isInRecognitionState() && recognizer.getGlobalRecognitionTimes() >= Constants.MAX_GLOBAL_RECOGNITIOME_TIMES){ recognizer.resetRecognitionState(); } if(recognizer.isInRecognitionState()){ recognizer.removeOutliers(accData); recognizer.removeOutliers(gyData); double [] feature = new double [FEATURE_SIZE]; recognizer.extractFeatures(feature, accData, gyData); int result = recognizer.runModel(feature); String ret = "@@@"; if(result != Constants.UNDEF_RET){ if(result == Constants.FINISH_RET){ mUserWarningService.playSpeech("Step" + Integer.toString(recognizer.getLastGesture()) + Constants.RIGHT_GESTURE_INFO); waitForPlayout(2000); mUserWarningService.playSpeech(Constants.FINISH_INFO); waitForPlayout(1); recognizer.resetLastGesutre(); recognizer.resetRecognitionState(); ret += "1"; }else if(result == Constants.RIGHT_RET){ mUserWarningService.playSpeech("Step" + Integer.toString(recognizer.getLastGesture()) + Constants.RIGHT_GESTURE_INFO); waitForPlayout(2000); mUserWarningService.playSpeech("Now please do Step " + Integer.toString(recognizer.getExpectedGesture())); waitForPlayout(1); ret += "1"; }else if(result == Constants.ERROR_RET){ mUserWarningService.playSpeech(Constants.WRONG_GESTURE_WARNING + recognizer.getExpectedGesture()); waitForPlayout(1); ret += "0"; }else if(result == Constants.ERROR_AND_FORWARD_RET){ mUserWarningService.playSpeech(Constants.WRONG_GESTURE_WARNING + recognizer.getLastGesture()); waitForPlayout(1); if(recognizer.getExpectedGesture() <= Constants.STATE_SPACE){ mUserWarningService.playSpeech( "Step " + recognizer.getLastGesture() + "missing " + ". Now please do Step" + Integer.toString(recognizer.getExpectedGesture())); waitForPlayout(1); }else{ recognizer.resetRecognitionState(); mUserWarningService.playSpeech("Recognition finished."); waitForPlayout(1); } ret += "0"; } ret += "," + Integer.toString(result) + "@@@"; Log.d(TAG, ret); Message msg = new Message(); msg.obj = ret; mWriteThread.writeHandler.sendMessage(msg); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "protected abstract String getPreprocessingModel(PipelineData data);", "@Override\n public void preprocess() {\n }", "public Instances preprocess(PipelineData data) throws Exception {\n\t\tInstances instances = filterData(data);\n\n\t\tmodelString = getPreprocessingModel(data);\n\t\tanalyzeSystem(data);\n\t\tsaveAnalysis();\n\n\t\treturn instances;\n\t}", "@Override\n public void preprocess() {\n }", "private void preProcessDataModel() {\r\n collectAllAttribtueDefinitions();\r\n\r\n for (AttributeDefinition attribute : dataModel.getAttributeDefinitions()) {\r\n attribute.setAttributeType(UINameToValueMap.get(attribute.getAttributeType()));\r\n }\r\n\r\n if (null != dataModel.getLocalSecondaryIndexes()) {\r\n for (LocalSecondaryIndex index : dataModel.getLocalSecondaryIndexes()) {\r\n index.getProjection().setProjectionType(UINameToValueMap.get(index.getProjection().getProjectionType()));\r\n }\r\n }\r\n\r\n if (null != dataModel.getGlobalSecondaryIndexes()) {\r\n for (GlobalSecondaryIndex index : dataModel.getGlobalSecondaryIndexes()) {\r\n index.getProjection().setProjectionType(UINameToValueMap.get(index.getProjection().getProjectionType()));\r\n }\r\n }\r\n }", "public void prepareModel() {\n //Since many models have different scale amplitudes, we calculate a uniform scale factor for the model\n setScaleFactor();\n //Since the 3ds file does not provide normal values, we must calculate them ourselves\n calculateNormals();\n //Finally we need to setup the buffers for drawing\n setupBuffers();\n }", "protected void prepareModel() {\n model();\n }", "public String preProcess( String data );", "private void parseData() {\n\t\t\r\n\t}", "private static void preprocess() {\n \tLOG.info(\"Begin preprocessing of data.\");\n \t\n \tLOG.debug(\"Create a IterativeDirectoryReader.\");\n \t// Create a reader for directories\n \tIterativeDirectoryReader iterativeDirectoryReader = (IterativeDirectoryReader) ReaderFactory.instance().getIterativeDirectoryReader();\n \titerativeDirectoryReader.setDirectoryName(clArgs.preprocessInDir);\n \titerativeDirectoryReader.setPathInChildDirectory(clArgs.preprocessPathInChildDir);\n \t\n \tLOG.debug(\"Create a IterativeFileReader.\");\n \t// Create a reader for text files and set an appropriate file filter\n \tIterativeFileReader iterativeFileReader = (IterativeFileReader) ReaderFactory.instance().getIterativeFileReader();\n \titerativeFileReader.setFileFilter(FileUtil.acceptVisibleFilesFilter(false, true));\n \t\n \tLOG.debug(\"Create a TextFileLineReader.\");\n \t// Create a reader for text files, the first six lines are not relevant in this data set\n \tTextFileLineReader textFileLineReader = (TextFileLineReader) ReaderFactory.instance().getTextFileLineReader();\n \ttextFileLineReader.setOffset(clArgs.preprocessLineOffset);\n \t\n \tLOG.debug(\"Create a GpsLogLineProcessor.\");\n \t// Create a processor for user points\n \tGpsLogLineProcessor processor = new GpsLogLineProcessor(clArgs.preprocessOutFile);\n \t\n \t// Build reader chain\n \titerativeDirectoryReader.setReader(iterativeFileReader);\n \titerativeFileReader.setReader(textFileLineReader);\n \ttextFileLineReader.setProcessor(processor);\n \t\n \titerativeDirectoryReader.attach(processor, \n \t\t\t\tnew Interests[] {\n \t\t\t\t\tInterests.NewChildDirectory,\n \t\t\t\t\tInterests.HasFinished\n \t\t\t\t});\n \t\n \tLOG.debug(\"Read GPS logs. Save the data in a new file {}.\", clArgs.preprocessOutFile);\n \t// Read and save the data\n \titerativeDirectoryReader.read();\n\n \tLOG.info(\"Finished preprocessing of data.\");\n }", "private int[] prepareSplit(String sampleFile, String featureDefFile, double percentTrain, boolean normalize, List<RankList> trainingData, List<RankList> testData) {\n/* 1430 */ List<RankList> data = readInput(sampleFile);\n/* */ \n/* */ \n/* 1433 */ int[] features = readFeature(featureDefFile);\n/* */ \n/* */ \n/* 1436 */ if (features == null) {\n/* 1437 */ features = FeatureManager.getFeatureFromSampleVector(data);\n/* */ }\n/* 1439 */ if (normalize) {\n/* 1440 */ normalize(data, features);\n/* */ }\n/* 1442 */ FeatureManager.prepareSplit(data, percentTrain, trainingData, testData);\n/* 1443 */ return features;\n/* */ }", "public double[] preprocessDataNormalizationOnly(double[] data) {\n return dataNormalization.normalizeNewData(data);\n }", "@Override\n\tpublic void processData() {\n\t\t\n\t}", "P preProcessInputs(R rawInputs);", "void pretrain(DataSetIterator iterator);", "public void dataConfig(String dir) {\n VersatileDataSource source = new CSVDataSource(new File(dir + \"trainData/iris.csv\"), false,\n CSVFormat.DECIMAL_POINT);\n VersatileMLDataSet data = new VersatileMLDataSet(source);\n data.defineSourceColumn(\"sepal-length\", 0, ColumnType.continuous);\n data.defineSourceColumn(\"sepal-width\", 1, ColumnType.continuous);\n data.defineSourceColumn(\"petal-length\", 2, ColumnType.continuous);\n data.defineSourceColumn(\"petal-width\", 3, ColumnType.continuous);\n\n // Define the column that we are trying to predict.\n ColumnDefinition outputColumn = data.defineSourceColumn(\"species\", 4,\n ColumnType.nominal);\n data.analyze();\n data.defineSingleOutputOthersInput(outputColumn);\n\n EncogModel model = new EncogModel(data);\n\n model.selectMethod(data, \"feedforward\");\n data.normalize();\n System.out.println(data.get(0).toString());\n NeuralUtils.dataToFile(data, dir + \"trainData/test.csv\");\n\n NormalizationHelper helper = data.getNormHelper();\n System.out.println(helper.toString());\n NeuralUtils.persistHelper(helper, dir + \"resources/Helper/helper.txt\");\n\n }", "<T> ScanRequest<T> preprocess(ScanRequest<T> req) throws ProcessingException;", "@Override\n\tprotected void postprocess(Classifier classifier, PipelineData data) throws Exception {\n\t}", "private MyPersonModelProvider(String inputdata) {\n\t\t\tList<String> contents = UtilFile.readFile(inputdata);\n\t\t\tList<List<String>> tableContents = UtilFile.convertTableContents(contents);\n\n\t\t\tpersons = new ArrayList<MyPerson>();\n\t\t\tfor (List<String> iList : tableContents) {\n\t\t\t\tpersons.add(new MyPerson(iList.get(0), iList.get(1), iList.get(2), Boolean.valueOf(iList.get(3))));\n\t\t\t}\n\t\t}", "public void trainingPreprocessing() {\n neuralNetAndDataSet = new NeuralNetAndDataSet(neuralNetwork, trainingSet);\n trainingController = new TrainingController(neuralNetAndDataSet);\n neuralNetwork.getLearningRule().addListener(this);\n trainingController.setLmsParams(0.7, 0.01, 0);\n LMS learningRule = (LMS) this.neuralNetAndDataSet.getNetwork().getLearningRule();\n if (learningRule instanceof MomentumBackpropagation) {\n ((MomentumBackpropagation) learningRule).setMomentum(0.2);\n }\n }", "private void populateData() {\n\t\tList<TrafficRecord> l = TestHelper.getSampleData();\r\n\t\tfor(TrafficRecord tr: l){\r\n\t\t\tput(tr);\r\n\t\t}\r\n\t\t \r\n\t}", "public void preprocess(String trainDataFolder)\n\t{\n\t\tFile folder = new File(trainDataFolder);\n\t\tFile[] listOfFiles = folder.listFiles();\n\t\tfor(int i=0;i<listOfFiles.length;i++){\n\t\t\t\ttry{\n\t\t\t\t\tBufferedReader reader = new BufferedReader(new FileReader(listOfFiles[i].getAbsoluteFile()));\n\t\t\t\t\tString allLines = new String();\n\t\t\t\t\tString line = null;\n\t\t\t\t\tint tabIndex;\n\t\t\t\t\tString type, msg;\n\t\t\t\t\tint label;\n\t\t\t\t\tint line_count = 0;\n\t\t\t\t\tallDocs = new ArrayList<String>();\n\t\t\t\t\twhile((line=reader.readLine())!=null && !line.isEmpty()){\n\t\t\t\t\t\tallDocs.add(line);\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(allDocs.size());\n\t\t\t\t\t//System.out.println(offset);\n\t\t\t\t\tfor(int s=0;s<offset;s++){\n\t\t\t\t\t\tline = allDocs.get(s);\n\t\t\t\t\t\ttabIndex = line.indexOf('\\t');\n\t\t\t\t\t\ttype = line.substring(0, tabIndex);\n\t\t\t\t\t\tmsg = line.substring(tabIndex + 1);\n\t\t\t\t\t\tmsg = msg.toLowerCase();\n\t\t\t\t\t\tif(type.equals(\"ham\")){label = 0;}\n\t\t\t\t\t\telse{label = 1;}\n\t\t\t\t\t\tclassStrings[label] += (line + \" \");\n\t\t\t\t\t\tclassCounts[label]++;\n\t\t\t\t\t\ttrainingDocs.add(line);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(IOException ioe){ioe.printStackTrace();}\n\t\t}\n\t\t/*System.out.println(\"number of ham tokens \"+classStrings[0].length());\n\t\tSystem.out.println(\"number of spam tokens \" +classStrings[1].length());\n\t\t*/\n\t\tSystem.out.println(\"Training Data Class Distribution:\");\n\t\tSystem.out.println(\"Ham: \"+classCounts[0]+\"(\"+Math.round(classCounts[0]*10000.0/trainingDocs.size())/100.0+\"%)\");\n\t\tSystem.out.println(\"Spam: \"+classCounts[1]+\"(\"+Math.round(classCounts[1]*10000.0/trainingDocs.size())/100.0+\"%)\");\n\t\tSystem.out.println(\"Total: \"+trainingDocs.size());\n\t}", "private Layer[] reformat(ArrayList<String[]> preProcess){\r\n Layer[] reconstruction = new Layer[preProcess.size()];\r\n\r\n for(int layer = 0; layer < reconstruction.length; layer++){\r\n Neuron[] neurons = new Neuron[preProcess.get(layer).length];\r\n\r\n for(int neuron = 0; neuron < neurons.length; neuron++){\r\n int trim = preProcess.get(layer)[neuron].length() - 1;\r\n\r\n preProcess.get(layer)[neuron] = preProcess.get(layer)[neuron].substring(1, trim).replaceAll(\"\\\\s+\", \"\");\r\n String[] synapses = preProcess.get(layer)[neuron].split(\",\");\r\n neurons[neuron] = new Neuron();\r\n\r\n if(layer == reconstruction.length - 1)\r\n neurons[neuron].setActivation(activation.LEAKY_REC_LIN);\r\n\r\n for (int synapse = 0; synapse < synapses.length; synapse++) {\r\n String[] connection = synapses[synapse].split(\"=\");\r\n\r\n if (!synapses[synapse].contains(\"null\")) {\r\n int location = Integer.parseInt(connection[0]);\r\n float weight = Float.parseFloat(connection[1]);\r\n\r\n if (synapse < synapses.length - 1)\r\n neurons[neuron].setSynapse(location, weight);\r\n else\r\n neurons[neuron].setBias(weight);\r\n }\r\n }\r\n }\r\n reconstruction[layer] = new Layer(neurons);\r\n }\r\n return reconstruction;\r\n }", "public Data process(Data data) throws EngineException {\n before(data);\n Data res = doProcess(data);\n after(res);\n return res;\n }", "protected boolean transformIncomingData() {\r\n\t\tboolean rB=false;\r\n\t\tArrayList<String> targetStruc ;\r\n\t\t\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (transformationModelImported == false){\r\n\t\t\t\testablishTransformationModel();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// soappTransform.requiredVariables\r\n\t\t\tif (transformationsExecuted == false){\r\n\t\t\t\texecuteTransformationModel();\r\n\t\t\t}\r\n\t\t\trB = transformationModelImported && transformationsExecuted ;\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn rB;\r\n\t}", "@Override\r\n\t\tpublic void normalize()\r\n\t\t\t{\n\t\t\t\t\r\n\t\t\t}", "protected void establishTransformationModel() {\r\n\t \r\n\t\tTransformationModel transformModel ;\r\n\t\tArrayList<TransformationStack> modelTransformStacks ;\r\n\t\t\r\n\t\t\r\n\t\t// the variables needed for the profile\r\n\t\t// targetStruc = getTargetVector();\r\n\t\tsomData = soappTransformer.getSomData() ; \r\n\t\t// soappTransformer.setSomData( somApplication.getSomData() );\r\n\t\tsomApplication.setSomData(somData) ;\r\n\t\t\r\n\t\tsomData.getVariablesLabels() ;\r\n\t\t \r\n\t\t\r\n\t\t// from here we transfer...\r\n\t\tmodelTransformStacks = soappTransformer.getTransformationModel().getVariableTransformations();\r\n\t\ttransformModel = soappTransformer.getTransformationModel() ;\r\n\t\t \r\n\t\t\r\n\t\ttransformationModelImported = true;\r\n\t}", "@Override\n\tpublic void predictFromPlainFile(String unlabel_file, String predict_file) {\n\t\t\n\t}", "public void normalize() {}", "public static void main(String[] args) throws Exception {\n int numLinesToSkip = 0;\n String delimiter = \",\"; //这是csv文件中的分隔符\n RecordReader recordReader = new CSVRecordReader(numLinesToSkip,delimiter);\n recordReader.initialize(new FileSplit(new ClassPathResource(\"dataSet20170119.csv\").getFile()));\n\n //Second: the RecordReaderDataSetIterator handles conversion to DataSet objects, ready for use in neural network\n\n /**\n * 这是标签(类别)所在列的序号\n */\n int labelIndex = 0; //5 values in each row of the iris.txt CSV: 4 input features followed by an integer label (class) index. Labels are the 5th value (index 4) in each row\n //类别的总数\n int numClasses = 2; //3 classes (types of iris flowers) in the iris data set. Classes have integer values 0, 1 or 2\n\n //一次读取多少条数据。当数据量较大时可以分几次读取,每次读取后就训练。这就是随机梯度下降\n int batchSize = 2000; //Iris data set: 150 examples total. We are loading all of them into one DataSet (not recommended for large data sets)\n\n DataSetIterator iterator = new RecordReaderDataSetIterator(recordReader,batchSize,labelIndex,numClasses);\n //因为我在这里写的2000是总的数据量大小,一次读完,所以一次next就完了。如果分批的话要几次next\n DataSet allData = iterator.next();\n// allData.\n allData.shuffle();\n SplitTestAndTrain testAndTrain = allData.splitTestAndTrain(0.8); //Use 65% of data for training\n\n DataSet trainingData = testAndTrain.getTrain();\n DataSet testData = testAndTrain.getTest();\n //We need to normalize our data. We'll use NormalizeStandardize (which gives us mean 0, unit variance):\n //数据归一化的步骤,非常重要,不做可能会导致梯度中的几个无法收敛\n DataNormalization normalizer = new NormalizerStandardize();\n normalizer.fit(trainingData); //Collect the statistics (mean/stdev) from the training data. This does not modify the input data\n normalizer.transform(trainingData); //Apply normalization to the training data\n normalizer.transform(testData); //Apply normalization to the test data. This is using statistics calculated from the *training* set\n\n\n final int numInputs = 9202;\n int outputNum = 2;\n int iterations = 1000;\n long seed = 142;\n int numEpochs = 50; // number of epochs to perform\n\n log.info(\"Build model....\");\n MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()\n .seed(seed)\n .optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)\n .iterations(iterations)\n .activation(Activation.SIGMOID)\n .weightInit(WeightInit.ZERO) //参数初始化的方法,全部置零\n .learningRate(1e-3) //经过测试,这里的学习率在1e-3比较合适\n .regularization(true).l2(5e-5) //正则化项,防止参数过多导致过拟合。2阶范数乘一个比率\n .list()\n\n .layer(0, new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD)\n .activation(Activation.SIGMOID)\n .nIn(numInputs).nOut(outputNum).build())\n .backprop(true).pretrain(false)\n .build();\n\n //run the model\n MultiLayerNetwork model = new MultiLayerNetwork(conf);\n model.init();\n model.setListeners(new ScoreIterationListener(100));\n\n\n log.info(\"Train model....\");\n for( int i=0; i<numEpochs; i++ ){\n log.info(\"Epoch \" + i);\n model.fit(trainingData);\n\n //每个epoch结束后立马观察模型估计的效果,方便及早停止\n Evaluation eval = new Evaluation(numClasses);\n INDArray output = model.output(testData.getFeatureMatrix());\n eval.eval(testData.getLabels(), output);\n log.info(eval.stats());\n }\n\n }", "public synchronized final void process() throws FilterException {\n if (this.result == null)\n throw new FilterException(i18n.getString(\"outputNotSet\"));\n if (this.source == null)\n throw new FilterException(i18n.getString(\"inputNotSet\"));\n\n try {\n // Starts the input interpretation (transformation)\n this.transformer.transform(this.source, this.result);\n } catch (TransformerException e) {\n throw new FilterException(e);\n } finally {\n this.source = null;\n this.result = null;\n }\n }", "public void applyModel(ScServletData data, Object model)\n {\n }", "public static void preprocessModels(AdditionsAndRetractions changes, EditConfigurationVTwo editConfiguration, VitroRequest request){\n\n List<ModelChangePreprocessor> modelChangePreprocessors = editConfiguration.getModelChangePreprocessors();\n if ( modelChangePreprocessors != null ) {\n for ( ModelChangePreprocessor pp : modelChangePreprocessors ) {\n //these work by side effect\n pp.preprocess( changes.getRetractions(), changes.getAdditions(), request );\n }\n } \n }", "private void processExtractData_N() {\n\n this.normalCollection = new VertexCollection();\n\n Map<Integer, float[]> definedNormals = new HashMap<>();\n\n int n = 0;int count = 1;\n while(n < extract.getNormals().size()){\n\n float thisNormValues[] = {extract.getNormals().get(n),\n extract.getNormals().get(n+1),\n extract.getNormals().get(n+2)};\n\n definedNormals.put(count, thisNormValues);\n\n n = n+3;\n count++;\n }\n\n for(Integer nId : extract.getDrawNormalOrder()){\n float[] pushThese = definedNormals.get(nId);\n this.normalCollection.push(pushThese[0], pushThese[1], pushThese[2]);\n }\n }", "void preProcess();", "@Override\n public PreparedData prepare(SparkContext sc, TrainingData trainingData) {\n // now that we have all actions in separate RDDs we must merge any user dictionaries and\n // make sure the same user ids map to the correct events\n Optional<BiDictionaryJava> userDictionary = Optional.empty();\n\n List<Tuple2<String,IndexedDatasetJava>> indexedDatasets = new ArrayList<>();\n\n // make sure the same user ids map to the correct events for merged user dictionaries\n for(Tuple2<String,JavaPairRDD<String,String>> entry : trainingData.getActions()) {\n\n String eventName = entry._1();\n JavaPairRDD<String,String> eventIDS = entry._2();\n\n // passing in previous row dictionary will use the values if they exist\n // and append any new ids, so after all are constructed we have all user ids in the last dictionary\n IndexedDatasetJava ids = IndexedDatasetJava.apply(eventIDS, userDictionary, sc);\n userDictionary = Optional.of(ids.getRowIds());\n\n // append the transformation to the indexedDatasets list\n indexedDatasets.add(new Tuple2<>(eventName, ids));\n }\n\n List<Tuple2<String,IndexedDatasetJava>> rowAdjustedIds = new ArrayList<>();\n\n // check to see that there are events in primary event IndexedDataset and return an empty list if not\n if(userDictionary.isPresent()){\n\n // now make sure all matrices have identical row space since this corresponds to all users\n // with the primary event since other users do not contribute to the math\n for(Tuple2<String,IndexedDatasetJava> entry : indexedDatasets) {\n String eventName = entry._1();\n IndexedDatasetJava eventIDS = entry._2();\n rowAdjustedIds.add(new Tuple2<>(eventName,\n (new IndexedDatasetJava(eventIDS.getMatrix(),userDictionary.get(),eventIDS.getColIds())).\n newRowCardinality(userDictionary.get().size())));\n }\n }\n\n JavaPairRDD<String, Map<String,JsonAST.JValue>>fieldsRDD =\n trainingData.getFieldsRDD().mapToPair(entry -> new Tuple2<>(\n entry._1(), JavaConverters.mapAsJavaMapConverter(entry._2().fields()).asJava()));\n\n JavaPairRDD<String,HashMap<String,JsonAST.JValue>> fields = fieldsRDD.mapToPair(entry ->\n new Tuple2<>(entry._1(),new HashMap<>(entry._2())));\n\n return new PreparedData(rowAdjustedIds, fields);\n }", "void setTrainData(DataModel trainData);", "public String execute(String input) {\n Data data = Serializer.parse(input, Data.class);\n\n // Step #2: Check the discriminator\n final String discriminator = data.getDiscriminator();\n if (discriminator.equals(Discriminators.Uri.ERROR)) {\n // Return the input unchanged.\n return input;\n }\n\n // Create a series of pipes to process the training files\n ArrayList<Pipe> pipeList = new ArrayList<>();\n pipeList.add(new Input2CharSequence(\"UTF-8\"));\n // Pipes: lowercase, tokenize, remove stopwords, map to features\n pipeList.add( new CharSequenceLowercase() );\n pipeList.add( new CharSequence2TokenSequence(Pattern.compile(\"\\\\p{L}[\\\\p{L}\\\\p{P}]+\\\\p{L}\")) );\n pipeList.add( new TokenSequenceRemoveStopwords());\n pipeList.add( new TokenSequence2FeatureSequence());\n pipe = new SerialPipes(pipeList);\n\n // put the directory of files used for training through the pipes\n String directory = data.getParameter(\"directory\").toString();\n InstanceList instances = readDirectory(new File(directory));\n\n // create a topic to be trained\n int numberOfTopics = (Integer) data.getParameter(\"numTopics\");\n ParallelTopicModel topicModel = new ParallelTopicModel(numberOfTopics);\n topicModel.addInstances(instances);\n\n // train the model\n try {\n topicModel.estimate();\n } catch (IOException e){\n e.printStackTrace();\n return new Data<>(Discriminators.Uri.ERROR,\n \"Unable to train the model\").asJson();\n }\n\n // write topic keys file\n String path = data.getParameter(\"path\").toString();\n String keysName = data.getParameter(\"keysName\").toString();\n int wordsPerTopic = (Integer) data.getParameter(\"wordsPerTopic\");\n try {\n topicModel.printTopWords(new File(path + \"/\" + keysName), wordsPerTopic, false);\n } catch (IOException e) {\n e.printStackTrace();\n return new Data<>(Discriminators.Uri.ERROR,\n \"Unable to write the topic keys to \" + path + \"/\" + keysName).asJson();\n }\n\n // write the .inferencer file\n String inferencerName = data.getParameter(\"inferencerName\").toString();\n try {\n ObjectOutputStream oos =\n new ObjectOutputStream (new FileOutputStream (path + \"/\" + inferencerName));\n oos.writeObject (topicModel.getInferencer());\n oos.close();\n } catch (Exception e) {\n e.printStackTrace();\n return new Data<>(Discriminators.Uri.ERROR,\n \"Unable to write the inferencer to \" + path + \"/\" + inferencerName).asJson();\n }\n\n // Success\n return new Data<>(Discriminators.Uri.TEXT, \"Success\").asJson();\n }", "@Override\n\tprotected void prepare() {\n\t\tfor(ProcessInfoParameter parameter :getParameter()){\n\t\t\tString name = parameter.getParameterName();\n\t\t\tif(parameter.getParameter() == null){\n\t\t\t\t;\n\t\t\t}else if(name.equals(\"XX_TipoRetencion\")){\n\t\t\t\tp_TypeRetention = (String) parameter.getParameter();\n\t\t\t}\n\t\t\telse if(name.equals(\"C_Invoice_From_ID\"))\n\t\t\t\tp_Invoice_From = parameter.getParameterAsInt();\t\n\t\t\telse if(name.equals(\"C_Invoice_To_ID\"))\n\t\t\t\tp_Invoice_To = parameter.getParameterAsInt();\t\n\t\t\telse if(name.equals(\"DateDoc\"))\n\t\t\t\tp_DateDoc = (Timestamp) parameter.getParameter();\t\t\n\t\t}\n\t}", "private void prepare( ) {\n super.prepare( schema.getCount( ) );\n serializer = new FieldSerializer[ fieldCount ];\n for ( int i = 0; i < fieldCount; i++ ) {\n FieldSchema field = schema.getField( i );\n serializer[i] = serializerByType[ field.getType().ordinal() ];\n }\n }", "protected void preprocessQueryModel( SQLQueryModel query, List<Selection> selections,\n Map<LogicalTable, String> tableAliases, DatabaseMeta databaseMeta ) {\n }", "public static void main(String[] args) throws IOException, InterruptedException {\n\n File src = new ClassPathResource(\"winequality-red.csv\").getFile();\n\n FileSplit fileSplit = new FileSplit(src);\n\n RecordReader rr = new CSVRecordReader(1,',');// since there is header in the file remove row 1 with delimter coma\n rr.initialize(fileSplit);\n\n Schema sc = new Schema.Builder()\n .addColumnsDouble(\"fixed acidity\",\"volatile acidity\",\"citric acid\",\"residual sugar\",\"chlorides\",\"free sulfur dioxide\",\"total sulfur dioxide\",\"density\",\"pH\",\"sulphates\",\"alcohol\")\n .addColumnCategorical(\"quality\", Arrays.asList(\"3\",\"4\",\"5\",\"6\",\"7\",\"8\"))\n .build();\n\n TransformProcess tp = new TransformProcess.Builder(sc)\n .categoricalToInteger(\"quality\")\n .build();\n\n System.out.println(\"Initial Schema : \"+tp.getInitialSchema());\n System.out.println(\"New Schema : \"+tp.getFinalSchema());\n\n List<List<Writable>> original_data = new ArrayList<>();\n\n while(rr.hasNext()){\n original_data.add(rr.next());\n }\n\n List<List<Writable>> transformed_data = LocalTransformExecutor.execute(original_data,tp);\n\n CollectionRecordReader crr = new CollectionRecordReader(transformed_data);\n\n DataSetIterator iter = new RecordReaderDataSetIterator(crr,transformed_data.size(),-1,6);\n\n DataSet fullDataSet = iter.next();\n fullDataSet.shuffle(seed);\n\n SplitTestAndTrain traintestsplit = fullDataSet.splitTestAndTrain(0.8);\n DataSet trainDataSet = traintestsplit.getTrain();\n DataSet testDataSet = traintestsplit.getTest();\n\n\n DataNormalization normalization = new NormalizerMinMaxScaler();\n normalization.fit(trainDataSet);\n normalization.transform(trainDataSet);\n normalization.transform(testDataSet);\n\n MultiLayerConfiguration config = getConfig (numberInput,numberClasses,learning_rate);\n\n MultiLayerNetwork model = new MultiLayerNetwork(config);\n model.init();\n\n //UI-Evaluator\n StatsStorage storage = new InMemoryStatsStorage();\n UIServer server = UIServer.getInstance();\n server.attach(storage);\n\n //Set model listeners\n model.setListeners(new StatsListener(storage, 10));\n\n Evaluation eval;\n\n for(int i=0;i<epochs;i++) {\n model.fit(trainDataSet);\n eval = model.evaluate(new ViewIterator(testDataSet, transformed_data.size()));\n System.out.println(\"Epoch \" + i + \", Accuracy : \"+eval.accuracy());\n }\n\n Evaluation evalTrain = model.evaluate(new ViewIterator(trainDataSet,transformed_data.size()));\n Evaluation evalTest = model.evaluate(new ViewIterator(testDataSet,transformed_data.size()));\n\n System.out.println(\"Train Eval : \"+evalTrain.stats());\n System.out.println(\"Test Eval : \"+evalTest.stats());\n\n\n\n\n\n\n\n }", "protected void prepareEntityToNodeMap()\r\n\t{\n\t}", "public static void main(String[] args) {\n\t\tMap a = preProcess(\"D:\\\\CS17Fall\\\\Machine Learning\\\\Assignment\\\\Assignment3\\\\iris.data\", \"D:\\\\CS17Fall\\\\Machine Learning\\\\Assignment\\\\Assignment3\\\\iris_processed.data\");\n\t}", "@Test\n public void addModelData() {\n new FactoryInitializer()\n .initialize(\n ((tr, ev, is, np, md) -> new ResNetConv2DFactory(tr,ev,is,np,md).addModelData(new ArrayList<>()))\n );\n }", "public void prepareForFeaturesAndOrderCollection() throws Exception {\n\n LOG.info(\" - Preparing phrases...\");\n readPhrases(false);\n collectNumberProps(m_srcPhrs, m_trgPhrs, true, true); \n collectTypeProp(m_srcPhrs, m_trgPhrs); \n\n collectContextEqs();\n prepareSeedDictionary(m_contextSrcEqs, m_contextTrgEqs);\n prepareTranslitDictionary(m_contextSrcEqs);\n filterContextEqs();\n\n collectContextAndTimeProps(m_srcPhrs, m_trgPhrs);\n collectOrderProps(m_srcPhrs, m_trgPhrs);\n }", "@Override\n\t\tprotected void process() throws Exception {\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing - Initializing Models...\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tGlobalVars.initialize();\n\n\t\t\t// Processing Step 1. - CoreNLP\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing CoreNLP.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tString processed_text = Filter\n\t\t\t\t\t.filterdata(GlobalVars.pipeline, text);\n\n\t\t\t// Processing Step 2. - Openie\"\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing Openie.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tStringBuilder openIEOutput = new StringBuilder();\n\t\t\tString temp = \"\";\n\t\t\tfor (String sentence : processed_text.split(\"\\\\. \")) {\n\n\t\t\t\tSeq<Instance> extractions = GlobalVars.openIE.extract(sentence);\n\n\t\t\t\tInstance[] arr = new Instance[extractions.length()];\n\t\t\t\textractions.copyToArray(arr);\n\n\t\t\t\tfor (Instance inst : arr) {\n\t\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\t\tsb.append(inst.sentence() + \"\\n\");\n\t\t\t\t\tDouble conf = inst.confidence();\n\t\t\t\t\tString stringConf = conf.toString().substring(0, 4);\n\t\t\t\t\tsb.append(stringConf).append(\" (\")\n\t\t\t\t\t\t\t.append(inst.extr().arg1().text()).append(\"; \")\n\t\t\t\t\t\t\t.append(inst.extr().rel().text()).append(\"; \");\n\n\t\t\t\t\ttemp += inst.extr().arg1().text() + \"\\n\"\n\t\t\t\t\t\t\t+ inst.extr().rel().text() + \"\\n\";\n\n\t\t\t\t\tPart[] arr2 = new Part[inst.extr().arg2s().length()];\n\t\t\t\t\tinst.extr().arg2s().copyToArray(arr2);\n\t\t\t\t\t/*\n\t\t\t\t\t * for (Part arg : arr2) { sb.append(arg.text()).append(\"\");\n\t\t\t\t\t * System.out.println(\"%\" + arg.text() + \"%\"); }\n\t\t\t\t\t */\n\t\t\t\t\tif (arr2.length != 0) {\n\t\t\t\t\t\tSystem.out.println(\"Hats: \" + arr2[0]);\n\t\t\t\t\t\ttemp += arr2[0] + \"\\n\";\n\t\t\t\t\t\tsb.append(arr2[0]);\n\t\t\t\t\t\tsb.append(\")\\n\\n\");\n\t\t\t\t\t\topenIEOutput.append(sb.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Processing Step 3. - Rewrite\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing Rewrite.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\t// Load load = new Load();\n\t\t\t// result = load.Loadfilter(openIEOutput.toString());\n\t\t\tresult = temp;\n\t\t}", "public static void processData() {\n\t\tString dirName = \"C:\\\\research_data\\\\mouse_human\\\\homo_b47_data\\\\\";\r\n\t//\tString GNF1H_fName = \"GNF1H_genes_chopped\";\r\n\t//\tString GNF1M_fName = \"GNF1M_genes_chopped\";\r\n\t\tString GNF1H_fName = \"GNF1H\";\r\n\t\tString GNF1M_fName = \"GNF1M\";\r\n\t\tString mergedValues_fName = \"GNF1_merged_expression.txt\";\r\n\t\tString mergedPMA_fName = \"GNF1_merged_PMA.txt\";\r\n\t\tString discretizedMI_fName = \"GNF1_discretized_MI.txt\";\r\n\t\tString discretizedLevels_fName = \"GNF1_discretized_levels.txt\";\r\n\t\tString discretizedData_fName = \"GNF1_discretized_data.txt\";\r\n\t\t\r\n\t\tboolean useMotifs = false;\r\n\t\tMicroArrayData humanMotifs = null;\r\n\t\tMicroArrayData mouseMotifs = null;\r\n\t\t\r\n\t\tMicroArrayData GNF1H_value = new MicroArrayData();\r\n\t\tMicroArrayData GNF1H_PMA = new MicroArrayData();\r\n\t\tGNF1H_PMA.setDiscrete();\r\n\t\tMicroArrayData GNF1M_value = new MicroArrayData();\r\n\t\tMicroArrayData GNF1M_PMA = new MicroArrayData();\r\n\t\tGNF1M_PMA.setDiscrete();\r\n\t\t\r\n\t\ttry {\r\n\t\t/*\tGNF1H_value.readFile(dirName+GNF1H_fName+\".gcrma.txt\");\r\n\t\t\tGNF1H_PMA.readFile(dirName+GNF1H_fName+\".pma\");\r\n\t\t\tGNF1M_value.readFile(dirName+GNF1M_fName+\".gcrma.txt\");\r\n\t\t\tGNF1M_PMA.readFile(dirName+GNF1M_fName+\".pma\"); */\r\n\t\t/*\tGNF1H_value.readFile(dirName+GNF1H_fName+\".gcrma.txt.homob44\");\r\n\t\t\tGNF1H_PMA.readFile(dirName+GNF1H_fName+\".pma.txt.homob44\");\r\n\t\t\tGNF1M_value.readFile(dirName+GNF1M_fName+\".gcrma.txt.homob44\");\r\n\t\t\tGNF1M_PMA.readFile(dirName+GNF1M_fName+\".pma.txt.homob44\"); */\r\n\t\t\tGNF1H_value.readFile(dirName+GNF1H_fName+\".gcrma.snco.txt\");\r\n\t\t\tGNF1H_PMA.readFile(dirName+GNF1H_fName+\".pma.sn.txt\");\r\n\t\t\tGNF1M_value.readFile(dirName+GNF1M_fName+\".gcrma.snco.txt\");\r\n\t\t\tGNF1M_PMA.readFile(dirName+GNF1M_fName+\".pma.sn.txt\");\r\n\t\t} catch(IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\tif (useMotifs) {\r\n\t\t\thumanMotifs = new MicroArrayData();\r\n\t\t\tmouseMotifs = new MicroArrayData();\r\n\t\t\tloadMotifs(humanMotifs,GNF1H_value.geneNames,mouseMotifs,GNF1M_value.geneNames);\r\n\t\t}\r\n\t\t\r\n\t\t// combine replicates in PMA values\r\n\t\tint[][] H_PMA = new int[GNF1H_PMA.numRows][GNF1H_PMA.numCols/2];\r\n\t\tint[][] M_PMA = new int[GNF1M_PMA.numRows][GNF1M_PMA.numCols/2];\r\n\t\t\r\n\t\tint i = 0;\r\n\t\tint j = 0;\r\n\t\tint k = 0;\r\n\t\tint v = 0;\r\n\t\tk = 0;\r\n\t\tj = 0;\r\n\t\twhile (j<GNF1H_PMA.numCols-1) {\r\n\t\t\tfor (i=0;i<H_PMA.length;i++) {\r\n\t\t\t\tv = 0;\r\n\t\t\t//\tif (GNF1H_PMA.dvalues[i][j] > 0 & GNF1H_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\tif (GNF1H_PMA.dvalues[i][j] > 0 | GNF1H_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\t\tv = 1;\r\n\t\t\t\t}\r\n\t\t\t\tH_PMA[i][k] = v;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\t\t\tj = j + 2;\r\n\t\t}\r\n\t\t\r\n\t\tj = 0;\r\n\t\tk = 0;\r\n\t\twhile (j<GNF1M_PMA.numCols-1) {\r\n\t\t\tfor (i=0;i<M_PMA.length;i++) {\r\n\t\t\t\tv = 0;\r\n\t\t\t//\tif (GNF1M_PMA.dvalues[i][j] > 0 & GNF1M_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\tif (GNF1M_PMA.dvalues[i][j] > 0 | GNF1M_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\t\tv = 1;\r\n\t\t\t\t}\r\n\t\t\t\tM_PMA[i][k] = v;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\t\t\tj = j + 2;\r\n\t\t}\r\n\t\t\r\n\t\tint numMatched = 31;\r\n\t\t\r\n\t/*\tGNF1H_value.numCols = numMatched;\r\n\t\tGNF1M_value.numCols = numMatched; */\r\n\t\t\r\n\t\tint[][] matchPairs = new int[numMatched][2];\r\n\t\tfor(i=0;i<numMatched;i++) {\r\n\t\t\tmatchPairs[i][0] = i;\r\n\t\t\tmatchPairs[i][1] = i + GNF1H_value.numCols;\r\n\t\t}\r\n\t\t\r\n\t//\tDiscretizeAffyData H_discretizer = new DiscretizeAffyData(GNF1H_value.values,H_PMA,0);\r\n\t//\tH_discretizer.adjustIntensities();\r\n\t\ttransformRelativeAbundance(GNF1H_value.values,H_PMA,GNF1H_value.numCols);\r\n\t\t\r\n\t//\tDiscretizeAffyData M_discretizer = new DiscretizeAffyData(GNF1M_value.values,M_PMA,0);\r\n\t//\tM_discretizer.adjustIntensities();\r\n\t\ttransformRelativeAbundance(GNF1M_value.values,M_PMA,GNF1M_value.numCols);\r\n\t\t\r\n\t\tdouble[][] mergedExpression = new double[GNF1H_value.numRows][GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\tint[][] mergedPMA = new int[GNF1H_value.numRows][GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\tint[] species = null;\r\n\t\tif (!useMotifs) {\r\n\t\t\tspecies = new int[GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\t} else {\r\n\t\t\tspecies = new int[GNF1H_value.numCols+GNF1M_value.numCols + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t}\r\n\t\t\r\n\t\tfor (i=0;i<GNF1H_value.numRows;i++) {\r\n\t\t\tSystem.arraycopy(GNF1H_value.values[i],0,mergedExpression[i],0,GNF1H_value.numCols);\r\n\t\t\tSystem.arraycopy(H_PMA[i],0,mergedPMA[i],0,GNF1H_value.numCols);\t\r\n\t\t}\r\n\t\tfor (i=0;i<GNF1M_value.numRows;i++) {\r\n\t\t\tSystem.arraycopy(GNF1M_value.values[i],0,mergedExpression[i],GNF1H_value.numCols,GNF1M_value.numCols);\r\n\t\t\tSystem.arraycopy(M_PMA[i],0,mergedPMA[i],GNF1H_value.numCols,GNF1M_value.numCols);\r\n\t\t}\r\n\t\t\r\n\t\t// concatenate experiment and gene names\r\n\t\tfor (i=0;i<GNF1H_value.numCols;i++) {\r\n\t\t\tGNF1H_value.experimentNames[i] = \"h_\" + GNF1H_value.experimentNames[i];\r\n\t\t\tspecies[i] = 1;\r\n\t\t}\r\n\t\tfor (i=0;i<GNF1M_value.numCols;i++) {\r\n\t\t\tGNF1M_value.experimentNames[i] = \"m_\" + GNF1M_value.experimentNames[i];\r\n\t\t\tspecies[i+GNF1H_value.numCols] = 2;\r\n\t\t}\r\n\t\t\r\n\t\tString[] mergedExperimentNames = null;\r\n\t\tif (!useMotifs) {\r\n\t\t\tmergedExperimentNames = new String[GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\t} else {\r\n\t\t\tmergedExperimentNames = new String[GNF1H_value.numCols+GNF1M_value.numCols + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t}\r\n\t\tSystem.arraycopy(GNF1H_value.experimentNames,0,mergedExperimentNames,0,GNF1H_value.numCols);\r\n\t\tSystem.arraycopy(GNF1M_value.experimentNames,0,mergedExperimentNames,GNF1H_value.numCols,GNF1M_value.numCols);\r\n\t\tif (useMotifs) {\r\n\t\t\tSystem.arraycopy(humanMotifs.experimentNames,0,mergedExperimentNames,GNF1H_value.numCols+GNF1M_value.numCols,humanMotifs.numCols);\r\n\t\t\tSystem.arraycopy(mouseMotifs.experimentNames,0,mergedExperimentNames,GNF1H_value.numCols+GNF1M_value.numCols+humanMotifs.numCols,mouseMotifs.numCols);\r\n\t\t\tfor (i=0;i<humanMotifs.numCols;i++) {\r\n\t\t\t\tspecies[i + GNF1H_value.numCols+GNF1M_value.numCols] = 3;\r\n\t\t\t}\r\n\t\t\tfor (i=0;i<mouseMotifs.numCols;i++) {\r\n\t\t\t\tspecies[i + GNF1H_value.numCols+GNF1M_value.numCols + humanMotifs.numCols] = 4;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tString[] mergedGeneNames = new String[GNF1H_value.numRows];\r\n\t\tfor (i=0;i<GNF1M_value.numRows;i++) {\r\n\t\t\tmergedGeneNames[i] = GNF1H_value.geneNames[i] + \"|\" + GNF1M_value.geneNames[i];\r\n\t\t}\r\n\t\t\r\n\t\tint[] filterList = new int[GNF1M_value.numRows];\r\n\t\tint numFiltered = 0;\r\n\t\tdouble maxExpressedPercent = 1.25;\r\n\t\tint maxExpressed_H = (int) Math.floor(maxExpressedPercent*((double) GNF1H_value.numCols));\r\n\t\tint maxExpressed_M = (int) Math.floor(maxExpressedPercent*((double) GNF1M_value.numCols));\r\n\t\tint numExpressed_H = 0;\r\n\t\tint numExpressed_M = 0;\r\n\t\t\r\n\t\tfor (i=0;i<GNF1H_value.numRows;i++) {\r\n\t\t\tnumExpressed_H = 0;\r\n\t\t\tfor (j=0;j<GNF1H_value.numCols;j++) {\r\n\t\t\t\tif (GNF1H_PMA.dvalues[i][j] > 0) {\r\n\t\t\t//\tif (!Double.isNaN(GNF1H_value.values[i][j])) {\r\n\t\t\t//\tif (GNF1H_value.values[i][j] > 1.5) {\r\n\t\t\t\t\tnumExpressed_H++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tnumExpressed_M = 0;\r\n\t\t\tfor (j=0;j<GNF1M_value.numCols;j++) {\r\n\t\t\t\tif (GNF1M_PMA.dvalues[i][j] > 0) {\r\n\t\t\t//\tif (GNF1H_value.values[i][j] > 1.5) {\r\n\t\t\t//\tif (!Double.isNaN(GNF1M_value.values[i][j])) {\r\n\t\t\t\t\tnumExpressed_M++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (numExpressed_M >= maxExpressed_M | numExpressed_H >= maxExpressed_H) {\r\n\t\t\t\tfilterList[i] = 1;\r\n\t\t\t\tnumFiltered++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tGNF1H_value = null;\r\n\t\tGNF1H_PMA = null;\r\n\t\tGNF1M_value = null;\r\n\t\tGNF1M_PMA = null;\r\n\t\t\r\n\t\tdouble[][] mergedExpression2 = null;\r\n\t\tif (numFiltered > 0) {\r\n\t\t\tk = 0;\r\n\t\t\tint[][] mergedPMA2 = new int[mergedPMA.length-numFiltered][mergedPMA[0].length];\r\n\t\t\tif (!useMotifs) {\r\n\t\t\t\tmergedExpression2 = new double[mergedExpression.length-numFiltered][mergedExpression[0].length];\r\n\t\t\t} else {\r\n\t\t\t\tmergedExpression2 = new double[mergedExpression.length-numFiltered][mergedExpression[0].length + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t\t}\r\n\t\t\tString[] mergedGeneNames2 = new String[mergedGeneNames.length-numFiltered];\r\n\t\t\tfor (i=0;i<filterList.length;i++) {\r\n\t\t\t\tif (filterList[i] == 0) {\r\n\t\t\t\t\tmergedPMA2[k] = mergedPMA[i];\r\n\t\t\t\t\tif (!useMotifs) {\r\n\t\t\t\t\t\tmergedExpression2[k] = mergedExpression[i];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.arraycopy(mergedExpression[i],0,mergedExpression2[k],0,mergedExpression[i].length);\r\n\t\t\t\t\t\tSystem.arraycopy(humanMotifs.values[i],0,mergedExpression2[k],mergedExpression[i].length,humanMotifs.numCols);\r\n\t\t\t\t\t\tSystem.arraycopy(mouseMotifs.values[i],0,mergedExpression2[k],humanMotifs.numCols+mergedExpression[i].length,mouseMotifs.numCols);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmergedGeneNames2[k] = mergedGeneNames[i];\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tmergedPMA = mergedPMA2;\r\n\t\t\tmergedExpression = mergedExpression2;\r\n\t\t\tmergedGeneNames = mergedGeneNames2;\r\n\t\t} else {\r\n\t\t\tif (useMotifs) {\r\n\t\t\t\tmergedExpression2 = new double[mergedExpression.length][mergedExpression[0].length + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t\t\tfor (i=0;i<mergedExpression.length;i++) {\r\n\t\t\t\t\tSystem.arraycopy(mergedExpression[i],0,mergedExpression2[i],0,mergedExpression[i].length);\r\n\t\t\t\t\tSystem.arraycopy(humanMotifs.values[i],0,mergedExpression2[i],mergedExpression[i].length,humanMotifs.numCols);\r\n\t\t\t\t\tSystem.arraycopy(mouseMotifs.values[i],0,mergedExpression2[i],humanMotifs.numCols+mergedExpression[i].length,mouseMotifs.numCols);\r\n\t\t\t\t}\r\n\t\t\t\tmergedExpression = mergedExpression2;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tDiscretizeAffyPairedData discretizer = new DiscretizeAffyPairedData(mergedExpression,mergedPMA,matchPairs,20);\r\n\t\tMicroArrayData mergedData = new MicroArrayData();\r\n\t\tmergedData.values = discretizer.expression;\r\n\t\tmergedData.geneNames = mergedGeneNames;\r\n\t\tmergedData.experimentNames = mergedExperimentNames;\r\n\t\tmergedData.experimentCode = species;\r\n\t\tmergedData.numCols = discretizer.numExperiments;\r\n\t\tmergedData.numRows = discretizer.numGenes;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tmergedData.writeFile(dirName+mergedValues_fName);\r\n\t\t\tdiscretizer.discretizeDownTree(dirName+discretizedMI_fName);\r\n\t\t\tdiscretizer.mergeDownLevels(3,dirName+discretizedLevels_fName);\r\n\t\t\tdiscretizer.transposeDExpression();\r\n\t\t\tmergedData.setDiscrete();\r\n\t\t\tmergedData.values = null;\r\n\t\t\tmergedData.dvalues = discretizer.dExpression;\r\n\t\t\tmergedData.writeFile(dirName+discretizedData_fName);\r\n\t\r\n\t\t\tmergedData.dvalues = mergedPMA;\r\n\t\t\tmergedData.numCols = mergedPMA[0].length;\r\n\t\t\tmergedData.writeFile(dirName+mergedPMA_fName);\r\n\t\t} catch(IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t/*\tMicroArrayData mergedData = new MicroArrayData();\r\n\t\tmergedData.values = mergedExpression;\r\n\t\tmergedData.geneNames = mergedGeneNames;\r\n\t\tmergedData.experimentNames = mergedExperimentNames;\r\n\t\tmergedData.experimentCode = species;\r\n\t\tmergedData.numCols = mergedExpression[0].length;\r\n\t\tmergedData.numRows = mergedExpression.length;\r\n\t\ttry {\r\n\t\t\tmergedData.writeFile(dirName+mergedValues_fName);\r\n\t\t\tmergedData.setDiscrete();\r\n\t\t\tmergedData.values = null;\r\n\t\t//\tmergedData.dvalues = simpleDiscretization(mergedExpression,mergedPMA);\r\n\t\t\tmergedData.dvalues = simpleDiscretization2(mergedExpression,species);\r\n\t\t\tmergedData.writeFile(dirName+discretizedData_fName);\r\n\t\r\n\t\t\tmergedData.dvalues = mergedPMA;\r\n\t\t\tmergedData.numCols = mergedPMA[0].length;\r\n\t\t\tmergedData.writeFile(dirName+mergedPMA_fName);\r\n\t\t} catch(IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t} */\r\n\t\t\r\n\t}", "private void loadData(){\n\t\t \n\t\t model.getDataVector().clear();\n\t\t ArrayList<Person> personList = DataBase.getInstance().getPersonList();\n\t\t for(Person person : personList){\n\t\t\t addRow(person.toBasicInfoStringArray());\n\t\t }\n\t\t \n\t }", "private void setTrainingData() throws IOException {\r\n\t\ttrainIdBodyMap = readInIdBodiesMap(new File(TRAIN_BODIES_CSV_LOCATION));\r\n\t\ttrainStances = readStances(new File(TRAIN_STANCES_CSV_LOCATION));\r\n\r\n\t}", "private void remplirPrestaraireData() {\n\t}", "public void PrepareDataset(TweetPreprocessor preprocessor, String dataset)\n\t{\n\t\tdbiterator = DBInstanceIterator.getInstance();\n\t\ttry\n {\n System.out.println(\"Preparing Datasets ...\");\n //PrepareAll(preprocessor,dataset);\n\n\t\t\tSystem.out.println(\"Saving work to Database ..\");\n\t\t\tsaveTextOutput(Dataset + \"data_text.csv\", \"d_text\");\n\t\t\tsaveTextOutput(Dataset + \"data_feature.csv\", \"d_feature\");\n\t\t\tsaveTextOutput(Dataset + \"data_complex.csv\", \"d_complex\");\n\t\t\t//saveLexiconOuput(Dataset + \"data_lexicon.csv\",true);\n\t\t\tSystem.out.println(\"Datasets ready for training .%.\");\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public InterpolationModel(Collection<List<String>> sentences) {\n\tthis();\n\tUnigram = new UnigramModel();\n\tBigram = new BigramModel();\n\tTrigram = new TrigramModel();\n\ttrain(sentences);\n }", "public void induceModel(Graph graph, DataSplit split) {\r\n super.induceModel(graph, split);\r\n Node[] trainingSet = split.getTrainSet();\r\n if(trainingSet == null || trainingSet.length == 0)\r\n return;\r\n\r\n Attributes attribs = trainingSet[0].getAttributes();\r\n FastVector attInfo = new FastVector(tmpVector.length);\r\n logger.finer(\"Setting up WEKA attributes\");\r\n if(useIntrinsic)\r\n {\r\n for(Attribute attrib : attribs)\r\n {\r\n // do not include the KEY attribute\r\n if(attrib == attribs.getKey())\r\n continue;\r\n\r\n switch(attrib.getType())\r\n {\r\n case CATEGORICAL:\r\n String[] tokens = ((AttributeCategorical)attrib).getTokens();\r\n FastVector values = new FastVector(tokens.length);\r\n for(String token : tokens)\r\n values.addElement(token);\r\n attInfo.addElement(new weka.core.Attribute(attrib.getName(),values));\r\n logger.finer(\"Adding WEKA attribute \"+attrib.getName()+\":Categorical\");\r\n break;\r\n\r\n default:\r\n attInfo.addElement(new weka.core.Attribute(attrib.getName()));\r\n logger.finer(\"Adding WEKA attribute \"+attrib.getName()+\":Numerical\");\r\n break;\r\n }\r\n }\r\n }\r\n else\r\n {\r\n String[] tokens = attribute.getTokens();\r\n FastVector values = new FastVector(tokens.length);\r\n for(String token : tokens)\r\n values.addElement(token);\r\n attInfo.addElement(new weka.core.Attribute(attribute.getName(),values));\r\n logger.finer(\"Adding WEKA attribute \"+attribute.getName()+\":Categorical\");\r\n }\r\n\r\n for(Aggregator agg : aggregators)\r\n {\r\n Attribute attrib = agg.getAttribute();\r\n switch(agg.getType())\r\n {\r\n case CATEGORICAL:\r\n String[] tokens = ((AttributeCategorical)attrib).getTokens();\r\n FastVector values = new FastVector(tokens.length);\r\n for(String token : tokens)\r\n values.addElement(token);\r\n attInfo.addElement(new weka.core.Attribute(agg.getName(),values));\r\n logger.finer(\"Adding WEKA attribute \"+agg.getName()+\":Categorical\");\r\n break;\r\n\r\n default:\r\n attInfo.addElement(new weka.core.Attribute(agg.getName()));\r\n logger.finer(\"Adding WEKA attribute \"+agg.getName()+\":Numerical\");\r\n break;\r\n }\r\n }\r\n\r\n Instances train = new Instances(\"train\",attInfo,split.getTrainSetSize());\r\n train.setClassIndex(vectorClsIdx);\r\n\r\n for(Node node : split.getTrainSet())\r\n {\r\n double[] v = new double[attInfo.size()];\r\n makeVector(node,v);\r\n train.add(new Instance(1,v));\r\n }\r\n try\r\n {\r\n classifier.buildClassifier(train);\r\n }\r\n catch(Exception e)\r\n {\r\n throw new RuntimeException(\"Failed to build classifier \"+classifier.getClass().getName(),e);\r\n }\r\n testInstance = new Instance(1,tmpVector);\r\n testInstances = new Instances(\"test\",attInfo,1);\r\n testInstances.setClassIndex(vectorClsIdx);\r\n testInstances.add(testInstance);\r\n testInstance = testInstances.firstInstance();\r\n }", "@Override\n\tprotected Instances lrprocess(Instances data) {\n\t\ttry {\n\t\t\treturn this.process(data);\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "protected void preRun() {\r\n\t\tthis.preparePairs();\r\n\t}", "@Override\n public Dataset<Row> runPreprocessingStep(Dataset<Row> dataSet, Map<String, Object> parameters, SparkRunnerConfig config) {\n List<String> columnsToKeep = new ArrayList<>();\n columnsToKeep.add(BpmnaiVariables.VAR_PROCESS_INSTANCE_ID);\n columnsToKeep.add(BpmnaiVariables.VAR_PROCESS_INSTANCE_VARIABLE_NAME);\n columnsToKeep.add(BpmnaiVariables.VAR_PROCESS_INSTANCE_VARIABLE_TYPE);\n columnsToKeep.add(BpmnaiVariables.VAR_PROCESS_INSTANCE_VARIABLE_REVISION);\n columnsToKeep.add(BpmnaiVariables.VAR_STATE);\n columnsToKeep.add(BpmnaiVariables.VAR_LONG);\n columnsToKeep.add(BpmnaiVariables.VAR_DOUBLE);\n columnsToKeep.add(BpmnaiVariables.VAR_TEXT);\n columnsToKeep.add(BpmnaiVariables.VAR_TEXT2);\n columnsToKeep.add(BpmnaiVariables.VAR_DATA_SOURCE);\n\n List<String> columnsToRemove = new ArrayList<>();\n\n Configuration configuration = ConfigurationUtils.getInstance().getConfiguration(config);\n if(configuration != null) {\n PreprocessingConfiguration preprocessingConfiguration = configuration.getPreprocessingConfiguration();\n if(preprocessingConfiguration != null) {\n for(ColumnConfiguration cc : preprocessingConfiguration.getColumnConfiguration()) {\n if(!cc.isUseColumn()) {\n if(columnsToKeep.contains(cc.getColumnName())) {\n BpmnaiLogger.getInstance().writeWarn(\"The column '\" + cc.getColumnName() + \"' has to stay in in order to do the processing. It will not be removed. Comment: \" + cc.getComment());\n } else {\n columnsToRemove.add(cc.getColumnName());\n BpmnaiLogger.getInstance().writeInfo(\"The column '\" + cc.getColumnName() + \"' will be removed. Comment: \" + cc.getComment());\n }\n }\n }\n }\n }\n\n //check if all variables that should be filtered actually exist, otherwise log a warning\n List<String> existingColumns = new ArrayList<>(Arrays.asList(dataSet.columns()));\n\n columnsToRemove\n .stream()\n .forEach(new Consumer<String>() {\n @Override\n public void accept(String s) {\n if(!existingColumns.contains(s)) {\n // log the fact that a variable that should be filtered does not exist\n BpmnaiLogger.getInstance().writeWarn(\"The column '\" + s + \"' is configured to be filtered, but does not exist in the data.\");\n }\n }\n });\n\n dataSet = dataSet.drop(BpmnaiUtils.getInstance().asSeq(columnsToRemove));\n\n return dataSet;\n }", "public abstract void fit(BinaryData trainingData);", "public void prepareARFF(WhereClause where, DatabaseState pre, HashMap<String, String> classinfo) throws Exception {\n\t\t\n\t\t// prepare file for Decision tree solver\n\t\tFile filename = new File(\"./data/feature.arff\");\n\t\tif(!filename.exists())\n\t\t\tfilename.createNewFile();\n\t\tFileWriter filewriter = new FileWriter(filename);\n\t\tBufferedWriter writer = new BufferedWriter(filewriter);\n\t\t\n\t\t// write data name\n\t\twriter.write(\"@RELATION test\"); writer.newLine();\n\t\t\n\t\t// write feature/attributes names\n\t\tfor(int i = 0; i < where.getWhereExprs().size(); ++i){\n\t\t\twriter.write(\"@ATTRIBUTE\" + \" col\"+String.valueOf(i) + \" NUMERIC\"); writer.newLine();\n\t\t\tmap.put(\"col\" + String.valueOf(i), where.getWhereExprs().get(i));\n\t\t}\n\t\t\n\t\t// write class information\n\t\twriter.write(\"@ATTRIBUTE class {'g','b'}\"); writer.newLine();\n\t\t\n\t\t// write data\n\t\twriter.write(\"@DATA\"); writer.newLine();\n\t\t\n\t\t// write data from dbstate\n\t\tString[] column_names = pre.getColumnNames();\n\t\tfor(String key: pre.getKeySet()){\n\t\t\t// for every tuple\n\t\t\tTuple tuple = pre.getTuple(key);\n\t\t\t\n\t\t\t// get feature info from each where expression\n\t\t\tfor(WhereExpr expr: where.getWhereExprs()){\n\t\t\t\t// update attributes' values\n\t\t\t\tfor(int i = 0; i < column_names.length; ++i)\n\t\t\t\t\texpr.getAttrExpr().setVariable(column_names[i], Double.valueOf(tuple.getValue(i)));\n\t\t\t\twriter.write(String.valueOf(expr.getAttrExpr().Evaluate()) + \",\");\n\t\t\t}\n\t\t\t\n\t\t\t// write class info\n\t\t\twriter.write(\"'\"+classinfo.get(key)+\"'\");\n\t\t\twriter.newLine();\n\t\t}\n\t\t\n\t\t// finish prepare file for DT solver\n\t\twriter.close();\n\t}", "@Data\npublic class <XXX>ModelInfo extends AbstractModelInfo {\n private <Field1DataType> <Field1>;\n /**\n * @return an corresponding {@link <XXX>Transformer} for this model info\n */\n @Override\n public Transformer getTransformer() {\n return new <XXX>Transformer(this);\n }", "protected Prediction(Parcel in) {\n this.tagId = in.readString();\n this._tag = in.readString();\n this.probability = in.readDouble();\n }", "protected void parseTermData()\n {\n for (int i = 0; i < data.length; i++)\n {\n data[i] = Cdata[i];\n }\n }", "void onParsableDataResult(List<T> parsableData);", "private void preprocess(ArrayList<Point>[] dsg) {\n preprocessGroup = new ArrayList<>();\n for(ArrayList<Point> l:dsg){\n \tfor(Point p:l){\n \t\tif(p.layer<=constructor.k_point_GSkyline_groups&&p.getUnitGroupSize()<=constructor.k_point_GSkyline_groups){\n \t\t\tpreprocessGroup.add(p);\n \t\t}\n \t}\n }\n for(int i=0;i<preprocessGroup.size();i++){\n \tpreprocessGroup.get(i).index=i;\n }\n }", "private void applyRules () throws DataNormalizationException {\n\t\tapplyRules(null);\n\t}", "protected void processDataObject() throws Exception\r\n\t{\r\n\t\tif (maximalRecordsToPass > 0 && currentPassedRecord > maximalRecordsToPass)\r\n\t\t{\r\n\t\t\t// simulate conversion end\r\n\t\t\tendDocument();\r\n\t\t\tthrow new RuntimeException(\"Converter ended after \"\t+ maximalRecordsToPass\t+ \" records (this is debug mode)\");\r\n\t\t}\r\n\t\tDataObject dataObject = getDataObject();\r\n\t\tObjectRule rule = dataObject.getDataObjectRule();\r\n\n\t\tString subject = null;\r\n\t\ttry\r\n\t\t{\r\n\t\t\tValue checkedSubjectValue = rule.checkConditionsAndGetSubject(dataObject);\n\t\t\tif (checkedSubjectValue != null) {\n\t\t\t\tsubject = checkedSubjectValue.getValue();\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tthrow new Exception(\"Problem with preprocessor on object rule\\n\"\t+ getDataObject().getDataObjectRule().toString(), e);\r\n\t\t}\r\n\r\n\t\tif (subject == null)\r\n\t\t{\r\n\t\t\t// this object should be ignored, remove unprocessed children from the\r\n\t\t\t// queue\r\n\t\t\tfor (DataObject childDataObject : dataObject.findAllChildren())\r\n\t\t\t{\r\n\t\t\t\tif (childDataObject == dataObject)\r\n\t\t\t\t\tthrow new Exception(\"Internal error: when removing child object fo the parent that should not be converted - a child is the same as the father\");\r\n\t\t\t\tpartsCompleted.remove(childDataObject);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// process this object\r\n\t\t\ttry\r\n\t\t\t{\n\t\t\t\trule.processDataObject(subject, this);\r\n\t\t\t}\r\n\t\t\tcatch (Exception e)\r\n\t\t\t{\n\t\t\t\tthrow new Exception(\n\t\t\t\t\t\t\"Exception with running property rules on object rule\\n\"\r\n\t\t\t\t\t\t+ getDataObject().getDataObjectRule().toString(), e);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void processing() {\n\n\t}", "private void convertData() {\n m_traces = new ArrayList<Trace>();\n\n for (final TraceList trace : m_module.getContent().getTraceContainer().getTraces()) {\n m_traces.add(new Trace(trace));\n }\n\n m_module.getContent().getTraceContainer().addListener(m_traceListener);\n\n m_functions = new ArrayList<Function>();\n\n for (final INaviFunction function :\n m_module.getContent().getFunctionContainer().getFunctions()) {\n m_functions.add(new Function(this, function));\n }\n\n for (final Function function : m_functions) {\n m_functionMap.put(function.getNative(), function);\n }\n\n m_views = new ArrayList<View>();\n\n for (final INaviView view : m_module.getContent().getViewContainer().getViews()) {\n m_views.add(new View(this, view, m_nodeTagManager, m_viewTagManager));\n }\n\n createCallgraph();\n }", "private void setupModel() {\n\n //Chooses which model gets prepared\n switch (id) {\n case 2:\n singlePackage = new Node();\n activeNode = singlePackage;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.package_solo)\n .build().thenAccept(renderable -> activeRenderable = renderable)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n\n case 3:\n multiPackage = new Node();\n activeNode = multiPackage;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.package_multi_new)\n .build().thenAccept(renderable -> activeRenderable = renderable)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n\n case 4:\n wagonPackage = new Node();\n activeNode = wagonPackage;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.package_car_new)\n .build().thenAccept(a -> activeRenderable = a)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n\n default:\n mailbox = new Node();\n activeNode = mailbox;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.mailbox)\n .build().thenAccept(renderable -> activeRenderable = renderable)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n }\n }", "public void normalize(List<RankList> samples) {\n/* 667 */ for (RankList sample : samples) nml.normalize(sample);\n/* */ \n/* */ }", "private void preProcessData() {\n\n // Group employees by department\n if (employeesByDepartments == null) {\n\n employeesByDepartments = new HashMap<>();\n\n dataSet.stream().forEach(employee -> {\n\n if (!employeesByDepartments.containsKey(employee.getDepartment()))\n employeesByDepartments.put(employee.getDepartment(), new HashSet<>());\n Set<EmployeeAggregate> employees = employeesByDepartments.get(employee.getDepartment());\n employees.add(employee);\n });\n }\n\n // Find out minimum, and maximum age of the employees\n if (minAge == 0) minAge = dataSet.stream().map(EmployeeAggregate::getAge).min(Integer::compare).get();\n if (maxAge == 0) maxAge = dataSet.stream().map(EmployeeAggregate::getAge).max(Integer::compare).get();\n\n // Group employees by age\n if (employeesByAgeRange == null) {\n\n employeesByAgeRange = new HashMap<>();\n\n // Work out age ranges\n Set<Range> ranges = new HashSet<>();\n int currTopBoundary = (int) Math.ceil((double) maxAge / (double) AGE_RANGE_INCREMENT) * AGE_RANGE_INCREMENT;\n\n while (currTopBoundary >= minAge) {\n Range range = new Range(currTopBoundary - AGE_RANGE_INCREMENT, currTopBoundary);\n ranges.add(range);\n employeesByAgeRange.put(range, new HashSet<>());\n currTopBoundary -= AGE_RANGE_INCREMENT;\n }\n\n // Group employees\n dataSet.stream().forEach(employee -> {\n for (Range range : ranges) {\n if (range.inRange(employee.getAge())) {\n\n employeesByAgeRange.get(range).add(employee);\n\n break;\n }\n }\n });\n }\n }", "public void trainModel(String input) {\n\n String[] words = input.split(\" \");\n String currentWord = \"\";\n\n for (int i = 0; i < words.length; i++) {\n\n if (i == 0 || words[i-1].contains(\".\")) {\n model.get(\"_begin\").add(words[i]);\n } else if (i == words.length - 1 || words[i].contains(\".\")) {\n model.get(\"_end\").add(words[i]);\n } else {\n model.putIfAbsent(currentWord, new ArrayList<String>());\n model.get(currentWord).add(words[i]);\n }\n\n currentWord = words[i];\n\n }\n }", "public void processLine(String line){\n\t\tString[] splitted = line.split(\"(\\\\s+|\\\\t+)\");\n\t\tif(splitted.length < FIELDS){\n\t\t\tSystem.err.println(\"DataRow: Cannot process line : \" + line);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tindex \t\t= Integer.parseInt(splitted[0]);\n\t\tparentIndex = Integer.parseInt(splitted[1]);\n\t\tword \t\t= splitted[2].trim();\n\t\tpos\t\t\t= splitted[3].trim();\n\t\tpredicateLabel = splitted[4].trim();\n\t\tintervenes = splitted[5];\n\t\t\n\t\tidentificationLabel = splitted[6];\n\t\tclassificationLabel = splitted[7];\n\t\t\n\t\thmmState = Integer.parseInt(splitted[8]);\n\t\tnaiveState = Integer.parseInt(splitted[9]);\n\t\tchunk = splitted[10];\n\t\tne = splitted[11];\n\t\tif(splitted.length > FIELDS){\n\t\t\tSystem.err.println(\"WARNING: data row has more than required columns: \" + line);\n\t\t}\n\t}", "private DefaultTableModel processData(File file, Constants.SetType setType,\n\t boolean shuffle, double trainingPercentage, double testPercentage) throws IOException, InvalidFormatException {\n\t\tCSVReader reader = new CSVReader(new FileReader(file));\n\n\t\tList data = reader.readAll();\n\n\t\t// First row preparation\n\t\tcolumnNames = (String[]) data.get(0);\n\n\t\t// Data from reader to List loading\n\t\tdata = data.subList(1, (int) reader.getLinesRead());\n\n\t\t// Data shuffling\n\t\tif (shuffle)\n\t\t\tCollections.shuffle(data);\n\n\t\t// Calculate train and test sub sets\n\t\tcalculateIndexesForDataSubSets(trainingPercentage, data.size());\n\n\t\t// DefaultTableModels preparation\n\t\tprepareDefaultTableModels(data);\n\n\t\treturn getTableModels().get(setType);\n\t}", "private void parseAndPopulate(String in) {\r\n\t\tIParser parser = new AbbyyOCRDataParser(in);\r\n\t\tocrData = parser.parse();\r\n\t\tStore.addData(ocrData);\r\n\t\t\r\n\t\tEditText np = (EditText)findViewById(R.id.patient_et);\r\n\t\tEditText nm = (EditText)findViewById(R.id.medicine_et);\r\n\t\tEditText cd = (EditText)findViewById(R.id.consumption_et);\r\n\t\t\r\n\t\tPatient2Medicine p2m = ocrData.getPatient2Medicine();\r\n\t\tnp.setText(ocrData.getPatient().getName());\r\n\t\tnm.setText(ocrData.getMedicine().getMedicine());\r\n\t\tcd.setText(p2m.getFrequencyOfIntake()\r\n\t\t\t\t+ \" \" + p2m.getQuantityPerIntake() + \" by \" + p2m.getMode());\r\n\t\t\r\n\t}", "public void normalize()\n\t{\n\t\tlong last_entity_id = getLastEntityId(getEntityName());\n\t\t\n\t\t/* Clear db of any id's greater than id for this entity. Keep things clean */\n\t\t\n\t\t/* Save new entries for that entity */\n\t\tprocessNewRows(last_entity_id);\n\t\t\n\t\t/* Update session info */\n\t}", "void populateData();", "@Override\n public void prepareRun(BatchSourceContext context) throws IOException {\n Map<String, String> arguments = new HashMap<>();\n FileSetArguments.setInputPaths(arguments, config.files);\n context.setInput(Input.ofDataset(config.fileSetName, arguments));\n }", "public InterpolationModel() {\n\tUnigram = new UnigramModel();\n\tBigram = new BigramModel();\n\tTrigram = new TrigramModel();\n }", "private void loadData(){\n try (BufferedReader br = new BufferedReader(new FileReader(this.fileName))) {\n String line;\n while((line=br.readLine())!=null){\n E e = createEntity(line);\n super.save(e);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void load(final String model_file) throws Exception {\n\t\ttry {\n\t\t\tFileInputStream in = new FileInputStream(model_file);\n\t\t\tGZIPInputStream gin = new GZIPInputStream(in);\n\n\t\t\tObjectInputStream s = new ObjectInputStream(gin);\n\n\t\t\ts.readObject(); //this is the id\n\n\t\t\tsetFeature((String) s.readObject());\n\t\t\tsetInfo((String) s.readObject());\n\n\t\t\tprobs = (HashMap[][]) s.readObject();\n\t\t\t//classnum = s.readInt();\n\t\t\t//classnames = (ArrayList) s.readObject();\n\t\t\tint b, a = s.readInt();\n\t\t\tclassCounts = new double[a];\n\n\t\t\tfor (int i = 0; i < a; i++)\n\t\t\t\tclassCounts[i] = s.readDouble();\n\t\t\ttotalExamplesSeen = s.readDouble();\n\t\t\t//a = s.readInt();\n\t\t\t//header = new int[a];\n\t\t\t//for (int i = 0; i < header.length; i++)\n\t\t\t//\theader[i] = s.readInt();\n\t\t\t//read in saved numbers\n\t\t\ta = s.readInt();\n\t\t\tm_seenNumbers = new double[a][];\n\t\t\tfor (int i = 0; i < a; i++) {\n\t\t\t\tb = s.readInt();\n\t\t\t\tm_seenNumbers[i] = new double[b];\n\t\t\t\tfor (int j = 0; j < b; j++)\n\t\t\t\t\tm_seenNumbers[i][j] = s.readDouble();\n\t\t\t}\n\t\t\t//now for weights\n\t\t\ta = s.readInt();\n\t\t\tm_Weights = new double[a][];\n\t\t\tfor (int i = 0; i < a; i++) {\n\t\t\t\tb = s.readInt();\n\t\t\t\tm_Weights[i] = new double[b];\n\t\t\t\tfor (int j = 0; j < b; j++)\n\t\t\t\t\tm_Weights[i][j] = s.readDouble();\n\t\t\t}\n\n\t\t\ta = s.readInt();\n\t\t\tm_NumValues = new int[a];\n\t\t\tfor (int i = 0; i < a; i++)\n\t\t\t\tm_NumValues[i] = s.readInt();\n\n\t\t\ta = s.readInt();\n\t\t\tm_SumOfWeights = new double[a];\n\t\t\tfor (int i = 0; i < a; i++)\n\t\t\t\tm_SumOfWeights[i] = s.readDouble();\n\n\n\t\t\tm_StandardDev = s.readDouble();\n\t\t\tsetThreshold(s.readDouble());\n\t\t\tisOneClass(s.readBoolean());\n\t\t\tint len = s.readInt();\n\t\t\tfeatureArray = new boolean[len];\n\t\t\tfor (int i = 0; i < featureArray.length; i++) {\n\t\t\t\tfeatureArray[i] = s.readBoolean();\n\t\t\t}\n\t\t\tlen = s.readInt();\n\t\t\tfeatureTotals = new int[len];\n\t\t\tfor (int i = 0; i < featureTotals.length; i++) {\n\t\t\t\tfeatureTotals[i] = s.readInt();\n\t\t\t}\n\n\t\t\tinTraining = s.readBoolean();\n\n\n\t\t\t//read in ngram model\n\t\t\tString name = (String) s.readObject();\n\t\t\t//need to see which type of txt class it is.\n\t\t\ttry {\n\t\t\t\t//need to fix\n\t\t\t\tFileInputStream in2 = new FileInputStream(name);\n\t\t\t\tObjectInputStream s2 = new ObjectInputStream(in2);\n\t\t\t\tString modeltype = new String((String) s2.readObject());\n\t\t\t\ts2.close();\n\t\t\t\tif (modeltype.startsWith(\"NGram\"))\n\t\t\t\t\ttxtclass = new NGram();\n\t\t\t\telse\n\t\t\t\t\ttxtclass = new TextClassifier();\n\n\t\t\t\ttxtclass.setProgress(false);//we dont want to show subclass\n\t\t\t\t// progresses.\n\t\t\t} catch (Exception e2) {\n\t\t\t\ttxtclass = new NGram();\n\t\t\t\ttxtclass.setProgress(false);//we dont want to show subclass\n\t\t\t\t// progresses.\n\t\t\t}\n\n\t\t\ttxtclass.load(name);\n\n\n\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in nbayes read file:\" + e);\n\t\t}\n\t\t//now that we've loaded, its time to set the flag to true.\n\t\t//hasModel = true;\n\t\t/*for(int i=0;i<MLearner.NUMBER_CLASSES;i++)\n\t\t{\t\n\t\t\tif(classCounts[i]<3)\n\t\t\t\tcontinue;\n\t\t\tfor(int j=0;j<featureArray.length;j++)\n\t\t\t{\n\t\t\t\tif(featureArray[j])\n\t\t\t\t\tSystem.out.println(i+\" \"+j+\" \"+probs[i][j]);\n\t\t\t}\n\t\t}*/\n\t\tRealprobs = new HashMap[MLearner.NUMBER_CLASSES][featureArray.length];\n\t\tsetFeatureBoolean(featureArray);\n\t\tinTraining = true;//easier than saving the work (although should check size fisrt\n\t}", "public DummyModel(String data) {\n textData = data;\n }", "private void separateAttributes() {\n\n String gfuncStr = gridRscData.getGdpfun().replaceAll(\"\\\\s+\", \"\").trim();\n if (gfuncStr != null && gfuncStr.endsWith(\"!\")) {\n gfuncStr = gfuncStr.substring(0, gfuncStr.length() - 1);\n }\n String[] gfuncArray = gfuncStr.split(\"!\", -1);\n\n String[] glevelArray = gridRscData.getGlevel().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] gvcordArray = gridRscData.getGvcord().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] skipArray = gridRscData.getSkip().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] filterArray = gridRscData.getFilter().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] scaleArray = gridRscData.getScale().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] typeArray = gridRscData.getType().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] cintArray = gridRscData.getCint().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] lineArray = gridRscData.getLineAttributes()\n .replaceAll(\"\\\\s+\", \"\").split(\"!\", -1);\n String[] fintArray = gridRscData.getFint().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] flineArray = gridRscData.getFline().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] hiloArray = gridRscData.getHilo().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] hlsymArray = gridRscData.getHlsym().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] windArray = gridRscData.getWind().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] markerArray = gridRscData.getMarker().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] clrbarArray = gridRscData.getClrbar().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] textArray = gridRscData.getText().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] colorArray = gridRscData.getColors().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n /* Clean up cint -- max 5 zoom level */\n if (cintArray != null && cintArray.length > 0) {\n for (int i = 0; i < cintArray.length; i++) {\n String[] tmp = cintArray[i].split(\">\");\n if (tmp.length > 5) {\n cintArray[i] = tmp[0] + \">\" + tmp[1] + \">\" + tmp[2] + \">\"\n + tmp[3] + \">\" + tmp[4];\n }\n }\n }\n\n for (int i = 0; i < gfuncArray.length; i++) {\n if (gfuncArray[i].contains(\"//\")) {\n String[] tmpstr = gfuncArray[i].split(\"//\", 2);\n gfuncArray[i] = tmpstr[0];\n String referencedAlias = tmpstr[1];\n String referencedFunc = tmpstr[0];\n /*\n * Need to substitute all occurrences of referencedAlias with\n * referencedFunc\n */\n for (int j = i + 1; j < gfuncArray.length; j++) {\n /*\n * First need to find out if the gfuncArray[i] is a derived\n * quantity\n */\n gfuncArray[j] = substituteAlias(referencedAlias,\n referencedFunc, gfuncArray[j]);\n }\n } else {\n\n /*\n * Handle blank GDPFUN\n */\n if (gfuncArray[i].isEmpty()) {\n if (i > 0) {\n gfuncArray[i] = gfuncArray[i - 1];\n }\n }\n\n }\n }\n\n contourAttributes = new ContourAttributes[gfuncArray.length];\n\n for (int i = 0; i < gfuncArray.length; i++) {\n contourAttributes[i] = new ContourAttributes();\n contourAttributes[i].setGdpfun(gfuncArray[i]);\n\n if (i == 0) {\n contourAttributes[i].setGlevel(glevelArray[0]);\n contourAttributes[i].setGvcord(gvcordArray[0]);\n contourAttributes[i].setSkip(skipArray[0]);\n contourAttributes[i].setFilter(filterArray[0]);\n contourAttributes[i].setScale(scaleArray[0]);\n contourAttributes[i].setType(typeArray[0]);\n contourAttributes[i].setCint(cintArray[0]);\n contourAttributes[i].setLine(lineArray[0]);\n contourAttributes[i].setFint(fintArray[0]);\n contourAttributes[i].setFline(flineArray[0]);\n contourAttributes[i].setHilo(hiloArray[0]);\n contourAttributes[i].setHlsym(hlsymArray[0]);\n contourAttributes[i].setWind(windArray[0]);\n contourAttributes[i].setMarker(markerArray[0]);\n contourAttributes[i].setClrbar(clrbarArray[0]);\n contourAttributes[i].setText(textArray[0]);\n contourAttributes[i].setColors(colorArray[0]);\n } else {\n int idx = (glevelArray.length > i) ? i\n : (glevelArray.length - 1);\n if (glevelArray[idx].isEmpty() && idx > 0) {\n glevelArray[idx] = glevelArray[idx - 1];\n }\n contourAttributes[i].setGlevel(glevelArray[idx]);\n\n idx = (gvcordArray.length > i) ? i : gvcordArray.length - 1;\n if (gvcordArray[idx].isEmpty() && idx > 0) {\n gvcordArray[idx] = gvcordArray[idx - 1];\n }\n contourAttributes[i].setGvcord(gvcordArray[idx]);\n\n idx = (skipArray.length > i) ? i : skipArray.length - 1;\n if (skipArray[idx].isEmpty() && idx > 0) {\n skipArray[idx] = skipArray[idx - 1];\n }\n contourAttributes[i].setSkip(skipArray[idx]);\n\n idx = (filterArray.length > i) ? i : filterArray.length - 1;\n if (filterArray[idx].isEmpty() && idx > 0) {\n filterArray[idx] = filterArray[idx - 1];\n }\n contourAttributes[i].setFilter(filterArray[idx]);\n\n idx = (scaleArray.length > i) ? i : scaleArray.length - 1;\n if (scaleArray[idx].isEmpty() && idx > 0) {\n scaleArray[idx] = scaleArray[idx - 1];\n }\n contourAttributes[i].setScale(scaleArray[idx]);\n\n idx = (typeArray.length > i) ? i : typeArray.length - 1;\n if (typeArray[idx].isEmpty() && idx > 0) {\n typeArray[idx] = typeArray[idx - 1];\n }\n contourAttributes[i].setType(typeArray[idx]);\n\n idx = (cintArray.length > i) ? i : cintArray.length - 1;\n if (cintArray[idx].isEmpty() && idx > 0) {\n cintArray[idx] = cintArray[idx - 1];\n }\n contourAttributes[i].setCint(cintArray[idx]);\n\n idx = (lineArray.length > i) ? i : lineArray.length - 1;\n if (lineArray[idx].isEmpty() && idx > 0) {\n lineArray[idx] = lineArray[idx - 1];\n }\n contourAttributes[i].setLine(lineArray[idx]);\n\n idx = (fintArray.length > i) ? i : fintArray.length - 1;\n if (fintArray[idx].isEmpty() && idx > 0) {\n fintArray[idx] = fintArray[idx - 1];\n }\n contourAttributes[i].setFint(fintArray[idx]);\n\n idx = (flineArray.length > i) ? i : flineArray.length - 1;\n if (flineArray[idx].isEmpty() && idx > 0) {\n flineArray[idx] = flineArray[idx - 1];\n }\n contourAttributes[i].setFline(flineArray[idx]);\n\n idx = (hiloArray.length > i) ? i : hiloArray.length - 1;\n if (hiloArray[idx].isEmpty() && idx > 0) {\n hiloArray[idx] = hiloArray[idx - 1];\n }\n contourAttributes[i].setHilo(hiloArray[idx]);\n\n idx = (hlsymArray.length > i) ? i : hlsymArray.length - 1;\n if (hlsymArray[idx].isEmpty() && idx > 0) {\n hlsymArray[idx] = hlsymArray[idx - 1];\n }\n contourAttributes[i].setHlsym(hlsymArray[idx]);\n\n idx = (windArray.length > i) ? i : windArray.length - 1;\n if (windArray[idx].isEmpty() && idx > 0) {\n windArray[idx] = windArray[idx - 1];\n }\n contourAttributes[i].setWind(windArray[idx]);\n\n idx = (markerArray.length > i) ? i : markerArray.length - 1;\n if (markerArray[idx].isEmpty() && idx > 0) {\n markerArray[idx] = markerArray[idx - 1];\n }\n contourAttributes[i].setMarker(markerArray[idx]);\n\n idx = (clrbarArray.length > i) ? i : clrbarArray.length - 1;\n if (clrbarArray[idx].isEmpty() && idx > 0) {\n clrbarArray[idx] = clrbarArray[idx - 1];\n }\n contourAttributes[i].setClrbar(clrbarArray[idx]);\n\n idx = (textArray.length > i) ? i : textArray.length - 1;\n if (textArray[idx].isEmpty() && idx > 0) {\n textArray[idx] = textArray[idx - 1];\n }\n contourAttributes[i].setText(textArray[idx]);\n\n idx = (colorArray.length > i) ? i : colorArray.length - 1;\n if (colorArray[idx].isEmpty() && idx > 0) {\n colorArray[idx] = colorArray[idx - 1];\n }\n contourAttributes[i].setColors(colorArray[idx]);\n\n }\n }\n }", "DataModel getDataModel ();", "@Override\n\tpublic Object process(Object input) {\n\t\treturn filter.process((Waveform2)input);\n\t}", "public List<Feature> process(String tag, String data);", "protected abstract Instances filterData(PipelineData data) throws Exception;", "private void preprocess(Bitmap bitmap) {\n convertBitmapToByteBuffer(bitmap);\n }", "public abstract void build(ClassifierData<U> inputData);", "private void initializeModel() {\n\t\t\n\t}", "protected void prepare()\n\t{\n\t\tProcessInfoParameter[] para = getParameter();\n\t\tfor (int i = 0; i < para.length; i++)\n\t\t{\n\t\t\tString name = para[i].getParameterName();\n\t\t\t\n\t\t\tif (name.equals(\"Action\"))\n\t\t\t\tp_Action = para[i].getParameterAsString();\n\t\t\telse\n\t\t\t\tlog.log(Level.SEVERE, \"Unknown Parameter: \" + name);\n\t\t}\n\t\tp_Hospitalization_ID=getRecord_ID();\n\t}", "public void prepareData(){\n\tAssert.pre( data!=null, \"data must be aquired first\");\n\t//post: creates a vector of items with a maximum size, nullifies the original data. This prevents us from having to loop through the table each time we need a random charecter (only once to prepare the table). this saves us more time if certain seeds are used very often.\n\n\t//alternate post: changes frequencies in data vector to the sum of all the frequencies so far. would have to change getrandomchar method\n\n\n\t //if the array is small, we can write out all of the Strings\n\t \n\ttable = new Vector(MAX_SIZE);\n\n\tif (total < MAX_SIZE){\n\t\t\n\t\n\t\t//steps through data, creating a new vector\n\t\tfor(int i = 0; i<data.size(); i++){\n\n\t\t count = data.get(i);\n\n\t\t Integer fr = count.getValue();\n\t\t int f = fr.intValue();\n\n\t\t if(total<MAX_SIZE){\n\t\t\tf = (f*MAX_SIZE)/total;\n\t\t }\n\t\t\t\n\t\t //ensures all are represented (biased towards small values)\n\t\t //if (f == 0){ f == 1;}\n\n\n\t\t String word = (String)count.getKey();\n\t \n\t\t for (int x = 0; x< f; x++){\n\t\t\ttable.add( word);\n\t\t }\n\n\t\t}\n\t }\n\n\t//because of division with ints, the total might not add up 100.\n\t//so we redefine the total at the end of this process\n\ttotal = table.size();\n\n\t //we've now prepared the data\n\t dataprepared = true;\n\n\t //removes data ascociations to clear memory\n\t data = null;\n\t}", "private void processContentEn() {\n if (this.content == null || this.content.equals(\"\")) {\r\n _logger.error(\"{} - The sentence is null or empty\", this.traceId);\r\n }\r\n\r\n // process input using ltp(Segmentation, POS, DP, SRL)\r\n this.nlp = new NLP(this.content, this.traceId, this.setting);\r\n }", "protected void prepare()\n\t{\n\t\tProcessInfoParameter[] para = getParameter();\n\t\tfor (int i = 0; i < para.length; i++)\n\t\t{\n\t\t\tString name = para[i].getParameterName();\n\t\t\tif (para[i].getParameter() == null)\n\t\t\t\t;\n\t\t\telse if (name.equals(\"M_Requisition_ID\"))\n\t\t\t\tp_M_RequisitionFrom_ID = ((BigDecimal)para[i].getParameter()).intValue();\n\t\t\telse\n\t\t\t\tlog.log(Level.SEVERE, \"Unknown Parameter: \" + name);\n\t\t}\n\t}", "public void train() {\n\t\tfor (int i = 0; i < numberOfIterations; i++) {\n\t\t\t// for each training record\n\t\t\tfor (int j = 0; j < numberOfRecords; j++) {\n\t\t\t\t// calculate inputs and outputs\n\t\t\t\tforwardCalculation(records.get(j).input);\n\t\t\t\t// compute errors, update weights and thetas\n\t\t\t\tbackwardCalculation(records.get(j).output);\n\t\t\t}\n//\t\t\tpostprocessOutputs();\n\t\t}\n\t}", "@Test\n\tpublic void testProcessAndLoad() {\n\t\tPreProcessor preProcessor = new PreProcessor();\n\t\tpreProcessor.processFiles(new File(\"res/tests/test1.txt\"));\n\t\tNGramModel actualModel = preProcessor.getNgramModel();\n\t\tactualModel.end();\n\t\t\n\t\tString testFilePath = \"res/bin/test.bin\";\n\t\t\n\t\tFile dir = new File(\"res/bin\");\n\t\tif (!dir.exists()) {\n\t\t\tdir.mkdirs();\n\t\t}\n\t\t\n\t\tpreProcessor.writeToFile(testFilePath);\n\t\t\n\t\tLoader loader = new Loader();\n\t\tNGramModel loadedModel = loader.load(testFilePath);\n\t\tassertEquals(loadedModel.numNgrams(), actualModel.getNgrams().size());\n\t\t\n\t\tfor (Map.Entry<NGram, Integer> current : actualModel.getNgrams().entrySet()) {\n\t\t\tassertEquals((int)current.getValue(), loadedModel.getCount(current.getKey()));\n\t\t}\n\t\t\n\t\tfor (int i = 1; i <= actualModel.maxLength(); i++) {\n\t\t\tassertEquals(loadedModel.numberOfNGramLength(i), actualModel.numberOfNGramLength(i));\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < actualModel.topUnigrams().size(); i++) {\n\t\t\tassertEquals(loadedModel.topUnigrams().get(i), actualModel.topUnigrams().get(i));\n\t\t}\n\t\t\n\t\tassertEquals(\n\t\t\tloadedModel.getGoodTuringEstimation().getTotal(),\n\t\t\tactualModel.getGoodTuringEstimation().getTotal());\n\t\t\n\t\tassertEquals(\n\t\t\tloadedModel.getGoodTuringEstimation().getA(),\n\t\t\tactualModel.getGoodTuringEstimation().getA(), 1E-6);\n\t\t\n\t\tassertEquals(\n\t\t\tloadedModel.getGoodTuringEstimation().getB(),\n\t\t\tactualModel.getGoodTuringEstimation().getB(), 1E-6);\n\t}" ]
[ "0.7185971", "0.7185971", "0.7185971", "0.7185971", "0.7007652", "0.6891497", "0.670891", "0.6673237", "0.6248359", "0.6137292", "0.60628426", "0.60427654", "0.6022668", "0.5856188", "0.5828943", "0.57392967", "0.5682014", "0.56186295", "0.5596448", "0.5583993", "0.55220217", "0.5475883", "0.5467014", "0.54641753", "0.54474205", "0.5410903", "0.54030544", "0.5402487", "0.54021996", "0.53809047", "0.5379259", "0.5325403", "0.53028315", "0.5295118", "0.5281448", "0.52520925", "0.52493465", "0.5231564", "0.51912946", "0.5179492", "0.5177358", "0.51736224", "0.51528764", "0.514346", "0.5139169", "0.51388985", "0.5138493", "0.5131986", "0.51302814", "0.5124095", "0.5117482", "0.5112395", "0.5107424", "0.5076947", "0.5066158", "0.50654685", "0.50568503", "0.5038498", "0.5024965", "0.50090414", "0.5002459", "0.49974403", "0.49945927", "0.49925265", "0.49843237", "0.49763083", "0.49662775", "0.4965198", "0.49554476", "0.49551946", "0.49550948", "0.4948749", "0.4944846", "0.4944839", "0.49441293", "0.49407732", "0.49406284", "0.4931122", "0.49236298", "0.49195752", "0.4916823", "0.49164128", "0.49141502", "0.49021772", "0.49004927", "0.48996544", "0.48965746", "0.48956028", "0.48912376", "0.48846227", "0.48801732", "0.4875739", "0.48717415", "0.48715737", "0.486729", "0.486541", "0.48614264", "0.48593563", "0.48555237", "0.48528653" ]
0.50452185
57
Creates a new instance of Shoes1
public S11() { super(); strapAllowed = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Shoe makeShoe() {\n\treturn new Shoe();\r\n}", "public Builder setShoes(int value) {\n bitField0_ |= 0x00000040;\n shoes_ = value;\n onChanged();\n return this;\n }", "@Override\n\tpublic void create () {\n\t\tgempiresAssetHandler = new GempiresAssetHandler(this);\n\t\tbatch = new SpriteBatch();\n\t\tcastle = new CastleScreen(this);\n\t\tsetScreen(new MainMenuScreen(this));\n\t}", "public Shiv(){\n super(\"Shiv\",25);\n }", "public Fish create(){\n\t\tMovementStyle style = new NoMovement();\n\t\treturn new Shark(style);\n\t}", "public Driver() {\r\n\t\tShoe shoes[] = new Shoe[10]; //Array of ten shoes\r\n\t}", "private FireWeaponScreenFactory() {\n\t}", "public void create() {\n connect();\n batch = new SpriteBatch();\n font = new BitmapFont();\n\n audioManager.preloadTracks(\"midlevelmusic.wav\", \"firstlevelmusic.wav\", \"finallevelmusic.wav\", \"mainmenumusic.wav\");\n\n mainMenuScreen = new MainMenuScreen(this);\n pauseMenuScreen = new PauseMenuScreen(this);\n settingsScreen = new SettingsScreen(this);\n completeLevelScreen = new CompleteLevelScreen(this);\n completeGameScreen = new CompleteGameScreen(this);\n\n setScreen(mainMenuScreen);\n }", "public StimuliFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "Stone create();", "protected void createContents() {\n\t\tshlFaststone = new Shell();\n\t\tshlFaststone.setImage(SWTResourceManager.getImage(Edit.class, \"/image/all1.png\"));\n\t\tshlFaststone.setToolTipText(\"\");\n\t\tshlFaststone.setSize(944, 479);\n\t\tshlFaststone.setText(\"kaca\");\n\t\tshlFaststone.setLayout(new FillLayout(SWT.HORIZONTAL));\n\t\t\n\t\tComposite composite = new Composite(shlFaststone, SWT.NONE);\n\t\tcomposite.setLayout(new FillLayout(SWT.HORIZONTAL));\n\t\t\n\t\tSashForm sashForm = new SashForm(composite, SWT.VERTICAL);\n\t\t//\n\t\tMenu menu = new Menu(shlFaststone, SWT.BAR);\n\t\tshlFaststone.setMenuBar(menu);\n\t\tMenuItem menuItem = new MenuItem(menu, SWT.CASCADE);\n\t\tmenuItem.setSelection(true);\n\t\tmenuItem.setText(\"\\u6587\\u4EF6\");\n\t\t\n\t\tMenu menu_1 = new Menu(menuItem);\n\t\tmenuItem.setMenu(menu_1);\n\t\t\n\t\tfinal Canvas down=new Canvas(shlFaststone,SWT.NONE|SWT.BORDER|SWT.DOUBLE_BUFFERED);\n\t\t\n\t\tComposite composite_4 = new Composite(sashForm, SWT.BORDER);\n\t\tcomposite_4.setLayout(new FillLayout(SWT.HORIZONTAL));\n\t\t\n\t\tSashForm sashForm_3 = new SashForm(composite_4, SWT.NONE);\n\t\tformToolkit.adapt(sashForm_3);\n\t\tformToolkit.paintBordersFor(sashForm_3);\n\t\t\n\t\tToolBar toolBar = new ToolBar(sashForm_3, SWT.BORDER | SWT.FLAT | SWT.WRAP | SWT.RIGHT);\n\t\ttoolBar.setToolTipText(\"\");\n\t\t\n\t\tToolItem toolItem_6 = new ToolItem(toolBar, SWT.NONE);\n\t\ttoolItem_6.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tmntmNewItem_2.notifyListeners(SWT.Selection,event1);\n\n\t\t\t}\n\t\t});\n\t\ttoolItem_6.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6253\\u5F00.jpg\"));\n\t\ttoolItem_6.setText(\"\\u6253\\u5F00\");\n\t\t\n\t\tToolItem tltmNewItem = new ToolItem(toolBar, SWT.NONE);\n\t\t\n\t\t\n\t\ttltmNewItem.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\n\n\t\t\t}\n\t\t});\n\t\t//\n\t\t\n\t\ttltmNewItem.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u53E6\\u5B58\\u4E3A.jpg\"));\n\t\ttltmNewItem.setText(\"\\u53E6\\u5B58\\u4E3A\");\n\t\t//关闭\n\t\tToolItem tltmNewItem_4 = new ToolItem(toolBar, SWT.NONE);\n\t\ttltmNewItem_4.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tmntmNewItem_5.notifyListeners(SWT.Selection, event2);\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\ttltmNewItem_4.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7ED3\\u675F.jpg\"));\n\t\ttltmNewItem_4.setText(\"\\u5173\\u95ED\");\n\t\t\n\t\t\n\t\t\n\t\tToolItem tltmNewItem_1 = new ToolItem(toolBar, SWT.NONE);\n\t\ttltmNewItem_1.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t//缩放\n\t\t\n\t\t\n\t\ttltmNewItem_1.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u653E\\u5927.jpg\"));\n\t\t\n\t\t//工具栏:放大\n\t\t\n\t\ttltmNewItem_1.setText(\"\\u653E\\u5927\");\n\t\t\n\t\tToolItem tltmNewItem_2 = new ToolItem(toolBar, SWT.NONE);\n\t\t\n\t\t//工具栏:缩小\n\t\ttltmNewItem_2.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t}\n\t\t});\n\t\t\n\t\ttltmNewItem_2.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F29\\u5C0F.jpg\"));\n\t\ttltmNewItem_2.setText(\"\\u7F29\\u5C0F\");\n\t\tToolItem toolItem_5 = new ToolItem(toolBar, SWT.NONE);\n\t\ttoolItem_5.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tmntmNewItem_5.notifyListeners(SWT.Selection, event2);\n\n\t\t\t}\n\t\t});\n\t\ttoolItem_5.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7ED3\\u675F.jpg\"));\n\t\ttoolItem_5.setText(\"\\u9000\\u51FA\");\n\t\t\n\t\tToolBar toolBar_1 = new ToolBar(sashForm_3, SWT.BORDER | SWT.FLAT | SWT.RIGHT);\n\t\tformToolkit.adapt(toolBar_1);\n\t\tformToolkit.paintBordersFor(toolBar_1);\n\t\t\n\t\tToolItem toolItem_7 = new ToolItem(toolBar_1, SWT.NONE);\n\t\t\n\t\t//工具栏:标题\n\t\ttoolItem_7.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t}\n\t\t});\n\t\t//\n\t\t\n\t\ttoolItem_7.setText(\"\\u6807\\u9898\");\n\t\ttoolItem_7.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6807\\u9898.jpg\"));\n\t\t\n\t\tToolItem toolItem_1 = new ToolItem(toolBar_1, SWT.NONE);\n\t\t\n\t\t//工具栏:调整大小\n\t\ttoolItem_1.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t}\n\t\t});\n\t\t//\n\t\t\n\t\ttoolItem_1.setText(\"\\u8C03\\u6574\\u5927\\u5C0F\");\n\t\ttoolItem_1.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u8C03\\u6574\\u5927\\u5C0F.jpg\"));\n\t\t\n\t\tToolBar toolBar_2 = new ToolBar(sashForm_3, SWT.BORDER | SWT.FLAT | SWT.RIGHT);\n\t\ttoolBar_2.setBackground(SWTResourceManager.getColor(SWT.COLOR_GRAY));\n\t\tformToolkit.adapt(toolBar_2);\n\t\tformToolkit.paintBordersFor(toolBar_2);\n\t\t\n\t\tToolItem toolItem_2 = new ToolItem(toolBar_2, SWT.NONE);\n\t\t\n\t\t//工具栏:裁剪\n\t\ttoolItem_2.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t}\n\t\t});\n\t\t//\n\t\t\n\t\ttoolItem_2.setText(\"\\u88C1\\u526A\");\n\t\ttoolItem_2.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u88C1\\u526A.jpg\"));\n\t\t\n\t\tToolItem toolItem_3 = new ToolItem(toolBar_2, SWT.NONE);\n\t\t\n\t\t//工具栏:剪切\n\t\ttoolItem_3.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t}\n\t\t});\n\t\t//\n\t\t\n\t\ttoolItem_3.setText(\"\\u526A\\u5207\");\n\t\ttoolItem_3.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u526A\\u5207.jpg\"));\n\t\t\n\t\tToolItem toolItem_4 = new ToolItem(toolBar_2, SWT.NONE);\n\t\t\n\n\t\t//工具栏:粘贴\n\t\ttoolItem_4.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t\tcomposite_3.layout();\n\t\t\t\tFile f=new File(\"src/picture/beauty.jpg\");\n\t\t\t\tImageData imageData;\n\t\t\t\ttry {\n\t\t\t\t\timageData = new ImageData( new FileInputStream( f));\n\t\t\t\t\tImage image=new Image(shlFaststone.getDisplay(),imageData);\n\t\t\t\t\tButton lblNewLabel_3 = null;\n\t\t\t\t\tlblNewLabel_3.setImage(image);\n\t\t\t\t} catch (FileNotFoundException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\tcomposite_3.layout();\n\t\t\t}\n\t\t});\n\t\t//omposite;\n\t\t//\n\t\t\n\t\ttoolItem_4.setText(\"\\u590D\\u5236\");\n\t\ttoolItem_4.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u590D\\u5236.jpg\"));\n\t\t\n\t\tToolItem tltmNewItem_3 = new ToolItem(toolBar_2, SWT.NONE);\n\t\ttltmNewItem_3.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u7C98\\u8D34.jpg\"));\n\t\ttltmNewItem_3.setText(\"\\u7C98\\u8D34\");\n\t\tsashForm_3.setWeights(new int[] {486, 165, 267});\n\t\t\n\t\tComposite composite_1 = new Composite(sashForm, SWT.NONE);\n\t\tformToolkit.adapt(composite_1);\n\t\tformToolkit.paintBordersFor(composite_1);\n\t\tcomposite_1.setLayout(new FillLayout(SWT.HORIZONTAL));\n\t\t\n\t\tSashForm sashForm_1 = new SashForm(composite_1, SWT.VERTICAL);\n\t\tformToolkit.adapt(sashForm_1);\n\t\tformToolkit.paintBordersFor(sashForm_1);\n\t\t\n\t\tComposite composite_2 = new Composite(sashForm_1, SWT.NONE);\n\t\tformToolkit.adapt(composite_2);\n\t\tformToolkit.paintBordersFor(composite_2);\n\t\tcomposite_2.setLayout(new FillLayout(SWT.HORIZONTAL));\n\t\t\n\t\tTabFolder tabFolder = new TabFolder(composite_2, SWT.NONE);\n\t\ttabFolder.setTouchEnabled(true);\n\t\tformToolkit.adapt(tabFolder);\n\t\tformToolkit.paintBordersFor(tabFolder);\n\t\t\n\t\tTabItem tbtmNewItem = new TabItem(tabFolder, SWT.NONE);\n\t\ttbtmNewItem.setText(\"\\u65B0\\u5EFA\\u4E00\");\n\t\t\n\t\tTabItem tbtmNewItem_1 = new TabItem(tabFolder, SWT.NONE);\n\t\ttbtmNewItem_1.setText(\"\\u65B0\\u5EFA\\u4E8C\");\n\t\t\n\t\tTabItem tbtmNewItem_2 = new TabItem(tabFolder, SWT.NONE);\n\t\ttbtmNewItem_2.setText(\"\\u65B0\\u5EFA\\u4E09\");\n\t\t\n\t\tButton button = new Button(tabFolder, SWT.CHECK);\n\t\tbutton.setText(\"Check Button\");\n\t\t\n\t\tcomposite_3 = new Composite(sashForm_1, SWT.H_SCROLL | SWT.V_SCROLL);\n\t\t\n\t\tformToolkit.adapt(composite_3);\n\t\tformToolkit.paintBordersFor(composite_3);\n\t\tcomposite_3.setLayout(new FillLayout(SWT.HORIZONTAL));\n\t\t\n\t\tLabel lblNewLabel_3 = new Label(composite_3, SWT.NONE);\n\t\tformToolkit.adapt(lblNewLabel_3, true, true);\n\t\tlblNewLabel_3.setText(\"\");\n\t\tsashForm_1.setWeights(new int[] {19, 323});\n\t\t\n\t\tComposite composite_5 = new Composite(sashForm, SWT.NONE);\n\t\tcomposite_5.setToolTipText(\"\");\n\t\tcomposite_5.setLayout(new FillLayout(SWT.HORIZONTAL));\n\t\t\n\t\tSashForm sashForm_2 = new SashForm(composite_5, SWT.NONE);\n\t\tformToolkit.adapt(sashForm_2);\n\t\tformToolkit.paintBordersFor(sashForm_2);\n\t\t\n\t\tLabel lblNewLabel = new Label(sashForm_2, SWT.BORDER | SWT.CENTER);\n\t\tformToolkit.adapt(lblNewLabel, true, true);\n\t\tlblNewLabel.setText(\"1/1\");\n\t\t\n\t\tLabel lblNewLabel_2 = new Label(sashForm_2, SWT.BORDER | SWT.CENTER);\n\t\tformToolkit.adapt(lblNewLabel_2, true, true);\n\t\tlblNewLabel_2.setText(\"\\u5927\\u5C0F\\uFF1A1366*728\");\n\t\t\n\t\tLabel lblNewLabel_1 = new Label(sashForm_2, SWT.CENTER);\n\t\tformToolkit.adapt(lblNewLabel_1, true, true);\n\t\tlblNewLabel_1.setText(\"\\u7F29\\u653E\\uFF1A100%\");\n\t\t\n\t\tLabel label = new Label(sashForm_2, SWT.NONE);\n\t\tlabel.setAlignment(SWT.RIGHT);\n\t\tformToolkit.adapt(label, true, true);\n\t\tlabel.setText(\"\\u5494\\u5693\\u5DE5\\u4F5C\\u5BA4\\u7248\\u6743\\u6240\\u6709\");\n\t\tsashForm_2.setWeights(new int[] {127, 141, 161, 490});\n\t\tsashForm.setWeights(new int[] {50, 346, 22});\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tMenuItem mntmNewItem = new MenuItem(menu_1, SWT.NONE);\n\t\tmntmNewItem.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6587\\u4EF6\\u5B50\\u56FE\\u6807/\\u6587\\u4EF6.\\u65B0\\u5EFA.jpg\"));\n\t\tmntmNewItem.setText(\"\\u65B0\\u5EFA\");\n\t\t\n\t\tmntmNewItem_2 = new MenuItem(menu_1, SWT.NONE);\n\t\tmntmNewItem_2.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t\t//Label lblNewLabel_3 = new Label(composite_1, SWT.NONE);\n\t\t\t\t//Canvas c=new Canvas(shlFaststone,SWT.BALLOON);\n\t\t\t\t\n\t\t\t\tFileDialog dialog = new FileDialog(shlFaststone,SWT.OPEN); \n\t\t\t\tdialog.setFilterPath(System.getProperty(\"user_home\"));//设置初始路径\n\t\t\t\tdialog.setFilterNames(new String[] {\"文本文档(*txt)\",\"所有文档\"}); \n\t\t\t\tdialog.setFilterExtensions(new String[]{\"*.exe\",\"*.xls\",\"*.*\"});\n\t\t\t\tString path=dialog.open();\n\t\t\t\tString s=null;\n\t\t\t\tFile f=null;\n\t\t\t\tif(path==null||\"\".equals(path)) {\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\ttry{\n\t\t\t f=new File(path);\n\t\t\t\tbyte[] bs=Fileutil.readFile(f);\n\t\t\t s=new String(bs,\"UTF-8\");\n\t\t\t\t}catch (Exception e1) {\n\t\t\t\t\t// TODO: handle exception\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\tMessageDialog.openError(shlFaststone, \"出错了\", \"打开\"+path+\"出错了\");\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t \n\t\t\t\ttext = new Text(composite_4, SWT.BORDER | SWT.WRAP\n\t\t\t\t\t\t| SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL\n\t\t\t\t\t\t| SWT.MULTI);\n\t\t\t\ttext.setText(s);\n\t\t\t\tcomposite_1.layout();\n\t\t\t\tshlFaststone.setText(shlFaststone.getText()+\"\\t\"+f.getName());\n\t\t\t\t\t\n\t\t\t\tFile f1=new File(path);\n\t\t\t\tImageData imageData;\n\t\t\t\ttry {\n\t\t\t\t\timageData = new ImageData( new FileInputStream( f1));\n\t\t\t\t\tImage image=new Image(shlFaststone.getDisplay(),imageData);\n\t\t\t\t\tlblNewLabel_3.setImage(image);\n\t\t\t\t} catch (FileNotFoundException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t});\n\t\tmntmNewItem_2.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6587\\u4EF6\\u5B50\\u56FE\\u6807/\\u6587\\u4EF6.\\u6253\\u5F00.jpg\"));\n\t\tmntmNewItem_2.setText(\"\\u6253\\u5F00\");\n\t\t\n\t\tMenuItem mntmNewItem_1 = new MenuItem(menu_1, SWT.NONE);\n\t\tmntmNewItem_1.setText(\"\\u4ECE\\u526A\\u8D34\\u677F\\u5BFC\\u5165\");\n\t\t\n\t\tMenuItem mntmNewItem_3 = new MenuItem(menu_1, SWT.NONE);\n\t\tmntmNewItem_3.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6587\\u4EF6\\u5B50\\u56FE\\u6807/\\u6587\\u4EF6.\\u53E6\\u5B58\\u4E3A.jpg\"));\n\t\tmntmNewItem_3.setText(\"\\u53E6\\u5B58\\u4E3A\");\n\t\t\n\t\t mntmNewItem_5 = new MenuItem(menu_1, SWT.NONE);\n\t\tmntmNewItem_5.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t boolean result=MessageDialog.openConfirm(shlFaststone,\"退出\",\"是否确认退出\");\n\t\t\t\t if(result) {\n\t\t\t\t\t System.exit(0);\n\t\t\t\t }\n\n\t\t\t}\n\t\t});\n\t\tmntmNewItem_5.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6587\\u4EF6\\u5B50\\u56FE\\u6807/\\u6587\\u4EF6.\\u4FDD\\u5B58.jpg\"));\n\t\tmntmNewItem_5.setText(\"\\u5173\\u95ED\");\n\t\tevent2=new Event();\n\t\tevent2.widget=mntmNewItem_5;\n\n\t\t\n\t\tMenuItem mntmNewSubmenu = new MenuItem(menu, SWT.CASCADE);\n\t\tmntmNewSubmenu.setText(\"\\u6355\\u6349\");\n\t\t\n\t\tMenu menu_2 = new Menu(mntmNewSubmenu);\n\t\tmntmNewSubmenu.setMenu(menu_2);\n\t\t\n\t\tMenuItem mntmNewItem_6 = new MenuItem(menu_2, SWT.NONE);\n\t\tmntmNewItem_6.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6355\\u6349/\\u6355\\u6349\\u6D3B\\u52A8\\u7A97\\u53E3.jpg\"));\n\t\tmntmNewItem_6.setText(\"\\u6355\\u6349\\u6D3B\\u52A8\\u7A97\\u53E3\");\n\t\t\n\t\tMenuItem mntmNewItem_7 = new MenuItem(menu_2, SWT.NONE);\n\t\tmntmNewItem_7.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6355\\u6349/\\u6355\\u6349.\\u6355\\u6349\\u7A97\\u53E3\\u6216\\u5BF9\\u8C61.jpg\"));\n\t\tmntmNewItem_7.setText(\"\\u6355\\u6349\\u7A97\\u53E3\\u5BF9\\u8C61\");\n\t\t\n\t\tMenuItem mntmNewItem_8 = new MenuItem(menu_2, SWT.NONE);\n\t\tmntmNewItem_8.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6355\\u6349/\\u6355\\u6349.jpg\"));\n\t\tmntmNewItem_8.setText(\"\\u6355\\u6349\\u77E9\\u5F62\\u533A\\u57DF\");\n\t\t\n\t\tMenuItem mntmNewItem_9 = new MenuItem(menu_2, SWT.NONE);\n\t\tmntmNewItem_9.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6355\\u6349/\\u6355\\u6349.\\u624B\\u7ED8\\u533A\\u57DF.jpg\"));\n\t\tmntmNewItem_9.setText(\"\\u6355\\u6349\\u624B\\u7ED8\\u533A\\u57DF\");\n\t\t\n\t\tMenuItem mntmNewItem_10 = new MenuItem(menu_2, SWT.NONE);\n\t\tmntmNewItem_10.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6355\\u6349/\\u6355\\u6349.\\u6574\\u4E2A\\u5C4F\\u5E55.jpg\"));\n\t\tmntmNewItem_10.setText(\"\\u6355\\u6349\\u6574\\u4E2A\\u5C4F\\u5E55\");\n\t\t\n\t\tMenuItem mntmNewItem_11 = new MenuItem(menu_2, SWT.NONE);\n\t\tmntmNewItem_11.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6355\\u6349/\\u6355\\u6349\\u6EDA\\u52A8\\u7A97\\u53E3.jpg\"));\n\t\tmntmNewItem_11.setText(\"\\u6355\\u6349\\u6EDA\\u52A8\\u7A97\\u53E3\");\n\t\t\n\t\tMenuItem mntmNewItem_12 = new MenuItem(menu_2, SWT.NONE);\n\t\tmntmNewItem_12.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6355\\u6349/\\u6355\\u6349.\\u56FA\\u5B9A\\u5927\\u5C0F\\u533A\\u57DF.jpg\"));\n\t\tmntmNewItem_12.setText(\"\\u6355\\u6349\\u56FA\\u5B9A\\u5927\\u5C0F\\u533A\\u57DF\");\n\t\t\n\t\tMenuItem menuItem_1 = new MenuItem(menu_2, SWT.NONE);\n\t\tmenuItem_1.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6355\\u6349/\\u6355\\u6349.\\u91CD\\u590D\\u4E0A\\u6B21\\u6355\\u6349.jpg\"));\n\t\tmenuItem_1.setText(\"\\u91CD\\u590D\\u4E0A\\u6B21\\u6355\\u6349\");\n\t\t\n\t\tMenuItem menuItem_2 = new MenuItem(menu, SWT.CASCADE);\n\t\tmenuItem_2.setText(\"\\u7F16\\u8F91\");\n\t\t\n\t\tMenu menu_3 = new Menu(menuItem_2);\n\t\tmenuItem_2.setMenu(menu_3);\n\t\t\n\t\tMenuItem mntmNewItem_14 = new MenuItem(menu_3, SWT.NONE);\n\t\tmntmNewItem_14.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u5DE6\\u64A4\\u9500.jpg\"));\n\t\tmntmNewItem_14.setText(\"\\u64A4\\u9500\");\n\t\t\n\t\tMenuItem mntmNewItem_13 = new MenuItem(menu_3, SWT.NONE);\n\t\tmntmNewItem_13.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u53F3\\u64A4\\u9500.jpg\"));\n\t\tmntmNewItem_13.setText(\"\\u91CD\\u505A\");\n\t\t\n\t\tMenuItem mntmNewItem_15 = new MenuItem(menu_3, SWT.NONE);\n\t\tmntmNewItem_15.setText(\"\\u9009\\u62E9\\u5168\\u90E8\");\n\t\t\n\t\tMenuItem mntmNewItem_16 = new MenuItem(menu_3, SWT.NONE);\n\t\tmntmNewItem_16.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u7F16\\u8F91.\\u88C1\\u526A.jpg\"));\n\t\tmntmNewItem_16.setText(\"\\u88C1\\u526A\");\n\t\t\n\t\tMenuItem mntmNewItem_17 = new MenuItem(menu_3, SWT.NONE);\n\t\tmntmNewItem_17.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u526A\\u5207.jpg\"));\n\t\tmntmNewItem_17.setText(\"\\u526A\\u5207\");\n\t\t\n\t\tMenuItem mntmNewItem_18 = new MenuItem(menu_3, SWT.NONE);\n\t\tmntmNewItem_18.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u590D\\u5236.jpg\"));\n\t\tmntmNewItem_18.setText(\"\\u590D\\u5236\");\n\t\t\n\t\tMenuItem menuItem_4 = new MenuItem(menu_3, SWT.NONE);\n\t\tmenuItem_4.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u7C98\\u8D34.jpg\"));\n\t\tmenuItem_4.setText(\"\\u7C98\\u8D34\");\n\t\t\n\t\tMenuItem mntmNewItem_19 = new MenuItem(menu_3, SWT.NONE);\n\t\tmntmNewItem_19.setText(\"\\u5220\\u9664\");\n\t\t\n\t\tMenuItem menuItem_3 = new MenuItem(menu, SWT.CASCADE);\n\t\tmenuItem_3.setText(\"\\u7279\\u6548\");\n\t\t\n\t\tMenu menu_4 = new Menu(menuItem_3);\n\t\tmenuItem_3.setMenu(menu_4);\n\t\t\n\t\tMenuItem mntmNewItem_20 = new MenuItem(menu_4, SWT.NONE);\n\t\tmntmNewItem_20.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7279\\u6548.\\u6C34\\u5370.jpg\"));\n\t\tmntmNewItem_20.setText(\"\\u6C34\\u5370\");\n\t\t\n\t\tPanelPic ppn = new PanelPic();\n\t\tMenuItem mntmNewItem_21 = new MenuItem(menu_4, SWT.NONE);\n\t\tmntmNewItem_21.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tflag[0]=true;\n\t\t\t\tflag[1]=false;\n\n\t\t\t}\n\n\t\t});\n\t\t\n\t\tdown.addMouseListener(new MouseAdapter(){\n\t\t\tpublic void mouseDown(MouseEvent e)\n\t\t\t{\n\t\t\t\tmouseDown=true;\n\t\t\t\tpt=new Point(e.x,e.y);\n\t\t\t\tif(flag[1])\n\t\t\t\t{\n\t\t\t\t\trect=new Composite(down,SWT.BORDER);\n\t\t\t\t\trect.setLocation(e.x, e.y);\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpublic void mouseUp(MouseEvent e)\n\t\t\t{\n\t\t\t\tmouseDown=false;\n\t\t\t\tif(flag[1]&&dirty)\n\t\t\t\t{\n\t\t\t\t\trexx[n-1]=rect.getBounds();\n\t\t\t\t\trect.dispose();\n\t\t\t\t\tdown.redraw();\n\t\t\t\t\tdirty=false;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tdown.addMouseMoveListener(new MouseMoveListener(){\n\t\t\t@Override\n\t\t\tpublic void mouseMove(MouseEvent e) {\n if(mouseDown)\n {\n \t dirty=true;\n\t\t\t\tif(flag[0])\n\t\t\t {\n \t GC gc=new GC(down);\n gc.drawLine(pt.x, pt.y, e.x, e.y);\n list.add(new int[]{pt.x,pt.y,e.x,e.y});\n pt.x=e.x;pt.y=e.y;\n\t\t\t }\n else if(flag[1])\n {\n \t if(rect!=null)\n \t rect.setSize(rect.getSize().x+e.x-pt.x, rect.getSize().y+e.y-pt.y);\n// \t down.redraw();\n \t pt.x=e.x;pt.y=e.y;\n }\n }\n\t\t\t}\n\t\t\t\n\t\t});\n\t\tdown.addPaintListener(new PaintListener(){\n\t\t\t@Override\n\t\t\tpublic void paintControl(PaintEvent e) {\n\t\t\t\tfor(int i=0;i<list.size();i++)\n\t\t\t\t{\n\t\t\t\t\tint a[]=list.get(i);\n\t\t\t\t\te.gc.drawLine(a[0], a[1], a[2], a[3]);\n\t\t\t\t}\n\t\t\t\tfor(int i=0;i<n;i++)\n\t\t\t\t{\n\t\t\t\t\tif(rexx[i]!=null)\n\t\t\t\t\t\te.gc.drawRectangle(rexx[i]);\n\t\t\t\t}\n\t\t\t}});\n\n\t\t\n\t\tmntmNewItem_21.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7279\\u6548.\\u6587\\u5B57.jpg\"));\n\t\tmntmNewItem_21.setText(\"\\u753B\\u7B14\");\n\t\t\n\t\tMenuItem mntmNewSubmenu_1 = new MenuItem(menu, SWT.CASCADE);\n\t\tmntmNewSubmenu_1.setText(\"\\u67E5\\u770B\");\n\t\t\n\t\tMenu menu_5 = new Menu(mntmNewSubmenu_1);\n\t\tmntmNewSubmenu_1.setMenu(menu_5);\n\t\t\n\t\tMenuItem mntmNewItem_24 = new MenuItem(menu_5, SWT.NONE);\n\t\tmntmNewItem_24.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u67E5\\u770B.\\u653E\\u5927.jpg\"));\n\t\tmntmNewItem_24.setText(\"\\u653E\\u5927\");\n\t\t\n\t\tMenuItem mntmNewItem_25 = new MenuItem(menu_5, SWT.NONE);\n\t\tmntmNewItem_25.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u67E5\\u770B.\\u7F29\\u5C0F.jpg\"));\n\t\tmntmNewItem_25.setText(\"\\u7F29\\u5C0F\");\n\t\t\n\t\tMenuItem mntmNewItem_26 = new MenuItem(menu_5, SWT.NONE);\n\t\tmntmNewItem_26.setText(\"\\u5B9E\\u9645\\u5C3A\\u5BF8\\uFF08100%\\uFF09\");\n\t\t\n\t\tMenuItem mntmNewItem_27 = new MenuItem(menu_5, SWT.NONE);\n\t\tmntmNewItem_27.setText(\"\\u9002\\u5408\\u7A97\\u53E3\");\n\t\t\n\t\tMenuItem mntmNewItem_28 = new MenuItem(menu_5, SWT.NONE);\n\t\tmntmNewItem_28.setText(\"100%\");\n\t\t\n\t\tMenuItem mntmNewItem_29 = new MenuItem(menu_5, SWT.NONE);\n\t\tmntmNewItem_29.setText(\"200%\");\n\t\t\n\t\tMenuItem mntmNewSubmenu_2 = new MenuItem(menu, SWT.CASCADE);\n\t\tmntmNewSubmenu_2.setText(\"\\u8BBE\\u7F6E\");\n\t\t\n\t\tMenu menu_6 = new Menu(mntmNewSubmenu_2);\n\t\tmntmNewSubmenu_2.setMenu(menu_6);\n\t\t\n\t\tMenuItem menuItem_5 = new MenuItem(menu, SWT.CASCADE);\n\t\tmenuItem_5.setText(\"\\u5E2E\\u52A9\");\n\t\t\n\t\tMenu menu_7 = new Menu(menuItem_5);\n\t\tmenuItem_5.setMenu(menu_7);\n\t\t\n\t\tMenuItem menuItem_6 = new MenuItem(menu_7, SWT.NONE);\n\t\tmenuItem_6.setText(\"\\u7248\\u672C\");\n\t\t\n\t\tMenuItem mntmNewItem_23 = new MenuItem(menu, SWT.NONE);\n\t\tmntmNewItem_23.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u5DE6\\u64A4\\u9500.jpg\"));\n\t\t\n\t\tMenuItem mntmNewItem_30 = new MenuItem(menu, SWT.NONE);\n\t\tmntmNewItem_30.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u53F3\\u64A4\\u9500.jpg\"));\n\n\t}", "@Override\n\tpublic void create() {\n\t\tAssets.load();\n\t\t\n\t\t//creo pantallas y cargo por defecto menuPrincipal\n\t\tscreenJuego = new JuegoScreen(this);\n\t\tmenuPrincipal = new MenuPrincipal(this);\n\t\tsetScreen(menuPrincipal);\n\t}", "static private Screen createScreen() {\n Screen test = new Screen();\n //These values below, don't change\n test.addWindow(1,1,64, 12);\n test.addWindow(66,1,64,12);\n test.addWindow(1,14,129,12);\n test.setWidthAndHeight();\n test.makeBoarders();\n test.setWindowsType();\n test.draw();\n return test;\n }", "public Shelf() {\r\n\t\tsuper();\r\n\t}", "@Override\r\n\tpublic void start(Stage s) throws Exception {\n\t\tc=new Container();\r\n\t\tthis.st=s;\r\n\t\tc.setFs(new FirstScreen(st,c));\r\n\t\tthis.sc=new Scene(c.getFs(), 800,600);\r\n\t\tst.setScene(sc);\r\n\t\tst.setTitle(\"Main Window\");\r\n\t\tst.show();\r\n\t}", "public sosGame() {\n initComponents();\n }", "public void create () \n\t{ \n\t\t// Set Libgdx log level to DEBUG\n\t\tGdx.app.setLogLevel(Application.LOG_DEBUG);\n\t\t// Load assets\n\t\tAssets.instance.init(new AssetManager());\n\t\tpaused = false;\n\t\t// Load preferences for audio settings and start playing music\n\t\tGamePreferences.instance.load();\n\t\tAudioManager.instance.play(Assets.instance.music.song01);\n\t\t// Start game at menu screen\n\t\tsetScreen(new MenuScreen(this));\n\t\t\n\t}", "@Override\n\tSauce createSauce() {\n\t\treturn new NYSauce();\n\t}", "@RequiresApi(api = Build.VERSION_CODES.N)\n public SHUBOPresenter(MainActivity context) {\n this.mMainActivity = context;\n model = new SHUBUModel(this);\n }", "public CreateHero() {\r\n\t\tinitComponents();\r\n\t}", "public Home() {\n initComponents();\n ShowLauncher();\n }", "public SineChromosoneFactory(Landscape l, int shells){\n\tthis.l = l;\n\tthis.shells = shells;\n\tbuild_polar_coordinates();\n }", "@Override\n public void create() {\n\n batch = new SpriteBatch();\n manager = new AssetManager();\n\n manager.load(\"audio/main_theme.mp3\", Music.class);\n // manager.load(\"String sonido\", Sound.class);\n manager.load(\"sprites/dragon.pack\", TextureAtlas.class);\n manager.load(\"sprites/vanyr.pack\", TextureAtlas.class);\n manager.finishLoading();\n\n setScreen(new PlayScreen(this));\n\n }", "public Shelf(String name) {\r\n\t\tsuper();\r\n\t\tthis.name = name;\r\n\t}", "@Override\n\tpublic Item create() {\n\t\tLOGGER.info(\"Shoe Name\");\n\t\tString item_name = util.getString();\n\t\tLOGGER.info(\"Shoe Size\");\n\t\tdouble size = util.getDouble();\n\t\tLOGGER.info(\"Set Price\");\n\t\tdouble price = util.getDouble();\n\t\tLOGGER.info(\"Number in Stock\");\n\t\tlong stock = util.getLong();\n\t\tItem newItem = itemDAO.create(new Item(item_name, size, price, stock));\n\t\tLOGGER.info(\"\\n\");\n\t\treturn newItem;\n\t}", "public Builder clearShoes() {\n bitField0_ = (bitField0_ & ~0x00000040);\n shoes_ = 0;\n onChanged();\n return this;\n }", "Strobo createStrobo();", "public Shot() {\n }", "Simple createSimple();", "private void makeBoss()\r\n {\r\n maxHealth = 1000;\r\n health = maxHealth;\r\n \r\n weapon = new Equip(\"Claws of Death\", Equip.WEAPON, 550);\r\n armor = new Equip(\"Inpenetrable skin\", Equip.ARMOR, 200);\r\n }", "public static void create() {\r\n render();\r\n }", "public StockApp()\n {\n reader = new InputReader();\n manager = new StockManager();\n menuSetup();\n }", "private static void createAndShowGUI()\n {\n Sudoku s = new Sudoku();\n }", "Hero createHero();", "abstract public Hamburger creatHamburger(String type);", "@Override\n public void create()\n {\n Gdx.app.setLogLevel(Application.LOG_DEBUG);\n \n // Load assets\n Assets.instance.init(new AssetManager());\n \n // Load preferences for audio settings, and start playing music\n GamePreferences.instance.load();\n AudioManager.instance.play(Assets.instance.music.song01);\n \n // Start game at menu screen\n setScreen(new MenuScreen(this));\n }", "@Override\n\tpublic void create() {\n\t\t// This should come from the platform\n\t\theight = platform.getScreenDimension().getHeight();\n\t\twidth = platform.getScreenDimension().getWidth();\n\n\t\t// create the drawing boards\n\t\tsb = new SpriteBatch();\n\t\tsr = new ShapeRenderer();\n\n\t\t// Push in first state\n\t\tgsm.push(new CountDownState(gsm));\n//\t\tgsm.push(new PlayState(gsm));\n\t}", "Instance createInstance();", "public ScahaManager (Profile _pro) {\r\n\t\t\r\n\t\t//\r\n\t\t// Here we are starting with basically an empty shell of an object..\r\n\t\t// all id's are zero\r\n\t\t//\r\n\t\tsuper(-1, _pro);\r\n\t\tID = -1;\r\n\t}", "public void createScene();", "public NewJFrame1() {\n initComponents();\n\n dip();\n sh();\n }", "public Game(){\n\t\tDimension size = new Dimension(width * scale, height * scale);\n\t\tsetPreferredSize(size);\n\t\t\n\t\tscreen = new Screen(width, height);//instantiated the new screen\n\t\t\n\t\tframe = new JFrame();\n\t\t\n\t}", "public WorldScene makeScene() {\n // WorldCanvas c = new WorldCanvas(300, 300);\n WorldScene s = new WorldScene(this.width, this.height);\n s.placeImageXY(newImg, this.width / 2, this.height / 2);\n return s;\n }", "private Shell() { }", "Stimulus createStimulus();", "public Stage1()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1200, 900, 1);\n \n GreenfootImage image = getBackground();\n image.setColor(Color.BLACK);\n image.fill();\n star();\n \n \n \n //TurretBase turretBase = new TurretBase();\n playerShip = new PlayerShip();\n scoreDisplay = new ScoreDisplay();\n addObject(scoreDisplay, 100, 50);\n addObject(playerShip, 100, 450);\n \n }", "public Shout createShout(String type, String msg) {\n\t\tShout shout = new Shout();\n\t\tshout.type = type;\n\t\tshout.msg = msg;\n\n\t\tupdateSystemInfo(shout);\n\t\treturn shout;\n\t}", "public StockDemo(StockManager manager)\n {\n this.manager = manager;\n \n manager.addProduct(new Product(101, \"Television\"));\n manager.addProduct(new Product(102, \"Android phone\"));\n manager.addProduct(new Product(103, \"Washing machine\"));\n manager.addProduct(new Product(104, \"LED\"));\n manager.addProduct(new Product(105, \"Toshiba Laptop\"));\n manager.addProduct(new Product(106, \"Belkin Router\"));\n manager.addProduct(new Product(107, \"Wi-fi Extender\"));\n manager.addProduct(new Product(108, \"Freezer\"));\n manager.addProduct(new Product(109, \"Microwave\"));\n manager.addProduct(new Product(110, \"Toaster\"));\n }", "@Override\n public void create() {\n setScreen(new ServerScreen(\n new RemoteGame(),\n new SocketIoGameServer(HOST, PORT)\n ));\n }", "public sword ( )\r\n\t{\r\n\t\t// TODO Auto-generated constructor stub\r\n\t\tsuper();\r\n\t\tthis.setDamageBuff (3);\r\n\t\tthis.setDurability (15);\r\n\t\tthis.setWeaponName (\"Sword\");\r\n\t}", "private Hero createHeroObject(){\n return new Hero(\"ImageName\",\"SpiderMan\",\"Andrew Garfield\",\"6 feet 30 inches\",\"70 kg\",\n \"Webs & Strings\",\"Fast thinker\",\"Webs & Flexible\",\n \"200 km/hour\",\"Very fast\",\"Spiderman - Super Hero saves the world\",\n \"SuperHero saves the city from all the villians\");\n }", "@Override\n\tpublic void create() {\n\t\tthis.playScreen = new PlayScreen<EntityUnknownGame>(this);\n\t\tsetScreen(this.playScreen);\n\t\t\n\t\t//this.shadowMapTest = new ShadowMappingTest<EntityUnknownGame>(this);\n\t\t//setScreen(this.shadowMapTest);\n\t\t\n\t\t//this.StillModelTest = new StillModelTest<EntityUnknownGame>(this);\n\t\t//setScreen(this.StillModelTest);\n\t\t\n//\t\tthis.keyframedModelTest = new KeyframedModelTest<EntityUnknownGame>(this);\n//\t\tsetScreen(this.keyframedModelTest);\n\t}", "@Override\r\n\tpublic void create() {\n\t\tbatch = new SpriteBatch();\r\n\t\tcamera = new OrthographicCamera();\r\n\t\tassets = new AssetManager();\r\n\t\t\r\n\t\tcamera.setToOrtho(false,WIDTH,HEIGHT);\r\n\t\t\r\n\t\tTexture.setAssetManager(assets);\r\n\t\tTexture.setEnforcePotImages(false);\r\n\t\t\r\n\t\tsetScreen(new SplashScreen(this));\r\n\t}", "protected void createContents() {\r\n\t\tshell = new Shell();\r\n\t\tshell.setSize(450, 300);\r\n\t\tshell.setText(\"SWT Application\");\r\n\r\n\t}", "public Os() {\n osBO = new OsBO();\n }", "@Override\r\n public void create() {\n\r\n Gdx.app.log(TAG, \"version : \" + Version.VERSION);\r\n\r\n chscreenMap = new HashMap<String, CHScreen>();\r\n musicManager = new MusicManager();\r\n soundManager = new SoundManager();\r\n\r\n assetManager = new AssetManager();\r\n\r\n chAsyncManager = new CHAsyncManager();\r\n\r\n // 代表返回,菜单事件,会被Gdx拦截掉,不会下发到Android处理了。\r\n Gdx.input.setCatchBackKey(true);\r\n Gdx.input.setCatchMenuKey(true);\r\n\r\n instance = this;\r\n\r\n init();\r\n\r\n }", "public SinglePlayerGameController() {\n player1 = new Player(\"Player 1\");\n computer = new Player(\"Computer\");\n game = new Game(new Dice(), player1, computer);\n player1.setColor(\"blue\");\n computer.setColor(\"red\");\n diceImage = new DiceImage();\n }", "public static Add_simple_dish newInstance(String param1, String param2) {\n Add_simple_dish fragment = new Add_simple_dish();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public salida()\r\n { \r\n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\r\n super(600, 400, 1); \r\n }", "public ObjectFactoryMenu() {\n }", "public SKIN_SPECIALIST() {\n initComponents();\n }", "public void salesScreen()\n {\n onSales = true;\n salesItem = new SalesItem[50];\n Button timbitAdd = new Button(24, \"button-blue.png\", \"button-green.png\", \"Add timbit:\");\n Button doughnutAdd = new Button(24, \"button-blue.png\", \"button-green.png\", \"Add doughnut:\");\n Button coffeeAdd = new Button(24, \"button-blue.png\", \"button-green.png\", \"Add coffee:\");\n \n addObject(timbitAdd, 400, 100);\n addObject(doughnutAdd, 400, 200);\n addObject(coffeeAdd, 400, 300);\n }", "Component createComponent();", "Component createComponent();", "public static void main(String... args) {\n Singletone singletone = Singletone.getInstance();\n try {\n // create obj for Singletone by Accessing private Constructor of\n Class clazz = Class.forName(\"com.krushidj.singletone.Singletone\");\n // get All consturctors of the class\n Constructor[] cons = clazz.getDeclaredConstructors();\n // provide access to private constructor\n cons[0].setAccessible(true);\n Field f = (Singletone.class).getDeclaredField(\"isInstantiated\");\n f.setAccessible(true);\n f.set(true, false);\n // creating obj using the Accessed constructor\n Singletone singletone1 = (Singletone) cons[0].newInstance(null);\n System.out.println(\"singletone hashCode:::\" + singletone.hashCode());\n System.out.println(\"singletone1 hashCode:::\" + singletone1.hashCode());\n } // try\n catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "private void createAndShowGUI (){\n\n JustawieniaPowitalne = new JUstawieniaPowitalne();\n }", "public BlasticFantastic()\r\n {\r\n super(\"BlasticFantastic 0.1\");\r\n AppGameContainer app;\r\n\t\ttry {\r\n\t\t\tapp = new AppGameContainer(this);\r\n\t\t\tapp.setDisplayMode(1024, 600, false);\r\n\t\t\tapp.setVSync(true);\r\n\t\t\tapp.start();\r\n\t\t} catch (SlickException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n \r\n }", "public static PharmacyShop newInstance(String param1, String param2) {\n PharmacyShop fragment = new PharmacyShop();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public SMPFXController() {\n\n }", "PlayerBean create(String name);", "public Ship newShip(GameScreen screen){\n\t\tthis.ship = new Ship(screen);\n\t\treturn ship;\n\t}", "public SPOR() {\n initComponents();\n }", "public RubyObject createObject() {\n\t\treturn (RubyObject) RGSSProjectHelper.getInterpreter(project).runScriptlet(\"return RPG::Troop::Page.new\");\n\t}", "@Override\n public void create() { //Called when the application is\n Gdx.app.setLogLevel(LOG_NONE); // Sets level of logs to display. LOG_DEBUG when programming. LOG_NONE to mute all.\n Gdx.app.debug(\"Game DEBUG\",\"Initialising Application\");\n MenuScreen menuScreen = new MenuScreen(this);\n this.setScreen(menuScreen);\n\n }", "private StickFactory() {\n\t}", "public soal2GUI() {\n initComponents();\n }", "public ElectricShower() {\r\n\t\tthis(12, 0, 4);\r\n\t}", "private void createUIComponents() {\n bt1 = new JButton(\"Hola\");\n }", "public GraphicsFactory() {\n\t\tsuper();\n\t}", "public static void main(String args[])\n{\n f=new steg();\n\t f.setSize(800,800);\n\t f.setTitle(\"STEGANOGRAPHY \");\n f.show();\n }", "public MainMenuScreen(Game game)\n {\n super(game);\n\n batcher = new SpriteBatcher(glGraphics, 100);\n guiCam = new Camera2D(glGraphics, 1920, 1080);\n\n openIntent = new Intent(ScreenManager.game.getPackageName()+\".ACTION2\");\n }", "public ShopGraphics(MainMenu program) {\r\n\t\tsuper();\r\n\t\tthis.program = program;\r\n\t\tinitializeObjects();\r\n\t}", "H1 createH1();", "public Sandwich()\n\t{super();\n \n\t\t\n\t}", "public Socio() {\n setUndecorated(true);\n initComponents();\n }", "public void create(){}", "SandBox createSandBox(Site site, String sandBoxName, SandBoxType sandBoxType) throws Exception;", "public PanelSgamacView1()\n {\n }", "public Game2(Starter starter){\r\n chromaticManager = starter.chromaticManager;\r\n this.starter=starter;\r\n }", "public ShotEngine(StartSettings ss, Polygon[] p)\n\t{\n\t\tssp = new SpatialPartition(0, 0, ss.getMapWidth(), ss.getMapHeight(), 20, 60, 100);\n\t\tpsp = new SpatialPartition(0, 0, ss.getMapWidth(), ss.getMapHeight(), 10, 20, 100);\n\t\tfor(int i = 0; i < p.length; i++)\n\t\t{\n\t\t\tpsp.addRegion(p[i]);\n\t\t}\n\t}", "public TitleScreen(MenuHandler menuHandler)\n\t{\n\t\tsuper();\n\t\tsetName(\"TitleScreen\");\n\t\tmenuEntities = new ArrayList<MenuEntity>();\n\t\tMenuEntity gameStarter = new GameStarter(440,522,120,42,\"\",\"Load/Characters/CharacterFile.txt\",menuHandler);\n\t\tgameStarter.setFont(new Font(\"Arial\",Font.PLAIN,18));\n\t\tgameStarter.setColor(Color.BLACK);\n\t\tmenuEntities.add(gameStarter);\n\t\tsetMenuEntities(menuEntities);\n\t}", "public ShoeInventory(int size)\r\n\t{\r\n\t\tif(size == 0)\r\n\t\t\tSystem.out.println(\"Cannot set array to size 0.\"); \r\n\t\telse\r\n\t\t{\r\n\t\t\tcounter = 0;\r\n\t\t\tarraySize = size;\r\n\t\t\ttypeArray = new ShoeType[arraySize];\r\n\t\t}\r\n\t}", "Make createMake();", "public Equipos() {\n\t\tthis(\"equipos\", null);\n\t}", "public static EDHGameSetup newInstance(String param1, String param2) {\n EDHGameSetup fragment = new EDHGameSetup();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public Equipas() {\r\n\t\t\r\n\t}", "public void create() {\n\t\t// TODO Auto-generated method stub\n\t\tskin = new Skin(Gdx.files.internal(\"uiskin.json\"));\n\t\tstage = new Stage();\n\t\tfinal TextButton playButton = new TextButton(\"Play\", skin, \"default\"); // Creates button with label \"play\"\n\t\tfinal TextButton leaderboardButton = new TextButton(\"Leaderboards\", skin, \"default\"); // Creates button with\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// label \"leaderboards\"\n\t\tfinal TextButton optionsButton = new TextButton(\"Options\", skin, \"default\"); // Creates button with label\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \"options\"\n\t\tfinal TextButton userInfoButton = new TextButton(\"User Info\", skin, \"default\");// Creates button with label\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \"User Info\"\n\t\tfinal TextButton quitGameButton = new TextButton(\"Exit Game\", skin, \"default\");\n\n\t\t// Three lines below this set the widths of buttons using the constant widths\n\t\tplayButton.setWidth(Gdx.graphics.getWidth() / 3);\n\t\tleaderboardButton.setWidth(playButton.getWidth());\n\t\toptionsButton.setWidth(playButton.getWidth());\n\t\tuserInfoButton.setWidth(playButton.getWidth());\n\t\tquitGameButton.setWidth(playButton.getWidth());\n\n\t\t// Set the heights using constant height\n\t\tplayButton.setHeight(Gdx.graphics.getHeight() / 15);\n\t\tleaderboardButton.setHeight(playButton.getHeight());\n\t\toptionsButton.setHeight(playButton.getHeight());\n\t\tuserInfoButton.setHeight(playButton.getHeight());\n\t\tquitGameButton.setHeight(playButton.getHeight());\n\n\t\t// Sets positions for buttons\n\t\tplayButton.setPosition(Gdx.graphics.getWidth() / 20, Gdx.graphics.getHeight() / 3);\n\t\tleaderboardButton.setPosition(playButton.getX(), playButton.getY() - leaderboardButton.getHeight());\n\t\toptionsButton.setPosition(playButton.getX(), leaderboardButton.getY() - optionsButton.getHeight());\n\t\tuserInfoButton.setPosition(playButton.getX(), optionsButton.getY() - userInfoButton.getHeight());\n\t\tquitGameButton.setPosition(playButton.getX(), userInfoButton.getY() - quitGameButton.getHeight());\n\n\t\t// User Info Name and sign in/ sign out button at the top of the screen\n\t\tfinal Label userInfoLabel = new Label(\"HI GUYS: \" + Constants.user, skin, \"default\");\n\t\tfinal TextButton userSignButton = new TextButton(\"singin/out\", skin, \"default\");\n\t\tuserSignButton.setHeight(Gdx.graphics.getHeight() / 40);\n\t\tuserSignButton.setPosition(Gdx.graphics.getWidth() - userSignButton.getWidth(),\n\t\t\t\tGdx.graphics.getHeight() - userSignButton.getHeight());\n\t\tif (Constants.userID == 0)\n\t\t\tuserSignButton.setText(\"Sign In\");\n\t\telse\n\t\t\tuserSignButton.setText(\"Sign Out\");\n\t\tuserSignButton.addListener(new ClickListener() { // When Sign in/Sing out is pressed in the top right\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tif (Constants.userID == 0) { // If no one is signed in\n\t\t\t\t\tdispose();\n\t\t\t\t\tgame.setScreen(new UserInfoScreen(game));\n\t\t\t\t} else { // If a user is currently signed in\n\t\t\t\t\tConstants.userID = 0;\n\t\t\t\t\tConstants.user = \"Temporary User\";\n\t\t\t\t\tcreate();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tuserInfoLabel.setHeight(userSignButton.getHeight());\n\t\tuserInfoLabel.setPosition(Gdx.graphics.getWidth() - userInfoLabel.getWidth() - userSignButton.getWidth(),\n\t\t\t\tGdx.graphics.getHeight() - userInfoLabel.getHeight());\n\t\tstage.addActor(userInfoLabel);\n\t\tstage.addActor(userSignButton);\n\n\t\tplayButton.addListener(new ClickListener() { // This tells button what to do when clicked\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tdispose();\n\t\t\t\tgame.setScreen(new LobbyScreen(game)); // Switch over to lobby screen\n\t\t\t}\n\t\t});\n\n\t\tleaderboardButton.addListener(new ClickListener() {\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tdispose();\n\t\t\t\tgame.setScreen(new LeaderboardScreen(game)); // Switch over to leaderboard screen\n\t\t\t}\n\t\t});\n\n\t\toptionsButton.addListener(new ClickListener() {\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\t// Do some stuff when clicked\n\t\t\t\tdispose();\n\t\t\t\tgame.setScreen(new OptionsScreen(game));\n\n\t\t\t}\n\t\t});\n\n\t\tuserInfoButton.addListener(new ClickListener() {\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tdispose();\n\t\t\t\tgame.setScreen(new UserInfoScreen(game));\n\n\t\t\t}\n\t\t});\n\n\t\tquitGameButton.addListener(new ClickListener() {\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tdispose();\n\t\t\t\tGdx.app.exit();\n\t\t\t}\n\t\t});\n\n\t\t// Adds all buttons to stage to be rendered\n\t\tstage.addActor(playButton);\n\t\tstage.addActor(leaderboardButton);\n\t\tstage.addActor(optionsButton);\n\t\tstage.addActor(userInfoButton);\n\t\tstage.addActor(quitGameButton);\n\n\t\tGdx.input.setInputProcessor(stage);\n\t}", "public TShirtWithLogo(double x, double y, double width,\n\t double heightOfSleeves, double sleeveHeight, double sleeveLength)\n {\n\t// construct the basic house shell\n\tsuper(x,y,width,heightOfSleeves, sleeveHeight, sleeveLength);\n\t\n\t// get the GeneralPath that we are going to append stuff to\n\tGeneralPath gp = this.get();\n\n\tEllipse2D.Double e1 = new Ellipse2D.Double(x,\n y, width, (heightOfSleeves+sleeveHeight)); \n\t \n\tEllipse2D.Double e2 = new Ellipse2D.Double(x,\n y, width/1.5, (heightOfSleeves+sleeveHeight)/1.5); \n\t \n\tEllipse2D.Double e3 = new Ellipse2D.Double(x,\n y, width/3, (heightOfSleeves+sleeveHeight)/3); \n\t\t\n // GeneralPath wholeShirt = this.get();\n gp.append(e1, false);\n gp.append(e2, false);\n\tgp.append(e3, false);\n }", "public DemoPluginFactory() {}", "public BasicSpecies() {\r\n\r\n\t}", "public Window(){\n\n screen = new Screen();\n add(screen);\n\n setSize(800,800);\n\n setTitle(\"Java Worm v0.1\");\n System.out.println(\"Java Worm v0.1\");\n\n setVisible(true);\n }" ]
[ "0.63881224", "0.6093631", "0.5865987", "0.5781937", "0.5758739", "0.5715601", "0.566431", "0.5658865", "0.5637096", "0.5635976", "0.5613923", "0.55561376", "0.55540943", "0.5502848", "0.5495485", "0.5494501", "0.5465456", "0.5439522", "0.54329926", "0.5423003", "0.5417282", "0.54167217", "0.5414921", "0.54109454", "0.539211", "0.53643566", "0.5355104", "0.5353671", "0.53457016", "0.5317102", "0.5305168", "0.5285831", "0.52789223", "0.52763253", "0.52736855", "0.5263163", "0.5247096", "0.52459794", "0.52388096", "0.52334625", "0.5233291", "0.5229935", "0.52172124", "0.5208797", "0.5196773", "0.51800305", "0.51777333", "0.5174715", "0.51723343", "0.5171777", "0.51672566", "0.51626426", "0.5156878", "0.5147717", "0.51474786", "0.514062", "0.51355326", "0.513137", "0.5130701", "0.5127623", "0.51242226", "0.51202154", "0.51201653", "0.51201653", "0.5118245", "0.51095855", "0.51095164", "0.51065034", "0.51039827", "0.5096633", "0.50908136", "0.50825197", "0.5065069", "0.50606203", "0.50582445", "0.5056829", "0.505639", "0.5048609", "0.50460047", "0.50444174", "0.5044326", "0.50441796", "0.5041619", "0.5037183", "0.5029886", "0.50281495", "0.5027187", "0.5023587", "0.50223166", "0.50217736", "0.50192463", "0.5016106", "0.5010847", "0.5009939", "0.5002717", "0.5001699", "0.500084", "0.4997439", "0.49972785", "0.49945247", "0.49902028" ]
0.0
-1
Sends this game room data to the sender.
private void reportData() { getSender().tell(new GameRoomDataMessage(gameRoomName, capacity, players), this.getSelf()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void send() {\n try {\n String message = _gson.toJson(this);\n byte[] bytes = message.getBytes(\"UTF-8\");\n int length = bytes.length;\n\n _out.writeInt(length);\n _out.write(bytes);\n \n } catch (IOException ex) {\n Logger.getLogger(ResponseMessage.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public ChatRoomDataPacket(M data, IChatUser sender) {\n\t\tsuper(data, sender);\n\t}", "public void sendPlayerData() throws JSONException {\n\t\tJSONObject json = new JSONObject();\n\t\tJSONObject json2 = new JSONObject();\n\t\tjson2.put(\"Name\", playerModel.getPlayerName());\n\n\t\tswitch (playerModel.getPlayerColor()) {\n\n\t\tcase PL_BLUE:\n\t\t\tjson2.put(\"Farbe\", \"Blau\");\n\t\t\tbreak;\n\t\tcase PL_RED:\n\t\t\tjson2.put(\"Farbe\", \"Rot\");\n\t\t\tbreak;\n\t\tcase PL_WHITE:\n\t\t\tjson2.put(\"Farbe\", \"Weiß\");\n\t\t\tbreak;\n\t\tcase PL_YELLOW:\n\t\t\tjson2.put(\"Farbe\", \"Orange\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\n\t\t}\n\t\tjson.put(\"Spieler\", json2);\n\t\tlog.info(playerModel + \" verschickt\");\n\t\tcontroller.getClient().send(json);\n\t}", "@Override\r\n\tpublic void activity(Direction direction, DatagramSocket sendSocket) {\r\n\t\tSystem.out.println(\"Elevator \" + elevator.getId() + \": Moving \" + direction.toString().toLowerCase() + \" from floor \" + this.elevator.getElevatorLocation());\r\n\t\ttry {\r\n\t\t\tThread.sleep(this.timeBetweenFloors);\r\n\t\t} catch (InterruptedException e) {}\r\n\t\tif(direction == Direction.UP) {\r\n\t\t\tthis.elevator.setElevatorLocation(this.elevator.getElevatorLocation()+1);\r\n\t\t\tByteArrayOutputStream stream = new ByteArrayOutputStream();\r\n\t\t\tObjectOutputStream oStream;\r\n\t\t\ttry {\r\n\t\t\t\toStream = new ObjectOutputStream(stream);\r\n\t\t\t\toStream.writeObject(new ElevatorInfo(this.elevator.getId(), this.elevator.getElevatorLocation(),direction.toString(),this.elevator.getErrorCode(),this.elevator.getLamp()));\r\n\t\t\t\tstream.close();\r\n\t\t\t\toStream.close();\r\n\t\t\t}catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tbyte[] message = stream.toByteArray();\r\n\t\t\tDatagramPacket sendPacket = new DatagramPacket(message, message.length,this.elevator.getGuiIp(),this.elevator.getGuiPort());\r\n\t\t\ttry {\r\n\t\t\t\tsendSocket.send(sendPacket);\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(direction == Direction.DOWN) {\r\n\t\t\tthis.elevator.setElevatorLocation(this.elevator.getElevatorLocation()-1);\r\n\t\t\tByteArrayOutputStream stream = new ByteArrayOutputStream();\r\n\t\t\tObjectOutputStream oStream;\r\n\t\t\ttry {\r\n\t\t\t\toStream = new ObjectOutputStream(stream);\r\n\t\t\t\toStream.writeObject(new ElevatorInfo(this.elevator.getId(), this.elevator.getElevatorLocation(),direction.toString(),this.elevator.getErrorCode(),this.elevator.getLamp()));\r\n\t\t\t\tstream.close();\r\n\t\t\t\toStream.close();\r\n\t\t\t}catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tbyte[] message = stream.toByteArray();\r\n\t\t\tDatagramPacket sendPacket = new DatagramPacket(message, message.length,this.elevator.getGuiIp(),this.elevator.getGuiPort());\r\n\t\t\ttry {\r\n\t\t\t\tsendSocket.send(sendPacket);\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void sendMessage(String content, String room) {\n }", "public void sendGameInfoToAll(){\r\n\t\t\r\n\t\tVector<Player> players = lobby.getLobbyPlayers();\t\r\n\t\tString message = \"UDGM\" + lobby.getGameString();\r\n\t\t\r\n\t\tif(!players.isEmpty()){\r\n\t \tfor(int i=0; i<players.size(); i++){\t \t\t\r\n\t \t\tsendOnePlayer(players.get(i), message);\t \t\t\r\n\t \t}\r\n\t\t}\r\n\t}", "public void send(Object message) {\n try {\n if (message.equals(startTurnMessage)) {\n myTurn = true;\n }\n else if (message.equals(endTurnMessage)) {\n myTurn = false;\n }\n else {\n socketOut.reset();\n socketOut.writeObject(message);\n socketOut.flush();\n }\n } catch (IOException | NullPointerException e) {\n e.printStackTrace();\n }\n }", "public void sendData() {\r\n\t\t// HoverBot specific implementation of sendData method\r\n\t\tSystem.out.println(\"Sending location information...\");\r\n\t}", "public void sendRequest() {\r\n\t\t\r\n\t\tclient.join(this, isHost, gameCode, playerName, playerNumber);\r\n\t\t\r\n\t}", "public void send(Object data) {\n\t\t//do nothing - override to do something\n\t}", "public void sendGameInfo(Player plr){\r\n\t\t\r\n\t\tString message = \"UDGM\" + lobby.getGameString();\r\n\t\tsendOnePlayer(plr, message);\r\n\t}", "public void sendMsgToClient() {\n\n try {\n\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())), true);\n\n Log.d(TAG, \"The transmitted data:\" + msg);\n\n writer.println(msg);\n\n } catch (Exception e) {\n\n e.printStackTrace();\n\n }\n\n }", "public void doSendMsg() {\n FacesContext fctx = FacesContext.getCurrentInstance();\n HttpSession sess = (HttpSession) fctx.getExternalContext().getSession(false);\n SEHRMessagingListener chatHdl = (SEHRMessagingListener) sess.getAttribute(\"ChatHandler\");\n if (chatHdl.isSession()) {\n //TODO implement chat via sehr.xnet.DOMAIN.chat to all...\n if (room.equalsIgnoreCase(\"public\")) {\n //send public inside zone\n chatHdl.sendMsg(this.text, SEHRMessagingListener.PUBLIC, moduleCtrl.getLocalZoneID(), -1, -1);\n } else {\n chatHdl.sendMsg(this.text, SEHRMessagingListener.PRIVATE_USER, moduleCtrl.getLocalZoneID(), -1, curUserToChat.getUsrid());\n }\n this.text = \"\";\n }\n //return \"pm:vwChatRoom\";\n }", "public void sendLiteGame(){\n SerializableLiteGame toSend = liteGame.makeSerializable();\n\n if ( client1 != null ) {\n client1.send(toSend);\n }\n if ( client2 != null ) {\n client2.send(toSend);\n }\n if ( client3 != null ) {\n client3.send(toSend);\n }\n }", "public void joinGameRoom(String roomCode) {\n try {\n roomCode = roomCode.toLowerCase();\n DataOutputStream out = new DataOutputStream(socket.getOutputStream());\n DataInputStream in = new DataInputStream(socket.getInputStream());\n out.writeUTF(\"Conn\" + roomCode);\n String response = in.readUTF();\n\n switch (response.substring(0, 4)) {\n case \"Conf\":\n String start = \"YELLOW\";\n String you = \"YELLOW\";\n\n if (response.charAt(4) == 'R')\n start = \"RED\";\n if (response.charAt(5) == 'R')\n you = \"RED\";\n\n ObjectInputStream inObj = new ObjectInputStream(socket.getInputStream());\n ArrayList<String> gameChat = new ArrayList<>((ArrayList<String>) inObj.readObject());\n inObj = new ObjectInputStream(socket.getInputStream());\n ArrayList<String> mainChat = new ArrayList<>((ArrayList<String>) inObj.readObject());\n new GameGUI().start(stage, mainMenuGUI, socket, roomCode, gameChat, mainChat, start, you);\n break;\n case \"Full\":\n AlertHandler.show(Alert.AlertType.ERROR, \"Room Full\", \"Room Full\", \"The room you tried to join is full.\");\n break;\n case \"Invl\":\n AlertHandler.show(Alert.AlertType.ERROR, \"Invalid Code\", \"Invalid Code\", \"The selected room does not exist\");\n break;\n\n }\n\n } catch (IOException | ClassNotFoundException e) {\n e.printStackTrace();\n }\n\n }", "private void sendData() {\n final ByteBuf data = Unpooled.buffer();\n data.writeShort(input);\n data.writeShort(output);\n getCasing().sendData(getFace(), data, DATA_TYPE_UPDATE);\n }", "@Override\n public void onClick(View v) {\n Log.d(TAG,\"JOINING ROOMID\" + chat_list.get(position).roomhash );\n mSocket.emit(\"CreateRoom\",chat_list.get(position).roomhash,chat_list.get(position).gcmID);\n Intent intent2 = new Intent(CTX, ChatInstance.class);\n intent2.putExtra(\"roomnum\", chat_list.get(position).roomhash);\n\n CTX.startActivity(intent2);\n\n }", "@Override\n\tpublic void send(OutputStream stream) throws IOException {\n\t\tstream.write(this.data);\n\t}", "public void sendPacket() throws IOException {\n\t\tbyte[] buf = playerList.toString().getBytes();\n\n\t\t// send the message to the client to the given address and port\n\t\tInetAddress address = packet.getAddress();\n\t\tint port = packet.getPort();\n\t\tpacket = new DatagramPacket(buf, buf.length, address, port);\n\t\tsocket.send(packet);\n\t}", "public static void sendGameStatus(int sender_id, int receiver_id, String receiver_username, String game, int gameStatus){\n\n Socket clientSocket;\n\n try{\n clientSocket = new Socket(hostname, port);\n\n //Care about order\n ObjectInputStream datain = new ObjectInputStream(clientSocket.getInputStream());\n ObjectOutputStream dataout = new ObjectOutputStream(clientSocket.getOutputStream());\n\n String request = \"STATUS \"\n + Integer.toString(sender_id) + \" \"\n + Integer.toString(receiver_id) + \" \"\n + game + \" \"\n + Integer.toString(gameStatus) + \" \"\n + receiver_username;\n\n dataout.writeObject(request);\n// String response = (String) datain.readObject();\n clientSocket.close();\n\n }catch(Exception e){\n e.printStackTrace();\n }\n\n }", "public void sendMessage() {\n\t\tString myPosition=this.agent.getCurrentPosition();\n\t\tif (myPosition!=null){\n\t\t\t\n\t\t\tList<String> wumpusPos = ((CustomAgent)this.myAgent).getStenchs();\n\t\t\t\n\t\t\tif(!wumpusPos.isEmpty()) {\n\t\t\t\tList<String> agents =this.agent.getYellowpage().getOtherAgents(this.agent);\n\t\t\t\t\n\t\t\t\tACLMessage msg=new ACLMessage(ACLMessage.INFORM);\n\t\t\t\tmsg.setSender(this.myAgent.getAID());\n\t\t\t\tmsg.setProtocol(\"WumpusPos\");\n\t\t\t\tmsg.setContent(wumpusPos.get(0)+\",\"+myPosition);\n\t\t\t\t\n\t\t\t\tfor(String a:agents) {\n\t\t\t\t\tif(this.agent.getConversationID(a)>=0) {\n\t\t\t\t\t\tif(a!=null) msg.addReceiver(new AID(a,AID.ISLOCALNAME));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.agent.sendMessage(msg);\n\t\t\t\tthis.lastPos=myPosition;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t}", "public void sendmsg(Message msg){\n try {\n oos.writeObject(new Datapacket(1, null, msg,null, null));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void sendMessage() {\n Log.d(\"sender\", \"Broadcasting message\");\n Intent intent = new Intent(\"custom-event-name\");\n // You can also include some extra data.\n double[] destinationArray = {getDestination().latitude,getDestination().longitude};\n intent.putExtra(\"destination\", destinationArray);\n LocalBroadcastManager.getInstance(this).sendBroadcast(intent);\n }", "public void send(ILPacket dataPacket) throws IOException {\n\t\t \n\t\tDatagramPacket packet;\n\t\t\n\t\tbyte[] buffer = dataPacket.getBytes();\n\t\t\n\t\tpacket = new DatagramPacket(buffer, buffer.length, this.group, this.writePort);\n\t\tthis.outSocket.send(packet);\n\t}", "public void send_data_packet(char sender, int seq, char dest, String msg,\n String path) {\n if (!Character.isUpperCase(sender)) {\n Log(\"Invalid sender '\"+sender+\"'\\n\");\n return;\n }\n if (!Character.isUpperCase(dest)) {\n Log(\"Invalid destination '\"+dest+\"'\\n\");\n return;\n }\n DatagramPacket dp= make_data_packet(sender, seq, dest, msg, path);\n if (dp != null) {\n send_data_packet(dest, dp);\n }\n }", "private static void sendDataMessage() {\r\n\t\tSystem.out.println(\"CLIENT: \" + \" \" + \"DataMessage sent.\");\r\n\t\t\r\n\t\tbyte[] blockNumberAsByteArray = helper.intToByteArray(blockNumberSending);\r\n\t\tsplitUserInput = helper.divideArray(userInputByteArray);\r\n\r\n\t\tsendData = message.dataMessage(blockNumberAsByteArray, splitUserInput[sendingPackageNumber]);\r\n\t\tsendingPackageNumber++;\r\n\t\tblockNumberSending++; // blocknumber that is given to the next message to be transmitted\r\n\r\n\t\t// trims the message (removes empty bytes), so the last message can be detected\r\n\t\ttrimmedSendData = helper.trim(sendData);\r\n\r\n\t\tsendDataMessage = new DatagramPacket(trimmedSendData, trimmedSendData.length, ipAddress, SERVER_PORT);\r\n\t\ttry {\r\n\t\t\tclientSocket.send(sendDataMessage);\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tackNeeded = true;\r\n\r\n\t\tif (trimmedSendData.length < 516) {\r\n\t\t\tlastPackage = true;\r\n\t\t}\r\n\t}", "public void sendMatch() {\n for (int i = 0; i < numberOfPlayers; i++) {\n try {\n // s = ss.accept();\n oos = new ObjectOutputStream(sockets.get(i).getOutputStream());\n oos.writeObject(game);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }", "public static void sendGameMove(int sender_id, int receiver_id, String game, String move) {\n\n\n Socket clientSocket;\n\n ResponseObject object = new ResponseObject();\n\n try {\n clientSocket = new Socket(hostname, port);\n\n //Care about order\n ObjectInputStream datain = new ObjectInputStream(clientSocket.getInputStream());\n ObjectOutputStream dataout = new ObjectOutputStream(clientSocket.getOutputStream());\n\n String request = \"REQUEST \" + Integer.toString(sender_id) + \" \" + Integer.toString(receiver_id) + \" \" + game + \" \" + move;\n\n dataout.writeObject(request);\n// String response = (String) datain.readObject();\n clientSocket.close();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public boolean send(NetData data)\n {\n writer.println(data.toString());\n xMessenger.miniMessege(\">>>\"+ data.toString());\n return true;\n }", "@ReactMethod\n public void send(ReadableArray data) {\n byte[] payload = new byte[data.size()];\n for (int i = 0; i < data.size(); i++) {\n payload[i] = (byte)data.getInt(i);\n }\n\n long maxSize = chirpConnect.maxPayloadLength();\n if (maxSize < payload.length) {\n onError(context, \"Invalid payload\");\n return;\n }\n ChirpError error = chirpConnect.send(payload);\n if (error.getCode() > 0) {\n onError(context, error.getMessage());\n }\n }", "public void sendEndRace() {\n // Set data to game state\n byte[] buffer = new byte[1];\n buffer[0] = END_RACE;\n\n // Send the data to all the players\n for (InetAddress playerAddress : players.keySet())\n sendPacket(playerAddress, buffer);\n }", "public void sendStartGame (){\n connect();\n try{\n doStream.writeUTF(\"GAME_START\");\n doStream.writeUTF(currentUser.getUserName());\n\n } catch (IOException e){\n e.printStackTrace();\n }\n disconnect();\n }", "public void writeUserMessage(String room, String name, String message) {\n ((GroupChatPanel)grouptabs.get(room)).writeUserMessage(name,message);\n }", "@Override\r\n public void sendClientGame(ClientGame clientGame) {\r\n\r\n //System.out.println(\"Invio \"+clientGame+clientGame.getReserve()+\" a \"+username);\r\n ClientGameNetObject clientGameNetObject = new ClientGameNetObject(MessageHeaderEnum.CLIENTGAME.toString(),clientGame);\r\n //System.out.println(clientGameNetObject+\" : \"+clientGameNetObject.getClientGame().getReserve()+\" : \"+clientGame.getActivePlayerUsername());\r\n sendObject(clientGameNetObject);\r\n }", "public void sendGameStateToAllClients(GameState gameState) {\n for (String player : this.getDistantPlayers()) {\n\n Socket s = getPlayersSocket().get(player);\n\n // System.out.println(\"GAMESTATE READY TO BE SENT to \"+player);\n ObjectOutputStream out = null;\n if ((!s.isClosed()) && s.isConnected()) {\n\n }\n\n try {\n out = new ObjectOutputStream(this.getPlayersSocket().get(player).getOutputStream());\n // System.out.println(\"GAMESTATE READY TO BE SENT to \"+player+\"Soket ok\");\n out.writeObject(gameState);\n // System.out.println(\"GAMESTATE READY TO BE SENT to \"+player+\"Soket ok\"+\" Written\");\n out.flush();\n } catch (IOException e) {\n e.printStackTrace();\n }\n //System.out.println(\"GAMESTATE SENT\");\n }\n ((LocalClientI) AppSingleton.getInstance().getClient()).receive(gameState);\n }", "public void send(byte[] data) throws IOException {\n dataOutput.write(data);\n dataOutput.flush();\n }", "void sendMessage(Message m) throws IOException {\n String msg = m.toString();\n\n buffer = msg.getBytes(\"Windows-1256\");\n toServer = new DatagramPacket(buffer, buffer.length,\n InetAddress.getByName(sendGroup), port);\n if (m.getType() == Message.DATA) {\n manager.mManager.addMessage(m);\n }\n\n System.out.println(getName() + \"-->\" + m);\n serverSocket.send(toServer);\n }", "public void communicate() {\n // Send\n for (int i = 0; i < robots.length; i++) {\n if (i != this.id) {\n if (objectFound) {\n System.out.println(\"Robot \" + this.id + \": Telling everyone else...\");\n this.robots[i].mailbox[i] = new Message(this.id, this.objectFound, goal);\n } else {\n this.robots[i].mailbox[i] = new Message(this.id, this.objectFound, null);\n }\n }\n }\n // Read\n for (int i = 0; i < mailbox.length; i++) {\n if (i != this.id && mailbox[i] != null && mailbox[i].objectFound) {\n this.objectFound = true;\n this.goal = mailbox[i].objectLocation;\n }\n }\n }", "public void sendMsg(){\r\n\t\tsuper.getPPMsg(send);\r\n\t}", "public synchronized void send(byte[] data, int length) throws IOException {\r\n\t\tsocket.send(new DatagramPacket(data, length, remoteAddress));\r\n\t}", "private void setPlayerRoom(){\n player.setRoom(currentRoom);\n }", "@Override\n\tpublic void EmergencySend(byte[] data) {\n\t\t\n\t}", "public void Send(long[] data, int dest, int tag) {\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\tEntered Send(int[]) method\");\n }\n Message message = new Message(Message.dataToByteArray(data), Rank(), tag, Message.TYPE_LONG);\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\tSending...\");\n System.err.println(message);\n }\n group_.Send(message, dest);\n }", "public void sendMessageToPlayer(JSONObject msg, Player receiver)\n {\n if (mEnable && msg != null && receiver != null) {\n Log.d(LOGTAG,\"Sending message to receiver at pos \" + receiver.getPosition());\n\n // TODO: Check if device ok?\n BluetoothDevice recDevice = receiver.getBDevice();\n mBS.send(recDevice, MessageFactory.msgToBytes(msg));\n\n } else Log.d(LOGTAG,\"There is a problem sending a message to a receiver\");\n }", "private void sendData(String message) {\n\t\t\ttry {\n\t\t\t\toutput.writeObject(message);\n\t\t\t\toutput.flush(); // flush output to client\n\t\t\t} catch (IOException ioException) {\n\t\t\t\tSystem.out.println(\"\\nError writing object\");\n\t\t\t}\n\t\t}", "private synchronized void sendGameData(PrintWriter stream) {\r\n\t\tstream.println(\"1\");\r\n\t\tstream.println(Integer.toString(XSIZ));\r\n\t\tstream.println(Integer.toString(YSIZ));\r\n\t\tstream.println(Integer.toString(ZOMBIE_BORDER));\r\n\t\tstream.println(Integer.toString(MAX_NR_ZOMBIES));\r\n\t\tstream.println(Integer.toString(SQ_SIZE));\r\n\t\tif(dead){\r\n\t\t\tstream.println(\"true\");\r\n\t\t}else{\r\n\t\t\tstream.println(\"false\");\r\n\t\t}\r\n\t\t\r\n\t\t//planten doorsturen\r\n\t\tsendPlants(stream);\r\n\t\t//zombies doorsturen\r\n\t\tsendZombies(stream);\r\n\r\n\t\tstream.flush();\r\n\t}", "public void send() {\n\t}", "private void sendMessage(ChatMessage msg) throws IOException {\n try {\n sOutput.writeObject(msg);\n } catch (IOException e) {\n sOutput.close();\n sInput.close();\n e.printStackTrace();\n }\n //sOutput.flush();\n }", "@Override\n\tpublic void sendData(CharSequence data) {\n\t\t\n\t}", "private void sendData(String data) {\n\n if (!socket.isConnected() || socket.isClosed()) {\n Toast.makeText(getApplicationContext(), \"Joystick is disconnected...\",\n Toast.LENGTH_LONG).show();\n return;\n }\n\n\t\ttry {\n\t\t\tOutputStream outputStream = socket.getOutputStream();\n\n byte [] arr = data.getBytes();\n byte [] cpy = ByteBuffer.allocate(arr.length+1).array();\n\n for (int i = 0; i < arr.length; i++) {\n cpy[i] = arr[i];\n }\n\n //Terminating the string with null character\n cpy[arr.length] = 0;\n\n outputStream.write(cpy);\n\t\t\toutputStream.flush();\n\n Log.d(TAG, \"Sending data \" + data);\n\t\t} catch (IOException e) {\n Log.e(TAG, \"IOException while sending data \"\n + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t} catch (NullPointerException e) {\n Log.e(TAG, \"NullPointerException while sending data \"\n + e.getMessage());\n\t\t}\n\t}", "private void sendMessage(ChatMessage msg) {\n try {\n sOutput.writeObject(msg);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void run() {\n if (pendingTeleports.containsKey(sender.getName())) {\n pendingTeleports.remove(sender.getName(),originalSender);\n if (senderPlayer.dimension != teleportee.dimension) {\n TeleportHelper.transferPlayerToDimension(teleportee,senderPlayer.dimension,server.getPlayerList());\n }\n teleportee.setPositionAndUpdate(senderPlayer.posX,senderPlayer.posY,senderPlayer.posZ);\n sender.addChatMessage(new TextComponentString(TextFormatting.GREEN+\"Teleport successful.\"));\n teleportee.addChatMessage(new TextComponentString(TextFormatting.GREEN+\"Teleport successful.\"));\n } //if not, the teleportee moved\n }", "private void formWriteBegin() {\n\t\tsendData = new byte[4];\n\t\tsendData[0] = 0;\n\t\tsendData[1] = 4;\n\t\tsendData[2] = 0;\n\t\tsendData[3] = 0;\n\t\t\n\t\t// Now that the data has been set up, let's form the packet.\n\t\tsendPacket = new DatagramPacket(sendData, 4, receivePacket.getAddress(),\n\t\t\t\treceivePacket.getPort());\t\n\t}", "public void send(Serializable msg) throws IOException;", "public void actionPerformed(ActionEvent e) {\n try {\r\n if (roomOrUser == 1) {\r\n // send message to a room\r\n sock.executeCommand(new RoomMessageCommand(new LongInteger(name), textArea_1.getText()\r\n .getBytes()));\r\n textArea_2.setText(textArea_2.getText() + textField.getText() + \": \" + textArea_1.getText()\r\n + \"\\n\");\r\n } else if (roomOrUser == 2) {\r\n // send message to a user\r\n sock.executeCommand(new UserMessageCommand(new LongInteger(name), textArea_1.getText()\r\n .getBytes(), true));\r\n textArea_2.setText(textArea_2.getText() + textField.getText() + \": \" + textArea_1.getText()\r\n + \"\\n\");\r\n }\r\n } catch (InvalidCommandException ex) {\r\n JOptionPane.showMessageDialog(null, \"Unable to join or leave room.\", \"alert\",\r\n JOptionPane.ERROR_MESSAGE);\r\n }\r\n }", "void sendMessage(ChatMessage msg) {\n\t\ttry {\n\t\t\tsOutput.writeObject(msg);\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tdisplay(\"Não foi possível enviar a mesagem !!!\");\n\t\t}\n\t}", "void sendData(String msg) throws IOException\n {\n if ( msg.length() == 0 ) return;\n//\n msg += \"\\n\";\n// Log.d(msg, msg);\n if (outputStream != null)\n outputStream.write(msg.getBytes());\n// myLabel.setText(\"Data Sent\");\n// myTextbox.setText(\" \");\n }", "@Override\n\tpublic void onSendPrivateChatDone(byte result) {\n\t\tif(WarpResponseResultCode.SUCCESS==result){\n\t\t\tLog.d(\"Receiver\", \"He is Online\");\n\t\t\tChatActivity.this.runOnUiThread(new Runnable() {\n\t\t\t\t public void run() {\n\t\t\t\t\t sa = ((SharingAtts)getApplication());\n\t\t\t\t\t ItemTest it = new ItemTest();\n\t\t\t\t\t String colNames = it.printData(\"chat\")[1];\n\t\t\t\t\t DBManager dbm = new DBManager(ChatActivity.this, colNames,\"chat\",it.printData(\"chat\")[0]);\n\t\t\t\t\t dbm.openToWrite();\n\t\t\t\t\t dbm.cretTable();\n\t\t\t\t\t msg = msg.replace(\" \", \"?*\");\n\t\t\t\t\t dbm.insertQuery(sa.name+\" \"+msg+\" \"+challenged, colNames.split(\" \")[1]+\" \"+colNames.split(\" \")[2]+\" \"+colNames.split(\" \")[3]);\n\t\t\t\t\t dbm.close();\n\t\t\n\t\t\t\t }\n\t\t\t});\n\t\t\t\n\t\t\t\n\t\t}else{\n\t\t\tChatActivity.this.runOnUiThread(new Runnable() {\n\t\t\t\t public void run() {\n\t\t\t\t\t Toast.makeText(ChatActivity.this, \"Receiver is offline. Come back later\", Toast.LENGTH_SHORT).show();\t\n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t});\n\t\t}\n\t}", "public void updateRoom(Room room);", "public void sendData(String mssg, int destinationPort){\r\n\r\n\t\t\t //Creates a new socket. This will be used for sending and receiving packets\r\n\t\t\t//\t\t\tsocket.setSoTimeout(5000); //Sets the timeout value to 5 seconds. If 5 seconds elapses and no packet arrives on receive, an exception will be thrown\t\r\n\t\tInetAddress local = null;\r\n\t\t\ttry {\r\n\t\t\t\tlocal = InetAddress.getLocalHost();\r\n\t\t\t} catch (UnknownHostException e1) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t} //Gets the local address of the computer \r\n\t\t\t\r\n\t\t\t\tbyte[] dataArray = mssg.getBytes();\r\n\r\n\t\t\t\tDatagramPacket packetToSend = new DatagramPacket(dataArray, dataArray.length, local, destinationPort); //Creates a packet from the dataArray, to be sent to the intermediate host\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsndSocket.send(packetToSend);\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t} \r\n\t}", "void onRoomMessage(String roomName, EcologyMessage message) {\n message.addArgument(roomName);\n message.addArgument(ROOM_MESSAGE_ID);\n message.setSource(getMyDeviceId());\n sendConnectorMessage(message);\n }", "@Override\n public void send(String key, String data) throws IOException {\n\n }", "public void sendMessage()\r\n {\r\n MessageScreen messageScreen = new MessageScreen(_lastMessageSent);\r\n pushScreen(messageScreen);\r\n }", "@Override\n public void send(byte[] data) throws SocketException {\n DatagramPacket sendPacket = new DatagramPacket(\n data,\n data.length,\n this.lastClientIPAddress,\n this.lastClientPort);\n try {\n serverSocket.send(sendPacket);\n } catch (IOException ex) {\n Logger.getLogger(UDPServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void forwardRoomMessage(EcologyMessage message) {\n String targetRoomName = null;\n try {\n targetRoomName = (String) message.fetchArgument();\n } catch (ClassCastException | IndexOutOfBoundsException e) {\n //throw new IllegalArgumentException(\"Unrecognized message format.\");\n Log.e(TAG, \"Exception \" + e.getMessage());\n }\n\n Room room = rooms.get(targetRoomName);\n if (room != null) {\n room.onMessage(message);\n }\n }", "@Override\n public void stream(T data) {\n channel.write(new DataMessage<>(data));\n }", "void writeData(String messageToBeSent) {\n\n try {\n if (clientSocket != null) {\n outputStream = clientSocket.getOutputStream();\n ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream);\n objectOutputStream.writeObject(messageToBeSent);\n outputStream.flush();\n }\n\n if (getLog().isDebugEnabled()) {\n getLog().debug(\"Artifact configurations and test cases data sent to the synapse agent successfully\");\n }\n } catch (IOException e) {\n getLog().error(\"Error while sending deployable data to the synapse agent \", e);\n }\n }", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tmConnectedThread.write(\"send\");\n\t\t\t\t\tmConnectedThread.writeFile();\n\t\t\t\t}", "public void send(Board board){\n\t\ttry {\n\t\t\t//\t\t\tSystem.out.println(\"Sende Board \" + board);\n\t\t\tout.reset();\n\t\t\tout.writeObject(board);\n\t\t\tout.flush();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void sendData(IoBuffer outData) {\n\t\ttry {\n\t\t\tsession.write(outData);\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void sendDataToAMQ(){\n\t\t\r\n\t\tList<String> msg = new ArrayList<>();\r\n\t\tif(offsetfollower < (prototype.followerDrivingInfo.meetingLocation - 500)) {\r\n\t\t\toffsetleader += prototype.leaderDrivingInfo.speed;\r\n\t\t\toffsetfollower += prototype.followerDrivingInfo.speed;\r\n\t\t\tmsg.add(\"<carName TestCar carName> <segmentPosX -4 segmentPosX> <segmentPosY \"+ (+offsetleader) +\" segmentPosY> <carSpeed \" + (prototype.leaderDrivingInfo.speed)+\" carSpeed>\");\r\n\t\t\tmsg.add(\"<carName Camcar carName> <segmentPosX -4 segmentPosX> <segmentPosY \"+ (offsetfollower) +\" segmentPosY> <carSpeed \" + (prototype.followerDrivingInfo.speed)+\" carSpeed>\");\t\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\toffsetleader += prototype.leaderDrivingInfo.speed;\r\n\t\t\toffsetfollower += prototype.leaderDrivingInfo.speed ;\r\n\t\t\tmsg.add(\"<carName TestCar carName> <segmentPosX -4 segmentPosX> <segmentPosY \"+ (+offsetleader) +\" segmentPosY> <carSpeed \" + (prototype.leaderDrivingInfo.speed)+\" carSpeed>\");\t\r\n\t\t\tmsg.add(\"<carName Camcar carName> <segmentPosX -4 segmentPosX> <segmentPosY \"+ (offsetfollower) +\" segmentPosY> <carSpeed \" + (prototype.leaderDrivingInfo.speed)+\" carSpeed>\");\r\n\r\n\t\t}\r\n for(int i = 0; i < msg.size();i++)\r\n {\r\n \tamqp.sendMessage(msg.get(i));\r\n }\r\n// \t}\r\n }", "public void sendJoiningPlayer() {\r\n Player p = nui.getPlayerOne();\r\n XferJoinPlayer xfer = new XferJoinPlayer(p);\r\n nui.notifyJoinConnected();\r\n networkPlayer.sendOutput(xfer);\r\n }", "public void send(DataPacket packet){\n if(deviceDestination != null){\n deviceDestination.receive(packet, portDestination);\n }\n }", "public void sendBroadcast(byte[] bytesToSend)\n {\n if (m_name != null)\n {\n m_socket.write(bytesToSend);\n }\n\n }", "protected final boolean send(final Object data) {\n\t\t// enviamos los datos\n\t\treturn this.send(data, null);\n\t}", "public void sendId() {\n for (int i = 0; i < numberOfPlayers; i++) {\n try {\n // s = ss.accept();\n oos = new ObjectOutputStream(sockets.get(i).getOutputStream());\n game.getOne().setID(0);\n game.getTwo().setID(1);\n oos.writeObject(i);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }", "protected void makeRoom(String roomID)\n {\n mChat.child(roomID).child(\"sender1\").setValue(uid1);\n mChat.child(roomID).child(\"sender2\").setValue(uid);\n goToChat(roomID);\n }", "private void send(Object o) {\r\n try {\r\n System.out.println(\"02. -> Sending (\" + o +\") to the client.\");\r\n this.os.writeObject(o);\r\n this.os.flush();\r\n } \r\n catch (Exception e) {\r\n System.out.println(\"XX.\" + e.getStackTrace());\r\n }\r\n }", "public synchronized void setRoom(String room) {\n this.room = room;\n }", "public void send(Opcode opcode, Serializable datum);", "public void send(PacketHeader hdr, char[] data)\n\t{\n\t\tchar[] toName = new char[32];\n\n\t\t//sprintf(toName, \"SOCKET_%d\", (int)hdr.to);\n\t\t\n\t\tassert((mSendBusy == false) && (hdr.mLength > 0) \n\t\t\t&& (hdr.mLength <= MaxPacketSize) && (hdr.from == mNetworkAddress));\n\t\tDebug.print('n', \"Sending to addr %d, %d bytes... \", hdr.to, hdr.mLength);\n\n\t\tInterrupt.Schedule(NetworkSendDone, this, NetworkTime, NetworkSendInt);\n\n\t\tif (Random() % 100 >= mChanceToWork * 100) \n\t\t{ // emulate a lost packet\n\t\t\tDebug.print('n', \"oops, lost it!\\n\");\n\t\t\treturn;\n\t\t}\n\n\t\t// concatenate hdr and data into a single buffer, and send it out\n\t\tchar[] buffer = new char[MaxWireSize];\n\t\tbuffer = (char[])hdr;\n\t\t//bcopy(data, buffer + sizeof(PacketHeader), hdr.length);\n\t\tsendToSocket(mSock, buffer, MaxWireSize, toName);\n\t\t\n\t}", "public void setRoom(Room room) {\r\n\t\tthis.room = room;\r\n\t}", "void sendPacket(Packet p){\n InetAddress address=p.getDestination().getAddress();\n if (this.socket.isClosed()){\n return;\n }\n if (chatRooms.containsKey(address)){\n chatRooms.get(address).sendMessage(p);\n }else{\n Socket distant;\n Discussion discussion;\n try {\n distant = new Socket(address, NetworkManager.UNICAST_PORT);\n discussion = new Discussion(distant);\n discussion.addObserver(this);\n chatRooms.put(distant.getInetAddress(), discussion);\n new Thread(discussion).start();\n discussion.sendMessage(p);\n } catch (IOException e) {\n System.out.println(\"Erreur à l'envois d'un nouveau message\");\n }\n }\n }", "public void Send(float[] data, int dest, int tag) {\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\tEntered Send(int[]) method\");\n }\n Message message = new Message(Message.dataToByteArray(data), Rank(), tag, Message.TYPE_FLOAT);\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\tSending...\");\n System.err.println(message);\n }\n group_.Send(message, dest);\n }", "private void message(\n QueryParam params,\n ChatMessage message, WebSocketSession session) throws\n InvalidRoomException,\n BroadcastException {\n\n IRoomService roomService = roomServiceFactory.getRoomService();\n \n message.setFrom(params.displayName);\n\n IRoom targetRoom = roomService.getRoom(params.RoomId);\n\n targetRoom.broadcastMessage(message);\n }", "public void onlinerequest() {\r\n int size = Server.getUsers().size();\r\n \r\n try {\r\n this.output.flush();\r\n this.output.writeUTF(\"ONLINE\");\r\n this.output.flush();\r\n this.output.writeUTF(Integer.toString(size));\r\n this.output.flush();\r\n// Log.print(\"Sending the data\");\r\n for(int x = 0; x < Server.getUsers().size(); x++){\r\n if(Server.getUsers().get(x).getName().equals(this.name)){\r\n this.output.writeUTF(Server.getUsers().get(x).getName() + \" (You)\");\r\n }\r\n else{\r\n this.output.writeUTF(Server.getUsers().get(x).getName());\r\n this.output.flush();\r\n }\r\n \r\n \r\n }\r\n// Log.print(\"Successfully sent\");\r\n } catch (IOException ex) {\r\n Log.error(ex.getMessage());\r\n }\r\n }", "public void sendStartGame() {\n \t\tclient.sendTCP(new StartGame());\n \t}", "@Override\n public void sendMessage(Message m) {\n commSender.sendMessage(m);\n }", "@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n updateRooms(dataSnapshot);\n }", "public void sendPacket(String data) throws IOException {\n\n BufferedWriter out = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));\n out.write(data + \"\\0\");\n out.flush();\n }", "long sendMessage(int roomId, String message) throws RoomNotFoundException, RoomPermissionException, IOException;", "@Override\n\tpublic void onUserJoinedRoom(RoomData arg0, String arg1) {\n\t\t\n\t}", "public void run() {\n\t\t\t\tDatagramPacket packet = new DatagramPacket(data,data.length,ip,port);\n\t\t\t\ttry {\n\t\t\t\t\tsocket.send(packet);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "public synchronized void send(byte[] data, int len) {\n byte[] sendData = data;\n int sendLen = len;\n if (EncryptSetupManager.newInstance().getFlag() && len > 0) {\n sendData = this.mAESManager.encrypt(data, len);\n if (sendData == null) {\n LogUtil.e(Tag, \"encrypt failed!\");\n } else {\n sendLen = sendData.length;\n }\n }\n if (AudioUtil.getIs()) {\n LogUtil.d(Tag, \"VR write \" + sendLen);\n this.mPCMPackageHead.m4053c(CommonParams.bA);\n this.mPCMPackageHead.m4047a(sendLen);\n this.mPCMPackageHead.m4052c();\n this.mArrayAdd.merge(this.mPCMPackageHead.m4048a(), this.f3149e, sendData, sendLen, this.mPair);\n writeVR(this.mPair.getData(), this.mPair.getSize());\n }\n }", "public void Send(int[] data, int dest, int tag) {\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\tEntered Send(int[]) method\");\n }\n Message message = new Message(Message.dataToByteArray(data), Rank(), tag, Message.TYPE_INT);\n if (DEBUG_MODE) {\n System.err.println(\"Comm: \\tSending...\");\n System.err.println(message);\n }\n group_.Send(message, dest);\n }", "@Override\n public void sendCommand(GameCommand cmd) {\n if(mSocket == null || !mSocket.isConnected() || mOut == null)\n throw new ClientConnException(\"Cannot send message. Socket is closed.\");\n\n try {\n mOut.writeObject(cmd);\n mOut.flush();\n } catch(IOException e) {\n LOG.log(Level.FINER, \"Connection closed: \" + e.toString(), e);\n disconnect();\n }\n }", "public void send(SocketChannel socket, byte[] data) {\n\t\tsynchronized (this.changeKeyQueue) {\n\t\t\t// since we now have something to write we change\n\t\t\t// key for this channel to WRITE state\n\t\t\tthis.changeKeyQueue\n\t\t\t\t\t.add(new ChangeKey(socket, SelectionKey.OP_WRITE));\n\n\t\t\tsynchronized (this.queueToMemaslap) {\n\t\t\t\tList<ByteBuffer> queue = (List<ByteBuffer>) this.queueToMemaslap\n\t\t\t\t\t\t.get(socket);\n\t\t\t\tif (queue == null) {\n\t\t\t\t\tqueue = new ArrayList<ByteBuffer>();\n\t\t\t\t\tthis.queueToMemaslap.put(socket, queue);\n\t\t\t\t}\n\t\t\t\tqueue.add(ByteBuffer.wrap(data));\n\t\t\t}\n\t\t}\n\t\t// wakes up selector's blocking .select() method\n\t\tthis.selector.wakeup();\n\t}", "private void send(Object o) {\n\t\ttry {\n\t\t\tSystem.out.println(\"02. -> Sending (\" + o +\") to the client.\");\n\t\t\tthis.os.writeObject(o);\n\t\t\tthis.os.flush();\n\t\t} \n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(\"XX.\" + e.getStackTrace());\n\t\t}\n\t}", "private void sendGMToAll(String msg){\r\n for(ClientHandler ch: clientThreads){\r\n try{\r\n //Get the client's ObjectOutputStream\r\n ObjectOutputStream oos = ch.getOOS();\r\n //Print the message to the client\r\n oos.writeObject(new DataWrapper(0, msg, true));\r\n } catch(IOException ioe) {\r\n System.out.println(\"IOException occurred: \" + ioe.getMessage());\r\n ioe.printStackTrace();\r\n }\r\n }\r\n }", "public void sendMessage(Message message) {\n if (accepted || !ended || message.type.equals(\"register\") || message.type.equals(\"lobby\")) {\n message.packetNum = packetNum;\n ByteBuffer buffer = ByteBuffer.wrap(SerializationUtils.serialize(message));\n SocketAddress addr = null;\n try {\n addr = client.getLocalAddress();\n log(\"sending [\" + message + \"] to \" + addr);\n client.write(buffer);\n reconciliation.add(message);\n packetNum++;\n } catch (IOException e) {\n error(\"Failed to send message to:\" + addr);\n e.printStackTrace();\n }\n }\n }" ]
[ "0.63992137", "0.6192966", "0.612981", "0.5966736", "0.5933615", "0.5921348", "0.5861404", "0.57848054", "0.5742484", "0.5729097", "0.5728792", "0.5726734", "0.5705594", "0.5698152", "0.5697204", "0.56924325", "0.5662241", "0.56295025", "0.5615319", "0.5601851", "0.55874306", "0.55810416", "0.55805635", "0.55632424", "0.5556994", "0.55551606", "0.55525523", "0.55439556", "0.55295736", "0.55184966", "0.5500647", "0.5479497", "0.54723626", "0.5466804", "0.54667944", "0.5466442", "0.5455384", "0.54513276", "0.5443993", "0.54410577", "0.5439987", "0.54383314", "0.5425409", "0.54251844", "0.5422088", "0.5413936", "0.54083633", "0.5395302", "0.5384681", "0.5380228", "0.5378924", "0.5337895", "0.53331244", "0.5322457", "0.5316423", "0.53078276", "0.529276", "0.52904296", "0.52805406", "0.5279888", "0.52795625", "0.52771926", "0.52621967", "0.5261699", "0.5259339", "0.525837", "0.5254537", "0.5254205", "0.52519697", "0.5251618", "0.52500093", "0.52453923", "0.52437717", "0.5242152", "0.5241183", "0.5231551", "0.52209514", "0.52168936", "0.52157205", "0.52119607", "0.5211768", "0.52114415", "0.5210761", "0.52073973", "0.5206624", "0.520642", "0.51924014", "0.5189444", "0.5188414", "0.5186952", "0.51774055", "0.517433", "0.51732475", "0.5170373", "0.5163859", "0.5161697", "0.5161132", "0.51595306", "0.51573074", "0.5153471" ]
0.6802887
0
do something on text submit
@Override public boolean onQueryTextSubmit(String query) { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String submitText();", "public abstract void onSubmit(String text);", "public void submitText() {\r\n \t\tthis.dialog.clickOK();\r\n \t}", "@Override\r\n public void actionPerformed(ActionEvent e) {\n String texto = tf.getText();\r\n //lo seteo como texto en el Label\r\n lab.setText(texto);\r\n //refresco los componentes de la ventana\r\n validate();\r\n //combierto a mayuscula el texto del textfield\r\n tf.setText(texto.toUpperCase());\r\n //lo selecciono todo\r\n tf.selectAll();\r\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t if (tf.isEditValid()) { //The text is invalid.\n\t\t\t //The text is valid,\n\t\t try {\n\t\t\t\t\t\t\ttf.commitEdit();\n\t\t\t\t\t\t} catch (ParseException e1) {\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t} //so use it.\n\t\t tf.postActionEvent(); //stop editing\n\t\t\t }\n\t\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\ttext.setText(ok.getText());\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif(parent_frame.getFestival().isLocked()){\n\t\t\t\t\tfeedback_display.append(\"\\tPlease submit after voice prompt has finished.\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tprocessAttempt(input_from_user.getText());\n\t\t\t\t\tinput_from_user.requestFocusInWindow(); //gets focus back on the field\n\t\t\t\t}\n\t\t\t}", "public void submitForm(String text) {\n\n Toast.makeText(this, text, Toast.LENGTH_LONG).show();\n String expected = \" Successful Signup \";\n if(text.equalsIgnoreCase(expected))\n {\n Intent myIntent = new Intent(SignUp.this, NumberVerify.class).putExtra(\"PHONE\",PhoneNumber.getText().toString());\n startActivity(myIntent);\n }\n\n }", "public void actionPerformed(ActionEvent ae)\r\n\r\n\t {\r\n ta.append(\"Me: \"+tf.getText()+\"\\n\");\t\t \r\n\r\n\t pw.println(tf.getText());//write the value of textfield into PrintWriter\r\n\r\n\t tf.setText(\"\");//clean the textfield\r\n\r\n\t }", "public static void pressSubmit(){\n DriverManager.driver.findElement(Constans.SUBMIT_BUTTON_LOCATOR).click();\n }", "private void submitInput(String txt){\n switch(inputType){\n case MAZE:\n loadMaze(txt);\n break;\n case LROUTE:\n loadRoute(txt);\n break;\n case SROUTE:\n saveRoute(txt);\n break;\n }\n }", "protected void enterPressed()\n\t{\n\t\t// Call the enter method if the enter key was pressed\n\t\tif (showCaret)\n\t\t\tonSubmit(text.getText().substring(0, text.getText().length() - 1));\n\t\telse onSubmit(text.getText());\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbtnSubmit_click(e);\n\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\tString get=textField.getText();\r\n\t\t\t\t\t\ttextField_1.setText(get);\r\n\t\t\t\t\t}", "@Override\n\tpublic boolean onQueryTextSubmit(String arg0) {\n\t\treturn false;\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n if (e.getSource() == submit) {\n int score = answerCheck();\n try {\n Submit submitButton = new Submit(userid, user.getText(), totalScore.getText(), score);\n setVisible(false);\n } catch (SQLException ex) {\n Logger.getLogger(Play.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }", "public boolean onQueryTextSubmit (String query) {\n return true;\n }", "@Override\n\tpublic boolean onQueryTextSubmit(String query) {\n\t\tLog.v(\"query\", \"onQueryTextSubmit\");\n\t\treturn false;\n\t}", "public void textBoxAction( TextBoxWidgetExt tbwe ){}", "@Override\r\n\t\t\tpublic boolean onQueryTextSubmit(String query) {\n\t\t\t\tdebugMemory(\"onQueryTextSubmit\");\r\n\t\t\t\treturn false;\r\n\t\t\t}", "@Override\n\t\tpublic boolean onQueryTextSubmit(String query) {\n\t\t\treturn true;\n\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif(parent_frame.getFestival().isLocked()){\n\t\t\t\t\tfeedback_display.append(\"\\tPlease submit after voice prompt has finished.\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tprocessAttempt(input_from_user.getText());\n\t\t\t\t}\n\t\t\t\tinput_from_user.requestFocusInWindow();//gets focus back to the spell here field\n\t\t\t}", "@Override\n public void Submit() {\n }", "public Submit_Button()\n\t\t\t{\n\t\t\t\tsuper(\"Submit\");\n\n\t\t\t\taddActionListener(new ActionListener()\n\t\t\t\t{\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t\t\t{\n\t\t\t\t\t\tloadText();\n\n\t\t\t\t\t\t// pass ssn input into patient instance to lookup tuple\n\t\t\t\t\t\tPatient p = new Patient(ssn);\n \n String result = p.search(selected_record_type);\n \n String[] values = result.split(\"\\n\");\n \n\t\t\t\t\t\t// create new instance of output panel to display result\n\t\t\t\t\t\tdisplayNewRecordOutput(new Patient_Record_Output(values));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}", "private void textField1ActionPerformed(java.awt.event.ActionEvent evt) {\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tString answerval = answer.getText();\r\n\t\t\t\tif (answerval.length() > 0) {\r\n\t\t\t\t\tanswer.setText(\"\");\r\n\t\t\t\t\tmsgsnd(answerval);\r\n\t\t\t\t}\r\n\t\t\t\tanswer.requestFocus();\r\n\t\t\t}", "@Step\r\n\tpublic void clickSubmit() {\r\n\t\tLOGGER.info(\"Clicking submit\");\r\n\t\tspeedoSubmit.click();\r\n\t}", "public String GetInput(JTextField textField, String text)\r\n {\r\n textField.selectAll();\r\n text = textField.getText();\r\n JOptionPane.showMessageDialog(this,\"<html><font size = 5>You enter: \\\"\"+ text+\"\\\"! \"\r\n +\"Please press \\\"OK\\\" to continue or press \\\"x\\\"\"\r\n + \" to exit</font></html>\");\r\n textField.setText(\"\");\r\n return text;\r\n }", "@Override\n public void onClick(View v) {\n String inputFieldText = ((TextView) findViewById(R.id.inputField)).getText().toString();\n\n // Set text to custom text, or if custom text is empty set to default hint\n if (inputFieldText.isEmpty()) {\n ((TextView) findViewById(R.id.text)).setText(\"Enter your OWN text!\");\n } else {\n ((TextView) findViewById(R.id.text)).setText(inputFieldText);\n }\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(hint==e.getSource()) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Hint: I have something to do with walking\");\n\t\t}\n\t\telse if(submit==e.getSource()) {\n\t\t\tif(textfield.getText().equalsIgnoreCase(\"footsteps\")) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"You won!\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Sorry, that is incorrect.\");\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n final String fieldText = field.getText();\n JOptionPane.showMessageDialog(null, fieldText);\n System.out.println(\"YESSSSSSSSSSSS\");\n }", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\t@NiftyEventSubscriber(id = \"chatText\")\n\tpublic void submitChatText(String id, NiftyInputEvent event){\n\t\tTextField tf = nifty.getScreen(\"hud\").findNiftyControl(\"chatText\",TextField.class);\n\t\tListBox lb = nifty.getScreen(\"hud\").findNiftyControl(\"listBoxChat\",ListBox.class);\n\t\tif (NiftyInputEvent.SubmitText.equals(event)) {\n\t\t\tString sendText = tf.getDisplayedText();\n\t\t\tif (sendText.length() == 0){\n\t\t\t\tnifty.getScreen(\"hud\").getFocusHandler().resetFocusElements();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttf.setText(\"\");\n\t\t\tif(observers.size()== 0){\n\t\t\t\tlb.addItem(sendText);\n\t\t\t}\n\t\t\tfor (GUIObserver g : observers) {\n\t\t\t\tg.onChatMessage(sendText);\n\t\t\t}\n\t\t\tnifty.getScreen(\"hud\").getFocusHandler().resetFocusElements();\n\t\t\tlb.showItem(lb.getItems().get(lb.getItems().size()-1));\n\t\t}\n\t}", "@Override\n public boolean onQueryTextSubmit(String s) {\n return false;\n }", "public void submit() {\n driver.findElement(SUBMIT_SELECTOR).click();\n }", "private void txtserchActionPerformed(java.awt.event.ActionEvent evt) {\n }", "private void sendTextInBox() {\n\t\tmodelAdapter.send(textFieldMessage.getText());\n\t textFieldMessage.setText(\"\");\n\t }", "@Override\n\tprotected final void onSubmit()\n\t{\n\t}", "public void onClick(ClickEvent event) {\r\n System.out.println(\"Submit Button geklickt\");\r\n handleEvent();\r\n }", "protected void saveInput() {\r\n value = valueText.getText();\r\n }", "private void makeTweet(String text) {\n\t\tassertNotNull(activity.findViewById(ca.ualberta.cs.lonelytwitter.R.id.save));\n\t\ttextInput.setText(text);\n\t\t((Button) activity.findViewById(ca.ualberta.cs.lonelytwitter.R.id.save)).performClick();\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tinput(input.getText().toString());\n\t\t\t\tshow.setText(output.toString());\n\t\t\t}", "@Override\n\tpublic boolean verifyText(JTextField arg0, String arg1) {\n\t\treturn true;\n\t}", "public void actionPerformed(ActionEvent e) {\n String text = textField1.getText();\n textField2.setText(text);\n\n }", "private void handleSubmitOnPre() {\n }", "private void addSubmitListener() {\n\t\tview.addSubmitListener(new SubmitListener());\n\t}", "@Override\n\t\t\tpublic void onPreSubmit() {\n\t\t\t}", "@Override\n\t\t\tpublic void onPreSubmit() {\n\t\t\t}", "public void textBoxSubmit() throws InterruptedException {\n\t\tdriver.get(\"http://www.google.com\");\n\t\tWebElement input = driver.findElement(By.name(\"q\"));\n\t\tinput.sendKeys(\"React\");\n\t\tThread.sleep(1000);\n\t\tinput.clear();\n\t\tThread.sleep(1000);\n\t\tinput.sendKeys(\"Angular\");\n\t\tThread.sleep(1000);\n\t\tinput.submit();\n\t}", "@Override\n public boolean onQueryTextSubmit(String query) {\n return true;\n }", "@Override\n public boolean onQueryTextSubmit(String query) {\n return true;\n }", "protected void onSubmitAction(IModel<StringWrapper> model, AjaxRequestTarget target, Form<?> form) {\n }", "@Override\n\t\tpublic boolean onQueryTextSubmit(String query) {\n\t\t\treturn false;\n\t\t}", "public interface SearchForm {\n void inputText(String text);\n void submit();\n\n}", "private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed\r\n sendMessage(jTextField1.getText());\r\n }", "public void processInput(String text);", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tString text = getCurUser() + \" : \" + textField.getText();\n\t\t\t\ttextField.setText(\"\");\n\t\t\t\tfinal ChatMessage msg = new ChatMessage();\n\t\t\t\tmsg.setMessage(text);\n\t\t\t\tmainFrame.sendMessage(msg);\n\t\t\t\t\n\t\t\t}", "private void setupSubmitButton() {\n\t\tImageIcon submit_button_image = new ImageIcon(parent_frame.getResourceFileLocation() + \"submit.png\");\n\t\tJButton submit_button = new JButton(\"\", submit_button_image);\n\t\tsubmit_button.setBorderPainted(false);\n\t\tsubmit_button.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t//only enable submitting if festival has finished to avoid delayed voice prompts\n\t\t\t\tif(parent_frame.getFestival().isLocked()){\n\t\t\t\t\tfeedback_display.append(\"\\tPlease submit after voice prompt has finished.\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tprocessAttempt(input_from_user.getText());\n\t\t\t\t}\n\t\t\t\tinput_from_user.requestFocusInWindow();//gets focus back to the spell here field\n\t\t\t}\n\t\t});\n\t\tsubmit_button.addMouseListener(new VoxMouseAdapter(submit_button,null));\n\t\tadd(submit_button);\n\t\tsubmit_button.setBounds(32, 598, 177, 100);\n\t}", "public void actionPerformed(ActionEvent e) {\n\n if (inputField.getText().trim().length() == 0) {\n return;\n }\n try {\n\n String input = inputField.getText();\n \n inputField.setText(\"\");\n clientMessage = new Message(getName(), Message.ALL, input, Message.DATA);\n clientMessage.setID(manager.getNextMessageID());\n //JOptionPane.showMessageDialog(null, input);\n //JOptionPane.showMessageDialog(null, clientMessage.getContent());\n sendMessage(clientMessage);\n\n } catch (IOException err) {\n System.err.println(err.getMessage());\n err.printStackTrace();\n }\n }", "public void enterAnswer(String text) {\n\t\ttextBox.clear();\n\t\ttextBox.sendKeys(text);\n\t}", "@Override\n public void onClick(View v) {\n String userEnteredText = ((EditText) findViewById(R.id.editText)).getText().toString();\n\n // If the text field is empty , update label with default text string.\n if (userEnteredText.isEmpty()) {\n textView.setText(\"Enter your own text\");\n } else {\n textView.setText(userEnteredText);\n }\n }", "@Override\n public boolean onQueryTextSubmit(String arg0) {\n fetch(arg0);\n return false;\n }", "private void sendMessage(JTextField text){\n \t\tString message = text.getText();\n \t\tfor(int i = 0; i < listeners.size(); i++)\n \t\t{\n \t\t\tboolean b = listeners.get(i).sendMessage(userName, message);\n \t\t\tif(b == false)\n \t\t\t\tSystem.out.println(\"Error, could not send\");\n \t\t}\n \t\t\n \t\ttext.setText(\"\");\n \t}", "private void add_grant_perches_textActionPerformed(java.awt.event.ActionEvent evt) {\n }", "private void jTextFieldNomeActionPerformed(java.awt.event.ActionEvent evt) {\n }", "@Override\n \t\tpublic boolean onQueryTextSubmit(String query) {\n \t\t\t\t\n \t\t\treturn false;\n \t\t}", "private void btnSubmit_click(ActionEvent e) {\n\t\tString subjectName=txtSubjectName.getText();\n\t\tString STATUS=txtSTATUS.getText();\n\n\t\t//为空判断\n\t\tif(SysFun.isNullOrEmpty(subjectName)) {\n\t\t\tlblMsg.setText(\"提示:用户名不得为空!\");\n\t\t\treturn;\n\t\t}\n\t\tif(STATUS==null || STATUS.isEmpty()) {\n\t\t\tlblMsg.setText(\"提示:教室号不得为空!\");\n\t\t\treturn;\n\t\t}\n\t\t\n//\t\tLong or=0L;\n//\t\tif(rdoNo.isSelected()) {\n//\t\t\tor=0L;\n//\t\t}else if(rdoYes.isSelected()) {\n//\t\t\tor=1L;\n//\t\t}\n\n\t\tSubject item=subjectService.loadByName(subjectName);\n\t\t\n\t\tif(item!=null) {\n\t\t\tlblMsg.setText(\"提示:该管理员账号已存在!\");\n\t\t\treturn;\n\t\t}\n\t\tSubject bean=new Subject();\n\t\tbean.setSubjectName(subjectName);\n\t\tbean.setSTATUS(STATUS);\n\t\t\n\t\tLong result=0L;\n\t\tString errMsg=null;\n\t\ttry {\n\t\tresult=subjectService.insert(bean);\n\t\t}catch(Exception ex) {\n\t\t\terrMsg=ex.getMessage();\n\t\t}\n\t\t\n\t\tif(result>0) {\n\t\t\tJOptionPane.showMessageDialog(null, \"添加成功!\");\n\t\t\tif(subjectListFrm!=null) {\n\t\t\t\tsubjectListFrm.btnReset_click(null);\n\t\t\t\tsubjectListFrm.setVisible(true);\n\t\t\t}\n\t\t\tthis.dispose();\n\t\t}else {\n\t\t\tJOptionPane.showMessageDialog(null, \"添加失败!\");\n\t\t}\n\n\t\t\n\t\tif(subjectListFrm!=null) {\n\t\t\tsubjectListFrm.btnReset_click(null); \n\t\t\tsubjectListFrm.setVisible(true);\n\t\t}\n\t\tthis.dispose();\n\t}", "@Override\n public void actionPerformed(ActionEvent actionEvent) {\n String playerName=nameTextField.getText();\n String playerNumber=numberTextField.getText();\n String message=\"\";\n\n if(playerName.equals(\"\"))\n {\n message=\"the name field is empty! \\n\";\n }\n if(playerNumber.equals(\"\")||(Integer.parseInt(playerNumber)!=2&&(Integer.parseInt(playerNumber))!=3))\n {\n message+=\"Remember a game is composed by 2 or 3 players\";\n }\n if (actionEvent.getActionCommand().equals(\"submit\"))\n {\n Choice c=new PlayerNumberChoice(playerName,Integer.parseInt(playerNumber));\n view.setPlayerName(playerName);\n view.notify(c);\n submitButton.setEnabled(false);\n }\n else\n {\n JOptionPane.showMessageDialog(lobbyWindowFrame,message);\n }\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n String text = tweetInsertTextBox.getText();\n if (text != null && text.length() > 0) {\n jTextAreaTweets.setText(jTextAreaTweets.getText() + text + \"\\n\");\n tweetInsertTextBox.setText(\"\");\n jTextAreaTweets.setRows(jTextAreaTweets.getLineCount());\n tweetList.add(text);\n //f1.validate();\n }\n }", "public void actionPerformed(ActionEvent e)\r\n {\r\n out.println(textField.getText());\r\n textField.setText(\"\");\r\n }", "void actionButton ( ) throws IOException {\n String textOfField = this.gui.wdgInputText.getText();\n this.gui.widgOutput.append(\"Button1 \" + (++this.ctKeyStroke1) + \" time, text=\" + textOfField + \"\\n\");\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif (text.getText().isEmpty()) {\n\t\t\t\t\tJFrame frame = new JFrame();\n\t\t\t\t\tJLabel label = new JLabel(\"输入错误\", JLabel.CENTER);\n\t\t\t\t\tlabel.setFont(font);\n\t\t\t\t\tframe.add(label);\n\t\t\t\t\tframe.setLocation(900, 300);\n\t\t\t\t\tframe.setSize(500, 200);\n\t\t\t\t\tframe.setVisible(true);\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tDoctorResult result = new DoctorResult();\n\t\t\t\t\tresult.setOperate(op);\n\t\t\t\t\tresult.setEdit(text.getText());\n\t\t\t\t\tresult.Init();\n\t\t\t\t}\n\t\t\t}", "private void txtDisplayActionPerformed(java.awt.event.ActionEvent evt) {\n \n }", "private void txtNomenclaturaActionPerformed(java.awt.event.ActionEvent evt) {\n }", "@FXML\n private void _submitAnswer(ActionEvent _event) {\n Game currentGame = GameFactory.getCurrentGameInstance();\n currentGame.processAnswer(_answerInput.getText());\n Map<String, Object> data = currentGame.createMap();\n updateView(data);\n this._answerInput.setText(\"\");\n if (!currentGame.gameOver) {\n this._submitBtn.setDisable(true);\n this._nxtQuestion.setDisable(false);\n } else {\n this._submitBtn.setDisable(true);\n this._nxtQuestion.setDisable(true);\n }\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent event) {\n\t\t\t\tsendData(event.getActionCommand());//调用sendData方法,响应操作。\t将信息发送给客户\r\n\t\t\t\tenterField.setText(\"\"); //将输入区域置空\r\n\t\t\t}", "private void InterestJTextFieldActionPerformed(java.awt.event.ActionEvent evt) {\n }", "@Override\n public void onClick(View v) {\n String inputText = inputEditText.getText().toString();\n\n // Show the user's input text\n messageTextView.setText(inputText);\n\n }", "protected abstract void onSubmit(AjaxRequestTarget target, Form form);", "@Override\n public boolean onQueryTextSubmit(String query) {\n Log.i(TAG, \"on query submit: \" + query);\n return true;\n }", "private void txtKQActionPerformed(java.awt.event.ActionEvent evt) {\n }", "public boolean onQueryTextSubmit(String query) {\n return false;\n }", "private void nombretxtActionPerformed(java.awt.event.ActionEvent evt) {\n }", "private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {\n \n }", "@Override\n public boolean onSubmit(CharSequence input) {\n Author author =new Author();\n author.setId(\"2\");\n author.setName(\"Jubril\");\n Message message=new Message();\n message.setCreatedAt(new Date());\n message.setId(\"1\");\n message.setText(input.toString());\n message.setAuthor(author);\n adapter.addToStart(message, true);\n return true;\n }", "private void txtNomProdActionPerformed(java.awt.event.ActionEvent evt) {\n\n }", "public void Submit_prescription(View v){\n\t\tEditText pres = (EditText) findViewById(R.id.p_prescription);\n\t\tString newprescription = pres.getText().toString();\n\t\t\n\t\t\n\t\tFileOutputStream fop = null;\n\t\ttry {\n\t\t\tfop = new FileOutputStream( new File(this.getApplicationContext().getFilesDir(),\n\t\t\t\t\t\tFILENAME));\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t//check empty case\n\t\tif (newprescription.length() == 0){\n\t\t\tMissPIBox(v);\n\t\t}else if(patient.conditionsEmpty()){\n\t\t\tnoConditionBox(v);\n\t\t}\n\t\telse{\n\t\t\t//let physician edit the new prescription for the target vitalsign\n\t\t\tphysician.addPrescription(patient, newprescription);\n\t\t\tphysician.saveToFile(fop);\n\t\t\tSuccessfulBox(v);\n\t\t}\n\n\t}", "private void tfApellidoActionPerformed(java.awt.event.ActionEvent evt) {\n }", "private void jTextField13ActionPerformed(java.awt.event.ActionEvent evt) {\n }", "private void txt_nombreActionPerformed(java.awt.event.ActionEvent evt) {\n }", "public void setSubmit(String submit) {\n this.submit = submit;\n }", "public void clickOnSubmit() {\r\n\r\n\t\treportStep(\"About to click on Submit button \", \"INFO\");\r\n\r\n\t\tif(clickAfterWait(submitButton)) {\r\n\r\n\t\t\treportStep(\"Successfully clicked on the Submit button \", \"PASS\");\r\n\r\n\t\t}else {\r\n\t\t\tclickAfterWait(submitButton);\r\n\t\t\treportStep(\"Failed to click on the Submit button \", \"INFO\");\r\n\r\n\t\t}\r\n\t}", "@Override\n\tpublic void input(String text) {\n\t\t\n\t\tname = text;\n\t}", "@OnEditorAction(R.id.edit_text)\n public boolean onEditorAction (TextView v, int actionId, KeyEvent event) {\n if (actionId == EditorInfo.IME_ACTION_DONE) {\n mButtonSubmit2.performClick();\n return true;\n }\n return false;\n }", "private void jTextFieldTelefoneActionPerformed(java.awt.event.ActionEvent evt) {\n }", "public void performSubmit(Action action) {\n performSubmit(action, true);\n }", "public void actionPerformed (ActionEvent ae)\n {\n if (ae.getActionCommand().equals (\"Submit\"))\n {\n String name = nameField.getText();\n if (name.length() > 0)\n {\n HighScoreManager.scores.add (location,new HighScore (name,GameEngine.getLayoutAsString(),score));\n HighScoreManager.scores.remove (10);\n ((ActionListener)parent).actionPerformed (new ActionEvent (this, ActionEvent.ACTION_PERFORMED,\"Submit\"));\n }\n else\n {\n JOptionPane.showMessageDialog (this, \"You must input a name\", \"Name Error\", JOptionPane.ERROR_MESSAGE);\n }\n }\n }", "private void onValider() {\n recuperation​(Reponse.getText());\r\n\r\n }", "public void actionPerformed(ActionEvent event) {\n\t\t\tString userText = nameField.getText();\n\t\t\thelloLabel.setText(message + \" \" + userText);\n\t\t\tclickButton.setEnabled(false);\n\t\t\tnameField.setEditable(false);\n\t\t}", "@Override\n public void onClick(View view) {\n if ( checkValidation () )\n submitForm();\n \n }", "private void submitForm() {\n final Dialog dialog = new Dialog(context);\n\t\t dialog.setContentView(R.layout.dialogbox);\n\t\t dialog.setTitle(\"Sucess!\");\n\t\t dialog.setCancelable(false);\n\t dialog.setCanceledOnTouchOutside(false);\n\t\t TextView txt = (TextView) dialog.findViewById(R.id.errorlog);\n\t\t txt.setText(\"Registration Successfull.\");\n\t\t Button dialogButton = (Button) dialog.findViewById(R.id.release);\n\t\t dialogButton.setOnClickListener(new OnClickListener() {\n\t\t\t public void onClick(View vd) {\n\t\t\t\t change.setEnabled(true);\n\t\t\t\t dialog.dismiss();\n\t\t\n\t\t}\n\t\t});\n\t\t dialog.show();\n}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(e.getSource()==sendButton){\n\t\t\tif(!inputField.getText().trim().isEmpty()){\n\t\t\t\ttry{\n\t\t\t\t\tclient.sendRequest(inputField.getText().trim());\n\t\t\t\t}catch(Exception ee){\n\t\t\t\t\tee.printStackTrace();\n\t\t\t\t}\n\t\t\t\toutputArea.append(client.getResponse()+\"\\n\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tJOptionPane.showConfirmDialog(this, \"输入不能为空!\");\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tinputField.setText(\"\");\n\t\t\toutputArea.setText(\"\");\n\t\t}\n\t}" ]
[ "0.8139478", "0.7695989", "0.761549", "0.6559422", "0.62833065", "0.6247281", "0.62422806", "0.6209692", "0.61793965", "0.61535156", "0.6114862", "0.61136705", "0.60990274", "0.6096528", "0.6096066", "0.6078686", "0.60772824", "0.6067253", "0.6067033", "0.6063585", "0.6063439", "0.60606545", "0.6055205", "0.6047924", "0.6028665", "0.6004419", "0.6003354", "0.6002432", "0.5993591", "0.59520423", "0.5941516", "0.59256846", "0.59153396", "0.58972484", "0.58911365", "0.58823377", "0.5882279", "0.586583", "0.5857287", "0.585616", "0.58444095", "0.5831594", "0.5825086", "0.58246434", "0.5823181", "0.58221275", "0.58221275", "0.5818919", "0.58043146", "0.58043146", "0.57995415", "0.5790651", "0.5776629", "0.57691497", "0.5766936", "0.57573247", "0.5752136", "0.5745433", "0.5743839", "0.5743495", "0.5739151", "0.5726514", "0.5724494", "0.5721003", "0.5720339", "0.57185346", "0.57120126", "0.5702533", "0.5691562", "0.56870866", "0.56866896", "0.56750995", "0.5674197", "0.56728673", "0.565879", "0.56487316", "0.563756", "0.5635373", "0.56342417", "0.5630961", "0.56278414", "0.5620421", "0.5616719", "0.5615018", "0.5613348", "0.56092036", "0.56071615", "0.56065094", "0.56054276", "0.5601074", "0.5600526", "0.5599456", "0.5598651", "0.5597987", "0.5590374", "0.55901736", "0.5589719", "0.558586", "0.5585313", "0.5577948", "0.5576334" ]
0.0
-1
Handles album search feature. Filters albums on device by user input.
@Override public boolean onQueryTextChange(String userInput) { filterAudio(userInput); SingletonController.getInstance().setFilter(userInput); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void displayFilteredAlbums();", "List<AlbumVO> searchAlbum(String searchText) throws Exception;", "public void searchByAlbum()\n {\n String input = JOptionPane.showInputDialog(null,\"Enter the album you'd like to search for:\");\n input = input.replaceAll(\" \", \"_\").toUpperCase();\n \n Collections.sort(catalog);\n int index = Collections.binarySearch(catalog, new Album(\"\",input,null), null);\n if(index >= 0)\n System.out.println(\"Album:\\t\" + catalog.get(index).getAlbum()\n + \"\\nArtist: \" + catalog.get(index).getArtist()+\"\\n\");\n else System.err.println(\"Album '\" + input + \"' not found!\\n\"); \n }", "public ArrayList <ITunesItem> getAlbums(String searchText) throws IOException\n\t{\n\t\tsearchText = searchText.replace(\" \", \"+\");\n\t\tString query = \"term=\" + searchText + \"&entity=album&attribute=albumTerm\";\n\t\treturn searchQuery(query);\n\t}", "void displayAlbums(FilterableAlbum[] albums);", "@FXML\n private void handleFilter(ActionEvent event) {\n if(!inSearch){\n btnFind.setImage(imageC);\n //query here\n String querry = txtInput.getText();\n if(querry !=null){\n obsSongs = FXCollections.observableArrayList(bllfacade.querrySongs(querry));\n lstSongs.setItems(obsSongs);\n }\n inSearch = true;\n }else{\n btnFind.setImage(imageF); \n txtInput.setText(\"\");\n init();\n inSearch = false;\n }\n }", "public void searchByArtist()\n {\n String input = JOptionPane.showInputDialog(null,\"Enter the artist you'd like to search for:\");\n input = input.replaceAll(\" \", \"_\").toUpperCase(); //standardize output.\n \n Collections.sort(catalog, new ArtistComparator());\n int index = Collections.binarySearch(catalog, \n new Album(input,\"\",null), new ArtistComparator());\n //Since an artist could be listed multiple times, there is *no guarantee*\n //which artist index we find. So, we have to look at the artists\n //left and right of the initial match until we stop matching.\n if(index >= 0)\n {\n Album initial = catalog.get(index);\n String artist = initial.getArtist();\n \n ArrayList<Album> foundAlbums = new ArrayList<>();\n //this ArrayList will have only the albums of our found artist \n foundAlbums.add(initial);\n try { \n int j = index, k = index;\n while(artist.equalsIgnoreCase(catalog.get(j+1).getArtist()))\n {\n foundAlbums.add(catalog.get(j+1));\n j++;\n }\n while(artist.equalsIgnoreCase(catalog.get(k-1).getArtist()))\n {\n foundAlbums.add(catalog.get(k-1));\n k--;\n }\n }\n catch(IndexOutOfBoundsException e) {\n //happens on the last round of the while-loop test expressions\n //don't do anyhting because now we need to print out our albums.\n }\n System.out.print(\"Artist: \" + artist + \"\\nAlbums: \");\n for(Album a : foundAlbums)\n System.out.print(a.getAlbum() + \"\\n\\t\");\n System.out.println();\n }\n else System.err.println(\"Artist '\" + input + \"' not found!\\n\"); \n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_search_page);\n\n //loadAlbums();\n\n //contextOfApplication = getApplicationContext();\n artist = getIntent().getStringExtra(\"SEARCHED_ARTIST\");\n\n getArtistAlbums(artist);\n\n listView = (ListView) findViewById(R.id.albumsListView);\n adapter = new CustomAlbumsListViewAdapter(TopAlbums.this, R.layout.album_list_row, albums);\n listView.setAdapter(adapter);\n\n\n }", "@GET\n public Iterator<Album> searchByName(@QueryParam(\"name\") String name) {\n return null;\n }", "public SearchResults search(Context context, String searchText) {\n\n List<Song> songs = new LinkedList<Song>();\n\n String[] columns = new String[]{MediaStore.MediaColumns._ID,\n MediaStore.Audio.Media.TITLE,\n MediaStore.Audio.Artists.ARTIST,\n MediaStore.Audio.Albums.ALBUM,\n MediaStore.Audio.Media.DATA,\n MediaStore.Audio.Albums.ALBUM_ID};\n\n // Clauses for title album and artist\n String titleSelectionClause = MediaStore.Audio.Media.TITLE + \" LIKE ?\";//\" = ?\";\n String albumSelectionClause = MediaStore.Audio.Albums.ALBUM + \" LIKE ?\";//\" = ?\";\n String artistSelectionClause = MediaStore.Audio.Artists.ARTIST + \" LIKE ?\";//\" = ?\";\n\n // Selection arg\n String[] selectionArg = {searchText};\n\n // Run queries\n List<Song> titleSearch = internalExternalQuery(context, columns, titleSelectionClause, selectionArg);\n List<Song> albumSearch = internalExternalQuery(context, columns, albumSelectionClause, selectionArg);\n List<Song> artistSearch = internalExternalQuery(context, columns, artistSelectionClause, selectionArg);\n\n return new SearchResults(titleSearch, albumSearch, artistSearch);\n }", "@FXML\n\tprivate void searchByTag(ActionEvent event) throws IOException {\n\t\tArrayList<Photo> searchResults = new ArrayList<Photo>();\n\t\tif(andOrList.getSelectionModel().isEmpty()) {\n\t\t\tif(firstTagKey.getSelectionModel().isEmpty() || (firstTagValue.getText() == null || firstTagValue.getText().trim().isEmpty())) {\n\t\t\t\tAlert error = new Alert(AlertType.ERROR);\n\t\t\t\terror.setTitle(\"Error\");\n\t\t\t\terror.setHeaderText(\"Tag Search Error\");\n\t\t\t\terror.setContentText(\"No tag type is selected or a tag value has not been entered.\");\n\t\t\t\terror.showAndWait();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfor(int i = 0; i<userAdmin.getUser(username).getAlbums().size();i++) {\n\t\t\t\t\tfor(int j =0; j<userAdmin.getUser(username).getAlbums().get(i).getPhotos().size();j++) {\n\t\t\t\t\t\tfor(int k = 0; k<userAdmin.getUser(username).getAlbums().get(i).getPhotos().get(j).getTags().size(); k++){\n\t\t\t\t\t\t\tif(userAdmin.getUser(username).getAlbums().get(i).getPhotos().get(j).getTags().get(k).getKeyTag().toLowerCase().equals(firstTagKey.getSelectionModel().getSelectedItem().toLowerCase()) && userAdmin.getUser(username).getAlbums().get(i).getPhotos().get(j).getTags().get(k).getValueTag().toLowerCase().equals(firstTagValue.getText().toLowerCase())) {\n\t\t\t\t\t\t\t\tsearchResults.add(userAdmin.getUser(username).getAlbums().get(i).getPhotos().get(j));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif(firstTagKey.getSelectionModel().isEmpty() || (firstTagValue.getText() == null || firstTagValue.getText().trim().isEmpty()) || secondTagKey.getSelectionModel().isEmpty() || (secondTagValue.getText() == null || secondTagValue.getText().trim().isEmpty()) ) {\n\t\t\t\tAlert error = new Alert(AlertType.ERROR);\n\t\t\t\terror.setTitle(\"Error\");\n\t\t\t\terror.setHeaderText(\"Tag Search Error\");\n\t\t\t\terror.setContentText(\"Tag type or Tag Values are empty.\");\n\t\t\t\terror.showAndWait();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(andOrList.getSelectionModel().getSelectedItem().equals(\"or\")){\n\t\t\t\t\tfor(int i = 0; i<userAdmin.getUser(username).getAlbums().size();i++) {\n\t\t\t\t\t\tfor(int j =0; j<userAdmin.getUser(username).getAlbums().get(i).getPhotos().size();j++) {\n\t\t\t\t\t\t\tfor(int k = 0; k<userAdmin.getUser(username).getAlbums().get(i).getPhotos().get(j).getTags().size(); k++){\n\t\t\t\t\t\t\t\tif((userAdmin.getUser(username).getAlbums().get(i).getPhotos().get(j).getTags().get(k).getKeyTag().toLowerCase().equals(firstTagKey.getSelectionModel().getSelectedItem().toLowerCase())\n\t\t\t\t\t\t\t\t\t&& userAdmin.getUser(username).getAlbums().get(i).getPhotos().get(j).getTags().get(k).getValueTag().toLowerCase().equals(firstTagValue.getText().toLowerCase())) \n\t\t\t\t\t\t\t\t\t|| userAdmin.getUser(username).getAlbums().get(i).getPhotos().get(j).getTags().get(k).getKeyTag().toLowerCase().equals(secondTagKey.getSelectionModel().getSelectedItem().toLowerCase())\n\t\t\t\t\t\t\t\t\t&& userAdmin.getUser(username).getAlbums().get(i).getPhotos().get(j).getTags().get(k).getValueTag().toLowerCase().equals(secondTagValue.getText().toLowerCase())){\n\t\t\t\t\t\t\t\t\tsearchResults.add(userAdmin.getUser(username).getAlbums().get(i).getPhotos().get(j));\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfor(int i = 0; i<userAdmin.getUser(username).getAlbums().size();i++) {\n\t\t\t\t\t\tfor(int j =0; j<userAdmin.getUser(username).getAlbums().get(i).getPhotos().size();j++) {\n\t\t\t\t\t\t\tfor(int k = 0; k<userAdmin.getUser(username).getAlbums().get(i).getPhotos().get(j).getTags().size(); k++){\n\t\t\t\t\t\t\t\tif(userAdmin.getUser(username).getAlbums().get(i).getPhotos().get(j).getTags().get(k).getKeyTag().toLowerCase().equals(firstTagKey.getSelectionModel().getSelectedItem().toLowerCase())\n\t\t\t\t\t\t\t\t\t\t&& userAdmin.getUser(username).getAlbums().get(i).getPhotos().get(j).getTags().get(k).getValueTag().toLowerCase().equals(firstTagValue.getText().toLowerCase())){\n\t\t\t\t\t\t\t\t\tfor(int l=0;l<userAdmin.getUser(username).getAlbums().get(i).getPhotos().get(j).getTags().size(); l++) {\n\t\t\t\t\t\t\t\t\t\tif(userAdmin.getUser(username).getAlbums().get(i).getPhotos().get(j).getTags().get(l).getKeyTag().toLowerCase().equals(secondTagKey.getSelectionModel().getSelectedItem().toLowerCase())\n\t\t\t\t\t\t\t\t\t\t\t\t&& userAdmin.getUser(username).getAlbums().get(i).getPhotos().get(j).getTags().get(l).getValueTag().toLowerCase().equals(secondTagValue.getText().toLowerCase())) {\n\t\t\t\t\t\t\t\t\t\t\tsearchResults.add(userAdmin.getUser(username).getAlbums().get(i).getPhotos().get(j));\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(searchResults.isEmpty()) {\n\t\t\tAlert alert = new Alert(AlertType.INFORMATION);\n\t\t\talert.setTitle(\"Search Results\");\n\t\t\talert.setHeaderText(\"Search Results\");\n\t\t\talert.setContentText(\"No photos were found that match your criteria.\");\n\t\t\talert.showAndWait();\n\t\t}\n\t\telse {\n\t\t\tfor(int i = 0; i<searchResults.size();i++) {\n\t\t\t\tfor(int j =i+1;j<searchResults.size();j++) {\n\t\t\t\t\tif(searchResults.get(i).getFilepath().toString().equals(searchResults.get(j).getFilepath().toString())){\n\t\t\t\t\t\tsearchResults.remove(j);\n\t\t\t\t\t\tj--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(andOrList.getSelectionModel().isEmpty()) {\n\t\t\t\tSearchResultsController.search = firstTagKey.getValue().toString() + \":\" + firstTagValue.getText().toString();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSearchResultsController.search = firstTagKey.getValue().toString() + \":\" + firstTagValue.getText().toString() + \" \" + andOrList.getValue().toString() + \" \" + secondTagKey.getValue().toString() + \":\" + secondTagValue.getText().toString(); \n\t\t\t}\n\t\t\tSearchResultsController.username = username;\n\t\t\tSearchResultsController.searchResults = searchResults;\n\t\t\tFXMLLoader loader = new FXMLLoader();\n\t\t\tloader.setLocation(getClass().getClassLoader().getResource(\"view/SearchResultsView.fxml\"));\n\t\t\tPane pane = (Pane)loader.load();\n\t\t\tSearchResultsController src = loader.getController();\n\t\t\tStage stage = new Stage();\n\t\t\tsrc.start(stage);\n\t\t\tstage.setTitle(\"Search Results\");\n\t\t\tstage.setScene(new Scene(pane));\n\t\t\tstage.setResizable(false);\n\t\t\tstage.show();\n\t\t\t((Node)(event.getSource())).getScene().getWindow().hide();\n\t\t}\n\t}", "void navigateToDisplayActivity(Integer[] filteredAlbumsIds);", "private void doSearch(String query, boolean art,\n boolean music,\n boolean tech,\n boolean careers,\n boolean culture,\n boolean sports,\n boolean science,\n boolean education){\n ArrayList<String> categories = new ArrayList<String>();\n if(art) categories.add(\"Art\");\n if(music) categories.add(\"Music\");\n if(tech) categories.add(\"Tech\");\n if(careers) categories.add(\"Careers\");\n if(culture) categories.add(\"Culture\");\n if(sports) categories.add(\"Sports\");\n if(science) categories.add(\"Science\");\n if(education) categories.add(\"Education\");\n\n //if none selected search for all categories\n if(!art && !music && !tech && !careers && !culture && !sports && !science && !education){\n categories.add(\"Art\");\n categories.add(\"Music\");\n categories.add(\"Tech\");\n categories.add(\"Careers\");\n categories.add(\"Culture\");\n categories.add(\"Sports\");\n categories.add(\"Science\");\n categories.add(\"Education\");\n }\n eventServices.searchEventFeed(query, null, null, categories, new AppCallback<List<Event>>() {\n @Override\n public void call(final List<Event> events) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n eventList.addAll(events);\n adapter.notifyDataSetChanged();\n }\n });\n }\n\n @Override\n public void call() {\n\n }\n });\n\n// Log.d(TAG, \"doSearch: \" + query + \" \" + SearchActivity.DATE_RANGE_LABELS[dateRange] + \" \");\n adapter.notifyDataSetChanged();\n }", "public abstract void performSearch(SearchCaller caller, SearchManager manager, Connection connection, MediaSearch mediaSearch);", "@FXML\n public void handleSearchButton(ActionEvent event) throws ClassNotFoundException, IOException {\n Album temp = new Album(\"temp\");\n if (cList.getItems().size() == 0 && (startDate.getValue() == null || endDate.getValue() == null)) {\n alert(\"Error\", \"Miss search criteria.\", \"Please add the search criteria first.\");\n return;\n }\n\n if ((startDate.getValue() != null && endDate.getValue() == null) ||\n (startDate.getValue() == null && endDate.getValue() != null) ||\n (startDate.getValue() != null && startDate.getValue().isAfter(endDate.getValue()))) {\n error(\"Please enter valid date range\");\n }\n if (obsList.isEmpty() && startDate.getValue() != null && endDate.getValue() != null) {\n for (Album a : albums) {\n ArrayList<Photo> photos = new ArrayList<Photo>();\n photos = (ArrayList<Photo>) a.getPhotos();\n for (Photo p : photos) {\n ArrayList<Tag> tags2 = new ArrayList<Tag>();\n tags2 = (ArrayList<Tag>) p.getTags();\n if (p.isWithinDateRange(startDate.getValue(), endDate.getValue())) {\n boolean exists = false;\n SerializableImage tempImage = new SerializableImage();\n tempImage.setImage(p.getImage());\n for (Photo p2 : temp.getPhotos()) {\n if (tempImage.equals(p2.getSerializableImage())) {\n exists = true;\n }\n }\n if (exists == false) {\n temp.addPhoto(p);\n }\n }\n }\n }\n\n } else if (!(obsList.isEmpty()) && startDate.getValue() == null && endDate.getValue() == null) {\n boolean containsAllTags = true;\n boolean containsTag = false;\n for (Album a : albums) {\n ArrayList<Photo> photos = new ArrayList<Photo>();\n photos = (ArrayList<Photo>) a.getPhotos();\n for (Photo p : photos) {\n containsAllTags = true;\n containsTag = false;\n ArrayList<Tag> tags2 = new ArrayList<Tag>();\n tags2 = (ArrayList<Tag>) p.getTags();\n for (Tag c : tags) {\n for (Tag t : tags2) {\n if (t.getType().equals(c.getType()) && t.getValue().equals(c.getValue())) {\n containsTag = true;\n }\n }\n containsAllTags = containsAllTags && containsTag;\n containsTag = false;\n }\n if (containsAllTags) {\n boolean exists = false;\n SerializableImage tempImage = new SerializableImage();\n tempImage.setImage(p.getImage());\n for (Photo p2 : temp.getPhotos()) {\n if (tempImage.equals(p2.getSerializableImage())) {\n exists = true;\n }\n }\n if (!exists) {\n temp.addPhoto(p);\n }\n }\n }\n }\n } else {\n for (Album a : albums) {\n boolean containsAllTags = true;\n boolean containsTag = false;\n ArrayList<Photo> photos = new ArrayList<Photo>();\n photos = (ArrayList<Photo>) a.getPhotos();\n for (Photo p : photos) {\n if (p.isWithinDateRange(startDate.getValue(), endDate.getValue())) {\n containsAllTags = true;\n containsTag = false;\n ArrayList<Tag> tags2 = new ArrayList<Tag>();\n tags2 = (ArrayList<Tag>) p.getTags();\n for (Tag c : tags) {\n for (Tag t : tags2) {\n if (t.getType().equals(c.getType()) && t.getValue().equals(c.getValue())) {\n containsTag = true;\n }\n }\n containsAllTags = containsAllTags && containsTag;\n containsTag = false;\n }\n if (containsAllTags) {\n boolean exists = false;\n SerializableImage tempImage = new SerializableImage();\n tempImage.setImage(p.getImage());\n for (Photo p2 : temp.getPhotos()) {\n if (tempImage.equals(p2.getSerializableImage())) {\n exists = true;\n }\n }\n if (!exists) {\n temp.addPhoto(p);\n }\n }\n }\n }\n }\n\n }\n Parent parent;\n FXMLLoader loader = new FXMLLoader(getClass().getResource(\"/View/SearchResults.fxml\"));\n parent = (Parent) loader.load();\n\n SearchResultsController ctrl = loader.getController();\n Scene scene = new Scene(parent);\n\n Stage app_stage = (Stage) ((Node) event.getSource()).getScene().getWindow();\n\n ctrl.start(app_stage, currentUser, temp);\n\n app_stage.setScene(scene);\n app_stage.show();\n\n\n }", "public void search() {\n String q = this.query.getText();\n String cat = this.category.getValue();\n if(cat.equals(\"Book\")) {\n searchBook(q);\n } else {\n searchCharacter(q);\n }\n }", "@Override\n public boolean onQueryTextSubmit(String query) {\n //wenn auf button geklickt wird suchen\n songList.clear();\n\n //jetzt filtern nach querry, dafuer neue Liste\n List<Song> temp = new ArrayList<>();\n temp.addAll(songListBackup);\n for (Song song : temp) {\n if (song.getTitle().contains(query)) {\n songList.add(song);\n }\n }\n\n songView.setAdapter(new SongAdapter(songList));\n return true;\n }", "public void search() throws ParseException {\n for(Album a : user.getAlbums()){\n for(Photo p : a.getPhotos()){\n tempAlbum.addPhoto(p);\n }\n }\n\n fromDateFilter();\n toDateFilter();\n tagFilter();\n\n\n ObservableList<Photo> filteredList = FXCollections.observableArrayList();\n\n for(Photo p : tempAlbum.getPhotos()){\n filteredList.add(p);\n }\n\n resultsListView.setItems(filteredList);\n\n resultsListView.setCellFactory(param -> new ListCell<Photo>() {\n\n private ImageView imageView = new ImageView();\n @Override\n public void updateItem(Photo name, boolean empty) {\n super.updateItem(name, empty);\n if(empty){\n setText(null);\n setGraphic(null);\n }else{\n try {\n imageView.setImage(new Image(new FileInputStream(name.getLocation())));\n imageView.setFitHeight(50);\n imageView.setFitWidth(50);\n imageView.setPreserveRatio(true);\n setText(name.toString());\n setGraphic(imageView);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n }\n\n }\n });\n\n }", "private void performSearch() {\n try {\n final String searchVal = mSearchField.getText().toString().trim();\n\n if (searchVal.trim().equals(\"\")) {\n showNoStocksFoundDialog();\n }\n else {\n showProgressDialog();\n sendSearchResultIntent(searchVal);\n }\n }\n catch (final Exception e) {\n showSearchErrorDialog();\n logError(e);\n }\n }", "public static int search (String searching)\n {\n ListAlbum listAlbum = new ListAlbum(true, false, false);\n AlbumXmlFile.readAllAlbumsFromDataBase(listAlbum, true);\n Iterator albumIterator = listAlbum.iterator();\n Album actualAlbum;\n int actualAlbumIndex=0;\n while (albumIterator.hasNext())\n {\n \n actualAlbum = (Album) albumIterator.next();\n \n if (actualAlbum.getName().equals(searching))\n {\n JSoundsMainWindowViewController.showAlbumResults(true, false, false, actualAlbum);\n JSoundsMainWindow.jtfSearchSong.setText(\"\");\n return 1;\n }\n else if (actualAlbum.getArtist().getName().equals(searching))\n {\n JSoundsMainWindowViewController.showAlbumResults(true, false, false, actualAlbum);\n JSoundsMainWindow.jtfSearchSong.setText(\"\");\n return 1;\n }\n actualAlbum.getSongs();\n Iterator songsIterator = actualAlbum.getSongs().iterator();\n int actualSongIndex = 0;\n\n while (songsIterator.hasNext())\n {\n /* Se añade el número de la canción al modelo de la lista */\n Song song = (Song) songsIterator.next();\n if (song.getName().equals(searching))\n {\n JSoundsMainWindowViewController.showSongResults(true, false, false, actualAlbum,song,actualSongIndex);\n JSoundsMainWindow.jtfSearchSong.setText(\"\");\n indexFromSearchedSong=actualSongIndex;\n if (alreadyPlaying)\n {\n JSoundsMainWindowViewController.stopSong();\n alreadyPlaying=false;\n dontInitPlayer=true;\n }\n //playListSongs(true);\n return 1;\n }\n actualSongIndex++;\n }\n actualAlbumIndex++;\n }\n JSoundsMainWindow.jtfSearchSong.setText(\"\");\n JOptionPane.showMessageDialog(null, \"Not Found :( \");\n return 0;\n }", "@Override\n public boolean onQueryTextSubmit(final String query) {\n Log.i(TAG, \"onQueryTextSubmit '\" + query + \"'\");\n mArtistSearch.clearFocus();\n mLatestQuery = query;\n\n mMusicServiceConnection.whenConnected(new Runnable() {\n @Override\n public void run() {\n mMusicServiceConnection.getService().findArtists(query);\n }\n });\n return true;\n }", "List<SongVO> searchSong(String searchText) throws Exception;", "private void queryMusic(String term, String media) {\n //show progress bar while loading\n progressBar.setVisibility(View.VISIBLE);\n //checks if there's an internet\n if (isNetworkConnected()) {\n //Query to itunes api\n viewModel.getSearchData(term, userProfile.getCountryCode(), media, userProfile.isEnableExplicit() ? \"Yes\" : \"No\").observe(getViewLifecycleOwner(), baseResponseResource -> {\n switch (baseResponseResource.status) {\n case LOADING:\n break;\n case SUCCESS:\n //Get the data from the db\n getDataFromDb();\n progressBar.setVisibility(View.GONE);\n break;\n\n case CLIENT_ERROR:\n case SERVER_ERROR:\n resultsRv.setVisibility(View.GONE);\n progressBar.setVisibility(View.GONE);\n resultText.setVisibility(View.VISIBLE);\n// Log.d(TAG, \"getDashboard: fail\" + new GsonBuilder().create().toJson(baseResponseResource));\n break;\n }\n });\n } else {\n //Loads the last data from the db\n getDataFromDb();\n Toast.makeText(getActivity(), getString(R.string.no_internet),Toast.LENGTH_LONG).show();\n }\n }", "void loadAlbums();", "Observable<AlbumList> browseAlbums(String pagingState, Integer items, String facets, String userId);", "public void recreateSearchIndicies() throws MediaAlbumException;", "public void performSearch() {\n History.newItem(MyWebApp.SEARCH_RESULTS);\n getMessagePanel().clear();\n if (keywordsTextBox.getValue().isEmpty()) {\n getMessagePanel().displayMessage(\"Search term is required.\");\n return;\n }\n mywebapp.getResultsPanel().resetSearchParameters();\n //keyword search does not restrict to spots\n mywebapp.addCurrentLocation();\n if (markFilterCheckbox != null) {\n mywebapp.getResultsPanel().getSearchParameters().setLicensePlate(markFilterCheckbox.getValue());\n }\n if (contestFilterCheckbox != null) {\n mywebapp.getResultsPanel().getSearchParameters().setContests(contestFilterCheckbox.getValue());\n }\n if (geoFilterCheckbox != null) {\n mywebapp.getResultsPanel().getSearchParameters().setGeospatialOff(!geoFilterCheckbox.getValue());\n }\n if (plateFilterCheckbox != null) {\n mywebapp.getResultsPanel().getSearchParameters().setLicensePlate(plateFilterCheckbox.getValue());\n }\n if (spotFilterCheckbox != null) {\n mywebapp.getResultsPanel().getSearchParameters().setSpots(spotFilterCheckbox.getValue());\n }\n String color = getValue(colorsListBox);\n mywebapp.getResultsPanel().getSearchParameters().setColor(color);\n String manufacturer = getValue(manufacturersListBox);\n if (manufacturer != null) {\n Long id = new Long(manufacturer);\n mywebapp.getResultsPanel().getSearchParameters().setManufacturerId(id);\n }\n String vehicleType = getValue(vehicleTypeListBox);\n mywebapp.getResultsPanel().getSearchParameters().setVehicleType(vehicleType);\n// for (TagHolder tagHolder : tagHolders) {\n// mywebapp.getResultsPanel().getSearchParameters().getTags().add(tagHolder);\n// }\n mywebapp.getResultsPanel().getSearchParameters().setKeywords(keywordsTextBox.getValue());\n mywebapp.getMessagePanel().clear();\n mywebapp.getResultsPanel().performSearch();\n mywebapp.getTopMenuPanel().setTitleBar(\"Search\");\n //mywebapp.getResultsPanel().setImageResources(resources.search(), resources.searchMobile());\n }", "public void onSearchCompleted(String searchString, List<Photo> photos);", "public void handleSearch(ActionEvent actionEvent) {\n\t\tRadioButton radio = (RadioButton) toogleSearch.getSelectedToggle();\n\t\tString searchString = txtSearch.getText();\n\t\tObservableList<Item> itemList;\n\t\tif(radio == radioID){\n\t\t\ttry {\n\t\t\t\titemList = ItemDAO.searchItemById(searchString);\n\t\t\t\tpopulateItems(itemList);\n\t\t\t} catch (SQLException e) {\n\t\t\t\tExp.displayException(e);\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\tExp.displayException(e);\n\t\t\t}\n\t\t} else if(radio == radioName){\n\t\t\ttry {\n\t\t\t\titemList = ItemDAO.searchItemByName(searchString);\n\t\t\t\tpopulateItems(itemList);\n\t\t\t} catch (SQLException e) {\n\t\t\t\tExp.displayException(e);\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\tExp.displayException(e);\n\t\t\t}\n\t\t} else {\n\t\t\ttry {\n\t\t\t\titemList = ItemDAO.searchItemByLocation(searchString);\n\t\t\t\tpopulateItems(itemList);\n\t\t\t} catch (SQLException e) {\n\t\t\t\tExp.displayException(e);\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\tExp.displayException(e);\n\t\t\t}\n\t\t}\n\n\n\n\t}", "@Override\n public boolean onQueryTextChange(String s) {\n if(s.isEmpty() && amenList.isEmpty()){\n searchResultsCard.setVisibility(View.GONE);\n }else {\n searchResultsCard.setVisibility(View.VISIBLE);\n }\n placesAdaptor.getFilter( ).filter(s);\n //if no results available, hide the result card\n //self-checking if there is any results, as filter results only available after\n //this method ends\n boolean noResult=true;\n ArrayList<PlacesDataClass> tempFilter=placesAdaptor.getFiltered( );\n if(tempFilter.isEmpty()) {\n ArrayList<String> temp_filter=new ArrayList<String>(Arrays.asList(placesName));\n for(String a:temp_filter){\n if(a.toLowerCase().contains(s.toLowerCase())){\n noResult=false;\n }\n }\n }else {\n for (PlacesDataClass object : tempFilter) {\n // the filtering itself:\n if (object.toString( ).toLowerCase( ).contains(s.toLowerCase( )))\n noResult=false;\n }\n }//if no results available then display the no results text\n if (noResult) {\n noResultsFoundText.setVisibility(View.VISIBLE);\n } else noResultsFoundText.setVisibility(View.GONE);\n Log.i(\"results number\", \"query: \"+s+\"; no result: \"+noResult);\n // ---------------Change-----------------\n while (!origin.isEmpty( )) {\n origin.remove(0);\n }\n\n return false;\n }", "@Override\r\n\tpublic ResponseWrapper searchMedia(RequestWrapper request ) {\r\n\r\n\t\tIHandler handler = HandlerFactory.getHandler(request.getcategoryType());\r\n\t\t\t\t\t\t\r\n\t\tResponseWrapper response = handler.search(request);\r\n\t\treturn response;\r\n\t}", "public void performSearch() {\n OASelect<QueryInfo> sel = getQueryInfoSearch().getSelect();\n sel.setSearchHub(getSearchFromHub());\n sel.setFinder(getFinder());\n getHub().select(sel);\n }", "public void search(String query) {\n Log.i(TAG, \"search: \" + query);\n artistInteractor.searchInItunes(query, this);\n }", "public static void showAlbumResults(boolean orderByArtist, boolean orderByAlbum, boolean orderByYear, Album album)\n {\n updateOrderButtons(orderByArtist, orderByAlbum, orderByYear);\n \n JSoundsMainWindowViewController.removeAllElementsInContainer();\n \n DefaultTableModel model = new DefaultTableModel(createDataForAlbumResults(orderByArtist,orderByAlbum,orderByYear,true,album), columnNames);\n table.setModel(model);\n setTableWithData();\n \n DefaultTableModel dm = (DefaultTableModel) JSoundsMainWindowViewController.table.getModel();\n int i = dm.getRowCount() - 1;\n boolean found = false;\n \n while (!found && i >= 0)\n {\n JMusicList actualList = (JMusicList) dm.getValueAt(i, JSoundsMainWindowViewController.LIST_SONG_COLUMN);\n \n if (actualList.equals(JSoundsMainWindowViewController.jlActualListSongs))\n {\n JSoundsMainWindowViewController.jlActualListSongs = actualList;\n found = true;\n }\n else\n i--;\n } \n \n if (found)\n MusicPlayerControl.updateContainerInformation(jlActualListSongs, jlActualListSongs.getjLLastPlayedSongList(), table, JSoundsMainWindowViewController.jlActualListSongs.getRowInJTable());\n }", "private void search(String query) {\n final List<Artist> foundartists = new ArrayList<Artist>();\n final String usrquery = query;\n\n spotifysvc.searchArtists(query, new Callback<ArtistsPager>() {\n @Override\n public void success(ArtistsPager artists, Response response) {\n List<Artist> artistlist = artists.artists.items;\n Log.d(LOG_TAG_API, \"found artists [\" + artistlist.size() + \"]: \" + artistlist.toString());\n datalist.clear();\n\n if (artistlist.size() > 0) {\n setListdata(artistlist);\n } else {\n Toast.makeText(getActivity(), \"no artists found by the name: \" + usrquery, Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void failure(RetrofitError error) {\n Log.e(LOG_TAG_API, \"failed to retrieve artists:\\n\" + error.toString());\n Toast.makeText(getActivity(), \"failed to retrieve artists. Possible network issues?: \", Toast.LENGTH_SHORT).show();\n }\n });\n }", "public void apiFindSongReverseSearchApple(Messenger handler, Song song, int playlistPos){\n String termSearch = (song.getArtist() + \"+\" + song.getTrack());\n termSearch = termSearch.replace(\"&\", \"\");\n termSearch = termSearch.replace(\"?\", \"\");\n termSearch = termSearch.replace(\"#\", \"\");\n termSearch.replace(' ', '+');\n Log.v(TAG, \"Term Search: \" + termSearch);\n\n Request request = new Request.Builder()\n .url(getString(R.string.api_apple_search_track) + \"?term=\"+termSearch+\"&limit=20\"+\"&types=songs\")\n .header(\"Authorization\", \"Bearer \"+ getString(R.string.apple_dev_token))\n .build();\n\n try(Response response = client.newCall(request).execute()){\n if(response.isSuccessful()){\n String res = response.body().string();\n //Log.v(TAG,\"Apple Music Find Songs Response: \" + res);\n appleMusicMatchSong(handler,res,playlistPos,song,true);\n } else {\n Log.v(TAG,\"Failed \" + response.toString());\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void txtSearchingBrandKeyReleased(java.awt.event.KeyEvent evt) {\n String query=txtSearchingBrand.getText().toUpperCase();\n filterData(query);\n }", "public void searchbarChanges() throws UnsupportedEncodingException {\n // filters the rooms on the searchbar input. It searches for matches in the building name and room name.\n String searchBarInput = searchBar.getText();\n if (searchBarInput == \"\") {\n loadCards();\n } else {\n List<Room> roomsToShow = SearchViewLogic.filterBySearch(roomList, searchBarInput, buildings);\n //Load the cards that need to be shown\n getCardsShown(roomsToShow);\n }\n }", "private void searchImage(String text){\n\n // Set toolbar title as query string\n toolbar.setTitle(text);\n\n Map<String, String> options = setSearchOptions(text, Constants.NEW_SEARCH);\n Call<SearchResponse> call = service.searchPhoto(options);\n\n call.enqueue(new Callback<SearchResponse>() {\n @Override\n public void onResponse(Response<SearchResponse> response, Retrofit retrofit) {\n SearchResponse result = response.body();\n if (result.getStat().equals(\"ok\")) {\n // Status is ok, add result to photo list\n if (photoList != null) {\n photoList.clear();\n photoList.addAll(result.getPhotos().getPhoto());\n imageAdapter.notifyDataSetChanged();\n pageCount = 2;\n }\n\n } else {\n // Display error if something wrong with result\n Toast.makeText(context, result.getMessage(), Toast.LENGTH_LONG).show();\n }\n }\n\n @Override\n public void onFailure(Throwable t) {\n // Display error here since request failed\n Toast.makeText(context, t.getMessage(), Toast.LENGTH_LONG).show();\n }\n });\n }", "private void displayFilter() throws JSONException, InterruptedException {\r\n logger.log(Level.INFO, \"\\nPlease enter the type of club you would \" +\r\n \"like to filter by or 'back' to return to initial prompt:\");\r\n \r\n // club name that user searches for\r\n String filter = in.nextLine();\r\n \r\n // exit if user chooses to do so, otherwise search database\r\n if (\"back\".equalsIgnoreCase(filter))\r\n displayOpen();\r\n else\r\n filterClub(filter);\r\n }", "public String searchByFilter() {\n if (selectedFilter.size() != 0) {\n for (Genre filterOption : selectedFilter) {\n searchTerm = searchResultTerm;\n searchBook();\n\n System.out.println(\"CURRENT NUMBER OF BOOKS: \" + books.size());\n\n BookCollection temp = this.db.getCollectionByGenre(filterOption);\n System.out.println(\"GETTING COLLECTION FOR FILTERING: \" + temp.getCollectionName() + \" NUM OF BOOKS: \"\n + temp.getCollectionBooks().size());\n filterBookList(temp.getCollectionBooks());\n System.out.println(\"UPDATED NUMBER OF BOOKS: \" + books.size());\n }\n } else {\n searchTerm = searchResultTerm;\n searchBook();\n }\n\n return \"list.xhtml?faces-redirect=true\";\n }", "public void searchFor(View view) {\n // Get a handle for the editable text view holding the user's search text\n EditText userInput = findViewById(R.id.user_input_edit_text);\n // Get the characters from the {@link EditText} view and convert it to string value\n String input = userInput.getText().toString();\n\n // Search filter for search text matching book titles\n RadioButton mTitleChecked = findViewById(R.id.title_radio);\n // Search filter for search text matching authors\n RadioButton mAuthorChecked = findViewById(R.id.author_radio);\n // Search filter for search text matching ISBN numbers\n RadioButton mIsbnChecked = findViewById(R.id.isbn_radio);\n\n if (!input.isEmpty()) {\n // On click display list of books matching search criteria\n // Build intent to go to the {@link QueryResultsActivity} activity\n Intent results = new Intent(MainActivity.this, QueryListOfBookActivity.class);\n\n // Get the user search text to {@link QueryResultsActivity}\n // to be used while creating the url\n results.putExtra(\"topic\", mUserSearch.getText().toString().toLowerCase());\n\n // Pass search filter, if any\n if (mTitleChecked.isChecked()) {\n // User is searching for book titles that match the search text\n results.putExtra(\"title\", \"intitle=\");\n } else if (mAuthorChecked.isChecked()) {\n // User is searching for authors that match the search text\n results.putExtra(\"author\", \"inauthor=\");\n } else if (mIsbnChecked.isChecked()) {\n // User is specifically looking for the book with the provided isbn number\n results.putExtra(\"isbn\", \"isbn=\");\n }\n\n // Pass on the control to the new activity and start the activity\n startActivity(results);\n\n } else {\n // User has not entered any search text\n // Notify user to enter text via toast\n\n Toast.makeText(\n MainActivity.this,\n getString(R.string.enter_text),\n Toast.LENGTH_SHORT)\n .show();\n }\n }", "private void searchSong() {\n String keyword = keywordEdt.getText().toString().trim();\n if (TextUtils.isEmpty(keyword)) {\n } else {\n keyword = keyword.toLowerCase();\n\n }\n\n midiRecommendAdapter.notifyDataSetChanged();\n }", "private void handleIntent() {\n\t\tif (getIntent() != null && getIntent().getAction() != null) {\n\t\t\tif (getIntent().getAction().equals(Intent.ACTION_SEARCH)) {\n\t\t\t\tLog.d(\"MainActivityantivirus\", \"Action search!\");\n\t\t\t\tif (mCurrentFragmentType == NavigationElement.TYPE_APPS) {\n\t\t\t\t\tfinal String query = getIntent().getStringExtra(SearchManager.QUERY);\n\t\t\t\t\tif (query != null) {\n\t\t\t\t\t\t((AppsFragment) mCurrentFragment).onSearch(query);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void scanForSongs() {\n if (scanner != null) {\n return;\n }\n scanner = new FileScanner();\n scanner.setActivity(getActivity(), new FileScanner.OnLoadDone() {\n @Override\n public void onLoadDone(ArrayList<MusicFile> data) {\n scanDone(data);\n }\n }, MusicFile.TYPE.MP3);\n scanner.execute(0);\n }", "public static void sharkSearch(Response.Listener<JSONObject> responseListener, Response.ErrorListener errorListener) {\n String searchUrl = FLICKR_API_URL + \"?api_key=\" + FLICKR_API_KEY + \"&method=\" + FLICKR_METHOD_PHOTO_SEARCH\n + \"&text=shark&format=json&nojsoncallback=1&page=1&extras=url_t,url_c,url_l,url_o\";\n\n JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, searchUrl, null, responseListener, errorListener);\n SharkFeedApplication.getRequestQueue().add(request);\n }", "private void performFileSearch() {\n Intent intent = new Intent();\n intent.setType(\"*/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), PICK_IMAGE_REQUEST);\n\n }", "private void handleIntent(Intent intent) {\n if (Intent.ACTION_SEARCH.equals(intent.getAction())) {\n String query = intent.getStringExtra(SearchManager.QUERY);\n Log.d(TAG, \"Received a new search query: \" + query);\n\n // show suggestion for search\n SearchRecentSuggestions suggestions = new SearchRecentSuggestions(this,\n SuggestionProvider.AUTHORITY, SuggestionProvider.MODE);\n suggestions.saveRecentQuery(query, null);\n\n // store search keyword\n PreferenceManager.getDefaultSharedPreferences(this)\n .edit()\n .putString(FlickerClient.PREF_SEARCH_QUERY, query)\n .apply();\n FragmentManager fm = getSupportFragmentManager();\n Fragment fragment = fm.findFragmentById(R.id.fragmentContainer);\n if(fragment != null) {\n // download and update photos according to search keyword\n ((FeedFragment)fragment).refresh();\n }\n }\n }", "public void apiFindSongsOnAppleMusic(Messenger handler){\n transferPlaylists = new ArrayList<>();\n\n for(int i = 0; i < playlists.size(); i++){\n transferPlaylists.add(new Playlist(playlists.get(i).getName(),\"APPLE_MUSIC\"));\n for(int j = 0; j < playlists.get(i).getTracks().size(); j++){\n\n Song song = playlists.get(i).getTracks().get(j);\n String termSearch = (song.getTrack() + \"+\" + song.getArtist());\n termSearch = termSearch.replace(\"&\", \"\");\n termSearch = termSearch.replace(\"?\", \"\");\n termSearch = termSearch.replace(\"#\", \"\");\n termSearch.replace(' ', '+');\n Log.v(TAG, \"Term Search: \" + termSearch);\n\n Request request = new Request.Builder()\n .url(getString(R.string.api_apple_search_track) + \"?term=\"+termSearch+\"&limit=20\"+\"&types=songs\")\n .header(\"Authorization\", \"Bearer \"+ getString(R.string.apple_dev_token))\n .build();\n\n try(Response response = client.newCall(request).execute()){\n if(response.isSuccessful()){\n String res = response.body().string();\n //Log.v(TAG,\"Apple Music Find Songs Response: \" + res);\n appleMusicMatchSong(handler,res,i,song,false);\n } else {\n Log.v(TAG,\"Failed \" + response.toString());\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n try {\n updateMessage(handler,3);\n apiCreatePlaylistsAppleMusic(handler);\n } catch (JSONException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void search (String title, AsyncHttpResponseHandler handler) {\n String apiUrl = getApiUrl(\"track.search\");\n RequestParams params = new RequestParams();\n params.put(\"track\", title);\n params.put(\"api_key\", API_KEY);\n //client.addHeader(\"Authorization\", \"Bearer \" + accessToken );\n client.get(apiUrl, params, handler);\n }", "@Override \n public void onActivityResult(int requestCode, int resultCode, Intent data) \n { \n \n if(requestCode==1) \n { \n \tString barcode=data.getStringExtra(\"BARCODE\");\n \tif (barcode.equals(\"NULL\"))\n \t{\n \t\t//that means barcode could not be identified or user pressed the back button\n \t\t//do nothing\t\n \t}\n \telse\n \t{\n \t\tsearch.setQuery(barcode, true);\n \t\tsearch.setIconifiedByDefault(false);\n \t}\n }\n \n if (requestCode == 2) {\n ArrayList<String> results;\n results = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);\n //Toast.makeText(this, results.get(0), Toast.LENGTH_SHORT).show();\n \n //if the name has an ' then the SQL is failing. Hence replacing them. \n String text = results.get(0).replace(\"'\",\"\");\n search.setQuery(text, true);\n \t\tsearch.setIconifiedByDefault(false);\n }\n \n }", "private void handleIntent(Intent intent) {\n if (Intent.ACTION_SEARCH.equals(intent.getAction())) {\n String query = intent.getStringExtra(SearchManager.QUERY);\n //use the query to search your data somehow\n query = query.replaceAll(\"\\\\s+\",\"\");\n showSearchResults(query);\n }\n }", "public void performFileSearch() {\n\n // ACTION_OPEN_DOCUMENT is the intent to choose a file via the system's file browser.\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n\n // Filter to only show results that can be \"opened\", such as a\n // file (as opposed to a list of contacts or timezones)\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n\n // Filter to show only images, using the image MIME data type.\n // If one wanted to search for ogg vorbis files, the type would be \"audio/ogg\".\n // To search for all documents available via installed storage providers, it would be \"*/*\".\n intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);\n intent.setType(\"image/*\");\n\n startActivityForResult(intent, READ_REQUEST_CODE);\n }", "private void showSearchResults(String query){\n searchResultGV = (GridView) findViewById(R.id.searchResultGV);\n setTitle(\"Search Result for: \" + query);\n query = query.toLowerCase();\n\n getPhotoList(query);\n\n searchResultGV.setAdapter(adapter);\n }", "public void onSearchSubmit(String queryTerm);", "public ArrayList <ITunesItem> searchMultipleKey(String searchText, String country, String media) throws IOException\n\t{\n\t\tsearchText = searchText.replace(\" \", \"+\");\n\t\tString query = \"term=\" + searchText;\n\t\tif(!country.isEmpty())\n\t\t{\n\t\t\tquery = query + \"&country=\" + country;\n\t\t}\n\t\tif(!media.isEmpty())\n\t\t{\n\t\t\tquery = query + \"&media=\" + media;\n\t\t}\n\t\treturn searchQuery(query);\n\t}", "void startGlobalSearch(String initialQuery, boolean selectInitialQuery,\n Bundle appSearchData, Rect sourceBounds) {\n ComponentName globalSearchActivity = getGlobalSearchActivity();\n if (globalSearchActivity == null) {\n Log.w(TAG, \"No global search activity found.\");\n return;\n }\n Intent intent = new Intent(INTENT_ACTION_GLOBAL_SEARCH);\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n intent.setComponent(globalSearchActivity);\n // Make sure that we have a Bundle to put source in\n if (appSearchData == null) {\n appSearchData = new Bundle();\n } else {\n appSearchData = new Bundle(appSearchData);\n }\n // Set source to package name of app that starts global search, if not set already.\n if (!appSearchData.containsKey(\"source\")) {\n appSearchData.putString(\"source\", mContext.getPackageName());\n }\n intent.putExtra(APP_DATA, appSearchData);\n if (!TextUtils.isEmpty(initialQuery)) {\n intent.putExtra(QUERY, initialQuery);\n }\n if (selectInitialQuery) {\n intent.putExtra(EXTRA_SELECT_QUERY, selectInitialQuery);\n }\n intent.setSourceBounds(sourceBounds);\n try {\n if (DBG) Log.d(TAG, \"Starting global search: \" + intent.toUri(0));\n mContext.startActivity(intent);\n } catch (ActivityNotFoundException ex) {\n Log.e(TAG, \"Global search activity not found: \" + globalSearchActivity);\n }\n }", "private void doSearchTest() {\n Log.d(TAG, \"doSearchTest: called; waiting for user input\");\n\n final String callbackUrl = \"urn:ietf:wg:oauth:2.0:oob\";\n final String applicationId = \"c2b235f2620e362157a40aec609e737fe5a2547784933e00201ff90358e092c5\";\n final String secret = \"bee75fbb20ce6b45b64113b44208d12aeca02121fee8ea40f1bd9f44b491ba1c\";\n final String authorizationCode = \"ad2311b2860d224f89c32b7dfd4cb99550ba358aef412fae9ad11b52957a8930\";\n// final String callbackUrl = \"urn:ietf:wg:oauth:2.0:oob\";\n// final String applicationId = \"ed87cdb095b49b1fab3231f69ea86311365528aa3e8b3a499666a1030ef58c56\";\n// final String secret = \"89ddacc015dab3471b73bbe45ebdb2a57ae44a9cb7ec3f0e08fb4dca0aaa37fa\";\n// final String authorizationCode = \"5dd588086e5decedad948d1def60f8853b494ba14642a2942cc5761bd44ad97c\";\n\n Thread thread = new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n Audiosearch client = new Audiosearch().setApplicationId(applicationId).setSecret(secret).build();\n// Audiosearch client = new Audiosearch(applicationId, secret).setSignature(authorizationCode).build();\n// .setApplicationId(applicationId)\n// .setSecret(secret)\n// .build();\n\n Call<EpisodeQueryResult> call = client.searchEpisodes(\"Obama\");\n Log.d(TAG, \"run: Call<EpisodeQueryResult> \" + call);\n Response response = call.execute();\n EpisodeQueryResult eqr = (EpisodeQueryResult) response.body();\n Log.d(TAG, \"run: \" + eqr.getQuery());\n Log.d(TAG, \"run: \" + call.isExecuted());\n Log.d(TAG, \"run: \" + response.message());\n Log.d(TAG, \"run: \" + response.isSuccessful());\n List<EpisodeResult> list = eqr.getResults();\n for (EpisodeResult episodeResult : list) {\n for (AudioFile audiofile : episodeResult.getAudioFiles()) {\n// relatedEpisodes += episode.getTitle() + \" \" + audiofile.getMp3() + \" \";\n SearchAudio sa = new SearchAudio(episodeResult, audiofile);\n Log.d(\"searched\", sa.getShow_title());\n // sa.getMp3() gets the mp3 in String format\n Log.d(\"searched\", sa.getMp3());\n }\n }\n\n\n } catch (IOException e) {\n e.printStackTrace();\n Log.d(\"search test\",\"IOException\");\n } catch (CredentialsNotFoundException e) {\n e.printStackTrace();\n Log.d(\"search test\",\"CredentialsNotFoundException\");\n } catch (Exception e) {\n e.printStackTrace();\n Log.d(\"search test\", \"Exception\");\n }\n }\n });\n thread.start();\n Log.d(\"doSearchTest\", \"initialized thread...\");\n }", "public List<Album> getAlbums(Artist artist);", "public SearchByArtistPrefix(SongCollection sc) {\n\t\tsongs = sc.getAllSongs();\n\t}", "public static ArrayList<Result> search(HashMap<String,ArrayList<String>> map) {\n result = new ArrayList<>();\n finalResult = new ArrayList<>();\n \n String input = map.get(\"search\").get(0);\n searchByName(input);\n \n ArrayList<String> type = map.get(\"type\");\n if(type.isEmpty());\n else for(String t:type){\n searchByType(t);\n result = finalResult;\n }\n \n //<editor-fold defaultstate=\"collapsed\" desc=\"FILTERS\">\n ArrayList<ArrayList<String>> filters = new ArrayList<>();\n filters.add(map.get(\"brand\"));\n filters.add(map.get(\"price\"));\n filters.add(map.get(\"os\"));\n filters.add(map.get(\"memory\"));\n filters.add(map.get(\"storage\"));\n filters.add(map.get(\"numberOfSimSlots\"));\n filters.add(map.get(\"f_camera\"));\n filters.add(map.get(\"b_camera\"));\n /**\n * ArrayList of filters from Mobile Phone\n * 0 = Brand | brand\n * 1 = Price | price\n * 2 = OS | os\n * 3 = Memory | memory\n * 4 = Storage | storage\n * 5 = SIM slots | numberOfSimSlots\n * 6 = Camera front | f_camera\n * 7 = Camera back | b_camera\n */\n int filterMode = 0;\n while(filterMode<filters.size()){\n// for(Result r:result){\n// System.out.println(r.getMP().getFullName());\n// }\n// System.out.println(\"filtermode: \"+filterMode);\n finalResult = new ArrayList<>();\n if(filters.get(filterMode).isEmpty()||filters.get(filterMode).get(0).equals(\"\")){\n filterMode++;\n continue;\n }\n filter(filterMode,filters.get(filterMode++));\n result = finalResult;\n }\n //</editor-fold>\n return result;\n }", "public int selectTagsAlbum(final Context context, ITagQueryResult result);", "@Override\n protected List<Book> doInBackground(String... params) {\n\n String importedQuery[] = params[0].split(\"#\");\n String fullQuery = \"\";\n\n for (int i = 0; i < importedQuery.length; i++) {\n if (!fullQuery.equals(\"\")) fullQuery+='&';\n //vanaf hier moet de lus komen voor meerdere gekoppelde queries\n String prefix = \"\";\n String searchWord = \"\";\n\n int tmp = 0;\n for (String s : importedQuery) Log.d(TAG, \"params[]\" + tmp++ + s);\n\n String args[] = importedQuery[i].split(\"\\\\|\"); //todo params[i]\n prefix = args[0].trim();\n searchWord = args[1].trim();\n searchWord = searchWord.replace(\" \", \"+\");\n\n\n Log.d(TAG, \"searchWord:\" + searchWord);\n Log.d(TAG, \"Prefix\" + prefix);\n\n String[] options = SearchMethodGoogleApi.getPrefixesForQuery();\n// for (String s:options)Log.v(TAG+\"options\",s);\n if (!isStringInArray(prefix, options)) {\n //een ongeldige parameter mee gestuurd\n throw new IllegalArgumentException(\"invalid parameters\");\n }\n fullQuery += prefix + searchWord;\n\n //tot hier moet de lus komen voor meerdere gekoppelde queries\n\n }\n\n\n\n\n List<Book> bookList = new ArrayList<>();\n Volume volume = null;\n Volumes volumes = null;\n Books books = QueryGoogleBooksHelper.setUpClient();\n\n\n Books.Volumes.List volumesList = null;\n try {\n volumesList = books.volumes().list(fullQuery).setMaxResults(40L);\n\n Log.d(App.getTAG(), \"queryFullString:\" + fullQuery);\n\n\n // Execute the searchWord.\n volumes = volumesList.execute();\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (volumes != null && volumes.getItems() != null) {\n //vanaf hier halen we de details op:\n for (Volume vol : volumes.getItems()) {\n Log.v(TAG + \"Book (genAll)\", vol != null ? vol.toString() : \"\");\n\n Volume.VolumeInfo volInfo = vol.getVolumeInfo();\n Volume.SaleInfo salesInfo = vol.getSaleInfo();\n Volume.SearchInfo searchInfo = vol.getSearchInfo();\n\n\n //get authors in List\n List<String> authorStringList = volInfo.getAuthors();\n ArrayList<Author> authorArrayList = new ArrayList<>();\n //copy contents of list to array\n if (volInfo.getAuthors() != null) {\n for (String author : authorStringList)\n authorArrayList.add(new Author(author));\n } else {\n authorArrayList.add(new Author(App.getContext().getString(R.string.no_returned_authors_google)));\n }\n\n //getGoogleID\n String googleID = vol.getId();\n\n //get ISBN:\n String ISBN = \"\";\n if (volInfo.getIndustryIdentifiers() != null) {\n if (volInfo.getIndustryIdentifiers().size() > 1)\n ISBN = volInfo.getIndustryIdentifiers().get(1).getIdentifier();\n }\n\n //get Title:\n String title = \"\";\n if (volInfo.getTitle() != null) {\n title = volInfo.getTitle();\n }\n //get description\n String description = \"\";\n if (volInfo.getDescription() != null) {\n description = volInfo.getDescription();\n }\n\n //get ImageLinks:\n Volume.VolumeInfo.ImageLinks imageLinks = null;\n if (volInfo.getImageLinks() != null) {\n imageLinks = volInfo.getImageLinks();\n }\n\n //get links to book (pre)views:\n String previewLink = \"\";\n if (volInfo.getPreviewLink() != null) {\n previewLink = volInfo.getPreviewLink();\n }\n\n //String shortDescription=searchInfo.getTextSnippet()+App.getContext().getString(R.string.etc_after_book_description);\n Double averageRating = volInfo.getAverageRating();\n\n //TODO:etc verder doen\n\n //create new Book and edit its info with the info from Google\n Book book = new Book(ISBN, googleID, title, authorArrayList, description, imageLinks, previewLink);\n bookList.add(book);\n Log.v(TAG, bookList.size() + \"Book added\");\n }\n }\n\n\n return bookList;\n\n\n }", "void searchForProducts(String searchQuery) {\n if (searchQuery.isEmpty()) {\n searchQuery = \"%\";\n } else {\n searchQuery = \"%\" + searchQuery + \"%\";\n }\n filter.postValue(searchQuery);\n }", "@Override\n public boolean onQueryTextSubmit(String query) {\n if (AfterLoginActivity.this.latestBookList != null) {\n searchBookList = new ArrayList<>();\n\n for (Book book : AfterLoginActivity.this.latestBookList) {\n //str1.toLowerCase().contains(str2.toLowerCase())\n if (book.getName().toLowerCase().contains(query.toLowerCase())) {\n //add to search book list\n searchBookList.add(book);\n }\n }\n //set books to book list view\n AfterLoginActivity.this.bookListFragment.setBooks(searchBookList);\n }\n return true;\n }", "@Override\n public boolean onQueryTextSubmit(String query) {\n topStories = false;\n filter.setQuery(query);\n gvResults.clearOnScrollListeners();\n setUpRecycler();\n findViewById(R.id.relativeLayout).setVisibility(View.GONE);\n findViewById(R.id.tvHeading).setVisibility(View.GONE);\n fetchArticles(0,true);\n searchView.clearFocus();\n return true;\n }", "public void initSearchWidget(){\n\n searchview.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n\n //Closes the keyboard once query is submitted\n searchview.clearFocus();\n return false;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n\n //New arraylist for filtered products\n List<product> filteredList = new ArrayList<>();\n\n //Iterating over the array with products and adding every product that matches\n //the query to the new filtered list\n for (product product : listOfProducts){\n if (product.getProductName().toLowerCase().contains(newText.toLowerCase())){\n filteredList.add(product);\n }\n }\n\n //Hides the product list and display \"not found\" message when can't find match\n if (filteredList.size()<1){\n recyclerView.setVisibility(View.GONE);\n noResults.setVisibility(View.VISIBLE);\n }else {\n recyclerView.setVisibility(View.VISIBLE);\n noResults.setVisibility(View.GONE);\n }\n\n //Sets new adapter with filtered products to the recycler view\n productAdapter = new Adapter(MainActivity.this,filteredList);\n recyclerView.setAdapter(productAdapter);\n\n return true;\n }\n });\n }", "@Override\n public void onCreateOptionsMenu(@NonNull @NotNull Menu menu, @NonNull @NotNull MenuInflater inflater) {\n inflater.inflate(R.menu.main_menu, menu);\n MenuItem menuItem = menu.findItem(R.id.search_icon);\n SearchView searchView = (SearchView) menuItem.getActionView();\n searchView.setQueryHint(getString(R.string.explore_music));\n\n //listens to the query on the searchview\n searchView.setOnQueryTextListener(new OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n //query itunes api\n queryMusic(query, \"all\");\n return false;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n if (!TextUtils.isEmpty(newText)) {\n //hidden due to the limit of 20 request per minute\n// queryMusic(newText, \"all\");\n }\n return false;\n }\n });\n super.onCreateOptionsMenu(menu, inflater);\n }", "Results processFilter(FilterSpecifier filter) throws SearchServiceException;", "public void performFileSearch() {\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n\n // Filter to only show results that can be \"opened\", such as a file (as opposed to a list\n // of contacts or timezones)\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n\n // Filter to show only images, using the image MIME data type.\n // If one wanted to search for ogg vorbis files, the type would be \"audio/ogg\".\n // To search for all documents available via installed storage providers, it would be\n // \"*/*\".\n intent.setType(\"image/*\");\n\n startActivityForResult(intent, READ_REQUEST_CODE);\n // END_INCLUDE (use_open_document_intent)\n }", "@Override\n public boolean onQueryTextSubmit(String query) {\n // If the list contains the search query\n // than filter the adapter\n // using the filter method\n // with the query as its argument\n //placesAdaptor.getFilter( ).filter(query);\n //TODO: set to intent if needed\n /*Intent intent = new Intent(getApplicationContext(),LandmarkDetailsActivity.class);\n\n intent.putExtra(\"placeName\", \"Geisel Library\");\n //hard code to geisel details page\n startActivity(intent);*/\n\n return false;\n }", "public void onSearchButtonClick(View view){\r\n\t\t\r\n\t\tfor (ListingItem item : ListingContent.ITEMS) {\r\n\t\t\tif (item.content.toUpperCase(Locale.getDefault()).contains(searchField.getText().toString().toUpperCase(Locale.getDefault()))) {\r\n\t\t\t\tresults.add(item);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tsetListAdapter(new ArrayAdapter<ListingContent.ListingItem>(this,\r\n\t\t\t\tandroid.R.layout.simple_list_item_1,\r\n\t\t\t\tandroid.R.id.text1, results));\r\n\t}", "public void performSearch() {\n OASelect<CorpToStore> sel = getCorpToStoreSearch().getSelect();\n sel.setSearchHub(getSearchFromHub());\n sel.setFinder(getFinder());\n getHub().select(sel);\n }", "abstract public boolean performSearch();", "public void searchByCategory(View v){\n category = searchSpinner.getSelectedItem().toString();\n if(category!=null && connection.isOnline(this)){\n new SearchByCategoryAsync().execute();\n }\n }", "@Override\n\tpublic List<AlbumResponse> getAlbums(String albumToGet) {\n\t\tlogger.info(\"inside getAlbums method in service\");\n\t\ttry {\n\t\t\tif (albumToGet != null) {\n\t\t\t\tlogger.info(\"album id provided: \" + albumToGet + \", fetching the unique entry\");\n\t\t\t\tLong albumToGetInLong = Long.parseLong(albumToGet);\n\t\t\t\tOptional<Album> album = albumRepository.findById(albumToGetInLong);\n\t\t\t\tif (album.isPresent()) {\n\t\t\t\t\tlogger.info(\"corresponding album found in database\");\n\t\t\t\t\tList<AlbumResponse> responses = AlbumService.convertAlbumEntityToResponseModel(album.get(),\n\t\t\t\t\t\t\tResponseMessageConstants.FETCH_SUCCESSFUL);\n\t\t\t\t\treturn responses;\n\t\t\t\t} else {\n\t\t\t\t\tlogger.error(\"corresponsding album not found in database\");\n\t\t\t\t\tList<AlbumResponse> responses = Arrays\n\t\t\t\t\t\t\t.asList(new AlbumResponse(albumToGet, \"\", null, ResponseMessageConstants.FETCH_UNSUCCESSFUL\n\t\t\t\t\t\t\t\t\t+ \", \" + ResponseMessageConstants.NON_EXISITNG_ID_ERROR));\n\t\t\t\t\treturn responses;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlogger.info(\"album id not provided, fetching all the entries\");\n\t\t\t\tList<Album> albumList = albumRepository.findAll();\n\t\t\t\talbumList.stream().forEach(e -> e.setComments(ResponseMessageConstants.FETCH_SUCCESSFUL));\n\t\t\t\tList<AlbumResponse> responses = AlbumService.convertAlbumEntityToResponseModel(albumList);\n\t\t\t\treturn responses;\n\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\tlogger.error(\"exception while converting albumId from string to long\");\n\t\t\tList<AlbumResponse> responses = Arrays\n\t\t\t\t\t.asList(new AlbumResponse(albumToGet, \"\", null, ResponseMessageConstants.FETCH_UNSUCCESSFUL + \", \"\n\t\t\t\t\t\t\t+ ResponseMessageConstants.INCORRECT_ID_FORMAT_ERROR));\n\t\t\treturn responses;\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(e.getMessage());\n\t\t\tList<AlbumResponse> responses = Arrays.asList(new AlbumResponse(albumToGet, \"\", null,\n\t\t\t\t\tResponseMessageConstants.FETCH_UNSUCCESSFUL + \", \" + ResponseMessageConstants.UNKNOWN_EXCEPTION));\n\t\t\treturn responses;\n\t\t}\n\t}", "@Override\n public void onClick(View v) {\n if (searchTerm.getText().length() > 0) {\n String searchWord =searchTerm.getText().toString().replace(\" \", \"%20\");\n MainActivity.searchTerm = searchWord;\n new PhotoSearch(fragment).execute(MainActivity.searchTerm);\n\n } else\n Toast.makeText(getContext(), \"Enter a travel search term.\", Toast.LENGTH_SHORT).show();\n }", "private void searchBook(String query) {\n String filter = this.bookFilter.getValue();\n String sort = this.sort.getValue();\n \n // Get the user defined comparator\n Comparator<Book> c = getBookComparator(filter, sort);\n\n // Create a book used for comparison\n Book book = createBookForQuery(filter, query);\n \n // Find all matches\n GenericList<Book> results = DashboardController.library.getBookTable().findAll(book, c);\n\n // Cast results to an array\n Book[] bookResults = bookResultsToArray(results, c);\n\n // Load the results in a new scene\n this.loadBookResultsView(bookResults);\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\tBundle savedInstanceState) \n\t{\n\t\tfinal HomeScreen activity = (HomeScreen) getActivity();\n\t\t\n\t\t//define a typeface for formatting text fields and listview. \n\t\t\n\t\ttype= Typeface.createFromAsset(activity.getAssets(),\"fonts/book.TTF\");\n\t\tmyFragmentView = inflater.inflate(R.layout.fragment_search, container, false);\t\t\n\t\tsearch=(SearchView) myFragmentView.findViewById(R.id.searchView1);\n search.setQueryHint(\"Start typing to search...\");\n \n search.setIconifiedByDefault(false);\n \n\t\tsearchResults = (ListView) myFragmentView.findViewById(R.id.listview_search);\n\t\tbuttonBarcode = (ImageButton) myFragmentView.findViewById(R.id.imageButton2);\n\t\tbuttonAudio = (ImageButton) myFragmentView.findViewById(R.id.imageButton1);\n\t\t\n\t\t\n\t\t//this part of the code is to handle the situation when user enters any search criteria, how should the \n\t\t//application behave?\n\t\t\n\t\tbuttonBarcode.setOnClickListener(new OnClickListener() \n {\n public void onClick(View v) \n {\n \tstartActivityForResult(new Intent(activity, Barcode.class),1);\t\n }\n });\n\t\t\n\t\tbuttonAudio.setOnClickListener(new OnClickListener() \n {\n public void onClick(View v) \n {\n \tIntent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n // Specify free form input\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\"Name the product you want to order\");\n intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.ENGLISH);\n startActivityForResult(intent, 2);\t\n }\n });\n\t\t\n\t\tsearch.setOnQueryTextFocusChangeListener(new View.OnFocusChangeListener() \n {\n \t\t\n \t\t@Override\n \t\tpublic void onFocusChange(View v, boolean hasFocus) {\n \t\t\t// TODO Auto-generated method stub\n \t\t\t//Toast.makeText(activity, String.valueOf(hasFocus),Toast.LENGTH_SHORT).show();\n \t\t}\n \t});\n\t\t\n\t\tsearch.setOnQueryTextListener(new OnQueryTextListener() \n {\n \t\t\t\n \t\t@Override\n \t\tpublic boolean onQueryTextSubmit(String query) {\n \t\t\t// TODO Auto-generated method stub\n \t\t\t\t\n \t\t\treturn false;\n \t\t}\n \t\t\n \t\t@Override\n \t\tpublic boolean onQueryTextChange(String newText) {\n \t\t\t\tif (newText.length() > 3)\n \t\t\t\t{\n \t\t\t\t\tsearchResults.setVisibility(myFragmentView.VISIBLE);\n \t\t\t\t\tmyAsyncTask m= (myAsyncTask) new myAsyncTask().execute(newText);\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tsearchResults.setVisibility(myFragmentView.INVISIBLE);\n \t\t\t\t}\n\n \t\t\treturn false;\n \t\t}\n \t\t\n \t});\n\t\treturn myFragmentView;\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu icon){\n\r\n MenuInflater expand = getMenuInflater();\r\n\r\n expand.inflate(R.menu.top_menu, icon); //Referencing to the specific menu\r\n\r\n MenuItem search = icon.findItem(R.id.search_bar);\r\n\r\n SearchView searchView = (SearchView) search.getActionView(); //Displays the search view button\r\n\r\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\r\n\r\n\r\n @Override\r\n public boolean onQueryTextSubmit(String s) {//Begins filtering here\r\n\r\n adapterDevices.getFilter().filter(s);\r\n\r\n return false;\r\n }\r\n //Sends typed string in search bar to trigger search\r\n\r\n\r\n //Method is triggered if there is text change\r\n @Override\r\n public boolean onQueryTextChange(String s) {\r\n\r\n if(s.equals(\"\")){ //When search bar is empty again the page is reloaded\r\n\r\n Intent refresh = new Intent(getApplicationContext(), MyDevicesActivity.class);\r\n\r\n startActivity(refresh);\r\n\r\n finish();\r\n\r\n }\r\n return false;\r\n }\r\n });\r\n\r\n\r\n return true;\r\n\r\n\r\n }", "private void prepareAlbums() {\n int[] covers = new int[]{\n R.drawable.laser,\n R.drawable.shutterstock_sky,\n R.drawable.setalite,\n R.drawable.doctor,\n R.drawable.tower,\n R.drawable.machine,\n R.drawable.finger,\n R.drawable.polymers,\n R.drawable.liver,\n R.drawable.balls,\n R.drawable.phone};\n\n Invention a = new Invention(\"MOBILE LASER SCANNING AND INFRASTRUCTURE MONITORING SYSTEM\", \"Middle East and UAE in particular have experienced a tremendous boom in property and infrastructure development over the last decade. In other cities, the underlying infrastructure available to property developers is typically mapped and documented well before the developer begins his work.\",\n covers[0], \"Apps\", getRandomNumber(1, 30), getRandomNumber(1, 100), getRandomNumber(1, 3000));\n inventionList.add(a);\n\n a = new Invention(\"HUB CONTEST DISTRIBUTED ALGORITHM\", \" We typically take for granted the amount of work needed for a simple phone call to occur between two mobile phones. Behind the scenes, hundreds, if not thousands of messages are communicated between a mobile handset, radio tower, and countless servers to enable your phone call to go smoothly. \",\n covers[1], \"Product Design\", getRandomNumber(1, 30), getRandomNumber(1, 100), getRandomNumber(1, 3000));\n inventionList.add(a);\n\n a = new Invention(\"CLOCK SYNCHRONIZATION OVER COMMUNICATION \", \" In real life, the communication paths from master to slave and reverse are not perfectly symmetric mainly due to dissimilar forward and reverse physical link delays and queuing delays. asymmetry, creates an error in the estimate of the slave clock’s offset from the master\",\n covers[2], \"Table Top Games\", getRandomNumber(1, 30), getRandomNumber(1, 100), getRandomNumber(1, 3000));\n inventionList.add(a);\n\n a = new Invention(\"PATIENT-SPECIFIC SEIZURE CLASSIFICATION\",\"The timely detection of an epileptic seizure to alert the patient is currently not available. The invention is a device that can classify specific seizures of patients. It is realized within a microchip (IC) and can be attached to the patient.\",\n covers[3], \"Software\", getRandomNumber(1, 30), getRandomNumber(1, 100), getRandomNumber(1, 3000));\n inventionList.add(a);\n\n a = new Invention(\"ALTERNATIVE RENEWABLE ENERGY HARVESTING\", \"There has been increased demand to harvest energy from nontraditional alternative energy sources for self-powered sensors chipsets which are located in remote locations and that can operate at extremely low power levels.\",\n covers[4], \"Gadgets\", getRandomNumber(1, 30), getRandomNumber(1, 100), getRandomNumber(1, 3000));\n inventionList.add(a);\n\n a = new Invention(\"TECHNIQUE FOR MOTOR CONTROL OVER PACKET NETWORKS\", \"Many industries rely on motor control systems to physically control automated machines in manufacturing, energy conservation, process control and other important functions. \",\n covers[5], \"Software\",getRandomNumber(1, 30), getRandomNumber(1, 100), getRandomNumber(1, 3000));\n inventionList.add(a);\n\n a = new Invention(\"INDOOR WIRELESS FINGERPRINTING TECHNIQUE\",\" Location information has gained significant attention for a variety of outdoor applications thanks to the reliable and popular GPS system. \",\n covers[6], \"Apps\", getRandomNumber(1, 30), getRandomNumber(1, 100), getRandomNumber(1, 3000));\n inventionList.add(a);\n\n a = new Invention(\"POLYMERS AND PLASTICS FROM SULFUR COMPOUND\", \"Plastics are some of the most heavily used materials in our world. From plastic bags, to computer components - they are the back-bone material of our daily lives.\",\n covers[7], \"Video Games\", getRandomNumber(1, 30), getRandomNumber(1, 100), getRandomNumber(1, 3000));\n inventionList.add(a);\n\n a = new Invention(\"FIBER-IN-FIBER BIOARTIFICIAL LIVER DEVICE\", \"Liver is a site for proteins and amino acids production. Once the liver fails, its function is very difficult to replicate. Up to date, there is no approved therapy but human liver transplant - bio artificial liver devices and incubating liver cells are only a short term solution to bridge the time for the patients to the ultimate liver transplant.\",\n covers[8], \"Gadgets\", getRandomNumber(1, 30), getRandomNumber(1, 100), getRandomNumber(1, 3000));\n inventionList.add(a);\n\n a = new Invention(\"COMPACT SUFFIX TREE FOR BINARY PATTERN MATCHING\", \" While the “suffix tree” is an efficient structure to solve many string problems, especially in cloud storages, it requires a large memory space for building and storing the tree structure. \",\n covers[9], \"Apps\", getRandomNumber(1, 30), getRandomNumber(1, 100), getRandomNumber(1, 3000));\n inventionList.add(a);\n\n adapter.notifyDataSetChanged();\n }", "@FXML\n private void btnSearchClick() {\n\n // Check if search field isn't empty\n if (!txtSearch.getText().equals(\"\")) {\n\n // Display the progress indicator\n resultsProgressIndicator.setVisible(true);\n\n // Get query results\n MovieAPIImpl movieAPIImpl = new MovieAPIImpl();\n movieAPIImpl.getMovieList(Constants.SERVICE_API_KEY, txtSearch.getText(), this);\n }\n }", "private void search()\n {\n JTextField searchField = (currentSearchView.equals(SEARCH_PANE_VIEW))? searchBar : resultsSearchBar;\n String searchTerm = searchField.getText();\n \n showTransition(2000);\n \n currentPage = 1;\n showResultsView(true);\n paginate(1, getResultsPerPage());\n\n if(searchWeb) showResultsTableView(WEB_RESULTS_PANE);\n else showResultsTableView(IMAGE_RESULTS_PANE);\n\n \n showSearchView(RESULTS_PANE_VIEW);\n resultsSearchBar.setText(searchTerm);\n }", "private void onQueryEventFunctionality() {\n hideKeypad();\n // Find a reference to the {@link EditText} in the layout\n EditText bookQuery = (EditText) findViewById(R.id.book_search_text);\n // Get the user typed text from the EditText view\n mbookQueryText = bookQuery.getText().toString();\n // Make the final URL, based on user input, to be used to fetch data from the server\n mGBooksRequestUrl = makeUrlFromInput(mbookQueryText);\n\n // Get a reference to the ConnectivityManager to check state of network connectivity\n ConnectivityManager connMgr = (ConnectivityManager)\n getSystemService(Context.CONNECTIVITY_SERVICE);\n\n // Get details on the currently active default data network\n NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();\n\n mEmptyStateTextView.setVisibility(GONE);\n\n //Show the progress indicator\n View loadingIndicator = findViewById(R.id.loading_indicator);\n loadingIndicator.setVisibility(VISIBLE);\n\n // If there is a network connection, fetch data\n if (networkInfo != null && networkInfo.isConnected()) {\n // Get a reference to the LoaderManager, in order to interact with loaders.\n LoaderManager loaderManager = getLoaderManager();\n // Initialize the loader. Pass in the int ID constant defined above and pass in null for\n // the bundle. Pass in this activity for the LoaderCallbacks parameter (which is valid\n // because this activity implements the LoaderCallbacks interface).\n loaderManager.restartLoader(BOOK_LOADER_ID, null, BookActivity.this);\n } else {\n // Otherwise, display error\n // First, hide loading indicator so error message will be visible\n loadingIndicator.setVisibility(View.GONE);\n\n // Update empty state with no connection error message\n mEmptyStateTextView.setText(R.string.no_internet_connection);\n }\n }", "public void search() {\r\n \t\r\n }", "@Override\n public void onClick(View view) {\n if (spotifyBroadcastReceiver.getAlbumName() == null ||\n spotifyBroadcastReceiver.getArtistName() == null ||\n spotifyBroadcastReceiver.getTrackName() == null) {\n Log.d(TAG, \"Song's Information Not Complete!\");\n } else {\n // search song\n getLyrics();\n }\n }", "@Override\n\tpublic BrowseResult search(String containerId, String searchCriteria,\n\t\t\tString filter, long firstResult, long maxResults,\n\t\t\tSortCriterion[] orderBy) throws ContentDirectoryException {\n\t\treturn super.search(containerId, searchCriteria, filter, firstResult,\n\t\t\t\tmaxResults, orderBy);\n\t}", "public void handleSearchQuery(String query) {\n // Iterate through Spot list looking for a Spot whose name matches the search query String\n for (Spot spot : mSpotList) {\n if (spot.getName().equalsIgnoreCase(query)) {\n mMap.addCircle(new CircleOptions()\n .center(new LatLng(spot.getLatLng().latitude, spot.getLatLng().longitude))\n .radius(10)\n .strokeColor(Color.BLACK) // Border color of the circle\n // Fill color of the circle.\n // 0x represents, this is an hexadecimal code\n // 55 represents percentage of transparency. For 100% transparency, specify 00.\n // For 0% transparency ( ie, opaque ) , specify ff\n // The remaining 6 characters(00ff00) specify the fill color\n .fillColor(0x8800ff00)\n // Border width of the circle\n .strokeWidth(2)); // Todo: Make this transparent blue?\n\n // To change the position of the camera, you must specify where you want\n // to move the camera, using a CameraUpdate. The Maps API allows you to\n // create many different types of CameraUpdate using CameraUpdateFactory.\n // Animate the move of the camera position to spot's coordinates and zoom in\n mMap.animateCamera(CameraUpdateFactory.newCameraPosition(CameraPosition.fromLatLngZoom(spot.getLatLng(), 18)),\n 2000, null);\n break;\n }\n }\n }", "@Override\n public void onSearchOpened() {\n }", "@Override\n public void onSearchOpened() {\n }", "@Override\n public void onSearchOpened() {\n }", "private void searchQuery(String query) {\n mSearchAheadServiceV3 = new SearchAheadService(this, API_KEY);\n\n String queryString = query;\n\n LatLng surreyBC = new LatLng(49.104599F, -122.823509F);\n\n List searchCollections = Arrays.asList(SearchCollection.AIRPORT, SearchCollection.ADMINAREA,\n SearchCollection.ADDRESS, SearchCollection.FRANCHISE, SearchCollection.POI);\n try {\n SearchAheadQuery searchAheadQuery = new SearchAheadQuery\n .Builder(queryString, searchCollections)\n .location(surreyBC)\n .limit(5)\n .build();\n\n mSearchAheadServiceV3.predictResultsFromQuery(searchAheadQuery,\n new SearchAheadService.SearchAheadResponseCallback() {\n\n @Override\n public void onSuccess(@NonNull SearchAheadResponse searchAheadResponse) {\n\n //Get search results from the request response\n List<SearchAheadResult> searchAheadResults = searchAheadResponse.getResults();\n\n //if we have requests\n if (searchAheadResults.size() > 0) {\n\n //clear the current data to display\n searchResultsData.clear();\n\n try {\n\n int size = (searchAheadResults.size() < 5) ? searchAheadResults.size() : 5;\n\n for (int i = size - 1; i >= 0; i--) {\n // create a hashmap\n HashMap<String, String> hashMap = new HashMap<>();\n\n AddressProperties addressProperties = searchAheadResults.get(i).getPlace().getAddressProperties();\n\n // convert image int to a string and place it into the hashmap with an images key\n hashMap.put(\"address\", searchAheadResults.get(i).getName());\n hashMap.put(\"city\", addressProperties.getCity() + \", \" + addressProperties.getStateCode());\n hashMap.put(\"lat\", String.valueOf(searchAheadResults.get(i).getPlace().getLatLng().getLatitude()));\n hashMap.put(\"long\", String.valueOf(searchAheadResults.get(i).getPlace().getLatLng().getLongitude()));\n\n\n // add this hashmap to the list\n searchResultsData.add(hashMap);\n }\n\n //handle null pointer exception on address properties\n } catch (NullPointerException e) {\n e.printStackTrace();\n }\n\n //adapter inputs\n String[] from = {\n \"address\",\n \"city\",\n \"lat\",\n \"long\"\n };\n\n int[] to = {R.id.text_result_address, R.id.text_result_city, R.id.hidden_location_lat, R.id.hidden_location_long};\n\n searchAdapter = new SimpleAdapter(getApplicationContext(), searchResultsData, R.layout.item_search_result, from, to);\n mListViewSearch.setAdapter(searchAdapter);\n mListViewSearch.setVisibility(View.VISIBLE);\n } else {\n resetSearchAheadList();\n }\n }\n\n @Override\n public void onError(Exception e) {\n Log.e(\"MAPQUEST\", \"Search Ahead V3 Failure\", e);\n }\n });\n } catch (IllegalQueryParameterException e) {\n Log.e(\"Error performing search\", e.getMessage());\n }\n }", "void doMySearch(String query,final Context context) {\n if (mCurrent_page == 1) {\n ringProgressDialog = ProgressDialog.show(context, \"Please wait ...\", \"Downloading Images ...\", true);\n ringProgressDialog.setCancelable(true);\n }\n\n Retrofit retrofit = new Retrofit.Builder()\n .baseUrl(BASE_URL)\n .addConverterFactory(GsonConverterFactory.create())\n .build();\n FlickrService flickrService = retrofit.create(FlickrService.class);\n\n flickrService.searchPhotos(String.valueOf(query), String.valueOf(mCurrent_page)).enqueue(new Callback<FlickrPicturesResponse>() {\n @Override\n public void onResponse(Call<FlickrPicturesResponse> call, Response<FlickrPicturesResponse> response) {\n FlickrPicturesResponse model = response.body();\n List<Photo> photos = model.getPhotos().getPhoto();\n if (ringProgressDialog != null){\n ringProgressDialog.dismiss();\n }\n for (Photo photo : photos) {\n mAdapter.addItem(photo);\n mAdapter.notifyDataSetChanged();\n }\n }\n\n @Override\n public void onFailure(Call<FlickrPicturesResponse> call, Throwable t) {\n if (ringProgressDialog != null) {ringProgressDialog.dismiss();}\n Toast.makeText(context, R.string.connection_error, Toast.LENGTH_LONG).show(); }\n });\n }", "private void searchPhotosButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchPhotosButtonActionPerformed\n\n clearInformation();\n String key = keySearchPhotoTextField.getText();\n String tag = tagSearchPhotoTextField.getText();\n if (key.equals(EMPTY)) {\n this.displayInformation(PLEASE_EDIT_KEY);\n } else if (tag.equals(EMPTY)) {\n this.displayInformation(PLEASE_EDIT_TAG);\n } else {\n\n // set the information for the display GUI\n // and launch the search of photos\n // NOTE : we can use the same (the last)\n // current window or not\n if (!useSameWindowCheckBox.isSelected()) {\n displayPhotosGUI =\n new FlickrPhotosSearchGUI(flickrService);\n displayPhotosGUI.setInfo(key, tag);\n displayPhotosGUI.search();\n } else {\n if (displayPhotosGUI != null) {\n if (!displayPhotosGUI.isActive()) {\n\n displayPhotosGUI.setVisible(true);\n displayPhotosGUI.setInfo(key, tag);\n displayPhotosGUI.search();\n }\n } else {\n displayInformation(NO_DISPLAY_WINDOW);\n }\n\n }\n }\n }", "@GET(\"/v1/albums/{albumId}\")\r\n void getAlbum( //\r\n @Query(\"apikey\") String apikey, //\r\n @Query(\"pretty\") boolean pretty, //\r\n @Query(\"catalog\") String catalog, //\r\n @Path(\"albumId\") String albumId, //\r\n Callback<AlbumData> callBack);", "public List<Album> searchArtistForAlbum(String text) throws SQLException {\n\t\tList<Album> artistWork = new ArrayList<Album>();\n\t\tDriver driver = new Driver();\n\n\t\tString sql = \"SELECT Album.* FROM artist,album \"\n\t\t\t\t+ \" WHERE artist.Artist_ID = album.Artist_ID AND Artist_Name Like ? \"\n\t\t\t\t+ \"ORDER BY artist.Artist_ID, Year_Released\";\n\n\t\tConnection conn = null;\n\t\tPreparedStatement pstmt = null;\n\t\tResultSet res = null;\n\n\t\ttry {\n\t\t\tconn = driver.openConnection();\n\t\t\tpstmt = conn.prepareStatement(sql);\n\t\t\tpstmt.setString(1, \"%\" + text + \"%\");\n\t\t\tres = pstmt.executeQuery();\n\t\t\twhile (res.next()) {\n\t\t\t\tartistWork.add(new Album(res.getInt(\"Album_Id\"), res.getString(\"Album_Name\"),\n\t\t\t\t\t\tres.getString(\"Year_Released\"), res.getInt(\"Artist_Id\")));\n\t\t\t}\n\t\t\treturn artistWork;\n\t\t}\n\n\t\tfinally {\n\t\t\tDriver.closeConnection(conn);\n\t\t\tDriver.closeStatement(pstmt);\n\n\t\t}\n\t}", "public void onSearchStarted();", "private void searchforResults() {\n\n List<String> queryList = new SavePreferences(this).getStringSetPref();\n if(queryList != null && queryList.size() > 0){\n Log.i(TAG, \"Searching for results \" + queryList.get(0));\n Intent searchIntent = new Intent(Intent.ACTION_WEB_SEARCH);\n searchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n searchIntent.putExtra(SearchManager.QUERY, queryList.get(0));\n this.startActivity(searchIntent);\n }\n }", "public void setSearchQuery(String searchQuery) {\n searchQuery = searchQuery.toLowerCase();\n this.searchQuery = searchQuery;\n\n List<Media> mediaList = viewModel.getMediaList();\n List<Media> newList = new ArrayList<>();\n\n for (Media media : mediaList) {\n String title = media.getTitle().toLowerCase();\n if (title.contains(searchQuery)){\n newList.add(media);\n }\n }\n searchList.clear();\n searchList.addAll(newList);\n }", "@Override\r\n\tpublic void listAlbums() {\n\t\tString AlbumNames=\"\";\r\n\t\tList<IAlbum> album1=model.getUser(userId).getAlbums();\r\n\t\tif(album1.size()==0){\r\n\t\t\tString error=\"No albums exist for user \"+userId+\"\";\r\n\t\t\tsetErrorMessage(error);\r\n\t\t\tshowError();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tIAlbum temp=album1.get(0);\r\n\t\t\r\n\t\tfor(int i=0; i<album1.size(); i++){\r\n\t\t\ttemp=album1.get(i);\r\n\t\t\t/*accessing the photo list now*/\r\n\t\t\tList<IPhoto> photoList=temp.getPhotoList();\r\n\t\t\tif(photoList.size()==0){\r\n\t\t\t\tAlbumNames=AlbumNames+\"\"+album1.get(i).getAlbumName()+\" number of photos: 0\\n\";\r\n\t\t\t}\r\n\t\t\t/*Let's compare*/\r\n\t\t\telse{Date lowest=photoList.get(0).getDate();\r\n\t\t\tDate highest=photoList.get(0).getDate();\r\n\t\t\tfor(int j=0;j<photoList.size();j++){\r\n\t\t\t\tif(photoList.get(j).getDate().before(lowest)){\r\n\t\t\t\t\tlowest=photoList.get(j).getDate();\r\n\t\t\t\t}\r\n\t\t\t\tif(photoList.get(j).getDate().after(highest)){\r\n\t\t\t\t\thighest=photoList.get(j).getDate();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/**/\r\n\t\t\tif(i==album1.size()-1){\r\n\t\t\t\t/*Do I even need this?*/\r\n\t\t\t\tAlbumNames=AlbumNames+\"\"+album1.get(i).getAlbumName()+\" number of photos: \"+album1.get(i).getAlbumSize()+\", \"+lowest+\" - \"+highest+\"\";\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\tAlbumNames=AlbumNames+\"\"+album1.get(i).getAlbumName()+\" number of photos: \"+album1.get(i).getAlbumSize()+\", \"+lowest+\" - \"+highest+\"\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t}\r\n\t\tsetErrorMessage(AlbumNames);\r\n\t\tshowError();\r\n\t\t\r\n\r\n\t}" ]
[ "0.726591", "0.7028412", "0.69864064", "0.647803", "0.6431112", "0.60357726", "0.59744805", "0.5903525", "0.58899736", "0.5871359", "0.57533777", "0.57224923", "0.5714327", "0.56910765", "0.5680187", "0.56647885", "0.5648644", "0.5630123", "0.5564949", "0.5515667", "0.55126595", "0.550746", "0.5487021", "0.5485356", "0.54800385", "0.54499674", "0.542037", "0.5391837", "0.5384704", "0.5379464", "0.53605086", "0.535663", "0.5331614", "0.5312109", "0.52854216", "0.52683544", "0.5259639", "0.52556056", "0.52370673", "0.52352256", "0.522368", "0.52169746", "0.52104014", "0.5204419", "0.51748556", "0.51645386", "0.51441085", "0.51396334", "0.51308185", "0.51305664", "0.51292247", "0.5116015", "0.51114535", "0.5108483", "0.5101195", "0.50987685", "0.50964355", "0.50944036", "0.5091038", "0.50820905", "0.5081671", "0.5073247", "0.50724417", "0.50691473", "0.50529504", "0.50365305", "0.50357527", "0.5020373", "0.5005567", "0.5004383", "0.50035477", "0.49962667", "0.49943393", "0.4990545", "0.49825534", "0.49747643", "0.4965759", "0.49587524", "0.49576044", "0.49551404", "0.4948605", "0.49389458", "0.49337435", "0.4932798", "0.49303108", "0.49298856", "0.4928733", "0.4925668", "0.4923608", "0.4923608", "0.4923608", "0.4923139", "0.49209478", "0.49162203", "0.4914671", "0.4910105", "0.4901987", "0.4901801", "0.4896286", "0.4892545" ]
0.54774463
25
Attached to a button in fragment_album_song_selection.xml; does not override the back button
public void backButtonPressed(View view) { onBackPressed(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void backButton() {\n\t\t\r\n\t}", "@Override\n\tpublic void backButton() {\n\n\t}", "@Override\n public void backButton() {\n\n\n }", "void onUpOrBackClick();", "void onGoBackButtonClick();", "private void configureBackButton() {\n LinearLayout layoutTop = (LinearLayout) findViewById(R.id.title);\n layoutTop.bringToFront();\n\n Button button = (Button) findViewById(R.id.backButton);\n button.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n finish();\n }\n });\n }", "public void goBack() {\n goBackBtn();\n }", "private void backButton() {\n navigate.goPrev(this.getClass(), stage);\n }", "public void onBackPressed() {\n backbutton();\n }", "@Override\r\n\tpublic void onBackPressed()\r\n\t{\r\n\t\tif (flipper.getDisplayedChild() != 0)\r\n\t\t{\r\n\t\t\tflipper.showPrevious();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tsuper.onBackPressed();\r\n\t\t}\r\n\t}", "private void setUpBackButton() {\n mBackButton = mDetailToolbar.getChildAt(0);\n if (null != mBackButton && mBackButton instanceof ImageView) {\n\n // the scrim makes the back arrow more visible when the image behind is very light\n mBackButton.setBackgroundResource(R.drawable.scrim);\n\n ViewGroup.MarginLayoutParams lpt = (ViewGroup.MarginLayoutParams) mBackButton.getLayoutParams();\n lpt.setMarginStart((int) getResources().getDimension(R.dimen.keyline_1));\n\n ViewGroup.LayoutParams lp = mBackButton.getLayoutParams();\n lp.height = (int) getResources().getDimension(R.dimen.small_back_arrow);\n lp.width = (int) getResources().getDimension(R.dimen.small_back_arrow);\n\n // tapping the back button or the Up button should return to the list of articles\n mBackButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n onBackPressed();\n supportFinishAfterTransition();\n }\n });\n }\n }", "public void backButtonClicked()\r\n {\n manager = sond.getManager();\r\n AnimatorThread animThread = model.getThread();\r\n\r\n if (button.getPlay() && animThread != null && animThread.isAlive())\r\n {\r\n if (!animThread.getWait())\r\n {\r\n animThread.interrupt();\r\n }\r\n else\r\n {\r\n animThread.wake();\r\n }\r\n }\r\n else if (manager.canUndo())\r\n {\r\n manager.undo();\r\n }\r\n }", "public boolean onBackPressed() {\n //if (mShouldHandleBackPressed) {\n // ((GalleryActivity)getActivity()).setActionBarTitle(\"Gallery\");\n // loadBuckets();\n // return true;\n //}\n return false;\n }", "@Override\n public void onClick(View view) {\n onBackPressed(); }", "@Override\n\tpublic void onClick(View v) {\n\t\tif (v.getId() == AppConfig.resourceId(this, \"jg_iphoneback\", \"id\")) {\n\t\t\tif (mWebview.canGoBack()) {\n\t\t\t\tmWebview.goBack();\n\t\t\t} else {\n\t\t\t\tfinish();\n\t\t\t\tif (JGSDK.icon != null) {\n\t\t\t\t\tJGSDK.isShow = true;\n\t\t\t\t\tJGSDK.icon.setVisibility(View.VISIBLE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tprotected void titleBtnBack() {\n\t\tsuper.titleBtnBack();\n\t}", "@Override\n public void onClick(View v) {\n onBackPressed();\n }", "@Override\n public void onClick(View v) {\n onBackPressed();\n }", "@Override\n public void onClick(View v) {\n onBackPressed();\n }", "@Override\n public void onClick(View v) {\n onBackPressed();\n }", "@Override\n\tpublic void onBackPressed()\n\t{\n\t\tIntent intent = new Intent(AlbumActivity.this, MainActivity.class);\n\t\tstartActivity(intent);\n\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\ttry\n\t\t\t\t{if(wb.canGoBack())\n\t\t\t\t\twb.goBack();\n\t\t\t\t}catch(Exception e)\n\t\t\t\t{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "@Override\n\tpublic void onClick(View v) {\n\t\tswitch (v.getId()) {\n\t\tcase R.id.imageButton_back:\n\t\t\tsuper.onBackPressed();\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\n public void onClick(View v) {\n if (v.getId() == R.id.ll_back) {\n onBackPressed();\n }\n\n }", "private void displayBackButton() {\n RegularButton backButton = new RegularButton(\"BACK\", 200, 600);\n\n backButton.setOnAction(e -> backButtonAction());\n\n sceneNodes.getChildren().add(backButton);\n }", "@Override\n public void onClick(View v) {\n frameLayoutSearch.setVisibility(View.GONE);\n songBelongAlbumFragment = new SongBelongAlbumFragment();\n Bundle bundle = new Bundle();\n bundle.putString(\"nameSongOfAlbum\",tvAlbumName.getText().toString());\n songBelongAlbumFragment.setArguments(bundle);\n android.support.v4.app.FragmentTransaction fragmentTransaction = ( (FragmentActivity)context).getSupportFragmentManager().beginTransaction();\n fragmentTransaction.replace(R.id.fragment_container, songBelongAlbumFragment);\n fragmentTransaction.commit();\n }", "@Override\n\tpublic void onClick(View v) {\n\t\tif (v == backBtn)\n\t\t\tfinish();\n\t}", "public void onClick(View arg0) {\n goBack();\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tonBackPressed();\r\n\t\t\t}", "@Override\n public void onClick(View v) {\n getActivity().onBackPressed();\n }", "private void setupBack() {\n\t\tmakeButton(\"Back\", (ActionEvent e) -> {\n\t\t\tchangeView(\"login\");\n\t\t});\n\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tonBackPressed();\n\t\t\t}", "@FXML\n\tvoid backToPageBtnClicked(MouseEvent event) {\n\t\ttestAnchor.setVisible(false);\n\t\ttestAnchor.toBack();\n\t\taddNewTestButton.setVisible(true);\n\t}", "@Override\n public void backPressed(){\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tonBackPressed();\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tonBackPressed();\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tonBackPressed();\n\t\t\t}", "@Override\r\n\t\tpublic void onClick(View v) {\n\t\t\tswitch (v.getId()) {\r\n\t\t\tcase R.id.back:\r\n\t\t\t\tfinish();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\t\r\n\t\t}", "@Override\n public void onClick(View v) {\n mLastItemPositionInt = getAdapterPosition();\n\n// mSongDetailItemImageButton.setOnClickListener(new View.OnClickListener() {\n// @Override\n// public void onClick(View v) {\n// PopupMenu popupMenu = new PopupMenu(mainActivity.getApplicationContext(), v);\n// popupMenu.inflate(R.menu.menu_favorite_song_item);\n// popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {\n// @Override\n// public boolean onMenuItemClick(MenuItem item) {\n// if(mListFavoriteSongAdapter.get(mLastItemPositionInt).isFavoriteSong()){\n//\n// }\n// switch (item.getItemId()) {\n// case R.id.remove_favorite_song_item:\n// deleteSongFromDataBase(mLastItemPositionInt);\n// }\n// return false;\n// }\n// });\n// popupMenu.show();\n// }\n// });\n\n //Theo chieu doc => Show small playing area\n if (v.getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) {\n// //Get position of item\n// mLastItemPositionInt = getAdapterPosition();\n\n mainActivity.getmMediaService().setListSongService(mListFavoriteSongAdapter);\n\n //play Media\n mainActivity.getmMediaService().playMedia(mListFavoriteSongAdapter.get(mLastItemPositionInt));\n\n //Add Current Song to Database\n// addSongToDataBase(mainActivity.getmMediaService().getmMediaPosition());\n\n //Delete Current Song from Database\n// deleteSongFromDataBase(mLastItemPositionInt);\n\n //UpDate data on View\n notifyDataSetChanged();\n //Show small playing area\n mainActivity.getmFavoriteSongFragment().showSmallPlayingArea();\n //Update UI in AllSongFragment\n mainActivity.getmFavoriteSongFragment().upDateSmallPlayingRelativeLayout();\n } else { //Theo chieu ngang => khong hien thi small playing area\n mLastItemPositionInt = getAdapterPosition();\n mainActivity.getmMediaService().playMedia(mListFavoriteSongAdapter.get(mLastItemPositionInt));\n notifyDataSetChanged();\n }\n }", "void onHistoryButtonClicked();", "public void onBackButton() {\n WindowLoader wl = new WindowLoader(backButton);\n wl.load(\"MenuScreen\", getInitData());\n RETURN_AUDIO.play(Double.parseDouble(getInitData().get(\"SFXVol\")));\n }", "@Override\n public void onClick(View v) {\n switch (v.getId()) {\n case R.id.back_btn:\n onBackPressed();\n break;\n default:\n break;\n }\n }", "@Override\r\n\tpublic void onButtonEvent(GlassUpEvent event, int contentId) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t}", "public void onClickBack(View view){\n onBackPressed();\n }", "public abstract boolean onBackPressed();", "void setActionBtnBack(LinkActionGUI mainAction, LinkActionGUI linkAction);", "@Override\n public void onClick(View view) {\n if (!Constants.getActivateBottomNavigationWidgetButton().equals(\"Video\")) {\n disabledActivateBottomNavigationWidgetButton();\n\n videoButton.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.ic_video, 0, 0);\n videoButton.setTypeface(null, Typeface.BOLD);\n videoButton.setTextColor(getResources().getColor(R.color.bottom_navigation_widget_button_enable_color));\n\n Utils.showLibrary(LibraryActivity.this, \"video\");\n Utils.triggerGAEvent(LibraryActivity.this, \"BottomNavigation\", \"Video\", customerId);\n }\n }", "private void backButton() {\n // Set up the button to add a new fish using a seperate activity\n backButton = (Button) findViewById(R.id.backButton);\n backButton.setOnClickListener(new View.OnClickListener() {\n public void onClick(View view) {\n // Start up the add fish activity with an intent\n Intent detailActIntent = new Intent(view.getContext(), MainActivity.class);\n finish();\n startActivity(detailActIntent);\n\n\n }\n });\n }", "@Override\n\tpublic void onBackPressed() {\n\n\t\tboolean callSuper = true;\n\n\t\tFraSearch search = (FraSearch) getSupportFragmentManager()\n\t\t\t\t.findFragmentByTag(FraSearch.TAG);\n\n\t\tif (search != null && search.isAdded() && !search.isDetached()\n\t\t\t\t&& !search.isRemoving() && search.isSearchVisible()) {\n\t\t\tsearch.hide();\n\t\t\tcallSuper = false;\n\t\t}\n\t\t\n\t\tFraMenu menu = (FraMenu) getSupportFragmentManager()\n\t\t\t\t.findFragmentByTag(FraMenu.TAG);\n\n\t\tif (menu != null && menu.isAdded() && !menu.isDetached()\n\t\t\t\t&& !menu.isRemoving() && menu.isFraMenuVisible()) {\n\t\t\tmenu.hide();\n\t\t\tcallSuper = false;\n\t\t}\n\n\t\t\n\t\tfinal RelativeLayout share = (RelativeLayout) findViewById(R.id.share);\n\n\t\tif (share != null && share.getVisibility() == View.VISIBLE) {\n\t\t\tshare.setVisibility(View.INVISIBLE);\n\t\t\tcallSuper = false;\n\t\t}\n\n\t\tfinal RelativeLayout font = (RelativeLayout) findViewById(R.id.font);\n\n\t\tif (font != null && font.getVisibility() == View.VISIBLE) {\n\t\t\tfont.setVisibility(View.INVISIBLE);\n\t\t\tcallSuper = false;\n\t\t}\n\t\t\n\t\tif (callSuper) {\n\t\t\tsuper.onBackPressed();\n\t\t}\n\t}", "@Test\r\n public void backButton(){\r\n onView(withId(R.id.btnBack1)).perform(click());\r\n }", "@Override\n public void onBackPressed(){\n setSound.startButtonNoise(MemoryThemeActivity.this);\n finish();\n }", "@Override\n public void onClick(View v) {\n switch (v.getId())\n {\n case R.id.back_toolbar:\n finish();\n break;\n }\n }", "public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n //This is making going to previous task but change button pressed\n //NavUtils.navigateUpFromSameTask(this);\n\n //and this will go back too but show button pressed\n super.onBackPressed();\n //overridePendingTransition(R.anim.left_to, R.anim.right);\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic void onClick(View v) {\n\t\tswitch (v.getId()) {\r\n\t\tcase R.id.gardenvideo_back:\r\n\r\n\t\t\tthis.finish();\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "@FXML\n public void backButtonClicked(MouseEvent event) {\n toggleBackBtnVisibility(false);\n setMainScene(previousView, null);\n }", "public void clickBackButton() {\n\t\tbackButton.click();\n\n\t}", "@Override\n public void onBackPressed() {\n if (Utils.isTablet(getApplicationContext())) {\n finish();\n } else {\n final Fragment fragment = getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG);\n\n if (fragment instanceof ListingItemFragment) {\n if (fragment.isAdded() && fragment.isVisible()) {\n getSupportFragmentManager().beginTransaction().remove(fragment).commit();\n changeActivityViewsVisibility(true);\n\n setTitle(getString(R.string.search_results_title));\n } else {\n finish();\n }\n\n } else if (fragment instanceof MapViewFragment) {\n getSupportFragmentManager().popBackStackImmediate();\n } else {\n finish();\n }\n\n }\n }", "@Override\n public void onBtnClick() {\n dialog.dismiss();\n getMusicID(\"cancel\");\n }", "@Override\n public void onBackPressed() {\n \tshowDialog(DLG_BUTTONS);\n }", "private void setButtonOnClickListener() {\n binding.ibtBack.setOnClickListener(event -> navController.navigateUp());\n }", "@Override\n\tpublic boolean onNaviBackClick() {\n\t\treturn false;\n\t}", "public void clickBack(View view){\r\n onBackPressed();\r\n }", "@Override\n public void onClick(View view) {\n if (!Constants.getActivateBottomNavigationWidgetButton().equals(\"E-books\")) {\n disabledActivateBottomNavigationWidgetButton();\n\n ebookButton.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.ic_ebook, 0, 0);\n ebookButton.setTypeface(null, Typeface.BOLD);\n ebookButton.setTextColor(getResources().getColor(R.color.bottom_navigation_widget_button_enable_color));\n\n Utils.showLibrary(LibraryActivity.this, \"ebook\");\n Utils.triggerGAEvent(LibraryActivity.this, \"BottomNavigation\", \"E-books\", customerId);\n }\n }", "@Override\n\t\tpublic void onClick(View v) {\n\t\t\tswitch (v.getId()) {\n\t\t\tcase R.id.basicview_btn:\n\t\t\t\tviewPager.setCurrentItem(0);\n\t\t\t\tbreak;\n\t\t\tcase R.id.uploadview_btn:\n\t\t\t\tviewPager.setCurrentItem(1);\n\t\t\t\tbreak;\n\t\t\tcase R.id.back:\n\t\t\t\tfinish();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "@Override\n\tpublic void onBackPressed() {\n\t}", "@Override\n\tpublic void onBackPressed() {\n\t}", "@Override\n\tpublic void onBackPressed() {\n\t}", "@Override\n\tpublic void onBackPressed() {\n\t}", "@Override\n public void onBackPressed() {}", "@Override\n public void onPageSelected(int position) {\n if (position == 0 || position == layouts.size()-1) {\n btnPrevious.setVisibility(View.GONE);\n } else {\n btnPrevious.setVisibility(View.VISIBLE);\n }\n }", "@Override\n public void onBackPressed()\n {\n mIsBackButtonPressed = true;\n super.onBackPressed();\n \n }", "@Override\n\tpublic void onBackPressed()\n\t{\n\t}", "@Override\n\tpublic void onClick(View v) {\n\t\tif (v == tvBack) {\n\t\t\tthis.finish();\n\t\t}\n\t}", "@Override\n\tpublic void onClick(View v) {\n\t\tswitch (v.getId()) {\n\t\tcase R.id.backBtn:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "public void onClickButtonSaveSettingsLanguages(View view){\n super.onBackPressed();\n\n }", "@Override\n public void onBackPressed() {\n if (!mEditSymptomChanged) {\n super.onBackPressed();\n return;\n }\n //otherwise if there are unsaved changes setup a dialog to warn the user\n //handles the user confirming that changes should be made\n mHomeChecked = false;\n showUnsavedChangesDialogFragment();\n }", "@Override\n public void onBackPressed() {\n GalleryGridFragment currentPage = (GalleryGridFragment) getSupportFragmentManager().findFragmentByTag(\"android:switcher:\" + R.id.container + \":\" + mViewPager.getCurrentItem());\n\n if (currentPage != null) {\n // If the selection menu is showing, close it\n if (currentPage.numSelected > 0) {\n currentPage.clearSelected();\n return;\n }\n }\n super.onBackPressed();\n }", "@Override\n\tpublic void onClick(View v) {\n\t\tswitch (v.getId()) {\n\t\tcase R.id.img_back:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\n\tpublic void onClick(View arg0) {\n\t\tint i = arg0.getId();\n\t\tif (i == R.id.back) {\n\t\t\treBack();\n\n\t\t} else if (i == R.id.share_qmark_chat_group) {\n\t\t} else if (i == R.id.reset_qmark_chat_group) {\n\t\t\tshowResetDialog();\n\n\t\t} else {\n\t\t}\n\t}", "@Override\n public void onBackPressed() { }", "MutableLiveData<Boolean> onBackClicked() {\n return mBack;\n }", "@Override\n\tpublic void onClick(View v) {\n\t\tswitch (v.getId()) {\n\t\tcase R.id.fm1_jhtx:\n\t\t\tviewpager.setCurrentItem(0);\n\t\t\tsetTextViewBG(0);\n\t\t\tbreak;\n\t\tcase R.id.fm1_xt:\n\t\t\tviewpager.setCurrentItem(1);\n\t\t\tsetTextViewBG(1);\n\t\t\tbreak;\n\t\tcase R.id.top_return:\n\t\t\tthis.finish();\n\t\t\tbreak;\n\t\t}\n\t}", "void setupBtnBack() {\n Intent intent = getIntent();\n Bundle bundle = intent.getExtras();\n String str = bundle.getString(\"str\");\n\n ToastTip(str);\n\n Button btn_back = (Button)findViewById(R.id.btn_btn_back);\n\n btn_back.setOnClickListener(back_listener);\n }", "@Override\n public void onItemClick(AdapterView<?> arg0, View arg1,\n int position, long arg3) {\n\nSingletonTracks.getInstance().setTrack(position);\n PlayingFragment fragment = new PlayingFragment();\n FragmentTransaction transaction = getFragmentManager().beginTransaction();\n transaction.replace(R.id.fragement_container, fragment);\n transaction.addToBackStack(null);\n transaction.commit();\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n // Inflate the layout for this fragment\n mContentView = inflater.inflate(R.layout.fragment_choosing_media,null);\n\n btnAudio = (Button) mContentView.findViewById(R.id.btn_audio);\n btnVideo = (Button) mContentView.findViewById(R.id.btn_video);\n btnLive = (Button) mContentView.findViewById(R.id.btn_live);\n\n manager = getActivity().getSupportFragmentManager();\n transact= manager.beginTransaction();\n\n btnAudio.setOnClickListener(\n new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n type = 1;\n openFileBrowser(mContentView);\n\n }\n });\n btnVideo.setOnClickListener(\n new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n type = 2;\n openFileBrowser(mContentView);\n }\n });\n btnLive.setOnClickListener(\n new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n }\n });\n mContentView.setOnKeyListener(new View.OnKeyListener() {\n @Override\n public boolean onKey(View v, int keyCode, KeyEvent event) {\n if( keyCode == KeyEvent.KEYCODE_BACK ){\n // back to previous fragment by tag\n getActivity().getSupportFragmentManager().popBackStack();\n Log.d(\"ChoosingMedia--\",\" back success\");\n return true;\n }\n return false;\n }\n });\n\n\n return mContentView;\n }", "@Override\n public void onClick(View v) {\n switch (v.getId()) {\n case R.id.slide_system_button:\n setSystemRingtone();\n break;\n case R.id.slide_user_button:\n setDefinedRingtone();\n break;\n default:\n break;\n }\n dismissSlideMusicPop();\n }", "@Override\n public void onBoomButtonClick(int index) {\n fragment = null;\n fragmentClass = TvShowFragment.class;\n ((AppCompatActivity)getActivity()).getSupportActionBar().setTitle(\"TV Show\");\n ((AppCompatActivity)getActivity()).getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor(\"#660099\")));\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Window window = getActivity().getWindow();\n window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n window.setStatusBarColor(Color.parseColor(\"#660099\"));\n }\n mNavigationView = (NavigationView)getActivity().findViewById(R.id.nvView);\n Menu nv = mNavigationView.getMenu();\n MenuItem item = nv.findItem(R.id.nav_horloge_atomique_fragment);\n item.setChecked(true);\n try {\n fragment = (Fragment) fragmentClass.newInstance();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n // Insert the fragment by replacing any existing fragment\n FragmentManager fragmentManager = getActivity().getSupportFragmentManager();\n fragmentManager.beginTransaction().replace(R.id.flContent, fragment).commit();\n }", "@Override\n public boolean onSupportNavigateUp() {\n onBackPressed();\n return super.onSupportNavigateUp();\n }", "@Override\r\n public void onClick(View view) {\n Bundle bundle = new Bundle();\r\n bundle.putInt(CategoryItem.CAT_ID, categoryItem.getCategoryId());\r\n categoryFragment.setArguments(bundle);\r\n String title = mContext.getResources().getString(R.string.app_name);\r\n HomeMainActivity.addFragmentToBackStack(categoryFragment, title);\r\n }", "@Override\n public void onBackPressed()\n {\n // instead of going to new activity open up dialog fragment\n BackButtonDialogFragment backButtonDialogFragment = new BackButtonDialogFragment(this);\n backButtonDialogFragment.show(getSupportFragmentManager(),\"back\");\n }", "public void onBack(View w){\n onBackPressed();\n }", "@Override\n public void onBackPressed() {\n if (curFragment != PAGE_SHOP_CART) {\n backFragment(preFragment);\n } else {\n this.getParent().onBackPressed();\n }\n }", "@Override\r\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\r\n\t\toverridePendingTransition(R.anim.open_scale, R.anim.close_translate);\r\n\t}", "@Override\n\tpublic void onBackPressed() {\n\n\t}", "@Override\n\tpublic void onBackPressed()\n\t\t{\n\t\tbackPressed();\n\t\t}", "@Override\n\tpublic void onBackPressed() {\n\t\t\n\t}", "@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t}", "@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t}", "@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t}", "@Override\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\n\t}" ]
[ "0.7029968", "0.6999739", "0.69249445", "0.6672011", "0.66695297", "0.65880305", "0.6574326", "0.64732826", "0.64306885", "0.6428561", "0.64229625", "0.6364474", "0.63193864", "0.62992746", "0.62765104", "0.6265679", "0.6260774", "0.6260774", "0.6260774", "0.6260774", "0.6257455", "0.6254653", "0.62472814", "0.6246905", "0.6228174", "0.6219213", "0.6216835", "0.6188465", "0.6181442", "0.6181001", "0.6180204", "0.6173631", "0.6170281", "0.6153662", "0.61401296", "0.61401296", "0.61401296", "0.6138877", "0.61276567", "0.6111577", "0.6109981", "0.6090862", "0.6079365", "0.6079123", "0.60761964", "0.60749906", "0.6066763", "0.6061094", "0.60554403", "0.6053874", "0.60478055", "0.6047356", "0.60466087", "0.6045364", "0.6038832", "0.6037442", "0.6030552", "0.6026343", "0.60250986", "0.6007797", "0.60071355", "0.60035574", "0.59954417", "0.59944814", "0.599434", "0.599434", "0.599434", "0.599434", "0.59883904", "0.59862244", "0.59846115", "0.5980868", "0.59785223", "0.5976115", "0.5972033", "0.59632856", "0.5961654", "0.59612626", "0.5960358", "0.5960148", "0.5945881", "0.59452957", "0.59440154", "0.5941697", "0.59401906", "0.5938937", "0.593745", "0.5933749", "0.5930207", "0.5925568", "0.5921237", "0.59161216", "0.5914629", "0.59114486", "0.5909974", "0.5909515", "0.590794", "0.590794", "0.590794", "0.590794" ]
0.5966986
75
Only reset the adapter if the position has changed
@Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (position != mClickTypeSelection) { setActionSpinner(true, position); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void onDataSetChanged() {\n }", "public void dataSetChanged() {\n int count = this.mAdapter.getCount();\n this.mExpectedAdapterCount = count;\n boolean z = this.mItems.size() < (this.mOffscreenPageLimit * 2) + 1 && this.mItems.size() < count;\n int i = this.mCurItem;\n this.mChangeData = true;\n boolean z2 = z;\n int i2 = i;\n int i3 = 0;\n boolean z3 = false;\n while (i3 < this.mItems.size()) {\n ItemInfo itemInfo = this.mItems.get(i3);\n int itemPosition = this.mAdapter.getItemPosition(itemInfo.object);\n if (itemPosition != -1) {\n if (itemPosition == -2) {\n this.mItems.remove(i3);\n i3--;\n if (!z3) {\n this.mAdapter.startUpdate((ViewGroup) this);\n z3 = true;\n }\n this.mAdapter.destroyItem((ViewGroup) this, itemInfo.position, itemInfo.object);\n if (this.mCurItem == itemInfo.position) {\n i2 = Math.max(0, Math.min(this.mCurItem, count - 1));\n }\n } else if (itemInfo.position != itemPosition) {\n if (itemInfo.position == this.mCurItem) {\n i2 = itemPosition;\n }\n itemInfo.position = itemPosition;\n }\n z2 = true;\n }\n i3++;\n }\n if (z3) {\n this.mAdapter.finishUpdate((ViewGroup) this);\n }\n if (z2) {\n int childCount = getChildCount();\n for (int i4 = 0; i4 < childCount; i4++) {\n LayoutParams layoutParams = (LayoutParams) getChildAt(i4).getLayoutParams();\n if (!layoutParams.isDecor) {\n layoutParams.widthFactor = 0.0f;\n }\n }\n setCurrentItemInternal(i2, false, true);\n requestLayout();\n }\n }", "private void resetAdapter() {\n\n\t\tmSwipeList.discardUndo();\n\n\t\tString[] items = new String[20];\n\t\tfor (int i = 0; i < items.length; i++) {\n\t\t\titems[i] = String.format(\"Test Item %d\", i);\n\t\t}\n\n\t\tmAdapter = new ArrayAdapter<String>(this,\n\t\t\tandroid.R.layout.simple_list_item_1,\n\t\t\tandroid.R.id.text1,\n\t\t\tnew ArrayList<String>(Arrays.asList(items)));\n\t\tsetListAdapter(mAdapter);\n\n\t}", "public void resetAdapter() {\n\n // Hide ProgressBar\n mBinding.searchUserLayout.getUvm().hideProgress();\n\n // Cancel any pending searches\n mSearchHandler.removeCallbacksAndMessages(null);\n\n // Clear the Adapter\n mAdapter.clear();\n }", "public void notifyDataSetChanged(int position ) {\n\t\tmSelectPosition = position;\r\n\t\tsuper.notifyDataSetChanged();\r\n\t}", "public void reset() {\n position = 0;\n }", "public void notifyDataSetChanged() {\n viewState.setShouldRefreshEvents(true);\n invalidate();\n }", "@Override\n public void onAdapterAboutToEmpty(int itemsInAdapter) {\n arrayAdapter.notifyDataSetChanged();\n Log.d(\"LIST\", \"notified\");\n i++;\n }", "@Override\n public void notifyDataSetChanged() {\n super.notifyDataSetChanged();\n }", "public void resetVelden(View view){\n //sortSpinner.setSelection(0);\n activity.resetFilteredAdapterData(); // resets the data of the adapter in the parent activity.\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n mAdapter.notifyItemRemoved(position + 1); //notifies the RecyclerView Adapter that data in adapter has been removed at a particular position.\n mAdapter.notifyItemRangeChanged(position, mAdapter.getItemCount()); //notifies the RecyclerView Adapter that positions of element in adapter has been changed from position(removed element index to end of list), please update it.\n }", "public void reset()\n {\n currentPosition = 0;\n }", "public void onDataSetChanged();", "public void run() {\n updateBtn.reset();\n notifyDataSetChanged();\n }", "public void notifyChanged() {\n notifyDataSetChanged();\n }", "public void reset() {\n resetData();\n postInvalidate();\n }", "public void setPosition(){\r\n currentPosition = 0; \r\n }", "public void resetPosition()\n {\n resetPosition(false);\n }", "@Override\n public void sure() {\n orderListAdpater.notifyDataSetChanged();\n onOrderUpdate();\n }", "@Override\n public void sure() {\n orderListAdpater.notifyDataSetChanged();\n onOrderUpdate();\n }", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n adapter.swapCursor(null);\n }", "@Override\n public void onLoaderReset(Loader loader) {\n mAdapter.swapCursor(null);\n }", "public void refreshAdapter() {\n int count = 0;\n removeAllViews();\n for (TypeViewInfo info : this.mTypeToView.values()) {\n info.currentUsedPosition = 0;\n }\n if (this.mListAdapter != null) {\n count = this.mListAdapter.getCount();\n }\n for (int i = 0; i < count; i++) {\n Integer type = Integer.valueOf(this.mListAdapter.getItemViewType(i));\n if (!this.mTypeToView.containsKey(type)) {\n this.mTypeToView.put(type, new TypeViewInfo(type));\n }\n TypeViewInfo info2 = this.mTypeToView.get(type);\n View canvasView = info2.currentUsedPosition < info2.holdViews.size() ? info2.holdViews.get(info2.currentUsedPosition) : null;\n View current = this.mListAdapter.getView(i, canvasView, this);\n if (current == null) {\n throw new RuntimeException(\"Adapter.getView(postion , convasView, viewParent) cannot be null \");\n }\n if (canvasView != current) {\n if (canvasView == null) {\n info2.holdViews.add(current);\n } else {\n info2.holdViews.remove(canvasView);\n info2.holdViews.add(info2.currentUsedPosition, current);\n }\n }\n info2.currentUsedPosition++;\n addView(current);\n }\n this.mSelectIndex = Math.min(this.mSelectIndex, (float) (count - 1));\n this.mSelectIndex = Math.max(0.0f, this.mSelectIndex);\n calculationRect(true);\n }", "public boolean resetToPreviousPosition()\n {\n return setPosition( previousPosition);\n }", "@Override\r\n\tpublic void notifyDataSetChanged() {\n\t\tsuper.notifyDataSetChanged();\r\n\t\tLog.v(\"DEBUG\", \"CHANGE\");\r\n\t}", "@Override\n public void sure() {\n orderListAdpater.notifyDataSetChanged();\n onOrderUpdate();\n }", "@Override\n public void onLoaderReset(android.support.v4.content.Loader loader) {\n adapter.swapCursor(null);\n }", "public void notifyDataSetChanged() {\n if (noxItemCatalog != null) {\n noxItemCatalog.recreate();\n createShape();\n initializeScroller();\n refreshView();\n }\n }", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n mAdapter.swapCursor(null);\n }", "private void refresh(int position) {\n mCurrentTabPosition = position;\n mCampaignAdapter.refreshAll();\n }", "public void reset(){\n\t\tthis.currentIndex = 0;\n\t}", "public void refreshAdapter() {\n\t\tadapter.notifyDataSetChanged();\n\t\tthis.listView.onRefreshComplete();\n\t}", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n // Clear the Cursor we were using with another call to the swapCursor()\n adapter.swapCursor(null);\n }", "@Override\n\t\tprotected void onPostExecute(Cursor result) {\n\t\t\tmAdapter.swapCursor(result);\n\t\t}", "@Override\n public int getItemViewType(int position) {\n return position; // USE THIS FOR KEEP OLD VIEW DATA WHEN SCROLL.\n }", "@Override\n public void onClick(View view) {\n update(holder.getAdapterPosition());\n }", "@Override\n\tpublic void onLoaderReset(Loader<Cursor> loader) {\n\t\tmAdapter.swapCursor(null);\n\t}", "@Override\n\tpublic void notifyDataSetChanged() {\n\t\tsuper.notifyDataSetChanged();\n\t\tsetIndexer(list);\n\t}", "private void update(int position) {\n File f = list_items[position];\n list_items = f.listFiles();\n notifyDataSetChanged();\n }", "protected void notifyItemChanged(int position) {\n notifyItemChanged(mAdapter.getItem(position));\n }", "protected void notifyItemsChanged() {\n notifyItemsChanged(0, mAdapter.getItemCount());\n }", "public void notifyDataSetChanged() {\n\t\tthis.mModelRssItems = mBusinessRss.getModelRssItem(mRssName,\n\t\t\t\tmOnlyViewUnRead);\n\t\tsuper.notifyDataSetChanged();\n\t}", "@Override\n public void onLoaderReset(Loader<List<StockPicking>> loader) {\n mAdapter.clear();\n }", "protected void refillInternal(final int lastItemPos,final int firstItemPos){\n\t if (mAdapter == null) {\n\t return;\n\t }\n\t if(mAdapter.getCount() == 0){\n\t \treturn;\n\t }\n\t \t\t\n\t\tif(getChildCount() == 0){\n\t\t\tfillFirstTime(lastItemPos, firstItemPos);\n\t\t}\n\t\telse{\n\t\t\trelayout();\n\t\t\tremoveNonVisibleViews();\n\t\t\trefillRight();\n\t\t\trefillLeft();\n\t\t}\n\t}", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n this.goalAdapter.swapCursor(null);\n }", "@Override\n public void sure() {\n onOrderUpdate();\n orderListAdpater.notifyDataSetChanged();\n }", "@Override\n public void sure() {\n onOrderUpdate();\n orderListAdpater.notifyDataSetChanged();\n }", "@Override\n public void onDataSetChanged() {\n final long identityToken = Binder.clearCallingIdentity();\n mPresenter.getStocksData();\n Binder.restoreCallingIdentity(identityToken);\n }", "public void notifyDataChanged() {\n notifyDataSetChanged();\n isLoading = false;\n }", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n mPurseAdapter.swapCursor(null);\n }", "private void reset() {\n\n mPullRefreshEnabled = mAutoLoadAdapter.getPullToRefreshEn();\n mIsLoadMoreEn = mAutoLoadAdapter.getLoadMoreEn();\n mIsFooterEn = mAutoLoadAdapter.getFooterEn();\n mIsLoadMoreErrEn = mAutoLoadAdapter.getLoadMoreErrEn();\n setLoadingMore(false);\n }", "@Override\n public void onLoaderReset(Loader<List<EarthQuake>> loader) {\n mAdapter.clear();\n }", "@Override\r\n public void removeFirstObjectInAdapter() {\n Log.d(\"LIST\", \"removed object!\");\r\n al.remove(0);\r\n arrayAdapter.notifyDataSetChanged();\r\n }", "private void resetSearchAheadList() {\n if (!searchResultsData.isEmpty()) {\n searchResultsData.clear();\n searchAdapter.notifyDataSetChanged();\n }\n }", "public void onItemUnsetSelection(AdapterView<?> parent, View view, int position);", "@Override\n public void removeFirstObjectInAdapter() {\n Log.d(\"LIST\", \"removed object!\");\n rowItem.remove(0);\n arrayAdapter.notifyDataSetChanged();\n }", "@Override\n public void onItemDismiss(int position) {\n dummyDataList.remove(position);\n notifyItemRemoved(position);\n\n }", "public void invalidate()\n\t{\n\t\tif (this.holder != null) {\n\t\t\tthis.holder.bind(this, this.holder.itemView.isActivated());\n\t\t}\n\t}", "@Override\n public void updateItem(DataModel newItem, int position) {\n\n deleteItem(position);\n originalData.add(0, newItem);\n currentData.add(0, newItem);\n }", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n bookAdapter.swapCursor(null);\n }", "@Override\r\n public void onLoaderReset(Loader<List<News>> loader) {\n mAdapter.clear();\r\n }", "@Override\n public void onLoaderReset(Loader<List<Pokemon>> loader) {\n mAdapter.clear();\n }", "private void refreshData(){\n Log.d(LOG_TAG, \"refreshData()\");\n mRVAdapter.setData(null);\n loadData();\n }", "public void clear(){\n nyts.clear();\n notifyDataSetChanged();\n }", "@Override\n public void setChanged() {\n set(getItem());\n }", "protected void refreshAdapter() {\n if (mAdapter == null) {\n mAdapter = createMonthAdapter(mController);\n } else {\n mAdapter.setSelectedDay(mSelectedDay);\n if (pageListener != null) pageListener.onPageChanged(getMostVisiblePosition());\n }\n // refresh the view with the new parameters\n setAdapter(mAdapter);\n }", "@Override\n public void onLoaderReset(Loader<List<Book>> loader) {\n mAdapter.clear();\n }", "@Override\n public void onLoaderReset(Loader<ArrayList<Book>> loader) {\n adapter.clear();\n Log.i(LOG_TAG,\"onLoaderReset\");\n }", "@Override\n public void onLoaderReset(Loader<ArrayList<NewsItem>> loader) {\n newsAdapter.clear();\n }", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tmAdapter.notifyDataSetChanged(mDataArrays);\n\t\t\t\t\tmListView.setSelection(mListView.getCount() - 1);\n\t\t\t\t}", "@Override\n public void onBindViewHolder(@NonNull RVAdapter.ViewHolder holder, final int position) {\n Log.d (\"debugMode\", \"onBindHolder getting position in list....\");\n Location location = mValues.get(position);\n Log.d (\"debugMode\", \"onBindHolder beginning to assign values to holder....\");\n holder.mLocation.setText(location.getName());\n\n if (location.getCustom().equals(\"false\")) {\n holder.mDelete.setVisibility(View.INVISIBLE);\n holder.mDelete.setEnabled(false);\n } else {\n holder.mDelete.setVisibility(View.VISIBLE);\n holder.mDelete.setEnabled(true);\n }\n\n /*\n *when the user clicks delete on an item, the file of the contents is deleted\n *and rewritten with the previous items, minus the deleted item\n */\n holder.mDelete.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Log.d(\"debugMode\", \"delete pressed\");\n mValues.remove(position);\n notifyItemRemoved(position);\n notifyItemRangeChanged(position, mValues.size());\n removeContentsFromFile();\n rewriteLocationList(mValues);\n }\n });\n Log.d (\"debugMode\", \"onBindHolder succeeded in assigning to holder in adapter...\");\n }", "public void resetCounts() {\n // For each item in the RecyclerView\n for(int pos = 0; pos < numItems; pos++) {\n // Reset the count variable of the item\n DataStorage.listInUse.getList().get(pos).reset();\n notifyItemChanged(pos);\n }\n }", "protected void notifyItemsChanged(int positionStart) {\n notifyItemsChanged(positionStart, mAdapter.getItemCount() - positionStart);\n }", "@Override\n public void onClick(View view) {\n slctdExpndColpsPostn = position;\n notifyDataSetChanged();\n }", "@Override\n public void onLoaderReset(@NonNull Loader<List<newslist>> loader) {\n mAdapter.clear();\n }", "private void refreshData(){\n filempty.setVisibility(View.GONE);\n adapter = new FoundRecyclerviewAdapter(FoundActivity.this, data);\n v.setAdapter(adapter);\n emptyView();\n }", "@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tchoosed = pos;\n\t\t\t\t\t\tSingleListAdaper.this.notifyDataSetChanged();\n\t\t\t\t\t}", "public void notifyDataSetChanged() {\n\t\tmDataSetObservable.notifyChanged();\n\t}", "@Override\n\tpublic void onLoaderReset(Loader<Cursor> loader) {\n\t\tsetListAdapter(null);\n\t}", "@Override\n public void deleteItem(int position) {\n originalData.remove(currentData.get(position));\n //Removed of the current data using the current position gotten from the click listener\n currentData.remove(position);\n\n //Notify changes to adapter through presenter\n }", "@Override\n public void onBindViewHolder(ViewHolder holder, int position) {\n mCursorAdapter.getCursor().moveToPosition(position); //EDITED: added this line as suggested in the comments below, thanks :)\n mCursorAdapter.bindView(holder.itemView, mContext, mCursorAdapter.getCursor());\n\n }", "@Override\n public void setAdapter(Adapter adapter) {\n Adapter previousAdapter = getAdapter();\n if (previousAdapter != null)\n previousAdapter.unregisterAdapterDataObserver(mEmptyAdapterDataObserver);\n\n // register observer for new adapter\n if (adapter != null)\n adapter.registerAdapterDataObserver(mEmptyAdapterDataObserver);\n\n // update adapter\n super.setAdapter(adapter);\n }", "@Override\n public void clear() {\n original.clear();\n filtered.clear();\n notifyDataSetChanged();\n }", "public void refreshListView() {\n if (recyclerViewAdapter != null) {\n recyclerViewAdapter.notifyDataSetChanged();\n }\n }", "public void onLoaderReset(Loader<Cursor> arg0) {\n \t adapter.swapCursor(null);\n \t\t\n \t}", "public void resetPosition() {\n\t\tposition = new double[3];\n\t\tgyroOffset = 0;\n\t}", "@Override\n public void onBindViewHolder(ViewHolder viewHolder, final int position)\n {\n Log.d(TAG, \"Element \" + position + \" set.\");\n\n if(position==0)\n {\n posicion=1;\n }\n if(position==1)\n {\n posicion=2;\n }\n if(position==2)\n {\n posicion=3;\n }\n if(position==3)\n {\n posicion=4;\n }\n if(position==4)\n {\n posicion=5;\n }\n if(position==5)\n {\n posicion=6;\n }\n\n // Get element from your dataset at this position and replace the contents of the view\n // with that element\n viewHolder.getTextView().setText(mDataSet[position]);\n }", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n mCursorAdapter.swapCursor(null);\n }", "@Override\r\n public Object getItem(int position) {\n return null;\r\n }", "@Override\n public void onDetach() {\n super.onDetach();\n adapter.notifyDataSetChanged();\n Bimp.tempSelectBitmap.clear();\n Bimp.max = 0;\n }", "@Override\n public void onPageSelected(int position) {\n viewPager.getAdapter().notifyDataSetChanged();\n Log.d(\"ADebugTag\", \"***************notifyDataSetChanged*************** \");\n\n }", "@Override\r\n public void onItemsChanged(RecyclerView recyclerView){\r\n isNotifyDataSetChanged = true;\r\n }", "public void refreshList() {\n mCursor.requery();\n mCount = mCursor.getCount() + mExtraOffset;\n notifyDataSetChanged();\n }", "public void notifyAdapters() {\n for (int size = this.mAdapters.size() - 1; size >= 0; size--) {\n BaseUserAdapter baseUserAdapter = this.mAdapters.get(size).get();\n if (baseUserAdapter != null) {\n baseUserAdapter.notifyDataSetChanged();\n } else {\n this.mAdapters.remove(size);\n }\n }\n }", "public void remove(int position) {\n if (mUpdateData != null && 0 != getCount()) {\n mUpdateData.remove(position);\n }\n notifyDataSetChanged();\n }", "@Override\n public void onBindViewHolder(ViewHolder itemViewHolder, int position) {\n }", "@Override\r\n public void onLoaderReset(Loader<List<NewsList>> loader) {\n adapter.clear();\r\n }", "@Override\n public void run() {\n notifyDataSetChanged();\n }", "public void notifyDataSetChanged() {\n /*\n r17 = this;\n r0 = r17\n org.telegram.ui.Components.StickerMasksAlert r1 = org.telegram.ui.Components.StickerMasksAlert.this\n org.telegram.ui.Components.RecyclerListView r1 = r1.gridView\n int r1 = r1.getMeasuredWidth()\n if (r1 != 0) goto L_0x0012\n android.graphics.Point r1 = org.telegram.messenger.AndroidUtilities.displaySize\n int r1 = r1.x\n L_0x0012:\n r2 = 1116733440(0x42900000, float:72.0)\n int r2 = org.telegram.messenger.AndroidUtilities.dp(r2)\n int r1 = r1 / r2\n r0.stickersPerRow = r1\n org.telegram.ui.Components.StickerMasksAlert r1 = org.telegram.ui.Components.StickerMasksAlert.this\n androidx.recyclerview.widget.GridLayoutManager r1 = r1.stickersLayoutManager\n int r2 = r0.stickersPerRow\n r1.setSpanCount(r2)\n android.util.SparseArray<java.lang.Object> r1 = r0.rowStartPack\n r1.clear()\n java.util.HashMap<java.lang.Object, java.lang.Integer> r1 = r0.packStartPosition\n r1.clear()\n android.util.SparseIntArray r1 = r0.positionToRow\n r1.clear()\n android.util.SparseArray<java.lang.Object> r1 = r0.cache\n r1.clear()\n r1 = 0\n r0.totalItems = r1\n org.telegram.ui.Components.StickerMasksAlert r2 = org.telegram.ui.Components.StickerMasksAlert.this\n java.util.ArrayList[] r2 = r2.stickerSets\n org.telegram.ui.Components.StickerMasksAlert r3 = org.telegram.ui.Components.StickerMasksAlert.this\n int r3 = r3.currentType\n r2 = r2[r3]\n r3 = -3\n r4 = -3\n r5 = 0\n L_0x004e:\n int r6 = r2.size()\n if (r4 >= r6) goto L_0x0160\n if (r4 != r3) goto L_0x0067\n android.util.SparseArray<java.lang.Object> r6 = r0.cache\n int r7 = r0.totalItems\n int r8 = r7 + 1\n r0.totalItems = r8\n java.lang.String r8 = \"search\"\n r6.put(r7, r8)\n int r5 = r5 + 1\n goto L_0x015a\n L_0x0067:\n r6 = -2\n java.lang.String r7 = \"fav\"\n java.lang.String r8 = \"recent\"\n r9 = -1\n r10 = 0\n if (r4 != r6) goto L_0x008e\n org.telegram.ui.Components.StickerMasksAlert r6 = org.telegram.ui.Components.StickerMasksAlert.this\n int r6 = r6.currentType\n if (r6 != 0) goto L_0x008b\n org.telegram.ui.Components.StickerMasksAlert r6 = org.telegram.ui.Components.StickerMasksAlert.this\n java.util.ArrayList r6 = r6.favouriteStickers\n java.util.HashMap<java.lang.Object, java.lang.Integer> r11 = r0.packStartPosition\n int r12 = r0.totalItems\n java.lang.Integer r12 = java.lang.Integer.valueOf(r12)\n r11.put(r7, r12)\n r11 = r7\n goto L_0x00aa\n L_0x008b:\n r6 = r10\n r11 = r6\n goto L_0x00c8\n L_0x008e:\n if (r4 != r9) goto L_0x00b0\n org.telegram.ui.Components.StickerMasksAlert r6 = org.telegram.ui.Components.StickerMasksAlert.this\n java.util.ArrayList[] r6 = r6.recentStickers\n org.telegram.ui.Components.StickerMasksAlert r11 = org.telegram.ui.Components.StickerMasksAlert.this\n int r11 = r11.currentType\n r6 = r6[r11]\n java.util.HashMap<java.lang.Object, java.lang.Integer> r11 = r0.packStartPosition\n int r12 = r0.totalItems\n java.lang.Integer r12 = java.lang.Integer.valueOf(r12)\n r11.put(r8, r12)\n r11 = r8\n L_0x00aa:\n r16 = r10\n r10 = r6\n r6 = r16\n goto L_0x00c8\n L_0x00b0:\n java.lang.Object r6 = r2.get(r4)\n org.telegram.tgnet.TLRPC$TL_messages_stickerSet r6 = (org.telegram.tgnet.TLRPC$TL_messages_stickerSet) r6\n java.util.ArrayList<org.telegram.tgnet.TLRPC$Document> r11 = r6.documents\n java.util.HashMap<java.lang.Object, java.lang.Integer> r12 = r0.packStartPosition\n int r13 = r0.totalItems\n java.lang.Integer r13 = java.lang.Integer.valueOf(r13)\n r12.put(r6, r13)\n r16 = r11\n r11 = r10\n r10 = r16\n L_0x00c8:\n if (r10 == 0) goto L_0x015a\n boolean r12 = r10.isEmpty()\n if (r12 == 0) goto L_0x00d2\n goto L_0x015a\n L_0x00d2:\n int r12 = r10.size()\n float r12 = (float) r12\n int r13 = r0.stickersPerRow\n float r13 = (float) r13\n float r12 = r12 / r13\n double r12 = (double) r12\n double r12 = java.lang.Math.ceil(r12)\n int r12 = (int) r12\n if (r6 == 0) goto L_0x00eb\n android.util.SparseArray<java.lang.Object> r13 = r0.cache\n int r14 = r0.totalItems\n r13.put(r14, r6)\n goto L_0x00f2\n L_0x00eb:\n android.util.SparseArray<java.lang.Object> r13 = r0.cache\n int r14 = r0.totalItems\n r13.put(r14, r10)\n L_0x00f2:\n android.util.SparseIntArray r13 = r0.positionToRow\n int r14 = r0.totalItems\n r13.put(r14, r5)\n r13 = 0\n L_0x00fa:\n int r14 = r10.size()\n if (r13 >= r14) goto L_0x012e\n int r14 = r13 + 1\n int r15 = r0.totalItems\n int r15 = r15 + r14\n android.util.SparseArray<java.lang.Object> r1 = r0.cache\n java.lang.Object r3 = r10.get(r13)\n r1.put(r15, r3)\n if (r6 == 0) goto L_0x0116\n android.util.SparseArray<java.lang.Object> r1 = r0.cacheParents\n r1.put(r15, r6)\n goto L_0x011b\n L_0x0116:\n android.util.SparseArray<java.lang.Object> r1 = r0.cacheParents\n r1.put(r15, r11)\n L_0x011b:\n android.util.SparseIntArray r1 = r0.positionToRow\n int r3 = r0.totalItems\n int r3 = r3 + r14\n int r15 = r5 + 1\n int r9 = r0.stickersPerRow\n int r13 = r13 / r9\n int r15 = r15 + r13\n r1.put(r3, r15)\n r13 = r14\n r1 = 0\n r3 = -3\n r9 = -1\n goto L_0x00fa\n L_0x012e:\n r1 = 0\n L_0x012f:\n int r3 = r12 + 1\n if (r1 >= r3) goto L_0x014e\n if (r6 == 0) goto L_0x013e\n android.util.SparseArray<java.lang.Object> r3 = r0.rowStartPack\n int r9 = r5 + r1\n r3.put(r9, r6)\n r10 = -1\n goto L_0x014b\n L_0x013e:\n android.util.SparseArray<java.lang.Object> r3 = r0.rowStartPack\n int r9 = r5 + r1\n r10 = -1\n if (r4 != r10) goto L_0x0147\n r11 = r8\n goto L_0x0148\n L_0x0147:\n r11 = r7\n L_0x0148:\n r3.put(r9, r11)\n L_0x014b:\n int r1 = r1 + 1\n goto L_0x012f\n L_0x014e:\n int r1 = r0.totalItems\n int r6 = r0.stickersPerRow\n int r12 = r12 * r6\n int r12 = r12 + 1\n int r1 = r1 + r12\n r0.totalItems = r1\n int r5 = r5 + r3\n L_0x015a:\n int r4 = r4 + 1\n r1 = 0\n r3 = -3\n goto L_0x004e\n L_0x0160:\n super.notifyDataSetChanged()\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.telegram.ui.Components.StickerMasksAlert.StickersGridAdapter.notifyDataSetChanged():void\");\n }", "@Override\n public void onClick(View view) {\n adapter.restoreItem(deletedModel, deletedPosition);\n }", "@Override\n public void onBindViewHolder(ViewHolder holder, int position) {\n\n }" ]
[ "0.6914882", "0.6907704", "0.68947357", "0.6882564", "0.6875764", "0.67636395", "0.66102964", "0.66094327", "0.65814525", "0.6556969", "0.6543786", "0.65247923", "0.652151", "0.64932853", "0.6487625", "0.6471397", "0.64660144", "0.64654386", "0.64120936", "0.6403884", "0.63893694", "0.6373339", "0.6370584", "0.63597554", "0.6350752", "0.6347568", "0.63460064", "0.6335684", "0.63305426", "0.6329952", "0.6298356", "0.62846935", "0.62727875", "0.6253653", "0.62473375", "0.62405604", "0.6220277", "0.6219987", "0.62018955", "0.6192639", "0.61811596", "0.617757", "0.61640656", "0.61451584", "0.61448133", "0.61390656", "0.61390656", "0.6137318", "0.61259806", "0.6124807", "0.6123646", "0.6111007", "0.6105023", "0.60983455", "0.60961014", "0.6095522", "0.60730404", "0.60720503", "0.6068729", "0.6063339", "0.6062435", "0.60617757", "0.6061495", "0.6058793", "0.605467", "0.60439247", "0.60357606", "0.6026268", "0.6024817", "0.6023828", "0.6016759", "0.60133797", "0.60062426", "0.6006043", "0.6002112", "0.5989604", "0.5985577", "0.598143", "0.5978416", "0.59783137", "0.59783006", "0.5966623", "0.59645414", "0.59602886", "0.59548753", "0.5954432", "0.5952294", "0.5950974", "0.59500575", "0.5949321", "0.594133", "0.5939622", "0.5921946", "0.5919279", "0.59112173", "0.58990556", "0.5898781", "0.5895193", "0.5894395", "0.5892687", "0.58912355" ]
0.0
-1
Only reset the adapter if the position has changed
@Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (position != mHoldTypeSelection) { setActionSpinner(false, position); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void onDataSetChanged() {\n }", "public void dataSetChanged() {\n int count = this.mAdapter.getCount();\n this.mExpectedAdapterCount = count;\n boolean z = this.mItems.size() < (this.mOffscreenPageLimit * 2) + 1 && this.mItems.size() < count;\n int i = this.mCurItem;\n this.mChangeData = true;\n boolean z2 = z;\n int i2 = i;\n int i3 = 0;\n boolean z3 = false;\n while (i3 < this.mItems.size()) {\n ItemInfo itemInfo = this.mItems.get(i3);\n int itemPosition = this.mAdapter.getItemPosition(itemInfo.object);\n if (itemPosition != -1) {\n if (itemPosition == -2) {\n this.mItems.remove(i3);\n i3--;\n if (!z3) {\n this.mAdapter.startUpdate((ViewGroup) this);\n z3 = true;\n }\n this.mAdapter.destroyItem((ViewGroup) this, itemInfo.position, itemInfo.object);\n if (this.mCurItem == itemInfo.position) {\n i2 = Math.max(0, Math.min(this.mCurItem, count - 1));\n }\n } else if (itemInfo.position != itemPosition) {\n if (itemInfo.position == this.mCurItem) {\n i2 = itemPosition;\n }\n itemInfo.position = itemPosition;\n }\n z2 = true;\n }\n i3++;\n }\n if (z3) {\n this.mAdapter.finishUpdate((ViewGroup) this);\n }\n if (z2) {\n int childCount = getChildCount();\n for (int i4 = 0; i4 < childCount; i4++) {\n LayoutParams layoutParams = (LayoutParams) getChildAt(i4).getLayoutParams();\n if (!layoutParams.isDecor) {\n layoutParams.widthFactor = 0.0f;\n }\n }\n setCurrentItemInternal(i2, false, true);\n requestLayout();\n }\n }", "private void resetAdapter() {\n\n\t\tmSwipeList.discardUndo();\n\n\t\tString[] items = new String[20];\n\t\tfor (int i = 0; i < items.length; i++) {\n\t\t\titems[i] = String.format(\"Test Item %d\", i);\n\t\t}\n\n\t\tmAdapter = new ArrayAdapter<String>(this,\n\t\t\tandroid.R.layout.simple_list_item_1,\n\t\t\tandroid.R.id.text1,\n\t\t\tnew ArrayList<String>(Arrays.asList(items)));\n\t\tsetListAdapter(mAdapter);\n\n\t}", "public void resetAdapter() {\n\n // Hide ProgressBar\n mBinding.searchUserLayout.getUvm().hideProgress();\n\n // Cancel any pending searches\n mSearchHandler.removeCallbacksAndMessages(null);\n\n // Clear the Adapter\n mAdapter.clear();\n }", "public void notifyDataSetChanged(int position ) {\n\t\tmSelectPosition = position;\r\n\t\tsuper.notifyDataSetChanged();\r\n\t}", "public void reset() {\n position = 0;\n }", "public void notifyDataSetChanged() {\n viewState.setShouldRefreshEvents(true);\n invalidate();\n }", "@Override\n public void onAdapterAboutToEmpty(int itemsInAdapter) {\n arrayAdapter.notifyDataSetChanged();\n Log.d(\"LIST\", \"notified\");\n i++;\n }", "@Override\n public void notifyDataSetChanged() {\n super.notifyDataSetChanged();\n }", "public void resetVelden(View view){\n //sortSpinner.setSelection(0);\n activity.resetFilteredAdapterData(); // resets the data of the adapter in the parent activity.\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n mAdapter.notifyItemRemoved(position + 1); //notifies the RecyclerView Adapter that data in adapter has been removed at a particular position.\n mAdapter.notifyItemRangeChanged(position, mAdapter.getItemCount()); //notifies the RecyclerView Adapter that positions of element in adapter has been changed from position(removed element index to end of list), please update it.\n }", "public void reset()\n {\n currentPosition = 0;\n }", "public void onDataSetChanged();", "public void run() {\n updateBtn.reset();\n notifyDataSetChanged();\n }", "public void notifyChanged() {\n notifyDataSetChanged();\n }", "public void reset() {\n resetData();\n postInvalidate();\n }", "public void setPosition(){\r\n currentPosition = 0; \r\n }", "public void resetPosition()\n {\n resetPosition(false);\n }", "@Override\n public void sure() {\n orderListAdpater.notifyDataSetChanged();\n onOrderUpdate();\n }", "@Override\n public void sure() {\n orderListAdpater.notifyDataSetChanged();\n onOrderUpdate();\n }", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n adapter.swapCursor(null);\n }", "@Override\n public void onLoaderReset(Loader loader) {\n mAdapter.swapCursor(null);\n }", "public void refreshAdapter() {\n int count = 0;\n removeAllViews();\n for (TypeViewInfo info : this.mTypeToView.values()) {\n info.currentUsedPosition = 0;\n }\n if (this.mListAdapter != null) {\n count = this.mListAdapter.getCount();\n }\n for (int i = 0; i < count; i++) {\n Integer type = Integer.valueOf(this.mListAdapter.getItemViewType(i));\n if (!this.mTypeToView.containsKey(type)) {\n this.mTypeToView.put(type, new TypeViewInfo(type));\n }\n TypeViewInfo info2 = this.mTypeToView.get(type);\n View canvasView = info2.currentUsedPosition < info2.holdViews.size() ? info2.holdViews.get(info2.currentUsedPosition) : null;\n View current = this.mListAdapter.getView(i, canvasView, this);\n if (current == null) {\n throw new RuntimeException(\"Adapter.getView(postion , convasView, viewParent) cannot be null \");\n }\n if (canvasView != current) {\n if (canvasView == null) {\n info2.holdViews.add(current);\n } else {\n info2.holdViews.remove(canvasView);\n info2.holdViews.add(info2.currentUsedPosition, current);\n }\n }\n info2.currentUsedPosition++;\n addView(current);\n }\n this.mSelectIndex = Math.min(this.mSelectIndex, (float) (count - 1));\n this.mSelectIndex = Math.max(0.0f, this.mSelectIndex);\n calculationRect(true);\n }", "public boolean resetToPreviousPosition()\n {\n return setPosition( previousPosition);\n }", "@Override\r\n\tpublic void notifyDataSetChanged() {\n\t\tsuper.notifyDataSetChanged();\r\n\t\tLog.v(\"DEBUG\", \"CHANGE\");\r\n\t}", "@Override\n public void sure() {\n orderListAdpater.notifyDataSetChanged();\n onOrderUpdate();\n }", "@Override\n public void onLoaderReset(android.support.v4.content.Loader loader) {\n adapter.swapCursor(null);\n }", "public void notifyDataSetChanged() {\n if (noxItemCatalog != null) {\n noxItemCatalog.recreate();\n createShape();\n initializeScroller();\n refreshView();\n }\n }", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n mAdapter.swapCursor(null);\n }", "private void refresh(int position) {\n mCurrentTabPosition = position;\n mCampaignAdapter.refreshAll();\n }", "public void reset(){\n\t\tthis.currentIndex = 0;\n\t}", "public void refreshAdapter() {\n\t\tadapter.notifyDataSetChanged();\n\t\tthis.listView.onRefreshComplete();\n\t}", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n // Clear the Cursor we were using with another call to the swapCursor()\n adapter.swapCursor(null);\n }", "@Override\n\t\tprotected void onPostExecute(Cursor result) {\n\t\t\tmAdapter.swapCursor(result);\n\t\t}", "@Override\n public int getItemViewType(int position) {\n return position; // USE THIS FOR KEEP OLD VIEW DATA WHEN SCROLL.\n }", "@Override\n public void onClick(View view) {\n update(holder.getAdapterPosition());\n }", "@Override\n\tpublic void onLoaderReset(Loader<Cursor> loader) {\n\t\tmAdapter.swapCursor(null);\n\t}", "@Override\n\tpublic void notifyDataSetChanged() {\n\t\tsuper.notifyDataSetChanged();\n\t\tsetIndexer(list);\n\t}", "private void update(int position) {\n File f = list_items[position];\n list_items = f.listFiles();\n notifyDataSetChanged();\n }", "protected void notifyItemChanged(int position) {\n notifyItemChanged(mAdapter.getItem(position));\n }", "protected void notifyItemsChanged() {\n notifyItemsChanged(0, mAdapter.getItemCount());\n }", "public void notifyDataSetChanged() {\n\t\tthis.mModelRssItems = mBusinessRss.getModelRssItem(mRssName,\n\t\t\t\tmOnlyViewUnRead);\n\t\tsuper.notifyDataSetChanged();\n\t}", "@Override\n public void onLoaderReset(Loader<List<StockPicking>> loader) {\n mAdapter.clear();\n }", "protected void refillInternal(final int lastItemPos,final int firstItemPos){\n\t if (mAdapter == null) {\n\t return;\n\t }\n\t if(mAdapter.getCount() == 0){\n\t \treturn;\n\t }\n\t \t\t\n\t\tif(getChildCount() == 0){\n\t\t\tfillFirstTime(lastItemPos, firstItemPos);\n\t\t}\n\t\telse{\n\t\t\trelayout();\n\t\t\tremoveNonVisibleViews();\n\t\t\trefillRight();\n\t\t\trefillLeft();\n\t\t}\n\t}", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n this.goalAdapter.swapCursor(null);\n }", "@Override\n public void sure() {\n onOrderUpdate();\n orderListAdpater.notifyDataSetChanged();\n }", "@Override\n public void sure() {\n onOrderUpdate();\n orderListAdpater.notifyDataSetChanged();\n }", "@Override\n public void onDataSetChanged() {\n final long identityToken = Binder.clearCallingIdentity();\n mPresenter.getStocksData();\n Binder.restoreCallingIdentity(identityToken);\n }", "public void notifyDataChanged() {\n notifyDataSetChanged();\n isLoading = false;\n }", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n mPurseAdapter.swapCursor(null);\n }", "private void reset() {\n\n mPullRefreshEnabled = mAutoLoadAdapter.getPullToRefreshEn();\n mIsLoadMoreEn = mAutoLoadAdapter.getLoadMoreEn();\n mIsFooterEn = mAutoLoadAdapter.getFooterEn();\n mIsLoadMoreErrEn = mAutoLoadAdapter.getLoadMoreErrEn();\n setLoadingMore(false);\n }", "@Override\n public void onLoaderReset(Loader<List<EarthQuake>> loader) {\n mAdapter.clear();\n }", "@Override\r\n public void removeFirstObjectInAdapter() {\n Log.d(\"LIST\", \"removed object!\");\r\n al.remove(0);\r\n arrayAdapter.notifyDataSetChanged();\r\n }", "private void resetSearchAheadList() {\n if (!searchResultsData.isEmpty()) {\n searchResultsData.clear();\n searchAdapter.notifyDataSetChanged();\n }\n }", "public void onItemUnsetSelection(AdapterView<?> parent, View view, int position);", "@Override\n public void removeFirstObjectInAdapter() {\n Log.d(\"LIST\", \"removed object!\");\n rowItem.remove(0);\n arrayAdapter.notifyDataSetChanged();\n }", "@Override\n public void onItemDismiss(int position) {\n dummyDataList.remove(position);\n notifyItemRemoved(position);\n\n }", "public void invalidate()\n\t{\n\t\tif (this.holder != null) {\n\t\t\tthis.holder.bind(this, this.holder.itemView.isActivated());\n\t\t}\n\t}", "@Override\n public void updateItem(DataModel newItem, int position) {\n\n deleteItem(position);\n originalData.add(0, newItem);\n currentData.add(0, newItem);\n }", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n bookAdapter.swapCursor(null);\n }", "@Override\r\n public void onLoaderReset(Loader<List<News>> loader) {\n mAdapter.clear();\r\n }", "@Override\n public void onLoaderReset(Loader<List<Pokemon>> loader) {\n mAdapter.clear();\n }", "private void refreshData(){\n Log.d(LOG_TAG, \"refreshData()\");\n mRVAdapter.setData(null);\n loadData();\n }", "public void clear(){\n nyts.clear();\n notifyDataSetChanged();\n }", "@Override\n public void setChanged() {\n set(getItem());\n }", "protected void refreshAdapter() {\n if (mAdapter == null) {\n mAdapter = createMonthAdapter(mController);\n } else {\n mAdapter.setSelectedDay(mSelectedDay);\n if (pageListener != null) pageListener.onPageChanged(getMostVisiblePosition());\n }\n // refresh the view with the new parameters\n setAdapter(mAdapter);\n }", "@Override\n public void onLoaderReset(Loader<List<Book>> loader) {\n mAdapter.clear();\n }", "@Override\n public void onLoaderReset(Loader<ArrayList<Book>> loader) {\n adapter.clear();\n Log.i(LOG_TAG,\"onLoaderReset\");\n }", "@Override\n public void onLoaderReset(Loader<ArrayList<NewsItem>> loader) {\n newsAdapter.clear();\n }", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tmAdapter.notifyDataSetChanged(mDataArrays);\n\t\t\t\t\tmListView.setSelection(mListView.getCount() - 1);\n\t\t\t\t}", "@Override\n public void onBindViewHolder(@NonNull RVAdapter.ViewHolder holder, final int position) {\n Log.d (\"debugMode\", \"onBindHolder getting position in list....\");\n Location location = mValues.get(position);\n Log.d (\"debugMode\", \"onBindHolder beginning to assign values to holder....\");\n holder.mLocation.setText(location.getName());\n\n if (location.getCustom().equals(\"false\")) {\n holder.mDelete.setVisibility(View.INVISIBLE);\n holder.mDelete.setEnabled(false);\n } else {\n holder.mDelete.setVisibility(View.VISIBLE);\n holder.mDelete.setEnabled(true);\n }\n\n /*\n *when the user clicks delete on an item, the file of the contents is deleted\n *and rewritten with the previous items, minus the deleted item\n */\n holder.mDelete.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Log.d(\"debugMode\", \"delete pressed\");\n mValues.remove(position);\n notifyItemRemoved(position);\n notifyItemRangeChanged(position, mValues.size());\n removeContentsFromFile();\n rewriteLocationList(mValues);\n }\n });\n Log.d (\"debugMode\", \"onBindHolder succeeded in assigning to holder in adapter...\");\n }", "public void resetCounts() {\n // For each item in the RecyclerView\n for(int pos = 0; pos < numItems; pos++) {\n // Reset the count variable of the item\n DataStorage.listInUse.getList().get(pos).reset();\n notifyItemChanged(pos);\n }\n }", "protected void notifyItemsChanged(int positionStart) {\n notifyItemsChanged(positionStart, mAdapter.getItemCount() - positionStart);\n }", "@Override\n public void onClick(View view) {\n slctdExpndColpsPostn = position;\n notifyDataSetChanged();\n }", "@Override\n public void onLoaderReset(@NonNull Loader<List<newslist>> loader) {\n mAdapter.clear();\n }", "private void refreshData(){\n filempty.setVisibility(View.GONE);\n adapter = new FoundRecyclerviewAdapter(FoundActivity.this, data);\n v.setAdapter(adapter);\n emptyView();\n }", "@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tchoosed = pos;\n\t\t\t\t\t\tSingleListAdaper.this.notifyDataSetChanged();\n\t\t\t\t\t}", "public void notifyDataSetChanged() {\n\t\tmDataSetObservable.notifyChanged();\n\t}", "@Override\n\tpublic void onLoaderReset(Loader<Cursor> loader) {\n\t\tsetListAdapter(null);\n\t}", "@Override\n public void deleteItem(int position) {\n originalData.remove(currentData.get(position));\n //Removed of the current data using the current position gotten from the click listener\n currentData.remove(position);\n\n //Notify changes to adapter through presenter\n }", "@Override\n public void onBindViewHolder(ViewHolder holder, int position) {\n mCursorAdapter.getCursor().moveToPosition(position); //EDITED: added this line as suggested in the comments below, thanks :)\n mCursorAdapter.bindView(holder.itemView, mContext, mCursorAdapter.getCursor());\n\n }", "@Override\n public void setAdapter(Adapter adapter) {\n Adapter previousAdapter = getAdapter();\n if (previousAdapter != null)\n previousAdapter.unregisterAdapterDataObserver(mEmptyAdapterDataObserver);\n\n // register observer for new adapter\n if (adapter != null)\n adapter.registerAdapterDataObserver(mEmptyAdapterDataObserver);\n\n // update adapter\n super.setAdapter(adapter);\n }", "@Override\n public void clear() {\n original.clear();\n filtered.clear();\n notifyDataSetChanged();\n }", "public void refreshListView() {\n if (recyclerViewAdapter != null) {\n recyclerViewAdapter.notifyDataSetChanged();\n }\n }", "public void onLoaderReset(Loader<Cursor> arg0) {\n \t adapter.swapCursor(null);\n \t\t\n \t}", "public void resetPosition() {\n\t\tposition = new double[3];\n\t\tgyroOffset = 0;\n\t}", "@Override\n public void onBindViewHolder(ViewHolder viewHolder, final int position)\n {\n Log.d(TAG, \"Element \" + position + \" set.\");\n\n if(position==0)\n {\n posicion=1;\n }\n if(position==1)\n {\n posicion=2;\n }\n if(position==2)\n {\n posicion=3;\n }\n if(position==3)\n {\n posicion=4;\n }\n if(position==4)\n {\n posicion=5;\n }\n if(position==5)\n {\n posicion=6;\n }\n\n // Get element from your dataset at this position and replace the contents of the view\n // with that element\n viewHolder.getTextView().setText(mDataSet[position]);\n }", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n mCursorAdapter.swapCursor(null);\n }", "@Override\r\n public Object getItem(int position) {\n return null;\r\n }", "@Override\n public void onDetach() {\n super.onDetach();\n adapter.notifyDataSetChanged();\n Bimp.tempSelectBitmap.clear();\n Bimp.max = 0;\n }", "@Override\n public void onPageSelected(int position) {\n viewPager.getAdapter().notifyDataSetChanged();\n Log.d(\"ADebugTag\", \"***************notifyDataSetChanged*************** \");\n\n }", "@Override\r\n public void onItemsChanged(RecyclerView recyclerView){\r\n isNotifyDataSetChanged = true;\r\n }", "public void refreshList() {\n mCursor.requery();\n mCount = mCursor.getCount() + mExtraOffset;\n notifyDataSetChanged();\n }", "public void notifyAdapters() {\n for (int size = this.mAdapters.size() - 1; size >= 0; size--) {\n BaseUserAdapter baseUserAdapter = this.mAdapters.get(size).get();\n if (baseUserAdapter != null) {\n baseUserAdapter.notifyDataSetChanged();\n } else {\n this.mAdapters.remove(size);\n }\n }\n }", "public void remove(int position) {\n if (mUpdateData != null && 0 != getCount()) {\n mUpdateData.remove(position);\n }\n notifyDataSetChanged();\n }", "@Override\n public void onBindViewHolder(ViewHolder itemViewHolder, int position) {\n }", "@Override\r\n public void onLoaderReset(Loader<List<NewsList>> loader) {\n adapter.clear();\r\n }", "@Override\n public void run() {\n notifyDataSetChanged();\n }", "public void notifyDataSetChanged() {\n /*\n r17 = this;\n r0 = r17\n org.telegram.ui.Components.StickerMasksAlert r1 = org.telegram.ui.Components.StickerMasksAlert.this\n org.telegram.ui.Components.RecyclerListView r1 = r1.gridView\n int r1 = r1.getMeasuredWidth()\n if (r1 != 0) goto L_0x0012\n android.graphics.Point r1 = org.telegram.messenger.AndroidUtilities.displaySize\n int r1 = r1.x\n L_0x0012:\n r2 = 1116733440(0x42900000, float:72.0)\n int r2 = org.telegram.messenger.AndroidUtilities.dp(r2)\n int r1 = r1 / r2\n r0.stickersPerRow = r1\n org.telegram.ui.Components.StickerMasksAlert r1 = org.telegram.ui.Components.StickerMasksAlert.this\n androidx.recyclerview.widget.GridLayoutManager r1 = r1.stickersLayoutManager\n int r2 = r0.stickersPerRow\n r1.setSpanCount(r2)\n android.util.SparseArray<java.lang.Object> r1 = r0.rowStartPack\n r1.clear()\n java.util.HashMap<java.lang.Object, java.lang.Integer> r1 = r0.packStartPosition\n r1.clear()\n android.util.SparseIntArray r1 = r0.positionToRow\n r1.clear()\n android.util.SparseArray<java.lang.Object> r1 = r0.cache\n r1.clear()\n r1 = 0\n r0.totalItems = r1\n org.telegram.ui.Components.StickerMasksAlert r2 = org.telegram.ui.Components.StickerMasksAlert.this\n java.util.ArrayList[] r2 = r2.stickerSets\n org.telegram.ui.Components.StickerMasksAlert r3 = org.telegram.ui.Components.StickerMasksAlert.this\n int r3 = r3.currentType\n r2 = r2[r3]\n r3 = -3\n r4 = -3\n r5 = 0\n L_0x004e:\n int r6 = r2.size()\n if (r4 >= r6) goto L_0x0160\n if (r4 != r3) goto L_0x0067\n android.util.SparseArray<java.lang.Object> r6 = r0.cache\n int r7 = r0.totalItems\n int r8 = r7 + 1\n r0.totalItems = r8\n java.lang.String r8 = \"search\"\n r6.put(r7, r8)\n int r5 = r5 + 1\n goto L_0x015a\n L_0x0067:\n r6 = -2\n java.lang.String r7 = \"fav\"\n java.lang.String r8 = \"recent\"\n r9 = -1\n r10 = 0\n if (r4 != r6) goto L_0x008e\n org.telegram.ui.Components.StickerMasksAlert r6 = org.telegram.ui.Components.StickerMasksAlert.this\n int r6 = r6.currentType\n if (r6 != 0) goto L_0x008b\n org.telegram.ui.Components.StickerMasksAlert r6 = org.telegram.ui.Components.StickerMasksAlert.this\n java.util.ArrayList r6 = r6.favouriteStickers\n java.util.HashMap<java.lang.Object, java.lang.Integer> r11 = r0.packStartPosition\n int r12 = r0.totalItems\n java.lang.Integer r12 = java.lang.Integer.valueOf(r12)\n r11.put(r7, r12)\n r11 = r7\n goto L_0x00aa\n L_0x008b:\n r6 = r10\n r11 = r6\n goto L_0x00c8\n L_0x008e:\n if (r4 != r9) goto L_0x00b0\n org.telegram.ui.Components.StickerMasksAlert r6 = org.telegram.ui.Components.StickerMasksAlert.this\n java.util.ArrayList[] r6 = r6.recentStickers\n org.telegram.ui.Components.StickerMasksAlert r11 = org.telegram.ui.Components.StickerMasksAlert.this\n int r11 = r11.currentType\n r6 = r6[r11]\n java.util.HashMap<java.lang.Object, java.lang.Integer> r11 = r0.packStartPosition\n int r12 = r0.totalItems\n java.lang.Integer r12 = java.lang.Integer.valueOf(r12)\n r11.put(r8, r12)\n r11 = r8\n L_0x00aa:\n r16 = r10\n r10 = r6\n r6 = r16\n goto L_0x00c8\n L_0x00b0:\n java.lang.Object r6 = r2.get(r4)\n org.telegram.tgnet.TLRPC$TL_messages_stickerSet r6 = (org.telegram.tgnet.TLRPC$TL_messages_stickerSet) r6\n java.util.ArrayList<org.telegram.tgnet.TLRPC$Document> r11 = r6.documents\n java.util.HashMap<java.lang.Object, java.lang.Integer> r12 = r0.packStartPosition\n int r13 = r0.totalItems\n java.lang.Integer r13 = java.lang.Integer.valueOf(r13)\n r12.put(r6, r13)\n r16 = r11\n r11 = r10\n r10 = r16\n L_0x00c8:\n if (r10 == 0) goto L_0x015a\n boolean r12 = r10.isEmpty()\n if (r12 == 0) goto L_0x00d2\n goto L_0x015a\n L_0x00d2:\n int r12 = r10.size()\n float r12 = (float) r12\n int r13 = r0.stickersPerRow\n float r13 = (float) r13\n float r12 = r12 / r13\n double r12 = (double) r12\n double r12 = java.lang.Math.ceil(r12)\n int r12 = (int) r12\n if (r6 == 0) goto L_0x00eb\n android.util.SparseArray<java.lang.Object> r13 = r0.cache\n int r14 = r0.totalItems\n r13.put(r14, r6)\n goto L_0x00f2\n L_0x00eb:\n android.util.SparseArray<java.lang.Object> r13 = r0.cache\n int r14 = r0.totalItems\n r13.put(r14, r10)\n L_0x00f2:\n android.util.SparseIntArray r13 = r0.positionToRow\n int r14 = r0.totalItems\n r13.put(r14, r5)\n r13 = 0\n L_0x00fa:\n int r14 = r10.size()\n if (r13 >= r14) goto L_0x012e\n int r14 = r13 + 1\n int r15 = r0.totalItems\n int r15 = r15 + r14\n android.util.SparseArray<java.lang.Object> r1 = r0.cache\n java.lang.Object r3 = r10.get(r13)\n r1.put(r15, r3)\n if (r6 == 0) goto L_0x0116\n android.util.SparseArray<java.lang.Object> r1 = r0.cacheParents\n r1.put(r15, r6)\n goto L_0x011b\n L_0x0116:\n android.util.SparseArray<java.lang.Object> r1 = r0.cacheParents\n r1.put(r15, r11)\n L_0x011b:\n android.util.SparseIntArray r1 = r0.positionToRow\n int r3 = r0.totalItems\n int r3 = r3 + r14\n int r15 = r5 + 1\n int r9 = r0.stickersPerRow\n int r13 = r13 / r9\n int r15 = r15 + r13\n r1.put(r3, r15)\n r13 = r14\n r1 = 0\n r3 = -3\n r9 = -1\n goto L_0x00fa\n L_0x012e:\n r1 = 0\n L_0x012f:\n int r3 = r12 + 1\n if (r1 >= r3) goto L_0x014e\n if (r6 == 0) goto L_0x013e\n android.util.SparseArray<java.lang.Object> r3 = r0.rowStartPack\n int r9 = r5 + r1\n r3.put(r9, r6)\n r10 = -1\n goto L_0x014b\n L_0x013e:\n android.util.SparseArray<java.lang.Object> r3 = r0.rowStartPack\n int r9 = r5 + r1\n r10 = -1\n if (r4 != r10) goto L_0x0147\n r11 = r8\n goto L_0x0148\n L_0x0147:\n r11 = r7\n L_0x0148:\n r3.put(r9, r11)\n L_0x014b:\n int r1 = r1 + 1\n goto L_0x012f\n L_0x014e:\n int r1 = r0.totalItems\n int r6 = r0.stickersPerRow\n int r12 = r12 * r6\n int r12 = r12 + 1\n int r1 = r1 + r12\n r0.totalItems = r1\n int r5 = r5 + r3\n L_0x015a:\n int r4 = r4 + 1\n r1 = 0\n r3 = -3\n goto L_0x004e\n L_0x0160:\n super.notifyDataSetChanged()\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.telegram.ui.Components.StickerMasksAlert.StickersGridAdapter.notifyDataSetChanged():void\");\n }", "@Override\n public void onClick(View view) {\n adapter.restoreItem(deletedModel, deletedPosition);\n }", "@Override\n public void onBindViewHolder(ViewHolder holder, int position) {\n\n }" ]
[ "0.6914882", "0.6907704", "0.68947357", "0.6882564", "0.6875764", "0.67636395", "0.66102964", "0.66094327", "0.65814525", "0.6556969", "0.6543786", "0.65247923", "0.652151", "0.64932853", "0.6487625", "0.6471397", "0.64660144", "0.64654386", "0.64120936", "0.6403884", "0.63893694", "0.6373339", "0.6370584", "0.63597554", "0.6350752", "0.6347568", "0.63460064", "0.6335684", "0.63305426", "0.6329952", "0.6298356", "0.62846935", "0.62727875", "0.6253653", "0.62473375", "0.62405604", "0.6220277", "0.6219987", "0.62018955", "0.6192639", "0.61811596", "0.617757", "0.61640656", "0.61451584", "0.61448133", "0.61390656", "0.61390656", "0.6137318", "0.61259806", "0.6124807", "0.6123646", "0.6111007", "0.6105023", "0.60983455", "0.60961014", "0.6095522", "0.60730404", "0.60720503", "0.6068729", "0.6063339", "0.6062435", "0.60617757", "0.6061495", "0.6058793", "0.605467", "0.60439247", "0.60357606", "0.6026268", "0.6024817", "0.6023828", "0.6016759", "0.60133797", "0.60062426", "0.6006043", "0.6002112", "0.5989604", "0.5985577", "0.598143", "0.5978416", "0.59783137", "0.59783006", "0.5966623", "0.59645414", "0.59602886", "0.59548753", "0.5954432", "0.5952294", "0.5950974", "0.59500575", "0.5949321", "0.594133", "0.5939622", "0.5921946", "0.5919279", "0.59112173", "0.58990556", "0.5898781", "0.5895193", "0.5894395", "0.5892687", "0.58912355" ]
0.0
-1
We are adding a button, not editing one
public void showAddButtonDialog() { mEditMode = false; mDialogTitle.setText(mContext.getString(R.string.dialog_title_add)); mControllerReading.setText(mContext.getString(R.string.dialog_controller_reading_default)); mDebounceMultiplier.setChecked(false); mDebounceSpinner.setSelection(0); mClickActionTypeSpinner.setSelection(0); mClickActionSpinner.setSelection(0); mHoldActionTypeSpinner.setSelection(0); mHoldActionSpinner.setSelection(0); mButtonDialog.show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@NotNull\n TBItemButton addButton() {\n @NotNull TBItemButton butt = new TBItemButton(myItemListener, myStats != null ? myStats.getActionStats(\"simple_button\") : null);\n myItems.addItem(butt);\n return butt;\n }", "private void setAddButtonUI() {\n addButton = new JButton(\"Add\");\n addButton.setForeground(new Color(247, 37, 133));\n addButton.addActionListener(this);\n addButton.setContentAreaFilled(false);\n addButton.setFocusPainted(false);\n addButton.setFont(new Font(\"Nunito\", Font.PLAIN, 14));\n addButton.setAlignmentX(Component.CENTER_ALIGNMENT);\n }", "@Override\n\tprotected void initAddButton() {\n addBtn = addButton(\"newBtn\", TwlLocalisationKeys.ADD_BEAT_TYPE_TOOLTIP, new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tnew AddEditBeatTypePanel(true, null, BeatTypesList.this).run(); // adding\n\t\t\t\t}\n\t }); \t\t\n\t}", "void addButton_actionPerformed(ActionEvent e) {\n addButton();\n }", "private void createButton(){\n addButton();\n addStartButton();\n }", "protected JButton createAddButton() {\n JButton butAdd = new JButton();\n butAdd.setIcon(new ImageIcon(getClass().getClassLoader().getResource(\"image/add.jpg\")));\n butAdd.setToolTipText(\"Add a new item\");\n butAdd.addActionListener(new AddItemListener());\n return butAdd;\n }", "private void addButton()\n {\n JButton button = new JButton();\n button.setSize(200, 30);\n button.setName(\"login\");\n button.setAction(new CreateUserAction());\n add(button);\n button.setText(\"Login\");\n }", "public DynaForm addButton(Button button) {\n\t\treturn null;\r\n\t}", "private void createButton() {\n\t\tbtnAddTask = new JButton(\"Add Task\");\n\t\tbtnSave = new JButton(\"Save\");\n\t\tbtnCancel = new JButton(\"Cancel\");\n\n\t\tbtnAddTask.addActionListener(new ToDoAction());\n\t\tbtnSave.addActionListener(new ToDoAction());\n\t\tbtnCancel.addActionListener(new ToDoAction());\n\t}", "public void addButton()\n\t{\n\t\tdriver.findElement(By.xpath(\"//input[@name='Insert']\")).click();\n\t}", "@Override\n\tprotected void buildButton() {\n\t\t\n\t}", "private void createAddButton(final Composite parent, final FunctionParameter fp, boolean addEnabled) {\n \t\t// create add button -> left\n\t\tfinal Button addButton = new Button(parent, SWT.PUSH);\n\t\taddButtons.put(fp, addButton);\n \t\taddButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, true, false, 2, 1));\n \t\taddButton.setText(\"Add parameter value\");\n \t\taddButton.setEnabled(addEnabled);\n \n \t\t// create selection listeners\n \t\taddButton.addSelectionListener(new SelectionAdapter() {\n \t\t\t@Override\n \t\t\tpublic void widgetSelected(SelectionEvent e) {\n \t\t\t\t// add text field\n \t\t\t\tList<Pair<Text, Button>> texts = inputFields.get(fp);\n \t\t\t\tboolean removeButtonsDisabled = texts.size() == fp.getMinOccurrence();\n \t\t\t\tPair<Text, Button> added = createField(addButton.getParent(), fp, null);\n \t\t\t\tadded.getFirst().moveAbove(addButton);\n \t\t\t\tadded.getSecond().moveAbove(addButton);\n \t\t\t\t\n \t\t\t\t// update add button\n \t\t\t\tif (texts.size() == fp.getMaxOccurrence())\n \t\t\t\t\taddButton.setEnabled(false);\n \n \t\t\t\t// need to enable all remove buttons or only the new one?\n \t\t\t\tif (removeButtonsDisabled)\n \t\t\t\t\tfor (Pair<Text, Button> pair : texts)\n \t\t\t\t\t\tpair.getSecond().setEnabled(true);\n \t\t\t\telse\n \t\t\t\t\tadded.getSecond().setEnabled(true);\n \n \t\t\t\t// do layout\n \t\t\t\t((Composite) getControl()).layout();\n \t\t\t\t// run validator to update ControlDecoration and updateState\n \t\t\t\tadded.getFirst().setText(\"\");\n \t\t\t\t// pack to make wizard larger if necessary\n \t\t\t\tgetWizard().getShell().pack();\n \t\t\t}\n \t\t});\n \t}", "public void addVehicleSaveButton() {\r\n\t\tsafeJavaScriptClick(addMarkerOkButton.replace(\".ant-modal-footer button.ant-btn.ant-btn-primary\",\r\n\t\t\t\t\".ant-col-24 button.ant-btn.ant-btn-primary\"));\r\n\t}", "protected void renderAddNewDataButton () {\n\t\tnew Timer() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tdataGrid.appendButton(I18Utilities.getInstance().getInternalitionalizeText(getAddDataIconCaptionI18nCode(), getAddDataIconDefaultCaption()), \"ui-icon-document\", new Command() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void execute() {\n\t\t\t\t\t\tshoAddNewDataEditor();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t}\n\t\t}.schedule(100);\n\t}", "private void initCreateDeckBtn() {\n createBtn = new Button((editWidth - 310) / 2, 400, \"CREATE NEW DECK\", MasterGUI.green, titleField.getWidth(), titleField.getHeight());\n createBtn.setFont(MasterGUI.poppinsFont);\n createBtn.setForeground(MasterGUI.white);\n createBtn.setContentAreaFilled(true);\n createBtn.setFocusPainted(false);\n ActionListener createAction = new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n createDeckFromInput();\n user.updateDeckList();\n repaintDeckCards();\n HomeView.repaintHomeView();\n }\n };\n createBtn.addActionListener(e -> {\n MainGUI.confirmDialog(createAction, \"Create new Deck?\");\n });\n editPanel.add(createBtn);\n }", "private JButton getAddButton() {\n if (addButton == null) {\n addButton = new JButton();\n addButton.setText(\"Add User\");\n addButton.setIcon(PortalLookAndFeel.getAddIcon());\n addButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent e) {\n addUser();\n }\n });\n }\n return addButton;\n }", "private JButton getJButtonInto() {\r\n\t\tif (jButtonInto == null) {\r\n\t\t\tjButtonInto = new JButton();\r\n\t\t\tjButtonInto.setMargin(new Insets(2, 5, 2, 5));\r\n\t\t\tjButtonInto.setText(\"数据入库\");\r\n\t\t\tjButtonInto.setBounds(new Rectangle(512, 517, 70, 23));\r\n\t\t\tjButtonInto.addMouseListener(new MouseAdapter() {\r\n\t\t\t\tpublic void mouseClicked(java.awt.event.MouseEvent e) {\r\n\t\t\t\t\tDataIntoGui.this.setVisible(false);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn jButtonInto;\r\n\t}", "public void clickAddButton() {\n\t\tfilePicker.fileManButton(locAddButton);\n\t}", "private void createButton() {\n this.setIcon(images.getImageIcon(fileName + \"-button\"));\n this.setActionCommand(command);\n this.setPreferredSize(new Dimension(width, height));\n this.setMaximumSize(new Dimension(width, height));\n }", "private JButton createButtonAddProduct() {\n\n JButton btn = new JButton(\"Add Product\");\n btn.setEnabled(false);\n btn.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n\n // new NewProductDialog(DemonstrationApplication.this);\n }\n });\n\n return btn;\n }", "private JButton getAddQuantityCardButton() {\n\t\tif (addQuantityCardButton == null) {\n\t\t\taddQuantityCardButton = new JButton();\n\t\t\taddQuantityCardButton.setText(\"Добавить\");\n\t\t\taddQuantityCardButton.addActionListener(new java.awt.event.ActionListener() {\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\n\t\t\t\t\tDefaultListModel model = (DefaultListModel) functionList.getModel();\n\t\t\t\t\tParseElement el = new ParseElement((ListElement) cardType.getSelectedItem(), (String)condition.getSelectedItem(), (String)value.getSelectedItem());\n\n\t\t\t\t\t((DefaultListModel) functionList.getModel()).add(model.getSize(), el);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn addQuantityCardButton;\n\t}", "public JButton getAddButton(){ return addCustomTraitButton; }", "@Override\n public void onClick(View v) {\n buttonAddClicked();\n }", "private JButton getAddButton() {\n if (addButton == null) {\n addButton = new JButton();\n addButton.setText(\"Add\");\n addButton.setToolTipText(\"Add new notification settings for a site\");\n addButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent e) {\n addBalloonSettings();\n }\n });\n }\n return addButton;\n }", "Button createButton();", "private void setupAddToReviewButton() {\n\t\tImageIcon addreview_button_image = new ImageIcon(parent_frame.getResourceFileLocation() + \"addtoreview.png\");\n\t\tJButton add_to_review = new JButton(\"\", addreview_button_image);\n\t\tadd_to_review.setBounds(374, 598, 177, 100);\n\t\tadd_to_review.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\twords_to_add_to_review.add(words_to_spell.get(current_word_number));\n\t\t\t\tinput_from_user.requestFocusInWindow();//gets focus back to the spell here field\n\t\t\t}\n\t\t});\n\t\tadd_to_review.addMouseListener(new VoxMouseAdapter(add_to_review,null));\n\t\tadd(add_to_review);\n\t}", "public void createOrderBtn(){\n createOrderBtn = new Button(\"Create order\");\n createOrderBtn.setLayoutX(305);\n createOrderBtn.setLayoutY(710);\n createOrderBtn.setPrefWidth(480);\n createOrderBtn.setPrefHeight(50);\n createOrderBtn.setStyle(\"-fx-background-color: #34ffb9\");\n createOrderBtn.setFont(new Font(18));\n createOrderBtn.setOnAction(event -> createOrderInDB());\n\n root.getChildren().addAll(createOrderBtn);\n }", "public Button(){\n id=1+nbrButton++;\n setBounds(((id-1)*getDimX())/(Data.getNbrLevelAviable()+1),((id-1)*getDimY())/(Data.getNbrLevelAviable()+1),getDimX()/(2*Data.getNbrLevelAviable()),getDimY()/(2*Data.getNbrLevelAviable()));\n setText(id+\"\");\n setFont(Data.getFont());\n addMouseListener(this);\n setVisible(true);\n }", "public void createButtonClicked() {\n clearInputFieldStyle();\n setAllFieldsAndSliderDisabled(false);\n setButtonsDisabled(false, true, true);\n setDefaultValues();\n Storage.setSelectedRaceCar(null);\n }", "private void newOrderbutton(String txt) {\n Button btn = new Button(txt);\n newBtnStyle(btn);\n\n boolean containsbtn = false;\n btn.setId(txt);\n for (Node node : activeOrders.getChildren()) {\n String button = ((Button) node).getText();\n if (txt.equals(button))\n containsbtn = true;\n\n }\n if (!containsbtn) {\n activeOrders.getChildren().add(btn);\n\n changeActive(btn);\n } else {\n //Alert clerc about the amount to pay back.\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Nyt bord\");\n alert.setHeaderText(\"Bord: \" + txt + \" eksistere allerede\");\n alert.showAndWait();\n }\n }", "private JButton addButton(String name) {\n JButton button = new JButton(name);\n button.setActionCommand(name);\n buttonsPanel.add(button);\n return button;\n }", "HasClickHandlers getCreateNewButton();", "private Button addButton(Configuration config, String name) {\r\n Button button = new HintedButton(config, name);\r\n button.addActionListener(this);\r\n add(button);\r\n return button;\r\n }", "protected javax.swing.JButton getJButtonNew() {\n\t\tif(jButton2 == null) {\n\t\t\tjButton2 = new javax.swing.JButton();\n\t\t\tjButton2.setPreferredSize(new java.awt.Dimension(85,25));\n\t\t\tjButton2.setMnemonic(java.awt.event.KeyEvent.VK_N);\n\t\t\tjButton2.setName(\"New\");\n\t\t\tjButton2.setText(\"New...\");\n\t\t\tjButton2.setToolTipText(\"Add a new play entry to the list below\");\n\t\t\tjButton2.addActionListener(new java.awt.event.ActionListener() { \n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) { \t\t\t\t\t\n\t\t\t\t\tVideoEntryEditor ed = new VideoEntryEditor(PlayListDialog.this);\n\t\t\t\t\ted.setThemeFiles( getThemeFiles() );\n\t\t\t\t\ted.show();\n\t\t\t\t\t\n\t\t\t\t\tif( ed.getResponse() == JOptionPane.OK_OPTION ) {\n\t\t\t\t\t\tgetTableModel().addRow( ed.getVideoEntry() );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn jButton2;\n\t}", "private JButton getAddIncludeConditionButton() {\n\t\tif (addIncludeConditionButton == null) {\n\t\t\taddIncludeConditionButton = new JButton();\n\t\t\taddIncludeConditionButton.setText(\"Добавить\");\n\t\t\taddIncludeConditionButton.addActionListener(new java.awt.event.ActionListener() {\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\n\t\t\t\t\tDefaultListModel model = (DefaultListModel) functionList.getModel();\n\t\t\t\t\tOneCard el = new OneCard((ListElement)getCardValue().getSelectedItem(), (ListElement) getCardColor().getSelectedItem());\n\t\t\t\t\t((DefaultListModel) functionList.getModel()).add(model.getSize(), el);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn addIncludeConditionButton;\n\t}", "public void manageInputPointCreation(){\n Button addInputButton = new Button();\n addInputButton.setId(\"addInputListButton\");\n\n addInputButton.setOnAction(new EventHandler<ActionEvent>() {\n public void handle(ActionEvent event) {\n try {\n Map<String, IYamlDomain> newMap = new HashMap<String, IYamlDomain>();\n newMap.put(Integer.toString(_addCounter), _class.newInstance());\n _abstractUiNode.getChilds().get(0).addInputData(newMap);\n _addCounter ++;\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n });\n\n _abstractUiNode.getChildren().add(addInputButton);\n addInputButton.setVisible(true);\n StackPane.setAlignment(addInputButton, Pos.BOTTOM_LEFT);\n\n }", "@Override\n\tpublic Button createButton() {\n\t\treturn new HtmlButton();\n\t}", "private JButton createButtonAddKeyword() {\n\n JButton btn = new JButton(\"Add Keyword\");\n btn.setEnabled(false);\n btn.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n if (newKeyword(JOptionPane.showInputDialog(\"Insert a Keyword\"))) {\n JOptionPane.showMessageDialog(rootPane, \"Keyword inserted sucessfully!\", \"Sucess\", JOptionPane.PLAIN_MESSAGE);\n }\n\n }\n });\n\n return btn;\n }", "private void addBtnMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_addBtnMousePressed\n addBtn.setBackground(Color.decode(\"#1e5837\"));\n }", "private JButton createAddResourceButton() {\n\n JButton addBtn = new JButton(\"Add\");\n addBtn.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n try {\n\n List<Resource> resourcesList = controller.getResoucesList();\n\n for (Resource resource : controller.getDemonstration().getResourcesList()) {\n resourcesList.remove(resource);\n }\n\n if (resourcesList.isEmpty()) {\n throw new IllegalArgumentException();\n }\n\n DialogSelectable dialogoNewResource = new DialogSelectable(CreateDemonstrationUI.this, resourcesList, \"Select Resource from list:\");\n Resource selectedResource = (Resource) dialogoNewResource.getSelectedItem();\n if (selectedResource == null) {\n throw new NullPointerException();\n }\n\n if (controller.addResource(selectedResource)) {\n updateResourcesList();\n String successMessage = \"Resource added successfully!\";\n String successTitle = \"Resource added.\";\n\n JOptionPane.showMessageDialog(rootPane, successMessage, successTitle, JOptionPane.INFORMATION_MESSAGE);\n }\n } catch (NullPointerException ex) {\n\n } catch (IllegalArgumentException ex) {\n\n String warningMessage = \"There is no more resources to add\";\n String warningTitle = \"No more resources in system\";\n\n JOptionPane.showMessageDialog(rootPane, warningMessage, warningTitle, JOptionPane.WARNING_MESSAGE);\n\n } catch (Exception ex) {\n\n String warningMessage = \"Something wen't wrong please try again.\";\n String warningTitle = \"ERROR 404\";\n\n JOptionPane.showMessageDialog(rootPane, warningMessage, warningTitle, JOptionPane.WARNING_MESSAGE);\n }\n\n }\n });\n return addBtn;\n }", "void onAddClicked();", "public void createNoBanButton() {\n\t\tnoban = new JButton(\"Click here if the current team missed a ban\");\n\t\tnoban.setName(\"noban\");\n\t\tnoban.setBackground(Color.GRAY);\n\t\tnoban.setForeground(Color.WHITE);\n\t\tnoban.setBorderPainted(false);\n\t\tnoban.addActionListener(this);\n\t\tnoban.setBounds(400, 50, 400, 100);\n\t\tbottomPanel.add(noban, new Integer(1));\n\t}", "@Override\r\n\tprotected ActionListener insertBtnAction() {\n\t\treturn null;\r\n\t}", "public void createButtons() {\n\n addRow = new JButton(\"Add row\");\n add(addRow);\n\n deleteRow = new JButton(\"Delete row\");\n add(deleteRow);\n }", "private void addUndoButton() {\n\t\tundoButton = new EAdSimpleButton(EAdSimpleButton.SimpleButton.UNDO);\n undoButton.setEnabled(false);\n\t\ttoolPanel.add(undoButton);\n\t\tredoButton.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tcontroller.getCommandManager().undoCommand();\n\t\t\t}\n\n\t\t});\n\t}", "@Override\n public Button createButton() {\n return new WindowsButton();\n }", "private void createButton() throws SlickException {\n int width = 25*getGameContainer().getWidth()/100;\n int height = 10*getGameContainer().getHeight()/100;\n\n Image login = new Image(getReaderXmlFile().read(\"buttonLogin\")).getScaledCopy(width, height);\n Coordinate posLogin = new Coordinate((getGameContainer().getWidth() - login.getWidth())/2,55*getGameContainer().getHeight()/100);\n loginButton = new Button(getGameContainer(), login, posLogin, IDStates.MENU_STATE, this);\n\n Image account = new Image(getReaderXmlFile().read(\"buttonAccount\")).getScaledCopy(width, height);\n Coordinate posAccount = new Coordinate((getGameContainer().getWidth() - account.getWidth())/2,70*getGameContainer().getHeight()/100);\n accountButton = new Button(getGameContainer(), account, posAccount, IDStates.MENU_STATE, this);\n }", "@Override\n protected Button createButton(Composite parent, int id, String label,\n boolean defaultButton) {\n return null;// 重写父类的按钮,返回null,使默认按钮失效\n }", "public void setAddBtn(JButton addBtn) {\n\t\tthis.addBtn = addBtn;\n\t}", "public void setAddButton(UIComponent addButton) {\r\n this.addButton = addButton;\r\n }", "private void setUpAddBookButton()\n {\n setComponentAlignment(addBookButton, Alignment.BOTTOM_LEFT);\n addBookButton.setCaption(\"Add\");\n addBookButton.addClickListener(new Button.ClickListener() {\n public void buttonClick(Button.ClickEvent event)\n {\n Object id = bookTable.getValue();\n int book_id = (int)bookTable.getContainerProperty(id,\"id\").getValue();\n basket.add(allBooksBean.getIdByIndex(book_id-1));\n //basket.add(allBooks.get(book_id-1));\n errorLabel.setCaption(\"Successfully added book to Basket\");\n }\n });\n }", "private JButton createButton(final Box addTo, final String label) {\n JButton button = new JButton(label);\n button.setActionCommand(label);\n button.addActionListener(this);\n addTo.add(button);\n return button;\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\taddBtn.setEnabled(true);\n\t\t\t}", "private JButton getCmdAdd() {\r\n\t\tif (cmdAdd == null) {\r\n\t\t\tcmdAdd = new JButton();\r\n\t\t\tcmdAdd.setText(\"\");\r\n\t\t\tcmdAdd.setToolTipText(\"Add single proxy\");\r\n\t\t\tcmdAdd.setIcon(new ImageIcon(getClass().getResource(\"/add.png\")));\r\n\t\t\tcmdAdd.addActionListener(new java.awt.event.ActionListener() {\r\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\r\n\t\t\t\t\taddProxy = getJDialog();\r\n\t\t\t\t\taddProxy.pack();\r\n\t\t\t\t\taddProxy.setSize(new Dimension(231, 144));\r\n\t\t\t\t\taddProxy.setLocationRelativeTo(jContentPane);\r\n\t\t\t\t\taddProxy.setVisible(true);\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\r\n\t\t}\r\n\t\treturn cmdAdd;\r\n\t}", "protected JButton addAddButton(String legend) {\n if (legend != null) {\n AddButton.setText(legend);\n }\n AddButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent ae) {\n EditModel.insertRecord(BottomRow + 1);\n validate();\n repaint();\n }\n });\n AddButton.setEnabled(true);\n return AddButton;\n }", "private JButton getJButton() {\n\t\tif (new_button == null) {\n\t\t\tnew_button = new JButton();\n\t\t\tnew_button.setText(Locale.getString(\"NEW\"));\n\t\t\tnew_button.setMnemonic(java.awt.event.KeyEvent.VK_N);\n\t\t\tnew_button.addActionListener(new java.awt.event.ActionListener() { \n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) { \n\t\t\t\t\tSystem.out.println(\"actionPerformed()\"); // TODO Auto-generated Event stub actionPerformed()\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn new_button;\n\t}", "public JButton getAddBtn() {\n\t\treturn addBtn;\n\t}", "protected Button createCustomButton(Composite parent, String label) {\n\t\t((GridLayout) parent.getLayout()).numColumns++;\r\n\t\tButton button = new Button(parent, SWT.PUSH);\r\n\t\tbutton.setText(label);\r\n\t\tbutton.setFont(JFaceResources.getDialogFont());\r\n\r\n\t\tbutton.addSelectionListener(new SelectionAdapter() {\r\n\t\t\tpublic void widgetSelected(SelectionEvent event) {\r\n\t\t\t\t//buttonPressed(((Integer) event.widget.getData()).intValue());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tsetButtonLayoutData(button);\r\n\t\treturn button;\r\n\t}", "public JButton getAddBtn() {\n return addBtn;\n }", "public void makeObtainButton() {\r\n JButton obtain = new JButton(\"Obtain a new champion using Riot Points\");\r\n new Button(obtain, main);\r\n// obtain.setAlignmentX(Component.LEFT_ALIGNMENT);\r\n// obtain.setPreferredSize(new Dimension(2500, 100));\r\n// obtain.setFont(new Font(\"Arial\", Font.PLAIN, 40));\r\n obtain.addActionListener(new ActionListener() {\r\n @Override\r\n public void actionPerformed(ActionEvent e) {\r\n obtainChampionUsingRiotPoints();\r\n }\r\n });\r\n// main.add(obtain);\r\n }", "void createButton(Button main){\n\t\tActions handler = new Actions();\r\n\t\tmain.setOnAction(handler);\r\n\t\tmain.setFont(font);\r\n\t\t//sets button preference dimensions and label \r\n\t\tmain.setPrefWidth(100);\r\n\t\tmain.setPrefHeight(60);\r\n\t\tmain.setText(\"Close\");\r\n\t}", "public javax.swing.JButton getAddButton() {\n return addButton;\n }", "public void makeGetRPButton() {\r\n JButton getRP = new JButton(\"Check if a champion can be purchased with Riot Points\");\r\n new Button(getRP, main);\r\n// getRP.setAlignmentX(Component.LEFT_ALIGNMENT);\r\n// getRP.setPreferredSize(new Dimension(2500, 100));\r\n// getRP.setFont(new Font(\"Arial\", Font.PLAIN, 40));\r\n getRP.addActionListener(new ActionListener() {\r\n @Override\r\n public void actionPerformed(ActionEvent e) {\r\n getRiotPointsBalanceDifference();\r\n }\r\n });\r\n// main.add(getRP);\r\n }", "private Component updateButton(){\n return updatePersonButton = new Button(\"updateButton\"){\n @Override\n public void onSubmit() {\n super.onSubmit();\n }\n };\n }", "private JButton getJButton1() {\n\t\tif (edit_button == null) {\n\t\t\tedit_button = new JButton();\n\t\t\tedit_button.setMnemonic(java.awt.event.KeyEvent.VK_E);\n\t\t\tedit_button.setText(Locale.getString(\"EDIT\"));\n\t\t}\n\t\treturn edit_button;\n\t}", "private void createButtonsPanel() {\r\n Composite buttonsPanel = new Composite(this, SWT.NONE);\r\n buttonsPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));\r\n buttonsPanel.setLayout(new GridLayout(4, true));\r\n\r\n getButtonFromAction(buttonsPanel, \"New\", new NewAction(_window));\r\n getButtonFromAction(buttonsPanel, \"Save\", new SaveAction());\r\n getButtonFromAction(buttonsPanel, \"Delete\", new DeleteAction(_window));\r\n getButtonFromAction(buttonsPanel, \"Cancel\", new CancelAction());\r\n }", "private void initButton() {\r\n\t\tthis.panelButton = new JPanel();\r\n\t\tthis.panelButton.setLayout(new BoxLayout(this.panelButton,\r\n\t\t\t\tBoxLayout.LINE_AXIS));\r\n\t\tthis.modifyButton = new JButton(\"Modify\");\r\n\t\tthis.buttonSize(this.modifyButton);\r\n\t\tthis.deleteButton = new JButton(\"Delete\");\r\n\t\tthis.buttonSize(this.deleteButton);\r\n\t\tthis.cancelButton = new JButton(\"Cancel\");\r\n\t\tthis.buttonSize(this.cancelButton);\r\n\r\n\t\tthis.modifyButton.addActionListener(this.editWeaponControl);\r\n\t\tthis.deleteButton.addActionListener(this.editWeaponControl);\r\n\t\tthis.cancelButton.addActionListener(this.editWeaponControl);\r\n\r\n\t\tthis.panelButton.add(this.modifyButton);\r\n\t\tthis.panelButton.add(Box.createRigidArea(new Dimension(15, 0)));\r\n\t\tthis.panelButton.add(this.deleteButton);\r\n\t\tthis.panelButton.add(Box.createRigidArea(new Dimension(15, 0)));\r\n\t\tthis.panelButton.add(this.cancelButton);\r\n\t}", "public void addButton(final JButton theButton) {\n customButtonPanel.add(theButton);\n }", "@Override\n public void addToggleButton(Component button)\n {\n button.addFeature(new AddToggleButtonFeature(this, button));\n }", "public void makeFavouriteButton() {\r\n JButton favourite = new JButton(\"Favourite a champion\");\r\n new Button(favourite, main);\r\n// favourite.setAlignmentX(Component.LEFT_ALIGNMENT);\r\n// favourite.setPreferredSize(new Dimension(2500, 100));\r\n// favourite.setFont(new Font(\"Arial\", Font.PLAIN, 40));\r\n favourite.addActionListener(new ActionListener() {\r\n @Override\r\n public void actionPerformed(ActionEvent e) {\r\n favouriteChampion();\r\n }\r\n });\r\n// main.add(favourite);\r\n }", "@SuppressWarnings(\"unchecked\")\r\n\tprivate void addButton(GuiButton guiButton, boolean enabled)\r\n\t{\r\n\t\tif (!enabled)\r\n\t\t\tguiButton.enabled = false;\r\n\t\t// field_146292_n.add(guiButton);\r\n\t\tbuttonList.add(guiButton);\r\n\t}", "void addButton_actionPerformed(ActionEvent e) {\n doAdd();\n }", "public JButtonOperator btAddFromLibrary() {\n if (_btAddFromLibrary==null) {\n _btAddFromLibrary = new JButtonOperator(this, \"Add from Library...\"); // NOI18N\n }\n return _btAddFromLibrary;\n }", "@Override\r\n\tpublic void onBoAdd(ButtonObject bo) throws Exception {\n\t\tgetButtonManager().getButton(\r\n\t\t\t\tnc.ui.wds.w8006080202.tcButtun.ITcButtun.Con)\r\n\t\t\t\t.setEnabled(false);\r\n\t\tgetButtonManager().getButton(\r\n\t\t\t\tnc.ui.wds.w8006080202.tcButtun.ITcButtun.Pp)\r\n\t\t\t\t.setEnabled(false);\r\n\t\tsuper.onBoAdd(bo);\r\n\t\tgetBillCardPanelWrapper().getBillCardPanel().setHeadItem(\"pp_archive\", 0);\r\n\t}", "@Override\r\n\tprotected void onBoDelete() throws Exception {\n\t\tsuper.onBoDelete();\r\n\t\t// 修改按钮属性\r\n\t\tif(myaddbuttun){\r\n\t\t\tgetButtonManager().getButton(IBillButton.Add).setEnabled(true);\r\n\t\t\tmyaddbuttun=true;\r\n\t\t\t// 转到卡片面,实现按钮的属性转换\r\n\t\t\tgetBillUI().setCardUIState();\r\n\t\t\tsuper.onBoReturn();\r\n\t\t}else{\r\n\t\t\tgetButtonManager().getButton(IBillButton.Add).setEnabled(false);\r\n\t\t\tmyaddbuttun=false;\r\n\t\t\t// 转到卡片面,实现按钮的属性转换\r\n\t\t\tgetBillUI().setCardUIState();\r\n\t\t\tsuper.onBoReturn();\r\n\t\t}\r\n\t}", "private void addButton(final FrameContainer<?> source) {\n final JToggleButton button = new JToggleButton(source.toString(),\n IconManager.getIconManager().getIcon(source.getIcon()));\n button.addActionListener(this);\n button.setHorizontalAlignment(SwingConstants.LEFT);\n button.setMinimumSize(new Dimension(0,buttonHeight));\n button.setMargin(new Insets(0, 0, 0, 0));\n buttons.put(source, button);\n }", "private void addControls() {\n\t\tAjaxButton button = new AjaxButton(\"submitButton\", ResourceUtils.getModel(\"button.save\")) {\n\t\t\t@Override\n protected void onSubmit(AjaxRequestTarget target, Form<?> form) {\n onSubmitAction(strWrapper, target, form);\n target.add(form);\n }\n\n\t\t\t@Override\n\t\t\tprotected void onError(AjaxRequestTarget target, Form<?> form) {\n\t\t\t\tsuper.onError(target, form);\n\t\t\t\ttarget.add(form);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tprotected void onConfigure() {\n\t\t\t\tsuper.onConfigure();\n\t\t\t\tthis.setVisible(true);\n\t\t\t}\n\t\t};\n\t\tform.add(button);\n\n\t\tbutton = new AjaxButton(\"cancelButton\", ResourceUtils.getModel(\"button.cancel\")) {\n\t\t\t@Override\n\t\t\tprotected void onSubmit(AjaxRequestTarget target, Form<?> form) {\n\t\t\t\tonCancelAction(strWrapper, target, form);\n\t\t\t\tform.clearInput();\n\t\t\t\ttarget.add(form);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tprotected void onConfigure() {\n\t\t\t\tsuper.onConfigure();\n\t\t\t\tthis.setVisible(true);\n\t\t\t}\n\t\t};\n\t\tbutton.setDefaultFormProcessing(false);\n\t\tform.add(button);\n\n\t}", "private void addBtnMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_addBtnMouseReleased\n addBtn.setBackground(Color.decode(\"#4fc482\"));\n }", "public void addUpdateBtn() {\n if (isInputValid()) {\n if ( action.equals(Constants.ADD) ) {\n addCustomer(createCustomerData());\n } else if ( action.equals(Constants.UPDATE) ){\n updateCustomer(createCustomerData());\n }\n cancel();\n }\n }", "private void addUniqueToViewNodes() {\n\t\taddFilterButton();\n\t\t\n\t\t/* Button Initialization */\n\t\t//This Button Creates a Report\n\t\tcreateReportBtn = new Button(\"Create Report\");\n\t\tcreateReportBtn.getStyleClass().add(\"GreenButton\");\n\t\tcreateReportBtn.setOnAction(e -> {\n\t\t\tCreateReportPopup crPopup = new CreateReportPopup(\"Create Report\");\n\t\t\tcrPopup.show();\n\t\t});\n\t\t\n\t\t// This Button views the currently selected report in more detail\n\t\treportDetailsBtn = new Button(\"Report Details\");\n\t\treportDetailsBtn.getStyleClass().add(\"GreenButton\");\n\t\t\n\t\t/* Assembly */\n\t\tactionButtons.getChildren().addAll(createReportBtn, reportDetailsBtn);\n\t\t\n\t\tactionButtons.setPrefHeight(Values.ACTION_BUTTONS_PREF_WIDTH);\n\t}", "private void showSubmitBtn(){\n\t\tmainWindow.addLayer(submitBtn, BUTTON_LAYER, submitBtnX, submitBtnY);\n\t}", "void enableAddContactButton();", "public void addButton(HtmlSubmitButton b) {\r\n\t\t_buttons.add(b);\r\n\t\tadd(b, TYPE_COMP);\r\n\t}", "public Button addButton(ButtonID buttonId) {\n\t\tfinal Button b = new Button();\n\t\tb.setText(buttonId.title);\n\t\tif (buttonId.icon != null)\n\t\t\tb.setGraphic(new ImageView(buttonId.icon));\n\t\tswitch (buttonId) {\n\t\tcase OK:\n\t\t\tb.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void handle(final ActionEvent event) {\n\t\t\t\t\thandleOk(event);\n\t\t\t\t}\n\t\t\t});\n\t\t\t// TODO fix problematic NPE on VK_ENTER press\n\t\t\t// b.setDefaultButton(true);\n\t\t\tbreak;\n\t\tcase CANCEL:\n\t\t\tb.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void handle(final ActionEvent event) {\n\t\t\t\t\thandleCancel(event);\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase NEXT:\n\t\t\tb.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void handle(final ActionEvent event) {\n\t\t\t\t\thandleNext(event);\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase BACK:\n\t\t\tb.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void handle(final ActionEvent event) {\n\t\t\t\t\thandleBack(event);\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase HELP:\n\t\t\tb.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void handle(final ActionEvent event) {\n\t\t\t\t\thandleHelp(event);\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t\torderedButtonList.add(b);\n\t\tbuttons.put(buttonId, b);\n\t\treturn b;\n\t}", "protected void createButtons(Composite parent) {\n\t\tcomRoot = new Composite(parent, SWT.BORDER);\n\t\tcomRoot.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));\n\t\tcomRoot.setLayout(new GridLayout(2, false));\n\n\t\ttbTools = new ToolBar(comRoot, SWT.WRAP | SWT.RIGHT | SWT.FLAT);\n\t\ttbTools.setLayout(new GridLayout());\n\t\ttbTools.setLayoutData(new GridData(SWT.RIGHT, SWT.BOTTOM, true, false));\n\n\t\tfinal ToolItem btnSettings = new ToolItem(tbTools, SWT.NONE);\n\t\tbtnSettings.setText(Messages.btnAdvancedSettings);\n\t\tbtnSettings.setToolTipText(Messages.tipAdvancedSettings);\n\t\tbtnSettings.addSelectionListener(new SelectionAdapter() {\n\n\t\t\tpublic void widgetSelected(final SelectionEvent event) {\n\t\t\t\tPerformanceSettingsDialog dialog = new PerformanceSettingsDialog(\n\t\t\t\t\t\tgetShell(), getMigrationWizard().getMigrationConfig());\n\t\t\t\tdialog.open();\n\t\t\t}\n\t\t});\n\n\t\tnew ToolItem(tbTools, SWT.SEPARATOR);\n\t\tbtnPreviewDDL = new ToolItem(tbTools, SWT.CHECK);\n\t\tbtnPreviewDDL.setSelection(false);\n\t\tbtnPreviewDDL.setText(Messages.btnPreviewDDL);\n\t\tbtnPreviewDDL.setToolTipText(Messages.tipPreviewDDL);\n\t\tbtnPreviewDDL.addSelectionListener(new SelectionAdapter() {\n\n\t\t\tpublic void widgetSelected(final SelectionEvent event) {\n\t\t\t\tboolean flag = btnPreviewDDL.getSelection();\n\t\t\t\tswitchText(flag);\n\t\t\t}\n\t\t});\n\t\tnew ToolItem(tbTools, SWT.SEPARATOR);\n\n\t\tfinal ToolItem btnExportScript = new ToolItem(tbTools, SWT.NONE);\n\t\tbtnExportScript.setText(Messages.btnExportScript);\n\t\tbtnExportScript.setToolTipText(Messages.tipSaveScript);\n\t\tbtnExportScript.addSelectionListener(new SelectionAdapter() {\n\n\t\t\tpublic void widgetSelected(final SelectionEvent event) {\n\t\t\t\texportScriptToFile();\n\t\t\t}\n\t\t});\n\t\tnew ToolItem(tbTools, SWT.SEPARATOR);\n\t\tfinal ToolItem btnUpdateScript = new ToolItem(tbTools, SWT.NONE);\n\t\tbtnUpdateScript.setText(Messages.btnUpdateScript);\n\t\tbtnUpdateScript.setToolTipText(Messages.tipUpdateScript);\n\t\tbtnUpdateScript.addSelectionListener(new SelectionAdapter() {\n\n\t\t\tpublic void widgetSelected(final SelectionEvent event) {\n\t\t\t\tprepare4SaveScript();\n\t\t\t\tgetMigrationWizard().saveMigrationScript(false, isSaveSchema());\n\t\t\t\tMessageDialog.openInformation(PlatformUI.getWorkbench()\n\t\t\t\t\t\t.getDisplay().getActiveShell(),\n\t\t\t\t\t\tMessages.msgInformation, Messages.setOptionPageOKMsg);\n\t\t\t}\n\t\t});\n\t\tbtnUpdateScript\n\t\t\t\t.setEnabled(getMigrationWizard().getMigrationScript() != null);\n\t\tnew ToolItem(tbTools, SWT.SEPARATOR);\n\t\tfinal ToolItem btnNewScript = new ToolItem(tbTools, SWT.NONE);\n\t\tbtnNewScript.setText(Messages.btnCreateNewScript);\n\t\tbtnNewScript.setToolTipText(Messages.tipCreateNewScript);\n\t\tbtnNewScript.addSelectionListener(new SelectionAdapter() {\n\n\t\t\tpublic void widgetSelected(final SelectionEvent event) {\n\t\t\t\tprepare4SaveScript();\n\t\t\t\tString name = EditScriptDialog.getMigrationScriptName(\n\t\t\t\t\t\tgetShell(), getMigrationWizard().getMigrationConfig()\n\t\t\t\t\t\t\t\t.getName());\n\t\t\t\tif (StringUtils.isBlank(name)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tgetMigrationWizard().getMigrationConfig().setName(name);\n\t\t\t\tgetMigrationWizard().saveMigrationScript(true, isSaveSchema());\n\t\t\t\tbtnUpdateScript.setEnabled(getMigrationWizard()\n\t\t\t\t\t\t.getMigrationScript() != null);\n\t\t\t\tMessageDialog.openInformation(PlatformUI.getWorkbench()\n\t\t\t\t\t\t.getDisplay().getActiveShell(),\n\t\t\t\t\t\tMessages.msgInformation, Messages.setOptionPageOKMsg);\n\t\t\t}\n\t\t});\n\t}", "public void clickOnEditButton() {\r\n\t\tsafeClick(addMarkerOkButton.replace(\".ant-modal-footer button.ant-btn.ant-btn-primary\",\r\n\t\t\t\t\".ant-btn.ant-btn-primary.ant-btn-circle\"), SHORTWAIT);\r\n\t}", "private JButton addCancelButton(){\n\t\tJButton cancelButton = new JButton(\"Cancel\");\n\n\t\tcancelButton.addActionListener(arg0 -> setVisible(false));\n\t\treturn cancelButton;\n\t}", "private JButton getLinkButton() {\r\n\t\tif (linkButton == null) {\r\n\t\t\tlinkButton = new JButton(); \r\n\t\t\tlinkButton.setIcon(new ImageIcon(getClass().getResource(\"/img/icon/discrete_attribute.gif\")));\r\n\t\t\tlinkButton.setPreferredSize(new Dimension(23, 23));\r\n\t\t\tlinkButton.setBounds(new Rectangle(44, 1, 23, 20));\r\n\t\t\tlinkButton.setToolTipText(\"超链接编辑\");\r\n\t\t\tlinkButton.setActionCommand(\"linkButton\");\r\n\t\t\tlinkButton.addActionListener(this.buttonAction);\r\n\t\t\t\r\n\t\t}\r\n\t\treturn linkButton;\r\n\t}", "@Override\r\n\tprotected void createButtonsForButtonBar(Composite parent) {\n\t\tcreateButton(parent, IDialogConstants.OK_ID, \"Add\",\r\n\t\t\t\ttrue);\r\n\t\tcreateButton(parent, IDialogConstants.CANCEL_ID,\r\n\t\t\t\tIDialogConstants.CANCEL_LABEL, false);\r\n\t}", "public JButton getAddModifyButton() {\n return addModifyButton;\n }", "private JButton getJButton3() {\r\n\t\tif (jButton3 == null) {\r\n\t\t\tjButton3 = new JButton();\r\n\t\t\tjButton3.setBounds(new Rectangle(38, 224, 124, 28));\r\n\t\t\tjButton3.setBackground(new Color(0, 204, 51));\r\n\t\t\tjButton3.setText(\"New word\");\r\n\t\t\tjButton3.addActionListener(new java.awt.event.ActionListener() {\r\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\r\n\t\t\t\t\tjButton1.setEnabled(true);\r\n\t\t\t\t\tjButton1.setVisible(true);\r\n\t\t\t\t\tjTextArea.setText(\"\");\r\n\t\t\t\t\tjTextArea.setEditable(true);\r\n\t\t\t\t\tjButton.setEnabled(false);\r\n\t\t\t\t\tjButton2.setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn jButton3;\r\n\t}", "private JButton addOKButton(){\n\t\tJButton okButton = new JButton(\"OK\");\n\t\tokButton.addActionListener(arg0 -> {\n\t\t\tinfo = new ChannelInfo(nameT.getText(), passwordT.getText(), null);\n\t\t\tsetVisible(false);\n\t\t});\n\t\treturn okButton;\n\t}", "private JButton getNouveujButton() {\r\n\t\tif (NouveujButton == null) {\r\n\t\t\tNouveujButton = new JButton();\r\n\t\t\tNouveujButton.setLocation(new Point(36, 32));\r\n\t\t\tNouveujButton.setActionCommand(\"Nouvelle Fiche\");\r\n\t\t\tNouveujButton.setIcon(new ImageIcon(getClass().getResource(\"/nouveau.png\")));\r\n\t\t\tNouveujButton.setFont(new Font(\"Dialog\", Font.PLAIN, 12));\r\n\t\t\tNouveujButton.setSize(new Dimension(120, 120));\r\n\t\t\tNouveujButton.addActionListener(new java.awt.event.ActionListener() {\r\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\r\n\t\t\t\t//\tSystem.out.println(\"actionPerformed()\"); // TODO Auto-generated Event stub actionPerformed()\r\n\t\t\t\t\tif (e.getActionCommand().equals(\"Nouvelle Fiche\")) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tHistorique.ecrire(\"Ouverture de : \"+e);\r\n\t\t\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tnew FEN_Ajout();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t}\r\n\t\treturn NouveujButton;\r\n\t}", "private void buttonInitiation() {\n submit = new JButton(\"Submit\");\n submit.setBounds(105, 250, 90, 25);\n this.add(submit);\n goBack = new JButton(\"Return to Main Menu\");\n goBack.setBounds(205, 250, 200, 25);\n this.add(goBack);\n }", "@Override\n\tprotected void createCompButtons() {\n\t\tbuildCompButtons();\n\t}", "public void addButton( AbstractButton button ) {\r\n synchronized (buttons) {\r\n buttons.add( button );\r\n }\r\n }", "public void clickCreateButton() {\n this.action.click(this.createButton);\n }", "JButton createTranslateButton(ParagraphTranslateGUI app) {\n ImageIcon translateIcon = new ImageIcon(\"resources/TranslateButton.png\");\n translateButton = new JButton(resizeIcon(translateIcon, this.width, this.height));\n translateButton.setBounds(this.posX, this.posY, this.width, this.height);\n\n addMouseListener(app);\n\n return translateButton;\n }", "public void makeReceiveButton() {\r\n JButton receive = new JButton(\"Receive a new champion recommendation\");\r\n new Button(receive, main);\r\n// receive.setAlignmentX(Component.LEFT_ALIGNMENT);\r\n// receive.setPreferredSize(new Dimension(2500, 100));\r\n// receive.setFont(new Font(\"Arial\", Font.PLAIN, 40));\r\n receive.addActionListener(new ActionListener() {\r\n @Override\r\n public void actionPerformed(ActionEvent e) {\r\n receiveChampionRecommendation();\r\n }\r\n });\r\n// main.add(receive);\r\n }", "@Override\r\n\tprotected void createButtonsForButtonBar(Composite parent) {\r\n\t\tcreateButton(parent, IDialogConstants.OK_ID, Messages.BTN_ADD,\r\n\t\t\t\ttrue);\r\n\t\tcreateButton(parent, IDialogConstants.CANCEL_ID,\r\n\t\t\t\tMessages.BTN_FINISH, false);\r\n\t\tinitDataBindings();\r\n\t}", "private void addControlButton(Component comp) {\r\n\t\tif (comp instanceof JButton){\r\n\t\t\tJButton b = (JButton)comp;\r\n\t\t\tb.setSize(BUTTON_WIDTH,BUTTON_HEIGHT);\r\n\t\t\tb.setLocation(LEFT_BUTTON_PADDING, TOP_BUTTON_PADDING + (BUTTON_HEIGHT+BUTTON_PADDING) * numButtons);\r\n\t\t\tnumButtons++;\r\n\t\t}\r\n\t\telse\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t}" ]
[ "0.773607", "0.7608008", "0.75572616", "0.75367725", "0.74493194", "0.7427834", "0.74222785", "0.74188054", "0.7282987", "0.72812825", "0.7187246", "0.7182512", "0.71620655", "0.7161267", "0.71592486", "0.71413666", "0.7133197", "0.7097612", "0.70935524", "0.7071916", "0.7070722", "0.706723", "0.70613116", "0.7060612", "0.7043513", "0.7043197", "0.7023083", "0.7000041", "0.69960797", "0.6959982", "0.6957452", "0.6954448", "0.69521004", "0.6893798", "0.6867759", "0.6867481", "0.68661845", "0.6858958", "0.68571854", "0.6847382", "0.68360907", "0.6834612", "0.68192184", "0.68060046", "0.68025", "0.6793514", "0.6792673", "0.6781252", "0.6773582", "0.6771878", "0.67650485", "0.6756574", "0.6756015", "0.67519724", "0.6748137", "0.6725503", "0.6715885", "0.67101353", "0.67005134", "0.66951823", "0.6680805", "0.6677675", "0.66724455", "0.66612387", "0.6658627", "0.66545403", "0.6651666", "0.6648163", "0.664497", "0.66369736", "0.6629812", "0.66216755", "0.6621398", "0.66198784", "0.6612277", "0.66097194", "0.6606826", "0.6597221", "0.65970826", "0.65844876", "0.6576435", "0.6576402", "0.6572531", "0.65673846", "0.6564225", "0.6557667", "0.65570325", "0.65559703", "0.6545455", "0.6545338", "0.6543468", "0.6537526", "0.6534275", "0.6532042", "0.6524239", "0.65218097", "0.6521498", "0.6519202", "0.6517701", "0.6508379", "0.6500964" ]
0.0
-1
Populate an action spinner based on its type
private void setActionSpinner(boolean isClickAction, int pos) { Spinner actionSpinner, typeSpinner; if (isClickAction) { actionSpinner = mClickActionSpinner; typeSpinner = mClickActionTypeSpinner; mClickTypeSelection = pos; } else { actionSpinner = mHoldActionSpinner; typeSpinner = mHoldActionTypeSpinner; mHoldTypeSelection = pos; } ArrayAdapter<String> actionAdapter; LinearLayout.LayoutParams actionParams = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams actionTypeParams = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT); actionParams.weight = 1; actionTypeParams.weight = 1; switch (pos) { case 0: // Action Type: None actionSpinner.setVisibility(View.GONE); actionAdapter = new ArrayAdapter<>(mContext, android.R.layout.simple_spinner_item, mContext.getResources().getStringArray(R.array.dialog_spinner_empty)); actionAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line); actionSpinner.setAdapter(actionAdapter); actionParams.weight = 0; actionTypeParams.weight = 2; actionSpinner.setLayoutParams(actionParams); typeSpinner.setLayoutParams(actionTypeParams); break; case 1: // Action Type: Volume actionSpinner.setVisibility(View.VISIBLE); actionAdapter = new ArrayAdapter<>(mContext, android.R.layout.simple_spinner_item, mContext.getResources().getStringArray(R.array.dialog_action_volume)); actionAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line); actionSpinner.setAdapter(actionAdapter); actionSpinner.setLayoutParams(actionParams); typeSpinner.setLayoutParams(actionTypeParams); break; case 2: // Action Type: Media actionSpinner.setVisibility(View.VISIBLE); actionAdapter = new ArrayAdapter<>(mContext, android.R.layout.simple_spinner_item, mContext.getResources().getStringArray(R.array.dialog_action_media)); actionAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line); actionSpinner.setAdapter(actionAdapter); actionSpinner.setLayoutParams(actionParams); typeSpinner.setLayoutParams(actionTypeParams); break; case 3: // Action Type: Integrated actionSpinner.setVisibility(View.VISIBLE); actionAdapter = new ArrayAdapter<>(mContext, android.R.layout.simple_spinner_item, mContext.getResources().getStringArray(R.array.dialog_action_integrated)); actionAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line); actionSpinner.setAdapter(actionAdapter); actionSpinner.setLayoutParams(actionParams); typeSpinner.setLayoutParams(actionTypeParams); break; case 4: // Action Type: Application actionSpinner.setVisibility(View.VISIBLE); AppListAdapter appAdapter = new AppListAdapter(mContext); actionSpinner.setAdapter(appAdapter); actionSpinner.setLayoutParams(actionParams); typeSpinner.setLayoutParams(actionTypeParams); break; case 5: // Action Type: Tasker actionSpinner.setVisibility(View.VISIBLE); if (mTaskerTasks != null) { actionAdapter = new ArrayAdapter<>(mContext, android.R.layout.simple_spinner_item, mTaskerTasks); } else { actionAdapter = new ArrayAdapter<>(mContext, android.R.layout.simple_spinner_item, mContext.getResources().getStringArray(R.array.dialog_spinner_empty)); } actionSpinner.setAdapter(actionAdapter); actionSpinner.setLayoutParams(actionParams); typeSpinner.setLayoutParams(actionTypeParams); break; default: actionSpinner.setVisibility(View.GONE); actionParams.weight = 0; actionTypeParams.weight = 2; actionSpinner.setLayoutParams(actionParams); typeSpinner.setLayoutParams(actionTypeParams); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createAction() {\n setupPrioritySpinner();\n mPriority.setSelection(getActivity().getSharedPreferences(TASK_PREFS, Context.MODE_PRIVATE).getInt(PRIORITY_PREF, 0));\n }", "private void spinnerAction() {\n Spinner spinnerphonetype = (Spinner) findViewById(R.id.activity_one_phonetype_spinner);//phonetype spinner declaration\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,\n R.array.phone_spinner, android.R.layout.simple_spinner_item); //create the spinner array\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //set the drop down function\n spinnerphonetype.setAdapter(adapter); //set the spinner array\n }", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1,\n int arg2, long arg3) {\n actionType = String.valueOf(actionTypeSpiner\n .getSelectedItem());\n if (actionType == \"Upload\"\n || actionType.equals(\"Upload\")) {\n viewLay.setVisibility(View.GONE);\n action = true;\n fileNameTxt.setVisibility(View.GONE);\n doOpen();\n } else if (actionType == \"View\"\n || actionType.equals(\"View\")) {\n action = false;\n fileNameTxt.setVisibility(View.GONE);\n submitTxt.setEnabled(true);\n }\n }", "private void initSpinnerTypeExam()\n {\n Spinner spinner = findViewById(R.id.iTypeExam);\n\n // Adapt\n final ArrayAdapter<String> adapter = new ArrayAdapter<>(\n this,\n R.layout.support_simple_spinner_dropdown_item\n );\n spinner.setAdapter(adapter);\n\n // ajout des types d'examens\n for(TypeExamen t : TypeExamen.values())\n {\n adapter.add(t.toString());\n }\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n if (position != mClickTypeSelection) {\n setActionSpinner(true, position);\n }\n }", "private void setupSpinner() {\n // Create adapter for spinner. The list options are from the String array it will use\n // the spinner will use the default layout\n ArrayAdapter fruitSpinnerAdapter = ArrayAdapter.createFromResource(this,\n R.array.array_fruit_options, android.R.layout.simple_spinner_item);\n\n // Specify dropdown layout style - simple list view with 1 item per line\n fruitSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n\n // Apply the adapter to the spinner\n mTypeSpinner.setAdapter(fruitSpinnerAdapter);\n\n // Set the integer mSelected to the constant values\n mTypeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String selection = (String) parent.getItemAtPosition(position);\n if (!TextUtils.isEmpty(selection)) {\n if (selection.equals(getString(R.string.apple))) {\n mFruit = FruitEntry.TYPE_APPLE;\n } else if (selection.equals(getString(R.string.banana))) {\n mFruit = FruitEntry.TYPE_BANANA;\n } else if (selection.equals(getString(R.string.peach))) {\n mFruit = FruitEntry.TYPE_PEACH;\n } else if (selection.equals(getString(R.string.pineapple))) {\n mFruit = FruitEntry.TYPE_PINEAPPLE;\n } else if (selection.equals(getString(R.string.strawberry))) {\n mFruit = FruitEntry.TYPE_STRAWBERRY;\n } else if (selection.equals(getString(R.string.watermelon))) {\n mFruit = FruitEntry.TYPE_WATERMELON;\n } else {\n mFruit = FruitEntry.TYPE_NOTSELECTED;\n }\n }\n }\n\n // Because AdapterView is an abstract class, onNothingSelected must be defined\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n mFruit = FruitEntry.TYPE_NOTSELECTED;\n }\n });\n }", "ActionType getType();", "private void initControlUI() {\n typeAdapter = new SpinnerSimpleAdapter(self, android.R.layout.simple_spinner_item, self.getResources().getStringArray(R.array.arr_feedback_type));\n spnType.setAdapter(typeAdapter);\n }", "private static void onItemSelectedAction(AdapterView<?> parent, int position, AppCompatActivity actionBarActivity) {\n if (parent.getChildAt(0) != null) {\n ((TextView) parent.getChildAt(0)).setTextColor(actionBarActivity.getResources().getColor(R.color.app_color_spinner_filter_selected_item));\n ((TextView) parent.getChildAt(0)).setTextSize(14);\n }\n DataProvider.setHealthDataFilter((HealthDataFilter) parent.getItemAtPosition(position));\n PreferenceUtility.saveLastFilterName(actionBarActivity);\n }", "private void itemtypeSpinner() {\n ArrayAdapter<CharSequence> staticAdapter = ArrayAdapter\n .createFromResource(getContext(), R.array.select_array,\n android.R.layout.simple_spinner_item);\n\n // Specify the layout to use when the list of choices appears\n staticAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n // Apply the adapter to the spinner\n mItemTypeSpinnerA2.setAdapter(staticAdapter);\n\n mItemTypeSpinnerA2.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n String itemtypeText = (String) parent.getItemAtPosition(position);\n if (itemtypeText.equals(\"Mobile Phones\")) {\n\n mInputLayoutSerialNoA2.setVisibility(View.VISIBLE);\n mInputLayoutSerialNoA2.setClickable(true);\n mInputLayoutItemImeiA2.setVisibility(View.VISIBLE);\n mInputLayoutItemImeiA2.setClickable(true);\n\n\n } else if (itemtypeText.equals(\"Laptops\")) {\n\n mInputLayoutSerialNoA2.setVisibility(View.VISIBLE);\n mInputLayoutSerialNoA2.setClickable(true);\n mInputLayoutItemImeiA2.setVisibility(View.GONE);\n mInputLayoutItemImeiA2.setClickable(false);\n\n } else {\n mInputLayoutSerialNoA2.setVisibility(View.GONE);\n mInputLayoutSerialNoA2.setClickable(false);\n mInputLayoutItemImeiA2.setVisibility(View.GONE);\n mInputLayoutItemImeiA2.setClickable(false);\n }\n\n\n\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n mItemTypeSpinnerA2.getItemAtPosition(0);\n mInputLayoutSerialNoA2.setVisibility(View.GONE);\n mInputLayoutSerialNoA2.setClickable(false);\n mInputLayoutItemImeiA2.setVisibility(View.GONE);\n mInputLayoutItemImeiA2.setClickable(false);\n\n\n }\n });\n\n }", "Action getType();", "TinySpinnerButtonUI ( int type )\r\n {\r\n orientation = type;\r\n }", "private void initUI(View view) {\n btnSend = (AutoBgButton) view.findViewById(R.id.btnSend);\n btnBack = (ImageView) view.findViewById(R.id.btnBack);\n edtTitle = (EditText) view.findViewById(R.id.edtTitleFB);\n edtDes = (EditText) view.findViewById(R.id.edtDesFB);\n spnType = (Spinner) view.findViewById(R.id.spnType);\n btnBack.setOnClickListener(this);\n btnSend.setOnClickListener(this);\n spnType.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n\n @Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n if (position == 0) {\n type = \"1\";\n } else if (position == 1) {\n type = \"3\";\n }\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n // TODO Auto-generated method stub\n\n }\n });\n }", "protected void setStatusSpinner() {\r\n\t\tSpinner spinner = (Spinner) mActionBar.getCustomView().findViewById(\r\n\t\t\t\tR.id.spinner_status);\r\n\t\tif (!mShowStatusFilter\r\n\t\t\t\t|| mArchiveFragmentStatePagerAdapter.getCount() == 0) {\r\n\t\t\tspinner.setVisibility(View.GONE);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Determine which statuses are actually used for the currently\r\n\t\t// selected size filter.\r\n\t\tGridDatabaseAdapter gridDatabaseAdapter = new GridDatabaseAdapter();\r\n\t\tfinal StatusFilter[] usedStatuses = gridDatabaseAdapter\r\n\t\t\t\t.getUsedStatuses(mArchiveFragmentStatePagerAdapter\r\n\t\t\t\t\t\t.getSizeFilter());\r\n\r\n\t\t// Load the list of descriptions for statuses actually used into the\r\n\t\t// array adapter.\r\n\t\tString[] usedStatusesDescription = new String[usedStatuses.length];\r\n\t\tfor (int i = 0; i < usedStatuses.length; i++) {\r\n\t\t\tusedStatusesDescription[i] = getResources().getStringArray(\r\n\t\t\t\t\tR.array.archive_status_filter)[usedStatuses[i].ordinal()];\r\n\t\t}\r\n\t\tArrayAdapter<String> adapterStatus = new ArrayAdapter<String>(this,\r\n\t\t\t\tandroid.R.layout.simple_spinner_item, usedStatusesDescription);\r\n\t\tadapterStatus\r\n\t\t\t\t.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\r\n\r\n\t\t// Build the spinner\r\n\t\tspinner.setAdapter(adapterStatus);\r\n\r\n\t\t// Restore selected status\r\n\t\tStatusFilter selectedStatusFilter = mArchiveFragmentStatePagerAdapter\r\n\t\t\t\t.getStatusFilter();\r\n\t\tfor (int i = 0; i < usedStatuses.length; i++) {\r\n\t\t\tif (usedStatuses[i] == selectedStatusFilter) {\r\n\t\t\t\tspinner.setSelection(i);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Hide spinner if only two choices are available. As one of those\r\n\t\t// choices is always \"ALL\" the choices will result in an identical\r\n\t\t// selection.\r\n\t\tspinner.setVisibility((usedStatuses.length <= 2 ? View.GONE\r\n\t\t\t\t: View.VISIBLE));\r\n\r\n\t\tspinner.setOnItemSelectedListener(new OnItemSelectedListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void onItemSelected(AdapterView<?> parent, View view,\r\n\t\t\t\t\tint position, long id) {\r\n\t\t\t\t// Get the selected status\r\n\t\t\t\tStatusFilter statusFilter = usedStatuses[(int) id];\r\n\r\n\t\t\t\t// Check if value for status spinner has changed.\r\n\t\t\t\tif (statusFilter != mArchiveFragmentStatePagerAdapter\r\n\t\t\t\t\t\t.getStatusFilter()) {\r\n\t\t\t\t\t// Remember currently displayed grid id.\r\n\t\t\t\t\tint gridId = getCurrentSelectedGridId();\r\n\r\n\t\t\t\t\t// Refresh pager adapter with new status.\r\n\t\t\t\t\tmArchiveFragmentStatePagerAdapter\r\n\t\t\t\t\t\t\t.setStatusFilter(statusFilter);\r\n\r\n\t\t\t\t\t// Refresh the size spinner as the content of the spinners\r\n\t\t\t\t\t// are related.\r\n\t\t\t\t\tsetSizeSpinner();\r\n\r\n\t\t\t\t\t// If possible select the grid id which was selected before\r\n\t\t\t\t\t// changing the spinner(s). Otherwise select last page.\r\n\t\t\t\t\tselectGridId(gridId);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onNothingSelected(AdapterView<?> arg0) {\r\n\t\t\t\t// Do nothing\r\n\t\t\t}\r\n\t\t});\r\n\t}", "public void initSpinner() {\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n if (position != mHoldTypeSelection) {\n setActionSpinner(false, position);\n }\n }", "ActionType createActionType();", "public void addItemsOnSpinner2() {\n }", "public String getActionType() {\n return actionType;\n }", "public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n userType = (int) arg3;\n /* 将mySpinner 显示*/\n arg0.setVisibility(View.VISIBLE);\n }", "private void setEventTypeList() {\n EventTypeAdapter listAdapter = new EventTypeAdapter(this, R.layout.spinner_item, getResources().getStringArray(R.array.event_type_list));\n listAdapter.setDropDownViewResource(R.layout.spinner_list_item);\n listEventType.setAdapter(listAdapter);\n listEventType.setSelection(listAdapter.getCount());\n listEventType.setOnItemSelectedListener(this);\n }", "private void getUserTypeChoice() {\n mTypeInput = \"(\";\n if (mBinding.chipApartment.isChecked()) {\n if (!mTypeInput.equals(\"(\"))\n mTypeInput += \", \";\n mTypeInput = mTypeInput + \"'Apartment'\";\n }\n if (mBinding.chipLoft.isChecked()) {\n if (!mTypeInput.equals(\"(\"))\n mTypeInput += \", \";\n mTypeInput += \"'Loft'\";\n }\n if (mBinding.chipHouse.isChecked()) {\n if (!mTypeInput.equals(\"(\"))\n mTypeInput += \", \";\n mTypeInput += \"'House'\";\n }\n if (mBinding.chipVilla.isChecked()) {\n if (!mTypeInput.equals(\"(\"))\n mTypeInput += \", \";\n mTypeInput += \"'Villa'\";\n }\n if (mBinding.chipManor.isChecked()) {\n if (!mTypeInput.equals(\"(\"))\n mTypeInput += \", \";\n mTypeInput += \"'Manor'\";\n }\n mTypeInput += \")\";\n }", "@Override\n public void onClick(View view) {\n\n if (material_type.getSelectedItem().equals(\"--Select Material Type--\")) {\n Toast.makeText(Activity_Sell.this, \"Select Material Type to continue\", Toast.LENGTH_SHORT).show();\n } else {\n\n// LoadMaterialTypeSpinner();\n alertDialog.dismiss();\n getMaterial();\n /* getMaterialClasses();\n getMaterialDetails();\n getMaterialUnits();*/\n\n }\n }", "String getSpinnerText();", "public void handleItemSpinnerChange(){\n String itemTypeText = itemType.getSelectedItem().toString();\n if(itemTypeText.equals(\"Computer\")){\n osTextView.setVisibility(View.VISIBLE);\n osInput.setVisibility(View.VISIBLE);\n printerTextView.setVisibility(View.INVISIBLE);\n printerType.setVisibility(View.GONE);\n }\n else if(itemTypeText.equals(\"Printer\")){\n osTextView.setVisibility(View.INVISIBLE);\n osInput.setVisibility(View.INVISIBLE);\n printerTextView.setVisibility(View.VISIBLE);\n printerType.setVisibility(View.VISIBLE);\n }\n }", "@Override\n\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1,\n\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\tif (arg2 != 0) {\n\t\t\t\t\tindex2=arg2;\n\t\t\t\t\ttype1 = spn2.get(arg2).getType_id();\n\t\t\t\t\ttype_name1 = spn2.get(arg2).getType_name();\n\t\t\t\t\tHttpRequest1(APIURL.CHECK.ADDARTICLE1, spn2.get(arg2)\n\t\t\t\t\t\t\t.getType_id());\n\t\t\t\t\tspn4.clear();\n\t\t\t\t\tspinnerAdapter4.setList(spn4);\n\t\t\t\t\tspinnerAdapter4.notifyDataSetChanged();\n\t\t\t\t\tspn5.clear();\n\t\t\t\t\tspinnerAdapter5.setList(spn5);\n\t\t\t\t\tspinnerAdapter5.notifyDataSetChanged();\n\t\t\t\t} else {\n\t\t\t\t\ttype1 = \"\";\n\t\t\t\t\ttype_name1 = \"\";\n\t\t\t\t}\n\t\t\t}", "public void addItemsOnSpinner() {\n Data dataset = new Data(getApplicationContext());\n List<String> list = new ArrayList<String>();\n list = dataset.getClasses();\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, list);\n dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinner.setAdapter(dataAdapter);\n }", "public void addActionChoice () {\r\n\t\tactionChoices.add(new ActionChoice());\r\n\t}", "@Override\n\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1,\n\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\tif (arg2 != 0) {\n\t\t\t\t\tindex22=arg2;\n\t\t\t\t\ttype2 = spn3.get(arg2).getType_id();\n\t\t\t\t\ttype_name2 = spn3.get(arg2).getType_name();\n\t\t\t\t\tHttpRequest(2, APIURL.CHECK.ADDARTICLE2, \"\", spn3.get(arg2)\n\t\t\t\t\t\t\t.getType_id());\n\n\t\t\t\t\tspn5.clear();\n\t\t\t\t\tspinnerAdapter5.setList(spn5);\n\t\t\t\t\tspinnerAdapter5.notifyDataSetChanged();\n\t\t\t\t} else {\n\t\t\t\t\ttype2 = \"\";\n\t\t\t\t\ttype_name2 = \"\";\n\t\t\t\t}\n\t\t\t}", "private void assignSpinner(int i, String s) {\n switch (s) {\n case \"Bitters\":\n ArrayAdapter<String> bittersAdapter;\n bittersAdapter = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, bitters);\n bittersAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n spinnerArrayList.get(i-1).setAdapter(bittersAdapter);\n spinnerArrayList.get(i-1).setVisibility(View.VISIBLE);\n break;\n case \"Gin\":\n ArrayAdapter<String> ginAdapter;\n ginAdapter = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, gin);\n ginAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n spinnerArrayList.get(i-1).setAdapter(ginAdapter);\n spinnerArrayList.get(i-1).setVisibility(View.VISIBLE);\n break;\n case \"Rum\":\n ArrayAdapter<String> rumAdapter;\n rumAdapter = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, rum);\n rumAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n spinnerArrayList.get(i-1).setAdapter(rumAdapter);\n spinnerArrayList.get(i-1).setVisibility(View.VISIBLE);\n break;\n case \"Tequila\":\n ArrayAdapter<String> tequilaAdapter;\n tequilaAdapter = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, tequila);\n tequilaAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n spinnerArrayList.get(i-1).setAdapter(tequilaAdapter);\n spinnerArrayList.get(i-1).setVisibility(View.VISIBLE);\n break;\n case \"Vodka\":\n ArrayAdapter<String> vodkaAdapter;\n vodkaAdapter = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, vodka);\n vodkaAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n spinnerArrayList.get(i-1).setAdapter(vodkaAdapter);\n spinnerArrayList.get(i-1).setVisibility(View.VISIBLE);\n break;\n case \"Vermouth\":\n ArrayAdapter<String> vermouthAdapter;\n vermouthAdapter = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, vodka);\n vermouthAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n spinnerArrayList.get(i-1).setAdapter(vermouthAdapter);\n spinnerArrayList.get(i-1).setVisibility(View.VISIBLE);\n break;\n case \"Whiskey\":\n ArrayAdapter<String> whiskeyAdapter;\n whiskeyAdapter = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, whiskey);\n whiskeyAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n spinnerArrayList.get(i-1).setAdapter(whiskeyAdapter);\n spinnerArrayList.get(i-1).setVisibility(View.VISIBLE);\n break;\n }\n }", "@Override\n\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1,\n\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\tindex1=arg2;\n\t\t\t\ttype0 = spn1.get(arg2).getType_id();\n\t\t\t\ttype_name = spn1.get(arg2).getType_name();\n\t\t\t\tHttpRequest(1, APIURL.CHECK.ADDARTICLE1, spn1.get(arg2)\n\t\t\t\t\t\t.getType_id(), \"\");\n\t\t\t\tspn3.clear();\n\t\t\t\tspinnerAdapter3.setList(spn3);\n\t\t\t\tspinnerAdapter3.notifyDataSetChanged();\n\t\t\t\tspn4.clear();\n\t\t\t\tspinnerAdapter4.setList(spn4);\n\t\t\t\tspinnerAdapter4.notifyDataSetChanged();\n\t\t\t\tspn5.clear();\n\t\t\t\tspinnerAdapter5.setList(spn5);\n\t\t\t\tspinnerAdapter5.notifyDataSetChanged();\n\t\t\t}", "private void loadSpinner() {\n // Chargement du spinner de la liste des widgets\n widgetAdapter = (WidgetAdapter) DomoUtils.createAdapter(context, VOCAL);\n spinnerWidgets.setAdapter(widgetAdapter);\n\n // Chargement du spinner Box\n BoxAdapter boxAdapter = (BoxAdapter) DomoUtils.createAdapter(context, BOX);\n spinnerBox.setAdapter(boxAdapter);\n }", "@Override\r\n\t\tprotected void onPreExecute() {\n\t\t\trefreshMenuItem.setActionView(R.layout.action_progressbar);\r\n\r\n\t\t\trefreshMenuItem.expandActionView();\r\n\t\t}", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n recipeType = (String) recipeAdapter.getRecipeType(position);\n\n }", "private void createSpinners() {\n\t\tsuper.addSpinner(myResources.getString(\"FishReproduce\"));\n\t\tsuper.addSpinner(myResources.getString(\"SharkDeath\"));\n\t\tsuper.addSpinner(myResources.getString(\"SharkReproduce\"));\n\t}", "String getAction();", "String getAction();", "protected void init_actions()\r\n {\r\n action_obj = new CUP$AnalizadorSintactico$actions(this);\r\n }", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n type.getItems().add(\"Membre\");\n type.getItems().add(\"PetSitter\");\n type.getItems().add(\"Veterinaire\"); \n }", "@OnClick(R.id.converter_sale_or_purchase_cv)\n public void chooseAction() {\n mDialog = new DialogList(mContext,\n mActionDialogTitle, mListForActionDialog, null,\n new RecyclerViewAdapterDialogList.OnItemClickListener() {\n @Override\n public void onClick(int position) {\n if (position == 0) {\n mAction = ConstantsManager.CONVERTER_ACTION_PURCHASE;\n } else {\n mAction = ConstantsManager.CONVERTER_ACTION_SALE;\n }\n mPreferenceManager.setConverterAction(mAction);\n mDialog.getDialog().dismiss();\n setLang();\n }\n });\n ((ImageView) mDialog.getDialog().getWindow().findViewById(R.id.dialog_list_done))\n .setImageResource(R.drawable.ic_tr);\n mDialog.getDialog().getWindow().findViewById(R.id.dialog_list_done)\n .setBackground(getResources().getDrawable(R.drawable.ic_tr));\n }", "public int getActionType();", "@Override\r\n\tpublic void initActions() {\n\t\t\r\n\t}", "private void initSpinnerSelectionChamps() {\n\n //preparation de l'URL, recuperation de tous les champs dispo. dans la BDD\n final String url = WebService.buildUrlForRequest(Metier.DOMAIN, Metier.NOM_MODELE_CATEGORIES, WebService.ACTION_LIST, null);\n\n //preparation et execution de la requete en asynchrone\n asyncHttpClient.get(getActivity(), url, new AsyncHttpResponseHandler() {\n @Override\n public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {\n //recuperation des donnees et parsing en JSONArray\n String response = null;\n try {\n response = new String(responseBody, ENCODING);\n JSONArray jsonArray = new JSONArray(response);\n Log.e(\"JSONARRAY\", jsonArray.toString(1));\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n }\n\n @Override\n public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {\n new AlertDialog.Builder(getActivity()).setMessage(getString(R.string.error_msg_fail_retrieve_data) + statusCode).show();\n }\n });\n/*\n try {\n JSONObject json = JsonUtils.loadJSONFromResources(getActivity(), R.raw.champs);\n this.spinnerChampAdapter = new ChampAdapter(getActivity(), JsonUtils.getJsonObjects(json, new ArrayList<JSONObject>()));\n } catch (IOException e) {\n e.printStackTrace();\n }*/\n }", "@Override\n public void updateActionUI() {\n JSONObject jobContractsAndItsBidIds = getJobContractsAndItsBidIds(getContracts(), super.getId());\n JSONArray jobContracts = jobContractsAndItsBidIds.getJSONArray(\"jobContracts\");\n JSONArray offerContracts = jobContractsAndItsBidIds.getJSONArray(\"offerContracts\");\n JSONArray jobContractBidsJSONArray = jobContractsAndItsBidIds.getJSONArray(\"jobContractBids\");\n aboutToExpireContracts = jobContractsAndItsBidIds.getJSONArray(\"aboutToExpireContracts\");\n\n // converting jobContractBidsJSONArray into an arraylist\n ArrayList<String> jobContractBids = new ArrayList<>();\n for (int i = 0; i < jobContractBidsJSONArray.length(); i++) {\n jobContractBids.add(jobContractBidsJSONArray.getString(i));\n }\n\n //get available bids\n JSONArray availableBids = getAvailableBids(jobContractBids, getBids(true), super.getCompetencies(), getId());\n\n // getting tutor's actions\n ArrayList<Action> tutorActions = getTutorActions(view, availableBids, jobContracts, offerContracts, this);\n\n // getting default user actions and adding them to tutor's actions\n ArrayList<Action> defaultActions = getDefaultActions();\n\n for (int i =0; i < defaultActions.size(); i++) {\n tutorActions.add(defaultActions.get(i));\n }\n\n // setting user's action as tutor's action\n super.setActions(tutorActions);\n }", "private void setUpSpinner(){\n ArrayAdapter paymentSpinnerAdapter =ArrayAdapter.createFromResource(this,R.array.array_gender_option,android.R.layout.simple_spinner_item);\n\n // Specify dropdown layout style - simple list view with 1 item per line, then apply adapter to the spinner\n paymentSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n mPaymentSpinner.setAdapter(paymentSpinnerAdapter);\n\n // To set the spinner to the selected payment method by the user when clicked from cursor adapter.\n if (payMode != null) {\n if (payMode.equalsIgnoreCase(\"COD\")) {\n mPaymentSpinner.setSelection(0);\n } else {\n mPaymentSpinner.setSelection(1);\n }\n mPaymentSpinner.setOnTouchListener(mTouchListener);\n }\n\n mPaymentSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String selectedPayment = (String)parent.getItemAtPosition(position);\n if(!selectedPayment.isEmpty()){\n if(selectedPayment.equals(getString(R.string.payment_cod))){\n mPaymentMode = clientContract.ClientInfo.PAYMENT_COD; // COD = 1\n }else{\n\n mPaymentMode = clientContract.ClientInfo.PAYMENT_ONLINE; // ONLINE = 0\n }\n }\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n\n }\n });\n\n }", "private void setupSpinner() {\n // Create adapter for spinner. The list options are from the String array it will use\n // the spinner will use the default layout\n ArrayAdapter supplierSpinnerAdapter = ArrayAdapter.createFromResource(this,\n R.array.array_supplier_options, android.R.layout.simple_spinner_item);\n\n // Specify dropdown layout style - simple list view with 1 item per line\n supplierSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n\n // Apply the adapter to the spinner\n mSupplierSpinner.setAdapter(supplierSpinnerAdapter);\n\n // Set the integer mSelected to the constant values\n mSupplierSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String selection = (String) parent.getItemAtPosition(position);\n if (!TextUtils.isEmpty(selection)) {\n if (selection.equals(getString(R.string.supplier_one))) {\n mSupplier = BookEntry.SUPPLIER_ONE;\n } else if (selection.equals(getString(R.string.supplier_two))) {\n mSupplier = BookEntry.SUPPLIER_TWO;\n } else {\n mSupplier = BookEntry.SUPPLIER_UNKNOWN;\n }\n }\n }\n\n // Because AdapterView is an abstract class, onNothingSelected must be defined\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n mSupplier = BookEntry.SUPPLIER_UNKNOWN;\n }\n });\n }", "public interface ChoiceAction {\n}", "public void setActionType(Integer actionType) {\n this.actionType = actionType;\n }", "private void setupModeSpinner() {\n \t\tSpinner spinner = (Spinner) this.findViewById( R.id.action_edit_gpsfilter_area_mode );\n \t\tArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource( this, R.array.action_edit_gpsfilter_area_mode, android.R.layout.simple_spinner_item );\n \t\tadapter.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item );\n \t\tspinner.setAdapter( adapter );\n \n \t\tspinner.setSelection( this.area.getMode() == GPSFilterMode.INCLUDE ? 0 : 1 );\n \n \t\tspinner.setOnItemSelectedListener( new OnItemSelectedListener() {\n \t\t\t@Override\n \t\t\tpublic void onItemSelected( AdapterView<?> parent, View view, int position, long id ) {\n \t\t\t\tupdateMode( position );\n \t\t\t}\n \n \t\t\t@Override\n \t\t\tpublic void onNothingSelected( AdapterView<?> parent ) {\n \t\t\t}\n \t\t} );\n \t}", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n String taskType = adapterView.getItemAtPosition(i).toString();\n Log.d(TAG, \"SPINNER: \" + taskType);\n\n\n String[] tasks = getResources().getStringArray(R.array.tasktypelist);\n\n if (tasks.length > 0 && taskType.equals(tasks[0])) {\n taskParamsLayout.removeAllViews();\n\n piPointsNo = new EditText(MainActivity.this);\n piPointsNo.setInputType(InputType.TYPE_CLASS_NUMBER);\n piPointsNo.setHint(R.string.taskpi_help_points);\n\n taskParamsLayout.addView(piPointsNo);\n\n }\n\n else if (tasks.length > 1 && taskType.equals(tasks[1])) {\n taskParamsLayout.removeAllViews();\n\n Message msg=new Message();\n msg.obj=\"Wait! This task is a false one! :( \";\n toastHandler.sendMessage(msg);\n }\n\n else if (tasks.length > 2 && taskType.equals(tasks[2])) {\n taskParamsLayout.removeAllViews();\n\n Message msg=new Message();\n msg.obj=\"Wait! This task is a false one! :( \";\n toastHandler.sendMessage(msg);\n }\n\n }", "private void updateSubModeSpinnerTexts() {\n\n }", "protected void init_actions()\n {\n action_obj = new CUP$Sintactico$actions(this);\n }", "@Override\n\tpublic void onClick(View v) {\n\t\tif (searchText.equals(\"Restaurants\")){\n\t\t\tsearchType=\"restaurant\";\t\n\t\t}\n\t\telse if (searchText.equals(\"Shopping Mall\")){\n\t\t\tsearchType=\"shopping_mall\";\n\t\t}\n\t\telse if (searchText.equals(\"ATM\")){\n\t\t\tsearchType=\"atm\";\n\t\t}\n\t\telse if (searchText.equals(\"Bank\")){\n\t\t\tsearchType=\"bank\";\n\t\t}\n\t\telse if (searchText.equals(\"Hospital\")){\n\t\t\tsearchType=\"hospital\";\n\t\t}\n\t\tloadPage();\n\t\t\n\t}", "@Override\r\n\tpublic String getAction() {\n\t\tString action = null;\r\n\t\tif(caction.getSelectedIndex() == -1) {\r\n\t\t\treturn null;\r\n\t}\r\n\tif(caction.getSelectedIndex() >= 0) {\r\n\t\t\taction = caction.getSelectedItem().toString();\r\n\t}\r\n\t\treturn action;\r\n\t\r\n\t}", "public void setActionType(final String actionType) {\n this.actionType = actionType;\n }", "public void initializers() {\n\t\taccidentSpinner = (Spinner) findViewById(R.id.accidentSpinner);\n\t\tdesc = (EditText) findViewById(R.id.descriptionEt);\n\t\timView = (ImageView) findViewById(R.id.image1);\n\t\timView2 = (ImageView) findViewById(R.id.image2);\n\t\timView.setOnClickListener(this);\n\t\timView2.setOnClickListener(this);\n\t\tsubmit = (Button) findViewById(R.id.reportBtn);\n\t\tsubmit.setOnClickListener(this);\n\n\t\ttry {\n\t\t\tArrayAdapter<String> adapter_state = new ArrayAdapter<String>(this,\n\t\t\t\t\tandroid.R.layout.simple_spinner_item, accidentType);\n\t\t\tadapter_state\n\t\t\t\t\t.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\t\t\taccidentSpinner.setAdapter(adapter_state);\n\t\t} catch (Exception ex) {\n\t\t\tToast.makeText(this, \"Something happen\", Toast.LENGTH_SHORT).show();\n\t\t}\n\n\t}", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n pane.getButtonTypes()\n .add(new ButtonType(\"Finalizar\", ButtonBar.ButtonData.OK_DONE));\n pane.getButtonTypes()\n .add(new ButtonType(\"Cancelar\", ButtonBar.ButtonData.CANCEL_CLOSE));\n System.out.println(\"stuff initialized\");\n }", "@Override\r\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n switch (position) {\r\n case 0:\r\n mode = 1;\r\n //mode = spinner.getSelectedItem().toString();\r\n break;\r\n case 1:\r\n mode = 2;\r\n //mode = spinner.getSelectedItem().toString();\r\n break;\r\n case 2:\r\n mode = 3;\r\n //mode = spinner.getSelectedItem().toString();\r\n break;\r\n }\r\n }", "private void setUpCategorySpinner() {\n mCategorySpinner = (Spinner) findViewById(R.id.spnCategory);\n categoryList = new ArrayList<>();\n categoryList.add(AppUtils.SELECT_CATEGORY);\n List<String> tempList = AppUtils.getAllCategoryName();\n categoryList.addAll(tempList);\n int size = categoryList.size();\n categoryList.add(size, AppUtils.CREATE_CATEGORY);\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,\n android.R.layout.simple_spinner_item, categoryList);\n dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n mCategorySpinner.setAdapter(dataAdapter);\n mCategorySpinner.setOnItemSelectedListener(this);\n }", "@Override\n public void userRequestedAction()\n {\n inComm = true;\n view.disableAction();\n\n // switch to loading ui\n view.setActionText(\"Loading...\");\n view.setStatusText(loadingMessages[rand.nextInt(loadingMessages.length)]);\n view.setStatusColor(COLOR_WAITING);\n view.loadingAnimation();\n\n // switch the status of the system\n if (isArmed) disarmSystem();\n else armSystem();\n isArmed = !isArmed;\n\n // notify PubNub\n }", "@Override\n\tpublic String getAction() {\n\t\treturn action;\n\t}", "public void setAction(String action) { this.action = action; }", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1, int position, long id) {\n switch (position)\n {\n case 1:\n break;\n case 2:\n Toast.makeText(this,appointmentTypes[position],Toast.LENGTH_LONG).show();\n /*Intent intent = new Intent(getApplicationContext(), AppointmentRequests.class);\n Bundle b = new Bundle();\n b.putString(\"userid\",userid);\n intent.putExtras(b);\n startActivity(intent);*/\n break;\n case 3:\n break;\n }\n }", "public void selected(String action);", "public void populateSpinner() {\r\n ArrayList<String> ary = new ArrayList<>();\r\n\r\n ary.add(\"Male\");\r\n ary.add(\"Female\");\r\n\r\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.support_simple_spinner_dropdown_item, ary);\r\n\r\n adapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\r\n Gender.setAdapter(adapter);\r\n }", "protected void init_actions()\n {\n action_obj = new CUP$FractalParser$actions(this);\n }", "public String getAction() {\n return action;\n }", "private SelectOSAction() {\r\n }", "public void onClickSifIVSpinner(View view){\n sifIncidentTypeSpinner.performClick();\n }", "private void createToolBarActions() {\r\n\t\t// create the action\r\n\t\tGetMessage<Transport> getMessage = new GetMessage<Transport>(new Transport());\r\n\t\tgetMessage.addParameter(IFilterTypes.TRANSPORT_TODO_FILTER, \"\");\r\n\r\n\t\t// add to the toolbar\r\n\t\tform.getToolBarManager().add(new RefreshViewAction<Transport>(getMessage));\r\n\t\tform.getToolBarManager().update(true);\r\n\t}", "StateClass(String action) {\r\n setAccountAction(action); \r\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n if(appCompatActivity instanceof MainActivity){\n if (AppConstant.DEBUG) Log.d(new Object() { }.getClass().getEnclosingClass()+\">\",\"action is mainactivity\");\n ((MainActivity)appCompatActivity).loadReportsData();\n // ((MainActivity)appCompatActivity).removeMenuItem();\n }\n\n onItemSelectedAction(parent, position, appCompatActivity);\n if (appCompatActivity instanceof IListenToItemSelected) {\n ((IListenToItemSelected) appCompatActivity).itemSelectedListenCustom(parent);\n }\n }", "private void spinnerFunctions() {\n mTranportSectionAdapter = ArrayAdapter.createFromResource(getContext(), R.array.transport_titles, R.layout.drop_down_spinner_item);\n mTransportSectionSpinner.setAdapter(mTranportSectionAdapter);\n mFuelTypeAdapter = ArrayAdapter.createFromResource(getContext(), R.array.fuel_types, R.layout.drop_down_spinner_item);\n mFuelTypeSpinner.setAdapter(mFuelTypeAdapter);\n mBoxAdapter = ArrayAdapter.createFromResource(getContext(), R.array.box_types, R.layout.drop_down_spinner_item);\n mBoxSpinner.setAdapter(mBoxAdapter);\n }", "protected void init_actions() {\r\n action_obj = new CUP$SintacticoH$actions(this);\r\n }", "private void optionSelected(MenuActionDataItem action){\n \t\tString systemAction = action.getSystemAction();\n \t\tif(!systemAction.equals(\"\")){\n \t\t\t\n \t\t\tif(systemAction.equals(\"back\")){\n \t\t\t\tonBackPressed();\n \t\t\t}else if(systemAction.equals(\"home\")){\n \t\t\t\tIntent launchHome = new Intent(this, CoverActivity.class);\t\n \t\t\t\tstartActivity(launchHome);\n \t\t\t}else if(systemAction.equals(\"tts\")){\n \t\t\t\ttextToSearch();\n \t\t\t}else if(systemAction.equals(\"search\")){\n \t\t\t\tshowSearch();\n \t\t\t}else if(systemAction.equals(\"share\")){\n \t\t\t\tshowShare();\n \t\t\t}else if(systemAction.equals(\"map\")){\n \t\t\t\tshowMap();\n \t\t\t}else\n \t\t\t\tLog.e(\"CreateMenus\", \"No se encuentra el el tipo de menu: \" + systemAction);\n \t\t\t\n \t\t}else{\n \t\t\tNextLevel nextLevel = action.getNextLevel();\n \t\t\tshowNextLevel(this, nextLevel);\n \t\t\t\n \t\t}\n \t\t\n \t}", "protected void init_actions()\n {\n action_obj = new CUP$Asintactico$actions(this);\n }", "private PSContentTypeActionMenuHelper(){}", "public void onItemSelected(AdapterView<?> parent, View view,\n int pos, long id) {\n\n Spinner spinner = (Spinner) parent;\n Integer tag = (Integer) spinner.getTag();\n int tagValue = tag.intValue();\n switch (tagValue)\n {\n case VIEWED_SPINNER_ID:\n {\n boolean bChange =false;\n if (orderBy.equals(orderByViewed))\n {\n bChange = true;\n }\n if (pos == 0)\n {\n orderByViewed = \"album_name ASC\";\n }\n else\n {\n orderByViewed = \"album_name DESC\";\n }\n if (bChange) {\n orderBy = orderByViewed;\n }\n }\n break;\n\n case PRICE_SPINNER_ID:\n {\n boolean bChange =false;\n if (orderBy.equals(orderByPrice))\n {\n bChange = true;\n }\n if (pos == 0) {\n orderByPrice = \"price DESC\";\n }\n else\n {\n orderByPrice = \"price ASC\";\n }\n if (bChange) {\n orderBy = orderByPrice;\n }\n }\n break;\n\n case RATINGS_SPINNER_ID:\n {\n boolean bChange =false;\n if (orderBy.equals(orderByRatings))\n {\n bChange = true;\n }\n if (pos == 0) {\n orderByRatings = \"ratings DESC\";\n }\n else\n {\n orderByRatings = \"ratings ASC\";\n }\n if (bChange) {\n orderBy = orderByRatings;\n }\n }\n break;\n\n case YEAR_SPINNER_ID:\n {\n boolean bChange =false;\n if (orderBy.equals(orderByYear))\n {\n bChange = true;\n }\n if (pos == 0) {\n orderByYear = \"year DESC\";\n }\n else\n {\n orderByYear = \"year ASC\";\n }\n if (bChange) {\n orderBy = orderByYear;\n }\n }\n break;\n\n case BEDS_SPINNER_ID:\n {\n boolean bChange =false;\n if (orderBy.equals(orderByBeds))\n {\n bChange = true;\n }\n if (pos == 0) {\n orderByBeds = \"beds DESC\";\n }\n else\n {\n orderByBeds = \"beds ASC\";\n }\n if (bChange) {\n orderBy = orderByBeds;\n }\n }\n break;\n\n case BATHS_SPINNER_ID:\n {\n boolean bChange =false;\n if (orderBy.equals(orderByBaths))\n {\n bChange = true;\n }\n if (pos == 0) {\n orderByBaths = \"baths DESC\";\n }\n else\n {\n orderByBaths = \"baths ASC\";\n }\n if (bChange) {\n orderBy = orderByBaths;\n }\n }\n break;\n\n case AREA_SPINNER_ID:\n {\n boolean bChange =false;\n if (orderBy.equals(orderByArea))\n {\n bChange = true;\n }\n if (pos == 0) {\n orderByArea = \"area DESC\";\n }\n else\n {\n orderByArea = \"area ASC\";\n }\n if (bChange) {\n orderBy = orderByArea;\n }\n }\n break;\n\n case MAKE_SPINNER_ID:\n {\n boolean bChange =false;\n if (orderBy.equals(orderByMake))\n {\n bChange = true;\n }\n if (pos == 0) {\n orderByMake = \"make ASC\";\n }\n else\n {\n orderByMake = \"make DESC\";\n }\n if (bChange) {\n orderBy = orderByMake;\n }\n }\n break;\n\n case MODEL_SPINNER_ID:\n {\n boolean bChange =false;\n if (orderBy.equals(orderByModel))\n {\n bChange = true;\n }\n if (pos == 0) {\n orderByModel = \"model ASC\";\n }\n else\n {\n orderByModel = \"model DESC\";\n }\n if (bChange) {\n orderBy = orderByModel;\n }\n }\n break;\n\n case COLOR_SPINNER_ID:\n {\n boolean bChange =false;\n if (orderBy.equals(orderByColor))\n {\n bChange = true;\n }\n if (pos == 0) {\n orderByColor = \"color ASC\";\n }\n else\n {\n orderByColor = \"color DESC\";\n }\n if (bChange) {\n orderBy = orderByColor;\n }\n }\n break;\n\n\n\n default:\n break;\n }\n\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\trequestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\tsetContentView(R.layout.new_class_add);\n\t\tcontext = this;\n\t\tIntent intent = getIntent();\n\t\tString type = intent.getStringExtra(\"type\");\n\t\tif(\"1\".equals(type)){\n\t\t\t\n\t\t}\n\t\tname_of_class = (EditText) findViewById(R.id.name_of_class);\n\t\tname_of_class.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = new Intent(context, ClassListActivity.class);\n\t\t\t\tstartActivityForResult(intent, 2);\n\n\t\t\t}\n\t\t});\n\t\tname_of_teacher = (EditText) findViewById(R.id.name_of_teacher);\n\n\t\tname_of_teacher.setOnClickListener(new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = new Intent(context, TeacherListActivity.class);\n\t\t\t\tstartActivityForResult(intent, 1);\n\t\t\t}\n\t\t});\n\n\t\tspinner1 = (Spinner) findViewById(R.id.Spinner01);\n\t\tadapter_m = new ArrayAdapter<String>(this,\n\t\t\t\tandroid.R.layout.simple_spinner_item, m);\n\t\t// 设置下拉列表的风格\n\t\tadapter_m.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n\t\t// 将adapter 添加到spinner中\n\t\tspinner1.setAdapter(adapter_m);\n\t\t// 设置默认值\n\t\tspinner1.setVisibility(View.VISIBLE);\n\t\t\n\t\tspinner2= (Spinner) findViewById(R.id.Spinner02);\n\t\tadapter_n = new ArrayAdapter<String>(this,\n\t\t\t\tandroid.R.layout.simple_spinner_item, n);\n\t\t// 设置下拉列表的风格\n\t\tadapter_n.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n\t\t// 将adapter 添加到spinner中\n\t\tspinner2.setAdapter(adapter_n);\n\t\t// 设置默认值\n\t\tspinner2.setVisibility(View.VISIBLE);\n\t\t\n\t\tspinner3= (Spinner) findViewById(R.id.Spinner03);\n\t\tadapter_address = new ArrayAdapter<String>(this,\n\t\t\t\tandroid.R.layout.simple_spinner_item, address);\n\t\t// 设置下拉列表的风格\n\t\tadapter_address.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n\t\t// 将adapter 添加到spinner中\n\t\tspinner3.setAdapter(adapter_address);\n\t\t// 设置默认值\n\t\tspinner3.setVisibility(View.VISIBLE);\n\t\t\n\n\t}", "@Override\n\t\t\tpublic void onItemSelected(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\tcontainerType = containerTypes.get(position);\n\t\t\t}", "public void runSpinner() {\r\n addItemsOndifficultySpinner();\r\n addListenerOnButton();\r\n addListenerOnSpinnerItemSelection();\r\n }", "public String getActionType() {\n return actionType;\n }", "private void init(){\n //Selected value in Spinner\n String selectedSubj= getActivity().getIntent().getStringExtra(\"subj\");\n String selectedPoten= getActivity().getIntent().getStringExtra(\"prob\");\n String selectedInst= getActivity().getIntent().getStringExtra(\"inst\");\n String selectedY= getActivity().getIntent().getStringExtra(\"peri\");\n\n if(selectedY.equals(\"2015~2017\")){\n String yList[]= {\"2015\", \"2016\", \"2017\"};\n selectedY= yList[new Random().nextInt(yList.length)];\n }\n\n String e_inst= QuestionUtil.create_eInst(selectedY, selectedInst);\n String k_inst= QuestionUtil.create_kInst(e_inst);\n String m= QuestionUtil.createPeriodM(selectedY, e_inst);\n\n QuestionNameBuilder.inst= new QuestionNameBuilder(selectedY, m, k_inst, selectedSubj, QuestionNameBuilder.UNDEFINED\n , QuestionNameBuilder.UNDEFINED, QuestionNameBuilder.TYPE_KOR);\n qnBuilder= QuestionNameBuilder.inst;\n\n //Potential Load\n loadPotentials(selectedPoten);\n }", "private void setupSpinner() {\n // Create adapter for spinner. The list options are from the String array it will use\n // the spinner will use the default layout\n ArrayAdapter genderSpinnerAdapter = ArrayAdapter.createFromResource(this,\n R.array.array_gender_options, android.R.layout.simple_spinner_item);\n\n // Specify dropdown layout style - simple list view with 1 item per line\n genderSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n\n // Apply the adapter to the spinner\n mGenderSpinner.setAdapter(genderSpinnerAdapter);\n\n // Set the integer mSelected to the constant values\n mGenderSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String selection = (String) parent.getItemAtPosition(position);\n if (!TextUtils.isEmpty(selection)) {\n if (selection.equals(getString(R.string.gender_male))) {\n mGender = PetContract.PetEntry.GENDER_MALE;\n } else if (selection.equals(getString(R.string.gender_female))) {\n mGender = PetContract.PetEntry.GENDER_FEMALE;\n } else {\n mGender = PetContract.PetEntry.GENDER_UNKNOWN;\n }\n }\n }\n\n // Because AdapterView is an abstract class, onNothingSelected must be defined\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n mGender = PetContract.PetEntry.GENDER_UNKNOWN;\n }\n });\n }", "public void spinner() {\n /**\n * calls if the tasks was weekly, if not, it will be automatically set to \"once\"\n */\n if(weekly) {\n String[] items = new String[]{activity.getResources().getString(R.string.sunday), activity.getResources().getString(R.string.monday), activity.getResources().getString(R.string.tuesday), activity.getResources().getString(R.string.wednesday), activity.getResources().getString(R.string.thursday), activity.getResources().getString(R.string.friday), activity.getResources().getString(R.string.saturday)};\n ArrayAdapter<String> frequencyAdapter = new ArrayAdapter<String>(activity.getBaseContext(), android.R.layout.simple_spinner_dropdown_item, items);\n weekday.setAdapter(frequencyAdapter);\n weekday.getBackground().setColorFilter(activity.getResources().getColor(R.color.colorAccent), PorterDuff.Mode.SRC_ATOP);\n weekday.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n day = String.valueOf(position + 1); //chosen day is stored\n\n }\n\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n\n }\n });\n } else {\n day = \"8\";\n weekday.setVisibility(View.GONE);\n }\n }", "@Override\n public void onClick(View v) {\n setTaskShowType();\n }", "public String chooseAction(JSONObject context, boolean initializing)\r\n {\r\n if(initializing)\r\n {\r\n \r\n //Take a decision\r\n }\r\n \r\n else\r\n {\r\n //Take a decision\r\n }\r\n \r\n }", "public void setActiontype(Integer actiontype) {\n this.actiontype = actiontype;\n }", "private void getAndSetIncomingIntent(){\n if (getIntent().hasExtra(\"asso\")) {\n Log.d(TAG, getIntent().getStringExtra(\"asso\"));\n edt_asso_name.setText(getIntent().getStringExtra(\"asso\"));\n }\n if (getIntent().hasExtra(\"school\")) {\n edt_school.setText(getIntent().getStringExtra(\"school\"));\n }\n if (getIntent().hasExtra(\"purpose\")) {\n edt_purpose.setText(getIntent().getStringExtra(\"purpose\"));\n }\n if (getIntent().hasExtra(\"link\")) {\n edt_link.setText(getIntent().getStringExtra(\"link\"));\n }\n if (getIntent().hasExtra(\"type\")) {\n selectedSpinnerType = getIntent().getStringExtra(\"type\");\n }\n\n }", "private void placeActions() {\n IActionBars actionBars = getViewSite().getActionBars();\n\n // first in the menu\n IMenuManager menuManager = actionBars.getMenuManager();\n menuManager.add(mCreateFilterAction);\n menuManager.add(mEditFilterAction);\n menuManager.add(mDeleteFilterAction);\n menuManager.add(new Separator());\n menuManager.add(mClearAction);\n menuManager.add(new Separator());\n menuManager.add(mExportAction);\n\n // and then in the toolbar\n IToolBarManager toolBarManager = actionBars.getToolBarManager();\n for (CommonAction a : mLogLevelActions) {\n toolBarManager.add(a);\n }\n toolBarManager.add(new Separator());\n toolBarManager.add(mCreateFilterAction);\n toolBarManager.add(mEditFilterAction);\n toolBarManager.add(mDeleteFilterAction);\n toolBarManager.add(new Separator());\n toolBarManager.add(mClearAction);\n }", "public void addItemsOnSpinner() {\r\n\r\n\tspinner = (Spinner) findViewById(R.id.spinner);\r\n\tList<String> list = new ArrayList<String>();\r\n\tlist.add(\"Food\");\r\n\tlist.add(\"RentHouse\");\r\n\tlist.add(\"Closing\");\r\n\tlist.add(\"Party\");\r\n\tlist.add(\"Material\");\r\n\tArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, list);\r\n\tdataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\r\n\tspinner.setAdapter(dataAdapter);\r\n }", "private void loadSpinner(View view) {\n\n ArrayAdapter<String> adapter = new ArrayAdapter<>(\n view.getContext(), android.R.layout.simple_spinner_item, getCategories());\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n categorySpinner.setAdapter(adapter);\n\n\n }", "public Integer getActiontype() {\n return actiontype;\n }", "public Type getActionType() {\n return actionType;\n }", "private void setUpSocialSpinner() {\n socialSpinner = mView.findViewById(R.id.social_spinner);\n\n // Get list of social conditions setup in strings.xml\n conditionsArray = new ArrayList<>(Arrays.asList(getResources().getStringArray(R.array.social_conditions)));\n conditionsArray.add(getResources().getString(R.string.spinner_empty)); //filter_empty is \"None\"\n\n // Convert ArrayList to array, so that it can be passed to SocialArrayAdapter\n String[] spinnerObject = new String[conditionsArray.size()];\n spinnerObject = conditionsArray.toArray(spinnerObject);\n\n // Create string ArrayAdapter that will be used for filterSpinner\n ArrayAdapter<String> spinnerAdapter = new SocialArrayAdapter(mActivity,\n R.layout.spinner_item, spinnerObject);\n socialSpinner.setAdapter(spinnerAdapter);\n\n // Set default selection to None\n int defaultIndex = conditionsArray.indexOf(getResources().getString(R.string.spinner_empty));\n socialSpinner.setSelection(defaultIndex);\n }", "void loadSpinner(Spinner sp){\n List<String> spinnerArray = new ArrayList<>();\n spinnerArray.add(\"Oui\");\n spinnerArray.add(\"Non\");\n\n// (3) create an adapter from the list\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(\n this,\n android.R.layout.simple_spinner_item,\n spinnerArray\n );\n\n//adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n// (4) set the adapter on the spinner\n sp.setAdapter(adapter);\n\n }", "public void setType( final int type )\n {\n this.type = type;\n fireActionChanged();\n }", "protected void init_actions()\n {\n action_obj = new CUP$PCLParser$actions(this);\n }", "String getActionName(Closure action);", "public String getAction() {\n return action;\n }" ]
[ "0.6103016", "0.6077356", "0.60322636", "0.601555", "0.5984481", "0.5956611", "0.59526837", "0.5842299", "0.5818588", "0.58178174", "0.5780438", "0.5749028", "0.56265414", "0.55930096", "0.55812454", "0.5545105", "0.5456515", "0.5418632", "0.5398931", "0.5382475", "0.5338547", "0.5330801", "0.53102785", "0.5299102", "0.5291508", "0.5284759", "0.52725583", "0.5238713", "0.5230696", "0.52220917", "0.52216595", "0.521812", "0.5210353", "0.5210028", "0.5209113", "0.5175553", "0.5175553", "0.51751906", "0.51681304", "0.5164386", "0.51623315", "0.51573986", "0.515142", "0.51357794", "0.51102954", "0.5107539", "0.51023996", "0.5082709", "0.5081391", "0.5078873", "0.50712633", "0.50688833", "0.5060471", "0.50531226", "0.5052564", "0.5050447", "0.50487775", "0.5046428", "0.5045727", "0.50431657", "0.5035791", "0.5035672", "0.5035596", "0.5030641", "0.5027665", "0.5022201", "0.50026774", "0.50014937", "0.4997855", "0.49957272", "0.4988296", "0.49881074", "0.49817973", "0.49801886", "0.4977196", "0.49732864", "0.49707058", "0.49694642", "0.49650934", "0.49635142", "0.49558648", "0.4949867", "0.49471286", "0.4941227", "0.4936201", "0.49342757", "0.49309492", "0.4924554", "0.49137655", "0.4904667", "0.49006563", "0.48981777", "0.4896836", "0.4895244", "0.4893202", "0.4887567", "0.4884577", "0.48839414", "0.48833132", "0.48832086" ]
0.7030165
0
Gets the DB connection
public static Connection getConnection() { return conn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Connection getDBConnection() {\n\n\t\tConnection dbConnection = null;\n\n\t\ttry {\n\n\t\t\tClass.forName(dbDriver);\n\n\t\t} catch (ClassNotFoundException e) {\n\n\t\t\tLOGGER.error(e.getMessage());\n\n\t\t}\n\n\t\ttry {\n\n\t\t\tdbConnection = DriverManager.getConnection(dbConnectionURL, dbUser, dbPassword);\n\t\t\treturn dbConnection;\n\n\t\t} catch (SQLException e) {\n\n\t\t\tLOGGER.error(e.getMessage());\n\n\t\t}\n\n\t\treturn dbConnection;\n\n\t}", "private static Connection getDBConnection() {\n\n\t\tConnection dbConnection = null;\n\n\t\ttry {\n\n\t\t\tClass.forName(DB_DRIVER);\n\n\t\t} catch (ClassNotFoundException e) {\n\n\t\t\tSystem.out.println(e.getMessage());\n\n\t\t}\n\n\t\ttry {\n\n\t\t\tdbConnection = DriverManager.getConnection(DB_CONNECTION, DB_USER,\n\t\t\t\t\tDB_PASSWORD);\n\t\t\treturn dbConnection;\n\n\t\t} catch (SQLException e) {\n\n\t\t\tSystem.out.println(e.getMessage());\n\n\t\t}\n\n\t\treturn dbConnection;\n\n\t}", "public Connection getDbConnect() {\n return dbConnect;\n }", "public static Connection getConnection() {\n\t\ttry {\n\t\t\treturn DBUtil.getInstance().ds.getConnection();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\n\t}", "public static Connection getConnection()\n {\n if (ds == null) {\n try {\n initCtx = new InitialContext();\n envCtx = (Context) initCtx.lookup(\"java:comp/env\");\n ds = (DataSource) envCtx.lookup(dbName);\n }\n catch (javax.naming.NamingException e) {\n Logger.log(Logger.ERROR, \"A problem occurred while retrieving a DataSource object\");\n Logger.log(Logger.ERROR, e.toString());\n }\n }\n\n Connection dbCon = null;\n try {\n dbCon = ds.getConnection();\n }\n catch (java.sql.SQLException e) {\n Logger.log(Logger.ERROR, \"A problem occurred while connecting to the database.\");\n Logger.log(Logger.ERROR, e.toString());\n }\n return dbCon;\n }", "public static DatabaseConnection getDb() {\n return db;\n }", "public Connection getConnection() {\n if(connection == null) throw new RuntimeException(\"Attempt to get database connection before it was initialized\");\n return connection;\n }", "public Connection getConexao() {\t\n\t\ttry {\n\t\t\t\n\t\t\tif (this.conn!=null) {\n\t\t\t\treturn this.conn;\n\t\t\t}\n\t\t\t\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\tconn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/\"+this.db,this.user,this.pass);\n\t\t\t\n\t\t} catch(Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\treturn this.conn;\n\t}", "public Connection getDBConnection()\r\n {\r\n Connection conn = null;\r\n try\r\n {\r\n // Quitamos los drivers\r\n Enumeration e = DriverManager.getDrivers();\r\n while (e.hasMoreElements())\r\n {\r\n DriverManager.deregisterDriver((Driver) e.nextElement());\r\n }\r\n DriverManager.registerDriver(new com.geopista.sql.GEOPISTADriver());\r\n String sConn = aplicacion.getString(UserPreferenceConstants.LOCALGIS_DATABASE_URL);\r\n conn = DriverManager.getConnection(sConn);\r\n AppContext app = (AppContext) AppContext.getApplicationContext();\r\n conn = app.getConnection();\r\n conn.setAutoCommit(false);\r\n } catch (Exception e)\r\n {\r\n return null;\r\n }\r\n return conn;\r\n }", "public DatabaseConnection getDatabaseConnection() {\n return query.getDatabaseConnection();\n }", "public Connection getConnection() {\n try {\n return ds.getConnection();\n } catch (SQLException e) {\n System.err.println(\"Error while connecting to database: \" + e.toString());\n }\n return null;\n }", "public static Connection getDbConnection() throws SQLException {\n return getDbConnection(FxContext.get().getDivisionId());\n }", "public static Connection getConnection() {\n \t\treturn connPool.getConnection();\n \t}", "public Connection connection()\n {\n String host = main.getConfig().getString(\"db.host\");\n int port = main.getConfig().getInt(\"db.port\");\n String user = main.getConfig().getString(\"db.user\");\n String password = main.getConfig().getString(\"db.password\");\n String db = main.getConfig().getString(\"db.db\");\n\n MysqlDataSource dataSource = new MysqlDataSource();\n dataSource.setServerName(host);\n dataSource.setPort(port);\n dataSource.setUser(user);\n if (password != null ) dataSource.setPassword(password);\n dataSource.setDatabaseName(db);\n Connection connection = null;\n try\n {\n connection = dataSource.getConnection();\n }\n catch (SQLException sqlException)\n {\n sqlException.printStackTrace();\n }\n return connection;\n }", "public static Connection getConnection() {\n\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tconn = getConnectionPool().getConnection();\n\t\t} catch (Exception e) {\n\n\t\t\tthrow new SystemException(\"Getting Connection from DB Connection Pool\",e,SystemCode.UNABLE_TO_EXECUTE);\n\t\t}\n\t\treturn conn;\n\n\t}", "private Connection getConnection() {\n\t\tlog.debug(\"getConnection start\");\n\t\tif (con != null)\n\t\t\treturn con;\n\t\tString url = \"jdbc:mysql://localhost:3306/\" + db;\n\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\").newInstance();\n\t\t\tlog.debug(\"getConnection obtained driver\");\n\t\t\tcon = DriverManager.getConnection(url, user, password);\n\t\t\tlog.debug(\"getConnection got connection\");\n\t\t} catch (Exception ex) {\n\t\t\tlog.error(\"getConnection: error:\" + ex.getMessage(), ex);\n\t\t\treturn null;\n\t\t}\n\t\treturn con;\n\t}", "protected Connection getConnection()\n {\n Connection connection = null;\n try\n {\n connection = DriverManager.getConnection(url, user, password);\n }\n catch (SQLException ex)\n {\n Logger.getLogger(DB_Utils.class.getName()).log(Level.SEVERE, null, ex);\n }\n return connection;\n }", "public Connection getDBConnection() {\n Connection con = connectDB();\n createTables(con);\n return con;\n }", "private Connection getConnection() {\n if ( conn==null ) {\n conn = Util.getConnection( \"root\", \"\" );\n }\n return conn;\n }", "public static Connection getInstanceConnection(){\r\n\t\ttry {\r\n\t\t\tif(conn==null) {\r\n\t\t\t\tconn=DriverManager.getConnection(url, userDb, pwdDb);\r\n\t\t\t\tSystem.out.println(\"Connexion �tablie avec la base\");\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(\"Probl�me de connexion\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn conn;\r\n\t}", "public Connection getConnection() throws SQLException {\n\t\treturn Database.getConnection();\n\t}", "public Connection getConnection(){\n try{\n if(connection == null || connection.isClosed()){\n connection = FabricaDeConexao.getConnection();\n return connection;\n } else return connection;\n } catch (SQLException e){throw new RuntimeException(e);}\n }", "public static Connection getConnection() throws SQLException {\n\t\t// Create a connection reference var\n\t\tConnection con = null;\n\n\t\t// Int. driver obj from our dependency, connect w/ JDBC\n\t\tDriver postgresDriver = new Driver();\n\t\tDriverManager.registerDriver(postgresDriver);\n\n\t\t// Get database location/credentials from environmental variables\n\t\tString url = System.getenv(\"db_url\");\n\t\tString username = System.getenv(\"db_username\");\n\t\tString password = System.getenv(\"db_password\");\n\t\t\n\t\t// Connect to db and assign to con var.\n\t\tcon = DriverManager.getConnection(url, username, password);\n\n\t\t// Return con, allowing calling class/method etc to use the connection\n\t\treturn con;\n\t}", "public static Connection getConn() {\n return conn;\n }", "public static Connection getConnection() {\r\n\t\tsetProperties();\r\n\t\tConnection connection = null;\r\n\t\ttry {\r\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\r\n\t\t\tconnection = (Connection) DriverManager.getConnection(DBURL,\r\n\t\t\t\t\tproperties);\r\n//\t\t\tSystem.err.println(\"Connection Established\");\r\n\t\t} catch (SQLException e) {\r\n\t\t\tlogger.error(\"connection Not Established\");\r\n\t\t\tlogger.error(\"\", e);\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\tlogger.error(\"\", e);\r\n\t\t}\r\n\t\treturn connection;\r\n\t}", "public static Connection getDBConnection(){\n\t\tConnection conn = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\t/*InputStream is = DBConfig.class.getClass().\r\n\t\t\t\t\tgetResourceAsStream(\"/resources/db.properties\");\r\n\t\t\tprop.load(is);\r\n\t\t\tClass.forName(prop.getProperty(\"drivername\"));\r\n\t\t\tconn = DriverManager.getConnection(prop.getProperty(\"jdbcurl\"),\r\n\t\t\t\t\tprop.getProperty(\"username\"),prop.getProperty(\"password\"));*/\r\n\t\t\t\r\n\t\t\tClass.forName(\"oracle.jdbc.driver.OracleDriver\");\r\n\t\t\tconn = DriverManager.getConnection(\"jdbc:oracle:thin:@localhost:1521:orcl\",\"fred\",\"flintstone\");\r\n\t\t\t/*Statement stmt = conn.createStatement();\r\n\t\t\tResultSet rs = stmt.executeQuery(\"SELECT LOCATION_NAME FROM LOCATIONS\");\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\tSystem.out.println(rs.getString(\"LOCATION_NAME\"));\r\n\t\t\t}*/\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} /*catch (FileNotFoundException e){\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}*/\r\n\t\t\r\n\t\treturn conn;\r\n\t}", "public static Connection getCon() {\n Connection con= null;\n try{\n Class.forName(driver);\n con = DriverManager.getConnection(dBUrl);\n } catch (SQLException e) {\n e.printStackTrace();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n return con;\n }", "public static Connection getDBInstance() {\r\n\t\tif (db == null)\r\n\t\t\ttry {\r\n\t\t\t\tloadDBDriver();\r\n\t\t\t\tdb = DriverManager.getConnection(url, user, password);\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\treturn db;\r\n\t}", "public Connection getConnection() {\n try {\n return DriverManager.getConnection(\"jdbc:sqlite:\" + dbName);\n } catch (SQLException e) {\n return null;\n }\n }", "public Connection getConnection() {\n if (con == null) {\n try {\n con = DriverManager.getConnection(url, user, password);\n return con;\n } catch (SQLException e) {\n System.err.println(e.getMessage());\n }\n }\n\n return con;\n }", "public static Connection getConnection() {\r\n\t\tConnection conn = null;\r\n\t\ttry {\r\n\t\t\tClass.forName(DB_DRIVER);\r\n\t\t\tconn = DriverManager.getConnection(DRIVER_URL, DB_USERNAME,\r\n\t\t\t\t\tDB_PASSWORD);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn conn;\r\n\t}", "@Override\n\tpublic DBConnection getDBConnection() {\n\t\t\n\t\tSystem.out.println(\"Started to create DB Connection Object\");\n\t\tDBConnection connection = new DBConnection();\n\t\tconnection.setImplementorName(\"MySQL Implementation\");\n\t\tSystem.out.println(\"Completed to create DB Connection Object\");\n\t\treturn connection;\n\t}", "private Connection getConnection() {\n if (_connection != null) return _connection;\n\n Element ncElement = getNetcdfElement();\n \n //See if we can get the database connection from a JNDI resource.\n String jndi = ncElement.getAttributeValue(\"jndi\");\n if (jndi != null) {\n try {\n Context initCtx = new InitialContext();\n Context envCtx = (Context) initCtx.lookup(\"java:comp/env\");\n DataSource ds = (DataSource) envCtx.lookup(jndi);\n _connection = ds.getConnection();\n } catch (Exception e) {\n String msg = \"Failed to get database connection from JNDI: \" + jndi;\n _logger.error(msg, e);\n throw new TSSException(msg, e);\n }\n return _connection;\n }\n\n //Make the connection ourselves.\n String connectionString = ncElement.getAttributeValue(\"connectionString\");\n String dbUser = ncElement.getAttributeValue(\"dbUser\");\n String dbPassword = ncElement.getAttributeValue(\"dbPassword\");\n String jdbcDriver = ncElement.getAttributeValue(\"jdbcDriver\");\n \n try {\n Class.forName(jdbcDriver);\n _connection = DriverManager.getConnection(connectionString, dbUser, dbPassword);\n } catch (Exception e) {\n String msg = \"Failed to get database connection: \" + connectionString;\n _logger.error(msg, e);\n throw new TSSException(msg, e);\n } \n \n return _connection;\n }", "public Connection getConnection() {\n\t\t\tConnection conn = null;\n\t\t\tProperties prop = new Properties();\n\n\t\t\ttry {\n\t\t\t\tString url = \"jdbc:postgresql://java2010rev.cfqzgdfohgof.us-east-2.rds.amazonaws.com:5432/postgres?currentSchema=jensquared\";\n\t\t\t\tString username = \"jenny77\";\n\t\t\t\tString password = \"zeus1418\";\n//\t\t\t\tClassLoader loader = Thread.currentThread().getContextClassLoader();\n//\t prop.load(loader.getResourceAsStream(\"database.properties\"));\n//\t\t\t\tconn = DriverManager.getConnection(prop.getProperty(\"url\"),\n//\t\t\t\t\t\tprop.getProperty(\"username\"),prop.getProperty(\"password\"));\n\t\t\t\tconn = DriverManager.getConnection(url, username, password);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n//\t\t\t} catch (FileNotFoundException e) {\n//\t\t\t\t// TODO Auto-generated catch block\n//\t\t\t\te.printStackTrace();\n//\t\t\t} catch (IOException e) {\n//\t\t\t\t// TODO Auto-generated catch block\n//\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn conn;\n\t\t}", "public Connection getConnection() {\n\t// register the JDBC driver\n\ttry {\n\t Class.forName(super.driver);\n\t} catch (ClassNotFoundException e) {\n\t e.printStackTrace();\n\t}\n \n\t// create a connection\n\tConnection connection = null;\n\ttry {\n\t connection = DriverManager.getConnection (super.jdbc_url,super.getu(), super.getp());\n\t} catch (SQLException e) {\n\t e.printStackTrace();\n\t}\n\treturn connection;\n }", "public static Connection getConnectionToDB() {\n\t\tProperties properties = getProperties();\n\n\t\ttry {\n\t\t\tmyConnection = DriverManager.getConnection(JDBC_URL, properties);\n\t\t\treturn myConnection;\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "static Connection getDBConnection(){\r\n\t\t if(mainConnection != null)\r\n\t\t\t return mainConnection;\r\n\t\t \r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\t// loading Oracle Driver\r\n\t\t \t\tSystem.out.print(\"Looking for Oracle's jdbc-odbc driver ... \");\r\n\t\t\t \tDriverManager.registerDriver(new oracle.jdbc.OracleDriver());\r\n\t\t\t \tSystem.out.println(\", Loaded.\");\r\n\r\n\t\t\t\t\tString URL = \"jdbc:oracle:thin:@localhost:1521:orcl\";\r\n\t\t\t \tString userName = \"system\";\r\n\t\t\t \tString password = \"password\";\r\n\r\n\t\t\t \tSystem.out.print(\"Connecting to DB...\");\r\n\t\t\t \tmainConnection = DriverManager.getConnection(URL, userName, password);\r\n\t\t\t \tSystem.out.println(\", Connected!\");\r\n\t\t \t\t}\r\n\t\t \t\tcatch (Exception e)\r\n\t\t \t\t{\r\n\t\t \t\tSystem.out.println( \"Error while connecting to DB: \"+ e.toString() );\r\n\t\t \t\te.printStackTrace();\r\n\t\t \t\tSystem.exit(-1);\r\n\t\t \t\t}\r\n\t\t\t\treturn mainConnection;\r\n\t\t \r\n\t}", "public Connection getDatabaseConnection() {\n return con;\n }", "public Connection getConnection(){\n\t\tif(connection == null){\r\n\t\t\tinitConnection();\r\n\t\t}\r\n\t\treturn connection;\r\n\t}", "public static String getConnectionDB(){\n return \"jdbc:mysql://\" + hostname +\":\"+ port+\"/\" + database;\n }", "public static Connection GetConnection() throws SQLException {\n return connectionPool.getConnection();\n }", "public IDatabaseConnection getConnection() {\n try {\n DatabaseConnection databaseConnection = new DatabaseConnection(getDataSource().getConnection());\n editConfig(databaseConnection.getConfig());\n return databaseConnection;\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "public static Connection getConnection() {\r\n\r\n\t\tConfigLoader loader = new ConfigLoader();\r\n\t\tProperties properties = null;\r\n\t\t;\r\n\t\ttry {\r\n\t\t\tproperties = loader.loadConfigurations();\r\n\t\t} catch (IOException e) {\r\n\t\t\tlogger.error(e.getStackTrace().toString());\r\n\t\t}\r\n\t\tConnection connection = null;\r\n\t\ttry {\r\n\t\t\tString url = properties.getProperty(\"hsqldb.url\");\r\n\t\t\tString user = properties.getProperty(\"hsqldb.user\");\r\n\t\t\tString password = properties.getProperty(\"hsqldb.password\");\r\n\t\t\tlogger.info(\"Connecting to hsqlDB with db:\" + url);\r\n\t\t\tconnection = DriverManager.getConnection(url, user, password);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tlogger.error(e.getStackTrace().toString());\r\n\t\t}\r\n\t\treturn connection;\r\n\t}", "public static Connection getConnection() throws Exception {\n\t\treturn jdbcConnectionPool.getConnection();\r\n\r\n\t\t// return getInstance().dataSourse.getConnection();\r\n\t}", "public static Connection getConnection() {\n return singleInstance.createConnection();\n }", "public static Connection getConnection() {\n if (connection == null) {\n try {\n connect();\n } catch (IOException e) {\n if (sc != null) {\n sc.log(\"connect \", e);\n }\n }\n }\n if (connection == null) {\n if (sc != null) {\n sc.log(\"BigtableHelper-No Connection\");\n }\n }\n return connection;\n }", "private Connection getConnection() throws ClassNotFoundException, SQLException {\n\n log.info(\"Get DB connection\");\n\n String url = AppConfig.getInstance().getProperty(\"db.URL\") +\n AppConfig.getInstance().getProperty(\"db.schema\") +\n AppConfig.getInstance().getProperty(\"db.options\");\n String sDBUser = AppConfig.getInstance().getProperty(\"db.user\");\n String sDBPassword = AppConfig.getInstance().getProperty(\"db.password\");\n\n if (sDBUser != null && sDBPassword != null && sDBPassword.startsWith(\"crypt:\")) {\n AltEncrypter cypher = new AltEncrypter(\"cypherkey\" + sDBUser);\n sDBPassword = cypher.decrypt(sDBPassword.substring(6));\n }\n\n return DriverManager.getConnection(url, sDBUser, sDBPassword);\n }", "private Connection dbConnection() {\n\t\t\n\t\t///\n\t\t/// declare local variables\n\t\t///\n\t\t\n\t\tConnection result = null;\t// holds the resulting connection\n\t\t\n\t\t// try to make the connection\n\t\ttry {\n\t\t\tClass.forName(\"org.sqlite.JDBC\");\n\t\t\tresult = DriverManager.getConnection(CONNECTION_STRING);\n\t\t} catch (Exception ex) {\n\t\t\tSystem.out.println(ex.getMessage());\n\t\t}\n\t\t\n\t\t// return the resulting connection\n\t\treturn result;\n\t\t\n\t}", "protected Connection connection() {\n\t\tif (connection == null) {\n\t\t\ttry {\n\t\t\t\tdblogger.info(\"Connecting to \" + connectionUrlString);\n\t\t\t\tconnection = DriverManager.getConnection(connectionUrlString,\n\t\t\t\t\t\tusername, password);\n\t\t\t} catch (SQLException exception) {\n\t\t\t\tdblogger.fatal(\"Failed to connect to database using \"\n\t\t\t\t\t\t+ connectionUrlString + \" User: \" + username\n\t\t\t\t\t\t+ \" Password: \" + password);\n\t\t\t\tthrow new IllegalStateException(\n\t\t\t\t\t\t\"Failed to connect to the database using \"\n\t\t\t\t\t\t\t\t+ connectionUrlString\n\t\t\t\t\t\t\t\t+ \". Please contact your DBA.\");\n\t\t\t}\n\t\t}\n\t\treturn connection;\n\t}", "public static Connection getConnection() {\n\t\treturn null;\r\n\t}", "public Connection getConnection() {\n try {\n return dataSource.getConnection();\n } catch (SQLException e) {\n e.printStackTrace();\n return null;\n }\n }", "public static Connection getConnection() {\n\t\treturn null;\n\t}", "public static Connection getConnection() throws SQLException {\n\t\ttry {\n\t\t\tClass.forName(\"oracle.jdbc.driver.OracleDriver\"); //registering Oracle Driver\n\t\t}\n\t\tcatch(ClassNotFoundException ex) {\n\t\t\tex.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\tString url = System.getenv(\"DB_URL\"); // best not to hard code in your db credentials ! \n\t\tString username = System.getenv(\"DB_USERNAME\");\n\t\tString password = System.getenv(\"DB_PASSWORD\");\n\t\tif(connection == null || connection.isClosed()) {\n\t\t\tconnection = DriverManager.getConnection(url, username, password);\n\t\t\tSystem.out.println(connection.getMetaData().getDriverName());\n\t\t}\n\t\treturn connection;\n\t}", "@Override\n\tpublic Connection getConnection() throws SQLException {\n\t\tConnection conn;\n\t\tconn = ConnectionFactory.getInstance().getConnection();\n\t\treturn conn;\n\t}", "private Connection getConn(){\n \n return new util.ConnectionPar().getConn();\n }", "private static Connection getConnection(){\n Connection conn = THREAD_CONNECTION.get();\n if(conn == null){\n try {\n conn = DATA_SOURCE.getConnection();\n } catch (SQLException e) {\n e.printStackTrace();\n LOGGER.error(\"getConnection error\", e);\n throw new RuntimeException(e);\n } finally {\n THREAD_CONNECTION.set(conn);\n }\n }\n AssertUtil.notNull(conn);\n return conn;\n }", "private Connection getDb() throws TzException {\n if (conn != null) {\n return conn;\n }\n\n try {\n dbPath = cfg.getDbPath();\n\n if (debug()) {\n debug(\"Try to open db at \" + dbPath);\n }\n\n conn = DriverManager.getConnection(\"jdbc:h2:\" + dbPath,\n \"sa\", \"\");\n\n final ResultSet rset =\n conn.getMetaData().getTables(null, null,\n aliasTable, null);\n if (!rset.next()) {\n clearDb();\n loadInitialData();\n }\n } catch (final Throwable t) {\n // Always bad.\n error(t);\n throw new TzException(t);\n }\n\n return conn;\n }", "private Connection getDBConnection(){\n\t\tConnection conn = null;\n\t\t\t\t\n\t\ttry{\n\t\t\t\t// name of the database\n\t\t\tClass.forName(\"org.sqlite.JDBC\");\n\t\t} catch(ClassNotFoundException e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\t\t\t\n\t\ttry{\n\t\t\t// type of the database file\n\t\t\tString url = \"jdbc:sqlite:vehicles.sqlite\";\n\t\t\tconn = DriverManager.getConnection(url);\n\t\t}catch(SQLException e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\treturn conn;\n\t}", "public String getDbconnstr() {\n return dbconnstr;\n }", "public Connection getConnection() {\r\n\tConnection result = null;\r\n\tif (isConnected()) {\r\n\t result = conn;\r\n\t}\r\n\treturn result;\r\n }", "public synchronized Connection getConnection() throws DBException {\n Connection con = null;\n try{\n if (s_ds != null) {\n try {\n con = s_ds.getConnection();\n } catch (Exception e) {\n SystemLog.getInstance().getErrorLog().error(\"ERR,HSQLDBTomCTRL,getCon-JNDI,\" + e\n , e);\n }\n } \n // If null try another method\n \n\t\t\tif ( con == null ){\n\t DriverManager.setLoginTimeout(5);\n\t\t\t\tcon = DriverManager.getConnection(m_dbURL , m_userName , m_password);\n\t\t\t\tSystem.out.println(\"HSQLDB-DBCON:user=\"+m_userName+\":Connection !!\");\n\t\t\t}\n\n return con;\n }catch(SQLException e) {\n System.err.println( \"DBCON:ERROR: user=\"+m_userName+\":Get Connection from pool-HSQLDB\");\n\t\t\tthrow new DBException(\"DBCON:ERROR: user=\"+m_userName+\":Get Connection HSQLDB:\" + e.getMessage()); \n }\n }", "public static Connection getConnection() {\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tconn = getConnectionPool().getConnection();\n\t\t\t// will get a thread-safe connection from the BoneCP connection\n\t\t\t// pool.\n\t\t\t// synchronization of the method will be done inside BoneCP source\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn conn;\n\t}", "public final DBI getConnect() {\n try {\n Class.forName(\"com.mysql.cj.jdbc.Driver\");\n // String dbc = System.getenv(\"DB_CONNECTION\");\n // if (dbc == null || dbc.equals(\"\")) {\n // dbc = \"localhost:3306\";\n // }\n // DBI dbi = new DBI(\"jdbc:mysql://\" + dbc + \"/MLPXX?allowPublicKeyRetrieval=true&useSSL=false\", \"MLPXX\", \"MLPXX\");\n DBI dbi = new DBI(\"jdbc:mysql://localhost:3306/MLPXX?allowPublicKeyRetrieval=true&useSSL=false\", \"MLPXX\", \"MLPXX\");\n\n //DBI dbi = new DBI(\"jdbc:mysql://\" + dbc + \"/MLPXX?useSSL=false\", \"MLPXX\", \"MLPXX\");\n // dbi.setSQLLog(new PrintStreamLog());\n return dbi;\n } catch (ClassNotFoundException e) {\n //return null;\n throw new RuntimeException(e);\n }\n }", "protected Connection getConnection() {\n return con;\n }", "public final Connection getConnection() throws SQLException {\n\t\tString[] threadCredentials = (String[]) this.threadBoundCredentials.get();\n\t\tif (threadCredentials != null) {\n\t\t\treturn doGetConnection(threadCredentials[0], threadCredentials[1]);\n\t\t}\n\t\telse {\n\t\t\treturn doGetConnection(this.username, this.password);\n\t\t}\n\t}", "public Connection getConnection() {\n this.connect();\n return this.connection;\n }", "public static Connection getConnection() {\n Connection localConnection = connection;\n if (localConnection == null) synchronized (DB_ConnectionProvider.class) {\n\n // multi thread supported, double checker lock\n\n localConnection = connection;\n if (localConnection == null) {\n try {\n Class.forName(\"oracle.jdbc.driver.OracleDriver\");\n // oracle driver: oracle.jdbc.driver.OracleDriver\n // mysql driver: com.mysql.jdbc.Driver\n connection = localConnection = DriverManager.getConnection(\n \"jdbc:oracle:thin:@localhost:1521:XE\", USERNAME, PASSWORD);\n // mysql url: jdbc:mysql://localhost:3306/world\n // oracle url: jdbc:oracle:thin:@localhost:1521:XE\n } catch (Exception ex) {\n System.out.println(\"Could not connect with the database.\");\n }\n }\n }\n return localConnection;\n }", "public static MyConnection getConnection() throws SQLException{\n\t\treturn MyConnection.getConnection();\n\t}", "private Connection getConnection() {\n Connection conn = null;\n\n // Force the class loader to load the JDBC driver\n try { \n // The newInstance() call is a work around for some \n // broken Java implementations\n Class.forName(jdbcDriver).newInstance(); \n } catch (Exception ex) { \n System.err.println(\"Failed to load the JDBC driver: \" + jdbcDriver);\n }\n\n // Include the username and password on the URL\n StringBuffer url = new StringBuffer();\n url.append(jdbcUrl);\n if (jdbcUsername != null) {\n url.append(\"?user=\" + jdbcUsername);\n if (jdbcPassword != null) {\n url.append(\"&password=\" + jdbcPassword);\n }\n }\n\n // Establish a connection to the database\n try {\n conn = DriverManager.getConnection(url.toString());\n } catch (SQLException ex) {\n System.err.println(\"Failed to establish a database connection: url=\" + url.toString());\n System.err.println(\"SQLException: \" + ex.getMessage()); \n System.err.println(\"SQLState: \" + ex.getSQLState()); \n System.err.println(\"VendorError: \" + ex.getErrorCode()); \n ex.printStackTrace();\n }\n\n return conn;\n }", "public Connection getConnection() {\n return conn;\n }", "public Connection getConnection() {\n return conn;\n }", "protected Connection getConnection() {\r\n\t\treturn getProcessor().getConnection();\r\n\t}", "public static Connection getConnection() {\n Connection conn = null;\n\n try {\n DataSource dataSource = (DataSource) new InitialContext().lookup(\"jdbc/library\");\n conn = dataSource.getConnection();\n } catch (SQLException | NamingException e) {\n LOG.error(e.getMessage(), e);\n }\n return conn;\n }", "public static Connection getConnection(){\n\t\t/***********************************************************************\n\t\t * Method................................................getConnection *\n\t\t * Author..........................................................JLH *\n\t\t *---------------------------------------------------------------------*\n\t\t * This method obtains a connection to the database *\n\t\t * *\n\t\t * Return Value \t\t\t\t\t\t\t\t\t\t\t\t\t *\n\t\t * (Connection) conn: Returns a connection to the database or null if *\n\t\t * one cannot be obtained. *\n\t\t ***********************************************************************/\n\t\tConnection conn=null;\n\t\t \n\t\ttry {\n\t\t Class.forName(\"com.mysql.jdbc.Driver\"); \n\t\t conn = DriverManager.getConnection(\"jdbc:mysql://70.178.114.2:3306/stagecraft?user=root&password=Security_Pr0bs12!@\");\n\t\t}\n\t\tcatch (SQLException ex) {\n\t\t System.out.println(\"Error: \" + ex);\n\t\t return null;\n\t\t}\n\t\tcatch(NullPointerException ex) {\n\t\t\tSystem.out.println(\"Error: \" + ex);\n\t\t \treturn null;\n\t\t} catch (ClassNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t}\n\t return conn;\t\t\n\t}", "public static Connection getInstance() {\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tconn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/restaurant?useSSL=false\", \"root\", \"1234\");\n\t\t} catch (SQLException e) {\n\t\t\te.getStackTrace();\n\t\t}\n\t\treturn conn;\n\t}", "public Connection getConnection()\n\t{\n\t\treturn connection;\n\t}", "public static Connection getConnection() {\n Connection con = null;\n try {\n Class.forName(\"org.hsqldb.jdbcDriver\");\n con = DriverManager.getConnection(\n \"jdbc:hsqldb:mem:avdosdb\", \"sa\", \"\");\n } catch(Exception e) {\n e.printStackTrace();\n }\n return con;\n }", "public static Connection getConnection() {\n try {\n String dbURL = \"jdbc:mysql://\" + HOST + \":3306/soccer\" ;\n Class.forName(DRIVER);\n Connection connection = DriverManager.getConnection(dbURL, USERNAME, PASSWORD);\n return connection;\n } catch (Exception e) {\n System.out.println(\"Error in Database.getConnection: \" + e.getMessage());\n return null;\n }\n }", "public final Connection getConnection() throws SQLException {\n\t\treturn this.ds != null ? this.ds.getConnection() : DriverManager\n\t\t\t\t.getConnection(this.url);\n\t}", "protected static Connection getConnection() {\r\n\t\t\r\n\t\tSystem.out.print(\"CONSOLE -- ENTROU NA PACKAGE DATA ACCESS OBJECT: getConnection \\n\" ); \r\n\t\t\r\n\t\tConnection connection = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tClass.forName(\"com.mysql.cj.jdbc.Driver\");\r\n\t\t\tconnection = DriverManager.getConnection(jdbcURL, jdbcUsername, jdbcPassword);\r\n\t\t\t\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\t\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn connection;\r\n\t\t\r\n\t}", "public Connection getConnection() throws SQLException {\n\t\tif (connection == null) {\n\t\t\tconnection = ConnectBDD.jdbcConnexion();\n\t\t}\n\t\treturn connection;\n\t}", "public Connection getConnection() {\n java.sql.Connection connection = null;\n try {\n connection = DriverManager.getConnection(\n \"jdbc:postgresql://cslvm74.csc.calpoly.edu:5432/bfung\", \"postgres\",\n \"\");\n } catch (SQLException e) {\n System.out.println(\"Connection Failed! Check output console\");\n e.printStackTrace();\n return null;\n }\n return connection;\n }", "public static Connection getConnection() {\r\n\t\tConnection connection = null;\r\n\t\ttry {\r\n\t\t\tString dbDirectory = \"C:/Users/MAX-Student/Desktop/java/db\";\r\n\t\t\tSystem.setProperty(\"derby.system.home\", dbDirectory);\r\n\r\n\t\t\t// set the db url, username, and password\r\n\t\t\tString url = \"jdbc:derby:InspirationalDB\";\r\n\t\t\tString username = \"\";\r\n\t\t\tString password = \"\";\r\n\r\n\t\t\tconnection = DriverManager.getConnection(url, username, password);\r\n\t\t\treturn connection;\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\tfor (Throwable t : e)\r\n\t\t\t\tt.printStackTrace(); // for debugging\r\n\t\t\treturn null;\r\n\t\t }\r\n\t}", "public static Connection getConnection() {\r\n\t\tString DRIVER_CLASS = \"com.mysql.cj.jdbc.Driver\";\r\n\t\ttry {\r\n\t\t\tClass.forName(DRIVER_CLASS).getDeclaredConstructor().newInstance();\r\n\t\t} catch(Exception e) {\r\n\t\t\tthrow new RuntimeException(e);\r\n\t\t}\r\n\t\tjava.sql.Connection conn = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tconn = DriverManager.getConnection(DatabaseInfo.url, DatabaseInfo.username, DatabaseInfo.password);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new RuntimeException(e);\r\n\t\t}\r\n\t\treturn conn;\r\n\t}", "protected Connection getConnection () {\n \t\treturn connection;\n \t}", "public static Connection getConnection() throws SQLException{\n\t\tif( conn != null ){\n\t\t\treturn conn;\n\t\t}else{\n\t\t\topenConnection();\n\t\t\treturn conn;\n\t\t}\n\t}", "public String getConnection()\n {\n return this.connection;\n }", "public Connection getConnection() throws SQLException {\r\n if (user != null) {\r\n return dataSource.getConnection(user, password);\r\n } else {\r\n return dataSource.getConnection();\r\n }\r\n }", "private static Connection getConnection() throws SQLException {\n return DriverManager.getConnection(\n Config.getProperty(Config.DB_URL),\n Config.getProperty(Config.DB_LOGIN),\n Config.getProperty(Config.DB_PASSWORD)\n );\n }", "private Connection getConnection() throws SQLException, ClassNotFoundException {\n return connectionBuilder.getConnection();\n }", "public DatabaseClient getDb() {\n return db;\n }", "public Connection getConnection() throws SQLException{\n return ds.getConnection();\n }", "private Connection getConnection() throws SQLException{\n return ds.getConnection();\n }", "private synchronized Connection getConnection() throws SQLException {\n return datasource.getConnection();\r\n }", "Connection getConnection() {\n\t\treturn connection;\n\t}", "public Connection getConnection() throws SQLException {\r\n return connection;\r\n }", "public static DbConnection getInstance() {\n if (!DbConnectionHolder.INSTANCE.isInitialized.get()) {\n synchronized (lock) {\n DbConnectionHolder.INSTANCE.initialize();\n }\n }\n return DbConnectionHolder.INSTANCE;\n }", "protected Connection getConnection() {\n String url = \"jdbc:oracle:thin:@localhost:32118:xe\";\n String username = \"JANWILLEM2\";\n String password = \"JANWILLEM2\";\n\n if (myConnection == null) {\n try {\n myConnection = DriverManager.getConnection(url, username, password);\n } catch (Exception exc) {\n exc.printStackTrace();\n }\n }\n\n return myConnection;\n }", "public Connection getConnection() {\n\t\treturn this.connection;\n\t}", "public static Connection GetConnection_s() {\n try {\n return connectionPool.getConnection(); \n } catch (SQLException e) {\n return null;\n }\n }" ]
[ "0.81851965", "0.80784845", "0.80336136", "0.8011784", "0.798684", "0.7976663", "0.7974228", "0.797096", "0.79584277", "0.7934046", "0.793022", "0.7910675", "0.78969115", "0.7868214", "0.7827344", "0.7807825", "0.78040147", "0.7792598", "0.77527666", "0.7744297", "0.77251637", "0.77246547", "0.76934165", "0.76909125", "0.7686061", "0.76853126", "0.7678179", "0.7677872", "0.76739925", "0.7665563", "0.7659263", "0.7648719", "0.76401216", "0.7626009", "0.76168424", "0.7613683", "0.7610534", "0.76054645", "0.75983244", "0.7585514", "0.75706756", "0.7569257", "0.7556999", "0.754554", "0.7534749", "0.75337017", "0.75257325", "0.75204813", "0.7515893", "0.750058", "0.7483127", "0.7482525", "0.74819684", "0.7473138", "0.7458075", "0.745393", "0.74362993", "0.74359494", "0.74262726", "0.74199986", "0.7419812", "0.7417667", "0.74176025", "0.74087334", "0.7394455", "0.73938596", "0.73787177", "0.7378183", "0.7373054", "0.7370748", "0.7370748", "0.73681086", "0.7360711", "0.73597044", "0.7351483", "0.7343654", "0.7339958", "0.7339246", "0.73322725", "0.73149776", "0.72987694", "0.7297225", "0.72951084", "0.7289704", "0.72763324", "0.7267265", "0.72671473", "0.72570235", "0.72558236", "0.72539496", "0.7250619", "0.72369975", "0.72218066", "0.7204095", "0.7200363", "0.72002405", "0.71992946", "0.7176421", "0.7175314", "0.71631616" ]
0.7940498
9
constructs CertificateValidationContext from the resources filepath.
private static final CertificateValidationContext getCertContextFromPath(String pemFilePath) throws IOException { return CertificateValidationContext.newBuilder() .setTrustedCa( DataSource.newBuilder().setFilename(TestUtils.loadCert(pemFilePath).getAbsolutePath())) .build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static final CertificateValidationContext getCertContextFromPathAsInlineBytes(\n String pemFilePath) throws IOException, CertificateException {\n X509Certificate x509Cert = TestUtils.loadX509Cert(pemFilePath);\n return CertificateValidationContext.newBuilder()\n .setTrustedCa(\n DataSource.newBuilder().setInlineBytes(ByteString.copyFrom(x509Cert.getEncoded())))\n .build();\n }", "protected ValidatorResources loadResources(ServletContext ctx)\n throws IOException, ServletException {\n if ((pathnames == null) || (pathnames.length() <= 0)) {\n return null;\n }\n\n StringTokenizer st = new StringTokenizer(pathnames, RESOURCE_DELIM);\n\n List urlList = new ArrayList();\n ValidatorResources resources = null;\n try {\n while (st.hasMoreTokens()) {\n String validatorRules = st.nextToken().trim();\n\n if (LOG.isInfoEnabled()) {\n LOG.info(\"Loading validation rules file from '\"\n + validatorRules + \"'\");\n }\n\n URL input =\n ctx.getResource(validatorRules);\n\n // If the config isn't in the servlet context, try the class\n // loader which allows the config files to be stored in a jar\n if (input == null) {\n input = getClass().getResource(validatorRules);\n }\n\n if (input != null) {\n urlList.add(input);\n } else {\n throw new ServletException(\n \"Skipping validation rules file from '\"\n + validatorRules + \"'. No url could be located.\");\n }\n }\n\n int urlSize = urlList.size();\n String[] urlArray = new String[urlSize];\n\n for (int urlIndex = 0; urlIndex < urlSize; urlIndex++) {\n URL url = (URL) urlList.get(urlIndex);\n\n urlArray[urlIndex] = url.toExternalForm();\n }\n\n resources = new ValidatorResources(urlArray);\n } catch (SAXException sex) {\n LOG.error(\"Skipping all validation\", sex);\n throw new StrutsException(\"Skipping all validation because the validation files cannot be loaded\", sex);\n }\n return resources;\n }", "private void initResources(ServletContext servletContext) {\n if (pathnames != null) {\n ActionContext ctx = ActionContext.getContext();\n try {\n \n ValidatorResources resources = this.loadResources(servletContext);\n \n \n String prefix = ctx.getActionInvocation().getProxy().getNamespace();\n \n \n servletContext.setAttribute(ValidatorPlugIn.VALIDATOR_KEY + prefix, resources);\n \n servletContext.setAttribute(ValidatorPlugIn.STOP_ON_ERROR_KEY + '.'\n + prefix,\n (this.stopOnFirstError ? Boolean.TRUE : Boolean.FALSE));\n } catch (Exception e) {\n throw new StrutsException(\n \"Cannot load a validator resource from '\" + pathnames + \"'\", e);\n }\n }\n }", "private Certificate loadcert(final String filename) throws FileNotFoundException, IOException, CertificateParsingException {\n final byte[] bytes = FileTools.getBytesFromPEM(FileTools.readFiletoBuffer(filename), \"-----BEGIN CERTIFICATE-----\",\n \"-----END CERTIFICATE-----\");\n return CertTools.getCertfromByteArray(bytes, Certificate.class);\n\n }", "public ValidationResult validate(CertPath certPath);", "private static ConfigDocumentContext createConfigurationContext(String resource) \n throws LifecycleException \n {\n try {\n Object contextBean = null;\n URL configUrl = Thread.currentThread().getContextClassLoader().getResource(resource);\n if( configUrl == null ) {\n // we can't find the config so we just an instance of Object for the ConfigDocumentContext.\n if( log.isDebugEnabled() )\n log.debug(\"Cannot find configuration at resource '\"+resource+\"'.\");\n contextBean = new Object();\n } else {\n // we have a config, create a DOM out of it and use it for the ConfigDocumentContext.\n if( log.isDebugEnabled() ) {\n log.debug(\"Loading xchain config file for url: \"+configUrl.toExternalForm());\n }\n \n // get the document builder.\n DocumentBuilder documentBuilder = XmlFactoryLifecycle.newDocumentBuilder();\n \n InputSource configInputSource = UrlSourceUtil.createSaxInputSource(configUrl);\n Document document = documentBuilder.parse(configInputSource);\n contextBean = document;\n }\n // create the context\n ConfigDocumentContext configDocumentContext = new ConfigDocumentContext(null, contextBean, Scope.chain);\n configDocumentContext.setConfigUrl(configUrl);\n configDocumentContext.setLenient(true);\n return configDocumentContext;\n } catch( Exception e ) {\n throw new LifecycleException(\"Error loading configuration from resource '\"+resource+\"'.\", e);\n }\n }", "protected void init() throws Exception {\n if (this.sslConfiguration != null && this.sslConfiguration.enabled()) {\n if (this.sslConfiguration.certificatePath() != null && this.sslConfiguration.privateKeyPath() != null) {\n try (var cert = Files.newInputStream(this.sslConfiguration.certificatePath());\n var privateKey = Files.newInputStream(this.sslConfiguration.privateKeyPath())) {\n // begin building the new ssl context building based on the certificate and private key\n var builder = SslContextBuilder.forServer(cert, privateKey);\n\n // check if a trust certificate was given, if not just trusts all certificates\n if (this.sslConfiguration.trustCertificatePath() != null) {\n try (var stream = Files.newInputStream(this.sslConfiguration.trustCertificatePath())) {\n builder.trustManager(stream);\n }\n } else {\n builder.trustManager(InsecureTrustManagerFactory.INSTANCE);\n }\n\n // build the context\n this.sslContext = builder\n .clientAuth(this.sslConfiguration.clientAuth() ? ClientAuth.REQUIRE : ClientAuth.OPTIONAL)\n .build();\n }\n } else {\n // self-sign a certificate as no certificate was provided\n var selfSignedCertificate = new SelfSignedCertificate();\n this.sslContext = SslContextBuilder\n .forServer(selfSignedCertificate.certificate(), selfSignedCertificate.privateKey())\n .trustManager(InsecureTrustManagerFactory.INSTANCE)\n .build();\n }\n }\n }", "public void init() throws Exception {\n\t\tString trustKeyStore = null;\n\t\tString trustKsPsword = null;\n\t\tString trustKsType = null;\n\t\t\n\t\t// Read ssl keystore properties from file\n\t\tProperties properties = new Properties();\n\t\tInputStream sslCertInput = Resources.getResourceAsStream(\"sslCertification.properties\");\n\t\ttry {\n\t\t\tproperties.load(sslCertInput);\n\t\t\ttrustKeyStore = properties.getProperty(\"trustKeyStore\");\n\t\t\ttrustKsPsword = properties.getProperty(\"trustKeyStorePass\");\n\t\t\ttrustKsType = properties.getProperty(\"trustKeyStoreType\");\n\t\t} catch (Exception e) {\n\t\t\tthrow e;\n\t\t} finally {\n\t\t\tsslCertInput.close();\n\t\t}\n \n // Set trust key store factory\n KeyStore trustKs = KeyStore.getInstance(trustKsType); \n FileInputStream trustKSStream = new FileInputStream(trustKeyStore);\n try {\n \ttrustKs.load(trustKSStream, trustKsPsword.toCharArray()); \n } catch (Exception e) {\n \tthrow e;\n } finally {\n \ttrustKSStream.close();\n }\n TrustManagerFactory trustKf = TrustManagerFactory.getInstance(\"SunX509\");\n trustKf.init(trustKs); \n \n // Init SSLContext\n SSLContext context = SSLContext.getInstance(\"TLSv1.2\"); \n context.init(null, trustKf.getTrustManagers(), null); \n sslFactory = context.getSocketFactory();\n \n\t\treturn;\n\t}", "public SurveyContext(String contextsPath, String activitiesPath) {\n this.surveyContext = new HashMap<>();\n InputStream in = getClass().getResourceAsStream(contextsPath);\n\n try(BufferedReader br = new BufferedReader(new InputStreamReader(in))) {\n int index = 1;\n\n for(String line; (line = br.readLine()) != null; ) {\n this.surveyContext.put(index, new Context(line, activitiesPath));\n index++;\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public ValidationContext buildValidationContext() {\n return validationContextObjectFactory.getObject();\n }", "public ValidationContext getSignatureValidationContext(final CertificateVerifier certificateVerifier) {\n\n\t\tfinal ValidationContext validationContext = new SignatureValidationContext();\n\t\tfinal List<CertificateToken> certificates = getCertificates();\n\t\tfor (final CertificateToken certificate : certificates) {\n\n\t\t\tvalidationContext.addCertificateTokenForVerification(certificate);\n\t\t}\n\t\tprepareTimestamps(validationContext);\n\t\tcertificateVerifier.setSignatureCRLSource(new ListCRLSource(getCRLSource()));\n\t\tcertificateVerifier.setSignatureOCSPSource(new ListOCSPSource(getOCSPSource()));\n\t\t// certificateVerifier.setAdjunctCertSource(getCertificateSource());\n\t\tvalidationContext.initialize(certificateVerifier);\n\t\tvalidationContext.validate();\n\t\treturn validationContext;\n\t}", "public Resource load(String filename) throws MalformedURLException;", "ValueResourceParser2(@NonNull File file) {\n mFile = file;\n }", "public PropFileReader(String filename, String jsonFileName){\n this.ruleJsonFile=jsonFileName;\n this.filename=filename;\n this.propertyBuilder();\n }", "@Test\n public void certificateFileTest() {\n // TODO: test certificateFile\n }", "public static FileSource fromPath(String filename) {\n return fromPath(filename, new SmarterMap());\n }", "private SSLContext initSSLContext() {\n KeyStore ks = KeyStoreUtil.loadSystemKeyStore();\n if (ks == null) {\n _log.error(\"Key Store init error\");\n return null;\n }\n if (_log.shouldLog(Log.INFO)) {\n int count = KeyStoreUtil.countCerts(ks);\n _log.info(\"Loaded \" + count + \" default trusted certificates\");\n }\n\n File dir = new File(_context.getBaseDir(), CERT_DIR);\n int adds = KeyStoreUtil.addCerts(dir, ks);\n int totalAdds = adds;\n if (adds > 0 && _log.shouldLog(Log.INFO))\n _log.info(\"Loaded \" + adds + \" trusted certificates from \" + dir.getAbsolutePath());\n if (!_context.getBaseDir().getAbsolutePath().equals(_context.getConfigDir().getAbsolutePath())) {\n dir = new File(_context.getConfigDir(), CERT_DIR);\n adds = KeyStoreUtil.addCerts(dir, ks);\n totalAdds += adds;\n if (adds > 0 && _log.shouldLog(Log.INFO))\n _log.info(\"Loaded \" + adds + \" trusted certificates from \" + dir.getAbsolutePath());\n }\n dir = new File(System.getProperty(\"user.dir\"));\n if (!_context.getBaseDir().getAbsolutePath().equals(dir.getAbsolutePath())) {\n dir = new File(_context.getConfigDir(), CERT_DIR);\n adds = KeyStoreUtil.addCerts(dir, ks);\n totalAdds += adds;\n if (adds > 0 && _log.shouldLog(Log.INFO))\n _log.info(\"Loaded \" + adds + \" trusted certificates from \" + dir.getAbsolutePath());\n }\n if (_log.shouldLog(Log.INFO))\n _log.info(\"Loaded total of \" + totalAdds + \" new trusted certificates\");\n\n try {\n SSLContext sslc = SSLContext.getInstance(\"TLS\");\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());\n tmf.init(ks);\n X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0];\n _stm = new SavingTrustManager(defaultTrustManager);\n sslc.init(null, new TrustManager[] {_stm}, null);\n /****\n if (_log.shouldLog(Log.DEBUG)) {\n SSLEngine eng = sslc.createSSLEngine();\n SSLParameters params = sslc.getDefaultSSLParameters();\n String[] s = eng.getSupportedProtocols();\n Arrays.sort(s);\n _log.debug(\"Supported protocols: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = eng.getEnabledProtocols();\n Arrays.sort(s);\n _log.debug(\"Enabled protocols: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = params.getProtocols();\n if (s == null)\n s = new String[0];\n _log.debug(\"Default protocols: \" + s.length);\n Arrays.sort(s);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = eng.getSupportedCipherSuites();\n Arrays.sort(s);\n _log.debug(\"Supported ciphers: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = eng.getEnabledCipherSuites();\n Arrays.sort(s);\n _log.debug(\"Enabled ciphers: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = params.getCipherSuites();\n if (s == null)\n s = new String[0];\n _log.debug(\"Default ciphers: \" + s.length);\n Arrays.sort(s);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n }\n ****/\n return sslc;\n } catch (GeneralSecurityException gse) {\n _log.error(\"Key Store update error\", gse);\n } catch (ExceptionInInitializerError eiie) {\n // java 9 b134 see ../crypto/CryptoCheck for example\n // Catching this may be pointless, fetch still fails\n _log.error(\"SSL context error - Java 9 bug?\", eiie);\n }\n return null;\n }", "public CloudServiceVaultCertificate() {\n }", "private void importTrustedCertificate() {\n\t\t// Let the user choose a file containing trusted certificate(s) to\n\t\t// import\n\t\tFile certFile = selectImportExportFile(\n\t\t\t\t\"Certificate file to import from\", // title\n\t\t\t\tnew String[] { \".pem\", \".crt\", \".cer\", \".der\", \"p7\", \".p7c\" }, // file extensions filters\n\t\t\t\t\"Certificate Files (*.pem, *.crt, , *.cer, *.der, *.p7, *.p7c)\", // filter descriptions\n\t\t\t\t\"Import\", // text for the file chooser's approve button\n\t\t\t\t\"trustedCertDir\"); // preference string for saving the last chosen directory\n\t\tif (certFile == null)\n\t\t\treturn;\n\n\t\t// Load the certificate(s) from the file\n\t\tArrayList<X509Certificate> trustCertsList = new ArrayList<>();\n\t\tCertificateFactory cf;\n\t\ttry {\n\t\t\tcf = CertificateFactory.getInstance(\"X.509\");\n\t\t} catch (Exception e) {\n\t\t\t// Nothing we can do! Things are badly misconfigured\n\t\t\tcf = null;\n\t\t}\n\n\t\tif (cf != null) {\n\t\t\ttry (FileInputStream fis = new FileInputStream(certFile)) {\n\t\t\t\tfor (Certificate cert : cf.generateCertificates(fis))\n\t\t\t\t\ttrustCertsList.add((X509Certificate) cert);\n\t\t\t} catch (Exception cex) {\n\t\t\t\t// Do nothing\n\t\t\t}\n\n\t\t\tif (trustCertsList.size() == 0) {\n\t\t\t\t// Could not load certificates as any of the above types\n\t\t\t\ttry (FileInputStream fis = new FileInputStream(certFile);\n\t\t\t\t\t\tPEMReader pr = new PEMReader(\n\t\t\t\t\t\t\t\tnew InputStreamReader(fis), null, cf\n\t\t\t\t\t\t\t\t\t\t.getProvider().getName())) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Try as openssl PEM format - which sligtly differs from\n\t\t\t\t\t * the one supported by JCE\n\t\t\t\t\t */\n\t\t\t\t\tObject cert;\n\t\t\t\t\twhile ((cert = pr.readObject()) != null)\n\t\t\t\t\t\tif (cert instanceof X509Certificate)\n\t\t\t\t\t\t\ttrustCertsList.add((X509Certificate) cert);\n\t\t\t\t} catch (Exception cex) {\n\t\t\t\t\t// do nothing\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (trustCertsList.size() == 0) {\n\t\t\t/* Failed to load certifcate(s) using any of the known encodings */\n\t\t\tshowMessageDialog(this,\n\t\t\t\t\t\"Failed to load certificate(s) using any of the known encodings -\\n\"\n\t\t\t\t\t\t\t+ \"file format not recognised.\", ERROR_TITLE,\n\t\t\t\t\tERROR_MESSAGE);\n\t\t\treturn;\n\t\t}\n\n\t\t// Show the list of certificates contained in the file for the user to\n\t\t// select the ones to import\n\t\tNewTrustCertsDialog importTrustCertsDialog = new NewTrustCertsDialog(this,\n\t\t\t\t\"Credential Manager\", true, trustCertsList, dnParser);\n\n\t\timportTrustCertsDialog.setLocationRelativeTo(this);\n\t\timportTrustCertsDialog.setVisible(true);\n\t\tList<X509Certificate> selectedTrustCerts = importTrustCertsDialog\n\t\t\t\t.getTrustedCertificates(); // user-selected trusted certs to import\n\n\t\t// If user cancelled or did not select any cert to import\n\t\tif (selectedTrustCerts == null || selectedTrustCerts.isEmpty())\n\t\t\treturn;\n\n\t\ttry {\n\t\t\tfor (X509Certificate cert : selectedTrustCerts)\n\t\t\t\t// Import the selected trusted certificates\n\t\t\t\tcredManager.addTrustedCertificate(cert);\n\n\t\t\t// Display success message\n\t\t\tshowMessageDialog(this, \"Trusted certificate(s) import successful\",\n\t\t\t\t\tALERT_TITLE, INFORMATION_MESSAGE);\n\t\t} catch (CMException cme) {\n\t\t\tString exMessage = \"Failed to import trusted certificate(s) to the Truststore\";\n\t\t\tlogger.error(exMessage, cme);\n\t\t\tshowMessageDialog(this, exMessage, ERROR_TITLE, ERROR_MESSAGE);\n\t\t}\n\t}", "private static Certificate getCertficateFromFile(File certFile) throws Exception{\n\t\tCertificate certificate = null;\n\t\tInputStream certInput = null;\n\t\ttry {\n\t\t\tcertInput = new BufferedInputStream(new FileInputStream(certFile));\n\t\t\tCertificateFactory certFactory = CertificateFactory.getInstance(DEFAULT_CERTIFCATE_TYPE);\n\t\t\tcertificate = certFactory.generateCertificate(certInput);\n\t\t} catch (Exception ex) {\n\t\t\tthrow new Exception(\"提取证书文件[\" + certFile.getName() + \"]认证失败,原因[\" + ex.getMessage() + \"]\");\n\t\t} finally {\n\t\t\t//IOUtils.closeQuietly(certInput);\n\t\t}\n\t\treturn certificate;\n\t}", "public static Resource loadFromFile() {\n File file = new File(saveFilePath);\n // create a new file if it doesn't exist\n if (!file.exists()) {\n // save an empty resource object\n Resource resource = new Resource();\n resource.saveToFile();\n }\n\n Resource resource = null;\n try {\n resource = (Resource) loadObjFromFile(saveFilePath);\n } catch (InvalidClassException e) {\n // if resource file is outdated or corrupted reset file\n resource = new Resource();\n resource.saveToFile();\n staticLog(\"resource file was corrupted, cleared with new one\");\n// e.printStackTrace();\n } catch (IOException | ClassNotFoundException e) {\n e.printStackTrace();\n }\n\n resource.activeUsers = new HashMap<>();\n resource.activeProjects = new HashMap<>();\n return resource;\n }", "public void init(boolean forward) throws CertPathValidatorException {\n }", "private ClinicFileLoader() {\n\t}", "private void init(String filename){\n // create product cateogries \n // hard coded key-value for this project \n productCategory.addProduct(\"book\", \"books\");\n productCategory.addProduct(\"books\", \"books\");\n productCategory.addProduct(\"chocolate\", \"food\");\n productCategory.addProduct(\"chocolates\", \"food\");\n productCategory.addProduct(\"pills\", \"medical\");\n \n // read input\n parser.readInput(filename);\n \n // addProducts\n try {\n this.addProducts(parser.getRawData());\n } catch (Exception e) {\n System.out.println(\"Check input integrity\");\n }\n \n this.generateReceipt();\n\n }", "public static SigningPolicy getPolicy(String fileName, \n String requiredCaDN) \n throws SigningPolicyParserException {\n \n if ((fileName == null) || (fileName.trim().equals(\"\"))) {\n throw new IllegalArgumentException();\n }\n \n logger.debug(\"Signing policy file name \" + fileName + \" with CA DN \"\n + requiredCaDN);\n\n FileReader fileReader = null;\n \n try {\n fileReader = new FileReader(fileName);\n } catch (FileNotFoundException exp) {\n if (fileReader != null) {\n try {\n fileReader.close();\n } catch (Exception e) {\n }\n }\n throw new SigningPolicyParserException(exp.getMessage(), exp);\n }\n\n SigningPolicy policy = getPolicy(fileReader, requiredCaDN);\n policy.setFileName(fileName);\n logger.debug(\"Policy file parsing completed, policy is \" + \n (policy == null));\n return policy;\n }", "public Resource load(IFile f);", "public static X509Certificate loadCertificate(InputStream in)\n throws GeneralSecurityException {\n return (X509Certificate) getCertificateFactory().generateCertificate(in);\n }", "public static WSDLValidationInfo validateWSDL(RequestContext requestContext) throws RegistryException {\r\n try {\r\n /*if (resourceContent instanceof byte[]) {\r\n\r\n InputStream in = new ByteArrayInputStream((byte[]) resourceContent);\r\n\r\n File tempFile = File.createTempFile(\"reg\", \".bin\");\r\n tempFile.deleteOnExit();\r\n\r\n BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(tempFile));\r\n byte[] contentChunk = new byte[1024];\r\n int byteCount;\r\n while ((byteCount = in.read(contentChunk)) != -1) {\r\n out.write(contentChunk, 0, byteCount);\r\n }\r\n out.flush();\r\n\r\n String uri = tempFile.toURI().toString();\r\n return validaWSDLFromURI(uri);\r\n\r\n\r\n } else*/ if (requestContext.getSourceURL() != null) {\r\n return validaWSDLFromURI(requestContext.getSourceURL());\r\n }\r\n return null;\r\n } catch (Exception e) {\r\n throw new RegistryException(e.getMessage());\r\n }\r\n }", "public CertificateValidator(KeyStore trustStore, Collection<? extends CRL> crls)\n {\n _trustStore = trustStore;\n _crls = crls;\n }", "public static X509Certificate loadCertificate(String file)\n throws IOException, GeneralSecurityException {\n\n if (file == null) {\n throw new IllegalArgumentException(\"Certificate file is null\");\n //i18n\n // .getMessage(\"certFileNull\"));\n }\n\n X509Certificate cert = null;\n\n BufferedReader reader = new BufferedReader(new FileReader(file));\n try {\n cert = readCertificate(reader);\n } finally {\n reader.close();\n }\n\n if (cert == null) {\n throw new GeneralSecurityException(\"No certificate data\");\n //i18n.getMessage(\"noCertData\"));\n }\n\n return cert;\n }", "@SuppressWarnings(\"static-method\")\n\tprotected Collection<DynamicValidationComponent> createLocalFileValidatorComponents(Link it, URL url, int lineno,\n\t\t\tFile currentFile, DynamicValidationContext context) {\n\t\tFile fn = FileSystem.convertURLToFile(url);\n\t\tif (Strings.isEmpty(fn.getName())) {\n\t\t\t// Special case: the URL should point to a anchor in the current document.\n\t\t\tfinal String linkRef = url.getRef();\n\t\t\tif (!Strings.isEmpty(linkRef)) {\n\t\t\t\treturn Arrays.asList(new DynamicValidationComponent() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic String functionName() {\n\t\t\t\t\t\treturn \"Documentation_reference_anchor_test_\" + lineno + \"_\"; //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void generateValidationCode(ITreeAppendable it) {\n\t\t\t\t\t\tcontext.setTempResourceRoots(null);\n\t\t\t\t\t\tcontext.appendTitleAnchorExistenceTest(it, currentFile,\n\t\t\t\t\t\t\t\turl.getRef(),\n\t\t\t\t\t\t\t\tSECTION_PATTERN_TITLE_EXTRACTOR,\n\t\t\t\t\t\t\t\tIterables.concat(\n\t\t\t\t\t\t\t\t\t\tArrays.asList(MARKDOWN_FILE_EXTENSIONS),\n\t\t\t\t\t\t\t\t\t\tArrays.asList(HTML_FILE_EXTENSIONS)));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t// No need to validate the current file's existence and anchor.\n\t\t\treturn null;\n\t\t}\n\t\tif (!fn.isAbsolute()) {\n\t\t\tfn = FileSystem.join(currentFile.getParentFile(), fn);\n\t\t}\n\t\tfinal File filename = fn;\n\t\tfinal String extension = FileSystem.extension(filename);\n\t\tif (isMarkdownFileExtension(extension) || isHtmlFileExtension(extension)) {\n\t\t\t// Special case: the file may be a HTML or a Markdown file.\n\t\t\tfinal DynamicValidationComponent existence = new DynamicValidationComponent() {\n\t\t\t\t@Override\n\t\t\t\tpublic String functionName() {\n\t\t\t\t\treturn \"Documentation_reference_test_\" + lineno + \"_\"; //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void generateValidationCode(ITreeAppendable it) {\n\t\t\t\t\tcontext.setTempResourceRoots(context.getSourceRoots());\n\t\t\t\t\tcontext.appendFileExistenceTest(it, filename, Messages.MarkdownParser_1,\n\t\t\t\t\t\t\tIterables.concat(\n\t\t\t\t\t\t\t\t\tArrays.asList(MARKDOWN_FILE_EXTENSIONS),\n\t\t\t\t\t\t\t\t\tArrays.asList(HTML_FILE_EXTENSIONS)));\n\t\t\t\t}\n\t\t\t};\n\t\t\tif (!Strings.isEmpty(url.getRef())) {\n\t\t\t\tfinal DynamicValidationComponent refValidity = new DynamicValidationComponent() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic String functionName() {\n\t\t\t\t\t\treturn \"Documentation_reference_anchor_test_\" + lineno + \"_\"; //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void generateValidationCode(ITreeAppendable it) {\n\t\t\t\t\t\tcontext.setTempResourceRoots(null);\n\t\t\t\t\t\tcontext.appendTitleAnchorExistenceTest(it, filename,\n\t\t\t\t\t\t\t\turl.getRef(),\n\t\t\t\t\t\t\t\tSECTION_PATTERN_TITLE_EXTRACTOR,\n\t\t\t\t\t\t\t\tIterables.concat(\n\t\t\t\t\t\t\t\t\t\tArrays.asList(MARKDOWN_FILE_EXTENSIONS),\n\t\t\t\t\t\t\t\t\t\tArrays.asList(HTML_FILE_EXTENSIONS)));\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\treturn Arrays.asList(existence, refValidity);\n\t\t\t}\n\t\t\treturn Collections.singleton(existence);\n\t\t}\n\t\treturn Arrays.asList(new DynamicValidationComponent() {\n\t\t\t@Override\n\t\t\tpublic String functionName() {\n\t\t\t\treturn \"File_reference_test_\" + lineno + \"_\"; //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void generateValidationCode(ITreeAppendable it) {\n\t\t\t\tcontext.appendFileExistenceTest(it, filename, Messages.MarkdownParser_1);\n\t\t\t}\n\t\t});\n\t}", "protected SSLContext() {}", "private AuditYamlConfigurationLoader(Properties properties)\n {\n this.properties = new Properties(properties);\n }", "@Required\n\tpublic void setResource(final String filename) {\n\t\ttry {\n\t\t\tthis.validDocStr = ResourceUtil.getTextResource(\n\t\t\t\t\tthis.applicationContext, filename);\n\t\t} catch (final IOException e) {\n\t\t\tthrow new RuntimeException(\"Loading of text resource failed: \" + e);\n\t\t}\n\t}", "private SSLContext createSSLContext() throws KeyStoreException,\n NoSuchAlgorithmException, KeyManagementException, IOException, CertificateException {\n TrustManager localTrustManager = new X509TrustManager() {\n @Override\n public X509Certificate[] getAcceptedIssuers() {\n System.out.println(\"X509TrustManager#getAcceptedIssuers\");\n return new X509Certificate[]{};\n }\n\n @Override\n public void checkServerTrusted(X509Certificate[] chain,\n String authType) throws CertificateException {\n System.out.println(\"X509TrustManager#checkServerTrusted\");\n }\n\n @Override\n public void checkClientTrusted(X509Certificate[] chain,\n String authType) throws CertificateException {\n System.out.println(\"X509TrustManager#checkClientTrusted\");\n }\n };\n\n\n SSLContext sslContext = SSLContext.getInstance(\"TLS\");\n sslContext.init(null, new TrustManager[]{localTrustManager}, new SecureRandom());\n\n return sslContext;\n }", "Context createContext( Properties properties ) throws NamingException;", "@SuppressWarnings(\"rawtypes\")\n private com.squareup.okhttp.Call recCertCheckValidateBeforeCall(File certificateFile, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {\n if (certificateFile == null) {\n throw new ApiException(\"Missing the required parameter 'certificateFile' when calling recCertCheck(Async)\");\n }\n \n\n com.squareup.okhttp.Call call = recCertCheckCall(certificateFile, progressListener, progressRequestListener);\n return call;\n\n }", "public Configuration(File configFile) {\r\n \t\tproperties = loadProperties(configFile);\r\n \t}", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "public ConfigFile(String fileName, String encoding) {\n InputStream inputStream = null;\n try {\n inputStream = getClassLoader().getResourceAsStream(fileName); // properties.load(ConfigFile.class.getResourceAsStream(fileName));\n if (inputStream == null) {\n throw new IllegalArgumentException(\"Properties file not found in classpath: \" + fileName);\n }\n\n properties = new Properties();\n if (fileName.endsWith(\"yml\")){\n isYml = true;\n properties= new Yaml().loadAs(new InputStreamReader(inputStream, encoding),Properties.class);\n }else\n properties.load(new InputStreamReader(inputStream, encoding));\n } catch (IOException e) {\n throw new RuntimeException(\"Error loading properties file.\", e);\n } finally {\n if (inputStream != null) try {\n inputStream.close();\n } catch (IOException e) {\n LogKit.error(e.getMessage(), e);\n }\n }\n }", "public ValidationResult validate(X509Certificate[] certChain);", "private FileInputStream loadFile(String file)\n\t{\n\t\tlogger.info(\"Fetching File : \"+System.getProperty(\"user.dir\")+\"\\\\src\\\\main\\\\resources\\\\\"+file);\n\t\ttry \n\t\t{\n\t\t\treturn(new FileInputStream(System.getProperty(\"user.dir\")+\"\\\\src\\\\main\\\\resources\\\\\"+file));\n\t\t} catch (FileNotFoundException e) {\t\t\t\t\n\t\t\tAssert.assertTrue(file+\" file is missing\", false);\n\t\t\treturn null;\n\t\t}\n\t}", "public MessageSourceHolder(String... classPathResourcePaths) {\n Properties globalProperties = new Properties();\n try {\n globalProperties.load(MessageSourceHolder.class.getResourceAsStream(\"/resources/global.properties\"));\n } catch (IOException e1) {\n throw new CommonPropertiesTechnicalRuntimeException();\n }\n String locale = globalProperties.getProperty(ConfigurationKeys.LOCALE);\n \n for (String path : classPathResourcePaths) {\n Properties resMessages = new Properties();\n String fullPath = path + \"_\" + locale.toLowerCase() + \".properties\";\n LOG.debug(\"Load Property file {}\", fullPath);\n try (InputStream is = MessageSourceHolder.class.getResourceAsStream(fullPath)) {\n resMessages.load(is);\n } catch (IOException e) {\n throw new CommonPropertiesTechnicalRuntimeException();\n }\n messages.putAll(resMessages);\n }\n }", "ResourceFilesHandler() throws MissingResourceException {\n\t\tLocale locale = Locale.getDefault();\n\t\tif (!SUPPORTED_LOCALES.contains(locale)) {\n\t\t\tlocale = DEFAULT_LOCALE;\n\t\t}\n\n\t\t// generate the path to the *.properties files\n\t\tfinal String path = getClass().getPackage().getName().replaceAll(\"\\\\.\", ESCAPED_FILE_SEPERATOR);\n\n\t\t// create the ResourceBundle\n\t\tbundleConstants = ResourceBundle.getBundle(path + ESCAPED_FILE_SEPERATOR + DOMINION_CARD);\n\t\tbundleI18N = ResourceBundle.getBundle(path + ESCAPED_FILE_SEPERATOR + DOMINION_LANGUAGE, locale);\n\t}", "public MyPathResource() {\r\n }", "public ValidatorFactory(String bundleName) {\n this.messageResolver = new ResourceMessageResolver(bundleName);\n }", "public StudentXMLRepository(Validator<Student> studentValidator,String XMLfile){\n super(studentValidator);\n this.XMLfile=XMLfile;\n try {\n loadData();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public FileConfiguration loadConfiguration(File file);", "public SurveyEngine(String filePath) throws SurveyEngineException {\r\n this.filePath = filePath;\r\n try {\r\n DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\r\n DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();\r\n this.doc = dBuilder.parse(new File(filePath));\r\n } catch (ParserConfigurationException | SAXException | IOException e) {\r\n throw new SurveyEngineException(\"Can't open file \" + filePath, e);\r\n }\r\n \r\n try {\r\n SchemaValidator validator = new SchemaValidator(\"src/xml/survey.xsd\");\r\n validator.validate(this.filePath);\r\n } catch (SAXException | ParserConfigurationException | IOException e) {\r\n throw new SurveyEngineException(\"Validation failed!\", e);\r\n }\r\n }", "private static SSLContext createSSLContext() {\n\t try {\n\t SSLContext context = SSLContext.getInstance(\"SSL\");\n\t if (devMode) {\n\t \t context.init( null, new TrustManager[] {new RESTX509TrustManager(null)}, null); \n\t } else {\n\t TrustManager[] trustManagers = tmf.getTrustManagers();\n\t if ( kmf!=null) {\n\t KeyManager[] keyManagers = kmf.getKeyManagers();\n\t \n\t // key manager and trust manager\n\t context.init(keyManagers,trustManagers,null);\n\t }\n\t else\n\t \t// no key managers\n\t \tcontext.init(null,trustManagers,null);\n\t }\n\t return context;\n\t } \n\t catch (Exception e) {\n\t \t logger.error(e.toString());\n\t throw new HttpClientError(e.toString());\n\t \t }\n }", "protected static X509Certificate getCertificate()\n throws CertificateException, KeyStoreException, IOException {\n String certificatePath = getCertificatePath();\n String keyStorePath = getKeyStorePath();\n if (certificatePath != null) {\n File certificateFile = new File(certificatePath);\n if (certificateFile.isFile()) {\n // load certificate from file\n return loadCertificateFromFile(certificateFile);\n } else {\n throw new IllegalArgumentException(\n \"The specified certificate path '\" + certificatePath + \"' is invalid\");\n }\n } else if (keyStorePath != null) {\n return new KeyStoreManager()\n .getKeyStoreCertificate(keyStorePath, getKeyStorePassword(), getKeyStoreAlias());\n } else {\n // should not happen\n throw new IllegalArgumentException(\"Could not load a certificate for authentication\");\n }\n }", "private void createSSLContext() throws Exception {\n\n char[] passphrase = \"passphrase\".toCharArray();\n\n KeyStore ks = KeyStore.getInstance(\"JKS\");\n ks.load(new FileInputStream(\"testkeys\"), passphrase);\n\n KeyManagerFactory kmf = KeyManagerFactory.getInstance(\"SunX509\");\n kmf.init(ks, passphrase);\n\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(\"SunX509\");\n tmf.init(ks);\n\n sslContext = SSLContext.getInstance(\"TLS\");\n sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);\n }", "protected XmlLoader(@NotNull File xmlFile, @Nullable DataContext context, Key<?>... keys) throws XmlParseException {\n\t\tcheckParams(context, keys);\n\t\tthis.dataContext = context;\n\t\tthis.document = getDocumentFromFile(xmlFile);\n\t}", "public void load(String filePath) throws GTFException {\n\n\t\tString exceptionPrefix = \"The argument file '\" + filePath + \"' \";\n\n\t\ttry {\n\t\t\tprops.load(new FileInputStream(filePath));\n\n\t\t\t//\n\t\t\t// Validate the arguments (to fail early if something is wrong)\n\t\t\t//\n\n\t\t\t// Configuration directory\n\t\t\tString configurationDirectory = getConfigurationDirectory();\n\t\t\tvalidateDirectoryEntry(configurationDirectory, ARGUMENT_CONFIGURATION_DIRECTORY, exceptionPrefix);\n\n\t\t\t// Testsuite directory\n\t\t\tString testsuiteDirectory = getTestsuiteDirectory();\n\t\t\tvalidateDirectoryEntry(testsuiteDirectory, ARGUMENT_TESTSUITE_DIRECTORY, exceptionPrefix);\n\n\t\t\t// Backup directory\n\t\t\tString backupDirectory = getBackupDirectory();\n\t\t\tif (StringUtils.isNotEmpty(backupDirectory)) {\n\t\t\t\tvalidateDirectoryEntry(backupDirectory, ARGUMENT_BACKUP_DIRECTORY, exceptionPrefix);\n\t\t\t}\n\n\t\t\t// Mapping directory\n\t\t\tString mappingDirectory = getMappingDirectory();\n\t\t\tif (StringUtils.isNotEmpty(mappingDirectory)) {\n\t\t\t\tvalidateDirectoryEntry(mappingDirectory, ARGUMENT_MAPPING_DIRECTORY, exceptionPrefix);\n\t\t\t}\n\n\t\t\t// Input Type\n\t\t\tString inputType = StringUtils.upperCase(props.getProperty(ARGUMENT_INPUT_TYPE));\n\t\t\tif (inputType != null) {\n\t\t\t\tif (!StringUtils.equals(inputType, INPUT_TYPE_XLS)) {\n\t\t\t\t\tthrow new GTFException(exceptionPrefix + \"contains an entry for '\" + ARGUMENT_INPUT_TYPE\n\t\t\t\t\t\t\t+ \"' that is not supported. Supported values are: \" + SUPPORTED_INPUT_TYPES);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// XLS-Directory\n\t\t\tif (StringUtils.equals(getInputType(), INPUT_TYPE_XLS)) {\n\t\t\t\tString xlsDirectory = getXLSDirectory();\n\t\t\t\tvalidateDirectoryEntry(xlsDirectory, ARGUMENT_XLS_DIRECTORY, exceptionPrefix);\n\t\t\t}\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\tthrow new GTFException(exceptionPrefix + \"could not be found.\", e.getCause());\n\t\t} catch (IOException e) {\n\t\t\tthrow new GTFException(exceptionPrefix + \"could not be loaded.\", e.getCause());\n\t\t}\n\t}", "public CryptFile(File file, CryptFile parentFile) {\n this.file = file;\n this.parentFile = parentFile;\n users = new Properties();\n }", "public RuleParser() {\n this.fileName = \"\";\n }", "private static KeyStore buildKeyStore(Context context, int certRawResId) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException {\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n\n // read and add certificate authority\n Certificate cert = readCert(context, certRawResId);\n keyStore.setCertificateEntry(\"ca\", cert);\n\n return keyStore;\n }", "public static WSDLValidationInfo validateWSI(RequestContext requestContext) throws RegistryException {\r\n try {\r\n /*if (resourceContent instanceof byte[]) {\r\n\r\n InputStream in = new ByteArrayInputStream((byte[]) resourceContent);\r\n\r\n File tempFile = File.createTempFile(\"reg\", \".bin\");\r\n tempFile.deleteOnExit();\r\n\r\n BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(tempFile));\r\n byte[] contentChunk = new byte[1024];\r\n int byteCount;\r\n while ((byteCount = in.read(contentChunk)) != -1) {\r\n out.write(contentChunk, 0, byteCount);\r\n }\r\n out.flush();\r\n\r\n String uri = tempFile.toURI().toString();\r\n return validateWSI(uri);\r\n\r\n\r\n } else*/ if (requestContext.getSourceURL() != null) {\r\n return validateWSI(requestContext.getSourceURL());\r\n }\r\n return null;\r\n } catch (Exception e) {\r\n throw new RegistryException(e.getMessage(), e);\r\n }\r\n }", "private void initContext() {\n contextId = System.getProperty(CONFIG_KEY_CERES_CONTEXT, DEFAULT_CERES_CONTEXT);\n\n // Initialize application specific configuration keys\n homeDirKey = String.format(\"%s.%s\", contextId, CONFIG_KEY_HOME);\n debugKey = String.format(\"%s.%s\", contextId, CONFIG_KEY_DEBUG);\n configFileKey = String.format(\"%s.%s\", contextId, CONFIG_KEY_CONFIG_FILE_NAME);\n modulesDirKey = String.format(\"%s.%s\", contextId, CONFIG_KEY_MODULES);\n libDirsKey = String.format(\"%s.%s\", contextId, CONFIG_KEY_LIB_DIRS);\n mainClassKey = String.format(\"%s.%s\", contextId, CONFIG_KEY_MAIN_CLASS);\n classpathKey = String.format(\"%s.%s\", contextId, CONFIG_KEY_CLASSPATH);\n applicationIdKey = String.format(\"%s.%s\", contextId, CONFIG_KEY_APP);\n logLevelKey = String.format(\"%s.%s\", contextId, CONFIG_KEY_LOG_LEVEL);\n consoleLogKey = String.format(\"%s.%s\", contextId, CONFIG_KEY_CONSOLE_LOG);\n\n // Initialize default file and directory paths\n char sep = File.separatorChar;\n defaultRelConfigFilePath = String.format(\"%s/%s\", DEFAULT_CONFIG_DIR_NAME, configFileKey).replace('/', sep);\n defaultHomeConfigFilePath = String.format(\"${%s}/%s\", homeDirKey, defaultRelConfigFilePath).replace('/', sep);\n defaultHomeModulesDirPath = String.format(\"${%s}/%s\", homeDirKey, DEFAULT_MODULES_DIR_NAME).replace('/', sep);\n defaultHomeLibDirPath = String.format(\"${%s}/%s\", homeDirKey, DEFAULT_LIB_DIR_NAME).replace('/', sep);\n }", "public ConfigFileReader(){\r\n\t\t \r\n\t\t BufferedReader reader;\r\n\t\t try {\r\n\t\t\t reader = new BufferedReader(new FileReader(propertyFilePath));\r\n\t\t\t properties = new Properties();\r\n\t\t\t try {\r\n\t\t\t\t properties.load(reader);\r\n\t\t\t\t reader.close();\r\n\t\t\t } catch (IOException e) {\r\n\t\t\t\t e.printStackTrace();\r\n\t\t\t }\r\n\t\t } catch (FileNotFoundException e) {\r\n\t\t\t e.printStackTrace();\r\n\t\t\t throw new RuntimeException(\"configuration.properties not found at \" + propertyFilePath);\r\n\t \t } \r\n\t }", "public Messages(File i18nFile) {\n\t\tthis.i18nFile = i18nFile;\n\t}", "public void initialize() throws ResourceInitializationException {\n StringBuffer sb=new StringBuffer();\n String input = (String) getConfigParameterValue(\"INPUT_FILE\");\n System.out.println(\"INPUT_FILE:\" + input);\n System.out.println(\"Initializing Collection Reader....\");\n ///////////////\n try {\n in = new BufferedReader(new FileReader(input));\n String strs=null;\n while((strs=in.readLine())!=null){\n sb.append(strs+\"\\n\");\n }\n } catch (UnsupportedEncodingException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n /////////////////////\n \n cas=sb.toString();\n }", "public FailureContext() {\n }", "private SSLContext createSSLContext(final SSLContextService service)\n throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, KeyManagementException, UnrecoverableKeyException {\n\n final SSLContextBuilder sslContextBuilder = new SSLContextBuilder();\n\n if (StringUtils.isNotBlank(service.getTrustStoreFile())) {\n final KeyStore truststore = KeyStore.getInstance(service.getTrustStoreType());\n try (final InputStream in = new FileInputStream(new File(service.getTrustStoreFile()))) {\n truststore.load(in, service.getTrustStorePassword().toCharArray());\n }\n sslContextBuilder.loadTrustMaterial(truststore, new TrustSelfSignedStrategy());\n }\n\n if (StringUtils.isNotBlank(service.getKeyStoreFile())) {\n final KeyStore keystore = KeyStore.getInstance(service.getKeyStoreType());\n try (final InputStream in = new FileInputStream(new File(service.getKeyStoreFile()))) {\n keystore.load(in, service.getKeyStorePassword().toCharArray());\n }\n sslContextBuilder.loadKeyMaterial(keystore, service.getKeyStorePassword().toCharArray());\n }\n\n sslContextBuilder.useProtocol(service.getSslAlgorithm());\n\n return sslContextBuilder.build();\n }", "public Resources() {\n }", "public JsonSchemaValidator(File f) {\n this.jsonFile = f;\n if (! f.isFile()) {\n throw new PhenopacketValidatorRuntimeException(\"Could not open file at \\\"\" + f.getAbsolutePath() + \"\\\"\");\n }\n JsonSchemaFactory schemaFactory = JsonSchemaFactory.getInstance(VERSION_FLAG);\n try {\n InputStream baseSchemaStream = inputStreamFromClasspath(\"schema/phenopacket-general-schema.json\");\n this.jsonSchema = schemaFactory.getSchema(baseSchemaStream);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private Templates load(URL fileSource) throws Exception {\n return m_factory.newTemplates(new StreamSource(fileSource.openStream()));\n }", "public ResponseCtx evaluate(final String requestFile) throws ParsingException, WebserverSystemException,\r\n FileNotFoundException {\r\n\r\n if (this.pdp == null) {\r\n init();\r\n }\r\n\r\n // setup the request based on the file\r\n final RequestCtx request = RequestCtx.getInstance(new FileInputStream(requestFile));\r\n\r\n // evaluate the request\r\n return pdp.evaluate(request);\r\n }", "public CompletionStage<Result> validate()\n {\n IRequestValidator requestValidator=new CertValidateRequestValidator();\n return handleRequest(request(),requestValidator, JsonKeys.CERT_VALIDATE);\n }", "public static FileSource fromPath(String filename, SmarterMap options) {\n if (StringUtils.isBlank(filename))\n throw new FwissrRuntimeException(\"Unexpected file source path: \" + filename);\n return new FileSource(filename, options);\n }", "public static X509Certificate readCertificate(BufferedReader reader)\n throws IOException, GeneralSecurityException {\n String line;\n StringBuffer buff = new StringBuffer();\n boolean isCert = false;\n boolean isKey = false;\n boolean notNull = false;\n while ((line = reader.readLine()) != null) {\n // Skip key info, if any\n if (line.indexOf(\"BEGIN RSA PRIVATE KEY\") != -1 ||\n line.indexOf(\"BEGIN PRIVATE KEY\") != -1) {\n isKey = true;\n continue;\n } else if (isKey && (line.indexOf(\"END RSA PRIVATE KEY\") != -1 ||\n line.indexOf(\"END PRIVATE KEY\") != -1)) {\n isKey = false;\n continue;\n } else if (isKey)\n continue;\n\n notNull = true;\n if (line.indexOf(\"BEGIN CERTIFICATE\") != -1) {\n isCert = true;\n } else if (isCert && line.indexOf(\"END CERTIFICATE\") != -1) {\n byte[] data = Base64.decode(buff.toString().getBytes());\n return loadCertificate(new ByteArrayInputStream(data));\n } else if (isCert) {\n buff.append(line);\n }\n }\n if (notNull && !isCert) {\n throw new GeneralSecurityException(\n \"Certificate needs to start with \"\n + \" BEGIN CERTIFICATE\");\n }\n return null;\n }", "public static synchronized boolean load(ServletContext servletContext) {\n\t\tString temp;\n\t\ttry {\n\t\t\t//Get the trial.xml config file\n\t\t\txml = XmlUtil.getDocument(servletContext.getRealPath(configFilename));\n\n\t\t\t//Get the basepath to the root directory\n\t\t\tbasepath = servletContext.getRealPath(File.separator).trim();\n\t\t\tif (!basepath.endsWith(File.separator)) basepath += File.separator;\n\n\t\t\t//Get the root directory name\n\t\t\ttemp = basepath.substring(0,basepath.length()-1);\n\t\t\tserviceName = temp.substring(temp.lastIndexOf(File.separator)+1);\n\n\t\t\t//Get the top-level attributes\n\t\t\tautostart = XmlUtil.getValueViaPath(xml,\"clinical-trial@autostart\");\n\t\t\tlog = XmlUtil.getValueViaPath(xml,\"clinical-trial@log\");\n\t\t\toverwrite = XmlUtil.getValueViaPath(xml,\"clinical-trial@overwrite\");\n\n\t\t\t//Get the preprocessor parameters.\n\t\t\tpreprocessorEnabled = XmlUtil.getValueViaPath(xml,\"clinical-trial/http-import/preprocessor@enabled\");\n\t\t\tpreprocessorClassName = XmlUtil.getValueViaPath(xml,\"clinical-trial/http-import/preprocessor/preprocessor-class-name\");\n\t\t\t//Get the http import anonymizer enabled parameter\n\t\t\thttpImportAnonymize = XmlUtil.getValueViaPath(xml,\"clinical-trial/http-import/anonymize\");\n\t\t\t//Get the http import IP addresses\n\t\t\tNodeList list = xml.getElementsByTagName(\"http-import\");\n\t\t\tif (list.getLength() == 0) {\n\t\t\t\thttpImportIPAddresses = new String[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tElement httpImportNode = (Element)list.item(0);\n\t\t\t\tlist = httpImportNode.getElementsByTagName(\"site\");\n\t\t\t\thttpImportIPAddresses = new String[list.getLength()];\n\t\t\t\tfor (int i=0; i<list.getLength(); i++) {\n\t\t\t\t\thttpImportIPAddresses[i] = XmlUtil.getElementValue(list.item(i));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Get the http export directories and URLs\n\t\t\tElement httpExportNode = XmlUtil.getElementViaPath(xml,\"clinical-trial/http-export\");\n\t\t\tif (httpExportNode != null) {\n\t\t\t\tNodeList siteNodes = httpExportNode.getElementsByTagName(\"site\");\n\t\t\t\thttpExportDirectories = new String[siteNodes.getLength()];\n\t\t\t\thttpExportDirectoryFiles = new File[siteNodes.getLength()];\n\t\t\t\thttpExportURLs = new String[siteNodes.getLength()];\n\t\t\t\tfor (int i=0; i<httpExportDirectories.length; i++) {\n\t\t\t\t\thttpExportDirectories[i] = httpExportDir + File.separator +\n\t\t\t\t\t\t\t\t\t((Element)siteNodes.item(i)).getAttribute(\"directory\");\n\t\t\t\t\thttpExportDirectoryFiles[i] = new File(basepath + httpExportDirectories[i]);\n\t\t\t\t\thttpExportURLs[i] = XmlUtil.getElementValue(siteNodes.item(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\thttpExportDirectories = new String[0];\n\t\t\t\thttpExportURLs = new String[0];\n\t\t\t}\n\n\t\t\t//Get the dicom export mode, directories, IP addresses and AE Titles\n\t\t\tElement dicomExportNode = XmlUtil.getElementViaPath(xml,\"clinical-trial/dicom-export\");\n\t\t\tif (dicomExportNode != null) {\n\t\t\t\tElement storeNode;\n\t\t\t\tdicomExportMode = dicomExportNode.getAttribute(\"mode\");\n\t\t\t\tNodeList storeNodes = dicomExportNode.getElementsByTagName(\"destination-dicom-store\");\n\t\t\t\tdicomExportDirectories = new String[storeNodes.getLength()];\n\t\t\t\tdicomExportDirectoryFiles = new File[storeNodes.getLength()];\n\t\t\t\tdicomExportAETitles = new String[storeNodes.getLength()];\n\t\t\t\tdicomExportIPAddresses = new String[storeNodes.getLength()];\n\t\t\t\tfor (int i=0; i<storeNodes.getLength(); i++) {\n\t\t\t\t\tstoreNode = (Element)storeNodes.item(i);\n\t\t\t\t\tdicomExportDirectories[i] = dicomExportDir + File.separator + storeNode.getAttribute(\"directory\");\n\t\t\t\t\tdicomExportDirectoryFiles[i] = new File(basepath + dicomExportDirectories[i]);\n\t\t\t\t\tdicomExportAETitles[i] = XmlUtil.getValueViaPath(storeNode,\"destination-dicom-store/ae-title\");\n\t\t\t\t\tdicomExportIPAddresses[i] = XmlUtil.getValueViaPath(storeNode,\"destination-dicom-store/ip-address\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdicomExportDirectoryFiles = new File[0];\n\t\t\t\tdicomExportAETitles = new String[0];\n\t\t\t\tdicomExportIPAddresses = new String[0];\n\t\t\t}\n\n\t\t\t//Get the dicom store parameters.\n\t\t\tdicomImportAnonymize = XmlUtil.getValueViaPath(xml,\"clinical-trial/dicom-store/anonymize\");\n\t\t\t//Detect a change in the ae-title or port and notify the author service.\n\t\t\tboolean change = false;\n\t\t\ttemp = XmlUtil.getValueViaPath(xml,\"clinical-trial/dicom-store/ae-title\").trim();\n\t\t\tif ((dicomStoreAETitle != null) && !temp.equals(dicomStoreAETitle)) change = true;\n\t\t\tdicomStoreAETitle = temp;\n\t\t\ttemp = XmlUtil.getValueViaPath(xml,\"clinical-trial/dicom-store/port\").trim();\n\t\t\tif ((dicomStorePort != null) && !temp.equals(dicomStorePort)) change = true;\n\t\t\tdicomStorePort = temp;\n\t\t\tif (change) AdminService.scpParamsChanged();\n\n\t\t\t//Get the database export parameters.\n\t\t\tdatabaseExportMode = XmlUtil.getValueViaPath(xml,\"clinical-trial/database-export@mode\");\n\t\t\tdatabaseExportAnonymize = XmlUtil.getValueViaPath(xml,\"clinical-trial/database-export/anonymize\");\n\t\t\tdatabaseExportInterval = XmlUtil.getValueViaPath(xml,\"clinical-trial/database-export/interval\");\n\t\t\tdatabaseClassName = XmlUtil.getValueViaPath(xml,\"clinical-trial/database-export/database-class-name\");\n\n\t\t\t//Get the remapper parameters\n\t\t\tkeyfile = XmlUtil.getValueViaPath(xml,\"clinical-trial/remapper@key-file\");\n\t\t\tbasedate = XmlUtil.getValueViaPath(xml,\"clinical-trial/remapper/base-date\");\n\t\t\tuidroot = XmlUtil.getValueViaPath(xml,\"clinical-trial/remapper/uid-root\");\n\t\t\tptIdPrefix = XmlUtil.getValueViaPath(xml,\"clinical-trial/remapper/patient-id/prefix\");\n\t\t\tptIdSuffix = XmlUtil.getValueViaPath(xml,\"clinical-trial/remapper/patient-id/suffix\");\n\n\t\t\tString s = XmlUtil.getValueViaPath(xml,\"clinical-trial/remapper/patient-id@first\");\n\t\t\ttry { firstPtId = Integer.parseInt(s); }\n\t\t\tcatch (Exception ex) { firstPtId = 1; }\n\n\t\t\ts = XmlUtil.getValueViaPath(xml,\"clinical-trial/remapper/patient-id@width\");\n\t\t\ttry { ptIdWidth = Integer.parseInt(s); }\n\t\t\tcatch (Exception ex) { ptIdWidth = 4; }\n\n\t\t\t//We made it.\n\t\t\treturn true;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\txml = null;\n\t\t\tlogger.warn(\"Unable to load the configuration: [\"+e.getMessage()+\"]\");\n\t\t}\n\t\treturn false;\n\t}", "public X509CRLImpl(InputStream in) throws CRLException {\n try {\n // decode CertificateList structure\n this.crl = (CertificateList) CertificateList.ASN1.decode(in);\n this.tbsCertList = crl.getTbsCertList();\n this.extensions = tbsCertList.getCrlExtensions();\n } catch (IOException e) {\n throw new CRLException(e);\n }\n }", "public static X509Certificate loadAndroidKeyAttestationCertificate() {\n String certificate =\n \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIByTCCAXCgAwIBAgIBATAKBggqhkjOPQQDAjAcMRowGAYDVQQDDBFBbmRyb2lkIE\"\n + \"tleW1hc3Rl cjAgFw03MDAxMDEwMDAwMDBaGA8yMTA2MDIwNzA2MjgxNVowGjEYMBY\"\n + \"GA1UEAwwPQSBLZXltYXN0 ZXIgS2V5MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE\"\n + \"FpsFUWID9p2QPAvtfal4MRf9vJg0tNc3 vKJwoDhhSCMm7If0FljgvmroBYQyCIbnn\"\n + \"Bxh2OU9SKxI/manPwIIUqOBojCBnzALBgNVHQ8EBAMC B4AwbwYKKwYBBAHWeQIBEQ\"\n + \"RhMF8CAQEKAQACAQEKAQEEBWhlbGxvBAAwDL+FPQgCBgFWDy29GDA6 oQUxAwIBAqI\"\n + \"DAgEDowQCAgEApQUxAwIBBKoDAgEBv4N4AwIBA7+DeQQCAgEsv4U+AwIBAL+FPwIF \"\n + \"ADAfBgNVHSMEGDAWgBQ//KzWGrE6noEguNUlHMVlux6RqTAKBggqhkjOPQQDAgNHAD\"\n + \"BEAiBKzJSk 9VNauKu4dr+ZJ5jMTNlAxSI99XkKEkXSolsGSAIgCnd5T99gv3B/IqM\"\n + \"CHn0yZ7Wuu/jisU0epRRo xh8otA8=\\n\"\n + \"-----END CERTIFICATE-----\";\n return createCertificate(certificate);\n }", "public Configuration(final File anOutputDirectory, final Set<File> aSourceDirectories, final FileFilter aFileFilter,\n final Set<PackageAlias> aPackageAliases, final boolean anIsResourceBundleValidationEnabled,\n final String aRootClassName) {\n\n // Validate parameters.\n Validate.notNull(anOutputDirectory, \"Parameter anOutputDirectory is not allowed to be null\");\n Validate.notEmpty(aSourceDirectories, \"Parameter aSourceDirectories is not allowed to be empty\");\n\n for (final File sourceDirectory : aSourceDirectories) {\n Validate.isTrue(sourceDirectory.isDirectory(), \"Parameter sourceDirectories must contain valid directories\");\n }\n\n Validate.notNull(aFileFilter, \"Parameter aFileFilter is not allowed to be null\");\n Validate.notNull(aPackageAliases, \"Parameter aPackageAliases is not allowed to be null\");\n Validate.notEmpty(aRootClassName, \"Parameter aRootClassName is not allowed to be empty\");\n\n outputDirectory = anOutputDirectory;\n sourceDirectories = aSourceDirectories;\n fileFilter = aFileFilter;\n packageAliases = aPackageAliases;\n resourceBundleValidationEnabled = anIsResourceBundleValidationEnabled;\n fullyQualifiedGeneratedRootClassName = aRootClassName;\n }", "@Override\n\tpublic void init(boolean forward) throws CertPathValidatorException\n\t{\n\t}", "public abstract T useTransportSecurity(File certChain, File privateKey);", "public InstanceReader(String filename) throws FileNotFoundException{\n this.reader = new FileReader(filename);\n }", "X509CertificateInfo()\n {\n }", "public Builder fromFilePath(String filePath) {\n if (StringUtil.isNullOrEmpty(filePath)) {\n throw new IllegalArgumentException(\"Illegal filePath: \" + filePath);\n }\n this.sourceFilePath = filePath;\n return this;\n }", "public InputReader() throws FileNotFoundException, TransformerConfigurationException {\n this.csvlocation = System.getProperty(Static.SYSYEM_PROPERTY_FILE);\n this.templatelocation = System.getProperty(Static.SYSTEM_PROPERTY_TEMPLATE_FILE);\n init();\n }", "protected static String getCertificatePath() {\n return certificatePath;\n }", "public ApplicationResourceProperties() {\n }", "protected CertPath readCertificates(InputStream is) \n throws CertificateException, IOException {\n CertificateFactory factory = CertificateFactory.getInstance(\"X509\");\n return factory.generateCertPath(is, \"PkiPath\");\n }", "public void init (String path, ResourceBundle bundle)\n {\n _path = path;\n _bundle = bundle;\n }", "private TSLValidatorFactory() {\r\n\t\tsuper();\r\n\t}", "private List<X509Certificate> getValidationCertificates(String idpEntityID) throws ResolverException {\n if (this.validationCertificates != null && !this.validationCertificates.isEmpty()) {\n return this.validationCertificates;\n }\n else if (this.metadataProvider != null) {\n EntityDescriptor metadata = this.metadataProvider.getEntityDescriptor(idpEntityID);\n if (metadata == null) {\n logger.warn(\"No metadata found for IdP '{}' - cannot find key to use when verifying SAD JWT signature\", idpEntityID);\n return Collections.emptyList();\n }\n List<X509Credential> creds = MetadataUtils.getMetadataCertificates(metadata, UsageType.SIGNING);\n return creds.stream().map(X509Credential::getEntityCertificate).collect(Collectors.toList());\n }\n else {\n return Collections.emptyList();\n }\n }", "public SLDStyle(String filename) {\n \n File f = new File(filename);\n setInput(f);\n readXML();\n }", "@Nonnull\n public static KeyStore loadKeyStore(String filename, String password)\n throws IOException, GeneralSecurityException {\n return loadKeyStore(FileUtil.getContextFile(filename), password);\n }", "public void init(boolean forward) throws CertPathValidatorException {\n if (forward) {\n throw new CertPathValidatorException(\"forward checking \"\n + \"not supported\");\n }\n }", "public static Context getResourceContext() {\n return context;\n }", "public BpmnModelReader(String filePath) {\n\t\tloadedFile = new File(filePath);\n\t}", "public static InitializationTransactionRequest from(UnmarshallingContext context) throws IOException {\n\t\tTransactionReference classpath = TransactionReference.from(context);\n\t\tStorageReference manifest = StorageReference.from(context);\n\n\t\treturn new InitializationTransactionRequest(classpath, manifest);\n\t}", "PrivateResource resolve(Uri encryptedPath, Uri decryptedPath);", "private LSLRComponentProperties(final String resourceName) {\n this.resourceName = resourceName;\n }", "protected SftpPropertyLoad(final String bundleFileName) {\n\n\t\tthis.bundleFileName = bundleFileName;\n\n\t\tfinal Resource res = new ClassPathResource(StringUtil.replace(bundleFileName, \".\", \"/\") + \".properties\");\n\t\tfinal EncodedResource encodedResource = new EncodedResource(res, \"UTF-8\");\n\n\t\ttry {\n\t\t\tprops = PropertiesLoaderUtils.loadProperties(encodedResource);\n\t\t} catch (IOException e) {\n\t\t\tthrow new WebRuntimeException(e);\n\t\t}\n\t}", "public CertificateIssuer(String name, File fileaddress) throws CryptoException {\r\n\t\tsuper(fileaddress);\r\n\t\tlog.debug(PropertyFileConfiguration.StarLine+\"Issuer for \"+name+\" has been created from : \" + fileaddress.getAbsolutePath());\r\n\t\tlog.debug(\"Root cert subjectDN : \" +this.getSubjectDN()+PropertyFileConfiguration.StarLine);\r\n\t\tthis.name = name;\r\n\t\tthis.hascert = true;\r\n\t}", "public SSLService(Environment environment) {\n this.env = environment;\n this.settings = env.settings();\n this.diagnoseTrustExceptions = DIAGNOSE_TRUST_EXCEPTIONS_SETTING.get(environment.settings());\n this.sslConfigurations = new HashMap<>();\n this.sslContexts = loadSSLConfigurations();\n }", "public static <T> T load(URL location, ResourceBundle resources, BuilderFactory builderFactory,\n Charset charset) throws IOException {\n return builder().location(location).resources(resources).builderFactory(builderFactory)\n .charset(charset).build().load();\n }", "public PKCS10CertificationRequest readSigningRequestFromPem(File file) {\n FileReader reader = null;\n PEMParser parser = null;\n try {\n reader = new FileReader(file);\n parser = new PEMParser(reader);\n return (PKCS10CertificationRequest) parser.readObject();\n } catch (RuntimeException | IOException e) {\n throw new RuntimeException(\"Failed to load CSR from [\"+file+\"]\", e);\n } finally {\n CloseablesExt.closeQuietly(parser);\n CloseablesExt.closeQuietly(reader);\n }\n }" ]
[ "0.61176896", "0.5799691", "0.57057583", "0.55173784", "0.54214495", "0.54201305", "0.49235895", "0.48762348", "0.4784843", "0.47464937", "0.47242656", "0.4717961", "0.46499792", "0.46359733", "0.46232182", "0.4621227", "0.46198633", "0.46148053", "0.45626247", "0.4541877", "0.45296037", "0.4520677", "0.4519145", "0.45018426", "0.44962588", "0.4495163", "0.44917402", "0.4485849", "0.44686493", "0.44599915", "0.44460812", "0.4424219", "0.44232288", "0.44125742", "0.44113132", "0.4398458", "0.43878213", "0.4368283", "0.4365005", "0.43648896", "0.43569723", "0.43513936", "0.43486905", "0.43318942", "0.43289676", "0.43207678", "0.43167266", "0.43106943", "0.4290416", "0.42868483", "0.42851672", "0.42836696", "0.42690238", "0.42617303", "0.42575026", "0.42523378", "0.42517427", "0.42285848", "0.42210725", "0.42191207", "0.4209888", "0.42087597", "0.4203469", "0.42017618", "0.41969404", "0.41951162", "0.41944456", "0.41941792", "0.41860017", "0.418327", "0.418111", "0.41734585", "0.41728625", "0.41646034", "0.41610003", "0.4158642", "0.41560435", "0.41472733", "0.41470227", "0.41405514", "0.41397655", "0.4135891", "0.41355875", "0.413466", "0.41309786", "0.41269448", "0.4123396", "0.41228014", "0.41096595", "0.41071382", "0.4106907", "0.40972945", "0.40964678", "0.40948817", "0.40876764", "0.40851876", "0.40760764", "0.40759224", "0.4072958", "0.40717533" ]
0.6537718
0
constructs CertificateValidationContext from pemFilePath and sets contents as inlinebytes.
private static final CertificateValidationContext getCertContextFromPathAsInlineBytes( String pemFilePath) throws IOException, CertificateException { X509Certificate x509Cert = TestUtils.loadX509Cert(pemFilePath); return CertificateValidationContext.newBuilder() .setTrustedCa( DataSource.newBuilder().setInlineBytes(ByteString.copyFrom(x509Cert.getEncoded()))) .build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static final CertificateValidationContext getCertContextFromPath(String pemFilePath)\n throws IOException {\n return CertificateValidationContext.newBuilder()\n .setTrustedCa(\n DataSource.newBuilder().setFilename(TestUtils.loadCert(pemFilePath).getAbsolutePath()))\n .build();\n }", "public X509Certificate readCertificateFromPem(File file) {\n FileReader reader = null;\n PEMParser parser = null;\n try {\n reader = new FileReader(file);\n parser = new PEMParser(reader);\n X509CertificateHolder holder = (X509CertificateHolder) parser.readObject();\n return new JcaX509CertificateConverter().setProvider(\"BC\").getCertificate(holder);\n } catch (RuntimeException | IOException | GeneralSecurityException e) {\n throw new RuntimeException(\"Failed to load certficate from [\"+file+\"]\", e);\n } finally {\n CloseablesExt.closeQuietly(parser);\n CloseablesExt.closeQuietly(reader);\n }\n }", "private Certificate loadcert(final String filename) throws FileNotFoundException, IOException, CertificateParsingException {\n final byte[] bytes = FileTools.getBytesFromPEM(FileTools.readFiletoBuffer(filename), \"-----BEGIN CERTIFICATE-----\",\n \"-----END CERTIFICATE-----\");\n return CertTools.getCertfromByteArray(bytes, Certificate.class);\n\n }", "public PKCS10CertificationRequest readSigningRequestFromPem(File file) {\n FileReader reader = null;\n PEMParser parser = null;\n try {\n reader = new FileReader(file);\n parser = new PEMParser(reader);\n return (PKCS10CertificationRequest) parser.readObject();\n } catch (RuntimeException | IOException e) {\n throw new RuntimeException(\"Failed to load CSR from [\"+file+\"]\", e);\n } finally {\n CloseablesExt.closeQuietly(parser);\n CloseablesExt.closeQuietly(reader);\n }\n }", "public SSLConfig(@NonNull String pemCertificate, @NonNull String privateKey, @NonNull String password){\n this.sslCertificateType = PEM;\n this.pemCertificate = pemCertificate;\n this.privateKey = privateKey;\n this.password = password;\n }", "public static X509Certificate getCertificateFromPem(String pem)\n throws CertificateException {\n InputStream pemstream = new ByteArrayInputStream(pem.getBytes(StandardCharsets.UTF_8));\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n return (X509Certificate) cf.generateCertificate(pemstream);\n }", "public static PKCS10CertificationRequest convertPemToPKCS10CertificationRequest(byte[] pem)\n throws IOException {\n PKCS10CertificationRequest csr = null;\n ByteArrayInputStream pemStream;\n pemStream = new ByteArrayInputStream(pem);\n\n Reader pemReader = new BufferedReader(new InputStreamReader(pemStream));\n PEMParser pemParser = new PEMParser(pemReader);\n\n Object parsedObj = pemParser.readObject();\n\n if (parsedObj instanceof PKCS10CertificationRequest) {\n csr = (PKCS10CertificationRequest) parsedObj;\n }\n\n return csr;\n }", "public ValidationResult validate(CertPath certPath);", "public CloudServiceVaultCertificate() {\n }", "public ImportCertificateRequest withCertificateChain(java.nio.ByteBuffer certificateChain) {\n setCertificateChain(certificateChain);\n return this;\n }", "public abstract T useTransportSecurity(File certChain, File privateKey);", "@Test\n public void certificateFileTest() {\n // TODO: test certificateFile\n }", "private void importTrustedCertificate() {\n\t\t// Let the user choose a file containing trusted certificate(s) to\n\t\t// import\n\t\tFile certFile = selectImportExportFile(\n\t\t\t\t\"Certificate file to import from\", // title\n\t\t\t\tnew String[] { \".pem\", \".crt\", \".cer\", \".der\", \"p7\", \".p7c\" }, // file extensions filters\n\t\t\t\t\"Certificate Files (*.pem, *.crt, , *.cer, *.der, *.p7, *.p7c)\", // filter descriptions\n\t\t\t\t\"Import\", // text for the file chooser's approve button\n\t\t\t\t\"trustedCertDir\"); // preference string for saving the last chosen directory\n\t\tif (certFile == null)\n\t\t\treturn;\n\n\t\t// Load the certificate(s) from the file\n\t\tArrayList<X509Certificate> trustCertsList = new ArrayList<>();\n\t\tCertificateFactory cf;\n\t\ttry {\n\t\t\tcf = CertificateFactory.getInstance(\"X.509\");\n\t\t} catch (Exception e) {\n\t\t\t// Nothing we can do! Things are badly misconfigured\n\t\t\tcf = null;\n\t\t}\n\n\t\tif (cf != null) {\n\t\t\ttry (FileInputStream fis = new FileInputStream(certFile)) {\n\t\t\t\tfor (Certificate cert : cf.generateCertificates(fis))\n\t\t\t\t\ttrustCertsList.add((X509Certificate) cert);\n\t\t\t} catch (Exception cex) {\n\t\t\t\t// Do nothing\n\t\t\t}\n\n\t\t\tif (trustCertsList.size() == 0) {\n\t\t\t\t// Could not load certificates as any of the above types\n\t\t\t\ttry (FileInputStream fis = new FileInputStream(certFile);\n\t\t\t\t\t\tPEMReader pr = new PEMReader(\n\t\t\t\t\t\t\t\tnew InputStreamReader(fis), null, cf\n\t\t\t\t\t\t\t\t\t\t.getProvider().getName())) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Try as openssl PEM format - which sligtly differs from\n\t\t\t\t\t * the one supported by JCE\n\t\t\t\t\t */\n\t\t\t\t\tObject cert;\n\t\t\t\t\twhile ((cert = pr.readObject()) != null)\n\t\t\t\t\t\tif (cert instanceof X509Certificate)\n\t\t\t\t\t\t\ttrustCertsList.add((X509Certificate) cert);\n\t\t\t\t} catch (Exception cex) {\n\t\t\t\t\t// do nothing\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (trustCertsList.size() == 0) {\n\t\t\t/* Failed to load certifcate(s) using any of the known encodings */\n\t\t\tshowMessageDialog(this,\n\t\t\t\t\t\"Failed to load certificate(s) using any of the known encodings -\\n\"\n\t\t\t\t\t\t\t+ \"file format not recognised.\", ERROR_TITLE,\n\t\t\t\t\tERROR_MESSAGE);\n\t\t\treturn;\n\t\t}\n\n\t\t// Show the list of certificates contained in the file for the user to\n\t\t// select the ones to import\n\t\tNewTrustCertsDialog importTrustCertsDialog = new NewTrustCertsDialog(this,\n\t\t\t\t\"Credential Manager\", true, trustCertsList, dnParser);\n\n\t\timportTrustCertsDialog.setLocationRelativeTo(this);\n\t\timportTrustCertsDialog.setVisible(true);\n\t\tList<X509Certificate> selectedTrustCerts = importTrustCertsDialog\n\t\t\t\t.getTrustedCertificates(); // user-selected trusted certs to import\n\n\t\t// If user cancelled or did not select any cert to import\n\t\tif (selectedTrustCerts == null || selectedTrustCerts.isEmpty())\n\t\t\treturn;\n\n\t\ttry {\n\t\t\tfor (X509Certificate cert : selectedTrustCerts)\n\t\t\t\t// Import the selected trusted certificates\n\t\t\t\tcredManager.addTrustedCertificate(cert);\n\n\t\t\t// Display success message\n\t\t\tshowMessageDialog(this, \"Trusted certificate(s) import successful\",\n\t\t\t\t\tALERT_TITLE, INFORMATION_MESSAGE);\n\t\t} catch (CMException cme) {\n\t\t\tString exMessage = \"Failed to import trusted certificate(s) to the Truststore\";\n\t\t\tlogger.error(exMessage, cme);\n\t\t\tshowMessageDialog(this, exMessage, ERROR_TITLE, ERROR_MESSAGE);\n\t\t}\n\t}", "private void getKeyAndCerts(String filePath, String pw)\n throws GeneralSecurityException, IOException {\n System.out\n .println(\"reading signature key and certificates from file \" + filePath + \".\");\n\n FileInputStream fis = new FileInputStream(filePath);\n KeyStore store = KeyStore.getInstance(\"PKCS12\", \"IAIK\");\n store.load(fis, pw.toCharArray());\n\n Enumeration<String> aliases = store.aliases();\n String alias = (String) aliases.nextElement();\n privKey_ = (PrivateKey) store.getKey(alias, pw.toCharArray());\n certChain_ = Util.convertCertificateChain(store.getCertificateChain(alias));\n fis.close();\n }", "X509CertificateInfo()\n {\n }", "public void setUserCertificatesPath(String path);", "public static PKCS10CertificationRequest convertPemToPKCS10CertificationRequest(String pem)\n throws IOException {\n\n return convertPemToPKCS10CertificationRequest (pem.getBytes(StandardCharsets.UTF_8));\n }", "public ValidationContext getSignatureValidationContext(final CertificateVerifier certificateVerifier) {\n\n\t\tfinal ValidationContext validationContext = new SignatureValidationContext();\n\t\tfinal List<CertificateToken> certificates = getCertificates();\n\t\tfor (final CertificateToken certificate : certificates) {\n\n\t\t\tvalidationContext.addCertificateTokenForVerification(certificate);\n\t\t}\n\t\tprepareTimestamps(validationContext);\n\t\tcertificateVerifier.setSignatureCRLSource(new ListCRLSource(getCRLSource()));\n\t\tcertificateVerifier.setSignatureOCSPSource(new ListOCSPSource(getOCSPSource()));\n\t\t// certificateVerifier.setAdjunctCertSource(getCertificateSource());\n\t\tvalidationContext.initialize(certificateVerifier);\n\t\tvalidationContext.validate();\n\t\treturn validationContext;\n\t}", "@Override\n public X509Certificate decodePemEncodedCertificate(Reader certificateReader) {\n Certificate certificate;\n\n // the JCA CertificateFactory takes an InputStream, so convert the reader to a stream first. converting to a String first\n // is not ideal, but is relatively straightforward. (PEM certificates should only contain US_ASCII-compatible characters.)\n try (InputStream certificateAsStream = new ByteArrayInputStream(CharStreams.toString(certificateReader).getBytes(StandardCharsets.US_ASCII))) {\n CertificateFactory certificateFactory = CertificateFactory.getInstance(\"X.509\");\n certificate = certificateFactory.generateCertificate(certificateAsStream);\n } catch (CertificateException | IOException e) {\n throw new ImportException(\"Unable to read PEM-encoded X509Certificate\", e);\n }\n\n if (!(certificate instanceof X509Certificate)) {\n throw new ImportException(\"Attempted to import non-X.509 certificate as X.509 certificate\");\n }\n\n return (X509Certificate) certificate;\n }", "public static X509Certificate loadAndroidKeyAttestationCertificate() {\n String certificate =\n \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIByTCCAXCgAwIBAgIBATAKBggqhkjOPQQDAjAcMRowGAYDVQQDDBFBbmRyb2lkIE\"\n + \"tleW1hc3Rl cjAgFw03MDAxMDEwMDAwMDBaGA8yMTA2MDIwNzA2MjgxNVowGjEYMBY\"\n + \"GA1UEAwwPQSBLZXltYXN0 ZXIgS2V5MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE\"\n + \"FpsFUWID9p2QPAvtfal4MRf9vJg0tNc3 vKJwoDhhSCMm7If0FljgvmroBYQyCIbnn\"\n + \"Bxh2OU9SKxI/manPwIIUqOBojCBnzALBgNVHQ8EBAMC B4AwbwYKKwYBBAHWeQIBEQ\"\n + \"RhMF8CAQEKAQACAQEKAQEEBWhlbGxvBAAwDL+FPQgCBgFWDy29GDA6 oQUxAwIBAqI\"\n + \"DAgEDowQCAgEApQUxAwIBBKoDAgEBv4N4AwIBA7+DeQQCAgEsv4U+AwIBAL+FPwIF \"\n + \"ADAfBgNVHSMEGDAWgBQ//KzWGrE6noEguNUlHMVlux6RqTAKBggqhkjOPQQDAgNHAD\"\n + \"BEAiBKzJSk 9VNauKu4dr+ZJ5jMTNlAxSI99XkKEkXSolsGSAIgCnd5T99gv3B/IqM\"\n + \"CHn0yZ7Wuu/jisU0epRRo xh8otA8=\\n\"\n + \"-----END CERTIFICATE-----\";\n return createCertificate(certificate);\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "private void addCertificate(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.add(value);\n }", "protected void init() throws Exception {\n if (this.sslConfiguration != null && this.sslConfiguration.enabled()) {\n if (this.sslConfiguration.certificatePath() != null && this.sslConfiguration.privateKeyPath() != null) {\n try (var cert = Files.newInputStream(this.sslConfiguration.certificatePath());\n var privateKey = Files.newInputStream(this.sslConfiguration.privateKeyPath())) {\n // begin building the new ssl context building based on the certificate and private key\n var builder = SslContextBuilder.forServer(cert, privateKey);\n\n // check if a trust certificate was given, if not just trusts all certificates\n if (this.sslConfiguration.trustCertificatePath() != null) {\n try (var stream = Files.newInputStream(this.sslConfiguration.trustCertificatePath())) {\n builder.trustManager(stream);\n }\n } else {\n builder.trustManager(InsecureTrustManagerFactory.INSTANCE);\n }\n\n // build the context\n this.sslContext = builder\n .clientAuth(this.sslConfiguration.clientAuth() ? ClientAuth.REQUIRE : ClientAuth.OPTIONAL)\n .build();\n }\n } else {\n // self-sign a certificate as no certificate was provided\n var selfSignedCertificate = new SelfSignedCertificate();\n this.sslContext = SslContextBuilder\n .forServer(selfSignedCertificate.certificate(), selfSignedCertificate.privateKey())\n .trustManager(InsecureTrustManagerFactory.INSTANCE)\n .build();\n }\n }\n }", "@Override\n public InputStream getCertStream() {\n if (Strings.isEmpty(certPath)) {\n throw new NotFoundException(\"cert path not configured\");\n }\n if (certBytes == null) {\n Path path = Paths.get(certPath).toAbsolutePath();\n try {\n certBytes = readAllBytes(path);\n } catch (IOException e) {\n throw new UncheckedIOException(\"read cert failed\", e);\n }\n }\n return new ByteArrayInputStream(certBytes);\n }", "public ValidationResult validate(X509Certificate[] certChain);", "public CryptFile(File file, CryptFile parentFile) {\n this.file = file;\n this.parentFile = parentFile;\n users = new Properties();\n }", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public Builder setSourceContextBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n sourceContext_ = value;\n onChanged();\n return this;\n }", "protected SSLContext() {}", "@Nullable\n private static X509Certificate certificateFromPemString(@Nullable String certStr)\n throws CertificateException {\n if (certStr == null || EMPTY_CERT.equals(certStr)) {\n return null;\n }\n\n try {\n final List<X509Certificate> certs =\n Credentials.convertFromPem(certStr.getBytes(StandardCharsets.US_ASCII));\n return certs.isEmpty() ? null : certs.get(0);\n } catch (IOException e) {\n throw new CertificateException(e);\n }\n }", "public void writeToPemFile(PKCS10CertificationRequest request, File file) {\n try {\n writeToPemFile(PemType.CERTIFICATE_REQUEST, request.getEncoded(), file);\n } catch (IOException e) {\n throw new RuntimeException(\"Failed to write CSR PEM to [\"+file+\"]\", e);\n }\n }", "public static SigningPolicy getPolicy(String fileName, \n String requiredCaDN) \n throws SigningPolicyParserException {\n \n if ((fileName == null) || (fileName.trim().equals(\"\"))) {\n throw new IllegalArgumentException();\n }\n \n logger.debug(\"Signing policy file name \" + fileName + \" with CA DN \"\n + requiredCaDN);\n\n FileReader fileReader = null;\n \n try {\n fileReader = new FileReader(fileName);\n } catch (FileNotFoundException exp) {\n if (fileReader != null) {\n try {\n fileReader.close();\n } catch (Exception e) {\n }\n }\n throw new SigningPolicyParserException(exp.getMessage(), exp);\n }\n\n SigningPolicy policy = getPolicy(fileReader, requiredCaDN);\n policy.setFileName(fileName);\n logger.debug(\"Policy file parsing completed, policy is \" + \n (policy == null));\n return policy;\n }", "@SuppressWarnings(\"rawtypes\")\n private com.squareup.okhttp.Call recCertCheckValidateBeforeCall(File certificateFile, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {\n if (certificateFile == null) {\n throw new ApiException(\"Missing the required parameter 'certificateFile' when calling recCertCheck(Async)\");\n }\n \n\n com.squareup.okhttp.Call call = recCertCheckCall(certificateFile, progressListener, progressRequestListener);\n return call;\n\n }", "protected abstract InputStream openCertificateStream(String id)\n throws FileNotFoundException, KeyStorageException, IOException;", "public void importCA(File certfile){\n try {\n File keystoreFile = new File(archivo);\n \n //copia .cer -> formato manipulacion\n FileInputStream fis = new FileInputStream(certfile);\n DataInputStream dis = new DataInputStream(fis);\n byte[] bytes = new byte[dis.available()];\n dis.readFully(bytes);\n ByteArrayInputStream bais = new ByteArrayInputStream(bytes);\n bais.close();\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n Certificate certs = cf.generateCertificate(bais);\n //System.out.println(certs.toString());\n //inic keystore\n FileInputStream newib = new FileInputStream(keystoreFile);\n KeyStore keystore = KeyStore.getInstance(INSTANCE);\n keystore.load(newib,ksPass );\n String alias = (String)keystore.aliases().nextElement();\n newib.close();\n \n //recupero el array de certificado del keystore generado para CA\n Certificate[] certChain = keystore.getCertificateChain(alias);\n certChain[0]= certs; //inserto el certificado entregado por CA\n //LOG.info(\"Inserto certifica CA: \"+certChain[0].toString());\n //recupero la clave privada para generar la nueva entrada\n Key pk = (PrivateKey)keystore.getKey(alias, ksPass); \n keystore.setKeyEntry(alias, pk, ksPass, certChain);\n LOG.info(\"Keystore actualizado: [OK]\");\n \n FileOutputStream fos = new FileOutputStream(keystoreFile);\n keystore.store(fos,ksPass);\n fos.close(); \n \n } catch (FileNotFoundException ex) {\n LOG.error(\"Error - no se encuentra el archivo\",ex);\n } catch (IOException | NoSuchAlgorithmException | CertificateException | KeyStoreException ex) {\n LOG.error(\"Error con el certificado\",ex);\n } catch (UnrecoverableKeyException ex) {\n LOG.error(ex);\n }\n }", "protected abstract InputStream openCACertificateStream(String id)\n throws FileNotFoundException, KeyStorageException, IOException;", "private static Certificate getCertficateFromFile(File certFile) throws Exception{\n\t\tCertificate certificate = null;\n\t\tInputStream certInput = null;\n\t\ttry {\n\t\t\tcertInput = new BufferedInputStream(new FileInputStream(certFile));\n\t\t\tCertificateFactory certFactory = CertificateFactory.getInstance(DEFAULT_CERTIFCATE_TYPE);\n\t\t\tcertificate = certFactory.generateCertificate(certInput);\n\t\t} catch (Exception ex) {\n\t\t\tthrow new Exception(\"提取证书文件[\" + certFile.getName() + \"]认证失败,原因[\" + ex.getMessage() + \"]\");\n\t\t} finally {\n\t\t\t//IOUtils.closeQuietly(certInput);\n\t\t}\n\t\treturn certificate;\n\t}", "public SingleCertificateResolver(X509Certificate paramX509Certificate) {\n/* 45 */ this.certificate = paramX509Certificate;\n/* */ }", "@Test\n public void testSslJks_loadTrustStoreFromFile() throws Exception {\n final InputStream inputStream = this.getClass().getResourceAsStream(\"/keystore.jks\");\n final String tempDirectoryPath = System.getProperty(\"java.io.tmpdir\");\n final File jks = new File(tempDirectoryPath + File.separator + \"keystore.jks\");\n final FileOutputStream outputStream = new FileOutputStream(jks);\n final byte[] buffer = new byte[1024];\n int noOfBytes = 0;\n while ((noOfBytes = inputStream.read(buffer)) != -1) {\n outputStream.write(buffer, 0, noOfBytes);\n }\n\n final MockVault mockVault = new MockVault(200, \"{\\\"data\\\":{\\\"value\\\":\\\"mock\\\"}}\");\n final Server server = VaultTestUtils.initHttpsMockVault(mockVault);\n server.start();\n\n final VaultConfig vaultConfig = new VaultConfig()\n .address(\"https://127.0.0.1:9998\")\n .token(\"mock_token\")\n .sslConfig(new SslConfig().trustStoreFile(jks).build())\n .build();\n final Vault vault = new Vault(vaultConfig);\n final LogicalResponse response = vault.logical().read(\"secret/hello\");\n\n VaultTestUtils.shutdownMockVault(server);\n }", "public static String generateCert(String certPem) {\n try {\n String tempPemPath = \"/tmp/tempPem\";\n Files.write(Paths.get(tempPemPath), certPem.getBytes());\n\n DefaultExecutor executor = new DefaultExecutor();\n CommandLine cmdLine = CommandLine.parse(\"openssl\");\n cmdLine.addArgument(\"x509\");\n cmdLine.addArgument(\"-in\");\n cmdLine.addArgument(tempPemPath);\n cmdLine.addArgument(\"-text\");\n\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n PumpStreamHandler streamHandler = new PumpStreamHandler(baos);\n executor.setStreamHandler(streamHandler);\n\n executor.execute(cmdLine);\n return baos.toString(\"UTF-8\");\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n }\n }", "private void setCertificate(\n int index, com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.set(index, value);\n }", "protected InputStream loadMessageMappingRulesContainerFile() throws BackendRuntimeException\r\n\t{\r\n\t\tfinal InputStream is = this.getClass().getClassLoader().getResourceAsStream(\"sapmessagemapping/messages.xml\");\r\n\t\tif (is != null)\r\n\t\t{\r\n\t\t\treturn is;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new BackendRuntimeException(\"File \\\"\" + RFC_MESSAGES + \"\\\" can not be opened\");\r\n\t\t}\r\n\t}", "public ImportCertificateRequest withCertificate(java.nio.ByteBuffer certificate) {\n setCertificate(certificate);\n return this;\n }", "public Builder setRawResumeBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n rawResume_ = value;\n onChanged();\n return this;\n }", "public PEMWriter() {\r\n }", "private void initCodeValuesInlineContent(String fileContent) {\n String lineSeparator = (String) java.security.AccessController.doPrivileged(\n new sun.security.action.GetPropertyAction(\"line.separator\"));\n\n String fileContentEnCodeStr = \"\";\n try {\n fileContentEnCodeStr = (new sun.misc.BASE64Encoder()).encode(fileContent.getBytes(\"UTF-8\"));\n } catch (java.io.UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n\n codeValuesBase64 = new StringBuilder();\n for(String item : fileContentEnCodeStr.split(lineSeparator))\n codeValuesBase64.append('\"').append(item).append(\"\\\",\");\n // Remove trailing commas.\n if (codeValuesBase64.length() > 0)\n codeValuesBase64.setLength(codeValuesBase64.length() - 1);\n }", "com.google.protobuf.ByteString getCertificate(int index);", "public PropFileReader(String filename, String jsonFileName){\n this.ruleJsonFile=jsonFileName;\n this.filename=filename;\n this.propertyBuilder();\n }", "public Builder setLinkedContextBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n linkedContext_ = value;\n onChanged();\n return this;\n }", "public Builder setCertificate(liubaninc.m0.pki.CertificateOuterClass.Certificate value) {\n if (certificateBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n certificate_ = value;\n onChanged();\n } else {\n certificateBuilder_.setMessage(value);\n }\n\n return this;\n }", "public static X509Certificate loadCertificate(InputStream in)\n throws GeneralSecurityException {\n return (X509Certificate) getCertificateFactory().generateCertificate(in);\n }", "public void testParseAndCreate() throws Exception {\r\n byte[] keydata = FileHelper.loadFile(new File(\"./src/test/resources/PUBLIC_KEY_RSA1024.cvc\"));\r\n CVCPublicKey publicKey1 = (CVCPublicKey)CertificateParser.parseCVCObject(keydata);\r\n\r\n // Create certificate\r\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\", \"BC\");\r\n keyGen.initialize(1024, new SecureRandom());\r\n KeyPair keyPair = keyGen.generateKeyPair();\r\n CAReferenceField caRef = new CAReferenceField(CA_COUNTRY_CODE, CA_HOLDER_MNEMONIC, CA_SEQUENCE_NO);\r\n HolderReferenceField holderRef = new HolderReferenceField(HR_COUNTRY_CODE, HR_HOLDER_MNEMONIC, HR_SEQUENCE_NO);\r\n\r\n // Call CertificateGenerator\r\n CVCertificate cvc = \r\n CertificateGenerator.createTestCertificate(publicKey1, keyPair.getPrivate(), caRef, holderRef, \"SHA1WithRSA\", AuthorizationRoleEnum.IS );\r\n \r\n // Compare as text - these should be identical\r\n CVCPublicKey publicKey2 = cvc.getCertificateBody().getPublicKey();\r\n assertEquals(\"Public keys as text differ\", publicKey1.getAsText(\"\"), publicKey2.getAsText(\"\"));\r\n\r\n }", "private SSLContext initSSLContext() {\n KeyStore ks = KeyStoreUtil.loadSystemKeyStore();\n if (ks == null) {\n _log.error(\"Key Store init error\");\n return null;\n }\n if (_log.shouldLog(Log.INFO)) {\n int count = KeyStoreUtil.countCerts(ks);\n _log.info(\"Loaded \" + count + \" default trusted certificates\");\n }\n\n File dir = new File(_context.getBaseDir(), CERT_DIR);\n int adds = KeyStoreUtil.addCerts(dir, ks);\n int totalAdds = adds;\n if (adds > 0 && _log.shouldLog(Log.INFO))\n _log.info(\"Loaded \" + adds + \" trusted certificates from \" + dir.getAbsolutePath());\n if (!_context.getBaseDir().getAbsolutePath().equals(_context.getConfigDir().getAbsolutePath())) {\n dir = new File(_context.getConfigDir(), CERT_DIR);\n adds = KeyStoreUtil.addCerts(dir, ks);\n totalAdds += adds;\n if (adds > 0 && _log.shouldLog(Log.INFO))\n _log.info(\"Loaded \" + adds + \" trusted certificates from \" + dir.getAbsolutePath());\n }\n dir = new File(System.getProperty(\"user.dir\"));\n if (!_context.getBaseDir().getAbsolutePath().equals(dir.getAbsolutePath())) {\n dir = new File(_context.getConfigDir(), CERT_DIR);\n adds = KeyStoreUtil.addCerts(dir, ks);\n totalAdds += adds;\n if (adds > 0 && _log.shouldLog(Log.INFO))\n _log.info(\"Loaded \" + adds + \" trusted certificates from \" + dir.getAbsolutePath());\n }\n if (_log.shouldLog(Log.INFO))\n _log.info(\"Loaded total of \" + totalAdds + \" new trusted certificates\");\n\n try {\n SSLContext sslc = SSLContext.getInstance(\"TLS\");\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());\n tmf.init(ks);\n X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0];\n _stm = new SavingTrustManager(defaultTrustManager);\n sslc.init(null, new TrustManager[] {_stm}, null);\n /****\n if (_log.shouldLog(Log.DEBUG)) {\n SSLEngine eng = sslc.createSSLEngine();\n SSLParameters params = sslc.getDefaultSSLParameters();\n String[] s = eng.getSupportedProtocols();\n Arrays.sort(s);\n _log.debug(\"Supported protocols: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = eng.getEnabledProtocols();\n Arrays.sort(s);\n _log.debug(\"Enabled protocols: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = params.getProtocols();\n if (s == null)\n s = new String[0];\n _log.debug(\"Default protocols: \" + s.length);\n Arrays.sort(s);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = eng.getSupportedCipherSuites();\n Arrays.sort(s);\n _log.debug(\"Supported ciphers: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = eng.getEnabledCipherSuites();\n Arrays.sort(s);\n _log.debug(\"Enabled ciphers: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = params.getCipherSuites();\n if (s == null)\n s = new String[0];\n _log.debug(\"Default ciphers: \" + s.length);\n Arrays.sort(s);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n }\n ****/\n return sslc;\n } catch (GeneralSecurityException gse) {\n _log.error(\"Key Store update error\", gse);\n } catch (ExceptionInInitializerError eiie) {\n // java 9 b134 see ../crypto/CryptoCheck for example\n // Catching this may be pointless, fetch still fails\n _log.error(\"SSL context error - Java 9 bug?\", eiie);\n }\n return null;\n }", "public MailcapFile(InputStream is) throws IOException {\n/* 104 */ if (LogSupport.isLoggable())\n/* 105 */ LogSupport.log(\"new MailcapFile: InputStream\"); \n/* 106 */ parse(new BufferedReader(new InputStreamReader(is, \"iso-8859-1\")));\n/* */ }", "private List<X509Certificate> getValidationCertificates(String idpEntityID) throws ResolverException {\n if (this.validationCertificates != null && !this.validationCertificates.isEmpty()) {\n return this.validationCertificates;\n }\n else if (this.metadataProvider != null) {\n EntityDescriptor metadata = this.metadataProvider.getEntityDescriptor(idpEntityID);\n if (metadata == null) {\n logger.warn(\"No metadata found for IdP '{}' - cannot find key to use when verifying SAD JWT signature\", idpEntityID);\n return Collections.emptyList();\n }\n List<X509Credential> creds = MetadataUtils.getMetadataCertificates(metadata, UsageType.SIGNING);\n return creds.stream().map(X509Credential::getEntityCertificate).collect(Collectors.toList());\n }\n else {\n return Collections.emptyList();\n }\n }", "public ConsumedCertificateCredentialModel(final ItemModelContext ctx)\n\t{\n\t\tsuper(ctx);\n\t}", "public void loadKey(File in, File privateKeyFile) throws GeneralSecurityException, IOException {\n\t byte[] encodedKey = new byte[(int)privateKeyFile.length()];\n\t FileInputStream is = new FileInputStream(privateKeyFile);\n\t is.read(encodedKey);\n\t \n\t // create private key\n\t PKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(encodedKey);\n\t KeyFactory kf = KeyFactory.getInstance(\"RSA\");\n\t PrivateKey pk = kf.generatePrivate(privateKeySpec);\n\t \n\t // read AES key\n\t pkCipher.init(Cipher.DECRYPT_MODE, pk);\n\t aesKey = new byte[256/8];\n\t CipherInputStream cis = new CipherInputStream(new FileInputStream(in), pkCipher);\n\t cis.read(aesKey);\n\t aesKeySpec = new SecretKeySpec(aesKey, \"AES\");\n\t cis.close();\n\t is.close();\n\t }", "public vn.com.ecopharma.hrm.rc.model.Certificate create(long certificateId);", "public MailcapFile(String new_fname) throws IOException {\n/* 83 */ if (LogSupport.isLoggable())\n/* 84 */ LogSupport.log(\"new MailcapFile: file \" + new_fname); \n/* 85 */ FileReader reader = null;\n/* */ try {\n/* 87 */ reader = new FileReader(new_fname);\n/* 88 */ parse(new BufferedReader(reader));\n/* */ } finally {\n/* 90 */ if (reader != null) {\n/* */ try {\n/* 92 */ reader.close();\n/* 93 */ } catch (IOException ex) {}\n/* */ }\n/* */ } \n/* */ }", "public SecKeyRing(File file) throws IOException, PGPException {\r\n\r\n\t\tload(file);\r\n\t}", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private void validateEncryptionContext(ParsedCiphertext parsedCiphertext, String sdbPath) {\n Map<String, String> encryptionContext = parsedCiphertext.getEncryptionContextMap();\n String pathFromEncryptionContext = encryptionContext.getOrDefault(SDB_PATH_PROPERTY_NAME, null);\n if (!StringUtils.equals(pathFromEncryptionContext, sdbPath)) {\n String msg = \"EncryptionContext did not have expected path: \" + sdbPath;\n if (StringUtils.equalsIgnoreCase(pathFromEncryptionContext, sdbPath)) {\n msg += \" (case path change detected)\";\n } else {\n msg += \" (possible tampering)\";\n }\n log.error(msg);\n InvalidEncryptionContextApiError iece = new InvalidEncryptionContextApiError(msg);\n throw ApiException.newBuilder().withApiErrors(iece).build();\n }\n }", "private void createSSLContext() throws Exception {\n\n char[] passphrase = \"passphrase\".toCharArray();\n\n KeyStore ks = KeyStore.getInstance(\"JKS\");\n ks.load(new FileInputStream(\"testkeys\"), passphrase);\n\n KeyManagerFactory kmf = KeyManagerFactory.getInstance(\"SunX509\");\n kmf.init(ks, passphrase);\n\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(\"SunX509\");\n tmf.init(ks);\n\n sslContext = SSLContext.getInstance(\"TLS\");\n sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);\n }", "public interface CertService {\n\n /**\n * Retrieves the root certificate.\n * \n * @return\n * @throws CertException\n */\n public X509Certificate getRootCertificate() throws CertException;\n\n /**\n * Sets up a root service to be used for CA-related services like certificate request signing and certificate\n * revocation.\n * \n * @param keystore\n * @throws CertException\n */\n public void setRootService(RootService rootService) throws CertException;\n\n /**\n * Retrieves a KeyStore object from a supplied InputStream. Requires a keystore password.\n * \n * @param userId\n * @return\n */\n public KeyStore getKeyStore(InputStream keystoreIS, String password) throws CertException;\n\n /**\n * Retrieves existing private and public key from a KeyStore.\n * \n * @param userId\n * @return\n */\n public KeyPair getKeyPair(KeyStore ks, String keyAlias, String certificateAlias, String keyPassword)\n throws CertException;\n\n /**\n * Retrieves an existing certificate from a keystore using keystore's certificate alias.\n * \n * @param userId\n * @return\n */\n public X509Certificate getCertificate(KeyStore keystore, String certificateAlias) throws CertException;\n\n /**\n * Generates a private key and a public certificate for a user whose X.509 field information was enclosed in a\n * UserInfo parameter. Stores those artifacts in a password protected keystore. This is the principal method for\n * activating a new certificate and signing it with a root certificate.\n * \n * @param userId\n * @return KeyStore based on the provided userInfo\n */\n\n public KeyStore initializeUser(UserInfo userInfo, String keyPassword) throws CertException;\n\n /**\n * Wraps a certificate object into an OutputStream object secured by a keystore password\n * \n * @param keystore\n * @param os\n * @param keystorePassword\n * @throws CertException\n */\n public void storeCertificate(KeyStore keystore, OutputStream os, String keystorePassword) throws CertException;\n\n /**\n * Extracts the email address from a certificate\n * \n * @param certificate\n * @return\n * @throws CertException\n */\n public String getCertificateEmail(X509Certificate certificate) throws CertException;\n\n}", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public Builder setSourceFileBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n sourceFile_ = value;\n onChanged();\n return this;\n }", "Builder webIdentityTokenFile(Path webIdentityTokenFile);", "private void start(String filePath, String password) throws CmsCadesException,\n GeneralSecurityException, IOException, TspVerificationException {\n getKeyAndCerts(filePath, password);\n\n // sign some bytes\n byte[] somerandomdata = new byte[100];\n Random random = new Random();\n random.nextBytes(somerandomdata);\n byte[] signature = signData(somerandomdata);\n System.out.println(\"signed some random data\");\n\n System.out.println(\"verify the signature: \");\n verifyCadesSignature(signature, somerandomdata);\n\n // sign a file stream\n FileInputStream dataStream = new FileInputStream(fileToBeSigned);\n signDataStream(dataStream, signatureFile);\n dataStream.close();\n System.out.println(\n \"signed file \" + fileToBeSigned + \" and saved signature to \" + signatureFile);\n\n System.out.println(\"verify the signature contained in \" + signatureFile + \":\");\n FileInputStream sigStream = new FileInputStream(signatureFile);\n dataStream = new FileInputStream(fileToBeSigned);\n verifyCadesSignatureStream(sigStream, dataStream);\n sigStream.close();\n dataStream.close();\n }", "@Test\n public void testHttps_simplepem() throws Exception {\n if (\"true\".equals(System.getProperty(\"io.r2.skipLongTests\"))) throw new SkipException(\"Long test skipped\");\n\n KeyStore ks = KeyStore.getInstance(\"simplepem\");\n ks.load(new MultiFileConcatSource()\n .alias(\"server\")\n .add(\"src/test/resources/certchain.pem\")\n .add(\"src/test/resources/key.pem\")\n .build(),\n new char[0]\n );\n\n KeyManagerFactory kmf = KeyManagerFactory.getInstance(\"simplepemreload\");\n kmf.init( ExpiringCacheKeyManagerParameters.forKeyStore(ks).withRevalidation(5) );\n\n KeyManager[] km = kmf.getKeyManagers();\n assertThat(km).hasSize(1);\n\n SSLContext ctx = SSLContext.getInstance(\"TLSv1.2\");\n ctx.init(km, null, null);\n\n HttpsServer server = startHttpsServer(ctx);\n\n try {\n HttpsURLConnection conn = createClientConnection();\n\n assertThat(conn.getPeerPrincipal().getName()).isEqualTo(\"CN=anna.apn2.com\");\n\n ks.load(new MultiFileConcatSource()\n .alias(\"server\")\n .add(\"src/test/resources/selfcert.pem\")\n .add(\"src/test/resources/selfkey.pem\")\n .build(),\n new char[0]\n );\n\n Thread.sleep(10000); // wait for picking up the change in 5 seconds (+extra)\n\n HttpsURLConnection conn2 = createClientConnection();\n\n assertThat(conn2.getPeerPrincipal().getName()).isEqualTo(\"CN=self.signed.cert,O=Radical Research,ST=NA,C=IO\");\n\n }\n finally {\n // stop server\n server.stop(0);\n }\n }", "protected SECSItem(SECSItemFormatCode formatCode, int lengthInBytes)\n {\n if (lengthInBytes < 0 || lengthInBytes > 0x00FFFFFF)\n {\n throw new IllegalArgumentException(\n \"The value for the length argument must be between 0 and 16777215 inclusive.\");\n }\n\n this.formatCode = formatCode;\n this.lengthInBytes = lengthInBytes;\n outboundNumberOfLengthBytes = calculateMinimumNumberOfLengthBytes(lengthInBytes);\n }", "java.util.List<com.google.protobuf.ByteString> getCertificateList();", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public MEKeyTool(File meKeystoreFile)\n throws FileNotFoundException, IOException {\n\n FileInputStream input;\n\n input = new FileInputStream(meKeystoreFile);\n\n try {\n keystore = new PublicKeyStoreBuilderBase(input);\n } finally {\n input.close();\n }\n }", "private SSLContext createSSLContext() throws KeyStoreException,\n NoSuchAlgorithmException, KeyManagementException, IOException, CertificateException {\n TrustManager localTrustManager = new X509TrustManager() {\n @Override\n public X509Certificate[] getAcceptedIssuers() {\n System.out.println(\"X509TrustManager#getAcceptedIssuers\");\n return new X509Certificate[]{};\n }\n\n @Override\n public void checkServerTrusted(X509Certificate[] chain,\n String authType) throws CertificateException {\n System.out.println(\"X509TrustManager#checkServerTrusted\");\n }\n\n @Override\n public void checkClientTrusted(X509Certificate[] chain,\n String authType) throws CertificateException {\n System.out.println(\"X509TrustManager#checkClientTrusted\");\n }\n };\n\n\n SSLContext sslContext = SSLContext.getInstance(\"TLS\");\n sslContext.init(null, new TrustManager[]{localTrustManager}, new SecureRandom());\n\n return sslContext;\n }", "private static ConfigDocumentContext createConfigurationContext(String resource) \n throws LifecycleException \n {\n try {\n Object contextBean = null;\n URL configUrl = Thread.currentThread().getContextClassLoader().getResource(resource);\n if( configUrl == null ) {\n // we can't find the config so we just an instance of Object for the ConfigDocumentContext.\n if( log.isDebugEnabled() )\n log.debug(\"Cannot find configuration at resource '\"+resource+\"'.\");\n contextBean = new Object();\n } else {\n // we have a config, create a DOM out of it and use it for the ConfigDocumentContext.\n if( log.isDebugEnabled() ) {\n log.debug(\"Loading xchain config file for url: \"+configUrl.toExternalForm());\n }\n \n // get the document builder.\n DocumentBuilder documentBuilder = XmlFactoryLifecycle.newDocumentBuilder();\n \n InputSource configInputSource = UrlSourceUtil.createSaxInputSource(configUrl);\n Document document = documentBuilder.parse(configInputSource);\n contextBean = document;\n }\n // create the context\n ConfigDocumentContext configDocumentContext = new ConfigDocumentContext(null, contextBean, Scope.chain);\n configDocumentContext.setConfigUrl(configUrl);\n configDocumentContext.setLenient(true);\n return configDocumentContext;\n } catch( Exception e ) {\n throw new LifecycleException(\"Error loading configuration from resource '\"+resource+\"'.\", e);\n }\n }", "public static X509Certificate readCertificate(BufferedReader reader)\n throws IOException, GeneralSecurityException {\n String line;\n StringBuffer buff = new StringBuffer();\n boolean isCert = false;\n boolean isKey = false;\n boolean notNull = false;\n while ((line = reader.readLine()) != null) {\n // Skip key info, if any\n if (line.indexOf(\"BEGIN RSA PRIVATE KEY\") != -1 ||\n line.indexOf(\"BEGIN PRIVATE KEY\") != -1) {\n isKey = true;\n continue;\n } else if (isKey && (line.indexOf(\"END RSA PRIVATE KEY\") != -1 ||\n line.indexOf(\"END PRIVATE KEY\") != -1)) {\n isKey = false;\n continue;\n } else if (isKey)\n continue;\n\n notNull = true;\n if (line.indexOf(\"BEGIN CERTIFICATE\") != -1) {\n isCert = true;\n } else if (isCert && line.indexOf(\"END CERTIFICATE\") != -1) {\n byte[] data = Base64.decode(buff.toString().getBytes());\n return loadCertificate(new ByteArrayInputStream(data));\n } else if (isCert) {\n buff.append(line);\n }\n }\n if (notNull && !isCert) {\n throw new GeneralSecurityException(\n \"Certificate needs to start with \"\n + \" BEGIN CERTIFICATE\");\n }\n return null;\n }", "public PrivateKey readPrivateKeyFromPem(File file) {\n FileReader reader = null;\n PEMParser parser = null;\n try {\n reader = new FileReader(file);\n parser = new PEMParser(reader);\n PrivateKeyInfo keyInfo = (PrivateKeyInfo) parser.readObject();\n return new JcaPEMKeyConverter().getPrivateKey(keyInfo);\n } catch (RuntimeException | IOException e) {\n throw new RuntimeException(\"Failed to load private key from [\"+file+\"]\", e);\n } finally {\n \tCloseablesExt.closeQuietly(parser);\n \tCloseablesExt.closeQuietly(reader);\n }\n }", "public abstract String doPreBatch(final X509Certificate[] certChain) throws BatchException;", "public StorageOld(String Type, String Body) throws Exception {\n\t\tthis.FileName = CA_CERT;\n\t\tthis.Type = Type;\n\t\tthis.Body = Body;\n\t}", "public Builder setContextBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n context_ = value;\n onChanged();\n return this;\n }", "public T useTransportSecurity(InputStream certChain, InputStream privateKey) {\n throw new UnsupportedOperationException();\n }", "private static void doCACertVerification(final IHealthCard cardInt, final IHealthCard cardExt,\n final CardFileSystemData cardExtFs) {\n result = result.flatMap(__ -> new ReadCommand(cardExtFs.cvcCASfid, 0).executeOn(cardExt))\n .validate(Response.ResponseStatus.SUCCESS::validateResult)\n .map(Response::getResponseData)\n .map(GemCvCertificate::new)\n .flatMap(caCertificateFromExt -> new ManageSecurityEnvironmentCommand(\n ManageSecurityEnvironmentCommand.MseUseCase.KEY_SELECTION_FOR_CV_CERTIFICATE_VALIDATION, caCertificateFromExt)\n .executeOn(cardInt)\n .validate(Response.ResponseStatus.SUCCESS::validateResult)\n .flatMap(__ -> new PsoVerifyCertificateCommand(caCertificateFromExt)\n .executeOn(cardInt)\n .validate(Response.ResponseStatus.SUCCESS::validateResult)));\n }", "public static MyFileContext create() {\n\t\treturn new MyContextImpl();\n\t}", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "protected static String getCertificatePath() {\n return certificatePath;\n }", "private SslContext buildServerSslContext()\n throws SSLException\n {\n SslContextBuilder builder = SslContextBuilder.forServer(certFile, keyFile);\n if (verifyMode == VerifyMode.NO_VERIFY) {\n builder.trustManager(InsecureTrustManagerFactory.INSTANCE);\n } else {\n builder.trustManager(caFile);\n }\n if (verifyMode == VerifyMode.VERIFY) {\n builder.clientAuth(ClientAuth.OPTIONAL);\n } else if (verifyMode == VerifyMode.VERIFY_REQ_CLIENT_CERT) {\n builder.clientAuth(ClientAuth.REQUIRE);\n }\n return builder.build();\n }", "public SSLContext mo12551a() {\n try {\n CertificateFactory instance = CertificateFactory.getInstance(\"X.509\");\n TrustManagerFactory instance2 = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());\n KeyStore instance3 = KeyStore.getInstance(KeyStore.getDefaultType());\n instance3.load(null, null);\n instance3.setCertificateEntry(\"DigiCertGlobalRootCA\", (X509Certificate) instance.generateCertificate(new BufferedInputStream(getClass().getClassLoader().getResourceAsStream(\"com/clevertap/android/sdk/certificates/DigiCertGlobalRootCA.crt\"))));\n instance3.setCertificateEntry(\"DigiCertSHA2SecureServerCA\", (X509Certificate) instance.generateCertificate(new BufferedInputStream(getClass().getClassLoader().getResourceAsStream(\"com/clevertap/android/sdk/certificates/DigiCertSHA2SecureServerCA.crt\"))));\n instance2.init(instance3);\n SSLContext instance4 = SSLContext.getInstance(\"TLS\");\n instance4.init(null, instance2.getTrustManagers(), null);\n C3111h1.m14930d(\"SSL Context built\");\n return instance4;\n } catch (Throwable th) {\n C3111h1.m14937e(\"Error building SSL Context\", th);\n return null;\n }\n }", "public ResponseCtx evaluate(final String requestFile) throws ParsingException, WebserverSystemException,\r\n FileNotFoundException {\r\n\r\n if (this.pdp == null) {\r\n init();\r\n }\r\n\r\n // setup the request based on the file\r\n final RequestCtx request = RequestCtx.getInstance(new FileInputStream(requestFile));\r\n\r\n // evaluate the request\r\n return pdp.evaluate(request);\r\n }", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public String getUserCertificatesPath();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public ValidationContext buildValidationContext() {\n return validationContextObjectFactory.getObject();\n }", "public Builder addCertificate(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.addCertificate(value);\n return this;\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public interface CSRCreator {\n byte[] createCSR(CertificateInfo certificateInfo);\n}", "List<Certificate> getCertificatesById(@NonNull String certificateId, String sha256Thumbprint);", "public CMProps(String filename) {\n final char c = Thread.currentThread().getThreadGroup().getName().charAt(0);\n if (props[c] == null)\n props[c] = this;\n try {\n final CMFile F = new CMFile(filename, null);\n if (F.exists()) {\n this.load(new ByteArrayInputStream(F.textUnformatted().toString().getBytes()));\n loaded = true;\n } else\n loaded = false;\n } catch (final IOException e) {\n loaded = false;\n }\n }" ]
[ "0.7474138", "0.53416544", "0.5284994", "0.51318645", "0.47603047", "0.45531023", "0.45502505", "0.45317042", "0.45222408", "0.44545093", "0.4445764", "0.44305614", "0.43665382", "0.4363274", "0.4307463", "0.43048468", "0.42949504", "0.4292582", "0.42780608", "0.42624116", "0.42623284", "0.42573544", "0.4251093", "0.42218864", "0.42176595", "0.42162222", "0.4197346", "0.4196802", "0.41695392", "0.41555437", "0.4144801", "0.4140422", "0.41095406", "0.41055313", "0.41033196", "0.41001567", "0.4099838", "0.40913057", "0.40627345", "0.40618142", "0.4053944", "0.40528777", "0.40452924", "0.40428537", "0.4035532", "0.403207", "0.40013188", "0.40012997", "0.3999873", "0.39939773", "0.3985847", "0.39825103", "0.39808872", "0.39740583", "0.39665544", "0.39465883", "0.39407757", "0.39347064", "0.39337948", "0.39271963", "0.39259207", "0.3925089", "0.39122123", "0.39084113", "0.39081293", "0.3894174", "0.3888448", "0.3884343", "0.38836244", "0.3863474", "0.38623896", "0.38567612", "0.3848551", "0.38453773", "0.38428926", "0.3841946", "0.38388342", "0.38387346", "0.38363656", "0.38225177", "0.3815195", "0.3813066", "0.38123265", "0.3809739", "0.379548", "0.37878844", "0.378541", "0.3783013", "0.378296", "0.37817794", "0.37770307", "0.37767816", "0.37707257", "0.376807", "0.37679538", "0.37664565", "0.37637308", "0.37535274", "0.37503538", "0.375026" ]
0.8407006
0
Constructor with specified initial values
public Product(String id, String name, String description) { this.id = id; this.name = name; this.description = description; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ConstructorsDemo() \n\t {\n\t x = 5; // Set the initial value for the class attribute x\n\t }", "public InitialData(){}", "public void init(Object[] initialParams) {\n\t \n\t}", "public Initialization()\r\n {\r\n C.cinit();\r\n init(\"2\",0);\r\n \r\n init(\"2\",1);\r\n \r\n init(\"4\",2);\r\n init(\"4\",3);\r\n init(\"4\",4);//ss\r\n init(\"6\",5);\r\n init(\"6\",6);\r\n init(\"6\",7); //ss\r\n init(\"8\",8);\r\n init(\"8\",9);\r\n init(\"8\",10);//ss4 7 10\r\n }", "Constructor() {\r\n\t\t \r\n\t }", "public Constructor(){\n\t\t\n\t}", "defaultConstructor(){}", "public void init() {\n\t\tinit(\"1,0 3,0 5,0 7,0 9,0 0,1 2,1 4,1 6,1 8,1 1,2 3,2 5,2 7,2 9,2 0,3 2,3 4,3 6,3 8,3\", \n\t\t\t \"1,6 3,6 5,6 7,6 9,6 0,7 2,7 4,7 6,7 8,7 1,8 3,8 5,8 7,8 9,8 0,9 2,9 4,9 6,9 8,9\"); \n }", "private void initValues() {\n \n }", "public Student() {\n//\t\tname = \"\";\n//\t\tage = 0;\n\t\t\n\t\t\n\t\t//call constructors inside of other constructors\n\t\tthis(999,0);\n\t}", "public void initializeDefault() {\n\t\tthis.numAuthorsAtStart = 5;\n\t\tthis.numPublicationsAtStart = 20;\n\t\tthis.numCreationAuthors = 0;\n\t\tthis.numCreationYears = 10;\n\n\t\tyearInformation = new DefaultYearInformation();\n\t\tyearInformation.initializeDefault();\n\t\tpublicationParameters = new DefaultPublicationParameters();\n\t\tpublicationParameters.initializeDefault();\n\t\tpublicationParameters.setYearInformation(yearInformation);\n\t\tauthorParameters = new DefaultAuthorParameters();\n\t\tauthorParameters.initializeDefault();\n\t\ttopicParameters = new DefaultTopicParameters();\n\t\ttopicParameters.initializeDefault();\n\t}", "private Instantiation(){}", "DefaultConstructor(int a){}", "public AllDifferent()\n {\n this(0);\n }", "public Test05() {\n this(0);\n n2 = \"n2\";\n n4 = \"n4\";\n }", "public Employee(){\r\n this(\"\", \"\", \"\", 0, \"\", 0.0);\r\n }", "public void initDefaultValues() {\n }", "public InitialState() {\r\n\t\t}", "public void init(Object[] parameters) {\n\n\t}", "public Card() { this(12, 3); }", "private Values(){}", "@Override\n\tpublic void initializeValues() {\n\n\t}", "public void initialiser() {\n double inf = Double.POSITIVE_INFINITY;\n create_add(\"bagel\", 20, 8);\n create_add(\"burger\", 10, 10);\n create_add(\"smoothie\", 30, 5);\n create_add(\"café\", (int)inf, 2);\n }", "@Override\n\t\tpublic void init() {\n\t\t}", "public MyPractice()\n\t{\n\t\t//Unless we specify values all data members\n\t\t//are a zero, false, or null\n\t}", "public BaseParameters(){\r\n\t}", "@Override\n\t\tprotected void initialise() {\n\n\t\t}", "public void initialize() {\r\n\t\tsetValue(initialValue);\r\n\t}", "public Account() {\n this(0, 0.0, \"Unknown name\"); // Invole the 2-param constructor\n }", "public Parameters() {\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public Zeffit()\n {\n // TODO: initialize instance variable(s)\n }", "@Override public void init()\n\t\t{\n\t\t}", "@Override\r\n\tpublic final void init() {\r\n\r\n\t}", "public void initialize() {\n\t\tinitialize(seedValue0, seedValue1);\n\t}", "void DefaultConstructor(){}", "private FullyObservableProblem(int[] initialValuation,\n\t\t\tExplicitCondition goal, ArrayList<String> variableNames,\n\t\t\tList<List<String>> propositionNames,\n\t\t\tArrayList<Integer> domainSizes, ArrayList<Integer> axiomLayer,\n\t\t\tArrayList<Integer> defaultAxiomValues,\n\t\t\tLinkedHashSet<Operator> causativeOperators, Set<OperatorRule> axioms)\n\t{\n\t\tsuper(goal, variableNames, propositionNames, domainSizes, axiomLayer,\n\t\t\t\tdefaultAxiomValues, causativeOperators, axioms, true);\n\t\tGlobal.problem = this;\n\t\tperformSanityCheck();\n\t\tList<Integer> defaultValues = new ArrayList<Integer>();\n\t\tfor (int i = 0; i < initialValuation.length; i++)\n\t\t{\n\t\t\tdefaultValues.add(i, initialValuation[i]);\n\t\t}\n\t\texplicitAxiomEvaluator = new ExplicitAxiomEvaluator();\n\t\tinitialState = new ExplicitState(initialValuation,\n\t\t\t\texplicitAxiomEvaluator);\n\t}", "public Car() {\r\n this(\"\", \"\", \"\", 0, Category.EMPTY, 0.00, \"\", 0, \"\", 0.00, \"\", DriveTrain.EMPTY,\r\n Aspiration.EMPTY, 0.00, 0.00, 0.00, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0);\r\n }", "@Override\r\n\tprotected void init() {\n\t\tupdateValues();\r\n\t}", "public Pitonyak_09_02() {\r\n }", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "@Override\n\tpublic void initValue() {\n\t\t\n\t}", "public Counter(int init){\n \tvalue = init;\n }", "@Test\n public void goalCustomConstructor_isCorrect() throws Exception {\n\n int goalId = 11;\n int userId = 1152;\n String name = \"Test Name\";\n int timePeriod = 1;\n int unit = 2;\n double amount = 1000.52;\n\n\n //Create goal\n Goal goal = new Goal(goalId, userId, name, timePeriod, unit, amount);\n\n // Verify Values\n assertEquals(goalId, goal.getGoalId());\n assertEquals(userId, goal.getUserId());\n assertEquals(name, goal.getGoalName());\n assertEquals(timePeriod, goal.getTimePeriod());\n assertEquals(unit, goal.getUnit());\n assertEquals(amount, goal.getAmount(),0);\n }", "public void testConstructor1() {\n XIntervalDataItem item1 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0);\n }", "public IntArrays()\n\t{\n\t\tthis(10);\n\t}", "public CMN() {\n\t}", "public void init() {\n \n }", "public BabbleValue() {}", "public Car () {\n\n Make = \"\";\n Model = \"\";\n Year = 2017;\n Price = 0.00;\n }", "@objid (\"4bb3363c-38e1-48f1-9894-6dceea1f8d66\")\n public void init() {\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {}", "public Stack() {\r\n this(20);\r\n }", "public void init(){}", "public Contructor(int year, String name) {\n // constructor name must match class name and cannot have return type\n // all classes have constructor by default\n // f you do not create a class constructor yourself, Java creates one for you.\n // However, then you are not able to set initial values for object attributes.\n // constructor can also take parameters\n batchYear = year;\n studentName = name;\n }", "public void init() {}", "public void init() {}", "ConstructorPractice () {\n\t\tSystem.out.println(\"Default Constructor\");\n\t}", "public void init() {\n\t\t}", "@Test\n public void billCustomConstructor_isCorrect() throws Exception {\n\n int billId = 100;\n String billName = \"test Bill\";\n int userId = 101;\n int accountId = 202;\n double billAmount = 300.25;\n String dueDate = \"02/02/2018\";\n int occurrenceRte = 1;\n\n //Create empty bill\n Bill bill = new Bill(billId,userId,accountId,billName,billAmount,dueDate,occurrenceRte);\n\n // Verify Values\n assertEquals(billId, bill.getBillId());\n assertEquals(billName, bill.getBillName());\n assertEquals(userId, bill.getUserId());\n assertEquals(accountId, bill.getAccountId());\n assertEquals(billAmount, bill.getBillAmount(), 0);\n assertEquals(dueDate, bill.getDueDate());\n assertEquals(occurrenceRte, bill.getOccurrenceRte());\n }", "public void init() { }", "public void init() { }", "private void __sep__Constructors__() {}", "public Bank(){\n this(\"Seneca@York\", 0);\n }", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "public void init() {\n\t\n\t}", "public void init() {\r\n\r\n\t}", "@Test\n public void constructor(){\n /**Positive tests*/\n Road road = new Road(cityA, cityB, 4);\n assertEquals(road.getFrom(), cityA);\n assertEquals(road.getTo(), cityB);\n assertEquals(road.getLength(), 4);\n }", "public DepictionParameters() {\n this(200, 150, true, DEFAULT_BACKGROUND);\n }", "public Demo3() {}", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "public Riddle(String initQuestion, String initAnswer)\n {\n // set the instance variables to the init parameter variables\n\n }", "public Identity()\n {\n super( Fields.ARGS );\n }", "public void init() {\r\n\t\t// to override\r\n\t}", "Employees() { \r\n\t\t this(100,\"Hari\",\"TestLeaf\");\r\n\t\t System.out.println(\"default Constructor\"); \r\n\t }", "public BankAccount() {\n this(12346, 5.00, \"Default Name\", \"Default Address\", \"default phone\");\n }", "public void init() {\n\t\t\n\t}", "private void init() {\n\n\t}", "public Log() { //Null constructor is adequate as all values start at zero\n\t}", "public Person() {\n\t\tname \t= \"\";\n\t\taddress = \"\";\n\t\tcity \t= \"\";\n\t\tage \t= 0;\n\t}", "public ContasCorrentes(){\n this(0,\"\",0.0,0.0,0);\n }", "Reproducible newInstance();", "public void initialize(Hashtable args) {\r\n addPort(east = new SamplePort2(this));\r\n addPort(west = new SamplePort2(this));\r\n addPort(north = new SamplePort(this));\r\n addPort(south = new SamplePort(this));\r\n System.err.println(\"inicializado nodo SampleNode ;)\");\r\n _number = _NextNumber++;\r\n }", "public Student (String first, String last)\n {\n firstName = first;\n lastName = last;\n testScore1 = 0;\n testScore2 = 0;\n testScore3 = 0;\n }", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "private ARXDate() {\r\n this(\"Default\");\r\n }", "public Student() {\r\n\t\t\r\n\t\t//populating country options\r\n\t\t//can also be done using a properties file\r\n\t\t\r\n\t\t/*\r\n\t\t * countryOptions = new LinkedHashMap<String, String>();\r\n\t\t * \r\n\t\t * countryOptions.put(\"BR\", \"Brazil\"); countryOptions.put(\"IN\", \"India\");\r\n\t\t * countryOptions.put(\"US\", \"United States\"); countryOptions.put(\"CA\",\r\n\t\t * \"Canada\");\r\n\t\t */\r\n\t\t\r\n\t\t\r\n\t}", "public Watch(){ //Watch Constuctor\r\n super(); //Values passed in from the super class\r\n month = 1; //Initialize month to 1\r\n day = 1; //Initialize day to 1\r\n year = 1980; //Initialize year to 1980\r\n}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}" ]
[ "0.67586315", "0.6732957", "0.6700343", "0.6582033", "0.6577564", "0.6533861", "0.6451989", "0.64434546", "0.6440125", "0.638089", "0.6312323", "0.6276497", "0.6258018", "0.6253083", "0.62529725", "0.62525135", "0.6252151", "0.6190911", "0.6179333", "0.6179225", "0.6168912", "0.6160071", "0.615243", "0.6146855", "0.613588", "0.61347854", "0.61170846", "0.6117024", "0.61164266", "0.610246", "0.6100903", "0.6094768", "0.60908765", "0.6065384", "0.6063292", "0.60590625", "0.60443455", "0.6044127", "0.6027519", "0.60122013", "0.5996323", "0.5993039", "0.5988646", "0.5978722", "0.59763676", "0.59605503", "0.5956605", "0.5947026", "0.5946372", "0.5945132", "0.5944005", "0.59436715", "0.59436715", "0.59436715", "0.5937353", "0.59347534", "0.5933788", "0.5928569", "0.5922017", "0.5922017", "0.5915646", "0.5915514", "0.5902188", "0.58965236", "0.58965236", "0.5893848", "0.5889649", "0.58884966", "0.58884966", "0.58884966", "0.588651", "0.58859473", "0.588453", "0.58834827", "0.5883042", "0.588304", "0.5875334", "0.5875334", "0.5875334", "0.5875334", "0.5867458", "0.5866692", "0.5866685", "0.5865862", "0.5861739", "0.5855525", "0.5854724", "0.58546185", "0.5854173", "0.5848622", "0.5839719", "0.58352214", "0.58287436", "0.5826937", "0.5826937", "0.5826937", "0.582675", "0.5816508", "0.5815346", "0.5810937", "0.5810937" ]
0.0
-1
Creates a table model for closed patterns mined from byte sequences
public ClosedPatternTableModel(List<ClosedPatternRowObject> rowObjects, ServiceProvider serviceProvider) { super(MODEL_NAME, serviceProvider); this.rowObjects = rowObjects; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "HdbSequenceModel createHdbSequenceModel();", "Table8 create(Table8 table8);", "HdbSequenceElements createHdbSequenceElements();", "ByteDataTable()\n\t{\n\t\tsuper();\n\n\t\tdouble cellWidth = WIDEST_BYTE_STRING.getBoundsInLocal().getWidth();\n\t\tArrayList<TableColumn<Row, String>> columns = new ArrayList<TableColumn<Row, String>>();\n\t\tfor (int i = 0; i < NUM_COLUMNS; ++i) {\n\t\t\tTableColumn<Row, String> col = new TableColumn<Row, String>(COLUMN_HEADINGS[i]);\n\t\t \tcol.setCellValueFactory(new HexTableCell(\"columns\", i));\n\t\t\tcol.setPrefWidth(cellWidth);\n\t\t\tcolumns.add(col);\n \t\t}\n\n\t\tsetColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);\n\t\tgetColumns().setAll(columns);\n\t}", "FromTable createFromTable();", "BTable createBTable();", "@androidx.room.Dao()\[email protected](mv = {1, 4, 0}, bv = {1, 0, 3}, k = 1, d1 = {\"\\u00006\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0010\\u0000\\n\\u0000\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0000\\n\\u0002\\u0010\\b\\n\\u0002\\b\\u0003\\n\\u0002\\u0010\\u000e\\n\\u0002\\b\\u0002\\n\\u0002\\u0010\\u0002\\n\\u0000\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\t\\bg\\u0018\\u00002\\u00020\\u0001J\\u0013\\u0010\\u0002\\u001a\\u0004\\u0018\\u00010\\u0003H\\u00a7@\\u00f8\\u0001\\u0000\\u00a2\\u0006\\u0002\\u0010\\u0004J\\u001b\\u0010\\u0005\\u001a\\u0004\\u0018\\u00010\\u00062\\u0006\\u0010\\u0007\\u001a\\u00020\\bH\\u00a7@\\u00f8\\u0001\\u0000\\u00a2\\u0006\\u0002\\u0010\\tJ\\u001b\\u0010\\n\\u001a\\u0004\\u0018\\u00010\\u00062\\u0006\\u0010\\u000b\\u001a\\u00020\\fH\\u00a7@\\u00f8\\u0001\\u0000\\u00a2\\u0006\\u0002\\u0010\\rJ\\u0019\\u0010\\u000e\\u001a\\u00020\\u000f2\\u0006\\u0010\\u0010\\u001a\\u00020\\u0011H\\u00a7@\\u00f8\\u0001\\u0000\\u00a2\\u0006\\u0002\\u0010\\u0012J\\u0019\\u0010\\u0013\\u001a\\u00020\\u000f2\\u0006\\u0010\\u0014\\u001a\\u00020\\u0003H\\u0097@\\u00f8\\u0001\\u0000\\u00a2\\u0006\\u0002\\u0010\\u0015J\\u0019\\u0010\\u0016\\u001a\\u00020\\u000f2\\u0006\\u0010\\u0017\\u001a\\u00020\\u0006H\\u00a7@\\u00f8\\u0001\\u0000\\u00a2\\u0006\\u0002\\u0010\\u0018J\\u0019\\u0010\\u0019\\u001a\\u00020\\u000f2\\u0006\\u0010\\u0017\\u001a\\u00020\\u0006H\\u00a7@\\u00f8\\u0001\\u0000\\u00a2\\u0006\\u0002\\u0010\\u0018\\u0082\\u0002\\u0004\\n\\u0002\\b\\u0019\\u00a8\\u0006\\u001a\"}, d2 = {\"Lcom/hend/movieschallenge/persistence/MovieDao;\", \"\", \"get\", \"Lcom/hend/movieschallenge/persistence/dbmodels/DBMovie;\", \"(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;\", \"getMovieEntityById\", \"Lcom/hend/movieschallenge/persistence/dbmodels/MovieEntity;\", \"id\", \"\", \"(ILkotlin/coroutines/Continuation;)Ljava/lang/Object;\", \"getMovieEntityByTitle\", \"title\", \"\", \"(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;\", \"insert\", \"\", \"movieData\", \"Lcom/hend/movieschallenge/persistence/dbmodels/MovieData;\", \"(Lcom/hend/movieschallenge/persistence/dbmodels/MovieData;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;\", \"insertDBMovie\", \"dbMovie\", \"(Lcom/hend/movieschallenge/persistence/dbmodels/DBMovie;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;\", \"insertMovie\", \"movieEntity\", \"(Lcom/hend/movieschallenge/persistence/dbmodels/MovieEntity;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;\", \"update\", \"app_debug\"})\npublic abstract interface MovieDao {\n \n @org.jetbrains.annotations.Nullable()\n @androidx.room.Insert(onConflict = androidx.room.OnConflictStrategy.REPLACE)\n public abstract java.lang.Object insert(@org.jetbrains.annotations.NotNull()\n com.hend.movieschallenge.persistence.dbmodels.MovieData movieData, @org.jetbrains.annotations.NotNull()\n kotlin.coroutines.Continuation<? super kotlin.Unit> p1);\n \n @org.jetbrains.annotations.Nullable()\n @androidx.room.Insert(onConflict = androidx.room.OnConflictStrategy.REPLACE)\n public abstract java.lang.Object insertMovie(@org.jetbrains.annotations.NotNull()\n com.hend.movieschallenge.persistence.dbmodels.MovieEntity movieEntity, @org.jetbrains.annotations.NotNull()\n kotlin.coroutines.Continuation<? super kotlin.Unit> p1);\n \n @org.jetbrains.annotations.Nullable()\n @androidx.room.Update(onConflict = androidx.room.OnConflictStrategy.REPLACE)\n public abstract java.lang.Object update(@org.jetbrains.annotations.NotNull()\n com.hend.movieschallenge.persistence.dbmodels.MovieEntity movieEntity, @org.jetbrains.annotations.NotNull()\n kotlin.coroutines.Continuation<? super kotlin.Unit> p1);\n \n @org.jetbrains.annotations.Nullable()\n @androidx.room.Transaction()\n public abstract java.lang.Object insertDBMovie(@org.jetbrains.annotations.NotNull()\n com.hend.movieschallenge.persistence.dbmodels.DBMovie dbMovie, @org.jetbrains.annotations.NotNull()\n kotlin.coroutines.Continuation<? super kotlin.Unit> p1);\n \n @org.jetbrains.annotations.Nullable()\n @androidx.room.Query(value = \"SELECT * FROM MovieData LIMIT 1\")\n @androidx.room.Transaction()\n public abstract java.lang.Object get(@org.jetbrains.annotations.NotNull()\n kotlin.coroutines.Continuation<? super com.hend.movieschallenge.persistence.dbmodels.DBMovie> p0);\n \n @org.jetbrains.annotations.Nullable()\n @androidx.room.Query(value = \"SELECT * FROM MovieEntity WHERE id = :id LIMIT 1\")\n @androidx.room.Transaction()\n public abstract java.lang.Object getMovieEntityById(int id, @org.jetbrains.annotations.NotNull()\n kotlin.coroutines.Continuation<? super com.hend.movieschallenge.persistence.dbmodels.MovieEntity> p1);\n \n @org.jetbrains.annotations.Nullable()\n @androidx.room.Query(value = \"SELECT * FROM MovieEntity WHERE title = :title LIMIT 1\")\n @androidx.room.Transaction()\n public abstract java.lang.Object getMovieEntityByTitle(@org.jetbrains.annotations.NotNull()\n java.lang.String title, @org.jetbrains.annotations.NotNull()\n kotlin.coroutines.Continuation<? super com.hend.movieschallenge.persistence.dbmodels.MovieEntity> p1);\n \n /**\n * Contains all queries required on database\n */\n @kotlin.Metadata(mv = {1, 4, 0}, bv = {1, 0, 3}, k = 3)\n public final class DefaultImpls {\n \n @org.jetbrains.annotations.Nullable()\n @androidx.room.Transaction()\n public static java.lang.Object insertDBMovie(@org.jetbrains.annotations.NotNull()\n com.hend.movieschallenge.persistence.MovieDao $this, @org.jetbrains.annotations.NotNull()\n com.hend.movieschallenge.persistence.dbmodels.DBMovie dbMovie, @org.jetbrains.annotations.NotNull()\n kotlin.coroutines.Continuation<? super kotlin.Unit> p2) {\n return null;\n }\n }\n}", "private String createSEQTable() {\n\t\tStringBuffer buildSQL = new StringBuffer();\n\t\tbuildSQL.append(\" CREATE TABLE \" + DEFAULT_SEQUENCE_NAME + \" ( \");\n\t\tbuildSQL.append(\"id bigint(20) NOT NULL AUTO_INCREMENT, \");\n\t\tbuildSQL.append(\"prefix_value varchar(12) NOT NULL, \");\n\t\tbuildSQL.append(\"next_val int(11) NOT NULL, \");\n\t\tbuildSQL.append(\"increment int(11) NOT NULL, \");\n\t\tbuildSQL.append(\"PRIMARY KEY (id) \");\n\t\tbuildSQL.append(\") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\");\n\t\t// --log.debug(buildSQL.toString());\n\t\treturn buildSQL.toString();\n\t}", "public static void main(String[] args) {\n RegexParser regexParser = new RegexParser(new File(args[0]));\n regexParser.parseCharClasses();\n regexParser.parseTokens();\n regexParser.buildDFATable();\n // write DFA Table to file\n try {\n BufferedWriter tableWriter = new BufferedWriter(new FileWriter(new File(args[2])));\n for (int i = 0; i < regexParser.dfaTable.tableRows.size(); i++) {\n tableWriter.write(\"State\" + i);\n tableWriter.newLine();\n for (int j = 0; j < 95; j++) {\n //if (regexParser.dfaTable.tableRows.get(i).nextStates[j] != 1) {\n tableWriter.write(\" \" + (char)(j + 32) + \" \" + regexParser.dfaTable.tableRows.get(i).nextStates[j]);\n //}\n }\n tableWriter.newLine();\n }\n tableWriter.newLine();\n tableWriter.write(\"Accept States\");\n tableWriter.newLine();\n for (int j = 0; j < regexParser.dfaTable.tableRows.size(); j++) {\n for (int i = 0; i < regexParser.dfaTable.nfa.acceptStates.size(); i++) {\n if (regexParser.dfaTable.tableRows.get(j).nfaStates.contains(regexParser.dfaTable.nfa.acceptStates.get(i))) {\n tableWriter.write(\" \" + j);\n }\n }\n }\n tableWriter.close();\n }\n catch (Exception e) {\n System.out.println(\"Could not write to table file\");\n System.exit(0);\n }\n TableWalker tw = new TableWalker(regexParser.dfaTable, new File(args[1]), new File(args[3]));\n System.out.println(\"Success! Check your output files!\");\n//Part 2, piece 1: parsing the grammar\n LL1GrammarParser parser = new LL1GrammarParser(new File(args[4]), regexParser.specReader.tokens);\n parser.parseGrammar();\n\n//piece 2/3: first and follow sets \n System.out.println(\"Creating First and Follow Sets: \");\n\n LL1FFSets sets = new LL1FFSets(parser.rules);\n\n System.out.println(\"Working on the Parsing Table\");\n//piece 4/5: LL(1) parsing table and running it. Success/reject message here.\n LL1ParsingTable table = new LL1ParsingTable(sets, regexParser.specReader.tokens,tw.parsedTokens, parser.rules);\n System.out.println(table.run());\n\n\n }", "private static void createEdgeTables() {\n\t\tString line = null;\n\t\tString[] tmpArray;\n\n\t\tfor (int i = 0; i < Data.AmountEdges; i++) {\n\t\t\tline = Fileread.getLine();\n\t\t\ttmpArray = line.split(\" \");\n\t\t\tData.source[i] = Integer.parseInt(tmpArray[0]);\n\t\t\tData.target[i] = Integer.parseInt(tmpArray[1]);\n\t\t\tData.weight[i] = Integer.parseInt(tmpArray[2]);\n\t\t}\n\t}", "@kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u0000T\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0000\\n\\u0002\\u0010\\u000e\\n\\u0002\\b\\u0003\\n\\u0002\\u0010\\t\\n\\u0002\\b\\u0007\\n\\u0002\\u0010\\u000b\\n\\u0002\\b\\u0005\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0003\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0003\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0005\\n\\u0002\\u0010 \\n\\u0002\\b\\u0003\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\n\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0000\\bv\\u0018\\u00002\\u00020\\u0001:\\u0004./01J\\b\\u0010,\\u001a\\u00020\\u000fH&J\\b\\u0010-\\u001a\\u00020\\u000fH&R\\u0014\\u0010\\u0002\\u001a\\u0004\\u0018\\u00010\\u0003X\\u00a6\\u0004\\u00a2\\u0006\\u0006\\u001a\\u0004\\b\\u0004\\u0010\\u0005R\\u0012\\u0010\\u0006\\u001a\\u00020\\u0007X\\u00a6\\u0004\\u00a2\\u0006\\u0006\\u001a\\u0004\\b\\b\\u0010\\tR\\u0014\\u0010\\n\\u001a\\u0004\\u0018\\u00010\\u0003X\\u00a6\\u0004\\u00a2\\u0006\\u0006\\u001a\\u0004\\b\\u000b\\u0010\\u0005R\\u0014\\u0010\\f\\u001a\\u0004\\u0018\\u00010\\u0003X\\u00a6\\u0004\\u00a2\\u0006\\u0006\\u001a\\u0004\\b\\r\\u0010\\u0005R\\u0012\\u0010\\u000e\\u001a\\u00020\\u000fX\\u00a6\\u0004\\u00a2\\u0006\\u0006\\u001a\\u0004\\b\\u000e\\u0010\\u0010R\\u0012\\u0010\\u0011\\u001a\\u00020\\u000fX\\u00a6\\u0004\\u00a2\\u0006\\u0006\\u001a\\u0004\\b\\u0011\\u0010\\u0010R\\u0014\\u0010\\u0012\\u001a\\u0004\\u0018\\u00010\\u0003X\\u00a6\\u0004\\u00a2\\u0006\\u0006\\u001a\\u0004\\b\\u0013\\u0010\\u0005R\\u0014\\u0010\\u0014\\u001a\\u0004\\u0018\\u00010\\u0015X\\u00a6\\u0004\\u00a2\\u0006\\u0006\\u001a\\u0004\\b\\u0016\\u0010\\u0017R\\u0014\\u0010\\u0018\\u001a\\u0004\\u0018\\u00010\\u0019X\\u00a6\\u0004\\u00a2\\u0006\\u0006\\u001a\\u0004\\b\\u001a\\u0010\\u001bR\\u0014\\u0010\\u001c\\u001a\\u0004\\u0018\\u00010\\u001dX\\u00a6\\u0004\\u00a2\\u0006\\u0006\\u001a\\u0004\\b\\u001e\\u0010\\u001fR\\u0014\\u0010 \\u001a\\u0004\\u0018\\u00010\\u0003X\\u00a6\\u0004\\u00a2\\u0006\\u0006\\u001a\\u0004\\b!\\u0010\\u0005R\\u0018\\u0010\\\"\\u001a\\b\\u0012\\u0004\\u0012\\u00020\\u00030#X\\u00a6\\u0004\\u00a2\\u0006\\u0006\\u001a\\u0004\\b$\\u0010%R\\u0014\\u0010&\\u001a\\u0004\\u0018\\u00010\\'X\\u00a6\\u0004\\u00a2\\u0006\\u0006\\u001a\\u0004\\b(\\u0010)R\\u0018\\u0010*\\u001a\\b\\u0012\\u0004\\u0012\\u00020\\u00030#X\\u00a6\\u0004\\u00a2\\u0006\\u0006\\u001a\\u0004\\b+\\u0010%\\u0082\\u0001\\u000223\\u00a8\\u00064\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent;\", \"Lcom/stripe/android/model/StripeModel;\", \"clientSecret\", \"\", \"getClientSecret\", \"()Ljava/lang/String;\", \"created\", \"\", \"getCreated\", \"()J\", \"description\", \"getDescription\", \"id\", \"getId\", \"isConfirmed\", \"\", \"()Z\", \"isLiveMode\", \"lastErrorMessage\", \"getLastErrorMessage\", \"nextActionData\", \"Lcom/stripe/android/model/StripeIntent$NextActionData;\", \"getNextActionData\", \"()Lcom/stripe/android/model/StripeIntent$NextActionData;\", \"nextActionType\", \"Lcom/stripe/android/model/StripeIntent$NextActionType;\", \"getNextActionType\", \"()Lcom/stripe/android/model/StripeIntent$NextActionType;\", \"paymentMethod\", \"Lcom/stripe/android/model/PaymentMethod;\", \"getPaymentMethod\", \"()Lcom/stripe/android/model/PaymentMethod;\", \"paymentMethodId\", \"getPaymentMethodId\", \"paymentMethodTypes\", \"\", \"getPaymentMethodTypes\", \"()Ljava/util/List;\", \"status\", \"Lcom/stripe/android/model/StripeIntent$Status;\", \"getStatus\", \"()Lcom/stripe/android/model/StripeIntent$Status;\", \"unactivatedPaymentMethods\", \"getUnactivatedPaymentMethods\", \"requiresAction\", \"requiresConfirmation\", \"NextActionData\", \"NextActionType\", \"Status\", \"Usage\", \"Lcom/stripe/android/model/PaymentIntent;\", \"Lcom/stripe/android/model/SetupIntent;\", \"payments-core_release\"})\npublic abstract interface StripeIntent extends com.stripe.android.model.StripeModel {\n \n /**\n * Unique identifier for the object.\n */\n @org.jetbrains.annotations.Nullable()\n public abstract java.lang.String getId();\n \n /**\n * Time at which the object was created. Measured in seconds since the Unix epoch.\n */\n public abstract long getCreated();\n \n /**\n * An arbitrary string attached to the object. Often useful for displaying to users.\n */\n @org.jetbrains.annotations.Nullable()\n public abstract java.lang.String getDescription();\n \n /**\n * Has the value true if the object exists in live mode or the value false if the object exists\n * in test mode.\n */\n public abstract boolean isLiveMode();\n \n /**\n * The expanded [PaymentMethod] represented by [paymentMethodId].\n */\n @org.jetbrains.annotations.Nullable()\n public abstract com.stripe.android.model.PaymentMethod getPaymentMethod();\n \n @org.jetbrains.annotations.Nullable()\n public abstract java.lang.String getPaymentMethodId();\n \n /**\n * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use.\n */\n @org.jetbrains.annotations.NotNull()\n public abstract java.util.List<java.lang.String> getPaymentMethodTypes();\n \n @org.jetbrains.annotations.Nullable()\n public abstract com.stripe.android.model.StripeIntent.NextActionType getNextActionType();\n \n @org.jetbrains.annotations.Nullable()\n public abstract java.lang.String getClientSecret();\n \n @org.jetbrains.annotations.Nullable()\n public abstract com.stripe.android.model.StripeIntent.Status getStatus();\n \n @org.jetbrains.annotations.Nullable()\n public abstract com.stripe.android.model.StripeIntent.NextActionData getNextActionData();\n \n /**\n * Whether confirmation has succeeded and all required actions have been handled.\n */\n public abstract boolean isConfirmed();\n \n @org.jetbrains.annotations.Nullable()\n public abstract java.lang.String getLastErrorMessage();\n \n /**\n * Payment types that have not been activated in livemode, but have been activated in testmode.\n */\n @org.jetbrains.annotations.NotNull()\n public abstract java.util.List<java.lang.String> getUnactivatedPaymentMethods();\n \n public abstract boolean requiresAction();\n \n public abstract boolean requiresConfirmation();\n \n /**\n * Type of the next action to perform.\n */\n @kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u0000\\u0012\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0010\\u0010\\n\\u0000\\n\\u0002\\u0010\\u000e\\n\\u0002\\b\\f\\b\\u0086\\u0001\\u0018\\u0000 \\u000e2\\b\\u0012\\u0004\\u0012\\u00020\\u00000\\u0001:\\u0001\\u000eB\\u000f\\b\\u0002\\u0012\\u0006\\u0010\\u0002\\u001a\\u00020\\u0003\\u00a2\\u0006\\u0002\\u0010\\u0004J\\b\\u0010\\u0007\\u001a\\u00020\\u0003H\\u0016R\\u0011\\u0010\\u0002\\u001a\\u00020\\u0003\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\u0005\\u0010\\u0006j\\u0002\\b\\bj\\u0002\\b\\tj\\u0002\\b\\nj\\u0002\\b\\u000bj\\u0002\\b\\fj\\u0002\\b\\r\\u00a8\\u0006\\u000f\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent$NextActionType;\", \"\", \"code\", \"\", \"(Ljava/lang/String;ILjava/lang/String;)V\", \"getCode\", \"()Ljava/lang/String;\", \"toString\", \"RedirectToUrl\", \"UseStripeSdk\", \"DisplayOxxoDetails\", \"AlipayRedirect\", \"BlikAuthorize\", \"WeChatPayRedirect\", \"Companion\", \"payments-core_release\"})\n public static enum NextActionType {\n /*public static final*/ RedirectToUrl /* = new RedirectToUrl(null) */,\n /*public static final*/ UseStripeSdk /* = new UseStripeSdk(null) */,\n /*public static final*/ DisplayOxxoDetails /* = new DisplayOxxoDetails(null) */,\n /*public static final*/ AlipayRedirect /* = new AlipayRedirect(null) */,\n /*public static final*/ BlikAuthorize /* = new BlikAuthorize(null) */,\n /*public static final*/ WeChatPayRedirect /* = new WeChatPayRedirect(null) */;\n @org.jetbrains.annotations.NotNull()\n private final java.lang.String code = null;\n @org.jetbrains.annotations.NotNull()\n public static final com.stripe.android.model.StripeIntent.NextActionType.Companion Companion = null;\n \n NextActionType(java.lang.String code) {\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.lang.String getCode() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public java.lang.String toString() {\n return null;\n }\n \n @kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u0000\\u001a\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0010\\u0000\\n\\u0002\\b\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0000\\n\\u0002\\u0010\\u000e\\n\\u0002\\b\\u0002\\b\\u0080\\u0003\\u0018\\u00002\\u00020\\u0001B\\u0007\\b\\u0002\\u00a2\\u0006\\u0002\\u0010\\u0002J\\u0019\\u0010\\u0003\\u001a\\u0004\\u0018\\u00010\\u00042\\b\\u0010\\u0005\\u001a\\u0004\\u0018\\u00010\\u0006H\\u0000\\u00a2\\u0006\\u0002\\b\\u0007\\u00a8\\u0006\\b\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent$NextActionType$Companion;\", \"\", \"()V\", \"fromCode\", \"Lcom/stripe/android/model/StripeIntent$NextActionType;\", \"code\", \"\", \"fromCode$payments_core_release\", \"payments-core_release\"})\n public static final class Companion {\n \n private Companion() {\n super();\n }\n \n @org.jetbrains.annotations.Nullable()\n public final com.stripe.android.model.StripeIntent.NextActionType fromCode$payments_core_release(@org.jetbrains.annotations.Nullable()\n java.lang.String code) {\n return null;\n }\n }\n }\n \n /**\n * - [The Intent State Machine - Intent statuses](https://stripe.com/docs/payments/intents#intent-statuses)\n * - [PaymentIntent.status API reference](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-status)\n * - [SetupIntent.status API reference](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-status)\n */\n @kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u0000\\u0012\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0010\\u0010\\n\\u0000\\n\\u0002\\u0010\\u000e\\n\\u0002\\b\\r\\b\\u0086\\u0001\\u0018\\u0000 \\u000f2\\b\\u0012\\u0004\\u0012\\u00020\\u00000\\u0001:\\u0001\\u000fB\\u000f\\b\\u0002\\u0012\\u0006\\u0010\\u0002\\u001a\\u00020\\u0003\\u00a2\\u0006\\u0002\\u0010\\u0004J\\b\\u0010\\u0007\\u001a\\u00020\\u0003H\\u0016R\\u0011\\u0010\\u0002\\u001a\\u00020\\u0003\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\u0005\\u0010\\u0006j\\u0002\\b\\bj\\u0002\\b\\tj\\u0002\\b\\nj\\u0002\\b\\u000bj\\u0002\\b\\fj\\u0002\\b\\rj\\u0002\\b\\u000e\\u00a8\\u0006\\u0010\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent$Status;\", \"\", \"code\", \"\", \"(Ljava/lang/String;ILjava/lang/String;)V\", \"getCode\", \"()Ljava/lang/String;\", \"toString\", \"Canceled\", \"Processing\", \"RequiresAction\", \"RequiresConfirmation\", \"RequiresPaymentMethod\", \"Succeeded\", \"RequiresCapture\", \"Companion\", \"payments-core_release\"})\n public static enum Status {\n /*public static final*/ Canceled /* = new Canceled(null) */,\n /*public static final*/ Processing /* = new Processing(null) */,\n /*public static final*/ RequiresAction /* = new RequiresAction(null) */,\n /*public static final*/ RequiresConfirmation /* = new RequiresConfirmation(null) */,\n /*public static final*/ RequiresPaymentMethod /* = new RequiresPaymentMethod(null) */,\n /*public static final*/ Succeeded /* = new Succeeded(null) */,\n /*public static final*/ RequiresCapture /* = new RequiresCapture(null) */;\n @org.jetbrains.annotations.NotNull()\n private final java.lang.String code = null;\n @org.jetbrains.annotations.NotNull()\n public static final com.stripe.android.model.StripeIntent.Status.Companion Companion = null;\n \n Status(java.lang.String code) {\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.lang.String getCode() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public java.lang.String toString() {\n return null;\n }\n \n @kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u0000\\u001a\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0010\\u0000\\n\\u0002\\b\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0000\\n\\u0002\\u0010\\u000e\\n\\u0002\\b\\u0002\\b\\u0080\\u0003\\u0018\\u00002\\u00020\\u0001B\\u0007\\b\\u0002\\u00a2\\u0006\\u0002\\u0010\\u0002J\\u0019\\u0010\\u0003\\u001a\\u0004\\u0018\\u00010\\u00042\\b\\u0010\\u0005\\u001a\\u0004\\u0018\\u00010\\u0006H\\u0000\\u00a2\\u0006\\u0002\\b\\u0007\\u00a8\\u0006\\b\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent$Status$Companion;\", \"\", \"()V\", \"fromCode\", \"Lcom/stripe/android/model/StripeIntent$Status;\", \"code\", \"\", \"fromCode$payments_core_release\", \"payments-core_release\"})\n public static final class Companion {\n \n private Companion() {\n super();\n }\n \n @org.jetbrains.annotations.Nullable()\n public final com.stripe.android.model.StripeIntent.Status fromCode$payments_core_release(@org.jetbrains.annotations.Nullable()\n java.lang.String code) {\n return null;\n }\n }\n }\n \n /**\n * See [setup_intent.usage](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-usage) and\n * [Reusing Cards](https://stripe.com/docs/payments/cards/reusing-cards).\n */\n @kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u0000\\u0012\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0010\\u0010\\n\\u0000\\n\\u0002\\u0010\\u000e\\n\\u0002\\b\\t\\b\\u0086\\u0001\\u0018\\u0000 \\u000b2\\b\\u0012\\u0004\\u0012\\u00020\\u00000\\u0001:\\u0001\\u000bB\\u000f\\b\\u0002\\u0012\\u0006\\u0010\\u0002\\u001a\\u00020\\u0003\\u00a2\\u0006\\u0002\\u0010\\u0004J\\b\\u0010\\u0007\\u001a\\u00020\\u0003H\\u0016R\\u0011\\u0010\\u0002\\u001a\\u00020\\u0003\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\u0005\\u0010\\u0006j\\u0002\\b\\bj\\u0002\\b\\tj\\u0002\\b\\n\\u00a8\\u0006\\f\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent$Usage;\", \"\", \"code\", \"\", \"(Ljava/lang/String;ILjava/lang/String;)V\", \"getCode\", \"()Ljava/lang/String;\", \"toString\", \"OnSession\", \"OffSession\", \"OneTime\", \"Companion\", \"payments-core_release\"})\n public static enum Usage {\n /*public static final*/ OnSession /* = new OnSession(null) */,\n /*public static final*/ OffSession /* = new OffSession(null) */,\n /*public static final*/ OneTime /* = new OneTime(null) */;\n @org.jetbrains.annotations.NotNull()\n private final java.lang.String code = null;\n @org.jetbrains.annotations.NotNull()\n public static final com.stripe.android.model.StripeIntent.Usage.Companion Companion = null;\n \n Usage(java.lang.String code) {\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.lang.String getCode() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public java.lang.String toString() {\n return null;\n }\n \n @kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u0000\\u001a\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0010\\u0000\\n\\u0002\\b\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0000\\n\\u0002\\u0010\\u000e\\n\\u0002\\b\\u0002\\b\\u0080\\u0003\\u0018\\u00002\\u00020\\u0001B\\u0007\\b\\u0002\\u00a2\\u0006\\u0002\\u0010\\u0002J\\u0019\\u0010\\u0003\\u001a\\u0004\\u0018\\u00010\\u00042\\b\\u0010\\u0005\\u001a\\u0004\\u0018\\u00010\\u0006H\\u0000\\u00a2\\u0006\\u0002\\b\\u0007\\u00a8\\u0006\\b\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent$Usage$Companion;\", \"\", \"()V\", \"fromCode\", \"Lcom/stripe/android/model/StripeIntent$Usage;\", \"code\", \"\", \"fromCode$payments_core_release\", \"payments-core_release\"})\n public static final class Companion {\n \n private Companion() {\n super();\n }\n \n @org.jetbrains.annotations.Nullable()\n public final com.stripe.android.model.StripeIntent.Usage fromCode$payments_core_release(@org.jetbrains.annotations.Nullable()\n java.lang.String code) {\n return null;\n }\n }\n }\n \n @kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u0000&\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0007\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0000\\b6\\u0018\\u00002\\u00020\\u0001:\\u0006\\u0003\\u0004\\u0005\\u0006\\u0007\\bB\\u0007\\b\\u0004\\u00a2\\u0006\\u0002\\u0010\\u0002\\u0082\\u0001\\u0006\\t\\n\\u000b\\f\\r\\u000e\\u00a8\\u0006\\u000f\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent$NextActionData;\", \"Lcom/stripe/android/model/StripeModel;\", \"()V\", \"AlipayRedirect\", \"BlikAuthorize\", \"DisplayOxxoDetails\", \"RedirectToUrl\", \"SdkData\", \"WeChatPayRedirect\", \"Lcom/stripe/android/model/StripeIntent$NextActionData$DisplayOxxoDetails;\", \"Lcom/stripe/android/model/StripeIntent$NextActionData$RedirectToUrl;\", \"Lcom/stripe/android/model/StripeIntent$NextActionData$AlipayRedirect;\", \"Lcom/stripe/android/model/StripeIntent$NextActionData$SdkData;\", \"Lcom/stripe/android/model/StripeIntent$NextActionData$BlikAuthorize;\", \"Lcom/stripe/android/model/StripeIntent$NextActionData$WeChatPayRedirect;\", \"payments-core_release\"})\n public static abstract class NextActionData implements com.stripe.android.model.StripeModel {\n \n private NextActionData() {\n super();\n }\n \n @kotlinx.parcelize.Parcelize()\n @kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u00004\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0000\\n\\u0002\\u0010\\b\\n\\u0000\\n\\u0002\\u0010\\u000e\\n\\u0002\\b\\r\\n\\u0002\\u0010\\u000b\\n\\u0000\\n\\u0002\\u0010\\u0000\\n\\u0002\\b\\u0003\\n\\u0002\\u0010\\u0002\\n\\u0000\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0002\\b\\u0087\\b\\u0018\\u00002\\u00020\\u0001B\\'\\u0012\\b\\b\\u0002\\u0010\\u0002\\u001a\\u00020\\u0003\\u0012\\n\\b\\u0002\\u0010\\u0004\\u001a\\u0004\\u0018\\u00010\\u0005\\u0012\\n\\b\\u0002\\u0010\\u0006\\u001a\\u0004\\u0018\\u00010\\u0005\\u00a2\\u0006\\u0002\\u0010\\u0007J\\t\\u0010\\r\\u001a\\u00020\\u0003H\\u00c6\\u0003J\\u000b\\u0010\\u000e\\u001a\\u0004\\u0018\\u00010\\u0005H\\u00c6\\u0003J\\u000b\\u0010\\u000f\\u001a\\u0004\\u0018\\u00010\\u0005H\\u00c6\\u0003J+\\u0010\\u0010\\u001a\\u00020\\u00002\\b\\b\\u0002\\u0010\\u0002\\u001a\\u00020\\u00032\\n\\b\\u0002\\u0010\\u0004\\u001a\\u0004\\u0018\\u00010\\u00052\\n\\b\\u0002\\u0010\\u0006\\u001a\\u0004\\u0018\\u00010\\u0005H\\u00c6\\u0001J\\t\\u0010\\u0011\\u001a\\u00020\\u0003H\\u00d6\\u0001J\\u0013\\u0010\\u0012\\u001a\\u00020\\u00132\\b\\u0010\\u0014\\u001a\\u0004\\u0018\\u00010\\u0015H\\u00d6\\u0003J\\t\\u0010\\u0016\\u001a\\u00020\\u0003H\\u00d6\\u0001J\\t\\u0010\\u0017\\u001a\\u00020\\u0005H\\u00d6\\u0001J\\u0019\\u0010\\u0018\\u001a\\u00020\\u00192\\u0006\\u0010\\u001a\\u001a\\u00020\\u001b2\\u0006\\u0010\\u001c\\u001a\\u00020\\u0003H\\u00d6\\u0001R\\u0011\\u0010\\u0002\\u001a\\u00020\\u0003\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\b\\u0010\\tR\\u0013\\u0010\\u0006\\u001a\\u0004\\u0018\\u00010\\u0005\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\n\\u0010\\u000bR\\u0013\\u0010\\u0004\\u001a\\u0004\\u0018\\u00010\\u0005\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\f\\u0010\\u000b\\u00a8\\u0006\\u001d\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent$NextActionData$DisplayOxxoDetails;\", \"Lcom/stripe/android/model/StripeIntent$NextActionData;\", \"expiresAfter\", \"\", \"number\", \"\", \"hostedVoucherUrl\", \"(ILjava/lang/String;Ljava/lang/String;)V\", \"getExpiresAfter\", \"()I\", \"getHostedVoucherUrl\", \"()Ljava/lang/String;\", \"getNumber\", \"component1\", \"component2\", \"component3\", \"copy\", \"describeContents\", \"equals\", \"\", \"other\", \"\", \"hashCode\", \"toString\", \"writeToParcel\", \"\", \"parcel\", \"Landroid/os/Parcel;\", \"flags\", \"payments-core_release\"})\n public static final class DisplayOxxoDetails extends com.stripe.android.model.StripeIntent.NextActionData {\n \n /**\n * The timestamp after which the OXXO expires.\n */\n private final int expiresAfter = 0;\n \n /**\n * The OXXO number.\n */\n @org.jetbrains.annotations.Nullable()\n private final java.lang.String number = null;\n \n /**\n * URL of a webpage containing the voucher for this OXXO payment.\n */\n @org.jetbrains.annotations.Nullable()\n private final java.lang.String hostedVoucherUrl = null;\n public static final android.os.Parcelable.Creator<com.stripe.android.model.StripeIntent.NextActionData.DisplayOxxoDetails> CREATOR = null;\n \n @org.jetbrains.annotations.NotNull()\n public final com.stripe.android.model.StripeIntent.NextActionData.DisplayOxxoDetails copy(int expiresAfter, @org.jetbrains.annotations.Nullable()\n java.lang.String number, @org.jetbrains.annotations.Nullable()\n java.lang.String hostedVoucherUrl) {\n return null;\n }\n \n @java.lang.Override()\n public boolean equals(@org.jetbrains.annotations.Nullable()\n java.lang.Object other) {\n return false;\n }\n \n @java.lang.Override()\n public int hashCode() {\n return 0;\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public java.lang.String toString() {\n return null;\n }\n \n public DisplayOxxoDetails() {\n super();\n }\n \n public DisplayOxxoDetails(int expiresAfter, @org.jetbrains.annotations.Nullable()\n java.lang.String number, @org.jetbrains.annotations.Nullable()\n java.lang.String hostedVoucherUrl) {\n super();\n }\n \n /**\n * The timestamp after which the OXXO expires.\n */\n public final int component1() {\n return 0;\n }\n \n /**\n * The timestamp after which the OXXO expires.\n */\n public final int getExpiresAfter() {\n return 0;\n }\n \n /**\n * The OXXO number.\n */\n @org.jetbrains.annotations.Nullable()\n public final java.lang.String component2() {\n return null;\n }\n \n /**\n * The OXXO number.\n */\n @org.jetbrains.annotations.Nullable()\n public final java.lang.String getNumber() {\n return null;\n }\n \n /**\n * URL of a webpage containing the voucher for this OXXO payment.\n */\n @org.jetbrains.annotations.Nullable()\n public final java.lang.String component3() {\n return null;\n }\n \n /**\n * URL of a webpage containing the voucher for this OXXO payment.\n */\n @org.jetbrains.annotations.Nullable()\n public final java.lang.String getHostedVoucherUrl() {\n return null;\n }\n \n @java.lang.Override()\n public int describeContents() {\n return 0;\n }\n \n @java.lang.Override()\n public void writeToParcel(@org.jetbrains.annotations.NotNull()\n android.os.Parcel parcel, int flags) {\n }\n \n @kotlin.Metadata(mv = {1, 5, 1}, k = 3)\n public static final class Creator implements android.os.Parcelable.Creator<com.stripe.android.model.StripeIntent.NextActionData.DisplayOxxoDetails> {\n \n public Creator() {\n super();\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public final com.stripe.android.model.StripeIntent.NextActionData.DisplayOxxoDetails createFromParcel(@org.jetbrains.annotations.NotNull()\n android.os.Parcel in) {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public final com.stripe.android.model.StripeIntent.NextActionData.DisplayOxxoDetails[] newArray(int size) {\n return null;\n }\n }\n }\n \n /**\n * Contains instructions for authenticating by redirecting your customer to another\n * page or application.\n */\n @kotlinx.parcelize.Parcelize()\n @kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u0000:\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0000\\n\\u0002\\u0018\\u0002\\n\\u0000\\n\\u0002\\u0010\\u000e\\n\\u0002\\b\\t\\n\\u0002\\u0010\\b\\n\\u0000\\n\\u0002\\u0010\\u000b\\n\\u0000\\n\\u0002\\u0010\\u0000\\n\\u0002\\b\\u0003\\n\\u0002\\u0010\\u0002\\n\\u0000\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0002\\b\\u0087\\b\\u0018\\u00002\\u00020\\u0001B\\u0017\\u0012\\u0006\\u0010\\u0002\\u001a\\u00020\\u0003\\u0012\\b\\u0010\\u0004\\u001a\\u0004\\u0018\\u00010\\u0005\\u00a2\\u0006\\u0002\\u0010\\u0006J\\t\\u0010\\u000b\\u001a\\u00020\\u0003H\\u00c6\\u0003J\\u000b\\u0010\\f\\u001a\\u0004\\u0018\\u00010\\u0005H\\u00c6\\u0003J\\u001f\\u0010\\r\\u001a\\u00020\\u00002\\b\\b\\u0002\\u0010\\u0002\\u001a\\u00020\\u00032\\n\\b\\u0002\\u0010\\u0004\\u001a\\u0004\\u0018\\u00010\\u0005H\\u00c6\\u0001J\\t\\u0010\\u000e\\u001a\\u00020\\u000fH\\u00d6\\u0001J\\u0013\\u0010\\u0010\\u001a\\u00020\\u00112\\b\\u0010\\u0012\\u001a\\u0004\\u0018\\u00010\\u0013H\\u00d6\\u0003J\\t\\u0010\\u0014\\u001a\\u00020\\u000fH\\u00d6\\u0001J\\t\\u0010\\u0015\\u001a\\u00020\\u0005H\\u00d6\\u0001J\\u0019\\u0010\\u0016\\u001a\\u00020\\u00172\\u0006\\u0010\\u0018\\u001a\\u00020\\u00192\\u0006\\u0010\\u001a\\u001a\\u00020\\u000fH\\u00d6\\u0001R\\u0013\\u0010\\u0004\\u001a\\u0004\\u0018\\u00010\\u0005\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\u0007\\u0010\\bR\\u0011\\u0010\\u0002\\u001a\\u00020\\u0003\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\t\\u0010\\n\\u00a8\\u0006\\u001b\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent$NextActionData$RedirectToUrl;\", \"Lcom/stripe/android/model/StripeIntent$NextActionData;\", \"url\", \"Landroid/net/Uri;\", \"returnUrl\", \"\", \"(Landroid/net/Uri;Ljava/lang/String;)V\", \"getReturnUrl\", \"()Ljava/lang/String;\", \"getUrl\", \"()Landroid/net/Uri;\", \"component1\", \"component2\", \"copy\", \"describeContents\", \"\", \"equals\", \"\", \"other\", \"\", \"hashCode\", \"toString\", \"writeToParcel\", \"\", \"parcel\", \"Landroid/os/Parcel;\", \"flags\", \"payments-core_release\"})\n public static final class RedirectToUrl extends com.stripe.android.model.StripeIntent.NextActionData {\n \n /**\n * The URL you must redirect your customer to in order to authenticate.\n */\n @org.jetbrains.annotations.NotNull()\n private final android.net.Uri url = null;\n \n /**\n * If the customer does not exit their browser while authenticating, they will be redirected\n * to this specified URL after completion.\n */\n @org.jetbrains.annotations.Nullable()\n private final java.lang.String returnUrl = null;\n public static final android.os.Parcelable.Creator<com.stripe.android.model.StripeIntent.NextActionData.RedirectToUrl> CREATOR = null;\n \n /**\n * Contains instructions for authenticating by redirecting your customer to another\n * page or application.\n */\n @org.jetbrains.annotations.NotNull()\n public final com.stripe.android.model.StripeIntent.NextActionData.RedirectToUrl copy(@org.jetbrains.annotations.NotNull()\n android.net.Uri url, @org.jetbrains.annotations.Nullable()\n java.lang.String returnUrl) {\n return null;\n }\n \n /**\n * Contains instructions for authenticating by redirecting your customer to another\n * page or application.\n */\n @java.lang.Override()\n public boolean equals(@org.jetbrains.annotations.Nullable()\n java.lang.Object other) {\n return false;\n }\n \n /**\n * Contains instructions for authenticating by redirecting your customer to another\n * page or application.\n */\n @java.lang.Override()\n public int hashCode() {\n return 0;\n }\n \n /**\n * Contains instructions for authenticating by redirecting your customer to another\n * page or application.\n */\n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public java.lang.String toString() {\n return null;\n }\n \n public RedirectToUrl(@org.jetbrains.annotations.NotNull()\n android.net.Uri url, @org.jetbrains.annotations.Nullable()\n java.lang.String returnUrl) {\n super();\n }\n \n /**\n * The URL you must redirect your customer to in order to authenticate.\n */\n @org.jetbrains.annotations.NotNull()\n public final android.net.Uri component1() {\n return null;\n }\n \n /**\n * The URL you must redirect your customer to in order to authenticate.\n */\n @org.jetbrains.annotations.NotNull()\n public final android.net.Uri getUrl() {\n return null;\n }\n \n /**\n * If the customer does not exit their browser while authenticating, they will be redirected\n * to this specified URL after completion.\n */\n @org.jetbrains.annotations.Nullable()\n public final java.lang.String component2() {\n return null;\n }\n \n /**\n * If the customer does not exit their browser while authenticating, they will be redirected\n * to this specified URL after completion.\n */\n @org.jetbrains.annotations.Nullable()\n public final java.lang.String getReturnUrl() {\n return null;\n }\n \n @java.lang.Override()\n public int describeContents() {\n return 0;\n }\n \n @java.lang.Override()\n public void writeToParcel(@org.jetbrains.annotations.NotNull()\n android.os.Parcel parcel, int flags) {\n }\n \n @kotlin.Metadata(mv = {1, 5, 1}, k = 3)\n public static final class Creator implements android.os.Parcelable.Creator<com.stripe.android.model.StripeIntent.NextActionData.RedirectToUrl> {\n \n public Creator() {\n super();\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public final com.stripe.android.model.StripeIntent.NextActionData.RedirectToUrl createFromParcel(@org.jetbrains.annotations.NotNull()\n android.os.Parcel in) {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public final com.stripe.android.model.StripeIntent.NextActionData.RedirectToUrl[] newArray(int size) {\n return null;\n }\n }\n }\n \n @kotlinx.parcelize.Parcelize()\n @kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u0000<\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0000\\n\\u0002\\u0010\\u000e\\n\\u0002\\b\\u0004\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\r\\n\\u0002\\u0010\\b\\n\\u0000\\n\\u0002\\u0010\\u000b\\n\\u0000\\n\\u0002\\u0010\\u0000\\n\\u0002\\b\\u0003\\n\\u0002\\u0010\\u0002\\n\\u0000\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0003\\b\\u0081\\b\\u0018\\u0000 \\\"2\\u00020\\u0001:\\u0001\\\"B#\\b\\u0010\\u0012\\u0006\\u0010\\u0002\\u001a\\u00020\\u0003\\u0012\\u0006\\u0010\\u0004\\u001a\\u00020\\u0003\\u0012\\n\\b\\u0002\\u0010\\u0005\\u001a\\u0004\\u0018\\u00010\\u0003\\u00a2\\u0006\\u0002\\u0010\\u0006B+\\u0012\\u0006\\u0010\\u0002\\u001a\\u00020\\u0003\\u0012\\b\\u0010\\u0007\\u001a\\u0004\\u0018\\u00010\\u0003\\u0012\\u0006\\u0010\\u0004\\u001a\\u00020\\b\\u0012\\n\\b\\u0002\\u0010\\u0005\\u001a\\u0004\\u0018\\u00010\\u0003\\u00a2\\u0006\\u0002\\u0010\\tJ\\t\\u0010\\u0010\\u001a\\u00020\\u0003H\\u00c6\\u0003J\\u000b\\u0010\\u0011\\u001a\\u0004\\u0018\\u00010\\u0003H\\u00c6\\u0003J\\t\\u0010\\u0012\\u001a\\u00020\\bH\\u00c6\\u0003J\\u000b\\u0010\\u0013\\u001a\\u0004\\u0018\\u00010\\u0003H\\u00c6\\u0003J5\\u0010\\u0014\\u001a\\u00020\\u00002\\b\\b\\u0002\\u0010\\u0002\\u001a\\u00020\\u00032\\n\\b\\u0002\\u0010\\u0007\\u001a\\u0004\\u0018\\u00010\\u00032\\b\\b\\u0002\\u0010\\u0004\\u001a\\u00020\\b2\\n\\b\\u0002\\u0010\\u0005\\u001a\\u0004\\u0018\\u00010\\u0003H\\u00c6\\u0001J\\t\\u0010\\u0015\\u001a\\u00020\\u0016H\\u00d6\\u0001J\\u0013\\u0010\\u0017\\u001a\\u00020\\u00182\\b\\u0010\\u0019\\u001a\\u0004\\u0018\\u00010\\u001aH\\u00d6\\u0003J\\t\\u0010\\u001b\\u001a\\u00020\\u0016H\\u00d6\\u0001J\\t\\u0010\\u001c\\u001a\\u00020\\u0003H\\u00d6\\u0001J\\u0019\\u0010\\u001d\\u001a\\u00020\\u001e2\\u0006\\u0010\\u001f\\u001a\\u00020 2\\u0006\\u0010!\\u001a\\u00020\\u0016H\\u00d6\\u0001R\\u0013\\u0010\\u0007\\u001a\\u0004\\u0018\\u00010\\u0003\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\n\\u0010\\u000bR\\u0011\\u0010\\u0002\\u001a\\u00020\\u0003\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\f\\u0010\\u000bR\\u0013\\u0010\\u0005\\u001a\\u0004\\u0018\\u00010\\u0003\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\r\\u0010\\u000bR\\u0011\\u0010\\u0004\\u001a\\u00020\\b\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\u000e\\u0010\\u000f\\u00a8\\u0006#\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent$NextActionData$AlipayRedirect;\", \"Lcom/stripe/android/model/StripeIntent$NextActionData;\", \"data\", \"\", \"webViewUrl\", \"returnUrl\", \"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V\", \"authCompleteUrl\", \"Landroid/net/Uri;\", \"(Ljava/lang/String;Ljava/lang/String;Landroid/net/Uri;Ljava/lang/String;)V\", \"getAuthCompleteUrl\", \"()Ljava/lang/String;\", \"getData\", \"getReturnUrl\", \"getWebViewUrl\", \"()Landroid/net/Uri;\", \"component1\", \"component2\", \"component3\", \"component4\", \"copy\", \"describeContents\", \"\", \"equals\", \"\", \"other\", \"\", \"hashCode\", \"toString\", \"writeToParcel\", \"\", \"parcel\", \"Landroid/os/Parcel;\", \"flags\", \"Companion\", \"payments-core_release\"})\n public static final class AlipayRedirect extends com.stripe.android.model.StripeIntent.NextActionData {\n @org.jetbrains.annotations.NotNull()\n private final java.lang.String data = null;\n @org.jetbrains.annotations.Nullable()\n private final java.lang.String authCompleteUrl = null;\n @org.jetbrains.annotations.NotNull()\n private final android.net.Uri webViewUrl = null;\n @org.jetbrains.annotations.Nullable()\n private final java.lang.String returnUrl = null;\n @org.jetbrains.annotations.NotNull()\n private static final com.stripe.android.model.StripeIntent.NextActionData.AlipayRedirect.Companion Companion = null;\n public static final android.os.Parcelable.Creator<com.stripe.android.model.StripeIntent.NextActionData.AlipayRedirect> CREATOR = null;\n \n @org.jetbrains.annotations.NotNull()\n public final com.stripe.android.model.StripeIntent.NextActionData.AlipayRedirect copy(@org.jetbrains.annotations.NotNull()\n java.lang.String data, @org.jetbrains.annotations.Nullable()\n java.lang.String authCompleteUrl, @org.jetbrains.annotations.NotNull()\n android.net.Uri webViewUrl, @org.jetbrains.annotations.Nullable()\n java.lang.String returnUrl) {\n return null;\n }\n \n @java.lang.Override()\n public boolean equals(@org.jetbrains.annotations.Nullable()\n java.lang.Object other) {\n return false;\n }\n \n @java.lang.Override()\n public int hashCode() {\n return 0;\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public java.lang.String toString() {\n return null;\n }\n \n public AlipayRedirect(@org.jetbrains.annotations.NotNull()\n java.lang.String data, @org.jetbrains.annotations.Nullable()\n java.lang.String authCompleteUrl, @org.jetbrains.annotations.NotNull()\n android.net.Uri webViewUrl, @org.jetbrains.annotations.Nullable()\n java.lang.String returnUrl) {\n super();\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.lang.String component1() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.lang.String getData() {\n return null;\n }\n \n @org.jetbrains.annotations.Nullable()\n public final java.lang.String component2() {\n return null;\n }\n \n @org.jetbrains.annotations.Nullable()\n public final java.lang.String getAuthCompleteUrl() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n public final android.net.Uri component3() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n public final android.net.Uri getWebViewUrl() {\n return null;\n }\n \n @org.jetbrains.annotations.Nullable()\n public final java.lang.String component4() {\n return null;\n }\n \n @org.jetbrains.annotations.Nullable()\n public final java.lang.String getReturnUrl() {\n return null;\n }\n \n public AlipayRedirect(@org.jetbrains.annotations.NotNull()\n java.lang.String data, @org.jetbrains.annotations.NotNull()\n java.lang.String webViewUrl, @org.jetbrains.annotations.Nullable()\n java.lang.String returnUrl) {\n super();\n }\n \n @java.lang.Override()\n public int describeContents() {\n return 0;\n }\n \n @java.lang.Override()\n public void writeToParcel(@org.jetbrains.annotations.NotNull()\n android.os.Parcel parcel, int flags) {\n }\n \n @kotlin.Metadata(mv = {1, 5, 1}, k = 3)\n public static final class Creator implements android.os.Parcelable.Creator<com.stripe.android.model.StripeIntent.NextActionData.AlipayRedirect> {\n \n public Creator() {\n super();\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public final com.stripe.android.model.StripeIntent.NextActionData.AlipayRedirect createFromParcel(@org.jetbrains.annotations.NotNull()\n android.os.Parcel in) {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public final com.stripe.android.model.StripeIntent.NextActionData.AlipayRedirect[] newArray(int size) {\n return null;\n }\n }\n \n @kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u0000\\u0014\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0010\\u0000\\n\\u0002\\b\\u0002\\n\\u0002\\u0010\\u000e\\n\\u0002\\b\\u0002\\b\\u0082\\u0003\\u0018\\u00002\\u00020\\u0001B\\u0007\\b\\u0002\\u00a2\\u0006\\u0002\\u0010\\u0002J\\u0012\\u0010\\u0003\\u001a\\u0004\\u0018\\u00010\\u00042\\u0006\\u0010\\u0005\\u001a\\u00020\\u0004H\\u0002\\u00a8\\u0006\\u0006\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent$NextActionData$AlipayRedirect$Companion;\", \"\", \"()V\", \"extractReturnUrl\", \"\", \"data\", \"payments-core_release\"})\n static final class Companion {\n \n private Companion() {\n super();\n }\n \n /**\n * The alipay data string is formatted as query parameters.\n * When authenticate is complete, we make a request to the\n * return_url param, as a hint to the backend to ping Alipay for\n * the updated state\n */\n private final java.lang.String extractReturnUrl(java.lang.String data) {\n return null;\n }\n }\n }\n \n /**\n * When confirming a [PaymentIntent] or [SetupIntent] with the Stripe SDK, the Stripe SDK\n * depends on this property to invoke authentication flows. The shape of the contents is subject\n * to change and is only intended to be used by the Stripe SDK.\n */\n @kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u0000\\u0016\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0003\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0000\\b6\\u0018\\u00002\\u00020\\u0001:\\u0002\\u0003\\u0004B\\u0007\\b\\u0004\\u00a2\\u0006\\u0002\\u0010\\u0002\\u0082\\u0001\\u0002\\u0005\\u0006\\u00a8\\u0006\\u0007\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent$NextActionData$SdkData;\", \"Lcom/stripe/android/model/StripeIntent$NextActionData;\", \"()V\", \"Use3DS1\", \"Use3DS2\", \"Lcom/stripe/android/model/StripeIntent$NextActionData$SdkData$Use3DS1;\", \"Lcom/stripe/android/model/StripeIntent$NextActionData$SdkData$Use3DS2;\", \"payments-core_release\"})\n public static abstract class SdkData extends com.stripe.android.model.StripeIntent.NextActionData {\n \n private SdkData() {\n super();\n }\n \n @kotlinx.parcelize.Parcelize()\n @kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u00004\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0000\\n\\u0002\\u0010\\u000e\\n\\u0002\\b\\u0006\\n\\u0002\\u0010\\b\\n\\u0000\\n\\u0002\\u0010\\u000b\\n\\u0000\\n\\u0002\\u0010\\u0000\\n\\u0002\\b\\u0003\\n\\u0002\\u0010\\u0002\\n\\u0000\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0002\\b\\u0087\\b\\u0018\\u00002\\u00020\\u0001B\\r\\u0012\\u0006\\u0010\\u0002\\u001a\\u00020\\u0003\\u00a2\\u0006\\u0002\\u0010\\u0004J\\t\\u0010\\u0007\\u001a\\u00020\\u0003H\\u00c6\\u0003J\\u0013\\u0010\\b\\u001a\\u00020\\u00002\\b\\b\\u0002\\u0010\\u0002\\u001a\\u00020\\u0003H\\u00c6\\u0001J\\t\\u0010\\t\\u001a\\u00020\\nH\\u00d6\\u0001J\\u0013\\u0010\\u000b\\u001a\\u00020\\f2\\b\\u0010\\r\\u001a\\u0004\\u0018\\u00010\\u000eH\\u00d6\\u0003J\\t\\u0010\\u000f\\u001a\\u00020\\nH\\u00d6\\u0001J\\t\\u0010\\u0010\\u001a\\u00020\\u0003H\\u00d6\\u0001J\\u0019\\u0010\\u0011\\u001a\\u00020\\u00122\\u0006\\u0010\\u0013\\u001a\\u00020\\u00142\\u0006\\u0010\\u0015\\u001a\\u00020\\nH\\u00d6\\u0001R\\u0011\\u0010\\u0002\\u001a\\u00020\\u0003\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\u0005\\u0010\\u0006\\u00a8\\u0006\\u0016\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent$NextActionData$SdkData$Use3DS1;\", \"Lcom/stripe/android/model/StripeIntent$NextActionData$SdkData;\", \"url\", \"\", \"(Ljava/lang/String;)V\", \"getUrl\", \"()Ljava/lang/String;\", \"component1\", \"copy\", \"describeContents\", \"\", \"equals\", \"\", \"other\", \"\", \"hashCode\", \"toString\", \"writeToParcel\", \"\", \"parcel\", \"Landroid/os/Parcel;\", \"flags\", \"payments-core_release\"})\n public static final class Use3DS1 extends com.stripe.android.model.StripeIntent.NextActionData.SdkData {\n @org.jetbrains.annotations.NotNull()\n private final java.lang.String url = null;\n public static final android.os.Parcelable.Creator<com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS1> CREATOR = null;\n \n @org.jetbrains.annotations.NotNull()\n public final com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS1 copy(@org.jetbrains.annotations.NotNull()\n java.lang.String url) {\n return null;\n }\n \n @java.lang.Override()\n public boolean equals(@org.jetbrains.annotations.Nullable()\n java.lang.Object other) {\n return false;\n }\n \n @java.lang.Override()\n public int hashCode() {\n return 0;\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public java.lang.String toString() {\n return null;\n }\n \n public Use3DS1(@org.jetbrains.annotations.NotNull()\n java.lang.String url) {\n super();\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.lang.String component1() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.lang.String getUrl() {\n return null;\n }\n \n @java.lang.Override()\n public int describeContents() {\n return 0;\n }\n \n @java.lang.Override()\n public void writeToParcel(@org.jetbrains.annotations.NotNull()\n android.os.Parcel parcel, int flags) {\n }\n \n @kotlin.Metadata(mv = {1, 5, 1}, k = 3)\n public static final class Creator implements android.os.Parcelable.Creator<com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS1> {\n \n public Creator() {\n super();\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public final com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS1 createFromParcel(@org.jetbrains.annotations.NotNull()\n android.os.Parcel in) {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public final com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS1[] newArray(int size) {\n return null;\n }\n }\n }\n \n @kotlinx.parcelize.Parcelize()\n @kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u0000<\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0000\\n\\u0002\\u0010\\u000e\\n\\u0002\\b\\u0003\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\r\\n\\u0002\\u0010\\b\\n\\u0000\\n\\u0002\\u0010\\u000b\\n\\u0000\\n\\u0002\\u0010\\u0000\\n\\u0002\\b\\u0003\\n\\u0002\\u0010\\u0002\\n\\u0000\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0003\\b\\u0087\\b\\u0018\\u00002\\u00020\\u0001:\\u0001!B%\\u0012\\u0006\\u0010\\u0002\\u001a\\u00020\\u0003\\u0012\\u0006\\u0010\\u0004\\u001a\\u00020\\u0003\\u0012\\u0006\\u0010\\u0005\\u001a\\u00020\\u0003\\u0012\\u0006\\u0010\\u0006\\u001a\\u00020\\u0007\\u00a2\\u0006\\u0002\\u0010\\bJ\\t\\u0010\\u000f\\u001a\\u00020\\u0003H\\u00c6\\u0003J\\t\\u0010\\u0010\\u001a\\u00020\\u0003H\\u00c6\\u0003J\\t\\u0010\\u0011\\u001a\\u00020\\u0003H\\u00c6\\u0003J\\t\\u0010\\u0012\\u001a\\u00020\\u0007H\\u00c6\\u0003J1\\u0010\\u0013\\u001a\\u00020\\u00002\\b\\b\\u0002\\u0010\\u0002\\u001a\\u00020\\u00032\\b\\b\\u0002\\u0010\\u0004\\u001a\\u00020\\u00032\\b\\b\\u0002\\u0010\\u0005\\u001a\\u00020\\u00032\\b\\b\\u0002\\u0010\\u0006\\u001a\\u00020\\u0007H\\u00c6\\u0001J\\t\\u0010\\u0014\\u001a\\u00020\\u0015H\\u00d6\\u0001J\\u0013\\u0010\\u0016\\u001a\\u00020\\u00172\\b\\u0010\\u0018\\u001a\\u0004\\u0018\\u00010\\u0019H\\u00d6\\u0003J\\t\\u0010\\u001a\\u001a\\u00020\\u0015H\\u00d6\\u0001J\\t\\u0010\\u001b\\u001a\\u00020\\u0003H\\u00d6\\u0001J\\u0019\\u0010\\u001c\\u001a\\u00020\\u001d2\\u0006\\u0010\\u001e\\u001a\\u00020\\u001f2\\u0006\\u0010 \\u001a\\u00020\\u0015H\\u00d6\\u0001R\\u0011\\u0010\\u0006\\u001a\\u00020\\u0007\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\t\\u0010\\nR\\u0011\\u0010\\u0004\\u001a\\u00020\\u0003\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\u000b\\u0010\\fR\\u0011\\u0010\\u0002\\u001a\\u00020\\u0003\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\r\\u0010\\fR\\u0011\\u0010\\u0005\\u001a\\u00020\\u0003\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\u000e\\u0010\\f\\u00a8\\u0006\\\"\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent$NextActionData$SdkData$Use3DS2;\", \"Lcom/stripe/android/model/StripeIntent$NextActionData$SdkData;\", \"source\", \"\", \"serverName\", \"transactionId\", \"serverEncryption\", \"Lcom/stripe/android/model/StripeIntent$NextActionData$SdkData$Use3DS2$DirectoryServerEncryption;\", \"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/model/StripeIntent$NextActionData$SdkData$Use3DS2$DirectoryServerEncryption;)V\", \"getServerEncryption\", \"()Lcom/stripe/android/model/StripeIntent$NextActionData$SdkData$Use3DS2$DirectoryServerEncryption;\", \"getServerName\", \"()Ljava/lang/String;\", \"getSource\", \"getTransactionId\", \"component1\", \"component2\", \"component3\", \"component4\", \"copy\", \"describeContents\", \"\", \"equals\", \"\", \"other\", \"\", \"hashCode\", \"toString\", \"writeToParcel\", \"\", \"parcel\", \"Landroid/os/Parcel;\", \"flags\", \"DirectoryServerEncryption\", \"payments-core_release\"})\n public static final class Use3DS2 extends com.stripe.android.model.StripeIntent.NextActionData.SdkData {\n @org.jetbrains.annotations.NotNull()\n private final java.lang.String source = null;\n @org.jetbrains.annotations.NotNull()\n private final java.lang.String serverName = null;\n @org.jetbrains.annotations.NotNull()\n private final java.lang.String transactionId = null;\n @org.jetbrains.annotations.NotNull()\n private final com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS2.DirectoryServerEncryption serverEncryption = null;\n public static final android.os.Parcelable.Creator<com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS2> CREATOR = null;\n \n @org.jetbrains.annotations.NotNull()\n public final com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS2 copy(@org.jetbrains.annotations.NotNull()\n java.lang.String source, @org.jetbrains.annotations.NotNull()\n java.lang.String serverName, @org.jetbrains.annotations.NotNull()\n java.lang.String transactionId, @org.jetbrains.annotations.NotNull()\n com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS2.DirectoryServerEncryption serverEncryption) {\n return null;\n }\n \n @java.lang.Override()\n public boolean equals(@org.jetbrains.annotations.Nullable()\n java.lang.Object other) {\n return false;\n }\n \n @java.lang.Override()\n public int hashCode() {\n return 0;\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public java.lang.String toString() {\n return null;\n }\n \n public Use3DS2(@org.jetbrains.annotations.NotNull()\n java.lang.String source, @org.jetbrains.annotations.NotNull()\n java.lang.String serverName, @org.jetbrains.annotations.NotNull()\n java.lang.String transactionId, @org.jetbrains.annotations.NotNull()\n com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS2.DirectoryServerEncryption serverEncryption) {\n super();\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.lang.String component1() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.lang.String getSource() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.lang.String component2() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.lang.String getServerName() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.lang.String component3() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.lang.String getTransactionId() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n public final com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS2.DirectoryServerEncryption component4() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n public final com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS2.DirectoryServerEncryption getServerEncryption() {\n return null;\n }\n \n @java.lang.Override()\n public int describeContents() {\n return 0;\n }\n \n @java.lang.Override()\n public void writeToParcel(@org.jetbrains.annotations.NotNull()\n android.os.Parcel parcel, int flags) {\n }\n \n @kotlin.Metadata(mv = {1, 5, 1}, k = 3)\n public static final class Creator implements android.os.Parcelable.Creator<com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS2> {\n \n public Creator() {\n super();\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public final com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS2 createFromParcel(@org.jetbrains.annotations.NotNull()\n android.os.Parcel in) {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public final com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS2[] newArray(int size) {\n return null;\n }\n }\n \n @kotlinx.parcelize.Parcelize()\n @kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u0000<\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0000\\n\\u0002\\u0010\\u000e\\n\\u0002\\b\\u0002\\n\\u0002\\u0010 \\n\\u0002\\b\\u000e\\n\\u0002\\u0010\\b\\n\\u0000\\n\\u0002\\u0010\\u000b\\n\\u0000\\n\\u0002\\u0010\\u0000\\n\\u0002\\b\\u0003\\n\\u0002\\u0010\\u0002\\n\\u0000\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0002\\b\\u0087\\b\\u0018\\u00002\\u00020\\u0001B-\\u0012\\u0006\\u0010\\u0002\\u001a\\u00020\\u0003\\u0012\\u0006\\u0010\\u0004\\u001a\\u00020\\u0003\\u0012\\f\\u0010\\u0005\\u001a\\b\\u0012\\u0004\\u0012\\u00020\\u00030\\u0006\\u0012\\b\\u0010\\u0007\\u001a\\u0004\\u0018\\u00010\\u0003\\u00a2\\u0006\\u0002\\u0010\\bJ\\t\\u0010\\u000f\\u001a\\u00020\\u0003H\\u00c6\\u0003J\\t\\u0010\\u0010\\u001a\\u00020\\u0003H\\u00c6\\u0003J\\u000f\\u0010\\u0011\\u001a\\b\\u0012\\u0004\\u0012\\u00020\\u00030\\u0006H\\u00c6\\u0003J\\u000b\\u0010\\u0012\\u001a\\u0004\\u0018\\u00010\\u0003H\\u00c6\\u0003J9\\u0010\\u0013\\u001a\\u00020\\u00002\\b\\b\\u0002\\u0010\\u0002\\u001a\\u00020\\u00032\\b\\b\\u0002\\u0010\\u0004\\u001a\\u00020\\u00032\\u000e\\b\\u0002\\u0010\\u0005\\u001a\\b\\u0012\\u0004\\u0012\\u00020\\u00030\\u00062\\n\\b\\u0002\\u0010\\u0007\\u001a\\u0004\\u0018\\u00010\\u0003H\\u00c6\\u0001J\\t\\u0010\\u0014\\u001a\\u00020\\u0015H\\u00d6\\u0001J\\u0013\\u0010\\u0016\\u001a\\u00020\\u00172\\b\\u0010\\u0018\\u001a\\u0004\\u0018\\u00010\\u0019H\\u00d6\\u0003J\\t\\u0010\\u001a\\u001a\\u00020\\u0015H\\u00d6\\u0001J\\t\\u0010\\u001b\\u001a\\u00020\\u0003H\\u00d6\\u0001J\\u0019\\u0010\\u001c\\u001a\\u00020\\u001d2\\u0006\\u0010\\u001e\\u001a\\u00020\\u001f2\\u0006\\u0010 \\u001a\\u00020\\u0015H\\u00d6\\u0001R\\u0011\\u0010\\u0002\\u001a\\u00020\\u0003\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\t\\u0010\\nR\\u0011\\u0010\\u0004\\u001a\\u00020\\u0003\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\u000b\\u0010\\nR\\u0013\\u0010\\u0007\\u001a\\u0004\\u0018\\u00010\\u0003\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\f\\u0010\\nR\\u0017\\u0010\\u0005\\u001a\\b\\u0012\\u0004\\u0012\\u00020\\u00030\\u0006\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\r\\u0010\\u000e\\u00a8\\u0006!\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent$NextActionData$SdkData$Use3DS2$DirectoryServerEncryption;\", \"Landroid/os/Parcelable;\", \"directoryServerId\", \"\", \"dsCertificateData\", \"rootCertsData\", \"\", \"keyId\", \"(Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;)V\", \"getDirectoryServerId\", \"()Ljava/lang/String;\", \"getDsCertificateData\", \"getKeyId\", \"getRootCertsData\", \"()Ljava/util/List;\", \"component1\", \"component2\", \"component3\", \"component4\", \"copy\", \"describeContents\", \"\", \"equals\", \"\", \"other\", \"\", \"hashCode\", \"toString\", \"writeToParcel\", \"\", \"parcel\", \"Landroid/os/Parcel;\", \"flags\", \"payments-core_release\"})\n public static final class DirectoryServerEncryption implements android.os.Parcelable {\n @org.jetbrains.annotations.NotNull()\n private final java.lang.String directoryServerId = null;\n @org.jetbrains.annotations.NotNull()\n private final java.lang.String dsCertificateData = null;\n @org.jetbrains.annotations.NotNull()\n private final java.util.List<java.lang.String> rootCertsData = null;\n @org.jetbrains.annotations.Nullable()\n private final java.lang.String keyId = null;\n public static final android.os.Parcelable.Creator<com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS2.DirectoryServerEncryption> CREATOR = null;\n \n @org.jetbrains.annotations.NotNull()\n public final com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS2.DirectoryServerEncryption copy(@org.jetbrains.annotations.NotNull()\n java.lang.String directoryServerId, @org.jetbrains.annotations.NotNull()\n java.lang.String dsCertificateData, @org.jetbrains.annotations.NotNull()\n java.util.List<java.lang.String> rootCertsData, @org.jetbrains.annotations.Nullable()\n java.lang.String keyId) {\n return null;\n }\n \n @java.lang.Override()\n public boolean equals(@org.jetbrains.annotations.Nullable()\n java.lang.Object other) {\n return false;\n }\n \n @java.lang.Override()\n public int hashCode() {\n return 0;\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public java.lang.String toString() {\n return null;\n }\n \n public DirectoryServerEncryption(@org.jetbrains.annotations.NotNull()\n java.lang.String directoryServerId, @org.jetbrains.annotations.NotNull()\n java.lang.String dsCertificateData, @org.jetbrains.annotations.NotNull()\n java.util.List<java.lang.String> rootCertsData, @org.jetbrains.annotations.Nullable()\n java.lang.String keyId) {\n super();\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.lang.String component1() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.lang.String getDirectoryServerId() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.lang.String component2() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.lang.String getDsCertificateData() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.util.List<java.lang.String> component3() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n public final java.util.List<java.lang.String> getRootCertsData() {\n return null;\n }\n \n @org.jetbrains.annotations.Nullable()\n public final java.lang.String component4() {\n return null;\n }\n \n @org.jetbrains.annotations.Nullable()\n public final java.lang.String getKeyId() {\n return null;\n }\n \n @java.lang.Override()\n public int describeContents() {\n return 0;\n }\n \n @java.lang.Override()\n public void writeToParcel(@org.jetbrains.annotations.NotNull()\n android.os.Parcel parcel, int flags) {\n }\n \n @kotlin.Metadata(mv = {1, 5, 1}, k = 3)\n public static final class Creator implements android.os.Parcelable.Creator<com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS2.DirectoryServerEncryption> {\n \n public Creator() {\n super();\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public final com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS2.DirectoryServerEncryption createFromParcel(@org.jetbrains.annotations.NotNull()\n android.os.Parcel in) {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public final com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS2.DirectoryServerEncryption[] newArray(int size) {\n return null;\n }\n }\n }\n }\n }\n \n @kotlinx.parcelize.Parcelize()\n @kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u0000.\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0002\\n\\u0002\\u0010\\b\\n\\u0000\\n\\u0002\\u0010\\u000b\\n\\u0000\\n\\u0002\\u0010\\u0000\\n\\u0002\\b\\u0002\\n\\u0002\\u0010\\u0002\\n\\u0000\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0002\\b\\u00c7\\u0002\\u0018\\u00002\\u00020\\u0001B\\u0007\\b\\u0002\\u00a2\\u0006\\u0002\\u0010\\u0002J\\t\\u0010\\u0003\\u001a\\u00020\\u0004H\\u00d6\\u0001J\\u0013\\u0010\\u0005\\u001a\\u00020\\u00062\\b\\u0010\\u0007\\u001a\\u0004\\u0018\\u00010\\bH\\u0096\\u0002J\\b\\u0010\\t\\u001a\\u00020\\u0004H\\u0016J\\u0019\\u0010\\n\\u001a\\u00020\\u000b2\\u0006\\u0010\\f\\u001a\\u00020\\r2\\u0006\\u0010\\u000e\\u001a\\u00020\\u0004H\\u00d6\\u0001\\u00a8\\u0006\\u000f\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent$NextActionData$BlikAuthorize;\", \"Lcom/stripe/android/model/StripeIntent$NextActionData;\", \"()V\", \"describeContents\", \"\", \"equals\", \"\", \"other\", \"\", \"hashCode\", \"writeToParcel\", \"\", \"parcel\", \"Landroid/os/Parcel;\", \"flags\", \"payments-core_release\"})\n public static final class BlikAuthorize extends com.stripe.android.model.StripeIntent.NextActionData {\n @org.jetbrains.annotations.NotNull()\n public static final com.stripe.android.model.StripeIntent.NextActionData.BlikAuthorize INSTANCE = null;\n public static final android.os.Parcelable.Creator<com.stripe.android.model.StripeIntent.NextActionData.BlikAuthorize> CREATOR = null;\n \n private BlikAuthorize() {\n super();\n }\n \n @java.lang.Override()\n public int hashCode() {\n return 0;\n }\n \n @java.lang.Override()\n public boolean equals(@org.jetbrains.annotations.Nullable()\n java.lang.Object other) {\n return false;\n }\n \n @java.lang.Override()\n public int describeContents() {\n return 0;\n }\n \n @java.lang.Override()\n public void writeToParcel(@org.jetbrains.annotations.NotNull()\n android.os.Parcel parcel, int flags) {\n }\n \n @kotlin.Metadata(mv = {1, 5, 1}, k = 3)\n public static final class Creator implements android.os.Parcelable.Creator<com.stripe.android.model.StripeIntent.NextActionData.BlikAuthorize> {\n \n public Creator() {\n super();\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public final com.stripe.android.model.StripeIntent.NextActionData.BlikAuthorize createFromParcel(@org.jetbrains.annotations.NotNull()\n android.os.Parcel in) {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public final com.stripe.android.model.StripeIntent.NextActionData.BlikAuthorize[] newArray(int size) {\n return null;\n }\n }\n }\n \n @kotlinx.parcelize.Parcelize()\n @androidx.annotation.RestrictTo(value = {androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP})\n @kotlin.Metadata(mv = {1, 5, 1}, k = 1, d1 = {\"\\u0000:\\n\\u0002\\u0018\\u0002\\n\\u0002\\u0018\\u0002\\n\\u0000\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0006\\n\\u0002\\u0010\\b\\n\\u0000\\n\\u0002\\u0010\\u000b\\n\\u0000\\n\\u0002\\u0010\\u0000\\n\\u0002\\b\\u0002\\n\\u0002\\u0010\\u000e\\n\\u0000\\n\\u0002\\u0010\\u0002\\n\\u0000\\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0002\\b\\u0087\\b\\u0018\\u00002\\u00020\\u0001B\\r\\u0012\\u0006\\u0010\\u0002\\u001a\\u00020\\u0003\\u00a2\\u0006\\u0002\\u0010\\u0004J\\t\\u0010\\u0007\\u001a\\u00020\\u0003H\\u00c6\\u0003J\\u0013\\u0010\\b\\u001a\\u00020\\u00002\\b\\b\\u0002\\u0010\\u0002\\u001a\\u00020\\u0003H\\u00c6\\u0001J\\t\\u0010\\t\\u001a\\u00020\\nH\\u00d6\\u0001J\\u0013\\u0010\\u000b\\u001a\\u00020\\f2\\b\\u0010\\r\\u001a\\u0004\\u0018\\u00010\\u000eH\\u00d6\\u0003J\\t\\u0010\\u000f\\u001a\\u00020\\nH\\u00d6\\u0001J\\t\\u0010\\u0010\\u001a\\u00020\\u0011H\\u00d6\\u0001J\\u0019\\u0010\\u0012\\u001a\\u00020\\u00132\\u0006\\u0010\\u0014\\u001a\\u00020\\u00152\\u0006\\u0010\\u0016\\u001a\\u00020\\nH\\u00d6\\u0001R\\u0011\\u0010\\u0002\\u001a\\u00020\\u0003\\u00a2\\u0006\\b\\n\\u0000\\u001a\\u0004\\b\\u0005\\u0010\\u0006\\u00a8\\u0006\\u0017\"}, d2 = {\"Lcom/stripe/android/model/StripeIntent$NextActionData$WeChatPayRedirect;\", \"Lcom/stripe/android/model/StripeIntent$NextActionData;\", \"weChat\", \"Lcom/stripe/android/model/WeChat;\", \"(Lcom/stripe/android/model/WeChat;)V\", \"getWeChat\", \"()Lcom/stripe/android/model/WeChat;\", \"component1\", \"copy\", \"describeContents\", \"\", \"equals\", \"\", \"other\", \"\", \"hashCode\", \"toString\", \"\", \"writeToParcel\", \"\", \"parcel\", \"Landroid/os/Parcel;\", \"flags\", \"payments-core_release\"})\n public static final class WeChatPayRedirect extends com.stripe.android.model.StripeIntent.NextActionData {\n @org.jetbrains.annotations.NotNull()\n private final com.stripe.android.model.WeChat weChat = null;\n public static final android.os.Parcelable.Creator<com.stripe.android.model.StripeIntent.NextActionData.WeChatPayRedirect> CREATOR = null;\n \n @org.jetbrains.annotations.NotNull()\n public final com.stripe.android.model.StripeIntent.NextActionData.WeChatPayRedirect copy(@org.jetbrains.annotations.NotNull()\n com.stripe.android.model.WeChat weChat) {\n return null;\n }\n \n @java.lang.Override()\n public boolean equals(@org.jetbrains.annotations.Nullable()\n java.lang.Object other) {\n return false;\n }\n \n @java.lang.Override()\n public int hashCode() {\n return 0;\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public java.lang.String toString() {\n return null;\n }\n \n public WeChatPayRedirect(@org.jetbrains.annotations.NotNull()\n com.stripe.android.model.WeChat weChat) {\n super();\n }\n \n @org.jetbrains.annotations.NotNull()\n public final com.stripe.android.model.WeChat component1() {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n public final com.stripe.android.model.WeChat getWeChat() {\n return null;\n }\n \n @java.lang.Override()\n public int describeContents() {\n return 0;\n }\n \n @java.lang.Override()\n public void writeToParcel(@org.jetbrains.annotations.NotNull()\n android.os.Parcel parcel, int flags) {\n }\n \n @kotlin.Metadata(mv = {1, 5, 1}, k = 3)\n public static final class Creator implements android.os.Parcelable.Creator<com.stripe.android.model.StripeIntent.NextActionData.WeChatPayRedirect> {\n \n public Creator() {\n super();\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public final com.stripe.android.model.StripeIntent.NextActionData.WeChatPayRedirect createFromParcel(@org.jetbrains.annotations.NotNull()\n android.os.Parcel in) {\n return null;\n }\n \n @org.jetbrains.annotations.NotNull()\n @java.lang.Override()\n public final com.stripe.android.model.StripeIntent.NextActionData.WeChatPayRedirect[] newArray(int size) {\n return null;\n }\n }\n }\n }\n}", "StreamTable()\n {\n }", "private static PatternSet genPatternSetFromDatabase(SequenceDatabase db, double minsup, String user_id) throws IOException{\n\t\t// for BIDE\n//\t\tAlgoBIDEPlus algo = new AlgoBIDEPlus();\n//\t\tSequentialPatterns raw_patterns = algo.runAlgorithm(db, null, (int)Math.floor(minsup*db.size()));\n\n\t\t// Prefixspan\n\t\tAlgoPrefixSpan algo = new AlgoPrefixSpan();\n\t\talgo.setMaximumPatternLength(10);\n\t\tSequentialPatterns raw_patterns = algo.runAlgorithm(db, minsup, null, true);\n\t\t\n\t\t// for SPAM\n//\t\tAlgoSPAM algo = new AlgoSPAM();\n//\t\talgo.setMaximumPatternLength(10);\n//\t\tSequentialPatterns raw_patterns = algo.runAlgorithm(db, null, minsup);\n\t\t\t\t\n\t\tint levelCount=0;\n\t\t// translate raw patterns into my pattern set structure\n\t\tPatternSet pattern_set = new PatternSet(user_id, db.getSequenceIDs(), true, false);\n\t\tfor(List<SequentialPattern> level : raw_patterns.getLevels()){\n\t\t\tfor(SequentialPattern raw_pattern : level){\n\t\t\t\t// FILTER OUT PATTERN WITH LENGTH ONE\n//\t\t\t\tif ( raw_pattern.size() == 1 ) {continue;}\n\t\t\t\t// Format each sequential pattern into my pattern class\n\t\t\t\t// It's convenient to be processed as followed\n\t\t\t\tPattern new_pattern = new Pattern(levelCount);\n\t\t\t\tnew_pattern.setPatternItemsetList(raw_pattern.getItemsets());\n\t\t\t\tnew_pattern.setTransactionIDs(new LinkedList<Integer>(raw_pattern.getSequencesID()));\n\t\t\t\tint base_size = db.size();\n\t\t\t\tnew_pattern.setAbsoluteSupport(raw_pattern.getAbsoluteSupport());\n\t\t\t\tnew_pattern.setRelativeSupport(new Double(raw_pattern.getRelativeSupportFormated(base_size)), base_size);\n\t\t\t\tpattern_set.addPattern(new_pattern);\n\t\t\t}\n\t\t\tlevelCount++;\n\t\t}\n\t\treturn pattern_set;\n\t}", "public StringTable(int maxSize) \n\t{\n\t\tfor (int j = 0; j < length; j++){ //fills table with empty slots\n\t\t\tTable[j] = new Record(\" \");\n\t\t}\n\t}", "private AutomatonFromTable automatonFromTable() {\n \tAutomatonFromTable hypothesis = new AutomatonFromTable(inputs);\n\t\t/*\n\t\t * Number of new states in the hypothesis is the \n\t\t * number of distinct rows in the upper half of the observation table\n\t\t */\n\t\tint noOfNewStates = -1;\n\t\tList<List<String>> distinctStates = new ArrayList<>();\n\t\tIterator<Entry<String, List<String>>> it = observationTableUpper.entrySet().iterator();\n\t\twhile(it.hasNext()){\n\t\t\tMap.Entry<String, List<String>> entry = (Map.Entry<String, List<String>>)it.next();\n\t\t\tdistinctStates.add(entry.getValue());\n\t\t}\n\t\tnoOfNewStates = new HashSet<>(distinctStates).size();\n\t\t//Adding those many number of states\n\t\tfor(int i=0;i<noOfNewStates;i++){\n\t\t\tif(i==0){\n\t\t\t\thypothesis.addInitialState();\n\t\t\t}else{\n\t\t\t\thypothesis.addState();\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"No.of new states \"+noOfNewStates);\n\t\t\n\t\t\n\t\tList<Transition> prefixStateMap = new ArrayList<>();\n\t\t\n\t\t//Adding the transitions for those states\n\t\tit = observationTableUpper.entrySet().iterator();\n\t\tSystem.out.println(\"Upper table size \"+observationTableUpper);\n\t\tint currentMaxState = 0;\n\t\twhile(it.hasNext()){\n\t\t\tMap.Entry<String, List<String>> entry = (Map.Entry<String, List<String>>)it.next();\n\t\t\tString prefix = entry.getKey();\n\t\t\tList<String> results = entry.getValue();\n\t\t\tint currentState = getCurrentState(prefix, prefixStateMap);\n\t\t\tSystem.out.println(\"Current State \"+currentState);\n\t\t\tint nextState;\n\t\t\tif(prefix.contains(\"<>\")){\n\t\t\t\tfor(int i=0;i<results.size();i=i+2){\n\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\tnextState = ++currentMaxState;\n\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t}\n\t\t\t}else if((nextState = checkErrorState(prefix, prefixStateMap))!=-1){\n\t\t\t\tfor(int i=0;i<results.size();i=i+2){\n\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tfor(int i=0;i<results.size();i=i+2){\n\t\t\t\t\tif(!results.get(i+1).equals(\"-\")){\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Check for two start calls and make sure they end up on the same state.\n\t\t\t\t\t\t * This is Media Player specific and might need to be changed \n\t\t\t\t\t\t * add for conditional checks for other examples. \n\t\t\t\t\t\t * For Android Media Player, calling start after the first call to start\n\t\t\t\t\t\t * doesn't lead to a transition to a new state. So that needs to be specifically handled.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tboolean exceptionCase = false;\n\t\t\t\t\t\tif(prefix.contains(\"$\")){\n\t\t\t\t\t\t\tint lastIndex = prefix.lastIndexOf(\"$\");\n\t\t\t\t\t\t\tString lastCall = prefix.substring(lastIndex+1, prefix.length()-1);\n\t\t\t\t\t\t\tif(lastCall.contains(\"start()\") && results.get(i).contains(\"start()\")){\n\t\t\t\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\t\t\t\tint result = checkErrorState(\"<\"+results.get(i)+\",\"+results.get(i+1)+\">\", prefixStateMap);\n\t\t\t\t\t\t\t\tif(result!=-1){\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"Error state is: \"+result);\n\t\t\t\t\t\t\t\t\tnextState = result;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tnextState = currentState;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t\t\t\t\texceptionCase = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}if(!exceptionCase){\n\t\t\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\t\t\tint result = checkErrorState(\"<\"+results.get(i)+\",\"+results.get(i+1)+\">\", prefixStateMap);\n\t\t\t\t\t\t\tif(result!=-1){\n\t\t\t\t\t\t\t\tSystem.out.println(\"Error state is: \"+result);\n\t\t\t\t\t\t\t\tnextState = result;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tnextState = ++currentMaxState;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tnextState = currentState;\n\t\t\t\t\t\tTransition transitionDetails = new Transition();\n\t\t\t\t\t\ttransitionDetails.setPrefix(prefix);\n\t\t\t\t\t\ttransitionDetails.setInput(results.get(i));\n\t\t\t\t\t\ttransitionDetails.setOutput(results.get(i+1));\n\t\t\t\t\t\ttransitionDetails.setCurrentState(currentState);\n\t\t\t\t\t\ttransitionDetails.setNextState(nextState);\n\t\t\t\t\t\tprefixStateMap.add(transitionDetails);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t * Add all the final transitions to the automaton object\n\t\t */\n\t\tfor(Transition transition: prefixStateMap){\n\t\t\thypothesis.addTransition(transition);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Populate the Tree representation of the Automaton by doing a breadth-first search\n\t\t */\n\t\tint i = 0;\n\t\twhile(i<hypothesis.getNumberStates()){\n\t\t\tList<Transition> successorDetails = new ArrayList<>();\n\t\t\tfor(Transition transition: prefixStateMap){\n\t\t\t\tint startState = transition.getCurrentState();\n\t\t\t\tif(startState==i){\n\t\t\t\t\tsuccessorDetails.add(transition);\n\t\t\t\t\tautomatonTree.put(startState, successorDetails);\n\t\t\t\t}\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tSystem.out.println(automatonTree);\n\t\treturn hypothesis;\n\t}", "protected AbstractTableNameConverter() {\r\n\t\tclassMappings = new HashMap<Class<? extends RawEntity<?>>, String>();\r\n\t\t\r\n\t\tpatterns = new LinkedList<String>();\r\n\t\tpatternMappings = new HashMap<String, String>();\r\n\t}", "public TablesGenerator()\n {\n }", "public static void decode () {\n // read the input\n int firstThing = BinaryStdIn.readInt();\n s = BinaryStdIn.readString();\n char[] t = s.toCharArray();\n char[] firstColumn = new char[t.length];\n int [] next = new int[t.length];\n \n // copy array and sort\n for (int i = 0; i < t.length; i++) {\n firstColumn[i] = t[i];\n }\n Arrays.sort(firstColumn);\n \n // decode\n int N = t.length;\n int [] count = new int[256];\n \n // counts frequency of each letter\n for (int i = 0; i < N; i++) {\n count[t[i]]++;\n }\n \n int m = 0, j = 0;\n \n // fills the next[] array with appropriate values\n while (m < N) {\n int _count = count[firstColumn[m]];\n while (_count > 0) {\n if (t[j] == firstColumn[m]) {\n next[m++] = j;\n _count--;\n }\n j++;\n }\n j = 0;\n }\n \n // decode the String\n int _next = next.length;\n int _i = firstThing;\n for (int i = 0; i < _next; i++) {\n _i = next[_i];\n System.out.print(t[_i]);\n } \n System.out.println();\n }", "void decode (DataInputStream dis, Node [] table, Decoder decoder) {\n m_size = Decoder.readUnsignedByte (dis);\n if (m_size == 255) {\n m_size = Decoder.readUnsignedByte (dis) * 255 + Decoder.readUnsignedByte (dis) ;\n }\n //System.out.println (m_size);\n if (m_size > 0) {\n m_node = new Node [m_size];\n for (int i = 0; i < m_size; i++) {\n m_node[i] = Node.decode (dis, table, decoder);\n }\n }\n //System.out.println (\"decoding MFNode done\");\n }", "private void buildSymbolTables() {\n new SymbolsTableBuilder(data).read(this);//.dump();\n }", "public interface StringTable {\n List<StringRecord> getAllRecords();\n List<StringRecord> getRecordsWhere(Predicate<StringRecord> predicate);\n void addFieldEncoder(FieldEncoder encoder);\n}", "public SymbolTable()\r\n {\r\n // Create the tables stack and add the top level\r\n tables = new ArrayDeque<HashMap<String,T>>();\r\n tables.add( new HashMap<String,T>() );\r\n \r\n // Ditto with the counts\r\n counts = new ArrayDeque<Integer>();\r\n counts.add( 0 );\r\n }", "private Proof faxm8Gen(Expression s, Expression t) {\n return generateWithTerm(var(\"b\"), t, generateWithTerm(var(\"a\"), s, faxm8));\n }", "private static void generateHuffmanTree(){\n try (BufferedReader br = new BufferedReader(new FileReader(_codeTableFile))) {\n String line;\n while ((line = br.readLine()) != null) {\n // process the line.\n if(!line.isEmpty() && line!=null){\n int numberData = Integer.parseInt(line.split(\" \")[0]);\n String code = line.split(\" \")[1];\n Node traverser = root;\n for (int i = 0; i < code.length() - 1; i++){\n char c = code.charAt(i); \n if (c == '0'){\n //bit is 0\n if(traverser.getLeftPtr() == null){\n traverser.setLeftPtr(new BranchNode(999999, null, null));\n }\n traverser = traverser.getLeftPtr();\n }\n else{\n //bit is 1\n if(traverser.getRightPtr() == null){\n traverser.setRightPtr(new BranchNode(999999, null, null));\n }\n traverser = traverser.getRightPtr();\n }\n }\n //Put data in the last node by creating a new leafNode\n char c = code.charAt(code.length() - 1);\n if(c == '0'){\n traverser.setLeftPtr(new LeafNode(9999999, numberData, null, null));\n }\n else{\n traverser.setRightPtr(new LeafNode(9999999, numberData, null, null));\n }\n }\n }\n } \n catch (IOException ex) {\n Logger.getLogger(FrequencyTableBuilder.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public static HashMap<String, ArrayList<String>> parseCreateString(String createTableString, boolean metadata) throws FileNotFoundException {\n\n /*\n CREATE TABLE CUSTOMERS( ID INT PRIMARY KEY,NAME TEXT NOT NULL,AGE INT);\n */\n\n System.out.println(\"STUB: Calling your method to create a table\");\n System.out.println(\"Parsing the string:\\\"\" + createTableString + \"\\\"\");\n createTableString = createTableString.toLowerCase();\n String tablename = createTableString.substring(0, createTableString.indexOf(\"(\")).split(\" \")[2].trim();\n String tablenamefile = tablename + \".tbl\";\n Table newTable = new Table(tablenamefile, Constant.leafNodeType);\n HashMap<String, ArrayList<String>> columndata = new HashMap<>();\n TreeMap<Integer, String> columnOrdinalPosition = new TreeMap<>();\n int record_length = 0;\n Matcher m = Pattern.compile(\"\\\\((.*?)\\\\)\").matcher(createTableString);\n while (m.find()) {\n String cols = m.group(1);\n String singlecol[] = cols.split(\",\");\n ArrayList<String> colname;\n int ordinalPosition = 1;\n for (int i = singlecol.length - 1; i >= 0; i--) {\n\n\n colname = new ArrayList<>();\n singlecol[i] = singlecol[i].trim();\n String colNameType[] = singlecol[i].split(\" \");\n colNameType = removeWhiteSpacesInArray(colNameType);\n //columntype\n colname.add(0, colNameType[1]);\n\n columnTypeHelper.setProperties(tablename.concat(\".\").concat(colNameType[0]), colNameType[1]);\n record_length = record_length + RecordFormat.getRecordFormat(colNameType[1]);\n colname.add(1, \"yes\");\n //ordinaltype\n colname.add(2, String.valueOf(++ordinalPosition));\n columnOrdinalPosition.put(ordinalPosition, tablename.concat(\".\").concat(colNameType[0]));\n if (colNameType.length == 4) {\n if (colNameType[2].equals(\"primary\")) {\n colname.set(1, \"pri\");\n colname.set(2, String.valueOf(1));\n columnOrdinalPosition.remove(ordinalPosition);\n columnOrdinalPosition.put(1, tablename.concat(\".\").concat(colNameType[0]));\n --ordinalPosition;\n } else\n colname.set(1, \"no\");\n columnNotNullHelper.setProperties(tablename.concat(\".\").concat(colNameType[0]), \"NOT NULL\");\n }\n columndata.put(colNameType[0], colname);\n }\n\n }\n\n Iterator it = columnOrdinalPosition.entrySet().iterator();\n while (it.hasNext()) {\n Map.Entry pair = (Map.Entry) it.next();\n columnOrdinalHelper.setProperties(String.valueOf(pair.getValue()), String.valueOf(pair.getKey()));\n }\n recordLengthHelper.setProperties(tablename.concat(\".\").concat(Constant.recordLength), String.valueOf(record_length));\n recordLengthHelper.setProperties(tablename.concat(\".\").concat(Constant.numberOfColumns), String.valueOf(columnOrdinalPosition.size()));\n if (!metadata) {\n updateTablesTable(tablename, record_length);\n updateColumnsTable(tablename, columndata);\n }\n return columndata;\n\n }", "private void initTables()\n {\n if ( vc == null )\n {\n // statics are not initialised yet\n vc = new char[ 64 ];\n cv = new int[ 256 ];\n // build translate valueToChar table only once.\n // 0..25 -> 'A'..'Z'\n for ( int i = 0; i <= 25; i++ )\n {\n vc[ i ] = ( char ) ( 'A' + i );\n }\n // 26..51 -> 'a'..'z'\n for ( int i = 0; i <= 25; i++ )\n {\n vc[ i + 26 ] = ( char ) ( 'a' + i );\n }\n // 52..61 -> '0'..'9'\n for ( int i = 0; i <= 9; i++ )\n {\n vc[ i + 52 ] = ( char ) ( '0' + i );\n }\n vc[ 62 ] = spec1;\n vc[ 63 ] = spec2;\n // build translate charToValue table only once.\n for ( int i = 0; i < 256; i++ )\n {\n cv[ i ] = IGNORE;// default is to ignore\n }\n for ( int i = 0; i < 64; i++ )\n {\n cv[ vc[ i ] ] = i;\n }\n cv[ spec3 ] = PAD;\n }\n valueToChar = vc;\n charToValue = cv;\n }", "private void genPattern(int[] rowKeyLink) {\n ptnKeys = new HashMap<Integer, Integer>();\n pattern = new byte[patternSize];\n ptnLink = new int[patternSize * rowSize * 2];\n final int rowBitsSize = 6;\n final int zeroBitsSize = 4;\n\n /* starts with 4000 // 6 bits each\n 0400\n 0040\n 0003 | 3 (4 bits for zero row index)\n total 4 x 6 bits + 4 bits = 28 bits for combo */\n int initCombo = 0;\n for (int i = 0; i < rowSize - 1; i++) {\n int key = rowSize << ((rowSize - i - 1) * 3);\n initCombo = (initCombo << rowBitsSize) | rowKeys.get(key);\n }\n initCombo = (initCombo << rowBitsSize) | rowKeys.get(rowSize - 1);\n initCombo = (initCombo << zeroBitsSize) | (rowSize - 1);\n int ctPtn = 0;\n byte moves = 0;\n int[] ptnKeys2combo = new int[patternSize];\n\n ptnKeys2combo[ctPtn] = initCombo;\n ptnKeys.put(initCombo, ctPtn);\n pattern[ctPtn++] = moves;\n boolean loop = true;\n int top = 0;\n int top2 = 0;\n int end = 1;\n int end2 = 1;\n\n while (loop) {\n moves++;\n top = top2;\n end = end2;\n top2 = end2;\n loop = false;\n\n for (int i = top; i < end; i++) {\n int currPtn = ptnKeys2combo[i];\n int ptnCombo = currPtn >> zeroBitsSize;\n int zeroRow = currPtn & 0x000F;\n int zeroIdx = getRowKey(ptnCombo, zeroRow);\n int linkBase = i * rowSize * 2;\n\n // space down, tile up\n if (zeroRow < rowSize - 1) {\n int lowerIdx = getRowKey(ptnCombo, zeroRow + 1);\n for (int j = 0; j < rowSize; j++) {\n if (rowKeyLink[lowerIdx * rowSize + j] != -1) {\n int newPtn = 0;\n int pairKeys = (rowKeyLink[zeroIdx * rowSize + j] << rowBitsSize)\n | rowKeyLink[lowerIdx * rowSize + j];\n\n switch (zeroRow) {\n case 0:\n newPtn = (pairKeys << 2 * rowBitsSize)\n | (ptnCombo & partialPattern[0]);\n break;\n case 1:\n newPtn = (ptnCombo & partialPattern[1])\n | (pairKeys << rowBitsSize)\n | (ptnCombo & partialPattern[2]);\n break;\n case 2:\n newPtn = (ptnCombo & partialPattern[3]) | pairKeys;\n break;\n default:\n System.err.println(\"ERROR\");\n }\n\n newPtn = (newPtn << zeroBitsSize) | (zeroRow + 1);\n if (ptnKeys.containsKey(newPtn)) {\n ptnLink[linkBase + j * 2] = ptnKeys.get(newPtn);\n } else {\n ptnKeys2combo[ctPtn] = newPtn;\n ptnKeys.put(newPtn, ctPtn);\n pattern[ctPtn] = moves;\n ptnLink[linkBase + j * 2] = ctPtn++;\n loop = true;\n end2++;\n }\n } else {\n ptnLink[linkBase + j * 2] = -1;\n }\n }\n } else {\n ptnLink[linkBase] = -1;\n ptnLink[linkBase + 2] = -1;\n ptnLink[linkBase + 4] = -1;\n ptnLink[linkBase + 6] = -1;\n }\n\n // space up, tile down\n if (zeroRow > 0) {\n int upperIdx = getRowKey(ptnCombo, zeroRow - 1);\n for (int j = 0; j < rowSize; j++) {\n if (rowKeyLink[upperIdx * rowSize + j] != -1) {\n int newPtn = 0;\n int pairKeys = (rowKeyLink[upperIdx * rowSize + j] << rowBitsSize)\n | rowKeyLink[zeroIdx * rowSize + j];\n\n switch (zeroRow) {\n case 1:\n newPtn = (ptnCombo & partialPattern[0])\n | (pairKeys << 2 * rowBitsSize);\n break;\n case 2:\n newPtn = (ptnCombo & partialPattern[1])\n | (pairKeys << rowBitsSize)\n | (ptnCombo & partialPattern[2]);\n break;\n case 3:\n newPtn = (ptnCombo & partialPattern[3]) | pairKeys;\n break;\n default:\n System.err.println(\"ERROR\");\n }\n\n newPtn = (newPtn << zeroBitsSize) | (zeroRow - 1);\n if (ptnKeys.containsKey(newPtn)) {\n ptnLink[linkBase + j * 2 + 1] = ptnKeys.get(newPtn);\n } else {\n ptnKeys2combo[ctPtn] = newPtn;\n ptnKeys.put(newPtn, ctPtn);\n pattern[ctPtn] = moves;\n ptnLink[linkBase + j * 2 + 1] = ctPtn++;\n loop = true;\n end2++;\n }\n } else {\n ptnLink[linkBase + j * 2 + 1] = -1;\n }\n }\n } else {\n ptnLink[linkBase + 1] = -1;\n ptnLink[linkBase + 3] = -1;\n ptnLink[linkBase + 5] = -1;\n ptnLink[linkBase + 7] = -1;\n }\n }\n }\n }", "public SymbolTable(){\r\n\t\tthis(INIT_CAPACITY);\r\n\t}", "public SymbolTableEntry(){\n\t}", "public StringToStringTableVector()\n {\n\n m_blocksize = 8;\n m_mapSize = m_blocksize;\n m_map = new StringToStringTable[m_blocksize];\n }", "private static void buildNewEncodingTableUtil(Node root , Map<Character,String> newTable , List<Character> path) {\n\t\t\n\t\tif(root!=null) {\n\t\t\t\n\t\t\tif(root.left==null && root.right==null) {//Leaf.. Put the sequence into the map.\n\t\t\t\t\n\t\t\t\tString encoding = path.stream().map(e->e.toString()).collect(Collectors.joining()); //Good stuff\n//\t\t\t\tSystem.out.println(\"--encoding : \" + encoding);\n\t\t\t\tnewTable.put(root.data, encoding);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpath.add('0');\n\t\t\t\tbuildNewEncodingTableUtil(root.left, newTable, path);\n\t\t\t\tpath.remove(path.size()-1);\n\t\t\t\tpath.add('1');\n\t\t\t\tbuildNewEncodingTableUtil(root.right, newTable, path);\n\t\t\t\tpath.remove(path.size()-1);\n\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t}", "public static String[][] createPattern()\n {\n //the game is more like a table of 6 columns and 6 rows\n\t\n\t//we're going to have to make a 2D array of 7 rows \n\n String[][] f = new String[7][15];\n\n //Time to loop over each row from up to down\n\n for (int i = 0; i < f.length; i++)\n { \n for (int j = 0; j < f[i].length; j++)\n {\n if (j % 2 == 0) f[i][j] =\"|\";\n\n else f[i][j] = \" \";\n \n if (i==6) f[i][j]= \"-\";\n } \n }\n return f;\n }", "public abstract String getRegexTableMarker();", "public LdpcDecoder() throws IOException {\n\n\t\trng = new Random(); \n\t\tdamping = 1.0;\n\t\tString filename = \"rate0.50_irreg_dvbs2_N64800.alist\";\n\n\t\tBufferedReader file = new BufferedReader(new FileReader(\"resource/\" + filename));\n\n\t\tString line = file.readLine();\n\t\tStringTokenizer tokenizer = new StringTokenizer(line);\n\t\t// n = number of bits (columns)\n\t\t// m = number of checks (rows)\n\t\tn = Integer.parseInt(tokenizer.nextToken());\n\t\tm = Integer.parseInt(tokenizer.nextToken());\n\t\t// System.out.println(\"n = \" + n);\n\t\t// System.out.println(\"m = \" + m);\n\n\t\tline = file.readLine();\n\t\ttokenizer = new StringTokenizer(line);\n\t\t// cmax = max col weight = max left degree (bit nodes)\n\t\tcmax = Integer.parseInt(tokenizer.nextToken());\n\t\t// rmax = max row weight = max right (check) degree\n\t\trmax = Integer.parseInt(tokenizer.nextToken());\n\n\t\tcol_weight = new int[n];\n\t\tline = file.readLine();\n\t\t// System.out.println(input);\n\t\ttokenizer = new StringTokenizer(line);\n\t\tfor (int i = 0; i <= n - 1; i++) {\n\t\t\tcol_weight[i] = Integer.parseInt(tokenizer.nextToken());\n\t\t}\n\n\t\trow_weight = new int[m];\n\t\tline = file.readLine();\n\t\ttokenizer = new StringTokenizer(line);\n\t\tfor (int i = 0; i <= m - 1; i++)\n\t\t\trow_weight[i] = Integer.parseInt(tokenizer.nextToken());\n\n\t\tint v;\n\t\tint counter[] = new int[n];\n\t\tfor (int i = 0; i <= n - 1; i++)\n\t\t\tcounter[i] = 0;\n\t\trow_list = new int[m][rmax];\n\t\tcol_list_r = new int[n][cmax];\n\t\tcol_list_c = new int[n][cmax];\n\n\t\t// chaos: alist format has left connections first, skip them\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tline = file.readLine();\n\n\t\tfor (int j = 0; j <= m - 1; j++) {\n\t\t\tline = file.readLine();\n\t\t\ttokenizer = new StringTokenizer(line);\n\t\t\tfor (int i = 0; i <= row_weight[j] - 1; i++) {\n\t\t\t\tv = Integer.parseInt(tokenizer.nextToken()) - 1;\n\t\t\t\trow_list[j][i] = v;\n\t\t\t\tcol_list_r[v][counter[v]] = j;\n\t\t\t\tcol_list_c[v][counter[v]] = i;\n\t\t\t\tcounter[v]++;\n\t\t\t}\n\t\t}\n\t\tfile.close();\n\t\t\n\t\t// allocate variables here - need to this only once (avoid memory leaks?)\n\t\talpha = new double[m][rmax];\n\t\tbeta = new double[m][rmax];\n\t\tlambda = new double[n];\n\t\tposterior = new double[n];\n\t\tq0 = new double[n-noffs];\n\n\t\t//tmp_bit = new int[n];\n\t\t\n\t\tinitPER = 0.09; // TODO compute this at each re-init\n\t\t\n\t\tinitState();\n\t\t\n\t}", "@Override\n public char[][] buildDnaTable(String[] dna) {\n var table = new char[dna.length][dna.length];\n\n // loop of dna\n for (var row = 0; row < dna.length; row++) {\n char[] rowData = dna[row].toCharArray();\n // validate structured & content\n validateSequenceData(rowData, dna.length);\n table[row] = rowData;\n }\n\n\n return table;\n }", "public ExpressionPatternModel() {\n }", "private MyTable generateTable()\n\t{\n\t\t//this creates the column headers for the table\n\t\tString[] titles = new String[] {\"Name\"};\n\t\t//fields will store all of the entries in the database for the GUI\n\t\tArrayList<String[]> fields = new ArrayList<String[]>();\n\t\tfor (food foodStuff: items) //for each element in items do the following\n\t\t{\n\t\t\t//creates a single row of the table\n\t\t\tString[] currentRow = new String[1]; //creates an array for this row\n\t\t\tcurrentRow[1] = foodStuff.getName(); //sets this row's name\n\t\t\tfields.add(currentRow); //adds this row to the fields ArrayList\n\t\t}\n\t\t//builds a table with titles and a downgraded fields array\n\t\tMyTable builtTable = new MyTable(fields.toArray(new String[0][1]), titles);\n\t\treturn builtTable; // return\n\t}", "TABLE createTABLE();", "public TableDefinition(Class<T> model){\n this.singleton = this;\n this.model = model;\n try {\n OBJECT = Class.forName(model.getName());\n createTableDefinition();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public MVCModelo()\n\t{\n\t\ttablaChaining=new HashSeparateChaining<String, TravelTime>(20000000);\n\t\ttablaLineal = new TablaHashLineal<String, TravelTime>(20000000);\n\t}", "public void testToStringStarTableString() throws IOException {\n String s = helper.toString(table,\"votable\");\n StarTable table1 = helper.getBuilder().makeStarTableFromString(s);\n assertNotNull(table1);\n assertEquals(table1.getColumnCount(),table.getColumnCount());\n assertEquals(table1.getRowCount(),table.getRowCount());\n \n }", "@Ignore\r\n @Test\r\n public void testCreateEncodingsLabelBitString()\r\n {\r\n System.out.println(\"createEncodingsLabelBitString\");\r\n HuffmanEncoder huffman = new HuffmanEncoder(p, ensemble);\r\n HuffmanNode root = huffman.createTree();\r\n EncodingsLabelTextCreator enc = new EncodingsLabelTextCreator(root);\r\n String expResult = \"{ a: 01, b: 10, c: 11, d: 001, e: 000 }\"; \r\n String result = enc.getLabelText();\r\n System.out.println(result);\r\n assertEquals(expResult, result);\r\n }", "public void importFnaBitSequences(String filename, int start, int end) {\n\n int currentKID = -1;\n SuperString currentSeq = new SuperString();\n //String currentName = \"\";\n boolean ignore = true; //do not write empty sequence to database\n\n TimeTotals tt = new TimeTotals();\n tt.start();\n\n System.out.println(\"\\nFNA import begins \" + tt.toHMS() + \"\\n\");\n try (BufferedReader br = new BufferedReader(new FileReader(filename))) {\n\n for (String line; (line = br.readLine()) != null; ) {\n\n if (debug) {\n System.err.println(\"Single line:: \" + line);\n }\n\n // if blank line, it does not count as new sequence\n if (line.trim().length() == 0) {\n if (debug) System.err.println(\" :: blank line detected \");\n\n if (!ignore)\n if(currentKID >= start && currentSeq.length() > 0) {\n storeSequence(currentKID, currentSeq, tt);\n } else {\n sequenceLength.add(currentSeq.length());\n exceptionsArr.add(new HashMap<>());\n }\n\n else if (!ignore) {\n sequenceLength.add(currentSeq.length());\n exceptionsArr.add(new HashMap<>());\n }\n ignore = true;\n\n // if line starts with \">\", then it is start of a new reference sequence\n } else if (line.charAt(0) == '>') {\n if (debug) System.err.println(\" :: new entry detected \" + line);\n\n // save previous iteration to database\n if (!ignore && currentSeq.length() > 0) {\n storeSequence(currentKID, currentSeq, tt);\n } else if (!ignore) {\n sequenceLength.add(currentSeq.length());\n exceptionsArr.add(new HashMap<>());\n }\n // initialize next iteration\n if (indexOf(line.trim()) == -1) {\n //original.addAndTrim(new Kid(line.trim()));\n //addNewKidEntry(line);\n add(new Kid(line.trim()));\n if (getLast()==start || (getLast()== 1 && start == 1)){\n System.err.println(\"Found KID\\t\" + currentKID + \"\\tbit string import started\");\n }\n }\n\n currentKID = getKid(line.trim()); // original.indexOf(line.trim());\n if (currentKID == -1) {\n System.err.println(\"This sequence not found in database : \" + line);\n listEntries(0);\n exit(0);\n }\n //currentSeq = \"\";\n\n currentSeq = new SuperString();\n\n ignore = false;\n } else {\n currentSeq.addAndTrim(line.trim());\n }\n\n\n if (currentKID >= end){\n break;\n }\n } //end for\n\n //write last\n if (!ignore && currentKID >= start && currentSeq.length() > 0) {\n storeSequence(currentKID, currentSeq, tt);\n }\n// else if (!ignore) {\n// sequenceLength.add(currentSeq.length());\n// exceptionsArr.add(new HashMap<>());\n// }\n br.close();\n\n }catch (FileNotFoundException e1) {\n e1.printStackTrace();\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n\n }", "private void buildTables() {\n\t\tint k = G.getK();\n\t\tint numEachPod = k * k / 4 + k;\n \n\t\tbuildEdgeTable(k, numEachPod);\n\t\tbuildAggTable(k, numEachPod);\n\t\tbuildCoreTable(k, numEachPod); \n\t}", "public BSTSymbolTable()\r\n\t{\r\n\t\tdata = new IterativeBinarySearchTree<Entry>();\r\n\t}", "tbls createtbls();", "public void encodeData() {\n frequencyTable = new FrequencyTableBuilder(inputPath).buildFrequencyTable();\n huffmanTree = new Tree(new HuffmanTreeBuilder(new FrequencyTableBuilder(inputPath).buildFrequencyTable()).buildTree());\n codeTable = new CodeTableBuilder(huffmanTree).buildCodeTable();\n encodeMessage();\n print();\n }", "public static void decode()\n {\n \n \n int a = BinaryStdIn.readInt();\n String t = BinaryStdIn.readString();\n int len = t.length();\n \n //variables for generating next[] array\n int[] next = new int[len];\n char[] original = t.toCharArray();\n char[] temp = t.toCharArray();\n boolean[] flag = new boolean[len];\n for(int i = 0 ; i < len; i++)\n {\n flag[i] = true;\n }\n \n //sort the encoded string\n decodeSort(temp);\n \n //generating next[] array\n for(int i = 0 ; i < len; i++)\n {\n for(int j = 0 ; j < len; j++)\n {\n if(flag[j])\n { \n if(original[j]==temp[i])\n {\n next[i] = j;\n flag[j]=false;\n break;\n }\n }\n }\n \n }\n \n // decode procedure\n int key = a;\n for (int count = 0; count < len; count++) {\n key = next[key];\n BinaryStdOut.write(t.charAt(key));\n }\n BinaryStdOut.close();\n }", "private Table<Integer,String> buildTable(Collection<Block> featuresAsBlocks, Collection<Clause> featuresAsClauses, List<PredicateDefinition> globalConstants, Dataset dataset, Algorithm mode, PresubsumptionType presubsumptionType){\n Table<Integer,String> table = new Table<Integer,String>();\n //i.e. not global constants\n List<Block> nonConstantAttributes = new ArrayList<Block>();\n List<Block> globalConstantAttributes = new ArrayList<Block>();\n for (Block attribute : featuresAsBlocks){\n if (attribute.definition().isGlobalConstant()){\n globalConstantAttributes.add(attribute);\n } else {\n nonConstantAttributes.add(attribute);\n }\n }\n Dataset copyOfDataset = dataset.shallowCopy();\n copyOfDataset.reset();\n while (copyOfDataset.hasNextExample()){\n Example example = copyOfDataset.nextExample();\n table.addClassification(copyOfDataset.currentIndex(), copyOfDataset.classificationOfCurrentExample());\n addGlobalConstants(example, copyOfDataset.currentIndex(), table, globalConstants);\n }\n if (mode == HIFI || mode == HIFI_GROUNDING_COUNTING || mode == RELF || mode == RELF_GROUNDING_COUNTING){\n HiFi tableConstructionHifi = new HiFi(dataset);\n if (mode == HIFI_GROUNDING_COUNTING || mode == RELF_GROUNDING_COUNTING){\n tableConstructionHifi.setAggregablesBuilder(VoidAggregablesBuilder.construct());\n tableConstructionHifi.setPostProcessingAggregablesBuilder(GroundingCountingAggregablesBuilder.construct());\n }\n if (this.normalizationFactor != null){\n tableConstructionHifi.setNormalizationFactor(normalizationFactor);\n }\n table.addAll(tableConstructionHifi.constructTable(nonConstantAttributes));\n } else if (mode == POLY || mode == POLY_GROUNDING_COUNTING){\n Poly tableConstructionHiFi = new Poly(dataset);\n if (mode == POLY){\n tableConstructionHiFi.setUseGroundingCounting(false);\n } else if (mode == POLY_GROUNDING_COUNTING){\n tableConstructionHiFi.setUseGroundingCounting(true);\n }\n table.addAll(tableConstructionHiFi.constructTable(nonConstantAttributes));\n } else if (mode == RELF_X){\n throw new UnsupportedOperationException();\n// HiFi tableConstructionHifi = new HiFi(dataset);\n// if (mode == HIFI_GROUNDING_COUNTING || mode == RELF_GROUNDING_COUNTING){\n// tableConstructionHifi.setAggregablesBuilder(VoidAggregablesBuilder.construct());\n// tableConstructionHifi.setPostProcessingAggregablesBuilder(GroundingCountingAggregablesBuilder.construct());\n// }\n// if (this.normalizationFactor != null){\n// tableConstructionHifi.setNormalizationFactor(normalizationFactor);\n// }\n// //table.addAll(tableConstructionHifi.constructTable(nonConstantAttributes));\n//\n// RelfX tableConstructionRelfX = new RelfX(dataset);\n// table.addAll(tableConstructionRelfX.constructTable(Sugar.listFromCollections(featuresAsClauses), presubsumptionType));\n }\n\n return table;\n }", "static LearningTable createFilledLearningTable() {\n\t\tLearningTable table = new LearningTable(null, null, null);\n\t\t\n\t\ttable.getAttributes().addAll(createAttributes());\n\t\ttable.getExamples().addAll(createFilledExamples());\n\t\t\n\t\treturn table;\n\t}", "void buildTable(){\n HashMap<String, Integer> map = new HashMap<String, Integer>();\n while (first.hasNext()){\n String s = first.next();\n for(String key: s.split(SPLIT)) {\n int val = map.getOrDefault(key, 0);\n map.put(key, val + 1);\n }\n }\n ArrayList<Tuple> arr = new ArrayList<>();\n for (String key: map.keySet()){\n int num = map.get(key);\n //filter the unusual items\n if (num >= this.support){\n arr.add(new Tuple(key, num));\n }\n }\n //descending sort\n arr.sort((Tuple t1, Tuple t2)->{\n if (t1.num <= t2.num)\n return 1;\n else\n return -1;\n });\n\n int idx = 0;\n for(Tuple t: arr){\n this.table.add(new TableEntry(t.item, t.num));\n this.keyToNum.put(t.item, t.num);\n this.keyToIdx.put(t.item, idx);\n idx += 1;\n }\n /*\n for(TableEntry e: table){\n System.out.println(e.getItem()+ \" \"+ e.getNum());\n }*/\n }", "@Ignore\r\n @Test\r\n public void testCreateEncodingsLabelBitString2()\r\n {\r\n System.out.println(\"testCreateEncodingsLabelBitString2\");\r\n HuffmanEncoder huffman = new HuffmanEncoder(p2, ensemble2);\r\n HuffmanNode root = huffman.createTree();\r\n EncodingsLabelTextCreator enc = new EncodingsLabelTextCreator(root);\r\n String expResult = \"{ a: 01, b: 00, c: 0 }\"; \r\n String result = enc.getLabelText();\r\n System.out.println(result);\r\n assertEquals(expResult, result);\r\n }", "private SequentialSearchSymbolTable() {\n\t\t\tkeySet = new ArrayList<>();\n\t\t\tvalueSet = new ArrayList<>();\n\t\t\tsize = 0;\n\t\t}", "private static Collection<Text> createText(ProtocolStructure protocolStructure) {\n Byte[] bytes = protocolStructure.getBytes();\n Collection<Text> result = new ArrayList<>();\n //noinspection NumericCastThatLosesPrecision\n int totalLines = (int) Math.ceil(bytes.length / 16.0);\n for (int i = 0; i < totalLines; i++) {\n result.add(createOffset(i));\n int toIndex = Math.min((i + 1) * 16, bytes.length);\n Byte[] line = Arrays.copyOfRange(bytes, i * 16, toIndex);\n result.addAll(createHex(line));\n result.addAll(createAscii(line));\n }\n return result;\n }", "FlowSequence createFlowSequence();", "public void frameNoteDecoder(Integer[] frameNotes){\n //for(int i = 0;i<1;i++){\n for(int j =0; j < rhytm.get(beatCounter).length;j++){\n if(rhytm.get(beatCounter)[j]!=null)\n if ((!rhytm.get(beatCounter)[j].equals(\"Ri\")) && (!rhytm.get(beatCounter)[j].equals(\"Rs\"))) {\n melodyCounter++;\n }\n }\n beatCounter++;\n //}\n\n if(beatCounter==15) {\n for (int i = 0; i < frameNotes.length; i++) {\n if (melody.get(melodyCounter) == frameNotes[i]) {\n if (i < 2) {\n binaryOutput += \"0\";\n binaryOutput += Integer.toBinaryString(i);\n } else {\n binaryOutput += Integer.toBinaryString(i);\n }\n }\n }\n }\n if(beatCounter==31) {\n for (int i = 0; i < frameNotes.length; i++) {\n if (melody.get(melodyCounter) == frameNotes[i]) {\n binaryOutput += Integer.toBinaryString(i);\n }\n }\n }\n beatCounter++;\n melodyCounter++;\n\n\n}", "private void createTable() {\n\t\tfreqTable = new TableView<>();\n\n\t\tTableColumn<WordFrequency, Integer> column1 = new TableColumn<WordFrequency, Integer>(\"No.\");\n\t\tcolumn1.setCellValueFactory(new PropertyValueFactory<WordFrequency, Integer>(\"serialNumber\"));\n\n\t\tTableColumn<WordFrequency, String> column2 = new TableColumn<WordFrequency, String>(\"Word\");\n\t\tcolumn2.setCellValueFactory(new PropertyValueFactory<WordFrequency, String>(\"word\"));\n\n\t\tTableColumn<WordFrequency, Integer> column3 = new TableColumn<WordFrequency, Integer>(\"Count\");\n\t\tcolumn3.setCellValueFactory(new PropertyValueFactory<WordFrequency, Integer>(\"count\"));\n\n\t\tList<TableColumn<WordFrequency, ?>> list = new ArrayList<TableColumn<WordFrequency, ?>>();\n\t\tlist.add(column1);\n\t\tlist.add(column2);\n\t\tlist.add(column3);\n\n\t\tfreqTable.getColumns().addAll(list);\n\t}", "int[] prefix_suffix_tabble(String pattern){\n\n // ABAB\n int[] table = pattern.length;\n\n int M = pattern.length();\n int i=0;\n int j=1;\n\n table[0] = 0;\n\n while(j<M){\n if(pattern.charAt(i) == pattern.charAt(j)){\n table[j] = i+1;\n i++;\n j++;\n }\n else{ // charAt(i) != charAt(j)\n\n\n if(i==0){ // cant go to previous, so just set it to 0 and move on. Almost our base case\n table[j] = 0;\n j++;\n continue;\n }\n\n // set i to the value of the previous and keep doing it\n int valueAtPrevious = table[i-1];\n i = valueAtPrevious;\n }\n }\n return table;\n // ith index indicates a prefix that is also a suffix from 0 including i. Cant be the whole String\n\n\n }", "private void buildTrie(List<String> patterns) {\n for (String s : patterns) {\n words.add(s);\n Node activeNode = root;\n for (int i = 0; i < s.length(); ++i) {\n if (!activeNode.hasEdge(s.charAt(i)))\n activeNode.addEdge(new Edge(activeNode, s.charAt(i), false, -1));\n activeNode = activeNode.getEdge(s.charAt(i)).getTo();\n }\n activeNode.setWordEnd(true, words.size() - 1);\n }\n }", "public SymbolTable(int capacity){\r\n\t\tN = 0;\r\n\t\tM = capacity;\r\n\t\tkeys = new String[M];\r\n\t\tvals = new Character[M];\r\n\t}", "public abstract String[] createTablesStatementStrings();", "public void generateFixedDataInit() {\n if (codeValues != null) {\n \n stringBuffer.append(TEXT_139);\n \n } else {\n \n stringBuffer.append(TEXT_140);\n stringBuffer.append(TEXT_141);\n stringBuffer.append( ElementParameterParser.getValue(node, \"__FIELDSEPARATOR__\") );\n stringBuffer.append(TEXT_142);\n stringBuffer.append(TEXT_143);\n stringBuffer.append( ElementParameterParser.getValue(node, \"__ROWSEPARATOR__\") );\n stringBuffer.append(TEXT_144);\n \n int i = -1;\n for (IMetadataColumn column : getOutColumnsMain()) {\n i++;\n String label = column.getLabel();\n String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable());\n JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType());\n String patternValue = column.getPattern() == null || column.getPattern().trim().length() == 0 ? null : column.getPattern();\n\n String defaultValue = \"null\";\n if (column.getDefault() != null && column.getDefault().length() > 0) {\n defaultValue = column.getDefault();\n } else {\n if (typeToGenerate == null) {\n throw new IllegalArgumentException();\n }\n if (JavaTypesManager.isJavaPrimitiveType(typeToGenerate)) {\n if (\"char\".equals(typeToGenerate)) {\n defaultValue = \"' '\";\n } else if (\"boolean\".equals(typeToGenerate)) {\n defaultValue = \"false\";\n } else if (\"byte\".equals(typeToGenerate)) {\n defaultValue = \"(byte)0\";\n } else if (\"double\".equals(typeToGenerate)) {\n defaultValue = \"0.0d\";\n } else if (\"float\".equals(typeToGenerate)) {\n defaultValue = \"0.0f\";\n } else if (\"long\".equals(typeToGenerate)) {\n defaultValue = \"0l\";\n } else if (\"short\".equals(typeToGenerate)) {\n defaultValue = \"(short) 0\";\n } else {\n defaultValue = \"0\";\n }\n }\n }\n \n stringBuffer.append(TEXT_145);\n stringBuffer.append(i);\n stringBuffer.append(TEXT_146);\n stringBuffer.append(i);\n stringBuffer.append(TEXT_147);\n \n if(javaType == JavaTypesManager.STRING || javaType == JavaTypesManager.OBJECT) {\n \n stringBuffer.append(TEXT_148);\n stringBuffer.append(defaultValue );\n stringBuffer.append(TEXT_149);\n \n } else if (javaType == JavaTypesManager.DATE) {\n \n stringBuffer.append(TEXT_150);\n if ((defaultValue==null) || \"\".equals(defaultValue) || \"null\".equals(defaultValue)){ \n stringBuffer.append(TEXT_151);\n } \n stringBuffer.append(TEXT_152);\n stringBuffer.append(defaultValue );\n stringBuffer.append(TEXT_153);\n stringBuffer.append(TEXT_154);\n stringBuffer.append( patternValue );\n stringBuffer.append(TEXT_155);\n stringBuffer.append( patternValue );\n stringBuffer.append(TEXT_156);\n \n } else if(javaType == JavaTypesManager.BYTE_ARRAY) {\n \n stringBuffer.append(TEXT_157);\n stringBuffer.append(defaultValue );\n stringBuffer.append(TEXT_158);\n \n } else {\n \n stringBuffer.append(TEXT_159);\n stringBuffer.append(defaultValue );\n stringBuffer.append(TEXT_160);\n stringBuffer.append( typeToGenerate );\n stringBuffer.append(TEXT_161);\n \n }\n \n stringBuffer.append(TEXT_162);\n \n if (javaType != JavaTypesManager.DATE) {\n \n stringBuffer.append(TEXT_163);\n stringBuffer.append(defaultValue );\n stringBuffer.append(TEXT_164);\n \n } else if (defaultValue == null || \"\".equals(defaultValue) || \"null\".equals(defaultValue)) {\n \n stringBuffer.append(TEXT_165);\n stringBuffer.append(defaultValue );\n stringBuffer.append(TEXT_166);\n stringBuffer.append( patternValue );\n stringBuffer.append(TEXT_167);\n \n } else {\n \n stringBuffer.append(TEXT_168);\n stringBuffer.append(defaultValue );\n stringBuffer.append(TEXT_169);\n stringBuffer.append( patternValue );\n stringBuffer.append(TEXT_170);\n \n }\n \n stringBuffer.append(TEXT_171);\n \n }\n \n stringBuffer.append(TEXT_172);\n \n }\n }", "public void generateTable() {\n if (Reference.ean != null) {\n //create a new Table\n TableLayout ll = (TableLayout) findViewById(R.id.table);\n\n //loop through each intolerance we use\n int index = 0;\n\n for (int i = 0; i < Reference.binaryFieldNames.length; i++) {\n //create a new table row\n TableRow row = new TableRow(this);\n\n TableRow.LayoutParams lp = new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT);\n row.setLayoutParams(lp);\n\n //create a new text view\n TextView tv = new TextView(this);\n tv.setText(Reference.binaryFieldNamesFormatted[i]);\n\n //setup the radio buttons\n RadioGroup group = new RadioGroup(this);\n group.setId(index + GROUP_OFFSET);\n\n RadioButton yes = new RadioButton(this);\n yes.setText(POSITIVE);\n\n RadioButton no = new RadioButton(this);\n no.setText(NEGATIVE);\n\n //add the radio buttons to the group\n group.addView(yes);\n group.addView(no);\n\n\n //turn on the previous settings\n switch (data[index]) {\n case Reference.ANY:\n no.toggle();\n break;\n case Reference.NONE:\n yes.toggle();\n break;\n }\n\n //add the views to the row and then add the row\n row.addView(tv);\n row.addView(group);\n ll.addView(row, index);\n\n //add listener for the radio button group\n group.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {\n public void onCheckedChanged(RadioGroup group, int checkedId) {\n //figure out the row the radio button was in\n int row = group.getId() - GROUP_OFFSET;\n //figure out the amount this represents\n String text = ((RadioButton)findViewById(checkedId)).getText().toString();\n int amount = Reference.UNKNOWN;\n //re-map the values because currently 2 is traces and 1 is any amount\n switch (text) {\n case POSITIVE:\n amount = Reference.NONE;\n break;\n case NEGATIVE:\n amount = Reference.ANY;\n break;\n }\n //set this in the profile array\n data[row] = amount;\n }\n });\n index++;\n }\n\n for (int i = 0; i < Reference.tertiaryFieldNames.length; i++) {\n //create a new table row\n TableRow row = new TableRow(this);\n\n TableRow.LayoutParams lp = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT);\n row.setLayoutParams(lp);\n\n //create a new text view\n TextView tv = new TextView(this);\n tv.setText(Reference.tertiaryFieldNamesFormatted[i]);\n\n //setup the radio buttons\n RadioGroup group = new RadioGroup(this);\n group.setId(index + GROUP_OFFSET);\n\n\n RadioButton any = new RadioButton(this);\n any.setText(ANY);\n RadioButton traces = new RadioButton(this);\n traces.setText(TRACES);\n RadioButton none = new RadioButton(this);\n none.setText(NONE);\n\n //add the radio buttons to the group\n group.addView(any);\n group.addView(traces);\n group.addView(none);\n\n\n //turn on the previous settings\n switch (data[index]) {\n case Reference.ANY:\n any.toggle();\n break;\n case Reference.TRACE:\n traces.toggle();\n break;\n case Reference.NONE:\n none.toggle();\n break;\n }\n\n //add the views to the row and then add the row\n row.addView(tv);\n row.addView(group);\n ll.addView(row, index);\n\n //add listener for the radio button group\n group.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {\n public void onCheckedChanged(RadioGroup group, int checkedId) {\n //figure out the row the radio button was in\n int row = group.getId() - GROUP_OFFSET;\n String text = ((RadioButton)findViewById(checkedId)).getText().toString();\n //figure out the amount this represents\n int amount = Reference.UNKNOWN;\n //re-map the values because currently 2 is traces and 1 is any amount\n switch (text) {\n case ANY:\n amount = Reference.ANY;\n break;\n case TRACES:\n amount = Reference.TRACE;\n break;\n case NONE:\n amount = Reference.NONE;\n break;\n }\n //figure out the row the radio butto\n\n //set this in the profile array\n data[row] = amount;\n }\n });\n index++;\n }\n } else {\n ((TextView)findViewById(R.id.title)).setText(\"Scan a barcode to edit a products data\");\n findViewById(R.id.push_button).setVisibility(View.INVISIBLE);\n findViewById(R.id.name).setVisibility(View.INVISIBLE);\n }\n }", "private Row(byte[] data)\n\t\t{\n\t\t\tArrayList<Byte> al = new ArrayList<Byte>(data.length);\n\t\t\tfor(byte b: data)\n\t\t\t\tal.add(b);\n\t\t\tObservableList<Byte> ol = FXCollections.observableArrayList(al);\n\t\t\tsetColumns(new SimpleListProperty<Byte>(ol));\n\t\t}", "public NewTextLineCodecFactory(String charset,String encodingDelimiter, String decodingDelimiter){\n\t\tsuper(Charset.forName(charset),encodingDelimiter,decodingDelimiter);\n\t}", "public static void buildTable() {\r\n\t\t//This method keeps the user from editing the table\r\n\t\ttableModel = new DefaultTableModel() {\r\n\t\t\tprivate static final long serialVersionUID = 1L;\r\n\t\t\t@Override\r\n\t\t\tpublic boolean isCellEditable(int row, int column) {\r\n\t\t\t\t//All cells false\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\ttableModel.setNumRows(dblogic.getSize());\r\n\t\ttableModel.setColumnCount(COL_COUNT);\r\n\t\ttableModel.setColumnIdentifiers(columnNames);\r\n\t\ttable.setRowSelectionAllowed(true);\r\n\t\ttable.setColumnSelectionAllowed(false);\r\n\t\ttable.setDragEnabled(false);\r\n\t\ttable.getTableHeader().setReorderingAllowed(false);\r\n\t\ttable.setModel(tableModel);\r\n\r\n\t\t//Build rows\r\n\t\tfor (int i = 0; i < dblogic.getSize(); i++) {\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getLastName(), i, COL_LAST);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getFirstName(), i, COL_FIRST);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getPatronEmail(), i, COL_EMAIL);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getDOB(), i, COL_BIRTH);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getPatronSinceString(), i, COL_ADDED);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getAnniv().toString(), i, COL_ANNIV);\r\n\t\t}\r\n\t}", "public RoutingTable() {\n for(int i = 0; i < addressLength; i++) {\n routingTable[i] = new HashTable();\n bloomFilters[i] = new BloomFilter(k, m);\n }\n }", "public SequenceFasta(){\n description = null;\n\t sequence = null;\n\t}", "HdbdtiModel createHdbdtiModel();", "public static void car(Contract contract) {\n String flag1 = \"@@\";\n String flag2 = \"=\";\n //1,8 2, 7 2h,6 3,3 11,7 22,4 333 444 554 664 775 883\n if (contract.getTable1() != null && contract.getTable1().length() != 8) {\n String table = contract.getTable1();\n String[] tables = table.split(flag2, -1);\n int size = tables[0].split(flag1, -1).length;\n List<Table> list = new ArrayList<Table>();\n for (int i = 0; i < size; i++) {\n Table t = new Table();\n try {\n t.setTable0(tables[0].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable1(tables[1].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable2(tables[2].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable3(tables[3].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable4(tables[4].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable5(tables[5].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable6(tables[6].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable7(tables[7].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable8(tables[8].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable9(tables[9].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable10(tables[10].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable11(tables[11].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n String str = t.getTable0() + t.getTable1() + t.getTable2() + t.getTable3() + t.getTable4() + t.getTable5() + t.getTable6() + t.getTable7();\n if (!\"\".equals(str)) {\n list.add(t);\n }\n\n }\n contract.setTableList1(list);\n }\n\n if (contract.getTable2() != null && contract.getTable2().length() != 1) {\n String table = contract.getTable2();\n String[] tables = table.split(flag2, -1);\n int size = tables[0].split(flag1, -1).length;\n List<Table> list = new ArrayList<Table>();\n for (int i = 0; i < size; i++) {\n Table t = new Table();\n\n try {\n t.setTable1(tables[0].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable2(tables[1].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable2(contract.getTableList1().get(i).getTable0());\n } catch (Exception e) {\n\n }\n\n String str = t.getTable0() + t.getTable1() + t.getTable2() + t.getTable3() + t.getTable4() + t.getTable5() + t.getTable6();\n if (!\"\".equals(str)) {\n list.add(t);\n }\n\n }\n contract.setTableList2(list);\n }\n if (contract.getTable2H() != null && contract.getTable2H().length() != 2) {\n String table = contract.getTable2H();\n String[] tables = table.split(flag2, -1);\n int size = tables[0].split(flag1, -1).length;\n List<Table> list = new ArrayList<Table>();\n for (int i = 0; i < size; i++) {\n Table t = new Table();\n try {\n t.setTable0(tables[0].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable1(tables[1].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable2(tables[2].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n\n\n String str = t.getTable0() + t.getTable1() + t.getTable2() + t.getTable3() + t.getTable4() + t.getTable5();\n if (!\"\".equals(str)) {\n list.add(t);\n }\n\n }\n contract.setTableList2H(list);\n }\n\n\n if (contract.getTable11() != null && contract.getTable11().length() != 3) {\n String table = contract.getTable11();\n String[] tables = table.split(flag2, -1);\n int size = tables[0].split(flag1, -1).length;\n List<Table> list = new ArrayList<Table>();\n for (int i = 0; i < size; i++) {\n Table t = new Table();\n try {\n t.setTable0(tables[0].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable1(tables[1].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable2(tables[2].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable3(tables[3].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable4(tables[4].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable5(tables[5].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable6(contract.getTableList1().get(i).getTable0());\n } catch (Exception e) {\n\n }\n String str = t.getTable0() + t.getTable1() + t.getTable2() + t.getTable3() + t.getTable4() + t.getTable5() + t.getTable6();\n if (!\"\".equals(str)) {\n list.add(t);\n }\n\n }\n contract.setTableList11(list);\n }\n\n if (contract.getTable33() != null && contract.getTable33().length() != 2) {\n String table = contract.getTable33();\n String[] tables = table.split(flag2, -1);\n int size = tables[0].split(flag1, -1).length;\n List<Table> list = new ArrayList<Table>();\n for (int i = 0; i < size; i++) {\n Table t = new Table();\n try {\n t.setTable0(tables[0].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable1(tables[1].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n try {\n t.setTable2(tables[2].split(flag1, size)[i]);\n } catch (Exception e) {\n }\n\n\n String str = t.getTable0() + t.getTable1() + t.getTable2();\n if (!\"\".equals(str)) {\n list.add(t);\n }\n\n }\n contract.setTableList33(list);\n }\n }", "public void generateWithBigramModel (String start) {\n\t\tRandom r = new Random();\n//\t\tList<String> biList = new ArrayList<>();\n//\t\tfor (Map.Entry<String, Integer> entry : this.bi.entrySet()) {\n//\t\t\tif (entry.getKey().startsWith(start)) {\n//\t\t\t\tfor (int i = 0; i < entry.getValue(); i++) {\n//\t\t\t\t\tbiList.add(entry.getKey());\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t\tint maxLen = 200;\n//\t\tstart = biList.get(r.nextInt(biList.size()));\n\t\tStringBuilder sb = new StringBuilder(start);\n\t\tList<String> biList = null;\n\t\twhile (sb.charAt(0) != '$' || maxLen > 0) {\n\t\t\tSystem.out.print(sb.charAt(0));\n\t\t\tsb.deleteCharAt(0);\n\t\t\tbiList = new ArrayList<>();\n\t\t\tfor (Map.Entry<String, Integer> entry : this.tri.entrySet()) {\n\t\t\t\tif (entry.getKey().startsWith(sb.toString())) {\n\t\t\t\t\tfor (int i = 0; i < entry.getValue(); i++) {\n\t\t\t\t\t\tbiList.add(entry.getKey());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (biList.size() > 0) {\n\t\t\t\tsb = new StringBuilder(biList.get(r.nextInt(biList.size())));\n\t\t\t}\n\t\t\t\n\t\t\tmaxLen--;\n\t\t}\n\t\tSystem.out.println();\n\t}", "public Database createTableFromArray(int [][] dataDbn){\r\n \tDatabase db = new Database();\r\n \tTable table = null;\r\n \tToken t = null, t2 = null;\r\n \tAttribute attr = null;\r\n \tList ll;\r\n \tLinkedList attributeValues = new LinkedList();\r\n \tLinkedList sampleValueList;\r\n \tint numGenesTotal;\r\n \tint samples;\r\n \tString atrNode = \"node\";\r\n \t\r\n \ttry {\r\n \t\ttable = new Table(); \r\n \t\ttable.setName(\"name\");\r\n \t}catch(Exception e){\r\n \t\t\r\n\t\t\te.printStackTrace();\r\n \t}\r\n \t\r\n \t\r\n \tnumGenesTotal = dataDbn[0].length;\r\n \tsamples = dataDbn.length;\r\n \t\r\n \t// each gene has 3 levels (3 attributes). they are represent by 0,1,2\r\n \tattributeValues.add(new Integer(0));\r\n \tattributeValues.add(new Integer(1));\r\n \tattributeValues.add(new Integer(2));\r\n \t\r\n \t// set attributes for each gene\r\n \tfor(int k=0;k<numGenesTotal;k++){\r\n \t\tString name = atrNode + k;\r\n \t\tattr = new Attribute(name);\r\n \t\tattr.setValues(attributeValues);\r\n \t\ttable.addAttribute(attr);\r\n \t}\r\n \t\r\n \t// read dbnData and load gene's value of each sample in to List and then add this List in to the table\r\n \tfor(int i =0;i<samples;i++){\r\n \t\tsampleValueList = new LinkedList();\r\n \t\tfor(int j=0; j<numGenesTotal;j++){\r\n \t\t\tInteger val = new Integer(dataDbn[i][j]);\r\n \t\t\tsampleValueList.add(val);\r\n \t\t}\r\n \t\ttable.addTuple(new Tuple(sampleValueList));\r\n \t}\r\n \t\r\n \tdb.addTable(table);\r\n \t/*\r\n \tString filePath = \"C:\\\\Users\\\\devamuni\\\\Documents\\\\D_Result\\\\Input.out\";\r\n File f1 = new File(filePath);\r\n try {\r\n\t\t\tOutputStream os = new FileOutputStream(f1);\r\n\t\t\tsave(os, db);\r\n } catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\t\r\n\t\t\te.printStackTrace();\r\n } */\r\n \treturn db;\r\n }", "@SuppressWarnings(\"unchecked\")\n private StateMetadata<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>[] createStateMetadataTable() {\n metadata0eol_metadata0reduceeoi_eol = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.eol,reduceeoi_eol);\n metadata0instr_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.instr,null);\n metadata0lpar_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.lpar,null);\n metadata0rcurl_metadata0reduceexpr_map = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.rcurl,reduceexpr_map);\n metadata0expr_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.expr,null);\n metadata0rpar_metadata0reduceexpr_parens = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.rpar,reduceexpr_parens);\n metadata0block_metadata0reduceblock_param_lambda = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.block,reduceblock_param_lambda);\n metadata0id_metadata0reduceexpr_field_access = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.id,reduceexpr_field_access);\n metadata0dot_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.dot,null);\n metadata0le_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.le,null);\n metadata0block_param_optional_8_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.block_param_optional_8,null);\n metadata0parameter_metadata0reduceparameter_star_4_rec = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.parameter,reduceparameter_star_4_rec);\n metadata0expr_star_9_sub_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.expr_star_9_sub,null);\n metadata0plus_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.plus,null);\n metadata0rpar_metadata0reduceexpr_mthcall = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.rpar,reduceexpr_mthcall);\n metadata0comma_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.comma,null);\n metadata0quote_metadata0reduceselector_quote = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.quote,reduceselector_quote);\n metadata0null_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(null,null);\n metadata0id_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.id,null);\n metadata0parameter_metadata0reduceparameter_star_3_rec = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.parameter,reduceparameter_star_3_rec);\n metadata0_while_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum._while,null);\n metadata0instrs_metadata0reduceinstrs_optional_0_instrs = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.instrs,reduceinstrs_optional_0_instrs);\n metadata0block_metadata0reduceblock_param_block = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.block,reduceblock_param_block);\n metadata0instrs_metadata0reduceinstrs_rec = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.instrs,reduceinstrs_rec);\n metadata0slash_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.slash,null);\n metadata0entry_metadata0reduceentry_star_10_element = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.entry,reduceentry_star_10_element);\n metadata0_return_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum._return,null);\n metadata0parameter_star_3_sub_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.parameter_star_3_sub,null);\n metadata0ropt_metadata0reduceexpr_list = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.ropt,reduceexpr_list);\n metadata0pipe_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.pipe,null);\n metadata0instrs_optional_0_metadata0reducescript = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.instrs_optional_0,reducescript);\n metadata0instrs_optional_2_metadata0reduceblock = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.instrs_optional_2,reduceblock);\n metadata0quote_metadata0reduceentry_hint_quote = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.quote,reduceentry_hint_quote);\n metadata0parameter_metadata0reduceparameter_star_3_element = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.parameter,reduceparameter_star_3_element);\n metadata0expr_star_7_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.expr_star_7,null);\n metadata0id_metadata0reduceparameter_hint_id_id = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.id,reduceparameter_hint_id_id);\n metadata0at_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.at,null);\n metadata0parameter_star_3_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.parameter_star_3,null);\n metadata0repl_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.repl,null);\n metadata0bang_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.bang,null);\n metadata0rpar_metadata0reduceexpr_funcall = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.rpar,reduceexpr_funcall);\n metadata0ge_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.ge,null);\n metadata0lt_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.lt,null);\n metadata0parameter_metadata0reduceparameter_star_4_element = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.parameter,reduceparameter_star_4_element);\n metadata0parameter_star_4_sub_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.parameter_star_4_sub,null);\n metadata0doc_plus_1_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.doc_plus_1,null);\n metadata0doc_metadata0reducedoc_plus_1_rec = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.doc,reducedoc_plus_1_rec);\n metadata0entry_star_10_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.entry_star_10,null);\n metadata0quote_metadata0reduceexpr_quote = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.quote,reduceexpr_quote);\n metadata0aslash_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.aslash,null);\n metadata0entry_star_10_sub_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.entry_star_10_sub,null);\n metadata0minus_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.minus,null);\n metadata0expr_star_7_sub_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.expr_star_7_sub,null);\n metadata0mod_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.mod,null);\n metadata0expr_star_9_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.expr_star_9,null);\n metadata0eq_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.eq,null);\n metadata0ne_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.ne,null);\n metadata0rpar_metadata0reduceexpr_while = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.rpar,reduceexpr_while);\n metadata0_throw_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum._throw,null);\n metadata0selector_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.selector,null);\n metadata0instrs_metadata0reduceinstrs_optional_2_instrs = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.instrs,reduceinstrs_optional_2_instrs);\n metadata0semicolon_metadata0reduceeoi_semi = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.semicolon,reduceeoi_semi);\n metadata0gt_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.gt,null);\n metadata0script_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.script,null);\n metadata0value_metadata0reduceexpr_value = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.value,reduceexpr_value);\n metadata0lcurl_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.lcurl,null);\n metadata0expr_star_5_sub_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.expr_star_5_sub,null);\n metadata0_if_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum._if,null);\n metadata0colon_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.colon,null);\n metadata0rpar_metadata0reduceexpr_ifelse = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.rpar,reduceexpr_ifelse);\n metadata0eoi_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.eoi,null);\n metadata0block_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.block,null);\n metadata0doc_metadata0reducedoc_plus_1_element = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.doc,reducedoc_plus_1_element);\n metadata0id_metadata0reduceselector_id = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.id,reduceselector_id);\n metadata0star_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.star,null);\n metadata0block_param_optional_6_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.block_param_optional_6,null);\n metadata0assign_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.assign,null);\n metadata0block_param_metadata0reduceblock_param_optional_8_block_param = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.block_param,reduceblock_param_optional_8_block_param);\n metadata0rpar_metadata0reduceexpr_block = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.rpar,reduceexpr_block);\n metadata0id_metadata0reduceparameter_hint_quote_id = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.id,reduceparameter_hint_quote_id);\n metadata0lopt_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.lopt,null);\n metadata0entry_metadata0reduceentry_star_10_rec = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.entry,reduceentry_star_10_rec);\n metadata0quote_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.quote,null);\n metadata0id_metadata0reduceentry_hint_id = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.id,reduceentry_hint_id);\n metadata0parameter_star_4_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.parameter_star_4,null);\n metadata0__eof___metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.__eof__,null);\n metadata0text_metadata0reduceexpr_text = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.text,reduceexpr_text);\n metadata0block_param_metadata0reduceblock_param_optional_6_block_param = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.block_param,reduceblock_param_optional_6_block_param);\n metadata0rpar_metadata0reduceexpr_if = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithTerminal(TerminalEnum.rpar,reduceexpr_if);\n metadata0expr_star_5_metadata0null = StateMetadata.<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>createAllVersionWithNonTerminal(NonTerminalEnum.expr_star_5,null);\n\n return (StateMetadata<TerminalEnum,NonTerminalEnum,ProductionEnum,VersionEnum>[])new StateMetadata<?,?,?,?>[]{metadata0null_metadata0null,metadata0lpar_metadata0null,metadata0minus_metadata0null,metadata0_while_metadata0null,metadata0lpar_metadata0null,metadata0lopt_metadata0null,metadata0quote_metadata0reduceexpr_quote,metadata0plus_metadata0null,metadata0text_metadata0reduceexpr_text,metadata0at_metadata0null,metadata0id_metadata0reduceexpr_field_access,metadata0value_metadata0reduceexpr_value,metadata0lcurl_metadata0null,metadata0bang_metadata0null,metadata0id_metadata0null,metadata0assign_metadata0null,metadata0_if_metadata0null,metadata0lpar_metadata0null,metadata0aslash_metadata0null,metadata0lpar_metadata0null,metadata0quote_metadata0null,metadata0id_metadata0reduceparameter_hint_quote_id,metadata0id_metadata0null,metadata0id_metadata0reduceparameter_hint_id_id,metadata0parameter_star_4_metadata0null,metadata0colon_metadata0null,metadata0doc_metadata0reducedoc_plus_1_element,metadata0_return_metadata0null,metadata0expr_metadata0null,metadata0eq_metadata0null,metadata0expr_metadata0null,metadata0lpar_metadata0null,metadata0expr_star_5_metadata0null,metadata0pipe_metadata0null,metadata0parameter_star_3_metadata0null,metadata0colon_metadata0null,metadata0_throw_metadata0null,metadata0expr_metadata0null,metadata0minus_metadata0null,metadata0expr_metadata0null,metadata0lt_metadata0null,metadata0expr_metadata0null,metadata0ne_metadata0null,metadata0expr_metadata0null,metadata0dot_metadata0null,metadata0quote_metadata0reduceselector_quote,metadata0id_metadata0reduceselector_id,metadata0selector_metadata0null,metadata0lpar_metadata0null,metadata0expr_star_7_metadata0null,metadata0colon_metadata0null,metadata0instrs_optional_2_metadata0reduceblock,metadata0expr_metadata0null,metadata0slash_metadata0null,metadata0expr_metadata0null,metadata0star_metadata0null,metadata0expr_metadata0null,metadata0ge_metadata0null,metadata0expr_metadata0null,metadata0plus_metadata0null,metadata0expr_metadata0null,metadata0le_metadata0null,metadata0expr_metadata0null,metadata0gt_metadata0null,metadata0expr_metadata0null,metadata0mod_metadata0null,metadata0expr_metadata0null,metadata0doc_plus_1_metadata0null,metadata0doc_metadata0reducedoc_plus_1_rec,metadata0expr_metadata0null,metadata0instrs_metadata0reduceinstrs_optional_2_instrs,metadata0block_metadata0reduceblock_param_block,metadata0instr_metadata0null,metadata0eol_metadata0reduceeoi_eol,metadata0semicolon_metadata0reduceeoi_semi,metadata0eoi_metadata0null,metadata0instrs_metadata0reduceinstrs_rec,metadata0block_param_metadata0reduceblock_param_optional_8_block_param,metadata0block_param_optional_8_metadata0null,metadata0rpar_metadata0reduceexpr_mthcall,metadata0expr_metadata0null,metadata0expr_star_7_sub_metadata0null,metadata0comma_metadata0null,metadata0expr_metadata0null,metadata0block_metadata0reduceblock_param_lambda,metadata0parameter_star_3_sub_metadata0null,metadata0comma_metadata0null,metadata0parameter_metadata0reduceparameter_star_3_rec,metadata0parameter_metadata0reduceparameter_star_3_element,metadata0block_param_optional_6_metadata0null,metadata0rpar_metadata0reduceexpr_funcall,metadata0block_param_metadata0reduceblock_param_optional_6_block_param,metadata0expr_metadata0null,metadata0expr_star_5_sub_metadata0null,metadata0comma_metadata0null,metadata0expr_metadata0null,metadata0block_metadata0null,metadata0rpar_metadata0reduceexpr_block,metadata0parameter_metadata0reduceparameter_star_4_element,metadata0parameter_star_4_sub_metadata0null,metadata0comma_metadata0null,metadata0parameter_metadata0reduceparameter_star_4_rec,metadata0expr_metadata0null,metadata0colon_metadata0null,metadata0block_metadata0null,metadata0rpar_metadata0reduceexpr_if,metadata0colon_metadata0null,metadata0block_metadata0null,metadata0rpar_metadata0reduceexpr_ifelse,metadata0expr_metadata0null,metadata0expr_metadata0null,metadata0entry_star_10_metadata0null,metadata0rcurl_metadata0reduceexpr_map,metadata0expr_metadata0null,metadata0colon_metadata0null,metadata0expr_metadata0null,metadata0quote_metadata0reduceentry_hint_quote,metadata0id_metadata0reduceentry_hint_id,metadata0entry_metadata0reduceentry_star_10_element,metadata0entry_star_10_sub_metadata0null,metadata0comma_metadata0null,metadata0entry_metadata0reduceentry_star_10_rec,metadata0expr_metadata0null,metadata0expr_star_9_sub_metadata0null,metadata0comma_metadata0null,metadata0expr_metadata0null,metadata0expr_metadata0null,metadata0expr_star_9_metadata0null,metadata0ropt_metadata0reduceexpr_list,metadata0expr_metadata0null,metadata0colon_metadata0null,metadata0block_metadata0null,metadata0rpar_metadata0reduceexpr_while,metadata0expr_metadata0null,metadata0expr_metadata0null,metadata0rpar_metadata0reduceexpr_parens,metadata0repl_metadata0null,metadata0__eof___metadata0null,metadata0eoi_metadata0null,metadata0expr_metadata0null,metadata0expr_metadata0null,metadata0null_metadata0null,metadata0script_metadata0null,metadata0__eof___metadata0null,metadata0instrs_optional_0_metadata0reducescript,metadata0instrs_metadata0reduceinstrs_optional_0_instrs};\n }", "public static LearningTable createLearningTable() {\n\t\tLearningTable table = new LearningTable(null, null, null);\n\t\t\n\t\ttable.getAttributes().addAll(createAttributes());\n\t\ttable.getExamples().addAll(createExamples(table.getAttributes()));\n\t\t\n\t\treturn table;\n\t}", "@Test\n\tpublic void testConstructorInputStream() throws Exception\n\t{\n\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\n\t\tsmall_model.writeModelBinary(baos);\n\t\t\n\t\t//System.out.println(small_model);\n\n\t\tGeoTessModel model = new GeoTessModel(new DataInputStream(new ByteArrayInputStream(baos.toByteArray())));\n\t\t\n\t\t//System.out.println(model);\n\t\t\n\t\tassertTrue(small_model.equals(model));\n\t\t\n\t\t// write model to byte array in ascii format\n\t\tbaos = new ByteArrayOutputStream();\n\t\tsmall_model.writeModelAscii(baos);\n\t\t\n\t\tmodel = new GeoTessModel(new Scanner(new ByteArrayInputStream(baos.toByteArray())));\n\t\t\n\t\t//System.out.println(model);\n\t\t\n\t\tassertTrue(small_model.equals(model));\n\t}", "private void createHammed()\n\t{\n\t\tint j=0;\n\t\tboolean skip = false;\n\t\t\n\t\t\n\t\tfor (int i=0;i<binaryCode.length; i++)\n\t\t{\t\n\t\t\t//checks to see if the bit is a parity bit\n\t\t\tfor (int k=0; k<PARITY.length;k++)\n\t\t\t{\n\t\t\t\t//if it is a parity bit, it skips\n\t\t\t\tif (i==PARITY[k])\n\t\t\t\t{\n\t\t\t\t\tskip=true;\n\t\t\t\t} \n\n\t\t\t}\n\t\t\t\n\t\t\tif (skip)\n\t\t\t{\n\t\t\t\tskip=false;\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t//if it is not a parity bit, it places the value into the bit position\n\t\t\t\tbinaryCode[i]=binaryNumber.getBitValue(j);\n\t\t\t\tj++;\n\t\t\t}\n\n\t\t}\n\t}", "private byte[] parseInsertRecord_lantrix(String s)\n { \n // ASCII Data:\t\n // Example:\n // ------- \t\n\t\t//>RGP190805211932-3457215-058493640000000FFBF0300;ID=8247;#2122;*54<CRLF\n\t\t// R = [ 0, 1] Response \n // GP = [ 1, 3] Global Position \n\t\t// 190805 = [ 3, 9] GPS time-of-day DDMMAA\n\t\t// 211932 = [ 9 , 15] GPS time-of-hours GMT HHMMSS\n\t\t// -3457215 = [ 15, 23] Latitude \n\t\t// -05849364 = [ 23, 32] Longitude\n\t\t// 000 = [ 32, 35] Speed (kph 0...999)\n\t\t// 000 = [ 35, 38] Heading (degrees 0...359)\n\t\t// 0 = [ 38, 39] GPS source 3 = Position 3D, 2 = Position 2D , 0= invalid\n\t\t// FF = [ 39, 41] Age of the data in Hexadecimal\n\t\t// BF = [ 41, 43] I/O Digital \n\t\t// 03 = [ 43, 45] Number of events generated by the report (decimal).\n\t\t// 00 = [ 45, 47] Horizontal Accuracy HDOP (0 .. 50)\n\t\t// ; = Separator\n\t\t// ID=d8247 = Number Device ID \n\t\t// ; = Separator\n\t\t// #2122 = [ 57 , 62] Sentence Number (as generated by the mobile van from # 0000 to # 7FFF and those generated by the base go # 8000 to # FFFF)\n\t\t// ;*54 = Checksum\n\t\t// < = End of message\n\t\t// CRLF = End of line and carriage advance \n\n /* pre-validate */\n if (StringTools.isBlank(s)) {\n Print.logError(\"String is null/blank\");\n return null;\n } else\n if (s.length() < 5) {\n Print.logError(\"String is invalid length\");\n return null;\n } else\n if (!s.startsWith(\">\")) {\n Print.logError(\"String does not start with '>'\");\n return null;\n }\n\n /* ends with \"<\"? */\n int se = s.endsWith(\"<\")? (s.length() - 1) : s.length();\n s = s.substring(1,se);\n\n /* split */\n String T[] = StringTools.split(s,';'); \n\n /* RPG record */\n if (T[0].length() < 33) {\n Print.logError(\"Invalid 'RPG' data length\");\n return null;\n }\n\n /* mobile id */\n String mobileID = null;\n for (int i = 1; i < T.length; i++) {\n if (T[i].startsWith(\"ID=\")) {\n mobileID = T[i].substring(3);\n break;\n }\n }\n\n\t\t/* Sentence Number */\n String Sentence_number = null;\n for (int j = 1; j < T.length; j++) {\n if (T[j].startsWith(\"#\")) {\n Sentence_number = T[j].substring(1);\n break;\n }\n }\n\n //Arming the ACK frame to remove the data sent from the tracker\n\t String tracker_ID = mobileID;\n\t\tString frame_data_checksum = null;\t\t\n\t\tframe_data_checksum = \">ACK;ID=\" + tracker_ID + \";#\" + Sentence_number + \";*\";\n\t\tString chksum = getCheckSum(frame_data_checksum);\n\t\tString frame_data_ACK = null;\t\t\t\n\t\tframe_data_ACK = frame_data_checksum + chksum + \"<\\r\\n\";\n\n\t\t/* parse */ \t\n long dmy = StringTools.parseLong(T[0].substring( 3, 9), 0L);\n long hms = StringTools.parseLong(T[0].substring( 9, 15), 0L); \n long fixtime = this._getUTCSeconds(dmy, hms);\t\t\n double latitude = (double)StringTools.parseLong(T[0].substring( 15,23),0L) / 100000.0;\n double longitude = (double)StringTools.parseLong(T[0].substring(23,32),0L) / 100000.0;\n\t\tdouble KPH = StringTools.parseDouble(T[0].substring(32,35), 0.0);\n double speedKPH = KPH; \n double headingDeg = StringTools.parseDouble(T[0].substring(35,38), 0.0);\n\t\tint age_data = Integer.parseInt(T[0].substring(39,41),16);\n String decimal = Integer.toString(age_data);\n long inout = Long.parseLong(T[0].substring(41,43),16);\n String binary_io = Long.toBinaryString(inout);\n\t\tString srcStr = T[0].substring(38,39);\n String ageStr = decimal;\n double altitudeM = 0.0;\n double odomKM = 0.0;\n long gpioInput = 0L; \n\t\tint statusCode = StatusCodes.STATUS_LOCATION;\n\n /* I/O Digital */\n\t\tgpioInput = inout; \n\n\t\t/* get time */ \n if (fixtime <= 0L) {\n Print.logWarn(\"Invalid date.\");\n fixtime = DateTime.getCurrentTimeSec(); // default to now\n } \n\n /* lat/lon valid? */\n boolean validGPS = true;\n if (!GeoPoint.isValid(latitude,longitude)) {\n Print.logWarn(\"Invalid lat/lon: \" + latitude + \"/\" + longitude);\n validGPS = false;\n latitude = 0.0;\n longitude = 0.0;\n speedKPH = 0.0;\n headingDeg = 0.0;\n }\n GeoPoint geoPoint = new GeoPoint(latitude,longitude);\n\n /* adjustments to received values */\n if (speedKPH < MINIMUM_SPEED_KPH) {\n speedKPH = 0.0;\n headingDeg = 0.0;\n } else\n if (headingDeg < 0.0) { \n headingDeg = 0.0;\n }\n \n /* debug */\t\t\n Print.logInfo(\"MobileID : \" + mobileID);\n\t\tPrint.logInfo(\"Sentence : \" + Sentence_number);\n Print.logInfo(\"Timestamp: \" + fixtime + \" [\" + new DateTime(fixtime) + \"]\");\n Print.logInfo(\"GeoPoint : \" + geoPoint);\n Print.logInfo(\"Speed km/h: \" + speedKPH + \" [\" + headingDeg + \"]\");\n\n /* mobile-id */\n if (StringTools.isBlank(mobileID)) {\n Print.logError(\"Missing MobileID\");\n return null;\n }\n\n /* find Device */\n String accountID = \"\";\n String deviceID = \"\";\n String uniqueID = \"\";\n //Device device = DCServerFactory.loadDeviceByPrefixedModemID(UNIQUEID_PREFIX, mobileID);\n Device device = DCServerConfig.loadDeviceUniqueID(Main.getServerConfig(), mobileID);\n if (device == null) {\n return null; // errors already displayed\n } else {\n accountID = device.getAccountID();\n deviceID = device.getDeviceID();\n uniqueID = device.getUniqueID();\n Print.logInfo(\"UniqueID : \" + uniqueID);\n Print.logInfo(\"DeviceID : \" + accountID + \"/\" + deviceID);\n }\n \n /* check IP address */\n DataTransport dataXPort = device.getDataTransport();\n if ((this.ipAddress != null) && !dataXPort.isValidIPAddress(this.ipAddress)) {\n DTIPAddrList validIPAddr = dataXPort.getIpAddressValid(); // may be null\n Print.logError(\"Invalid IP Address from device: \" + this.ipAddress + \" [expecting \" + validIPAddr + \"]\");\n return null;\n }\n dataXPort.setIpAddressCurrent(this.ipAddress); // FLD_ipAddressCurrent\n dataXPort.setRemotePortCurrent(this.clientPort); // FLD_remotePortCurrent\n dataXPort.setLastTotalConnectTime(DateTime.getCurrentTimeSec()); // FLD_lastTotalConnectTime\n if (!dataXPort.getDeviceCode().equalsIgnoreCase(Constants.DEVICE_CODE)) {\n dataXPort.setDeviceCode(Constants.DEVICE_CODE); // FLD_deviceCode\n }\n\n /* reject invalid GPS fixes? */\n if (!validGPS && (statusCode == StatusCodes.STATUS_LOCATION)) {\n // ignore invalid GPS fixes that have a simple 'STATUS_LOCATION' status code\n Print.logWarn(\"Ignoring event with invalid latitude/longitude\");\n return null;\n }\n\n /* estimate GPS-based odometer */\n if (odomKM <= 0.0) {\n // calculate odometer\n odomKM = (ESTIMATE_ODOMETER && validGPS)? \n device.getNextOdometerKM(geoPoint) : \n device.getLastOdometerKM();\n } else {\n // bounds-check odometer\n odomKM = device.adjustOdometerKM(odomKM);\n }\n Print.logInfo(\"OdometerKM: \" + odomKM);\n\n /* simulate Geozone arrival/departure */\n if (SIMEVENT_GEOZONES && validGPS) {\n java.util.List<Device.GeozoneTransition> zone = device.checkGeozoneTransitions(fixtime, geoPoint);\n if (zone != null) {\n for (Device.GeozoneTransition z : zone) {\n this.insertEventRecord(device, \n z.getTimestamp(), z.getStatusCode(), z.getGeozone(),\n geoPoint, gpioInput, speedKPH, headingDeg, altitudeM, odomKM);\n Print.logInfo(\"Geozone : \" + z);\n if (z.getStatusCode() == statusCode) {\n // suppress 'statusCode' event if we just added it here\n Print.logDebug(\"StatusCode already inserted: 0x\" + StatusCodes.GetHex(statusCode));\n statusCode = StatusCodes.STATUS_IGNORE;\n }\n }\n }\n }\n\n /* insert event */\n if (statusCode == StatusCodes.STATUS_NONE) {\n // ignore this event\n } else\n if ((statusCode != StatusCodes.STATUS_LOCATION) || !validGPS) {\n this.insertEventRecord(device, \n fixtime, statusCode, null/*GeoZone*/,\n geoPoint, gpioInput, speedKPH, headingDeg, altitudeM, odomKM);\n } else\n if (!device.isNearLastValidLocation(geoPoint,MINIMUM_MOVED_METERS)) {\n if ((statusCode == StatusCodes.STATUS_LOCATION) && (speedKPH > 0.0)) {\n statusCode = StatusCodes.STATUS_MOTION_IN_MOTION;\n }\n this.insertEventRecord(device, \n fixtime, statusCode, null/*GeoZone*/,\n geoPoint, gpioInput, speedKPH, headingDeg, altitudeM, odomKM);\n }\n \n /* save device changes */\n try {\n // TODO: check \"this.device\" vs \"this.dataXPort\" \n device.updateChangedEventFields();\n } catch (DBException dbe) {\n Print.logException(\"Unable to update Device: \" + accountID + \"/\" + deviceID, dbe);\n } finally {\n //\n }\n Print.logInfo(\"ACK: \" + frame_data_ACK);\n\t\treturn frame_data_ACK.getBytes();// //return required acknowledgement (ACK) back to the device\n\n }", "public HuffmanCodes() {\n\t\thuffBuilder = new PriorityQueue<CS232LinkedBinaryTree<Integer, Character>>();\n\t\tfileData = new ArrayList<char[]>();\n\t\tfrequencyCount = new int[127];\n\t\thuffCodeVals = new String[127];\n\t}", "public abstract DataSet getTablesByType(InputStream inputSteam,\r\n String name, String pattern, String type)\r\n throws Exception;", "protected void constructTable(Logger l, Statement s, int run)\n throws SQLException{\n createTable(s, run);\n insertResults(l,s,run);\n }", "public static void ComputeTables() {\n int[][] nbl2bit\n = {\n new int[]{1, 0, 0, 0}, new int[]{1, 0, 0, 1}, new int[]{1, 0, 1, 0}, new int[]{1, 0, 1, 1},\n new int[]{1, 1, 0, 0}, new int[]{1, 1, 0, 1}, new int[]{1, 1, 1, 0}, new int[]{1, 1, 1, 1},\n new int[]{-1, 0, 0, 0}, new int[]{-1, 0, 0, 1}, new int[]{-1, 0, 1, 0}, new int[]{-1, 0, 1, 1},\n new int[]{-1, 1, 0, 0}, new int[]{-1, 1, 0, 1}, new int[]{-1, 1, 1, 0}, new int[]{-1, 1, 1, 1}\n };\n\n int step, nib;\n\n /* loop over all possible steps */\n for (step = 0; step <= 48; step++) {\n /* compute the step value */\n int stepval = (int) (Math.floor(16.0 * Math.pow(11.0 / 10.0, (double) step)));\n\n\n /* loop over all nibbles and compute the difference */\n for (nib = 0; nib < 16; nib++) {\n diff_lookup[step * 16 + nib] = nbl2bit[nib][0]\n * (stepval * nbl2bit[nib][1]\n + stepval / 2 * nbl2bit[nib][2]\n + stepval / 4 * nbl2bit[nib][3]\n + stepval / 8);\n }\n }\n }", "protected void sequence_DEFINE_DefinitionTable_TABLE(ISerializationContext context, DefinitionTable semanticObject) {\n\t\tgenericSequencer.createSequence(context, semanticObject);\n\t}", "void initTable();", "Table createTable();", "@Override\n public void onCreate(SQLiteDatabase db) {\n db.execSQL(\n \"create table notes \" +\n \"(id integer primary key autoincrement, \" +\n \"unit text,version interger,content blob)\"\n );\n }", "protected void constructTable(Logger l, Statement s, int run)\n throws SQLException{\n createTable(s, run);\n insertResults(l,s,run);\n }", "private TimeTable createTimeTableStary(){\n\n final String dateString = \"03.07.2017\";\n SimpleDateFormat formater = new SimpleDateFormat(\"dd.MM.yyyy\");\n\n Date timetableDate = null;\n try {\n timetableDate = formater.parse(dateString);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n ArrayList<Subject> testSubs = new ArrayList<>();\n testSubs.add(new Subject(\"Př\",\"Teoretická informatika\",732,\"UAI\",\"08:00\",\"09:30\", Calendar.MONDAY, \"BB\", \"1\",\"3.10.2016\",\"2.1.2017\",true));\n testSubs.add(new Subject(\"Př\",\"Bakalářská angličtina NS 3\",230,\"OJZ\",\"10:00\",\"11:30\", Calendar.TUESDAY, \"BB\", \"4\",\"3.10.2016\",\"2.1.2017\",true));\n testSubs.add(new Subject(\"Cv\",\"Teoretická informatika\",732,\"UAI\",\"14:30\",\"16:00\", Calendar.TUESDAY, \"AV\", \"Pč4\",\"3.10.2016\",\"2.1.2017\",true));\n\n\n return new TimeTable (timetableDate, testSubs);\n\n }", "public void initTable();", "public char[][] regenCharTable();", "SpCharInSeq create(@Valid SpCharInSeq spCharInSeq);", "public interface Decoder {\r\n \t \r\n\t// Main method that every decoder needs to overwrite \r\n\tpublic List<Hypothesis> extract_phase(int N);\r\n\r\n\t// Once a tree segment is matched with a pattern , what do we do with it ? \r\n\tpublic boolean processMatch(ParseTreeNode ptn, Integer patId,\r\n\t\t\tArrayList<ParseTreeNode> frontiers,\r\n\t\t\tArrayList<GrammarRule> targetStrings);\r\n\t\r\n\tpublic void addPhraseEntriesToForest(ArrayList<PhraseRule> targetList, ParseTreeNode frontier, boolean isRoot);\r\n\t// Add grammar rules to forest \r\n\tpublic boolean addToTargetForest(GrammarRule targetInfo, ArrayList<ParseTreeNode> frontiers, boolean isSrcRoot);\r\n\t// Add glue rules\r\n\tpublic void addGlueRulesToTargetForest(ParseTreeNode ptn);\r\n\t// Handle OOV - copy, delete, transliterate etc - Perhaps put in a different class later TODO\r\n\tpublic void handleOOV(ParseTreeNode ptn);\r\n\tpublic void addLexicalBackoff(LexicalRule backoff, ParseTreeNode ptn);\r\n}", "public static final String generateTableTestCase(){\n\t\n\t\tint[] operators = new int[]{AND,AND_AND,DIVIDE,GREATER,GREATER_EQUAL,\n\t\t\t\tLEFT_SHIFT,LESS,LESS_EQUAL,MINUS,MULTIPLY,OR,OR_OR,PLUS,REMAINDER,\n\t\t\t\tRIGHT_SHIFT,UNSIGNED_RIGHT_SHIFT,XOR};\n\t\n\t\tclass Decode {\n\t\t\tpublic final String constant(int code){\n\t\t\t\tswitch(code){ \n\t\t\t\t\tcase T_boolean \t: return \"true\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_byte\t\t: return \"((byte) 3)\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_char\t\t: return \"'A'\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_double\t: return \"300.0d\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_float\t: return \"100.0f\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_int\t\t: return \"1\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_long\t\t: return \"7L\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_JavaLangString\t: return \"\\\"hello-world\\\"\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_null\t\t: return \"null\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_short\t: return \"((short) 5)\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_JavaLangObject\t: return \"null\";} //$NON-NLS-1$\n\t\t\t\treturn \"\";} //$NON-NLS-1$\n\t\n\t\t\tpublic final String type(int code){\n\t\t\t\tswitch(code){ \n\t\t\t\t\tcase T_boolean \t: return \"z\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_byte\t\t: return \"b\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_char\t\t: return \"c\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_double\t: return \"d\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_float\t: return \"f\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_int\t\t: return \"i\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_long\t\t: return \"l\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_JavaLangString\t: return \"str\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_null\t\t: return \"null\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_short\t: return \"s\"; //$NON-NLS-1$\n\t\t\t\t\tcase T_JavaLangObject\t: return \"obj\";} //$NON-NLS-1$\n\t\t\t\treturn \"xxx\";} //$NON-NLS-1$\n\t\t\t\n\t\t\tpublic final String operator(int operator){\n\t\t\t\t\tswitch (operator) {\n\t\t\t\t\tcase EQUAL_EQUAL :\treturn \"==\"; //$NON-NLS-1$\n\t\t\t\t\tcase LESS_EQUAL :\treturn \"<=\"; //$NON-NLS-1$\n\t\t\t\t\tcase GREATER_EQUAL :return \">=\"; //$NON-NLS-1$\n\t\t\t\t\tcase LEFT_SHIFT :\treturn \"<<\"; //$NON-NLS-1$\n\t\t\t\t\tcase RIGHT_SHIFT :\treturn \">>\"; //$NON-NLS-1$\n\t\t\t\t\tcase UNSIGNED_RIGHT_SHIFT :\treturn \">>>\"; //$NON-NLS-1$\n\t\t\t\t\tcase OR_OR :return \"||\"; //$NON-NLS-1$\n\t\t\t\t\tcase AND_AND :\t\treturn \"&&\"; //$NON-NLS-1$\n\t\t\t\t\tcase PLUS :\t\t\treturn \"+\"; //$NON-NLS-1$\n\t\t\t\t\tcase MINUS :\t\treturn \"-\"; //$NON-NLS-1$\n\t\t\t\t\tcase NOT :\t\t\treturn \"!\"; //$NON-NLS-1$\n\t\t\t\t\tcase REMAINDER :\treturn \"%\"; //$NON-NLS-1$\n\t\t\t\t\tcase XOR :\t\t\treturn \"^\"; //$NON-NLS-1$\n\t\t\t\t\tcase AND :\t\t\treturn \"&\"; //$NON-NLS-1$\n\t\t\t\t\tcase MULTIPLY :\t\treturn \"*\"; //$NON-NLS-1$\n\t\t\t\t\tcase OR :\t\t\treturn \"|\"; //$NON-NLS-1$\n\t\t\t\t\tcase TWIDDLE :\t\treturn \"~\"; //$NON-NLS-1$\n\t\t\t\t\tcase DIVIDE :\t\treturn \"/\"; //$NON-NLS-1$\n\t\t\t\t\tcase GREATER :\t\treturn \">\"; //$NON-NLS-1$\n\t\t\t\t\tcase LESS :\t\t\treturn \"<\";\t} //$NON-NLS-1$\n\t\t\t\treturn \"????\";} //$NON-NLS-1$\n\t\t}\n\t\n\t\t\t\n\t\tDecode decode = new Decode();\n\t\tString s;\n\t\n\t\ts = \"\\tpublic static void binaryOperationTablesTestCase(){\\n\" + //$NON-NLS-1$\n\t\n\t\t\t\"\\t\\t//TC test : all binary operation (described in tables)\\n\"+ //$NON-NLS-1$\n\t\t\t\"\\t\\t//method automatically generated by\\n\"+ //$NON-NLS-1$\n\t\t\t\"\\t\\t//org.eclipse.jdt.internal.compiler.ast.OperatorExpression.generateTableTestCase();\\n\"+ //$NON-NLS-1$\n\t\t\n\t\t\t\"\\t\\tString str0;\\t String str\\t= \"+decode.constant(T_JavaLangString)+\";\\n\"+ //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t\"\\t\\tint i0;\\t int i\\t= \"+decode.constant(T_int)+\";\\n\"+ //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t\"\\t\\tboolean z0;\\t boolean z\\t= \"+decode.constant(T_boolean)+\";\\n\"+ //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t\"\\t\\tchar c0; \\t char c\\t= \"+decode.constant(T_char)+\";\\n\"+ //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t\"\\t\\tfloat f0; \\t float f\\t= \"+decode.constant(T_float)+\";\\n\"+ //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t\"\\t\\tdouble d0;\\t double d\\t= \"+decode.constant(T_double)+\";\\n\"+ //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t\"\\t\\tbyte b0; \\t byte b\\t= \"+decode.constant(T_byte)+\";\\n\"+ //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t\"\\t\\tshort s0; \\t short s\\t= \"+decode.constant(T_short)+\";\\n\"+ //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t\"\\t\\tlong l0; \\t long l\\t= \"+decode.constant(T_long)+\";\\n\"+ //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t\"\\t\\tObject obj0; \\t Object obj\\t= \"+decode.constant(T_JavaLangObject)+\";\\n\"+ //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t\"\\n\"; //$NON-NLS-1$\n\t\n\t\tint error = 0;\t\t\n\t\tfor (int i=0; i < operators.length; i++)\n\t\t{\tint operator = operators[i];\n\t\t\tfor (int left=0; left<16;left++)\n\t\t\tfor (int right=0; right<16;right++)\n\t\t\t{\tint result = (OperatorSignatures[operator][(left<<4)+right]) & 0x0000F;\n\t\t\t\tif (result != T_undefined)\n\t\n\t\t\t\t\t//1/ First regular computation then 2/ comparaison\n\t\t\t\t\t//with a compile time constant (generated by the compiler)\n\t\t\t\t\t//\tz0 = s >= s;\n\t\t\t\t\t//\tif ( z0 != (((short) 5) >= ((short) 5)))\n\t\t\t\t\t//\t\tSystem.out.println(155);\n\t\n\t\t\t\t{\ts += \"\\t\\t\"+decode.type(result)+\"0\"+\" = \"+decode.type(left); //$NON-NLS-1$ //$NON-NLS-3$ //$NON-NLS-2$\n\t\t\t\t\ts += \" \"+decode.operator(operator)+\" \"+decode.type(right)+\";\\n\"; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$\n\t\t\t\t\tString begin = result == T_JavaLangString ? \"\\t\\tif (! \" : \"\\t\\tif ( \"; //$NON-NLS-2$ //$NON-NLS-1$\n\t\t\t\t\tString test = result == T_JavaLangString ? \".equals(\" : \" != (\"; //$NON-NLS-2$ //$NON-NLS-1$\n\t\t\t\t\ts += begin\t+decode.type(result)+\"0\"+test //$NON-NLS-1$\n\t\t\t\t\t\t\t\t+decode.constant(left)+\" \" //$NON-NLS-1$\n\t\t\t\t\t\t\t\t+decode.operator(operator)+\" \" //$NON-NLS-1$\n\t\t\t\t\t\t\t\t+decode.constant(right)+\"))\\n\"; //$NON-NLS-1$\n\t\t\t\t\ts += \"\\t\\t\\tSystem.out.println(\"+ (++error) +\");\\n\"; //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\treturn s += \"\\n\\t\\tSystem.out.println(\\\"binary tables test : done\\\");}\"; //$NON-NLS-1$\n\t}", "public static void decode() {\n int first = BinaryStdIn.readInt();\n String t = BinaryStdIn.readString();\n int n = t.length();\n int[] count = new int[256 + 1];\n int[] next = new int[n];\n int i = 0;\n while (i < n) {\n count[t.charAt(i) + 1]++;\n i++;\n }\n i = 1;\n while (i < 256 + 1) {\n count[i] += count[i - 1];\n i++;\n }\n i = 0;\n while (i < n) {\n next[count[t.charAt(i)]++] = i;\n i++;\n }\n i = next[first];\n int c = 0;\n while (c < n){\n BinaryStdOut.write(t.charAt(i));\n i = next[i];\n c++;\n }\n BinaryStdOut.close();\n }", "public KMP(String pat) {\n this.R = 256; //the ascii numerical equivalent of a character could be from 1-256\n \t\t\t //So that many number of rows\n this.pat = pat;\n\n // build DFA from pattern\n int M = pat.length();\n\n //dfa array is a lookup table for the next transition, given the 'character' and 'current-state'\n //dfa is built from the pattern\n //read: dfa[incomingCharacter][currentState]\n dfa = new int[R][M]; //R possible characters, M possible states\n \n //if I am currently in State 2 and the incoming character is A, what state should this go to ?\n //that is given by dfa[65][2] i.e dfa['A'][2]\n\n //I am in the very first state (initial state) and receive\n //the first pattern character. Go to the next state.\n\n dfa[pat.charAt(0)][0] = 1;\n\n //For j=0, dfa[pat.charAt(0)][0] = 1; takes care of success transition and the rest default to 0.\n //So we don't worry about 0th state, in this for loop\n\n for (int X = 0, j = 1; j < M; j++) {\n //Start with fallback state X=0 initially\n //Have to update missing transitions for states 1 through end-of-pattern\n\n \tfor (int c = 0; c < R; c++)\n { dfa[c][j] = dfa[c][X]; \t\t// Copy mismatch cases. \n } \t\t\t\t\t\t\t\t// Copy the whole column at X, to the current column position j\n \t\t\t\t\t\t\t \n \t/*Override for the matching cases\n \tStates: 0-1-2-3\n \tPattern:\"abc\" a at 0 transitions to 1, b at 1 transitions to 2, c at 2 transitions to 3\n \tpat.chatAt(j) at state j should trigger a transition to state j+1\n \t */\n\n //For matching cases, override the cell values\n //The cell value would be currentStateNo+1. So j+1\n\n dfa[pat.charAt(j)][j] = j+1;\n\n //Now finally change the fallback state\n //If I had, received the same character at the fallback state, where would I have gone ?\n \t//That's the new fallback state.\n\n X = dfa[pat.charAt(j)][X]; // Update restart state.\n } \n }", "private void buildTable() {\n\t\tObservableList<Record> data;\r\n\t\tdata = FXCollections.observableArrayList();\r\n\r\n\t\t// get records from the database\r\n\t\tArrayList<Record> list = new ArrayList<Record>();\r\n\t\tlist = getItemsToAdd();\r\n\r\n\t\t// add records to the table\r\n\t\tfor (Record i : list) {\r\n\t\t\tSystem.out.println(\"Add row: \" + i);\r\n\t\t\tdata.add(i);\r\n\t\t}\r\n\t\ttableView.setItems(data);\r\n\t}", "public Table() {\n this.tableName = \"\";\n this.rows = new HashSet<>();\n this.columnsDefinedOrder = new ArrayList<>();\n }", "public Maze(byte[] arr)\n {\n try {\n\n int rowSizeInt;\n int colSizeInt;\n int entryRowInt;\n int entryColInt;\n int exitRowInt;\n int exitColInt;\n\n byte[] RowSizeBytes = Arrays.copyOfRange(arr, 0, 4);\n byte[] ColSizeBytes = Arrays.copyOfRange(arr, 4, 8);\n\n byte[] StartRowBytes = Arrays.copyOfRange(arr, 8, 12);\n byte[] StartColBytes = Arrays.copyOfRange(arr, 12, 16);\n\n byte[] EndRowBytes = Arrays.copyOfRange(arr, 16, 20);\n byte[] EndColBytes = Arrays.copyOfRange(arr, 20, 24);\n\n rowSizeInt = ByteBuffer.wrap(RowSizeBytes).getInt();\n colSizeInt = ByteBuffer.wrap(ColSizeBytes).getInt();\n entryRowInt = ByteBuffer.wrap(StartRowBytes).getInt();\n entryColInt = ByteBuffer.wrap(StartColBytes).getInt();\n exitRowInt = ByteBuffer.wrap(EndRowBytes).getInt();\n exitColInt = ByteBuffer.wrap(EndColBytes).getInt();\n\n this.data = new int[rowSizeInt][colSizeInt];\n\n //Sets the visual int matrix\n int byteArrIndex = 24;\n for (int i = 0; i < rowSizeInt; i++)\n {\n for (int j = 0; j < colSizeInt; j++)\n {\n this.data[i][j] = arr[byteArrIndex++];\n }\n }\n\n this.PositionMatrix = new Position[rowSizeInt / 2 + 1][colSizeInt / 2 + 1];\n int counter = 0;\n for (int i = 0; i < rowSizeInt / 2 + 1; i++)\n {\n for (int j = 0; j < colSizeInt / 2 + 1; j++)\n {\n this.PositionMatrix[i][j] = new Position(i, j);\n this.PositionMatrix[i][j].setId(counter);\n counter++;\n }\n }\n\n this.data[entryRowInt * 2][entryColInt * 2] = 0;\n this.data[exitRowInt * 2][exitColInt * 2] = 0;\n\n intToPositionArr(this.PositionMatrix, data);\n\n this.data[entryRowInt * 2][entryColInt * 2] = 83;\n this.data[exitRowInt * 2][exitColInt * 2] = 69;\n\n this.entry = PositionMatrix[entryRowInt][entryColInt];\n this.exit = PositionMatrix[exitRowInt][exitColInt];\n }\n\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "public void createTables(){\n Map<String, String> name_type_map = new HashMap<>();\n List<String> primaryKey = new ArrayList<>();\n try {\n name_type_map.put(KEY_SINK_NAME, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_SINK_ADDRESS, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_SINK_DETAIL, MyDatabase.TYPE_VARCHAR);\n primaryKey.add(KEY_SINK_ADDRESS);\n myDatabase.createTable(TABLE_SINK, name_type_map, primaryKey, null);\n }catch (MySQLException e){ //数据表已存在\n e.print();\n }\n try {\n name_type_map.clear();\n name_type_map.put(KEY_NODE_NAME, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_PARENT, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_DETAIL, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_ADDRESS,MyDatabase.TYPE_VARCHAR);\n primaryKey.clear();\n primaryKey.add(KEY_NODE_PARENT);\n primaryKey.add(KEY_NODE_ADDRESS);\n myDatabase.createTable(TABLE_NODE, name_type_map, primaryKey, null);\n }catch (MySQLException e){\n e.print();\n }\n\n try {\n name_type_map.clear();\n name_type_map.put(KEY_NODE_ADDRESS, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_PARENT, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_DATA_TIME, MyDatabase.TYPE_TIMESTAMP);\n name_type_map.put(KEY_DATA_VAL, MyDatabase.TYPE_FLOAT);\n primaryKey.clear();\n primaryKey.add(KEY_DATA_TIME);\n primaryKey.add(KEY_NODE_ADDRESS);\n primaryKey.add(KEY_NODE_PARENT);\n myDatabase.createTable(TABLE_DATA, name_type_map, primaryKey, null);\n }catch (MySQLException e) {\n e.print();\n }\n }", "public DatabaseFileInformation(byte[] aFileBytes)\n {\n mTables = new LinkedList<>();\n\n mHeader = (short) (((0xFF) & aFileBytes[1]) | (((0xFF) & aFileBytes[0]) << 8));\n mVersion = (short) (((0xFF) & aFileBytes[3]) | (((0xFF) & aFileBytes[2]) << 8));\n mUnknown1 = ((0xFF) & aFileBytes[7]) | (((0xFF) & aFileBytes[6]) << 8) | (((0xFF) & aFileBytes[5]) <<\n 16) | (((0xFF) & aFileBytes[4]) << 24);\n mDatabaseSize = ((0xFF) & aFileBytes[11]) | (((0xFF) & aFileBytes[10]) << 8) | (((0xFF) & aFileBytes[9]) <<\n 16) | (((0xFF) & aFileBytes[8]) << 24);\n mZero = ((0xFF) & aFileBytes[15]) | (((0xFF) & aFileBytes[14]) << 8) | (((0xFF) & aFileBytes[13]) <<\n 16) | (((0xFF) & aFileBytes[12]) << 24);\n mTableCount = ((0xFF) & aFileBytes[19]) | (((0xFF) & aFileBytes[18]) << 8) | (((0xFF) & aFileBytes[17]) <<\n 16) | (((0xFF) & aFileBytes[16]) << 24);\n mUnknown2 = ((0xFF) & aFileBytes[23]) | (((0xFF) & aFileBytes[22]) << 8) | (((0xFF) & aFileBytes[21]) <<\n 16) | (((0xFF) & aFileBytes[20]) << 24);\n\n int lTableDefinitionPosition = 24;\n int lTableDataStart = lTableDefinitionPosition + (mTableCount * 8);\n\n // Read the table definitions.\n for (int i = 0; i < mTableCount; i++)\n {\n DatabaseTable lDatabaseTable = new DatabaseTable();\n lDatabaseTable.readTableDefinition(aFileBytes, lTableDefinitionPosition);\n lDatabaseTable.readTableHeader(aFileBytes, lTableDataStart);\n mTables.add(lDatabaseTable);\n lTableDefinitionPosition += 8;\n }\n }", "private DefaultTableModel createModel() {\n List list = getDefaultInitialData();//obtenemos toda la lista a mostrar\n Vector data = new Vector();//vector tabla\n if (list != null) {\n for (Object o : list) {\n Vector columnas = new Vector();//columnas para llenar la tabla\n //lenar el vector columna\n Object object = null;\n for (Object x : title) {\n try {\n object = o.getClass().getMethod(\"get\" + convertir(x.toString()), new Class[]{}).invoke(o);\n columnas.add(object);\n } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {\n Logger.getLogger(JCAbstractXTable.class.getName()).log(Level.SEVERE, null, e);\n }\n }\n data.add(columnas);\n }\n }\n return new DefaultTableModel(data, nameColumn());\n }" ]
[ "0.5672329", "0.5323669", "0.5313757", "0.5293912", "0.50130844", "0.49442813", "0.49246994", "0.4910212", "0.48609516", "0.48463565", "0.47846186", "0.4760375", "0.47598726", "0.4754189", "0.47384945", "0.47344264", "0.47231075", "0.4696092", "0.4688698", "0.46689126", "0.46664327", "0.466573", "0.46430117", "0.46317217", "0.462457", "0.46132383", "0.46022707", "0.4588127", "0.45842463", "0.45643774", "0.4556987", "0.45520568", "0.4549139", "0.4523873", "0.4522539", "0.4509747", "0.45043787", "0.4488835", "0.4469792", "0.44694686", "0.4463478", "0.44521925", "0.44334823", "0.4428628", "0.44252902", "0.44135195", "0.44090104", "0.4397379", "0.43800482", "0.43786633", "0.43765345", "0.43727785", "0.43723387", "0.4367292", "0.43656775", "0.43566567", "0.43559825", "0.4355669", "0.43552676", "0.43546584", "0.4352762", "0.4336693", "0.43331897", "0.4325899", "0.43186304", "0.43157473", "0.4312608", "0.4307856", "0.42950878", "0.42926103", "0.42847562", "0.4284007", "0.42837003", "0.4275094", "0.42700225", "0.42651775", "0.42631954", "0.42623228", "0.4262154", "0.42620352", "0.42584032", "0.4256456", "0.42431763", "0.42369503", "0.4236129", "0.42347175", "0.423451", "0.42335644", "0.42308232", "0.42263326", "0.42243457", "0.42219293", "0.42178932", "0.42169404", "0.4215708", "0.42092416", "0.42086175", "0.41979823", "0.4193206", "0.41913003" ]
0.4791299
10
Main entry point of class given a particular set of haplotypes, samples and reference context, compute genotype likelihoods and assemble into a list of variant contexts and genomic events ready for calling The list of samples we're working with is obtained from the readLikelihoods
public CalledHaplotypes assignGenotypeLikelihoods(final List<Haplotype> haplotypes, final ReadLikelihoods<Haplotype> readLikelihoods, final Map<String, List<GATKRead>> perSampleFilteredReadList, final byte[] ref, final SimpleInterval refLoc, final SimpleInterval activeRegionWindow, final FeatureContext tracker, final List<VariantContext> activeAllelesToGenotype, final boolean emitReferenceConfidence, final int maxMnpDistance, final SAMFileHeader header, final boolean withBamOut) { // sanity check input arguments Utils.nonEmpty(haplotypes, "haplotypes input should be non-empty and non-null"); Utils.validateArg(readLikelihoods != null && readLikelihoods.numberOfSamples() > 0, "readLikelihoods input should be non-empty and non-null"); Utils.validateArg(ref != null && ref.length > 0, "ref bytes input should be non-empty and non-null"); Utils.nonNull(refLoc, "refLoc must be non-null"); Utils.validateArg(refLoc.size() == ref.length, " refLoc length must match ref bytes"); Utils.nonNull(activeRegionWindow, "activeRegionWindow must be non-null"); Utils.nonNull(activeAllelesToGenotype, "activeAllelesToGenotype must be non-null"); Utils.validateArg(refLoc.contains(activeRegionWindow), "refLoc must contain activeRegionWindow"); ParamUtils.isPositiveOrZero(maxMnpDistance, "maxMnpDistance may not be negative."); // update the haplotypes so we're ready to call, getting the ordered list of positions on the reference // that carry events among the haplotypes final SortedSet<Integer> startPosKeySet = decomposeHaplotypesIntoVariantContexts(haplotypes, ref, refLoc, activeAllelesToGenotype, maxMnpDistance); // Walk along each position in the key set and create each event to be outputted final Set<Haplotype> calledHaplotypes = new HashSet<>(); final List<VariantContext> returnCalls = new ArrayList<>(); final int ploidy = configuration.genotypeArgs.samplePloidy; final List<Allele> noCallAlleles = GATKVariantContextUtils.noCallAlleles(ploidy); if (withBamOut) { //add annotations to reads for alignment regions and calling regions AssemblyBasedCallerUtils.annotateReadLikelihoodsWithRegions(readLikelihoods, activeRegionWindow); } for( final int loc : startPosKeySet ) { if( loc < activeRegionWindow.getStart() || loc > activeRegionWindow.getEnd() ) { continue; } final List<VariantContext> activeEventVariantContexts; if( activeAllelesToGenotype.isEmpty() ) { activeEventVariantContexts = getVariantContextsFromActiveHaplotypes(loc, haplotypes, true); } else { // we are in GGA mode! activeEventVariantContexts = getVariantContextsFromGivenAlleles(loc, activeAllelesToGenotype, true); } final List<VariantContext> eventsAtThisLocWithSpanDelsReplaced = replaceSpanDels(activeEventVariantContexts, Allele.create(ref[loc - refLoc.getStart()], true), loc); VariantContext mergedVC = AssemblyBasedCallerUtils.makeMergedVariantContext(eventsAtThisLocWithSpanDelsReplaced); if( mergedVC == null ) { continue; } final Map<Allele, List<Haplotype>> alleleMapper = createAlleleMapper(mergedVC, loc, haplotypes, activeAllelesToGenotype); if( configuration.debug && logger != null ) { logger.info("Genotyping event at " + loc + " with alleles = " + mergedVC.getAlleles()); } mergedVC = removeAltAllelesIfTooManyGenotypes(ploidy, alleleMapper, mergedVC); ReadLikelihoods<Allele> readAlleleLikelihoods = readLikelihoods.marginalize(alleleMapper, new SimpleInterval(mergedVC).expandWithinContig(ALLELE_EXTENSION, header.getSequenceDictionary())); if (configuration.isSampleContaminationPresent()) { readAlleleLikelihoods.contaminationDownsampling(configuration.getSampleContamination()); } if (emitReferenceConfidence) { mergedVC = addNonRefSymbolicAllele(mergedVC); readAlleleLikelihoods.addNonReferenceAllele(Allele.NON_REF_ALLELE); } final GenotypesContext genotypes = calculateGLsForThisEvent(readAlleleLikelihoods, mergedVC, noCallAlleles); final VariantContext call = calculateGenotypes(new VariantContextBuilder(mergedVC).genotypes(genotypes).make(), getGLModel(mergedVC), header); if( call != null ) { readAlleleLikelihoods = prepareReadAlleleLikelihoodsForAnnotation(readLikelihoods, perSampleFilteredReadList, emitReferenceConfidence, alleleMapper, readAlleleLikelihoods, call); final VariantContext annotatedCall = makeAnnotatedCall(ref, refLoc, tracker, header, mergedVC, readAlleleLikelihoods, call); returnCalls.add( annotatedCall ); if (withBamOut) { AssemblyBasedCallerUtils.annotateReadLikelihoodsWithSupportedAlleles(call, readAlleleLikelihoods); } // maintain the set of all called haplotypes call.getAlleles().stream().map(alleleMapper::get).filter(Objects::nonNull).forEach(calledHaplotypes::addAll); } } final List<VariantContext> phasedCalls = doPhysicalPhasing ? phaseCalls(returnCalls, calledHaplotypes) : returnCalls; return new CalledHaplotypes(phasedCalls, calledHaplotypes); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Pair<List<Genotype>, GenotypeLocusData> createCalls(RefMetaDataTracker tracker, char ref, HashMap<String, AlignmentContextBySample> contexts, GenomeLoc loc) {\n int indexOfMax = 0;\n char baseOfMax = ref;\n double maxConfidence = Double.MIN_VALUE;\n for ( char altAllele : BaseUtils.BASES ) {\n if ( altAllele != ref ) {\n int baseIndex = BaseUtils.simpleBaseToBaseIndex(altAllele);\n if ( PofFs[baseIndex] > maxConfidence ) {\n indexOfMax = baseIndex;\n baseOfMax = altAllele;\n maxConfidence = PofFs[baseIndex];\n }\n }\n }\n \n double phredScaledConfidence = -10.0 * Math.log10(alleleFrequencyPosteriors[indexOfMax][0]);\n \n // return a null call if we don't pass the confidence cutoff\n if ( !ALL_BASE_MODE && phredScaledConfidence < CONFIDENCE_THRESHOLD )\n return new Pair<List<Genotype>, GenotypeLocusData>(null, null);\n \n ArrayList<Genotype> calls = new ArrayList<Genotype>();\n \n // first, populate the sample-specific data\n for ( String sample : GLs.keySet() ) {\n \n // create the call\n AlignmentContext context = contexts.get(sample).getContext(StratifiedContext.OVERALL);\n Genotype call = GenotypeWriterFactory.createSupportedCall(OUTPUT_FORMAT, ref, context.getLocation());\n \n if ( call instanceof ReadBacked ) {\n ((ReadBacked)call).setReads(context.getReads());\n }\n if ( call instanceof SampleBacked ) {\n ((SampleBacked)call).setSampleName(sample);\n }\n if ( call instanceof LikelihoodsBacked ) {\n ((LikelihoodsBacked)call).setLikelihoods(GLs.get(sample).getLikelihoods());\n }\n if ( call instanceof PosteriorsBacked ) {\n ((PosteriorsBacked)call).setPosteriors(GLs.get(sample).getPosteriors());\n }\n \n calls.add(call);\n }\n \n // next, the general locus data\n // note that calculating strand bias involves overwriting data structures, so we do that last\n GenotypeLocusData locusdata = GenotypeWriterFactory.createSupportedGenotypeLocusData(OUTPUT_FORMAT, ref, loc);\n if ( locusdata != null ) {\n if ( locusdata instanceof ConfidenceBacked ) {\n ((ConfidenceBacked)locusdata).setConfidence(phredScaledConfidence);\n }\n if ( locusdata instanceof AlleleFrequencyBacked ) {\n int bestAFguess = findMaxEntry(alleleFrequencyPosteriors[indexOfMax]).second;\n ((AlleleFrequencyBacked)locusdata).setAlleleFrequency((double)bestAFguess / (double)(frequencyEstimationPoints-1));\n AlleleFrequencyBacked.AlleleFrequencyRange range = computeAFrange(alleleFrequencyPosteriors[indexOfMax], frequencyEstimationPoints-1, bestAFguess, ALLELE_FREQUENCY_RANGE);\n ((AlleleFrequencyBacked)locusdata).setAlleleFrequencyRange(range);\n }\n if ( locusdata instanceof IDBacked ) {\n rodDbSNP dbsnp = getDbSNP(tracker);\n if ( dbsnp != null )\n ((IDBacked)locusdata).setID(dbsnp.getRS_ID());\n }\n if ( locusdata instanceof ArbitraryFieldsBacked) {\n ArrayList<Double> refBalances = new ArrayList<Double>();\n ArrayList<Double> onOffBalances = new ArrayList<Double>();\n ArrayList<Double> weights = new ArrayList<Double>();\n \n // accumulate ratios and weights\n for ( java.util.Map.Entry<String, GenotypeLikelihoods> entry : GLs.entrySet() ) {\n // determine the best genotype\n Integer sorted[] = Utils.SortPermutation(entry.getValue().getPosteriors());\n DiploidGenotype bestGenotype = DiploidGenotype.values()[sorted[DiploidGenotype.values().length - 1]];\n \n // we care only about het calls\n if ( bestGenotype.isHetRef(ref) ) {\n \n // make sure the alt base is our target alt\n char altBase = bestGenotype.base1 != ref ? bestGenotype.base1 : bestGenotype.base2;\n if ( altBase != baseOfMax )\n continue;\n \n // get the base counts at this pileup (minus deletions)\n ReadBackedPileup pileup = new ReadBackedPileup(ref, contexts.get(entry.getKey()).getContext(StratifiedContext.OVERALL));\n int[] counts = pileup.getBasePileupAsCounts();\n int refCount = counts[BaseUtils.simpleBaseToBaseIndex(ref)];\n int altCount = counts[BaseUtils.simpleBaseToBaseIndex(altBase)];\n int totalCount = 0;\n for (int i = 0; i < counts.length; i++)\n totalCount += counts[i];\n \n // add the entries\n weights.add(entry.getValue().getNormalizedPosteriors()[bestGenotype.ordinal()]);\n refBalances.add((double)refCount / (double)(refCount + altCount));\n onOffBalances.add((double)(refCount + altCount) / (double)totalCount);\n }\n }\n \n if ( weights.size() > 0 ) {\n // normalize the weights\n double sum = 0.0;\n for (int i = 0; i < weights.size(); i++)\n sum += weights.get(i);\n for (int i = 0; i < weights.size(); i++)\n weights.set(i, weights.get(i) / sum);\n \n // calculate total weighted ratios\n double normalizedRefRatio = 0.0;\n double normalizedOnOffRatio = 0.0;\n for (int i = 0; i < weights.size(); i++) {\n normalizedRefRatio += weights.get(i) * refBalances.get(i);\n normalizedOnOffRatio += weights.get(i) * onOffBalances.get(i);\n }\n \n HashMap<String, String> fields = new HashMap<String, String>();\n fields.put(\"AB\", String.format(\"%.2f\", normalizedRefRatio));\n fields.put(\"OO\", String.format(\"%.2f\", normalizedOnOffRatio));\n ((ArbitraryFieldsBacked)locusdata).setFields(fields);\n }\n }\n if ( locusdata instanceof SLODBacked ) {\n // the overall lod\n double overallLog10PofNull = Math.log10(alleleFrequencyPosteriors[indexOfMax][0]);\n double overallLog10PofF = Math.log10(PofFs[indexOfMax]);\n double lod = overallLog10PofF - overallLog10PofNull;\n \n // the forward lod\n initializeGenotypeLikelihoods(ref, contexts, StratifiedContext.FORWARD);\n calculateAlleleFrequencyPosteriors(ref, null);\n double forwardLog10PofNull = Math.log10(alleleFrequencyPosteriors[indexOfMax][0]);\n double forwardLog10PofF = Math.log10(PofFs[indexOfMax]);\n \n // the reverse lod\n initializeGenotypeLikelihoods(ref, contexts, StratifiedContext.REVERSE);\n calculateAlleleFrequencyPosteriors(ref, null);\n double reverseLog10PofNull = Math.log10(alleleFrequencyPosteriors[indexOfMax][0]);\n double reverseLog10PofF = Math.log10(PofFs[indexOfMax]);\n \n double forwardLod = forwardLog10PofF + reverseLog10PofNull - overallLog10PofNull;\n double reverseLod = reverseLog10PofF + forwardLog10PofNull - overallLog10PofNull;\n //logger.debug(\"forward lod=\" + forwardLod + \", reverse lod=\" + reverseLod);\n \n // strand score is max bias between forward and reverse strands\n double strandScore = Math.max(forwardLod - lod, reverseLod - lod);\n // rescale by a factor of 10\n strandScore *= 10.0;\n //logger.debug(String.format(\"SLOD=%f\", strandScore));\n \n ((SLODBacked)locusdata).setSLOD(strandScore);\n }\n }\n \n return new Pair<List<Genotype>, GenotypeLocusData>(calls, locusdata);\n }", "private void CreateGenomeData()\n {\n SymbolList blankList = new BlankSymbolList(totalLength);\n SimpleSequenceFactory seqFactory = new SimpleSequenceFactory();\n blankSequence = seqFactory.createSequence(blankList, null, null, null);\n \n try {\n \n for(int i =0;i<chromosomeCount;i++)\n {\n ArrayList<GeneDisplayInfo> currentChr = outputGenes.get(i);\n int geneCount = currentChr.size();\n\n for(int j =0; j < geneCount ; j++)\n {\n \n GeneDisplayInfo gene = currentChr.get(j);\n StrandedFeature.Template stranded = new StrandedFeature.Template();\n\n if(gene.Complement)\n stranded.strand = StrandedFeature.NEGATIVE;\n else\n stranded.strand = StrandedFeature.POSITIVE;\n stranded.location = new RangeLocation(gene.Location1,gene.Location2);\n //String s = \"Source\n \n stranded.type = \"Source\" + Integer.toString(i);\n if(gene.name ==\"Circular\")\n stranded.type = \"CircularF\" + Integer.toString(i);\n stranded.source = gene.name;\n Feature f = blankSequence.createFeature(stranded);\n \n }\n \n } \n \n \n int totalfeature =sourceGene.size(); \n for(int i =0; i < totalfeature ; i++)\n {\n\n GeneDisplayInfo gene = GeneData.targetGene.get(i);\n StrandedFeature.Template stranded = new StrandedFeature.Template();\n \n if(gene.Complement)\n stranded.strand = StrandedFeature.NEGATIVE;\n else\n stranded.strand = StrandedFeature.POSITIVE;\n stranded.location = new RangeLocation(gene.Location1,gene.Location2);\n stranded.type = \"Target\";\n stranded.source = gene.name;\n blankSequence.createFeature(stranded);\n \n }\n \n \n }\n catch (BioException ex) {\n Logger.getLogger(GeneData.class.getName()).log(Level.SEVERE, null, ex);\n } catch (ChangeVetoException ex) {\n Logger.getLogger(GeneData.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n\t\tcurdata = GenomeDataFactory.createGenomeData(blankSequence);\t\n \n \n }", "public Pair<List<Genotype>, GenotypeLocusData> calculateGenotype(RefMetaDataTracker tracker, char ref, AlignmentContext context, DiploidGenotypePriors priors) {\n HashMap<String, AlignmentContextBySample> contexts = splitContextBySample(context);\n if ( contexts == null )\n return null;\n \n initializeAlleleFrequencies(contexts.size());\n \n // run joint estimation for the full GL contexts\n initializeGenotypeLikelihoods(ref, contexts, StratifiedContext.OVERALL);\n calculateAlleleFrequencyPosteriors(ref, context.getLocation());\n return createCalls(tracker, ref, contexts, context.getLocation());\n }", "protected GenotypesContext calculateGLsForThisEvent(final ReadLikelihoods<Allele> readLikelihoods, final VariantContext mergedVC, final List<Allele> noCallAlleles ) {\n Utils.nonNull(readLikelihoods, \"readLikelihoods\");\n Utils.nonNull(mergedVC, \"mergedVC\");\n final List<Allele> vcAlleles = mergedVC.getAlleles();\n final AlleleList<Allele> alleleList = readLikelihoods.numberOfAlleles() == vcAlleles.size() ? readLikelihoods : new IndexedAlleleList<>(vcAlleles);\n final GenotypingLikelihoods<Allele> likelihoods = genotypingModel.calculateLikelihoods(alleleList,new GenotypingData<>(ploidyModel,readLikelihoods));\n final int sampleCount = samples.numberOfSamples();\n final GenotypesContext result = GenotypesContext.create(sampleCount);\n for (int s = 0; s < sampleCount; s++) {\n result.add(new GenotypeBuilder(samples.getSample(s)).alleles(noCallAlleles).PL(likelihoods.sampleLikelihoods(s).getAsPLs()).make());\n }\n return result;\n }", "@Tutorial(showSource = true, showSignature = true, showLink = true, linkPrefix = \"src/test/java/\")\n @Override\n public void process(ProcessorContext context)\n {\n samples.add(model.likelihood.parameters.max.getValue() - observation.getValue());\n }", "public static void processData() {\n\t\tString dirName = \"C:\\\\research_data\\\\mouse_human\\\\homo_b47_data\\\\\";\r\n\t//\tString GNF1H_fName = \"GNF1H_genes_chopped\";\r\n\t//\tString GNF1M_fName = \"GNF1M_genes_chopped\";\r\n\t\tString GNF1H_fName = \"GNF1H\";\r\n\t\tString GNF1M_fName = \"GNF1M\";\r\n\t\tString mergedValues_fName = \"GNF1_merged_expression.txt\";\r\n\t\tString mergedPMA_fName = \"GNF1_merged_PMA.txt\";\r\n\t\tString discretizedMI_fName = \"GNF1_discretized_MI.txt\";\r\n\t\tString discretizedLevels_fName = \"GNF1_discretized_levels.txt\";\r\n\t\tString discretizedData_fName = \"GNF1_discretized_data.txt\";\r\n\t\t\r\n\t\tboolean useMotifs = false;\r\n\t\tMicroArrayData humanMotifs = null;\r\n\t\tMicroArrayData mouseMotifs = null;\r\n\t\t\r\n\t\tMicroArrayData GNF1H_value = new MicroArrayData();\r\n\t\tMicroArrayData GNF1H_PMA = new MicroArrayData();\r\n\t\tGNF1H_PMA.setDiscrete();\r\n\t\tMicroArrayData GNF1M_value = new MicroArrayData();\r\n\t\tMicroArrayData GNF1M_PMA = new MicroArrayData();\r\n\t\tGNF1M_PMA.setDiscrete();\r\n\t\t\r\n\t\ttry {\r\n\t\t/*\tGNF1H_value.readFile(dirName+GNF1H_fName+\".gcrma.txt\");\r\n\t\t\tGNF1H_PMA.readFile(dirName+GNF1H_fName+\".pma\");\r\n\t\t\tGNF1M_value.readFile(dirName+GNF1M_fName+\".gcrma.txt\");\r\n\t\t\tGNF1M_PMA.readFile(dirName+GNF1M_fName+\".pma\"); */\r\n\t\t/*\tGNF1H_value.readFile(dirName+GNF1H_fName+\".gcrma.txt.homob44\");\r\n\t\t\tGNF1H_PMA.readFile(dirName+GNF1H_fName+\".pma.txt.homob44\");\r\n\t\t\tGNF1M_value.readFile(dirName+GNF1M_fName+\".gcrma.txt.homob44\");\r\n\t\t\tGNF1M_PMA.readFile(dirName+GNF1M_fName+\".pma.txt.homob44\"); */\r\n\t\t\tGNF1H_value.readFile(dirName+GNF1H_fName+\".gcrma.snco.txt\");\r\n\t\t\tGNF1H_PMA.readFile(dirName+GNF1H_fName+\".pma.sn.txt\");\r\n\t\t\tGNF1M_value.readFile(dirName+GNF1M_fName+\".gcrma.snco.txt\");\r\n\t\t\tGNF1M_PMA.readFile(dirName+GNF1M_fName+\".pma.sn.txt\");\r\n\t\t} catch(IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\tif (useMotifs) {\r\n\t\t\thumanMotifs = new MicroArrayData();\r\n\t\t\tmouseMotifs = new MicroArrayData();\r\n\t\t\tloadMotifs(humanMotifs,GNF1H_value.geneNames,mouseMotifs,GNF1M_value.geneNames);\r\n\t\t}\r\n\t\t\r\n\t\t// combine replicates in PMA values\r\n\t\tint[][] H_PMA = new int[GNF1H_PMA.numRows][GNF1H_PMA.numCols/2];\r\n\t\tint[][] M_PMA = new int[GNF1M_PMA.numRows][GNF1M_PMA.numCols/2];\r\n\t\t\r\n\t\tint i = 0;\r\n\t\tint j = 0;\r\n\t\tint k = 0;\r\n\t\tint v = 0;\r\n\t\tk = 0;\r\n\t\tj = 0;\r\n\t\twhile (j<GNF1H_PMA.numCols-1) {\r\n\t\t\tfor (i=0;i<H_PMA.length;i++) {\r\n\t\t\t\tv = 0;\r\n\t\t\t//\tif (GNF1H_PMA.dvalues[i][j] > 0 & GNF1H_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\tif (GNF1H_PMA.dvalues[i][j] > 0 | GNF1H_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\t\tv = 1;\r\n\t\t\t\t}\r\n\t\t\t\tH_PMA[i][k] = v;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\t\t\tj = j + 2;\r\n\t\t}\r\n\t\t\r\n\t\tj = 0;\r\n\t\tk = 0;\r\n\t\twhile (j<GNF1M_PMA.numCols-1) {\r\n\t\t\tfor (i=0;i<M_PMA.length;i++) {\r\n\t\t\t\tv = 0;\r\n\t\t\t//\tif (GNF1M_PMA.dvalues[i][j] > 0 & GNF1M_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\tif (GNF1M_PMA.dvalues[i][j] > 0 | GNF1M_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\t\tv = 1;\r\n\t\t\t\t}\r\n\t\t\t\tM_PMA[i][k] = v;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\t\t\tj = j + 2;\r\n\t\t}\r\n\t\t\r\n\t\tint numMatched = 31;\r\n\t\t\r\n\t/*\tGNF1H_value.numCols = numMatched;\r\n\t\tGNF1M_value.numCols = numMatched; */\r\n\t\t\r\n\t\tint[][] matchPairs = new int[numMatched][2];\r\n\t\tfor(i=0;i<numMatched;i++) {\r\n\t\t\tmatchPairs[i][0] = i;\r\n\t\t\tmatchPairs[i][1] = i + GNF1H_value.numCols;\r\n\t\t}\r\n\t\t\r\n\t//\tDiscretizeAffyData H_discretizer = new DiscretizeAffyData(GNF1H_value.values,H_PMA,0);\r\n\t//\tH_discretizer.adjustIntensities();\r\n\t\ttransformRelativeAbundance(GNF1H_value.values,H_PMA,GNF1H_value.numCols);\r\n\t\t\r\n\t//\tDiscretizeAffyData M_discretizer = new DiscretizeAffyData(GNF1M_value.values,M_PMA,0);\r\n\t//\tM_discretizer.adjustIntensities();\r\n\t\ttransformRelativeAbundance(GNF1M_value.values,M_PMA,GNF1M_value.numCols);\r\n\t\t\r\n\t\tdouble[][] mergedExpression = new double[GNF1H_value.numRows][GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\tint[][] mergedPMA = new int[GNF1H_value.numRows][GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\tint[] species = null;\r\n\t\tif (!useMotifs) {\r\n\t\t\tspecies = new int[GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\t} else {\r\n\t\t\tspecies = new int[GNF1H_value.numCols+GNF1M_value.numCols + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t}\r\n\t\t\r\n\t\tfor (i=0;i<GNF1H_value.numRows;i++) {\r\n\t\t\tSystem.arraycopy(GNF1H_value.values[i],0,mergedExpression[i],0,GNF1H_value.numCols);\r\n\t\t\tSystem.arraycopy(H_PMA[i],0,mergedPMA[i],0,GNF1H_value.numCols);\t\r\n\t\t}\r\n\t\tfor (i=0;i<GNF1M_value.numRows;i++) {\r\n\t\t\tSystem.arraycopy(GNF1M_value.values[i],0,mergedExpression[i],GNF1H_value.numCols,GNF1M_value.numCols);\r\n\t\t\tSystem.arraycopy(M_PMA[i],0,mergedPMA[i],GNF1H_value.numCols,GNF1M_value.numCols);\r\n\t\t}\r\n\t\t\r\n\t\t// concatenate experiment and gene names\r\n\t\tfor (i=0;i<GNF1H_value.numCols;i++) {\r\n\t\t\tGNF1H_value.experimentNames[i] = \"h_\" + GNF1H_value.experimentNames[i];\r\n\t\t\tspecies[i] = 1;\r\n\t\t}\r\n\t\tfor (i=0;i<GNF1M_value.numCols;i++) {\r\n\t\t\tGNF1M_value.experimentNames[i] = \"m_\" + GNF1M_value.experimentNames[i];\r\n\t\t\tspecies[i+GNF1H_value.numCols] = 2;\r\n\t\t}\r\n\t\t\r\n\t\tString[] mergedExperimentNames = null;\r\n\t\tif (!useMotifs) {\r\n\t\t\tmergedExperimentNames = new String[GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\t} else {\r\n\t\t\tmergedExperimentNames = new String[GNF1H_value.numCols+GNF1M_value.numCols + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t}\r\n\t\tSystem.arraycopy(GNF1H_value.experimentNames,0,mergedExperimentNames,0,GNF1H_value.numCols);\r\n\t\tSystem.arraycopy(GNF1M_value.experimentNames,0,mergedExperimentNames,GNF1H_value.numCols,GNF1M_value.numCols);\r\n\t\tif (useMotifs) {\r\n\t\t\tSystem.arraycopy(humanMotifs.experimentNames,0,mergedExperimentNames,GNF1H_value.numCols+GNF1M_value.numCols,humanMotifs.numCols);\r\n\t\t\tSystem.arraycopy(mouseMotifs.experimentNames,0,mergedExperimentNames,GNF1H_value.numCols+GNF1M_value.numCols+humanMotifs.numCols,mouseMotifs.numCols);\r\n\t\t\tfor (i=0;i<humanMotifs.numCols;i++) {\r\n\t\t\t\tspecies[i + GNF1H_value.numCols+GNF1M_value.numCols] = 3;\r\n\t\t\t}\r\n\t\t\tfor (i=0;i<mouseMotifs.numCols;i++) {\r\n\t\t\t\tspecies[i + GNF1H_value.numCols+GNF1M_value.numCols + humanMotifs.numCols] = 4;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tString[] mergedGeneNames = new String[GNF1H_value.numRows];\r\n\t\tfor (i=0;i<GNF1M_value.numRows;i++) {\r\n\t\t\tmergedGeneNames[i] = GNF1H_value.geneNames[i] + \"|\" + GNF1M_value.geneNames[i];\r\n\t\t}\r\n\t\t\r\n\t\tint[] filterList = new int[GNF1M_value.numRows];\r\n\t\tint numFiltered = 0;\r\n\t\tdouble maxExpressedPercent = 1.25;\r\n\t\tint maxExpressed_H = (int) Math.floor(maxExpressedPercent*((double) GNF1H_value.numCols));\r\n\t\tint maxExpressed_M = (int) Math.floor(maxExpressedPercent*((double) GNF1M_value.numCols));\r\n\t\tint numExpressed_H = 0;\r\n\t\tint numExpressed_M = 0;\r\n\t\t\r\n\t\tfor (i=0;i<GNF1H_value.numRows;i++) {\r\n\t\t\tnumExpressed_H = 0;\r\n\t\t\tfor (j=0;j<GNF1H_value.numCols;j++) {\r\n\t\t\t\tif (GNF1H_PMA.dvalues[i][j] > 0) {\r\n\t\t\t//\tif (!Double.isNaN(GNF1H_value.values[i][j])) {\r\n\t\t\t//\tif (GNF1H_value.values[i][j] > 1.5) {\r\n\t\t\t\t\tnumExpressed_H++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tnumExpressed_M = 0;\r\n\t\t\tfor (j=0;j<GNF1M_value.numCols;j++) {\r\n\t\t\t\tif (GNF1M_PMA.dvalues[i][j] > 0) {\r\n\t\t\t//\tif (GNF1H_value.values[i][j] > 1.5) {\r\n\t\t\t//\tif (!Double.isNaN(GNF1M_value.values[i][j])) {\r\n\t\t\t\t\tnumExpressed_M++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (numExpressed_M >= maxExpressed_M | numExpressed_H >= maxExpressed_H) {\r\n\t\t\t\tfilterList[i] = 1;\r\n\t\t\t\tnumFiltered++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tGNF1H_value = null;\r\n\t\tGNF1H_PMA = null;\r\n\t\tGNF1M_value = null;\r\n\t\tGNF1M_PMA = null;\r\n\t\t\r\n\t\tdouble[][] mergedExpression2 = null;\r\n\t\tif (numFiltered > 0) {\r\n\t\t\tk = 0;\r\n\t\t\tint[][] mergedPMA2 = new int[mergedPMA.length-numFiltered][mergedPMA[0].length];\r\n\t\t\tif (!useMotifs) {\r\n\t\t\t\tmergedExpression2 = new double[mergedExpression.length-numFiltered][mergedExpression[0].length];\r\n\t\t\t} else {\r\n\t\t\t\tmergedExpression2 = new double[mergedExpression.length-numFiltered][mergedExpression[0].length + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t\t}\r\n\t\t\tString[] mergedGeneNames2 = new String[mergedGeneNames.length-numFiltered];\r\n\t\t\tfor (i=0;i<filterList.length;i++) {\r\n\t\t\t\tif (filterList[i] == 0) {\r\n\t\t\t\t\tmergedPMA2[k] = mergedPMA[i];\r\n\t\t\t\t\tif (!useMotifs) {\r\n\t\t\t\t\t\tmergedExpression2[k] = mergedExpression[i];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.arraycopy(mergedExpression[i],0,mergedExpression2[k],0,mergedExpression[i].length);\r\n\t\t\t\t\t\tSystem.arraycopy(humanMotifs.values[i],0,mergedExpression2[k],mergedExpression[i].length,humanMotifs.numCols);\r\n\t\t\t\t\t\tSystem.arraycopy(mouseMotifs.values[i],0,mergedExpression2[k],humanMotifs.numCols+mergedExpression[i].length,mouseMotifs.numCols);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmergedGeneNames2[k] = mergedGeneNames[i];\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tmergedPMA = mergedPMA2;\r\n\t\t\tmergedExpression = mergedExpression2;\r\n\t\t\tmergedGeneNames = mergedGeneNames2;\r\n\t\t} else {\r\n\t\t\tif (useMotifs) {\r\n\t\t\t\tmergedExpression2 = new double[mergedExpression.length][mergedExpression[0].length + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t\t\tfor (i=0;i<mergedExpression.length;i++) {\r\n\t\t\t\t\tSystem.arraycopy(mergedExpression[i],0,mergedExpression2[i],0,mergedExpression[i].length);\r\n\t\t\t\t\tSystem.arraycopy(humanMotifs.values[i],0,mergedExpression2[i],mergedExpression[i].length,humanMotifs.numCols);\r\n\t\t\t\t\tSystem.arraycopy(mouseMotifs.values[i],0,mergedExpression2[i],humanMotifs.numCols+mergedExpression[i].length,mouseMotifs.numCols);\r\n\t\t\t\t}\r\n\t\t\t\tmergedExpression = mergedExpression2;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tDiscretizeAffyPairedData discretizer = new DiscretizeAffyPairedData(mergedExpression,mergedPMA,matchPairs,20);\r\n\t\tMicroArrayData mergedData = new MicroArrayData();\r\n\t\tmergedData.values = discretizer.expression;\r\n\t\tmergedData.geneNames = mergedGeneNames;\r\n\t\tmergedData.experimentNames = mergedExperimentNames;\r\n\t\tmergedData.experimentCode = species;\r\n\t\tmergedData.numCols = discretizer.numExperiments;\r\n\t\tmergedData.numRows = discretizer.numGenes;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tmergedData.writeFile(dirName+mergedValues_fName);\r\n\t\t\tdiscretizer.discretizeDownTree(dirName+discretizedMI_fName);\r\n\t\t\tdiscretizer.mergeDownLevels(3,dirName+discretizedLevels_fName);\r\n\t\t\tdiscretizer.transposeDExpression();\r\n\t\t\tmergedData.setDiscrete();\r\n\t\t\tmergedData.values = null;\r\n\t\t\tmergedData.dvalues = discretizer.dExpression;\r\n\t\t\tmergedData.writeFile(dirName+discretizedData_fName);\r\n\t\r\n\t\t\tmergedData.dvalues = mergedPMA;\r\n\t\t\tmergedData.numCols = mergedPMA[0].length;\r\n\t\t\tmergedData.writeFile(dirName+mergedPMA_fName);\r\n\t\t} catch(IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t/*\tMicroArrayData mergedData = new MicroArrayData();\r\n\t\tmergedData.values = mergedExpression;\r\n\t\tmergedData.geneNames = mergedGeneNames;\r\n\t\tmergedData.experimentNames = mergedExperimentNames;\r\n\t\tmergedData.experimentCode = species;\r\n\t\tmergedData.numCols = mergedExpression[0].length;\r\n\t\tmergedData.numRows = mergedExpression.length;\r\n\t\ttry {\r\n\t\t\tmergedData.writeFile(dirName+mergedValues_fName);\r\n\t\t\tmergedData.setDiscrete();\r\n\t\t\tmergedData.values = null;\r\n\t\t//\tmergedData.dvalues = simpleDiscretization(mergedExpression,mergedPMA);\r\n\t\t\tmergedData.dvalues = simpleDiscretization2(mergedExpression,species);\r\n\t\t\tmergedData.writeFile(dirName+discretizedData_fName);\r\n\t\r\n\t\t\tmergedData.dvalues = mergedPMA;\r\n\t\t\tmergedData.numCols = mergedPMA[0].length;\r\n\t\t\tmergedData.writeFile(dirName+mergedPMA_fName);\r\n\t\t} catch(IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t} */\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tILog log = new OutputStreamLog(System.out);\n\t\tlibrary.Library l=new library.Library();\n\t\tOcl4Java.InitModel(\"library\", new OutputStreamLog(System.out));\n\n\t\t// Init population\n\t\tinitPopulation();\n\t\t\n\t\t// Invoke generated code and output the results\t\t\n\t\ttry {\n\t\t\t// Open output file\n\t\t\tFileWriter fout = new FileWriter(\"src/test/scripts/invariants_result.txt\");\n\t\t\tPrintWriter out = new PrintWriter(fout,true);\n\t\t\n\t\t\t// Use the generated code\n\t\t\tList values = test.scripts.Invariants.Library.evaluateAll(lib);\n\t\t\tIterator i = values.iterator();\n\t\t\twhile (i.hasNext()) {\n\t\t\t\tObject obj = i.next();\n\t\t\t\tout.println(\"[\"+obj+\"]\");\n\t\t\t\tSystem.out.println(\"[\"+obj+\"]\");\n\t\t\t}\n\t\t\t\n\t\t\tfout.close();\n\t\t} catch (Exception e) {\n\t\t\tif (Ocl4Java.processor.getDebug().booleanValue()) e.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\n \n // set parameter set list\n ParameterSetListMaker maker = new ParameterSetListMaker(DefaultParameterRecipes.getDEFAULT_PARAMETER_RECIPES());\n List<ParameterSet> psList = maker.getParameterSetList();\n \n //Get sequenceDNA a singleton chromsomome II currently\n Path p1 = Paths.get(ParameterSet.FA_SEQ_FILE);\n seq = new SequenceDNA(p1, new SeqInterval(ParameterSet.SEQUENCE_START, ParameterSet.SEQUENCE_END));\n \n //Get PUExpt chromosome II - a singleton\n Path p = Paths.get(ParameterSet.BIN_COUNT_FILE);\n pu = new PuExperiment(p, new SeqBin(ParameterSet.PU_BIN_SIZE,0)); //the pu experiment under study - also sets bin size for analysis\n \n //Get genbank annotation file of chromosome II - a singleton\n Path p2 = Paths.get(ParameterSet.CHROMOSOME_II_GENBANK);\n annotation = new SequenceDNAAnnotationGenbank(p2);\n \n //get transcript list - a singleton\n transcriptList = annotation.getTranscriptsByType(type-> type == Transcript.TRANSCRIPT_TYPE.MRNA || type == Transcript.TRANSCRIPT_TYPE.SNRNA ||\n type == Transcript.TRANSCRIPT_TYPE.RRNA || type == Transcript.TRANSCRIPT_TYPE.SNORNA || type == Transcript.TRANSCRIPT_TYPE.TRNA);\n \n //get Rif1 list\n Path rif1p = Paths.get(ParameterSet.RIF1_INTERVAL_FILE);\n rif1List = new Rif1Sites(rif1p).getRif1IntervalList();\n \n \n //RUN PARAMETER SETS FOR DYNAMIC SIMULATION\n \n //Iterate over all parameter sets\n for (ParameterSet paramSet : psList) { \n\n //Create probability distribution based on transcript exclusion and AT content\n probDistribution = new ProbabilityDistribution2(seq.atFunction(paramSet.getInitiatorSiteLength()), paramSet, \n annotation.getTranscriptBlocks(transcriptList));\n\n //Replicate molecules\n population = new ReplicatingMoleculePopulation(probDistribution, paramSet, rif1List);\n\n //Create new model comparator to compare pu data with predicted right fork frequency distribution from population of replicating molecules\n modelComparator = new AtModelComparator(pu, ParameterSet.SEQUENCE_START / ParameterSet.PU_BIN_SIZE, population.getPopulationAveRtForkFreqInBins());\n \n //print list of interTranscripts with probabilities\n /*System.out.println(\"index\\tstart\\tend\\tAT Content\\tRif1 index\\tprob\"); \n InterTranscriptSites sites = new InterTranscriptSites(seq, annotation.getTranscriptBlocks(transcriptList), rif1List, probDistribution);\n sites.getInterTranscriptList().forEach(System.out::println);\n System.out.println(\"\");*/\n\n switch (task) {\n case PRINT_PARAMETER_SET:\n System.out.println(paramSet); \n break;\n case PRINT_SEQUENCE:\n System.out.println(seq.intervalToString(new SeqInterval(0, seq.getLength() - 1)));\n break;\n case PRINT_CDF:\n System.out.println(paramSet); \n System.out.println(\"MIDPOINT\\tCDF\");\n probDistribution.printCDf(ParameterSet.PU_BIN_SIZE);\n break;\n case PRINT_MEAN_SQUARED_DEVIATION_RIGHT_FORK_FREQUENCY:\n System.out.println(\"MSD\\tNumPreRCs\\tExpConst\\tAttenuator\\tInitLength\\tMaxRate\\tStdDevPredicted\\tStdDevObserved\");\n System.out.println(modelComparator.getMeanSquaredDifference() + \"\\t\" + paramSet.getNumberInitiators() + \"\\t\" + paramSet.getExponentialPowerFactor() + \"\\t\" + \n paramSet.getAttenuationFactor() + \"\\t\" + paramSet.getInitiatorSiteLength() \n + \"\\t\" + paramSet.getMaxFiringProbabilityPerMin() + \"\\t\" + modelComparator.getPredictedStdDeviation() + \"\\t\" + modelComparator.getObservedStdDeviation());\n break;\n case PRINT_PREDICTED_AND_OBSERVED_RIGHT_FORK_FREQUENCIES:\n printPredictedAndObservedRtForkFrequencies(paramSet);\n break;\n case PRINT_INITIATION_FREQUENCIES:\n printInitiationFrequencies(paramSet);\n break;\n case PRINT_TERMINATION_FREQUENCIES:\n printTerminationFrequencies(paramSet);\n break;\n case PRINT_MEDIAN_REPLICATION_TIMES_FOR_BINS_IN_GENOME:\n System.out.println(paramSet);\n System.out.println(\"Position\\tMedianTime\");\n List<Double> replicationTimes = population.getPopulationMedianTimeOfReplicationInBins(ParameterSet.PU_BIN_SIZE, ParameterSet.NUMBER_BINS);\n for (int i = 0; i < replicationTimes.size(); i++) {\n System.out.println(i * ParameterSet.PU_BIN_SIZE + ParameterSet.PU_BIN_SIZE / 2 + \"\\t\" + replicationTimes.get(i));\n }\n break;\n case PRINT_SPHASE_DURATION_FOR_MOLECULES_IN_POPULATION:\n System.out.println(paramSet);\n population.getElapsedTimeList().stream().forEach(f-> System.out.println(f));\n break;\n case PRINT_FRACTION_REPLICATED_OF_BINS_AT_GIVEN_TIME:\n System.out.println(paramSet);\n System.out.println(\"ELAPSED TIME: \" + timeOfReplication + \" min\");\n System.out.println(\"Position\\tFxReplicated\");\n List<Double> fxReplicated = population.getPopulationAveFxReplicatedInBins(timeOfReplication, ParameterSet.PU_BIN_SIZE, ParameterSet.NUMBER_BINS, paramSet.getMinPerCycle());\n for (int i = 0; i < fxReplicated.size(); i++) {\n System.out.println(i * ParameterSet.PU_BIN_SIZE + ParameterSet.PU_BIN_SIZE / 2 + \"\\t\" + fxReplicated.get(i));\n }\n break;\n case PRINT_REPLICATION_TIME_OF_BIN_FOR_MOLECULES_IN_POPULATION:\n System.out.println(paramSet);\n System.out.println(\"BIN NUMBER: \" + binNumber);\n for (int i = 0; i < paramSet.getNumberCells(); i++) {\n System.out.println(population.getPopulationTimesOfReplicationOfBin(binNumber)[i]);\n }\n break;\n case PRINT_RF_DELTA_LIST:\n PrintDeltaAtContentAndNumberTranscribedPositionsOfBins();\n }\n } \n }", "public static void main(String[] a){\n\n try {\n log.info(\"loading..\");\n\n //ExonQuantSource qs = new ExonQuantSource(new FileInputStream(System.getProperty(\"exon.quant.source\")));\n //ExonEQTLSource es = new ExonEQTLSource(new FileInputStream(System.getProperty(\"exon.eqtl.source\")), qs);\n\n TransQuantSource qs = new TransQuantSource(new FileInputStream(System.getProperty(\"exon.quant.source\")));\n TransEQTLSource es = new TransEQTLSource(new FileInputStream(System.getProperty(\"exon.eqtl.source\")), qs);\n\n\n AggregatedDataSource aggregatedSource = new AggregatedDataSource(qs, es);\n\n log.info(\"loaded\");\n\n log.info(\" \" + ((GenericQuantDataSource)aggregatedSource.quantSource).getStats());\n log.info(\" \" + ((GenericEQTLDataSource)aggregatedSource.eQTLSource).getStats());\n\n String chr = \"1\";\n int start = 1628906;\n int stop = 1629906;\n\n log.info(\"selecting \" + chr + \":\" + start + \"-\" + stop);\n\n ArrayList<DataFeature> quantResult = null;\n ArrayList<DataFeature> eQTLResult = null;\n\n long startTime = System.currentTimeMillis();\n\n quantResult = aggregatedSource.locateQuantFeatures(chr, start, stop);\n eQTLResult = aggregatedSource.locateEQTLFeatures(chr, start, stop);\n\n //for(int i=9;i<1000;i++) {\n //}\n\n long estimatedTime = System.currentTimeMillis() - startTime;\n\n log.info(\"Estimated run time:\" + estimatedTime + \" Millis\");\n\n log.info(\"quantResult.size() = \" + quantResult.size());\n log.info(\"eQTLResult.size() = \" + eQTLResult.size());\n\n for (DataFeature f : quantResult) {\n log.info(\"1 f = \" + f.getId() + \" start:\" + f.getStart() +\n \" end:\" + f.getEnd() + \" score:\" + f.getScore() );\n }\n\n for (DataFeature f : eQTLResult) {\n log.info(\"f = \" + f.getId() + \" start:\" + f.getStart() +\n \" end:\" + f.getEnd() + \" score:\" + f.getScore());\n\n log.info(\"linked to :\");\n\n for (LinkedFeature l0 : f.getLinked()) {\n log.info(\" linked = \" + l0.getFeature().getId() + \" start:\" + l0.getFeature().getStart() +\n \" end:\" + l0.getFeature().getEnd() + \" link score:\" + l0.getLinkScore());\n }\n }\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// Auto-generated catch block\n\t\t\tlog.error(\"Error!\", e);\n\t\t} catch (Exception e) {\n\t\t\t// Auto-generated catch block\n log.error(\"Error!\", e);\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tUtility.dirPath = \"C:\\\\Users\\\\imSlappy\\\\workspace\\\\FeelingAnalysis\\\\Documents\\\\2_group_eng\";\n\t\tString sub[] = {\"dup\",\"bug\"};\n\t\tUtility.classLabel = sub;\n\t\tUtility.numdoc = 350;\n\t\tSetClassPath.read_path(Utility.dirPath);\n\t\tUtility.language = \"en\";\n\t\t\n\t\tUtility.stopWordHSEN = Fileprocess.FileHashSet(\"data/stopwordAndSpc_eng.txt\");\n\t\tUtility.dicen = new _dictionary();\n\t\tUtility.dicen.getDictionary(\"data/dicEngScore.txt\");\n\t\t\n\t\tUtility.vocabHM = new HashMap();\n\t\t// ================= completed initial main Program ==========================\n\n\t\tMainExampleNaive ob = new MainExampleNaive();\n\t\t\n\t\t// --------------------- Pre-process -----------------------\n\t\tob.word_arr = new HashSet [Utility.listFile.length][];\n\t\tob.wordSet = new ArrayList<String>();\n\t\tfor (int i = 0; i < Utility.listFile.length; i++) {\n\t\t\tob.word_arr[i]=new HashSet[Utility.listFile[i].length];\n\t\t\tfor (int j = 0; j < Utility.listFile[i].length; j++) {\n\t\t\t\tStringBuffer strDoc = Fileprocess.readFile(Utility.listFile[i][j]);\n\t\t\t\tob.word_arr[i][j]=ob.docTokenization(new String(strDoc));\n\t\t\t}\n\t\t\tob.checkBound(3, 10000);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"++ Total : \"+Utility.vocabHM.size()+\" words\");\n\t\tSystem.out.println(\"++ \"+Utility.vocabHM);\n\t\t\n\t\t// ---------------------- Selection ------------------------\n//\t\tInformationGain ig = new InformationGain(ob.word_arr.length*ob.word_arr[0].length , ob.wordSet,ob.word_arr);\n//\t\tArrayList<String> ban_word = ig.featureSelection(0.0); // selected out with IG = 0\n//\t\t//ob.banFeature(ban_word);\n//\t\tSystem.out.println(\"ban list[\"+ban_word.size()+\"] : \"+ban_word);\n//\t\t\n//\t\tSystem.out.println(\"-- After \"+Utility.vocabHM.size());\n//\t\tSystem.out.println(\"-- \"+Utility.vocabHM);\n\t\t\n\t\tob.setWordPosition();\n\t\t// ---------------------- Processing -----------------------\n\t\tNaiveBayes naive = new NaiveBayes();\n\t\tnaive.naiveTrain(true);\n\t\t\n\t\tint result = naive.naiveUsage(\"after cold reset of my pc (crash of xp) the favorites of firefox are destroyed and all settings are standard again! Where are firefox-favorites stored and the settings ? how to backup them rgularely? All other software on my pc still works properly ! even INternetExplorer\");\n\t\tSystem.out.println(\"\\nResult : \"+Utility.classLabel[result]);\n\t}", "public static void main(String[] args) throws Exception\n {\n if (args.length==0 || args[0].equals(\"-h\")){\n System.err.println(\"Tests: call as $0 org1=g1.fa,org2=g2.fa annot.txt 5ss-motif 5ss-boundary 3ss-motif 3ss-boundary\");\n System.err.println(\"Outputs splice site compositions.\");\n System.exit(9);\n }\n \n int arg_idx=0;\n String genome_fa_list = args[arg_idx++];\n String annotation_file = args[arg_idx++];\n int donor_motif_length = Integer.parseInt(args[arg_idx++]);\n int donor_boundary_length = Integer.parseInt(args[arg_idx++]);\n int acceptor_motif_length = Integer.parseInt(args[arg_idx++]);\n int acceptor_boundary_length = Integer.parseInt(args[arg_idx++]);\n\n AnnotatedGenomes annotations = new AnnotatedGenomes();\n List<String> wanted_organisms = annotations.readMultipleGenomes(genome_fa_list);\n annotations.readAnnotations(annotation_file); \n \n SpliceSiteComposition ss5[] = new SpliceSiteComposition[wanted_organisms.size()];\n SpliceSiteComposition ss3[] = new SpliceSiteComposition[wanted_organisms.size()];\n \n for (int org_idx=0; org_idx<wanted_organisms.size(); org_idx++)\n {\n String org = wanted_organisms.get(org_idx);\n System.out.println(\"#SSC organism \"+org);\n \n SpliceSiteComposition don = ss5[org_idx] = new SpliceSiteComposition(donor_motif_length, donor_boundary_length, true);\n SpliceSiteComposition acc = ss3[org_idx] = new SpliceSiteComposition(acceptor_motif_length, acceptor_boundary_length, false);\n\n for (GenePred gene: annotations.getAllAnnotations(org))\n {\n don.countIntronSites(gene);\n acc.countIntronSites(gene);\n\n } // for gene \n \n //don.reportStatistics(System.out);\n //acc.reportStatistics(System.out);\n don.writeData(System.out);\n acc.writeData(System.out);\n \n } // for org\n }", "protected abstract SortedMap<String, SampleDescriptor> computeSamples(File sampleDir) throws IOException;", "public static void main(String[] args) {\n\t\tString[] stereotypeBooks = {\"Critique of the Critique of Pure Reason\", \"Token Work of Fiction to Show I Can Write\", \n\t\t\t\t\"Deconstructing Everything I Find\", \"The Metaphysics of Dasein or Some Other Word I Made Up\", \n\t\t\t\t\"I Understand Existence More Than All Y'all Fools\"};\n\t\tSA0 stereotype = new SA0(\"Immanuel Locke\", 79, \"Male\", 1724, 5, 5, \"Germany\", \"Metaphysics\", stereotypeBooks);\n\t\tSystem.out.println(stereotype.defendSelf());\n\t\tSystem.out.println(stereotype.getSummary()); \n\t\t\n\t\tString[] nietzscheBooks = {\"Thus Spake Zarathustra\", \"Beyond Good and Evil\", \"The Antichrist\", \n\t\t\t\t\"Human, All Too Human\", \"The Gay Science\"};\n\t\tSA0 nietzsche = new SA0(\"Friedrich Nietzsche\", 55, \"Male\", 1844, 4, 8, \"Germany\", \"Metaphysics\", nietzscheBooks);\n\t\tSystem.out.println(nietzsche.defendSelf());\n\t\tSystem.out.println(nietzsche.getSummary()); \n\t}", "public static List<ExactCall> readExactLog(final BufferedReader reader, final List<Integer> startsToKeep, GenomeLocParser parser) throws IOException {\n if ( reader == null ) throw new IllegalArgumentException(\"reader cannot be null\");\n if ( startsToKeep == null ) throw new IllegalArgumentException(\"startsToKeep cannot be null\");\n if ( parser == null ) throw new IllegalArgumentException(\"GenomeLocParser cannot be null\");\n\n List<ExactCall> calls = new LinkedList<ExactCall>();\n\n // skip the header line\n reader.readLine();\n\n // skip the first \"type\" line\n reader.readLine();\n\n while (true) {\n final VariantContextBuilder builder = new VariantContextBuilder();\n final List<Allele> alleles = new ArrayList<Allele>();\n final List<Genotype> genotypes = new ArrayList<Genotype>();\n final double[] posteriors = new double[2];\n final double[] priors = MathUtils.normalizeFromLog10(new double[]{0.5, 0.5}, true);\n final List<Integer> mle = new ArrayList<Integer>();\n final Map<Allele, Double> log10pRefByAllele = new HashMap<Allele, Double>();\n long runtimeNano = -1;\n\n GenomeLoc currentLoc = null;\n while (true) {\n final String line = reader.readLine();\n if (line == null)\n return calls;\n\n final String[] parts = line.split(\"\\t\");\n final GenomeLoc lineLoc = parser.parseGenomeLoc(parts[0]);\n final String variable = parts[1];\n final String key = parts[2];\n final String value = parts[3];\n\n if (currentLoc == null)\n currentLoc = lineLoc;\n\n if (variable.equals(\"type\")) {\n if (startsToKeep.isEmpty() || startsToKeep.contains(currentLoc.getStart())) {\n builder.alleles(alleles);\n final int stop = currentLoc.getStart() + alleles.get(0).length() - 1;\n builder.chr(currentLoc.getContig()).start(currentLoc.getStart()).stop(stop);\n builder.genotypes(genotypes);\n final int[] mleInts = ArrayUtils.toPrimitive(mle.toArray(new Integer[]{}));\n final AFCalcResult result = new AFCalcResult(mleInts, 1, alleles, posteriors, priors, log10pRefByAllele);\n calls.add(new ExactCall(builder.make(), runtimeNano, result));\n }\n break;\n } else if (variable.equals(\"allele\")) {\n final boolean isRef = key.equals(\"0\");\n alleles.add(Allele.create(value, isRef));\n } else if (variable.equals(\"PL\")) {\n final GenotypeBuilder gb = new GenotypeBuilder(key);\n gb.PL(GenotypeLikelihoods.fromPLField(value).getAsPLs());\n genotypes.add(gb.make());\n } else if (variable.equals(\"log10PosteriorOfAFEq0\")) {\n posteriors[0] = Double.valueOf(value);\n } else if (variable.equals(\"log10PosteriorOfAFGt0\")) {\n posteriors[1] = Double.valueOf(value);\n } else if (variable.equals(\"MLE\")) {\n mle.add(Integer.valueOf(value));\n } else if (variable.equals(\"pRefByAllele\")) {\n final Allele a = Allele.create(key);\n log10pRefByAllele.put(a, Double.valueOf(value));\n } else if (variable.equals(\"runtime.nano\")) {\n runtimeNano = Long.valueOf(value);\n } else {\n // nothing to do\n }\n }\n }\n }", "public static void main(String[] args){\n\t\tfor(int i=0; i<programRuns; i++){ //for loop to run gen numOfMutations creation \n\t\t\tnumOfMutations[i] = createnumOfMutationss(); //createnumOfMutationss returns number of total mutations\n\t\t}\n\t\n\t\tsort(numOfMutations); //sort array\n\t\tgetFreq(); //find the frequency of the number of mutations that occur\n\t\tgraph(); //create histogram of data\n\t\t\n\t}", "static void initializeData() {\n\n if (timeLimitInHour != -1) {\n endTime = startTime + timeLimitInHour * 60 * 60 * 1000;\n }\n\n // Read the data file.\n data = new Data(dataFileName);\n\n // Build all variables.\n allVariable = data.buildAllVariable();\n\n // Read the target gene set.\n GeneSet geneSet = new GeneSet(allVariable, targetGeneSetFileName, minGeneSetSize, maxGeneSetSize, selectedCollections);\n listOfTargetGeneSets = geneSet.buildListOfGeneSets();\n\n // Read sample class labels.\n readSampleClass();\n\n // Initialize remaining fields.\n if (numberOfThreads == 0)\n numberOfThreads = getRuntime().availableProcessors();\n\n // Initialize BufferedWriter with preliminary info for log file.\n String fileInfo = \"EDDY OUTPUT FILE\\n\";\n fileInfo += (\"Data File: \" + dataFileName + \"\\n\");\n fileInfo += (\"Target Gene Set(s) File: \" + targetGeneSetFileName + \"\\n\");\n fileInfo += (\"Class Label File: \" + sampleClassInformationFileName + \"\\n\");\n fileInfo += (\"Number of Gene Sets: \" + listOfTargetGeneSets.size() + \"\\n\");\n fileInfo += (\"Number of Threads: \" + numberOfThreads + \"\\n\\n\");\n \n // log command line options, in verbatim \n fileInfo += concatStrings(commandLine) + \"\\n\\n\";\n \n fileInfo += (\"Name: \\tCollection: \\tSize: \\tURL: \\tJS Divergence: \\tP-Value: \\t#Permutations: \\tGenes: \\n\");\n try {\n \t// TODO: need to come up with a better way to assign the output file name.\n String fileName = targetGeneSetFileName.substring(0, targetGeneSetFileName.indexOf(\".gmt\")) + \"_output.txt\";\n \n File file = new File(fileName);\n \n output = new BufferedWriter(new FileWriter(file));\n output.write(fileInfo);\n } catch ( IOException e ) {\n e.printStackTrace();\n }\n\n }", "public static void main(String[] args) {\n\t\tfinal Engine<DoubleGene, Double> engine = Engine\n\t\t\t\t.builder(JeneticsDemo2::eval, Codecs.ofScalar(DoubleRange.of(0, 2 * Math.PI)))\n\t\t\t\t\t.populationSize(500)\n\t\t\t\t\t.optimize(Optimize.MINIMUM)\n\t\t\t\t\t.offspringSelector(new StochasticUniversalSelector<>())\n\t\t\t\t\t.alterers(new Mutator<>(0.03), new MeanAlterer<>(0.6))\n\t\t\t\t\t.build();\n\n\t\t// Execute the GA (engine).\n\t\tfinal Phenotype<DoubleGene, Double> result = engine.stream()\n\t\t\t\t// Truncate the evolution stream if no better individual could\n\t\t\t\t// be found after 5 consecutive generations.\n\t\t\t\t.limit(Limits.bySteadyFitness(5))\n\t\t\t\t// Terminate the evolution after maximal 100 generations.\n\t\t\t\t.limit(100).collect(EvolutionResult.toBestPhenotype());\n\t\t\n\t\tSystem.out.println(\"Best GenoType: \" + result);\n\t}", "public void Main(){\n \n \n String dna = \"ATGCTGCTGATGTAA\";\n Main one = new Main();\n processGenes(testProcessGenes(fr));\n \n //System.out.println(processGenes(testProcessGenes(fr)));\n \n \n //System.out.println(processGenes());\n //System.out.println(cgRatio(dna));\n //System.out.println(countCTG(dna));\n //System.out.println(HOW RIGHT HERE?);\n //testProcessGenes() takes the fileresource and converts it into a \n //storageresource.\n //processgenes takes a SR and processes it. \n //How would i call the two in main?\n \n \n \n }", "private void analyze() {\n\t\tdouble org = 0;\n\t\tdouble avgIndPerDoc = 0;\n\t\tdouble avgTotalPerDoc = 0;\n\n\t\tfor (Instance instance : instanceProvider.getInstances()) {\n\n\t\t\tint g = 0;\n\t\t\tSet<AbstractAnnotation> orgM = new HashSet<>();\n\n//\t\t\torgM.addAll(instance.getGoldAnnotations().getAnnotations());\n//\t\t\tg += instance.getGoldAnnotations().getAnnotations().size();\n\n\t\t\tfor (AbstractAnnotation instance2 : instance.getGoldAnnotations().getAnnotations()) {\n\n\t\t\t\tResult r = new Result(instance2);\n\n\t\t\t\t{\n////\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(r.getTrend());\n//\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(r.getInvestigationMethod());\n////\t\t\t\t\tList<AbstractAnnotation> aa = new ArrayList<>(\n////\t\t\t\t\t\t\tr.getDefinedExperimentalGroups().stream().map(a -> a.get()).collect(Collectors.toList()));\n//\n//\t\t\t\t\torgM.addAll(aa);\n//\t\t\t\t\tg += aa.size();\n\t\t\t\t}\n\n\t\t\t\t{\n\t\t\t\t\t/**\n\t\t\t\t\t * props of exp\n\t\t\t\t\t */\n\t\t\t\t\tfor (DefinedExperimentalGroup instance3 : r.getDefinedExperimentalGroups()) {\n\n//\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(instance3.getOrganismModel());\n//\t\t\t\t\tList<AbstractAnnotation> aa = new ArrayList<>(instance3.getTreatments());\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(instance3.getInjury());\n\n\t\t\t\t\t\tList<AbstractAnnotation> ab = Arrays.asList(instance3.getInjury());\n\n\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n\t\t\t\t\t\t\t\t.filter(i -> i != null).flatMap(i -> i.getDeliveryMethods().stream())\n\t\t\t\t\t\t\t\t.filter(i -> i != null).collect(Collectors.toList());\n\n\t\t\t\t\t\taa.addAll(instance3.getTreatments().stream().filter(i -> i != null)\n\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Treatment(et))\n\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getDeliveryMethod()).filter(i -> i != null)\n\t\t\t\t\t\t\t\t.collect(Collectors.toList()));\n\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).flatMap(i -> i.getAnaesthetics().stream())\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).collect(Collectors.toList());\n\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getInjuryDevice()).filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.collect(Collectors.toList());\n\n\t\t\t\t\t\t// List<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getInjuryLocation()).filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.collect(Collectors.toList());\n\n\t\t\t\t\t\torgM.addAll(aa);\n\t\t\t\t\t\tg += aa.size();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tavgIndPerDoc += orgM.size();\n\t\t\tavgTotalPerDoc += g;\n\n\t\t\torg += ((double) orgM.size()) / (g == 0 ? 1 : g);\n//\t\t\tSystem.out.println(((double) orgM.size()) / g);\n\n\t\t}\n\t\tSystem.out.println(\"avgTotalPerDoc = \" + avgTotalPerDoc / instanceProvider.getInstances().size());\n\t\tSystem.out.println(\"avgIndPerDoc = \" + avgIndPerDoc / instanceProvider.getInstances().size());\n\t\tSystem.out.println(\"org = \" + org);\n\t\tSystem.out.println(\"avg. org = \" + (org / instanceProvider.getInstances().size()));\n\t\tSystem.out.println(new DecimalFormat(\"0.00\").format(avgTotalPerDoc / instanceProvider.getInstances().size())\n\t\t\t\t+ \" & \" + new DecimalFormat(\"0.00\").format(avgIndPerDoc / instanceProvider.getInstances().size())\n\t\t\t\t+ \" & \" + new DecimalFormat(\"0.00\").format(org / instanceProvider.getInstances().size()));\n\t\tSystem.exit(1);\n\n\t\tStats.countVariables(0, instanceProvider.getInstances());\n\n\t\tint count = 0;\n\t\tfor (SlotType slotType : EntityType.get(\"Result\").getSlots()) {\n\n\t\t\tif (slotType.isExcluded())\n\t\t\t\tcontinue;\n\t\t\tcount++;\n\t\t\tSystem.out.println(slotType.name);\n\n\t\t}\n\t\tSystem.out.println(count);\n\t\tSystem.exit(1);\n\t}", "public static void main(String[] args) throws Exception\n\t{\n\t\tList<Artifact> docs = Artifact.listByType(Type.Document,false);\n\t\tint counter = 0;\n\t\tfor(Artifact doc : docs)\n\t\t{\n\t\t\t\tMLExample.hibernateSession = HibernateUtil.clearSession(MLExample.hibernateSession);\n\t\t\t\tString doc_path = doc.getAssociatedFilePath();\n//\t\t\t\tList<MLExample> trainExamples = \n//\t\t\t\t\tMLExample.getExamplesInDocument(LinkExampleBuilder.ExperimentGroupTimexEvent, doc_path);\n//\t\t\t\tList<MLExample> trainExamples2 = \n//\t\t\t\t\tMLExample.getExamplesInDocument(LinkExampleBuilder.ExperimentGroupEventEvent, doc_path);\n\n\t\t\t\tList<MLExample> trainExamples3 = \n\t\t\t\t\tMLExample.getExamplesInDocument(SecTimeEventExampleBuilder.ExperimentGroupSecTimeEvent,\n\t\t\t\t\t\t\tdoc_path);\n\t\t\t\t\n\t\t\t\tList<MLExample> all_train_examples = new ArrayList<MLExample>();\n//\t\t\t\tall_train_examples.addAll(trainExamples);\n//\t\t\t\tall_train_examples.addAll(trainExamples2);\n\t\t\t\tall_train_examples.addAll(trainExamples3);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor(MLExample example_to_process: all_train_examples)\n\t\t\t\t{\n\t\t\t\t\tNormalizedDependencyFeatures ndf = new NormalizedDependencyFeatures();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tndf.calculateFeatures(example_to_process);\n\n\t\t\t\t\tHibernateUtil.clearLoaderSession();\n\t\t\t\t}\n\t\t\t\tcounter++;\n\t\t\t\tFileUtil.logLine(null, \"Doc processed:\"+counter);\n\t\t//\t\tMLExample example_to_process = MLExample.getInstanceForLink\n\t\t//\t\t(PhraseLink.getInstance(4117), experimentgroup);\n\t\t}\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tList<String> listSouceCode = Helper.getAllDataFromFolder(DATASET1);\n\n\t\t//Create the HMM for concepts\n\t\tHMMConcept hmmConcept = new HMMConcept();\n\t\thmmConcept.init();\n\t\tHMMConceptInit.initTransition(hmmConcept);\n\n\t\t//Now, let us test the training phase\n\t\t//Transition probabilities\n\t\tHMMConceptTransition.\n\t\t\tpreTransition(listSouceCode, hmmConcept);\n\t\tHMMConceptTransition.\n\t\t\ttargetTransition(listSouceCode, hmmConcept);\n\t\tHMMConceptTransition.\n\t\t\totherTransition(listSouceCode, hmmConcept);\n//\t\t//Observations probabilities\n\t\tHMMConceptObservation.\n\t\t\tpreObservation(listSouceCode, hmmConcept);\n\t\tHMMConceptObservation.\n\t\t\ttargetObservation(listSouceCode, hmmConcept);\n\t\tHMMConceptObservation.\n\t\t\totherObservation(listSouceCode, hmmConcept);\n\t\t\n//\t\tSystem.out.println(hmmConcept);\n\n//\t\t//*************************END of the HMM training***************************************\n\n\t\t///To extract knowledge, just uncomment the corresponding source code\n\t\t\n\t\t/**\n\t\t * EPICAM Knowledge extraction\n//\t\t */\n//\t\t//Knowledge extraction\n//\t\tList<String> testedSourceCode = Helper.getAllDataFromFolder(DATASET2);\n//\t\tList<Column> alphaTable;\n//\t\t\n//\t\tfor (String sourceFile : testedSourceCode) {\n//\t\t\talphaTable = MostLikelyExplanationConcept.\n//\t\t\t\t\tfillAlphaStartTable4Concepts(hmmConcept, sourceFile);\n//\n//\t\t\tString extracted = MostLikelyExplanationConcept.knowledgeExtraction(alphaTable);\n////\t\t\tWriting to an OWL file\n//\t\t\tHelper.writeDataToFile(CONCEPTSEXTRACTED, extracted);\n//\t\t\t//The number of false positives and the number of target\n//\t\t\tSystem.out.println(MostLikelyExplanationConcept.nbFalsePositive+\"\\n and nb target: \"+\n//\t\t\tMostLikelyExplanationConcept.nbTarget);\n//\t\t\t\n////\t\t\tSystem.out.println(Term2OWL.term2OWL(new File(CONCEPTSEXTRACTED)));\n//\n//\t\t}\n\n\t\t/**\n\t\t * Geoserver knowledge extraction\n\t\t */\n\n\t\tList<String> testedSourceCode = Helper.getAllDataFromFolder(GEOSERVER);\n\t\tList<Column> alphaTable;\n\t\t\n\t\tfor (String sourceFile : testedSourceCode) {\n\t\t\talphaTable = MostLikelyExplanationConcept.\n\t\t\t\t\tfillAlphaStartTable4Concepts(hmmConcept, sourceFile);\n\n\t\t\tString extracted = MostLikelyExplanationConcept.knowledgeExtraction(alphaTable);\n//\t\t\tWriting to an OWL file\n\t\t\tHelper.writeDataToFile(TERMSEXTRACTED2GEOSERVER, extracted);\n\t\t\t//The number of false positives and the number of target\n\t\t\t\n//\t\t\tSystem.out.println(Term2OWL.term2OWL(new File(CONCEPTSEXTRACTED)));\n\n\t}\n\t\tSystem.out.println(MostLikelyExplanationConcept.nbFalsePositive+\"\\n and nb target: \"+\n\t\tMostLikelyExplanationConcept.nbTarget);\n\t}", "List<Defect> analyze(StructuredScenario mainScenario, HashMap<String, List<StructuredScenario>> sequentiallyRelatedScenariosHashMap, HashMap<String, List<StructuredScenario>> nonSeqRelatedScenarioHashMap);", "protected abstract void initialize(List<Sample> samples, QueryGenerator queryGenerator);", "public static void main(String[] args) throws IOException {\n long startTime = System.nanoTime();\n ParallelStreaming main = new ParallelStreaming();\n main.run(\"referenceGenes.list\", \"Ecoli\");\n\n long runTime = System.nanoTime() - startTime;\n\n for (Map.Entry<String, Sigma70Consensus> entry : main.consensus.entrySet()) {\n System.out.println(entry.getKey() + \" \" + entry.getValue());\n }\n\n System.out.println(\"Total runtime: \" + runTime / 1000000000f + \" seconds\");\n }", "@SuppressWarnings(\"static-access\")\n\t@Override\n\tpublic void runJob(JobProperties jobProperties) {\n\t\t// set global variables from passed job properties file\n\t\t// set type of array format used for object arrays \n\t\t// this will have to be changed to be more dynamic\n\t\t\n\t\t// Entity object that will hold all the wanted entities to be generated\n\n\t\tSet<Entity> builtEnts = new HashSet<Entity>();\n\t\t\n\t\tSet<String> patientIds = new HashSet<String>();\n\t\t\n\t\ttry {\t\n\t\t\tlogger.info(\"Setting Variables\");\n\t\t\tsetVariables(jobProperties);\n\t\t\n\t\t\tFile data = new File(FILE_NAME);\n\t\t\t\n\t\t\tlogger.info(\"Reading Mapping files\");\n\t\t\t\n\t\t\tList<Mapping> mappingFile = Mapping.class.newInstance().generateMappingList(MAPPING_FILE, MAPPING_SKIP_HEADER, MAPPING_DELIMITER, MAPPING_QUOTED_STRING);\n\n\t\t\tList<PatientMapping2> patientMappingFile = \n\t\t\t\t\t!PATIENT_MAPPING_FILE.isEmpty() ? PatientMapping2.class.newInstance().generateMappingList(PATIENT_MAPPING_FILE, MAPPING_DELIMITER): new ArrayList<PatientMapping2>();\n\t\t\t\n\t\t\t\t\t\n\t\t\t// set relational key if not set in config\n\t\t\tif(RELATIONAL_KEY_OVERRIDE == false) {\n\t\t\t\tfor(PatientMapping2 pm: patientMappingFile) {\n\t\t\t\t\tif(pm.getPatientColumn().equalsIgnoreCase(\"PatientNum\")) {\n\t\t\t\t\t\tRELATIONAL_KEY = pm.getPatientKey().split(\":\")[1];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tMap<String,Map<String,String>> datadic = DICT_FILE.exists() ? generateDataDict(DICT_FILE): new HashMap<String,Map<String,String>>();\n\t\t\t\n\t\t\tlogger.info(\"Finished Reading Mapping Files\");\n\n\t\t\tif(data.exists()){\n\t\t\t\t// Read datafile into a List of LinkedHashMaps.\n\t\t\t\t// List should be objects that will be used for up and down casting through out the job process.\n\t\t\t\t// Using casting will allow the application to be very dynamic while also being type safe.\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\n\t\t\t\t\tlogger.info(\"generating patients\");\n\t\t\t\t\t\n\t\t\t\t\tMap<String, Map<String,String>> patientList = buildPatientRecordList(data,patientMappingFile, datadic);\n\t\t\t\t\t\n\t\t\t\t\tfor(String key: patientList.keySet()) {\n\t\t\t\t\t\tMap<String,String> pat = patientList.get(key);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(pat.containsKey(\"patientNum\")) {\n\t\n\t\t\t\t\t\t\tpatientIds.add(pat.get(\"patientNum\"));\n\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbuiltEnts.addAll(processPatientEntities(patientList.get(key)));\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tlogger.info(patientIds.size() + \" Patients Generated.\");\n\t\t\t\t\t\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlogger.error(\"Error building patients\");\n\t\t\t\t\tlogger.error(e);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlogger.info(\"generating tables\");\n\t\t\t\ttry {\n\t\t\t\t\tlogger.info(\"Reading Data Files\");\n\n\t\t\t\t\tList recs = buildRecordList(data, mappingFile, datadic);\n\n\t\t\t\t\tlogger.info(\"Finished reading Data Files\");\n\n\t\t\t\t\tlogger.info(\"Building table Entities\");\n\n\t\t\t\t\tfor(Object o: recs){\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( o instanceof LinkedHashMap ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbuiltEnts.addAll(processEntities(mappingFile,( LinkedHashMap ) o));\t\n\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tlogger.info(\"Finished Building Entities\");\n\t\t\t\t\t\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlogger.error(\"Error Processing data files\");\n\t\t\t\t\tlogger.error(e);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlogger.info(\"Filling in Tree\");\n\t\t\t\tbuiltEnts.addAll(thisFillTree(builtEnts));\n\t\t\t\t\t\t\t\t\n\t\t\t\tlogger.info(\"Generating ConceptCounts\");\n\t\t\t\t\n\t\t\t\tbuiltEnts.addAll(ConceptCounts.generateCounts2(builtEnts, patientIds));\n\t\t\t\t\n\t\t\t\tlogger.info(\"finished generating tables\");\n\n\t\t\t} else {\n\t\t\t\tlogger.error(\"File \" + data + \" Does Not Exist!\");\n\t\t\t}\n\t\t\t//builtEnts.addAll(thisFillTree(builtEnts));\n\t\t\t// for testint seqeunces move this to a global variable and generate it from properties once working;\n\t\t\tlogger.info(\"Generating sequences\");\n\t\t\t\n\t\t\tList<ColumnSequencer> sequencers = new ArrayList<ColumnSequencer>();\n\t\t\t\n\t\t\tif(DO_SEQUENCING) {\n\t\t\t\t\n\t\t\t\tif(DO_CONCEPT_CD_SEQUENCE) sequencers.add(new ColumnSequencer(Arrays.asList(\"ConceptDimension\",\"ObservationFact\"), \"conceptCd\", \"CONCEPTCD\", \"I2B2\", CONCEPT_CD_STARTING_SEQ, 1));\n\t\n\t\t\t\tif(DO_ENCOUNTER_NUM_SEQUENCE) sequencers.add(new ColumnSequencer(Arrays.asList(\"ObservationFact\"), \"encounterNum\", \"ENCOUNTER\", \"I2B2\", ENCOUNTER_NUM_STARTING_SEQ, 1));\n\t\t\t\t\n\t\t\t\tif(DO_INSTANCE_NUM_SEQUENCE) sequencers.add(new ColumnSequencer(Arrays.asList(\"ObservationFact\"), \"instanceNum\", \"INSTANCE\", \"I2B2\", ENCOUNTER_NUM_STARTING_SEQ, 1));\n\t\n\t\t\t\tif(DO_PATIENT_NUM_SEQUENCE) sequencers.add(new ColumnSequencer(Arrays.asList(\"PatientDimension\",\"ObservationFact\",\"PatientTrial\"), \"patientNum\", \"ID\", \"I2B2\", PATIENT_NUM_STARTING_SEQ, 1));\n\n\t\t\t}\n\t\t\t\n\t\t\t//Set<ObjectMapping> oms = new HashSet<ObjectMapping>();\n\t\t\tlogger.info(\"Applying sequences\");\n\t\t\tSet<PatientMapping> pms = new HashSet<PatientMapping>();\t\t\n\t\t\t\n\t\t\tfor(ColumnSequencer seq: sequencers ) {\n\t\t\t\tlogger.info(\"Performing sequence: \" + seq.entityColumn + \" for e ( \" + seq.entityNames + \" )\" );\n\t\t\t\t\n\t\t\t\tpms.addAll(seq.generateSeqeunce2(builtEnts));\n\n\t\t\t}\n\t\t\t\n\t\t\tlogger.info(\"Building Patient Mappings\");\n\t\t\t//Set<PatientMapping> pms = PatientMapping.objectMappingToPatientMapping(oms);\n\t\t\tlogger.info(\"Finished Building Patient Mappings\");\n\t\t\t\n\t\t\t\n\t\t\ttry {\n\n\t\t\t\tlogger.info(\"Performing temp fixes\");\n\t\t\t\t//perform any temp fixes in method called here\n\t\t\t\tperformRequiredTempFixes(builtEnts);\n\t\t\t\t\n\n\t\t\t\t//Map<Path, List<String>> paths = Export.buildFilestoWrite(builtEnts, WRITE_DESTINATION, OUTPUT_FILE_EXTENSION);\n\t\t\t\t\n\t\t\t\tlogger.info(\"writing tables\");\n\t\t\t\t\n\t\t\t\tif(APPEND_FILES == false) {\n\t\t\t\t\t\n\t\t\t\t\tlogger.info(\"Cleaning write directory - \" + new File(WRITE_DESTINATION).getAbsolutePath());\n\t\t\t\t\t\n\t\t\t\t\tExport.cleanWriteDir(WRITE_DESTINATION);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//Export.writeToFile(paths, WRITE_OPTIONS);\n\t\t\t\t\n\t\t\t\tlogger.info(\"Writing Entites to \" + new File(WRITE_DESTINATION).getAbsolutePath());\n\t\t\t\t\n\t\t\t\tExport.writeToFile(builtEnts, WRITE_DESTINATION, OUTPUT_FILE_EXTENSION, WRITE_OPTIONS);\n\t\t\t\t\n\t\t\t\tExport.writeToFile(pms, WRITE_DESTINATION, OUTPUT_FILE_EXTENSION, WRITE_OPTIONS);\n\n\t\t\t\tlogger.info(\"Finished writing files to \" + new File(WRITE_DESTINATION).getAbsolutePath());\n\t\t\t\t\n\t\t\t\t//Export.writeToFile(oms, WRITE_DESTINATION, OUTPUT_FILE_EXTENSION, WRITE_OPTIONS);\n\n\t\t\t} catch ( Exception e1) {\n\t\t\t\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\t//builtEnts.addAll(pms);\n\t\t\t\n\t\t\t//builtEnts.addAll(oms);\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\n\t\t\tlogger.catching(Level.ERROR,e);\n\t\t\t\n\t\t} \n\n\t\tlogger.info(\"Job Completed\");\n\t}", "public void prepareForFeaturesAndOrderCollection() throws Exception {\n\n LOG.info(\" - Preparing phrases...\");\n readPhrases(false);\n collectNumberProps(m_srcPhrs, m_trgPhrs, true, true); \n collectTypeProp(m_srcPhrs, m_trgPhrs); \n\n collectContextEqs();\n prepareSeedDictionary(m_contextSrcEqs, m_contextTrgEqs);\n prepareTranslitDictionary(m_contextSrcEqs);\n filterContextEqs();\n\n collectContextAndTimeProps(m_srcPhrs, m_trgPhrs);\n collectOrderProps(m_srcPhrs, m_trgPhrs);\n }", "public static void main(String[] args) throws FileNotFoundException, IOException, InterruptedException {\n ArrayList<Metric> metrics = new ArrayList<Metric>();\n metrics.add(new ELOC());\n metrics.add(new NOPA());\n metrics.add(new NMNOPARAM());\n MyClassifier c1 = new MyClassifier(\"Logistic Regression\");\n c1.setClassifier(new Logistic());\n String type = \"CodeSmellDetection\";\n String smell = \"Large Class\";\n Model model = new Model(\"antModel1\", \"ant\", \"https://github.com/apache/ant.git\", metrics, c1, \"\", type, smell);\n Process process = new Process();\n String periodLength = \"All\";\n String version = \"rel/1.8.3\";\n \n String projectName = model.getProjName();\n process.initGitRepositoryFromFile(scatteringFolderPath + \"/\" + projectName\n + \"/gitRepository.data\");\n try {\n DeveloperTreeManager.calculateDeveloperTrees(process.getGitRepository()\n .getCommits(), periodLength);\n DeveloperFITreeManager.calculateDeveloperTrees(process.getGitRepository()\n .getCommits(), periodLength);\n } catch (Exception ex) {\n Logger.getLogger(TestFile.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n List<Commit> commits = process.getGitRepository().getCommits();\n PeriodManager.calculatePeriods(commits, periodLength);\n List<Period> periods = PeriodManager.getList();\n \n String dirPath = Config.baseDir + projectName + \"/models/\" + model.getName();\n Files.createDirectories(Paths.get(dirPath));\n \n for (Period p : periods) {\n File periodData = new File(dirPath + \"/predictors.csv\");\n PrintWriter pw1 = new PrintWriter(periodData);\n \n String message1 = \"nome,\";\n for(Metric m : metrics) {\n message1 += m.getNome() + \",\";\n }\n message1 += \"isSmell\\n\";\n pw1.write(message1);\n \n //String baseSmellPatch = \"C:/ProgettoTirocinio/dataset/apache-ant-data/apache_1.8.3/Validated\";\n CalculateSmellFiles cs = new CalculateSmellFiles(model.getProjName(), \"Large Class\", \"1.8.1\");\n \n List<FileBean> smellClasses = cs.getSmellClasses();\n \n String projectPath = baseFolderPath + projectName;\n \n Git.gitReset(new File(projectPath));\n Git.clean(new File(projectPath));\n \n List<FileBean> repoFiles = Git.gitList(new File(projectPath), version);\n System.out.println(\"Repo size: \"+repoFiles.size());\n \n \n for (FileBean file : repoFiles) {\n \n if (file.getPath().contains(\".java\")) {\n File workTreeFile = new File(projectPath + \"/\" + file.getPath());\n\n ClassBean classBean = null;\n \n if (workTreeFile.exists()) {\n ArrayList<ClassBean> code = new ArrayList<>();\n ArrayList<ClassBean> classes = ReadSourceCode.readSourceCode(workTreeFile, code);\n \n String body = file.getPath() + \",\";\n if (classes.size() > 0) {\n classBean = classes.get(0);\n\n }\n for(Metric m : metrics) {\n try{\n body += m.getValue(classBean, classes, null, null, null, null) + \",\";\n } catch(NullPointerException e) {\n body += \"0.0,\";\n }\n }\n \n //isSmell\n boolean isSmell = false;\n for(FileBean sm : smellClasses) {\n if(file.getPath().contains(sm.getPath())) {\n System.out.println(\"ok\");\n isSmell = true;\n break;\n }\n }\n \n body = body + isSmell + \"\\n\";\n pw1.write(body); \n }\n }\n }\n Git.gitReset(new File(projectPath));\n pw1.flush();\n }\n \n WekaEvaluator we1 = new WekaEvaluator(baseFolderPath, projectName, new Logistic(), \"Logistic Regression\", model.getName());\n \n ArrayList<Model> models = new ArrayList<Model>();\n \n models.add(model);\n System.out.println(models);\n //create a project\n Project p1 = new Project(\"https://github.com/apache/ant.git\");\n p1.setModels(models);\n p1.setName(\"ant\");\n p1.setVersion(version);\n \n ArrayList<Project> projects;\n //projects.add(p1);\n \n //create a file\n// try {\n// File f = new File(Config.baseDir + \"projects.txt\");\n// FileOutputStream fileOut;\n// if(f.exists()){\n// projects = ProjectHandler.getAllProjects(); \n// Files.delete(Paths.get(Config.baseDir + \"projects.txt\"));\n// //fileOut = new FileOutputStream(f, true);\n// } else {\n// projects = new ArrayList<Project>();\n// Files.createFile(Paths.get(Config.baseDir + \"projects.txt\"));\n// }\n// fileOut = new FileOutputStream(f);\n// projects.add(p1);\n// ObjectOutputStream out = new ObjectOutputStream(fileOut);\n// out.writeObject(projects);\n// out.close();\n// fileOut.close();\n//\n// } catch (FileNotFoundException e) {\n// e.printStackTrace();\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// ProjectHandler.setCurrentProject(p1);\n// Project curr = ProjectHandler.getCurrentProject();\n// System.out.println(curr.getGitURL()+\" --- \"+curr.getModels());\n// ArrayList<Project> projectest = ProjectHandler.getAllProjects();\n// for(Project testp : projectest){\n// System.out.println(testp.getModels());\n// }\n }", "public static void main(String[] args) {\n\t\tString great_association_rule =\"singlenearestgene\";\n\t\t\n\t\t//String filename = \"C:\\\\Users\\\\Burçak\\\\Google Drive\\\\GLANET_Bioinformatics_2ndSubmission\\\\GREAT\\\\great_twonearestgenes_found_enriched_BP_GO_Terms.txt\";\n\t\tString filename = \"C:\\\\Users\\\\Burçak\\\\Google Drive\\\\GLANET_Bioinformatics_2ndSubmission\\\\GREAT\\\\great_singlenearestgene_found_enriched_BP_GO_Terms.txt\";\n\t\tList<String> great_enriched_BP_GOTermNames_List = new ArrayList<String>();\n\t\treadFileAndFill(filename,great_enriched_BP_GOTermNames_List);\n\t\t\n\t\tSystem.out.println(\"Number of GO Term Names found enriched by GREAT: \" + great_enriched_BP_GOTermNames_List.size());\n\t\t\n\t\t//Fill GOTermName 2 GOTermID map\n\t\tString GOID2TermInputFile = \"C:\\\\Users\\\\Burçak\\\\Google Drive\\\\Data\\\\\" + Commons.GENE_ONTOLOGY_TERMS + System.getProperty(\"file.separator\") + Commons.GOID2TERM_INPUTFILE;\n\t\tMap<String,String> GOTermName2GOTermIDMap = new HashMap<String,String>();\n\t\tGOTermsUtility.fillGOTermName2GOTermIDMap(GOID2TermInputFile, GOTermName2GOTermIDMap);\n\t\t\n\t\t//output the converted GO Term IDs\n\t\t//GOTermList_GATA2_P= c(\"GO:0006351\",\"GO:0035854\",\"GO:0045599\",\"GO:0045746\",\"GO:0045766\",\"GO:0045944\",\"GO:0070345\",\"GO:2000178\")\n\t\tString great_enriched_BP_GOTermIDs = creatGOTermIDString(great_association_rule,great_enriched_BP_GOTermNames_List,GOTermName2GOTermIDMap);\n\t\t\n\t\tSystem.out.println(\"**************************************************\");\n\t\tSystem.out.println(great_enriched_BP_GOTermIDs);\n\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t List<Result> outputK = new ArrayList<Result>();\n\n\t\t\t\n\t\t\tint alignment_type = Integer.parseInt(args[0]);\n\t\t\t\n\t\t\tif(alignment_type==1){\n\t\t\t\t\n\t\t\t\tGlobalAlignment gb = new GlobalAlignment();\n\n\t\t\t\toutputK = \tgb.PerformGlobalAlignment(args[1],args[2],args[3],args[4],Integer.parseInt(args[5]),Integer.parseInt(args[6]));\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\tfor(int i=0;i<outputK.size();i++){\n\t\t\t\t\tResult r = outputK.get(i);\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(r.score);\n \tSystem.out.println(\"id1 \"+r.id1+\" \"+r.startpos1+\" \"+r.seq1);\n\t\t\t\t\tSystem.out.println(\"id2 \"+r.id2+\" \"+r.startpos2+\" \"+r.seq2);\n//\t\t\t\t\t\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else if(alignment_type==2){\n\t\t\t\t\n\t\t\t\tLocalAlignment loc = new LocalAlignment();\n\t\t\t\toutputK = \tloc.PerformLocalAlignment(args[1],args[2],args[3],args[4],Integer.parseInt(args[5]),Integer.parseInt(args[6]));\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\tfor(int i=0;i<outputK.size();i++){\n\t\t\t\t\tResult r = outputK.get(i);\n\n\t\t\t\t\tSystem.out.println(r.score);\n System.out.println(\"id1 \"+r.id1+\" \"+r.startpos1+\" \"+r.seq1);\n\t\t\t\t\tSystem.out.println(\"id2 \"+r.id2+\" \"+r.startpos2+\" \"+r.seq2);\n\n\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}else if(alignment_type==3){\n\t\t\t\t\n\t\t \tDoveTail dt = new DoveTail();\t\t\n\t\t\t\toutputK = \tdt.PerformDoveTailAlignment(args[1],args[2],args[3],args[4],Integer.parseInt(args[5]),Integer.parseInt(args[6]));\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\tfor(int i=0;i<outputK.size();i++){\n\t\t\t\t\tResult r = outputK.get(i);\n\n\t\t\t\t\tSystem.out.println(r.score);\n System.out.println(\"id1 \"+r.id1+\" \"+r.startpos1+\" \"+r.seq1);\n\t\t\t\t\tSystem.out.println(\"id2 \"+r.id2+\" \"+r.startpos2+\" \"+r.seq2);\n\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}else{\n\t\t\t\tSystem.out.println(\"Enter 1,2 or 3\");\n\t\t\t}\n\t\t\n\t\n\t}", "public static void main(String abc[]) throws Exception{\n\tScanner scan=new Scanner(System.in); //for taking the input from user\n\t//Asking the user for the description\n\tSystem.out.println(\"Please mention the description of the ontology\");\n\tString s1_des;\n\ts1_des=scan.nextLine();\n\t//Asking the user for the competency questions\n\tSystem.out.println(\"Please mention the Competency Questions related to the Ontology\");\n\tString s2_cq;\n\ts2_cq=scan.nextLine();\t\n\t//This java file has code for OWL file and classifying different properties\n\tOwl_Lexical owl_ontology=new Owl_Lexical();\n\towl_ontology.owlOntology();\n\t//Saving the description of the ontology in a file\n\tBufferedWriter writer_des=new BufferedWriter(new FileWriter(\"ontology_description\"));\n\twriter_des.write(s1_des);\n\twriter_des.close();\n\t//Saving the competency questions of the ontology in a file\n\tBufferedWriter writer_cq=new BufferedWriter(new FileWriter(\"ontology_cq\"));\n\twriter_cq.write(s2_cq);\n\twriter_cq.close();\n\t//Stop words from competency questions are removed\n\tStopWords_CqOntology stop_cq=new StopWords_CqOntology();\n\tstop_cq.stopWordsCQOntology();\n\t//Stop Words from the description are removed\n\tStopWords_Ontology stop_des=new StopWords_Ontology();\n\tstop_des.stopWordsDesOntology();\t\n\t\n/*--------------------------------EXECUTION PART------------------------------------------------\n <-------------------------------STRUCTURAL ANALYSIS---------------------------------------------->\t\n Properties obtained from the OWL file are analysed. Doc2Vec is used and cosine similarity \n gives the numeric score of the ontology against each ODP.The below functions call the respective\n class that holds the code for each Structural Property that we have taken under consideration \n for the analysis. */\n\t// 1. CHAIN OF PROPERTY\n\tParagraphVectorsChainOfProperty cp=new ParagraphVectorsChainOfProperty();\n\tcp.chainOf();\n\t// 2. DATA DOMAIN Property\n\tParagraphVectorsDataPropertyDomain pd=new ParagraphVectorsDataPropertyDomain();\n\tpd.dataPropertyDomain();\n\t// 3. DATA RANGE PROPERTY\n\tParagraphVectorsDataPropertyRange pr=new ParagraphVectorsDataPropertyRange();\n\tpr.dataPropertyRange();\n\t// 4. DISJOINT CLASSES\n\tParagraphVectorsDisjointClasses dc=new ParagraphVectorsDisjointClasses();\n\tdc.disjointClasses();\n\t// 5. OBJECT DOMAIN PROPERTY\n\tParagraphVectorsObjectDomainProperty od=new ParagraphVectorsObjectDomainProperty();\n\tod.objectDomainProperty();\n\t// 6. OBJECT RANGE PROPERTY\n\tParagraphVectorsObjectPropertyRange op=new ParagraphVectorsObjectPropertyRange();\n\top.objectRangeProperty();\n\t// 7. SUB-CLASS PROPERTY\n\tParagraphVectorsSubClassProperty sc=new ParagraphVectorsSubClassProperty();\n\tsc.subClassProperty();\n\t// 8. SUB-DATA PROPERTY\n\tParagraphVectorsSubDataProperty sd=new ParagraphVectorsSubDataProperty();\n\tsd.subDataProperty();\n\t// 9. SUB-OBJECT PROPERTY\n\tParagraphVectorsSubObjectProperty so=new ParagraphVectorsSubObjectProperty();\n\tso.subObjectProperty();\n\t\n/*<-----------------------------------BEHAVIOURAL ANALYSIS-------------------------------------------->\n The Competency Question of the ontology are saved and mappped with the competency questions \n of the ODPs in the list. The ODPs obtained manchester site do not have competency questions, but \n the rest all ontologies have.So, approximately 15 among the 73 ODPs present are without CQs\t\n\t*/\n\tParagraphVectors_CQ cq=new ParagraphVectors_CQ();\n\tcq.cqMapping();\n/*<------------------------------------LEXICAL ANALYSIS------------------------------------------------>\n Lexical Analysis involves the analysis by use of the description and by the names of classes\n properties present in the OWL file. The description along with the description(classes and properties) \n of the OWL file of the ontology are compared against the ODPs. All the ODPs present have description\n *along with the classes and properties.\n */\n // 1. DESCRIPTION\n\tParagraphVectorsTextExample te=new ParagraphVectorsTextExample();\n\tte.description();\n\t// 2. SIGNATURE\n\tParagraphVectors_Signature vs=new ParagraphVectors_Signature();\n\tvs.signature();\n/*<--------------------------------------INTEGRATION OF SCORES----------------------------------------->\n * After obtaning the numeric values of lexical, structural and behavioural parts, the cosine \n * similarity scores are combined together of the ontology and the ODPs and placed in a single\n * file.\n */\n\tIntegration_Of_Scores os=new Integration_Of_Scores();\n\tos.integratingScores();\n/*<----------------------------------------NORMALISING SCORES------------------------------------------->\n * After all the scores of an ODP (against the given ontology) are added up, the scores are normalised\n * so that these range between 0 to 1 and we can set a particular threshold for the ODP recommendations\n */\n\tNormalising_Scores ns=new Normalising_Scores();\n\tns.normalisingScores();\n/*<------------------------------------------ODP RECOMMENDER-------------------------------------------->\n * \tAfter we have normalised the scores against the ODPs, we run the this java program from where the\n * recommendations can be suggested. \n */\n ODPRecommender reco=new ODPRecommender();\n reco.odpRecommender();\n\t\n}", "public static void main(String[] args) \n\t{\n\t\tClassPathXmlApplicationContext context = null;\n\t\ttry {\n\t\t\tcontext = new ClassPathXmlApplicationContext(\"ApplicationContext.xml\");\n\t\t\tNlpDocumentsDao docDao = (NlpDocumentsDao) context.getBean(\"nlpDocumentsDao\");\t\t\t\n\t\t\tString docId = \"12771596\";\n\t\t\t/*List<NlpPatientHitsDocs> nlpDocRecs = docDao.getNlpDocsWithHits(docId);\n\n\t\t\tfor (int i=0; i<nlpDocRecs.size(); i++) {\n\t\t\t\tNlpPatientHitsDocs nlpRecord = nlpDocRecs.get(i);\n\t\t\t\tSystem.out.println(\"Document:\\n\"+nlpRecord.getNote_content().substring(0, 100));\n\t\t\t}\t*/\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t} catch(Throwable th) {\n\t\t\tth.printStackTrace();\n\t\t} finally {\n\t\t\tcontext.close();\n\t\t}\n\t}", "public static Ld calculateLd(GeneticVariant variant1, GeneticVariant variant2) throws LdCalculatorException\n \t{\n \n \t\tif (variant1 == null)\n \t\t{\n \t\t\tthrow new IllegalArgumentException(\"Variant1 = null\");\n \t\t}\n \n \t\tif (variant2 == null)\n \t\t{\n \t\t\tthrow new IllegalArgumentException(\"Variant2 = null\");\n \t\t}\n \n \t\tif (variant1.getAlleleCount() != 2 || variant2.getAlleleCount() != 2)\n \t\t{\n \t\t\tthrow new UnsupportedOperationException(\"Ld calculator currently only supports biallelic variants\");\n \t\t}\n \n \t\tfinal byte[] variant1Genotypes = variant1.getSampleCalledDosages();\n \t\tfinal byte[] variant2Genotypes = variant2.getSampleCalledDosages();\n \n \t\tif (variant1Genotypes.length != variant2Genotypes.length)\n \t\t{\n \t\t\tthrow new LdCalculatorException(\"Error calculating LD: \" + variant1.getPrimaryVariantId() + \" contains \"\n \t\t\t\t\t+ variant1Genotypes.length + \" samples and \" + variant2.getPrimaryVariantId() + \" contains\"\n \t\t\t\t\t+ variant2Genotypes.length + \" samples. This should be identical\");\n \t\t}\n \n \t\t// matrix with all combinations between variant 1 genotypes and variant\n \t\t// 2 genotypes\n \t\tint[][] genotypes = new int[3][3];\n \n \t\tint calledGenoypes = 0;\n \n \t\tfor (int ind = 0; ind < variant1Genotypes.length; ++ind)\n \t\t{\n \t\t\tbyte genotypeVariant1 = variant1Genotypes[ind];\n \t\t\tbyte genotypeVariant2 = variant2Genotypes[ind];\n \t\t\tif (genotypeVariant1 != -1 && genotypeVariant2 != -1)\n \t\t\t{\n \t\t\t\tgenotypes[genotypeVariant1][genotypeVariant2]++;\n \t\t\t\t++calledGenoypes;\n \t\t\t}\n \t\t}\n \n \t\t// matrix with freq for all combined genotypes\n \t\tdouble[][] genotypesFreq = new double[3][3];\n \t\tfor (int x = 0; x < 3; x++)\n \t\t{\n \t\t\tfor (int y = 0; y < 3; y++)\n \t\t\t{\n \t\t\t\tgenotypesFreq[x][y] = (double) genotypes[x][y] / (double) calledGenoypes;\n \t\t\t}\n \t\t}\n \n \t\t// Determine allele freq of variants:\n \t\tdouble[][] alleleFreq = new double[2][2];\n \t\t// Variant 1:\n \t\talleleFreq[0][0] = (genotypesFreq[0][0] + genotypesFreq[0][1] + genotypesFreq[0][2])\n \t\t\t\t+ (genotypesFreq[1][0] + genotypesFreq[1][1] + genotypesFreq[1][2]) / 2d;\n \t\talleleFreq[0][1] = (genotypesFreq[2][0] + genotypesFreq[2][1] + genotypesFreq[2][2])\n \t\t\t\t+ (genotypesFreq[1][0] + genotypesFreq[1][1] + genotypesFreq[1][2]) / 2d;\n \t\t// Variant 2:\n \t\talleleFreq[1][0] = (genotypesFreq[0][0] + genotypesFreq[1][0] + genotypesFreq[2][0])\n \t\t\t\t+ (genotypesFreq[0][1] + genotypesFreq[1][1] + genotypesFreq[2][1]) / 2d;\n \t\talleleFreq[1][1] = (genotypesFreq[0][2] + genotypesFreq[1][2] + genotypesFreq[2][2])\n \t\t\t\t+ (genotypesFreq[0][1] + genotypesFreq[1][1] + genotypesFreq[2][1]) / 2d;\n \n \t\t// Precalculate triangles of non-double heterozygote:\n \t\tdouble[][] genotypesTriangleFreq = new double[3][3];\n \t\tgenotypesTriangleFreq[0][0] = 2d * genotypesFreq[0][0] + genotypesFreq[1][0] + genotypesFreq[0][1];\n \t\tgenotypesTriangleFreq[2][0] = 2d * genotypesFreq[2][0] + genotypesFreq[1][0] + genotypesFreq[2][1];\n \t\tgenotypesTriangleFreq[0][2] = 2d * genotypesFreq[0][2] + genotypesFreq[1][2] + genotypesFreq[0][1];\n \t\tgenotypesTriangleFreq[2][2] = 2d * genotypesFreq[2][2] + genotypesFreq[1][2] + genotypesFreq[2][1];\n \n \t\t// Calculate expected genotypes, assuming equilibrium, take this as\n \t\t// start:\n \t\tdouble h11 = alleleFreq[0][0] * alleleFreq[1][0];\n \t\tdouble h12 = alleleFreq[0][0] * alleleFreq[1][1];\n \t\tdouble h21 = alleleFreq[0][1] * alleleFreq[1][0];\n \t\tdouble h22 = alleleFreq[0][1] * alleleFreq[1][1];\n \n \t\t// Calculate the frequency of the two double heterozygotes:\n \t\tdouble x12y12 = (h11 * h22 / (h11 * h22 + h12 * h21)) * genotypesFreq[1][1];\n \t\tdouble x12y21 = (h12 * h21 / (h11 * h22 + h12 * h21)) * genotypesFreq[1][1];\n \n \t\t// Perform iterations using EM algorithm:\n \t\tfor (int itr = 0; itr < 25; itr++)\n \t\t{\n \n \t\t\th11 = (x12y12 + genotypesTriangleFreq[0][0]) / 2;\n \t\t\th12 = (x12y21 + genotypesTriangleFreq[0][2]) / 2;\n\t\t\th21 = (x12y21 + genotypesTriangleFreq[2][0]) / 2;\n \t\t\th22 = (x12y12 + genotypesTriangleFreq[2][2]) / 2;\n \n \t\t\tx12y12 = (h11 * h22 / (h11 * h22 + h12 * h21)) * genotypesFreq[1][1];\n \t\t\tx12y21 = (h12 * h21 / (h11 * h22 + h12 * h21)) * genotypesFreq[1][1];\n \n \t\t}\n \n \t\tdouble d = h11 - (alleleFreq[0][0] * alleleFreq[1][0]);\n \n \t\tdouble rSquared = d * d / (alleleFreq[0][0] * alleleFreq[0][1] * alleleFreq[1][0] * alleleFreq[1][1]);\n \n \t\tdouble dMax = 0;\n \t\tif (d < 0)\n \t\t{\n \t\t\tdouble a = alleleFreq[0][1] * alleleFreq[1][1];\n \t\t\tif (alleleFreq[0][0] > alleleFreq[1][0])\n \t\t\t{\n \t\t\t\ta = alleleFreq[0][0] * alleleFreq[1][0];\n \t\t\t}\n \t\t\tdouble b = alleleFreq[0][0] * alleleFreq[1][0];\n \t\t\tif (alleleFreq[0][0] > alleleFreq[1][0])\n \t\t\t{\n \t\t\t\tb = alleleFreq[0][1] * alleleFreq[1][1];\n \t\t\t}\n \t\t\tdMax = Math.min(a, b);\n \t\t}\n \t\telse\n \t\t{\n \t\t\tdouble a = alleleFreq[0][1] * alleleFreq[1][0];\n \t\t\tif (alleleFreq[0][0] > alleleFreq[1][0])\n \t\t\t{\n \t\t\t\ta = alleleFreq[0][0] * alleleFreq[1][1];\n \t\t\t}\n \t\t\tdouble b = alleleFreq[0][0] * alleleFreq[1][1];\n \t\t\tif (alleleFreq[0][0] > alleleFreq[1][0])\n \t\t\t{\n \t\t\t\tb = alleleFreq[0][1] * alleleFreq[1][0];\n \t\t\t}\n \t\t\tdMax = Math.min(a, b);\n \t\t}\n \t\tdouble dPrime = Math.abs(d / dMax);\n \n \t\t// sometimes dPrime slightly larger then 1. Fixing this:\n \t\tdPrime = Math.min(1, dPrime);\n \n \t\tString variant1Alt = variant1.getVariantAlleles().get(1).getAlleleAsString();\n \t\tString variant1Ref = variant1.getVariantAlleles().get(0).getAlleleAsString();\n \t\tString variant2Alt = variant2.getVariantAlleles().get(1).getAlleleAsString();\n \t\tString variant2Ref = variant2.getVariantAlleles().get(0).getAlleleAsString();\n \n \t\tLinkedHashMap<String, Double> haplotypesFreq = new LinkedHashMap<String, Double>(4);\n \t\thaplotypesFreq.put(variant1Alt + variant2Alt, h11);\n \t\thaplotypesFreq.put(variant1Alt + variant2Ref, h12);\n \t\thaplotypesFreq.put(variant1Ref + variant2Alt, h21);\n \t\thaplotypesFreq.put(variant1Ref + variant2Ref, h22);\n \n \t\treturn new Ld(variant1, variant2, rSquared, dPrime, haplotypesFreq);\n \n \t}", "public static void main(String[] args) throws UIMAException, IOException, CpeDescriptorException, SAXException {\n\n if (args.length < 2) {\n System.out.println(\"Please provide where to write stats.\");\n System.exit(1);\n }\n\n // \"../data/stats/kbp/chinese_mention_surfaces.tsv\"\n String mentionSurfaceFile = args[0];\n\n // \"../data/stats/kbp/chinese_mention_coverage_report\"\n String statOutputDir = args[1];\n\n // A place to put intermediate files.\n String workingDir = args[2];\n\n Configuration commonConfig = new Configuration(\"settings/common.properties\");\n String typeSystemName = commonConfig.get(\"edu.cmu.cs.lti.event.typesystem\");\n\n TypeSystemDescription typeSystemDescription = TypeSystemDescriptionFactory\n .createTypeSystemDescription(typeSystemName);\n\n String[] datasetNames = {\"LDC2014E114\", \"LDC2015E105\", \"LDC2015E78\", \"LDC2015E112_R2\", \"ACE2005_Chinese\"};\n\n EventDataReader dataReader = new EventDataReader(workingDir, \"all\", false);\n\n for (String datasetName : datasetNames) {\n String dataConfigPath = commonConfig.get(\"edu.cmu.cs.lti.dataset.settings.path\");\n Configuration datasetConfig = new Configuration(\n new File(dataConfigPath, datasetName + \".properties\"));\n dataReader.readData(datasetConfig, dataConfigPath, typeSystemDescription);\n }\n\n CollectionReaderDescription reader = dataReader.getReader();\n\n AnalysisEngineDescription goldAnnotator = AnalysisEngineFactory.createEngineDescription(\n GoldStandardEventMentionAnnotator.class, typeSystemDescription,\n GoldStandardEventMentionAnnotator.PARAM_TARGET_VIEWS,\n new String[]{CAS.NAME_DEFAULT_SOFA, UimaConst.inputViewName},\n GoldStandardEventMentionAnnotator.PARAM_COPY_MENTION_TYPE, true,\n GoldStandardEventMentionAnnotator.PARAM_COPY_REALIS, true,\n GoldStandardEventMentionAnnotator.PARAM_COPY_CLUSTER, true,\n GoldStandardEventMentionAnnotator.PARAM_COPY_RELATIONS, true\n );\n\n AnalysisEngineDescription surfaceCollector = AnalysisEngineFactory\n .createEngineDescription(EventMentionSurfaceCollector.class,\n EventMentionSurfaceCollector.PARAM_OUTPUT_FILE_PATH, mentionSurfaceFile\n );\n\n SimplePipeline.runPipeline(reader, goldAnnotator, surfaceCollector);\n\n for (int i = 0; i < datasetNames.length; i++) {\n EventDataReader datasetEventReader = new EventDataReader(workingDir, datasetNames[i], false);\n\n String datasetName = datasetNames[i];\n\n CollectionReaderDescription dataSetReader = datasetEventReader.getReader();\n\n AnalysisEngineDescription stanfordProcessor = AnalysisEngineFactory.createEngineDescription(\n StanfordCoreNlpAnnotator.class, typeSystemDescription,\n StanfordCoreNlpAnnotator.PARAM_LANGUAGE, \"zh\",\n StanfordCoreNlpAnnotator.PARAM_SPLIT_ONLY, true\n );\n\n AnalysisEngineDescription coverageReport = AnalysisEngineFactory.createEngineDescription(\n EventMentionSurfaceCoverageReport.class,\n EventMentionSurfaceCoverageReport.PARAM_EVENT_MENTION_SURFACE, mentionSurfaceFile,\n EventMentionSurfaceCoverageReport.PARAM_REPORT_OUTPUT, statOutputDir,\n EventMentionSurfaceCoverageReport.PARAM_DATA_SET_NAME, datasetName\n );\n\n new BasicPipeline(dataSetReader, goldAnnotator, stanfordProcessor, coverageReport).run();\n }\n }", "@DataProvider(name = \"toyIntegratedVariants\")\n public Object[][] getAnnotateStructuralVariantTestData() {\n return new Object[][]{\n { createVariantContext(\"chr1\", 10, 50, null, null, null,\n \"<CNV>\", 40, null, null, null),\n createAttributesMap(\n Arrays.asList(GATKSVVCFConstants.PROMOTER, GATKSVVCFConstants.INTERGENIC),\n Arrays.asList(\"EMMA1\", true)) },\n { createVariantContext(\"chr1\", 50, 450, null, null, null,\n \"<DEL>\", 400, null, null, null),\n createAttributesMap(\n Arrays.asList(GATKSVVCFConstants.LOF, GATKSVVCFConstants.NONCODING_BREAKPOINT,\n GATKSVVCFConstants.INTERGENIC),\n Arrays.asList(\"EMMA1\", \"DNase\", false)) },\n { createVariantContext(\"chr1\", 1100, 1700, null, null, null,\n \"<INV>\", 600, null, null, null),\n createAttributesMap(\n Arrays.asList(GATKSVVCFConstants.NONCODING_SPAN, GATKSVVCFConstants.NEAREST_TSS,\n GATKSVVCFConstants.INTERGENIC),\n Arrays.asList(\"Enhancer\", \"EMMA1\", true)) },\n { createVariantContext(\"chr1\", 1300, 1800, null, null, null,\n \"<INS:LINE1>\", 42, null, null, null),\n createAttributesMap(\n Arrays.asList(GATKSVVCFConstants.NONCODING_BREAKPOINT, GATKSVVCFConstants.NEAREST_TSS,\n GATKSVVCFConstants.INTERGENIC),\n Arrays.asList(\"Enhancer\", \"EMMA1\", true)) },\n { createVariantContext(\"chr1\", 2000, 2200, null, null, null,\n \"<DUP>\", 42, null, null, null),\n createAttributesMap(\n Arrays.asList(GATKSVVCFConstants.DUP_PARTIAL,GATKSVVCFConstants.INTERGENIC),\n Arrays.asList(\"EMMA2\", false)) },\n { createVariantContext(\"chr1\", 3100, 3300, null, null, null,\n \"<DUP>\", 200, null, null, null),\n createAttributesMap(\n Arrays.asList(GATKSVVCFConstants.PROMOTER,GATKSVVCFConstants.INTERGENIC),\n Arrays.asList(\"EMMA2\", true)) },\n // check annotate promoter for all segments in multi-segment SV\n { createVariantContext(\"chr1\", 30, 30, \"chr1\", 3030, null,\n \"<BND>\", null, \"-+\", null, null),\n createAttributesMap(\n Arrays.asList(GATKSVVCFConstants.PROMOTER, GATKSVVCFConstants.INTERGENIC),\n Arrays.asList(Arrays.asList(\"EMMA1\", \"EMMA2\"), true)) }\n };\n }", "public static void main(String[] args) {\n\t\tPropertyManager.setPropertyFilePath(\"/home/francesco/Desktop/NLP_HACHATHON_4YFN/TextDigesterConfig.properties\");\n\t\t\n\t\tString text = MultilingImport.readText(\"/home/francesco/Desktop/NLP_HACHATHON_4YFN/EXAMPLE_TEXTS/multilingMss2015Training/body/text/\" + lang + \"/\" + docName);\n\n\t\t/* Process text document */\n\t\tLangENUM languageOfHTMLdoc = FlProcessor.getLanguage(text);\n\t\t\n\t\tTDDocument TDdoc = FlProcessor.generateDocumentFromFreeText(text, null, languageOfHTMLdoc);\n\n\t\t// Store GATE document\n\t\tWriter out = null;\n\t\ttry {\n\t\t\tout = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(\"/home/francesco/Desktop/NLP_HACHATHON_4YFN/EXAMPLE_TEXTS/\" + lang + \"_\" + docName.replace(\".txt\", \"_GATE.xml\")), \"UTF-8\"));\n\t\t} catch (UnsupportedEncodingException e1) {\n\t\t\te1.printStackTrace();\n\t\t} catch (FileNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tout.write(TDdoc.getGATEdoc().toXml());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tout.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\ttry {\n\t\t\tLexRankSummarizer lexRank = new LexRankSummarizer(languageOfHTMLdoc, SentenceSimilarityENUM.cosineTFIDF, false, 0.01);\n\t\t\tMap<Annotation, Double> sortedSentences = lexRank.sortSentences(TDdoc);\n\t\t\t\n\t\t\tList<Annotation> sentListOrderedByRelevance = new ArrayList<Annotation>();\n\t\t\tfor(Entry<Annotation, Double> sentence : sortedSentences.entrySet()) {\n\t\t\t\tlogger.info(\"Score: \" + sentence.getValue() + \" - '\" + GtUtils.getTextOfAnnotation(sentence.getKey(), TDdoc.getGATEdoc()) + \"'\");\n\t\t\t\tsentListOrderedByRelevance.add(sentence.getKey());\n\t\t\t}\n\t\t\t\n\t\t\tlogger.info(\"Summary max 100 tokens: \");\n\t\t\tList<Annotation> summarySentences = GtUtils.orderAnnotations(sentListOrderedByRelevance, TDdoc.getGATEdoc(), 100);\n\t\t\tfor(Annotation ann : summarySentences) {\n\t\t\t\tlogger.info(GtUtils.getTextOfAnnotation(ann, TDdoc.getGATEdoc()));\n\t\t\t}\n\t\t} catch (TextDigesterException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t*/\n\t}", "public static void main(final String[] args) throws IOException {\n // Instantiate a client that will be used to call the service.\n DocumentAnalysisClient client = new DocumentAnalysisClientBuilder()\n .credential(new AzureKeyCredential(\"{key}\"))\n .endpoint(\"https://{endpoint}.cognitiveservices.azure.com/\")\n .buildClient();\n\n File invoice = new File(\"./formrecognizer/azure-ai-formrecognizer/src/samples/resources/Sample-W2.jpg\");\n Path filePath = invoice.toPath();\n BinaryData invoiceData = BinaryData.fromFile(filePath, (int) invoice.length());\n\n SyncPoller<OperationResult, AnalyzeResult> analyzeW2Poller =\n client.beginAnalyzeDocument(\"prebuilt-tax.us.w2\", invoiceData);\n\n AnalyzeResult analyzeTaxResult = analyzeW2Poller.getFinalResult();\n\n for (int i = 0; i < analyzeTaxResult.getDocuments().size(); i++) {\n AnalyzedDocument analyzedTaxDocument = analyzeTaxResult.getDocuments().get(i);\n Map<String, DocumentField> taxFields = analyzedTaxDocument.getFields();\n System.out.printf(\"----------- Analyzing Document %d -----------%n\", i);\n DocumentField w2FormVariantField = taxFields.get(\"W2FormVariant\");\n if (w2FormVariantField != null) {\n if (DocumentFieldType.STRING == w2FormVariantField.getType()) {\n String merchantName = w2FormVariantField.getValueAsString();\n System.out.printf(\"Form variant: %s, confidence: %.2f%n\",\n merchantName, w2FormVariantField.getConfidence());\n }\n }\n\n DocumentField employeeField = taxFields.get(\"Employee\");\n if (employeeField != null) {\n System.out.println(\"Employee Data: \");\n if (DocumentFieldType.MAP == employeeField.getType()) {\n Map<String, DocumentField> employeeDataFieldMap = employeeField.getValueAsMap();\n DocumentField employeeName = employeeDataFieldMap.get(\"Name\");\n if (employeeName != null) {\n if (DocumentFieldType.STRING == employeeName.getType()) {\n String merchantAddress = employeeName.getValueAsString();\n System.out.printf(\"Employee Name: %s, confidence: %.2f%n\",\n merchantAddress, employeeName.getConfidence());\n }\n }\n DocumentField employeeAddrField = employeeDataFieldMap.get(\"Address\");\n if (employeeAddrField != null) {\n if (DocumentFieldType.STRING == employeeAddrField.getType()) {\n String employeeAddress = employeeAddrField.getValueAsString();\n System.out.printf(\"Employee Address: %s, confidence: %.2f%n\",\n employeeAddress, employeeAddrField.getConfidence());\n }\n }\n }\n }\n\n DocumentField employerField = taxFields.get(\"Employer\");\n if (employerField != null) {\n System.out.println(\"Employer Data: \");\n if (DocumentFieldType.MAP == employerField.getType()) {\n Map<String, DocumentField> employerDataFieldMap = employerField.getValueAsMap();\n DocumentField employerNameField = employerDataFieldMap.get(\"Name\");\n if (employerNameField != null) {\n if (DocumentFieldType.STRING == employerNameField.getType()) {\n String employerName = employerNameField.getValueAsString();\n System.out.printf(\"Employee Name: %s, confidence: %.2f%n\",\n employerName, employerNameField.getConfidence());\n }\n }\n\n DocumentField employerIDNumberField = employerDataFieldMap.get(\"IdNumber\");\n if (employerIDNumberField != null) {\n if (DocumentFieldType.STRING == employerIDNumberField.getType()) {\n String employerIdNumber = employerIDNumberField.getValueAsString();\n System.out.printf(\"Employee ID Number: %s, confidence: %.2f%n\",\n employerIdNumber, employerIDNumberField.getConfidence());\n }\n }\n }\n }\n\n DocumentField localTaxInfosField = taxFields.get(\"LocalTaxInfos\");\n if (localTaxInfosField != null) {\n System.out.println(\"Local Tax Info data:\");\n if (DocumentFieldType.LIST == localTaxInfosField.getType()) {\n Map<String, DocumentField> localTaxInfoDataFields = localTaxInfosField.getValueAsMap();\n DocumentField localWagesTips = localTaxInfoDataFields.get(\"LocalWagesTipsEtc\");\n if (DocumentFieldType.DOUBLE == localTaxInfosField.getType()) {\n System.out.printf(\"Local Wages Tips Value: %.2f, confidence: %.2f%n\",\n localWagesTips.getValueAsDouble(), localTaxInfosField.getConfidence());\n }\n }\n }\n\n DocumentField taxYearField = taxFields.get(\"TaxYear\");\n if (taxYearField != null) {\n if (DocumentFieldType.STRING == taxYearField.getType()) {\n String taxYear = taxYearField.getValueAsString();\n System.out.printf(\"Tax year: %s, confidence: %.2f%n\",\n taxYear, taxYearField.getConfidence());\n }\n }\n\n DocumentField taxDateField = taxFields.get(\"TaxDate\");\n if (employeeField != null) {\n if (DocumentFieldType.DATE == taxDateField.getType()) {\n LocalDate taxDate = taxDateField.getValueAsDate();\n System.out.printf(\"Tax Date: %s, confidence: %.2f%n\",\n taxDate, taxDateField.getConfidence());\n }\n }\n\n DocumentField socialSecurityTaxField = taxFields.get(\"SocialSecurityTaxWithheld\");\n if (localTaxInfosField != null) {\n if (DocumentFieldType.DOUBLE == socialSecurityTaxField.getType()) {\n Double socialSecurityTax = socialSecurityTaxField.getValueAsDouble();\n System.out.printf(\"Social Security Tax withheld: %.2f, confidence: %.2f%n\",\n socialSecurityTax, socialSecurityTaxField.getConfidence());\n }\n }\n }\n }", "public static void main(String[] args) {\n try {\n ModuleExtractionExamples.usingModuleExtractors();\n } catch (ExtractorException e) {\n e.printStackTrace();\n }\n //ModuleExtractionExamples.generatingSignatures();\n //ModuleExtractionExamples.writeSignaturesToFile();\n //etc...\n\n }", "public static void main(String[] args) throws Exception {\n \t\n \tbyte[] fileData = Files.readAllBytes(Paths.get(new File(System.getProperty(\"user.dir\")+\"/bin/main/re/bytecode/obfuscat/pass/vm/VMRefImpl.class\").toURI()));\n \tDSLParser p = new DSLParser();\n \tMap<String, Function> functions = p.processFile(fileData);\n \tFunction refF = MergedFunction.mergeFunctions(functions, \"process\"); // functions.get(\"process\");\n \t\n \t\n \t\n \tfileData = Files.readAllBytes(Paths.get(new File(System.getProperty(\"user.dir\")+\"/bin/test/re/bytecode/obfuscat/samples/Sample8.class\").toURI()));\n \tp = new DSLParser();\n functions = p.processFile(fileData);\n \n \tFunction f = MergedFunction.mergeFunctions(functions, \"entry\");\n \t\n\t\t//HashMap<String, Object> map = new HashMap<String, Object>();\n\t\t//Function f = Obfuscat.buildFunction(\"Test\", map);\n \t\n \t\n\t\t//HashMap<String, Object> map = new HashMap<String, Object>();\n\t\t//map.put(\"data\", new byte[] { 1, 2, 3, 4 });\n\t\t//Function f = Obfuscat.buildFunction(\"KeyBuilder\", map );\n\t\n \tf = Obfuscat.applyPass(f, \"Flatten\");\n\t\tf = Obfuscat.applyPass(f, \"OperationEncode\");\n\t\t\n\t\tint[] gen = new VMCodeGenerator(new Context(System.currentTimeMillis()), f).generate();\n\n\t\tbyte[] vmcode = new byte[gen.length];\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i < gen.length; i++) {\n\t\t\tsb.append(String.format(\"%02X\", gen[i] & 0xFF));\n\t\t\tvmcode[i] = (byte) gen[i];\n\t\t}\n\n\t\tSystem.out.println(sb.toString());\n\n\t\tSystem.out.println(\"=========================================\");\n\n\t\t\n\t\tSystem.out.println(f.getBlocks().get(0));\n\t\t\n\t\tEmulateFunction eFB = new EmulateFunction(f);\n\t\tbyte[] arr = new byte[] {0, 0, 0, 0};\n\t\tSystem.out.println(\"Emulate Original => \"+eFB.run(-1, arr));\n\t\tSystem.out.println(Arrays.toString(arr));\n\t\t\n\t\tarr = new byte[] {0, 0, 0, 0};\n\t\tSystem.out.println(\"Java Reference => \"+VMRefImpl.process(vmcode, f.getData() ,new Object[]{0, arr}));\n\t\tSystem.out.println(Arrays.toString(arr));\n\n\t\t\n\t\tEmulateFunction eFRef = new EmulateFunction(refF);\n\t\tarr = new byte[] {0, 0, 0, 0};\n\t\tSystem.out.println(\"Emulated Reference => \"+eFRef.run(-1, gen, f.getData(), new Object[] {0, arr}));\n\t\tSystem.out.println(Arrays.toString(arr));\n\t\t\n\t\tEmulateFunction eFPass = new EmulateFunction(Obfuscat.applyPass(f, \"Virtualize\"));\n\t\tarr = new byte[] {0, 0, 0, 0};\n\t\tSystem.out.println(\"Emulate Pass VM => \"+eFPass.run(-1, arr ));\n\t\tSystem.out.println(Arrays.toString(arr));\n\t\t\n\n }", "protected abstract RuleExplanationSet transformGenotypes(EvolutionResult<BitGene, Double> evolutionResult);", "public static void main(final String[] args)\r\n {\r\n // Set the path to the data files\r\n Dictionary.initialize(\"c:/Program Files/WordNet/2.1/dict\");\r\n \r\n // Get an instance of the Dictionary object\r\n Dictionary dict = Dictionary.getInstance();\r\n \r\n // Declare a filter for all terms starting with \"car\", ignoring case\r\n TermFilter filter = new WildcardFilter(\"car*\", true);\r\n \r\n // Get an iterator to the list of nouns\r\n Iterator<IndexTerm> iter = \r\n dict.getIndexTermIterator(PartOfSpeech.NOUN, 1, filter);\r\n \r\n // Go over the list items\r\n while (iter.hasNext())\r\n {\r\n // Get the next object\r\n IndexTerm term = iter.next();\r\n \r\n // Write out the object\r\n System.out.println(term.toString());\r\n \r\n // Write out the unique pointers for this term\r\n int nNumPtrs = term.getPointerCount();\r\n if (nNumPtrs > 0)\r\n {\r\n // Print out the number of pointers\r\n System.out.println(\"\\nThis term has \" + Integer.toString(nNumPtrs) +\r\n \" pointers\");\r\n \r\n // Print out all of the pointers\r\n String[] ptrs = term.getPointers();\r\n for (int i = 0; i < nNumPtrs; ++i)\r\n {\r\n String p = Pointer.getPointerDescription(term.getPartOfSpeech(), ptrs[i]);\r\n System.out.println(ptrs[i] + \": \" + p);\r\n }\r\n }\r\n \r\n // Get the definitions for this term\r\n int nNumSynsets = term.getSynsetCount();\r\n if (nNumSynsets > 0)\r\n {\r\n // Print out the number of synsets\r\n System.out.println(\"\\nThis term has \" + Integer.toString(nNumSynsets) +\r\n \" synsets\");\r\n \r\n // Print out all of the synsets\r\n Synset[] synsets = term.getSynsets();\r\n for (int i = 0; i < nNumSynsets; ++i)\r\n {\r\n System.out.println(synsets[i].toString());\r\n }\r\n }\r\n }\r\n \r\n System.out.println(\"Demo processing finished.\");\r\n }", "private List<SignalDetectionHypothesis> generateHypotheses(\n ChannelSegment<Waveform> channelSegment,\n List<SignalDetectionParameters> detectionParametersList,\n OnsetTimeUncertaintyParameters uncertaintyParameters,\n OnsetTimeRefinementParameters refinementParameters) {\n List<SignalDetectionHypothesis> hypotheses = new ArrayList<>();\n\n Map<SignalDetectionParameters, SignalDetectorPlugin> detectorPlugins = detectionParametersList\n .stream().collect(toMap(Function.identity(),\n parameters -> getPlugin(parameters.getPluginName(), SignalDetectorPlugin.class,\n signalDetectorPluginRegistry)));\n\n OnsetTimeUncertaintyPlugin uncertaintyPlugin = getPlugin(uncertaintyParameters.getPluginName(),\n OnsetTimeUncertaintyPlugin.class,\n onsetTimeUncertaintyPluginRegistry);\n\n OnsetTimeRefinementPlugin refinementPlugin = getPlugin(refinementParameters.getPluginName(),\n OnsetTimeRefinementPlugin.class,\n onsetTimeRefinementPluginRegistry);\n\n logger.info(\"SignalDetectionControl invoking {} plugins for Channel {}\",\n detectionParametersList.stream().map(SignalDetectionParameters::getPluginName)\n .collect(toList()), channelSegment.getChannelId());\n\n Collection<Instant> detectionTimes = detectorPlugins.entrySet()\n .stream()\n .map(entry -> entry.getValue()\n .detectSignals(channelSegment, entry.getKey().getPluginParameters()))\n .flatMap(Collection::stream).collect(toList());\n\n if (detectionTimes.isEmpty()) {\n return Collections.emptyList();\n } else {\n for (Instant detectionTime : detectionTimes) {\n Duration uncertainty = executeUncertaintyPlugin(channelSegment, uncertaintyPlugin,\n detectionTime, uncertaintyParameters.getPluginParameters());\n final FeatureMeasurement<InstantValue> arrivalTimeMeasurement = createArrivalMeasurement(\n detectionTime, uncertainty, channelSegment.getId());\n final FeatureMeasurement<PhaseTypeMeasurementValue> phaseMeasurement =\n createPhaseMeasurement(\n channelSegment.getId());\n UUID parentSdId = UUID.randomUUID();\n\n //TODO: Replace the zeroed UUID with a proper CreationInfo ID when CreationInfo is finalized\n SignalDetectionHypothesis initialHypothesis = SignalDetectionHypothesis.create(\n parentSdId, arrivalTimeMeasurement, phaseMeasurement,\n new UUID(0, 0));\n\n hypotheses.add(initialHypothesis);\n\n refineHypothesis(initialHypothesis, channelSegment, refinementPlugin,\n refinementParameters.getPluginParameters(), uncertaintyPlugin,\n uncertaintyParameters.getPluginParameters())\n .ifPresent(hypothesis -> hypotheses.add(hypothesis));\n }\n }\n return hypotheses;\n }", "public ArrayList<Genome_ga> makeGenomeList(int length){\n\t\tArrayList<Genome_ga> genomelist = new ArrayList<Genome_ga>();\r\n\t\tfor(int i =0; i<length;i++) {\r\n\t\t\tgenomelist.add(make1Genome());\r\n\t\t}\r\n\r\n\t\tgenomelist = evg.evalGenomeList(genomelist);\r\n\r\n\t\treturn genomelist;\r\n\t}", "private void operate(){//DONT EDIT\n\t\tholo=getHologramProcessor();\n\t\tref=getReferenceProcessor();\n dx=getDouble(dxTF);\n dy=getDouble(dyTF);\n Tolerance=getDouble(toleranceTF);\n wavelength=getDouble(wavelengthTF);\n distance=getDouble(distanceTF);\n Sigma=getInteger(sigmaTF);\n Iterations=getInteger(iterationsTF);\n \n if (holo == null) \n throw new ArrayStoreException(\"reconstruct: No hologram selected.\");\n else \n\t\t{\n\n\t\t\t//rec = HoloJUtils.reconstruct(holo.getWidth(),1,sideCenter,holo,butterworth);\n rec = HoloJUtils.reconstruct(holo,ref,distance,wavelength,Iterations,Tolerance,Sigma);\n// if (ref != null)\n//\t\t\t{\n//\t\t\t Point p = new Point();\n//\t\t\t p.x = holo.getWidth()/2;\n// p.y = holo.getHeight()/2;\n//\t\t\t\trec = HoloJUtils.reconstruct(radius,ratio,p,ref,holo,butterworth);\n// }\n//\t\t\trec.setCalibration(imageCal);\n rec.setTitle(\"\"+title);\n\t\t\trec.showHolo(\"Hologram : \"+rec.getTitle()+\" :\");\n\t\t\trec.showAmplitude(\"Amplitude\");\n\t\t}\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String choice_s = \"\";\n int choice = 0;\n do{\n DisplayMenu(); \n choice_s = sc.next();\n \n //test input\n if(IsNumber(choice_s)){\n choice = Convert(choice_s);\n } else { \n do{\n System.out.println(\"Please enter a number only.\");\n choice_s = sc.next();\n } while (!IsNumber(choice_s));\n choice = Convert(choice_s);\n } \n \n if(choice == 1){ \n method = 1;\n System.out.println();\n System.out.println(\"*** UNGROUPED DATA ***\");\n \n ArrayList a = new ArrayList<>();\n //a = GetData();\n double[] arr = {70, 36, 43, 69,82,48,34,62,35,15,\n 59,139,46,37,42,30,55,56,36,82,\n 38,89,54,25,35,24,22,9,55,19};\n \n //ArrayList a = new ArrayList<>();\n for (int i = 0; i < arr.length; i++ ){\n a.add(arr[i]);\n }\n \n //System.out.println(getMean(a));\n //System.out.println(getMedian(a));\n getMean(a);\n getMedian(a);\n System.out.println(\"Mode = \"+ getMode(a));\n \n \n \n \n } else if (choice == 2){\n System.out.println(\"*** GROUPED DATA ***\");\n method = 2;\n N = 0;\n n = 0;\n ArrayList<ArrayList> al;\n ArrayList list = new ArrayList<>(); \n ArrayList upper = new ArrayList<>(); \n ArrayList lower = new ArrayList<>(); \n ArrayList freq = new ArrayList<>(); \n\n String testN = \"\";\n int population = 0;\n do{\n System.out.println();\n System.out.println(\"Enter total number of class intervals: \");\n\n testN = sc.next(); \n\n if(IsNumber(testN)){\n population = Convert(testN);\n } else { \n do{\n System.out.println(\"Please enter a number only.\");\n testN = sc.next();\n } while (!IsNumber(testN));\n\n population = Convert(testN);\n } \n N = population;\n }while(N <= 1);\n\n\n\n\n int type2 = 0, testT2 = 0;\n String typeTest2 = \"\"; \n do{ \n System.out.println();\n System.out.println(\"** Are there open ended intervals? **\"); \n System.out.println(\"[1] Yes \");\n System.out.println(\"[2] No \");\n System.out.println();\n System.out.println(\"Please pick a number from the choices above.\"); \n typeTest2 = sc.next(); \n if(IsNumber(typeTest2)){\n testT2 = Convert(typeTest2);\n } else { \n do{\n System.out.println(\"Please enter a number only.\");\n typeTest2 = sc.next();\n } while (!IsNumber(typeTest2));\n\n testT2 = Convert(typeTest2);\n } \n type2 = testT2;\n }while(type2 < 1 || type2 > 2);\n\n if(type2 == 1){\n\n } else {\n\n }\n\n int type = 0, testT = 0;\n String typeTest = \"\";\n\n do{ \n System.out.println();\n System.out.println(\"** INPUT OPTIONS **\"); \n System.out.println(\"[1] Integer \");\n System.out.println(\"[2] Float \");\n System.out.println();\n System.out.println(\"Please pick a number from the choices above.\");\n\n typeTest = sc.next();\n\n if(IsNumber(typeTest)){\n testT = Convert(typeTest);\n } else { \n do{\n System.out.println(\"Please enter a number only.\");\n typeTest = sc.next();\n } while (!IsNumber(typeTest));\n\n testT = Convert(typeTest);\n } \n type = testT;\n }while(type < 1 || type > 2);\n\n\n if(type == 1){\n System.out.println();\n System.out.println(\"ENTER class limits and frequecies: \");\n sc.nextLine();\n System.out.println(\"Integers only\");\n\n for(int i = 1; i <= N; i++){\n String test1 = \"\"; \n boolean flag1 = true;\n while(flag1 == true){ \n System.out.print(\"[\"+i+\"]\" +\" \"); \n Object member = sc.next();\n test1 = member.toString();\n int in;\n\n try {\n member = sc.nextLine(); \n in = Integer.valueOf(test1);\n if (in < 0) {\n System.out.println(\"oops, no negatives\");\n } else {\n //System.out.println(\"Input accepted \");\n flag1 = false;\n }\n } catch(NumberFormatException e) {\n System.out.println(\"Please enter an integer only\");\n }\n\n if(flag1 == false){ \n upper.add(test1);\n }\n } \n String test2 = \"\"; \n boolean flag2 = true;\n while(flag2 == true){ \n System.out.print(\"[\"+i+\"]\" +\" \"); \n Object member2 = sc.next();\n test2 = member2.toString(); \n int in2; \n try {\n member2 = sc.nextLine(); \n in2 = Integer.valueOf(test2);\n if (in2 < 0) {\n System.out.println(\"oops, no negatives\");\n } else {\n //System.out.println(\"Input accepted \");\n flag2 = false;\n }\n } catch(NumberFormatException e) {\n System.out.println(\"Please enter an integer only\"); \n } \n if(flag2 == false){ \n lower.add(test2);\n }\n } \n String test3 = \"\"; \n boolean flag3 = true;\n while(flag3 == true){ \n System.out.print(\"[\"+i+\"]\" +\" \"); \n Object member3 = sc.next();\n test3 = member3.toString();\n\n int in3;\n\n try {\n member3 = sc.nextLine(); \n\n in3 = Integer.valueOf(test3);\n if (in3 < 0) {\n System.out.println(\"oops, no negatives\");\n } else {\n //System.out.println(\"Input accepted \");\n flag3 = false;\n }\n } catch(NumberFormatException e) {\n System.out.println(\"Please enter an integer only\");\n\n }\n\n if(flag3 == false){ \n freq.add(test3);\n }\n } \n }\n } else {\n System.out.println();\n \n sc.nextLine();\n System.out.println(\"Floats only\");\n for(int i = 1; i <= N; i++){\n Double test = 0.0;\n System.out.print(\"[\"+i+\"]\" +\" \");\n while (!sc.hasNextFloat()) { \n System.out.println(\"Invalid input. Try again\");\n sc.next();\n } \n test = sc.nextDouble(); \n upper.add(test); \n Double test2 = 0.0;\n System.out.print(\"[\"+i+\"]\" +\" \");\n while (!sc.hasNextFloat()) { \n System.out.println(\"Invalid input. Try again\");\n sc.next();\n } \n test2 = sc.nextDouble(); \n lower.add(test2);\n Double test3 = 0.0;\n System.out.print(\"[\"+i+\"]\" +\" \");\n while (!sc.hasNextFloat()) { \n System.out.println(\"Invalid input. Try again\");\n sc.next();\n } \n test3 = sc.nextDouble(); \n freq.add(test3);\n\n }\n\n\n }\n\n \n System.out.println();\n System.out.println(upper);\n System.out.println(lower);\n System.out.println(freq);\n System.out.println();\n \n ArrayList <Double> up = new ArrayList<>();\n ArrayList <Double> low = new ArrayList<>();\n ArrayList <Double> f = new ArrayList<>();\n ArrayList <Double> classmarks = new ArrayList<>();\n ArrayList <Double> fx = new ArrayList<>();\n ArrayList <Double> fx2 = new ArrayList<>();\n \n for(int i = 0; i < N; i++){\n up.add(Double.parseDouble(upper.get(i).toString()));\n low.add(Double.parseDouble(lower.get(i).toString()));\n f.add(Double.parseDouble(freq.get(i).toString()));\n \n }\n\n \n double cm = (up.get(0) + low.get(0)) / 2;\n classmarks.add(cm);\n for(int i = 1; i <N; i++){\n classmarks.add((up.get(i)+low.get(i))/2);\n } \n \n double fxs = (f.get(0) * classmarks.get(0));\n fx.add(fxs);\n for(int i = 1; i <N; i++){\n fx.add((f.get(i) * classmarks.get(i)));\n } \n \n double fxs2 = (fx.get(0) * classmarks.get(0));\n fx2.add(fxs2);\n for(int i = 1; i <N; i++){\n fx2.add((fx.get(i) * classmarks.get(i)));\n } \n \n System.out.println(up);\n System.out.println(low);\n System.out.println(f);\n System.out.println(classmarks);\n System.out.println(fx);\n System.out.println(fx2);\n \n \n double totalf = 0.0, totalfx = 0.0, totalfx2= 0.0;\n \n for(int i = 0; i < N; i++){\n totalf += f.get(i);\n totalfx += fx.get(i);\n totalfx2 += fx2.get(i);\n }\n \n System.out.println(totalf);\n System.out.println(totalfx);\n System.out.println(totalfx2);\n \n \n double mean = totalfx/totalf; \n System.out.println(mean);\n \n System.out.println(\"Median not included\");\n \n JFrame frame = new JFrame();\n //frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); \n JTable table = new JTable(); \n table.setModel(new DefaultTableModel((int) (N + 2), 6));\n\n table.setValueAt(\"UPPER CLASS LIMIT\", 0, 0);\n table.setValueAt(\"LOWER CLASS LIMIT\", 0, 1);\n table.setValueAt(\"FREQUENCY\", 0, 2);\n table.setValueAt(\"CLASS MARKS (x)\", 0, 3);\n table.setValueAt(\"fx\", 0, 4);\n table.setValueAt(\"fx^2\", 0, 5);\n \n table.setValueAt(\"TOTAL = \" + totalf, (int) (N + 1), 2);\n table.setValueAt(\"TOTAL = \" + totalfx, (int) (N + 1), 4);\n table.setValueAt(\"TOTAL = \" + totalfx2, (int) (N + 1), 5);\n \n for(int i = 0; i < N; i++){\n table.setValueAt(up.get(i),i+1,0);\n table.setValueAt(low.get(i),i+1,1);\n table.setValueAt(f.get(i),i+1,2);\n table.setValueAt(classmarks.get(i),i+1,3);\n table.setValueAt(fx.get(i),i+1,4);\n table.setValueAt(fx2.get(i),i+1,5);\n //table.setValueAt(new DecimalFormat(\"#.##\").format(cps.get(i)),i+1,6);\n }\n\n JScrollPane scrollPane = new JScrollPane(table);\n scrollPane.setBorder(BorderFactory.createTitledBorder (\"Descriptive Statistics\"));\n frame.add(scrollPane, BorderLayout.CENTER);\n frame.setSize(300, 150);\n frame.setVisible(true);\n \n \n ArrayList <Integer> mox = new ArrayList<>();\n\n double max_value = -1;\n int max_index = -1;\n for(int i = 0 ; i < N ; i++ ){\n if(max_value <= f.get(i)){\n //System.out.println(\"Compare\" +f.get(i));\n max_value = f.get(i);\n max_index = i;\n //System.out.println(\"max_index\"+max_index);\n //System.out.println(\"max_value\"+max_value);\n }\n // mox.add(max_index);\n\n }\n // System.out.println(mox);\n //if(mox.size() != 0){\n \n // for(int i = 0; i < mox.size(); i++)\n double mode = max_value;\n System.out.println(\"Mode = \"+mode);\n int ctr = 0;\n System.out.println(\"Modal class/es\");\n for(int i = 0; i < N; i++){\n if(f.get(i) == mode){\n System.out.println(up.get(i)+\"-\"+low.get(i));\n ctr++;\n }\n }\n if (ctr == 1){\n System.out.println(\"unimodal\");\n } else if (ctr == 2){\n System.out.println(\"bimodal\");\n } else if (ctr == 3){\n System.out.println(\"multimodal\");\n } else {\n System.out.println(\"no mode\");\n }\n \n \n// } else {\n// System.out.println(\"no modal class\");\n// } \n \n \n /*\n ArrayList <ArrayList> grouped = Stratified(f);\n Collections.sort(f);\n System.out.println(grouped);\n \n System.out.println(\"Mode\");\n \n int max = (int) grouped.get(0).get(0);\n System.out.println(max);\n /*\n for(int i = 0; i < grouped.size(); i++){\n if(grouped.get(i+1).size() >= max){\n max = grouped.get(i+1).size();\n }\n \n }\n */\n \n \n } else if (choice > 3 || choice < 3){\n System.out.println(\"INVALID INPUT\");\n }\n \n }while(choice != 3);\n \n System.out.println(\"Thank you for your time.\"); \n System.exit(0); \n }", "public static void main(String[] args) {\n\t\tString sampleFolderPath = \"E:\\\\-1\";\n\t\tFile dir = new File(sampleFolderPath);\n\t\tFile[] files = dir.listFiles();\n\t\tif (files != null) {\n\t\t\tfor (int i = 0; i < files.length; i++) {\n\t\t\t\tString samplePath = files[i].getAbsolutePath();\n\t\t\t\tSystem.out.println(\"processing: \" + samplePath);\n\t\t\t\ttry {\n\t\t\t\t\t// 2. parse each sample\n\t\t\t\t\tparsingError = false;\n\t\t\t\t\tJavaScriptLexer lexer = new JavaScriptLexer(new ANTLRFileStream(samplePath));\n\t\t\t\t\tCountErrorListener errorListener = new CountErrorListener();\n\t\t\t\t\tlexer.removeErrorListeners();\n\t\t\t\t\tlexer.addErrorListener(errorListener);\n\t\t\t\t\tCommonTokenStream tokens = new CommonTokenStream(lexer);\n\t\t\t\t\tJavaScriptParser parser = new JavaScriptParser(tokens);\n\t\t\t\t\tparser.removeErrorListeners();\n\t\t\t\t\tparser.addErrorListener(errorListener);\n\t\t\t\t\tParseTree tree = parser.program();\n\t\t\t\t\tif (parsingError) {\n\t\t\t\t\t\tSystem.out.println(\"--------------\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// System.out.println(\"---\" + tree.toStringTree());\n\t\t\t\t\t// 3. traverse the sample and count parent\n\t\t\t\t\tJavaScriptParserBaseVisitor visitor = new JavaScriptParserBaseVisitor();\n\t\t\t\t\tvisitor.visit(tree);\n\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"--------------\");\n\t\t\t}\n\t\t}\n\t\tfor (final String k : parentCount.keySet()) {\n\t\t\tSystem.out.println(k + \": \" + parentCount.get(k));\n\t\t}\n\t\tSystem.out.println(\"=====================================\");\n\t\tSystem.out.println(\"PCSG:\");\n\t\tSystem.out.println(\"=====================================\");\n\n\t\t// for (final String k : ruleCount.keySet()) {\n\t\t// System.out.println(k + \": \"+ (float) ruleCount.get(k) /\n\t\t// parentCount.get(k.substring(k.indexOf(\">\") + 1, k.indexOf(\"->\"))));\n\t\t// }\n\t\tinstorePCSG();\n\t}", "public static void main(String[] args) throws IOException {\n PopulationModelDefinition def = new PopulationModelDefinition(\n new EvaluationEnvironment(),\n ChordModel::generatePopulationRegistry,\n ChordModel::getRules,\n ChordModel::getMeasures,\n (e, r) -> new HashMap<>(),\n ChordModel::states);\n def.setParameter(\"N\",new SibillaDouble(1000));\n PopulationModel model = def.createModel();\n\n List<Trajectory> trajectories = new LinkedList();\n byte[] trajectoryBytes = BytearrayToFile.fromFile(\".\", \"chordTrajectory_Samplings100_Deadline600_N1000_Samples6\");\n\n Trajectory toAdd = TrajectorySerializer.deserialize(trajectoryBytes, model);\n Sample firstSample =(Sample) toAdd.getData().get(0);\n PopulationState firstState = (PopulationState) firstSample.getValue();\n System.out.printf(\"Population model registry size: %d\", model.stateByteArraySize() / 4);\n System.out.printf(\"\\nChord with externalizable\\nSamples: %d\\nState population vector size: %d\", toAdd.getData().size(), firstState.getPopulationVector().length);\n trajectories.add(toAdd);\n\n ComputationResult result = new ComputationResult(trajectories);\n\n byte[] customBytes = ComputationResultSerializer.serialize(result, model);\n byte[] customBytesCompressed = Compressor.compress(customBytes);\n byte[] apacheBytes = Serializer.getSerializer(SerializerType.APACHE).serialize(result);\n byte[] apacheBytesCompressed = Compressor.compress(apacheBytes);\n byte[] fstBytes = Serializer.getSerializer(SerializerType.FST).serialize(result);\n byte[] fstBytesCompressed = Compressor.compress(fstBytes);\n\n System.out.printf(\"\\nCustom bytes: %d\\nApache bytes: %d\\nFst bytes: %d\", customBytes.length, apacheBytes.length, fstBytes.length);\n System.out.printf(\"\\nCustom bytes compressed: %d\\nApache bytes compressed: %d\\nFst bytes compressed: %d\", customBytesCompressed.length, apacheBytesCompressed.length, fstBytesCompressed.length);\n }", "static public void main(String[] args) throws IOException{\n\t\tString sample = \"h19x24\";\n\t\tString parentFolder = \"/media/kyowon/Data1/Dropbox/fCLIP/new24/\";\t\t\n\t\tString bedFileName = \"/media/kyowon/Data1/fCLIP/samples/sample3/bed/\" + sample + \".sorted.bed\";\n\t\tString dbFasta = \"/media/kyowon/Data1/RPF_Project/genomes/hg19.fa\";\n\t\tString parameterFileName = \"/media/kyowon/Data1/fCLIP/samples/sample3/bed/\" + sample + \".sorted.param\";\n\t\t\n\t\tString trainOutFileName = parentFolder + sample + \".train.csv\";\n\t\tString arffTrainOutFileName = parentFolder + sample + \".train.arff\";\n\t\t\n\t\tString cisOutFileName = parentFolder + sample + \".csv\";\n\t\tString transOutFileNameM = parentFolder + sample + \".pair.M.csv\";\n\t\tString transOutFileNameU = parentFolder + sample + \".pair.U.csv\";\n\t\tString transControlOutFileNameM = parentFolder + sample + \".pair.M.AntiSense.csv\";\n\t\tString transControlOutFileNameU = parentFolder + sample + \".pair.U.AntiSense.csv\";\n\t\tString rmskBed = \"/media/kyowon/Data1/fCLIP/Data/cat.rmsk.bed\";\n\t\tString siControlBed = \"/media/kyowon/Data1/fCLIP/RNAseq/siControl_R1_Aligned_Sorted.bed\";\n\t\tString siKDDroshaBed = \"/media/kyowon/Data1/fCLIP/RNAseq/siDrosha_R1_Aligned_Sorted.bed\";\n\t\tString siKDDicerBed = \"/media/kyowon/Data1/fCLIP/RNAseq/siDicer_R1_Aligned_Sorted.bed\";\n\t\t\n\t\tString cisBed5pFileName = cisOutFileName + \".5p.bed\";\n\t\tString cisBed3pFileName = cisOutFileName + \".3p.bed\";\n\t\t\n\t\tdouble unpairedScoreThreshold = 0.25; \n\t\tdouble pairedScoreThreshold = unpairedScoreThreshold/5;\n\t//\tdouble motifScoreThreshold = 0.15;\n\t\t\n\t\tint num3pPaired = 10;\n\t\tint num5pPaired = 20;\n\t\t\n\t\tString filteredTransOutFileName = transOutFileNameM + \".filtered.csv\";\n\t\t\n\t\tint blatHitThreshold = 100000000;\n\t\tint transPairSeqLength = FCLIP_Scorer.getFlankingNTNumber() *2 + 80;\n\t\t\n\t\tZeroBasedFastaParser fastaParser = new ZeroBasedFastaParser(dbFasta);\n\t\tMirGff3FileParser mirParser = new MirGff3FileParser(\"/media/kyowon/Data1/fCLIP/genomes/hsa_hg19.gff3\");\n\t\tAnnotationFileParser annotationParser = new AnnotationFileParser(\"/media/kyowon/Data1/fCLIP/genomes/hg19.refFlat.txt\");\n\t\tFCLIP_ScorerTrainer.train(parameterFileName, bedFileName, mirParser, annotationParser);\n\t\t\n\t\ttrain(trainOutFileName, arffTrainOutFileName, bedFileName, fastaParser, annotationParser, mirParser, parameterFileName, unpairedScoreThreshold, pairedScoreThreshold);\n\t\trunCis(cisOutFileName, arffTrainOutFileName, bedFileName, fastaParser, annotationParser, mirParser, parameterFileName, unpairedScoreThreshold, pairedScoreThreshold);\n\n\t\tScoredPositionOutputParser.generateBedFromCsv(cisOutFileName, cisBed5pFileName, cisBed3pFileName, false); // for fold change..\n\t//\tScoredPositionOutputParser.generateFastaForMotif(cisOutFileName, cisOutFileName + \".5p.motif.fa\", cisOutFileName + \".3p.motif.fa\",cisOutFileName + \".motif.m\", \"M\");\n\t\t\n\t\trunTrans(transOutFileNameM, transOutFileNameU, cisOutFileName, arffTrainOutFileName, blatHitThreshold, transPairSeqLength, false);\n\t\tCheckRepeat.generate(cisOutFileName, transOutFileNameM, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tCheckRepeat.generate(cisOutFileName, transOutFileNameU, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tScoredPairOutputParser.generateFastaForMotif(transOutFileNameM, transOutFileNameM + \".5p.motif.fa\", transOutFileNameM + \".3p.motif.fa\");\n\t\t//GenerateCircosLinkFiles.run(transOutFileNameM + \".rmsk.csv\", transOutFileNameM + \".link.txt\");\n\t//\tCheckCoverage.generate(cisOutFileName, transOutFileNameM, cisBed5pFileName, cisBed3pFileName, siKDDroshaBed, siControlBed);\n\t///\tCheckCoverage.generate(cisOutFileName, transOutFileNameM, cisBed5pFileName, cisBed3pFileName, siKDDicerBed, siControlBed);\n\t\t\n\t\trunTrans(transControlOutFileNameM, transControlOutFileNameU, cisOutFileName, arffTrainOutFileName, blatHitThreshold, transPairSeqLength, true);\t\t\n\t\tCheckRepeat.generate(cisOutFileName, transControlOutFileNameM, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tCheckRepeat.generate(cisOutFileName, transControlOutFileNameU, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tScoredPairOutputParser.generateFastaForMotif(transControlOutFileNameM, transControlOutFileNameM + \".5p.motif.fa\", transControlOutFileNameM + \".3p.motif.fa\");\n\t//\tGenerateCircosLinkFiles.run(transControlOutFileNameM + \".rmsk.csv\", transControlOutFileNameM + \".link.txt\");\n\t\t//CheckCoverage.generate(cisOutFileName, transControlOutFileNameM, cisBed5pFileName, cisBed3pFileName, siKDDroshaBed, siControlBed);\n\t//\tCheckCoverage.generate(cisOutFileName, transControlOutFileNameM, cisBed5pFileName, cisBed3pFileName, siKDDicerBed, siControlBed);\n\t\t\n\t\tfilterTransPairs(transOutFileNameM, filteredTransOutFileName, num3pPaired, num5pPaired);\n\t\tCheckRepeat.generate(cisOutFileName, filteredTransOutFileName, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tScoredPairOutputParser.generateFastaForMotif(filteredTransOutFileName, filteredTransOutFileName + \".5p.motif.fa\", filteredTransOutFileName + \".3p.motif.fa\");\n\t\t//GenerateCircosLinkFiles.run(filteredTransOutFileName + \".rmsk.csv\", filteredTransOutFileName + \".link.txt\");\n\t///\tCheckCoverage.generate(cisOutFileName, filteredTransOutFileName, cisBed5pFileName, cisBed3pFileName, siKDDroshaBed, siControlBed);\n\t//\tCheckCoverage.generate(cisOutFileName, filteredTransOutFileName, cisBed5pFileName, cisBed3pFileName, siKDDicerBed, siControlBed);\n\t\t\n\t\t\n\t\t// generate background for drosha and dicer..\n\t\t\n\t\t\n\t\t// motif different conditioin?? \n\t\t\n\t\t\t\t\n\t\t//GenerateDepthsForEncodeDataSets.generate(outFileName, outFileName + \".encode.csv\", annotationParser);\n\t\t\n\t\t\n\t}", "private int[] checkBuild( int sigrun, int step ) throws GEException, IOException\n {\n\t//Check if application is for building haplotypes.\n\tint[] params = new int[2];\n if ( app_id.equals(\"hapConstructor\") )\n {\n\t //step++;\n Specification spec = io_mgr.getSpecification();\n //Global parameters are needed to build new loci sets from significant analyses.\n Map mParams = spec.getAllGlobalParameters();\n GDef gd = spec.getGDef();\n //The first time around create a new hapBuilder if building observation data.\n //If it is evaluating rather than building, then create a new instance of the \n //hapBuilder.\n if ( step == 1)\n {\n hc = new hapConstructor(app_id, spec, theAnalyses, io_mgr.getoutpathStem(), screentesting);\n if(!spec.gethapC_sigtesting_only() || sigrun != -1)\n {\n hc.updateResults(sigrun, nCycles, theAnalyses, mParams,gd, step, io_mgr.getinDate(),this, study_Gtypes,1);\n }\n }\n else\n {\n hc.refresh_hapstorage(); \n }\n //Stores results from previous analyses in analysisResults object.\n \n if(screening != 0)\n {\n step++;\n hc.updateStep(step);\n }\n \n //Create a boolean to track whether a new analysis needs to be performed with a new set of loci.\n boolean flg = false;\n //Check if there are new loci sets to test from either back sets or new \n //sets created from significant loci.\n if ( screentesting && screening != 0 && hc.beginBuild() )\n {\n \tscreenpass = false;\n \tscreening = hc.screentest;\n //Controller setups up the new analyses and updates them in the specification \n //object.\n hc.controller(io_mgr, this, hc.getNewLoci(), study_Gtypes, sigrun, \"forward\");\n flg = true;\n //params[0] = -2;\n //params[1] = 0;\n //flg = false;\n }\n else if ( screening == 0 && hc.checkscreentest() )\n {\n screenpass = true;\n screening = hc.screentest;\n hc.controller(io_mgr, this, hc.getScreenedSets(), study_Gtypes, sigrun, \"forward\");\n flg = true;\n }\n else if( !screentesting && (!spec.gethapC_sigtesting_only() || sigrun != -1) && hc.beginBuild() )\n {\n hc.controller(io_mgr, this, hc.getNewLoci(), study_Gtypes, sigrun, \"forward\");\n flg = true;\n }\n //Check if there are backsets to test.\n else if ( hc.backSetExists() && spec.gethapC_backsets() )\n {\n //Reset the step to the backset level.\n step = hc.backSetLevel();\n System.out.println(\"Evaluating backsets\");\n Set bsets = hc.getBackSet(step);\n bsets = hc.saveSets(bsets);\n if ( bsets.size() == 0 )\n {\n //Set params\n //This situation shouldn't happen, the hb.backSetExists should return false\n //in this section.\n //The problem is the backset step member variable is screwed up.\n flg = false;\n }\n else\n {\n hc.controller(io_mgr, this, bsets, study_Gtypes, sigrun, \"backward\");\n flg = true;\n }\n }\n //Check if the building for observation data is done and now \n //time to start evaluation.\n else if ( sigrun < 0 && spec.gethapC_sigtesting() )\n {\n \tif(spec.gethapC_sigtesting_only())\n \t{\n sigrun = spec.gethapC_sigtesting_start();\n \t}\n \telse\n \t{\n \t sigrun = 0;\n \t}\n System.out.println(\"Starting evaluation\");\n //Change process status from build to eval\n hc.updateProcess();\n //Iterate through each simulated data set and use it\n //as if it were the observation data.\n //Thread this...\n spec.updateAnalyses(hc.getOriginalAnalysis());\n theAnalyses = spec.getCCAnalyses();\n //The reason you can't multithread is because every object in ca is the same\n //when you pass it to the two threads. So when one thread manipulates the object\n //the other object is affected.If you could truly create a new copy of ca and pass it\n //to the second thread then it would work.\n step = 1;\n screening = -1;\n System.out.println(\"Evaluation no. \" + sigrun);\n params[0] = sigrun;\n params[1] = 1;\n }\n\t //Done with analysis and not sig testing\n else if ( sigrun == -1 ) \n {\n params[0] = -2;\n params[1] = 0;\n }\n //Sigtesting and completed all analyses for sigtest, go to next sim set.\n //The sigCycles are limited to 1000 because for the FDR this should\n //be plenty of simulated sets.\n else if ( sigrun < sigCycles - 1 )\n {\n spec.updateAnalyses(hc.getOriginalAnalysis());\n theAnalyses = spec.getCCAnalyses();\n params[0] = sigrun+1;\n screening = -1;\n System.out.println(\"Continuing significance runs\");\n params[1] = 1;\n }\n else if ( sigrun == sigrun -1 )\n {\n Evalsigs es = new Evalsigs();\n \tes.readfile(\"all_obs.final\");\n \tes.readfile(\"all_sims.final\");\n \tes.all_efdr();\n }\n //Done with everything, stop\n else\n {\n params[0] = -2;\n params[1] = 0;\n }\n //If flg is true then continue with analysis process.\n if ( flg )\n {\n theAnalyses = spec.getCCAnalyses();\n if ( theAnalyses.length > 0 )\n {\n System.out.println(\"Getting subjects...\");\n for ( int i = 0; i < theAnalyses.length; ++i )\n {\n theAnalyses[i].setStudySubjects(spec.getStudy());\n }\n }\n params[0] = sigrun;\n //System.out.println(\"Starting \" + sigrun + \" with step: \" + step);\n params[1] = step;\n }\n }\n //Not hapConstructing\n else\n {\n params[0] = -2;\n params[1] = 0;\n }\n return params;\n }", "public void processArgs(String[] args){\n\t\tPattern pat = Pattern.compile(\"-[a-z]\");\n\t\tString useqVersion = IO.fetchUSeqVersion();\n\t\tSystem.out.println(\"\\n\"+useqVersion+\" Arguments: \"+ Misc.stringArrayToString(args, \" \") +\"\\n\");\n\t\tfor (int i = 0; i<args.length; i++){\n\t\t\tString lcArg = args[i].toLowerCase();\n\t\t\tMatcher mat = pat.matcher(lcArg);\n\t\t\tif (mat.matches()){\n\t\t\t\tchar test = args[i].charAt(1);\n\t\t\t\ttry{\n\t\t\t\t\tswitch (test){\n\t\t\t\t\tcase 'r': bedFile = new File(args[++i]); break;\n\t\t\t\t\tcase 's': saveDirectory = new File(args[++i]); break;\n\t\t\t\t\tcase 'c': haploArgs = args[++i]; break;\n\t\t\t\t\tcase 't': numberConcurrentThreads = Integer.parseInt(args[++i]); break;\n\t\t\t\t\tdefault: Misc.printErrAndExit(\"\\nProblem, unknown option! \" + mat.group());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception e){\n\t\t\t\t\tMisc.printErrAndExit(\"\\nSorry, something doesn't look right with this parameter: -\"+test+\"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//check save dir\n\t\tif (saveDirectory == null) Misc.printErrAndExit(\"\\nError: cannot find your save directory!\\n\"+saveDirectory);\n\t\tsaveDirectory.mkdirs();\n\t\tif (saveDirectory.isDirectory() == false) Misc.printErrAndExit(\"\\nError: your save directory does not appear to be a directory?\\n\");\n\n\t\t//check bed\n\t\tif (bedFile == null || bedFile.canRead() == false) Misc.printErrAndExit(\"\\nError: cannot find your bed file of regions to interrogate?\\n\"+bedFile);\n\t\t\n\t\t//check args\n\t\tif (haploArgs == null) Misc.printErrAndExit(\"\\nError: please provide a gatk haplotype caller launch cmd similar to the following where you \"\n\t\t\t\t+ \"replace the $xxx with the correct path to these resources on your system:\\n'java -Xmx4G -jar $GenomeAnalysisTK.jar -T \"\n\t\t\t\t+ \"HaplotypeCaller -stand_call_conf 5 -stand_emit_conf 5 --min_mapping_quality_score 13 -R $fasta --dbsnp $dbsnp -I $bam'\\n\");\n\t\tif (haploArgs.contains(\"~\") || haploArgs.contains(\"./\")) Misc.printErrAndExit(\"\\nError: full paths in the GATK command.\\n\"+haploArgs);\n\t\tif (haploArgs.contains(\"-o\") || haploArgs.contains(\"-L\")) Misc.printErrAndExit(\"\\nError: please don't provide a -o or -L argument to the cmd.\\n\"+haploArgs);\t\n\t\n\t\t//determine number of threads\n\t\tdouble gigaBytesAvailable = ((double)Runtime.getRuntime().maxMemory())/ 1073741824.0;\n\t\t\n\t\n\t}", "public static void main(String[] args) {\n\n\t\tString urlClassification = \"http://www.hep.ucl.ac.uk/undergrad/0056/exam-data/2018-19/classification.txt\";\n\t\tString urlExpert = \"http://www.hep.ucl.ac.uk/undergrad/0056/exam-data/2018-19/expert.txt\";\n\t\tString urlLocations = \"http://www.hep.ucl.ac.uk/undergrad/0056/exam-data/2018-19/locations.txt\";\n\n\t\tArrayList<ImageData> classification = ImageData.classificationFromURL(urlClassification);\n\t\tArrayList<ImageData> expert = ImageData.expertFromURL(urlExpert);\n\t\tArrayList<ImageData> locations = ImageData.locationsFromURL(urlLocations);\n\t\t\n\t\t// For part 2. we need to print the number of images\n\t\t// This will be the length of expert list\n\n\t\tSystem.out.println(expert.size());\n\t\t\n\t\t// For part 3. we need to print the number of images classified by at least 1\n\t\t// volunteer. We will utilise the properties of Sets in java.\n\t\t\n\t\tHashSet<Integer> idsClassifiedByOne = new HashSet<Integer>();\n\t\tfor (ImageData image : classification) {\n\t\t\tidsClassifiedByOne.add(image.getIdentifier());\n\t\t}\n\t\tSystem.out.println(idsClassifiedByOne.size());\n\t\t\n\t\t// For part 4. we need to print details of the images classified by at least 10\n\t\t// volunteers. \n\t\t\n\t\tArrayList<ImageData> atLeast10Vols = new ArrayList<ImageData>();\n\t\tatLeast10Vols = ImageData.atLeast10(classification);\n\t\t\n\t\t// Must merge the information from classification, locations and expert lists\n\t\tArrayList<ImageData> atLeast10CompleteList = new ArrayList<ImageData>();\n\t\tatLeast10CompleteList = ImageData.collectAll(atLeast10Vols, expert, locations);\n\t\tArrayList<ImageData> clean10CompleteList = ImageData.clean(atLeast10CompleteList);\n\t\t\n\t\t// Printing out the data\n\t\t\n\t\tSystem.out.println(clean10CompleteList);\n\n\t}", "public static void main(String[] args) {\n\t\ttry{\n\t\t\tMyLogger d = MyLogger.getInstance();\n \t\tif(args.length != 4) {\n \t\t\t\tSystem.err.println(\"Less than Required length input, please enter three parameters for logger level,input file,output file\\n\");\n \t\t\t\tSystem.exit(1);\n \t\t\t}\n \t\t\tif(Integer.parseInt(args[2])>3 ||Integer.parseInt(args[2])<0)\n \t\t\t{\n \t\t\t\tSystem.err.println(\"Invalid Value\");\n \t\t\t\tSystem.exit(1);\n \t\t\t}\n \t\t\td.set(Integer.parseInt(args[2]),args[1]);\n\t \t\n\t\t\tint N=Integer.parseInt(args[3]);\n\t\t\t\n\t\t\tString s = \"\";\n\t\t\tlong startTime = System.currentTimeMillis();\n\t\t\tArrayList<Integer> l = new ArrayList<Integer>();\n\t\t\t\n\t\t\tString str = \"\";\n\t\t\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tfor(int i=0;i<N;i++){\n\t\t\t\tFileProcessor fp = new FileProcessor(args[0], args[1]);\n\t\t\t\tTreeInfo tst = new TreeInfo();\n\t\t\t\tPopulateTreeVisitorInterface ptv = new PopulateTreeVisitor(fp);\n\t\t\t\ttst.accept(ptv);\n\t\t\t\twordCountVisitorInterface wcv = new WordCountVisitor(fp);\n\t\t\t\ttst.accept(wcv);\n\t\t\t}\n\t\t\t\n\t\t\tlong endTime = System.currentTimeMillis();\n\t\t\tlong totalTime = (endTime- startTime)/1000;\n\t\t\tSystem.out.println(\"Total Time Insertion : \" + totalTime);\n\t\t}\n\t\tcatch(NumberFormatException e){\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t\t\n\t}", "public static void main(String[] args)\n\t{\n\t Corpus corpus = null;\n\t\ttry {\n\t\t\tcorpus = Corpus.load(\"data/all\");\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t // 2. Create a LDA sampler\n\t GibbsSampler ldaGibbsSampler = new GibbsSampler(corpus.getDocument(), \n\t \t\tcorpus.getVocabularySize());\n\t // 3. Train it\n\t ldaGibbsSampler.gibbs(4);\n\t // 4. The phi matrix is a LDA model, you can use LdaUtil to explain it.\n\t double[][] phi = ldaGibbsSampler.getPhi();\n\t System.out.println(\"Number of interactions£º\"+GibbsSampler.ITERATIONS);\n\t Map<String, Double>[] topicMap = Utils.translate(phi, corpus.getVocabulary(), 200);\n\t Utils.explain(topicMap);\n\t}", "public void run () {\n generalFeatureExtraction();\n\n //\n // 2 - Traverse the Call Graph and propagate call stack counter\n propagateFeatures();\n }", "public static void main(String[] args) throws Exception {\n parseCommandLine(args);\n\n // initialise GATE - this must be done before calling any GATE APIs\n Gate.init();\n\n // load the saved application\n CorpusController application =\n (CorpusController) PersistenceManager.loadObjectFromFile(gappFile);\n\n // Create a Corpus to use. We recycle the same Corpus object for each\n // iteration. The string parameter to newCorpus() is simply the\n // GATE-internal name to use for the corpus. It has no particular\n // significance.\n Corpus corpus = Factory.newCorpus(\"BatchProcessApp Corpus\");\n application.setCorpus(corpus);\n\n // process the files one by one\n for (int i = firstFile; i < args.length; i++) {\n // load the document (using the specified encoding if one was given)\n File docFile = new File(args[i]);\n System.out.print(\"Processing document \" + docFile + \"...\");\n Document doc = Factory.newDocument(docFile.toURL(), encoding);\n\n // put the document in the corpus\n corpus.add(doc);\n\n // run the application\n application.execute();\n\n // remove the document from the corpus again\n corpus.clear();\n\n String docXMLString = null;\n // if we want to just write out specific annotation types, we must\n // extract the annotations into a Set\n if (annotTypesToWrite != null) {\n // Create a temporary Set to hold the annotations we wish to write out\n Set annotationsToWrite = new HashSet();\n\n // we only extract annotations from the default (unnamed) AnnotationSet\n // in this example\n AnnotationSet defaultAnnots = doc.getAnnotations();\n Iterator annotTypesIt = annotTypesToWrite.iterator();\n while (annotTypesIt.hasNext()) {\n // extract all the annotations of each requested type and add them to\n // the temporary set\n AnnotationSet annotsOfThisType =\n defaultAnnots.get((String) annotTypesIt.next());\n if (annotsOfThisType != null) {\n annotationsToWrite.addAll(annotsOfThisType);\n }\n }\n\n // create the XML string using these annotations\n docXMLString = doc.toXml(annotationsToWrite);\n }\n // otherwise, just write out the whole document as GateXML\n else {\n docXMLString = doc.toXml();\n }\n\n // Release the document, as it is no longer needed\n Factory.deleteResource(doc);\n\n // output the XML to <inputFile>.out.xml\n String outputFileName = docFile.getName() + \".out.xml\";\n File outputFile = new File(docFile.getParentFile(), outputFileName);\n\n // Write output files using the same encoding as the original\n FileOutputStream fos = new FileOutputStream(outputFile);\n BufferedOutputStream bos = new BufferedOutputStream(fos);\n OutputStreamWriter out;\n if (encoding == null) {\n out = new OutputStreamWriter(bos);\n } else {\n out = new OutputStreamWriter(bos, encoding);\n }\n\n out.write(docXMLString);\n\n out.close();\n System.out.println(\"done\");\n } // for each file\n\n System.out.println(\"All done\");\n }", "@Test\n public void testGenome() {\n\n this.genomeBList.add(this.chromB1);\n this.genomeBList.add(this.chromB2);\n this.genomeBList.add(this.chromB3);\n this.genomeBList.add(this.chromB4);\n\n this.genomeB = new Genome(this.genomeBList);\n this.addHPDataB = new AdditionalDataHPDistance(this.genomeB);\n\n Assert.assertTrue(this.genomeB.getGenome().size() == 4);\n Assert.assertTrue(this.genomeB.getNumberOfChromosomes() == 4);\n Assert.assertTrue(this.genomeB.getNumberOfGenes() == 9);\n Assert.assertTrue(this.genomeB.getChromosome(1).getGenes()[1] == 6);\n Assert.assertTrue(this.genomeB.getChromosome(0).getSize() == 4);\n Assert.assertTrue(this.genomeB.getGenome().get(1).getGenes()[1] == 6);\n\n // Assert.assertTrue(this.addHPDataB.getGenomeAsArray().length == 17);\n // Assert.assertTrue(this.addHPDataB.getGenomeAsArray()[0] == 1);\n // Assert.assertTrue(this.addHPDataB.getGenomeAsArray()[8] == 9);\n\n Assert.assertTrue(this.addHPDataB.getGenomeCappedPlusArray().length == 17);\n Assert.assertTrue(this.addHPDataB.getGenomeCappedPlusArray()[0] == 0);\n Assert.assertTrue(this.addHPDataB.getGenomeCappedPlusArray()[8] == 6);\n\n Assert.assertTrue(this.addHPDataB.getGenomeCappedMinusArray().length == 17);\n Assert.assertTrue(this.addHPDataB.getGenomeCappedMinusArray()[0] == -10);\n Assert.assertTrue(this.addHPDataB.getGenomeCappedMinusArray()[8] == 6);\n\n }", "public void GenSetAnnotation(List<String> symb) throws Exception {\t\t\n\t\tString module = \"GS_\"+((int)(Math.random()*10000));\n\t\tSystem.out.println(\"Your module name is: \"+module);\n\t\tString workspace = \"results/\";\n\n\t\tFile dossier = new File(workspace);\n\t\tif(!dossier.exists()){\n\t\t\tdossier.mkdir();\n\t\t}\n\n\t\t\n\t\tStringBuffer plossb = new StringBuffer();\n\n\t\tplossb.append(\"SS\\tModule\\tCoverGenes\\tNumTerms\\tGNTotal\\n\");\n\t\t\n\t\t\tString sub = \"GO:0008150\";\n//\t\t\tfor( String sub: this.go.subontology.keySet()) {\n\t\t\t\tSystem.out.println(\"####### SubOntology : \" +sub );\n\t\t\t\tString statfolder = workspace+\"newBriefings_Incomplete/OwnModules/\"+module+\"/is_a/\";\n\n\t\t\t\tdossier = new File(statfolder);\n\t\t\t\tif(!dossier.exists()){\n\t\t\t\t\tdossier.mkdir();\n\t\t\t\t}\n\n\t\t\t\tSet<String> terminosinc = new HashSet<String>(this.goa.getTerms(symb, sub,go)); // Get terms to GOA with removed incomplete terms \n\n\t\t\t\tString export = statfolder+ this.go.allStringtoInfoTerm.get(sub).toName(); // url folder to save the information\n\n\t\t\t\tArrayList<String> listTerm = new ArrayList<String>(terminosinc); // change to list the terms set\n\n\t\t\t\tWrite.exportSSM(go, sub, this.goa,listTerm, symb,export+\"/SemanticMatrix\"); // computed and export the semantic similarity\n\n\t\t\t\tString[] methods = {\"DF\",\"Ganesan\",\"LC\",\"PS\",\"Zhou\",\"Resnik\",\"Lin\",\"NUnivers\",\"AIC\"};\n\t\t\t\t\n\t\t\t\tRepresentative.onemetric(module, ic,sub,methods, \"average\", new HashSet<String>(symb), export+\"/SemanticMatrix\", export, go, listTerm,this.goa,\n\t\t\t\t\t\ttailmin,RepCombinedSimilarity,precision,nbGeneMin);\n\n\t\t\t\n\t\t\tfor(String t : this.go.allStringtoInfoTerm.keySet()) {\n\t\t\t\tthis.go.allStringtoInfoTerm.get(t).geneSet.clear();\n\t\t\t}\n//\t\t}\n\t\t\n\t\t\n\t}", "public void makeContexts() {\n \n // make map of ContextTreeNode objects for all taxonomic contexts, indexed by root node name\n HashMap<String, ContextTreeNode> contextNodesByRootName = new HashMap<String, ContextTreeNode>();\n for (ContextDescription cd : ContextDescription.values()) {\n contextNodesByRootName.put(cd.licaNodeName, new ContextTreeNode(new TaxonomyContext(cd, this)));\n }\n \n TraversalDescription prefTaxParentOfTraversal = Traversal.description().depthFirst().\n relationships(RelType.PREFTAXCHILDOF, Direction.OUTGOING);\n \n // for each ContextTreeNode (i.e. each context)\n for (Entry<String, ContextTreeNode> entry: contextNodesByRootName.entrySet()) {\n \n String childName = entry.getKey();\n ContextTreeNode contextNode = entry.getValue();\n \n // traverse back up the taxonomy tree from the root of this context toward life\n for (Node parentNode : prefTaxParentOfTraversal.traverse(contextNode.context.getRootNode()).nodes()) {\n \n // if/when we find a more inclusive (i.e. parent) context\n String parentName = String.valueOf(parentNode.getProperty(\"name\"));\n if (contextNodesByRootName.containsKey(parentName) && (parentName.equals(childName) == false)) {\n \n System.out.println(\"Adding \" + childName + \" as child of \" + parentName);\n \n // add this link in the contextNode hierarchy and move to the next contextNode\n ContextTreeNode parentContextNode = contextNodesByRootName.get(parentName);\n parentContextNode.addChild(contextNode);\n break;\n \n }\n }\n }\n \n // get the root of the ContextTreeNode tree (i.e. most inclusive context)\n ContextTreeNode contextHierarchyRoot = contextNodesByRootName.get(LIFE_NODE_NAME);\n \n System.out.println(\"\\nHierarchy for contexts (note: paraphyletic groups do not have their own contexts):\");\n printContextTree(contextHierarchyRoot, \"\");\n System.out.println(\"\");\n \n // make the contexts!\n makeContextsRecursive(contextHierarchyRoot);\n \n }", "public static void main(String[] args) {\n\n GenomeSequence g = new GenomeSequence();\n g.genomeSequence();\n System.out.println(\"---------------------------------------------------------------------\\n\");\n\n // Thread five times to generate 100 genome sequence in total\n // getName >>> Thread-1 to Thread-5\n GenomeSequenceThread thread_1 = new GenomeSequenceThread();\n GenomeSequenceThread thread_2 = new GenomeSequenceThread();\n GenomeSequenceThread thread_3 = new GenomeSequenceThread();\n GenomeSequenceThread thread_4 = new GenomeSequenceThread();\n GenomeSequenceThread thread_5 = new GenomeSequenceThread();\n\n long startTime = System.currentTimeMillis();\n // Starting all threads\n thread_1.start();\n thread_2.start();\n thread_3.start();\n thread_4.start();\n thread_5.start();\n\n try {\n thread_1.join();\n thread_2.join();\n thread_3.join();\n thread_4.join();\n thread_5.join();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n long endTime = System.currentTimeMillis();\n long executionTimeThread = endTime - startTime;\n\n System.out.println(\"\\nTotal Execution time: \"\n + executionTimeThread\n + \" milli seconds.\\n\");\n }", "public static void main(String[] args) throws Exception {\n\t\tString matlabLocation = \"/usr/local/MATLAB/R2012a/bin/matlab\";\n\t\tMatlabProxyFactoryOptions options = new MatlabProxyFactoryOptions.Builder()\n\t\t\t\t.setProxyTimeout(30000L).setMatlabLocation(matlabLocation)\n\t\t\t\t.setHidden(true).build();\n\n\t\tMatlabProxyFactory factory = new MatlabProxyFactory(options);\n\t\tMatlabProxy proxy = factory.getProxy();\n\n\t\tSAXBuilder builder = new SAXBuilder();\n\t\tString inputCorpusDir = \"../data/ACL2015/testData\";\n\t\tDocument doc = builder.build(inputCorpusDir + \"/\"\n\t\t\t\t+ \"GuidedSumm_topics.xml\");\n\t\tElement root = doc.getRootElement();\n\t\tList<Element> corpusList = root.getChildren();\n\n\t\tString outputSummaryDir = \"../data/ACL2015/Output\";\n\t\tString confFilePath = \"../data/ACL2015/ROUGE/conf.xml\";\n\t\t\n\n\t\tint iterTime = 3;\n\t\t\t\t\n\t\t///////////////////////////////////////////////\t\n\t\t\n\t\tint[] numberClusters_DCNN = {7, 8};\n\t\t\n\n\t\t//////////////////////////////////////////////////////\n\t\tPrintWriter out_DCNN_Spe_H_Har_H_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_H_Har_H_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_H_Har_H_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Har_H_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Har_H_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_H_Har_H_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_H_Har_H_110.close();\n\t\t\n\t\t/////////////////////////////////////////////\n\t\t\n\t\tPrintWriter out_DCNN_Spe_H_Har_C_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_H_Har_C_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_H_Har_C_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Har_C_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Har_C_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_H_Har_C_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_H_Har_C_110.close();\n\t\t\n\t\t////////////////////////////////////\n\t\tPrintWriter out_DCNN_Spe_C_Gre_H_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_C_Gre_H_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_C_Gre_H_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_H_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_H_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_H_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_C_Gre_H_110.close();\n\t\t\n\t\t//////////////////////////////\n\t\tPrintWriter out_DCNN_Spe_C_Gre_C_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_C_Gre_C_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_C_Gre_C_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_C_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_C_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_C_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_C_Gre_C_110.close();\n\t\t////////////////////////////////\n\t\tPrintWriter out_DCNN_Spe_H_Gre_H_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_H_Gre_H_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_H_Gre_H_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_H_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_H_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_H_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_H_Gre_H_110.close();\n\t\t\n\t\t////////////////////////\n\t\tPrintWriter out_DCNN_Spe_H_Gre_C_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_H_Gre_C_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_H_Gre_C_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_C_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_C_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_C_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_H_Gre_C_110.close();\n\t\t\n\t\t////////////////////////////\n\t\tPrintWriter out_DCNN_Spe_H_LGC_C_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_H_LGC_C_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_H_LGC_C_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_LGC_C_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_LGC_C_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_H_LGC_C_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_H_LGC_C_110.close();\n\t\t\n\t\t///////////////////////\n\t\t\n\t\tPrintWriter out_DCNN_Spe_C_LGC_C_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_C_LGC_C_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_C_LGC_C_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_LGC_C_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_LGC_C_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_C_LGC_C_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_C_LGC_C_110.close();\n\t\t\n\t\t\n\t\tproxy.disconnect();\n\t}", "public static void main(String[] args) {\r\n\t\tList<String> tracklist = TracklistCreator.readTrackList(\"work\\\\all_wav.txt\");\r\n\t\tint filesProcessed = 0;\r\n\t\tfor (String wavFilePath : tracklist) {\r\n\t\t\ttry {\r\n\t\t\t\tString track = StringUtils.substringAfterLast(wavFilePath, File.separator);\r\n\t\t\t\tString beatFilePath = TARGET_DIR + track + PathConstants.EXT_BEAT;\r\n\t\t\t\tnew VampBeatTimesProvider(wavFilePath, beatFilePath, new Configuration().pre);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t if (++filesProcessed % 10 == 0) {\r\n\t \tLOG.info(filesProcessed + \" files were processed\");\r\n\t }\r\n\t\t}\r\n\t\tLOG.info(\"Done. \" + filesProcessed + \" files were saved to '\" + TARGET_DIR + \"'\");\r\n\t}", "public static void main (String[] args){\n LexGridXMLProcessor lp = new LexGridXMLProcessor();\r\n ArrayList<SystemReleaseSurvey> survey = null;\r\n //System.out.println(\"CodingSchemeProps: \" + lp.setPropertiesFlag(args[0],null));\r\n //System.out.println(\"RelationsProps: \" + lp.systemReleaseCodingSchemePropertiesSurvey(args[0],null));\r\n survey = lp.systemReleaseCodingSchemePropertiesSurvey(args[0],null);\r\n for(SystemReleaseSurvey srs : survey){\r\n \r\n System.out.println(srs.toString());\r\n \r\n }\r\n }", "@Override\n\t\tprotected void process() throws Exception {\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing - Initializing Models...\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tGlobalVars.initialize();\n\n\t\t\t// Processing Step 1. - CoreNLP\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing CoreNLP.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tString processed_text = Filter\n\t\t\t\t\t.filterdata(GlobalVars.pipeline, text);\n\n\t\t\t// Processing Step 2. - Openie\"\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing Openie.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tStringBuilder openIEOutput = new StringBuilder();\n\t\t\tString temp = \"\";\n\t\t\tfor (String sentence : processed_text.split(\"\\\\. \")) {\n\n\t\t\t\tSeq<Instance> extractions = GlobalVars.openIE.extract(sentence);\n\n\t\t\t\tInstance[] arr = new Instance[extractions.length()];\n\t\t\t\textractions.copyToArray(arr);\n\n\t\t\t\tfor (Instance inst : arr) {\n\t\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\t\tsb.append(inst.sentence() + \"\\n\");\n\t\t\t\t\tDouble conf = inst.confidence();\n\t\t\t\t\tString stringConf = conf.toString().substring(0, 4);\n\t\t\t\t\tsb.append(stringConf).append(\" (\")\n\t\t\t\t\t\t\t.append(inst.extr().arg1().text()).append(\"; \")\n\t\t\t\t\t\t\t.append(inst.extr().rel().text()).append(\"; \");\n\n\t\t\t\t\ttemp += inst.extr().arg1().text() + \"\\n\"\n\t\t\t\t\t\t\t+ inst.extr().rel().text() + \"\\n\";\n\n\t\t\t\t\tPart[] arr2 = new Part[inst.extr().arg2s().length()];\n\t\t\t\t\tinst.extr().arg2s().copyToArray(arr2);\n\t\t\t\t\t/*\n\t\t\t\t\t * for (Part arg : arr2) { sb.append(arg.text()).append(\"\");\n\t\t\t\t\t * System.out.println(\"%\" + arg.text() + \"%\"); }\n\t\t\t\t\t */\n\t\t\t\t\tif (arr2.length != 0) {\n\t\t\t\t\t\tSystem.out.println(\"Hats: \" + arr2[0]);\n\t\t\t\t\t\ttemp += arr2[0] + \"\\n\";\n\t\t\t\t\t\tsb.append(arr2[0]);\n\t\t\t\t\t\tsb.append(\")\\n\\n\");\n\t\t\t\t\t\topenIEOutput.append(sb.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Processing Step 3. - Rewrite\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing Rewrite.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\t// Load load = new Load();\n\t\t\t// result = load.Loadfilter(openIEOutput.toString());\n\t\t\tresult = temp;\n\t\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t\tClassifyDocuments docsClassification = new ClassifyDocuments();\r\n\t\t\r\n\t\t// Ask user for input to the root directory where all the folders are located\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter the path of the directory where all the folders are located\\n\");\r\n\t\tdocsClassification.rootFolder = scan.next();\r\n\t\t\r\n\t\t// Initialize all the other path variables\r\n\t\tdocsClassification.allDocs = docsClassification.rootFolder + \"\\\\ALL\";\r\n\t\tdocsClassification.hamiltonDocs = docsClassification.rootFolder + \"\\\\HAMILTON\";\r\n\t\tdocsClassification.jayDocs = docsClassification.rootFolder + \"\\\\JAY\";\r\n\t\tdocsClassification.madisonDocs = docsClassification.rootFolder + \"\\\\MADISON\";\r\n\t\tdocsClassification.hamiltonAndMadison = docsClassification.rootFolder + \"\\\\HAMILTON AND MADISON\";\r\n\t\tdocsClassification.toBeClassified = docsClassification.rootFolder + \"\\\\HAMILTON OR MADISON\";\r\n\r\n\t\t// Create the invertedIndex\r\n\t\tdocsClassification.createIndex();\r\n\t\t\r\n\t\tlong beginTime = System.currentTimeMillis();\r\n\r\n\t\t// Call doRocchioClassification\r\n\t\tSystem.out.println(\"As per Rocchio Classification:\");\r\n\t\tdocsClassification.doRocchioClassification();\r\n\r\n\t\t// Call doBayesianClassification\r\n\t\tSystem.out.println(\"As per Bayesian Classification:\");\r\n\t\tdocsClassification.doBayesianClassification();\r\n\t\t\r\n\t\tSystem.out.println(\"Time taken : \" + (System.currentTimeMillis() - beginTime) + \"ms\");\r\n\r\n\t}", "private void generalFeatureExtraction () {\n Logger.log(\"Counting how many calls each method does\");\n Chain<SootClass> classes = Scene.v().getApplicationClasses();\n try {\n for (SootClass sclass : classes) {\n if (!isLibraryClass(sclass)) {\n System.out.println(ConsoleColors.RED_UNDERLINED + \"\\n\\n 🔍🔍 Checking invocations in \" +\n sclass.getName() + \" 🔍🔍 \" + ConsoleColors.RESET);\n List<SootMethod> methods = sclass.getMethods();\n for (SootMethod method : methods) {\n featuresMap.put(method, new Features(method));\n }\n }\n }\n } catch (Exception e) { \n }\n System.out.println(\"\\n\");\n }", "public static void main(final String[] args) {\n final Generator g = new Generator();\n // g.populateStudentAndFaculty();\n // g.populateShelf();\n // g.populateBooks();\n // g.populateCopies();\n // g.populateAuthors();\n // g.populateKeywords();\n g.populateIssuesAndEtc();\n // 8 are currently checked out\n }", "public void setSamples(List<Sample> samples)\n {\n this.samples = samples;\n }", "public static void main(String [ ] args)\n\t{\n\t\ttry\n\t\t{\n\t\t\t//Parse command line arguments\n String organism = null; //The target organism for the simulation, determines the genome data that will be parsed\n if(args[0].equals(\"Hum\"))\n organism = \"Homo sapiens\";\n else if(args[0].equals(\"Mou\"))\n organism = \"Mus musculus\";\n else if(args[0].equals(\"Test\"))\n organism = \"Test test\";\n else\n printString(\"Please check and provide a valid organism name as the first input argument!\");\n \n int sex = 0;\n if(args[1].equals(\"F\"))\n sex = FEMALE;\n else if(args[1].equals(\"M\"))\n sex = MALE;\n else\n printString(\"Please check that you provided 'F' or 'M' for gender!\");\n \n final int INITIAL_POPULATION_SIZE = Integer.parseInt(args[2]);\n final int SIM_DURATION = Integer.parseInt(args[3]);\n final int TIME_INTERVAL = 24;//Integer.parseInt(args[4]);\n \n \n /******************************************************\n * Read the genome_data file to obtain data on the size \n * of each chromosome. Store this data in a String list.\n * Each line stores the integer sizes of each chromosome \n * pair, e.g for an organism of haploid# = 3;\n * chr1 133797422,133797422\n * chr2 242508799,242508799\n * XY 198450956,130786757 <==The last line will have\n * two different values for\n * males (XY instead of XX)\n *\n */\n File genome_data_file = new File (\"Genome_data.txt\");\n genome_data = importGenomeData(genome_data_file, organism, sex);\n \n //printString(Integer.toString(genome_data.size()));\n //for(Iterator<String> i = genome_data.iterator(); i.hasNext();)\n //{\n //String item = i.next();\n //System.out.println(item);\n //}\n /******************************************************/\n \n List<Cell> cell_population = initiatePopulation(INITIAL_POPULATION_SIZE); //Initialise a population to be used at the start of the simulation\n \n //Run the simulation executive, providing the duration to run the simulation for, the time intervals at which events are evaluated and the initial cell population to perform the simulation of proliferation on\n cell_population = runSimulationExecutive(SIM_DURATION, TIME_INTERVAL, cell_population);\n //printLabelDistribOfPopulation(cell_population);\n generateOutput(cell_population, genome_data);\n\n\n }\n\t\tcatch (NumberFormatException|IOException error)\n\t\t{\n\t\t\t//int missing_argument = Integer.parseInt(error.getMessage()) + 1;\n\t\t\t//print(\"Argument number \" + missing_argument + \" missing! Enter the correct number of arguments.\"); // Print error message on console if there are missing arguments\n\t\t\tprintString(\"Oops! Something is wrong with the input values you provided. Check that you have entered the correct number, and types of arguments. Error type => \" + error.getMessage());\n //Catch null pointer exceptions!!!\n\t\t}// try-catch\n\n\t\t//****************************************\n\t\t//1. Set a max time to run simulation\n\t\t//2. Set time intervals\n\t\t//3. Vars for fraction_dividing_cells, rate_cell_death, doubling_time/division_rate\n\t\t//4. Don't use a static variable for current_timepoint. Provide this value each time you deal with a cell, i.e in the for loop\n\t\t//5. cell_cycle_duration\n\t //6. cell_cycle_frequency\n\t \n\t\t\n\t\t//***Maybe store all generations in single rows/columns of a two dimensional array?\n\t\t\n\t}", "public static void main(String[] args) throws IOException {\n int activeThreshold = 300;\n //Activity.selectActive(\"st\", 6, activeThreshold);\n //Activity.selectActive(\"ri\", 6, activeThreshold);\n //Activity.selectActive(\"dw\", 9, activeThreshold);\n\n //Interaction.analysis(\"st\", 6);\n //Interaction.analysis(\"ri\", 6);\n\n //BehaviourIndicators.analysis(\"st\", 6);\n //BehaviourIndicators.analysis(\"ri\", 6);\n //BehaviourIndicators.analysis(\"dw\", 9);\n\n Engagement.analysis(\"st\",6);\n Engagement.analysis(\"ri\",6);\n //todo the data files for DW have to be adjusted to the ones of the other two to be able to run it\n //Engagement.analysis(\"dw\",9);\n\n //Motivation.analysis(\"ri\", 6);\n //Motivation.analysis(\"st\", 6);\n }", "public static void main(String[] args) throws IOException {\n CommandLineParser parser = new DefaultParser();\n Options options = new Options();\n\n Option optModel = OptionBuilder.withArgName(\"model\")\n .hasArg()\n .withDescription(\"model used for simulation: \\n\\nmistransmission\\n constraint\\n constraintWithMistransmission\\n prior\\n priorWithMistransmission (default)\")\n .create(\"model\");\n options.addOption(optModel);\n \n options.addOption(\"stochastic\", false, \"sample from previous generation's distributions\"); \n \n options.addOption(\"superspeakers\", false, \"20% of speakers in grouped distance model connect to other group\"); \n\n Option optLogging = OptionBuilder.withArgName(\"logging\")\n .hasArg()\n .withDescription(\"logging level: \\nnone \\nsome \\nall \\ntabular \\ntroubleshooting\")\n .create(\"logging\");\n options.addOption(optLogging); \n\n Option optFreqNoun = OptionBuilder.withArgName(\"freqNoun\")\n .hasArg()\n .withDescription(\"noun frequency of the target word\")\n .create(\"freqNoun\");\n options.addOption(optFreqNoun); \n \n Option optFreqVerb = OptionBuilder.withArgName(\"freqVerb\")\n .hasArg()\n .withDescription(\"verb frequency of the target word\")\n .create(\"freqVerb\");\n options.addOption(optFreqVerb); \n \n Option optMisProbP = OptionBuilder.withArgName(\"misProbNoun\")\n .hasArg()\n .withDescription(\"mistransmission probability for nouns\")\n .create(\"misProbP\");\n options.addOption(optMisProbP); \n \n Option optMisProbQ = OptionBuilder.withArgName(\"misProbVerb\")\n .hasArg()\n .withDescription(\"mistransmission probability for verbs\")\n .create(\"misProbQ\");\n options.addOption(optMisProbQ); \n \n Option optLambda11 = OptionBuilder.withArgName(\"prior11General\")\n .hasArg()\n .withDescription(\"general prior probability for {1,1} stress pattern\")\n .create(\"prior11General\");\n options.addOption(optLambda11); \n \n Option optLambda22 = OptionBuilder.withArgName(\"prior22General\")\n .hasArg()\n .withDescription(\"general prior probability for {2,2} stress pattern\")\n .create(\"prior22General\");\n options.addOption(optLambda22); \n \n Option optTargetLambda11 = OptionBuilder.withArgName(\"prior11Target\")\n .hasArg()\n .withDescription(\"prior probability for {1,1} stress pattern in the target word prefix class\")\n .create(\"prior11Target\");\n options.addOption(optTargetLambda11); \n \n Option optTargetLambda22 = OptionBuilder.withArgName(\"prior22Target\")\n .hasArg()\n .withDescription(\"prior probability for {2,2} stress pattern in the target word prefix class\")\n .create(\"prior22Target\");\n options.addOption(optTargetLambda22); \n \n Option optDistModel = OptionBuilder.withArgName(\"distModel\")\n .hasArg()\n .withDescription(\"distance model:\\n none\\n absolute\\n probabilistic\\n random\\n lattice\\n grouped (default)\")\n .create(\"distModel\");\n options.addOption(optDistModel); \n \n options.addOption(\"priorClass\", false, \"use word pair prefixes as a class for sharing prior probabilities\"); \n \n Option optNumSpeakers = OptionBuilder.withArgName(\"numSpeakers\")\n .hasArg()\n .withDescription(\"number of speakers\")\n .create(\"numSpeakers\");\n options.addOption(optNumSpeakers); \n \n Option optTargetWord = OptionBuilder.withArgName(\"targetWord\")\n .hasArg()\n .withDescription(\"target word for logging\")\n .create(\"targetWord\");\n options.addOption(optTargetWord); \n \n options.addOption(\"help\", false, \"print this message\"); \n\n try { // parse the command line arguments\n CommandLine line = parser.parse(options, args);\n if(line.hasOption(\"model\")) {\n model = line.getOptionValue(\"model\");\n }\n if(line.hasOption(\"stochastic\")) { \n stochastic = true;\n } else {\n stochastic = false;\n }\n if(line.hasOption(\"superspeakers\")) { \n superspeakers = true;\n } else {\n superspeakers = false;\n }\n if(line.hasOption(\"logging\")) {\n logging = line.getOptionValue(\"logging\");\n }\n if(line.hasOption(\"freqNoun\")) {\n freqNoun = Integer.parseInt(line.getOptionValue(\"freqNoun\"));\n }\n if(line.hasOption(\"freqVerb\")) {\n freqVerb = Integer.parseInt(line.getOptionValue(\"freqVerb\"));\n }\n if(line.hasOption(\"misProbP\")) {\n misProbP = Integer.parseInt(line.getOptionValue(\"misProbP\"));\n }\n if(line.hasOption(\"misProbQ\")) {\n misProbQ = Integer.parseInt(line.getOptionValue(\"misProbQ\"));\n }\n if(line.hasOption(\"targetWord\")) {\n targetWord = line.getOptionValue(\"targetWord\");\n }\n if(line.hasOption(\"prior11General\")) {\n lambda11 = Integer.parseInt(line.getOptionValue(\"prior11General\"));\n }\n if(line.hasOption(\"prior22General\")) {\n lambda22 = Integer.parseInt(line.getOptionValue(\"prior22General\"));\n }\n if(line.hasOption(\"prior11Target\")) {\n targetClassLambda11 = Integer.parseInt(line.getOptionValue(\"prior11Target\"));\n }\n if(line.hasOption(\"prior22Target\")) {\n targetClassLambda22 = Integer.parseInt(line.getOptionValue(\"prior22Target\"));\n }\n if(line.hasOption(\"distModel\")) {\n distModel = line.getOptionValue(\"distModel\");\n }\n if(line.hasOption(\"priorClass\")) {\n priorClass = true;\n } else {\n priorClass = false;\n }\n if(line.hasOption(\"numSpeakers\")) {\n numSpeakers = Integer.parseInt(line.getOptionValue(\"numSpeakers\"));\n }\n if(line.hasOption(\"help\")) {\n HelpFormatter formatter = new HelpFormatter();\n formatter.printHelp( \"StressChange\", options );\n }\n } catch ( ParseException exp) {\n System.out.println(\"Unexpected exception: \" + exp.getMessage());\n }\n\n if (StressChange.logging.equals(\"tabular\")){\n System.out.println(\"Iteration,Speaker,Group,Word,Prefix,Noun prob,Verb prob\");\n }\n else if (!StressChange.logging.equals(\"none\")) {\n System.out.println(\"Simulating \" + model + \" model with \" + distModel + \" distance model, showing \" + logging + \" words\");\n System.out.println(\"N1 (target word noun frequency): \" + freqNoun);\n System.out.println(\"N2 (target word verb frequency): \" + freqVerb);\n }\n \n initialStress = new ReadPairs(System.getProperty(\"user.dir\") + \"/src/initialStressSmoothed.txt\").OpenFile(); // read in initial pairs\n\n SimState state = new StressChange(System.currentTimeMillis());\n state.start();\n \n do {\n convos.removeAllEdges();\n if (! StressChange.logging.equals(\"none\") && !StressChange.logging.equals(\"tabular\")){ System.out.println(\"\"); }\n //if (! StressChange.logging.equals(\"none\")){ System.out.println(\"Generation at year \" + (1500 + (state.schedule.getSteps()) * 25)); } // 25-year generations \n if (! StressChange.logging.equals(\"none\") && !StressChange.logging.equals(\"tabular\")){ System.out.println(\"==== ITERATION \" + (state.schedule.getSteps() + 1) + \" ====\"); }\n if (!state.schedule.step(state)) {\n break;\n }\n step++;\n } while (state.schedule.getSteps() < 49); // maximum 50 iterations\n state.finish();\n\n System.exit(0);\n }", "public static void main(String[] args) throws IOException {\n // All but last arg is a file/directory of LDC tagged input data\n File[] files = new File[args.length - 1];\n for (int i = 0; i < files.length; i++)\n files[i] = new File(args[i]);\n\n // Last arg is the TestFrac\n double testFraction = Double.valueOf(args[args.length -1]);\n\n // Get list of sentences from the LDC POS tagged input files\n List<List<String>> sentences = POSTaggedFile.convertToTokenLists(files);\n int numSentences = sentences.size();\n\n // Compute number of test sentences based on TestFrac\n int numTest = (int)Math.round(numSentences * testFraction);\n\n // Take test sentences from end of data\n List<List<String>> testSentences = sentences.subList(numSentences - numTest, numSentences);\n\n // Take training sentences from start of data\n List<List<String>> trainSentences = sentences.subList(0, numSentences - numTest);\n System.out.println(\"# Train Sentences = \" + trainSentences.size() +\n \" (# words = \" + BigramModel.wordCount(trainSentences) +\n \") \\n# Test Sentences = \" + testSentences.size() +\n \" (# words = \" + BigramModel.wordCount(testSentences) + \")\");\n\n // Create a BidirectionalBigramModel model and train it.\n BidirectionalBigramModel model = new BidirectionalBigramModel();\n\n System.out.println(\"Training...\");\n model.train(trainSentences);\n\n // Test on training data using test2\n model.test2(trainSentences);\n\n System.out.println(\"Testing...\");\n // Test on test data using test2\n model.test2(testSentences);\n }", "public static void main(String[] args) throws Exception { \n\t\tUtils.LIMIT_RELATIONS = true;\n\t\tUtils.WINDOW = 2;\n\t\t\n//\t\tString pid = RandomFile.getPID();\n//\t\tgenerateClass(pid, \"f\", 1, 0, 25);\n//\t\tgenerateClass(pid, \"g\", 2, 0.1, 25);\n\t\t\n\t\tif (args.length != 5) {\n\t\t\tSystem.out.print(\"Usage: numRepeat experiment \");\n\t\t\tSystem.out.print(\"\\\"mean1,mean2,...\\\" \\\"pct1,pct2,..\\\"\");\n\t\t\tSystem.out.print(\"\\\"length1,length2,...\\\"\");\n\t\t\tSystem.out.println();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tUtils.EXPERIMENTS = Integer.parseInt(args[0]);\n\t\tString experiment = args[1];\n\t\tSystem.out.println(\"Experiment: \" + experiment);\n\t\t\n\t\tList<Double> means = new ArrayList<Double>();\n\t\tString[] meanTokens = args[2].split(\"[,]\");\n\t\tfor (String tok : meanTokens)\n\t\t\tmeans.add(Double.parseDouble(tok));\n\t\t\n\t\tList<Double> pcts = new ArrayList<Double>();\n\t\tString[] pctTokens = args[3].split(\"[,]\");\n\t\tfor (String tok : pctTokens)\n\t\t\tpcts.add(Double.parseDouble(tok));\n\t\t\n\t\tList<Integer> lengths = new ArrayList<Integer>();\n\t\tString[] lengthTokens = args[4].split(\"[,]\");\n\t\tfor (String tok : lengthTokens)\n\t\t\tlengths.add(Integer.parseInt(tok));\n\t\t\n\t\tif (\"curve\".equals(experiment)) \n\t\t\tlearningCurve(lengths, means, pcts);\n\t\telse if (\"cluster\".equals(experiment))\n\t\t\tcluster(lengths, means, pcts);\n\t\telse if (\"knn\".equals(experiment))\n\t\t\tknn(lengths, means, pcts);\n\t\telse\n\t\t\texperiment(lengths, means, pcts);\n\t\t\n//\t\texpectedSequenceSizes(lengths,means);\n\t}", "public static void main(String[] args) {\n\t// write your code here\n\n\n Library library = new Library();\n //new students array for this library\n ArrayList<Student> studentsInLibrary = new ArrayList<>();\n ArrayList<Book> booksInLibrary = new ArrayList<>();\n ArrayList<Tablet> tabletsInLibrary = new ArrayList<>();\n\n //set the created arraylist to library registered students and fill it\n library.setRegisteredStudents(fillStudentsArray(studentsInLibrary));\n library.setBooksBank(fillBooksArray(booksInLibrary));\n library.setTabletsBank(fillTabletsArray(tabletsInLibrary));\n\n\n System.out.println(!false);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// //Debugging\n// for ( Student student1 : library.getRegisteredStudents() ) {\n//\n//\n// System.out.println(student1.toString());\n// }\n//\n//\n// for ( Book book : library.getBooksBank() ) {\n//\n//\n// System.out.println(book.toString());\n// }\n//\n// System.out.println(\"***********************************\");\n//\n// for ( Tablet tablet : library.getTabletsBank() ) {\n//\n//\n// System.out.println(tablet.toString());\n// }\n\n\n\n LibraryManager libraryManager =new LibraryManager();\n\n\n\n\n\n\n\n\n //pass the library to its manager\n libraryManager.setTheLibrary(library);\n\n }", "private static void setClonalSexRecGenomes(String haplotypeFile, String recombinationFile, String chromosomeDefinition, String sexInfoFile, boolean haploids)\n {\n if(! new File(haplotypeFile).exists()) throw new IllegalArgumentException(\"Haplotype file does not exist \"+haplotypeFile);\n if(recombinationFile!=null) throw new IllegalArgumentException(\"It is not allowed to provide a recombination file for simulation of clonal evolution\" + recombinationFile);\n if(sexInfoFile != null) throw new IllegalArgumentException(\"It is not allowed to provide a sex info file for simulations of clonal evolution \"+sexInfoFile);\n\n sexInfo=SexInfo.getClonalEvolutionSexInfo();\n\n DiploidGenomeReader dgr =new DiploidGenomeReader(haplotypeFile,sexInfo.getSexAssigner(),haploids,logger);\n SexedDiploids sd=dgr.readGenomes();\n if(sd.countMales()>0) throw new IllegalArgumentException(\"It is not allowed to specify male-haplotypes for clonal evolution, solely hermaphrodites or no sex is allowed\");\n if(sd.countFemales()>0) throw new IllegalArgumentException(\"It is not allowed to specify female-haplotypes for clonal evolution, solely hermaphrodites or no sex is allowed\");\n sexInfo.setHemizygousSite(sd.getDiploids().get(0).getHaplotypeA().getSNPCollection());\n\n ArrayList<Chromosome> chromosomes=sd.getDiploids().get(0).getHaplotypeA().getSNPCollection().getChromosomes();\n recombinationGenerator = new RecombinationGenerator(CrossoverGenerator.getDefault(), new RandomAssortmentGenerator(chromosomes,true));\n\n basePopulation=sd.updateSexChromosome(sexInfo);\n\n }", "public static void main(String[] args) throws IOException {\n\n SimpleDateFormat ft = new SimpleDateFormat(\"hh:mm:ss\");\n System.out.println(\"Started at \" + ft.format(new Date()));\n\n // Folder containing android apps to analyze\n final PluginId pluginId = PluginId.getId(\"idaDoctor\");\n final IdeaPluginDescriptor pluginDescriptor = PluginManager.getPlugin(pluginId);\n File experimentDirectory = new File(root_project.getBasePath());\n fileName = new File(pluginDescriptor.getPath().getAbsolutePath()+\"/resources/results.csv\");\n String smellsNeeded = args[0];\n\n FILE_HEADER = new String[StringUtils.countMatches(smellsNeeded, \"1\") + 1];\n\n DataTransmissionWithoutCompressionRule dataTransmissionWithoutCompressionRule = new DataTransmissionWithoutCompressionRule();\n DebuggableReleaseRule debbugableReleaseRule = new DebuggableReleaseRule();\n DurableWakeLockRule durableWakeLockRule = new DurableWakeLockRule();\n InefficientDataFormatAndParserRule inefficientDataFormatAndParserRule = new InefficientDataFormatAndParserRule();\n InefficientDataStructureRule inefficientDataStructureRule = new InefficientDataStructureRule();\n InefficientSQLQueryRule inefficientSQLQueryRule = new InefficientSQLQueryRule();\n InternalGetterSetterRule internaleGetterSetterRule = new InternalGetterSetterRule();\n LeakingInnerClassRule leakingInnerClassRule = new LeakingInnerClassRule();\n LeakingThreadRule leakingThreadRule = new LeakingThreadRule();\n MemberIgnoringMethodRule memberIgnoringMethodRule = new MemberIgnoringMethodRule();\n NoLowMemoryResolverRule noLowMemoryResolverRule = new NoLowMemoryResolverRule();\n PublicDataRule publicDataRule = new PublicDataRule();\n RigidAlarmManagerRule rigidAlarmManagerRule = new RigidAlarmManagerRule();\n SlowLoopRule slowLoopRule = new SlowLoopRule();\n UnclosedCloseableRule unclosedCloseableRule = new UnclosedCloseableRule();\n\n String[] smellsType = {\"DTWC\", \"DR\", \"DW\", \"IDFP\", \"IDS\", \"ISQLQ\", \"IGS\", \"LIC\", \"LT\", \"MIM\", \"NLMR\", \"PD\", \"RAM\", \"SL\", \"UC\"};\n\n FILE_HEADER[0] = \"Class\";\n\n int headerCounter = 1;\n\n for (int i = 0; i < smellsNeeded.length(); i++) {\n if (smellsNeeded.charAt(i) == '1') {\n FILE_HEADER[headerCounter] = smellsType[i];\n headerCounter++;\n }\n }\n\n CSVFormat csvFileFormat = CSVFormat.DEFAULT.withRecordSeparator(NEW_LINE_SEPARATOR);\n FileWriter fileWriter = new FileWriter(fileName);\n try (CSVPrinter csvFilePrinter = new CSVPrinter(fileWriter, csvFileFormat)) {\n csvFilePrinter.printRecord((Object[]) FILE_HEADER);\n\n for (File project : experimentDirectory.listFiles()) {\n\n if (!project.isHidden()) {\n\n // Method to convert a directory into a set of java packages.\n ArrayList<PackageBean> packages = FolderToJavaProjectConverter.convert(project.getAbsolutePath());\n\n for (PackageBean packageBean : packages) {\n\n for (ClassBean classBean : packageBean.getClasses()) {\n\n List record = new ArrayList();\n\n System.out.println(\"-- Analyzing class: \" + classBean.getBelongingPackage() + \".\" + classBean.getName());\n\n record.add(classBean.getBelongingPackage() + \".\" + classBean.getName());\n\n if (smellsNeeded.charAt(0) == '1') {\n if (dataTransmissionWithoutCompressionRule.isDataTransmissionWithoutCompression(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(1) == '1') {\n if (debbugableReleaseRule.isDebuggableRelease(RunAndroidSmellDetection.getAndroidManifest(project))) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(2) == '1') {\n if (durableWakeLockRule.isDurableWakeLock(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(3) == '1') {\n if (inefficientDataFormatAndParserRule.isInefficientDataFormatAndParser(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(4) == '1') {\n if (inefficientDataStructureRule.isInefficientDataStructure(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(5) == '1') {\n if (inefficientSQLQueryRule.isInefficientSQLQuery(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(6) == '1') {\n if (internaleGetterSetterRule.isInternalGetterSetter(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(7) == '1') {\n if (leakingInnerClassRule.isLeakingInnerClass(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(8) == '1') {\n if (leakingThreadRule.isLeakingThread(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(9) == '1') {\n if (memberIgnoringMethodRule.isMemberIgnoringMethod(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(10) == '1') {\n if (noLowMemoryResolverRule.isNoLowMemoryResolver(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(11) == '1') {\n if (publicDataRule.isPublicData(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(12) == '1') {\n if (rigidAlarmManagerRule.isRigidAlarmManager(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(13) == '1') {\n if (slowLoopRule.isSlowLoop(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(14) == '1') {\n if (unclosedCloseableRule.isUnclosedCloseable(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n csvFilePrinter.printRecord(record);\n }\n }\n }\n }\n }\n System.out.println(\"CSV file was created successfully!\");\n System.out.println(\"Finished at \" + ft.format(new Date()));\n }", "public static void main(String [] args) {\n\n String priorDirectory = \"pathway_lists\"; //Directory of prior knowledge files, we assume that every file in here is a prior knowledge file\n boolean priorMatrices = true; //Are priors in the form of a matrix or a sif file?\n String dataFile = \"\"; //Filename of the dataset to analyze\n String runName = \"\"; //Name of the run to produce output directory\n int ns = 20; //Number of subsamples to test\n int numLambdas = 40; //Number of lambda values to test\n double low = 0.05; //Low end of lambda range to do knee point analysis\n double high = 0.95; //High end of lambda range to do knee point analysis\n boolean loocv = false; //Do we do leave-one-out cross validation instead of ns subsamples\n boolean makeScores = false; //Should we make edge score matrices?\n boolean fullCounts = false; //Do we want to output counts for edges across subsamples / lambda parameters\n int index = 0;\n List<String> toRemove = new ArrayList<String>();\n try {\n while (index < args.length) {\n if (args[index].equals(\"-ns\")) {\n ns = Integer.parseInt(args[index + 1]);\n index += 2;\n } else if (args[index].equals(\"-nl\")) {\n numLambdas = Integer.parseInt(args[index + 1]);\n index += 2;\n } else if(args[index].equals(\"-llow\")){\n low = Double.parseDouble(args[index+1]);\n index+=2;\n }else if (args[index].equals(\"-lhigh\")){\n high = Double.parseDouble(args[index+1]);\n index+=2;\n } else if(args[index].equals(\"-run\")) {\n runName = args[index+1];\n index+=2;\n }\n else if(args[index].equals(\"-fullCounts\"))\n {\n fullCounts = true;\n index++;\n }\n else if (args[index].equals(\"-priors\")) {\n priorDirectory = args[index + 1];\n index += 2;\n } else if (args[index].equals(\"-sif\")) {\n priorMatrices = false;\n index++;\n } else if (args[index].equals(\"-data\")) {\n dataFile = args[index + 1];\n index += 2;\n }\n else if(args[index].equals(\"-rm\"))\n {\n int count = index + 1;\n while(count < args.length && !args[count].startsWith(\"-\"))\n {\n toRemove.add(args[count]);\n count++;\n }\n index = count;\n } else if (args[index].equals(\"-loocv\")) {\n loocv = true;\n index++;\n }\n else if(args[index].equals(\"-makeScores\"))\n {\n makeScores = true;\n index++;\n }\n else if(args[index].equals(\"-v\"))\n {\n verbose = true;\n index++;\n }\n else\n index++;\n }\n }\n catch(ArrayIndexOutOfBoundsException e)\n {\n System.err.println(\"Command line arguments not specified properly at argument: \" + args[index]);\n e.printStackTrace();\n System.exit(-1);\n }\n catch(NumberFormatException e)\n {\n System.err.println(\"Expected a number for element: \" + args[index]);\n e.printStackTrace();\n System.exit(-1);\n }\n catch(Exception e)\n {\n System.err.println(\"Double check command line arguments\");\n e.printStackTrace();\n System.exit(-1);\n }\n\n //Create lambda range to test based on input parameters\n double [] initLambdas = new double[numLambdas];\n for(int i = 0; i < numLambdas;i++)\n {\n initLambdas[i] = low + i*(high-low)/numLambdas;\n }\n\n //Load in the dataset\n DataSet d = null;\n try {\n d = MixedUtils.loadDataSet2(dataFile);\n }\n catch(Exception e)\n {\n System.err.println(\"Error loading in data file\");\n e.printStackTrace();\n System.exit(-1);\n }\n\n if(verbose)\n {\n System.out.println(\"Removing Variables... \" + toRemove);\n }\n //Remove variables specified by the user\n for(String s:toRemove)\n {\n d.removeColumn(d.getVariable(s));\n }\n\n //Add dummy discrete variable to the dataset if only a continuous dataset is provided\n boolean addedDummy = false;\n if(d.isContinuous())\n {\n System.out.print(\"Data is only continuous, adding a discrete variable...\");\n Random rand = new Random();\n DiscreteVariable temp= new DiscreteVariable(\"Dummy\",2);\n d.addVariable(temp);\n int column = d.getColumn(d.getVariable(temp.getName()));\n for(int i = 0; i < d.getNumRows();i++)\n {\n d.setInt(i,column,rand.nextInt(temp.getNumCategories()));\n }\n System.out.println(\"Done\");\n addedDummy = true;\n }\n if(verbose)\n {\n System.out.println(\"Full Dataset: \" + d);\n System.out.println(\"Is DataSet Mixed? \" + d.isMixed());\n }\n try{\n File x = new File(runName);\n if(x.exists())\n {\n if(x.isDirectory())\n {\n System.err.println(\"Please specify a run name that does not have an existing directory\");\n System.exit(-1);\n }\n else\n {\n System.err.println(\"Please specify a run name that isn't a file\");\n System.exit(-1);\n }\n\n }\n x.mkdir();\n\n\n //Loading in prior knowledge files\n File f = new File(priorDirectory);\n if(!f.isDirectory())\n {\n System.err.println(\"Prior sources directory does not exist\");\n System.exit(-1);\n }\n HashMap<Integer,String> fileMap = new HashMap<Integer,String>();\n int numPriors = f.listFiles().length;\n SparseDoubleMatrix2D[] priors = new SparseDoubleMatrix2D[numPriors];\n\n //Load in each prior from the directory, accounting for whether its a matrix or an sif file\n //Add accounting for whether a dummy variable was added to the data\n for(int i = 0;i < f.listFiles().length;i++)\n {\n fileMap.put(i,f.listFiles()[i].getName());\n String currFile = f.listFiles()[i].getPath();\n if(!priorMatrices)\n {\n PrintStream out = new PrintStream(\"temp.txt\");\n createPrior(f.listFiles()[i],out,d.getVariableNames());\n currFile = \"temp.txt\";\n }\n if(addedDummy)\n {\n addLines(new File(currFile));\n priors[i] = new SparseDoubleMatrix2D(realDataPriorTest.loadPrior(new File(\"temp_2.txt\"),d.getNumColumns()));\n }\n else\n {\n priors[i] = new SparseDoubleMatrix2D(realDataPriorTest.loadPrior(new File(currFile),d.getNumColumns()));\n }\n }\n //Delete maintenance files\n File t = new File(\"temp.txt\");\n t.deleteOnExit();\n t = new File(\"temp_2.txt\");\n if(t.exists())\n t.deleteOnExit();\n\n\n\n //Generate subsample indices\n int [][] samps = genSubs(d,ns,loocv);\n System.out.println(\"Done\");\n //Generate lambda parameters to test based on knee points and initial lambdas\n System.out.print(\"Generating Lambda Params...\");\n mgmPriors m = new mgmPriors(ns,initLambdas,d,priors,samps,verbose);\n System.out.println(\"Done\");\n\n\n //Set piMGM to output edge scores subsampled data after computing optimal lambda parameters)\n if(makeScores) {\n m.makeEdgeScores();\n }\n\n //Run piMGM\n System.out.print(\"Running piMGM...\");\n Graph g = m.runPriors();\n System.out.println(\"Done\");\n System.out.print(\"Printing Results...\");\n\n //Print all result files, edge scores, and full edge counts (across subsamples and params)\n printAllResults(g,m,runName,fileMap);\n if(makeScores)\n {\n double [][] scores = m.edgeScores;\n printScores(scores,d,runName);\n }\n if(fullCounts)\n {\n TetradMatrix tm = m.fullCounts;\n printCounts(tm,d,runName);\n }\n System.out.println(\"Done\");\n }\n catch(Exception e)\n {\n System.err.println(\"Unknown Error\");\n e.printStackTrace();\n System.exit(-1);\n }\n\n }", "static public void main(String[] args) throws Throwable {\n /*\n Stream.of(mOneShotInputStrings)\n .parallel()\n .forEach(arrayOfStrings -> \n Stream.of(arrayOfStrings)\n .parallel()\n .forEach(string -> \n Stream.of(mWordList)\n .parallel()\n .map(word -> WordMatcher.search(word, string))\n .forEach(results -> results.print())));\n } */\n \n printDebugging(\"Starting SearchStreamGangTest\");\n \n // Create/run appropriate type of StreamGang to search for words.\n Stream.of(TestsToRun.values())\n .forEach(test -> {\n printDebugging(\"Starting \" + test); \n makeStreamGang(mWordList, test).run(); \n printDebugging(\"Ending \" + test);\n });\n \n printDebugging(\"Ending SearchStreamGangTest\"); \n\t}", "public static void main(String[] args){\n\t\tString[] model = readFile(args[0]);\n\t\tString[] data = readFile(args[1]);\n\t\t\n\t\t//create graphs\n\t\tgraph datag = new graph(data);\n\t\tgraph modelg = new graph(model);\n\t\t\n\t\t//search and output isomorphisms\n\t\tTuple[] h = new Tuple[modelg.V.length]; \n \t\tsearch(modelg, datag, h);\n\t}", "public static void main(String[] args) throws IOException {\n\t\t\n\t\n\tnew VetClinic();\n\t\n\t// WELCOME TO MY CODE: MAIRA LORENA WALTERO GUEVARA \n\t// This code is for demonstration purposes for my application for Graduate Software Engineer (Dublin)in DATALEX \n\t\n\t// MY CLINIC IS DIVIDED IN TWO SUPER CLASES: \n\t// 1. STAFF AND 2. ANIMALS \n\t\n\t// 1. STAFF HAS 3 CHILDREN: \n\t// 1.1 ADMINISTRATIVE STAFF AND 1.2 MEDICAL STAFF\n\t// 1.1 ADMININSTRATIVE STAFF HAS 3 CHILDS: \n\t//1.1.1 HR (id=229 -230) , 1.1.2 IT (id=226-228) AND 1.1.3 RECEPTIONIST (id=221-225)\n\t\n\t// 1.2. MEDICAL STAFF HAS 3 CHILDREN: \n\t//1.2.1 SMALL ANIMALS VETS (id= 111 - 125) , 1.2.2 LARGE ANIMALS VETS (id= 126 - 130) AND LABORATORIANS (id= 131 - 140) \n\t//1.2.1 SMALL ANIMALS VETS is only attending small animals = pets \n\t//1.2.2 LARGE ANIMALS VETS is only attending large animals = livestock animals \n\t//1.2.3 LABORATORIANS are attending both type of animals but only if they need. \n\t\n\t//2. ANIMALS HAS TWO SUBCLASSES: \n\t//2.1 COMPANION ANIMALS AND 2.2 LIVESTOCK ANIMALS \n\t//2.1 COMPANION ANIMALS HAS 3 SUBCLASSES:\n\t//2.1.2 CAT , 2.1.2 DOG AND 2.1.3 RABBIT \n\t//2.2 LIVESTOCK ANIMALS HAS TWO SUBCLASSES: \n\t//2.2.1 CATTLE AND 2.2.2 SHEEP \n\t\n\t// THE ARE TREE TYPES OF CLASES WHO CONTAIN THE METHODS IN ORDER TO CREATE THE FUNTIONS \n\t// 1. READING FILES , 2. MAIN CLASS OF METHODS AND 3. PRINT AND QUESTION METHODS\n\t\n\t// 1. READING FILES: \n\t// 1.1 INFOANIMALS AND INFOSTAFF : IN HERE THE METHOD READ THE FILE AND IN SOME CASES CREATE AN ARRAY LIST WITH RANDOM ELEMENTS \n\t// 1.2 MAIN CLASS OF METHOS: IN HERE THERE ARE THE METHODS TO CREATE THE INTANCES, POPULATE THE QUEUES, ASSING TASKS AND DO THE SEARCHS \n\t// 1.3 PRINT AND QUESTION METHODS: THIS CONTAIN THE METHODS TO ASK TO THE USER QUESTIONS AND PRINT THE ANSWER USING THE METHODS INSIDE OF INFORMATION CLASS\n\t}", "public int produce(int min, int max, int start, int subpopulation, Individual[] inds, ec.EvolutionState state, int thread)\n/* */ {\n/* 27 */ int n = this.sources[0].produce(min, max, start, subpopulation, inds, state, thread);\n/* */ \n/* */ \n/* */ \n/* 31 */ if (!state.random[thread].nextBoolean(this.likelihood)) {\n/* 32 */ return reproduce(n, start, subpopulation, inds, state, thread, false);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 38 */ if (!(this.sources[0] instanceof ec.BreedingPipeline)) {\n/* 39 */ for (int q = start; q < n + start; q++) {\n/* 40 */ inds[q] = ((Individual)inds[q].clone());\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 48 */ if (!(inds[start] instanceof TestCaseCandidate))\n/* 49 */ state.output.fatal(\"OurMutatorPipeline didn't get an Chromosome.The offending individual is in subpopulation \" + \n/* 50 */ subpopulation + \" and it's:\" + inds[start]);\n/* 51 */ ChromosomeSpecies species = (ChromosomeSpecies)inds[start].species;\n/* */ \n/* */ \n/* */ \n/* 55 */ for (int q = start; q < n + start; q++)\n/* */ {\n/* 57 */ TestCaseCandidate i = (TestCaseCandidate)inds[q];\n/* 58 */ double mutp = 1.0D / i.getGenes().size();\n/* */ \n/* 60 */ double[] propa = new double[i.getGenes().size()];\n/* 61 */ for (int x = 0; x < i.getGenes().size(); x++)\n/* 62 */ propa[x] = mutp;\n/* 63 */ for (int x = 0; x < i.getGenes().size(); x++) {\n/* 64 */ if (state.random[thread].nextBoolean(propa[x]))\n/* */ {\n/* */ \n/* 67 */ ((csbst.generators.AbsractGenerator)i.getGenes().get(x)).mutate();\n/* */ }\n/* */ }\n/* */ \n/* 71 */ i.evaluated = false;\n/* */ }\n/* */ \n/* 74 */ return n;\n/* */ }", "public static void Pubmed() throws IOException \n\t{\n\t\t\n\t\tMap<String,Map<String,List<String>>> trainset = null ; \n\t\t//Map<String, List<String>> titles = ReadXMLFile.ReadCDR_TestSet_BioC() ;\n\t File fFile = new File(\"F:\\\\TempDB\\\\PMCxxxx\\\\articals.txt\");\n\t List<String> sents = readfiles.readLinesbylines(fFile.toURL()); \n\t\t\n\t\tSentinfo sentInfo = new Sentinfo() ; \n\t\t\n\t\ttrainset = ReadXMLFile.DeserializeT(\"F:\\\\eclipse64\\\\eclipse\\\\TrainsetTest\") ;\n\t\tLinkedHashMap<String, Integer> TripleDict = new LinkedHashMap<String, Integer>();\n\t\tMap<String,List<Integer>> Labeling= new HashMap<String,List<Integer>>() ;\n\t\t\n\t\tMetaMapApi api = new MetaMapApiImpl();\n\t\tList<String> theOptions = new ArrayList<String>();\n\t theOptions.add(\"-y\"); // turn on Word Sense Disambiguation\n\t theOptions.add(\"-u\"); // unique abrevation \n\t theOptions.add(\"--negex\"); \n\t theOptions.add(\"-v\");\n\t theOptions.add(\"-c\"); // use relaxed model that containing internal syntactic structure, such as conjunction.\n\t if (theOptions.size() > 0) {\n\t api.setOptions(theOptions);\n\t }\n\t \n\t\t\n\t\tif (trainset == null )\n\t\t{\n\t\t\ttrainset = new HashMap<String, Map<String,List<String>>>();\n\t\t}\n\t\t\n\t\t\n\t\t/************************************************************************************************/\n\t\t//Map<String, Integer> bagofwords = semantic.getbagofwords(titles) ; \n\t\t//trainxmllabeling(trainset,bagofwords); \n\t\t/************************************************************************************************/\n\t\t\n\t\t\n\t\tint count = 0 ;\n\t\tint count1 = 0 ;\n\t\tModel candidategraph = ModelFactory.createDefaultModel(); \n\t\tMap<String,List<String>> TripleCandidates = new HashMap<String, List<String>>();\n\t\tfor(String title : sents)\n\t\t{\n\t\t\t\n\t\t\tModel Sentgraph = sentInfo.graph;\n\t\t\tif (trainset.containsKey(title))\n\t\t\t\tcontinue ; \n\t\t\t//8538\n\t\t\tcount++ ; \n\n\t\t\tMap<String, List<String>> triples = null ;\n\t\t\t// get the goldstandard concepts for current title \n\t\t\tList<String> GoldSndconcepts = new ArrayList<String> () ;\n\t\t\tMap<String, Integer> allconcepts = null ; \n\t\t\t\n\t\t\t// this is optional and not needed here , it used to measure the concepts recall \n\t\t\tMap<String, List<String>> temptitles = new HashMap<String, List<String>>(); \n\t\t\ttemptitles.put(title,GoldSndconcepts) ;\n\t\t\t\t\t\t\n\t\t\t// get the concepts \n\t\t\tallconcepts = ConceptsDiscovery.getconcepts(temptitles,api);\n\t\t\t\n\t\t\tArrayList<String> RelInstances1 = SyntaticPattern.getSyntaticPattern(title,allconcepts,FILE_NAME_Patterns) ;\n\t\t\t//Methylated-CpG island recovery assay: a new technique for the rapid detection of methylated-CpG islands in cancer\n\t\t\tif (RelInstances1 != null && RelInstances1.size() > 0 )\n\t\t\t{\n\t\t\t\tcount1++ ;\n\t\t\t\tTripleCandidates.put(title, RelInstances1) ;\n\t\t\t\t\n\t\t\t\tif (count1 == 30)\n\t\t\t\t{\n\t\t\t\t\tReadXMLFile.Serialized(TripleCandidates,\"F:\\\\eclipse64\\\\eclipse\\\\Relationdisc1\") ;\n\t\t\t\t\tcount1 = 0 ;\n\t\t\t\t}\n\t\t\t}\n \n\t\t}\n\t\t\n\t\tint i = 0 ;\n\t\ti++ ; \n\t}", "public void process(){\n\n for(int i = 0; i < STEP_SIZE; i++){\n String tmp = \"\" + accData[i][0] + \",\" + accData[i][1] + \",\"+accData[i][2] +\n \",\" + gyData[i][0] + \",\" + gyData[i][1] + \",\" + gyData[i][2] + \"\\n\";\n try{\n stream.write(tmp.getBytes());\n }catch(Exception e){\n //Log.d(TAG,\"!!!\");\n }\n\n }\n\n /**\n * currently we don't apply zero-mean, unit-variance operation\n * to the data\n */\n // only accelerator's data is using, currently 200 * 3 floats\n // parse the 1D-array to 2D\n\n if(recognizer.isInRecognitionState() &&\n recognizer.getGlobalRecognitionTimes() >= Constants.MAX_GLOBAL_RECOGNITIOME_TIMES){\n recognizer.resetRecognitionState();\n }\n if(recognizer.isInRecognitionState()){\n recognizer.removeOutliers(accData);\n recognizer.removeOutliers(gyData);\n\n double [] feature = new double [FEATURE_SIZE];\n recognizer.extractFeatures(feature, accData, gyData);\n\n int result = recognizer.runModel(feature);\n String ret = \"@@@\";\n if(result != Constants.UNDEF_RET){\n if(result == Constants.FINISH_RET){\n mUserWarningService.playSpeech(\"Step\" + Integer.toString(recognizer.getLastGesture()) + Constants.RIGHT_GESTURE_INFO);\n waitForPlayout(2000);\n mUserWarningService.playSpeech(Constants.FINISH_INFO);\n waitForPlayout(1);\n recognizer.resetLastGesutre();\n recognizer.resetRecognitionState();\n ret += \"1\";\n }else if(result == Constants.RIGHT_RET){\n mUserWarningService.playSpeech(\"Step\" + Integer.toString(recognizer.getLastGesture()) + Constants.RIGHT_GESTURE_INFO);\n waitForPlayout(2000);\n mUserWarningService.playSpeech(\"Now please do Step \" + Integer.toString(recognizer.getExpectedGesture()));\n waitForPlayout(1);\n ret += \"1\";\n }else if(result == Constants.ERROR_RET){\n mUserWarningService.playSpeech(Constants.WRONG_GESTURE_WARNING + recognizer.getExpectedGesture());\n waitForPlayout(1);\n ret += \"0\";\n }else if(result == Constants.ERROR_AND_FORWARD_RET){\n mUserWarningService.playSpeech(Constants.WRONG_GESTURE_WARNING + recognizer.getLastGesture());\n waitForPlayout(1);\n if(recognizer.getExpectedGesture() <= Constants.STATE_SPACE){\n mUserWarningService.playSpeech(\n \"Step \" + recognizer.getLastGesture() + \"missing \" +\n \". Now please do Step\" + Integer.toString(recognizer.getExpectedGesture()));\n waitForPlayout(1);\n }else{\n recognizer.resetRecognitionState();\n mUserWarningService.playSpeech(\"Recognition finished.\");\n waitForPlayout(1);\n }\n\n\n ret += \"0\";\n }\n ret += \",\" + Integer.toString(result) + \"@@@\";\n\n Log.d(TAG, ret);\n Message msg = new Message();\n msg.obj = ret;\n mWriteThread.writeHandler.sendMessage(msg);\n }\n }\n\n }", "private void streamlinedGo(String[] argsList) {\n\t\tstates = alignment.getAminoAcidsAsFitchStates();\n\t\tbaseStates = phylogeny.getFitchStates(states).clone();\n\t\tambiguousAtRoot = 0;\n\t\tancestorAmbiguities = new boolean[baseStates.length];\n\t\t/* Establish how many ancestral states are ambiguous */\n\t\tfor(int i=0;i<baseStates.length;i++){\n\t\t\tHashSet<String> statesSet=baseStates[i];\n\t\t\tif(statesSet.size()>1){\n\t\t\t\tambiguousAtRoot++;\n\t\t\t\tancestorAmbiguities[i] = true;\n\t\t\t}\n\t\t}\n\t\t/* Attempt to resolve the rootnode states */\n\t\tphylogeny.resolveFitchStatesTopnode();\n\t\tphylogeny.resolveFitchStates(phylogeny.states);\n\t\t/* A new PR object used to hold reconstructions */\n\t\tpr = new ParsimonyReconstruction(states, phylogeny);\n\t\t/* Should now be resolved as far as possible.\n\t\t * Compare each taxon to tree root MRCA */\n\t\t//pr.printAncestralComparison();\n\n\t\t/*\n\t\t * Parse the args into lists\n\t\t * Then find the tips and MRCAs of each list. at this point print all branches below\n\t\t * Then walk through the MRCA / lists counting subs\n\t\t */\n\t\tint numberOfClades = argsList.length-2;\t// we'll assume the first two args are alignment and phylogeny respectively, and all the others (we've checked >2) are clades described by tips\n\t\t// Guessed the number of clades, initialise arrays\n\t\tcladeTips = new HashSet[numberOfClades];\n\t\tcladeTipsAsNodes = new HashSet[numberOfClades];\n\t\tMRCAnodes = new TreeNode[numberOfClades];\n\t\tMRCAcladesBranchTotals = new int[numberOfClades];\n\t\tMRCAcladesBranchTotalsTerminal = new int[numberOfClades];\n\t\tMRCAcladesBranchTotalsInternal = new int[numberOfClades];\n\t\tMRCAcladesSubstitutionTotals = new int[numberOfClades];\n\t\tMRCAcladesSubstitutionTotalsTerminal = new int[numberOfClades];\n\t\tMRCAcladesSubstitutionTotalsInternal = new int[numberOfClades];\n\t\tSystem.out.println(\"Assuming \"+numberOfClades+\" separate clades. Parsing clade descriptions...\");\n\t\t// Parse the clade lists\n\t\tfor(int i=2;i<argsList.length;i++){\n\t\t\tString[] taxaTokens = argsList[i].split(\":\");\n\t\t\tcladeTips[i-2] = new HashSet<String>();\n\t\t\tcladeTipsAsNodes[i-2] = new HashSet<TreeNode>();\n\t\t\tfor(String aTaxon:taxaTokens){\n\t\t\t\tcladeTips[i-2].add(aTaxon);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check we've parsed them correctly\n\t\tSystem.out.println(\"Read these taxon lists:\");\n\t\tfor(int i=0;i<cladeTips.length;i++){\n\t\t\tSystem.out.print(\"Clade \"+i);\n\t\t\tfor(String taxon:cladeTips[i]){\n\t\t\t\tSystem.out.print(\" \"+taxon);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\t// Find the MRCA node of each clade, and also print all the branches beneath that MRCA node\n\t\tSystem.out.println(\"Searching the tree for the MRCAs of each clade...\");\n\t\tfor(int i=0;i<numberOfClades;i++){\n\t\t\t// Find the tip nodes corresponding to extant taxa\n\t\t\tIterator<String> itr = cladeTips[i].iterator();\n\t\t\twhile(itr.hasNext()){\n\t\t\t\tint nodeIDofTip = phylogeny.getTipNumber(itr.next());\n\t\t\t\tTreeNode tipNode = phylogeny.getNodeByNumberingID(nodeIDofTip);\n\t\t\t\tcladeTipsAsNodes[i].add(tipNode);\n\t\t\t}\n\t\t\t\t\n\t\t\t// Find the ID of the MRCA node\n\t\t\tint nodeIDofMRCA = phylogeny.getNodeNumberingIDContainingTaxa(cladeTips[i]);\n\t\t\tTreeNode cladeNodeMRCA = phylogeny.getNodeByNumberingID(nodeIDofMRCA);\n\t\t\tMRCAnodes[i] = cladeNodeMRCA;\n\n\t\t\t// Print all the branches below MRCA\n\t\t\tSystem.out.println(\"Found the MRCA of clade \"+i+\" (\"+nodeIDofMRCA+\"):\\n\"+cladeNodeMRCA.getContent()+\"\\nPrinting all branches below this node:\");\n\t\t\tMRCAcladesBranchTotals[i] = cladeNodeMRCA.howManyTips();\n\t\t\tfor(TreeBranch branch:cladeNodeMRCA.getBranches()){\n\t\t\t\tSystem.out.println(branch);\n\t\t\t\tInteger[] substitutions = StateComparison.printStateComparisonBetweenTwoNodes(branch.getParentNode().states, branch.getDaughterNode().states, branch.getParentNode().getContent(), branch.getDaughterNode().getContent());\n\t\t\t\tMRCAcladesSubstitutionTotals[i] = substitutions.length;\n\t\t\t\tif(branch.isEndsInTerminalTaxon()){\n\t\t\t\t\tMRCAcladesBranchTotalsTerminal[i]++;\n\t\t\t\t\tMRCAcladesSubstitutionTotalsTerminal[i] = substitutions.length;\n\t\t\t\t}else{\n\t\t\t\t\tMRCAcladesBranchTotalsInternal[i]++;\n\t\t\t\t\tMRCAcladesSubstitutionTotalsInternal[i] = substitutions.length;\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// For each MRCA node and clade tips combination, compare and print substitutions\n\t\tSystem.out.println(\"Comparing ancestral clade MRCA node sequences with extant sequences...\");\n\t\tfor(int i=0;i<numberOfClades;i++){\n\t\t\tSystem.out.println(\"Comparing ancestral MRCA sequence for CLADE \"+i+\" against *ALL* clades' terminal taxa...\");\n\t\t\tTreeNode thisMRCA = MRCAnodes[i];\n\t\t\tfor(int j=0;j<cladeTipsAsNodes.length;j++){\n\t\t\t\tSystem.out.println(\"Clade MRCA: \"+i+\" -vs- clade tips: \"+j);\n\t\t\t\tint MRCAtoTipsSubstitutions = 0;\n\t\t\t\tfor(TreeNode someTip:cladeTipsAsNodes[j]){\n\t\t\t\t\tInteger[] substitutions = StateComparison.printStateComparisonBetweenTwoNodes(thisMRCA.states, someTip.states, \"MRCA_clade_\"+i, someTip.getContent());\n\t\t\t\t\tMRCAtoTipsSubstitutions+= substitutions.length;\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Substitutions from Clade MRCA: \"+i+\" -vs- clade tips: \"+j+\": \"+MRCAtoTipsSubstitutions);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// All uncorrected pairwise comparisons\n\t\tSystem.out.println(\"Comparing extant sequences directly...\");\n\t\tfor(int i=0;i<numberOfClades;i++){\n\t\t\tfor(TreeNode someTip:cladeTipsAsNodes[i]){\n\t\t\t\tfor(int j=0;j<cladeTipsAsNodes.length;j++){\n\t\t\t\t\tSystem.out.println(\"Basis clade: \"+i+\" -vs- clade tips: \"+j);\n\t\t\t\t\tint MRCAtoTipsSubstitutions = 0;\n\t\t\t\t\tfor(TreeNode someOtherTip:cladeTipsAsNodes[j]){\n\t\t\t\t\t\tInteger[] substitutions = StateComparison.printStateComparisonBetweenTwoNodes(someTip.states, someOtherTip.states, someTip.getContent(), someOtherTip.getContent());\n\t\t\t\t\t\tMRCAtoTipsSubstitutions+= substitutions.length;\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(\"Substitutions from Clade MRCA: \"+i+\" -vs- clade tips: \"+j+\": \"+MRCAtoTipsSubstitutions);\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\t\n\t\t// Print a summary of each clade\n\t\tSystem.out.println(\"Summary of clade counts...\");\n\t\tSystem.out.println(\"Clade\\tbranches\\texternal\\tinternal\\t\\tsubstitutions\\texternal\\tinternal\");\n\t\tfor(int i=0;i<numberOfClades;i++){\n\t\t\tSystem.out.println(i\n\t\t\t\t\t+\"\\t\"+MRCAcladesBranchTotals[i]\n\t\t\t\t\t+\"\\t\"+MRCAcladesBranchTotalsTerminal[i]\n\t\t\t\t\t+\"\\t\"+MRCAcladesBranchTotalsInternal[i]+\"\\t\"\n\t\t\t\t\t+\"\\t\"+MRCAcladesSubstitutionTotals[i]\n\t\t\t\t\t+\"\\t\"+MRCAcladesSubstitutionTotalsTerminal[i]\n\t\t\t\t\t+\"\\t\"+MRCAcladesSubstitutionTotalsInternal[i]);\n\t\t}\n\t\tSystem.out.println(\"Done.\");\n\t}", "public static void main(String[] args) throws Exception {\n ConfigurationBuilder cb = new ConfigurationBuilder();\n cb\n .setOAuthConsumerKey(\"uAlvehs52GY9lWBDWfETms0Vs\")\n .setOAuthConsumerSecret(\"KYLNKxP2Rq6HPVc49z4qcBvMIJEiKU62JDBLvfuho8XXqiMzuA\")\n .setOAuthAccessToken(\"2847226595-6MYimsk1SK8W1xqEcAI5rOzOmaeQC4RYexBonGy\")\n .setOAuthAccessTokenSecret(\"KO0AXstVC7V4A0PgvWW4cnTzQ9wOA9SIMfnF6PDU747Er\");\n\n TwitterStreamFactory fact = new TwitterStreamFactory(cb.build());\n TwitterStream twitterStream = fact.getInstance();\n String filename = \".\";\n final PrintWriter writer = new PrintWriter(new FileOutputStream(new File(filename + \"/twitter.data\"), true));\n\n StatusListener listener = new StatusListener() {\n\n public void onStatus(Status status) {\n for (String s : getHashTags(status.toString())) {\n writer.println(s);\n writer.flush();\n }\n }\n\n\n public void onDeletionNotice(StatusDeletionNotice statusDeletionNotice) {\n //System.out.println(\"Got a status deletion notice id:\" + statusDeletionNotice.getStatusId());\n }\n\n\n public void onTrackLimitationNotice(int numberOfLimitedStatuses) {\n System.out.println(\"Got track limitation notice:\" + numberOfLimitedStatuses);\n }\n\n\n public void onScrubGeo(long userId, long upToStatusId) {\n System.out.println(\"Got scrub_geo event userId:\" + userId + \" upToStatusId:\" + upToStatusId);\n }\n\n\n public void onStallWarning(StallWarning warning) {\n System.out.println(\"Got stall warning:\" + warning);\n }\n\n\n public void onException(Exception ex) {\n ex.printStackTrace();\n }\n };\n twitterStream.addListener(listener);\n twitterStream.sample();\n\n }", "private void sampleGauges() {\n rootContext.gauges.values()\n .forEach(PrometheusGaugeWrapper::sample);\n\n rootContext.gaugeSets.values()\n .forEach(PrometheusLabelledGaugeWrapper::sample);\n }", "public static void main(String[] args) throws JsonGenerationException, JsonMappingException, IOException{\n\t\tDictionary root = new Dictionary();\n\t\tparse Parse = new parse();\n long begin = System.currentTimeMillis();\n //String fileName = args[0];\n //String examine = args[1];\n Parse.parseFILE(\"word_tagged.txt\", root);\n long end = System.currentTimeMillis();\n System.out.println(\"insertion time elapse: \" + (double)(end-begin)/1000);\n \n \n /***********************Read data from phrase check dataset**************************/\n \n\t\tBigram n = new Bigram(Parse.parseFILE(\"Grammar.txt\"));\n\t n.train();\n\t ObjectMapper phrase = new ObjectMapper();\n\t String PhraseJson = phrase.writeValueAsString(n);\n\t phrase.writeValue(new File(\"Phrase.json\"), n);\n\t \n\t /***********************Read data from grammar rule dataset**************************/\n\t BuildRule rule = new BuildRule(Parse.parseFILE(\"Grammar.txt\"), 3, root);\n\t rule.train();\n\t \n\t System.out.println(rule.testing);\n\t ConvertToJson con = new ConvertToJson(rule);\n\t ObjectMapper mapper = new ObjectMapper();\n\t String ruleJson = mapper.writeValueAsString(rule);\n\t\tmapper.writeValue(new File(\"GrammarRule.json\"), rule);\n /***************************Begin to check*************************************/\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tArrayList<Lines> result; \r\n\t\tArrayList<Junctions> resultJunction;\r\n\t\tboolean isDarkLine = true;\r\n\t\tboolean doCorrectPosition = false;\r\n\t\tboolean doEstimateWidth = false;\r\n\t\tboolean doExtendLine = true;\r\n\t\tdouble lowerThresh = lowerThreshDefault;\r\n\t\tdouble upperThresh = upperThreshDefault;\r\n\t\tdouble sigma = 3.39;\r\n\t\tresult = new ArrayList<Lines>();\r\n\t\tresultJunction = new ArrayList<Junctions>();\r\n\t\t\r\n\t\tOpener opener = new Opener(); \r\n\t\tString imageFilePath = \"./images/image.jpg\";\r\n\t\tImagePlus imp = opener.openImage(imageFilePath);\r\n\t\tImageProcessor ip = imp.getProcessor();\r\n\t\t\r\n\t\tLineDetector detect = new LineDetector();\r\n\t\tresult.add(detect.detectLines(ip, sigma, upperThresh, lowerThresh, isDarkLine, doCorrectPosition, doEstimateWidth, doExtendLine));\r\n\t\t//usedOptions = detect.getUsedParamters();\r\n\t\tresultJunction.add(detect.getJunctions());\r\n\t\tSystem.out.print(\"helo\");\r\n\r\n\t}", "public static void main (String[] args) throws Exception {\n CommandOption.setSummary (Replacer.class,\n \"Tool for modifying text with n-gram preprocessing\");\n CommandOption.process (Replacer.class, args);\n\n\t\tNGramPreprocessor preprocessor = new NGramPreprocessor();\n\n\t\tif (replacementFiles.value != null) {\n\t\t\tfor (String filename: replacementFiles.value) {\n\t\t\t\tSystem.out.println(\"including replacements from \" + filename);\n\t\t\t\tpreprocessor.loadReplacements(filename);\n\t\t\t}\n\t\t}\n\n\t\tif (deletionFiles.value != null) {\n\t\t\tfor (String filename: deletionFiles.value) {\n\t\t\t\tSystem.out.println(\"including deletions from \" + filename);\n\t\t\t\tpreprocessor.loadDeletions(filename);\n\t\t\t}\n\t\t}\n\t\t\n\t\tArrayList<Pipe> pipes = new ArrayList<Pipe>();\n\t\t\n\t\tPrintWriter out = new PrintWriter(outputFile.value);\n\n\t\tfor (String filename: inputFiles.value) {\n\t\t\tlogger.info(\"Loading \" + filename);\n\t\t\t\n\t\t\tCsvIterator reader = new CsvIterator(new FileReader(filename),\n\t\t\t\t\t\t\t\t\t\t\t\t lineRegex.value,\n\t\t\t\t\t\t\t\t\t\t\t\t dataGroup.value,\n\t\t\t\t\t\t\t\t\t\t\t\t labelGroup.value,\n\t\t\t\t\t\t\t\t\t\t\t\t nameGroup.value);\n\t\t\t\n\t\t\tIterator<Instance> iterator = preprocessor.newIteratorFrom(reader);\n\n\t\t\t@Var\n\t\t\tint count = 0;\n\t\t\t\n\t\t\t// We're not saving the instance list, just writing to the out file\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tInstance instance = iterator.next();\n\n\t\t\t\tout.println(instance.getName() + \"\\t\" + instance.getTarget() + \"\\t\" + instance.getData());\n\t\t\t\t\n\t\t\t\tcount++;\n\t\t\t\tif (count % 10000 == 0) {\n\t\t\t\t\tlogger.info(\"instance \" + count);\n\t\t\t\t}\n\t\t\t\titerator.next();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tout.close();\n\t}", "public void calculateFeatures(MLExample exampleToProcess) throws Exception {\n\t\t\n\t\t\t\n\t\t\t//are directly connected?\t\t\t\n\t\t\tPhraseLink phraseLink = exampleToProcess.getRelatedPhraseLink();\n\t\t\t\n\t\t\tPhrase phrase1 = phraseLink.getFromPhrase();\n\t\t\tPhrase phrase2 = phraseLink.getToPhrase();\n\t\t\tArtifact related_sent = phrase1.getStartArtifact().getParentArtifact();\n\t\t\t\n\t\t\t//relatedArgInPrep\n\t\t\tNormalizedSentence normalized_sent_obj = \n\t\t\t\tNormalizedSentence.getInstance(related_sent, NormalizationMethod.MethodType.MentionToHead);\n\t\t\n\t\t\tString phrase1_head = phrase1.getNormalizedHead();\n\t\t\tString phrase2_head = phrase2.getNormalizedHead();\n\t\t\tArrayList<DependencyLine> nor_dependencies =normalized_sent_obj.getNormalizedDependencies();\n\t\t\tnorDependencyList = nor_dependencies;\n\t\t\t\n\t\t\tfor (DependencyLine nor_dep: nor_dependencies)\n\t\t\t{\n\t\t\t\tString lex_dep = nor_dep.relationName+\"-\"+nor_dep.firstPart+\"-\"+nor_dep.secondPart;\n\t\t\t\tFeatureValuePair nor_dep_feature = FeatureValuePair.getInstance(FeatureName.normalizedDependencies,\n\t\t\t\t\t\tlex_dep,\"1\");\n\t\t\t\tMLExampleFeature.setFeatureExample(exampleToProcess, nor_dep_feature);\t\n\t\t\t}\n//\t\t\tTODO: 8 march, remove comment\n//\t\t\t//Checks whether they are conjuncted\n//\t\t\tBoolean conjuncted_and = areConjunctedBy(phraseLink,\"and\");\n//\t\t\tFeatureValuePair are_conjucted_and_feature = FeatureValuePair.getInstance(FeatureName.AreConjunctedAnd,\n//\t\t\t\t\tconjuncted_and?\"1\":\"0\");\n//\t\t\tMLExampleFeature.setFeatureExample(exampleToProcess, are_conjucted_and_feature);\t\n//\t\t\t\n//\t\t\t//Checks whether they are directly connected\n//\t\t\tBoolean directly_connected = haveDirectRelation(phraseLink,nor_dependencies);\n//\t\t\t\n//\t\t\tFeatureValuePair areDirectlyConnectedFeature = FeatureValuePair.getInstance(\n//\t\t\t\t\t\tFeatureName.AreDirectlyConnected, \n//\t\t\t\t\t\tdirectly_connected?\"1\":\"0\");\n//\t\t\t\t\n//\t\t\tMLExampleFeature.setFeatureExample(exampleToProcess, areDirectlyConnectedFeature);\t\n//\t\t\t//Checks common governors\n//\t\t\tBoolean have_common_govs = haveCommonGoverners(phrase1,phrase2,nor_dependencies);\n//\t\t\t\n//\t\t\tFeatureValuePair haveCommonGovs = FeatureValuePair.getInstance(\n//\t\t\t\t\t\tFeatureName.HaveCommonGovernors, \n//\t\t\t\t\t\thave_common_govs?\"1\":\"0\");\n//\t\t\t\t\n//\t\t\tMLExampleFeature.setFeatureExample(exampleToProcess, haveCommonGovs);\n//\t\t\t\n//\t\t\t\n//\t\t\t//This feature gets the arguments that are in prep relation with phrases\n//\t\t\tList<String> from_args_in_pre =StanfordDependencyUtil.getAllArgsInPrep\n//\t\t\t\t(phrase1_head, phrase1.getNormalOffset()+1, nor_dependencies);\n//\t\t\tfor(String prep_arg:from_args_in_pre )\n//\t\t\t{\n//\t\t\t\tFeatureValuePair from_prep_arg_features = FeatureValuePair.getInstance\n//\t\t\t\t(FeatureName.fromPrepArg, prep_arg,\"1\");\n//\t\t\t\n//\t\t\t MLExampleFeature.setFeatureExample(exampleToProcess, from_prep_arg_features);\n//\t\t\t}\n//\t\t\tList<String> to_args_in_pre =StanfordDependencyUtil.getAllArgsInPrep\n//\t\t\t(phrase2_head, phrase2.getNormalOffset()+1, normalized_sent_obj.getNormalizedDependencies());\n//\t\t\t\n//\t\t\tfor(String prep_arg:to_args_in_pre )\n//\t\t\t{\n//\t\t\t\tFeatureValuePair to_prep_arg_features = FeatureValuePair.getInstance\n//\t\t\t\t(FeatureName.toPrepArg, prep_arg,\"1\");\n//\t\t\t\n//\t\t\t MLExampleFeature.setFeatureExample(exampleToProcess, to_prep_arg_features);\n//\t\t\t}\n\t\t\t/////////////////////\n\t\t\t////////////////////\n\t\t\t/////////////////////\n\t\t\t// Check if to phrase is the preposition arg of from phrase(timex in timex event) \n\t\t\t\n//\t\t\tif (phrase1.getPhraseEntityType().equals(\"TIMEX3\"))\n//\t\t\t{\n//\t\t\t\tTimexPhrase related_timex = TimexPhrase.getRelatedTimexFromPhrase(phrase1);\n//\t\t\t\tboolean is_direct_arg = isEventDirectPrepArgOfTimex(\n//\t\t\t\t\t\t\trelated_timex,phrase2,normalized_sent_obj);\n//\t\t\t\tFeatureValuePair is_event_direct_arg = FeatureValuePair.getInstance\n//\t\t\t\t(FeatureName.isToPhDirectPrepArgOfFromPh, is_direct_arg?\"1\":\"0\");\n//\t\t\t\n//\t\t\t MLExampleFeature.setFeatureExample(exampleToProcess, is_event_direct_arg);\n//\t\t\t}\n\t\t\t/////////////////////////////normalized ti type dep lines//////////////////////////////////////////\n//\t\t\tArrayList<String> sent_nor_dep = getSentNorToTypeDepLines(related_sent);\n//\t\t\tfor (String dep_string:sent_nor_dep)\n//\t\t\t{\n//\t\t\t\tFeatureValuePair nor_dep_feature = FeatureValuePair.getInstance\n//\t\t\t\t(FeatureName.norToTypeDep,dep_string,\"1\");\n//\t\t\t\n//\t\t\t MLExampleFeature.setFeatureExample(exampleToProcess, nor_dep_feature);\n//\t\t\t}\n\t \t\n\t}", "public static void main(String args[]) throws IOException {\n\t\tProcessData ged = new ProcessData(); \r\n\t\tged.readFile(\"My Family.ged\"); \r\n\t\t\r\n\t\t// output result for sprint 1, sprint 2, sprint 3 and sprint 4 to output.txt file\r\n\t\tVector<String> s = new Vector<String>();\r\n\t\t\r\n\t\t// get the individuals data\r\n\t\ts.add(\"Individuals Info:\");\r\n\t\ts.addAll(ged.print_individual());\r\n\t\tPrintWriter writer = new PrintWriter(\"Output.txt\", \"UTF-8\");\r\n\t\twhile(s.size()>0)\r\n\t\t{\r\n\t\t writer.write(s.firstElement());\r\n\t\t writer.println();\r\n\t\t s.removeElementAt(0);\r\n\t\t}\r\n\t\ts.add(\"\");\r\n\t\ts.add(\"\");\r\n\t\ts.add(\"\");\r\n\t\t\r\n\t\t// get the family data\r\n\t\ts.add(\"Family Info\");\r\n\t\ts.addAll(ged.print_family());\r\n\t\twhile(s.size()>0)\r\n\t\t{\r\n\t\t writer.write(s.firstElement());\r\n\t\t writer.println();\r\n\t\t s.removeElementAt(0);\r\n\t\t}\t\t\t\r\n\t\tSystem.out.println(\"Result is printed to Output.txt file.\");\r\n\t\twriter.close();\t\t\r\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t\tGenetic.evolutionary(8);\r\n\t\tDynamic.findPath();\r\n\t}", "public static void main(String[] args) {\n List<Evento> listadoEventos = Evento.createShortList();\n List<Expositor> listadoExpositores = Expositor.createShortList();\n List<Asistente> Asistentes = Asistente.createShortList();\n //Asigno a los eventos sus expositores\n listadoEventos.get(0).setExpositor(listadoExpositores.get(0));\n listadoEventos.get(1).setExpositor(listadoExpositores.get(1));\n listadoEventos.get(2).setExpositor(listadoExpositores.get(2));\n listadoEventos.get(3).setExpositor(listadoExpositores.get(3));\n listadoEventos.get(4).setExpositor(listadoExpositores.get(4));\n listadoEventos.get(5).setExpositor(listadoExpositores.get(5));\n //Asigno los asistentes a los eventos\n listadoEventos.get(0).getListaAsistentes().add(Asistentes.get(0));\n listadoEventos.get(0).getListaAsistentes().add(Asistentes.get(1));\n\n listadoEventos.get(1).getListaAsistentes().add(Asistentes.get(2));\n\n listadoEventos.get(2).getListaAsistentes().add(Asistentes.get(3));\n\n listadoEventos.get(3).getListaAsistentes().add(Asistentes.get(4));\n listadoEventos.get(3).getListaAsistentes().add(Asistentes.get(5));\n\n listadoEventos.get(4).getListaAsistentes().add(Asistentes.get(6));\n\n listadoEventos.get(5).getListaAsistentes().add(Asistentes.get(7));\n listadoEventos.get(5).getListaAsistentes().add(Asistentes.get(8));\n listadoEventos.get(5).getListaAsistentes().add(Asistentes.get(9));\n\n //2A: Listado de manera ordenado por titulo descendiente, expositor y asistentes.\n\n Comparator<Integer> comparador = Collections.reverseOrder();\n\n //Ordenar de forma descendente por titulo\n Collections.sort(listadoEventos, (o1, o2) -> o2.getTitulo().compareTo(o1.getTitulo()));\n\n System.out.println(\"======Prueba 01 - Listado de eventos======\");\n for(Evento e:listadoEventos){\n System.out.println(\"****************************************\");\n System.out.println(\"Evento: \"+e.getTitulo());\n System.out.println(\"Expositor: \"+e.getExpositor().getNombre());\n System.out.println(\"Asistentes:\");\n for(Asistente a : e.getListaAsistentes()){\n System.out.println(a.getCodigo()+\"\\t\"+a.getNombre()+\"\\t\"+a.getApellidos());\n }\n }\n\n }", "@Requires({\"ref != null\", \"ref.length >= activeRegionStop - activeRegionStart\"})\n private boolean addHaplotypeForGGA( final Haplotype haplotype, final byte[] ref, final List<Haplotype> haplotypeList, final int activeRegionStart, final int activeRegionStop, final boolean FORCE_INCLUSION_FOR_GGA_MODE ) {\n if( haplotype == null ) { return false; }\n\n final SWPairwiseAlignment swConsensus = new SWPairwiseAlignment( ref, haplotype.getBases(), SWParameterSet.STANDARD_NGS );\n haplotype.setAlignmentStartHapwrtRef( swConsensus.getAlignmentStart2wrt1() );\n\n if( swConsensus.getCigar().toString().contains(\"S\") || swConsensus.getCigar().getReferenceLength() < 60 || swConsensus.getAlignmentStart2wrt1() < 0 ) { // protect against unhelpful haplotype alignments\n return false;\n }\n\n haplotype.setCigar( AlignmentUtils.leftAlignIndel(swConsensus.getCigar(), ref, haplotype.getBases(), swConsensus.getAlignmentStart2wrt1(), 0, true) );\n\n final int hapStart = ReadUtils.getReadCoordinateForReferenceCoordinate(haplotype.getAlignmentStartHapwrtRef(), haplotype.getCigar(), activeRegionStart, ReadUtils.ClippingTail.LEFT_TAIL, true);\n int hapStop = ReadUtils.getReadCoordinateForReferenceCoordinate( haplotype.getAlignmentStartHapwrtRef(), haplotype.getCigar(), activeRegionStop, ReadUtils.ClippingTail.RIGHT_TAIL, true );\n if( hapStop == ReadUtils.CLIPPING_GOAL_NOT_REACHED && activeRegionStop == haplotype.getAlignmentStartHapwrtRef() + haplotype.getCigar().getReferenceLength() ) {\n hapStop = activeRegionStop; // contract for getReadCoordinateForReferenceCoordinate function says that if read ends at boundary then it is outside of the clipping goal\n }\n byte[] newHaplotypeBases;\n // extend partial haplotypes to contain the full active region sequence\n if( hapStart == ReadUtils.CLIPPING_GOAL_NOT_REACHED && hapStop == ReadUtils.CLIPPING_GOAL_NOT_REACHED ) {\n newHaplotypeBases = ArrayUtils.addAll( ArrayUtils.addAll( ArrayUtils.subarray(ref, activeRegionStart, swConsensus.getAlignmentStart2wrt1()),\n haplotype.getBases()),\n ArrayUtils.subarray(ref, swConsensus.getAlignmentStart2wrt1() + swConsensus.getCigar().getReferenceLength(), activeRegionStop) );\n } else if( hapStart == ReadUtils.CLIPPING_GOAL_NOT_REACHED ) {\n newHaplotypeBases = ArrayUtils.addAll( ArrayUtils.subarray(ref, activeRegionStart, swConsensus.getAlignmentStart2wrt1()), ArrayUtils.subarray(haplotype.getBases(), 0, hapStop) );\n } else if( hapStop == ReadUtils.CLIPPING_GOAL_NOT_REACHED ) {\n newHaplotypeBases = ArrayUtils.addAll( ArrayUtils.subarray(haplotype.getBases(), hapStart, haplotype.getBases().length), ArrayUtils.subarray(ref, swConsensus.getAlignmentStart2wrt1() + swConsensus.getCigar().getReferenceLength(), activeRegionStop) );\n } else {\n newHaplotypeBases = ArrayUtils.subarray(haplotype.getBases(), hapStart, hapStop);\n }\n\n final Haplotype h = new Haplotype( newHaplotypeBases );\n final SWPairwiseAlignment swConsensus2 = new SWPairwiseAlignment( ref, h.getBases(), SWParameterSet.STANDARD_NGS );\n\n h.setAlignmentStartHapwrtRef( swConsensus2.getAlignmentStart2wrt1() );\n if ( haplotype.isArtificialHaplotype() ) {\n h.setArtificialEvent(haplotype.getArtificialEvent());\n }\n if( swConsensus2.getCigar().toString().contains(\"S\") || swConsensus2.getCigar().getReferenceLength() != activeRegionStop - activeRegionStart || swConsensus2.getAlignmentStart2wrt1() < 0 ) { // protect against unhelpful haplotype alignments\n return false;\n }\n\n h.setCigar( AlignmentUtils.leftAlignIndel(swConsensus2.getCigar(), ref, h.getBases(), swConsensus2.getAlignmentStart2wrt1(), 0, true) );\n\n if( FORCE_INCLUSION_FOR_GGA_MODE || !haplotypeList.contains(h) ) {\n haplotypeList.add(h);\n return true;\n } else {\n return false;\n }\n }", "public static void main(String[] args) {\n\t\tlong/* integer of higher order; more info than an int*/ currentTime = System.currentTimeMillis();\r\n\t\tString[] someString = new String[1000];\r\n\t\tstandardPopulate(someString);\r\n\t\tprint(someString);\r\n\t\tinitializingArraysExamples();\r\n\t\tlong endTime = System.currentTimeMillis();\r\n\r\n\t\tSystem.out.println(\"The process took \"\r\n\t\t\t\t+ (endTime-currentTime) + \" ms.\");\r\n\t\t\r\n\t\t\r\n\t}", "public void generateGenes() {\n\t\tfor(int i = 0; i < geneNumber; i++){\n\t\t\tdouble[] vector = new double[NUM_HEURISTICS];\n\t\t\tfor(int j = 0; j < NUM_HEURISTICS; j++){\n\t\t\t\t// To get a number in [-0.5, 0.5)\n\t\t\t\tvector[j] = Math.random() - 0.5;\n\t\t\t}\n\t\t\tGene newGene = new Gene(vector, true);\n\t\t\tgenepool.add(newGene);\n\t\t}\n\t}", "void print_statistics(long tot_arrived, long tot_processed, Double end_time){\n\n CloudEvent cloudEvent = new CloudEvent();\n CloudletEvent cletEvent = new CloudletEvent();\n PrintFile print = new PrintFile();\n\n\n // System response time & throughput\n\n float system_response_time = (float)(sum_service_times1_clet+ sum_service_times1_cloud + sum_service_times2_clet+ sum_service_times2_cloud)/ tot_processed;\n float response_time_class1 = (float) ((sum_service_times1_clet+ sum_service_times1_cloud)/ (completition_clet_type1 + completition_cloud_type1));\n float response_time_class2 = (float) ((sum_service_times2_clet+ sum_service_times2_cloud)/ (completition_clet_type2 + completition_cloud_type2));\n\n float lambda_tot = (float) (tot_arrived/end_time);\n float lambda_1 = (float)((arrival_type1_clet+arrival_type1_cloud)/end_time);\n float lambda_2 = (float)((arrival_type2_clet+arrival_type2_cloud)/end_time);\n\n\n // per-class effective cloudlet throughput\n\n float task_rate_clet1 = (float) ((float)completition_clet_type1 / end_time);\n float task_rate_clet2 = (float) ((float)completition_clet_type2 / end_time);\n\n\n // per-class cloud throughput\n\n float lambda_cloud1 = (float) ((arrival_type1_cloud)/end_time);\n float lambda_cloud2 = (float) ((arrival_type2_cloud)/end_time);\n\n\n // class response time and mean population\n\n float response_time_cloudlet = (float) (sum_service_times1_clet+ sum_service_times2_clet)/ (completition_clet_type1 + completition_clet_type2);\n float response_time_cloudlet1 = (float) sum_service_times1_clet/ completition_clet_type1;\n float response_time_cloudlet2 = (float) (sum_service_times2_clet/ completition_clet_type2);\n\n float response_time_cloud = (float) ((sum_service_times1_cloud+ sum_service_times2_cloud)/ (completition_cloud_type1 + completition_cloud_type2));\n float response_time_cloud1 = (float) (sum_service_times1_cloud/ completition_cloud_type1);\n float response_time_cloud2 = (float) (sum_service_times2_cloud/ completition_cloud_type2);\n\n // E[N] cloudlet\n float mean_cloudlet_jobs = cletEvent.mean_cloudlet_jobs_number();\n // E[N] class 1 cloudlet\n float mean_cloudlet_jobs1 = cletEvent.mean_cloudlet_jobs_number1();\n // E[N] class 2 cloudlet\n float mean_cloudlet_jobs2 = cletEvent.mean_cloudlet_jobs_number2();\n\n // E[N] cloud\n float mean_cloud_jobs = cloudEvent.mean_cloud_jobs_number();\n // E[N] class 1 cloud\n float mean_cloud_jobs1 = cloudEvent.mean_cloud_jobs_number1();\n // E[N] class 2 cloud\n float mean_cloud_jobs2 = cloudEvent.mean_cloud_jobs_number2();\n\n\n // Altre statistiche di interesse\n\n float lambda_clet = (float) ((arrival_type1_clet+ arrival_type2_clet)/end_time);\n float lambda_clet1 = (float) ((arrival_type1_clet)/end_time);\n float lambda_clet2 = (float) ((arrival_type2_clet)/end_time);\n float lambda_cloud = (float) ((arrival_type1_cloud+ arrival_type2_cloud)/end_time);\n\n double rate1_clet = mean_cloudlet_jobs1*0.45;\n double rate2_clet = mean_cloudlet_jobs2*0.27;\n\n\n\n NumberFormat numForm = NumberFormat.getInstance();\n numForm.setMinimumFractionDigits(6);\n numForm.setMaximumFractionDigits(6);\n numForm.setRoundingMode(RoundingMode.HALF_EVEN);\n\n\n System.out.println(\"\\n\\n\\n 1) SYSTEM RESPONSE TIME & THROUGHPUT \" + \"(GLOBAL & PER-CLASS)\");\n\n System.out.println(\"\\n Global System response time ...... = \" + numForm.format( system_response_time));\n System.out.println(\" Response time class 1 ...... = \" + numForm.format( response_time_class1));\n System.out.println(\" Response time class 2 ...... = \" + numForm.format( response_time_class2));\n\n System.out.println(\"\\n Global System throughput ...... = \" + numForm.format( lambda_tot));\n System.out.println(\" Throughput class 1 ...... = \" + numForm.format( lambda_1));\n System.out.println(\" Throughput class 2 ...... = \" + numForm.format( lambda_2));\n\n\n System.out.println(\"\\n\\n\\n 2) PER_CLASS EFFECTIVE CLOUDLET THROUGHPUT \");\n System.out.println(\" Task-rate cloudlet class 1 ...... = \" + numForm.format( rate1_clet));\n System.out.println(\" Task-rate cloudlet class 2 ...... = \" + numForm.format( rate2_clet));\n\n\n System.out.println(\"\\n\\n\\n 3) PER_CLASS CLOUD THROUGHPUT \");\n System.out.println(\" Throughput cloud class 1 ...... = \" + numForm.format( lambda_cloud1));\n System.out.println(\" Throughput cloud class 2 ...... = \" + numForm.format( lambda_cloud2));\n\n\n System.out.println(\"\\n\\n\\n 4) CLASS RESPONSE TIME & MEAN POPULATION \" + \"(CLOUDLET & CLOUD)\");\n\n System.out.println(\"\\n Response Time class 1 cloudlet ...... = \" + numForm.format( response_time_cloudlet1));\n System.out.println(\" Response Time class 2 cloudlet ...... = \" + numForm.format(response_time_cloudlet2));\n System.out.println(\" Response Time class 1 cloud ...... = \" + numForm.format( response_time_cloud1));\n System.out.println(\" Response Time class 2 cloud ...... = \" + numForm.format( response_time_cloud2));\n\n System.out.println(\"\\n Mean Population class 1 cloudlet ...... = \" + numForm.format( mean_cloudlet_jobs1));\n System.out.println(\" Mean Population class 2 cloudlet ...... = \" + numForm.format( mean_cloudlet_jobs2));\n System.out.println(\" Mean Population class 1 cloud ...... = \" + numForm.format( mean_cloud_jobs1));\n System.out.println(\" Mean Population class 2 cloud ...... = \" + numForm.format( mean_cloud_jobs2));\n\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"TraceA v1.04, 24.10.2015\");\r\n\t\t\r\n\t\tif (args.length < 2) {\r\n\t\t\tSystem.err.println (\"usage: TraceA <TDB-XML-File> <OSA-Log-File-Wildcard> ...\\n\");\r\n\t\t\tSystem.exit(-1);\r\n\t\t};\r\n\t\t\r\n\t\tfinal File tdb = new File (args[0]);\r\n\t\t\r\n\t\ttry {\r\n\t\t\tTdbProcessing.processTdb (tdb);\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.err.println(\"Error in TDB-XML: '\" + e.getMessage() + \"', in file: \" + args[0]);\r\n\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t\t\r\n\r\n\t\ttry {\r\n\t\t\tfor (int i=1; i < args.length; i++) {\r\n\t\t\t\tFile argi0 = new File (args[i]);\r\n\t\t\t\tString s0 = argi0.getAbsolutePath();\r\n\t \t\t\tFile argi = new File (s0);\r\n\t\t\t\tString wildcard = argi.getName();\r\n\t\t\t\tFile logfiledir = argi.getParentFile();\r\n\t\t\t\tJFnPatternMatcher patternmatcher = new JFnPatternMatcher (wildcard);\r\n\t\t\t\tFile logfiles[] = logfiledir.listFiles(patternmatcher);\r\n\t\t\t\t// TODO: order of logfiles[] is undefined !!!\r\n\t\t\t\tfor (final File logfile : logfiles) {\r\n\t\t\t\t\tprocessLog(logfile);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tevaluate();\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.err.println(\"Excption: \" + e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t\t\r\n \tSystem.out.println(\"ready.\\n\");\r\n\t}", "@Test\n public void testCanParseAllSamples() throws IOException {\n final File sampleDir = new File(\"sample_abc/\");\n final File[] abcFiles = sampleDir.listFiles((file) -> file.getName().endsWith(\".abc\"));\n\n for (File file : abcFiles) {\n try {\n final CharStream stream = new ANTLRFileStream(file.getAbsolutePath());\n AbcLexer lexer = new AbcLexer(stream);\n lexer.reportErrorsAsExceptions();\n\n AbcParser parser = new AbcParser(new CommonTokenStream(lexer));\n parser.addErrorListener(new BaseErrorListener() {\n public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line,\n int charPositionInLine, String msg, RecognitionException e) {\n return;\n }\n });\n parser.reportErrorsAsExceptions();\n\n parser.abcTune();\n } catch (Exception e) {\n System.err.println(file);\n throw e;\n }\n }\n }", "protected void treatSpeakers()\n\t{\n\t\tint nHP = (Integer) results[0];\n\t\tdouble Xdist = (Double)results[1];\n\t\tdouble Ydist = (Double)results[2];\n\t\tdouble shift = (Double)results[3];\n\t\tfloat height = (Float) results[4];\n\t\tint numHP1 = (Integer) results[5];\n\t\tboolean stereoOrder = (Boolean)results[6];\n\t\tint lastHP = (replace ? 0 : gp.speakers.size()-1);\n\t\tint numHP;\n\t\tint rangees = (nHP / 2);\n\t\tfloat X, Y;\n\t\tif(replace) gp.speakers = new Vector<HoloSpeaker>(nHP);\n\t\tnumHP1 = (evenp(nHP) ? numHP1 : 1 + numHP1);\n\t\t// Creation des HPs en fonction de ces parametres\n\t\tfor (int i = 1; i <= rangees; i++)\n\t\t\t{\n\t\t\t\t// on part du haut a droite, on descend puis on remonte\n\t\t\t\t\n\t\t\t\tX = (float) (-Xdist);\n\t\t\t\tY = (float) (shift + (Ydist * (rangees - 1) * 0.5) - (Ydist * (i - 1)));\n\t\t\t\tif(stereoOrder)\n\t\t\t\t\tnumHP = numHP1+(i-1)*2;\n\t\t\t\telse\n\t\t\t\t\tnumHP = (numHP1 + rangees + rangees - i) % nHP + 1;\n\t\t\t\tgp.speakers.add(new HoloSpeaker(X, Y, height, numHP+lastHP,-1));\n\t\t\t\t\n\t\t\t\tX = (float) (Xdist);\n\t\t\t\tY = (float) (shift + (Ydist * (rangees - 1) * 0.5) - (Ydist * (i - 1)));\n\t\t\t\tif(stereoOrder)\n\t\t\t\t\tnumHP = numHP1+(i-1)*2+1;\n\t\t\t\telse\n\t\t\t\t\tnumHP = (numHP1 + i - 1) % nHP + 1;\n\t\t\t\tgp.speakers.add(new HoloSpeaker(X, Y, height, numHP+lastHP,-1));\n\t\t\t\tinc();\n\t\t\t}\n\n\t\t\tif (!evenp(nHP))\n\t\t\t{\n\t\t\tX = 0;\n\t\t\tY = (float) (shift + (Ydist * (rangees - 1) * 0.5));\n\t\t\tnumHP = ((numHP1 - 1) % nHP) + 1;\n\t\t\tgp.speakers.add(new HoloSpeaker(X, Y, height, numHP+lastHP,-1));\n\t\t}\n\t}", "public static void main(String[] args){\r\n Language myLang = new Language(\"Willish\", 5, \"Mars\", \"verb-noun-verb-adjective\");\r\n Mayan mayan = new Mayan(\"Ki'che'\", 2330000);\r\n SinoTibetan sino1 = new SinoTibetan(\"Chinese Tibetan\", 100000);\r\n SinoTibetan sino2 = new SinoTibetan(\"Tibetan\", 200000);\r\n ArrayList<Language> langList = new ArrayList<Language>();\r\n langList.add(myLang);\r\n langList.add(mayan);\r\n langList.add(sino1);\r\n langList.add(sino2);\r\n \r\n for (Language allLangs : langList){\r\n allLangs.getInfo();\r\n }\r\n }", "public double empiricalLikelihood(int numSamples, ArrayList<ArrayList<Integer>> testing) {\n\t\tNCRPNode[] path = new NCRPNode[numLevels];\n\t\tNCRPNode node;\n\t\t\n\t\tpath[0] = rootNode;\n\n\t\tArrayList<Integer> fs;\n\t\tint sample, level, type, token, doc, seqLen;\n\n\t\tDirichlet dirichlet = new Dirichlet(numLevels, alpha);\n\t\tdouble[] levelWeights;\n\t\t//dictionary\n\t\tdouble[] multinomial = new double[numTypes];\n\n\t\tdouble[][] likelihoods = new double[ testing.size() ][ numSamples ];\n\t\t\n\t\t//for each sample\n\t\tfor (sample = 0; sample < numSamples; sample++) {\n\t\t\tArrays.fill(multinomial, 0.0);\n\n\t\t\t//select a path\n\t\t\tfor (level = 1; level < numLevels; level++) {\n\t\t\t\tpath[level] = path[level-1].selectExisting();\n\t\t\t}\n\t \n\t\t\t//sample level weights\n\t\t\tlevelWeights = dirichlet.nextDistribution();\n\t \n\t\t\t//for each words in dictionary\n\t\t\tfor (type = 0; type < numTypes; type++) {\n\t\t\t\t//for each topic\n\t\t\t\tfor (level = 0; level < numLevels; level++) {\n\t\t\t\t\tnode = path[level];\n\t\t\t\t\tmultinomial[type] +=\n\t\t\t\t\t\tlevelWeights[level] * \n\t\t\t\t\t\t(eta + node.typeCounts[type]) /\n\t\t\t\t\t\t(etaSum + node.totalTokens);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//convert to log\n\t\t\tfor (type = 0; type < numTypes; type++) {\n\t\t\t\tmultinomial[type] = Math.log(multinomial[type]);\n\t\t\t}\n\n\t\t\t//calculate document likelihoods \n\t\t\tfor (doc=0; doc<testing.size(); doc++) {\n fs = testing.get(doc);\n seqLen = fs.size();\n \n for (token = 0; token < seqLen; token++) {\n type = fs.get(token);\n likelihoods[doc][sample] += multinomial[type];\n }\n }\n\t\t}\n\t\n double averageLogLikelihood = 0.0;\n double logNumSamples = Math.log(numSamples);\n for (doc=0; doc<testing.size(); doc++) {\n \t\n \t//find the max for normalization, avoid overflow of sum\n double max = Double.NEGATIVE_INFINITY;\n for (sample = 0; sample < numSamples; sample++) {\n if (likelihoods[doc][sample] > max) {\n max = likelihoods[doc][sample];\n }\n }\n\n double sum = 0.0;\n //normalize \n for (sample = 0; sample < numSamples; sample++) {\n sum += Math.exp(likelihoods[doc][sample] - max);\n }\n\n //calc average\n averageLogLikelihood += Math.log(sum) + max - logNumSamples;\n }\n\n\t\treturn averageLogLikelihood;\n }" ]
[ "0.6090553", "0.5699476", "0.5572057", "0.544278", "0.51581347", "0.5144002", "0.5089874", "0.5086845", "0.49968785", "0.497307", "0.4966495", "0.49226713", "0.48920146", "0.48797348", "0.48691142", "0.48639128", "0.48469388", "0.4841646", "0.4830717", "0.4826987", "0.4819725", "0.481408", "0.48140123", "0.48000175", "0.47994608", "0.47956103", "0.4794988", "0.4792912", "0.4790147", "0.47758433", "0.47683218", "0.47645056", "0.4762622", "0.47402543", "0.47344205", "0.4726782", "0.4721241", "0.47180563", "0.4713692", "0.47135884", "0.47059596", "0.47004193", "0.46953896", "0.46823815", "0.4660281", "0.46587905", "0.46567288", "0.46557125", "0.46481076", "0.46246845", "0.4605973", "0.45963195", "0.45886287", "0.45838967", "0.4581721", "0.45589373", "0.4545981", "0.4543409", "0.45407137", "0.45382157", "0.45320198", "0.4529941", "0.45283252", "0.45268863", "0.45097935", "0.45025438", "0.45004913", "0.4496901", "0.44841015", "0.44823802", "0.44791478", "0.44769913", "0.4476321", "0.44756413", "0.4474791", "0.44648576", "0.44613522", "0.44610158", "0.44606397", "0.44579285", "0.44449395", "0.4442535", "0.44382283", "0.443556", "0.44301587", "0.44228327", "0.44216406", "0.44205886", "0.44158992", "0.44140568", "0.4406991", "0.44039327", "0.4399334", "0.43992248", "0.43990114", "0.43939883", "0.4387815", "0.43844202", "0.43600938", "0.43576422" ]
0.6467147
0
For a particular event described in inputVC, form PL vector for each sample by looking into allele read map and filling likelihood matrix for each allele
protected GenotypesContext calculateGLsForThisEvent(final ReadLikelihoods<Allele> readLikelihoods, final VariantContext mergedVC, final List<Allele> noCallAlleles ) { Utils.nonNull(readLikelihoods, "readLikelihoods"); Utils.nonNull(mergedVC, "mergedVC"); final List<Allele> vcAlleles = mergedVC.getAlleles(); final AlleleList<Allele> alleleList = readLikelihoods.numberOfAlleles() == vcAlleles.size() ? readLikelihoods : new IndexedAlleleList<>(vcAlleles); final GenotypingLikelihoods<Allele> likelihoods = genotypingModel.calculateLikelihoods(alleleList,new GenotypingData<>(ploidyModel,readLikelihoods)); final int sampleCount = samples.numberOfSamples(); final GenotypesContext result = GenotypesContext.create(sampleCount); for (int s = 0; s < sampleCount; s++) { result.add(new GenotypeBuilder(samples.getSample(s)).alleles(noCallAlleles).PL(likelihoods.sampleLikelihoods(s).getAsPLs()).make()); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void processData() {\n\t\tfloat S, M, VPR, VM;\n\t\tgetCal();\n\t\tgetTimestamps();\n\t\t\n \n\t\tfor(int i = 0; i < r.length; i++) {\n\t\t\t//get lux\n\t\t\tlux[i] = RGBcal[0]*vlam[0]*r[i] + RGBcal[1]*vlam[1]*g[i] + RGBcal[2]*vlam[2]*b[i];\n \n\t\t\t//get CLA\n\t\t\tS = RGBcal[0]*smac[0]*r[i] + RGBcal[1]*smac[1]*g[i] + RGBcal[2]*smac[2]*b[i];\n\t\t\tM = RGBcal[0]*mel[0]*r[i] + RGBcal[1]*mel[1]*g[i] + RGBcal[2]*mel[2]*b[i];\n\t\t\tVPR = RGBcal[0]*vp[0]*r[i] + RGBcal[1]*vp[1]*g[i] + RGBcal[2]*vp[2]*b[i];\n\t\t\tVM = RGBcal[0]*vmac[0]*r[i] + RGBcal[1]*vmac[1]*g[i] + RGBcal[2]*vmac[2]*b[i];\n \n\t\t\tif(S > CLAcal[2]*VM) {\n\t\t\t\tCLA[i] = M + CLAcal[0]*(S - CLAcal[2]*VM) - CLAcal[1]*683*(1 - pow((float)2.71, (float)(-VPR/4439.5)));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tCLA[i] = M;\n\t\t\t}\n\t\t\tCLA[i] = CLA[i]*CLAcal[3];\n\t\t\tif(CLA[i] < 0) {\n\t\t\t\tCLA[i] = 0;\n\t\t\t}\n \n\t\t\t//get CS\n\t\t\tCS[i] = (float) (.7*(1 - (1/(1 + pow((float)(CLA[i]/355.7), (float)1.1026)))));\n \n\t\t\t//get activity\n\t\t\ta[i] = (float) (pow(a[i], (float).5) * .0039 * 4);\n\t\t}\n\t}", "public void sample_V() {\n\t\t//Note, sumV and sumVVT are update in the update function itself. Hence, when\n\t\t//sample_V is called after the 1 iteration of all vertices, we already have the sum.\n\t\t\n\t\t//meanV = (SUM V_j)/N\n\t\tRealVector meanV = params.sumV.mapMultiply(1.0/datasetDesc.getNumItems());\n\t\t//meanS = (SUM (V_j*V_j')/N)\n\t\tRealMatrix meanS = params.sumVVT.scalarMultiply(1.0/datasetDesc.getNumItems());\n\t\t\n\t\t//mu0 = (beta0*mu0 + meanV)/(beta0 + N)\n\t\tRealVector mu0_ = (params.mu0_V.mapMultiply(params.beta0_V).add(meanV)).mapDivide((params.beta0_V + datasetDesc.getNumItems()));\n\t\t\n\t\tdouble beta0_ = params.beta0_V + datasetDesc.getNumItems();\n\t\tint nu0_ = params.nu0_V + datasetDesc.getNumItems();\n\t\t\n\t\t//W0 = inv( inv(W0) + N*meanS + (beta0*N/(beta0 + N))(mu0 - meanU)*(mu0 - meanU)'\n\t\tRealVector tmp = params.mu0_V.subtract(meanV);\n\t\tRealMatrix mu0_d_meanV_T = tmp.outerProduct(tmp); \n\t\tmu0_d_meanV_T = mu0_d_meanV_T.scalarMultiply((params.beta0_V*datasetDesc.getNumItems()/(params.beta0_V + datasetDesc.getNumItems())));\n\t\tRealMatrix invW0_ = params.invW0_V.add(params.sumVVT).add(mu0_d_meanV_T);\n\n\t\t//Update all the values.\n\t\tparams.mu0_V = mu0_;\n\t\tparams.beta0_V = beta0_;\n\t\tparams.nu0_V = nu0_;\n\t\tparams.invW0_V = invW0_;\n\t\tparams.W0_V = (new LUDecompositionImpl(invW0_)).getSolver().getInverse();\n\t\t\n\t\t//Sample lambda_V and mu_V from the Gaussian Wishart distribution\n\t\t// http://en.wikipedia.org/wiki/Normal-Wishart_distribution#Generating_normal-Wishart_random_variates\n\t\t//Draw lambda_V from Wishart distribution with scale matrix w0_U.\n\t\tparams.lambda_V = sampleWishart(params.invW0_V, params.nu0_V);\n\t\t//Compute cov = inv(beta0*lambda) \n\t\tRealMatrix cov = (new LUDecompositionImpl(params.lambda_V.scalarMultiply(params.beta0_V))).getSolver().getInverse();\n\t\t//Draw mu_V from multivariate normal dist with mean mu0_V and covariance inv(beta0_V*lambda)\n\t\tMultivariateNormalDistribution dist = new MultivariateNormalDistribution(params.mu0_V.toArray(), \n\t\t\t\tcov.getData());\n\t\tparams.mu_V = new ArrayRealVector(dist.sample());\n\t\t\n\t\t//Reset the sum of latent factors.\n\t\tparams.sumV.mapMultiply(0);\n\t\tparams.sumVVT.scalarMultiply(0);\n\t}", "public int perform_LMVM() {\n if (_inequality_width > 0) {\n int nvars = _fb.Size() * 2;\n double[] x = new double[nvars];\n \n // INITIAL POINT\n for (int i = 0; i < nvars / 2; i++) {\n x[i] = _va.get(i);\n x[i + _fb.Size()] = _vb.get(i);\n }\n \n // int info = BLMVMSolve(x, nvars);\n \n for (int i = 0; i < nvars / 2; i++) {\n _va.set(i, x[i]);\n _vb.set(i, x[i + _fb.Size()]);\n _vl.set(i, _va.get(i) - _vb.get(i));\n }\n \n return 0;\n } else {\n \n int nvars = _fb.Size();\n double[] x = new double[nvars];\n \n // INITIAL POINT\n for (int i = 0; i < nvars; i++) {\n x[i] = _vl.get(i);\n }\n \n // int info = BLMVMSolve(x, nvars);\n \n for (int i = 0; i < nvars; i++) {\n _vl.set(i, x[i]);\n }\n \n return 0;\n }\n }", "private void findVOIs(short[] cm, ArrayList<Integer> xValsAbdomenVOI, ArrayList<Integer> yValsAbdomenVOI, short[] srcBuffer, ArrayList<Integer> xValsVisceralVOI, ArrayList<Integer> yValsVisceralVOI) {\r\n \r\n // angle in radians\r\n double angleRad;\r\n \r\n // the intensity profile along a radial line for a given angle\r\n short[] profile;\r\n \r\n // the x, y location of all the pixels along a radial line for a given angle\r\n int[] xLocs;\r\n int[] yLocs;\r\n try {\r\n profile = new short[xDim];\r\n xLocs = new int[xDim];\r\n yLocs = new int[xDim];\r\n } catch (OutOfMemoryError error) {\r\n System.gc();\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT allocate profile\");\r\n return;\r\n }\r\n \r\n // the number of pixels along the radial line for a given angle\r\n int count;\r\n \r\n // The threshold value for muscle as specified in the JCAT paper\r\n int muscleThresholdHU = 16;\r\n \r\n for (int angle = 0; angle < 360; angle += angularResolution) {\r\n count = 0;\r\n int x = cm[0];\r\n int y = cm[1];\r\n int yOffset = y * xDim;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n // increment x each step\r\n scaleFactor = Math.tan(angleRad);\r\n while (x < xDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n // walk out in x and compute the value of y for the given radial line\r\n x++;\r\n y = cm[1] - (int)((x - cm[0]) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n \r\n // x, y is a candidate abdomen VOI point\r\n // if there are more abdomenTissueLabel pixels along the radial line,\r\n // then we stopped prematurely\r\n \r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends and the muscle starts\r\n \r\n // start at the end of the profile array since its order is from the\r\n // center-of-mass to the abdomen voi point\r\n \r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx <= 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n break;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n // decrement y each step\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n while (y > 0 && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n // walk to the top of the image and compute values of x for the given radial line\r\n y--;\r\n x = cm[0] + (int)((cm[1] - y) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n // decrement x each step\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n while (x > 0 && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n x--;\r\n y = cm[1] - (int)((cm[0] - x) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n\r\n } else if (angle > 225 && angle <= 315) {\r\n // increment y each step\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n while (y < yDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n y++;\r\n x = cm[0] - (int)((y - cm[1]) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n\r\n }\r\n } // end for (angle = 0; ...\r\n\r\n }", "void calculateLogLikelihoods(double[] fPartials, double[] fFrequencies, double[] fOutLogLikelihoods)\n\t{\n int v = 0;\n\t\tfor (int k = 0; k < m_nPatterns; k++) {\n\n double sum = 0.0;\n\t\t\tfor (int i = 0; i < m_nStates; i++) {\n\n\t\t\t\tsum += fFrequencies[i] * fPartials[v];\n\t\t\t\tv++;\n\t\t\t}\n fOutLogLikelihoods[k] = Math.log(sum) + getLogScalingFactor(k);\n\t\t}\n\t}", "public void mainProcess(java.util.ArrayList<double[]> dataPoint, String dist) throws Exception {\n double[][] S = initAP(dataPoint);\r\n// double[][] S = readData(fn);\r\n double[][] A = new double[N][N];\r\n double[][] R = new double[N][N];\r\n //////////////////////////////////////\r\n\tfor(int m=0; m<iter; m++) {\r\n// System.out.println(m);\r\n for(int i=0; i<N; i++) {\r\n for(int k=0; k<N; k++) {\r\n double max = -1e100;\r\n for(int kk=0; kk<k; kk++) {\r\n if(S[i][kk]+A[i][kk]>max)\r\n max = S[i][kk]+A[i][kk];\r\n }\r\n for(int kk=k+1; kk<N; kk++) {\r\n if(S[i][kk]+A[i][kk]>max)\r\n max = S[i][kk]+A[i][kk];\r\n }\r\n R[i][k] = (1-lambda)*(S[i][k] - max) + lambda*R[i][k];\r\n }\r\n }\r\n for(int i=0; i<N; i++) {\r\n for(int k=0; k<N; k++) {\r\n if(i==k) {\r\n double sum = 0.0;\r\n for(int ii=0; ii<i; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n for(int ii=i+1; ii<N; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n A[i][k] = (1-lambda)*sum + lambda*A[i][k];\r\n } else {\r\n double sum = 0.0;\r\n int maxik = Math.max(i, k);\r\n int minik = Math.min(i, k);\r\n for(int ii=0; ii<minik; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n for(int ii=minik+1; ii<maxik; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n for(int ii=maxik+1; ii<N; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n A[i][k] = (1-lambda)*Math.min(0.0, R[k][k]+sum) + lambda*A[i][k];\r\n }\r\n }\r\n }\r\n }\r\n \r\n//\tdouble E[N][N] = {0};\r\n double[][] E = new double[N][N];\r\n\r\n//\tvector<int> center;\r\n java.util.ArrayList<Integer> center = new java.util.ArrayList<>();\r\n for(int i=0; i<N; i++) {\r\n E[i][i] = R[i][i] + A[i][i];\r\n if(E[i][i]>0) {\r\n center.add(i);\r\n }\r\n }\r\n// int idx[N] = {0};\r\n int idx[] = new int[N];\r\n\r\n\tfor(int i=0; i<N; i++) {\r\n int idxForI = 0;\r\n double maxSim = -1e100;\r\n for(int j=0; j<center.size(); j++) {\r\n int c = center.get(j);\r\n if (S[i][c]>maxSim) {\r\n maxSim = S[i][c];\r\n idxForI = c;\r\n }\r\n }\r\n idx[i] = idxForI;\r\n }\r\n// java.util.HashMap<Integer, String> colorMap = new java.util.HashMap<>();\r\n java.util.HashMap<Integer, Integer> idcMap = new java.util.HashMap<>();\r\n java.util.HashSet<Integer> idSet = new java.util.HashSet<>();\r\n for(int i=0; i<N; i++) {\r\n idcMap.put(i, idx[i]);\r\n idSet.add(idx[i]);\r\n// System.out.println(idx[i]+1);\r\n\t}\r\n java.io.FileWriter out = new java.io.FileWriter(dist);\r\n java.util.HashMap<Integer, String> colorMap = getColorMap(idSet);\r\n for(int i=0; i<N; i++){\r\n double d[] = dataPoint.get(i);\r\n if(idSet.contains(i)){\r\n out.write(i+\"\\t\"+d[0]+\"\\t\"+d[1]+\"\\t\"+colorMap.get(i)+\"\\n\");\r\n }\r\n else{\r\n out.write(i+\"\\t\"+d[0]+\"\\t\"+d[1]+\"\\t\"+colorMap.get(idcMap.get(i))+\"\\n\");\r\n }\r\n// System.out.println(i+\"\\t\"+d[0]+\"\\t\"+d[1]+\"\\t\"+colorMap.get(idcMap.get(i)));\r\n }\r\n out.close();\r\n// System.out.println(colorMap);\r\n /////////////////////////////////////////\r\n }", "public void controlPointsChanged(List<Coordinates> lcp) {\n // sort the control points by x position.\n // this makes things easier later when we paint the function.\n lcp.sort(\n (point1,point2) -> Integer.compare(point1.getX(),point2.getX())\n );\n\n // collect the points in an array before doing the calculations.\n // again, this makes things easier for us.\n controlPoints=lcp.toArray(new Coordinates[0]);\n n=controlPoints.length;\n if(n<2) {\n // nothing to do here\n return;\n }\n double []X = new double[n];\n double []Y = new double[n];\n for(int i =0;i<n;i++){\n \tX[i]=controlPoints[i].getX();\n \tY[i]=controlPoints[i].getY();\n }\n // Construct the linear system S*C=T with n-2 equations.\n // The matrix S contains the left hand side of the equations on slide 13.\n // The matrix Z contains the right hand side of the equations on slide 13.\n double[][] S=new double[n-2][n-2];\n double[] Z=new double[n-2];\n \n // Fill the matrix S and the vector Z and solve S*C=T to get c_2 to c_{n-1}.\n for(int i = 0; i< n-3;i++){\n \tS[i][i]=2*delta(X,i+1,0);\n \tS[i+1][i]=delta(X,i+2,-1);\n \tS[i][i+1]=delta(X,i+1,1);\n \tZ[i]=z(Y,X,i);\n }\n S[n-2][n-2]=2*delta(X,n-1,0);\n \n C= EliminationGaussLegendre.solve(S, Z);\n \n // Calculate the n-1 coefficients b_i and d_i.\n // Note that you need all c_i here (but you know that c_1 and c_n are zero).\n //a_i = y_i;\n for(int i=1 ; i<n ; i++){\n \tD[i-1]=d(Y,X,i-1);\n \tB[i-1]=b(Y,C,X,i-1);\n }\n \n }", "public int perform_GIS(int C) {\n // cerr << \"C = \" << C << endl;\n C = 1;\n // cerr << \"performing AGIS\" << endl;\n ArrayList<Double> pre_v = newArrayList(_vl.size(), 0.0); // jenia: same size as _vl's because later it can set _vl\n double pre_logl = -999999;\n for (int iter = 0; iter < 200; iter++) {\n double logl = update_model_expectation();\n // fprintf(stderr, \"iter = %2d C = %d f = %10.7f train_err = %7.5f\", iter, C, logl, _train_error);\n if (_heldout.size() > 0) {\n // double hlogl = heldout_likelihood();\n // fprintf(stderr, \" heldout_logl(err) = %f (%6.4f)\", hlogl, _heldout_error);\n }\n // cerr << endl;\n \n if (logl < pre_logl) {\n C += 1;\n _vl = pre_v;\n iter--;\n continue;\n }\n \n if (C > 1 && iter % 10 == 0) C--;\n \n pre_logl = logl;\n pre_v = _vl; // TODO jenia this doesn't have any effect\n assert (_vl.size() >= _fb.Size());\n for (int i = 0; i < _fb.Size(); i++) {\n double coef = _vee.get(i) / _vme.get(i);\n plusEq(_vl, i, log(coef) / C);\n }\n }\n // cerr << endl;\n return 0; // jenia: the original didn't return anything explicitly\n }", "private void Perform_LPM_III()\n {\n int zindex = get_z();\n int d = Utils.GetOperand_XXXXXXX11111XXXX(mMBR);\n int wordlocation = zindex >> 1;\n\n try\n {\n if (Utils.bit0(zindex))\n set_reg(d,(program_memory[wordlocation] & 0xff00) >> 8);\n else\n set_reg(d,program_memory[wordlocation] & 0x00ff);\n }\n catch (RuntimeException e) { } \n inc_z();\n clockTick();\n clockTick();\n return;\n }", "private void collectValues\n (int[] i, int i0, int i1, long[] V) {\n for (int o=i0; o<i1; o++) // 1\n V[o] = read(i[o]); // 1\n }", "public void transformMEToAppLogNVPair(\n final MitchellEnvelopeDocument mitchellEnvelopeDocument,\n final EventDetails eventDetailsIn)\n throws MitchellException\n {\n final String METHOD_NAME = \"transformMEToAppLogNVPair\";\n logger.entering(CLASS_NAME, METHOD_NAME);\n final String inputMEXML = mitchellEnvelopeDocument.xmlText();\n final String appLogXSLFilePath = this.systemConfigProxy\n .getSettingValue(\"/AppraisalAssignment/AppLogging/AppLoggingTemplateBaseDir\")\n + File.separator\n + this.systemConfigProxy\n .getSettingValue(\"/AppraisalAssignment/AppLogging/AppLoggingTemplateXslFile\");\n if (logger.isLoggable(java.util.logging.Level.INFO)) {\n logger.info(\"AppLoggingXSLFilePath is ::\" + appLogXSLFilePath);\n logger.info(\"Input ME is ::\" + inputMEXML);\n }\n\n try {\n\n final XsltTransformer xsltTranformer = new XsltTransformer(\n appLogXSLFilePath);\n xsltTranformer.createTransformer();\n final String appLogXML = xsltTranformer.transformXmlString(inputMEXML);\n if (appLogXML == null) {\n throw new MitchellException(CLASS_NAME, METHOD_NAME,\n \"Null String returned while tranforming the MitchellEnvelopeDocument!!\");\n }\n if (logger.isLoggable(java.util.logging.Level.INFO)) {\n logger.info(\"APPLogXML Is:: \" + appLogXML);\n }\n final InputStream inputAppLogStream = new ByteArrayInputStream(\n appLogXML.getBytes());\n\n final SAXParserFactory saxParserfactory = SAXParserFactory.newInstance();\n final SAXParser saxParser = saxParserfactory.newSAXParser();\n final DefaultHandler defaultHandler = new DefaultHandler() {\n StringBuffer textBuffer;\n\n public void startElement(final String uri, final String localName,\n final String qName, final Attributes attributes)\n throws SAXException\n {\n }\n\n public void endElement(final String uri, final String localName,\n final String qName)\n throws SAXException\n {\n\n if (!\"root\".equals(qName)) {\n if (logger.isLoggable(java.util.logging.Level.FINE)) {\n logger.fine(\"Key::\" + qName);\n logger.fine(\"Value::\" + textBuffer.toString());\n }\n final NameValuePair nvPair = eventDetailsIn.addNewNameValuePair();\n nvPair.setName(qName);\n nvPair.addValue(textBuffer.toString());\n }\n textBuffer = null;\n }\n\n public void characters(final char buf[], final int offset, final int len)\n throws SAXException\n {\n final String textValue = new String(buf, offset, len);\n if (textBuffer == null) {\n textBuffer = new StringBuffer(textValue);\n\n } else {\n\n textBuffer.append(textValue);\n }\n }\n };\n saxParser.parse(inputAppLogStream, defaultHandler);\n if (logger.isLoggable(java.util.logging.Level.INFO)) {\n logger.info(\"Parsing completed!!\");\n }\n } catch (final MitchellException me) {\n throw me;\n } catch (final Exception exception) {\n logger.severe(\"Unexpected exception occured::\" + exception.getMessage());\n\n throw new MitchellException(CLASS_NAME, METHOD_NAME,\n \"Unexpected exception occured!!\", exception);\n }\n logger.exiting(CLASS_NAME, METHOD_NAME);\n }", "private final void silk_PLC_update(final Jsilk_decoder_control psDecCtrl)\r\n\t{\r\n\t\tfinal Jsilk_PLC_struct psPLC = this.sPLC;\r\n\r\n\t\t/* Update parameters used in case of packet loss */\r\n\t\tthis.prevSignalType = this.indices.signalType;\r\n\t\tint LTP_Gain_Q14 = 0;\r\n\t\tfinal int nb_subfr1 = this.nb_subfr - 1;// java\r\n\t\tif( this.indices.signalType == Jdefine.TYPE_VOICED ) {\r\n\t\t\t/* Find the parameters for the last subframe which contains a pitch pulse */\r\n\t\t\tfor( int j = 0, je = psDecCtrl.pitchL[ nb_subfr1 ], nb_j = nb_subfr1; j * this.subfr_length < je; j++, nb_j-- ) {\r\n\t\t\t\tif( j == this.nb_subfr ) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tint temp_LTP_Gain_Q14 = 0;\r\n\t\t\t\tfinal int nb_j_o = nb_j * Jdefine.LTP_ORDER;// java\r\n\t\t\t\tint i = 0;\r\n\t\t\t\tdo {\r\n\t\t\t\t\ttemp_LTP_Gain_Q14 += psDecCtrl.LTPCoef_Q14[ nb_j_o + i ];\r\n\t\t\t\t} while( ++i < Jdefine.LTP_ORDER );\r\n\t\t\t\tif( temp_LTP_Gain_Q14 > LTP_Gain_Q14 ) {\r\n\t\t\t\t\tLTP_Gain_Q14 = temp_LTP_Gain_Q14;\r\n\t\t\t\t\tSystem.arraycopy( psDecCtrl.LTPCoef_Q14, nb_j_o, psPLC.LTPCoef_Q14, 0, Jdefine.LTP_ORDER );\r\n\r\n\t\t\t\t\tpsPLC.pitchL_Q8 = psDecCtrl.pitchL[ nb_j ] << 8;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// silk_memset( psPLC.LTPCoef_Q14, 0, Jdefine.LTP_ORDER * sizeof( opus_int16 ) );\r\n\t\t\tint i = 0;\r\n\t\t\tdo {\r\n\t\t\t\tpsPLC.LTPCoef_Q14[i] = 0;\r\n\t\t\t} while( ++i < Jdefine.LTP_ORDER );\r\n\t\t\tpsPLC.LTPCoef_Q14[ Jdefine.LTP_ORDER / 2 ] = (short)LTP_Gain_Q14;\r\n\r\n\t\t\t/* Limit LT coefs */\r\n\t\t\tif( LTP_Gain_Q14 < V_PITCH_GAIN_START_MIN_Q14 ) {\r\n\t\t\t\tfinal int tmp = V_PITCH_GAIN_START_MIN_Q14 << 10;\r\n\t\t\t\tfinal int scale_Q10 = ( tmp / ( LTP_Gain_Q14 > 1 ? LTP_Gain_Q14 : 1 ) );\r\n\t\t\t\ti = 0;\r\n\t\t\t\tdo {\r\n\t\t\t\t\tpsPLC.LTPCoef_Q14[ i ] = (short)(((int)psPLC.LTPCoef_Q14[ i ] * scale_Q10) >> 10);\r\n\t\t\t\t} while( ++i < Jdefine.LTP_ORDER );\r\n\t\t\t} else if( LTP_Gain_Q14 > V_PITCH_GAIN_START_MAX_Q14 ) {\r\n\t\t\t\tfinal int tmp = V_PITCH_GAIN_START_MAX_Q14 << 14;\r\n\t\t\t\tfinal int scale_Q14 = ( tmp / ( LTP_Gain_Q14 > 1 ? LTP_Gain_Q14 : 1 ) );\r\n\t\t\t\ti = 0;\r\n\t\t\t\tdo{\r\n\t\t\t\t\tpsPLC.LTPCoef_Q14[ i ] = (short)(( (int)psPLC.LTPCoef_Q14[ i ] * scale_Q14 ) >> 14);\r\n\t\t\t\t} while( ++i < Jdefine.LTP_ORDER );\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tpsPLC.pitchL_Q8 = ( this.fs_kHz * 18 ) << 8;\r\n\t\t\t// silk_memset( psPLC.LTPCoef_Q14, 0, Jdefine.LTP_ORDER * sizeof( opus_int16 ));\r\n\t\t\tint i = 0;\r\n\t\t\tdo {\r\n\t\t\t\tpsPLC.LTPCoef_Q14[i] = 0;\r\n\t\t\t} while( ++i < Jdefine.LTP_ORDER );\r\n\t\t}\r\n\r\n\t\t/* Save LPC coeficients */\r\n\t\tSystem.arraycopy( psDecCtrl.PredCoef_Q12[ 1 ], 0, psPLC.prevLPC_Q12, 0, this.LPC_order );\r\n\t\tpsPLC.prevLTP_scale_Q14 = (short)psDecCtrl.LTP_scale_Q14;\r\n\r\n\t\t/* Save last two gains */\r\n\t\tpsPLC.prevGain_Q16[0] = psDecCtrl.Gains_Q16[ nb_subfr1 - 1 ];\r\n\t\tpsPLC.prevGain_Q16[1] = psDecCtrl.Gains_Q16[ nb_subfr1 ];\r\n\r\n\t\tpsPLC.subfr_length = this.subfr_length;\r\n\t\tpsPLC.nb_subfr = this.nb_subfr;\r\n\t}", "public static void YM3812UpdateOne(FM_OPL OPL, ShortPtr buffer, int length) {\n int i;\n int data;\n ShortPtr buf = buffer;\n long amsCnt = OPL.amsCnt;\n long vibCnt = OPL.vibCnt;\n int rythm = ((OPL.rythm & 0x20) & 0xFF);\n OPL_CH CH;\n int R_CH;\n if ((Object) OPL != cur_chip) {\n cur_chip = OPL;\n /* channel pointers */\n S_CH = OPL.P_CH;\n E_CH = 9;// S_CH[9];\n /* rythm slot */\n SLOT7_1 = S_CH[7].SLOT[SLOT1];\n SLOT7_2 = S_CH[7].SLOT[SLOT2];\n SLOT8_1 = S_CH[8].SLOT[SLOT1];\n SLOT8_2 = S_CH[8].SLOT[SLOT2];\n /* LFO state */\n amsIncr = OPL.amsIncr;\n vibIncr = OPL.vibIncr;\n ams_table = OPL.ams_table;\n vib_table = OPL.vib_table;\n }\n R_CH = rythm != 0 ? 6 : E_CH;\n for (i = 0; i < length; i++) {\n /* channel A channel B channel C */\n /* LFO */\n ams = ams_table.read((int) ((amsCnt = (amsCnt + amsIncr) & 0xFFFFFFFFL) >> AMS_SHIFT));//recheck\n vib = vib_table.read((int) ((vibCnt = (vibCnt + vibIncr) & 0xFFFFFFFFL) >> VIB_SHIFT));//recheck\n outd[0] = 0;\n\n /* FM part */\n for (int k = 0; k != R_CH; k++) {\n CH = S_CH[k];\n OPL_CALC_CH(CH);\n }\n /* Rythn part */\n if (rythm != 0) {\n OPL_CALC_RH(S_CH);\n }\n /* limit check */\n if (outd[0] > OPL_MAXOUT) {\n data = OPL_MAXOUT;\n } else if (outd[0] < OPL_MINOUT) {\n data = OPL_MINOUT;\n } else {\n data = outd[0];\n }\n //data = Limit(outd[0], OPL_MAXOUT, OPL_MINOUT);\n /* store to sound_old buffer */\n buf.write(i, (short) (data >> OPL_OUTSB));\n }\n OPL.amsCnt = (int) amsCnt;\n OPL.vibCnt = (int) vibCnt;\n }", "private void updateLambdaMatrix(final double[] a, Kernel<T> kernel, final List<TrainingSample<T>> l)\n\t{\n\t\tfinal double [][] matrix = kernel.getKernelMatrix(l);\n\t\tlambda_matrix = new double[matrix.length][matrix.length];\n\t\t\n//\t\tfor(int x = 0 ; x < matrix.length; x++)\n//\t\t{\n//\t\t\tint l1 = l.get(x).label;\n//\t\t\tfor(int y = x ; y < matrix.length; y++)\n//\t\t\t{\n//\t\t\t\tif(matrix[x][y] == 0)\n//\t\t\t\t\tcontinue;\n//\t\t\t\tint l2 = l.get(y).label;\n//\t\t\t\tlambda_matrix[x][y] = -0.5 * l1 * l2 * a[x] * a[y] * matrix[x][y];\n//\t\t\t\tlambda_matrix[y][x] = lambda_matrix[x][y];\n//\t\t\t}\n//\t\t}\n//\t\t\n\t\teprintln(3, \"+ update lambda\");\n\t\tThreadedMatrixOperator factory = new ThreadedMatrixOperator()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void doLine(int index, double[] line) {\n\t\t\t\tint l1 = l.get(index).label;\n\t\t\t\tdouble al1 = -0.5 * a[index]*l1;\n\t\t\t\tfor(int j = line.length-1 ; j != 0 ; j--)\n\t\t\t\t{\n\t\t\t\t\tint l2 = l.get(j).label;\n\t\t\t\t\tline[j] = al1 * l2 * a[j] * matrix[index][j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\t\t};\n\t\t\n\t\tlambda_matrix = factory.getMatrix(lambda_matrix);\n\t}", "public static void enrichmentMaxLowMem(String szinputsegment,String szinputcoorddir,String szinputcoordlist,\n\t\t\t\t int noffsetleft, int noffsetright,\n int nbinsize, boolean bcenter,boolean bunique, boolean busesignal,String szcolfields,\n\t\t\t\t boolean bbaseres, String szoutfile,boolean bcolscaleheat,Color theColor,String sztitle, \n\t\t\t\t\t String szlabelmapping, boolean bprintimage, boolean bstringlabels, boolean bbrowser) throws IOException\n {\n\n\n //for each enrichment category and state label gives a count of how often\n //overlapped by a segment optionally with signal\n\n String szLine;\n String[] files;\n\n if (szinputcoordlist == null)\n {\n File dir = new File(szinputcoorddir);\n\t //we don't have a specific list of files to include\n\t //will use all files in the directory\n\t if (dir.isDirectory())\t \n\t {\n\t //throw new IllegalArgumentException(szinputcoorddir+\" is not a directory!\");\n\t //added in v1.11 to skip hidden files\n\t String[] filesWithHidden = dir.list();\n\t int nnonhiddencount = 0;\n\t for (int nfile = 0; nfile < filesWithHidden.length; nfile++)\n\t {\n\t if (!(new File(filesWithHidden[nfile])).isHidden())\n\t\t{\n\t\t nnonhiddencount++;\n\t\t}\n\t }\t \n\n\t int nactualindex = 0;\n\t files = new String[nnonhiddencount];// dir.list(); \n\t if (nnonhiddencount == 0)\n\t {\n\t throw new IllegalArgumentException(\"No files found in \"+szinputcoorddir);\n\t }\n\n for (int nfile = 0; nfile < filesWithHidden.length; nfile++)\n\t {\n\t if (!(new File(filesWithHidden[nfile])).isHidden())\n\t {\n\t files[nactualindex] = filesWithHidden[nfile];\n\t\t nactualindex++;\n\t }\n\t }\n\t Arrays.sort(files);\n\t szinputcoorddir += \"/\";\n\t }\n\t else\n\t {\n\t files = new String[1];\n\t files[0] = szinputcoorddir;\n\t szinputcoorddir = \"\";\n\t }\n }\n else\n {\n szinputcoorddir += \"/\";\n\t //store in files all file names given in szinputcoordlist\n\t BufferedReader brfiles = Util.getBufferedReader(szinputcoordlist);\n\t ArrayList alfiles = new ArrayList();\n\t while ((szLine = brfiles.readLine())!=null)\n\t {\n\t alfiles.add(szLine);\n\t }\n\t brfiles.close(); \n\t files = new String[alfiles.size()];\n\t for (int nfile = 0; nfile < files.length; nfile++)\n\t {\n\t files[nfile] = (String) alfiles.get(nfile);\n\t }\n }\n\t\n ArrayList alchromindex = new ArrayList(); //stores the index of the chromosome\n\t\n if (busesignal)\n {\n bunique = false;\n }\n\n HashMap hmchromMax = new HashMap(); //maps chromosome to the maximum index\n HashMap hmchromToIndex = new HashMap(); //maps chromosome to an index\n HashMap hmLabelToIndex = new HashMap(); //maps label to an index\n HashMap hmIndexToLabel = new HashMap(); //maps index string to label\n int nmaxlabel=0; // the maximum label found\n String szlabel=\"\";\n boolean busedunderscore = false;\n //reads in the segmentation recording maximum position for each chromosome and\n //maximum label\n BufferedReader brinputsegment = Util.getBufferedReader(szinputsegment);\n while ((szLine = brinputsegment.readLine())!=null)\n {\n\n\t //added v1.24\n\t if (bbrowser)\n\t {\n\t if ((szLine.toLowerCase(Locale.ENGLISH).startsWith(\"browser\"))||(szLine.toLowerCase(Locale.ENGLISH).startsWith(\"track\")))\n\t {\n\t continue;\n\t }\n\t }\n\n\t StringTokenizer st;\n\t if (bstringlabels)\n\t {\n st = new StringTokenizer(szLine,\"\\t\");\n\t }\n\t else\n\t {\n\t st = new StringTokenizer(szLine,\"\\t \");\n }\n\n\t //added in v1.24\n\t int numtokens = st.countTokens();\n\t if (numtokens == 0)\n\t {\n\t //skip blank lines\n\t continue;\n\t }\n\t else if (numtokens < 4)\n\t {\n\t throw new IllegalArgumentException(\"Line \"+szLine+\" in \"+szinputsegment+\" only had \"+numtokens+\" token(s). Expecting at least 4\");\n\t }\n\n\t String szchrom = st.nextToken().trim();\n\t int nbegincoord = Integer.parseInt(st.nextToken().trim());\n\t int nendcoord = Integer.parseInt(st.nextToken().trim());\n\t if (nbegincoord % nbinsize != 0)\n\t {\n\t\tthrow new IllegalArgumentException(\"Binsize of \"+nbinsize+\" does not agree with coordinates in input segment \"+szLine+\". -b binsize should match parameter value to LearnModel or \"+\n \"MakeSegmentation used to produce segmentation. If segmentation is derived from a lift over from another assembly, then the '-b 1' option should be used\");\n\t }\n //int nbegin = nbegincoord/nbinsize;\n\t int nend = (nendcoord-1)/nbinsize;\n szlabel = st.nextToken().trim();\n\t short slabel;\n\n\n if (bstringlabels)\n\t {\n\n\t int nunderscoreindex = szlabel.indexOf(\"_\");\n\n\t if (nunderscoreindex >=0)\n\t {\n\t String szprefix = szlabel.substring(0,nunderscoreindex);\n\n try\n\t {\n\t\t slabel = (short) (Short.parseShort(szprefix));\n\t\t if (slabel > nmaxlabel)\n\t {\n\t nmaxlabel = slabel;\n\t }\n\t\t busedunderscore = true;\n\t hmLabelToIndex.put(szlabel, Short.valueOf(slabel));\n\t\t hmIndexToLabel.put(\"\"+slabel, szlabel);\n\t\t}\n catch (NumberFormatException ex)\n\t\t{\n try\n\t\t {\n\t\t slabel = (short) (Short.parseShort(szprefix.substring(1)));\n\t\t if (slabel > nmaxlabel)\n\t\t {\n\t\t nmaxlabel = slabel;\n\t\t }\n\t\t busedunderscore = true;\n\t\t hmLabelToIndex.put(szlabel, Short.valueOf(slabel));\n\t\t hmIndexToLabel.put(\"\"+slabel, szlabel);\n\t\t }\n\t\t catch (NumberFormatException ex2)\n\t\t {\n\t\t if (busedunderscore)\n\t\t {\n\t throw new IllegalArgumentException(\"Not a valid ID before '_' in \"+szlabel+\", while valid ID found for other entries\");\n\t\t }\n\t\t }\n\t\t}\n\t }\n\n\t if (!busedunderscore)\n\t {\n //handle string labels\n\t Short objshort = (Short) hmLabelToIndex.get(szlabel);\n\n\t if (objshort == null)\n\t {\n\t nmaxlabel = hmLabelToIndex.size()+1;\n\t slabel = (short) nmaxlabel;\n\t hmLabelToIndex.put(szlabel, Short.valueOf(slabel));\n \t hmIndexToLabel.put(\"\"+nmaxlabel, szlabel);\n\t }\n\t //else\n\t //{\n\t // slabel = ((Short) objshort).shortValue();\n\t //}\n\t }\n\t }\n\t else\n\t {\n try\n\t {\n slabel = (short) (Short.parseShort(szlabel));\n\t }\n\t catch (NumberFormatException ex)\n\t {\n try\n\t\t{\n slabel = (short) (Short.parseShort(szlabel.substring(1)));\n\t\t}\n\t catch (NumberFormatException ex2)\n\t {\n throw new IllegalArgumentException(\"In fourth column neither state number or ID found in segmentation file. Use '-labels' option to run overlap enrichment treating fourth column as labels\");\n\t\t}\n\t }\n\n\t //alsegments.add(new SegmentRec(szchrom,nbegin,nend,slabel));\n\t if (slabel > nmaxlabel)\n\t {\n\t nmaxlabel = slabel;\n\t }\n\t }\n\n\t Integer objMax = (Integer) hmchromMax.get(szchrom);\n\t if (objMax == null)\n\t {\n\t //System.out.println(\"on chrom \"+szchrom);\n\t hmchromMax.put(szchrom,Integer.valueOf(nend));\n\t hmchromToIndex.put(szchrom, Integer.valueOf(hmchromToIndex.size()));\n\t alchromindex.add(szchrom);\n\t }\n\t else\n\t {\n\t int ncurrmax = objMax.intValue();\n\t if (ncurrmax < nend)\n\t {\n\t hmchromMax.put(szchrom, Integer.valueOf(nend));\t\t \n\t }\n\t }\n }\n brinputsegment.close();\n\n double[][] tallyoverlaplabel = new double[files.length][nmaxlabel+1];\n double[] dsumoverlaplabel = new double[files.length];\n double[] tallylabel = new double[nmaxlabel+1];\n\n int numchroms = alchromindex.size();\n\n for (int nchrom = 0; nchrom < numchroms; nchrom++)\n {\n //ArrayList alsegments = new ArrayList(); //stores all the segments\n\t String szchromwant = (String) alchromindex.get(nchrom);\n\t //System.out.println(\"processing \"+szchromwant);\n\t int nsize = ((Integer) hmchromMax.get(szchromwant)).intValue()+1;\n\t short[] labels = new short[nsize]; //stores the hard label assignments\n\n\t //sets to -1 so missing segments not counted as label 0\n\t for (int npos = 0; npos < nsize; npos++)\n\t {\n labels[npos] = -1;\n\t }\n\n\t brinputsegment = Util.getBufferedReader(szinputsegment);\n\t while ((szLine = brinputsegment.readLine())!=null)\n\t {\n\t StringTokenizer st;\n\t if (bstringlabels)\n\t {\n\t st = new StringTokenizer(szLine,\"\\t\");\n\t }\n\t else\n\t {\n\t st = new StringTokenizer(szLine,\"\\t \");\n\t }\n\n\t String szchrom = st.nextToken().trim();\n\t if (!szchrom.equals(szchromwant)) \n\t continue;\n\n\t int nbegincoord = Integer.parseInt(st.nextToken().trim());\n\t int nendcoord = Integer.parseInt(st.nextToken().trim());\n\n\t //if (nbegincoord % nbinsize != 0)\n\t // {\n\t //\t throw new IllegalArgumentException(\"Binsize of \"+nbinsize+\" does not agree with input segment \"+szLine);\n\t //}\n\t int nbegin = nbegincoord/nbinsize;\n\t int nend = (nendcoord-1)/nbinsize;\n\t szlabel = st.nextToken().trim();\n\t short slabel = -1;\n\n\t if (bstringlabels)\n\t {\n\t\tint nunderscoreindex = szlabel.indexOf(\"_\");\n\n\t\tif (nunderscoreindex >=0)\n\t\t{\n\t\t String szprefix = szlabel.substring(0,nunderscoreindex);\n\n try\n\t\t {\n\t\t slabel = (short) (Short.parseShort(szprefix));\n\t\t busedunderscore = true;\n\t\t }\n catch (NumberFormatException ex)\n\t\t {\n try\n\t\t {\n\t\t slabel = (short) (Short.parseShort(szprefix.substring(1)));\n\t\t\t busedunderscore = true;\n\t\t }\n\t\t catch (NumberFormatException ex2)\n\t\t {\n\t\t\t if (busedunderscore)\n\t\t\t {\n\t\t\t throw new IllegalArgumentException(\"Not a valid ID before '_' in \"+szlabel+\", while valid ID found for other entries\");\n\t\t\t }\n\t\t }\n\t\t }\n\t\t}\n\n\t\tif (!busedunderscore)\n\t\t{\n\t //handle string labels\n\t\t Short objshort = (Short) hmLabelToIndex.get(szlabel);\n\t\t slabel = ((Short) objshort).shortValue();\n\t\t}\n\t }\n\t else\n\t {\n try\n\t {\n\t slabel = (short) (Short.parseShort(szlabel));\n\t }\n\t catch (NumberFormatException ex)\n\t {\n try\n\t\t {\n slabel = (short) (Short.parseShort(szlabel.substring(1)));\n\t\t }\n\t\t catch (NumberFormatException ex2)\n\t\t {\n\t\t throw new IllegalArgumentException(\"In fourth column neither state number or ID found in segmentation file. Use '-labels' option to run overlap enrichment treating fourth column as labels\");\n\t }\n\t\t}\n\t }\n\n\t if (nbegin < 0)\n\t {\n\t nbegin = 0;\n\t }\n\n\t if (nend >= labels.length)\n\t {\n\t nend = labels.length - 1;\n\t }\n\n\t //SegmentRec theSegmentRec = (SegmentRec) alsegments.get(nindex);\n\t //int nbegin = theSegmentRec.nbegin;\n\t //int nend = theSegmentRec.nend;\n\t //short slabel = theSegmentRec.slabel;\n\t //int nchrom = ((Integer) hmchromToIndex.get(theSegmentRec.szchrom)).intValue();\n\t //short[] labels_nchrom = labels[nchrom];\n\t //stores each label position in the genome\n\t for (int npos = nbegin; npos <= nend; npos++)\n\t {\n\t labels[npos] = slabel;\n\t //tallylabel[slabel]++; \n\t }\n\t tallylabel[slabel] += (nend-nbegin)+1;\n\t }\n\n\n\t for (int nfile = 0; nfile < files.length; nfile++)\n\t {\n\t double[] tallyoverlaplabel_nfile = tallyoverlaplabel[nfile];\n\n\t int nchromindex = 0;\n\t int nstartindex = 1;\n\t int nendindex = 2;\n\t int nsignalindex = 3;\n\n\t if (szcolfields != null)\n\t {\n\t StringTokenizer stcolfields = new StringTokenizer(szcolfields,\",\");\n\t\tnchromindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t\tnstartindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t\tnendindex = Integer.parseInt(stcolfields.nextToken().trim());\n\n\t if (busesignal)\n\t {\n\t nsignalindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t }\n\t }\n\n \t \n if (bunique)\n\t {\n\t //Iterator itrChroms = hmchromToIndex.entrySet().iterator();\n\t //while (itrChroms.hasNext())\n\t //{\n\t //Map.Entry pairs = (Map.Entry) itrChroms.next();\n\t //String szchrom =(String) pairs.getKey();\n\t //int nchrom = ((Integer) pairs.getValue()).intValue();\n\t //short[] labels_nchrom = labels[nchrom];\n\n\t //reading in the coordinates to overlap with\n BufferedReader brcoords = Util.getBufferedReader(szinputcoorddir +files[nfile]);\n\t ArrayList alrecs = new ArrayList();\n\t while ((szLine = brcoords.readLine())!=null)\n\t {\n\t if (szLine.trim().equals(\"\")) continue;\n\t String[] szLineA = szLine.split(\"\\\\s+\");\n\t\t if (nstartindex >= szLineA.length)\n\t\t {\n\t\t throw new IllegalArgumentException(nstartindex+\" is an invalid column index for \"+szLine+\" in \"+szinputcoorddir+files[nfile]);\n\t\t }\n\n if (nendindex >= szLineA.length)\n\t\t {\n\t\t throw new IllegalArgumentException(nendindex+\" is an invalid column index for \"+szLine+\" in \"+szinputcoorddir+files[nfile]);\n\t\t }\n\n\t String szcurrchrom = szLineA[nchromindex];\n\t \t if (szchromwant.equals(szcurrchrom))\n\t\t {\n\t\t int nbeginactual =Integer.parseInt(szLineA[nstartindex])-noffsetleft;\n\t\t int nendactual =Integer.parseInt(szLineA[nendindex])-noffsetright;\n\t\t if (bcenter)\n\t\t {\n\t\t nbeginactual = (nbeginactual+nendactual)/2;\n\t\t nendactual = nbeginactual;\n\t\t }\n\t\t alrecs.add(new Interval(nbeginactual,nendactual));\n\t\t }\n\t\t}\n\t brcoords.close();\n\n\t\tObject[] alrecA = alrecs.toArray();\n\t\tArrays.sort(alrecA,new IntervalCompare());\n\n\t\tboolean bclosed = true;\n\t int nintervalstart = -1;\n\t\tint nintervalend = -1;\n\t\tboolean bdone = false;\n\n\t\tfor (int nindex = 0; (nindex <= alrecA.length&&(alrecA.length>0)); nindex++)\n\t\t{\n\t\t int ncurrstart = -1;\n\t\t int ncurrend = -1;\n\n\t\t if (nindex == alrecA.length)\n\t\t {\n\t\t bdone = true;\n\t\t }\n\t\t else \n\t\t {\n\t\t ncurrstart = ((Interval) alrecA[nindex]).nstart;\n\t\t ncurrend = ((Interval) alrecA[nindex]).nend;\n if (nindex == 0)\n\t\t {\n\t\t nintervalstart = ncurrstart;\n\t\t\t nintervalend = ncurrend;\n\t\t }\n\t\t else if (ncurrstart <= nintervalend)\n\t\t {\n\t\t //this read is still in the active interval\n\t\t //extending the current active interval \n\t\t if (ncurrend > nintervalend)\n\t\t {\n\t\t nintervalend = ncurrend;\n\t\t }\n\t\t }\t\t \n\t\t else \n\t\t {\n\t\t //just finished the current active interval\n\t\t bdone = true;\n\t\t }\n\t\t }\n\n\t\t if (bdone)\n\t {\t\t \t\t\t\t\t\t\n\t int nbegin = nintervalstart/nbinsize;\n\t\t int nend = nintervalend/nbinsize;\n\n\t\t if (nbegin < 0)\n\t\t {\n\t\t nbegin = 0;\n\t\t }\n\n\t\t if (nend >= labels.length)\n\t\t {\n\t\t nend = labels.length - 1;\n\t\t }\n\n\t for (int nbin = nbegin; nbin <= nend; nbin++)\n\t {\n\t\t if (labels[nbin]>=0)\n\t\t {\n\t\t tallyoverlaplabel_nfile[labels[nbin]]++;\n\t\t }\n\t\t }\n\n\t\t if (bbaseres)\n\t\t { \n\t\t //dbeginfrac represents the fraction of bases the nbegin interval\n\t\t //which came after the actual nbeginactual\n\t double dbeginfrac = (nintervalstart - nbegin*nbinsize)/(double) nbinsize;\n\t\t\t \n\t\t\t //dendfrac represents the fraction of bases after the end position in the interval\n\t double dendfrac = ((nend+1)*nbinsize-nintervalend-1)/(double) nbinsize;\n\t\t\t \n\t\t\t if ((nbegin < labels.length)&&(labels[nbegin]>=0)&&(dbeginfrac>0))\n\t\t { \t\t\t \n\t\t //only counted the bases if nbegin was less than labels.length \n\t\t tallyoverlaplabel_nfile[labels[nbegin]]-=dbeginfrac;\n\t\t\t }\n\n if ((nend < labels.length)&&(labels[nend]>=0)&&(dendfrac>0))\n\t\t {\n\t\t //only counted the bases if nend was less than labels.length \n\t\t tallyoverlaplabel_nfile[labels[nend]]-=dendfrac;\n\t\t\t }\n\t\t }\t\t\t \n\n\t\t nintervalstart = ncurrstart; \n\t\t nintervalend = ncurrend;\n\t\t bdone = false;\n\t\t }\t \n\t\t}\n\t\t //}\n\t }\n\t else\n\t {\n\t BufferedReader brcoords = Util.getBufferedReader(szinputcoorddir +files[nfile]);\n\t while ((szLine = brcoords.readLine())!=null)\n\t {\n\t if (szLine.trim().equals(\"\")) continue;\n\t String[] szLineA = szLine.split(\"\\\\s+\");\n\n\t String szchrom = szLineA[nchromindex];\n\t\t if (!szchromwant.equals(szchrom))\n\t\t continue;\n\n\t int nbeginactual =Integer.parseInt(szLineA[nstartindex])-noffsetleft;\n\t int nbegin = nbeginactual/nbinsize;\n\n\t\t int nendactual =Integer.parseInt(szLineA[nendindex])-noffsetright;\n\t int nend = nendactual/nbinsize;\n\n\t\t double damount;\n\t if ((busesignal)&&(nsignalindex < szLineA.length))\n\t {\n\t \t damount = Double.parseDouble(szLineA[nsignalindex]);\n\t\t }\n\t else\n\t {\n\t damount = 1;\n\t\t }\n\n\t //Integer objChrom = (Integer) hmchromToIndex.get(szchrom);\n\t //if (objChrom != null)\n\t\t //{\n\t\t //we have the chromosome corresponding to this read\n\t //int nchrom = objChrom.intValue();\n\t //short[] labels_nchrom = labels[nchrom];\n\n\t\t if (bcenter)\n\t {\n\t //using the center position of the interval only\n\t\t int ncenter = (nbeginactual+nendactual)/(2*nbinsize);\n\t\t if ((ncenter < labels.length)&&(labels[ncenter]>=0))\n\t\t {\n\t tallyoverlaplabel_nfile[labels[ncenter]]+=damount;\t\t\t \n\t\t }\n\t\t }\n\t else\n\t {\n\t\t if (nbegin < 0)\n\t\t {\n\t\t nbegin = 0;\n\t\t }\n\t\t //using the full interval range\n\t\t //no requirement on uniqueness\n\t\t if (nend >= labels.length)\n\t\t {\n\t\t nend = labels.length - 1;\n\t\t }\n\t\t\t\n\t for (int nindex = nbegin; nindex <= nend; nindex++)\n\t {\n\t\t if (labels[nindex]>=0)\n\t\t {\n\t\t //increment overlap tally not checking for uniqueness\n \t tallyoverlaplabel_nfile[labels[nindex]]+=damount;\n\t\t\t }\n\t\t }\t \n\n\t\t if (bbaseres)\n\t\t { \n\t\t //dbeginfrac represents the fraction of bases the nbegin interval\n\t\t\t //which came after the actual nbeginactual\n\t double dbeginfrac = (nbeginactual - nbegin*nbinsize)/(double) nbinsize;\n\t\t\t \n\t\t\t //dendfrac represents the fraction of bases after the end position in the interval\n\t double dendfrac = ((nend+1)*nbinsize-nendactual-1)/(double) nbinsize;\n\n\t\t\t if ((nbegin < labels.length)&&(labels[nbegin]>=0)&&(dbeginfrac>0))\n\t\t\t { \n\t\t\t //only counted the bases if nbegin was less than labels.length \n\t\t\t tallyoverlaplabel_nfile[labels[nbegin]]-=damount*dbeginfrac;\n\t\t\t }\n\n if ((nend < labels.length)&&(labels[nend]>=0)&&(dendfrac>0))\n\t\t {\n\t\t //only counted the bases if nend was less than labels.length \n\t\t\t tallyoverlaplabel_nfile[labels[nend]]-=damount*dendfrac;\n\t\t\t }\t\t\t \n\t\t }\n\t\t }\n\t\t}\t \n\t\tbrcoords.close();\n\t }\n\t }\n }\n\n\n for (int nfile = 0; nfile < files.length; nfile++)\n {\n\t double[] tallyoverlaplabel_nfile = tallyoverlaplabel[nfile];\n\n\t for (int nindex = 0; nindex < tallyoverlaplabel_nfile.length; nindex++)\n {\n dsumoverlaplabel[nfile] += tallyoverlaplabel_nfile[nindex];\n }\n\t\t\n if (dsumoverlaplabel[nfile] < EPSILONOVERLAP) // 0.00000001)\n {\n\t throw new IllegalArgumentException(\"Coordinates in \"+files[nfile]+\" not assigned to any state. Check if chromosome naming in \"+files[nfile]+\n\t\t\t\t\t\t \" match those in the segmentation file.\");\n\t }\n\t}\n\n\toutputenrichment(szoutfile, files,tallyoverlaplabel, tallylabel, dsumoverlaplabel,theColor,\n\t\t\t bcolscaleheat,ChromHMM.convertCharOrderToStringOrder(szlabel.charAt(0)),sztitle,0,szlabelmapping,szlabel.charAt(0), bprintimage, bstringlabels, hmIndexToLabel);\n }", "public HL7Segment processPIDToUFD(String pHL7MessageBlock) throws ICANException {\n\n HL7Message aHL7Message = new HL7Message(pHL7MessageBlock);\n HL7Segment aZPDSegment = new HL7Segment(aHL7Message.getSegment(\"ZPD\"));\n HL7Segment aInPID = new HL7Segment(k.NULL);\n HL7Segment aOutPID = new HL7Segment(HL7_23.PID);\n\n HL7Field aTempField;\n String aPID_3_RepeatField[] = new String[5];\n String aPID_11_RepeatField[] = new String[5];\n String aPID_13_RepeatField[] = new String[5];\n int aRepeat = 0;\n aInPID.setSegment(aHL7Message.getSegment(HL7_23.PID));\n\n// Copy all fields indicated in aArray from IN segment ...\n aOutPID.linkTo(aInPID);\n\n String aArray[] = { HL7_23.PID_1_set_ID,\n HL7_23.PID_5_patient_name,\n HL7_23.PID_7_date_of_birth,\n HL7_23.PID_8_sex,\n HL7_23.PID_9_patient_alias,\n HL7_23.PID_10_race,\n HL7_23.PID_12_county_code,\n HL7_23.PID_13_home_phone,\n HL7_23.PID_14_business_phone,\n HL7_23.PID_15_language,\n HL7_23.PID_16_marital_status,\n HL7_23.PID_17_religion,\n HL7_23.PID_18_account_number,\n HL7_23.PID_19_SSN_number,\n HL7_23.PID_21_mothers_ID,\n HL7_23.PID_23_birth_place,\n HL7_23.PID_29_patient_death_date_time,\n HL7_23.PID_30_patient_death_indicator\n };\n aOutPID.copyFields(aArray);\n\n// Check patient death date is not less than patient birth date\n\n String aPatientDeathDateTime = aOutPID.get(HL7_23.PID_29_patient_death_date_time);\n if (aPatientDeathDateTime.length() > 2) {\n int aBirthDate = Integer.parseInt(aOutPID.get(HL7_23.PID_7_date_of_birth).substring(0, 8));\n int aDeathDate = Integer.parseInt(aPatientDeathDateTime.substring(0, 8));\n if (aDeathDate < aBirthDate) {\n throw new ICANException(\"F010\", mEnvironment);\n }\n }\n\n// ... make certain it gets a Set ID.\n if ( aInPID.isEmpty(HL7_23.PID_1_set_ID))\n aOutPID.setField(\"1\", HL7_23.PID_1_set_ID);\n\n// Patient UR Number\n if (! aInPID.isEmpty(HL7_23.PID_3_patient_ID_internal, HL7_23.CX_ID_number)) {\n aTempField = new HL7Field(aInPID.get(HL7_23.PID_3_patient_ID_internal));\n aTempField.setSubField(\"PI\",HL7_23.CX_ID_type_code );\n aPID_3_RepeatField[aRepeat++] = aTempField.getField();\n mPatientUR = aInPID.get(HL7_23.PID_3_patient_ID_internal, HL7_23.CX_ID_number);\n }\n// Patient Sex Indeterminate = Unknown\n if (aOutPID.get(HL7_23.PID_8_sex).equalsIgnoreCase(\"I\")) {\n aOutPID.set(HL7_23.PID_8_sex, \"U\");\n }\n\n// Correct the Rabbi prefix\n if (aOutPID.get(HL7_23.PID_5_patient_name, HL7_23.XPN_prefix).equalsIgnoreCase(\"RAB\")) {\n aOutPID.set(HL7_23.PID_5_patient_name, HL7_23.XPN_prefix, \"Rabbi\");\n }\n if (aOutPID.get(HL7_23.PID_9_patient_alias, HL7_23.XPN_prefix).equalsIgnoreCase(\"RAB\")) {\n aOutPID.set(HL7_23.PID_9_patient_alias, HL7_23.XPN_prefix, \"Rabbi\");\n }\n\n// Pension Number and Mental Health ID\n if (! aInPID.isEmpty(HL7_23.PID_4_alternate_patient_ID, HL7_23.CX_ID_number)) {\n String aField[] = aInPID.getRepeatFields(HL7_23.PID_4_alternate_patient_ID);\n int n;\n\n for (n = 0; n < aField.length; n++) {\n aTempField = new HL7Field(aField[n]);\n if (aTempField.getSubField(HL7_23.CX_ID_type_code).equalsIgnoreCase(\"PE\")) {\n aTempField.setSubField(\"PEN\",HL7_23.CX_ID_type_code );\n aTempField.setSubField(\"PEN\",HL7_23.CX_assigning_authority );\n aPID_3_RepeatField[aRepeat++] = aTempField.getField();\n\n } else\n if (aTempField.getSubField(HL7_23.CX_ID_type_code).equalsIgnoreCase(\"MH\")) {\n aTempField.setSubField(\"MH\",HL7_23.CX_ID_type_code );\n aTempField.setSubField(\"MHN\",HL7_23.CX_assigning_authority );\n aPID_3_RepeatField[aRepeat++] = aTempField.getField();\n cMentalHealthID = aTempField.getSubField(HL7_23.CX_ID_number);\n }\n\n }\n }\n\n// Medicare Number\n if (! aInPID.isEmpty(HL7_23.PID_19_SSN_number, HL7_23.CX_ID_number)) {\n aTempField = new HL7Field(aInPID.get(HL7_23.PID_19_SSN_number));\n } else {\n aTempField = new HL7Field(\"C-U\");\n }\n aTempField.setSubField(\"MC\",HL7_23.CX_ID_type_code );\n aTempField.setSubField(\"HIC\",HL7_23.CX_assigning_authority );\n aPID_3_RepeatField[aRepeat++] = aTempField.getField();\n\n// DVA Number\n if (!aInPID.isEmpty(HL7_23.PID_27_veterans_military_status, HL7_23.CX_ID_number) &&\n !aInPID.get(HL7_23.PID_27_veterans_military_status).equalsIgnoreCase(\"\\\"\\\"\")) {\n aTempField = new HL7Field(aInPID.get(HL7_23.PID_27_veterans_military_status, HL7_23.CX_ID_number));\n aTempField.setSubField(\"VA\",HL7_23.CX_ID_type_code );\n aTempField.setSubField(\"DVA\",HL7_23.CX_assigning_authority );\n aPID_3_RepeatField[aRepeat++] = aTempField.getField();\n }\n\n aOutPID.setRepeatFields(HL7_23.PID_3_patient_ID_internal, aPID_3_RepeatField);\n\n// Patients Address\n HL7Field aPID11Field = new HL7Field();\n HL7Field aPIDTmpField = new HL7Field();\n String aPID11Array[] = aInPID.getRepeatFields(HL7_23.PID_11_patient_address);\n// String aStateDesc = \"\";\n aRepeat = 0;\n int i;\n for (i=0; i < aPID11Array.length; i++) {\n aPIDTmpField = new HL7Field(aPID11Array[i]);\n aPID11Field.setSubField(aPIDTmpField.getSubField(HL7_23.XAD_street_1),HL7_23.XAD_street_1);\n aPID11Field.setSubField(aPIDTmpField.getSubField(HL7_23.XAD_street_2),HL7_23.XAD_street_2);\n aPID11Field.setSubField(aPIDTmpField.getSubField(HL7_23.XAD_city),HL7_23.XAD_city);\n\n //Norman Soh: Process State description based on PostCode\n// String aPostCodeStr = aPIDTmpField.getSubField(HL7_23.XAD_zip);\n// if (aPostCodeStr.length() > 0) {\n// try {\n// int aPostCode = Integer.parseInt(aPostCodeStr);\n// if (aPostCode >= 800 && aPostCode <= 899) {\n// aStateDesc = \"NT\";\n// } else if ((aPostCode >= 200 && aPostCode <= 299) ||\n// (aPostCode >= 2600 && aPostCode <= 2619) ||\n// (aPostCode >= 2900 && aPostCode <= 2920)) {\n// aStateDesc = \"ACT\";\n// } else if ((aPostCode >= 1000 && aPostCode <= 2599) ||\n// (aPostCode >= 2620 && aPostCode <= 2899) ||\n// (aPostCode >= 2921 && aPostCode <= 2999)) {\n// aStateDesc = \"NSW\";\n// } else if ((aPostCode >= 3000 && aPostCode <= 3999) ||\n// (aPostCode >= 8000 && aPostCode <= 8999)) {\n// aStateDesc = \"VIC\";\n// } else if (aPostCode == 8888) {\n// aStateDesc = \"OVERSEAS\";\n// } else if (aPostCode == 9990 || aPostCode == 9988) {\n// aStateDesc = \"\";\n// } else if ((aPostCode >= 4000 && aPostCode <= 4999) ||\n// (aPostCode >= 9000 && aPostCode <= 9799)) {\n// aStateDesc = \"QLD\";\n// } else if (aPostCode >= 5000 && aPostCode <= 5999) {\n// aStateDesc = \"SA\";\n// } else if (aPostCode >= 6000 && aPostCode <= 6999) {\n// aStateDesc = \"WA\";\n// } else if (aPostCode >= 7000 && aPostCode <= 7999) {\n// aStateDesc = \"TAS\";\n// }\n// aPID11Field.setSubField(aStateDesc, HL7_23.XAD_state_or_province);\n// } catch (Exception e) {\n// //Do nothing, postcode is not entered or is invalid\n// }\n// }\n //\n\n if (aPIDTmpField.getSubField(HL7_23.XAD_zip).equalsIgnoreCase(\"8888\")){\n aPID11Field.setSubField(\"OVERSEAS\", HL7_23.XAD_state_or_province);\n } else {\n aPID11Field.setSubField(aPIDTmpField.getSubField(HL7_23.XAD_state_or_province), HL7_23.XAD_state_or_province);\n }\n\n aPID11Field.setSubField(aPIDTmpField.getSubField(HL7_23.XAD_zip),HL7_23.XAD_zip);\n aPID11Field.setSubField(aPIDTmpField.getSubField(HL7_23.XAD_country),HL7_23.XAD_country);\n aPID11Field.setSubField(aPIDTmpField.getSubField(HL7_23.XAD_type),HL7_23.XAD_type);\n aPID11Field.setSubField(aPIDTmpField.getSubField(HL7_23.XAD_geographic_designation),HL7_23.XAD_geographic_designation);\n aPID11Field.setSubField(aPIDTmpField.getSubField(HL7_23.XAD_county_parish),HL7_23.XAD_county_parish);\n\n aPID_11_RepeatField[aRepeat++] = aPID11Field.getField();\n if (aRepeat == 4) {\n break;\n }\n }\n aOutPID.setRepeatFields(HL7_23.PID_11_patient_address, aPID_11_RepeatField);\n\n//Get first home phone number only\n if (! aZPDSegment.isEmpty(CSC_23.ZPD_12_Personal_Contact_Data_Phone_Numbers)) {\n String aZPD12Array[] = aZPDSegment.getRepeatFields(CSC_23.ZPD_12_Personal_Contact_Data_Phone_Numbers);\n HL7Field aPID13Field = new HL7Field();\n String aPID13Array[] = aZPDSegment.getRepeatFields(CSC_23.ZPD_12_Personal_Contact_Data_Phone_Numbers);\n HL7Field aPID14Field = new HL7Field();\n\n HL7Field aZPDField;\n\n HL7Field aTmpField = new HL7Field();\n aRepeat = 0;\n\n for (i=0; i < aZPD12Array.length; i++) {\n aZPDField = new HL7Field(aZPD12Array[i]);\n if (aZPDField.getSubField(HL7_23.XTN_telecom_use).equalsIgnoreCase(\"PRN\")) {\n aPID13Field.setSubField(aZPDField.getSubField(HL7_23.XTN_telephone_number), HL7_23.XTN_telephone_number);\n if (aZPDField.getSubField(HL7_23.XTN_comment).equalsIgnoreCase(\"H\") ||\n aZPDField.getSubField(HL7_23.XTN_comment).equalsIgnoreCase(\"R\") ||\n aZPDField.getSubField(HL7_23.XTN_comment).equalsIgnoreCase(\"P\") ||\n aZPDField.getSubField(HL7_23.XTN_comment).equalsIgnoreCase(\"RES\") ||\n aZPDField.getSubField(HL7_23.XTN_comment).equalsIgnoreCase(\"POB\") ||\n aZPDField.getSubField(HL7_23.XTN_comment).equalsIgnoreCase(\"PR1\") ||\n aZPDField.getSubField(HL7_23.XTN_comment).equalsIgnoreCase(\"PR2\")) {\n aPID13Field.setSubField(\"PRN\", HL7_23.XTN_telecom_use); // Home Phone\n } else {\n aPID13Field.setSubField(\"ORN\", HL7_23.XTN_telecom_use); // Overseas Phone Number\n }\n\n aPID_13_RepeatField[aRepeat++] = aPID13Field.getField();\n if (aRepeat == 4) {\n break;\n }\n }\n\n if (aZPDField.getSubField(HL7_23.XTN_telecom_use).equalsIgnoreCase(\"WPN\")) {\n //aPID14Field.setSubField(aZPDField.getSubField(HL7_23.XTN_telephone_number), HL7_23.XTN_telephone_number);\n if (aZPDField.getSubField(HL7_23.XTN_comment).equalsIgnoreCase(\"H\") ||\n aZPDField.getSubField(HL7_23.XTN_comment).equalsIgnoreCase(\"R\") ||\n aZPDField.getSubField(HL7_23.XTN_comment).equalsIgnoreCase(\"P\") ||\n aZPDField.getSubField(HL7_23.XTN_comment).equalsIgnoreCase(\"RES\")) {\n aPID14Field.setSubField(aZPDField.getSubField(HL7_23.XTN_telephone_number), HL7_23.XTN_telephone_number);\n aPID14Field.setSubField(\"WPN\", HL7_23.XTN_telecom_use); // Business Phone\n }\n }\n }\n if (aRepeat > 0) {\n aOutPID.setRepeatFields(HL7_23.PID_13_home_phone, aPID_13_RepeatField);\n }\n aOutPID.setField(aPID14Field.getField(), HL7_23.PID_14_business_phone);\n\n }\n return aOutPID;\n }", "protected void getLovLabelsForInitialValues(HttpServletRequest request, Record inputRecord) {\r\n Logger l = LogUtils.getLogger(getClass());\r\n if (l.isLoggable(Level.FINER)) {\r\n l.entering(getClass().getName(), \"getLovLabelsForInitialValues\", new Object[]{request, inputRecord});\r\n }\r\n\r\n // loop through all fields with initial values\r\n Record outputRecord = new Record();\r\n Iterator fieldNames = inputRecord.getFieldNames();\r\n while (fieldNames.hasNext()) {\r\n // get field name and value\r\n String fieldName = (String) fieldNames.next();\r\n String fieldValue = inputRecord.getStringValue(fieldName);\r\n\r\n // set the description for LOV field\r\n ArrayList lov = (ArrayList) request.getAttribute(fieldName + \"LOV\");\r\n if (lov != null) {\r\n int size = lov.size();\r\n int i;\r\n for (i = 0; i < size; i++) {\r\n LabelValueBean lvb = (LabelValueBean) lov.get(i);\r\n if (lvb.getValue().equals(fieldValue)) {\r\n outputRecord.setFieldValue(fieldName + \"LOVLABEL\", lvb.getLabel());\r\n }\r\n }\r\n }\r\n }\r\n\r\n // add the descriptions to the Record\r\n inputRecord.setFields(outputRecord);\r\n l.exiting(getClass().getName(), \"getLovLabelsForInitialValues\", inputRecord);\r\n }", "public void getProbe () {\n double prxg;\n int index;\n double effaoa = effective_aoa();\n /* get variables in the generating plane */\n if (Math.abs(ypval) < .01) ypval = .05;\n getPoints(xpval,ypval);\n\n solver.getVel(lrg,lthg);\n loadProbe();\n\n pxg = lxgt;\n pyg = lygt;\n prg = lrgt;\n pthg = lthgt;\n pxm = lxmt;\n pym = lymt;\n /* smoke */\n if (pboflag == 3 ) {\n prxg = xpval;\n for (index =1; index <=POINTS_COUNT; ++ index) {\n getPoints(prxg,ypval);\n xg[19][index] = lxgt;\n yg[19][index] = lygt;\n rg[19][index] = lrgt;\n thg[19][index] = lthgt;\n xm[19][index] = lxmt;\n ym[19][index] = lymt;\n if (stall_model_type != STALL_MODEL_IDEAL_FLOW) { // stall model\n double apos = stall_model_type == STALL_MODEL_DFLT ? +10 : stall_model_apos;\n double aneg = stall_model_type == STALL_MODEL_DFLT ? -10 : stall_model_aneg;\n if (xpval > 0.0) {\n if (effaoa > apos && ypval > 0.0) { \n ym[19][index] = ym[19][1];\n } \n if (effaoa < aneg && ypval < 0.0) {\n ym[19][index] = ym[19][1];\n }\n }\n if (xpval < 0.0) {\n if (effaoa > apos && ypval > 0.0) { \n if (xm[19][index] > 0.0) {\n ym[19][index] = ym[19][index-1];\n }\n } \n if (effaoa < aneg && ypval < 0.0) {\n if (xm[19][index] > 0.0) {\n ym[19][index] = ym[19][index-1];\n }\n }\n }\n }\n solver.getVel(lrg,lthg);\n prxg = prxg + vxdir*STEP_X;\n }\n }\n return;\n }", "private Point3d lp2xyz(double line, double pixel, MetadataDoris metadata, OrbitsDoris orbits) {\n \n int MAXITER = 10;\n final double CRITERPOS = Math.pow(10, -6);\n final double SOL = Constants.lightSpeed;\n final int refHeight = 0;\n \n final double ell_a = Constants.semiMajorAxis;\n final double ell_b = Constants.semiMinorAxis;\n \n Point3d satellitePosition;\n Point3d satelliteVelocity;\n Point3d ellipsoidPosition;\n \n // put stuff that makes sense here!\n double azTime = line2ta(line, metadata);\n double rgTime = pix2tr(pixel, metadata);\n \n satellitePosition = getSatelliteXYZ(azTime, orbits);\n satelliteVelocity = getSatelliteXYZDot(azTime, orbits);\n \n ellipsoidPosition = metadata.approxXYZCentreOriginal;\n \n // allocate matrices\n // DoubleMatrix ellipsoidPositionSolution = DoubleMatrix.zeros(3,1);\n DoubleMatrix equationSet = DoubleMatrix.zeros(3);\n DoubleMatrix partialsXYZ = DoubleMatrix.zeros(3, 3);\n \n for (int iter = 0; iter <= MAXITER; iter++) {\n // update equations and slove system\n double dsat_Px = ellipsoidPosition.x - satellitePosition.x; // vector of 'satellite to P on ellipsoid'\n double dsat_Py = ellipsoidPosition.y - satellitePosition.y; // vector of 'satellite to P on ellipsoid'\n double dsat_Pz = ellipsoidPosition.z - satellitePosition.z; // vector of 'satellite to P on ellipsoid'\n \n equationSet.put(0,\n -(satelliteVelocity.x * dsat_Px +\n satelliteVelocity.y * dsat_Py +\n satelliteVelocity.z * dsat_Pz));\n \n equationSet.put(1,\n -(dsat_Px * dsat_Px +\n dsat_Py * dsat_Py +\n dsat_Pz * dsat_Pz - Math.pow(SOL * rgTime, 2)));\n \n equationSet.put(2,\n -((ellipsoidPosition.x * ellipsoidPosition.x + ellipsoidPosition.y * ellipsoidPosition.y) / (Math.pow(ell_a + refHeight, 2)) +\n Math.pow(ellipsoidPosition.z / (ell_b + refHeight), 2) - 1.0));\n \n partialsXYZ.put(0, 0, satelliteVelocity.x);\n partialsXYZ.put(0, 1, satelliteVelocity.y);\n partialsXYZ.put(0, 2, satelliteVelocity.z);\n partialsXYZ.put(1, 0, 2 * dsat_Px);\n partialsXYZ.put(1, 1, 2 * dsat_Py);\n partialsXYZ.put(1, 2, 2 * dsat_Pz);\n partialsXYZ.put(2, 0, (2 * ellipsoidPosition.x) / (Math.pow(ell_a + refHeight, 2)));\n partialsXYZ.put(2, 1, (2 * ellipsoidPosition.y) / (Math.pow(ell_a + refHeight, 2)));\n partialsXYZ.put(2, 2, (2 * ellipsoidPosition.z) / (Math.pow(ell_a + refHeight, 2)));\n \n // solve system [NOTE!] orbit has to be normalized, otherwise close to singular\n DoubleMatrix ellipsoidPositionSolution = Solve.solve(partialsXYZ, equationSet);\n // DoubleMatrix ellipsoidPositionSolution = solve33(partialsXYZ, equationSet);\n \n // update solution\n ellipsoidPosition.x = ellipsoidPosition.x + ellipsoidPositionSolution.get(0);\n ellipsoidPosition.y = ellipsoidPosition.y + ellipsoidPositionSolution.get(1);\n ellipsoidPosition.z = ellipsoidPosition.z + ellipsoidPositionSolution.get(2);\n \n // check convergence\n if (Math.abs(ellipsoidPositionSolution.get(0)) < CRITERPOS &&\n Math.abs(ellipsoidPositionSolution.get(1)) < CRITERPOS &&\n Math.abs(ellipsoidPositionSolution.get(2)) < CRITERPOS) {\n // System.out.println(\"INFO: ellipsoidPosition (converged) = \" + ellipsoidPosition);\n break;\n } else if (iter >= MAXITER) {\n MAXITER = MAXITER + 1;\n System.out.println(\"WARNING: line, pix -> x,y,z: maximum iterations (\" + MAXITER + \") reached. \" + \"Criterium (m): \" + CRITERPOS +\n \"dx,dy,dz=\" + ellipsoidPositionSolution.get(0) + \", \" + ellipsoidPositionSolution.get(1) + \", \" + ellipsoidPositionSolution.get(2, 0));\n }\n }\n \n return ellipsoidPosition;\n }", "private void process(double sample)\r\n {\n System.arraycopy(samples, 0, samples, 1, sampleSize - 1);\r\n samples[0] = sample;\r\n\r\n currentValue = AnalysisUtil.rms(samples);\r\n }", "public static void main( String[] args ) throws Exception {\n Vectorizer v =new Vectorizer();\n\t //Make a hashmap of arraylist to test makeVectors() function\n HashMap<String, ArrayList<List<String>> > hh = new HashMap<String, ArrayList<List<String>> >();\n\t String Id=\"1\";String s1=\"loving \" ;String s2=\"life\";\n\t List<String> l1 = new ArrayList<String>(); l1.add(s1);l1.add(s2);\n\t Id=\"3\";s1=\"street\" ;s2=\"washington\";\n\t List<String> l3 = new ArrayList<String>(); l3.add(s1);l3.add(s2);\n\t ArrayList<List<String>> al1=new ArrayList<List<String>>();\n\t al1.add(l1);al1.add(l3);\n\t hh.put(Id,al1);\n\t \t \n\t Id=\"2\";s1=\"having\" ;s2=\"dreams\";\n\t List<String> l2 = new ArrayList<String>(); l2.add(s1);l2.add(s2);\n\t ArrayList<List<String>> al2=new ArrayList<List<String>>();\n\t al2.add(l2);\n\t hh.put(Id,al2);\n\t \n\t HashMap<String, ArrayList<Counter<String>> > hm =v.makeVectors(hh);\n {//Print the hashmap-----------------------------\n // Get a set of the entries\n Set set = hm.entrySet();\n // Get an iterator\n Iterator i = set.iterator();\n // Display elements\n while(i.hasNext()) {\n Map.Entry me = (Map.Entry)i.next();\n System.out.print(me.getKey() + \": \");\n System.out.println(me.getValue());\n }\n }//End of the print section---------------------- \n }", "public HL7Segment processPV1ToUFD(String pHL7MessageBlock) throws ICANException {\n\n HL7Message aHL7Message = new HL7Message(mHL7Message);\n HL7Segment aPV1Segment = new HL7Segment(\"PV1\");\n\n CodeLookUp aPayClass = new CodeLookUp(\"CSC_PayClass.table\", mFacility, mEnvironment);\n\n\n// Special processing for PV1 segments received in A28 and A31 messages.\n if (aHL7Message.isEvent(\"A28, A31\")) {\n aPV1Segment.set(HL7_23.PV1_1_set_ID, \"1\");\n aPV1Segment.set(HL7_23.PV1_2_patient_class, \"R\");\n aPV1Segment.set(HL7_23.PV1_3_assigned_patient_location, HL7_23.PL_facility_ID, mFacility);\n aPV1Segment.set(HL7_23.PV1_18_patient_type, \"R\");\n aPV1Segment.set(HL7_23.PV1_19_visit_number, \"R\".concat(mPatientUR));\n if (mFacility.matches(\"BHH|MAR|PJC|ANG\")) {\n HL7Segment aInPV1Segment = new HL7Segment(aHL7Message.getSegment(HL7_23.PV1));\n String aPV1_8ReferringDoc = aInPV1Segment.get(HL7_23.PV1_8_referring_doctor);\n aPV1Segment.set(HL7_23.PV1_8_referring_doctor, aPV1_8ReferringDoc);\n }\n } else { // For all other message types ... i.e. \"A01 to A17\"\n aHL7Message = new HL7Message(pHL7MessageBlock);\n aPV1Segment.setSegment(aHL7Message.getSegment(HL7_23.PV1));\n aPV1Segment.set(HL7_23.PV1_2_patient_class, \"I\");\n\n// Sandringham funny Facility in Room position ....\n if (aPV1Segment.get(HL7_23.PV1_3_assigned_patient_location, HL7_23.PL_room).equalsIgnoreCase(\"23\")) {\n aPV1Segment.set(HL7_23.PV1_3_assigned_patient_location, HL7_23.PL_room, \"SDMH\");\n }\n if (aPV1Segment.get(HL7_23.PV1_6_prior_patient_location, HL7_23.PL_room).equalsIgnoreCase(\"23\")) {\n aPV1Segment.set(HL7_23.PV1_6_prior_patient_location, HL7_23.PL_room, \"SDMH\");\n }\n aPV1Segment.set(HL7_23.PV1_19_visit_number, \"I\".concat(aPV1Segment.get(HL7_23.PV1_19_visit_number)));\n\n// Translate the Financial Class\n if (mFacility.equalsIgnoreCase(\"BHH\") ||\n mFacility.equalsIgnoreCase(\"MAR\") ||\n mFacility.equalsIgnoreCase(\"ANG\") ||\n mFacility.equalsIgnoreCase(\"PJC\")) {\n\n //aPV1Segment.set(HL7_23.PV1_20_financial_class, aPayClass.getValue(mFacility + \"-\" + aPV1Segment.get(HL7_23.PV1_2_patient_class) + \"-\" + aPV1Segment.get(HL7_23.PV1_20_financial_class)));\n } else {\n aPV1Segment.set(HL7_23.PV1_20_financial_class, aPayClass.getValue(aPV1Segment.get(HL7_23.PV1_20_financial_class)));\n }\n\n\n// Check each of the Dr's have a valid Bayside code\n String aDr;\n// ... Attending Dr ....\n aDr = doDrTranslate(aPV1Segment.get(HL7_23.PV1_7_attending_doctor, HL7_23.XCN_ID_num));\n if (aDr.equalsIgnoreCase(k.NULL)) {\n aPV1Segment.set(HL7_23.PV1_7_attending_doctor, \"\");\n } else {\n aPV1Segment.set(HL7_23.PV1_7_attending_doctor, HL7_23.XCN_ID_num, aDr);\n }\n\n// ... Refering Dr ....\n aDr = doDrTranslate(aPV1Segment.get(HL7_23.PV1_8_referring_doctor, HL7_23.XCN_ID_num));\n if (aDr.equalsIgnoreCase(k.NULL)) {\n aPV1Segment.set(HL7_23.PV1_8_referring_doctor, \"\");\n } else {\n aPV1Segment.set(HL7_23.PV1_8_referring_doctor, HL7_23.XCN_ID_num, aDr);\n }\n\n// ... Consulting Dr ....\n aDr = doDrTranslate(aPV1Segment.get(HL7_23.PV1_9_consulting_doctor, HL7_23.XCN_ID_num));\n if (aDr.equalsIgnoreCase(k.NULL)) {\n aPV1Segment.set(HL7_23.PV1_9_consulting_doctor, \"\");\n } else {\n aPV1Segment.set(HL7_23.PV1_9_consulting_doctor, HL7_23.XCN_ID_num, aDr);\n }\n\n// Check for CSC sending invalid discharge/admit times of\n aPV1Segment.set(HL7_23.PV1_44_admit_date_time, doValidTimeCheck(aPV1Segment.get(HL7_23.PV1_44_admit_date_time)));\n aPV1Segment.set(HL7_23.PV1_45_discharge_date_time, doValidTimeCheck(aPV1Segment.get(HL7_23.PV1_45_discharge_date_time)));\n }\n return aPV1Segment;\n\n }", "public static void modifiedNussinov() {\r\n // Declare j\r\n int j;\r\n\r\n // Fill in DPMatrix\r\n for (int k = 0; k < sequence.length(); k++) {\r\n for (int i = 0; i < sequence.length()-1; i++) {\r\n // If bigger than allowed loop size\r\n if (k > minimumLoop - 1) {\r\n // Index is in bounds\r\n if ((i + k + 1) <= sequence.length()-1) {\r\n // Set j to i + k + 1\r\n j = i + k + 1;\r\n\r\n // Set min to max value\r\n double minimum = Double.MAX_VALUE;\r\n\r\n // Check for minimum\r\n minimum = Math.min(minimum, Math.min((DPMatrix[i + 1][j] ), (DPMatrix[i][j - 1] )) );\r\n\r\n // Adjust for pair scores\r\n if (checkPair(sequence.charAt(i), sequence.charAt(j)) == 1) {\r\n // Check for minimum\r\n minimum = Math.min(minimum, DPMatrix[i + 1][j - 1] - 2);\r\n } else if (checkPair(sequence.charAt(i), sequence.charAt(j)) == 2) {\r\n // Check for minimum\r\n minimum = Math.min(minimum, DPMatrix[i + 1][j - 1] - 3);\r\n }\r\n for (int l = i + 1; l < j; l++) {\r\n // Check for minimum\r\n minimum = Math.min(minimum, (DPMatrix[i][l]) + (DPMatrix[l + 1][j]));\r\n }\r\n\r\n // Set the matrix value\r\n DPMatrix[i][j] = minimum;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Run the traceback\r\n String structure = structureTraceback();\r\n\r\n // Create file for writer\r\n File file = new File(\"5.o1\");\r\n\r\n // Create writer\r\n try {\r\n // Writer\r\n BufferedWriter writer = new BufferedWriter(new FileWriter(file));\r\n\r\n // Write sequence\r\n writer.write(sequence);\r\n writer.write('\\n');\r\n\r\n // Write MFE\r\n writer.write(Double.toString(DPMatrix[0][sequenceLength - 1]));\r\n writer.write('\\n');\r\n\r\n // Write structure\r\n writer.write(structure);\r\n\r\n // Close writer\r\n writer.close();\r\n\r\n } catch (IOException e) {\r\n // Print error\r\n System.out.println(\"Error opening file 5.o1\");\r\n }\r\n\r\n }", "public void addEvent(BasicEvent event) {\n if ((event instanceof TypedEvent)) {\n TypedEvent e = (TypedEvent) event;\n if (useOnePolarityOnlyEnabled) {\n if (useOffPolarityOnlyEnabled) {\n if (e.type == 1) {\n return;\n }\n } else {\n if (e.type == 0) {\n return;\n }\n }\n }\n }\n\n // save location for computing velocityPPT\n// float oldx = location.x, oldy = location.y;\n\n float m = mixingFactor, m1 = 1 - m;\n\n float dt = event.timestamp - lastTimestamp; // this timestamp may be bogus if it goes backwards in time, we need to check it later\n\n // if useVelocity is enabled, first update the location using the measured estimate of velocityPPT.\n // this will give predictor characteristic to cluster because cluster will move ahead to the predicted location of\n // the present event\n if (useVelocity && dt > 0 && velocityFitter.valid) {\n location.x = location.x + predictiveVelocityFactor * dt * velocityPPT.x;\n location.y = location.y + predictiveVelocityFactor * dt * velocityPPT.y;\n }\n\n // compute new cluster location by mixing old location with event location by using\n // mixing factor\n\n location.x = (m1 * location.x + m * event.x);\n location.y = (m1 * location.y + m * event.y);\n\n // velocityPPT of cluster is updated here as follows\n // 1. instantaneous velocityPPT is computed from old and new cluster locations and dt\n // 2. new velocityPPT is computed by mixing old velocityPPT with instaneous new velocityPPT using velocityMixingFactor\n // Since an event may pull the cluster back in the opposite direction it is moving, this measure is likely to be quite noisy.\n // It would be better to use the saved cluster locations after each packet is processed to perform an online regression\n // over the history of the cluster locations. Therefore we do not use the following anymore.\n// if(useVelocity && dt>0){\n// // update velocityPPT vector using old and new position only if valid dt\n// // and update it by the mixing factors\n// float oldvelx=velocityPPT.x;\n// float oldvely=velocityPPT.y;\n//\n// float velx=(location.x-oldx)/dt; // instantaneous velocityPPT for this event in pixels/tick (pixels/us)\n// float vely=(location.y-oldy)/dt;\n//\n// float vm1=1-velocityMixingFactor;\n// velocityPPT.x=vm1*oldvelx+velocityMixingFactor*velx;\n// velocityPPT.y=vm1*oldvely+velocityMixingFactor*vely;\n// velocityPPS.x=velocityPPT.x*VELPPS_SCALING;\n// velocityPPS.y=velocityPPT.y*VELPPS_SCALING;\n// }\n\n int prevLastTimestamp = lastTimestamp;\n lastTimestamp = event.timestamp;\n numEvents++;\n instantaneousISI = lastTimestamp - prevLastTimestamp;\n if (instantaneousISI <= 0) {\n instantaneousISI = 1;\n }\n avgISI = m1 * avgISI + m * instantaneousISI;\n instantaneousEventRate = 1f / instantaneousISI;\n avgEventRate = m1 * avgEventRate + m * instantaneousEventRate;\n\n averageEventDistance = m1 * averageEventDistance + m * distanceToLastEvent;\n averageEventXDistance = m1 * averageEventXDistance + m * xDistanceToLastEvent;\n averageEventYDistance = m1 * averageEventYDistance + m * yDistanceToLastEvent;\n \n // if scaling is enabled, now scale the cluster size\n scale(event);\n\n }", "double calculateGLBasicMass(int i1, int i2, int i3)\n {\n\n // Array of Glycerolipid's num of Carbon, Hydrogen repeated (for SN1 Dropdown Menu's values)\n int[] arrayGL_sn1 = {\n 5,10, 7,14, 9,18, 11,22, 13,26, 15,30, 16,32, 17,34,\n 17,32, 18,36, 18,34, 19,40, 19,38, 19,38, 19,36, 20,40,\n 20,38, 20,36, 21,44, 21,42, 21,42, 21,40, 21,40, 21,38,\n 21,36, 21,36, 21,34, 22,44, 23,48, 23,46, 23,46, 23,44,\n 23,42, 23,40, 23,38, 23,36, 24,48, 25,50, 25,48, 25,46,\n 25,44, 25,42, 25,40, 25,38, 26,52, 27,54, 27,52, 28,56, 29,58};\n\n // addCarbon array: Amount of increase in Carbon when on certain sn2 & sn3 index position\n int[] addCarbon = {\n 0, 2, 4, 6, 8, 10, 12, 13, 14, 14, 15, 15, 16, 16, 17, 17, 17,\n 18, 18, 18, 18, 18, 18, 18, 19, 20, 20, 20, 20,\t20,\t20, 21, 22,\n 22,\t22,\t22,\t22, 22, 22, 23, 24, 24, 25, 26 };\n\n // addHydrogen array: Amount of increase in Hydrogen when on certain sn2 & sn3 index position\n int[] addHydrogen = {\n 0, 2, 6, 10, 14, 18, 22, 24, 26, 24, 28, 26, 30, 28, 32, 30, 28,\n 34,\t32,\t32,\t30,\t28,\t28,\t26,\t36,\t38,\t36,\t34,\t32,\t30,\t28,\t40,\t42,\n 40,\t38,\t36,\t34,\t32,\t30,\t44,\t46,\t44,\t48,\t50 };\n\n // Get the # of C & H depending on the index position of SN1's dropdown menu\n int numOfC = arrayGL_sn1[i1 * 2], numOfH = arrayGL_sn1[i1 * 2 + 1];\n\n // Add carbon & hydrogen depending on SN2 and SN3 dropdown menu's index position\n numOfC = numOfC + addCarbon[i2] + addCarbon[i3];\n numOfH = numOfH + addHydrogen[i2] + addHydrogen[i3];\n\n /* Set Number of Carbon & Hydrogen */\n setNumC(numOfC); setNumH(numOfH);\n\n /* Set Number of Oxygen */\n\n // If SN1 Dropdown index is not O or P\n if (i1 != 11 && i1 != 12 && i1 != 18 && i1 != 19 && i1 != 28 && i1 != 29) {\n\n if (i2 == 0 && i3 == 0){ setNumO(4); }\n else if (i2 == 0 || i3 == 0) { setNumO(5); }\n else setNumO(6);\n\n // If SN1 Dropdown index is O or P\n } else {\n\n if (i2 == 0 && i3 == 0){ setNumO(3); }\n else if (i2 == 0 || i3 == 0) { setNumO(4); }\n else setNumO(5);\n }\n\n // Sets the basic mass based on the elemental composition of the monoisotopic distribution\n setMass(calculateInitialMass(getNumC(), getNumH(), getNumO(), getNumN(), getNumAg(),\n getNumLi(), getNumNa(), getNumK(), getNumCl(), getNumP(), getNumS(), getNumF()));\n\n // Return basic mass\n return getMass();\n }", "public void IPL(){ \r\n \r\n this.io.resetIOController();\r\n this.memory.resetMemory();\r\n \r\n /*** Pseudocode for ROM bootloader \r\n * Reads a file to memory starting at M(64) to EOF\r\n * \r\n * ADDR=64, X1=0\r\n * L1: R0 = io.readLine()\r\n * memory.set(ADDR+X1, R0)\r\n * X1++\r\n * checkForMore = io.checkStatus()\r\n * test checkForMore\r\n * jcc checkForMore to L1\r\n * jmp 64\r\n */ \r\n HashMap<Integer,String> ROM = new HashMap<>(); \r\n /************* Assembly for bootloader **************/\r\n ROM.put(00, \"00000000000000101111\"); // Trap Handler Table Start Position -> 47\r\n ROM.put(01, \"00000000000000101011\"); // Machine Fault Handler -> 42\r\n ROM.put( 9, \"11001100110011001100\"); // SECTION_TAG (Used for finding sections)\r\n ROM.put(10, \"000011 00 10 0 0 00000000\"); //10: LDA(2,0,0,0) -- reset ECX to 0 (index value) \r\n ROM.put(11, \"000011 00 11 0 0 00000000\"); //11: LDA(3,0,0,0) -- reset EDX to 0 (IO Status Ready) \r\n ROM.put(12, \"000001 00 01 0 0 00001001\"); //12: LDR(1,0,9) -- LOAD M(9) to EBX (SECTION_TAG)\r\n ROM.put(13, \"000010 00 10 0 0 00000110\" ); //13: STR(2,0,6) -- set M(6) to ECX \r\n ROM.put(14, \"101001 00 10 0 0 00000110\" ); //14: LDX(0, 2, 6) -- Set X(2) from M(6) (copied from ECX/0) \r\n ROM.put(15, \"101001 00 01 0 0 00000110\" ); //15: LDX(0, 1, 6) -- Set X(1) from M(6) (copied from ECX) \r\n ROM.put(16, \"111101 00 00 000000 0010\" ); //16: L1: IN(0, 2) -- read word from CardReader to EAX \r\n ROM.put(17, \"010110 00 01 0 0 00000000\" ); //17: TRR(0, 1) -- Test EAX against EBX (SECTION_TAG) \r\n ROM.put(18, \"001100 00 11 0 0 00011001\" ); //18: JCC(3,x, L2) -- JMP to L2 if EAX=EBX --- L2=25 \r\n ROM.put(19, \"000010 01 00 0 0 01000000\" ); //19: L3: STR(0,1,64i1) -- store EAX to ADDR+X1 (ADDR=64) \r\n ROM.put(20, \"101011 00 01 0 0 00000000\" ); //20: INX(1) -- X(1)++\r\n ROM.put(21, \"111111 00 00 000000 0010\" ); //21: CHK(0, 2) -- Check status of Card Reader to EAX \r\n ROM.put(22, \"010110 00 11 0 0 00000000\" ); //22: TRR(0, 3) -- Test EAX against EDX (IO Status Ready -- not done) \r\n ROM.put(23, \"001100 00 11 0 0 00010000\" ); //23: JCC(3,x, L1) -- JMP to L1 if EAX=EDX --- L1=16 \r\n ROM.put(24, \"001101 00 00 0 0 01000000\" ); //24: JMP(64) -- else: launch program by transferring control to 64 \r\n ROM.put(25, \"000011 01 10 0 0 01000000\" ); //25: L2: LDA(1,1,64i1) -- Load ADDR+X1 to ECX\r\n ROM.put(26, \"000010 10 10 0 0 00001000\" ); //26: STR(1,2,8) -- Store ECX to 8+X2\r\n ROM.put(27, \"101011 00 10 0 0 00000000\" ); //27: INX(2) -- X(2)++\r\n ROM.put(28, \"001101 00 00 0 0 00010011\" ); //28: JMP(19) -- JMP(L3) \r\n /***************** Error Handler ************************************/ \r\n ROM.put(32, \"000001 00 11 0 0 00000010\"); //32: LDR(3, 0, 2) -- restore PC to EDX (used on 41) \r\n ROM.put(33, \"000011 00 00 0 0 01000101\"); //33: LDA(0,72) -- Set EAX to 69 ('E')\r\n ROM.put(34, \"000011 00 01 0 0 01110010\"); //34: LDA(1,105) -- Set EBX to 114 ('r')\r\n ROM.put(35, \"000011 00 10 0 0 01101111\"); //35: LDA(2,13) -- Set ECX to 111 ('o')\r\n ROM.put(36, \"111110 00 00 000000 0001\"); //36: OUT(0,1) -- Output EAX ('E')\r\n ROM.put(37, \"111110 00 01 000000 0001\"); //37: OUT(1,1) -- Output EBX ('r')\r\n ROM.put(38, \"111110 00 01 000000 0001\"); //38: OUT(1,1) -- Output EBX ('r')\r\n ROM.put(39, \"111110 00 10 000000 0001\"); //39: OUT(2,1) -- Output ECX ('o')\r\n ROM.put(40, \"111110 00 01 000000 0001\"); //40: OUT(1,1) -- Output EBX ('r')\r\n ROM.put(41, \"000010 00 11 0 0 00000110\"); //41: STR(3,0,6) -- Store EDX to M(6)\r\n ROM.put(42, \"001101 00 00 1 0 00000110\"); //42: JMP(0,6) -- JMP to c(M(6))\r\n // Machine error entry point\r\n ROM.put(43, \"000001 00 11 0 0 00000100\"); // 43: LDR(3, 0, 4) -- restore PC to EDX (used on 41) \r\n ROM.put(44, \"000011 00 00 0 0 01001101\"); //44: LDA(0,72) -- Set EAX to 77 ('M') \r\n ROM.put(45, \"111110 00 00 000000 0001\"); //45: OUT(0,1) -- Output EAX ('M') \r\n ROM.put(46, \"001101 00 00 0 0 00100001\" ); //46: JMP(33) -- Jump to 33 \"MError\"\r\n // Create Trap Table Defaults\r\n for(int i=47;i<=63;i++){\r\n ROM.put(i, \"001101 00 00 0 0 00100000\"); // Set TRAP table locs all to 32 by default\r\n }\r\n \r\n // Read ROM contents into memory\r\n for (Map.Entry romEntry : ROM.entrySet()) { \r\n try {\r\n this.getMemory().engineerSetMemoryLocation(new Unit(13, (int)romEntry.getKey()), Word.WordFromBinaryString((String)romEntry.getValue()));\r\n } catch (MachineFaultException ex) {\r\n Logger.getLogger(Computer.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n \r\n try {\r\n this.getCpu().getBranchPredictor().scanMemory();\r\n } catch (MachineFaultException ex) {\r\n Logger.getLogger(Computer.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n //Transfer Control to ROM Bootloader\r\n this.getCpu().getControlUnit().setProgramCounter(new Unit(13, 10)); // Start at 10 \r\n this.cpu.setRunning(true); \r\n }", "private void Perform_LPM_II()\n {\n int zindex = get_z();\n int d = Utils.GetOperand_XXXXXXX11111XXXX(mMBR);\n int wordlocation = zindex >> 1;\n\n try\n {\n if (Utils.bit0(zindex))\n set_reg(d,(program_memory[wordlocation] & 0xff00) >> 8);\n else\n set_reg(d,program_memory[wordlocation] & 0x00ff);\n }\n catch (RuntimeException e) { } \n clockTick();\n clockTick();\n return;\n }", "public boolean[] map(LocusContext context, SAMRecord read) {\n boolean[] errorsPerCycle = new boolean[read.getReadLength() + 1];\n \n byte[] bases = read.getReadBases();\n byte[] contig = context.getReferenceContig().getBases();\n byte[] sq = (byte[]) read.getAttribute(\"SQ\");\n \n int totalMismatches = 0;\n \n for (int cycle = 0, offset = (int) context.getPosition(); cycle < bases.length; cycle++, offset++) {\n byte compBase;\n \n switch (contig[offset]) {\n case 'A':\n case 'a': compBase = 'A'; break;\n case 'C':\n case 'c': compBase = 'C'; break;\n case 'G':\n case 'g': compBase = 'G'; break;\n case 'T':\n case 't': compBase = 'T'; break;\n default: compBase = '.'; break;\n }\n \n if (compBase != '.') {\n if (useNextBestBase) {\n int nextBestBaseIndex = QualityUtils.compressedQualityToBaseIndex(sq[cycle]);\n byte nextBestBase;\n switch (nextBestBaseIndex) {\n case 0: nextBestBase = 'A'; break;\n case 1: nextBestBase = 'C'; break;\n case 2: nextBestBase = 'G'; break;\n case 3: nextBestBase = 'T'; break;\n default: nextBestBase = '.'; break;\n }\n \n if (nextBestBase != '.') {\n errorsPerCycle[cycle] = !(bases[cycle] == compBase || nextBestBase == compBase);\n totalMismatches = (!(bases[cycle] == compBase || nextBestBase == compBase)) ? 1 : 0;\n }\n } else {\n errorsPerCycle[cycle] = !(bases[cycle] == compBase);\n totalMismatches += (!(bases[cycle] == compBase)) ? 1 : 0;\n }\n }\n }\n \n /*\n if (totalMismatches > 4) {\n for (int cycle = 0; cycle < bases.length; cycle++) { System.out.print((char) bases[cycle]); } System.out.print(\"\\n\");\n for (int cycle = 0, offset = (int) context.getPosition(); cycle < bases.length; cycle++, offset++) { System.out.print((char) contig[offset]); } System.out.print(\"\\n\");\n System.out.println(totalMismatches + \"\\n\");\n }\n */\n\n // We encode that we saw a read in the last position of the array.\n // That way we know what to normalize by, and we get thread safety!\n errorsPerCycle[errorsPerCycle.length - 1] = true;\n \n return errorsPerCycle;\n }", "private final void addCalibrationRecords(final String userID, final NetcdfFile ncfile, final String sourceName,\r\n final String sourceURL, final Array dateArray, final Array offsetArray, final Array offsetSeArray,\r\n final Array slopeArray, final Array slopeSeArray, final Array covarianceArray, final int channelNum,\r\n final double sceneTb, final String radToTbConvFormula, final String tbToRadConvFormula,\r\n final Set<String> convVarsNames) throws BadArgumentException, InvalidFilenameException,\r\n DatasetReadException, VariableNotFoundException, ChannelNotFoundException, VariableReadException\r\n {\r\n // Check dimensions consistency.\r\n if ((dateArray.getShape()[0] != offsetArray.getShape()[0])\r\n || (dateArray.getShape()[0] != slopeArray.getShape()[0])\r\n || (dateArray.getShape()[0] != offsetSeArray.getShape()[0])\r\n || (dateArray.getShape()[0] != slopeSeArray.getShape()[0])\r\n || (dateArray.getShape()[0] != covarianceArray.getShape()[0]))\r\n {\r\n throw new BadArgumentException(\"array dimensions mismatch.\");\r\n }\r\n\r\n // Sweep arrays and add each record into the map.\r\n for (int i = 0; i < dateArray.getShape()[0]; i++)\r\n {\r\n Double dateDouble = dateArray.getDouble(i) * 1e3; // in [ms]\r\n Date date = new Date(dateDouble.longValue());\r\n\r\n // Read the conversion variables.\r\n Map<String, Double> convVars = new HashMap<String, Double>();\r\n for (String convVarName : convVarsNames)\r\n {\r\n // TODO: [Remove workaround when formulas are changed]\r\n // Restore 'c1' and 'c2', if they are in the formula...\r\n if (convVarName.equals(configManager.getGlobalAttributesNames().getC1()))\r\n {\r\n convVars.put(C1_VARNAME, NetcdfUtils.readDouble(ncfile, convVarName, i, channelNum));\r\n\r\n } else if (convVarName.equals(configManager.getGlobalAttributesNames().getC2()))\r\n {\r\n convVars.put(C2_VARNAME, NetcdfUtils.readDouble(ncfile, convVarName, i, channelNum));\r\n } else\r\n {\r\n convVars.put(convVarName, NetcdfUtils.readDouble(ncfile, convVarName, i, channelNum));\r\n }\r\n }\r\n\r\n // Create calibration record.\r\n CalibrationRecord calRecord = new CalibrationRecordImpl(radToTbConvFormula, tbToRadConvFormula, convVars,\r\n TB_VARNAME, RAD_VARNAME, offsetArray.getDouble(i), offsetSeArray.getDouble(i),\r\n slopeArray.getDouble(i), slopeSeArray.getDouble(i), covarianceArray.getDouble(i), sceneTb);\r\n\r\n // Add calibration record, if valid, to data for this user.\r\n if (calRecord.isValid())\r\n {\r\n dataForUser(userID).addRecord(date, sourceName, sourceURL, calRecord);\r\n\r\n // TODO: to be checked.\r\n // if single-point, add a second one, with same value, and shifted one second, so that\r\n // it can be plotted by dygraphs.\r\n if (dateArray.getShape()[0] == 1)\r\n {\r\n DateTime dt = new DateTime(date);\r\n dt = dt.plus(Seconds.ONE);\r\n\r\n dataForUser(userID).addRecord(dt.toDate(), sourceName, sourceURL, calRecord);\r\n }\r\n }\r\n }\r\n }", "private void getOriginalAndPedalData(List<Point> originalList) {\n\t\tfor (int i = 0; i < originalList.size() - 1; i++) {\n\t\t\tPoint point = (Point) originalList.get(i);\n\t\t\tPoint pedalPoint = getSpecificPedalByPoint(point);\n\t\t\t// int result = getVectorValue(pedalPoint, point, (Point) originalList.get(i + 1));\n\t\t\t\n\t\t\tdouble tmp = getDistance(point, pedalPoint);\n\t\t\t// double tmp = getHeightDistance(point, pedalPoint);\n\t\t\t\n\t\t\tthis.countM++;\n\t\t\t\n\t\t\tthis.aij += tmp;\n\t\t\tthis.dij += tmp;\n\t\t\tthis.sij += Math.abs(tmp - (this.aij / this.countM));\n\t\t}\n\t}", "public void sample_U() {\n\t\t//Note, sumU and sumUUT are update in the update function itself. Hence, when\n\t\t//sample_U is called after the 1 iteration of all vertices, we already have the sum.\n\t\t\n\t\t//meanU = (SUM U_i)/N\n\t\tRealVector meanU = params.sumU.mapMultiply(1.0/datasetDesc.getNumUsers());\n\t\t//meanS = (SUM (U_i*U_i')/N)\n\t\tRealMatrix meanS = params.sumUUT.scalarMultiply(1.0/datasetDesc.getNumUsers());\n\t\t\n\t\t//mu0 = (beta0*mu0 + meanU)/(beta0 + N)\n\t\tRealVector mu0_ = (params.mu0_U.mapMultiply(params.beta0_U).add(meanU)).mapDivide((params.beta0_U + datasetDesc.getNumUsers()));\n\t\t\n\t\tdouble beta0_ = params.beta0_U + datasetDesc.getNumUsers();\n\t\tint nu0_ = params.nu0_U + datasetDesc.getNumUsers();\n\t\t\n\t\t//W0 = inv( inv(W0) + N*meanS + (beta0*N/(beta0 + N))(mu0 - meanU)*(mu0 - meanU)'\n\t\tRealVector tmp = params.mu0_U.subtract(meanU);\n\t\tRealMatrix mu0_d_meanU_T = tmp.outerProduct(tmp); \n\t\tmu0_d_meanU_T = mu0_d_meanU_T.scalarMultiply((params.beta0_U*datasetDesc.getNumUsers()/(params.beta0_U + datasetDesc.getNumUsers())));\n\t\tRealMatrix invW0_ = params.invW0_U.add(params.sumUUT).add(mu0_d_meanU_T);\n\t\t\n\t\t//Update all the values.\n\t\tparams.mu0_U = mu0_;\n\t\tparams.beta0_U = beta0_;\n\t\tparams.nu0_U = nu0_;\n\t\tparams.invW0_U = invW0_;\n\t\tparams.W0_U = (new LUDecompositionImpl(invW0_)).getSolver().getInverse();\n\t\t\n\t\t//Sample lambda_U and mu_U from the Gaussian Wishart distribution\n\t\t// http://en.wikipedia.org/wiki/Normal-Wishart_distribution#Generating_normal-Wishart_random_variates\n\t\t//Draw lambda_U from Wishart distribution with scale matrix w0_U.\n\t\tparams.lambda_U = sampleWishart(params.invW0_U, params.nu0_U);\n\t\t//Compute cov = inv(beta0*lambda) \n\t\tRealMatrix cov = (new LUDecompositionImpl(params.lambda_U.scalarMultiply(params.beta0_U))).getSolver().getInverse();\n\t\t//Draw mu_U from multivariate normal dist with mean mu0_U and covariance inv(beta0*lambda)\n\t\tMultivariateNormalDistribution dist = new MultivariateNormalDistribution(params.mu0_U.toArray(), \n\t\t\t\tcov.getData());\n\t\tparams.mu_U = new ArrayRealVector(dist.sample());\n\t\t\n\t\t//Reset the sum of latent factors.\n\t\tparams.sumU.mapMultiply(0);\n\t\tparams.sumUUT.scalarMultiply(0);\n\t}", "@Override\n public void calculate(double[] x) {\n\n double prob = 0.0; // the log prob of the sequence given the model, which is the negation of value at this point\n Triple<double[][], double[][], double[][]> allParams = separateWeights(x);\n double[][] linearWeights = allParams.first();\n double[][] W = allParams.second(); // inputLayerWeights \n double[][] U = allParams.third(); // outputLayerWeights \n\n double[][] Y = null;\n if (flags.softmaxOutputLayer) {\n Y = new double[U.length][];\n for (int i = 0; i < U.length; i++) {\n Y[i] = ArrayMath.softmax(U[i]);\n }\n }\n\n double[][] What = emptyW();\n double[][] Uhat = emptyU();\n\n // the expectations over counts\n // first index is feature index, second index is of possible labeling\n double[][] E = empty2D();\n double[][] eW = emptyW();\n double[][] eU = emptyU();\n\n // iterate over all the documents\n for (int m = 0; m < data.length; m++) {\n int[][][] docData = data[m];\n int[] docLabels = labels[m];\n\n // make a clique tree for this document\n CRFCliqueTree cliqueTree = CRFCliqueTree.getCalibratedCliqueTree(docData, labelIndices, numClasses, classIndex,\n backgroundSymbol, new NonLinearCliquePotentialFunction(linearWeights, W, U, flags));\n\n // compute the log probability of the document given the model with the parameters x\n int[] given = new int[window - 1];\n Arrays.fill(given, classIndex.indexOf(backgroundSymbol));\n int[] windowLabels = new int[window];\n Arrays.fill(windowLabels, classIndex.indexOf(backgroundSymbol));\n\n if (docLabels.length>docData.length) { // only true for self-training\n // fill the given array with the extra docLabels\n System.arraycopy(docLabels, 0, given, 0, given.length);\n System.arraycopy(docLabels, 0, windowLabels, 0, windowLabels.length);\n // shift the docLabels array left\n int[] newDocLabels = new int[docData.length];\n System.arraycopy(docLabels, docLabels.length-newDocLabels.length, newDocLabels, 0, newDocLabels.length);\n docLabels = newDocLabels;\n }\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n int label = docLabels[i];\n double p = cliqueTree.condLogProbGivenPrevious(i, label, given);\n if (VERBOSE) {\n System.err.println(\"P(\" + label + \"|\" + ArrayMath.toString(given) + \")=\" + p);\n }\n prob += p;\n System.arraycopy(given, 1, given, 0, given.length - 1);\n given[given.length - 1] = label;\n }\n\n // compute the expected counts for this document, which we will need to compute the derivative\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n // for each possible clique at this position\n System.arraycopy(windowLabels, 1, windowLabels, 0, window - 1);\n windowLabels[window - 1] = docLabels[i];\n for (int j = 0; j < docData[i].length; j++) {\n Index<CRFLabel> labelIndex = labelIndices[j];\n // for each possible labeling for that clique\n int[] cliqueFeatures = docData[i][j];\n double[] As = null;\n double[] fDeriv = null;\n double[][] yTimesA = null;\n double[] sumOfYTimesA = null;\n\n if (j == 0) {\n As = NonLinearCliquePotentialFunction.hiddenLayerOutput(W, cliqueFeatures, flags);\n fDeriv = new double[inputLayerSize];\n double fD = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (useSigmoid) {\n fD = As[q] * (1 - As[q]); \n } else {\n fD = 1 - As[q] * As[q]; \n }\n fDeriv[q] = fD;\n }\n\n // calculating yTimesA for softmax\n if (flags.softmaxOutputLayer) {\n double val = 0;\n\n yTimesA = new double[outputLayerSize][numHiddenUnits];\n for (int ii = 0; ii < outputLayerSize; ii++) {\n yTimesA[ii] = new double[numHiddenUnits];\n }\n sumOfYTimesA = new double[outputLayerSize];\n\n for (int k = 0; k < outputLayerSize; k++) {\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Yk = Y[0];\n } else {\n Yk = Y[k];\n }\n double sum = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n val = As[q] * Yk[hiddenUnitNo];\n yTimesA[k][hiddenUnitNo] = val;\n sum += val;\n }\n }\n sumOfYTimesA[k] = sum;\n }\n }\n\n // calculating Uhat What\n int[] cliqueLabel = new int[j + 1];\n System.arraycopy(windowLabels, window - 1 - j, cliqueLabel, 0, j + 1);\n\n CRFLabel crfLabel = new CRFLabel(cliqueLabel);\n int givenLabelIndex = labelIndex.indexOf(crfLabel);\n double[] Uk = null;\n double[] UhatK = null;\n double[] Yk = null;\n double[] yTimesAK = null;\n double sumOfYTimesAK = 0;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n UhatK = Uhat[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[givenLabelIndex];\n UhatK = Uhat[givenLabelIndex];\n if (flags.softmaxOutputLayer) {\n Yk = Y[givenLabelIndex];\n }\n }\n\n if (flags.softmaxOutputLayer) {\n yTimesAK = yTimesA[givenLabelIndex];\n sumOfYTimesAK = sumOfYTimesA[givenLabelIndex];\n }\n\n for (int k = 0; k < inputLayerSize; k++) {\n double deltaK = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n int hiddenUnitNo = k / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n UhatK[hiddenUnitNo] += (yTimesAK[hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesAK);\n deltaK *= Yk[hiddenUnitNo];\n } else {\n UhatK[hiddenUnitNo] += As[k];\n deltaK *= Uk[hiddenUnitNo];\n }\n }\n } else {\n UhatK[k] += As[k];\n if (useOutputLayer) {\n deltaK *= Uk[k];\n }\n }\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n if (useOutputLayer) {\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n if (k == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n }\n }\n }\n\n for (int k = 0; k < labelIndex.size(); k++) { // labelIndex.size() == numClasses\n int[] label = labelIndex.get(k).getLabel();\n double p = cliqueTree.prob(i, label); // probability of these labels occurring in this clique with these features\n if (j == 0) { // for node features\n double[] Uk = null;\n double[] eUK = null;\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n eUK = eU[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[k];\n eUK = eU[k];\n if (flags.softmaxOutputLayer) {\n Yk = Y[k];\n }\n }\n if (useOutputLayer) {\n for (int q = 0; q < inputLayerSize; q++) {\n double deltaQ = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n eUK[hiddenUnitNo] += (yTimesA[k][hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesA[k]) * p;\n deltaQ = Yk[hiddenUnitNo];\n } else {\n eUK[hiddenUnitNo] += As[q] * p;\n deltaQ = Uk[hiddenUnitNo];\n }\n }\n } else {\n eUK[q] += As[q] * p;\n deltaQ = Uk[q];\n }\n if (useHiddenLayer)\n deltaQ *= fDeriv[q];\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n } else {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n }\n } else {\n double deltaK = 1;\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n double[] eWK = eW[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWK[cliqueFeatures[n]] += deltaK * p;\n }\n }\n } else { // for edge features\n for (int n = 0; n < cliqueFeatures.length; n++) {\n E[cliqueFeatures[n]][k] += p;\n }\n }\n }\n }\n }\n }\n\n if (Double.isNaN(prob)) { // shouldn't be the case\n throw new RuntimeException(\"Got NaN for prob in CRFNonLinearLogConditionalObjectiveFunction.calculate()\");\n }\n\n value = -prob;\n if(VERBOSE){\n System.err.println(\"value is \" + value);\n }\n\n // compute the partial derivative for each feature by comparing expected counts to empirical counts\n int index = 0;\n for (int i = 0; i < E.length; i++) {\n int originalIndex = edgeFeatureIndicesMap.get(i);\n\n for (int j = 0; j < E[i].length; j++) {\n derivative[index++] = (E[i][j] - Ehat[i][j]);\n if (VERBOSE) {\n System.err.println(\"linearWeights deriv(\" + i + \",\" + j + \") = \" + E[i][j] + \" - \" + Ehat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n if (index != edgeParamCount)\n throw new RuntimeException(\"after edge derivative, index(\"+index+\") != edgeParamCount(\"+edgeParamCount+\")\");\n\n for (int i = 0; i < eW.length; i++) {\n for (int j = 0; j < eW[i].length; j++) {\n derivative[index++] = (eW[i][j] - What[i][j]);\n if (VERBOSE) {\n System.err.println(\"inputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eW[i][j] + \" - \" + What[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n\n\n if (index != beforeOutputWeights)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != beforeOutputWeights(\"+beforeOutputWeights+\")\");\n\n if (useOutputLayer) {\n for (int i = 0; i < eU.length; i++) {\n for (int j = 0; j < eU[i].length; j++) {\n derivative[index++] = (eU[i][j] - Uhat[i][j]);\n if (VERBOSE) {\n System.err.println(\"outputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eU[i][j] + \" - \" + Uhat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n }\n\n if (index != x.length)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != x.length(\"+x.length+\")\");\n\n int regSize = x.length;\n if (flags.skipOutputRegularization || flags.softmaxOutputLayer) {\n regSize = beforeOutputWeights;\n }\n\n // incorporate priors\n if (prior == QUADRATIC_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w / 2.0 / sigmaSq;\n derivative[i] += k * w / sigmaSq;\n }\n } else if (prior == HUBER_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double w = x[i];\n double wabs = Math.abs(w);\n if (wabs < epsilon) {\n value += w * w / 2.0 / epsilon / sigmaSq;\n derivative[i] += w / epsilon / sigmaSq;\n } else {\n value += (wabs - epsilon / 2) / sigmaSq;\n derivative[i] += ((w < 0.0) ? -1.0 : 1.0) / sigmaSq;\n }\n }\n } else if (prior == QUARTIC_PRIOR) {\n double sigmaQu = sigma * sigma * sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w * w * w / 2.0 / sigmaQu;\n derivative[i] += k * w / sigmaQu;\n }\n }\n }", "private Matrix performCalibration(ArrayList<double[]> points2d, ArrayList<double[]> points3d) {\n\n\t\tSystem.out.println(\"out\");\n\t\t//create A, Chapter 7, pg 5\n\t\tdouble [] m = new double[2*points3d.size()*12];\n\n\t\tint width = 12;\n\t\tfor(int y = 0; y<points3d.size()*2; y++){\n\t\t\tfor(int x=0; x<width; x++){\n\t\t\t\tif((y%2)==0){\n\t\t\t\t\tif(x>=0 && x<4) {\n\t\t\t\t\t\t/*System.out.println(\"X \" + x);\n\t\t\t\t\t\tSystem.out.println(\"Y \" + y);\n\t\t\t\t\t\tSystem.out.println(\"SZ \" + points3d.size());\n\t\t\t\t\t\tif(x == 0 && y ==24){\n\t\t\t\t\t\t\tSystem.out.println(\"BREAK\");\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\tm[y * width + x] = points3d.get(y/2)[x];\n\t\t\t\t\t}\n\t\t\t\t\telse if(x>3 && x<8)\n\t\t\t\t\t\tm[y*width+x] = 0;\n\t\t\t\t\telse if(x>7 && x<12)\n\t\t\t\t\t\tm[y*width+x] = -(points3d.get(y/2)[x-8] * points2d.get(y/2)[0]);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(x>=0 && x<4)\n\t\t\t\t\t\tm[y*width+x] = 0;\n\t\t\t\t\telse if(x>3 && x<8)\n\t\t\t\t\t\tm[y*width+x] = points3d.get(y/2)[x-4];\n\t\t\t\t\telse if(x>7 && x<12)\n\t\t\t\t\t\tm[y*width+x] = -(points3d.get(y/2)[x-8] * points2d.get(y/2)[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//System.out.println(\"Finish\");\n\t\t//create matrix A\n\t\tMatrix A = new Matrix(points2d.size() * 2, 12, m);//rows,columns\n\n\t\tMatrix U = new Matrix ();\n\t\tMatrix D = new Matrix ();\n\t\tMatrix V = new Matrix ();\n\n\t\t//perform SVD2 on A\n\t\tA.SVD2(U,D,V);\n\n\t\tdouble[] rv = new double[12];\n\t\tMatrix p = new Matrix();\n\t\tV.getCol(V.cols-1,p);\n\n\t\tfor(int i=0; i<12; i++){\n\t\t\trv[i] = p.get(i,0)/p.get(11,0);\n\t\t}\n\n\t\treturn new Matrix(3, 4, rv);\n\t}", "public static void WeightedVector() throws FileNotFoundException {\n int doc = 0;\n for(Entry<String, List<Integer>> entry: dictionary.entrySet()) {\n List<Integer> wtg = new ArrayList<>();\n List<Double> newList = new ArrayList<>();\n wtg = entry.getValue();\n int i = 0;\n Double mul = 0.0;\n while(i<57) {\n mul = wtg.get(i) * idfFinal.get(doc);\n newList.add(i, mul);\n i++;\n }\n wtgMap.put(entry.getKey(),newList);\n doc++;\n }\n savewtg();\n }", "@Override\n\tprotected void updateDataFromRead(CountedData counter, final GATKSAMRecord gatkRead, final int offset, final byte refBase) {\n Object[][] covars;\n\t\ttry {\n\t\t\tcovars = (Comparable[][]) gatkRead.getTemporaryAttribute(getCovarsAttribute());\n\t\t\t// Using the list of covariate values as a key, pick out the RecalDatum from the data HashMap\n\t NestedHashMap data;\n\t data = dataManager.data;\n\t final Object[] key = covars[offset];\n\t\t\tBisulfiteRecalDatumOptimized datum = (BisulfiteRecalDatumOptimized) data.get( key );\n\t if( datum == null ) { // key doesn't exist yet in the map so make a new bucket and add it\n\t // initialized with zeros, will be incremented at end of method\n\t datum = (BisulfiteRecalDatumOptimized)data.put( new BisulfiteRecalDatumOptimized(), true, (Object[])key );\n\t }\n\n\t // Need the bases to determine whether or not we have a mismatch\n\t final byte base = gatkRead.getReadBases()[offset];\n\t final long curMismatches = datum.getNumMismatches();\n\t final byte baseQual = gatkRead.getBaseQualities()[offset];\n\n\t // Add one to the number of observations and potentially one to the number of mismatches\n\t datum.incrementBaseCounts( base, refBase, baseQual );\n\t increaseCountedBases(counter,1);\n\t\t\tincreaseNovelCountsBases(counter,1);\n\t\t\tincreaseNovelCountsMM(counter,(datum.getNumMismatches() - curMismatches));\n\t \n\t\t} catch (IllegalArgumentException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t} catch (IllegalAccessException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t} catch (InstantiationException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n //counter.novelCountsBases++;\n \n //counter.novelCountsMM += datum.getNumMismatches() - curMismatches; // For sanity check to ensure novel mismatch rate vs dnsnp mismatch rate is reasonable\n \n }", "static void computeLPSArray(String pat, int M, int lps[]) {\n int len = 0;\r\n int i = 1;\r\n lps[0] = 0; // lps[0] is always 0 \r\n\r\n // the loop calculates lps[i] for i = 1 to M-1 \r\n while (i < M) {\r\n if (pat.charAt(i) == pat.charAt(len)) {\r\n len++;\r\n lps[i] = len;\r\n i++;\r\n } else // (pat[i] != pat[len]) \r\n {\r\n // This is tricky. Consider the example. \r\n // AAACAAAA and i = 7. The idea is similar \r\n // to search step. \r\n if (len != 0) {\r\n len = lps[len - 1];\r\n\r\n // Also, note that we do not increment \r\n // i here \r\n } else // if (len == 0) \r\n {\r\n lps[i] = len;\r\n i++;\r\n }\r\n }\r\n }\r\n }", "private void extrapolation(HashMap<Long,Double> extraV){\n double g = 0;\n double h = 0;\n double newV = 0;\n for (long i=0; i<n; i++) {\n g = (oldv.get(i)-extraV.get(i));\n g = g*g;//compute g\n h = v.get(i) - 2*oldv.get(i) + extraV.get(i);\n newV = v.get(i) - g/h;\n if(g >= 1e-8 && h >= 1e-8){\n v.put(i, newV);\n }\n }\n }", "public void get_InputValues(){\r\n\tA[1]=-0.185900;\r\n\tA[2]=-0.85900;\r\n\tA[3]=-0.059660;\r\n\tA[4]=-0.077373;\r\n\tB[1]=30.0;\r\n\tB[2]=19.2;\r\n\tB[3]=13.8;\r\n\tB[4]=22.5;\r\n\tC[1]=4.5;\r\n\tC[2]=12.5;\r\n\tC[3]=27.5;\r\n\tD[1]=16.0;\r\n\tD[2]=10.0;\r\n\tD[3]=7.0;\r\n\tD[4]=5.0;\r\n\tD[5]=4.0;\r\n\tD[6]=3.0;\r\n\t\r\n}", "@SubscribeEvent(priority = EventPriority.NORMAL)\n\tpublic void getMapGenEvent(InitMapGenEvent event)\n\t{\n\t\tif (dimension == 0){\n\t\t\tswitch(event.getType()){\n\t\t\tcase CAVE:\n\t\t\t\tevent.setNewGen(CyborgUtils.caveGen); //= CyborgUtils.caveGen;\n\t\t\t\tbreak;\n\t\t\tcase CUSTOM:\n\t\t\t\tbreak;\n\t\t\tcase MINESHAFT:\n\t\t\t\tbreak;\n\t\t\tcase NETHER_BRIDGE:\n\t\t\t\tbreak;\n\t\t\tcase NETHER_CAVE:\n\t\t\t\tbreak;\n\t\t\tcase RAVINE:// TODO larger Ravines\n\t\t\t\tbreak;\n\t\t\tcase SCATTERED_FEATURE:\n\t\t\t\tbreak;\n\t\t\tcase STRONGHOLD:\n\t\t\t\tbreak;\n\t\t\tcase VILLAGE:\n\t\t\t\tbreak;\n\t\t\tcase OCEAN_MONUMENT: //TODO Uncomment this line for MC 1.8\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\n\t}", "void init_embedding() {\n\n\t\tg_heir = new int[50]; // handles up to 8^50 points\n\t\tg_levels = 0; // stores the point-counts at the associated levels\n\n\t\t// reset the embedding\n\n\t\tint N = m_gm.getNodeCount();\n\t\tif (areUsingSubset) {\n\t\t\tN = included_points.size();\n\t\t}\n\t\t\n\t\tm_embed = new float[N*g_embedding_dims];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tfor (int j = 0; j < g_embedding_dims; j++) {\n\t\t\t\tm_embed[i * (g_embedding_dims) + j] = ((float) (myRandom\n\t\t\t\t\t\t.nextInt(10000)) / 10000.f) - 0.5f;\n\t\t\t}\n\t\t}\n\n\t\t// calculate the heirarchy\n\t\tg_levels = fill_level_count(N, g_heir, 0);\n\t\tg_levels = 1;\n\t\t\n\t\t// generate vector data\n\n\t\tg_current_level = g_levels - 1;\n\t\tg_vel = new float[g_embedding_dims * N];\n\t\tg_force = new float[g_embedding_dims * N];\n\n\t\t// compute the index sets\n\n\t\tg_idx = new IndexType[N * (V_SET_SIZE + S_SET_SIZE)];\n\t\tfor (int i = 0; i < g_idx.length; i++) {\n\n\t\t\tg_idx[i] = new IndexType();\n\t\t}\n\n\t\tg_done = false; // controls the movement of points\n\t\tg_interpolating = false; // specifies if we are interpolating yet\n\n\t\tg_cur_iteration = 0; // total number of iterations\n\t\tg_stop_iteration = 0; // total number of iterations since changing\n\t\t\t\t\t\t\t\t// levels\n\t}", "@SuppressWarnings(\"unused\")\r\n private void findAbdomenVOI() {\r\n \r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM();\r\n int xcm = centerOfMass[0];\r\n int ycm = centerOfMass[1];\r\n\r\n ArrayList<Integer> xValsAbdomenVOI = new ArrayList<Integer>();\r\n ArrayList<Integer> yValsAbdomenVOI = new ArrayList<Integer>();\r\n\r\n // angle in radians\r\n double angleRad;\r\n \r\n for (int angle = 39; angle < 45; angle += 3) {\r\n int x, y, yOffset;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n scaleFactor = Math.tan(angleRad);\r\n x = xDim;\r\n y = ycm;\r\n yOffset = y * xDim;\r\n while (x > xcm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n x--;\r\n y = ycm - (int)((x - xcm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n x = xcm;\r\n y = 0;\r\n yOffset = y * xDim;\r\n while (y < ycm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n y++;\r\n x = xcm + (int)((ycm - y) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n x = 0;\r\n y = ycm;\r\n yOffset = y * xDim;\r\n while (x < xcm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n x++;\r\n y = ycm - (int)((xcm - x) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 225 && angle <= 315) {\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n x = xcm;\r\n y = yDim;\r\n yOffset = y * xDim;\r\n while (y < yDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n y--;\r\n x = xcm - (int)((y - ycm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n }\r\n } // end for (angle = 0; ...\r\n \r\n int[] x1 = new int[xValsAbdomenVOI.size()];\r\n int[] y1 = new int[xValsAbdomenVOI.size()];\r\n int[] z1 = new int[xValsAbdomenVOI.size()];\r\n for(int idx = 0; idx < xValsAbdomenVOI.size(); idx++) {\r\n x1[idx] = xValsAbdomenVOI.get(idx);\r\n y1[idx] = xValsAbdomenVOI.get(idx);\r\n z1[idx] = 0;\r\n }\r\n\r\n // make the VOI's and add the points to them\r\n abdomenVOI = new VOI((short)0, \"Abdomen\");\r\n abdomenVOI.importCurve(x1, y1, z1);\r\n\r\n\r\n }", "public static void addCNVTrack(String inDir, String outDir) {\n\t\tString[] split;\n\t\tString toWrite = \"\", chr, load;\n\t\tArrayList<Point> regions;\n\t\tint loc_min = Integer.MAX_VALUE, loc_max = Integer.MIN_VALUE;\n\t\tfloat min, max;\n\t\tFile[] files = (new File(inDir)).listFiles();\n\t\tfor (int i = 1; i<=22; i++) { //iterate through chromosomes\n\t\t\tif (i<=21)\n\t\t\t\tchr = Integer.toString(i);\n\t\t\telse\n\t\t\t\tchr = \"X\";\n\t\t\tSystem.out.println(\"chr\" + chr);\n\t\t\tfor (File file : files) {\n\t\t\t\tif (file.getName().indexOf(\".txt\")!=-1) {\n\t\t\t\t\tSystem.out.print(file.getName().split(\".txt\")[0] + \" \");\n\t\t\t\t\tload = FileOps.loadFromFile(file.getAbsolutePath());\n\t\t\t\t\tsplit = load.split(\"\\tchr\" + chr + \"\\t\"); //sans-\"chr\" for hepato\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttoWrite = \"\";\n\t\t\t\t\t\tregions = new ArrayList<Point>();\n\t\t\t\t\t\tmin = Float.MAX_VALUE; max = -1 * Float.MAX_VALUE;\n\t\t\t\t\t\tloc_min = Integer.MAX_VALUE; loc_max = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (int j = 1; j<split.length; j++) { //iterate through regions -- grab bounds\n\t\t\t\t\t\t\tif (Float.parseFloat(split[j].split(\"\\t\")[1].split(\"\\n\")[0]) > max)\n\t\t\t\t\t\t\t\tmax = Float.parseFloat(split[j].split(\"\\t\")[1].split(\"\\n\")[0]);\n\t\t\t\t\t\t\tif (Float.parseFloat(split[j].split(\"\\t\")[1].split(\"\\n\")[0]) < min)\n\t\t\t\t\t\t\t\tmin = Float.parseFloat(split[j].split(\"\\t\")[1].split(\"\\n\")[0]);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (Integer.parseInt(split[j].split(\"\\t\")[0]) < loc_min)\n\t\t\t\t\t\t\t\tloc_min = Integer.parseInt(split[j].split(\"\\t\")[0]);\n\t\t\t\t\t\t\tif (Integer.parseInt(split[j].split(\"\\t\")[0]) > loc_max)\n\t\t\t\t\t\t\t\tloc_max = Integer.parseInt(split[j].split(\"\\t\")[0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (int j = 1; j<split.length; j++) { //iterate through regions -- collect/merge\n\t\t\t\t\t\t\tif (regions.size()==0)\n\t\t\t\t\t\t\t\tregions.add(new Point(Integer.parseInt(split[j].split(\"\\t\")[0]), Integer.parseInt(split[j].split(\"\\t\")[0])\n\t\t\t\t\t\t\t\t\t\t, Float.parseFloat(split[j].split(\"\\t\")[1].split(\"\\n\")[0]) - min));\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tregions = cnvSplice(new Point(Integer.parseInt(split[j].split(\"\\t\")[0]), Integer.parseInt(split[j].split(\"\\t\")[0])\n\t\t\t\t\t\t\t\t\t\t, Float.parseFloat(split[j].split(\"\\t\")[1].split(\"\\n\")[0]) - min), regions);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(split.length + \" | \" + regions.size());\n\t\t\t\t\t\tfor (Point region : regions) //iterate through regions -- dump\n\t\t\t\t\t\t\tFileOps.appendToFile(outDir + \"/chr\" + chr + \".txt\", \"chr\" + chr + \" \" + region.x + \" \" + region.y + \" cn\" + (region.score / (float)region.z) + \" \" + Utils.normalize((float)Math.pow(2, Math.abs(region.score / (float)region.z)), (float)Math.pow(2, 0), (float)Math.pow(2, Math.abs(max - min)), 200, 900) + \" + \" + region.x + \" \" + region.y + \"\\n\");\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (Exception e) { e.printStackTrace(); System.out.println(\"throwing chr\" + chr); }\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\ttoWrite = \"browser position chr\" + chr + \":\" + loc_min + \"-\" + loc_max + \"\\nbrowser hide all\\n\"\n\t\t\t\t+ \"track name=\\\"CopyNumVar\\\" description=\\\" \\\" visibility=dense useScore=1\\n\";\n\t\t\tFileOps.writeToFile(outDir + \"/chr\" + chr + \".txt\", toWrite + FileOps.loadFromFile(outDir + \"/chr\" + chr + \".txt\"));\n\t\t}\n\t}", "public void updateFinalMaps() {\r\n\t\t//prints out probMap for each tag ID and makes new map with ln(frequency/denominator) for each\r\n\t\t//wordType in transMapTemp\r\n\t\tTreeMap<String, TreeMap<String, Float>> tagIDsFinal = new TreeMap<String, TreeMap<String, Float>>();\r\n\t\tfor (String key: this.transMapTemp.keySet()) {\r\n\t\t\tProbMap probMap = this.transMapTemp.get(key);\r\n\t\t\ttagIDsFinal.put(key, this.transMapTemp.get(key).map);\r\n\r\n\t\t\tfor (String key2: probMap.map.keySet()) {\r\n\t\t\t\ttagIDsFinal.get(key).put(key2, (float) Math.log(probMap.map.get(key2) / probMap.getDenominator()));\r\n\t\t\t\tSystem.out.println(key + \": \" + key2 + \" \" + tagIDsFinal.get(key).get(key2));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//makes new map with ln(frequency/denominator) for each word in emissionMapTemp\r\n\t\tTreeMap<String, TreeMap<String, Float>> emissionMapFinal = new TreeMap<String, TreeMap<String, Float>>();\r\n\t\tfor (String key: this.emissionMapTemp.keySet()) {\r\n\t\t\tProbMap probMap = this.emissionMapTemp.get(key);\r\n\t\t\temissionMapFinal.put(key, this.emissionMapTemp.get(key).map);\r\n\t\t\tfor (String key2: probMap.map.keySet()) {\r\n\r\n\t\t\t\temissionMapFinal.get(key).put(key2, (float) Math.log(probMap.map.get(key2) / probMap.getDenominator()));\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.transMap = tagIDsFinal;\r\n\t\tthis.emissionMap = emissionMapFinal;\t\t\r\n\t}", "private void buildScaleInputs(StateObservation stateObs) {\n viewWidth = 5;\n viewHeight = 10;\n //*****************************\n\n int blockSize;\n int avatarColNumber;\n\n int numGridRows, numGridCols;\n\n ArrayList<Observation>[][] gameGrid;\n\n gameGrid = stateObs.getObservationGrid();\n numGridRows = gameGrid[0].length;\n numGridCols = gameGrid.length;\n\n blockSize = stateObs.getBlockSize();\n\n // get where the player is\n avatarColNumber = (int) (stateObs.getAvatarPosition().x / blockSize);\n\n // create the inputs\n MLPScaledInputs = new double[viewWidth * viewHeight];\n\n int colStart = avatarColNumber - (viewWidth / 2);\n int colEnd = avatarColNumber + (viewWidth / 2);\n\n int index = 0;\n\n for (int i = numGridRows - (viewHeight + 1); i < viewHeight; i++) { // rows\n\n for (int j = colStart; j <= colEnd; j++) { // rows\n if (j < 0) {\n // left outside game window\n MLPScaledInputs[index] = 1;\n } else if (j >= numGridCols) {\n // right outside game window\n MLPScaledInputs[index + 1] = 1;\n } else if (gameGrid[j][i].isEmpty()) {\n MLPScaledInputs[index] = 0;\n } else {\n for (Observation o : gameGrid[j][i]) {\n\n switch (o.itype) {\n case 3: // obstacle sprite\n MLPScaledInputs[index + 2] = 1;\n break;\n case 1: // user ship\n MLPScaledInputs[index + 3] = 1;\n break;\n case 9: // alien sprite\n MLPScaledInputs[index + 4] = 1;\n break;\n case 6: // missile\n MLPScaledInputs[index + 5] = 1;\n break;\n }\n }\n }\n index++;\n }\n }\n }", "public void compute2() {\n\n ILineString lsInitiale = this.geom;\n ILineString lsLisse = Operateurs.resampling(lsInitiale, 1);\n // ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 10, 1);\n // ILineString\n // lsLisse=LissageGaussian.AppliquerLissageGaussien((GM_LineString)\n // lsInitiale, 10, 1, false);\n\n logger.debug(\"Gaussian Smoothing of : \" + lsInitiale);\n\n // On determine les séquences de virages\n List<Integer> listSequence = determineSequences(lsLisse);\n\n // On applique le filtre gaussien\n\n // On crée une collection de points qui servira à découper tous les\n // virages\n\n if (listSequence.size() > 0) {\n List<Integer> listSequenceFiltre = filtrageSequences(listSequence, 1);\n DirectPositionList dplPointsInflexionLsLissee = determinePointsInflexion(\n lsInitiale, listSequenceFiltre);\n\n for (IDirectPosition directPosition : dplPointsInflexionLsLissee) {\n this.jddPtsInflexion.add(directPosition.toGM_Point().getPosition());\n // dplPtsInflexionVirages.add(directPosition);\n }\n\n // jddPtsInflexion.addAll(jddPtsInflexionLsInitiale);\n\n }\n // dplPtsInflexionVirages.add(lsInitiale.coord().get(lsInitiale.coord().size()-1));\n\n }", "public static void main(String[] args){\n\t\tScanner input = new Scanner(System.in); \n\t\t\t\t\n\t\tSystem.out.print(\"Please input the string X: \" );\n\t\tString strX = input.nextLine(); \n\t\t\t\t\n\t\tSystem.out.println(\"Please input the component of transition matrix: \"); \n\t\tString transStr = input.nextLine();\n\t\t\n\t\tSystem.out.println(\"Please input the transition matrix: (AB * AB)\"); \n\t\t// copy: 0.641 0.359 0.729 0.271 0.117 0.691 0.192 0.097 0.42 0.483\n\t\t \n\t\t\n\t\tint dim = transStr.length(); \n\t\t\n\t\tdouble transition[][] = new double[dim][dim];\n\t\tfor(int i=0; i<dim; i++){\n\t\t\t\n\t\t\tfor(int j=0; j<dim; j++){\n\t\t\t\t\n\t\t\t\ttransition[i][j] = input.nextDouble();\n\t\t\t}\n\t\t\t\n\t\t}//end i<hmm.length(); \n\t\t\n\t\tprintMatrix(transition); \n\t\t\n\t\t//emission matrix\n\t\tSystem.out.println(\"Now input the emission matrix:\"); \n\t\t//copy: 0.117 0.691 0.192 0.097 0.42 0.483\n\t\t\n\t\tString Row = transStr;\t\t\t//\"AB\" in this case; \n\t\tString Col = \"xyz\"; \t\t//\"xyz\" in this case; \n\t\t\n\t\t//create a matrix for probability column given row\n\t\tdouble emission[][] = new double [Row.length()][Col.length()]; \n\t\tfor(int i=0; i<Row.length(); i++){\n\t\t\t\n\t\t\tfor(int j=0; j<Col.length(); j++){\n\t\t\t\t\n\t\t\t\temission[i][j] = input.nextDouble(); \t\t\t\t\n\n\t\t\t}\n\t\t\t\n\t\t}//end for i<Row.length(); \n\t\t\n\t\tprintMatrix(emission); \n\t\t\n\t\t//close the input scanner\n\t\tinput.close(); \n\t\t\n\t\t\n\t\t\n\t\t/**************************************************************************************************/\n\t\t//step 2, build a state-matrix \n\t\tdouble state[][] = new double[Row.length()][strX.length()]; \n\t\t\n\t\tfor(int i=0; i<Row.length(); i++){\n\t\t\t\n\t\t\tfor(int j=0; j<strX.length(); j++){\n\t\t\t\t\n\t\t\t\t//the state matrix will share the same Row name with the transition matrix; \n\t\t\t\tint row = i; \n\t\t\t\tint col = Col.indexOf( strX.charAt(j) );\n\t\t\t\t\n\t\t\t\tstate[i][j] = emission[row][col]; \n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tprintMatrix(state); \n\t\t\n\t\t/**************************************************************************************************/\n\t\t//Step 3, traverse through the string-X, check each character,\n\t\t\n\t\t//step 3.1, update the first column of the state[][] matrix; \n\t\t//for the first column of the state[][] matrix; \n\t\t// it could be the max of [AAx or BAx ]\n\t\t// or could be the max of [ABx or BBx ]\n\t\tint row = state.length; \n\t\tint col = state[0].length; \n\t\t\n\t\t\n\t\tfor( int i=0; i<row; i++){\n\t\t\t\n\t\t\t//when i = 0; the state[0][0] would be AAx or BAx, we take the greater value from AB*AB transition matrix first column, \n\t\t\t// \n\t\t\t//call maxOfcolumn() method to get the max value of a column.\n\t\t\tstate[i][0] = state[i][0] * maxOfColumn(transition, i); \n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tprintMatrix(state); \n\t\t\n\t\t\n\t\t\n\t\t//step 4, update all other elements in the state[][] matrix; \n\t\t\n\t\tfor(int i=1; i<col; i++){\n\t\t\t\n\t\t\tfor( int j=0; j<row; j++){\n\t\t\t\t\n\t\t\t\tstate[j][i] = state[j][i] * maxOfColumn(state, i-1); \n\t\t\t\t\n\t\t\t}//end for j<row loop; \n\t\t\t\n\t\t}//end for i<col loop; \n\t\t\n\t\tprintMatrix(state); \n\t\t\n\t\t\n\t\t//step 4, back trace the state[][] matrix, get the HMM hidden path; \n\t\tString hiddenPath = \"\"; \n\t\t\n\t\tfor(int i=0; i<col; i++){\n\t\t\t\n\t\t\tdouble currMax = 0.0; \n\t\t\tchar currChar = 'X';\n\t\t\t\n\t\t\tfor(int j=0; j<row; j++){\n\t\t\t\t\n\t\t\t\tif(state[j][i] > currMax){\n\t\t\t\t\t\n\t\t\t\t\tcurrMax = state[j][i]; \n\t\t\t\t\tcurrChar = Row.charAt(j); \n\t\t\t\t\t\n\t\t\t\t}//end if\n\t\t\t\t\n\t\t\t} //end for j<row loop \n\t\t\t\n\t\t\t\n\t\t\thiddenPath += currChar; \n\t\t} //end for i<col loop; \n\t\t\n\t\tSystem.out.println(\"The finial hidden path: \" + hiddenPath); \n\t\t\n\t\t/*****************************************************\n\t\t * \n\t\t * \n\t\tdouble prob = 1.0; \n\t\t\n\t\t//the probability of the very first char\n\t\t\n\t\tint col_first = Col.indexOf(strX.charAt(0)); \n\t\t\n\t\tdouble prob_max = 0;\n\t\tString hmm = \"\"; \n\t\t\n\t\tfor(int i=0; i<Row.length(); i++){\n\t\t\t\n\t\t\tif(emission[i][col_first] > prob_max) {\n\t\t\t\n\t\t\t\thmm = Row.charAt(i) + \"\"; \n\t\t\t\tprob_max = emission[i][col_first]; \n\t\t\t\t\t\n\t\t\t}\n\t\t\t\t//initial the first char of hmm;\t\t\t\n\t\t}\n\t\t\n\t\tprob *= prob_max; \n\t\t\n\t\t\n\t\t//1st, get HMM probability of AB/AA/BA/BB, whichever possbile at current character; \n\t\t//2nd, get emission probability\n\t\t//3rd, use emission probability*HMM, check the maximum probability; \n\t\tfor(int i=1; i<strX.length(); i++){\n\t\t\t\n\t\t\tSystem.out.println(\"hmm: \" + hmm); \n\t\t\t\n\t\t\tprob_max = 0.0; \n\t\t\tchar nextHMM = 'X'; \n\t\t\t\n\t\t\t// Here we know the prior Letter in the HMM hidden path is 'A'; \n\t\t\t// the current letter in the String-X is y;\n\t\t\t// so the current pattern could be AAy or ABy; \n\t\t\t\n\t\t\t//construct the pattern: String pattern = hmm.charAt(i-1) + \"A/B\" + strX.charAt(i); \n\t\t\t\n\t\t\tfor(int index = 0; index < Row.length(); index++){\n\t\t\t\t\n\t\t\t//\tString pattern = \"\" + hmm.charAt(i-1) + Row.charAt( index ) + strX.charAt(i); \n\t\t\t\t\n\t\t\t\tint transition_row = Row.indexOf( hmm.charAt(i-1) );\n\t\t\t\tint transition_col = Row.indexOf( Row.charAt( index) );\n\t\t\t\t\n\t\t\t\tint emission_row = transition_col; \n\t\t\t\tint emission_col = Col.indexOf( strX.charAt(i) ); \n\t\t\t\t\n\t\t\t\tdouble currProb = transition[transition_row][transition_col] * emission[emission_row][emission_col];\n\t\t\t\t\n\t\t\t\tif( currProb > prob_max){\n\t\t\t\t\t\n\t\t\t\t\tprob_max = currProb;\n\t\t\t\t\tnextHMM = Row.charAt(index); \n\t\t\t\t\t\n\t\t\t\t}//end if( currProb > prob_max)\n\t\t\t\t\n\t\t\t}//end index < Row.length(); \n\t\t\t\n\t\t\thmm += nextHMM; \n\t\t\t\n\t\t\tprob *= prob_max; \n\t\t\t\n\t\t} //end for i<strX.length() loop; \n\t\t\n\t\t\n\t\tSystem.out.println(\"The hmm: \" + hmm); \n\t\tSystem.out.println(\"The final probability is: \" + prob);\n\t\t\n\t\t*/\n\t\t\n\t}", "public double empiricalLikelihood(int numSamples, ArrayList<ArrayList<Integer>> testing) {\n\t\tNCRPNode[] path = new NCRPNode[numLevels];\n\t\tNCRPNode node;\n\t\t\n\t\tpath[0] = rootNode;\n\n\t\tArrayList<Integer> fs;\n\t\tint sample, level, type, token, doc, seqLen;\n\n\t\tDirichlet dirichlet = new Dirichlet(numLevels, alpha);\n\t\tdouble[] levelWeights;\n\t\t//dictionary\n\t\tdouble[] multinomial = new double[numTypes];\n\n\t\tdouble[][] likelihoods = new double[ testing.size() ][ numSamples ];\n\t\t\n\t\t//for each sample\n\t\tfor (sample = 0; sample < numSamples; sample++) {\n\t\t\tArrays.fill(multinomial, 0.0);\n\n\t\t\t//select a path\n\t\t\tfor (level = 1; level < numLevels; level++) {\n\t\t\t\tpath[level] = path[level-1].selectExisting();\n\t\t\t}\n\t \n\t\t\t//sample level weights\n\t\t\tlevelWeights = dirichlet.nextDistribution();\n\t \n\t\t\t//for each words in dictionary\n\t\t\tfor (type = 0; type < numTypes; type++) {\n\t\t\t\t//for each topic\n\t\t\t\tfor (level = 0; level < numLevels; level++) {\n\t\t\t\t\tnode = path[level];\n\t\t\t\t\tmultinomial[type] +=\n\t\t\t\t\t\tlevelWeights[level] * \n\t\t\t\t\t\t(eta + node.typeCounts[type]) /\n\t\t\t\t\t\t(etaSum + node.totalTokens);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//convert to log\n\t\t\tfor (type = 0; type < numTypes; type++) {\n\t\t\t\tmultinomial[type] = Math.log(multinomial[type]);\n\t\t\t}\n\n\t\t\t//calculate document likelihoods \n\t\t\tfor (doc=0; doc<testing.size(); doc++) {\n fs = testing.get(doc);\n seqLen = fs.size();\n \n for (token = 0; token < seqLen; token++) {\n type = fs.get(token);\n likelihoods[doc][sample] += multinomial[type];\n }\n }\n\t\t}\n\t\n double averageLogLikelihood = 0.0;\n double logNumSamples = Math.log(numSamples);\n for (doc=0; doc<testing.size(); doc++) {\n \t\n \t//find the max for normalization, avoid overflow of sum\n double max = Double.NEGATIVE_INFINITY;\n for (sample = 0; sample < numSamples; sample++) {\n if (likelihoods[doc][sample] > max) {\n max = likelihoods[doc][sample];\n }\n }\n\n double sum = 0.0;\n //normalize \n for (sample = 0; sample < numSamples; sample++) {\n sum += Math.exp(likelihoods[doc][sample] - max);\n }\n\n //calc average\n averageLogLikelihood += Math.log(sum) + max - logNumSamples;\n }\n\n\t\treturn averageLogLikelihood;\n }", "public static ArrayList<PitchCandidate> melodicCheck(ArrayList<PitchCandidate> pitch_candidates, ModeModule my_mode_module, MelodicVoice alter_me, \n Integer pitch_center, int voice_pitch_count, Integer previous_melody_pitch, Integer previous_melodic_interval, Boolean is_accent, Boolean prog_built) {\n Boolean large_dissonance_bad = InputParameters.large_dissonance_bad;\n Integer [] consonances = InputParameters.consonances;\n Integer [] perfect_consonances = InputParameters.perfect_consonances;\n Integer [] root_consonances = InputParameters.root_consonances;\n \n for (PitchCandidate myPC : pitch_candidates){\n int cand_pitch = myPC.getPitch();\n int melody_motion_to_cand = 0;\n \n //DEBUG\n //System.out.println(\"melodicCheck evaluating pitch candidate \" + cand_pitch);\n \n if (voice_pitch_count > 0) {\n melody_motion_to_cand = cand_pitch - previous_melody_pitch;\n \n \n //Check if The candidate has already followed the preceding pitch too often. \n //look for previous_melody_pitch in PitchCount\n //if it's there get how many times it's appeared in the melody\n // if the count is greater than samplesize threshold\n //check if there are previous_melody_pitch to pitch_candidate motions in MOtion Counts\n //if so get the motion count - then divide motion count by pitch count\n // get the percentage of motions from mode module\n //if actual count is greater than mode module percentage decrement\n\t\t\t\t\n double thresh = 0;\n\t\t\t\tDouble threshornull = my_mode_module.getMelodicMotionProbability(cand_pitch, previous_melody_pitch, key_transpose, 0);\n\t\t\t\tif (threshornull == null){\n //DEBUG\n //System.out.println(\"From mode module motion probability of \" + previous_melody_pitch %12 +\" to \" + cand_pitch%12 + \" is NULL\");\n myPC.decrementRank(Decrements.melodic_motion_quota_exceed);\n myPC.decrementRank(Decrements.improbable_melodic_motion);\n }\n else {\n thresh = threshornull;\n //DEBUG\n //System.out.println(\"From mode module, motion probability of \" + previous_melody_pitch%12 +\" to \" + cand_pitch%12 + \" = \" + thresh );\n }\n for (PitchCount my_pitch_count: pitch_counts) {\n if(my_pitch_count.getPitch() == previous_melody_pitch%12)\n\t\t\t\t\t\t//DEBUG\n //System.out.println(\"found preceding cp pitch \" + previous_melody_pitch%12 +\" in pitch counts with count \" + my_pitch_count.getCount());\n if(my_pitch_count.getCount() > sample_size) \n for (MotionCount my_motion_count: motion_counts){\n //DEBUG\n //System.out.println(\"pitch_count for \" + previous_melody_pitch %12 + \" = \" + my_pitch_count.getCount());\n //System.out.println(\"motion count for \" + my_motion_count.getPreviousPitch() + \"/\" + my_motion_count.getSucceedingPitch() + \"=\"+ my_motion_count.getCount());\n if (my_motion_count.getPreviousPitch()== previous_melody_pitch %12 && my_motion_count.getSucceedingPitch() == cand_pitch %12) {\n double actual = my_motion_count.getCount()/(double)my_pitch_count.getCount();\n //DEBUG\n //System.out.println(\"found \" + my_motion_count.getCount() + \" instances of motion from \" + previous_melody_pitch %12 + \" to \" +cand_pitch %12 );\n //System.out.println(\"frequency of motion from \" + previous_melody_pitch %12 + \" to \" + cand_pitch%12 + \" = \" + actual); \n if (actual >= thresh) {\n myPC.decrementRank(Decrements.melodic_motion_quota_exceed);\n //DEBUG\n //System.out.println(cand_pitch %12 + \" is approached too often from \" + previous_melody_pitch %12);\n }\n }\n }\n }\n }\n \n if (voice_pitch_count > 1){\n // Peak/Trough check\n // a melodic phrase should have no more than two peaks and two troughs\n // a peak is defined as a change in melodic direction \n // so when a candidate pitch wants to go in the opposite direction of \n // the previous melodic interval we want to increment the peak or trough count accordingly\n // and determine whether we have more than two peaks or more than two troughs\n // note that the melody can always go higher or lower than the previous peak or trough\n\n if (previous_melodic_interval < 0 && melody_motion_to_cand > 0 ) {// will there be a change in direction from - to + ie trough?\n if (previous_melody_pitch == trough && trough_count >=2) {\n myPC.decrementRank(Decrements.peak_trough_quota_exceed);\n //DEBUG\n //System.out.println(previous_melody_pitch + \" duplicates previous peak\");\n } //will this trough = previous trough? then increment\n } \n if (previous_melodic_interval > 0 && melody_motion_to_cand <0){ // will there be a trough?\n if (previous_melody_pitch == peak && peak_count >=2) {\n myPC.decrementRank(Decrements.peak_trough_quota_exceed);\n //DEBUG\n //System.out.println(previous_melody_pitch + \" duplicates previous trough\");\n } //will this trough = previous trough? then increment\n }\n\t\t\t\t\n //Motion after Leaps checks\n //First check if the melody does not go in opposite direction of leap\n // then check if there are two successive leaps in the same direction\n if (previous_melodic_interval > 4 && melody_motion_to_cand > 0){\n myPC.decrementRank(Decrements.bad_motion_after_leap);\n //DEBUG\n //System.out.println(melody_motion_to_cand + \" to \"+ cand_pitch + \" is bad motion after leap\");\n if (melody_motion_to_cand > 4) {\n myPC.decrementRank(Decrements.successive_leaps);\n //DEBUG\n //System.out.println(cand_pitch + \" is successive leap\");\n }\n \n } \n if (previous_melodic_interval < -4 && melody_motion_to_cand < 0){\n myPC.decrementRank(Decrements.bad_motion_after_leap);\n //DEBUG\n //System.out.println(melody_motion_to_cand + \" to \"+cand_pitch + \" is bad motion after leap\");\n if (melody_motion_to_cand < -4) {\n myPC.decrementRank(Decrements.successive_leaps); \n //DEBUG\n //System.out.println(cand_pitch + \" is successive leap\");\n }\n\n } \n } \n // end melody checks\n } //next pitch candidate\n return pitch_candidates; \n }", "void updatePercepts() {\n clearPercepts();\n\n Location r1Loc = model.getAgPos(0);\n Location r2Loc = model.getAgPos(1);\n\t\tLocation r3Loc = model.getAgPos(2);\n\t\tLocation r4Loc = model.getAgPos(3);\n\t\t\n Literal pos1 = Literal.parseLiteral(\"pos(r1,\" + r1Loc.x + \",\" + r1Loc.y + \")\");\n Literal pos2 = Literal.parseLiteral(\"pos(r2,\" + r2Loc.x + \",\" + r2Loc.y + \")\");\n\t\tLiteral pos3 = Literal.parseLiteral(\"pos(r3,\" + r3Loc.x + \",\" + r3Loc.y + \")\");\n\t\tLiteral pos4 = Literal.parseLiteral(\"pos(r4,\" + r4Loc.x + \",\" + r4Loc.y + \")\");\n\n addPercept(pos1);\n addPercept(pos2);\n\t\taddPercept(pos3);\n\t\taddPercept(pos4);\n\n if (model.hasObject(GARB, r1Loc)) {\n addPercept(g1);\n }\n if (model.hasObject(GARB, r2Loc)) {\n addPercept(g2);\n }\n\t\tif (model.hasObject(COAL, r4Loc)) {\n\t\t\taddPercept(c4);\t\n\t\t}\n }", "public void populateNoiseArray(double[] p_76308_1_, double p_76308_2_, double p_76308_4_, double p_76308_6_, int p_76308_8_, int p_76308_9_, int p_76308_10_, double p_76308_11_, double p_76308_13_, double p_76308_15_, double p_76308_17_) {\n/* 81 */ if (p_76308_9_ == 1) {\n/* */ \n/* 83 */ boolean var64 = false;\n/* 84 */ boolean var65 = false;\n/* 85 */ boolean var21 = false;\n/* 86 */ boolean var68 = false;\n/* 87 */ double var70 = 0.0D;\n/* 88 */ double var73 = 0.0D;\n/* 89 */ int var75 = 0;\n/* 90 */ double var77 = 1.0D / p_76308_17_;\n/* */ \n/* 92 */ for (int var30 = 0; var30 < p_76308_8_; var30++) {\n/* */ \n/* 94 */ double var31 = p_76308_2_ + var30 * p_76308_11_ + this.xCoord;\n/* 95 */ int var78 = (int)var31;\n/* */ \n/* 97 */ if (var31 < var78)\n/* */ {\n/* 99 */ var78--;\n/* */ }\n/* */ \n/* 102 */ int var34 = var78 & 0xFF;\n/* 103 */ var31 -= var78;\n/* 104 */ double var35 = var31 * var31 * var31 * (var31 * (var31 * 6.0D - 15.0D) + 10.0D);\n/* */ \n/* 106 */ for (int var37 = 0; var37 < p_76308_10_; var37++)\n/* */ {\n/* 108 */ double var38 = p_76308_6_ + var37 * p_76308_15_ + this.zCoord;\n/* 109 */ int var40 = (int)var38;\n/* */ \n/* 111 */ if (var38 < var40)\n/* */ {\n/* 113 */ var40--;\n/* */ }\n/* */ \n/* 116 */ int var41 = var40 & 0xFF;\n/* 117 */ var38 -= var40;\n/* 118 */ double var42 = var38 * var38 * var38 * (var38 * (var38 * 6.0D - 15.0D) + 10.0D);\n/* 119 */ int var19 = this.permutations[var34] + 0;\n/* 120 */ int var66 = this.permutations[var19] + var41;\n/* 121 */ int var67 = this.permutations[var34 + 1] + 0;\n/* 122 */ int var22 = this.permutations[var67] + var41;\n/* 123 */ var70 = lerp(var35, func_76309_a(this.permutations[var66], var31, var38), grad(this.permutations[var22], var31 - 1.0D, 0.0D, var38));\n/* 124 */ var73 = lerp(var35, grad(this.permutations[var66 + 1], var31, 0.0D, var38 - 1.0D), grad(this.permutations[var22 + 1], var31 - 1.0D, 0.0D, var38 - 1.0D));\n/* 125 */ double var79 = lerp(var42, var70, var73);\n/* 126 */ int var10001 = var75++;\n/* 127 */ p_76308_1_[var10001] = p_76308_1_[var10001] + var79 * var77;\n/* */ }\n/* */ \n/* */ } \n/* */ } else {\n/* */ \n/* 133 */ int var19 = 0;\n/* 134 */ double var20 = 1.0D / p_76308_17_;\n/* 135 */ int var22 = -1;\n/* 136 */ boolean var23 = false;\n/* 137 */ boolean var24 = false;\n/* 138 */ boolean var25 = false;\n/* 139 */ boolean var26 = false;\n/* 140 */ boolean var27 = false;\n/* 141 */ boolean var28 = false;\n/* 142 */ double var29 = 0.0D;\n/* 143 */ double var31 = 0.0D;\n/* 144 */ double var33 = 0.0D;\n/* 145 */ double var35 = 0.0D;\n/* */ \n/* 147 */ for (int var37 = 0; var37 < p_76308_8_; var37++) {\n/* */ \n/* 149 */ double var38 = p_76308_2_ + var37 * p_76308_11_ + this.xCoord;\n/* 150 */ int var40 = (int)var38;\n/* */ \n/* 152 */ if (var38 < var40)\n/* */ {\n/* 154 */ var40--;\n/* */ }\n/* */ \n/* 157 */ int var41 = var40 & 0xFF;\n/* 158 */ var38 -= var40;\n/* 159 */ double var42 = var38 * var38 * var38 * (var38 * (var38 * 6.0D - 15.0D) + 10.0D);\n/* */ \n/* 161 */ for (int var44 = 0; var44 < p_76308_10_; var44++) {\n/* */ \n/* 163 */ double var45 = p_76308_6_ + var44 * p_76308_15_ + this.zCoord;\n/* 164 */ int var47 = (int)var45;\n/* */ \n/* 166 */ if (var45 < var47)\n/* */ {\n/* 168 */ var47--;\n/* */ }\n/* */ \n/* 171 */ int var48 = var47 & 0xFF;\n/* 172 */ var45 -= var47;\n/* 173 */ double var49 = var45 * var45 * var45 * (var45 * (var45 * 6.0D - 15.0D) + 10.0D);\n/* */ \n/* 175 */ for (int var51 = 0; var51 < p_76308_9_; var51++) {\n/* */ \n/* 177 */ double var52 = p_76308_4_ + var51 * p_76308_13_ + this.yCoord;\n/* 178 */ int var54 = (int)var52;\n/* */ \n/* 180 */ if (var52 < var54)\n/* */ {\n/* 182 */ var54--;\n/* */ }\n/* */ \n/* 185 */ int var55 = var54 & 0xFF;\n/* 186 */ var52 -= var54;\n/* 187 */ double var56 = var52 * var52 * var52 * (var52 * (var52 * 6.0D - 15.0D) + 10.0D);\n/* */ \n/* 189 */ if (var51 == 0 || var55 != var22) {\n/* */ \n/* 191 */ var22 = var55;\n/* 192 */ int var69 = this.permutations[var41] + var55;\n/* 193 */ int var71 = this.permutations[var69] + var48;\n/* 194 */ int var72 = this.permutations[var69 + 1] + var48;\n/* 195 */ int var74 = this.permutations[var41 + 1] + var55;\n/* 196 */ int var75 = this.permutations[var74] + var48;\n/* 197 */ int var76 = this.permutations[var74 + 1] + var48;\n/* 198 */ var29 = lerp(var42, grad(this.permutations[var71], var38, var52, var45), grad(this.permutations[var75], var38 - 1.0D, var52, var45));\n/* 199 */ var31 = lerp(var42, grad(this.permutations[var72], var38, var52 - 1.0D, var45), grad(this.permutations[var76], var38 - 1.0D, var52 - 1.0D, var45));\n/* 200 */ var33 = lerp(var42, grad(this.permutations[var71 + 1], var38, var52, var45 - 1.0D), grad(this.permutations[var75 + 1], var38 - 1.0D, var52, var45 - 1.0D));\n/* 201 */ var35 = lerp(var42, grad(this.permutations[var72 + 1], var38, var52 - 1.0D, var45 - 1.0D), grad(this.permutations[var76 + 1], var38 - 1.0D, var52 - 1.0D, var45 - 1.0D));\n/* */ } \n/* */ \n/* 204 */ double var58 = lerp(var56, var29, var31);\n/* 205 */ double var60 = lerp(var56, var33, var35);\n/* 206 */ double var62 = lerp(var49, var58, var60);\n/* 207 */ int var10001 = var19++;\n/* 208 */ p_76308_1_[var10001] = p_76308_1_[var10001] + var62 * var20;\n/* */ } \n/* */ } \n/* */ } \n/* */ } \n/* */ }", "public void process(){\n\n for(int i = 0; i < STEP_SIZE; i++){\n String tmp = \"\" + accData[i][0] + \",\" + accData[i][1] + \",\"+accData[i][2] +\n \",\" + gyData[i][0] + \",\" + gyData[i][1] + \",\" + gyData[i][2] + \"\\n\";\n try{\n stream.write(tmp.getBytes());\n }catch(Exception e){\n //Log.d(TAG,\"!!!\");\n }\n\n }\n\n /**\n * currently we don't apply zero-mean, unit-variance operation\n * to the data\n */\n // only accelerator's data is using, currently 200 * 3 floats\n // parse the 1D-array to 2D\n\n if(recognizer.isInRecognitionState() &&\n recognizer.getGlobalRecognitionTimes() >= Constants.MAX_GLOBAL_RECOGNITIOME_TIMES){\n recognizer.resetRecognitionState();\n }\n if(recognizer.isInRecognitionState()){\n recognizer.removeOutliers(accData);\n recognizer.removeOutliers(gyData);\n\n double [] feature = new double [FEATURE_SIZE];\n recognizer.extractFeatures(feature, accData, gyData);\n\n int result = recognizer.runModel(feature);\n String ret = \"@@@\";\n if(result != Constants.UNDEF_RET){\n if(result == Constants.FINISH_RET){\n mUserWarningService.playSpeech(\"Step\" + Integer.toString(recognizer.getLastGesture()) + Constants.RIGHT_GESTURE_INFO);\n waitForPlayout(2000);\n mUserWarningService.playSpeech(Constants.FINISH_INFO);\n waitForPlayout(1);\n recognizer.resetLastGesutre();\n recognizer.resetRecognitionState();\n ret += \"1\";\n }else if(result == Constants.RIGHT_RET){\n mUserWarningService.playSpeech(\"Step\" + Integer.toString(recognizer.getLastGesture()) + Constants.RIGHT_GESTURE_INFO);\n waitForPlayout(2000);\n mUserWarningService.playSpeech(\"Now please do Step \" + Integer.toString(recognizer.getExpectedGesture()));\n waitForPlayout(1);\n ret += \"1\";\n }else if(result == Constants.ERROR_RET){\n mUserWarningService.playSpeech(Constants.WRONG_GESTURE_WARNING + recognizer.getExpectedGesture());\n waitForPlayout(1);\n ret += \"0\";\n }else if(result == Constants.ERROR_AND_FORWARD_RET){\n mUserWarningService.playSpeech(Constants.WRONG_GESTURE_WARNING + recognizer.getLastGesture());\n waitForPlayout(1);\n if(recognizer.getExpectedGesture() <= Constants.STATE_SPACE){\n mUserWarningService.playSpeech(\n \"Step \" + recognizer.getLastGesture() + \"missing \" +\n \". Now please do Step\" + Integer.toString(recognizer.getExpectedGesture()));\n waitForPlayout(1);\n }else{\n recognizer.resetRecognitionState();\n mUserWarningService.playSpeech(\"Recognition finished.\");\n waitForPlayout(1);\n }\n\n\n ret += \"0\";\n }\n ret += \",\" + Integer.toString(result) + \"@@@\";\n\n Log.d(TAG, ret);\n Message msg = new Message();\n msg.obj = ret;\n mWriteThread.writeHandler.sendMessage(msg);\n }\n }\n\n }", "public void adaptProductVector() {\t\t\r\n\t\tHashMap<Integer, Integer> neighboursAdaption = new HashMap<Integer, Integer>();\r\n\t\t\r\n\t\tdouble threshold = Parameters.adaptationThreshold / 100.0;\r\n\t\tint neighbours = 0;\r\n\t\t\r\n\t\tfor (int i = 0; i < Parameters.vectorSpaceSize; i++) {\r\n\t\t\tneighboursAdaption.put(i, 0);\r\n\t\t}\r\n\t\t\r\n\t\tfor (Object o: network.getAdjacent(this)) {\t\t\r\n\t\t\tif (o instanceof Customer) {\r\n\t\t\t\tCustomer c = (Customer)o;\r\n\t\t\t\t\r\n\t\t\t\tfor (int i = 0; i < Parameters.vectorSpaceSize; i++) {\r\n\t\t\t\t\tint count = neighboursAdaption.get(i);\r\n\t\t\t\t\tif (c.getDemandVector()[i] == 1) {\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tneighboursAdaption.put(i, count);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tneighbours++;\r\n\t\t}\r\n\t\t\r\n\t\tfor (int i = 0; i < Parameters.vectorSpaceSize; i++) {\r\n\t\t\tif ((double)neighboursAdaption.get(i) / neighbours >= threshold ) {\r\n\t\t\t\tdemandVector[i] = 1;\r\n\t\t\t}\r\n\t\t}\t\t \r\n\t}", "public void process(float[] sample) {\n\t\tfor (int i = 0; i < sample.length; i++) {\n\t\t\tfloat ms = sample[i] * (1 - Mixer);\n\t\t\t\n\t\t\tint j = (tap + 64) & Modulus;\n\t\t\tbuffer[j] = Mixer * buffer[j] + ms;\n\t\t\tj = (tap + 128) & Modulus;\n\t\t\tbuffer[j] = Mixer * buffer[j] + ms;\n\t\t\tj = (tap + 256) & Modulus;\n\t\t\tbuffer[j] = Mixer * buffer[j] + ms;\n\t\t\tj = (tap + 512) & Modulus;\n\t\t\tbuffer[j] = Mixer * buffer[j] + ms;\n\t\t\tj = (tap + 1024) & Modulus;\n\t\t\tbuffer[j] = Mixer * buffer[j] + ms;\n\t\t\tj = (tap + 2048) & Modulus;\n\t\t\tbuffer[j] = Mixer * buffer[j] + ms;\n\t\t\tj = (tap + 4096) & Modulus;\n\t\t\tbuffer[j] = Mixer * buffer[j] + ms;\n\t\t\tj = (tap + 8192) & Modulus;\n\t\t\tbuffer[j] = Mixer * buffer[j] + ms;\n\t\t\tj = (tap + 16384) & Modulus;\n\t\t\tbuffer[j] = Mixer * buffer[j] + ms;\n\t\t\tj = (tap + 32768) & Modulus;\n\t\t\tbuffer[j] = Mixer * buffer[j] + ms;\n\n\t\t\tj = tap++ & Modulus;\n\t\t\tsample[i] += buffer[j];\n\t\t}\n\t}", "private static void collectData(Cell cell){\n float distMidX = midX-cell.x;\n float distMidY = midY-cell.y;\n float thisDist = (float) (Math.sqrt(distMidX*distMidX+distMidY*distMidY));\n int thisAng = (int) (180.f*Math.atan2(distMidY,distMidX)/Math.PI);\n thisAng = (thisAng<0) ? thisAng+360 : (thisAng>360) ? thisAng-360 : thisAng;\n float tempT = (cell.quiescent) ? Pars.divMax/Pars.divConv : 1.f/(cell.envRespDiv()*Pars.divConv);\n Data.findDistStats(thisDist,thisAng,tempT,cell.envRespSp()/Pars.speedConv,cell.prevDiv/Pars.divConv,cell.prevSp/Pars.speedConv);//collect -> Data.popR\n Data.findIR(cell.x, cell.y, cell.pop);//collect infected and recruited sample\n }", "private static void getStat(){\n\t\tfor(int key : Initial_sequences.keySet()){\n\t\t\tint tmNo = Initial_sequences.get(key);\n\t\t\tif (tmNo > 13){\n\t\t\t\ttmInitLarge ++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(tmInit.containsKey(tmNo)){\n\t\t\t\t\tint temp = tmInit.get(tmNo);\n\t\t\t\t\ttemp++;\n\t\t\t\t\ttmInit.put(tmNo, temp);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttmInit.put(tmNo, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Go through all the proteins in SC\n\t\tfor(int key : SC_sequences.keySet()){\n\t\t\tint tmNo = SC_sequences.get(key);\n\t\t\t\n\t\t\tint loop = Loop_lengths.get(key);\n\t\t\tint tmLen = TM_lengths.get(key);\n\t\t\t\n\t\t\tLoopTotalLen = LoopTotalLen + loop;\n\t\t\tTMTotalLen = TMTotalLen + tmLen;\n\t\t\t\n\t\t\t\n\t\t\tif (tmNo > 13){\n\t\t\t\ttmSCLarge ++;\n\t\t\t\tLoopLargeLen = LoopLargeLen + loop;\n\t\t\t\tTMLargeLen = TMLargeLen + tmLen;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(tmSC.containsKey(tmNo)){\n\t\t\t\t\tint temp = tmSC.get(tmNo);\n\t\t\t\t\ttemp++;\n\t\t\t\t\ttmSC.put(tmNo, temp);\n\t\t\t\t\t\n\t\t\t\t\tint looptemp = Loop_SC.get(tmNo);\n\t\t\t\t\tlooptemp = looptemp + loop;\n\t\t\t\t\tLoop_SC.put(tmNo, looptemp);\n\t\t\t\t\t\n\t\t\t\t\tint tmlenTemp = TM_len_SC.get(tmNo);\n\t\t\t\t\ttmlenTemp = tmlenTemp + tmLen;\n\t\t\t\t\tTM_len_SC.put(tmNo, tmlenTemp);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttmSC.put(tmNo, 1);\n\t\t\t\t\t\n\t\t\t\t\tLoop_SC.put(tmNo, 1);\n\t\t\t\t\tTM_len_SC.put(tmNo, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void CalculatePPMI(boolean readFromFile, boolean writeToFile) {\n\t\t\n\t\tlong startTime = System.currentTimeMillis();\n\n\t\tSystem.out.println(\"\\nConverting matrix to use PPMI values...\");\n\t\tSystem.out.println(\"Memory used: \" + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / Math.pow(1000, 3) + \" GB\");\n\n\t\tfloat[][] C = null;\n\t\tfloat[][] newC = null;\n\n\t\t// Variables\n\t\tfloat matrixSum = 0f;\n\t\tfloat matrixDelta = 0f;\n\t\t\n\t\tfloat cellValue = 0f;\n\t\tfloat cellProbability = 0f;\n\t\t\n\t\tfloat rowSum = 0f;\n\t\tfloat rowDelta = 0f;\n\t\tfloat rowProbability = 0f;\n\t\t\n\t\tfloat colSum = 0f;\n\t\tfloat colDelta = 0f;\n\t\tfloat colProbability = 0f;\n\t\t\n\t\tfloat logValue = 0f;\n\t\tfloat maxValue = 0f;\n\t\tfloat PPMI = 0f;\n\n\t\t// Read from file if necessary\n\t\tif(readFromFile) {\n\t\t\t\n\t\t\tnewC = new float[this.V][this.V];\n\t\t\tSystem.out.println(\"Memory used: \" + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / Math.pow(1000, 3) + \" GB\");\n\t\t\t\t\t\n\t\t\ttry {\n\n\t\t\t\t// Read file\n\t\t\t\tRandomAccessFile file = new RandomAccessFile(\"context-matrix.raf\", \"r\");\n\t\t\t\t\n\t\t\t\tString line;\n\t\t\t\tString[] values;\n\t\t\t\tint rowNum = 0;\n\t\t\t\tint colNum = 0;\n\t\t\t\tfloat currentNum = 0f;\n\t\t\t\tint count = 0;\n\t\t\t\twhile((line = file.readLine()) != null) {\n\t\t\t\t\t\n\t\t\t\t\t// Check row num\n\t\t\t\t\tif(rowNum >= this.V) break;\n\t\t\t\t\t\n\t\t\t\t\tvalues = line.split(\" \");\n\t\t\t\t\t\n\t\t\t\t\tfor(String value : values) {\n\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcurrentNum = Float.parseFloat(value);\n\n\t\t\t\t\t\t// Calculate PPMI and store value in newC\n\t\t\t\t\t\tif(currentNum != 0 && currentNum < 16) {\n\t\t\t\t\t\t\tcellProbability = currentNum / this.matrixSum;\n\t\t\t\t\t\t\trowProbability = this.rowSums[rowNum] / this.matrixSum;\n\t\t\t\t\t\t\tcolProbability = this.colSums[colNum] / this.matrixSum;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tlogValue = cellProbability / (rowProbability * colProbability);\n\t\t\t\t\t\t\tmaxValue = (float) (Math.log10(logValue) / Math.log10(2));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tPPMI = Math.max(maxValue, 0);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tnewC[rowNum][colNum] = PPMI;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(count % 1000000 == 0)\n\t\t\t\t\t\t\tSystem.out.println(\"Progress: \" + (count / 1000000) + \" / \" + (((long)newC.length * (long)newC[0].length) / 1000000));\n\n\t\t\t\t\t\tcolNum++;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tcolNum = 0;\n\t\t\t\t\trowNum++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Close file\n\t\t\t\tfile.close();\n\t\t\t\t\n\t\t\t\t// Store new matrix on instance object\n\t\t\t\tthis.TermContextMatrix_PPMI = newC;\n\t\t\t\tif(this.TermContextMatrix_PPMI == null) System.out.println(\"PPMI term-context matrix is null.\");\n\n\t\t\t} catch(IOException e0) {\n\t\t\t\te0.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\tC = this.TermContextMatrix_FREQ;\n\t\t\tnewC = new float[C.length][C[0].length];\n\n\t\t\t// Calculate matrix sum\n\t\t\tfor(int i = 0; i < C.length; i++) {\n\t\t\t\tfor(int j = 0; j < C[i].length; j++) {\n\t\t\t\t\tmatrixDelta = C[i][j];\n\t\t\t\t\tmatrixSum += matrixDelta;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// For each cell\n\t\t\tfor(int u = 0; u < C.length; u++) {\n\t\t\t\t\n\t\t\t\t// Calculate row sum\n\t\t\t\tfor(int r = 0; r < C[u].length; r++) {\n\t\t\t\t\trowDelta = C[u][r];\n\t\t\t\t\trowSum += rowDelta;\n\t\t\t\t}\n\t\t\t\trowProbability = rowSum / matrixSum;\n\t\t\t\t\n\t\t\t\tfor(int v = 0; v < C[u].length; v++) {\n\t\t\t\t\t\n\t\t\t\t\tcellValue = C[u][v];\n\t\t\t\t\t\n\t\t\t\t\tif(u != v && cellValue != 0) {\n\n\t\t\t\t\t\t// Calculate cell probability\n\t\t\t\t\t\tcellProbability = cellValue / matrixSum;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Calculate col sum\n\t\t\t\t\t\tfor(int c = 0; c < C.length; c++) {\n\t\t\t\t\t\t\tcolDelta = C[c][v];\n\t\t\t\t\t\t\tcolSum += colDelta;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcolProbability = (float) (Math.pow(colSum, 0.75) / Math.pow(matrixSum, 0.75));\n\n\t\t\t\t\t\tlogValue = cellProbability / (rowProbability * colProbability);\n\t\t\t\t\t\tmaxValue = (float) (Math.log10(logValue) / Math.log10(2));\n\t\t\t\t\t\t\n\t\t\t\t\t\tPPMI = Math.max(maxValue, 0);\n\t\t\t\t\t\t\n\t\t\t\t\t\tnewC[u][v] = PPMI;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.TermContextMatrix_PPMI = newC;\t\t\t\n\t\t}\n\n\t\tSystem.out.println(\"Matrix converted.\");\n\n\t\tlong endTime = System.currentTimeMillis();\n\t\t\n\t\tSystem.out.println(\"Time taken: \" + (endTime - startTime) + \" ms\");\n\t\t\n\t\tif(writeToFile) {\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tWriteMatrixToDisk(this.TermContextMatrix_PPMI);\n\t\t\t\n\t\t\t\t// Save any settings pertaining to the matrix for later use\n\t\t\t\tBufferedWriter settingsBw = new BufferedWriter(new FileWriter(\"settings.txt\"));\n\t\t\t\tsettingsBw.write(\"V \" + this.V + \"\\n\");\n\t\t\t\tsettingsBw.close();\n\t\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t}", "public void buildModel() {\n double loss_pre = Double.MAX_VALUE;\n for (int iter = 0; iter < maxIter; iter ++) {\n Long start = System.currentTimeMillis();\n if (showProgress)\n System.out.println(\"Iteration \"+(iter+1)+\" started\");\n // Update user latent vectors\n IntStream.range(0,userCount).parallel().peek(i->update_user(i)).forEach(j->{});\n /*\n for (int u = 0; u < userCount; u ++) {\n update_user(u);\n }\n */\n if (showProgress) {\n System.out.println(\"Users updated for \" + (System.currentTimeMillis() - start) + \"millis\");\n start = System.currentTimeMillis();\n }\n\n IntStream.range(0,itemCount).parallel().peek(i->update_item(i)).forEach(j->{});\n // Update item latent vectors\n /*\n for (int i = 0; i < itemCount; i ++) {\n update_item(i);\n }\n */\n if (showProgress) {\n System.out.println(\"Items updated for \" + (System.currentTimeMillis() - start) + \"millis\");\n start = System.currentTimeMillis();\n }\n\n // Show loss\n if (showLoss)\n loss_pre = showLoss(iter, start, loss_pre);\n\n\n } // end for iter\n\n }", "public static void test(String[] args) throws Exception {\n\t\tAbstractPILPDelegate.setDebugMode(null);\r\n\t\t\r\n\t\tComputeCostBasedOnFreq ins = new ComputeCostBasedOnFreq();\r\n\t\tins.initPreMapping(\"D:/data4code/replay/pre.csv\");\r\n\t\tins.getEventSeqForEachPatient(\"D:/data4code/cluster/LogBasedOnKmeansPlusPlus-14.csv\");\r\n\t\tins.removeOneLoop();\r\n\r\n\t\tPetrinetGraph net = null;\r\n\t\tMarking initialMarking = null;\r\n\t\tMarking[] finalMarkings = null; // only one marking is used so far\r\n\t\tXLog log = null;\r\n\t\tMap<Transition, Integer> costMOS = null; // movements on system\r\n\t\tMap<XEventClass, Integer> costMOT = null; // movements on trace\r\n\t\tTransEvClassMapping mapping = null;\r\n\r\n\t\tnet = constructNet(\"D:/data4code/mm.pnml\");\r\n\t\tinitialMarking = getInitialMarking(net);\r\n\t\tfinalMarkings = getFinalMarkings(net);\r\n\t\tXParserRegistry temp=XParserRegistry.instance();\r\n\t\ttemp.setCurrentDefault(new XesXmlParser());\r\n\t\tlog = temp.currentDefault().parse(new File(\"D:/data4code/mm.xes\")).get(0);\r\n//\t\tlog = XParserRegistry.instance().currentDefault().parse(new File(\"d:/temp/BPI2013all90.xes.gz\")).get(0);\r\n\t\t//\t\t\tlog = XParserRegistry.instance().currentDefault().parse(new File(\"d:/temp/BPI 730858110.xes.gz\")).get(0);\r\n\t\t//\t\t\tlog = XFactoryRegistry.instance().currentDefault().openLog();\r\n\t\tcostMOS = constructMOSCostFunction(net);\r\n\t\tXEventClass dummyEvClass = new XEventClass(\"DUMMY\", 99999);\r\n\t\tXEventClassifier eventClassifier = XLogInfoImpl.STANDARD_CLASSIFIER;\r\n\t\tcostMOT = constructMOTCostFunction(net, log, eventClassifier, dummyEvClass);\r\n\t\tmapping = constructMapping(net, log, dummyEvClass, eventClassifier);\r\n\r\n\t\tint cost1 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n\t\t\t\tmapping, false);\r\n\t\tSystem.out.println(cost1);\r\n\t\t\r\n//\t\tint iteration = 0;\r\n//\t\twhile (true) {\r\n//\t\t\tSystem.out.println(\"start: \" + iteration);\r\n//\t\t\tlong start = System.currentTimeMillis();\r\n//\t\t\tint cost1 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n//\t\t\t\t\tmapping, false);\r\n//\t\t\tlong mid = System.currentTimeMillis();\r\n//\t\t\tSystem.out.println(\" With ILP cost: \" + cost1 + \" t: \" + (mid - start));\r\n//\r\n//\t\t\tlong mid2 = System.currentTimeMillis();\r\n//\t\t\tint cost2 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n//\t\t\t\t\tmapping, false);\r\n//\t\t\tlong end = System.currentTimeMillis();\r\n//\r\n//\t\t\tSystem.out.println(\" No ILP cost: \" + cost2 + \" t: \" + (end - mid2));\r\n//\t\t\tif (cost1 != cost2) {\r\n//\t\t\t\tSystem.err.println(\"ERROR\");\r\n//\t\t\t}\r\n//\t\t\t//System.gc();\r\n//\t\t\tSystem.out.flush();\r\n//\t\t\titeration++;\r\n//\t\t}\r\n\r\n\t}", "public void learnVector(final Calendar when, final List<Double> vals);", "public void calcInc(int np)\n\t{\n \n findSpecEq();\n int nofc=numberOfComponents;\n fvec.timesEquals(0.0);\n fvec.set(nofc+1,0,1.0);\n Matrix dxds=Jac.solve(fvec);\n if (np<5)\n {\n double dp=0.01;\n ds=dp/dxds.get(nofc+1,0);\n Xgij.setMatrix(0,nofc+1,np-1,np-1,u);\n dxds.timesEquals(ds);\n // dxds.print(0,10);\n u.plusEquals(dxds);\n // Xgij.print(0,10);\n// u.print(0,10);\n }\n else\n {\n //System.out.println(\"iter \" +iter + \" np \" + np);\n if (iter>6)\n { \n ds *= 0.5;\n System.out.println(\"ds > 6\");\n }\n \n else\n {\n if (iter<3) {\n ds *= 1.5;\n }\n if (iter==3) {\n ds *= 1.1;\n }\n if (iter==4) {\n ds *= 1.0;\n }\n if (iter>4) {\n ds *= 0.5;\n }\n \n// Now we check wheater this ds is greater than dTmax and dPmax.\n if(Math.abs(system.getTemperature()*dxds.get(nofc,0)*ds)>dTmax){\n // System.out.println(\"true T\");\n ds=sign(dTmax/system.getTemperature()/Math.abs(dxds.get(nofc,0)),ds);\n }\n \n if(Math.abs(system.getPressure()*dxds.get(nofc+1,0)*ds)>dPmax)\n {\n ds=sign(dPmax/system.getPressure()/Math.abs(dxds.get(nofc+1,0)),ds);\n // System.out.println(\"true P\");\n }\n if (etterCP2) {\n etterCP2=false;\n ds = 0.5*ds;\n }\n \n Xgij.setMatrix(0,nofc+1,0,2,Xgij.getMatrix(0,nofc+1,1,3)); \n Xgij.setMatrix(0,nofc+1,3,3,u);\n s.setMatrix(0,0,0,3,Xgij.getMatrix(speceq,speceq,0,3));\n // s.print(0,10);\n // System.out.println(\"ds1 : \" + ds);\n calcInc2(np);\n // System.out.println(\"ds2 : \" + ds);\n \n// Here we find the next point from the polynomial.\n \n }\n }\n }", "private void Perform_LPM_I()\n {\n int zindex = get_z();\n int wordlocation = zindex >> 1;\n try\n {\n if (Utils.bit0(zindex))\n set_reg(0,(program_memory[wordlocation] & 0xff00) >> 8);\n else\n set_reg(0,program_memory[wordlocation] & 0x00ff);\n }\n catch (RuntimeException e) { } \n clockTick();\n clockTick();\n return;\n }", "public static void OPLWriteReg(FM_OPL OPL, int r, int v) {\n\n OPL_CH CH;\n int slot;\n int block_fnum;\n switch (r & 0xe0) {\n case 0x00:\n /* 00-1f:controll */\n\n switch (r & 0x1f) {\n\n case 0x01:\n /* wave selector enable */\n if ((OPL.type & OPL_TYPE_WAVESEL) != 0) {\n /*RECHECK*/\n OPL.wavesel = ((v & 0x20) & 0xFF);\n if (OPL.wavesel == 0) {\n /* preset compatible mode */\n int c;\n for (c = 0; c < OPL.max_ch; c++) {\n OPL.P_CH[c].SLOT[SLOT1].wt_offset = 0;\n OPL.P_CH[c].SLOT[SLOT1].wavetable = SIN_TABLE;//OPL->P_CH[c].SLOT[SLOT1].wavetable = &SIN_TABLE[0];\n OPL.P_CH[c].SLOT[SLOT2].wavetable = SIN_TABLE;//OPL->P_CH[c].SLOT[SLOT2].wavetable = &SIN_TABLE[0];\n }\n }\n }\n return;\n case 0x02:\n /* Timer 1 */\n\n OPL.T[0] = (256 - v) * 4;\n break;\n case 0x03:\n /* Timer 2 */\n\n OPL.T[1] = (256 - v) * 16;\n return;\n case 0x04:\n /* IRQ clear / mask and Timer enable */\n\n if ((v & 0x80) != 0) {\n /* IRQ flag clear */\n\n OPL_STATUS_RESET(OPL, 0x7f);\n } else {\n /* set IRQ mask ,timer enable*/\n /*RECHECK*/\n\n int/*UINT8*/ st1 = ((v & 1) & 0xFF);\n /*RECHECK*/\n int/*UINT8*/ st2 = (((v >> 1) & 1) & 0xFF);\n\n /* IRQRST,T1MSK,t2MSK,EOSMSK,BRMSK,x,ST2,ST1 */\n OPL_STATUS_RESET(OPL, v & 0x78);\n OPL_STATUSMASK_SET(OPL, ((~v) & 0x78) | 0x01);\n /* timer 2 */\n if (OPL.st[1] != st2) {\n double interval = st2 != 0 ? (double) OPL.T[1] * OPL.TimerBase : 0.0;\n OPL.st[1] = st2;\n if (OPL.TimerHandler != null) {\n OPL.TimerHandler.handler(OPL.TimerParam + 1, interval);\n }\n }\n /* timer 1 */\n if (OPL.st[0] != st1) {\n double interval = st1 != 0 ? (double) OPL.T[0] * OPL.TimerBase : 0.0;\n OPL.st[0] = st1;\n if (OPL.TimerHandler != null) {\n OPL.TimerHandler.handler(OPL.TimerParam + 0, interval);\n }\n }\n }\n return;\n case 0x06:\n /* Key Board OUT */\n if ((OPL.type & OPL_TYPE_KEYBOARD) != 0) {\n if (OPL.keyboardhandler_w != null) {\n OPL.keyboardhandler_w.handler(OPL.keyboard_param, v);\n } else {\n //Log(LOG_WAR,\"OPL:write unmapped KEYBOARD port\\n\");\n }\n }\n return;\n case 0x07:\n /* DELTA-T controll : START,REC,MEMDATA,REPT,SPOFF,x,x,RST */\n if ((OPL.type & OPL_TYPE_ADPCM) != 0) {\n YM_DELTAT_ADPCM_Write(OPL.deltat, r - 0x07, v);\n }\n return;\n case 0x08:\n /* MODE,DELTA-T : CSM,NOTESEL,x,x,smpl,da/ad,64k,rom */\n OPL.mode = v;\n v &= 0x1f;\n /* for DELTA-T unit */\n case 0x09:\n /* START ADD */\n case 0x0a:\n case 0x0b:\n /* STOP ADD */\n case 0x0c:\n case 0x0d:\n /* PRESCALE */\n case 0x0e:\n case 0x0f:\n /* ADPCM data */\n case 0x10:\n /* DELTA-N */\n case 0x11:\n /* DELTA-N */\n case 0x12:\n /* EG-CTRL */\n if ((OPL.type & OPL_TYPE_ADPCM) != 0) {\n YM_DELTAT_ADPCM_Write(OPL.deltat, r - 0x07, v);\n }\n return;\n }\n break;\n case 0x20:\n /* am,vib,ksr,eg type,mul */\n\n slot = slot_array[r & 0x1f];\n if (slot == -1) {\n return;\n }\n set_mul(OPL, slot, v);\n return;\n case 0x40:\n slot = slot_array[r & 0x1f];\n if (slot == -1) {\n return;\n }\n set_ksl_tl(OPL, slot, v);\n return;\n case 0x60:\n slot = slot_array[r & 0x1f];\n if (slot == -1) {\n return;\n }\n set_ar_dr(OPL, slot, v);\n return;\n case 0x80:\n slot = slot_array[r & 0x1f];\n if (slot == -1) {\n return;\n }\n set_sl_rr(OPL, slot, v);\n return;\n case 0xa0:\n switch (r) {\n case 0xbd: /* amsep,vibdep,r,bd,sd,tom,tc,hh */ {\n int rkey = ((OPL.rythm ^ v) & 0xFF);\n OPL.ams_table = new IntArray(AMS_TABLE, (v & 0x80) != 0 ? AMS_ENT : 0);\n OPL.vib_table = new IntArray(VIB_TABLE, (v & 0x40) != 0 ? VIB_ENT : 0);\n OPL.rythm = ((v & 0x3f) & 0xFF);\n\n if ((OPL.rythm & 0x20) != 0) {\n /* BD key on/off */\n if ((rkey & 0x10) != 0) {\n if ((v & 0x10) != 0) {\n OPL.P_CH[6].op1_out[0] = OPL.P_CH[6].op1_out[1] = 0;\n OPL_KEYON(OPL.P_CH[6].SLOT[SLOT1]);\n OPL_KEYON(OPL.P_CH[6].SLOT[SLOT2]);\n } else {\n OPL_KEYOFF(OPL.P_CH[6].SLOT[SLOT1]);\n OPL_KEYOFF(OPL.P_CH[6].SLOT[SLOT2]);\n }\n }\n /* SD key on/off */\n if ((rkey & 0x08) != 0) {\n if ((v & 0x08) != 0) {\n OPL_KEYON(OPL.P_CH[7].SLOT[SLOT2]);\n } else {\n OPL_KEYOFF(OPL.P_CH[7].SLOT[SLOT2]);\n }\n }/* TAM key on/off */\n\n if ((rkey & 0x04) != 0) {\n if ((v & 0x04) != 0) {\n OPL_KEYON(OPL.P_CH[8].SLOT[SLOT1]);\n } else {\n OPL_KEYOFF(OPL.P_CH[8].SLOT[SLOT1]);\n }\n }\n /* TOP-CY key on/off */\n if ((rkey & 0x02) != 0) {\n if ((v & 0x02) != 0) {\n OPL_KEYON(OPL.P_CH[8].SLOT[SLOT2]);\n } else {\n OPL_KEYOFF(OPL.P_CH[8].SLOT[SLOT2]);\n }\n }\n /* HH key on/off */\n if ((rkey & 0x01) != 0) {\n if ((v & 0x01) != 0) {\n OPL_KEYON(OPL.P_CH[7].SLOT[SLOT1]);\n } else {\n OPL_KEYOFF(OPL.P_CH[7].SLOT[SLOT1]);\n }\n }\n }\n }\n return;\n }\n /* keyon,block,fnum */\n if ((r & 0x0f) > 8) {\n return;\n }\n CH = OPL.P_CH[r & 0x0f];\n if ((r & 0x10) == 0) {\n /* a0-a8 */\n\n block_fnum = (int) (CH.block_fnum & 0x1f00) | v;\n } else {\n /* b0-b8 */\n\n int keyon = (v >> 5) & 1;\n block_fnum = (int) (((v & 0x1f) << 8) | (CH.block_fnum & 0xff));\n if (CH.keyon != keyon) {\n if ((CH.keyon = keyon) != 0) {\n CH.op1_out[0] = CH.op1_out[1] = 0;\n OPL_KEYON(CH.SLOT[SLOT1]);\n OPL_KEYON(CH.SLOT[SLOT2]);\n } else {\n OPL_KEYOFF(CH.SLOT[SLOT1]);\n OPL_KEYOFF(CH.SLOT[SLOT2]);\n }\n }\n }\n /* update */\n if (CH.block_fnum != block_fnum) {\n int blockRv = 7 - (block_fnum >> 10);\n int fnum = block_fnum & 0x3ff;\n CH.block_fnum = block_fnum & 0xFFFFFFFFL;\n\n CH.ksl_base = KSL_TABLE[block_fnum >> 6];\n CH.fc = OPL.FN_TABLE[fnum] >> blockRv;\n CH.kcode = (int) ((CH.block_fnum >> 9) & 0xFF);\n if ((OPL.mode & 0x40) != 0 && (CH.block_fnum & 0x100) != 0) {\n CH.kcode |= 1;\n }\n CALC_FCSLOT(CH, CH.SLOT[SLOT1]);\n CALC_FCSLOT(CH, CH.SLOT[SLOT2]);\n }\n return;\n case 0xc0:\n /* FB,C */\n if ((r & 0x0f) > 8) {\n return;\n }\n CH = OPL.P_CH[r & 0x0f];\n {\n int feedback = (v >> 1) & 7;\n CH.FB = ((feedback != 0 ? (8 + 1) - feedback : 0) & 0xFF);\n CH.CON = ((v & 1) & 0xFF);\n set_algorythm(CH);\n }\n return;\n case 0xe0:\n /* wave type */\n\n slot = slot_array[r & 0x1f];\n if (slot == -1) {\n return;\n }\n CH = OPL.P_CH[slot / 2];\n if (OPL.wavesel != 0) {\n /* Log(LOG_INF,\"OPL SLOT %d wave select %d\\n\",slot,v&3); */\n CH.SLOT[slot & 1].wt_offset = (v & 0x03) * SIN_ENT;//CH.SLOT[slot & 1].wavetable = new IntSubArray(SIN_TABLE[(v & 0x03) * SIN_ENT]);\n }\n return;\n default:\n System.out.println(\"case =\" + (r & 0xe0) + \" r=\" + r + \" v=\" + v);\n break;\n }\n }", "public void readSampless(){\n\t\tif (loop) {\n\t\t\treadBytesLoop();\n\t\t} else {\n\t\t\treadBytes();\n\t\t}\n\t\t// convert them to floating point\n\t\t// hand those arrays to our effect\n\t\t// and convert back to bytes\n\t\tprocess();\n\t\t\n\t\t// write to the line.\n\t\twriteBytes();\n\t\t// send samples to the listener\n\t\t// these will be what we just put into the line\n\t\t// which means they should be pretty well sync'd\n\t\t// with the audible result\n\t\tbroadcast();\n\t}", "private void fillConditionalProb(\tfloat[] conditionalTable,\r\n\t\t\t\t\t\t\t\t\t\tFile trainDir) \r\n\t{\r\n\t\t// Let nCharLanguage be the total number of characters (including \r\n\t\t// multiple occurrences of the same unique character, including spaces) \r\n\t\t// contained in all training documents, \r\n\t\t// For each of the 27 unique characters, ci, compute conditional prob:\r\n\t\t// P(ci | Language) = countLanguage(ci) / nCharLanguage,\r\n\t\t// where countLetter(ci) is the number of times character ci occurs \r\n\t\t// in all documents in the training set. \r\n\t\t\r\n\t\t// GET OVERALL COUNT OF ALL LETTERS IN THIS TRAINING DIRECTORY\r\n\t\tfloat nCharLanguage = (float) getTotalLetters(trainDir);\r\n\t\t\t\t\r\n\t\t// FILL IN THE CONDITIONAL TABLE\r\n\t\tfor(int i = 0; i < 26; i++){\r\n\t\t\tchar currentLetter = (char) ('a' + i);\r\n\t\t\tconditionalTable[i] = \r\n\t\t\t\t\tcountLetter(currentLetter, trainDir) / nCharLanguage;\r\n\t\t}\r\n\t\tconditionalTable[26] = \r\n\t\t\t\tcountLetter(' ', trainDir) / nCharLanguage;\r\n\t}", "public void AddDataToTILData(){\n ArrayList<ArrayList<Double>> TILList = ReturnTILList();\n System.out.println(\"\\nAdding Data:\");\n DisplayTimeInLevelList(TILList);\n //first, get the average for each level and add them to an arraylist\n ArrayList<Double> LeveltimeAvg = new ArrayList<Double>();\n \n System.out.println(\"Leveltime average, size \"+TILList.size());\n for(ArrayList<Double> tl : TILList){ // tl for time list\n LeveltimeAvg.add(Mean(tl));\n System.out.println(Mean(tl));\n }\n System.out.println(\"critpoints:\");\n for(Long p: TILData.critpoints){\n System.out.println(\"\"+p);\n }\n \n //then write a new line using the subject's id, avg's, and crit_points\n TILData.AddSubjectData(Subject_ID,LeveltimeAvg,TILData.critpoints);\n \n }", "public static double ludcmp(double a[][], int indx[])\n\t\t\t{\n\tint n = a.length;\n\tint i = 0, imax = 0, j = 0, k = 0;\n\tdouble big, dum, sum, temp;\n\tdouble d = 1.0;\n\tdouble vv[] = new double[n];\n\tfor (i = 0; i < n; i++) {\n big = 0.0;\n for (j = 0; j < n; j++)\n if ((temp = Math.abs(a[i][j])) > big)\n\t\tbig = temp;\n\n\tif (big == 0.0) {\n try {\n // no non-zero largest element\n\n throw new NRException(\"Error: Singular linearized system. Computation cannot proceed.\");\n } catch (NRException ex) {\n ex.printStackTrace();\n }\n\n\t}\n\tvv[i] = 1.0 / big;\n }\n\n for (j = 0; j < n; j++) {\n\tfor (i = 0; i < j; i++) {\n sum = a[i][j];\n for (k = 0; k < i; k++)\n sum -= (a[i][k] * a[k][j]);\n a[i][j] = sum;\n\t}\n\tbig = 0.0;\n\tfor (i = j; i < n; i++) {\n sum = a[i][j];\n for (k = 0; k < j; k++)\n sum -= (a[i][k] * a[k][j]);\n a[i][j] = sum;\n\t\n if ((dum = vv[i] * Math.abs(sum)) >= big) {\n\t\tbig = dum;\n\t\timax = i;\n\t\t}\n\t}\n\tif (j != imax) {\n\t\tfor (k = 0; k < n; k++) {\n\t\tdum = a[imax][k];\n\t\ta[imax][k] = a[j][k];\n\t\ta[j][k] = dum;\n }\n d = -d;\n vv[imax] = vv[j];\n }\n\tindx[j] = imax;\n\t// replace zero values with a nigh zero value so that\n\t// we don't get any divisions by zero.\n if (a[j][j] == 0.0)\n\t a[j][j] = TINY;\n\n\tif (j != n-1) {\n\tdum = 1.0 / (a[j][j]);\n\tfor (i = j + 1; i < n; i++)\n\t a[i][j] *= dum;\n\t}\n }\n\treturn d;\n\t}", "public void updateMuListHelper(ArrayList<HashMap<String,ViterbiUnit>> list,ArrayList<String> line,int i){\n\t\tHashMap<String,ViterbiUnit> mapUnit=new HashMap<String,ViterbiUnit>();\n\t\tif(i==0){\n\t\t\tmapUnit.put(padding_word,new ViterbiUnit(\"\",1.0));\n\t\t}else if(i<=line.size()){\n\t\t\tString xWord=line.get(i-1);\n\t\t\t//iterate through all possible ys after the previous ones\n\t\t\tHashMap<String,ViterbiUnit> prevMapUnit=list.get(i-1);\n\t\t\tfor(String prevY:prevMapUnit.keySet()){\n\t\t\t\tTransitionUnit transitionSubMap=transition_map.get(prevY);\n\t\t\t\tfor(String yWord:transitionSubMap.state_transition.keySet()){\n\t\t\t\t\tif(yWord.equals(padding_word)){\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tdouble tempMu=prevMapUnit.get(prevY).prob*transitionSubMap.state_transition.get(yWord).prob*\n\t\t\t\t\t\t\tgetTerminalTransitionProb(yWord,xWord);\n\t\t\t\t\tif((!mapUnit.containsKey(yWord))||mapUnit.get(yWord).prob<tempMu){\n\t\t\t\t\t\tmapUnit.put(yWord,new ViterbiUnit(prevY,tempMu));\n\t\t\t\t\t\tassert(tempMu>0);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t}else if(i==line.size()+1){\n\t\t\tHashMap<String,ViterbiUnit> prevMapUnit=list.get(i-1);\n\t\t\tfor(String prevY:prevMapUnit.keySet()){\n\t\t\t\tTransitionUnit transitionSubMap=transition_map.get(prevY);\n\t\t\t\tString yWord=padding_word;\n\t\t\t\tif(transitionSubMap.state_transition.containsKey(yWord)){\n\t\t\t\t\tdouble tempMu=prevMapUnit.get(prevY).prob*transitionSubMap.state_transition.get(yWord).prob;\n\t\t\t\t\tif((!mapUnit.containsKey(yWord))||mapUnit.get(yWord).prob<tempMu){\n\t\t\t\t\t\tmapUnit.put(yWord,new ViterbiUnit(prevY,tempMu));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tlist.add(mapUnit);\n\t\tupdateMuListHelper(list,line,i+1);\n\t}", "@Test\n\tpublic void test() {\n\t\tdouble delta = 0.00001;\n\t\tSnp fakeSnp1 = new Snp(\"fakeId1\", 0, 0.3);\n\t\tSnp fakeSnp2 = new Snp(\"fakeId2\", 0, 0.8);\n\t\tSnp fakeSnp3 = new Snp(\"fakeId3\", 0, 1.4);\n\t\tPascal.set.withZScore_=true;\n\t\tArrayList<Snp> geneSnps = new ArrayList<Snp>();\n\t\tgeneSnps.add(fakeSnp1);geneSnps.add(fakeSnp2);geneSnps.add(fakeSnp3);\n\t\tDenseMatrix ld= new DenseMatrix(3,3);\n\t\t//DenseMatrix crossLd= new DenseMatrix(3,2);\n\t\t\n\t\tArrayList<Double> snpScores = new ArrayList<Double>(3);\n\t\tsnpScores.add(fakeSnp1.getZscore());\n\t\tsnpScores.add(fakeSnp2.getZscore());\n\t\tsnpScores.add(fakeSnp3.getZscore());\n\t\t//ld and crossLd calculated as follows:\n\t\t// make 0.9-toeplitz mat of size 5.\n\t\t// 3,4,5 for ld-mat\n\t\t// 1,2 for crossLd-mat\n\t\tld.set(0,0,1);ld.set(1,1,1);ld.set(2,2,1);\n\t\tld.set(0,1,0.9);ld.set(1,2,0.9);\n\t\tld.set(1,0,0.9);ld.set(2,1,0.9);\n\t\tld.set(0,2,0.81);\n\t\tld.set(2,0,0.81);\n\t\tdouble[] weights = {2,2,2};\n\t\tAnalyticVegas myAnalyticObj= null;\n\t\t//UpperSymmDenseMatrix myMatToDecompose = null;\n\t\tdouble[] myEigenvals = null;\n\t\tdouble[] emptyWeights = {1,1,1};\n\t\tmyAnalyticObj= new AnalyticVegas(snpScores, ld, emptyWeights);\n\t\tmyAnalyticObj.computeScore();\n\t\tmyEigenvals = myAnalyticObj.computeLambda();\n\t\tassertEquals(myEigenvals[0],2.74067, delta);\n\t\tassertEquals(myEigenvals[1],0.1900, delta);\n\t\tassertEquals(myEigenvals[2],0.06932, delta);\n\t\t\n\t\tmyAnalyticObj= new AnalyticVegas(snpScores, ld, weights);\n\t\tmyAnalyticObj.computeScore();\n\t\tmyEigenvals = myAnalyticObj.computeLambda();\t\t\t\n\t\tassertEquals(myEigenvals[0], 5.481348, delta);\n\t\tassertEquals(myEigenvals[1],0.380000, delta);\n\t\tassertEquals(myEigenvals[2],0.138652, delta);\n\t\t\t\n\t\tdouble[] weights2 = {1,2,0.5};\n\t\t\n\t\tmyAnalyticObj= new AnalyticVegas(snpScores, ld, weights2);\n\t\tmyAnalyticObj.computeScore();\n\t\tmyEigenvals = myAnalyticObj.computeLambda();\t\t\n\t\tassertEquals(myEigenvals[0],3.27694674, delta);\n\t\tassertEquals(myEigenvals[1],0.1492338, delta);\n\t\tassertEquals(myEigenvals[2],0.07381938, delta);\t\t\t\n\t\t\n\t}", "float[][] getCameraVectorsNormal(int resX, int resY){\n float vectors[][]=new float[resX*resY][3];//first vector index, second the components of the vector\n float[] vect2=rotateYVector(dir);\n vect2[1]=0;\n vect2=normalize(vect2);\n float[] vect3=normalize(vectorProduct(dir, vect2));//dir, vect2, vect3 base vectors\n float[] x={0,0,0};\n float[] y={0,0,0};\n float[] temp={0,0,0};\n for(int i=0;i<3;i++){\n x[i]=(vect2[i])/(resX/2);\n y[i]=(vect3[i])/(resY/2);\n temp[i]=vect2[i];\n }\n \n for(int j=0;j<resY;j++){\n for(int i=0;i<resX;i++){\n vectors[j*resX+i][0]=dir[0]+vect2[0]+vect3[0];\n vectors[j*resX+i][1]=dir[1]+vect2[1]+vect3[1];\n vectors[j*resX+i][2]=dir[2]+vect2[2]+vect3[2];\n vectors[j*resX+i]=normalize(vectors[j*resX+i]);\n vect2[0]-=x[0];\n vect2[1]-=x[1];\n vect2[2]-=x[2];\n if((vectorLength(vect2)>(-0.0001)&&vectorLength(vect2)<0.0001)&&(resX%2)==0){\n vect2[0]-=x[0];\n vect2[1]-=x[1];\n vect2[2]-=x[2];\n }\n }\n //printVector(temp);\n vect2[0]=temp[0];\n vect2[1]=temp[1];\n vect2[2]=temp[2];\n vect3[0]-=y[0];\n vect3[1]-=y[1];\n vect3[2]-=y[2];\n if((vectorLength(vect3)>(-0.0001)&&vectorLength(vect3)<0.0001)&&(resY%2)==0){\n vect3[0]-=y[0];\n vect3[1]-=y[1];\n vect3[2]-=y[2];\n }\n }\n \n return vectors;\n }", "private void compute_line_points(float[][] ku, byte[] ismax, float[] ev,float[] nx, float[] ny,float[] px, float[] py, long width, long height, double low,double high, long mode)\r\n\t{\r\n\t long r, c, l;\r\n\t double[] k = new double[5];\r\n\t double[] eigval = new double[2];\r\n\t double[][] eigvec = new double[2][2];\r\n\t double a, b;\r\n\t MutableDouble t = new MutableDouble();\r\n\t MutableLong num = new MutableLong();\r\n\t double n1, n2;\r\n\t double p1, p2;\r\n\t double val;\r\n\r\n\t for (r=0; r<height; r++) {\r\n\t for (c=0; c<width; c++) {\r\n\t l = LinesUtil.LINCOOR(r,c,width);\r\n\t k[0] = ku[0][(int) l];\r\n\t k[1] = ku[1][(int) l];\r\n\t k[2] = ku[2][(int) l];\r\n\t k[3] = ku[3][(int) l];\r\n\t k[4] = ku[4][(int) l];\r\n\t ev[(int) l] = (float) 0.0;\r\n\t nx[(int) l] = (float) 0.0;\r\n\t ny[(int) l] = (float) 0.0;\r\n\t compute_eigenvals(k[2],k[3],k[4],eigval,eigvec);\r\n\t if (mode == LinesUtil.MODE_LIGHT)\r\n\t val = -eigval[0];\r\n\t else\r\n\t val = eigval[0];\r\n\t if (val > 0.0) {\r\n\t ev[(int) l] = (float) val;\r\n\t n1 = eigvec[0][0];\r\n\t n2 = eigvec[0][1];\r\n\t a = k[2]*n1*n1+2.0*k[3]*n1*n2+k[4]*n2*n2;\r\n\t b = k[0]*n1+k[1]*n2;\r\n\t solve_linear(a,b,t,num);\r\n\t if (num.intValue() != 0) {\r\n\t p1 = t.doubleValue()*n1;\r\n\t p2 = t.doubleValue()*n2;\r\n\t if (Math.abs(p1) <= PIXEL_BOUNDARY && Math.abs(p2) <= PIXEL_BOUNDARY) {\r\n\t if (val >= low) {\r\n\t if (val >= high)\r\n\t ismax[(int) l] = 2;\r\n\t else\r\n\t ismax[(int) l] = 1;\r\n\t }\r\n\t nx[(int) l] = (float) n1;\r\n\t ny[(int) l] = (float) n2;\r\n\t px[(int) l] = (float) (r+p1);\r\n\t py[(int) l] = (float) (c+p2);\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\t}", "public void learnVector(final Calendar when, final double[] vals);", "void updateFrom(ClonalGeneAlignmentParameters alignerParameters);", "private synchronized void setSignals(SignalEvent event)\r\n\t{\r\n\t\tfor(int i = 0;i < event.getLeftSignal().length; i++)\r\n\t\t{\r\n\t\t\tif(llleftSamples.size() < maxSize/zoomX)\r\n\t\t\t{\r\n\t\t\t\tllleftSamples.add((int) (100 - event.getLeftSignal()[i] * 100 * zoomY ));\r\n\t\t\t\tllrightSamples.add((int) (100 - event.getRightSignal()[i] * 100 * zoomY));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tllleftSamples.removeFirst();\r\n\t\t\t\tllleftSamples.add((int) (100 - event.getLeftSignal()[i] * 100 * zoomY));\r\n\t\t\t\tllrightSamples.removeFirst();\r\n\t\t\t\tllrightSamples.add((int) (100 - event.getRightSignal()[i] * 100 * zoomY));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i=0;i<event.getfftHelperObj().getFFTSignal().length;i++)\r\n\t\t{\t\t\r\n\t\t\tif(llFFTSamples.size() < (fftSize/2)/zoomX)\r\n\t\t\t{\r\n\t\t\t\tllFFTSamples.add((int) (maxSizeFFt * event.getfftHelperObj().getFFTSignal()[i] * zoomY ));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tllFFTSamples.removeFirst();\r\n\t\t\t\tllFFTSamples.add((int) (maxSizeFFt * event.getfftHelperObj().getFFTSignal()[i] * zoomY));\r\n\t\t\t}\t\r\n\t\t}\r\n\t\tcnt++;\r\n\t}", "@Override\n \tpublic double[] getdata(List<Pair<String, String>> alin, MoleculeManager manager, GapManager gap) {\n \n \n \tdouble S_max;\n \tdouble[][] p;\n \tdouble[] data;\n \tint N;\n \tint Len;\n \tint n_seqs=0;\n \n \tn_seqs = alin.size();\n \t\n \tLen = alin.get(0).getSecond().length();\n \tN = manager.alphabetSize();\n \t\n \tp = new double[Len][N];\n \t\n \tS_max = Math.log(N)/Math.log(2);\n \t\n \tp = getFreq(p,alin,n_seqs, manager.alphabet()); \n \n \tdata = new double[Len];\n \t\n \tfor (int i = 0; i < data.length; i++) {\n \t\t\n \t\tdouble s_obs=0;\n \t\t\n \t\tdouble freqSum = 0; \n \n \t\tfor (int j = 0; j < N; j++) {\n \t\t\t\n \t\t\tif (p[i][j]!= 0 ) { \n \t\t\t\t\n \t\t\t\ts_obs = s_obs + p[i][j] * Math.log(p[i][j]) / Math.log(2);\n \t\t\t\t\n \t\t\t\tfreqSum = gap.attempToSumFreq(freqSum, p[i][j]) ;\n \t\t\t\t\n \t\t\t}\n \t\t}\n \t\t\n \t\tdata[i] = (S_max + s_obs) * freqSum / S_max;\n \t}\n \n \treturn data;\n }", "public void InitLinearLV() throws Exception{\n\tcommandExec c1 = new commandExec();\n\tc1.runCommand(\"lvcreate -n LinearLV -l 50%VG /dev/TargetVG\" );\n}", "public void compute() {\n\n this.jddPtsInflexion.clear();\n ILineString lsInitialee = this.geom;\n\n ILineString lsInitiale = Operateurs.resampling(lsInitialee, 1);\n ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 5, 1);\n\n double sumOfDistances = 0;\n double length = 70;// 200 m max\n double sumOfAngels = 0;\n // ArrayList<Double> angels=new ArrayList<Double>();\n ArrayList<Double> differences = new ArrayList<Double>();\n\n ArrayList<Double> distances = new ArrayList<Double>();\n\n IDirectPosition p1 = lsInitiale.coord().get(0);\n IDirectPosition p2 = lsInitiale.coord().get(1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double angel = Math.atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n angel = (angel + Math.PI) * 180 / Math.PI;\n\n // angels.add(angel);\n\n for (int i = 1; i < lsInitiale.coord().size() - 1; i++) {\n\n p1 = lsInitiale.coord().get(i);\n p2 = lsInitiale.coord().get(i + 1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double newAngel = Math\n .atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n // give the value that varie from 0 to 360-epsilon\n newAngel = (newAngel + Math.PI) * 180 / Math.PI;\n\n // angels.add(newAngel);\n\n while (sumOfDistances > length && differences.size() > 0) {\n sumOfDistances -= distances.get(0);\n\n sumOfAngels -= differences.get(0);\n\n distances.remove(0);\n // System.out.println(\"olddiff=\" + differences.get(0));\n differences.remove(0);\n\n }\n\n double diff = newAngel - angel;\n\n if (diff > 180)\n diff = -360 + diff;// for the case of angel=10 and newAngel=350;\n else if (diff < -180)\n diff = 360 + diff;\n\n differences.add(diff);\n sumOfAngels += diff;\n angel = newAngel;\n // System.out.println(\"sumOfAngels=\" + sumOfAngels);\n // System.out.println(\"angel=\" + newAngel);\n // System.out.println(\"diff=\" + diff);\n\n /*\n * for(int k=0;k<angels.size();k++){ double diff2=newAngel-angels.get(k));\n * if(diff2>180)diff2=360-diff2;// for the case of angel=10 and\n * newAngel=350; else if(diff2<-180)diff2=-360-diff2;\n * if(Math.abs(newAngel->200) {\n * \n * }\n * \n * \n * }\n */\n\n if (Math.abs(sumOfAngels) > 100) {\n\n double maxOfDiff = 0;\n int indexOfMaxOfDiff = -1;\n for (int k = 0; k < differences.size(); k++) {\n if (differences.get(k) > maxOfDiff) {\n maxOfDiff = differences.get(k);\n indexOfMaxOfDiff = k;\n\n }\n\n }\n double maxDistance = -1;\n int maxDistancePointIndex = -1;\n // if(i+differences.size()-indexOfMaxOfDiff-1>=jddPtsInflexion.size())\n for (int jj = 0; jj < differences.size(); jj++) {\n // jddPtsInflexion.add(lsInitiale.coord().get(i+differences.size()-indexOfMaxOfDiff-2));\n if (i + jj - indexOfMaxOfDiff >= 0\n && i + jj - indexOfMaxOfDiff < lsInitiale.coord().size()) {\n int currIndex = i + jj - indexOfMaxOfDiff;\n double distance = lsInitiale.coord().get(currIndex).distance2D(\n lsLisse.coord().get(currIndex));\n if (distance > maxDistance) {\n maxDistance = distance;\n maxDistancePointIndex = currIndex;\n }\n\n }\n\n }\n\n if (maxDistancePointIndex >= 0)\n this.jddPtsInflexion.add(lsInitiale.coord()\n .get(maxDistancePointIndex));\n\n differences.clear();\n sumOfDistances = distances.get(distances.size() - 1);\n distances.clear();\n sumOfAngels = 0;\n i++;\n\n }\n\n }\n\n }", "private void processExtractData_N() {\n\n this.normalCollection = new VertexCollection();\n\n Map<Integer, float[]> definedNormals = new HashMap<>();\n\n int n = 0;int count = 1;\n while(n < extract.getNormals().size()){\n\n float thisNormValues[] = {extract.getNormals().get(n),\n extract.getNormals().get(n+1),\n extract.getNormals().get(n+2)};\n\n definedNormals.put(count, thisNormValues);\n\n n = n+3;\n count++;\n }\n\n for(Integer nId : extract.getDrawNormalOrder()){\n float[] pushThese = definedNormals.get(nId);\n this.normalCollection.push(pushThese[0], pushThese[1], pushThese[2]);\n }\n }", "public void sample()\n\t{\n\t\tint nd = interval.numDimensions();\n\n\t\t// the order in which mpicbg expects\n\t\tp = new double[ nd ][ (int) N ];\n\t\tq = new double[ nd ][ (int) N ];\n\n\t\tdouble[] src = new double[ nd ];\n\t\tdouble[] tgt = new double[ nd ];\n\n\t\tint i = 0;\n\t\tIntervalIterator it = new IntervalIterator( interval );\n\t\twhile ( it.hasNext() )\n\t\t{\n\t\t\tit.fwd();\n\t\t\tit.localize( src );\n\t\t\txfm.apply( src, tgt );\n\n\t\t\tfor ( int d = 0; d < nd; d++ )\n\t\t\t{\n\t\t\t\tp[ d ][ i ] = src[ d ];\n\t\t\t\tq[ d ][ i ] = tgt[ d ];\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t}", "private void resampleAbdomenVOI() {\r\n VOIVector vois = abdomenImage.getVOIs();\r\n VOI theVOI = vois.get(0);\r\n\r\n VOIContour curve = ((VOIContour)theVOI.getCurves().get(0));\r\n \r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM();\r\n int xcm = centerOfMass[0];\r\n int ycm = centerOfMass[1];\r\n// ViewUserInterface.getReference().getMessageFrame().append(\"Xcm: \" +xcm +\" Ycm: \" +ycm);\r\n \r\n\r\n ArrayList<Integer> xValsAbdomenVOI = new ArrayList<Integer>();\r\n ArrayList<Integer> yValsAbdomenVOI = new ArrayList<Integer>();\r\n\r\n // angle in radians\r\n double angleRad;\r\n \r\n for (int angle = 0; angle < 360; angle += angularResolution) {\r\n int x = xcm;\r\n int y = ycm;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n // increment x each step\r\n scaleFactor = Math.tan(angleRad);\r\n while (x < xDim && curve.contains(x, y)) {\r\n \r\n // walk out in x and compute the value of y for the given radial line\r\n x++;\r\n y = ycm - (int)((x - xcm) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n // decrement y each step\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n while (y > 0 && curve.contains(x, y)) {\r\n\r\n // walk to the top of the image and compute values of x for the given radial line\r\n y--;\r\n x = xcm + (int)((ycm - y) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n // decrement x each step\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n while (x > 0 && curve.contains(x, y)) {\r\n \r\n x--;\r\n y = ycm - (int)((xcm - x) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n\r\n } else if (angle > 225 && angle <= 315) {\r\n // increment y each step\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n while (y < yDim && curve.contains(x, y)) {\r\n \r\n y++;\r\n x = xcm - (int)((y - ycm) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n }\r\n } // end for (angle = 0; ...\r\n \r\n// ViewUserInterface.getReference().getMessageFrame().append(\"resample VOI number of points: \" +xValsAbdomenVOI.size());\r\n curve.clear();\r\n for(int idx = 0; idx < xValsAbdomenVOI.size(); idx++) {\r\n curve.add( new Vector3f( xValsAbdomenVOI.get(idx), yValsAbdomenVOI.get(idx), 0 ) );\r\n }\r\n }", "private void setProblem() throws IOException, InvalidInputException{\r\n String finalInputFileName;\r\n if(scale){\r\n finalInputFileName = inputFileName + \".scaled\";\r\n }\r\n else{\r\n finalInputFileName = inputFileName;\r\n }\r\n \r\n // Read data from the input file\r\n BufferedReader reader = new BufferedReader(new FileReader(finalInputFileName));\r\n if(reader.toString().length() == 0){\r\n throw new InvalidInputException(\"Invalid input file! File is empty!\");\r\n }\r\n\r\n // Prepare holders for dataset D=(X,y)\r\n Vector<svm_node[]> X = new Vector<svm_node[]>();\r\n Vector<Double> y = new Vector<Double>();\r\n int maxIndex = 0;\r\n\r\n // Load data from file to holders\r\n while(true){\r\n String line = reader.readLine();\r\n\r\n if(line == null){\r\n break;\r\n }\r\n\r\n StringTokenizer st = new StringTokenizer(line,\" \\t\\n\\r\\f:\");\r\n\r\n y.addElement(Utils.toDouble(st.nextToken()));\r\n int m = st.countTokens()/2;\r\n svm_node[] x = new svm_node[m];\r\n for(int i = 0; i < m; i++) {\r\n x[i] = new svm_node();\r\n x[i].index = Utils.toInt(st.nextToken());\r\n x[i].value = Utils.toDouble(st.nextToken());\r\n }\r\n if(m > 0){\r\n maxIndex = Math.max(maxIndex, x[m-1].index);\r\n }\r\n X.addElement(x);\r\n }\r\n\r\n this.problem = new svm_problem();\r\n this.problem.l = y.size();\r\n this.inputDime = maxIndex + 1;\r\n\r\n // Wrap up multi-dimensional input vector X\r\n this.problem.x = new svm_node[this.problem.l][];\r\n for(int i=0;i<this.problem.l;i++)\r\n this.problem.x[i] = X.elementAt(i);\r\n\r\n // Wrap up 1-dimensional input vector y\r\n this.problem.y = new double[this.problem.l];\r\n for(int i=0;i<this.problem.l;i++)\r\n this.problem.y[i] = y.elementAt(i);\r\n \r\n////////////////////???\r\n // Verify the gamma setting according to the maxIndex\r\n if(param.gamma == 0 && maxIndex > 0)\r\n param.gamma = 1.0/maxIndex;\r\n\r\n // Dealing with pre-computed kernel\r\n if(param.kernel_type == svm_parameter.PRECOMPUTED){\r\n for(int i = 0; i < this.problem.l; i++) {\r\n if (this.problem.x[i][0].index != 0) {\r\n String msg = \"Invalid kernel matrix! First column must be 0:sample_serial_number.\";\r\n throw new InvalidInputException(msg);\r\n }\r\n if ((int)this.problem.x[i][0].value <= 0 || (int)this.problem.x[i][0].value > maxIndex){\r\n String msg = \"Invalid kernel matrix! Sample_serial_number out of range.\";\r\n throw new InvalidInputException(msg);\r\n }\r\n }\r\n }\r\n\r\n reader.close();\r\n }", "private void transform(float[] v, int len){\n \t\n \t\n \t\t\n if((len & 3) != 0) throw new IllegalArgumentException();\n \n for(int i = 0; i < len; i += 4){\n\n // 0\n // 1\n // 2\n // 3\n \t// 0 1 2 3 \n \t \t// 4 5 6 7\n \t \t// 8 9 10 11\n \t \t// 12 13 14 15\n \t \t// \n\n \tfloat v0 = v[i];\n \tfloat v1 = v[i+1];\n \tfloat v2 = v[i+2];\n \tfloat v3 = v[i+3];\n \t\n \tv[i] = matrix[ 0]*v0 + matrix[ 1]*v1 + matrix[ 2]*v2 + matrix[ 3]*v3;\n \tv[i+1] = matrix[ 4]*v0 + matrix[ 5]*v1 + matrix[ 6]*v2 + matrix[ 7]*v3;\n \tv[i+2] = matrix[ 8]*v0 + matrix[ 9]*v1 + matrix[10]*v2 + matrix[11]*v3;\n \tv[i+3] = matrix[12]*v0 + matrix[13]*v1 + matrix[14]*v2 + matrix[15]*v3;\n \t\n }\n\n }", "@Override\n public void notifyOnFeatureVectorEvent() {\n }", "public static void main(String[] args) throws IOException {\r\n\t\tBufferedReader bf = new BufferedReader(new FileReader(\"entrada_polinomios\"));\r\n\t\t\r\n\t\ttry{\r\n\t\t\twhile(true){\r\n\t\t\t\t\r\n\t\t\t\tString aux1 = bf.readLine();\r\n\t\t\t\tint grado = Integer.parseInt(aux1);\r\n\t\t\t\tString aux2 = bf.readLine();\r\n\t\t\t\tint[] coeficientes = new int[grado + 1];\r\n\t\t\t\tString palabrasSeparadas[] = aux2.split(\" \");\r\n\t\t\t\tfor(int i = 0; i < grado + 1;i++){\r\n\t\t\t\t\tcoeficientes[i] = Integer.parseInt(palabrasSeparadas[i]);\r\n\t\t\t\t}\r\n\t\t\t\t//System.out.println(\"holiwi\");\r\n\t\t\t\tVector<Integer> v_aux = new Vector();\r\n\t\t\t\tString aux3 = bf.readLine();\r\n\t\t\t\t//System.out.println(aux3);\r\n\t\t\t\tString valores_a_evaluar[] = aux3.split(\" \");\r\n\t\t\t\tint valor = Integer.parseInt(valores_a_evaluar[0]);\r\n\t\t\t\tint i = 1;\r\n\t\t\t\twhile(valor != 0){\r\n\r\n\t\t\t\t\tv_aux.add(valor);\r\n\t\t\t\t\tvalor = Integer.parseInt(valores_a_evaluar[i]);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tint[] entrada = new int[1 + grado + 1 + v_aux.size()];\r\n\t\t\t\tentrada[0] = grado;\r\n\t\t\t\t//System.out.println(entrada.length + \",\" + coeficientes.length);\r\n\t\t\t\tfor(int j = 0; j < grado + 1; j++){\r\n\t\t\t\t\tentrada[j+1] = coeficientes[j];\r\n\t\t\t\t}\r\n\t\t\t\tfor(int j = 0; j < v_aux.size(); j++){\r\n\t\t\t\t\tentrada[1 + grado + 1 +j] = v_aux.get(j);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPolinomios a = new Polinomios();\r\n\t\t\t\ta.solve(entrada);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\r\n\t}", "@UITopiaVariant(affiliation = \"RWTH Aachen\", author = \"Kefang\", email = \"***@gmail.com\", uiLabel = UITopiaVariant.USEVARIANT)\n\t@PluginVariant(variantLabel = \"Assign Controlled Label\", requiredParameterLabels = { 0 })\n\tpublic XLog assignControlledLabel(UIPluginContext context, XLog log) {\n\n\t\tXFactory factory = XFactoryRegistry.instance().currentDefault();\n\t\tXLog label_log = (XLog) log.clone();\n\t\t// how to decide the throughputtime of each trace?? \n\t\tlabel_log.getGlobalTraceAttributes().add(factory.createAttributeBoolean(Configuration.POS_LABEL, false, null));\n\t\t// we need to create a dislogue for setting parameters\n\t\tLabelParameters parameters = new LabelParameters();\n\t\tLabelParameterStep lp_step = new LabelParameterStep(parameters);\n\n\t\tListWizard<LabelParameters> wizard = new ListWizard<LabelParameters>(lp_step);\n\t\tparameters = ProMWizardDisplay.show(context, wizard, parameters);\n\t\t//System.out.println(parameters.getFit_overlap_rate());\n\t\t//System.out.println(parameters.getFit_pos_rate());\n\n\t\tList<TraceVariant> variants = EventLogUtilities.getTraceVariants(label_log); // for all variants \n\t\t// fit and not fit for variants \n\t\t// assignLabel to fit and not fit for also the variants.\n\t\tList<TraceVariant> fit_variants = new ArrayList<TraceVariant>();\n\t\tList<TraceVariant> unfit_variants = new ArrayList<TraceVariant>();\n\n\t\tfor (TraceVariant var : variants) {\n\t\t\tif (var.getFitLabel() == null || var.getFitLabel())\n\t\t\t\tfit_variants.add(var);\n\t\t\telse // if(var.getFitLabel() == false)\n\t\t\t\tunfit_variants.add(var);\n\t\t} // variants size ==0, we don't need to do it??? \n\t\tif (fit_variants.size() > 0)\n\t\t\tEventLogUtilities.assignVariantListLabel(fit_variants, parameters.getFit_overlap_rate(),\n\t\t\t\t\tparameters.getFit_pos_rate());\n\t\t// for unfit variants // if variants.size == 0, we don't need to do it\n\t\tif (unfit_variants.size() > 0)\n\t\t\tEventLogUtilities.assignVariantListLabel(unfit_variants, parameters.getUnfit_overlap_rate(),\n\t\t\t\t\tparameters.getUnfit_pos_rate());\n\n\t\treturn label_log;\n\t}", "public synchronized void onPointEvent(Object source, PointEvent evt) {\n PointData pd = evt.getPointData();\n // Check that there's data.. ?\n if (pd == null) { // || pd.getData() == null) {\n return;\n }\n\n // Find the index of the point\n String fullname = pd.getName();\n int i = 0;\n for (; i < itsNumPoints; i++) {\n if (itsNames[i].equals(fullname)) {\n break;\n }\n }\n if (i == itsNumPoints) {\n Logger logger = Logger.getLogger(this.getClass().getName());\n logger.warn(\"(\" + itsParent.getFullName() + \") received unsolicited data from \" + fullname);\n return;\n }\n\n // Everything looks good\n itsValues[i] = pd;\n\n // Check whether now is an appropriate time to recalculate output\n if (matchData()) {\n // Recalculate output and fire update event\n Object resval = doCalculations();\n AbsTime ts;\n if (itsNumPoints==1) {\n \t // Only listening to a single point so preserve the timestamp\n \t ts = pd.getTimestamp();\n } else {\n \t // Mutliple points, therefore original timestamp is not clearly defined\n \t ts = new AbsTime();\n }\n PointData res = new PointData(itsParent.getFullName(), ts, resval);\n itsParent.firePointEvent(new PointEvent(this, res, true));\n }\n }", "public void run(){\n\n for (int locIdx = begN; locIdx < endN; locIdx++) {\n\n // do mean-shift for profiles at these locations\n\n for (int profileIdx=0; profileIdx<profiles.get(locIdx).size(); profileIdx++) {\n\n // access the detection\n// int profileLength = profiles.get(locIdx).get(profileIdx).length;\n\n // calculate peaks for the ring 'profileIdx'\n ArrayList<Float> currPeaks = extractPeakIdxsList(profiles.get(locIdx).get(profileIdx), startIdx.get(profileIdx), finishIdx.get(locIdx).get(profileIdx));\n\n //if (currPeaks.size()<3) {\n // // it is not a bifurcation according to MS for this ring, don't calculate further, leave empty fields of peakIdx at this location\n // break;\n //}\n //else {\n // add those points\n for (int pp=0; pp<currPeaks.size(); pp++){\n peakIdx.get(locIdx).get(profileIdx).add(pp, currPeaks.get(pp));\n }\n //}\n\n/*\n\t\t\t\tfor (int k=0; k<nrPoints; k++) {\n start[k] = ((float) k / nrPoints) * profileLength;\n }\n\n\t\t\t\tTools.runMS( \tstart,\n \tprofiles.get(locIdx).get(profileIdx),\n \tmaxIter,\n \tepsilon,\n \th,\n\t\t\t\t\t\t\t\tmsFinish);\n*/\n\n /*\n for (int i1=0; i1<nrPoints; i1++) {\n convIdx.get(locIdx).get(profileIdx)[i1] = (float) msFinish[i1];\n }\n*/\n/*\n int inputProfileLength = profiles.get(locIdx).get(profileIdx).length;\n Vector<float[]> cls = Tools.extractClusters1(msFinish, minD, M, inputProfileLength);\n\t\t\t\textractPeakIdx(cls, locIdx, profileIdx); // to extract 3 major ones (if there are three)\n*/\n\n }\n\n }\n\n }", "public void calculate(double[] theta) {\r\n dvModel.vectorToParams(theta);\r\n\r\n double localValue = 0.0;\r\n double[] localDerivative = new double[theta.length];\r\n\r\n TwoDimensionalMap<String, String, SimpleMatrix> binaryW_dfsG,binaryW_dfsB;\r\n binaryW_dfsG = TwoDimensionalMap.treeMap();\r\n binaryW_dfsB = TwoDimensionalMap.treeMap();\r\n TwoDimensionalMap<String, String, SimpleMatrix> binaryScoreDerivativesG,binaryScoreDerivativesB ;\r\n binaryScoreDerivativesG = TwoDimensionalMap.treeMap();\r\n binaryScoreDerivativesB = TwoDimensionalMap.treeMap();\r\n Map<String, SimpleMatrix> unaryW_dfsG,unaryW_dfsB ;\r\n unaryW_dfsG = new TreeMap<String, SimpleMatrix>();\r\n unaryW_dfsB = new TreeMap<String, SimpleMatrix>();\r\n Map<String, SimpleMatrix> unaryScoreDerivativesG,unaryScoreDerivativesB ;\r\n unaryScoreDerivativesG = new TreeMap<String, SimpleMatrix>();\r\n unaryScoreDerivativesB= new TreeMap<String, SimpleMatrix>();\r\n\r\n Map<String, SimpleMatrix> wordVectorDerivativesG = new TreeMap<String, SimpleMatrix>();\r\n Map<String, SimpleMatrix> wordVectorDerivativesB = new TreeMap<String, SimpleMatrix>();\r\n\r\n for (TwoDimensionalMap.Entry<String, String, SimpleMatrix> entry : dvModel.binaryTransform) {\r\n int numRows = entry.getValue().numRows();\r\n int numCols = entry.getValue().numCols();\r\n binaryW_dfsG.put(entry.getFirstKey(), entry.getSecondKey(), new SimpleMatrix(numRows, numCols));\r\n binaryW_dfsB.put(entry.getFirstKey(), entry.getSecondKey(), new SimpleMatrix(numRows, numCols));\r\n binaryScoreDerivativesG.put(entry.getFirstKey(), entry.getSecondKey(), new SimpleMatrix(1, numRows));\r\n binaryScoreDerivativesB.put(entry.getFirstKey(), entry.getSecondKey(), new SimpleMatrix(1, numRows));\r\n }\r\n for (Map.Entry<String, SimpleMatrix> entry : dvModel.unaryTransform.entrySet()) {\r\n int numRows = entry.getValue().numRows();\r\n int numCols = entry.getValue().numCols();\r\n unaryW_dfsG.put(entry.getKey(), new SimpleMatrix(numRows, numCols));\r\n unaryW_dfsB.put(entry.getKey(), new SimpleMatrix(numRows, numCols));\r\n unaryScoreDerivativesG.put(entry.getKey(), new SimpleMatrix(1, numRows));\r\n unaryScoreDerivativesB.put(entry.getKey(), new SimpleMatrix(1, numRows));\r\n }\r\n if (op.trainOptions.trainWordVectors) {\r\n for (Map.Entry<String, SimpleMatrix> entry : dvModel.wordVectors.entrySet()) {\r\n int numRows = entry.getValue().numRows();\r\n int numCols = entry.getValue().numCols();\r\n wordVectorDerivativesG.put(entry.getKey(), new SimpleMatrix(numRows, numCols));\r\n wordVectorDerivativesB.put(entry.getKey(), new SimpleMatrix(numRows, numCols));\r\n }\r\n }\r\n\r\n // Some optimization methods prints out a line without an end, so our\r\n // debugging statements are misaligned\r\n Timing scoreTiming = new Timing();\r\n scoreTiming.doing(\"Scoring trees\");\r\n int treeNum = 0;\r\n MulticoreWrapper<Tree, Pair<DeepTree, DeepTree>> wrapper = new MulticoreWrapper<Tree, Pair<DeepTree, DeepTree>>(op.trainOptions.trainingThreads, new ScoringProcessor());\r\n for (Tree tree : trainingBatch) {\r\n wrapper.put(tree);\r\n }\r\n wrapper.join();\r\n scoreTiming.done();\r\n while (wrapper.peek()) {\r\n Pair<DeepTree, DeepTree> result = wrapper.poll();\r\n DeepTree goldTree = result.first;\r\n DeepTree bestTree = result.second;\r\n\r\n StringBuilder treeDebugLine = new StringBuilder();\r\n Formatter formatter = new Formatter(treeDebugLine);\r\n boolean isDone = (Math.abs(bestTree.getScore() - goldTree.getScore()) <= 0.00001 || goldTree.getScore() > bestTree.getScore());\r\n String done = isDone ? \"done\" : \"\";\r\n formatter.format(\"Tree %6d Highest tree: %12.4f Correct tree: %12.4f %s\", treeNum, bestTree.getScore(), goldTree.getScore(), done);\r\n System.err.println(treeDebugLine.toString());\r\n if (!isDone){\r\n // if the gold tree is better than the best hypothesis tree by\r\n // a large enough margin, then the score difference will be 0\r\n // and we ignore the tree\r\n\r\n double valueDelta = bestTree.getScore() - goldTree.getScore();\r\n //double valueDelta = Math.max(0.0, - scoreGold + bestScore);\r\n localValue += valueDelta;\r\n\r\n // get the context words for this tree - should be the same\r\n // for either goldTree or bestTree\r\n List<String> words = getContextWords(goldTree.getTree());\r\n\r\n // The derivatives affected by this tree are only based on the\r\n // nodes present in this tree, eg not all matrix derivatives\r\n // will be affected by this tree\r\n backpropDerivative(goldTree.getTree(), words, goldTree.getVectors(),\r\n binaryW_dfsG, unaryW_dfsG,\r\n binaryScoreDerivativesG, unaryScoreDerivativesG,\r\n wordVectorDerivativesG);\r\n\r\n backpropDerivative(bestTree.getTree(), words, bestTree.getVectors(),\r\n binaryW_dfsB, unaryW_dfsB,\r\n binaryScoreDerivativesB, unaryScoreDerivativesB,\r\n wordVectorDerivativesB);\r\n\r\n }\r\n ++treeNum;\r\n }\r\n\r\n double[] localDerivativeGood;\r\n double[] localDerivativeB;\r\n if (op.trainOptions.trainWordVectors) {\r\n localDerivativeGood = NeuralUtils.paramsToVector(theta.length,\r\n binaryW_dfsG.valueIterator(), unaryW_dfsG.values().iterator(),\r\n binaryScoreDerivativesG.valueIterator(),\r\n unaryScoreDerivativesG.values().iterator(),\r\n wordVectorDerivativesG.values().iterator());\r\n\r\n localDerivativeB = NeuralUtils.paramsToVector(theta.length,\r\n binaryW_dfsB.valueIterator(), unaryW_dfsB.values().iterator(),\r\n binaryScoreDerivativesB.valueIterator(),\r\n unaryScoreDerivativesB.values().iterator(),\r\n wordVectorDerivativesB.values().iterator());\r\n } else {\r\n localDerivativeGood = NeuralUtils.paramsToVector(theta.length,\r\n binaryW_dfsG.valueIterator(), unaryW_dfsG.values().iterator(),\r\n binaryScoreDerivativesG.valueIterator(),\r\n unaryScoreDerivativesG.values().iterator());\r\n\r\n localDerivativeB = NeuralUtils.paramsToVector(theta.length,\r\n binaryW_dfsB.valueIterator(), unaryW_dfsB.values().iterator(),\r\n binaryScoreDerivativesB.valueIterator(),\r\n unaryScoreDerivativesB.values().iterator());\r\n }\r\n\r\n // correct - highest\r\n for (int i =0 ;i<localDerivativeGood.length;i++){\r\n localDerivative[i] = localDerivativeB[i] - localDerivativeGood[i];\r\n }\r\n\r\n // TODO: this is where we would combine multiple costs if we had parallelized the calculation\r\n value = localValue;\r\n derivative = localDerivative;\r\n\r\n // normalizing by training batch size\r\n value = (1.0/trainingBatch.size()) * value;\r\n ArrayMath.multiplyInPlace(derivative, (1.0/trainingBatch.size()));\r\n\r\n // add regularization to cost:\r\n double[] currentParams = dvModel.paramsToVector();\r\n double regCost = 0;\r\n for (int i = 0 ; i<currentParams.length;i++){\r\n regCost += currentParams[i] * currentParams[i];\r\n }\r\n regCost = op.trainOptions.regCost * 0.5 * regCost;\r\n value += regCost;\r\n // add regularization to gradient\r\n ArrayMath.multiplyInPlace(currentParams, op.trainOptions.regCost);\r\n ArrayMath.pairwiseAddInPlace(derivative, currentParams);\r\n\r\n }", "@Test\n @Tag(\"bm1000\")\n public void testAFIRO() {\n\n // CPLEX MIN OPTIMAL -464.7531428571429 @ { 8E+1, 25.5, 54.5, 84.80, 18.21428571428572, 0, 0, 0, 0, 0, 0, 0, 18.21428571428572, 0, 19.30714285714286, 5E+2, 475.92, 24.08, 0, 215, 0, 0, 0, 0, 0, 0, 0, 0, 339.9428571428572, 383.9428571428572, 0, 0 }\n\n // Before shift\n // [80.0, 25.499999999999993, 54.5, 0.0, 18.214285714285708, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 18.214285714285708, 0.0, 19.30714285714285, 0.0, 651.9200000000001, 24.079999999999995, 0.0, 214.99999999999997, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 465.65714285714296, 561.6571428571428, 0.0, 0.0, 0.0, 0.0, 512.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 556.1746428571429, 0.0, 280.6928571428572, 0.0, 61.78571428571429, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]\n\n // After shift\n // [80.0, 25.499999999999993, 54.5, 84.8, 18.214285714285708, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 18.214285714285708, 0.0, 19.30714285714285, 500.0, 651.9200000000001, 24.079999999999995, 0.0, 214.99999999999997, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 465.65714285714296, 561.6571428571428, 0.0, 0.0, 0.0, 0.0, 512.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 556.1746428571429, 0.0, 280.6928571428572, 0.0, 61.78571428571429, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]\n // OPTIMAL -819.096 @ { 80.0, 25.499999999999993, 54.5, 84.8, 18.214285714285708, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 18.214285714285708, 0.0, 19.30714285714285, 500.0, 651.9200000000001, 24.079999999999995, 0.0, 214.99999999999997, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 465.65714285714296, 561.6571428571428, 0.0, 0.0, 0.0, 0.0, 512.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 556.1746428571429, 0.0, 280.6928571428572, 0.0, 61.78571428571429, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }\n\n // Mapped\n // OPTIMAL NaN @ { 80.0, 25.499999999999993, 54.5, 84.8, 18.214285714285708, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 18.214285714285708, 0.0, 19.30714285714285, 500.0, 651.9200000000001, 24.079999999999995, 0.0, 214.99999999999997, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 465.65714285714296, 561.6571428571428, 0.0, 0.0 }\n\n // Result\n // OPTIMAL -630.6960000000001 @ { 8E+1, 25.49999999999999, 54.5, 84.8, 18.21428571428571, 0, 0, 0, 0, 0, 0, 0, 18.21428571428571, 0, 19.30714285714285, 5E+2, 651.9200000000001, 24.07999999999999, 0, 215, 0, 0, 0, 0, 0, 0, 0, 0, 465.657142857143, 561.6571428571428, 0, 0 }\n\n // CPLEX MAX OPTIMAL 3438.2920999999997 @ { 54.5, 0, 54.5, 57.77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5E+2, 483.5955, 16.4045, 0, 215, 0, 0, 0, 0, 0, 0, 0, 0, 345.4253571428571, 0, 0, 389.4253571428571 }\n\n CuteNetlibCase.doTest(\"AFIRO.SIF\", \"-464.7531428571429\", \"3438.2920999999997\", NumberContext.of(7, 4));\n }", "public void translate() {\n\t\tif(!init)\r\n\t\t\treturn; \r\n\t\ttermPhraseTranslation.clear();\r\n\t\t// document threshold: number of terms / / 8\r\n//\t\tdocThreshold = (int) (wordKeyList.size() / computeAvgTermNum(documentTermRelation) / 8.0);\r\n\t\t//\t\tuseDocFrequency = true;\r\n\t\tint minFrequency=1;\r\n\t\temBkgCoefficient=0.5;\r\n\t\tprobThreshold=0.001;//\r\n\t\titerationNum = 20;\r\n\t\tArrayList<Token> tokenList;\r\n\t\tToken curToken;\r\n\t\tint j,k;\r\n\t\t//p(w|C)\r\n\r\n\t\tint[] termValues = termIndexList.values;\r\n\t\tboolean[] termActive = termIndexList.allocated;\r\n\t\ttotalCollectionCount = 0;\r\n\t\tfor(k=0;k<termActive.length;k++){\r\n\t\t\tif(!termActive[k])\r\n\t\t\t\tcontinue;\r\n\t\t\ttotalCollectionCount +=termValues[k];\r\n\t\t}\r\n\t\t\r\n\t\t// for each phrase\r\n\t\tint[] phraseFreqKeys = phraseFrequencyIndex.keys;\r\n\t\tint[] phraseFreqValues = phraseFrequencyIndex.values;\r\n\t\tboolean[] states = phraseFrequencyIndex.allocated;\r\n\t\tfor (int phraseEntry = 0;phraseEntry<states.length;phraseEntry++){\r\n\t\t\tif(!states[phraseEntry]){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (phraseFreqValues[phraseEntry] < minFrequency)\r\n\t\t\t\tcontinue;\r\n\t\t\ttokenList=genSignatureTranslation(phraseFreqKeys[phraseEntry]); // i is phrase number\r\n\t\t\tfor (j = 0; j <tokenList.size(); j++) {\r\n\t\t\t\tcurToken=(Token)tokenList.get(j);\r\n\t\t\t\tif(termPhraseTranslation.containsKey(curToken.getIndex())){\r\n\t\t\t\t\tIntFloatOpenHashMap old = termPhraseTranslation.get(curToken.getIndex());\r\n\t\t\t\t\tif(old.containsKey(phraseFreqKeys[phraseEntry])){\r\n\t\t\t\t\t\tSystem.out.println(\"aha need correction\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\told.put(phraseFreqKeys[phraseEntry], (float) curToken.getWeight()); //phrase, weight\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tIntFloatOpenHashMap newPhrase = new IntFloatOpenHashMap();\r\n\t\t\t\t\tnewPhrase.put(phraseFreqKeys[phraseEntry], (float) curToken.getWeight());\r\n\t\t\t\t\ttermPhraseTranslation.put(curToken.getIndex(), newPhrase);\r\n\t\t\t\t}\r\n\t\t\t\t//\t\t\t\toutputTransMatrix.add(i,curToken.getIndex(),curToken.getWeight());\r\n\t\t\t\t//\t\t\t\toutputTransTMatrix.add(curToken.getIndex(), i, curToken.getWeight());\r\n\t\t\t\t//TODO termPhrase exists, create PhraseTerm\r\n\t\t\t}\r\n\t\t\ttokenList.clear();\r\n\t\t}\r\n\r\n\t}", "public Vector mapPseudoDocument(Vector doc) {\n //logger.info(\"lsm.mapPseudoDocument \" + doc);\n // N = Uk.rows();\n float[] pdoc = new float[Uk[0].length];\n\n //logger.info(\"Uk.size \" + Uk.length + \" X \" + Uk[0].length);\n //logger.info(\"doc.size \" + doc.size());\n //logger.info(\"pdoc.size \" + pdoc.length);\n\n //for (int j=0;j<doc.size();j++)\n //\tlogger.info(j + \" \" + doc.get(j));\n\n for (int i = 0; i < Uk[0].length; i++) {\n Iterator<Integer> it = doc.nonZeroElements();\n for (int j = 0; it.hasNext(); j++) {\n Integer index = it.next().intValue();\n //logger.info(i + \", i: \" + index);\n //logger.info(i + \", v:\" + doc.get(index));\n //logger.info(i + \", Uk: \" + Uk[index][i]);\n pdoc[i] += Uk[index][i] * doc.get(index);\n\n } // end for j\n } // end for i\n\n //logger.info(\"pdoc.size \" + pdoc.length);\n return new DenseVector(pdoc);\n }", "public Vector loadAffyGCOSExpressionFile(File f) throws IOException {\r\n \tthis.setTMEVDataType();\r\n final int preSpotRows = this.sflp.getXRow()+1;\r\n final int preExperimentColumns = this.sflp.getXColumn();\r\n int numLines = this.getCountOfLines(f);\r\n int spotCount = numLines - preSpotRows;\r\n\r\n if (spotCount <= 0) {\r\n JOptionPane.showMessageDialog(superLoader.getFrame(), \"There is no spot data available.\", \"TDMS Load Error\", JOptionPane.INFORMATION_MESSAGE);\r\n }\r\n \r\n int[] rows = new int[] {0, 1, 0};\r\n int[] columns = new int[] {0, 1, 0};\r\n //String value,pvalue;\r\n String detection;\r\n\r\n float cy3, cy5;\r\n\r\n String[] moreFields = new String[1];\r\n String[] extraFields=null;\r\n final int rColumns = 1;\r\n final int rRows = spotCount;\r\n \r\n ISlideData slideDataArray[]=null;\r\n AffySlideDataElement sde=null;\r\n FloatSlideData slideData=null;\r\n \r\n BufferedReader reader = new BufferedReader(new FileReader(f));\r\n StringSplitter ss = new StringSplitter((char)0x09);\r\n String currentLine;\r\n int counter, row, column,experimentCount=0;\r\n counter = 0;\r\n row = column = 1;\r\n this.setFilesCount(1);\r\n this.setRemain(1);\r\n this.setFilesProgress(0);\r\n this.setLinesCount(numLines);\r\n this.setFileProgress(0);\r\n float[] intensities = new float[2];\r\n \r\n while ((currentLine = reader.readLine()) != null) {\r\n if (stop) {\r\n return null;\r\n }\r\n// fix empty tabbs appending to the end of line by wwang\r\n while(currentLine.endsWith(\"\\t\")){\r\n \tcurrentLine=currentLine.substring(0,currentLine.length()-1);\r\n }\r\n ss.init(currentLine);\r\n \r\n if (counter == 0) { // parse header\r\n \t\r\n \tif(sflp.onlyIntensityRadioButton.isSelected()) \r\n \t\texperimentCount = ss.countTokens()- preExperimentColumns;\r\n \t\t\r\n \tif(sflp.intensityWithDetectionRadioButton.isSelected()) \r\n \t\texperimentCount = (ss.countTokens()+1- preExperimentColumns)/2;\r\n \t\t\r\n \tif(sflp.intensityWithDetectionPvalRadioButton.isSelected()) \r\n \t\texperimentCount = (ss.countTokens()+1- preExperimentColumns)/3;\r\n \t\r\n \t\r\n \tslideDataArray = new ISlideData[experimentCount];\r\n \tSampleAnnotation sampAnn=new SampleAnnotation();\r\n \tslideDataArray[0] = new SlideData(rRows, rColumns, sampAnn);//Added by Sarita to include SampleAnnotation model.\r\n \r\n slideDataArray[0].setSlideFileName(f.getPath());\r\n for (int i=1; i<experimentCount; i++) {\r\n \tsampAnn=new SampleAnnotation();\r\n \tslideDataArray[i] = new FloatSlideData(slideDataArray[0].getSlideMetaData(),spotCount, sampAnn);//Added by Sarita \r\n \tslideDataArray[i].setSlideFileName(f.getPath());\r\n \t//System.out.println(\"slideDataArray[i].slide file name: \"+ f.getPath());\r\n }\r\n if(sflp.onlyIntensityRadioButton.isSelected()){\r\n \tString [] fieldNames = new String[1];\r\n \t//extraFields = new String[1];\r\n \tfieldNames[0]=\"AffyID\";\r\n \tslideDataArray[0].getSlideMetaData().appendFieldNames(fieldNames);\r\n }else if(sflp.intensityWithDetectionRadioButton.isSelected()){\r\n \tString [] fieldNames = new String[2];\r\n \textraFields = new String[1];\r\n fieldNames[0]=\"AffyID\";\r\n fieldNames[1]=\"Detection\";\r\n slideDataArray[0].getSlideMetaData().appendFieldNames(fieldNames);\r\n }else{\r\n \tString [] fieldNames = new String[3];\r\n \textraFields = new String[2];\r\n fieldNames[0]=\"AffyID\";\r\n fieldNames[1]=\"Detection\";\r\n fieldNames[2]=\"P-value\";\r\n slideDataArray[0].getSlideMetaData().appendFieldNames(fieldNames);\r\n \r\n }\r\n ss.nextToken();//parse the blank on header\r\n for (int i=0; i<experimentCount; i++) {\r\n \tString val=ss.nextToken();\r\n\t\t\t\t\tslideDataArray[i].setSampleAnnotationLoaded(true);\r\n\t\t\t\t\tslideDataArray[i].getSampleAnnotation().setAnnotation(\"Default Slide Name\", val);\r\n\t\t\t\t\tslideDataArray[i].setSlideDataName(val);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.mav.getData().setSampleAnnotationLoaded(true);\r\n\t\t\t \t \r\n if(sflp.intensityWithDetectionPvalRadioButton.isSelected()){\r\n \tss.nextToken();//parse the detection\r\n ss.nextToken();//parse the pvalue\r\n }else if(sflp.intensityWithDetectionRadioButton.isSelected()){\r\n \tss.nextToken();//parse the detection \r\n } \r\n }\r\n \r\n } else if (counter >= preSpotRows) { // data rows\r\n \trows[0] = rows[2] = row;\r\n \tcolumns[0] = columns[2] = column;\r\n \tif (column == rColumns) {\r\n \t\tcolumn = 1;\r\n \t\trow++;//commented by sarita\r\n \t\t\r\n \t\t\r\n \t} else {\r\n \t\tcolumn++;//commented by sarita\r\n \t\t\r\n \t\t\r\n \t}\r\n\r\n \t//affy ID\r\n \tmoreFields[0] = ss.nextToken();\r\n \r\n \t\r\n \t\r\n String cloneName = moreFields[0];\r\n if(_tempAnno.size()!=0) {\r\n \t \r\n \t \t \r\n \t if(((MevAnnotation)_tempAnno.get(cloneName))!=null) {\r\n \t\t MevAnnotation mevAnno = (MevAnnotation)_tempAnno.get(cloneName);\r\n\r\n \t\t sde = new AffySlideDataElement(String.valueOf(row+1), rows, columns, intensities, moreFields, mevAnno);\r\n \t }else {\r\n \t /**\r\n \t * Sarita: clone ID explicitly set here because if the data file\r\n \t * has a probe (for eg. Affy house keeping probes) for which Resourcerer\r\n \t * does not have annotation, MeV would still work fine. NA will be\r\n \t * appended for the rest of the fields. \r\n \t * \r\n \t * \r\n \t */\r\n \t\tMevAnnotation mevAnno = new MevAnnotation();\r\n \t\tmevAnno.setCloneID(cloneName);\r\n sde = new AffySlideDataElement(String.valueOf(row+1), rows, columns, new float[2], moreFields, mevAnno);\r\n \t \t\t \r\n }\r\n }\r\n /* Added by Sarita\r\n * Checks if annotation was loaded and accordingly use\r\n * the appropriate constructor.\r\n * \r\n * \r\n */\r\n \r\n else {\r\n sde = new AffySlideDataElement(String.valueOf(row+1), rows, columns, intensities, moreFields);\r\n }\r\n \r\n \t\r\n \t//sde = new AffySlideDataElement(String.valueOf(row+1), rows, columns, new float[2], moreFields);\r\n\r\n \tslideDataArray[0].addSlideDataElement(sde);\r\n \tint i=0;\r\n\r\n \tfor ( i=0; i<slideDataArray.length; i++) { \r\n \t\ttry {\t\r\n\r\n \t\t\t// Intensity\r\n \t\t\tintensities[0] = 1.0f;\r\n \t\t\tintensities[1] = ss.nextFloatToken(0.0f);\r\n \t\t\r\n \t\t\tif(sflp.intensityWithDetectionPvalRadioButton.isSelected()){\r\n \t\t\t\t\r\n \t\t\t\textraFields[0]=ss.nextToken();//detection\r\n \t\t\t\textraFields[1]=ss.nextToken();//p-value\r\n \t\t\t\t\r\n \t\t\t}else if(sflp.intensityWithDetectionRadioButton.isSelected()){\r\n \t\t\t\textraFields[0]=ss.nextToken();//detection\r\n \t\t\t}\r\n\r\n \t\t} catch (Exception e) {\r\n \t\t\t\r\n \t\t\tintensities[1] = Float.NaN;\r\n \t\t}\r\n \t\tif(i==0){\r\n \t\t\t\r\n \t\t\tslideDataArray[i].setIntensities(counter - preSpotRows, intensities[0], intensities[1]);\r\n \t\t\t//sde.setExtraFields(extraFields);\r\n \t\t\tif(sflp.intensityWithDetectionPvalRadioButton.isSelected()){\r\n \t\t\t\tsde.setDetection(extraFields[0]);\r\n \t\t\t\tsde.setPvalue(new Float(extraFields[1]).floatValue());\r\n \t\t\t}else if(sflp.intensityWithDetectionRadioButton.isSelected()){\r\n \t\t\t\tsde.setDetection(extraFields[0]);\r\n \t\t\t}\r\n \t\t}else{\r\n \t\t\tif(i==1){\r\n \t\t\t\tmeta = slideDataArray[0].getSlideMetaData(); \t\r\n \t\t\t}\r\n \t\t\tslideDataArray[i].setIntensities(counter-preSpotRows,intensities[0],intensities[1]);\r\n \t\t\tif(sflp.intensityWithDetectionPvalRadioButton.isSelected()){\r\n \t\t\t\t((FloatSlideData)slideDataArray[i]).setDetection(counter-preSpotRows,extraFields[0]);\r\n \t\t\t\t((FloatSlideData)slideDataArray[i]).setPvalue(counter-preSpotRows,new Float(extraFields[1]).floatValue());\r\n \t\t\t}\r\n \t\t\tif(sflp.intensityWithDetectionRadioButton.isSelected()){\r\n \t\t\t\t((FloatSlideData)slideDataArray[i]).setDetection(counter-preSpotRows,extraFields[0]);\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n\r\n } else {\r\n //we have additional sample annoation\r\n \r\n \tfor (int i = 0; i < preExperimentColumns - 1; i++) {\r\n\t\t\t\t\tss.nextToken();\r\n\t\t\t\t}\r\n\t\t\t\tString key = ss.nextToken();\r\n\r\n\t\t\t\tfor (int j = 0; j < slideDataArray.length; j++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(slideDataArray[j].getSampleAnnotation()!=null){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tString val=ss.nextToken();\r\n\t\t\t\t\t\tslideDataArray[j].getSampleAnnotation().setAnnotation(key, val);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tSampleAnnotation sampAnn=new SampleAnnotation();\r\n\t\t\t\t\t\t\tsampAnn.setAnnotation(key, ss.nextToken());\r\n\t\t\t\t\t\t\tslideDataArray[j].setSampleAnnotation(sampAnn);\r\n\t\t\t\t\t\t\tslideDataArray[j].setSampleAnnotationLoaded(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n \t}\r\n \t\r\n this.setFileProgress(counter);\r\n \tcounter++;\r\n \t//System.out.print(counter);\r\n \t}\r\n reader.close();\r\n \r\n \r\n Vector data = new Vector(slideDataArray.length);\r\n \r\n for(int j = 0; j < slideDataArray.length; j++)\r\n \tdata.add(slideDataArray[j]);\r\n \r\n this.setFilesProgress(1);\r\n return data;\r\n }", "public void processData() {\n\t\t SamReader sfr = SamReaderFactory.makeDefault().validationStringency(ValidationStringency.LENIENT).open(this.inputFile);\n\t\t \n\t\t\t\n\t\t\t//Set up file writer\n\t\t SAMFileWriterFactory sfwf = new SAMFileWriterFactory();\n\t\t sfwf.setCreateIndex(true);\n\t\t SAMFileWriter sfw = sfwf.makeSAMOrBAMWriter(sfr.getFileHeader(), false, this.outputFile);\n\t\t \n\t\t \n\t\t\t\n\t\t\t\n\t\t\t//counters\n\t\t\tint totalReads = 0;\n\t\t\tint trimmedReads = 0;\n\t\t\tint droppedReads = 0;\n\t\t\tint dropTrimReads = 0;\n\t\t\tint dropMmReads = 0;\n\t\t\t\n\t\t\t//Containers\n\t\t\tHashSet<String> notFound = new HashSet<String>();\n\t\t\tHashMap<String, SAMRecord> mateList = new HashMap<String,SAMRecord>();\n\t\t\tHashSet<String> removedList = new HashSet<String>();\n\t\t\tHashMap<String,SAMRecord> editedList = new HashMap<String,SAMRecord>();\n\t\t\t\n\t\t\tfor (SAMRecord sr: sfr) {\n\t\t\t\t//Messaging\n\t\t\t\tif (totalReads % 1000000 == 0 && totalReads != 0) {\n\t\t\t\t\tSystem.out.println(String.format(\"Finished processing %d reads. %d were trimmed, %d were set as unmapped. Currently storing mates for %d reads.\",totalReads,trimmedReads,droppedReads,mateList.size()));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\ttotalReads += 1;\n\t\t\t\t\n\t\t\t\tString keyToCheck = sr.getReadName() + \":\" + String.valueOf(sr.getIntegerAttribute(\"HI\"));\n\t\t\t\n\t\t\t\t//Make sure chromsome is available\n\t\t\t\tString chrom = sr.getReferenceName();\n\t\t\t\tif (!this.refHash.containsKey(chrom)) {\n\t\t\t\t\tif (!notFound.contains(chrom)) {\n\t\t\t\t\t\tnotFound.add(chrom);\n\t\t\t\t\t\tMisc.printErrAndExit(String.format(\"Chromosome %s not found in reference file, skipping trimming step\", chrom));\n\t\t\t\t\t}\n\t\t\t\t} else if (!sr.getReadUnmappedFlag()) {\n\t\t\t\t\tString refSeq = null;\n\t\t\t\t\tString obsSeq = null;\n\t\t\t\t\tList<CigarElement> cigar = null;\n\t\t\t\t\t\n\t\t\t\t\t//Get necessary sequence information depending on orientation\n\t\t\t\t\tif (sr.getReadNegativeStrandFlag()) {\n\t\t\t\t\t\trefSeq = this.revComp(this.refHash.get(chrom).substring(sr.getAlignmentStart()-1,sr.getAlignmentEnd()));\n\t\t\t\t\t\tobsSeq = this.revComp(sr.getReadString());\n\t\t\t\t\t\tcigar = this.reverseCigar(sr.getCigar().getCigarElements());\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\trefSeq = this.refHash.get(chrom).substring(sr.getAlignmentStart()-1,sr.getAlignmentEnd());\n\t\t\t\t\t\tobsSeq = sr.getReadString();\n\t\t\t\t\t\tcigar = sr.getCigar().getCigarElements();\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Get alignments\n\t\t\t\t\tString[] alns = this.createAlignmentStrings(cigar, refSeq, obsSeq, totalReads);\n\t\t\t\t\t\n\t\t\t\t\t//Identify Trim Point\n\t\t\t\t\tint idx = this.identifyTrimPoint(alns,sr.getReadNegativeStrandFlag());\n\t\t\t\t\t\n\t\t\t\t\t//Check error rate\n\t\t\t\t\tboolean mmPassed = false;\n\t\t\t\t\tif (mmMode) {\n\t\t\t\t\t\tmmPassed = this.isPoorQuality(alns, sr.getReadNegativeStrandFlag(), idx);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Create new cigar string\n\t\t\t\t\tif (idx < minLength || mmPassed) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tsr.setAlignmentStart(0);\n\t\t\t\t\t\tsr.setReadUnmappedFlag(true);\n\t\t\t\t\t\tsr.setProperPairFlag(false);\n\t\t\t\t\t\tsr.setReferenceIndex(-1);\n\t\t\t\t\t\tsr.setMappingQuality(0);\n\t\t\t\t\t\tsr.setNotPrimaryAlignmentFlag(false);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (sr.getReadPairedFlag() && !sr.getMateUnmappedFlag()) {\n\t\t\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\t\t\tmateList.put(keyToCheck, this.changeMateUnmapped(mateList.get(keyToCheck)));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tremovedList.add(keyToCheck);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} \n\t\t\t\t\t\tdroppedReads += 1;\n\t\t\t\t\t\tif (idx < minLength) {\n\t\t\t\t\t\t\tdropTrimReads += 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdropMmReads += 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (idx+1 != alns[0].length()) {\n\t\t\t\t\t\ttrimmedReads++;\n\t\t\t\t\t\tCigar oldCig = sr.getCigar();\n\t\t\t\t\t\tCigar newCig = this.createNewCigar(alns, cigar, idx, sr.getReadNegativeStrandFlag());\n\t\t\t\t\t\tsr.setCigar(newCig);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (sr.getReadNegativeStrandFlag()) {\n\t\t\t\t\t\t\tint newStart = this.determineStart(oldCig, newCig, sr.getAlignmentStart());\n\t\t\t\t\t\t\tsr.setAlignmentStart(newStart);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (this.verbose) {\n\t\t\t\t\t\t\tthis.printAlignments(sr, oldCig, alns, idx);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (sr.getReadPairedFlag() && !sr.getMateUnmappedFlag()) {\n\t\t\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\t\t\tmateList.put(keyToCheck, this.changeMatePos(mateList.get(keyToCheck),sr.getAlignmentStart()));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\teditedList.put(keyToCheck,sr);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//System.out.println(sr.getReadName());\n\t\t\t\tif (sr.getReadPairedFlag() && !sr.getMateUnmappedFlag()) {\n\t\t\t\t\t//String rn = sr.getReadName();\n\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\tif (editedList.containsKey(keyToCheck)) {\n\t\t\t\t\t\t\tsr = this.changeMatePos(sr,editedList.get(keyToCheck).getAlignmentStart());\n\t\t\t\t\t\t\teditedList.remove(keyToCheck);\n\t\t\t\t\t\t} else if (removedList.contains(keyToCheck)) {\n\t\t\t\t\t\t\tsr = this.changeMateUnmapped(sr);\n\t\t\t\t\t\t\tremovedList.remove(keyToCheck);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsfw.addAlignment(sr);\n\t\t\t\t\t\tsfw.addAlignment(mateList.get(keyToCheck));\n\t\t\t\t\t\tmateList.remove(keyToCheck);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmateList.put(keyToCheck, sr);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsfw.addAlignment(sr);\n\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\tmateList.remove(keyToCheck);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(String.format(\"Finished processing %d reads. %d were trimmed, %d were set as unmapped. Of the unmapped, %d were too short and %d had too many mismatches. Currently storing mates for %d reads.\",\n\t\t\t\t\ttotalReads,trimmedReads,droppedReads,dropTrimReads, dropMmReads, mateList.size()));\n\t\t\tSystem.out.println(String.format(\"Reads left in hash: %d. Writing to disk.\",mateList.size()));\n\t\t\tfor (SAMRecord sr2: mateList.values()) {\n\t\t\t\tsfw.addAlignment(sr2);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tsfw.close();\n\t\t\ttry {\n\t\t\t\tsfr.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\t\n\t}", "float[][] getCameraVectors(int resX, int resY){\n float vectors[][]=new float[resX*resY][3];//first vector index, second the components of the vector\n float[] vect2=rotateYVector(dir);\n vect2[1]=0;\n vect2=normalize(vect2);\n float[] vect3=normalize(vectorProduct(dir, vect2));//dir, vect2, vect3 base vectors\n float[] x={0,0,0};\n float[] y={0,0,0};\n float[] temp={0,0,0};\n for(int i=0;i<3;i++){\n x[i]=(vect2[i])/(resX/2);\n y[i]=(vect3[i])/(resY/2);\n temp[i]=vect2[i];\n }\n \n for(int j=0;j<resY;j++){\n for(int i=0;i<resX;i++){\n vectors[j*resX+i][0]=dir[0]+vect2[0]+vect3[0];\n vectors[j*resX+i][1]=dir[1]+vect2[1]+vect3[1];\n vectors[j*resX+i][2]=dir[2]+vect2[2]+vect3[2];\n vect2[0]-=x[0];\n vect2[1]-=x[1];\n vect2[2]-=x[2];\n if((vectorLength(vect2)>(-0.0001)&&vectorLength(vect2)<0.0001)&&(resX%2)==0){\n vect2[0]-=x[0];\n vect2[1]-=x[1];\n vect2[2]-=x[2];\n }\n }\n //printVector(temp);\n vect2[0]=temp[0];\n vect2[1]=temp[1];\n vect2[2]=temp[2];\n vect3[0]-=y[0];\n vect3[1]-=y[1];\n vect3[2]-=y[2];\n if((vectorLength(vect3)>(-0.0001)&&vectorLength(vect3)<0.0001)&&(resY%2)==0){\n vect3[0]-=y[0];\n vect3[1]-=y[1];\n vect3[2]-=y[2];\n }\n }\n \n return vectors;\n }", "public void rasterScanning(){\r\n ReadParameter embedPara = new ReadParameter();\r\n QuantisationEmbedding subband = new QuantisationEmbedding();\r\n int i,j,k,p;\r\n double[] coeffStream, modCoeffStream;\r\n //Modification in selected subband only\r\n if(embedPara.getSubbandChoice().compareTo(\"LF\") == 0){\r\n //Embed in low low subband only\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n coeffStream[k++] = subband.getSubbandLL()[i][j];\r\n }\r\n }\r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n // Write it back in proper order\r\n k = 0; // Reset k value\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n \r\n } else if(embedPara.getSubbandChoice().compareTo(\"HF\") == 0){\r\n //Embed in high frequency subband only\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length * 3];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n \r\n // Make it fir three high frequency subbands\r\n for(p=0; p<3; p++){\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n if(p==0){ //Get LH Subband values\r\n coeffStream[k++] = subband.getSubbandLH()[i][j];\r\n \r\n } else if(p==1){ //Get HL Subband values\r\n coeffStream[k++] = subband.getSubbandHL()[i][j];\r\n \r\n } else if(p==2){ //Get HH Subband values\r\n coeffStream[k++] = subband.getSubbandHH()[i][j];\r\n \r\n } // End of if-else condition \r\n } // End of inner loop\r\n } \r\n } // End of outer loop\r\n \r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n \r\n // Write it back in proper order\r\n k=0; // Reset k value\r\n //Write back LH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n \r\n \r\n } else if(embedPara.getSubbandChoice().compareTo(\"AF\") == 0){\r\n //Embed in all subbands\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length * 4];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n \r\n // Make it fir three high frequency subbands\r\n for(p=0; p<4; p++){\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n if(p==0){ //Get LL Subband values\r\n coeffStream[k++] = subband.getSubbandLL()[i][j];\r\n \r\n } else if(p==1){ //Get LH Subband values\r\n coeffStream[k++] = subband.getSubbandLH()[i][j];\r\n \r\n } else if(p==2){ //Get HL Subband values\r\n coeffStream[k++] = subband.getSubbandHL()[i][j];\r\n \r\n } else if(p==3){ //Get HH Subband values\r\n coeffStream[k++] = subband.getSubbandHH()[i][j];\r\n \r\n } // End of if-else condition \r\n } // End of inner loop\r\n } \r\n } // End of outer loop\r\n \r\n \r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n \r\n \r\n // Write it back in proper order\r\n k = 0; //Reset k value\r\n //Write back LL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back LH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n } // End subband choice if-else condition\r\n \r\n }", "public static void main(String[] args)\n throws FileNotFoundException, IOException\n {\n if (args.length == 0)\n {\n System.out.println(getUsageString());\n System.exit(0);\n }\n\n AssignEigenvectorsCmd cmd = new AssignEigenvectorsCmd();\n // Parse input. If incorrect, say what's wrong and print usage String\n if (!cmd.parseArguments(args))\n {\n System.out.println(getUsageString());\n System.exit(0);\n }\n\n // read lag times\n IDoubleArray lagFile = doublesNew.fromFile(cmd.inDir + \"/hmm-its.dat\");\n int[] lagtimes = intArrays.from(lagFile.getColumn(0));\n\n // reference\n IDoubleArray pibig0 = doublesNew.fromFile(cmd.inDir + \"/hmm-pibig-lag\" + cmd.reflag + \".dat\");\n IDoubleArray Rbig0 = doublesNew.fromFile(cmd.inDir + \"/hmm-Rbig-lag\" + cmd.reflag + \".dat\");\n cmd.setReference(pibig0, Rbig0);\n\n // read matrices and Chi\n for (int tau : lagtimes)\n {\n IDoubleArray TC = doublesNew.fromFile(cmd.inDir + \"/hmm-TC-lag\" + tau + \".dat\");\n IDoubleArray timescales = msm.timescales(TC, tau);\n IDoubleArray pibig = doublesNew.fromFile(cmd.inDir + \"/hmm-pibig-lag\" + tau + \".dat\");\n IDoubleArray Rbig = doublesNew.fromFile(cmd.inDir + \"/hmm-Rbig-lag\" + tau + \".dat\");\n\n System.out.print(tau + \"\\t\");\n for (int i = 1; i < Rbig.columns(); i++)\n {\n IDoubleArray ri = Rbig.viewColumn(i);\n\n double max = 0;\n int argmax = i;\n for (int j = 1; j < Rbig.columns(); j++)\n {\n double o = cmd.overlap(ri, j, pibig);\n if (o > max)\n {\n max = o;\n argmax = j;\n }\n }\n \n if (max > cmd.minOverlap)\n {\n System.out.print(timescales.get(argmax-1)+\"\\t\");\n }\n else\n {\n System.out.print(0+\"\\t\");\n }\n //System.out.print(max + \"(\"+argmax+\")\" + \"\\t\");\n }\n System.out.println();\n }\n\n }", "default void LM(int pos, SubMatrix M, DataBlock m, double f) {\n ISsfDynamics dynamics = getDynamics();\n ISsfMeasurement measurement = getMeasurement();\n // Apply LX on each column of M\n DataBlockIterator cols = M.columns();\n DataBlock col = cols.getData();\n do {\n col.addAY(-measurement.ZX(pos, col) / f, m);\n dynamics.XT(pos, col);\n } while (cols.next());\n }", "private static void vel_step ( int N, double[] u, double[] v, double[] u0, double[] v0,\r\n\t\tfloat visc, float dt )\r\n\t\t{\r\n\t\tadd_source ( N, u, u0, dt ); add_source ( N, v, v0, dt );\r\n\t\t\r\n\t\t/*\r\n\t\tdraw_dens ( N, v );\r\n\t\tdraw_dens ( N, v0 );\r\n\t\t*/\r\n\t\t\r\n\t\t//SWAP ( u0, u ); \r\n\t\t\r\n\t\tdouble[] temp;\r\n\t\ttemp=u0;\r\n\t\tu0=u;\r\n\t\tu=temp;\r\n\t\t//draw_dens ( N, u );\r\n\t\tdiffuse ( N, 1, u, u0, visc, dt );\r\n\t\t//draw_dens ( N, u );\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t//SWAP ( v0, v ); \r\n\t\t//double[] temp;\r\n\t\ttemp=v0;\r\n\t\tv0=v;\r\n\t\tv=temp;\r\n\t\t//draw_dens ( N, v );\r\n\t\t//draw_dens ( N, v0 );\r\n\t\tdiffuse ( N, 2, v, v0, visc, dt );\r\n\t\t//draw_dens ( N, v );\r\n\t\t//System.out.println(\"V\");\r\n\t\t//draw_dens ( N, v );\r\n\t\t\r\n\t\t\r\n\t\t/*\r\n\t\tdraw_dens ( N, v );\r\n\t\tdraw_dens ( N, v0 );\r\n\t\t*/\r\n\t\tproject ( N, u, v, u0, v0 );\r\n\t\t//SWAP ( u0, u ); \r\n\t\ttemp=u0;\r\n\t\tu0=u;\r\n\t\tu=temp;\r\n\t\t\r\n\t\t//SWAP ( v0, v );\r\n\t\ttemp=v0;\r\n\t\tv0=v;\r\n\t\tv=temp;\r\n\t\t//System.out.println(\"V\");\r\n\t\t//draw_dens ( N, v );\r\n\t\t\r\n\t\t/*\r\n\t\tdraw_dens ( N, v );\r\n\t\tdraw_dens ( N, v0 );\r\n\t\t*/\r\n\t\t\r\n\t\tadvect ( N, 1, u, u0, u0, v0, dt ); \r\n\t\tadvect ( N, 2, v, v0, u0, v0, dt );\r\n\t\tproject ( N, u, v, u0, v0 );\r\n\t\t}", "private void initializeSTL(STLFileReader reader) {\r\n try {\r\n initWithSize(IntStream.of(reader.getNumOfFacets()).sum());\r\n\r\n for (int index = 0; index < size; index++) {\r\n double[] normal = new double[3];\r\n double[][] vertices = new double[3][3];\r\n\r\n reader.getNextFacet(normal, vertices);\r\n\r\n normalX[index] = normal[X];\r\n normalY[index] = normal[Y];\r\n normalZ[index] = normal[Z];\r\n\r\n vertexAX[index] = vertices[A][X];\r\n vertexAY[index] = vertices[A][Y];\r\n vertexAZ[index] = vertices[A][Z];\r\n\r\n\r\n edgeBAX[index] = vertices[B][X] - vertices[A][X];\r\n edgeBAY[index] = vertices[B][Y] - vertices[A][Y];\r\n edgeBAZ[index] = vertices[B][Z] - vertices[A][Z];\r\n\r\n edgeCAX[index] = vertices[C][X] - vertices[A][X];\r\n edgeCAY[index] = vertices[C][Y] - vertices[A][Y];\r\n edgeCAZ[index] = vertices[C][Z] - vertices[A][Z];\r\n\r\n centerX[index] = (vertices[A][X] + vertices[B][X] + vertices[C][X]) / 3;\r\n centerY[index] = (vertices[A][Y] + vertices[B][Y] + vertices[C][Y]) / 3;\r\n centerZ[index] = (vertices[A][Z] + vertices[B][Z] + vertices[C][Z]) / 3;\r\n\r\n area[index] = areaOf(vertices);\r\n }\r\n reader.close();\r\n } catch (Exception e) {\r\n throw new RuntimeException(e);\r\n }\r\n }", "public void calculate() {\n float xoff = 0;\n for (int i = 0; i < cols; i++)\n { \n float yoff = 0;\n for (int j = 0; j < rows; j++)\n {\n z[i][j] = map(noise(xoff, yoff,zoff), 0, 1, -120, 120);\n yoff += 0.1f;\n }\n xoff += 0.1f;\n }\n zoff+=0.01f;\n }", "private double calculateUvi(){\n if ( uva != Integer.MAX_VALUE\n && uvb != Integer.MAX_VALUE\n && uvd != Integer.MAX_VALUE\n && uvcomp1 != Integer.MAX_VALUE\n && uvcomp2 != Integer.MAX_VALUE\n )\n {\n // These equations came from the \"Designing the VEML6075 into an Application\" document from Vishay\n double uvacomp = (uva - uvd) - VEML_A_COEF * (uvcomp1 - uvd) - VEML_B_COEF * (uvcomp2 - uvd);\n double uvbcomp = (uvb - uvd) - VEML_C_COEF * (uvcomp1 - uvd) - VEML_D_COEF * (uvcomp2 - uvd);\n\n return ( (uvbcomp * VEML_UVB_RESP) + (uvacomp * VEML_UVA_RESP) ) / 2.0;\n }\n\n return Double.NaN;\n }" ]
[ "0.55143595", "0.5257567", "0.5253568", "0.5126732", "0.5029475", "0.49475676", "0.475419", "0.4689893", "0.46602765", "0.46556956", "0.46436468", "0.4636452", "0.4616809", "0.46162686", "0.45779273", "0.4552181", "0.45322683", "0.45222244", "0.45200452", "0.45139152", "0.45050403", "0.4494266", "0.44935393", "0.44914812", "0.44817123", "0.44731385", "0.44618306", "0.4449787", "0.4426726", "0.44246015", "0.44216713", "0.44075263", "0.4394741", "0.438216", "0.43762422", "0.43704635", "0.43692562", "0.43681934", "0.43670115", "0.43608668", "0.43594846", "0.43564516", "0.43544906", "0.43463436", "0.434461", "0.43394706", "0.43375045", "0.43256453", "0.43210268", "0.43114224", "0.43098155", "0.4306178", "0.43021902", "0.42893898", "0.42789915", "0.42775938", "0.42677194", "0.42621106", "0.42599076", "0.42577842", "0.4251648", "0.4251642", "0.42512164", "0.42499587", "0.42483264", "0.42479652", "0.42454886", "0.42430988", "0.4239561", "0.42285606", "0.42240337", "0.42221475", "0.42186522", "0.4206962", "0.42054403", "0.42048582", "0.42031378", "0.42013335", "0.41997012", "0.4198912", "0.4186353", "0.41861954", "0.41757318", "0.41671956", "0.4166844", "0.41630462", "0.4152544", "0.4152037", "0.4148441", "0.4145701", "0.41449654", "0.41404995", "0.4138614", "0.41334814", "0.41284508", "0.41251537", "0.41178834", "0.41152278", "0.41150838", "0.41129825" ]
0.45966536
14
Removes symbolic events from list of haplotypes
protected static void cleanUpSymbolicUnassembledEvents( final List<Haplotype> haplotypes ) { Utils.nonNull(haplotypes); final List<Haplotype> haplotypesToRemove = new ArrayList<>(); for( final Haplotype h : haplotypes ) { for( final VariantContext vc : h.getEventMap().getVariantContexts() ) { if( vc.isSymbolic() ) { for( final Haplotype h2 : haplotypes ) { for( final VariantContext vc2 : h2.getEventMap().getVariantContexts() ) { if( vc.getStart() == vc2.getStart() && (vc2.isIndel() || vc2.isMNP()) ) { // unfortunately symbolic alleles can't currently be combined with non-point events haplotypesToRemove.add(h); break; } } } } } } haplotypes.removeAll(haplotypesToRemove); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void removeEvents(){\n for(Entry<Class, List<EventTrigger>> eventGroup: HandlerRegistry.getHandlers().entrySet()){\n String annotation = eventGroup.getKey().getName();\n List<EventTrigger> eventTriggers = new ArrayList<EventTrigger>(eventGroup.getValue());\n for(EventTrigger trigger : eventTriggers){\n if(trigger.getServer()==this) { // do not send own events...\n ESRemoveEvent esre = new ESRemoveEvent(annotation, trigger.getTrigger());\n for(EventShare es : EventShare.getEventShareServers()){\n if(es!=this) {\n if (es.isShareOut()) {\n try {\n es.getEventBusServer().write(esre);\n }catch (Exception e){\n e.printStackTrace();\n }\n }\n }\n }\n HandlerRegistry.getHandlers().get(eventGroup.getKey()).remove(trigger);\n System.out.println(HandlerRegistry.getHandlers());\n }\n }\n }\n }", "<T extends ListenableEvent> void removeActions(ActionType<T> type);", "public void repair(EventType event);", "void clearEventsDetectors();", "public void removeAllListeners(String type) {\n APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + \".removeAllListeners(%s);\", wrapQuotes(type)));\n }", "public void UnPostAllEvents();", "public void removeAllTuioListeners()\n\t{\n\t\tlistenerList.clear();\n\t}", "private void unsubscribeAll(MicroService m){\n\t\tConcurrentLinkedQueue<Class> queue=microToEvent.get(m);\n\t\tif(queue!=null)\n\t\tfor(Class cla:queue){\n\t\t\tif(Broadcast.class.isAssignableFrom(cla)){\t\t// checks if broadcast is super/interface of cla (meaning cla implements/extends broadcast)\n\t\t\t\t\tbroadcastToMicroServices.get(cla).remove(m);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\teventToMicroHandlers.get(cla).remove(m);\n\t\t\t}\n\t\t}\n\t}", "void removeArrayOfFaultType(int i);", "@Override\r\n\tpublic void clearEventHandlers() {\n\t\t\r\n\t}", "private void removeClickList() {\n\t\t\n\t\tmyGame.removeChatRequestListener(this);\n\t\tmyGame.removeNotificationListener(this);\n\t\tmyGame.removeZoneRequestListener(this);\n\t\tmyGame.removeConnectionRequestListener(this);\n\t\t\n\t}", "void hardRemoveAllBotsOfType( String className, String initiator ) {\n String rawClassName = className.toLowerCase();\n Integer numBots = m_botTypes.get( rawClassName );\n LinkedList<String> names = new LinkedList<String>();\n\n for( ChildBot c : m_botStable.values() )\n if( c != null ) {\n if(c.getClassName().equals( rawClassName ))\n names.add( c.getBot().getBotName() );\n }\n\n for( String name : names ) {\n removeBot( name, \"!removetype by \" + initiator );\n m_botAction.sendChatMessage( 1, name + \" logged off. (!removetype initiated.)\" );\n }\n\n if( numBots != null && numBots.intValue() != 0 )\n m_botTypes.put( rawClassName, new Integer(0) );\n }", "public final void removeAllCompositeTypes()\n {\n listModel.removeAllElements();\n\tallTypes.removeAllElements();\n }", "@SuppressWarnings(\"unused\")\n public void removeAllListeners() {\n eventHandlerList.clear();\n }", "public void removeServer(AbstractServer server) {\n server.getHandler().getHandledTypes()\n .forEach(x -> {\n handlerMap.remove(x, server);\n log.trace(\"Un-Registered {} to handle messages of type {}\", server, x);\n });\n }", "@Override\n public void clearNonSymbolMatchedListener() {\n nonSymbolListener = null;\n }", "private void removeEvent() {\n Event event = selectEvent(\"Which event would you like to delete?\");\n world.removeEvent(event);\n System.out.println(\"Removed \" + event.getName() + \"!\");\n }", "public void removeListeners() {\n for (LetterTile tile : rack)\n tile.removeTileListener();\n }", "final void removeSourceEvents(Object source) {\n\tToolkit toolkit = Toolkit.getDefaultToolkit();\n if (toolkit instanceof SunToolkit) {\n\t ((SunToolkit)toolkit).flushPendingEvents();\n\t}\n\n synchronized (this) {\n\t for (int i = 0; i < NUM_PRIORITIES; i++) {\n\t EventQueueItem entry = queues[i].head;\n\t\tEventQueueItem prev = null;\n\t\twhile (entry != null) {\n\t\t if (entry.event.getSource() == source) {\n\t\t if (prev == null) {\n\t\t\t queues[i].head = entry.next;\n\t\t\t} else {\n\t\t\t prev.next = entry.next;\n\t\t\t}\n\t\t } else {\n\t\t prev = entry;\n\t\t }\n\t\t entry = entry.next;\n\t\t}\n\t\tqueues[i].tail = prev;\n\t }\n\t}\n }", "void unsetEvent();", "protected void clearEvents() {\n\t\tsCIButtons.clearEvents();\n\t\tsCILogicUnit.clearEvents();\n\t\tsCIState.clearEvents();\n\n\t\tfor (int i = 0; i < timeEvents.length; i++) {\n\t\t\ttimeEvents[i] = false;\n\t\t}\n\t}", "public void clearNames() {\n eventTitles = null;\n guestTitles = null;\n }", "void unsetType();", "public void removeFromEvents(final SapEvent value)\n\t{\n\t\tremoveFromEvents( getSession().getSessionContext(), value );\n\t}", "public void removeByType(long typeId);", "@Override\n public List<XulEventHandler> getEventHandlers() {\n return null;\n }", "void clearHandlers();", "public void clear_type(String type) {\n\t\t/* Iterate through draw list */\n\t\tIterator<ArrayList<Drawable>> iter = this.drawlist.iterator();\n\t\twhile(iter.hasNext()) {\n\t\t\tArrayList<Drawable> layer = iter.next();\n\t\t\t/* Iterate through the layer. */\n\t\t\tIterator<Drawable> jter = layer.iterator();\n\t\t\twhile(jter.hasNext()) {\n\t\t\t\tif(jter.next().getType().equals(type)) {\n\t\t\t\t\tjter.remove();\n\t\t\t\t}//fi\n\t\t\t}//elihw\n\t\t}//elihw\n\t}", "public void removeSysUserTypes(final Map idList);", "public void clearEvents()\n {\n ClientListener.INSTANCE.clear();\n BackingMapListener.INSTANCE.clear();\n }", "protected abstract List<EventType> getAllowedEventTypes();", "public void removeAllAnnotationTypes() {\n \t\tfConfiguredAnnotationTypes.clear();\n \t\tfAllowedAnnotationTypes.clear();\n \t\tfConfiguredHighlightAnnotationTypes.clear();\n \t\tfAllowedHighlightAnnotationTypes.clear();\n \t\tif (fTextInputListener != null) {\n \t\t\tfSourceViewer.removeTextInputListener(fTextInputListener);\n \t\t\tfTextInputListener= null;\n \t\t}\n \t}", "void removeHasAlcoholSpecimanType(Integer oldHasAlcoholSpecimanType);", "public void removeResourceTypes(final Map idList);", "protected void removeHalted() {\n for (Machine machine : machines) {\n while (!machine.getEventBuffer().isEmpty()) {\n Guard targetHalted =\n machine.getEventBuffer().satisfiesPredUnderGuard(x -> x.targetHalted()).getGuardFor(true);\n if (!targetHalted.isFalse()) {\n rmBuffer(machine, targetHalted);\n continue;\n }\n break;\n }\n }\n }", "public static void removeAllObservers() {\n compositeDisposable.clear();\n observersList.clear();\n Timber.i(\"This is the enter point: All live assets and team feed auto refresh DOs are removed\");\n }", "@Override\n public void clearSymbolMatchedListener() {\n symbolListener = null;\n }", "private void removeObsoleteFishes() {\n for (Piranha piranha : piranhas) {\n if (piranha.isOnRemoval()) {\n toRemove.add(piranha);\n }\n }\n if (!toRemove.isEmpty()) {\n for (Piranha piranha : toRemove) {\n piranhas.remove(piranha);\n }\n }\n toRemove.clear();\n }", "@Test\n public void cancelEventsBySizeNonzero(){\n List<String> s1=new ArrayList<>();\n s1.add(\"sSeyon\");\n List<String> a1=new ArrayList<>();\n a1.add(\"aHelen\");\n List<String> s2=new ArrayList<>();\n s2.add(\"sSeyon\");\n s2.add(\"sHelen\");\n List<String> a2=new ArrayList<>();\n a2.add(\"aHelen\");\n a2.add(\"aLeo\");\n List<String> s3=new ArrayList<>();\n List<String> a3=new ArrayList<>();\n\n\n es.addEvent(EventType.SINGLE_SPEAKER_EVENT, 3, \"CSC207\",t1,t2,\"HL205\",\n s1,a1);\n es.addEvent(EventType.MULTI_SPEAKER_EVENT,5,\"MAT224\",t3,t4,\"Bahen\",\n s2,a2);\n es.addEvent(EventType.NO_SPEAKER_EVENT,6,\"Party\",t5,t6,\"Party Room\",\n s3,a3);\n\n //cancels the 2-speakers event\n assertTrue(es.cancelEventsBySize(2, true));\n assertEquals(2,es.getListEvents().size());\n HashMap<String,String> expected1 = toMap(EventType.SINGLE_SPEAKER_EVENT, 3, \"CSC207\",t1,t2,\"HL205\",\n s1,a1);\n HashMap<String,String> actual1 = listToMap(es.getListEvents().get(0));\n assertEquals(expected1,actual1);\n HashMap<String,String> expected2 = toMap(EventType.NO_SPEAKER_EVENT,6,\"Party\",t5,t6,\"Party Room\",\n s3,a3);\n HashMap<String,String> actual2 = listToMap(es.getListEvents().get(1));\n assertEquals(expected2,actual2);\n\n // this leaves only the non_speaker event left\n assertTrue(es.cancelEventsBySize(1, true));\n assertEquals(1,es.getListEvents().size());\n HashMap<String,String> expected3 = toMap(EventType.NO_SPEAKER_EVENT,6,\"Party\",t5,t6,\"Party Room\",\n s3,a3);\n HashMap<String,String> actual3 = listToMap(es.getListEvents().get(0));\n assertEquals(expected3,actual3);\n }", "protected void clearOutEvents() {\n\t}", "protected void clearOutEvents() {\n\t}", "void cleanUpEventsAndPlaces();", "public synchronized void removeAll() {\r\n\t\tif (trackedResources == null)\r\n\t\t\treturn;\r\n\t\tPair<IPath, IResourceChangeHandler>[] entries = (Pair<IPath, IResourceChangeHandler>[]) trackedResources.toArray(new Pair[trackedResources.size()]);\r\n\t\tfor (Pair<IPath, IResourceChangeHandler> entry : entries) {\r\n\t\t\tremoveResource(entry.first, entry.second);\r\n\t\t}\r\n\t}", "int removeHabitEvent(HabitEvent habitEvent);", "private void removeAllActiveXListeners()\n throws ActiveXException\n {\n Hashtable interfaces;\n Enumeration e;\n Guid iid;\n \n e = listeners.keys();\n\n while(e.hasMoreElements())\n {\n iid = (Guid) e.nextElement();\n removeActiveXListener1(clientSite, iid); \n }\n }", "private void removeTimeListeners()\n {\n myProcessorBuilder.getTimeManager().removeActiveTimeSpanChangeListener(myActiveTimeSpanChangeListener);\n myProcessorBuilder.getAnimationManager().removeAnimationChangeListener(myAnimationListener);\n myTimeAgnostic = true;\n }", "public void clearAutoEvent()\n {\n _autoEventList.clear();\n }", "protected void unregisterContractEvents()\n {\n for(final Subscription subscription : subscriptions)\n {\n Async.run(new Callable<Void>() {\n @Override\n public Void call() throws Exception {\n subscription.unsubscribe();\n return null;\n }\n });\n }\n\n subscriptions.clear();\n }", "private static synchronized Set<OWLParserFactory> removeOBOParserFactories(OWLOntologyManager m) {\n\t\tPriorityCollection<OWLParserFactory> factories = m.getOntologyParsers();\n\t\tSet<OWLParserFactory> copied = new HashSet<>();\n\t\tfor (OWLParserFactory factory : factories) {\n\t\t\tcopied.add(factory);\n\t\t}\n\t\tfor (OWLParserFactory factory : copied) {\n\t\t\tClass<?> cls = factory.getClass();\n\t\t\tboolean remove = false;\n\t\t\tif (OBOFormatOWLAPIParserFactory.class.equals(cls)) {\n\t\t\t\tremove = true;\n\t\t\t}\n\t\t\tif (remove) {\n\t\t\t\tfactories.remove(factory);\n\t\t\t}\n\t\t}\n\t\treturn copied;\n\t}", "public Builder clearSpeechEventType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n speechEventType_ = 0;\n onChanged();\n return this;\n }", "public void removeAllcast() {\n\t\tif(this.cast != null)\n\t\t\tthis.cast.clear();\n\t}", "public void reset() {\n events.clear();\n }", "private HashSet<String> getEventTypes(HLPetriNet hlPN) {\n\t\tHashSet<String> returnEvtTypes = new HashSet<String>();\n\t\tIterator<Transition> transitionsIt = hlPN.getPNModel().getTransitions()\n\t\t\t\t.iterator();\n\t\twhile (transitionsIt.hasNext()) {\n\t\t\tTransition transition = transitionsIt.next();\n\t\t\tif (transition.getLogEvent() != null) {\n\t\t\t\treturnEvtTypes.add(transition.getLogEvent().getEventType());\n\t\t\t}\n\t\t}\n\t\treturn returnEvtTypes;\n\t}", "void clearTypedFeatures();", "void unsetListOfServiceElements();", "void unregisterAll();", "@Override\n\tpublic void deleteAll() {\n\t\tmDB.execSQL(\"DROP TABLE EVENT\");\n\t}", "public void removeMultiTouchListeners() {\r\n\t\tlisteners.clear();\r\n\t}", "public void removeAlarms (){\n AlarmManager alarmManager = (AlarmManager) getContext().getSystemService(Context.ALARM_SERVICE);\n for (int i = 0; i < dogMetaDataArrayList.size(); i++){\n Intent recreateIntent = new Intent(getContext(), OneTimeReciveNotification.class);\n PendingIntent pendingIntent = PendingIntent.getBroadcast(getContext(), i, recreateIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n pendingIntent.cancel();\n alarmManager.cancel(pendingIntent);\n }\n }", "protected synchronized void discardKeyEvents(Component paramComponent)\n/* */ {\n/* 1303 */ if (paramComponent == null) {\n/* 1304 */ return;\n/* */ }\n/* */ \n/* 1307 */ long l = -1L;\n/* */ \n/* 1309 */ for (Iterator localIterator = this.typeAheadMarkers.iterator(); localIterator.hasNext();) {\n/* 1310 */ TypeAheadMarker localTypeAheadMarker = (TypeAheadMarker)localIterator.next();\n/* 1311 */ Object localObject = localTypeAheadMarker.untilFocused;\n/* 1312 */ int i = localObject == paramComponent ? 1 : 0;\n/* 1313 */ while ((i == 0) && (localObject != null) && (!(localObject instanceof Window))) {\n/* 1314 */ localObject = ((Component)localObject).getParent();\n/* 1315 */ i = localObject == paramComponent ? 1 : 0;\n/* */ }\n/* 1317 */ if (i != 0) {\n/* 1318 */ if (l < 0L) {\n/* 1319 */ l = localTypeAheadMarker.after;\n/* */ }\n/* 1321 */ localIterator.remove();\n/* 1322 */ } else if (l >= 0L) {\n/* 1323 */ purgeStampedEvents(l, localTypeAheadMarker.after);\n/* 1324 */ l = -1L;\n/* */ }\n/* */ }\n/* */ \n/* 1328 */ purgeStampedEvents(l, -1L);\n/* */ }", "private void removeListeners() {\n \t\tlistenToTextChanges(false);\n \t\tfHistory.removeOperationHistoryListener(fHistoryListener);\n \t\tfHistoryListener= null;\n \t}", "public static List<String> noX(List<String> list) {\n\t\treturn list.stream().map(s -> s.replace(\"x\", \"\"))\n\t\t\t\t\t\t\t.collect(Collectors.toList());\n\t}", "public synchronized <T extends EventListener> void remove(Class<T> t, T l) {\n \tif (l == null || !t.isInstance(l)) return;\n \t\n \twhile (listeners.remove(l)) {};\n }", "protected void clearEvents() {\n\t\tsCInterface.clearEvents();\n\n\t}", "public static void killAll() {\n\t\t// get an iterator\n\t\tIterator<?> i = anisLookup.entrySet().iterator();\n\t\twhile (i.hasNext()) {\n\t\t\tMap.Entry<?, ?> entry = (Map.Entry<?, ?>)i.next();\n\t\t\tAni existingAni = (Ani) entry.getValue(); \n\t\t\texistingAni.pause();\n\t\t\tpapplet().unregisterMethod(\"pre\", existingAni);\n\t\t\texistingAni = null;\n\t\t\ti.remove();\n\t\t}\t\n\t}", "public interface NoEventType {\n\n}", "private void removeActionListeners() {\n for (Integer key: app.getWorkSpace().getWorkSpaceMap().keySet()) {\n removeActionListener(app.getWorkSpace().getGridCell(key));\n }\n }", "@Override\n\tpublic void removeTrigger() {\n\t\tplayer.removeListener(this.listener, EventNameType.SOUL_FIGHT);\n\t}", "public void removeAllFightsystems()\r\n {\n\r\n }", "private void copyComponentEvents(String aEvType, List aList, ProcessTrace aPTr)\n throws IOException {\n String typeS;\n\n for (int i = 0; i < aList.size(); i++) {\n ProcessTraceEvent prEvent = (ProcessTraceEvent) aList.get(i);\n typeS = prEvent.getType();\n if (aEvType != null && aEvType.equals(typeS)) {\n aPTr.addEvent(prEvent);\n }\n }\n }", "public void removeInputType(IInputType type);", "int unregisterAlarmDef(VCenterInfo vCenterInfo, List<String> morList);", "public void purgeTimeouts() {\n\t\ttimeoutSet = new LinkedList<Event>();\n\t}", "public static void removePlurals(ArrayList<String> list){\r\n //Loop through the list\r\n for(i = 0; i < list.size(); i++){\r\n if(list.get(i).endsWith(\"s\") || list.get(i).endsWith(\"S\")){\r\n list.remove(i);\r\n i--;\r\n } \r\n }\r\n }", "public void removeONDEXListener(ONDEXListener l) {\n listeners.remove(l);\n }", "void unsetAppointmentsToIgnore();", "public void removeAllListeners() {\n die();\n }", "public void suppressionRdV_all() {\n //on vide l'agenda de ses elements\n for (RdV elem_agenda : this.agd) {\n this.getAgenda().remove(elem_agenda);\n }\n //on reinitialise a null l'objet agenda\n //this.agd = null;\n }", "private void m91744a(List<AwemeLabelModel> list) {\n if (!C6307b.m19566a((Collection<T>) list)) {\n for (int i = 0; i < list.size(); i++) {\n AwemeLabelModel awemeLabelModel = (AwemeLabelModel) list.get(i);\n if (awemeLabelModel != null && awemeLabelModel.getLabelType() == 1 && !C28482e.m93606a(this.f73950g) && this.f73950g.getStatus() != null && this.f73950g.getStatus().getPrivateStatus() == 1) {\n list.remove(awemeLabelModel);\n }\n }\n }\n }", "public void removeFromInventoryDHandles (String inputType, String inputColor, String inputStandard){\n }", "public void removeAllAmplitudeListeners()\r\n {\r\n amplitudeListeners.clear();\r\n }", "public void removeTriggersForKeys(Collection<String> collection) {\n }", "@Override\n public String getEventType()\n {\n\t return null;\n }", "public void removeEvents() throws SQLException{\n\t\tSQLiteDatabase db = tableHelper.getWritableDatabase(); \n\t\ttry {\n\t\t\tdb.delete(SQLTablesHelper.MY_EVENT_TABLE_NAME, null, null);\n\t\t} finally {\n\t\t\tdb.close();\n\t\t}\n\t}", "public void removeFromEvents(final SessionContext ctx, final SapEvent value)\n\t{\n\t\tEVENTSHANDLER.removeValue( ctx, this, value );\n\t}", "@Override\n\tpublic void removeAll() throws SystemException {\n\t\tfor (TvShow tvShow : findAll()) {\n\t\t\tremove(tvShow);\n\t\t}\n\t}", "void removeOldNotification();", "protected void RemoveEvents()\r\n {\r\n INotifyPropertyChanged propParent = (INotifyPropertyChanged)getProxyParent();\r\n propParent.getPropertyChanged().removeObservers(filterPropertyChanges);\r\n }", "void removeScope() throws EmptySymTableException {\n\n\t\t// if Symtable's list empty, throw empty\n\t\tif (list.isEmpty()) {\n\t\t\tthrow new EmptySymTableException();\n\t\t} else { // else remove HashMap from front of list\n\t\t\tlist.removeFirst();\n\t\t}\n\t}", "private List grepTopLevelEvents(Collection events) throws Exception {\n\t // Grep all events that are contained by other events\n\t Set containedEvents = new HashSet();\n\t GKInstance event = null;\n\t for (Iterator it = events.iterator(); it.hasNext();) {\n\t event = (GKInstance) it.next();\n\t if (event.getSchemClass().isValidAttribute(ReactomeJavaConstants.hasEvent)) {\n\t List components = event.getAttributeValuesList(ReactomeJavaConstants.hasEvent);\n\t if (components != null && components.size() > 0) { \n\t for (Iterator it1 = components.iterator(); it1.hasNext();) {\n\t GKInstance tmp = (GKInstance) it1.next();\n\t Boolean dnr = (Boolean) tmp.getAttributeValue(DO_NOT_RELEASE);\n\t if (dnr != null && !dnr.booleanValue())\n\t containedEvents.add(tmp);\n\t }\n\t }\n\t }\n\t }\n\t List topEvents = new ArrayList(events);\n\t topEvents.removeAll(containedEvents);\n\t return topEvents;\n\t}", "public static void delete() {\n\t\tSystem.out.println(\"Do you want to delete events on a [S]elected date or [A]ll events?\");\n\t\tScanner sc = new Scanner(System.in);\n\t\tString input = \"\";\n\t\tif (sc.hasNextLine()) {\n\t\t\tinput = sc.nextLine().toLowerCase();\n\t\t\tif (input.equals(\"s\")) {\n\t\t\t\tSystem.out.println(\"s\");\n\t\t\t\tSystem.out.println(\"What day do you want to delete the events on? In MM/DD/YYYY\");\n\t\t\t\tString date = sc.nextLine();\n\t\t\t\tint month = Integer.parseInt(date.substring(0, 2));\n\t\t\t\tint day = Integer.parseInt(date.substring(3, 5));\n\t\t\t\tint year = Integer.parseInt(date.substring(6, 10));\n\t\t\t\tGregorianCalendar toDelete = new GregorianCalendar(year, month, day);\n\t\t\t\tcalendarToEvent.remove(toDelete);\n\t\t\t\tquit(); //to save the new treemap to the events.txt\n\t\t\t\tSystem.out.println(\"Removed\");\n\t\t\t} else if (input.equals(\"a\")) {\n\t\t\t\tSystem.out.println(\"a\");\n\t\t\t\tSystem.out.println(\"Deleting all events\");\n\t\t\t\tcalendarToEvent = new TreeMap<Calendar, TreeSet<Event>>();\n\t\t\t}\n\t\t}\n\t}", "public abstract void unregisterListeners();", "public void removeAllElementInsertionMaps()\n {\n list.removeAllElements();\n }", "public void removeType(String name) {\n String nameInLowerCase = Ascii.toLowerCase(name);\n Preconditions.checkState(!registered);\n Preconditions.checkArgument(types.containsKey(nameInLowerCase), \"missing key: %s\", name);\n types.remove(nameInLowerCase);\n }", "protected static void removeSymbols(SymbolTable table, Declaration decl) {\n Map<IDExpression, Declaration> symbol_table = getTable(table);\n List<IDExpression> names = decl.getDeclaredIDs();\n for (int i = 0; i < names.size(); i++) {\n IDExpression id = names.get(i);\n if (symbol_table.remove(id) == null) {\n PrintTools.printlnStatus(0,\n \"[WARNING] Attempt to remove a non-existing symbol\",\n \"\\\"\", id, \"\\\"\", \"in\", table.getClass());\n }\n }\n }", "public void stopSounds() {\n\t\tCollection<SoundInfo> sounds = soundList.values();\n for(SoundInfo sound: sounds){\n \tif (sound.isStoppable())\n \t\tsound.stop();\n }\n\t}", "private void removeExemplar(Exemplar ex){\n\n /* remove from the general list */\n if(m_Exemplars == ex){\n m_Exemplars = ex.next;\n if(m_Exemplars != null)\n\tm_Exemplars.previous = null;\n\t\n } else {\n ex.previous.next = ex.next;\n if(ex.next != null){\n\tex.next.previous = ex.previous;\n }\n }\n ex.next = ex.previous = null;\n\n /* remove from the class list */\n if(m_ExemplarsByClass[(int) ex.classValue()] == ex){\n m_ExemplarsByClass[(int) ex.classValue()] = ex.nextWithClass;\n if(m_ExemplarsByClass[(int) ex.classValue()] != null)\n\tm_ExemplarsByClass[(int) ex.classValue()].previousWithClass = null;\n\t\n } else {\n ex.previousWithClass.nextWithClass = ex.nextWithClass;\n if(ex.nextWithClass != null){\n\tex.nextWithClass.previousWithClass = ex.previousWithClass;\n }\n }\n ex.nextWithClass = ex.previousWithClass = null;\n }", "private void restoreTransientEventSets()\n throws ActiveXException\n {\n Hashtable interfaces;\n Enumeration e, e2;\n PersistentEventLink p;\n ActiveXEventSetDescriptor eventSet;\n ActiveXEventListener l;\n\n e = listeners.elements();\n\n while(e.hasMoreElements())\n {\n interfaces = (Hashtable) e.nextElement();\n\n e2 = interfaces.keys();\n\n while(e2.hasMoreElements())\n {\n l = (ActiveXEventListener) e2.nextElement();\n\n p = (PersistentEventLink) interfaces.get(l);\n \n p.restoreActiveXEventSetDescriptor();\n\n }\n } \n }", "private List<BeaconConcept> filterSemanticGroup(List<BeaconConcept> concepts, List<String> types) {\n\t\t\n\t\tif (types.isEmpty()) return concepts;\n\t\t\n\t\tPredicate<BeaconConcept> hasType = n -> !Collections.disjoint(types, n.getCategories());\n\t\tconcepts = Util.filter(hasType, concepts);\n\t\t\n\t\treturn concepts;\n\t}", "public void unregisterListeners(){\n listeners.clear();\n }" ]
[ "0.62496066", "0.61110765", "0.5973948", "0.584533", "0.559651", "0.55690175", "0.5568766", "0.5551485", "0.5541244", "0.545574", "0.5433662", "0.5427607", "0.5404674", "0.5395377", "0.5385274", "0.5372184", "0.53649515", "0.5361955", "0.5355863", "0.53547347", "0.5315206", "0.52957565", "0.52942806", "0.5278096", "0.5236007", "0.52278644", "0.51970845", "0.51852405", "0.51811105", "0.51797915", "0.51792794", "0.51543075", "0.5146893", "0.514181", "0.5138507", "0.5133834", "0.51325756", "0.5127447", "0.5115195", "0.5113603", "0.5113603", "0.51098204", "0.50931245", "0.5092511", "0.5089689", "0.5087085", "0.5077047", "0.5073098", "0.5054499", "0.50455743", "0.50387096", "0.5037865", "0.5031711", "0.50205284", "0.50197685", "0.5013775", "0.5012729", "0.5001563", "0.49991572", "0.49936157", "0.49914208", "0.49904865", "0.49829647", "0.49823415", "0.49783638", "0.49758992", "0.49695495", "0.4967376", "0.49589166", "0.49589005", "0.49588227", "0.4951139", "0.49376255", "0.49373224", "0.493413", "0.49145162", "0.49045074", "0.4899365", "0.48988807", "0.48967198", "0.4893982", "0.4882124", "0.4877661", "0.48747885", "0.48701465", "0.48698422", "0.48635027", "0.48591948", "0.48506862", "0.48460272", "0.4843159", "0.4831074", "0.48262984", "0.48235998", "0.482233", "0.4820756", "0.48196965", "0.481297", "0.48110622", "0.48081443" ]
0.7949662
0
check whether all alleles of a vc, including the ref but excluding the NON_REF allele, are one base in length
protected static GenotypeLikelihoodsCalculationModel getGLModel(final VariantContext vc) { final boolean isSNP = vc.getAlleles().stream().filter(a -> !a.isSymbolic()).allMatch(a -> a.length() == 1); return isSNP ? GenotypeLikelihoodsCalculationModel.SNP : GenotypeLikelihoodsCalculationModel.INDEL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Requires(\"c != null\")\n private boolean pathIsTooDivergentFromReference( final Cigar c ) {\n for( final CigarElement ce : c.getCigarElements() ) {\n if( ce.getOperator().equals(CigarOperator.N) ) {\n return true;\n }\n }\n return false;\n }", "private static boolean pathIsTooDivergentFromReference(final Cigar c) {\n return c.getCigarElements().stream().anyMatch(ce -> ce.getOperator() == CigarOperator.N);\n }", "boolean detectCycledirected(ArrayList<Integer> G[]) {\n\t\tint[] vis = new int[G.length];\n\t\tint[] ancestor = new int[G.length];\n\t\tfor (int i = 0; i < G.length; i++) {\n\t\t\tif (vis[i] == 0) {\n\t\t\t\tif (detectCycleUtil(G, i, vis, ancestor))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public int variantBases() {\n int ret = referenceAlleleLength;\n for (Alt alt : alts) {\n if (referenceAlleleLength != alt.length()) {\n ret += alt.length();\n }\n }\n return ret;\n }", "@Test\n public void testInbreedingCoeffForMultiallelicVC() {\n VariantContext test1 = makeVC(\"1\",Arrays.asList(Aref,T,C),\n makeG(\"s1\", Aref, T, 2530, 0, 7099, 366, 3056, 14931),\n makeG(\"s2\", T, T, 7099, 2530, 0, 7099, 366, 3056),\n makeG(\"s3\", T, C, 7099, 2530, 7099, 3056, 0, 14931),\n makeG(\"s4\", Aref, T, 2530, 0, 7099, 366, 3056, 14931),\n makeG(\"s5\", T, T, 7099, 2530, 0, 7099, 366, 3056),\n makeG(\"s6\", Aref, T, 2530, 0, 7099, 366, 3056, 14931),\n makeG(\"s7\", T, T, 7099, 2530, 0, 7099, 366, 3056),\n makeG(\"s8\", Aref, T, 2530, 0, 7099, 366, 3056, 14931),\n makeG(\"s9\", T, T, 7099, 2530, 0, 7099, 366, 3056),\n makeG(\"s10\", Aref, T, 2530, 0, 7099, 366, 3056, 14931));\n\n final AS_InbreedingCoeff testClass1 = new AS_InbreedingCoeff();\n final double ICresult1 = testClass1.calculateIC(test1, T);\n Assert.assertEquals(ICresult1, -0.4285714, DELTA_PRECISION, \"Pass\");\n final double ICresult1b = testClass1.calculateIC(test1, C);\n Assert.assertEquals(ICresult1b, -0.05263, DELTA_PRECISION, \"Pass\");\n\n //make sure that hets with different alternate alleles all get counted\n VariantContext test2 = makeVC(\"2\", Arrays.asList(Aref,T,C),\n makeG(\"s1\", Aref, C, 4878, 1623, 11297, 0, 7970, 8847),\n makeG(\"s2\", Aref, T, 2530, 0, 7099, 366, 3056, 14931),\n makeG(\"s3\", Aref, T, 3382, 0, 6364, 1817, 5867, 12246),\n makeG(\"s4\", Aref, T, 2488, 0, 9110, 3131, 9374, 12505),\n makeG(\"s5\", Aref, C, 4530, 2006, 18875, 0, 6847, 23949),\n makeG(\"s6\", Aref, T, 5325, 0, 18692, 389, 16014, 24570),\n makeG(\"s7\", Aref, T, 2936, 0, 29743, 499, 21979, 38630),\n makeG(\"s8\", Aref, T, 6902, 0, 8976, 45, 5844, 9061),\n makeG(\"s9\", Aref, T, 5732, 0, 10876, 6394, 11408, 17802),\n makeG(\"s10\", Aref, T, 2780, 0, 25045, 824, 23330, 30939));\n\n final AS_InbreedingCoeff testClass2 = new AS_InbreedingCoeff();\n final double ICresult2 = testClass2.calculateIC(test2, T);\n Assert.assertEquals(ICresult2, -0.666666, DELTA_PRECISION, \"Pass\");\n final double ICresult2b = testClass2.calculateIC(test2, C);\n Assert.assertEquals(ICresult2b, -0.111129, DELTA_PRECISION, \"Pass\");\n }", "public boolean validate() {\n double ab = lengthSide(a, b);\n double ac = lengthSide(a, c);\n double bc = lengthSide(b, c);\n\n return ((ab < ac + bc)\n && (ac < ab + bc)\n && (bc < ab + ac));\n }", "boolean hasBasis();", "public static boolean vcheck() {\n for (int i = 0; i < card.length; i++) { // rows\n int sum = 0;\n for (int j = 0; j < card.length; j++) { // what coloum\n sum = sum + card[i][j]; // last sum plus the number in the cordinate\n }\n if (sum == 0) {\n System.out.println(\"BINGO\");\n System.out.println(\"The numbers called is \" + called);\n return true;\n\n }\n\n }\n return false;\n\n }", "private boolean calculateMaximumLengthBitonicSubarray() {\n\n boolean found = false; // does any BSA found\n\n boolean directionChange = false; //does direction numberOfWays increase to decrease\n\n int countOfChange = 0;\n\n int i = 0;\n directionChange = false;\n int start = i;\n i++;\n for (; i < input.length; i++) {\n if (countOfChange != 0 && countOfChange % 2 == 0) {\n if (this.length < (i - 2 - start + 1)) {\n this.i = start;\n this.j = i - 2;\n this.length = this.j - this.i + 1;\n }\n start = i - 2;\n countOfChange = 0;\n }\n\n if (input[i] > input[i - 1]) {\n if (directionChange == true) {\n countOfChange++;\n }\n directionChange = false;\n }\n if (input[i] < input[i - 1]) {\n if (directionChange == false) {\n countOfChange++;\n }\n directionChange = true;\n }\n\n\n }\n\n if (directionChange == true) {\n if (this.length < (i - 1 - start + 1)) {\n this.i = start;\n this.j = i - 1;\n this.length = this.j - this.i + 1;\n }\n }\n return directionChange;\n }", "public final boolean isReferencedAtMostOnce() {\n return this.getReferences(false, true).size() == 0 && this.getReferences(true, false).size() <= 1;\r\n }", "boolean hasAuvLoc();", "private int checkCaja(int box, Gene[] gene) {\n\n int l = (box % n) * n,\n k = (box / n) * n;\n list.clear();\n //TODO: DARLE DBG A ESTO\n// dbg(\"l,k\",l,k);\n int v;\n for (int i = l; i < l + n - 1; i++) {\n for (int j = k; j < k + n - 1; j++) {\n v = (Integer) gene[c.campo(i, j)].getAllele();\n list.set(v - 1);\n }\n }\n int zeros = 0; // Numbers not checked off\n for (int i = 0; i < nn; i++) {\n if (!list.get(i)) {\n zeros++;\n }\n }\n return zeros;\n }", "private boolean isTreeFull() {\n // The number of leaf nodes required to store the whole vector\n // (each leaf node stores 32 elements).\n int requiredLeafNodes = (totalSize >>> 5);\n\n // The maximum number of leaf nodes we can have in a tree of this\n // depth (each interior node stores 32 children).\n int maxLeafNodes = (1 << treeDepth);\n\n return (requiredLeafNodes > maxLeafNodes);\n }", "public boolean checkInvariants() {\n\t\tRunningLengthWord rlw, prev;\n\n\t\ttry {\n\t\t\tEWAHIterator i =\n\t\t\t\t\tnew EWAHIterator(this.buffer, this.actualsizeinwords);\n\t\t\t// test that actualsizeinwords complies with info in headers and\n\t\t\t// test that literal number is not > max\n\t\t\twhile (i.hasNext()) {\n\t\t\t\tRunningLengthWord w = i.next();\n\t\t\t\tif (i.dirtyWords() > actualsizeinwords) {\n\t\t\t\t\tlog.error(i.dirtyWords() + \" larger than actual \"\n\t\t\t\t\t\t\t+ actualsizeinwords);\n\t\t\t\t\tlog.error(toDebugString());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (i.pointer > actualsizeinwords) {\n\t\t\t\t\tlog.error(\"pointer \" + i.pointer + \" larger than actual \"\n\t\t\t\t\t\t\t+ actualsizeinwords);\n\t\t\t\t\tlog.error(toDebugString());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (w.getNumberOfLiteralWords() > RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\tlog.error(\"larger than max literals\"\n\t\t\t\t\t\t\t+ w.getNumberOfLiteralWords());\n\t\t\t\t\tlog.error(toDebugString());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (w.getRunningLength() > RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\tlog.error(\"larger than max running length \"\n\t\t\t\t\t\t\t+ w.getRunningLength());\n\t\t\t\t\tlog.error(toDebugString());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// check adjacent words for errors\n\t\t\trlw = new RunningLengthWord(buffer, 0);\n\t\t\tprev = rlw;\n\t\t\trlw = rlw.getNext();\n\n\t\t\twhile (rlw.position < actualsizeinwords\n\t\t\t\t\t&& rlw.position + rlw.getNumberOfLiteralWords() < actualsizeinwords) {\n\t\t\t\t// case 1) second word has no running length -> first one should\n\t\t\t\t// have max literal count\n\t\t\t\tif (rlw.getRunningLength() == 0\n\t\t\t\t\t\t&& prev.getNumberOfLiteralWords() < RunningLengthWord.largestliteralcount) {\n\t\t\t\t\tlog.error(prev.getNumberOfLiteralWords()\n\t\t\t\t\t\t\t+ \" dirty words followed by \"\n\t\t\t\t\t\t\t+ rlw.getNumberOfLiteralWords()\n\t\t\t\t\t\t\t+ \" number of dirty words \" + \"\\n\\n\"\n\t\t\t\t\t\t\t+ toDebugString());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// case 2) both have running length for same bit and first one\n\t\t\t\t// has\n\t\t\t\t// no literals -> first one should have max running length\n\t\t\t\tif (prev.getRunningLength() > 0\n\t\t\t\t\t\t&& rlw.getRunningLength() > 0\n\t\t\t\t\t\t&& prev.getNumberOfLiteralWords() == 0\n\t\t\t\t\t\t&& prev.getRunningBit() == rlw.getRunningBit()\n\t\t\t\t\t\t&& prev.getRunningLength() < RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\tlog.error(\"Two running length for same bit of length \"\n\t\t\t\t\t\t\t+ prev.getRunningLength() + \" and \"\n\t\t\t\t\t\t\t+ rlw.getRunningLength() + \"\\n\\n\" + toDebugString());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tprev = rlw;\n\t\t\t\trlw = rlw.getNext();\n\t\t\t}\n\n\t\t\tif (!prev.equals(this.rlw)) {\n\t\t\t\tlog.error(\"Last word should have been \" + prev.toString()\n\t\t\t\t\t\t+ \" but was \" + this.rlw.toString());\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// the largest bit set == sizeinbits\n\t\t\tIntIterator it = intIterator();\n\t\t\tint greatest = -1;\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tgreatest = it.next();\n\t\t\t}\n\t\t\tif (this.sizeinbits != greatest + 1) {\n\t\t\t\tlog.error(\"sizein bits \" + sizeinbits\n\t\t\t\t\t\t+ \" but largest value is \" + greatest + \"\\n\\n\"\n\t\t\t\t\t\t+ toDebugString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tLoggerUtil.logException(e, log);\n\t\t\tlog.error(bufferToString());\n\t\t}\n\n\t\treturn true;\n\t}", "protected final boolean checkMaxDistances(\n\t\t\tfinal OpenLREncoderProperties properties,\n\t\t\tfinal LocRefData locRefData) throws OpenLRProcessingException {\n\t\t/*\n\t\t * check for the maximum distance between two successive LRP \n\t\t */\n\t\tif (LOG.isDebugEnabled()) {\n\t\t\tLOG.debug(\"check location reference (maximum distance check)\");\n\t\t}\n\t\tfinal List<LocRefPoint> locRefPoints = locRefData.getLocRefPoints();\n\t\tint maxDistance = properties.getMaximumDistanceLRP();\n\t\t\n\t\tboolean dnpsAreVAlid = true;\n\t\tfor (LocRefPoint lrPoint : locRefPoints) {\n\t\t\t// check the distance limit\n\t\t\tif (!lrPoint.isLastLRP()\n\t\t\t\t\t&& lrPoint.getDistanceToNext() > maxDistance) {\n\t\t\t\t// limit is exceeded\n LOG.error(String\n .format(\"maximum distance between two LRP is exceeded (LRP #: %s, distance: %s)\",\n lrPoint.getSequenceNumber(),\n lrPoint.getDistanceToNext()));\n\t\t\t\tdnpsAreVAlid = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn dnpsAreVAlid;\n\t}", "static boolean hasMoreComposites(final int flags) {\n return (flags & MORE_COMPONENTS.bitMask) > 0;\n }", "private boolean checkFull() {\n\t\treturn this.array.length - 1 == this.lastNotNull();\n\t}", "boolean piecesContiguous(Piece side) {\n int k;\n int l;\n sideAbbrev = side.abbrev();\n for (int i = 0; i < M; i++) {\n for (int j = 0; j < M; j++) {\n _visited[i][j] = false;\n }\n }\n contSum = 0;\n for (k = 0; k < M; k++) {\n for (l = 0; l < M; l++) {\n if (boardArr[k][l].abbrev().equals(sideAbbrev)) {\n return dfs(k, l) == totalCount(side);\n }\n }\n }\n return false;\n }", "protected boolean checkAcyclicCase(DNode cutoff, DNode corr,\n\t\t\tDNode[] cutoff_cut, DNode[] corr_cut) {\n\n\t\treturn checkConcurrency(cutoff, corr, cutoff_cut, corr_cut)\n\t\t// && checkGateway(cutoff,corr)\n\t\t// <<< LUCIANO: It seems that the condition above is redundant and it\n\t\t// only serves as a hack to deal with acyclic xor rigids (cf. to\n\t\t// complete the occurrence net)\n\t\t;\n\t}", "public boolean canReproduce() {\r\n ArrayList<Cell> neighbours = getNeighbours(FIRSTLAYER);\r\n\r\n int numOfSameT = 0;\r\n int numOfEmpty = 0;\r\n int numOfFoodC = 0;\r\n\r\n for (Cell cell : neighbours) {\r\n if (isSameType(cell.getInhabit())) {\r\n numOfSameT++;\r\n } else if (cell.getInhabit() == null && isTerrainAccessiable(cell)) {\r\n numOfEmpty++;\r\n } else if (isEdible(cell.getInhabit())) {\r\n numOfFoodC++;\r\n }\r\n }\r\n\r\n return (numOfSameT >= numOfSameTypeNeighbourToReproduce() \r\n && numOfEmpty >= numOfEmptyToReproduce()\r\n && numOfFoodC >= numOfFoodCellToReproduce());\r\n }", "public boolean checkGradient() {\r\n boolean temp = true;\r\n for (int i = 0; i<clusters.length; i++) {\r\n for (int j = 0; j<clusters[i].length; j++) {\r\n try {\r\n if (this.data.getProbeColor(this.experiment.getGeneIndexMappedToData(clusters[i][j])) != null) {\r\n temp = false;\r\n }\r\n } catch (Exception e) {\r\n }\r\n }\r\n }\r\n return temp;\r\n }", "private int checkFila(int r, Gene[] gene) {\n // System.out.print(row + \":\");\n list.clear();\n \n// boolean[] l=new boolean[nn];\n int m = r * nn;\n int v;\n// for (int k = m; k < m + nn; k++) {\n// v = ((Integer) gene[k].getAllele()).intValue();\n// list.set(v - 1);//tengo v en la fila\n// }\n for (int j = 0; j < nn; j++) {\n v = (Integer) gene[c.campo(r, j)].getAllele();\n list.set(v - 1);//tengo v en la fila\n// l[v-1]=true;\n }\n int zeros = 0;//a quien no tengo\n for (int k = 0; k < nn; k++) {\n if (!list.get(k)) {\n zeros++;\n }\n }\n return zeros;\n }", "public boolean Llena(){\n return VectorPila.length-1==cima;\n }", "private boolean checkConvexity()\r\n \t{\r\n\t\tswap(0, findLowest());\r\n\t\tArrays.sort(v, new Comparator() {\r\n\t\t\tpublic int compare(Object a, Object b)\r\n\t\t\t{\r\n\t\t\t\tint as = area_sign(v[0], (Pointd)a, (Pointd)b);\r\n\t\t\t\tif ( as > 0)\t\t/* left turn */\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\telse if (as < 0)\t/* right turn */\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\telse \t\t\t\t\t/* collinear */\r\n\t\t\t\t{\r\n\t\t\t\t\tdouble x = Math.abs(((Pointd)a).getx() - v[0].getx()) - Math.abs(((Pointd)b).getx() - v[0].getx());\r\n\t\t\t\t\tdouble y = Math.abs(((Pointd)a).gety() - v[0].gety()) - Math.abs(((Pointd)b).gety() - v[0].gety());\r\n\t\t\t\t\tif ( (x < 0) || (y < 0) )\r\n\t\t\t\t\t\treturn -1;\r\n\t\t\t\t\telse if ( (x > 0) || (y > 0) )\r\n\t\t\t\t\t\treturn 1;\r\n\t\t\t\t\telse\t\t// points are coincident\r\n\t\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n \t\tfor (int i=0; i < nv; i++)\r\n \t\t{\r\n \t\t\ti2 = next(i, nv);\r\n \t\t\ti3 = next(i2, nv);\r\n \t\t\tif ( !lefton(\tv[i], v[i2], v[i3]) )\r\n \t\t\t\treturn false;\r\n \t\t}\r\n \t\treturn true;\r\n\t}", "private boolean correcto() {\r\n return (casillas.size()>numCasillaCarcel); //&&tieneJuez\r\n }", "private boolean checkIllegallIndexes(Set<Integer> mintermSet, Set<Integer> dontCareSet, int size) {\n\t\tSet<Integer> mintermAndDontCareUnion = new HashSet<>(mintermSet);\n\t\tmintermAndDontCareUnion.addAll(dontCareSet);\n\n\t\tdouble maxMinterm = Math.pow(2, size) - 1;\n\t\tfor (Integer integer : mintermAndDontCareUnion) {\n\t\t\tif (integer > maxMinterm) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public int getMinMatchLength() {\n int[] allele = {getAllele(0), getAllele(1)};\n byte[][] alt = {getAlt(allele[0]).getSequence(), getAlt(allele[1]).getSequence()};\n byte[] ref = getReference();\n\n int[] matchLength = {0, 0};\n for (int i = 0; i < 2; i++) {\n for (int j = 0; j < Math.min(ref.length, alt[i].length); j++) {\n if (alt[i][j] == ref[j]) {\n matchLength[i]++;\n } else {\n break;\n }\n }\n }\n return Math.min(matchLength[0], matchLength[1]);\n }", "private void checkRep() {\n for (Ball ball : balls) {\n assert ball.getPosition().d1 >= 0\n && ball.getPosition().d1 <= WIDTH - 1;\n assert ball.getPosition().d2 >= 0\n && ball.getPosition().d2 <= HEIGHT - 1;\n }\n for (Gadget gadget : gadgets) {\n assert gadget.getPosition().d1 >= 0\n && gadget.getPosition().d1 <= WIDTH - 1;\n assert gadget.getPosition().d2 >= 0\n && gadget.getPosition().d2 <= HEIGHT - 1;\n }\n\n assert GRAVITY > 0 && MU2 > 0 && MU > 0;\n }", "private static boolean needsConsolidation(final Cigar c) {\n if ( c.numCigarElements() <= 1 )\n return false; // fast path for empty or single cigar\n\n CigarOperator lastOp = null;\n for( final CigarElement cur : c.getCigarElements() ) {\n if ( cur.getLength() == 0 || lastOp == cur.getOperator() )\n return true;\n lastOp = cur.getOperator();\n }\n\n return false;\n }", "@Test\n public void length() {\n float result = 0.0f;\n float[] a = new float[] {1.001f, 2.002f, 2.0f, 3.0f, 4.0f, 6.0f}; \n float expect = 65.0f;\n // 1)\n result = Vec4f.length(a, 2);\n assertTrue(Math.abs(result*result-expect) < 1E-6f);\n \n //2)\n float[] a2 = new float[] {2.0f, 3.0f, 4.0f, 6.0f}; \n float result2 = Vec4f.length(a2);\n assertTrue(Math.abs(result2*result2-expect) < 1E-6f);\n }", "boolean isZeroReference() {\n return refCount == 0;\n }", "private boolean tryCounterExample(BDD reachableStates){\n\t\tBDD counterExample = reachableStates.andWith(buildEndGame());\n\t\t\n\t\treturn counterExample.satCount(this.dimension * this.dimension - 1) == 0 ? true : false;\n\t}", "public int getReferenceAlleleLength() {\n return referenceAlleleLength;\n }", "boolean detectCycleUndirected(ArrayList<Integer> G[]) {\n\t\tint[] vis = new int[G.length];\n\t\tfor (int i = 0; i < G.length; i++) {\n\t\t\tif (vis[i] == 0) {\n\t\t\t\tif (detectCycleUtil(G, i, vis, -1))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private boolean isValidAndNewReference(String ref) {\n Set<String> allRefs = getAllReferenceNames();\n if (allRefs.contains(ref)) {\n if (!ref.equals(currentReference)) {\n return true;\n }\n } else if (allRefs.contains(\"chr\" + ref)) {\n // Looks like a number. Let's try slapping on \"chr\" and see if it works.\n return isValidAndNewReference(\"chr\" + ref);\n } else {\n if (TrackController.getInstance().getTracks().size() > 0) {\n DialogUtils.displayMessage(String.format(\"<html>Reference <i>%s</i> not found in loaded tracks.</html>\", ref));\n }\n }\n return false;\n }", "public static boolean goodGC(String sequence) {\n\t\tdouble gcCount = 0;\n\t\tfor (int i = 0; i < sequence.length(); i++)\n\t\t\tif (sequence.charAt(i) == 'g' || sequence.charAt(i) == 'c') gcCount++;\n\t\treturn (gcCount / sequence.length()) >= MIN_GC_FRACTION && (gcCount / sequence.length()) <= MAX_GC_FRACTION;\n\t}", "public boolean diag1(){\n\tboolean trouve=false;\n\tint i=0;\n\tObject tmp='@';\n\twhile(i<5 && !trouve){\n\t\tif(gc[i][i]==tmp)\n\t\t\ttrouve=true;\n\t\telse\n\t\t\ti++;\n\t}\n\treturn trouve;\n}", "boolean hasAlreadFoldCard();", "public boolean percolates(){\n\t\tif(isPathological)\n\t\t\treturn isOpen(1,1);\n\t\t//System.out.println(\"Root top: \"+ quickUnion.find(N+2));\n\t\t\n\t\treturn (quickUnion.find(N*N+1) == quickUnion.find(0)); \t\n\t}", "final protected boolean isValid() {\n boolean valid = true;\n for (Hex h : hexagons)\n for (Vertex v : h.vertices)\n if (isAdjacent(v) && v.getBuilding() == null)\n valid = false;\n return valid;\n }", "boolean testDependence(DependenceVector dv);", "boolean hasAabbValue();", "public boolean checkIfFull() {\n this.isFull = true;\n for(int i=0; i<this.size; i++) {\n for(int j=0; j<this.size; j++) if(this.state[i][j].isEmpty) this.isFull = false;\n }\n }", "public boolean isFull() {\n for (int r = 0; r < 6; r++) {\n for (int c = 0; c < 7; c++) {\n if (!hasPiece(r, c)) {\n return false;\n }\n }\n }\n return true;\n }", "boolean hasHadithReferenceNo();", "static boolean GeneralComp(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"GeneralComp\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = EqualityComp(b, l + 1);\n if (!r) r = RelationalComp(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "private boolean checkCycle() {\n for (int i = 0; i < 26; i++) {\n color[i] = 0;\n }\n for (int i = 0; i < 26; i++) {\n if (color[i] != -1 && BFS(i)) return true;\n }\n return false;\n }", "private boolean colisionPalas() {\r\n\t\treturn game.racketIzq.getBounds().intersects(getBounds())\r\n\t\t\t\t|| game.racketDer.getBounds().intersects(getBounds());\r\n\t}", "boolean hasBasisValue();", "private boolean checkComp() {\n\t\tfor (int i = 0; i < comp.length; i++) {\n\t\t\tfor (int j = 0; j < comp[i].length; j++) {\n\t\t\t\tif (comp[i][j] != answer[i][j]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private boolean checkMainDiagonal() {\n int diagonalSum = 0;\n for (int i = 0; i < dimensions; i++) {\n diagonalSum += square[i + dimensions * i];\n }\n\n return diagonalSum == magicConst;\n }", "public Boolean isFull() {\n\t\tif (this.mVehicles.size() == this.mCapacity)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public boolean isAllCap() throws PDFNetException {\n/* 605 */ return IsAllCap(this.a);\n/* */ }", "public Boolean checkHercules() {\r\n \tBoolean flag = true;\r\n \tfor(int i = 0; i < 44; i++) {\r\n \t\tif(hercules[i] == 0) {\r\n \t\t\tflag = false;\r\n \t\t}\r\n \t}\r\n \treturn flag;\r\n }", "boolean testLength(Tester t) {\n return t.checkExpect(lob3.length(), 3) && t.checkExpect(los3.length(), 3)\n && t.checkExpect(los1.length(), 1) && t.checkExpect(new MtLoGamePiece().length(), 0);\n }", "public boolean hasReferences() {\n\t\treturn this.refCounter > 0;\n\t}", "public boolean canConstruct(String ransomNote, String magazine) {\n int[] count = new int[26];\n System.out.println(Arrays.toString(count));\n for (char ch : magazine.toCharArray()) {\n count[(int) ch - (int) 'a'] += 1;\n }\n System.out.println(Arrays.toString(count));\n for (char ch : ransomNote.toCharArray()) {\n count[(int) ch - (int) 'a'] -= 1;\n }\n System.out.println(Arrays.toString(count));\n for (int i : count) {\n if (i < 0)\n return false;\n }\n return true;\n }", "public boolean istrianglevalid() {\n //if all of the sides are valid, then return true, else return false\n if (sideA > 0 && sideB > 0 && sideC > 0) {\n return true;\n } else {\n return false;\n }\n }", "private static boolean isDistanceOK(double[] diff) {\n\t\tfor (double d : diff) {\n\t\t\tif (Math.abs(d) > MAX_PIXEL_DISTANCE) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean RepVec(String []a){\n boolean rep=false;\n String aux1=\"\",aux2=\"\";\n for (int i = 0; i < a.length; i++) {\n aux1=a[i];\n for (int j = 0; j < a.length; j++) {\n aux2=a[j];\n if( i!=j ){ \n if(aux1==aux2){\n rep=true;\n return rep;\n } \n } \n }\n }\n return rep;\n \n }", "boolean hasRef();", "public boolean percolates()\r\n { return uf.find(0) == uf.find(dimension*dimension + 1); }", "protected boolean checkGateway(DNode cutoff, DNode corr) {\n\t\tif (cutoff.post.length > 1 || cutoff.pre.length > 1\n\t\t\t\t|| corr.post.length > 1 || corr.pre.length > 1)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "public static boolean isATGCN(final Allele a) {\n\tif(a==null || a.isBreakpoint() || a.isNoCall() || a.isSymbolic() || a.isSingleBreakend() || a.length()==0) return false;\n\treturn isATGCN(a.getDisplayString());\n\t}", "public boolean isConsistent()\n\t{\n\t\tfinal List<AbsoluteFeatureElement> checkedAbsolutes = new ArrayList<AbsoluteFeatureElement>();\n\t\tfinal List<RelativeFeatureElement> checkedRelatives = new ArrayList<RelativeFeatureElement>();\n\t\t\n\t\tfor (final FeatureElement element : featureElements)\n\t\t{\n\t\t\tif (element instanceof AbsoluteFeatureElement)\n\t\t\t{\n\t\t\t\tfinal AbsoluteFeatureElement abs = (AbsoluteFeatureElement) element;\n\t\t\t\t\n\t\t\t\tfor (final AbsoluteFeatureElement other : checkedAbsolutes)\n\t\t\t\t{\n\t\t\t\t\tif (abs.position() == other.position())\t// same positions, so need compatible elements\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!(abs.equals(other) || abs.isCompatibleWith(other) || abs.generalises(other) || other.generalises(abs)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcheckedAbsolutes.add(abs);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfinal RelativeFeatureElement rel = (RelativeFeatureElement) element;\n\t\t\t\t\n\t\t\t\tfor (final RelativeFeatureElement other : checkedRelatives)\n\t\t\t\t{\n\t\t\t\t\tif (rel.walk().equals(other.walk()))\t// equal Walks, so need compatible elements\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!(rel.equals(other) || rel.isCompatibleWith(other) || rel.generalises(other) || other.generalises(rel)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcheckedRelatives.add(rel);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public boolean isFull() {\n return this.chromosomes.size() >= Defines.popSize;\n }", "public boolean IsCyclic() {\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> queue = new LinkedList<>();\r\n\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tif (processed.containsKey(vname)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tPair rootpair = new Pair(vname, vname);\r\n\t\t\tqueue.addLast(rootpair);\r\n\t\t\twhile (queue.size() != 0) {\r\n\t\t\t\t// 1. removeFirst\r\n\t\t\t\tPair rp = queue.removeFirst();\r\n\r\n\t\t\t\t// 2. check if processed, mark if not\r\n\t\t\t\tif (processed.containsKey(rp.vname)) {\r\n\t\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tprocessed.put(rp.vname, true);\r\n\r\n\t\t\t\t// 3. Check, if an edge is found\r\n\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\r\n\t\t\t\t// 4. Add the unprocessed nbrs back\r\n\t\t\t\tArrayList<String> nbrnames = new ArrayList<>(rp.vtx.nbrs.keySet());\r\n\t\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\t\tif (!processed.containsKey(nbrname)) {\r\n\t\t\t\t\t\tPair np = new Pair(nbrname, rp.psf + nbrname);\r\n\t\t\t\t\t\tqueue.addLast(np);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "public boolean checkInvalid4(String x) {\n int temp = x.length();\n for (int i = 0; i < x.length(); i++) {\n if (consonants.contains(String.valueOf(x.charAt(i))))\n temp--;\n }\n return temp > 3;\n }", "public static boolean checkGenome(int[] code) {\n boolean[] numbers = new boolean[8];\n for (int c : code) { numbers[c] = true; }\n for (boolean b : numbers) { if (!b) return false; }\n return true;\n }", "boolean checkForShortCircuit(CaveGen g) {\n int i = g.placedMapUnits.size() - 1;\n MapUnit m = g.placedMapUnits.get(i);\n if (i >= Parser.scUnitTypes.length) return false;\n if (Parser.scUnitTypes[i] != -1) {\n String targetName = g.spawnMapUnitsSorted.get(Parser.scUnitTypes[i]).name;\n if (!targetName.equals(m.name))\n return true;\n } \n if (Parser.scRots[i] != -1) {\n if (m.rotation != Parser.scRots[i])\n return true;\n } \n if (Parser.scUnitIdsFrom[i] != -1 \n && Parser.scDoorsFrom[i] != -1\n && Parser.scDoorsTo[i] != -1) {\n Door d = m.doors.get(Parser.scDoorsTo[i]);\n if (d.adjacentDoor == null || d.adjacentDoor.mapUnit == null)\n return true;\n MapUnit o = d.adjacentDoor.mapUnit;\n if (g.placedMapUnits.indexOf(o) != Parser.scUnitIdsFrom[i])\n return true;\n if (o.doors.indexOf(d.adjacentDoor) != Parser.scDoorsFrom[i])\n return true;\n }\n else {\n if (Parser.scDoorsTo[i] != -1) {\n Door d = m.doors.get(Parser.scDoorsTo[i]);\n if (d.adjacentDoor == null || d.adjacentDoor.mapUnit == null)\n return true;\n }\n if (Parser.scUnitIdsFrom[i] != -1 \n && Parser.scDoorsFrom[i] != -1) {\n boolean isGood = false;\n for (Door d: m.doors) {\n if (d.adjacentDoor == null || d.adjacentDoor.mapUnit == null)\n continue;\n MapUnit o = d.adjacentDoor.mapUnit;\n if (g.placedMapUnits.indexOf(o) != Parser.scUnitIdsFrom[i])\n continue;\n if (o.doors.indexOf(d.adjacentDoor) != Parser.scDoorsFrom[i])\n continue;\n isGood = true;\n }\n if (!isGood) return true;\n }\n else if (Parser.scUnitIdsFrom[i] != -1) {\n boolean isGood = false;\n for (Door d: m.doors) {\n if (d.adjacentDoor == null || d.adjacentDoor.mapUnit == null)\n continue;\n MapUnit o = d.adjacentDoor.mapUnit;\n if (g.placedMapUnits.indexOf(o) != Parser.scUnitIdsFrom[i])\n continue;\n isGood = true;\n }\n if (!isGood) return true;\n }\n }\n return false;\n }", "private boolean runMultiSampleCase() {\n\t\tArrayList<Candidate> candidates = collectTrioCandidates();\n\n\t\t// Then, check the candidates for all trios around affected individuals.\n\t\tfor (Candidate c : candidates)\n\t\t\tif (isCompatibleWithTriosAroundAffected(c))\n\t\t\t\treturn true;\n\t\treturn false;\n\t}", "@Test\n public void testConnectedComponents()\n {\n Collection<IIntArray> cc1 = MarkovModel.util.connectedComponents(P1);\n assertTrue(cc1.containsAll(C1));\n assertEquals(cc1.size(), C1.size());\n\n Collection<IIntArray> cc2 = MarkovModel.util.connectedComponents(P2);\n assertTrue(cc2.containsAll(C2));\n assertEquals(cc2.size(), C2.size());\n\n Collection<IIntArray> cc3 = MarkovModel.util.connectedComponents(P3);\n assertTrue(cc3.containsAll(C3));\n assertEquals(cc3.size(), C3.size()); \n }", "public boolean hasUncountable() {\n return ops.hasUncountable(mat);\n }", "public boolean isFull() {\r\n return solutions().size() == maxSize;\r\n }", "public boolean isInconsistentWith(BuildPtr that) {\n return signOfCompare(this.posByN,that.posByN) * signOfCompare(this.posByID,that.posByID) < 0;\n }", "public boolean diag2(){\n\tboolean trouve=false;\n\tint i=0;\n\tObject tmp='@';\n\twhile(i<5 && !trouve){\n\t\tif(gc[i][gc.length-i-1]==tmp)\n\t\t\ttrouve=true;\n\t\telse\n\t\t\ti++;\n\t}\n\treturn trouve;\n}", "public boolean isFull() {\r\n return placeCounter == dimension * dimension;\r\n }", "boolean hasGcj02();", "private void passValidation (VCFLine currentLine) {\n\t\tboolean hasPassed = false;\n\n\t\tif (!currentLine.isLastLine() && currentLine.isValid()) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The line has to be a valid line to be processed\n\t\t\tcurrentLine.processForAnalyse();\n\t\t\tint[] lengths = VCFLineUtility.getVariantLengths(currentLine.getREF(), Utils.split(currentLine.getALT(), ','), currentLine.getINFO());\t\t// Retrieves the length of all defined variations of the line\n\t\t\tVariantType[] variations = VCFLineUtility.getVariantTypes(lengths);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Converts the lengths into variation types (insertion, deletion...)\n\n\t\t\tallValidIndex = new ArrayList<Integer>();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Initializes the array that will contain all valid alternative indexes of the line\n\t\t\tallValidGenome = new ArrayList<String>();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Initializes the array that will contain all valid genome names of the line\n\n\t\t\tfor (int i = 0; i < genomeList.size(); i++) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Will scan information for all genomes of the line\n\t\t\t\tint[] altIndexes = getAlternativeIndexes(genomeList.get(i), reader, synchronizer);\t\t\t\t\t\t\t\t\t\t\t\t// Gets indexes defined by the GT type ('.' is converted as -1)\n\t\t\t\tList<Integer> validIndex = getValidIndexes(variationMap.get(genomeList.get(i)), variations, altIndexes);\t\t\t\t\t\t// Only keeps the valid ones (excludes the ones referring to the reference)\n\t\t\t\tif (validIndex.size() > 0) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// If we have found at least one valid index (one variant matching the variation requirements)\n\t\t\t\t\tif (isValid(currentLine)) {\n\t\t\t\t\t\tallValidGenome.add(genomeList.get(i));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// If the process comes here, it means information has been found for the current genome\n\t\t\t\t\t\tfor (int index: validIndex) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// For all found indexes\n\t\t\t\t\t\t\tif (!allValidIndex.contains(index)) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// If it does not have been stored yet\n\t\t\t\t\t\t\t\tallValidIndex.add(index);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// We store it\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (allValidGenome.size() > 0) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// If information has been found for at least one genome\n\t\t\t\thasPassed = true;\n\t\t\t}\n\t\t}\n\n\t\tcurrentLine.setHasData(hasPassed);\n\t}", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "boolean piecesContiguous(Side player) {\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n if (_pieces[i][j].side() == player) {\n boolean[][] traverse = new boolean[8][8];\n return getCount(player) == contiguousHelp(traverse, i,\n j, player);\n }\n }\n }\n\n }", "public boolean checkColoring(int[] ccolor){\n // \tfor(int i = 0; i < ccolor.length; i++){\n //\t System.out.println(Arrays.toString(ccolor));\n \t//}\n for(int i = 0; i < ccolor.length; i++){\n for(int w = 0; w < ccolor.length; w++){\n \t//System.out.println(i + \",\" + w);\n if(hasEdge(i,w) && (ccolor[i] == ccolor[w])){\n \t//System.out.println(i + \",false\" + w);\n return false;\n }\n }\n }\n return true;\n }", "public boolean isCyclic(int V, ArrayList<ArrayList<Integer>> adj)\n {\n // code here\n // System.out.println(V);\n // System.out.println(adj.toString());\n boolean visit[] = new boolean[V];\n boolean recstack[] = new boolean[V];\n for(int i = 0; i < V; i++){\n if(dfs(i, visit, recstack, adj)){\n return true;\n }\n }\n return false;\n }", "public boolean contient(Couple assoc) {\n for (int i = 0; i < nbAssoc; i++)\n if (associations[i].equals(assoc))\n return true;\n return false;\n }", "boolean complete() {\n\t\tint sizes = 1;\n\n\t\tfor (int i = 0; i <= matrix.length - 1; i++) {\n\t\t\tfor (int j = 4; j >= sizes; j--) {\n\t\t\t\tint cost = getCost(i,j);\n\t\t\t\tif (cost == 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsizes = sizes + 1;\n\t\t}\n\t\treturn true;\n\t}", "public boolean isCheckmate()\n {\n Game g = Game.getInstance();\n\n int sum = 0;\n\n for(Piece[] p1 : g.m_board.m_pieces)\n {\n for(Piece p2 : p1)\n {\n if(p2 != null)\n {\n if(p2.m_color == this.m_color)\n {\n sum += p2.getLegalMoves().size();\n }\n }\n }\n }\n\n if(sum == 0){ return true; } else { return false; }\n }", "private boolean isReference()\n {\n return countAttributes(REFERENCE_ATTRS) > 0;\n }", "boolean hasExplicitLac();", "boolean hasHas_consequence();", "public boolean checkConsonant(String givenLetter){\n if(calledConsonant.isEmpty())\n return true;\n else{\n for(String letter : calledConsonant){\n if(letter.equals(givenLetter)){\n return false;\n }\n }\n }\n return true;\n }", "public boolean checkData()\n {\n boolean ok = true;\n int l = -1;\n for(Enumeration<Vector<Double>> iter = data.elements(); iter.hasMoreElements() && ok ;)\n {\n Vector<Double> v = iter.nextElement();\n if(l == -1)\n l = v.size();\n else\n ok = (l == v.size()); \n }\n return ok; \n }", "public boolean isValid() {\n if (state.length != Board.dim*Board.dim) return false;\n if ((double)Board.dim != Math.sqrt((double)state.length)) return false;\n byte[] counts = new byte[state.length];\n try {\n for (int i = 0; i < counts.length; i++) counts[state[i]]++;\n } catch (ArrayIndexOutOfBoundsException e) { return false; }\n for (int i = 0; i < counts.length; i++) if (counts[i] != 1) return false;\n return true;\n }", "boolean isFull();", "boolean isFull();", "boolean isFull();", "boolean isFull();", "boolean isFull();", "boolean isFull();", "boolean isFull();", "boolean isFull();", "boolean isFull();" ]
[ "0.60040134", "0.5925773", "0.5669743", "0.56538004", "0.55959177", "0.5359747", "0.5301991", "0.52329344", "0.5226109", "0.52134645", "0.5165535", "0.5137831", "0.51305974", "0.512898", "0.51215273", "0.5121229", "0.5106983", "0.5102223", "0.50951576", "0.5080747", "0.5057463", "0.5029289", "0.50250757", "0.50247306", "0.5024008", "0.49939352", "0.49929488", "0.4985779", "0.49779147", "0.49770486", "0.4974196", "0.4957405", "0.49504766", "0.49354318", "0.49316978", "0.49271753", "0.4926903", "0.4926047", "0.49168682", "0.49137715", "0.49130297", "0.49026197", "0.48996902", "0.48987487", "0.48959994", "0.48875943", "0.48845896", "0.4877633", "0.4873571", "0.48735043", "0.48696148", "0.48628312", "0.48591712", "0.48553032", "0.48542807", "0.48506933", "0.48449752", "0.48390478", "0.4837604", "0.4836951", "0.4835766", "0.48342857", "0.48340395", "0.4832559", "0.483187", "0.4828826", "0.4812729", "0.48121127", "0.48083243", "0.47952655", "0.47921774", "0.47873986", "0.47834846", "0.47832745", "0.478313", "0.47694528", "0.47669545", "0.4765808", "0.47646686", "0.47641468", "0.4753724", "0.47518972", "0.47506535", "0.47339565", "0.4728621", "0.4725826", "0.47194028", "0.4719068", "0.4716895", "0.4713031", "0.47085848", "0.47075316", "0.47073177", "0.47073177", "0.47073177", "0.47073177", "0.47073177", "0.47073177", "0.47073177", "0.47073177", "0.47073177" ]
0.0
-1
Created by Zachary Herridge on 7/26/2018.
public interface MessagingQueueListener { void onMessage(MessageEvent messageEvent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n public int describeContents() { return 0; }", "public final void mo51373a() {\n }", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "private void m50366E() {\n }", "@Override public int describeContents() { return 0; }", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "protected boolean func_70814_o() { return true; }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n public void init() {\n }", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n void init() {\n }", "private MetallicityUtils() {\n\t\t\n\t}", "@Override\n public void init() {}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n protected void initialize() \n {\n \n }", "@Override\n protected void init() {\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "Consumable() {\n\t}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n public void initialize() { \n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "private void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n public int describeContents()\n {\n return 0;\n }", "@Override\n\tpublic void jugar() {}", "public void gored() {\n\t\t\n\t}", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int getSize() {\n return 1;\n }", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "public void mo4359a() {\n }", "@Override\n public void init() {\n\n }" ]
[ "0.573949", "0.55468684", "0.5527791", "0.5520735", "0.55133224", "0.5490192", "0.5383327", "0.53155816", "0.5302001", "0.5288547", "0.52827984", "0.5263403", "0.5252079", "0.5252079", "0.5252079", "0.5252079", "0.5252079", "0.5252079", "0.525117", "0.5250782", "0.5250782", "0.5209669", "0.5201485", "0.5197871", "0.5197593", "0.519057", "0.51720226", "0.5167708", "0.5167174", "0.5155174", "0.5143912", "0.51420206", "0.51420206", "0.5134789", "0.5132375", "0.5132375", "0.5132375", "0.5132375", "0.5132375", "0.51242006", "0.512019", "0.5114426", "0.5114378", "0.5112864", "0.51050836", "0.50880724", "0.50856286", "0.5074753", "0.50723195", "0.5067605", "0.50636125", "0.50547695", "0.50547695", "0.50547695", "0.5045806", "0.5035294", "0.50279474", "0.5015754", "0.5007191", "0.5007191", "0.5007191", "0.50060165", "0.50014096", "0.49984926", "0.49976155", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49964827", "0.49909335", "0.49883235", "0.49883235", "0.49875733", "0.49851668", "0.49839038" ]
0.0
-1
abstract public MarshalerAbstract getMarshaler();
abstract public String getApplicationName();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public javax.slee.resource.Marshaler getMarshaler() {\r\n \t\treturn null;\r\n \t}", "public Marshaller getMarshaller()\n throws JAXBException {\n return getMarshaller(true);\n }", "public static BinaryMessageEncoder<BirthInfo> getEncoder() {\n return ENCODER;\n }", "SerializeFactory getSerializeFactory();", "protected String reflectMarshal (Object obj) throws Exception {\n\t\treturn reflectMarshal (obj, new MarshalContext ());\n\t}", "public abstract OMElement serialize();", "public static BinaryMessageEncoder<VehicleInfoAvro> getEncoder() {\n return ENCODER;\n }", "public abstract String serialise();", "public interface Marshaller<T> {\n\tT unmarshal(ByteBuf in);\n\tvoid marshal(ByteBuf out, T t);\n}", "void marshal(Object obj);", "public void setMarshaller(Marshaller marshaller)\n {\n }", "public interface Marshaller<X> {\n Bytestring marshall(X x);\n\n X unmarshall(Bytestring string);\n}", "protected int get_marshal_type () {\n\t\treturn MARSHAL_FCAST_RESULT;\n\t}", "protected int get_marshal_type () {\n\t\treturn MARSHAL_FCAST_RESULT;\n\t}", "public SerialMarshallerFactory() {\n if (getSecurityManager() == null) {\n registry = SerializableClassRegistry.getInstance();\n } else {\n registry = doPrivileged(new PrivilegedAction<SerializableClassRegistry>() {\n public SerializableClassRegistry run() {\n return SerializableClassRegistry.getInstance();\n }\n });\n }\n }", "public static BinaryMessageEncoder<Trip> getEncoder() {\n return ENCODER;\n }", "public abstract TypeSerializer<IN> getInputTypeSerializer();", "public MessageEncoder<MessageType> getMessageEncoder();", "public abstract Object getUnderlyingObject();", "public void marshal(Writer out) throws MarshalException, ValidationException {\r\n/* 345 */ Marshaller.marshal(this, out);\r\n/* */ }", "DiagramMetadataMarshaller<M> getMetadataMarshaller();", "public byte[] marshall();", "PayloadCommunicator getPayloadCommunicator();", "public interface Serializer {\r\n /**\r\n * Gets the value which indicates the encoding mechanism used.\r\n */\r\n String getContentEncoding();\r\n\r\n /**\r\n * Gets the MIME-type suffix\r\n */\r\n String getContentFormat();\r\n\r\n /**\r\n * Serializes the object graph provided and writes a serialized\r\n * representation to the output stream provided.\r\n */\r\n void serialize(OutputStream output, Object graph);\r\n\r\n /**\r\n * Deserializes the stream provided and reconstructs the corresponding\r\n * object graph.\r\n */\r\n Object deserialize(InputStream input, Class type, String format,\r\n String contentEncoding);\r\n}", "public ObjectSerializationEncoder() {\n // Do nothing\n }", "public abstract Object marshal(Object objO, File objF);", "public static BinaryMessageEncoder<DNSLog> getEncoder() {\n return ENCODER;\n }", "public interface MarshalBuffer\n{\n /**\n * @param key\n * key\n * @return DBRowColumnTypeReader\n * @see java.util.Map#containsKey(java.lang.Object)\n */\n boolean containsKey(Object key);\n\n /**\n * @return value\n */\n byte get();\n\n /**\n * @param dst\n * dst\n * @return value\n */\n ByteBuffer get(byte[] dst);\n\n /**\n * @param key\n * key\n * @return map\n * @see java.util.Map#get(java.lang.Object)\n */\n DBRowMapPair get(Object key);\n\n /**\n * @return value\n */\n boolean getBoolean(); // NOPMD\n\n /**\n * @return value\n */\n double getDouble();\n\n /**\n * @return value\n */\n int getInt();\n\n /**\n * @return value\n */\n long getLong();\n\n /**\n * @return value\n */\n int getNextSharedIndex();\n\n /**\n * @param index\n * index\n * @return value\n */\n PyBase getShared(int index);\n\n /**\n * @return value\n */\n short getShort(); // NOPMD\n\n /**\n * @throws IllegalOpCodeException\n * on wrong stream format\n */\n void initialize() throws IllegalOpCodeException;\n\n /**\n * @return value\n */\n int parentPosition();\n\n /**\n * @return value\n */\n byte peekByte();\n\n /**\n * @return value\n */\n int position();\n\n /**\n * @return value\n */\n boolean processed();\n\n /**\n * @param key\n * key\n * @param value\n * value\n * @return value\n * @see java.util.Map#put(java.lang.Object, java.lang.Object)\n */\n DBRowMapPair put(PyDBRowDescriptor key, DBRowMapPair value);\n\n /**\n * @param size\n * size\n * @return value\n */\n byte[] readBytes(int size);\n\n /**\n * @param index\n * index\n * @param pyBase\n * pyBase\n * @return value\n */\n PyBase setShared(int index, PyBase pyBase);\n}", "public final OnTheWire marshal(InMemory onTheWire) {\n return null;\n }", "@Override\r\n\t\t\tpublic void serializar() {\n\r\n\t\t\t}", "Serializer<T> getSerializer();", "@Override\r\n\tpublic void serializar() {\n\r\n\t}", "public interface Serializer {\n /**\n * Serializes given serializable object into the byte array.\n *\n * @param object object that will be serialized\n * @return serialized byte array\n */\n byte[] serialize(Serializable object);\n\n /**\n * Deserializes byte array that serialized by {@link #serialize(Serializable)} method.\n *\n * @param bytes byte array that will be deserialized\n * @return deserialized object\n */\n Object deserialize(byte[] bytes);\n}", "com.google.protobuf.ByteString\n getSerBytes();", "public void serialize() {\n\t\t\n\t}", "public interface BaseBean extends Serializable {\n}", "@Override\r\n\tpublic BaseMapper<T> getMapper() {\n\t\treturn comMessageMapper;\r\n\t}", "public Map<QName, Marshaller> getMarshallers() {\n return Collections.unmodifiableMap(marshallers);\n }", "@Override\r\n\tpublic Class getObjectType() {\n\t\treturn mapperInterface;\r\n\t}", "public byte[] serialize() {\n try {\n ByteArrayOutputStream b = new ByteArrayOutputStream();\n ObjectOutputStream o = new ObjectOutputStream(b);\n o.writeObject(this);\n return b.toByteArray();\n } catch (IOException ioe) {\n return null;\n }\n }", "@Override\n public byte[] serialize() throws IOException {\n throw new UnsupportedOperationException(\"Not implemented\");\n }", "@Override\r\n\tpublic Object getMapper() {\n\t\treturn null;\r\n\t}", "interface MessageEncoder\r\n{\r\n\tString encode();\t\r\n}", "public abstract JsonElement serialize();", "public interface PrideXmlMarshaller {\n\n <T extends PrideXmlObject> String marshall(T object);\n\n <T extends PrideXmlObject> void marshall(T object, OutputStream os);\n\n <T extends PrideXmlObject> void marshall(T object, Writer out);\n\n <T extends PrideXmlObject> void marshall(T object, XMLStreamWriter writer);\n}", "@Override\n\tpublic Object getMapper() {\n\t\treturn null;\n\t}", "private void do_marshal (MarshalWriter writer) {\n\n\t\t// Version\n\n\t\twriter.marshalInt (M_VERSION_NAME, MARSHAL_VER_1);\n\n\t\t// Contents\n\n\t\twriter.marshalLong (\"mode_timestamp\" , mode_timestamp + OFFSERL);\n\t\twriter.marshalInt (\"relay_mode\" , relay_mode );\n\t\twriter.marshalInt (\"configured_primary\", configured_primary);\n\n\t\treturn;\n\t}", "public interface DiagramMarshaller<G extends Graph, M extends Metadata, D extends Diagram<G, M>> {\n\n /**\n * Constructs a graph instance of type <code>G</code> by consuming the input stream.\n * @param metadata The diagram's metadata. Marshaller classes can update metadata, if applies, here.\n * @param input The input stream that contains the serialized graph to generate.\n * @return A graph instance of type <code>G</code>.\n * @throws IOException System I/O error.\n */\n G unmarshall(final M metadata,\n final InputStream input) throws IOException;\n\n /**\n * Serializes a diagram instance of type <code>D</code> as string.\n * @param diagram The diagram instance to serialize.\n * @return The serialized diagram's raw value.\n * @throws IOException System I/O error.\n */\n String marshall(final D diagram) throws IOException;\n\n /**\n * Provides a un/marshaller instance for the Diagram's metadata.\n * @return The diagram's metadata marshaller.\n */\n DiagramMetadataMarshaller<M> getMetadataMarshaller();\n}", "public ClockProtocolCoder getTheProtocolCoder() {\n return theProtocolCoder;\n }", "public abstract interface INetworkMessage extends Serializable\r\n{\r\n public String getMessageId();\r\n}", "public MyEncodeableUsingEncoderDecoderClass() {}", "private static Serializer getSerializer() {\n\t\tConfiguration config = new Configuration();\n\t\tProcessor processor = new Processor(config);\n\t\tSerializer s = processor.newSerializer();\n\t\ts.setOutputProperty(Property.METHOD, \"xml\");\n\t\ts.setOutputProperty(Property.ENCODING, \"utf-8\");\n\t\ts.setOutputProperty(Property.INDENT, \"yes\");\n\t\treturn s;\n\t}", "public GenericData.Record serialize() {\n return null;\n }", "public interface Packing {\n public String pack();\n}", "@Override\n TypeInformation<T> getProducedType();", "public IOutputType getPrimaryOutputType();", "@Override\n\tpublic Enregistrable getEnregistrable() {\n\t\treturn null;\n\t}", "public interface RuntimewiringInterface {\n public RuntimeWiring buildWiring();\n}", "public byte[] serialize();", "public interface Serialization {\n\n byte[] objSerialize(Object obj);\n\n Object ObjDeserialize(byte[] bytes);\n}", "public Object createObject() {\n return klass.__call__().__tojava__(interfaceType);\n }", "public SignerInfo toASN1Structure()\n {\n return info;\n }", "public void encodeWithCoder(com.webobjects.foundation.NSCoder coder){\n return; //TODO codavaj!!\n }", "public String marshal (Object obj) throws Exception {\n Class thisClass = obj.getClass();\n XmlDescriptor desc = (XmlDescriptor)classList.get(thisClass.getName());\n if (desc == null) {\n\t\t\t//Debugger.trace (\"Class \" + thisClass.getName () + \" not found..\"\n\t\t\t//\t\t\t\t, Debugger.SHORT);\n return reflectMarshal (obj); // if no descriptor class - try to use relection to marshal.\n\t\t}\n return this.marshal(obj, new MarshalContext (outFormat), desc.xmlName);\n }", "@Test\n public void testMarshal() throws Exception {\n TypeXMLAdapter adapter = new TypeXMLAdapter();\n Assert.assertEquals(currentType.toString(), adapter.marshal(currentType));\n }", "@Override\n public Object getPayloadInstance() {\n return null;\n }", "public static Coder getDefaultCoder()\n {\n\treturn createBERCoder(c_project);\n }", "public interface SerializePackage extends EPackage {\n\t/**\n\t * The package name.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tString eNAME = \"serialize\";\n\n\t/**\n\t * The package namespace URI.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tString eNS_URI = \"http://www.misc.com/common/moplaf/serialize/model/0.1\";\n\n\t/**\n\t * The package namespace name.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tString eNS_PREFIX = \"srlz\";\n\n\t/**\n\t * The singleton instance of the package.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tSerializePackage eINSTANCE = com.misc.common.moplaf.serialize.impl.SerializePackageImpl.init();\n\n\t/**\n\t * The meta object id for the '{@link com.misc.common.moplaf.serialize.impl.SerializableImpl <em>Serializable</em>}' class.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @see com.misc.common.moplaf.serialize.impl.SerializableImpl\n\t * @see com.misc.common.moplaf.serialize.impl.SerializePackageImpl#getSerializable()\n\t * @generated\n\t */\n\tint SERIALIZABLE = 0;\n\n\t/**\n\t * The feature id for the '<em><b>Files</b></em>' containment reference list.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint SERIALIZABLE__FILES = FilePackage.FILE_READER_WRITER__FILES;\n\n\t/**\n\t * The feature id for the '<em><b>Selected File</b></em>' reference.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint SERIALIZABLE__SELECTED_FILE = FilePackage.FILE_READER_WRITER__SELECTED_FILE;\n\n\t/**\n\t * The feature id for the '<em><b>Handled File</b></em>' reference.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint SERIALIZABLE__HANDLED_FILE = FilePackage.FILE_READER_WRITER__HANDLED_FILE;\n\n\t/**\n\t * The feature id for the '<em><b>Read Feedback</b></em>' attribute.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint SERIALIZABLE__READ_FEEDBACK = FilePackage.FILE_READER_WRITER__READ_FEEDBACK;\n\n\t/**\n\t * The feature id for the '<em><b>Write Feedback</b></em>' attribute.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint SERIALIZABLE__WRITE_FEEDBACK = FilePackage.FILE_READER_WRITER__WRITE_FEEDBACK;\n\n\t/**\n\t * The feature id for the '<em><b>Name</b></em>' attribute.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint SERIALIZABLE__NAME = FilePackage.FILE_READER_WRITER_FEATURE_COUNT + 0;\n\n\t/**\n\t * The feature id for the '<em><b>Scheme</b></em>' attribute.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint SERIALIZABLE__SCHEME = FilePackage.FILE_READER_WRITER_FEATURE_COUNT + 1;\n\n\t/**\n\t * The feature id for the '<em><b>Selected Objects</b></em>' reference list.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint SERIALIZABLE__SELECTED_OBJECTS = FilePackage.FILE_READER_WRITER_FEATURE_COUNT + 2;\n\n\t/**\n\t * The number of structural features of the '<em>Serializable</em>' class.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint SERIALIZABLE_FEATURE_COUNT = FilePackage.FILE_READER_WRITER_FEATURE_COUNT + 3;\n\n\t/**\n\t * The operation id for the '<em>Get Read Feedback</em>' operation.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint SERIALIZABLE___GET_READ_FEEDBACK__FILE = FilePackage.FILE_READER_WRITER___GET_READ_FEEDBACK__FILE;\n\n\t/**\n\t * The operation id for the '<em>Get Write Feedback</em>' operation.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint SERIALIZABLE___GET_WRITE_FEEDBACK__FILE = FilePackage.FILE_READER_WRITER___GET_WRITE_FEEDBACK__FILE;\n\n\t/**\n\t * The operation id for the '<em>Read File</em>' operation.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint SERIALIZABLE___READ_FILE = FilePackage.FILE_READER_WRITER___READ_FILE;\n\n\t/**\n\t * The operation id for the '<em>Write File</em>' operation.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint SERIALIZABLE___WRITE_FILE = FilePackage.FILE_READER_WRITER___WRITE_FILE;\n\n\t/**\n\t * The operation id for the '<em>Read File</em>' operation.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint SERIALIZABLE___READ_FILE__FILE = FilePackage.FILE_READER_WRITER___READ_FILE__FILE;\n\n\t/**\n\t * The operation id for the '<em>Write File</em>' operation.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint SERIALIZABLE___WRITE_FILE__FILE = FilePackage.FILE_READER_WRITER___WRITE_FILE__FILE;\n\n\t/**\n\t * The number of operations of the '<em>Serializable</em>' class.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint SERIALIZABLE_OPERATION_COUNT = FilePackage.FILE_READER_WRITER_OPERATION_COUNT + 0;\n\n\t/**\n\t * The meta object id for the '{@link com.misc.common.moplaf.serialize.impl.DeserializableImpl <em>Deserializable</em>}' class.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @see com.misc.common.moplaf.serialize.impl.DeserializableImpl\n\t * @see com.misc.common.moplaf.serialize.impl.SerializePackageImpl#getDeserializable()\n\t * @generated\n\t */\n\tint DESERIALIZABLE = 1;\n\n\t/**\n\t * The feature id for the '<em><b>Files</b></em>' containment reference list.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint DESERIALIZABLE__FILES = FilePackage.FILE_READER_WRITER__FILES;\n\n\t/**\n\t * The feature id for the '<em><b>Selected File</b></em>' reference.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint DESERIALIZABLE__SELECTED_FILE = FilePackage.FILE_READER_WRITER__SELECTED_FILE;\n\n\t/**\n\t * The feature id for the '<em><b>Handled File</b></em>' reference.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint DESERIALIZABLE__HANDLED_FILE = FilePackage.FILE_READER_WRITER__HANDLED_FILE;\n\n\t/**\n\t * The feature id for the '<em><b>Read Feedback</b></em>' attribute.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint DESERIALIZABLE__READ_FEEDBACK = FilePackage.FILE_READER_WRITER__READ_FEEDBACK;\n\n\t/**\n\t * The feature id for the '<em><b>Write Feedback</b></em>' attribute.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint DESERIALIZABLE__WRITE_FEEDBACK = FilePackage.FILE_READER_WRITER__WRITE_FEEDBACK;\n\n\t/**\n\t * The feature id for the '<em><b>Name</b></em>' attribute.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint DESERIALIZABLE__NAME = FilePackage.FILE_READER_WRITER_FEATURE_COUNT + 0;\n\n\t/**\n\t * The feature id for the '<em><b>Scheme</b></em>' attribute.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint DESERIALIZABLE__SCHEME = FilePackage.FILE_READER_WRITER_FEATURE_COUNT + 1;\n\n\t/**\n\t * The feature id for the '<em><b>Owned Objects</b></em>' containment reference list.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint DESERIALIZABLE__OWNED_OBJECTS = FilePackage.FILE_READER_WRITER_FEATURE_COUNT + 2;\n\n\t/**\n\t * The number of structural features of the '<em>Deserializable</em>' class.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint DESERIALIZABLE_FEATURE_COUNT = FilePackage.FILE_READER_WRITER_FEATURE_COUNT + 3;\n\n\t/**\n\t * The operation id for the '<em>Get Read Feedback</em>' operation.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint DESERIALIZABLE___GET_READ_FEEDBACK__FILE = FilePackage.FILE_READER_WRITER___GET_READ_FEEDBACK__FILE;\n\n\t/**\n\t * The operation id for the '<em>Get Write Feedback</em>' operation.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint DESERIALIZABLE___GET_WRITE_FEEDBACK__FILE = FilePackage.FILE_READER_WRITER___GET_WRITE_FEEDBACK__FILE;\n\n\t/**\n\t * The operation id for the '<em>Read File</em>' operation.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint DESERIALIZABLE___READ_FILE = FilePackage.FILE_READER_WRITER___READ_FILE;\n\n\t/**\n\t * The operation id for the '<em>Write File</em>' operation.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint DESERIALIZABLE___WRITE_FILE = FilePackage.FILE_READER_WRITER___WRITE_FILE;\n\n\t/**\n\t * The operation id for the '<em>Read File</em>' operation.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint DESERIALIZABLE___READ_FILE__FILE = FilePackage.FILE_READER_WRITER___READ_FILE__FILE;\n\n\t/**\n\t * The operation id for the '<em>Write File</em>' operation.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint DESERIALIZABLE___WRITE_FILE__FILE = FilePackage.FILE_READER_WRITER___WRITE_FILE__FILE;\n\n\t/**\n\t * The number of operations of the '<em>Deserializable</em>' class.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @generated\n\t * @ordered\n\t */\n\tint DESERIALIZABLE_OPERATION_COUNT = FilePackage.FILE_READER_WRITER_OPERATION_COUNT + 0;\n\n\n\t/**\n\t * Returns the meta object for class '{@link com.misc.common.moplaf.serialize.Serializable <em>Serializable</em>}'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the meta object for class '<em>Serializable</em>'.\n\t * @see com.misc.common.moplaf.serialize.Serializable\n\t * @generated\n\t */\n\tEClass getSerializable();\n\n\t/**\n\t * Returns the meta object for the attribute '{@link com.misc.common.moplaf.serialize.Serializable#getName <em>Name</em>}'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the meta object for the attribute '<em>Name</em>'.\n\t * @see com.misc.common.moplaf.serialize.Serializable#getName()\n\t * @see #getSerializable()\n\t * @generated\n\t */\n\tEAttribute getSerializable_Name();\n\n\t/**\n\t * Returns the meta object for the attribute '{@link com.misc.common.moplaf.serialize.Serializable#getScheme <em>Scheme</em>}'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the meta object for the attribute '<em>Scheme</em>'.\n\t * @see com.misc.common.moplaf.serialize.Serializable#getScheme()\n\t * @see #getSerializable()\n\t * @generated\n\t */\n\tEAttribute getSerializable_Scheme();\n\n\t/**\n\t * Returns the meta object for the reference list '{@link com.misc.common.moplaf.serialize.Serializable#getSelectedObjects <em>Selected Objects</em>}'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the meta object for the reference list '<em>Selected Objects</em>'.\n\t * @see com.misc.common.moplaf.serialize.Serializable#getSelectedObjects()\n\t * @see #getSerializable()\n\t * @generated\n\t */\n\tEReference getSerializable_SelectedObjects();\n\n\t/**\n\t * Returns the meta object for class '{@link com.misc.common.moplaf.serialize.Deserializable <em>Deserializable</em>}'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the meta object for class '<em>Deserializable</em>'.\n\t * @see com.misc.common.moplaf.serialize.Deserializable\n\t * @generated\n\t */\n\tEClass getDeserializable();\n\n\t/**\n\t * Returns the meta object for the attribute '{@link com.misc.common.moplaf.serialize.Deserializable#getName <em>Name</em>}'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the meta object for the attribute '<em>Name</em>'.\n\t * @see com.misc.common.moplaf.serialize.Deserializable#getName()\n\t * @see #getDeserializable()\n\t * @generated\n\t */\n\tEAttribute getDeserializable_Name();\n\n\t/**\n\t * Returns the meta object for the attribute '{@link com.misc.common.moplaf.serialize.Deserializable#getScheme <em>Scheme</em>}'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the meta object for the attribute '<em>Scheme</em>'.\n\t * @see com.misc.common.moplaf.serialize.Deserializable#getScheme()\n\t * @see #getDeserializable()\n\t * @generated\n\t */\n\tEAttribute getDeserializable_Scheme();\n\n\t/**\n\t * Returns the meta object for the containment reference list '{@link com.misc.common.moplaf.serialize.Deserializable#getOwnedObjects <em>Owned Objects</em>}'.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the meta object for the containment reference list '<em>Owned Objects</em>'.\n\t * @see com.misc.common.moplaf.serialize.Deserializable#getOwnedObjects()\n\t * @see #getDeserializable()\n\t * @generated\n\t */\n\tEReference getDeserializable_OwnedObjects();\n\n\t/**\n\t * Returns the factory that creates the instances of the model.\n\t * <!-- begin-user-doc -->\n\t * <!-- end-user-doc -->\n\t * @return the factory that creates the instances of the model.\n\t * @generated\n\t */\n\tSerializeFactory getSerializeFactory();\n\n\t/**\n\t * <!-- begin-user-doc -->\n\t * Defines literals for the meta objects that represent\n\t * <ul>\n\t * <li>each class,</li>\n\t * <li>each feature of each class,</li>\n\t * <li>each operation of each class,</li>\n\t * <li>each enum,</li>\n\t * <li>and each data type</li>\n\t * </ul>\n\t * <!-- end-user-doc -->\n\t * @generated\n\t */\n\tinterface Literals {\n\t\t/**\n\t\t * The meta object literal for the '{@link com.misc.common.moplaf.serialize.impl.SerializableImpl <em>Serializable</em>}' class.\n\t\t * <!-- begin-user-doc -->\n\t\t * <!-- end-user-doc -->\n\t\t * @see com.misc.common.moplaf.serialize.impl.SerializableImpl\n\t\t * @see com.misc.common.moplaf.serialize.impl.SerializePackageImpl#getSerializable()\n\t\t * @generated\n\t\t */\n\t\tEClass SERIALIZABLE = eINSTANCE.getSerializable();\n\n\t\t/**\n\t\t * The meta object literal for the '<em><b>Name</b></em>' attribute feature.\n\t\t * <!-- begin-user-doc -->\n\t\t * <!-- end-user-doc -->\n\t\t * @generated\n\t\t */\n\t\tEAttribute SERIALIZABLE__NAME = eINSTANCE.getSerializable_Name();\n\n\t\t/**\n\t\t * The meta object literal for the '<em><b>Scheme</b></em>' attribute feature.\n\t\t * <!-- begin-user-doc -->\n\t\t * <!-- end-user-doc -->\n\t\t * @generated\n\t\t */\n\t\tEAttribute SERIALIZABLE__SCHEME = eINSTANCE.getSerializable_Scheme();\n\n\t\t/**\n\t\t * The meta object literal for the '<em><b>Selected Objects</b></em>' reference list feature.\n\t\t * <!-- begin-user-doc -->\n\t\t * <!-- end-user-doc -->\n\t\t * @generated\n\t\t */\n\t\tEReference SERIALIZABLE__SELECTED_OBJECTS = eINSTANCE.getSerializable_SelectedObjects();\n\n\t\t/**\n\t\t * The meta object literal for the '{@link com.misc.common.moplaf.serialize.impl.DeserializableImpl <em>Deserializable</em>}' class.\n\t\t * <!-- begin-user-doc -->\n\t\t * <!-- end-user-doc -->\n\t\t * @see com.misc.common.moplaf.serialize.impl.DeserializableImpl\n\t\t * @see com.misc.common.moplaf.serialize.impl.SerializePackageImpl#getDeserializable()\n\t\t * @generated\n\t\t */\n\t\tEClass DESERIALIZABLE = eINSTANCE.getDeserializable();\n\n\t\t/**\n\t\t * The meta object literal for the '<em><b>Name</b></em>' attribute feature.\n\t\t * <!-- begin-user-doc -->\n\t\t * <!-- end-user-doc -->\n\t\t * @generated\n\t\t */\n\t\tEAttribute DESERIALIZABLE__NAME = eINSTANCE.getDeserializable_Name();\n\n\t\t/**\n\t\t * The meta object literal for the '<em><b>Scheme</b></em>' attribute feature.\n\t\t * <!-- begin-user-doc -->\n\t\t * <!-- end-user-doc -->\n\t\t * @generated\n\t\t */\n\t\tEAttribute DESERIALIZABLE__SCHEME = eINSTANCE.getDeserializable_Scheme();\n\n\t\t/**\n\t\t * The meta object literal for the '<em><b>Owned Objects</b></em>' containment reference list feature.\n\t\t * <!-- begin-user-doc -->\n\t\t * <!-- end-user-doc -->\n\t\t * @generated\n\t\t */\n\t\tEReference DESERIALIZABLE__OWNED_OBJECTS = eINSTANCE.getDeserializable_OwnedObjects();\n\n\t}\n\n}", "public interface ospector\n{\n\n public abstract void addAbstractTypeResolver(AbstractTypeResolver abstracttyperesolver);\n\n public abstract void addBeanDeserializerModifier(BeanDeserializerModifier beandeserializermodifier);\n\n public abstract void addBeanSerializerModifier(BeanSerializerModifier beanserializermodifier);\n\n public abstract void addDeserializationProblemHandler(DeserializationProblemHandler deserializationproblemhandler);\n\n public abstract void addDeserializers(Deserializers deserializers);\n\n public abstract void addKeyDeserializers(KeyDeserializers keydeserializers);\n\n public abstract void addKeySerializers(Serializers serializers);\n\n public abstract void addSerializers(Serializers serializers);\n\n public abstract void addTypeModifier(TypeModifier typemodifier);\n\n public abstract void addValueInstantiators(ValueInstantiators valueinstantiators);\n\n public abstract void appendAnnotationIntrospector(AnnotationIntrospector annotationintrospector);\n\n public abstract w getMapperVersion();\n\n public abstract s getOwner();\n\n public abstract TypeFactory getTypeFactory();\n\n public abstract void insertAnnotationIntrospector(AnnotationIntrospector annotationintrospector);\n\n public abstract boolean isEnabled(f f);\n\n public abstract boolean isEnabled(i i);\n\n public abstract boolean isEnabled(n n);\n\n public abstract boolean isEnabled(DeserializationFeature deserializationfeature);\n\n public abstract boolean isEnabled(MapperFeature mapperfeature);\n\n public abstract boolean isEnabled(SerializationFeature serializationfeature);\n\n public transient abstract void registerSubtypes(NamedType anamedtype[]);\n\n public transient abstract void registerSubtypes(Class aclass[]);\n\n public abstract void setClassIntrospector(ClassIntrospector classintrospector);\n\n public abstract void setMixInAnnotations(Class class1, Class class2);\n}", "public abstract String pickle(Object obj);", "public interface CustomObjectSerializer <T> {\n\n Class<T> type();\n\n void serializeObject(JsonSerializerInternal serializer, T instance, CharBuf builder );\n\n}", "@Override\n\tpublic Object readObject() {\n\t\treturn super.readObject();\n\t}", "public Marshaller getMarshaller(QName key) {\n if (key == null) {\n return null;\n }\n\n return marshallers.get(key);\n }", "public java.lang.Class classForCoder(){\n return null; //TODO codavaj!!\n }", "@Override\n default ManagerPrx ice_datagram()\n {\n return (ManagerPrx)_ice_datagram();\n }", "@Override\n\tpublic void marshal(Object arg0, HierarchicalStreamWriter arg1, MarshallingContext arg2) {\n\n\t}", "Object getBase();", "@Override\n\tpublic byte[] getBytes() {\n\t\tbyte[] marshalledBytes = null;\n\t\tByteArrayOutputStream baOutputStream = new ByteArrayOutputStream();\n\t\tDataOutputStream dout = new DataOutputStream(new BufferedOutputStream(\n\t\t\t\tbaOutputStream));\n\n\t\ttry {\n\t\t\tdout.writeInt(type);\n\t\t\tdout.writeInt(status);\n\t\t\tdout.writeInt(msgLength);\n\n\t\t\tbyte[] messageBytes = message.getBytes();\n\t\t\tint elementLength = messageBytes.length;\n\t\t\tdout.writeInt(elementLength);\n\t\t\tdout.write(messageBytes);\n\n\t\t\tdout.flush();\n\t\t\tmarshalledBytes = baOutputStream.toByteArray();\n\t\t\tbaOutputStream.close();\n\t\t\tdout.close();\n\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error marshalling the bytes for RegistryReportsRegistrationStatus.\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn marshalledBytes;\n\n\t}", "protected abstract byte[] encode(Object o) throws EncoderException;", "@Override\n\tpublic byte[] toBytes() {\n\t\treturn null;\n\t}", "public Serializer getDefaultSerializer()\r\n\t{\r\n\t\treturn new XMLSerializer();\r\n\t}", "org.jetbrains.kotlin.backend.common.serialization.proto.IrFunctionBase getBase();", "public interface JSONRegistry<I extends Identifiable> extends Registry<I> {\r\n\t/**\r\n\t * @param json the JSON form of the object\r\n\t * @return the Object deserialized from JSON\r\n\t * @throws JsonParseException \r\n\t * @throws JsonMappingException \r\n\t * @throws IOException \r\n\t */\r\n\tpublic I fromJSON(String json) throws JsonParseException, JsonMappingException, IOException ;\r\n\t/**\r\n\t * @param toSerialise the object to serialize\r\n\t * @return the JSPM form of the object\r\n\t * @throws JsonGenerationException \r\n\t * @throws JsonMappingException \r\n\t * @throws IOException \r\n\t */\r\n\tpublic String toJSON(I toSerialise) throws JsonGenerationException, JsonMappingException, IOException;\r\n}", "public abstract org.omg.CORBA.Object read_Object();", "@Override\n void pack() {\n }", "@Override\n\tpublic String serialize() {\n\t\treturn null;\n\t}", "@Override\n\tpublic boolean usesSelfDescribingMessage() {\n\t\treturn ReadMarshallable.super.usesSelfDescribingMessage();\n\t}", "public interface IJSCmdBase {\r\n\r\n public abstract void run();\r\n\r\n /** \\brief unMarshall\r\n * \r\n * \\details\r\n *\r\n * \\return Object\r\n *\r\n * @param pobjFile\r\n * @return */\r\n public abstract Object unMarshal(File pobjFile); // private Object\r\n // unMarshall\r\n\r\n /** \\brief marshal\r\n * \r\n * \\details\r\n *\r\n * \\return Object\r\n *\r\n * @param objO\r\n * @param objF */\r\n public abstract Object marshal(Object objO, File objF); // private\r\n // SchedulerObjectFactoryOptions\r\n // marshal\r\n\r\n public abstract String toXMLString(Object objO); // private\r\n // SchedulerObjectFactoryOptions\r\n // marshal\r\n\r\n public abstract String toXMLString(); // private\r\n // SchedulerObjectFactoryOptions\r\n // marshal\r\n\r\n}", "public interface TransactionSerializer extends ObjectSerializer<Transaction> {\n}", "public boolean isCompatibleSerialization() {\n return compatibleSerialization;\n }", "public interface FieldSerializer {\n\n boolean serializeField(JsonSerializerInternal serializer, Object parent, FieldAccess fieldAccess, CharBuf builder );\n\n}", "@Override\r\n\tpublic XMLConvertor<?> getXMLConveter() throws OneM2MException {\n\t\treturn ConvertorFactory.getXMLConvertor(TimeSeries.class, TimeSeries.SCHEMA_LOCATION);\r\n\t}", "@Override\r\n\tpublic byte[] getByte() throws Exception {\n\t\tbyte[] marshalledBytes = null;\r\n\t\tByteArrayOutputStream baOutputStream = new ByteArrayOutputStream();\r\n\t\tDataOutputStream dout = new DataOutputStream(new BufferedOutputStream(\r\n\t\t\t\tbaOutputStream));\r\n\t\tdout.write(getType());\r\n\t\tInetAddress localAddress = node.serverSocketForSending.getInetAddress()\r\n\t\t\t\t.getLocalHost();\r\n\t\tint localPortNumber = node.serverSocketForSending.getLocalPort();\r\n\t\tbyte[] byteLocalIP = localAddress.getAddress();\r\n\t\tbyte addressLength = (byte) byteLocalIP.length;\r\n\t\tdout.write(addressLength);\r\n\t\tdout.write(byteLocalIP);\r\n\t\tdout.writeInt(localPortNumber);\r\n\t\tdout.writeInt(node.nodeID);\r\n\t\tdout.flush();\r\n\t\tmarshalledBytes = baOutputStream.toByteArray();\r\n\t\tbaOutputStream.close();\r\n\t\tdout.close();\r\n\r\n\t\treturn marshalledBytes;\r\n\t}", "public interface MessageSerializer<T> {\r\n\r\n\t/**\r\n\t * The content type that identifies the message serializer\r\n\t * \r\n\t * @return MIME format string\r\n\t */\r\n\tString getContentType();\r\n\r\n\t/**\r\n\t * Serialize the message to the stream\r\n\t * \r\n\t * @param <T>The implicit type of the message to serialize\r\n\t * @param stream\r\n\t * \">The stream to write the context to\r\n\t * @param context\r\n\t * \">The context to send\r\n\t */\r\n\tpublic void serialize(OutputStream stream, T message, SendContext<T> ctx)\r\n\t\t\tthrows IOException;\r\n\r\n\t/**\r\n\t * Deserialize a message from the stream by reading the\r\n\t * \r\n\t * @param context\r\n\t * \">The context to deserialize\r\n\t * @return An Object that was deserialized\r\n\t */\r\n\t//\r\n\r\n\t/**\r\n\t * Since we don't receive messages I short-circuited the original signature\r\n\t * \r\n\t * @param stream\r\n\t * @return\r\n\t * @throws IOException\r\n\t */\r\n\tT deserialize(InputStream stream) throws IOException;\r\n}", "@Override\r\n\tpublic Class<?> interfaceAdapted() {\n\t\treturn null;\r\n\t}", "public TDataObject getBaseDataObject(\n )\n {return baseDataObject;}", "@Override\n\tpublic int getSerializationId() {\n\t\treturn SERIALIZATION_ID;\n\t}", "public String toClassicRepresentation(){\n try {\n return LegacyMarshaller.getInstance().marshal(getComponents()).toString();\n } catch (ServiceException exception) {\n throw new RuntimeServiceException(exception);\n }\n }", "public synchronized DBEncoderFactory getDBEncoderFactory() {\n return this.encoderFactory;\n }", "public abstract Object mo1185b();", "public interface Serializable {\n\n\t/**\n\t * Method to convert the object into a stream\n\t *\n\t * @param out OutputSerializer to write the object to\n\t * @throws IOException in case of an IO-error\n\t */\n\tvoid writeObject(OutputSerializer out) throws java.io.IOException;\n\n\t/** \n\t * Method to build the object from a stream of bytes\n\t *\n\t * @param in InputSerializer to read from\n\t * @throws IOException in case of an IO-error\n\t */\n\tvoid readObject(InputSerializer in) throws java.io.IOException;\n}" ]
[ "0.8104173", "0.6168797", "0.6043439", "0.6023546", "0.59082437", "0.58513504", "0.58489823", "0.5839952", "0.5833148", "0.5818269", "0.58161175", "0.57810843", "0.577914", "0.577914", "0.5763591", "0.57404953", "0.5733276", "0.57210857", "0.5703297", "0.56488496", "0.5632243", "0.5573983", "0.55725116", "0.554265", "0.5538469", "0.5521314", "0.55048305", "0.54742724", "0.5472045", "0.5463966", "0.5437989", "0.5426774", "0.5376962", "0.53757685", "0.536893", "0.5353248", "0.53446156", "0.5338526", "0.5332649", "0.53244084", "0.5294064", "0.52824414", "0.5276103", "0.5267327", "0.526422", "0.5256079", "0.524848", "0.5244964", "0.5244386", "0.5235896", "0.5231339", "0.52261573", "0.5206556", "0.5199115", "0.5191472", "0.51791143", "0.51781535", "0.5171704", "0.5160134", "0.51600397", "0.51592016", "0.5158911", "0.5148496", "0.5147804", "0.51234305", "0.51188976", "0.511702", "0.5108586", "0.5108182", "0.5099792", "0.50971663", "0.5096039", "0.50893414", "0.50871944", "0.5085658", "0.5082701", "0.50673527", "0.50649333", "0.5062421", "0.50612736", "0.5055647", "0.50418353", "0.50378406", "0.5036731", "0.50336957", "0.50205785", "0.5019754", "0.50189346", "0.5010264", "0.50040716", "0.50018525", "0.5001182", "0.49828503", "0.49751222", "0.49735892", "0.4972181", "0.49701974", "0.4960631", "0.49592713", "0.49584955", "0.49546105" ]
0.0
-1
Have to implement a faster version with streams
public void createHashedVector() { Double val; for(int i=0; i < this.size; i++) { val = this.get(i); if(val !=0) { this.hmap.put(i, val); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void doStream() {\n ArrayList<Person> personCopy = new ArrayList<>(person);\n long l = System.currentTimeMillis();\n long ans = personCopy.stream().filter(p -> p.getHeight() > 180).count();\n System.out.println(\"doStream(): \" + ans);\n long e = System.currentTimeMillis();\n System.out.println(\"Cost time: \" + (e - l) + \"ms\");\n System.out.println(\"----------------------------\");\n }", "@Test\r\n\tvoid mapMethod() {\r\n\t\tStream<TransactionBean> transactionBeanStream = transactions.stream();\r\n\t\tStream<Integer> streamInteger = transactionBeanStream.peek(System.out::println).map(TransactionBean::getId);\r\n\t\tList<Integer> afterStreamList = streamInteger.peek(System.out::println).collect(Collectors.toCollection(ArrayList::new));\r\n\t\tassertSame(\"wrong value\", 1, afterStreamList.get(0).intValue());\r\n\t\tassertSame(\"wrong value\", 2, afterStreamList.get(1).intValue());\r\n\t\tassertSame(\"wrong value\", 3, afterStreamList.get(2).intValue());\r\n\t}", "@Test\n public void intermediateOperations() {\n Stream<Book> books = TestData.getBooks().stream();\n // filter\n Stream<Book> booksWithMultipleAuthors = books.filter(book -> book.hasMultipleAuthors());\n // map\n Stream<String> namesStream = booksWithMultipleAuthors.map(book -> book.getName());\n \n Set<String> expected = \n Sets.newHashSet(\"Design Patterns: Elements of Reusable Object-Oriented Software\",\n \"Structure and Interpretation of Computer Programs\");\n assertEquals(expected, namesStream.collect(Collectors.toSet()));\n }", "private static void doParallelStream() {\n ArrayList<Person> personCopy = new ArrayList<>(person);\n long l = System.currentTimeMillis();\n long ans = personCopy.parallelStream().filter(p -> p.getHeight() > 180).count();\n System.out.println(\"doParallelStream(): \" + ans);\n long e = System.currentTimeMillis();\n System.out.println(\"Cost time: \" + (e - l) + \"ms\");\n System.out.println(\"----------------------------\");\n }", "public abstract Stream<E> streamBlockwise();", "@Test\n public void testGetNextCulturalObjectByStreamMethod() {\n Multimap<Long, CulturalObject> multimap = ArrayListMultimap.create();\n IntStream.range(0, NUMBER_OF_EXECUTIONS).parallel().forEach(i -> {{\n CulturalObject co = cardService.getNextCulturalObject(null);\n if (co != null) {\n multimap.put(co.getId(), co);\n }\n }});\n\n double[] sizes = multimap.keySet().stream().mapToDouble(aLong -> (double) multimap.get(aLong).size()).toArray();\n StandardDeviation std = new StandardDeviation();\n assertThat(std.evaluate(sizes), is(closeTo(0.0, 0.5)));\n\n }", "@Test\n public void streamApiTest(){\n Collection<Integer> myCollection=initializeIntCollection(3,5);\n\n long sumOfOddValues3times=myCollection.stream().\n filter(o -> o % 2 ==1). // for all odd numbers\n mapToInt(o -> o*3). // multiply their value on 3\n sum(); // and return their sum (reduce operation)\n Assert.assertEquals((3+5+7)*3, sumOfOddValues3times);\n\n Optional<Integer> sumOfModulesOn3= myCollection.stream().\n filter( o -> o % 3 ==0).\n reduce((sum, o) -> sum = sum + o);\n Assert.assertEquals(new Integer(3+6), sumOfModulesOn3.get());\n\n\n\n Collection<Integer> evenCollection=new ArrayList<>();\n myCollection.\n stream().\n filter(o -> o % 2 == 0).\n forEach((i) -> evenCollection.add(i));\n }", "private int[] removeDuplicatesWithStream() {\n\t return Arrays.stream(randomIntegers).distinct().toArray();\n\t}", "public static void generate(SparseStream stream, PrintStream output) {\n stream.position(0);\n byte[] buffer = new byte[1024 * 1024];\n for (Range block : StreamExtent.blocks(stream.getExtents(), buffer.length)) {\n long startPos = block.getOffset() * buffer.length;\n long endPos = Math.min((block.getOffset() + block.getCount()) * buffer.length, stream.getLength());\n stream.position(startPos);\n while (stream.position() < endPos) {\n int numLoaded = 0;\n long readStart = stream.position();\n while (numLoaded < buffer.length) {\n int bytesRead = stream.read(buffer, numLoaded, buffer.length - numLoaded);\n if (bytesRead == 0) {\n break;\n }\n\n numLoaded += bytesRead;\n }\n for (int i = 0; i < numLoaded; i += 16) {\n boolean foundVal = false;\n if (i > 0) {\n for (int j = 0; j < 16; j++) {\n if (buffer[i + j] != buffer[i + j - 16]) {\n foundVal = true;\n break;\n }\n\n }\n } else {\n foundVal = true;\n }\n if (foundVal) {\n output.printf(\"%08x\", i + readStart);\n for (int j = 0; j < 16; j++) {\n if (j % 8 == 0) {\n output.print(\" \");\n }\n\n output.printf(\" %02x\", buffer[i + j]);\n }\n output.print(\" |\");\n for (int j = 0; j < 16; j++) {\n if (j % 8 == 0 && j != 0) {\n output.print(\" \");\n }\n\n output.printf(\"%c\", (buffer[i + j] >= 32 && buffer[i + j] < 127) ? (char) buffer[i + j] : '.');\n }\n output.print(\"|\");\n output.println();\n }\n }\n }\n }\n }", "public static void main(String[] args) {\r\n\t\t\r\n\t\tSystem.out.println(\"-------1. Stream filter() example---------\");\r\n\t\t//We can use filter() method to test stream elements for a condition and generate filtered list.\r\n\t\t\r\n\t\tList<Integer> myList = new ArrayList<>();\r\n\t\tfor(int i=0; i<100; i++) myList.add(i);\r\n\t\tStream<Integer> sequentialStream = myList.stream();\r\n\r\n\t\tStream<Integer> highNums = sequentialStream.filter(p -> p > 90); //filter numbers greater than 90\r\n\t\tSystem.out.print(\"High Nums greater than 90=\");\r\n\t\thighNums.forEach(p -> System.out.print(p+\" \"));\r\n\t\t//prints \"High Nums greater than 90=91 92 93 94 95 96 97 98 99 \"\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"-------2. Stream map() example---------\");\r\n\t\t//We can use map() to apply functions to an stream\r\n\t\tStream<String> names = Stream.of(\"aBc\", \"d\", \"ef\");\r\n\t\tSystem.out.println(names.map(s -> {\r\n\t\t\t\treturn s.toUpperCase();\r\n\t\t\t}).collect(Collectors.toList()));\r\n\t\t//prints [ABC, D, EF]\r\n\t\t\r\n\t\tSystem.out.println(\"-------3. Stream sorted() example---------\");\r\n\t\t//We can use sorted() to sort the stream elements by passing Comparator argument.\r\n\t\tStream<String> names2 = Stream.of(\"aBc\", \"d\", \"ef\", \"123456\");\r\n\t\tList<String> reverseSorted = names2.sorted(Comparator.reverseOrder()).collect(Collectors.toList());\r\n\t\tSystem.out.println(reverseSorted); // [ef, d, aBc, 123456]\r\n\r\n\t\tStream<String> names3 = Stream.of(\"aBc\", \"d\", \"ef\", \"123456\");\r\n\t\tList<String> naturalSorted = names3.sorted().collect(Collectors.toList());\r\n\t\tSystem.out.println(naturalSorted); //[123456, aBc, d, ef]\r\n\t\t\r\n\t\tSystem.out.println(\"-------4. Stream flatMap() example---------\");\r\n\t\t//We can use flatMap() to create a stream from the stream of list.\r\n\t\tStream<List<String>> namesOriginalList = Stream.of(\r\n\t\t\t\tArrays.asList(\"Pankaj\"), \r\n\t\t\t\tArrays.asList(\"David\", \"Lisa\"),\r\n\t\t\t\tArrays.asList(\"Amit\"));\r\n\t\t\t//flat the stream from List<String> to String stream\r\n\t\t\tStream<String> flatStream = namesOriginalList\r\n\t\t\t\t.flatMap(strList -> strList.stream());\r\n\r\n\t\t\tflatStream.forEach(System.out::println);\r\n\r\n\t}", "private void usingPrimitiveStream() {\n IntStream.range(1, 4).forEach(System.out::println);\n DoubleStream.of(2.3, 4.3).forEach(System.out::println);\n LongStream.range(1, 4).forEach(System.out::println);\n }", "O transform(R result);", "@Test\n public void intermediateAndTerminalOperations() throws Exception {\n System.out.println(\n MockData.getCars()\n // Here we go to \"abstraction\" of strams\n .stream()\n // This is an intermediate op because we stay in the abstraction\n .filter(car -> {\n System.out.println(\"filter car \" + car);\n return car.getPrice() < 10000;\n })\n // This is intermediate too, we still working with streams \"abstraction\"\n .map(car -> {\n System.out.println(\"mapping car \" + car);\n return car.getPrice();\n })\n // same as before, still intermediate, still in streams abstraction\n .map(price -> {\n System.out.println(\"mapping price \" + price);\n return price + (price * .14);\n })\n // ok, this is a terminal operation and give you back the \"concrete type\" result of the operations\n .collect(Collectors.toList())\n );\n\n // Q: If you comment this line, no result is printed, you got only stram reference, why?\n // A: STREAMS are LAZY initialized\n\n // Q: What's the order of execution in the above code?\n // A: See the console print to understand order of execution:\n // The mappings are executed as soon as the first car passes the filter\n // so to get some results, stream don't need to filter ALL the list before\n\n }", "public static int sumUsingStreams(int []arr)\n{\n //Your code here\n //using stream.sum()\n return Arrays.stream( arr)\n .sum(); \n \n}", "public void testConsumer ()\n {\n\n List<String> list = new ArrayList<>();\n list.add(\"ccc\");\n list.add(\"bbb\");\n list.add(\"ddd\");\n list.add(\"DDDD\");\n list.add(\"ccc\");\n list.add(\"aaa\");\n list.add(\"eee\");\n\n// Collections.sort(list);\n// Collections.sort(list, (s, s2) -> s.toLowerCase().compareTo(s2.toLowerCase()));\n\n// list.sort((s, s2) -> s.compareTo(s2));\n// list.sort((s, s2) -> s.toLowerCase().compareTo(s2.toLowerCase()));\n\n// list.forEach(s -> System.out.println(s));\n// list.forEach(s -> System.out.println(s));\n\n\n// Predicate<String> predicate2 = s -> s.length()>3;\n// System.out.println(\"predicate2.test(\\\"DDDD\\\") = \" + predicate2.test(\"DDDD\"));\n\n// Stream<String> stringStream = list.stream();\n// stringStream.forEach(s -> System.out.println(s));\n// stringStream.forEach(s -> System.out.println(s));//会报错\n\n// list.stream().forEach(s -> System.out.println(s));\n// list.stream().forEach(s -> System.out.println(s));\n\n //并行流是无序的\n// list.parallelStream().forEach(s -> System.out.println(s));\n// list.parallelStream().forEach(s -> System.out.println(s));\n\n// list.stream().skip(3).forEach(s -> System.out.println(s));\n// list.stream().distinct().forEach(s -> System.out.println(s));\n// System.out.println(\"list.stream().count() = \" + list.stream().count());\n// list.stream().limit(2).forEach(s -> System.out.println(s));\n\n// list.stream().filter(s -> s.length()<4).forEach(s -> System.out.println(s));\n\n// BiFunction<Integer, String, Person> bf = Person::new;\n// BiFunction<Integer, String, Person> bf = (n, s) -> new Person(s);\n\n// Person aaa = bf.apply();\n\n// System.out.println(\"aaa = \" + bf.apply(0, \"aaa\"));\n \n }", "@Override\n public void consume(Stream<T> items) {\n final Set<byte[]> hashes =\n new TreeSet<>(\n (left, right) -> {\n for (int i = 0, j = 0; i < left.length && j < right.length; i++, j++) {\n var a = (left[i] & 0xff);\n var b = (right[j] & 0xff);\n if (a != b) {\n return a - b;\n }\n }\n return left.length - right.length;\n });\n final var output = SftpServer.MAPPER.createArrayNode();\n items.forEach(\n item -> {\n final var outputNode = output.addObject();\n for (final var writer : writers) {\n writer.accept(item, outputNode);\n }\n try {\n hashes.add(\n MessageDigest.getInstance(\"SHA1\")\n .digest(SftpServer.MAPPER.writeValueAsBytes(outputNode)));\n } catch (NoSuchAlgorithmException | JsonProcessingException e) {\n throw new RuntimeException(e);\n }\n });\n\n // Now, we can take a hash of the sorted hashes and be confident that if the data is the same,\n // the has will be the same even if the data was supplied in a different order\n try {\n final var digest = MessageDigest.getInstance(\"SHA1\");\n for (final var hash : hashes) {\n digest.update(hash);\n }\n final var totalHash = Utils.bytesToHex(digest.digest());\n if (totalHash.equals(lastHash)) {\n return;\n }\n if (server.get().refill(name, command + \" \" + totalHash, output)) {\n lastHash = totalHash;\n }\n\n } catch (NoSuchAlgorithmException e) {\n throw new RuntimeException(e);\n }\n }", "public static void main(String[] args){\n List<String> list = Arrays.asList(\"a\",\"2\",\"3\",\"4\",\"5\");\n //List l1 = Lists.newArrayList();\n //list.stream().map(a->\"map\"+a).forEach(System.out::println);\n Stream lines = list.stream();\n lines.flatMap(line->Arrays.stream(line.toString().split(\"\"))).distinct().count();\n\n\n }", "public static void calculateSumViaStreams(List<Integer> numbers){\n int sum = numbers.stream()\n .filter(x -> x % 2 == 0)\n .map(y -> y * y)\n .reduce(0, (x, y) -> x + y);\n\n System.out.println(sum);\n }", "@Override\n\tpublic void run() {\n\t\tresult =\n\t\t\tStream.iterate(new int[]{0, 1}, s -> new int[]{s[1], s[0] + s[1]})\n\t\t\t\t.limit(limit)\n\t\t\t\t.map(n -> n[0])\n\t\t\t\t.collect(toList());\n\n\t}", "private static void testStreamFormList() {\n\n Integer[] ids = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20};\n\n/*\n Stream.of(ids)\n .map(StreamsOverviewMain::findById)\n .filter(Objects::nonNull)\n .collect(Collectors.toList())\n .forEach(System.out::println);\n*/\n/*\n Random r = new Random();\n Integer integer = Stream.of(ids)\n .filter(i -> i % 2 == 0)\n .filter(i -> i % 3 == 0)\n .filter(i -> i % 5 == 0)\n .findFirst()\n// .orElse(0);\n .orElseGet(()->r.nextInt());\n System.out.println(integer);\n*/\n Stream.of(ids)\n .filter(i -> i % 2 == 0)\n .filter(i -> i % 3 == 0)\n .skip(2)\n .limit(1)\n .forEach(System.out::println);\n\n/*\n Optional<Employee2> first = Stream.of(ids)\n .map(StreamsOverviewMain::findById)\n .filter(Objects::nonNull)\n .findFirst();\n System.out.println(first);\n*/\n/*\n OptionalDouble average = Stream.of(ids)\n .map(StreamsOverviewMain::findById)\n .filter(Objects::nonNull)\n .mapToInt(Employee2::getSalary)\n .average();\n System.out.println(average);\n*/\n\n List<List<Employee2>> departments = new ArrayList<>();\n departments.add(employeeList);\n departments.add(secondList);\n\n/*\n departments.stream().flatMap(l -> l.stream()\n .map(e -> e.getFirstName())).forEach(System.out::println);\n*/\n\n/*\n Stream.of(ids).map(e -> String.format(\"%,3d\", e)).forEach(System.out::print);\n System.out.println();\n Stream.of(ids)\n// .peek(e -> e = e * 2)\n .map(e -> String.format(\"%,3d\", e * 2))\n .forEach(System.out::print);\n System.out.println();\n*/\n/*\n Consumer<Integer> c = e -> e = e * 2;\n Stream.of(ids).forEach(c);\n System.out.println(c);\n*/\n }", "public static void main(String[] args) {\n\t\n\t\tm(\"Iterate\", () -> {\t\t\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tSupplier<IntStream>[] sArr = (Supplier<IntStream>[])new Supplier[] {\n\t\t\t\t() -> IntStream.iterate(2, i -> 2 * i),\n\t\t\t\t() -> IntStream.iterate(10, i -> i - 1),\n\t\t\t\t() -> IntStream.iterate(10, i -> i),\n\t\t\t\t() -> IntStream.iterate(10, i -> 2),\n\t\t\t\t() -> IntStream.iterate(42, IntUnaryOperator.identity()),\n\t\t\t\t() -> IntStream.iterate(42, IntUnaryOperator.identity().andThen(IntUnaryOperator.identity())),\n\t\t\t};\n\t\t\tStream.of(sArr).forEach(supplier -> supplier.get().limit(10).forEach(System.out::println));\n\t\t});\n\t\t\n\t\t\n\t\t//Various IntStream generations. generate produces elements without input => it uses an IntSupplier.\n\t\t\n\t\tSystem.out.println(\"---------------------------------------------\");\n\t\t\n\t\tm(\"Generate\", () -> {\t\t\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tSupplier<IntStream>[] sArr = (Supplier<IntStream>[])new Supplier[] {\n\t\t\t\t() -> IntStream.generate(() -> new Random().nextInt()),\n\t\t\t\t() -> IntStream.generate(() -> new Random().nextInt()).filter(n -> n >= 0),\n\t\t\t\t() -> IntStream.generate(() -> 10),\n\t\t\t\t() -> IntStream.generate(() -> new Random().nextInt() % 20).filter(n -> n >= 0)\n\t\t\t};\n\t\t\tStream.of(sArr).forEach(supplier -> {supplier.get().limit(10).forEach(System.out::println); System.out.println(\"--------------------------------\");});\n\t\t});\n\t\t\n\t\t\n\t\t//Iterate and generate for DoubleStream, LongStream and Stream<T>\n\t\t\n\t\t\n\t\tm(\"DoubleStream iterate and generate\", () -> {\t\t\n\t\t\tDoubleStream.iterate(1, d -> d + d / 2).limit(20).forEach(System.out::println); //Uses DoubleUnaryOperator\n\t\t\tSystem.out.println(\"-------------------------\");\n\t\t\tDoubleStream.generate(() -> new Random().nextDouble()).limit(5).forEach(System.out::println); //Uses DoubleSupplier\n\t\t});\n\t\t\n\t\tm(\"LongStream iterate and generate\", () -> {\t\t\n\t\t\tLongStream.iterate(2, n -> n * n).limit(4).forEach(System.out::println); //Uses LongUnaryOperator\n\t\t\tSystem.out.println(\"-------------------------\");\n\t\t\tDoubleStream.generate(() -> new Random().nextLong()).limit(5).forEach(System.out::println); //Uses LongSupplier\n\t\t});\n\t\t\n\t\tm(\"Stream iterate and generate\", () -> {\t\t\n\t\t\tStream.<List<Object>>iterate(new ArrayList<Object>(), l -> {l.add(1); return l;}).limit(4).forEach(System.out::println); //Uses UnaryOperator\n\t\t\tSystem.out.println(\"-------------------------\");\n\t\t\tStream.<List<Object>>generate(() -> new ArrayList<Object>()).limit(4).forEach(System.out::println); //Uses Supplier\n\t\t});\n\t\t\n\t\tm(\"noneMatch\", () -> {\t\t\n\t\t\tStream<String> stream = Stream.<String>iterate(\"-\", s -> s + s);\n\t\t\tPredicate<String> predicate = s -> s.length() > 3;\n\t\t\tSystem.out.println(stream.noneMatch(predicate)); //Note: this is not infinite. None match will fail as soon as one element is found\n\t\t});\n\t\t\n\t\tm(\"allMatch\", () -> {\t\t\n\t\t\tStream<String> stream = Stream.<String>iterate(\"-\", s -> s + s);\n\t\t\tPredicate<String> predicate = s -> s.length() > 0;\n\t\t\tPredicate<String> predicate2 = s -> s.length() > 3;\n\t\t\t//System.out.println(stream.allMatch(predicate)); //Note: This is infinite and will fail with OOM error\n\t\t\tSystem.out.println(stream.allMatch(predicate2)); //Note how this will return as the first element does not match so false can be returned\n\t\t});\n\t\t\n\t}", "protected abstract List<List<SearchResults>> processStream();", "public static void main(String args[]) \r\n {\n List<Integer> number = Arrays.asList(2,3,4,5); \r\n \r\n // demonstration of map method \r\n List<Integer> square = number.stream().map(x -> x*x). \r\n collect(Collectors.toList()); \r\n System.out.println(\"Square od number using map()\"+square); \r\n \r\n // create a list of String \r\n List<String> names = \r\n Arrays.asList(\"Reflection\",\"Collection\",\"Stream\"); \r\n \r\n // demonstration of filter method \r\n List<String> result = names.stream().filter(s->s.startsWith(\"S\")). \r\n collect(Collectors.toList()); \r\n System.out.println(result); \r\n \r\n // demonstration of sorted method \r\n List<String> show = \r\n names.stream().sorted().collect(Collectors.toList()); \r\n System.out.println(show); \r\n \r\n // create a list of integers \r\n List<Integer> numbers = Arrays.asList(2,3,4,5,2); \r\n \r\n // collect method returns a set \r\n Set<Integer> squareSet = \r\n numbers.stream().map(x->x*x).collect(Collectors.toSet()); \r\n System.out.println(squareSet); \r\n \r\n // demonstration of forEach method \r\n number.stream().map(x->x*x).forEach(y->System.out.println(y)); \r\n \r\n // demonstration of reduce method \r\n int even = \r\n number.stream().filter(x->x%2==0).reduce(0,(ans,i)-> ans+i); \r\n \r\n System.out.println(even); \r\n \r\n // Create a String with no repeated keys \r\n Stream<String[]> \r\n str = Stream \r\n .of(new String[][] { { \"GFG\", \"GeeksForGeeks\" }, \r\n { \"g\", \"geeks\" }, \r\n { \"G\", \"Geeks\" } }); \r\n\r\n // Convert the String to Map \r\n // using toMap() method \r\n Map<String, String> \r\n map = str.collect( \r\n Collectors.toMap(p -> p[0], p -> p[1])); \r\n\r\n // Print the returned Map \r\n System.out.println(\"Map:\" + map); \r\n }", "private int[] removeDuplicatesWithParallelStream() {\n\t return Arrays.stream(randomIntegers).parallel().distinct().toArray();\n\t}", "public static void findFirstMultipleOfSixViaStreams(List<Integer> numbers){\n\n int abc = 9;\n numbers.stream().filter(x -> {\n System.out.println(\"x = \" + x);\n return x % 6 == 0;\n }).map(x -> x + abc).findFirst();\n// Optional<Integer> firstSixMultiple = numbers.stream()\n// .filter(x -> {\n// System.out.println(\"x = \" + x);\n// return x % 6 == 0;\n// })\n// .findFirst();\n\n// int ans = firstSixMultiple.orElse(-1);\n\n// System.out.println(ans);\n }", "private void streamsMinDemoOptimized() {\n IntSummaryStatistics stats = IntStream.of(numbers).summaryStatistics();\n System.out.println(stats.getMin());\n System.out.println(stats.getMax());\n System.out.println(stats.getAverage());\n System.out.println(stats.getCount());\n System.out.println(stats.getSum());\n }", "@Test\n public void streamsExample() {\n List<Integer> list = asList(1, 2, 3, 4, 5);\n \n list.stream().forEach(out::println);\n \n out.println();\n \n list.stream().parallel().forEachOrdered(out::println);\n \n \n }", "public static void main(String[] args) {\n\n\n List<Integer> source = buildIntRange();\n\n if(CollectionUtils.isNotEmpty(source)){\n\n }\n // 传统方式的遍历\n long start = System.currentTimeMillis();\n for (int i = 0; i < source.size(); i++) {\n try {\n TimeUnit.MILLISECONDS.sleep(1);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n System.out.println(\"传统方式 : \" + (System.currentTimeMillis() - start) + \"ms\");\n\n // 单管道stream\n start = System.currentTimeMillis();\n source.stream().forEach(r -> {\n try {\n TimeUnit.MILLISECONDS.sleep(1);\n } catch (Exception e) {\n e.printStackTrace();\n }\n });\n System.out.println(\"stream : \" + (System.currentTimeMillis() - start) + \"ms\");\n\n // 多管道parallelStream\n start = System.currentTimeMillis();\n source.parallelStream().forEach(r -> {\n try {\n TimeUnit.MILLISECONDS.sleep(1);\n } catch (Exception e) {\n e.printStackTrace();\n }\n });\n System.out.println(\"parallelStream : \" + (System.currentTimeMillis() - start) + \"ms\");\n }", "public IntStream stream() {\n\treturn StreamSupport.intStream(spliterator(), false);\n }", "private static Stream<?> all(Iterator<Object> i) {\n requireNonNull(i);\n final Iterable<Object> it = () -> i;\n return StreamSupport.stream(it.spliterator(), false);\n }", "@Ignore\n @Test\n public void hashSetToStream() {\n // BEGIN HASHSET_TO_STREAM\n Set<Integer> numbers = new HashSet<>(asList(4, 3, 2, 1));\n\n List<Integer> sameOrder = numbers.stream()\n .collect(toList());\n\n // This may not pass\n assertEquals(asList(4, 3, 2, 1), sameOrder);\n // END HASHSET_TO_STREAM\n }", "public IntStream parallelStream() {\n\treturn StreamSupport.intStream(spliterator(), true);\n }", "private void mapToObjUsingStream() {\n IntStream.range(1, 4)\n .mapToObj(i -> \"a\" + i)\n .forEach(System.out::println);\n }", "@Override\n protected Collection<Stream> calculateEmittedStreams(\n final Collection<Stream> providedStreams) {\n return null;\n }", "@Benchmark\r\n\tpublic void withoutStream(Blackhole bh) {\r\n\t\tList<Double> result = new ArrayList<Double>(DATA_FOR_TESTING.size() / 2 + 1);\r\n\t\tfor (Integer i : DATA_FOR_TESTING) {\r\n\t\t\tif (i % 2 == 0) {\r\n\t\t\t\tresult.add(Math.sqrt(i));\r\n\t\t\t\tbh.consume(i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static void functionStream() {\n\t\tStream.iterate(0, n -> n + 2).limit(10).forEach(System.out::println);\n\t\tStream.generate(Math::random).limit(4).forEach(System.out::println);\n\n\t}", "private void collectorOperationInStream() {\n List<Person> persons =\n Arrays.asList(\n new Person(\"Max\", 18),\n new Person(\"Vicky\", 23),\n new Person(\"Ron\", 23),\n new Person(\"Harry\", 12));\n\n Map<Integer, List<Person>> personsByAge = persons\n .stream()\n .collect(Collectors.groupingBy(p -> p.age));\n\n personsByAge.forEach((age, p) -> System.out.format(\"age %s: %s\\n\", age, p));\n\n Double averageAge = persons\n .stream()\n .collect(Collectors.averagingInt(p -> p.age));\n\n System.out.println(\"Average-Age: \" + averageAge);\n\n IntSummaryStatistics ageSummary = persons.stream()\n .collect(Collectors.summarizingInt(p -> p.age));\n\n System.out.println(\"Summarizing Age: \" + ageSummary);\n\n String phrase = persons\n .stream()\n .filter(p -> p.age >= 18)\n .map(p -> p.name)\n .collect(Collectors.joining(\" and \", \"In Germany \", \" are of legal age.\"));\n\n System.out.println(\"Collectors Joining: \" + phrase);\n\n Map<Integer, String> map = persons\n .stream()\n .collect(Collectors.toMap(\n p -> p.age,\n p -> p.name,\n (name1, name2) -> name1 + \";\" + name2));\n\n System.out.println(\"Collectors Mapping: \" + map);\n\n\n Collector<Person, StringJoiner, String> personNameCollector =\n Collector.of(\n () -> new StringJoiner(\" | \"), // supplier\n (j, p) -> j.add(p.name.toUpperCase()), // accumulator\n StringJoiner::merge, // combiner\n StringJoiner::toString); // finisher\n\n String names = persons\n .stream()\n .collect(personNameCollector);\n\n System.out.println(\"Collectors Collect: \" + names);\n\n\n List<Integer> IntegerRange = IntStream.range(51, 54).boxed().collect(Collectors.toList());\n List<Integer> IntegerRange1 = IntStream.range(51, 54).mapToObj(i-> i).collect(Collectors.toList());\n System.out.println(\"InStream to List : \"+IntegerRange);\n System.out.println(\"InStream to List : \"+IntegerRange1);\n }", "public static void main(String[] args) {\n\t\tList<Integer> numberList = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);\r\n\t\t\t\t\r\n\t\t//Stampa il doppio di ogni numero\r\n\t\tSystem.out.println(\"Stampa il doppio di ogni numero\");\r\n\t\tnumberList.forEach((i)-> System.out.print(numberList.get(i-1)*2+ \" \"));\r\n\t\t\r\n\t\t//Recupera lo stream a partire dalla lista\r\n\t\tStream<Integer> streamInt = numberList.stream();\r\n\t\tSystem.out.println(\"\");\r\n\t\t//Stampa il quadrato di ogni numero\r\n\t\tSystem.out.println(\"Stampa il quadrato di ogni numero\");\r\n\t\tstreamInt.forEach((p)->System.out.print(p*p +\" \"));\r\n\t\t\r\n\t\t//Stampa i numeri Dispari\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"Stampa i numeri Dispari\");\t\t\r\n\t\tnumberList.stream().filter(n -> n % 2 != 0).forEach(System.out::print); \t\t\r\n\t\tSystem.out.println(\"\");\r\n\t\tnumberList.stream().filter(n -> n % 2 != 0).forEach((n)->System.out.print(n));\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t\tList<String> stringList = Arrays.asList(\"a1\", \"c6\", \"a2\", \"b1\", \"c2\", \"c1\", \"c5\", \"c3\");\r\n\t\tstringList.stream().filter(s -> s.startsWith(\"c\")).map(String::toUpperCase).sorted().forEach(System.out::println);\r\n\t\t\t\t\r\n\t\t//Stampa le donne della mia famiglia\r\n\t\tMyFamily myFamily = new MyFamily();\r\n\t\tSystem.out.println(\"Stampa le donne della mia famiglia\");\r\n\t\tmyFamily.getMyFamily().stream().filter((p)->p.isFemale()).forEach((p)->System.out.println(p));\r\n\t\t\r\n\t\t//Stampa gli uomini della mia famiglia\r\n\t\tSystem.out.println(\"Stampa gli uomini della mia famiglia\");\r\n\t\tmyFamily.getMyFamily().stream().filter((p)->!p.isFemale()).forEach((p)->System.out.println(p));\r\n\t\t\r\n\t\t//Calcola la somma dell'eta dei maschi della mia famiglia\r\n\t\tInteger anniMaschi = myFamily.getMyFamily().stream().filter((p)->!p.isFemale()).map((p)->p.getEta()).reduce(0, Integer::sum);\r\n\t\t\r\n\t\t//These reduction operations can run safely in parallel with almost no modification:\r\n\t\tInteger anniMaschi2 = myFamily.getMyFamily().stream().parallel().filter((p)->!p.isFemale()).map((p)->p.getEta()).reduce(0, Integer::sum);\t\t\r\n\t\tSystem.out.println(\"Anni Totali dei maschi...\" + anniMaschi);\r\n\t\tSystem.out.println(\"Anni Totali dei maschi...\" + anniMaschi2);\r\n\r\n\t\t\r\n\t}", "public IntStream stream(long size) {\n\treturn StreamSupport.intStream(spliterator(size), false);\n }", "@Test\r\n void limitMethod() {\r\n\t\tStream<TransactionBean> transactionBeanStream = transactions.stream().limit(2);\r\n\t\tList<TransactionBean> afterStreamList = transactionBeanStream.peek(System.out::println).collect(Collectors.toCollection(ArrayList::new));\r\n\t\tassertSame(\"wrong type\", 2, afterStreamList.size());\r\n }", "private void mapToIntUsingStream() {\n Stream.of(\"a1\", \"a2\", \"a3\")\n .map(s -> s.substring(1))\n .mapToInt(Integer::parseInt)\n .max()\n .ifPresent(System.out::println);\n }", "protected String traverseStream(InputStream stream){\n\n\t\tScanner input = new Scanner(stream);\n\t\tString res = \"\";\n\n\t\twhile(input.hasNext()){\n\t\t\tres += input.next() + \" \";\n\t\t}\n\n\t\treturn res;\n\t}", "public static void main(String[] args) {\n String[] words = {\"Hello\", \"World\"};\n List<String> uniqueChars = Arrays.stream(words)\n .map(word -> word.split(\"\"))\n .flatMap(Arrays::stream)\n .distinct()\n .collect(toList());\n\n System.out.println(uniqueChars);\n\n // Compute the squares of all numbers in a list\n List<Integer> squares = Stream.of(1, 2, 3, 4, 5)\n .map(n -> n * n)\n .collect(toList());\n\n System.out.println(squares);\n\n // Given two lists of numbers, return all pairs of numbers, keeping only those whose sum is\n // divisible by 3\n List<Integer> numbers1 = Arrays.asList(1, 2, 3);\n List<Integer> numbers2 = Arrays.asList(3, 4);\n\n List<String> pairs = numbers1.stream()\n .flatMap(i -> numbers2.stream()\n .filter(j -> (i + j) % 3 == 0)\n .map(j -> new int[] {i, j}))\n .map(Arrays::toString)\n .collect(toList());\n\n System.out.println(pairs);\n\n // Print a message only if a list of numbers contains an even number\n if (Stream.of(1, 2, 3, 5, 7).anyMatch(n -> n % 2 == 0)) {\n System.out.println(\"This list contains an even number\");\n } else {\n System.out.println(\"This list contains no even numbers\");\n }\n\n // Print a message only if a list of numbers contains all odd number\n if (Stream.of(1, 3, 5, 7).allMatch(n -> n % 2 == 1)) {\n System.out.println(\"This list contains all odd numbers\");\n } else {\n System.out.println(\"This list contains an even number\");\n }\n\n if (Stream.of(1, 3, 5, 7).noneMatch(n -> n % 2 == 0)) {\n System.out.println(\"This list contains all odd numbers\");\n } else {\n System.out.println(\"This list contains an even number\");\n }\n\n // Find any even number in a list of numbers\n // (findAny can return different results than findFirst with a parallel stream)\n Stream.of(1, 2, 3, 4, 5, 6, 7)\n .parallel()\n .filter(n -> n % 2 == 0)\n .findAny()\n .ifPresent(System.out::println);\n\n\n // Find the first even number in a list of numbers\n Stream.of(1, 2, 3, 4, 5, 6, 7)\n .parallel()\n .filter(n -> n % 2 == 0)\n .findFirst()\n .ifPresent(System.out::println);\n\n // REDUCE!!!!!\n // Using reduce to combine elements of a stream into a single value with having to mutate\n // external state in a non-threadsafe way\n\n // The non-functional way (not thread-safe; uses mutable accumulator anti-pattern)\n int sum = 0;\n for (int n : Arrays.asList(1, 2, 3, 4, 5)) {\n sum += n;\n }\n System.out.println(\"SUM: \" + sum);\n\n // The functional way (thread-safe)\n sum = Arrays.asList(1, 2, 3, 4, 5).stream()\n .parallel()\n .reduce(0, Integer::sum); // Integer::sum has type sig of (n1, n2) -> n1 + n2\n\n System.out.println(\"SUM: \" + sum);\n\n // Better yet from a readability perspective would be:\n sum = IntStream.of(1, 2, 3, 4, 5)\n .parallel()\n .sum();\n\n System.out.println(\"SUM: \" + sum);\n\n // Count number of objects in stream (threadsafe)\n // NOTE: You could also just use Arrays.asList(1, 2).stream().count()\n long count = Arrays.asList(1, 2, 3, 4, 5).stream()\n .parallel()\n .map(i -> 1L) // convert each number in the stream to a 1\n .reduce(0L, Long::sum); // Long::sum has type sig of (n1, n2) -> n1 + n2\n\n System.out.println(\"COUNT: \" + count);\n\n // Better yet from a readability perspective would be:\n count = IntStream.of(1, 2, 3, 4, 5)\n .parallel()\n .count();\n\n System.out.println(\"COUNT: \" + count);\n\n // Generate 7 Attributes using 4d6 and drop lowest (discard if less than 8), and keep only the\n // top 6; if at least one attribute is not 15 or greater, reroll them all.\n\n List<Integer> attributes;\n do {\n attributes = IntStream.range(0, 7)\n .map(i -> {\n int roll;\n do {\n roll = IntStream.range(0, 4)\n .map(j -> Die.D6.roll())\n .sorted()\n .skip(1)\n .sum();\n } while (roll < 8);\n return roll;\n })\n .sorted()\n .skip(1)\n .boxed()\n // Use collectingAndThen to perform a final transformation on the result\n .collect(collectingAndThen(toList(), Collections::unmodifiableList));\n\n } while (attributes.stream()\n .mapToInt(attr -> attr)\n .max().getAsInt() < 15);\n\n System.out.println(attributes.stream()\n .map(String::valueOf)\n .collect(joining(\", \", \"Attributes: \", \"\")));\n\n // Stream.iterate(T seed, UnaryOperator<T> f) --> generate unbounded stream\n // Generate first 20 numbers of Fibonacci series using Stream.iterate\n // Generate an unbounded stream of fibonacci tuples -> (0, 1), (1, 2), (2, 3), (3, 5)\n // then map each tuple to a single number by extracting the first element\n String series = Stream\n .iterate(new int[] {0, 1}, fibTuple -> new int[] {fibTuple[1], fibTuple[0] + fibTuple[1]})\n .parallel()\n .limit(20)\n .map(fibTuple -> fibTuple[0])\n .map(String::valueOf)\n .collect(Collectors.joining(\", \", \"(\", \")\"));\n\n System.out.println(\"Fibonacci: \" + series);\n\n // Stream.generate(Supplier<T> s) --> roll 4d6 drop lowest\n int roll = IntStream.generate(Die.D6::roll)\n .parallel()\n .limit(4)\n .sorted()\n .skip(1)\n .sum();\n System.out.println(\"Roll: \" + roll);\n\n\n }", "@CompileStatic\npublic interface Stream<T> {\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param mapper mapper returning iterable of values to be flattened into output\n * @return the remapped stream\n */\n default <X> Stream<X> flatMap(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Iterable<X>> mapper) {\n\n return flatMap(null, mapper);\n }\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param name name of the operation\n * @param mapper mapper returning iterable of values to be flattened into output\n * @return the remapped stream\n */\n <X> Stream<X> flatMap(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Iterable<X>> mapper);\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param mapper the mapping closure\n * @return remapped stream\n */\n default <X> Stream<X> map(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<X> mapper) {\n\n return map(null, mapper);\n }\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param name stable name of the mapping operator\n * @param mapper the mapping closure\n * @return remapped stream\n */\n <X> Stream<X> map(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<X> mapper);\n\n /**\n * Filter stream based on predicate\n *\n * @param predicate the predicate to filter on\n * @return filtered stream\n */\n default Stream<T> filter(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Boolean> predicate) {\n\n return filter(null, predicate);\n }\n\n /**\n * Filter stream based on predicate\n *\n * @param name name of the filter operator\n * @param predicate the predicate to filter on\n * @return filtered stream\n */\n Stream<T> filter(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Boolean> predicate);\n\n /**\n * Assign event time to elements.\n *\n * @param assigner assigner of event time\n * @return stream with elements assigned event time\n */\n default Stream<T> assignEventTime(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> assigner) {\n\n return assignEventTime(null, assigner);\n }\n\n /**\n * Assign event time to elements.\n *\n * @param name name of the assign event time operator\n * @param assigner assigner of event time\n * @return stream with elements assigned event time\n */\n Stream<T> assignEventTime(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> assigner);\n\n /**\n * Add window to each element in the stream.\n *\n * @return stream of pairs with window\n */\n default Stream<Pair<Object, T>> withWindow() {\n return withWindow(null);\n }\n\n /**\n * Add window to each element in the stream.\n *\n * @param name stable name of the mapping operator\n * @return stream of pairs with window\n */\n Stream<Pair<Object, T>> withWindow(@Nullable String name);\n\n /**\n * Add timestamp to each element in the stream.\n *\n * @return stream of pairs with timestamp\n */\n default Stream<Pair<T, Long>> withTimestamp() {\n return withTimestamp(null);\n }\n\n /**\n * Add timestamp to each element in the stream.\n *\n * @param name stable name of mapping operator\n * @return stream of pairs with timestamp\n */\n Stream<Pair<T, Long>> withTimestamp(@Nullable String name);\n\n /** Print all elements to console. */\n void print();\n\n /**\n * Collect stream as list. Note that this will result on OOME if this is unbounded stream.\n *\n * @return the stream collected as list.\n */\n List<T> collect();\n\n /**\n * Test if this is bounded stream.\n *\n * @return {@code true} if this is bounded stream, {@code false} otherwise\n */\n boolean isBounded();\n\n /**\n * Process this stream as it was unbounded stream.\n *\n * <p>This is a no-op if {@link #isBounded} returns {@code false}, otherwise it turns the stream\n * into being processed as unbounded, although being bounded.\n *\n * <p>This is an optional operation and might be ignored if not supported by underlying\n * implementation.\n *\n * @return Stream viewed as unbounded stream, if supported\n */\n default Stream<T> asUnbounded() {\n return this;\n }\n\n /**\n * Convert elements to {@link StreamElement}s.\n *\n * @param <V> type of value\n * @param repoProvider provider of {@link Repository}\n * @param entity the entity of elements\n * @param keyExtractor extractor of keys\n * @param attributeExtractor extractor of attributes\n * @param valueExtractor extractor of values\n * @param timeExtractor extractor of time\n * @return stream with {@link StreamElement}s inside\n */\n <V> Stream<StreamElement> asStreamElements(\n RepositoryProvider repoProvider,\n EntityDescriptor entity,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<CharSequence> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\")\n Closure<CharSequence> attributeExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> timeExtractor);\n\n /**\n * Persist this stream to replication.\n *\n * @param repoProvider provider of {@link Repository}.\n * @param replicationName name of replication to persist stream to\n * @param target target of the replication\n */\n void persistIntoTargetReplica(\n RepositoryProvider repoProvider, String replicationName, String target);\n\n /**\n * Persist this stream to specific family.\n *\n * <p>Note that the type of the stream has to be already {@link StreamElement StreamElements} to\n * be persisted to the specified family. The family has to accept given {@link\n * AttributeDescriptor} of the {@link StreamElement}.\n *\n * @param repoProvider provider of {@link Repository}.\n * @param targetFamilyname name of target family to persist the stream into\n */\n default void persistIntoTargetFamily(RepositoryProvider repoProvider, String targetFamilyname) {\n persistIntoTargetFamily(repoProvider, targetFamilyname, 10);\n }\n\n /**\n * Persist this stream to specific family.\n *\n * <p>Note that the type of the stream has to be already {@link StreamElement StreamElements} to\n * be persisted to the specified family. The family has to accept given {@link\n * AttributeDescriptor} of the {@link StreamElement}.\n *\n * @param repoProvider provider of {@link Repository}.\n * @param targetFamilyname name of target family to persist the stream into\n * @param parallelism parallelism to use when target family is bulk attribute family\n */\n void persistIntoTargetFamily(\n RepositoryProvider repoProvider, String targetFamilyname, int parallelism);\n\n /**\n * Persist this stream as attribute of entity\n *\n * @param <V> type of value extracted\n * @param repoProvider provider of repository\n * @param entity the entity to store the stream to\n * @param keyExtractor extractor of key for elements\n * @param attributeExtractor extractor for attribute for elements\n * @param valueExtractor extractor of values for elements\n * @param timeExtractor extractor of event time\n */\n <V> void persist(\n RepositoryProvider repoProvider,\n EntityDescriptor entity,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<CharSequence> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\")\n Closure<CharSequence> attributeExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> timeExtractor);\n\n /**\n * Directly write this stream to repository. Note that the stream has to contain {@link\n * StreamElement}s (e.g. created by {@link #asStreamElements}.\n *\n * @param repoProvider provider of repository\n */\n void write(RepositoryProvider repoProvider);\n\n /**\n * Create time windowed stream.\n *\n * @param millis duration of tumbling window\n * @return time windowed stream\n */\n WindowedStream<T> timeWindow(long millis);\n\n /**\n * Create sliding time windowed stream.\n *\n * @param millis duration of the window\n * @param slide duration of the slide\n * @return sliding time windowed stream\n */\n WindowedStream<T> timeSlidingWindow(long millis, long slide);\n\n /**\n * Create session windowed stream.\n *\n * @param <K> type of key\n * @param keyExtractor extractor of key\n * @param gapDuration duration of the gap between elements per key\n * @return session windowed stream\n */\n <K> WindowedStream<Pair<K, T>> sessionWindow(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n long gapDuration);\n\n /**\n * Create calendar-based windowed stream.\n *\n * @param window the resolution of the calendar window (\"days\", \"weeks\", \"months\", \"years\")\n * @param count number of days, weeks, months, years\n * @param timeZone time zone of the calculation\n * @return calendar windowed stream\n */\n WindowedStream<T> calendarWindow(String window, int count, TimeZone timeZone);\n\n /**\n * Group all elements into single window.\n *\n * @return globally windowed stream.\n */\n WindowedStream<T> windowAll();\n\n /**\n * Merge two streams together.\n *\n * @param other the other stream(s)\n * @return merged stream\n */\n default Stream<T> union(Stream<T> other) {\n return union(Arrays.asList(other));\n }\n\n /**\n * Merge two streams together.\n *\n * @param name name of the union operator\n * @param other the other stream(s)\n * @return merged stream\n */\n default Stream<T> union(@Nullable String name, Stream<T> other) {\n return union(name, Arrays.asList(other));\n }\n\n /**\n * Merge multiple streams together.\n *\n * @param streams other streams\n * @return merged stream\n */\n default Stream<T> union(List<Stream<T>> streams) {\n return union(null, streams);\n }\n\n /**\n * Merge multiple streams together.\n *\n * @param name name of the union operator\n * @param streams other streams\n * @return merged stream\n */\n Stream<T> union(@Nullable String name, List<Stream<T>> streams);\n\n /**\n * Transform this stream using stateful processing.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @param stateUpdate update (accumulation) function for the state the output is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKey(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKey(\n null, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate);\n }\n\n /**\n * Transform this stream using stateful processing without time-sorting.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @param stateUpdate update (accumulation) function for the state the output is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKeyUnsorted(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKeyUnsorted(\n null, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate);\n }\n\n /**\n * Transform this stream using stateful processing.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param name optional name of the stateful operation\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param stateUpdate update (accumulation) function for the state\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKey(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKey(\n name, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate, true);\n }\n\n /**\n * Transform this stream using stateful processing without time-sorting.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param name optional name of the stateful operation\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param stateUpdate update (accumulation) function for the state\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKeyUnsorted(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKey(\n name, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate, false);\n }\n\n /**\n * Transform this stream using stateful processing.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param name optional name of the stateful operation\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param stateUpdate update (accumulation) function for the state\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @param sorted {@code true} if the input to the state update function should be time-sorted\n * @return the statefully reduced stream\n */\n <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKey(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate,\n boolean sorted);\n\n /**\n * Transform this stream to another stream by applying combining transform in global window\n * emitting results after each element added. That means that the following holds: * the new\n * stream will have exactly the same number of elements as the original stream minus late elements\n * dropped * streaming semantics need to define allowed lateness, which will incur real time\n * processing delay * batch semantics use sort per key\n *\n * @param <K> key type\n * @param <V> value type\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialValue closure providing initial value of state for key\n * @param combiner combiner of values to final value\n * @return the integrated stream\n */\n default <K, V> Stream<Pair<K, V>> integratePerKey(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<V> initialValue,\n @ClosureParams(value = FromString.class, options = \"V,V\") Closure<V> combiner) {\n\n return integratePerKey(null, keyExtractor, valueExtractor, initialValue, combiner);\n }\n\n /**\n * Transform this stream to another stream by applying combining transform in global window\n * emitting results after each element added. That means that the following holds: * the new\n * stream will have exactly the same number of elements as the original stream minus late elements\n * dropped * streaming semantics need to define allowed lateness, which will incur real time\n * processing delay * batch semantics use sort per key\n *\n * @param <K> key type\n * @param <V> value type\n * @param name optional name of the transform\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialValue closure providing initial value of state for key\n * @param combiner combiner of values to final value\n * @return the integrated stream\n */\n <K, V> Stream<Pair<K, V>> integratePerKey(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<V> initialValue,\n @ClosureParams(value = FromString.class, options = \"V,V\") Closure<V> combiner);\n\n /** Reshuffle the stream via random key. */\n default Stream<T> reshuffle() {\n return reshuffle(null);\n }\n\n /**\n * Reshuffle the stream via random key.\n *\n * @param name name of the transform\n */\n @SuppressWarnings(\"unchecked\")\n Stream<T> reshuffle(@Nullable String name);\n}", "public static void main(final String[] args)\n {\n final Supplier<ArrayList<String>> proveedor = ArrayList::new;\n\n // Aqui tenemos el acumulador, el que añadira cada elemento del stream al proveedor definido\n // arriba\n // BiConsumer<ArrayList<String>, String> acumulador = (list, str) -> list.add(str);\n final BiConsumer<ArrayList<String>, String> acumulador = ArrayList::add;\n\n // Aquí tenemos el combinador, ya que por ejemplo al usar parallelStream, cada hijo generara\n // su propio proveedor, y al final deberan combinarse\n final BiConsumer<ArrayList<String>, ArrayList<String>> combinador = ArrayList::addAll;\n\n final List<Empleado> empleados = Empleado.empleados();\n final List<String> listNom = empleados.stream()\n .map(Empleado::getNombre)\n .collect(ArrayList::new, ArrayList::add, ArrayList::addAll);\n System.out.println(listNom);\n\n // Usando Collectors\n final List<String> listNom2 = empleados.stream()\n .map(Empleado::getNombre)\n .collect(Collectors.toList());\n System.out.println(listNom2);\n\n final Set<String> listNom3 = empleados.stream()\n .map(Empleado::getNombre)\n .collect(Collectors.toSet());\n System.out.println(listNom3);\n\n final Collection<String> listNom4 = empleados.stream()\n .map(Empleado::getNombre)\n .collect(Collectors.toCollection(TreeSet::new));\n System.out.println(listNom4);\n\n // Ahora con mapas\n final Map<Long, String> map = empleados.stream()\n .collect(Collectors.toMap(Empleado::getId, Empleado::getNombre));\n System.out.println(map);\n\n final Map<Genero, String> map2 = empleados.stream()\n .collect(Collectors.toMap(Empleado::getGenero, Empleado::getNombre,\n (nom1,\n nom2) -> String.join(\", \", nom1, nom2)));\n System.out.println(map2);\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Create Stream of Object\\n\");\n\t\tStream<String> stream= Stream.of(\"Saliou\",\"Fatimatou\",\"Mahdiyou\",\"Kolon\");\n\t stream.forEach(System.out::println);\n\t \n // Create Stream from Objects from Collection\n\t\tSystem.out.println(\" \\n\\nCreate Stream Object from collection\\n\");\n\t Collection<String> collection=Arrays.asList(\"Saliou\",\"Fatimatou\",\"Mahdiyou\",\"Kolon\");\n\t Stream<String> stream2=collection.stream();\n\t stream2.forEach(System.out::println);\n\t \n\t //Create Stream Object from Collection\n\t System.out.println(\"\\n\\nCreate Stream Object from List\");\n\t List<String> list= Arrays.asList(\"Modou\",\"Fatou\",\"Saliou\",\"Samba\");\n\t Stream<String> stream3=list.stream();\n\t stream3.forEach(System.out::println);\n\t \n\t //Create Stream Object from Set\n\t System.out.println(\"\\n Create Stream from Set\");\n\t Set<String> set= new HashSet<>(list);\n\t Stream<String> stream4= set.stream();\n\t stream4.forEach(System.out::println);\n\t \n\t //Create Stream Object from Arrays\n\t System.out.println(\"\\nCreate Stream Object from Arrays\");\n\t ArrayList<String> array= new ArrayList<>(list);\n\t Stream<String> stream5= array.stream();\n\t stream5.forEach(System.out::println);\n\t \n\t //Create Stream from Array of String\n\t System.out.println(\"\\n Create Stream from Array of String\");\n\t String[] strArray= {\"Saliou\",\"Fatimatou\",\"Mahdiyou\",\"Kolon\"};\n\t Stream<String> stream6=Arrays.stream(strArray);\n\t stream6.forEach(System.out::println);\n\t \n\t \n\t}", "public static void main(String[] args) {\n IntStream myIntStream = IntStream.range(1, 20);\n List<Integer> sortedReverse = myIntStream.boxed().sorted((a, b) -> b - a).collect(Collectors.toList());\n System.out.println(sortedReverse);\n Collections.sort(sortedReverse, Comparator.comparing(a-> a.intValue()));\n Collections.sort(sortedReverse, Integer::compareTo);\n\n String[] stringArray = { \"Barbara\", \"James\", \"Mary\",\n \"John\", \"Patricia\", \"Robert\", \"Michael\", \"Linda\" };\n\n\n Arrays.sort(stringArray, String::compareToIgnoreCase);\n\n System.out.println(IntStream.range(1, 5).sum());\n System.out.println(IntStream.range(1, 5).reduce(100,(a,b)-> a+b));\n\n // Local Date and Time\n LocalDateTime timePoint = LocalDateTime.now( ); // The current date and time\n LocalDate myLocalDate = LocalDate.now().plusDays(10);\n\n List<String> myList = List.of(stringArray);\n long count = myList.parallelStream()\n .peek(a-> System.out.println(\"Processing \"+a + \" \"+a.length()))\n .map(a-> a.toUpperCase())\n .peek(a-> System.out.println(\"Upper Case: \"+a))\n .map(a-> a.length())\n .filter(a-> a>5)\n .count();\n\n System.out.println(\"Name length greater than 5 is: \"+ count);\n\n }", "public static void sorting() {\n List<String> wordList = new ArrayList<>();\n for (int i = 0; i < 500000; i++)\n wordList.add(UUID.randomUUID().toString());\n\n //Sort and filter the list using compare to sequentially\n long t1s = System.nanoTime();\n List<String> a =wordList.stream()\n .filter((String s) -> s.contains(\"Z\") ? true : false)\n .sorted((s1, s2) -> s1.compareTo(s2))\n .collect(Collectors.toList());\n long t1d = System.nanoTime() - t1s;\n\n //Sort and filter the list using compare to in parallel\n long t2s = System.nanoTime();\n List<String> b = wordList.parallelStream()\n .filter((String s) -> s.contains(\"Z\") ? true : false)\n .sorted((s1, s2) -> s1.compareTo(s2))\n .collect(Collectors.toList());\n long t2d = System.nanoTime() - t2s;\n\n System.out.println(\"Filter + Sort Serial time : \" + t1d);\n System.out.println(\"Filter + Sort Parallel time : \" + t2d);\n }", "private static InputStream merge(InputStream ... arrays) throws IOException {\n\t\tMinHeap heap = new MinHeap();\n\t\tfor(int k = 0; k < arrays.length; k++) {\n\t\t\tElement element = new Element(arrays[k]);\n\t\t\tif(element.hasMoreElement()) {\n\t\t\t\theap.insert(element);\n\t\t\t}\n\t\t}\n\t\treturn new MergedIntegerStream(heap);\n\t}", "private void verifyNumbersPrimeWitStream(){\n\t\tList<Integer> primeList = IntStream.range(2, Integer.MAX_VALUE)\n\t\t\t\t.filter(n -> isPrime(n))\n\t\t\t\t.limit(primes.length)\n\t\t\t\t.boxed()\n\t\t\t\t.collect(Collectors.toList());\n\t\tprimes = primeList.stream().mapToInt(i->i).toArray();\n\t}", "@Test\n public void lab5() {\n StudentService ss = new StudentService();\n Utils.fillStudents(ss);\n\n List<Student> students = ss.getAllStudents();\n\n //List<Long> listOfAges = students.stream()\n Set<Long> listOfAges = students.stream()\n .filter(s -> s.getStatus() == Student.Status.HIBERNATING)\n .map(s -> s.getDob().until(LocalDate.now(), ChronoUnit.YEARS))\n .collect(toSet());\n\n\n }", "public static void main(String[] args) \r\n{\n\tList<Integer> numbers = Arrays.asList(3, 2, 2, 3, 7, 3, 5);\r\n\r\n\t//get list of unique squares\r\n\tList<Integer> squaresList = numbers.stream().map( i -> i*i).distinct().collect(Collectors.toList());\r\n\tSystem.out.println(squaresList);\r\n//\tList<String>strings = Arrays.asList(\"abc\", \"\", \"bc\", \"efg\", \"abcd\",\"\", \"jkl\");\r\n//\r\n//\t//get count of empty string\r\n////\tlong count = strings.stream().filter(string -> string.isEmpty()).count();\r\n////\tSystem.out.println(count);\r\n//\tList<String>strings1 = Arrays.asList(\"abc\", \"\", \"bc\", \"efg\", \"abcd\",\"\", \"jkl\");\r\n//\tList<String> filtered = strings1.stream().filter(string -> !string.isEmpty()).collect(Collectors.toList());\r\n//\r\n//\tSystem.out.println(\"Filtered List: \" + filtered);\r\n//\tString mergedString = strings1.stream().filter(string -> !string.isEmpty()).collect(Collectors.joining());\r\n//\tSystem.out.println(\"Merged String: \" + mergedString);\r\n//}\r\n}", "private void sampleOfTheGeneratedWindowedAggregate() {\n Iterator<Integer[]> iterator = null;\n\n // builder3\n Integer[] rows = iterator.next();\n\n int prevStart = -1;\n int prevEnd = -1;\n\n for ( int i = 0; i < rows.length; i++ ) {\n // builder4\n Integer row = rows[i];\n\n int start = 0;\n int end = 100;\n if ( start != prevStart || end != prevEnd ) {\n // builder5\n int actualStart = 0;\n if ( start != prevStart || end < prevEnd ) {\n // builder6\n // recompute\n actualStart = start;\n // implementReset\n } else { // must be start == prevStart && end > prevEnd\n actualStart = prevEnd + 1;\n }\n prevStart = start;\n prevEnd = end;\n\n if ( start != -1 ) {\n for ( int j = actualStart; j <= end; j++ ) {\n // builder7\n // implementAdd\n }\n }\n // implementResult\n // list.add(new Xxx(row.deptno, row.empid, sum, count));\n }\n }\n // multiMap.clear(); // allows gc\n // source = Linq4j.asEnumerable(list);\n }", "IStreamList<T> transform(IStreamList<T> dataset);", "@Test\r\n void filterMethod() {\r\n\t\tStream<TransactionBean> transactionBeanStream = transactions.stream().filter(t -> t.getType() == Transaction.GROCERY);\r\n\t\tList<TransactionBean> afterStreamList = transactionBeanStream.peek(System.out::println).collect(Collectors.toCollection(ArrayList::new));\r\n\t\tassertSame(\"wrong type\", Transaction.GROCERY, afterStreamList.get(0).getType());\r\n\t\tassertSame(\"wrong type\", Transaction.GROCERY, afterStreamList.get(1).getType());\r\n }", "public static void concurrency() {\n List<String> words = new ArrayList<>();\n for (int i = 0; i < 500000; i++)\n words.add(UUID.randomUUID().toString());\n\n //Groups the list into a map of strings by length in serial\n long t2s = System.nanoTime();\n Map<Integer, List<String>> a = words.stream()\n .collect(Collectors.groupingBy(String::length));\n long t2d = System.nanoTime() - t2s;\n\n //Groups the list into a map of strings by length in parallel\n long t1s = System.nanoTime();\n ConcurrentMap<Integer, List<String>> b = words.parallelStream()\n .collect(Collectors.groupingByConcurrent(String::length));\n long t1d = System.nanoTime() - t1s;\n\n System.out.println(\"Collect Serial time : \" + t2d);\n System.out.println(\"Collect Parallel time : \" + t1d);\n }", "@Test\n public void test1(){\n\n// List<String> list= new ArrayList<String>();\n// list.add(\"张三\");\n// list.add(\"李四\");\n// list.add(\"王五\");\n// list.add(\"马六\");\n// System.out.println(list.get(0));\n//\n// list.forEach(li-> System.out.println(li+\"干什么\"));\n//// Runnable no=() -> System.out.println(\"hello\");\n//\n// Complex complex=new Complex(2,3);\n//\n// Complex c=new Complex(5,3);\n// Complex cc=c.plus(complex);\n// System.out.println(cc.toString()+\"11111111111111111111\");\n List<String> data = new ArrayList<>();\n data.add(\"张三\");\n data.add(\"李四\");\n data.add(\"王三\");\n data.add(\"马六\");\n data.parallelStream().forEach(x-> System.out.println(x));\n System.out.println(\"--------------------\");\n data.stream().forEach(System.out::println);\n System.out.println(\"+++++++++++++++++\");\n List<String> kk=data.stream().sorted().limit(2).collect(Collectors.toList());\n kk.forEach(System.out::println);\n List<String> ll=data.stream()\n .filter(x -> x.length() == 2)\n .map(x -> x.replace(\"三\",\"五\"))\n .sorted()\n .filter(x -> x.contains(\"五\")).collect(Collectors.toList());\n ll.forEach(string-> System.out.println(string));\n for (String string:ll) {\n System.out.println(string);\n }\n ll.stream().sorted().forEach(s -> System.out.println(s));\n// .forEach(System.out::println);\n Thread thread=new Thread(()->{ System.out.println(1); });\n thread.start();\n\n LocalDateTime currentTime=LocalDateTime.now();\n\n System.out.println(\"当前时间\"+currentTime);\n LocalDate localDate=currentTime.toLocalDate();\n System.out.println(\"当前日期\"+localDate);\n\n Thread tt=new Thread(()-> System.out.println(\"111\"));\n }", "@Test\n public void testCombinePageRankTfIdf() {\n\n Iterator<Pair<Document, Double>> resultIterator = icsSearchEngine.searchQuery(\n Arrays.asList(\"ISG\", \"Bren\", \"School\", \"UCI\"),\n 100, 100.0);\n ImmutableList<Pair<Document, Double>> resultList = ImmutableList.copyOf(resultIterator);\n\n // first result should be \"isg.ics.uci.edu\"\n Assert.assertEquals(\"isg.ics.uci.edu\", getDocumentUrl(resultList.get(0).getLeft().getText()));\n\n // top 10 should have URLs starting \"hobbes.ics.uci.edu\"\n Assert.assertTrue(resultList.stream().limit(10).map(p -> getDocumentUrl(p.getLeft().getText()))\n .anyMatch(p -> p.contains(\"hobbes.ics.uci.edu\")));\n\n // top 50 should have URL \"ipubmed2.ics.uci.edu\"\n Assert.assertTrue(resultList.stream().limit(50).map(p -> getDocumentUrl(p.getLeft().getText()))\n .anyMatch(p -> p.equals(\"ipubmed2.ics.uci.edu\")));\n\n }", "@SuppressWarnings(\"unused\")\n\tprivate static int[] pureStreamStrategy(String word) {\n\t\treturn word.codePoints()\n\t\t\t\t.filter(Character::isLetter)\n\t\t\t\t.map(Character::toUpperCase)\n\t\t\t\t.boxed()\n\t\t\t\t.collect(\n\t\t\t\t\tCollectors.groupingBy(\n\t\t\t\t\t\tcp -> cp,\n\t\t\t\t\t\tTreeMap::new,\n\t\t\t\t\t\tCollectors.summingInt(cp -> 1)\n\t\t\t\t\t)\n\t\t\t\t).entrySet().stream()\n\t\t\t\t.flatMap(e -> Stream.of(e.getKey(), e.getValue()))\n\t\t\t\t.mapToInt(i -> i)\n\t\t\t\t.toArray()\n\t\t;\n\t}", "private void convertTransactionToBitStream(){\n bitTransactionList = new ArrayList<>();\n itemListMap2 = new HashMap<>();\n \n for(int i=0; i<transactions_set.size(); i++){\n ArrayList curr_tr = transactions_set.get(i);\n \n if(curr_tr.size() >= min_itemset_size_K){ \n int freqItem = 0;\n BitSet bitset = new BitSet(bitsetLen);\n \n for(int j=0; j<curr_tr.size(); j++){\n try{\n int item = (int)curr_tr.get(j);\n bitset.set(itemIndex.get(item), true);\n freqItem++;\n }\n catch(Exception e){}\n }\n if(freqItem >= min_itemset_size_K){\n bitTransactionList.add(bitset);\n// System.out.println(bitset);\n HashSet<BitSet> subset_2 = createSubsetsOfLen2(bitset);\n for(BitSet sub_b : subset_2){\n itemListMap2.put(sub_b, itemListMap2.getOrDefault(sub_b, 0)+1);\n }\n }\n }\n }\n \n itemListMap2.values().removeIf(val -> val<min_sup);\n }", "@Test\n public void t2() {\n List<StableCommit> stableCommitList = getStableCommits().stream().filter(commit ->\n commit.getFilePath().equals(\"src/java/org/apache/commons/lang/builder/HashCodeBuilder.java\") && commit.getLevel() == 1).collect(Collectors.toList());\n // it has been through 9 different refactorings\n List<RefactoringCommit> refactoringCommitList = getRefactoringCommits().stream().filter(commit ->\n commit.getFilePath().equals(\"src/java/org/apache/commons/lang/builder/HashCodeBuilder.java\")).collect(Collectors.toList());\n\n Assert.assertEquals(4, stableCommitList.size());\n Assert.assertEquals(8, refactoringCommitList.size());\n\n Assert.assertEquals(\"5c40090fecdacd9366bba7e3e29d94f213cf2633\", stableCommitList.get(0).getCommit());\n\n // then, it was refactored two times (in commit 5c40090fecdacd9366bba7e3e29d94f213cf2633)\n Assert.assertEquals(\"5c40090fecdacd9366bba7e3e29d94f213cf2633\", refactoringCommitList.get(0).getCommit());\n Assert.assertEquals(\"5c40090fecdacd9366bba7e3e29d94f213cf2633\", refactoringCommitList.get(1).getCommit());\n\n // It appears 3 times\n Assert.assertEquals(\"379d1bcac32d75e6c7f32661b2203f930f9989df\", stableCommitList.get(1).getCommit());\n Assert.assertEquals(\"d3c425d6f1281d9387f5b80836ce855bc168453d\", stableCommitList.get(2).getCommit());\n Assert.assertEquals(\"3ed99652c84339375f1e6b99bd9c7f71d565e023\", stableCommitList.get(3).getCommit());\n }", "@Test\n public void shouldDownloadAllUrls() throws Exception {\n //given\n Flowable<URL> urls = Urls.all();\n\n\n/* final Flowable<String> htmls2 = urls\n .flatMap(url -> UrlDownloader.download(url)\n .subscribeOn(Schedulers.io())); //ojo al subscribeon\n\n\n Flowable<Pair<String, String>> gel = urls.map(s -> {\n final String[] html = {\"\"};\n final String[] gelote = new String[1];\n\n UrlDownloader.download(s).subscribe(value -> {\n gelote[0] = value;\n });\n String result = gelote[0];\n return Pair.of(s.toURI().toString(), gelote[0]);\n });\n\n //\n Flowable<String> htmls =\n urls.flatMap(url -> UrlDownloader.download(url).subscribeOn(Schedulers.io()));\n\n Flowable<Pair<URL, Flowable<String>>> broken = urls.map(url -> Pair.of(url, UrlDownloader.download(url)));\n\n urls.flatMap(url -> {\n final Flowable<String> html = UrlDownloader.download(url);\n Flowable<Pair<URL,String>> var =html.map(htmlstr->Pair.of(url,htmlstr));\n return var;\n });\n\n */\n Flowable<Pair<URI, String>> pairs = urls.flatMap(url -> UrlDownloader.download(url)\n .subscribeOn(Schedulers.io())\n .map(htmlstr -> Pair.of(toUri(url), htmlstr)));\n\n\n //no confundir toMap con map\n //Maybe: 0..1 values\n //Single 1 value\n //Completable 0 values\n //Flowable 0...infinity\n //single es un stream que solo tiene un valor\n Single<Map<URI, String>> var = pairs.toMap((Pair<URI, String> pair) -> pair.getLeft(), (Pair<URI, String> pair) -> pair.getRight());\n Map<URI, String> bodies2 = var.blockingGet();\n Map<URI, String> bodies = pairs.toMap(Pair::getLeft, Pair::getRight).blockingGet();\n TimeUnit.SECONDS.sleep(20);\n\n //when\n //WARNING: URL key in HashMap is a bad idea here\n\n //No mutar el mapa del suscribe , en vez de eso, use toMap()\n //con confundir con el operador map()\n //blocking*\n\n\n /*Map<URI, String> bodies = new HashMap<>();*/\n\n/*\n gel.toMap(s.getLeft());\n gel.subscribe(System.out::println);\n*/\n\n //then\n assertThat(bodies).hasSize(996);\n assertThat(bodies).containsEntry(new URI(\"http://www.twitter.com\"), \"<html>www.twitter.com</html>\");\n assertThat(bodies).containsEntry(new URI(\"http://www.aol.com\"), \"<html>www.aol.com</html>\");\n assertThat(bodies).containsEntry(new URI(\"http://www.mozilla.org\"), \"<html>www.mozilla.org</html>\");\n }", "WindowedStream<T> windowAll();", "@Test\n public void onlyWithMap(){\n Observable<Observable<PhoneNumber>> usersPhonesNumbers = costService\n .findUserInDepartment(DEPARTMENT_ID)\n .map(costService::findPhoneNumber);//<-- returns observable\n\n //Strange type here :o\n Observable<Observable<BigDecimal>> priceStream = usersPhonesNumbers\n .map(phones -> phones.map(costService::getPricePerSmsForNumber));\n\n Observable<BigDecimal> costPerPerson = priceStream.map(userPhones -> userPhones.reduce(ZERO, BigDecimal::add).blockingGet());//blockingGet<---only one difference in comparison to streams\n\n BigDecimal totalCost = costPerPerson.reduce(ZERO, BigDecimal::add).blockingGet(); //blockingGet<---only one difference in comparison to streams\n log.info(\"Total cost of sending SMSes to all users all phones {}\", totalCost);\n }", "public static void main(String[] args) {\n\t int[] array= {1, 2, 3, 5, 465, 2, 8, 6, 8};\n System.out.println(hasDuplicates(array));\n System.out.println(hasDuplicates2(array));\n System.out.println(hasDuplicates3(array));\n\n String s1 = \"Hello World\";\n StringBuilder sb= new StringBuilder(s1);\n String reversed = sb.reverse().toString();\n System.out.println(reversed);\n\n Student jhony = new Student(\"John\", LocalDate.of(2000, Month.MAY,17), 85);\n Student paul = new Student(\"Paul\", LocalDate.of(1999, Month.JULY,1), 90);\n Student kolya = new Student(\"Kolya\", LocalDate.of(2002, Month.APRIL,6), 70);\n Student sasha = new Student(\"Sasha\", LocalDate.of(2005, Month.NOVEMBER,24), 29);\n Student tom = new Student(\"Tom\", LocalDate.of(2001, Month.JANUARY,2), 10);\n\n List<Student> students= new ArrayList<>();\n students.add(jhony);\n students.add(paul);\n students.add(kolya);\n students.add(sasha);\n students.add(tom);\n// for (Student student:students) {\n// //if(student.getMarkJava()<50) System.out.println(student.getName());\n// if(student.getBirthday().getYear()>2000) System.out.println(student.getName());\n// }\n students.stream().filter(student -> student.getMarkJava()>50)\n .forEach(System.out::println);\n System.out.println(students.stream().filter(el -> el.getMarkJava() > 80).count());\n System.out.println(students.stream().max(Comparator.comparing(student -> student.getMarkJava())));\n System.out.println(students.stream().mapToInt(student -> student.getMarkJava()).max().getAsInt());\n System.out.println(students.stream().mapToInt(student -> student.getMarkJava()).min().getAsInt());\n System.out.println(students.stream().mapToInt(student -> student.getMarkJava()).sum());\n System.out.println(students.stream().mapToInt(student -> student.getMarkJava()).average().getAsDouble());\n System.out.println(students.stream().count());\n\n PartTimeEmployee ivan = new PartTimeEmployee(\"Ivan\",15,80);\n FullTimeEmployee vasya = new FullTimeEmployee(\"Vasya\",2,15,\"coder\");\n List<IAccounting> workers = new ArrayList<>();\n workers.add(ivan);\n workers.add(vasya);\n System.out.println(workers);\n\n }", "@Test\r\n void multiLevelFilter() {\r\n\t\tStream<TransactionBean> transactionBeanStream = transactions.stream().filter(t -> t.getType() == Transaction.GROCERY).filter(t -> \"r3\".equals(t.getValue()));\r\n\t\tList<TransactionBean> afterStreamList = transactionBeanStream.peek(System.out::println).collect(Collectors.toCollection(ArrayList::new));\r\n\t\tassertSame(\"wrong type\", Transaction.GROCERY, afterStreamList.get(0).getType());\r\n\t\tassertSame(\"wrong value\", \"r3\", afterStreamList.get(0).getValue());\r\n }", "public static void main(String[] args) {\n\t\tStream<Integer> intStream = Stream.of(1, 2, 3, 4);\n\t\t// intStream.forEach(System.out::println);\n\n\t\t/*\n\t\t * Approach 2 of declaring a stream objects with range of elements from 1-10\n\t\t * where last range element is not considered while printing or for any //\n\t\t * operation like sum, average, etc.\n\t\t * \n\t\t * We have IntStream, DoubleStream, etc to handle primitive values inside\n\t\t * streams...\n\t\t */\n\n\t\tIntStream.range(1, 10).forEach(e -> System.out.println(\"IntStream values from 1-10 range: \" + e)); // This will\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// print\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// numbers\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// from 1-9\n\n\t\t// Sometimes,we really want to create Streams dynamically instead of sequential\n\t\t// int values as above. We can use iterate method to to that.\n\t\tIntStream.iterate(1, e -> e * 2).limit(10).forEach(System.out::println);// Priting square numbers\n\n\t\tIntStream.iterate(2, e -> e + 2).limit(10).peek(System.out::println);// Printing even numbers\n\n\t\t/*\n\t\t * Convert these primitive streams to List For that we need to do a boxing\n\t\t * operation on top of stream\n\t\t */\n\n\t\tSystem.out.println(\"Converting IntStream to List...\");\n\t\tIntStream.range(1, 10).limit(5).boxed().collect(Collectors.toList()).forEach(System.out::println);\n\n\t\t/*\n\t\t * Lets explore some concepts on Strings...How stream works on strings and its\n\t\t * related operations\n\t\t */\n\n\t\t// Stream courseStream = Stream.of(\"Spring\", \"API\", \"AWS\", \"Java\", \"JavaFP\");\n\t\tList<String> courses = List.of(\"Spring\", \"API\", \"AWS\", \"Java\", \"JavaFP\");\n\t\tList<String> courses2 = List.of(\"Spring\", \"API\", \"AWS\", \"Java\", \"JavaFP\");\n\t\t// If we want to join these values\n\n\t\tSystem.out.println(courses.stream().collect(Collectors.joining()));\n\n\t\t/*\n\t\t * Lets say, if i want tp split each string in stream seprated by comma..\n\t\t */\n\t\tSystem.out.println(\"String opeartaion within Streams....\");\n\t\t// The below one prints all stream Objects that executed on top of split\n\t\t// function. So, we need to flatMap it to extract the actual result\n\t\tSystem.out.println(courses.stream().map(course -> course.toString().split(\",\")).collect(Collectors.toList()));\n\t\tSystem.out.println(\n\t\t\t\tcourses.stream().map(course -> course.split(\"\")).flatMap(Arrays::stream).collect(Collectors.toList()));\n\n\t\tSystem.out.println(\"Tuples strings : \"\n\t\t\t\t+ courses.stream().flatMap(course -> courses2.stream().map(course2 -> List.of(course, course2)))\n\t\t\t\t\t\t.collect(Collectors.toList()));\n\n\t\t/**\n\t\t * Higher Order Functions... Higher Order function is a function that returns a\n\t\t * function... In simpler terms, a method that returns a Predicate which\n\t\t * contains logic. So, here we are using method logic as a normal data and\n\t\t * returning it from an another method..\n\t\t */\n\n\t\tList<Courses> courseList = List.of(new Courses(1, \"Java\", 5000, 5), new Courses(2, \"AWS\", 4000, 4));\n\t\t// If we want to get courses whcih has number of students greater than 4000,\n\t\t// then we need to write a predicate for that first\n\t\tint numberOfStudentsThreshhold = 4000;\n\t\tPredicate<Courses> numberOfStudentsPredicate = numberOfStudentsPredecateMethod(numberOfStudentsThreshhold);\n\n\t\tSystem.out.println(\"Courses that has score>4000 : \"\n\t\t\t\t+ courseList.stream().filter(numberOfStudentsPredicate).collect(Collectors.toList()));\n\n\t}", "default Stream<E> parallelStream() {\n return StreamSupport.stream(spliterator(), true);\n }", "private static void compressStream(Map<Byte, byte[]> dictionary,\n OutputStream outs) throws IOException {\n int current_pos = 0;\n byte[] byteStream = new byte[dictionary.size()*2];\n boolean patternExistTwice = false;\n for (Byte key : dictionary.keySet()) {\n patternExistTwice =\n doesPatternExistTwice(dictionary, dictionary.get(key));\n\n // If the pattern already exists twice in the dictionary then it is\n // definitely the end of the dictionary\n if (patternExistTwice && key == dictionary.size()) {\n if (dictionary.get(key).length == 1) {\n byteStream[current_pos] = 0;\n current_pos++;\n } else {\n int realKey =\n getKeyOfSubstring(dictionary, dictionary.get(key));\n byteStream[current_pos] = (byte) realKey;\n current_pos++;\n }\n byteStream[current_pos] = Util.getLastByte(dictionary.get(key));\n current_pos++;\n break;\n }\n\n // Write Node number following by last byte of the corresponding\n // value.\n else {\n if (dictionary.get(key).length == 1) {\n byteStream[current_pos] = 0;\n current_pos++;\n } else {\n int realKey =\n getKeyOfSubstring(dictionary, dictionary.get(key));\n byteStream[current_pos] = (byte) realKey;\n current_pos++;\n }\n byteStream[current_pos] = Util.getLastByte(dictionary.get(key));\n current_pos++;\n }\n }\n\n outs.write(byteStream);\n }", "public String joinedStream(Stream strm) {\n\t\tString str = \"\";\n\t\tstr += joinStreamInfo(strm);\n\t\tMap<String, Set<String>> joinSet = new HashMap<String, Set<String>>();\n\t\tSet<String> newVal = new HashSet<String>();\n\t\tfor (Window win : strm.getFrom().getList()) { //All streamwindows used in the current stream\n\t\t\tif(streamSet.contains(win.getName()))\n\t\t\t\tcontinue; //if stream is generated by starql -> skip\t\n\t\t\tif(win.getName().contains(\"_\")){\n\t\t\t\tString key = win.getName().substring(0,\n\t\t\t\t\t\twin.getName().indexOf(\"_\"));\n\t\t\t\tif(isHistorical())\n\t\t\t\t\tHelperFunctions.mapToSet(joinSet, key, win.getName().substring(win.getName().indexOf(\"_\")) + \"_stream\");\n\t\t\t\telse\n\t\t\t\t\tHelperFunctions.mapToSet(joinSet, key, win.getName().substring(win.getName().indexOf(\"_\")));\n\t\t\t\tnewVal.clear();\n\t\t\t}else{\n\t\t\t\tif(isHistorical())\n\t\t\t\t\tHelperFunctions.mapToSet(joinSet, win.getName(), win.getName()+\"_stream\");\n\t\t\t\telse\n\t\t\t\t\tHelperFunctions.mapToSet(joinSet, win.getName(), win.getName());\n\t\t\t}\n\t\t}\n\t\t\n\t\tstreamSet.clear();\n\t\tstreamSet.addAll(joinSet.keySet());\n\t\tstreamSet.addAll(streamSet2);\n\t\tif(!joinSet.isEmpty()){\t\n\t\t\tIterator it = joinSet.entrySet().iterator();\n\t\t\twhile (it.hasNext()) {\t\t\t\t\n\t\t\t\tMap.Entry mapEntry = (Map.Entry) it.next();\t\t\t\t\n\t\t\t\tstr += \"\\r\\n\"+genTableStr;\n\t\t\t\tstr += mapEntry.getKey() + \" AS WCACHE \\r\\n\";\n\t\t\t\tstr += \"SELECT * FROM\\r\\n \";\n\t\t\t\tboolean first2 = true;\n\t\t\t\tfor (String val : (Set<String>) mapEntry.getValue()) {\n\t\t\t\t\tif(((Set<String>) mapEntry.getValue()).size() == 1 && !mapEntry.getKey().toString().contains(\"_\") ){\n\t\t\t\t\t\tstr += val;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(((Set<String>) mapEntry.getValue()).size() == 1){\n\t\t\t\t\t\t\tstr += mapEntry.getKey() + val;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tif (first2) {\n\t\t\t\t\t\t\t\tstr += \"(mergeunion '\"+mapEntry.getKey() + val;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tstr += \", \"+mapEntry.getKey() + val;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfirst2 = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(((Set<String>) mapEntry.getValue()).size() > 1)\n\t\t\t\t\tstr += \t\"' cols:wid)\";\n\t\t\t\tstr += \";\\r\\n\";\n\t\t\t\tit.remove(); // avoids a ConcurrentModificationException\n\t\t\t}\t\t\t\n\t\t}\t\n\t\t//str += nowVal(strm, hasNative);\n\t\treturn str;\n\t}", "public static void main(String[] args) {\n BiFunction<String, Integer, Usuario> factory = Usuario::new;\n Usuario user1 = factory.apply(\"Henrique Schumaker\", 50);\n Usuario user2 = factory.apply(\"Humberto Schumaker\", 120);\n Usuario user3 = factory.apply(\"Hugo Schumaker\", 190);\n Usuario user4 = factory.apply(\"Hudson Schumaker\", 10);\n Usuario user5 = factory.apply(\"Gabriel Schumaker\", 90);\n Usuario user6 = factory.apply(\"Nikolas Schumaker\", 290);\n Usuario user7 = factory.apply(\"Elisabeth Schumaker\", 195);\n Usuario user8 = factory.apply(\"Eliza Schumaker\", 1000);\n Usuario user9 = factory.apply(\"Marcos Schumaker\", 100);\n Usuario user10 = factory.apply(\"Wilson Schumaker\", 1300);\n \n List<Usuario> usuarios = Arrays.asList(user1, user2, user3, user4, user5,\n user6, user7, user8, user9, user10);\n \n //filtra usuarios com + de 100 pontos\n usuarios.stream().filter(u -> u.getPontos() >100);\n \n //imprime todos\n usuarios.forEach(System.out::println);\n \n /*\n Por que na saída apareceu todos, sendo que eles não tem mais de 100 pontos? \n Ele não aplicou o ltro na lista de usuários! Isso porque o método filter, assim como os \n demais métodos da interface Stream, não alteram os elementos do stream original! É muito \n importante saber que o Stream não tem efeito colateral sobre a coleção que o originou.\n */\n }", "public static void main(String args[] ) throws Exception {\n \n Scanner s = new Scanner(System.in);\n List<String> inputList = new ArrayList<String>(); \n int limit = Integer.parseInt(s.nextLine());\n while (s.hasNextLine()) {\n \n String scanValue = s.nextLine();\n inputList.add(scanValue); \n } \n\n List<Integer> intList = getAllValuesArr(inputList);\n \n intList.stream().forEach(i -> {\n\n IntStream.range(1, i+1).forEach(num -> { \n printRangeNumbers(num); \n });\n });\n \n\n\n }", "private void streamsMinDemo() {\n IntStream.of(numbers).min().ifPresent(System.out::println);\n IntStream.of(numbers).max().ifPresent(System.out::println);\n IntStream.of(numbers).average().ifPresent(System.out::println);\n System.out.println(IntStream.of(numbers).count());\n System.out.println(IntStream.of(numbers).sum());\n }", "private Stream<String> processLines(Stream<String> lines) {\n System.out.println(\"processlines\" + Thread.currentThread().getName());\n Pattern pattern = Pattern.compile(\"<a href=\\\"([^\\\\/]*\\\\/)\\\".*\");\n\n return lines\n .map(s -> pattern.matcher(s))\n .filter(m -> m.matches())\n .map(m -> m.group(1))\n .filter(s -> !\"../\".equals(s));\n }", "public static void main(String[] args) {\n Random r = new Random();\n Map<Boolean, List<Integer>> boxed = r.ints(0, 101)\n .limit(10)\n .boxed()\n .collect(Collectors.partitioningBy(i -> i % 2 == 0));\n System.out.println(boxed.get(true));\n System.out.println(boxed.get(false));\n // r.ints returns an IntStream (stream of primitive ints which requires boxing/unboxing\n // can we improve?\n }", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\tdefault EagerFutureStream<Collection<U>> batchByTime(long time, TimeUnit unit) {\n\t\n\t\tint size = this.getLastActive().list().size();\n\t\tList[] list = {new ArrayList<U>()};\n\t\tint[] count = {0};\n\t\tSimpleTimer[] timer = {new SimpleTimer()};\n\t\treturn (EagerFutureStream)this.map(next-> { \n\t\t\t\tsynchronized(timer){\n\t\t\t\t\tcount[0]++;\n\t\t\t\t\tif(unit.toNanos(time)-timer[0].getElapsedNanoseconds()>0){\n\t\t\t\t\t\t\n\t\t\t\t\t\tlist[0].add(next);\n\t\t\t\t\t} else{\n\t\t\t\t\t\tlist[0].add(next);\n\t\t\t\t\t\tList<U> result = list[0];\n\t\t\t\t\t\tlist[0] = new ArrayList<U>();\n\t\t\t\t\t\t timer[0] = new SimpleTimer();\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(count[0]==size){\n\t\t\t\t\t\tlist[0].add(next);\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<U> result = list[0];\n\t\t\t\t\t\tlist[0] = new ArrayList<U>();\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t\treturn new ArrayList();\n\t\t\t\t}\n\t\t\t}\t).filter(l->l.size()>0);\n\t\t\n\t}", "public static void main(String[] args){\n int result = Stream.of(1,2,3,4,5,6,7,8,9,10)\n .reduce(0,Integer::sum);//metodo referenciado\n// .reduce(0, (acumulador, elemento) -> acumulador+elemento);\n System.out.println(result);\n\n // Obtener lenguajes separados por pipeline entre ellos y sin espacios\n // opcion 1(mejor) con operador ternario\n String cadena = Stream.of(\"Java\",\"C\",\"Python\",\"Ruby\")\n .reduce(\"\", (acumulador, lenguaje) -> acumulador.equals(\"\")?lenguaje:acumulador + \"|\" + lenguaje);\n\n System.out.println(cadena);\n\n //Opcion 2 Con regex\n String cadenaRegex = Stream.of(\"Java\",\"C\",\"Python\",\"Ruby\")\n .reduce(\"\", (acumulador, lenguaje) -> acumulador + \"|\" + lenguaje)\n .replaceFirst(\"\\\\|\",\"\") // Quitamos la primera pipeline\n .replaceAll(\"\\\\s\",\"\"); // Quitamos todos los espacios\n\n System.out.println(cadenaRegex);\n }", "@Benchmark\n public void task0()\n throws IOException{\n Map<Character, Integer> letterScores = (new LetterScorer(maxThreads, validCharRegex))\n .getScoreFromCorpus(dataDir);\n\n Files.write(Paths.get(outFilePath)\n , (new KScorer(maxThreads, validCharRegex, kNeighborhood, letterScores))\n .getScoreFromCorpus(dataDir)\n .stream()\n .sorted(Comparator.comparing(Map.Entry::getKey))\n .map(e-> e.getKey() + \", \" + e.getValue())\n .collect(Collectors.joining(\"\\n\"))\n .getBytes());\n }", "public static void main(String[] args) {\n float[] fb=new float[9];\n fb[0]=(int)12;\n fb[1]=(byte)13;\n fb[2]=(short)8;\n fb[3]=12.021f;\n // fb[4]=23443.43d;\n// fb[4]='a';\n// for(int i=0;i<=4;i++) {\n// \t System.out.println(fb[i]);\n// }\n List<Integer> lis1=new ArrayList<>();\n List<Integer> lis2=new ArrayList<>();\n lis1.add(2);\n lis1.add(4);\n lis1.add(16);\n lis1.add(32);\n lis1.add(96);\n lis1.add(123);\n lis1.add(435);\n lis1.add(234);\n lis1.add(100);\n lis1.add(122);\n lis1.add(240);\n lis1.add(350);\n java.util.Iterator<Integer> itr= lis1.iterator();\n //while(itr.hasNext()) {\n // itr.remove();\n \t System.out.println(itr.next());\n \t System.out.println(itr.next());\n \t System.out.println(itr.next());\n \t System.out.println(itr.next());\n\n \t System.out.println(itr.next());\n \t System.out.println(itr.next());\n \t System.out.println(itr.next());\n\n \t System.out.println(lis1);\n // \n// long startTime = System.currentTimeMillis();\n// getTotalX(lis1,lis2);\n// System.out.println(\"Time taken by 2 * o(n^2) \" + (System.currentTimeMillis() - startTime) + \"ms\"); \n// \n \t\t \n\t}", "@Override\n public Iterator<? extends Map.Entry<Key, Value>> reduceKV(Iterator<Map.Entry<Key, Value>> iter) {\n Key keyBeforeTT = null, keyAfterTT = null;\n Value valueBeforeTT = null;\n List<Value> valuesAfterTT = new LinkedList<>();\n\n while (iter.hasNext()) {\n Map.Entry<Key, Value> next = iter.next();\n Key k = next.getKey();\n Value v = next.getValue();\n\n if (k.getTimestamp() < tt) {\n if (keyBeforeTT == null || k.getTimestamp() > keyBeforeTT.getTimestamp()) {\n keyBeforeTT = k;\n valueBeforeTT = v;\n }\n } else {\n if (keyAfterTT == null || k.getTimestamp() > keyAfterTT.getTimestamp())\n keyAfterTT = k;\n valuesAfterTT.add(v);\n }\n }\n\n // Entries with ts >= tt are summed together into one entry with the timestamp of the most recent one.\n // If no entry is seen with ts < tt and we are on scan or full majc scope, then no entries are emitted.\n if (sScope == SScope.SCAN_OR_MAJC_FULL && keyBeforeTT == null)\n return null;\n\n // All entries are emitted after applying the above rules.\n if (keyBeforeTT == null && keyAfterTT == null)\n return null;\n else if (keyAfterTT == null)\n return Iterators.singletonIterator(new AbstractMap.SimpleImmutableEntry<>(keyBeforeTT, valueBeforeTT));\n else if (keyBeforeTT == null)\n return Iterators.singletonIterator(new AbstractMap.SimpleImmutableEntry<>(keyAfterTT, summer.reduce(keyAfterTT, valuesAfterTT.iterator())));\n else {\n // emit most recent entry first\n return new PeekingIterator2<Map.Entry<Key, Value>>(\n new AbstractMap.SimpleImmutableEntry<>(keyAfterTT, summer.reduce(keyAfterTT, valuesAfterTT.iterator())),\n new AbstractMap.SimpleImmutableEntry<>(keyBeforeTT, valueBeforeTT)\n );\n }\n }", "public static void main(String[] args) {\n deck = new Deck();\n\n //1c)\n hand = deck.assign(10);\n\n // prints all cards in hand\n System.out.print(String.format(\"Printing all %s cards in hand: \", hand.size()));\n hand.stream()\n .map(Card::getDetails)\n .sorted() //TODO fix sorting by numeric value. x1 x11 x12 x10 x2 etc..\n .forEachOrdered(\n det -> Stream.concat(Stream.of(det), Stream.of(\", \"))\n .forEachOrdered(System.out::print));\n //TODO refactor formatted print to own method\n System.out.println(\"\");\n\n //1d) filter and print specific suit from hand\n //TODO refactor to separate method and make calls for each suit\n\n System.out.print(\"Printing all Spades suit cards: \");\n hand.stream()\n .filter(Card -> (Card.getSuit() == 'S'))\n .map(Card::getDetails)\n .sorted() //TODO fix sorting by numeric value. x1 x11 x12 x10 x2 etc..\n .forEachOrdered(\n det -> Stream\n .concat( Stream.of(det), Stream.of(\", \") ) //separates cards with \", \"\n .forEachOrdered(System.out::print) );\n System.out.println(\"\"); //line break\n\n\n // 1e) filters heart cards from hand into new set\n HashSet<Card> cardsOfHeart = hand.stream()\n .filter(Card -> ( Card.getSuit() == 'H') )\n .collect(Collectors\n .toCollection(HashSet::new));\n\n //print heart cards\n System.out.print( String.format( \"Printing all %s heart cards: \", cardsOfHeart.size() ) );\n cardsOfHeart.stream()\n .map(Card::getDetails) //map to card details\n .sorted() //TODO fix sorting by numeric value. x1 x11 x12 x10 x2 etc..\n .forEachOrdered(\n det -> Stream\n .concat( Stream.of(det), Stream.of(\", \") ) //separates cards with \", \"\n .forEachOrdered(System.out::print)\n );\n System.out.println(\"\");\n\n //1f) stream map cards to stream of suit chars\n System.out.print(\"Printing only suit value of cards in hand: \");\n hand.stream().map(Card::getSuit).sorted().forEachOrdered(System.out::print);\n System.out.println(\"\");\n\n //1g) stream reduce card values to sum of values in hand\n System.out.println(\n String.format(\"The sum of the face values on hand is %s\",\n hand.stream()\n .map(Card::getFace)\n .reduce(0, Integer::sum)\n )\n );\n\n }", "private static Stream<List<String>> shuffles(List<Integer> inititalList,List<String> zer,List<String> one, String function) {\n List<String> result = new ArrayList<>();\n List<Integer> lst = new ArrayList<>(inititalList);\n List<Integer> lst2 = new ArrayList<>(inititalList);\n Collections.shuffle(lst);\n Collections.shuffle(lst2);\n int count0 = 0;\n int count1 = 0;\n for(int j=0;j<32;j++){\n if(function.charAt(j)=='0'){\n result.add(zer.get(lst.get(count0)));\n count0++;\n }else {\n result.add(one.get(lst2.get(count1)));\n count1++;\n }\n }\n Stream stream = Stream.iterate(result, prev -> result);\n return stream;\n }", "private void collectUsingStream() {\n List<Person> persons =\n Arrays.asList(\n new Person(\"Max\", 18),\n new Person(\"Vicky\", 23),\n new Person(\"Ron\", 23),\n new Person(\"Harry\", 12));\n\n List<Person> filtered = persons\n .stream()\n .filter(p -> p.name.startsWith(\"H\"))\n .collect(Collectors.toList());\n\n System.out.println(\"collectUsingStream Filtered: \" + filtered);\n }", "BitStream bitStream(int startIndex);", "@Test\n public void terminalOperations() {\n // count\n assertEquals(4, TestData.getBooks().stream().count());\n // findFirst\n Optional<Book> gangOfFour = TestData.getBooks().stream()\n .filter(book -> book.name.equals(\"Design Patterns: Elements of Reusable Object-Oriented Software\"))\n .findFirst();\n assertTrue(gangOfFour.isPresent());\n assertEquals(4, gangOfFour.get().authors.size());\n }", "public void callLazystream()\n {\n\n Stream<String> stream = list.stream().filter(element -> {\n wasCalled();\n System.out.println(\"counter in intermediate operations:\" + counter);\n return element.contains(\"2\");\n });\n\n System.out.println(\"counter in intermediate operations:\" + counter);\n }", "public void streamIterate(){\n Stream.iterate(new int[]{0, 1},t -> new int[]{t[1], t[0]+t[1]})\n .limit(20)\n .forEach(t -> System.out.println(\"(\" + t[0] + \",\" + t[1] +\")\"));\n /*\n In Java 9, the iterate method was enhanced with support for a predicate.\n For example, you can generate numbers starting at 0 but stop the iteration once the number is greater than 100:\n * */\n IntStream.iterate(0, n -> n < 100, n -> n + 4)\n .forEach(System.out::println);\n }", "default Stream<T> union(List<Stream<T>> streams) {\n return union(null, streams);\n }", "public static <E> List<E> take(Stream<? extends E> stream, int n){\n if (stream == null) return null;\n List<E> output_list = new LinkedList<E>();\n if ( n != 0) {\n Iterator<? extends E> iter = stream.iterator();\n while( n-- != 0 && iter.hasNext()) { output_list.add(iter.next()); }\n }\n return output_list;\n }", "@Test\n public void flatMapExample() {\n final Book book1 = new Book(\"Java EE 7 Essentials\", 2013, Arrays.asList(\"Arun Gupta\"));\n final Book book2 = new Book(\"Algorithms\", 2011, Arrays.asList(\"Robert Sedgewick\", \"Kevin Wayne\"));\n final Book book3 = new Book(\"Clean code\", 2014, Arrays.asList(\"Robert Martin\"));\n final List<String> expectedAuthors =\n Arrays.asList(\"Arun Gupta\", \"Robert Sedgewick\", \"Kevin Wayne\", \"Robert Martin\");\n\n final List<Book> javaBooks = Stream.of(book1, book2, book3).collect(Collectors.toList());\n\n final List<String> actualAuthors = javaBooks.stream()\n .flatMap(book -> book.getAuthors().stream())\n .distinct()\n .collect(Collectors.toList());\n\n Assert.assertEquals(actualAuthors.size(), expectedAuthors.size());\n actualAuthors.forEach(book -> Assert.assertTrue(expectedAuthors.contains(book)));\n }", "public static void main(String []args) {\n\t\tList<String> numbers = Arrays.asList(\"1\", \"2\", \"3\", \"4\", \"5\", \"6\",\"7\",\"8\",\"9\");\r\n\t\t//Generate numbers from 1 to 9\r\n\t\tSystem.out.println(IntStream.range(1,10).mapToObj(String::valueOf).collect(Collectors.toList()));\r\n//\t\tSystem.out.println(\"Original list \" + numbers);\r\n\t\t\r\n\t\tList<Integer> even = numbers.stream()\r\n\t\t\t\t//gets the integer value from the string\r\n//\t\t\t\t.map(s ->Integer.valueOf(s))\r\n\t\t\t\t.map(Integer::valueOf) // Another way to do the top line(line 18)\r\n\t\t\t\t//checking if it is even\r\n\t\t\t\t.filter(number -> number % 2 ==1)// Odd numbers\r\n//\t\t\t\t.filter(number -> number % 2 ==0)// Even numbers\r\n\t\t\t\t//Collects results in to list call even.\r\n\t\t\t\t.collect(Collectors.toList());\r\n\t\t\r\n\t\tSystem.out.println(even);\r\n\r\n\t\tList<String> strings = Arrays.asList(\"abc\", \"\", \"bc\", \"efg\", \"abcd\", \"\", \"jkl\", \"\", \"\");\r\n\t\tSystem.out.println(strings);\r\n\t\t\r\n\t\tList<String> filtered = strings.stream()\r\n\t\t\t\t// checking each item and we check it is empty\r\n\t\t\t\t.filter(s-> !s.isEmpty())\r\n//\t\t\t\t.filter(s-> s.isEmpty())\r\n\t\t\t\t// add the remaining element to the list\r\n\t\t\t\t.collect(Collectors.toList());\r\n\t\tSystem.out.println(filtered);\r\n\t\t\r\n\t\t// Known as a method reference \r\n//\t\tforEach(System.out::println)\r\n\t\t \r\n\t}", "public void testF() {\n\t\tfor (int k = 0; k < usedSS; k++) {\n\t\t\tList<Integer> subStr = vals.subList(k*compSize, (k+1)*compSize);\n\t\t\tint sum = (int) subStr.stream().filter(i -> i != BipartiteMatching.FREE).count();\n\t\t\tfData.add(sum);\t\t\t\n\t\t}\n\t}", "protected Stream<Integer> rawStreamAllValuesOfby(final Object[] parameters) {\n return rawStreamAllValues(POSITION_BY, parameters).map(Integer.class::cast);\n }", "private void exercise2() {\n List<String> list = asList(\n \"The\", \"Quick\", \"BROWN\", \"Fox\", \"Jumped\", \"Over\", \"The\", \"LAZY\", \"DOG\");\n\n final List<String> lowerOddLengthList = list.stream()\n .filter((string) -> string.length() % 2 != 0)\n .map(String::toLowerCase)\n .peek(System.out::println)\n .collect(toList());\n }", "@Test\n public void bigDataInMap() throws Exception {\n\n final byte[] data = new byte[16 * 1024 * 1024]; // 16 MB\n rnd.nextBytes(data); // use random data so that Java does not optimise it away\n data[1] = 0;\n data[3] = 0;\n data[5] = 0;\n\n CollectingSink resultSink = new CollectingSink();\n\n StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();\n env.setParallelism(1);\n\n DataStream<Integer> src = env.fromElements(1, 3, 5);\n\n src.map(\n new MapFunction<Integer, String>() {\n private static final long serialVersionUID = 1L;\n\n @Override\n public String map(Integer value) throws Exception {\n return \"x \" + value + \" \" + data[value];\n }\n })\n .addSink(resultSink);\n\n JobGraph jobGraph = StreamingJobGraphGenerator.createJobGraph(env.getStreamGraph());\n\n final RestClusterClient<StandaloneClusterId> restClusterClient =\n new RestClusterClient<>(\n MINI_CLUSTER_RESOURCE.getClientConfiguration(),\n StandaloneClusterId.getInstance());\n\n try {\n submitJobAndWaitForResult(restClusterClient, jobGraph, getClass().getClassLoader());\n\n List<String> expected = Arrays.asList(\"x 1 0\", \"x 3 0\", \"x 5 0\");\n\n List<String> result = CollectingSink.result;\n\n Collections.sort(expected);\n Collections.sort(result);\n\n assertEquals(expected, result);\n } finally {\n restClusterClient.close();\n }\n }", "public static <E> Stream<E> buffer(Iterable<E> stream) {\n if (stream == null) return null;\n \n return new AbstractStream<E>() {\n final Iterable<E> input_stream = stream;\n List<E> buffer = null;\n\n public Iterator<E> iterator() {\n if (buffer != null) return buffer.iterator();\n \n buffer = new LinkedList<E>();\n return new Iterator<E>(){\n Iterator<E> iter = input_stream.iterator();\n public void remove(){ iter.remove(); }\n public boolean hasNext() { return iter.hasNext(); }\n public E next() {\n E next_item = iter.next();\n buffer.add(next_item);\n return next_item;\n }\n };\n }\n\n };\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic static <CollectedFact> Stream<CollectedFact> addToStream(\n\t\t\tStream<CollectedFact> stream, Stream<CollectedFact> stream2) {\n\t\tList<CollectedFact> result = stream.collect(Collectors.toList()); // error\n\t\tresult.addAll(stream2.collect(Collectors.toList()));\n//\t\tresult.forEach(System.out::println);\n\t\t\n\t\t\n\t\t//code to save to an Output File\n\t\t List<String> strList = result.stream().distinct().map(Object::toString)\n\t\t\t\t.collect(Collectors.toList());\n\n\t\ttry {\n\t\t\tFiles.write(Paths.get(outputFileName),\n\t\t\t\t\t(Iterable<String>) strList.stream()::iterator);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn result.stream();\n\t}", "@Override\n public void run () {\n try {\n int i = 0;\n String tupleString = this.inReadEnds[i].getNextString();\n while (tupleString != null && i < this.inReadEnds.length - 1){\n BMap tempStore = BMap.makeBMap(tupleString);\n mapStore = BMap.or(mapStore, tempStore);\n i++;\n tupleString = this.inReadEnds[i].getNextString();\n }\n \n BMap tempStore = BMap.makeBMap(tupleString);\n this.mapStore = BMap.or(mapStore, tempStore);\n \n this.outWriteEnd.putNextString(mapStore.getBloomFilter());\n this.outWriteEnd.close();\n } \n catch (Exception e) {\n ReportError.msg(this.getClass().getName() + \" \" + e);\n }\n }", "default Spliterator.OfInt getNextVertices(int vidx) {\n class MySpliterator extends AbstractIntSpliterator{\n int index;\n int limit;\n public MySpliterator (int vidx, int lo, int hi) {\n super(hi,ORDERED|NONNULL|SIZED|SUBSIZED);\n limit=hi;\n index=lo;\n }\n @Override\n public boolean tryAdvance(@Nonnull IntConsumer action) {\n if (index<limit) {\n action.accept(getNext(vidx,index++));\n return true;\n }\n return false;\n }\n @Nullable\n public MySpliterator trySplit() {\n int hi = limit, lo = index, mid = (lo + hi) >>> 1;\n return (lo >= mid) ? null : // divide range in half unless too small\n new MySpliterator(vidx, lo, index = mid);\n }\n \n }\n return new MySpliterator(vidx,0,getNextCount(vidx));\n }", "private IntStream createStream() {\n DataInputStream dataInputStream = null;\n try {\n dataInputStream = new DataInputStream(new BufferedInputStream(new FileInputStream(fileName)));\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found\");\n }\n DataInputStream finalDin = dataInputStream;\n return IntStream.generate(() -> {\n try {\n assert finalDin != null;\n return finalDin.readInt();\n } catch (IOException e) {\n System.out.println(\"Stream problem\");\n }\n return 0;\n })\n .limit(20);\n }", "@Test\n public void terminalOperationsIndeed() {\n Stream<Book> bookStream = TestData.getBooks().stream();\n assertEquals(4, bookStream.count());\n\n try {\n bookStream.count();\n fail(\"No expection got?\");\n } catch(IllegalStateException e) {\n // We got exception as expected\n }\n }" ]
[ "0.5832039", "0.5615606", "0.5608581", "0.5558672", "0.5539166", "0.5515144", "0.544838", "0.5413682", "0.53811324", "0.53343374", "0.52857727", "0.52849215", "0.5282471", "0.5239383", "0.523746", "0.523316", "0.5227797", "0.52234536", "0.5206238", "0.5193808", "0.5181343", "0.51752347", "0.5159951", "0.5139265", "0.5137673", "0.5127515", "0.51084465", "0.5096583", "0.508066", "0.50656563", "0.50612265", "0.50590146", "0.50562584", "0.505455", "0.5041258", "0.5025475", "0.50253505", "0.5019142", "0.5015448", "0.49944115", "0.49688196", "0.49564517", "0.49559012", "0.4936928", "0.49326855", "0.49247468", "0.4918825", "0.4916495", "0.49083936", "0.49007744", "0.48858193", "0.48742983", "0.48620304", "0.4855817", "0.48484388", "0.4845918", "0.48409814", "0.4840247", "0.48251337", "0.48195076", "0.48170614", "0.48089272", "0.4801166", "0.48011214", "0.4789973", "0.4779453", "0.47761983", "0.47619948", "0.4759947", "0.47457007", "0.4738822", "0.47330108", "0.47267497", "0.47215423", "0.4713433", "0.47015834", "0.46995947", "0.46982458", "0.46908322", "0.46881092", "0.4686908", "0.46857002", "0.46844316", "0.46834487", "0.46775332", "0.46708938", "0.466785", "0.46633026", "0.46630964", "0.4661411", "0.46609187", "0.46587217", "0.46529505", "0.4645994", "0.46384686", "0.4638373", "0.46374163", "0.4633918", "0.46281663", "0.46270624", "0.46263272" ]
0.0
-1
/ Code within the callback can roll the transaction back by calling the setRollbackOnly() method on the supplied TransactionStatus object
@Override public Object doInTransaction(TransactionStatus transactionStatus) { transactionStatus.setRollbackOnly(); return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void rollbackTransaction();", "@Override\n public void rollbackTx() {\n \n }", "@Override\r\n\tpublic void setRollbackOnly() throws IllegalStateException, SystemException {\r\n\t\trequireTransaction(\"set rollback\");\r\n\t\tgetTransaction().setRollbackOnly();\r\n\t}", "public static void setRollbackOnly() {\n\t\tTxStatus status = (TxStatus) txContexts.get();\n\t\tif (status == null) {\n\t\t\t//System.out.println(\"No transaction to set rollbackonly on\");\n\t\t\tthrow new TransactionInfrastructureUsageException(\"No transaction context in setRollbackOnly\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Set rollbackonly on\");\n\t\t\tstatus.setRollbackOnly();\n\t\t}\n\t}", "@Override\n public void setRollbackOnly() throws IllegalStateException, SystemException {\n assertActiveTransaction();\n getTransaction().setRollbackOnly();\n }", "void rollback(Transaction transaction);", "public synchronized void setRollbackOnly() {\n rollbackOnly = true;\n if (transacted == Transacted.Xa) {\n try {\n transactionManager.setRollbackOnly();\n } catch (Exception e) {\n throw new TransactionException(e);\n }\n }\n }", "public void setRollbackStatus(Byte rollbackStatus) {\r\n this.rollbackStatus = rollbackStatus;\r\n }", "@Override\r\n\tpublic void rollback() throws IllegalStateException, SecurityException, SystemException {\r\n\r\n\t\trequireTransaction(\"rollback\");\r\n\t\tif (getStatus()==Status.STATUS_COMMITTING) {\r\n\t\t\tthrow new IllegalStateException(\"Cannot rollback transaction while it's committing\");\r\n\t\t}\r\n\t\tgetTransaction().rollback();\r\n\t\tremoveTransaction();\r\n\r\n\t}", "public void rollback();", "public void rollbackTx()\n\n{\n\n}", "boolean requiresRollbackAfterSqlError();", "void rollback() {\r\n tx.rollback();\r\n tx = new Transaction();\r\n }", "void rollback();", "public Object doInTransaction(TransactionStatus status) {\n sendEvent();\n sendEvent();\n sendEvent();\n sendEvent();\n status.setRollbackOnly();\n return null;\n }", "@Override\n\tpublic void rollBack() {\n\n\t}", "@Override\n public void rollback() throws SQLException {\n if (isTransActionAlive()) {\n getTransaction().rollback();\n }\n }", "public void setRollback(Boolean rollback) {\n this.rollback = rollback;\n }", "public IgniteInternalFuture<IgniteInternalTx> rollbackAsync();", "public void rollbackTransaction() throws TransactionException {\n\t\t\r\n\t}", "void rollBack();", "@Override\r\n\t\tpublic void rollback() throws SQLException {\n\t\t\t\r\n\t\t}", "public abstract void rollback() throws DetailException;", "protected abstract void rollbackIndividualTrx();", "private void rollBackJMS() throws JMSException {\n\t\t session.rollback();\n\t\t log(\"JMS session rolled back ...., commit counter: \" + commitCounter);\n\n\t }", "void rollbackTransaction(ConnectionContext context) throws IOException;", "private void doRollback() throws TransactionInfrastructureException {\n\t\t// DO WE WANT TO ROLL\n\t\t//\t\tif (isTransactionalMethod(m))\n\t\tObject txObject = getTransactionObject();\n\t\tif (txObject == null)\n\t\t\tthrow new TransactionInfrastructureException(\"Cannot rollback transaction: don't have a transaction\");\n\t\trollback(txObject);\n\t}", "protected abstract void rollback(WorkFlowChainContext chainContext) throws WorkFlowException;", "public DAO rollback() throws IllegalStateException\r\n\t{\r\n\t\treturn rollback(false);\r\n\t}", "@Override\n public void rollback() throws IllegalStateException, SecurityException, SystemException {\n assertActiveTransaction();\n try {\n getTransaction().rollback();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n txns.set(null);\n }\n }", "@Override\r\n\t\tpublic void rollback(Savepoint savepoint) throws SQLException {\n\t\t\t\r\n\t\t}", "public boolean rolledback() throws HibException;", "private void rollbackTransaction(GraphTraversalSource g) {\n if (graphFactory.isSupportingTransactions()) {\n g.tx().rollback();\n }\n }", "public Boolean getRollback() {\n return this.rollback;\n }", "public Object doInTransaction(TransactionStatus status) {\n\t\t\t\tlog.debug(\"Start Transaction\");\n\t\t\t\tquery_insertStudent.update(param);\n\n\t\t\t\t/*\n\t\t\t\t * activate the following error line to create an Error which\n\t\t\t\t * terminates this method. One will see, that the complete\n\t\t\t\t * transaction is rolled back, hence the insert statement above\n\t\t\t\t * is not executed, alternatively the second rollback statement\n\t\t\t\t * can be activated with the same result which in that case is a\n\t\t\t\t * manual rollback of the transaction\n\t\t\t\t */\n\n\t\t\t\t// if (true) throw new Error(\"Test Exception\");\n\t\t\t\t// or\n\t\t\t\t// status.setRollbackOnly();\n\t\t\t\t/*\n\t\t\t\t * result from query is a list, actually containing only one row\n\t\t\t\t * and one column\n\t\t\t\t */\n\t\t\t\tList<?> results = query_getStudentId.execute();\n\t\t\t\tInteger id = (Integer) results.get(0);\n\t\t\t\tlog.debug(\"End Transaction\");\n\t\t\t\treturn id;\n\t\t\t\t/*\n\t\t\t\t * and the transaction ends here! if no error occurs the\n\t\t\t\t * transaction is committed by Spring otherwise it is rolled\n\t\t\t\t * back\n\t\t\t\t */\n\t\t\t}", "@Override\n\tpublic void rollback() throws Throwable {\n\t\tthrow new Warning(\"please use rollback(context)\");\n\t}", "@Override\n public void rollbackTransaction() {\n if (connection != null) {\n try {\n connection.rollback();\n } catch (SQLException e) {\n LOGGER.error(\"Can't rollback transaction \", e);\n } finally {\n closeConnection();\n }\n }\n }", "@Override\n public void rollback()\n throws TransactionException\n {\n Iterator<Buffer> it=branchBuffers.iterator();\n while (it.hasNext())\n { \n it.next().rollback();\n it.remove();\n }\n state=State.ABORTED;\n \n }", "private void processRollback() throws HsqlException {\n\n String token;\n boolean toSavepoint;\n\n token = tokenizer.getSimpleToken();\n toSavepoint = false;\n\n if (token.equals(Token.T_WORK)) {\n\n // do nothing\n } else if (token.equals(Token.T_TO)) {\n tokenizer.getThis(Token.T_SAVEPOINT);\n\n token = tokenizer.getSimpleName();\n toSavepoint = true;\n } else {\n tokenizer.back();\n }\n\n if (toSavepoint) {\n session.rollbackToSavepoint(token);\n } else {\n session.rollback();\n }\n }", "@Override\r\n\t\t\tpublic Boolean doInTransaction(TransactionStatus status) {\n\t\t\t\ttry {\r\n\t\t\t\t\t\tboolean result = bookDAO.deleteBook(ISBN);\r\n\t\t\t\t\t\treturn result;\r\n\r\n\t\t\t\t} catch (Exception exception) {\r\n\t\t\t\t\tstatus.setRollbackOnly();\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\r\n\t\t\t}", "public Byte getRollbackStatus() {\r\n return rollbackStatus;\r\n }", "public static boolean isRollbackOnly() {\n\t\tTxStatus status = (TxStatus) txContexts.get();\n\t\tif (status == null) {\n\t\t\tSystem.out.println(\"No transaction to set rollbackonly on\");\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn status.getRollbackOnly();\n\t\t}\n\t}", "public boolean rollback() {\r\n\tboolean result = false;\r\n\r\n\tif (conn != null && isConnected()) {\r\n\t try {\r\n\t\tboolean autoCommit = getAutoCommit();\r\n\r\n\t\tif (!autoCommit) {\r\n\t\t conn.rollback();\r\n\t\t result = true;\r\n\t\t}\r\n\t } catch (Exception e) {\r\n\t\te.printStackTrace();\r\n\t }\r\n\t}\r\n\r\n\treturn result;\r\n }", "public Boolean isRollback() {\n return this.rollback;\n }", "@Override\n public void setRollbackOnly(Throwable cause)\n throws Exception {\n if (_runtime == null)\n getTransactionManager();\n\n if (_runtime != null)\n _runtime.setRollbackOnly(cause);\n }", "protected boolean isTransactionRollback()\n {\n try\n {\n UMOTransaction tx = TransactionCoordination.getInstance().getTransaction();\n if (tx != null && tx.isRollbackOnly())\n {\n return true;\n }\n }\n catch (TransactionException e)\n {\n // TODO MULE-863: What should we really do?\n logger.warn(e.getMessage());\n }\n return false;\n }", "public synchronized void afterCompletion(int status)\n {\n boolean success = false;\n try\n {\n if (status == Status.STATUS_ROLLEDBACK)\n {\n super.rollback();\n }\n else if (status == Status.STATUS_COMMITTED)\n {\n internalPostCommit();\n }\n else\n {\n // this method is called after*Completion*(), so we can expect\n // not to be confronted with intermediate status codes\n // TODO Localise this\n NucleusLogger.TRANSACTION.fatal(\"Received unexpected transaction status + \" + status);\n }\n success = true;\n }\n finally\n {\n jtaTx = null;\n joinStatus = JoinStatus.NO_TXN;\n if (!success)\n { \n // TODO Localise this\n NucleusLogger.TRANSACTION.error(\"Exception during afterCompletion in JTA transaction. PersistenceManager might be in inconsistent state\");\n }\n }\n\n if (active)\n {\n throw new NucleusTransactionException(\"internal error, must not be active after afterCompletion()!\");\n }\n }", "public boolean syncRollbackPhase() {\n return syncRollbackPhase;\n }", "public static void finishTransaction()\n {\n if (currentSession().getTransaction().isActive())\n {\n try\n {\n System.out.println(\"INFO: Transaction not null in Finish Transaction\");\n Thread.dumpStack();\n rollbackTransaction();\n// throw new UAPersistenceException(\"Incorrect Transaction handling! While finishing transaction, transaction still open. Rolling Back.\");\n } catch (UAPersistenceException e)\n {\n System.out.println(\"Finish Transaction threw an exception. Don't know what to do here. TODO find solution for handling this situation\");\n }\n }\n }", "public void rollback() throws ResourceException;", "boolean isMarkedRollback() throws Exception;", "@Override\n\tpublic void cancelTransaction() {\n\t\t\n\t}", "private LoanProtocol processRollback(LoanProtocol protocol)\n\t{\n\t\ttransferLock.countDown();\n\t\tshouldRollback = true;\n\t\treturn null;\n\t}", "private void testRollback001() {\n\t\tDmtSession session = null;\n\t\ttry {\n\t\t\tDefaultTestBundleControl.log(\"#testRollback001\");\n\t\t\tsession = tbc.getDmtAdmin().getSession(\".\", DmtSession.LOCK_TYPE_EXCLUSIVE);\n\t\t\tsession.rollback();\n\t\t\tDefaultTestBundleControl.failException(\"#\",DmtIllegalStateException.class);\n\t\t} catch (DmtIllegalStateException e) {\n\t\t\tDefaultTestBundleControl.pass(\"DmtIllegalStateException correctly thrown\");\n\t\t} catch (Exception e) {\n tbc.failExpectedOtherException(DmtIllegalStateException.class, e);\n\t\t} finally {\n\t\t\ttbc.closeSession(session);\n\t\t}\n\t}", "@Override\r\n\t\t\t\tpublic Boolean doInTransaction(TransactionStatus status) {\n\t\t\t\t\ttry {\r\n\r\n\t\t\t\t\t\tint rows = bookDAO.addBook(book);\r\n\t\t\t\t\t\tif (rows > 0)\r\n\t\t\t\t\t\t\treturn true;\r\n\r\n\t\t\t\t\t} catch (Exception exception) {\r\n\t\t\t\t\t\tstatus.setRollbackOnly();\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn false;\r\n\r\n\t\t\t\t}", "protected boolean isTransactionAllowedToRollback() throws SystemException\n {\n return this.getTransactionStatus() != Status.STATUS_COMMITTED &&\n this.getTransactionStatus() != Status.STATUS_NO_TRANSACTION &&\n this.getTransactionStatus() != Status.STATUS_UNKNOWN;\n }", "protected abstract void abortTxn(Txn txn) throws PersistException;", "private void rollBackAll() {\n\t\ttry {\n\t\t\t// rollback JMS\n\t\t\trollBackJMS();\n\t\t\t// rollback application data\n\t\t\trollBackApplication();\n\t\t} catch (Exception e) {\n\n\t\t\tlog(\"rollback failed. closing JMS connection ...\");\n\n\t\t\t// application may decide NOT to close connection if rollback failed.\n\t\t\tclose();\n\t\t}\n\t}", "boolean supportsRollback(Database database);", "public void doRollback() throws Exception{\n /* rollback to last stable checkpoint */\n rStateManager.rollback();\n\n /* gets the last stable checkpoint, or zero if it doesn't exist */\n long seqn = rStateManager.getCurrentCheckpointID();\n\n IRecoverableServer lServer = (IRecoverableServer)getServer();\n \n getStateLog().setNextExecuteSEQ(seqn + 1);\n getStateLog().setCheckpointLowWaterMark(seqn);\n\n if(seqn >= 0){\n lServer.setCurrentState(rStateManager.getCurrentState());\n }else{\n lServer.setCurrentState(null);\n }\n\n if(seqn > getCurrentPrePrepareSEQ()){\n getStateLog().setNextPrePrepareSEQ(seqn+1);\n }else{\n tryExecuteRequests();\n }\n \n }", "void setTransactionSuccessful();", "void endTransaction();", "public void rollback() throws SailException {\n if (waitForCommit) {\n statementDiffBuffer.clear();\n }\n\n baseSailConnection.rollback();\n }", "public void rollbackTransactionBlock() throws SQLException {\n masterNodeConnection.rollback();\n }", "@Override\r\n\t\t\tpublic Boolean doInTransaction(TransactionStatus status) {\n\t\t\t\ttry {\r\n\t\t\t\r\n\t\t\t\t\t\tint rows = bookDAO.updateBook(ISBN, price);\r\n\t\t\t\t\t\tif (rows > 0)\r\n\t\t\t\t\t\t\treturn true;\r\n\r\n\t\t\t\t} catch (Exception exception) {\r\n\t\t\t\t\tstatus.setRollbackOnly();\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\r\n\t\t\t}", "public static void rollbackTransaction() throws HException {\r\n\t\t\r\n\t\tTransaction tx = (Transaction) threadTransaction.get();\r\n\t\ttry {\r\n\t\t\tthreadTransaction.set(null);\r\n\t\t\tif (tx != null && !tx.wasCommitted() && !tx.wasRolledBack()) {\r\n\t\t\t\ttx.rollback();\r\n\t\t\t}\r\n\t\t} catch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t} finally {\r\n\t\t\t//closeSession();\r\n\t\t}\r\n\t}", "@RollbackExecution\n public void rollback() {\n log.warn(\"Rollback requested but not available for 'sortWorkPlacements' migration.\");\n }", "boolean supportsRollbackAfterDDL();", "void commitTransaction();", "@Override\n\tpublic void rollbackTran(Connection con) throws SQLException {\n\t\tcon.rollback();\n\t this.closeAll(null, null, con);\n\t}", "protected void commit()\n\t{\n\t\t_Status = DBRowStatus.Unchanged;\n\t}", "public void testRollback() throws Exception {\n Properties props = new Properties();\n props.setProperty(LockssRepositoryImpl.PARAM_CACHE_LOCATION, tempDirPath);\n props\n\t.setProperty(ConfigManager.PARAM_PLATFORM_DISK_SPACE_LIST, tempDirPath);\n ConfigurationUtil.setCurrentConfigFromProps(props);\n\n startService();\n Connection conn = sqlDbManager.getConnection();\n assertNotNull(conn);\n assertFalse(sqlDbManager.tableExists(conn, \"testtable\"));\n assertTrue(sqlDbManager.createTableIfMissing(conn, \"testtable\",\n\t\t\t\t\t TABLE_CREATE_SQL));\n assertTrue(sqlDbManager.tableExists(conn, \"testtable\"));\n\n SqlDbManager.safeRollbackAndClose(conn);\n conn = sqlDbManager.getConnection();\n assertNotNull(conn);\n assertFalse(sqlDbManager.tableExists(conn, \"testtable\"));\n }", "void readOnlyTransaction();", "public void commitTransaction() {\n\r\n\t}", "@Override\n public void commitTx() {\n \n }", "private void testRollback002() {\n\t\tDmtSession session = null;\n\t\ttry {\n\t\t\tDefaultTestBundleControl.log(\"#testRollback002\");\n\t\t\tsession = tbc.getDmtAdmin().getSession(\".\", DmtSession.LOCK_TYPE_SHARED);\n\t\t\tsession.rollback();\n\t\t\tDefaultTestBundleControl.failException(\"#\",DmtIllegalStateException.class);\n\t\t} catch (DmtIllegalStateException e) {\n\t\t\tDefaultTestBundleControl.pass(\"DmtIllegalStateException correctly thrown\");\n\t\t} catch (Exception e) {\n tbc.failExpectedOtherException(DmtIllegalStateException.class, e);\n\t\t} finally {\n\t\t\ttbc.closeSession(session);\n\t\t}\n\t}", "public static boolean isMarkedAsRollback(Transaction tx)\n {\n if (tx == null) return false;\n int status;\n try\n {\n status = tx.getStatus();\n return status == Status.STATUS_MARKED_ROLLBACK;\n }\n catch (SystemException e)\n {\n return false;\n }\n }", "public TransactionConfiguration syncRollbackPhase(boolean b) {\n this.syncRollbackPhase = b;\n return this;\n }", "public void testRollback() throws Exception{\n \t\tsource.open(executionContext);\n \t\t// rollback between deserializing records\n \t\tList first = (List) source.read();\n \t\tsource.mark();\n \t\tList second = (List) source.read();\n \t\tassertFalse(first.equals(second));\n \t\tsource.reset();\n \n \t\tassertEquals(second, source.read());\n \n \t}", "public void commitTransaction() throws TransactionException {\n\t\t\r\n\t}", "private void testRollback003() {\n DmtSession session = null;\n try {\n DefaultTestBundleControl.log(\"#testRollback003\");\n session = tbc.getDmtAdmin().getSession(\".\",DmtSession.LOCK_TYPE_ATOMIC);\n session.rollback();\n TestCase.assertEquals(\"Asserting that after a rollback(), the session is not closed.\", session.getState(), DmtSession.STATE_OPEN);\n } catch (Exception e) {\n \ttbc.failUnexpectedException(e);\n } finally {\n tbc.closeSession(session);\n }\n }", "public static DAO Rollback() throws IllegalStateException\r\n\t{\r\n\t\treturn instance.rollback();\r\n\t}", "@Override\r\n\t\tpublic void setTransactionIsolation(int level) throws SQLException {\n\t\t\t\r\n\t\t}", "public void beforeCompletion()\n {\n \n boolean success = false;\n try\n {\n flush();\n // internalPreCommit() can lead to new updates performed by usercode \n // in the Synchronization.beforeCompletion() callback\n internalPreCommit();\n flush();\n success = true;\n }\n finally\n {\n if (!success) \n {\n // TODO Localise these messages\n NucleusLogger.TRANSACTION.error(\"Exception flushing work in JTA transaction. Mark for rollback\");\n try\n {\n jtaTx.setRollbackOnly();\n }\n catch (Exception e)\n {\n NucleusLogger.TRANSACTION.fatal(\n \"Cannot mark transaction for rollback after exception in beforeCompletion. PersistenceManager might be in inconsistent state\", e);\n }\n }\n }\n }", "public static void deshacerTransaccion() {\n try {\n con.rollback();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void rollbackValues() {\n \n }", "public void forceCommitTx()\n{\n}", "public void testCommitOrRollback() throws Exception {\n Properties props = new Properties();\n props.setProperty(LockssRepositoryImpl.PARAM_CACHE_LOCATION, tempDirPath);\n props\n\t.setProperty(ConfigManager.PARAM_PLATFORM_DISK_SPACE_LIST, tempDirPath);\n ConfigurationUtil.setCurrentConfigFromProps(props);\n\n startService();\n Connection conn = sqlDbManager.getConnection();\n Logger logger = Logger.getLogger(\"testCommitOrRollback\");\n SqlDbManager.commitOrRollback(conn, logger);\n SqlDbManager.safeCloseConnection(conn);\n\n conn = null;\n try {\n SqlDbManager.commitOrRollback(conn, logger);\n } catch (NullPointerException sqle) {\n }\n }", "public void rollback() {\n\t\ttry {\n\t\t\tif (conn != null) {\n\t\t\t\tconn.rollback();\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"接続エラーが発生しました/Connection Rollback Error Occured\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void setStatus(TransactionStatus status) {\n this.status = status;\n }", "public void DoTransaction(TransactionCallback callback) {\r\n Transaction tx = _db.beginTx();\r\n try {\r\n callback.doTransaction();\r\n tx.success();\r\n } catch (Exception ex) {\r\n\t\t\tSystem.out.println(\"Failed to do callback transaction.\");\r\n\t\t\tex.printStackTrace();\r\n\t\t\ttx.failure();\r\n\t\t} finally {\r\n\t\t\ttx.finish();\r\n tx.close();\r\n\t\t}\r\n }", "public void endTransaction(int transactionID);", "public void closeTransaction(){\n\t\ttr.rollback();\n\t\ttr = null;\n\t}", "@Override\r\n\tpublic void onError(Object pojo, Method method, Throwable throwable) {\r\n\t\tif (threadLocalEntityManager != null)\r\n\t\t\tthreadLocalEntityManager.rollbackTransaction();\r\n\r\n\t\tlogger.error(\"JPA: TransactionalHandler onError: \", throwable);\r\n\t}", "void commit(Transaction transaction);", "public void onRollbackLastReInitialization(ContainerId containerId) {}", "public Boolean removeTransaction()\n {\n return true;\n }", "public void rollback() throws SQLException {\n\t\tconnection.rollback();\n\t}", "public void beginTransaction() throws Exception;", "public interface onTransactionStatusChangeListener {\n public void onResponse(boolean success);\n }" ]
[ "0.7189756", "0.7120261", "0.7107874", "0.709808", "0.7001101", "0.6980156", "0.69780046", "0.6925179", "0.6857502", "0.6855202", "0.68451256", "0.6762191", "0.6731523", "0.67129046", "0.66981596", "0.66524994", "0.6646384", "0.663933", "0.663919", "0.6625552", "0.6606226", "0.660019", "0.6598957", "0.6507687", "0.65020126", "0.64439386", "0.642823", "0.642263", "0.6414406", "0.638256", "0.6382524", "0.6347608", "0.63265723", "0.6325957", "0.632473", "0.6314038", "0.6295414", "0.6280276", "0.6262057", "0.6239282", "0.6168298", "0.6152086", "0.6149373", "0.61391675", "0.6138745", "0.61305594", "0.61304873", "0.61206305", "0.6118554", "0.61111563", "0.60758126", "0.60569733", "0.6048817", "0.60270184", "0.5965296", "0.5960512", "0.5951574", "0.59415644", "0.59221995", "0.5917804", "0.5914003", "0.59018856", "0.589426", "0.58733296", "0.5872236", "0.5856637", "0.58550686", "0.5847491", "0.58449376", "0.5842521", "0.58314735", "0.5812496", "0.580265", "0.5799896", "0.57793367", "0.5775182", "0.5772008", "0.57593495", "0.56941986", "0.56799877", "0.56785995", "0.5660161", "0.5643851", "0.56396466", "0.56355536", "0.5630967", "0.56080675", "0.55989814", "0.55968165", "0.55885476", "0.55836856", "0.55814976", "0.5564163", "0.5563437", "0.5527303", "0.5504645", "0.55043256", "0.5493111", "0.54915583", "0.5489739" ]
0.7596605
0
initialize your data structure here.
public MinStack() { stack = new Stack<Integer>(); minStack = new Stack<Integer>(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initData() {\n\t}", "private void initData() {\n }", "private void initData() {\n\n }", "public void initData() {\n }", "public void initData() {\n }", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\n\tpublic void initData() {\n\n\n\n\t}", "private void InitData() {\n\t}", "private void initData(){\n\n }", "public AllOOneDataStructure() {\n map = new HashMap<>();\n vals = new HashMap<>();\n maxKey = minKey = \"\";\n max = min = 0;\n }", "@Override\n\tpublic void initData() {\n\t\t\n\t}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\n protected void initData() {\n }", "@Override\n protected void initData() {\n }", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\r\n\tpublic void initData() {\n\t}", "private void initialize() {\n first = null;\n last = null;\n size = 0;\n dictionary = new Hashtable();\n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "public DesignADataStructure() {\n arr = new ArrayList<>();\n map = new HashMap<>();\n }", "@Override\n\tprotected void initData(){\n\t\tsuper.initData();\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "public void initData() {\n\t\tnotes = new ArrayList<>();\n\t\t//place to read notes e.g from file\n\t}", "public static void init() {\n buildings = new HashMap<Long, JSONObject>();\n arr = new ArrayList();\n buildingOfRoom = new HashMap<Long, Long>();\n }", "protected @Override\r\n abstract void initData();", "public void initialize() {\n // empty for now\n }", "void initData(){\n }", "private void initData() {\n\t\tpages = new ArrayList<WallpaperPage>();\n\n\t}", "public void initData(){\r\n \r\n }", "public InitialData(){}", "abstract void initializeNeededData();", "public void initialize()\n {\n }", "public void init()\n {\n this.tripDict = new HashMap<String, Set<Trip>>();\n this.routeDict = new HashMap<String, Double>();\n this.tripList = new LinkedList<Trip>();\n this.computeAllPaths();\n this.generateDictionaries();\n }", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void init() {\n\t\t}", "private void initialize()\n {\n aggregatedFields = new Fields(fieldToAggregator.keySet());\n }", "private void initializeData() {\n posts = new ArrayList<>();\n posts.add(new Posts(\"Emma Wilson\", \"23 years old\", R.drawable.logo));\n posts.add(new Posts(\"Lavery Maiss\", \"25 years old\", R.drawable.star));\n posts.add(new Posts(\"Lillie Watts\", \"35 years old\", R.drawable.profile));\n }", "public void initialize() {\n grow(0);\n }", "public void init() {\n for (int i = 1; i <= 20; i++) {\n List<Data> dataList = new ArrayList<Data>();\n if (i % 2 == 0 || (1 + i % 10) == _siteIndex) {\n dataList.add(new Data(i, 10 * i));\n _dataMap.put(i, dataList);\n }\n }\n }", "public void init() {\n \n }", "private void initData() {\n\t\tnamesInfo = new NameSurferDataBase(fileName);\n\n\t}", "private void initData() {\n requestServerToGetInformation();\n }", "private TigerData() {\n initFields();\n }", "public void initialise() \n\t{\n\t\tthis.docids = scoresMap.keys();\n\t\tthis.scores = scoresMap.getValues();\n\t\tthis.occurrences = occurrencesMap.getValues();\t\t\n\t\tresultSize = this.docids.length;\n\t\texactResultSize = this.docids.length;\n\n\t\tscoresMap.clear();\n\t\toccurrencesMap.clear();\n\t\tthis.arraysInitialised = true;\n\t}", "public void InitData() {\n }", "public void init() {\r\n\r\n\t}", "private void Initialized_Data() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void init() {\n\t\tupdateValues();\r\n\t}", "private void init() {\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "private void initialise() {\n \thashFamily = new Hash[this.r];\n for(int i= 0; i < this.r;i++)\n {\n \tthis.hashFamily[i] = new Hash(this.s * 2);\n }\n this.net = new OneSparseRec[this.r][this.s *2];\n for(int i = 0 ; i < this.r; i++)\n \tfor(int j =0 ; j< this.s * 2 ; j++)\n \t\tthis.net[i][j] = new OneSparseRec();\n \n }", "protected void initialize() {\n \t\n }", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "public DataStructure() {\r\n firstX = null;\r\n lastX = null;\r\n firstY = null;\r\n lastY = null;\r\n size = 0;\r\n }", "private void initialize() {\n }", "private void init()\n\t{\n\t\tif (_invData == null)\n\t\t\t_invData = new InvestigateStore.MappedStores();\n\t}", "private void init() {\n\n\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "private RandomData() {\n initFields();\n }", "public void initialize() {\n\n fechaDeLaVisita.set(LocalDate.now());\n\n if (medico.get() != null) {\n medico.get().clear();\n } else {\n medico.set(new Medico());\n }\n\n turnoVisita.set(\"\");\n visitaAcompanadaSN.set(false);\n lugarVisita.set(\"\");\n if (causa.get() != null) {\n causa.get().clear();\n } else {\n causa.set(new Causa());\n }\n\n if (promocion.get() != null) {\n promocion.get().clear();\n } else {\n promocion.set(new Promocion());\n }\n\n observacion.set(\"\");\n persistida.set(false);\n persistidoGraf.set(MaterialDesignIcon.SYNC_PROBLEM.graphic());\n\n fechaCreacion.set(LocalDateTime.now());\n\n }", "private void initialize() {\n\t\t\n\t}", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "private void initData() {\n\t\tcomboBoxInit();\n\t\tinitList();\n\t}", "void initData() {\r\n\t\tthis.daVinci = new Artist(\"da Vinci\");\r\n\t\tthis.mona = new Painting(daVinci, \"Mona Lisa\");\r\n\t\t//this.lastSupper = new Painting(this.daVinci, \"Last Supper\");\r\n\t}", "public Data() {\n this.customers = new HashMap<>();\n this.orders = new HashMap<>();\n this.siteVisits = new HashMap<>();\n this.imageUploads = new HashMap<>();\n }", "public void init() { \r\n\t\t// TODO Auto-generated method\r\n\t }", "public void initialize() {\r\n }", "public void initialize() {\n // TODO\n }", "private void initValues() {\n \n }", "public void init() {\n\t\t\n\t}", "public void init(){\n\t\tEmployee first = new Employee(\"Diego\", \"Gerente\", \"[email protected]\");\n\t\tHighSchool toAdd = new HighSchool(\"Santiago Apostol\", \"4656465\", \"cra 33a #44-56\", \"3145689879\", 30, 5000, \"Jose\", new Date(1, 3, 2001), 3, \"Servicios educativos\", \"451616\", 15, \"Piedrahita\", 45, 1200, 500);\n\t\ttoAdd.addEmployee(first);\n\t\tProduct pilot = new Product(\"jet\", \"A00358994\", 1.5, 5000);\n\t\tFood firstFood = new Food(\"Colombina\", \"454161\", \"cra 18\", \"454611313\", 565, 60000, \"Alberto\", new Date(1, 8, 2015), 6, \"Manufactura\", 4);\n\t\tfirstFood.addProduct(pilot);\n\t\ttheHolding = new Holding(\"Hertz\", \"15545\", \"cra 39a #30a-55\", \"3147886693\", 80, 500000, \"Daniel\", new Date(1, 2, 2015), 5);\n\t\ttheHolding.addSubordinate(toAdd);\n\t\ttheHolding.addSubordinate(firstFood);\n\t}", "private void initialize() {\n\t}", "public void init() {\n\t\n\t}", "private void initStructures() throws RIFCSException {\n initTexts();\n initDates();\n }", "public AllOOneDataStructure() {\n\t\thead=new Node(\"\", 0);\n\t\ttail=new Node(\"\", 0);\n\t\thead.next=tail;\n\t\ttail.prev=head;\n\t\tmap=new HashMap<>();\n\t}", "@Override public void init()\n\t\t{\n\t\t}", "@objid (\"4bb3363c-38e1-48f1-9894-6dceea1f8d66\")\n public void init() {\n }", "private void initialize() {\n this.pm10Sensors = new ArrayList<>();\n this.tempSensors = new ArrayList<>();\n this.humidSensors = new ArrayList<>();\n }", "private void init() {\n UNIGRAM = new HashMap<>();\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "public void init() {\n\t}", "public void init() {\n\t}", "public void init() {\n\t}", "@SuppressWarnings(\"static-access\")\n\tprivate void initData() {\n\t\tstartDate = startDate.now();\n\t\tendDate = endDate.now();\n\t}" ]
[ "0.7977482", "0.7960524", "0.77892214", "0.77469254", "0.77469254", "0.7558169", "0.7558169", "0.7558169", "0.7558169", "0.7558169", "0.7558169", "0.7555887", "0.74711394", "0.74664557", "0.7456787", "0.7442776", "0.74332404", "0.74293566", "0.74293566", "0.74293566", "0.7424801", "0.7424801", "0.74193865", "0.74193865", "0.7396702", "0.7377209", "0.7337531", "0.7284757", "0.7242543", "0.7239983", "0.7234074", "0.7234074", "0.7198138", "0.71908426", "0.715556", "0.71537024", "0.71223176", "0.7119919", "0.7108915", "0.7079143", "0.7067195", "0.7038099", "0.7007621", "0.70002675", "0.69993395", "0.69971174", "0.6990406", "0.69751334", "0.6956165", "0.69540185", "0.69464344", "0.6929199", "0.69277245", "0.69274646", "0.692011", "0.6919285", "0.6905678", "0.6900472", "0.6888085", "0.68746126", "0.687375", "0.6872683", "0.6862437", "0.6862437", "0.6862437", "0.6862437", "0.6859934", "0.68572277", "0.6854638", "0.68525577", "0.6849266", "0.6842036", "0.684087", "0.6834055", "0.6818388", "0.6818388", "0.6818388", "0.68110853", "0.6810481", "0.67957866", "0.67933977", "0.67928183", "0.6774874", "0.67705756", "0.6769432", "0.6769174", "0.67685276", "0.6758345", "0.67506", "0.67413336", "0.6737609", "0.67348677", "0.67224944", "0.67206126", "0.6720061", "0.6720061", "0.6720061", "0.6716976", "0.6716976", "0.6716976", "0.67100465" ]
0.0
-1
/ http .authorizeRequests() .antMatchers("/css/", "/").permitAll() .antMatchers("/user/").hasRole("USER") .and() .formLogin().loginPage("/login").failureUrl("/loginerror").defaultSuccessUrl("/user/index");
@Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() // Los recursos estáticos no requieren autenticación .antMatchers("/css/**", "/").permitAll() .antMatchers( "/vendors/**", "/img/**", "/js/**", "/scss/**", "/node_modules/**").permitAll() //Asignar permisos a URLs por ROLES .antMatchers("/monedas/**").hasAnyAuthority("ROLE_USER") .antMatchers("/tasas/**").hasAnyAuthority("ROLE_USER") // Todas las demás URLs de la Aplicación requieren autenticación .anyRequest().authenticated() // El formulario de Login no requiere autenticacion //.and().formLogin().permitAll(); //Asi se usa para usar el por dedecto de spring security // El formulario de Login no requiere autenticacion //.and().formLogin().loginPage("/login").permitAll() .and().formLogin().loginPage("/login").failureUrl("/login-error").defaultSuccessUrl("/").permitAll() .and().logout().permitAll(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void configure(HttpSecurity http) throws Exception {\n \thttp\n .authorizeRequests()\n .antMatchers(resources).permitAll() \n .antMatchers(\"/\",\"/index\", \"/usuarioForm\").permitAll()\n .anyRequest().authenticated()\n .and()\n .formLogin()\n .loginPage(\"/login\")\n .permitAll()\n .defaultSuccessUrl(\"/usuarioForm\")\n .failureUrl(\"/login?error=true\")\n .usernameParameter(\"username\")\n .passwordParameter(\"password\")\n .and()\n .csrf().disable()\n .logout()\n .permitAll()\n .logoutSuccessUrl(\"/login?logout\");\n }", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n\n\n http\n .csrf().disable()\n .authorizeRequests()\n .antMatchers(\"/admin/**\").hasRole(\"ADMIN\")\n .antMatchers(\"/anonymous*\").anonymous()\n .antMatchers(\"/login*\").permitAll()\n .anyRequest().authenticated()\n .and()\n .formLogin();\n\n }", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n http.csrf().disable().authorizeRequests()\n .antMatchers(\"/**.html\").permitAll();\n http.httpBasic().and()\n .authorizeRequests().anyRequest().authenticated().and()\n .formLogin().loginPage(\"/login\")\n //.loginProcessingUrl(\"/login\")\n .defaultSuccessUrl(\"/\")\n\n //.successHandler(loginHandler)\n //.failureHandler(failureHandler)\n .permitAll();\n\n\n }", "@Override\r\n\tprotected void configure(HttpSecurity http) throws Exception {\n\t\thttp.authorizeRequests()\r\n\t\t.antMatchers(\"/admin\").hasRole(\"ADMIN\")\r\n\t\t.antMatchers(\"/user\").hasAnyRole(\"USER\",\"ADMIN\")\r\n\t\t.antMatchers(\"/\").permitAll()\r\n\t\t.and().formLogin();\r\n\t}", "@Override\n\tpublic void configure(HttpSecurity httpSecurity) throws Exception {\n\n\t\thttpSecurity.authorizeRequests()\n\t\t\t\t.antMatchers(\"/css/**\").permitAll() // for css folder\n\t\t\t\t.antMatchers(\"/\").hasRole(\"EMPLOYEE\")\n\t\t\t\t.antMatchers(\"/leaders/**\").hasRole(\"MANAGER\")\n\t\t\t\t.antMatchers(\"/systems/**\").hasRole(\"ADMIN\")\n\t\t\t\t.and()\n\t\t\t\t.formLogin()\n\t\t\t\t.loginPage(\"/showMyLoginPage\")\n\t\t\t\t.loginProcessingUrl(\"/authenticateTheUser\") // url provided by spring\n\t\t\t\t.permitAll()\n\t\t\t\t.and().logout().permitAll() // gives logout support, which provides! default url (/logout)\n\t\t\t\t.and().exceptionHandling().accessDeniedPage(\"/access-denied\");\n\n\t}", "@Override\n protected void configure(HttpSecurity http) throws Exception\n {\n http\n .csrf().disable()\n .authorizeRequests()\n\n .antMatchers(\n \"/\",\n \"**/favicon.ico\",\n \"/login**\",\n \"/error/**\",\n \"/webjars/**\",\n \"/img/**\",\n \"/css/**\",\n \"/js/**\").permitAll();\n //.antMatchers(\"/employees/**\").access(\"hasRole('WRITER')\")\n //.antMatchers(\"/**\").access(\"hasRole('ADMIN')\")\n //.and().exceptionHandling().accessDeniedPage(\"/error/403\");\n http\n .authorizeRequests()\n .anyRequest()\n .authenticated();\n http\n .authorizeRequests()\n .and().formLogin()\n //.loginProcessingUrl(\"/j_spring_security_check\")\n //.loginPage(\"/login\")\n .defaultSuccessUrl(\"/\")\n //.failureUrl(\"/login?error=true\")\n .usernameParameter(\"username\").passwordParameter(\"password\")\n .and().logout().logoutUrl(\"/logout\").logoutSuccessUrl(\"/\");\n\n // Config Remember Me.\n http.authorizeRequests().and()\n .rememberMe()\n .tokenRepository(this.persistentTokenRepository())\n .tokenValiditySeconds(1 * 24 * 60 * 60); // 24h\n }", "@Override\r\n\tprotected void configure(HttpSecurity http) throws Exception {\r\n\t\t\t\thttp.authorizeRequests()\r\n\t\t .antMatchers(\"/\").permitAll()\r\n\t\t .antMatchers(\"/h2-console/**\").permitAll()\r\n\t\t .antMatchers(\"/employees.html\").access(\"hasRole('ROLE_ADMIN')\")\r\n\t\t .and().formLogin();\r\n\t\t\r\n\t\t\t\thttp.csrf().disable();\r\n\t\t\t\thttp.headers().frameOptions().disable();\r\n\t}", "@Override\n protected void configure(HttpSecurity http) throws Exception{\n\n http.authorizeRequests()\n .antMatchers(\"/admin/**\").hasRole(\"ADMIN\")\n .antMatchers(\"/manager/**\").hasRole(\"MANAGER\")\n .antMatchers(\"/user/**\").hasRole(\"USER\")\n .antMatchers(\"/\", \"/**\").permitAll() // access of the home page only for authenticated\n .and().formLogin().loginPage(\"/login\");\n\n // cross-side request forgery protection - by default by Spring\n //http.csrf().disable();\n //http.headers().frameOptions().disable();\n }", "@Override\r\n\tprotected void configure(HttpSecurity http) throws Exception {\r\n\t\t\r\n\thttp\r\n\t\t.csrf().disable()\r\n\t\t.authorizeRequests().antMatchers(\"/home\").authenticated()\r\n\t\t.and()\r\n\t\t.formLogin().usernameParameter(\"username\").passwordParameter(\"password\").loginPage(\"/login\")\r\n\t\t.failureUrl(\"/login?error\")\r\n\t .and()\r\n\t .logout().logoutSuccessUrl(\"/login?logout\")\r\n\t .and()\r\n\t .exceptionHandling().accessDeniedPage(\"/403\");\r\n\t\r\n\t\r\n\t\r\n\t}", "@Override\n\tpublic void configure(HttpSecurity http) throws Exception {\n\t\thttp.authorizeRequests()\n\t\t\t\t\t\t.antMatchers(\"/\", \"/css/**\", \"/js/**\", \"/images/**\", \"/listar\").permitAll() // Páginas sin autenticación, puede entrar cualquier usuario sin autenticarse\n\t\t\t\t\t\t.antMatchers(\"/ver/**\").hasAnyRole(\"USER\")\n\t\t\t\t\t\t.antMatchers(\"/uploads/**\").hasAnyRole(\"USER\")\n\t\t\t\t\t\t.antMatchers(\"/form/**\").hasAnyRole(\"ADMIN\") // Solo ADMIN\n\t\t\t\t\t\t.antMatchers(\"/eliminar/**\").hasAnyRole(\"ADMIN\") // Solo ADMIN\n\t\t\t\t\t\t.antMatchers(\"/factura/**\").hasAnyRole(\"ADMIN\") // Solo ADMIN\n\t\t\t\t\t\t.anyRequest().authenticated()\n\t\t\t\t\t\t.and()\n\t\t\t\t\t\t.formLogin().loginPage(\"/login\").permitAll()// Implementamos formulario de login\n\t\t\t\t\t\t.and()\n\t\t\t\t\t\t.logout().permitAll(); \n\t\t\n\t}", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n http.authorizeRequests().antMatchers(\"/login\",\"/register\",\"/addtocart\",\"/view\",\"/\",\"/removecart\",\"/cart\").permitAll().\n antMatchers(\"/checkout\").hasAnyAuthority(\"user\").\n antMatchers(\"/product\").hasAnyAuthority(\"admin\").and().formLogin()\n .loginProcessingUrl(\"/spring_login_check\") // Submit URL\n .loginPage(\"/login\")//\n .defaultSuccessUrl(\"/\")//\n .failureUrl(\"/login?error=true\")//\n .usernameParameter(\"userId\")//\n .passwordParameter(\"password\").and().exceptionHandling().accessDeniedHandler(accessDeniedHandler());\n // Cấu hình cho Logout Page.\n\n }", "@Override\r\n\tprotected void configure(HttpSecurity http) throws Exception {\r\n\t\thttp.authorizeRequests()\r\n\t\t\t\t// \"/admin\" can only be accessed by admin\r\n\t\t\t\t.antMatchers(\"/admin\").hasRole(\"ADMIN\")\r\n\t\t\t\t// \"/user can only be accessed by user\"\r\n\t\t\t\t.antMatchers(\"/user\").hasAnyRole(\"ADMIN\", \"USER\")\r\n\t\t\t\t// \"/\" can be accessed by all.\r\n\t\t\t\t.antMatchers(\"/\").permitAll()\r\n\t\t\t\t// prompt a login form?\r\n\t\t\t\t.and().formLogin();\r\n\t}", "@Override\n public void configure(WebSecurity web) throws Exception {\n web.ignoring().antMatchers(\"/login\");\n }", "@Override\n\tprotected void configure(HttpSecurity http) throws Exception {\n\t\t\n\t http\n\t\t.authorizeRequests()\n\t\t.antMatchers(\"/login\", \"/static/**\", \"/login/**\").permitAll()\n\t\t.antMatchers(\"/oauth/confirm_access\").permitAll()\n\t\t.antMatchers(\"/oauth/token\").permitAll()\n\t\t.antMatchers(\"/oauth/authorize\").permitAll()\n\t\t.antMatchers(\"/student/\").access(\"hasRole('STUDENT')\")\n\t\t.antMatchers(\"/studentview/\").access(\"hasRole('STUDENT')\")\n\t\t.antMatchers(\"/vendor/\").access(\"hasRole('VENDOR')\")\n\t\t.antMatchers(\"/collegeadmin/\").access(\"hasRole('COLLEGEADMIN')\")\n\t\t/*.antMatchers(\"/basicDetail/**\").access(\"hasRole('USER')\")*/\n\t\t.antMatchers(\"/db/\").access(\"hasRole('ADMIN') and hasRole('DBA')\")\n\t\t.antMatchers(\"/admin/\").access(\"hasRole('ADMIN')\").anyRequest().authenticated()\n\t\t.and().formLogin().loginPage(\"/login\").successHandler(customSuccessHandler)\n\t\t.usernameParameter(\"username\").passwordParameter(\"password\")\n\t\t.and()\n\t\t\n\t\t.csrf()\n\t\t.csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse())\n\t\t.requireCsrfProtectionMatcher(new AntPathRequestMatcher(\"/oauth/authorize\"))\n\t\t/*.disable()*/\n\t\t.and()\n\t\t.logout()\n\t\t.logoutUrl(\"/logout\")\n\t\t.and().exceptionHandling().accessDeniedPage(\"/Access_Denied/\")\n\t\t/*.and()\n\t\t.formLogin()\n\t\t.loginProcessingUrl(\"/login\")*/;\n\t}", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n http\n .csrf().disable()\n .sessionManagement()\n .sessionCreationPolicy(SessionCreationPolicy.STATELESS)\n //.antMatchers(\"/api/user/login\").permitAll()\n\n\n //.anyRequest().authenticated()\n .and()\n .addFilterBefore(new JWTLoginFilter(\"/api/user/login\", authenticationManager()),\n UsernamePasswordAuthenticationFilter.class)\n .addFilterBefore(new JWTAuthenticationFilter(),\n UsernamePasswordAuthenticationFilter.class)\n .authorizeRequests()\n //.anyRequest().authenticated()\n .antMatchers(\"/api/user\").hasRole(\"ADMIN\")\n .antMatchers(\"/api/article\").hasRole(\"ADMIN\")\n .antMatchers(\"/api/address/add\").authenticated()\n .antMatchers(\"/api/basket\").authenticated();\n\n }", "@Override\r\n protected void configure(HttpSecurity http) throws Exception {\r\n http.authorizeRequests()\r\n .antMatchers(\"/login\", \"/registration\", \"/resources/**\")\r\n .permitAll()\r\n .antMatchers(\"/**\")\r\n .hasAnyRole(\"ADMIN\", \"USER\")\r\n .and()\r\n .formLogin()\r\n .loginPage(\"/login\")\r\n .defaultSuccessUrl(\"/loginSuccess\")\r\n .failureUrl(\"/login?error=true\")\r\n .permitAll()\r\n .and()\r\n .logout()\r\n .logoutSuccessUrl(\"/login?logout=true\")\r\n .invalidateHttpSession(true)\r\n .permitAll()\r\n .and()\r\n .csrf().disable();\r\n }", "@Override\n\tprotected void configure(HttpSecurity http) throws Exception {\n\t\t\n\t\thttp.csrf();\n\t\t\n\t\thttp.authorizeRequests().antMatchers(\"/css/**\", \"/js/**\", \"/img/**\", \"/bootstrap/**\", \"/resources/**\").permitAll()\n\t\t.antMatchers(\"/\", \"/createAdminUser\", \"/index\", \"/signUp\", \"/user/activate\", \"/news\", \"/about\", \"/contact\", \"/taebo\", \"/crossfit\", \"/aerotonus\", \"/total50\").permitAll()\n .antMatchers(\"/user/**\").hasRole(\"USER\")\n .antMatchers(\"/admin/**\", \"/user/**\").hasRole(\"ADMIN\")\n .anyRequest().authenticated()\n .and().formLogin().loginPage(\"/login\").successForwardUrl(\"/\").failureUrl(\"/login?error\").permitAll().and()\n\t\t.logout().logoutUrl(\"/logout\").logoutSuccessUrl(\"/\");\n\t}", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n http.\n csrf().disable()\n .authorizeRequests()\n .antMatchers(\"/vehicle/add\").hasAuthority(\"User\")\n .antMatchers(\"/employee/register\").hasAuthority(\"Merchant\")\n .anyRequest().authenticated()\n .and().httpBasic();\n /* http.csrf().disable().authorizeRequests()\n .antMatchers(\"/vehicle/add\").hasAuthority(Email)//USER role can access /users/**\n //.antMatchers(\"/admin/**\").has(\"ADMIN\")//ADMIN role can access /admin/**\n // .antMatchers(\"/quests/**\").permitAll()// anyone can access /quests/**\n .anyRequest().authenticated();//any other request just need authentication\n //enable form login\n\n /* http.authorizeRequests().anyRequest().hasAnyRole(\"ADMIN\", \"User\")\n .and()\n .httpBasic(); // Authenticate users with HTTP basic authentication*/\n }", "@Override\r\n\tprotected void configure(HttpSecurity http) throws Exception {\r\n\t\thttp.csrf()\r\n\t\t\t.disable().authorizeRequests()\r\n\t\t\t.antMatchers(\"/**\").hasRole(\"USER\")\r\n\t\t\t.and()\r\n\t\t\t.httpBasic(); // displays browser alerts\r\n\t\t\t//.formLogin(); // dsiplays form\r\n\t}", "@Override\n\tprotected void configure(HttpSecurity http) throws Exception {\n\t\thttp.authorizeRequests().antMatchers(\"/admin/**\").hasRole(\"admin\").antMatchers(\"/user/**\")\n\t\t\t\t.hasAnyRole(\"admin\", \"user\").anyRequest().authenticated().and().formLogin().loginPage(\"/login.html\")\n\t\t\t\t.loginProcessingUrl(\"/login\").successHandler(new AuthenticationSuccessHandler() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onAuthenticationSuccess(HttpServletRequest req, HttpServletResponse resp,\n\t\t\t\t\t\t\tAuthentication authentication) throws IOException, ServletException {\n\t\t\t\t\t\tresp.setContentType(\"application/json;charset=utf-8\");\n\t\t\t\t\t\tSysUsers users = (SysUsers) authentication.getPrincipal();\n\t\t\t\t\t\tusers.setPassword(null);\n\t\t\t\t\t\tPrintWriter out = resp.getWriter();\n\t\t\t\t\t\tList<Object> list = new ArrayList<Object>();\n\t\t\t\t\t\tlist.add(\"success\");\n\t\t\t\t\t\tlist.add(users);\n\t\t\t\t\t\tout.write(new ObjectMapper().writeValueAsString(list));\n\t\t\t\t\t\tout.flush();\n\t\t\t\t\t\tout.close();\n\t\t\t\t\t}\n\t\t\t\t}).failureHandler((req, resp, e) -> {\n\t\t\t\t\tresp.setContentType(\"application/json;charset=utf-8\");\n\t\t\t\t\tPrintWriter out = resp.getWriter();\n\t\t\t\t\tout.write(e.getMessage());\n\t\t\t\t\tout.flush();\n\t\t\t\t\tout.close();\n\t\t\t\t}).permitAll().and().logout()\n\t\t\t\t// 默认注销行为为logout,可以通过下面的方式来修改\n\t\t\t\t.logoutUrl(\"/logout\").logoutSuccessHandler(new LogoutSuccessHandler() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onLogoutSuccess(HttpServletRequest req, HttpServletResponse resp,\n\t\t\t\t\t\t\tAuthentication authentication) throws IOException, ServletException {\n\t\t\t\t\t\tresp.setContentType(\"application/json;charset=utf-8\");\n\t\t\t\t\t\tPrintWriter out = resp.getWriter();\n\t\t\t\t\t\tout.write(new ObjectMapper().createObjectNode().put(\"msg\", \"注销成功!\").toString());\n\t\t\t\t\t\tout.flush();\n\t\t\t\t\t\tout.close();\n\t\t\t\t\t}\n\t\t\t\t}).permitAll().and().csrf().disable().exceptionHandling()\n\t\t\t\t.accessDeniedHandler(new AccessDeniedHandler() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void handle(HttpServletRequest request, HttpServletResponse response,\n\t\t\t\t\t\t\tAccessDeniedException accessDeniedException) throws IOException, ServletException {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tresponse.setCharacterEncoding(\"UTF-8\");\n\t\t\t\t\t\tresponse.setContentType(\"application/json\");\n\t\t\t\t\t\tresponse.getWriter()\n\t\t\t\t\t\t\t\t.println(new ObjectMapper().createObjectNode().put(\"msg\", \"没有权限访问呀!\").toString());\n\t\t\t\t\t\tresponse.getWriter().flush();\n\t\t\t\t\t\tresponse.getWriter().close();\n\n\t\t\t\t\t}\n\t\t\t\t}).authenticationEntryPoint(new AuthenticationEntryPoint() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void commence(HttpServletRequest request, HttpServletResponse response,\n\t\t\t\t\t\t\torg.springframework.security.core.AuthenticationException authException)\n\t\t\t\t\t\t\tthrows IOException, ServletException { // TODO Auto-generated method stub\n\t\t\t\t\t\tresponse.setCharacterEncoding(\"UTF-8\");\n\t\t\t\t\t\tresponse.setContentType(\"application/json\");\n\t\t\t\t\t\tresponse.getWriter()\n\t\t\t\t\t\t\t\t.println(new ObjectMapper().createObjectNode().put(\"msg\", \"请先登录!\").toString());\n\t\t\t\t\t\tresponse.getWriter().flush();\n\t\t\t\t\t\tresponse.getWriter().close();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t//控制一个用户只能在一个客户端登陆\n\t\thttp.sessionManagement().maximumSessions(1).expiredUrl(\"/login\");\n\n\t}", "@Override\n\tpublic void configure(HttpSecurity http) throws Exception {\n\t\thttp.authorizeRequests().antMatchers(\"/\",\"/Inicio\",\"/Contactanos\",\"/Volver a inicio\",\"/Login\",\"/Volver al inicio\",\"/Inicio1\",\"/Contactos1\",\"/Singup1\",\"/Regresa1\"\n\t\t\t\t,\"/Inicio2\",\"/Contactos2\",\"/Singup2\",\"/Descargando book2\",\"/Regresa2\"\n\t\t\t\t,\"/Inicio3\",\"/Contactos3\",\"/Singup3\",\"/Descargando book3\",\"/Regresa3\"\n\t\t\t\t,\"/Inicio4\",\"/Contactos4\",\"/Singup4\",\"/Regresa4\"\n\t\t\t\t,\"/Inicio5\",\"/Contactos5\",\"/Singup5\",\"/Regresa5\",\"/css/**\",\"/img/**\",\"/libros/**\")\n\t\t.permitAll()\n\t\t.antMatchers(\"/book1/**\",\"/book2/**\",\"/book3/**\",\"/book4/**\",\"/book5/**\").hasAnyAuthority(\"Manuel\")\n\t\t.antMatchers(\"/book1/**\",\"/book2/**\",\"/book3/**\",\"/book4/**\",\"/book5/**\").hasAnyRole(\"Perlera89\")\n\t\t.antMatchers(\"/book1/**\",\"/book2/**\",\"/book3/**\",\"/book4/**\",\"/book5/**\").hasAnyAuthority(\"rigo\")\n\t\t.anyRequest().authenticated()\n\t\t.and()\n\t\t.formLogin().loginPage(\"/Login\")\n\t\t.permitAll()\n\t\t.and()\n\t\t.logout().permitAll();\n\t\t}", "@Override\n public void configure(WebSecurity web) throws Exception {\n web\n .ignoring()\n .antMatchers(\"/resources/**\", \"/static/**\", \"/css/**\", \"/js/**\", \"/images/**\",\"/documents/**\");\n }", "@Override\n\tprotected void configure(HttpSecurity http) throws Exception {\n\t\t\n\t\t\t\t\t\n\t\thttp\n\t\t.csrf().disable()\n\t\t.authorizeRequests()\n\t\t.antMatchers(\"/admin/Login**\")\t\n\t\t.permitAll()\n\t\t.antMatchers(\"/admin/**\")\n\t\t.hasAnyRole(\"ADMIN\")\n\t\t.antMatchers(\"/manager/**\")\n\t\t.hasAnyRole(\"ADMIN\",\"MANAGER\")\n\t\t.anyRequest()\n\t\t.permitAll();\n\t\t\n\t\thttp\n\t\t.formLogin()\n\t\t.loginProcessingUrl(\"/admin/Login\")\n\t\t.loginPage(UrlConstance.LOGIN_URL)\n\t\t.usernameParameter(\"email\")\n\t\t.passwordParameter(\"password\")\n\t\t.defaultSuccessUrl(\"/default\")\n\t\t.failureUrl(\"/Login?error=true\");\n\t\t\n\t\thttp.logout()\n\t\t.logoutUrl(\"/admin/Logout\")\n\t\t.logoutSuccessUrl(UrlConstance.LOGIN_URL)\n\t\t.deleteCookies(\"JSESSIONID\");\n\t\t\n\t\thttp.exceptionHandling()\n\t\t.accessDeniedPage(\"/error/403\");\n\n\t}", "@RequestMapping(value = \"/login\", method = RequestMethod.GET)\n public ModelAndView login() {\n ModelAndView modelAndView = new ModelAndView();\n modelAndView.setViewName(\"user/login\");\n return modelAndView;\n }", "@RequestMapping(\"login\")\r\n\tpublic String loginUser() {\n\t\treturn \"login\";\r\n\t}", "@PreAuthorize(\"hasRole('ADMIN') AND hasRole('USER')\") \n\t@RequestMapping(\"/home\")\n @ResponseBody\n public String home(){\n\t return \"home\";\n }", "@Override\n\tprotected void configure(HttpSecurity http) throws Exception {\n\t\thttp.authorizeRequests().antMatchers(\"/\", \"/home\").permitAll().antMatchers(\"/admin\").hasRole(\"ADMIN\")\n\t\t.anyRequest().authenticated().and().formLogin().failureUrl(\"/login?error\").permitAll()\n\t\t.and()//.addFilterAfter(loginFilter(), BasicAuthenticationFilter.class)\n\t\t.logout().logoutRequestMatcher(new AntPathRequestMatcher(\"/logout\"));\n\t\thttp.exceptionHandling().accessDeniedPage(\"/error\");\n\t\t/*\n\t\t * http.csrf().disable().authorizeRequests().antMatchers(\"/getlist\").hasAnyRole(\n\t\t * \"user\").and().formLogin();\n\t\t * http.csrf().disable().authorizeRequests().antMatchers(\"/home\").hasAnyRole(\n\t\t * \"user\").and().formLogin();\n\t\t * http.csrf().disable().authorizeRequests().antMatchers(\"/mainHome\").hasAnyRole\n\t\t * (\"user\").and().formLogin();\n\t\t * http.csrf().disable().authorizeRequests().antMatchers(\"/index\").hasAnyRole(\n\t\t * \"user\").and().formLogin();\n\t\t * http.csrf().disable().authorizeRequests().antMatchers(\"/empform\").hasAnyRole(\n\t\t * \"user\").and().formLogin();\n\t\t * http.csrf().disable().authorizeRequests().antMatchers(\"/getDepartmentslist\").\n\t\t * hasAnyRole(\"admin\").and().formLogin();\n\t\t * http.csrf().disable().authorizeRequests().antMatchers(\"/departmentform\").\n\t\t * hasAnyRole(\"admin\").and().formLogin();\n\t\t * http.csrf().disable().authorizeRequests().antMatchers(\"/mainHome\").hasAnyRole\n\t\t * (\"admin\").and().formLogin();\n\t\t */\n\n\t}", "@Override\r\n\tprotected void configure(HttpSecurity http) throws Exception {\n\t\thttp.authorizeRequests().antMatchers(\"/admin\").hasRole(\"ADMIN\").antMatchers(\"/user\").hasRole(\"USER\")\r\n\t\t\t\t.antMatchers(\"/\").permitAll().antMatchers(\"/h2-console/**\").permitAll().and().formLogin();\r\n\r\n\t\thttp.csrf().disable();\r\n\t\thttp.headers().frameOptions().disable();\r\n\t}", "@GetMapping(\"/login\")\n public String viewLoginPage() {\n\n return \"login/login\";\n }", "@Override\n\tprotected void configure(HttpSecurity http) throws Exception {\n\t\thttp.cors().and().csrf().disable()\n\t\t\t.exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()\n\t\t\t.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()\n\t\t\t.authorizeRequests()\n\t\t\t.antMatchers(\"/admin/teamsize/**\").hasAnyRole(\"ADMIN\", \"STUDENT\")\n\t\t\t.antMatchers(\"/admin/**\").hasRole(\"ADMIN\")\n//\t\t\t.antMatchers(\"/user/register\").hasRole(\"ADMIN\")\n\t\t\t.antMatchers(\"/guide/**\").hasAnyRole(\"GUIDE\",\"ADMIN\")\n\t .antMatchers(\"/student/**\").hasAnyRole(\"STUDENT\",\"ADMIN\")\n\t\t\t//.antMatchers(\"/student/**\").permitAll()\n\t\t\t.antMatchers(\"/user/**\").permitAll()\n\t .antMatchers(\"/\").hasAnyRole(\"ADMIN\",\"GUIDE\",\"STUDENT\")\n\t .antMatchers(\"/v2/api-docs\", \"/configuration/**\", \"/swagger*/**\", \"/webjars/**\").permitAll().anyRequest().authenticated();\n//\t\t\t.and()\n//\t\t\t.formLogin().loginPage(\"/user/login\").permitAll();\n\t\t\n\t\t // If a user try to access a resource without having enough permissions\n//\t\thttp.exceptionHandling().accessDeniedPage(\"/user/login\");\n\t\thttp.addFilterBefore(authTokenFilter, UsernamePasswordAuthenticationFilter.class);\n\t}", "@Override\n public void configure(WebSecurity web) throws Exception {\n web\n .ignoring()\n .antMatchers(\"/*.js\",\"/css/*.css\",\"/*.ico\",\"/*.json\");\n }", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n\n http.authorizeRequests()\n .antMatchers(\"/\").permitAll()\n .antMatchers(\"/admin/**\")\n .access(\"hasRole('USER') or hasRole('ADMIN') or hasRole('DBA')\")\n .antMatchers(\"/user/updatePassword*\", \"/user/savePassword*\", \"/updatePassword*\").hasAuthority(\"CHANGE_PASSWORD_PRIVILEGE\")\n .and()\n .formLogin()\n .loginPage(\"/login\")\n .loginProcessingUrl(\"/login\").usernameParameter(\"userName\").passwordParameter(\"password\")\n .defaultSuccessUrl(\"/admin/dashboard\")\n \n .and()\n .sessionManagement()\n //.invalidSessionUrl(\"/invalidSession.html\")\n // .invalidSessionUrl(\"/invalidSession\")\n .maximumSessions(1).sessionRegistry(sessionRegistry()).and()\n .sessionFixation().none()\n .and()\n .logout()\n //.logoutSuccessHandler(myLogoutSuccessHandler)\n //.invalidateHttpSession(false)\n //.logoutSuccessUrl(\"/login?logSucc=true\")\n .deleteCookies(\"JSESSIONID\")\n .permitAll() \n \n .and()\n .rememberMe().rememberMeParameter(\"remember-me\").tokenRepository(tokenRepository)\n //.tokenValiditySeconds(86400).and().csrf().and().exceptionHandling().accessDeniedPage(\"/Access_Denied\");\n .tokenValiditySeconds(86400).and().csrf().disable().exceptionHandling().accessDeniedPage(\"/Access_Denied\");\n \n /* \n .failureUrl(\"/login?error=true\")\n .successHandler(myAuthenticationSuccessHandler)\n .failureHandler(authenticationFailureHandler)\n .and()\n .sessionManagement()\n //.invalidSessionUrl(\"/invalidSession.html\")\n .invalidSessionUrl(\"/invalidSession.html\")\n .maximumSessions(1).sessionRegistry(sessionRegistry()).and()\n .sessionFixation().none()\n .and()\n .logout()\n .logoutSuccessHandler(myLogoutSuccessHandler)\n .invalidateHttpSession(false)\n .logoutSuccessUrl(\"/logout.html?logSucc=true\")\n .deleteCookies(\"JSESSIONID\")\n .permitAll() \n \n .and()\n .rememberMe().rememberMeParameter(\"remember-me\").tokenRepository(tokenRepository)\n //.tokenValiditySeconds(86400).and().csrf().and().exceptionHandling().accessDeniedPage(\"/Access_Denied\");\n .tokenValiditySeconds(86400).and().csrf().disable().exceptionHandling().accessDeniedPage(\"/Access_Denied\");\n \n */\n \n \n }", "@GetMapping(\"/login-success\")\n public ModelAndView loginSuccess(){\n return new ModelAndView(\"index\");\n }", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n http\n .csrf().disable()\n .authorizeRequests()\n .mvcMatchers(HttpMethod.POST,\"*/users\").permitAll()\n .mvcMatchers(HttpMethod.GET,\"*/users\").hasRole(\"ADMIN\")\n .mvcMatchers(\"/spaces\").hasRole(\"USER,ADMIN\")\n .anyRequest().authenticated()\n .and().httpBasic()\n .and().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)\n .and().sessionManagement().disable();\n }", "@RequestMapping(value=\"/\" , method = RequestMethod.GET)\n public ModelAndView welcome_login(){\n Authentication authentication = SecurityContextHolder.getContext().getAuthentication();\n String currentUserName = authentication.getName();\n\n UserEntity userEntity= iUserService.findUserByCurrentUserName(currentUserName);\n ModelAndView welcome = new ModelAndView(\"welcome\");\n welcome.getModel().put(\"currentUserName\", currentUserName);\n welcome.getModel().put(\"userEntity\", userEntity);\n\n return welcome;\n }", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n http.authorizeRequests()\n .antMatchers(\"/greet/director\").hasRole(\"Director\")\n .and()\n .authorizeRequests()\n .antMatchers(\"/greet/avenger\").hasAnyRole(\"Director\", \"Avenger\")\n .and()\n .authorizeRequests()\n .antMatchers(\"/greet\").permitAll()\n .and().httpBasic(); // to allow api calls from post mand with basic auth\n\n // so that it also allow login / logout via browser\n http.formLogin()\n .loginPage(\"/login\").permitAll()\n .and()\n .logout().permitAll();\n }", "@GetMapping(\"/login\")\n public String showLogin(Model model){\n model.addAttribute(\"user\", new User());\n return \"loginForm\";\n }", "@GetMapping(\"login\")\n public String loginForm(Model model){\n model.addAttribute(\"user\", new User());\n return \"login_form\";\n }", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n\n http\n .authorizeRequests().antMatchers(\"/oauth/**\", \"/login/**\", \"/logout\", \"/webjars/**\").permitAll()\n .and()\n .authorizeRequests().anyRequest().authenticated()\n .and()\n .formLogin().and()\n .httpBasic();\n }", "@GetMapping(path = \"/addUser\")\n @PreAuthorize(\"hasAnyRole('ROLE_ADMIN')\")\n public String addUser(Model model){\n return \"addUser\";\n }", "@Override\n\tprotected void configure(HttpSecurity http) throws Exception {\n\n\t\t// @formatter:off\n\t\thttp\n\t\t\t.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and().authorizeRequests().antMatchers(HttpMethod.OPTIONS).anonymous()\n\t\t\t.and()\n\t\t\t.csrf().disable()\n\t\t\t.authorizeRequests().antMatchers(\"/rest/inscription\",\"/rest/inscription/**\").permitAll()\n\t\t\t.and()\n\t\t\t.authorizeRequests().antMatchers(\"/rest/**\").permitAll()//authenticated().and().httpBasic()\n\n\t\t\t.and()\n\t\t\t.authorizeRequests().anyRequest().permitAll(); //\n//\t\thttp.authorizeRequests()\n//\t\t\t.antMatchers(\"/\").permitAll()\n//\t\t\t.antMatchers(\"/bootstrap/**\").permitAll()\n//\t\t\t.antMatchers(\"/matiere\",\"/matiere/**\").hasAnyRole(\"ADMIN\")\n//\t\t\t.antMatchers(\"/admin\",\"/admin/**\").authenticated()\n//\t\t\t.antMatchers(\"/**\").authenticated().and()\n//\t\t\t.formLogin()\n//\t\t\t\t.loginPage(\"/login\")\n//\t\t\t\t//.loginProcessingUrl(\"/perform\")//page qui apparait pendant l'authentification\n//\t\t\t\t.defaultSuccessUrl(\"/home\")\n//\t\t\t\t.failureUrl(\"/login?error=true\").permitAll()\n//\t\t\t.and()\n//\t\t\t.logout().logoutUrl(\"/logout\").logoutSuccessUrl(\"/\").permitAll();\n\t\t// @formatter:on\n\t}", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n http.authorizeRequests().antMatchers(\"/v2/api-docs\",\n \"/configuration/ui\",\n \"/swagger-resources/**\",\n \"/configuration/security\",\n \"/swagger-ui.html\",\n \"/webjars/**\").permitAll();\n\n http.authorizeRequests()\n .antMatchers(\"/\", \"/css/**\", \"/js/**\", \"/images/**\").permitAll()\n .anyRequest()\n .authenticated()\n .and()\n .addFilter(new JWTAuthenticationFilter(authenticationManager(), jwtService))\n .addFilter(new JWTAuthorizationFilter(authenticationManager(), jwtService))\n .csrf().disable()\n .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);\n }", "@GetMapping(\"/loginpage\")\n public String viewLoginPage() {\n return \"loginpage\";\n }", "@RequestMapping(value = \"/login\", method = RequestMethod.GET)\r\n\tpublic ModelAndView login() {\r\n\t\treturn new ModelAndView(\"admin/login\");\r\n\t}", "@Override\n public void configure(WebSecurity web) throws Exception {\n web\n .ignoring()\n .antMatchers(\"/resources/**\");\n }", "public void configure(HttpSecurity http) throws Exception{\n\t\thttp.csrf().disable();\n\t\thttp.headers().frameOptions().disable();\n\t\thttp.authorizeRequests()\n\t\t.antMatchers(\"/list\").hasRole(\"PROFESSOR\")\n\t\t.antMatchers(\"/add\").hasRole(\"PROFESSOR\")\n\t\t.antMatchers(\"/view\").hasAnyRole(\"PROFESSOR\",\"STUDENT\")\n\t\t.antMatchers(HttpMethod.POST, \"/register\").permitAll()\n\t\t.antMatchers(\"/\", \"/register\", \"/css/**\", \"/images/**\", \"/js/**\", \"/**\").permitAll()\n\t\t.antMatchers(\"/h2-console/**\").permitAll()\n\t\t.anyRequest().authenticated()\n\t\t.and()\n\t\t.formLogin()\n\t\t.loginPage(\"/login\")\n\t\t.permitAll()\n\t\t.and()\n\t\t.logout()\n\t\t.invalidateHttpSession(true)\n\t\t.clearAuthentication(true)\n\t\t.logoutRequestMatcher(new AntPathRequestMatcher(\"/logout\"))\n\t\t.logoutSuccessUrl(\"/login?logout\")\n\t\t.permitAll()\n\t\t.and()\n\t\t.exceptionHandling()\n\t\t.accessDeniedHandler(accessDeniedHandler);\n\t}", "protected void configure(HttpSecurity http) throws Exception {\n\n http.csrf().disable();//pour desactiver les failles csrf\n http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);\n http.authorizeRequests().antMatchers(\"/login/**\",\"/register/**\",\"/**\").permitAll();\n\n http.authorizeRequests().anyRequest().authenticated();//pour indiquer à spring que toutes les ressource doivent etre authentifier\n //http.addFilter(new JWTauthentificationFilter(authenticationManager()));\n //http.addFilterBefore(new JWTauthorizationFilter(), UsernamePasswordAuthenticationFilter.class);\n\n http.logout().logoutUrl(\"/logout\");\n http.logout().logoutRequestMatcher(new AntPathRequestMatcher(\"/logout\"))\n .logoutSuccessUrl(\"/?logout\").deleteCookies(\"remember-me\").permitAll()\n .and()\n .rememberMe();\n http.formLogin().failureForwardUrl(\"/login?error\");\n }", "@Override\n public void configure(WebSecurity web) throws Exception {\n web.ignoring().antMatchers(HttpMethod.GET,\"/api/posts/**\")\n .antMatchers(\"api/users/**\");\n }", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n http\n .csrf().disable();\n// .loginPage(\"/login\").and().logout().permitAll();\n// .authorizeRequests().anyRequest().authenticated()\n// .and().httpBasic()\n// .httpBasic()\n// .and().sessionManagement().disable();\n }", "@RequestMapping(\"/\")\n public String home(HttpServletRequest request) {\n if(!request.isUserInRole(\"ROLE_ADMIN\")){\n return \"home\";\n }\n else {\n return \"redirect:/admin/pocetna\";\n }\n }", "@RequestMapping(value = \"/403\", method = RequestMethod.GET)\n \tpublic ModelAndView accesssDenied() {\n\n \t ModelAndView model = new ModelAndView();\n \t\t\n \t //check if user is login\n \t Authentication auth = SecurityContextHolder.getContext().getAuthentication();\n \t if (!(auth instanceof AnonymousAuthenticationToken)) {\n \t\tUserDetails userDetail = (UserDetails) auth.getPrincipal();\t\n \t\tmodel.addObject(\"username\", userDetail.getUsername());\n \t }\n \t\t\n \t model.setViewName(\"403\");\n \t return model;\n\n \t}", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n VaadinSpringSecurity.configure(http);\n // Ignore the login processing url and vaadin endpoint calls\n http.csrf().ignoringAntMatchers(\"/login\", \"/connect/**\");\n // specify the URL of the login view, the value of the parameter\n // is the defined route for the login view component.\n http.formLogin().loginPage(\"/login\").permitAll();\n }", "@Override\n\tprotected void configure(HttpSecurity security) throws Exception{\n\t\t\n\t\tsecurity.authorizeRequests()\n\t\t\t.antMatchers(\"/\").permitAll()\n\t\t\t.antMatchers(\"/member/**\").fullyAuthenticated()\n\t\t\t.antMatchers(\"/manager/**\").hasRole(\"MANAGER\")\n\t\t\t.antMatchers(\"/admin/**\").hasRole(\"ADMIN\");\n\t\t\n\t\tsecurity.csrf().disable();\n//\t\tsecurity.formLogin();\n\t\tsecurity.formLogin().loginPage(\"/login\").defaultSuccessUrl(\"/loginSuccess\", true);\n\t\tsecurity.exceptionHandling().accessDeniedPage(\"/accessDenied\");\n\t\tsecurity.logout().invalidateHttpSession(true).logoutSuccessUrl(\"/login\");\n\t\t\n\t\tsecurity.userDetailsService(boardUserDetailService);\n\t}", "@Override\n public void configure(HttpSecurity http) throws Exception {\n\n String[] unsecuredResources = new String[] { \"/login\", \"/security/**\", \"/services/rest/login\",\n \"/services/rest/logout\" };\n\n http\n //\n .userDetailsService(this.userDetailsService)\n // define all urls that are not to be secured\n .authorizeRequests().antMatchers(unsecuredResources).permitAll().anyRequest().authenticated().and()\n\n // activate crsf check for a selection of urls (but not for login & logout)\n .csrf().requireCsrfProtectionMatcher(new CsrfRequestMatcher()).and()\n\n // configure parameters for simple form login (and logout)\n .formLogin().successHandler(new SimpleUrlAuthenticationSuccessHandler()).defaultSuccessUrl(\"/\")\n .failureUrl(\"/login.html?error\").loginProcessingUrl(\"/j_spring_security_login\").usernameParameter(\"username\")\n .passwordParameter(\"password\").and()\n // logout via POST is possible\n .logout().logoutSuccessUrl(\"/login.html\").and()\n\n // register login and logout filter that handles rest logins\n .addFilterAfter(getSimpleRestAuthenticationFilter(), BasicAuthenticationFilter.class)\n .addFilterAfter(getSimpleRestLogoutFilter(), LogoutFilter.class);\n\n if (this.corsEnabled) {\n http.addFilterBefore(getCorsFilter(), CsrfFilter.class);\n }\n }", "@Override\n\tprotected void configure(HttpSecurity http) throws Exception {\n\n\t\t// Cái csrf là cái middle gì đó nó được RUN khi extends\n\t\t// WebSecurityConfigurerAdapter\n\t\t// Cái này có tác dụng Ngăn chặn cái gì đó (hiện tại đang thấy nó đang ngăn chặn\n\t\t// method POST, không ngăn chặn GET)\n\t\t// đoạn code http.csrf().ignoringAntMatchers sẽ là từ bỏ việc ngăn chặn, tức là\n\t\t// cho nó hoạt động\n\t\thttp.csrf().disable(); // TẮT lệnh này cũng bị lỗi 405\n\t\t// BẬT lệnh này bị lỗi 405\n\t\t// http.csrf().ignoringAntMatchers(\"/ajax/**\");\n\n\t\t// Các trang không yêu cầu login\n\t\thttp.authorizeRequests().antMatchers(\"/\", \"/login\", \"/logout\", \"/admin/login\").permitAll();\n\n\t\t// Trang /userInfo yêu cầu phải login với vai trò ROLE_USER hoặc ROLE_ADMIN.\n\t\t// Nếu chưa login, nó sẽ redirect tới trang /login.\n\t\thttp.authorizeRequests().antMatchers(\"/checkout/payment\").access(\"hasAnyRole('ROLE_USER', 'ROLE_ADMIN')\");\n\t\thttp.authorizeRequests().antMatchers(\"/comment/**\").access(\"hasAnyRole('ROLE_USER', 'ROLE_ADMIN')\");\n\t\thttp.authorizeRequests().antMatchers(\"/account/**\").access(\"hasAnyRole('ROLE_USER', 'ROLE_ADMIN')\");\n\n\t\t// Trang chỉ dành cho ADMIN\n\t\thttp.authorizeRequests().antMatchers(\"/admin/**\").access(\"hasRole('ROLE_ADMIN')\");\n\t\thttp.authorizeRequests().antMatchers(\"/api/v1/admin/**\").access(\"hasRole('ROLE_ADMIN')\");\n\n\t\t// Khi người dùng đã login, với vai trò XX.\n\t\t// Nhưng truy cập vào trang yêu cầu vai trò YY,\n\t\t// Ngoại lệ AccessDeniedException sẽ ném ra.\n\t\thttp.authorizeRequests().and().exceptionHandling().accessDeniedPage(\"/403\");\n\n\t\t// Cấu hình cho Login Form.\n\t\thttp.authorizeRequests().and().formLogin()\n\t\t\t\t// Chỉ định Url sẽ được submit login\n\t\t\t\t// Khi submit URL này thì Security sẽ gọi Provider đã được setup ở\n\t\t\t\t// configureGlobal để xử lý check\n\t\t\t\t// .loginProcessingUrl(\"/j_spring_security_check\") // Submit URL\n\t\t\t\t.loginProcessingUrl(\"/login-check\") // Submit URL\n\t\t\t\t.loginPage(\"/login\")//\n\t\t\t\t.defaultSuccessUrl(\"/home\")//\n\t\t\t\t.failureUrl(\"/login?error=true\")//\n\t\t\t\t.usernameParameter(\"username\")//\n\t\t\t\t.passwordParameter(\"password\");\n//\t\t\t\t.successHandler(authenticationSuccessHandler);\n\n\t\t// Cấu hình cho Logout Page.\n\t\thttp.authorizeRequests().and().logout().logoutUrl(\"/logout\").logoutSuccessUrl(\"/home\");\n\n\t\t// Cấu hình Remember Me.\n\t http.authorizeRequests().and() //\n\t .rememberMe()\n\t // .alwaysRemember(true) // default : false : ko remember, phải chọn remember\n\t .rememberMeParameter(\"remember-me\") // default : remember-me\n\t .rememberMeCookieName(\"RememberMeApp\") // default : remember-me\n\t .tokenRepository(this.persistentTokenRepository()) //\n\t .tokenValiditySeconds(1 * 24 * 60 * 60); // custom 24h // default : 2 weeks\n\t}", "@Override\n protected void configure(HttpSecurity http) throws Exception{\n http\n .csrf().disable()\n .httpBasic().disable()\n .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)\n .and()\n .authorizeRequests()\n .antMatchers(HttpMethod.GET, \"/home\").permitAll()\n .antMatchers(HttpMethod.POST, \"/login\").permitAll()\n .antMatchers(HttpMethod.GET, \"/signup\").permitAll()\n .antMatchers(HttpMethod.POST,\"/signup\").permitAll()\n .antMatchers(HttpMethod.GET, \"/verifyemail/**\").permitAll()\n .antMatchers(HttpMethod.GET,\"/userinfo\").authenticated()\n .antMatchers(HttpMethod.PUT, \"/userinfo\").authenticated()\n .antMatchers(HttpMethod.GET, \"/resetpassword/**\").permitAll()\n .antMatchers(HttpMethod.PUT, \"/resetpassword/newpassword/**\").permitAll()\n .antMatchers(HttpMethod.POST, \"/resetpassword\").permitAll()\n .antMatchers(HttpMethod.PUT, \"/resetimage\").authenticated()\n .anyRequest().permitAll()\n .and()\n .apply(new JwtConfigurer(jwtTokenProvider));\n }", "@RequestMapping(\"/login\")\n\tpublic String login() {\n\t\tconfig.output();\n\t\tAuthentication auth = SecurityContextHolder.getContext().getAuthentication();\n\t\tif (auth instanceof AnonymousAuthenticationToken) {\n\t\t\treturn \"login\";\n\t\t} else {\n\t\t\treturn \"home\"; \n\t\t}\n\t}", "@Override\n public void init(HttpSecurity http) throws Exception {\n http\n // disable csrf because of API mode\n .csrf().disable().sessionManagement()\n .sessionCreationPolicy(SessionCreationPolicy.STATELESS)\n\n .and()\n // manage routes securisation here\n .authorizeRequests().antMatchers(HttpMethod.OPTIONS).permitAll()\n\n // manage routes securisation here\n .and().authorizeRequests().antMatchers(HttpMethod.OPTIONS).permitAll()\n\n .antMatchers(\"/logout\", \"/\", \"/unsecured\").permitAll() //\n // .antMatchers(\"/**/catalog\").authenticated() //\n // .antMatchers(\"/**/catalog\").hasRole(\"CATALOG_MANAGER\") //\n\n .anyRequest().authenticated();\n\n }", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n http.csrf().disable()\n // Register our CustomRequestCache that saves unauthorized access attempts, so\n // the user is redirected after login.\n .requestCache().requestCache(new CustomRequestCache())\n // Restrict access to our application.\n .and().authorizeRequests()\n // Allow all flow internal requests.\n .requestMatchers(SecurityUtils::isFrameworkInternalRequest).permitAll() //\n // Allow all requests by logged in users.\n .anyRequest().authenticated()\n // Configure the login page.\n .and().formLogin().loginPage(LOGIN_URL).permitAll()\n .loginProcessingUrl(LOGIN_PROCESSING_URL)\n .failureUrl(LOGIN_FAILURE_URL)\n // Configure logout\n .and()\n .logout(logout -> logout\n .logoutUrl(LOGOUT_URL)\n .logoutSuccessUrl(LOGOUT_SUCCESS_URL)\n .invalidateHttpSession(true)\n .deleteCookies()\n );\n }", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n http.authorizeRequests()\n .antMatchers(\"/\", \"/home\", \"/error\", \"/api/**\", \"/css/**\", \"/img/**\", \"/js/**\").permitAll()\n .antMatchers(\"/admin\").hasAnyAuthority(\"WEBADMIN\", \"DBADMIN\")\n .antMatchers(h2ConsolePath + \"/**\").hasAuthority(\"DBADMIN\")\n .antMatchers(\"/**\").hasAuthority(\"WEBADMIN\")\n .and()\n .formLogin().loginPage(\"/login\").permitAll().successHandler(successHandler())\n .and()\n .logout().permitAll();\n\n // H2 Console security config\n http.csrf().ignoringAntMatchers(h2ConsolePath + \"/**\");\n http.headers().frameOptions().disable();\n }", "@GetMapping(value={\"/login\"})\n public String login(){\n return \"login\";\n }", "@Override\n\tprotected void configure(HttpSecurity http) throws Exception {\n\t\thttp.authorizeRequests().antMatchers(EMPLOYEE_ROLES_HOME_PAGE_URL_ACCESS)\n\t\t\t\t.hasAnyRole(\"EMPLOYEE\", \"ADMIN\", \"MANAGER\").antMatchers(MANAGER_ROLES_PAGE_URL_ACCESS)\n\t\t\t\t.hasRole(\"MANAGER\").antMatchers(ADMIN_ROLES_PAGE_URL_ACCESS).hasRole(\"ADMIN\").and().formLogin()\n\t\t\t\t.loginPage(LOGIN_PAGE_URL).loginProcessingUrl(LOGIN_PROCESSING_URL_TO_AUTHENTICATE).permitAll().and()\n\t\t\t\t.logout().permitAll().and().exceptionHandling().accessDeniedPage(ACCESS_DENIED_MAPPING_URL);\n\t}", "protected void configure(HttpSecurity http) throws Exception {\n http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)\n .and()\n .cors().configurationSource(new CorsConfigurationSource() {\n @Override\n public CorsConfiguration getCorsConfiguration(HttpServletRequest request) {\n CorsConfiguration config = new CorsConfiguration();\n config.setAllowedOrigins(Collections.singletonList(\"http://localhost:4200\"));\n config.setAllowedMethods(Collections.singletonList(\"*\"));\n config.setAllowCredentials(true);\n config.setAllowedHeaders(Collections.singletonList(\"*\"));\n config.setExposedHeaders(Arrays.asList(\"Authorization\"));\n config.setMaxAge(3600L);\n return config;\n }\n }).and().csrf().disable()\n .addFilterBefore(new RequestValidationBeforeFilter(), BasicAuthenticationFilter.class)\n .addFilterAfter(new AuthoritiesLoggingAfterFilter(),BasicAuthenticationFilter.class)\n .addFilterBefore(new JWTTokenValidatorFilter(), BasicAuthenticationFilter.class)\n .addFilterAfter(new JWTTokenGeneratorFilter(), BasicAuthenticationFilter.class)\n .addFilterAt(new AuthoritiesLoggingAtFilter(),BasicAuthenticationFilter.class)\n .authorizeRequests()\n .antMatchers(\"/accounts\").hasRole(\"USER\")\n .antMatchers(\"/balance\").hasAnyRole(\"USER\",\"ADMIN\")\n .antMatchers(\"/loans\").hasRole(\"ROOT\")\n .antMatchers(\"/cards\").authenticated()\n .antMatchers(\"/notice\").permitAll()\n .antMatchers(\"/contact\").permitAll()\n .antMatchers(\"/welcome\").permitAll()\n .and()\n .formLogin()\n .and()\n .httpBasic();\n }", "@RequestMapping(value = \"/login\", method = RequestMethod.GET)\n public String login(Principal principal) { \n return principal == null ? \"login\" : \"index\";\n }", "@GetMapping(\"/loginForm\")\n\t\tpublic String login() {\n\t\t\treturn\"user/loginForm\";\n\t\t}", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n\n http\n .authorizeRequests()\n // The code below is to allow H2 console to be accessed (even for users that are not logged in)\n .antMatchers(\"/h2/**\", \"/console/**\").permitAll()\n\n .antMatchers(\"/index\", \"/\", \"/**\").hasAnyRole(\"USER\")\n .antMatchers(\"/api\").hasAnyRole(\"USER\")\n .antMatchers(\"/period/**\").hasAnyRole(\"ADMIN\")\n\n .anyRequest().authenticated()\n .and()\n .formLogin().loginPage(\"/login\").permitAll()\n .and()\n .logout().permitAll()\n .logoutSuccessUrl(\"/login\")\n .and()\n .exceptionHandling().accessDeniedHandler(accessDeniedHandler);\n\n http.csrf().disable();\n http.headers().frameOptions().disable();\n }", "@GetMapping(value = \"/\")\n public String indexLoginLogout(@RequestParam(value = \"error\", required = false) String error,\n @RequestParam(value = \"logout\", required = false) String logout,\n Model model, HttpServletRequest request) throws WebException{\n model.addAttribute(\"error\", error != null);\n model.addAttribute(\"logout\", logout != null);\n model.addAttribute(\"date\", new Date());\n String login = SecurityContextHolder.getContext().getAuthentication().getName();\n model.addAttribute(\"login\", login);\n String role = String.valueOf(model.asMap().get(\"role\"));\n if((role != null) && !(role.equals(\"null\"))) {\n try {\n //putting userId into to session!!!!!!\n long userId = userService.findByLogin(login).getId();\n request.getSession(true).setAttribute(\"user_id\", userId);\n if (role.matches(\"CLIENT\")) {\n return \"redirect:/market/user/usermain\";\n } else if (role.matches(\"ADMIN\")) {\n return \"redirect:/market/admin/adminmain\";\n }\n } catch (ServiceException e) {\n throw new WebException(e);\n }\n }\n return \"index\";\n }", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n http\n .csrf().csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse())\n .and()\n .authorizeRequests()\n .antMatchers(\"/api/test\",\"/api/login\",\"/api/register\",\"/api/populate\",\"/#/**\",\"/\").permitAll()\n .antMatchers(\"/api/admin/**\").hasRole(\"ADMIN\")\n .antMatchers(\"/api/**\").hasRole(\"USER\")\n .anyRequest().authenticated()\n .and()\n .exceptionHandling()\n .and()\n .sessionManagement()\n .sessionCreationPolicy(SessionCreationPolicy.STATELESS);\n http.addFilterBefore(jwtFilter, UsernamePasswordAuthenticationFilter.class);\n }", "@RequestMapping(value = \"/Access_Denied\", method = RequestMethod.GET)\n public String accessDeniedPage(ModelMap model) {\n model.addAttribute(\"loggedinuser\", appService.getPrincipal());\n return \"accessDenied\";\n }", "@GetMapping(\"/user\")\n public String user(){\n\n return \"User .. \";\n }", "@Override\n protected void configure(HttpSecurity httpSecurity) throws Exception {\n httpSecurity.cors().configurationSource(request -> {\n var cors = new CorsConfiguration();\n cors.setAllowedOrigins(List.of(\"*\"));\n cors.setAllowedMethods(List.of(\"GET\",\"POST\", \"PUT\", \"DELETE\", \"OPTIONS\"));\n cors.setAllowedHeaders(List.of(\"*\"));\n return cors;\n })\n .and()\n .csrf()\n .disable()\n .authorizeRequests()\n .antMatchers(DOCS_WHITELIST).permitAll()\n\n .antMatchers(HttpMethod.POST, jwtConfig.getUri() + \"/login\").permitAll()\n\n .antMatchers(HttpMethod.POST, \"/users/**\").permitAll()\n .antMatchers(HttpMethod.GET, \"/users/me/\").permitAll()\n .antMatchers(HttpMethod.GET, \"/users/**\").hasAnyRole(\"USER\", \"MODERATOR\", \"ADMIN\")\n .antMatchers(HttpMethod.DELETE, \"/users/**\").hasAnyRole(\"ADMIN\")\n .antMatchers(HttpMethod.PUT, \"/users/{userId}/\").hasAnyRole(\"ADMIN\")\n\n .antMatchers(\"/rooms/{roomId}/reservations/\").permitAll()\n\n .antMatchers(HttpMethod.GET, \"/buildings/**\").hasAnyRole(\"USER\", \"MODERATOR\", \"ADMIN\")\n .antMatchers(HttpMethod.POST,\"/buildings/**\").hasAnyRole(\"ADMIN\", \"MODERATOR\")\n .antMatchers(HttpMethod.PUT,\"/buildings/**\").hasAnyRole(\"ADMIN\", \"MODERATOR\")\n .antMatchers(HttpMethod.DELETE, \"/buildings/**\").hasRole(\"ADMIN\")\n\n .antMatchers(HttpMethod.GET, \"/rooms/**\").hasAnyRole(\"USER\", \"MODERATOR\", \"ADMIN\")\n .antMatchers(HttpMethod.POST,\"/rooms/**\").hasAnyRole(\"ADMIN\", \"MODERATOR\")\n .antMatchers(HttpMethod.PUT,\"/rooms/**\").hasAnyRole(\"ADMIN\", \"MODERATOR\")\n .antMatchers(HttpMethod.DELETE, \"/rooms/**\").hasRole(\"ADMIN\")\n\n .antMatchers(HttpMethod.GET, \"/sections/**\").hasAnyRole(\"USER\", \"MODERATOR\", \"ADMIN\")\n .antMatchers(HttpMethod.POST,\"/sections/**\").hasAnyRole(\"ADMIN\", \"MODERATOR\")\n .antMatchers(HttpMethod.PUT,\"/sections/**\").hasAnyRole(\"ADMIN\", \"MODERATOR\")\n .antMatchers(HttpMethod.DELETE, \"/sections/**\").hasRole(\"ADMIN\")\n\n .antMatchers(\"/admin/**\").hasRole(\"ADMIN\")\n\n .anyRequest()\n .authenticated()\n .and()\n .exceptionHandling()\n .authenticationEntryPoint(\n (req, res, e) -> {\n res.setContentType(\"application/json\");\n res.setStatus(HttpServletResponse.SC_UNAUTHORIZED);\n res.getOutputStream().println(\"{ \\\"message\\\": \\\"Brukernavn eller passord er feil\\\"}\");\n })\n .and()\n .addFilter(new JWTUsernamePasswordAuthenticationFilter(refreshTokenService, authenticationManager(), jwtConfig))\n .addFilterAfter(new JWTAuthenticationFilter(jwtConfig, jwtUtil, userDetailsService), UsernamePasswordAuthenticationFilter.class)\n .sessionManagement()\n .sessionCreationPolicy(SessionCreationPolicy.STATELESS);\n }", "@RequestMapping(value = \"/userhomepage\", method = RequestMethod.GET)\n public ModelAndView displayUserHomepage() {\n return new ModelAndView(\"userhomepage\");\n }", "@RequestMapping(value=\"/\")\n\tpublic ModelAndView index(@RequestParam(name=\"userAdded\",required=false )boolean success)\n\t{\n \tModelAndView mv=new ModelAndView();\n \tAuthentication authentication = SecurityContextHolder.getContext().getAuthentication();\n \tlog.info(\"authentication detail\"+authentication);\n\t\tboolean isAdmin=authentication.getAuthorities().stream().anyMatch(r -> r.getAuthority().equals(\"ROLE_ADMIN\"));\n\t\tboolean isUser=authentication.getAuthorities().stream().anyMatch(r -> r.getAuthority().equals(\"ROLE_USER\"));\n\t\tString username = authentication.getName();\n\t\tlog.info(\"username:////////////////////\"+username+ \" is admin: \"+ isAdmin+\" user: \"+isUser);\n\t\tif(success)mv.addObject(\"userAdded\",true);\n\t\tif(isAdmin)\n\t\t{\n\t\t\tmv.addObject(\"username\",username);\n\t\t\tmv.setViewName(\"redirect:/viewuser\");\n\t\t\treturn mv;\n\t\t}\n\t\telse if(isUser)\n\t\t{\n\t\t\tOptional<User> user=userService.getUserByusername(username);\n\t\t\tmv.addObject(\"id\",user.get().getId());\n\t\t\tmv.setViewName(\"redirect:/userDetails\");\n\t\t\treturn mv;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmv.setViewName(\"/login\");\n\t\t\treturn mv;\n\t\t}\n\n\t}", "@GetMapping(\"/login.html\")\n\tpublic ModelAndView getLogin() {\n\t\tModelAndView mv = new ModelAndView(\"Login\");\n\t\treturn mv;\n\t}", "@PreAuthorize(\"hasAuthority('ROLE_ADMIN')\")\n @RequestMapping\n public String admin() {\n return \"admin\";\n }", "@RequestMapping(value=\"/loginValidation\")\r\npublic String validation(@RequestParam(\"userid\") String userid,@RequestParam(\"password\") String password)\r\n{\r\n\t//getting all credentials from user table\r\n\tList<User> listUser=userService.getAllCreds();\r\n\tboolean flag = false;\r\n\t\r\n\t//checking whether the user is valid or not\r\n\tfor(User u: listUser) {\r\n\t\tif(u.getUserId().equals(userid) && u.getPassword().equals(password)) {\r\n\t\t\tflag=true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tif(flag)\r\n\t{\r\n\t\t//if creds are valid it will redirect to usertype page\r\n\t\treturn \"usertype\";\r\n\t }\r\n\telse\r\n\t{\r\n\t\t//if creds are invalid it will redirect to loginfailure page\r\n\t\treturn \"loginfailure\";\t \r\n }\r\n}", "protected void configure(HttpSecurity http) throws Exception {\n\n\t\thttp\n\t\t\t\t// .csrf().disable()\n\t\t\t\t.csrf().disable().headers().frameOptions().disable()\n\t\t\t\t// .authorizeRequests()\n\t\t\t\t// .antMatchers(\"*/xomeq/login*\")\n\t\t\t\t// .anonymous()\n\t\t\t\t// .and()\n\t\t\t\t.authorizeRequests().antMatchers(\"/public/**\").permitAll().antMatchers(\"/login*\").permitAll() // Para\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// poder\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// cambiar\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// el\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// lenguaje\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// en\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// el\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// login\n\t\t\t\t// .antMatchers(\"/**\").authenticated()\n\t\t\t\t.and().formLogin().loginPage(\"/login\").failureUrl(\"/login?error=true\").successHandler(successHandler())\n\t\t\t\t// .loginProcessingUrl(\"/rest/login\")\n\t\t\t\t// .defaultSuccessUrl(\"/genome\",true)\n\t\t\t\t.permitAll()\n\n\t\t\t\t// .failureHandler(authenticationFailureHandler)\n\t\t\t\t.and().logout()\n\t\t\t\t// .logoutSuccessUrl(\"/\")\n\t\t\t\t.permitAll();\n\t}", "@Override\n\tprotected void configure(HttpSecurity http) throws Exception{\n http = http.cors().and().csrf().disable();\n\n // Set session management to stateless\n http = http\n .sessionManagement()\n .sessionCreationPolicy(SessionCreationPolicy.STATELESS)\n .and();\n\n // Set unauthorized requests exception handler\n http = http\n .exceptionHandling()\n .authenticationEntryPoint(\n (request, response, ex) -> {\n response.sendError(\n HttpServletResponse.SC_UNAUTHORIZED,\n ex.getMessage()\n );\n }\n )\n .and();\n \n //To be modified to fit project endpoints\n\t\thttp.authorizeRequests().antMatchers(\"/public/**\").permitAll()\n\t\t.antMatchers(\"/admin\").hasRole(\"ADMIN\")\n\t\t.antMatchers(\"/user\").hasAnyRole(\"USER\",\"ADMIN\",\"DRIVER\")\n\t\t.anyRequest().authenticated()\n\t\t.and().oauth2ResourceServer().jwt();\n\t}", "@Override\n\t\tprotected void configure(HttpSecurity http) throws Exception {\n\t\t\thttp.cors().and().csrf().disable()\n\t\t\t\t\t.addFilterAfter(new JWTAuthorizationFilter(), UsernamePasswordAuthenticationFilter.class)\n\t\t\t\t\t.authorizeRequests()\n\t\t\t\t\t.antMatchers(\"/admin/**\").hasRole(\"ADMIN\")\n\t\t\t\t\t.antMatchers(\"/user/**\").hasRole(\"USER\")\n\t\t\t\t\t.antMatchers(HttpMethod.POST, \"/login\").permitAll()\n\t\t\t\t\t.antMatchers(HttpMethod.GET, \"/articulos\").permitAll()\n\t\t\t\t\t.and()\n\t\t\t\t\t.authorizeRequests()\n\t\t\t\t\t.antMatchers(\"/h2-console/**\").permitAll()\n\t\t\t\t\t.anyRequest().authenticated();\n\t\t\thttp.headers().frameOptions().disable();\n\n\t\t}", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n /*http\n .csrf().disable()\n .addFilterAfter(new JWTAuthorizationFilter(), UsernamePasswordAuthenticationFilter.class)\n .authorizeRequests()\n .antMatchers(HttpMethod.POST, \"/api/authentication/**\").permitAll()\n .anyRequest().authenticated();\n */\n http\n .csrf().disable()\n .addFilterAfter(new JWTAuthorizationFilter(), UsernamePasswordAuthenticationFilter.class)\n .authorizeRequests().\n anyRequest().permitAll();\n }", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n String[] allowed = {\"/api/auth/**\", \"/static/**\", \"/*.ico\"};\n\n http.cors()\n .and()\n .csrf()\n .disable()\n .exceptionHandling()\n .authenticationEntryPoint(unauthorizedHandler)\n .and()\n .sessionManagement()\n .sessionCreationPolicy(SessionCreationPolicy.STATELESS)\n .and()\n .authorizeRequests()\n .antMatchers(allowed)\n .permitAll()\n .anyRequest()\n .authenticated()\n .and()\n .formLogin()\n // uncommenting this should enable a default login form\n // we need to replace this with a custom one\n .loginPage(\"/\")\n .permitAll()\n .and()\n .logout()\n .permitAll();\n\n /*\n * This is key for exposing csrf tokens in apis that are outside\n * of the browser. We will need these headers in react and for\n * testing with postman etc.\n */\n http.addFilterBefore(\n new JwtAuthenticationFilter(tokenProvider, customUserDetailsService),\n UsernamePasswordAuthenticationFilter.class);\n }", "@Public\n\t@Get(\"/login\")\n\tpublic void login() {\n\t\tif (userSession.isLogged()) {\n\t\t\tresult.redirectTo(HomeController.class).home();\n\t\t}\n\t}", "@RequestMapping(value = \"/login\", method = GET)\r\n\tpublic String login() {\r\n\t\treturn \"admin/login\";\r\n\t}", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n http\n .httpBasic()\n .and()\n .authorizeRequests()\n .antMatchers(\"/topics\").hasRole(\"admin\")\n .antMatchers(\"/topics/**\").hasRole(\"admin\")\n .antMatchers(\"/courses/**\").hasRole(\"admin\")\n .and()\n .csrf().disable()\n .formLogin().disable();\n }", "@RequestMapping(value = \"/403\", method = RequestMethod.GET)\n\tpublic ModelAndView accesssDenied() {\n\t\tModelAndView model = new ModelAndView();\n\t\t// check if user is login\n\t\tAuthentication auth = SecurityContextHolder.getContext().getAuthentication();\n\t\tif (!(auth instanceof AnonymousAuthenticationToken)) {\n\t\t\tUserDetails userDetail = (UserDetails) auth.getPrincipal();\n\t\t\tSystem.out.println(userDetail);\n\t\t\tmodel.addObject(\"username\", userDetail.getUsername());\n\n\t\t}\n\t\tmodel.setViewName(\"403\");\n\t\treturn model;\n\t}", "@Override\n protected void configure(HttpSecurity httpSecurity) throws Exception {\n httpSecurity\n .csrf().disable()\n .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()\n // non abbiamo bisogno di una sessione\n .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()\n .cors().and()\n .authorizeRequests()\n .antMatchers(\n //HttpMethod.GET,\n \"/\",\n \"/*.html\",\n \"/favicon.ico\",\n \"/**/*.html\",\n \"/**/*.css\",\n \"/**/*.js\"\n ).permitAll()\n .antMatchers(\"/chat-websocket/**\", \"/public/**\", \"/swagger-ui/**\", \"/api-docs\", \"/api-docs/**\").permitAll()\n //.antMatchers(\"/api/v1/targets/**\").hasRole(\"ADMIN\")\n .antMatchers(HttpMethod.OPTIONS).permitAll()\n .anyRequest().authenticated();\n\n // Filtro Custom JWT\n httpSecurity.addFilterBefore(authenticationTokenFilterBean(), UsernamePasswordAuthenticationFilter.class);\n httpSecurity.headers().cacheControl();\n }", "@RequestMapping(value=\"/login\", method = RequestMethod.GET) \n\tpublic String login( Principal principal) {\n\t\tif(principal!=null)\n\t\t{\n\t\t\treturn \"redirect:/dashboard\";\n\t\t}\n\t\treturn \"login\"; \n\t}", "@GetMapping(\"/login\")\n\tpublic String getloginForm(@AuthenticationPrincipal UserDetailsImpl user, HttpServletRequest request) {\n\n\t\tif (user != null) {\n\t\t\t/* If user is already logged in, then send them to headlines page with a flag */\n\t\t\trequest.setAttribute(\"isLoggedIn\", true);\n\t\t\treturn \"forward:/\";\n\t\t}\n\t\treturn \"login\";\n\t}", "@GetMapping(\"/admin\")\n String dashboard(){\n return \"dashboard\";\n }", "@RequestMapping(value=\"/loginForm\", method = RequestMethod.GET)\n\tpublic String home(){\n\n\t\treturn \"loginForm\";\n\t}", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n\n\n http\n .httpBasic().disable()\n .csrf().disable()\n .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)\n .and()\n .authorizeRequests()\n .antMatchers(\"/admin/*\").hasRole(\"ADMIN\")\n .antMatchers(\"/user/*\").hasRole(\"USER\")\n .antMatchers(\"/api/*\", \"/auth\").permitAll()\n .antMatchers(\"/register\", \"/auth\").permitAll()\n .and()\n .addFilterBefore(jwtFilter, UsernamePasswordAuthenticationFilter.class);\n }", "@Override\n\t// This method configure the HttpSecurity object\n\tprotected void configure(HttpSecurity http) throws Exception {\n\t\thttp.authorizeRequests().\n\t\t/* antMatchers(\"/**\"). */\n\t\t\t\tantMatchers(PUBLIC_MATCHERS).permitAll().anyRequest().authenticated();\n\n\t\t// Cross-site request forgery\n\t\thttp.csrf().disable()\n\t\t\t\t// Cross-Origin Resource Sharing\n\t\t\t\t.cors().disable().\n\t\t\t\t// Here is a login form\n\t\t\t\t// Here Spring check the login and pwd if it success it redirect us to \"/\" with\n\t\t\t\t// the \"authenticated\" label and show us the \"Logout\" navbar because we are\n\t\t\t\t// authenticated otherwise it redirect us to the \"/login\" in case of wrong url\n\t\t\t\t// or \"/login?error\" in case of wrong login and pwd\n\t\t\t\tformLogin().failureUrl(\"/login?error\").defaultSuccessUrl(\"/\").loginPage(\"/login\").permitAll().\n\n\t\t\t\tand()\n\t\t\t\t// Here it specifies where to beredirected and how when the user log out\n\t\t\t\t// To access a request parameter Thymeleaf use the \"param\" variable\n\t\t\t\t.logout().logoutRequestMatcher(new AntPathRequestMatcher(\"/logout\")).logoutSuccessUrl(\"/login?logout\")\n\t\t\t\t.deleteCookies(\"remember-me\").permitAll().and().rememberMe();\n\t}", "@PostMapping(\"/login\")\n\t public String login(@RequestParam(\"username\") String username, @RequestParam(\"password\") String password, Model model) {\n\t \t\tSystem.out.println(username +\"Hello \"+ password);\n\t \t\tboolean flag=userService.autoLogin(username, password);\n\t if(flag) {\n\t \tmodel.addAttribute(\"expense\", expenseService.getMonthAndYearAndAmount());\n\t \t model.addAttribute(\"username\",username);\n\t \t localUsername = username;\n\t \t return \"redirect:/dashboard\";\n\t }\n\t model.addAttribute(\"error\",true);\n\t return \"login\";\n\t }", "@RequestMapping(value=\"/success-login\", method=RequestMethod.GET)\r\n\tpublic String successLogin(HttpSession session) {\n User authUser = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); \r\n labMVC.domain.User user = userRepo.findByEmail((authUser.getUsername()));\r\n String view;\r\n switch (user.getRole()) {\r\n \tcase ROLE_ADMIN: \r\n \t\tview = \"redirect:/admin/adminDashboard\"; \r\n \t\tbreak;\r\n \tdefault: \r\n \t\tview = \"security/success-login\"; \r\n \t\tbreak;\r\n }\r\n switch (user.getRole()) {\r\n \tcase ROLE_CLIENT: \r\n \t\tview = \"redirect:/client/clientDashboard\"; \r\n \t\tbreak;\r\n \tdefault: \r\n \t\tview = \"security/success-login\"; \r\n \t\tbreak;\r\n }\r\n switch (user.getRole()) {\r\n \tcase ROLE_DEBTOR: \r\n \t\tview = \"redirect:/case/caseDashboard\"; \r\n \t\tbreak;\r\n \tdefault: \r\n \t\tview = \"security/success-login\"; \r\n \t\tbreak;\r\n }\r\n session.setAttribute(\"User\", user);\r\n\t\treturn view;\r\n\t}", "@PostMapping(path = \"login_user\")\n public String logIn(User user, Model model){\n for (User currUser: users){\n if(currUser.getEmailId().equals(user.getEmailId()) && currUser.getPassword().equals(user.getPassword())){\n model.addAttribute(\"feeds\",feeds);\n return \"user_page\";\n }\n }\n return \"user_not_found\";\n }", "@Override\r\n\tprotected void configure(HttpSecurity http) throws Exception {\r\n\t\thttp.csrf().disable().cors()\r\n\t\t\t.and()\r\n\t\t\t\t.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)\r\n\t\t\t.and()\r\n\t\t\t\t.authorizeRequests()\r\n\t\t\t\t.antMatchers(\"/api/auth/**\").permitAll()\r\n\t\t\t\t.antMatchers(HttpMethod.POST, \"/tarefa/**\", \"/categoria/**\", \"/usuario/**\").hasRole(\"ADMIN\")\r\n\t\t\t\t.antMatchers(HttpMethod.PUT, PATHS).hasRole(\"ADMIN\")\r\n\t\t\t\t.antMatchers(HttpMethod.DELETE, PATHS).hasRole(\"ADMIN\")\r\n\t\t\t\t.antMatchers(HttpMethod.GET, PATHS).hasAnyRole(\"ADMIN\", \"USER\")\r\n\t\t\t\t.antMatchers(\"/h2-console/**\").permitAll()\r\n\t\t\t\t.anyRequest().authenticated()\r\n\t\t\t.and()\r\n\t\t\t\t.addFilterBefore(authenticationJwtTokenFilter(), UsernamePasswordAuthenticationFilter.class)\r\n\t\t\t.exceptionHandling().authenticationEntryPoint(unauthorizedHandler);\r\n\t}", "@Override\n public void configure(final WebSecurity web) throws Exception {\n web.ignoring()\n .antMatchers(HttpMethod.OPTIONS, \"/**\")\n .antMatchers(HttpMethod.POST, \"/api/v1/user\")\n .antMatchers(HttpMethod.GET, \"/api/v1/*/public**\")\n .antMatchers(HttpMethod.GET, \"/api/v1/*/public/**\");\n }", "@RequestMapping(\"/readLoginData\")\r\n\tpublic ModelAndView readLoginData(@ModelAttribute(\"userdata\") User user)\r\n\t{\n\t\t\r\n\t\t\r\n\t\tString page=null;\r\n\t\tboolean result= userDaoImpl.checkUser(user);\r\n\t\tif(result)\r\n\t\t{\r\n\t\t\tpage=\"home\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tpage=\"redirect:login\";\r\n\t\t}\r\n\t\tModelAndView modelAndView=new ModelAndView(page);\r\n\t\treturn modelAndView;\r\n\t}", "@Override\n\tprotected void configure(HttpSecurity http) throws Exception {\n\t\thttp\n\t\t\t\n\t\t.cors()\n \t.and()\n .csrf()\n \t.disable()\n .formLogin()\n \t.disable()\n .httpBasic()\n \t.disable()\n .exceptionHandling()\n \t.authenticationEntryPoint(jwtUnauthorizedHandlerEntryPoint)\n \t.and()\n\t\t.authorizeRequests()\n\t\t\t\t.antMatchers(\"/\",\n \"/favicon.ico\",\n \"/**/*.png\",\n \"/**/*.gif\",\n \"/**/*.svg\",\n \"/**/*.jpg\",\n \"/**/*.html\",\n \"/**/*.css\",\n \"/**/*.js\",\n \"/error\", \n \"/webjars/**\").permitAll()\n\t\t\t\t.antMatchers(\"/app/**\").permitAll()\n\t\t\t.anyRequest().authenticated()\n\t\t\t.and()\n\t\t\t.logout()\n\t\t\t\t.logoutSuccessUrl(\"/logout\").permitAll()\n\t\t\t.and()\n\t\t\t.oauth2Login()\n\t\t\t\t.authorizationEndpoint()\n\t\t\t\t.baseUri(\"/oauth2/authorize/\")\n\t\t\t\t.authorizationRequestRepository(customAuthorizationRequestRepository)\n\t\t\t\t.and()\n\t\t\t.userInfoEndpoint()\n\t\t\t\t.userService(customOauth2UserService)\n\t\t\t\t.and()\n .redirectionEndpoint()\n \t.baseUri(\"/oauth2/callback/*\")\n \t.and()\n .successHandler(customAuthenticationSuccessHandler)\n .failureHandler(customAuthenticationFailureHandler)\n .and()\n .addFilterBefore(jwtfilt , UsernamePasswordAuthenticationFilter.class );\n \n \n//\t\t\t.failureHandler((request, response, exception) -> {\n//\t\t\t request.getSession().setAttribute(\"error.message\", exception.getMessage());\n//\t\t\t authenticationFailureHandler.onAuthenticationFailure(request, response, exception);\n// })\n//\t\t\t\t.authorizationEndpoint()\n//\t\t\t\t\t.baseUri(\"/oauth2/authorize\")\n//\t\t\t\t\t.and()\n//\t\t\t\t.redirectionEndpoint()\n//\t\t\t\t\t.baseUri(\"/oauth2/callback/*\")\n//\t\t\t\t\t.and()\n//\t\t\t\t.userInfoEndpoint()\n//\t\t\t\t\t.userService(oauth2UserService)\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t}", "protected void configure(HttpSecurity http) throws Exception {\n\t\tsuper.configure(http);\n\t\thttp.authorizeRequests()\n\t\t.antMatchers(\"/user/add**\").hasAuthority(\"ROLE_ADD_PERMISSION\")\n\t\t.antMatchers(HttpMethod.POST,\"/user/edit**\").hasAnyAuthority(\"ROLE_ADD_PERMISSION\",\"ROLE_EDIT_PERMISSION\")\n\t\t.antMatchers(HttpMethod.DELETE, \"/user/user**\").hasAuthority(\"ROLE_DELETE_PERMISSION\")\n\t\t.antMatchers(HttpMethod.GET,\"/user/user**\").hasAnyAuthority(\"ROLE_READ_PERMISSION\")\n\t\t.antMatchers(\"/user/me\").permitAll()\n\t\t.and()\n\t\t.csrf().disable();\n\t}" ]
[ "0.80347663", "0.768262", "0.75601685", "0.74140376", "0.7339735", "0.73328567", "0.71340895", "0.7128428", "0.7117923", "0.6985396", "0.6900678", "0.6856645", "0.6810636", "0.67429996", "0.66432226", "0.6628903", "0.6618401", "0.6531288", "0.65220636", "0.65088916", "0.65029216", "0.65021586", "0.64898944", "0.647573", "0.64732385", "0.6464379", "0.6460333", "0.64558166", "0.6446814", "0.64438623", "0.63972926", "0.63837975", "0.6321759", "0.6318941", "0.6286397", "0.6271652", "0.6238646", "0.6165084", "0.61633456", "0.61618227", "0.6152765", "0.61324817", "0.61322886", "0.61064374", "0.6095848", "0.6077238", "0.60702705", "0.6063064", "0.6056584", "0.60515094", "0.6048681", "0.6046648", "0.60110164", "0.6000623", "0.59817016", "0.5979666", "0.5976973", "0.59762245", "0.5973904", "0.5953879", "0.59490734", "0.5946602", "0.59392476", "0.5934751", "0.5929304", "0.59258413", "0.5917746", "0.5904104", "0.5866174", "0.5861898", "0.5855563", "0.58543473", "0.58517385", "0.5850355", "0.5839357", "0.5817753", "0.5805392", "0.5800752", "0.5793788", "0.5782995", "0.5782256", "0.5779714", "0.5773549", "0.576144", "0.5755885", "0.57473844", "0.57456297", "0.573671", "0.5733616", "0.573355", "0.57322", "0.5730443", "0.57300985", "0.5718775", "0.5718327", "0.5704329", "0.56977713", "0.56838304", "0.56724596", "0.5670198" ]
0.6532591
17
If start is after 16:00 add one day = 1440 minutes
private Integer getStandardStart(int startTime) { if (startTime % 1440 > 960) { startTime += 1440; } int startOfDay = startTime - (startTime % 1440); //we need a standard variable to indicate the day of week; //standard day starts at 08:00 = 480 minutes and ends at 16:00 = 960 minutes capacityEndTime = startOfDay + 960; return startOfDay + 480; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void increment_time()\n\t{\n\t\ttime_of_day = time_of_day + 1;\n\t\tif(time_of_day>=120)\n\t\t{\n\t\t\ttime_of_day=time_of_day-120;\n\t\t}\n\t}", "private Date stepTime(Date d, int mins) {\n\t\tif (d == null) return d;\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTime(d);\n\t\tcal.add(Calendar.MINUTE, mins);\n\t\treturn cal.getTime();\n\t}", "private void advanceTime(){\n\t minute++;\n\t while (minute > 59) {\n\t minute -= 60;\n\t hour++;\n\t }\n\t while (hour > 23) {\n\t hour -= 24;\n\t day++;\n\t }\n\t while (day > 6) {\n\t day -= 7;\n\t }\n\n\t }", "public static void calTime() {\n time = new Date().getTime() - start;\n }", "public MyTime nextMinute(){\n\t\tint second = getSeconds();\n\t\tint minute = getMinute();\n\t\tint hour = getHours();\n\t\t\n\t\tif (minute!=59){\n\t\t\tminute++;\n\t\t}\n\t\telse{\n\t\t\tminute = 0;\n\t\t\tif (hours!=23){\n\t\t\t\thour++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\thour = 0;\n\t\t\t}\n\t\t\n\t\t}\n\t\n\t\t\n\t\treturn new MyTime(hour,minute,second);\n\t}", "@Override\n public int getTimeForNextTicInSeconds() {\n int seconds = Calendar.getInstance().get(Calendar.SECOND);\n return 60 - seconds;\n }", "public static Appointment appointmentIn15Min() {\n Appointment appointment;\n LocalDateTime now = LocalDateTime.now();\n ZoneId zid = ZoneId.systemDefault();\n ZonedDateTime zdt = now.atZone(zid);\n LocalDateTime ldt = zdt.withZoneSameInstant(ZoneId.of(\"UTC\")).toLocalDateTime();\n LocalDateTime ldt2 = ldt.plusMinutes(15);\n String username = UserDB.getCurrentUser().getUserName();\n try (Connection conn =DriverManager.getConnection(DB_URL, user, pass);\n Statement statement = conn.createStatement()) {\n String query = \"SELECT * FROM appointment WHERE start BETWEEN '\" + ldt + \"' AND '\" + ldt2 + \"' AND \" + \n \"createdBy='\" + username + \"'\";\n ResultSet results = statement.executeQuery(query);\n if(results.next()) {\n appointment = new Appointment(results.getInt(\"appointmentId\"), results.getInt(\"customerId\"), results.getString(\"title\"),\n results.getString(\"end\"), results.getString(\"contact\"), results.getString(\"description\"),results.getString(\"location\"), \n results.getTimestamp(\"start\"), results.getTimestamp(\"end\"), results.getDate(\"createDate\"), results.getDate(\"lastupDate\"), results.getString(\"createdBy\"));\n return appointment;\n }\n } catch (SQLException e) {\n System.out.println(\"SQLException: \" + e.getMessage());\n }\n return null;\n }", "@Override\n\tpublic void get_time_int(ShortHolder heure, ShortHolder min) {\n\t\t\n\t}", "public M csmiAddTimeStart(Object start){this.put(\"csmiAddTimeStart\", start);return this;}", "private long calculateTime(LocalDate date, long secondsSinceMidnight) {\n GregorianCalendar gregorianCalendar = new GregorianCalendar(timeZone);\n gregorianCalendar.setTimeInMillis(0);\n gregorianCalendar.set(date.getYear(), date.getMonthValue() - 1, date.getDayOfMonth());\n gregorianCalendar.add(java.util.Calendar.SECOND, (int)secondsSinceMidnight);\n\n return gregorianCalendar.getTimeInMillis();\n }", "public void setTime(){\n Date currentDate = new Date();\n\n SharedPreferences.Editor editor = mSharedPreferences.edit();\n editor.putLong(\"WAIT_TIME\", currentDate.getTime() + 1800000); //30 min\n editor.commit();\n }", "private static void timerTest4() {\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 14);\n\t\tcalendar.set(Calendar.MINUTE, 20);\n\t\tcalendar.set(Calendar.SECOND, 0);\n\t\tDate time = calendar.getTime();\n\n\t\tTimer timer = new Timer();\n\t\tSystem.out.println(\"wait ....\");\n\t\ttimer.scheduleAtFixedRate(new TimerTask() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tSystem.out.println(\"timertest4\");\n\n\t\t\t}\n\t\t}, time, 24 * 60 * 60 * 1000);\n\n\t}", "@Override\n\tprotected void setNextSiegeDate()\n\t{\n\t\tif(_siegeDate.getTimeInMillis() < Calendar.getInstance().getTimeInMillis())\n\t\t{\n\t\t\t_siegeDate = Calendar.getInstance();\n\t\t\t// Осада не чаще, чем каждые 4 часа + 1 час на подготовку.\n\t\t\tif(Calendar.getInstance().getTimeInMillis() - getSiegeUnit().getLastSiegeDate() * 1000L > 14400000)\n\t\t\t\t_siegeDate.add(Calendar.HOUR_OF_DAY, 1);\n\t\t\telse\n\t\t\t{\n\t\t\t\t_siegeDate.setTimeInMillis(getSiegeUnit().getLastSiegeDate() * 1000L);\n\t\t\t\t_siegeDate.add(Calendar.HOUR_OF_DAY, 5);\n\t\t\t}\n\t\t\t_database.saveSiegeDate();\n\t\t}\n\t}", "@Test\n public void addRecord_can_read_TR_spanning_from_today_until_tomorrow() {\n DateTime start = new DateTime(today.getYear(), today.getMonthOfYear(), today.getDayOfMonth(), 12, 0);\n DateTime end = new DateTime(today.getYear(), today.getMonthOfYear(), today.getDayOfMonth() + 1, 12, 0);\n\n // when\n aggregatedDay.addRecord(aRecord(start, end, Rounding.Strategy.SIXTY_MINUTES_UP));\n\n // then: duration equals the hours covering today\n assertEquals(12, aggregatedDay.getDuration().getStandardHours());\n }", "protected Date getCurrentDateAndTime() {\n\t\tDate date = new Date();\n\t\tDate updatedDate = new Date((date.getTime() + (1000 * 60 * 60 * 24)));//(1000 * 60 * 60 * 24)=24 hrs. **** 120060 = 2 mins\n\t\treturn updatedDate;\n\t}", "public abstract double calculateStartTime();", "public M csolAddTimeStart(Object start){this.put(\"csolAddTimeStart\", start);return this;}", "public static String getTime(Long start){\n\t\tLong now =System.currentTimeMillis()/1000; \n\t\tLong date = (now - start)/(3600*24);\n\t\t//\t\tLog.e(\"TimeTypeUtil\", \"停车的天数为:\"+ date);\n\t\tLong hour = ((now-start)%86400)/3600;\n\t\tLong minute = ((now-start)%3600)/60;\n\t\tString result = \"\";\n\t\tif (date == 0) {\n\t\t\tif(hour==0)\n\t\t\t\tresult =minute+\"分钟\";\n\t\t\telse \n\t\t\t\tresult =hour+\"小时\"+minute+\"分钟\";\n\t\t}else{\n\t\t\tresult =date+\"天\"+hour+\"小时\"+minute+\"分钟\";\n\t\t}\n\t\treturn result;\n\t}", "long getStartTime();", "int getStartTime();", "int getStartTime();", "int getStartTime();", "public M csseAddTimeStart(Object start){this.put(\"csseAddTimeStart\", start);return this;}", "public double getStartTime();", "public abstract Date getNextFireTime();", "private void calcUpTime(Long created_at) {\n\tupTimeHour = (((System.currentTimeMillis() - created_at) / (1000 * 60 * 60)) % 24) - 1;\n\tupTimeMinute = ((System.currentTimeMillis() - created_at) / (1000 * 60)) % 60;\n }", "public void updateAlarmTime (){\r\n\t\tint newHour, newMinut;\r\n\t\t\r\n\t\tif (relative) { //Before\r\n\t\t\tnewMinut = reference.getMinutes() - alarmMinutes;\r\n\t\t\tnewHour = reference.getHours() - alarmHours - ((newMinut<0)?1:0);\r\n\t\t\tnewMinut = (newMinut<0)?newMinut+60:newMinut;\r\n\t\t\tnewHour = (newHour<0)?newHour+24:newHour;\r\n\t\t} else {\r\n\t\t\tnewMinut = reference.getMinutes() + alarmMinutes;\r\n\t\t\tnewHour = reference.getHours() + alarmHours + ((newMinut>=60)?1:0);\r\n\t\t\tnewMinut = (newMinut>=60)?newMinut-60:newMinut;\r\n\t\t\tnewHour = (newHour>=240)?newHour-24:newHour;\r\n\t\t}\r\n\r\n\t\tthis.alarmTime.setHours(newHour);\r\n\t\tthis.alarmTime.setMinutes(newMinut);\r\n\t}", "public MyTime nextHour(){\n\t\tint second = getSeconds();\n\t\tint minute = getMinute();\n\t\tint hour = getHours();\n\t\t\n\t\tif (hours!=23){\n\t\t\thour++;\n\t\t}\n\t\telse{\n\t\t\thour = 0;\n\t\t}\n\t\t\n\t\treturn new MyTime(hour,minute,second);\n\t}", "Date getStartedOn();", "@Test public void shouldGive240MinFor950cent() {\r\n // Three hours: $1.5+2.0+3.0\r\n assertEquals( 4 * 60 /*minutes*/ , rs.calculateTime(950) ); \r\n }", "private static long getTimestampStart(long timestamp, long start) {\n long timestampStart = 0;\n for (long i = timestamp; i >= timestamp-60; i--) {\n if ((i-start) % 60 == 0) {\n timestampStart = i;\n break;\n }\n }\n return timestampStart;\n }", "public Integer calculateTimeBeforeStart(LocalTime timePoint) {\n LOGGER.info(\"CALCULATING TIME BEFORE START.\");\n LocalTime now = LocalTime.now();\n\n LocalTime timeLeftUntilTomorrow = timePoint.minusHours(now.getHour()).minusMinutes(now.getMinute());\n\n return timeLeftUntilTomorrow.getHour() * 60 + timeLeftUntilTomorrow.getMinute();\n }", "public M csmiUpdateTimeStart(Object start){this.put(\"csmiUpdateTimeStart\", start);return this;}", "public int getStartMinute() {\n\treturn start.getMinute();\n }", "public void addMinutes(int minutes)\n {\n\n int h = minutes / 60;\n int m = minutes - (h * 60);\n\n hour += h;\n\n if (minute == 30 && m == 30)\n {\n minute = 0;\n hour++;\n }\n else\n {\n minute += m;\n }\n }", "public abstract Date getStartTime();", "public long getStartTime();", "public long getStartTime();", "Instant getStart();", "Integer getMinute();", "public void startAgentTime() {\n Timer timer = new Timer(SIBAConst.TIME_AGENT_CHANGE_FOR_HOUR, new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n \t\n \tCalendar c = Calendar.getInstance();\n int minutos = c.get(Calendar.MINUTE);\n int hora = c.get( (Calendar.HOUR_OF_DAY)); \n hora = hora * 60;\n if (minutos >= 30 && minutos <= 59)\n {hora +=30;\t\n }\n if (hora > ctrlHours)\n {ctrlHours = hora;\n //activada bandera de modificacion de programacion\n activatedScheduleChange = true;\n }\n else\n { if (hora < ctrlHours)\n \t ctrlHours = 0;\n }\n \t\n \t\n \n }\n });\n timer.start();\n }", "public void uneMinuteDePlus() {\n\t\tthis.m = m+1 > 59 ? 0 : m+1;\n\t}", "java.util.Calendar getStartTime();", "LocalDateTime calculateNextPossibleStartTime(LocalDateTime startTime);", "public void startCount() {\n //meetodi k�ivitamisel nullime tunnid, minutid, sekundid:\n secondsPassed = 0;\n minutePassed = 0;\n hoursPassed = 0;\n if (task != null)\n return;\n task = new TimerTask() {\n @Override\n public void run() {//aeg l�ks!\n secondsPassed++; //loeme sekundid\n if (secondsPassed == 60) {//kui on l�binud 60 sek, nullime muutujat\n secondsPassed = 0;\n minutePassed++;//kui on l�binud 60 sek, suurendame minutid 1 v�rra\n }\n if (minutePassed == 60) {//kui on l�binud 60 min, nullime muutujat\n minutePassed = 0;\n hoursPassed++;//kui on l�binud 60 min, suurendame tunnid 1 v�rra\n }\n //kirjutame aeg �les\n String seconds = Integer.toString(secondsPassed);\n String minutes = Integer.toString(minutePassed);\n String hours = Integer.toString(hoursPassed);\n\n if (secondsPassed <= 9) {\n //kuni 10 kirjutame 0 ette\n seconds = \"0\" + Integer.toString(secondsPassed);\n }\n if (minutePassed <= 9) {\n //kuni 10 kirjutame 0 ette\n minutes = \"0\" + Integer.toString(minutePassed);\n }\n if (hoursPassed <= 9) {\n //kuni 10 kirjutame null ettte\n hours = \"0\" + Integer.toString(hoursPassed);\n }\n\n\n time = (hours + \":\" + minutes + \":\" + seconds);//aeg formaadis 00:00:00\n getTime();//edastame aeg meetodile getTime\n\n }\n\n };\n myTimer.scheduleAtFixedRate(task, 0, 1000);//timer k�ivitub kohe ja t��tab sekundite t�psusega\n\n }", "@Test public void shouldGive60MinFor150cent() {\r\n // First hour: $1.5\r\n assertEquals( 60 /*minutes*/, rs.calculateTime(150) ); \r\n }", "OffsetDateTime startDateTime();", "public int getIntervalMinutes();", "public void pickRecitationTime(int start){\n\t\tthis.recitationTime = start;\n\t}", "protected void processTimer(){\n if(timer != null){\n timer.cancel();\n timer = null;\n }\n // Verificamos si el partido esta en progreso\n if(match.status == Match.STATUS_PENDING || match.status == Match.STATUS_ENDED){\n return;\n }\n // Creamos temporizador 90 * 60 * 1000 = 5.400.000\n timer = new CountDownTimer(5400000, 1000) {\n @Override\n public void onTick(long l) {\n // Calcular los segundos que pasaron\n long seconds = (new Date().getTime() - matchDayLong) / 1000;\n // Calcular los minutos del partido\n long minutes = seconds / 60;\n //long minutes = TimeUnit.MILLISECONDS.toMinutes(uptime);\n if(minutes < 0){\n minutes = 0;\n seconds = 0;\n statusMedium.setText(\"PT\");\n }if(minutes > 45 && minutes < 60){\n minutes = 45;\n seconds = 60;\n }else if(minutes > 90){\n minutes = 90;\n seconds = 60;\n statusMedium.setText(\"ST\");\n }else if(minutes >= 60){\n minutes -= 15;\n statusMedium.setText(\"ST\");\n }else{\n statusMedium.setText(\"PT\");\n }\n\n statusTime.setText(String.format(\"%02d:%02d\", minutes, (seconds%60)));\n }\n\n @Override\n public void onFinish() {\n\n }\n }.start();\n }", "public void changeStartDate(DateToken startToken) {\r\n\t\tDateTime now = new DateTime();\r\n\t\tif (Interval.nowStub != null) now = Interval.nowStub;\r\n\t\t\r\n\t\tstartDateExplicitlySet = true;\r\n\t\t\r\n\t\tif (this.start == null) {\r\n\t\t\tDateTime start = startToken.mergeInto(now).withTime(0, 0, 0, 0);\r\n\r\n\t\t\t// not leaping forward a year here; date should be taken as is\r\n\t\t\t\r\n\t\t\tthis.start = start;\r\n\t\t\tend = start.withTime(23, 59, 0, 0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// a time has already been set\r\n\t\t\tDateTime start = startToken.mergeInto(this.start);\r\n\t\t\tthis.start = start;\r\n\t\t\tif (end.isBefore(this.start)) {\r\n\t\t\t\tend = this.start.plusHours(1);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tend = startToken.mergeInto(end);\r\n\t\t\t\tif (end.isBefore(start)) {\r\n\t\t\t\t\tend = start.plusHours(1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean isSupportMinutes() {\r\n return true;\r\n }", "Integer getStartHour();", "String makeNewSleep(){\n\t\tbeginSleepTime = new SimpleDateFormat(\"HH:mm\").format(new Date());\n\t\treturn beginSleepTime;\n\t}", "@Test public void shouldGive120MinFor350cent() {\r\n // Two hours: $1.5+2.0\r\n assertEquals( 2 * 60 /*minutes*/ , rs.calculateTime(350) ); \r\n }", "@Test public void shouldGive180MinFor650cent() {\r\n // Three hours: $1.5+2.0+3.0\r\n assertEquals( 3 * 60 /*minutes*/ , rs.calculateTime(650) ); \r\n }", "public void advanceTime(){\n\t\tminute++;\r\n\t\twhile (minute > 59) {\r\n\t\t\tminute -= 60;\r\n\t\t\thour++;\r\n\t\t}\r\n\t\twhile (hour > 23) {\r\n\t\t\thour -= 24;\r\n\t\t\tday++;\r\n\t\t}\r\n\t\twhile (day > 6) {\r\n\t\t\tday -= 7;\r\n\t\t\tweek++;\r\n\t\t\ttotalMoney += abonnementen * 40;\r\n\t\t}\r\n\t\twhile(week > 51) {\r\n\t\t\tweek -= 52;\r\n\t\t}\r\n\t\t//System.out.println(\"advanceTime: \"+\"week: \"+ week + \" day: \"+ day +\" hour: \" + hour +\" minute: \"+ minute+ \" Money earned = \" + Math.round(totalMoney));\r\n\t}", "public void calculateHours(String time1, String time2) {\n Date date1, date2;\n int days, hours, min;\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"hh:mm aa\", Locale.US);\n try {\n date1 = simpleDateFormat.parse(time1);\n date2 = simpleDateFormat.parse(time2);\n\n long difference = date2.getTime() - date1.getTime();\n days = (int) (difference / (1000 * 60 * 60 * 24));\n hours = (int) ((difference - (1000 * 60 * 60 * 24 * days)) / (1000 * 60 * 60));\n min = (int) (difference - (1000 * 60 * 60 * 24 * days) - (1000 * 60 * 60 * hours)) / (1000 * 60);\n hours = (hours < 0 ? -hours : hours);\n SessionHour = hours;\n SessionMinit = min;\n Log.i(\"======= Hours\", \" :: \" + hours + \":\" + min);\n\n if (SessionMinit > 0) {\n if (SessionMinit < 10) {\n SessionDuration = SessionHour + \":\" + \"0\" + SessionMinit + \" hrs\";\n } else {\n SessionDuration = SessionHour + \":\" + SessionMinit + \" hrs\";\n }\n } else {\n SessionDuration = SessionHour + \":\" + \"00\" + \" hrs\";\n }\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }", "Double getScheduleDuration();", "public String getCurrentTimeHourMinSec() {\n\t\t\t\t// DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t\t// need to change after the date format is decided\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\t\tDate date = new Date();\n\t\t\t\treturn dateFormat.format(date);\n\t\t\t}", "public static void scheduleRepeatingElapsedNotification15(Context context) {\n\n\n // Setting intent to class where notification will be handled\n Intent intent = new Intent(context, AlarmReceiver.class);\n\n // Setting pending intent to respond to broadcast sent by AlarmManager everyday at 8am\n alarmIntentElapsed = PendingIntent.getBroadcast(context, ALARM_TYPE_ELAPSED, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // Getting instance of AlarmManager service\n alarmManagerElapsed = (AlarmManager)context.getSystemService(ALARM_SERVICE);\n\n // Daily inexact alarm from phone boot - current set to test for 10 seconds\n alarmManagerElapsed.setInexactRepeating(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime(), 60000 * 15, alarmIntentElapsed);\n }", "public void durata(long start, long stop){\n\t\tlong durata = stop - start;\n\t\tlong secondi = durata % 60;\n\t\tlong minuti = durata / 60;\n\t\t\n\t\tSystem.out.println(\"Durata: \" + minuti + \"m \" + secondi + \"s\");\n\t}", "public static void scheduleRepeatingElapsedNotification60(Context context) {\n\n\n // Setting intent to class where notification will be handled\n Intent intent = new Intent(context, AlarmReceiver.class);\n\n // Setting pending intent to respond to broadcast sent by AlarmManager everyday at 8am\n alarmIntentElapsed = PendingIntent.getBroadcast(context, ALARM_TYPE_ELAPSED, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // Getting instance of AlarmManager service\n alarmManagerElapsed = (AlarmManager)context.getSystemService(ALARM_SERVICE);\n\n // Daily inexact alarm from phone boot - current set to test for 10 seconds\n alarmManagerElapsed.setInexactRepeating(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime(), 60000 * 60, alarmIntentElapsed);\n }", "OffsetDateTime usageStart();", "public int getMinutes(){\n return (int) ((totalSeconds%3600)/60);\n }", "public void addTime(int minutes) throws InvalidDateException{\r\n\t\tif (minutes >= 0) {\r\n\t\t\tint totalMinutes = this.minute + minutes;\r\n\t\t\tif (totalMinutes > 59) {\r\n\t\t\t\tint totalHours = this.hour + totalMinutes/60;\r\n\t\t\t\tthis.minute = totalMinutes%60;\r\n\t\t\t\tif (totalHours > 23) {\r\n\t\t\t\t\tint totalDays = this.day + totalHours/24;\r\n\t\t\t\t\tthis.hour = totalHours%24;\r\n\t\t\t\t\tif (totalDays > 31) {\r\n\t\t\t\t\t\tint totalMonths = this.month + totalDays/31;\r\n\t\t\t\t\t\tif(totalDays%31 ==0) {\r\n\t\t\t\t\t\t\ttotalMonths -= 1;\r\n\t\t\t\t\t\t\tthis.day = 31;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.day = totalDays%31;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (totalMonths > 12) {\r\n\t\t\t\t\t\t\tint totalYears = this.year + totalMonths/12;\r\n\t\t\t\t\t\t\tif(totalMonths%12 == 0) {\r\n\t\t\t\t\t\t\t\ttotalYears -= 1;\r\n\t\t\t\t\t\t\t\tthis.month = 12;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tthis.month = totalMonths%12;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tthis.year = totalYears;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.month = totalMonths;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.day = totalDays;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.hour = totalHours;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthis.minute = totalMinutes;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthrow new InvalidDateException(\"You can't go back in time !\");\r\n\t\t}\r\n\t}", "@Override\n protected LocalDateTime CalculateNextFeedTime() {\n return LocalDateTime.now();\n }", "public static int getMinutesSinceMidnight(Date date){\n long timeNow = date.getTime();\n long days = TimeUnit.MILLISECONDS.toDays(timeNow);\n long millisToday = (timeNow - TimeUnit.DAYS.toMillis(days)); //GMT:This number of milliseconds after 12:00 today\n int minutesToday = (int )TimeUnit.MILLISECONDS.toMinutes(millisToday); //GMT\n minutesToday += (60*5) + 30; //GMT+05:30 minutesToday\n minutesToday = minutesToday % (24*60);\n return minutesToday;\n }", "public M csseUpdateTimeStart(Object start){this.put(\"csseUpdateTimeStart\", start);return this;}", "private void updateStartTime() {\n Date date = startTimeCalendar.getTime();\n String startTime = new SimpleDateFormat(\"HH:mm\").format(date);\n startHourText.setText(startTime);\n }", "@Test\n public void addRecord_can_read_TR_spanning_from_yesterday_until_today() {\n DateTime start = new DateTime(today.getYear(), today.getMonthOfYear(), today.getDayOfMonth() - 1, 12, 0);\n DateTime end = new DateTime(today.getYear(), today.getMonthOfYear(), today.getDayOfMonth(), 12, 0);\n\n // when\n aggregatedDay.addRecord(aRecord(start, end, Rounding.Strategy.SIXTY_MINUTES_UP));\n\n // then: duration equals the hours covering today\n assertEquals(12, aggregatedDay.getDuration().getStandardHours());\n }", "public void checkAddTrackDay() {\n int hour = this.timeTrankiManager.getHour();\n int minute = this.timeTrankiManager.getMinute();\n\n if (hour == 9 && minute == 00) {\n this.trackListFinal.addTrackDay(1);\n }\n }", "private String parseTime(TimePicker start){\n String time = \"\";\n if (start.getHour() < 10){\n time += \"0\" + start.getHour() + \":\";\n } else {\n time += start.getHour() + \":\";\n }\n if (start.getMinute() < 10){\n time += \"0\" + start.getMinute();\n } else {\n time += start.getMinute();\n }\n return time;\n }", "long getInhabitedTime();", "public int getStartMinute() {\n return startMinute;\n }", "public void setStart_time(long start_time) {\n this.start_time = start_time;\n }", "XMLGregorianCalendar getMovementStartTime();", "public Timestamp getDateStart();", "net.opengis.gml.x32.TimeInstantPropertyType addNewBegin();", "public void setStartTime (long x)\r\n {\r\n startTime = x;\r\n }", "public void timePasses(){\n crtClock++;\n if(crtClock==25)crtClock=1; // If end of day, reset to 1\n if(crtClock<=opHours)tellMeterToConsumeUnits(unitsPerHr);\n }", "long getVisitStarttime();", "long getVisitStarttime();", "public boolean setStartTime(int newStart)\n\t{\n\t\tif (newStart >= 0 && newStart < fileLength)\n\t\t{\n\t\t\tstartTime = newStart;\n\t\t\tif (startTime + playbackLength > fileLength)\n\t\t\t{\n\t\t\t\tplaybackLength = fileLength - startTime;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public void addTime(long in) {\n if (current < max) {\n times[current] = in;\n current++;\n }\n else System.out.println(\"Adding past max\");\n }", "public String getFormattedTimeFromStart() {\r\n if (history.getNumberOfJumpsSoFar() == 0) {\r\n return \"00:00\";\r\n }\r\n\r\n double time = history.getTimeFromStart();\r\n double maxTime = 59.59;\r\n if (time < maxTime) {\r\n return String.format(\"%02d:%02d\", (int) (time % 60), (int) (time * 100 % 100));\r\n } else {\r\n return \"59:59\";\r\n }\r\n }", "public String getCurrentDateTimeHourMinSec() {\n\t\t\t\t// DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t\t// need to change after the date format is decided\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t\tDate date = new Date();\n\t\t\t\treturn dateFormat.format(date);\n\t\t\t}", "public synchronized int setArrivalTime(){\n\t\t return random.nextInt((30-1)+1)+1;\n\n\t}", "private long decideNextEndReset() {\n\t\tlong time = System.currentTimeMillis() + plugin.getEndResetPeriod() * 86400000;\n\t\t// Round to get the start of the next day in GMT, 5PM Pacific, 8PM Eastern,\n\t\t// when there are the most players on more-or-less\n\t\treturn (time / 86400000) * 86400000;\n\t}", "@Test\n public void addRecord_will_add_the_difference_between_calc_and_effective_duration_to_last_day() {\n DateTime start = new DateTime(today.getYear(), today.getMonthOfYear(), today.getDayOfMonth() - 1, 12, 0);\n DateTime end = new DateTime(today.getYear(), today.getMonthOfYear(), today.getDayOfMonth(), 11, 10);\n\n // when: providing a tracking conf that rounds up\n aggregatedDay.addRecord(aRecord(start, end, Rounding.Strategy.SIXTY_MINUTES_UP));\n\n // then: duration for the 2nd day will contain the *effective* duration\n assertEquals(12, aggregatedDay.getDuration().getStandardHours());\n }", "public void addDelayTime(int add)\r\n\t{\r\n\t\tString[] parts = departureTime.split(\":\");\r\n\t\tString[] parts1 = arrivalTime.split(\":\");\r\n\t\tString departureHour = parts[0];\r\n\t\tString departureMin = parts[1];\r\n\t\tString arrivalHour = parts1[0];\r\n\t\tString arrivalMin = parts1[1];\r\n\t\t// converting string to integer\r\n\t\tint departureHour1 = Integer.parseInt(departureHour);\r\n\t\tint arrivalHour1 = Integer.parseInt(arrivalHour);\r\n\t\t// adding delay time and start form 0 if it is 24\r\n\t\tint departHour = (departureHour1 + add)%24;\r\n\t\tint arriveHour = (arrivalHour1+add)%24;\r\n\t\tString dHour = String.format(\"%02d\",departHour);\r\n\t\tString aHour = String.format(\"%02d\",arriveHour);\r\n\t\t// combining hour and minute.\r\n\t\tthis.departureTime = dHour + \":\" + departureMin;\r\n\t\tthis.arrivalTime = aHour + \":\" + arrivalMin;\r\n\t\t\r\n\t}", "@Schedule(hour = \"2\")\n public void allocateCurrentDayReservation() {\n \n Calendar c = Calendar.getInstance();\n Date dateTime = c.getTime();\n \n reservationSessionBeanLocal.allocateCarsToReservations(dateTime);\n }", "public String getStartTime();", "public String getStartTime();", "public String getCurrentTimeHourMin() {\n\t\t\t\t// DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t\t// need to change after the date format is decided\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"HH:mm\");\n\t\t\t\tDate date = new Date();\n\t\t\t\treturn dateFormat.format(date);\n\t\t\t}", "boolean hasDesiredTime();", "public void timer() {\r\n date.setTime(System.currentTimeMillis());\r\n calendarG.setTime(date);\r\n hours = calendarG.get(Calendar.HOUR_OF_DAY);\r\n minutes = calendarG.get(Calendar.MINUTE);\r\n seconds = calendarG.get(Calendar.SECOND);\r\n //Gdx.app.debug(\"Clock\", hours + \":\" + minutes + \":\" + seconds);\r\n\r\n buffTimer();\r\n dayNightCycle(false);\r\n }", "private void generateDefaultTimeSlots() {\n\t\tLocalTime startTime = LocalTime.of(9, 0); // 9AM start time\n\t\tLocalTime endTime = LocalTime.of(19, 0); // 5PM end time\n\n\t\tfor (int i = 1; i <= 7; i++) {\n\t\t\tList<Timeslot> timeSlots = new ArrayList<>();\n\t\t\tLocalTime currentTime = startTime.plusMinutes(15);\n\t\t\twhile (currentTime.isBefore(endTime) && currentTime.isAfter(startTime)) {\n\t\t\t\tTimeslot newSlot = new Timeslot();\n\t\t\t\tnewSlot.setTime(currentTime);\n\t\t\t\tnewSlot = timeslotRepository.save(newSlot);\n\t\t\t\ttimeSlots.add(newSlot);\n\t\t\t\tcurrentTime = currentTime.plusHours(1); // new slot after one hour\n\t\t\t}\n\t\t\tDay newDay = new Day();\n\t\t\tnewDay.setTs(timeSlots);\n\t\t\tnewDay.setDayOfWeek(DayOfWeek.of(i));\n\t\t\tdayRepository.save(newDay);\n\t\t}\n\t}", "public void instants() {\n\t\tInstant now = Instant.now(); // do something time consuming Instant\n\t\tInstant later = Instant.now();\n\t\tDuration duration = Duration.between(now, later);\n\t\tSystem.out.println(duration.toMillis());\n\n\t\tLocalDate date = LocalDate.of(2015, 5, 25);\n\t\tLocalTime time = LocalTime.of(11, 55, 00);\n\t\tZoneId zone = ZoneId.of(\"US/Eastern\");\n\t\tZonedDateTime zonedDateTime = ZonedDateTime.of(date, time, zone);\n\t\tInstant instant = zonedDateTime.toInstant();\n\n\t\tInstant nextDay = instant.plus(1, ChronoUnit.DAYS);\n\t\tSystem.out.println(nextDay);\n\t\tInstant nextHour = instant.plus(1, ChronoUnit.HOURS);\n\t\tSystem.out.println(nextHour);\n\t\t// Instant nextWeek = instant.plus(1, ChronoUnit.WEEKS); // exception\n\t}", "public String getMinutes();" ]
[ "0.66337526", "0.6062038", "0.5722276", "0.5685164", "0.56656003", "0.564328", "0.5633698", "0.5568818", "0.55547464", "0.55514425", "0.5504714", "0.5475176", "0.5472962", "0.5465932", "0.54124546", "0.5397302", "0.53697264", "0.53657097", "0.5341377", "0.5337767", "0.5337767", "0.5337767", "0.5327551", "0.5317446", "0.53122604", "0.53121585", "0.5277772", "0.5272565", "0.5255448", "0.524277", "0.5239532", "0.52180016", "0.52129674", "0.5211802", "0.52001494", "0.51942194", "0.5190974", "0.5190974", "0.5190792", "0.5177015", "0.5175624", "0.51732296", "0.5170027", "0.5168782", "0.516789", "0.51642567", "0.5154483", "0.5137865", "0.5078644", "0.50783783", "0.5072764", "0.50726056", "0.5063363", "0.5061424", "0.5055972", "0.50503653", "0.50371933", "0.5036282", "0.50331163", "0.50311714", "0.50276256", "0.5016875", "0.50153077", "0.50055754", "0.5003258", "0.50024945", "0.5001333", "0.4976437", "0.497211", "0.49674883", "0.49659133", "0.49654192", "0.49548265", "0.49540523", "0.49444374", "0.49426764", "0.4939935", "0.49159324", "0.49099207", "0.49095544", "0.49078345", "0.49007463", "0.49007463", "0.4897055", "0.48941815", "0.48939884", "0.4890592", "0.4889373", "0.48861", "0.48824635", "0.48748022", "0.4874362", "0.4872182", "0.4872182", "0.486713", "0.48521724", "0.48464206", "0.4839645", "0.4836487", "0.48297843" ]
0.5144323
47
Graph: 0 1 2 3 4 5
@Test public void testMiniFatTreeExtension() throws IOException { Graph: // // 0 1 // 2 3 4 5 // File inFile = constructGraph( 6, 16, "incl_range(2,5)", "set(0,1)", "incl_range(2,5)", "2 0\n0 2\n2 1\n1 2\n3 0\n0 3\n3 1\n1 3\n4 0\n0 4\n4 1\n1 4\n5 0\n0 5\n5 1\n1 5" ); // Perform extension File tempOut = File.createTempFile("topology", ".tmp"); TopologyServerExtender extender = new TopologyServerExtender(inFile.getAbsolutePath(), tempOut.getAbsolutePath()); extender.extendRegular(7); assertTrue(inFile.delete()); Pair<Graph, GraphDetails> res = GraphReader.read(tempOut.getAbsolutePath()); GraphDetails details = res.getRight(); // Graph dimensions assertEquals(34, details.getNumNodes()); // 6 + 4*7 = 34 assertEquals(72, details.getNumEdges()); // 16 + 2*4*7 = 16 + 56 = 72 // Sets assertTrue(details.isAutoExtended()); assertEquals(createSet(2, 3, 4, 5), details.getTorNodeIds()); // ToRs remain the same assertEquals(createSet(0, 1), details.getSwitchNodeIds()); // Switches remain the same Set<Integer> servers = new HashSet<>(); for (int i = 6; i < 34; i++ ) { servers.add(i); } assertEquals(servers, details.getServerNodeIds()); // Servers are added // Test saved mapping from server perspective for (int i = 6; i < 34; i++ ) { assertEquals((int) details.getTorIdOfServer(i), 2 + (int) Math.floor((double) (i - 6) / 7.0)); } // Test saved mapping from ToR perspective for (int i = 2; i <= 5; i++ ) { Set<Integer> torServers = new HashSet<>(); for (int j = 6 + (i - 2) * 7; j < 6 + (i - 1) * 7; j++ ) { torServers.add(j); } assertEquals(torServers, details.getServersOfTor(i)); } assertTrue(tempOut.delete()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void graph4() {\n\t\tconnect(\"8\", \"9\");\n\t\tconnect(\"3\", \"1\");\n\t\tconnect(\"3\", \"2\");\n\t\tconnect(\"3\", \"9\");\n\t\tconnect(\"4\", \"3\");\n\t\t//connect(\"4\", \"5\");\n\t\t//connect(\"4\", \"7\");\n\t\t//connect(\"5\", \"7\");\t\t\n\t}", "void graph2() {\n\t\tconnect(\"1\", \"7\");\n\t\tconnect(\"1\", \"8\");\n\t\tconnect(\"1\", \"9\");\n\t\tconnect(\"9\", \"1\");\n\t\tconnect(\"9\", \"0\");\n\t\tconnect(\"9\", \"4\");\n\t\tconnect(\"4\", \"8\");\n\t\tconnect(\"4\", \"3\");\n\t\tconnect(\"3\", \"4\");\n\t}", "void graph3() {\n\t\tconnect(\"0\", \"0\");\n\t\tconnect(\"2\", \"2\");\n\t\tconnect(\"2\", \"3\");\n\t\tconnect(\"3\", \"0\");\n\t}", "private static int[][] graph(){\n int[][] graph = new int[6][6];\n graph[0][1] = 7;\n graph[1][0] = 7;\n\n graph[0][2] = 2;\n graph[2][0] = 2;\n\n graph[1][2] = 3;\n graph[2][1] = 3;\n\n graph[1][3] = 4;\n graph[3][1] = 4;\n\n graph[2][3] = 8;\n graph[3][2] = 8;\n\n graph[4][2] = 1;\n graph[2][4] = 1;\n\n graph[3][5] = 5;\n graph[5][3] = 5;\n\n graph[4][5] = 3;\n graph[5][4] = 3;\n return graph;\n }", "public Graph(){\n\t\tthis.sizeE = 0;\n\t\tthis.sizeV = 0;\n\t}", "Graph(int v) {\n this.v = v;\n array = new ArrayList[v];\n\n // Add linkedList to array\n for (int i = 0; i < v; i++) {\n array[i] = new ArrayList<>();\n }\n }", "Graph(int v) {\n V = v;\n adj = new LinkedList[v];\n for (int i = 0; i < v; ++i)\n adj [i] = new LinkedList();\n }", "Graph(){\n\t\taddNode();\n\t\tcurrNode=myNodes.get(0);\n\t}", "static void showGraph(ArrayList<ArrayList<Integer>> graph) {\n for(int i=0;i< graph.size(); i++ ){\n System.out.print(\"Vertex : \" + i + \" : \");\n for(int j = 0; j < graph.get(i).size(); j++) {\n System.out.print(\" -> \"+ graph.get(i).get(j));\n }\n }\n }", "public Graph(){\r\n this.listEdges = new ArrayList<>();\r\n this.listNodes = new ArrayList<>();\r\n this.shown = true;\r\n }", "Graph(int n){\r\n numberOfVertices = n;\r\n adjacentVertices = new LinkedList[numberOfVertices];\r\n for (int i = 0; i < numberOfVertices; i++){\r\n adjacentVertices[i] = new LinkedList<>();\r\n }\r\n }", "public void drawGraph(Graph graph);", "void printGraph();", "public:\n Graph(int V); // Constructor\n void addEdge(int v, int w);", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n n = 5;\n m = 7;\n\n // 최단 거리 테이블을 모두 무한으로 초기화\n for (int i = 0; i < 101; i++) {\n Arrays.fill(graph[i], INF);\n }\n\n // 자기 자신에서 자기 자신으로 가는 비용은 0으로 초기화\n for (int i = 1; i <= n; i++) {\n for (int j = 0; j <= n; j++) {\n if (i == j)\n graph[i][j] = 0;\n }\n }\n\n // 각 간선에 대한 정보를 입력 받아 그 값으로 초기화 (양방향 이동 가능)\n graph[1][2] = 1;\n graph[2][1] = 1;\n graph[1][3] = 1;\n graph[3][1] = 1;\n graph[1][4] = 1;\n graph[4][1] = 1;\n graph[2][4] = 1;\n graph[4][2] = 1;\n graph[3][4] = 1;\n graph[4][3] = 1;\n graph[3][5] = 1;\n graph[5][3] = 1;\n graph[4][5] = 1;\n graph[5][4] = 1;\n\n // // 각 간선에 대한 정보를 입력 받아, 그 값으로 초기화\n // for (int i = 0; i < m; i++) {\n // // A와 B가 서로에게 가는 비용은 1이라고 설정\n // int a = sc.nextInt();\n // int b = sc.nextInt();\n // graph[a][b] = 1;\n // graph[b][a] = 1;\n // }\n\n for (int k = 1; k <= n; k++) {\n for (int a = 1; a <= n; a++) {\n for (int b = 1; b <= n; b++) {\n graph[a][b] = Math.min(graph[a][b], graph[a][k] + graph[k][b]);\n }\n }\n }\n\n // 수행된 결과를 출력\n for (int a = 1; a <= n; a++) {\n for (int b = 1; b <= n; b++) {\n if (graph[a][b] == INF)\n System.out.print(\"INFINITY \");\n else\n System.out.print(graph[a][b] + \" \");\n }\n System.out.println();\n }\n\n System.out.println(graph[1][5] + graph[5][4]);\n }", "public void buildGraph(){\n\t}", "public static void main(String[] args) throws IOException {\n\n // read in graph\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt(), m = scanner.nextInt();\n ArrayList<Integer>[] graph = new ArrayList[n];\n for (int i = 0; i < n; i++)\n graph[i] = new ArrayList<>();\n\n for (int i = 0; i < m; i++) {\n scanner.nextLine();\n int u = scanner.nextInt() - 1, v = scanner.nextInt() - 1; // convert to 0 based index\n graph[u].add(v);\n graph[v].add(u);\n }\n\n int[] dist = new int[n];\n Arrays.fill(dist, -1);\n // partition the vertices in each of the components of the graph\n for (int u = 0; u < n; u++) {\n if (dist[u] == -1) {\n // bfs\n Queue<Integer> queue = new LinkedList<>();\n queue.add(u);\n dist[u] = 0;\n while (!queue.isEmpty()) {\n int w = queue.poll();\n for (int v : graph[w]) {\n if (dist[v] == -1) { // unvisited\n dist[v] = (dist[w] + 1) % 2;\n queue.add(v);\n } else if (dist[w] == dist[v]) { // visited and form a odd cycle\n System.out.println(-1);\n return;\n } // otherwise the dist will not change\n }\n }\n }\n\n }\n\n BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));\n // vertices with the same dist are in the same group\n List<Integer>[] groups = new ArrayList[2];\n groups[0] = new ArrayList<>();\n groups[1] = new ArrayList<>();\n for (int u = 0; u < n; u++) {\n groups[dist[u]].add(u + 1);\n }\n for (List<Integer> g: groups) {\n writer.write(String.valueOf(g.size()));\n writer.newLine();\n for (int u: g) {\n writer.write(String.valueOf(u));\n writer.write(' ');\n }\n writer.newLine();\n }\n\n writer.close();\n\n\n }", "protected Graph<Integer, Edge<Integer>> generateGraph() {\n Graph<Integer, Edge<Integer>> graph = newGraph();\n Integer[] integersArray = new Integer[25];\n\n /*\n * add all integers in [0,24]\n */\n for (int i = 0; i < 25; i++) {\n integersArray[i] = new Integer(i);\n graph.addVertex(integersArray[i]);\n }\n\n /*\n * create edges between all integers i, j for which (i + j) is even\n */\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n continue;\n }\n graph.addEdge(new UnweightedEdge(integersArray[i], integersArray[j]));\n }\n }\n\n return graph;\n }", "Graph(int size) {\n n = size;\n V = new Vertex[size + 1];\n // create an array of Vertex objects\n for (int i = 1; i <= size; i++)\n V[i] = new Vertex(i);\n }", "public void drawGraph(Graphics g) \n\t{\n\t\tNode<T> n = start;\n\t\tint count = 0;\t//loop counter variable\n\t\twhile((n.next != start && count == 0) || count < 1) //while not at end of list and hasnt looped\n\t\t{\n\t\t\tint[] pos = n.computeXY();\t\t\t\t\t\t//compute coordinates of the current node\n\t\t\tint[] nextPos = n.next.computeXY();\t\t\t\t//compute coordinates of the next node\n\n\t\t\t//System.out.println(\"--\\nval: \" + n.value + \" position: \" + pos[0] + \", \" + pos[1]);\n\n\t\t\tg.setColor(Color.BLACK); //set draw color to black\n\t\t\tg.drawLine(pos[0], pos[1], nextPos[0], nextPos[1]); //draw line between current \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// and next node\n\t\t\tif(n.isCurrent) //if the node n is the current node in the list\n\t\t\t{\n\t\t\t\tg.setColor(new Color(100, 200, 100));\t\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tg.setColor(new Color(130, 225, 235));\t\n\t\t\t}\n\n\t\t\tg.fillOval(pos[0] - 25, pos[1] - 25, 50, 50);\t//fill the oval\n\t\t\tg.setColor(Color.BLACK);\t\t\t\t\t\t//set the color of the oval\n\t\t\tif(n == start) \t\t\t\t\t\t\t\t\t//if n is the starting node\n\t\t\t{\n\t\t\t\tg.drawOval(pos[0] - 20, pos[1] - 20, 40, 40);\n\t\t\t}\n\t\t\tg.drawOval(pos[0] - 25, pos[1] - 25, 50, 50);\n\t\t\tg.drawString(n.value.toString(), pos[0], pos[1] + 5);\n\t\t\t\n\t\t\tif(n.next == start) //if we are at the end\n\t\t\t{\n\t\t\t\tcount++;\t\t//increment loop counter\n\t\t\t}\n\t\t\tn = n.next;\n\t\t}\n\t}", "public static graphNode[] createGraph() {\n\t\tgraphNode[] graph = new graphNode[16];\n\t\t\n\t\tgraph[0] = new graphNode(1, new graphNode(5, null));\n\t\tgraph[1] = new graphNode(0, null);\n\t\tgraph[2] = new graphNode(7, new graphNode(11, null));\n\t\tgraph[3] = null; //illegal, fox eats chicken\n\t\tgraph[4] = new graphNode(5, new graphNode(7, new graphNode(13, null)));\n\t\tgraph[5] = new graphNode(0, new graphNode(4, null));\n\t\tgraph[6] = null; //illegal, chicken eats grain\n\t\tgraph[7] = new graphNode(2, new graphNode(4, null));\n\t\tgraph[8] = new graphNode(11, new graphNode(13, null));\n\t\tgraph[9] = null; //illegal, chicken eats grain\n\t\tgraph[10] = new graphNode(11, new graphNode(15, null));\n\t\tgraph[11] = new graphNode(2, new graphNode(8, new graphNode(10, null)));\n\t\tgraph[12] = null; //illegal, fox eats chicken\n\t\tgraph[13] = new graphNode(4, new graphNode(8, null));\n\t\tgraph[14] = new graphNode(15, null);\n\t\tgraph[15] = new graphNode(10, new graphNode(14, null));\n\t\t\n\t\treturn graph;\n\t}", "public FixedGraph(int numOfVertices, int b, int seed) {\r\n super(numOfVertices);\r\n int adjVertex;\r\n double x = 0;\r\n int[] numOfEdges = new int[numOfVertices];\r\n Vector<Integer> graphVector = new Vector<Integer>();\r\n connectivity = b;\r\n\r\n\r\n Random random = new Random(seed);\r\n graphSeed = seed;\r\n\r\n for (int v = 0; v < numOfVertices; v++) {\r\n graphVector.add(new Integer(v));\r\n }\r\n\r\n for (int i = 0; i < numOfVertices; i++) {\r\n\r\n while ((numOfEdges[i] < b) && (graphVector.isEmpty() == false)) {\r\n x = random.nextDouble();\r\n do {\r\n adjVertex = (int) (x * numOfVertices);\r\n\r\n } while (adjVertex >= numOfVertices);\r\n\r\n\r\n if ((i == adjVertex) || (numOfEdges[adjVertex] >= b)) {\r\n if (numOfEdges[adjVertex] >= b) {\r\n for (int v = 0; v < graphVector.size(); v++) {\r\n\r\n int compInt = ((Integer) graphVector.elementAt(v)).intValue();\r\n if (adjVertex == compInt) {\r\n graphVector.removeElementAt(v);\r\n }\r\n if (graphVector.isEmpty() == true) {\r\n System.out.println(\"Graph Vector Empty\");\r\n }\r\n }\r\n\r\n }\r\n\r\n }\r\n if ((i != adjVertex) && (adjVertex < numOfVertices) && (numOfEdges[adjVertex] < b) && (super.isAdjacent(i, adjVertex) == false) && (numOfEdges[i] < b)) {\r\n super.addEdge(i, adjVertex);\r\n if (super.isAdjacent(i, adjVertex)) {\r\n numOfEdges[i] = numOfEdges[i] + 1;\r\n numOfEdges[adjVertex] = numOfEdges[adjVertex] + 1;\r\n }\r\n System.out.print(\"*\");\r\n\r\n }\r\n\r\n if (numOfEdges[i] >= b) {\r\n for (int v = 0; v < graphVector.size(); v++) {\r\n\r\n int compInt = ((Integer) graphVector.elementAt(v)).intValue();\r\n if (i == compInt) {\r\n graphVector.removeElementAt(v);\r\n }\r\n if (graphVector.isEmpty() == true) {\r\n System.out.println(\"Graph Vector Empty\");\r\n }\r\n }\r\n break;\r\n }\r\n if (graphVector.size() < b) {\r\n //boolean deadlock = false;\r\n System.out.println(\"Graph size= \" + graphVector.size());\r\n\r\n for (int v = 0; v < graphVector.size(); v++) {\r\n\r\n int compInt = ((Integer) graphVector.elementAt(v)).intValue();\r\n //System.out.println(\"i:= \" + i + \" and compInt:= \" + compInt);\r\n if (super.isAdjacent(i, compInt) || (i == compInt)) {\r\n //System.out.println(\"\" + i + \" adjacent to \" + compInt + \" \" + super.isAdjacent(i, compInt));\r\n // deadlock = false;\r\n } else {\r\n if ((numOfEdges[compInt] < b) && (numOfEdges[i] < b) && (i != compInt)) {\r\n super.addEdge(i, compInt);\r\n numOfEdges[i] = numOfEdges[i] + 1;\r\n numOfEdges[compInt] = numOfEdges[compInt] + 1;\r\n if (numOfEdges[i] >= b) {\r\n for (int w = 0; w < graphVector.size(); w++) {\r\n\r\n int compW = ((Integer) graphVector.elementAt(w)).intValue();\r\n if (i == compW) {\r\n graphVector.removeElementAt(w);\r\n }\r\n if (graphVector.isEmpty() == true) {\r\n System.out.println(\"Graph Vector Empty\");\r\n }\r\n }\r\n break;\r\n }\r\n if (numOfEdges[compInt] >= b) {\r\n for (int w = 0; w < graphVector.size(); w++) {\r\n\r\n int compW = ((Integer) graphVector.elementAt(w)).intValue();\r\n if (compInt == compW) {\r\n graphVector.removeElementAt(w);\r\n }\r\n if (graphVector.isEmpty() == true) {\r\n System.out.println(\"Graph Vector Empty\");\r\n }\r\n }\r\n\r\n }\r\n // deadlock = true;\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n\r\n System.out.println();\r\n }\r\n\r\n }", "public Graph getGraph();", "public static void main(String[] args) {\n Graph graph = new Graph();\n graph.addEdge(0, 1);\n graph.addEdge(0, 4);\n\n graph.addEdge(1,0);\n graph.addEdge(1,5);\n graph.addEdge(1,2);\n graph.addEdge(2,1);\n graph.addEdge(2,6);\n graph.addEdge(2,3);\n\n graph.addEdge(3,2);\n graph.addEdge(3,7);\n\n graph.addEdge(7,3);\n graph.addEdge(7,6);\n graph.addEdge(7,11);\n\n graph.addEdge(5,1);\n graph.addEdge(5,9);\n graph.addEdge(5,6);\n graph.addEdge(5,4);\n\n graph.addEdge(9,8);\n graph.addEdge(9,5);\n graph.addEdge(9,13);\n graph.addEdge(9,10);\n\n graph.addEdge(13,17);\n graph.addEdge(13,14);\n graph.addEdge(13,9);\n graph.addEdge(13,12);\n\n graph.addEdge(4,0);\n graph.addEdge(4,5);\n graph.addEdge(4,8);\n graph.addEdge(8,4);\n graph.addEdge(8,12);\n graph.addEdge(8,9);\n graph.addEdge(12,8);\n graph.addEdge(12,16);\n graph.addEdge(12,13);\n graph.addEdge(16,12);\n graph.addEdge(16,17);\n graph.addEdge(17,13);\n graph.addEdge(17,16);\n graph.addEdge(17,18);\n\n graph.addEdge(18,17);\n graph.addEdge(18,14);\n graph.addEdge(18,19);\n\n graph.addEdge(19,18);\n graph.addEdge(19,15);\n LinkedList<Integer> visited = new LinkedList();\n List<ArrayList<Integer>> paths = new ArrayList<ArrayList<Integer>>();\n int currentNode = START;\n visited.add(START);\n new searchEasy().findAllPaths(graph, visited, paths, currentNode);\n for(ArrayList<Integer> path : paths){\n for (Integer node : path) {\n System.out.print(node);\n System.out.print(\" \");\n }\n System.out.println();\n }\n }", "public static void main(String[] args) {\n\n Graph myGraph = new Graph();\n myGraph.addNode(\"8\");\n myGraph.addNode(\"1\");\n myGraph.addNode(\"2\");\n myGraph.addNode(\"9\");\n myGraph.addNode(\"7\");\n myGraph.addNode(\"5\");\n myGraph.addEdge(\"8\" , \"1\" , 50);\n myGraph.addEdge(\"5\" , \"1\" , 70);\n myGraph.addEdge(\"7\" , \"5\", 20);\n myGraph.addEdge(\"8\" , \"9\", 100);\n myGraph.addEdge(\"8\" , \"2\", 40);\n String[] trip = {\"8\" , \"1\" , \"5\"};\n String[] trip2 = {\"8\" , \"5\"};\n String[] trip3 = {\"8\" , \"1\" , \"5\" , \"7\" , \"5\" , \"1\" , \"8\" , \"9\"};\n String[] trip4 = {\"8\" , \"9\" , \"5\" };\n String[] trip5 = {\"8\"};\n String[] trip6 = {\"8\" , \"2\"};\n// System.out.println(myGraph);\n// System.out.println(myGraph.getNodes());\n// System.out.println(myGraph.getNeighbors(\"8\"));\n// System.out.println(myGraph.getNeighbors(\"7\"));\n// System.out.println(myGraph.getNeighbors(\"5\"));\n// System.out.println(myGraph.size());\n// System.out.println(myGraph.breadthFirst(\"8\"));\n// System.out.println(myGraph.weightList);\n// System.out.println(myGraph.breadthFirst(\"7\"));\n// System.out.println(myGraph.breadthFirst(\"5\"));\n// System.out.println(myGraph.businessTrip(\"8\",trip));\n// System.out.println(myGraph.businessTrip(\"8\",trip2));\n// System.out.println(myGraph.businessTrip(\"8\",trip3));\n// System.out.println(myGraph.businessTrip(\"8\",trip4));\n// System.out.println(myGraph.businessTrip(\"8\",trip5));\n// System.out.println(myGraph.businessTrip(\"8\",trip6));\n System.out.println(myGraph.depthFirst(\"8\"));\n }", "public static void main(String [] args){\n\t\tSystem.out.println(\"Code by github: Vinay26k\");\n\t\t // create the graph given in above figure\n int V = 5;\n Graph graph = new Graph(V);\n addEdge(graph, 0, 1);\n addEdge(graph, 0, 4);\n addEdge(graph, 1, 2);\n addEdge(graph, 1, 3);\n addEdge(graph, 1, 4);\n addEdge(graph, 2, 3);\n addEdge(graph, 3, 4);\n \n // print the adjacency list representation of \n // the above graph\n printGraph(graph);\n\t}", "public Graph(int n) {\n this.n = n;\n edge = new List[n];\n for (int i = 0; i < n; i++)\n edge[i] = new List(0, 0, 0); // dummy node\n }", "public Graph createGraph() {\n String fileName;\n// fileName =\"./428333.edges\";\n String line;\n Graph g = new Graph();\n// List<String> vertexNames = new ArrayList<>();\n// try\n// {\n// BufferedReader in=new BufferedReader(new FileReader(fileName));\n// line=in.readLine();\n// while (line!=null) {\n////\t\t\t\tSystem.out.println(line);\n// String src = line.split(\" \")[0];\n// String dst = line.split(\" \")[1];\n//// vertexNames.add(src);\n//// vertexNames.add(dst);\n//// System.out.println(src+\" \"+dst);\n// g.addEdge(src, dst, 1);\n// line=in.readLine();\n// }\n// in.close();\n// } catch (Exception e) {\n//\t\t\te.printStackTrace();\n// }\n\n fileName=\"./788813.edges\";\n// List<String> vertexNames = new ArrayList<>();\n try\n {\n BufferedReader in=new BufferedReader(new FileReader(fileName));\n line=in.readLine();\n while (line!=null) {\n//\t\t\t\tSystem.out.println(line);\n String src = line.split(\" \")[0];\n String dst = line.split(\" \")[1];\n g.addEdge(src, dst, 1);\n line=in.readLine();\n }\n in.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n// Graph g = new Graph(new String[]{\"v0\", \"v1\", \"v2\", \"v3\", \"v4\", \"v5\", \"v6\", \"v7\", \"v8\"});\n// // Add the required edges.\n// g.addEdge(\"v0\", \"v1\", 4); g.addEdge(\"v0\", \"v7\", 8);\n// g.addEdge(\"v1\", \"v2\", 8); g.addEdge(\"v1\", \"v7\", 11); g.addEdge(\"v2\", \"v1\", 8);\n// g.addEdge(\"v2\", \"v8\", 2); g.addEdge(\"v2\", \"v5\", 4); g.addEdge(\"v2\", \"v3\", 7);\n// g.addEdge(\"v3\", \"v2\", 7); g.addEdge(\"v3\", \"v5\", 14); g.addEdge(\"v3\", \"v4\", 9);\n// g.addEdge(\"v4\", \"v3\", 9); g.addEdge(\"v4\", \"v5\", 10);\n// g.addEdge(\"v5\", \"v4\", 10); g.addEdge(\"v5\", \"v3\", 9); g.addEdge(\"v5\", \"v2\", 4);\n// g.addEdge(\"v5\", \"v6\", 2);\n// g.addEdge(\"v6\", \"v7\", 1); g.addEdge(\"v6\", \"v8\", 6); g.addEdge(\"v6\", \"v5\", 2);\n// g.addEdge(\"v7\", \"v0\", 8); g.addEdge(\"v7\", \"v8\", 7); g.addEdge(\"v7\", \"v1\", 11);\n// g.addEdge(\"v7\", \"v6\", 1);\n// g.addEdge(\"v8\", \"v2\", 2); g.addEdge(\"v8\", \"v7\", 7); g.addEdge(\"v8\", \"v6\", 6);\n\n//\n return g;\n }", "public GraphImpl(int[][] g) {\n\t\tanzKnoten = g.length;\n\t\tgraph = g;\n\t}", "private int[][] initGraph() {\r\n\t\tint[][] graph = new int[8][8];\r\n\t\tgraph[0] = new int[] { 0, 1, 1, MAX, MAX, MAX, MAX, MAX };\r\n\t\tgraph[1] = new int[] { 1, 0, MAX, 1, 1, MAX, MAX, MAX };\r\n\t\tgraph[2] = new int[] { 1, MAX, 0, MAX, MAX, 1, 1, MAX };\r\n\t\tgraph[3] = new int[] { MAX, 1, MAX, 0, MAX, MAX, MAX, 1 };\r\n\t\tgraph[4] = new int[] { MAX, 1, MAX, MAX, 0, MAX, MAX, 1 };\r\n\t\tgraph[5] = new int[] { MAX, MAX, 1, MAX, MAX, 0, 1, MAX };\r\n\t\tgraph[6] = new int[] { MAX, MAX, 1, MAX, MAX, 1, 0, MAX };\r\n\t\tgraph[7] = new int[] { MAX, MAX, MAX, 1, 1, MAX, MAX, 0 };\r\n\t\treturn graph;\r\n\t}", "public Graph() {\r\n\t\tthis.matrix = new Matrix();\r\n\t\tthis.listVertex = new ArrayList<Vertex>();\r\n\t}", "public Graph(int V, int E) {\n this(V);\n if (E < 0) throw new RuntimeException(\"Number of edges must be nonnegative\");\n for (int i = 0; i < E; i++) {\n int v = (int) (Math.random() * V);\n int w = (int) (Math.random() * V);\n double weight = Math.round(100 * Math.random()) / 100.0;\n Edge e = new Edge(v, w, weight,0);\n //addEdge(e);\n }\n }", "public interface Graph {\n\n\t/**\n\t * Method to add the edge from start to end to the graph.\n\t * Adding self-loops is not allowed.\n\t * @param start start vertex\n\t * @param end end vertex\n\t */\n\tpublic void addEdge(int start, int end);\n\n\t/**\n\t * Method to add the edge with the given weight to the graph from start to end.\n\t * Adding self-loops is not allowed.\n\t * @param start number of start vertex\n\t * @param end number of end vertex\n\t * @param weight weight of edge\n\t */\n\tpublic void addEdge(int start, int end, double weight);\n\n\t/**\n\t * Method to add a vertex to the graph.\n\t */\n\tpublic void addVertex();\n\t\n\t/**\n\t * Method to add multiple vertices to the graph.\n\t * @param n number of vertices to add\n\t */\n\tpublic void addVertices(int n);\n\n\t/**\n\t * Returns all neighbors of the given vertex v (all vertices i with {i,v} in E or (i,v) or (v,i) in E).\n\t * @param v vertex whose neighbors shall be returned\n\t * @return List of vertices adjacent to v\n\t */\n\tpublic List<Integer> getNeighbors(int v);\n\n\t/**\n\t * Returns a list containing all predecessors of v. In an undirected graph all neighbors are returned.\n\t * @param v vertex id\n\t * @return list containing all predecessors of v\n\t */\n\tpublic List<Integer> getPredecessors(int v);\n\n\t/**\n\t * Returns a list containing all successors v. In an undirected graph all neighbors are returned.\n\t * @param v vertex id\n\t * @return list containing all edges starting in v\n\t */\n\tpublic List<Integer> getSuccessors(int v);\n\n\t/**\n\t * Method to get the number of vertices.\n\t * @return number of vertices\n\t */\n\tpublic int getVertexCount();\n\n\t/**\n\t * Method to get the weight of the edge {start, end} / the arc (start, end).\n\t * @param start start vertex of edge / arc\n\t * @param end end vertex of edge / arc\n\t * @return Double.POSITIVE_INFINITY, if the edge does not exist, c_{start, end} otherwise\n\t */\n\tpublic double getEdgeWeight(int start, int end);\n\n\t/**\n\t * Method to test whether the graph contains the edge {start, end} / the arc (start, end).\n\t * @param start start vertex of the edge\n\t * @param end end vertex of the edge\n\t */\n\tpublic boolean hasEdge(int start, int end);\n\n\t/**\n\t * Method to remove an edge from the graph, defined by the vertices start and end.\n\t * @param start start vertex of the edge\n\t * @param end end vertex of the edge\n\t */\n\tpublic void removeEdge(int start, int end);\n\n\t/**\n\t * Method to remove the last vertex from the graph.\n\t */\n\tpublic void removeVertex();\n\n\t/**\n\t * Returns whether the graph is weighted.\n\t * A graph is weighted if an edge with weight different from 1.0 has been added to the graph.\n\t * @return true if the graph is weighted\n\t */\n\tpublic boolean isWeighted();\n\n\t/**\n\t * Returns whether the graph is directed.\n\t * @return true if the graph is directed\n\t */\n\tpublic boolean isDirected();\n\n}", "Digraph(int v) {\n this.V = v;\n adj = (List<Integer>[]) new ArrayList[V];\n for (int i = 0; i < V; i++) {\n adj[i] = new ArrayList<>();\n }\n }", "public Graph(int V){\n this.V = V;\n this.E = 0;//no edge at initial condition.\n //initialize the adjacency list\n this.adj = new Queue[V];\n //initialize the Queue\n for(int i=0;i<adj.length;i++) {\n //each element in adj is a Queue that stores all vertexes connected with the index i of adj.\n adj[i] = new Queue<Integer>();\n }\n }", "public static void main(String[] args) {\n int vertex = 5;\n //value of vertexes\n int[][] matrix = new int[vertex+1][vertex+1];\n \n //to store the Edges informarion\n ArrayList<Edge> edgeList = new ArrayList<Edge>();\n edgeList.add(new Edge(1,2,2));\n edgeList.add(new Edge(2,3,4));\n edgeList.add(new Edge(2,4,8));\n edgeList.add(new Edge(3,1,3));\n edgeList.add(new Edge(3,5,8));\n edgeList.add(new Edge(5,2,7));\n edgeList.add(new Edge(5,4,3));\n \n //loop of the ArrayList\n for(int i=0; i<edgeList.size(); i++){\n //define the variable Edge as currentEdge\n Edge currentEdge = edgeList.get(i);\n //stored the information in these 3 variables\n int startVertex = currentEdge.startVertex;\n int endVertex = currentEdge.endVertex;\n int weight = currentEdge.weight;\n //updated matrix and created data structure for weighted Directed Graph\n matrix[startVertex][endVertex] = weight;\n }\n\n for(int i = 1; i<=vertex; i++){\n for(int j=1; j<=vertex; j++){\n System.out.print(matrix[i][j] + \" \");\n }\n System.out.println();\n //to move to the next line\n }\n }", "GraphObj() {\n this._V = 0;\n this._E = 0;\n inListArray = new ArrayList<>();\n inListArray.add(null);\n outListArray = new ArrayList<>();\n outListArray.add(null);\n selfEdges = new ArrayList<>();\n selfEdges.add(-1);\n edgeList = new ArrayList<>();\n edgeList.add(null);\n }", "Graph(int vertices) {\r\n this.numVertices = vertices;\r\n adjacencylist = new LinkedList[vertices];\r\n //initialize adjacency lists for all the vertices\r\n for (int i = 0; i <vertices ; i++) {\r\n adjacencylist[i] = new LinkedList<>();\r\n }\r\n }", "public Graph(int V)\n {\n this.V = V;\n adj = (Bag<Integer>[]) new Bag[V];\n for (int v = 0; v < V; v++)\n adj[v] = new Bag<Integer>();\n }", "public static void DrawIt (Graph<Integer,String> g) {\n\t\tISOMLayout<Integer,String> layout = new ISOMLayout<Integer,String>(g);\r\n\t\t// The Layout<V, E> is parameterized by the vertex and edge types\r\n\t\tlayout.setSize(new Dimension(650,650)); // sets the initial size of the space\r\n\t\t// The BasicVisualizationServer<V,E> is parameterized by the edge types\r\n\t\tBasicVisualizationServer<Integer,String> vv =\r\n\t\tnew BasicVisualizationServer<Integer,String>(layout);\r\n\t\tvv.setPreferredSize(new Dimension(650,650)); //Sets the viewing area size\r\n\t\tJFrame frame = new JFrame(\"Simple Graph View\");\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().add(vv);\r\n\t\tframe.pack();\r\n\t\tframe.setVisible(true);\r\n\r\n\t}", "public JXGraph() {\r\n this(0.0, 0.0, -1.0, 1.0, -1.0, 1.0, 0.2, 4, 0.2, 4);\r\n }", "public static void main(String[] args) {\n\tGraph g = new Graph(9);\n\tg.addEdge(0,2);\n\tg.addEdge(0,5);\n\tg.addEdge(2,3);\n\tg.addEdge(2,4);\n\tg.addEdge(5,3);\n\tg.addEdge(5,6);\n\tg.addEdge(3,6);\n\tg.addEdge(6,7);\n\tg.addEdge(6,8);\n\tg.addEdge(6,4);\n\tg.addEdge(7,8);\n\t \n\tg.printGraph();\n\tSystem.out.println(\"Number of edges: \" + numEdges(g));\n\t\n }", "public Vertex[] createGraph(){\n\t\t /* constructing a graph using matrices\n\t\t * If there is a connection between two adjacent LETTERS, the \n\t * cell will contain a num > 1, otherwise a 0. A value of -1 in the\n\t * cell denotes that the cities are not neighbors.\n\t * \n\t * GRAPH (with weights b/w nodes):\n\t * E+---12-------+B--------18-----+F----2---+C\n\t * +\t\t\t\t+\t\t\t\t +\t\t +\n\t * |\t\t\t\t|\t\t\t\t/\t\t |\n\t * |\t\t\t\t|\t\t\t |\t\t |\n\t * |\t\t\t\t|\t\t\t |\t\t 10\n\t * 24\t\t\t\t8\t\t\t 8\t |\n\t * |\t\t\t\t|\t\t\t |\t\t +\n\t * |\t\t\t\t|\t\t\t | H <+---11---I\n\t * |\t\t\t\t|\t\t\t /\n\t * +\t\t\t\t+\t\t\t +\n\t * G+---12----+A(start)+---10--+D\n\t * \n\t * NOTE: I is the only unidirectional node\n\t */\n\t\t\n\t\tint cols = 9;\n\t\tint rows = 9;\n\t\t//adjacency matrix\n\t\t\t\t //A B C D E F G H I\n\t int graph[][] = { {0,8,0,10,0,0,12,0,0}, //A\n\t {8,0,0,0,12,18,0,0,0}, //B\n\t {0,0,0,0,0,2,0,10,0}, //C\n\t {10,0,0,0,0,8,0,0,0}, //D\n\t {0,12,0,0,0,0,24,0,0}, //E\n\t {0,18,2,8,0,0,0,0,0}, //F\n\t {12,0,0,0,0,0,24,0,0}, //G\n\t {0,0,10,0,0,0,0,0,11}, //H\n\t {0,0,0,0,0,0,0,11,0}}; //I\n\t \n\t //initialize stores vertices\n\t Vertex[] vertices = new Vertex[rows]; \n\n\t //Go through each row and collect all [i,col] >= 1 (neighbors)\n\t int weight = 0; //weight of the neighbor\n\t for (int i = 0; i < rows; i++) {\n\t \tVector<Integer> vec = new Vector<Integer>(rows);\n\t\t\tfor (int j = 0; j < cols; j++) {\n\t\t\t\tif (graph[i][j] >= 1) {\n\t\t\t\t\tvec.add(j);\n\t\t\t\t\tweight = j;\n\t\t\t\t}//is a neighbor\n\t\t\t}\n\t\t\tvertices[i] = new Vertex(Vertex.getVertexName(i), vec);\n\t\t\tvertices[i].state = weight;\n\t\t\tvec = null; // Allow garbage collection\n\t\t}\n\t return vertices;\n\t}", "public static List<List<Integer>> createGraph(int n) {\n\t List<List<Integer>> graph = new ArrayList<>();\n\t for (int i = 0; i < n; i++) graph.add(new ArrayList<>());\n\t return graph;\n\t }", "public static void articulationPoints(graph g) throws IOException\n\t{\n\t\tint[] visited = new int[g.V];\n\t\tint[] discovered = new int[g.V];\n\t\tint[] low = new int[g.V];\n\t\tint[] parent = new int[g.V];\n\t\tfor(int i = 0 ; i < g.V ; i++)\n\t\t{\n\t\t\tparent[i] = -1;\n\t\t} \n\t\tfor(int i = 0 ; i < g.V ; i++) // Here i m taking 0th node as source node but prog can be easily modified for general node.\n\t\t{\n\t\t\tif(visited[i] == 0)\n\t\t\t{\n\t\t\t\texplore(g,i,visited,discovered,low,parent);\t\n\t\t\t}\t\t\n\t\t}\n\t\tSystem.out.println(\"\\n\\n\\n\\nYou can check if the algo did the correct job by checking if the low[] and discovered[]\\n arrays have the right value or not\");\n\t\tSystem.out.println(\"Press 1 if u want to check the arrays and 0 if not\");\n\t\tint ans = Integer.parseInt(new BufferedReader(new InputStreamReader(System.in)).readLine());\n\t\tif(ans == 1)\n\t\t\tprintLowAndDiscovered(g,discovered,low);\t\n\t}", "public Graph(int V) {\r\n \t \t\r\n if (V < 0) throw new IllegalArgumentException(\"Number of vertices in a Digraph must be nonnegative\");\r\n this.V = V;\r\n this.E = 0;\r\n this.indegree = new int[V];\r\n adj = (Bag<Edge>[]) new Bag[V];\r\n for (int v = 0; v < V; v++)\r\n adj[v] = new Bag<Edge>();\r\n }", "public List<List<Integer>> createGraph(int n) {\r\n List<List<Integer>> graph = new ArrayList<>(n);\r\n for (int i = 0; i < n; i++) graph.add(new ArrayList<>());\r\n return graph;\r\n }", "@Override protected void onPreExecute() { g = new UndirectedGraph(10); }", "public Graph() {\n\t\tthis(new PApplet());\n\t}", "public Node(Integer number){\n this.number = number;\n this.edges = new ArrayList<Edge>();\n }", "public void showGraphInSwingWindow() {\n GraphModel model = new DefaultGraphModel();\n JGraph graph = new JGraph(model);\n // Control-drag should clone selection\n graph.setCloneable(true);\n\n // Enable edit without final RETURN keystroke\n graph.setInvokesStopCellEditing(true);\n\n // When over a cell, jump to its default port (we only have one, anyway)\n graph.setJumpToDefaultPort(true);\n\n // Insert all three cells in one call, so we need an array to store them\n List<DefaultGraphCell> cellsList = new ArrayList<DefaultGraphCell>();\n Map<String, Integer> conformityMap = new HashMap<String, Integer>();\n\n\n // Create vertex\n int vertexNumber = 0;\n for (String loopVertex : undirectedGraph.keySet()) {\n cellsList.add(createVertex(loopVertex, 40 * (vertexNumber + 1) + 20 * ((vertexNumber + 1) % 2),\n 20 * (vertexNumber + 2) + 50 * ((vertexNumber + 1) % 2), 80, 20, null, false));\n conformityMap.put(loopVertex, vertexNumber);\n vertexNumber++;\n }\n\n int firstVertexNumber;\n int secondVertexNumber;\n for (String loopVertex : undirectedGraph.keySet()) {\n\n firstVertexNumber = conformityMap.get(loopVertex);\n for (String loopCorrespondingVertex : undirectedGraph.get(loopVertex)) {\n secondVertexNumber = conformityMap.get(loopCorrespondingVertex);\n if (secondVertexNumber <= firstVertexNumber) {\n continue;\n }\n // Create Edge\n DefaultEdge edge = new DefaultEdge();\n // Fetch the ports from the new vertices, and connect them with the edge\n edge.setSource(cellsList.get(firstVertexNumber).getChildAt(0));\n edge.setTarget(cellsList.get(secondVertexNumber).getChildAt(0));\n cellsList.add(edge);\n int arrow = GraphConstants.ARROW_SIMPLE;\n GraphConstants.setLineEnd(edge.getAttributes(), arrow);\n GraphConstants.setEndFill(edge.getAttributes(), true);\n }\n }\n\n\n // Set Arrow Style for edge\n// int arrow = GraphConstants.ARROW_NONE;\n// GraphConstants.setLineEnd(edge.getAttributes(), arrow);\n// GraphConstants.setEndFill(edge.getAttributes(), true);\n\n // Insert the cells via the cache, so they get selected\n\n DefaultGraphCell[] cells = new DefaultGraphCell[cellsList.size()];\n for (int i = 0; i < cellsList.size(); i++) {\n cells[i] = cellsList.get(i);\n }\n graph.getGraphLayoutCache().insert(cells);\n\n // Show in Frame\n JFrame frame = new JFrame();\n frame.getContentPane().add(new JScrollPane(graph));\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.pack();\n frame.setVisible(true);\n }", "public static void main(String[] args) {\n\t\tGraph g = new Graph(5, false);\r\n\t\tg.addConnection(1, 2, 15);\r\n\t\tg.addConnection(1, 3, 5);\r\n\t\tg.addConnection(1, 4, 1);\r\n\t\t\r\n\t\tg.addConnection(2, 3, 5);\r\n\t\t//g.addConnection(2, 5, 1);\r\n\t\t\r\n\t\t//g.addConnection(4, 5, 1);\r\n\r\n\t\tSystem.out.println(g);\r\n\t\tg.dijkstra(1);\r\n\t\tg.prim(1);\r\n\t\t\r\n\t}", "public static List<List<Integer>> createGraph(int n) {\n List<List<Integer>> graph = new ArrayList<>();\n for (int i = 0; i < n; i++) graph.add(new ArrayList<>());\n return graph;\n }", "void visualizeGraph(double input, double dvallog) {\n synchronized (this) {\n graph.beginDraw();\n graph.stroke(50);\n graph.strokeWeight(2);\n graph.clear();\n float py = graph.height;\n for (int a = 1; a < graph.width; a++) {\n double db = graphSize * ((double)a / graph.width - 1) / 20;\n float cy = -graph.height * 20 * (float)getOutput(db, db) / graphSize;\n graph.line(a - 1, py, a, cy);\n py = cy;\n }\n graph.noFill();\n //if (sideChain != null) {\n graph.ellipse(graph.width * Math.min(1, 20 * (float)dvallog / graphSize + 1), -graph.height * 20 * (float)getOutput(dvallog, dvallog) / graphSize, 10, 10);\n //graph.ellipse(graph.width * Math.min(1, 20 * (float)Math.log10(input) / graphSize + 1), -graph.height * 20 * (float)Math.log10(getRMS(bufOut)) / graphSize, 10, 10);\n graph.endDraw();\n }\n }", "public Graph(int numberOfVertices){\r\n this.numberOfVertices = numberOfVertices;\r\n this.adjacencyList = new TreeMap<>();\r\n }", "public Graph(int size) {\n\t\tmatrix = new int[size][size];\n\t\tthis.size = size;\n\n\t\tfor(int i = 0; i < size; i++) {\n\t\t\tfor(int j = 0; j < size; j++) {\n\t\t\t\tmatrix[i][j] = 0;\n\t\t\t}\n\t\t}\n\n\t\t// make space for the values (and ignore the cast warning)\n\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tType[] values = (Type[]) new Object[size];\n\t\tthis.values = values;\n\t}", "static Graph readGraph(Scanner in) {\n String s;\n s = in.next();\n if (s.charAt(0) == '#') {\n s = in.nextLine();\n\n }\n int n = in.nextInt(); // number of vertices in the graph\n int m = in.nextInt(); // number of edges in the graph\n\n // create a graph instance\n Graph g = new Graph(n);\n\n\n for (int i = 1; i <= n; i++) {\n g.V[i].duration = in.nextInt();\n }\n\n for (int i = 0; i < m; i++) // Loop to read all the edges\n {\n int u = in.nextInt();\n int v = in.nextInt();\n\n g.addEdge(u, v);\n }\n in.close();\n return g;\n }", "public void drawEdges(IEdgeDrawerGraph graph);", "public void setGraph(Graph<V,E> graph);", "public void generateGraph() {\n\t\tMap<Integer, MovingFObject> map = sc.getInitPos();\r\n\t\tgraph = new boolean[map.size()][map.size()];\r\n\t\tfor(int i = 0; i < map.size(); i++) {\r\n\t\t\tMovingFObject cloned = map.get(i).duplicate();\r\n\t\t\tArrayList<Location> locs = sc.traceLinearMotion(i,sc.getMaxVelocity(),cloned.getGoal());\r\n\t\t\tfor(int j = 0; j < map.size(); j++) {\r\n\t\t\t\tif(j != i) {\r\n\t\t\t\t\tfor(int k = 0; k < locs.size(); k++) {\r\n\t\t\t\t\t\tcloned.setLocation(locs.get(k));\r\n\t\t\t\t\t\tif(cloned.locationTouchingLocation(1, map.get(j), 2)) {\r\n\t\t\t\t\t\t\tgraph[i][j] = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(cloned.locationTouchingLocation(1, map.get(j), 0)) {\r\n\t\t\t\t\t\t\tgraph[j][i] = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public Graph(int V) {\n if (V < 0) throw new RuntimeException(\"Number of vertices must be nonnegative\");\n this.V = V;\n this.E = 0;\n\n\n adj = (LinkedList<Edge>[])new LinkedList[V];\n for (int v = 0; v < V; v++) adj[v] = new LinkedList<Edge>();\n }", "public void drawGraph(){\n this.post(new Runnable(){\n @Override\n public void run(){\n removeAllSeries();\n addSeries(xySeries);\n addSeries(currentPoint);\n //addSeries(currentPoint);\n }\n });\n }", "public Graph(Node... nodes)\r\n\t{\r\n\t\tedges = new ArrayList<>();\r\n\r\n\t\tfor (int i = 0; i < nodes.length - 1; i += 2)\r\n\t\t{\r\n\t\t\tedges.add(new Node[]\r\n\t\t\t{\r\n\t\t\t\tnodes[i], nodes[i + 1]\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (nodes.length % 2 == 1)\r\n\t\t{\r\n\t\t\tedges.add(new Node[]\r\n\t\t\t{\r\n\t\t\t\tnodes[nodes.length - 1]\r\n\t\t\t});\r\n\t\t}\r\n\t}", "public ImageGraph(BufferedImage[] originalArray) {\n\n this.originalArray = originalArray; // the original one dimensional array of pics\n int size = this.originalArray.length; // size of the graph\n\n // transfer this into a two dimensional array that stores Nodes\n Node[][] twoDimensional = new Node[size][size];\n for (int i=0; i<this.originalArray.length; i++) {\n twoDimensional[i / size][i % size] = new Node(this.originalArray[i]);\n }\n this.reference = twoDimensional[0][0]; // set up the reference\n\n int dimension = (int) Math.sqrt(size);\n\n for (int r=0; r<twoDimensional.length; r++) {\n for (int c=0; c<twoDimensional[0].length; c++) {\n // exceptional cases\n if (r==0 && c==0) {\n /*\n 1 0 0\n 0 0 0\n 0 0 0\n */\n twoDimensional[r][c].setRight(twoDimensional[r][c+1]);\n twoDimensional[r][c].setDown(twoDimensional[r+1][c]);\n } else if (r == 0 && c == dimension) {\n /*\n 0 0 1\n 0 0 0\n 0 0 0\n */\n twoDimensional[r][c].setLeft(twoDimensional[r][c-1]);\n twoDimensional[r][c].setDown(twoDimensional[r+1][c]);\n } else if (r == dimension && c == 0) {\n /*\n 0 0 0\n 0 0 0\n 1 0 0\n */\n twoDimensional[r][c].setUpper(twoDimensional[r-1][c]);\n twoDimensional[r][c].setRight(twoDimensional[r][c+1]);\n } else if (r == dimension && c == dimension) {\n /*\n 0 0 0\n 0 0 0\n 0 0 1\n */\n twoDimensional[r][c].setUpper(twoDimensional[r-1][c]);\n twoDimensional[r][c].setLeft(twoDimensional[r][c-1]);\n } else if (r != dimension && r != 0 && c == 0) {\n /*\n 0 0 0 0\n 1 0 0 0\n 1 0 0 0\n 0 0 0 0\n */\n twoDimensional[r][c].setUpper(twoDimensional[r-1][c]);\n twoDimensional[r][c].setRight(twoDimensional[r][c+1]);\n twoDimensional[r][c].setDown(twoDimensional[r-1][c]);\n } else if (r != dimension && r != 0 && c == dimension) {\n /*\n 0 0 0 0\n 0 0 0 1\n 0 0 0 1\n 0 0 0 0\n */\n twoDimensional[r][c].setUpper(twoDimensional[r-1][c]);\n twoDimensional[r][c].setDown(twoDimensional[r-1][c]);\n twoDimensional[r][c].setLeft(twoDimensional[r][c-1]);\n } else if (r == 0 && c != 0 && c!= dimension) {\n /*\n 0 1 1 0\n 0 0 0 0\n 0 0 0 0\n 0 0 0 0\n */\n twoDimensional[r][c].setLeft(twoDimensional[r][c-1]);\n twoDimensional[r][c].setRight(twoDimensional[r][c+1]);\n twoDimensional[r][c].setDown(twoDimensional[r+1][c]);\n } else if (r == dimension && c != 0 && c != dimension ) {\n /*\n 0 0 0 0\n 0 0 0 0\n 0 0 0 0\n 0 1 1 0\n */\n twoDimensional[r][c].setLeft(twoDimensional[r][c-1]);\n twoDimensional[r][c].setRight(twoDimensional[r][c+1]);\n twoDimensional[r][c].setUpper(twoDimensional[r-1][c]);\n }\n // in general\n twoDimensional[r][c].setDown(twoDimensional[r+1][c]);\n twoDimensional[r][c].setUpper(twoDimensional[r-1][c]);\n twoDimensional[r][c].setLeft(twoDimensional[r][c-1]);\n twoDimensional[r][c].setRight(twoDimensional[r][c+1]);\n }\n }\n\n // initialization of node array\n for (int i=0; i<twoDimensional.length; i++) {\n for (int j=0; j<twoDimensional[0].length; j++) {\n this.nodeArray[i*dimension+j] = twoDimensional[i][j];\n }\n }\n\n }", "public Graph() // constructor\n{\n vertexList = new Vertex[MAX_VERTS];\n // adjacency matrix\n adjMat = new int[MAX_VERTS][MAX_VERTS];\n nVerts = 0;\n for (int j = 0; j < MAX_VERTS; j++) // set adjacency\n for (int k = 0; k < MAX_VERTS; k++) // matrix to 0\n adjMat[j][k] = INFINITY;\n}", "Graph(){\n\t\tadjlist = new HashMap<String, Vertex>();\n\t\tvertices = 0;\n\t\tedges = 0;\n\t\tkeys = new ArrayList<String>();\n\t}", "public GraphNode buildGraph()\n {\n GraphNode node1 = new GraphNode(1);\n GraphNode node2 = new GraphNode(2);\n GraphNode node3 = new GraphNode(3);\n GraphNode node4 = new GraphNode(4);\n List<GraphNode> v = new ArrayList<GraphNode>();\n v.add(node2);\n v.add(node4);\n node1.neighbours = v;\n v = new ArrayList<GraphNode>();\n v.add(node1);\n v.add(node3);\n node2.neighbours = v;\n v = new ArrayList<GraphNode>();\n v.add(node2);\n v.add(node4);\n node3.neighbours = v;\n v = new ArrayList<GraphNode>();\n v.add(node3);\n v.add(node1);\n node4.neighbours = v;\n return node1;\n }", "Graph() {\r\n\t\tvertices = new LinkedList<Vertex>();\r\n\t\tedges = 0;\r\n\r\n\t\tfor (int i = 0; i < 26; i++) {\r\n\t\t\t// ASCII value of 'A' is 65\r\n\t\t\tVertex vertex = new Vertex((char) (i + 65));\r\n\t\t\tvertices.add(vertex);\r\n\t\t}\r\n\t\tcurrentVertex = vertices.get(0);\r\n\t\tseen = new boolean[26];\r\n\t}", "private void getGraph (ActionEvent evt) {\n\t\t\t//TODO\n\t}", "@FXML\n public void setGraph(){\n /*\n series.getData().clear();\n for(double x = -400; x <= 400; x += 1)\n series.getData().add(new XYChart.Data<Number,Number> (x, x));\n\n graph.getData().add(series);\n */\n System.out.println(\"vjksdl\");\n }", "public CycleGraph(int n) {\n for (int i = 1; i < n; i++) {\n super.addEdge(i-1, i);\n }\n if (n > 1) {\n super.addEdge(n - 1, 0);\n } else {\n super.addVertex(0);\n }\n }", "public void updateGraph(){\n int cont=contador;\n eliminar(0);\n construir(cont);\n }", "public ListGraph(int numV, boolean directed) {\r\n super(numV, directed);\r\n edges = new List[numV];\r\n for (int i = 0; i < numV; i++) {\r\n edges[i] = new LinkedList < Edge > ();\r\n }\r\n }", "void makeSampleGraph() {\n\t\tg.addVertex(\"a\");\n\t\tg.addVertex(\"b\");\n\t\tg.addVertex(\"c\");\n\t\tg.addVertex(\"d\");\n\t\tg.addVertex(\"e\");\n\t\tg.addVertex(\"f\");\n\t\tg.addVertex(\"g\");\n\t\tg.addEdge(\"a\", \"b\");\n\t\tg.addEdge(\"b\", \"c\");\n\t\tg.addEdge(\"b\", \"f\");\n\t\tg.addEdge(\"c\", \"d\");\n\t\tg.addEdge(\"d\", \"e\");\n\t\tg.addEdge(\"e\", \"f\");\n\t\tg.addEdge(\"e\", \"g\");\n\t}", "public Graph()\r\n {\r\n this( \"x\", \"y\" );\r\n }", "public Graph() {\r\n\t\tinit();\r\n\t}", "public static void main(String args[])\n{\n\t// Create a graph\n\tGraph newGraph = new Graph(5);\n\t\n\t// Add each of the edges\n\tnewGraph.addEdge(0, 1);\n\tnewGraph.addEdge(0, 2);\n\tnewGraph.addEdge(1, 2);\n\tnewGraph.addEdge(2, 0);\n\tnewGraph.addEdge(2, 3);\n\t\n\t\n}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n \n\t\tint n=sc.nextInt();\n \n for(int i=0;i<=n;i++)\n adj.add(new ArrayList<Integer>());\n\n for(int i=1;i<n;i++){\n int a=sc.nextInt();\n int b=sc.nextInt();\n adj.get(a).add(b);\n adj.get(b).add(a);\n }\n \n maxD=-1;\n dfs(1,0);\n \n //Arrays.fill(vis,0);\n for(int i=0;i<=n;i++) vis[i]=0;\n maxD=-1;\n dfs(maxNode,0);\n \n System.out.println(maxD);\n sc.close();\n\n\t}", "String targetGraph();", "public void drawGraph()\n\t{\n\t\tMatrixStack transformStack = new MatrixStack();\n\t\ttransformStack.getTop().mul(getWorldTransform());\n\t\tdrawSelfAndChildren(transformStack);\n\t}", "public EdgeListGraph(int V) {\n\t\t// TODO Auto-generated constructor stub\n\t\tthis.V = V;\n\t\tthis.edgeList = new ArrayList<>();\n\t}", "private void drawGraphFromPoints(Graphics2D g)\n\t{\n\n\t\tdouble xAxisLength = midBoxWidth - AXIS_Y_GAP*2;\n\t\tdouble yAxisLength = midBoxHeight - AXIS_X_GAP*2;\n\t\tdouble yScale;\n\n\t\tint xLength = totalEntered[0].length - 1;\n\t\tif (xLength < 10) {\n\t\t\txLength = 10;\n\t\t}\n\t\tdouble xGap = xAxisLength/xLength;\n\t\tdouble yGap = yAxisLength/10;\n\n\t\tyScale = statsCollector.getYScale(graph);\n\n\t\tswitch (graph) {\n\t\tcase ARRIVAL: {\n\t\t\tfor (int j = 0; j < 4; j++) {\n\t\t\t\tfor (int i = 1; i < totalEntered[j].length; i++) {\n\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\tconnectPoints(g, (i-1)*xGap, (totalEntered[j][i-1]/yScale)*yGap, i*xGap, (totalEntered[j][i]/yScale)*yGap, j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase MAX_QUEUE_TIME: {\n\t\t\tfor (int j = 0; j < 4; j++) {\n\t\t\t\tfor (int i = 0; i < maxWait[j].length; i++) {\n\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\tconnectPoints(g, (i-1)*xGap, (maxWait[j][i-1]/yScale)*yGap, i*xGap, (maxWait[j][i]/yScale)*yGap, j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase AVG_QUEUE_TIME: {\n\t\t\tfor (int j = 0; j < 4; j++) {\n\t\t\t\tfor (int i = 0; i < maxWait[j].length; i++) {\n\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\tconnectPoints(g, (i-1)*xGap, (averageWait[j][i-1]/yScale)*yGap, i*xGap, (averageWait[j][i]/yScale)*yGap, j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase TOTAL_TIME: {\n\t\t\tfor (int j = 0; j < 4; j++) {\n\t\t\t\tfor (int i = 0; i < timeAlive[j].length; i++) {\n\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\tconnectPoints(g, (i-1)*xGap, (timeAlive[j][i-1]/yScale)*yGap, i*xGap, (timeAlive[j][i]/yScale)*yGap, j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t}\n\t}", "private void addLinkesToGraph()\n\t{\n\t\tString from,to;\n\t\tshort sourcePort,destPort;\n\t\tMap<Long, Set<Link>> mapswitch= linkDiscover.getSwitchLinks();\n\n\t\tfor(Long switchId:mapswitch.keySet())\n\t\t{\n\t\t\tfor(Link l: mapswitch.get(switchId))\n\t\t\t{\n\t\t\t\tfrom = Long.toString(l.getSrc());\n\t\t\t\tto = Long.toString(l.getDst());\n\t\t\t\tsourcePort = l.getSrcPort();\n\t\t\t\tdestPort = l.getDstPort();\n\t\t\t\tm_graph.addEdge(from, to, Capacity ,sourcePort,destPort);\n\t\t\t} \n\t\t}\n\t\tSystem.out.println(m_graph);\n\t}", "public Graph() {\r\n\t\tnodePos = new HashMap<Integer, Vec2D>();\r\n\t\tconnectionLists = new HashMap<Integer, List<Connection>>();\r\n\t\t//screenWidth = Config.SCREEN_WIDTH;\r\n\t}", "NetworkGraph(int Vertex) {\n this.Vertex = Vertex;\n\n // Size == # of Vertices\n myNetwork = new LinkedList[Vertex];\n\n // Create a new list for each vertex\n // such that adjacent nodes can be stored\n for (int i = 0; i < Vertex; i++) {\n myNetwork[i] = new LinkedList<>();\n }\n }", "ConnectingGraphIII(int x) {\n father = new int[x + 1];\n totalcount = x; //initial state, total number of graph = x nodes.\n //init\n for (int i = 1; i < x + 1; i++) {\n father[i] = i;\n }\n }", "GraphLayout createGraphLayout();", "public GraphEdge()\r\n {\r\n cost = 1.0;\r\n indexFrom = -1;\r\n indexTo = -1;\r\n }", "public Graph()\r\n\t{\r\n\t\tthis.adjacencyMap = new HashMap<String, HashMap<String,Integer>>();\r\n\t\tthis.dataMap = new HashMap<String,E>();\r\n\t}", "public static void main(String[] args) {\n int n = 2100; //input the number of nodes\n int max = 10000;\n int graph[][] = Dijkstra2DArray(n);\n /*int graph[][]=new int[n][n];\n for(int i=0;i<n;i++) //test for the graph-2\n graph[i][i]=0;\n graph[0][1]=6;graph[1][0]=6;\n graph[0][2]=7;graph[2][0]=7;\n graph[0][3]=2;graph[3][0]=2;\n graph[0][4]=1;graph[4][0]=1;\n graph[1][2]=2;graph[2][1]=2;\n graph[1][3]=3;graph[3][1]=3;\n graph[1][4]=3;graph[4][1]=3;\n graph[2][3]=2;graph[3][2]=2;\n graph[2][4]=4;graph[4][2]=4;\n graph[3][4]=1;graph[4][3]=1;*/\n /*for(int i=0;i<n;i++) //test for the graph-1\n graph[i][i]=0;\n graph[0][1]=2;graph[1][0]=2;\n graph[0][2]=4;graph[2][0]=4;\n graph[0][3]=max;graph[3][0]=max;\n graph[0][4]=max;graph[4][0]=max;\n graph[0][5]=max;graph[5][0]=max;\n graph[0][6]=max;graph[6][0]=max;\n graph[0][7]=max;graph[7][0]=max;\n graph[1][2]=3;graph[2][1]=3;\n graph[1][3]=9;graph[3][1]=9;\n graph[1][4]=max;graph[4][1]=max;\n graph[1][5]=max;graph[5][1]=max;\n graph[1][6]=4;graph[6][1]=4;\n graph[1][7]=2;graph[7][1]=2;\n graph[2][3]=1;graph[3][2]=1;\n graph[2][4]=3;graph[4][2]=3;\n graph[2][5]=max;graph[5][2]=max;\n graph[2][6]=max;graph[6][2]=max;\n graph[2][7]=max;graph[7][2]=max;\n graph[3][4]=3;graph[4][3]=3;\n graph[3][5]=3;graph[5][3]=3;\n graph[3][6]=1;graph[6][3]=1;\n graph[3][7]=max;graph[7][3]=max;\n graph[4][5]=2;graph[5][4]=2;\n graph[4][6]=max;graph[6][4]=max;\n graph[4][7]=max;graph[7][4]=max;\n graph[5][6]=6;graph[6][5]=6;\n graph[5][7]=max;graph[7][5]=max;\n graph[6][7]=14;graph[7][6]=14;*/\n \n int result[][] = new int[n][n];\n int i, j, k, l, min, mark;\n boolean status[] = new boolean[n];\n long startTime = System.currentTimeMillis();\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n result[i][j] = graph[i][j];\n status[j] = false;\n }\n result[i][i] = 0;\n status[i] = true;\n for (k = 1; k < n; k++) {\n min = max;\n mark = i;\n for (l = 0; l < n; l++) {\n if ((!status[l]) && result[i][l] < min) {\n mark = l;\n min = result[i][l];\n }\n }\n status[mark] = true;\n for (l = 0; l < n; l++) {\n if ((!status[l]) && graph[mark][l] < max) {\n if (result[i][mark] + graph[mark][l] < result[i][l]) {\n result[i][l] = result[i][mark] + graph[mark][l];\n }\n }\n }\n }\n }\n long endTime = System.currentTimeMillis();\n System.out.println(\"Runtime:\" + (endTime - startTime) + \"ms\"); //test the runtime of this algorithm\n System.out.println(\"Result: \");\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n System.out.print(result[i][j] + \" \");\n }\n System.out.print(\"\\n\");\n }\n Problem2 p = new Problem2();\n System.out.println( p.BiDijkstra(graph, 0, 10));\n }", "public void displayGraph() {\r\n\t\tgraph.display();\r\n\t}", "Graph(List<Edge> edges) {\n\n //one pass to find all vertices\n // this step avoid add isolated coordinates to the graph\n for (Edge e : edges) {\n if (!graph.containsKey(e.startNode)) {\n graph.put(e.startNode, new Node(e.startNode));\n }\n if (!graph.containsKey(e.endNode)) {\n graph.put(e.endNode, new Node(e.endNode));\n }\n }\n\n //another pass to set neighbouring vertices\n for (Edge e : edges) {\n graph.get(e.startNode).neighbours.put(graph.get(e.endNode), e.weight);\n //graph.get(e.v2).neighbours.put(graph.get(e.v1), e.dist); // also do this for an undirected graph\n }\n }", "public DSAGraph()\n\t{\n\t\tvertices = new DSALinkedList();\n\t\tedgeCount = 0;\n\t}", "public GraphView() {\r\n graphModel = new GraphModel();\r\n graphModel.setNoOfChannels(0);\r\n graphModel.setXLength(1);\r\n initializeGraph();\r\n add(chartPanel);\r\n setVisible(true);\r\n }", "public int getEdgeCount() \n {\n return 3;\n }", "public Graph(int size){\n this.size=size;\n Matrix=new boolean[size][size];\n color=new int[size];\n }", "public DirectedGraph(int n){\n\t\tdGraph = new SLLSparseM(n,n); //sparse M for outnodes\n\t\tdGraphin = new SLLSparseM(n,n);//Sparse M for in nodes\n\t\tnumofvert = n;\n\t\toutdegree = new int [n];//array to count out degrees\n\t\tindegree = new int [n];//array to count in degrees\n\t\tArrays.fill(outdegree,0);\n\t\tArrays.fill(indegree, 0);\n\t}", "public void addVertex (){\t\t \n\t\tthis.graph.insert( new MyList<Integer>() );\n\t}", "public Graph(int n) {\n if (n <= 0) {\n throw new IllegalArgumentException(\"There must be at least 1 node in the graph\");\n }\n nodes = new MyArrayList<>(n);\n // adds nodes 1-n *in indices 0-(n-1)*\n for (int i = 0; i < n; i++) {\n nodes.add(new Node(i + 1));\n }\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate DirectedGraph getGraph() {\n\n\t\tNode node1, node2, node3, node4, node5;\n\t\tEdge edge1, edge2, edge3, edge4;\n\n\t\tNodeList nodes = new NodeList();\n\t\tEdgeList edges = new EdgeList();\n\n\t\t// create Node\n\t\tnode1 = new Node(\"Node1\");\n\t\tnodes.add(node1);\n\t\tnode2 = new Node(\"Node2\");\n\t\tnodes.add(node2);\n\t\tnode3 = new Node(\"Node3\");\n\t\tnodes.add(node3);\n\t\tnode4 = new Node(\"Node4\");\n\t\tnodes.add(node4);\n\t\tnode5 = new Node(\"Node5\");\n\t\tnodes.add(node5);\n\n\t\t// create Edge\n\t\tedge1 = new Edge(node1, node2);\n\t\tedges.add(edge1);\n\t\tedge2 = new Edge(node1, node3);\n\t\tedges.add(edge2);\n\t\tedge3 = new Edge(node2, node4);\n\t\tedges.add(edge3);\n\t\tedge4 = new Edge(node4, node5);\n\t\tedges.add(edge4);\n\n\t\tDirectedGraph graph = new DirectedGraph();\n\t\tgraph.nodes = nodes;\n\t\tgraph.edges = edges;\n\n\t\t// set Layout of the graph (Compute and Set the x,y of each Node)\n\t\tnew DirectedGraphLayout().visit(graph);\n\n\t\treturn graph;\n\t}", "public static void graph(){\n\t\t double[][] valuepairs = new double[2][];\n\t\t valuepairs[0] = mutTotal; //x values\n\t\t valuepairs[1] = frequency; //y values\n\t\t DefaultXYDataset set = new DefaultXYDataset();\n\t\t set.addSeries(\"Occurances\",valuepairs); \n\t\t XYBarDataset barset = new XYBarDataset(set, .8);\n\t\t JFreeChart chart = ChartFactory.createXYBarChart(\n\t\t \"Mutation Analysis\",\"Number of Mutations\",false,\"Frequency\",\n\t\t barset,PlotOrientation.VERTICAL,true, true, false);\n\t\t JFrame frame = new JFrame(\"Mutation Analysis\");\n\t\t frame.setContentPane(new ChartPanel(chart));\n\t\t frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t frame.pack();\n\t\t frame.setVisible(true);\n\t\t }" ]
[ "0.7336581", "0.7333114", "0.69780195", "0.6922994", "0.6810699", "0.67952925", "0.67088103", "0.6617793", "0.65478635", "0.6517651", "0.6411857", "0.6409773", "0.6404483", "0.6321491", "0.6290659", "0.6274279", "0.62680465", "0.62374824", "0.62269634", "0.61501545", "0.6137715", "0.61375946", "0.6134849", "0.61270595", "0.61249125", "0.60880136", "0.6083569", "0.6064562", "0.60565776", "0.603529", "0.6000976", "0.5996554", "0.59783334", "0.59752405", "0.59723175", "0.59691155", "0.5967715", "0.5963005", "0.59377617", "0.5935765", "0.59210956", "0.5909649", "0.5901173", "0.58956146", "0.58942753", "0.58925897", "0.58918023", "0.58911073", "0.5877211", "0.58740187", "0.5872746", "0.5865877", "0.5863634", "0.58604646", "0.5855098", "0.58516026", "0.584991", "0.5844659", "0.58401716", "0.58368266", "0.58333564", "0.5830889", "0.5822655", "0.58218896", "0.5821857", "0.5817551", "0.5813304", "0.5808658", "0.58054936", "0.5803034", "0.57970124", "0.57819843", "0.57817423", "0.5772538", "0.5772266", "0.5766082", "0.576484", "0.57644737", "0.5755725", "0.57539284", "0.5752758", "0.5750029", "0.57360816", "0.5731311", "0.57271224", "0.57270813", "0.57243764", "0.5721929", "0.5711798", "0.57057035", "0.5705463", "0.5690791", "0.5689942", "0.5686231", "0.56791127", "0.567606", "0.56698483", "0.5669283", "0.56650907", "0.5661085", "0.56541324" ]
0.0
-1
Returns the optional QueryCache.
public static QueryCache getQueryCache(Cache<?, ?> cache) { return SecurityActions.getCacheComponentRegistry(cache.getAdvancedCache()).getComponent(QueryCache.class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tprotected String getQueryCacheName() {\n\t\treturn null;\n\t}", "private static InternalCacheConfig defaultQueryCacheConfig() {\n InternalCacheConfig cacheConfig = new InternalCacheConfig();\n cacheConfig.maxIdle = Duration.ofSeconds(100);\n cacheConfig.objectCount = 10_000;\n return cacheConfig;\n }", "public interface QueryCache {\n IQ get(InputQuery inputQuery);\n\n void put(InputQuery inputQuery, IQ executableQuery);\n\n void clear();\n}", "@Override\n public CacheAPI getCacheAPI() {\n return null;\n }", "public Cache getDefaultCache() {\n return defaultCache;\n }", "@InjectableComponent\npublic interface QueryCache {\n /**\n * Retrieve the result of the last doesQueryFitFiterForm operation in the current thread.\n * for the {@link ApplicationUser} {@link com.atlassian.query.Query} pair.\n *\n * @param searcher the user who is performing the search\n * @param query the query for which to find the result for; cannot be null.\n * @return the last result of the doesQueryFitFiterForm operation for the\n * {@link ApplicationUser} {@link com.atlassian.query.Query} pair in the current thread, or null if\n * the operation has yet to be performed.\n */\n Boolean getDoesQueryFitFilterFormCache(ApplicationUser searcher, Query query);\n\n /**\n * Set the cached result of a doesQueryFitFiterForm operation on the\n * {@link ApplicationUser} {@link com.atlassian.query.Query} pair. The cache result\n * is only held for the current thread.\n *\n * @param searcher the user who is performing the search\n * @param query the query for which to store the result under; cannot be null\n * @param doesItFit the result of a doesSearchRequestFitNavigator operation for the.\n * {@link ApplicationUser} {@link com.atlassian.query.Query}\n */\n void setDoesQueryFitFilterFormCache(ApplicationUser searcher, Query query, boolean doesItFit);\n\n /**\n * Retrieve the result of the last getQueryContext operation in the current thread\n * for the {@link ApplicationUser} {@link com.atlassian.query.Query} pair.\n *\n * @param searcher the user who is performing the search\n * @param query the query for which to find the result for; cannot be null.\n * @return the last result of the getQueryContext operation for the\n * {@link ApplicationUser} {@link com.atlassian.query.Query} pair in the current thread, or null if\n * the operation has yet to be performed.\n */\n QueryContext getQueryContextCache(ApplicationUser searcher, Query query);\n\n /**\n * Set the cached result of a getQueryContext operation on the\n * {@link ApplicationUser} {@link com.atlassian.query.Query} pair. The cache result\n * is only held for the current thread.\n *\n * @param searcher the user who is performing the search\n * @param query the query for which to store the result under; cannot be null.\n * @param queryContext the queryContext result to store\n * {@link ApplicationUser} {@link com.atlassian.query.Query}\n */\n void setQueryContextCache(ApplicationUser searcher, Query query, QueryContext queryContext);\n\n /**\n * Retrieve the result of the last getSimpleQueryContext operation in the current thread\n * for the {@link ApplicationUser} {@link com.atlassian.query.Query} pair.\n *\n * @param searcher the user who is performing the search\n * @param query the query for which to find the result for; cannot be null.\n * @return the last result of the getSimpleQueryContext operation for the\n * {@link ApplicationUser} {@link com.atlassian.query.Query} pair in the current thread, or null if\n * the operation has yet to be performed.\n */\n QueryContext getSimpleQueryContextCache(ApplicationUser searcher, Query query);\n\n /**\n * Set the cached result of a getSimpleQueryContext operation on the\n * {@link ApplicationUser} {@link com.atlassian.query.Query} pair. The cache result\n * is only held for the current thread.\n *\n * @param searcher the user who is performing the search\n * @param query the query for which to store the result under; cannot be null.\n * @param queryContext the querySimpleContext result to store\n * {@link ApplicationUser} {@link com.atlassian.query.Query}\n */\n void setSimpleQueryContextCache(ApplicationUser searcher, Query query, QueryContext queryContext);\n\n /**\n * Retrieve the collection of {@link com.atlassian.jira.jql.ClauseHandler}s registered\n * for the {@link ApplicationUser} jqlClauseName pair.\n *\n * @param searcher the user who is performing the search\n * @param jqlClauseName the jQLClauseName for which to find the result for; cannot be null.\n * @return the collection of {@link com.atlassian.jira.jql.ClauseHandler}s registered\n * for the {@link ApplicationUser} jqlClauseName pair.\n */\n Collection<ClauseHandler> getClauseHandlers(ApplicationUser searcher, String jqlClauseName);\n\n /**\n * Set the cached result of a getSimpleQueryContext operation on the\n * {@link ApplicationUser} {@link com.atlassian.query.Query} pair. The cache result\n * is only held for the current thread.\n *\n * @param searcher the user who is performing the search\n * @param jqlClauseName the jQLClauseName for which to store the result under; cannot be null.\n * @param clauseHandlers the collection of {@link com.atlassian.jira.jql.ClauseHandler}s\n * {@link ApplicationUser} {@link com.atlassian.jira.jql.ClauseHandler}\n */\n void setClauseHandlers(ApplicationUser searcher, String jqlClauseName, Collection<ClauseHandler> clauseHandlers);\n\n /**\n * Retrieve the list of {@link QueryLiteral}s registered\n * for the {@link QueryCreationContext} {@link Operand} jqlClause triplet.\n *\n * @param context the query context of the search, which cannot be null.\n * @param operand the Operand which cannot be null\n * @param jqlClause the jQLClause for which to find the result for; cannot be null.\n * @return the list of {@link QueryLiteral}s registered\n * for the {@link QueryCreationContext} jqlClause pair.\n */\n List<QueryLiteral> getValues(QueryCreationContext context, Operand operand, TerminalClause jqlClause);\n\n /**\n * Set the cached result of a getValues operation on the\n * for the {@link QueryCreationContext} {@link Operand} jqlClause triplet. The cache result\n * is only held for the current thread.\n *\n * @param context the query context the search is being performed in\n * @param operand the Operand which cannot be null\n * @param jqlClause the jQLClause for which to store the result under; cannot be null.\n * @param values the collection of {@link QueryLiteral}s\n */\n void setValues(QueryCreationContext context, Operand operand, TerminalClause jqlClause, List<QueryLiteral> values);\n}", "private static Cache getCacheInstance() {\r\n\t\tif( cache == null ) {\r\n\t\t\ttry {\r\n\t\t\t\tCacheFactory cf = CacheManager.getInstance().getCacheFactory();\r\n\t\t\t\tcache = cf.createCache(Collections.emptyMap());\r\n\t\t\t} catch (CacheException e) {\r\n\t\t\t\tlog.log(Level.SEVERE, \"can not initialize cache\", e);\r\n\t\t\t\tcache = null;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn cache;\r\n\t}", "protected Cache<Request, Result> getNetspeakCache() {\n return this.netspeakCache;\n }", "public Query advancedQuery() \n {\n return null;\n }", "public boolean useCache(QueryInfo queryInfo) {\n return TextUtils.isEmpty(queryInfo.getParam(\"extraInfo\"));\n }", "public boolean getMayCache () {\n\treturn mayCache;\n }", "public static CatalogStructure getCache() {\n return CACHE.get();\n }", "public CacheStrategy getCacheStrategy();", "public static ResponseCache getDefault() {\n SecurityManager sm = System.getSecurityManager();\n if (sm != null) {\n sm.checkPermission(new NetPermission(\"getResponseCache\"));\n }\n return defaultResponseCache;\n }", "protected net.sf.ehcache.Ehcache getCache() {\n return cache;\n }", "private static boolean canCacheQuery(QueryInfo queryInfo) {\n return !queryInfo.hasAggregates()\n && !queryInfo.hasDistinct()\n && !queryInfo.hasGroupBy()\n && !queryInfo.hasLimit()\n && !queryInfo.hasTop()\n && !queryInfo.hasOffset()\n && !queryInfo.hasDCount()\n && !queryInfo.hasOrderBy();\n }", "@Produces\n\t@ApplicationScoped\n\tpublic org.infinispan.AdvancedCache<Long, String> getLocalRequestCache() {\n\t\torg.infinispan.Cache<Long,String> basicCache = getLocalCacheManager().getCache(\"client-request-cache\",true);\n\t\treturn basicCache.getAdvancedCache();\n\t}", "private Cache<String, String> getCache() {\n if (protobufSchemaCache == null) {\n throw new IllegalStateException(\"Not started yet\");\n }\n return protobufSchemaCache;\n }", "public MemoryCacheParams get() {\n return new MemoryCacheParams(m114359b(), 256, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, f81939a);\n }", "public Querytool getQuery() {\n return localQuerytool;\n }", "IQuery getQuery();", "protected Cache cache(RequestContext ctx) {\n String serviceId = serviceId(ctx);\n if (serviceId != null) {\n return cacheManager.getCache(serviceId);\n }\n return null;\n }", "CloudCache getCache(String cacheName);", "public Query getQuery()\n {\n return query;\n }", "public boolean getMayUseCache () {\n\treturn mayUseCache;\n }", "public BaseCacheBuilder getCacheBuilder() {\n return cacheBuilder;\n }", "public Query getQuery ()\n {\n\n\treturn this.q;\n\n }", "public Map<String, DataModel> getQuery() {\n if (queries == null) {\n queries = FxSharedUtils.getMappedFunction(new FxSharedUtils.ParameterMapper<String, DataModel>() {\n @Override\n public DataModel get(Object key) {\n try {\n final FxResultSet result = EJBLookup.getSearchEngine().search((String) key, 0, -1, null);\n return new FxResultSetDataModel(result);\n } catch (FxApplicationException e) {\n throw e.asRuntimeException();\n }\n }\n }, true);\n }\n return queries;\n }", "public JsonArray getCache() {\n return cache;\n }", "public Cache<ImmutableBytesPtr,PMetaDataEntity> getMetaDataCache() {\n Cache<ImmutableBytesPtr,PMetaDataEntity> result = metaDataCache;\n if (result == null) {\n synchronized(this) {\n result = metaDataCache;\n if(result == null) {\n long maxTTL = config.getLong(\n QueryServices.MAX_SERVER_METADATA_CACHE_TIME_TO_LIVE_MS_ATTRIB,\n QueryServicesOptions.DEFAULT_MAX_SERVER_METADATA_CACHE_TIME_TO_LIVE_MS);\n long maxSize = config.getLongBytes(\n QueryServices.MAX_SERVER_METADATA_CACHE_SIZE_ATTRIB,\n QueryServicesOptions.DEFAULT_MAX_SERVER_METADATA_CACHE_SIZE);\n metaDataCache = result = CacheBuilder.newBuilder()\n .maximumWeight(maxSize)\n .expireAfterAccess(maxTTL, TimeUnit.MILLISECONDS)\n .weigher(new Weigher<ImmutableBytesPtr, PMetaDataEntity>() {\n @Override\n public int weigh(ImmutableBytesPtr key, PMetaDataEntity table) {\n return SizedUtil.IMMUTABLE_BYTES_PTR_SIZE + key.getLength() + table.getEstimatedSize();\n }\n })\n .build();\n }\n }\n }\n return result;\n }", "public static Cache getStaticTheCache()\n\t{\n\t\treturn staticTheCache;\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate static void secondLevelCacheWithPropertySetWithQueryCacheDisabled() {\n\t\ttry(Session session = HbUtil.getSession()) {\n\t\t\tList<Book> list = session.createQuery(\"from Book b where b.subject=:p_subject\")\n\t\t\t\t\t\t.setParameter(\"p_subject\", \"C\")\n\t\t\t\t\t\t// .setCacheable(true)\n\t\t\t\t\t\t.getResultList();\n\t\t\tfor (Book b : list) \n\t\t\t\tSystem.out.println(b);\n\t\t}catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\ttry(Session session = HbUtil.getSession()) {\n\t\t\tList<Book> list = session.createQuery(\"from Book b where b.subject=:p_subject\")\n\t\t\t\t\t\t.setParameter(\"p_subject\", \"C\")\n\t\t\t\t\t\t// .setCacheable(true)\n\t\t\t\t\t\t.getResultList();\n\t\t\tfor (Book b : list) \n\t\t\t\tSystem.out.println(b);\n\t\t}catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public QueryWithoutCache() throws SQLException {\n super();\n }", "public boolean isUseCache() {\n return mUseCache;\n }", "public QueryInfoSearch getQueryInfoSearch() {\n if (queryInfoSearch != null) return queryInfoSearch;\n queryInfoSearch = new QueryInfoSearch();\n return queryInfoSearch;\n }", "public boolean getNoCache() {\n return noCache;\n }", "public Map<String, String> getQuery() {\n\t\treturn Collections.unmodifiableMap(query);\n\t}", "Cache<String, YourBean> getMyCache() {\n\treturn myCache;\n }", "@Override\n\tpublic Cache getCacheInstance(CacheType cacheType) {\n\t\tCache cache = null;\n\t\tif (cacheType.equals(CacheType.ConcurrentCache)) {\n\t\t\tcache = cacheManager.getCache(\"concurrentBatchScheduleCache\");\n\t\t}\n\t\tif (cacheType.equals(CacheType.HistroicalCache)) {\n\t\t\tcache = cacheManager.getCache(\"concurrentBatchScheduleCache\");\n\t\t}\n\t\treturn cache;\n\t}", "public void cacheableQuery() throws HibException;", "Optional<CachingInputs> getInputs();", "@SuppressWarnings(\"unchecked\")\n\tprivate static void secondLevelCacheWithPropertySetWithQueryCacheEnabled() {\n\t\ttry(Session session = HbUtil.getSession()) {\n\t\t\tList<Book> list = session.createQuery(\"from Book b where b.subject=:p_subject\")\n\t\t\t\t\t\t.setParameter(\"p_subject\", \"C\")\n\t\t\t\t\t\t.setCacheable(true)\n\t\t\t\t\t\t.getResultList();\n\t\t\tfor (Book b : list) \n\t\t\t\tSystem.out.println(b);\n\t\t}catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\ttry(Session session = HbUtil.getSession()) {\n\t\t\tList<Book> list = session.createQuery(\"from Book b where b.subject=:p_subject\")\n\t\t\t\t\t\t.setParameter(\"p_subject\", \"C\")\n\t\t\t\t\t\t.setCacheable(true)\n\t\t\t\t\t\t.getResultList();\n\t\t\tfor (Book b : list) \n\t\t\t\tSystem.out.println(b);\n\t\t}catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Test\n\tpublic void testQueryCaching(){\n\t\tqueryCache();\n\t\tqueryCache2();\n\t}", "public ICodeReaderCache getCodeReaderCache() {\n \t\treturn null;\n \t}", "boolean isCachingEnabled();", "@Override\n public boolean isCaching() {\n return false;\n }", "public boolean shouldCache() {\n return this.shouldCache;\n }", "protected Map<String,BaseAttribute> getAttributeCache(ShibbolethResolutionContext resolutionContext, String query) {\n if (cacheResults) {\n String principal = resolutionContext.getAttributeRequestContext().getPrincipalName();\n Map<String, Map<String, BaseAttribute>> cache = dataCache.get(principal);\n if (cache != null) {\n Map<String, BaseAttribute> attributes = cache.get(query);\n log.debug(\"Data connector {} got cached attributes for principal: {}\", getId(), principal);\n return attributes;\n }\n }\n\n return null;\n }", "@SuppressWarnings(\"WeakerAccess\")\n public static QueryOptions defaultOptions() {\n return new Builder().build();\n }", "public Map<String, String> getCache() {\n return cache;\n }", "public DatabaseQuery getQuery() {\n return query;\n }", "public PojoCache getPojoCache();", "public Map<String, Map<String, Object>> getPredicateCache()\n {\n return this.predicateCache;\n }", "boolean isCacheInitialized();", "public static RequestCountForCartBundleCache getCache()\n\t{\n\t\treturn instance;\n\t}", "boolean isCacheable();", "@Override\n\tpublic boolean isCaching() {\n\t\treturn false;\n\t}", "@Override\n\tpublic Query getQuery(JSONObject json) {\n\t\treturn null;\n\t}", "public ExprMatrix withCache();", "public T getIfPresent()\n\t{\n\t\treturn cache.getIfPresent(KEY);\n\t}", "private synchronized Optional<QueryResults> getCachedResult(long token)\n {\n if (lastResult == null) {\n return Optional.empty();\n }\n\n // is the a repeated request for the last results?\n if (token == lastToken) {\n // tell query manager we are still interested in the query\n queryManager.recordHeartbeat(queryId);\n return Optional.of(lastResult);\n }\n\n // if this is a result before the lastResult, the data is gone\n if (token < lastToken) {\n throw new WebApplicationException(Response.Status.GONE);\n }\n\n // if this is a request for a result after the end of the stream, return not found\n if (!nextToken.isPresent()) {\n throw new WebApplicationException(Response.Status.NOT_FOUND);\n }\n\n // if this is not a request for the next results, return not found\n if (token != nextToken.getAsLong()) {\n // unknown token\n throw new WebApplicationException(Response.Status.NOT_FOUND);\n }\n\n return Optional.empty();\n }", "public Cache() {\n this(null);\n }", "@Override\n\t\tpublic String getQueryString() {\n\t\t\treturn null;\n\t\t}", "public boolean isResourceCacheIgnoreQueryParams()\r\n {\r\n return getSemanticObject().getBooleanProperty(swb_resourceCacheIgnoreQueryParams);\r\n }", "@Override\n\tpublic Object getBeanCache(String name) {\n\t\treturn null;\n\t}", "public boolean isCached() {\n return true;\n }", "private QueryService getQueryService() {\n return queryService;\n }", "boolean isNoCache();", "public StackManipulation cached() {\n return new Cached(this);\n }", "public boolean hasQuery() {\n return fieldSetFlags()[8];\n }", "public QueryRequestOptions options() {\n return this.options;\n }", "protected Duration getCacheDuration() {\n return Duration.ZERO;\n }", "public static Object getCache(String key) {\n\t\treturn getCache(key, null);\n\t}", "T getQueryInfo();", "public QueryModel getQueryModel()\n {\n return _queryModel;\n }", "public String getQuery() {\n return query;\n }", "public String getQuery() {\n return query;\n }", "public String getQuery() {\n return query;\n }", "public static Query empty() {\n return new Query();\n }", "public DBMaker enableHardCache() {\n cacheType = DBCacheRef.HARD;\n return this;\n }", "protected String getRetrievalQuery()\n {\n return immutableGetRetrievalQuery();\n }", "public static Object getCache(String key) {\n return getCache(key, null);\n }", "public static Object getCache(String key) {\n return getCache(key, null);\n }", "public String getQuery() {\r\n return query;\r\n }", "public String getQuery() {\n return _query;\n }", "public Queries loadQueries() {\r\n\t\tQueries queries = null;\r\n\t try {\r\n queries = Queries.unmarshalAsQueries();\r\n\t } catch (Exception e) {\r\n\t e.printStackTrace();\r\n\t }\r\n\t return queries;\r\n\t}", "public QueryElements getQueryAccess() {\n\t\treturn pQuery;\n\t}", "public ImcacheCacheManager() {\n this(CacheBuilder.heapCache());\n }", "@Override\n protected SerializablePredicate<T> getFilter(Query<T, Void> query) {\n return Optional.ofNullable(inMemoryDataProvider.getFilter())\n .orElse(item -> true);\n }", "public String getQuery() {\r\n\t\treturn query;\r\n\t}", "protected Optional<TBaseProcessor> getInteractiveQueryProcessor() {\n return Optional.empty();\n }", "public String getQuery() {\n return query;\n }", "public List<QueryDescriptor> getSystemQueries()\n {\n List<QueryDescriptor> queries = new ArrayList<QueryDescriptor>();\n Map<String, QueryDescriptor> Queries = ((DemoQueryModel) _queryModel).getQueries();\n Iterator keys = Queries.keySet().iterator();\n while (keys != null && keys.hasNext())\n {\n Object key = keys.next();\n QueryDescriptor qd = Queries.get(key);\n Object queryType = qd.getUIHints().get(QueryDescriptor.UIHINT_IMMUTABLE);\n\n // For SystemQueries, immutable is null or true\n if (queryType == null || queryType.equals(Boolean.TRUE))\n {\n queries.add(qd);\n }\n }\n\n return queries;\n }", "public Queries queries() {\n return this.queries;\n }", "public SingleQuery getQuery() throws NoQueryFoundException\n {\n if(queries.size() > 0) {\n return new SingleQuery(queries.get(queries.size() - 1));\n }\n else {\n throw new NoQueryFoundException(\"Tried to access non-existing query - the collection is empty!\");\n }\n }", "public boolean getCacheable() {\r\n\t\treturn this.cacheable;\r\n\t}", "PortalCacheModel getCacheModel();", "public RequestQueue getRequestQueue() {\n if (requestQueue == null) { // If RequestQueue is null the initialize new RequestQueue\n requestQueue = Volley.newRequestQueue(appContext.getApplicationContext());\n }\n return requestQueue; // Return RequestQueue\n }", "@Override\n\tprotected String getCacheName() {\n\t\treturn null;\n\t}", "public final boolean isUseCache() {\n\t\treturn useCache;\n\t}" ]
[ "0.6638221", "0.6287616", "0.6102152", "0.60510445", "0.601165", "0.5950047", "0.5935736", "0.5778335", "0.5751855", "0.5709542", "0.5628802", "0.56202567", "0.55991095", "0.5594701", "0.5582303", "0.55820054", "0.55799973", "0.557114", "0.555522", "0.5553081", "0.55258054", "0.5516555", "0.5511876", "0.5501864", "0.549106", "0.5451645", "0.5443024", "0.54219085", "0.5389576", "0.53700954", "0.53699976", "0.5353284", "0.5319696", "0.5311312", "0.5306666", "0.53026885", "0.53020734", "0.5301823", "0.52794635", "0.5279437", "0.52646476", "0.5255641", "0.525371", "0.5250474", "0.524512", "0.5240783", "0.52347106", "0.5232381", "0.5224318", "0.52071154", "0.5177673", "0.5166557", "0.5164866", "0.5158711", "0.5157818", "0.51551527", "0.51525706", "0.5148174", "0.51398337", "0.5134627", "0.51249444", "0.5123302", "0.5118729", "0.51012886", "0.50940984", "0.50879633", "0.50801337", "0.50772804", "0.5059783", "0.50551146", "0.50544935", "0.5054249", "0.5021016", "0.50082415", "0.50061697", "0.500087", "0.500087", "0.500087", "0.49951518", "0.4994653", "0.49943686", "0.4993425", "0.4993425", "0.49932635", "0.49930924", "0.49916425", "0.49882558", "0.49851668", "0.49750575", "0.49633917", "0.49619848", "0.49599898", "0.49578425", "0.4957732", "0.49523574", "0.49478728", "0.49337453", "0.49323004", "0.4931397", "0.49175406" ]
0.6397892
1
TODO Autogenerated method stub
@Override public void insertAccount() throws Exception { }
{ "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 getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "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.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
metri_quadri_distrutti_del_porto = potenza_di_fuoco_invasori 2.5
public boolean portoDistrutto() { return p.getDimensioneSqMetersNonDistrutta() <= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mutacioni(Individe individi, double probabiliteti) {\n int gjasaPerNdryshim = (int) ((1 / probabiliteti) * Math.random());\r\n if (gjasaPerNdryshim == 1) {\r\n int selectVetura1 = (int) (Math.random() * individi.pikatEVeturave.length);//selekton veturen e pare\r\n int selectPikenKamioni1 = (int) (Math.random() * individi.pikatEVeturave[selectVetura1].size());//selekton piken e vetures tpare\r\n if (pikatEVeturave[selectVetura1].size() == 0) {\r\n return;\r\n }\r\n Point pika1 = individi.pikatEVeturave[selectVetura1].get(selectPikenKamioni1);//pika 1\r\n\r\n int selectVetura2 = (int) (Math.random() * individi.pikatEVeturave.length);//selekton veturen e dyte\r\n int selectPikenKamioni2 = (int) (Math.random() * individi.pikatEVeturave[selectVetura2].size());//selekton piken e vetures tdyte\r\n if (pikatEVeturave[selectVetura2].size() == 0) {\r\n return;\r\n }\r\n Point pika2 = individi.pikatEVeturave[selectVetura2].get(selectPikenKamioni2);//pika 2\r\n\r\n individi.pikatEVeturave[selectVetura2].set(selectPikenKamioni2, pika1);//i ndrron vendet ketyre dy pikave\r\n individi.pikatEVeturave[selectVetura1].set(selectPikenKamioni1, pika2);\r\n }\r\n\r\n }", "public double dlugoscOkregu() {\n\t\treturn 2 * Math.PI * promien;\n\t}", "double getPerimetro(){\n return 2 * 3.14 * raggio;\n }", "public void provocarEvolucion(Tribu tribuJugador, Tribu tribuDerrotada){\r\n System.out.println(\"\\n\");\r\n System.out.println(\"-------------------Fase de evolución ----------------------\");\r\n int indiceAtributo;\r\n int indiceAtributo2;\r\n double golpeViejo = determinarGolpe(tribuJugador);\r\n for(int i = 1; i <= 10 ; i++){\r\n System.out.println(\"Iteración número: \" + i);\r\n indiceAtributo = (int)(Math.random() * 8);\r\n indiceAtributo2 = (int)(Math.random() * 8);\r\n String nombreAtributo1 = determinarNombrePosicion(indiceAtributo);\r\n String nombreAtributo2 = determinarNombrePosicion(indiceAtributo2);\r\n if((tribuJugador.getArray()[indiceAtributo] < tribuDerrotada.getArray()[indiceAtributo] \r\n && (tribuJugador.getArray()[indiceAtributo2] < tribuDerrotada.getArray()[indiceAtributo2]))){\r\n System.out.println(\"Se cambió el atributo \" + nombreAtributo1 + \" de la tribu del jugador porque\"\r\n + \" el valor era \" + tribuJugador.getArray()[indiceAtributo] + \" y el de la tribu enemeiga era de \"\r\n + tribuDerrotada.getArray()[indiceAtributo] + \" esto permite hacer más fuerte la tribu del jugador.\");\r\n \r\n tribuJugador.getArray()[indiceAtributo] = tribuDerrotada.getArray()[indiceAtributo];\r\n \r\n System.out.println(\"Se cambió el atributo \" + nombreAtributo2 + \" de la tribu del jugador porque\"\r\n + \" el valor era \" + tribuJugador.getArray()[indiceAtributo2] + \" y el de la tribu enemeiga era de \"\r\n + tribuDerrotada.getArray()[indiceAtributo2] + \" esto permite hacer más fuerte la tribu del jugador.\");\r\n \r\n tribuJugador.getArray()[indiceAtributo2] = tribuDerrotada.getArray()[indiceAtributo2];\r\n }\r\n }\r\n double golpeNuevo = determinarGolpe(tribuJugador);\r\n if(golpeNuevo > golpeViejo){\r\n tribus.replace(tribuJugador.getNombre(), determinarGolpe(tribuJugador));\r\n System.out.println(\"\\nTribu evolucionada\");\r\n imprimirAtributos(tribuJugador);\r\n System.out.println(\"\\n\");\r\n System.out.println(tribus);\r\n }\r\n else{\r\n System.out.println(\"\\nTribu sin evolucionar\");\r\n System.out.println(\"La tribu no evolucionó porque no se encontraron atributos\"\r\n + \" que permitiesen crecer su golpe\");\r\n imprimirAtributos(tribuJugador);\r\n System.out.println(\"\\n\");\r\n System.out.println(tribus);\r\n }\r\n }", "public Coup coupIA() {\n\n int propriete = TypeCoup.CONT.getValue();\n int bloque = Bloque.NONBLOQUE.getValue();\n Term A = intArrayToList(plateau1);\n Term B = intArrayToList(plateau2);\n Term C = intArrayToList(piecesDispos);\n Variable D = new Variable(\"D\");\n Variable E = new Variable(\"E\");\n Variable F = new Variable(\"F\");\n Variable G = new Variable(\"G\");\n Variable H = new Variable(\"H\");\n org.jpl7.Integer I = new org.jpl7.Integer(co.getValue());\n q1 = new Query(\"choixCoupEtJoue\", new Term[] {A, B, C, D, E, F, G, H, I});\n\n\n if (q1.hasSolution()) {\n Map<String, Term> solution = q1.oneSolution();\n int caseJ = solution.get(\"D\").intValue();\n int pion = solution.get(\"E\").intValue();\n Term[] plateau1 = listToTermArray(solution.get(\"F\"));\n Term[] plateau2 = listToTermArray(solution.get(\"G\"));\n Term[] piecesDispos = listToTermArray(solution.get(\"H\"));\n for (int i = 0; i < 16; i++) {\n if (i < 8) {\n this.piecesDispos[i] = piecesDispos[i].intValue();\n }\n this.plateau1[i] = plateau1[i].intValue();\n this.plateau2[i] = plateau2[i].intValue();\n }\n\n int ligne = caseJ / 4;\n int colonne = caseJ % 4;\n\n if (pion == 1 || pion == 5) {\n pion = 1;\n }\n if (pion == 2 || pion == 6) {\n pion = 0;\n }\n if (pion == 3 || pion == 7) {\n pion = 2;\n }\n if (pion == 4 || pion == 8) {\n pion = 3;\n }\n\n\n Term J = intArrayToList(this.plateau1);\n q1 = new Query(\"gagne\", new Term[] {J});\n System.out.println(q1.hasSolution() ? \"Gagné\" : \"\");\n if (q1.hasSolution()) {\n propriete = 1;\n }\n return new Coup(bloque,ligne, colonne, pion, propriete);\n }\n System.out.println(\"Bloqué\");\n return new Coup(1,0, 0, 0, 3);\n }", "@Override\n public void cantidad_Punteria(){\n punteria=69.5+05*nivel+aumentoP;\n }", "public void muovi() {\n\n for (int i = punti; i > 0; i--) {\n x[i] = x[(i - 1)];\n y[i] = y[(i - 1)];\n }\n\n if (sinistra) {\n x[0] -= DIMENSIONE_PUNTO;\n }\n\n if (destra) {\n x[0] += DIMENSIONE_PUNTO;\n }\n\n if (su) {\n y[0] -= DIMENSIONE_PUNTO;\n }\n\n if (giu) {\n y[0] += DIMENSIONE_PUNTO;\n }\n }", "public static void main(String[] args) {\n\t\t\tScanner tastiera=new Scanner(System.in);\r\n\t\t\tint k=0, j=0;\r\n\t\t\tint conta=0;\r\n\t\t\tString risposta=\"\";\r\n\t\t\tRandom r=new Random();\r\n\t\t\tArrayList<Giocatore> partecipantiOrdinati=new ArrayList<Giocatore>();\r\n\t\t\tArrayList<Giocatore> partecipantiMescolati=new ArrayList<Giocatore>();\r\n\t\t\tArrayList<Giocatore> perdenti=new ArrayList<Giocatore>();\r\n\t\t\tfor(int i=0;i<GIOCATORI.length;i++) {\r\n\t\t\t\tpartecipantiOrdinati.add(new Giocatore(GIOCATORI[i]));\r\n\t\t\t}\r\n\t\t\tfor(int i=0;i<GIOCATORI.length;i++) {\r\n\t\t\t\tint indice=Math.abs(r.nextInt()%partecipantiOrdinati.size());\r\n\t\t\t\tpartecipantiMescolati.add(partecipantiOrdinati.get(indice));\r\n\t\t\t\tpartecipantiOrdinati.remove(indice);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"INIZIA IL TORNEO DI BRISCOLA!\");\r\n\t\t\twhile(partecipantiMescolati.size()!=1) {\r\n\t\t\t\tSystem.out.println(\"Fase \"+(j+1));\r\n\t\t\twhile(conta<partecipantiMescolati.size()) {\r\n\t\t\t\tMazzo m=new Mazzo();\r\n\t\t\t\tm.ordinaMazzo();\r\n\t\t\t\tm.mescolaMazzo();\r\n\t\t\t\tGiocatore g1=partecipantiMescolati.get(conta);\r\n\t\t\t\tGiocatore g2=partecipantiMescolati.get(conta+1);\r\n\t\t\t\tPartita p=new Partita(g1,g2,m);\r\n\t\t\t\tSystem.out.println(\"Inizia la partita tra \"+g1.getNickName()+\" e \"+g2.getNickName());\r\n\t\t\t\tSystem.out.println(\"La briscola è: \"+p.getBriscola().getCarta());\r\n\t\t\t\tSystem.out.println(\"Vuoi skippare la partita? \"); risposta=tastiera.next();\r\n\t\t\t\tif(risposta.equalsIgnoreCase(\"si\")) {\r\n\t\t\t\t\tg1.setPunteggio(p.skippa());\r\n\t\t\t\t\tg2.setPunteggio(PUNTI_MASSIMI-g1.getPunteggio());\r\n\t\t\t\t\tif(p.vittoria()) {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto \"+g1.getNickName());//vince g1\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g1.getPunteggio());\r\n\t\t\t\t\t\tp.aggiungiPerdente(g2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto \"+g2.getNickName());// vince g2\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g2.getPunteggio());\r\n\t\t\t\t\t\tp.aggiungiPerdente(g1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tp.daiLePrimeCarte();\r\n\t\t\t\t\tCarta c1=new Carta(g1.gioca().getCarta());\r\n\t\t\t\t\tCarta c2=new Carta(g2.gioca().getCarta());\r\n\t\t\t\t\tg1.eliminaDaMano(c1); g2.eliminaDaMano(c2);\r\n\t\t\t\t\tint tracciatore=1; //parte dal giocatore 1\r\n\t\t\t\t\twhile(!m.mazzoMescolato.isEmpty())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(c1.getCarta()+\" \"+c2.getCarta());\r\n\t\t\t\t\t\tif(p.chiPrende(c1, c2) && tracciatore==1){\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g1.getNickName());\r\n\t\t\t\t\t\t\tg1.setPunteggio(g1.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tp.pesca(g1); p.pesca(g2);\r\n\t\t\t\t\t\t\tc1=g1.gioca(); c2=g2.gioca();\r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(p.chiPrende(c2, c1)) {\r\n\t\t\t\t\t\t\ttracciatore=2;\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g2.getNickName());\r\n\t\t\t\t\t\t\tg2.setPunteggio(g2.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tp.pesca(g2); p.pesca(g1);\r\n\t\t\t\t\t\t\tc2=g2.gioca(); c1=g1.gioca();\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2); \r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{tracciatore = 1; k--;}\r\n\t\t\t\t\t\tSystem.out.println(g1.getPunteggio()+\" \"+g2.getPunteggio());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tSystem.out.println(\"Manche Finale\");\r\n\t\t\t\t\twhile(!g1.carteInMano.isEmpty() || !g2.carteInMano.isEmpty()) {\r\n\t\t\t\t\t\tSystem.out.println(c1.getCarta()+\" \"+c2.getCarta());\r\n\t\t\t\t\t\tif(p.chiPrende(c1, c2) && tracciatore==1){\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g1.getNickName());\r\n\t\t\t\t\t\t\tg1.setPunteggio(g1.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tc1=g1.gioca(); c2=g2.gioca();\r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(p.chiPrende(c2, c1)) {\r\n\t\t\t\t\t\t\ttracciatore=2;\r\n\t\t\t\t\t\t\tSystem.out.println(\"Prende \"+g2.getNickName());\r\n\t\t\t\t\t\t\tg2.setPunteggio(g2.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t\t\tc2=g2.gioca(); c1=g1.gioca();\r\n\t\t\t\t\t\t\tg2.eliminaDaMano(c2);\r\n\t\t\t\t\t\t\tg1.eliminaDaMano(c1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\ttracciatore = 1;\r\n\t\t\t\t\t\tSystem.out.println(g1.getPunteggio()+\" \"+g2.getPunteggio());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(p.chiPrende(c1, c2) && tracciatore==1) {\r\n\t\t\t\t\t\tSystem.out.println(\"Prende \"+g1.getNickName());\r\n\t\t\t\t\t\tg1.setPunteggio(g1.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSystem.out.println(\"Prende \"+g2.getNickName());\r\n\t\t\t\t\t\tg2.setPunteggio(g2.aumentaPunteggio(c1.valoreCarta()+c2.valoreCarta()));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tSystem.out.println(\"Situazione: \"+g1.getNickName()+\": \"+g1.getPunteggio());\r\n\t\t\t\t\tSystem.out.println(g2.getNickName()+\": \"+g2.getPunteggio());\r\n\t\t\t\t\tif(p.vittoria()) {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto il giocatore \"+g1.getNickName());\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g1.getPunteggio());\r\n\t\t\t\t\t\tperdenti.add(g2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tSystem.out.println(\"Ha vinto il giocatore \"+g2.getNickName());\r\n\t\t\t\t\t\tSystem.out.println(\"Con un punteggio di \"+g2.getPunteggio());\r\n\t\t\t\t\t\tperdenti.add(g1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tconta+=2;\r\n\t\t\t\tSystem.out.println(\"Premi una lettera per continuare: \"); risposta=tastiera.next();\r\n\t\t\t}\r\n\t\t\tj++;\r\n\t\t\tconta=0;\r\n\t\t\tfor(int i=0;i<perdenti.size();i++)\r\n\t\t\t\tpartecipantiMescolati.remove(perdenti.get(i));\r\n\t\t\tSystem.out.println(\"Restano i seguenti partecipanti: \");\r\n\t\t\tfor(int i=0;i<partecipantiMescolati.size();i++) {\r\n\t\t\t\tSystem.out.println(partecipantiMescolati.get(i).getNickName());\r\n\t\t\t\tpartecipantiMescolati.get(i).setPunteggio(0);\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Il vincitore del torneo è: \"+partecipantiMescolati.get(0).getNickName());\r\n\t\t\t\t\r\n\t}", "public void creaAziendaAgricola(){\n\t\tCantina nipozzano = creaCantina(\"Nipozzano\");\t\n\t\tBotte[] bottiNipozzano = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiNipozzano.length; i++){\n\t\t\tbottiNipozzano[i] = creaBotte(nipozzano, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\t\t\n\t\tVigna mormoreto = creaVigna(\"Mormoreto\", 330, 25, EsposizioneVigna.sud, \"Terreni ricchi di sabbia, ben drenati. Discreta presenza di calcio. pH neutro o leggermente alcalino\");\n\t\tFilare[] filariMormoreto = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMormoreto.length;i++){\n\t\t\tfilariMormoreto[i] = creaFilare(mormoreto, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\t\n\t\tVigna montesodi = creaVigna(\"Montesodi\", 400, 20, EsposizioneVigna.sud_ovest, \"Arido e sassoso, di alberese, argilloso e calcareo, ben drenato, poco ricco di sostanza organica\");\n\t\tFilare[] filariMontesodi = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMontesodi.length;i++){\n\t\t\tfilariMontesodi[i] = creaFilare(montesodi, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t/*\n\t\t * CANTINA: POMINO - VIGNETO BENEFIZIO\n\t\t */\n\t\t\n\t\tCantina pomino = creaCantina(\"Pomino\");\n\t\tBotte[] bottiPomino = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiPomino.length; i++){\n\t\t\tbottiPomino[i] = creaBotte(pomino, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\n\t\tVigna benefizio = creaVigna(\"Benefizio\", 700, 9, EsposizioneVigna.sud_ovest, \"Terreni ricchi di sabbia, forte presenza di scheletro. Molto drenanti. Ricchi in elementi minerali. PH acido o leggermente acido.\");\n\t\tFilare[] filariBenefizio = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariBenefizio.length;i++){\n\t\t\tfilariBenefizio[i] = creaFilare(benefizio, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(nipozzano);\n\t\taziendaAgricolaDAO.saveLuogo(mormoreto);\n\t\taziendaAgricolaDAO.saveLuogo(montesodi);\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(pomino);\n\t\taziendaAgricolaDAO.saveLuogo(benefizio);\n\t\t\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Giulio d'Afflitto\"));\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Francesco Ermini\"));\n\n\t\t\n\t}", "private Punto getPuntoPriorizado(Punto puntoini, List<Punto> puntos ){\n\t\t\n\t\tPunto puntopriorizado = null;\n\t\t// calculamos la heuristica de distancias a los demas puntos\n\t\tfor (Punto punto : puntos) {\n\t\t\tif( (puntoini!=null && punto!=null) && !puntoini.equals(punto) ){\n\t\t\t\tdouble d = Geometria.distanciaDeCoordenadas(puntoini, punto);\n\t\t\t\tpunto.getDatos().put(\"distanci\", d);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// ordenamos por las heuristicas definidad en la clase comparator\n\t\t// hora atencion, prioridad, urgencia, distancia\n\t\tCollections.sort(puntos, new PuntoHeuristicaComparator1());\n\t\tSystem.out.println(\"### mostrando las heuristicas #####\");\n\t\tmostratPuntosHeuristica(puntos);\n\t\n\t\tif( puntos!=null && puntos.size()>0){\n\t\t\tpuntopriorizado = puntos.get(0);\n\t\t}\n\t\t\n\t\t/*Punto pa = null ;\n\t\tfor (Punto p : puntos) {\n\t\t\tif(pa!=null){\n\t\t\t\tString key = p.getDatos().toString();\n\t\t\t\tString keya = pa.getDatos().toString();\n\t\t\t\tif(!key.equals(keya)){\n\t\t\t\t\tpuntopriorizado = p;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tpa = p ;\n\t\t}*/\n\n\t\treturn puntopriorizado;\n\t}", "public void Semantica() {\r\n int var, etq;\r\n double marca, valor;\r\n double[] punto = new double[3];\r\n double[] punto_medio = new double[2];\r\n\r\n /* we generate the fuzzy partitions of the variables */\r\n for (var = 0; var < n_variables; var++) {\r\n marca = (extremos[var].max - extremos[var].min) /\r\n ((double) n_etiquetas[var] - 1);\r\n for (etq = 0; etq < n_etiquetas[var]; etq++) {\r\n valor = extremos[var].min + marca * (etq - 1);\r\n BaseDatos[var][etq].x0 = Asigna(valor, extremos[var].max);\r\n valor = extremos[var].min + marca * etq;\r\n BaseDatos[var][etq].x1 = Asigna(valor, extremos[var].max);\r\n BaseDatos[var][etq].x2 = BaseDatos[var][etq].x1;\r\n valor = extremos[var].min + marca * (etq + 1);\r\n BaseDatos[var][etq].x3 = Asigna(valor, extremos[var].max);\r\n BaseDatos[var][etq].y = 1;\r\n BaseDatos[var][etq].Nombre = \"V\" + (var + 1);\r\n BaseDatos[var][etq].Etiqueta = \"E\" + (etq + 1);\r\n }\r\n }\r\n }", "@Override\n\tpublic void crearNuevaPoblacion() {\n\t\t/* Nos quedamos con los mejores individuos. Del resto, cruzamos la mitad, los mejores,\n\t\t * y el resto los borramos.*/\n\t\tList<IIndividuo> poblacion2 = new ArrayList<>();\n\t\tint numFijos = (int) (poblacion.size()/2);\n\t\t/* Incluimos el 50%, los mejores */\n\t\tpoblacion2.addAll(this.poblacion.subList(0, numFijos));\n\t\t\n\t\t/* De los mejores, mezclamos la primera mitad \n\t\t * con todos, juntandolos de forma aleatoria */\n\t\tList<IIndividuo> temp = poblacion.subList(0, numFijos+1);\n\t\tfor(int i = 0; i < temp.size()/2; i++) {\n\t\t\tint j;\n\t\t\tdo {\n\t\t\t\tj = Individuo.aleatNum(0, temp.size()-1);\n\t\t\t}while(j != i);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tpoblacion2.addAll(cruce(temp.get(i), temp.get(j)));\n\t\t\t} catch (CruceNuloException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//this.poblacion.clear();\n\t\tthis.poblacion = poblacion2;\n\t}", "public void posiziona_bersaglio() {\n do{\n int r = (int) (Math.random() * POSIZIONI_RANDOM);\n bersaglio_x = ((r * DIMENSIONE_PUNTO));\n }while(bersaglio_x<102 || bersaglio_x>LARGHEZZA);\n do{\n int r = (int) (Math.random() * POSIZIONI_RANDOM);\n bersaglio_y = ((r * DIMENSIONE_PUNTO));\n }while(bersaglio_y<102 || bersaglio_y>ALTEZZA);\n //System.out.println (\"x : \"+bersaglio_x+\" y : \"+bersaglio_y);\n }", "public double portataMassicaFumi( ){\r\n\t\treturn portatamassica;\r\n\t}", "public static int ruolette(ArrayList<Integer> fitvalores, ArrayList<int[]> poblacion, int semilla){ \n int totalfitnes = 0;\n int totalfitnesnuevo = 0;\n int indtablero = 0;\n int semi=semilla;\n int tpoblacion=poblacion.size();\n int []nuevofitness = new int [fitvalores.size()];\n double []nproporcion = new double [fitvalores.size()];\n ArrayList <Double> proporcion = new ArrayList<>();//proporcion j la ruleta\n ArrayList <Double> ruleta = new ArrayList<>();\n //obtener el max fitnes\n for(int i=0;i<fitvalores.size();i++){ //total de fitnes\n totalfitnes=totalfitnes+fitvalores.get(i);\n }\n \n for(int i=0;i<fitvalores.size();i++){ //poner datos en el nuevo fittnes inverso\n double pro=(tpoblacion*tpoblacion-tpoblacion)-fitvalores.get(i);\n nuevofitness[i]= (int) pro;\n // System.out.println(\"nuevo fitnes\"+nuevofitness[i]);\n } \n for(int i=0;i<fitvalores.size();i++){ //total de fitnes nuevo o inverso\n totalfitnesnuevo=(totalfitnesnuevo+nuevofitness[i]);//para que los mejores casos usen mas espacio\n }\n \n for(int i=0;i<fitvalores.size();i++){ //poner datos en el array proporcion\n double var1=nuevofitness[i];\n double var2=totalfitnesnuevo;\n double pro=var1/var2;\n nproporcion[i]=pro;\n //System.out.println(\"nueva proporcion \"+nproporcion[i]);\n } \n ruleta.add(nproporcion[0]);\n // System.out.println(\"primera propporniaso \"+nproporcion[0]);\n for(int i=1;i<fitvalores.size();i++){ //poner datos en la ruleta\n double var1=ruleta.get(i-1);\n double var2=nproporcion[i];\n ruleta.add(var1+var2);\n //System.out.println(\"ruleta \"+ruleta.get(i));\n }\n double num=randomadec(0,1,semi);\n // System.out.println(\"numero random dec \"+num); \n for(int i=0;i<fitvalores.size();i++){ //poner datos en el array proporcion\n // System.out.println(ruleta.get(i));\n if(num<ruleta.get(i)){\n indtablero=i;\n //System.out.println(\"se guardo el tablero \"+indtablero);\n break;\n }\n }\n return indtablero;//esto devuelve el indice del tablero ganador en la ruleta\n }", "public void distribuirAportes1(){\n\n if(null == comprobanteSeleccionado.getAporteuniversidad()){\n System.out.println(\"comprobanteSeleccionado.getAporteuniversidad() >> NULO\");\n }\n\n if(null == comprobanteSeleccionado.getAporteorganismo()){\n System.out.println(\"comprobanteSeleccionado.getAporteorganismo() >> NULO\");\n }\n\n if(null == comprobanteSeleccionado.getMontoaprobado()){\n System.out.println(\"comprobanteSeleccionado.getMontoaprobado() >> NULO\");\n }\n\n try{\n if(comprobanteSeleccionado.getAporteuniversidad().floatValue() > 0f){\n comprobanteSeleccionado.setAporteorganismo(comprobanteSeleccionado.getMontoaprobado().subtract(comprobanteSeleccionado.getAporteuniversidad()));\n comprobanteSeleccionado.setAportecomitente(BigDecimal.ZERO);\n }\n } catch(NullPointerException npe){\n System.out.println(\"Error de NullPointerException\");\n npe.printStackTrace();\n }\n\n }", "public static void main(String[] args) {\n\r\n\t\tScanner tastatura = new Scanner(System.in);\r\n\t\tint pismo = 0;\r\n\t\tint brojBacanja = 0;\r\n\t\tint ishodBacanja = 0;\r\n\t\tint brojPisma = 0;\r\n\t\tint brojGlava = 0;\r\n//\t\tdouble kolicnkZaPismo = (double) brojPisma/brojBacanja;\r\n//\t\tdouble kolicnikZaGlavu = (double) brojGlava/brojBacanja;\r\n\t\t//ne moze ovde\r\n\t\t\r\n\t\twhile (true) {\r\n\t\t\tSystem.out.print(\"Koliko puta zelite da bacite novcic: \");\r\n\t\t\tbrojBacanja = tastatura.nextInt();\r\n\t\t\t\r\n\t\t\tif(brojBacanja == 0) break; \r\n\t\t\t\tbrojPisma = 0;\r\n\t\t\t\tbrojGlava = 0;\r\n\t\t\r\n\t\t\tfor (int i = 0; i<brojBacanja; i++) {\r\n\t\t\t\tishodBacanja = (int) (Math.random() + 0.5);\r\n\t\t\t\tif(ishodBacanja == pismo)\r\n\t\t\t\t\tbrojPisma++; \r\n\t\t\t\t\t//++ znaci ako je u zagradi tacno izvrsava se to nesti++\r\n\t\t\t\telse \r\n\t\t\t\t\tbrojGlava++;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdouble kolicnkZaPismo = (double) brojPisma/brojBacanja; //obavezno 2x double\r\n\t\t\tdouble kolicnikZaGlavu = (double) brojGlava/brojBacanja;\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Kolicnik za pisma: \" + kolicnkZaPismo);\r\n\t\t\tSystem.out.println(\"Kolicnik za glavu: \" + kolicnikZaGlavu);\r\n\t\t\tSystem.out.println(\"Pismo je palo \" + brojPisma +\" puta\");\r\n\t\t\tSystem.out.println(\"Glava je pala \" + brojGlava + \" puta\");\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"***Za izlaz ukucajte 0 ***\");\r\n\t\t\t\r\n// u zadatku\t\t\t\r\n//\t\t\tSystem.out.print(\"Broj pisma Broj glava\");\r\n//\t\t\tSystem.out.print(\" Broj pisma / Broj bacanja\");\r\n//\t\t\tSystem.out.println(\" Broj glava / Broj bacanja\");\r\n//\t\t\t\r\n//\t\t\tSystem.out.printf(\"%8d %12d %17.2f %25.2f\\n \" , \r\n//\t\t\t\t\tbrojPisma, brojGlava,\r\n//\t\t\t\t\t(double) brojPisma / brojBacanja,\r\n//\t\t\t\t\t(double) brojGlava / brojBacanja);\r\n\t\t}\r\n\t}", "public double getCustoAluguel(){\n return 2 * cilindradas;\n }", "private void actualizaPuntuacion() {\n if(cambiosFondo <= 10){\n puntos+= 1*0.03f;\n }\n if(cambiosFondo > 10 && cambiosFondo <= 20){\n puntos+= 1*0.04f;\n }\n if(cambiosFondo > 20 && cambiosFondo <= 30){\n puntos+= 1*0.05f;\n }\n if(cambiosFondo > 30 && cambiosFondo <= 40){\n puntos+= 1*0.07f;\n }\n if(cambiosFondo > 40 && cambiosFondo <= 50){\n puntos+= 1*0.1f;\n }\n if(cambiosFondo > 50) {\n puntos += 1 * 0.25f;\n }\n }", "public static void dodavanjeTeretnogVozila() {\n\t\tString vrstaVozila = \"Teretno Vozilo\";\n\t\tString regBr = UtillMethod.unosRegBroj();\n\t\tGorivo gorivo = UtillMethod.izabirGoriva();\n\t\tGorivo gorivo2 = UtillMethod.izabirGorivaOpet(gorivo);\n\t\tint brServisa = 1;\n\t\tdouble potrosnja = UtillMethod.unesiteDoublePotrosnja();\n\t\tSystem.out.println(\"Unesite broj km koje je vozilo preslo:\");\n\t\tdouble predjeno = UtillMethod.unesiteBroj();\n\t\tdouble preServisa = 20000;\n\t\tdouble cenaServisa = 10000;\n\t\tSystem.out.println(\"Unesite cenu vozila za jedan dan:\");\n\t\tdouble cenaDan = UtillMethod.unesiteBroj();\n\t\tSystem.out.println(\"Unesite broj sedista u vozilu:\");\n\t\tint brSedista = UtillMethod.unesiteInt();\n\t\tSystem.out.println(\"Unesite broj vrata vozila:\");\n\t\tint brVrata = UtillMethod.unesiteInt();\n\t\tboolean vozObrisano = false;\n\t\tArrayList<Gorivo> gorivaVozila = new ArrayList<Gorivo>();\n\t\tgorivaVozila.add(gorivo);\n\t\tif(gorivo2!=Main.nista) {\n\t\t\tgorivaVozila.add(gorivo2);\n\t\t}\n\t\tArrayList<Servis> servisiNadVozilom = new ArrayList<Servis>();\n\t\tSystem.out.println(\"Unesite maximalnu masu koje vozilo moze da prenosi u KG !!\");\n\t\tint maxMasauKg = UtillMethod.unesiteInt();\n\t\tSystem.out.println(\"Unesite maximalnu visinu u m:\");\n\t\tdouble visinauM = UtillMethod.unesiteBroj();\n\t\tTeretnaVozila vozilo = new TeretnaVozila(vrstaVozila, regBr, gorivaVozila, brServisa, potrosnja, predjeno, preServisa,\n\t\t\t\tcenaServisa, cenaDan, brSedista, brVrata, vozObrisano, servisiNadVozilom, maxMasauKg, visinauM);\n\t\tUtillMethod.prviServis(vozilo, predjeno);\n\t\tMain.getVozilaAll().add(vozilo);\n\t\tSystem.out.println(\"Novo vozilo je uspesno dodato u sistem!\");\n\t\tSystem.out.println(\"--------------------------------------\");\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tdouble [] [] notasAlunos = new double[2][4];\r\n\t\t\r\n\t\tnotasAlunos [0][0]= 10;\r\n\t\tnotasAlunos [0][1]= 4;\r\n\t\tnotasAlunos [0][2]= 6.9;\r\n\t\tnotasAlunos [0][3]= 8;\r\n\t\t\r\n\r\n\t\tnotasAlunos [1][0]= 9.7;\r\n\t\tnotasAlunos [1][1]= 4;\r\n\t\tnotasAlunos [1][2]= 5;\r\n\t\tnotasAlunos [1][3]= 10;\r\n\r\n\t\tdouble soma = 0;\r\n\t\t\r\n\t\t\r\n\t\tfor (int i = 0; i < notasAlunos.length; i++) {\r\n\t\t\t//System.out.print(notasAlunos[i]+\" \");\r\n\t\t\t\r\n\t\t\tfor (int j = 0; j < notasAlunos[i].length; j++) {\r\n\t\t\t\tSystem.out.print(notasAlunos[i][j]+ \" - \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\tSystem.out.println(\"Caluclando a media: \");\r\n\t\t\r\n\t\tfor (int i = 0; i < notasAlunos.length; i++) {\r\n\t\t\tsoma = 0;//inicializando a soma para a proxima iteração\r\n\t\t\tfor (int j = 0; j < notasAlunos[i].length; j++) {\r\n\t\t\t//\tSystem.out.print(notasAlunos[i][j]+ \" - \");\r\n\t\t\t\tsoma += notasAlunos[i][j];\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"A media do aluno \"+(i+1)+ \" é \"+ (soma/4));\r\n\t\t}\r\n\t\r\n\r\n\t}", "public void calcular()\r\n/* 530: */ {\r\n/* 531:556 */ this.facturaProveedorSRI.setMontoIva(this.facturaProveedorSRI.getBaseImponibleDiferenteCero().multiply(\r\n/* 532:557 */ ParametrosSistema.getPorcentajeIva().divide(BigDecimal.valueOf(100L))));\r\n/* 533: */ }", "void rozpiszKontraktyPart2NoEV(int index,float wolumenHandlu, float sumaKupna,float sumaSprzedazy )\n\t{\n\t\tArrayList<Prosument> listaProsumentowTrue =listaProsumentowWrap.getListaProsumentow();\n\t\t\n\n\t\tint a=0;\n\t\twhile (a<listaProsumentowTrue.size())\n\t\t{\n\t\t\t\t\t\t\n\t\t\t// ustala bianrke kupuj\n\t\t\t// ustala clakowita sprzedaz (jako consumption)\n\t\t\t//ustala calkowite kupno (jako generacje)\n\t\t\tDayData constrainMarker = new DayData();\n\t\t\t\n\t\t\tArrayList<Point> L1\t=listaFunkcjiUzytecznosci.get(a);\n\t\t\t\n\t\t\t//energia jaka zadeklarowal prosument ze sprzeda/kupi\n\t\t\tfloat energia = L1.get(index).getIloscEnergiiDoKupienia();\n\t\t\t\n\t\t\tif (energia>0)\n\t\t\t{\n\t\t\t\tfloat iloscEnergiiDoKupienia = energia/sumaKupna*wolumenHandlu;\n\t\t\t\t\n\t\t\t\tconstrainMarker.setKupuj(1);\n\t\t\t\tconstrainMarker.setGeneration(iloscEnergiiDoKupienia);\n\t\t\t\t\n\t\t\t\trynekHistory.ustawBetaDlaWynikowHandlu(iloscEnergiiDoKupienia,a);\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfloat iloscEnergiiDoSprzedania = energia/sumaSprzedazy*wolumenHandlu;\n\n\t\t\t\t\n\t\t\t\tconstrainMarker.setKupuj(0);\n\t\t\t\tconstrainMarker.setConsumption(iloscEnergiiDoSprzedania);\n\t\t\t\t\n\t\t\t\trynekHistory.ustawBetaDlaWynikowHandlu(iloscEnergiiDoSprzedania,a);\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tArrayList<Float> priceVector = priceVectorsList.get(priceVectorsList.size()-1);\n\t\t\t\n\t\t\t//poinformuj prosumenta o wyniakch handlu i dostosuj go do wynikow\n\t\t\tlistaProsumentowTrue.get(a).getKontrakt(priceVector,constrainMarker);\n\t\t\t\n\t\t\ta++;\n\t\t}\n\t}", "public void abrir(String name, String rfc, Double sueldo, Double aguinaldo2,// Ya esta hecho es el vizualizador\r\n\t\t\tDouble primav2, Double myH2, Double gF, Double sGMM2, Double hip, Double donat, Double subR,\r\n\t\t\tDouble transp, String NivelE, Double colegiatura2) {\r\n\t\tthis.nombre=name;//\r\n\t\tthis.RFC=rfc;//\r\n\t\tthis.SueldoM=sueldo;//\r\n\t\tthis.Aguinaldo=aguinaldo2;//\r\n\t\tthis.PrimaV=primav2;//\r\n\t\tthis.MyH=myH2;//\r\n\t\tthis.GatsosFun=gF;//\r\n\t\tthis.SGMM=sGMM2;//\r\n\t\tthis.Hipotecarios=hip;//\r\n\t\tthis.Donativos=donat;//\r\n\t\tthis.SubRetiro=subR;//\r\n\t\tthis.TransporteE=transp;//\r\n\t\tthis.NivelE=NivelE;//\r\n\t\tthis.Colegiatura=colegiatura2;//\r\n\t\t\r\n\t\tthis.calculo(this.nombre, this.RFC, this.SueldoM, this.Aguinaldo, this.PrimaV,this.MyH,this.GatsosFun,\r\n\t\t\t\tthis.SGMM,this.Hipotecarios,this.Donativos,this.SubRetiro,this.TransporteE,this.NivelE,this.Colegiatura);\r\n\t\t\r\n\t\tpr.Imprimir(this.nombre, this.RFC, this.SueldoM,this.IngresoA,this.Aguinaldo,this.PrimaV,this.MyH,this.GatsosFun,this.SGMM,this.Hipotecarios,this.Donativos,this.SubRetiro,this.TransporteE,this.NivelE,this.Colegiatura,this.AguinaldoE,this.AguinaldoG,this.PrimaVE,this.PrimaVG,this.TotalIngresosG,this.MaxDedColeg,this.TotalDedNoRetiro,this.DedPerm,this.MontoISR,this.CuotaFija,this.PorcExced,this.PagoEx,this.Total);\r\n\t\t\r\n\t}", "public Fenetre_resultats_plaque(float debit_m_1, float debit_m_2, float capacite_th_1, float capacite_th_2, float viscosite_1, float viscosite_2, float conductivite_th_1, float conductivite_th_2, float masse_volumique_1, float masse_volumique_2, float tempc, float tempf, float longueur, float largeur, float hauteur) {\n\n Plaques plaque1;\n Finance F1;\n\n plaque1 = new Plaques(longueur, largeur, hauteur, debit_m_1, debit_m_2, capacite_th_1, capacite_th_2, tempc, tempf, masse_volumique_1, masse_volumique_2, viscosite_1, viscosite_2, conductivite_th_1, conductivite_th_2);\n F1 = new Finance();\n\n int nbre_plaques_total_main = plaque1.calcul_nbre_plaques_total();\n double surface_plaque_main = plaque1.calcul_surface_plaques();\n\n plaque1.calcul_surface_contact();\n\n double smod_main = plaque1.calcul_smod();\n\n plaque1.calcul_coeff_convection_h();\n plaque1.calcul_rth();\n plaque1.calcul_densite_couple();\n plaque1.calcul_rcharge();\n \n double pe_main = plaque1.calcul_Pe();\n\n int nbre_modules_main = plaque1.getter_nbre_modules();\n\n double prix_modules_main = F1.calcul_prix_modules(nbre_modules_main);\n if (prix_modules_main < 0) {\n prix_modules_main = 0;\n }\n \n F1.calcul_volume_plaques(surface_plaque_main, plaque1.getter_diam_tube(), plaque1.getter_epaisseur_plaque(), nbre_plaques_total_main, plaque1.getter_inter_plaque());\n \n double prix_materiaux_main = F1.calcul_prix_matiere();\n if (prix_materiaux_main < 0) {\n prix_materiaux_main = 0;\n }\n \n double prix_total_main = prix_modules_main + prix_materiaux_main;\n\n double energie_produite_main = F1.conversion_kwh(pe_main);\n double revenu_horaire_main = F1.calcul_revenu_horaire();\n double nbre_heures_main = F1.calcul_nbre_heures();\n \n DecimalFormat df2 = new DecimalFormat(\"#.##\");\n DecimalFormat df4 = new DecimalFormat(\"#.####\");\n DecimalFormat df5 = new DecimalFormat(\"#.#####\");\n DecimalFormat df7 = new DecimalFormat(\"#.#######\");\n \n\n String entetes[] = {\"Résultat\", \"Valeur\"};\n Object donnees[][] = {\n {\"Nombre de modules\", plaque1.getter_nbre_modules()},\n {\"Surface proposée (en m²)\", df5.format(plaque1.getter_surface_contact())},\n {\"Surface utilisée par les modules (en m²)\", df5.format(smod_main)},\n {\"Débit massique chaud(en m3/h)\", debit_m_1},\n {\"Débit massique froid(en m3/h)\", debit_m_2},\n {\"Température chaude (en °C)\", tempc},\n {\"Différence de température\", plaque1.getter_diff_temperature()},\n {\"Puissance électrique générée (en W)\", df2.format(pe_main)}};\n\n DefaultTableModel modele = new DefaultTableModel(donnees, entetes) {\n @Override\n public boolean isCellEditable(int row, int col) {\n return false;\n }\n };\n\n tableau = new JTable(modele);\n\n String entetes2[] = {\"Caractéristiques\", \"Valeurs\"};\n Object donnees2[][] = {\n {\"Surface d'un module (en m²)\", plaque1.getter_surface_module()},\n {\"Longueur d'une jambe (en m)\", df4.format(plaque1.getter_longueur_jambe())},\n {\"Surface d'une jambe (en m²)\", df7.format(plaque1.getter_surface_jambe())},\n {\"Densité de couple\", df5.format(plaque1.getter_densite_couple())},\n {\"Conductivité thermique du module (en W/m/K)\", df2.format(plaque1.getter_conduct_th_module())}\n };\n\n DefaultTableModel modele2 = new DefaultTableModel(donnees2, entetes2) {\n @Override\n public boolean isCellEditable(int row, int col) {\n return false;\n }\n };\n\n Object donnees3[][] = {\n {\"Prix des modules (en €)\", df2.format(prix_modules_main)},\n {\"Prix de la matière première (en €)\", df2.format(prix_materiaux_main)},\n {\"Prix total échangeur (en €)\", df2.format(prix_total_main)},\n {\"Prix du kilowatt-heure\", F1.getter_prix_elec()},\n {\"Revenu horaire\", df2.format(revenu_horaire_main)},\n {\"Nbre d'heures pour remboursement\", df2.format(nbre_heures_main)}\n\n };\n String entetes3[] = {\"Caractéristiques\", \"Valeurs\"};\n\n DefaultTableModel modele3 = new DefaultTableModel(donnees3, entetes3) {\n @Override\n public boolean isCellEditable(int row, int col) {\n return false;\n }\n };\n\n tableau3 = new JTable(modele3);\n\n // Pour le graphique en camembert\n final JFXPanel fxPanel = new JFXPanel(); // On crée un panneau FX car on peut pas mettre des objet FX dans un JFRame\n final PieChart chart = new PieChart(); // on crée un objet de type camembert\n chart.setTitle(\"Répartition du prix de l'échangeur\"); // on change le titre de ce graph\n chart.getData().setAll(new PieChart.Data(\"Prix des modules \" + prix_modules_main + \" €\", prix_modules_main), new PieChart.Data(\"Prix du matériau \" + df2.format(prix_materiaux_main) + \" €\", prix_materiaux_main)\n ); // on implémente les différents case du camebert\n final Scene scene = new Scene(chart); // on crée une scene (FX) où l'on met le graph camembert\n fxPanel.setScene(scene);\n\n // a partir de là c'est plus le camembert\n tableau2 = new JTable(modele2);\n\n JScrollPane tableau_entete = new JScrollPane(tableau);\n JScrollPane tableau_entete2 = new JScrollPane(tableau2);\n JScrollPane tableau_entete3 = new JScrollPane(tableau3);\n\n tableau_entete.setViewportView(tableau);\n tableau_entete2.setViewportView(tableau2);\n tableau_entete3.setViewportView(tableau3);\n\n tableau_entete.setPreferredSize(new Dimension(550, 170));\n tableau_entete2.setPreferredSize(new Dimension(550, 110));\n tableau_entete3.setPreferredSize(new Dimension(550, 120));\n\n JLabel label_resultat = new JLabel(\"Resultat de la simulation\");\n JLabel label_module = new JLabel(\"Caractéristiques du module utilisé\");\n JLabel label_prix = new JLabel(\"Prix de l'échangeur\");\n \n setBounds(0, 0, 600, 950);\n setTitle(\"Résultats Technologie Plaques\");\n \n panneau = new JPanel();\n panneau.add(label_resultat);\n panneau.add(tableau_entete);\n panneau.add(label_module);\n panneau.add(tableau_entete2);\n panneau.add(label_prix);\n panneau.add(tableau_entete3);\n panneau.add(fxPanel); // on ajoute au Jframe notre panneau FX (qui contient donc UNE \"scene\" qui elle contient les object FX, ici notre camembert)\n getContentPane().add(panneau);\n \n this.setLocation(600, 0);\n this.setResizable(false);\n }", "@Override\n public Coup meilleurCoup(Plateau _plateau, Joueur _joueur, boolean _ponder) {\n \n _plateau.sauvegardePosition(0);\n \n /* On créé un noeud père, qui est le noeud racine de l'arbre. On définit arbitrairement le joueur associé (\n (0 ou 1, il importe peu de savoir quel joueur correspond à ce nombre, cette information étant déjà portée par \n j1 et j2 dans l'algorithme. Le tout est de faire alterner cette valeur à chaque niveau de l'arbre. */\n \n Noeud pere = new Noeud();\n pere.joueurAssocie = 0;\n \n // On définit ici c, le coefficient d'arbitrage entre exploration et exploitation. Ce dernier est théroquement optimal pour una valeur égale à sqrt(2).\n \n double c = 10 * Math.sqrt(2);\n double[] resultat = new double[2];\n \n // Conditions de fonctionnement par itération\n \n //int i = 1;\n //int nbTours = 10000;\n \n //while(i <= nbTours){\n \n // Conditions de fonctionnement en mode \"compétition\" (100 ms pour se décider au maximum).\n \n long startTime = System.currentTimeMillis();\n \n while((System.currentTimeMillis()-startTime) < 100){\n\n // La valeur résultat ne sert à rien fondamentalement ici, elle sert uniquement pour le bon fonctionnement de l'algorithme en lui même.\n // On restaure le plateau à chaque tour dans le MCTS (Sélection - Expension - Simulation - Backpropagation). \n \n resultat = MCTS(pere, _plateau, this.j_humain, this.j_ordi, c, this.is9x9, this.methodeSimulation);\n _plateau.restaurePosition(0);\n \n //i++;\n }\n\n // On doit maintenant choisir le meilleur coup parmi les fils du noeud racine, qui correspondent au coup disponibles pour l'IA.\n \n double maxValue = 0;\n int maxValueIndex = 0;\n \n for(int j = 0; j < pere.fils.length; j++){\n \n double tauxGain = ((double)pere.fils[j].nbPartiesGagnees / (double)pere.fils[j].nbPartiesJouees);\n\n // On choisirat le coup qui maximise le taux de gain des parties simulées.\n \n if(tauxGain >= maxValue){\n maxValueIndex = j;\n maxValue = tauxGain;\n \n }\n }\n \n // On retourne le coup associé au taux de gain le plus élevé.\n\n return pere.fils[maxValueIndex].coupAssocie;\n }", "public void run() {\n PopulationFGA<Integer> poblacionActual = new PopulationFGA<>(funcionBorn,\n funcionFitness,\n problema.getDimension(),\n 1);\n poblacionActual.incializa(200);\n while(!condTerminacion.conditionReached(poblacionActual)) {\n System.out.println(\"Generacion Actual: \" + poblacionActual.getGeneracion());\n poblacionActual = iteration(poblacionActual);\n }\n ArrayList<IndividualFGA<Integer>> individuos = poblacionActual.generaIndividuos();\n IndividualFGA<Integer> mejor = individuos.get(0);\n for (IndividualFGA<Integer> e : individuos) {\n if (mejor.getFitness() <= e.getFitness())\n mejor = e;\n }\n System.out.println(\"Mejor solucion \" + '\\n' + mejor.toString());\n //System.out.println(\"Fitness \" + mejor.getFitness());\n int dim = problema.getDimension();\n int costo = 0;\n int obj1;\n int obj2;\n Phenotype<Integer> fenotipo = mejor.getRepActual();\n for (int i = 0; i < (dim - 1); i++) {\n obj1 = fenotipo.getAllele(i).intValue() - 1;\n for (int j = i + 1; j < dim; j++) {\n obj2 =fenotipo.getAllele(j).intValue() - 1; \n costo = costo + problema.getDistanciaEntre(i,j) * problema.getFlujoEntre(obj1,obj2);\n }\n }\n System.out.println(\"Costo de la solucion: \" + costo);\n\n }", "public void recarga(){\n \tthis.fuerza *= 1.1;\n \tthis.vitalidad *= 1.1; \n }", "@Test\n public void test_distanceLinaireSurX_distanceLinaireSurX_ParcourOptimum_Pour_4villes() {\n\n Pays pays = new Pays(4);\n\n int positionY = (int) (Math.random() * 50);\n\n pays.setPositionVille(0, new Point(2, positionY));\n pays.setPositionVille(1, new Point(3, positionY));\n pays.setPositionVille(2, new Point(4, positionY));\n pays.setPositionVille(3, new Point(5, positionY));\n\n brutForceV3.recherche(pays, 0);\n\n assertEquals(\"0>1>2>3>0\", brutForceV3.getParcours().getVillesEmprunté());\n assertEquals(brutForceV3.getParcours().getDistance(),\n parcoursVilles(pays, brutForceV3.getParcours().getVillesEmprunté(),\">\"));\n\n }", "public void solucion() {\r\n System.out.println(\"Intervalo : [\" + a + \", \" + b + \"]\");\r\n System.out.println(\"Error : \" + porce);\r\n System.out.println(\"decimales : \"+ deci);\r\n System.out.println(\"Iteraciones : \" + iteraciones);\r\n System.out\r\n .println(\"------------------------------------------------ \\n\");\r\n \r\n double c = 0;\r\n double fa = 0;\r\n double fb = 0;\r\n double fc = 0;\r\n int iteracion = 1;\r\n \r\n do {\r\n // Aqui esta la magia\r\n c = (a + b) / 2; \r\n System.out.println(\"Iteracion (\" + iteracion + \") : \" + c);\r\n fa = funcion(a);\r\n fb = funcion(b);\r\n fc = funcion(c);\r\n if (fa * fc == 0) {\r\n if (fa == 0) {\r\n JOptionPane.showMessageDialog(null, \"Felicidades la raíz es: \"+a);\r\n System.out.println(a);\r\n System.exit(0);\r\n } else {\r\n JOptionPane.showMessageDialog(null, \"Felicidades la raíz es: \"+c);\r\n System.out.println(c);\r\n System.exit(0);\r\n }}\r\n \r\n if (fc * fa < 0) {\r\n b = c;\r\n fa = funcion(a);\r\n fb = funcion(b);\r\n c = (a+b) / 2;\r\n \r\n x=c;\r\n fc = funcion(c);\r\n } else {\r\n a = c;\r\n fa = funcion(a);\r\n fb = funcion(b);\r\n c = (a+b) / 2;\r\n \r\n x=c;\r\n fc = funcion(c);\r\n }\r\n iteracion++;\r\n // Itera mientras se cumpla la cantidad de iteraciones establecidas\r\n // y la funcion se mantenga dentro del margen de error\r\n \r\n er = Math.abs(((c - x) / c)* 100);\r\n BigDecimal bd = new BigDecimal(aux1);\r\n bd = bd.setScale(deci, RoundingMode.HALF_UP);\r\n BigDecimal bdpm = new BigDecimal(pm);\r\n bdpm = bdpm.setScale(deci, RoundingMode.HALF_UP);\r\n cont++;\r\n fc=c ;\r\n JOptionPane.showMessageDialog(null, \"conteos: \" + cont + \" Pm: \" + bd.doubleValue() + \" Funcion: \" + bdpm.doubleValue() + \" Error: \" + er +\"%\"+ \"\\n\");\r\n } while (er <=porce);\r\n \r\n \r\n }", "private void calcularDistanciaRecorrer(){\r\n\t\tfloat diferenciax = siguientePunto.x - posicion.x;\r\n\t\tfloat diferenciay = siguientePunto.y - posicion.y;\r\n\t\tdistanciaRecorrer = (float) Math.sqrt(diferenciax*diferenciax+diferenciay*diferenciay);\r\n\t}", "public void hallarPerimetroIsosceles() {\r\n this.perimetro = 2*(this.ladoA+this.ladoB);\r\n }", "private int[] enquadramentoContagemDeCaracteres(int[] quadro) throws Exception {\n System.out.println(\"\\n\\t[Contagem de Caracteres]\");\n Painel.CAMADAS_RECEPTORAS.camadaEnlace(\"\\n\\t[Contagem de Caracteres]\\n\");\n Thread.sleep(velocidade);\n\n int informacaoDeControle = ManipuladorDeBit.getPrimeiroByte(quadro[0]);//Quantidade de Bits do quadro\n //Quantidade de Bits de carga util do quadro\n int quantidadeDeBitsCargaUtil = informacaoDeControle;\n System.out.println(\"IC: \" + informacaoDeControle);\n Painel.CAMADAS_RECEPTORAS.camadaEnlace(\"\\n\\tIC [\"+informacaoDeControle+\"] \");\n\n\n int novoTamanho = quantidadeDeBitsCargaUtil/8;\n\n int[] quadroDesenquadrado = new int[novoTamanho];//Novo vetor de Carga Util\n int posQuadro = 0;//Posicao do Vetor de Quadros\n\n int cargaUtil = 0;//Nova Carga Util\n\n quadro[0] = ManipuladorDeBit.deslocarBits(quadro[0]);//Deslocando os bits 0's a esquerda\n //Primeiro inteiro do Quadro - Contem a informacao de Controle IC nos primeiros 8 bits\n quadro[0] <<= 8;//Deslocando 8 bits para a esquerda, descartar a IC\n\n Painel.CAMADAS_RECEPTORAS.camadaEnlace(\"Carga Util [ \");\n for (int i=1; (i<=3) && (i<=novoTamanho); i++) {\n cargaUtil = ManipuladorDeBit.getPrimeiroByte(quadro[0]);\n quadroDesenquadrado[posQuadro++] = cargaUtil;\n Painel.CAMADAS_RECEPTORAS.camadaEnlace(cargaUtil + \" \");\n quadro[0] <<= 8;//Desloca 8 bits para a esquerda\n }\n\n Thread.sleep(velocidade);\n\n //Caso o quadro for composto por mais de um inteiro do vetor\n for (int i=1, quantidadeByte; posQuadro<novoTamanho; i++) {\n quantidadeByte = ManipuladorDeBit.quantidadeDeBytes(quadro[i]);\n quadro[i] = ManipuladorDeBit.deslocarBits(quadro[i]);\n\n for (int x=1; (x<=quantidadeByte) && (x<=4); x++) {\n cargaUtil = ManipuladorDeBit.getPrimeiroByte(quadro[i]);\n quadroDesenquadrado[posQuadro++] = cargaUtil;\n Painel.CAMADAS_RECEPTORAS.camadaEnlace(cargaUtil + \" \");\n quadro[i] <<= 8;//Desloca 8 bits para a esquerda\n }\n Thread.sleep(velocidade);\n }\n \n Painel.CAMADAS_RECEPTORAS.camadaEnlace(\"]\\n\");\n Thread.sleep(velocidade);\n\n return quadroDesenquadrado;\n }", "public double Baricentro() {\n if (puntos.size() <= 2) {\n return 0;\n } else {\n // Inicializacion de las areas\n double areaPonderada = 0;\n double areaTotal = 0;\n double areaLocal;\n // Recorrer la lista conservando 2 puntos\n Punto2D antiguoPt = null;\n for (Punto2D pt : puntos) {\n if (antiguoPt != null) {\n // Cálculo deñ baricentro local\n if (antiguoPt.y == pt.y) {\n // Es un rectángulo, el baricentro esta en\n // centro\n areaLocal = pt.y * (pt.x - antiguoPt.x);\n areaTotal += areaLocal;\n areaPonderada += areaLocal * ((pt.x - antiguoPt.x) / 2.0 + antiguoPt.x);\n } else {\n // Es un trapecio, que podemos descomponer en\n // un reactangulo con un triangulo\n // rectangulo adicional\n // Separamos ambas formas\n // Primer tiempo: rectangulo\n areaLocal = Math.min(pt.y, antiguoPt.y) + (pt.x - antiguoPt.x);\n areaTotal += areaLocal;\n areaPonderada += areaLocal * ((pt.x - antiguoPt.x) / 2.0 + antiguoPt.x);\n //Segundo tiempo: triangulo rectangulo\n areaLocal = (pt.x - antiguoPt.x) * Math.abs(pt.y - antiguoPt.y) / 2.0;\n areaTotal += areaLocal;\n if (pt.y > antiguoPt.y) {\n // Baricentro a 1/3 del lado pt\n areaPonderada += areaLocal * (2.0 / 3.0 * (pt.x - antiguoPt.x) + antiguoPt.x);\n } else {\n // Baricentro a 1/3 dek lado antiguoPt\n areaPonderada += areaLocal * (1.0 / 3.0 * (pt.x - antiguoPt.x) + antiguoPt.x);\n }\n }\n }\n antiguoPt = pt;\n }\n // Devolvemos las coordenadas del baricentro\n return areaPonderada / areaTotal;\n }\n }", "public static void Promedio(){\n int ISumaNotas=0;\n int IFila=0,ICol=0;\n int INota;\n float FltPromedio;\n for(IFila=0;IFila<10;IFila++)\n {\n ISumaNotas+=Integer.parseInt(StrNotas[IFila][1]);\n }\n FltPromedio=ISumaNotas/10;\n System.out.println(\"El promedio de la clase es:\"+FltPromedio);\n }", "@Test\n public void test_distanceLinaireSurY_ParcourOptimum_Pour_4villes() {\n\n Pays pays = new Pays(4);\n\n int positionX = (int) (Math.random() * 50);\n\n pays.setPositionVille(0, new Point(positionX, 2));\n pays.setPositionVille(1, new Point(positionX, 3));\n pays.setPositionVille(2, new Point(positionX, 4));\n pays.setPositionVille(3, new Point(positionX, 5));\n\n brutForceV3.recherche(pays, 0);\n\n assertEquals(\"0>1>2>3>0\", brutForceV3.getParcours().getVillesEmprunté());\n assertEquals(brutForceV3.getParcours().getDistance(),\n parcoursVilles(pays, brutForceV3.getParcours().getVillesEmprunté(),\">\"));\n\n }", "void MontaValores(){\r\n // 0;0;-23,3154166666667;-51,1447783333333;0 // Extrai os valores e coloca no objetos\r\n // Dis;Dir;Lat;Long;Velocidade\r\n // Quebra de Rota lat=-999.999 long=-999.999 ==> Marca ...\r\n \r\n int ind=0;\r\n NMEAS=NMEA.replace(\",\" , \".\");\r\n \r\n //1)\r\n dists=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind));\r\n Distancia=Double.valueOf(dists);\r\n ind=ind+dists.length()+1;\r\n \r\n //2)\r\n dirs=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind+1));\r\n Direcao=Double.valueOf(dirs);\r\n ind=ind+dirs.length()+1;\r\n \r\n //3)\r\n lats=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind+1));\r\n Lat=Double.valueOf(lats);\r\n ind=ind+lats.length()+1;\r\n \r\n //4)\r\n longs=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind+1));\r\n Long=Double.valueOf(longs);\r\n ind=ind+longs.length()+1;\r\n \r\n //5)\r\n vels=NMEAS.substring(ind,NMEAS.length());\r\n // Transforma de Knots para Km/h\r\n Velocidade=Double.valueOf(vels)/100*1.15152*1.60934;\r\n vels=String.valueOf(Velocidade);\r\n ind=ind+vels.length()+1;\r\n \r\n }", "public void asignarPedido(Pedido pedido){\n\t\tdouble costeMin=100000;\n\t\tint pos=0;\n\t\t\n\t\tif (pedido.getPeso()<PESOMAXMOTO) {\n\t\tif(motosDisponibles.size()!=0){\n\t\t \n\t\t\tpos=0;\n\t\t\t//Damos como primer valor el de primera posición\n\t\t\t\n\t\t\tcosteMin=pedido.coste(motosDisponibles.get(0));\n\t\t\t\n\t\t\t//Ahora vamos a calcular el min yendo uno por uno\n\t\t\t\n\t\t\tfor(int i=0; i<motosDisponibles.size(); i++){\n\t\t\t\tif(costeMin>pedido.coste(motosDisponibles.get(i))){\n\t\t\t\t\tcosteMin=pedido.coste(motosDisponibles.get(i));\n\t\t\t\t\tpos=i;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Una vez hallada la moto de menor coste la asignamos\n\t\t\tpedido.setTransporte(motosDisponibles.get(pos));\n\t\t\tmotosDisponibles.removeElementAt(pos);\n\t\t\t\n\t\t \n\t\t}\n\t\telse {\n\t\t\tpedidosEsperandoMoto.add(pedidosEsperandoMoto.size(),pedido);\n\t\t}\n\t\t}\n\t\t\n\t\telse {\n\t\t\tif (furgonetasDisponibles.size()!=0){\n\t\t\tcosteMin = pedido.coste(furgonetasDisponibles.get(0));\n\t\t\tfor(int i=0; i<furgonetasDisponibles.size(); i++){\n\t\t\t\tif(costeMin>pedido.coste(furgonetasDisponibles.get(i))){\n\t\t\t\t\tcosteMin=pedido.coste(furgonetasDisponibles.get(i));\n\t\t\t\t\tpos=i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpedido.setTransporte(furgonetasDisponibles.get(pos));\n\t\t\tfurgonetasDisponibles.removeElementAt(pos);\n\t\t}\n\t\t\telse{\n\t\t\t\tpedidosEsperandoFurgoneta.add(pedidosEsperandoFurgoneta.size(),pedido);\n\t\t\t}\n\t\t}\n\t}", "private void pintar_cuadrantes() {\tfor (int f = 0; f < 3; f++)\n//\t\t\tfor (int c = 0; c < 3; c++)\n//\t\t\t\ttablero[f][c].setBorder(new LineBorder(Color.DARK_GRAY, 2));\n//\n//\t\tfor (int f = 0; f < 3; f++)\n//\t\t\tfor (int c = 6; c < 9; c++)\n//\t\t\t\ttablero[f][c].setBorder(new LineBorder(Color.DARK_GRAY, 2));\n//\n//\t\tfor (int f = 3; f < 6; f++)\n//\t\t\tfor (int c = 3; c < 6; c++)\n//\t\t\t\ttablero[f][c].setBorder(new LineBorder(Color.DARK_GRAY, 2));\n//\n//\t\tfor (int f = 6; f < 9; f++)\n//\t\t\tfor (int c = 0; c < 3; c++)\n//\t\t\t\ttablero[f][c].setBorder(new LineBorder(Color.DARK_GRAY, 2));\n//\n//\t\tfor (int f = 6; f < 9; f++)\n//\t\t\tfor (int c = 6; c < 9; c++)\n//\t\t\t\ttablero[f][c].setBorder(new LineBorder(Color.DARK_GRAY, 2));\n//\t\n\t\t\n\t\t}", "public void carroPulando() {\n\t\tpulos++;\n\t\tpulo = (int) (PULO_MAXIMO/10);\n\t\tdistanciaCorrida += pulo;\n\t\tif (distanciaCorrida > distanciaTotalCorrida) {\n\t\t\tdistanciaCorrida = distanciaTotalCorrida;\n\t\t}\n\t}", "public Rettangolo(Punto[] vertici)\n\t{\n\t\tsuper(vertici);\n\n\t\tif(this.direzioneLati[0] != -1.0 / this.direzioneLati[1] && (this.direzioneLati[0] != Double.POSITIVE_INFINITY || this.direzioneLati[1] != 0.0))\n\t\t{\n\t\t\tthis.vertici = null;\n\t\t\tthis.direzioneLati = this.lunghezzaLati = null; // TODO: eccezioni\n\t\t\tSystem.out.println(\"Errore: i quattro punti non individuano un rettangolo.\");\n\t\t}\n\t}", "public void distribuirAportes2(){\n\n if(comprobanteSeleccionado.getAporteorganismo().floatValue() > 0f){\n comprobanteSeleccionado.setAportecomitente(comprobanteSeleccionado.getMontoaprobado().subtract(comprobanteSeleccionado.getAporteuniversidad().add(comprobanteSeleccionado.getAporteorganismo())));\n }\n }", "double objetosc() {\n return dlugosc * wysokosc * szerokosc; //zwraca obliczenie poza metode\r\n }", "private static void statistique(){\n\t\tfor(int i = 0; i<7; i++){\n\t\t\tfor(int j = 0; j<7; j++){\n\t\t\t\tfor(int l=0; l<jeu.getJoueurs().length; l++){\n\t\t\t\t\tif(jeu.cases[i][j].getCouleurTapis() == jeu.getJoueurs()[l].getNumJoueur()){\n\t\t\t\t\t\tjeu.getJoueurs()[l].setTapis(jeu.getJoueurs()[l].getTapisRest()+1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tJoueur j;\n\t\tSystem.out.println(\"// Fin de la partie //\");\n\t\tfor(int i=0; i<jeu.getJoueurs().length; i++) {\n\t\t\tj =jeu.getJoueurs()[i];\n\t\t\tSystem.out.println(\"Joueur \"+ (j.getNumJoueur()+1) + \" a obtenue \"+j.getTapisRest()+j.getMonnaie()+\" points\" );\n\t\t}\n\t}", "public float calcular(float dinero, float precio) {\n // Cálculo del cambio en céntimos de euros \n cambio = Math.round(100 * dinero) - Math.round(100 * precio);\n // Se inicializan las variables de cambio a cero\n cambio1 = 0;\n cambio50 = 0;\n cambio100 = 0;\n // Se guardan los valores iniciales para restaurarlos en caso de no \n // haber cambio suficiente\n int de1Inicial = de1;\n int de50Inicial = de50;\n int de100Inicial = de100;\n \n // Mientras quede cambio por devolver y monedas en la máquina \n // se va devolviendo cambio\n while(cambio > 0) {\n // Hay que devolver 1 euro o más y hay monedas de 1 euro\n if(cambio >= 100 && de100 > 0) {\n devolver100();\n // Hay que devolver 50 céntimos o más y hay monedas de 50 céntimos\n } else if(cambio >= 50 && de50 > 0) {\n devolver50();\n // Hay que devolver 1 céntimo o más y hay monedas de 1 céntimo\n } else if (de1 > 0){\n devolver1();\n // No hay monedas suficientes para devolver el cambio\n } else {\n cambio = -1;\n }\n }\n \n // Si no hay cambio suficiente no se devuelve nada por lo que se\n // restauran los valores iniciales\n if(cambio == -1) {\n de1 = de1Inicial;\n de50 = de50Inicial;\n de100 = de100Inicial;\n return -1;\n } else {\n return dinero - precio;\n }\n }", "@Override\n public double calculaTributos() {\n // TODO Auto-generated method stub\n return 10;\n }", "double getDiametro(){\n return raggio * 2;\n }", "public static Pot oceni_moder(Igra igra) {\n\t\tTocka[][] plosca = igra.getPlosca();\n\t\tint N = Igra.N;\n\n\t\t\n\t\tSet<Vrednost> modra_pot = new HashSet<Vrednost>();\n\t\tVrednost[][] tabela_dolzin_modri = new Vrednost[N][N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tfor (int j = 0; j < N; j++) {\n\t\t\t\ttabela_dolzin_modri[i][j] = new Vrednost(new Koordinati(j, i));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 1. vrstica\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tif (plosca[i][0].polje == Polje.Moder) tabela_dolzin_modri[i][0].vrednost = 0;\n\t\t\tif (plosca[i][0].polje == Polje.PRAZNO) tabela_dolzin_modri[i][0].vrednost = 1;\n\t\t}\n\t\t\n\t\t// ostalo\n\t\tfor (int j = 1; j < N; j++) {\n\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\n\t\t\t\tint gor_gor_lev;\n\t\t\t\tint gor_lev;\n\t\t\t\tint dol_lev;\n\t\t\t\tint dol_dol_lev;\n\t\t\t\tint levo;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif (plosca[i - 1][j].polje == Polje.PRAZNO && plosca[i][j - 1].polje == Polje.PRAZNO) {\n\t\t\t\t\t\tgor_gor_lev = tabela_dolzin_modri[i - 1][j - 1].vrednost;\n\t\t\t\t\t}\n\t\t\t\t\telse gor_gor_lev = POLNO;\n\t\t\t\t} catch (ArrayIndexOutOfBoundsException e) { gor_gor_lev = POLNO; }\n\t\t\t\t\n\t\t\t\ttry { gor_lev = tabela_dolzin_modri[i][j - 1].vrednost; } \n\t\t\t\tcatch (ArrayIndexOutOfBoundsException e) { gor_lev = POLNO; }\n\t\t\t\ttry { dol_lev = tabela_dolzin_modri[i + 1][j - 1].vrednost; } \n\t\t\t\tcatch (ArrayIndexOutOfBoundsException e) { dol_lev = POLNO; }\n\t\t\t\ttry {\n\t\t\t\t\tif (plosca[i + 1][j - 1].polje == Polje.PRAZNO && plosca[i + 1][j].polje == Polje.PRAZNO) {\n\t\t\t\t\t\tdol_dol_lev = tabela_dolzin_modri[i + 2][j - 1].vrednost;\n\t\t\t\t\t}\n\t\t\t\t\telse dol_dol_lev = POLNO;\n\t\t\t\t} catch (ArrayIndexOutOfBoundsException e) { dol_dol_lev = POLNO; }\n\t\t\t\ttry {\n\t\t\t\t\tif (plosca[i + 1][j - 1].polje == Polje.PRAZNO && plosca[i][j - 1].polje == Polje.PRAZNO) {\n\t\t\t\t\t\tlevo = tabela_dolzin_modri[i + 1][j - 2].vrednost;\n\t\t\t\t\t}\n\t\t\t\t\telse levo = POLNO;\n\t\t\t\t} catch (ArrayIndexOutOfBoundsException e) { levo = POLNO; }\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tVrednost pointer = null;\n\t\t\t\tSkok skok = null;\n\t\t\t\tint vrednost_polja;\n\t\t\t\tvrednost_polja = Math.min(gor_gor_lev, Math.min(gor_lev, Math.min(dol_lev, Math.min(dol_dol_lev, levo))));\n\t\t\t\t\n\t\t\t\tif (vrednost_polja != POLNO) {\n\t\t\t\t\tif (vrednost_polja == gor_gor_lev) {\n\t\t\t\t\t\tpointer = tabela_dolzin_modri[i - 1][j - 1];\n\t\t\t\t\t\tskok = Skok.Skok1;\n\t\t\t\t\t}\n\t\t\t\t\tif (vrednost_polja == gor_lev) pointer = tabela_dolzin_modri[i][j - 1];\n\t\t\t\t\tif (vrednost_polja == dol_lev) pointer = tabela_dolzin_modri[i + 1][j - 1];\n\t\t\t\t\tif (vrednost_polja == dol_dol_lev) {\n\t\t\t\t\t\tpointer = tabela_dolzin_modri[i + 2][j - 1];\n\t\t\t\t\t\tskok = Skok.Skok3;\n\t\t\t\t\t}\n\t\t\t\t\tif (vrednost_polja == levo) {\n\t\t\t\t\t\tpointer = tabela_dolzin_modri[i + 1][j - 2];\n\t\t\t\t\t\tskok = Skok.Skok2;\n\t\t\t\t\t}\n\t\t\t\t\tif (plosca[i][j].polje == Polje.PRAZNO) vrednost_polja += 1;\n\t\t\t\t\tif (plosca[i][j].polje == Polje.Rdec) vrednost_polja = POLNO;\n\t\t\t\t}\n\t\t\t\ttabela_dolzin_modri[i][j].vrednost = vrednost_polja;\n\t\t\t\ttabela_dolzin_modri[i][j].pointer = pointer;\n\t\t\t\ttabela_dolzin_modri[i][j].skok = skok;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// Ponovni pregled\n\t\t\tfor (int i = 0; i < N; i++) {\n\t\t\t\tint gor;\n\t\t\t\tint dol;\n\t\t\t\tint vrednost_polja = tabela_dolzin_modri[i][j].vrednost;\n\t\t\t\tVrednost pointer = tabela_dolzin_modri[i][j].pointer;\n\t\t\t\tSkok skok = tabela_dolzin_modri[i][j].skok;\n\t\t\t\tVrednost nov_pointer = pointer;\n\t\t\t\t\n\t\t\t\ttry { gor = tabela_dolzin_modri[i - 1][j].vrednost; } \n\t\t\t\tcatch (ArrayIndexOutOfBoundsException e) { gor = POLNO; }\n\t\t\t\ttry { dol = tabela_dolzin_modri[i + 1][j].vrednost; } \n\t\t\t\tcatch (ArrayIndexOutOfBoundsException e) { dol = POLNO; }\n\t\t\t\t\n\t\t\t\tif (dol != POLNO && dol < vrednost_polja) {\n\t\t\t\t\tif (plosca[i][j].polje == Polje.Moder) vrednost_polja = dol;\n\t\t\t\t\tif (plosca[i][j].polje == Polje.PRAZNO) vrednost_polja = dol + 1;\n\t\t\t\t\tnov_pointer = tabela_dolzin_modri[i + 1][j];\n\t\t\t\t\tskok = null;\n\t\t\t\t}\n\t\t\t\tif (gor != POLNO && gor < vrednost_polja) {\n\t\t\t\t\tif (plosca[i][j].polje == Polje.Moder) vrednost_polja = gor;\n\t\t\t\t\tif (plosca[i][j].polje == Polje.PRAZNO) vrednost_polja = gor + 1;\n\t\t\t\t\tnov_pointer = tabela_dolzin_modri[i - 1][j];\n\t\t\t\t\tskok = null;\n\t\t\t\t}\n\t\t\t\ttabela_dolzin_modri[i][j].vrednost = vrednost_polja;\n\t\t\t\ttabela_dolzin_modri[i][j].pointer = nov_pointer;\n\t\t\t\ttabela_dolzin_modri[i][j].skok = skok;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Koncna vrednost\n\t\tint najmanjsa_modra = POLNO;\n\t\tVrednost pointer_modra = null;\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tint vrednost = tabela_dolzin_modri[i][N - 1].vrednost;\n\t\t\tif (najmanjsa_modra > vrednost) {\n\t\t\t\tnajmanjsa_modra = vrednost;\n\t\t\t\tpointer_modra = tabela_dolzin_modri[i][N - 1];\n\t\t\t}\t\n\t\t}\n\t\t\n\t\n\t\t// Izracun poti\n\t\tVrednost spremenljivka = pointer_modra;\n\t\twhile (spremenljivka != null) {\n\t\t\tmodra_pot.add(spremenljivka);\n\t\t\tspremenljivka = spremenljivka.pointer;\n\t\t}\n\t\t\n\t\treturn new Pot(najmanjsa_modra, modra_pot);\n\t}", "private BigDecimal calculaJuros(ParcelaRecebimento pagamento, long diasAtraso) {\n\t\tBigDecimal juros = pagamento.getParcelaReceber().getValor().multiply(pagamento.getTaxaJuro().setScale(5).divide(BigDecimal.valueOf(30.0), 5))\r\n\t\t\t\t.divide(BigDecimal.valueOf(100), 5).multiply(BigDecimal.valueOf(diasAtraso));\r\n\r\n\t\treturn juros.setScale(2, RoundingMode.HALF_DOWN);\r\n\t}", "public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\tint[] brojeviunizu = new int[512];\n\t\tdouble brojbrojevaunizu;\n\t\tint brojac=0;\n\t\tint zbir=0;\n\t\tSystem.out.println(\"\\nUnesite koliko brojeva zelite da bude u nizu: \");\n\t\tbrojbrojevaunizu = input.nextInt();\n\t\tSystem.out.print(\"\\n\");\n\t\tfor(brojac=0;brojac<brojbrojevaunizu;brojac++) {\n\t\t\tSystem.out.println(+(brojac+1)+\". element niza je: \");\n\t\t\tbrojeviunizu[brojac] = input.nextInt();\n\t\t}\n\t\tSystem.out.println(\"\\nElementi niza su: \\n\"); \n\t\tfor(brojac=0;brojac<brojbrojevaunizu;brojac++) \n\t\t{\n\t\tSystem.out.println((brojac+1)+\". broj u nizu je: \" +brojeviunizu[brojac]);\n\t\tzbir=zbir+brojeviunizu[brojac];\n\t\t}\n\t\tSystem.out.println(\"Ukupan zbir clanova niza je: \"+zbir);\n\t\tSystem.out.println(\"Prosek clanova niza je: \"+(zbir/brojbrojevaunizu));\n\t\tinput.close(); \n\t}", "public void calcularIndicePlasticidad(){\r\n\t\tindicePlasticidad = limiteLiquido - limitePlastico;\r\n\t}", "public void PerspektivischeProjektion(){\n /**\n * Abrufen der Koordinaten aus den einzelnen\n * Point Objekten des Objekts Tetraeder.\n */\n double[] A = t1.getTetraeder()[0].getPoint();\n double[] B = t1.getTetraeder()[1].getPoint();\n double[] C = t1.getTetraeder()[2].getPoint();\n double[] D = t1.getTetraeder()[3].getPoint();\n\n /*\n * Aufrufen der Methode sortieren\n */\n double[][] sP = cls_berechnen.sortieren(A, B, C, D);\n\n A = sP[0];\n B = sP[1];\n C = sP[2];\n D = sP[3];\n\n /*Wenn alle z Koordinaten gleich sind, ist es kein Tetraeder. */\n if (A[2] == D[2]) {\n System.out.println(\"kein Tetraeder\");\n return;\n }\n\n //Entfernung vom 'Center of projection' zur 'Projectoin plane'\n double d=5;\n\n /*\n * Transformiert x|y|z Koordinaten in x|y Koordinaten\n * mithilfer der perspektivischen Projektion\n */\n\n A[0]=A[0]/((A[2]+d)/d);\n A[1]=A[1]/((A[2]+d)/d);\n B[0]=B[0]/((B[2]+d)/d);\n B[1]=B[1]/((B[2]+d)/d);\n C[0]=C[0]/((C[2]+d)/d);\n C[1]=C[1]/((C[2]+d)/d);\n D[0]=D[0]/((D[2]+d)/d);\n D[1]=D[1]/((D[2]+d)/d);\n\n\n double ax, ay, bx, by, cx, cy, dx, dy;\n ax=A[0];\n ay=A[1];\n bx=B[0];\n by=B[1];\n cx=C[0];\n cy=C[1];\n dx=D[0];\n dy=D[1];\n\n tetraederzeichnen(ax, ay, bx, by, cx, cy, dx, dy);\n }", "public void dibujarse(Entorno entorno) \n\t{\n\t\t\n\t\t\t\tswitch(this.dibujo)\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\tcase 1: entorno.dibujarImagen(mario, x, y, 0, 0.7); \n\t\t\t\t\t\tbreak;\n\t\t\t\tcase 2:entorno.dibujarImagen(this.mariocorreder, x, y, 0, 0.7);\n\t\t\t\t\t break;\n\t\t\t\tcase 3:entorno.dibujarImagen(this.mariocorreizq, x, y, 0, 0.7);\n\t\t\t\t break; \n\t\t\t\tcase 4:entorno.dibujarImagen(this.mariosalta, x, y, 0, 0.7);\n\t\t\t\t break;\n\t\t\t\tcase 5: entorno.dibujarImagen(this.mariosalta, x, y, 0, 0.7);\n\t\t\t\t break;\n\t\t\t\tcase 6:entorno.dibujarImagen(this.mariosub, x, y, 0, 0.7);\n\t\t break; \n\t\t\t\tcase 8:entorno.dibujarImagen(this.mariocae, x, y, 0, 0.7);\n\t\t\t\t\t\tbreak;\n\t\t\t\tcase 9:entorno.dibujarImagen(this.mariosub, x, y,0, 0.7);\n\t\t\t\t\t\tbreak;\n\t\t\t\tcase 10:entorno.dibujarImagen(this.mariosub, x, y,0, 0.7);\n\t\t\t\t\t\tbreak;\n\t\t\t\tdefault:entorno.dibujarImagen(mario, x, y, 0, 0.7); \n\t\t\n\t\t\t\t}\n\t}", "private Map<String,Double> getPromedioHabilidades(Cuadrilla cuadrilla){\n\t\tSystem.out.println(\"#### getPromedioHabilidades ######\");\n\t\tdouble proprod= 0, protrae= 0, prodorm = 0, prodcaa = 0;\n\t\tint cantper = 0;\n\t\tfor (CuadrillasDetalle cd : cuadrilla.getCuadrillasDetalles()) {\n\t\t\t\n\t\t\tList<TecnicoCompetenciaDetalle> tcds = \tcd.getTecnico().getTecnicoCompetenciaDetalles();\n\t\t\tfor (TecnicoCompetenciaDetalle tcd : tcds) {\n\t\t\t\tInteger codigoComp = tcd.getCompetencia().getCodigoCompetencia();\n\t\t\t\tswitch(codigoComp){\n\t\t\t\t\tcase COMPETENCIA_PRODUCTIVIDAD:\n\t\t\t\t\t\tproprod = proprod+ tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase COMPETENCIA_TRABAJO_EQUIPO:\n\t\t\t\t\t\tprotrae = protrae + tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase COMPETENCIA_ORIENTACION_METAS:\n\t\t\t\t\t\tprodorm = prodorm + tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase COMPETENCIA_CALIDAD_ATENCION:\n\t\t\t\t\t\tprodcaa = prodcaa +tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcantper++;\t\t\t\n\t\t}\n\t\t\t\t\t\n\t\t// promedio de las competencias de los tenicos de cada cuadrilla\n\t\tproprod = proprod/cantper; \n\t\tprotrae = protrae/cantper;\n\t\tprodorm = prodorm/cantper;\n\t\tprodcaa = prodcaa/cantper;\n\n\t\tMap<String, Double> mpproms = new LinkedHashMap<String,Double>();\n\t\tmpproms.put(\"proprod\", proprod);\n\t\tmpproms.put(\"protrae\", protrae);\n\t\tmpproms.put(\"prodorm\", prodorm);\n\t\tmpproms.put(\"prodcaa\", prodcaa);\n\t\n\t\treturn mpproms;\n\t\t\n\t}", "private void moverJogadorAPosicao(int jogador, int valorDados, boolean iguais) {\n int tentativasDeSairDaPrisao = this.listaJogadores.get(jogadorAtual()).getTentativasSairDaPrisao();\n //Analisando se o cara esta preso, se a prisao ta ativada e se o cara tentou um numero de vezes menos que tres\n //ou se a funcao prisao esta falsa\n //ou se o jogador nao esta preso\n if ((JogadorEstaPreso(this.listaJogadores.get(jogadorAtual()).getNome()) && iguais && this.prisao == true && tentativasDeSairDaPrisao <= 2) || this.prisao == false || (!JogadorEstaPreso(this.listaJogadores.get(jogadorAtual()).getNome()) && this.prisao == true)) {\n if (JogadorEstaPreso(this.listaJogadores.get(jogadorAtual()).getNome()) && iguais && this.prisao == true && tentativasDeSairDaPrisao < 2);\n {\n this.sairdaPrisao(this.listaJogadores.get(jogadorAtual()));\n this.listaJogadores.get(jogadorAtual()).setTentativasSairDaPrisao(0);\n }\n this.posicoes[jogador] = (this.posicoes[jogador] + valorDados);\n if (posicoes[jogador] > 40) {\n posicoes[jogador] = posicoes[jogador] - 40;\n }\n }\n\n //analisando se o jogador esta preso e lanca numeros diferentes nos dados\n if (JogadorEstaPreso(this.listaJogadores.get(jogadorAtual()).getNome()) && !iguais && this.prisao == true) {\n //analisa se estourou as tentativas\n //se estourou\n if (this.listaJogadores.get(jogadorAtual()).getTentativasSairDaPrisao() == 2) {\n this.sairdaPrisao(this.listaJogadores.get(jogadorAtual()));\n this.listaJogadores.get(jogadorAtual()).retirarDinheiro(50);\n this.listaJogadores.get(jogadorAtual()).setTentativasSairDaPrisao(0);\n this.posicoes[jogador] = (this.posicoes[jogador] + valorDados);\n if (posicoes[jogador] > 40) {\n posicoes[jogador] = posicoes[jogador] - 40;\n }\n\n } //se nao estourou\n else if (this.listaJogadores.get(jogadorAtual()).getTentativasSairDaPrisao() < 2) {\n this.listaJogadores.get(jogadorAtual()).addTentativasSairDaPrisao();\n }\n\n\n }\n\n\n }", "public static void main(String[] args) {\n\t\t\tString nome;\n\t\t\tint prova \t\t= 5; \n\t\t\tint projeto\t\t= 3; \n\t\t\tint exercicio \t= 2;\n\t\t\tint qtdAlunos = 0;\n\t\t\tint nAprovados \t= 0;\n\t\t\tint nRprovados \t= 0;\n\t\t\tint nAf \t\t= 0;\n\t\t\tdouble nota1,nota2,nota3,notaAf,sem1,sem2;\n\t\t\tdouble mediaGeral = 0;\n\t\t\tdouble menor = 0;\n\t\t\tdouble maior=0;\n\t\t\tdouble bim1=0;\n\t\t\tdouble bim2=0;\n\n\t\t\t\n\t\t\t\n\t\t\tScanner Al = new Scanner(System.in);\n\t\t\tSystem.out.print(\"Informe o numero de alunos.\");\n\t\t\tqtdAlunos = Al.nextInt();\n\t\t\tString [][]alunos = new String[qtdAlunos][3];\n\t\t\n\t\t\t\n\t\t\tScanner Nota = new Scanner(System.in);\n\t\t\tsem1=0;\n\t\t\tsem2=0;\n\t\t\tScanner Al2 = new Scanner(System.in);\n\t\t\tSystem.out.println(\"Informe a Disciplina para lançamento das notas:\t \");\n\t\t\t\n\t\t\tString disciplina = Al2.nextLine();\n\n\t\t\t\tfor(int x=0;x < qtdAlunos;x++){\n\t\t\t\t\tnota1=0;\n\t\t\t\t\tnota2=0;\n\t\t\t\t\tnota3=0;\n\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Informe o Nome do Aluno\t \");\n\t\t\t\t\tnome = Al2.nextLine();\n\t\t\t\t\t\n\t\t\t\t\tfor(int y=1;y<=4;y++) {\n\t\t\t\t\t\tSystem.out.println(\"*************************************************************\");\n\t\t\t\t\t\tSystem.out.println(\"* \"+y+\"° Bimestre *\");\n\t\t\t\t\t\tSystem.out.println(\"*************************************************************\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.print(\"Informe a Nota da Prova\t \");\n\t\t\t\t\t\tnota1 = Nota.nextDouble();\n\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.print(\"Informe a Nota do Projeto\t \");\n\t\t\t\t\t\tnota2 = Nota.nextDouble();\n\n\t\t\t\t\t\tSystem.out.print(\"Informe a Nota do Exercício \");\n\t\t\t\t\t\tnota3= Nota.nextDouble();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(y==1) {\n\t\t\t\t\t\t\tbim1=((nota1*prova)+(nota2*projeto)+(nota3*exercicio))/(prova+projeto+exercicio);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tbim2=((nota1*prova)+(nota2*projeto)+(nota3*exercicio))/(prova+projeto+exercicio);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(y==2) {\n\t\t\t\t\t\t\tsem1=(bim1+bim2)/2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(y==4) {\n\t\t\t\t\t\t\tsem2=(bim1+bim2)/2;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif((sem1+sem2)/2 < 5 ) {\n\t\t\t\t\t\t\t\tSystem.out.println(\"Aluno reprovado \");\n\t\t\t\t\t\t\t\t//reprovado\n\t\t\t\t\t\t\t\talunos[x][0]= nome;\n\t\t\t\t\t\t\t\talunos[x][1]= Double.toString((sem1+sem2)/2);\n\t\t\t\t\t\t\t\talunos[x][2]= \"Reprovado\";\t\t\n\t\t\t\t\t\t\t\tnRprovados=nRprovados+1;\n\t\t\t\t\t\t\t}else if((sem1+sem2)/2 > 5 && (sem1+sem2)/2<=7.9 ){\n\t\t\t\t\t\t\t\tSystem.out.println(\"Aluno Necessita realiar a AF \");\n\t\t\t\t\t\t\t\tSystem.out.println(\"Nota Necessaria para Aprovacao: \"+ Math.round((10+(-(sem1+sem2)/2))* 100.0)/100.0);\n\t\t\t\t\t\t\t\tSystem.out.println(\"Informe a Nota da AF \");\n\t\t\t\t\t\t\t\tnotaAf = Nota.nextDouble();\n\t\t\t\t\t\t\t\tnAf=nAf+1;\n\t\t\t\t\t\t\t\tif(notaAf<(10+(-(sem1+sem2)/2))) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\talunos[x][0]= nome;\n\t\t\t\t\t\t\t\t\talunos[x][1]= Double.toString(notaAf);\n\t\t\t\t\t\t\t\t\talunos[x][2]= \"Reprovado - AF\";\t\n\t\t\t\t\t\t\t\t\tnRprovados=nRprovados+1;\n\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\talunos[x][0]= nome;\n\t\t\t\t\t\t\t\t\talunos[x][1]= Double.toString(notaAf);\n\t\t\t\t\t\t\t\t\talunos[x][2]= \"Aprovado -AF\";\t\t\n\t\t\t\t\t\t\t\t\tnAprovados=nAprovados+1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\talunos[x][0]= nome;\n\t\t\t\t\t\t\t\talunos[x][1]= Double.toString(Math.round(((sem1+sem2)/2)* 100.0)/100.0);\n\t\t\t\t\t\t\t\talunos[x][2]= \"Aprovado\";\t\n\t\t\t\t\t\t\t\tnAprovados=nAprovados+1;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\t\tif(menor==0 || Double.parseDouble(alunos[x][1])< menor) {\n\t\t\t\t\t\t\t\tmenor=Double.parseDouble(alunos[x][1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(maior==0 || Double.parseDouble(alunos[x][1])> maior){\n\t\t\t\t\t\t\t\tmaior=Double.parseDouble(alunos[x][1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmediaGeral+=Double.parseDouble(alunos[x][1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \");\n\t\t\t\tSystem.out.println(\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \");\n\t\t\t\tSystem.out.println(\"#############################################################\");\n\t\t\t\tSystem.out.println(\"# Disciplina : \"+disciplina+\" \");\n\t\t\t\tSystem.out.println(\"#============================================================\");\n\t\t\t\tSystem.out.println(\"# Entrada de Dados dos alunos \");\n\t\t\t\tSystem.out.println(\"#============================================================\");\n\t\t\t\tSystem.out.println(\"# Quantidade de Alunos :\"+qtdAlunos+\" \");\n\t\t\t\tSystem.out.println(\"#============================================================\");\n\t\t\t\tSystem.out.println(\"#\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \");\n\t\t\t\tSystem.out.println(\"# Menor Nota :\"+menor+\" \");\n\t\t\t\tSystem.out.println(\"# Maior Nota :\"+maior+\" \");\n\t\t\t\tSystem.out.println(\"#\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \");\n\t\t\t\tSystem.out.println(\"#Numero de Aprovados :\"+nAprovados+\"\t\t\t\t\t\t \");\n\t\t\t\tSystem.out.println(\"#Numero de Reprovados:\"+nRprovados+\"\t\t\t\t\t\t \");\n\t\t\t\tSystem.out.println(\"#Numero de AF :\"+nAf+\"\t\t\t\t\t\t\t\t \");\n\t\t\t\tSystem.out.println(\"#===========================================================#\");\n\t\t\t\tSystem.out.println(\"# Média Turma :\"+Math.round(((mediaGeral/qtdAlunos)* 100.0)/100.0));\n\t\t\t\tSystem.out.println(\"#===========================================================#\");\t\t\t\n\t\t\t\tSystem.out.println(\"#===========================================================#\");\n\t\t\t\tSystem.out.println(\"#...................Lista dos Alunos........................#\");\n\t\t\t\tSystem.out.println(\"#===========================================================#\");\n\t\t\t\tSystem.out.println(\"#############################################################\");\n\t\t\t\tSystem.out.println(\"Nome: |Nota |Status \");\n\t\t\t\tSystem.out.println(\"-------------------------------------------------------------\");\n\t\t\t\t\n\t\t\t\tfor(int i=0;i<alunos.length;i++){\n\t\t\t\t\tSystem.out.println(alunos[i][0].length()<= 29 ? String.format (\"%-29.29s\",alunos[i][0]) +\"|\"+ String.format (\"%-14.14s\",alunos[i][1])+\"|\"+ alunos[i][2] : alunos[i][0].substring(0, 29) +\"|\"+ alunos[i][1]+\"|\"+ alunos[i][2] );\t\n\n\t\t\t\t}\n\t\t\t\tAl.close();\n\t\t\t\tAl2.close();\n\t\t\t\tNota.close();\n\t\t\n\t}", "public void ganarDineroPorAutomoviles() {\n for (Persona p : super.getMundo().getListaDoctores()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaCocineros()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaAlbaniles()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaHerreros()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaCocineros()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n }", "private int pasarMilisegundoASegundo( long milisegundos )\n {\n return (int)(milisegundos/MILISEGUNDOS_EN_SEGUNDO);\n }", "public void jugarMaquinaSola(int turno) {\n if (suspenderJuego) {\n return;\n }\n CuadroPieza cuadroActual;\n CuadroPieza cuadroDestino;\n CuadroPieza MovDestino = null;\n CuadroPieza MovActual = null;\n for (int x = 0; x < 8; x++) {\n for (int y = 0; y < 8; y++) {\n cuadroActual = tablero[x][y];\n if (cuadroActual.getPieza() != null) {\n if (cuadroActual.getPieza().getColor() == turno) {\n for (int x1 = 0; x1 < 8; x1++) {\n for (int y1 = 0; y1 < 8; y1++) {\n cuadroDestino = tablero[x1][y1];\n if (cuadroDestino.getPieza() != null) {\n if (cuadroActual.getPieza().validarMovimiento(cuadroDestino, this)) {\n if (MovDestino == null) {\n MovActual = cuadroActual;\n MovDestino = cuadroDestino;\n } else {\n if (cuadroDestino.getPieza().getPeso() > MovDestino.getPieza().getPeso()) {\n MovActual = cuadroActual;\n MovDestino = cuadroDestino;\n }\n if (cuadroDestino.getPieza().getPeso() == MovDestino.getPieza().getPeso()) {\n //Si es el mismo, elijo al azar si moverlo o no\n if (((int) (Math.random() * 3) == 1)) {\n MovActual = cuadroActual;\n MovDestino = cuadroDestino;\n }\n }\n }\n }\n\n }\n }\n }\n }\n }\n }\n }\n if (MovActual == null) {\n boolean b = true;\n do {//Si no hay mov recomendado, entonces genero uno al azar\n int x = (int) (Math.random() * 8);\n int y = (int) (Math.random() * 8);\n tablero[x][y].getPieza();\n int x1 = (int) (Math.random() * 8);\n int y1 = (int) (Math.random() * 8);\n\n MovActual = tablero[x][y];\n MovDestino = tablero[x1][y1];\n if (MovActual.getPieza() != null) {\n if (MovActual.getPieza().getColor() == turno) {\n b = !MovActual.getPieza().validarMovimiento(MovDestino, this);\n //Si mueve la pieza, sale del while.\n }\n }\n } while (b);\n }\n if (MovActual.getPieza().MoverPieza(MovDestino, this)) {\n this.setTurno(this.getTurno() * -1);\n if (getRey(this.getTurno()).isInJacke(this)) {\n if (Pieza.isJugadorAhogado(turno, this)) {\n JOptionPane.showMessageDialog(null, \"Hacke Mate!!! - te lo dije xD\");\n if (JOptionPane.showConfirmDialog(null, \"Deseas Empezar una nueva Partida¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n suspenderJuego = true;\n }\n return;\n } else {\n JOptionPane.showMessageDialog(null, \"Rey en Hacke - ya t kgste\");\n }\n } else {\n if (Pieza.isJugadorAhogado(turno, this)) {\n JOptionPane.showMessageDialog(null, \"Empate!!!\\nComputadora: Solo por que te ahogaste...!!!\");\n if (JOptionPane.showConfirmDialog(null, \"Deseas Empezar una nueva Partida¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n suspenderJuego = true;\n }\n return;\n }\n if (Pieza.getCantMovimientosSinCambios() >= 50) {\n JOptionPane.showMessageDialog(null, \"Empate!!! \\nComputadora: Vaya, han pasado 50 turnos sin comernos jeje!!!\");\n if (JOptionPane.showConfirmDialog(null, \"Otra Partida Amistosa¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n suspenderJuego = true;\n }\n return;\n }\n }\n }\n if (this.getTurno() == turnoComputadora) {\n jugarMaquinaSola(this.getTurno());\n }\n }", "void evoluer()\n {\n int taille = grille.length;\n int nbVivantes = 0;\n for(int i=-1; i<2; i++)\n {\n int xx = ((x+i)+taille)%taille; // si x+i=-1, xx=taille-1. si x+i=taille, xx=0\n for(int j=-1; j<2; j++)\n {\n if (i==0 && j==0) continue;\n int yy = ((y+j)+taille)%taille;\n if (grille[xx][yy].vivante) nbVivantes++;\n }\n }\n if (nbVivantes<=1 || nbVivantes>=4) {vientDeChanger = (vivante==true); vivante = false;}\n if (nbVivantes==3) {vientDeChanger = (vivante==false); vivante = true;}\n }", "public void aggiungiPiatto(String nome_piatto, double prezzo_piatto, int porzioni) {\n\t\tPiatto nuovo_piatto= new Piatto(nome_piatto,prezzo_piatto, porzioni);\n\t\tquantita.add(nuovo_piatto);\n\t\tquantita.sort();\n\t}", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\r\n\t\t\r\n\t\t/*\r\n\t\t * Exercicio 1\r\n\t\t*/\r\n\t\t\r\n\t\tint c = 0;\r\n\t\tint s = 1;\r\n\t\tint f = 0;\r\n\t\tint b = 0;\r\n\t\t\r\n\t\twhile( c < 8 ) {\r\n\t\t\t\r\n\t\t\tb = f + s;\r\n\t\t\tf = s;\r\n\t\t\ts = b;\r\n\t\t\tc++;\r\n\t\t\tSystem.out.println(b);\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t * Exercicio 2\r\n\t\t */\r\n\t\t\r\n\t\tdouble[][] notas = new double[6][2];\r\n\t\tSystem.out.println(\"Digite a notas dos 6 alunos, em ordem (primeiro aluno: primeira nota depois segunda nota)\");\r\n\t\tfor(int i = 0; i <6; i++) {\r\n\t\t\tfor(int j = 0; i <2; i++) {\r\n\t\t\t\tnotas[i][j] = scan.nextDouble();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i = 0; i < 6; i++) {\r\n\t\t\tdouble m = (notas[i][0] + notas[i][1]) / 2;\r\n\t\t\tnotas[i][2] = m;\r\n\t\t\tSystem.out.println(notas[i][2]);\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i = 0; i < 6; i++) {\r\n\t\t\tSystem.out.println(notas[i][2] >= 6 ? \"Aluno \"+(i)+\" Passou\" : \"Aluno \"+(i)+\" Recuperação\");\r\n\t\t}\r\n\t\t\r\n\t\tint a = 0;\r\n\t\t\r\n\t\tfor(int i = 0; i < 6; i++) {\r\n\t\t\tif(notas[i][2] >= 6) {\r\n\t\t\t\ta++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(a+\" Alunos passaram\");\r\n\t\t\r\n\t\tint d = 0;\r\n\t\t\r\n\t\tfor(int i = 0; i < 6; i++) {\r\n\t\t\tif(notas[i][2] <= 3) {\r\n\t\t\t\td++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(d+\" Alunos reprovaram\");\r\n\t\t\r\n\t\tint e = 0;\r\n\t\t\r\n\t\tfor(int i = 0; i < 6; i++) {\r\n\t\t\tif((notas[i][2] <= 6)||(notas[i][2] >= 3)) {\r\n\t\t\t\te++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(e+\" Alunos de recuperação\");\r\n\t\t\r\n\t\tdouble g = 0;\r\n\t\t\r\n\t\tfor(int i = 0; i < 6; i++) {\r\n\t\t\tg = g + notas[i][2];\r\n\t\t}\r\n\t\tSystem.out.println(\"Media da sala: \"+g/6);\r\n\t\t\r\n\t\t/*\r\n\t\t * Exercicio 3\r\n\t\t */\r\n\t\t\r\n\t\tboolean prime = true;\r\n\t\tSystem.out.println(\"Insira o numero que desejas saber se é primo ou não (inteiro positivo) \");\r\n\t\tint h = scan.nextInt();\r\n\t\tfor(int i = 2; i <= h; i ++) {\r\n\t\t\tif( (h % i == 0) && (i != h) ) {\r\n\t\t\t\tprime = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(prime)\r\n\t\t\tSystem.out.print(\"O numero \"+h+\" é primo\");\r\n\t\telse\r\n\t\t\tSystem.out.print(\"O numero \"+h+\" não é primo\");\r\n\t\t\r\n\t\t/*\r\n\t\t * Exercicio 4\r\n\t\t */\r\n\t\t\r\n\t\tSystem.out.println(\"Insira notas dos alunos (Ordem: Primeira nota, segunda nota, presença)\");\r\n\t\tint[][] Sala = new int[5][3];\r\n\t\tfor(int i = 0; i < 5; i++) {\r\n\t\t\tfor(int j = 0; j < 3; j++) {\r\n\t\t\t\tSala[i][j] = scan.nextInt();\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < 5; i++) {\r\n\t\t\tif((Sala[i][0] + Sala[i][1] >= 6) && (Sala[i][2] / 18 >= 0.75)){\r\n\t\t\t\tSystem.out.println(\"Aluno \"+i+\" aprovado\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(\"Aluno \"+i+\" reprovado\");\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t * Exercicio 5\r\n\t\t */\r\n\t\t\r\n\t\tint[] first = {1,2,3,4,5,};\r\n\t\tint[] second = {10,9,8,7,6,5,4,3,2,1,};\r\n\t\tint[][] third = {{1,2,3,},\r\n\t\t\t\t\t {4,5,6},\r\n\t\t\t\t\t {7,8,9},\r\n\t\t\t\t\t {10,11,12}};\r\n\t\tint[][] fourth = new int[4][3]; \r\n\t\tint m = 0;\r\n\t\t//If they were random numbers, would i need to use the lowest integer? or just be clever\r\n\t\tint n = 1;\r\n\t\t\r\n\t\tfor(int i = 0; i < first.length; i++) {\r\n\t\t\tif(first[i] > m)\r\n\t\t\t\tm = first[i];\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i = 0; i < second.length; i++) {\r\n\t\t\tif(second[i] < n)\r\n\t\t\t\tn = second[i];\r\n\t\t}\r\n\t\t\r\n\t\tint x = n*m;\r\n\t\tint k = 0;\r\n\t\tint l = 0;\r\n\t\tint o = 0;\r\n\t\tint p = 0;\r\n\t\t\r\n\t\tfor(int i = 0; i < 4; i ++) {\r\n\t\t\tfor(int j = 0; j < 3; j++) {\r\n\t\t\t\tfourth[i][j] = third[i][j] + x;\r\n\t\t\t\r\n\t\t\t\tif(fourth[0][j] % 2 == 0) {\r\n\t\t\t\t\tk += fourth[0][j]; \r\n\t\t\t\t}\r\n\t\t\t\tif(fourth[1][j] % 2 == 0) {\r\n\t\t\t\t\tl += fourth[1][j];\r\n\t\t\t\t}\t\r\n\t\t\t\tif(fourth[0][j] % 2 == 0) {\r\n\t\t\t\t\to += fourth[2][j];\r\n\t\t\t\t}\r\n\t\t\t\tif(fourth[3][j] % 2 == 0) {\r\n\t\t\t\t\tp += fourth[3][j];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t * Exercicio 6\r\n\t\t */\r\n\t\t\r\n\t\tboolean[][] assentos = new boolean[2][5];\r\n\t\tfor(int i = 0; i < 2; i++) {\r\n\t\t\tfor(int j = 0; j < 5; j++) {\r\n\t\t\t\tassentos[i][j] = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tscan.close();\r\n\t}", "public void gastarDinero(double cantidad){\r\n\t\t\r\n\t}", "private double hitungG_pelukis(){\r\n return Math.sqrt(Math.pow(super.getRadius(),2)+Math.pow(tinggi,2));\r\n }", "public Nodo espaciosJustos(Nodo nodo){\n System.out.println(\"----------------inicio heuristica espaciosJustos--------------\");\n Operadores operadores = new Operadores();\n //variables de matriz\n int numFilas,numColumnas,numColores;\n \n numColumnas = nodo.getnColumnas();\n numFilas = nodo.getnFilas();\n numColores = nodo.getnColores();\n \n String [][] matriz = new String [numFilas][numColumnas];\n matriz = operadores.clonarMatriz(nodo.getMatriz());\n //-------------------\n \n //variables de filas y columnas\n ArrayList<ArrayListColumna> columnas = new ArrayList<ArrayListColumna>();\n columnas = (ArrayList<ArrayListColumna>)nodo.getColumnas();\n \n ArrayList<ArrayListFila> filas = new ArrayList<ArrayListFila>();\n filas = (ArrayList<ArrayListFila>)nodo.getFilas();\n //---------------------------\n \n ArrayListFila auxListFila = new ArrayListFila();\n ArrayListColumna auxListColumna = new ArrayListColumna();\n \n int cambio=1;\n int changue=0;\n while(cambio!=0){\n cambio=0;\n \n nodo.setCambio(0);\n for(int i=0;i<numFilas;i++){\n auxListFila = (ArrayListFila)filas.get(i);\n for(int j=0;j<numColores;j++){\n Color auxColor = new Color();\n auxColor = auxListFila.getColor(j);\n\n if(auxColor.getNumero() > 0){\n int contador=0;\n for(int c=0;c<numColumnas;c++){\n auxListColumna=(ArrayListColumna)columnas.get(c);\n\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListColumna.getColor(j1);\n if(auxColor1.getNumero() > 0){\n if(auxColor.getColor().equals(auxColor1.getColor()) && operadores.isPosicionVaciaFila(nodo.getMatriz(), i, c)){\n contador++;\n }\n }\n }\n }\n \n if(auxColor.getNumero() == contador){\n changue=1;\n cambio=1;\n auxColor.setNumero(0);\n for(int c=0;c<numColumnas;c++){\n auxListColumna=(ArrayListColumna)columnas.get(c);\n\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListColumna.getColor(j1);\n if(auxColor1.getNumero() > 0){\n if(auxColor.getColor().equals(auxColor1.getColor()) && operadores.isPosicionVaciaFila(nodo.getMatriz(), i, c)){\n \n auxColor1.setNumero(auxColor1.getNumero()-1);\n\n matriz = operadores.pintarPosicion(matriz, i, c, auxColor.getColor());\n\n nodo.setMatriz(matriz);\n }\n }\n }\n }\n System.out.println(\"-----\");\n operadores.imprimirMatriz(nodo.getMatriz());\n System.out.println(\"-----\");\n \n \n }\n }\n }\n }\n \n }\n if(changue==1) nodo.setCambio(1);\n System.out.println(\"----------------fin heuristica espaciosJustos-------------- \");\n return (Nodo)nodo;\n }", "public static void main(String[] args) {\n int numeros[] = {2, 3, 4, 2, 4, 5, 6, 2, 1, 2};\n //Creamos segundo arreglo con iguall tamaño que el arreglo nùmeros\n int cuadrados[] = new int[numeros.length];\n //Arreglo para almacenar el proceso de la operación\n String procesos[] = new String[numeros.length];\n //Creamos ciclo de repeticiòn para recorrer arreglo \n for (int indice = 0; indice < numeros.length; indice++) {\n int cuadrado = numeros[indice] * numeros[indice];\n //Almacenamos el proceso de la opreaciòn en el arreglo cuadrados\n cuadrados[indice] = cuadrado;\n \n //Almacenar resultado en el arreglo procesos\n procesos[indice] = numeros[indice] + \"x\" + numeros[indice];\n }\n //Ciclo de repetición para mostrar arreglos\n String print_numeros = \"numeros - \";\n String print_cuadrados = \"cuadrados - \";\n String print_procesos = \"procesoss - \";\n for (int indice = 0; indice < numeros.length; indice++) {\n print_numeros = print_numeros + numeros[indice] + \", \";\n print_cuadrados = print_cuadrados + cuadrados[indice] + \", \";\n print_procesos = print_procesos + procesos[indice] + \", \";\n\n }\n System.out.println(print_numeros);\n System.out.println(print_cuadrados);\n System.out.println(print_procesos);\n \n //suma solo numeros pares\n int acumulador_pares=0;\n for (int indice = 0; indice < 10; indice++) {\n boolean par= detectar_par(numeros[indice]);\n if (par == true) {\n acumulador_pares = acumulador_pares + numeros[indice];\n \n }\n }\n System.out.println(\"La suma de los nùmeros pares es: \"+acumulador_pares);\n \n }", "public void peluangKelasterhadapFitur() {\n fakultas[0]=gaussFK[0]*gaussFK[1]*gaussFK[2]*gaussFK[3]*gaussFK[4]*gaussFK[5]*gaussFK[6]*gaussFK[7]*gaussFK[8]*gaussFK[9];\n fakultas[1]=gaussFILKOM[0]*gaussFILKOM[1]*gaussFILKOM[2]*gaussFILKOM[3]*gaussFILKOM[4]*gaussFILKOM[5]*gaussFILKOM[6]*gaussFILKOM[7]*gaussFILKOM[8]*gaussFILKOM[9];\n fakultas[2]=gaussFT[0]*gaussFT[1]*gaussFT[2]*gaussFT[3]*gaussFT[4]*gaussFT[5]*gaussFT[6]*gaussFT[7]*gaussFT[8]*gaussFT[9];\n fakultas[3]=gaussFMIPA[0]*gaussFMIPA[1]*gaussFMIPA[2]*gaussFMIPA[3]*gaussFMIPA[4]*gaussFMIPA[5]*gaussFMIPA[6]*gaussFMIPA[7]*gaussFMIPA[8]*gaussFMIPA[9];\n fakultas[4]=gaussFP[0]*gaussFP[1]*gaussFP[2]*gaussFP[3]*gaussFP[4]*gaussFP[5]*gaussFP[6]*gaussFP[7]*gaussFP[8]*gaussFP[9];\n fakultas[5]=gaussFPT[0]*gaussFPT[1]*gaussFPT[2]*gaussFPT[3]*gaussFPT[4]*gaussFPT[5]*gaussFPT[6]*gaussFPT[7]*gaussFPT[8]*gaussFPT[9];\n fakultas[6]=gaussFTP[0]*gaussFTP[1]*gaussFTP[2]*gaussFTP[3]*gaussFTP[4]*gaussFTP[5]*gaussFTP[6]*gaussFTP[7]*gaussFTP[8]*gaussFTP[9];\n fakultas[7]=gaussFPIK[0]*gaussFPIK[1]*gaussFPIK[2]*gaussFPIK[3]*gaussFPIK[4]*gaussFPIK[5]*gaussFPIK[6]*gaussFPIK[7]*gaussFPIK[8]*gaussFPIK[9];\n fakultas[8]=gaussNon[0]*gaussNon[1]*gaussNon[2]*gaussNon[3]*gaussNon[4]*gaussNon[5]*gaussNon[6]*gaussNon[7]*gaussNon[8]*gaussNon[9];\n }", "public void popier() {\n Scanner input1 = new Scanner(System.in);\n //Ivedame vaiku skaiciu\n Scanner input2 = new Scanner(System.in);\n //Idame tevu skaiciu\n Scanner input3 = new Scanner(System.in);\n\n System.out.println(\"Iveskite atlyginimą ant popieriaus: \");\n double atlyginimas = input1.nextDouble();\n\n System.out.println(\"Iveskite turimų vaikų iki 18 metų skaičių.\");\n int vaikai = input2.nextInt();\n if (vaikai == 0) {\n\n //Apskaiciuojame NPD\n double npd = 310 - 0.5 * (atlyginimas - 380);\n if (npd >= 0)\n System.out.println(\"NPD: \" + npd);\n else\n System.out.println(\"NPD: \" + 0);\n\n //Bendras NPD\n double bnpd = npd;\n System.out.println(\"Bendras NPD: \" + bnpd);\n\n //Darbuotojo mokesciai\n System.out.println(\"\\nDarboutojo mokesčiai:\");\n\n //Apskaiciuojame GPM\n //Gauname neapmokestinama dali\n double nep = atlyginimas - bnpd;\n\n //GPM 15%\n double gpm = nep * 1.15 - nep;\n System.out.printf(\"Pajamu mokestis (GPM): %.2f %n\", gpm);\n\n //Apskaiciuojame PSD 6%\n double psd = atlyginimas * 1.06 - atlyginimas;\n System.out.printf(\"Sveikatos draudimas (PSD): %.2f %n\", psd);\n\n //Apskaiciuojame pensija ir soc draudima 3%\n double soc = atlyginimas * 1.03 - atlyginimas;\n System.out.printf(\"Pensijų ir soc. Draudimas: %.2f %n\", soc);\n\n\n //Darbdavio mokesciai\n System.out.println(\"\\nDabdavio mokami mokesčiai:\");\n\n //Sodros imoka 30.98%\n double sod = atlyginimas * 1.3098 - atlyginimas;\n System.out.printf(\"Sodros įmoka (VSD): %.2f %n\", sod);\n\n // Imoka i garantini fonda 0.2%\n double gar = atlyginimas * 1.002 - atlyginimas;\n System.out.printf(\"Įmokos į Garantinį fondą: %.2f %n\", gar);\n\n //Uzmokestis i rankas\n double rank = atlyginimas - gpm - psd - soc;\n System.out.printf(\"%nUžmokestis gaunamas į rankas: %.2f %n\", rank);\n\n //Darbo vietos kaina\n double viet = atlyginimas + sod + gar;\n System.out.printf(\"Darbo vietos kaina darbdaviui: %.2f\", viet);\n\n\n } else {\n\n System.out.println(\"Keliese auginate vaikus?\");\n int tevai = input3.nextInt();\n\n\n //Apskaiciuojame NPD\n double npd = 310 - 0.5 * (atlyginimas - 380);\n if (npd >= 0)\n System.out.println(\"NPD: \" + npd);\n else\n System.out.println(\"NPD: \" + 0);\n\n //Apskaiciuojame PNPD\n double pnpd = (200 * vaikai) / tevai;\n System.out.println(\"PNPD: \" + pnpd);\n\n //Bendras NPD\n double bnpd = npd + pnpd;\n System.out.println(\"Bendras NPD: \" + bnpd);\n\n //Darbuotojo mokesciai\n System.out.println(\"\\nDarboutojo mokesčiai:\");\n\n //Apskaiciuojame GPM\n //Gauname neapmokestinama dali\n double nep = atlyginimas - bnpd;\n\n //GPM 15%\n double gpm = nep * 1.15 - nep;\n System.out.printf(\"Pajamu mokestis (GPM): %.2f %n\", gpm);\n\n //Apskaiciuojame PSD 6%\n double psd = atlyginimas * 1.06 - atlyginimas;\n System.out.printf(\"Sveikatos draudimas (PSD): %.2f %n\", psd);\n\n //Apskaiciuojame pensija ir soc draudima 3%\n double soc = atlyginimas * 1.03 - atlyginimas;\n System.out.printf(\"Pensijų ir soc. Draudimas: %.2f %n\", soc);\n\n\n //Darbdavio mokesciai\n System.out.println(\"\\nDabdavio mokami mokesčiai:\");\n\n //Sodros imoka 30.98%\n double sod = atlyginimas * 1.3098 - atlyginimas;\n System.out.printf(\"Sodros įmoka (VSD): %.2f %n\", sod);\n\n // Imoka i garantini fonda 0.2%\n double gar = atlyginimas * 1.002 - atlyginimas;\n System.out.printf(\"Įmokos į Garantinį fondą: %.2f %n\", gar);\n\n //Uzmokestis i rankas\n double rank = atlyginimas - gpm - psd - soc;\n System.out.printf(\"%nUžmokestis gaunamas į rankas: %.2f %n\", rank);\n\n //Darbo vietos kaina\n double viet = atlyginimas + sod + gar;\n System.out.printf(\"Darbo vietos kaina darbdaviui: %.2f\", viet);\n\n }\n\n\n\n }", "public void hallarPerimetroEscaleno() {\r\n this.perimetro = this.ladoA+this.ladoB+this.ladoC;\r\n }", "public void calculEtatSuccesseur() { \r\n\t\tboolean haut = false,\r\n\t\t\t\tbas = false,\r\n\t\t\t\tgauche = false,\r\n\t\t\t\tdroite = false,\r\n\t\t\t\thautGauche = false,\r\n\t\t\t\tbasGauche = false,\r\n\t\t\t\thautDroit = false,\r\n\t\t\t\tbasDroit = false;\r\n\t\t\r\n\t\tString blanc = \" B \";\r\n\t\tString noir = \" N \";\r\n\t\tfor(Point p : this.jetonAdverse()) {\r\n\t\t\tString [][]plateau;\r\n\t\t\tplateau= copieEtat();\r\n\t\t\tint x = (int) p.getX();\r\n\t\t\tint y = (int) p.getY();\r\n\t\t\tif(this.joueurActuel.getCouleur() == \"noir\") { //dans le cas ou le joueur pose un pion noir\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(p.getY()>0 && p.getY()<plateau[0].length-1 && p.getX()>0 && p.getX()<plateau.length-1) { //on regarde uniquement le centre du plateaau \r\n\t\t\t\t\t//on reinitialise x,y et plateau a chaque étape\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tdroite = getDroite(x,y,blanc);\r\n\t\t\t\t\thaut = getHaut(x, y, blanc);\r\n\t\t\t\t\tbas = getBas(x, y, blanc);\r\n\t\t\t\t\tgauche = getGauche(x, y, blanc);\r\n\t\t\t\t\thautDroit = getDiagHautdroite(x, y, blanc);\r\n\t\t\t\t\thautGauche = getDiagHautGauche(x, y, blanc);\r\n\t\t\t\t\tbasDroit = getDiagBasDroite(x, y, blanc);\r\n\t\t\t\t\tbasGauche = getDiagBasGauche(x, y, blanc);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x][y-1]==noir) {//regarder si à gauche du pion blanc il y a un pion noir\r\n\r\n\t\t\t\t\t\t//on regarde si il est possible de poser un pion noir à droite\r\n\t\t\t\t\t\tif(droite) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//1\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x-1][y]==noir) {//regardre au dessus si le pion est noir\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(bas) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tplateau[x][y]= noir;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//2\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x][y+1]==noir) { //regarde a droite si le pion est noir\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(gauche) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y]= noir;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//3\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\tif(this.plateau[x+1][y] == noir) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(haut) {\r\n\t\t\t\t\t\t\t//System.out.println(\"regarde en dessous\");\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//4\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diaghautgauche\r\n\t\t\t\t\tif(this.plateau[x+1][y+1]==noir) {\r\n\t\t\t\t\t\tif(hautGauche) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//5\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diagbasGauche\r\n\t\t\t\t\tif(this.plateau[x-1][y+1]==noir) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(basGauche) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}//6\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diaghautDroit : OK!\r\n\t\t\t\t\tif(this.plateau[x+1][y-1]==noir) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(hautDroit) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}//7\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diagBasDroit\r\n\t\t\t\t\tif(this.plateau[x-1][y-1]==noir) {\r\n\t\t\t\t\t\tif(basDroit) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t\t//System.out.println(\"ajouté!\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//8\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse {//si le joueur actuel a les pions blanc\r\n\t\t\t\tif(p.getY()>0 && p.getY()<plateau[0].length-1 && p.getX()>0 && p.getX()<plateau.length-1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\tif(this.plateau[x][y-1]==blanc) {//regarder si à gauche du pion blanc il y a un pion noir\r\n\t\t\t\t\t\t//on regarde si il est possible de poser un pion noir à droite\r\n\t\t\t\t\t\tif(getDroite(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t}//1.1\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x-1][y]==blanc) {//regardre au dessus si le pion est noir\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(getBas(x, y, noir)) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tplateau[x][y]= blanc;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//2.2\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x][y+1]==blanc) { //regarde a droite si le pion est noir\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(getGauche(x, y, noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y]= blanc;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//3.3\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\tif(this.plateau[x+1][y] == blanc) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(getHaut(x, y, noir)) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//4.4\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diaghautgauche\r\n\t\t\t\t\tif(this.plateau[x+1][y+1]==blanc) {\r\n\t\t\t\t\t\tif(getDiagHautGauche(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]= blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//5.5\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diagbasGauche\r\n\t\t\t\t\tif(this.plateau[x-1][y+1]==blanc) {\r\n\t\t\t\t\t\tif(getDiagBasGauche(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//6.6\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diaghautDroit\r\n\t\t\t\t\tif(this.plateau[x+1][y-1]==blanc) {\r\n\t\t\t\t\t\tif(getDiagHautdroite(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}//7.7\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diagBasDroit\r\n\t\t\t\t\tif(this.plateau[x-1][y-1]==blanc) {\r\n\t\t\t\t\t\tif(getDiagBasDroite(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//8.8\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void dividirDineroGobierno() {\n\n double dineroDividible = super.getMundo().getGobierno().getCapitalEconomico() / 2;\n double dineroPorPersona = super.getMundo().contarPersonas();\n\n if (dineroDividible > 0) {\n\n super.getMundo().gobiernoDarDinero(dineroDividible);\n\n for (Persona p : super.getMundo().getListaDoctores())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaCocineros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaAlbaniles())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaHerreros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaCocineros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaDoctores())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaCocineros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaAlbaniles())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaHerreros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaCocineros())\n p.ganarDinero(dineroPorPersona);\n }\n }", "private void comerFantasma(Fantasma fantasma) {\n // TODO implement here\n }", "public BigDecimal calcolaImportoTotaleRilevanteIVASubdoumenti(){\n\t\tBigDecimal result = BigDecimal.ZERO;\n\t\tfor(SD ds : getListaSubdocumenti()) {\n\t\t\tif(Boolean.TRUE.equals(ds.getFlagRilevanteIVA())) {\n\t\t\t\tresult = result.add(ds.getImporto());\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tFap<Couple<Double, Integer>> sT = new FapTableau<>();\r\n\t\tFap<Couple<Double, Integer>> sL = new FapListe<>();\r\n\t\t\r\n\t\tRandom r = new Random();\r\n\t\tfor (int i=0 ; i<100 ; i++) {\r\n\t\t\ttry {\r\n\t\t\t\tSystem.out.println(\"sequenceL vide :\" + sL.estVide());\r\n\t\t\t\tSystem.out.println(\"sequenceT vide :\" + sT.estVide());\r\n\t\t\t\tassert(sL.estVide() == sT.estVide());\r\n\t\t\t\t\r\n\t\t\t\tif (r.nextBoolean()) {\r\n\t\t\t\t\tCouple<Double, Integer> a = new Couple<Double, Integer>(r.nextDouble(), r.nextInt(10));\r\n\t\t\t\t\t\tSystem.out.println(\"insertion de :\" + a);\r\n\t\t\t\t\t\tsL.insere(a);\r\n\t\t\t\t\t\tsT.insere(a);\r\n\t\t\t\t\t\r\n\t\t\t\t} else if (!sL.estVide()){\r\n\t\t\t\t\tCouple<Double, Integer> k1 = sL.extraire();\r\n\t\t\t\t\tCouple<Double, Integer> k2 = sT.extraire();\r\n\t\t\t\t\tassert(k1.equals(k2));\r\n\t\t\t\t\tSystem.out.println(\"suppression de :\" + k1);\r\n\t\t\t\t\tSystem.out.println(\"suppression de :\" + k2);\t\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}catch (Exception e) {\r\n\t\t\t\tSystem.out.println(e);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}", "private static int zamijeniDvijeKarte(int[] spil) {\n\t\tint prva =randomKarta (spil);\n\t\tint druga = randomKarta (spil);\n\t\tzamijeni (spil, prva, druga);\n\t\t\n\t\treturn spil, prva, druga;\n\t}", "public void calcularEntropia(){\n //Verificamos si será con la misma probabilida o con probabilidad\n //especifica\n if(contadorEstados == 0){\n //Significa que será con la misma probabilidad por lo que nosotros\n //calcularemos las probabilidades individuales\n for(int i = 0; i < numEstados; i++){\n probabilidadEstados[i] = 1.0 / numEstados;\n }\n }\n for(int i = 0; i < numEstados; i++){\n double logEstado = Math.log10(probabilidadEstados[i]);\n logEstado = logEstado * (-1);\n double logDos = Math.log10(2);\n double divisionLog = logEstado / logDos;\n double entropiaTmp = probabilidadEstados[i] * divisionLog;\n resultado += entropiaTmp;\n }\n }", "public static void partida(String vpalabra[],String verror[],String vacierto[],String palabra){\r\n //comienzo ahorcado\r\n System.out.println(\"******************* AHORCADO *******************\");\r\n String letra;\r\n \r\n int contador=7;\r\n //bucle\r\n while ((contador>0)&&(ganarPartida(vacierto,vpalabra)==false)){\r\n //for (int i=0;i<verror.length;i++){\r\n //muestra el dibujo para que sepa por donde va \r\n mostrarDibujo(contador);\r\n System.out.println(\"VIDAS: \"+ contador);\r\n //mostrar vector acierto\r\n mostrarAcierto(palabra, vacierto);\r\n \r\n \r\n //pregunta letra al jugador \r\n System.out.println(\"\");\r\n System.out.println(\"\");\r\n System.out.println(\"Escribe una única letra: \");\r\n letra=leer.next();\r\n \r\n //muestra vector verror las letras erroneas que vas introduciendo\r\n muestraError(verror);\r\n System.out.println(\"\");\r\n System.out.println(\"\"); \r\n //comprueba si letra esta en la matriz palabra para acertar o fallar\r\n if (buscarLetra(vpalabra, vacierto, verror, letra)==false){\r\n //recorro verror guardando letra erronea\r\n \r\n // verror[i]=letra;\r\n contador--;\r\n } \r\n \r\n //}\r\n }\r\n \r\n if (ganarPartida(vacierto,vpalabra)==true){\r\n System.out.println(\"La palabra es: \");\r\n mostrarPalabra(palabra, vpalabra);\r\n \r\n System.out.println(\" \");\r\n System.out.println(\"¡HAS GANADO!\");\r\n } else{\r\n System.out.println(\" _ _ _ \");\r\n System.out.println(\" |/ | \");\r\n System.out.println(\" | 0 \");\r\n System.out.println(\" | /ºº/ \");\r\n System.out.println(\" | | \");\r\n System.out.println(\" | / / \");\r\n System.out.println(\" | \");\r\n System.out.println(\"---------------\");\r\n System.out.println(\"---------------\");\r\n System.out.println(\" HAS PERDIDO \");\r\n }\r\n }", "public void eisagwgiFarmakou() {\n\t\t// Elegxw o arithmos twn farmakwn na mhn ypervei ton megisto dynato\n\t\tif(numOfMedicine < 100)\n\t\t{\n\t\t\tSystem.out.println();\t\n\t\t\tmedicine[numOfMedicine] = new Farmako();\t\n\t\t\tmedicine[numOfMedicine].setCode(rnd.nextInt(1000000)); // To sistima dinei automata ton kwdiko tou farmakou\n\t\t\tmedicine[numOfMedicine].setName(sir.readString(\"DWSTE TO ONOMA TOU FARMAKOU: \")); // Zitaw apo ton xristi na mou dwsei to onoma tou farmakou\n\t\t\tmedicine[numOfMedicine].setPrice(sir.readPositiveFloat(\"DWSTE THN TIMH TOU FARMAKOU: \")); // Pairnw apo ton xristi tin timi tou farmakou\n\t\t\tSystem.out.println();\n\t\t\t// Elegxos monadikotitas tou kwdikou tou farmakou\n\t\t\th = rnd.nextInt(1000000);\n\t\t\tfor(int i = 0; i < numOfMedicine; i++)\n\t\t\t{\n\t\t\t\tif(medicine[i].getCode() == h)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tSystem.out.println(\"O KWDIKOS AUTOS YPARXEI HDH!\");\n\t\t\t\t\th = rnd.nextInt(10);\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t}\n\t\t\tnumOfMedicine++;\n\t\t}\n\t\t// An xeperastei o megistos arithmos farmakwn\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"DEN MPOREITE NA EISAGETE ALLA FARMAKA!\");\n\t\t\tSystem.out.println(\"EXEI SYMPLHRWTHEI O PROVLEPOMENOS ARITHMOS!\");\n\t\t}\n\t}", "public static void dodavanjePutnickogVozila() {\n\t\tString vrstaVozila = \"Putnicko Vozilo\";\n\t\tString regBr = UtillMethod.unosRegBroj();\n\t\tGorivo gorivo = UtillMethod.izabirGoriva();\n\t\tGorivo gorivo2 = UtillMethod.izabirGorivaOpet(gorivo);\n\t\tint brServisa = 1;\n\t\tdouble potrosnja100 = UtillMethod.unesiteDoublePotrosnja();\n\t\tSystem.out.println(\"Unesite broj km koje je vozilo preslo:\");\n\t\tdouble predjeno = UtillMethod.unesiteBroj();\n\t\tdouble preServisa = 10000;\n\t\tdouble cenaServisa = 8000;\n\t\tSystem.out.println(\"Unesite cenu vozila za jedan dan:\");\n\t\tdouble cenaDan = UtillMethod.unesiteBroj();\n\t\tSystem.out.println(\"Unesite broj sedista u vozilu:\");\n\t\tint brSedist = UtillMethod.unesiteInt();\n\t\tSystem.out.println(\"Unesite broj vrata vozila:\");\n\t\tint brVrata = UtillMethod.unesiteInt();\n\t\tboolean vozObrisano = false;\n\t\tArrayList<Gorivo> gorivaVozila = new ArrayList<Gorivo>();\n\t\tgorivaVozila.add(gorivo);\n\t\tif(gorivo2!=Main.nista) {\n\t\t\tgorivaVozila.add(gorivo2);\n\t\t}\n\t\tArrayList<Servis> servisiNadVozilom = new ArrayList<Servis>();\n\t\tPutnickoVozilo vozilo = new PutnickoVozilo(vrstaVozila, regBr, gorivaVozila, brServisa, potrosnja100, predjeno,\n\t\t\t\tpreServisa, cenaServisa, cenaDan, brSedist, brVrata, vozObrisano, servisiNadVozilom);\n\t\tUtillMethod.prviServis(vozilo, predjeno);\n\t\tMain.getVozilaAll().add(vozilo);\n\t\tSystem.out.println(\"Novo vozilo je uspesno dodato u sistem!\");\n\t\tSystem.out.println(\"---------------------------------------\");\n\t}", "public static void main(String[] args) {\n\t\tnew Ventana();\n/*\n\t\tCollection<MuroDeEnergia> muros = new ArrayList<MuroDeEnergia>();\n\t\tCollection<NaveInvasora> naves = new ArrayList<NaveInvasora>();\n\t\tBateria jugador = new Bateria();\n\t\t\n\t\tJuego.getInstancia();\n\t\tmuros = Juego.getInstancia().getMuros();\n\t\tnaves = Juego.getInstancia().getEnemigos();\n\t\tjugador = Juego.getInstancia().getJugador();\n\t\t\n\t\tIterator<MuroDeEnergia> i;\n\t\tfor (i = muros.iterator(); i.hasNext();) {\n\t\t\tMuroDeEnergia act = i.next();\n\t\t\tSystem.out.println(\"El muro \" + act.getCodigoMuro() + \" esta ubicado en: (\" + act.getCoordenadaX() + \", \" + act.getCoordenadaY() + \")\");\n\t\t}\n\t\t\n\t\tIterator<NaveInvasora> j;\n\t\tfor (j = naves.iterator(); j.hasNext();) {\n\t\t\tNaveInvasora act = j.next();\n\t\t\tSystem.out.println(\"El enemigo \" + act.getCodigoNave() + \" esta ubicado en: (\" + act.getCoordenadaX() + \", \" + act.getCoordenadaY() + \")\");\n\t\t}\n\t\t\n\t\tSystem.out.println(\"El jugador esta ubicado en (\" + jugador.getCoordenadaX() + \", \" + jugador.getCoordenadaY() + \")\" );\n\n\t\tSystem.out.println(\"Hay \" + muros.size() + \" muros de energia.\");\n\t\tJuego.getInstancia().destruirMuro(1);\n\t\tSystem.out.println(\"El muro 1 fue destruido.\");\n\t\tmuros = Juego.getInstancia().getMuros();\n\t\tSystem.out.println(\"Hay \" + muros.size() + \" muros de energia.\");\n\t\t\n\t\tSystem.out.println(\"Hay \" + naves.size() + \" enemigos. El jugador tiene \" + jugador.getPuntos() + \" puntos.\");\n\t\tJuego.getInstancia().destruirNave(9);\n\t\tSystem.out.println(\"La nave 9 fue destruida.\");\n\t\tnaves = Juego.getInstancia().getEnemigos();\n\t\tSystem.out.println(\"Hay \" + naves.size() + \" enemigos. El jugador tiene \" + jugador.getPuntos() + \" puntos.\");\n\t\tSystem.out.println(\"Usted esta en el nivel \" + Juego.getInstancia().getDificultad());\n\t\tSystem.out.println(\"Destruyendo naves...\");\n\t\tint idNave = 0;\n\t\twhile(idNave < 15) {\n\n\t\t\tJuego.getInstancia().destruirNave(idNave);\n\n\t\t\tidNave++;\n\n\t\t}\n\t\tSystem.out.println(\"Todas las naves fueron destruidas. Usted esta en el nivel \" + Juego.getInstancia().getDificultad() + \".\");\n\n\t\tSystem.out.println(\"El jugador esta ubicado en (\" + jugador.getCoordenadaX() + \", \" + jugador.getCoordenadaY() + \")\" );\n\t\t\n\t\tSystem.out.println(\"El jugador se mueve a la izquierda\");\n\t\tJuego.getInstancia().presionaFlechaIzq();\n\t\tSystem.out.println(\"El jugador esta ubicado en (\" + jugador.getCoordenadaX() + \", \" + jugador.getCoordenadaY() + \")\" );\n\t\t\n\t\tSystem.out.println(\"El jugador se mueve a la izquierda\");\n\t\tJuego.getInstancia().presionaFlechaIzq();\n\t\tSystem.out.println(\"El jugador esta ubicado en (\" + jugador.getCoordenadaX() + \", \" + jugador.getCoordenadaY() + \")\" );\n\n\t\tSystem.out.println(\"El jugador se mueve a la derecha\");\n\t\tJuego.getInstancia().presionaFlechaDer();\n\t\tSystem.out.println(\"El jugador esta ubicado en (\" + jugador.getCoordenadaX() + \", \" + jugador.getCoordenadaY() + \")\" );\n\n\t\tSystem.out.println(\"Se termina el juego:\");\n\t\tJuego.getInstancia().finalizarJuego();\n\t\t\n*/\n\t}", "public static void main(String[] args) {\n\t\tString pol1=\"1x^3+3x^2+7x^1+21x^0\";\r\n\t\tString pol2=\"1x^2+7x^0\";\r\n\t\tString adunare=\"+1x^3+4x^2+7x^1+28x^0\";\r\n\t\tString scadere=\"+1x^3+2x^2+7x^1+14x^0\";\r\n\t\tString inmultire=\"+1x^5+3x^4+14x^3+42x^2+49x^1+147x^0\";\r\n\t\tString restul=\"\";\r\n\t\tString catul=\"+1.0x^1+3.0x^0\";\r\n\t\tString derivare=\"+3x^2+6x^1+7x^0\";\r\n\t\tString integrare=\"+0.25x^4+1.0x^3+3.5x^2+21.0x^1\";\r\n\t\tPolinom p1=new Polinom();\r\n\t\tPolinom p2=new Polinom();\r\n\t\tPolinom p1copie=new Polinom();\r\n\t\ttry {\r\n\t\t\tp1=p1.crearePolinom(pol1, 3);\r\n\t\t\tp1copie=p1.crearePolinom(pol1, 3);\r\n\t\t\tp2=p2.crearePolinom(pol2, 2);\r\n\t\t} catch (IllegalInputException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\r\n\t\tPolinom p3=p1.adunarePolinom(p2, 4);\r\n\t\tString rezAdunare=p3.afisPolinomIntreg();\r\n\t\tPolinom p4=p1.scaderePolinom(p2, 4);\r\n\t\tString rezScadere=p4.afisPolinomIntreg();\r\n\t\tPolinom p5=p1.inmultirePolinom(p2, 6);\r\n\t\tString rezInmultire=p5.afisPolinomIntreg();\r\n\t\tString cat=p1.impartirePolinom(p2, 3, 2);\r\n\t\tString rest=p1copie.impartirePolinom(p2, 3, 2);\r\n\t\tPolinom p7=p1.derivarePolinom(3);\r\n\t\tString rezDerivare=p7.afisPolinomReal();\r\n\t\tPolinom p8=p1.integrarePolinom(4);\r\n\t\tString rezIntegrare=p8.afisPolinomReal();\r\n\t\t\r\n\t\tassert adunare!=rezAdunare : \"Nu se verifica adunarea!\";\r\n\t\tassert scadere!=rezScadere : \"Nu se verifica scaderea!\";\r\n\t\tassert inmultire!=rezInmultire : \"Nu se verifica inmultirea!\";\r\n\t\tassert derivare!=rezDerivare : \"Nu se verifica derivarea!\";\r\n\t\tassert integrare!=rezIntegrare : \"Nu se verifica integrarea!\";\r\n\t\tassert catul!=cat : \"Nu se verifica adunarea!\";\r\n\t\tassert restul!=rest : \"Nu se verifica adunarea!\";\r\n\t\t\r\n\t\t\r\n\t}", "private Punto getPuntoCercano(Punto puntoini, List<Punto> puntos ){\n\t\t\t\n\t\t List<Segmento> segmentos = new ArrayList<Segmento>();\n\t\t\t// todos contra todos\n\t\t\tfor (Punto punto : puntos) {\n\t\t\t\tif( (puntoini!=null && punto!=null) && !puntoini.equals(punto) ){\n\t\t\t\t\t\tdouble d = Geometria.distanciaDeCoordenadas(puntoini, punto);\n\t\t\t\t\t\tsegmentos.add(new Segmento(puntoini, punto, d));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tCollections.sort(segmentos);\n\t\t\tPunto puntocerano = segmentos.get(0).getPunto2();\n\t\t \n\t\t return puntocerano;\n\t\t \n\t }", "public double ValorDePertenencia(double valor) {\n // Caso 1: al exterior del intervalo del conjunto difuo\n if (valor < min || valor > max || puntos.size() < 2) {\n return 0;\n }\n\n Punto2D ptAntes = puntos.get(0);\n Punto2D ptDespues = puntos.get(1);\n int index = 0;\n while (valor >= ptDespues.x) {\n index++;\n ptAntes = ptDespues;\n ptDespues = puntos.get(index);\n }\n\n if (ptAntes.x == valor) {\n // Tenemos un punto en este valor\n return ptAntes.y;\n } else {\n // Se aplica la interpolación\n return ((ptAntes.y - ptDespues.y) * (ptDespues.x - valor) / (ptDespues.x - ptAntes.x) + ptDespues.y);\n }\n }", "private int[] enquadramentoViolacaoCamadaFisica(int[] quadro) throws Exception {\n System.out.println(\"\\n\\t[Violacao da Camada Fisica]\");\n Painel.CAMADAS_RECEPTORAS.camadaEnlace(\"\\n\\t[Violacao da Camada Fisica]\");\n Thread.sleep(velocidade);\n\n final int byteFlag = 255;//00000000 00000000 00000000 11111111\n Painel.CAMADAS_RECEPTORAS.camadaEnlace(\"\\n\\t[Bits de Flag [11111111] = 255]\\n\\n\");\n Thread.sleep(velocidade);\n\n String auxiliar = \"\";\n Boolean SE = true;\n\n for (int inteiro : quadro) {\n int quantidadeByte = ManipuladorDeBit.quantidadeDeBytes(inteiro);\n ManipuladorDeBit.imprimirBits(inteiro);\n inteiro = ManipuladorDeBit.deslocarBits(inteiro);\n ManipuladorDeBit.imprimirBits(inteiro);\n int inteiroByte = ManipuladorDeBit.getPrimeiroByte(inteiro);\n\n if (inteiroByte == byteFlag) {//Inicio do Quadro\n SE = !SE;//Iniciar a Busca pelo Byte de Fim de Quadro\n inteiro <<= 8;//Deslocando 8 bits para a esquerda\n quantidadeByte--;\n Painel.CAMADAS_RECEPTORAS.camadaEnlace(\"\\tIC [\" + inteiroByte + \"] \");\n }\n\n if (!SE) {\n\n ManipuladorDeBit.imprimirBits(inteiro);\n\n for (int i=1; i<=quantidadeByte; i++) {\n int dado = ManipuladorDeBit.getPrimeiroByte(inteiro);\n ManipuladorDeBit.imprimirBits(dado);\n\n if (dado == byteFlag) {//Verificando se encontrou o Byte de Flag\n SE = !SE;//Encontrou o Byte de Fim de Quadro\n } else {\n Painel.CAMADAS_RECEPTORAS.camadaEnlace(\"Carga Util [ \");\n\n int novoQuadro = 0;\n\n Boolean cincoBits1 = ManipuladorDeBit.cincoBitsSequenciais(dado,1);\n if (cincoBits1) {\n\n dado = ManipuladorDeBit.deslocarBits(dado);\n ManipuladorDeBit.imprimirBits(dado);\n\n //Cria um inteiro com 1 no bit mais a esquerda e 0s em outros locais\n int displayMask = 1 << 31;//10000000 00000000 00000000 00000000\n //Para cada bit exibe 0 ou 1\n for (int b=1, cont=0; b<=8; b++) {\n //Utiliza displayMask para isolar o bit\n int bit = (dado & displayMask) == 0 ? 0 : 1;\n\n if (cont == 5) {\n cont = 0;//Zerando o contador\n dado <<= 1;//Desloca 1 bit para a esquerda\n bit = (dado & displayMask) == 0 ? 0 : 1;\n }\n\n if (b == 8) {//Quando chegar no Ultimo Bit\n inteiro <<= 8;//Deslocando 8 bits para esquerda\n dado = ManipuladorDeBit.getPrimeiroByte(inteiro);\n dado = ManipuladorDeBit.deslocarBits(dado);\n ManipuladorDeBit.imprimirBits(dado);\n\n novoQuadro <<= 1;//Deslocando 1 bit para a esquerda\n novoQuadro |= ManipuladorDeBit.pegarBitNaPosicao(dado,1);//Adicionando o bit ao novoDado\n\n ManipuladorDeBit.imprimirBits(novoQuadro);\n\n auxiliar += (char) novoQuadro;\n Painel.CAMADAS_RECEPTORAS.camadaEnlace(novoQuadro + \" ]\\n\");\n Thread.sleep(velocidade);\n i++;\n\n } else {//Colocando o Bit no novoQuadro\n novoQuadro <<= 1;//Deslocando 1 bit para a esquerda\n novoQuadro |= bit;//Adicionando o bit ao novoDado\n dado <<= 1;//Desloca 1 bit para a esquerda\n }\n\n if (bit == 1) {//Quando for um bit 1\n cont++;\n } else {//Caso vinher um bit 0\n cont = 0;\n }\n }\n\n } else {//Caso nao tem uma sequencia de 5 Bits 1's\n auxiliar += (char) dado;\n Painel.CAMADAS_RECEPTORAS.camadaEnlace(dado + \" ]\\n\");\n Thread.sleep(velocidade);\n }\n }\n \n inteiro <<= 8;//Deslocando 8 bits para a esquerda;\n }\n\n }\n }\n\n //Novo Quadro de Carga Util\n int[] quadroDesenquadrado = new int[auxiliar.length()];\n //Adicionando as informacoes de Carga Util no QuadroDesenquadrado\n for (int i=0; i<auxiliar.length(); i++) {\n quadroDesenquadrado[i] = (int) auxiliar.charAt(i);\n ManipuladorDeBit.imprimirBits(quadroDesenquadrado[i]);\n }\n\n return quadroDesenquadrado;\n }", "@Override\r\n\tpublic float chekearDatos(){\r\n\t\t\r\n\t\tfloat monto = 0f;\r\n\t\tfloat montoPorMes = creditoSolicitado/plazoEnMeses;\r\n\t\tdouble porcentajeDeSusIngesosMensuales = (cliente.getIngresosMensuales()*0.7);\r\n\t\t\r\n\t\tif(cliente.getIngresoAnual()>=15000f && montoPorMes<=porcentajeDeSusIngesosMensuales){\r\n\t\t\t\r\n\t\t\tmonto = this.creditoSolicitado;\r\n\t\t\tsetEstadoDeSolicitud(true);\r\n\t\t}\t\r\n\t\t\r\n\t\t\r\n\t\treturn monto;\r\n\t}", "private void laskeMatkojenPituus() {\n matkojenpituus = 0.0;\n\n for (Matka m : matkat) {\n matkojenpituus += m.getKuljettumatka();\n }\n\n }", "ArrayList<Float> pierwszaPredykcja()\n\t{\n\t\tif (Stale.scenariusz<100)\n\t\t{\n\t\t\treturn pierwszaPredykcjaNormal();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//dla scenariusza testowego cnea predykcji jest ustawiana na 0.30\n\t\t\tArrayList<Float> L1 = new ArrayList<>();\n\t\t\tL1.add(0.30f);\n\t\t\treturn L1;\n\t\t}\n\t}", "private void setPrecioVentaBaterias() throws Exception {\n\t\tRegisterDomain rr = RegisterDomain.getInstance();\n\t\tlong idListaPrecio = this.selectedDetalle.getListaPrecio().getId();\n\t\tString codArticulo = this.selectedDetalle.getArticulo().getCodigoInterno();\t\t\n\t\tArticuloListaPrecioDetalle lista = rr.getListaPrecioDetalle(idListaPrecio, codArticulo);\n\t\tString formula = this.selectedDetalle.getListaPrecio().getFormula();\n\t\tif (lista != null && formula == null) {\n\t\t\tthis.selectedDetalle.setPrecioGs(this.selectedCondicion.isCondicionContado()? lista.getPrecioGs_contado() : lista.getPrecioGs_credito());\n\t\t} else {\n\t\t\tdouble costo = this.selectedDetalle.getArticulo().getCostoGs();\n\t\t\tint margen = this.selectedDetalle.getListaPrecio().getMargen();\n\t\t\tdouble precio = ControlArticuloCosto.getPrecioVenta(costo, margen);\n\t\t\t\n\t\t\t// formula lista precio mayorista..\n\t\t\tif (idListaPrecio == 2 && formula != null) {\n\t\t\t\tArticuloListaPrecio distribuidor = (ArticuloListaPrecio) rr.getObject(ArticuloListaPrecio.class.getName(), 1);\n\t\t\t\tArticuloListaPrecioDetalle precioDet = rr.getListaPrecioDetalle(distribuidor.getId(), codArticulo);\n\t\t\t\tif (precioDet != null) {\n\t\t\t\t\tdouble cont = precioDet.getPrecioGs_contado();\n\t\t\t\t\tdouble cred = precioDet.getPrecioGs_credito();\n\t\t\t\t\tdouble formulaCont = cont + Utiles.obtenerValorDelPorcentaje(precioDet.getPrecioGs_contado(), 10);\n\t\t\t\t\tdouble formulaCred = cred + Utiles.obtenerValorDelPorcentaje(precioDet.getPrecioGs_credito(), 10);\n\t\t\t\t\tthis.selectedDetalle.setPrecioGs(this.selectedCondicion.isCondicionContado()? formulaCont : formulaCred);\n\t\t\t\t} else {\n\t\t\t\t\tmargen = distribuidor.getMargen();\n\t\t\t\t\tdouble precioGs = ControlArticuloCosto.getPrecioVenta(costo, margen);\n\t\t\t\t\tdouble formula_ = precioGs + Utiles.obtenerValorDelPorcentaje(precioGs, 10);\n\t\t\t\t\tthis.selectedDetalle.setPrecioGs(formula_);\n\t\t\t\t}\n\n\t\t\t// formula lista precio minorista..\n\t\t\t} else if (idListaPrecio == 3 && formula != null) {\n\t\t\t\tArticuloListaPrecio distribuidor = (ArticuloListaPrecio) rr.getObject(ArticuloListaPrecio.class.getName(), 1);\n\t\t\t\tArticuloListaPrecioDetalle precioDet = rr.getListaPrecioDetalle(distribuidor.getId(), codArticulo);\n\t\t\t\tif (precioDet != null) {\n\t\t\t\t\tdouble cont = precioDet.getPrecioGs_contado() + Utiles.obtenerValorDelPorcentaje(precioDet.getPrecioGs_contado(), 10);\n\t\t\t\t\tdouble cred = precioDet.getPrecioGs_credito() + Utiles.obtenerValorDelPorcentaje(precioDet.getPrecioGs_credito(), 10);\n\t\t\t\t\tdouble formulaCont = (cont * 1.15) / 0.8;\n\t\t\t\t\tdouble formulaCred = (cred * 1.15) / 0.8;\n\t\t\t\t\tthis.selectedDetalle.setPrecioGs(this.selectedCondicion.isCondicionContado()? formulaCont : formulaCred);\n\t\t\t\t} else {\n\t\t\t\t\tmargen = distribuidor.getMargen();\n\t\t\t\t\tdouble precioGs = ControlArticuloCosto.getPrecioVenta(costo, margen);\n\t\t\t\t\tdouble formula_ = ((precioGs + Utiles.obtenerValorDelPorcentaje(precioGs, 10)) * 1.15) / 0.8;\n\t\t\t\t\tthis.selectedDetalle.setPrecioGs(formula_);\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tthis.selectedDetalle.setPrecioGs(precio);\n\t\t\t}\t\t\n\t\t}\n\t}", "public BigDecimal calcolaImportoTotaleNonRilevanteIVASubdoumenti(){\n\t\tBigDecimal result = BigDecimal.ZERO;\n\t\tfor(SD ds : getListaSubdocumenti()) {\n\t\t\tif(!Boolean.TRUE.equals(ds.getFlagRilevanteIVA())) {\n\t\t\t\tresult = result.add(ds.getImporto());\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "protected void jouerOrdinateur() {\n Random rdmPropoOrdi = new Random();\n\n for (int i = 0; i < nbrPosition; i++) {\n int min = 0;\n int max = propositionHaute[i];\n if (propositionBasse[i] != 0) {\n min = propositionBasse[i] + 1;\n }\n\n if (propositionOrdinateur[i] != combinaisonJoueur[i]) {\n int propoOrdi = min + rdmPropoOrdi.nextInt(max - min);\n propositionOrdinateur[i] = (byte) (propoOrdi);\n\n if (propositionOrdinateur[i] < combinaisonJoueur[i]) {\n propositionBasse[i] = propositionOrdinateur[i];\n } else {\n propositionHaute[i] = propositionOrdinateur[i];\n }\n }\n }\n }", "private int obstaculos() {\n\t\treturn this.quadricula.length * this.quadricula[0].length - \n\t\t\t\tthis.ardiveis();\n\t}", "public static void quienHaGanado(Mano[] jugadores, int actual,int carro){\n if(jugadores[actual].getNPiezas()!=0){\n boolean dosIguales=false;\n actual=0;\n for (int i = 1; i < jugadores.length; i++) {\n if(jugadores[i].getPuntuacion()==jugadores[actual].getPuntuacion()){//El jug i y el actual tienen la misma putnuacion\n if(i==carro){//el jugador i es el carro\n actual=i;\n dosIguales=false;\n }\n else if(actual==carro){//el jugador actual es el carro\n dosIguales=false;\n }\n else{//ninguno es el carro y hay que acudir a un metodo para nombrar a los dos ganadores.\n dosIguales=true;\n }\n }\n if(jugadores[i].getPuntuacion()<jugadores[actual].getPuntuacion()){//el jugador i tiene menor puntuacion que el jugador actual\n actual=i;\n dosIguales=false;\n }\n }\n if(dosIguales){\n System.out.println(\"pene\");\n Excepciones.cambiarColorAzul(\"Y los GANADORES SON....\");\n for (int i = 0; i < jugadores.length; i++) {\n if (jugadores[i].getPuntuacion()==jugadores[actual].getPuntuacion()) {\n //System.out.println(\"\\t\\t\\u001B[34mEl jugador nº- \"+(i+1)+\": \"+jugadores[i].getNombre());\n Excepciones.cambiarColorAzul(\"\\t\\tEl jugador nº- \"+(i+1)+\": \"+jugadores[i].getNombre());\n }\n }\n System.out.println(\"\\u001B[30m\");\n }\n else{\n Excepciones.cambiarColorAzul(\"Y el GANADOR ES....\");\n //System.out.println(\"\\t\\t\\u001B[34mEl jugador nº- \"+(actual+1)+\": \"+jugadores[actual].getNombre()+\"\\u001B[30m\");\n Excepciones.cambiarColorAzul(\"\\t\\tEl jugador nº- \"+(actual+1)+\": \"+jugadores[actual].getNombre());\n }\n }\n else {\n Excepciones.cambiarColorAzul(\"Y el GANADOR ES....\");\n //System.out.println(\"\\t\\t\\u001B[34mEl jugador nº- \"+(actual+1)+\": \"+jugadores[actual].getNombre()+\"\\u001B[30m\");\n Excepciones.cambiarColorAzul(\"\\t\\tEl jugador nº- \"+(actual+1)+\": \"+jugadores[actual].getNombre());\n }\n }", "private void BajarPieza1posicion() {\n for (int i = 0; i < 4; ++i) {\r\n int x = posicionX + piezaActual.x(i);\r\n int y = posicionY - piezaActual.y(i);\r\n piezas[(y * anchoTablero) + x] = piezaActual.getPieza();\r\n }\r\n\r\n BorrarLineas();\r\n\r\n if (!finalizoQuitarFilas) {\r\n nuevaPieza();\r\n }\r\n }", "public void controllore() {\n if (puntiVita > maxPunti) puntiVita = maxPunti;\n if (puntiFame > maxPunti) puntiFame = maxPunti;\n if (puntiFelicita > maxPunti) puntiFelicita = maxPunti;\n if (soldiTam < 1) {\n System.out.println(\"Hai finito i soldi\");\n System.exit(3);\n }\n //controlla che la creatura non sia morta, se lo è mette sonoVivo a false\n if (puntiVita <= minPunti && puntiFame <= minPunti && puntiFelicita <= minPunti) sonoVivo = false;\n }", "public void ucitajPotez(Potez potez) {\n\t\tint red = potez.vratiRed();\n\t\tint kolona = potez.vratiKolonu();\n\t\ttabla[red][kolona] = potez.vratiRezultat();\n\n\t\tif (potez.vratiRezultat() == Polje1.potopljen) {\n\t\t\tint gornjiRed, gornjaKolona;\n\t\t\tboolean cont1 = false;\n\t\t\tboolean cont2 = false;\n\t\t\tboolean redar = false;\n\t\t\tboolean kolonar = false;\n\t\t\twhile (redar == false) {\n\t\t\t\tif (red == 0) {\n\t\t\t\t\tgornjiRed = 0;\n\t\t\t\t\tcont1 = true;\n\t\t\t\t} else {\n\t\t\t\t\tgornjiRed = red - 1;\n\t\t\t\t}\n\t\t\t\tif (red == 9) {\n\t\t\t\t\tcont2 = true;\n\t\t\t\t}\n\t\t\t\tif (tabla[gornjiRed][kolona] == Polje1.pogodjen && cont1 == false) {\n\t\t\t\t\ttabla[gornjiRed][kolona] = Polje1.potopljen;\n\t\t\t\t\tred--;\n\t\t\t\t} else {\n\t\t\t\t\tcont1 = true;\n\t\t\t\t\tgornjiRed++;\n\t\t\t\t}\n\t\t\t\tif (cont1 == true) {\n\t\t\t\t\tif (tabla[gornjiRed][kolona] == Polje1.pogodjen || tabla[gornjiRed][kolona] == Polje1.potopljen) {\n\t\t\t\t\t\ttabla[gornjiRed][kolona] = Polje1.potopljen;\n\t\t\t\t\t\tred++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcont2 = true;\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (cont1 == true && cont2 == true)\n\t\t\t\t\tredar = true;\n\t\t\t}\n\t\t\tcont1 = false;\n\t\t\tcont2 = false;\n\t\t\tred = potez.vratiRed();\n\t\t\twhile (kolonar == false) {\n\t\t\t\tif (kolona == 0) {\n\t\t\t\t\tgornjaKolona = 0;\n\t\t\t\t\tcont1 = true;\n\t\t\t\t} else {\n\t\t\t\t\tgornjaKolona = kolona - 1;\n\t\t\t\t}\n\t\t\t\tif (kolona == 9) {\n\t\t\t\t\tcont2 = true;\n\t\t\t\t}\n\t\t\t\tif (tabla[red][gornjaKolona] == Polje1.pogodjen && cont1 == false) {\n\t\t\t\t\ttabla[red][gornjaKolona] = Polje1.potopljen;\n\t\t\t\t\tkolona--;\n\t\t\t\t} else {\n\t\t\t\t\tcont1 = true;\n\t\t\t\t\tgornjaKolona++;\n\t\t\t\t}\n\t\t\t\tif (cont1 == true) {\n\t\t\t\t\tif (tabla[red][gornjaKolona] == Polje1.pogodjen || tabla[red][gornjaKolona] == Polje1.potopljen) {\n\t\t\t\t\t\ttabla[red][gornjaKolona] = Polje1.potopljen;\n\t\t\t\t\t\tkolona++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcont2 = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (cont1 == true && cont2 == true)\n\t\t\t\t\tkolonar = true;\n\n\t\t\t}\n\n\t\t}\n\n\n\t}", "public void reubicarProductosUltimaCaja(DTOListaPicadoCabecera listaPicado, ArrayList tiposCajas, ArrayList volumenProductos, ArrayList cajas, int numeroCajas) throws MareException {\n UtilidadesLog.info(\"MONCalculoCubicaje.reubicarProductosUltimaCaja(DTOListaPicadoCabecera listaPicado, ArrayList tiposCajas, ArrayList volumenProductos, ArrayList cajas, Integer numeroCajas): Entrada\");\n \n if(numeroCajas > 1){\n UtilidadesLog.debug(\"Hay mas de una caja\");\n \n // sapaza -- Cambios para WCS y MUO -- 22/09/2010\n DTOTipoCajaEmbalaje ultimaCaja = null;\n for(int j=cajas.size()-1; j>=0;j--) {\n ultimaCaja = (DTOTipoCajaEmbalaje)cajas.get(j);\n \n if(ultimaCaja.getCapacidad()==null)\n continue;\n else\n break;\n }\n \n if(ultimaCaja.getCapacidad() != null) {\n \n BigDecimal volumenUtilizadoUltimaCaja = ultimaCaja.getCapacidad().subtract(ultimaCaja.getVolumenSobrante()); \n \n UtilidadesLog.debug(\"volumenUtilizadoUltimaCaja: \" + volumenUtilizadoUltimaCaja);\n UtilidadesLog.debug(\"ultimaCaja.getCapacidadMinima(): \" + ultimaCaja.getCapacidadMinima());\n \n DTOTipoCajaEmbalaje cajaAuxiliar = null ;\n \n if(volumenUtilizadoUltimaCaja.compareTo(ultimaCaja.getCapacidadMinima())==-1){\n // Arma lista con los detalles a modificar\n ArrayList detallesAModificar = new ArrayList();\n int cantProd = listaPicado.getDetalles().size();\n ArrayList detalles = listaPicado.getDetalles();\n DTOListaPicadoDetalle dtoListaPicadoDetalle = null;\n \n for (int j = 0; j < cantProd; j++) {\n dtoListaPicadoDetalle = (DTOListaPicadoDetalle)detalles.get(j);\n \n if((dtoListaPicadoDetalle.getNumeroCaja()!= null) && (dtoListaPicadoDetalle.getNumeroCaja().longValue()== numeroCajas)){\n detallesAModificar.add(dtoListaPicadoDetalle);\n }\n }\n \n // Busca una caja menor para los productos\n int cantTiposCajas = tiposCajas.size();\n DTOTipoCajaEmbalaje dtoTipoCajaEmbalaje = null;\n \n for(int i=0; i< cantTiposCajas; i++){\n dtoTipoCajaEmbalaje = (DTOTipoCajaEmbalaje)tiposCajas.get(i);\n UtilidadesLog.debug(\"dtoTipoCajaEmbalaje: \" + dtoTipoCajaEmbalaje);\n \n if(volumenUtilizadoUltimaCaja.compareTo(dtoTipoCajaEmbalaje.getCapacidad())==-1){\n cajaAuxiliar = (DTOTipoCajaEmbalaje)deepCopy(dtoTipoCajaEmbalaje);\n }\n }\n \n // Asigna los productos a la caja menor\n if(cajaAuxiliar!=null){\n int cantDetMod = detallesAModificar.size();\n \n for(int k=0; k < cantDetMod; k++){\n dtoListaPicadoDetalle = (DTOListaPicadoDetalle)detallesAModificar.get(k);\n dtoListaPicadoDetalle.setOidTipoCajaEmbalaje(cajaAuxiliar.getOid());\n dtoListaPicadoDetalle.setDescripcionTipoCajaEmbalaje(cajaAuxiliar.getDescripcion());\n }\n } else {\n UtilidadesLog.debug(\"No se encontró una caja no realizamos ninguna acción\");\n } \n }\n }\n \n }\n UtilidadesLog.info(\"MONCalculoCubicaje.reubicarProductosUltimaCaja(DTOListaPicadoCabecera listaPicado, ArrayList tiposCajas, ArrayList volumenProductos, ArrayList cajas, Integer numeroCajas): Salida\");\n }", "public void calculoPersonal(){\n ayudantes = getAyudantesNecesarios();\n responsables = getResponsablesNecesarios();\n \n //Calculo atencion al cliente (30% total trabajadores) y RRPP (10% total trabajadores):\n \n int total = ayudantes + responsables;\n \n atencion_al_cliente = (total * 30) / 100;\n \n RRPP = (total * 10) / 100;\n \n //Creamos los trabajadores\n \n gestor_trabajadores.crearTrabajadores(RRPP, ayudantes,responsables,atencion_al_cliente);\n \n }", "public void sumaPuntos() {\r\n int rojo = 0;\r\n int azul = 0;\r\n for (int i = 1; i < 10; i++) {\r\n\r\n if (tablero[1][i].getTipo().equals(\"Rojo\")) {\r\n rojo += tablero[1][i].getValor();\r\n }\r\n\r\n if (tablero[8][i].getTipo().equals(\"Azul\")) {\r\n azul += tablero[8][i].getValor();\r\n }\r\n\r\n }\r\n if (rojo > azul) {\r\n this.setResultado(\"Rojo\");\r\n this.agregarVictoria(jugadorRojo);\r\n }\r\n if (azul > rojo) {\r\n this.setResultado(\"Azul\");\r\n this.agregarVictoria(jugadorAzul);\r\n }\r\n \r\n this.setReplay(true);\r\n }", "@Override\n public void tirar() {\n if ( this.probabilidad == null ) {\n super.tirar();\n this.valorTrucado = super.getValor();\n return;\n }\n \n // Necesitamos conocer la probabilidad de cada número, trucados o no, para ello tengo que saber\n // primero cuantos números hay trucados y la suma de sus probabilidades. \n // Con esto puedo calcular la probabilidad de aparición de los números no trucados.\n \n int numeroTrucados = 0;\n double sumaProbalidadesTrucadas = 0;\n double probabilidadNoTrucados = 0;\n \n for ( double p: this.probabilidad ) { // cálculo de la suma números y probabilidades trucadas\n if ( p >= 0 ) {\n numeroTrucados++;\n sumaProbalidadesTrucadas += p;\n }\n }\n \n if ( numeroTrucados < 6 ) { // por si estuvieran todos trucados\n probabilidadNoTrucados = (1-sumaProbalidadesTrucadas) / (6-numeroTrucados);\n }\n\n double aleatorio = Math.random(); // me servirá para escoger el valor del dado\n \n // Me quedo con la cara del dado cuya probabilidad de aparición, sumada a las anteriores, \n // supere el valor aleatorio\n double sumaProbabilidades = 0;\n this.valorTrucado = 0;\n do {\n ++this.valorTrucado;\n if (this.probabilidad[this.valorTrucado-1] < 0) { // no es una cara del dado trucada\n sumaProbabilidades += probabilidadNoTrucados;\n } else {\n sumaProbabilidades += this.probabilidad[this.valorTrucado-1];\n }\n \n } while (sumaProbabilidades < aleatorio && valorTrucado < 6);\n \n \n }", "public static void viaggia(List<Trasporto> lista,Taxi[] taxi,HandlerCoR h) throws SQLException\r\n {\n Persona app = (Persona) lista.get(0);\r\n /* ARGOMENTI handleRequest\r\n 1° Oggetto Request\r\n 2° Array Taxi per permettere la selezione e la modifica della disponibilità\r\n */\r\n h.handleRequest(new RequestCoR(app.getPosPartenza(),app.getPosArrivo(),taxi),taxi); \r\n SceltaPercorso tempo = new SceltaPercorso();\r\n SceltaPercorso spazio = new SceltaPercorso();\r\n tempo.setPercorsoStrategy(new timeStrategy());\r\n spazio.setPercorsoStrategy(new lenghtStrategy());\r\n for(int i=0;i<5;i++)\r\n if(!taxi[i].getLibero())\r\n {\r\n if(Scelta.equals(\"veloce\"))\r\n {\r\n JOptionPane.showMessageDialog(null,\"Hai Scelto il Percorso più Veloce...\");\r\n Connessione conn;\r\n conn = Connessione.getConnessione();\r\n String query = \"Delete from CRONOCORSE where PASSEGGERO = ? \";\r\n try (PreparedStatement ps = conn.connect.prepareStatement(query)) {\r\n ps.setString(1, app.getNome());\r\n ps.executeUpdate();\r\n ps.close();\r\n JOptionPane.showMessageDialog(null,\"Cliente in viaggio...\\n\"+app.getNome()+\" è arrivato a destinazione!\\nPrezzo Corsa: \"+taxi[i].getPrezzoTotale()+\"€\");\r\n \r\n \r\n }catch(SQLException e){JOptionPane.showMessageDialog(null,e);}\r\n tempo.Prenota(taxi[i]); \r\n app.setPosPartenza();\r\n taxi[i].setPosizione(app.getPosArrivo());\r\n taxi[i].setStato(true);\r\n taxi[i].clear();\r\n lista.set(0,app);\r\n i=5;\r\n \r\n } else\r\n \r\n {\r\n JOptionPane.showMessageDialog(null,\"Hai Scelto il Percorso più Breve...\");\r\n Connessione conn;\r\n conn = Connessione.getConnessione();\r\n String query = \"Delete from CRONOCORSE where PASSEGGERO = ? \";\r\n try (PreparedStatement ps = conn.connect.prepareStatement(query)) {\r\n ps.setString(1, app.getNome());\r\n ps.executeUpdate();\r\n ps.close();\r\n JOptionPane.showMessageDialog(null,\"Cliente in viaggio...\\n\"+app.getNome()+\" è arrivato a destinazione!\\nPrezzo Corsa: \"+taxi[i].getPrezzoTotale()+\"€\");\r\n \r\n \r\n }catch(SQLException e){JOptionPane.showMessageDialog(null,e);}\r\n spazio.Prenota(taxi[i]); \r\n app.setPosPartenza();\r\n taxi[i].setPosizione(app.getPosArrivo());\r\n taxi[i].setStato(true);\r\n taxi[i].clear();\r\n lista.set(0,app);\r\n i=5;\r\n \r\n \r\n }\r\n }\r\n \r\n }", "private void moverJogadorDaVez(int dado1, int dado2) throws Exception {\n // System.out.println(\"moverJogadorDaVez\" + dado1 + \" , \" + dado2);\n\n print(\"\\ttirou nos dados: \" + dado1 + \" , \" + dado2);\n int valorDados = dado1 + dado2;\n\n int jogador = this.jogadorAtual();\n\n boolean ValoresIguais = false;\n\n\n //preciso saber se o jogador vai passar pela posição 40, o que significa\n //ganhar dinheiro\n this.completouVolta(jogador, valorDados);\n\n if (dado1 == dado2) {\n ValoresIguais = true;\n } else {\n ValoresIguais = false;\n }\n\n //movendo à posição\n this.moverJogadorAPosicao(jogador, valorDados, ValoresIguais);\n this.print(\"\\tAtual dinheiro antes de ver a compra:\" + this.listaJogadores.get(jogador).getDinheiro());\n this.print(\"\\tVai até a posição \" + this.posicoes[jogador]);\n\n //vendo se caiu na prisao\n if (this.posicoes[this.jogadorAtual()] == 30 && this.prisao == true) {\n adicionaNaPrisao(listaJogadores.get(jogadorAtual()));\n DeslocarJogador(jogador, 10);\n listaJogadores.get(jogadorAtual()).adicionarComandoPay();\n }\n\n\n\n Lugar lugar = this.tabuleiro.get(this.posicoes[jogador] - 1);//busca em -1, pois eh um vetor\n\n\n if (this.isCompraAutomatica()) {\n this.realizarCompra(jogador, lugar);\n }\n\n if (!this.posicaoCompravel(this.posicoes[jogador])) {\n this.print(\"\\t\" + lugar.getNome() + \" não está à venda!\");\n\n\n String nomeDono = (String) Donos.get(this.posicoes[jogador]);\n //não cobrar aluguel de si mesmo\n if (!nomeDono.equals(this.listaJogadores.get(this.jogadorAtual()).getNome())) {\n\n if (this.isUmJogador(nomeDono)) {\n Jogador possivelDono = this.getJogadorByName(nomeDono);\n\n if (this.isPosicaoFerrovia(this.posicoes[jogador])) {\n this.print(\"\\tO dono eh \" + possivelDono.getNome());\n if (!lugar.estaHipotecada()) {\n this.pagarFerrovia(possivelDono.getId(), jogador, 25, lugar.getNome());\n }\n } else {\n\n this.print(\"\\tO dono eh \" + possivelDono.getNome());\n int valorAluguel = 0;\n if (this.posicoes[this.jogadorAtual()] != 12 && this.posicoes[this.jogadorAtual()] != 28) {\n valorAluguel = this.tabuleiro.getLugarPrecoAluguel(this.posicoes[jogador]);\n\n } else {\n if (possivelDono.getQuantidadeCompanhias() == 1) {\n valorAluguel = 4 * valorDados;\n\n }\n if (possivelDono.getQuantidadeCompanhias() == 2) {\n valorAluguel = 10 * valorDados;\n\n }\n }\n if (!lugar.estaHipotecada()) {\n this.pagarAluguel(possivelDono.getId(), jogador, valorAluguel, lugar.getNome());\n }\n\n }\n\n }\n }\n\n }\n\n\n this.pagarEventuaisTaxas(jogador);\n\n if ((this.posicoes[this.jogadorAtual()] == 2 || this.posicoes[jogadorAtual()] == 17 || this.posicoes[jogadorAtual()] == 33) && cards == true) {\n realizaProcessamentoCartaoChest();\n }\n\n if ((this.posicoes[this.jogadorAtual()] == 7 || this.posicoes[jogadorAtual()] == 22 || this.posicoes[jogadorAtual()] == 36) && cards == true) {\n realizaProcessamentoCartaoChance();\n }\n\n\n\n\n this.print(\"\\tAtual dinheiro depois:\" + this.listaJogadores.get(jogador).getDinheiro());\n\n\n\n }" ]
[ "0.65374136", "0.64575756", "0.6166911", "0.60817415", "0.60675704", "0.6059871", "0.6046768", "0.60442775", "0.5940789", "0.58433855", "0.58246195", "0.58072853", "0.58033663", "0.5800611", "0.5777529", "0.57630223", "0.57530236", "0.5744059", "0.5742758", "0.57394457", "0.5714946", "0.5712204", "0.5707254", "0.56869835", "0.56839633", "0.5677706", "0.566572", "0.56652045", "0.5664216", "0.56641144", "0.56446993", "0.564214", "0.5641255", "0.5636542", "0.56354684", "0.5626199", "0.5620812", "0.5617913", "0.5609049", "0.56027323", "0.56024075", "0.5595264", "0.5584061", "0.5576877", "0.55719805", "0.556652", "0.55651873", "0.55651367", "0.55641985", "0.5563659", "0.55591273", "0.5557704", "0.5556633", "0.5549702", "0.55471075", "0.5544207", "0.55414736", "0.55405873", "0.5539888", "0.55387294", "0.5534658", "0.5532911", "0.5530139", "0.55234224", "0.5522597", "0.5520326", "0.5511515", "0.5508899", "0.55070347", "0.5505956", "0.55023986", "0.5501387", "0.5500563", "0.5494439", "0.54907507", "0.5484405", "0.5481636", "0.54777575", "0.5471973", "0.5469172", "0.5466915", "0.54663616", "0.5464446", "0.54477614", "0.54476887", "0.544703", "0.54433256", "0.5442196", "0.5441502", "0.5431385", "0.542969", "0.5426437", "0.5419761", "0.5418775", "0.54093087", "0.5403516", "0.5402413", "0.5392087", "0.53835434", "0.537736", "0.53757703" ]
0.0
-1
/ JADX WARNING: Removed duplicated region for block: B:26:0x0087 / JADX WARNING: Removed duplicated region for block: B:19:0x0067
private void c() { /* r14 = this; r12 = android.os.SystemClock.elapsedRealtime(); r8 = r14.d(); r0 = r14.t; if (r0 == 0) goto L_0x007a; L_0x000c: r0 = 1; r7 = r0; L_0x000e: r0 = r14.r; r0 = r0.a(); if (r0 != 0) goto L_0x0018; L_0x0016: if (r7 == 0) goto L_0x007d; L_0x0018: r0 = 1; r10 = r0; L_0x001a: if (r10 != 0) goto L_0x0095; L_0x001c: r0 = r14.d; r0 = r0.b; if (r0 != 0) goto L_0x0028; L_0x0022: r0 = -1; r0 = (r8 > r0 ? 1 : (r8 == r0 ? 0 : -1)); if (r0 != 0) goto L_0x0032; L_0x0028: r0 = r14.p; r0 = r12 - r0; r2 = 2000; // 0x7d0 float:2.803E-42 double:9.88E-321; r0 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1)); if (r0 <= 0) goto L_0x0095; L_0x0032: r14.p = r12; r0 = r14.d; r1 = r14.f; r1 = r1.size(); r0.a = r1; r0 = r14.c; r1 = r14.f; r2 = r14.o; r4 = r14.m; r6 = r14.d; r0.getChunkOperation(r1, r2, r4, r6); r0 = r14.d; r0 = r0.a; r0 = r14.a(r0); r1 = r14.d; r1 = r1.b; if (r1 != 0) goto L_0x0080; L_0x0059: r4 = -1; L_0x005b: r0 = r14.b; r2 = r14.m; r1 = r14; r6 = r10; r0 = r0.update(r1, r2, r4, r6); if (r7 == 0) goto L_0x0087; L_0x0067: r0 = r14.v; r0 = r12 - r0; r2 = r14.u; r2 = (long) r2; r2 = r14.c(r2); r0 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1)); if (r0 < 0) goto L_0x0079; L_0x0076: r14.e(); L_0x0079: return; L_0x007a: r0 = 0; r7 = r0; goto L_0x000e; L_0x007d: r0 = 0; r10 = r0; goto L_0x001a; L_0x0080: if (r0 == 0) goto L_0x0095; L_0x0082: r4 = r14.d(); goto L_0x005b; L_0x0087: r1 = r14.r; r1 = r1.a(); if (r1 != 0) goto L_0x0079; L_0x008f: if (r0 == 0) goto L_0x0079; L_0x0091: r14.f(); goto L_0x0079; L_0x0095: r4 = r8; goto L_0x005b; */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.exoplayer.chunk.ChunkSampleSource.c():void"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test (timeout=180000)\n public void testDegenerateRegions() throws Exception {\n TableName table = TableName.valueOf(\"tableDegenerateRegions\");\n try {\n setupTable(table);\n assertNoErrors(doFsck(conf,false));\n assertEquals(ROWKEYS.length, countRows());\n\n // Now let's mess it up, by adding a region with a duplicate startkey\n HRegionInfo hriDupe =\n createRegion(tbl.getTableDescriptor(), Bytes.toBytes(\"B\"), Bytes.toBytes(\"B\"));\n TEST_UTIL.getHBaseCluster().getMaster().assignRegion(hriDupe);\n TEST_UTIL.getHBaseCluster().getMaster().getAssignmentManager()\n .waitForAssignment(hriDupe);\n ServerName server = regionStates.getRegionServerOfRegion(hriDupe);\n TEST_UTIL.assertRegionOnServer(hriDupe, server, REGION_ONLINE_TIMEOUT);\n\n HBaseFsck hbck = doFsck(conf,false);\n assertErrors(hbck, new ERROR_CODE[] { ERROR_CODE.DEGENERATE_REGION, ERROR_CODE.DUPE_STARTKEYS,\n ERROR_CODE.DUPE_STARTKEYS });\n assertEquals(2, hbck.getOverlapGroups(table).size());\n assertEquals(ROWKEYS.length, countRows());\n\n // fix the degenerate region.\n doFsck(conf,true);\n\n // check that the degenerate region is gone and no data loss\n HBaseFsck hbck2 = doFsck(conf,false);\n assertNoErrors(hbck2);\n assertEquals(0, hbck2.getOverlapGroups(table).size());\n assertEquals(ROWKEYS.length, countRows());\n } finally {\n cleanupTable(table);\n }\n }", "public void cleanupOldBlocks (long threshTime) ;", "@Test (timeout=180000)\n public void testDupeRegion() throws Exception {\n TableName table =\n TableName.valueOf(\"tableDupeRegion\");\n try {\n setupTable(table);\n assertNoErrors(doFsck(conf, false));\n assertEquals(ROWKEYS.length, countRows());\n\n // Now let's mess it up, by adding a region with a duplicate startkey\n HRegionInfo hriDupe =\n createRegion(tbl.getTableDescriptor(), Bytes.toBytes(\"A\"), Bytes.toBytes(\"B\"));\n\n TEST_UTIL.getHBaseCluster().getMaster().assignRegion(hriDupe);\n TEST_UTIL.getHBaseCluster().getMaster().getAssignmentManager()\n .waitForAssignment(hriDupe);\n ServerName server = regionStates.getRegionServerOfRegion(hriDupe);\n TEST_UTIL.assertRegionOnServer(hriDupe, server, REGION_ONLINE_TIMEOUT);\n\n // Yikes! The assignment manager can't tell between diff between two\n // different regions with the same start/endkeys since it doesn't\n // differentiate on ts/regionId! We actually need to recheck\n // deployments!\n while (findDeployedHSI(getDeployedHRIs((HBaseAdmin) admin), hriDupe) == null) {\n Thread.sleep(250);\n }\n\n LOG.debug(\"Finished assignment of dupe region\");\n\n // TODO why is dupe region different from dupe start keys?\n HBaseFsck hbck = doFsck(conf, false);\n assertErrors(hbck, new ERROR_CODE[] { ERROR_CODE.DUPE_STARTKEYS,\n ERROR_CODE.DUPE_STARTKEYS});\n assertEquals(2, hbck.getOverlapGroups(table).size());\n assertEquals(ROWKEYS.length, countRows()); // seems like the \"bigger\" region won.\n\n // fix the degenerate region.\n doFsck(conf,true);\n\n // check that the degenerate region is gone and no data loss\n HBaseFsck hbck2 = doFsck(conf,false);\n assertNoErrors(hbck2);\n assertEquals(0, hbck2.getOverlapGroups(table).size());\n assertEquals(ROWKEYS.length, countRows());\n } finally {\n cleanupTable(table);\n }\n }", "public int numberOfBlocksToRemove() {\r\n return 105;\r\n }", "int numberOfBlocksToRemove();", "public void handlesBlockingRegionDrag() {\r\n \t\tObject[] cells = graph.getDescendants(graph.getSelectionCells());\r\n \t\t// Put cells not in a blocking region to back\r\n \t\tHashSet<Object> putBack = new HashSet<Object>();\r\n \t\tfor (Object cell2 : cells) {\r\n \t\t\tif (cell2 instanceof JmtCell && ((JmtCell) cell2).parentChanged()) {\r\n \t\t\t\t// This cell was moved in, out or between blocking regions\r\n \t\t\t\tJmtCell cell = (JmtCell) cell2;\r\n \t\t\t\tObject key = ((CellComponent) cell.getUserObject()).getKey();\r\n \t\t\t\tObject oldRegionKey, newRegionKey;\r\n \t\t\t\tif (!(cell.getParent() instanceof BlockingRegion)) {\r\n \t\t\t\t\t// Object removed from blocking region\r\n \t\t\t\t\tputBack.add(cell2);\r\n \t\t\t\t\toldRegionKey = ((BlockingRegion) cell.getPrevParent()).getKey();\r\n \t\t\t\t\tmodel.removeRegionStation(oldRegionKey, key);\r\n \t\t\t\t\t// If region is empty, removes region too\r\n \t\t\t\t\tif (model.getBlockingRegionStations(oldRegionKey).size() == 0) {\r\n \t\t\t\t\t\tmodel.deleteBlockingRegion(oldRegionKey);\r\n \t\t\t\t\t}\r\n \t\t\t\t\t// Allow adding of removed objects to a new blocking region\r\n \t\t\t\t\tenableAddBlockingRegion(true);\r\n \t\t\t\t} else if (cell.getPrevParent() instanceof BlockingRegion) {\r\n \t\t\t\t\t// Object changed blocking region\r\n \t\t\t\t\toldRegionKey = ((BlockingRegion) cell.getPrevParent()).getKey();\r\n \t\t\t\t\tmodel.removeRegionStation(oldRegionKey, key);\r\n \t\t\t\t\t// If region is empty, removes region too\r\n \t\t\t\t\tif (model.getBlockingRegionStations(oldRegionKey).size() == 0) {\r\n \t\t\t\t\t\tmodel.deleteBlockingRegion(oldRegionKey);\r\n \t\t\t\t\t}\r\n \t\t\t\t\tnewRegionKey = ((BlockingRegion) cell.getParent()).getKey();\r\n \t\t\t\t\tmodel.addRegionStation(newRegionKey, key);\r\n \t\t\t\t} else {\r\n \t\t\t\t\t// Object added to a blocking region\r\n \t\t\t\t\tnewRegionKey = ((BlockingRegion) cell.getParent()).getKey();\r\n \t\t\t\t\tif (!model.addRegionStation(newRegionKey, key)) {\r\n \t\t\t\t\t\t// object cannot be added to blocking region (for\r\n \t\t\t\t\t\t// example it's a source)\r\n \t\t\t\t\t\tcell.removeFromParent();\r\n \t\t\t\t\t\tgraph.getModel().insert(new Object[] { cell }, null, null, null, null);\r\n \t\t\t\t\t\tputBack.add(cell);\r\n \t\t\t\t\t}\r\n \t\t\t\t\t// Doesn't allow adding of selected objects to a new\r\n \t\t\t\t\t// blocking region\r\n \t\t\t\t\tenableAddBlockingRegion(false);\r\n \t\t\t\t}\r\n \t\t\t\t// Resets parent for this cell\r\n \t\t\t\tcell.resetParent();\r\n \t\t\t}\r\n \t\t\t// Avoid insertion of a blocking region in an other\r\n \t\t\telse if (cell2 instanceof BlockingRegion) {\r\n \t\t\t\tBlockingRegion region = (BlockingRegion) cell2;\r\n \t\t\t\tif (region.getParent() != null) {\r\n \t\t\t\t\tregion.removeFromParent();\r\n \t\t\t\t\tgraph.getModel().insert(new Object[] { region }, null, null, null, null);\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\t// Puts cells removed from blocking regiont on background\r\n \t\tgraph.getModel().toBack(putBack.toArray());\r\n \t}", "private void repairGenome() {\n if (checkGenome(this.code)) {\n return;\n }\n int[] counters = new int[8];\n for (int c : code) { counters[c]++; }\n for (int i = 0; i < 8; ++i) {\n if (counters[i] == 0) {\n while (true) {\n int newPos = r.nextInt(GENOME_SIZE);\n if (counters[this.code[newPos]] > 1) {\n counters[this.code[newPos]]--;\n this.code[newPos] = i;\n break;\n }\n }\n }\n }\n }", "int regionSplitBits4DownSampledTable();", "public boolean IsDisappearing(){\r\n for (int i = 2; i < 10; i++) {\r\n ArrayList<Block> blocks = blockList.GetBlockList(i);//get all blocks\r\n int[] indexI = new int[blocks.size()], indexJ = new int[blocks.size()];\r\n //put i and j of All blocks with same color on i&j arrays\r\n for (int j = 0; j < indexI.length; j++) {\r\n indexI[j] = blocks.get(j).getI();\r\n indexJ[j] = blocks.get(j).getJ();\r\n }\r\n //check if 2 block beside each other if yes return true\r\n if (CheckBoom(indexI, indexJ))\r\n return true;\r\n else if (blocks.size() == 3) {//else check if there is another block have same color if yes swap on i,j array\r\n int temp = indexI[2];\r\n indexI[2] = indexI[1];\r\n indexI[1] = temp;\r\n temp = indexJ[2];\r\n indexJ[2] = indexJ[1];\r\n indexJ[1] = temp;\r\n if (CheckBoom(indexI, indexJ))//check\r\n return true;\r\n else {//else check from another side\r\n temp = indexI[0];\r\n indexI[0] = indexI[2];\r\n indexI[2] = temp;\r\n temp = indexJ[0];\r\n indexJ[0] = indexJ[2];\r\n indexJ[2] = temp;\r\n if (CheckBoom(indexI, indexJ))//check\r\n return true;\r\n }\r\n }\r\n }\r\n //if not return true so its false\r\n return false;\r\n }", "@Test\n public void testNonConsecutiveBlocks()\n {\n long blockSize = 1000;\n int noOfBlocks = (int)((testMeta.dataFile.length() / blockSize)\n + (((testMeta.dataFile.length() % blockSize) == 0) ? 0 : 1));\n\n testMeta.blockReader.beginWindow(1);\n\n for (int i = 0; i < 10; i++) {\n for (int j = 0; j < Math.ceil(noOfBlocks / 10.0); j++) {\n int blockNo = 10 * j + i;\n if (blockNo >= noOfBlocks) {\n continue;\n }\n BlockMetadata.FileBlockMetadata blockMetadata = new BlockMetadata.FileBlockMetadata(s3Directory + FILE_1,\n blockNo, blockNo * blockSize,\n blockNo == noOfBlocks - 1 ? testMeta.dataFile.length() : (blockNo + 1) * blockSize,\n blockNo == noOfBlocks - 1, blockNo - 1, testMeta.dataFile.length());\n testMeta.blockReader.blocksMetadataInput.process(blockMetadata);\n }\n }\n\n testMeta.blockReader.endWindow();\n\n List<Object> messages = testMeta.messageSink.collectedTuples;\n Assert.assertEquals(\"No of records\", testMeta.messages.size(), messages.size());\n\n Collections.sort(testMeta.messages, new Comparator<String[]>()\n {\n @Override\n public int compare(String[] rec1, String[] rec2)\n {\n return compareStringArrayRecords(rec1, rec2);\n }\n });\n\n Collections.sort(messages, new Comparator<Object>()\n {\n @Override\n public int compare(Object object1, Object object2)\n {\n String[] rec1 = new String((byte[])object1).split(\",\");\n String[] rec2 = new String((byte[])object2).split(\",\");\n return compareStringArrayRecords(rec1, rec2);\n }\n });\n for (int i = 0; i < messages.size(); i++) {\n byte[] msg = (byte[])messages.get(i);\n Assert.assertTrue(\"line \" + i, Arrays.equals(new String(msg).split(\",\"), testMeta.messages.get(i)));\n }\n }", "@Test (timeout=180000)\n public void testRegionHole() throws Exception {\n TableName table =\n TableName.valueOf(\"tableRegionHole\");\n try {\n setupTable(table);\n assertEquals(ROWKEYS.length, countRows());\n\n // Mess it up by leaving a hole in the assignment, meta, and hdfs data\n admin.disableTable(table);\n deleteRegion(conf, tbl.getTableDescriptor(), Bytes.toBytes(\"B\"),\n Bytes.toBytes(\"C\"), true, true, true);\n admin.enableTable(table);\n\n HBaseFsck hbck = doFsck(conf, false);\n assertErrors(hbck, new ERROR_CODE[] {\n ERROR_CODE.HOLE_IN_REGION_CHAIN});\n // holes are separate from overlap groups\n assertEquals(0, hbck.getOverlapGroups(table).size());\n\n // fix hole\n doFsck(conf, true);\n\n // check that hole fixed\n assertNoErrors(doFsck(conf,false));\n assertEquals(ROWKEYS.length - 2 , countRows()); // lost a region so lost a row\n } finally {\n cleanupTable(table);\n }\n }", "public abstract void removeBlock();", "int regionSplitBits4PVTable();", "public void RemoveBlock(int NumOfB,ArrayList<Block> blocks,int[] i,int[] j){\r\n try {\r\n //2 blocks\r\n if (NumOfB == 2) {\r\n //update BlockList and map matrix\r\n map[i[0]][j[0]] = '0';\r\n map[i[1]][j[1]] = '0';\r\n blockList.RemovBlock(blockList.getBlock(blocks.get(0).getTypeOfBlock(), i[1], j[1]), blocks.get(1).getTypeOfBlock());\r\n blockList.RemovBlock(blockList.getBlock(blocks.get(0).getTypeOfBlock(), i[0], j[0]), blocks.get(0).getTypeOfBlock());\r\n }\r\n //3 blocks\r\n else {\r\n //update BlockList and map matrix\r\n map[i[0]][j[0]] = '0';\r\n map[i[1]][j[1]] = '0';\r\n map[i[2]][j[2]] = '0';\r\n blockList.RemovBlock(blocks.get(2), blocks.get(2).getTypeOfBlock());\r\n blockList.RemovBlock(blocks.get(1), blocks.get(1).getTypeOfBlock());\r\n blockList.RemovBlock(blocks.get(0), blocks.get(0).getTypeOfBlock());\r\n }\r\n gamePage.Sounds(2);//remove sound\r\n MoveBlock(2);//check if there is block will move down\r\n }catch (ArrayIndexOutOfBoundsException e) {\r\n\r\n }\r\n }", "@Test(timeout=120000)\n public void testMissingFirstRegion() throws Exception {\n TableName table = TableName.valueOf(\"testMissingFirstRegion\");\n try {\n setupTable(table);\n assertEquals(ROWKEYS.length, countRows());\n\n // Mess it up by leaving a hole in the assignment, meta, and hdfs data\n admin.disableTable(table);\n deleteRegion(conf, tbl.getTableDescriptor(), Bytes.toBytes(\"\"), Bytes.toBytes(\"A\"), true,\n true, true);\n admin.enableTable(table);\n\n HBaseFsck hbck = doFsck(conf, false);\n assertErrors(hbck, new ERROR_CODE[] { ERROR_CODE.FIRST_REGION_STARTKEY_NOT_EMPTY });\n // fix hole\n doFsck(conf, true);\n // check that hole fixed\n assertNoErrors(doFsck(conf, false));\n } finally {\n cleanupTable(table);\n }\n }", "void scanunique() {\n\t\tint oldline, newline;\n\t\tnode psymbol;\n\n\t\tfor (newline = 1; newline <= newinfo.maxLine; newline++) {\n\t\t\tpsymbol = newinfo.symbol[newline];\n\t\t\tif (psymbol.symbolIsUnique()) { // 1 use in each file\n\t\t\t\toldline = psymbol.linenum;\n\t\t\t\tnewinfo.other[newline] = oldline; // record 1-1 map\n\t\t\t\toldinfo.other[oldline] = newline;\n\t\t\t}\n\t\t}\n\t\tnewinfo.other[0] = 0;\n\t\toldinfo.other[0] = 0;\n\t\tnewinfo.other[newinfo.maxLine + 1] = oldinfo.maxLine + 1;\n\t\toldinfo.other[oldinfo.maxLine + 1] = newinfo.maxLine + 1;\n\t}", "void m63702c() {\n for (C17455a c17455a : this.f53839c) {\n c17455a.f53844b.clear();\n }\n }", "public final synchronized void mo5320b() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r6 = this;\n monitor-enter(r6);\n r0 = r6.f24853c;\t Catch:{ all -> 0x004c }\n r1 = 0;\t Catch:{ all -> 0x004c }\n r2 = 0;\t Catch:{ all -> 0x004c }\n if (r0 == 0) goto L_0x0046;\t Catch:{ all -> 0x004c }\n L_0x0007:\n r0 = r6.f24851a;\t Catch:{ all -> 0x004c }\n if (r0 != 0) goto L_0x0013;\t Catch:{ all -> 0x004c }\n L_0x000b:\n r0 = r6.f24854d;\t Catch:{ all -> 0x004c }\n r3 = r6.f24853c;\t Catch:{ all -> 0x004c }\n r0.deleteFile(r3);\t Catch:{ all -> 0x004c }\n goto L_0x0046;\t Catch:{ all -> 0x004c }\n L_0x0013:\n r0 = com.google.android.m4b.maps.cg.bx.m23058b();\t Catch:{ all -> 0x004c }\n r3 = r6.f24854d;\t Catch:{ IOException -> 0x0032, all -> 0x002f }\n r4 = r6.f24853c;\t Catch:{ IOException -> 0x0032, all -> 0x002f }\n r3 = r3.openFileOutput(r4, r1);\t Catch:{ IOException -> 0x0032, all -> 0x002f }\n r4 = r6.f24851a;\t Catch:{ IOException -> 0x0033 }\n r4 = r4.m20837d();\t Catch:{ IOException -> 0x0033 }\n r3.write(r4);\t Catch:{ IOException -> 0x0033 }\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x004c }\n L_0x002b:\n com.google.android.m4b.maps.ap.C4655c.m20770a(r3);\t Catch:{ all -> 0x004c }\n goto L_0x0046;\n L_0x002f:\n r1 = move-exception;\n r3 = r2;\n goto L_0x003f;\n L_0x0032:\n r3 = r2;\n L_0x0033:\n r4 = r6.f24854d;\t Catch:{ all -> 0x003e }\n r5 = r6.f24853c;\t Catch:{ all -> 0x003e }\n r4.deleteFile(r5);\t Catch:{ all -> 0x003e }\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x004c }\n goto L_0x002b;\t Catch:{ all -> 0x004c }\n L_0x003e:\n r1 = move-exception;\t Catch:{ all -> 0x004c }\n L_0x003f:\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x004c }\n com.google.android.m4b.maps.ap.C4655c.m20770a(r3);\t Catch:{ all -> 0x004c }\n throw r1;\t Catch:{ all -> 0x004c }\n L_0x0046:\n r6.f24851a = r2;\t Catch:{ all -> 0x004c }\n r6.f24852b = r1;\t Catch:{ all -> 0x004c }\n monitor-exit(r6);\n return;\n L_0x004c:\n r0 = move-exception;\n monitor-exit(r6);\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.m4b.maps.cg.q.b():void\");\n }", "public void collapseBlocks() {\n // Create it if it's null\n if (graph_bcc == null) {\n // Create graph parametrics (Only add linear time algorithms here...)\n graph_bcc = new BiConnectedComponents(graph);\n graph2p_bcc = new BiConnectedComponents(new UniTwoPlusDegreeGraph(graph));\n }\n BiConnectedComponents bcc = graph_bcc, bcc_2p = graph2p_bcc; if (bcc != null && bcc_2p != null) {\n // Get the vertex to block lookup\n Map<String,Set<MyGraph>> v_to_b = bcc.getVertexToBlockMap();\n // Go through the entities and accumulate the positions\n Map<MyGraph,Double> x_sum = new HashMap<MyGraph,Double>(), y_sum = new HashMap<MyGraph,Double>();\n Iterator<String> it_e = entity_to_wxy.keySet().iterator();\n while (it_e.hasNext()) {\n String entity = it_e.next(); Point2D pt = entity_to_wxy.get(entity);\n\tif (v_to_b.containsKey(entity)) {\n\t Iterator<MyGraph> it_mg = v_to_b.get(entity).iterator();\n\t while (it_mg.hasNext()) {\n\t MyGraph mg = it_mg.next();\n\t if (x_sum.containsKey(mg) == false) { x_sum.put(mg,0.0); y_sum.put(mg,0.0); }\n\t x_sum.put(mg,x_sum.get(mg)+pt.getX()); y_sum.put(mg,y_sum.get(mg)+pt.getY());\n\t }\n } else System.err.println(\"Vertex To Block Lookup missing \\\"\" + entity + \"\\\"\");\n }\n // Now position those entities that aren't cut vertices at the center of the graph\n it_e = entity_to_wxy.keySet().iterator();\n while (it_e.hasNext()) {\n String entity = it_e.next(); Point2D pt = entity_to_wxy.get(entity);\n\tif (v_to_b.containsKey(entity) && bcc.getCutVertices().contains(entity) == false) {\n MyGraph mg = v_to_b.get(entity).iterator().next();\n\t entity_to_wxy.put(entity, new Point2D.Double(x_sum.get(mg)/mg.getNumberOfEntities(),y_sum.get(mg)/mg.getNumberOfEntities()));\n\t transform(entity);\n\t}\n }\n // Re-render\n zoomToFit(); repaint();\n }\n }", "@Override\r\n public int numberOfBlocksToRemove() {\r\n return blocks().size();\r\n }", "public int getBlockID()\r\n/* 57: */ {\r\n/* 58: 46 */ return RedPowerMachine.blockFrame.cm;\r\n/* 59: */ }", "@Override\n \tpublic void regionsRemoved(RegionEvent evt) {\n \t\t\n \t}", "public void remove( int position )\n {\n caller = \"remove\";\n byte byteSize = memoryPool[position];\n Integer size = (int)byteSize;\n // remove the record starting at the given position\n for ( int i = 0; i < size; i++ )\n {\n memoryPool[position + i] = 0;\n }\n\n findBlock( position );\n freeBlock = new HashMap<Integer, Integer>( 1 );\n freeBlock.put( position, size );\n freeBlockList.add( freeBlock );\n Object[] keyArray =\n freeBlockList.getCurrentElement().keySet().toArray();\n int key = (Integer)keyArray[0];\n\n caller = \"check\";\n int currentValue = freeBlockList.getCurrentElement().get( key );\n int mergePoint1 = position + currentValue;\n int rightKeyMatch = findBlock( mergePoint1 );\n\n int mergePoint2 = position;\n int leftKeyMatch = -1;\n int priorValue = -1;\n int key2 = -1;\n if ( 1==1)\n {\n findBlock(mergePoint2);\n freeBlockList.previous();\n if ( !( freeBlockList.getCurrent().equals( freeBlockList.getHead() ) )\n && !( freeBlockList.getCurrent().equals( freeBlockList.getTail() ) ) &&\n !( freeBlockList.getCurrent().equals( null )))\n {\n Object[] keyArray2 =\n freeBlockList.getCurrentElement().keySet().toArray();\n key2 = (Integer)keyArray2[0];\n priorValue = freeBlockList.getCurrentElement().get( key2 );\n leftKeyMatch = key2 + priorValue;\n }\n\n }\n\n if ( rightKeyMatch == mergePoint1 )\n {\n findBlock(mergePoint1);\n freeBlockList.previous();\n freeBlockList.removeCurrent();\n int rightValue =\n freeBlockList.getCurrentElement().get( rightKeyMatch );\n\n freeBlockList.getCurrentElement().clear();\n freeBlockList.getCurrentElement().put(\n position,\n currentValue + rightValue );\n //if()\n }\n if(leftKeyMatch == mergePoint2) {\n findBlock(mergePoint2);\n freeBlockList.previous();\n freeBlockList.removeCurrent();\n int rightValue =\n freeBlockList.getCurrentElement().get(leftKeyMatch);\n\n freeBlockList.getCurrentElement().clear();\n freeBlockList.getCurrentElement().put(\n key2,\n priorValue + rightValue );\n }\n\n }", "void ompleBlocsHoritzontals() {\r\n\r\n for (int i = 0; i < N; i = i + SRN) // for diagonal box, start coordinates->i==j \r\n {\r\n ompleBloc(i, i);\r\n }\r\n }", "@Override\n\tpublic int getReplaceBlock() {\n\t\treturn 0;\n\t}", "@Test (timeout=180000)\n public void testSidelineOverlapRegion() throws Exception {\n TableName table =\n TableName.valueOf(\"testSidelineOverlapRegion\");\n try {\n setupTable(table);\n assertEquals(ROWKEYS.length, countRows());\n\n // Mess it up by creating an overlap\n MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster();\n HMaster master = cluster.getMaster();\n HRegionInfo hriOverlap1 =\n createRegion(tbl.getTableDescriptor(), Bytes.toBytes(\"A\"), Bytes.toBytes(\"AB\"));\n master.assignRegion(hriOverlap1);\n master.getAssignmentManager().waitForAssignment(hriOverlap1);\n HRegionInfo hriOverlap2 =\n createRegion(tbl.getTableDescriptor(), Bytes.toBytes(\"AB\"), Bytes.toBytes(\"B\"));\n master.assignRegion(hriOverlap2);\n master.getAssignmentManager().waitForAssignment(hriOverlap2);\n\n HBaseFsck hbck = doFsck(conf, false);\n assertErrors(hbck, new ERROR_CODE[] {ERROR_CODE.DUPE_STARTKEYS,\n ERROR_CODE.DUPE_STARTKEYS, ERROR_CODE.OVERLAP_IN_REGION_CHAIN});\n assertEquals(3, hbck.getOverlapGroups(table).size());\n assertEquals(ROWKEYS.length, countRows());\n\n // mess around the overlapped regions, to trigger NotServingRegionException\n Multimap<byte[], HbckInfo> overlapGroups = hbck.getOverlapGroups(table);\n ServerName serverName = null;\n byte[] regionName = null;\n for (HbckInfo hbi: overlapGroups.values()) {\n if (\"A\".equals(Bytes.toString(hbi.getStartKey()))\n && \"B\".equals(Bytes.toString(hbi.getEndKey()))) {\n regionName = hbi.getRegionName();\n\n // get an RS not serving the region to force bad assignment info in to META.\n int k = cluster.getServerWith(regionName);\n for (int i = 0; i < 3; i++) {\n if (i != k) {\n HRegionServer rs = cluster.getRegionServer(i);\n serverName = rs.getServerName();\n break;\n }\n }\n\n HBaseFsckRepair.closeRegionSilentlyAndWait((HConnection) connection,\n cluster.getRegionServer(k).getServerName(), hbi.getHdfsHRI());\n admin.offline(regionName);\n break;\n }\n }\n\n assertNotNull(regionName);\n assertNotNull(serverName);\n try (Table meta = connection.getTable(TableName.META_TABLE_NAME, tableExecutorService)) {\n Put put = new Put(regionName);\n put.add(HConstants.CATALOG_FAMILY, HConstants.SERVER_QUALIFIER,\n Bytes.toBytes(serverName.getHostAndPort()));\n meta.put(put);\n }\n\n // fix the problem.\n HBaseFsck fsck = new HBaseFsck(conf, hbfsckExecutorService);\n fsck.connect();\n fsck.setDisplayFullReport(); // i.e. -details\n fsck.setTimeLag(0);\n fsck.setFixAssignments(true);\n fsck.setFixMeta(true);\n fsck.setFixHdfsHoles(true);\n fsck.setFixHdfsOverlaps(true);\n fsck.setFixHdfsOrphans(true);\n fsck.setFixVersionFile(true);\n fsck.setSidelineBigOverlaps(true);\n fsck.setMaxMerge(2);\n fsck.onlineHbck();\n fsck.close();\n\n // verify that overlaps are fixed, and there are less rows\n // since one region is sidelined.\n HBaseFsck hbck2 = doFsck(conf,false);\n assertNoErrors(hbck2);\n assertEquals(0, hbck2.getOverlapGroups(table).size());\n assertTrue(ROWKEYS.length > countRows());\n } finally {\n cleanupTable(table);\n }\n }", "public void testConstructors()\n throws IOException\n {\n HeaderBlockWriter block = new HeaderBlockWriter();\n ByteArrayOutputStream output = new ByteArrayOutputStream(512);\n\n block.writeBlocks(output);\n byte[] copy = output.toByteArray();\n byte[] expected =\n {\n ( byte ) 0xD0, ( byte ) 0xCF, ( byte ) 0x11, ( byte ) 0xE0,\n ( byte ) 0xA1, ( byte ) 0xB1, ( byte ) 0x1A, ( byte ) 0xE1,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0x3B, ( byte ) 0x00, ( byte ) 0x03, ( byte ) 0x00,\n ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0x09, ( byte ) 0x00,\n ( byte ) 0x06, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0x00, ( byte ) 0x10, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF\n };\n\n assertEquals(expected.length, copy.length);\n for (int j = 0; j < 512; j++)\n {\n assertEquals(\"testing byte \" + j, expected[ j ], copy[ j ]);\n }\n\n // verify we can read a 'good' HeaderBlockWriter (also test\n // getPropertyStart)\n block.setPropertyStart(0x87654321);\n output = new ByteArrayOutputStream(512);\n block.writeBlocks(output);\n assertEquals(0x87654321,\n new HeaderBlockReader(new ByteArrayInputStream(output\n .toByteArray())).getPropertyStart());\n }", "private void m29109d() {\n PersistentConfiguration cVar = this.f22554b;\n if (cVar != null) {\n if (C6804i.m29033a(cVar.getString(\"UTDID2\"))) {\n String string = this.f22554b.getString(\"UTDID\");\n if (!C6804i.m29033a(string)) {\n m29110f(string);\n }\n }\n boolean z = false;\n String str = \"DID\";\n if (!C6804i.m29033a(this.f22554b.getString(str))) {\n this.f22554b.remove(str);\n z = true;\n }\n String str2 = \"EI\";\n if (!C6804i.m29033a(this.f22554b.getString(str2))) {\n this.f22554b.remove(str2);\n z = true;\n }\n String str3 = \"SI\";\n if (!C6804i.m29033a(this.f22554b.getString(str3))) {\n this.f22554b.remove(str3);\n z = true;\n }\n if (z) {\n this.f22554b.commit();\n }\n }\n }", "private void resetMBPattern()\n {\n codedBlockPattern = 0;\n }", "public void a()\r\n/* 49: */ {\r\n/* 50: 64 */ HashSet<BlockPosition> localHashSet = Sets.newHashSet();\r\n/* 51: */ \r\n/* 52: 66 */ int m = 16;\r\n/* 53: 67 */ for (int n = 0; n < 16; n++) {\r\n/* 54: 68 */ for (int i1 = 0; i1 < 16; i1++) {\r\n/* 55: 69 */ for (int i2 = 0; i2 < 16; i2++) {\r\n/* 56: 70 */ if ((n == 0) || (n == 15) || (i1 == 0) || (i1 == 15) || (i2 == 0) || (i2 == 15))\r\n/* 57: */ {\r\n/* 58: 74 */ double d1 = n / 15.0F * 2.0F - 1.0F;\r\n/* 59: 75 */ double d2 = i1 / 15.0F * 2.0F - 1.0F;\r\n/* 60: 76 */ double d3 = i2 / 15.0F * 2.0F - 1.0F;\r\n/* 61: 77 */ double d4 = Math.sqrt(d1 * d1 + d2 * d2 + d3 * d3);\r\n/* 62: */ \r\n/* 63: 79 */ d1 /= d4;\r\n/* 64: 80 */ d2 /= d4;\r\n/* 65: 81 */ d3 /= d4;\r\n/* 66: */ \r\n/* 67: 83 */ float f2 = this.i * (0.7F + this.d.rng.nextFloat() * 0.6F);\r\n/* 68: 84 */ double d6 = this.e;\r\n/* 69: 85 */ double d8 = this.f;\r\n/* 70: 86 */ double d10 = this.g;\r\n/* 71: */ \r\n/* 72: 88 */ float f3 = 0.3F;\r\n/* 73: 89 */ while (f2 > 0.0F)\r\n/* 74: */ {\r\n/* 75: 90 */ BlockPosition localdt = new BlockPosition(d6, d8, d10);\r\n/* 76: 91 */ Block localbec = this.d.getBlock(localdt);\r\n/* 77: 93 */ if (localbec.getType().getMaterial() != Material.air)\r\n/* 78: */ {\r\n/* 79: 94 */ float f4 = this.h != null ? this.h.a(this, this.d, localdt, localbec) : localbec.getType().a((Entity)null);\r\n/* 80: 95 */ f2 -= (f4 + 0.3F) * 0.3F;\r\n/* 81: */ }\r\n/* 82: 98 */ if ((f2 > 0.0F) && ((this.h == null) || (this.h.a(this, this.d, localdt, localbec, f2)))) {\r\n/* 83: 99 */ localHashSet.add(localdt);\r\n/* 84: */ }\r\n/* 85:102 */ d6 += d1 * 0.300000011920929D;\r\n/* 86:103 */ d8 += d2 * 0.300000011920929D;\r\n/* 87:104 */ d10 += d3 * 0.300000011920929D;\r\n/* 88:105 */ f2 -= 0.225F;\r\n/* 89: */ }\r\n/* 90: */ }\r\n/* 91: */ }\r\n/* 92: */ }\r\n/* 93: */ }\r\n/* 94:111 */ this.j.addAll(localHashSet);\r\n/* 95: */ \r\n/* 96:113 */ float f1 = this.i * 2.0F;\r\n/* 97: */ \r\n/* 98:115 */ int i1 = MathUtils.floor(this.e - f1 - 1.0D);\r\n/* 99:116 */ int i2 = MathUtils.floor(this.e + f1 + 1.0D);\r\n/* 100:117 */ int i3 = MathUtils.floor(this.f - f1 - 1.0D);\r\n/* 101:118 */ int i4 = MathUtils.floor(this.f + f1 + 1.0D);\r\n/* 102:119 */ int i5 = MathUtils.floor(this.g - f1 - 1.0D);\r\n/* 103:120 */ int i6 = MathUtils.floor(this.g + f1 + 1.0D);\r\n/* 104:121 */ List<Entity> localList = this.d.b(this.h, new AABB(i1, i3, i5, i2, i4, i6));\r\n/* 105:122 */ Vec3 localbrw = new Vec3(this.e, this.f, this.g);\r\n/* 106:124 */ for (int i7 = 0; i7 < localList.size(); i7++)\r\n/* 107: */ {\r\n/* 108:125 */ Entity localwv = (Entity)localList.get(i7);\r\n/* 109:126 */ if (!localwv.aV())\r\n/* 110: */ {\r\n/* 111:129 */ double d5 = localwv.f(this.e, this.f, this.g) / f1;\r\n/* 112:131 */ if (d5 <= 1.0D)\r\n/* 113: */ {\r\n/* 114:132 */ double d7 = localwv.xPos - this.e;\r\n/* 115:133 */ double d9 = localwv.yPos + localwv.getEyeHeight() - this.f;\r\n/* 116:134 */ double d11 = localwv.zPos - this.g;\r\n/* 117: */ \r\n/* 118:136 */ double d12 = MathUtils.sqrt(d7 * d7 + d9 * d9 + d11 * d11);\r\n/* 119:137 */ if (d12 != 0.0D)\r\n/* 120: */ {\r\n/* 121:141 */ d7 /= d12;\r\n/* 122:142 */ d9 /= d12;\r\n/* 123:143 */ d11 /= d12;\r\n/* 124: */ \r\n/* 125:145 */ double d13 = this.d.a(localbrw, localwv.getAABB());\r\n/* 126:146 */ double d14 = (1.0D - d5) * d13;\r\n/* 127:147 */ localwv.receiveDamage(DamageSource.a(this), (int)((d14 * d14 + d14) / 2.0D * 8.0D * f1 + 1.0D));\r\n/* 128: */ \r\n/* 129:149 */ double d15 = EnchantmentProtection.a(localwv, d14);\r\n/* 130:150 */ localwv.xVelocity += d7 * d15;\r\n/* 131:151 */ localwv.yVelocity += d9 * d15;\r\n/* 132:152 */ localwv.zVelocity += d11 * d15;\r\n/* 133:154 */ if ((localwv instanceof EntityPlayer)) {\r\n/* 134:155 */ this.k.put((EntityPlayer)localwv, new Vec3(d7 * d14, d9 * d14, d11 * d14));\r\n/* 135: */ }\r\n/* 136: */ }\r\n/* 137: */ }\r\n/* 138: */ }\r\n/* 139: */ }\r\n/* 140: */ }", "void scanblocks() {\n\t\tint oldline, newline;\n\t\tint oldfront = 0; // line# of front of a block in old, or 0\n\t\tint newlast = -1; // newline's value during prev. iteration\n\n\t\tfor (oldline = 1; oldline <= oldinfo.maxLine; oldline++)\n\t\t\tblocklen[oldline] = 0;\n\t\tblocklen[oldinfo.maxLine + 1] = UNREAL; // starts a mythical blk\n\n\t\tfor (oldline = 1; oldline <= oldinfo.maxLine; oldline++) {\n\t\t\tnewline = oldinfo.other[oldline];\n\t\t\tif (newline < 0)\n\t\t\t\toldfront = 0; /* no match: not in block */\n\t\t\telse { /* match. */\n\t\t\t\tif (oldfront == 0)\n\t\t\t\t\toldfront = oldline;\n\t\t\t\tif (newline != (newlast + 1))\n\t\t\t\t\toldfront = oldline;\n\t\t\t\t++blocklen[oldfront];\n\t\t\t}\n\t\t\tnewlast = newline;\n\t\t}\n\t}", "public static void fix(World world) {\n \t\tFile regionFolder = new File(Bukkit.getWorldContainer() + File.separator + world.getName() + File.separator + \"region\");\r\n \t\tif (regionFolder.exists()) {\r\n \t\t\t// Loop through all region files of the world\r\n \t\t\tint dx, dz;\r\n \t\t\tint rx, rz;\r\n \t\t\tfor (String regionFileName : regionFolder.list()) {\r\n \t\t\t\t// Validate file\r\n \t\t\t\tFile file = new File(regionFolder + File.separator + regionFileName);\r\n \t\t\t\tif (!file.isFile() || !file.exists()) {\r\n \t\t\t\t\tcontinue;\r\n \t\t\t\t}\r\n \t\t\t\tString[] parts = regionFileName.split(\"\\\\.\");\r\n \t\t\t\tif (parts.length != 4 || !parts[0].equals(\"r\") || !parts[3].equals(\"mca\")) {\r\n \t\t\t\t\tcontinue;\r\n \t\t\t\t}\r\n \t\t\t\t// Obtain the chunk offset of this region file\r\n \t\t\t\ttry {\r\n \t\t\t\t\trx = Integer.parseInt(parts[1]) << 5;\r\n \t\t\t\t\trz = Integer.parseInt(parts[2]) << 5;\r\n \t\t\t\t} catch (Exception ex) {\r\n \t\t\t\t\tcontinue;\r\n \t\t\t\t}\r\n \r\n \t\t\t\t// Is it contained in the cache?\r\n \t\t\t\tReference<RegionFile> ref = RegionFileCacheRef.FILES.get(file);\r\n \t\t\t\tRegionFile reg = null;\r\n \t\t\t\tif (ref != null) {\r\n \t\t\t\t\treg = ref.get();\r\n \t\t\t\t}\r\n \t\t\t\tboolean closeOnFinish = false;\r\n \t\t\t\tif (reg == null) {\r\n \t\t\t\t\tcloseOnFinish = true;\r\n \t\t\t\t\t// Manually load this region file\r\n \t\t\t\t\treg = new RegionFile(file);\r\n \t\t\t\t}\r\n \t\t\t\t// Obtain all generated chunks in this region file\r\n \t\t\t\tfor (dx = 0; dx < 32; dx++) {\r\n \t\t\t\t\tfor (dz = 0; dz < 32; dz++) {\r\n \t\t\t\t\t\tif (reg.c(dx, dz)) {\r\n \t\t\t\t\t\t\t// Region file exists - add it\r\n\t\t\t\t\t\t\tfix(world, rx + dx, rz + dz, true);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\tif (closeOnFinish) {\r\n \t\t\t\t\t// Close the region file stream - we are done with it\r\n \t\t\t\t\treg.c();\r\n \t\t\t\t}\r\n \t\t\t}\r\n\t\t} else {\r\n\t\t\tNoLagg.plugin.log(Level.WARNING, \"Failed to fix world '\" + world.getName() + \"': Region folder is missing!\");\r\n \t\t}\r\n \t}", "@Test\r\n public void testCheckCollisionTankBlocks() {\r\n System.out.println(\"checkCollisionTankBlocks\");\r\n Rectangle r3 = new Rectangle(10, 10, 10, 10);\r\n boolean result = CollisionUtility.checkCollisionTankBlocks(r3);\r\n assertEquals(true, result);\r\n inblocks.remove(0);\r\n result = CollisionUtility.checkCollisionTankBlocks(r3);\r\n assertEquals(false, result);\r\n }", "private void cleanProblematicOverlappedRegions(RegionLocations locations) {\n RegionInfo region = locations.getRegionLocation().getRegion();\n\n boolean isLast = isEmptyStopRow(region.getEndKey());\n\n while (true) {\n Map.Entry<byte[], RegionLocations> overlap =\n isLast ? cache.lastEntry() : cache.lowerEntry(region.getEndKey());\n if (\n overlap == null || overlap.getValue() == locations\n || Bytes.equals(overlap.getKey(), region.getStartKey())\n ) {\n break;\n }\n\n if (LOG.isDebugEnabled()) {\n LOG.debug(\n \"Removing cached location {} (endKey={}) because it overlaps with \"\n + \"new location {} (endKey={})\",\n overlap.getValue(),\n Bytes.toStringBinary(overlap.getValue().getRegionLocation().getRegion().getEndKey()),\n locations, Bytes.toStringBinary(locations.getRegionLocation().getRegion().getEndKey()));\n }\n\n cache.remove(overlap.getKey());\n }\n }", "private final void verifyGhostRegionValues(ComputationalComposedBlock block) throws MPIException {\n\t\tBoundaryIterator boundaryIterator = block.getBoundaryIterator();\n\t\tBoundaryIterator expectedValuesIterator = block.getBoundaryIterator();\n\t\tBoundaryId boundary = new BoundaryId();\n\t\tfor (int d=0; d<2*DIMENSIONALITY; d++) {\n\t\t\tblock.receiveDoneAt(boundary);\n\t\t\tboundaryIterator.setBoundaryToIterate(boundary);\n\t\t\tBoundaryId oppositeBoundary = boundary.oppositeSide();\n\t\t\texpectedValuesIterator.setBoundaryToIterate(oppositeBoundary);\n\t\t\twhile (boundaryIterator.isInField()) {\n\t\t\t\t// Check the ghost values outside the current element.\n\t\t\t\tfor (int offset=1; offset<extent; offset++) {\n\t\t\t\t\tint neighborOffset = offset-1;\n\t\t\t\t\tint directedOffset = boundary.isLowerSide() ? -offset : offset;\n\t\t\t\t\tint directedNeighborOffset = boundary.isLowerSide() ? -neighborOffset : neighborOffset;\n\t\t\t\t\tdouble expected = expectedValuesIterator.currentNeighbor(boundary.getDimension(), directedNeighborOffset);\n\t\t\t\t\tdouble actual = boundaryIterator.currentNeighbor(boundary.getDimension(), directedOffset);\n\t\t\t\t\tassertEquals(expected, actual, 4*Math.ulp(expected));\n\t\t\t\t}\n\t\t\t\tboundaryIterator.next();\n\t\t\t\texpectedValuesIterator.next();\n\t\t\t}\n\t\t}\n\t}", "public void MeasureMovement(int[] dupCellID, int numslices, int b){\r\n\t\tfor (int x = 1; x < b; x = x + 1){ \r\n\t\t\tIJ.selectWindow(dupCellID[x]);\r\n\t\t\tImagePlus TheDuplicate = WindowManager.getCurrentImage();\r\n\t\t\tIJ.run(\"Threshold...\",\"method='Default'\");\r\n\t\t\tnew WaitForUserDialog(\"Threshold\", \"Threshold yeast cell to select the nucleus, then click OK.\").show();\r\n\t\t\tResultsTable res = new ResultsTable();\r\n\t\t\tdouble[] SliceNumY = new double[numslices];\r\n\t\t\tdouble[] SliceNumX = new double[numslices];\r\n\t\t\t\tfor(int z = 1; z < numslices; z = z+1) {\r\n\t\t\t\t\tTheDuplicate.setSlice(z);\r\n\t\t\t\t\tIJ.run(TheDuplicate, \"Analyze Particles...\", \"size=100-550 pixel circularity=0.00-1.00 show=Nothing display clear include add slice\");\r\n\t\t\t\t\tres = Analyzer.getResultsTable();\r\n\t\t\t\t\t\r\n\t\t\t\t\tint MaxY = TheDuplicate.getHeight();\r\n\t\t\t\t\tint Midpoint = MaxY/2; \r\n\t\t\t\t\tint MaxCount = res.getCounter();\r\n\t\t\t\t\tdouble yVal = 0;\r\n\t\t\t\t\tdouble xVal = 0;\r\n\t\t\t\t\tif (MaxCount > 1){\r\n\t\t\t\t\t\tfor (int c = 0; c < (MaxCount - 1); c = c + 1){\r\n\t\t\t\t\t\t\tyVal = res.getValueAsDouble(7, c);\r\n\t\t\t\t\t\t\txVal = res.getValueAsDouble(6, c);\r\n\t\t\t\t\t\t\tif (Math.abs((yVal/0.13) - Midpoint) <= 10 ){\r\n\t\t\t\t\t\t\t\tyVal = res.getValueAsDouble(7, c);\r\n\t\t\t\t\t\t\t\txVal = res.getValueAsDouble(6, c);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * if statement to only record the centre X Y \r\n\t\t\t\t\t * coordinate of the nucleus when 1 object has \r\n\t\t\t\t\t * been found. If more than 1 object is identified\r\n\t\t\t\t\t * then the XY coordinates default to zero to prevent \r\n\t\t\t\t\t * other fluorescent cell components from skewing the data\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (MaxCount > 0 && MaxCount <2) {\r\n\t\t\t\t\t\tyVal = res.getValueAsDouble(7, 0);\r\n\t\t\t\t\t\txVal = res.getValueAsDouble(6, 0);\r\n\t\t\t\t\t\tSliceNumY[z] = yVal;\r\n\t\t\t\t\t\tSliceNumX[z] = xVal; \r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tSliceNumY[z] = 0;\r\n\t\t\t\t\t\tSliceNumX[z] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\toutputinfo(SliceNumY, SliceNumX, numslices); //Write the results to text file\r\n\t\t\tTheDuplicate.changes = false;\t\r\n\t\t\tTheDuplicate.close();\r\n\t\t}\r\n\t}", "public int getInternalBlockLength()\r\n/* 40: */ {\r\n/* 41: 95 */ return 32;\r\n/* 42: */ }", "@Test (timeout=180000)\n public void testMissingRegionInfoQualifier() throws Exception {\n Connection connection = ConnectionFactory.createConnection(conf);\n TableName table = TableName.valueOf(\"testMissingRegionInfoQualifier\");\n try {\n setupTable(table);\n\n // Mess it up by removing the RegionInfo for one region.\n final List<Delete> deletes = new LinkedList<Delete>();\n Table meta = connection.getTable(TableName.META_TABLE_NAME, hbfsckExecutorService);\n MetaScanner.metaScan(connection, new MetaScanner.MetaScannerVisitor() {\n\n @Override\n public boolean processRow(Result rowResult) throws IOException {\n HRegionInfo hri = MetaTableAccessor.getHRegionInfo(rowResult);\n if (hri != null && !hri.getTable().isSystemTable()) {\n Delete delete = new Delete(rowResult.getRow());\n delete.addColumn(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER);\n deletes.add(delete);\n }\n return true;\n }\n\n @Override\n public void close() throws IOException {\n }\n });\n meta.delete(deletes);\n\n // Mess it up by creating a fake hbase:meta entry with no associated RegionInfo\n meta.put(new Put(Bytes.toBytes(table + \",,1361911384013.810e28f59a57da91c66\")).add(\n HConstants.CATALOG_FAMILY, HConstants.SERVER_QUALIFIER, Bytes.toBytes(\"node1:60020\")));\n meta.put(new Put(Bytes.toBytes(table + \",,1361911384013.810e28f59a57da91c66\")).add(\n HConstants.CATALOG_FAMILY, HConstants.STARTCODE_QUALIFIER, Bytes.toBytes(1362150791183L)));\n meta.close();\n\n HBaseFsck hbck = doFsck(conf, false);\n assertTrue(hbck.getErrors().getErrorList().contains(ERROR_CODE.EMPTY_META_CELL));\n\n // fix reference file\n hbck = doFsck(conf, true);\n\n // check that reference file fixed\n assertFalse(hbck.getErrors().getErrorList().contains(ERROR_CODE.EMPTY_META_CELL));\n } finally {\n cleanupTable(table);\n }\n connection.close();\n }", "@Test\n\tpublic void testForwardNonFrameBlockSubstitution() throws InvalidGenomeChange {\n\t\tGenomeChange change1 = new GenomeChange(new GenomePosition(refDict, '+', 1, 6642114, PositionType.ZERO_BASED),\n\t\t\t\t\"TAAACA\", \"GTT\");\n\t\tAnnotation annotation1 = new BlockSubstitutionAnnotationBuilder(infoForward, change1).build();\n\t\tAssert.assertEquals(infoForward.accession, annotation1.transcript.accession);\n\t\tAssert.assertEquals(AnnotationLocation.INVALID_RANK, annotation1.annoLoc.rank);\n\t\tAssert.assertEquals(\"c.691-3_693delinsGTT\", annotation1.ntHGVSDescription);\n\t\tAssert.assertEquals(\"p.Trp231Val\", annotation1.aaHGVSDescription);\n\t\tAssert.assertEquals(ImmutableSortedSet.of(VariantType.NON_FS_SUBSTITUTION, VariantType.SPLICE_ACCEPTOR),\n\t\t\t\tannotation1.effects);\n\n\t\t// deletion of three codons, insertion of one\n\t\tGenomeChange change2 = new GenomeChange(new GenomePosition(refDict, '+', 1, 6642126, PositionType.ZERO_BASED),\n\t\t\t\t\"GTGGTTCAA\", \"ACC\");\n\t\tAnnotation annotation2 = new BlockSubstitutionAnnotationBuilder(infoForward, change2).build();\n\t\tAssert.assertEquals(infoForward.accession, annotation2.transcript.accession);\n\t\tAssert.assertEquals(2, annotation2.annoLoc.rank);\n\t\tAssert.assertEquals(\"c.700_708delinsACC\", annotation2.ntHGVSDescription);\n\t\tAssert.assertEquals(\"p.Val234_Gln236delinsThr\", annotation2.aaHGVSDescription);\n\t\tAssert.assertEquals(ImmutableSortedSet.of(VariantType.NON_FS_SUBSTITUTION), annotation2.effects);\n\n\t\t// deletion of three codons, insertion of one, includes truncation of replacement ref from the right\n\t\tGenomeChange change3 = new GenomeChange(new GenomePosition(refDict, '+', 1, 6642134, PositionType.ZERO_BASED),\n\t\t\t\t\"AGTGGAGGAT\", \"CTT\");\n\t\tAnnotation annotation3 = new BlockSubstitutionAnnotationBuilder(infoForward, change3).build();\n\t\tAssert.assertEquals(infoForward.accession, annotation3.transcript.accession);\n\t\tAssert.assertEquals(2, annotation3.annoLoc.rank);\n\t\tAssert.assertEquals(\"c.708_716delinsCT\", annotation3.ntHGVSDescription);\n\t\tAssert.assertEquals(\"p.Gln236Hisfs*16\", annotation3.aaHGVSDescription);\n\t\tAssert.assertEquals(ImmutableSortedSet.of(VariantType.FS_SUBSTITUTION), annotation3.effects);\n\t}", "@Test\n public void tesInvalidateMissingBlock() throws Exception {\n long blockSize = 1024;\n int heatbeatInterval = 1;\n HdfsConfiguration c = new HdfsConfiguration();\n c.setInt(DFSConfigKeys.DFS_HEARTBEAT_INTERVAL_KEY, heatbeatInterval);\n c.setLong(DFS_BLOCK_SIZE_KEY, blockSize);\n MiniDFSCluster cluster = new MiniDFSCluster.Builder(c).\n numDataNodes(1).build();\n try {\n cluster.waitActive();\n DFSTestUtil.createFile(cluster.getFileSystem(), new Path(\"/a\"),\n blockSize, (short)1, 0);\n\n String bpid = cluster.getNameNode().getNamesystem().getBlockPoolId();\n DataNode dn = cluster.getDataNodes().get(0);\n FsDatasetImpl fsdataset = (FsDatasetImpl) dn.getFSDataset();\n List<ReplicaInfo> replicaInfos = fsdataset.getFinalizedBlocks(bpid);\n assertEquals(1, replicaInfos.size());\n\n ReplicaInfo replicaInfo = replicaInfos.get(0);\n String blockPath = replicaInfo.getBlockURI().getPath();\n String metaPath = replicaInfo.getMetadataURI().getPath();\n File blockFile = new File(blockPath);\n File metaFile = new File(metaPath);\n\n // Mock local block file not found when disk with some exception.\n fsdataset.invalidateMissingBlock(bpid, replicaInfo);\n\n // Assert local block file wouldn't be deleted from disk.\n assertTrue(blockFile.exists());\n // Assert block info would be removed from ReplicaMap.\n assertEquals(\"null\",\n fsdataset.getReplicaString(bpid, replicaInfo.getBlockId()));\n BlockManager blockManager = cluster.getNameNode().\n getNamesystem().getBlockManager();\n GenericTestUtils.waitFor(() ->\n blockManager.getLowRedundancyBlocksCount() == 1, 100, 5000);\n\n // Mock local block file found when disk back to normal.\n FsVolumeSpi.ScanInfo info = new FsVolumeSpi.ScanInfo(\n replicaInfo.getBlockId(), blockFile.getParentFile().getAbsoluteFile(),\n blockFile.getName(), metaFile.getName(), replicaInfo.getVolume());\n fsdataset.checkAndUpdate(bpid, info);\n GenericTestUtils.waitFor(() ->\n blockManager.getLowRedundancyBlocksCount() == 0, 100, 5000);\n } finally {\n cluster.shutdown();\n }\n }", "public void Inverse_macroblock_partition_scanning_process(){\n\t\tx=InverseRasterScan(mbPartIdx, MbPartWidth(mb_type),MbPartHeight(mb_type),16,0);\n\t\ty=InverseRasterScan(mbPartIdx, MbPartWidth(mb_type),MbPartHeight(mb_type),16,1);\n\n\t}", "public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5)\n {\n byte var6 = 0;\n byte var7 = 1;\n\n if (var1.getBlockId(var2 - 1, var3, var4) == this.blockID || var1.getBlockId(var2 + 1, var3, var4) == this.blockID)\n {\n var6 = 1;\n var7 = 0;\n }\n\n int var8;\n\n for (var8 = var3; var1.getBlockId(var2, var8 - 1, var4) == this.blockID; --var8)\n {\n ;\n }\n\n if (var1.getBlockId(var2, var8 - 1, var4) != Block.glowStone.blockID)\n {\n var1.setBlock(var2, var3, var4, 0);\n } else\n {\n int var9;\n\n for (var9 = 1; var9 < 4 && var1.getBlockId(var2, var8 + var9, var4) == this.blockID; ++var9)\n {\n ;\n }\n\n if (var9 == 3 && var1.getBlockId(var2, var8 + var9, var4) == Block.glowStone.blockID)\n {\n boolean var10 = var1.getBlockId(var2 - 1, var3, var4) == this.blockID || var1.getBlockId(var2 + 1, var3, var4) == this.blockID;\n boolean var11 = var1.getBlockId(var2, var3, var4 - 1) == this.blockID || var1.getBlockId(var2, var3, var4 + 1) == this.blockID;\n\n if (var10 && var11)\n {\n var1.setBlock(var2, var3, var4, 0);\n } else if ((var1.getBlockId(var2 + var6, var3, var4 + var7) != Block.glowStone.blockID || var1.getBlockId(var2 - var6, var3, var4 - var7) != this.blockID) && (var1.getBlockId(var2 - var6, var3, var4 - var7) != Block.glowStone.blockID || var1.getBlockId(var2 + var6, var3, var4 + var7) != this.blockID))\n {\n var1.setBlock(var2, var3, var4, 0);\n }\n } else\n {\n var1.setBlock(var2, var3, var4, 0);\n }\n }\n }", "private void DeleteBurnInsOnPreviousSamples() {\n\t\tif (gibbs_sample_num <= num_gibbs_burn_in + 1 && gibbs_sample_num >= 2){\n\t\t\tgibbs_samples_of_bart_trees[gibbs_sample_num - 2] = null;\n\t\t}\n\t}", "@Test\r\n\t@Ignore\r\n\tpublic void shouldReturnLisOfBrokenByRegion() {\n\t}", "public static void neighborhoodMaxLowMem(String szinputsegmentation,String szanchorpositions,\n int nbinsize, int numleft, int numright, int nspacing, \n\t\t\t\t\tboolean busestrand, boolean busesignal, String szcolfields,\n\t\t\t\t\tint noffsetanchor, String szoutfile,Color theColor, \n\t\t\t\t\t String sztitle,String szlabelmapping, boolean bprintimage, \n boolean bstringlabels, boolean bbrowser) throws IOException\n {\n\n\n\tboolean bchrommatch = false;//added in 1.23 to check for chromosome matches\n\t//an array of chromosome names\n\tArrayList alchromindex = new ArrayList();\n\n\tString szLine;\n\n\t//stores the largest index value for each chromosome\n\tHashMap hmchromMax = new HashMap();\n\n\t//maps chromosome names to index values\n\tHashMap hmchromToIndex = new HashMap();\n\tHashMap hmLabelToIndex = new HashMap(); //maps label to an index\n\tHashMap hmIndexToLabel = new HashMap(); //maps index string to label\n\t//stores the maximum integer label value\n\tint nmaxlabel=0;\n\tString szlabel =\"\";\n\tBufferedReader brinputsegment = Util.getBufferedReader(szinputsegmentation);\n\n\tboolean busedunderscore = false;\n //the number of additional intervals to the left and right to include\n \n \t//the center anchor position\n\tint numintervals = 1+numleft+numright;\n\n\n\t//this loops reads in the segmentation \n\twhile ((szLine = brinputsegment.readLine())!=null)\n\t{\n\t //added v1.24\n\t if (bbrowser)\n\t {\n\t\tif ((szLine.toLowerCase(Locale.ENGLISH).startsWith(\"browser\"))||(szLine.toLowerCase(Locale.ENGLISH).startsWith(\"track\")))\n\t\t{\n\t\t continue;\n\t\t}\n\t }\n\n\t StringTokenizer st;\n\t if (bstringlabels)\n\t {\n\t st = new StringTokenizer(szLine,\"\\t\");\n\t }\n\t else\n\t {\n\t st = new StringTokenizer(szLine,\"\\t \");\n\t }\n\n\t //added in v1.24\n\t int numtokens = st.countTokens();\n\t if (numtokens == 0)\n\t { \n\t //skip blank lines\n\t continue;\n\t }\n\t else if (numtokens < 4)\n\t {\n\t throw new IllegalArgumentException(\"Line \"+szLine+\" in \"+szinputsegmentation+\" only had \"+numtokens+\" token(s). Expecting at least 4\");\n\t }\n\n\t String szchrom = st.nextToken().trim();\n //assumes segments are in standard bed format which to get to \n\t //0-based inclusive requires substract 1 from the end\n\t //int nbegin = Integer.parseInt(st.nextToken().trim())/nbinsize; \n\t st.nextToken().trim();\n\t int nend = (Integer.parseInt(st.nextToken().trim())-1)/nbinsize; \n\t szlabel = st.nextToken().trim();\n\t short slabel;\n\n\t if (bstringlabels)\n\t {\n\t int nunderscoreindex = szlabel.indexOf(\"_\");\n\n\t if (nunderscoreindex >=0)\n\t {\n\t String szprefix = szlabel.substring(0,nunderscoreindex);\n\n try\n\t\t {\n\t slabel = (short) (Short.parseShort(szprefix));\n\t\t if (slabel > nmaxlabel)\n\t\t {\n\t nmaxlabel = slabel;\n\t\t }\n\t\t busedunderscore = true;\n\t\t hmLabelToIndex.put(szlabel, Short.valueOf(slabel));\n\t\t hmIndexToLabel.put(\"\"+slabel, szlabel);\n\t\t }\n catch (NumberFormatException ex)\n\t\t {\n try\n\t\t {\n\t\t slabel = (short) (Short.parseShort(szprefix.substring(1)));\n\t\t if (slabel > nmaxlabel)\n\t\t {\n\t\t nmaxlabel = slabel;\n\t\t }\n\t\t busedunderscore = true;\n\t\t hmLabelToIndex.put(szlabel, Short.valueOf(slabel));\n\t\t hmIndexToLabel.put(\"\"+slabel, szlabel);\n\t\t }\n\t\t catch (NumberFormatException ex2)\n\t\t {\n\t\t if (busedunderscore)\n\t\t {\n\t\t throw new IllegalArgumentException(\"Not a valid ID before '_' in \"+szlabel+\", while valid ID found for other entries\");\n\t\t }\n\t\t }\n\t\t }\n\t }\n\n\t if (!busedunderscore)\n\t {\n\t //handle string labels\n\t Short objshort = (Short) hmLabelToIndex.get(szlabel);\n\n\t if (objshort == null)\n\t {\n\t\t nmaxlabel = hmLabelToIndex.size()+1;\n\t\t slabel = (short) nmaxlabel;\n\t\t hmLabelToIndex.put(szlabel, Short.valueOf(slabel));\n\t\t hmIndexToLabel.put(\"\"+nmaxlabel, szlabel);\n\t\t }\n\t }\n\t }\n\t else\n\t {\n try\n\t {\n\t slabel = (short) (Short.parseShort(szlabel));\n\t }\n\t catch (NumberFormatException ex)\n\t {\n try\n\t {\n slabel = (short) (Short.parseShort(szlabel.substring(1)));\n\t }\n\t catch (NumberFormatException ex2)\n\t {\n\t throw new IllegalArgumentException(\"In fourth column neither state number or ID found in segmentation file. Use '-labels' option to run overlap enrichment treating fourth column as labels\");\n\t }\n\t }\n\t \n\t //alsegments.add(new SegmentRec(szchrom,nbegin,nend,slabel));\n\n\t if (slabel > nmaxlabel)\n\t {\n\t nmaxlabel = slabel;\n\t }\n\t }\n\n\t Integer objMax = (Integer) hmchromMax.get(szchrom);\n\t if (objMax == null)\n\t {\n\t\t//System.out.println(\"on chrom \"+szchrom);\n\t\thmchromMax.put(szchrom,Integer.valueOf(nend));\n\t\thmchromToIndex.put(szchrom, Integer.valueOf(hmchromToIndex.size()));\n\t\talchromindex.add(szchrom);\n\t }\n\t else\n\t {\n\t\tint ncurrmax = objMax.intValue();\n\t\tif (ncurrmax < nend)\n\t\t{\n\t\t hmchromMax.put(szchrom, Integer.valueOf(nend));\t\t \n\t\t}\n\t }\n\t}\n\tbrinputsegment.close();\n\n\t//stores a tally for each position relative to an anchor how frequently the label was observed\n\tdouble[][] tallyoverlaplabel = new double[numintervals][nmaxlabel+1]; \n\n\t//stores a tally for the total signal associated with each anchor position\n\tdouble[] dsumoverlaplabel = new double[numintervals];\n\n //a tally on how frequently each label occurs\n double[] tallylabel = new double[nmaxlabel+1];\n\n\n\tint numchroms = alchromindex.size();\n\n //short[][] labels = new short[numchroms][];\n\n\t//allocates space store all the segment labels for each chromosome\n\tfor (int nchrom = 0; nchrom < numchroms; nchrom++)\n\t{\n \t //stores all the segments in the data\n\t //ArrayList alsegments = new ArrayList();\n\t brinputsegment = Util.getBufferedReader(szinputsegmentation);\n\t String szchromwant = (String) alchromindex.get(nchrom);\n\t //System.out.println(\"processing \"+szchromwant);\n\t int nsize = ((Integer) hmchromMax.get(alchromindex.get(nchrom))).intValue()+1;\n\t short[] labels = new short[nsize];\n\t //this loops reads in the segmentation \n\n\n\t //short[] labels_nchrom = labels[nchrom];\n\t for (int npos = 0; npos < nsize; npos++)\n {\n labels[npos] = -1;\n }\n\t\t\n\t while ((szLine = brinputsegment.readLine())!=null)\n\t {\n\t //int numlines = alsegments.size();\n\t StringTokenizer st;\n\t if (bstringlabels)\n\t {\n\t st = new StringTokenizer(szLine,\"\\t\");\n\t }\n\t else\n\t {\n\t st = new StringTokenizer(szLine,\"\\t \");\n\t }\n\n\t String szchrom = st.nextToken().trim();\n\t if (!szchromwant.equals(szchrom))\n\t\t continue;\n\n\t bchrommatch = true;\n //assumes segments are in standard bed format which to get to \n\t //0-based inclusive requires substract 1 from the end\n\t int nbegin = Integer.parseInt(st.nextToken().trim())/nbinsize;\n\t int nend = (Integer.parseInt(st.nextToken().trim())-1)/nbinsize; \n\t szlabel = st.nextToken().trim();\n\t short slabel = -1;\n\n\t if (bstringlabels)\n\t {\n\t int nunderscoreindex = szlabel.indexOf(\"_\");\n\n\t\t if (nunderscoreindex >=0)\n\t\t {\n\t\t String szprefix = szlabel.substring(0,nunderscoreindex);\n\n try\n\t\t {\n\t\t slabel = (short) (Short.parseShort(szprefix));\n\t\t busedunderscore = true;\n\t\t }\n catch (NumberFormatException ex)\n\t\t {\n try\n\t\t {\n\t\t slabel = (short) (Short.parseShort(szprefix.substring(1)));\n\t\t\t busedunderscore = true;\n\t\t }\n\t\t catch (NumberFormatException ex2)\n\t\t {\n\t\t\t if (busedunderscore)\n\t\t\t {\n\t\t\t throw new IllegalArgumentException(\"Not a valid ID before '_' in \"+szlabel+\", while valid ID found for other entries\");\n\t\t\t }\n\t\t }\n\t\t }\n\t\t }\n\n\t\t if (!busedunderscore)\n\t\t {\n\t //handle string labels\n\t\t Short objshort = (Short) hmLabelToIndex.get(szlabel);\n\t\t slabel = ((Short) objshort).shortValue();\n\t }\n\t }\n\t else\n\t {\n try\n\t {\n\t\t slabel = (short) (Short.parseShort(szlabel));\n\t }\n\t catch (NumberFormatException ex)\n\t {\n try\n\t\t {\n slabel = (short) (Short.parseShort(szlabel.substring(1)));\n\t\t }\n\t\t catch (NumberFormatException ex2)\n\t\t {\n\t\t throw new IllegalArgumentException(\"In fourth column neither state number or ID found in segmentation file. Use '-labels' option to run overlap enrichment treating fourth column as labels\");\n\t\t }\n\t }\n\t }\n\n\t //this loop stores into labels the full segmentation\n\t //and a count of how often each label occurs\n\t //for (int nindex = 0; nindex < numlines; nindex++)\n\t //{\n\t //SegmentRec theSegmentRec = (SegmentRec) alsegments.get(nindex);\n\t //int nchrom = ((Integer) hmchromToIndex.get(theSegmentRec.szchrom)).intValue();\n\t //short[] labels_nchrom = labels[nchrom];\n\t //int nbegin = theSegmentRec.nbegin;\n\t //int nend = theSegmentRec.nend;\n\t //short slabel = theSegmentRec.slabel;\n\t for (int npos = nbegin; npos <= nend; npos++)\n\t {\n\t labels[npos] = slabel;\n\t }\n\n\t if (slabel >= 0)\n\t {\n\t tallylabel[slabel]+=(nend-nbegin)+1; \n\t }\t \n\t }\n\t brinputsegment.close();\n\n\n\t RecAnchorIndex theAnchorIndex = getAnchorIndex(szcolfields, busestrand, busesignal);\n\n \t //reads in the anchor position \n BufferedReader brcoords = Util.getBufferedReader(szanchorpositions);\n\t while ((szLine = brcoords.readLine())!=null)\n {\n\t if (szLine.trim().equals(\"\")) continue;\n\t String[] szLineA = szLine.split(\"\\\\s+\");\n\n String szchrom = szLineA[theAnchorIndex.nchromindex]; \n\t if (!szchrom.equals(szchromwant)) \n continue;\n\n\t int nanchor = (Integer.parseInt(szLineA[theAnchorIndex.npositionindex])-noffsetanchor);\n\t boolean bposstrand = true;\n\t if (busestrand)\n\t {\n\t String szstrand = szLineA[theAnchorIndex.nstrandindex];\t \n\t if (szstrand.equals(\"+\"))\n\t {\n\t bposstrand = true;\n\t }\n else if (szstrand.equals(\"-\"))\n {\n \t bposstrand = false;\n\t }\n\t else\n\t {\n \t throw new IllegalArgumentException(szstrand +\" is an invalid strand. Strand should be '+' or '-'\");\n\t\t }\t \n\t }\n\n\t double damount;\n\n\t if ((busesignal)&&(theAnchorIndex.nsignalindex< szLineA.length))\n\t {\n\t damount = Double.parseDouble(szLineA[theAnchorIndex.nsignalindex]);\n\t }\n\t else\n {\n\t damount = 1;\n\t }\n\n\t //updates the tallys for the given anchor position\n\t //Integer objChrom = (Integer) hmchromToIndex.get(szchrom);\n //if (objChrom != null)\n\t //{\n\t // int nchrom = objChrom.intValue();\n\t\t //short[] labels_nchrom = labels[nchrom];\n\n\t if (bposstrand)\n\t {\n\t int ntallyindex = 0;\n\t for(int noffset= -numleft; noffset <= numright; noffset++)\n\t {\n\t\t int nposindex = (nanchor + nspacing*noffset)/nbinsize;\n\n\t\t if ((nposindex >=0)&&(nposindex < labels.length)&&(labels[nposindex]>=0))\n\t\t {\n\t tallyoverlaplabel[ntallyindex][labels[nposindex]] += damount;\t\t \n\t\t }\n\t\t ntallyindex++;\n\t\t }\n\t\t }\n\t else\n\t {\n\t int ntallyindex = 0;\n\t for(int noffset= numright; noffset >= -numleft; noffset--)\n\t {\n\t\t int nposindex = (nanchor + nspacing*noffset)/nbinsize;\n\n\t\t if ((nposindex >=0)&&(nposindex < labels.length)&&(labels[nposindex]>=0))\n\t\t {\n\t tallyoverlaplabel[ntallyindex][labels[nposindex]]+=damount;\t\t \n\t\t }\n\t\t ntallyindex++;\n\t\t }\n\t\t //}\n\t\t }\n\t }\n brcoords.close(); \t \n\t}\n\n\tif (!bchrommatch)\n\t{\n\t throw new IllegalArgumentException(\"No chromosome name matches found between \"+szanchorpositions+\n \" and those in the segmentation file.\");\n\t}\n\n\toutputneighborhood(tallyoverlaplabel,tallylabel,dsumoverlaplabel,szoutfile,nspacing,numright,\n numleft,theColor,ChromHMM.convertCharOrderToStringOrder(szlabel.charAt(0)),sztitle,0,\n szlabelmapping,szlabel.charAt(0), bprintimage, bstringlabels, hmIndexToLabel);\n }", "public void unifyAdjacentChests(World par1World, int par2, int par3, int par4) {\n\t\tif (!par1World.isRemote) {\n\t\t\tBlock l = par1World.getBlock(par2, par3, par4 - 1);\n\t\t\tBlock i1 = par1World.getBlock(par2, par3, par4 + 1);\n\t\t\tBlock j1 = par1World.getBlock(par2 - 1, par3, par4);\n\t\t\tBlock k1 = par1World.getBlock(par2 + 1, par3, par4);\n\t\t\tBlock l1;\n\t\t\tBlock i2;\n\n\t\t\tbyte b0;\n\t\t\tint j2;\n\n\t\t\tif (l != this && i1 != this) {\n\t\t\t\tif (j1 != this && k1 != this) {\n\t\t\t\t\tb0 = 3;\n\n\t\t\t\t\tif (l.func_149730_j() && !i1.func_149730_j()) {\n\t\t\t\t\t\tb0 = 3;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (i1.func_149730_j() && !l.func_149730_j()) {\n\t\t\t\t\t\tb0 = 2;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (j1.func_149730_j() && !k1.func_149730_j()) {\n\t\t\t\t\t\tb0 = 5;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (k1.func_149730_j() && !j1.func_149730_j()) {\n\t\t\t\t\t\tb0 = 4;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tl1 = par1World.getBlock(j1 == this ? par2 - 1 : par2 + 1, par3, par4 - 1);\n\t\t\t\t\ti2 = par1World.getBlock(j1 == this ? par2 - 1 : par2 + 1, par3, par4 + 1);\n\t\t\t\t\tb0 = 3;\n\n\t\t\t\t\tif (j1 == this) {\n\t\t\t\t\t\tj2 = par1World.getBlockMetadata(par2 - 1, par3, par4);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tj2 = par1World.getBlockMetadata(par2 + 1, par3, par4);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (j2 == 2) {\n\t\t\t\t\t\tb0 = 2;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((l.func_149730_j() || l1.func_149730_j()) && !i1.func_149730_j() && !i2.func_149730_j()) {\n\t\t\t\t\t\tb0 = 3;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((i1.func_149730_j() || i2.func_149730_j()) && !l.func_149730_j() && !l1.func_149730_j()) {\n\t\t\t\t\t\tb0 = 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tl1 = par1World.getBlock(par2 - 1, par3, l == this ? par4 - 1 : par4 + 1);\n\t\t\t\ti2 = par1World.getBlock(par2 + 1, par3, l == this ? par4 - 1 : par4 + 1);\n\t\t\t\tb0 = 5;\n\n\t\t\t\tif (l == this) {\n\t\t\t\t\tj2 = par1World.getBlockMetadata(par2, par3, par4 - 1);\n\t\t\t\t} else {\n\t\t\t\t\tj2 = par1World.getBlockMetadata(par2, par3, par4 + 1);\n\t\t\t\t}\n\n\t\t\t\tif (j2 == 4) {\n\t\t\t\t\tb0 = 4;\n\t\t\t\t}\n\n\t\t\t\tif ((j1.func_149730_j() || l1.func_149730_j()) && !k1.func_149730_j() && !i2.func_149730_j()) {\n\t\t\t\t\tb0 = 5;\n\t\t\t\t}\n\n\t\t\t\tif ((k1.func_149730_j() || i2.func_149730_j()) && !j1.func_149730_j() && !l1.func_149730_j()) {\n\t\t\t\t\tb0 = 4;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpar1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 3);\n\t\t}\n\t}", "@Test(timeout = 30000)\n public void testMoveBlockFailure() {\n // Test copy\n testMoveBlockFailure(conf);\n // Test hardlink\n conf.setBoolean(DFSConfigKeys\n .DFS_DATANODE_ALLOW_SAME_DISK_TIERING, true);\n conf.setDouble(DFSConfigKeys\n .DFS_DATANODE_RESERVE_FOR_ARCHIVE_DEFAULT_PERCENTAGE, 0.5);\n testMoveBlockFailure(conf);\n }", "void reportSplit(HRegionInfo oldRegion, HRegionInfo newRegionA,\n HRegionInfo newRegionB) {\n \n outboundMsgs.add(new HMsg(HMsg.Type.MSG_REPORT_SPLIT, oldRegion,\n (oldRegion.getRegionNameAsString() + \" split; daughters: \" +\n newRegionA.getRegionNameAsString() + \", \" +\n newRegionB.getRegionNameAsString()).getBytes()));\n outboundMsgs.add(new HMsg(HMsg.Type.MSG_REPORT_OPEN, newRegionA));\n outboundMsgs.add(new HMsg(HMsg.Type.MSG_REPORT_OPEN, newRegionB));\n }", "@Test (timeout=180000)\n public void testHDFSRegioninfoMissing() throws Exception {\n TableName table = TableName.valueOf(\"tableHDFSRegioninfoMissing\");\n try {\n setupTable(table);\n assertEquals(ROWKEYS.length, countRows());\n\n // Mess it up by leaving a hole in the meta data\n admin.disableTable(table);\n deleteRegion(conf, tbl.getTableDescriptor(), Bytes.toBytes(\"B\"),\n Bytes.toBytes(\"C\"), true, true, false, true, HRegionInfo.DEFAULT_REPLICA_ID);\n TEST_UTIL.getHBaseAdmin().enableTable(table);\n\n HBaseFsck hbck = doFsck(conf, false);\n assertErrors(hbck, new ERROR_CODE[] {\n ERROR_CODE.ORPHAN_HDFS_REGION,\n ERROR_CODE.NOT_IN_META_OR_DEPLOYED,\n ERROR_CODE.HOLE_IN_REGION_CHAIN});\n // holes are separate from overlap groups\n assertEquals(0, hbck.getOverlapGroups(table).size());\n\n // fix hole\n doFsck(conf, true);\n\n // check that hole fixed\n assertNoErrors(doFsck(conf, false));\n assertEquals(ROWKEYS.length, countRows());\n } finally {\n cleanupTable(table);\n }\n }", "private synchronized void m29549c() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r6 = this;\n monitor-enter(r6);\n r0 = r6.f24853c;\t Catch:{ all -> 0x0050 }\n if (r0 == 0) goto L_0x004b;\t Catch:{ all -> 0x0050 }\n L_0x0005:\n r0 = com.google.android.m4b.maps.cg.bx.m23056a();\t Catch:{ all -> 0x0050 }\n r1 = 0;\n r2 = r6.f24854d;\t Catch:{ IOException -> 0x0035, all -> 0x0030 }\n r3 = r6.f24853c;\t Catch:{ IOException -> 0x0035, all -> 0x0030 }\n r2 = r2.openFileInput(r3);\t Catch:{ IOException -> 0x0035, all -> 0x0030 }\n if (r2 == 0) goto L_0x0027;\n L_0x0014:\n r3 = new com.google.android.m4b.maps.ar.a;\t Catch:{ IOException -> 0x0036 }\n r4 = com.google.android.m4b.maps.de.af.f19891a;\t Catch:{ IOException -> 0x0036 }\n r3.<init>(r4);\t Catch:{ IOException -> 0x0036 }\n r6.f24851a = r3;\t Catch:{ IOException -> 0x0036 }\n r3 = r6.f24851a;\t Catch:{ IOException -> 0x0036 }\n r4 = com.google.android.m4b.maps.ap.C4655c.m20771a(r2);\t Catch:{ IOException -> 0x0036 }\n r3.m20819a(r4);\t Catch:{ IOException -> 0x0036 }\n goto L_0x0029;\t Catch:{ IOException -> 0x0036 }\n L_0x0027:\n r6.f24851a = r1;\t Catch:{ IOException -> 0x0036 }\n L_0x0029:\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x0050 }\n L_0x002c:\n com.google.android.m4b.maps.ap.C4655c.m20773b(r2);\t Catch:{ all -> 0x0050 }\n goto L_0x004b;\n L_0x0030:\n r2 = move-exception;\n r5 = r2;\n r2 = r1;\n r1 = r5;\n goto L_0x0044;\n L_0x0035:\n r2 = r1;\n L_0x0036:\n r6.f24851a = r1;\t Catch:{ all -> 0x0043 }\n r1 = r6.f24854d;\t Catch:{ all -> 0x0043 }\n r3 = r6.f24853c;\t Catch:{ all -> 0x0043 }\n r1.deleteFile(r3);\t Catch:{ all -> 0x0043 }\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x0050 }\n goto L_0x002c;\t Catch:{ all -> 0x0050 }\n L_0x0043:\n r1 = move-exception;\t Catch:{ all -> 0x0050 }\n L_0x0044:\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x0050 }\n com.google.android.m4b.maps.ap.C4655c.m20773b(r2);\t Catch:{ all -> 0x0050 }\n throw r1;\t Catch:{ all -> 0x0050 }\n L_0x004b:\n r0 = 1;\t Catch:{ all -> 0x0050 }\n r6.f24852b = r0;\t Catch:{ all -> 0x0050 }\n monitor-exit(r6);\n return;\n L_0x0050:\n r0 = move-exception;\n monitor-exit(r6);\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.m4b.maps.cg.q.c():void\");\n }", "@Test(timeout=120000)\n public void testMissingLastRegion() throws Exception {\n TableName table =\n TableName.valueOf(\"testMissingLastRegion\");\n try {\n setupTable(table);\n assertEquals(ROWKEYS.length, countRows());\n\n // Mess it up by leaving a hole in the assignment, meta, and hdfs data\n admin.disableTable(table);\n deleteRegion(conf, tbl.getTableDescriptor(), Bytes.toBytes(\"C\"), Bytes.toBytes(\"\"), true,\n true, true);\n admin.enableTable(table);\n\n HBaseFsck hbck = doFsck(conf, false);\n assertErrors(hbck, new ERROR_CODE[] { ERROR_CODE.LAST_REGION_ENDKEY_NOT_EMPTY });\n // fix hole\n doFsck(conf, true);\n // check that hole fixed\n assertNoErrors(doFsck(conf, false));\n } finally {\n cleanupTable(table);\n }\n }", "@Test (timeout=180000)\n public void testLingeringSplitParent() throws Exception {\n TableName table =\n TableName.valueOf(\"testLingeringSplitParent\");\n Table meta = null;\n try {\n setupTable(table);\n assertEquals(ROWKEYS.length, countRows());\n\n // make sure data in regions, if in wal only there is no data loss\n admin.flush(table);\n HRegionLocation location = tbl.getRegionLocation(\"B\");\n\n // Delete one region from meta, but not hdfs, unassign it.\n deleteRegion(conf, tbl.getTableDescriptor(), Bytes.toBytes(\"B\"),\n Bytes.toBytes(\"C\"), true, true, false);\n\n // Create a new meta entry to fake it as a split parent.\n meta = connection.getTable(TableName.META_TABLE_NAME, tableExecutorService);\n HRegionInfo hri = location.getRegionInfo();\n\n HRegionInfo a = new HRegionInfo(tbl.getName(),\n Bytes.toBytes(\"B\"), Bytes.toBytes(\"BM\"));\n HRegionInfo b = new HRegionInfo(tbl.getName(),\n Bytes.toBytes(\"BM\"), Bytes.toBytes(\"C\"));\n\n hri.setOffline(true);\n hri.setSplit(true);\n\n MetaTableAccessor.addRegionToMeta(meta, hri, a, b);\n meta.close();\n admin.flush(TableName.META_TABLE_NAME);\n\n HBaseFsck hbck = doFsck(conf, false);\n assertErrors(hbck, new ERROR_CODE[] {\n ERROR_CODE.LINGERING_SPLIT_PARENT, ERROR_CODE.HOLE_IN_REGION_CHAIN});\n\n // regular repair cannot fix lingering split parent\n hbck = doFsck(conf, true);\n assertErrors(hbck, new ERROR_CODE[] {\n ERROR_CODE.LINGERING_SPLIT_PARENT, ERROR_CODE.HOLE_IN_REGION_CHAIN });\n assertFalse(hbck.shouldRerun());\n hbck = doFsck(conf, false);\n assertErrors(hbck, new ERROR_CODE[] {\n ERROR_CODE.LINGERING_SPLIT_PARENT, ERROR_CODE.HOLE_IN_REGION_CHAIN});\n\n // fix lingering split parent\n hbck = new HBaseFsck(conf, hbfsckExecutorService);\n hbck.connect();\n hbck.setDisplayFullReport(); // i.e. -details\n hbck.setTimeLag(0);\n hbck.setFixSplitParents(true);\n hbck.onlineHbck();\n assertTrue(hbck.shouldRerun());\n hbck.close();\n\n Get get = new Get(hri.getRegionName());\n Result result = meta.get(get);\n assertTrue(result.getColumnCells(HConstants.CATALOG_FAMILY,\n HConstants.SPLITA_QUALIFIER).isEmpty());\n assertTrue(result.getColumnCells(HConstants.CATALOG_FAMILY,\n HConstants.SPLITB_QUALIFIER).isEmpty());\n admin.flush(TableName.META_TABLE_NAME);\n\n // fix other issues\n doFsck(conf, true);\n\n // check that all are fixed\n assertNoErrors(doFsck(conf, false));\n assertEquals(ROWKEYS.length, countRows());\n } finally {\n cleanupTable(table);\n IOUtils.closeQuietly(meta);\n }\n }", "private void b()\r\n/* 67: */ {\r\n/* 68: 73 */ this.c.clear();\r\n/* 69: 74 */ this.e.clear();\r\n/* 70: */ }", "private static void registerBlock(Block b)\n\t{\n\t}", "@Test\n public void writing()\n throws IOException, DbfLibException\n {\n final Ranges ignoredRangesDbf = new Ranges();\n ignoredRangesDbf.addRange(0x01, 0x03); // modified\n ignoredRangesDbf.addRange(0x1d, 0x1d); // language driver\n ignoredRangesDbf.addRange(0x1e, 0x1f); // reserved\n ignoredRangesDbf.addRange(0x2c, 0x2f); // field description \"address in memory\"\n ignoredRangesDbf.addRange(0x4c, 0x4f); // idem\n ignoredRangesDbf.addRange(0x6c, 0x6f); // idem\n ignoredRangesDbf.addRange(0x8c, 0x8f); // idem\n ignoredRangesDbf.addRange(0xac, 0xaf); // idem\n ignoredRangesDbf.addRange(0xcc, 0xcf); // idem\n ignoredRangesDbf.addRange(0x34, 0x34); // work area id\n ignoredRangesDbf.addRange(0x54, 0x54); // work area id\n ignoredRangesDbf.addRange(0x74, 0x74); // work area id\n ignoredRangesDbf.addRange(0x94, 0x94); // work area id\n ignoredRangesDbf.addRange(0xb4, 0xb4); // work area id\n ignoredRangesDbf.addRange(0xd4, 0xd4); // work area id\n ignoredRangesDbf.addRange(0x105, 0x10e); // block number in memo file\n // (in some versions padded with zeros, in other versions with spaces)\n\n ignoredRangesDbf.addRange(0x161, 0x16a); // idem\n\n /*\n * in Clipper5 there is so much garbage in the header area that from the field definitions\n * on all the data is skipped\n */\n if (version == Version.CLIPPER_5)\n {\n ignoredRangesDbf.addRange(0x20, 0xdf); // reserved/garbage\n }\n\n final Ranges ignoredRangesDbt = new Ranges();\n\n if (version == Version.DBASE_3)\n {\n ignoredRangesDbt.addRange(0x04, 0x1ff); // reserved/garbage\n ignoredRangesDbt.addRange(0x432, 0x5ff); // zero padding beyond dbase eof bytes\n }\n else if (version == Version.DBASE_4)\n {\n ignoredRangesDbt.addRange(0x438, 0x5ff); // zero padding beyond dbase eof bytes\n }\n else if (version == Version.DBASE_5)\n {\n ignoredRangesDbt.addRange(0x16, 0x1ff); // reserved/garbage\n }\n else if (version == Version.CLIPPER_5)\n {\n ignoredRangesDbt.addRange(0x04, 0x3ff); // reserved/garbage\n ignoredRangesDbt.addRange(0x4f5, 0x5ff); // garbage beyond eof bytes\n ignoredRangesDbt.addRange(0x631, 0x7ff); // zero padding beyond eof bytes\n }\n else if (version == Version.FOXPRO_26)\n {\n ignoredRangesDbt.addRange(0x08, 0x0f); // file name (not written in FoxPro)\n ignoredRangesDbt.addRange(0x2f6, 0x2fb); // garbage\n ignoredRangesDbt.addRange(0x438, 0x4fb); // garbage\n }\n\n UnitTestUtil.doCopyAndCompareTest(versionDirectory + \"/cars\", \"cars\", version, ignoredRangesDbf,\n ignoredRangesDbt);\n }", "@Test\n public void test131() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n Block block0 = (Block)errorPage0.legend();\n Block block1 = (Block)errorPage0.blockquote();\n Label label0 = (Label)errorPage0.del((Object) block1);\n assertEquals(\"wheel_ErrorPage\", errorPage0.getComponentId());\n assertTrue(block1._isGeneratedId());\n }", "public void repair () {\n WriteableByteArray whole = new WriteableByteArray ();\n WriteableByteArray piece = new WriteableByteArray ();\n int [] offsets = new int [sequences.size ()];\n for (int index = 0;index < commonSequence.length;index++) {\n byte b = commonSequence [index];\n int i = 0;\n for (byte [] sequence : sequences)\n if (sequence [index + offsets [i++]] != b) {\n CommonSequence commonPiece = new CommonSequence ();\n i = 0;\n for (byte [] s : sequences) {\n piece.reset ();\n for (;;) {\n byte c = s [index + offsets [i]];\n if (c == b)\n break;\n piece.write (c);\n offsets [i]++;\n }\n commonPiece.add (piece.toByteArray ());\n i++;\n }\n whole.write (commonPiece.getCommonSequence ());\n break;\n }\n // all sequences now coincide at b\n whole.write (b);\n }\n commonSequence = whole.toByteArray ();\n matched = false;\n throw new NotTestedException ();\n }", "void transform() {\n\t\tint oldline, newline;\n\t\tint oldmax = oldinfo.maxLine + 2; /* Count pseudolines at */\n\t\tint newmax = newinfo.maxLine + 2; /* ..front and rear of file */\n\n\t\tfor (oldline = 0; oldline < oldmax; oldline++)\n\t\t\toldinfo.other[oldline] = -1;\n\t\tfor (newline = 0; newline < newmax; newline++)\n\t\t\tnewinfo.other[newline] = -1;\n\n\t\tscanunique(); /* scan for lines used once in both files */\n\t\tscanafter(); /* scan past sure-matches for non-unique blocks */\n\t\tscanbefore(); /* scan backwards from sure-matches */\n\t\tscanblocks(); /* find the fronts and lengths of blocks */\n\t}", "SerializableState getInvalidRegion(Long id,\n\t\t\t\t ParameterBlock oldParamBlock,\n\t\t\t\t SerializableState oldHints,\n\t\t\t\t ParameterBlock newParamBlock,\n\t\t\t\t SerializableState newHints)\n\tthrows RemoteException;", "protected int getChunkInRegion() {\n\t\treturn (rnd.nextInt(structurePosRange) + rnd.nextInt(structurePosRange)) / 2;\n\t}", "public void free(Block b) {\n if(b.length <= 0) return;\n\n if (b.start + b.length > limit) limit = b.start + b.length; // grows with free\n\n // query adjacent blocks\n Block prev = freeSpace.floor(b);\n Block next = freeSpace.higher(b);\n\n if (prev != null && prev.start + prev.length > b.start) {\n throw new RuntimeException(\"Corrupted. DEBUG PRV \" + prev.start + \"+\" + prev.length + \">\" + b.start);\n }\n if (next != null && next.start < b.start + b.length) {\n throw new RuntimeException(\"Corrupted. DEBUG NEX \" + next.start + \"<\" + b.start + \"+\" + b.length);\n }\n\n // merge them if possible\n \n Block n = Block.mergeBlocks(b, prev);\n if(n != null) { freeSpace.remove(prev); b = n; }\n\n n = Block.mergeBlocks(b, next);\n if(n != null) { freeSpace.remove(next); b = n; }\n\n freeSpace.add(b);\n }", "void combineAndCollectSnapshotBlocks(\n INode.ReclaimContext reclaimContext, INodeFile file, FileDiff removed) {\n BlockInfo[] removedBlocks = removed.getBlocks();\n if (removedBlocks == null) {\n FileWithSnapshotFeature sf = file.getFileWithSnapshotFeature();\n assert sf != null : \"FileWithSnapshotFeature is null\";\n if(sf.isCurrentFileDeleted())\n sf.collectBlocksAndClear(reclaimContext, file);\n return;\n }\n int p = getPrior(removed.getSnapshotId(), true);\n FileDiff earlierDiff = p == Snapshot.NO_SNAPSHOT_ID ? null : getDiffById(p);\n // Copy blocks to the previous snapshot if not set already\n if (earlierDiff != null) {\n earlierDiff.setBlocks(removedBlocks);\n }\n BlockInfo[] earlierBlocks =\n (earlierDiff == null ? new BlockInfoContiguous[]{} : earlierDiff.getBlocks());\n // Find later snapshot (or file itself) with blocks\n BlockInfo[] laterBlocks = findLaterSnapshotBlocks(removed.getSnapshotId());\n laterBlocks = (laterBlocks == null) ? file.getBlocks() : laterBlocks;\n // Skip blocks, which belong to either the earlier or the later lists\n int i = 0;\n for(; i < removedBlocks.length; i++) {\n if(i < earlierBlocks.length && removedBlocks[i] == earlierBlocks[i])\n continue;\n if(i < laterBlocks.length && removedBlocks[i] == laterBlocks[i])\n continue;\n break;\n }\n // Check if last block is part of truncate recovery\n BlockInfo lastBlock = file.getLastBlock();\n BlockInfo dontRemoveBlock = null;\n if (lastBlock != null && lastBlock.getBlockUCState().equals(\n HdfsServerConstants.BlockUCState.UNDER_RECOVERY)) {\n dontRemoveBlock = lastBlock.getUnderConstructionFeature()\n .getTruncateBlock();\n }\n // Collect the remaining blocks of the file, ignoring truncate block\n for (;i < removedBlocks.length; i++) {\n if(dontRemoveBlock == null || !removedBlocks[i].equals(dontRemoveBlock)) {\n reclaimContext.collectedBlocks().addDeleteBlock(removedBlocks[i]);\n }\n }\n }", "public boolean willOverlap() {\n/* 208 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@Test\n\tpublic void testForwardFrameShiftBlockSubstitution() throws InvalidGenomeChange {\n\t\tGenomeChange change1 = new GenomeChange(new GenomePosition(refDict, '+', 1, 6647537, PositionType.ZERO_BASED),\n\t\t\t\t\"TGCCCCACCT\", \"CCC\");\n\t\tAnnotation annotation1 = new BlockSubstitutionAnnotationBuilder(infoForward, change1).build();\n\t\tAssert.assertEquals(infoForward.accession, annotation1.transcript.accession);\n\t\tAssert.assertEquals(6, annotation1.annoLoc.rank);\n\t\tAssert.assertEquals(\"c.1225_1234delinsCCC\", annotation1.ntHGVSDescription);\n\t\tAssert.assertEquals(\"p.Cys409Profs*127\", annotation1.aaHGVSDescription);\n\t\tAssert.assertEquals(ImmutableSortedSet.of(VariantType.FS_SUBSTITUTION, VariantType.SPLICE_REGION),\n\t\t\t\tannotation1.effects);\n\t}", "void removeBlock(Block block);", "@Test\n public void testSafeBlocks() {\n IntStream.iterate(0, i -> i + 1).limit(LevelImpl.LEVEL_MAX).forEach(k -> {\n terrain = terrainFactory.create(level.getBlocksNumber());\n /* use 0 and 1 position because the margin blocks are inserted initially*/\n assertEquals(new Position(3 * TerrainFactoryImpl.CELL_DIMENSION * ScreenToolUtils.SCALE, \n TerrainFactoryImpl.CELL_DIMENSION * ScreenToolUtils.SCALE), terrain.getBlocks().get(0).getPosition());\n assertEquals(new Position(TerrainFactoryImpl.CELL_DIMENSION * ScreenToolUtils.SCALE,\n 3 * TerrainFactoryImpl.CELL_DIMENSION * ScreenToolUtils.SCALE), terrain.getBlocks().get(1).getPosition());\n level.levelUp();\n });\n }", "@Test\n public void testColocatedPartitionedRegion_NoFullPath() throws Throwable {\n createCacheInAllVms();\n redundancy = 0;\n localMaxmemory = 50;\n totalNumBuckets = 11;\n\n regionName = \"A\";\n colocatedWith = null;\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"B\";\n colocatedWith = \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"C\";\n colocatedWith = \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"D\";\n colocatedWith = \"B\";\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"E\";\n colocatedWith = \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"F\";\n colocatedWith = \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"G\";\n colocatedWith = \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"H\";\n colocatedWith = \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"I\";\n colocatedWith = \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"J\";\n colocatedWith = \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"K\";\n colocatedWith = \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"L\";\n colocatedWith = \"E\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"M\";\n colocatedWith = \"F\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"N\";\n colocatedWith = \"G\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"O\";\n colocatedWith = \"I\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"A\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"D\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"H\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"B\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"K\"));\n }", "@Override\n public void breakBlock(World world, int i, int j, int k, int lol, int meh) {\n byte byte0 = 4;\n int l = byte0 + 1;\n if (world.checkChunksExist(i - l, j - l, k - l, i + l, j + l, k + l)) {\n for (int i1 = -byte0; i1 <= byte0; i1++) {\n for (int j1 = -byte0; j1 <= byte0; j1++) {\n for (int k1 = -byte0; k1 <= byte0; k1++) {\n int l1 = world.getBlockId(i + i1, j + j1, k + k1);\n if (l1 != TropicraftMod.tropicLeaves.blockID) {\n continue;\n }\n int i2 = world.getBlockMetadata(i + i1, j + j1, k + k1);\n if ((i2 & 8) == 0) {\n world.setBlockMetadata(i + i1, j + j1, k + k1, i2 | 8);\n }\n }\n\n }\n\n }\n\n }\n }", "public void uncoverContiguous( int r , int c )\n { \n \n Stack<MineTile> stack = new Stack<MineTile>();\n stack.add(mineField[r][c]);\n \n while(!stack.empty())\n {\n MineTile curTile = stack.pop();\n r = curTile.getRow();\n c = curTile.getCol();\n for(int i = r-1; i <= r+1; i++)\n {\n for(int j = c-1; j <= c+1; j++)\n {\n if(isValid(i, j))\n {\n if(mineField[i][j].isCovered() & mineField[i][j].getCount() == 0)\n {\n stack.add(mineField[i][j]);\n }\n mineField[i][j].uncover();\n }\n \n } \n \n }\n \n }\n }", "static void hardDrop(Block b) {\n int[] pos = b.pos;\n char[][] piece = b.piece;\n\n while (canPlace(pos[0] + 1, pos[1], piece))\n pos[0]++;\n\n place(pos[0], pos[1], piece);\n }", "public static void wipeBlocks() {\n for (String location : MyZ.instance.getBlocksConfig().getKeys(false))\n actOnBlock(location, false);\n MyZ.instance.saveBlocksConfig();\n }", "@Test(timeout = 4000)\n public void test13() throws Throwable {\n DefaultNucleotideCodec defaultNucleotideCodec0 = DefaultNucleotideCodec.INSTANCE;\n byte[] byteArray0 = new byte[9];\n defaultNucleotideCodec0.toString(byteArray0);\n DefaultNucleotideCodec defaultNucleotideCodec1 = DefaultNucleotideCodec.INSTANCE;\n Nucleotide nucleotide0 = Nucleotide.Pyrimidine;\n Set<Nucleotide> set0 = nucleotide0.getBasesFor();\n byte[] byteArray1 = defaultNucleotideCodec1.encode((Collection<Nucleotide>) set0);\n DefaultNucleotideCodec defaultNucleotideCodec2 = DefaultNucleotideCodec.INSTANCE;\n defaultNucleotideCodec2.toString(byteArray1);\n defaultNucleotideCodec2.toString(byteArray1);\n // Undeclared exception!\n try { \n defaultNucleotideCodec0.getUngappedOffsetFor((byte[]) null, 12);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"java.nio.ByteBuffer\", e);\n }\n }", "public void b(World paramaqu, Random paramRandom, BlockPosition paramdt, Block parambec)\r\n/* 77: */ {\r\n/* 78: 93 */ BlockPosition localdt1 = paramdt.up();\r\n/* 79: */ label260:\r\n/* 80: 95 */ for (int i = 0; i < 128; i++)\r\n/* 81: */ {\r\n/* 82: 96 */ BlockPosition localdt2 = localdt1;\r\n/* 83: 97 */ for (int j = 0; j < i / 16; j++)\r\n/* 84: */ {\r\n/* 85: 98 */ localdt2 = localdt2.offset(paramRandom.nextInt(3) - 1, (paramRandom.nextInt(3) - 1) * paramRandom.nextInt(3) / 2, paramRandom.nextInt(3) - 1);\r\n/* 86: 99 */ if ((paramaqu.getBlock(localdt2.down()).getType() != BlockList.grass) || (paramaqu.getBlock(localdt2).getType().blocksMovement())) {\r\n/* 87: */ break label260;\r\n/* 88: */ }\r\n/* 89: */ }\r\n/* 90:104 */ if (paramaqu.getBlock(localdt2).getType().material == Material.air)\r\n/* 91: */ {\r\n/* 92: */ Object localObject;\r\n/* 93:108 */ if (paramRandom.nextInt(8) == 0)\r\n/* 94: */ {\r\n/* 95:109 */ localObject = paramaqu.b(localdt2).a(paramRandom, localdt2);\r\n/* 96:110 */ avy localavy = ((EnumFlowerVariant)localObject).a().a();\r\n/* 97:111 */ Block localbec = localavy.instance().setData(localavy.l(), (Comparable)localObject);\r\n/* 98:112 */ if (localavy.f(paramaqu, localdt2, localbec)) {\r\n/* 99:113 */ paramaqu.setBlock(localdt2, localbec, 3);\r\n/* 100: */ }\r\n/* 101: */ }\r\n/* 102: */ else\r\n/* 103: */ {\r\n/* 104:116 */ localObject = BlockList.tallgrass.instance().setData(bbh.a, bbi.b);\r\n/* 105:117 */ if (BlockList.tallgrass.f(paramaqu, localdt2, (Block)localObject)) {\r\n/* 106:118 */ paramaqu.setBlock(localdt2, (Block)localObject, 3);\r\n/* 107: */ }\r\n/* 108: */ }\r\n/* 109: */ }\r\n/* 110: */ }\r\n/* 111: */ }", "public void RemoveRowsIfStackedTooHigh() {\n \t\t\n while (rowHasBlocks(Parameters.RemoveBiggestPartialRowIfBlockInRow)) {\n int NoOfPiecesRemoved = \n eraseBiggestRowGreaterThan(Parameters.RemoveBiggestPartialRowIfBlockInRow);\n //remove points for each empty square\n ComputeScoreAndDelay(-(COLUMNS - NoOfPiecesRemoved) * Parameters.PointsSubtractedPerEmptySpaceFromPartialRow);\n \n }\n game_grid.repaint();\n LogEvent(\"row_removed\");\n }", "private Set<Long> removeSomeBlocks(Map<BlockStoreLocation, List<Long>> blockMap) {\n Set<Long> toRemove = new HashSet<>();\n // 1 block goes missing from each location\n for (Map.Entry<BlockStoreLocation, List<Long>> entry : blockMap.entrySet()) {\n List<Long> blocks = entry.getValue();\n if (blocks.isEmpty()) {\n continue;\n }\n toRemove.add(blocks.get(0));\n blocks.remove(0);\n }\n return toRemove;\n }", "public ByteBuf duplicate()\r\n/* 95: */ {\r\n/* 96:112 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 97:113 */ return super.duplicate();\r\n/* 98: */ }", "public static void scanDirty(List<Intersection> sections){\n for(int i = 0; i<sections.size(); i++){\n Intersection section = sections.get(i);\n if(section.dirty != 0){\n int startI = i;\n double min = Double.MAX_VALUE;\n for(int j = 0; j<sections.size(); j++){\n if(j == startI){\n continue;\n }\n Intersection other = sections.get(j);\n\n double m = Vector3DOps.mag(Vector3DOps.difference(other.location, section.location));\n if(m < min){\n min = m;\n }\n if( m < Math.abs(section.dirty) ){\n System.out.println(\"should take it: \" + other.dirty);\n //System.out.println(\"removing: \" + i + \", \" + m + \" < \" + section.dirty);\n //System.out.println(\"\\t by: \" + j + \" , \" + other.dirty);\n if(startI > i){\n continue;\n }\n sections.remove(i);\n i--;j--;\n }\n }\n if( startI > i){\n System.out.println(\"removed\");\n } else{\n System.out.println(\"left\");\n }\n }\n }\n\n\n }", "@Test\n public void undoCkpointTest() throws Exception {\n final int tableSize = PARAMETERS.NUM_ITERATIONS_LOW;\n final int trimPosition = tableSize / 2;\n final int snapshotPosition = trimPosition + 2;\n\n CountDownLatch latch = new CountDownLatch(1);\n\n t(1, () -> {\n\n CorfuRuntime rt = getNewRuntime();\n try {\n PersistentCorfuTable<String, Long> tableA = openTable(rt, streamNameA);\n\n // first, populate the map\n for (int i = 0; i < tableSize; i++) {\n tableA.insert(String.valueOf(i), (long) i);\n }\n\n // now, take a checkpoint and perform a prefix-trim\n MultiCheckpointWriter<PersistentCorfuTable<String, Long>> mcw1 = new MultiCheckpointWriter<>();\n mcw1.addMap(tableA);\n mcw1.appendCheckpoints(rt, author);\n\n // Trim the log\n Token token = new Token(rt.getLayoutView().getLayout().getEpoch(), trimPosition);\n rt.getAddressSpaceView().prefixTrim(token);\n rt.getAddressSpaceView().gc();\n rt.getAddressSpaceView().invalidateServerCaches();\n rt.getAddressSpaceView().invalidateClientCache();\n\n latch.countDown();\n } finally {\n rt.shutdown();\n }\n });\n\n AtomicBoolean trimExceptionFlag = new AtomicBoolean(false);\n\n // start a new runtime\n t(2, () -> {\n latch.await();\n CorfuRuntime rt = getNewRuntime();\n\n PersistentCorfuTable<String, Long> localm2A = openTable(rt, streamNameA);\n\n // start a snapshot TX at position snapshotPosition\n Token timestamp = new Token(0L, snapshotPosition - 1);\n rt.getObjectsView().TXBuild()\n .type(TransactionType.SNAPSHOT)\n .snapshot(timestamp)\n .build()\n .begin();\n\n // finally, instantiate the map for the snapshot and assert is has the right state\n try {\n localm2A.get(String.valueOf(0));\n } catch (TransactionAbortedException te) {\n assertThat(te.getAbortCause()).isEqualTo(AbortCause.TRIM);\n // this is an expected behavior!\n trimExceptionFlag.set(true);\n }\n\n try {\n if (!trimExceptionFlag.get()) {\n assertThat(localm2A.size())\n .isEqualTo(snapshotPosition);\n\n // check map positions 0..(snapshot-1)\n for (int i = 0; i < snapshotPosition; i++) {\n assertThat(localm2A.get(String.valueOf(i)))\n .isEqualTo(i);\n }\n\n // check map positions snapshot..(mapSize-1)\n for (int i = snapshotPosition; i < tableSize; i++) {\n assertThat(localm2A.get(String.valueOf(i))).isNull();\n }\n }\n } finally {\n rt.shutdown();\n }\n });\n }", "public ByteBuf retainedDuplicate()\r\n/* 83: */ {\r\n/* 84:100 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 85:101 */ return super.retainedDuplicate();\r\n/* 86: */ }", "@Test\n public void testSingleBlock()\n {\n BlockMetadata.FileBlockMetadata block = new BlockMetadata.FileBlockMetadata(s3Directory + FILE_1, 0L, 0L,\n testMeta.dataFile.length(), true, -1, testMeta.dataFile.length());\n\n testMeta.blockReader.beginWindow(1);\n testMeta.blockReader.blocksMetadataInput.process(block);\n testMeta.blockReader.endWindow();\n\n List<Object> actualMessages = testMeta.messageSink.collectedTuples;\n Assert.assertEquals(\"No of records\", testMeta.messages.size(), actualMessages.size());\n\n for (int i = 0; i < actualMessages.size(); i++) {\n byte[] msg = (byte[])actualMessages.get(i);\n Assert.assertTrue(\"line \" + i, Arrays.equals(new String(msg).split(\",\"), testMeta.messages.get(i)));\n }\n }", "@Test (timeout=180000)\n public void testValidLingeringSplitParent() throws Exception {\n TableName table =\n TableName.valueOf(\"testLingeringSplitParent\");\n Table meta = null;\n try {\n setupTable(table);\n assertEquals(ROWKEYS.length, countRows());\n\n // make sure data in regions, if in wal only there is no data loss\n admin.flush(table);\n HRegionLocation location = tbl.getRegionLocation(Bytes.toBytes(\"B\"));\n\n meta = connection.getTable(TableName.META_TABLE_NAME, tableExecutorService);\n HRegionInfo hri = location.getRegionInfo();\n\n // do a regular split\n byte[] regionName = location.getRegionInfo().getRegionName();\n admin.splitRegion(location.getRegionInfo().getRegionName(), Bytes.toBytes(\"BM\"));\n TestEndToEndSplitTransaction.blockUntilRegionSplit(conf, 60000, regionName, true);\n\n // TODO: fixHdfsHoles does not work against splits, since the parent dir lingers on\n // for some time until children references are deleted. HBCK erroneously sees this as\n // overlapping regions\n HBaseFsck hbck = doFsck(\n conf, true, true, false, false, false, true, true, true, false, false, false, null);\n assertErrors(hbck, new ERROR_CODE[] {}); //no LINGERING_SPLIT_PARENT reported\n\n // assert that the split hbase:meta entry is still there.\n Get get = new Get(hri.getRegionName());\n Result result = meta.get(get);\n assertNotNull(result);\n assertNotNull(MetaTableAccessor.getHRegionInfo(result));\n\n assertEquals(ROWKEYS.length, countRows());\n\n // assert that we still have the split regions\n assertEquals(tbl.getStartKeys().length, SPLITS.length + 1 + 1); //SPLITS + 1 is # regions pre-split.\n assertNoErrors(doFsck(conf, false));\n } finally {\n cleanupTable(table);\n IOUtils.closeQuietly(meta);\n }\n }", "private void scanForBlockFarAway() {\r\n\t\tList<MapLocation> locations = gameMap.senseNearbyBlocks();\r\n\t\tlocations.removeAll(stairs);\r\n\t\tif (locations.size() == 0) {\r\n\t\t\tblockLoc = null;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t/* remove blocks that can be sensed */\r\n\t\tIterator<MapLocation> iter = locations.iterator();\r\n\t\twhile(iter.hasNext()) {\r\n\t\t\tMapLocation loc = iter.next();\r\n\t\t\tif (myRC.canSenseSquare(loc))\r\n\t\t\t\titer.remove();\r\n\t\t} \r\n\t\t\r\n\t\tlocations = navigation.sortLocationsByDistance(locations);\r\n\t\t//Collections.reverse(locations);\r\n\t\tfor (MapLocation block : locations) {\r\n\t\t\tif (gameMap.get(block).robotAtLocation == null){\r\n\t\t\t\t/* this location is unoccupied */\r\n\t\t\t\tblockLoc = block;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tblockLoc = null;\r\n\t}", "public abstract int[] findEmptyBlock(int processSize);", "private void exitSequence_mainRegion_State2__region0_State4() {\n\t\texitSequence_mainRegion_State2__region0_State4__region0();\n\t}", "private synchronized void m3985g() {\n /*\n r8 = this;\n monitor-enter(r8);\n r2 = java.lang.Thread.currentThread();\t Catch:{ all -> 0x0063 }\n r3 = r8.f2114f;\t Catch:{ all -> 0x0063 }\n r3 = r3.mo1186c();\t Catch:{ all -> 0x0063 }\n r2 = r2.equals(r3);\t Catch:{ all -> 0x0063 }\n if (r2 != 0) goto L_0x0021;\n L_0x0011:\n r2 = r8.f2114f;\t Catch:{ all -> 0x0063 }\n r2 = r2.mo1185b();\t Catch:{ all -> 0x0063 }\n r3 = new com.google.analytics.tracking.android.aa;\t Catch:{ all -> 0x0063 }\n r3.<init>(r8);\t Catch:{ all -> 0x0063 }\n r2.add(r3);\t Catch:{ all -> 0x0063 }\n L_0x001f:\n monitor-exit(r8);\n return;\n L_0x0021:\n r2 = r8.f2122n;\t Catch:{ all -> 0x0063 }\n if (r2 == 0) goto L_0x0028;\n L_0x0025:\n r8.m3999d();\t Catch:{ all -> 0x0063 }\n L_0x0028:\n r2 = com.google.analytics.tracking.android.ab.f1966a;\t Catch:{ all -> 0x0063 }\n r3 = r8.f2110b;\t Catch:{ all -> 0x0063 }\n r3 = r3.ordinal();\t Catch:{ all -> 0x0063 }\n r2 = r2[r3];\t Catch:{ all -> 0x0063 }\n switch(r2) {\n case 1: goto L_0x0036;\n case 2: goto L_0x006e;\n case 3: goto L_0x00aa;\n default: goto L_0x0035;\n };\t Catch:{ all -> 0x0063 }\n L_0x0035:\n goto L_0x001f;\n L_0x0036:\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.isEmpty();\t Catch:{ all -> 0x0063 }\n if (r2 != 0) goto L_0x0066;\n L_0x003e:\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.poll();\t Catch:{ all -> 0x0063 }\n r0 = r2;\n r0 = (com.google.analytics.tracking.android.af) r0;\t Catch:{ all -> 0x0063 }\n r7 = r0;\n r2 = \"Sending hit to store\";\n com.google.analytics.tracking.android.av.m3818e(r2);\t Catch:{ all -> 0x0063 }\n r2 = r8.f2112d;\t Catch:{ all -> 0x0063 }\n r3 = r7.m3743a();\t Catch:{ all -> 0x0063 }\n r4 = r7.m3744b();\t Catch:{ all -> 0x0063 }\n r6 = r7.m3745c();\t Catch:{ all -> 0x0063 }\n r7 = r7.m3746d();\t Catch:{ all -> 0x0063 }\n r2.mo1197a(r3, r4, r6, r7);\t Catch:{ all -> 0x0063 }\n goto L_0x0036;\n L_0x0063:\n r2 = move-exception;\n monitor-exit(r8);\n throw r2;\n L_0x0066:\n r2 = r8.f2121m;\t Catch:{ all -> 0x0063 }\n if (r2 == 0) goto L_0x001f;\n L_0x006a:\n r8.m3987h();\t Catch:{ all -> 0x0063 }\n goto L_0x001f;\n L_0x006e:\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.isEmpty();\t Catch:{ all -> 0x0063 }\n if (r2 != 0) goto L_0x00a0;\n L_0x0076:\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.peek();\t Catch:{ all -> 0x0063 }\n r0 = r2;\n r0 = (com.google.analytics.tracking.android.af) r0;\t Catch:{ all -> 0x0063 }\n r7 = r0;\n r2 = \"Sending hit to service\";\n com.google.analytics.tracking.android.av.m3818e(r2);\t Catch:{ all -> 0x0063 }\n r2 = r8.f2111c;\t Catch:{ all -> 0x0063 }\n r3 = r7.m3743a();\t Catch:{ all -> 0x0063 }\n r4 = r7.m3744b();\t Catch:{ all -> 0x0063 }\n r6 = r7.m3745c();\t Catch:{ all -> 0x0063 }\n r7 = r7.m3746d();\t Catch:{ all -> 0x0063 }\n r2.mo1204a(r3, r4, r6, r7);\t Catch:{ all -> 0x0063 }\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2.poll();\t Catch:{ all -> 0x0063 }\n goto L_0x006e;\n L_0x00a0:\n r2 = r8.f2123o;\t Catch:{ all -> 0x0063 }\n r2 = r2.mo1198a();\t Catch:{ all -> 0x0063 }\n r8.f2109a = r2;\t Catch:{ all -> 0x0063 }\n goto L_0x001f;\n L_0x00aa:\n r2 = \"Need to reconnect\";\n com.google.analytics.tracking.android.av.m3818e(r2);\t Catch:{ all -> 0x0063 }\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.isEmpty();\t Catch:{ all -> 0x0063 }\n if (r2 != 0) goto L_0x001f;\n L_0x00b7:\n r8.m3991j();\t Catch:{ all -> 0x0063 }\n goto L_0x001f;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.analytics.tracking.android.y.g():void\");\n }", "void m5768b() throws C0841b;", "private void t3() {\n // write to a super region, read from a subregion: only keep write\n writeProtected();\n readDefault();\n }", "@Test\n public void testInvalidICCSingleChunkBadSequence() throws IOException {\n\n JPEGImageReader reader = createReader();\n reader.setInput(ImageIO.createImageInputStream(getClassLoaderResource(\"/jpeg/invalid-icc-single-chunk-bad-sequence-number.jpg\")));\n\n assertEquals(1772, reader.getWidth(0));\n assertEquals(2126, reader.getHeight(0));\n\n ImageReadParam param = reader.getDefaultReadParam();\n param.setSourceRegion(new Rectangle(reader.getWidth(0), 8));\n\n IIOReadWarningListener warningListener = mock(IIOReadWarningListener.class);\n reader.addIIOReadWarningListener(warningListener);\n\n BufferedImage image = reader.read(0, param);\n\n assertNotNull(image);\n assertEquals(1772, image.getWidth());\n assertEquals(8, image.getHeight());\n\n verify(warningListener).warningOccurred(eq(reader), anyString());\n }", "@Test\n public void testColocatedPartitionedRegion() throws Throwable {\n createCacheInAllVms();\n redundancy = 0;\n localMaxmemory = 50;\n totalNumBuckets = 11;\n\n regionName = \"A\";\n colocatedWith = null;\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"B\";\n colocatedWith = SEPARATOR + \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"C\";\n colocatedWith = SEPARATOR + \"A\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"D\";\n colocatedWith = SEPARATOR + \"B\";\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"E\";\n colocatedWith = SEPARATOR + \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"F\";\n colocatedWith = SEPARATOR + \"B\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"G\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"H\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"I\";\n colocatedWith = SEPARATOR + \"C\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"J\";\n colocatedWith = SEPARATOR + \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"K\";\n colocatedWith = SEPARATOR + \"D\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"L\";\n colocatedWith = SEPARATOR + \"E\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"M\";\n colocatedWith = SEPARATOR + \"F\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"N\";\n colocatedWith = SEPARATOR + \"G\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n regionName = \"O\";\n colocatedWith = SEPARATOR + \"I\";\n isPartitionResolver = Boolean.TRUE;\n attributeObjects = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets,\n colocatedWith, isPartitionResolver};\n createPartitionedRegion(attributeObjects);\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"A\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"D\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"H\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"B\"));\n\n accessor.invoke(() -> PRColocationDUnitTest.validateColocatedRegions(\"K\"));\n }", "@Test(timeout=75000)\n public void testSplitDaughtersNotInMeta() throws Exception {\n TableName table = TableName.valueOf(\"testSplitdaughtersNotInMeta\");\n Table meta = connection.getTable(TableName.META_TABLE_NAME, tableExecutorService);\n try {\n setupTable(table);\n assertEquals(ROWKEYS.length, countRows());\n\n // make sure data in regions, if in wal only there is no data loss\n admin.flush(table);\n HRegionLocation location = tbl.getRegionLocation(Bytes.toBytes(\"B\"));\n\n HRegionInfo hri = location.getRegionInfo();\n\n // Disable CatalogJanitor to prevent it from cleaning up the parent region\n // after split.\n admin.enableCatalogJanitor(false);\n\n // do a regular split\n byte[] regionName = location.getRegionInfo().getRegionName();\n admin.splitRegion(location.getRegionInfo().getRegionName(), Bytes.toBytes(\"BM\"));\n TestEndToEndSplitTransaction.blockUntilRegionSplit(conf, 60000, regionName, true);\n\n PairOfSameType<HRegionInfo> daughters =\n MetaTableAccessor.getDaughterRegions(meta.get(new Get(regionName)));\n\n // Delete daughter regions from meta, but not hdfs, unassign it.\n Map<HRegionInfo, ServerName> hris = tbl.getRegionLocations();\n undeployRegion(connection, hris.get(daughters.getFirst()), daughters.getFirst());\n undeployRegion(connection, hris.get(daughters.getSecond()), daughters.getSecond());\n\n List<Delete> deletes = new ArrayList<>();\n deletes.add(new Delete(daughters.getFirst().getRegionName()));\n deletes.add(new Delete(daughters.getSecond().getRegionName()));\n meta.delete(deletes);\n\n // Remove daughters from regionStates\n RegionStates regionStates = TEST_UTIL.getMiniHBaseCluster().getMaster().\n getAssignmentManager().getRegionStates();\n regionStates.deleteRegion(daughters.getFirst());\n regionStates.deleteRegion(daughters.getSecond());\n\n HBaseFsck hbck = doFsck(conf, false);\n assertErrors(hbck,\n new ERROR_CODE[] { ERROR_CODE.NOT_IN_META_OR_DEPLOYED, ERROR_CODE.NOT_IN_META_OR_DEPLOYED,\n ERROR_CODE.HOLE_IN_REGION_CHAIN }); //no LINGERING_SPLIT_PARENT\n\n // now fix it. The fix should not revert the region split, but add daughters to META\n hbck = doFsck(\n conf, true, true, false, false, false, false, false, false, false, false, false, null);\n assertErrors(hbck,\n new ERROR_CODE[] { ERROR_CODE.NOT_IN_META_OR_DEPLOYED, ERROR_CODE.NOT_IN_META_OR_DEPLOYED,\n ERROR_CODE.HOLE_IN_REGION_CHAIN });\n\n // assert that the split hbase:meta entry is still there.\n Get get = new Get(hri.getRegionName());\n Result result = meta.get(get);\n assertNotNull(result);\n assertNotNull(MetaTableAccessor.getHRegionInfo(result));\n\n assertEquals(ROWKEYS.length, countRows());\n\n // assert that we still have the split regions\n assertEquals(tbl.getStartKeys().length, SPLITS.length + 1 + 1); //SPLITS + 1 is # regions pre-split.\n assertNoErrors(doFsck(conf, false)); //should be fixed by now\n } finally {\n admin.enableCatalogJanitor(true);\n meta.close();\n cleanupTable(table);\n }\n }", "public interface NoCopySpan\n/* */ {\n/* */ public static class Concrete\n/* */ implements NoCopySpan\n/* */ {\n/* */ public Concrete() {\n/* 37 */ throw new RuntimeException(\"Stub!\");\n/* */ }\n/* */ }\n/* */ }", "public LinearGenomeShrinkMutation(){\n\t\tnumberGenesToRemove = 1;\n\t}", "void removebranchGroupInU(int i,boolean dead)\n {\n if(dead==true)\n {\n \n if(controlArray[i]==true)\n {\n //branchGroupArray[i].detach();\n \n branchGroupArray[i]=null ;\n controlArray[i]=false ;\n }\n \n \n }\n \n else \n {\n if(controlArray[i]==true)\n {\n branchGroupArray[i].detach();\n //branchGroupArray[i]=null;\n controlArray[i]=false ;\n }\n }\n }", "public void testSetPropertyStart()\n throws IOException\n {\n HeaderBlockWriter block = new HeaderBlockWriter();\n\n block.setPropertyStart(0x01234567);\n ByteArrayOutputStream output = new ByteArrayOutputStream(512);\n\n block.writeBlocks(output);\n byte[] copy = output.toByteArray();\n byte[] expected =\n {\n ( byte ) 0xD0, ( byte ) 0xCF, ( byte ) 0x11, ( byte ) 0xE0,\n ( byte ) 0xA1, ( byte ) 0xB1, ( byte ) 0x1A, ( byte ) 0xE1,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0x3B, ( byte ) 0x00, ( byte ) 0x03, ( byte ) 0x00,\n ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0x09, ( byte ) 0x00,\n ( byte ) 0x06, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0x67, ( byte ) 0x45, ( byte ) 0x23, ( byte ) 0x01,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0x00, ( byte ) 0x10, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0xFE, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x00,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF,\n ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF, ( byte ) 0xFF\n };\n\n assertEquals(expected.length, copy.length);\n for (int j = 0; j < 512; j++)\n {\n assertEquals(\"testing byte \" + j, expected[ j ], copy[ j ]);\n }\n }", "public ByteBuf discardSomeReadBytes()\r\n/* 113: */ {\r\n/* 114:130 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 115:131 */ return super.discardSomeReadBytes();\r\n/* 116: */ }", "public ItemStack func_70304_b(int par1)\n/* */ {\n/* 45 */ return null;\n/* */ }", "phaseI.Hdfs.BlockLocations getNewBlock();", "private void m16569e() {\n this.f14723f.removeMessages(this.f14724g);\n }", "private android.graphics.Bitmap m14713a(com.clevertap.android.sdk.C3072b1 r18, com.clevertap.android.sdk.C3072b1 r19) {\n /*\n r17 = this;\n r0 = r17\n r1 = r18\n r2 = r19\n int[] r10 = r0.f10958m\n r11 = 0\n if (r2 != 0) goto L_0x000e\n java.util.Arrays.fill(r10, r11)\n L_0x000e:\n r12 = 3\n r13 = 2\n r14 = 1\n if (r2 == 0) goto L_0x005e\n int r3 = r2.f10976g\n if (r3 <= 0) goto L_0x005e\n if (r3 != r13) goto L_0x0037\n boolean r3 = r1.f10975f\n if (r3 != 0) goto L_0x002c\n com.clevertap.android.sdk.c1 r3 = r0.f10961p\n int r4 = r3.f11004l\n int[] r5 = r1.f10980k\n if (r5 == 0) goto L_0x0033\n int r3 = r3.f11002j\n int r5 = r1.f10977h\n if (r3 != r5) goto L_0x0033\n goto L_0x0032\n L_0x002c:\n int r3 = r0.f10959n\n if (r3 != 0) goto L_0x0032\n r0.f10969x = r14\n L_0x0032:\n r4 = 0\n L_0x0033:\n r0.m14716a(r10, r2, r4)\n goto L_0x005e\n L_0x0037:\n if (r3 != r12) goto L_0x005e\n android.graphics.Bitmap r3 = r0.f10963r\n if (r3 != 0) goto L_0x0041\n r0.m14716a(r10, r2, r11)\n goto L_0x005e\n L_0x0041:\n int r4 = r2.f10973d\n int r5 = r0.f10966u\n int r9 = r4 / r5\n int r4 = r2.f10971b\n int r7 = r4 / r5\n int r4 = r2.f10972c\n int r8 = r4 / r5\n int r2 = r2.f10970a\n int r6 = r2 / r5\n int r5 = r0.f10968w\n int r2 = r7 * r5\n int r4 = r2 + r6\n r2 = r3\n r3 = r10\n r2.getPixels(r3, r4, r5, r6, r7, r8, r9)\n L_0x005e:\n r17.m14715a(r18)\n int r2 = r1.f10973d\n int r3 = r0.f10966u\n int r2 = r2 / r3\n int r4 = r1.f10971b\n int r4 = r4 / r3\n int r5 = r1.f10972c\n int r5 = r5 / r3\n int r6 = r1.f10970a\n int r6 = r6 / r3\n r3 = 8\n int r7 = r0.f10959n\n if (r7 != 0) goto L_0x0077\n r7 = 1\n goto L_0x0078\n L_0x0077:\n r7 = 0\n L_0x0078:\n r3 = 0\n r8 = 1\n r9 = 8\n L_0x007c:\n if (r11 >= r2) goto L_0x0100\n boolean r15 = r1.f10974e\n if (r15 == 0) goto L_0x0098\n r15 = 4\n if (r3 < r2) goto L_0x0095\n int r8 = r8 + 1\n if (r8 == r13) goto L_0x0094\n if (r8 == r12) goto L_0x0091\n if (r8 == r15) goto L_0x008e\n goto L_0x0095\n L_0x008e:\n r3 = 1\n r9 = 2\n goto L_0x0095\n L_0x0091:\n r3 = 2\n r9 = 4\n goto L_0x0095\n L_0x0094:\n r3 = 4\n L_0x0095:\n int r15 = r3 + r9\n goto L_0x009a\n L_0x0098:\n r15 = r3\n r3 = r11\n L_0x009a:\n int r3 = r3 + r4\n int r12 = r0.f10967v\n if (r3 >= r12) goto L_0x00f0\n int r12 = r0.f10968w\n int r3 = r3 * r12\n int r16 = r3 + r6\n int r13 = r16 + r5\n int r14 = r3 + r12\n if (r14 >= r13) goto L_0x00ad\n int r13 = r3 + r12\n L_0x00ad:\n int r3 = r0.f10966u\n int r12 = r11 * r3\n int r14 = r1.f10972c\n int r12 = r12 * r14\n int r14 = r13 - r16\n int r14 = r14 * r3\n int r14 = r14 + r12\n r3 = r16\n L_0x00bc:\n if (r3 >= r13) goto L_0x00f0\n r19 = r2\n int r2 = r0.f10966u\n r16 = r4\n r4 = 1\n if (r2 != r4) goto L_0x00d2\n byte[] r2 = r0.f10957l\n byte r2 = r2[r12]\n r2 = r2 & 255(0xff, float:3.57E-43)\n int[] r4 = r0.f10946a\n r2 = r4[r2]\n goto L_0x00d8\n L_0x00d2:\n int r2 = r1.f10972c\n int r2 = r0.m14712a(r12, r14, r2)\n L_0x00d8:\n if (r2 == 0) goto L_0x00dd\n r10[r3] = r2\n goto L_0x00e6\n L_0x00dd:\n boolean r2 = r0.f10969x\n if (r2 != 0) goto L_0x00e6\n if (r7 == 0) goto L_0x00e6\n r2 = 1\n r0.f10969x = r2\n L_0x00e6:\n int r2 = r0.f10966u\n int r12 = r12 + r2\n int r3 = r3 + 1\n r2 = r19\n r4 = r16\n goto L_0x00bc\n L_0x00f0:\n r19 = r2\n r16 = r4\n int r11 = r11 + 1\n r2 = r19\n r3 = r15\n r4 = r16\n r12 = 3\n r13 = 2\n r14 = 1\n goto L_0x007c\n L_0x0100:\n boolean r2 = r0.f10964s\n if (r2 == 0) goto L_0x0123\n int r1 = r1.f10976g\n if (r1 == 0) goto L_0x010b\n r2 = 1\n if (r1 != r2) goto L_0x0123\n L_0x010b:\n android.graphics.Bitmap r1 = r0.f10963r\n if (r1 != 0) goto L_0x0115\n android.graphics.Bitmap r1 = r17.m14718q()\n r0.f10963r = r1\n L_0x0115:\n android.graphics.Bitmap r1 = r0.f10963r\n r3 = 0\n int r7 = r0.f10968w\n r5 = 0\n r6 = 0\n int r8 = r0.f10967v\n r2 = r10\n r4 = r7\n r1.setPixels(r2, r3, r4, r5, r6, r7, r8)\n L_0x0123:\n android.graphics.Bitmap r9 = r17.m14718q()\n r3 = 0\n int r7 = r0.f10968w\n r5 = 0\n r6 = 0\n int r8 = r0.f10967v\n r1 = r9\n r2 = r10\n r4 = r7\n r1.setPixels(r2, r3, r4, r5, r6, r7, r8)\n return r9\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.clevertap.android.sdk.C3068a1.m14713a(com.clevertap.android.sdk.b1, com.clevertap.android.sdk.b1):android.graphics.Bitmap\");\n }", "@DISPID(1611006072) //= 0x60060078. The runtime will prefer the VTID if present\n @VTID(147)\n boolean deleteWarningBox();", "@Test (timeout=180000)\n public void testContainedRegionOverlap() throws Exception {\n TableName table =\n TableName.valueOf(\"tableContainedRegionOverlap\");\n try {\n setupTable(table);\n assertEquals(ROWKEYS.length, countRows());\n\n // Mess it up by creating an overlap in the metadata\n HRegionInfo hriOverlap =\n createRegion(tbl.getTableDescriptor(), Bytes.toBytes(\"A2\"), Bytes.toBytes(\"B\"));\n TEST_UTIL.getHBaseCluster().getMaster().assignRegion(hriOverlap);\n TEST_UTIL.getHBaseCluster().getMaster().getAssignmentManager()\n .waitForAssignment(hriOverlap);\n ServerName server = regionStates.getRegionServerOfRegion(hriOverlap);\n TEST_UTIL.assertRegionOnServer(hriOverlap, server, REGION_ONLINE_TIMEOUT);\n\n HBaseFsck hbck = doFsck(conf, false);\n assertErrors(hbck, new ERROR_CODE[] {\n ERROR_CODE.OVERLAP_IN_REGION_CHAIN });\n assertEquals(2, hbck.getOverlapGroups(table).size());\n assertEquals(ROWKEYS.length, countRows());\n\n // fix the problem.\n doFsck(conf, true);\n\n // verify that overlaps are fixed\n HBaseFsck hbck2 = doFsck(conf,false);\n assertNoErrors(hbck2);\n assertEquals(0, hbck2.getOverlapGroups(table).size());\n assertEquals(ROWKEYS.length, countRows());\n } finally {\n cleanupTable(table);\n }\n }" ]
[ "0.5977682", "0.59522206", "0.57200843", "0.57190716", "0.56996214", "0.5614598", "0.5485327", "0.5483199", "0.54684085", "0.5417067", "0.5406487", "0.5353741", "0.5343063", "0.5332558", "0.5328872", "0.5320241", "0.5316172", "0.52818745", "0.5281417", "0.5266477", "0.5265458", "0.5231492", "0.52288955", "0.5203517", "0.5181902", "0.5172934", "0.5170424", "0.5168992", "0.5157394", "0.51549304", "0.51482207", "0.51481247", "0.5147065", "0.5137402", "0.51328325", "0.5127885", "0.5118067", "0.51069987", "0.508498", "0.50842464", "0.50834835", "0.5072888", "0.5056299", "0.50495875", "0.50350606", "0.50347006", "0.5024069", "0.5009556", "0.50076365", "0.50048864", "0.49974164", "0.49760184", "0.49754962", "0.49622712", "0.49548253", "0.49458233", "0.4945318", "0.49397078", "0.49345532", "0.49334368", "0.493174", "0.49289495", "0.49264035", "0.49209988", "0.4915246", "0.490675", "0.49062884", "0.4901401", "0.4891346", "0.4889689", "0.48831555", "0.48810577", "0.48795235", "0.48787105", "0.48782668", "0.48679006", "0.48618647", "0.48608872", "0.48565593", "0.48564607", "0.4854447", "0.4854061", "0.4853165", "0.48517635", "0.48474813", "0.48403946", "0.4834901", "0.4832462", "0.48310006", "0.48281106", "0.48239717", "0.48210415", "0.4817761", "0.48177338", "0.48149413", "0.48147333", "0.480983", "0.48093444", "0.4808865", "0.48023957", "0.4797134" ]
0.0
-1
print the result without duplications
private void printData(Set<ModelData> data) { for (ModelData modelData : data) { Log.i(TAG,"Id "+modelData.getId()+",Name: "+modelData.getName()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void duplicate() {\n System.out.println(\"Je bent al in bezit van deze vragenlijst!\");\n }", "static void findDuplicate()\n\t{\n\n\t\tList<String> oList = null;\n\t\tSet<String> oSet = null;\n\t\ttry {\n\t\t\toList = new ArrayList<String>();\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\toList.add(\"Frog\");\n\t\t\toList.add(\"Dog\");\n\t\t\toList.add(\"Eagle\");\n\t\t\toList.add(\"Frog\");\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\tSystem.out.println(oList);\n\t\t\t\n\t\t\toSet = new TreeSet<>();\n\t\t\t\n\t\t\tString s = \"\";\n\t\t\tfor(int i=0;i<oList.size();i++)\n\t\t\t{\n\t\t\t\tif((oSet.add(oList.get(i))==false) && (!s.contains(oList.get(i))))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Duplicate: \"+oList.get(i));\n\t\t\t\t\ts+=oList.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}catch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\toList = null;\n\t\t\toSet = null;\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tint a[] = { 1, 2, 3, 6, 7, 8, 2, 3 };\r\n\r\n\t\tSystem.out.println(\"The Duplicates in the array is: \");\r\n\t\t\r\n\t\t//1 1\r\n\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tfor (int j=i+1; j < a.length; j++) {\r\n\t\t\t\tif (a[i] == a[j]) {\r\n\t\t\t\t\tSystem.out.println(a[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "private void printNonDuplicates( Collection< String > collection )\r\n {\r\n // create a HashSet \r\n Set< String > set = new HashSet< String >( collection ); \r\n\r\n System.out.println( \"\\nNonduplicates are: \" );\r\n\r\n for ( String s : set )\r\n System.out.printf( \"%s \", s );\r\n\r\n System.out.println();\r\n }", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t int arr[] = { 1, 2, 3,4, 4, 5, 6, 7 ,6}; \n\t\t \n\t\t printDuplicate(arr);\n\n\n\t}", "private void printNonDuplicates( Collection< String > collection )\r\n {\r\n \t // create a HashSet using a collection as parameter\r\n \t Set< String > set = new HashSet< String >( collection );\r\n \t System.out.println( \"Nonduplicates are: \" );\r\n \t for ( String s : set )\r\n \t\t System.out.printf( \"%s \", s );\r\n \t System.out.println();\r\n \t }", "public static void printDuplicate(String str){\n\t\t\n\t\tString[] strArray = str.split(\" \");\n\t\t\n\t\tHashMap<String, Integer> hm = new HashMap<>();\n\t\t\n\t\t/*for(String tempString : strArray){\n\t\t\tif(hm.containsKey(strArray[i])){\n\t\t\t\t\n\t\t\t\thm.put(strArray[i], hm.get(strArray[i])+1);\n\t\t\t}else{\n\t\t\t\thm.put(strArray[i], 1);\n\t\t\t}\n\t\t}*/\n\t\t\n\t\t//or\n\t\t\n\t\tfor(int i=0; i<strArray.length; i++){\n\t\t\t\n\t\t\tif(hm.containsKey(strArray[i])){\n\t\t\t\t\n\t\t\t\thm.put(strArray[i], hm.get(strArray[i])+1);\n\t\t\t}else{\n\t\t\t\thm.put(strArray[i], 1);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(hm);\n\t\t\n\t\tfor (Map.Entry<String, Integer> entry : hm.entrySet()) {\n\t\t\tif(entry.getValue()>1){\n\t\t\t\tSystem.out.print(\"Item : \" + entry.getKey() + \" Count : \" + entry.getValue());\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\t//java 8 iteration\n\t\thm.forEach((k,v)->{\n\t\t\t//System.out.println(\"Item : \" + k + \" Count : \" + v);\n\t\t\t\n\t\t\tif(v > 1){\n\t\t\t\t\n\t\t\t\tSystem.out.println(k +\" \" + v);\n\t\t\t}\n\t\t});\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tList<Integer> numbers = Arrays.asList(9, 10, 3, 4, 7, 3, 4);\n\t\tList<Integer> distinct = numbers.stream().map(i -> i * i).distinct().collect(Collectors.toList());\n\t\tSystem.out.printf(\"Original List : %s, Square Without duplicates : %s %n\", numbers, distinct);\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tString[] niz = { \"abc\",\"bcd\",\"efg\",\"ijk\",\"lmn\",\"abc\",\"bcd\"};\n\n\t\tfor(int i=0;i<niz.length-1;i++) {\n\t\t\tfor(int j=i+1;j<niz.length;j++) {\n\t\t\t\tif(niz[i]== niz[j] && (i !=j)) { // moze ici i ovako if( (my_array[i].equals(my_array[j])) && (i != j) )\n\t\t\t\t\tSystem.out.println(\"dupli elementi su : \" + niz[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void display()\r\n\t{\r\n\t\tfor (int i = 0; i < count; i++)\r\n\t\t\ts2.push(s1.pop());\r\n\t\tfor(int i = 0; i < count; i++)\r\n\t\t{\r\n\t\t\tSystem.out.print(s2.peek() + \" \");\r\n\t\t\ts1.push(s2.pop());\r\n\t\t}\r\n\t\tSystem.out.println(\"\");\r\n\t}", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tList<Integer> nums = new ArrayList<>();\r\n\t\t\r\n\t\tnums.add(10);nums.add(10);nums.add(10);nums.add(8);\r\n\t\tnums.add(11);nums.add(10);nums.add(10);nums.add(10);\r\n\r\n\t\tSystem.out.println(nums);\r\n\t\t\r\n\t\tList<Integer> unique1 = new ArrayList<>(); \r\n\t\t\r\n\t\t\r\n\t\t // find unique NON DUPLICATE VALUES\r\n\t\tfor(Integer num: nums) {\r\n\t\t\tif(!unique1.contains(num)) { // if unique1 doesn't contains num add it\r\n\t\t\t\tunique1.add(num); //<<<<<======= adding to unique1 num one by one\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(unique1.toString());\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t \r\n\t\t\r\n\t\tList<Integer> unique2 = new ArrayList<>();\r\n\t\t\r\n\t\tfor(int i =0; i<nums.size(); i++) { // find unique ( appearence once)\r\n\t\t\tint count=0;\r\n\t\t\t\r\n\t\t\tInteger value = nums.get(i);\r\n\t\t\tfor(int k =0; k<nums.size(); k++) {\r\n\t\t\t\tif(nums.get(k)== value && i != k) {\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(count == 0) {\r\n\t\t\t\tunique2.add(value);\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(unique2);\r\n\t\t\r\n\t}", "public static void main(String args[]) {\n\t\t\n\t\tint arr[]= {1,2,3,2,3,4,5,4,6};\n\t\t\n\t\tSystem.out.print(\"The original including the duplicate elements is: \");\n\t\tfor(int i=0; i<arr.length; i++) {\n\t\t\tSystem.out.print(arr[i] + \" \");\n\t\t}\n\t\t\n\t\tSystem.out.println(\" \\n \");\n\t\t\n//\t\tThe search for the duplicate array begins here.\n\t\t\n\t\tSystem.out.print(\"The array of duplicate elements are the following: \");\n\t\t\n\t\tfor(int i=0;i<arr.length;i++) {\n\t\t\t\t\n\t\t\tfor(int j=i+1;j<arr.length;j++) {\n\t\t\t\tif(arr[i]==arr[j]) {\n\t\t\t\t\tSystem.out.print(arr[j] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tint a[] = {1,2,2,6,7,3,4,4,5,5,6,7};\n\t\t\n\t\t\n\t\tMap<Integer,Integer> map =new HashMap<Integer,Integer>();\n\t\t\n\t\tfor (Integer num :a) {\n\t\t\tInteger Count =map.get(num);\n\t\t\tif(Count==null) {\n\t\t\t\tmap.put(num, 1);\n\t\t\t}else {\n\t\t\t\tmap.put(num, ++Count);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tSet<Entry<Integer, Integer>> entryset =map.entrySet();\n\t\tArrayList<Integer> list =new ArrayList<Integer>();\n\t\tfor(Entry<Integer, Integer> entry :entryset) {\n\t\t\tif(entry.getValue()>1) {\n\t\t\t\tlist.add(entry.getKey());\n\t\t\t\t}\n\t\t\t}\n\t\tSystem.out.println(\"Duplicates are \" +list);\n\t\t\n\t\tSet<Entry<Integer, Integer>> entryset1 =map.entrySet();\n\t\tArrayList<Integer> nonduplist =new ArrayList<Integer>();\n\t\tfor(Entry<Integer, Integer> entry1 :entryset1) {\n\t\t\tif(entry1.getValue()==1) {\n\t\t\t\tnonduplist.add(entry1.getKey());\n\t\t\t\t}\n\t\t\t}\n\t\tSystem.out.println(\"Non Duplicates are \" +nonduplist);\n\t\t\n \n}", "@Override\r\n\tpublic void printResult() {\n\t\tfor(Integer i:numbers)\r\n\t\t{\r\n\t\t\tSystem.out.println(i+\" \");\r\n\t\t}\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tint[] A={0,1,2,2,2,3,4};\n\t\tSystem.out.println(removeDuplicates(A));\n\t\tfor(int i=0;i<A.length;i++){\n\t\t\tSystem.out.print(A[i]);\n\t\t}\n\t}", "public static void printDuplicateCharacters(String word) {\r\n\t\tchar[] characters = word.toCharArray();\r\n\t\t// build HashMap with character and number of times they appear in\r\n\t\tMap<Character, Integer> charMap = new HashMap<Character, Integer>();\r\n\t\tfor (Character ch : characters) {\r\n\t\t\tif (charMap.containsKey(ch)) {\r\n\t\t\t\tcharMap.put(ch, charMap.get(ch) + 1);\r\n\t\t\t} else {\r\n\t\t\t\tcharMap.put(ch, 1);\r\n\t\t\t}\r\n\t\t} // Iterate through HashMap to print all duplicate characters of String\r\n\t\tSet<Map.Entry<Character, Integer>> entrySet = charMap.entrySet();\r\n\t\tSystem.out.printf(\"List of duplicate characters in String '%s' %n\", word);\r\n\t\tfor (Map.Entry<Character, Integer> entry : entrySet) {\r\n\t\t\tif (entry.getValue() > 1) {\r\n\t\t\t\tSystem.out.printf(\"%s : %d %n\", entry.getKey(), entry.getValue());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void outputDiff() {\n this.pw.println(\"Change\\t\" + \"Subset\\t\" + \"Concept\\t\"\r\n + \"Value Changed\\t\" + \"Old Value\\t\" + \"New Value\");\r\n for (final DiffElement de : this.diffSet) {\r\n this.pw.println(de.toString());\r\n }\r\n this.pw.close();\r\n\r\n }", "public static void main(String[] args) {\n\n\t\t\n\t\tList<Character>st1=new ArrayList<>();\n\t\n\t\tst1.add('a');\n\t\tst1.add('b');\n\t\tst1.add('a');\n\t\tst1.add('a');\n\t\tst1.add('c');\n\t\tst1.add('t');\n\t\n\t\tSystem.out.println(st1);//[a, b, a, a, c, t]\n\t\t\n\t\tList<Character>st2=new ArrayList<>();//empty []\n\t\tfor (int i=0; i<st1.size();i++) {\n\t\t\tif(!st2.contains(st1.get(i))) {\n\t\t\t\t// created str2 [empty], we will get the element from st1 to st2 while checking if there is repetition \n\t\t\t\tst2.add(st1.get(i));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(st2);//[a, b, c, t]\n\t\t\n\n\t}", "public void print() {\n\t\tSystem.out.println(word0 + \" \" + word1 + \" \" + similarity);\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\tAnagramCheck();\n\t\tSet<Character> se = new HashSet<Character>();\n\t\tSet<Character> se1 = new HashSet<Character>();\n\t\t\n\t\tStringBuffer sb = new StringBuffer();\n\t\tStringBuffer sb1 = new StringBuffer();\n\t\tString str =\"javav\";\n\t\t\n\t\tfor(int i =0; i <str.length();i++)\n\t\t{\n\t\t\tCharacter ch = str.charAt(i);\n\t\t\t\n\t\t\tif(!se.contains(ch))\n\t\t\t{\n\t\t\t\tse.add(ch);\n\t\t\t\tsb.append(ch);\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tse1.add(ch);\n\t\t\t\tsb1.append(ch);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"The duplicates after removed \"+sb.toString());\n\t\t\n\t\tSystem.out.println(\"The duplicate item is \"+sb1.toString());\n\t}", "public static void main(String[] args) {\n\t\tint[] nums = {1,1,2,3,4,3,4};\n\t\tfor(int i=0; i<nums.length;i++) {\n\t\t\tint count = 0;\n\t\t\tfor(int j=0; j<nums.length; j++) {\n\t\t\t\tif(nums[i]==nums[j]) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\tif(count==1) {\n\t\t\t\tSystem.out.println(nums[i]);\n\t\t\t}\n\t\t}\n\n\t}", "public void print(){\n System.out.println(\"(\"+a.getAbsis()+\"_a,\"+a.getOrdinat()+\"_a)\");\n System.out.println(\"(\"+b.getAbsis()+\"_b,\"+b.getOrdinat()+\"_b)\");\n System.out.println(\"(\"+c.getAbsis()+\"_b,\"+c.getOrdinat()+\"_c)\");\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tInteger[] numbers = new Integer[] {1, 73, 12, - 5, 73, 8, - 5, 1, 12};\n\t\n\t\tSet<Integer> equalNumbers = new HashSet<Integer>();\n\t\tSet<Integer> uniqueNumbers = new HashSet<Integer>();\n\t\tString uniqueNumber = \"\";\n\t\t\n\t\tfor (int i = 0; i < numbers.length; i++) {\n\t\t\tfor (int j = i + 1; j < numbers.length; j++) {\n\t\t\tif (numbers[i] == numbers[j]) {\n\t\t\t\tif (!equalNumbers.contains(numbers[j])) {\n\t\t\t\t\tequalNumbers.add(numbers[j]);\t// 1, -5, 73, 12,\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (!uniqueNumbers.contains(numbers[j]))\n\t\t\t\tuniqueNumbers.add(numbers[j]);\t // 1, -5, 8, 73, 12, \t\t\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\tfor (Integer number : equalNumbers) {\n\t\t\tSystem.out.print(number.toString() + \", \"); // 1, -5, 73, 12,\n\t\t}\t\n\t\tSystem.out.println();\t\t\n\t\tfor (Integer number : uniqueNumbers) {\n\t\t\tSystem.out.print(number.toString() + \", \"); // 1, -5, 8, 73, 12, \n\t\t} \n\t\t\n\t\tfor (Integer number : uniqueNumbers) {\n\t\t\tif (!equalNumbers.contains(number)) {\n\t\t\t\tuniqueNumber += number;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println();\t\n System.out.println(\"The uniqie number is : \" + uniqueNumber);\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn this.element +\" \"+duplicateCount+\" \"+probeCount;\n\t}", "static void AddAndDisplay()\n\t{\n\t\tSet<String> oSet = null;\n\t\ttry {\n\t\t\toSet = new TreeSet<String>();\n\t\t\toSet.add(\"Apple\");\n\t\t\toSet.add(\"Boy\");\n\t\t\toSet.add(\"Cat\");\n\t\t\toSet.add(\"Apple\");\n\t\t\tSystem.out.println(oSet);\n\t\t\tSystem.out.println(\"****************\");\n\t\t\t\n\t\t\tfor(String s:oSet)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"for each loop: \"+s);\n\t\t\t}\n\t\t\tSystem.out.println(\"****************\");\n\t\t\t\n\t\t\tIterator<String> it = oSet.iterator();\n\t\t\twhile(it.hasNext())\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Iterator: \"+it.next());\n\t\t\t}\n\t\t\tSystem.out.println(\"****************\");\n\t\t\t\n\t\t\tSpliterator<String> sp = oSet.spliterator();\n\t\t\tsp.forEachRemaining(System.out::println);\n\t\t\tSystem.out.println(\"****************\");\n\t\t\t\n\t\t\toSet.forEach((k)->System.out.println(\"for each method: \"+k));\n\t\t}catch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\toSet = null;\n\t\t}\n\t}", "public String cyclify() {\n return toString();\n }", "public void display() {\n\tString tm = \"{ \";\n\tIterator it = entrySet().iterator();\n\twhile(it.hasNext()) {\n\t\ttm += it.next() + \" ,\";\n\t}\n\ttm = tm.substring(0, tm.length() - 2) + \" }\";\n\tSystem.out.println(tm);\n }", "public void matchingcouple()\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Output :\");\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Following are the matching pairs \");\r\n\t\t\t\t\r\n\t\t\t\tfor(int i=0;i<womenmatchinlist.size();i++)\r\n\t\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t// print the matching pair from same index of men and women matching list\r\n\t\t\t\tSystem.out.println(menmatchinglist.get(i)+\" is engaged with \"+womenmatchinlist.get(i));\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}", "public static void printPerfectNumbers(){\n\t\tfor(Long x:result){\n\t\t\tSystem.out.println(x);\n\t\t}\n\t}", "void showsame() {\n\t\tint count;\n\t\tprintstatus = idle;\n\t\tif (newinfo.other[printnewline] != printoldline) {\n\t\t\tSystem.err.println(\"BUG IN LINE REFERENCING\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tcount = blocklen[printoldline];\n\t\tprintoldline += count;\n\t\tprintnewline += count;\n\t}", "public SetTest()\r\n {\r\n List< String > list = Arrays.asList( colors );\r\n System.out.printf( \"ArrayList: %s\\n\", list );\r\n printNonDuplicates( list );\r\n }", "void printSubgraphs() {\n StringBuilder sb = new StringBuilder();\n for(int sgKey: listOfSolutions.keySet()) {\n HashMap<Integer, Long> soln = listOfSolutions.get(sgKey);\n // inside a soln\n //sb.append(\"S:8:\");\n for(int key: soln.keySet()) {\n sb.append(key + \",\" + soln.get(key) + \";\");\n\n }\n sb.setLength(sb.length() - 1);\n sb.append(\"\\n\");\n }\n System.out.println(\"\\n\" + sb.toString());\n }", "public static void main(String[] args) {\n System.out.print(unique(new int[]{100, 11, 34, 11, 52, 61, 1, 34}));\n // should print: `[1, 11, 34, 52, 61]`\n\n\n }", "public static void printDistinctElement(int arr[]) {\r\n\t\tSet<Integer> set = new HashSet<>();\r\n\t\tfor(int num : arr){\r\n\t\t\tif(set.add(num)){\r\n\t\t\t\tSystem.out.print(num + \" \");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\n\t\tint [] numbers = {2, 7, 3, 2, 3, 7, 7};\n\t\tSet<Integer> set = new HashSet<>();\n\t\tfor(int i = 0; i < numbers.length; i++) {\n\t\t\tif(!set.contains(numbers[i])) {\n\t\t\t\tset.add(numbers[i]);\n\t\t\t\tSystem.out.print(numbers[i] + \" \");\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void display() {\n\t\tStringBuilder string = new StringBuilder();\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (hashArray[i] == null)\n\t\t\t\tstring.append(\"** \");\n\t\t\telse if (hashArray[i] == deleted)\n\t\t\t\tstring.append(hashArray[i].value + \" \");\n\t\t\telse\n\t\t\t\tstring.append(\"[\" + hashArray[i].value + \", \"\n\t\t\t\t\t\t+ hashArray[i].frequency + \"] \");\n\t\t}\n\t\tSystem.out.println(string.toString());\n\t}", "public static void main(String[] args) {\n printUnique();\n }", "public static void testDedupe(){\n LinkedList<String> list = new LinkedList<String>();\n \n for(int i = 0; i < 10; i++)\n list.add(\"Number \" + i);\n for(int j = 0; j < 5; j++)\n list.add(\"Number \" + j);\n \n //print test list\n for (String num : list)\n System.out.print(num + \" \");\n \n //Call deDupe and reprint list\n LinkedLists.deDupe(list);\n System.out.println(\"List after removing dupes: \" + '\\n');\n for (String num : list)\n System.out.print(num + \" \");\n }", "public String toString()\n {\n\n String elem;\n StringBuilder s = new StringBuilder();\n for(int i = 0 ; i < n ; i++)\n {\n elem = Integer.toString(array1[i]);\n s.append(elem);\n if(i < (n-1))\n s.append(',');\n }\n s.append('|');\n for(int i = 0 ; i < n ; i++)\n {\n elem = Integer.toString(array2[i]);\n s.append(elem);\n if(i < (n-1))\n s.append(',');\n }\n return s.toString();\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tRemoveDuplicates r=new RemoveDuplicates();\r\n\t\tNode4 n1=new Node4(3);\r\n\t\tn1.next=null;\r\n\t\t//n1.next.next=new Node4(7);\r\n\t//\tn1.next.next.next=new Node4(6);\r\n\t\t//n1.next.next.next.next=new Node4(7);\r\n\t n1=r.removingDuplicates(n1);\r\n\twhile(n1!=null)\r\n\t\t{\tSystem.out.print(n1.val+\"->\");\r\n\t\t\tn1=n1.next;}\r\n\t\r\n\t\t\r\n\t}", "public static void removeDuplicateSample() {\n Node ll1 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n Node ll2 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(4, null)))));\n Node ll3 = new Node(1, new Node(1, new Node(3, new Node(4, new Node(5, null)))));\n Node ll4 = new Node(1, new Node(1, new Node(1, new Node(4, new Node(5, null)))));\n\n System.out.println(\"1===\");\n ll1.printList();\n ll1 = ll1.removeDuplicate();\n ll1.printList();\n\n System.out.println(\"2===\");\n ll2.printList();\n ll2 = ll2.removeDuplicate();\n ll2.printList();\n\n System.out.println(\"3===\");\n ll3.printList();\n ll3 = ll3.removeDuplicate();\n ll3.printList();\n\n System.out.println(\"4===\");\n ll4.printList();\n ll4 = ll4.removeDuplicate();\n ll4.printList();\n\n }", "public SetTest()\r\n\t{\r\n\t\tList< String > list = Arrays.asList( colors );\r\n\t\tSystem.out.printf( \"ArrayList: %s\\n\", list );\r\n\t\tprintNonDuplicates( list );\r\n\t\tprintSortedNonDuplicates(list);\r\n\t\t}", "public void dump(){\r\n\t\tString str = \"\";\r\n\t\tfor(int i = 0; i < M; i++){\r\n\t\t\tstr = str + i + \". \" + vals[i];\r\n\t\t\tif(keys[i] != null){\r\n\t\t\t\tstr = str + \" \" + keys[i] + \" (\";\r\n\t\t\t\tstr = str + hash(keys[i]) + \")\";\r\n\t\t\t}else\r\n\t\t\t\tstr = str + \" -\";\r\n\t\t\tSystem.out.println(str);\r\n\t\t\tstr = \"\";\r\n\t\t}\r\n\t\tSystem.out.println(\"Size: \" + N + \"\\n\"); //La till denna för enkelhetens skull\r\n\t}", "private void print() {\n\t\tList<Entry<String, Double>> entries = sort();\n\t\tfor (Entry<String, Double> entry: entries) {\n\t\t\tSystem.out.println(entry);\n\t\t}\n\t}", "@Override\n public String toString() {\n if (!leaves.isEmpty()) {\n out.append(\" { rank=same;\").append(System.lineSeparator());\n leaves.forEach(out::append);\n out.append(\" }\").append(System.lineSeparator());\n }\n\n // end of dot-file\n out.append(\"}\");\n return out.toString();\n }", "public static void runExercise6() {//distinct() - will remove duplicates\n // List <?> stAges = students.stream().map(student -> student.getAge()).sorted().collect(Collectors.toList());\n // System.out.println(\"\" + stAges);\n // students.stream().map(student -> student.getAge()).sorted().forEach(age -> {\n // System.out.println(age);\n // students.stream().filter(stud -> age == stud.getAge()).forEach(st -> System.out.println(age + \" \" + st.getName()));\n \n // });\n students.stream().map(student -> student.getAge()).sorted().distinct().forEach(age -> {\n students.stream().filter(stud -> stud.getAge() == age).forEach(name -> System.out.println(name.getName()));\n });\n \n \n }", "public void displayResult()\n {\n for(int i = 0; i < this.etatPopulation.size(); i++)\n {\n String line = \"\";\n for (int j = 0; j < this.etatPopulation.get(i).size(); j++)\n {\n line += this.etatPopulation.get(i).get(j).toString() + \" \";\n }\n System.out.println(line);\n }\n }", "public String toString(){\r\n\t DoubleLinkedSeq clone = new DoubleLinkedSeq(); \r\n\t clone = this.clone();\r\n\t String elements = \"{\";\r\n\t for(clone.cursor = head; clone.cursor != null; clone.cursor = clone.cursor.getLink()){\r\n\t\t elements = elements + (clone.cursor.getData() + \",\"); \r\n\t }\r\n\t \r\n\t elements = elements + \")\";\r\n\t \r\n\t return elements; \r\n }", "public void dump() {\n for(Object object : results) {\n System.out.println( object );\n }\n }", "public static void main(String[] args) {\n\t\tint count=0;\n String[] ab= {\"A\", \"B\", \"B\", \"F\", \"A\"};\n \n for(int i=0; i<ab.length;i++){\n\t for(int j=0;j<ab.length;j++){\n\t\t if(ab[i]==ab[j]){\n\t\t\t count++;\n\t\t\t \n\t\t\t if(count==2){\n\t\t\t\t System.out.println(ab[i]);\n\t\t\t\t count= --count-1;\n\t\t\t\t \n\t\t\t }\n\t\t\t \n\t\t }\n\t }\n }\n\t}", "public static void main(String[] args) {\n\t\tint[] data = { 1, 2, 2 };\r\n\t\tSystem.out.println(new Solution().subsetsWithDup(data));\r\n\r\n\t}", "public void print(){\n\t\tfor (int i=0; i<_size; i++){\n\t\t\tSystem.out.print(_a[i].getKey()+\"; \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public static void main(String[] args) throws Exception{\n int a = 0;\n for(int i=0;i<3;i++){\n while(true){\n System.out.print(i);\n a = i;\n break;\n }\n }\n System.out.print(a + \"\");\n\n// System.out.print(\"a=====\" +a+\"\"+b+ \"======b\"+ \"====\" +c);\n\n }", "public static void main(String[] args) {\n Set<String>list=new LinkedHashSet<>();\n list.add(\"Work\");\n list.add(\" smart\");\n list.add(\" not\");\n list.add(\" hard\");\n\n String str2=\"\";\n\n for(String str:list){\n str2+=str;\n }\n System.out.println(str2);\n }", "public static void main(String[] args) {\n\t\tint a[] = {4,4,4,5,5,5,6,6,6,9};\n\t\t\n\t\tArrayList<Integer> ab = new ArrayList<Integer>();\n\t\t\n\t\tfor(int i=0; i<a.length; i++)\n\t\t{\n\t\t\tint k =0;\n\t\t\tif(!ab.contains(a[i]))\n\t\t\t{\n\t\t\t\tab.add(a[i]);\n\t\t\t\tk++;\n\t\t\t\tfor(int j=i+1; j<a.length; j++)\n\t\t\t\t{\n\t\t\t\t\tif(a[i]==a[j])\n\t\t\t\t\t{\n\t\t\t\t\t\tk++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(a[i]);\n\t\t\t//System.out.println(k);\n\t\t\tif(k==1)\n\t\t\t\tSystem.out.println(a[i] +\" is unique number \");\n\t\t}\n\t\t\n\t}", "public static void main(String[] args) {\n int[] arr={1,2,2,2,3,4,4,45}; // 1 3 45\n int[] array={};\n int j=0;\n for (int each:arr){\n int count=0;\n for (int i = 0; i <arr.length ; i++) {\n if (each==arr[i]){\n count++;\n }\n }\n if (count==1){\n System.out.println(each+\" \");\n // array[j++]=each;\n }\n }\n System.out.println(Arrays.toString(array));\n }", "public void printResult(){\n StringBuilder sb = new StringBuilder(20);\n sb.append(left_value)\n .append(space)\n .append(symbol)\n .append(space)\n .append(right_value)\n .append(space)\n .append('=')\n .append(space)\n .append(result);\n System.out.println(sb);\n }", "public String print() {\n Collections.sort(ordini, Comparator.comparing(o -> o.dataAcquisto));\n return ordini.stream()\n .map(o->o.toString()+\"\\n\")\n .reduce(String::concat).orElse(\"\");\n }", "public static void main(String[] args) {\n\t int[] array= {1, 2, 3, 5, 465, 2, 8, 6, 8};\n System.out.println(hasDuplicates(array));\n System.out.println(hasDuplicates2(array));\n System.out.println(hasDuplicates3(array));\n\n String s1 = \"Hello World\";\n StringBuilder sb= new StringBuilder(s1);\n String reversed = sb.reverse().toString();\n System.out.println(reversed);\n\n Student jhony = new Student(\"John\", LocalDate.of(2000, Month.MAY,17), 85);\n Student paul = new Student(\"Paul\", LocalDate.of(1999, Month.JULY,1), 90);\n Student kolya = new Student(\"Kolya\", LocalDate.of(2002, Month.APRIL,6), 70);\n Student sasha = new Student(\"Sasha\", LocalDate.of(2005, Month.NOVEMBER,24), 29);\n Student tom = new Student(\"Tom\", LocalDate.of(2001, Month.JANUARY,2), 10);\n\n List<Student> students= new ArrayList<>();\n students.add(jhony);\n students.add(paul);\n students.add(kolya);\n students.add(sasha);\n students.add(tom);\n// for (Student student:students) {\n// //if(student.getMarkJava()<50) System.out.println(student.getName());\n// if(student.getBirthday().getYear()>2000) System.out.println(student.getName());\n// }\n students.stream().filter(student -> student.getMarkJava()>50)\n .forEach(System.out::println);\n System.out.println(students.stream().filter(el -> el.getMarkJava() > 80).count());\n System.out.println(students.stream().max(Comparator.comparing(student -> student.getMarkJava())));\n System.out.println(students.stream().mapToInt(student -> student.getMarkJava()).max().getAsInt());\n System.out.println(students.stream().mapToInt(student -> student.getMarkJava()).min().getAsInt());\n System.out.println(students.stream().mapToInt(student -> student.getMarkJava()).sum());\n System.out.println(students.stream().mapToInt(student -> student.getMarkJava()).average().getAsDouble());\n System.out.println(students.stream().count());\n\n PartTimeEmployee ivan = new PartTimeEmployee(\"Ivan\",15,80);\n FullTimeEmployee vasya = new FullTimeEmployee(\"Vasya\",2,15,\"coder\");\n List<IAccounting> workers = new ArrayList<>();\n workers.add(ivan);\n workers.add(vasya);\n System.out.println(workers);\n\n }", "private void printResultSet(ResultSet rs) {\n\t\twhile(rs.hasNext()) {\t\n\t\t\tQuerySolution qs = rs.next();\n\t\t\tSystem.out.println(qs.toString());\n\t\t}\n\t\tSystem.out.println(\"------\");\n\t}", "public static void main(String[] args) {\n LinkRemoveDuplicates2 ll=new LinkRemoveDuplicates2();\r\n\r\n ll.insertFirst(40);\r\n\r\n ll.insertFirst(30);\r\n \r\n ll.insertFirst(20);\r\n ll.insertFirst(20);\r\n ll.insertFirst(10);\r\n ll.insertFirst(10);\r\n System.out.println(\"Initial List->\");\r\n ll.printList();\r\n ll.head=ll.remove(ll.head);\r\n System.out.println(\"\\n\\nAfter removing duplicates->\");\r\n ll.printList();\r\n\t}", "public static void main(String[] args) {\n\t\tint[] nums = {1,2,3,4,4,5,89,89};\n\t\tSystem.out.println(removeDups(nums));\n\t}", "public void peekCopy() {\n\t\tString first = listStr.get(0);\n\t\t//print out first in ArrayList\n\t\tSystem.out.println(first);\n\t\t//print out a new blank line for better readability\n\t\tSystem.out.println(\"\\n\");\n\t\t}", "public static void main(String[] args) {\n\t\t\r\n\t\t TreeSet<String> treeset = new TreeSet<String>();\r\n\t\t treeset.add(\"Good\");\r\n\t\t treeset.add(\"For\");\r\n\t\t treeset.add(\"Health\");\r\n\t\t //Add Duplicate Element\r\n\t\t treeset.add(\"Good\");\r\n\t\t System.out.println(\"TreeSet : \");\r\n\t\t for (String temp : treeset) {\r\n\t\t System.out.println(temp);\r\n\t\t }\r\n\t\t }", "public static void main(String[] args) {\n\t\t\n\t\tString [] array = {\"A\", \"A\", \"B\", \"C\", \"C\"};\n\t\t\n\t\tfor (int j = 0; j < array.length; j++) {\n\t\t\t\n\t\t\tint count = 0;\n\t\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\t\tif (array[i].equals(array[j]))\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\n\t\t\tif (count == 1)\n\t\t\tSystem.out.print(array[j] + \" \");\n\t\t\n\t\t}\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tHashSet<String> obj = new HashSet<String>();\n\t\t\n\t\tobj.add(\"Apple\");\n\t\tobj.add(\"Mango\");\n\t\tobj.add(\"Grapes\");\n\t\t\n\t\t//adding duplicate elements\n\t\tobj.add(\"Mango\");\n\t\tobj.add(\"Grapes\");\n\t\t\n\t\tobj.add(null);\n\t\tobj.add(null);\n\t\t\n\t\tSystem.out.println(obj);\n\t\t\n\t\t\t\t\n\t}", "@Override\n public void print() {\n for (int i = 1; i <= itertion; i++) {\n if(n <0){\n this.result = String.format(\"%-3d %-3s (%-3d) %-3s %d \", i, \"*\", n, \"=\", (n * i));\n System.out.println(this.result);\n }else {\n this.result = String.format(\"%-3d %-3s %-3d %-3s %d \", i, \"*\", n, \"=\", (n * i));\n System.out.println(this.result);\n }\n }\n }", "private static void printOutput (int[][] results)\n {\n for (int i=0; i<=results[0].length-1; i++)\n {\n System.out.println(results[0][i] +\",\"+ results[1][i]);\n }\n System.out.println();\n }", "public static void main(String[] args) {\n int [] A = {5,1,5,2,5,3,5,4};\n HashSet<Integer> aa = new HashSet<>();\n for (int i = 0; i <A.length ; i++) {\n if (aa.contains(A[i])) {\n System.out.println(A[i]);\n break;\n }else\n aa.add(A[i]);\n\n }\n\n }", "public static void main(String[] args) {\n\t\tArrayList<String> arrayListWithDups = new ArrayList<String>();\n\n\t\tarrayListWithDups.add(\"nonie\");\n\t\tarrayListWithDups.add(\"test\");\n\t\tarrayListWithDups.add(\"中中中\");\n\t\tarrayListWithDups.add(\"test\");\n\t\tarrayListWithDups.add(\"nonie\");\n\t\tarrayListWithDups.add(null);\n\t\tarrayListWithDups.add(\"中中中\");\n\t\tarrayListWithDups.add(\"homework\");\n\t\tarrayListWithDups.add(null);\n\n\t\t// Printing listWithDuplicateElements\n\t\tSystem.out.print(\"Input:\");\n\t\tSystem.out.println(arrayListWithDups);\n\n\t\t// Constructing HashSet using listWithDuplicateElements\n\t\tHashSet<String> removeDups = new HashSet<String>(arrayListWithDups);\n\n\t\t// Constructing listWithoutDuplicateElements using set\n\t\tArrayList<String> arrayListNoDups = new ArrayList<String>(removeDups);\n\n\t\t// Printing listWithoutDuplicateElements\n\t\tSystem.out.print(\"Ouput: \");\n\t\tSystem.out.println(arrayListNoDups);\n\t}", "private void print(){\n\t\tfor(int i = 0; i < maxNum; i++){\n\t\t\tSystem.out.print(m[i] + \" \");\n\t\t\t\n\t\t\tif((i + 1) % order == 0){\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}\n\t\tSystem.out.println();\n\t}", "public static void main(String[] args) {\n\t\tA1 a1=new A1(\"ram\",1,\"ram\");\n\t\tA1 a2=new A1(\"ram\",1,\"ram\");\n\t\tHashSet<A1> set=new HashSet<A1>();\n\t System.out.println(a1.getName());\n\t System.out.println(a2.getName());\n\t set.add(a1);\n\t set.add(a2);\n\t System.out.println(set.size());\n\t}", "private static String print(final ResultSet res) throws Exception {\n final StringBuilder sb = new StringBuilder();\n final ResultSetMetaData md = res.getMetaData();\n for(int i = 0; i < md.getColumnCount(); ++i) {\n sb.append(' ');\n sb.append(md.getColumnName(i + 1));\n sb.append(\" |\");\n }\n sb.append('\\n');\n while(res.next()) {\n for(int i = 0; i < md.getColumnCount(); ++i) {\n sb.append(' ');\n sb.append(res.getString(i + 1));\n sb.append(\" |\");\n }\n sb.append('\\n');\n }\n return sb.toString();\n }", "private void display(int[] array) {\n\t\tfor(int unique: array) {\n\t\t\tSystem.out.println(unique);\n\t\t}\n\t}", "@Override\r\n\tpublic String toString() {\n\t\treturn result;\r\n\t}", "public void printResults() {\r\n System.out.printf(\"\\nHistory\\n\\n\");\r\n String format = \"%-25s %s from %s\\n\";\r\n Collections.sort(results);\r\n for(Data data : results) {\r\n System.out.printf(format, data.getName(),\r\n defaultFormatter.format(data.getDate()), data.getComputer());\r\n }\r\n }", "@Override\n\tpublic void print(Multimap<String, List<String>> multimap,List<String> finalList) {\n\t\tmultimap= fileRecordsIntoMap(finalList);\n\t\tmultimap= \tremoveNonAnagram(multimap);\n\t\tSet<String> set=multimap.keySet();\n\t\tIterator<String> it=set.iterator();\n\t\twhile(it.hasNext())\n\t\t{\n\t\t\tList<String> list=(List) multimap.get(String.valueOf(it.next()));\n\t\t\tfor(String value:list)\n\t\t\t{\n\t\t\t\tSystem.out.print(value+\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public String toString() {\n if (first.p == null) return \"\";\n StringBuilder sb = new StringBuilder();\n Node n = first;\n while (!n.next.equals(first)) {\n sb.append(n.p.toString() + \"\\n\");\n n = n.next;\n }\n sb.append(n.p.toString() + \"\\n\");\n return sb.toString();\n }", "public static void main(String[]args){\n\tArrayList<Integer> testMethods = new ArrayList<Integer>();\n\ttestMethods.add(new Integer(21536));\n\ttestMethods.add(new Integer(221536247));\n\ttestMethods.add(new Integer(2));\n\ttestMethods.add(new Integer(3));\n\ttestMethods.add(new Integer(5));\n\ttestMethods.add(new Integer(5));\n collapseDuplicates(testMethods);\n\trandomize(testMethods);\n\tSystem.out.println(testMethods.toString());\n }", "private void printResult()\n\t{\n\t\t java.util.Iterator<Entry<String, Guest>> it = guestMapList.entrySet().iterator();\n while (it.hasNext()) {\n Map.Entry pair = (Map.Entry)it.next();\n Guest guest = (Guest) pair.getValue();\n if(guest.isInvited())\n \t \tSystem.out.println(\"guest \"+guest.getName()+\" should invited!!\");\n it.remove(); // avoids a ConcurrentModificationException\n }\n\t}", "private void showFinalResults(){\r\n\r\n System.out.println(\"Player\\t\\t:\\t\\tPoints\");\r\n for(Player player : this.sortedPlayers){\r\n System.out.println(player.toString());\r\n }\r\n System.out.println();\r\n }", "public void print_metrics(){\n\t\tHashMap<Integer, HashSet<Integer>> pairs=return_pairs();\n\t\tint total=gold.data.getTuples().size();\n\t\ttotal=total*(total-1)/2;\n\t\tSystem.out.println(\"Reduction Ratio is: \"+(1.0-(double) countHashMap(pairs)/total));\n\t\tint count=0;\n\t\tfor(int i:pairs.keySet())\n\t\t\tfor(int j:pairs.get(i))\n\t\t\tif(goldContains(i,j))\n\t\t\t\tcount++;\n\t\tSystem.out.println(\"Pairs Completeness is: \"+(double) count/gold.num_dups);\n\t}", "void reportResults()\n {\n if (primes.isEmpty())\n throw new IllegalArgumentException();\n System.out.println(\"Primes up to \" + lastComp + \" are as follows:\");\n String results = \"\";\n int count = 0;\n Iterator<Integer> it = primes.iterator();\n while(it.hasNext())\n {\n results += \"\" + it.next() + \" \";\n count++;\n if(count % 12 == 0)\n results += \"\\n\";\n }\n System.out.println(results);\n }", "@Override\r\n\tpublic String toString(){\r\n\t\tString output = \"[ \";\r\n\t\tIterator<Object> it = iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tObject n = it.next();\r\n\t\t\toutput += n + \" \"; \r\n\t\t}\r\n\t\toutput += \"]\";\r\n\t\treturn output;\r\n\t}", "public void ShowAllRep() {\n IntRepList.OpNode current = this.iRepBetter.head;\n while (null != current) {\n this.ShowRep(current.opArray);\n current = current.next;\n }\n }", "default void print() {\r\n\t\tGenerator.getInstance().getLogger().debug(\"Operation matrix:\\r\");\r\n\t\tString ans = \" operation \";\r\n\t\tfor (double i = 0; i < this.getOperationMap().keySet().size(); i++) {\r\n\t\t\tfinal Element element1 = this.get(i);\r\n\t\t\tans += element1 + \" \";\r\n\t\t}\r\n\t\tLogManager.getLogger(FiniteSemiGroup.class).debug(ans);\r\n\t\tfor (double i = 0; i < this.getOperationMap().keySet().size(); i++) {\r\n\t\t\tfinal Element element1 = this.get(i);\r\n\t\t\tans = element1 + \" \";\r\n\t\t\tfor (double j = 0; j < this.getOperationMap().keySet().size(); j++) {\r\n\t\t\t\tfinal Element element2 = this.get(j);\r\n\t\t\t\tans += \" \" + this.getOperationMap().get(element1).get(element2) + \" \";\r\n\t\t\t}\r\n\t\t\tLogManager.getLogger(FiniteSemiGroup.class).debug(ans);\r\n\t\t}\r\n\t}", "void printAssociations(HashMap<BitSet, Integer> allAssociations){\n try{\n boolean firstLine = true;\n FileWriter fw = new FileWriter(this.outputFilePath);\n \n for(Map.Entry<BitSet, Integer> entry : allAssociations.entrySet()){\n BitSet bs = entry.getKey();\n if(firstLine)\n firstLine = false;\n else\n fw.write(\"\\n\");\n \n for(int i=0; i<bs.length() ; i++){\n if(bs.get(i))\n fw.write(intToStrItem.get(frequentItemListSetLenOne.get(i).getKey())+\" \");\n }\n\n fw.write(\"(\" + entry.getValue() +\")\");\n }\n \n fw.close();\n }\n catch(Exception e){\n e.printStackTrace();\n }\n }", "private void printCommonList(String type, List<Entry<String, Integer>> list) {\r\n System.out.println(type + \": \");\r\n if (list.isEmpty()) {\r\n System.out.println(\"Nothing common found.\");\r\n } else {\r\n list.stream().forEach((entry) -> {\r\n System.out.println(entry.getKey() + \" - \" + entry.getValue());\r\n });\r\n }\r\n System.out.println();\r\n }", "public void print() {\n\t\tint i = 1;\n\t\tfor (String s: g.keySet()) {\n\t\t\tSystem.out.print(\"Element: \" + i++ + \" \" + s + \" --> \");\n\t\t\tfor (String k: g.get(s)) {\n\t\t\t\tSystem.out.print(k + \" ### \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void printNonRec() {\n if (root == null) System.out.println(\"The set is empty\");\n else {\n System.out.print(\"The set elements are: \");\n MyStack s = new MyStack();\n TNode t = root;\n\n while (t != null || !s.isEmpty()) {\n while (t != null) {\n s.push(t);\n t = t.left;\n }\n t = s.pop();\n System.out.print(\" \" + t.element + \", \");\n t = t.right;\n }\n System.out.print(\"\\n\");\n }\n }", "private void displayAll()\n {\n for (int i = 0; i < cache.size(); ++i)\n {\n Record r = cache.get(i); \n System.out.println(r.key() + \" \" + r.value());\n }\n }", "public String printSortedResult() {\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tsb.append(printStartNumberAndName() + \"; \");\n\t\tsb.append(printInfo());\n\t\t\n\t\tsb.append(printTotalTime());\n\t\t\n\t\tsb.append(errorHandler.print());\n\t\t\n\t\treturn sb.toString();\n\t}", "public static void main(String[] args) {\n\t\tLinkedHashSet<String> set=new LinkedHashSet<>();\n\t\tset.add(\"name\");\n\t\tset.add(\"surname\");\n\t\tset.add(\"address\");\n\t\tset.add(\"name\");\n\t\tset.add(\"surname\");\n\t\tset.add(\"address\");\n\t\t\n\t\tfor(String s:set)\n\t\t{\n\t\t\tSystem.out.println(s);\n\t\t}\n\t\n\n\t}", "public static void main(String[] args) {\n\t\tint r = findDuplicate(new int[]{1,1,3});\n\t\tSystem.out.println(r);\n\t}", "public static void main(String[] args) {\n\t\tint a[]= {2,3,4,5,6,5,4,3,2};\r\n\t\tfor(int i:a) {\r\n \t\t\tSystem.out.print(\" \"+i);\r\n \t\t}\r\n \t\tSystem.out.println();\r\n \t\tSystem.out.print(\"Missing number \");\r\n \t\tint single=a[0];\r\n \t\tfor(int i=1;i<a.length;i++) {\r\n \t\t single=single^a[i];\r\n \t\t}\r\n \t\tSystem.out.print(single);\r\n \t\t\r\n \r\n\t}", "public static void printAll() {\n\t\tint i=0;\n\t\twhile(i%2==0) {\n\t\t\ti+=2;\n\t\t\tSystem.out.print(i+\" \");\n\t\t\tif(i==100) break;\n\t\t}\n\t}", "public String toString () {\n\t\tString resumen = \"\";\n\t\tfor (int i = 0; i < this.size(); i++) {\n\t\t\tresumen = resumen + this.get(i).toString();\n\t\t}\n\t\treturn resumen;\n\t}", "public void printAll() {\n\t\tfor(int i = 0; i<r.length; i++)\n\t\t\tprintReg(i);\n\t\tprintReg(\"hi\");\n\t\tprintReg(\"lo\");\n\t\tprintReg(\"pc\");\n\t}", "private static void LogOverall() throws IOException {\n\t\tBufferedWriter out;\n\t\tIterator entries = allPatternOne.entrySet().iterator();\n\t\t\n\t\t out = new BufferedWriter(new FileWriter(singlePatternPath+\"allPatternOne.txt\"));\n\t\t int count1 = 0;\n\t\t entries = allPatternOne.entrySet().iterator();\n\t\t\twhile (entries.hasNext()) {\n\t\t\t Map.Entry entry = (Map.Entry) entries.next();\n\t\t\t Integer value = (Integer)entry.getKey();\n\t\t\t HashSet<SequencePair> set = (HashSet<SequencePair>) entry.getValue();\n\t\t\t count1+=set.size();\n\t\t\t out.write(\"!size \" + value + \" \" + set.size() + \"\\n\");\n\t\t\t Iterator itr = set.iterator();\n\t\t\t while(itr.hasNext()) {\n\t\t\t \tSequencePair current = (SequencePair) itr.next();\n\t\t\t \t//System.out.println(\"[\" + current.firstSeq +\":\"+current.secondSeq +\"]\");\n\t\t\t out.write(\"[\" + current.firstSeq +\":\"+current.secondSeq +\"]\"+\"\\n\");\n\t\t\t }\n\t\t\t}\n\t\t\tout.write(\"! total \" + count1);\n\t\t\t//System.out.println(count2);\n\t\t\tif(out!=null)\n\t\t\t\tout.close();\n\t\t\n\t\n\t\t\n\t\t\n\t out = new BufferedWriter(new FileWriter(newSinglePatternPath+\"allPatternTwo.txt\"));\n\t int count2 = 0;\n\t entries = allPatternTwo.entrySet().iterator();\n\t\twhile (entries.hasNext()) {\n\t\t Map.Entry entry = (Map.Entry) entries.next();\n\t\t Integer value = (Integer)entry.getKey();\n\t\t HashSet<SequencePair> set = (HashSet<SequencePair>) entry.getValue();\n\t\t count2+=set.size();\n\t\t out.write(\"!size \" + value + \" \" + set.size() + \"\\n\");\n\t\t Iterator itr = set.iterator();\n\t\t while(itr.hasNext()) {\n\t\t \tSequencePair current = (SequencePair) itr.next();\n\t\t \t\n\t\t out.write(\"[\" + current.firstSeq +\":\"+current.secondSeq +\"]\"+\"\\n\");\n\t\t }\n\t\t}\n\t\tout.write(\"! total \" + count2);\n\t\t//System.out.println(count2);\n\t\tif(out!=null)\n\t\t\tout.close();\n\t\t\n\t\t\n\t}", "private void loopThroughTokens(PrintWriter out) {\n\n for (String element : distinctTokens){\n out.println(element);\n\n }\n }", "public void PrintResult() {\n try {\n res.beforeFirst();\n int columnsNumber = res.getMetaData().getColumnCount();\n while (res.next()) {\n for (int i = 1; i <= columnsNumber; i++) {\n if (i > 1) System.out.print(\", \");\n Object columnValue = res.getObject(i);\n System.out.print(res.getMetaData().getColumnName(i) + \" \" + columnValue);\n }\n System.out.println();\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }" ]
[ "0.6816762", "0.62523186", "0.6202981", "0.6198502", "0.6143679", "0.6093933", "0.60280854", "0.60063213", "0.6002707", "0.59614253", "0.59590226", "0.5910345", "0.5868154", "0.5817361", "0.5770535", "0.5763108", "0.57612514", "0.57511395", "0.57430786", "0.5732327", "0.57254136", "0.57110727", "0.57098925", "0.570135", "0.5693355", "0.5679535", "0.5674528", "0.5661758", "0.56455815", "0.5632922", "0.5627742", "0.56210124", "0.5608337", "0.55988336", "0.5598074", "0.55819726", "0.5573492", "0.5567286", "0.5555794", "0.5548359", "0.5541795", "0.55400145", "0.5539322", "0.5533807", "0.55321854", "0.5529962", "0.5528601", "0.5524249", "0.552405", "0.55122554", "0.551056", "0.5498398", "0.5493176", "0.5490141", "0.5486892", "0.5484471", "0.5482172", "0.54758847", "0.54715705", "0.546515", "0.5461837", "0.5460635", "0.5443311", "0.544289", "0.544237", "0.54354614", "0.5432015", "0.5428635", "0.5421953", "0.54144907", "0.54139346", "0.5413116", "0.5411242", "0.5411088", "0.5410881", "0.5408029", "0.54074025", "0.54060686", "0.5390994", "0.53862107", "0.5367847", "0.53662926", "0.53655344", "0.53600675", "0.53594524", "0.53545797", "0.53482616", "0.53372633", "0.5333347", "0.5325522", "0.5324186", "0.53216016", "0.53184646", "0.53162545", "0.531559", "0.53148127", "0.53110886", "0.53047466", "0.5303599", "0.52950346", "0.52876353" ]
0.0
-1
Test of collectIdentifierValues method, of class CommandLineArgumentParser.
@Test public void testCollectIdentifierValues() throws Exception{ System.out.println("collectIdentifierValues"); char u = 'u'; char h ='h'; char k ='k'; System.out.println("test1"); String [] instanceInput = {"1u","chat.txt","user1"}; CommandLineArgumentParser instance = new CommandLineArgumentParser(instanceInput); String [] expResult = {"user1"}; String []result = instance.collectIdentifierValues(u,instanceInput); System.out.println(Arrays.toString(result)+" expected: "+Arrays.toString(expResult)); System.out.println("test2"); String [] instanceInput2 = {"2u","chat.txt","user1","user2"}; CommandLineArgumentParser instance2 = new CommandLineArgumentParser(instanceInput2); String [] expResult2 = {"user1","user2"}; String []result2 = instance2.collectIdentifierValues(u,instanceInput2); System.out.println(Arrays.toString(result2)+" expected: "+Arrays.toString(expResult2)); System.out.println("test3"); String [] instanceInput3 = {"1k3u","chat.txt","keyWord","user1","user2","user3"}; CommandLineArgumentParser instance3 = new CommandLineArgumentParser(instanceInput3); String [] expResult3 = {"user1","user2","user3"}; String []result3 = instance3.collectIdentifierValues(u,instanceInput3); System.out.println(Arrays.toString(result3)+" expected: "+Arrays.toString(expResult3)); System.out.println("test4"); String [] instanceInput4 = {"2k1u1h","chat.txt","keyWord1","keyWord1","user1","hiddenWord"}; CommandLineArgumentParser instance4 = new CommandLineArgumentParser(instanceInput4); String [] expResult4 = {"user1"}; String [] result4 = instance4.collectIdentifierValues(u,instanceInput4); System.out.println(Arrays.toString(result4)+" expected: "+Arrays.toString(expResult4)); System.out.println("test5"); String [] instanceInput5 = {"2h3k","chat.txt","hiddenWord1","hiddenWord2","keyWord","keyWord","keyword3"}; CommandLineArgumentParser instance5 = new CommandLineArgumentParser(instanceInput5); String [] expResult5 = {"hiddenWord1","hiddenWord2"}; String [] result5 = instance5.collectIdentifierValues(h,instanceInput5); System.out.println(Arrays.toString(result5)+" expected: "+Arrays.toString(expResult5)); System.out.println("test6"); String [] instanceInput6 = {"3k2h","chat.txt","keyWord1","keyWord2","keyWord3","hiddenWord1","hiddenWord2"}; CommandLineArgumentParser instance6 = new CommandLineArgumentParser(instanceInput6); String [] expResult6 = {"keyWord1","keyWord2","keyWord3"}; String [] result6 = instance6.collectIdentifierValues(k,instanceInput6); System.out.println(Arrays.toString(result6)+" expected: "+Arrays.toString(expResult6)); System.out.println("test7"); String [] instanceInput7 = {"1u1k1h","chat.txt","username1","keyWord1","hiddenWord1"}; CommandLineArgumentParser instance7 = new CommandLineArgumentParser(instanceInput7); String [] expResult7 = {"keyWord1"}; String [] result7 = instance7.collectIdentifierValues(k,instanceInput7); System.out.println(Arrays.toString(result7)+" expected: "+Arrays.toString(expResult7)); System.out.println("test8"); String [] instanceInput8 = {"1u","chat.txt","mike"}; CommandLineArgumentParser instance8 = new CommandLineArgumentParser(instanceInput8); String [] expResult8 = {"mike"}; String [] result8 = instance8.collectIdentifierValues(u,instanceInput8); System.out.println(Arrays.toString(result8)+" expected: "+Arrays.toString(expResult8)); assertEquals(Arrays.toString(expResult), Arrays.toString(result)); assertEquals(Arrays.toString(expResult2), Arrays.toString(result2)); assertEquals(Arrays.toString(expResult3), Arrays.toString(result3)); assertEquals(Arrays.toString(expResult4), Arrays.toString(result4)); assertEquals(Arrays.toString(expResult5), Arrays.toString(result5)); assertEquals(Arrays.toString(expResult6), Arrays.toString(result6)); assertEquals(Arrays.toString(expResult7), Arrays.toString(result7)); assertEquals(Arrays.toString(expResult8), Arrays.toString(result8)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n public void testTallyIdentifiers() throws Exception {\r\n System.out.println(\"tallyIdentifiers\");\r\n String identifiers = \"1k2h3u\";\r\n String [] args= {\"1k2h3u\",\"test\"};\r\n CommandLineArgumentParser instance = new CommandLineArgumentParser(args);\r\n int expResult = 6;\r\n int result = instance.tallyIdentifiers(identifiers);\r\n assertEquals(expResult, result);\r\n }", "@Test(expectedExceptions=InvalidArgumentValueException.class)\n public void argumentValidationTest() {\n String[] commandLine = new String[] {\"--value\",\"521\"};\n\n parsingEngine.addArgumentSource( ValidatingArgProvider.class );\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n\n ValidatingArgProvider argProvider = new ValidatingArgProvider();\n parsingEngine.loadArgumentsIntoObject( argProvider );\n\n Assert.assertEquals(argProvider.value.intValue(), 521, \"Argument is not correctly initialized\");\n\n // Try some invalid arguments\n commandLine = new String[] {\"--value\",\"foo\"};\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n }", "public void testGenomeIds() {\n assertThat(CoreUtilities.genomeOf(\"fig|12345.6.peg.10\"), equalTo(\"12345.6\"));\n assertThat(CoreUtilities.genomeOf(\"fig|23456.789.202.10\"), equalTo(\"23456.789\"));\n assertThat(CoreUtilities.genomeOf(\"patric|123.45.peg.10\"), equalTo(null));\n }", "private static void validateCommandLineArguments(AutomationContext context, String extendedCommandLineArgs[])\r\n\t{\r\n\t\t//fetch the argument configuration types required\r\n\t\tCollection<IPlugin<?, ?>> plugins = PluginManager.getInstance().getPlugins();\r\n \t\tList<Class<?>> argBeanTypes = plugins.stream()\r\n\t\t\t\t.map(config -> config.getArgumentBeanType())\r\n\t\t\t\t.filter(type -> (type != null))\r\n\t\t\t\t.collect(Collectors.toList());\r\n\t\t\r\n\t\targBeanTypes = new ArrayList<>(argBeanTypes);\r\n\t\t\r\n\t\t//Add basic arguments type, so that on error its properties are not skipped in error message\r\n\t\targBeanTypes.add(AutoxCliArguments.class);\r\n\r\n\t\t//if any type is required creation command line options and parse command line arguments\r\n\t\tCommandLineOptions commandLineOptions = OptionsFactory.buildCommandLineOptions(argBeanTypes.toArray(new Class<?>[0]));\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tcommandLineOptions.parseBeans(extendedCommandLineArgs);\r\n\t\t} catch(MissingArgumentException e)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"Error: \" + e.getMessage());\r\n\t\t\tSystem.err.println(commandLineOptions.fetchHelpInfo(COMMAND_SYNTAX));\r\n\t\t\tSystem.exit(-1);\r\n\t\t} catch(Exception ex)\r\n\t\t{\r\n\t\t\tex.printStackTrace();\r\n\t\t\tSystem.err.println(commandLineOptions.fetchHelpInfo(COMMAND_SYNTAX));\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "identifierList getIdentifierList();", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n setInput(invocation,\"ui4\", \"ID\", iD == null ? null : iD.getValue());\n }", "@Override\r\n public String[] extractCommandLineValues(String inputLine) {\r\n String strippedLine = inputLine.strip();\r\n String[] tokens = strippedLine.split(\" \", -1);\r\n int flagIndex = findFlagIndex(tokens);\r\n\r\n String[] argumentTokens = Arrays.copyOfRange(tokens, 1, flagIndex);\r\n String[] flagTokens = Arrays.copyOfRange(tokens, flagIndex + 1, tokens.length);\r\n\r\n String argumentValue = String.join(\" \", argumentTokens);\r\n String flagValue = String.join(\" \", flagTokens);\r\n\r\n return new String[] {argumentValue, flagValue};\r\n }", "@ParameterizedTest(name = \"{index} => oid = {0}\")\n\t//@MethodSource(\"sp800_73_4_DiscoveryObjectTestProvider\")\n @ArgumentsSource(ParameterizedArgumentsProvider.class)\n\t@DisplayName(\"SP800-73-4.55 test\")\n\tvoid sp800_73_4_Test_55 (String oid, TestReporter reporter) {\n\t\t\t\t\n\t\tPIVDataObject o = AtomHelper.getDataObject(oid);\n\t\t\n\t\tList<BerTag> tagList = o.getTagList();\n\t\t\n\t\tBerTag cardAppAIDTag = new BerTag(TagConstants.PIV_CARD_APPLICATION_AID_TAG);\n\t\t\n\t\tint tagIndex = tagList.indexOf(cardAppAIDTag);\n\t\t\n\t\t//Confirm (0x4F, 0x5F2F) tag order\n\t\tassertTrue(Arrays.equals(tagList.get(tagIndex).bytes,TagConstants.PIV_CARD_APPLICATION_AID_TAG));\n\t\tassertTrue(Arrays.equals(tagList.get(tagIndex+1).bytes,TagConstants.PIN_USAGE_POLICY_TAG));\n\t}", "@DisplayName(\"SP800-73-4.41 test\")\n\t@ParameterizedTest(name = \"{index} => oid = {0}\")\n\t//@MethodSource(\"sp800_73_4_DiscoveryObjectTestProvider\")\n @ArgumentsSource(ParameterizedArgumentsProvider.class)\n\tvoid sp800_73_4_Test_41(String oid, TestReporter reporter) {\n\t\t\n\t\tPIVDataObject o = AtomHelper.getDataObject(oid);\n\t\t\n\t\tList<BerTag> tagList = o.getTagList();\n\t\t\n\t\tBerTag pinUsagePolicyTag = new BerTag(TagConstants.PIN_USAGE_POLICY_TAG);\n\n\t\tassertTrue(tagList.contains(pinUsagePolicyTag));\t\t\t\n\t}", "@DisplayName(\"SP800-73-4.38 test\")\n\t@ParameterizedTest(name = \"{index} => oid = {0}\")\n\t//@MethodSource(\"sp800_73_4_DiscoveryObjectTestProvider\")\n @ArgumentsSource(ParameterizedArgumentsProvider.class)\n\tvoid sp800_73_4_Test_38(String oid, TestReporter reporter) {\t\t\n\t\ttry {\n\t\t\tPIVDataObject o = AtomHelper.getDataObject(oid);\t\n\t\t\tif (!o.inBounds(oid)) {\n\t\t\t\tString errStr = (String.format(\"Tag in \" + o.getFriendlyName() + \" failed length check\"));\n\t\t\t\tException e = new Exception(errStr);\n\t\t\t\tthrow(e);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\ts_logger.info(e.getMessage());\n\t\t\tfail(e);\n\t\t}\n\t}", "@Test\n\tpublic void testValidatePromptIds() {\n\t\ttry {\n\t\t\tfor(String emptyValue : ParameterSets.getEmptyValues()) {\n\t\t\t\tAssert.assertNull(SurveyResponseValidators.validatePromptIds(emptyValue));\n\t\t\t}\n\t\t\t\n\t\t\tfor(String simpleValidList : ParameterSets.getSimpleValidLists()) {\n\t\t\t\ttry {\n\t\t\t\t\tSurveyResponseValidators.validatePromptIds(simpleValidList);\n\t\t\t\t}\n\t\t\t\tcatch(ValidationException e) {\n\t\t\t\t\tfail(\"A valid list failed validation.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(ValidationException e) {\n\t\t\tfail(\"A validation exception was thrown: \" + e.getMessage());\n\t\t}\n\t}", "@DisplayName(\"SP800-73-4.40 test\")\n\t@ParameterizedTest(name = \"{index} => oid = {0}\")\n\t//@MethodSource(\"sp800_73_4_DiscoveryObjectTestProvider\")\n @ArgumentsSource(ParameterizedArgumentsProvider.class)\n\tvoid sp800_73_4_Test_40(String oid, TestReporter reporter) {\n\t\t\n\t\tPIVDataObject o = AtomHelper.getDataObject(oid);\n\t\t\n\t\tList<BerTag> tagList = o.getTagList();\n\t\tBerTag cardAppAIDTag = new BerTag(TagConstants.PIV_CARD_APPLICATION_AID_TAG);\n\n\t\t//Confirm Tag 0x4F is present\n\t\tassertTrue(tagList.contains(cardAppAIDTag));\t\n\t}", "@Test\r\n public void testCheckInput() throws Exception {\r\n System.out.println(\"checkInput\");\r\n System.out.println(\"test1\");\r\n String[] arguments = {\"1k2h3u\",\"test.txt\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\"};\r\n CommandLineArgumentParser instance =new CommandLineArgumentParser(arguments);\r\n String expResult = \"correct\";\r\n String result = instance.checkInput(arguments);\r\n assertEquals(expResult, result);\r\n \r\n System.out.println(\"test 2\");\r\n String[] arguments2 = {\"1k\",\"test.txt\",\"1\"};\r\n String expResult2 = \"correct\";\r\n String result2 = instance.checkInput(arguments2);\r\n assertEquals(expResult2, result2);\r\n \r\n System.out.println(\"test 3\");\r\n String[] arguments3 = {\"chat.txt\"};\r\n String expResult3 = \"correct\";\r\n String result3 = instance.checkInput(arguments3);\r\n assertEquals(expResult3, result3);\r\n \r\n System.out.println(\"test 4\");\r\n String[] arguments4 = {\"1k2h3u\",\"test.txt\",\"1\",\"2\",\"3\",\"4\",\"5\"};\r\n String expResult4 = \"Incorrect number of arguments\";\r\n String result4 = instance.checkInput(arguments4);\r\n assertEquals(expResult4, result4);\r\n \r\n System.out.println(\"test 5\");\r\n String[] arguments5 = {};\r\n String expResult5 = \"Need at least one argument with input file path\";\r\n String result5 = instance.checkInput(arguments5);\r\n assertEquals(expResult5, result5);\r\n }", "private void parseArgs(String[] object) throws IllegalArgumentException {\n Object object2;\n int n;\n int n2;\n int n3 = 0;\n boolean bl = false;\n boolean bl2 = true;\n block6 : do {\n int n4 = ((Object)object).length;\n n2 = 0;\n n = ++n3;\n if (n3 >= n4) break;\n object2 = object[n3];\n if (((String)object2).equals(\"--\")) {\n n = n3 + 1;\n break;\n }\n if (((String)object2).startsWith(\"--setuid=\")) {\n if (this.mUidSpecified) throw new IllegalArgumentException(\"Duplicate arg specified\");\n this.mUidSpecified = true;\n this.mUid = Integer.parseInt(((String)object2).substring(((String)object2).indexOf(61) + 1));\n continue;\n }\n if (((String)object2).startsWith(\"--setgid=\")) {\n if (this.mGidSpecified) throw new IllegalArgumentException(\"Duplicate arg specified\");\n this.mGidSpecified = true;\n this.mGid = Integer.parseInt(((String)object2).substring(((String)object2).indexOf(61) + 1));\n continue;\n }\n if (((String)object2).startsWith(\"--target-sdk-version=\")) {\n if (this.mTargetSdkVersionSpecified) throw new IllegalArgumentException(\"Duplicate target-sdk-version specified\");\n this.mTargetSdkVersionSpecified = true;\n this.mTargetSdkVersion = Integer.parseInt(((String)object2).substring(((String)object2).indexOf(61) + 1));\n continue;\n }\n if (((String)object2).equals(\"--runtime-args\")) {\n bl = true;\n continue;\n }\n if (((String)object2).startsWith(\"--runtime-flags=\")) {\n this.mRuntimeFlags = Integer.parseInt(((String)object2).substring(((String)object2).indexOf(61) + 1));\n continue;\n }\n if (((String)object2).startsWith(\"--seinfo=\")) {\n if (this.mSeInfoSpecified) throw new IllegalArgumentException(\"Duplicate arg specified\");\n this.mSeInfoSpecified = true;\n this.mSeInfo = ((String)object2).substring(((String)object2).indexOf(61) + 1);\n continue;\n }\n if (((String)object2).startsWith(\"--capabilities=\")) {\n if (this.mCapabilitiesSpecified) throw new IllegalArgumentException(\"Duplicate arg specified\");\n this.mCapabilitiesSpecified = true;\n if (((String[])(object2 = ((String)object2).substring(((String)object2).indexOf(61) + 1).split(\",\", 2))).length == 1) {\n this.mPermittedCapabilities = this.mEffectiveCapabilities = Long.decode((String)object2[0]).longValue();\n continue;\n }\n this.mPermittedCapabilities = Long.decode((String)object2[0]);\n this.mEffectiveCapabilities = Long.decode((String)object2[1]);\n continue;\n }\n if (((String)object2).startsWith(\"--rlimit=\")) {\n String[] arrstring = ((String)object2).substring(((String)object2).indexOf(61) + 1).split(\",\");\n if (arrstring.length != 3) throw new IllegalArgumentException(\"--rlimit= should have 3 comma-delimited ints\");\n object2 = new int[arrstring.length];\n for (n = 0; n < arrstring.length; ++n) {\n object2[n] = Integer.parseInt(arrstring[n]);\n }\n if (this.mRLimits == null) {\n this.mRLimits = new ArrayList();\n }\n this.mRLimits.add((int[])object2);\n continue;\n }\n if (((String)object2).startsWith(\"--setgroups=\")) {\n if (this.mGids != null) throw new IllegalArgumentException(\"Duplicate arg specified\");\n object2 = ((String)object2).substring(((String)object2).indexOf(61) + 1).split(\",\");\n this.mGids = new int[((String[])object2).length];\n n = ((Object[])object2).length - 1;\n do {\n if (n < 0) continue block6;\n this.mGids[n] = Integer.parseInt((String)object2[n]);\n --n;\n } while (true);\n }\n if (((String)object2).equals(\"--invoke-with\")) {\n if (this.mInvokeWith != null) throw new IllegalArgumentException(\"Duplicate arg specified\");\n ++n3;\n try {\n this.mInvokeWith = object[n3];\n }\n catch (IndexOutOfBoundsException indexOutOfBoundsException) {\n throw new IllegalArgumentException(\"--invoke-with requires argument\");\n }\n }\n if (((String)object2).startsWith(\"--nice-name=\")) {\n if (this.mNiceName != null) throw new IllegalArgumentException(\"Duplicate arg specified\");\n this.mNiceName = ((String)object2).substring(((String)object2).indexOf(61) + 1);\n continue;\n }\n if (((String)object2).equals(\"--mount-external-default\")) {\n this.mMountExternal = 1;\n continue;\n }\n if (((String)object2).equals(\"--mount-external-read\")) {\n this.mMountExternal = 2;\n continue;\n }\n if (((String)object2).equals(\"--mount-external-write\")) {\n this.mMountExternal = 3;\n continue;\n }\n if (((String)object2).equals(\"--mount-external-full\")) {\n this.mMountExternal = 6;\n continue;\n }\n if (((String)object2).equals(\"--mount-external-installer\")) {\n this.mMountExternal = 5;\n continue;\n }\n if (((String)object2).equals(\"--mount-external-legacy\")) {\n this.mMountExternal = 4;\n continue;\n }\n if (((String)object2).equals(\"--query-abi-list\")) {\n this.mAbiListQuery = true;\n continue;\n }\n if (((String)object2).equals(\"--get-pid\")) {\n this.mPidQuery = true;\n continue;\n }\n if (((String)object2).startsWith(\"--instruction-set=\")) {\n this.mInstructionSet = ((String)object2).substring(((String)object2).indexOf(61) + 1);\n continue;\n }\n if (((String)object2).startsWith(\"--app-data-dir=\")) {\n this.mAppDataDir = ((String)object2).substring(((String)object2).indexOf(61) + 1);\n continue;\n }\n if (((String)object2).equals(\"--preload-app\")) {\n this.mPreloadApp = object[++n3];\n continue;\n }\n if (((String)object2).equals(\"--preload-package\")) {\n this.mPreloadPackage = object[++n3];\n this.mPreloadPackageLibs = object[++n3];\n this.mPreloadPackageLibFileName = object[++n3];\n this.mPreloadPackageCacheKey = object[++n3];\n continue;\n }\n if (((String)object2).equals(\"--preload-default\")) {\n this.mPreloadDefault = true;\n bl2 = false;\n continue;\n }\n if (((String)object2).equals(\"--start-child-zygote\")) {\n this.mStartChildZygote = true;\n continue;\n }\n if (((String)object2).equals(\"--set-api-blacklist-exemptions\")) {\n this.mApiBlacklistExemptions = (String[])Arrays.copyOfRange(object, n3 + 1, ((Object)object).length);\n n3 = ((Object)object).length;\n bl2 = false;\n continue;\n }\n if (((String)object2).startsWith(\"--hidden-api-log-sampling-rate=\")) {\n object2 = ((String)object2).substring(((String)object2).indexOf(61) + 1);\n try {\n this.mHiddenApiAccessLogSampleRate = Integer.parseInt((String)object2);\n bl2 = false;\n }\n catch (NumberFormatException numberFormatException) {\n object = new StringBuilder();\n ((StringBuilder)object).append(\"Invalid log sampling rate: \");\n ((StringBuilder)object).append((String)object2);\n throw new IllegalArgumentException(((StringBuilder)object).toString(), numberFormatException);\n }\n }\n if (((String)object2).startsWith(\"--hidden-api-statslog-sampling-rate=\")) {\n object2 = ((String)object2).substring(((String)object2).indexOf(61) + 1);\n try {\n this.mHiddenApiAccessStatslogSampleRate = Integer.parseInt((String)object2);\n bl2 = false;\n }\n catch (NumberFormatException numberFormatException) {\n object = new StringBuilder();\n ((StringBuilder)object).append(\"Invalid statslog sampling rate: \");\n ((StringBuilder)object).append((String)object2);\n throw new IllegalArgumentException(((StringBuilder)object).toString(), numberFormatException);\n }\n }\n if (((String)object2).startsWith(\"--package-name=\")) {\n if (this.mPackageName != null) throw new IllegalArgumentException(\"Duplicate arg specified\");\n this.mPackageName = ((String)object2).substring(((String)object2).indexOf(61) + 1);\n continue;\n }\n n = n3;\n if (!((String)object2).startsWith(\"--usap-pool-enabled=\")) break;\n this.mUsapPoolStatusSpecified = true;\n this.mUsapPoolEnabled = Boolean.parseBoolean(((String)object2).substring(((String)object2).indexOf(61) + 1));\n bl2 = false;\n } while (true);\n if (!this.mAbiListQuery && !this.mPidQuery) {\n if (this.mPreloadPackage != null) {\n if (((Object)object).length - n > 0) throw new IllegalArgumentException(\"Unexpected arguments after --preload-package.\");\n } else if (this.mPreloadApp != null) {\n if (((Object)object).length - n > 0) throw new IllegalArgumentException(\"Unexpected arguments after --preload-app.\");\n } else if (bl2) {\n if (!bl) {\n object2 = new StringBuilder();\n ((StringBuilder)object2).append(\"Unexpected argument : \");\n ((StringBuilder)object2).append((String)object[n]);\n throw new IllegalArgumentException(((StringBuilder)object2).toString());\n }\n this.mRemainingArgs = new String[((Object)object).length - n];\n object2 = this.mRemainingArgs;\n System.arraycopy(object, n, object2, 0, ((String[])object2).length);\n }\n } else if (((Object)object).length - n > 0) throw new IllegalArgumentException(\"Unexpected arguments after --query-abi-list.\");\n if (!this.mStartChildZygote) return;\n bl = false;\n object = this.mRemainingArgs;\n n = ((Object)object).length;\n n3 = n2;\n do {\n bl2 = bl;\n if (n3 >= n) break;\n if (((String)object[n3]).startsWith(\"--zygote-socket=\")) {\n bl2 = true;\n break;\n }\n ++n3;\n } while (true);\n if (!bl2) throw new IllegalArgumentException(\"--start-child-zygote specified without --zygote-socket=\");\n }", "@Override\n protected void processShellCommandLine() throws IllegalArgumentException {\n final Map<String, String> argValues = getCommandLineArguments();\n logger.debug(\"processShellCommandLine: {}\", argValues);\n\n // note: open file is NOT done in background ...\n final String fileArgument = argValues.get(CommandLineUtils.CLI_OPEN_KEY);\n\n // required open file check:\n if (fileArgument == null) {\n throw new IllegalArgumentException(\"Missing file argument !\");\n }\n final File fileOpen = new File(fileArgument);\n\n // same checks than LoadOIDataCollectionAction:\n if (!fileOpen.exists() || !fileOpen.isFile()) {\n throw new IllegalArgumentException(\"Could not load the file: \" + fileOpen.getAbsolutePath());\n }\n\n logger.debug(\"processShellCommandLine: done.\");\n }", "@Test(expectedExceptions=ArgumentsAreMutuallyExclusiveException.class)\n public void mutuallyExclusiveArgumentsTest() {\n String[] commandLine = new String[] {\"--foo\",\"5\"};\n\n parsingEngine.addArgumentSource( MutuallyExclusiveArgProvider.class );\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n\n MutuallyExclusiveArgProvider argProvider = new MutuallyExclusiveArgProvider();\n parsingEngine.loadArgumentsIntoObject( argProvider );\n\n Assert.assertEquals(argProvider.foo.intValue(), 5, \"Argument is not correctly initialized\");\n\n // But when foo and bar come together, danger!\n commandLine = new String[] {\"--foo\",\"5\",\"--bar\",\"6\"};\n\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n }", "protected Identifier parseDatasetIdentifier( Element element, String xPathQuery )\n throws XMLParsingException,\n InvalidCapabilitiesException {\n\n Element identifierElement = (Element) XMLTools.getRequiredNode( element, xPathQuery, nsContext );\n\n String value = XMLTools.getStringValue( identifierElement ).trim();\n if ( \"\".equals( value ) ) {\n throw new InvalidCapabilitiesException( Messages.getMessage( \"WPVS_NO_VALID_IDENTIFIER\", \"dataset\" ) );\n }\n URI codeSpace = XMLTools.getNodeAsURI( identifierElement, \"@codeSpace\", nsContext, null );\n Identifier id = new Identifier( value, codeSpace );\n if ( datasetIdentifiers.contains( id.toString() ) ) {\n throw new InvalidCapabilitiesException( Messages.getMessage( \"WPVS_NO_UNIQUE_IDENTIFIER\",\n \"datasets\",\n id.toString() ) );\n\n }\n datasetIdentifiers.add( id.toString() );\n\n return id;\n }", "@SuppressWarnings(\"unused\")\n\tprivate static Stream<Arguments> sp800_73_4_DiscoveryObjectTestProvider() {\n\n\t\treturn Stream.of(Arguments.of(APDUConstants.DISCOVERY_OBJECT_OID));\n\n\t}", "boolean isSetIdentifier();", "Set<String> getIdentifiers();", "public Map<String, String> arguments() {\n if (this.arguments.isEmpty()) {\n for (final String argument : this.args) {\n final Matcher keys = KEY.matcher(argument);\n if (keys.find()) {\n final String identifier = keys.group(\"identifier\");\n final String value = keys.group(\"value\");\n if (!this.arguments.containsKey(identifier)) {\n this.arguments.put(identifier, value);\n } else {\n throw new IllegalArgumentException(\"duplicated keys\");\n }\n }\n }\n }\n return Collections.unmodifiableMap(this.arguments);\n }", "@Test\n\tpublic void testIdentifier() throws ParseException {\n\t\tIdentifier identifier = langParser(\"foo\").identifier();\n\t\tassertEquals(identifier.getName(), \"foo\");\n\t}", "@Test\r\n\tpublic void testTokenizeIdentifiers() {\r\n\r\n\t\t// Enter the code\r\n\r\n\t\tdriver.findElement(By.name(\"code[code]\"))\r\n\t\t\t\t.sendKeys(\"the_best_cat = \\\"Noogie Cat\\\"\\nputs \\\"The best cat is: \\\" + the_best_cat\");\r\n\r\n\t\t// Look for the \"Tokenize\" button and click\r\n\r\n\t\tdriver.findElements(By.name(\"commit\")).get(0).click();\r\n\r\n\t\t// Check that there is corresponding quantity of the word \":on_ident\"\r\n\r\n\t\ttry {\r\n\t\t\tWebElement code = driver.findElement(By.tagName(\"code\"));\r\n\t\t\tString res = code.getText();\r\n\t\t\tint count = 0;\r\n\t\t\tfor (int i = 0; i <= res.length() - 9; i++) {\r\n\t\t\t\tString sub = res.substring(i, i + 9);\r\n\t\t\t\tif (sub.equals(\":on_ident\"))\r\n\t\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t\tassertEquals(count, 3);\r\n\t\t} catch (NoSuchElementException nseex) {\r\n\t\t\tfail();\r\n\t\t}\r\n\t}", "@Test\n public void testArguments() {\n System.out.println(\"arguments\");\n assertThat(Arguments.valueOf(\"d\"), is(notNullValue()));\n assertThat(Arguments.valueOf(\"i\"), is(notNullValue()));\n assertThat(Arguments.valueOf(\"num\"), is(notNullValue()));\n }", "@Test\n\tpublic void testValidateSurveyResponseId() {\n\t\ttry {\n\t\t\tfor(String emptyValue : ParameterSets.getEmptyValues()) {\n\t\t\t\tAssert.assertNull(SurveyResponseValidators.validateSurveyResponseId(emptyValue));\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\tSurveyResponseValidators.validateSurveyResponseId(\"Invalid value.\");\n\t\t\t\tfail(\"The survey response ID was invalid.\");\n\t\t\t}\n\t\t\tcatch(ValidationException e) {\n\t\t\t\t// Passed.\n\t\t\t}\n\t\t\t\n\t\t\t// This may be any long value as it is simply a database ID.\n\t\t\tUUID uuid = UUID.randomUUID();\n\t\t\tAssert.assertEquals(uuid, SurveyResponseValidators.validateSurveyResponseId(uuid.toString()));\n\t\t}\n\t\tcatch(ValidationException e) {\n\t\t\tfail(\"A validation exception was thrown: \" + e.getMessage());\n\t\t}\n\t}", "@Test\n\tpublic void testValidateSurveyIds() {\n\t\ttry {\n\t\t\tfor(String emptyValue : ParameterSets.getEmptyValues()) {\n\t\t\t\tAssert.assertNull(SurveyResponseValidators.validateSurveyIds(emptyValue));\n\t\t\t}\n\t\t\t\n\t\t\tfor(String simpleValidList : ParameterSets.getSimpleValidLists()) {\n\t\t\t\ttry {\n\t\t\t\t\tSurveyResponseValidators.validateSurveyIds(simpleValidList);\n\t\t\t\t}\n\t\t\t\tcatch(ValidationException e) {\n\t\t\t\t\tfail(\"A valid list failed validation.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(ValidationException e) {\n\t\t\tfail(\"A validation exception was thrown: \" + e.getMessage());\n\t\t}\n\t}", "private boolean doDescriptorArgsMatch(String expected, String check) {\n String expectedArgs = expected.substring(1, expected.indexOf(\")\"));\n String checkArgs = check.substring(1, check.indexOf(\")\"));\n return expectedArgs.equals(checkArgs);\n }", "@Test\r\n\tpublic void testParseIdentifier() {\r\n\r\n\t\t// Enter the code\r\n\r\n\t\tdriver.findElement(By.name(\"code[code]\"))\r\n\t\t\t\t.sendKeys(\"the_best_cat = \\\"Noogie Cat\\\"\\nputs \\\"The best cat is: \\\" + the_best_cat\");\r\n\r\n\t\t// Look for the \"Parse\" button and click\r\n\r\n\t\tdriver.findElements(By.name(\"commit\")).get(1).click();\r\n\r\n\t\t// Check that there contains corresponding quantity of \"assign\"\r\n\r\n\t\ttry {\r\n\t\t\tWebElement code = driver.findElement(By.tagName(\"code\"));\r\n\t\t\tString res = code.getText();\r\n\t\t\tint count = 0;\r\n\t\t\tfor (int i = 0; i <= res.length() - 6; i++) {\r\n\t\t\t\tString sub = res.substring(i, i + 6);\r\n\t\t\t\tif (sub.equals(\"assign\"))\r\n\t\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t\tassertEquals(count, 1);\r\n\t\t} catch (NoSuchElementException nseex) {\r\n\t\t\tfail();\r\n\t\t}\r\n\t}", "@Test\n public void identifierTest() {\n assertEquals(\"ident1\", authResponse.getIdentifier());\n }", "@Test\n public void testMakeUniqueProgramId() {\n System.out.println(\"makeUniqueProgramId\");\n \n List<SAMProgramRecord> programList = new ArrayList();\n SAMProgramRecord programRecord = new SAMProgramRecord(\"test\");\n programList.add(programRecord);\n \n SAMProgramRecord programRecord1 = new SAMProgramRecord(\"test\");\n \n PicardCommandLine instance = new PicardCommandLineImpl();\n\n SAMProgramRecord result = instance.makeUniqueProgramId(programList, programRecord1);\n assertEquals(result.getProgramGroupId(), \"test_1\");\n\n }", "@Override\n public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (!(o instanceof Argument)) {\n return false;\n }\n return id != null && id.equals(((Argument) o).id);\n }", "public abstract ValidationResults validArguments(String[] arguments);", "@Override\n public void verifyArgs(ArrayList<String> args) throws ArgumentFormatException {\n super.checkNumArgs(args);\n _args = true;\n }", "public Vector<String> getValues(final String _identifier)\n\t{\n\t System.out.println(\"Okay, let's set some values!\");\n\n\t\tif(!_identifier.equals(identifier))\n\t\t\treturn null;\n\t\tfinal Vector<String> values = new Vector<String>();\n\t\tif(om.equals(\"hotspot_interaction\"))\n\t\t{\n\t\t\tfor(int i=0; i< hotspots.size(); i++)\n\t\t\t\tif(hotspots.elementAt(i).isHighlighted())\n\t\t\t\t{\n values.add(hotspots.elementAt(i).getKeyCode());\n\t\t\t\t}\n\t\t}else if(om.equals(\"graphic_associate_interaction\"))\n\t\t{\n\t\t\tfor(int i=0; i< associations.size(); i++)\n\t\t\t{\n\t\t\t\tString pair_add = \"\";\n\t\t\t\tpair_add += associations.elementAt(i).getA().getKeyCode();\n\t\t\t\tpair_add += \" \";\n\t\t\t\tpair_add += associations.elementAt(i).getB().getKeyCode();\n\t\t\t\tvalues.add(pair_add);\n\t\t\t}\n\t\t}else if(om.equals(\"graphic_order_interaction\"))\n\t\t{\n\t\t\tfor(int i = 0; i < movableObjects.size(); i++)\n\t\t\t{\n\t\t\t\tfinal Iterator<String> vals = movableObjects.elementAt(i).bound.keySet().iterator();\n\t\t\t\twhile(vals.hasNext()) {\n\t\t\t\t\tvalues.add(vals.next());\n\t\t\t\t}\n\t\t\t}\n\t\t}else if(om.equals(\"figure_placement_interaction\"))\n {\n\t\t if (skipped) {\n values.add(\"\");\n return values;\n }\n\n\t\t Boolean found = false;\n for(int i = 0; i < movableObjects.size(); i++)\n {\n //System.out.println(\"The point is: \" + movableObjects.elementAt(i).pos.x + \", \" + movableObjects.elementAt(i).pos.y);\n System.out.println(\"The movable Object thingy is: \"+movableObjects.elementAt(i).getKeyCode()+\" and bottom is: \"+bottom);\n for (int q=0; q < hotspots.size(); q++) {\n final Rectangle hsRect = new Rectangle(hotspots.elementAt(q).coords[0],hotspots.elementAt(q).coords[1],hotspots.elementAt(q).coords[2],hotspots.elementAt(q).coords[3]);\n final Rectangle mvRect = new Rectangle(movableObjects.elementAt(i).pos.x, movableObjects.elementAt(i).pos.y, movableObjects.elementAt(i).obj.getBounds().width, movableObjects.elementAt(i).obj.getBounds().height);\n System.out.println(\"The bounds for \"+ hotspots.elementAt(q).getKeyCode() +\" are: \"+hsRect+ \". Is \"+movableObjects.elementAt(i).getKeyCode() +\" at: \"+mvRect+\" in there?\");\n //System.out.println(\"The bounds for \"+ hotspots.elementAt(q).getKeyCode() +\" are: \"+hsRect+ \". Is \"+movableObjects.elementAt(i).getKeyCode() +\" at: \"+movableObjects.elementAt(i).pos.x+\",\"+movableObjects.elementAt(i).pos.y+\" in there?\");\n //if (hotspots.elementAt(q).obj.contains(movableObjects.elementAt(i).obj.getBounds2D())) {\n if (hsRect.contains(mvRect)) {\n values.add(movableObjects.elementAt(i).getKeyCode()+\":\"+hotspots.elementAt(q).getKeyCode());\n values.add(movableObjects.elementAt(i).getKeyCode()+\":\"+mvRect.x+\"-\"+mvRect.y);\n found = true;\n }\n }\n if (!found) {\n values.add(movableObjects.elementAt(i).getKeyCode() +\":\"+movableObjects.elementAt(i).pos.x+\"-\"+movableObjects.elementAt(i).pos.y);\n } else {\n found = false;\n }\n //values.add(movableObjects.elementAt(i).getKeyCode()+\":\"+movableObjects.elementAt(i).pos.x+\", \"+movableObjects.elementAt(i).pos.y);\n }\n }else if(om.equals(\"gap_match_interaction\"))\n\t\t{\n\t\t\tfor(int i=0; i< hotspots.size(); i++)\n\t\t\t{\n\t\t\t\tString pair_add = \"\";\n\t\t\t\tif(hotspots.elementAt(i).bound != null)\n\t\t\t\t{\n\t\t\t\t\tfinal Iterator<String> boundKeys = hotspots.elementAt(i).bound.keySet().iterator();\n\t\t\t\t\twhile(boundKeys.hasNext())\n\t\t\t\t\t{\n\t\t\t\t\t\tpair_add += boundKeys.next();\n\t\t\t\t\t\tpair_add += \" \";\n\t\t\t\t\t\tpair_add += hotspots.elementAt(i).getKeyCode();\n\t\t\t\t\t\tvalues.add(pair_add);\n\t\t\t\t\t\tpair_add = \"\";\n\t\t\t\t\t\tSystem.out.println(\"The pair we're adding is: \"+pair_add);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (om.equals(\"figure_placement_interaction\")) {\n\t\t System.out.println(\"Got here! values is \"+values.size());\n\t\t for (final String element : values)\n \t\t System.out.println(\"Got here! values is \" + element);\n\t\t}\n\t\tif (values.size() > 0) {\n\t\t return values;\n\t\t} else {\n\t\t values.add(\"\");\n\t\t return values;\n\t\t}\n\t}", "public interface IDs {\n\n static final String SERIES_STANDARD_ID = \"c7fb8441-d5db-4113-8af0-e4ba0c3f51fd\";\n static final String EPISODE_STANDARD_ID = \"a99a8588-93df-4811-8403-fe22c70fa00a\";\n static final String FILE_STANDARD_ID = \"c5919cbf-fbf3-4250-96e6-3fefae51ffc5\";\n static final String RECORDING_STANDARD_ID = \"4a40811d-c067-467f-8ff6-89f37eddb933\";\n static final String ZAP2IT_STANDARD_ID = \"545c4b00-5409-4d92-9cda-59a44f0ec7a9\";\n}", "public void testTokenIds() {\n Language<TokenId> language = TestGenLanguage.language();\n Set<TokenId> ids = language.tokenIds();\n assertTrue(\"Invalid ids.size() - expected \" + IDS_SIZE, ids.size() == IDS_SIZE);\n \n TokenId[] idArray = {\n TestGenLanguage.IDENTIFIER_ID,TestGenLanguage.PLUS_ID,TestGenLanguage.MINUS_ID,TestGenLanguage.PLUS_MINUS_PLUS_ID,TestGenLanguage.SLASH_ID,TestGenLanguage.STAR_ID,TestGenLanguage.ML_COMMENT_ID,TestGenLanguage.WHITESPACE_ID,TestGenLanguage.SL_COMMENT_ID,TestGenLanguage.ERROR_ID,TestGenLanguage.PUBLIC_ID,TestGenLanguage.PRIVATE_ID,TestGenLanguage.STATIC_ID,\n };\n\n // Check operations with ids\n Collection<TokenId> testIds = Arrays.asList(idArray);\n LexerTestUtilities.assertCollectionsEqual(\"Ids do not match with test ones\",\n ids, testIds);\n \n // Check that ids.iterator() is ordered by ordinal\n int ind = 0;\n for (TokenId id : ids) {\n assertTrue(\"Token ids not sorted by ordinal at index=\" + ind, id == idArray[ind]);\n ind++;\n assertSame(language.tokenId(id.name()), id);\n assertSame(language.tokenId(id.ordinal()), id);\n assertSame(language.validTokenId(id.name()), id);\n assertSame(language.validTokenId(id.ordinal()), id);\n }\n \n try {\n language.validTokenId(\"invalid-name\");\n fail(\"Error: exception not thrown\");\n } catch (IllegalArgumentException e) {\n // OK\n }\n \n try {\n language.validTokenId(-1);\n fail(\"Error: exception not thrown\");\n } catch (IndexOutOfBoundsException e) {\n // OK\n }\n \n try {\n language.validTokenId(20);\n fail(\"Error: exception not thrown\");\n } catch (IndexOutOfBoundsException e) {\n // OK\n }\n \n assertEquals(15, language.maxOrdinal());\n \n // Check token categories\n Set cats = language.tokenCategories();\n Collection testCats = Arrays.asList(new String[] { \"operator\", \"test-category\", \"whitespace\", \"error\", \"comment\", \"keyword\" });\n LexerTestUtilities.assertCollectionsEqual(\"Invalid token categories\",\n cats, testCats);\n \n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new TokenId[] {\n TestGenLanguage.PLUS_ID,TestGenLanguage.MINUS_ID,TestGenLanguage.PLUS_MINUS_PLUS_ID,TestGenLanguage.STAR_ID,TestGenLanguage.SLASH_ID,\n }),\n language.tokenCategoryMembers(\"operator\")\n \n );\n \n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new TokenId[] {\n TestGenLanguage.PLUS_ID,TestGenLanguage.MINUS_ID,TestGenLanguage.IDENTIFIER_ID,\n }),\n language.tokenCategoryMembers(\"test-category\")\n \n );\n\n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new TokenId[] {\n TestGenLanguage.WHITESPACE_ID,\n }),\n language.tokenCategoryMembers(\"whitespace\")\n \n );\n\n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new TokenId[] {\n TestGenLanguage.ERROR_ID,\n }),\n language.tokenCategoryMembers(\"error\")\n \n );\n\n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new TokenId[] {\n TestGenLanguage.ML_COMMENT_ID,TestGenLanguage.SL_COMMENT_ID,\n }),\n language.tokenCategoryMembers(\"comment\")\n \n );\n \n List<String> testIdCats\n = language.tokenCategories(TestGenLanguage.IDENTIFIER_ID);\n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new String[] {\n \"test-category\",\n }),\n testIdCats\n );\n\n List<String> testIdCats2\n = language.tokenCategories(TestGenLanguage.PLUS_ID);\n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new String[] {\n \"test-category\",\n \"operator\",\n }),\n testIdCats2\n );\n\n\n // Check Language.merge()\n Collection<TokenId> mergedIds\n = language.merge(\n Arrays.asList(new TokenId[] { TestGenLanguage.IDENTIFIER_ID }),\n language.merge(language.tokenCategoryMembers(\"comment\"),\n language.tokenCategoryMembers(\"error\"))\n \n );\n LexerTestUtilities.assertCollectionsEqual(\"Invalid language.merge()\",Arrays.asList(new TokenId[] {\n TestGenLanguage.ML_COMMENT_ID,TestGenLanguage.SL_COMMENT_ID,TestGenLanguage.ERROR_ID,TestGenLanguage.IDENTIFIER_ID,\n }),\n mergedIds\n \n );\n\n }", "public void setIdentifier(String value) {\n/* 214 */ setValue(\"identifier\", value);\n/* */ }", "public void testStringID() {\n String testID = generator.generatePrefixedIdentifier(\"test\");\n assertNotNull(testID);\n assertTrue(testID.matches(\"test\" + ID_REGEX));\n }", "public static void main(String[] args) {\n String idNum = \"410326880818551\";\n System.out.println(verify15(idNum));\n// String idNum2 = \"411111198808185510\";\n String idNum2 = \"410326198808185515\";\n System.out.println(verify(idNum2));\n }", "private void validateGetIdPInputValues(String resourceId) throws IdentityProviderManagementException {\n\n if (StringUtils.isEmpty(resourceId)) {\n String data = \"Invalid argument: Identity Provider resource ID value is empty\";\n throw IdPManagementUtil.handleClientException(IdPManagementConstants.ErrorMessage\n .ERROR_CODE_IDP_GET_REQUEST_INVALID, data);\n }\n }", "Collection<?> idValues();", "public void setIdentifierValue(java.lang.String param) {\r\n localIdentifierValueTracker = true;\r\n\r\n this.localIdentifierValue = param;\r\n\r\n\r\n }", "public void testGetInputArguments() {\n List<String> args = mb.getInputArguments();\n assertNotNull(args);\n for (String string : args) {\n assertNotNull(string);\n assertTrue(string.length() > 0);\n }\n }", "IdentifiersType createIdentifiersType();", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n setInput(invocation,\"string\", \"RoomUUID\", roomUUID == null ? null : roomUUID.getValue());\n }", "private void processIdentificator() {\r\n\t\tString identificator = generateString();\r\n\r\n\t\tif (identificator.equals(Constants.AND_STRING)) {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.AND_STRING);\r\n\r\n\t\t} else if (identificator.equals(Constants.XOR_STRING)) {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.XOR_STRING);\r\n\r\n\t\t} else if (identificator.equals(Constants.OR_STRING)) {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.OR_STRING);\r\n\r\n\t\t} else if (identificator.equals(Constants.NOT_STRING)) {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.NOT_STRING);\r\n\r\n\t\t} else if (identificator.equals(trueString)) {\r\n\t\t\ttoken = new Token(TokenType.CONSTANT, true);\r\n\r\n\t\t} else if (identificator.equals(falseString)) {\r\n\t\t\ttoken = new Token(TokenType.CONSTANT, false);\r\n\r\n\t\t} else {\r\n\t\t\ttoken = new Token(TokenType.VARIABLE, identificator.toUpperCase());\r\n\t\t}\r\n\t}", "protected void parseArgs(String[] args) {\n // Arguments are pretty simple, so we go with a basic switch instead of having\n // yet another dependency (e.g. commons-cli).\n for (int i = 0; i < args.length; i++) {\n int nextIdx = (i + 1);\n String arg = args[i];\n switch (arg) {\n case \"--prop-file\":\n if (++i < args.length) {\n loadPropertyFile(args[i]);\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--schema-name\":\n if (++i < args.length) {\n DataDefinitionUtil.assertValidName(args[i]);\n\n // Force upper-case to avoid tricky-to-catch errors related to quoting names\n this.schemaName = args[i];\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--grant-to\":\n if (++i < args.length) {\n DataDefinitionUtil.assertValidName(args[i]);\n\n // Force upper-case because user names are case-insensitive\n this.grantTo = args[i].toUpperCase();\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--target\":\n if (++i < args.length) {\n DataDefinitionUtil.assertValidName(args[i]);\n List<String> targets = Arrays.asList(args[i].split(\",\"));\n for (String target : targets) {\n String tmp = target.toUpperCase();\n nextIdx++;\n if (tmp.startsWith(\"BATCH\")) {\n this.grantJavaBatchSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.javaBatchSchemaName = args[nextIdx];\n i++;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n } else if (tmp.startsWith(\"OAUTH\")){\n this.grantOauthSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.oauthSchemaName = args[nextIdx];\n i++;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n } else if (tmp.startsWith(\"DATA\")){\n this.grantFhirSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.schemaName = args[nextIdx];\n i++;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n }\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--add-tenant-key\":\n if (++i < args.length) {\n this.addKeyForTenant = args[i];\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--update-proc\":\n this.updateProc = true;\n break;\n case \"--check-compatibility\":\n this.checkCompatibility = true;\n break;\n case \"--drop-admin\":\n this.dropAdmin = true;\n break;\n case \"--test-tenant\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.testTenant = true;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--tenant-key\":\n if (++i < args.length) {\n this.tenantKey = args[i];\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--tenant-key-file\":\n if (++i < args.length) {\n tenantKeyFileName = args[i];\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--list-tenants\":\n this.listTenants = true;\n break;\n case \"--update-schema\":\n this.updateFhirSchema = true;\n this.updateOauthSchema = true;\n this.updateJavaBatchSchema = true;\n this.dropSchema = false;\n break;\n case \"--update-schema-fhir\":\n this.updateFhirSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.schemaName = args[nextIdx];\n i++;\n } else {\n this.schemaName = DATA_SCHEMANAME;\n }\n break;\n case \"--update-schema-batch\":\n this.updateJavaBatchSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.javaBatchSchemaName = args[nextIdx];\n i++;\n }\n break;\n case \"--update-schema-oauth\":\n this.updateOauthSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.oauthSchemaName = args[nextIdx];\n i++;\n }\n break;\n case \"--create-schemas\":\n this.createFhirSchema = true;\n this.createOauthSchema = true;\n this.createJavaBatchSchema = true;\n break;\n case \"--create-schema-fhir\":\n this.createFhirSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.schemaName = args[nextIdx];\n i++;\n }\n break;\n case \"--create-schema-batch\":\n this.createJavaBatchSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.javaBatchSchemaName = args[nextIdx];\n i++;\n }\n break;\n case \"--create-schema-oauth\":\n this.createOauthSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.oauthSchemaName = args[nextIdx];\n i++;\n }\n break;\n case \"--drop-schema\":\n this.updateFhirSchema = false;\n this.dropSchema = true;\n break;\n case \"--drop-schema-fhir\":\n this.dropFhirSchema = Boolean.TRUE;\n break;\n case \"--drop-schema-batch\":\n this.dropJavaBatchSchema = Boolean.TRUE;\n break;\n case \"--drop-schema-oauth\":\n this.dropOauthSchema = Boolean.TRUE;\n break;\n case \"--pool-size\":\n if (++i < args.length) {\n this.maxConnectionPoolSize = Integer.parseInt(args[i]);\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--prop\":\n if (++i < args.length) {\n // properties are given as name=value\n addProperty(args[i]);\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--confirm-drop\":\n this.confirmDrop = true;\n break;\n case \"--allocate-tenant\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.allocateTenant = true;\n this.dropTenant = false;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--drop-tenant\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.dropTenant = true;\n this.allocateTenant = false;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--freeze-tenant\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.freezeTenant = true;\n this.dropTenant = false;\n this.allocateTenant = false;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--drop-detached\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.dropDetached = true;\n this.dropTenant = false;\n this.allocateTenant = false;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--delete-tenant-meta\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.deleteTenantMeta = true;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--dry-run\":\n this.dryRun = Boolean.TRUE;\n break;\n case \"--db-type\":\n if (++i < args.length) {\n this.dbType = DbType.from(args[i]);\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n switch (dbType) {\n case DERBY:\n translator = new DerbyTranslator();\n // For some reason, embedded derby deadlocks if we use multiple threads\n maxConnectionPoolSize = 1;\n break;\n case POSTGRESQL:\n translator = new PostgreSqlTranslator();\n break;\n case DB2:\n default:\n break;\n }\n break;\n default:\n throw new IllegalArgumentException(\"Invalid argument: \" + arg);\n }\n }\n }", "public String getIdentifier() {\n/* 222 */ return getValue(\"identifier\");\n/* */ }", "@Test\n public void testGetPropertyValueSet(){\n List<User> list = toList(//\n new User(2L),\n new User(5L),\n new User(5L));\n\n Set<Integer> set = CollectionsUtil.getPropertyValueSet(list, \"id\", Integer.class);\n assertThat(set, contains(2, 5));\n }", "List<ArgumentEntity> getArgumentsByUser(UUID id);", "@DisplayName(\"SP800-73-4.42 test\")\n\t@ParameterizedTest(name = \"{index} => oid = {0}\")\n\t//@MethodSource(\"sp800_73_4_DiscoveryObjectTestProvider\")\n @ArgumentsSource(ParameterizedArgumentsProvider.class)\n\tvoid sp800_73_4_Test_42(String oid, TestReporter reporter) {\n\t\t\n\t\tPIVDataObject o = AtomHelper.getDataObject(oid);\n\t\t\n\t\tboolean globalPINisPrimary = ((DiscoveryObject) o).globalPINisPrimary();\n\t\t\n\t\tif(globalPINisPrimary) {\n\t\t\ts_logger.info(\"Global PIN is the primary PIN used to satisfy the PIV ACRs for command execution and object access.\");\n\n\t\t\ttry {\n\t\t\t\tCardUtils.authenticateInSingleton(true);\n\t\t\t} catch (ConformanceTestException e) {\n\t\t\t\tfail(e);\n\t\t\t}\n\t\t} else {\n\t\t\ts_logger.info(\"PIV Card Application PIN is the primary PIN used to satisfy the PIV ACRs for command execution and object access.\");\n\n\t\t\ttry {\n\t\t\t\tCardUtils.authenticateInSingleton(false);\n\t\t\t} catch (ConformanceTestException e) {\n\t\t\t\tfail(e);\n\t\t\t}\n\t\t}\n\t\t\t\n\t}", "@Test\n\tpublic void testValidateReturnId() {\n\t\ttry {\n\t\t\tfor(String emptyValue : ParameterSets.getEmptyValues()) {\n\t\t\t\tAssert.assertNull(SurveyResponseValidators.validateReturnId(emptyValue));\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\tSurveyResponseValidators.validateReturnId(\"Invalid value.\");\n\t\t\t\tfail(\"The return ID value was invalid.\");\n\t\t\t}\n\t\t\tcatch(ValidationException e) {\n\t\t\t\t// Passed.\n\t\t\t}\n\t\t\t\n\t\t\tAssert.assertEquals(true, SurveyResponseValidators.validateReturnId(\"true\"));\n\t\t\tAssert.assertEquals(false, SurveyResponseValidators.validateReturnId(\"false\"));\n\t\t}\n\t\tcatch(ValidationException e) {\n\t\t\tfail(\"A validation exception was thrown: \" + e.getMessage());\n\t\t}\n\t}", "public static void assertOptionIds(String expectedIds, PmAttr<?> pmAttr) {\n StringBuilder sb = new StringBuilder();\n boolean first = true;\n for (PmOption o : pmAttr.getOptionSet().getOptions()) {\n if (!first) {\n sb.append(\", \");\n }\n sb.append(o.getIdAsString());\n first = false;\n }\n assertEquals(pmAttr.getPmRelativeName() + \": option ids\", expectedIds, sb.toString());\n }", "private void scanArgs(String [] args)\n{\n for (int i = 0; i < args.length; ++i) {\n if (args[i].startsWith(\"-\")) {\n\t badArgs();\n }\n else badArgs();\n }\n}", "public void testValidateArgs() {\n\t\tString[] args = new String[]{\"name\",\"bob\",\"jones\"};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with 1 argument, should fail\n\t\targs = new String[]{\"name\"};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with 0 arguments, should be a problem\n\t\targs = new String[]{};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with null arguments, should be a problem\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with correct arguments, first one is zero, should work\n\t\targs = new String[]{\"name\",\"bob\"};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tfail(\"An InvalidFunctionArguements exception should have NOT been thrown by the constructor!\");\n\t\t}\n\t}", "private void validateArgumentValues() throws ArgBoxException {\n\t\tfinal List<String> errorMessages = new ArrayList<>();\n\t\tparsedArguments.values().stream()\n\t\t\t\t.filter(parsedArg -> parsedArg.isValueRequired())\n\t\t\t\t.filter(parsedArg -> {\n\t\t\t\t\tfinal boolean emptyValue = null == parsedArg.getValue();\n\t\t\t\t\tif (emptyValue) {\n\t\t\t\t\t\terrorMessages.add(String.format(\"The argument %1s has no value !\", parsedArg.getCommandArg()));\n\t\t\t\t\t}\n\t\t\t\t\treturn !emptyValue;\n\t\t\t\t})\n\t\t\t\t.peek(parsedArg -> {\n\t\t\t\t\tif (parsedArg.getValidator().negate().test(parsedArg.getValue())) {\n\t\t\t\t\t\terrorMessages.add(String.format(\"The value %1s for the argument %2s is not valid !\",\n\t\t\t\t\t\t\t\tparsedArg.getValue(), parsedArg.getCommandArg()));\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.close();\n\t\tthrowException(() -> CollectionUtils.isNotEmpty(errorMessages),\n\t\t\t\tgetArgBoxExceptionSupplier(\"One or more arguments have errors with their values !\", errorMessages));\n\t}", "@Test\n\tpublic void requestAccountsForCustomer12212_checkListOfAccountsIDs_expectContains12345() {\n\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\tthen();\n\t}", "protected abstract String getIdentifier();", "public void testGetIdentifier() {\n\t\tassertEquals(item.getIdentifier(),\"cup8\");\r\n\t}", "public\n static\n StringBuffer scanOutProperties(String args, StringBuffer sb)\n {\n int si; // source Index\n \n int len = args.length();\n char c;\n\n int nambeg, namlen;\n int valbeg, vallen;\n\n // set output sb empty\n sb.setLength(0);\n\n // scan entire args for nam/val pairs\n si = 0;\n\n mainscanloop: // outermost scan loop\n for (;;)\n {\n if (si >= len)\n break mainscanloop; // totally done\n\n namvalscanloop: // scan single nam/val pair\n for (;;)\n {\n // ====== begin scan on one pair\n nambeg = -1;\n namlen = 0;\n\n valbeg = -1;\n vallen = 0;\n\n\n // ====== scan past white space before nam\n for (;;)\n {\n if (si >= len)\n break namvalscanloop; // done with this pair\n\n c = args.charAt(si);\n\n if (c == ' ' || c == '\\t' || c == '\\n' || c == '\\r')\n {\n si++;\n continue;\n }\n break;\n }\n\n\n // ====== Start of nam\n // scan len of nam, up to '='\n nambeg = si;\n for (;;)\n {\n if (si >= len)\n break namvalscanloop; // done with this pair\n\n c = args.charAt(si);\n\n if (c == '\\n')\n {\n si++;\n break namvalscanloop; // done with this pair\n }\n\n if (c == '=') // Found delimiter - go on to scan val\n {\n si++;\n break;\n }\n\n namlen++;\n\n si++;\n }\n\n\n // ====== Start of val\n // scan len of val\n // handle \" and ' bounded values\n if (si >= len)\n break namvalscanloop; // done with this pair\n\n c = args.charAt(si);\n\n // === scan to matching \" or '\n if (c == '\\\"' || c == '\\'')\n {\n char matchc = c;\n si++;\n if (si >= len)\n break namvalscanloop; // done with this pair\n\n c = args.charAt(si);\n\n valbeg = si;\n for (;;)\n {\n if (c == '\\n')\n {\n si++;\n break namvalscanloop; // done with this pair\n }\n\n if (c == '\\\\') // Check for escaped \" or '\n {\n if (si + 1 < len)\n {\n if (args.charAt(si + 1) == '\\\"' || args.charAt(si + 1) == '\\'')\n {\n vallen += 2;\n si += 2;\n if (si >= len)\n break namvalscanloop; // done with this pair\n c = args.charAt(si);\n continue;\n }\n }\n }\n\n if (c == matchc)\n {\n si++;\n break namvalscanloop; // done with this pair\n }\n\n vallen++;\n\n si++;\n if (si >= len)\n break namvalscanloop; // done with this pair\n c = args.charAt(si);\n }\n }\n else\n\n // === scan normal value - c is valid upon first entry\n {\n valbeg = si;\n for (;;)\n {\n if (c == '\\n')\n {\n si++;\n break namvalscanloop; // done with this pair\n }\n\n if (c == ' ')\n {\n si++;\n break namvalscanloop; // done with this pair\n }\n\n vallen++;\n\n si++;\n if (si >= len)\n break namvalscanloop; // done with this pair\n c = args.charAt(si);\n }\n }\n\n } // end of namvalscanloop\n\n // append anything accumulated in output sb and go for another pair\n YutilProperties.scanOutPropertiesNamValAppend(args, nambeg, namlen, valbeg, vallen, sb);\n\n } // end of for ever\n\n return sb;\n }", "@java.lang.Override\n public boolean hasInputIds() {\n return inputSourceCase_ == 2;\n }", "public String[] parseOptions(long setId, String attribute) throws ServerException;", "public static void main(String[] args) {\n Identification identification1 = new IdentificationGermany(\"ABC.203948ASFJH\");\n Identification identification2 = new IdentificationGermany(\"XYA-LKJASD\");\n Identification identification3 = new IdentificationGermany(\"12345678\");\n\n Identification identification4 = new IdentificationNetherlands(\"12345678\");\n Identification identification5 = new IdentificationNetherlands(\"123409\");\n Identification identification6 = new IdentificationNetherlands(\"ASBCLKJS\");\n\n validate(identification1);\n validate(identification2);\n validate(identification3);\n validate(identification4);\n validate(identification5);\n validate(identification6);\n }", "Set<Character> getAllowedIdentifierChars();", "@Test\n\tpublic void argumentTest() {\n\t\tSelectionController selectionController = new SelectionController();\n\t\ttry {\n\t\t\tselectionController.select(null);\n\t\t\tAssert.fail(\"The new selection was null\");\n\t\t} catch (NullPointerException e) {\n\t\t}\n\n\t\ttry {\n\t\t\tselectionController.unselect(null);\n\t\t\tAssert.fail(\"The new unselection was null\");\n\t\t} catch (NullPointerException e) {\n\t\t}\n\n\t\ttry {\n\t\t\tselectionController.reselect(null);\n\t\t\tAssert.fail(\"The new reselection was null\");\n\t\t} catch (NullPointerException e) {\n\t\t}\n\t}", "static boolean attribute_arg_value_scalar(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"attribute_arg_value_scalar\")) return false;\n boolean r;\n r = consumeToken(b, STRING);\n if (!r) r = consumeToken(b, NUMBER);\n if (!r) r = consumeToken(b, BOOLEAN);\n if (!r) r = identifier(b, l + 1);\n return r;\n }", "@Test\r\n public void testGetIdentifier() {\r\n System.out.println(\"getIdentifier\");\r\n Assignment instance = new Assignment();\r\n String expResult = \":=\";\r\n String result = instance.getIdentifier();\r\n assertEquals(expResult, result);\r\n }", "@Test\n\tpublic void testFetchMappedValuesForInValidData() {\n\t\tString input = \"231\";\n\t\tList<String> expectedOutput = Arrays.asList(\"A,B,C\", \"D,E,F\", \"1\");\n\t\tList<String> actualOutput = GeneralUtility.fetchMappedValues(input);\n\t\tAssert.assertArrayEquals(expectedOutput.toArray(), actualOutput.toArray());\n\t}", "public String getIdentifierString();", "private List<String> nextIdentListParam()\n {\n if (empty())\n return null;\n\n int start = position;\n ArrayList<String> result = null;\n\n if (!consume('('))\n return null;\n skipWhitespace();\n\n do {\n String ident = nextIdentifier();\n if (ident == null) {\n position = start;\n return null;\n }\n if (result == null)\n result = new ArrayList<>();\n result.add(ident);\n skipWhitespace();\n } while (skipCommaWhitespace());\n\n if (consume(')'))\n return result;\n\n position = start;\n return null;\n }", "public List<Long> getIdList(String key) throws IdentifierException {\n Object value = get(key);\n if (!(value instanceof List) || ((List)value).isEmpty() || !(((List)value).get(0) instanceof String))\n return emptyLongList;\n List<String> stringList = (List<String>)value;\n List<Long> longList = new ArrayList<>(stringList.size());\n for (String longString : stringList)\n longList.add(Utils.stringToId(longString));\n return longList;\n }", "IdListRule createIdListRule();", "java.lang.String getIdentifier();", "I getIdentifier();", "@Test\n public void testDAM31901001() {\n // in this case, there are different querirs used to generate the ids.\n // the database id is specified in the selectKey element\n testDAM30602001();\n }", "@Test\n public void commandIdTest() {\n // TODO: test commandId\n }", "protected void parse(CommandLine cli)\n {\n // Application ID option\n if(hasOption(cli, Opt.APPLICATION_ID, false))\n {\n applicationId = Long.parseLong(getOptionValue(cli, Opt.APPLICATION_ID));\n logOptionValue(Opt.APPLICATION_ID, applicationId);\n }\n\n // Server ID option\n if(hasOption(cli, Opt.SERVER_ID, false))\n {\n serverId = Long.parseLong(getOptionValue(cli, Opt.SERVER_ID));\n logOptionValue(Opt.SERVER_ID, serverId);\n }\n\n // Category option\n if(hasOption(cli, Opt.CATEGORY, true))\n {\n category = getOptionValue(cli, Opt.CATEGORY);\n logOptionValue(Opt.CATEGORY, category);\n }\n\n // Name option\n if(hasOption(cli, Opt.NAME, true))\n {\n name = getOptionValue(cli, Opt.NAME);\n logOptionValue(Opt.NAME, name);\n }\n }", "@java.lang.Override\n public boolean hasInputIds() {\n return inputSourceCase_ == 2;\n }", "public void setIdentifiers(String identifiers) {\n this.identifiers = identifiers;\n }", "public boolean isSetIdentifier() {\n return this.identifier != null;\n }", "void processCommandLineArguments(String[] args) throws ConfigurationException;", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n setInput(invocation,\"ui4\", \"ID\", iD == null ? null : iD.getValue());\n setInput(invocation,\"string\", \"StartLocalTime\", startLocalTime == null ? null : startLocalTime.getValue());\n setInput(invocation,\"string\", \"Duration\", duration == null ? null : duration.getValue());\n setInput(invocation,\"string\", \"Recurrence\", recurrence == null ? null : recurrence.getValue());\n setInput(invocation,\"boolean\", \"Enabled\", enabled == null ? null : enabled.getValue());\n setInput(invocation,\"string\", \"RoomUUID\", roomUUID == null ? null : roomUUID.getValue());\n setInput(invocation,\"string\", \"ProgramURI\", programURI == null ? null : programURI.getValue());\n setInput(invocation,\"string\", \"ProgramMetaData\", programMetaData == null ? null : programMetaData.getValue());\n setInput(invocation,\"string\", \"PlayMode\", playMode == null ? null : playMode.getValue());\n setInput(invocation,\"ui2\", \"Volume\", volume == null ? null : volume.getValue());\n setInput(invocation,\"boolean\", \"IncludeLinkedZones\", includeLinkedZones == null ? null : includeLinkedZones.getValue());\n }", "protected abstract Object[] getValue(Object ... inputs) throws InvalidNumberOfArgumentsException;", "public String[] getIdsFromSmartKey(String value);", "public void setIdentifiers(List<Identifier> identifiers) {\r\n\r\n this.identifiers = identifiers;\r\n\r\n }", "public void analyseArguments(String[] args) throws ArgumentsException {\n \t\t\n for (int i=0;i<args.length;i++){ \n \n \n if (args[i].matches(\"-s\")){\n affichage = true;\n }\n else if (args[i].matches(\"-seed\")) {\n aleatoireAvecGerme = true;\n i++; \n \t// traiter la valeur associee\n try { \n seed =new Integer(args[i]);\n \n }\n catch (Exception e) {\n throw new ArgumentsException(\"Valeur du parametre -seed invalide :\" + args[i]);\n } \t\t\n }\n \n else if (args[i].matches(\"-mess\")){\n i++; \n \t// traiter la valeur associee\n messageString = args[i];\n if (args[i].matches(\"[0,1]{7,}\")) {\n messageAleatoire = false;\n nbBitsMess = args[i].length();\n \n } \n else if (args[i].matches(\"[0-9]{1,6}\")) {\n messageAleatoire = true;\n nbBitsMess = new Integer(args[i]);\n if (nbBitsMess < 1) \n throw new ArgumentsException (\"Valeur du parametre -mess invalide : \" + nbBitsMess);\n }\n else \n throw new ArgumentsException(\"Valeur du parametre -mess invalide : \" + args[i]);\n }\n \n else throw new ArgumentsException(\"Option invalide :\"+ args[i]);\n \n }\n \n }", "private static boolean verify(String ident) {\n if (Arrays.asList(IDENTIFIERS).contains(ident)) return true;\n if (!ident.matches(\"[a-zA-Z]\\\\w*\")) return true;\n variables.putIfAbsent(ident,0L);\n return false;\n }", "@Nonnull\n @CheckReturnValue\n public ArgumentValues values() {\n return strings;\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }" ]
[ "0.6263417", "0.5575525", "0.5280657", "0.5253385", "0.52436274", "0.5234544", "0.5217076", "0.51767665", "0.5158806", "0.514335", "0.5123334", "0.51193875", "0.5069831", "0.49926808", "0.49160537", "0.49060717", "0.48728544", "0.48550496", "0.48496848", "0.484878", "0.48199752", "0.48185557", "0.47998297", "0.4790321", "0.47896492", "0.47507444", "0.4743165", "0.47377145", "0.4736894", "0.4725726", "0.47225052", "0.47119358", "0.4684736", "0.4666276", "0.46588886", "0.46576127", "0.46572506", "0.46474412", "0.46462932", "0.46345672", "0.4626505", "0.461592", "0.45860702", "0.45610008", "0.4556326", "0.45444268", "0.45433083", "0.45329395", "0.45211834", "0.4507589", "0.45029426", "0.44937596", "0.44914064", "0.44880015", "0.44560036", "0.44512516", "0.44500667", "0.44495845", "0.44444412", "0.44440344", "0.4427954", "0.44272038", "0.4418355", "0.44015932", "0.44004145", "0.43983608", "0.43977126", "0.43969154", "0.4382796", "0.43743524", "0.437034", "0.43672484", "0.4362559", "0.43585333", "0.43573764", "0.43551582", "0.4348768", "0.43376157", "0.4337574", "0.43374234", "0.43314812", "0.43298438", "0.4328573", "0.43261683", "0.4324972", "0.4324145", "0.43226933", "0.43193063", "0.43098187", "0.43098187", "0.43098187", "0.43098187", "0.43098187", "0.43098187", "0.43098187", "0.43098187", "0.43098187", "0.43098187", "0.43098187", "0.43098187" ]
0.7230284
0
Test of createOutputFilePath method, of class CommandLineArgumentParser.
@Test public void testCreateOutputFilePath() throws Exception { System.out.println("createOutputFilePath"); String [] instanceInput = {"ukh","chat.txt","mike","keyWord","hiddenWord"}; CommandLineArgumentParser instance = new CommandLineArgumentParser(instanceInput); String expResult = "chat.json"; String result = instance.createOutputFilePath(); System.out.println(expResult+" "+result); assertEquals(expResult, result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public File getOutputFilePath() {\n return outputFile;\n }", "private static File determineOutputFile(CommandLine optionLine)\n {\n String output = optionLine.getOptionValue(Environment.OUTPUT);\n if (!StringUtils.isEmpty(output)) {\n return new File(output);\n }\n System.err.println(\"Output file is missing\"); //$NON-NLS-1$\n System.exit(1);\n return null;\n }", "static File getOutputFileFromArguments(String[] args)\n {\n return new File(args[args.length - 1]);\n }", "public abstract boolean isFileOutput();", "void createdOutput(TestResult tr, Section section, String outputName);", "Output createOutput();", "@Test\n\tpublic void testSetGetOutputFileFolder() {\n\t\tString path = \"a\" + File.separator + \"path\";\n\t\toutput.setOutputFileFolder(path);\n\t\tboolean result = output.getOutputFileFolder() != null &&\n\t\t\t\toutput.getOutputFileFolder() == path;\n\t\tassertTrue(result);\n\t}", "public abstract String FileOutput();", "public String getOutputFilePath() {\t\n\t\treturn outputFilePath; \n\t}", "@Override\n\tpublic String generatePathStr(String component,\n\t\t\tString outputName) throws RemoteException {\n\t\treturn \"/user/\" + userName + \"/tmp/redsqirl_\" + component + \"_\" + outputName\n\t\t\t\t+ \"_\" + RandomString.getRandomName(8)+\".txt\";\n\t}", "public String getOutputFileName() {\n\t\treturn outputFile;\n\t}", "@Override\r\n\tpublic String getOutputFile() {\n\t\t\r\n\t\treturn fileOutputPath;\r\n\t}", "public Path getOutputPath() {\n\t\t\n\t\tString name = getSimulationName();\t\t\n\t\tint l = name.length();\n\t\tString sim_name = name.substring(0, l-11); // \"_SIM_FOLDER\" contains 11 character\n\t\t\n\t\tPath path = Paths.get(outpath + \"\\\\\"+ sim_name);\n\t\tif(!Files.exists(path)) {\n\t\t try {\n\t\t Files.createDirectories(path);\n\t\t } catch (IOException e) {\n\t\t e.printStackTrace();\n\t\t }\n\t\t}\n\t\treturn path;\n\t}", "public void setOutput(String outputFile) {\n this.output = outputFile;\n }", "void setOutputPath(String outputPath);", "@Nullable\n @Override\n public Path getPathToOutputFile() {\n return null; // I mean, seriously? OK.\n }", "public Builder(Path outputPath) {\n Preconditions.checkArgument(outputPath != null, \"outputPath can not be null\");\n this.outputFile = outputPath;\n }", "abstract protected String getResultFileName();", "public File getOutput(){\n return outputDir;\n }", "public void testOutput(String path) {\n\t\ttestOutput(path, false);\n\t}", "private void createFile(String outputData, File file) {\n try {\n FileWriter writer = new FileWriter(file);\n writer.write(outputData);\n writer.close();\n } catch (IOException e) {\n e.getSuppressed();\n }\n }", "protected void checkOuputFile(final File outputFile)\r\n\t{\r\n\t\tif(outputFile == null)\r\n\t\t{\r\n\t\t\tthrow new NullPointerException(\"Given output file is null\");\r\n\t\t}\r\n\t\t\r\n\t\t/*if(outputFile.exists())\r\n\t\t{\r\n\t\t\tthrow new IllegalArgumentException(\"Given output file \" + outputFile + \" does already exist\");\r\n\t\t}*/\t\t\r\n\t}", "@Test\n\tpublic void addTaskOutput(){\n\t}", "public interface OutputFile extends VariantOutput {\n\n /**\n * Returns the output file for this artifact's output.\n * Depending on whether the project is an app or a library project, this could be an apk or\n * an aar file. If this {@link com.android.build.OutputFile} has filters, this is a split\n * APK.\n *\n * For test artifact for a library project, this would also be an apk.\n *\n * @return the output file.\n */\n @NonNull\n File getOutputFile();\n}", "public static synchronized Result makeOutputFile(URI absoluteURI) throws XPathException {\n File newFile = new File(absoluteURI);\n try {\n if (!newFile.exists()) {\n File directory = newFile.getParentFile();\n if (directory != null && !directory.exists()) {\n directory.mkdirs();\n }\n newFile.createNewFile();\n }\n return new StreamResult(newFile);\n } catch (IOException err) {\n throw new XPathException(\"Failed to create output file \" + absoluteURI, err);\n }\n }", "protected void createHMetisOutFilePath() {\n\t\tString file = \"\";\n\t\tfile += \"TEMP_GRAPH_FILE.hgr.part.\";\n\t\tfile += this.getPartitioner().getPartition().getNumBlock();\n\t\tthis.setHMetisOutFile(file);\t\n\t}", "public void createOutput() {\n\t\tsetOutput(new Output());\n\t}", "@Test\n public void testCreateFilePath() {\n System.out.println(\"createFilePath with realistic path\");\n String path = System.getProperty(\"user.dir\")+fSeparator+\"MyDiaryBook\"\n +fSeparator+\"Users\"+fSeparator+\"Panagiwtis Georgiadis\"+fSeparator+\"Entries\"\n +fSeparator+\"Test1\";\n FilesDao instance = new FilesDao();\n boolean expResult = true;\n boolean result = instance.createFilePath(path);\n assertEquals(\"Some message\",expResult, result);\n }", "void createFile()\n {\n //Check if file already exists\n try {\n File myObj = new File(\"src/main/java/ex45/exercise45_output.txt\");\n if (myObj.createNewFile()) {\n System.out.println(\"File created: \" + myObj.getName());// created\n } else {\n System.out.println(\"File already exists.\"); //exists\n }\n //Error check\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n }", "private void assertOutputFiles(Path outputDir) throws Exception {\n\n assertThat(outputDir.exists()).isTrue();\n assertThat(outputDir.getRelative(REGULAR_FILE_NAME).exists()).isTrue();\n assertThat(outputDir.getRelative(REGULAR_FILE_NAME).getFileSize()).isNotEqualTo(0);\n assertThat(outputDir.getRelative(REGULAR_FILE_NAME).isSymbolicLink()).isFalse();\n assertThat(outputDir.getRelative(HARD_LINK_FILE_NAME).exists()).isTrue();\n assertThat(outputDir.getRelative(HARD_LINK_FILE_NAME).getFileSize()).isNotEqualTo(0);\n assertThat(outputDir.getRelative(HARD_LINK_FILE_NAME).isSymbolicLink()).isFalse();\n assertThat(outputDir.getRelative(RELATIVE_SYMBOLIC_LINK_FILE_NAME).exists()).isTrue();\n assertThat(outputDir.getRelative(RELATIVE_SYMBOLIC_LINK_FILE_NAME).getFileSize())\n .isNotEqualTo(0);\n assertThat(outputDir.getRelative(RELATIVE_SYMBOLIC_LINK_FILE_NAME).isSymbolicLink()).isTrue();\n assertThat(outputDir.getRelative(ABSOLUTE_SYMBOLIC_LINK_FILE_NAME).exists()).isTrue();\n assertThat(outputDir.getRelative(ABSOLUTE_SYMBOLIC_LINK_FILE_NAME).getFileSize())\n .isNotEqualTo(0);\n assertThat(outputDir.getRelative(ABSOLUTE_SYMBOLIC_LINK_FILE_NAME).isSymbolicLink()).isTrue();\n assertThat(\n Files.isSameFile(\n java.nio.file.Paths.get(outputDir.getRelative(REGULAR_FILE_NAME).toString()),\n java.nio.file.Paths.get(outputDir.getRelative(HARD_LINK_FILE_NAME).toString())))\n .isTrue();\n assertThat(\n Files.isSameFile(\n java.nio.file.Paths.get(outputDir.getRelative(REGULAR_FILE_NAME).toString()),\n java.nio.file.Paths.get(\n outputDir.getRelative(RELATIVE_SYMBOLIC_LINK_FILE_NAME).toString())))\n .isTrue();\n assertThat(\n Files.isSameFile(\n java.nio.file.Paths.get(outputDir.getRelative(REGULAR_FILE_NAME).toString()),\n java.nio.file.Paths.get(\n outputDir.getRelative(ABSOLUTE_SYMBOLIC_LINK_FILE_NAME).toString())))\n .isTrue();\n }", "protected void createHMetisInFilePath() {\n\t\tString file = \"\";\n\t\tfile += this.getRuntimeEnv().getOptionValue(PTArgString.OUTPUTDIR);\n\t\tfile += Utils.getFileSeparator();\n\t\tfile += \"TEMP_GRAPH_FILE.hgr\";\n\t\tthis.setHMetisInFile(file);\n\t}", "protected String getOutputFileParameter() {\n if (outputFile == null) {\n return null;\n }\n return \"/output=\" + outputFile.toString();\n }", "public File generateFile()\r\n {\r\n return generateFile(null);\r\n }", "public void outputToFile(String filemame)\n {\n }", "@Test\n public void testPlugin(@TempDir File outputDirectory) throws Exception {\n final String mappingsDirectoryPath = mappingsDir.getAbsolutePath();\n final String outputDirectoryPath = outputDirectory.getAbsolutePath();\n final var mojo =\n new GenerateCsvWritersFromDslMojo(mappingsDirectoryPath, outputDirectoryPath, project);\n mojo.execute();\n verify(project).addCompileSourceRoot(outputDirectoryPath);\n for (String outputFilePath : OUTPUT_FILE_PATHS) {\n compareFiles(expectedDir, outputDirectory, outputFilePath);\n }\n }", "public String getOutputPath()\n {\n return __m_OutputPath;\n }", "public String getOutputPath () \n\t{\n\t\treturn outputPathTextField.getText();\n\t}", "public String getOutputFile() {\n return outputFile;\n }", "@Override\n\t\t\tpublic Result createOutput(String ns, String file)\n\t\t\t\t\tthrows IOException {\n\t\t\t\tStreamResult res = new StreamResult(writer);\n\t\t\t\tres.setSystemId(\"no-id\");\n\t\t\t\treturn res;\n\t\t\t}", "public void setOutputFilePath(String outputFilePath) {\r\n this.outputFilePath = outputFilePath;\r\n }", "String getFileOutput();", "public String getOutputFile()\r\n {\n return \"\";\r\n }", "public String getOutputPath() {\n\t\treturn outputPath;\n\t}", "private void createRequiredDirectory(String outdir, String className) throws IOException\r\n\t{\n\t\tString workingdirectory = System.getProperty(\"user.dir\");\r\n\t\t\r\n\t\t//used to create directory\r\n\t\tscreenshotDir = new File(workingdirectory +\"/custom-test-report\");\r\n\t\tscreenshotDir.mkdir();\r\n\t\t\r\n\t\tscreenshotDir = new File(workingdirectory +\"/custom-test-report/Failure_Screenshot\");\r\n\t\tscreenshotDir.mkdir();\r\n\t\t\r\n\t\tscreenshotDir = new File(workingdirectory + \"/custom-test-report\" + \"/\" + className);\r\n\t\tscreenshotDir.mkdir();\r\n\t}", "@BeforeClass\n public static void createOutputDir() throws OfficeException {\n\n // Ensure we start with a fresh output directory\n final File outputDir = new File(OUTPUT_DIR);\n FileUtils.deleteQuietly(outputDir);\n outputDir.mkdirs();\n }", "@Test\r\n public void testCheckInput() throws Exception {\r\n System.out.println(\"checkInput\");\r\n System.out.println(\"test1\");\r\n String[] arguments = {\"1k2h3u\",\"test.txt\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\"};\r\n CommandLineArgumentParser instance =new CommandLineArgumentParser(arguments);\r\n String expResult = \"correct\";\r\n String result = instance.checkInput(arguments);\r\n assertEquals(expResult, result);\r\n \r\n System.out.println(\"test 2\");\r\n String[] arguments2 = {\"1k\",\"test.txt\",\"1\"};\r\n String expResult2 = \"correct\";\r\n String result2 = instance.checkInput(arguments2);\r\n assertEquals(expResult2, result2);\r\n \r\n System.out.println(\"test 3\");\r\n String[] arguments3 = {\"chat.txt\"};\r\n String expResult3 = \"correct\";\r\n String result3 = instance.checkInput(arguments3);\r\n assertEquals(expResult3, result3);\r\n \r\n System.out.println(\"test 4\");\r\n String[] arguments4 = {\"1k2h3u\",\"test.txt\",\"1\",\"2\",\"3\",\"4\",\"5\"};\r\n String expResult4 = \"Incorrect number of arguments\";\r\n String result4 = instance.checkInput(arguments4);\r\n assertEquals(expResult4, result4);\r\n \r\n System.out.println(\"test 5\");\r\n String[] arguments5 = {};\r\n String expResult5 = \"Need at least one argument with input file path\";\r\n String result5 = instance.checkInput(arguments5);\r\n assertEquals(expResult5, result5);\r\n }", "public static File createOutputFolder(String fileName, String analysisType) {\n\t\tProjectExplorerManager projExpMan = new ProjectExplorerManager();\n\t\t\n\t\tString dataFileName = fileName.replaceAll(\".csv\", \"\");\n\t\tString outputFolderPath = ((ProjectExplorerTreeNodeModel)projExpMan.getOutputFolder(ProjectExplorerView.projectTree).getData()).getProjectFile().getAbsolutePath();\n\t\tString newFolderName = getOutputFolderName(analysisType);\n\t\t\n\t\tFile outputFolder = new File(outputFolderPath+\"//\"+dataFileName+newFolderName);\n\t\tif(!outputFolder.exists()) outputFolder.mkdir();\n\t\t\n\t\treturn outputFolder;\n\t}", "public String getpathOutput() {\r\n\t\treturn pathOutput;\r\n\t}", "public String getOutPutFilePath(int startLine, int endLine) {\n\t\t// Create the entire filename\n\t\tString fileName=FILE_OUT_PATH+startLine + \"_\" + endLine+\".txt\";\t\n\t\treturn(fileName);\n\t}", "public void generateOutputLine(String outputLine, int index);", "public Builder outputFileName(String outputFileName) {\n this.outputFileName = outputFileName;\n return this;\n }", "public void testGetTargetFileName() throws Exception {\n System.out.println(\"getTargetFileName\");\n // server can be configured such that \n // the target directory name is not an empty value\n //String expResult = \"\";\n String result = instance.getTargetFileName();\n assertNotNull(result);\n \n }", "public String getOutputFileName() {\n return outputFileName.getText();\n }", "private void markOutputDirSuccessful(JobContext context) throws IOException {\r\n JobConf conf = context.getJobConf();\r\n // get the o/p path\r\n Path outputPath = FileOutputFormat.getOutputPath(conf);\r\n if (outputPath != null) {\r\n // get the filesys\r\n FileSystem fileSys = outputPath.getFileSystem(conf);\r\n // create a file in the output folder to mark the job completion\r\n Path filePath = new Path(outputPath, SUCCEEDED_FILE_NAME);\r\n fileSys.create(filePath).close();\r\n }\r\n }", "String getOutputName();", "private Writer createSequenceFileWriter(File outputPath) throws Exception {\n Configuration conf = new Configuration();\n org.apache.hadoop.fs.Path path = new org.apache.hadoop.fs.Path(outputPath.getAbsolutePath());\n\n CompressionCodec codec = getCompressionCodec();\n Writer.Option optPath = Writer.file(path);\n Writer.Option optKey = Writer.keyClass(keyConverter.getClassName());\n Writer.Option optValue = Writer.valueClass(valueConverter.getClassName());\n Writer.Option optCom = Writer.compression(compressionType, codec);\n\n return createWriter(conf, optPath, optKey, optValue, optCom);\n }", "public static void initializeOutputFolder() {\n\t\tString default_folder = PropertiesFile.getInstance().getProperty(\"default_folder\");\n\t\t\n\t\t// The file has to exist and is a directory (Not just a child file)\n\t\tString fullQualifiedFolderName = getFullyQualifiedFileName(default_folder);\n\t\tFile defaultDir = new File(fullQualifiedFolderName);\n\t\tif (!checkFolder(fullQualifiedFolderName)) {\n\t\t\tboolean dirCreated = defaultDir.mkdir();\n\t\t\tif(dirCreated == false) {\n\t\t\t\tlog.error(\"Could not create generation folder\");\n\t\t\t}\n\t\t} else\n\t\t\tdeleteFolderRecursively(defaultDir);\n\t}", "private static void prepareOutputFile() {\n try {\n outputFileBuffer = new BufferedWriter(new FileWriter(PATH+OUTPUT_FILE_NAME));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) throws IOException {\n\t\t\n\t\tFile file = new File(\"F:/Chandu/Test/Test1/Test2/Test3/Test4\");\n\t\t\n\t\t//create a directory\n\t\t\n\t\tboolean isFolderCreated =file.mkdirs();\n\t\t\n\t\tSystem.out.println(isFolderCreated);\n\t\t\n\t\t//get AbsolutePath\n\t\t\n\t\tString absolutePath =file.getAbsolutePath();\n\t\tSystem.out.println(absolutePath);\n\t\t\n\t\tString canonicalPath =file.getCanonicalPath();\n\t\tSystem.out.println(canonicalPath);\n\t\t\n\t\tboolean isDirectory =file.isDirectory();\n\t\t\n\t\tSystem.out.println(isDirectory);\n\t\t\n\t\t//how to create file\n\t\t\n\t\tFile file1 = new File(\"F:/Chandu/Test/abc.java\") ;\n\t\t\n\t\t//write data into file\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t}", "private static void checkArgsAndSetUp()\n {{\n File outDir= new File( arg_outDirname );\n\n if ( outDir.exists() ) {\n\t if ( !outDir.isDirectory() ) {\n\t System.err.println( PROGRAM_NAME+ \n\t\t\t\t\": output directory is not a directory; \"); \n\t System.err.println( \"\\t\"+ \"dir=\\\"\"+ arg_outDirname+ \"\\\", \" );\n\t System.err.println( \"\\t\"+ \"please specify an empty directory.\" );\n\t System.exit(-1);\n\t }\n\t if ( outDir.list().length > 0 ) {\n\t System.err.println( PROGRAM_NAME+ \n\t\t\t\t\": output directory is not empty; \"); \n\t System.err.println( \"\\t\"+ \"dir=\\\"\"+ arg_outDirname+ \"\\\", \" );\n\t System.err.println( \"\\t\"+ \"please specify an empty directory.\" );\n\t System.exit(-1);\n\t }\n } else {\n\t outDir.mkdir();\n }\n }}", "public interface TestRunnerGenerator {\n public void generateTestRunner(final String outputFolder);\n}", "void completedOutput(TestResult tr, Section section, String outputName);", "private PrintWriter createOutputFile(String outputFile) throws IOException {\n return new PrintWriter(new BufferedWriter(new FileWriter(outputFile)));\n }", "@Test\n\tpublic void testWriteToFile() {\n\t\tArrayList<ArrayList<String>> risultatoAnalisi = \n\t\t\t\tnew ArrayList<ArrayList<String>>();\n\t\toutput.setAnalysisResult(risultatoAnalisi);\n\t\tString percorso = \"\";\n\t\toutput.setOutputFileFolder(percorso);\n\t\ttry {\n\t\t\toutput.writeToFile();\n\t\t} catch (IOException e) {\n\t\t\tfail(\"Problem when writing to specified path.\");\n\t\t}\n\t\tassertTrue(new File(percorso + \"analysis.txt\").exists());\n\t\t/*\n\t\t * Ora passo un path corretto e controllo che venga creato il fiile\n\t\t */\n\t\tpercorso = \"test-dir\";\n\t\toutput.setOutputFileFolder(percorso);\n\t\ttry {\n\t\t\toutput.writeToFile();\n\t\t} catch (IOException e) {\n\t\t\tfail(\"Problem when writing to specified path.\");\n\t\t}\n\t\tassertTrue(new File(percorso + File.separator + \"analysis.txt\").exists());\n\t\t/*\n\t\t * Ripeto il test con valori da scrivere\n\t\t */\n\t\tArrayList<String> datiCasuali = new ArrayList<String>();\n\t\tdatiCasuali.add(\"27\");\n\t\trisultatoAnalisi.add(datiCasuali);\n\t\tdatiCasuali.add(\"12\");\n\t\trisultatoAnalisi.add(datiCasuali);\n\t\tdatiCasuali.add(\"3245543\");\n\t\trisultatoAnalisi.add(datiCasuali);\n\t\toutput.setAnalysisResult(risultatoAnalisi); \n\t\tpercorso = \"\";\n\t\toutput.setOutputFileFolder(percorso);\t\t\n\t\ttry {\n\t\t\toutput.writeToFile();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tfail(\"Problem when writing to specified path.\");\n\t\t}\n\t\tassertTrue(new File(percorso + \"analysis.txt\").exists());\n\t}", "public static String buildPathToTestOutputDir(String relpath) {\n return String.format(\"%s/src/test/resources/test_output/%s\", System.getProperty(\"user.dir\"), relpath);\n }", "public Output getOutput() {\n\t\treturn OutputFactory.of(outputFile.toPath());\n\t}", "@Test\n public void nonExistingApkPathReturnsNullAndPrintsMessage() {\n String[] inputArgs = new String[] {\"-i\", \"/path/\", \"-o\", \"/path/\", \"-a\", \"/wrong/\"};\n ArgumentReader sut = new ArgumentReader(inputArgs);\n\n Arguments args = sut.read();\n\n assertThat(args, nullValue());\n String message = File.separator + \"wrong is not found!\";\n assertThat(errContent.toString(), containsString(message));\n }", "public void setOutputFile(String outputFile) {\n this.outputFile = outputFile;\n }", "private File createDestinationFile() {\n\t\tSystem.out.print(\"Please enter the name of the output file that will be created to hold the modified/correct inventory: \");\n\t\tString fileName = sc.nextLine();\n\t\tFile file = new File(fileName);\n\t\twhile (file.exists()) {\n\t\t\tSystem.out.println(\"----->A file with the name of \\\"\" + fileName + \"\\\" [size = \" + file.length() + \" bytes; path = \" + file.getAbsolutePath() + \"] already exists.<-----\");\n\t\t\tSystem.out.print(\"Please input a new file name: \");\n\t\t\tfileName = sc.nextLine();\n\t\t\tfile = new File(fileName);\n\t\t}\n\t\treturn file;\n\t}", "public String getOutputPath(String inputPath) {\n String fileName;\n String ext = \"\";\n if (inputPath.indexOf(\".\") > 0) {\n int dotIndex = inputPath.lastIndexOf(\".\");\n fileName = inputPath.substring(0, dotIndex);\n ext = inputPath.substring(dotIndex, inputPath.length());\n } else {\n fileName = inputPath;\n }\n return fileName + \"_chk\" + ext;\n }", "@Test(dataProvider = \"getTemplatePathDP\")\n public void getTemplatePath(String converterName, String expectedTemplate) throws Exception {\n String expectedTemplatePath = tmp_output_builder_test.toString() + File.separator + expectedTemplate;\n Path expectedFile = Paths.get(expectedTemplatePath);\n Files.createDirectory(expectedFile.getParent());\n Files.createFile(expectedFile);\n\n doReturn(tmp_output_builder_test.toString()).when(sakuliProperties).getForwarderTemplateFolder();\n doReturn(converterName).when(testling).getConverterName();\n assertEquals(testling.getTemplatePath().toString(), expectedTemplatePath);\n }", "public void handleExistenceOfOutputFile(String outFileName) {\n if (!forceOverwrite)\n throwValidationException(\"File \\\"\" + outFileName\n + \"\\\" already exists. Use -f / --force-overwrite option to overwrite it.\", false);\n }", "public static void main(String[] args) {\n\t\tFile file = new File(\"test/a.txt\");\r\n\t\tFileUtil.createFile(file);\r\n\t\t/*if(! file.exists()){\r\n\t\t\ttry {\r\n\t\t\t\tSystem.out.println(file.getAbsolutePath());\r\n\t\t\t\tfile.createNewFile();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t*/\r\n\t}", "public boolean doTestFileInit(Properties p)\n {\n // Used for all tests; just dump files in outputDir\n File outSubDir = new File(outputDir);\n if (!outSubDir.mkdirs())\n {\n if (!outSubDir.exists())\n reporter.logErrorMsg(\"Problem creating output dir: \" + outSubDir);\n }\n // Initialize an output name manager to that dir with .out extension\n baseOutName = outputDir + File.separator + testName;\n outNames = new OutputNameManager(baseOutName, \".out\");\n\n String testBasePath = inputDir \n + File.separator;\n String goldBasePath = goldDir \n + File.separator;\n\n testFileInfo.inputName = testBasePath + \"Minitest.xsl\";\n testFileInfo.xmlName = testBasePath + \"Minitest.xml\";\n // Use separate output files for different versions, since \n // some indenting rules are implemented differently 1.x/2.x\n testFileInfo.goldName = goldBasePath + \"Minitest-xalanj2.out\";\n testFileInfo.description = \"General minitest, covers many xsl: elems\";\n\n paramFileInfo.inputName = testBasePath + \"MinitestParam.xsl\";\n paramFileInfo.xmlName = testBasePath + \"MinitestParam.xml\";\n paramFileInfo.goldName = goldBasePath + \"MinitestParam.out\";\n paramFileInfo.description = \"Simple string and int params\";\n\n perfFileInfo.inputName = testBasePath + \"MinitestPerf.xsl\";\n perfFileInfo.xmlName = testBasePath + \"MinitestPerf.xml\";\n perfFileInfo.goldName = goldBasePath + \"MinitestPerf.out\";\n perfFileInfo.description = \"Simple performance test\";\n\n try\n {\n // Clean up any Pass files for the minitest that exist\n //@see Reporter.writeResultsStatus(boolean)\n String logFileBase = (new File(testProps.getProperty(Logger.OPT_LOGFILE, \"ResultsSummary.xml\"))).getAbsolutePath();\n logFileBase = (new File(logFileBase)).getParent();\n\n File f = new File(logFileBase, Logger.PASS + \"-\" + testName + \".xml\");\n reporter.logTraceMsg(\"Deleting previous file: \" + f);\n f.delete();\n } \n catch (Exception e)\n {\n reporter.logThrowable(reporter.ERRORMSG, e, \"Deleting Pass-Minitest file threw\");\n reporter.logErrorMsg(\"Deleting Pass-Minitest file threw: \" + e.toString());\n }\n\n return true;\n }", "private static void checkBaseOutputPath(String outputPath) {\r\n\t\tif (outputPath.equals(MultiFileOutputFormat.PART)) {\r\n\t\t\tthrow new IllegalArgumentException(\"output name cannot be 'part'\");\r\n\t\t}\r\n\t}", "public String getOutputFilename() {\n\t\treturn outputFilename;\n\t}", "public String getOutputSubdir() {\n return m_optionalOutputSubDir;\n }", "private static String getOutputFilename(String pepXmlFilename)\r\n {\r\n if (null == pepXmlFilename)\r\n throw new IllegalArgumentException(\"pepXML file name can not be null\");\r\n if (pepXmlFilename.toLowerCase().endsWith(\".pep.xml\"))\r\n return pepXmlFilename.substring(0, pepXmlFilename.length()-8) + outputSuffix;\r\n else if (pepXmlFilename.toLowerCase().endsWith(\".xml\"))\r\n return pepXmlFilename.substring(0, pepXmlFilename.length()-4) + outputSuffix;\r\n else\r\n return pepXmlFilename + outputSuffix;\r\n }", "public String getFileNameOut() {\r\n\t\treturn fileNameOut;\r\n\t}", "static void createOutputStructure(final File dir) throws MojoExecutionException {\n if (!dir.exists() && !dir.mkdirs()) {\n throw new MojoExecutionException(\"could not create output directory \" + dir.getAbsolutePath());\n }\n }", "Path createPath();", "public String getOutPutFilePath() {\n\t\t// Create the entire filename\n\t\tString fileName=FILE_OUT_PATH+ FILENAME + \"NO_LINE_NUMBERS\" + \".txt\";\t\n\t\treturn(fileName);\n\t}", "@Test\n public void testAMWorkflow() throws Throwable {\n describe(\"Create a committer with a null output path & use as an AM\");\n JobData jobData = startJob(true);\n JobContext jContext = jobData.jContext;\n TaskAttemptContext tContext = jobData.tContext;\n\n TaskAttemptContext newAttempt = new TaskAttemptContextImpl(\n jContext.getConfiguration(),\n taskAttempt0);\n Configuration conf = jContext.getConfiguration();\n\n // bind\n TextOutputForTests.bind(conf);\n\n OutputFormat<?, ?> outputFormat\n = ReflectionUtils.newInstance(newAttempt.getOutputFormatClass(), conf);\n Path outputPath = FileOutputFormat.getOutputPath(newAttempt);\n Assertions.assertThat(outputPath)\n .as(\"null output path in new task attempt\")\n .isNotNull();\n\n ManifestCommitter committer2 = (ManifestCommitter)\n outputFormat.getOutputCommitter(newAttempt);\n committer2.abortTask(tContext);\n\n }", "public JobBuilder outputPath(String outputPath) {\r\n job.setOutputPath(outputPath);\r\n return this;\r\n }", "public void testOutput(String path, boolean debug) {\n\t\tString[] args;\n\t\tif (debug) {\n\t\t\targs = new String[] { \"debug\", path };\n\t\t} else {\n\t\t\targs = new String[] { path };\n\t\t}\n\t\tTypeFinder.main(args);\n\t\tString expectedErr = \"\";\n\t\t// Check that there is no error\n\t\tString actualErr = errContent.toString();\n\t\tassertEquals(expectedErr, actualErr);\n\t\t// Check standard output matches Output.txt file\n\t\tString expectedOut;\n\t\ttry {\n\t\t\tString header = FileManager.lineSeparator + \"Directory: \" + args[0] + FileManager.lineSeparator;\n\t\t\texpectedOut = header + FileManager.getFileContents(path.concat(OUTPUT_FILE));\n\t\t\tString actualOut = outContent.toString();\n\t\t\tassertEquals(expectedOut, actualOut);\n\t\t} catch (FileNotFoundException e) {\n\t\t\tfail(\"Output.txt cannot be found at \" + path);\n\t\t} catch (IOException e) {\n\t\t\trestoreStream();\n\t\t\te.printStackTrace();\n\t\t\tfail(\"You dun goofed.\");\n\t\t}\n\t}", "public void setOutputFilePath(String outputFilePath) {\n if (outputFilePath != null && !outputFilePath.trim().isEmpty()) {\n if (CONSOLE.equals(outputFilePath.toLowerCase())) {\n writer = new PrintWriter(System.out);\n } else {\n File outputFile = new File(outputFilePath);\n try {\n writer = new FileWriter(outputFile, false);\n } catch (IOException e) {\n if (LOG.isDebugEnabled()) {\n LOG.debug(e.getMessage(), e);\n } else {\n LOG.error(e.getMessage());\n }\n }\n }\n }\n }", "private String getOutputFileName() {\n String filename = VideoCapture.getSelf().getOutputFileName();\n return VideoCapture.getSelf().appDir.getPath()+\"/\"+filename+\".mp4\";\n }", "public String getPathFileOut() {\r\n\t\treturn pathFileOut;\r\n\t}", "private String getOutputFilename(JFrame anAppFrame)\n {\n String fn = \"\";\n\n // setup file chooser\n JFileChooser csvChooser = new JFileChooser();\n CSVFileFilter filter = new CSVFileFilter();\n csvChooser.setFileFilter(filter);\n\n // prompt user for output file\n int returnVal = csvChooser.showSaveDialog(anAppFrame);\n\n // process result\n if (returnVal == JFileChooser.APPROVE_OPTION)\n {\n fn = csvChooser.getSelectedFile().getPath();\n if (TRACE)\n System.out.println(\"DataGenModel: saving \" + fn);\n }\n return fn;\n }", "private static BufferedWriter createFileWriter(String filePath) {\n String[] pathComponents = filePath.split(\"/data/\");\n //to avoid heavy nesting in output, replace nested directory with filenames\n\n String output = pathComponents[0] + \"/out/rule_comparisons/\" + pathComponents[1].replace(\"/\",\"-\");\n\n File file = new File(output);\n try {\n //create file in this location if one does not exist\n if (!file.exists()) {\n file.createNewFile();\n }\n return new BufferedWriter(new FileWriter(file));\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public T caseOutputFile(OutputFile object) {\n\t\treturn null;\n\t}", "public void testGetExecutable_2()\n\t\tthrows Exception {\n\t\tFiles fixture = new Files();\n\t\tfixture.setAbsolutePath(\"\");\n\t\tfixture.setType(\"\");\n\t\tfixture.setReadable(\"\");\n\t\tfixture.setSize(\"\");\n\t\tfixture.setWritable(\"\");\n\t\tfixture.setExecutable(\"\");\n\t\tfixture.setMtime(\"\");\n\n\t\tString result = fixture.getExecutable();\n\n\t\t\n\t\tassertEquals(\"\", result);\n\t}", "private String getOutputFileName(JCas pJCas) {\n String returnValue = null;\n \n String name = getSourceName(pJCas);\n \n if ((this.outputProjectDirectorySaved.startsWith(\"/\")) || (this.outputProjectDirectorySaved.startsWith(\"\\\\\"))\n || (this.outputProjectDirectorySaved.indexOf(\":\") == 1))\n returnValue = this.outputProjectDirectorySaved + \"/\" + name + \".txt.knowtator.xml\";\n else\n returnValue = this.homeDir + \"/\" + this.eHostWorkSpaceName + \"/\" + this.projectName + \"/saved/\" + name\n + \".txt.knowtator.xml\";\n \n return returnValue;\n }", "@Produces\n\tpublic Path produceFile() throws IOException{\n\t\tlogger.info(\"The path (generated by PathProducer) will be injected here - # Path : \"+path);\n\t\tif(Files.notExists(path)){\n\t\t\tFiles.createDirectory(path);\n\t\t\tlogger.info(\" Directory Created :: \" +path);\n\t\t}\n\t\t/*\n\t\t * currentTimeMillis will be injected by NumberPrefixProducer and has a seperate qualifier\n\t\t */\n\t\tPath file = path.resolve(\"myFile_\" + currentTimeMillis + \".txt\");\n\t\tlogger.info(\"FileName : \"+file);\n\t\tif(Files.notExists(file)){\n\t\t\tFiles.createFile(file);\n\t\t}\n\t\tlogger.info(\" File Created :: \" +file);\n\t\treturn file;\n\t}", "public void setOutputFile(File params) {\n outputFile = params;\n }", "@Test\n public void testOutputDelimited() throws Throwable {\n testOutputDelimited(false);\n }", "@Test\n void fileWriter() {\n\n\n ArrayList<String> fileLines = Name_Sorter.fileRead(this.readFile, \"src/main/java/oop/assignment3/ex41/base/testFile-ex41\");\n Collections.sort(fileLines);\n this.writeFile = Name_Sorter.fileWriter(this.writeFile, fileLines, \"src/main/java/oop/assignment3/ex41/base/ex41-testOutputFile.txt\");\n boolean actualOutput = this.writeFile != null;\n Assertions.assertTrue(actualOutput);\n }", "@Execute\n public Value<String> action(\n //Idx 1 would be displayed first, with a text box for entering the value.\n @Idx(index = \"1\", type = FILE)\n //UI labels.\n @Pkg(label = \"[[DOCXtoPDF.inputFile.label]]\")\n //Force PDF selection\n @FileExtension(\"docx\")\n //Ensure that a validation error is thrown when the value is null.\n @NotEmpty\n String inputFile,\n\n //Set Optional Export Dir\n @Idx(index = \"2\", type = TEXT)\n @Pkg(label = \"[[DOCXtoPDF.outputLocation.label]]\", description = \"[[DOCXtoPDF.outputLocation.description]]\")\n String outputPath) {\n\n //Internal validation, to disallow empty strings. No null check needed as we have NotEmpty on firstString.\n if (\"\".equals(inputFile.trim()))\n throw new BotCommandException(\"Please select a valid file for processing.\");\n\n if(!inputFile.toUpperCase().endsWith(\".DOCX\")){\n throw new BotCommandException(\"Please select a supported file to continue\");\n }\n\n //Business logic\n try{\n //Get file name to add to custom path\n Path path = Paths.get(inputFile);\n Path fileName = path.getFileName();\n String fileNameWithoutExt = \"\";\n if (fileName.toString().toUpperCase().endsWith(\".DOCX\")) {\n fileNameWithoutExt = fileName.toString().replaceAll(\"(?).docx\", \"\");\n }\n\n //Check if output path is same as input or custom\n if(outputPath.equals(null) || outputPath.equals(\"\")){\n //Same as input Path - just remove the file name itself\n outputPath = inputFile.replace(fileName.toString(), \"\");\n }else{\n //Custom Path\n //Make sure it ends in a slash\n if (!outputPath.endsWith(\"\\\\\") && outputPath.contains(\"\\\\\")){\n outputPath = outputPath + \"\\\\\";\n }else if(!outputPath.endsWith(\"/\") && outputPath.contains(\"/\")){\n outputPath = outputPath + \"/\";\n }\n }\n\n //Create file directories if they dont already exist\n Files.createDirectories(Paths.get(outputPath));\n\n //Set full path with file name\n outputPath = outputPath + fileNameWithoutExt + \".pdf\";\n\n InputStream inputStream = new FileInputStream(inputFile);\n OutputStream outputStream = new FileOutputStream(outputPath);\n IConverter converter = LocalConverter.builder().build();\n converter.convert(inputStream).as(DocumentType.DOCX).to(outputStream).as(DocumentType.PDF).execute();\n outputStream.close();\n System.out.println(\"Success!\");\n converter.shutDown();\n\n } catch (Exception e) {\n throw new BotCommandException(\"Error occurred during file conversion. Error code: \" + e.toString());\n }\n\n //Return StringValue.\n return new StringValue(outputPath);\n }", "public String outputFileDir() {\n return outputFileDir;\n }", "public String outputFileName() {\n return outputFileName;\n }" ]
[ "0.6269155", "0.62538016", "0.61790156", "0.6000293", "0.5999795", "0.5980241", "0.5939752", "0.5849184", "0.5709826", "0.55870533", "0.55534226", "0.55296856", "0.5522623", "0.55176675", "0.5514343", "0.5508993", "0.54581726", "0.54474366", "0.5426738", "0.5406867", "0.53619355", "0.5352889", "0.53381044", "0.5335666", "0.53249437", "0.5323812", "0.529807", "0.52980083", "0.52831537", "0.52704614", "0.5265269", "0.5255654", "0.5238433", "0.52330065", "0.52321786", "0.52261347", "0.5217378", "0.52152574", "0.52021486", "0.5200946", "0.51769847", "0.51761395", "0.5174448", "0.51744133", "0.5173746", "0.51636624", "0.51329654", "0.51311", "0.51273113", "0.5123662", "0.510163", "0.5095428", "0.5094763", "0.5086068", "0.50669324", "0.50650376", "0.5056375", "0.5054245", "0.50510544", "0.50387627", "0.50365824", "0.5026821", "0.5024879", "0.50181067", "0.49944037", "0.49768808", "0.4973684", "0.4970362", "0.49614474", "0.49580613", "0.4953265", "0.49510637", "0.49442637", "0.49407172", "0.49331445", "0.49249104", "0.4921371", "0.4921169", "0.49015918", "0.48974437", "0.48947906", "0.48934102", "0.48871765", "0.4885647", "0.4881912", "0.48811954", "0.4876966", "0.48746634", "0.48693153", "0.48662782", "0.48654956", "0.4864824", "0.48637292", "0.48604414", "0.48544404", "0.4846352", "0.48437762", "0.48435503", "0.48392794", "0.48382002" ]
0.81863743
0
Test of checkInput method, of class CommandLineArgumentParser.
@Test public void testCheckInput() throws Exception { System.out.println("checkInput"); System.out.println("test1"); String[] arguments = {"1k2h3u","test.txt","1","2","3","4","5","6"}; CommandLineArgumentParser instance =new CommandLineArgumentParser(arguments); String expResult = "correct"; String result = instance.checkInput(arguments); assertEquals(expResult, result); System.out.println("test 2"); String[] arguments2 = {"1k","test.txt","1"}; String expResult2 = "correct"; String result2 = instance.checkInput(arguments2); assertEquals(expResult2, result2); System.out.println("test 3"); String[] arguments3 = {"chat.txt"}; String expResult3 = "correct"; String result3 = instance.checkInput(arguments3); assertEquals(expResult3, result3); System.out.println("test 4"); String[] arguments4 = {"1k2h3u","test.txt","1","2","3","4","5"}; String expResult4 = "Incorrect number of arguments"; String result4 = instance.checkInput(arguments4); assertEquals(expResult4, result4); System.out.println("test 5"); String[] arguments5 = {}; String expResult5 = "Need at least one argument with input file path"; String result5 = instance.checkInput(arguments5); assertEquals(expResult5, result5); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testGetInputArguments() {\n List<String> args = mb.getInputArguments();\n assertNotNull(args);\n for (String string : args) {\n assertNotNull(string);\n assertTrue(string.length() > 0);\n }\n }", "protected abstract boolean checkInput();", "public boolean checkInput();", "public abstract boolean verifyInput();", "private void checkUserInput() {\n }", "@Test(expectedExceptions=InvalidArgumentValueException.class)\n public void argumentValidationTest() {\n String[] commandLine = new String[] {\"--value\",\"521\"};\n\n parsingEngine.addArgumentSource( ValidatingArgProvider.class );\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n\n ValidatingArgProvider argProvider = new ValidatingArgProvider();\n parsingEngine.loadArgumentsIntoObject( argProvider );\n\n Assert.assertEquals(argProvider.value.intValue(), 521, \"Argument is not correctly initialized\");\n\n // Try some invalid arguments\n commandLine = new String[] {\"--value\",\"foo\"};\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n }", "@Override\n\tpublic boolean checkInput() {\n\t\treturn true;\n\t}", "private void validateInputParameters(){\n\n }", "@Override\r\n public boolean isValidCommandLine(String inputLine) {\r\n String strippedLine = inputLine.strip();\r\n String[] tokens = strippedLine.split(\" \", -1);\r\n int flagIndex = findFlagIndex(tokens);\r\n\r\n if (flagIndex == NOT_FOUND) {\r\n return false;\r\n }\r\n\r\n String[] argumentTokens = Arrays.copyOfRange(tokens, 1, flagIndex);\r\n String[] flagTokens = Arrays.copyOfRange(tokens, flagIndex + 1, tokens.length);\r\n\r\n String argumentValue = String.join(\" \", argumentTokens);\r\n String flagValue = String.join(\" \", flagTokens);\r\n\r\n boolean isStartWithCommand = strippedLine.startsWith(super.getCommand() + \" \");\r\n boolean isNonEmptyArgument = argumentValue.length() > 0;\r\n boolean isNonEmptyFlag = flagValue.length() > 0;\r\n\r\n return isStartWithCommand && isNonEmptyArgument && isNonEmptyFlag;\r\n }", "private boolean isValidInput() {\n\t\treturn true;\n\t}", "private static String[] checkInput(String input) throws Exception{\n String[] in = input.trim().split(\" \");\n\n if(in.length == 0){\n throw new CommandException(ExceptionEnum.INCORRECT_COMMAND_EXCEPTION);\n }\n\n if(CommandEnum.getCommandEnumFrom(in[0]) == null){\n throw new CommandException(ExceptionEnum.INCORRECT_COMMAND_EXCEPTION);\n }\n\n if(isSpecificCommandENum(in[0],BYE)){\n return in;\n }\n if(isSpecificCommandENum(in[0],TERMINATE)){\n return in;\n }\n\n if(in.length < MIN_PARAM){\n throw new CommandException(ExceptionEnum.LESS_INPUT_EXCEPTION);\n }\n\n if(in.length > MAX_PARAM){\n throw new CommandException(ExceptionEnum.EXTRA_INPUT_EXCEPTION);\n }\n\n //check input value\n for(int i = 1; i < in.length; i++){\n try{\n Integer.parseInt(in[i]);\n }catch(NumberFormatException e){\n throw new CommandException(ExceptionEnum.INVALID_INPUT_EXCEPTION);\n }\n }\n\n return in;\n }", "@Override\n public String getInputArg(String argName) {\n Log.w(TAG, \"Test input args is not supported.\");\n return null;\n }", "@Test\n\tpublic void forInputChecker() {\n\t\tchar charTest = 'c';\n\t\tboolean result = false;\n\t\ttry {\n\t\t\tresult = object1.inputChecker(charTest);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tboolean ExpectedResult = true;\n\t\tassertEquals(ExpectedResult, result);\n\n\t}", "@Test\n public void wrongArgumentsReturnsNullAndPrintsMessage() {\n String[] inputArgs = new String[] {\"-i\", \"/path/\"};\n ArgumentReader sut = new ArgumentReader(inputArgs);\n\n Arguments args = sut.read();\n\n assertThat(args, nullValue());\n assertThat(errContent.toString(), containsString(\"must be provided!\"));\n assertThat(errContent.toString(), containsString(\"Usage:\"));\n }", "private void inputValidation(String[] args) {\r\n\t\t// Must have two argument inputs - grammar and sample input\r\n\t\tif (args.length != 2) {\r\n\t\t\tSystem.out.println(\"Invalid parameters. Try:\\njava Main <path/to/grammar> <path/to/input>\");\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "protected abstract boolean isInputValid();", "@Override\n public boolean checkInput(String xmlid,XMLParameter env, Map input, Map output, Map config) throws Exception {\n return true;\n }", "protected abstract int isValidInput();", "private void argumentChecker(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tif (args.length != 2) {\n\t\t\tSystem.out.println(\"Invalid arguments. \\nExpected:\\tDriver inputFile.txt outputFile.txt\");\n\t\t}\n\t}", "private static void verifyArgs()\r\n\t{\r\n\t\tif(goFile == null)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"Error: you must specify an input GO file.\");\r\n\t\t\texitError();\r\n\t\t}\r\n\t\tif(annotFile == null)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"Error: you must specify an input annotation file.\");\r\n\t\t\texitError();\r\n\t\t}\r\n\t\tif(goSlimFile == null)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"Error: you must specify an input GOslim file.\");\r\n\t\t\texitError();\r\n\t\t}\r\n\t\tif(slimAnnotFile == null)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"Error: you must specify an output file.\");\r\n\t\t\texitError();\r\n\t\t}\r\n\t}", "@Test\r\n public void Test004TakeUserInputValid()\r\n {\r\n gol.input = new Scanner(new ByteArrayInputStream(\"1 1 2 2 2 3 2 4 -1\".getBytes()));\r\n gol.takeUserInput();\r\n assertTrue(gol.grid[1][1] == 1 && gol.grid[2][2] == 1 && gol.grid[2][3] == 1 && gol.grid[2][4] == 1);\r\n }", "protected abstract boolean isInputValid(@NotNull ConversationContext context, @NotNull String input);", "private static boolean validateInput1(String[] input) {\n\t\tif (input.length != 1) {\n\t\t\tSystem.out.println(ErrorType.UNKNOWN_COMMAND);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public void verifyArgs(ArrayList<String> args) throws ArgumentFormatException {\n super.checkNumArgs(args);\n _args = true;\n }", "public interface ArgumentValidator {\n boolean areArgumentsValid(String[] arguments);\n boolean configDirectoryExists(String configDirectory);\n boolean keyValuePairDirectoryExists(String keyValuePairDirectory);\n boolean configDirectoryContainsTemplateFiles(String configDirectory);\n boolean keyValuePairDirectoryContainKeyValuePairFiles(String keyValuePairDirectory);\n\n\n}", "public void processInput(CommandLineInput commandLineInput) {\n\t\t\n\t}", "public abstract ValidationResults validArguments(String[] arguments);", "public ApplicationInputResult processInput(String[] args) {\n List<String> invalidInputs = new ArrayList<>();\n CommandLine clp;\n try {\n // Use the CLI parser to help us parse the input\n clp = new DefaultParser().parse(ALL_INPUT_OPTIONS, args);\n String payrollFile = null;\n if (clp.hasOption(FILE_INPUT_OPTION.getOpt())) {\n payrollFile = clp.getOptionValue(FILE_INPUT_OPTION.getOpt());\n }\n // Let's make sure we got a file\n if (!StringUtils.isBlank(payrollFile)) {\n return new ApplicationInputResult(payrollFile); // all good\n } else {\n invalidInputs.add(FILE_INPUT_OPTION.getOpt()); // add this missing argument to the result\n }\n } catch (MissingOptionException e) {\n LOGGER.error(\"The required arguments {} were missing\", e.getMissingOptions());\n List<?> missingOptions = e.getMissingOptions();\n missingOptions.forEach( missingOption -> invalidInputs.add(missingOption.toString()));\n } catch (MissingArgumentException e) {\n LOGGER.error(\"The required argument [{}] is missing its value\", e.getOption().getOpt());\n invalidInputs.add(e.getOption().getOpt());\n } catch (ParseException pe) {\n LOGGER.error(\"An exception occurred while parsing command line read of arguments: {}{}\", Arrays.toString(args), pe);\n }\n return new ApplicationInputResult(invalidInputs);\n }", "private static void checkPassedInArguments(String[] args, EquationManipulator manipulator) {\n // Convert arguments to a String\n StringBuilder builder = new StringBuilder();\n for (String argument: args) {\n builder.append(argument + \" \");\n }\n \n // check if equation is valid\n String[] equation = manipulator.getEquation(builder.toString());\n if (equation.length == 0) {\n // unable to parse passed in arguments\n printErrorMessage();\n handleUserInput(manipulator);\n } else {\n // arguments were passed in correctly\n System.out.println(\"Wohoo! It looks like everything was passed in correctly!\"\n + \"\\nYour equation is: \" + builder.toString() + \"\\n\");\n handleArguments(equation, manipulator);\n }\n }", "@Override\r\n\tpublic String execute(File workingDir, String stdin) {\r\n\t\tboolean checkCase = true;\r\n\t\tint skippedFieldCount = 0;\r\n\t\tArrayList<String> operands = new ArrayList<String>();\r\n\r\n\t\tif (args == null) {\r\n\t\t\treturn getUnique(checkCase, stdin);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < args.length; i++) {\r\n\t\t\tString arg = args[i];\r\n\r\n\t\t\t// Check for extra operands\r\n\t\t\tif (operands.size() >= 2) {\r\n\t\t\t\tsetStatusCode(ERR_CODE_EXTRA_OPERAND);\r\n\t\t\t\treturn String.format(ERR_MSG_EXTRA_OPERAND, arg);\r\n\t\t\t}\r\n\r\n\t\t\t// Check for valid file\r\n\t\t\tif (!arg.startsWith(\"-\")) {\r\n\t\t\t\tFile file = new File(arg);\r\n\r\n\t\t\t\t// Check if filePath is relative to working dir (i.e. not absolute path)\r\n\t\t\t\t// If it is we make the file relative to working dir.\r\n\t\t\t\tif (!file.isAbsolute() && workingDir.exists()) {\r\n\t\t\t\t\tfile = new File(workingDir, arg);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (operands.size() == 0 && !file.exists()) {\r\n\t\t\t\t\tsetStatusCode(ERR_CODE_FILE_NOT_FOUND);\r\n\t\t\t\t\treturn String.format(ERR_MSG_FILE_NOT_FOUND, arg);\r\n\t\t\t\t}\r\n\t\t\t\toperands.add(file.toString());\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for stdin argument\r\n\t\t\tif (arg.equals(\"-\")) {\r\n\t\t\t\toperands.add(arg);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// Option argument\r\n\t\t\tswitch (arg) {\r\n\t\t\tcase \"-i\":\r\n\t\t\t\tcheckCase = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"-f\":\r\n\t\t\t\tif (i + 1 >= args.length) {\r\n\t\t\t\t\tsetStatusCode(ERR_CODE_MISSING_OPTION_ARG);\r\n\t\t\t\t\treturn String.format(ERR_MSG_MISSING_OPTION_ARG, arg);\r\n\t\t\t\t}\r\n\r\n\t\t\t\ti += 1;\r\n\t\t\t\targ = args[i];\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tskippedFieldCount = Integer.parseInt(arg);\r\n\t\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\t\tsetStatusCode(ERR_CODE_INVALID_NUM_OF_FIELDS);\r\n\t\t\t\t\treturn String.format(ERR_MSG_INVALID_NUM_OF_FIELDS, arg);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"-help\":\r\n\t\t\t\treturn getHelp();\r\n\t\t\tdefault:\r\n\t\t\t\tsetStatusCode(ERR_CODE_INVALID_OPTION);\r\n\t\t\t\treturn String.format(ERR_MSG_INVALID_OPTION, arg);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString input;\r\n\t\tif (operands.size() == 0 || operands.get(0).equals(\"-\")) {\r\n\t\t\tinput = stdin;\r\n\t\t} else {\r\n\t\t\tinput = readFile(operands.get(0), Charset.forName(\"UTF8\"));\r\n\t\t}\r\n\r\n\t\tString output;\r\n\t\tif (skippedFieldCount == 0) {\r\n\t\t\toutput = getUnique(checkCase, input);\r\n\t\t} else {\r\n\t\t\toutput = getUniqueSkipNum(skippedFieldCount, checkCase, input);\r\n\t\t}\r\n\r\n\t\t// Check if the user specify an output file\r\n\t\tif (operands.size() > 1) {\r\n\t\t\tString outputFilePath = operands.get(1);\r\n\r\n\t\t\tif (!outputFilePath.equals(\"-\")) {\r\n\t\t\t\t// Output is redirected to file\r\n\t\t\t\twriteToFile(outputFilePath, output);\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}", "@Test public void gracefullyEndsForEmptyInputs() {\n\t\tAssert.assertNotNull(parser.parse(new String[0], new CliOptions()));\n\t}", "@Test\n\tpublic void secindForInputChecker() {\n\t\tchar charTest = 'c';\n\t\tboolean result = false;\n\t\ttry {\n\t\t\tresult = object1.inputChecker(charTest);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tboolean ExpectedResult = true;\n\t\tassertEquals(ExpectedResult, result);\n\n\t}", "private boolean isInputValid() {\n return true;\n }", "@Test\n\tpublic void execute() throws Exception {\n\t\tassertTrue(argumentAnalyzer.getFlags().contains(Context.CHECK.getSyntax()));\n\t}", "private boolean parseArguments(String input) {\r\n\t\tString arguments[] = input.split(\" \");\r\n\t\tif (arguments.length == TWO_ARGUMENTS) {\r\n\t\t\tmailbox = arguments[ARRAY_SECOND_ELEMENT].trim();\r\n\t\t\tpassword = arguments[ARRAY_THIRD_ELEMENT].trim();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\t\t\r\n\t}", "@Test\n public void correctArgumentsReturnsArguments() {\n String projectPath = \"/pathI/\";\n String resultPath = \"/pathO/\";\n String apkPath = apkFile.getAbsolutePath();\n String filtersPath = filterFile.getAbsolutePath();\n String[] inputArgs = new String[] {\"-i\", projectPath, \"-o\", resultPath, \n \"-a\", apkPath, \"-f\", filtersPath};\n ArgumentReader sut = new ArgumentReader(inputArgs);\n\n Arguments args = sut.read();\n\n assertThat(args, notNullValue());\n assertThat(args.getProjectPath(), equalTo(projectPath));\n assertThat(args.getResultPath(), equalTo(resultPath));\n assertThat(args.getApkFilePath(), equalTo(apkPath));\n assertThat(args.getFiltersPath(), equalTo(filtersPath));\n }", "private boolean isInValidInput(String input) {\n\n\t\tif (input == null || input.isEmpty())\n\t\t\treturn true;\n\n\t\tint firstPipeIndex = input.indexOf(PARAM_DELIMITER);\n\t\tint secondPipeIndex = input.indexOf(PARAM_DELIMITER, firstPipeIndex + 1);\n\n\t\t/*\n\t\t * if there are no PARAM_DELIMITERs or starts with a PARAM_DELIMITER\n\t\t * (Meaning command is missing) or only single PARAM_DELIMITER input is\n\t\t * not valid\n\t\t */\n\t\tif (firstPipeIndex == -1 || firstPipeIndex == 0 || secondPipeIndex == -1)\n\t\t\treturn true;\n\n\t\t// Means package name is empty\n\t\tif (secondPipeIndex - firstPipeIndex < 2)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "private static boolean validateInput2(String[] input) {\n\t\tif (input.length != 2) {\n\t\t\tSystem.out.println(ErrorType.UNKNOWN_COMMAND);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "Optional<String> validate(String command, List<String> args);", "@Test\n public void testArguments() {\n System.out.println(\"arguments\");\n assertThat(Arguments.valueOf(\"d\"), is(notNullValue()));\n assertThat(Arguments.valueOf(\"i\"), is(notNullValue()));\n assertThat(Arguments.valueOf(\"num\"), is(notNullValue()));\n }", "@Override\n public Map<String, String> getInputArgs() {\n Log.w(TAG, \"Test input args is not supported.\");\n return new HashMap<>();\n }", "@Override\n protected boolean parseArguments(String argumentInput) {\n Objects.requireNonNull(argumentInput, LegalityCheck.INPUT_ARGUMENT_NULL_MESSAGE);\n\n switch (argumentInput) {\n\n case LIST_COMMAND_OPTION_EMPTY:\n case LIST_COMMAND_OPTION_SHORT:\n this.savedOption = ListCommandOptions.SHORT;\n return true;\n\n case LIST_COMMAND_OPTION_LONG:\n this.savedOption = ListCommandOptions.LONG;\n return true;\n\n default:\n return false;\n }\n }", "private static void validateInputArguments(String args[]) {\n\n\t\tif (args == null || args.length != 2) {\n\t\t\tthrow new InvalidParameterException(\"invalid Parameters\");\n\t\t}\n\n\t\tString dfaFileName = args[DFA_FILE_ARGS_INDEX];\n\t\tif (dfaFileName == null || dfaFileName.trim().isEmpty()) {\n\t\t\tthrow new InvalidParameterException(\"Invalid file name\");\n\t\t}\n\n\t\tString delimiter = args[DELIMITER_SYMBOL_ARGS_INDEX];\n\t\tif (delimiter == null || delimiter.trim().isEmpty()) {\n\t\t\tthrow new InvalidParameterException(\"Invalid delimiter symbol\");\n\t\t}\n\t}", "public static void main( String[] args ) throws IOException {\n InputStreamReader reader =\n new InputStreamReader( System.in, StandardCharsets.UTF_8 );\n BufferedReader in = new BufferedReader( reader );\n String line;\n while ( ( line = in.readLine() ) != null ) {\n String print;\n if ( isValid( line ) ) {\n print = \"True\";\n } else {\n print = \"False\";\n }\n System.out.println( print );\n }\n }", "private void inputHandle(String[] arguments) {\n\t\tif (arguments.length != 1)\n\t\t\tSystem.err.println(\"There needs to be one argument:\\n\"\n\t\t\t\t\t+ \"directory of training data set, and test file name.\");\n\t\telse {\t\t\t\n\t\t\tinputTestFile = arguments[0];\n\t\t}\n\t}", "private static void validateCommandLineArguments(AutomationContext context, String extendedCommandLineArgs[])\r\n\t{\r\n\t\t//fetch the argument configuration types required\r\n\t\tCollection<IPlugin<?, ?>> plugins = PluginManager.getInstance().getPlugins();\r\n \t\tList<Class<?>> argBeanTypes = plugins.stream()\r\n\t\t\t\t.map(config -> config.getArgumentBeanType())\r\n\t\t\t\t.filter(type -> (type != null))\r\n\t\t\t\t.collect(Collectors.toList());\r\n\t\t\r\n\t\targBeanTypes = new ArrayList<>(argBeanTypes);\r\n\t\t\r\n\t\t//Add basic arguments type, so that on error its properties are not skipped in error message\r\n\t\targBeanTypes.add(AutoxCliArguments.class);\r\n\r\n\t\t//if any type is required creation command line options and parse command line arguments\r\n\t\tCommandLineOptions commandLineOptions = OptionsFactory.buildCommandLineOptions(argBeanTypes.toArray(new Class<?>[0]));\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tcommandLineOptions.parseBeans(extendedCommandLineArgs);\r\n\t\t} catch(MissingArgumentException e)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"Error: \" + e.getMessage());\r\n\t\t\tSystem.err.println(commandLineOptions.fetchHelpInfo(COMMAND_SYNTAX));\r\n\t\t\tSystem.exit(-1);\r\n\t\t} catch(Exception ex)\r\n\t\t{\r\n\t\t\tex.printStackTrace();\r\n\t\t\tSystem.err.println(commandLineOptions.fetchHelpInfo(COMMAND_SYNTAX));\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "@Override\n\tprotected void isValid(String input) throws DataInputException\n\t{\n\t}", "@Test\n public void TestIlegalCorrectInputCheck(){\n Assert.assertEquals(player.CorrectInputCheck(\"horisonaz\",5,1,1)\n ,false , \" check horisontal spelling\"\n );\n\n //illegal : check vertical\n Assert.assertEquals(player.CorrectInputCheck(\"verticles\",5,1,1)\n ,false , \" check vertical spelling\"\n );\n\n //illegal : place a 5 ship horisontal at 0,1 outside of the grid\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,0,1)\n ,false,\" illegal : place a 5 ship horisontal at 0,1 outside of the grid \"\n );\n\n // illegal : place a 5 ship horisontal at 1,0 outside of the grid\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,1,0)\n ,false, \" illegal : place a 5 ship horisontal at 1,0 outside of the grid \"\n );\n\n // illegal : place a 5 ship horisontal at 7,1 ship is to big it goes outside the grid\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,7,1)\n ,false , \" illegal : place a 5 ship horisontal at 7,1 outside of the grid \"\n );\n\n // illegal : place a 5 ship horisontal at 1,10\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,1,7)\n ,false , \" illegal : place a 5 ship horisontal at 1,7 outside of the grid \"\n );\n\n\n }", "@Override\n public ValidationResults validArguments(String[] arguments) {\n final int MANDATORY_NUM_OF_ARGUMENTS = 1;\n if (arguments.length == MANDATORY_NUM_OF_ARGUMENTS) {\n // Check if CommandMAN was called on itself (Checker doesn't need to\n // validate CommandMAN twice).\n if (arguments[0].equals(this.getCommandName())) {\n this.toDocument = this; // man will document itself.\n } else {\n // Man will document this command object.\n try {\n this.toDocument = Checker.getCommand(arguments[0], true);\n } catch (Exception ex) {\n return new ValidationResults(false, \"No manual entry for \"\n + arguments[0]); // CMD does not exist.\n }\n }\n return new ValidationResults(true, null);\n }\n return new ValidationResults(false, \"Requires \"\n + MANDATORY_NUM_OF_ARGUMENTS + \" argument.\");\n }", "public static void commandLineOptionValidator(CommandLine commandLine) {\n\n if (!commandLine.hasOption(ENV)) {\n throw new RuntimeException(\"Environment value is not provided\");\n }\n\n try {\n Env.valueOf(commandLine.getOptionValue(ENV).toUpperCase());\n } catch (IllegalArgumentException e) {\n throw new RuntimeException(\"Environment value is not valid\" +\n e.getMessage());\n }\n\n if (!commandLine.hasOption(CommandLineParamConstants.JOB_TYPE)) {\n throw new RuntimeException(\"JobType value is not provided\");\n }\n\n if (!commandLine.hasOption(CommandLineParamConstants.SOURCE_FILE_TYPE)) {\n throw new RuntimeException(\"fileType value is not provided\");\n }\n\n if (!commandLine.hasOption(CommandLineParamConstants.SOURCE_PATH)) {\n throw new RuntimeException(\"sourcePath value is not provided\");\n }\n }", "private void checkMandatoryArguments() throws ArgBoxException {\n\t\tfinal List<String> errors = registeredArguments.stream()\n\t\t\t\t.filter(arg -> arg.isMandatory())\n\t\t\t\t.filter(arg -> !parsedArguments.containsKey(arg))\n\t\t\t\t.map(arg -> String.format(\"The argument %1s is required !\", arg.getLongCall()))\n\t\t\t\t.collect(Collectors.toList());\n\t\tthrowException(() -> !errors.isEmpty(), getArgBoxExceptionSupplier(\"Some arguments are missing !\", errors));\n\t}", "public void validate(String[] argsIn) {\n\n\t\tif (argsIn.length > 1 || null == argsIn) {\n\t\t\tSystem.err.println(\"Arguments passed were either less/more than expected!\\nThe program can accepts 1 arguments.\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tif(argsIn.length != 1 || argsIn[0].equals(\"${arg0}\") || (Integer.parseInt(argsIn[0]) > 2)) {\n\t\t\tSystem.err.println(\"Debug arguments can take values from 0-2\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tbuildInput(argsIn);\n\t\tif (argsIn.length == 1) {\n\t\t\tint debugValue = 0;\n\t\t\ttry {\n\t\t\t\tdebugValue = Integer.parseInt(argsIn[0]);\n\t\t\t\tMyLogger.setDebugValue(debugValue);\n\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tSystem.out.println(\"Error while parsing debug level value\");\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void testTooManyInput(){\n //set up\n CurrencyRates test = new CurrencyRates();\n\n //add sample user input\n InputStream in = new ByteArrayInputStream(\"ABC123 BCD234 WER456 FDG435\".getBytes());\n System.setIn(in);\n\n //test if system exits when user input is incorrect\n assertNull(test.takeInput());\n\n return;\n }", "void validate(final WriteableCommandLine commandLine)\n throws OptionException;", "@Test\n\tvoid test() {\n\t\t\n\t\tuserInput ui = new userInput();\n\t\t\n\t\tboolean test0 = ui.isValidChildcareType(0);\n\t\tboolean test1 = ui.isValidChildcareType(1);\n\t\tboolean test2 = ui.isValidChildcareType(2);\n\t\tboolean test3 = ui.isValidChildcareType(3);\n\t\tboolean test4 = ui.isValidChildcareType(4);\n\t\tboolean test5 = ui.isValidChildcareType(5);\n\t\tboolean test6 = ui.isValidChildcareType(-1);\n\t\t\n\t\tassertEquals(test0, false);\n\t\tassertEquals(test1, true);\n\t\tassertEquals(test2, true);\n\t\tassertEquals(test3, true);\n\t\tassertEquals(test4, true);\n\t\tassertEquals(test5, false);\n\t\tassertEquals(test6, false);\n\t}", "@Test\n public void isInputDataValidTest() {\n boolean invoke = Deencapsulation.invoke(modificationFibonacci, \"isInputDataValid\", \"1\");\n assertTrue(invoke);\n }", "public static boolean isValid(String args[]){\n \n if(args.length < 2){\n System.out.println(\"Not enough arguments detected. Please enter two\"\n + \" integer arguments.\");\n return false;\n }\n \n Scanner scanin = new Scanner(args[0]);\n Scanner scanin2 = new Scanner(args[1]);\n\t \n if(!scanin.hasNextInt() || !scanin2.hasNextInt()){\n System.out.println(\"Invalid argument type detected. Please enter two\"\n + \" integer arguments.\");\n return false;\n }\n\t else\n return true;\n }", "@Test\n public void correctArgumentsWithoutFiltersReturnsArguments() {\n String projectPath = \"/pathI/\";\n String resultPath = \"/pathO/\";\n String apkPath = apkFile.getAbsolutePath();\n String[] inputArgs = new String[] {\"-i\", projectPath, \"-o\", resultPath, \n \"-a\", apkPath};\n ArgumentReader sut = new ArgumentReader(inputArgs);\n\n Arguments args = sut.read();\n\n assertThat(args, notNullValue());\n assertThat(args.getFiltersPath(), nullValue());\n assertThat(args.getProjectPath(), equalTo(projectPath));\n assertThat(args.getResultPath(), equalTo(resultPath));\n assertThat(args.getApkFilePath(), equalTo(apkPath));\n }", "public void testGetOpt() throws Exception {\n String str;\n while ((str = this._getOpt.nextArg()) != null) {\n // it's so happened that all the test arguments begin with different\n // letter, so we can just check by that. In general, we can also\n // use String.equals() method to do the comparison.\n switch (str.charAt(0)) {\n case 'h' :\n break;\n case 'u' :\n assertEquals(\"tux\", this._getOpt.getArgValue());\n break;\n case 'p' :\n assertEquals(\"v2.4\", this._getOpt.getArgValue());\n break;\n case 's' :\n assertEquals(\"dbServer\", this._getOpt.getArgValue());\n break;\n case 'd' :\n assertEquals(\"mydb\", this._getOpt.getArgValue());\n break;\n default :\n MDMS.ERROR(\"Invalue input argument\");\n }\n }\n }", "@Nullable\r\n protected abstract Prompt acceptValidatedInput(@NotNull ConversationContext context, @NotNull String input);", "@Test\n public void TestLegalCorrectInputCheck(){\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,1,1)\n ,true , \" check horisontal \"\n );\n\n //legal : check vertical spelling\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,1,1)\n ,true , \" check vertical \"\n );\n\n //legal : place a 5 ship horisontal at 1,1\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,1,1)\n ,true , \" legal : place a 5 ship horisontal at 1,1 \"\n );\n\n // legal : place a 5 ship horisontal at 1,10\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,1,10)\n ,true ,\" legal : place a 5 ship horisontal at 1,10 \"\n );\n\n // legal : place a 5 ship vertical at 1,10\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,1,1)\n ,true , \" legal : place a 5 ship vertical at 1,10 \"\n );\n\n // legal : place a 5 ship vertical at 1,10\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,10,1)\n ,true ,\"000 legal : place a 5 ship vertical at 1,10 \"\n );\n\n // legal : place a 5 ship horisontal at 6,1\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,6,1)\n ,true , \" legal : place a 5 ship horisontal at 6,1 \"\n );\n\n // legal : place a 5 ship vertical at 1,6\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,1,6)\n ,true ,\"000 legal : place a 5 ship vertical at 10,6 \"\n );\n\n }", "public boolean parseAndSetInputParameter(String inArg) {\r\n\t\tif (inArg.startsWith(\"-\"))\r\n\t\t\treturn false;\r\n\t\tthis.inArg = inArg;\r\n\t\treturn true;\r\n\t}", "@When(\"^user enters valid \\\"([^\\\"]*)\\\"$\")\n public void userEntersValid(String arg0) throws Throwable {\n }", "public static boolean checkInput(String saInput) {\r\n\t\treturn checkGenericPattern(saInput) && checkGenericPattern(unalter(saInput));\r\n\t}", "@Test(expectedExceptions=ArgumentsAreMutuallyExclusiveException.class)\n public void mutuallyExclusiveArgumentsTest() {\n String[] commandLine = new String[] {\"--foo\",\"5\"};\n\n parsingEngine.addArgumentSource( MutuallyExclusiveArgProvider.class );\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n\n MutuallyExclusiveArgProvider argProvider = new MutuallyExclusiveArgProvider();\n parsingEngine.loadArgumentsIntoObject( argProvider );\n\n Assert.assertEquals(argProvider.foo.intValue(), 5, \"Argument is not correctly initialized\");\n\n // But when foo and bar come together, danger!\n commandLine = new String[] {\"--foo\",\"5\",\"--bar\",\"6\"};\n\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n }", "private void validateParameters() {\r\n if (command == null) {\r\n throw new BuildException(\r\n \"'command' parameter should not be null for coverity task.\");\r\n }\r\n\r\n }", "private void scanArgs(String [] args)\n{\n for (int i = 0; i < args.length; ++i) {\n if (args[i].startsWith(\"-\")) {\n\t badArgs();\n }\n else badArgs();\n }\n}", "public boolean parse(String input) {\n\t\tif (input.isEmpty()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tString[] sp = input.split(\" \");\n\t\tthis.command = sp[0];\n\t\tif (sp.length > 1) {\n\t\t\tthis.arguments = Arrays.copyOfRange(sp, 1, sp.length);\n\t\t}\n\t\treturn true;\n\t}", "public static boolean isFirstArgumentValid(String input) {\n\t\tif (CommonUtils.isNotNullOrEmpty(input) && isValidCurrency(input))\n\t\t\treturn true;\n\t\treturn false;\n\t}", "@Override\n protected void processShellCommandLine() throws IllegalArgumentException {\n final Map<String, String> argValues = getCommandLineArguments();\n logger.debug(\"processShellCommandLine: {}\", argValues);\n\n // note: open file is NOT done in background ...\n final String fileArgument = argValues.get(CommandLineUtils.CLI_OPEN_KEY);\n\n // required open file check:\n if (fileArgument == null) {\n throw new IllegalArgumentException(\"Missing file argument !\");\n }\n final File fileOpen = new File(fileArgument);\n\n // same checks than LoadOIDataCollectionAction:\n if (!fileOpen.exists() || !fileOpen.isFile()) {\n throw new IllegalArgumentException(\"Could not load the file: \" + fileOpen.getAbsolutePath());\n }\n\n logger.debug(\"processShellCommandLine: done.\");\n }", "@Test\r\n public void Test005TakeUserInputInValidRow()\r\n {\r\n gol.input = new Scanner(new ByteArrayInputStream(\"20 1 2 2 2 3 2 4 -1\".getBytes()));\r\n gol.takeUserInput();\r\n assertTrue(gol.grid[2][3] == 1 && gol.grid[2][2] == 1 && gol.grid[2][3] == 1 && gol.grid[2][4] == 1);\r\n }", "public boolean validateInput() {\n/* 158 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "private static boolean argsAreValid(String[] args) {\n try {\n if (args.length != NUM_OF_ARGS) {\n System.err.println(TypeTwoErrorException.TYPE_II_GENERAL_MSG +\n BAD_COMMAND_LINE_ARGUMENTS);\n return false;\n }\n File sourceDirectory = new File(args[0]);\n File commandFile = new File(args[1]);\n if ((!sourceDirectory.isDirectory()) || (!commandFile.isFile())) {\n System.err.println(TypeTwoErrorException.TYPE_II_GENERAL_MSG +\n BAD_COMMAND_LINE_ARGUMENTS);\n return false;\n }\n } catch (Exception e) {\n System.err.println(TypeTwoErrorException.TYPE_II_GENERAL_MSG +\n UNKNOWN_ERROR_COMMAND_LINE_ARGUMENTS);\n return false;\n }\n return true;\n }", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter string\");\n\t\tString input1 = scan.next();\n\t\tString input2 = scan.next();\n\t\tcheckPermutations(input1,input2);\n\t}", "@Override\n protected void validate()\n throws CommandException, CommandValidationException {\n super.validate();\n String pp = getOption(\"printprompt\");\n if (pp != null)\n printPrompt = Boolean.parseBoolean(pp);\n else\n printPrompt = programOpts.isInteractive();\n encoding = getOption(\"encoding\");\n String fname = getOption(\"file\");\n if (fname != null)\n file = new File(fname);\n }", "@Override\n\tprotected void checkNumberOfInputs(int length) {\n\n\t}", "static Boolean verifyArguments(String[] args)\n {\n if (args.length < 2)\n {\n return false;\n }\n \n return true;\n }", "public void testValidateArgs() {\n\t\tString[] args = new String[]{\"name\",\"bob\",\"jones\"};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with 1 argument, should fail\n\t\targs = new String[]{\"name\"};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with 0 arguments, should be a problem\n\t\targs = new String[]{};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with null arguments, should be a problem\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t\tfail(\"An InvalidFunctionArguements exception should have been thrown by the constructor!\");\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tassertTrue(ifa.getMessage().contains(\"HasAttributeWithValueContains takes exactly 2 arguments.\"));\n\t\t}\n\t\t\n\t\t//test with correct arguments, first one is zero, should work\n\t\targs = new String[]{\"name\",\"bob\"};\n\t\ttry {\n\t\t\tnew HasAttributeWithValueContains(args);\n\t\t} catch (InvalidFunctionArguments ifa) {\n\t\t\tfail(\"An InvalidFunctionArguements exception should have NOT been thrown by the constructor!\");\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(isValid(\"aabbccddeefghi\"));\n\t}", "public static boolean isSecondArgumentValid(String input) {\n\t\tif (CommonUtils.isNotNullOrEmpty(input) && CommonUtils.isNumeric(input))\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public void doIt(Input in);", "public ArgumentChecker(String word) {\n\n if (word.isEmpty() || word == null) {\n throw new IllegalArgumentException();\n }\n }", "public void testInvalidInput(){\n\t\tString input = \"bye\";\n\t\tString actual = operation.processOperation(input);\n\t\tString expected = \"bye bye could not be performed\";\n\t\tassertEquals(expected,actual);\n\t}", "@SuppressWarnings(\"unchecked\")\n @Test\n public void testLogInputArguments() throws Exception {\n ByteArrayOutputStream byteStream = new ByteArrayOutputStream();\n Constructor privateCtor = BasicLog.class.getDeclaredConstructor(String.class, PrintStream.class);\n privateCtor.setAccessible(true);\n Log log = (Log) privateCtor.newInstance(\"name\", new PrintStream(byteStream));\n List<Long> list = new ArrayList<Long>();\n list.add(1l);\n list.add(2l);\n Helper.logInputArguments(log, new String[] {\"list\", \"user\", \"CopilotProfile\", \"null parameter\",\n \"CopilotProfileDTO\", \"CopilotProjectDTO\", \"CopilotPoolMember\"}, new Object[] {list, \"user\",\n new CopilotProfile(), null, new CopilotProfileDTO(), new CopilotProjectDTO(), new CopilotPoolMember()});\n String out = byteStream.toString();\n assertTrue(\"Should contain 'Input arguments:'.\", out.indexOf(\"Input arguments:\") != -1);\n }", "private boolean doDescriptorArgsMatch(String expected, String check) {\n String expectedArgs = expected.substring(1, expected.indexOf(\")\"));\n String checkArgs = check.substring(1, check.indexOf(\")\"));\n return expectedArgs.equals(checkArgs);\n }", "public static void main(String arg[]){\n\t\tint n;\r\n\t\tmyTester mt = new myTester();\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\tn = in.nextInt();\r\n\t\tif(mt.isNegative(n)){\r\n\t\t\tSystem.out.print(n + \" is Negative\");\r\n\t\t}else if(mt.isZero(n)){\r\n\t\t\tSystem.out.print(\"You Entered Zero!.\");\r\n\t\t}else{\r\n\t\t\tSystem.out.print( n + \" is Positive\");\r\n\t\t}\r\n\t}", "@Test\n public void testMain() {\n String simulatedUserInput = \"100AUD\" + System.getProperty(\"line.separator\")\n + \"1\" + System.getProperty(\"line.separator\");\n\n InputStream savedStandardInputStream = System.in;\n System.setIn(new ByteArrayInputStream(simulatedUserInput.getBytes()));\n\n mainFunction mainfunc = new mainFunction();\n\n try {\n mainfunc.start();\n } catch(Exception e) {\n System.out.println(\"Exception!\");\n }\n\n assertEquals(1,1);\n }", "@Test\n public void verifyParametersInput() {\n // act\n book.setISBN(isbn);\n book.setAuthors(array);\n book.setPublisher(publisher);\n // verify\n verify(book).setISBN(isbn);\n verify(book).setAuthors(array);\n verify(book).setPublisher(publisher);\n }", "public interface Input \n{\n\t/*\n\t * Use to initialise input\n\t */\n\tboolean initialise (String args);\n\t/*\n\t * Return a line or return null\n\t */\n\tString getLine ();\n\t\n}", "@Test\n public void isInputDataValidTestWithBadInput() {\n boolean invoke = Deencapsulation.invoke(modificationFibonacci, \"isInputDataValid\", \"a\");\n assertFalse(invoke);\n }", "private boolean validateArguments() {\n return !isEmpty(getWsConfig()) && !isEmpty(getVirtualServer()) && !isEmpty(getVirtualServer()) && !isEmpty(getAppContext()) && !isEmpty(getWarFile()) && !isEmpty(getUser()) && !isEmpty(getPwdLocation());\n }", "@Test\n public void testCheckInputValidation() {\n GreekNumberValidation instance = new GreekNumberValidation();\n assertEquals(false, instance.checkInputValidation(\"69 88 89 89 35\"));\n assertEquals(false, instance.checkInputValidation(\"69 885 896 897 35\"));\n assertEquals(false, instance.checkInputValidation(\"6 885 896 8 35\"));\n assertEquals(true, instance.checkInputValidation(\"6985898731\"));\n assertEquals(true, instance.checkInputValidation(\"asd 34 5\"));\n assertEquals(true, instance.checkInputValidation(\"asd gfd g\"));\n assertEquals(true, instance.checkInputValidation(\"asdgfdg\"));\n\n }", "@Test\r\n public void Test006TakeUserInputInValidColumn()\r\n {\r\n gol.input = new Scanner(new ByteArrayInputStream(\"2 1 2 20 2 3 2 4 -1\".getBytes()));\r\n gol.takeUserInput();\r\n assertTrue(gol.grid[2][1] == 1 && gol.grid[2][3] == 1 && gol.grid[2][4] == 1);\r\n }", "public Boolean test(String input);", "public void validateInput( JobConf job ) throws IOException\n {\n for( JobConf jobConf : getJobConfs( job, getConfigs( job ) ) )\n jobConf.getInputFormat().validateInput( jobConf );\n }", "boolean canProcess(final WriteableCommandLine commandLine, final String argument);", "public ParseTree checkArgument(String arg) throws ParseException{\n\t\ttree = new ParseTree(info);\n\t\tcheckArgument(arg, new int[] {0, Integer.MAX_VALUE - 1, ERROR});\n\t\treturn tree;\n\t}", "@Test\n public void testGetChoice() {\n assertTrue(Human.parseInput(\"r\").equals(Choice.ROCK));\n assertTrue(Human.parseInput(\"p\").equals(Choice.PAPER));\n assertTrue(Human.parseInput(\"s\").equals(Choice.SCISSORS));\n assertTrue(Human.parseInput(\"n\") == null);\n\n }", "@Test\n\tpublic void testRunArgsStdin() throws SortException {\n\t\tString[] argsArr = new String[] { \"-n\" };\n\t\tString contentStr = \"112\" + NEW_LINE + \"68\" + NEW_LINE + \"681\";\n\t\tString expected = \"68\" + NEW_LINE + \"112\" + NEW_LINE + \"681\" + NEW_LINE;\n\t\tInputStream inputStream = new java.io.ByteArrayInputStream(contentStr.getBytes());\n\t\tByteArrayOutputStream stdout = new ByteArrayOutputStream();\n\t\tsortApplication.run(argsArr, inputStream, stdout);\n\t\tassertEquals(expected, stdout.toString());\n\t}", "@Test\n public void theUserIsPromptedForAnInput() {\n //arrange\n //act\n String returnedValue = Localization.fromPrompter(Prompter.readOnly(expectedValue));\n //assess\n assertEquals(expectedValue, returnedValue);\n }" ]
[ "0.7267352", "0.71635056", "0.70276856", "0.67909145", "0.6767938", "0.6764676", "0.6728627", "0.6693893", "0.6491859", "0.6466175", "0.64212334", "0.63676536", "0.63346225", "0.63318336", "0.6305013", "0.62908936", "0.6280127", "0.6269841", "0.62272334", "0.6204189", "0.61890656", "0.61831605", "0.6172332", "0.6107233", "0.60739607", "0.60712105", "0.60704", "0.60700154", "0.60557383", "0.60518295", "0.6004564", "0.59890574", "0.5984524", "0.5966991", "0.5959555", "0.5917366", "0.5890733", "0.58869797", "0.58860886", "0.5832659", "0.57976204", "0.5791771", "0.578802", "0.57849723", "0.5776981", "0.57704383", "0.5749616", "0.57347035", "0.5726182", "0.5698702", "0.5686495", "0.56841606", "0.568068", "0.56752276", "0.5648043", "0.5627361", "0.5611523", "0.5600164", "0.5593588", "0.5583406", "0.556974", "0.5565084", "0.5561856", "0.55511963", "0.5541082", "0.55394596", "0.5534524", "0.5527273", "0.5501215", "0.5499946", "0.54927707", "0.54781604", "0.54649377", "0.5463442", "0.54558074", "0.54534656", "0.54531443", "0.544902", "0.5437283", "0.5436605", "0.54310846", "0.5427036", "0.542575", "0.5425504", "0.54228586", "0.54202837", "0.5410415", "0.54098916", "0.5403318", "0.5402235", "0.5384494", "0.538104", "0.53808856", "0.5379868", "0.53782743", "0.5363029", "0.5360882", "0.53608704", "0.5356641", "0.5350987" ]
0.8165666
0
Test of tallyIdentifiers method, of class CommandLineArgumentParser.
@Test public void testTallyIdentifiers() throws Exception { System.out.println("tallyIdentifiers"); String identifiers = "1k2h3u"; String [] args= {"1k2h3u","test"}; CommandLineArgumentParser instance = new CommandLineArgumentParser(args); int expResult = 6; int result = instance.tallyIdentifiers(identifiers); assertEquals(expResult, result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n public void testCollectIdentifierValues() throws Exception{\r\n System.out.println(\"collectIdentifierValues\");\r\n \r\n char u = 'u';\r\n char h ='h';\r\n char k ='k';\r\n \r\n System.out.println(\"test1\"); \r\n String [] instanceInput = {\"1u\",\"chat.txt\",\"user1\"};\r\n CommandLineArgumentParser instance = new CommandLineArgumentParser(instanceInput);\r\n String [] expResult = {\"user1\"};\r\n String []result = instance.collectIdentifierValues(u,instanceInput);\r\n System.out.println(Arrays.toString(result)+\" expected: \"+Arrays.toString(expResult));\r\n \r\n System.out.println(\"test2\");\r\n String [] instanceInput2 = {\"2u\",\"chat.txt\",\"user1\",\"user2\"};\r\n CommandLineArgumentParser instance2 = new CommandLineArgumentParser(instanceInput2);\r\n String [] expResult2 = {\"user1\",\"user2\"};\r\n String []result2 = instance2.collectIdentifierValues(u,instanceInput2);\r\n System.out.println(Arrays.toString(result2)+\" expected: \"+Arrays.toString(expResult2));\r\n \r\n System.out.println(\"test3\");\r\n String [] instanceInput3 = {\"1k3u\",\"chat.txt\",\"keyWord\",\"user1\",\"user2\",\"user3\"};\r\n CommandLineArgumentParser instance3 = new CommandLineArgumentParser(instanceInput3);\r\n String [] expResult3 = {\"user1\",\"user2\",\"user3\"};\r\n String []result3 = instance3.collectIdentifierValues(u,instanceInput3);\r\n System.out.println(Arrays.toString(result3)+\" expected: \"+Arrays.toString(expResult3));\r\n \r\n System.out.println(\"test4\");\r\n String [] instanceInput4 = {\"2k1u1h\",\"chat.txt\",\"keyWord1\",\"keyWord1\",\"user1\",\"hiddenWord\"};\r\n CommandLineArgumentParser instance4 = new CommandLineArgumentParser(instanceInput4);\r\n String [] expResult4 = {\"user1\"};\r\n String [] result4 = instance4.collectIdentifierValues(u,instanceInput4);\r\n System.out.println(Arrays.toString(result4)+\" expected: \"+Arrays.toString(expResult4));\r\n \r\n System.out.println(\"test5\");\r\n String [] instanceInput5 = {\"2h3k\",\"chat.txt\",\"hiddenWord1\",\"hiddenWord2\",\"keyWord\",\"keyWord\",\"keyword3\"};\r\n CommandLineArgumentParser instance5 = new CommandLineArgumentParser(instanceInput5);\r\n String [] expResult5 = {\"hiddenWord1\",\"hiddenWord2\"};\r\n String [] result5 = instance5.collectIdentifierValues(h,instanceInput5);\r\n System.out.println(Arrays.toString(result5)+\" expected: \"+Arrays.toString(expResult5));\r\n \r\n System.out.println(\"test6\");\r\n String [] instanceInput6 = {\"3k2h\",\"chat.txt\",\"keyWord1\",\"keyWord2\",\"keyWord3\",\"hiddenWord1\",\"hiddenWord2\"};\r\n CommandLineArgumentParser instance6 = new CommandLineArgumentParser(instanceInput6);\r\n String [] expResult6 = {\"keyWord1\",\"keyWord2\",\"keyWord3\"};\r\n String [] result6 = instance6.collectIdentifierValues(k,instanceInput6);\r\n System.out.println(Arrays.toString(result6)+\" expected: \"+Arrays.toString(expResult6));\r\n \r\n System.out.println(\"test7\");\r\n String [] instanceInput7 = {\"1u1k1h\",\"chat.txt\",\"username1\",\"keyWord1\",\"hiddenWord1\"};\r\n CommandLineArgumentParser instance7 = new CommandLineArgumentParser(instanceInput7);\r\n String [] expResult7 = {\"keyWord1\"};\r\n String [] result7 = instance7.collectIdentifierValues(k,instanceInput7);\r\n System.out.println(Arrays.toString(result7)+\" expected: \"+Arrays.toString(expResult7));\r\n \r\n System.out.println(\"test8\");\r\n String [] instanceInput8 = {\"1u\",\"chat.txt\",\"mike\"};\r\n CommandLineArgumentParser instance8 = new CommandLineArgumentParser(instanceInput8);\r\n String [] expResult8 = {\"mike\"};\r\n String [] result8 = instance8.collectIdentifierValues(u,instanceInput8);\r\n System.out.println(Arrays.toString(result8)+\" expected: \"+Arrays.toString(expResult8));\r\n \r\n assertEquals(Arrays.toString(expResult), Arrays.toString(result));\r\n assertEquals(Arrays.toString(expResult2), Arrays.toString(result2));\r\n assertEquals(Arrays.toString(expResult3), Arrays.toString(result3));\r\n assertEquals(Arrays.toString(expResult4), Arrays.toString(result4));\r\n assertEquals(Arrays.toString(expResult5), Arrays.toString(result5));\r\n assertEquals(Arrays.toString(expResult6), Arrays.toString(result6));\r\n assertEquals(Arrays.toString(expResult7), Arrays.toString(result7));\r\n assertEquals(Arrays.toString(expResult8), Arrays.toString(result8));\r\n \r\n }", "@Test\r\n\tpublic void testTokenizeIdentifiers() {\r\n\r\n\t\t// Enter the code\r\n\r\n\t\tdriver.findElement(By.name(\"code[code]\"))\r\n\t\t\t\t.sendKeys(\"the_best_cat = \\\"Noogie Cat\\\"\\nputs \\\"The best cat is: \\\" + the_best_cat\");\r\n\r\n\t\t// Look for the \"Tokenize\" button and click\r\n\r\n\t\tdriver.findElements(By.name(\"commit\")).get(0).click();\r\n\r\n\t\t// Check that there is corresponding quantity of the word \":on_ident\"\r\n\r\n\t\ttry {\r\n\t\t\tWebElement code = driver.findElement(By.tagName(\"code\"));\r\n\t\t\tString res = code.getText();\r\n\t\t\tint count = 0;\r\n\t\t\tfor (int i = 0; i <= res.length() - 9; i++) {\r\n\t\t\t\tString sub = res.substring(i, i + 9);\r\n\t\t\t\tif (sub.equals(\":on_ident\"))\r\n\t\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t\tassertEquals(count, 3);\r\n\t\t} catch (NoSuchElementException nseex) {\r\n\t\t\tfail();\r\n\t\t}\r\n\t}", "@DisplayName(\"SP800-73-4.38 test\")\n\t@ParameterizedTest(name = \"{index} => oid = {0}\")\n\t//@MethodSource(\"sp800_73_4_DiscoveryObjectTestProvider\")\n @ArgumentsSource(ParameterizedArgumentsProvider.class)\n\tvoid sp800_73_4_Test_38(String oid, TestReporter reporter) {\t\t\n\t\ttry {\n\t\t\tPIVDataObject o = AtomHelper.getDataObject(oid);\t\n\t\t\tif (!o.inBounds(oid)) {\n\t\t\t\tString errStr = (String.format(\"Tag in \" + o.getFriendlyName() + \" failed length check\"));\n\t\t\t\tException e = new Exception(errStr);\n\t\t\t\tthrow(e);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\ts_logger.info(e.getMessage());\n\t\t\tfail(e);\n\t\t}\n\t}", "@Test\r\n\tvoid testWordLengthsTallyHandout() {\n\t\tString input[] = Main.TEXT_LIST;\r\n\t\tint expected[] = {0, 9, 25, 42, 43, 26, 13, 11, 4, 2, 3, 1 };\r\n\r\n\t\t// Use assertEquals to compare arrays\r\n\t\tassertArrayEquals(expected, Main.wordLengthsTally(input) );\r\n\r\n\t}", "@Test\n public void uuidCountTest() {\n // TODO: test uuidCount\n }", "@Test\n public void aminoCountsTest1(){\n AminoAcidLL first = AminoAcidLL.createFromRNASequence(a);\n int[] expected = {1,3,1};\n assertArrayEquals(expected, first.aminoAcidCounts());\n }", "@ParameterizedTest(name = \"{index} => oid = {0}\")\n\t//@MethodSource(\"sp800_73_4_DiscoveryObjectTestProvider\")\n @ArgumentsSource(ParameterizedArgumentsProvider.class)\n\t@DisplayName(\"SP800-73-4.55 test\")\n\tvoid sp800_73_4_Test_55 (String oid, TestReporter reporter) {\n\t\t\t\t\n\t\tPIVDataObject o = AtomHelper.getDataObject(oid);\n\t\t\n\t\tList<BerTag> tagList = o.getTagList();\n\t\t\n\t\tBerTag cardAppAIDTag = new BerTag(TagConstants.PIV_CARD_APPLICATION_AID_TAG);\n\t\t\n\t\tint tagIndex = tagList.indexOf(cardAppAIDTag);\n\t\t\n\t\t//Confirm (0x4F, 0x5F2F) tag order\n\t\tassertTrue(Arrays.equals(tagList.get(tagIndex).bytes,TagConstants.PIV_CARD_APPLICATION_AID_TAG));\n\t\tassertTrue(Arrays.equals(tagList.get(tagIndex+1).bytes,TagConstants.PIN_USAGE_POLICY_TAG));\n\t}", "public void testCount()\n\t{\n\t\tinfo.append(a1);\n\t\tinfo.append(a2);\n\t\tinfo.append(a3);\n\t\tassertEquals(3,info.getSynonymsCount());\n\t}", "@DisplayName(\"SP800-73-4.41 test\")\n\t@ParameterizedTest(name = \"{index} => oid = {0}\")\n\t//@MethodSource(\"sp800_73_4_DiscoveryObjectTestProvider\")\n @ArgumentsSource(ParameterizedArgumentsProvider.class)\n\tvoid sp800_73_4_Test_41(String oid, TestReporter reporter) {\n\t\t\n\t\tPIVDataObject o = AtomHelper.getDataObject(oid);\n\t\t\n\t\tList<BerTag> tagList = o.getTagList();\n\t\t\n\t\tBerTag pinUsagePolicyTag = new BerTag(TagConstants.PIN_USAGE_POLICY_TAG);\n\n\t\tassertTrue(tagList.contains(pinUsagePolicyTag));\t\t\t\n\t}", "public void testNumberID() {\n String testID = generator.generatePrefixedIdentifier(\"123\");\n assertNotNull(testID);\n assertTrue(testID.matches(\"_123\" + ID_REGEX));\n }", "public static void main(String[] args) throws Throwable {\n\t\tgetDashCounts();\n\t}", "public static void main(String[] args) {\n\t\tScanner s=new Scanner (System.in);\n\t\tint n=s.nextInt();\n\t\tString beg=\"T1\";\n\t\tString aux=\"T2\";\n\t\tString end=\"T3\";\n\t\tTOH(n,beg,aux,end);\n\t\tint count=count(n,beg,aux,end);\n\t\tSystem.out.println(count-1);\n\t}", "int countByExample(MenuInfoExample example);", "@Test\n public void aminoCountsTest2(){\n AminoAcidLL first = AminoAcidLL.createFromRNASequence(b);\n int[] expected = {2,1,1,1};\n assertArrayEquals(expected, first.aminoAcidCounts());\n }", "@Test\n\tpublic void requestAccountsForCustomer12212_checkListOfAccountsIDs_expectContains12345() {\n\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\tthen();\n\t}", "@Test\r\n\tpublic void testParseIdentifier() {\r\n\r\n\t\t// Enter the code\r\n\r\n\t\tdriver.findElement(By.name(\"code[code]\"))\r\n\t\t\t\t.sendKeys(\"the_best_cat = \\\"Noogie Cat\\\"\\nputs \\\"The best cat is: \\\" + the_best_cat\");\r\n\r\n\t\t// Look for the \"Parse\" button and click\r\n\r\n\t\tdriver.findElements(By.name(\"commit\")).get(1).click();\r\n\r\n\t\t// Check that there contains corresponding quantity of \"assign\"\r\n\r\n\t\ttry {\r\n\t\t\tWebElement code = driver.findElement(By.tagName(\"code\"));\r\n\t\t\tString res = code.getText();\r\n\t\t\tint count = 0;\r\n\t\t\tfor (int i = 0; i <= res.length() - 6; i++) {\r\n\t\t\t\tString sub = res.substring(i, i + 6);\r\n\t\t\t\tif (sub.equals(\"assign\"))\r\n\t\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t\tassertEquals(count, 1);\r\n\t\t} catch (NoSuchElementException nseex) {\r\n\t\t\tfail();\r\n\t\t}\r\n\t}", "@Test\r\n public void testCheckInput() throws Exception {\r\n System.out.println(\"checkInput\");\r\n System.out.println(\"test1\");\r\n String[] arguments = {\"1k2h3u\",\"test.txt\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\"};\r\n CommandLineArgumentParser instance =new CommandLineArgumentParser(arguments);\r\n String expResult = \"correct\";\r\n String result = instance.checkInput(arguments);\r\n assertEquals(expResult, result);\r\n \r\n System.out.println(\"test 2\");\r\n String[] arguments2 = {\"1k\",\"test.txt\",\"1\"};\r\n String expResult2 = \"correct\";\r\n String result2 = instance.checkInput(arguments2);\r\n assertEquals(expResult2, result2);\r\n \r\n System.out.println(\"test 3\");\r\n String[] arguments3 = {\"chat.txt\"};\r\n String expResult3 = \"correct\";\r\n String result3 = instance.checkInput(arguments3);\r\n assertEquals(expResult3, result3);\r\n \r\n System.out.println(\"test 4\");\r\n String[] arguments4 = {\"1k2h3u\",\"test.txt\",\"1\",\"2\",\"3\",\"4\",\"5\"};\r\n String expResult4 = \"Incorrect number of arguments\";\r\n String result4 = instance.checkInput(arguments4);\r\n assertEquals(expResult4, result4);\r\n \r\n System.out.println(\"test 5\");\r\n String[] arguments5 = {};\r\n String expResult5 = \"Need at least one argument with input file path\";\r\n String result5 = instance.checkInput(arguments5);\r\n assertEquals(expResult5, result5);\r\n }", "public static void main(String[] args) {\n\t\tList<String> list = new ArrayList<String>();\n\t\tlist.add(\"A201550B\");\n\t\tlist.add(\"ABB19991000Z\");\n\t\tlist.add(\"XYZ200019Z\");\n\t\tlist.add(\"ERF200220\");\n\t\tlist.add(\"SCD203010T\");\n\t\t//list.add(\"abC200010E\");\n\t\t//countFakes(list);\n\t\tSystem.out.println(countFakes(list));\n\n\t}", "@Test\n public void commandIdTest() {\n // TODO: test commandId\n }", "@Before\r\n\tpublic void setUp() {\r\n\t\tcl=new CommandLine();\r\n\t\t\r\n\t\ttags=new String[] {\"tournament\",\"-M\",\"ABC_Map.map,bbbb.map\",\"-P\",\"Cheater,Aggressive\",\"-G\",\"3\",\"-D\",\"10\"};\r\n\t\ttags2=new String[] {\"tournament\",\"-B\",\"ABC_Map.map,gggg.map\",\"-P\",\"Cheater,Human\",\"-G\",\"6\",\"-D\",\"60\"};\r\n\t}", "@Test public void testAllSimple10() { testAll(1234, \"1234\", 10); }", "int getNumberOfArgumentsByUser(UUID id);", "public static void main(String[] args) {\n countLetters(\"apple tree\");\n }", "private void testCanCreate(Term t, String name, int numArgs) {\n PredicateKey k1 = PredicateKey.createForTerm(t);\n Term arity = createArity(name, numArgs);\n PredicateKey k2 = PredicateKey.createFromNameAndArity(arity);\n\n testCreatedKey(k1, name, numArgs);\n testCreatedKey(k2, name, numArgs);\n\n // test that two keys instances with same name and number of arguments are considered equal\n testEquals(k1, k2);\n }", "protected static void main(String args[]) {\n\t\tTabTokenizer cst=new TabTokenizer(\"this, is,just, a, test, X\");\n\t\twhile\t(cst.hasMoreTokens()) System.out.println(\"-->\"+cst.nextToken()+\"<--\");\n\t\tcst=new TabTokenizer(\"this, is, another,\t\ttest,\tX,\");\n\t\tcst.setMaxNumberToken(2);\n\t\twhile\t(cst.hasMoreTokens()) System.out.println(\"-->\"+cst.nextToken()+\"<--\");\n\t\tcst=new TabTokenizer(\"and another,\t\");\n\t\twhile\t(cst.hasMoreTokens()) System.out.println(\"-->\"+cst.nextToken()+\"<--\");\n\t}", "@Test\n\tpublic void checkHowManyTripsExists() {\n\t\tassertEquals(Trains.numberOfTrips(\"C\", \"C\", 3), 2);\n\t}", "@Test\n public void identifierTest() {\n assertEquals(\"ident1\", authResponse.getIdentifier());\n }", "public void testTokenIds() {\n Language<TokenId> language = TestGenLanguage.language();\n Set<TokenId> ids = language.tokenIds();\n assertTrue(\"Invalid ids.size() - expected \" + IDS_SIZE, ids.size() == IDS_SIZE);\n \n TokenId[] idArray = {\n TestGenLanguage.IDENTIFIER_ID,TestGenLanguage.PLUS_ID,TestGenLanguage.MINUS_ID,TestGenLanguage.PLUS_MINUS_PLUS_ID,TestGenLanguage.SLASH_ID,TestGenLanguage.STAR_ID,TestGenLanguage.ML_COMMENT_ID,TestGenLanguage.WHITESPACE_ID,TestGenLanguage.SL_COMMENT_ID,TestGenLanguage.ERROR_ID,TestGenLanguage.PUBLIC_ID,TestGenLanguage.PRIVATE_ID,TestGenLanguage.STATIC_ID,\n };\n\n // Check operations with ids\n Collection<TokenId> testIds = Arrays.asList(idArray);\n LexerTestUtilities.assertCollectionsEqual(\"Ids do not match with test ones\",\n ids, testIds);\n \n // Check that ids.iterator() is ordered by ordinal\n int ind = 0;\n for (TokenId id : ids) {\n assertTrue(\"Token ids not sorted by ordinal at index=\" + ind, id == idArray[ind]);\n ind++;\n assertSame(language.tokenId(id.name()), id);\n assertSame(language.tokenId(id.ordinal()), id);\n assertSame(language.validTokenId(id.name()), id);\n assertSame(language.validTokenId(id.ordinal()), id);\n }\n \n try {\n language.validTokenId(\"invalid-name\");\n fail(\"Error: exception not thrown\");\n } catch (IllegalArgumentException e) {\n // OK\n }\n \n try {\n language.validTokenId(-1);\n fail(\"Error: exception not thrown\");\n } catch (IndexOutOfBoundsException e) {\n // OK\n }\n \n try {\n language.validTokenId(20);\n fail(\"Error: exception not thrown\");\n } catch (IndexOutOfBoundsException e) {\n // OK\n }\n \n assertEquals(15, language.maxOrdinal());\n \n // Check token categories\n Set cats = language.tokenCategories();\n Collection testCats = Arrays.asList(new String[] { \"operator\", \"test-category\", \"whitespace\", \"error\", \"comment\", \"keyword\" });\n LexerTestUtilities.assertCollectionsEqual(\"Invalid token categories\",\n cats, testCats);\n \n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new TokenId[] {\n TestGenLanguage.PLUS_ID,TestGenLanguage.MINUS_ID,TestGenLanguage.PLUS_MINUS_PLUS_ID,TestGenLanguage.STAR_ID,TestGenLanguage.SLASH_ID,\n }),\n language.tokenCategoryMembers(\"operator\")\n \n );\n \n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new TokenId[] {\n TestGenLanguage.PLUS_ID,TestGenLanguage.MINUS_ID,TestGenLanguage.IDENTIFIER_ID,\n }),\n language.tokenCategoryMembers(\"test-category\")\n \n );\n\n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new TokenId[] {\n TestGenLanguage.WHITESPACE_ID,\n }),\n language.tokenCategoryMembers(\"whitespace\")\n \n );\n\n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new TokenId[] {\n TestGenLanguage.ERROR_ID,\n }),\n language.tokenCategoryMembers(\"error\")\n \n );\n\n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new TokenId[] {\n TestGenLanguage.ML_COMMENT_ID,TestGenLanguage.SL_COMMENT_ID,\n }),\n language.tokenCategoryMembers(\"comment\")\n \n );\n \n List<String> testIdCats\n = language.tokenCategories(TestGenLanguage.IDENTIFIER_ID);\n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new String[] {\n \"test-category\",\n }),\n testIdCats\n );\n\n List<String> testIdCats2\n = language.tokenCategories(TestGenLanguage.PLUS_ID);\n LexerTestUtilities.assertCollectionsEqual(\n Arrays.asList(new String[] {\n \"test-category\",\n \"operator\",\n }),\n testIdCats2\n );\n\n\n // Check Language.merge()\n Collection<TokenId> mergedIds\n = language.merge(\n Arrays.asList(new TokenId[] { TestGenLanguage.IDENTIFIER_ID }),\n language.merge(language.tokenCategoryMembers(\"comment\"),\n language.tokenCategoryMembers(\"error\"))\n \n );\n LexerTestUtilities.assertCollectionsEqual(\"Invalid language.merge()\",Arrays.asList(new TokenId[] {\n TestGenLanguage.ML_COMMENT_ID,TestGenLanguage.SL_COMMENT_ID,TestGenLanguage.ERROR_ID,TestGenLanguage.IDENTIFIER_ID,\n }),\n mergedIds\n \n );\n\n }", "boolean testCountAndSay(Tester t) {\n\t\treturn\n\t\tt.checkExpect(s.countAndSay(1), \"1\") &&\n\t\tt.checkExpect(s.countAndSay(3), \"21\") &&\n\t\tt.checkExpect(s.countAndSay(4), \"1211\");\n\t}", "@DisplayName(\"SP800-73-4.40 test\")\n\t@ParameterizedTest(name = \"{index} => oid = {0}\")\n\t//@MethodSource(\"sp800_73_4_DiscoveryObjectTestProvider\")\n @ArgumentsSource(ParameterizedArgumentsProvider.class)\n\tvoid sp800_73_4_Test_40(String oid, TestReporter reporter) {\n\t\t\n\t\tPIVDataObject o = AtomHelper.getDataObject(oid);\n\t\t\n\t\tList<BerTag> tagList = o.getTagList();\n\t\tBerTag cardAppAIDTag = new BerTag(TagConstants.PIV_CARD_APPLICATION_AID_TAG);\n\n\t\t//Confirm Tag 0x4F is present\n\t\tassertTrue(tagList.contains(cardAppAIDTag));\t\n\t}", "@UniqueID(\"ProvidedID\")\n\t\[email protected]\n\t\tprivate void uniqueIdAnnotation() {\n\t\t}", "@Test\n\tpublic void testRunArgsOnlyWithNumFlag() throws SortException {\n\t\tString[] argsArr = new String[] { \"-n\", \"examples/numbersort.txt\" };\n\t\tByteArrayOutputStream stdout = new ByteArrayOutputStream();\n\t\tsortApplication.run(argsArr, null, stdout);\n\t\tString expectedResult = \"9\" + NEW_LINE + \"11\" + NEW_LINE + \"23\" + NEW_LINE + \"65\" + NEW_LINE + \"1000\"\n\t\t\t\t+ NEW_LINE;\n\t\tassertEquals(expectedResult, stdout.toString());\n\t}", "@Test\n public void countInfosTest() {\n // TODO: test countInfos\n }", "@Test public void completeUsage() {\n\t\tfinal String[] args = new String[]{\"-verbose\", \"-speed\", \"4\", \"-filter\", \"a\", \"-filter\", \"b\", \"x\", \"y\", \"z\"};\n\t\tfinal CliActuators actuators = parser.parse(args, OPTIONS);\n\t\t// -verbose\n\t\tAssert.assertNotNull(actuators.getActuatorById(\"verbose\"));\n\t\t// -speed\n\t\tAssert.assertEquals(\"4\", actuators.getActuatorById(\"speed\").getValue());\n\t\t// -filter\n\t\tfinal CliActuator filter = actuators.getActuatorById(\"filter\");\n\t\tfinal List<String> filters = filter.getValues();\n\t\tAssert.assertEquals(2, filters.size());\n\t\tAssert.assertEquals(\"a\", filters.get(0));\n\t\tAssert.assertEquals(\"b\", filters.get(1));\n\t\t// rests\n\t\tfinal List<String> rests = actuators.getRests();\n\t\tAssert.assertEquals(3, rests.size());\n\t\tAssert.assertEquals(\"x\", rests.get(0));\n\t\tAssert.assertEquals(\"y\", rests.get(1));\n\t\tAssert.assertEquals(\"z\", rests.get(2));\n\t}", "public static void main(String[] args) {\n\t\tint a[]=takeInput();\n\t\tSystem.out.println(count(a, 0));\n\t\t\n\n\t}", "public void testGetIdentifier() {\n\t\tassertEquals(item.getIdentifier(),\"cup8\");\r\n\t}", "@Test\n public void testElementsTrackedIndividuallyForAStep() throws IOException {\n NameContext stepA = createStep(\"A\");\n NameContext stepB = createStep(\"B\");\n\n tracker.enter(stepA);\n tracker.enter(stepB);\n tracker.exit();\n tracker.enter(stepB);\n tracker.exit();\n tracker.exit();\n // Expected journal: IDLE A1 B1 A1 B2 A1 IDLE\n\n tracker.takeSample(70);\n assertThat(getCounterValue(stepA), equalTo(distribution(30)));\n assertThat(getCounterValue(stepB), equalTo(distribution(10, 10)));\n }", "@Test\r\n\tvoid testwordLengthsTallyHandout1() {\n\t\tString input = Main.TEXT_1;\r\n\t\tString expected[] = {\"Star\",\"Wars:\",\"Episode\",\"VII\",\"The\",\"Force\",\"Awakens\"};\r\n\t\t\r\n\t\t// Use assertEquals to compare arrays\r\n\t\tassertArrayEquals(expected, Main.splitString(input) );\r\n\r\n\t}", "public static void main(String[] args) {\nsub_seq(\"abc\", \"\");\nSystem.out.println();\nSystem.out.println(sub_seq_count(\"ab\", \"\"));\n\t}", "int getIdsCount();", "long countByExample(PaasCustomAutomationRecordExample example);", "private void shouldCountTests(String fileName) {\n prepareScenarioWithTestFile(fileName);\n jasmineFile = new JasmineFile(getProject(), virtualFile);\n jasmineFile.buildTreeNodeSync();\n\n // When you count the tests.\n TestCounts testCounts = jasmineFile.getTestCounts();\n\n // Then ensure there are counts for all the items.\n assertEquals(2, testCounts.getIncludedCount());\n assertEquals(2, testCounts.getExcludedCount());\n assertEquals(6, testCounts.getTestCount());\n }", "int countByExample(AutoAssessDetailExample example);", "private void inRange(String[] arguments) {\n\t\ttry { \n\t int IDLow = Integer.parseInt(arguments[1]);\n\t int IDHigh = Integer.parseInt(arguments[2]);\n\t totalInRangeCount = 0;\n\t countInRange(root, IDLow, IDHigh);\n\t System.out.printf(\"%d\\n\",totalInRangeCount);\n\t } catch(NumberFormatException e) { \n\t System.out.println(\"Argument not an Integer\");; \n\t }\n\t\t\n\t}", "int countByExample(UserTipsExample example);", "public static void main(final String[] args) {\n // instantiate this set\n Set s = new Set();\n // code to read the test cases input file\n Scanner stdin = new Scanner(new BufferedInputStream(System.in));\n // check if there is one more line to process\n while (stdin.hasNext()) {\n // read the line\n String line = stdin.nextLine();\n // split the line using space\n String[] tokens = line.split(\" \");\n // based on the list operation invoke the corresponding method\n switch (tokens[0]) {\n case \"size\":\n System.out.println(s.size());\n break;\n case \"contains\":\n System.out.println(s.contains(Integer.parseInt(tokens[1])));\n break;\n case \"print\":\n System.out.println(s);\n break;\n case \"add\":\n int[] intArray = intArray(tokens[1]);\n if (intArray.length == 1) {\n s.add(intArray[0]);\n } else {\n s.add(intArray);\n }\n break;\n case \"intersection\":\n s = new Set();\n Set t = new Set();\n intArray = intArray(tokens[1]);\n s.add(intArray);\n intArray = intArray(tokens[2]);\n t.add(intArray);\n System.out.println(s.intersection(t));\n break;\n case \"retainAll\":\n s = new Set();\n intArray = intArray(tokens[1]);\n s.add(intArray);\n intArray = intArray(tokens[2]);\n System.out.println(s.retainAll(intArray));\n break;\n case \"cartesianProduct\":\n s = new Set();\n t = new Set();\n intArray = intArray(tokens[1]);\n s.add(intArray);\n intArray = intArray(tokens[2]);\n t.add(intArray);\n System.out.println(Arrays.deepToString(s.cartesianProduct(t)));\n break;\n default:\n break;\n }\n }\n }", "public static void main(String[] args) {\n String idNum = \"410326880818551\";\n System.out.println(verify15(idNum));\n// String idNum2 = \"411111198808185510\";\n String idNum2 = \"410326198808185515\";\n System.out.println(verify(idNum2));\n }", "int getTaskIdCount();", "public void processArgs(String[] args){\n\t\tPattern pat = Pattern.compile(\"-[a-z]\");\n\t\tString useqVersion = IO.fetchUSeqVersion();\n\t\tSystem.out.println(\"\\n\"+useqVersion+\" Arguments: \"+ Misc.stringArrayToString(args, \" \") +\"\\n\");\n\t\tString dmelCountString = null;\n\t\tfor (int i = 0; i<args.length; i++){\n\t\t\tString lcArg = args[i].toLowerCase();\n\t\t\tMatcher mat = pat.matcher(lcArg);\n\t\t\tif (mat.matches()){\n\t\t\t\tchar test = args[i].charAt(1);\n\t\t\t\ttry{\n\t\t\t\t\tswitch (test){\n\t\t\t\t\tcase 'f': drssFile = new File(args[++i]); break;\n\t\t\t\t\tcase 'd': dmelCountString = args[++i]; break;\n\t\t\t\t\tdefault: Misc.printErrAndExit(\"\\nProblem, unknown option! \" + mat.group());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception e){\n\t\t\t\t\tMisc.printErrAndExit(\"\\nSorry, something doesn't look right with this parameter: -\"+test+\"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//check\n\t\tif (drssFile == null || drssFile.exists() == false) Misc.printErrAndExit(\"\\nFailed to find your drss file!\");\n\t\tif (dmelCountString == null) Misc.printErrAndExit(\"\\nFailed to find your treatment control count string!\");\n\t\tint[] dmel = Num.parseInts(dmelCountString, Misc.COMMA);\n\t\ttreatmentCounts = dmel[0];\n\t\tcontrolCounts = dmel[1];\n\n\n\n\t}", "@Test\n public void shouldCountLinesOfTestCode() throws Exception {\n initializeOSGiProjectWithTestCodeInsideBundles();\n resetOutput();\n getShell().execute(\"osgi lot\");\n assertTrue(getOutput().contains(\"Total lines of test code:4\"));\n }", "long countByExample(TerminalInfoExample example);", "@Test\n\tpublic void testIdentifier() throws ParseException {\n\t\tIdentifier identifier = langParser(\"foo\").identifier();\n\t\tassertEquals(identifier.getName(), \"foo\");\n\t}", "int countByExample(TaskExample example);", "@Test\n public void testMakeUniqueProgramId() {\n System.out.println(\"makeUniqueProgramId\");\n \n List<SAMProgramRecord> programList = new ArrayList();\n SAMProgramRecord programRecord = new SAMProgramRecord(\"test\");\n programList.add(programRecord);\n \n SAMProgramRecord programRecord1 = new SAMProgramRecord(\"test\");\n \n PicardCommandLine instance = new PicardCommandLineImpl();\n\n SAMProgramRecord result = instance.makeUniqueProgramId(programList, programRecord1);\n assertEquals(result.getProgramGroupId(), \"test_1\");\n\n }", "@Override\n public void verifyArgs(ArrayList<String> args) throws ArgumentFormatException {\n super.checkNumArgs(args);\n _args = true;\n }", "int countByExample(TResearchTeachExample example);", "@Test public void testIdWithHyphens() throws Exception {\n String templates =\n \"template-a(x-1) ::= \\\"[<x-1>]\\\"\" + Misc.newline +\n \"template-b(x-2) ::= <<\" + Misc.newline +\n \"<template-a(x-2)>\" + Misc.newline +\n \">>\" + Misc.newline +\n \"t-entry(x-3) ::= <<[<template-b(x-3)>]>>\" + Misc.newline;\n\n writeFile(tmpdir, \"t.stg\", templates);\n ErrorBuffer errors = new ErrorBuffer();\n STGroup group = new STGroupFile(tmpdir+\"/\"+\"t.stg\");\n group.setListener(errors);\n ST template = group.getInstanceOf(\"t-entry\");\n template.add(\"x-3\", \"x\");\n String expected = \"[[x]]\";\n String result = template.render();\n assertEquals(expected, result);\n\n assertEquals(\"[]\", errors.errors.toString());\n }", "public static void main(String[] args) {\n\t\tisArmstrongNumber(153);\n\t}", "@Test\r\n public void testGetDiseasesByHgncGeneId() {\r\n String hgncGeneId = \"HGNC:3689\";\r\n\r\n Set<Disease> result = instance.getDiseasesByHgncGeneId(hgncGeneId);\r\n// System.out.println(\"Human diseases for gene \" + hgncGeneId);\r\n// for (Disease disease : result) {\r\n// System.out.println(disease.getDiseaseId() + \" - \" + disease.getTerm());\r\n// }\r\n assertTrue(result.size() >= 14);\r\n }", "public static void main(String[] args) {\n final int t = SYS_IN.nextInt(); // total test cases\n SYS_IN.nextLine();\n for (int ti = 0; ti < t; ti++) {\n evaluateCase();\n }\n SYS_IN.close();\n }", "@Test\n\tpublic void requestAccountsForCustomer12212_checkListOfAccountsIDs_expectSize3() {\n\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\tthen();\n\t}", "public void testStringID() {\n String testID = generator.generatePrefixedIdentifier(\"test\");\n assertNotNull(testID);\n assertTrue(testID.matches(\"test\" + ID_REGEX));\n }", "public void testGetInputArguments() {\n List<String> args = mb.getInputArguments();\n assertNotNull(args);\n for (String string : args) {\n assertNotNull(string);\n assertTrue(string.length() > 0);\n }\n }", "@Test\n public void testShouldString123WhenInputIsInteger123() {\n int given = 123;\n\n // When: Call numberToString method\n String actual = Kata.numberToString(given);\n\n // Then:\n assertEquals(\"123\", actual);\n }", "public static void main(String[] args) throws IOException {\n\n int t = scanner.nextInt();\n scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n\n for (int tItr = 0; tItr < t; tItr++) {\n int n = scanner.nextInt();\n scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n\n int[] arr = new int[n];\n\n String[] arrItems = scanner.nextLine().split(\" \");\n scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n\n for (int i = 0; i < n; i++) {\n int arrItem = Integer.parseInt(arrItems[i]);\n arr[i] = arrItem;\n }\n\n long result = countInversions(arr);\n cnt = 0;\n System.out.println(result);\n //bufferedWriter.write(String.valueOf(result));\n //bufferedWriter.newLine();\n }\n\n //bufferedWriter.close();\n\n scanner.close();\n }", "public static void main(String[] args) {\n String s1 = \"tweety\";\n String s2 = \"weetty\";\n System.out.println(checkPermutationCountingHashMap(s1, s2));\n System.out.println(checkPermutationSorting(s1, s2));\n System.out.println(checkPermutationCountingArray(s1, s2));\n }", "public static void main(String[] args) {\n\t\tString str1 = \"Madhu12\";\n\n\t\tint numberOfInts =0;\n\t\tint numberOfCaps = 0;\n\t\tint numberOfLow = 0;\n\n\t\tfor(int i = 0; i<str1.length();i++){\n\t\t\tif (Character.isDigit(str1.charAt(i))){\n\t\t\t\tnumberOfInts+=1;\n\t\t\t}else{\n\t\t\t\tif (Character.isLowerCase(str1.charAt(i))){\n\n\t\t\t\t\tnumberOfLow += 1;\n\t\t\t\t}\n\n\t\t\t\tif (Character.isUpperCase(str1.charAt(i))){\n\t\t\t\t\tnumberOfCaps += 1;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tSystem.out.printf(\"The number of uppercase letters in '%s' is %d\"+\n\t\t\t\t\" \\nThe number of lowercase letters '%s' is %d \"+\n\t\t\t\t\"\\nThe number of digits in the '%s' is %d\",\n\t\t\t\tstr1, numberOfCaps,str1, numberOfLow,str1, numberOfInts);\n\n\t}", "@Test\r\n public void testLongTermStorageGetItemCount1()\r\n {\r\n assertEquals(\"The counter is wrong\", BASE_VALUE, testLongTermStorage.getItemCount(item2.getType()));\r\n }", "@Test\n public void test_count_by_app_ids() {\n List<String> ids = Arrays.asList(\"testCountId1\", \"testCountId2\", \"testCountId3\");\n ids.forEach(id -> applicationRepository.save(build(id)));\n //When we count entity providing some ids\n long count = applicationRepository.countByApplicationIds(ids.subList(0, 2));\n //Then we get the expected result\n assertThat((int) count, is(equalTo(2)));\n\n }", "@Test //ExSkip\n public void fieldTocEntryIdentifier() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Insert a TOC field, which will compile all TC fields into a table of contents.\n FieldToc fieldToc = (FieldToc) builder.insertField(FieldType.FIELD_TOC, true);\n\n // Configure the field only to pick up TC entries of the \"A\" type, and an entry-level between 1 and 3.\n fieldToc.setEntryIdentifier(\"A\");\n fieldToc.setEntryLevelRange(\"1-3\");\n\n Assert.assertEquals(\" TOC \\\\f A \\\\l 1-3\", fieldToc.getFieldCode());\n\n // These two entries will appear in the table.\n builder.insertBreak(BreakType.PAGE_BREAK);\n insertTocEntry(builder, \"TC field 1\", \"A\", \"1\");\n insertTocEntry(builder, \"TC field 2\", \"A\", \"2\");\n\n Assert.assertEquals(\" TC \\\"TC field 1\\\" \\\\n \\\\f A \\\\l 1\", doc.getRange().getFields().get(1).getFieldCode());\n\n // This entry will be omitted from the table because it has a different type from \"A\".\n insertTocEntry(builder, \"TC field 3\", \"B\", \"1\");\n\n // This entry will be omitted from the table because it has an entry-level outside of the 1-3 range.\n insertTocEntry(builder, \"TC field 4\", \"A\", \"5\");\n\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.TC.docx\");\n testFieldTocEntryIdentifier(doc); //ExSkip\n }", "int getAchieveInfoCount();", "public static void main(String[] args) {\n\t\tSystem.out.println(FindLongCommSubstringInt(\"tesla\",\"slate\"));\n\t\t//System.out.println(FindLongCommSubstringInt(\"xxxx\",\"slate\"));\n\t\tSystem.out.println(FindLongCommSubstringInt(\"xxxxx\",\"slate\"));\n\t}", "private void testMediatorInvocationCounts(String table) throws AnalyticsException, InterruptedException {\n log.info(\"Checking mediator invocation count in \" + table + \" table:\");\n for (int proxyNumber = 0; proxyNumber < NUMBER_OF_PROXIES; proxyNumber++) {\n for (int mediatorNumber = 1; mediatorNumber <= NUMBER_OF_MEDIATORS; mediatorNumber++) {\n String mediatorId = \"AccuracyTestProxy_\" + proxyNumber + \"@\" + mediatorNumber + \":mediator_\" + \n mediatorNumber;\n int count = getCounts(table, TestConstants.NUMBER_OF_INVOCATION, mediatorId);\n Assert.assertEquals(count, TOTAL_REQUESTS_PER_PROXY, \"Invocation count is incorrect for mediator: \" +\n mediatorId + \" in \" + table + \" table.\");\n }\n log.info(\"AccuracyTestProxy_\" + proxyNumber + \": All mediators: Ok\");\n }\n }", "IdentifiersType createIdentifiersType();", "public static void main(String[] args) throws NumberFormatException,IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint T = Integer.parseInt(br.readLine());\n\t\t\n\t\tfor(int test_case=1;test_case<=T;test_case++) {\n\t\t\tArrayList list = new ArrayList<>();\n\t\t\tint N = Integer.parseInt(br.readLine());\n\t\t\tStringBuilder str = new StringBuilder(br.readLine());\n\t\t\tfor(int i=0; i<str.length(); i++) {\n\t\t\t\tfor(int j=i+1;j<=str.length();j++) {\n\t\t\t\tlist.add(str.substring(i,j));\n\t\t\t\t}\n\t\t\t}\n\t\t\tlist.sort(null);\n\t\t\tSystem.out.println(\"#\"+test_case+\" \"+list.get(N-1));\n\t\t}\n\n\t}", "public static void main(String[] args) {\n System.out.println(countPairs(\"aba\"));\n }", "@Test\r\n public void testGetDiseasesByMgiGeneId() {\r\n String mgiGeneId = \"MGI:95523\";\r\n\r\n Set<Disease> result = instance.getDiseasesByMgiGeneId(mgiGeneId);\r\n// System.out.println(\"Human ortholog diseases for mouse gene \" + mgiGeneId);\r\n// for (Disease disease : result) {\r\n// System.out.println(disease.getDiseaseId() + \" - \" + disease.getTerm());\r\n// }\r\n assertTrue(result.size() >= 14);\r\n\r\n }", "int getArgsCount();", "int getArgsCount();", "int getArgsCount();", "int getArgsCount();", "int getArgsCount();", "int countByExample(AttributeExtendExample example);", "@Test\n public void testReportIteration_withIteration_withCustomSeparator() throws Throwable {\n String sep = \"--\";\n Bundle args = new Bundle();\n args.putString(LongevityClassRunner.ITERATION_SEP_OPTION, sep);\n\n ArgumentCaptor<Description> captor = ArgumentCaptor.forClass(Description.class);\n RunNotifier notifier = mock(RunNotifier.class);\n mRunner = spy(new LongevityClassRunner(NoOpTest.class, args));\n mRunner.setIteration(7);\n mRunner.run(notifier);\n verify(notifier).fireTestStarted(captor.capture());\n Assert.assertTrue(\n \"Description class name should contain the iteration number.\",\n captor.getValue().getClassName().matches(String.join(sep, \"^.*\", \"7$\")));\n }", "public static void main(String[] args) {\n String[] parts = new String[]{\"1S01\", \"1S01\", \"1S01\", \"1S01\", \"1S01\", \"1S02\", \"1S02\", \"1S02\", \"1H01\", \"1H01\", \"1S02\", \"1S01\", \"1S01\", \"1H01\", \"1H01\", \"1H01\", \"1S02\", \"1S02\", \"1M02\", \"1M02\", \"1M02\"};\n\n // Create Product Name Part Number map\n Map<String, String> productNames = new TreeMap<>();\n productNames.put(\"Blue Polo Shirt \", \"1S01\");\n productNames.put(\"Black Polo Shirt\", \"1S02\");\n productNames.put(\"Red Ball Cap \", \"1H01\");\n productNames.put(\"Duke Mug \", \"1M02\");\n\n // Create Product Counter Object and process data\n ProductCounter counter = new ProductCounter(productNames);\n counter.processList(parts);\n counter.printReport();\n }", "public static void main(String[] args) {\n System.out.println(testLibraryParseCardBarCode());\n System.out.println(testLibraryParseRunLibrarianCheckoutBookCommand());\n System.out.println(testLibraryParseRunSubscriberReturnBookCommand());\n System.out.println(testparseBookId());\n System.out.println(testparseRunSubscriberCheckoutBookCommand());\n }", "public static void main(String[] args) {\n\t\t\t\n\t\t\tMultiSet<String> ms = new MultiSetDecorator<>(new HashMultiSet<>());\n\t\t\tChrono chronoHash = new Chrono();\n\t\t\twordcount(ms);\n\t\t\tchronoHash.stop();\n\t\t\tSystem.out.println(\"avec ArrayList\");\n\t\t\tMultiSet<String> naif = new MultiSetDecorator<>(new NaiveMultiSet<String>());\n\t\t\tChrono chronoNaif = new Chrono();\n\t\t\twordcount(naif);\n\t\t\tchronoNaif.stop();\n\t\t\t\n\t\t}", "public void testGetUserTrials() {\n exp = new Experiment(\"10\");\n ArrayList<Trial> toSet = this.createTrials();\n exp.setTrials(toSet);\n assertEquals(\"getUserTrials does not work\", \"0\", exp.getUserTrials(\"id1\").get(0).getId());\n assertEquals(\"getUserTrials does not work\", \"9\", exp.getUserTrials(\"id2\").get(exp.getUserTrials(\"id2\").size()-1).getId());\n }", "public abstract void countLaunchingActivities(int num);", "public static void main(String[] args) {\n counting(new Object[] {\n new Bird(),\n new Duck(),\n new Chicken(),\n new Rooster(),\n new Parrot(new Dog()),\n new Fish(),\n new Shark(),\n new Clownfish(),\n new Dolphin(),\n new Dog(),\n new Butterfly(),\n new Cat()\n });\n\n }", "int getOtherIdsCount();", "int countByExample(TVmManufacturerExample example);", "@Test\n public void idTest() {\n // TODO: test id\n }", "@Test\n public void idTest() {\n // TODO: test id\n }", "@DisplayName(\"SP800-73-4.42 test\")\n\t@ParameterizedTest(name = \"{index} => oid = {0}\")\n\t//@MethodSource(\"sp800_73_4_DiscoveryObjectTestProvider\")\n @ArgumentsSource(ParameterizedArgumentsProvider.class)\n\tvoid sp800_73_4_Test_42(String oid, TestReporter reporter) {\n\t\t\n\t\tPIVDataObject o = AtomHelper.getDataObject(oid);\n\t\t\n\t\tboolean globalPINisPrimary = ((DiscoveryObject) o).globalPINisPrimary();\n\t\t\n\t\tif(globalPINisPrimary) {\n\t\t\ts_logger.info(\"Global PIN is the primary PIN used to satisfy the PIV ACRs for command execution and object access.\");\n\n\t\t\ttry {\n\t\t\t\tCardUtils.authenticateInSingleton(true);\n\t\t\t} catch (ConformanceTestException e) {\n\t\t\t\tfail(e);\n\t\t\t}\n\t\t} else {\n\t\t\ts_logger.info(\"PIV Card Application PIN is the primary PIN used to satisfy the PIV ACRs for command execution and object access.\");\n\n\t\t\ttry {\n\t\t\t\tCardUtils.authenticateInSingleton(false);\n\t\t\t} catch (ConformanceTestException e) {\n\t\t\t\tfail(e);\n\t\t\t}\n\t\t}\n\t\t\t\n\t}", "long countByExample(IymDefAssignmentExample example);", "@Test\n public void getID() {\n\n }", "public void testGetSubIntervalCount() {\n TaskSeriesCollection tsc = createCollection3();\n }", "@Test\n\tpublic void testValidatePromptIds() {\n\t\ttry {\n\t\t\tfor(String emptyValue : ParameterSets.getEmptyValues()) {\n\t\t\t\tAssert.assertNull(SurveyResponseValidators.validatePromptIds(emptyValue));\n\t\t\t}\n\t\t\t\n\t\t\tfor(String simpleValidList : ParameterSets.getSimpleValidLists()) {\n\t\t\t\ttry {\n\t\t\t\t\tSurveyResponseValidators.validatePromptIds(simpleValidList);\n\t\t\t\t}\n\t\t\t\tcatch(ValidationException e) {\n\t\t\t\t\tfail(\"A valid list failed validation.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(ValidationException e) {\n\t\t\tfail(\"A validation exception was thrown: \" + e.getMessage());\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tString str = \"aaa\";\n\t\tSystem.out.println(countSubs(str));\n\t}" ]
[ "0.58356756", "0.5643694", "0.53476745", "0.53120995", "0.51540637", "0.51304716", "0.50592357", "0.50332886", "0.50042164", "0.49822244", "0.49704313", "0.4968339", "0.49462804", "0.49261093", "0.4922097", "0.4916097", "0.48984516", "0.48850554", "0.48599166", "0.48479018", "0.4847627", "0.48406115", "0.48348278", "0.48216563", "0.4821169", "0.4814255", "0.4803247", "0.47986472", "0.47739294", "0.4726135", "0.47233015", "0.47059616", "0.47023466", "0.4698354", "0.46921405", "0.4685946", "0.46855617", "0.46784952", "0.46657762", "0.4654299", "0.463959", "0.46374384", "0.46368557", "0.46303418", "0.4630157", "0.46162376", "0.46129543", "0.46091178", "0.4607043", "0.45945176", "0.4590016", "0.45873377", "0.4586026", "0.45842516", "0.45730332", "0.45684534", "0.4567854", "0.4564283", "0.4563145", "0.45594564", "0.4558413", "0.45502785", "0.4546878", "0.45308122", "0.45248002", "0.4518017", "0.4515819", "0.4510165", "0.45034826", "0.45030972", "0.45016748", "0.4497531", "0.44876269", "0.44862965", "0.4484734", "0.44839004", "0.4481487", "0.447975", "0.447975", "0.447975", "0.447975", "0.447975", "0.4477943", "0.4470479", "0.44676065", "0.44634292", "0.44571736", "0.4456426", "0.44527802", "0.44424948", "0.44394487", "0.4438549", "0.44344535", "0.44344535", "0.4433715", "0.44326606", "0.44220895", "0.4421305", "0.4420686", "0.44180855" ]
0.8549768
0
cette methode decremente le pin_count
public void decrementerPinCount() { this.pin_count--; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void decrementGazingCount() {\n // TODO - You fill in here.\n mGazingThreads.decrementAndGet();\n }", "public void decrease() {\r\n\t\t\tsynchronized (activity.getTaskTracker()) {\r\n\t\t\t\tactivity.getTaskTracker().count--;\r\n\t\t\t\tLog.d(LOGTAG, \"Decremented task count to \" + count);\r\n\t\t\t}\r\n\t\t}", "public void decreasePigsCounter() {\n --_pigsCounter;\n }", "public void decreaseRemainingPausesCount() {\r\n remainingPausesCount--;\r\n }", "void decCount() {\n if (refCount > 0) {\n --refCount;\n }\n }", "void recount();", "private void decrementCounter()\r\n\t{\r\n\t\tthis.counter--;\r\n\t}", "public void decrementLiveCount() {\n liveCount = liveCount - 15;\n System.out.println(\"You're bad, live: \" + liveCount);\n }", "public void decPieceCount () {\n\t\tm_PieceCount --;\n\t}", "public void decrementStunCountdown()\n {\n addStunCountdown(-1);\n }", "public void decrementNumStones() {\n this.numStones--;\n }", "public void removeCount() {\n \t\tdupCount--;\n \t}", "public void decrease(int number) {\r\n this.count -= number;\r\n }", "public void decrease(int number) {\r\n this.count -= number;\r\n }", "void decrementAddedCount() {\n addedCount.decrementAndGet();\n }", "public void decRetryCount() {\n\t\tint cont = getRetryCount(); \n\t\tif (cont > 0) cont--;\n\t\tsetRetryCount(cont);\n\t}", "public void kurang(){\n hitung--;\n count.setText(Integer.toString(hitung));\n }", "public int restarCantidadPastillas(){\n\t\treturn cantidadPastillas--;\n\t}", "void upCount(){\n count++;\n }", "public void removeKickVote()\n\t{\n\t\tnumberOfKickVotes--;\n\t}", "public void decreaseCount(View view) {\n if (count > 0) {\n count--;\n }\n display(count);\n }", "public void ferdig(){\n antallTelegrafister--;\n }", "public void decrementa(View view) {\n TextView mensagem = findViewById(R.id.Mensagem);\n count--;\n\n Integer i = new Integer(count);\n mensagem.setText(i.toString());\n\n }", "public void decrementRechargeTimes();", "public void decrementCurrentNumberOfRegisterPushed(){\n currentNumberOfRegisterPushed--;\n }", "void decUsage() {\n incUsage(-1);\n }", "public void decrease() {\r\n --lives;\r\n }", "public void decrement() {\n sync.decrement();\n }", "public void unpin();", "public void unpin();", "public void removeMissiles(){\n nunMissiles--;\n }", "public void decrementPossiblePoints() {\n if (groupScore == 1) {groupScore = 0; return;}\n if (groupScore - (groupScore / 2) >= 0) {\n groupScore -= (groupScore / 2);\n }\n }", "public void decrementVictoryPoints() {\n\t\tthis.totalVictoryPoints++;\n\t}", "private synchronized static void upCount() {\r\n\t\t++count;\r\n\t}", "public void pierdeUnaVida() {\n numeroDeVidas--;\n }", "private void devolver100() {\n cambio = cambio - 100;\n de100--;\n cambio100++;\n }", "public void markUnsold(){\n\n myMaxRejectCountCount--;\n }", "long decrementAndGet();", "void decrease();", "void decrease();", "public int getPinCount();", "public void setdecrementcounter() {\n\t\tmPref.edit().putInt(PREF_CONVERTED, counter - 1).commit();\r\n\t}", "public void decrementTotalScore(){\n totalScore -= 1;\n }", "public boolean removeCount()\n {\n count--;\n if (count <= 0)\n {\n return false;\n }\n else\n {\n \treturn true;\n }\n }", "public void decrementHops() {\n\t\tthis.hopCount--;\n\t}", "public void decrementLoopCounter() throws EndTaskException {\n\t\tgoToLoopCounter();\n\t\tpickBeeper();\n\t\tgoToBeeperStock();\n\t\tputBeeper();\n\t}", "public void onClickSubtract(View view) {\n countJB--;\n updateCountTV();\n }", "private void decrementOpponentRechargeTimes()\n\t{\n\t\tfor (Map.Entry<Skills, Integer> pair : rechargingOpponentSkills.entrySet())\n\t\t{\n\t\t\tint val = pair.getValue();\n\t\t\tSkills s = pair.getKey();\n\t\t\t\n\t\t\tif (val > 0)\n\t\t\t{\n\t\t\t\trechargingOpponentSkills.put(s, --val);\n\t\t\t}\n\t\t}\n\t}", "public void lostLife(){\r\n\t\tthis.lives--;\r\n\t}", "void removePouncee(Long pouncee);", "boolean decrementPlannedInstances();", "public void decrementTotal(){\n total--;\n }", "public final void diminuerNbVie() {\n this.nbVie--;\n }", "private void decrConnectionCount() {\n connectionCount.dec();\n }", "public void decrement() {\n\t\tnumber--;\n\t}", "public synchronized void delete() {\ncounter -= 1;\n}", "public void resetCount() {\n count = 0;\n }", "public void remove_transfered_points(int points) {\n\t\tthis.balance = this.balance - points;\n\t\tif(this.balance < 10000) this.status = \"Bronze\";\n\t\telse if(this.balance >= 10000) this.status = \"Silver\";\n\t\t\n\t}", "public void countHits() {\nif (this.hitpoints <= 0) {\nreturn;\n}\nthis.hitpoints = this.hitpoints - 1;\n}", "public void decrement(){\n if (value >0) {\n value -= 1;\n }\n }", "public void decNumKeys() { numKeys--; }", "public void setSteak(double countNo) {\n steak = countNo;\r\n }", "@Override\r\n\tpublic void decreaseNbProjectilesWith(int amount) {\r\n\t\tif (getNbProjectiles() > 0)\t\r\n\t\t\tsetNbProjectiles( getNbProjectiles() - amount );\t\t\r\n\t}", "public void RemoveCredits(long credits)\n {\n this.credits -= credits;\n }", "public void decrement() {\r\n\t\tcurrentSheeps--;\r\n\t}", "public static void resetCount() {\n count = 1;\n }", "public void pagar(int precio){\r\n this.dinero -=precio;\r\n }", "protected synchronized void decreaseThreadsNumber() {\r\n threadNumber--;\r\n }", "private void incrementarPuntaje(int puntos) {\n // TODO implement here\n }", "void incrementCount();", "@KeepForSdk\n public void release() {\n if (this.zzm.decrementAndGet() < 0) {\n Log.e(\"WakeLock\", String.valueOf(this.zze).concat(\" release without a matched acquire!\"));\n }\n String zza = zza(null);\n synchronized (this.zza) {\n if (this.zzi) {\n int i;\n Integer[] numArr = (Integer[]) this.zzj.get(zza);\n if (numArr != null) {\n if (numArr[0].intValue() == 1) {\n this.zzj.remove(zza);\n i = 1;\n } else {\n numArr[0] = Integer.valueOf(numArr[0].intValue() - 1);\n }\n }\n i = 0;\n }\n if (!this.zzi) {\n }\n }\n zza(0);\n }", "@Override\n public synchronized void release(long delta) {\n if (delta < 0) {\n throw new IllegalArgumentException(\"resource counter delta must be >= 0\");\n }\n long prev = count;\n count+= delta;\n if (prev <= 0 && count > 0 ) {\n turnOn();\n }\n }", "public void decrementNumberOfBoats() {\n\t\tnumOfBoats--;\n\t}", "private static int removeStatPoints(int statPoints){\r\n statPoints--;\r\n return statPoints;\r\n }", "public void setNumDeparting() {\n if (isStopped() && !embarkingPassengersSet){\n \tRandom rand = new Random();\n \tint n = rand.nextInt(this.numPassengers+1);\n \tif (this.numPassengers - n <= 0) {\n \t\tthis.numPassengers = 0;\n n = this.numPassengers;\n \t} else {\n this.numPassengers = this.numPassengers - n;\n }\n trkMdl.passengersUnboarded(trainID, n);\n }\n \t//return 0;\n }", "public void resetCount() {\n\t\tcount = 0;\n\t}", "void decrementsGops();", "private void decrementTriesRemaining() {\n if (temps==null) temps = JCSystem.makeTransientByteArray(NUMTEMPS, JCSystem.CLEAR_ON_RESET);\n temps[TRIES] = (byte)(triesLeft[0]-1);\n Util.arrayCopyNonAtomic( temps, TRIES, triesLeft, (short)0, (short)1 );\n }", "private void knockDown( int count ) {\n for (int i=0; i<count; ++i) {\n int x = 1+r.nextInt(rows);\n int y = 1+r.nextInt(cols);\n if (!downWall( x, y, r.nextInt(4))) --i;\n }\n }", "public void releasePingLock() {\r\n\t\tbeingPinged.set(false);\r\n\t}", "public void decreaseHealingNumber() {\n healingNumber--;\n }", "@Override\n\tpublic void afterPerDown(String uri, long count, long rcount) {\n\n\t}", "public void decMonstres() {\n\t\tthis.nbMonstres -= 1;\n\t}", "int numberOfBlocksToRemove();", "public void onUntouch(final int pointerCount);", "long getAndDecrement();", "public int disminuir(int contador){\nSystem.out.println(\"Escoge la cantidad a disminuir\");\nnum=teclado.nextInt();\nfor(int i=0 ; i<num ; i++){\ncontador=contador-1;}\nreturn contador;}", "public void reduceCount()\n {\n minesLeft--;\n repaint();\n if (minesLeft == 0 && minesFound == numMines)\n {\n endGame(true);\n }\n }", "void decrementCommentLikes(long lifeHackId) throws DaoException;", "public void incCount() { }", "public void reverseNextCount(View view) {\n \tButton minus = (Button) findViewById(R.id.minus);\n \t\n if (countBackwards) {\n \tcountBackwards = false;\n \tminus.setBackgroundDrawable(defaultDrawable);\n } else {\n \tcountBackwards = true;\n \tdefaultDrawable = minus.getBackground();\n \tminus.setBackgroundColor(Color.RED);\n }\n\t}", "public void decreaseRepDegree() {\r\n\t\tactualRepDegree--;\r\n\r\n\t}", "public void resetMissedCallsCount();", "public void takeLife()\n\t{\n\t\tlives --;\n\t}", "public void decrementPrayerPoints(double amount) {\r\n if (entity.getAttribute(\"INFINITE_PRAYER\") != null) {\r\n return;\r\n }\r\n prayerPoints -= amount;\r\n if (prayerPoints < 0) {\r\n prayerPoints = 0;\r\n }\r\n //\t\tif (prayerPoints > staticLevels[PRAYER]) {\r\n //\t\t\tprayerPoints = staticLevels[PRAYER];\r\n //\t\t}\r\n if (entity instanceof Player) {\r\n PacketRepository.send(SkillLevel.class, new SkillContext((Player) entity, PRAYER));\r\n }\r\n }", "private void decWaiters()\r\n/* 451: */ {\r\n/* 452:537 */ this.waiters = ((short)(this.waiters - 1));\r\n/* 453: */ }", "public void decrementScore(int hole) {\n\t\tif (hole < 1 || hole > 18) return;\n\t\tif (scores[hole - 1] > 0) {\n\t\t\tscores[hole - 1]--;\n\t\t}\n\t}", "public void subtractCount(String t) {\n\t\tif (tagList.containsKey(t)) {\n\t\t\tif (tagList.get(t) > 0) {\n\t\t\t\tInteger previousCount = tagList.get(t);\n\t\t\t\ttagList.put(t, previousCount - 1);\n\t\t\t} else {\n\t\t\t\tSystem.out.print(\"Tag count is already zero!\");\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.print(\"Tag does not exist!\");\n\t\t}\n\t}", "public final int decrementPendingCountUnlessZero()\n/* */ {\n/* */ int i;\n/* */ \n/* */ \n/* 549 */ while (((i = this.pending) != 0) && \n/* 550 */ (!U.compareAndSwapInt(this, PENDING, i, i - 1))) {}\n/* 551 */ return i;\n/* */ }", "public void zeraEmpates() {\r\n contaEmpates = 0;\r\n }" ]
[ "0.6516814", "0.63816845", "0.6379723", "0.63465506", "0.6334019", "0.61610556", "0.6149597", "0.614528", "0.61300534", "0.6071335", "0.6057952", "0.59765255", "0.5948149", "0.5948149", "0.59462273", "0.59323865", "0.590444", "0.588798", "0.58657634", "0.5859603", "0.58585864", "0.5850915", "0.5847764", "0.5843367", "0.5831456", "0.58208495", "0.5820035", "0.5780354", "0.5731748", "0.5731748", "0.57157755", "0.5701766", "0.5697036", "0.56922734", "0.56915206", "0.5660729", "0.56349933", "0.56190693", "0.5606208", "0.5606208", "0.56042814", "0.56030077", "0.5595178", "0.5595148", "0.5593938", "0.5588006", "0.5584574", "0.5573342", "0.5558433", "0.5534206", "0.55303276", "0.55270606", "0.5516798", "0.55037105", "0.5490325", "0.5489041", "0.5488131", "0.5487132", "0.54755664", "0.54712903", "0.54696244", "0.5463271", "0.54630876", "0.54597163", "0.5447465", "0.5434535", "0.5430725", "0.54246825", "0.54212856", "0.5414735", "0.5410964", "0.54057837", "0.5401809", "0.5399087", "0.5393865", "0.5389138", "0.5389024", "0.538611", "0.53837305", "0.5381441", "0.5363357", "0.5361181", "0.53581095", "0.53549886", "0.5335351", "0.53223026", "0.53136986", "0.5300967", "0.52993363", "0.52967674", "0.5284428", "0.527793", "0.52755034", "0.52725893", "0.5266574", "0.52633166", "0.5257936", "0.52520615", "0.5250862", "0.5246611" ]
0.8049414
0
methode qui renitialise de nouveau une Frame
public void renitialiser() { buffer = new byte[Constants.PAGESIZE]; idDeLaPage = null; pin_count = 0; flagDirty = 0; estCharge = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "FRAME createFRAME();", "public static void changeFrame() {\r\n\t\t\r\n\t}", "Frame createFrame();", "public void buildFrame();", "public abstract void newWindow(ReFrame newFrame);", "void finishFrame() {\n\t\tcontrollers[CONTROLLER_OLD].set(controllers[CONTROLLER_NEW]);\n\t}", "public void limpaFrameInicial ()\n {\n this.getContentPane().remove(jPanelApresentacao);\n this.repaint();\n }", "NOFRAME createNOFRAME();", "public void refreshFrame() {\n switchWindow();\n this.switchToFrame(\"botFr\");\n }", "public FirstNewFrame() {\n\t\tjbInit();\n\t}", "public abstract void deleteWindow(ReFrame newFrame);", "private void setFrame(Pool p)\n\t{\n\t\tthis.frame = new Frame(p);\n\t}", "public void addChildFrame(JFrame frame);", "public void rebuildFrame(){\n \n // Re-initialize frame with default attributes\n controlFrame.dispose();\n controlFrame = buildDefaultFrame(\"CSCI 446 - A.I. - Montana State University\");\n \n // Initialize header with default attributes\n header = buildDefaultHeader();\n \n // Initialize control panel frame with default attributes\n controlPanel = buildDefaultPanel(BoxLayout.Y_AXIS);\n \n // Combine objects\n controlPanel.add(header, BorderLayout.NORTH);\n controlFrame.add(controlPanel);\n \n }", "@Override\n\tpublic void onNewFrame(HeadTransform headTransform) {\n\t}", "public frame() {\r\n\t\tframeOwner = 0;\r\n\t\tassignedProcess = 0;\r\n\t\tpageNumber = 0;\r\n\t}", "protected HFrame(){\n\t\tinit();\n\t}", "public void newPage(FrameDesc fdesc) {\n // no need to update frame state\n }", "private void createFrame() {\n System.out.println(\"Assembling \" + name + \" frame\");\n }", "private void createFrame(){\n System.out.println(\"Assembling \" + name + \" frame.\");\n }", "public VuePlateaux(JFrame frame,GameManager gm){\n super();\n this.frame = frame;\n frame.setPreferredSize(new Dimension(1200,500));\n gm.addObserver(this);\n this.shown = false;\n this.gm = gm;\n this.save = new JButton(\"sauvegarder\");\n this.contentIAdversaire = new JPanel();\n this.contentJoueur = new JPanel();\n this.plateaux = new JPanel();\n this.munitions = new JPanel();\n this.options = new JPanel();\n this.retourMenu = new JButton(\"Retourner au Menu\");\n setAffichage();\n }", "public void setContent (ZFrame frame)\n {\n if (content != null)\n content.destroy ();\n content = frame;\n }", "public void setContent (ZFrame frame)\n {\n if (content != null)\n content.destroy ();\n content = frame;\n }", "public FrameInsert() {\n initComponents();\n }", "private Frame3() {\n\t}", "public void closeFrame() {\n framesize = wordpointer = bitindex = -1;\n }", "public NewJFrame() {\n initComponents();\n IniciarTabla();\n \n \n // ingreso al githup \n \n }", "public void putFrame()\n {\n if (currImage != null)\n {\n super.putFrame(currImage, faceRects, new Scalar(0, 255, 0), 0);\n }\n }", "public void setFrame(Frame f){\n\t\tthis.frame = f;\n\t\t//if (singleInstance.mg == null || singleInstance.cpg == null) throw new AssertionViolatedException(\"Forgot to set important values first.\");\n\t}", "default void projectFrameClosed() {\n }", "public void onFrameRefresh(ym iba) {}", "void setupFrame()\n {\n int wd = shopFrame.getWidth();\n sellItemF(wd);\n\n requestItemF(wd);\n setAllVisFalse();\n }", "private void setFrame() {\r\n this.getContentPane().setLayout(null);\r\n this.addWindowListener(new WindowAdapter() {\r\n public void windowClosing(WindowEvent evt) {\r\n close();\r\n }\r\n });\r\n MainClass.frameTool.startup(this, FORM_TITLE, FORM_WIDTH, FORM_HEIGHT, \r\n false, true, false, false, FORM_BACKGROUND_COLOR,\r\n SNAKE_ICON);\r\n }", "private void insertNewInternalFrame(JInternalFrame treeDisplay) {\n jInternalFrameTree = treeDisplay;\n jLayeredPane1.add(jInternalFrameTree, JLayeredPane.PALETTE_LAYER);\n jInternalFrameTree.setMaximizable(true);\n jInternalFrameTree.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);\n jInternalFrameTree.setIconifiable(true);\n jInternalFrameTree.setClosable(true);\n jInternalFrameTree.setVisible(true);\n jInternalFrameTree.addMouseListener(new MouseAdapter(){\n public void mouseClicked(MouseEvent event){\n doMouseClicked(event);\n }\n\n private void doMouseClicked(MouseEvent event) {\n if(event.getButton() == MouseEvent.BUTTON3 && event.getComponent().getParent().getParent() instanceof JSplitPane){\n jInternalFrameTree = ((JInternalFrame)event.getComponent());\n JPopupMenu jPopupMenu = new JPopupMenu();\n JMenuItem jMenuItem = new JMenuItem(\"Window Preview\");\n jPopupMenu.add(jMenuItem);\n jMenuItem.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n setNewWindowEnabled(false);\n }\n\n private void setNewWindowEnabled(boolean b) {\n JFrame frame = new JFrame();\n JMenuBar jMenuBar = new JMenuBar();\n JMenu jMenu = new JMenu(\"Restore size\");\n jMenu.addMouseListener(new MouseAdapter() {\n public void mouseClicked(MouseEvent event){\n jMenuSelected(event);\n }\n\n private void jMenuSelected(MouseEvent event) {\n if(event.getComponent() instanceof JMenu){\n Container container = event.getComponent().getParent().getParent().getParent();\n jInternalFrameTree = new JInternalFrame(((JFrame)event.getComponent().getParent().getParent().getParent().getParent()).getTitle());\n jInternalFrameTree.setToolTipText(\"teste\");\n //jInternalFrameTree.add(null);\n insertNewInternalFrame(jInternalFrameTree);\n }\n }\n });\n jMenuBar.add(jMenu);\n frame.setJMenuBar(jMenuBar);\n frame.setTitle(jInternalFrameTree.getTitle());\n frame.add(jInternalFrameTree.getContentPane());\n try {\n jInternalFrameTree.setClosed(true);\n } catch (PropertyVetoException ex) {\n Logger.getLogger(Tool.class.getName()).log(Level.SEVERE, null, ex);\n }\n //jInternalFrameTree.dispose();\n //jInternalFrameTree = null;\n frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n frame.setSize(800, 800);\n frame.setVisible(true);\n }\n });\n jPopupMenu.show(event.getComponent(), event.getX(), event.getY());\n }\n }\n });\n }", "@Override\n public void dispose(){\n getFrame().setVisible(true);\n //Cerramos\n super.dispose();\n }", "@Override\n public void dispose(){\n getFrame().setVisible(true);\n //Cerramos\n super.dispose();\n }", "@Override\n public void dispose(){\n getFrame().setVisible(true);\n //Cerramos\n super.dispose();\n }", "@Override\n public void dispose(){\n getFrame().setVisible(true);\n //Cerramos\n super.dispose();\n }", "public void setFrame(int newFrame) {\r\n if (newFrame < maxFrames) {\r\n frame = newFrame;\r\n }\r\n }", "public BreukFrame() {\n super();\n initialize();\n }", "public Credits (JFrame frame)\r\n {\r\n super();\r\n this.setLayout (null); \r\n count = 0;\r\n this.frame = frame;\r\n playEnd();\r\n \r\n }", "public void clearChildFrames();", "@Override\n protected void clear(JFrame frame){\n frame.getContentPane().removeAll();\n }", "public void setFrame(double anX, double aY, double aWidth, double aHeight)\n{\n setFrameXY(anX, aY);\n setFrameSize(aWidth, aHeight);\n}", "public void setFrame(ChessFrame f)\n {\n frame = f;\n }", "public NewFrame() {\n initComponents();\n }", "public void createFrame() {\r\n System.out.println(\"Framing: Adding the log walls.\");\r\n }", "@Override\n\t\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\t\taddFrame.dispose();\n\t\t\t\t\t\t}", "public void onFrame(Controller controller) {\n\r\n\t}", "private void changeFrame() {\n\t\t\n\t\tselected.setVisible(!selected.isVisible());\n\t}", "Frame2(){\n initComponants();//this is a method\n }", "public NewJFrame1() {\n initComponents();\n\n dip();\n sh();\n }", "public FrameNuevaCategoria() {\n initComponents();\n limpiar();\n }", "public void initializeFrame() {\n frame.getContentPane().removeAll();\n createComponents(frame.getContentPane());\n// frame.setSize(new Dimension(1000, 600));\n }", "Frame getFrame();", "private void removeFrame() {\n RelativeFrame frame = selectRelativeFrame(\"Which frame would you like to delete?\");\n for (Event event: world.getEvents()) {\n if (event.getFrame() == frame) {\n event.changeFrame(world.getMasterFrame());\n }\n }\n world.getMasterFrame().removeRelativeFrame(frame);\n String masterName = world.getMasterFrame().getName();\n System.out.println(\"Removed \" + frame.getName() + \"and moved all events defined in it to \" + masterName + \"!\");\n }", "@Override\n protected Object getModelObject()\n {\n return frame;\n }", "public SameGnomeFrame() {\n\t\tsetSize(DEFUALT_WIDTH,DEFUALT_WIDTH);\n\t\tintializeGridBall();\n\t\tgrid = new GridComponent(gridBall);\n\t\tadd(grid);\n\t\t\n\t}", "public void unsetFrame()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(FRAME$24);\n }\n }", "public NewJFrame() {\n initComponents();\n // HidenLable.setVisible(false);\n }", "protected void createFrames() {\n createStandingRight();\n createStandingLeft();\n createWalkingRight();\n createWalkingLeft();\n createJumpingRight();\n createJumpingLeft();\n createDying();\n }", "private FrameUIController(){\r\n\t\t\r\n\t}", "public addStFrame() {\n initComponents();\n }", "FRAMESET createFRAMESET();", "public SubFrame(String title, MainFrame main, RefreshablePanel panel) throws HeadlessException {\n super(title);\n Toolkit toolkit = Toolkit.getDefaultToolkit();\n Dimension screenSize = toolkit.getScreenSize();\n this.main = main;\n main.newFrame(this);\n this.panel = panel;\n addWindowListener(new java.awt.event.WindowAdapter() {\n @Override\n public void windowClosed(java.awt.event.WindowEvent windowEvent) {\n main.removeFrame((SubFrame) windowEvent.getSource());\n }\n });\n setSize((int)(screenSize.width / 1.75), (int)(screenSize.height / 1.75));\n setLocation(screenSize.width / 4, screenSize.height / 4);\n \n setContentPane(panel);\n\n setDefaultCloseOperation(DISPOSE_ON_CLOSE);\n\n setVisible(true);\n\n }", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t\t\t{\n\t\t\t\t\tcreatePCLocal(false);\n\t\t\t\t\tJFramePort.this.dispose();\n\t\t\t\t\t}", "private void createAndInitPictureFrame() {\r\n frame = new com.FingerVeinScanner.Frame(picture,picture2);\r\n\t\tthis.pictureFrame = frame.getFrame(); // Create the JFrame.\r\n\t\tthis.pictureFrame.setResizable(true); // Allow the user to resize it.\r\n\t\tthis.pictureFrame.getContentPane().\r\n\t\tsetLayout(new BorderLayout()); // Use border layout.\r\n\t\tthis.pictureFrame.setDefaultCloseOperation\r\n\t\t(JFrame.DISPOSE_ON_CLOSE); // When closed, stop.\r\n\t\tthis.pictureFrame.setTitle(picture.getTitle());\r\n\t\t//PictureExplorerFocusTraversalPolicy newPolicy =\r\n\t\t//\tnew PictureExplorerFocusTraversalPolicy();\r\n\t\t//this.pictureFrame.setFocusTraversalPolicy(newPolicy);\r\n\t}", "private void updateFrame() {\n post(new Runnable() {\n @Override\n public void run() {\n if (Build.VERSION.SDK_INT <= 23)\n mBackground.invalidateSelf();\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {\n mFrame.setBackgroundDrawable(mBackground);\n } else {\n mFrame.setBackground(mBackground);\n }\n if (Build.VERSION.SDK_INT <= 23)\n mBackground.invalidateSelf();\n setContainerMargins(mBackground.getBorder_width());\n mFrame.post(new Runnable() {\n @Override\n public void run() {\n bitmap = Bitmap.createBitmap(mFrame.getWidth(), mFrame.getHeight(), Bitmap.Config.ARGB_8888);\n bitmapCanvas = new Canvas(bitmap);\n mFrame.getBackground().draw(bitmapCanvas);\n if (hasLegendText() || hasLegendIcon()) {\n eraseBitmap(bitmapCanvas, mLegendContainer);\n }\n mFrame.setBackgroundDrawable(new BitmapDrawable(bitmap));\n listenToResize = true;\n }\n });\n }\n });\n }", "static void abrir() {\n frame = new ModificarPesos();\n //Create and set up the window.\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n //Set up the content pane.\n frame.addComponentsToPane(frame.getContentPane());\n //Display the window.\n frame.pack();\n frame.setVisible(true);\n }", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t\t\t{\n\t\t\t\t\tcreatePCLocal(true);\n\t\t\t\t\tJFramePort.this.dispose();\n\t\t\t\t\t}", "public FrameJogo() {\n initComponents();\n createBufferStrategy(2);\n Thread t = new Thread(this);\n t.start();\n }", "public SMFrame() {\n initComponents();\n updateComponents();\n }", "private void makeFrame(){\n frame = new JFrame(\"Rebellion\");\n\n frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n frame.setSize(800,800);\n\n makeContent(frame);\n\n frame.setBackground(Color.getHSBColor(10,99,35));\n frame.pack();\n frame.setVisible(true);\n }", "public void closeDebugFrame()\n {\n dispose();\n }", "public updateFrame() {\n initComponents();\n }", "public OrganizerFrame() {\n super(\"Органайзер\");\n init();\n }", "public NewJFrame() {\n initComponents();\n \n }", "public void onFramePickup(ym iba) {}", "private Frame getCurrentFrame() {\n\t\treturn null;\r\n\t}", "void setMainFrame(NewMainFrame mainFrame) {\n this.mainFrame = mainFrame;\n }", "private void buildFrame(){\n this.setVisible(true);\n this.getContentPane();\n this.setSize(backgrondP.getIconWidth(),backgrondP.getIconHeight());\n this.setDefaultCloseOperation(EXIT_ON_CLOSE);\t \n\t }", "private void agregarAlPanel(JInternalFrame frame)\n\t{\n\t\tframe.setBounds(10 * (contentPane.getAllFrames().length + 1), 50 + (10 * (contentPane.getAllFrames().length + 1)), (int)frame.getBounds().getWidth(), (int)frame.getBounds().getHeight());\n\t\tcontentPane.add(frame);\n\t\tframe.moveToFront();\n\t}", "public void reverseFrame() {\r\n if (reversedImage) {\r\n reversedImage = false;\r\n } else {\r\n reversedImage = true;\r\n }\r\n }", "public NewJFrame() {\n initComponents();\n mcam.setLineWrap(true);\n\n }", "public void perdio() {\n\t\tthis.juego = null;\n\t\thiloJuego = null;\n\t\tthis.panelJuego = null;\n\t\tthis.dispose();\n\t\tGameOver_Win go = new GameOver_Win(0);\n\t\tgo.setVisible(true);\n\t\t\n\t}", "public frameTermino() {\n initComponents();\n conCategorias = false;\n }", "public void xsetFrame(com.walgreens.rxit.ch.cda.StrucDocTable.Frame frame)\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocTable.Frame target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocTable.Frame)get_store().find_attribute_user(FRAME$24);\n if (target == null)\n {\n target = (com.walgreens.rxit.ch.cda.StrucDocTable.Frame)get_store().add_attribute_user(FRAME$24);\n }\n target.set(frame);\n }\n }", "private void customizeFrame(JFrame frame) {\r\n frame.setTitle(getTitle());\r\n frame.setResizable(false);\r\n frame.setPreferredSize(new Dimension(width + 15, height + 36));\r\n frame.setVisible(true);\r\n\r\n frame.setLayout(new BorderLayout());\r\n frame.add(panel, BorderLayout.CENTER);\r\n frame.setLocationRelativeTo(null);\r\n\r\n frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\r\n frame.pack();\r\n }", "public void actionPerformed(ActionEvent e){\n\t\t\t\tframe.setSize(368, 385);\n\t\t\t\tframe.remove(gp);\n\t\t\t\tframe.add(op);\n\t\t\t\top.requestFocus();\n\t\t\t\tmoveframe.dispose();\n\t\t\t\tframe.setLocationRelativeTo(null);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "private void addFrame() {\n String name = selectString(\"What is the name of this frame?\");\n ReferenceFrame frame = selectFrame(\"What frame are you defining this frame relative to?\");\n double v = selectDouble(\"How fast is this frame moving (as a fraction of c)?\", -1, 1);\n try {\n frame.boost(name, v);\n System.out.println(\"Frame added!\");\n } catch (NameInUseException e) {\n System.out.println(\"A frame with that name already exists!\");\n } catch (FasterThanLightException e) {\n System.out.println(\"Nothing can move as quickly as light!\");\n }\n }", "public internalFrame() {\r\n initComponents();\r\n }", "void frameSetUp() {\r\n\t\tJFrame testFrame = new JFrame();\r\n\t\ttestFrame.setSize(700, 400);\r\n\t\ttestFrame.setResizable(false);\r\n\t\ttestFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\ttestFrame.setLayout(new GridLayout(0, 2));\r\n\t\tmainFrame = testFrame;\r\n\t}", "void close(VirtualFrame frame);", "@Override\n public void actionPerformed(ActionEvent e) {\n \n if(e.getSource()==Volver){\n FrameGeneral marco=(FrameGeneral) SwingUtilities.getWindowAncestor(this);\n marco.remove(this);\n marco.add(new MenuModo());\n marco.setVisible(true);\n }\n \n }", "public void setFrame(JFrame frame) {\n\t\tthis.frame = frame;\n\t}", "public void setFrame(JFrame frame) {\n\t\tthis.frame = frame;\n\t}", "public void newFrameAt(int offset){\n runStack.newFrameAt(offset);\n }", "public Builder clearFrame() {\n if (frameBuilder_ == null) {\n frame_ = null;\n onChanged();\n } else {\n frame_ = null;\n frameBuilder_ = null;\n }\n\n return this;\n }", "public ViewPanel(final ViewFrame viewFrame) throws SQLException {\r\n\t\ttabGrounds = new ArrayList<Ground>();\r\n\t\ttabDiamonds = new ArrayList<Diamond>();\r\n\t\ttabRocks = new ArrayList<Rock>();\r\n\t\ttabWalls = new ArrayList<Wall>();\r\n\t\ttabDarkGrounds= new ArrayList<DarkGround>();\r\n\t\ttabMonsters= new ArrayList<Beast>(); \r\n\t\tiGameover= new ImageIcon(getClass().getResource(\"/images/gameover1.png\"));\r\n\t\tthis.imgGameover= this.iGameover.getImage();\r\n\t\tchrono = new Timer(10, this);\r\n\t\t\r\n\t\tthis.model= new Model();\r\n\t\t//this.mod= new Model();\r\n\t\tthis.setViewFrame(viewFrame);\r\n\t\ttry {\r\n\t\t\tthis.elements = this.model.loadFind();\r\n\t\t} catch (SQLException e) {e.printStackTrace();}\r\n\t\t/**Fetch graphic elements*/\r\n\t\tFetch();\r\n\t\tviewFrame.getModel().getObservable().addObserver(this);\r\n\t\tchrono.start();\r\n\r\n\t}", "private void close() {\n this.frame.setVisible(false);\n this.frame.remove(this);\n this.frame.setTitle(null);\n this.frame.add(this.controller);\n this.frame.revalidate();\n this.frame.pack();\n this.frame.setLocationRelativeTo(null);\n this.frame.setVisible(true);\n }", "public void newFrame()\n {\n //////////////////////////////////////////////////////////////\n // If vehicle is moving, update its position (by calling its \n // newFrame method. \n // Somehow, need to know if it has reached its goal position. \n // If so, figure out what the next goal should be.\n // \n // If previous goal was emergency site, new goal is hospital\n // If previous goal was a hospital (or if it was at home,\n // or if it was going home), new goal is the next\n // emergency site, if there is one, or home if no more \n // emergencies.\n //////////////////////////////////////////////////////////////\n if( state == 2 )\n {\n line.setVisible( false );\n if( reset == false ) \n { \n car.travelTo( 10, 10, EMTApp.normalSpeed );\n if( car.getLocation().x == 10 )\n {\n if( car.getLocation().y == 10 )\n {\n reset = true;\n }\n }\n }\n car.traveledReset();\n car.newFrame();\n if( _emergency.size() > 0 )\n {\n reset = false;\n state = 0; \n }\n }\n if( state == 3 )\n {\n Hospital h1 = this.getClosestHospital( car.getLocation() );\n line.setPoints( car.getLocation().x + car.getWidth() / 2, \n car.getLocation().y + car.getHeight() / 2, \n h1.getLocation().x, h1.getLocation().y );\n line.setVisible( true );\n car.travelTo( h1.getLocation().x, \n h1.getLocation().y , EMTApp.highSpeed );\n car.newFrame();\n }\n if( car.isTargetReached() == true )\n {\n if( state == 0 )\n { \n _frametimer.restart();\n boolean justGoHome = false;\n if( _emergency.size() > 0 ) \n {\n _emergency.get( 0 ).setColor( Color.BLUE );\n _emergency.get( 0 ).setVisible( false );\n _emergency.remove( 0 ); //removes the first object\n } else if ( _emergency.size() == 0 )\n {\n justGoHome = true;\n state = 1;\n }\n state = 3; \n } \n else if ( state == 1 )\n { \n _frametimer.restart(); \n if( _emergency.size() > 0 )\n { \n state = 0; \n } else \n {\n state = 2;\n }\n } \n else if ( state == 3 )\n {\n if( _emergency.size() > 0 )\n {\n _frametimer.restart();\n state = 0;\n } else \n {\n _frametimer.restart();\n state = 2;\n }\n }\n }\n if ( state == 1 ) \n {\n car.newFrame(); \n } \n else if( state == 0 )\n {\n if( this.nextSite() != null )\n {\n EmergencySite e = this.nextSite();\n currentSite = e;\n }\n currentSite.setNoDrag( true );\n \n int nextX = currentSite.getXLocation();\n int nextY = currentSite.getYLocation();\n line.setPoints( car.getX() + car.getWidth() / 2 , \n car.getY() + car.getHeight() / 2 , \n nextX + currentSite.getWidth() / 2 , \n nextY + currentSite.getHeight() / 2 );\n line.setVisible( true );\n \n int tmpx = currentSite.getXLocation();\n car.travelTo( tmpx, currentSite.getYLocation(), EMTApp.highSpeed );\n car.newFrame();\n } \n }" ]
[ "0.73807144", "0.7096805", "0.70465606", "0.7016401", "0.6931308", "0.6802761", "0.6732696", "0.6620053", "0.6588538", "0.65866816", "0.6566119", "0.656244", "0.6552291", "0.6485893", "0.6428019", "0.6421867", "0.6382397", "0.6371393", "0.62808895", "0.6262508", "0.6262128", "0.6258949", "0.6258949", "0.62558633", "0.62388754", "0.6236948", "0.6228434", "0.6213184", "0.6192802", "0.6184095", "0.61555964", "0.6155588", "0.6147872", "0.61305547", "0.61247253", "0.61247253", "0.61247253", "0.61247253", "0.61053854", "0.60951644", "0.60914826", "0.6084956", "0.6062226", "0.6041729", "0.6035975", "0.6033898", "0.6032318", "0.6018292", "0.6014875", "0.6011022", "0.6007797", "0.59863156", "0.5981912", "0.59793705", "0.59694403", "0.5968151", "0.5956267", "0.59479606", "0.59462345", "0.5938675", "0.5933088", "0.59308296", "0.59276545", "0.5924564", "0.5913534", "0.5877737", "0.58673835", "0.58666545", "0.58610374", "0.58566433", "0.58515507", "0.5847276", "0.5846972", "0.5836338", "0.5832247", "0.5821059", "0.5818566", "0.58141035", "0.5812831", "0.580391", "0.5798642", "0.57986146", "0.5777225", "0.57756096", "0.57710916", "0.57690424", "0.5763451", "0.57603806", "0.5758877", "0.57559735", "0.5753715", "0.574935", "0.5749052", "0.5747696", "0.5746063", "0.5746063", "0.57447773", "0.5742645", "0.57415676", "0.57363725", "0.5733716" ]
0.0
-1
wait until all runnable(s) have finished executing
public static void flushScheduler() { while (!RuntimeEnvironment.getMasterScheduler().advanceToLastPostedRunnable()) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void waitUntilAllThreadsAreFinished() {\n int index = 1;\n\n while (true) {\n while (index <= noThread) {\n if (carry[index] == -1) {\n index = 1;\n } else {\n index++;\n }\n }\n break;\n }\n }", "public void waitForFinish() {\n for(Future future : futures){\n try {\n future.get();\n } catch (InterruptedException | ExecutionException e) {\n LOGGER.error(\"ERROR\",e);\n }\n }\n }", "@Override\n\tpublic synchronized void waitAllTasks() throws ExecutionException, InterruptedException {\n\t\twaitTasks(key -> true);\n\t}", "void waitAll();", "public void allFinished() {\n\t}", "public void executWaiting() {\n for (Runnable action : this.todo) {\n runAction( action );\n }\n }", "private static void await_execution(Thread[] threads) {\n for (Thread t: threads)\n {\n if (t.isAlive()) {\n try {\n t.join();\n }\n catch (InterruptedException ie) { \n ie.printStackTrace();\n }\n }\n }\n }", "void submitAndWaitForAll(Iterable<Runnable> tasks);", "public void waitToFinish()\n {\n while(!this.finished)\n {\n try\n {\n Thread.sleep(1);\n }\n catch (InterruptedException e)\n {\n e.printStackTrace();\n return;\n }\n }\n }", "public void waitAllNodesCompleteProcessingTask() {\n // check coordinator finished task\n while (!txnCoordinator.hasNoRunningJobs()) {\n Thread.yield();\n }\n // check each participant finished task and resolve unfinished task\n for (Participant p : txnCoordinator.getParticipants()) {\n while (!((Node) p).hasNoRunningJobs()) {\n Thread.yield();\n }\n p.resolveUnfinishedTask();\n }\n }", "public Status waitUntilFinished();", "public void run() {\n\t\tfor (ConConsumer consumer : _consumers) {\n\t\t\tconsumer.register();\n\t\t}\n\t\t// commit the channels <\n\t\t// wait for the tasks finish >\n\t\t_monitor.checkFinish();\n\t\t// wait for the tasks finish <\n\t\t_threadPool.shutdown();\n\t}", "public void executeAll()\n {\n this.queue.clear();\n this.queue_set = false;\n this.resetComputation();\n while(executeNext()) {}\n }", "public synchronized void waitForDone() {\n\twhile (!done) myWait();\n }", "private void run() {\n log.log(Level.INFO, \"Starting multiple evaluation of {0} tasks\", tasks.size());\n boolean done = tasks.isEmpty();\n while (!done) {\n boolean hasFreeTasks = true;\n while (hasCapacity() && hasFreeTasks) {\n File task = getFreeTask();\n if (task == null) {\n hasFreeTasks = false;\n } else {\n EvaluatorHandle handle = new EvaluatorHandle();\n if (handle.createEvaluator(task, log, isResume)) {\n log.fine(\"Created new evaluation handler\");\n evaluations.add(handle);\n }\n }\n }\n\n log.log(Level.INFO, \"Tasks in progress: {0}, Unfinished tasks: {1}\", new Object[]{evaluations.size(), tasks.size()});\n try {\n Thread.sleep(5000);\n } catch (InterruptedException ex) {\n //Bla bla\n }\n checkRunningEvaluations();\n done = tasks.isEmpty();\n }\n\n }", "public void finish() {\n for (RecordConsumer consumer : consumerList) {\n consumer.submit(new Record(true));\n }\n }", "@Override\n\tpublic void run() {\n\t\twhile (true) {\n\t\t\tIterator<Future<Integer>> iter = runningThreadsList.iterator();\n\t\t\tif (iter.hasNext()) {\n\t\t\t\tFuture<Integer> future = (Future<Integer>) iter.next();\n\t\t\t\tif (future.isDone()) {\n\t\t\t\t\trunningThreadsList.remove(future);\n\t\t\t\t\t\n\t\t\t\t\tif (allocator.getInventory().isEmpty()) {\n\t\t\t\t\t\tallocator.shutdown();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tThread.yield();\n\t\t}\n\t\t\t\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\tSystem.out.println(\"All Finished\");\r\n\t\t\t}", "public void waitToFinish()\n/* */ {\n/* 473 */ synchronized (this) {\n/* 474 */ while (getIterationsToGo() > 0) {\n/* */ try {\n/* 476 */ wait();\n/* */ }\n/* */ catch (InterruptedException e) {\n/* 479 */ e.printStackTrace();\n/* */ }\n/* */ }\n/* */ }\n/* */ }", "protected void finishBuilding() throws Exception{\n for(int i =0 ; i < Constants.MAX_THREADS; i++){\n if(shortestThread[i]!=null){\n shortestThread[i].setFinishedProcessing(true);\n shortestThread[i].join();\n }\n }\n }", "final void waitFinished() {\n if (selectionSyncTask != null) {\n selectionSyncTask.waitFinished();\n }\n }", "protected void completeFuturesForFauxInstances() {\n }", "public void run() throws InterruptedException, ExecutionException {\n\t\tExecutorService exec = Executors.newCachedThreadPool();\n\t\tfor (Entry<Integer, Set<Task>> entry : map.entrySet()) {\n\t\t\tList<Future<?>> futures = new ArrayList<Future<?>>();\n\t\t\t\n\t\t\t// submit each task in the set to the executor\n\t\t\tfor (Task task : entry.getValue()){\n\t\t\t\tfutures.add(exec.submit(task));\n\t\t\t}\n\t\t\t\n\t\t\t// iterate the futures to see if all the tasks in the set have finished execution\n\t\t\tfor (Iterator<Future<?>> iterator = futures.iterator(); iterator.hasNext();) {\n\t\t\t\tFuture<?> future = (Future<?>) iterator.next();\n\t\t\t\tif (future.get() == null);\n\t\t\t}\n\t\t}\n\t\texec.shutdown();\n\t}", "@Override\n public void run() {\n if ((waitOnThese) != null) {\n for (Future<?> f : waitOnThese) {\n try {\n f.get();\n } catch (Throwable e) {\n System.err.println(\"Error while waiting on future in CompletionThread\");\n }\n }\n }\n /* send the event */\n if ((event) == (SerializedObserverTest.TestConcurrencySubscriberEvent.onError)) {\n observer.onError(new RuntimeException(\"mocked exception\"));\n } else\n if ((event) == (SerializedObserverTest.TestConcurrencySubscriberEvent.onComplete)) {\n observer.onComplete();\n } else {\n throw new IllegalArgumentException(\"Expecting either onError or onComplete\");\n }\n\n }", "private void initialBlockOnMoarRunners() throws InterruptedException\n {\n lock.lock();\n try\n {\n if (taskQueue.isEmpty() && runners > 1)\n {\n runners--;\n needMoreRunner.await();\n runners++;\n }\n }\n finally\n {\n lock.unlock();\n }\n }", "private void waitForBackgroupTasks() {\n this.objectStore.getAllObjectIDs();\n this.objectStore.getAllEvictableObjectIDs();\n this.objectStore.getAllMapTypeObjectIDs();\n }", "@Override\r\n public void tasksFinished()\r\n {\n }", "private void waitUntilReady() {\n\t\t\twhile (deque.isEmpty() && loadThread.isAlive()) {\n//\t\t\t\ttry {\n//\t\t\t\t\tThread.sleep(100);\n//\t\t\t\t} catch (InterruptedException e) {\n//\t\t\t\t\tExceptionUtils.throwAsRuntimeException(e);\n//\t\t\t\t}\n\t\t\t}\n\t\t}", "void done(boolean allSucceeded);", "private void waitForAll(CountDownLatch latch) {\n\t\ttry {\n\t\t\tlatch.await();\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void checkRunningEvaluations() {\n List<EvaluatorHandle> finishedHandles = new LinkedList<EvaluatorHandle>();\n for (EvaluatorHandle handle : evaluations) {\n switch (handle.getStatus()) {\n case NEW:\n break;\n case CREATED:\n break;\n case RUNNING:\n break;\n case NOT_RESPONDING:\n break;\n case FAILED:\n case DESTROYED:\n case COMPLETED:\n File task = handle.getTask();\n log.log(Level.INFO, \"Tasks completed. Status: {0}\", handle.getStatus());\n tasks.remove(task);\n finishedHandles.add(handle);\n break;\n default:\n throw new AssertionError(handle.getStatus().name());\n }\n }\n for (EvaluatorHandle handle : finishedHandles) {\n evaluations.remove(handle);\n }\n }", "protected void waitUntilCommandFinished() {\n }", "private void completionService() {\n ListeningExecutorService executor = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(numberOfThreadsInThePool));\n ExecutorCompletionService<String> completionService = new ExecutorCompletionService<String>(executor);\n for (final String printRequest : printRequests) {\n// ListenableFuture<String> printer = completionService.submit(new Printer(printRequest));\n completionService.submit(new Printer(printRequest));\n }\n try {\n for (int t = 0, n = printRequests.size(); t < n; t++) {\n Future<String> f = completionService.take();\n System.out.print(f.get());\n }\n } catch (InterruptedException | ExecutionException e) {\n Thread.currentThread().interrupt();\n } finally {\n// if (executor != null) {\n executor.shutdownNow();\n// }\n }\n\n }", "private void awaitDone() throws IgniteInterruptedCheckedException {\n U.await(doneLatch);\n }", "public final void waitFor() {\r\n for (;;) {\r\n synchronized (this) {\r\n if (this.m_b)\r\n return;\r\n try {\r\n this.wait();\r\n } catch (Throwable tt) {\r\n tt.printStackTrace();\r\n }\r\n }\r\n }\r\n }", "public void awaitPendingTasksFinished() throws IgniteCheckedException {\n GridCompoundFuture pendingFut = this.pendingTaskFuture;\n\n this.pendingTaskFuture = new GridCompoundFuture();\n\n if (pendingFut != null) {\n pendingFut.markInitialized();\n\n pendingFut.get();\n }\n }", "protected abstract long waitOnQueue();", "public void joinAll() {\n\t\tfor (int i = 0; i < this.size(); i++) {\n\t\t\tif (this.get(i).getClient() != null) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.get(i).join();\n\t\t\t\t\tSystem.out.println(\"Thread \" + i + \" wurde beendet!\");\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\tthis.get(i).interrupt();\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void finishedAllRequests() {\n hasMoreRequests = false;\n }", "public void waitCompletion()\n {\n\n if (isThreadEnabled())\n {\n try\n {\n executionThread.join();\n }\n catch (InterruptedException ex)\n {\n throw new RuntimeException(ex);\n }\n }\n }", "public void run()\r\n/* 996: */ {\r\n/* 997:838 */ if (DefaultPromise.this.listeners == null) {\r\n/* 998: */ for (;;)\r\n/* 999: */ {\r\n/* :00:840 */ GenericFutureListener<?> l = (GenericFutureListener)poll();\r\n/* :01:841 */ if (l == null) {\r\n/* :02: */ break;\r\n/* :03: */ }\r\n/* :04:844 */ DefaultPromise.notifyListener0(DefaultPromise.this, l);\r\n/* :05: */ }\r\n/* :06: */ }\r\n/* :07:849 */ DefaultPromise.execute(DefaultPromise.this.executor(), this);\r\n/* :08: */ }", "private void _wait() {\n\t\tfor (int i = 1000; i > 0; i--)\n\t\t\t;\n\t}", "@Override\n\tpublic boolean done() {\n\t\tfor(Task t : details.getPendingTasks()){\n\t\t\tif(!t.isComplete())\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public synchronized void waitingToThraeds()\n\t{\n\t\twhile (countOfThreads<numberOfThreads)\n\t\t\n\t\ttry \n\t\t{\n\t\t\twait();\n\t\t}\n\t\tcatch(InterruptedException e)\n\t\t{\n\t\t\tSystem.out.println(\"Interrupted while waiting\");\n\t\t}\n\t \t\n\t\t\n \t\n\t}", "private void normalExecutorService() {\n ListeningExecutorService executor = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(numberOfThreadsInThePool));\n try {\n Set<Future<String>> printTaskFutures = new HashSet<Future<String>>();\n for (final String printRequest : printRequests) {\n// Future<String> printer = executor.submit(new Printer(printRequest));\n ListenableFuture<String> printer = executor.submit(new Printer(printRequest));\n printTaskFutures.add(printer);\n// Futures.addCallback(printer, new FutureCallback<String>() {\n// // we want this handler to run immediately after we push the big red button!\n// public void onSuccess(String explosion) {\n//// walkAwayFrom(explosion);\n// }\n//\n// public void onFailure(Throwable thrown) {\n//// battleArchNemesis(); // escaped the explosion!\n// }\n// });\n }\n for (Future<String> future : printTaskFutures) {\n System.out.print(future.get());\n\n }\n } catch (Exception e) {\n Thread.currentThread().interrupt();\n } finally {\n// if (executor != null) {\n executor.shutdownNow();\n// }\n }\n }", "void synchronizationDone();", "public void runPendingTasks() {\n/* */ try {\n/* 578 */ this.loop.runTasks();\n/* 579 */ } catch (Exception e) {\n/* 580 */ recordException(e);\n/* */ } \n/* */ \n/* */ try {\n/* 584 */ this.loop.runScheduledTasks();\n/* 585 */ } catch (Exception e) {\n/* 586 */ recordException(e);\n/* */ } \n/* */ }", "public boolean signalAllWaiters()\n {\n int w=waiting.get();\n if (w>0) return signal(w);\n return false;\n }", "private void async(Runnable runnable) {\n Bukkit.getScheduler().runTaskAsynchronously(KitSQL.getInstance(), runnable);\n }", "public void await() {\n for (final Future<Void> future : futures) {\n try {\n future.get();\n } catch (final Throwable e) {\n LOGGER.error(\"Scheduled blob storage job threw an exception.\", e);\n }\n }\n futures.clear();\n }", "public final void execute() {\n thread = Thread.currentThread();\n while (!queue.isEmpty()) {\n if (currentThreads.get() < maxThreads) {\n queue.remove(0).start();\n currentThreads.incrementAndGet();\n } else {\n try {\n Thread.sleep(Long.MAX_VALUE);\n } catch (InterruptedException ex) {}\n }\n }\n while (currentThreads.get() > 0) {\n try {\n Thread.sleep(Long.MAX_VALUE);\n } catch (InterruptedException ex) {}\n }\n }", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\t\n\t\t\t while ( !bFinished ) {\n\t\t\t \ttry {\n\t\t\t\t\t\t\tThread.sleep(200);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t }\n\t\t\t System.exit(0);\n\t\t\t\t}", "public void end() {\n\t\t// End runs waiting to start.\n\t\tfor ( Run r : startQueue ) {\n\t\t\tr.setState(\"dnf\");\n\t\t\tPrinter.print(\"Bib #\" + r.getBibNum() + \" Did Not Finish\");\n\t\t\tcompletedRuns.add(r);\n\t\t}\n\t\tstartQueue.clear();\n\t\t\n\t\t// End runs waiting to finish.\n\t\tfor ( Run r : finishQueue ) {\n\t\t\tr.setState(\"dnf\");\n\t\t\tPrinter.print(\"Bib #\" + r.getBibNum() + \" Did Not Finish\");\n\t\t\tcompletedRuns.add(r);\n\t\t}\n\t\tfinishQueue.clear();\n\t}", "public static void shutdown() {\n\t\trunning = false;\n\t\texecutor.shutdown();\n\t\tlog.info(\"### All threads shutdown requested ###\");\n\t\t\n\t\ttry {\n\t\t\tfor (int i = 0; !executor.awaitTermination(10, TimeUnit.SECONDS); i++) {\n\t\t\t\tlog.info(\"### Awaiting for pending task pool termination... ({}) ###\", i);\n\t\t\t}\n\t\t} catch (InterruptedException e) {\n\t\t\tlog.warn(\"### Exception awaiting for pending task pool termination: {} ###\", e.getMessage());\n\t\t}\n\t\t\n\t\tlog.info(\"### All threads have finished ###\");\n\t}", "public void runTasks() {\n promoteBlockedTasks();\n\n final AtomicInteger counter = new AtomicInteger(0);\n\n ExecutorService runners = threadPerCpuExecutor(stderr, \"TaskQueue\");\n\n for (int i = 0; i < Runtime.getRuntime().availableProcessors(); i++) {\n runners.execute(() -> {\n while (runOneTask()) {\n // running one task at a time\n counter.getAndIncrement();\n }\n });\n }\n\n runners.shutdown();\n\n try {\n runners.awaitTermination(FOREVER, TimeUnit.SECONDS);\n\n stdout.println(String.format(\"Executed tasks: %d\", counter.get()));\n\n } catch (InterruptedException e) {\n stdout.println(\"failed task: \" + e.getMessage());\n e.printStackTrace(stderr);\n throw new AssertionError();\n }\n }", "private boolean areAllExecutorsBusy(Slave s) {\n int count = 0;\n for (Executor executor : s.getComputer().getExecutors()) {\n if (!executor.isBusy()) {\n count++;\n }\n }\n return (count == 0);\n }", "private void runAnimations() {\n\t\tfor (int i = animations.size()-1; i >= 0; i--) {\n\t\t\tNodeAnimation anim = animations.get(i);\n\t\t\tanim.run();\n\t\t\tnodeSpin.spinNode();\n\n\t\t\tif (anim.isDone()) {\n\t\t\t\tlog.finest(\"Animation done\"); \n\t\t\t\t\n\t\t\t\tanimations.remove(i);\n\t\t\t}\n\t\t}\n\t}", "public void wait4arriving() throws InterruptedException {\n \n // your code here\t\n }", "public interface OnAllThreadResultListener {\n void onSuccess();//所有线程执行完毕\n void onFailed();//所有线程执行出现问题\n}", "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") // I know what I'm doing - famous last words.\n private static void awaitCompletion(final HashMultimap<UUID, Future<Void>> handles) {\n final Set<Future<Void>> futures;\n synchronized (handles) {\n futures = new HashSet<>(handles.values());\n handles.clear();\n }\n\n for (final Future<Void> future : futures) {\n await(future);\n }\n }", "private static void waitForMoverThreads(List<Thread> moverThreads) throws InterruptedException {\n for (Thread thread : moverThreads) {\n thread.join();\n }\n }", "public List<Runnable> shutdownNow() {\n lock.lock();\n try {\n shutdown();\n List<Runnable> result = new ArrayList<>();\n for (SerialExecutor serialExecutor : serialExecutorMap.values()) {\n serialExecutor.tasks.drainTo(result);\n }\n result.addAll(executor.shutdownNow());\n return result;\n } finally {\n lock.unlock();\n }\n }", "public void handleFinishedGoingToSleep(int i) {\n Assert.isMainThread();\n this.mGoingToSleep = false;\n for (int i2 = 0; i2 < this.mCallbacks.size(); i2++) {\n KeyguardUpdateMonitorCallback keyguardUpdateMonitorCallback = this.mCallbacks.get(i2).get();\n if (keyguardUpdateMonitorCallback != null) {\n keyguardUpdateMonitorCallback.onFinishedGoingToSleep(i);\n }\n }\n updateBiometricListeningState();\n }", "private synchronized void process()\n{\n boolean waiter = process_set.isEmpty();\n\n while (waiter || process_set.size() > 0) {\n try {\n\t wait(0);\n }\n catch (InterruptedException e) { }\n if (process_set.size() > 0) waiter = false;\n dumpProcesses();\n }\n}", "private void waitFor() {\n if (done) {\n return;\n }\n\n synchronized (waitObj) {\n while (!done) {\n try {\n waitObj.wait();\n } catch (InterruptedException ex) {\n ex.printStackTrace(System.err);\n }\n }\n }\n if (excpetion != null) {\n throw excpetion;\n }\n }", "void testFinished() {\n currentThreads.decrementAndGet();\n thread.interrupt();\n }", "@Override\n public void run() {\n try {\n remove_elements();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void waitForAllInBoard() {\n this.lock.lock();\n try {\n // update pilot state\n this.repository.updatePilotState(PilotState.WAIT_FOR_BOARDING);\n\n // wait for all passengers\n while (!this.planeReadyToTakeOff) {\n this.pilotWaitForAllInBoard.await();\n }\n this.planeReadyToTakeOff = false;\n\n // update pilot state\n this.repository.updatePilotState(PilotState.FLYING_FORWARD);\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n this.lock.unlock();\n }\n }", "public void finish() {\n latch.countDown();\n }", "public void run() {\n\t\t// Child threads start here to begin testing-- tests are below\n\t\n\t\t// We suggest writing a series of zero-sum tests,\n\t\t// i.e. lists should be empty between tests. \n\t\t// The interimBarr enforces this.\n\t\ttry {\n\t\t\tcontainsOnEmptyListTest();\n\t\t\tinterimBarr.await();\n\t\t\tsentinelsInEmptyListTest();\n\t\t\tprintResBarr.await();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "public void taskComplete() {\n mTasksLeft--;\n if ((mTasksLeft==0) & mHasCloRequest){\n onAllTasksCompleted();\n }\n }", "public static void main(String[] args) throws InterruptedException, ExecutionException {\n\t\tExecutorService executor = Executors.newFixedThreadPool(5);\n for (int i = 0; i < 10; i++) {\n \tCallable worker = new WorkerThread1(\"\" + i);\n \tFuture future = executor.submit(worker);\n \tSystem.out.println(\"Results\"+future.get());\n //executor.execute(worker);\n }\n executor.shutdown();\n while (!executor.isTerminated()) {\n }\n System.out.println(\"Finished all threads\");\n }", "protected void execute() {\n finished = true;\n }", "public void mo37770b() {\n ArrayList<RunnableC3181a> arrayList = f7234c;\n if (arrayList != null) {\n Iterator<RunnableC3181a> it = arrayList.iterator();\n while (it.hasNext()) {\n ThreadPoolExecutorFactory.getScheduledExecutor().execute(it.next());\n }\n f7234c.clear();\n }\n }", "void waitAndReleaseAllEntities();", "@Override\n public void run() {\n try{\n for(int n = 0;n < 20; n++){\n //This simulates 1sec of busy activity\n Thread.sleep(1000);\n //now talk to the ain thread\n myHandler.post(foregroundTask);\n }\n }catch (InterruptedException e){\n e.printStackTrace();\n }\n }", "protected void synchronizationDone() {\n }", "@Override\n\tpublic void run() {\n\t\tStaticSynchronized.execute();\n\t\tStaticSynchronized.execute2();\n\t\tStaticSynchronized.execute3();\n\t}", "protected void fireQueueComplete() {\n for (UploadListener uploadListener : uploadListeners) {\n uploadListener.queueUploadComplete();\n }\n }", "private static void threadPoolWithExecute() {\n\n Executor executor = Executors.newFixedThreadPool(3);\n IntStream.range(1, 10)\n .forEach((i) -> {\n executor.execute(() -> {\n System.out.println(\"started task for id - \"+i);\n try {\n if (i == 8) {\n Thread.sleep(4000);\n } else {\n Thread.sleep(1000);\n }\n System.out.println(\"In runnable task for id -\" + i);\n } catch (Exception e) {\n e.printStackTrace();\n }\n });\n });\n System.out.println(\"End of method .THis gets printed immdly since execute is not blocking call\");\n }", "public void run()\n {\n for (Runnable next = next(); null != next; next = next())\n {\n next.run();\n\n synchronized (m_lock)\n {\n m_runnable = null;\n }\n }\n }", "@Override\n\tpublic void execute() throws Exception {\n\t\tthis.done = false;\n\t\tthis.error = null;\n\n\t\tint timeout = value(this.timeout, 60000);\n\t\tint interval = value(this.interval, 1000);\n\t\tlong started = System.currentTimeMillis();\n\t\ttry {\n\t\t\tdo {\n\t\t\t\tboolean checked = check();\n\t\t\t\tif (checked || this.done || this.error != null || (System.currentTimeMillis() - started) > timeout) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tsynchronized (lock) {\n\t\t\t\t\tlock.wait(interval);\n\t\t\t\t}\n\t\t\t} while (true);\n\n\t\t} catch (Exception x) {\n\t\t\terror = new AssertionError(x);\n\t\t}\n\n\t\tif (error != null) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!done) {\n\t\t\tfail(\"Wait timeout: \" + timeout + \" ms\");\n\t\t}\n\t}", "@Override\n\tpublic void run() {\n\t\twhile(true){\n \tlock.lock();\n \ttry{\n\t \tif(observers.isEmpty()){\n\t \t\treturn;\n\t \t}\n \t}\n \tfinally{\n \t\tlock.unlock();\n \t}\n }\n\t}", "private void customWait() throws InterruptedException {\n while (!finished) {\n Thread.sleep(1);\n }\n finished = false;\n }", "public void waitFinish() throws InterruptedException {\r\n\t\t\ttThread.join();\r\n\t\t}", "static void completeTests(Container c, int seconds) throws InterruptedException {\n log.log(true, \"Waiting \" + seconds + \" seconds with \" + nTesters.intValue() + \" testers.\");\n long stop = System.currentTimeMillis() + (seconds * 1000);\n while (System.currentTimeMillis() < stop) {\n Thread.sleep(100);\n }\n // Stop the testers.\n testing = false;\n // Wait some more.\n while (nTesters.intValue() > 0) {\n Thread.sleep(100);\n }\n\n }", "private void advanceAllDrones(Set<Drone> droneSet, float deltaTime, int nbIterations) throws InterruptedException {\n\t\t//first set the time interval for all the drones\n\t\tfor(Drone drone: droneSet){\n\t\t drone.setNbIterations(nbIterations);\n\t\t\tdrone.setDeltaTime(deltaTime);\n\t\t}\n\t\t//get the execution pool\n\t\tExecutorService droneThreads = this.getDroneThreads();\n\t\t//System.out.println(\"used ThreadPool: \" + this.getDroneThreads());\n\t\t//first invoke all the next states\n\t\tList<Future<Void>> unfinishedThreads = droneThreads.invokeAll(droneSet);\n\t\tList<Future<Void>> finishedThreads = new ArrayList<>();\n\t\t//then wait for all the futures to finish\n\t\tboolean allFinished = false;\n\t\t//keeps looping until all drones are advanced to the next state\n\t\twhile(!allFinished){\n\t\t\t//first get the first thread\n\t\t\tFuture<Void> droneFuture = unfinishedThreads.get(0);\n\n\t\t\t//wait until the first thread finishes\n\t\t\ttry {\n\t\t\t\tdroneFuture.get();\n\t\t\t\t//check if there was an exception\n\t\t\t} catch (ExecutionException e) {\n\t\t\t\tif(e.getCause() instanceof AngleOfAttackException){\n\t\t\t\t\tSystem.out.println(\"angle of attack exception\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(\"An error occurred: \" + e.getCause().toString());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//get all the finished elements\n\t\t\tfinishedThreads = unfinishedThreads.stream()\n\t\t\t\t\t.filter(future -> future.isDone())\n\t\t\t\t\t.collect(Collectors.toList());\n\n\t\t\t//check if any of the finished threads got into trouble\n\t\t\tfor(Future<Void> finishedFuture: finishedThreads){\n\t\t\t\ttry {\n\t\t\t\t\tfinishedFuture.get();\n\t\t\t\t\t//check if there occurred an error\n\t\t\t\t} catch (ExecutionException e) {\n\t\t\t\t\tif(e.getCause() instanceof AngleOfAttackException){\n\t\t\t\t\t\tthrow (AngleOfAttackException) e.getCause(); //rethrow, info for the main loop\n\t\t\t\t\t}else{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//filter out all the elements that are finished\n\t\t\tunfinishedThreads = unfinishedThreads.stream()\n\t\t\t\t\t.filter(future -> !future.isDone())\n\t\t\t\t\t.collect(Collectors.toList());\n\t\t\t//check if drone futures is empty ot not\n\t\t\tif(unfinishedThreads.size() == 0){\n\t\t\t\tallFinished = true;\n\t\t\t}\n\t\t}\n\t\t//we may exit, all the drones have been set to state k+1\n\t}", "public void execute() {\n ExecutionList executionList = this;\n // MONITORENTER : executionList\n if (this.executed) {\n // MONITOREXIT : executionList\n return;\n }\n this.executed = true;\n RunnableExecutorPair list = this.runnables;\n this.runnables = null;\n // MONITOREXIT : executionList\n RunnableExecutorPair reversedList = null;\n do {\n if (list == null) {\n while (reversedList != null) {\n ExecutionList.executeListener((Runnable)reversedList.runnable, (Executor)reversedList.executor);\n reversedList = reversedList.next;\n }\n return;\n }\n RunnableExecutorPair tmp = list;\n list = list.next;\n tmp.next = reversedList;\n reversedList = tmp;\n } while (true);\n }", "boolean hasFinished();", "@Override\r\n\tpublic void run() {\n\t\t\r\n\t\tfor(int i=0;i<=4;i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Hii ....\");\r\n\t\t\ttry {\r\n\t\t\t\tThread.currentThread().sleep(1000);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tsynchronized (a) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\ta.wait();\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "@Override\r\n\tpublic void run() {\n\t\tfor (int i=1; i<0;i++) {\r\n\t\t\ttry {\r\n\t\t\t\tcurrentThread();\r\n\t\t\t\tThread.sleep(1000);\r\n\t\t\t\tSystem.out.println(currentThread());\r\n\t\t\t}catch(Exception e) {}\r\n\t\t}\r\n\t}", "public void awaitDone() {\n try {\n // Wait until the CountDownLatch reaches 0.\n mExitBarrier.await();\n } catch(java.lang.InterruptedException e) {\n errorLog(\"PlatformStrategyAndroid\",\n e.getMessage());\n }\n }", "public void waitForData() {\n waitForData(1);\n }", "public void waitForEndOfAllAjaxes(){\r\n\t\tLOGGER.info(Utilities.getCurrentThreadId()\r\n\t\t\t\t+ \" Wait for the page to load...\");\r\n\t\tWebDriverWait wait = new WebDriverWait(driver,Integer.parseInt(Configurations.TEST_PROPERTIES.get(ELEMENTSEARCHTIMEOUT)));\r\n\t\twait.until(new ExpectedCondition<Boolean>() {\r\n\t\t\t@Override\r\n\t\t\tpublic Boolean apply(WebDriver driver) {\r\n\t\t\t\t//\t\t\t\treturn (Boolean)((JavascriptExecutor)driver).executeScript(\"return jQuery.active == 0\");\r\n\t\t\t\treturn ((JavascriptExecutor)driver).executeScript(\"return document.readyState\").equals(\"complete\");\r\n\t\t\t\t//\t\t\t\t return Boolean.valueOf(((JavascriptExecutor) driver).executeScript(\"return (window.angular !== undefined) && (angular.element(document).injector() !== undefined) && (angular.element(document).injector().get('$http').pendingRequests.length === 0)\").toString());\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t}", "public void done() {\n try {\n C1000c.this.mo5101e(get());\n } catch (InterruptedException e) {\n Log.w(\"AsyncTask\", e);\n } catch (ExecutionException e2) {\n throw new RuntimeException(\"An error occurred while executing doInBackground()\", e2.getCause());\n } catch (CancellationException unused) {\n C1000c.this.mo5101e(null);\n } catch (Throwable th) {\n throw new RuntimeException(\"An error occurred while executing doInBackground()\", th);\n }\n }", "public void shutdown() {\n\t\tfinal List<Runnable> tasks = updater.shutdownNow();\n\t\tif (null == tasks) return;\n\t\tfor (final Runnable t : tasks)\n\t\t\tt.run();\n\t}", "public static void main(String[] args) {\n ExecutorService executor = Executors.newFixedThreadPool(5);\n\n for (int i = 0; i < 10; i++) {\n Runnable worker = new WorkerThreadSand(\" \" + i);\n executor.execute(worker);\n }\n executor.shutdown();\n\n// nasty path for executor\n try {\n ExecutorService nastyExecutor = Executors.newSingleThreadExecutor();\n nastyExecutor.execute(null);\n }catch (Exception e){\n System.out.println(\"Nulls don't work\");\n }\n\n\n System.out.println(\"Finished all threads\");\n\n }", "private static void wait(List<Thread> threads, boolean backoff) throws InterruptedException {\n while(threads.stream().allMatch(Thread::isAlive)) {\n Thread.sleep(1000);\n }\n threads.clear();\n if(backoff) {\n System.out.println();\n System.out.println(\"Backing off...\");\n Thread.sleep(10000);\n }\n }", "private void handleCompleteAndStats() throws Exception {\n\t\tsynchronized (completedProcs) {\n\t\t\twhile (completedProcs.size() != nProc)\n\t\t\t\tcompletedProcs.wait();\n\t\t}\n\t\tinitiateTerminate();\n\t\t\n\t\tsynchronized (procStats) {\n\t\t\twhile (procStats.size() != nProc)\n\t\t\t\tprocStats.wait();\n\t\t}\n\t\t\n\t\taggregateStats();\n\t}", "protected boolean isAllJobsFinished() {\r\n \tIterator<Progress> jobsIterator = JobManager.iterator();\r\n \twhile (jobsIterator.hasNext()) {\r\n \t\tProgress job = jobsIterator.next();\r\n\t\t\tif (!job.isFinished()) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n }" ]
[ "0.7251688", "0.71542084", "0.71353525", "0.7078263", "0.6842565", "0.6841239", "0.67312914", "0.6613561", "0.6447274", "0.6447102", "0.6428899", "0.63535523", "0.62528485", "0.61659145", "0.6042079", "0.6000584", "0.5982692", "0.5973279", "0.5945805", "0.5928671", "0.59237134", "0.5920073", "0.59168524", "0.59165394", "0.5914549", "0.58338684", "0.58210826", "0.5808598", "0.58028865", "0.5798124", "0.5795654", "0.5774591", "0.577442", "0.5770498", "0.5763227", "0.5743879", "0.5738399", "0.56850815", "0.56594557", "0.5659168", "0.56589246", "0.5636956", "0.5636913", "0.5635536", "0.563388", "0.56098706", "0.5600383", "0.55768263", "0.5570405", "0.5569885", "0.5565183", "0.5563149", "0.554754", "0.5542886", "0.5519072", "0.5495466", "0.5494394", "0.54887116", "0.5476113", "0.54736626", "0.5466", "0.5464309", "0.5463404", "0.5452256", "0.5450678", "0.5437484", "0.5435387", "0.54292446", "0.54154825", "0.5413876", "0.54129446", "0.5400346", "0.5397197", "0.5394747", "0.5385083", "0.5381076", "0.53750443", "0.536834", "0.5363311", "0.5360267", "0.53567815", "0.53542763", "0.5351758", "0.53494275", "0.5348178", "0.5336754", "0.53270036", "0.53118944", "0.5309655", "0.53092474", "0.53068924", "0.53018016", "0.5283671", "0.52748877", "0.5274502", "0.5274238", "0.5272859", "0.5270578", "0.5266278", "0.5249519", "0.524865" ]
0.0
-1
Display the provided message as an information to the user
public EObject displayInfo(EObject context, String title, String message) { MessageDialog.openInformation(Display.getCurrent().getActiveShell(), title, message); return context; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void displayMessage(String message) {\n }", "@Override\r\n\t\tpublic void showMessage(String message) {\n\t\t\t\r\n\t\t}", "private void displayMessage(String info) {\n \tif (message == null) {\n \t\tsetupMessage();\n \t}\n \tmessage.setLabel(info);\n\t\tadd(message, 6, 15);\n }", "@Override\r\n\tpublic void display(Object message) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void display(Object message) {\n\t\t\r\n\t}", "public void showMessage(String message) \r\n\t\t{\t\t\t\r\n\t\t}", "public void DisplayMessage(String massage);", "@Override\n\tpublic void showMessage(String message) {\n\n\t}", "protected void displayMessage() {\n \n System.out.print (\"Message:\\n\");\n userMessage = message.toString();\n\n for(int i = 0; i < userMessage.length(); i++) \n System.out.format (\"%3d\", i);\n System.out.format (\"\\n\");\n for (char c : userMessage.toCharArray()) \n System.out.format(\"%3c\",c);\n System.out.format (\"\\n\");\n }", "private void showInfo(String message)\r\n {\r\n infoLabel.setText(message);\r\n }", "public void showMessage(String message);", "private static void displayMessage(String message) {\n\t\toutput.append(message);\n\t}", "void displayMessage(String message);", "private void infoMessage(String message) {\n JOptionPane.showMessageDialog(this, message,\n \"VSEGraf - user management\", JOptionPane.INFORMATION_MESSAGE);\n }", "public void displayMessage(){\n //getCouseName obtém o nome do curso\n System.out.printf(\"Welcome to the grade book for \\n%s!\\n\\n\", getCouseName());\n }", "public void displayInfo(String message){\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setContentText(message);\n //alert.initOwner(owner);\n alert.show();\n }", "private void displayInformation(String message) {\n informationTextArea.setText(EMPTY);\n informationTextArea.setText(message);\n }", "public void showMessage(){\n\t jsfMessageHelper.addInfo(\"Mesaj:\", (messageTxt==null?\"?\":messageTxt));\r\n\t}", "static void giveInfo(String message){\n JOptionPane.showMessageDialog(null, message);\n }", "public void displayMessage(){//displayMessage body start\n\t\tSystem.out.printf(\"course name = %s\\n\", getCourseName());\n\t}", "private void displayMessage(String message) {\n TextView orderSummaryTextView = findViewById(R.id.order_summary_text_view);\n orderSummaryTextView.setText(message);\n }", "@Override\n\t\tpublic void displayMessage() {\n\t\t\tsuper.displayMessage();\n\t\t}", "public void displayMessage(String message) {\r\n TextView messageView = (TextView) findViewById(R.id.message);\r\n messageView.setText(String.valueOf(message));\r\n }", "private void showInfo(String message){ infoLabel.setText(message);}", "private void displayMessage(String message) {\n TextView orderSummaryTextView = (TextView) findViewById(R.id.order_summary_text_view);\n orderSummaryTextView.setText(message);\n }", "private void displayMessage(String message) {\n TextView orderSummaryTextView = (TextView) findViewById(R.id.order_summary_text_view);\n orderSummaryTextView.setText(message);\n }", "private void displayMessage(String message) {\n TextView orderSummaryTextView = (TextView) findViewById(R.id.order_summary_text_view);\n orderSummaryTextView.setText(message);\n }", "public void displayMessage(String message) {\n TextView orderSummaryTextView = (TextView) findViewById(R.id.result_text_view);\n orderSummaryTextView.setText(message);\n }", "public void displayMessage(String message){\n //Display a toast with the message we recieved\n displayMessage(message,Toast.LENGTH_LONG);\n }", "private void displayMessage(String message) {\n TextView SummaryTextView = (TextView) findViewById(R.id.ordersummary_text_view);\n SummaryTextView.setText(message);\n }", "private void showMessage(String string) {\n\n }", "private void display(String msg) {\n cg.append(msg + \"\\n\");\n }", "public void displayMessage(String message){\n\n\t\tElement mes = nifty.getScreen(\"hud\").findElementByName(\"MessagePanel\");\n\t\tmes.getRenderer(TextRenderer.class).setText(message);\n\t\tmes.startEffect(EffectEventId.onCustom);\n\t}", "public static void displayMessage(String message){\n JOptionPane.showInputDialog(message);\n }", "@Override\r\n\tpublic void display(Object message) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tObject[] obj = (Object[])message;\r\n\t\tswitch((String)obj[0]) {\r\n\t\tcase \"ExamLocked\":\r\n\t\t\tsubmitbtn.setDisable(true);\r\n\t\t\tbackbtn.setDisable(false);\r\n\t\t\tbreak;\r\n\t\tcase \"NewDuration\":\r\n\t\t\tTime t=Time.valueOf((String)obj[1]);\r\n\t\t\tsecond+=t.getHours()*3600+t.getMinutes()*60+t.getSeconds();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "private void displayMessage(String message) {\n Log.d(\"Method\", \"displayMessage()\");\n Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();\n }", "private void displayMessage(String message) {\n TextView priceTextView = (TextView) findViewById(R.id.price_tv);\n priceTextView.setText(message);\n }", "private void displayMessage(String message) {\n TextView seeBoxReadMore = (TextView) findViewById(R.id.read_more1);\n seeBoxReadMore.setTextColor(Color.BLACK);\n seeBoxReadMore.setText(message);\n seeBoxReadMore.setGravity(Gravity.CENTER);\n }", "public static void info(Object message) {\n\t\tSystem.out.print(message);\n\t}", "public void info(String message);", "public void info(String message);", "public void displayMessage(String message) {\n Toast.makeText(_context, message, Toast.LENGTH_SHORT).show();\n }", "public void displayMessage(String message){\n gameState = GameState.MESSAGE;\n currentMessage = message;\n notifyObservers();\n currentMessage = \"\";\n }", "void showMessage(@NonNull BaseMessage message);", "public void displayMessage(String message) {\n gameWindowController.showMessage(message);\n }", "public static void displayMsg() {\n\t}", "public void showInformationMessage(String msg) {\r\n JOptionPane.showMessageDialog(this,\r\n\t\t\t\t msg, TmplResourceSingleton.getString(\"info.dialog.header\"),\r\n\t\t\t\t JOptionPane.INFORMATION_MESSAGE);\r\n }", "public void displayMessage()\n\t{\n\t\t// this statement calls getCourseName to get the\n\t\t// name of the course this GradeBook represents\n\t\tSystem.out.printf( \"Welcome to the grade book for\\n%s!\\n\", getCourseName() );\n\t}", "protected void displayMessage(String message) throws IOException {\n FXMLLoader fxmlLoader =\n new FXMLLoader(getClass().getResource(DISPLAY));\n Parent root = fxmlLoader.load();\n\n DisplayController displayController = fxmlLoader.getController();\n System.out.println(\"Messages: \");\n System.out.println(message + \"\\n\");\n displayController.setText(message);\n\n Stage stage = new Stage();\n stage.setScene(new Scene(root));\n stage.showAndWait();\n }", "public void displayMessage(String m){\n\t\tJOptionPane.showMessageDialog(null, m, \"Perfect !\", JOptionPane.INFORMATION_MESSAGE);\n\t}", "@SuppressWarnings(\"unused\")\n public static void info(String message) {\n FacesContext.getCurrentInstance()\n .addMessage(null,\n new FacesMessage(FacesMessage.SEVERITY_INFO,\n FacesUtils.getlocalizedString(ResourceBundles.GENERAL, \"info\"),\n message));\n }", "public void showInformationMessage(final String message) {\r\n JOptionPane.showMessageDialog(window, message, getTitle(), JOptionPane.INFORMATION_MESSAGE);\r\n }", "void info(String message);", "@Override\n\tpublic void info(CharSequence message) {\n\n\t}", "public void showErrorMessage(String message){\n System.out.println(LocalTime.now() + \": Error: \" + message);\n }", "private void displayMessage23(String message) {\n TextView virtualBankReadMore = (TextView) findViewById(R.id.read_more23);\n virtualBankReadMore.setTextColor(Color.BLACK);\n virtualBankReadMore.setText(message);\n virtualBankReadMore.setGravity(Gravity.CENTER);\n }", "public void getMessage() {\r\n // use JOptionPane to have a pop up box informing user of the invalid token\r\n JOptionPane.showMessageDialog(null, \"Invalid Token \" + invalidToken);\r\n }", "@Override\r\n public final void displayInfo(final String message) {\r\n displayMessage(message, \"Info\", SWT.ICON_INFORMATION);\r\n }", "private void showMessageOnScreen(String message) {\n JOptionPane.showMessageDialog(this, message);\n }", "public static void message() {\r\n\t\t\r\n\t\tJOptionPane.showMessageDialog(null, \"Thanks for your participation\" + \"\\nHave a great day!\");\r\n\t\t\r\n\t\t\r\n\t}", "public void message() {\n JOptionPane.showMessageDialog(null,\n \"Task was deleted successfully.\",\n \"Message\", JOptionPane.INFORMATION_MESSAGE);\n }", "@HippyMethod(name = \"show\")\n\tpublic void show(String message)\n\t{\n\t\tLogUtils.d(CLASSNAME, message);\n\t\t// Toast.makeText(hippyRootView.getContext(), message, Toast.LENGTH_SHORT).show();\n\t}", "public void displayMessage(String text)\r\n {\r\n Message message = new Message();\r\n message.what = GUIManager.DISPLAY_INFO_TOAST;\r\n message.obj = text;\r\n mGUIManager.sendThreadSafeGUIMessage(message);\r\n }", "@FXML\r\n public void displayMessage(String message) {\r\n \r\n Alert displayMessage = new Alert(Alert.AlertType.INFORMATION);\r\n displayMessage.setTitle(null);\r\n displayMessage.setHeaderText(null);\r\n displayMessage.setContentText(message);\r\n displayMessage.showAndWait();\r\n \r\n }", "private synchronized void display(String msg) {\n\n\t\t//guiConversation.append(msg);\n\t\tSystem.out.println(msg);\n\t}", "private void display(String msg) {\n String time = simpleDateFormat.format(new Date()) + \" | \" + msg;\n System.out.println(time);\n }", "@Override\n public void displayMessage(String message) {\n Toast.makeText(getActivity(),message,Toast.LENGTH_SHORT).show();\n }", "private void displayMessage2(String message) {\n TextView boomersReadMore = (TextView) findViewById(R.id.read_more2);\n boomersReadMore.setTextColor(Color.BLACK);\n boomersReadMore.setText(message);\n boomersReadMore.setGravity(Gravity.CENTER);\n }", "int displayNotification(Message message);", "public void showMessage(String message) {\n\t\tMessagebox.show(message);\n\t}", "void displayErrorMessage(String message);", "private void toAbilityInfoDialogue(String message) {\n controller.getUIController().messageAbilityDialogue(message);\n }", "public void displayMessage()\n {\n // getCourseName gets the name of the course\n System.out.printf( \"Welcome to the grade book for\\n%s!\\n\\n\",\n getCourseName() );\n }", "public void displayLabel(String message)\n\t{\n\t\tGameplayPanel gameplayPanel = (GameplayPanel) container.getComponent(3);\n\t\tgameplayPanel.setMessage(message);\n\t}", "private void serverDisplay(String message)\n {\n String timeStamp = dateFormat.format(new Date()) + \" \" + message;\n System.out.println(timeStamp);\n }", "private void displayMessage12(String message) {\n TextView jokkoReadMore = (TextView) findViewById(R.id.read_more12);\n jokkoReadMore.setTextColor(Color.BLACK);\n jokkoReadMore.setText(message);\n jokkoReadMore.setGravity(Gravity.CENTER);\n }", "public displayMessage() {}", "public synchronized void displayMessage(String msg) {\n\t\tthis.commonTxtView.setText(msg);\n\n\t}", "private void displayMessage22(String message) {\n TextView kiliVrReadMore = (TextView) findViewById(R.id.read_more22);\n kiliVrReadMore.setTextColor(Color.BLACK);\n kiliVrReadMore.setText(message);\n kiliVrReadMore.setGravity(Gravity.CENTER);\n }", "public void getMessage() {\n\r\n\t}", "private void displayMessage(String text) {\n toggleProgress();\n userMessage.setVisibility(View.VISIBLE);\n userMessage.setText(text);\n }", "private void display(String msg) {\n\t\tString msgF = \"\\tClient- \" + msg + \"\\n\\n >> \";\n System.out.print(msgF);\n }", "protected abstract void info(String msg);", "@Override\n public void showMessage(String message) {\n getRootActivity().showMessage(message);\n }", "private void displayMessage13(String message) {\n TextView greenwashReadMore = (TextView) findViewById(R.id.read_more13);\n greenwashReadMore.setTextColor(Color.BLACK);\n greenwashReadMore.setText(message);\n greenwashReadMore.setGravity(Gravity.CENTER);\n }", "public void showMessage(){\n final AlertDialog.Builder alert = new AlertDialog.Builder(context);\n alert.setMessage(message);\n alert.setTitle(title);\n alert.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n alert.create().dismiss();\n }\n });\n alert.create().show();\n }", "private void displayMessage11(String message) {\n TextView setTicReadMore = (TextView) findViewById(R.id.read_more11);\n setTicReadMore.setTextColor(Color.BLACK);\n setTicReadMore.setText(message);\n setTicReadMore.setGravity(Gravity.CENTER);\n }", "@Override\n\tpublic void showError(String message) {\n\t\t\n\t}", "private void displayMessage3(String message) {\n TextView iDropWaterReadMore = (TextView) findViewById(R.id.read_more3);\n iDropWaterReadMore.setTextColor(Color.BLACK);\n iDropWaterReadMore.setText(message);\n iDropWaterReadMore.setGravity(Gravity.CENTER);\n }", "void showError(String message);", "void showError(String message);", "static void displayMessage() {\n\n System.out.println(\"\\nA total of \" + graphVisited.size() + \" vertices visited\");\n\n System.out.println(\"Found \" + silhouetteAnalyzer(numberOfVertices)\n + \" silhouettes\");\n }", "@Override\n\tpublic void displayMessage(LinphoneCore lc, String message) {\n\t\t\n\t}", "private void showAuthorDetails()\n {\n String message = \"Author: Kyle Russell\\nUniversity: Auckland University of Technology\\nContact: [email protected]\";\n JOptionPane.showMessageDialog(null, message, \"Author information\", JOptionPane.INFORMATION_MESSAGE);\n }", "public void showNamedMessage(String message) {\n\t\ttextUI.showNamedMessage(this.name, message);\n\t}", "private void display(String msg) {\n\t\tif(cg == null)\n\t\t\tSystem.out.println(msg); // println for Console mode\n\t\telse\n\t\t\tcg.append(msg + \"\\n\"); // Append to, for example, JTextArea in the ClientGUI\n\t}", "public void showMessage(int x, int y, String message) {\n }", "private void displayMessage4(String message) {\n TextView vulaMobileReadMore = (TextView) findViewById(R.id.read_more4);\n vulaMobileReadMore.setTextColor(Color.BLACK);\n vulaMobileReadMore.setText(message);\n vulaMobileReadMore.setGravity(Gravity.CENTER);\n }", "public void information(final String message) {\n\t\tSwingUtilities.invokeLater(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tinformations.setInformation(i18n.getMessage(message));\n\t\t\t}\n\t\t});\n\t}", "private void displayToast(String message) {\n Toast.makeText(OptionActivity.this, message, Toast.LENGTH_SHORT).show();\n }", "public void showMessage(String msg) {\n\t\tif (message == null)\n\t\t\tcreateMessage(msg);\n\t\tremove(message);\n\t\tcreateMessage(msg);\n\t}" ]
[ "0.79723346", "0.7958411", "0.7895593", "0.78872746", "0.78872746", "0.77887356", "0.7770552", "0.77664757", "0.77549875", "0.7751561", "0.774048", "0.7717888", "0.771012", "0.7611875", "0.75800794", "0.75740224", "0.75396025", "0.7480221", "0.74744344", "0.74133736", "0.7385123", "0.7377713", "0.73748684", "0.7367416", "0.73548913", "0.73548913", "0.73548913", "0.73476243", "0.7340022", "0.73119974", "0.7294626", "0.7284302", "0.72660905", "0.72636974", "0.7251125", "0.72474074", "0.72359", "0.7233818", "0.7221678", "0.7199251", "0.7199251", "0.7195035", "0.7186046", "0.7162487", "0.7159952", "0.71567744", "0.715574", "0.71420026", "0.7135507", "0.7118348", "0.7110664", "0.70986855", "0.7096157", "0.70567954", "0.7056682", "0.70524424", "0.7037061", "0.70251435", "0.69589907", "0.69483304", "0.6940107", "0.69233495", "0.69188505", "0.690582", "0.6893323", "0.68877846", "0.6883488", "0.6866058", "0.6857962", "0.68426657", "0.6836791", "0.68201977", "0.6817101", "0.6806621", "0.67901486", "0.6780286", "0.67785", "0.6777313", "0.6774359", "0.6762985", "0.6755177", "0.6750534", "0.6748979", "0.6743025", "0.673028", "0.6727741", "0.6725535", "0.6724492", "0.6722145", "0.67207295", "0.67207295", "0.67199516", "0.6711038", "0.67106384", "0.670714", "0.6705668", "0.66968", "0.6694549", "0.6688902", "0.6681129", "0.6680671" ]
0.0
-1
metodo implementado por la interfaz IVentanas que inicializa componentes de la ventana
public void inicializar() { try { setDefaultLookAndFeelDecorated(true); com.jtattoo.plaf.hifi.HiFiLookAndFeel.setTheme("Large-Font", "INSERT YOUR LICENSE KEY HERE", "Gallery of Fantastic Puzzles"); UIManager.setLookAndFeel("com.jtattoo.plaf.hifi.HiFiLookAndFeel"); } catch (Exception e) { e.printStackTrace(); } //Configuración del JDialog setBounds(100, 100, 450, 300); this.setLocationRelativeTo(null); getContentPane().setLayout(new BorderLayout()); contentPanel.setLayout(new FlowLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); //Componentes del JDialog { //TEXTO DE BIENVENIDA dtrpnBienve = new JEditorPane(); dtrpnBienve.setOpaque(false); dtrpnBienve.setEditable(false); dtrpnBienve.setPreferredSize(new Dimension(400, 130)); dtrpnBienve.setFont(new Font("Segoe UI", Font.BOLD, 15)); dtrpnBienve.setText( "Bienvenido/a a GFPuzzles, la aplicación desarrollada por \r\nAlige Development para la Gestión de su Galería de Arte\r\n\r\nPara más información, consulte los siguientes \r\napartados del menú Ayuda."); contentPanel.add(dtrpnBienve); } { //ICONO CORPORATIVO lblNewLabel = new JLabel(""); lblNewLabel.setVerticalAlignment(SwingConstants.BOTTOM); lblNewLabel.setIcon(new ImageIcon(DialogBienve.class.getResource("/images/19-70x70.png"))); contentPanel.add(lblNewLabel); } { //PANEL DESTINADO PARA LOS BOTONES buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane, BorderLayout.SOUTH); { //BOTON OK btnOkBienve = new JButton("OK"); btnOkBienve.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { DialogBienve.this.dispose(); } }); btnOkBienve.setActionCommand("OK"); buttonPane.add(btnOkBienve); getRootPane().setDefaultButton(btnOkBienve); } { //etiqueta utilizada para separar el icono del cuadro de texto lblNewLabel_1 = new JLabel(""); lblNewLabel_1.setPreferredSize(new Dimension(30, 14)); lblNewLabel_1.setMinimumSize(new Dimension(246, 14)); lblNewLabel_1.setMaximumSize(new Dimension(246, 14)); buttonPane.add(lblNewLabel_1); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initcomponent() {\n\r\n\t}", "private void inicializarcomponentes() {\n Comunes.cargarJList(jListBecas, becasFacade.getTodasBecasVigentes());\n \n }", "private void inicializarComponentes() {\n universidadesIncluidos = UniversidadFacade.getInstance().listarTodosUniversidadOrdenados();\n universidadesIncluidos.removeAll(universidadesExcluidos);\n Comunes.cargarJList(jListMatriculasCatastrales, universidadesIncluidos);\n }", "void inicializaComponentes(){\r\n\t\t\r\n\t\t//Botão com status\r\n\t\ttgbGeral = (ToggleButton) findViewById(R.id.tgbGeral);\r\n\t\ttgbGeral.setOnClickListener(this);\r\n\t\ttgbMovimento = (ToggleButton) findViewById(R.id.tgbMovimento);\r\n\t\ttgbMovimento.setOnClickListener(this);\r\n\t\ttgbfogo = (ToggleButton) findViewById(R.id.tgbFogo);\r\n\t\ttgbfogo.setOnClickListener(this);\r\n\r\n\t\t//botão\r\n\t\tbtnTemperatura = (Button) findViewById(R.id.btnTemperatura);\r\n\t\tbtnTemperatura.setOnClickListener(this);\r\n\t\t\r\n\t\t//label\r\n\t\ttxtLegenda = (TextView) findViewById(R.id.txtSensorLegenda);\r\n\t}", "public void InicializarComponentes() {\n campoCadastroNome = findViewById(R.id.campoCadastroNome);\n campoCadastroEmail = findViewById(R.id.campoCadastroEmail);\n campoCadastroSenha = findViewById(R.id.campoCadastroSenha);\n switchEscolhaTipo = findViewById(R.id.switchCadastro);\n botaoFinalizarCadastro = findViewById(R.id.botaoFinalizarCriacao);\n\n\n }", "public void inizializza() {\n Navigatore nav;\n Portale portale;\n\n super.inizializza();\n\n try { // prova ad eseguire il codice\n\n Modulo modulo = getModuloRisultati();\n modulo.inizializza();\n// Campo campo = modulo.getCampoChiave();\n// campo.setVisibileVistaDefault(false);\n// campo.setPresenteScheda(false);\n// Vista vista = modulo.getVistaDefault();\n// vista.getElement\n// Campo campo = vista.getCampo(modulo.getCampoChiave());\n\n\n\n /* aggiunge il Portale Navigatore al pannello placeholder */\n nav = this.getNavigatore();\n portale = nav.getPortaleNavigatore();\n this.getPanNavigatore().add(portale);\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }", "private static void inicializarComponentes() {\n\t\tgaraje = new Garaje();\r\n\t\tgarajeController=new GarajeController();\r\n\t\tgarajeController.iniciarPlazas();\r\n\t\t\r\n\t\tmenuInicio = new StringBuilder();\r\n\t\tmenuInicio.append(\"¡Bienvenido al garaje!\\n\");\r\n\t\tmenuInicio.append(\"****************************************\\n\");\r\n\t\tmenuInicio.append(\"9: Guardar Plazas\\n\");\r\n\t\tmenuInicio.append(\"0: Listar Plazas\\n\");\r\n\t\tmenuInicio.append(\"1: Listar Plazas Coche\\n\");\r\n\t\tmenuInicio.append(\"2: Listar Plazas Moto\\n\");\r\n\t\tmenuInicio.append(\"3: Reservar Plaza\\n\");\r\n\t\tmenuInicio.append(\"4: Listar Plazas Libres\\n\");\r\n\t\tmenuInicio.append(\"5: Listar Clientes\\n\");\r\n\t\tmenuInicio.append(\"6: Listar Vehículos\\n\");\r\n//\t\tmenuInicio.append(\"7:\\n\");\r\n//\t\tmenuInicio.append(\"8:\\n\");\r\n\t}", "private void initComponents() {\n\t\t\n\t}", "private void initComponents() {\n\t\t\n\t}", "@PostConstruct\n\tpublic void inicializar() {\n\t}", "public VPacientes() {\n initComponents();\n inicializar();\n }", "public void inicializar();", "private void initComponents() {\r\n\t\temulator = new Chip8();\r\n\t\tpanel = new DisplayPanel(emulator);\r\n\t\tregisterPanel = new EmulatorInfoPanel(emulator);\r\n\t\t\r\n\t\tcontroller = new Controller(this, emulator, panel, registerPanel);\r\n\t}", "private void inicializarComponentes() \n\t{\n\t\tthis.table=new JTable(); \n\t\ttablas.setBackground(Color.white);\n\t\tscroll =new JScrollPane(table); // Scroll controla la tabla\n\t\tthis.add(scroll,BorderLayout.CENTER);\n\t\tthis.add(tablas,BorderLayout.NORTH);\n\t\t\n\t}", "@Override\r\n\tprotected void initVentajas() {\n\r\n\t}", "@PostConstruct\r\n\tpublic void init() {\n\t\ttexto=\"Nombre : \";\r\n\t\topcion = 1;\r\n\t\tverPn = true;\r\n\t\ttipoPer = 1;\r\n\t\tsTipPer = \"N\";\r\n\t\tverGuar = true;\r\n\t\tvalBus = \"\";\r\n\t\tverCampo = true;\r\n\t\tread = false;\r\n\t\tgrabar = 0;\r\n\t\tcodCli = 0;\r\n\t\tcargarLista();\r\n\t}", "@PostConstruct\r\n public void inicializar() {\r\n try {\r\n anioDeclaracion = 0;\r\n existeDedPatente = false;\r\n deducciones = false;\r\n detaleExoDedMul = new ArrayList<String>();\r\n activaBaseImponible = 0;\r\n verBuscaPatente = 0;\r\n inicializarValCalcula();\r\n datoGlobalActual = new DatoGlobal();\r\n patenteActual = new Patente();\r\n patenteValoracionActal = new PatenteValoracion();\r\n verPanelDetalleImp = 0;\r\n habilitaEdicion = false;\r\n numPatente = \"\";\r\n buscNumPat = \"\";\r\n buscAnioPat = \"\";\r\n catDetAnio = new CatalogoDetalle();\r\n verguarda = 0;\r\n verActualiza = 0;\r\n verDetDeducciones = 0;\r\n verBotDetDeducciones = 0;\r\n listarAnios();\r\n } catch (Exception ex) {\r\n LOGGER.log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "protected void inicializar(){\n kr = new CreadorHojas(wp);\n jPanel1.add(wp,0); // inserta el workspace en el panel principal\n wp.insertarHoja(\"Hoja 1\");\n //wp.insertarHoja(\"Hoja 2\");\n //wp.insertarHoja(\"Hoja 3\");\n }", "@Override\n public void autonomousInit() {\n \n }", "private void inicializarComponentes() {\n\n\n comenzar = new JButton(devolverImagenButton(\"comenzar\", \"png\", 300, 300));\n comenzar.setRolloverIcon(devolverImagenButton(\"comenzar1\", \"png\", 300, 300));\n comenzar.setBackground(Color.WHITE);\n comenzar.setBorder(null);\n comenzar.setActionCommand(\"COMENZAR\");\n comenzar.setBounds(335, 450, 240, 100);\n add(comenzar);\n\n l1 = new JLabel();\n devolverImagenLabel(\"Bienvenido\", \"gif\", 900, 700, l1);\n l1.setBounds(0, 0, 900, 700);\n add(l1);\n\n }", "public Vencimientos() {\n initComponents();\n \n \n }", "@Override\n public void autonomousInit() {\n }", "@Override\n public void autonomousInit() {\n }", "public void inizializza() {\n\n /* invoca il metodo sovrascritto della superclasse */\n super.inizializza();\n\n }", "public void initControles(){\n\n }", "private void initComponent() {\n\t\taddGrid();\n\t\taddToolBars();\n\t}", "@Override\n public void initComponent() {\n }", "@Override\n public void initComponent() {\n }", "public void init(){\n \n }", "public void inicializarInterfaz() {\n\t\tvista.setVisible(true);\n\t\tvista.bienvenida.setVisible(true);\n\t\tvista.sel_billete.setVisible(false);\n\t\tvista.sel_fecha.setVisible(false);\n\t\tvista.detalles_compra.setVisible(false);\n\t\tvista.login.setVisible(false);\n\t\tvista.registro.setVisible(false);\n\t\tvista.pago.setVisible(false);\n\t\tvista.fin_pago.setVisible(false);\n\t\tvista.agur.setVisible(false);\n\t\t\n\t}", "public void iniciarComponentes(){\n\n crearPanel();\n colocarBotones();\n \n }", "public abstract void init() throws ComponentInitializationException;", "@Override\r\n public void initComponent() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "private void createUIComponents() {\n }", "public Encargar() { \n initComponents();\n inicializar();\n \n }", "private void inicializar() {\n\t\treporte = new Jasperreport();\n\t\tdiv = new Div();\n\t}", "public void inicializar(Component comp) {\r\n\r\n\t\tList<Tematica> tematica = servicioTematica.buscarTematicasDeArea(area);\r\n\t\tltbTematica.setModel(new ListModelList<Tematica>(tematica));\r\n\r\n\t}", "@Override\n\tpublic void autonomousInit() {\n\t}", "private void createUIComponents() {\n }", "private void initBefore() {\n // Crear Modelo\n model = new Model();\n\n // Crear Controlador\n control = new Controller(model, this);\n\n // Cargar Propiedades Vista\n prpView = UtilesApp.cargarPropiedades(FICHERO);\n\n // Restaurar Estado\n control.restaurarEstadoVista(this, prpView);\n\n // Otras inicializaciones\n }", "private void init() {\n\t\tinitDesign();\n\t\tinitHandlers();\n\t}", "public void autonomousInit() {\n \n }", "protected void _init(){}", "private void init() {\n\n\t}", "@Override\r\n\tprotected void processInit() {\n\t\t\r\n\t}", "private void iniciarComponentesInterface() {\n\t\tPanelchildren panelchildren = new Panelchildren();\r\n\t\tpanelchildren.setParent(this);\r\n\t\tlistBox = new Listbox();\r\n\t\tlistBox.setHeight(\"300px\");\r\n\t\tlistBox.setCheckmark(true);\r\n\t\tlistBox.setMultiple(false);\r\n\t\tlistBox.setParent(panelchildren);\r\n\t\tListhead listHead = new Listhead();\r\n\t\tlistHead.setParent(listBox);\r\n\t\tListheader listHeader = new Listheader(\"Projeto\");\r\n\t\tlistHeader.setParent(listHead);\r\n\r\n\t\t// Botões OK e Cancelar\r\n\t\tDiv div = new Div();\r\n\t\tdiv.setParent(panelchildren);\r\n\t\tdiv.setStyle(\"float: right;\");\r\n\t\tSeparator separator = new Separator();\r\n\t\tseparator.setParent(div);\r\n\t\tButton botaoOK = new Button(\"OK\");\r\n\t\tbotaoOK.addEventListener(\"onClick\", new EventListenerOK());\r\n\t\tbotaoOK.setWidth(\"100px\");\r\n\t\tbotaoOK.setStyle(\"margin-right: 5px\");\r\n\t\tbotaoOK.setParent(div);\r\n\t\tButton botaoCancelar = new Button(\"Cancelar\");\r\n\t\tbotaoCancelar.addEventListener(\"onClick\", new EventListenerCancelar());\r\n\t\tbotaoCancelar.setWidth(\"100px\");\r\n\t\tbotaoCancelar.setParent(div);\r\n\t}", "public void init() {\n \n }", "public void init() {\r\n\t\tlog.info(\"init()\");\r\n\t\tobjIncidencia = new IncidenciaSie();\r\n\t\tobjObsIncidencia = new ObservacionIncidenciaSie();\r\n\t\tobjCliente = new ClienteSie();\r\n\t\tobjTelefono = new TelefonoPersonaSie();\r\n\t}", "public void init() {\r\n\r\n\t}", "private void initComposants() {\r\n\t\tselectionMatierePanel = new SelectionMatierePanel(1);\r\n\t\ttableauPanel = new TableauPanel(1);\r\n\t\tadd(selectionMatierePanel, BorderLayout.NORTH);\r\n\t\tadd(tableauPanel, BorderLayout.SOUTH);\r\n\t\t\r\n\t}", "private void instanciarComponentes() {\n\t\t\n\t\tpainelTopo = new JPanel(new FlowLayout());\n\t\tpainelTopo.setBackground(Color.LIGHT_GRAY);\n\t\tlbInicial = new JLabel(\"De: \");\n\t\tlbFinal = new JLabel(\"Até: \");\n\t\tlabelTabuadoDo = new JLabel(\"Tabuada do: \");\n\t\ttxtInicial = new JTextField(10);\n\t\ttxtFinal = new JTextField(10);\n\t\ttxtNumero = new JTextField(10);\n\t\tbuttonCalcular = new JButton(\"Calcular\");\n\t\tpainelCentro = new JPanel(new FlowLayout());\n\t}", "public DepControlar() {\n \n initComponents();\n depservice = new DepService();\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "private void initiateInternal() {\n\n //define adaptation listener\n this.addComponentListener(new ComponentAdapter() {\n @Override\n public void componentResized(ComponentEvent e) {\n adapt(e);\n }\n });\n\n //solve problem with unloading of internal components\n setExtendedState(ICONIFIED | MAXIMIZED_BOTH);\n //the set visible must be the last thing called \n pack();\n setExtendedState(MAXIMIZED_BOTH);\n setVisible(true);\n }", "protected void init(){\n }", "@Override\r\n\tpublic void init() {}", "public void inicializa_controles() {\n bloquea_campos();\n bloquea_botones();\n carga_fecha();\n ocultar_labeles();\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate void initComponents() {\n\t\t//System.out.println(\"----------------------------Welcome Sip client---------------------------------------------\");\n\t\tiniStack();\n\t\t//onInvite(sendTo,message);\n//\t\tonRegisterStateless();\n\n\t}", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "@Override\r\n\tprotected void processInit() {\n\r\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "public abstract void setupComponent();", "private void init() {\n\n\n\n }", "@PostConstruct\n\tprivate void init() {\n\t\tEntrada entr = new Entrada(\n\t\t\t\tnew Persona(\"Manuel\",\"Jimenex\",\"52422\",\"100000\",\"Cra 340\"),\n\t\t\t\t(new PreFactura(1l,new Date())), itemsService.lista());\n\t\t\n\t\tlistaEntrada.add(entr);\n\t}", "private void inicComponent() {\n\n\t\tprogres = (LinearLayout) findViewById(R.id.linearLayoutProgres);\n\t\t\n\t\tbuttonKategorije = (Button) findViewById(R.id.buttonKategorije);\n\t\t\n\t}", "private void startComponents(){\n\n if(isAllowed(sentinel)){\n SentinelComponent sentinelComponent = new SentinelComponent(getInstance());\n sentinelComponent.getCanonicalName();\n }\n\n if(isAllowed(\"fileserver\")){\n FileServer fileServer = new FileServer(getInstance());\n fileServer.getCanonicalName();\n }\n\n if(isAllowed(\"manager\")){\n ManagerComponent Manager = new ManagerComponent(getInstance());\n Manager.getCanonicalName();\n }\n\n// if(isAllowed(\"sdk\")){\n// SDK sdk = new SDK(getInstance());\n// sdk.getCanonicalName();\n// }\n\n if(isAllowed(\"centrum\")){\n CentrumComponent centrum1 = new CentrumComponent(getInstance(), null);\n centrum1.getCanonicalName();\n }\n\n }", "private void initComponent() {\n\t\tmlistview=(ClickLoadListview) findViewById(R.id.ListView_hidden_check);\n\t\tChemicals_directory_search=(CustomFAB) findViewById(R.id.company_hidden_search);\n\t\tChemicals_directory_search.setVisibility(View.GONE);\n\t\ttopbar_com_name=(TopBarView) findViewById(R.id.topbar_com_name);\n\t\tsearch_chemical_name=(SearchInfoView) findViewById(R.id.search_chemical_name);\n\t}", "public VComponente() {\n initComponents();\n }", "public void initComponents() {\n Iterator<Component> itComponent = this.components.iterator();\n while (itComponent.hasNext()) {\n itComponent.next().init(this);\n }\n\n Iterator<Script> itScript = this.scripts.iterator();\n while (itScript.hasNext()) {\n itScript.next().init(this);\n }\n System.out.println(this.owner.id + \" : \" + this.components.toString() + \" \" + this.scripts.toString());\n\n }", "public TelaConversao() {\n initComponents();\n }", "private void inicializar () {\n String infService = Context.LAYOUT_INFLATER_SERVICE;\n LayoutInflater li = (LayoutInflater)getContext().getSystemService(infService);\n li.inflate(R.layout.activity_control_login,this,true);\n\n //Obtenemos las referencias a los distintos controles\n txtUsuario = (EditText) findViewById(R.id.TxtUsuario);\n txtPassword = (EditText) findViewById(R.id.TxtPassword);\n btnAceptar = (Button) findViewById(R.id.BtnAceptar);\n lblMensaje = (TextView) findViewById(R.id.LblMensaje);\n\n //Asignamos los eventos necesarios\n asignarEventos();\n }", "protected abstract void init();", "protected abstract void init();", "protected abstract void init();", "protected abstract void init();", "protected abstract void init();", "protected abstract void init();", "protected abstract void init();", "protected abstract void init();" ]
[ "0.76063985", "0.7601321", "0.74748915", "0.7347636", "0.72658396", "0.7218748", "0.720572", "0.7161264", "0.7161264", "0.7034087", "0.7027732", "0.6981768", "0.6972547", "0.69383496", "0.69087225", "0.6872594", "0.6842815", "0.6841878", "0.6813803", "0.68136144", "0.68051547", "0.6803298", "0.67845416", "0.67845416", "0.6766758", "0.6762866", "0.6760795", "0.6757651", "0.6757651", "0.67517114", "0.67485946", "0.67282003", "0.6722559", "0.6717591", "0.67165357", "0.67165357", "0.67165357", "0.67165357", "0.67165357", "0.67165357", "0.67165357", "0.67165357", "0.67165357", "0.67165357", "0.67165357", "0.67165357", "0.67165357", "0.67165357", "0.67165357", "0.67165357", "0.67165357", "0.67165357", "0.66921437", "0.6675503", "0.6665023", "0.66645974", "0.6652398", "0.66448015", "0.6643689", "0.66327655", "0.66265875", "0.6624453", "0.6623012", "0.6618318", "0.6597271", "0.6590044", "0.6586384", "0.6572786", "0.657183", "0.6562862", "0.6556794", "0.6556794", "0.6556794", "0.6556405", "0.65537286", "0.65527385", "0.6538025", "0.65298426", "0.65272945", "0.65272945", "0.65272945", "0.6526523", "0.6525279", "0.6524016", "0.65184385", "0.6515484", "0.6511503", "0.65091264", "0.6499972", "0.64982766", "0.6497698", "0.6492694", "0.64912325", "0.6477297", "0.6477297", "0.6477297", "0.6477297", "0.6477297", "0.6477297", "0.6477297", "0.6477297" ]
0.0
-1
Check if existing ApiResponse set
@Override public void process(Exchange exchange) throws Exception { ApiResponse existing = exchange.getProperty(PROPERTY_API_RESPONSE, ApiResponse.class); // Check if any ApiResponse's failed boolean failure = exchange.getIn().getBody(List.class).stream().anyMatch(o -> o instanceof ApiResponse && ((ApiResponse) o).getCode() != 200); // If found existing and it contains a failure then fail this response if (existing != null && existing.getCode() != ApiResponse.SUCCESS) { failure = true; } // Create ApiResponse and all list of responses ApiResponse response = failure ? ApiResponse.badRequest() : ApiResponse.success(); response.setResponses(exchange.getIn().getBody(List.class)); // If found existing then add responses if (existing != null && existing.getResponses() != null) { response.getResponses().addAll(existing.getResponses()); } // Flatten responses if single if (response.getResponses().size() == 1) { response = response.getResponses().get(0); } // Set as exchange property to be picked up by ApiResponseProcessor exchange.setProperty(PROPERTY_API_RESPONSE, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasListResponse();", "default boolean checkJsonResp(JsonElement response) {\n return false;\n }", "public boolean hasResponse() {\n return responseBuilder_ != null || response_ != null;\n }", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "public boolean hasResponse() {\n return responseBuilder_ != null || response_ != null;\n }", "public boolean hasResponse() {\n return instance.hasResponse();\n }", "public boolean hasResponse() {\n return instance.hasResponse();\n }", "public boolean hasResponse() {\n return instance.hasResponse();\n }", "public boolean hasResponse() {\n return instance.hasResponse();\n }", "public boolean hasResponse() {\n return response_ != null;\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "public boolean hasListResponse() {\n return msgCase_ == 6;\n }", "public boolean hasResponse() {\n return response_ != null;\n }", "public boolean hasResponse() {\n return response_ != null;\n }", "public boolean hasResponse() {\n return response_ != null;\n }", "public boolean isApiError() {\n return this.getCode() != null && this.getCode() > 0;\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "boolean hasGenericResponse();", "public boolean hasListResponse() {\n return msgCase_ == 6;\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "boolean isSerializeResponse();", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof OcApi)) {\n return false;\n }\n OcApi other = (OcApi) object;\n if ((this.apiId == null && other.apiId != null) || (this.apiId != null && !this.apiId.equals(other.apiId))) {\n return false;\n }\n return true;\n }", "boolean hasApiUrl();", "boolean hasInitialResponse();", "@Override\n public boolean equals(Object objectToCompare)\n {\n if (this == objectToCompare)\n {\n return true;\n }\n if (! (objectToCompare instanceof APIOperationResponse))\n {\n return false;\n }\n if (! super.equals(objectToCompare))\n {\n return false;\n }\n\n APIOperationResponse that = (APIOperationResponse) objectToCompare;\n\n if (headerAttributeCount != that.headerAttributeCount)\n {\n return false;\n }\n if (requestAttributeCount != that.requestAttributeCount)\n {\n return false;\n }\n if (responseAttributeCount != that.responseAttributeCount)\n {\n return false;\n }\n return apiOperation != null ? apiOperation.equals(that.apiOperation) : that.apiOperation == null;\n }", "public boolean isResponse(){\n return true;\n }", "@SuppressWarnings(\"unchecked\")\n private boolean checkResponse (HttpResponse<?> pResponse) {\n boolean result = false;\n if (pResponse != null\n && pResponse.getStatus() == 200\n && pResponse.getBody() != null) {\n HttpResponse<String> response = (HttpResponse<String>)pResponse;\n JSONObject body = new JSONObject(response.getBody());\n if (body.has(\"result\")) {\n result = Boolean.TRUE.equals(body.getBoolean(\"success\"));\n }\n }\n return result;\n }", "public final boolean hasResponseValues()\n\t{\n\t\treturn m_responseValues != null ? true : false;\n\t}", "public boolean hasResponseLog() {\n return result.hasResponseLog();\n }", "boolean hasFindGamesResponse();", "public boolean hasResponse() {\n if(responses == null)\n return false;\n for(SapMessage response : responses) {\n if(response != null)\n return true;\n }\n return false;\n }", "protected void verifyResponseInputModel( String apiName)\n {\n verifyResponseInputModel( apiName, apiName);\n }", "public boolean hasResponseBytes() {\n return result.hasResponseBytes();\n }", "public boolean hasSubnetResponse() {\n return subnetResponseBuilder_ != null || subnetResponse_ != null;\n }", "public boolean hasResponseType() {\n return fieldSetFlags()[4];\n }", "boolean hasScoreUpdateResponse();", "boolean isMarkAsResponse();", "Boolean responseHasErrors(MovilizerResponse response);", "public boolean validateReponse(Response response, int id,int which)\n {\n return response.isSuccessful();\n }", "public boolean hasResponseAddress() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "@java.lang.Override\n public boolean hasSearchResponse() {\n return searchResponse_ != null;\n }", "@Override\n\tpublic boolean isResponseExpected() {\n\t\treturn false;\n\t}", "boolean hasResponseAddress();", "boolean isSetSchufaResponseData();", "public boolean hasResponseAddress() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "boolean hasSystemResponse();", "public boolean hasSearchResponse() {\n return searchResponseBuilder_ != null || searchResponse_ != null;\n }", "@java.lang.Override\n public boolean hasReplicateResponse() {\n return replicateResponse_ != null;\n }", "boolean hasResponseMessage();", "boolean hasReplacePlayerResponse();", "protected abstract boolean isResponseValid(SatelMessage response);", "@java.lang.Override\n public boolean hasSubnetResponse() {\n return subnetResponse_ != null;\n }", "boolean hasReflectionResponse();", "public boolean hasInitialResponse() {\n return instance.hasInitialResponse();\n }", "public boolean validateResponse(Response response) {\n return response.isSuccessful();\n }", "boolean hasReplicateResponse();", "boolean hasSearchResponse();", "boolean isSetIdVerificationResponseData();", "public boolean hasReplicateResponse() {\n return replicateResponseBuilder_ != null || replicateResponse_ != null;\n }", "default boolean checkForError(HttpResponse response) {\n parameters.clear();\n\n\n if (response.getStatusCode() == 500) {\n System.out.println(\"Internal server error\");\n return true;\n } else if (response.getStatusCode() == 400) {\n System.out.println(\"Your input was not as expected. Use \\\"help\\\"-command to get more help.\");\n System.out.println(response.getBody());\n return true;\n } else if (response.getStatusCode() == 404) {\n System.out.println(\"The resource you were looking for could not be found. Use \\\"help\\\"-command to get more help.\");\n }\n\n return false;\n\n }", "public boolean hasInitialResponse() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "private boolean responseAvailable() {\n return (responseBody != null) || (responseStream != null);\n }", "protected boolean dispatchToAPI(Collection<API> apiSet, MessageContext synCtx) {\n List<API> defaultStrategyApiSet = new ArrayList<API>(apiSet);\n API defaultAPI = null;\n\n Object apiObject = synCtx.getProperty(RESTConstants.PROCESSED_API);\n if (apiObject != null) {\n if (identifyAPI((API) apiObject, synCtx, defaultStrategyApiSet)) {\n return true;\n }\n } else {\n //To avoid apiSet being modified concurrently\n List<API> duplicateApiSet = new ArrayList<API>(apiSet);\n for (API api : duplicateApiSet) {\n if (identifyAPI(api, synCtx, defaultStrategyApiSet)) {\n return true;\n }\n }\n }\n\n for (API api : defaultStrategyApiSet) {\n api.setLogSetterValue();\n if (api.canProcess(synCtx)) {\n if (log.isDebugEnabled()) {\n log.debug(\"Located specific API: \" + api.getName() + \" for processing message\");\n }\n apiProcess(synCtx, api);\n return true;\n }\n }\n\n if (defaultAPI != null && defaultAPI.canProcess(synCtx)) {\n defaultAPI.setLogSetterValue();\n apiProcess(synCtx, defaultAPI);\n return true;\n }\n\n return false;\n }", "public boolean hasResponsePort() {\n return ((bitField0_ & 0x00000040) == 0x00000040);\n }", "public boolean hasApiUrl() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "boolean hasSubnetResponse();", "private boolean isIxbrlInDocGeneratorResponse(DocumentGeneratorResponse response) {\n\n if (StringUtils.isBlank(getIxbrlLocationFromDocGeneratorResponse(response))) {\n Map<String, Object> logMap = new HashMap<>();\n logMap.put(LOG_MESSAGE_KEY,\n \"The Ixbrl location has not been set in Document Generator Response\");\n\n LOGGER.error(LOG_DOC_GENERATOR_RESPONSE_INVALID_MESSAGE_KEY, logMap);\n\n return false;\n }\n return true;\n }", "public boolean hasResponsePort() {\n return ((bitField0_ & 0x00000040) == 0x00000040);\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof ReturnItemResponse)) {\r\n return false;\r\n }\r\n ReturnItemResponse other = (ReturnItemResponse) object;\r\n if ((this.returnItemResponseId == null && other.returnItemResponseId != null) || (this.returnItemResponseId != null && !this.returnItemResponseId.equals(other.returnItemResponseId))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n\t\t\tpublic boolean hasError(ClientHttpResponse response) throws IOException {\n\t\t\t\treturn false;\n\t\t\t}", "boolean getReturnPartialResponses();", "@Override\n public boolean equals(Object objectToCompare)\n {\n if (this == objectToCompare)\n {\n return true;\n }\n if (objectToCompare == null || getClass() != objectToCompare.getClass())\n {\n return false;\n }\n if (!super.equals(objectToCompare))\n {\n return false;\n }\n APIOperation that = (APIOperation) objectToCompare;\n return Objects.equals(getCommand(), that.getCommand()) &&\n Objects.equals(getHeaderSchemaType(), that.getHeaderSchemaType()) &&\n Objects.equals(getRequestSchemaType(), that.getRequestSchemaType()) &&\n Objects.equals(getResponseSchemaType(), that.getResponseSchemaType());\n }", "public boolean hasApiUrl() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof ResponseFinancier)) {\n return false;\n }\n ResponseFinancier other = (ResponseFinancier) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "@Override\n\tpublic BaseResponse testResponse() {\n\t\treturn setResultSuccess();\n\t}", "@java.lang.Override\n public boolean hasLocalSearchResponse() {\n return localSearchResponse_ != null;\n }", "public boolean hasRegistrationResponse() {\n return registrationResponseBuilder_ != null || registrationResponse_ != null;\n }", "boolean hasUploadResponse();", "public ApiResponse() {\n }", "public boolean isResponseError()\n\t{\n\t\treturn this.responseError;\t\t\n\t}", "protected boolean isSuccessful(Response response) {\n if (response == null) {\n return false;\n }\n //System.out.println(\" Get Status is \" + response.getStatus());\n return response.getStatus() == 200;\n }", "public boolean hasUploadResponse() {\n return uploadResponseBuilder_ != null || uploadResponse_ != null;\n }", "boolean hasRegistrationResponse();", "public boolean hasLocalSearchResponse() {\n return localSearchResponseBuilder_ != null || localSearchResponse_ != null;\n }", "public boolean getResponseStatus();" ]
[ "0.6937173", "0.68751556", "0.6615145", "0.660749", "0.660749", "0.660749", "0.660749", "0.660749", "0.660749", "0.660749", "0.660749", "0.660749", "0.6594541", "0.6525748", "0.6525748", "0.6525748", "0.6525748", "0.6500111", "0.64995104", "0.6480434", "0.6470995", "0.6458273", "0.64455014", "0.64394826", "0.64394826", "0.64394826", "0.64385676", "0.6429114", "0.6424257", "0.6424257", "0.6424257", "0.6414644", "0.6414082", "0.6392356", "0.63737166", "0.6081432", "0.60608226", "0.6047912", "0.60457134", "0.6033535", "0.5992464", "0.5968567", "0.5966685", "0.59570307", "0.5905697", "0.5897696", "0.5887734", "0.5856788", "0.58299506", "0.58291173", "0.5818799", "0.58119917", "0.5800886", "0.5758142", "0.57480884", "0.5738433", "0.573839", "0.5725365", "0.57207435", "0.5689322", "0.5689191", "0.56722236", "0.56670773", "0.5661344", "0.5645025", "0.56438", "0.5637465", "0.56264085", "0.5619014", "0.5596868", "0.55822444", "0.5576489", "0.55668944", "0.55666244", "0.5562257", "0.5528723", "0.5507684", "0.5487326", "0.5453588", "0.54479635", "0.5436835", "0.5418899", "0.5415206", "0.5400748", "0.5381428", "0.53765565", "0.5372915", "0.5370734", "0.5359431", "0.53531027", "0.53412116", "0.5333906", "0.5330496", "0.53241533", "0.5322245", "0.5321946", "0.5312898", "0.5302637", "0.530152", "0.52849513" ]
0.6125898
35
TODO: Return the communication channel to the service.
@Override public IBinder onBind(Intent intent) { return localBinder; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Channel channel() {\n return channel;\n }", "public IChannel getChannel() {\n\t\treturn message.getChannel();\n\t}", "SocketChannel getChannel();", "EzyChannel getChannel();", "public Channel getChannel()\n {\n return channel;\n }", "java.lang.String getChannel();", "protected Channel getChannel()\n {\n return mChannel;\n }", "@Override\n public int getChannel()\n {\n return channel;\n }", "public SocketChannel getChannel() {\n return channel;\n }", "public Channel getChannel()\n\t{\n\t\treturn channel;\n\t}", "public Channel getChannel() {\n return channel;\n }", "private ManagedChannel getManagedChannel() {\n return ManagedChannelBuilder.forAddress(\"localhost\", mGrpcPortNum)\n .usePlaintext()\n .build();\n }", "public Channel getChannel() {\r\n\t\treturn channel;\r\n\t}", "public int GetChannel();", "public ChannelManager getChannelManager() {\n return channelMgr;\n }", "public String getChannel() {\r\n return channel;\r\n }", "public String getChannel() {\n return channel;\n }", "public Channel getChannel() throws ConnectException\n {\n return getChannel(null);\n }", "public Object getCommunicationChannel()\r\n\t\t\tthrows PersistenceMechanismException {\n\t\treturn null;\r\n\t}", "public Channel channel()\r\n/* 36: */ {\r\n/* 37: 68 */ return this.channel;\r\n/* 38: */ }", "public String getChannel() {\r\n\t\treturn this.channel;\r\n\t}", "private SocketChannel getChannel(){\n if ( key == null ) {\n return getSocket().getChannel();\n } else {\n return (SocketChannel)key.channel();\n }\n }", "public String getChannel() {\n\t\treturn channel;\n\t}", "public String getChannel() {\n\t\treturn channel;\n\t}", "public int getChannel() {\n return channel;\n }", "public interface Channel\r\n{\r\n /**\r\n * Get a duplex connection for this channel. This method must be called for each request-response message exchange.\r\n * @param msgProps message specific properties\r\n * @param xmlOptions XML formatting options\r\n * @return connection\r\n * @throws IOException on I/O error\r\n * @throws WsConfigurationException on configuration error\r\n */\r\n DuplexConnection getDuplex(MessageProperties msgProps, XmlOptions xmlOptions) throws IOException, \r\n WsConfigurationException;\r\n \r\n /**\r\n * Get a send-only connection for this channel. This method must be called for each message to be sent without a\r\n * response.\r\n * @param msgProps message specific properties\r\n * @param xmlOptions XML formatting options\r\n * @return connection\r\n * @throws IOException on I/O error\r\n * @throws WsConfigurationException on configuration error\r\n */\r\n OutConnection getOutbound(MessageProperties msgProps, XmlOptions xmlOptions) throws IOException, \r\n WsConfigurationException;\r\n \r\n /**\r\n * Get a receive-only connection for this channel. This method must be called for each message to be received, and\r\n * will wait for a message to be available before returning.\r\n * \r\n * @return connection\r\n * @throws IOException on I/O error\r\n * @throws WsConfigurationException on configuration error\r\n */\r\n InConnection getInbound() throws IOException, WsConfigurationException;\r\n \r\n /**\r\n * Close the channel. Implementations should disconnect and free any resources allocated to the channel.\r\n * @throws IOException on I/O error\r\n */\r\n void close() throws IOException;\r\n}", "public int getChannel() {\r\n\t\treturn channel;\r\n\t}", "public Byte getChannel() {\n return channel;\n }", "public SocketChannel getChannel() { return null; }", "public ChannelFuture getChannelFuture() {\n return channelFuture;\n }", "public interface ChannelsService {\n\n /**\n * Gets the Facebook data-ref to create send to messenger button.\n *\n * @param callback Callback with the result.\n */\n void createFbOptInState(@Nullable Callback<ComapiResult<String>> callback);\n }", "private static ManagedChannel getManagedChannel(int port) {\n return ManagedChannelBuilder.forAddress(\"localhost\", port)\n .usePlaintext(true)\n .build();\n }", "protected SocketChannel getSocket() {\n\t\treturn channel;\n\t}", "public interface MessagingService {\n\n /**\n * Checks whether message receivers are registered for this channel.\n * \n * @param ccid the channel id\n * @return <code>true</code> if there are message receivers on this channel,\n * <code>false</code> if not.\n */\n boolean hasMessageReceiver(String ccid);\n\n /**\n * Passes the message to the registered message receiver.\n * \n * @param ccid the channel to pass the message on\n * @param serializedMessage the message to send (serialized SMRF message)\n */\n void passMessageToReceiver(String ccid, byte[] serializedMessage);\n\n /**\n * Check whether the messaging component is responsible to send messages on\n * this channel.<br>\n * \n * In scenarios with only one messaging component, this will always return\n * <code>true</code>. In scenarios in which channels are assigned to several\n * messaging components, only the component that the channel was assigned\n * to, returns <code>true</code>.\n * \n * @param ccid\n * the channel ID or cluster controller ID, respectively.\n * @return <code>true</code> if the messaging component is responsible for\n * forwarding messages on this channel, <code>false</code>\n * otherwise.\n */\n boolean isAssignedForChannel(String ccid);\n\n /**\n * Check whether the messaging component was responsible before but the\n * channel has been assigned to a new messaging component in the mean time.\n * \n * @param ccid the channel id\n * @return <code>true</code> if the messaging component was responsible\n * before but isn't any more, <code>false</code> if it either never\n * was responsible or still is responsible.\n */\n boolean hasChannelAssignmentMoved(String ccid);\n}", "org.apache.drill.exec.proto.UserBitShared.RpcChannel getChannel();", "public java.lang.String getChannel() {\n java.lang.Object ref = channel_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n channel_ = s;\n return s;\n }\n }", "public final int getChannel() {\n return device.getChannel();\n }", "public String getChannelName()\r\n\t{\r\n\t\treturn this.sChannelName;\r\n\t}", "public ChannelLogger getChannelLogger() {\n return this.channelLogger;\n }", "public java.lang.String getChannel() {\n java.lang.Object ref = channel_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n channel_ = s;\n }\n return s;\n }\n }", "public java.lang.String getChannel() {\n java.lang.Object ref = channel_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n channel_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public NotificationsChannel getChannel(String channelId) throws Exception;", "java.lang.String getChannelName();", "public java.lang.String getChannel() {\n java.lang.Object ref = channel_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n channel_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public TextChannel getSupportChannel() { return supportChannel; }", "public ChannelLocator getChannelLocator();", "com.google.protobuf.ByteString\n getChannelBytes();", "private SmartCardChannel getChannel() throws UsbDeviceException, NotAvailableUSBDeviceException{\n\t\tif(this.channel != null){\n\t\t\treturn this.channel;\n\t\t}\n\t\tif(getUsbInterface() != null){\n\t\t\tif (!getUsbDeviceConnection().claimInterface(getUsbInterface(), true)) {\n\t\t\t\tthrow new NotAvailableUSBDeviceException(\"Imposible acceder al interfaz del dispositivo USB\"); //$NON-NLS-1$\n\t\t\t}\n\t\t\tthis.channel = new SmartCardChannel(getUsbDeviceConnection(), getUsbInterface());\n\t\t\treturn this.channel;\n\t\t}\n\t\tthrow new UsbDeviceException(\"usbInterface cannot be NULL\"); //$NON-NLS-1$\n\t}", "public String getChannel() {\n if(this.isRFC2812())\n return this.getNumericArg(1);\n else\n return this.getNumericArg(0);\n }", "@PreAuthorize(\"hasRole('superman')\")\n\tpublic abstract Channel getChannel(String name);", "public interface Channels {\n \n public void createChannel();\n\n}", "public int getChannelId( ) {\r\n return channelId;\r\n }", "public String getChannelId()\n {\n return channelId;\n }", "public Channel method_4090() {\n return null;\n }", "public com.google.protobuf.ByteString\n getChannelBytes() {\n java.lang.Object ref = channel_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n channel_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getChannelBytes() {\n java.lang.Object ref = channel_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n channel_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n\tpublic int getChannel() {\n\t\treturn super.getDeviceID();\n\t}", "public interface ChannelServiceI {\r\n Channel createChannel(Channel channel);\r\n\r\n int updateChannelUser(int id);\r\n\r\n int minusChannelUser(int id);\r\n\r\n List<Channel> getChannelPage(Channel channel);\r\n\r\n int count();\r\n\r\n Channel getChannel(String channelToken);\r\n\r\n List<Channel> getUserChannel(Channel channel);\r\n\r\n int deleteUser(Integer id);\r\n\r\n List<Channel> getUserChannelTotal(Channel channel);\r\n\r\n int updateChannel(Channel channel);\r\n}", "protected Channel connect() {\n\t\t\tif (channel == null) {\n\t\t\t\tinit();\n\t\t\t}\n\t\t\tSystem.out.println(\"channel === \"+channel);\n\t\t\tif (channel.isDone() && channel.isSuccess())\n\t\t\t\treturn channel.channel();\n\t\t\telse\n\t\t\t\tthrow new RuntimeException(\"Not able to establish connection to server\");\n\t\t}", "public abstract ManagedChannelBuilder<?> delegate();", "public io.grpc.channelz.v1.Channel getChannel(int index) {\n if (channelBuilder_ == null) {\n return channel_.get(index);\n } else {\n return channelBuilder_.getMessage(index);\n }\n }", "public com.google.protobuf.ByteString\n getChannelBytes() {\n java.lang.Object ref = channel_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n channel_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "java.lang.String getChannelToken();", "java.lang.String getChannelToken();", "public String getChannelId()\r\n\t{\r\n\t\treturn this.sChannelId;\r\n\t}", "String getServerConnectionChannelName();", "public com.google.protobuf.ByteString\n getChannelBytes() {\n java.lang.Object ref = channel_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n channel_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Bean\n\tpublic DirectChannel requestChooserOutputChannel() {\n\t\treturn MessageChannels.direct().get();\n\t}", "public ManagedChannelBuilder<?> delegate() {\n return this.delegateBuilder;\n }", "@Override\n public ScheduledExecutorService getSchedExecService() {\n return channelExecutor;\n }", "@objid (\"1bb2731c-131f-497d-9749-1f4f1e705acb\")\n Link getChannel();", "private ManagedChannel emulatedPubSubChannel() {\n if (!useEmulator) {\n throw new RuntimeException(\"You shouldn't be calling this when using the real \"\n + \"(non-emulator) implementation\");\n }\n String hostport = System.getenv(\"PUBSUB_EMULATOR_HOST\");\n return ManagedChannelBuilder.forTarget(hostport).usePlaintext().build();\n }", "public String getChannelId() {\n return channelId;\n }", "public Channel method_4112() {\n return null;\n }", "public Channel method_4121() {\n return null;\n }", "public SodiumChannel getSodiumChannel() {\n\t\t\treturn sodiumChannel;\n\t\t}", "public interface ChannelManager {\n int createChannel(String channel, long ttlInSeconds);\n int publishToChannel(String channel, String msg);\n}", "public interface ChannelConnection {\n public Channel getChannel();\n public Connector getConnector();\n}", "public io.grpc.channelz.v1.Channel getChannel(int index) {\n return channel_.get(index);\n }", "public ChannelType getChannelType() {\n return type;\n }", "@Override\n\tprotected void channelRead0(ChannelHandlerContext ctx, WsClientMessage msg) throws Exception {\n\t}", "public interface ChatPlayerService extends PlayerService, Chatter\n{\n /**\n * Sets the player's ChatTarget focus.\n * \n * @param focus The new ChatTarget to focus\n */\n void setFocus( ChatTarget focus );\n \n /**\n * Gets the player's current focus.\n * \n * @return The channel the player has focused\n */\n ChatTarget getFocus();\n \n /**\n * Gets the player's BaseComponent name.\n * \n * @return The player's BaseComponent name.\n */\n BaseComponent getComponentName();\n \n /**\n * Gets the ChatManagerImpl.\n * \n * @return The ChatManagerImpl instance\n */\n ChatManager getChatManager();\n \n /**\n * Gets the PrivateMessageTarget from the last inbound PM.\n * \n * @return The PrivateMessageTarget from the last PM received\n */\n PrivateMessageTarget getLastInboundWhisperTarget();\n \n /**\n * Sets the most recent inbound PM's PrivateMessageTarget.\n * \n * @param lastInboundWhisperTarget The new target.\n * @return This ChatPlayerService object.\n */\n ChatPlayerService setLastInboundWhisperTarget( PrivateMessageTarget lastInboundWhisperTarget );\n \n /**\n * Gets a formatted message to show all of the channels the\n * player is currently in.\n * \n * @return A formatted message showing the channels the player is in.\n */\n BaseComponent[] getChannelsJoinedMessage();\n}", "public String getSubChannel() {\r\n\t\treturn this.subChannel;\r\n\t}", "public String getChannelId() {\n\t\treturn channelId;\n\t}", "public ReadableByteChannel getByteChannel() throws IOException {\n InputStream source = getInputStream();\n \n if(source != null) {\n return Channels.newChannel(source);\n }\n return null;\n }", "public DmaChannel getChannelAt(int i);", "public interface MessageInputChannel extends\r\n Channel<MessageInput, MessageInputChannelAPI>, OneDimensional, MessageCallback {\r\n\r\n}", "public int getChannelType( ) {\r\n return 1;\r\n }", "public interface IRemoteMessageService {\n\n void unsubscribeToMessage(UnSubscribeToMessage cmd);\n\n /**\n * Sets a message element to a specified value\n */\n void setElementValue(SetElementValue cmd);\n\n void zeroizeElement(ZeroizeElement cmd);\n\n /**\n * Notifies service to send message updates to the specified ip address\n */\n SubscriptionDetails subscribeToMessage(SubscribeToMessage cmd);\n\n Set<? extends DataType> getAvailablePhysicalTypes();\n\n boolean startRecording(RecordCommand cmd);\n\n InetSocketAddress getRecorderSocketAddress();\n\n InetSocketAddress getMsgUpdateSocketAddress();\n\n void stopRecording();\n\n void terminateService();\n\n void reset();\n\n void setupRecorder(IMessageEntryFactory factory);\n\n public Map<String, Throwable> getCancelledSubscriptions();\n}", "@Test\n\tpublic void testChannel() {\n\t\tString requestXml =\n\t\t\t\t\"<FahrenheitToCelsius xmlns=\\\"http://www.w3schools.com/webservices/\\\">\" +\n\t\t\t\t\" <Fahrenheit>55</Fahrenheit>\" +\n\t\t\t\t\"</FahrenheitToCelsius>\";\n\n\t\t// Create the Message object\n\t\tMessage<String> message = MessageBuilder.withPayload(requestXml).build();\n\n\t\t// Send the Message to the handler's input channel\n\t\t//MessageChannel channel = channelResolver.resolveChannelName(\"fahrenheitChannel\");\n\t\tchannel.send(message);\n\t}", "public Message getMessageWizardChannel() {\n\t\tMessage temp = null;\n\t\t\n\t\ttry {\n\t\t\t//se ia mesajul din buffer\n\t\t\ttemp = bufferWizardChannel.take();\t\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn temp;\n\t\t\n\t}", "public MessageChannel getGameChannel() {\r\n\t\treturn gameChannel;\r\n\t}", "public Message getMessageWizardChannel() {\n\t\tMessage msg1=null;\n\t\ttry{\n\t\t\tmsg1=chann1.take();\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn msg1;\n\t}", "void start(Channel channel, Object msg);", "@Override\n\tpublic String getChannelId()\n\t{\n\t\treturn null;\n\t}", "public String getChannelCode() {\n return channelCode;\n }", "byte[] getChannelCommand() throws IOException {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n baos.write(rgbCommand(r, g, b));\n baos.write(wwcwCommand(ww, cw));\n return baos.toByteArray();\n }", "java.lang.String getChannelId();", "protected Channel createChannel() throws IOException, TimeoutException, NoSuchAlgorithmException {\n LOGGER.debug(\"Creating channel\");\n Channel channel = connectionProducer.getConnection(config).createChannel();\n LOGGER.debug(\"Created channel\");\n return channel;\n }", "public org.apache.axis.types.UnsignedInt getChannel() {\n return channel;\n }", "public interface SendService {\n\n public void sendMessage(RemotingCommand remotingCommand, long timeout);\n}" ]
[ "0.7437254", "0.73157257", "0.7183302", "0.7135984", "0.7129005", "0.71285546", "0.7090409", "0.7070889", "0.7067624", "0.7038997", "0.6988283", "0.6917885", "0.68884337", "0.67946744", "0.67914945", "0.67852235", "0.677885", "0.674656", "0.67354923", "0.6681876", "0.66714543", "0.6667951", "0.6658963", "0.6658963", "0.6637923", "0.65924364", "0.6589948", "0.65803987", "0.65801334", "0.656291", "0.6394705", "0.6370899", "0.6364142", "0.6360486", "0.63541204", "0.63400555", "0.6295168", "0.62838054", "0.6278035", "0.6249136", "0.62438136", "0.62114525", "0.6202571", "0.6174055", "0.6163322", "0.61605746", "0.6151532", "0.614542", "0.6134949", "0.61321455", "0.60943747", "0.6087775", "0.60815173", "0.60634476", "0.6059933", "0.60573", "0.6053354", "0.6047734", "0.60389555", "0.6030655", "0.6022905", "0.60092485", "0.6005142", "0.6005142", "0.60051006", "0.60014427", "0.6001328", "0.5996678", "0.59943444", "0.59914345", "0.59837997", "0.5970838", "0.59568334", "0.5928881", "0.5895364", "0.58861846", "0.58624125", "0.5857131", "0.58528924", "0.581504", "0.581163", "0.58108175", "0.58004445", "0.57914156", "0.57894915", "0.578917", "0.5776858", "0.57738584", "0.576785", "0.57609695", "0.5759547", "0.5758005", "0.57573795", "0.5743325", "0.5738268", "0.5733163", "0.57316715", "0.5726644", "0.5715349", "0.57023185", "0.5701523" ]
0.0
-1
REMOTE UPADTE AND LOCAL UPDATE
public Monitor updateMonitor(Monitor monitor) { try { Monitor updatedContact = api.updateMonitor(monitor); repo.save(updatedContact); return repo.save(updatedContact); } catch (IOException e) { e.printStackTrace(); } return repo.save(monitor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean updateBase(TRemoteHostOperateVo source, TRemoteHostOperateVo target);", "boolean requestRemoteUpdate(ITemplateKey key, PacketDistributor.PacketTarget target);", "boolean requestRemoteUpdate(ITemplateKey key);", "public boolean update() {\n\t\ttry {\n\t\t\tbyte[] buffer = \"UPDATE\".getBytes();\n\t\t\toos.writeObject(buffer);\n\t\t\tbuffer = (deviceId + \" \" + user).getBytes();\n\t\t\toos.writeObject(buffer);\n\t\t\tbuffer = (byte[]) ois.readObject();\n\t\t\tString reply = (new String(buffer));\n\t\t\tif (reply.equals(\"NULL\"))\n\t\t\t\treturn true;\n\t\t\t// System.out.println(\"REPLY IS : \" + reply);\n\t\t\tString[] namespaces = reply.split(\"\\n\");\n\t\t\tLong[] rowids = dh.getRowIds(namespaces);\n\t\t\tint l = rowids.length;\n\t\t\tString ids;\n\t\t\tif (l == 1)\n\t\t\t\tids = Long.toString(rowids[0]);\n\t\t\telse {\n\t\t\t\tids = Long.toString(rowids[0]);\n\t\t\t\tint i;\n\t\t\t\tfor (i = 1; i < l; i++) {\n\t\t\t\t\tids = ids + \"\\n\" + Long.toString(rowids[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// System.out.println(\"IDs : \" + ids);\n\t\t\tbuffer = ids.getBytes();\n\t\t\toos.writeObject(buffer);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean doUpdate(SysUser b) throws Exception {\n\t\treturn false;\n\t}", "public void executeUpdate();", "public void receivedUpdateFromServer();", "void executeUpdate();", "Long getUserUpdated();", "@Override\r\n\tpublic boolean update(Moteur obj) {\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic int update(SpUser t) {\n\t\treturn 0;\r\n\t}", "U getUpdateby();", "private void updIVTRN()\n\t{ \n\t\ttry{\n\t\t\tM_strSQLQRY = \"Update mr_ivtrn set\";\n\t\t\tM_strSQLQRY += \" IVT_LADQT = 0,\";\n\t\t\tM_strSQLQRY += \" IVT_LODDT = null,\";\n\t\t\tM_strSQLQRY += \" IVT_INVQT = 0,\";\n\t\t\tM_strSQLQRY += \" IVT_INVPK = 0,\";\n\t\t\tM_strSQLQRY += \" IVT_STSFL = 'A',\";\n\t\t\tM_strSQLQRY += \" IVT_LUSBY = '\"+cl_dat.M_strUSRCD_pbst+\"',\";\n\t\t\tM_strSQLQRY += \" IVT_LUPDT = '\"+M_fmtDBDAT.format(M_fmtLCDAT.parse(cl_dat.M_strLOGDT_pbst))+\"'\";\n\t\t\tM_strSQLQRY += \" where IVT_CMPCD = '\"+cl_dat.M_strCMPCD_pbst+\"' and IVT_MKTTP = '\"+txtTRNTP.getText() .toString() .trim()+\"'\";\n\t\t\tM_strSQLQRY += \" and IVT_LADNO = '\"+txtISSNO.getText().toString().trim() +\"'\";\n\t\t\t\n\t\t\tcl_dat.exeSQLUPD(M_strSQLQRY,\"setLCLUPD\");\n\t\t\t//System.out.println(\"update Ivtrn table :\"+M_strSQLQRY);\n\t\t\t\n\t\t}catch(Exception L_EX){\n\t\t\tsetMSG(L_EX,\"updIVTRN\");\n\t\t}\n\t}", "boolean update();", "Motivo update(Motivo update);", "boolean adminUpdate(int userId, int statusId, int reimbId);", "Update createUpdate();", "public void willbeUpdated() {\n\t\t\n\t}", "protected void checkUpdate() {\n \t\t// only update from remote server every so often.\n \t\tif ( ( System.currentTimeMillis() - lastUpdated ) > refreshInterval ) return;\n \t\t\n \t\tClusterTask task = getSessionUpdateTask();\n \t\tObject o = CacheFactory.doSynchronousClusterTask( task, this.nodeId );\n \t\tthis.copy( (Session) o );\n \t\t\n \t\tlastUpdated = System.currentTimeMillis();\n \t}", "@TargetMetric\n @Override\n public RespResult<SqlExecRespDto> executeUpdate(String username, SqlExecReqDto update) {\n return null;\n }", "private void updPrevRunningConfigUpdates() {\n\t\tList<FilterCondition> cond = new ArrayList<>();\n\t\tList<ConfiguredValuesMO> prevConfigList = null;\n\t\tConfiguredValuesMO prevConfig = null;\n\t\tsetFilterConditions(cond); \n\t\ttry {\n\t\t\tprevConfigList = (List<ConfiguredValuesMO>) genDao.getGenericObjects(ConfiguredValuesMO.class, cond, Boolean.TRUE);\n\t\t} catch (DAOException e) {\n\t\t\tlogger.error(\"Exception while retrieving Config updates for the device.\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\tprevConfig = prevConfigList.get(0); // Ideally this should give only one item.\n\t\tprevConfig.setStatus(ConfigUpdateStatus.INACTIVE);\n\t\ttry {\n\t\t\tgenDao.saveGenericObject(prevConfig);\n\t\t} catch (DAOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "long getUpdated();", "@Override\n public boolean update(Revue objet) {\n return false;\n }", "@Override\r\n\tpublic boolean doUpdate(Action vo) throws SQLException {\n\t\treturn false;\r\n\t}", "public void update(){}", "public void update(){}", "public void update(){\n \t//NOOP\n }", "public boolean update(Panier nouveau) {\n\t\treturn false;\r\n\t}", "Account.Update update();", "@DISPID(12)\n\t// = 0xc. The runtime will prefer the VTID if present\n\t@VTID(21)\n\tboolean updated();", "@Override\r\n\tpublic int update(PtHrUserBak t) {\n\t\treturn 0;\r\n\t}", "public void update() throws VcsException;", "public void update() {}", "public boolean updateData( Result r)\n {\n //some result checking...\n //set last update time\n time = NTPDate.currentTimeMillis();\n int prevState = nState;\n //get state as int\n nState = (int)r.param[r.getIndex(\"State\")];\n return (prevState!=nState);\n }", "@Override\n\tpublic boolean doUpdate(Orders vo) throws Exception\n\t{\n\t\treturn false; \n\t}", "@Override\n\tpublic boolean update(Etape obj) {\n\t\treturn false;\n\t}", "@Override\n\tpublic void update(Unidade obj) {\n\n\t}", "@Override\n\tprotected void doUpdate(Session session) {\n\n\t}", "@Override\n\tpublic PI update(PIDTO updated) throws NotFoundException {\n\t\treturn null;\n\t}", "protected abstract boolean supportsForUpdate();", "@Override\n public RespResult<List<SqlExecRespDto>> batchExecuteUpdate(String username, List<SqlExecReqDto> updates) {\n return null;\n }", "Update withAutoSync(Boolean autoSync);", "@Override\r\n\tpublic void update(Responsible p) {\n\t\t\r\n\t}", "@Override\n\tpublic boolean update(String sql) {\n\t\treturn false;\n\t}", "@Test\r\n\tpublic void testUpdate() {\r\n\t\tList<E> entities = dao.findAll();\r\n\t\tE updated = supplyUpdated(entities.get(0));\r\n\t\tdao.update(entities.get(0));\r\n\t\tentities = dao.findAll();\r\n\t\tassertEquals(updated, entities.get(0));\r\n\t}", "@Override\n\tpublic int update(Utente input) throws Exception {\n\t\treturn 0;\n\t}", "void setUserUpdated(final Long userUpdated);", "public void testCmdUpdate() {\n\t\ttestCmdUpdate_taskID_field();\n\t\ttestCmdUpdate_taskName_field();\n\t\ttestCmdUpdate_time_field();\n\t\ttestCmdUpdate_priority_field();\n\t}", "int updateByPrimaryKeySelective(EtpBase record);", "boolean needUpdate();", "int updateByPrimaryKeySelective(CTelnetServers record);", "int updateByPrimaryKeySelective(Online record);", "public void requestUpdate(){\n shouldUpdate = true;\n }", "int updateBase(@Param(value = \"source\") TAdminUserVo source, @Param(value = \"target\") TAdminUserVo target);", "@Override\r\n\tpublic void update(FollowUp followup) {\n\t\t\r\n\t}", "int updateByPrimaryKeySelective(UcOrderGuestInfo record);", "Snapshot.Update update();", "@Test\n public void updateViajeroTest() {\n ViajeroEntity entity = data.get(0);\n PodamFactory factory = new PodamFactoryImpl();\n ViajeroEntity newEntity = factory.manufacturePojo(ViajeroEntity.class);\n\n newEntity.setId(entity.getId());\n\n vp.update(newEntity);\n\n ViajeroEntity resp = em.find(ViajeroEntity.class, entity.getId());\n\n Assert.assertEquals(newEntity.getId(), resp.getId());\n }", "@Test\n public void updateTest5() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setWifi(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isWifi() ,\"Should return true if update Servizio\");\n }", "public abstract int execUpdate(String query) ;", "@Override\n\tpublic void queryUpdate() {\n\t\tneedToUpdate = true;\n\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\tpublic void update() {}", "@Override\n\tpublic void update() {}", "@Override\n\t\tpublic boolean update(AccountTransaction t) {\n\t\t\treturn false;\n\t\t}", "@Override\r\n\tpublic void uniqueUpdate() {\n\r\n\t}", "public boolean update(Etudiant obj) {\n\t\treturn false;\n\t}", "private void updateFromProvider() {\n if(isUpdating.get()){\n isHaveUpdateRequest.set(true);\n return;\n }\n mUpdateExecutorService.execute(new UpdateThread());\n }", "public void singleUpdate() {\n\t\ttry {\n\t\t\tthis.updateBy = CacheUtils.getUser().username;\n\t\t} catch (Exception e) {\n\t\t\tif (! getClass().equals(GlobalCurrencyRate.class)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.updateBy = \"super\";\n\t\t}\n\t\tthis.workspace = CacheUtils.getWorkspaceId();\n\t\tthis.updateAt = new Date();\n\n\t\tif (insertBy == null) insertBy = updateBy;\n\t\tif (insertAt == null) insertAt = updateAt;\n\n\t\tsuper.update();\n\t\tCacheUtils.cleanAll(this.getClass(), getAuditRight());\n\t}", "int updateByPrimaryKeySelective(TempletLink record);", "private void processV1AuthoritativeUpdate(SystemMetadata mnSystemMetadata, SystemMetadata cnSystemMetadata)\n throws RetryableException, SynchronizationFailed, UnrecoverableException {\n\n logger.debug(task.taskLabel() + \" entering processV1AuthoritativeUpdate...\");\n try {\n // this is an update from the authoritative memberNode\n // so look for fields with valid changes\n boolean foundValidMNChange = false;\n\n // obsoletedBy can be updated to a value only if its value hasn't\n // already been set. Once set, it cannot change.\n if ((cnSystemMetadata.getObsoletedBy() == null)\n && (mnSystemMetadata.getObsoletedBy() != null)) {\n logger.debug(task.taskLabel() + \" Updating ObsoletedBy...\");\n\n nodeCommunications.getCnCore().setObsoletedBy(session, TypeFactory.buildIdentifier(task.getPid()),\n mnSystemMetadata.getObsoletedBy(),\n cnSystemMetadata.getSerialVersion().longValue());\n // auditReplicaSystemMetadata(pid);\n // serial version will be updated at this point, so get the new version\n logger.debug(task.taskLabel() + \" Updated ObsoletedBy\");\n foundValidMNChange = true;\n }\n\n // (getArchived() returns a boolean)\n // only process the update if the new sysmeta set it to true and the \n // existing value is null or false. Cannot change the value from true\n // to false.\n if (((mnSystemMetadata.getArchived() != null) && mnSystemMetadata.getArchived())\n && ((cnSystemMetadata.getArchived() == null) || !cnSystemMetadata.getArchived())) {\n logger.debug(task.taskLabel() + \" Updating Archived...\");\n nodeCommunications.getCnCore().archive(session, TypeFactory.buildIdentifier(task.getPid()));\n // auditReplicaSystemMetadata(pid);\n // serial version will be updated at this point, so get the new version\n logger.debug(task.taskLabel() + \" Updated Archived\");\n foundValidMNChange = true;\n }\n\n if (foundValidMNChange) {\n notifyReplicaNodes(TypeFactory.buildIdentifier(task.getPid()), true); // true notifies the authMN, too\n } else {\n // TODO: refactor to assume less about how we got here and whether or not to throw an exception\n // \n // a simple reharvest may lead to getting to this point, so check\n // the sysmeta modified date before throwing an exception\n if (mnSystemMetadata.getDateSysMetadataModified().after(\n cnSystemMetadata.getDateSysMetadataModified())) {\n // something has changed, and we should probably investigate,\n // but for now just assume that an out-of-bounds change was attempted.\n InvalidRequest invalidRequest = new InvalidRequest(\n \"567123\",\n \"Synchronization unable to process the update request. Only archived and obsoletedBy may be updated\");\n logger.error(buildStandardLogMessage(invalidRequest, \"Ignoring update from MN. Only archived and obsoletedBy may be updated\"));\n throw SyncFailedTask.createSynchronizationFailed(task.getPid(), null, invalidRequest);\n }\n }\n } \n catch (ServiceFailure e) {\n V2TransferObjectTask.extractRetryableException(e);\n throw new UnrecoverableException(\"Failed to update cn with new SystemMetadata.\", e);\n } \n catch (InvalidRequest e) {\n throw SyncFailedTask.createSynchronizationFailed(task.getPid(),\n \"From processV1AuthoritativeUpdate: Could not update cn with new valid SystemMetadata!\", e);\n }\n catch (VersionMismatch e) {\n if (task.getAttempt() == 1) {\n try {\n notifyReplicaNode(cnSystemMetadata, TypeFactory.buildNodeReference(task.getNodeId()));\n } catch (InvalidToken | NotAuthorized | NotImplemented\n | ServiceFailure | NotFound | InvalidRequest e1) {\n throw new UnrecoverableException(\"Could not notify the source MN to update their SystemMetadata in response to \" +\n \"encountering a VersionMismatch during V1-style system metadata update\", e1);\n }\n }\n throw new RetryableException(\"Cannot update systemMetadata due to VersionMismatch\", e, 5000L);\n }\n \n catch ( NotFound | NotImplemented | NotAuthorized | InvalidToken e) {\n throw new UnrecoverableException(\"Unexpected failure when trying to update v1-permitted fields (archived, obsoletedBy).\", e);\n\n }\n }", "public void checkForUpdate();", "public void attemptToUpdate();", "@Override\r\n\tpublic boolean updateStu_result(Object stu_result) {\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic int update() throws Exception {\n\t\treturn 0;\r\n\t}", "interface Update {}", "protected abstract void update();", "protected abstract void update();", "@Override\n\tpublic Owner update(Owner owner) {\n\t\treturn null;\n\t}", "boolean hasUpdate();", "boolean hasUpdate();", "@Override\r\n\tpublic int do_update(DTO dto) {\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic int update() {\n\t\treturn 0;\n\t}", "Software update( Software s );", "public void update() {\n\t\t\n\t}", "org.zenoss.cloud.dataRegistry.UpdateMode getUpdateMode();", "@Test\n public void updateTest13() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setWifi(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true , servizio.isWifi() ,\"Should return true if update Servizio\");\n }", "private void updPRMST()\n\t{ \n\t\ttry\n\t\t{\n\t\t\tM_strSQLQRY = \"Update CO_PRMST set \";\n\t\t\tM_strSQLQRY += \"PR_CSTQT = PR_CSTQT + \"+strISSQT+\",\";\n\t\t\tM_strSQLQRY += \"PR_TRNFL = '0',\";\n\t\t\tM_strSQLQRY += \"PR_LUSBY = '\"+cl_dat.M_strUSRCD_pbst+\"',\";\n\t\t\tM_strSQLQRY += \"PR_LUPDT = '\"+M_fmtDBDAT.format(M_fmtLCDAT.parse(cl_dat.M_strLOGDT_pbst))+\"'\";\n\t\t\tM_strSQLQRY += \" where pr_prdcd = '\"+strPRDCD+\"'\";\n\t\t\t\n\t\t\tcl_dat.exeSQLUPD(M_strSQLQRY,\"setLCLUPD\");\n\t\t\t//System.out.println(\"update COprmt table :\"+M_strSQLQRY);\n\t\t}catch(Exception L_EX)\n\t\t{\n\t\t\tsetMSG(L_EX,\"updPRMST\");\n\t\t}\n\t}", "@Override\n\t\tprotected void postUpdate(EspStatusDTO t) throws SQLException {\n\t\t\t\n\t\t}", "@Override\n\tpublic boolean update() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean update() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean update() {\n\t\treturn false;\n\t}", "@Test\n public void updateTest3() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setRistorante(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isRistorante() ,\"Should return true if update Servizio\");\n }", "@Override\n\tpublic User update(User u) {\n\t\tSystem.out.println(\"OracleDao is update\");\n\t\treturn null;\n\t}", "@Override\r\n\tpublic Ngo update(Ngo obj) {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic void update(Connection con, Object obj) throws Exception {\n\t}", "@Test\n public void updateTest6() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setBeach_volley(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isBeach_volley() ,\"Should return true if update Servizio\");\n }", "@Override\n public void syncUserData() {\n\n List<User> users = userRepository.getUserList();\n List<LdapUser> ldapUsers = getAllUsers();\n Set<Integer> listUserIdRemoveAM = new HashSet<>();\n\n //check update or delete \n for (User user : users) {\n boolean isDeleted = true;\n for (LdapUser ldapUser : ldapUsers) {\n if (user.getUserID().equals(ldapUser.getUserID())) {\n // is updateours\n user.setFirstName(ldapUser.getFirstName());\n user.setLastName(ldapUser.getLastName());\n user.setUpdatedAt(Utils.getCurrentTime());\n user.setEmail(ldapUser.getMail().trim());\n user.setJobTitle(ldapUser.getTitle() == null ? DEFAULT_JOB_TITLE : ldapUser.getTitle());\n user.setPhoneNumber(ldapUser.getTelephonNumber());\n user.setOfficeLocation(ldapUser.getOfficeLocation());\n \n String managerId = ldapUser.getManagerUser();\n User manager = getUserFromListByUserID(users, managerId);\n user.setManagerId(manager == null ? 0 : manager.getId());\n \n //This code will be lock till deploy the real LDAP have 2 properties are \"department\" and \"userAccountControl\"\n /*user.setActive(ldapUser.getUserAccountControl() == 514 ? (byte) 0 : (byte) 1);*/\n Department department = departmentRepository.getDepartmentByName(ldapUser.getDepartment());\n checkChangeDepartment(user, department, listUserIdRemoveAM);\n \n userRepository.editUser(user);\n \n isDeleted = false;\n break;\n }\n }\n if (isDeleted) {\n user.setIsDeleted((byte) 1);\n user.setActive((byte) 0);\n userRepository.editUser(user);\n }\n }\n\n //check new user\n for (LdapUser ldapUser : ldapUsers) {\n boolean isNew = true;\n for(User user : users){\n if(ldapUser.getUserID().equals(user.getUserID())){\n isNew = false;\n break;\n }\n }\n if(isNew){\n logger.debug(\"Is new User userID = \"+ldapUser.getUserID());\n User user = new User();\n user.setUserID(ldapUser.getUserID());\n user.setStaffCode(ldapUser.getUserID());\n user.setFirstName(ldapUser.getFirstName());\n user.setLastName(ldapUser.getLastName());\n user.setCreatedAt(Utils.getCurrentTime());\n user.setUpdatedAt(Utils.getCurrentTime());\n user.setEmail(ldapUser.getMail().trim());\n user.setJobTitle(ldapUser.getTitle() == null ? DEFAULT_JOB_TITLE : ldapUser.getTitle());\n user.setPhoneNumber(ldapUser.getTelephonNumber());\n user.setActive((byte) 1);\n user.setIsDeleted((byte) 0);\n user.setOfficeLocation(ldapUser.getOfficeLocation());\n user.setRoleId(4);\n user.setApprovalManagerId(0);;\n \n String managerId = ldapUser.getManagerUser();\n User manager = getUserFromListByUserID(users, managerId);\n user.setManagerId(manager == null ? 0 : manager.getId());\n\n //This code will be lock till deploy the real LDAP have 2 properties are \"department\" and \"userAccountControl\"\n Department department = departmentRepository.getDepartmentByName(ldapUser.getDepartment());\n user.setDepartmentId(department == null ? 0 : department.getId());\n \n /*user.setActive(ldapUser.getUserAccountControl() == 514 ? (byte) 0 : (byte) 1);*/\n \n userRepository.addUser(user);\n logger.debug(\"Is new User id = \"+user.getId());\n }\n }\n \n //Remove AprovalManager out User\n for(Integer userId : listUserIdRemoveAM){\n if(userId == null) continue;\n User userRemoveAMId = userRepository.getUserById(userId);\n userRemoveAMId.setApprovalManagerId(0);\n userRepository.editUser(userRemoveAMId);\n }\n }", "@Override\r\n\tpublic String update() {\n\t\treturn null;\r\n\t}" ]
[ "0.61436844", "0.6012851", "0.6011923", "0.6004924", "0.5963125", "0.5922011", "0.59215987", "0.59142244", "0.5881977", "0.58695716", "0.5850547", "0.58414084", "0.58407694", "0.5792525", "0.57796276", "0.5762824", "0.5756938", "0.57413065", "0.5738862", "0.5731636", "0.57262355", "0.5672914", "0.56718844", "0.5655608", "0.5654074", "0.5654074", "0.56438893", "0.5624671", "0.5622872", "0.5612171", "0.559631", "0.55807006", "0.55797267", "0.55706745", "0.5565619", "0.55608803", "0.5559607", "0.55342716", "0.55300796", "0.55300325", "0.552843", "0.55257815", "0.55114913", "0.5509031", "0.55076814", "0.5494027", "0.5492306", "0.54917186", "0.5489937", "0.5484884", "0.5484147", "0.54816127", "0.5479731", "0.54795516", "0.5477054", "0.54758304", "0.5468051", "0.5465789", "0.5461045", "0.545737", "0.54472965", "0.5445907", "0.5445907", "0.5445907", "0.5435688", "0.5435688", "0.54344475", "0.5433652", "0.54328895", "0.5429691", "0.542308", "0.5422507", "0.5420744", "0.54200315", "0.54199535", "0.54187256", "0.5417979", "0.5411896", "0.54110694", "0.54110694", "0.53958756", "0.5394641", "0.5394641", "0.53928584", "0.53928435", "0.5392162", "0.53913385", "0.5389574", "0.53889847", "0.5385196", "0.5383317", "0.5381139", "0.5381139", "0.5381139", "0.53806525", "0.5376522", "0.5375273", "0.5374467", "0.53730136", "0.53717864", "0.53695184" ]
0.0
-1
POST AND LOCAL SAVE
public Monitor postMonitor(Monitor monitor) { try { Monitor createdContact = api.createMonitor(monitor); repo.save(createdContact); return repo.save(createdContact); } catch (IOException e) { e.printStackTrace(); } return repo.save(monitor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void savePost(Post post);", "public void save();", "public void save();", "public void save();", "public void save();", "protected abstract void doSave();", "Post save(Post post) throws Exception;", "void save();", "void save();", "void save();", "public void save() {\t\n\t\n\t\n\t}", "public void save() {\n }", "public void saveData(){\n SerializableManager.saveSerializable(this,user,\"userInfo.data\");\n SerializableManager.saveSerializable(this,todayCollectedID,\"todayCollectedCoinID.data\");\n SerializableManager.saveSerializable(this,CollectedCoins,\"collectedCoin.data\");\n uploadUserData uploadUserData = new uploadUserData(this);\n uploadUserData.execute(this.Uid);\n System.out.println(Uid);\n\n }", "private void saveData() {\n }", "Boolean save(PostSaveDTO postSaveDTO);", "public boolean save();", "public void saveData ( ) {\n\t\tinvokeSafe ( \"saveData\" );\n\t}", "T save(T t);", "public boolean save(Data model);", "private void performSave() {\n if (validate()) {\n int taskId = AppUtils.getLatestTaskId() + 1;\n int catId;\n if (category.equals(AppUtils.CREATE_CATEGORY)) {\n catId = saveNewCategory();\n } else {\n catId = AppUtils.getCategoryIdByName(category);\n }\n saveNewTask(taskId, catId);\n clearAll();\n redirectToViewTask();\n }\n\n }", "public final boolean save( ) throws Exception\n\t{\n\t\tboolean ret;\n\n\t\tif ( this.href == null )\n\t\t{\n\t\t\tfinal String location = Datastore.getInstance( ).postOnServer( this );\n\t\t\tthis.href = location;\n\t\t\tret = location != null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tret = Datastore.getInstance( ).updateOnServer( this );\n\t\t}\n\n\t\t/* fetch server-side values */\n\t\tload( );\n\n\t\treturn ret;\n\t}", "public void postData() {\n\n\t}", "@Override\n\tpublic void save() {\n\t\t\n\t}", "@Override\n\tpublic void save() {\n\t\t\n\t}", "@Override\r\n\tpublic void save() {\n\r\n\t\ts.save();\r\n\r\n\t}", "@Override\r\n\tpublic void save() {\n\r\n\t}", "@Override\r\n\tpublic void save() {\n\r\n\t}", "private void dataSubmission() {\n getPreferences(); // reload all the data\n\n String jsonObjectString = createJsonObject();\n StringBuilder url = new StringBuilder();\n url.append(serverUrl);\n\n if (vslaName == null || numberOfCycles == null || representativeName == null || representativePost == null\n || repPhoneNumber == null || grpBankAccount == null || physAddress == null\n || grpPhoneNumber == null || grpSupportType == null) {\n flashMessage(\"Please Fill all Fields\");\n\n } else if (IsEditing.equalsIgnoreCase(\"1\")) {\n url.append(\"editVsla\");\n new HttpAsyncTaskClass().execute(url.toString(), jsonObjectString);\n saveVslaInformation();\n\n } else { // Creating a new VSLA\n url.append(\"addNewVsla\");\n new HttpAsyncTaskClass().execute(url.toString(), jsonObjectString);\n saveVslaInformation();\n }\n }", "T save(T obj);", "void saveSaves(Object data, Context context);", "public void saveData(){\n reporter.info(\"Save edited form\");\n clickOnElement(LOCATORS.getBy(COMPONENT_NAME,\"SAVE_BUTTON\"));\n }", "@Override\n public void Save() {\n\t \n }", "@Override\n public void save() {\n\n }", "@Override\n public void save() {\n \n }", "protected boolean save() {\r\n\t\tboolean saved=true;\r\n\t\tif(validated()){\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tsaved=false;\r\n\t\t}\r\n\t\treturn saved;\r\n\t}", "@Override\n public void save()\n {\n \n }", "private String handleSave(WikiContext context, Query form) throws ChildContainerException, IOException {\n System.err.println(\"handleSave -- ENTERED\");\n String name = form.get(\"savepage\");\n String wikiText = form.get(\"savetext\");\n \n System.err.println(\"handleSave --got params\");\n if (name == null || wikiText == null) {\n context.raiseAccessDenied(\"Couldn't parse parameters from POST.\");\n }\n \n System.err.println(\"Writing: \" + name);\n context.getStorage().putPage(name, unescapeHTML(wikiText));\n System.err.println(\"Raising redirect!\");\n context.raiseRedirect(context.makeLink(\"/\" + name), \"Redirecting...\");\n System.err.println(\"SOMETHING WENT WRONG!\");\n return \"unreachable code\";\n }", "private String handleSave(WikiContext context, Query form) throws ChildContainerException, IOException {\n System.err.println(\"handleSave -- ENTERED\");\n String name = form.get(\"savepage\");\n String wikiText = form.get(\"savetext\");\n \n System.err.println(\"handleSave --got params\");\n if (name == null || wikiText == null) {\n context.raiseAccessDenied(\"Couldn't parse parameters from POST.\");\n }\n \n System.err.println(\"Writing: \" + name);\n context.getStorage().putPage(name, unescapeHTML(wikiText));\n System.err.println(\"Raising redirect!\");\n context.raiseRedirect(context.makeLink(\"/\" + name), \"Redirecting...\");\n System.err.println(\"SOMETHING WENT WRONG!\");\n return \"unreachable code\";\n }", "protected void saveValues() {\n dataModel.persist();\n }", "@Override\n protected void validateSave(Fornecedor post) {\n\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tString action = request.getParameter(\"action\");\r\n\t\t\r\n\t\tif(action.equals(\"Save\")){\r\n\t\t\tmodel.setAddress(request.getParameter(\"address\"));\r\n\t model.setPort( Integer.parseInt(request.getParameter(\"port\")));\r\n\t model.setAddressIp(request.getParameter(\"addressIp\"));\r\n\t save();\r\n\t\t}\r\n\t\trequest.setAttribute(\"model\", model);\r\n\t\trequest.getRequestDispatcher(\"param.jsp\").forward(request, response);\r\n\t}", "public void save() {\n DataBuffer.saveDataLocally();\n\n //TODO save to db must be done properly\n DataBuffer.save(session);\n\n //TODO recording saved confirmation\n }", "public void operationSave() {\n\r\n\t\tstatusFeldSave();\r\n\t}", "public JSONObject save();", "T save(T object);", "@Override\r\n\tpublic void save(HttpServletResponse paramHttpServletResponse) {\n\t\t\r\n\t}", "public void saveFormData() {\r\n if(!saveRequired) return;\r\n if(cvHierarchyData != null && cvHierarchyData.size()>0) {\r\n SponsorHierarchyBean sponsorHierarchyBean;\r\n for(int index=0; index<cvHierarchyData.size(); index++) {\r\n try {\r\n sponsorHierarchyBean = (SponsorHierarchyBean)cvHierarchyData.get(index);\r\n if(sponsorHierarchyBean.getAcType() != null) {\r\n if(sponsorHierarchyBean.getAcType() == TypeConstants.UPDATE_RECORD) {\r\n queryEngine.update(queryKey,sponsorHierarchyBean);\r\n }else if(sponsorHierarchyBean.getAcType() == TypeConstants.INSERT_RECORD) {\r\n queryEngine.insert(queryKey,sponsorHierarchyBean);\r\n }else if(sponsorHierarchyBean.getAcType() == TypeConstants.DELETE_RECORD) {\r\n queryEngine.delete(queryKey,sponsorHierarchyBean);\r\n }\r\n }\r\n }catch(CoeusException coeusException){\r\n coeusException.printStackTrace();\r\n }\r\n }\r\n }\r\n saveRequired = false;\r\n }", "public void saveData(){\r\n file.executeAction(modelStore);\r\n }", "public abstract String doSave() throws Exception;", "public final void saveAction(){\r\n\t\ttestReqmtService.saveAction(uiTestReqEditModel);\r\n\t\tgeteditDetails(uiTestReqEditModel.getObjId());\r\n\t\taddInfoMessage(SAVETR, \"save.TRsuccess\"); \r\n\t\tfor (UITestReqModel reqmnt : uiTestReqModel.getResultList()) {\r\n\t\t\tif(reqmnt.isTrLink()){\r\n\t\t\t\treqmnt.setTrLink(false);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected void save() {\n close();\n if(saveAction != null) {\n saveAction.accept(getObject());\n }\n }", "void save(Bill bill);", "public void save(){\n\t\tlowresModelManager.save();\n\t}", "@Override\n\tpublic void save(T obj) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic void save() {\n\t\tSystem.out.println(\"save method\");\n\t}", "public boolean save(New object);", "@Override\r\n\tpublic void innerSave() {\n\r\n\t}", "private void saveFunction() {\n }", "void save(JournalPage page);", "void save(Employee employee);", "HrDocumentRequest save(HrDocumentRequest hrDocumentRequest);", "public boolean doSave() {\n return true;\n }", "private void saveData() {\n // Actualiza la información\n client.setName(nameTextField.getText());\n client.setLastName(lastNameTextField.getText());\n client.setDni(dniTextField.getText());\n client.setAddress(addressTextField.getText());\n client.setTelephone(telephoneTextField.getText());\n\n // Guarda la información\n DBManager.getInstance().saveData(client);\n }", "public void saveWalk() {\n try {\n long id = this.currentRoute.getId();\n DatabaseHandler db = new DatabaseHandler(this.getApplicationContext());\n currentRoute.setWaypoints(db.getAllWaypoints(id));\n\n HTTPPostSender postSender = new HTTPPostSender();\n postSender.buildString(currentRoute, this.getContentResolver());\n postSender.cm = (ConnectivityManager) getSystemService(this.getApplicationContext().CONNECTIVITY_SERVICE);\n\n\n\n\n if(isOnline()) {\n postSender.execute(this.currentRoute);\n Toast.makeText(this.getApplicationContext(),\"Walk successfully sent to server\",Toast.LENGTH_LONG).show();\n\n } else {\n //oh god why..\n Toast.makeText(this.getApplicationContext(),\"Something bad happened\",Toast.LENGTH_LONG).show();\n }\n } catch(Exception e) {\n Toast.makeText(this.getApplicationContext(),e.getMessage(),Toast.LENGTH_LONG).show();\n }\n }", "@Override\n\tItem save(Item item);", "void save(Object entity);", "@Override\n\tpublic void save(Religiao obj) throws Exception {\n\t\t\n\t}", "void store( FormSubmit formResponse, Plugin plugin );", "private void save() {\n Toast.makeText(ContactActivity.this, getString(R.string.save_contact_toast), Toast.LENGTH_SHORT).show();\n\n String nameString = name.getText().toString();\n String titleString = title.getText().toString();\n String emailString = email.getText().toString();\n String phoneString = phone.getText().toString();\n String twitterString = twitter.getText().toString();\n \n if (c != null) {\n datasource.editContact(c, nameString, titleString, emailString, phoneString, twitterString);\n }\n else {\n \tc = datasource.createContact(nameString, titleString, emailString, phoneString, twitterString);\n }\n }", "void save(Student student);", "private void sendPost() {\n Map<String,Object> values = new HashMap<>();\n values.put(Constants.MANAGEMENT,management);\n values.put(Constants.GENERAL_INFORMATION,generalnformation);\n values.put(Constants.SYMPTOMS,symptoms);\n\n FireBaseUtils.mDatabaseDiseases.child(caseStudyUrl).child(url).updateChildren(values);\n Toast.makeText(DiseaseEditActivity.this, \"Item Posted\",LENGTH_LONG).show();\n finish();\n }", "private void saveForm() {\n\n if (reportWithCurrentDateExists()) {\n // Can't save this case\n return;\n }\n\n boolean isNewReport = (mRowId == null);\n\n // Get field values from the form elements\n\n // Date\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n String date = df.format(mCalendar.getTime());\n\n // Value\n Double value;\n try {\n value = Double.valueOf(mValueText.getText().toString());\n } catch (NumberFormatException e) {\n value = 0.0;\n }\n\n // Create/update report\n boolean isSaved;\n if (isNewReport) {\n mRowId = mDbHelper.getReportPeer().createReport(mTaskId, date, value);\n isSaved = (mRowId != 0);\n } else {\n isSaved = mDbHelper.getReportPeer().updateReport(mRowId, date, value);\n }\n\n // Show toast notification\n if (isSaved) {\n int toastMessageId = isNewReport ?\n R.string.message_report_created :\n R.string.message_report_updated;\n Toast toast = Toast.makeText(getApplicationContext(), toastMessageId, Toast.LENGTH_SHORT);\n toast.show();\n }\n }", "void save(User user);", "public String save() {\r\n\t\tVendorMasterModel model = new VendorMasterModel();\r\n\t\tmodel.initiate(context, session);\r\n\t\tboolean result;\r\n\t\tif (vendorMaster.getVendorCode().equals(\"\")) {\r\n\t\t\tresult = model.add(vendorMaster);\r\n\t\t\tif (result) {\r\n\t\t\t\taddActionMessage(\"Record saved successfully.\");\r\n\t\t\t\t//reset();\r\n\t\t\t\tgetNavigationPanel(3);\r\n\t\t\t}// end of if\r\n\t\t\telse {\r\n\t\t\t\taddActionMessage(\"Duplicate entry found.\");\r\n\t\t\t\tmodel.Data(vendorMaster, request);\r\n\t\t\t\tgetNavigationPanel(1);\r\n\t\t\t\treset();\r\n\t\t\t\treturn \"success\";\r\n\t\t\t\t\r\n\t\t\t}// end of else\r\n\t\t}// end of if\r\n\t\telse {\r\n\t\t\tresult = model.mod(vendorMaster);\r\n\t\t\tif (result) {\r\n\t\t\t\taddActionMessage(\"Record updated Successfully.\");\r\n\t\t\t\t//reset();\r\n\t\t\t\tgetNavigationPanel(3);\r\n\t\t\t}// end of if\r\n\t\t\telse {\r\n\t\t\t\tgetNavigationPanel(1);\r\n\t\t\t\tmodel.Data(vendorMaster, request);\r\n\t\t\t\taddActionMessage(\"Duplicate entry found.\");\r\n\t\t\t\treset();\r\n\t\t\t\treturn \"success\";\r\n\t\t\t\t\r\n\t\t\t}// end of else\r\n\t\t}// end of else\r\n\t\tmodel.calforedit(vendorMaster,vendorMaster.getVendorCode());\t\r\n\t\tmodel.terminate();\r\n\t\treturn \"Data\";\r\n\t}", "@Exclude\n public abstract void save();", "void save(DeliveryOrderForm deliveryOrderForm);", "@Override\r\n\tpublic void save(T t) {\n\t\tgetSession().save(t);\r\n\t}", "int save(T t);", "public void save(Object instance);", "void saveShipment(Shipment shipment);", "public MainItemOrdered save(MainItemOrdered mainItemOrdered);", "public void saveData(){\n\n if(addFieldstoLift()) {\n Intent intent = new Intent(SetsPage.this, LiftsPage.class);\n intent.putExtra(\"lift\", lift);\n setResult(Activity.RESULT_OK, intent);\n finish();\n }else{\n AlertDialog.Builder builder = new AlertDialog.Builder(SetsPage.this);\n builder.setCancelable(true);\n builder.setTitle(\"Invalid Entry\");\n builder.setMessage(\"Entry is invalid. If you continue your changes will not be saved\");\n builder.setPositiveButton(\"Continue\",\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n finish();\n }\n });\n builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n }\n });\n\n AlertDialog dialog = builder.create();\n dialog.show();\n }\n }", "private void saveReceipt() {\n\n\t\tFinalHttp finalHttp = new FinalHttp();\n\t\tGetServerUrl.addHeaders(finalHttp,true);\n\t\tAjaxParams params = new AjaxParams();\n\t\tparams.put(\"id\", receiptId);\n\t\tparams.put(\"receiptDate\", tv_canshu.getText().toString());\n\t\tparams.put(\"orderId\", orderId);\n\t\tparams.put(\"count\", et_num.getText().toString());\n\t\tparams.put(\"remarks\", et_remark.getText().toString());\n\t\tparams.put(\"receiptAddressId\", receiptAddressId);\n\t\tfinalHttp.post(GetServerUrl.getUrl() + \"admin/buyer/order/saveReceipt\",\n\t\t\t\tparams, new AjaxCallBack<Object>() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onSuccess(Object t) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tJSONObject jsonObject = new JSONObject(t.toString());\n\t\t\t\t\t\t\tString code = JsonGetInfo.getJsonString(jsonObject,\n\t\t\t\t\t\t\t\t\t\"code\");\n\t\t\t\t\t\t\tString msg = JsonGetInfo.getJsonString(jsonObject,\n\t\t\t\t\t\t\t\t\t\"msg\");\n\t\t\t\t\t\t\tif (!\"\".equals(msg)) {\n\t\t\t\t\t\t\t\tToast.makeText(SaveReceipptActivity.this, msg,\n\t\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (\"1\".equals(code)) {\n\t\t\t\t\t\t\t\tsetResult(1);\n\t\t\t\t\t\t\t\tfinish();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsuper.onSuccess(t);\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onFailure(Throwable t, int errorNo,\n\t\t\t\t\t\t\tString strMsg) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tToast.makeText(SaveReceipptActivity.this,\n\t\t\t\t\t\t\t\tR.string.error_net, Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tsuper.onFailure(t, errorNo, strMsg);\n\t\t\t\t\t}\n\n\t\t\t\t});\n\n\t}", "protected void doSave() {\n GWT.log(\"Please override\");\n }", "public void save(){\r\n\t\tmanager.save(this);\r\n\t}", "public Post save(Post t) {\n\t\tSession session;\n\t\ttry {\n\t\t\tsession = sessfact.getCurrentSession();\n\t\t} catch (HibernateException e) {\n\t\t\tsession = sessfact.openSession();\n\t\t}\n\t\tTransaction trans = session.beginTransaction();\n\t\tsession.save(t);\n\t\ttrans.commit();\n\t\treturn t;\n\t}", "Product save(Product product);", "public Flight save(Flight flight);", "@Override\n\tpublic void save(Field entity) {\n\t\t\n\t}", "public void saveExtraData() {}", "public void save() {\n sessionBean.saveStudent();\n success = true;\n }", "void save(Account account);", "public boolean save(T data) throws MIDaaSException;", "public void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows IOException {\n\n\t\t//Get the User Id from session\n\t\t_userId = (String) req.getSession(true).getAttribute(\"userId\");\n\n\t\t//If its an unauthorized access\n\t\tif(_userId == null){\n\t\t\tresp.sendRedirect(\"sign.jsp?User=\" + _userId);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Get the inputs\n\t\tretrieveInputs(req);\n\t\t\n\t\t//Persist the records\n\t\tBoolean persisted = persistRecords();\n\t\t\n\t\t//Send back the response\n\t\t//Pass on the user id and other data\n\t\treq.setAttribute(\"userId\", _userId);\n\t\treq.setAttribute(\"saved\", persisted);\n\t\treq.setAttribute(\"tabMarker\", _tabMarker);\n\t\t\n\t\t//Forward the request to the records page\n\t\ttry {\n\t\t\treq.getRequestDispatcher(\"records.jsp\").forward(req, resp);\n\t\t} catch (ServletException e) {\n\t\t\tlog(e.getMessage());\n\t\t}\t\n\t}", "private void storeInLocal(){\n\t\t\t question = questionTxt.getText().toString();\n\t\t\t \n\t\t\t if (question.length() == 0) {\n\t\t\t\t\tif (TextUtils.isEmpty(question)) {\n\t\t\t\t\t\tquestionTxt.setError(getString(R.string.error_field_required));\n\t\t\t\t\t\tfocusView = questionTxt;\n\t\t\t\t\t\tcancel = true;\n\t\t\t\t\t}\n\t\t }\n\t\t\t else{\n\t\t\t ContentValues values = new ContentValues();\n\t\t values.put(QuestionsTable.QUESTION, question);\n\t\t\t values.put(QuestionsTable.NURSE_ID, NurseLogin.mUsername);\n\t\t\t \n\t\t todoUri = getContentResolver().insert(QuestionsContentProvider.CONTENT_URI, values);\n\t\t\t }\n\t\t }", "private boolean saveData() {\n // get data from input controls\n collectDataFromUI();\n\n if (!validateData()) return false;\n\n boolean isTransfer = mCommon.transactionEntity.getTransactionType().equals(TransactionTypes.Transfer);\n if (!isTransfer) {\n mCommon.resetTransfer();\n }\n\n // Transaction. Need the id for split categories.\n\n if (!saveTransaction()) return false;\n\n // Split Categories\n\n if (mCommon.convertOneSplitIntoRegularTransaction()) {\n saveTransaction();\n }\n\n if(!mCommon.isSplitSelected()) {\n // Delete any split categories if split is unchecked.\n mCommon.removeAllSplitCategories();\n }\n if (!saveSplitCategories()) return false;\n\n return true;\n }", "Entity save(Entity entity);", "@Override\r\n\tpublic void save(Plate tipo) {\n\t\t\r\n\t}", "public String save(UrlObject urlObject);", "private void save(){\n\n this.title = mAssessmentTitle.getText().toString();\n String assessmentDueDate = dueDate != null ? dueDate.toString():\"\";\n Intent intent = new Intent();\n if (update){\n assessment.setTitle(this.title);\n assessment.setDueDate(assessmentDueDate);\n assessment.setType(mAssessmentType);\n intent.putExtra(MOD_ASSESSMENT,assessment);\n } else {\n intent.putExtra(NEW_ASSESSMENT, new Assessment(course.getId(),this.title,mAssessmentType,assessmentDueDate));\n }\n setResult(RESULT_OK,intent);\n finish();\n }", "private boolean savingData(Track track){\n return sqLiteController.SAVE_TRACK_DATA(track);\n }" ]
[ "0.6846179", "0.67577636", "0.67577636", "0.67577636", "0.67577636", "0.6737678", "0.656752", "0.65568197", "0.65568197", "0.65568197", "0.65353346", "0.65038836", "0.6387948", "0.6385712", "0.6381876", "0.63679147", "0.6362697", "0.6352645", "0.6333166", "0.63237625", "0.6281312", "0.62645656", "0.6236385", "0.6236385", "0.62152034", "0.62061065", "0.62061065", "0.618989", "0.6187651", "0.61586016", "0.60640913", "0.60583025", "0.6048436", "0.60458046", "0.60303533", "0.60138017", "0.6013194", "0.6012603", "0.60109985", "0.60002774", "0.5998938", "0.5997997", "0.5996241", "0.59917825", "0.598879", "0.5976919", "0.59760666", "0.596568", "0.5963366", "0.5962644", "0.59579235", "0.5943691", "0.5943603", "0.5936621", "0.5932748", "0.59084266", "0.59069055", "0.5904649", "0.58965254", "0.5895401", "0.58943695", "0.58920956", "0.5891529", "0.58902675", "0.58812803", "0.58774054", "0.58735794", "0.5868742", "0.5860464", "0.5857919", "0.58500385", "0.58498186", "0.5847765", "0.5838652", "0.58361363", "0.5829498", "0.5821429", "0.5818431", "0.58160806", "0.5803789", "0.5798619", "0.5798402", "0.57949495", "0.5791247", "0.5783054", "0.57707787", "0.5769509", "0.5769003", "0.5761054", "0.57608074", "0.57600296", "0.5753492", "0.57419777", "0.57399684", "0.57350177", "0.57304794", "0.57288367", "0.5719949", "0.57181007", "0.5717524", "0.5717442" ]
0.0
-1