query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
CelestialObject packageprivate constructor returning a celestial object and initializing some values
CelestialObject(String name, EquatorialCoordinates equatorialPos, float angularSize, float magnitude) { celestialName = Objects.requireNonNull(name); celestialEquatorialPosition = Objects.requireNonNull(equatorialPos); checkArgument(angularSize >= 0); celestialAngularSize = angularSize; celestialMagnitude = magnitude; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private SingleObject()\r\n {\r\n }", "Reproducible newInstance();", "protected abstract void construct();", "private SingleObject(){}", "private SingleObject(){\n }", "public ObjectFactory() {\n\t}", "public ObjectFactory() {\r\n\t}", "private ObjectFactory() { }", "public LocalObject() {}", "public CuerpoCeleste() {\n\t\t// Start of user code constructor for CuerpoCeleste)\n\t\tsuper();\n\t\t// End of user code\n\t}", "public Constructor(){\n\t\t\n\t}", "public Cohete() {\n\n\t}", "private TMCourse() {\n\t}", "public Clade() {}", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "protected GeometricObject() \n\t{\n\t\tdateCreated = new java.util.Date();\n\t}", "private Instantiation(){}", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public ObjectFactory() {\r\n }", "public Potencial() {\r\n }", "public ObjectFactory() {}", "public ObjectFactory() {}", "public ObjectFactory() {}", "@Test\n public void Constructor_ObjectValues_InstanceCreated() {\n\t\ttry {\n Position position = make_PositionWithIntegerPoints(xCoordinate, yCoordinate, direction);\n Surface surface = make_SurfaceWithGivenDimensions(xDimension, yDimension);\n\t\t\tRover rover = make_RoverWithObjectValues(position, surface);\n\t\t}\n\t\tcatch (AssertionError assErr) {\n\t\t\t// Test passed.\n\t\t\treturn;\n\t\t}\n }", "public RngObject() {\n\t\t\n\t}", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }" ]
[ "0.7153329", "0.704265", "0.6968854", "0.6842504", "0.67444575", "0.6738709", "0.67114055", "0.66683793", "0.66631174", "0.65982157", "0.6585885", "0.6526111", "0.6514715", "0.6493983", "0.64907724", "0.64817965", "0.64815843", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.64659417", "0.6459182", "0.6457357", "0.6457357", "0.6457357", "0.6456954", "0.64513665", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871", "0.644871" ]
0.0
-1
Method name returning the name of the celestial object
public String name() { return celestialName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getObjectName();", "private String getName() {\n return method.getName();\n }", "private String name() {\r\n return cls.getSimpleName() + '.' + mth;\r\n }", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "String name();", "@Override\n\tString name();", "public String name();", "public String name();", "public String name();", "public String name();", "public String name();", "public String name();", "public String name();", "public String name();", "public String name();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();" ]
[ "0.77799714", "0.7595891", "0.7511897", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7413724", "0.7334963", "0.72519124", "0.72519124", "0.72519124", "0.72519124", "0.72519124", "0.72519124", "0.72519124", "0.72519124", "0.72519124", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526", "0.71810526" ]
0.0
-1
Method angularSize returning the angular size of the celestial object
public double angularSize() { return celestialAngularSize; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double angularSize() {\n return angularSize;\n }", "public double getSize() {\n return size_;\n }", "double getSize();", "public double getSize() \n {\n return size;\n }", "public double getSize()\n\t{\n\t\treturn size;\n\t}", "public double getSize() {\n return size_;\n }", "@JSProperty(\"size\")\n double getSize();", "public RMSize getSize() { return new RMSize(getWidth(), getHeight()); }", "@Override\n\tpublic double getSize() {\n\t\treturn Math.sqrt(getMySize())/2;\n\t}", "public double getSize() {\n return getElement().getSize();\n }", "public double getMySize() {\n\t\treturn size;\n\t}", "public float getSize() {\n return size;\n }", "Dimension getSize();", "Dimension getSize();", "public float getSize()\n {\n return size;\n }", "int getCurrentSize();", "public float getSize() {\n\t\treturn size;\n\t}", "public Dimension getSize() {\n\t\t\t\tfor(Rectangle rec : boxes){\r\n\t\t\t\t\tbounds.union(rec);\r\n\t\t\t\t}\r\n\t\t\t\treturn bounds.getSize();\r\n\t\t\t}", "public int getApproximateSize() {\r\n return approximateSize;\r\n }", "public final int getRealSize() {\n return size - 1;\n }", "public int getSize() {\n\t\treturn width + length;\n\t}", "public Dimension getSize()\n\t{\n\t\treturn rect.getSize();\n\t}", "int getAreaSize();", "public short getObjectSize() { return objectSize; }", "long getPlaneSize();", "public double getCapacity() {\n\t\tIterator<Ball> it = this.contents.iterator();\n\t\tdouble retVal = 0;\n\t\twhile (it.hasNext()) {\n\t\t\tretVal += it.next().getCapacity();\n\t\t}\n\t\treturn retVal;\n\t}", "public Size getSize() {\n return size;\n }", "private int getSize() {\r\n\t\treturn this.size;\r\n\t}", "@Override\n public int getElementSize() {\n if (elementSize <= 0)\n calcElementSize();\n return elementSize;\n }", "public Dimension getSize() {\r\n\t\treturn this.size;\r\n\t}", "private int getSize() {\n\t\t\treturn size;\n\t\t}", "public int getDesiredSize()\n\t{\n\t\treturn desiredSize;\n\t}", "public int getSize() { return size; }", "public int getSize() {return size;}", "public java.lang.Long getObjectSize() {\n return object_size;\n }", "@Override\n\tpublic int computeSize() {\n\t\treturn 36;\n\t}", "public int getTotalSize();", "int getSize() {\n return size;\n }", "int getSize() {\n return size;\n }", "public int getSize() {\n return this.numberOfVehicle;\n }", "public final long getSize() { return size; }", "public int getSize() { \n return size;\n }", "public java.lang.Long getObjectSize() {\n return object_size;\n }", "public Dimension getSize() {\n\t\treturn size.getCopy();\n\t}", "public float getRelativeSize() {\n\t\treturn relativeSize;\n\t}", "int getLostedSize();", "public int getSize( )\n {\n return size;\n }", "public int getSize() {\r\n return r;\r\n }", "public int getSize() {\n\n return size;\n }", "public int getSize(){\n return size;\n }", "public long estimateSize() {\n/* 1338 */ return this.est;\n/* */ }", "public int getSize() {\n return size;\n }", "public Dimension getSize() { return new Dimension(width,height); }", "public int getSize() {\r\n return size;\r\n }", "public int getSize(){\n return size;\n }", "public int getSize(){\n return size;\n }", "public int getSize(){\n return size;\n }", "public long getSize() {\n return size;\n }", "public double getWidth() {\n return this.size * 2.0; \n }", "public int getSize() {\r\n return _size;\r\n }", "public long getSize() {\r\n return size;\r\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "@Override\n public long getSize() {\n return allocatedSize;\n }", "public int getSize() {\r\n \treturn size;\r\n }", "public int getSize() {\n return size;\n }", "int getTotalSize();", "public final int getSize() {\n return size;\n }", "float computeSize() {\n if (dirtyS) {\n size = modelRoot.getCSize().getSize(node);\n dirtyBufS = true;\n modelRoot.decrementNumberOfDirtySNodes();\n dirtyS = false;\n }\n return size;\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();", "public Point2D.Float getSize() {\r\n\t\treturn size;\r\n\t}", "public int getSize() {\n return size;\n }", "public int getSize() {\r\n return size;\r\n }", "public long getSize() {\n return size;\n }", "public long getSize() {\n return size;\n }", "public long getSize() {\n return size;\n }", "public long getSize() {\n return size;\n }", "public int getSize();", "public int getSize();", "public int getSize();", "public int getSize();", "public int getSize();" ]
[ "0.8211346", "0.6639572", "0.6638351", "0.6607718", "0.6606959", "0.6603693", "0.65355474", "0.6476783", "0.64736307", "0.6333658", "0.63273746", "0.62850535", "0.62784183", "0.62784183", "0.62575966", "0.6240838", "0.6239585", "0.6214115", "0.61879027", "0.6184727", "0.6181976", "0.61744887", "0.6122687", "0.61141646", "0.61081177", "0.6091224", "0.6081413", "0.6077863", "0.6070861", "0.605373", "0.6050979", "0.6045966", "0.6038409", "0.603742", "0.6033658", "0.6031558", "0.6030226", "0.60189754", "0.60106546", "0.6010344", "0.6008908", "0.6003324", "0.60021883", "0.60015863", "0.5999442", "0.59929913", "0.59735113", "0.5973435", "0.59698045", "0.5966668", "0.59608454", "0.5959248", "0.59539855", "0.59529257", "0.5952136", "0.5952136", "0.5952136", "0.5951951", "0.5948379", "0.5947973", "0.59434986", "0.5942751", "0.5942751", "0.5942751", "0.5942751", "0.5942751", "0.5942751", "0.5942751", "0.5942751", "0.59411955", "0.59394366", "0.59393257", "0.59372073", "0.5933039", "0.59302545", "0.5927676", "0.5927676", "0.5927676", "0.5927676", "0.5927676", "0.5927676", "0.5927676", "0.5927676", "0.5927676", "0.5927676", "0.5927676", "0.5927676", "0.5927676", "0.59273344", "0.5924517", "0.5921473", "0.5920981", "0.5920981", "0.5920981", "0.5920981", "0.591734", "0.591734", "0.591734", "0.591734", "0.591734" ]
0.8354465
0
Method magnitude returning the magnitude of the celestial object
public double magnitude() { return celestialMagnitude; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double magnitude() {\r\n\t\treturn Math.sqrt(this.x*this.x + this.y*this.y + this.z*this.z);\r\n\t}", "public double magnitude(){\n return Math.sqrt((this.x * this.x) + (this.y * this.y));\n }", "public double magnitude() {\n double totalX = this.xCoord * this.xCoord;\n double totalY = this.yCoord * this.yCoord;\n double totalZ = this.zCoord * this.zCoord;\n return Math.sqrt(totalX + totalY + totalZ);\n }", "public double magnitude () {\n\t\treturn Math.sqrt( (deltaX * deltaX) + (deltaY * deltaY));\n\t}", "public double magnitude(){\n\t\treturn Math.sqrt(x*x + y*y + z*z);\n\t}", "public double magnitude()\n {\n return Math.sqrt((x*x) + (y * y) + (z * z) + (w * w));\n }", "public T magnitude();", "public double magnitude() {\n\t\treturn Math.sqrt(x*x + y*y + z*z);\n\t}", "public double magnitude() {\n return Math.sqrt(magnitudeSquared());\n }", "public double magnitude() {\n return (Math.sqrt( (this.real * this.real) + (this.imag * this.imag) ) );\n }", "public double magnitude() {\n \n double ms = _x * _x + _y * _y; \n return Math.sqrt(ms);\n \n }", "public float getMagnitude()\n {\n return magnitude;\n }", "public int getMagnitude()\r\n {\r\n return magnitude;\r\n }", "public float magnitude() {\r\n \r\n return (float)Math.sqrt(x*x + y*y + z*z);\r\n }", "public int getMagnitude() {\n\t\treturn magnitude;\n\t}", "float getMagnitude();", "public float getMagnitude() {\r\n\t\treturn Float.parseFloat(getProperty(\"magnitude\").toString());\r\n\t}", "public float getMagnitude() {\n\t\treturn Float.parseFloat(getProperty(\"magnitude\").toString());\n\t}", "public double getMagnitude() {\n\t\treturn Math.sqrt(imaginary * imaginary + real * real);\n\t}", "public double getMagnitude() {\n\t\treturn Math.sqrt(real * real + imaginary * imaginary);\n\t}", "public double mag() {\n return Math.sqrt(mag2());\n }", "public double mag()\n {\n return (Math.sqrt(this.x*this.x + this.y*this.y));\n }", "public T magnitudeSquared();", "public float getMagnitude() {\n return (float) Math.sqrt(Math.pow(latComponent, 2) + Math.pow(longComponent, 2));\n }", "public void setMagnitude(int magnitude)\r\n {\r\n this.magnitude = magnitude; \r\n }", "public double magnitudeSquared(){\n\t\treturn x*x + y*y + z*z;\n\t}", "public double getHmag()\n\t{\n\t\tVectorN h = this.getH();\n\t\tdouble out = h.mag();\n\t\treturn out;\n\t}", "public void setMagnitude()\n {\n magnitude = (float) Math.sqrt(Math.pow(fx, 2) + Math.pow(fy, 2) + Math.pow(fz, 2));\n }", "public double magnitude(Coordinates vector);", "public double magnitudeSquared() {\n \n return _x * _x + _y * _y; \n \n }", "public double magnitudeSquared() {\n return x * x + y * y + z * z;\n }", "@Test\r\n public void testMag() {\r\n double expected = 5;\r\n Complex c = new Complex(-4, -3);\r\n double actual = c.mag();\r\n assertEquals(expected, actual);\r\n \r\n }", "public double getMagnitud(){\n return Math.sqrt(x*x+y*y);\n }", "private double calculateMagnitude(double x_acceleration, double y_acceleration, double z_acceleration) {\n double magnitude = 0;\n double x_squared = 0;\n double y_squared = 0;\n double z_squared = 0;\n\n x_squared = Math.pow(x_acceleration, 2);\n y_squared = Math.pow(y_acceleration, 2);\n z_squared = Math.pow(z_acceleration, 2);\n\n //-------------------------------------------------------------\n // Calculated based on formula r=sqrt(x^2+y^2+z^2) where,\n // r = magnitude of the vector.\n //-------------------------------------------------------------\n magnitude = Math.sqrt(x_squared + y_squared + z_squared);\n\n return magnitude;\n }", "public double squareMagnitude() {\n\t\treturn x*x + y*y + z*z;\n\t}", "public double getMaxGradientMagnitude() {\r\n if (maxmag >= 0) {\r\n return maxmag;\r\n } else {\r\n double magnitude = data[0].mag;\r\n for (int i = 0; i < data.length; i++) {\r\n magnitude = data[i].mag > magnitude ? data[i].mag : magnitude;\r\n }\r\n maxmag = magnitude;\r\n return magnitude;\r\n }\r\n }", "Double getZLength();", "public final void mag() throws ArithmeticException {\n\t\tif ((mksa&_LOG) != 0) throw new ArithmeticException\n\t\t(\"****Unit: mag(\" + symbol + \")\") ;\n\t\tvalue = -2.5*AstroMath.log(value);\n\t\tif ((mksa == underScore) && (factor == 1)) {\t// Now we've mag\n\t\t\tmksa |= _mag;\n\t\t\tif (symbol != null) symbol = \"mag\";\n\t\t} else {\n\t\t\tmksa |= (_log|_mag);\n\t\t\tif (symbol != null) symbol = \"mag[\" + symbol + \"]\";\n\t\t}\n\t}", "public float getMaxAlturaCM();", "public double getLimitingMag ( ) {\r\n\t\treturn limiting_mag;\r\n\t}", "public void setMinMagnitude(double magnitude);", "public MagnitudeSystem getMagnitudeSystem ( ) {\r\n\t\treturn system;\r\n\t}", "private double magnitudeToRadius(double mag) {\n\t\tif (mag > 6.0) {\n\t\t\treturn 0.25;\n\t\t} else if (mag > 5.0) {\n\t\t\treturn 0.3;\n\t\t} else if (mag > 4.0) {\n\t\t\treturn 0.4;\n\t\t} else if (mag > 3.0) {\n\t\t\treturn 0.55;\n\t\t} else if (mag > 2.0) {\n\t\t\treturn 0.7;\n\t\t} else if (mag > 1.0) {\n\t\t\treturn 0.9;\n\t\t} else if (mag > 0.5) {\n\t\t\treturn 1.0;\n\t\t} else if (mag > .5) {\n\t\t\treturn 1.20;\n\t\t} else if (mag < -2.0) {\n\t\t\treturn 5.0;\n\t\t}\n\t\treturn 1.75;\n\t}", "public float getChlorophyllMax() {\n return chlorophyllMax;\n }", "double getZLength();", "public float lenght() {\n\t\treturn (float) Math.sqrt(x*x + y*y + z*z);\n\t}", "public double module() {\n return getMagnitude();\n }", "public static Double LargeZ() {\n return LargeZ;\n }", "public double lenght() {\r\n\t\treturn Math.sqrt(this.x * this.x +\r\n\t\t\t\t\t\t this.y * this.y +\r\n\t\t\t\t\t\t this.z * this.z);\r\n\t}", "public float length(){\r\n\t\treturn (float)Math.sqrt(Math.pow(this.x, 2) + Math.pow(this.y, 2) + Math.pow(this.z, 2) );\r\n\t}", "public double getLength() {\n\treturn CVector.subtract(v2, v1).getMag();\n }", "public double getX_AxisMagnitudeDifference() {\n return 0;\n }", "public double getMagnitude ( Star star ) {\r\n\t\ttry {\r\n\t\t\tif (star instanceof CatalogStar)\r\n\t\t\t\treturn ((CatalogStar)star).getMagnitude(getMagnitudeSystem());\r\n\t\t} catch ( UnsupportedMagnitudeSystemException exception ) {\r\n\t\t\tSystem.err.println(exception);\r\n\t\t}\r\n\r\n\t\treturn star.getMag();\r\n\t}", "public double abs() {\n\t\treturn Math.sqrt(real * real + imag * imag);\n\t}", "public int fondMagasin(){\n\tint total =this.jeton;\n\tfor(Caisse c1 : this.lesCaisses){\n\ttotal = c1.getTotal()+total;\n\t}\n\treturn total;\n}", "public double len() {\n \t\treturn Math.sqrt((double)x*x + (double)y*y + (double)z*z);\n \t}", "public float length()\n {\n return (float) Math.sqrt(x * x + y * y + z * z + w * w);\n }", "public int getNumeroChampMag() {\n\t\treturn numeroChampMag;\n\t}", "public long getSize() {\n\t\treturn Math.abs(getXSize() * getYSize() * getZSize());\n\t}", "public double getCelsius(){\n return ((fahrenheit-32)*(5.0/9));\n }", "@Override\n public double obtenerVolumen(){\n return (1.0 / 3.0) * c.obtenerArea() * c.obtenerAltura();\n }", "@Override\r\n public double obtenerVolumen() {\n return Math.pow(getA(), 3);//eleva al cubo\r\n }", "public float length(){\n return (float) Math.sqrt(Math.pow(x,2) + Math.pow(y,2) + Math.pow(z,2));\n }", "final int compareMagnitude(BigInteger val) {\n int[] m1 = mag;\n int len1 = m1.length;\n int[] m2 = val.mag;\n int len2 = m2.length;\n if (len1 < len2)\n return -1;\n if (len1 > len2)\n return 1;\n for (int i = 0; i < len1; i++) {\n int a = m1[i];\n int b = m2[i];\n if (a != b)\n return ((a & LONG_MASK) < (b & LONG_MASK)) ? -1 : 1;\n }\n return 0;\n }", "public double getAzMax() {\n\t\treturn azMax;\n\t}", "public double masse () {return this.volume()*this.element.masseVolumique();}", "public static int magnitude(int a, int b) {\n int abso = Math.max(Math.abs(a), Math.abs(b));\n if (abso == (Math.abs(a))){\n return a; \n }\n else {\n return b;\n }\n\n }", "public double getLimiteCorrente () {\r\n\t\treturn limiteCorrente;\r\n\t}", "public static final float magnitude(final float real, final float imaginary) {\r\n return (float) Math.sqrt(real * real + imaginary * imaginary);\r\n }", "float zMax();", "public int getLengthInCentiMeters()\r\n\t{\r\n\t\treturn length;\r\n\t}", "public double getMaxSpeed() {\r\n return maxSpeed;\r\n }", "public double getMaxRadius() {\n return rrMaxRadius;\n }", "public double getMZ() {\n return iMass;\n }", "public double calcMagnitudeVector(int i) {\n // Remove the gravity contribution with the high-pass filter.\n linear_acceleration[0] = mEvent.values[0];\n linear_acceleration[1] = mEvent.values[1];\n linear_acceleration[2] = mEvent.values[2];\n\n mAccelValues[i] = Math.sqrt(\n linear_acceleration[0] * linear_acceleration[0] +\n linear_acceleration[1] * linear_acceleration[1] +\n linear_acceleration[2] * linear_acceleration[2]);\n return mAccelValues[i];\n }", "public Vector3D normalize()\r\n {\r\n float oneOverMagnitude = 0;\r\n float mag = magnitude();\r\n \r\n if (mag!=0) {\r\n oneOverMagnitude = 1 / mag;\r\n }\r\n\r\n return this.product(oneOverMagnitude);\r\n }", "public float length() {\r\n\t\treturn (float) Math.sqrt((x * x) + (y * y));\r\n\t}", "public double length() {\n\t\treturn Math.sqrt(x * x + y * y + z * z + w * w);\n\t}", "public double getMaxSpeedValue() {\n return maxSpeedValue;\n }", "public double getMagnitude(Sides stick){\n \tif(stick==Sides.left)return Math.sqrt(LeftStick.X*LeftStick.X+LeftStick.Y*LeftStick.Y);\n \telse return Math.sqrt(RightStick.X*RightStick.X+RightStick.Y*RightStick.Y);\n }", "public double getForceMagnitude(State state) {\n return opensimSimulationJNI.ExpressionBasedPointToPointForce_getForceMagnitude(swigCPtr, this, State.getCPtr(state), state);\n }", "public float getVisibleMagnitude() {\n\n return visibleMagnitude;\n\n }", "private long getAbsMax() {\n return Math.max(Math.abs(Visualizer.getLowerBound().get()),\n Visualizer.getUpperBound().get());\n }", "public float maxSpeed();", "public float length ()\n {\n return FloatMath.sqrt(lengthSquared());\n }", "public double norm() {\n\t\thomogenize();\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n\t}", "final int compareMagnitude(long val) {\n assert val != Long.MIN_VALUE;\n int[] m1 = mag;\n int len = m1.length;\n if (len > 2) {\n return 1;\n }\n if (val < 0) {\n val = -val;\n }\n int highWord = (int)(val >>> 32);\n if (highWord == 0) {\n if (len < 1)\n return -1;\n if (len > 1)\n return 1;\n int a = m1[0];\n int b = (int)val;\n if (a != b) {\n return ((a & LONG_MASK) < (b & LONG_MASK))? -1 : 1;\n }\n return 0;\n } else {\n if (len < 2)\n return -1;\n int a = m1[0];\n int b = highWord;\n if (a != b) {\n return ((a & LONG_MASK) < (b & LONG_MASK))? -1 : 1;\n }\n a = m1[1];\n b = (int)val;\n if (a != b) {\n return ((a & LONG_MASK) < (b & LONG_MASK))? -1 : 1;\n }\n return 0;\n }\n }", "@Test\n public void testGetMagnitude() {\n System.out.println(\"getMagnitude\");\n Unit instance = new Unit();\n Magnitude expResult = null;\n Magnitude result = instance.getMagnitude();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "@Override\n\tpublic int getMaxSpeed() {\n\t\treturn super.getMaxSpeed();\n\t}", "public float getMinAlturaCM();", "public double length() {\n return Math.sqrt(\n (Math.pow(getX(), 2)) +\n (Math.pow(getY(), 2)) +\n (Math.pow(getZ(), 2))\n );\n }", "public static long mass () { return mass;}", "double getMax() {\n\t\t\treturn value_max;\n\t\t}", "public float getOxygenMax() {\n return oxygenMax;\n }", "public double getCylinderSurfaceArea();", "public float getSpeed() {\n\t\tfloat result = (float) Math.sqrt(velocity.x * velocity.x + velocity.y * velocity.y);\n\t\treturn result;\n\t}", "public double getProperLimitingMag ( ) {\r\n\t\tif (getLimitingMag() != null)\r\n\t\t\treturn (double)getLimitingMag().floatValue();\r\n\r\n\t\treturn 0.0;\r\n\t}", "public double mag2() {\n return (x * x) + (y * y);\n }", "@Override\n public int calculerSurface() {\n return (int)(Math.PI * carre(rayon));\n }", "public double getAccelZ() {\n return m_accelerometer.getZ();\n }" ]
[ "0.79887515", "0.7981786", "0.793248", "0.78933823", "0.7861252", "0.7840295", "0.7834807", "0.7808302", "0.7760619", "0.7747376", "0.77368504", "0.7697859", "0.7631808", "0.76298624", "0.7568327", "0.7560478", "0.7492632", "0.74714607", "0.74062157", "0.73824215", "0.72440475", "0.7142285", "0.7085944", "0.70424265", "0.685292", "0.6851061", "0.68346447", "0.67981374", "0.6766785", "0.67624605", "0.6676442", "0.65946406", "0.6517582", "0.62207144", "0.6154891", "0.60255337", "0.60191625", "0.6011631", "0.60111606", "0.6005545", "0.600294", "0.5989276", "0.59674215", "0.5965143", "0.59189487", "0.58874375", "0.5878255", "0.58760923", "0.5851037", "0.58185726", "0.5794847", "0.5794297", "0.57828224", "0.57805705", "0.57578826", "0.57567453", "0.57534885", "0.5740318", "0.5716152", "0.57143843", "0.56987005", "0.5697829", "0.5684645", "0.56811726", "0.56463426", "0.5645384", "0.5630292", "0.5620691", "0.560967", "0.56063795", "0.5587478", "0.5568422", "0.5559492", "0.5558673", "0.55565", "0.55438024", "0.5539435", "0.5528964", "0.55283636", "0.5520444", "0.5517558", "0.55174327", "0.5516497", "0.5516106", "0.55067694", "0.5504376", "0.5501131", "0.54981965", "0.5497253", "0.54941297", "0.5490571", "0.5490108", "0.5481501", "0.54758555", "0.545539", "0.54447925", "0.5443433", "0.54392815", "0.5438743", "0.5438723" ]
0.85874707
0
Method equatorialPos returning the equatorial coordinates of the celestial object
public EquatorialCoordinates equatorialPos() { return celestialEquatorialPosition; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public EquatorialCoordinates equatorialPos() {\n return equatorialPos;\n }", "public static Dimension getPos()\n {\n Dimension pos = new Dimension( cX, cY );\n next();\n return pos;\n }", "public Coordinate getPosition();", "public Position findWeedPosition() {\n int x = 0;\n int y = 0;\n int sum = 0;\n for (int i = 0; i < this.WORLD.getMapSize().getX(); i++) {\n for (int j = 0; j < this.WORLD.getMapSize().getY(); j++) {\n\n //hogweed\n Organism organism = this.WORLD.getOrganism(i, j);\n if(organism!=null){\n Class c = organism.getClass();\n if (c.getSimpleName().equals(\"Parnsip\")) {\n int tmpX = Math.abs(this.position.getX() - i);\n int tmpY = Math.abs(this.position.getY() - j);\n if (!(sum==0)) {\n int tmpSum = tmpX + tmpY;\n if (sum > tmpSum) {\n x = i;\n y = j;\n sum = tmpSum;\n }\n }\n else {\n x = i;\n y = j;\n sum = tmpX + tmpY;\n\n }\n }\n }\n\n }\n }\n return new Position(x,y);\n }", "public Point getGridCoordinates(){\n try {\n return (new Point(x / MapManager.getMapTileWidth(), y / MapManager.getMapTileHeight()));\n } catch (Exception e){\n System.out.print(\"Error while getting grid coordinates.\");\n throw e;\n }\n }", "@Override\n\t\t\tpublic Vector getPosition() {\n\t\t\t\treturn new Vector(-2709.487, -4281.02, 3861.564); //-4409.0, 2102.0, -4651.0);\n\t\t\t}", "Square getCurrentPosition();", "public E3DVector3F getVertexPosC(){\r\n return vertices[2].getVertexPos();\r\n }", "public final native CoOrdinates getPosition() /*-{\r\n\t\treturn this.position;\r\n\t}-*/;", "Vector getPos();", "long getCoordinates();", "long getCoordinates();", "private Point getCentreCoordinate(Point t)\n {\n \treturn new Point (t.x + Constants.cell_length /2f, t.y, t.z+Constants.cell_length/2f );\n }", "public GuiPositions getPosCoor() {\r\n\t\treturn posCoor;\r\n\t}", "public EclipticToEquatorialConversion(ZonedDateTime when) {\n // The number of Julian centuries elapsed since January 1st, 2000 at 12h00 UTC.\n double nbJulianCenturies = Epoch.J2000.julianCenturiesUntil(when);\n\n // The obliquity of the ecliptic, i.e. the angle of inclination of the Earth's axis of rotation relative to the ecliptic\n double obliquity = POLYNOMIAL_OBLIQUITY.at(nbJulianCenturies);\n cosObliquity = cos(obliquity);\n sinObliquity = sin(obliquity);\n }", "Object getPosition();", "List<GridCoordinate> getCoordinates(int cellWidth, int cellHeight);", "MazePoint getActivePlayerCoordinates();", "public Point2D getCellCoordinates(JmtCell cell) {\r\n \t\tRectangle2D bounds = GraphConstants.getBounds(cell.getAttributes());\r\n \t\treturn new Point2D.Double(bounds.getMinX(), bounds.getMinY());\r\n \t}", "public Coordinate getPosition() {\n return cPosition;\n }", "public Point centeroid ()\r\n {\r\n return new Point ((v1.getX()+v2.getX()+v3.getX())/3,(v1.getY()+v2.getY()+v3.getY())/3);\r\n }", "public double getEquinox();", "public Coords getCenter()\r\n {\r\n return new Coords(Math.round(x + width / 2), Math.round(y + height / 2));\r\n }", "public Coordinate getLocation();", "Coordinates getCoordinates(int rowIndex);", "public Coordinates getCoordinates() {\n if (this.coordinates == null)\n return new Coordinates(-1, -1);\n return this.coordinates;\n }", "public Vector getLocation();", "public LatLng getCentrePos() {\n double lat = 0;\n double lon = 0;\n for (int i=0; i<newHazards.size(); i++) {\n lat += frags.get(i).getHazard().getLatitude();\n lon += frags.get(i).getHazard().getLongitude();\n }\n return new LatLng(lat / newHazards.size(), lon / newHazards.size());\n }", "public Position getCurrentPosion() {\n Position position = new Position();\n position.x = getLeft() + getWidth() / 2;\n position.y = getTop() + getHeight() / 2;\n return position;\n }", "public Position position();", "public static int getCoords()\n\t{\n\t\treturn moveCoords;\n\t}", "private HexaPoint getHitboxCoord(int pos) {\n int x = 0;\n int y = 0;\n int z = 0;\n int coordX = this.coordPion.getX();\n int coordY = this.coordPion.getY();\n int coordZ = this.coordPion.getZ();\n switch (pos) {\n case 0:\n x = coordX;\n y = coordY + 1;\n z = coordZ - 1;\n break;\n case 1:\n x = coordX + 1;\n y = coordY;\n z = coordZ - 1;\n break;\n case 2:\n x = coordX + 1;\n y = coordY - 1;\n z = coordZ;\n break;\n case 3:\n x = coordX;\n y = coordY - 1;\n z = coordZ + 1;\n break;\n case 4:\n x = coordX - 1;\n y = coordY;\n z = coordZ + 1;\n break;\n case 5:\n x = coordX - 1;\n y = coordY + 1;\n z = coordZ;\n break;\n }\n return new HexaPoint(x, y, z);\n }", "Point getCenter();", "Point getCenter();", "Position getPosition();", "Position getPosition();", "public Coordinate getCoordenadasActuales() ;", "public Coordinate getCenteredCoordinate() {\n return coordinate.add(getHalfSize());\n }", "public Vector2f getCoordinates() {\r\n return new Vector2f(tileColumn, tileRow);\r\n }", "public Position findWeed() {\n int xVec =0;\n int yVec=0;\n int sum = 0;\n Position move = new Position(0, 0);\n for (int i = 0; i < this.WORLD.getMapSize().getX(); i++) {\n for (int j = 0; j < this.WORLD.getMapSize().getY(); j++) {\n\n //hogweed\n Organism organism = this.WORLD.getOrganism(i, j);\n if(organism!=null){\n Class c = organism.getClass();\n if (c.getSimpleName().equals(\"Parnsip\")) {\n int tmpX = Math.abs(this.position.getX() - i);\n int tmpY = Math.abs(this.position.getY() - j);\n if (!(xVec == 0 && yVec == 0)) {\n int tmpSum = tmpX + tmpY;\n if (sum > tmpSum) {\n xVec=tmpX;\n yVec=tmpY;\n sum = tmpSum;\n this.setMove(move, j, i);\n }\n }\n else {\n xVec=tmpX;\n yVec=tmpY;\n sum = tmpX + tmpY;\n this.setMove(move, j, i);\n }\n }\n }\n\n }\n }\n return move;\n }", "IntPoint getLocation();", "public Position getPosition();", "public Position getPosition();", "public Position getPosition();", "public GridCoord getCoord() {\n return coord;\n }", "public int getXPos();", "Point getPosition();", "Point getPosition();", "public ImageWorkSpacePt findCurrentCenterPoint() {\n WebPlot plot= getPrimaryPlot();\n\n\n int screenW= plot.getScreenWidth();\n int screenH= plot.getScreenHeight();\n int sw= getScrollWidth();\n int sh= getScrollHeight();\n int cX;\n int cY;\n if (screenW<sw) {\n cX= screenW/2;\n }\n else {\n int scrollX = getScrollX();\n cX= scrollX+sw/2- wcsMarginX;\n }\n\n if (screenH<sh) {\n cY= screenH/2;\n }\n else {\n int scrollY = getScrollY();\n cY= scrollY+sh/2- wcsMarginY;\n }\n\n ScreenPt pt= new ScreenPt(cX,cY);\n\n return plot.getImageWorkSpaceCoords(pt);\n }", "public int getPosicionCero(){\n\t\tint posicionDelCero = -1;\n\t\tint i = 0;\n\t\twhile(i < celdas.size()){\n\t\t\tif(celdas.get(i).getValor() == 0){\n\t\t\t\tposicionDelCero = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn posicionDelCero;\n\t}", "public abstract Vec2 doorPosition();", "public Point getPosition();", "@Test\n public void testFind_East_cross_boundary() {\n\n double lat1 = 0.0;\n double lon1 = 170.0;\n double lat2 = 0.0;\n double lon2 = -170.0;\n double expResult = Math.toRadians(90);\n double result = Azimuth.find(lat1, lon1, lat2, lon2);\n assertEquals(expResult, result, 0.0);\n }", "public GridCoord getCoord() {\n\t\treturn this.coord;\n\t}", "public Pixel getCoordenadasCartesianas(){\r\n\t\tPixel p = new Pixel();\r\n\t\tp.setXDouble(this.getXCartesiano());\r\n\t\tp.setYDouble(this.getYCartesiano());\r\n\t\tp.setCol(this.getCol());\r\n\t\treturn p;\r\n\t}", "public GridLocation getLocation();", "public Equipe getEquipe() {\r\n\t\treturn this.equipe;\r\n\t}", "public int getCoordinatingExp()\n\t{\n\t\treturn m_skillCoordExp;\n\t}", "public Point getAbsPosition() {\n return Game.getMap().TFMapCoordinateToMapCenter(position);\n }", "Tile getPosition();", "public float getCenterX() {\n return cPosition.getX() + (float) cFishSizeX / 2;\n }", "public double getAbsPosition() {\n double distCM = ToFSerial.get() - startDist;\n //System.out.println(\"Dist in CM \" + distCM);\n\n double distIn = distCM * Constants.k_CMtoIn;\n //System.out.println(\"Dist in In \" + distIn);\n\n return (int) (1000 * distIn); \n\n }", "public Vector3D getCentrePosition()\n\t{\n\t\treturn centrePosition;\n\t}", "public ILocation east()\n {\n Location east = new Location(x + 1, y);\n return east;\n }", "public abstract Vector computeCenter();", "public int getPos();", "public int getPos();", "public ChunkCoordinates getPlayerCoordinates()\n {\n return new ChunkCoordinates(0, 0, 0);\n }", "public int getPosition(){\n\t\treturn this.cell;\n\t}", "double getXPosition();", "public Coordinates getCoordinates()\r\n {\r\n return new Coordinates(r.getX(), r.getY());\r\n }", "public Vector2f getPosition() { return new Vector2f(centroid_pos); }", "public PVector getPos() {\n\t\treturn new PVector(getX(), getY());\n\t}", "public GeoPoint position(){\n return position;\n }", "public int getPosicaoX() {\r\n\t\treturn posicaoX;\r\n\t}", "public void verificaCoordenada() {\r\n\t\tif (X < 0) {\r\n\t\t\tX = Const.TAMANHO - 1;\r\n\t\t} else {\r\n\t\t\tX = X % Const.TAMANHO;\r\n\t\t}\r\n\r\n\t\tif (Y < 0) {\r\n\t\t\tY = Const.TAMANHO - 1;\r\n\t\t} else {\r\n\t\t\tY = Y % Const.TAMANHO;\r\n\t\t}\r\n\t}", "public Position getPos() {\n\t\treturn coords;\n\t}", "@Override\n\tpublic List<DiscreteCoordinates> getCurrentCells() {\n\t\treturn Collections.singletonList(getCurrentMainCellCoordinates());\n\t}", "public Grid getEntrance(){\n\t\treturn getpos((byte)2);\n\t}", "public Point getLocation ( )\r\n\t{\r\n\t\treturn new Point ( currentCol, currentRow );\r\n\t}", "PVector _getCenter() {\n PVector cen = new PVector(_hitboxCenter.x, _hitboxCenter.y);\n cen.rotate(_rotVector.heading() - _front);\n cen.x += _x;\n cen.y += _y;\n return cen;\n }", "private double centerY() {\n return (piece.boundingBox().getHeight() % 2) / 2.0;\n }", "public double[] getCurrentMotorPositionsInCentimeters()\n {\n return finchController.getCurrentMotorPositionsInCentimeters();\n }", "private Entity ce() {\n return clientgui.getClient().getGame().getEntity(cen);\n }", "@Override\n\tpublic double getXLoc() {\n\t\tdouble side = Math.sqrt(getMySize())/2;\n\t\treturn x+side;\n\t}", "public Point getLocation() {\r\n return new Point((int)x,(int)y);\r\n }", "int getLatE6();", "int getLatE6();", "public void createCoord( CFWPoint poiCtI, CFWVector vecLookAtI)\t{\r\n\t\tm_poiCenter\t= poiCtI;\r\n\t\tvecLookAtI.nor();\r\n\t\t//look to the top\r\n\t\tCFWVector vecUp = new CFWVector();\r\n\t\tif(vecLookAtI.m_fY == 1.0f && vecLookAtI.m_fX == 0.0f && vecLookAtI.m_fZ == 0.0f)\r\n\t\t\tvecUp.m_fZ\t= 1.0f;\r\n\t\telse\r\n\t\t\tvecUp.m_fY\t= 1.0f;\r\n\t\t//\n\t\tCFWVector vecRight\t= vecLookAtI.cross(vecUp);\r\n\t\tm_vecAxis[0] = vecRight;\r\n\t\tm_vecAxis[1] = vecRight.cross(vecLookAtI);\r\n\t\tm_vecAxis[2] = vecLookAtI;\r\n\t\t\r\n\t\tm_bLeftH = true;\r\n\t}", "public int xCoordinate (double degLon){\n return (int) Math.round(degLon*earthRadiusRadians);\n }", "public Point getLocation() {\r\n\t\treturn this.center;\r\n\t}", "@Test\n public void testFind_East() {\n\n double lat1 = 0.0;\n double lon1 = 0.0;\n double lat2 = 0.0;\n double lon2 = 10.0;\n double expResult = Math.toRadians(90);\n double result = Azimuth.find(lat1, lon1, lat2, lon2);\n assertEquals(expResult, result, 0.0);\n }", "public PVector cohesion (ArrayList<Boid> boids) {\n float neighbordist = 50;\n PVector sum = new PVector(0, 0); // Start with empty vector to accumulate all positions\n int count = 0;\n for (Boid other : boids) {\n float d = PVector.dist(position, other.position);\n if ((d > 0) && (d < neighbordist)) {\n sum.add(other.position); // Add position\n count++;\n }\n }\n if (count > 0) {\n sum.div(count);\n return seek(sum); // Steer towards the position\n } else {\n return new PVector(0, 0);\n }\n }", "DVector3C getPosition();", "public Position<Arco<E>> getPosEnEntrante(){\r\n\t\treturn posV2;\r\n\t}", "public Point getCenter() {\n \treturn new Point(x+width/2,y+height/2);\n }", "public HashSet<CityByDegrees> getAdjacentCities() {\r\n\t\t\treturn this.adjacentCitySet;\r\n\t\t}", "public Location east()\r\n {\r\n // return new Location(x + 1, y);\r\n Location loc = new Location(x + 1, y);\r\n return loc;\r\n }", "public Coords getCoord() {\r\n\t\treturn coord;\r\n\t}", "public Coordinate getCoordinate() {\n\t\treturn super.listCoordinates().get(0);\n\t}" ]
[ "0.8273094", "0.59932625", "0.5990079", "0.5775645", "0.5765287", "0.5710493", "0.5662222", "0.565124", "0.56510097", "0.56487596", "0.5631289", "0.5631289", "0.5622029", "0.5579175", "0.55778444", "0.5564154", "0.55510104", "0.55120015", "0.5507308", "0.5497664", "0.54839486", "0.54570204", "0.54428583", "0.54241747", "0.5415768", "0.540403", "0.5389574", "0.53873724", "0.53731483", "0.5364901", "0.5362991", "0.53552747", "0.5347912", "0.5347912", "0.5333482", "0.5333482", "0.53271717", "0.5312841", "0.5309143", "0.5303781", "0.52918375", "0.5289151", "0.5289151", "0.5289151", "0.52871174", "0.5276594", "0.52758193", "0.52758193", "0.52743214", "0.52642345", "0.5253137", "0.52505046", "0.52483326", "0.524716", "0.5244629", "0.52445686", "0.5243563", "0.5239712", "0.5231331", "0.5228522", "0.52252233", "0.5216942", "0.5213864", "0.5213196", "0.5198377", "0.51853305", "0.51853305", "0.5185212", "0.5176993", "0.5176983", "0.5170892", "0.5166877", "0.51658416", "0.5162723", "0.51620793", "0.5161484", "0.5159684", "0.5156737", "0.51563734", "0.51524305", "0.5152424", "0.5144733", "0.5143051", "0.51416385", "0.51415145", "0.5135832", "0.5134791", "0.5134791", "0.5130749", "0.5130429", "0.51298875", "0.5129386", "0.51275873", "0.51274747", "0.5121089", "0.51162076", "0.51119155", "0.51050293", "0.5104507", "0.51027393" ]
0.8546594
0
Method info returning the name of the celestial object
public String info() { return name(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getObjectName();", "public String infoName();", "public java.lang.String getObjectName(){\n return localObjectName;\n }", "private String name() {\r\n return cls.getSimpleName() + '.' + mth;\r\n }", "protected String get_object_name() {\n\t\treturn this.name;\n\t}", "protected String get_object_name() {\n\t\treturn this.name;\n\t}", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();" ]
[ "0.76381373", "0.74883616", "0.71045935", "0.7104", "0.70372176", "0.70372176", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896", "0.70222896" ]
0.0
-1
Overrode method toString returning the name of the celestial object calling the method info()
@Override public String toString() { return info(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String toString(){\n return \"info\";\n }", "public String getInfo(){\n return \" name: \" + this.name;\n }", "public String toString() {return name;}", "public String toString(){\n return getName();\n }", "@Override \n public String toString() {\n return getName() + \"(\" + getClass().getName() + \")\";\n }", "public String toString()\r\n\t{\r\n\t\treturn getName();\r\n\t}", "public String toString() {\n return name();\n }", "public String toString() {\n return this.getName();\n }", "public String toString()\n {\n\treturn name;\n }", "public String infoName();", "public String toString() {\r\n\treturn name;\r\n }", "public String toString(){\n return this.name;\n }", "public String toString() {\n\t\treturn getName();\r\n\t}", "public String toString(){\n return name;\n }", "@Override\n public String toString(){\n return name;\n }", "public String toString()\n\t{\n\t\treturn name;\n\t}", "public String toString()\n\t{\n\t\treturn name;\n\t}", "public java.lang.String toString(){\n\t\treturn name;\n\t}", "public String toString() {\r\n\t\treturn name;\r\n\t}", "public String toString() {\r\n \t\treturn \"\\\"\" + _name + \"\\\" by \" + _creator;\r\n \t}", "@Override\n public String toString() {\n return getClass().getSimpleName() + \"[\" + _name + \"]\";\n }", "public String toString() {\n\t\treturn getName();\n\t}", "public String toString() {\n return getName();\n }", "@Override\n\tpublic String toString() {\n\t\treturn this.name();\n\t}", "@Override\n public String toString() {\n return this.name();\n }", "public String toString()\n {\n return name;\n }", "@ Override\n public final String toString() {\n return getName ( ) ;\n }", "@Override\r\n\tpublic String toString(){\r\n\t\treturn this.name;\r\n\t}", "@Override\n\t\tpublic String toString()\n\t\t{\n\t\t\treturn name;\n\t\t}", "@Override\r\n\tpublic String toString() {\n\t\treturn getName();\r\n\t}", "public String toString() {\n return this.getName();\n }", "public String toString() {\n return this.getName();\n }", "@Override\r\n\tpublic String toString() {\n\t\treturn name;\r\n\t}", "public String toString() {\n return getName();\n }", "public String toString() {\n return getName();\n }", "public String toString() {\n\t\treturn name;\n\t}", "public String toString() {\n\t\treturn name;\n\t}", "public String toString() {\n\t\treturn name;\n\t}", "@Override\n public final String toString() {\n return name;\n }", "@Override\n public final String toString() {\n return name;\n }", "public String toString() {\r\n return name;\r\n }", "public String toString() {\n\t\treturn getClass().getName();\n\t}", "public String toString()\n {\n return name;\n }", "public String toString()\n {\n return name;\n }", "public String toString()\n {\n return name;\n }", "public String toString()\n {\n return name;\n }", "public String info() {\n return name();\n }", "public String info() {\n return name();\n }", "@Override\n public String toString()\n {\n return (name);\n }", "public String toString()\n {\n return name;\n }", "public String toString()\n {\n return name;\n }", "public String toString() {return classSimpleName+\"#\"+name;}", "public String getInfoString();", "public String toString() {\r\n return this.name;\r\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\r\n\tpublic String toString() {\r\n\t\treturn name + \": \" + super.toString();\r\n\t}", "public String toString() { return kind() + \":\"+ text() ; }", "public String toString() {\r\n\t\treturn this.name;\r\n\t}", "@Override\r\n public String toString() {\r\n return name;\r\n }", "public String toString()\n {\n return \"\\nName: \" + name + \"\\n\";\n }", "@Override\n public String toString(){\n\n return this.getClass().getSimpleName();\n }", "public String toString()\n\t{\n\t\treturn this.name;\n\t}", "public String toString() {\n return name;\n }", "public String toString() {\n return name;\n }", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "public String toString(){\n return getName() + getDetails() + getPhone();\n }", "@Override\n\tpublic String toString() {\n\t\treturn getName();\n\t}", "public String toString() {\n return name;\n }", "public String toString() {\n return name;\n }", "public String toString() {\n return name;\n }", "public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return getName();\n }", "@Override\n public String toString() {\n return getName();\n }", "@Override\n public String toString() {\n return getName();\n }", "@Override\n public String toString() {\n return getName();\n }", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\n\t}", "public final String getInfo() {\r\n\t\treturn name;\r\n\t}", "@Override public String toString() {\n return name;\n }", "@Override\n\tpublic String toString() {\n\t\treturn String.format(\"%s\", getName());\n\t}", "@Override public String toString()\n {\n return name;\n }", "public String toString() {\n return this.name;\n }", "public String toString() {\n return this.name;\n }" ]
[ "0.81352973", "0.7836117", "0.77095824", "0.7707243", "0.7654894", "0.7631748", "0.7617088", "0.76127774", "0.76076585", "0.7606969", "0.75806", "0.75753844", "0.75398475", "0.7519906", "0.75181544", "0.75075907", "0.75075907", "0.7483716", "0.7482174", "0.74752104", "0.7474417", "0.7467709", "0.7464966", "0.7463426", "0.74631363", "0.7455698", "0.74373883", "0.74372584", "0.74308985", "0.74280006", "0.74163544", "0.74163544", "0.74151003", "0.7413101", "0.7413101", "0.74080443", "0.74080443", "0.74080443", "0.7405256", "0.7405256", "0.7400562", "0.7399294", "0.73957133", "0.73957133", "0.73957133", "0.73957133", "0.73931974", "0.73931974", "0.739199", "0.73842376", "0.73842376", "0.73789084", "0.73757", "0.7375522", "0.7365478", "0.7365478", "0.7365478", "0.7365478", "0.7365478", "0.7365478", "0.7365478", "0.7365478", "0.7365478", "0.7365478", "0.7365478", "0.7364942", "0.7363364", "0.7361502", "0.73545516", "0.7350221", "0.73456246", "0.73450136", "0.7343008", "0.7343008", "0.7341824", "0.7341824", "0.7341824", "0.7341824", "0.7341824", "0.7341824", "0.7341824", "0.7341824", "0.7341824", "0.7338404", "0.7337784", "0.73334056", "0.73334056", "0.73334056", "0.73334056", "0.733336", "0.733336", "0.733336", "0.733336", "0.7329062", "0.73289675", "0.7320064", "0.7313967", "0.7312395", "0.7307054", "0.7307054" ]
0.80300426
1
the value does not matter:
private void write(SidRegisterAddress reg) { o.reg(reg).write(UnsignedByte.x01); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getValue()\r\n/* 21: */ {\r\n/* 22: 71 */ return this.value;\r\n/* 23: */ }", "public int value() { \n return this.value; \n }", "public int getValue() {\n/* 450 */ return this.value;\n/* */ }", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\r\n\tpublic int operar() {\n\t\treturn 0;\r\n\t}", "@Override\n public int value() {\n return 0;\n }", "public String getValue() {\n/* 99 */ return this.value;\n/* */ }", "@Override\n\tpublic Value apprise() {\n\t\treturn null;\n\t}", "@Override\r\n\t\t\tpublic Object getValue() {\n\t\t\t\treturn null;\r\n\t\t\t}", "public Object currValue();", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "@Override\n public int getValue() {\n return super.getValue();\n }", "public int value(){\n return this.value;\n }", "@Override\r\n\tpublic int single() {\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic T somme() {\n\t\treturn val;\n\t}", "@Override\n public double getValue() {\n return 0;\n }", "public int value() \n {\n return value;\n }", "@Override\n\tpublic void initValue() {\n\t\t\n\t}", "@Override\n public int getAmount() {\n return 1;\n }", "@Override\r\n\t\tpublic long getValue() {\n\t\t\treturn -1;\r\n\t\t}", "@Override\r\n\tpublic void unsetGetValue() {\n\t\t\r\n\t}", "@Override\r\n\tpublic Integer getValue() {\n\t\treturn null;\r\n\t}", "private int getMY() {\n\t\treturn 0;\r\n\t}", "@Override\r\n\tpublic double alapterulet() {\n\t\treturn 0;\r\n\t}", "public Object getValue() { return _value; }", "@Override\n\tpublic Object getValue() {\n\t\treturn null;\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public int getValue() \n {\n return value;\n }", "public abstract Object getValue();", "public abstract Object getValue();", "public abstract Object getValue();", "String getCurrentValue();", "@Override\n public N value() {\n return value;\n }", "public boolean hasValue() { return false; }", "private Value() {\n\t}", "@Override\n\t\tpublic V setValue(V p1){\n\t\t\treturn p1;\n\t\t}", "public int getValue(){\n return this.value;\n }", "public void aendereWert (int value) {\n\t\tvalue = 0 ;\n\t}", "private void assignment() {\n\n\t\t\t}", "@Override\n public void func_104112_b() {\n \n }", "public Object getValue(){\n \treturn this.value;\n }", "@Override\n\tpublic void visit(NextValExpression arg0) {\n\t\t\n\t}", "@Override\n public Object getValue()\n {\n return value;\n }", "protected Object doGetValue() {\n\t\treturn value;\n\t}", "public abstract int getValue();", "public abstract int getValue();", "public abstract int getValue();", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "int getValue();", "int getValue();", "int getValue();", "int getValue();", "int getValue();", "public Object getValue()\n {\n\treturn value;\n }", "@Override\r\n\tpublic Value interpret() {\n\t\treturn null;\r\n\t}", "@Override\r\n public Object getValue() {\r\n return value;\r\n }", "boolean incLowValue() { return true; }", "protected abstract Set method_1559();", "public int\t\tget() { return value; }", "public int getValue() { return 42; }", "@Override\r\n\tpublic void unsetGiveValue() {\n\t\t\r\n\t}", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "@Override\r\n\tpublic void get() {\n\t\t\r\n\t}", "protected T getValue0() {\n\t\treturn value;\n\t}", "public S getValue() { return value; }", "public int getValue(){\n return value;\n }", "@Override\r\n\tpublic String getValue() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic String getValue() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic String getValue() {\n\t\treturn null;\r\n\t}", "public abstract void userValues();", "public abstract O value();", "public abstract int getPreferredValue();", "@Override\n\tpublic void one() {\n\t\t\n\t}", "synchronized byte getCurrentValueLo()\n {\n return (byte)getCurrentValue();\n }", "public A getValue() { return value; }", "public void dumpValue() {\n // an implementation is only needed for very large hashrecords\n }", "public Object getValue2() { return this.value2; }", "public Integer newValue(){\n\t\treturn 0;\r\n\t}", "@Override\n public int getAmount() {\n return 1;\n }", "public String getValor()\n/* 17: */ {\n/* 18:27 */ return this.valor;\n/* 19: */ }", "Object value();", "@Override\r\n\tprotected Object getValue(Object element) {\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic int sub() {\n\t\treturn 0;\r\n\t}", "@Override\n public double getValue()\n {\n return value;\n }", "public Object getValue() { return this.value; }", "public void addValue() {\n addValue(1);\n }", "@Override\n protected Integer compute() {\n\n\n return null;\n }", "@Override\n\tpublic String getValue() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getValue() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getValue() {\n\t\treturn null;\n\t}", "@Override\n public String toString() {\n \treturn String.valueOf(val);\n }", "@Override\n public String toString(){\n return String.valueOf(value);\n }", "private\tNum(int num) { value = num; }", "public void add1() {\r\n value++;\r\n }", "private byte getValue() {\n\t\treturn value;\n\t}" ]
[ "0.6215194", "0.61704975", "0.6170193", "0.6157538", "0.6146859", "0.6127785", "0.6044086", "0.6018205", "0.6002286", "0.5928022", "0.58968604", "0.5824529", "0.5819595", "0.58100045", "0.57906723", "0.5759151", "0.5744679", "0.5738304", "0.5706957", "0.57024074", "0.5700078", "0.56993514", "0.5699163", "0.5685664", "0.5685626", "0.56837636", "0.5674234", "0.56693375", "0.56650525", "0.56650525", "0.56650525", "0.565924", "0.5653407", "0.56487554", "0.5639296", "0.5638909", "0.5630227", "0.56098425", "0.55884403", "0.5585829", "0.55826724", "0.5575779", "0.55721176", "0.557019", "0.5564233", "0.5564233", "0.5564233", "0.556409", "0.5560269", "0.5560269", "0.5560269", "0.5560269", "0.5560269", "0.5555815", "0.5538195", "0.55225694", "0.5519801", "0.5511885", "0.55114543", "0.5510996", "0.55109894", "0.5510613", "0.5510613", "0.5510613", "0.5510613", "0.5510613", "0.5510613", "0.5510613", "0.55073917", "0.549471", "0.54933566", "0.54912364", "0.54901844", "0.54901844", "0.54901844", "0.54875374", "0.54829586", "0.5482344", "0.54796034", "0.5474837", "0.54682547", "0.54666984", "0.5463889", "0.5462912", "0.54595727", "0.54511386", "0.5445151", "0.5434537", "0.5433129", "0.5431971", "0.5431968", "0.54316723", "0.5430612", "0.542167", "0.542167", "0.542167", "0.54138273", "0.5408483", "0.53952086", "0.5378483", "0.5376276" ]
0.0
-1
Configure the options used in code generation
@Override protected void doInitializeOptions() { netPrinter.setOptions(getOptions()); childrenPrinter.setOptions(getOptions()); // Create the empty folders new File(outputPath, "bin").mkdir(); new File(outputPath, "build").mkdir(); // Configure the path where source files will be written srcPath = new File(outputPath, "src").toString(); // ----------------------------------------------------- // Transformations that will be applied on the Network // ----------------------------------------------------- networkTransfos.add(new Instantiator(!debug)); networkTransfos.add(new NetworkFlattener()); networkTransfos.add(new UnitImporter()); if (classify) { networkTransfos.add(new Classifier()); } if (mergeActions) { networkTransfos.add(new ActionMerger()); } if (mergeActors) { networkTransfos.add(new ActorMerger()); } if (convertMulti2Mono) { networkTransfos.add(new Multi2MonoToken()); } networkTransfos.add(new DisconnectedOutputPortRemoval()); networkTransfos.add(new TypeResizer(true, false, false, false)); networkTransfos.add(new StringTransformation()); networkTransfos.add(new DfVisitor<Expression>( new ShortCircuitTransformation())); networkTransfos.add(new DfVisitor<Void>(new SSATransformation())); networkTransfos.add(new DeadGlobalElimination()); networkTransfos.add(new DfVisitor<Void>(new DeadCodeElimination())); networkTransfos.add(new DfVisitor<Void>(new DeadVariableRemoval())); networkTransfos.add(new RenameTransformation(renameMap)); networkTransfos.add(new DfVisitor<Expression>(new TacTransformation())); networkTransfos.add(new DfVisitor<Void>(new CopyPropagator())); networkTransfos.add(new DfVisitor<Void>(new ConstantPropagator())); networkTransfos.add(new DfVisitor<Void>(new InstPhiTransformation())); networkTransfos.add(new DfVisitor<Expression>( new CastAdder(false, true))); networkTransfos.add(new DfVisitor<Void>(new EmptyBlockRemover())); networkTransfos.add(new DfVisitor<Void>(new BlockCombine())); networkTransfos.add(new DfVisitor<CfgNode>(new ControlFlowAnalyzer())); networkTransfos.add(new DfVisitor<Void>(new ListInitializer())); // computes names of local variables networkTransfos.add(new DfVisitor<Void>(new SSAVariableRenamer())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ConfigGeneratorApi(ToolOptions options) {\n super(options);\n }", "@Override\n @SuppressWarnings(\"static-access\")\n public void setJCLIOptions() {\n Option Help = new Option(\"h\", \"help\", false, \"Show Help.\");\n this.jcOptions.addOption(Help);\n this.jcOptions.addOption(OptionBuilder.withLongOpt(\"file\").withDescription(\"File to Convert\").isRequired(false).hasArg().create(\"f\"));\n //this.jcOptions.addOption(OptionBuilder.withLongOpt(\"outputfile\").withDescription(\"Output File\").isRequired(false).hasArg().create(\"of\"));\n OptionGroup jcGroup = new OptionGroup();\n jcGroup.addOption(OptionBuilder.withLongOpt(\"texttobinary\").withDescription(\"Convert text to Binary\").create(\"ttb\"));\n jcGroup.addOption(OptionBuilder.withLongOpt(\"binarytotext\").withDescription(\"Convert binary to text\").create(\"btt\"));\n this.jcOptions.addOptionGroup(jcGroup);\n }", "@Override\n protected void options()\n {\n super.options();\n addOption(Opt.APPLICATION_ID);\n addOption(Opt.SERVER_ID);\n addOption(Opt.CATEGORY);\n addOption(Opt.NAME, \"The name of the label\");\n }", "public ProfilingCompiler(Map<QNm, Str> options) {\n super(options);\n }", "public interface Options {\n\n /**\n * Returns true if Jasper issues a compilation error instead of a runtime\n * Instantiation error if the class attribute specified in useBean action\n * is invalid.\n */\n public boolean getErrorOnUseBeanInvalidClassAttribute();\n\n /**\n * Are we keeping generated code around?\n */\n public boolean getKeepGenerated();\n\n /**\n * Returns true if tag handler pooling is enabled, false otherwise.\n */\n public boolean isPoolingEnabled();\n\n /**\n * Are we supporting HTML mapped servlets?\n */\n public boolean getMappedFile();\n\n /**\n * Should errors be sent to client or thrown into stderr?\n */\n public boolean getSendErrorToClient();\n \n /**\n * Should we include debug information in compiled class?\n */\n public boolean getClassDebugInfo();\n\n /**\n * Background compile thread check interval in seconds\n */\n public int getCheckInterval();\n\n /**\n * Is Jasper being used in development mode?\n */\n public boolean getDevelopment();\n\n /**\n * Is the generation of SMAP info for JSR45 debugging suppressed?\n */\n public boolean isSmapSuppressed();\n\n /**\n * Indicates whether SMAP info for JSR45 debugging should be dumped to a\n * file.\n * Ignored is suppressSmap() is true\n */\n public boolean isSmapDumped();\n\n /**\n * Should white spaces between directives or actions be trimmed?\n */\n public boolean getTrimSpaces();\n\n /**\n * Class ID for use in the plugin tag when the browser is IE. \n */\n public String getIeClassId();\n\n /**\n * What is my scratch dir?\n */\n public File getScratchDir();\n\n /**\n * What classpath should I use while compiling the servlets\n * generated from JSP files?\n */\n public String getClassPath();\n\n // START PWC 1.2 6311155\n /**\n * Gets the system class path.\n *\n * @return The system class path\n */\n public String getSystemClassPath();\n // END PWC 1.2 6311155\n\n /**\n * Compiler to use.\n */\n public String getCompiler();\n\n /**\n * The compiler target VM, e.g. 1.1, 1.2, 1.3, 1.4, or 1.5.\n */\n public String getCompilerTargetVM();\n\n /**\n * Compiler source VM, e.g. 1.3, 1.4, or 1.5.\n */\n public String getCompilerSourceVM(); \n\n /**\n * The name of class that implements JavaCompiler, used for Java compilations.\n */\n public String getCompilerClassName();\n\n /**\n * The cache for the location of the TLD's\n * for the various tag libraries 'exposed'\n * by the web application.\n * A tag library is 'exposed' either explicitely in \n * web.xml or implicitely via the uri tag in the TLD \n * of a taglib deployed in a jar file (WEB-INF/lib).\n *\n * @return the instance of the TldScanner\n * for the web-application.\n */\n public TldScanner getTldScanner();\n\n /**\n * Java platform encoding to generate the JSP\n * page servlet.\n */\n public String getJavaEncoding();\n\n /**\n * boolean flag to tell Ant whether to fork JSP page compilations.\n */\n public boolean getFork();\n\n /**\n * Obtain JSP configuration informantion specified in web.xml. \n */\n public JspConfig getJspConfig();\n\n /**\n * Is generation of X-Powered-By response header enabled/disabled?\n */\n public boolean isXpoweredBy();\n\n /**\n * Obtain a Tag Plugin Manager\n */\n public TagPluginManager getTagPluginManager();\n\n /**\n * Are Text strings to be generated as char arrays?\n */\n public boolean genStringAsCharArray();\n\n /**\n * Are text strings to be generated as byte arrays, if the page is\n * unbuffered?\n */\n public boolean genStringAsByteArray();\n\n /**\n * If the buffer attribute for the page directive is not specified,\n * is the default \"none\"?\n */\n public boolean isDefaultBufferNone();\n\n /**\n * Modification test interval.\n */\n public int getModificationTestInterval();\n\n // BEGIN S1AS 6181923\n /**\n * Returns the value of the usePrecompiled (or use-precompiled) init\n * param.\n */\n public boolean getUsePrecompiled();\n // END S1AS 6181923\n\n // START SJSWS\n /**\n * Gets initial capacity of HashMap which maps JSPs to their corresponding\n * servlets.\n */\n public int getInitialCapacity();\n // END SJSWS \n\n // START SJSAS 6384538\n public boolean isValidationEnabled();\n // END SJSAS 6384538\n\n /**\n * If class files are generated as byte arrays, should they be saved to\n * disk at the end of compilations?\n */\n\n public boolean getSaveBytecode();\n\n}", "private Options() {\n }", "public void setConfiguration(CodeGeneratorConfiguration config) {\n \t\tthis.config = config;\n \t}", "private void setOptions() {\n cliOptions = new Options();\n cliOptions.addOption(Option.builder(\"p\")\n .required(false)\n .hasArg()\n .desc(\"Paramaters file\")\n .type(String.class)\n .build());\n cliOptions.addOption(Option.builder(\"P\")\n .required(false)\n .hasArg()\n .desc(\"Overwrite of one or more parameters provided by file.\")\n .type(String.class)\n .hasArgs()\n .build());\n cliOptions.addOption(Option.builder(\"H\")\n .required(false)\n .desc(\"Create a parameter file model on the classpath.\")\n .type(String.class)\n .build());\n }", "public Options() {\n init();\n }", "public void setOptions(Map options) {\n\t\t\r\n\t}", "public abstract OptionGroup getMapGeneratorOptions();", "public abstract OptionGroup getMapGeneratorOptions();", "void initialize(int options) {\n\n\t}", "protected void configure() {\n\t \n\t Configuration.BASE=true;\n\t Configuration.BASEMENUBAR=true;\n\t Configuration.BASETOOLBAR=true;\n\t Configuration.EDITMENUBAR=true;\n\t Configuration.EDITTOOLBAR=true;\n\t Configuration.FORMATMENUBAR=true;\n\t Configuration.FORMATTOOLBAR=true;\n\t Configuration.PERSISTENCEMENUBAR=true;\n\t Configuration.PERSISTENCETOOLBAR=true;\n\t Configuration.PRINTMENUBAR=true;\n\t Configuration.PRINTTOOLBAR=true;\n\t Configuration.SEARCHMENUBAR=true;\n\t Configuration.SEARCHTOOLBAR=true;\n\t Configuration.UNDOREDOMENUBAR=true;\n\t \t Configuration.UNDOREDOTOOLBAR=true;\n\t //\n\t Configuration.WORDCOUNTMENUBAR=true;\n\t Configuration.WORDCOUNTTOOLBAR=true;\n }", "private void prepareOptions() {\n CommandFactory\n .getInstance()\n .getCommands()\n .forEach((s, command) -> options.addOption(s, true, command.getDefinition()));\n }", "public void setOptions(int options) {\n\t\tthis.options = options;\n\t}", "abstract protected void setAdditionalOptionsImpl(@NotNull Project project, @NotNull Module module, @NotNull List<String> options);", "@Override\n\tpublic void setOptions(String[] options) throws Exception {\n\t\t\n\t}", "private void initOptions() {\n\t\t// TODO: ???\n\t\t// additional input docs via --dir --includes --excludes --recursive\n\t\t// --loglevel=debug\n\t\t// --optionally validate output as well?\n\t\t\n\t\tthis.sb = new StringBuffer();\n\t\tArrayList options = new ArrayList();\n\t\toptions.add( new LongOpt(\"help\", LongOpt.NO_ARGUMENT, null, 'h') );\n\t\toptions.add( new LongOpt(\"version\", LongOpt.NO_ARGUMENT, null, 'v') );\t\t\n\t\toptions.add( new LongOpt(\"query\", LongOpt.REQUIRED_ARGUMENT, sb, 'q') );\n\t\toptions.add( new LongOpt(\"base\", LongOpt.REQUIRED_ARGUMENT, sb, 'b') );\n\t\toptions.add( new LongOpt(\"var\", LongOpt.REQUIRED_ARGUMENT, sb, 'P') );\n\t\toptions.add( new LongOpt(\"out\", LongOpt.REQUIRED_ARGUMENT, sb, 'o') );\n\t\toptions.add( new LongOpt(\"algo\", LongOpt.REQUIRED_ARGUMENT, sb, 'S') );\n\t\toptions.add( new LongOpt(\"encoding\", LongOpt.REQUIRED_ARGUMENT, sb, 'E') );\n\t\toptions.add( new LongOpt(\"indent\", LongOpt.REQUIRED_ARGUMENT, sb, 'I') );\t\n\t\toptions.add( new LongOpt(\"strip\", LongOpt.NO_ARGUMENT, null, 's') );\t\t\n\t\toptions.add( new LongOpt(\"update\", LongOpt.REQUIRED_ARGUMENT, sb, 'u') );\t\n\t\toptions.add( new LongOpt(\"xinclude\", LongOpt.NO_ARGUMENT, null, 'x') );\t\t\n\t\toptions.add( new LongOpt(\"explain\", LongOpt.NO_ARGUMENT, null, 'e') );\n\t\toptions.add( new LongOpt(\"noexternal\", LongOpt.NO_ARGUMENT, null, 'n') );\t\t\n\t\toptions.add( new LongOpt(\"runs\", LongOpt.REQUIRED_ARGUMENT, sb, 'r') );\n\t\toptions.add( new LongOpt(\"iterations\", LongOpt.REQUIRED_ARGUMENT, sb, 'i') );\n\t\toptions.add( new LongOpt(\"docpoolcapacity\", LongOpt.REQUIRED_ARGUMENT, sb, 'C') );\n\t\toptions.add( new LongOpt(\"docpoolcompression\", LongOpt.REQUIRED_ARGUMENT, sb, 'D') );\n\t\toptions.add( new LongOpt(\"nobuilderpool\", LongOpt.NO_ARGUMENT, null, 'p') );\n\t\toptions.add( new LongOpt(\"debug\", LongOpt.NO_ARGUMENT, null, 'd') );\t\t\n\t\toptions.add( new LongOpt(\"validate\", LongOpt.REQUIRED_ARGUMENT, sb, 'V') ); \n\t\toptions.add( new LongOpt(\"namespace\", LongOpt.REQUIRED_ARGUMENT, sb, 'W') ); \n\t\toptions.add( new LongOpt(\"schema\", LongOpt.REQUIRED_ARGUMENT, sb, 'w') );\n\t\toptions.add( new LongOpt(\"filterpath\", LongOpt.REQUIRED_ARGUMENT, sb, 'f') );\n\t\toptions.add( new LongOpt(\"filterquery\", LongOpt.REQUIRED_ARGUMENT, sb, 'F') );\n\t\toptions.add( new LongOpt(\"xomxpath\", LongOpt.NO_ARGUMENT, null, 'N') );\t\t\n\t\t\n////\t\toptions.add( new LongOpt(\"loglevel\", LongOpt.REQUIRED_ARGUMENT, sb, 'l') ); setLogLevels(Level.INFO);\n\t\t\t\n\t\tthis.longOpts = new LongOpt[options.size()];\n\t\toptions.toArray(this.longOpts);\t\t\n\t}", "public abstract void setOptions(String[] options) throws Exception;", "private static void printRunOptions(){\n\t\tSystem.out.println(\"Run options:\");\n\t\tSystem.out.println(\" -simple <configFile> <pathToApplication> <synthesis(true/false)>\");\n\t\tSystem.out.println(\" -simpleSpeedup <configFile> <pathToApplication>\");\n\t\tSystem.out.println(\" -sweep <configFile> <pathToApplication> <sweepConfig> <parallelism(integer)> <synthesis(true/false)>\");\n\t\tSystem.out.println(\" -sweepRemote <configFile> <pathToApplication> <sweepConfig> <parallelism(integer)> <synthesis(true/false)> <hostAddress> <hostPort>\");\n\t\tSystem.out.println(\" -synthesize <configFile> <pathToApplication> <methodName> <scheduleCDFG(true/false)>\");\n\t\tSystem.out.println(\" -test <configFile> <pathToApplication>\");\n\t\tSystem.out.println(\" -speedup <configFile> <pathToApplication>\");\n\t\tSystem.out.println(\" -testCGRAVerilog <configFile> <pathToApplication>\");\n\t}", "public NationalAccountBenchmarkWebOptions() {\r\n super();\r\n\r\n }", "protected Options createOptions() {\n \treturn new Options(this) {\n\n\t\t\t/**\n\t\t\t * Appends the soot classpath to the default system classpath.\n\t\t\t */\n\t\t\tpublic String constructFullClasspath() {\n\t\t\t\tString cp = super.constructFullClasspath();\n\t\t\t\tcp += File.pathSeparator + soot.options.Options.v().soot_classpath();\n\t\t\t\treturn cp;\n\t\t\t}\n\n \t};\n }", "@Override\n\tpublic void setOptions(YamlDocumentOptions options) {\n\t\tsuper.setOptions(options);\n\t}", "public void setProperties() {\n\n Properties props = new Properties();\n props.setProperty(\"JOptExitCondition.JOptGenerationCount\", \"1000\");\n props.setProperty(\"JOpt.Algorithm.PreOptimization.SA.NumIterations\", \"1000\");\n\n // We have to tell the optimizer that we have an high interest in capacity planning, Default is\n // 100\n props.setProperty(\"JOptWeight.Capacity\", \"200\");\n this.addElement(props);\n }", "interface MozartExampleOptions extends MozartOptions {\n @Description(\"Path to the custom input file (customer data table)\")\n ValueProvider<String> getInputCustomDataFile();\n\n void setInputCustomDataFile(ValueProvider<String> value);\n\n @Description(\"Custom data column names\")\n ValueProvider<String> getCustomDataColumnNames();\n\n void setCustomDataColumnNames(ValueProvider<String> value);\n }", "public void printOptions() {\n\t\t\n\t}", "private static Options getOptions() {\n\t\tOptions options = new Options();\n\t\toptions.addOption(OptGenMode, \"generate\", false,\n\t\t\t\t\"generate private key sharing\");\n\t\toptions.addOption(\"h\", \"help\", false, \"Print help.\");\n\t\toptions.addOption(OptionBuilder.withType(Integer.class)\n\t\t\t\t.withLongOpt(\"shares\")\n\t\t\t\t.withDescription(\"number of shares to generate\").hasArg()\n\t\t\t\t.withArgName(\"int\").create(OptShares));\n\t\toptions.addOption(OptionBuilder.withType(Integer.class)\n\t\t\t\t.withLongOpt(\"threshold\")\n\t\t\t\t.withDescription(\"number of requires shares\").hasArg()\n\t\t\t\t.withArgName(\"int\").create(OptThreshold));\n\t\treturn options;\n\n\t}", "protected abstract void initializeOptions(Options options);", "public abstract IOptions newDocumentOptions();", "public void setOptions(final Properties options) {\n\t\tfinal Configuration config = new PropertiesConfiguration(options); //TODO switch to passing Configuration\n\t\tsetMakeFontSizesRelative(config.findBoolean(MAKE_FONT_SIZES_RELATIVE_OPTION).orElse(MAKE_FONT_SIZES_RELATIVE_OPTION_DEFAULT));\n\t\tsetRemoveMSOfficeProperties(config.findBoolean(REMOVE_MS_OFFICE_PROPERTIES_OPTION).orElse(REMOVE_MS_OFFICE_PROPERTIES_OPTION_DEFAULT));\n\t}", "go.micro.runtime.RuntimeOuterClass.CreateOptions getOptions();", "private static Options makeOptions() {\n\t\tOptions options = new Options();\n\n\t\tOption configOption = new Option(\"c\", \"config\", true, \"configuration file path\");\n\t\tconfigOption.setRequired(false);\n\t\tconfigOption.setArgName(\"file\");\n\t\toptions.addOption(configOption);\n\n\t\tOption debugOption = new Option(\"d\", \"debug\", false, \"debug mode\");\n\t\tdebugOption.setRequired(false);\n\t\toptions.addOption(debugOption);\n\n\t\tOption timingOption = new Option(\"t\", \"timing\", false, \"timing mode\");\n\t\ttimingOption.setRequired(false);\n\t\toptions.addOption(timingOption);\n\n\t\treturn options;\n\t}", "public static Options prepareOptions() {\n Options options = new Options();\n\n options.addOption(\"f\", \"forceDeleteIndex\", false,\n \"Force delete index if index already exists.\");\n options.addOption(\"h\", \"help\", false, \"Show this help information and exit.\");\n options.addOption(\"r\", \"realTime\", false, \"Keep for backwards compabitlity. No Effect.\");\n options.addOption(\"t\", \"terminology\", true, \"The terminology (ex: ncit_20.02d) to load.\");\n options.addOption(\"d\", \"directory\", true, \"Load concepts from the given directory\");\n options.addOption(\"xc\", \"skipConcepts\", false,\n \"Skip loading concepts, just clean stale terminologies, metadata, and update latest flags\");\n options.addOption(\"xm\", \"skipMetadata\", false,\n \"Skip loading metadata, just clean stale terminologies concepts, and update latest flags\");\n options.addOption(\"xl\", \"skipLoad\", false,\n \"Skip loading data, just clean stale terminologies and update latest flags\");\n options.addOption(\"xr\", \"report\", false, \"Compute and return a report instead of loading data\");\n\n return options;\n }", "@Test\n public void optionsTest() {\n // TODO: test options\n }", "public void setCommandLineGeneratorElement(IConfigurationElement element);", "protected BatchImageBuilder(StateImpl state, ConfigurableOption[] options) {\r\n\tfDC = (JavaDevelopmentContextImpl) state.getDevelopmentContext();\r\n\tstate.setCompilerOptions(options);\r\n\tfCompilerOptions = options;\r\n\tfNewState = state;\r\n\tfWorkQueue = new WorkQueue();\r\n}", "private static Options createOptions() {\n \n \t\tOptions options = new Options();\n \t\t\n \t\tOptionBuilder.withArgName(\"path\");\n \t\tOptionBuilder.hasArg(true);\n \t\tOptionBuilder.withDescription(\"path to the input file / directory\");\n \t\tOptionBuilder.isRequired(true);\n \t\toptions.addOption(OptionBuilder.create(\"input\"));\n \t\t\n \t\tOptionBuilder.withArgName(\"int\");\n \t\tOptionBuilder.hasArg(true);\n \t\tOptionBuilder.withDescription(\"minimum size of file in MB to split (Default: \" + MIN_FILE_SIZE + \" MB)\");\n \t\tOptionBuilder.isRequired(false);\n \t\toptions.addOption(OptionBuilder.create(\"minsize\"));\n \t\t\n \t\tOptionBuilder.withArgName(\"path\");\n \t\tOptionBuilder.hasArg(true);\n \t\tOptionBuilder.withDescription(\"path to the ignore list file\");\n \t\tOptionBuilder.isRequired(false);\n \t\toptions.addOption(OptionBuilder.create(\"ignore\"));\n \t\t\n \t\tOptionBuilder.withArgName(\"path\");\n \t\tOptionBuilder.hasArg(true);\n \t\tOptionBuilder.withDescription(\"path to the output directory\");\n \t\tOptionBuilder.isRequired(false);\n \t\toptions.addOption(OptionBuilder.create(\"output\"));\n \t\t\n \t\tOptionBuilder.withArgName(\"path\");\n \t\tOptionBuilder.hasArg(true);\n \t\tOptionBuilder.withDescription(\"path to the osmosis script template\");\n \t\tOptionBuilder.isRequired(false);\n \t\toptions.addOption(OptionBuilder.create(\"template\"));\n \t\t\n \t\treturn options;\n \t\t\n \t}", "Map getOptions();", "public void testOptions() {\n OptionsOperator optionsOper = OptionsOperator.invoke();\n optionsOper.selectEditor();\n optionsOper.selectFontAndColors();\n optionsOper.selectKeymap();\n optionsOper.selectGeneral();\n // \"Manual Proxy Setting\"\n String hTTPProxyLabel = Bundle.getStringTrimmed(\n \"org.netbeans.core.ui.options.general.Bundle\", \"CTL_Use_HTTP_Proxy\");\n new JRadioButtonOperator(optionsOper, hTTPProxyLabel).push();\n // \"HTTP Proxy:\"\n String proxyHostLabel = Bundle.getStringTrimmed(\n \"org.netbeans.core.ui.options.general.Bundle\", \"CTL_Proxy_Host\");\n JLabelOperator jloHost = new JLabelOperator(optionsOper, proxyHostLabel);\n new JTextFieldOperator((JTextField) jloHost.getLabelFor()).setText(\"www-proxy.uk.oracle.com\"); // NOI18N\n // \"Port:\"\n String proxyPortLabel = Bundle.getStringTrimmed(\n \"org.netbeans.core.ui.options.general.Bundle\", \"CTL_Proxy_Port\");\n JLabelOperator jloPort = new JLabelOperator(optionsOper, proxyPortLabel);\n new JTextFieldOperator((JTextField) jloPort.getLabelFor()).setText(\"80\"); // NOI18N\n optionsOper.ok();\n }", "public Options initOptions() {\n\n\t\tOptions privateOptions = new Options();\n\n\t\t//Algorithm options\n\t\t//Option algorithm = new Option(\"a\", \"algorithm\", true, \"Specify the algorithm to use during the alignment\");\n\t\t//algorithm.setArgName(\"mem | aln | bwasw\");\n\n\t\t//options.addOption(algorithm);\n\n\t\tOptionGroup algorithm = new OptionGroup();\n\n\t\tOption mem = new Option(\"m\",\"mem\", false,\"The MEM algorithm will be used\");\n\t\talgorithm.addOption(mem);\n\n\t\tOption aln = new Option(\"a\",\"aln\", false,\"The ALN algorithm will be used\");\n\t\talgorithm.addOption(aln);\n\n\t\tOption bwasw = new Option(\"b\", \"bwasw\", false, \"The bwasw algorithm will be used\");\n\t\talgorithm.addOption(bwasw);\n\n\t\tprivateOptions.addOptionGroup(algorithm);\n\n\t\t//Paired or single reads\n\t\t//Option reads = new Option(\"r\", \"reads\", true, \"Type of reads to use during alignment\");\n\t\t//reads.setArgName(\"paired | single\");\n\n\t\t//options.addOption(reads);\n\t\tOptionGroup reads = new OptionGroup();\n\n\t\tOption paired = new Option(\"p\", \"paired\", false, \"Paired reads will be used as input FASTQ reads\");\n\t\treads.addOption(paired);\n\n\t\tOption single = new Option(\"s\", \"single\", false, \"Single reads will be used as input FASTQ reads\");\n\t\treads.addOption(single);\n\n\t\tprivateOptions.addOptionGroup(reads);\n\n\t\t// Options to BWA\n\t\tOptionGroup bwaOptionsGroup = new OptionGroup();\n\t\tOption bwaArgs = new Option(\"w\", \"bwa\", true, \"Arguments passed directly to BWA\");\n\t\tbwaArgs.setArgName(\"\\\"BWA arguments\\\"\");\n\n\t\tbwaOptionsGroup.addOption(bwaArgs);\n\n\t\tprivateOptions.addOptionGroup(bwaOptionsGroup);\n\n\t\t//Index\n\t\tOptionGroup indexGroup = new OptionGroup();\n\t\tOption index = new Option(\"i\", \"index\", true, \"Prefix for the index created by bwa to use - setIndexPath(string)\");\n\t\tindex.setArgName(\"Index prefix\");\n\t\tindex.setRequired(true);\n\n\t\tindexGroup.addOption(index);\n\n\t\tprivateOptions.addOptionGroup(indexGroup);\n\n\t\t//Partition number\n\t\tOptionGroup sparkGroup = new OptionGroup();\n\t\tOption partitions = new Option(\"n\", \"partitions\", true,\n\t\t\t\t\"Number of partitions to divide input - setPartitionNumber(int)\");\n\t\tpartitions.setArgName(\"Number of partitions\");\n\n\t\tsparkGroup.addOption(partitions);\n\n\t\tprivateOptions.addOptionGroup(sparkGroup);\n\n\n\t\tOptionGroup reducerGroup = new OptionGroup();\n\t\tOption reducer = new Option(\"r\", \"reducer\", false, \"The program is going to merge all the final results in a reducer phase\");\n\n\t\treducerGroup.addOption(reducer);\n\n\t\tprivateOptions.addOptionGroup(reducerGroup);\n\n\t\t/* OptionGroup sorting = new OptionGroup();\n\n\t\tOption hdfs = new Option(\"f\", \"hdfs\", false, \"The HDFS is used to perform the input FASTQ reads sort\");\n\t\tsorting.addOption(hdfs);\n\n\t\tOption spark = new Option(\"k\", \"spark\", false, \"the Spark engine is used to perform the input FASTQ reads sort\");\n\t\tsorting.addOption(spark);\n\n\t\tprivateOptions.addOptionGroup(sorting);\n\t\t*/\n\t\t// Help\n\t\tOptionGroup helpGroup = new OptionGroup();\n\t\tOption help = new Option(\"h\", \"help\", false, \"Shows this help\");\n\n\t\thelpGroup.addOption(help);\n\n\t\tprivateOptions.addOptionGroup(helpGroup);\n\n\t\treturn privateOptions;\n\t}", "public void setOptions(java.util.Map<?,?> options) {\n\t}", "private void testInstanceOption() {\r\n\t\t\r\n\t\tString optionAllowObjects = AFD_FSDK_Library.OPTION_ALLOW_OBJECTS;\r\n\t\tString optionCallingConvention = AFD_FSDK_Library.OPTION_CALLING_CONVENTION;\r\n\t\tString optionClassLoader = AFD_FSDK_Library.OPTION_CLASSLOADER;\r\n\t\tString optionFuncitonMapper = AFD_FSDK_Library.OPTION_FUNCTION_MAPPER;\r\n\t\tString optionInvocationMapper = AFD_FSDK_Library.OPTION_INVOCATION_MAPPER;\r\n\t\tString optionOpenFlags = AFD_FSDK_Library.OPTION_OPEN_FLAGS;\r\n\t\tString optionStringEncoding = AFD_FSDK_Library.OPTION_STRING_ENCODING;\r\n\t\tString optionStructureAlignment = AFD_FSDK_Library.OPTION_STRUCTURE_ALIGNMENT;\r\n\t\tString optionTypeMapper = AFD_FSDK_Library.OPTION_TYPE_MAPPER;\r\n\t\t\r\n\t\tSystem.out.println(\"OPTION_ALLOW_OBJECTS: \" + optionAllowObjects);\r\n\t\tSystem.out.println(\"OPTION_CALLING_CONVENTION: \" + optionCallingConvention);\r\n\t\tSystem.out.println(\"OPTION_CLASSLOADER: \" + optionClassLoader);\r\n\t\tSystem.out.println(\"OPTION_FUNCTION_MAPPER: \" + optionFuncitonMapper);\r\n\t\tSystem.out.println(\"OPTION_INVOCATION_MAPPER: \" + optionInvocationMapper);\r\n\t\tSystem.out.println(\"OPTION_OPEN_FLAGS: \" + optionOpenFlags);\r\n\t\tSystem.out.println(\"OPTION_STRING_ENCODING: \" + optionStringEncoding);\r\n\t\tSystem.out.println(\"OPTION_STRUCTURE_ALIGNMENT: \" + optionStructureAlignment);\r\n\t\tSystem.out.println(\"OPTION_TYPE_MAPPER: \" + optionTypeMapper);\r\n\t}", "public void printOptions() {\n String indent = \" \";\n System.out.println();\n System.out.println(\"+--------------------------- COMMANDS AND OPTIONS LIST ---------------------------+\");\n\n System.out.println();\n System.out.println(\"******* COMMANDS (scraper.[COMMAND]) *******\");\n System.out.println(\"The following interact with the RegistrationScraper class\");\n System.out.println();\n \n\n System.out.println();\n System.out.println(\"iterateAll() --> Scrape every SDSU department's class and store the data [Recommended before: printDepartmentCourses()]\");\n System.out.println(indent + \"@usage iterateAll()\");\n\n System.out.println();\n System.out.println(\"iterateOne() --> Scrape ONE department's class and store the data [Recommended before: printDepartmentCourses()]\");\n System.out.println(indent + \"@usage iterateOne(\\\"CS\\\")\");\n System.out.println(indent + \"@param department\");\n\n System.out.println();\n System.out.println(\"printDepartmentCourses() --> Display a formatted list of every stored class so far\");\n System.out.println(indent + \"@usage printDepartmentCourses()\");\n\n System.out.println();\n System.out.println(\"printArrListSizes() --> Display the sizes of all the data (to make sure they're all the same length)\");\n System.out.println(indent + \"@usage printArrListSizes()\");\n \n\n System.out.println();\n System.out.println(\"******* OPTIONS (custom.[COMMAND] *******\");\n System.out.println(\"The following interact with the HTML GET method\");\n System.out.println();\n \n\n System.out.println();\n System.out.println(\"setTerm() --> Set the semester term you want to search\");\n System.out.println(indent + \"@usage setTerm(\\\"Summer\\\", \\\"2017\\\")\");\n System.out.println(indent + \"@param season\");\n System.out.println(indent + indent + \"options: Fall, Spring, Winter, Summer\");\n System.out.println(indent + \"@param year\");\n System.out.println(indent + indent + \"options: 2015, 2016, 2017, etc.\");\n\n System.out.println();\n System.out.println(\"setDepartment() --> Set a single department you wish to search (use with iterateOne())\");\n System.out.println(indent + \"@usage setDepartment(\\\"CS\\\")\");\n System.out.println(indent + \"@param department\");\n System.out.println(indent + indent + \"options: AMIND, BIOL, CS, etc.\");\n\n System.out.println();\n System.out.println(\"setInstructor() --> Set the course number you want to return (ex. all \\\"xx-108\\\" classes)\");\n System.out.println(indent + \"@usage setInstructor(\\\"Kraft\\\")\");\n System.out.println(indent + \"@param last name\");\n\n System.out.println();\n System.out.println(\"setCourseNumber() --> Set the course number you want to return (ex. all \\\"xx-108\\\" classes)\");\n System.out.println(indent + \"@usage setCourseNumber(\\\"108\\\")\");\n System.out.println(indent + \"@param number\");\n\n System.out.println();\n System.out.println(\"setCourseNumber() --> Set the course number AND suffic you want to return (ex. all \\\"xx-451A\\\" classes)\");\n System.out.println(indent + \"@usage setTerm(\\\"451\\\", \\\"A\\\")\");\n System.out.println(indent + \"@param number\");\n System.out.println(indent + \"@param suffix\");\n System.out.println(indent + indent + \"options: A, B, C, etc.\");\n\n System.out.println();\n System.out.println(\"setScheduleNumber() --> Set the specific class you want to return\");\n System.out.println(indent + \"@usage setScheduleNumber(\\\"20019\\\")\");\n System.out.println(indent + \"@param number\");\n\n System.out.println();\n System.out.println(\"setUnits() --> Set the specific number of units\");\n System.out.println(indent + \"@usage setUnits(\\\"3\\\")\");\n System.out.println(indent + \"@param units\");\n\n System.out.println();\n System.out.println(\"setLocation() --> Set the facility location of the class\");\n System.out.println(indent + \"@usage setUnits(\\\"GMCS\\\")\");\n System.out.println(indent + \"@param facility\");\n\n System.out.println();\n System.out.println(\"setLocation() --> Set the facility AND room location of the class\");\n System.out.println(indent + \"@usage setUnits(\\\"GMCS\\\", \\\"311\\\")\");\n System.out.println(indent + \"@param facility\");\n System.out.println(indent + \"@param room number\");\n\n System.out.println();\n System.out.println(\"setServiceLearning() --> Toggle the 'Service Learning' option [only show Service Learning classes]\");\n System.out.println(indent + \"@usage setServiceLearning(true)\");\n System.out.println(indent + \"@param true/false\");\n\n System.out.println();\n System.out.println(\"setSpecialTopics() --> Toggle the 'Special Topics' option [only show Special Topics classes]\");\n System.out.println(indent + \"@usage setSpecialTopics(true)\");\n System.out.println(indent + \"@param true/false\");\n\n System.out.println();\n System.out.println(\"setHonors() --> Toggle the 'Honors' option [only show Honors classes]\");\n System.out.println(indent + \"@usage setHonors(true)\");\n System.out.println(indent + \"@param true/false\");\n \n System.out.println();\n System.out.println(\"setDistanceOnline() --> Toggle the 'Distance Online' option [only show Online classes]\");\n System.out.println(indent + \"@usage setDistanceOnline(true)\");\n System.out.println(indent + \"@param true/false\");\n\n System.out.println();\n System.out.println(\"setDistanceHybrid() --> Toggle the 'Distance Hybrid' option [only show Hybrid classes]\");\n System.out.println(indent + \"@usage setDistanceHybrid(true)\");\n System.out.println(indent + \"@param true/false\");\n\n System.out.println();\n System.out.println(\"setEvening() --> Toggle the 'Evening' option [only show Evening classes]\");\n System.out.println(indent + \"@usage setEvening(true)\");\n System.out.println(indent + \"@param true/false\");\n\n System.out.println();\n System.out.println(\"setMeetingType() --> Set your preferred meeting type\");\n System.out.println(indent + \"@usage setMeetingType(\\\"Lecture\\\")\");\n System.out.println(indent + \"@param type\");\n System.out.println(indent + indent + \"@options Activity, Discussion, Labratory, Lecture, \"+\n \"Nontraditional, ROTC, Seminar, Supervised\");\n \n System.out.println();\n System.out.println(\"setGenEd() --> Set the General Education requirements you want to show\");\n System.out.println(indent + \"@usage setGenEd(\\\"IIA2\\\")\");\n System.out.println(indent + \"@param true/false\");\n System.out.println(indent + indent + \"@options see general catalog\");\n\n System.out.println();\n System.out.println(\"setSession() --> Set the Summer Session you want to show\");\n System.out.println(indent + \"@usage setGenEd(\\\"S1\\\")\");\n System.out.println(indent + \"@param session\");\n System.out.println(indent + indent + \"@options S1, S2, T1\");\n\n System.out.println();\n System.out.println(\"+---------------------------------------------------------------------------------+\");\n System.out.println();\n\n }", "public BwaOptions() {\n\t}", "ModuleOption option();", "public BuilderOptions(String[][] options) {\r\n this.options = options;\r\n }", "public abstract Builder options(RequestMappingInfo.BuilderConfiguration paramBuilderConfiguration);", "go.micro.runtime.RuntimeOuterClass.UpdateOptions getOptions();", "public Option() {\n setAutoFields();\n }", "OPTION createOPTION();", "private HashMap initCommonOpts() {\n HashMap _opts = new HashMap();\n \n _opts.put(\"help\", \n new Option(\"h\", \"help\", false, \"Get help.\")\n );\n _opts.put(\"version\",\n new Option(\"v\", \"version\", false, \"Print version number and exit.\")\n );\n _opts.put(\"system\",\n OptionBuilder\n .withLongOpt( \"system\" )\n .withDescription(\"Use the given filename or system identifier to find the DTD. \" +\n \"This could be a relative \" +\n \"pathname, if the DTD exists in a file on your system, or an HTTP URL. \" +\n \"The '-s' switch is optional. \" +\n \"Note that if a catalog is in use, what looks like a filename might \" +\n \"resolve to something else entirely.\")\n .hasArg()\n .withArgName(\"system-id\")\n .create('s')\n );\n _opts.put(\"doc\",\n OptionBuilder\n .withLongOpt( \"doc\" )\n .withDescription(\"Specify an XML document used to find the DTD. This could be just a \\\"stub\\\" \" +\n \"file, that contains nothing other than the doctype declaration and a root element. \" +\n \"This file doesn't need to be valid according to the DTD.\")\n .hasArg()\n .withArgName(\"xml-file\")\n .create('d')\n );\n _opts.put(\"public\",\n OptionBuilder\n .withLongOpt( \"public\" )\n .withDescription(\"Use the given public identifier to find the DTD. This would be used in \" +\n \"conjunction with an OASIS catalog file.\")\n .hasArg()\n .withArgName(\"public-id\")\n .create('p')\n );\n _opts.put(\"catalog\",\n OptionBuilder\n .withLongOpt( \"catalog\" )\n .withDescription(\"Specify a file to use as the OASIS catalog, to resolve system and \" +\n \"public identifiers.\")\n .hasArg()\n .withArgName(\"catalog-file\")\n .create('c')\n );\n _opts.put(\"title\",\n OptionBuilder\n .withLongOpt( \"title\" )\n .withDescription(\"Specify the title of this DTD.\")\n .hasArg()\n .withArgName(\"dtd-title\")\n .create('t')\n );\n _opts.put(\"roots\",\n OptionBuilder\n .withLongOpt(\"roots\")\n .withDescription(\"Specify the set of possible root elements for documents conforming \" +\n \"to this DTD.\")\n .hasArg()\n .withArgName(\"roots\")\n .create('r')\n );\n _opts.put(\"docproc\",\n OptionBuilder\n .withLongOpt(\"docproc\")\n .withDescription(\"Command to use to process structured comments. This command should \" +\n \"take its input on stdin, and produce valid XHTML on stdout.\")\n .hasArg()\n .withArgName(\"cmd\")\n .create()\n );\n _opts.put(\"markdown\",\n OptionBuilder\n .withLongOpt(\"markdown\")\n .withDescription(\"Causes structured comments to be processed as Markdown. \" +\n \"Requires pandoc to be installed on the system, and accessible to this process. \" +\n \"Same as \\\"--docproc pandoc\\\". If you want to supply your own Markdown \" +\n \"processor, or any other processor, use the --docproc option.\")\n .create('m')\n );\n _opts.put(\"param\",\n OptionBuilder\n .withLongOpt(\"param\")\n .hasArgs(2)\n .withValueSeparator()\n .withDescription(\"Parameter name & value to pass to the XSLT. You can use multiple \" +\n \"instances of this option.\")\n .withArgName( \"param=value\" )\n .create('P')\n );\n\n /* \n The 'q' here is a hack to get around some weird behavior that I can't figure out.\n If the 'q' is omitted, this option just doesn't work.\n */\n _opts.put(\"debug\",\n OptionBuilder\n .withLongOpt(\"debug\")\n .withDescription(\"Turns on debugging.\")\n .create('q')\n );\n\n return _opts;\n }", "static void setDefaultProperties() {\n properties.put(\"VERSION\", \"6\");\n\n // Directories and file names\n properties.put(\"SOURCE_DIRECTORY\", \"jspin-examples\");\n properties.put(\"C_COMPILER\", \"clang\");\n properties.put(\"SPIN\", \"/home/victor/Spin/spin\");\n properties.put(\"PAN\", \"pan\");\n properties.put(\"DOT\", \"dot\");\n properties.put(\"HELP_FILE_NAME\", \"txt\" + sep + \"help.txt\");\n properties.put(\"ABOUT_FILE_NAME\", \"txt\" + sep + \"copyright.txt\");\n\n // Options for executing Spin\n properties.put(\"SINGLE_QUOTE\", Boolean.toString(false));\n properties.put(\"COMMON_OPTIONS\", \"-g -l -p -r -s\");\n // Check options changed for version 6 (for now)\n // properties.put(\"CHECK_OPTIONS\", \"-a -v\");\n properties.put(\"CHECK_OPTIONS\", \"-a\");\n properties.put(\"RANDOM_OPTIONS\", \"-X\");\n properties.put(\"INTERACTIVE_OPTIONS\", \"-i -X\");\n properties.put(\"VERIFY_OPTIONS\", \"-a\");\n properties.put(\"C_COMPILER_OPTIONS\", \"-o pan pan.c\");\n properties.put(\"PAN_OPTIONS\", \"-X\");\n properties.put(\"TRAIL_OPTIONS\", \"-t -X\");\n properties.put(\"TRANSLATE_OPTIONS\", \"-f\");\n\n // Settings\n properties.put(\"MAX_STEPS\", \"250\");\n properties.put(\"MAX_DEPTH\", \"2000\");\n properties.put(\"SEED\", \"0\");\n properties.put(\"NEGATE_LTL\", Boolean.toString(true));\n properties.put(\"FAIRNESS\", Boolean.toString(true));\n properties.put(\"VERIFY_MODE\", Safety);\n properties.put(\"RAW\", Boolean.toString(false));\n properties.put(\"PROCESS_WIDTH\", Integer.toString(7));\n properties.put(\"STATEMENT_WIDTH\", Integer.toString(18));\n properties.put(\"VARIABLE_WIDTH\", Integer.toString(10));\n properties.put(\"LINES_PER_TITLE\", Integer.toString(20));\n\n // Size of main frame\n properties.put(\"WIDTH\", Integer.toString(1000));\n properties.put(\"HEIGHT\", Integer.toString(700));\n\n // Select dialog\n properties.put(\"SELECT_BUTTON\", Integer.toString(220));\n properties.put(\"SELECT_HEIGHT\", Integer.toString(70));\n properties.put(\"SELECT_MENU\", Integer.toString(5));\n properties.put(\"UNEXECUTABLE\", Boolean.toString(false));\n\n // Location of dividers in JSplitPanes: Left-right and top-bottom\n properties.put(\"LR_DIVIDER\", Integer.toString(400));\n properties.put(\"TB_DIVIDER\", Integer.toString(500));\n properties.put(\"MIN_DIVIDER\", Integer.toString(50));\n\n // Font\n properties.put(\"FONT_FAMILY\", \"Lucida Sans Typewriter\");\n properties.put(\"FONT_STYLE\", Integer.toString(java.awt.Font.PLAIN));\n properties.put(\"FONT_SIZE\", Integer.toString(14));\n\n // Tab size in editor\n properties.put(\"TAB_SIZE\", Integer.toString(4));\n\n // Display of Spin output\n properties.put(\"WRAP\", Boolean.toString(true));\n properties.put(\"MSC\", Boolean.toString(false));\n properties.put(\"PROCESS_TITLE\", \"Process \");\n properties.put(\"STATEMENT_TITLE\", \"Statement \");\n\n // Delay while waiting for user input\n properties.put(\"POLLING_DELAY\", Integer.toString(200));\n }", "public static Options getCmdLineOptions(){\n\t\tOptions options = new Options();\n\t\t//\t\toptions.addOption(OptionBuilder.withArgName(\"outputPath\").hasArg().withDescription(\"output sequence lengths to a file [if not specified, lengths are printed to stdout]\").create(Thunder.OPT_PATH_OUTPUT));\n\t\t//\t\toptions.addOption(OptionBuilder.withArgName(\"maxExpectedLength\").hasArg().withDescription(\"print sequences exceeding this maximum expected size (for debugging + QC)\").create(\"m\"));\n\t\treturn options;\n\t}", "public void initOptions(String[] args) {\n\t\tCL_Initializer.CL_init(args);\n\t\tCL_Initializer.checkParsing(args);\n\t\tCL_Initializer.initImagingScheme();\n\t\tCL_Initializer.initDataSynthesizer();\n\t}", "public CompilationBuilder setOptimizationOptions(Map<String, Boolean> options) {\n\t\tcompilerConfiguration.setOptimizationOptions(options);\n\t\treturn this;\n\t}", "go.micro.runtime.RuntimeOuterClass.ListOptions getOptions();", "public free_args setOptions(FreeTOptions options) {\n this.options = options;\n return this;\n }", "T setJavaOptions(List<String> javaOptions);", "public void setOptions(SourcletOptions options) {\n this.options=options;\n }", "void setConfiguration();", "protected void DefineFlag()\n {\n String flagStr = \"-ci -d -h -hs -i:STR -n -o:STR -p -s:STR -t:INT -ti -v -x:STR\";\n \n // init the system option\n systemOption_ = new Option(flagStr);\n // Add the full name for flags\n systemOption_.SetFlagFullName(\"-ci\", \"Print_Config_Info\");\n systemOption_.SetFlagFullName(\"-d\", \"Print_Operation_Details\");\n systemOption_.SetFlagFullName(\"-h\", \"Help\");\n systemOption_.SetFlagFullName(\"-hs\", \"Hierarchy_Struture\");\n systemOption_.SetFlagFullName(\"-i\", \"Input_File\");\n systemOption_.SetFlagFullName(\"-n\", \"No_Output\");\n systemOption_.SetFlagFullName(\"-o\", \"Output_File\");\n systemOption_.SetFlagFullName(\"-p\", \"Show_Prompt\");\n systemOption_.SetFlagFullName(\"-s\", \"Field_Separator\");\n systemOption_.SetFlagFullName(\"-t\", \"Term_Field\");\n systemOption_.SetFlagFullName(\"-ti\", \"Display_Filtered_Input\");\n systemOption_.SetFlagFullName(\"-v\", \"Version\");\n systemOption_.SetFlagFullName(\"-x\", \"Load_Configuration_file\");\n }", "public static void initDefaultOptions()\r\n\t{\n\r\n\t\taddOption(HELP, true, \"show Arguments\");\r\n\t}", "@Configuration\n public Option[] configuration() {\n SlingOptions.versionResolver.setVersionFromProject(\"org.apache.sling\", \"org.apache.sling.distribution.core\");\n SlingOptions.versionResolver.setVersionFromProject(\"org.apache.sling\", \"org.apache.sling.distribution.api\");\n SlingOptions.versionResolver.setVersionFromProject(\"org.apache.jackrabbit.vault\",\"org.apache.jackrabbit.vault\");\n return new Option[]{\n baseConfiguration(),\n slingQuickstart(),\n logback(),\n // build artifact\n slingDistribution(),\n // testing\n defaultOsgiConfigs(),\n SlingOptions.webconsole(),\n CoreOptions.mavenBundle(\"org.apache.felix\", \"org.apache.felix.webconsole.plugins.ds\", \"2.0.8\"),\n junitBundles()\n };\n }", "public void setOptions(){\n System.out.println(\"¿Que operacion desea realizar?\");\n System.out.println(\"\");\n System.out.println(\"1- Consultar sus datos\");\n System.out.println(\"2- Ingresar\");\n System.out.println(\"3- Retirar\");\n System.out.println(\"4- Transferencia\");\n System.out.println(\"5- Consultar saldo\");\n System.out.println(\"6- Cerrar\");\n System.out.println(\"\");\n}", "private void tweakPlatformDefaults() {\n if (PlatformUtils.isAppCode()) {\n SHOW_MAIN_TOOLBAR = false;\n SHOW_ICONS_IN_MENUS = false;\n SHOW_MEMORY_INDICATOR = false;\n }\n }", "void configure();", "public static Options createOptions() {\n Options options = new Options();\n options.addOption(Option.builder(\"i\").required(true).longOpt(\"inputFile\").hasArg(true)\n .argName(\"PATH\").desc(\"this command specifies the path to the file \"\n + \"containing queries to be inputted into the tool. It is therefore mandatory\")\n .build());\n options.addOption(Option.builder(\"o\").longOpt(\"outputFile\").hasArg(true).argName(\"PATH\")\n .desc(\"this command specifies the path to the file that the tool can write \"\n + \"its results to. If not specified, the tool will simply print results\"\n + \"on the console. It is therefore optional\").build());\n options.addOption(Option.builder(\"l\").longOpt(\"limit\").hasArg(true).argName(\"INTEGER\")\n .desc(\"this command specifies the path to an integer that the tools takes \"\n + \"as a limit for the number of errors to be explored, thereby controlling\"\n + \"the runtime. It is therefore optional\").build());\n return options;\n }", "@Nonnull\n private static GetFileAnnotationsOptions getFileAnnotationOptions() {\n\tGetFileAnnotationsOptions options = new GetFileAnnotationsOptions();\n\toptions.setUseChangeNumbers(true);\n\toptions.setFollowBranches(true);\n\toptions.setIgnoreWhitespaceChanges(true);\n\treturn options;\n }", "public CopsOptionParser() {\n\t\tsuper();\n\t\taddOption(HELP);\n\t\taddOption(SCENARIO);\n\t\taddOption(VALIDATE_ONLY);\n\t\taddOption(CONF);\n\n\t}", "public abstract Builder setBaseOptions(BaseOptions value);", "interface WithCustomToolkitSettings {\n /**\n * Specifies customToolkitSettings.\n * @param customToolkitSettings the customToolkitSettings parameter value\n * @return the next definition stage\n */\n WithCreate withCustomToolkitSettings(CustomToolkitSettings customToolkitSettings);\n }", "public static Options addOptions() {\n Options options = new Options();\n options.addOption(\"f\", true, \"The input file \");\n options.addOption(\"d\", true, \"The output directory\");\n options.addOption(\"u\", true, \"Only uber retrieval value is (1,0) default 0\");\n options.addOption(\"l\",true,\"Only Lyft Retrieval value is (1,0) default 0\");\n return options;\n }", "void\t\tsetCommandOptions(String command, Strings options);", "public List<String> getOptions() {\n List<String> options = new ArrayList<String>();\n if (!showWarnings) {\n options.add(\"-nowarn\");\n }\n addStringOption(options, \"-source\", source);\n addStringOption(options, \"-target\", target);\n addStringOption(options, \"--release\", release);\n addStringOption(options, \"-encoding\", encoding);\n return options;\n }", "@Override\n\tpublic YamlDocumentOptions options() {\n\t\treturn super.options();\n\t}", "@Parameterized.Parameters(name = \"{0}\")\n public static Collection<Object[]> algoOptions() {\n CarFlagEncoder encoder = new CarFlagEncoder();\n GraphHopper hopper = new GraphHopperOSM();\n hopper.setDataReaderFile(\"../map-data/leipzig_germany.osm.pbf\");\n hopper.setGraphHopperLocation(\"../target/mapmatchingtest-ch\");\n hopper.setEncodingManager(new EncodingManager(encoder));\n hopper.getCHFactoryDecorator().setDisablingAllowed(true);\n hopper.importOrLoad();\n\n // force CH\n AlgorithmOptions chOpts = AlgorithmOptions.start()\n .maxVisitedNodes(1000)\n .hints(new PMap().put(Parameters.CH.DISABLE, false))\n .build();\n\n // flexible should fall back to defaults\n AlgorithmOptions flexibleOpts = AlgorithmOptions.start()\n // TODO: fewer nodes than for CH are possible (short routes & different finish condition & higher degree graph)\n // .maxVisitedNodes(20)\n .build();\n\n return Arrays.asList(new Object[][]{\n {\"non-CH\", hopper, flexibleOpts},\n {\"CH\", hopper, chOpts}\n });\n }", "public final ANTLRv3Parser.optionsSpec_return optionsSpec() throws RecognitionException {\r\n ANTLRv3Parser.optionsSpec_return retval = new ANTLRv3Parser.optionsSpec_return();\r\n retval.start = input.LT(1);\r\n\r\n\r\n CommonTree root_0 = null;\r\n\r\n Token OPTIONS28=null;\r\n Token char_literal30=null;\r\n Token char_literal31=null;\r\n ANTLRv3Parser.option_return option29 =null;\r\n\r\n\r\n CommonTree OPTIONS28_tree=null;\r\n CommonTree char_literal30_tree=null;\r\n CommonTree char_literal31_tree=null;\r\n RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,\"token 92\");\r\n RewriteRuleTokenStream stream_OPTIONS=new RewriteRuleTokenStream(adaptor,\"token OPTIONS\");\r\n RewriteRuleTokenStream stream_76=new RewriteRuleTokenStream(adaptor,\"token 76\");\r\n RewriteRuleSubtreeStream stream_option=new RewriteRuleSubtreeStream(adaptor,\"rule option\");\r\n try {\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:138:2: ( OPTIONS ( option ';' )+ '}' -> ^( OPTIONS ( option )+ ) )\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:138:4: OPTIONS ( option ';' )+ '}'\r\n {\r\n OPTIONS28=(Token)match(input,OPTIONS,FOLLOW_OPTIONS_in_optionsSpec738); if (state.failed) return retval; \r\n if ( state.backtracking==0 ) stream_OPTIONS.add(OPTIONS28);\r\n\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:138:12: ( option ';' )+\r\n int cnt13=0;\r\n loop13:\r\n do {\r\n int alt13=2;\r\n int LA13_0 = input.LA(1);\r\n\r\n if ( (LA13_0==RULE_REF||LA13_0==TOKEN_REF) ) {\r\n alt13=1;\r\n }\r\n\r\n\r\n switch (alt13) {\r\n \tcase 1 :\r\n \t // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:138:13: option ';'\r\n \t {\r\n \t pushFollow(FOLLOW_option_in_optionsSpec741);\r\n \t option29=option();\r\n\r\n \t state._fsp--;\r\n \t if (state.failed) return retval;\r\n \t if ( state.backtracking==0 ) stream_option.add(option29.getTree());\r\n\r\n \t char_literal30=(Token)match(input,76,FOLLOW_76_in_optionsSpec743); if (state.failed) return retval; \r\n \t if ( state.backtracking==0 ) stream_76.add(char_literal30);\r\n\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t if ( cnt13 >= 1 ) break loop13;\r\n \t if (state.backtracking>0) {state.failed=true; return retval;}\r\n EarlyExitException eee =\r\n new EarlyExitException(13, input);\r\n throw eee;\r\n }\r\n cnt13++;\r\n } while (true);\r\n\r\n\r\n char_literal31=(Token)match(input,92,FOLLOW_92_in_optionsSpec747); if (state.failed) return retval; \r\n if ( state.backtracking==0 ) stream_92.add(char_literal31);\r\n\r\n\r\n // AST REWRITE\r\n // elements: option, OPTIONS\r\n // token labels: \r\n // rule labels: retval\r\n // token list labels: \r\n // rule list labels: \r\n // wildcard labels: \r\n if ( state.backtracking==0 ) {\r\n\r\n retval.tree = root_0;\r\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\r\n\r\n root_0 = (CommonTree)adaptor.nil();\r\n // 138:30: -> ^( OPTIONS ( option )+ )\r\n {\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:138:33: ^( OPTIONS ( option )+ )\r\n {\r\n CommonTree root_1 = (CommonTree)adaptor.nil();\r\n root_1 = (CommonTree)adaptor.becomeRoot(\r\n stream_OPTIONS.nextNode()\r\n , root_1);\r\n\r\n if ( !(stream_option.hasNext()) ) {\r\n throw new RewriteEarlyExitException();\r\n }\r\n while ( stream_option.hasNext() ) {\r\n adaptor.addChild(root_1, stream_option.nextTree());\r\n\r\n }\r\n stream_option.reset();\r\n\r\n adaptor.addChild(root_0, root_1);\r\n }\r\n\r\n }\r\n\r\n\r\n retval.tree = root_0;\r\n }\r\n\r\n }\r\n\r\n retval.stop = input.LT(-1);\r\n\r\n\r\n if ( state.backtracking==0 ) {\r\n\r\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\r\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n \tretval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\r\n\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n return retval;\r\n }", "@Override\n public Status changeOptions(Options options) {\n if (options.getComparator() != this.options.getComparator()) {\n return Status.InvalidArgument(\"changing comparator while building table\");\n }\n\n // Note that any live BlockBuilders point to rep_->options and therefore\n // will automatically pick up the updated options.\n this.options = new Options(options);\n this.indexBlockOptions = new Options(options);\n this.indexBlockOptions.setBlockRestartInterval(1);\n return Status.OK();\n }", "private Map<String, Object> getDefaultConfiguration() {\n JavaFormattingOptions options = JavaFormattingOptions.createDefault();\n options.ClassBraceStyle = BraceStyle.EndOfLine;\n options.InterfaceBraceStyle = BraceStyle.EndOfLine;\n options.EnumBraceStyle = BraceStyle.EndOfLine;\n\n return ProcyonBuilderConfiguration\n .getBuilderConfiguration()\n .uploadClassReference(true)\n .excludeNestedTypes(false)\n .flattenSwitchBlocks(true)\n .forceExplicitImports(true)\n .forceExplicitTypeArguments(true)\n .setLanguage(new JavaLanguage())\n .setByteCodeOutputOptions(new BytecodeOutputOptions())\n .setJavaFormatterOptions(options)\n .showSyntheticMembers(false)\n .alwaysGenerateExceptionVariableForCatchBlocks(true)\n .includeErrorDiagnostics(false)\n .includeLineNumbersInByteCode(false)\n .retainRedundantCasts(false)\n .retainPointlessSwitches(true)\n .unicodeOutputEnabled(true)\n .showDebugLineNumbers(false)\n .mergeVariables(false)\n .simplifyMemberReferences(true)\n .disableForEachTransforms(false)\n .setForceFullyQualifiedReferences(false)\n .getConfiguration();\n }", "T setJavaOptions(String... javaOptions);", "private Options createOptions()\n {\n final Options options = new Options();\n\n options.addOption(optionDataDir);\n options.addOption(optionRepoDir);\n options.addOption(optOutputFilename);\n\n return options;\n }", "public static void transferConfigurationTo(IOptionSetter options) {\r\n options.setOption(HOST_EVENT, getEventHost());\r\n options.setOption(PORT_EVENT, getEventPort());\r\n options.setOption(CONFIG_KEY_STORM_NIMBUS_HOST, getNimbus());\r\n options.setOption(CONFIG_KEY_STORM_NIMBUS_PORT, getThriftPort());\r\n options.setOption(EVENT_DISABLE_LOGGING, getEventDisableLogging());\r\n options.setOption(PIPELINE_INTERCONN_PORTS, getPipelinePorts());\r\n options.setOption(MONITORING_VOLUME_ENABLED, enableVolumeMonitoring());\r\n options.setOption(RETRY_INTERVAL_ZOOKEEPER, getZookeeperRetryInterval());\r\n options.setOption(RETRY_TIMES_ZOOKEEPER, getZookeeperRetryTimes());\r\n options.setOption(WATCHER_WAITING_TIME, getWatcherWaitingTime());\r\n }", "@Override\n\tprotected void setUp() {\n\t\topthand1 = new SimpleOptionHandler(4);\n\t\topthand2 = new SimpleOptionHandler(8, true, true, true, true);\n\t\topthand3 = new SimpleOptionHandler(91, false, false, false, false);\n\t}", "@SuppressWarnings(\"unused\")\n\tpublic void setOptions() {\n\t\tCIVLTable tbl_optionTable = (CIVLTable) getComponentByName(\"tbl_optionTable\");\n\t\tDefaultTableModel optionModel = (DefaultTableModel) tbl_optionTable\n\t\t\t\t.getModel();\n\n\t\tObject[] opts = currConfig.getGmcConfig().getOptions().toArray();\n\t\tGMCSection section = currConfig.getGmcConfig().getAnonymousSection();\n\n\t\tCollection<Option> options = currConfig.getGmcConfig().getOptions();\n\t\tIterator<Option> iter_opt = options.iterator();\n\t\tList<Object> vals = new ArrayList<Object>();\n\n\t\tfor (int j = 0; j < optionModel.getRowCount(); j++) {\n\t\t\tvals.add(optionModel.getValueAt(j, 1));\n\t\t}\n\n\t\tfor (int i = 0; i < vals.size(); i++) {\n\t\t\tOption currOpt = (Option) opts[i];\n\t\t\tObject val = vals.get(i);\n\n\t\t\tif (!currOpt.type().equals(OptionType.MAP)) {\n\t\t\t\tif (val instanceof String\n\t\t\t\t\t\t&& currOpt.type().equals(OptionType.INTEGER)) {\n\t\t\t\t\tInteger value = Integer.valueOf((String) val);\n\t\t\t\t\tsection.setScalarValue(currOpt, value);\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\t * else if(val == null) { section.setScalarValue(currOpt, \"\"); }\n\t\t\t\t */\n\t\t\t\telse if (true) {\n\t\t\t\t\tSystem.out.println(\"val: \" + val);\n\t\t\t\t}\n\t\t\t\tsection.setScalarValue(currOpt, val);\n\t\t\t}\n\t\t}\n\t}", "private static void forceBasicEditorConfiguration() {\n Game.graphics().setBaseRenderScale(1.0f);\n Game.config().debug().setDebugEnabled(true);\n Game.config().graphics().setGraphicQuality(Quality.VERYHIGH);\n Game.config().graphics().setReduceFramesWhenNotFocused(false);\n }", "private void appendKeyGeneratorSettings() {\n Label keyGeneratorSettings = new Label(Localization.lang(\"Key generator settings\"));\n keyGeneratorSettings.getStyleClass().add(\"sectionHeader\");\n builder.add(keyGeneratorSettings, 1, 10);\n builder.add(autoGenerateOnImport, 1, 11);\n builder.add(letterStartA, 2, 11);\n builder.add(warnBeforeOverwriting, 1, 12);\n builder.add(letterStartB, 2, 12);\n builder.add(dontOverwrite, 1, 13);\n builder.add(alwaysAddLetter, 2, 13);\n builder.add(generateOnSave, 1, 14);\n\n builder.add((new Label(Localization.lang(\"Replace (regular expression)\") + ':')), 1, 15);\n builder.add(new Label(Localization.lang(\"by\") + ':'), 2, 15);\n\n builder.add(keyPatternRegex, 1, 16);\n builder.add(keyPatternReplacement, 2, 16);\n\n dontOverwrite.setOnAction(e ->\n // Warning before overwriting is only relevant if overwriting can happen:\n warnBeforeOverwriting.setDisable(dontOverwrite.isSelected()));\n }", "public abstract Builder setImageProcessingOptions(ImageProcessingOptions value);", "private DecompilerSettings getDecompilerSettings() {\n DecompilerSettings settings = new DecompilerSettings();\n\n settings.setExcludeNestedTypes(utils.getConfigOption(EXCLUDE_NESTED_TYPES_KEY, Boolean.class));\n settings.setFlattenSwitchBlocks(utils.getConfigOption(FLATTEN_SWITCH_BLOCKS_KEY, Boolean.class));\n settings.setForceExplicitImports(utils.getConfigOption(FORCE_EXPLICIT_IMPORTS_KEY, Boolean.class));\n settings.setForceExplicitTypeArguments(utils.getConfigOption(FORCE_EXPLICIT_TYPE_ARGUMENTS_KEY, Boolean.class));\n settings.setLanguage(utils.getConfigOption(LANGUAGE_KEY, Language.class));\n settings.setShowSyntheticMembers(utils.getConfigOption(DISPLAY_SYNTHETIC_MEMBERS_KEY, Boolean.class));\n settings.setJavaFormattingOptions(utils.getConfigOption(JAVA_FORMATTER_OPTIONS_KEY, JavaFormattingOptions.class));\n settings.setBytecodeOutputOptions(utils.getConfigOption(BYTE_CODE_OUTPUT_OPTIONS_KEY, BytecodeOutputOptions.class));\n settings.setAlwaysGenerateExceptionVariableForCatchBlocks(\n utils.getConfigOption(ALWAYS_GENERATE_EXCEPTION_VARIABLE_FOR_CATCH_BLOCKS_KEY, Boolean.class)\n );\n settings.setRetainRedundantCasts(utils.getConfigOption(RETAIN_REDUNDANT_CASTS_KEY, Boolean.class));\n settings.setIncludeErrorDiagnostics(utils.getConfigOption(INCLUDE_ERROR_DIAGNOSTICS_KEY, Boolean.class));\n settings.setIncludeLineNumbersInBytecode(\n utils.getConfigOption(INCLUDE_LINE_NUMBERS_IN_BYTECODE_KEY, Boolean.class)\n );\n settings.setRetainPointlessSwitches(utils.getConfigOption(RETAIN_POINTLESS_SWITCHES_KEY, Boolean.class));\n settings.setUnicodeOutputEnabled(utils.getConfigOption(UNICODE_OUTPUT_ENABLED_KEY, Boolean.class));\n settings.setMergeVariables(utils.getConfigOption(MERGE_VARIABLES_KEY, Boolean.class));\n settings.setShowDebugLineNumbers(utils.getConfigOption(SHOW_DEBUG_LINE_NUMBERS_KEY, Boolean.class));\n settings.setSimplifyMemberReferences(utils.getConfigOption(SIMPLIFY_MEMBER_REFERENCES_KEY, Boolean.class));\n settings.setDisableForEachTransforms(utils.getConfigOption(DISABLE_FOR_EACH_TRANSFORMS_KEY, Boolean.class));\n settings.setForceFullyQualifiedReferences(utils.getConfigOption(FORCE_FULLY_QUALIFIED_REFERENCES, Boolean.class));\n\n return settings;\n }", "private static Options getOptions() {\n Option inputOption = Option.builder(\"i\")\n .longOpt(\"input\")\n .hasArg()\n .argName(\"input file\")\n .required()\n .desc(\"The JSON input filename\")\n .build();\n Option outputOption = Option.builder(\"o\")\n .longOpt(\"output\")\n .hasArg()\n .argName(\"output file\")\n .required()\n .desc(\"The Drupal output filename\")\n .build();\n Option configOption = Option.builder(\"c\")\n .longOpt(\"config\")\n .hasArg()\n .argName(\"properties file\")\n .required()\n .desc(\"The properties file for containing Google credentials\")\n .build();\n Option helpOption = Option.builder(\"h\")\n .longOpt(\"help\")\n .desc(\"Print this message\")\n .build();\n\n Options options = new Options();\n options.addOption(inputOption);\n options.addOption(outputOption);\n options.addOption(configOption);\n options.addOption(helpOption);\n\n return options;\n }", "public void setOptions(String[] options) throws Exception {\n\n String str;\n\n /* Number max of attempts of generalisation */\n str = Utils.getOption('G', options);\n if(str.length() != 0){\n m_NumAttemptsOfGene = Integer.parseInt(str);\n if(m_NumAttemptsOfGene < 1)\n\tthrow new Exception(\"NNge.setOptions : G option's value must be greater than 1.\");\n } else {\n m_NumAttemptsOfGene = 5;\n }\n\n /* Number of folder for computing the mutual information */\n str = Utils.getOption('I', options);\n if(str.length() != 0){\n m_NumFoldersMI = Integer.parseInt(str);\n if(m_NumFoldersMI < 1)\n\tthrow new Exception(\"NNge.setOptions : I option's value must be greater than 1.\");\n } else {\n m_NumFoldersMI = 5;\n }\n }", "public interface WordCountOptions extends SparkContextOptions {\n @Description(\"Mocked Option just to provide an example. Access this option via methods defined below.\")\n @Default.String(\"gs://beam-samples/shakespeare/kinglear.txt\")\n String getUnusedOption();\n void setUnusedOption(String value);\n }", "public InfoOptions() {\n\t\tHelpOpt = new ArrayList<String>();\n\t\tDisplayOpt = new ArrayList<String>();\n\t\tNoteOpt = new ArrayList<String>();\n\t\tDelOpt = new ArrayList<String>();\n\t\tChangeNameOpt = new ArrayList<String>();\n\t\tsetDisplay();\n\t\tsetHelp();\n\t\tsetNote();\n\t\tsetDel();\n\t\tsetChangeName();\n\t}", "private OptimoveConfig() {\n }", "protected void setParamValue( Source s ) {\n switch (option) {\n case INPUT:\n s.setInput( optionName );\n\n expected = optionName;\n break;\n\n case CLASS_SECTION:\n s.setClassSection( optionName );\n\n expected = optionName;\n break;\n\n case CLASSDEC:\n s.setClassDec( optionName );\n\n expected = optionName;\n break;\n\n case CLASSNAME:\n s.setClassName( optionName );\n\n expected = optionName;\n break;\n\n case CLASSNAME_SUFFIX:\n s.setClassNameSuffix( optionName );\n\n expected = optionName;\n break;\n\n case CLASS_TEMPLATE:\n s.setClassTemplate( optionName );\n\n expected = optionName;\n break;\n\n case CONFIG_FILE:\n s.setConfigFile( optionName );\n\n expected = optionName;\n break;\n\n case DECLARATIONS:\n s.setDeclarations( optionName );\n\n expected = optionName;\n break;\n\n case ENCODING:\n s.setEncoding( optionName );\n\n expected = optionName;\n break;\n\n case FOOTER:\n s.setFooter( optionName );\n\n expected = optionName;\n break;\n\n case HEADER:\n s.setHeader( optionName );\n\n expected = optionName;\n break;\n\n case INCLUDE:\n s.setInclude( optionName );\n\n expected = optionName;\n break;\n\n case INDIVIDUALS_SECTION:\n s.setIndividualsSection( optionName );\n\n expected = optionName;\n break;\n\n case INDIVIDUAL_TEMPLATE:\n s.setIndividualTemplate( optionName );\n\n expected = optionName;\n break;\n\n case MARKER:\n s.setMarker( optionName );\n\n expected = optionName;\n break;\n\n case NAMESPACE:\n s.setNamespace( optionName );\n\n expected = optionName;\n break;\n\n case OUTPUT:\n s.setOutput( optionName );\n\n expected = optionName;\n break;\n\n case PACKAGENAME:\n s.setPackageName( optionName );\n\n expected = optionName;\n break;\n\n case PROPERTY_SECTION:\n s.setPropertySection( optionName );\n\n expected = optionName;\n break;\n\n case PROP_TEMPLATE:\n s.setPropTemplate( optionName );\n\n expected = optionName;\n break;\n\n case ROOT:\n s.setRoot( optionName );\n\n expected = optionName;\n break;\n\n // Boolean options\n case DOS:\n s.setDos( optionName );\n\n expected = true;\n break;\n\n case HELP:\n s.setHelp( optionName );\n\n expected = true;\n break;\n\n case INCLUDE_SOURCE:\n s.setIncludeSource( optionName );\n\n expected = true;\n break;\n\n case LANG_DAML:\n s.setLangDaml( optionName );\n\n expected = true;\n break;\n\n case LANG_OWL:\n s.setLangOwl( optionName );\n\n expected = true;\n break;\n\n case LANG_RDFS:\n s.setLangRdfs( optionName );\n\n expected = true;\n break;\n\n case NOCLASSES:\n s.setNoClasses( optionName );\n\n expected = true;\n break;\n\n case NOHEADER:\n s.setNoHeader( optionName );\n\n expected = true;\n break;\n\n case NOINDIVIDUALS:\n s.setNoIndividuals( optionName );\n\n expected = true;\n break;\n\n case NOPROPERTIES:\n s.setNoProperties( optionName );\n\n expected = true;\n break;\n\n case NO_COMMENTS:\n s.setNoComments( optionName );\n\n expected = true;\n break;\n\n case NO_STRICT:\n s.setNoStrict( optionName );\n\n expected = true;\n break;\n\n case ONTOLOGY:\n s.setOntology( optionName );\n\n expected = true;\n break;\n\n case STRICT_INDIVIDUALS:\n s.setStrictIndividuals( optionName );\n\n expected = true;\n break;\n\n case UC_NAMES:\n s.setUcNames( optionName );\n\n expected = true;\n break;\n\n case USE_INF:\n s.setUseInf( optionName );\n\n expected = true;\n break;\n\n }\n }", "@Override\n\t\t\tprotected void configure() {\n\t\t\t}", "public OptionsBuilder optionsBuilder() {\n OptionsBuilder builder = new OptionsBuilder();\n\n builder.forks(forks);\n builder.warmupIterations(warmupIterations);\n builder.measurementIterations(measurementIterations);\n builder.timeUnit(outputTimeUnit);\n builder.threads(threads);\n\n if (benchmarkModes != null) {\n for (Mode benchmarkMode : benchmarkModes)\n builder.getBenchModes().add(benchmarkMode);\n }\n\n if (benchmarks != null) {\n for (Object benchmark : benchmarks) {\n if (benchmark instanceof Class)\n builder.include(((Class)benchmark).getSimpleName());\n else\n builder.include(benchmark.toString());\n }\n }\n\n if (jvmArgs != null)\n builder.jvmArgs(jvmArgs);\n\n if (output != null)\n builder.output(output);\n\n if (profilers != null) {\n for (Class profiler : profilers)\n builder.addProfiler(profiler);\n }\n\n return builder;\n }", "private void config() {\n\t}", "public CompilerOptions getCompilerOptions() {\n return compilerOptions;\n }", "public void setOptions(String value) {\n this.options = value;\n }" ]
[ "0.68582076", "0.64220834", "0.6299982", "0.61795765", "0.6086649", "0.6079579", "0.6065027", "0.6059934", "0.6053336", "0.6007044", "0.5928913", "0.5928913", "0.59156436", "0.5811286", "0.5754247", "0.57526237", "0.5732455", "0.57184565", "0.57164687", "0.5714442", "0.57034105", "0.5697597", "0.56764233", "0.567518", "0.5643307", "0.563889", "0.5611628", "0.5584837", "0.5579109", "0.5550309", "0.554459", "0.5533207", "0.5529307", "0.5504256", "0.5504144", "0.5486738", "0.54830426", "0.5463043", "0.54373455", "0.54198784", "0.54172665", "0.5402307", "0.5400407", "0.539646", "0.53892195", "0.5380918", "0.5373803", "0.5372527", "0.5366981", "0.53530884", "0.53508306", "0.53438014", "0.5341494", "0.53308165", "0.5328673", "0.5322272", "0.53212315", "0.5300544", "0.52918047", "0.52913237", "0.5278853", "0.52598554", "0.52459013", "0.5241237", "0.5239077", "0.5235886", "0.5230548", "0.52286285", "0.52246165", "0.5217452", "0.5212474", "0.5211525", "0.5207031", "0.5200544", "0.51819915", "0.5181908", "0.5178615", "0.51713246", "0.51627946", "0.51590157", "0.51584476", "0.5157855", "0.514534", "0.5144266", "0.51365864", "0.5132584", "0.5126965", "0.51255745", "0.5118341", "0.51161444", "0.5115383", "0.5113186", "0.51102257", "0.51064646", "0.510105", "0.50954336", "0.5092489", "0.5089711", "0.50875545", "0.5086907" ]
0.5648653
24
1. Take Screenshot and store it in a file format
public static void takeScreenshot(String filename) throws IOException { File file = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); //2. Now copy the file to the desired location using copyFile method FileUtils.copyFile(file, new File("E:\\Selenium\\SeleniumPractice\\src\\com\\seleniumpractice\\Screenshot\\"+filename+".jpg")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void takeScreenShot(){\n\t\tDate d=new Date();\r\n\t\tString screenshotFile=d.toString().replace(\":\", \"_\").replace(\" \", \"_\")+\".png\";\r\n\t\t// store screenshot in that file\r\n\t\tFile scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\r\n\t\ttry {\r\n\t\t\tFileUtils.copyFile(scrFile, new File(System.getProperty(\"user.dir\")+\"//screenshots//\"+screenshotFile));\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catcsh block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t//put screenshot file in reports\r\n\t\ttest.log(LogStatus.INFO,\"Screenshot-> \"+ test.addScreenCapture(System.getProperty(\"user.dir\")+\"//screenshots//\"+screenshotFile));\r\n\t\t\r\n\t}", "public void saveScreenshot() {\n if (ensureSDCardAccess()) {\n Bitmap bitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);\n Canvas canvas = new Canvas(bitmap);\n doDraw(1, canvas);\n File file = new File(mScreenshotPath + \"/\" + System.currentTimeMillis() + \".jpg\");\n FileOutputStream fos;\n try {\n fos = new FileOutputStream(file);\n bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);\n fos.close();\n } catch (FileNotFoundException e) {\n Log.e(\"Panel\", \"FileNotFoundException\", e);\n } catch (IOException e) {\n Log.e(\"Panel\", \"IOEception\", e);\n }\n }\n }", "public void takeScreenShot();", "public void screenShot(String data) throws IOException {\nTakesScreenshot screenShot=(TakesScreenshot) driver;\nFile screenshotAs = screenShot.getScreenshotAs(OutputType.FILE);\nFile file=new File(System.getProperty(\"user.dir\")+\"\\\\target\\\\\"+data+\".png\");\nFileUtils.copyFile(screenshotAs, file);\n\n}", "public void takeScreenShot() {\n\t\t destDir = \"screenshots\";\n\t\t // Capture screenshot.\n\t\t File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);\n\t\t // Set date format to set It as screenshot file name.\n\t\t dateFormat = new SimpleDateFormat(\"dd-MMM-yyyy__hh_mm_ssaa\");\n\t\t // Create folder under project with name \"screenshots\" provided to destDir.\n\t\t new File(destDir).mkdirs();\n\t\t // Set file name using current date time.\n\t\t String destFile = dateFormat.format(new Date()) + \".png\";\n\n\t\t try {\n\t\t // Copy paste file at destination folder location\n\t\t FileUtils.copyFile(scrFile, new File(destDir + \"/\" + destFile));\n\t\t } catch (IOException e) {\n\t\t e.printStackTrace();\n\t\t }\n\t\n}", "private void takeScreenshot(Activity activity) {\n uiDevice.waitForIdle(2000);\n\n // Create a file and save it\n Date start = new Date();\n final File screenFile = new File(Environment.getExternalStorageDirectory(), \"screen_\" + start.toString() + \"_\" + rand.nextInt());\n uiDevice.takeScreenshot(screenFile, 0.5f, 50);\n\n // Finally, attempt to send that file over websockets\n socket.sendScreenshot(screenFile, activity, start);\n\n }", "private Bitmap takeScreenshot2() {\n Bitmap bitmap = null;\n try {\n // image naming and path to include sd card appending name you choose for file\n String mPath = Environment.getExternalStorageDirectory().toString() + \"/Activity\" + \".jpg\";\n\n // create bitmap screen capture\n View v1 = activity.getWindow().getDecorView().getRootView();\n v1.setDrawingCacheEnabled(true);\n bitmap = Bitmap.createBitmap(v1.getDrawingCache());\n v1.setDrawingCacheEnabled(false);\n\n File imageFile = new File(mPath);\n\n FileOutputStream outputStream = new FileOutputStream(imageFile);\n int quality = 100;\n bitmap.compress(Bitmap.CompressFormat.JPEG, quality, outputStream);\n outputStream.flush();\n outputStream.close();\n return bitmap;\n\n } catch (Throwable e) {\n // Several error may come out with file handling or OOM\n e.printStackTrace();\n }\n return bitmap;\n }", "public void takescreenshot() throws IOException {\n\t\tString pwd = System.getProperty(\"user.dir\");\n\t\tFile sFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);\n\t\tFileUtils.copyFile(sFile, new File(pwd + \"\\\\Output_screen.jpg\"));\n\t}", "@Test\n\tprivate void takeScreenshot() throws IOException {\n\t\tFile screenshot = ((TakesScreenshot) this.driver).getScreenshotAs(OutputType.FILE);\n\t\tString fileName = this.getTimestamp() + \".png\";\n\t\tFileUtils.copyFile(screenshot, new File(fileName));\n\n\t}", "private String takeScreenshot(View view) {\n Date now = new Date();\n android.text.format.DateFormat.format(\"yyyy-MM-dd_hh:mm:ss\", now);\n\n try {\n // image naming and path to include sd card appending name you choose for file\n String mPath = Environment.getExternalStorageDirectory().toString() + \"/\" + now + \".jpg\";\n\n // create bitmap screen capture\n View v1 = getWindow().getDecorView().getRootView();\n v1.setDrawingCacheEnabled(true);\n Bitmap bitmap = Bitmap.createBitmap(v1.getDrawingCache(), (int)view.getX()+10,\n (int)view.getY()+35, view.getWidth()-22, view.getHeight()-33);\n v1.setDrawingCacheEnabled(false);\n File imageFile = new File(mPath);\n FileOutputStream outputStream = new FileOutputStream(imageFile);\n int quality = 100;\n bitmap.compress(Bitmap.CompressFormat.JPEG, quality, outputStream);\n outputStream.flush();\n outputStream.close();\n return mPath;\n } catch (Throwable e) {\n e.printStackTrace();\n }\n return \"\";\n }", "public static String getScreenshot() {\n TakesScreenshot screenshot = (TakesScreenshot) WebDriverBase.driver;\n File src = screenshot.getScreenshotAs(OutputType.FILE);\n String path = System.getProperty(\"user.dir\") + File.separator + \"target\" + File.separator + \"report\" + File.separator + System.currentTimeMillis() + \".png\";\n System.out.println(path);\n File dest = new File(path);\n try {\n FileUtils.copyFile(src, dest);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return path;\n }", "public String getScreenshot(WebDriver driver) {\nTakesScreenshot ts= (TakesScreenshot)driver;\n\n//This gives screenshot in the form of file\nFile source=ts.getScreenshotAs(OutputType.FILE);\n\n//RETURNS path in user directory in the screenshot folder which is stored in \"path\" in the form of string\nString path= System.getProperty(\"user.dir\")+\"/Screenshot/\"+System.currentTimeMillis()+\".png\";\n\n//The path is returned to vaiable destination\nFile destination=new File(path);\n\ntry {\nFileUtils.copyFile(source,destination );\n} catch (IOException e) {\n// TODO Auto-generated catch block\nSystem.out.println(\"Capture Failed\" + e.getMessage());\n}\nreturn path;\n}", "public static String createScreenshot(WebDriver driver) {\r\n\t \r\n\t UUID uuid = UUID.randomUUID();\r\n\t File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\r\n\t try {\r\n\t org.apache.commons.io.FileUtils.copyFile(scrFile, new File(\"/img\" + uuid + \".png\"));\r\n\t System.out.println(\"/img/screen\" + uuid + \".png\");\r\n\t } catch (IOException e) {\r\n\t System.out.println(\"Error while generating screenshot:\\n\" + e.toString());\r\n\t }\r\n\t return \"/img\" + uuid + \".png\";\r\n\t}", "@After\t\n public void takeScreenShot() {\n File scrFile = ((TakesScreenshot)getDriver()).getScreenshotAs(OutputType.FILE);\n // now save the screenshot to a file some place\n try {\n\t\t\tFileUtils.copyFile(scrFile, new File(\"c:\\\\tmp\\\\TC_EditAppAddNewApiSTTC.png\"));\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t}\n }", "private void saveScreenshot(Bitmap screenshot, String filePath) {\n FileOutputStream out = null;\n try {\n out = new FileOutputStream(filePath);\n screenshot.compress(Bitmap.CompressFormat.PNG, 100, out);\n Log.i(TAG, \"Screenshot saved to \" + filePath);\n Toast.makeText(this, \"Screenshot saved to \" + filePath, Toast.LENGTH_LONG).show();\n } catch (Exception e) {\n Log.e(TAG, \"Failed to save screenshot\", e);\n Toast.makeText(this, \"Screenshot FAILED!\", Toast.LENGTH_SHORT).show();\n } finally {\n try { if (out != null) { out.close();} } catch (IOException e) {}\n }\n }", "public static void TakeScreenShot(String i) throws IOException {//a metod we will use onTestFail listener, I added i so i can call the method for a particular case and put the screenShots in separate files\n Date d =new Date();\n String fileName = d.toString().replace(\":\",\"_\").replace(\" \",\"_\");\n path = System.getProperty(\"user.dir\")+\"\\\\src\\\\test\\\\resources\\\\Prints\"+i+\"\\\\\"+fileName+\".jpg\";\n File screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);\n FileUtils.copyFile(screenshot,new File(System.getProperty(\"user.dir\")+\"\\\\src\\\\test\\\\resources\\\\Prints\"+i+\"\\\\\"+fileName+\".jpg\"));\n }", "@Override\n public void saveSnapshot(String path) {\n String command = \"adb shell screencap -p \" + path;\n// String command=\"adb shell screencap -p /sdcard/js_test.png\";\n// executeCommand(Lists.newArrayList(\n// \"adb\",\"shell\",\"screencap\",\"-p\",\"/sdcard/js_test.png\",\n// \"|\",\"sed\",\"'s/\\\\r$//'\",\">\",path\n//\n// ));\n// String command=\"adb shell screencap -p | sed 's/\\\\r$//' > screen.png\";\n executeCommand(command);\n }", "private static void ScreenShot(WebDriver driver, String Filepath) {\n\t\tTakesScreenshot screen=((TakesScreenshot)driver);\n\t\t\n\t\tFile SrcFile=screen.getScreenshotAs(OutputType.FILE);\n\n\t\t//Move image to new destination\n\t\tFile DestFile=new File(Filepath);\n\n\t\t//Copy file at destination location\n\t\t//FileUtils.copyFile(SrcFile, DestFile);\n\t\t\n\t}", "public void takeScreenShot(String fileName) throws IOException {\n File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);\n DateFormat dateFormat = new SimpleDateFormat(\"yy-mm-dd HH-mm-ss\");\n Date date = new Date();\n FileUtils.copyFile(scrFile, new File(\"TestoutputData/Screenshot/\" + fileName + \"_\" + dateFormat.format(date) + \".png\"));\n }", "private void takeScreenShot(WebDriver driver, String fName) throws IOException {\n\n\t\tFile scrshotFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);\n\t\tFileUtils.copyFile(scrshotFile, new File(fName));\n\t}", "public String getScreenshot() {\n\t\tFile src = ((TakesScreenshot) getDriver()).getScreenshotAs(OutputType.FILE);\n\t\tString path = System.getProperty(\"user.dir\") + \"/screenshots/\" + System.currentTimeMillis() + \".png\";\n\t\tFile destination = new File(path);\n\t\ttry {\n\t\t\tFileUtils.copyFile(src, destination);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn path;\n\t}", "void takesScreenshot();", "public static String CaptureScreenShot(WebDriver driver) {\n\t\ttry {\n\t\t\tTakesScreenshot ts = (TakesScreenshot) driver;\n\t\t\tFile screenshotSRC = ts.getScreenshotAs(OutputType.FILE);\n\t\t\tString path = System.getProperty(\"user.dir\") + \"/Screenshots/\" + System.currentTimeMillis() + \".png\";\n\t\t\tFile screenshotDest = new File(path);\n\t\t\tFileUtils.copyFile(screenshotSRC, screenshotDest);\n\t\t\treturn path;\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Some exception occured.\" + e.getMessage());\n\t\t\treturn null;\n\t\t}\n\t}", "public void SaveScreenShot(Component component, String filename) throws Exception{\r\n BufferedImage imag = getScreenShot(component);\r\n ImageIO.write(imag, \"png\", new File(filename));\r\n }", "public void takeScreenShot(String fileName) throws IOException {\n\t\tScreenshot takeScreenShot = new AShot().takeScreenshot(driver);\n\t\tImageIO.write(takeScreenShot.getImage(), \"png\", new File(path+\"\\\\ScreenShots\\\\\" + fileName + \".png\"));\n\t}", "public static void getScreenShot(String description, WebDriver driver) throws IOException {\n\t\t DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd, HH.mm.ss\");\n\t\t File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\n\t\t String outputFile = Common.outputFileDir + description + \" (\" + dateFormat.format(new Date()) + \").png\";\n\t\t fileWriterPrinter(outputFile);\n\t\t FileUtils.copyFile(scrFile, new File(outputFile));\n\t\t }", "public static File captureRootScreenShot(Activity activity){\n View decor = activity.getWindow().getDecorView();\n decor.setDrawingCacheEnabled(true);\n\n // Configure screenshot bounds\n Bitmap decorBmp = decor.getDrawingCache();\n\n // Create the screenshot per se\n Bitmap screenShot = Bitmap.createBitmap(decorBmp, 0, 0, decorBmp.getWidth(), decorBmp.getHeight());\n\n // Recycle the intial bitmap\n decorBmp.recycle();\n\n // Disable drawing cache on the decor\n decor.setDrawingCacheEnabled(false);\n\n // Save the newly generated screenshot into a temporary variable\n try {\n\n // Create an image file name\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"PNG_\" + timeStamp + \"_\";\n File cacheDir = activity.getCacheDir();\n File tempFile = File.createTempFile(imageFileName, \".png\", cacheDir);\n\n // Write bitmap to file\n boolean result = screenShot.compress(Bitmap.CompressFormat.PNG, 0, new FileOutputStream(tempFile));\n if(result)\n return tempFile;\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return null;\n }", "private void screenshot() {\n final JComponent active = this.active;\n if (active != null && active.isValid()) {\n final BufferedImage image = new BufferedImage(active.getWidth(), active.getHeight(), BufferedImage.TYPE_INT_RGB);\n final Graphics2D handler = image.createGraphics();\n active.print(handler);\n handler.dispose();\n File file = new File(Preferences.userNodeForPackage(DesktopPane.class).get(SCREENSHOT_DIRECTORY_PREFS, \".\"));\n file = new File(file, getTitle(active.getClass()) + \".png\");\n try {\n assertTrue(ImageIO.write(image, \"png\", file));\n file = file.getParentFile();\n Desktop.getDesktop().open(file);\n } catch (IOException e) {\n JOptionPane.showInternalMessageDialog(active, e.getLocalizedMessage(),\n e.getClass().getSimpleName(), JOptionPane.ERROR_MESSAGE);\n }\n } else {\n JOptionPane.showInternalMessageDialog(this, \"No active window.\", \"Screenshot\", JOptionPane.WARNING_MESSAGE);\n }\n }", "private void takeScreenShot(WebDriver webdriver, String fileWithPath) {\n TakesScreenshot scrShot = ((TakesScreenshot) webdriver);\n //Call getScreenshotAs method to create image file\n File SrcFile = scrShot.getScreenshotAs(OutputType.FILE);\n //Move image file to new destination\n File DestFile = new File(fileWithPath);\n //Copy file at destination\n try {\n FileUtils.copyFile(SrcFile, DestFile);\n } catch (IOException e) {\n System.err.println(\"Something went wrong during copying\");\n }\n }", "private void takeScreenShot(View view) {\n\n //This is used to provide file name with Date a format\n Date date = new Date();\n CharSequence format = DateFormat.format(\"MM-dd-yyyy_hh:mm:ss\", date);\n\n //It will make sure to store file to given below Directory and If the file Directory dosen't exist then it will create it.\n try {\n File mainDir = new File(\n this.getExternalFilesDir(Environment.DIRECTORY_PICTURES), \"FilShare\");\n if (!mainDir.exists()) {\n boolean mkdir = mainDir.mkdir();\n }\n\n //Providing file name along with Bitmap to capture screenview\n String path = mainDir + \"/\" + \"TrendOceans\" + \"-\" + format + \".jpeg\";\n view.setDrawingCacheEnabled(true);\n Bitmap bitmap = Bitmap.createBitmap(view.getDrawingCache());\n view.setDrawingCacheEnabled(false);\n\n //This logic is used to save file at given location with the given filename and compress the Image Quality.\n File imageFile = new File(path);\n FileOutputStream fileOutputStream = new FileOutputStream(imageFile);\n bitmap.compress(Bitmap.CompressFormat.PNG, 90, fileOutputStream);\n fileOutputStream.flush();\n fileOutputStream.close();\n\n //Create New Method to take ScreenShot with the imageFile.\n shareScreenShot(imageFile);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static String takeScreenShot(WebDriver driver, String testName){\n File screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);\n String path = \"./\" + \"\\\\target\\\\surefire-reports\\\\\" + testName + \".png\";\n try {\n FileUtils.copyFile(screenshot, new File(path));\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n return testName + \".png\";\n }", "private void captureScreen(String reason) throws Exception {\n File file;\n try {\n file = new File(getWorkDirPath() + \"/dump.png\");\n file.getParentFile().mkdirs();\n file.createNewFile();\n } catch(IOException e) { throw new Exception(\"Error: Can't create dump file.\"); }\n PNGEncoder.captureScreen(file.getAbsolutePath());\n throw new Exception(reason);\n }", "void takeSnapShot(File fileToSave) {\n try {\n /*Construct a new BufferedImage*/\n BufferedImage exportImage = new BufferedImage(this.getSize().width,\n this.getSize().height,\n BufferedImage.TYPE_INT_RGB);\n\n \n /*Get the graphics from JPanel, use paint()*/\n this.paint(exportImage.createGraphics());\n \n fileToSave.createNewFile();\n ImageIO.write(exportImage, \"PNG\", fileToSave);\n } catch(Exception exe){\n System.out.println(\"DrawCanvas.java - Exception\");\n }//catch\n}", "@Attachment(value = \"Page screenshot {fileWithPath}\", type = \"image/png\")\n protected byte[] takeSnapShot(String fileWithPath){\n try{\n TakesScreenshot scrShot =((TakesScreenshot)driver);\n\n File SrcFile=scrShot.getScreenshotAs(OutputType.FILE);\n\n File DestFile=new File(\"./target/pictures/\"+ fileWithPath);\n\n FileUtils.copyFile(SrcFile, DestFile);\n\n return scrShot.getScreenshotAs(OutputType.BYTES);\n\n }catch(WebDriverException e){\n e.printStackTrace(); \n\n }catch(Exception e){\n e.printStackTrace(); \n }\n return null; \n }", "static String takeScreenShot(String ImagesPath, WebDriver driver) {\n TakesScreenshot takesScreenshot = (TakesScreenshot) driver;\n File screenShotFile = takesScreenshot.getScreenshotAs(OutputType.FILE);\n File destinationFile = new File(ImagesPath+\".png\");\n try {\n FileUtils.copyFile(screenShotFile, destinationFile);\n } catch (IOException e) {\n System.out.println(e.getMessage());\n }\n return ImagesPath+\".png\";\n }", "public void capturescreen(WebDriver driver, String testName) throws IOException {\n\t\tTakesScreenshot ts = (TakesScreenshot) driver;\n\t\tFile source = ts.getScreenshotAs(OutputType.FILE);\n\t\tFile target = new File(System.getProperty(\"user.dir\")+ \"\\\\screenshots\\\\\" + testName + \".png\");\n\t\tSystem.out.println(target);\n\t\tFileUtils.copyFile(source, target);\n\t\tSystem.out.println(\"Screenshot Captured for : \" + testName);\n\t}", "public static void captureScreenShot(WebDriver driver) {\n\t\tlogger.info(\"Taking the screenshot\");\n\t\ttry {\n\t\t\tString timeStamp = new SimpleDateFormat(\"yyyy.MM.dd.HH.mm.ss\").format(new Date());\n\n\t\t\tTakesScreenshot ScrObj = (TakesScreenshot) driver;\n\n\t\t\tThread.sleep(3000);\n\n\t\t\tFile CaptureImg = ScrObj.getScreenshotAs(OutputType.FILE);\n\t\t\tFileUtils.copyFile(CaptureImg, new File(\"./Screenshots/\" + timeStamp + \"_screenshot.png\"));\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tlogger.error(\"Error occured while Capturing Screenshot\");\n\t\t}\n\t}", "public static String takeScreenshot(String filename) {\n\t\tTakesScreenshot ts= (TakesScreenshot)driver;\n\t\tFile file=ts.getScreenshotAs(OutputType.FILE);\n\t\tString destinationFile=Constants.SCREENSHOT_FILEPATH+filename+\".png\";\n\t\ttry {\n\t\tFileUtils.copyFile(file, new File(\"screenshot/\"+filename+\".pig\"));\n\t\t}catch (Exception ex) {\n\t\t\tSystem.out.println(\"Cannot take screenshot!\");\n\t\t}\n\t\treturn destinationFile;\n\t}", "public static void takeScreenShot(String sFileName) throws IOException {\n\t\tTakesScreenshot scrShot =((TakesScreenshot)driver);\n\t\tString fileWithPath = (prop.getProperty(\"SCREENSHOT_DIR\") + \"\\\\\"+ sFileName);\n\t\tFile SrcFile=scrShot.getScreenshotAs(OutputType.FILE);\n\t\tFile DestFile=new File(fileWithPath);\n\t\tFileUtils.copyFile(SrcFile, DestFile);\n\t}", "private void makeScreenshot(TakesScreenshot d) {\n\t\tFile screenshot = d.getScreenshotAs(OutputType.FILE);\n\t\ttry {\n\t\t\tFileUtils.copyFile(screenshot, new File(screenshot.getName()));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void takeScreenshot()\n\t\t{\n\t\t\tint width = getWidth();\n\t\t\tint height = getHeight();\n\t\t\tint capacity = width * height;\n\t\t\tint[] dataArray = new int[capacity];\n\t\t\tIntBuffer dataBuffer = IntBuffer.allocate(capacity);\n\t\t\tGLES20.glReadPixels(0, 0, width, height, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, dataBuffer);\n\t\t\tint[] dataArrayTemp = dataBuffer.array();\n\n\t\t\t// Flip the mirrored image.\n\t\t\tfor (int y = 0; y < height; y++)\n\t\t\t{\n\t\t\t\tSystem.arraycopy(dataArrayTemp, y * width, dataArray, (height - y - 1) * width, width);\n\t\t\t}\n\n\t\t\tBitmap screenshot = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);\n\t\t\tscreenshot.copyPixelsFromBuffer(IntBuffer.wrap(dataArray));\n\t\t\tBitmap thumbnail = Bitmap.createScaledBitmap(screenshot, width / THUMBNAIL_SHRINKING_FACTOR, height / THUMBNAIL_SHRINKING_FACTOR, true);\n\t\t\tproject.getSheetAt(screenshotSheetIndex).saveThumbnail(thumbnail);\n\t\t\tBitmapDrawable thumbnailDrawable = new BitmapDrawable(getResources(), thumbnail);\n\t\t\tproject.getSheetAt(screenshotSheetIndex).setThumbnail(thumbnailDrawable);\n\n\t\t\t// Refresh the sheet panel if the user is not requesting an exit.\n\t\t\tif (activity.taskRequested != NotepadActivity.TASK_EXIT)\n\t\t\t{\n\t\t\t\tactivity.refreshSheetDrawerAfterGeneratingThumbnail();\n\t\t\t}\n\n\t\t\t// The project thumbnail should be twice the width and height of a sheet thumbnail.\n\t\t\tBitmap projectThumbnail = Bitmap.createScaledBitmap(\n\t\t\t\t\tscreenshot, (width * 2) / THUMBNAIL_SHRINKING_FACTOR, (height * 2) / THUMBNAIL_SHRINKING_FACTOR, true);\n\t\t\tproject.saveThumbnail(projectThumbnail);\n\n\t\t\tif (activity.taskRequested > 0)\n\t\t\t{\n\t\t\t\tpost(new Runnable()\n\t\t\t\t{\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run()\n\t\t\t\t\t{\n\t\t\t\t\t\tactivity.performTask();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}", "public static void takeScreenshot(String fileName) throws IOException\n\t {\n\t\t File file=((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\n\t\t \n\t\t // copying the screenshot to the desired loacation by copyFile method\n\t\t String timestamp = new SimpleDateFormat(\"yyyy_MM_dd__hh_mm_ss\").format(new Date());\n\t\t \n\t\t FileUtils.copyFile(file, new File(\"E:\\\\screenshots\\\\\"+fileName+\" \"+timestamp+\" .jpg\"));\n\t\t \n\t }", "public static void takeSnapShot(WebDriver webdriver, String fPath) throws Exception {\n\n //Convert web driver object to TakeScreenshot\n TakesScreenshot scrShot = ((TakesScreenshot) webdriver);\n\n //Call getScreenshotAs method to create image file\n File SrcFile = scrShot.getScreenshotAs(OutputType.FILE);\n\n //Move image file to new destination\n File DestFile = new File(fPath);\n\n //Copy file at destination\n FileUtils.copyFile(SrcFile, DestFile);\n\n }", "public static String capture(AndroidDriver driver, String screenShotName) throws IOException {\n\t\tFile source = driver.getScreenshotAs(OutputType.FILE);\n\t\tString dest = MyExtentListners.screenShotPath + screenShotName + \".png\";\n\t\tSystem.out.println(dest);\n\t\tFile destination = new File(dest);\n\t\tFileUtils.copyFile(source, destination);\n\t\treturn dest;\n\t}", "public static String captureScreenshot(String scenariopath) {\n\t\tDate date = new Date();\r\n\t\tString snaptime = dateformat.format(date);\r\n\t\tString result=\"false\";\r\n\t\ttry {\r\n\t\t\tWebDriver augumentdriver = new Augmenter().augment(driver);\r\n\t\t\tFile source = ((TakesScreenshot) augumentdriver).getScreenshotAs(OutputType.FILE);\r\n\t\t\tString currentDate = new SimpleDateFormat(\"dd-mm-yyyy hh:mm:ss\").format(new Date());\r\n\t\t\tString path =\".//screenshots//\" + scenariopath+\"_\"+ snaptime + \".png\";\r\n\t\t\tfinal BufferedImage image = ImageIO.read(source);\r\n\t\t\tGraphics g = image.getGraphics();\r\n\t\t\tg.setFont(g.getFont().deriveFont(20f));\r\n\t\t\tg.setColor(Color.GREEN);\r\n\t\t\tg.drawString(currentDate, 20, 20);\r\n\t\t\tg.dispose();\r\n\t\t\tImageIO.write(image, \"png\", new File(path));\r\n\t\t\tresult= path;\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Unable to take screenshot\");\r\n\t\t}\r\n\t\treturn result;\r\n\r\n\t}", "public static String capture(WebDriver driver, String screenShotName) throws IOException {\n\n TakesScreenshot ts = (TakesScreenshot) driver;\n File source = ts.getScreenshotAs(OutputType.FILE);\n String dest = \"target/extent/screenshots/\" + screenShotName + \".png\";\n File destination = new File(dest);\n FileUtils.copyFile(source, destination);\n String loctionForReport = \"screenshots/\" + screenShotName + \".png\";\n return loctionForReport;\n }", "public static String captureScreenshot(WebDriver driver,String screenshotName){\n\t\tTakesScreenshot ts=(TakesScreenshot)driver;\n\t\t//2.Take screen shot and define file type with a File Class:MAKE IT SOURCE FILE\n\t\tFile src=ts.getScreenshotAs(OutputType.FILE);\n\t\t//3.DEFINE where the taken screen shot will be save as FILE\n\t\tString destFilePath=(\"\\\\Users\\\\metootopa\\\\Desktop\\\\ECLIPSE_TEST\\\\com.MyAPP.HybridFrame\\\\ScreenShots\\\\\");\n\t\tString destFile=destFilePath+ screenshotName+ System.currentTimeMillis()+\".png\";\n\t\t//4.set src file to destinatoion folder\n\t\ttry {\n\t\t\tFileUtils.copyFile(src, new File(destFile));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Screenshot was not Successfull\"+e.getMessage());\n\t\t}\n\t\t\n\t\treturn destFile;\n\t\t\n\t\t\n\t\t\n\t}", "public void screenshot() {\n\t\tRemoteWebDriver rwd = ((RemoteWebDriver) web.driver);\r\n\t\ttry {\r\n\t\t\trwd.getCommandExecutor().execute(new Command(rwd.getSessionId(), DriverCommand.ELEMENT_SCREENSHOT));\r\n\t\t} catch (IOException e) {\r\n\t\t\tlogger.reportStackTrace(e);\r\n\t\t}\r\n\r\n\t}", "@Test\n public void myTest() throws Exception {\n\n WebDriver driver = new ChromeDriver();\n\n driver.get(\"http://www.google.com\");\n\n // RemoteWebDriver does not implement the TakesScreenshot class\n // if the driver does have the Capabilities to take a screenshot\n // then Augmenter will add the TakesScreenshot methods to the instance\n WebDriver augmentedDriver = new Augmenter().augment(driver);\n File screenshot = ((TakesScreenshot) augmentedDriver).getScreenshotAs(OutputType.FILE);\n\n\n //File screenshot = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\n // Now you can do whatever you need to do with it, for example copy somewhere\n FileUtils.copyFile(screenshot, new File(\"C:\\\\Dev\\\\screenshot.png\"));\n\n driver.quit();\n }", "public static void getScreenShot(String description, WebDriver driver, long milliseconds) throws IOException {\n\t\t DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd, HH.mm.ss\");\n\t\t File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\n\t\t String outputFile = Common.outputFileDir + description + \" (\" + dateFormat.format(milliseconds) + \").png\";\n\t\t fileWriterPrinter(outputFile);\n\t\t FileUtils.copyFile(scrFile, new File(outputFile));\n\t\t }", "public void screenShot() {\n\n\t}", "public void takeScreenshot( ) throws IOException {\n File source = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\n String path = \"./reports/target/screenshots/\" + source.getName();\n FileUtils.copyFile(source, new File(path));\n }", "public String takeScreenShotofFailure(String screenShot, WebDriver driver) throws Exception {\n\n\t\tString timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\")\n\t\t\t\t.format(Calendar.getInstance().getTime());\n\t\tSystem.out.println(\"Before taking screen shot\");\n\t\tTestLog.log.info(\"Before taking screen shot\");\n\t\tFile imageFile = ((TakesScreenshot) driver)\n\t\t\t\t.getScreenshotAs(OutputType.FILE);\n\t\tSystem.out.println(\"Created imgage file\");\n\t\tTestLog.log.info(\"Created imgage file\");\n\t\tString screenShotName = screenShot + \"_\" + timeStamp + \".png\";\n\n\t\t// It will store all the screenshots in test-output/screenshots folder\n\t\tString destDir = System.getProperty(\"user.dir\") + \"/\"\n\t\t\t\t+ \"test-output/ScreenShots\";\n\t\tnew File(destDir).mkdirs();\n\t\tString destFile = destDir + \"/\" + screenShotName;\n\t\tFileUtils.copyFile(imageFile, new File(destFile));\n\t\tSystem.out.println(\"Saving file\");\n\t\tTestLog.log.info(\"Saving file\");\n\t\treturn destFile;\n\t\t\n\t}", "public static void takeScreenShot(String filePath, String fileName) throws IOException { \n\t\ttry { \n\t\t\tFile scrFile = ((TakesScreenshot)SeleniumDriverManager.getManager().getDriver())\n\t\t\t\t\t.getScreenshotAs(OutputType.FILE); \n\t\t\tFileUtils.copyFile(scrFile, new File(filePath + fileName)); \n\t\t} catch (Exception e) { \n\t\t\te.printStackTrace(); \n\t\t} \n\t}", "private String createScreenshotFilePath() {\n String fileName = new SimpleDateFormat(FILE_NAME_FORMAT).format(new Date());\n String filePath = MainMenu.PUBLIC_EXTERNAL_PICTURES_ORION_PATH + fileName;\n return filePath;\n }", "public void screenShot(String name)\n\t{\n\t\tFile f1=((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\n\t\tFile f2=new File(\"src/test/resources/ScreenShots/\"+name+\".png\");\n\t\ttry \n\t\t{\n\t\t\tFileUtils.copyFile(f1,f2);\n\t\t\tlog.update(\"ScreenShot taken in name of \"+name);\n\t\t} \n\t\tcatch (IOException e) \n\t\t{\n\t\t\te.printStackTrace();\n\t\t\tlog.update(\"Error in taking ScreenShots\");\n\t\t}\n\t\tcatch(IncompatibleClassChangeError e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\tlog.update(\"Exception in incompatile class change error method\");\n\t\t}\n\t}", "public void storeScreenshot(Bitmap bitmap, String filename)\n {\n String path = \"/storage/self/primary/Pictures/\" + filename;\n OutputStream out = null;\n File imageFile = new File(path);\n try\n {\n out = new FileOutputStream(imageFile);\n bitmap.compress(Bitmap.CompressFormat.JPEG, 90,out);\n out.flush();\n }\n catch(FileNotFoundException e)\n {\n e.printStackTrace();\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try\n {\n if(out != null)\n out.close();\n }\n catch(Exception e)\n {\n e.printStackTrace();\n }\n }\n }", "public static String takeFailedScreenShot() throws IOException {\n\t\tTakesScreenshot scrShot =((TakesScreenshot)driver);\n\t\tString dateName = new SimpleDateFormat(\"yyyyMMddhhmmss\").format(new Date());\n\t\tString fileWithPath = (prop.getProperty(\"FAILEDSCREENSHOT_DIR\") + \"\\\\\"+ GenLogTC() + dateName + \".jpg\");\n\t\tFile SrcFile=scrShot.getScreenshotAs(OutputType.FILE);\n\t\tFile DestFile=new File(fileWithPath);\n\t\tFileUtils.copyFile(SrcFile, DestFile);\n\t\tString absPath = Paths.get(fileWithPath).toAbsolutePath().toString();\n\t\treturn absPath;\n\t}", "public static String captureScreenshotOfDesktop() {\n\t\ttry {\n\t\t\tRobot robot = new Robot();\n\t\t\tBufferedImage tmp = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));\n\t\t\tString path = System.getProperty(\"user.dir\") + \"/Screenshots/\" + System.currentTimeMillis() + \".png\";\n\t\t\tImageIO.write(tmp, \"png\", new File(path));\n\t\t\treturn path;\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Some exception occured.\" + e.getMessage());\n\t\t\treturn null;\n\t\t}\n\n\t}", "public static void getScreenShot(StackTraceElement l, String description, WebDriver driver) throws IOException {\n\t\t DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd, HH.mm.ss\");\n\t\t File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\n\t\t String packageNameOnly = l.getClassName().substring(0, l.getClassName().lastIndexOf(\".\"));\n\t\t String classNameOnly = l.getClassName().substring(1 + l.getClassName().lastIndexOf(\".\"), l.getClassName().length());\n\t\t String screenshotName = classNameOnly + \".\" + l.getMethodName() + \", \" + description +\", line # \" + l.getLineNumber();\n\t\t String outputFile = Common.outputFileDir + packageNameOnly + File.separator + classNameOnly + File.separator + screenshotName + \" (\" + dateFormat.format(new Date()) + \").png\";\n\t\t fileWriterPrinter(outputFile);\n\t\t FileUtils.copyFile(scrFile, new File(outputFile));\n\t\t }", "public static void captureScreenshot(WebDriver browserobject , String screenshotname) \n\t{\n\n\n\t\tPath dest = Paths.get(\"./ScreenShots\",screenshotname+\".png\"); \n\t\ttry {\n\t\t\tFiles.createDirectories(dest.getParent());\n\t\t\tFileOutputStream out = new FileOutputStream(dest.toString());\n\t\t\tout.write(((TakesScreenshot) browserobject).getScreenshotAs(OutputType.BYTES));\n\t\t\tout.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Excpetion while taking screenshot\"+ e.getMessage());\n\t\t}\n\t}", "public static void screenShot(WebDriver driver, String desc) {\n\t\tDate currentTime = new Date();\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd-hh-mm-ss\");\n\t\tString dateString = formatter.format(currentTime);\n\t\tFile scrFile = ((TakesScreenshot) driver)\n\t\t\t\t.getScreenshotAs(OutputType.FILE);\n\t\ttry {\n\t\t\tdesc = desc.trim().equals(\"\") ? \"\" : \"-\" + desc.trim();\n\t\t\tFile screenshot = new File(\"screenshot\" + File.separator\n\t\t\t\t\t+ dateString + desc + \".png\");\n\t\t\tFileUtils.copyFile(scrFile, screenshot);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static String capture(AndroidDriver driver, String screenShotName) throws IOException {\n\t\tFile source = driver.getScreenshotAs(OutputType.FILE);\n\t\tString dest = Constants.screenShotPath + screenShotName + \".png\";\n\t\tFile destination = new File(dest);\n\t\tFileUtils.copyFile(source, destination);\n\t\treturn dest;\n\t}", "public void takeScreenShot (WebDriver driver, String screenshotname) {\n\t\t\t File source = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\n\t\t\t // Define path where Screenshots will be saved\n\t\t\n\t\t\t //Copy the source file at the screenshot path\n\t\t\t try {\n\t\t\t\tFileUtils.copyFile(source, new File(\"./ScreenShots/\" + screenshotname +\".png\"));\n\t\t\t} catch (IOException e1) {}\n\t\t\t try {\n//\t\t\t\t Change the thread value to run test files with delay\n\t\t\t\t\tThread.sleep(3_000);\n\t\t\t\t} catch (InterruptedException e) {}\n\t\t }", "public void getScreenshot(String path) {\n\n String screenshotPath;\n String timestamp = testHelper.getTimestamp();\n\n screenshotPath = path + \"//\" + timestamp + \".JPG\";\n try {\n setUpScreenshot(screenshotPath);\n } catch (WebDriverException e) {\n LOGGER.log(Level.INFO,\n MESSAGE_WEB_DRIVER_EXCEPTION_IN_GET_SCREENSHOT_METHOD, e);\n } catch (IOException e) {\n LOGGER.log(Level.INFO,\n MESSAGE_IO_EXCEPTION_IN_GET_SCREENSHOT_METHOD, e);\n }\n\n }", "protected String getScreenshot(String screenshotName) throws Exception {\r\n //below line is just to append the date format with the screenshot name to avoid duplicate names\r\n String currentTimeStamp = new SimpleDateFormat(\"yyyyMMddhhmmss\").format(new Date());\r\n String filename = screenshotName + currentTimeStamp + \".png\";\r\n\r\n\r\n TakesScreenshot ts = (TakesScreenshot) driver;\r\n File source = ts.getScreenshotAs(OutputType.FILE);\r\n\r\n //after execution, you could see a folder \"FailedTestsScreenshots\" under src folder\r\n String destination = System.getProperty(\"user.dir\") + jsonConfig.get(\"extentReportPath\") + filename;\r\n File finalDestination = new File(destination);\r\n FileUtils.copyFile(source, finalDestination);\r\n\r\n //Returns the captured file path\r\n return filename;\r\n }", "public static void captureScreenshot() throws IOException {\n\t\tDate d = new Date();\n\t\tscreenshotName = (d.toString().replace(\":\", \"_\").replace(\" \", \"_\"))+\".jpg\";\n\t\tscreenshotLocation1 = (System.getProperty(\"user.dir\"))+(\"\\\\target\\\\surefire-reports\\\\html\\\\\")+screenshotName;\n\t\tscreenshotLocation2 = (System.getProperty(\"user.dir\")+\"\\\\test-output\\\\html\\\\\"+screenshotName);\n\t\t\n\t\t//TakesScreenshot on failure\n\t\tFile screenshot = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\n\t\t//add screenshot to the report - Surefire & reportng\n\t\tFileUtils.copyFile(screenshot, new File(screenshotLocation1));\n\t\tFileUtils.copyFile(screenshot, new File(screenshotLocation2));\n\t\ttest.log(LogStatus.INFO, \"Screenshot captured on failure of testcase\");\n\t\t\n\t}", "public static byte[] takeScreenshot(String filename) {\n\t\tTakesScreenshot ts = (TakesScreenshot) driver;\n\t\tbyte[] picBytes=ts.getScreenshotAs(OutputType.BYTES);\n\t\tFile file = ts.getScreenshotAs(OutputType.FILE);\n\t\tString destinationFile=Constants.SCREENSHOT_FILEPATH+filename+getTimeStamp()+\".png\";\n\t\ttry {\n\t\t\tFileUtils.copyFile(file, new File(destinationFile));\n\t\t} catch (Exception ex) {\n\t\t\tSystem.out.println(\"Cannot take screenshot!\");\n\t\t}\n\t\t\n\t\treturn picBytes;\n\t}", "public static void rep_GetScreenshot(String outputlocation, String strFileName) throws IOException {\n File srcFiler = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);\n FileUtils.copyFile(srcFiler, new File(outputlocation + strFileName));\n rep_Report(2, \"Screen shot saved\");\n }", "public static void takeScreenshot(View view, String filePath) {\n Bitmap bitmap;\n View v1 = view.getRootView();\n v1.setDrawingCacheEnabled(true);\n bitmap = Bitmap.createBitmap(v1.getDrawingCache());\n v1.setDrawingCacheEnabled(false);\n\n OutputStream fout = null;\n File imageFile = new File(filePath);\n\n try {\n fout = new FileOutputStream(imageFile);\n bitmap.compress(Bitmap.CompressFormat.JPEG, 90, fout);\n fout.flush();\n fout.close();\n\n } catch (FileNotFoundException e) {\n Log.e(C.TAG, \"screenshot error\", e);\n } catch (IOException e) {\n Log.e(C.TAG, \"screenshot error\", e);\n }\n }", "public void snapshot(TakesScreenshot drivername, String foldername,String filename) {\r\n\t\t// this method will take screen shot ,require two parameters ,one is\r\n\t\t// driver name, another is file name\r\n String timeString=ts.getTimeString();\r\n\t\tString currentPath = System.getProperty(\"user.dir\");\r\n\t\t// get current workfolder\r\n\t\tFile scrFile = drivername.getScreenshotAs(OutputType.FILE);\r\n\t\t// Now you can do whatever you need to do with it, for example copy\r\n\t\t// somewhere\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"save snapshot path is:\" + currentPath + \"/\"\r\n\t\t\t\t\t+ filename + \".jpg\");\r\n\t\t\tFileUtils.copyFile(scrFile, new File(currentPath +\"\\\\\"+ \"screenshot\"+\"\\\\\"+timeString+\"\\\\\" +foldername+ \"\\\\\"+filename\r\n\t\t\t\t\t+ \".jpg\"));\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"Can't save screenshot\");\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\tSystem.out.println(\"screen shot finished, it's in \" + currentPath\r\n\t\t\t\t\t+ \" folder\");\r\n\t\t}\r\n\t}", "private Bitmap takeShareableScreenshot() {\n // https://stackoverflow.com/questions/2661536/how-to-programmatically-take-a-screenshot-in-android\n// cameraActionLayout.setVisibility(View.GONE);\n// resultLayout.setVisibility(View.GONE);\n try {\n // create bitmap screen capture\n View v1 = getWindow().getDecorView().getRootView();\n v1.setDrawingCacheEnabled(true);\n return Bitmap.createBitmap(v1.getDrawingCache());\n } catch (Throwable e) {\n // Several error may come out with file handling or OOM\n e.printStackTrace();\n makeToast(e.toString());\n Timber.e(\"Error capturing screenshot: \" + e.toString());\n return null;\n }\n// finally {\n// cameraActionLayout.setVisibility(View.VISIBLE);\n// resultLayout.setVisibility(View.VISIBLE);\n// }\n }", "public static void screenshot() throws IOException {\n\tFile src = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);\n\n\t// copy to project location\n\tFileUtils.copyFile(src,\n\t\t\tnew File(System.getProperty(\"user.dir\") + \"\\\\src\\\\\" + \"screenshot_\" + timeStamp() + \".png\"));\n\n}", "private void takeScreenShot(final View v) {\n // Get device dimmensions\n Display display = getWindowManager().getDefaultDisplay();\n Point size = new Point();\n display.getSize(size);\n\n // create bitmap screen capture\n\n View view = v.getRootView();\n view.setDrawingCacheEnabled(true);\n // Create the bitmap to use to draw the screenshot\n final Bitmap bitmap = Bitmap.createBitmap(size.x, size.y, Bitmap.Config.ARGB_4444);\n final Canvas canvas = new Canvas(bitmap);\n\n // Get current theme to know which background to use\n final Activity activity = this;\n final Resources.Theme theme = activity.getTheme();\n final TypedArray ta = theme\n .obtainStyledAttributes(new int[]{android.R.attr.windowBackground});\n final int res = ta.getResourceId(0, 0);\n final Drawable background = activity.getResources().getDrawable(res);\n\n // Draw background\n background.draw(canvas);\n\n // Draw views\n view.draw(canvas);\n\n // Save the screenshot to the file system\n FileOutputStream fos;\n try {\n\n final File sddir = new File(SCREENSHOTS_LOCATIONS);\n\n if (!sddir.exists()) {\n sddir.mkdirs();\n }\n\n mQuestionScreenShotName = \"question_capture\"\n + System.currentTimeMillis() + \".jpg\";\n\n mQuestionImagePath = SCREENSHOTS_LOCATIONS + mQuestionScreenShotName;\n\n fos = new FileOutputStream(mQuestionImagePath);\n\n if (!bitmap.compress(Bitmap.CompressFormat.JPEG, 90, fos)) {\n return;\n }\n fos.flush();\n fos.close();\n\n } catch (FileNotFoundException e) {\n\n e.printStackTrace();\n } catch (IOException e) {\n\n e.printStackTrace();\n }\n }", "public static void takeScreenshotAtEndOfTest() throws IOException {\n\t\t//Take screenshot.\n\t\t\t\tFile scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);//output type is file type//coverting driver to take a screen shot TakesScreenshot(I) and then getScreenshotAs this method will execute \n\t\t//Copy to a file\t\t\n\t\t\t\tString currentDir = System.getProperty(\"user.dir\");\n\t\t\t\tFileUtils.copyFile(scrFile, new File(currentDir + \"/screenshots/\" + System.currentTimeMillis() + \".png\"));\n\t\t\t\t\n\t\t\t\t}", "public void takeScreenShot() {\r\n \t\tgraph.clearSelection();\r\n \t\tgraph.showScreenShotDialog();\r\n \t}", "public final File takeScreenshot() {\n\t\treturn ((TakesScreenshot) this.webDriver).getScreenshotAs(OutputType.FILE);\n\t}", "public static String takeScreenShot(String methodName) throws Exception {\n\n\t\ttry {\n\t\t\tdateStamp=Calendar.getInstance().getTime().toString().split(\":\")[0].replaceAll(\" \", \"_\");\n\t\t\tfileDirectory=new File(\"\\\\\"+LoadProperty.getPropertyInstance().getProperty(\"SCREENSHOT_LOCATION\")+\"/\"+dateStamp);\n\t\t\tif(!fileDirectory.exists()) {\n\t\t\t\tfileDirectory.mkdir();\n\t\t\t}\n\t\t\tscreenShot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);\n\t\t\t\n\t\t\tfilePath = fileDirectory + \"\\\\\" + methodName.replaceAll(\" \", \"_\") + \"_\"+ getTimeStamp() + \".jpg\";\n\t\t\tFileUtils.copyFile(screenShot, new File(filePath));\n\t\t\treturn filePath;\n\t\t} catch (Exception e) {\n\t\t\tthrow (new Exception());\n\t\t}\n\t}", "public String saveBitmap(Bitmap bitmap){\n String imagePath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)+ \"/screenshot.png\";\n File mFile = new File(imagePath);\n FileOutputStream outputStream;\n try\n {\n outputStream = new FileOutputStream(mFile);\n bitmap.compress(Bitmap.CompressFormat.PNG, 100, outputStream);\n outputStream.flush();\n outputStream.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return imagePath;\n }", "public static Screenshot takeScreenShot() {\n\t\tScreenshot screenshot = new AShot().shootingStrategy(ShootingStrategies.viewportPasting(1000))\n\t\t\t\t.takeScreenshot(driver);\n\t\treturn screenshot;\n\t}", "public static void captureScreenshot(WebDriver driver , String screenshotname) \n\t{\n\t\tPath dest = Paths.get(\"./Screenshots\",screenshotname+\".png\"); \n\t\t\n\t\ttry {\n\t\t\tFiles.createDirectories(dest.getParent());\n\t\t\tFileOutputStream out = new FileOutputStream(dest.toString());\n\t\t\tout.write(((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES));\n\t\t\tout.close();\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Excpetion while taking screenshot: \"+ e.getMessage());\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tWebDriver driver = new FirefoxDriver();\r\n\t\tdriver.get(\"https://www.facebook.com\");\r\n\t\t/*TakesScreenshot tss = (TakesScreenshot) driver;\r\n\t\tFile source = tss.getScreenshotAs(OutputType.FILE);instead of this we can also write as following*/\r\n\t\tFile source = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);\r\n\t\t/*File destination = new File(\"C:\\\\Users\\\\pva\\\\facebook.jpg\");\r\n\t\ttry {\r\n\t\t\tFileUtils.copyFile(source, destination);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();*/\r\n\t\t}", "public static void captureScreenshot(WebDriver driver , String screenshotname) throws IOException \n\t{\n\t\tPath dest = Paths.get(\"./ScreenShots\",screenshotname+\"gh.png\"); \n\t\t\n\t\t//take screenshot\n\t\tFile scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);\n\t\t//copy the screen shot to another file\n\t\tFileUtils.copyFile(scrFile, new File(dest.toString()));\n\t}", "public static void getscreenshotAs(WebDriver driver) throws IOException {\n\t\tdriver.get(\"https://www.rahulshettyacademy.com/AutomationPractice/\");\n\t\t\n\t\tFile SrcFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);\n\t\tFile DestFile = new File(\"D:\\\\ECLIPSE\\\\screenshot\\\\New folder.png\");\n\n\t\tFileUtils.copyFile(SrcFile, DestFile);\n\t}", "public Bitmap makeScreenshot() {\n renderer.setScreenshot();\n requestRender();\n return renderer.getLastScreenshot();\n }", "public String captureScreenshot(WebDriver driver, String testName) {\n String randomValue = \"_\" + StringUtils.getRandomAlphaNumeric(5);\n String fullPath = System.getProperty(\"user.dir\") + \"/screenshots/\" + testName + randomValue + \".png\";\n String captured = \"No\";\n try {\n WebDriver augmentedDriver = new Augmenter().augment(driver);\n File source = ((TakesScreenshot) augmentedDriver).getScreenshotAs(OutputType.FILE);\n FileUtils.copyFile(source, new File(fullPath));\n return fullPath;\n } catch (IOException e) {\n error(\"Failed to capture screenshot: <br/>\" + e.getMessage());\n error(Throwables.getStackTraceAsString(e));\n return captured;\n }\n }", "public void fTakeScreenshot(String SSPath){\r\n \ttry{ \t\t\r\n \t\tWebDriver screenDriver;\r\n \t\tif(driverType.contains(\"FIREFOX\") || driverType.contains(\"CHROME\") || driverType.contains(\"IE\")){\r\n \t\t\tscreenDriver = driver;\r\n \t\t}else{\r\n \t\t\tscreenDriver = new Augmenter().augment(driver);\r\n \t\t}\r\n \t\t\r\n File scrFile = ((TakesScreenshot)screenDriver).getScreenshotAs(OutputType.FILE);\r\n \t FileUtils.copyFile(scrFile, new File(SSPath));\r\n \t\ttry {\r\n \t\t\tThread.sleep(1);\r\n \t\t} catch (InterruptedException e) {\r\n \t\t\te.printStackTrace();\r\n \t\t}\r\n \t\tscreenDriver = null;\r\n \t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n }", "public ImageIcon takeSnapShot(Component panel){\r\n // BufferedImage bufImage = new BufferedImage(panel.getSize().width, panel.getSize().height,BufferedImage.TYPE_INT_RGB);\r\n BufferedImage bufImage = new BufferedImage(2250, 2250,BufferedImage.TYPE_INT_RGB);\r\n panel.paint(bufImage.createGraphics());\r\n ImageIcon imageIcon = new ImageIcon(bufImage);\r\n String snapshotLocation = FileSystemView.getFileSystemView().getDefaultDirectory().toString() + \"\\\\spaceGUI\\\\yourImage.jpeg\";\r\n File fc = new File(snapshotLocation.substring(0,snapshotLocation.indexOf(\"yourImage.jpeg\")));\r\n if(!fc.exists()) {\r\n fc.mkdir();\r\n }\r\n File imageFile = new File(snapshotLocation);\r\n try{\r\n imageFile.createNewFile();\r\n ImageIO.write(bufImage, \"jpeg\", imageFile);\r\n System.out.println(\"Created picture\");\r\n \r\n }catch(Exception ex){\r\n System.out.println(\"Did not create picture\");\r\n } \r\n return imageIcon;\r\n }", "public static void take(WebDriver driver){\n try {\n Thread.sleep(5000);\n }catch (InterruptedException e){\n e.printStackTrace();\n }\n\n\n Screenshot screenshot = new AShot()\n .shootingStrategy(ShootingStrategies.viewportPasting(100))\n .takeScreenshot(driver);\n\n try {\n ImageIO.write(screenshot.getImage(), \"png\", new File(\"/home/stanislav/123.png\"));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void getScreenshot() {\n String screenshotPath = System.getProperty(\"TEST_RESULTS_PATH\");\n getScreenshot(screenshotPath);\n }", "public static String CaptureScreenShotWithTestStepName(WebDriver driver, String testStepName) {\n\t\ttry {\n\t\t\tTakesScreenshot ts = (TakesScreenshot) driver;\n\t\t\tFile screenshotSRC = ts.getScreenshotAs(OutputType.FILE);\n\t\t\tString path = System.getProperty(\"user.dir\") + \"/Screenshots/\" + testStepName + System.currentTimeMillis()\n\t\t\t\t\t+ \".png\";\n\t\t\tFile screenshotDest = new File(path);\n\t\t\tFileUtils.copyFile(screenshotSRC, screenshotDest);\n\t\t\treturn path;\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Some exception occured.\" + e.getMessage());\n\t\t\treturn null;\n\t\t}\n\t}", "public static String getScreenshot(String testclass, String testname) throws IOException {\n\n\t\t//log.info(\"taking screenshot for failed test case: \" + testclass + \"_\" + testname);\n\t\tString filePath = \"./src/test/resources/screenshots/\";\n\t\tString timestamp = new SimpleDateFormat(\"yyyyMMddhhmmss\").format(new Date());\n\n\t\tString path = filePath + testclass + \"_\" + testname + \"_\" + timestamp;\n\n\t\tFile scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);\n\n\t\ttry {\n\t\t\tFileUtils.copyFile(scrFile, new File(path + \".png\"));\n\t\t\t//log.info(\"screenshot captured at: \" + path + \".png\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn path + \".png\";\n\t}", "public static String getScreenshot(String screenshotName) throws IOException {\n\t\tString dateName = new SimpleDateFormat(dateFormat).format(new Date());\n\t\tTakesScreenshot ts = (TakesScreenshot) driver;\n\t\tsource = ts.getScreenshotAs(OutputType.FILE);\n\t\tString destination = screenShotPath + screenshotName + nameSeparator + dateName + screenShotType;\n\t\tfinalDestination = new File(destination);\n\t\tFileUtils.copyFile(source, finalDestination);\n\t\treturn destination;\n\t}", "public static void main(String[] args) throws Exception{\n Home_Page.lnk_SignIn().click();\n LogIn_Page.txtbx_UserName().sendKeys(Constant.Username);\n LogIn_Page.txtbx_Password().sendKeys(Constant.Password);\n LogIn_Page.btn_LogIn().click();\n System.out.println(\" Login Successfully, now it is the time to Log Off buddy.\");\n Home_Page.lnk_LogOut().click(); \n File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\n System.out.println(System.getProperty(\"user.dir\") + \"//data//CaptureScreenshot//google.jpg\");\n FileUtils.copyFile(scrFile, new File(System.getProperty(\"user.dir\") + \"//data//CaptureScreenshot//google.jpg\"));\n driver.quit();\n }", "public static void takeSnapShot(WebDriver webdriver, String fileWithPath) throws Exception {\n //Convert web driver object to TakeScreenshot\n TakesScreenshot scrShot = ((TakesScreenshot) webdriver);\n //Call getScreenshotAs method to create image file\n File SrcFile = scrShot.getScreenshotAs(OutputType.FILE);\n //Move image file to new destination\n File DestFile = new File(\"/home/svyazemsky/JavaProjects/newqajava/src/test/java/Lesson8/screenshots/\" + fileWithPath);\n System.out.println(DestFile);\n //Copy file at destination\n com.google.common.io.Files.copy(SrcFile, DestFile);\n }", "public String takeScreenshot(String basename) {\n String screenshotFile = createScreenshot(basename);\n if (screenshotFile == null) {\n throw new RuntimeException(\"Unable to take screenshot: does the webdriver support it?\");\n } else {\n if (screenshotFile.startsWith(FILES_DIR)) {\n // make href to screenshot\n String relativeFile = screenshotFile.substring(FILES_DIR.length());\n relativeFile = relativeFile.replace('\\\\', '/');\n String wikiUrl = \"/files\" + relativeFile;\n if (\"\".equals(screenshotHeight)) {\n wikiUrl = String.format(\"<a href=\\\"%s\\\">%s</a>\",\n wikiUrl, screenshotFile);\n } else {\n wikiUrl = String.format(\"<a href=\\\"%1$s\\\"><img src=\\\"%1$s\\\" title=\\\"%2$s\\\" height=\\\"%3$s\\\"></a>\",\n wikiUrl, screenshotFile, screenshotHeight);\n }\n screenshotFile = wikiUrl;\n }\n }\n return screenshotFile;\n }", "public static File saveBitmapToFile(Bitmap bitmap)\n {\n File path = Environment.getExternalStorageDirectory();\n File file = new File(path, PATH + NAME);\n try\n {\n \tfile.createNewFile();\n\t\t\tFileOutputStream ostream = new FileOutputStream(file);\n\t\t\tbitmap.compress(CompressFormat.PNG, 100, ostream);\n\t\t\tostream.close();\n\t\t\tLog.i(\"UTIL\", \"Screen-Shot.jpeg written successfully.\");\n\t\t\t\n\t\t\treturn file;\n }\n catch (Exception e){ e.printStackTrace(); }\n return null; \n }", "public void captureScreenshot(String path_screenshot, String testCaseName) {\n try {\n File srcFile = ((TakesScreenshot) getDriver()).getScreenshotAs(OutputType.FILE);\n String filename = testCaseName + \"_\" + UUID.randomUUID().toString();\n File targetFile = new File(path_screenshot + filename + \".jpg\");\n FileUtils.copyFile(srcFile, targetFile);\n } catch (Exception e) {\n error(\"Failed while capturing screenshot\");\n error(Throwables.getStackTraceAsString(e));\n }\n }", "public static void getFullScreenShot(WebDriver driver,String fileToSave) throws IOException{\n\t\tFile scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\r\n\t\tFileUtils.copyFile(scrFile, new File(fileToSave));\r\n\t}", "private Bitmap takeScreenShot(int x, int y, int width, int hight) {\n\t\tif (checkPath(PATH))\n\t\t\treturn ScreenShotWorker.getScreenBitmap(this);\n\t\treturn null;\n\t}" ]
[ "0.80313915", "0.7875923", "0.7755495", "0.76872176", "0.75431526", "0.75195813", "0.7464618", "0.74434614", "0.7350501", "0.7328561", "0.7320652", "0.7303937", "0.7298942", "0.72940266", "0.72765005", "0.72729164", "0.72726965", "0.7271835", "0.72682", "0.72094715", "0.72046596", "0.71967715", "0.71660715", "0.7145391", "0.7143299", "0.7083541", "0.70657355", "0.7060773", "0.70570433", "0.70408785", "0.7037524", "0.70361745", "0.6988133", "0.6983425", "0.697814", "0.6967248", "0.69504213", "0.6940716", "0.69013035", "0.6868179", "0.6864347", "0.6854936", "0.6833251", "0.6819693", "0.6819466", "0.6781016", "0.67767096", "0.67738163", "0.67699033", "0.67651564", "0.6760699", "0.67590827", "0.6739735", "0.6738974", "0.6738776", "0.6714364", "0.6711251", "0.6699079", "0.6693007", "0.6692965", "0.6687946", "0.66821283", "0.6680858", "0.66660416", "0.66604584", "0.6657079", "0.66567", "0.6655262", "0.66396713", "0.6634836", "0.6634218", "0.66256475", "0.6620115", "0.6615069", "0.6615057", "0.6602535", "0.6591905", "0.6577492", "0.65726864", "0.65409267", "0.6539916", "0.6539089", "0.6527544", "0.6520995", "0.65209913", "0.6498555", "0.64766973", "0.64436054", "0.64407694", "0.64371234", "0.64254546", "0.6420284", "0.64189947", "0.6409313", "0.63936967", "0.6381208", "0.6320566", "0.63161093", "0.6280801", "0.6273167" ]
0.6392065
95
Gets the value of the simulateStyle property.
public boolean isSimulateStyle() { return simulateStyle; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setSimulateStyle(boolean value) {\n this.simulateStyle = value;\n }", "public int getStyle() {\r\n\t\treturn this.style;\r\n\t}", "public String getStyle() {\r\n return style;\r\n }", "public String getStyle() {\n return style;\n }", "public String getStyle() {\n return style;\n }", "public String getStyle() {\n return style;\n }", "public String getStyle() {\n return style;\n }", "public int getStyle() {\r\n\t\treturn style;\r\n\t}", "public String getStyle() {\n\t\treturn style;\n\t}", "public final String getStyleAttribute() {\n return getAttributeValue(\"style\");\n }", "public int getStyle() {\n\treturn style;\n }", "public String getStyle() {\r\n if (style != null) {\r\n return style;\r\n }\r\n ValueBinding vb = getValueBinding(\"style\");\r\n return vb != null ? (String) vb.getValue(getFacesContext()) : null;\r\n }", "public TextStyle getStyle(\n )\n {return style;}", "Style getStyle();", "public RMTextStyle getStyle()\n {\n return new RMTextStyle(_style);\n }", "public NodeStyle getStyle() {\n return style;\n }", "public String getCurrentStyle() {\n modifyStyleIfRequested();\n return currentStyle;\n }", "StyleValue getCSSValue();", "public mxStyleSheet getTextStyle()\n\t{\n\t\treturn textStyle;\n\t}", "public java.lang.String getStyleId()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STYLEID$30);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public org.sirius.client.win32.core.types.Dword getDwStyle() {\n return dwStyle;\n }", "public NodeStyle getCalculatedStyle() {\n return calculatedStyle;\n }", "public String getStyleName() {\r\n return getAttributeAsString(\"styleName\");\r\n }", "public String getColorStyle() {\n return colorStyle;\n }", "private String getStyleAttribute() {\n StringBuilder sb = new StringBuilder();\n\n styleAttribute.forEach((key, value) -> {\n sb.append(key).append(\":\").append(value).append(\";\");\n });\n\n return sb.toString();\n }", "final public String getStyleClass()\n {\n return ComponentUtils.resolveString(getProperty(STYLE_CLASS_KEY));\n }", "public abstract String getStyle();", "public String getStyleNew() {\n return (String) getAttributeInternal(STYLENEW);\n }", "public TextStyle getTextStyle() {\n return this.textStyle;\n }", "public String getStyles() {\n return getState().styles;\n }", "public static ScriptStyle getStyle(int val)\r\n/* 31: */ {\r\n/* 32: 92 */ for (int i = 0; i < styles.length; i++) {\r\n/* 33: 94 */ if (styles[i].getValue() == val) {\r\n/* 34: 96 */ return styles[i];\r\n/* 35: */ }\r\n/* 36: */ }\r\n/* 37:100 */ return NORMAL_SCRIPT;\r\n/* 38: */ }", "public abstract BossStyle getStyle();", "public CodeStyle getStyle(){\r\n\t\treturn m_style;\r\n\t}", "public String getTransitionStyle() {\n\t\treturn transitionStyle;\n\t}", "private OOBibStyle getSelectedStyle() {\n if (selectionModel.getSelected().size() > 0) {\n return selectionModel.getSelected().get(0);\n } else {\n return null;\n }\n }", "public String getRowUiStyle() {\r\n return uiRowStyle;\r\n }", "public java.lang.String getStyleName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STYLENAME$32);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "final public String getInlineStyle()\n {\n return ComponentUtils.resolveString(getProperty(INLINE_STYLE_KEY));\n }", "@DISPID(-2147418038)\n @PropGet\n ms.html.IHTMLStyle style();", "public final boolean hasStyle() {\n return hasStyle;\n }", "public StringItemStyle getStringStyle() {\r\n\t\treturn stringStyle;\r\n\t}", "public boolean getSimulate() {\n return this.simulate;\n }", "public org.openxmlformats.schemas.drawingml.x2006.main.STGuid xgetStyleId()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.openxmlformats.schemas.drawingml.x2006.main.STGuid target = null;\n target = (org.openxmlformats.schemas.drawingml.x2006.main.STGuid)get_store().find_attribute_user(STYLEID$30);\n return target;\n }\n }", "@Override\r\n\tpublic String getStyleName() {\r\n\t\treturn _hSplit.getStyleName();\r\n\t}", "public FontStyle getStyle();", "public StyleId getStyleId ();", "@Override\n public String getCSSStyle() {\n return null;\n }", "public org.apache.xmlbeans.XmlString xgetStyleName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(STYLENAME$32);\n return target;\n }\n }", "public mxStyleSheet getFillStyle()\n\t{\n\t\treturn fillStyle;\n\t}", "public String getStyleClass() {\r\n return Util.getQualifiedStyleClass(this,\r\n styleClass, \r\n CSS_DEFAULT.OUTPUT_CHART_DEFAULT_STYLE_CLASS,\r\n \"styleClass\");\r\n }", "public StylePanel getStylePanel();", "public boolean isNewIsDefaultStyle()\r\n {\r\n return myNewIsDefaultStyle;\r\n }", "public int getLineStyle() {\r\n return LineStyle;\r\n }", "public static Style getDefault() { return Style.SHAPE; }", "public int getCellStyle() {\n if (cellStyle != null) {\n return cellStyle;\n }\n setCellStyle(getCellStyle(clazz));\n return cellStyle;\n }", "public mxStyleSheet getLineStyle()\n\t{\n\t\treturn lineStyle;\n\t}", "public String getStyleSeason() {\n return (String)getAttributeInternal(STYLESEASON);\n }", "public RMColor getColor()\n {\n return getStyle().getColor();\n }", "public long getStylesStart() {\n return ByteUtils.toUnsignedInt(stylesStart);\n }", "private static String getStyleClass(Object obj) { return ((MetaData)obj).getStyle(); }", "public void setStyle(String st){\n style = st;\n }", "public static Style get(SoState state)\n { return Style.fromValue(SoInt32Element.get(classStackIndexMap.get(SoPickStyleElement.class), state)); }", "public ParseStyle getTheParseStyle() {\r\n return parseStyle;\r\n }", "public IfcShapeAspect getShapeAspectStyle()\n\t{\n\t\treturn this.ShapeAspectStyle;\n\t}", "public String getFacetValueHoverStyle() {\r\n return getAttributeAsString(\"facetValueHoverStyle\");\r\n }", "public BoardStyle getChosenStyle() {\n\t\treturn boardStyle;\n\t}", "public String getButtonFontStyle() {\r\n\t\tif (_saveButton == null)\r\n\t\t\treturn null;\r\n\t\telse\r\n\t\t\treturn _saveButton.getButtonFontStyle();\r\n\t}", "public long getStyleCount() {\n return ByteUtils.toUnsignedInt(styleCount);\n }", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"{\");\n if (getStyle() != null)\n sb.append(\"Style: \").append(getStyle());\n sb.append(\"}\");\n return sb.toString();\n }", "public VisualizationStyle getNewStyle()\r\n {\r\n return myNewStyle;\r\n }", "UiStyle getUiStyle();", "public org.openxmlformats.schemas.drawingml.x2006.main.CTTablePartStyle getSeCell()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.openxmlformats.schemas.drawingml.x2006.main.CTTablePartStyle target = null;\n target = (org.openxmlformats.schemas.drawingml.x2006.main.CTTablePartStyle)get_store().find_element_user(SECELL$18, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "public RMFormat getFormat()\n {\n return getStyle().getFormat();\n }", "public GrepStyle getGrepStyle()\n\t{\n\t\treturn grepStyle;\n\t}", "public MarkStyle[] getStyles() {\n return styles_;\n }", "QName getStyleAttributeName(String propertyName);", "public org.openxmlformats.schemas.drawingml.x2006.main.CTTablePartStyle getSwCell()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.openxmlformats.schemas.drawingml.x2006.main.CTTablePartStyle target = null;\n target = (org.openxmlformats.schemas.drawingml.x2006.main.CTTablePartStyle)get_store().find_element_user(SWCELL$20, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "@attribute(value = \"\", required = false, defaultValue=\"NONE\")\r\n\tpublic void setStyle(String style) {\r\n\t\t// dummy function for comment\r\n\t}", "@Override\n\tpublic int getAnimationStyle() {\n\t\treturn 0;\n\t}", "public org.apache.xmlbeans.XmlNMTOKENS xgetStyleCode()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlNMTOKENS target = null;\n target = (org.apache.xmlbeans.XmlNMTOKENS)get_store().find_attribute_user(STYLECODE$16);\n return target;\n }\n }", "public org.apache.xmlbeans.XmlNMTOKENS xgetStyleCode()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlNMTOKENS target = null;\n target = (org.apache.xmlbeans.XmlNMTOKENS)get_store().find_attribute_user(STYLECODE$16);\n return target;\n }\n }", "public float getStretchedSpringConst() {\r\n\t\treturn stretchedSpringConst;\r\n\t}", "public VisualizationStyle getOldStyle()\r\n {\r\n return myOldStyle;\r\n }", "private Style getStyle(InstanceWaypoint context) {\n \t\tStyleService ss = (StyleService) PlatformUI.getWorkbench().getService(StyleService.class);\n \t\tInstanceService is = (InstanceService) PlatformUI.getWorkbench().getService(InstanceService.class);\n \t\t\n \t\tInstanceReference ref = context.getValue();\n \t\tInstance instance = is.getInstance(ref);\n \t\t\n \t\treturn ss.getStyle(instance.getDefinition(), ref.getDataSet());\n \t}", "public List<StyleRun> getStyleRuns() {\n return styleRuns;\n }", "public final LineStyle getStyle(){\n return LineStyleUtils.getLineStyle(stroke);\n }", "public Object getDefault(VisualStyle style) {\n \t\tif (style == null)\n \t\t\treturn null;\n \n \t\tAppearance a = null;\n \n \t\tif (isNodeProp())\n \t\t\ta = style.getNodeAppearanceCalculator().getDefaultAppearance();\n \t\telse\n \t\t\ta = style.getEdgeAppearanceCalculator().getDefaultAppearance();\n \n \t\treturn a.get(this);\n \t}", "public default SpawnStyle getSpawnStyle(){ return SpawnStyle.FEET; }", "public void setStyle(String style) {\r\n this.style = style;\r\n }", "public void setStyle(String style) {\r\n this.style = style;\r\n }", "NodeStyle getOwnedStyle();", "public List<HTMLConfigComponent> getStylingList() {\n return stylingList;\n }", "public static native String generateStyle(StyleConfig config) /*-{\r\n\t\tvar configJS = [email protected]::getJsObj()();\r\n\t\treturn $wnd.Ext.DomHelper.generateStyle(configJS);\r\n\t}-*/;", "public void setStyle(String style) {\n this.style = style;\n }", "public native final String style(String name) /*-{\n\t\treturn this.style(name);\n\t}-*/;", "public int getTriggerRound() {\n return triggerRound;\n }", "public java.util.List getStyleCode()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STYLECODE$16);\n if (target == null)\n {\n return null;\n }\n return target.getListValue();\n }\n }", "public java.util.List getStyleCode()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STYLECODE$16);\n if (target == null)\n {\n return null;\n }\n return target.getListValue();\n }\n }", "public com.cognos.developer.schemas.raas.Returns__by__Order__Method___x002d__Prompted__Chart.WordBreakEnum getWordBreakStyle() {\r\n return wordBreakStyle;\r\n }", "@DISPID(1002)\n @PropGet\n ms.html.IHTMLStyle inlineStyles();" ]
[ "0.722103", "0.71560866", "0.7134557", "0.71118826", "0.71118826", "0.71118826", "0.71118826", "0.7085067", "0.7055201", "0.69892627", "0.68956625", "0.6527648", "0.63683254", "0.63669217", "0.63327014", "0.62989503", "0.62525696", "0.62287974", "0.62107897", "0.61636806", "0.6156434", "0.61556125", "0.61016864", "0.6042131", "0.60159487", "0.6007247", "0.59675986", "0.5932569", "0.5891787", "0.58857626", "0.5855953", "0.5852457", "0.5830306", "0.5799082", "0.5791387", "0.5768189", "0.575091", "0.5685892", "0.56840134", "0.5666776", "0.56284285", "0.562633", "0.56085616", "0.5591653", "0.55800396", "0.55777526", "0.55034274", "0.5501364", "0.548768", "0.54772186", "0.5451031", "0.5446862", "0.543249", "0.5416401", "0.5416118", "0.54000276", "0.53801006", "0.5331904", "0.5315158", "0.5314343", "0.5312294", "0.530117", "0.5289311", "0.52618986", "0.525742", "0.5251849", "0.52514356", "0.52388006", "0.5221367", "0.52182597", "0.5217419", "0.52072436", "0.5193235", "0.5183461", "0.5171785", "0.51673937", "0.5167183", "0.5146299", "0.5140625", "0.5139419", "0.5139419", "0.513621", "0.51328075", "0.51309574", "0.5125556", "0.51213837", "0.51151943", "0.509887", "0.5090304", "0.5090304", "0.5087944", "0.508724", "0.50633305", "0.5054387", "0.50422", "0.5040298", "0.50191504", "0.50191504", "0.5001002", "0.49839863" ]
0.77493256
0
Sets the value of the simulateStyle property.
public void setSimulateStyle(boolean value) { this.simulateStyle = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isSimulateStyle() {\n return simulateStyle;\n }", "@attribute(value = \"\", required = false, defaultValue=\"NONE\")\r\n\tpublic void setStyle(String style) {\r\n\t\t// dummy function for comment\r\n\t}", "public void setStyle(String st){\n style = st;\n }", "void setStyle(String style);", "public void setStyle(String style) {\r\n this.style = style;\r\n }", "public void setStyle(String style) {\r\n this.style = style;\r\n }", "public void setStyle(String style) {\n this.style = style;\n }", "public final synchronized void setStyle(int style){\n this.style = style;\n\n if (isLoggedIn()){\n sendCommand(\"$set style \"+style);\n filterLine(\"Style \"+style+\" set.\");\n }\n }", "public synchronized void resetStyle() {\n \t\tstyleInitialized = false;\n \t}", "public void setFillStyle(STYLE style);", "public void setDwStyle(org.sirius.client.win32.core.types.Dword dwStyle) {\n this.dwStyle = dwStyle;\n }", "public void setStrokeStyle(STYLE style);", "public void setStyle(Style style) {\n\t\tmFont = style.font;\n\t\tmFontHeight = mFont.getHeight();\n\t\tmFontColor = style.getFontColor();\n\t\tmTimeStrLen = mFont.stringWidth((Util.TIME_FMT == 24) ? \"00:00 -\" : \"00:00MM -\") + SPACING;\n\t}", "public void setStyleName(java.lang.String styleName)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STYLENAME$32);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(STYLENAME$32);\n }\n target.setStringValue(styleName);\n }\n }", "final public void setStyleClass(String styleClass)\n {\n setProperty(STYLE_CLASS_KEY, (styleClass));\n }", "public void setCurrentStyle(StyleEditorTree styleTree)\n\t{\n\t\tif (styleTree == null)\n\t\t\tthrow new IllegalArgumentException(\"StyleEditorTree is null.\");\n\n\t\tthis.guiController.setStyle(styleTree.getStyle());\n\t}", "@Override\n public void setStrokeStyle(Style style) {\n Object nativeStrokeStyle = graphicsEnvironmentImpl.setStrokeStyle(canvas, style, style.getCached());\n style.cache(nativeStrokeStyle);\n }", "public void changeToStandard(){\n drawAttributeManager.toggleStandardView();\n getContentPane().setBackground(DrawAttribute.whiteblue);\n canvas.repaint();\n }", "public void setStyle(String style) {\n this.style = style == null ? null : style.trim();\n }", "public void setStyle(String style) {\n this.style = style == null ? null : style.trim();\n }", "public void setStyle(String style) {\n this.style = style == null ? null : style.trim();\n }", "private void initSimulateModeView() {\n simulateMode = new Label(\"SIMULATE\");\n simulateMode.setPrefSize(200, 100);\n simulateMode.setFont(Font.font(null, FontWeight.BOLD, 30));\n simulateMode.setTextFill(Color.ORANGE);\n simulateMode.setEffect(getDropShadow());\n }", "public void setStylePanel(StylePanel stylePanel);", "@Override\n public void setFillStyle(Style style) {\n Object nativeFillStyle = graphicsEnvironmentImpl.setFillStyle(canvas, style, style.getCached());\n style.cache(nativeFillStyle);\n }", "void toggleStyle(XYChart.Series<Number, Number> temp)\n {\n if (temp.getData().size() > 0)\n {\n Node n = temp.getData().get(0).getNode();\n try\n {\n for (int i = 0; i < 3; i++)\n {\n n.getStyleClass().add(\"bulge-symbol-sending\");\n n.getStyleClass().add(\"bulge-symbol-sending\");\n Thread.currentThread().sleep(150);\n n.getStyleClass().add(\"bulge-symbol-receiving\");\n n.getStyleClass().add(\"bulge-symbol-receiving\");\n Thread.currentThread().sleep(100);\n }\n }\n catch (Exception e)\n {\n\n }\n }\n }", "@Override\n public void setLineCap(String style) {\n graphicsEnvironmentImpl.setLineCap(canvas, style);\n }", "public void setStyleName(String styleName) {\r\n setAttribute(\"styleName\", styleName, true);\r\n }", "public void setStyleClass(String styleClass) {\r\n this.styleClass = styleClass;\r\n }", "public void xsetStyleId(org.openxmlformats.schemas.drawingml.x2006.main.STGuid styleId)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.openxmlformats.schemas.drawingml.x2006.main.STGuid target = null;\n target = (org.openxmlformats.schemas.drawingml.x2006.main.STGuid)get_store().find_attribute_user(STYLEID$30);\n if (target == null)\n {\n target = (org.openxmlformats.schemas.drawingml.x2006.main.STGuid)get_store().add_attribute_user(STYLEID$30);\n }\n target.set(styleId);\n }\n }", "public abstract BossBar setStyle(BossStyle style);", "@Test\n public void testSetStyle() {\n writeBanner(getMethodName());\n }", "public static void set(SoState state, Style style)\n { SoInt32Element.set(classStackIndexMap.get(SoPickStyleElement.class), state, style.getValue()); }", "public Encoding setStyle(String value) {\n\t\tstyle = value;\n\t\treturn this;\n\t}", "public void setStyleId(java.lang.String styleId)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STYLEID$30);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(STYLEID$30);\n }\n target.setStringValue(styleId);\n }\n }", "public void setLineStyle(int style)\r\n\t{\r\n\t\tg.setPenStyle(style);\r\n\t}", "void setSimulationController(SimulationController simulationController);", "private void restoreStyle() {\n if(this.backedup) {\n this.backedup = false;\n\n this.currentFillColor = this.lastFillColor;\n DOM.setStyleAttribute(fill.getElement(), \"backgroundColor\",currentFillColor.toCss(false));\n this.fillOpacity.setValue(this.lastFillOpacity);\n this.currentFillColor.setAlpha(this.fillOpacity.getValue());\n\n this.currentStrokeColor = this.lastStrokeColor;\n DOM.setStyleAttribute(stroke.getElement(), \"backgroundColor\",currentStrokeColor.toCss(false));\n this.strokeOpacity.setValue(this.lastStrokeOpacity);\n this.currentStrokeColor.setAlpha(this.strokeOpacity.getValue());\n\n this.currentStrokeSize.setValue(this.lastStrokeSize);\n }\n }", "public void addStyleModifier(int newStyle) {\n\t\tif (style == null) {\n\t\t\tstyle = newStyle;\n\t\t\treturn;\n\t\t}\n\t\tif (style == Font.PLAIN || newStyle == Font.PLAIN) {\n\t\t\tthrow new IllegalStateException(\"Attempted to set incompable styles\");\n\t\t}\n\t\tstyle = style | newStyle;\n\t}", "private void setSimulation(Simulation simulation) {\n\t\tif (getSimulation() != null) {\n\t\t\tgetSimulation().removePropertyChangeListener(this);\n\t\t}\n\t\tfieldSimulation = simulation;\n\t\tif (getSimulation() != null) {\n\t\t\tgetSimulation().addPropertyChangeListener(this);\n\t\t}\n\t\t//\ttry {\n\t\t//\t\tsetSmoldynDefaultTimeStep();\n\t\t//\t} catch (Exception ex) {\n\t\t//\t\tlg.error(e);\n\t\t//\t}\n\t}", "public void style() {\n\n\t\tfinal ArrayList<String> cssClasses = new ArrayList<>();\n\t\tif (!this.styles.isEmpty()) {\n\t\t\tthis.styles.forEach(s -> {\n\t\t\t\tcssClasses.add(s.getCss());\n\t\t\t});\n\t\t}\n\n\t\t// replace the cell styles with the new set\n\t\tthis.add(AttributeModifier.replace(\"class\", StringUtils.join(cssClasses, \" \")));\n\t}", "public void setFontStyle(final FontStyles fontStyle)\n\t{\n\t\tthis.fontStyle = fontStyle;\n\t}", "public void setTransitionStyle(String transitionStyle) {\n\t\tthis.transitionStyle = transitionStyle;\n\t}", "public void setZoomAnimationStyle(int style) {\n\t//zoomAnimationStyle = style;\n}", "private void setStyleToDefault() {\n // enable syntax highlighting\n commandTextField.enableSyntaxHighlighting();\n }", "private void setBorder(CellStyle style, BorderStyle borderStyle) {\n\t\tstyle.setBorderBottom(borderStyle);\n\t\tstyle.setBorderTop(borderStyle);\n\t\tstyle.setBorderLeft(borderStyle);\n\t\tstyle.setBorderRight(borderStyle);\n\t}", "public void setStyles(String text) {\n getState().styles = text;\n }", "public void setStyleNew(String value) {\n setAttributeInternal(STYLENEW, value);\n }", "public void setDefault(VisualStyle style, Object c) {\n \t\tif ((style == null) || (c == null))\n \t\t\treturn;\n \n \t\tif (isNodeProp()) {\n \t\t\tNodeAppearanceCalculator nodeCalc = style.getNodeAppearanceCalculator();\n \t\t\tNodeAppearance na = nodeCalc.getDefaultAppearance();\n \t\t\tna.set(this, c);\n \t\t\tnodeCalc.setDefaultAppearance(na);\n \t\t} else {\n \t\t\tEdgeAppearanceCalculator edgeCalc = style.getEdgeAppearanceCalculator();\n \t\t\tEdgeAppearance ea = edgeCalc.getDefaultAppearance();\n \t\t\tea.set(this, c);\n \t\t\tedgeCalc.setDefaultAppearance(ea);\n \t\t}\n \t}", "public void xsetStyleName(org.apache.xmlbeans.XmlString styleName)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(STYLENAME$32);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(STYLENAME$32);\n }\n target.set(styleName);\n }\n }", "public void setNodeStyle(String style) {\n StringBuffer command = new StringBuffer(\"node [style=\");\n command.append(style);\n command.append(\"];\");\n this.drawElements.add(new DotGraphCommand(new String(command)));\n }", "public void setShapeAspectStyle(IfcShapeAspect ShapeAspectStyle)\n\t{\n\t\tthis.ShapeAspectStyle = ShapeAspectStyle;\n\t\tfireChangeEvent();\n\t}", "public void initialSetting(AttributeSet attributeSet, int defStyleAttr){\n paint_brush.setAntiAlias(true);\n\n //Setting the color for the Paint Brush\n paint_brush.setColor(Color.BLACK);\n\n //Setting the corner display for the drawings done by the User\n //The corners will be seen circular in display\n paint_brush.setStrokeJoin(Paint.Join.ROUND);\n\n //Setting the style of the stroke of the paint brush\n paint_brush.setStyle(Paint.Style.STROKE);\n\n //Setting the width of the stroke of the paint brush\n paint_brush.setStrokeWidth(8f);\n }", "private void applyFontStyle() {\r\n\t\tfinal Font font = SWTGraphicUtil.buildFontFrom(this.control, PromptSupport.getFontStyle(this.control));\r\n\t\tthis.control.setFont(font);\r\n\t\tSWTGraphicUtil.addDisposer(this.control, font);\r\n\t}", "public void modify( CellStyle style );", "public void setPageStyle(String style)\n {\n // ignore\n }", "void setRandomize(Boolean setting);", "public CommonPopWindow setAnimationStyle(@StyleRes int animationStyle) {\n/* 207 */ this.mAnimationStyle = animationStyle;\n/* 208 */ return this;\n/* */ }", "public void setAnimationStyle(int animationStyleId) {\n mPopupWindow.setAnimationStyle(animationStyleId);\n }", "protected void setLineType(int style) {\r\n\t\tif (primaryShape instanceof Shape) {\r\n\t\t\t((Shape) primaryShape).setLineStyle(style);\r\n\t\t}\r\n\t}", "private void applyStyle() {\n\t\tmenu.getStyleClass().add(menuColor);\n\t}", "public void setStartPointEndingStyle(String style) {\n/* 713 */ String actualStyle = (style == null) ? \"None\" : style;\n/* 714 */ COSBase base = getCOSObject().getDictionaryObject(COSName.LE);\n/* */ \n/* 716 */ if (!(base instanceof COSArray) || ((COSArray)base).size() == 0) {\n/* */ \n/* 718 */ COSArray array = new COSArray();\n/* 719 */ array.add((COSBase)COSName.getPDFName(actualStyle));\n/* 720 */ array.add((COSBase)COSName.getPDFName(\"None\"));\n/* 721 */ getCOSObject().setItem(COSName.LE, (COSBase)array);\n/* */ }\n/* */ else {\n/* */ \n/* 725 */ COSArray array = (COSArray)base;\n/* 726 */ array.setName(0, actualStyle);\n/* */ } \n/* */ }", "public void setBoardStyle(BoardStyle style) {\n\t\tboardStyle = style;\n\t}", "public void setSwimming ( boolean swimming ) {\n\t\texecute ( handle -> handle.setSwimming ( swimming ) );\n\t}", "private void setTheParseStyle(ParseStyle parseStyle) {\r\n this.parseStyle = parseStyle;\r\n }", "private void initSimulateModeController() {\n simulateMode.setOnMouseClicked(event -> {\n SimulatorMain sm = null;\n try { sm = new SimulatorMain(); }\n catch (Exception e) { e.printStackTrace(); }\n sm.start(SimulatorMain.stage);\n });\n simulateMode.setOnMouseEntered(event -> { simulateMode.setGraphic(new Circle(5)); });\n simulateMode.setOnMouseExited(event -> { simulateMode.setGraphic(null); });\n }", "final public void setInlineStyle(String inlineStyle)\n {\n setProperty(INLINE_STYLE_KEY, (inlineStyle));\n }", "@Override\r\n\tpublic void simulate() {\n\t\t\r\n\t}", "void set(String group, String name, String style);", "public CssTextEmphasisStyle() {\n value = initial;\n }", "public void setShowAnimation(boolean showAnimation)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(SHOWANIMATION$20);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(SHOWANIMATION$20);\n }\n target.setBooleanValue(showAnimation);\n }\n }", "private void selectStyleButton() {\n for (int i = 0; i < mapStylesView.getChildCount(); i++) {\n mapStylesView.getChildAt(i).setSelected(false);\n }\n SKMapViewStyle mapStyle = mapView.getMapSettings().getMapStyle();\n if (mapStyle == null || mapStyle.getStyleFileName().equals(\"daystyle.json\")) {\n findViewById(R.id.map_style_day).setSelected(true);\n } else if (mapStyle.getStyleFileName().equals(\"nightstyle.json\")) {\n findViewById(R.id.map_style_night).setSelected(true);\n } else if (mapStyle.getStyleFileName().equals(\"outdoorstyle.json\")) {\n findViewById(R.id.map_style_outdoor).setSelected(true);\n } else if (mapStyle.getStyleFileName().equals(\"grayscalestyle.json\")) {\n findViewById(R.id.map_style_grayscale).setSelected(true);\n }\n }", "@Override\n public void setShowSimulatedValues(boolean showSimulatedValues) throws G2AccessException {\n setAttributeValue (SystemAttributeSymbols.SHOW_SIMULATED_VALUES_, new Boolean (showSimulatedValues));\n }", "@Override\n\tpublic int getAnimationStyle() {\n\t\treturn 0;\n\t}", "public String getStyle() {\r\n return style;\r\n }", "protected void setDisplayProperty( int display, int mask,\n \t\t\tStringBuffer styleBuffer )\n \t{\n \t\tint flag = display & mask;\n \t\tif ( ( display & HTMLEmitterUtil.DISPLAY_NONE ) > 0 )\n \t\t{\n \t\t\tstyleBuffer.append( \"display: none;\" ); //$NON-NLS-1$\n \t\t}\n \t\telse if ( flag > 0 )\n \t\t{\n \t\t\tif ( ( flag & HTMLEmitterUtil.DISPLAY_BLOCK ) > 0 )\n \t\t\t{\n \t\t\t\tstyleBuffer.append( \"display: block;\" ); //$NON-NLS-1$\n \t\t\t}\n \t\t\telse if ( ( flag & HTMLEmitterUtil.DISPLAY_INLINE_BLOCK ) > 0 )\n \t\t\t{\n \t\t\t\tstyleBuffer.append( \"display: inline-block;\" ); //$NON-NLS-1$\n \t\t\t}\n \t\t\telse if ( ( flag & HTMLEmitterUtil.DISPLAY_INLINE ) > 0 )\n \t\t\t{\n \t\t\t\tstyleBuffer.append( \"display: inline;\" ); //$NON-NLS-1$\n \t\t\t}\n \t\t}\n \t}", "public void setCellStyle( CellStyle style )\n {\n for (Cell[] colCells : cells) {\n for (Cell cell : colCells) {\n cell.setCellStyle(style);\n }\n }\n }", "public String getStyle() {\n return style;\n }", "public String getStyle() {\n return style;\n }", "public String getStyle() {\n return style;\n }", "public String getStyle() {\n return style;\n }", "public final static void setDesign() {\n\t\t\ttry{\n\t\t\t\tUIManager.setLookAndFeel(\"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel\");\n\t\t\t}catch(Exception e){\n\t\t\t\tSystem.out.println(\"Prob with setDesign()\");\n\t\t\t}\n\t\t\t\n\t\t}", "public void setStyleCode(java.util.List styleCode)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STYLECODE$16);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(STYLECODE$16);\n }\n target.setListValue(styleCode);\n }\n }", "public void setStyleCode(java.util.List styleCode)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STYLECODE$16);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(STYLECODE$16);\n }\n target.setListValue(styleCode);\n }\n }", "@Override\n public void addStyleName(String style) {\n super.addStyleName(style);\n }", "public void setStoneCount(int stoneCount)\n {\n if(stoneCount < 0) throw new RuntimeException(\"Stone count must be >= 0\");\n this.stoneCount = stoneCount;\n repaint();\n }", "private void resetTalon(TalonSRX talon, ControlMode controlMode, double setValue) {\n\t\ttalon.clearMotionProfileTrajectories();\n\t\ttalon.clearMotionProfileHasUnderrun(10);\n\t\ttalon.changeMotionControlFramePeriod(10);\n\t\ttalon.set(controlMode, setValue);\n\t}", "private void changeUIdefaults() {\n\t\tUIManager.put(\"TaskPaneContainer.useGradient\", Boolean.FALSE);\n\t\tUIManager.put(\"TaskPaneContainer.background\",\n\t\t\t\tColors.LightGray.color(0.5f));\n\n\t\t// setting taskpane defaults\n\t\tUIManager.put(\"TaskPane.font\", new FontUIResource(new Font(\"Verdana\",\n\t\t\t\tFont.BOLD, 16)));\n\t\tUIManager.put(\"TaskPane.titleBackgroundGradientStart\",\n\t\t\t\tColors.White.color());\n\t\tUIManager.put(\"TaskPane.titleBackgroundGradientEnd\",\n\t\t\t\tColors.LightBlue.color());\n\t}", "public void setNewSpeed(float simSpeed) {\n synchronized (settings){\n settings.setSimSpeed(simSpeed);\n\n if(settings.getSimSpeed() > 1000){\n settings.setSimSpeed(1000f);\n System.out.println(\"The simulation only supports a simSpeed between 0.001 and 1000!\");\n System.out.println(\"The simulation speed was set to 1000\");\n }\n if(settings.getSimSpeed() < 0){\n settings.setSimSpeed(0.001f);\n System.out.println(\"The simulation only supports a simSpeed between 0.001 and 1000!\");\n System.out.println(\"The simulation speed was set to 0.001\");\n }\n }\n }", "public SimpleStyle() {\n\t\t// set default values\n\t\tthis.foregroundColor = -1;\n\t\t// others are null: VM DONE\n\t}", "public void removeColorStyle(ColorStyle style){\n\t\tstyles.remove(style);\n\t\tpropertyChange.firePropertyChange(PROPERTY_STYLEREMOVE, -1, 1);\n\t}", "private void setStyleToIndicateCommandFailure() {\n //override style and disable syntax highlighting\n commandTextField.overrideStyle(ERROR_STYLE_CLASS);\n }", "public static void setDefaultGraphStyle(mxAnalysisGraph aGraph, boolean resetEdgeValues) {\n mxGraph graph = aGraph.getGraph();\n Object parent = graph.getDefaultParent();\n Object[] vertices = aGraph.getChildVertices(parent);\n mxIGraphModel model = graph.getModel();\n\n for (int i = 0; i < vertices.length; i++) {\n model.setStyle(vertices[i], basicVertexStyleString);\n }\n\n Object[] edges = aGraph.getChildEdges(parent);\n boolean isDirected = mxGraphProperties.isDirected(aGraph.getProperties(), mxGraphProperties.DEFAULT_DIRECTED);\n String edgeString = basicEdgeStyleString;\n\n if (isDirected) {\n edgeString = edgeString + basicArrowStyleString;\n }\n else {\n edgeString = edgeString + \"endArrow=none\";\n }\n\n for (int i = 0; i < edges.length; i++) {\n model.setStyle(edges[i], edgeString);\n }\n\n if (resetEdgeValues) {\n for (int i = 0; i < edges.length; i++) {\n model.setValue(edges[i], null);\n }\n\n for (int i = 0; i < edges.length; i++) {\n model.setValue(edges[i], aGraph.getGenerator().getNewEdgeValue(aGraph));\n }\n }\n }", "public String getStyle() {\n\t\treturn style;\n\t}", "public StyleId setStyleId ( StyleId id );", "public void xsetStyleCode(org.apache.xmlbeans.XmlNMTOKENS styleCode)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlNMTOKENS target = null;\n target = (org.apache.xmlbeans.XmlNMTOKENS)get_store().find_attribute_user(STYLECODE$16);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlNMTOKENS)get_store().add_attribute_user(STYLECODE$16);\n }\n target.set(styleCode);\n }\n }", "public void xsetStyleCode(org.apache.xmlbeans.XmlNMTOKENS styleCode)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlNMTOKENS target = null;\n target = (org.apache.xmlbeans.XmlNMTOKENS)get_store().find_attribute_user(STYLECODE$16);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlNMTOKENS)get_store().add_attribute_user(STYLECODE$16);\n }\n target.set(styleCode);\n }\n }", "public boolean getSimulate() {\n return this.simulate;\n }", "public void handleStyle(HtmlObjects.Style t)\n {\n }", "public void styleforZero() {\r\n\t\t\r\n\t\tsuper.styleforZero();\r\n\t\t\r\n\t}", "public void setSeCell(org.openxmlformats.schemas.drawingml.x2006.main.CTTablePartStyle seCell)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.openxmlformats.schemas.drawingml.x2006.main.CTTablePartStyle target = null;\n target = (org.openxmlformats.schemas.drawingml.x2006.main.CTTablePartStyle)get_store().find_element_user(SECELL$18, 0);\n if (target == null)\n {\n target = (org.openxmlformats.schemas.drawingml.x2006.main.CTTablePartStyle)get_store().add_element_user(SECELL$18);\n }\n target.set(seCell);\n }\n }" ]
[ "0.68800235", "0.60483384", "0.6027432", "0.59936225", "0.58553904", "0.58553904", "0.57798624", "0.56887484", "0.5669657", "0.551453", "0.5485129", "0.5474051", "0.5450262", "0.53706604", "0.53222895", "0.53030837", "0.52883846", "0.52689195", "0.5235274", "0.5235274", "0.5235274", "0.52124363", "0.5173123", "0.5157233", "0.51531565", "0.5116353", "0.5065634", "0.50623506", "0.5053104", "0.5044809", "0.4962987", "0.49215862", "0.49181393", "0.49096575", "0.48949564", "0.48792672", "0.4867513", "0.48593938", "0.48556858", "0.4854272", "0.48538142", "0.48504168", "0.4838038", "0.4834218", "0.48329037", "0.48282692", "0.48252994", "0.48222902", "0.4809113", "0.48016793", "0.48010442", "0.4763127", "0.4751671", "0.47483978", "0.47375748", "0.46970236", "0.46714947", "0.46711332", "0.46611392", "0.46545488", "0.46406692", "0.46345285", "0.46185166", "0.4612918", "0.46105626", "0.45914862", "0.45902812", "0.4584445", "0.45836002", "0.4577934", "0.45737946", "0.45734084", "0.45724046", "0.4570822", "0.4567356", "0.45548528", "0.45479342", "0.45479342", "0.45479342", "0.45479342", "0.45463756", "0.45440358", "0.45440358", "0.45396528", "0.4537396", "0.45350978", "0.45279938", "0.4522162", "0.45219988", "0.45147613", "0.45146435", "0.4504642", "0.44984522", "0.4495222", "0.4494615", "0.4494615", "0.44882944", "0.4482459", "0.44821754", "0.44767436" ]
0.82900196
0
TODO Autogenerated method stub create the tree
public static void main(String[] args) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createTree() {\n\t\taddNodeToParent(nodeMap);\n\t}", "void makeTree()\n \t{\n \t\t\t \n \t\tobj.insert(5,\"spandu\");\n \tobj.insert(4,\"anshu\");\n \tobj.insert(3,\"anu\");\n \tobj.insert(6,\"himani\");\n \t\t\n \t}", "protected void makeTheTree(){\n\n structure.getRootNode().branchList.add(structure.getNode11());\n structure.getRootNode().branchList.add(structure.getNode12());\n structure.getRootNode().branchList.add(structure.getNode13());\n\n structure.getNode11().branchList.add(structure.getNode111());\n structure.getNode11().branchList.add(structure.getNode112());\n structure.getNode11().branchList.add(structure.getNode113());\n\n structure.getNode13().branchList.add(structure.getNode131());\n\n structure.getNode112().branchList.add(structure.getNode1121());\n\n }", "public void createTree() {\n Node<String> nodeB = new Node<String>(\"B\", null, null);\n Node<String> nodeC = new Node<String>(\"C\", null, null);\n Node<String> nodeD = new Node<String>(\"D\", null, null);\n Node<String> nodeE = new Node<String>(\"E\", null, null);\n Node<String> nodeF = new Node<String>(\"F\", null, null);\n Node<String> nodeG = new Node<String>(\"G\", null, null);\n root.leftChild = nodeB;\n root.rightChild = nodeC;\n nodeB.leftChild = nodeD;\n nodeB.rightChild = nodeE;\n nodeC.leftChild = nodeF;\n nodeC.rightChild = nodeG;\n\n }", "private void createTree() {\n\n // custom brown color\n Color brown = new Color(149, 99, 57);\n\n // trunk\n NscComponent trunk = new NscRectangle(49, 164, 13, 51);\n createShape(trunk, brown, true);\n\n // branches\n drawLine(50, 125, 50, 165, 10, brown);\n drawLine(25, 125, 50, 165, 10, brown);\n drawLine(75, 125, 50, 165, 10, brown);\n\n // branch outlines\n drawLine(49, 125, 49, 150, 1, Color.black);\n drawLine(60, 125, 60, 150, 1, Color.black);\n drawLine(24, 125, 49, 165, 1, Color.black);\n drawLine(35, 125, 50, 150, 1, Color.black);\n drawLine(85, 125, 60, 165, 1, Color.black);\n drawLine(74, 125, 60, 150, 1, Color.black);\n\n // leafs\n NscEllipse leafs2 = new NscEllipse(0, 5, 60, 122);\n NscEllipse leafs3 = new NscEllipse(50, 5, 60, 122);\n NscEllipse leafs = new NscEllipse(25, 0, 60, 127);\n NscEllipse leafs4 = new NscEllipse(25, 1, 60, 124);\n createShape(leafs2, treeColor, true);\n createShape(leafs3, treeColor, true);\n createShape(leafs, treeColor, true);\n createShape(leafs4, treeColor, false);\n\n repaint();\n }", "private void CreateJTree(List<MainCategoryDTO> allTree) {\n \n \n DefaultMutableTreeNode root = new DefaultMutableTreeNode(\"Listem\");\n for (int i = 0; i < allTree.size(); i++) {\n MainCategoryDTO mainCategory = allTree.get(i);\n DefaultMutableTreeNode mainCategoryTree = new DefaultMutableTreeNode(mainCategory.getName());\n CreatSubCategory(mainCategory.getList(),mainCategoryTree);\n root.add(mainCategoryTree);\n } \n \n \n DefaultTreeModel model = new DefaultTreeModel(root); \n jTree1.setModel(model); \n jTree1.setRootVisible(false);\n jTree1.addTreeSelectionListener((javax.swing.event.TreeSelectionEvent evt) -> {\n JTree1ValueChanged(evt);\n });\n \n }", "private TreeNode createTree() {\n // Map<String, String> map = new HashMap<>();\n // map.put(\"dd\", \"qq\");\n // 叶子节点\n TreeNode G = new TreeNode(\"G\");\n TreeNode D = new TreeNode(\"D\");\n TreeNode E = new TreeNode(\"E\", G, null);\n TreeNode B = new TreeNode(\"B\", D, E);\n TreeNode H = new TreeNode(\"H\");\n TreeNode I = new TreeNode(\"I\");\n TreeNode F = new TreeNode(\"F\", H, I);\n TreeNode C = new TreeNode(\"C\", null, F);\n // 构造根节点\n TreeNode root = new TreeNode(\"A\", B, C);\n return root;\n }", "public TreeNode() { \n this.name = \"\"; \n this.rule = new ArrayList<String>(); \n this.child = new ArrayList<TreeNode>(); \n this.datas = null; \n this.candAttr = null; \n }", "@Override\r\n\tpublic void buildTree() {\r\n\t\t\r\n\t\t// root level \r\n\t\trootNode = new TreeNode<String>(\"\");\r\n\t\t\r\n\t\t//first level\r\n\t\tinsert(\".\", \"e\");\r\n\t\tinsert(\"-\", \"t\");\r\n\t\t\r\n\t\t//second level\r\n\t\t\r\n\t\tinsert(\". .\", \"i\");\r\n\t\tinsert(\".-\", \"a\");\r\n\t\tinsert(\"-.\", \"n\"); \r\n\t\tinsert(\"--\", \"m\");\r\n\t\t\r\n\t\t//third level\r\n\t\tinsert(\"...\", \"s\");\r\n\t\tinsert(\"..-\", \"u\");\r\n\t\tinsert(\".-.\", \"r\");\r\n\t\tinsert(\".--\", \"w\");\r\n\t\tinsert(\"-..\", \"d\");\r\n\t\tinsert(\"-.-\", \"k\");\r\n\t\tinsert(\"--.\", \"g\");\r\n\t\tinsert(\"---\", \"o\");\r\n\t\t\r\n\t\t//fourth level\r\n\t\tinsert(\"....\", \"h\");\r\n\t\tinsert(\"...-\", \"v\");\r\n\t\tinsert(\"..-.\", \"f\");\r\n\t\tinsert(\".-..\", \"l\");\r\n\t\tinsert(\".--.\", \"p\");\r\n\t\tinsert(\".---\", \"j\");\r\n\t\tinsert(\"-...\", \"b\");\r\n\t\tinsert(\"-..-\", \"x\");\r\n\t\tinsert(\"-.-.\", \"c\");\r\n\t\tinsert(\"-.--\", \"y\");\r\n\t\tinsert(\"--..\", \"z\");\r\n\t\tinsert(\"--.-\", \"q\");\r\n\t\t\r\n\t}", "private void crearTree(){\n tree= new Tree(\"PROGRAMAS\");\r\n tree.setImmediate(true);\r\n\r\n // Set tree to show the 'name' property as caption for items\r\n tree.setItemCaptionPropertyId(\"nombre\");\r\n \r\n tree.addValueChangeListener(e -> Notification.show(\"Value changed:\",String.valueOf(e.getProperty().getValue()),Type.TRAY_NOTIFICATION));\r\n\t}", "private void CreateTree()\r\n\t{\r\n\r\n\t\t//sample nodes which are not identical\r\n\t\ta = new Node(1);\r\n\t\ta.left = new Node(3);\r\n\t\ta.left.left = new Node(5);\r\n\t\ta.right = new Node(2);\r\n\r\n\r\n\t\tb = new Node(2);\r\n\t\tb.left = new Node(1);\r\n\t\tb.right = new Node(3);\r\n\t\tb.right.right = new Node(7);\r\n\t\tb.left.right = new Node(4);\r\n\r\n\t\t//sample nodes which are identical\r\n\t\ta1 = new Node(1);\r\n\t\ta1.left = new Node(3);\r\n\t\ta1.left.left = new Node(5);\r\n\t\ta1.right = new Node(2);\r\n\r\n\r\n\t\tb1 = new Node(1);\r\n\t\tb1.left = new Node(3);\r\n\t\tb1.right = new Node(2);\r\n\t\tb1.left.left = new Node(5); \r\n\t}", "void createTree() throws IOException {\n\n // create root\n rootTreeItem = createTreeRoot();\n\n // create tree structure recursively\n createTree(rootTreeItem);\n\n // sort tree structure by name\n rootTreeItem.getChildren()\n .sort(Comparator.comparing(new Function<TreeItem<FilePath>, String>() {\n @Override\n public String apply(TreeItem<FilePath> t) {\n return t.getValue().toString().toLowerCase();\n }\n }));\n\n }", "public HIRTree(){\r\n\t\t\r\n\t}", "public static TreeNode getTree() {\n\t\tTreeNode a = new TreeNode(\"a\", 314);\n\t\tTreeNode b = new TreeNode(\"b\", 6);\n\t\tTreeNode c = new TreeNode(\"c\", 271);\n\t\tTreeNode d = new TreeNode(\"d\", 28);\n\t\tTreeNode e = new TreeNode(\"e\", 0);\n\t\tTreeNode f = new TreeNode(\"f\", 561);\n\t\tTreeNode g = new TreeNode(\"g\", 3);\n\t\tTreeNode h = new TreeNode(\"h\", 17);\n\t\tTreeNode i = new TreeNode(\"i\", 6);\n\t\tTreeNode j = new TreeNode(\"j\", 2);\n\t\tTreeNode k = new TreeNode(\"k\", 1);\n\t\tTreeNode l = new TreeNode(\"l\", 401);\n\t\tTreeNode m = new TreeNode(\"m\", 641);\n\t\tTreeNode n = new TreeNode(\"n\", 257);\n\t\tTreeNode o = new TreeNode(\"o\", 271);\n\t\tTreeNode p = new TreeNode(\"p\", 28);\n\t\t\n\t\ta.left = b; b.parent = a;\n\t\tb.left = c; c.parent = b;\n\t\tc.left = d;\t d.parent = c;\n\t\tc.right = e; e.parent = c;\n\t\tb.right = f; f.parent = b;\n\t\tf.right = g; g.parent = f;\n\t\tg.left = h; h.parent = g;\n\t\ta.right = i; i.parent = a;\n\t\ti.left = j; j.parent = i;\n\t\ti.right = o; o.parent = i;\n\t\tj.right = k; k.parent = j;\n\t\to.right = p; p.parent = o;\n\t\tk.right = n; n.parent = k;\n\t\tk.left = l; l.parent = k;\n\t\tl.right = m; m.parent = l;\n\t\t\n\t\td.childrenCount = 0;\n\t\te.childrenCount = 0;\n\t\tc.childrenCount = 2;\n\t\tb.childrenCount = 6;\n\t\tf.childrenCount = 2;\n\t\tg.childrenCount = 1;\n\t\th.childrenCount = 0;\n\t\tl.childrenCount = 1;\n\t\tm.childrenCount = 0;\n\t\tn.childrenCount = 0;\n\t\tk.childrenCount = 3;\n\t\tj.childrenCount = 4;\n\t\to.childrenCount = 1;\n\t\tp.childrenCount = 0;\n\t\ti.childrenCount = 7;\n\t\ta.childrenCount = 15;\n\t\t\n\t\treturn a;\n\t}", "private void createNodes( DefaultMutableTreeNode top ) {\n DefaultMutableTreeNode leaf = null;\n \n leaf = new DefaultMutableTreeNode( new treeInfo(\"Insert Transaction\") );\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Item\") );\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Report\") );\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Employee\") );\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Suplier\"));\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Salesman\"));\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Customer\"));\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Commisioner\"));\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Edit Transaction\"));\n top.add(leaf);\n leaf = new DefaultMutableTreeNode( new treeInfo(\"Producer\"));\n top.add(leaf);\n }", "private void constructTree() {\r\n\t\tsortLeaves();\r\n\t\tNode currentNode;\r\n\t\tint index = 0;\r\n\t\t\tdo{\r\n\t\t\t\t// Create a new node with the next two least frequent nodes as its children\r\n\t\t\t\tcurrentNode = new Node(this.treeNodes[0], this.treeNodes[1]); \r\n\t\t\t\taddNewNode(currentNode);\r\n\t\t\t}\r\n\t\t\twhile (this.treeNodes.length > 1); // Until there is only one root node\r\n\t\t\tthis.rootNode = currentNode;\r\n\t\t\tindex++;\r\n\t}", "public Tree()\n\t{\n\t\tsuper(\"Tree\", \"tree\", 0);\n\t}", "private void buildeAccessoryTree() {\n\t DefaultKingdeeTreeNode root = new DefaultKingdeeTreeNode(\"版模类型\");\r\n\t DefaultKingdeeTreeNode parentrNode = root;\r\n\t DefaultKingdeeTreeNode currentNode = null;\r\n\t \r\n//\t for(AccessoryTypeEnum s : AccessoryTypeEnum.getEnumList()){\r\n//\t\t\r\n//\t }\r\n\t List accessorylist =AccessoryTypeEnum.getEnumList();\r\n\t Class clz = AccessoryTypeEnum.class;\r\n\t for (int i=0;i<accessorylist.size();i++) {\r\n\t\tSystem.out.println(accessorylist.get(i));\r\n\t\tcurrentNode = new DefaultKingdeeTreeNode(accessorylist.get(i));\r\n\t\tcurrentNode.setUserObject(accessorylist.get(i));\r\n\r\n\t\tparentrNode.add(currentNode);\r\n\t }\r\n\t kDTree1.setModel(new KingdeeTreeModel(root));\r\n\t kDTree1.setSelectionNode(root);\r\n\t \r\n\t}", "@Override\r\n\tprotected Object createLowerView(Composite parent) {\n\t\tfTree = new Tree(parent, SWT.BORDER );\r\n\t\tfTree.addSelectionListener(new SelectionAdapter() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void widgetSelected(SelectionEvent arg0) {\r\n\t\t\t\t// https://jira.jboss.org/browse/JBIDE-7107\r\n\t\t\t\t// update \"OK\" button enablement\r\n\t\t\t\tupdateOkState();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t \r\n\t\tfTreeViewer = new TreeViewer(fTree);\r\n\t\tfTreeViewer.setContentProvider( treeContentProvider );\r\n\t\tfTreeViewer.setLabelProvider(new ModelTreeLabelProvider());\r\n\t\tfTreeViewer.setInput ( null );\r\n\t\tfTreeViewer.setAutoExpandLevel( getAutoExpandLevel() );\r\n\t\t// end tree viewer for variable structure\r\n\t\tGridData data = new GridData(); \r\n\t data.grabExcessVerticalSpace = true;\r\n\t data.grabExcessHorizontalSpace = true;\r\n\t data.horizontalAlignment = GridData.FILL;\r\n\t data.verticalAlignment = GridData.FILL;\r\n\t data.minimumHeight = 200;\r\n\t fTree.setLayoutData(data);\r\n\t \r\n\t\treturn fTree;\r\n\t}", "private void buildRoot() {\n this.root = new GPRootTreeNode(this.tree);\n }", "public FamilyTree(){\r\n super();\r\n }", "public void createNode()\r\n\t{\r\n\t\tTreeNode first=new TreeNode(1);\r\n\t\tTreeNode second=new TreeNode(2);\r\n\t\tTreeNode third=new TreeNode(3);\r\n\t\tTreeNode fourth=new TreeNode(4);\r\n\t\tTreeNode fifth=new TreeNode(5);\r\n\t\tTreeNode sixth=new TreeNode(6);\r\n\t\tTreeNode seventh=new TreeNode(7);\r\n\t\tTreeNode eight=new TreeNode(8);\r\n\t\tTreeNode nine=new TreeNode(9);\r\n\t\troot=first;\r\n\t\tfirst.left=second;\r\n\t\tfirst.right=third;\r\n\t\tsecond.left=fourth;\r\n\t\tthird.left=fifth;\r\n\t\tthird.right=sixth;\r\n\t\tfifth.left=seventh;\r\n\t\tseventh.right=eight;\r\n\t\teight.left=nine;\r\n\t\t\r\n\t}", "public MorseCodeTree()\r\n\t{\r\n\t\tbuildTree();\r\n\t}", "public static TreeNode buildTree() {\n\t\t\n\t\tTreeNode root = new TreeNode(1);\n\t\t\n\t\tTreeNode left = new TreeNode(2);\n\t\tleft.left = new TreeNode(4);\n\t\tleft.right = new TreeNode(5);\n\t\tleft.right.right = new TreeNode(8);\n\t\t\n\t\tTreeNode right = new TreeNode(3);\n\t\tright.left = new TreeNode(6);\n\t\tright.right = new TreeNode(7);\n\t\tright.right.left = new TreeNode(9);\n\t\t\n\t\troot.left = left;\n\t\troot.right = right;\n\t\t\n\t\treturn root;\n\t}", "public void createBinaryTree()\r\n\t{\n\t\t\r\n\t\tNode node = new Node(1);\r\n\t\tnode.left = new Node(2);\r\n\t\tnode.right = new Node(3);\r\n\t\tnode.left.left = new Node(4);\r\n\t\tnode.left.right = new Node(5);\r\n\t\tnode.left.right.right = new Node(10);\r\n\t\tnode.left.left.left = new Node(8);\r\n\t\tnode.left.left.left.right = new Node(15);\r\n\t\tnode.left.left.left.right.left = new Node(17);\r\n\t\tnode.left.left.left.right.left.left = new Node(18);\r\n\t\tnode.left.left.left.right.right = new Node(16);\r\n\t\tnode.left.left.right = new Node(9);\r\n\t\tnode.right.left = new Node(6);\r\n\t\tnode.right.left.left = new Node(13);\r\n\t\tnode.right.left.left.left = new Node(14);\r\n\t\tnode.right.right = new Node(7);\r\n\t\tnode.right.right.right = new Node(11);\r\n\t\tnode.right.right.right.right = new Node(12);\r\n\t\troot = node;\r\n\t\t\r\n\t}", "private DefaultTreeModel createTreeModel() {\n\t\t// create the root USA\n\t\tDefaultMutableTreeNode root = new DefaultMutableTreeNode(\"USA\");\n\n\t\t// First child is IOWA!\n\t\troot.add(new DefaultMutableTreeNode(\"Iowa\"));\n\n\t\t// other way to create a DefaultMutableTreeNode:\n\t\t// create an empty node and then add the user object\n\t\tDefaultMutableTreeNode newNode = new DefaultMutableTreeNode();\n\t\tnewNode.setUserObject(\"California\");\n\n\t\t// add a child to newNode\n\t\tnewNode.add(new DefaultMutableTreeNode(\"Sacramento\"));\n\n\t\t// add a sibling to Iowa (i.e. California)\n\t\troot.add(newNode);\n\n\t\t// create the model using the root of the tree\n\t\tDefaultTreeModel treeModel = new DefaultTreeModel(root);\n\n\t\t// ADD MODEL LISTENERS (changes/insertion/deletion of nodes)\n\t\ttreeModel.addTreeModelListener(createTreeModelListener());\n\t\treturn treeModel;\n\n\t}", "public JdbNavTree() {\r\n super(new Object [] {});\r\n commonInit();\r\n }", "private void NewTree(HttpServletRequest request, HttpServletResponse response) throws ParserConfigurationException, IOException {\n XMLTree tree;\n tree = XMLTree.getInstance();\n //_response.getWriter().write(tree.newTree());\n String answer = tree.newTree();\n returnResponse(response, answer);\n }", "@AutoGenerated\r\n\tprivate Panel buildTreePanel()\r\n\t{\n\t\ttreePanel = new Panel();\r\n\t\ttreePanel.setImmediate(false);\r\n\t\ttreePanel.setWidth(\"100.0%\");\r\n\t\ttreePanel.setHeight(\"100.0%\");\r\n\t\t\r\n\t\t// panelVerticalLayout\r\n\t\tpanelVerticalLayout = buildPanelVerticalLayout();\r\n\t\ttreePanel.setContent(panelVerticalLayout);\r\n\t\t\r\n\t\treturn treePanel;\r\n\t}", "public static Treenode createBinaryTree() {\n\t\tTreenode rootnode = new Treenode(40);\r\n\t\tTreenode r40 = new Treenode(50);\r\n\t\tTreenode l40 = new Treenode(20);\r\n\t\tTreenode r50 = new Treenode(60);\r\n\t\tTreenode l50 = new Treenode(45);\r\n\t\tTreenode r20 = new Treenode(30);\r\n\t\tTreenode l20 = new Treenode(10);\r\n\t\trootnode.right = r40;\r\n\t\trootnode.left = l40;\r\n\t\tr40.right=r50;\r\n\t\tr40.left = l50;\r\n\t\tl40.right=r20;\r\n\t\tl40.left=l20;\r\n\t\t r40.parent=rootnode; l40.parent= rootnode;\r\n\t\t r50.parent=r40;\r\n\t\tl50.parent=r40 ;\r\n\t\t r20.parent=l40;\r\n\t\t l20.parent=l40 ;\r\n\t\treturn rootnode;\r\n\t\t\r\n\t}", "public static ResolutionNode generateResolutionTree(){\n\t\tConnection con = null;\n\t\ttry {\n\t\t\tcon = getConnection();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t};\n\t\tResolutionNode tree = new ResolutionNode();\n\t\ttree.setAc_id(0);\n\t\ttree.setName(\"root\");\n\t\ttree.setPath(\"\");\n\t\ttree.setSupertype(tree);\n\t\tResolutionNode r = generateResolutionTree(0, tree, new ArrayList<ContextParameterType>(), new ArrayList<QualityParameterType>(), new ArrayList<CostParameterType>(), new ArrayList<RankingParameterType>(), \"root\");\n\t\tcloseConnnection(con);\n\t\treturn r;\n\t}", "public Node()\n {\n this.name=\"/\";\n this.type=0;\n this.stage=0;\n children=new ArrayList<Node>();\n }", "public static void build ()\r\n {\r\n lgt.insert(1);\r\n lgt.insert(2);\r\n lgt.insert(5);\r\n \r\n lgt.findRoot();\r\n lgt.insert(3);\r\n \r\n lgt.findRoot();\r\n lgt.insert(4);\r\n \r\n lgt.insert(6);\r\n lgt.findParent();\r\n lgt.insert(7);\r\n \r\n }", "public TreeTag()\n {\n setNoField(true);\n setRootVisible(true);\n icons = new HashMap<String, Object>();\n }", "public void populateTreeTable() {\n root = new DefaultTreeNode(\"root\", null);\n Session session = HibernateUtil.getSessionFactory().openSession();\n try {\n String sqlMenu = \"SELECT o from Tblobjeto o WHERE o.tipoObjeto LIKE 'menu' ORDER BY o.idObjeto\";\n menus = session.createQuery(sqlMenu).list();\n\n for (Tblobjeto mnu : menus) {\n TreeNode nodeMenu = new DefaultTreeNode(mnu, root);\n nodes.add(nodeMenu);\n\n Criteria cMenu = session.createCriteria(Tblobjeto.class);\n cMenu.add(Restrictions.eq(\"tblobjeto\", mnu));\n subMenus = (List<Tblobjeto>) cMenu.list();\n\n for (Tblobjeto smnu : subMenus) {\n TreeNode nodeSubMenu = new DefaultTreeNode(smnu, nodeMenu);\n nodes.add(nodeSubMenu);\n\n Criteria cSubMenu = session.createCriteria(Tblobjeto.class);\n cSubMenu.add(Restrictions.eq(\"tblobjeto\", smnu));\n acciones = (List<Tblobjeto>) cSubMenu.list();\n\n for (Tblobjeto ac : acciones) {\n nodes.add(new DefaultTreeNode(ac, nodeSubMenu));\n }\n }\n }\n } catch (HibernateException e) {\n logger.throwing(getClass().getName(), \"ObjetosBean\", e);\n } finally {\n session.close();\n }\n }", "public Tree(){\n root = null;\n }", "protected static DefaultMutableTreeNode getDefaultTreeModel()\n {\n // New root node\n DefaultMutableTreeNode root =\n new DefaultMutableTreeNode(\"Root\");\n \n // First level\n for (int i = 1; i <= 5; i++)\n {\n // New node\n DefaultMutableTreeNode folder =\n new DefaultMutableTreeNode(\"Folder-\" + i);\n \n // Add node to root\n root.add(folder);\n \n // Second level\n for (int j = 1; j <= 3; j++)\n {\n // New node\n DefaultMutableTreeNode subfolder =\n new DefaultMutableTreeNode(\"Subfolder-\" + j);\n \n // Add node to parent node\n folder.add(subfolder);\n \n // Third level\n for (int k = 1; k <= 3; k++)\n {\n // New anchor\n A a = new A(\"http://jakarta.apache.org\");\n a.setTarget(\"target\").addElement(\"Document-\" + k);\n \n // New node (leaf)\n DefaultMutableTreeNode document =\n new DefaultMutableTreeNode(a.toString());\n \n // Add node to parent node\n subfolder.add(document);\n }\n }\n }\n \n // Return root node\n return root;\n }", "public TtreeNode() {\n\t numberOfNodes++;\n\t }", "public TreeNode() {\n }", "@Override\r\n\tpublic JTree getJTree() {\r\n\t\tif (jTree == null) {\r\n\t\t\tjTree = new JLagerTree();\r\n\t\t\tjTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION );\r\n\t\t\tGenericNode root = new GenericNode(null);\r\n\t\t\tjTree.setModel(getTreeModel(root));\r\n\t\t\tjTree.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\r\n//\t\t\tjTree.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {\r\n//\t\t\t\tpublic void valueChanged(javax.swing.event.TreeSelectionEvent e) {\r\n//\t\t\t\t\ttreeValueChanged(e,BaugruppeTreePaneView.this.getJTree());\r\n////\t\t\t\t\tSystem.out.println(\"valueChanged()\"); // TODO Auto-generated Event stub valueChanged()\r\n//\t\t\t\t}\r\n//\t\t\t});\r\n//\t\t\tjTree.addTreeSelectionListener(getTreeSelectionListner());\r\n\t\t\t//Aussehen von JTree\r\n\t\t\tjTree.setCellRenderer(new AnfoderungTreeRenderer());\r\n\t\t\tjTree.setToolTipText(\"\");\r\n\t\t\t\r\n\t\t}\r\n\t\treturn jTree;\r\n\t}", "void create(Node node) {\n if (node.table.negatives() == 0) {\r\n node.atribute = 1;\r\n return;\r\n }\r\n if (node.table.positives() == 0) {\r\n node.atribute = 0;\r\n return;\r\n }\r\n\r\n //If no test split the data, make it a leaf with the majoriti of the target atribute\r\n int atr;\r\n //Choose the best atribute\r\n atr = this.chooseBestAtrib(node);\r\n node.atribute = atr;\r\n\r\n //No atribute split the data, so make the node a leaf with the majoriti of the class (either positive or negative)\r\n if (node.atribute == -1) {\r\n //System.out.println(\"Atribute is -1 in TeeBuidler.create\");\r\n if (node.table.negatives() > node.table.positives()) {\r\n node.atribute = 0;\r\n return;\r\n }\r\n if (node.table.positives() >= node.table.negatives()) {\r\n node.atribute = 1;\r\n return;\r\n }\r\n }\r\n\r\n Table table_left = new Table(), table_right = new Table();\r\n node.table.splitByAtrib(node.atribute, table_left, table_right);\r\n\r\n //Create two children for the current node //parameters: identifier,parent_result,atribute of split,id_child1, id_child2, table\r\n node.child_left = new Node(node.id + node.id, \"1\", -1, -1, -1, table_left);\r\n node.child_right = new Node(node.id + node.id+1, \"0\", -1, -1, -1, table_right);\r\n node.id_child_left = node.id + node.id;\r\n node.id_child_right = node.id + node.id+1;\r\n\r\n\r\n TreeBuilder builder = new TreeBuilder();\r\n builder.create(node.child_left);\r\n builder.create(node.child_right);\r\n\r\n }", "public void initTreeModel() {\n\t\t\n\t}", "public void initTreeModel() {\n\t\t\n\t}", "public RBTree() {\r\n\t\t// well its supposed just create a new Red Black Tree\r\n\t\t// Maybe create a new one that does a array of Objects\r\n\t}", "public TreeImpl(T dato) {\r\n\t\traiz = new NodeImpl<T>(dato, null);// El null dice que es raiz\r\n\t}", "public KdTree() \n\t {\n\t\t \n\t }", "public void createChild (GenericTreeNode<String> daddy)\r\n\t{\r\n\t\t\tList < GenericTreeNode<String> > child= daddy.getChildren();\r\n\t\t\r\n\t\tif (daddy.getData().equalsIgnoreCase(\"next.CommonProfile.Dashboard_SI\")){\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.SupportFunctionality.VoiceRecogFunctionality\"));\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.Admin.Admin_Principal\"));\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.Client.Client_Principal\"));\t\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.Member.Member_Principal\"));\t\r\n\t\t}\r\n\t\telse if (daddy.getData().equalsIgnoreCase(\"next.CommonProfile.Dashboard_SU\")){\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.SupportFunctionality.VoiceRecogFunctionality\"));\r\n\t\t\t//child.add(new GenericTreeNode<String>(\"next.CommonProfile.DashboardPrincipal\"));\t\r\n\t\t}\r\n\t\telse if (daddy.getData().equalsIgnoreCase(\"next.Admin.Admin_Principal\")){\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.CommonProfile.PersonalInfo\"));\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.CommonProfile.Products\"));\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.Admin.Business_Rules\"));\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.view.support.CustomList\"));\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.SupportFunctionality.VoiceRecogFunctionality\"));\r\n\t\t}\r\n\t\telse if (daddy.getData().equalsIgnoreCase(\"next.view.support.CustomList\")){\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.SupportFunctionality.VoiceRecogFunctionality\"));\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.SupportFunctionality.MapsFunctionality\"));\r\n\t\t\t\r\n\t\t}else if (daddy.getData().equalsIgnoreCase(\"next.SupportFunctionality.MapsFunctionality\")){\r\n\t\t\tchild.add(new GenericTreeNode<String>(\"next.SupportFunctionality.VoiceRecogFunctionality\"));\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\tdaddy.setChildren(child);\r\n\t\t for (GenericTreeNode<String> node : daddy.getChildren()) {\r\n\t\t\t createChild (node);\r\n\t }\r\n\t}", "private JTree makeCatalogTree() {\n\t\t\n\t\ttree_root = new DefaultMutableTreeNode(\"all photos\");\n\t\ttree_root.setUserObject(root);\n\t\t\n\t\tfinal JTree tree = new JTree(tree_root);\n\t\ttree.setMinimumSize(new Dimension(200,400));\n\n\t\ttree.setToggleClickCount(3); // so that we can use double-clicks for previewing instead of expanding/collapsing\n\n\t\tDefaultTreeSelectionModel selectionModel = new DefaultTreeSelectionModel();\n\t\tselectionModel.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION);\n\t\ttree.setSelectionModel(selectionModel);\n\t\t\n\t\ttree.addMouseListener(new MouseInputAdapter() {\n\t\t\t@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t// if left-double-click @@@changed =2 to ==1\n\t\t\t\tif (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) {\n\t\t\t\t\tDefaultMutableTreeNode tempNode = getSelectedTreeNode();\n\t\t\t\t\tAlbum chosenAlbum =(Album) tempNode.getUserObject();\n\t\t\t\t\t\n\t\t\t\t\tpreviewPane.display(chosenAlbum);\n\t\t\t\t\t\n\t\t\t\t\t// YOUR CODE HERE\n\t\t\t\t\tSystem.out.println(\"show the photos for album \" + getSelectedTreeNode());\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t});\t\n\t\t\n\t\treturn tree;\n\t}", "public TreeviewBean() {\n \n }", "public JdbTree(TreeModel treeModel) {\r\n super(treeModel);\r\n commonInit();\r\n }", "FractalTree() {\r\n }", "public static TreeNode buildTree02() {\n\t\t\n\t\tTreeNode root = new TreeNode(5);\n\t\t/*\n\t\troot.left = new TreeNode(4);\n\t\troot.left.left = new TreeNode(11);\n\t\troot.left.left.left = new TreeNode(7);\n\t\troot.left.left.right = new TreeNode(2);\n\t\t\n\t\troot.right = new TreeNode(8);\n\t\troot.right.left = new TreeNode(13);\n\t\troot.right.right = new TreeNode(4);\n\t\troot.right.right.left = new TreeNode(5);\n\t\troot.right.right.right = new TreeNode(1);\n\t\t*/\n\t\treturn root;\n\t}", "public Hierarchy() {\n treeModel = new DefaultTreeModel(topNode);\n treeModel.addTreeModelListener(new MyTreeModelListener());\n initComponents ();\n }", "private AlertTreeNode createTree() \n throws AlertException {\n\n AlertTreeNode res = null;\n\n AlertComponent.AlertProperty prop = null;\n AlertComponent compRoot = null;\n AlertComponent compNode = null;\n AlertTreeNode node = null;\n AlertTreeNode prevNode = null;\n\n //\n // 'root' node\n //\n prop = new AlertComponent.AlertProperty(\"root\", AlertType.COMPOSITE);\n compRoot = new AlertRoot(prop);\n res = new AlertTreeNode(compRoot, null);\n\n //\n // 'node' Node.\n // \n for (int i = 0; i < compRoot.getNbChildren(); i++) {\n \n prop = compRoot.getPropertyChild(i);\n compNode = compRoot.getPropertyValueComponent(prop.getName());\n node = new AlertTreeNode(compNode, res);\n if (prevNode == null) {\n res.setChild(node);\n } else {\n prevNode.setSibling(node);\n }\n prevNode = node;\n }\n return res;\n }", "public String makeTree() {\r\n // Create a stack to store the files/directories in the tree\r\n Stack<DirectoryTreeNode> itemStack = new Stack<>();\r\n // Initialize a string variable to store the tree diagram\r\n String tree = \"\";\r\n // Push the root directory into the stack\r\n itemStack.push(this.rootDir);\r\n\r\n // Loop through the items in the Stack until all the items have been\r\n // traversed (this is similar to the pre-order traversal of the tree)\r\n while (!itemStack.isEmpty()) {\r\n // Get the item on the top of the stack and store it in current\r\n DirectoryTreeNode current = (DirectoryTreeNode) itemStack.pop();\r\n // Get the number of tabs required in the output for this item\r\n int numTabs = this.getNumberOfAncestors((E) current);\r\n // Get the string of tabs needed to put before current's name\r\n String tabs = this.getNumberOfTabs(numTabs);\r\n // Add the required number of tabs, the current item's of name and a\r\n // newline\r\n tree += tabs + current.getName() + \"\\n\";\r\n\r\n // Check if current is a Directory (in which case it may have\r\n // sub directories and files)\r\n if (current instanceof Directory) {\r\n // Get the list of files and directories of current directory\r\n ArrayList<DirectoryTreeNode> contents =\r\n ((Directory) current).getContents();\r\n // Loop through the contents of current and add them to the stack\r\n for (int i = contents.size() - 1; i >= 0; i--) {\r\n itemStack.add(contents.get(i));\r\n }\r\n }\r\n }\r\n // Return the generated tree diagram\r\n return tree;\r\n }", "public TreeBuilder() {\n\t\troot = null;\n\t}", "private void createTree(String Name) {\n DecisionTree tree = new DecisionTree(treeID, Name, mainPanel.getSize(), font);\n mainPanel.addTab(Name + \" *\", tree);\n trees.add(tree);\n }", "public static TreeNode buildTree01() {\n\t\t\n\t\tTreeNode root = new TreeNode(5);\n\t\t\n\t\troot.left = new TreeNode(4);\n\t\troot.left.left = new TreeNode(11);\n\t\troot.left.left.left = new TreeNode(7);\n\t\troot.left.left.right = new TreeNode(2);\n\t\t\n\t\troot.right = new TreeNode(8);\n\t\troot.right.left = new TreeNode(13);\n\t\troot.right.right = new TreeNode(4);\n\t\troot.right.right.right = new TreeNode(1);\n\t\t\n\t\treturn root;\n\t}", "public JdbNavTree(TreeModel treeModel) {\r\n super(treeModel);\r\n commonInit();\r\n }", "public BuildTree createBuildTree() {\n BuildTree buildTree = new BuildTree();\n createBuildTree(0, buildTree);\n return buildTree;\n }", "List<UmsMenuNode> treeList();", "public RBTree() {\n\t\troot = null;\n\t\tdrawer = new RBTreeDrawer();\n\t}", "public TreeNode(String name) {\r\n setName(name);\r\n }", "protected void createTree() {\n\n\t\tint nextPlayer = opponent;\n\n\t\tQueue<Node> treeQueue = new LinkedList<Node>();\n\t\tWinChecker winCheck = new WinChecker();\n\n\t\ttreeQueue.add(parent);\n\n\t\twhile (!treeQueue.isEmpty()) {\n\t\t\tNode currentNode = treeQueue.poll();\n\n\t\t\tif (currentNode.getMove().Row != -1\n\t\t\t\t\t&& currentNode.getMove().Col != -1) {\n\t\t\t\tgb.updateBoard(currentNode.getMove());\n\n\t\t\t\tif (winCheck.getWin(gb) >= 0) {\n\t\t\t\t\tgb.revertBoard(currentNode.getMove());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tgb.revertBoard(currentNode.getMove());\n\t\t\t}\n\n\t\t\t// Restricting the depth to which we will create the tree\n\t\t\tif (currentNode.getPly() > 2) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tfor (List<Hexagon> tempList : this.gb.getBoard()) {\n\t\t\t\tfor (Hexagon tempHex : tempList) {\n\n\t\t\t\t\tif (tempHex == null) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (tempHex.getValue() == EMPTY) {\n\n\t\t\t\t\t\tif (currentNode.getPly() % 2 == 0) {\n\t\t\t\t\t\t\tnextPlayer = opponent;\n\t\t\t\t\t\t} else if (currentNode.getPly() % 2 == 1) {\n\t\t\t\t\t\t\tnextPlayer = player;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tMove nextMove = new Move(nextPlayer, false,\n\t\t\t\t\t\t\t\ttempHex.getRow(), tempHex.getColumn());\n\n\t\t\t\t\t\tNode newNode = new Node(currentNode.getPly() + 1,\n\t\t\t\t\t\t\t\tnextMove);\n\t\t\t\t\t\tnewNode.setParent(currentNode);\n\n\t\t\t\t\t\tcurrentNode.children.add(newNode);\n\n\t\t\t\t\t\ttreeQueue.add(newNode);\n\t\t\t\t\t\ttempHex.setValue(EMPTY);\n\t\t\t\t\t}// End of if statement\n\n\t\t\t\t}// End of inner ForLoop\n\t\t\t}// End of outer ForLoop\n\n\t\t\t// currentNode.printChildren();\n\n\t\t}// End of While Loop\n\n\t}", "public GenerateJTree1() {\n UIManager.put(\"Tree.rendererFillBackground\", false);\n initComponents();\n BasicInternalFrameUI bifui = (BasicInternalFrameUI) this.getUI();\n bifui.setNorthPane(null);\n bifui.setSouthPane(null);\n\n// UIDefaults d = new UIDefaults();\n// d.put(\"Tree.selectionBackground\", Color.GREEN);\n// jTree1.putClientProperty(\"Nimbus.Overrides\", d);\n// jTree1.putClientProperty(\"Nimbus.Overrides.InheritDefaults\", false);\n cellColour();\n try {\n loadTree();\n } catch (NotBoundException | MalformedURLException | RemoteException | ClassNotFoundException | SQLException | InterruptedException ex) {\n Logger.getLogger(GenerateJTree1.class.getName()).log(Level.SEVERE, null, ex);\n }\n ToolTipManager.sharedInstance().registerComponent(jTree1);\n }", "public static void buildStage2 ()\r\n {\r\n \r\n lgt.findParent(); //4\r\n lgt.findChild(0); //6\r\n lgt.insert(12);\r\n lgt.findParent();\r\n lgt.insert(13);\r\n lgt.findParent();\r\n lgt.insert(14);\r\n \r\n lgt.findRoot();\r\n lgt.findChild(0);//2\r\n lgt.findChild(0);//5\r\n lgt.insert(8);\r\n lgt.findParent();\r\n lgt.insert(9);\r\n lgt.findParent();\r\n lgt.insert(10);\r\n lgt.findParent();\r\n lgt.insert(11);\r\n \r\n }", "protected void buildHirarchyTree() {\r\n\t\tfor(SupplyZone s : supplyZoneLines){\r\n\t\t\tZoneNode currentZone = zoneNodeMap.get(s.getZoneName());\r\n\t\t\tZoneNode parentZone = zoneNodeMap.get(s.getParentZoneName());\r\n\t\t\tif(parentZone == null){\r\n\t\t\t\tzonesTreeRoot = currentZone;\r\n\t\t\t}\r\n\t\t\tcurrentZone.setParent(parentZone);\r\n\t\t\tif (parentZone != null) parentZone.addChild(currentZone); \r\n\t\t}\r\n\r\n\t}", "public Tree() // constructor\n\t{ root = null; }", "private static TreeNode getNode() {\n TreeNode treeNode = new TreeNode(1);\n TreeNode left = new TreeNode(2);\n TreeNode right = new TreeNode(3);\n treeNode.left = left;\n treeNode.right = right;\n\n left.left = new TreeNode(4);\n right.left = new TreeNode(5);\n right.right = new TreeNode(6);\n return treeNode;\n }", "private <X extends Jgxx> X buildTree(X root) {\n\t\tList<X> list = this.extendedModelProvider.find(EXTEND_MODEL_XTGL_ZHGL_JGXX_CODE, Jgxx.class, SELECT_PRE_SQL + \" WHERE J.LFT BETWEEN ? AND ? AND J.DELETED = 0 ORDER BY J.LFT\",\n\t\t\t\troot.getLft(), root.getRgt());\n\t\tStack<X> rightStack = new Stack<X>();\n\t\tfor (X node : list) {\n\t\t\tif (!rightStack.isEmpty()) {\n\t\t\t\twhile (rightStack.lastElement().getRgt() < node.getRgt()) {\n\t\t\t\t\trightStack.pop();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!rightStack.isEmpty()) {\n\t\t\t\trightStack.lastElement().addChild(node);\n\t\t\t}\n\t\t\trightStack.push(node);\n\t\t}\n\t\treturn rightStack.firstElement();\n\t}", "public JdbNavTree(TreeNode root) {\r\n super(root);\r\n commonInit();\r\n }", "private void setup(){\n buildTree(2);\n }", "private TreeItem<FilePath> createTreeRoot() {\n TreeItem<FilePath> root = new TreeItem<>(new FilePath(Paths.get(ROOT_FOLDER)));\n root.setExpanded(true);\n return root;\n }", "public KdTree() \r\n\t{\r\n\t}", "private void setUpDefaultTree() {\n\t\tTreeItem<String> tempTreeItem = new TreeItem<String>(\"Floor 1\");\n\t\tFloor tempFloor = new Floor(new Image(\"scheduleyTest/floorplan1.jpg\"));\n\t\tfloorHashMap.put(tempTreeItem, tempFloor);\n\t\ttree.getRoot().getChildren().add(tempTreeItem);\n\t\ttempFloor.addMeetingSpace(new MeetingSpace(new Rectangle(88,40,213,113)));\n\t\ttempFloor.addMeetingSpace(new MeetingSpace(new Rectangle(88,153,139,119)));\n\t\ttempTreeItem.getChildren().addAll(new TreeItem<String>(\"Room 1\"), new TreeItem<String>(\"Room 2\"));\n\t}", "public Tree() {\n // constructor. no nodes in tree yet\n root = null;\n }", "public static Node constructTree() {\n\n Node node2 = new Node(2, null, null);\n Node node8 = new Node(8, null, null);\n Node node12 = new Node(12, null, null);\n Node node17 = new Node(17, null, null);\n\n Node node6 = new Node(6, node2, node8);\n Node node15 = new Node(15, node12, node17);\n\n //Root Node\n Node node10 = new Node(10, node6, node15);\n\n return node10;\n }", "public static TreeNode generateBinaryTree1() {\n // Nodes\n TreeNode root = new TreeNode(5);\n TreeNode rootLeft = new TreeNode(2);\n TreeNode rootRight = new TreeNode(4);\n TreeNode rootLeftLeft = new TreeNode(20);\n TreeNode rootLeftRight = new TreeNode(1);\n // Edges\n root.left = rootLeft;\n root.right = rootRight;\n rootLeft.left = rootLeftLeft;\n rootLeft.right = rootLeftRight;\n\n // Return root\n return root;\n }", "protected FVResourceNode createVFsTree(IProgressObserver observer) {\n if (observer == null) {\n observer = new ObserverAdapter();\n }\n\n TreeManagementModel model =\n mgrModels.get(TreeTypeEnum.VIRTUAL_FABRICS_TREE);\n if (model.isValid()) {\n observer.onFinish();\n return model.getTree();\n }\n\n IProgressObserver[] subObsevers = observer.createSubObservers(2);\n\n FVResourceNode vfTree =\n new FVResourceNode(subnet.getName(), TreeNodeType.ALL,\n TreeNodeType.ALL.ordinal());\n FVResourceNode subnetTree = createDeviceTypesTree(subObsevers[0]);\n subObsevers[0].onFinish();\n VirtualFabricsTreeSynchronizer treeUpdater =\n new VirtualFabricsTreeSynchronizer(mPerformanceApi, subnetTree);\n treeUpdater.updateTree(vfTree, null, subObsevers[1]);\n subObsevers[1].onFinish();\n model.setTree(vfTree);\n return vfTree;\n }", "public TwoFourTree()\r\n\t{\r\n\t\troot = new TreeNode(); //assign the root to a new tree node\r\n\t}", "private static Node getTree()\r\n {\r\n Node node1 = new Node( 1 );\r\n Node node2 = new Node( 2 );\r\n Node node3 = new Node( 3 );\r\n Node node4 = new Node( 4 );\r\n Node node5 = new Node( 5 );\r\n Node node6 = new Node( 6 );\r\n Node node7 = new Node( 7 );\r\n\r\n node1.left = node2;\r\n node1.right = node3;\r\n\r\n node2.left = node4;\r\n node2.right = node5;\r\n\r\n node3.left = node6;\r\n node3.right = node7;\r\n return node1;\r\n }", "TreeNode getTreeNode();", "public void encodeTree(){\n StringBuilder builder = new StringBuilder();\n encodeTreeHelper(root,builder);\n }", "public Tree() {\n super.springPictureName = \"tree2.png\";\n super.summerPictureName = \"tree4.png\";\n super.autumnPictureName = \"tree5.png\";\n super.winterPictureName = \"tree7.png\";\n super.eachElementCapacity = 3;\n\n }", "List<TreeNodeDTO> genTree(boolean addNodeSize, boolean addRootNode, List<Long> disabledKeys);", "public static RootNode buildTree() {\n\t\t//1\n\t\tfinal RootNode root = new RootNode();\n\t\t\n\t\t//2\n\t\tEdgeNode a = attachEdgenode(root, \"a\");\n\t\tEdgeNode daa = attachEdgenode(root, \"daa\");\n\t\t\n\t\t//3\n\t\tExplicitNode e = Builder.buildExplicit();\n\t\te.setPreviousNode(a);\n\t\ta.addChildNode(e);\n\t\t\n\t\tattachLeafNode(daa, \"2\");\n\t\t\n\t\t//4\n\t\tEdgeNode a_e = attachEdgenode(e, \"a\");\n\t\tEdgeNode daa_e = attachEdgenode(e, \"daa\");\t\t\n\t\t\n\t\t//5\n\t\tattachLeafNode(a_e, \"3\");\n\t\tattachLeafNode(daa_e, \"1\");\n\t\treturn root;\n\t}", "public AVLTree() {\r\n\r\n\r\n this.root = new AVLTreeNode(9);\r\n Delete(9);\r\n }", "public static Node buildRandomTree() {\n\t\tNode root = createNode(15);\n\t\troot.leftChild = createNode(10);\n\t\troot.rightChild = createNode(4);\n\t\troot.leftChild.leftChild = createNode(25);\n\t\troot.leftChild.leftChild.rightChild = createNode(27);\n\t\troot.leftChild.leftChild.leftChild = createNode(13);\n\t\troot.leftChild.rightChild = createNode(25);\n\t\troot.leftChild.rightChild.rightChild = createNode(7);\n\t\t\n\t\treturn root;\n\t}", "private void createTree() {\n DefaultMutableTreeNode topNode = new DefaultMutableTreeNode(\"The World\");\n myTree = new JTree(topNode);\n\n DefaultMutableTreeNode mainPortNode = new DefaultMutableTreeNode(\"Sea Ports\");\n topNode.add(mainPortNode);\n\n for(SeaPort mySeaPort : world.getPorts()) {\n DefaultMutableTreeNode individualPortNode = new DefaultMutableTreeNode(mySeaPort.getName());\n mainPortNode.add(individualPortNode);\n\n DefaultMutableTreeNode peopleNode = new DefaultMutableTreeNode(\"People\");\n individualPortNode.add(peopleNode);\n for(Person myPerson : mySeaPort.getPersons()) {\n DefaultMutableTreeNode individualPeopleNode = new DefaultMutableTreeNode(myPerson.getName());\n peopleNode.add(individualPeopleNode);\n }\n\n DefaultMutableTreeNode dockNode = new DefaultMutableTreeNode(\"Docks\");\n individualPortNode.add(dockNode);\n for(Dock myDock : mySeaPort.getDocks()) {\n DefaultMutableTreeNode individualDockNode = new DefaultMutableTreeNode(myDock.getName());\n dockNode.add(individualDockNode);\n if(myDock.getShip() != null) {\n DefaultMutableTreeNode dockedShip = new DefaultMutableTreeNode(myDock.getShip().getName());\n individualDockNode.add(dockedShip);\n for(Job myJob : myDock.getShip().getJobs()) {\n DefaultMutableTreeNode dockedShipJob = new DefaultMutableTreeNode(myJob.getName());\n dockedShip.add(dockedShipJob);\n }\n }\n }\n\n DefaultMutableTreeNode portQueNode = new DefaultMutableTreeNode(\"Ship Queue\");\n individualPortNode.add(portQueNode);\n for(Ship myShip : mySeaPort.getQue()) {\n DefaultMutableTreeNode quedShip = new DefaultMutableTreeNode(myShip.getName());\n portQueNode.add(quedShip);\n for(Job myJob : myShip.getJobs()) {\n DefaultMutableTreeNode quedShipJob = new DefaultMutableTreeNode(myJob.getName());\n quedShip.add(quedShipJob);\n }\n }\n\n } //end of initial for loop inside createTree() method\n\n /*This method call is added in case a user reads a new data file after they\n have already read one or more data files.\n */\n myTreePanel.removeAll();\n\n //Add everything to the myTreePanel\n JScrollPane myTreeScroll = new JScrollPane(myTree);\n myTreePanel.add(myTreeScroll, BorderLayout.CENTER);\n validate();\n }", "@Test\n\tpublic void testBuildTree() {\n\t\tTree<Integer> tree = new Tree<Integer> ();\n\t\t//add first level children, 1\n\t\tNode<Integer> root = tree.getRoot();\n\t\troot.addChild(new Node<Integer>());\n\t\tNode<Integer> c1 = root.getFirstChild();\n\t\tassertTrue(c1.getData() == null);\n\t\t//add second level children, 3\n\t\tc1.addChild(new Node<Integer> ());\n\t\tc1.addChild(new Node<Integer> ());\n\t\tc1.addChild(new Node<Integer> ());\n\t\tassertTrue(c1.countChildren() == 3);\n\t\t//add third level children, 3 * 3\n\t\tint[][] leafData = {\n\t\t\t\t{8,7,2},\n\t\t\t\t{9,1,6},\n\t\t\t\t{2,4,1}\n\t\t};\n\t\tNode<Integer> c2 = c1.getFirstChild();\n\t\tint i = 0;\n\t\twhile (c2 != null) {\n\t\t\tc2.addChild(new Node<Integer> (leafData[i][0]));\n\t\t\tc2.addChild(new Node<Integer> (leafData[i][1]));\n\t\t\tc2.addChild(new Node<Integer> (leafData[i][2]));\n\t\t\tc2 = c2.next();\n\t\t\ti++;\n\t\t}\n\t\tassertTrue(tree.countDepth() == 3);\n\t\tNode<Integer> leaf = root;\n\t\twhile (leaf.countChildren() > 0) {\n\t\t\tleaf = leaf.getFirstChild();\n\t\t}\n\t\tassertTrue(leaf.getData() == 8);\t\t\t\n\t}", "private TreeModel getTreeValues(){\r\n \r\n DefaultMutableTreeNode parent;\r\n DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(\"Components\");\r\n String[] nodes = null;\r\n \r\n parent = rootNode;\r\n \r\n for(Netlist nl: netlists){\r\n for(String s: nl.keySet()){\r\n nodes = s.split(\"\\\\.\");\r\n parent = rootNode;\r\n \r\n // Due to structure of keys, the tree is produced depth-first\r\n for(int i=0; i<nodes.length; i++){\r\n // Create a new node for this sub category\r\n DefaultMutableTreeNode mtn = new DefaultMutableTreeNode(nodes[i]);\r\n \r\n // Create the child nodes\r\n Enumeration children = parent.children();\r\n Boolean exists = false;\r\n while(children.hasMoreElements()){\r\n DefaultMutableTreeNode next = (DefaultMutableTreeNode) children.nextElement();\r\n \r\n // Check whether the next tree node already exists\r\n if(next.getUserObject().equals(mtn.getUserObject())){ \r\n exists = true;\r\n mtn = next;\r\n break;\r\n }\r\n }\r\n if(!exists){\r\n parent.add(mtn); \r\n }\r\n \r\n // We already have this node, move to the child\r\n parent = mtn; \r\n } \r\n } \r\n }\r\n return new DefaultTreeModel(rootNode);\r\n }", "public JTree getTree(){\n return tree;\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic void initTreeView(int index){\n\t treeView.setCellFactory(new Callback<TreeView<JTable>, TreeCell<JTable>>() {\r\n\r\n\t @Override\r\n\t public TreeCell<JTable> call(TreeView<JTable> jt) {\r\n\r\n\t \treturn new TreeCell<JTable>(){\r\n\r\n\t @Override\r\n\t protected void updateItem(JTable f, boolean empty) {\r\n\t \tsuper.updateItem(f, empty);\r\n\t \tif(empty){\r\n\t setText(null);\r\n\t setGraphic(null);\r\n\t }else{\r\n\t setText(f.getName());\r\n\t setGraphic(null);\r\n\t setOnMouseClicked((MouseEvent t) -> {\r\n\t \t//当前节点是子节点的时候,生成表格stage\r\n\r\n\t \tif(getChildren().size() == 1){\r\n\t \t\tif (t.getClickCount() == 1) {\r\n//\t\t \t\t \tDialogs.create()\r\n//\t\t \t\t .owner(Main.stage)\r\n//\t\t \t\t .title(\"提示\")\r\n//\t\t \t\t .masthead(\"提示\")\r\n//\t\t \t\t .message(\"弹出表格信息窗口\")\r\n\t//\r\n//\t\t \t\t .showInformation();\r\n\t\t \t\t//跳转至表格页面\r\n\t\t \t\tStage stage = new Stage();\r\n\t\t \t\t//stage.setTitle(f.getName());\r\n\t\t \t\t\tAnchorPane root = null;\r\n\t\t \t\t\tSpringFxmlLoader loader = new SpringFxmlLoader();\r\n\t\t\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\t\t\troot = (AnchorPane) loader.springLoad(\"view/tableView.fxml\", Main.class);\r\n\r\n\r\n\t\t\t TableController controller = loader.getController();\r\n\t\t\t controller.setStage(stage);\r\n\t\t\t controller.setTableName(f.getNameEn());\r\n\t\t\t controller.setChildFlag(false);\r\n\t\t\t controller.selectTable(\" where 1=1 \");\r\n\r\n\t\t\t Scene scene = new Scene(root);\r\n\t\t\t stage.setScene(scene);\r\n\t\t\t log.info(\"--弹出表\" + f.getName() + \"--\");\r\n\t\t\t stage.show();\r\n\t\t\t Integer total = tableService.getTotal(f.getNameEn(), \" where 1 =1 \");\r\n\t\t\t String title = f.getName() + \"[\" + f.getNameEn() + \"]\" + \"[\" + total + \"]\";\r\n\r\n\t\t\t //如果是几个汉化表的编辑,添加说明\r\n\t\t\t if(StaticData.translate_col_name.equalsIgnoreCase(f.getNameEn()) ||\r\n\t\t\t \t\tStaticData.translate_content_name.equalsIgnoreCase(f.getNameEn()) ||\r\n\t\t\t \t\tStaticData.translate_table_name.equalsIgnoreCase(f.getNameEn())){\r\n\t\t\t \tString tips = \"(*系统默认10分钟刷新一次汉化信息,若使汉化编辑立即生效,可点击刷新汉化按钮)\";\r\n\t\t\t \ttitle += tips;\r\n\t\t\t }\r\n\r\n\t\t\t stage.setTitle(title);\r\n\t\t\t\t\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t\t\t\tlog.error(e.getStackTrace());\r\n\t\t\t\t\t\t\t\t\t\t\t\tlog.error(e.getMessage());\r\n\t\t\t\t\t\t\t\t\t\t\t\tDialogTools.error(\"错误\", \"出错了!\", \"查询表单数据出错!\");\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t \t\t }\r\n\t \t}\r\n\r\n\t } );\r\n\r\n\t }\r\n\t }\r\n\r\n\t };\r\n\t }\r\n\t });\r\n\r\n\t treeView.setRoot(StaticData.treeItemMap.get(index));\r\n\r\n\t }", "public TreeNode(Object e) {\n element = e;\n //this.parent = null;\n left = null;\n right = null;\n }", "private CategoryView buildComplicatedExpectedTree() {\n\n CategoryView root = new CategoryView(\"ROOT\");\n CategoryView a = new CategoryView(\"a\");\n CategoryView b = new CategoryView(\"b\");\n CategoryView c = new CategoryView(\"c\");\n CategoryView d = new CategoryView(\"d\");\n CategoryView e = new CategoryView(\"e\");\n\n root.addChild(a);\n root.addChild(e);\n root.addChild(new CategoryView(\"f\"));\n root.addChild(new CategoryView(\"g\"));\n root.addChild(new CategoryView(\"z\"));\n a.addChild(b);\n b.addChild(c);\n a.addChild(c);\n c.addChild(d);\n d.addChild(e);\n c.addChild(e);\n\n root.addChild(new CategoryView(\"1\") {{\n addChild(new CategoryView(\"2\") {{\n addChild(new CategoryView(\"3\"));\n }});\n }});\n root.addChild(new CategoryView(\"x\") {{\n addChild(new CategoryView(\"y\"));\n }});\n\n return root;\n }", "public void refreshTree(){\n\r\n\t\ttestCaseVector = db.getTestCases();\r\n\t\tFolderVector = db.getFolders();\r\n\t\trootNode_TC = new DefaultMutableTreeNode(\"Test Cases\");\r\n\t\ts = new MyTreeNode [testCaseVector.size()+FolderVector.size() +2];\r\n\t\tFolder1 = new DefaultMutableTreeNode [testCaseVector.size()+FolderVector.size() +2];\r\n\r\n\r\n\r\n\t\tint x = 1 ; \r\n\t\tfor(Folder f: FolderVector){\r\n\t\t\ts[x] = new MyTreeNode(f.getName(),'f', x, f.getFolderID());\r\n\r\n\t\t\tExpandedID[x] = f.getFolderID();\r\n\t\t\tFolder1[x] = new DefaultMutableTreeNode(s[x]);\r\n\r\n\t\t\tif (f.getParentID() == 0)\r\n\t\t\t{\r\n\t\t\t\trootNode_TC.add(Folder1[x]);\r\n\t\t\t\tx++;\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\telse {\r\n\r\n\t\t\t\tfor (int u = 1 ; u < s.length; u++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif(s[u]!=null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(s[u].getType() == 'f')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(s[u].getID() == f.getParentID())\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tFolder1[u].add(Folder1[x]);\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}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tint l = x-1;\r\n\t\t\tfor(TestCase tc : testCaseVector)\r\n\t\t\t{\r\n\r\n\t\t\t\tif (tc.getFolderID() == f.getFolderID())\r\n\t\t\t\t{\r\n\t\t\t\t\ts[x] =new MyTreeNode(tc.getName(), 't', x, tc.getId());\r\n\r\n\t\t\t\t\tFolder1[l].add(new DefaultMutableTreeNode(s[x]));\r\n\t\t\t\t\tx++;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tint y = FolderVector.size()+1;\r\n\t\tfor(TestCase tc : testCaseVector)\r\n\t\t{\r\n\t\t\tif(tc.getFolderID() == 0){\r\n\r\n\r\n\t\t\t\tMyTreeNode s=new MyTreeNode(tc.getName(), 't', y, tc.getId());\r\n\t\t\t\trootNode_TC.add(new DefaultMutableTreeNode(s));\r\n\t\t\t\ty++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tDefaultTreeModel Tree1 = new DefaultTreeModel(rootNode_TC);\r\n\t\toverviewTree.setModel(Tree1);\r\n\t\toverviewTree.setCellRenderer(new TreeRenderer(isExpanded, ExpandedID));\r\n\t\tfor(Folder f: FolderVector)\r\n\t\t{\r\n\t\t\tif(isExpanded[f.getFolderID()]){ // To expand the already expanded folders\r\n\t\t\t\tfor (int u = 1 ; u < s.length; u++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif(s[u]!=null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(s[u].getType() == 'f')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(s[u].getID() == f.getFolderID())\r\n\t\t\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t\t\tEnumeration<DefaultMutableTreeNode> e = rootNode_TC.depthFirstEnumeration();\r\n\t\t\t\t\t\t\t\twhile (e.hasMoreElements()) {\r\n\t\t\t\t\t\t\t\t\tDefaultMutableTreeNode node = e.nextElement();\r\n\t\t\t\t\t\t\t\t\tif (node != overviewTree.getModel().getRoot() )\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tMyTreeNode nodeInfo = null ;\r\n\t\t\t\t\t\t\t\t\t\tnodeInfo = (MyTreeNode) node.getUserObject();\r\n\t\t\t\t\t\t\t\t\t\tif (nodeInfo.getName().equalsIgnoreCase(s[u].getName())) \r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tTreePath p = new TreePath(node.getPath());\r\n\t\t\t\t\t\t\t\t\t\t\toverviewTree.expandRow(overviewTree.getRowForPath(p));\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\r\n\t}", "public NamedTree()\r\n {\r\n head = null;\r\n }", "public RBTree() {\r\n\t\troot = null;\r\n\t}", "public String treeType();", "private void createDOMTree(){\n\t\tElement rootEle = dom.createElement(\"Personnel\");\n\t\tdom.appendChild(rootEle);\n\n\t\t//No enhanced for\n\t\tIterator it = user.iterator();\n\t\twhile(it.hasNext()) {\n\t\t\tUserInformation b = (UserInformation)it.next();\n\t\t\t//For each Book object create element and attach it to root\n\t\t\tElement bookEle = createUserElement(b);\n\t\t\trootEle.appendChild(bookEle);\n\t\t}\n\t}", "public void buildClassTree() {\n\t\twriter.writeClassTree();\n\t}" ]
[ "0.76777947", "0.75327027", "0.7510975", "0.7140259", "0.7082461", "0.706725", "0.6985937", "0.6979851", "0.69705325", "0.6954513", "0.6931045", "0.68234503", "0.6822201", "0.68071884", "0.6783203", "0.67606694", "0.67378676", "0.6629428", "0.6588919", "0.6576995", "0.6565483", "0.6540858", "0.6533174", "0.65154123", "0.64774835", "0.6464904", "0.6447735", "0.642664", "0.6423877", "0.63964576", "0.6393936", "0.6386129", "0.6381626", "0.6378338", "0.6377559", "0.63702977", "0.635589", "0.6351143", "0.6348543", "0.6337586", "0.63291305", "0.6324638", "0.6324638", "0.6318802", "0.63137925", "0.6312287", "0.63097465", "0.630459", "0.63026196", "0.6301569", "0.62914556", "0.62842363", "0.6278385", "0.627781", "0.62767386", "0.62695456", "0.62660766", "0.626413", "0.62567306", "0.6250861", "0.62391865", "0.62262386", "0.61985004", "0.61980516", "0.61925095", "0.61888045", "0.6172233", "0.6171147", "0.6167562", "0.6166918", "0.61645365", "0.6160785", "0.61582035", "0.6155531", "0.61519796", "0.6151219", "0.61354995", "0.6134447", "0.61336726", "0.61311567", "0.61248744", "0.6111414", "0.6111254", "0.61016744", "0.6093096", "0.6090833", "0.6088943", "0.608331", "0.6065064", "0.605523", "0.60374665", "0.6033627", "0.60309696", "0.60275733", "0.6012892", "0.6009326", "0.6008964", "0.6000474", "0.59993327", "0.5992894", "0.5988313" ]
0.0
-1
Creates a new IcsSystemConsoleDesignation with the specified connection and encoding.
public IcsSystemConsoleDesignation(Connection connection, String encoding){ super(connection, encoding); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ChessclubHelpConsoleDesignation(\n Connection connection, String encoding, boolean isConsoleCloseable) {\n super(connection, true, encoding, isConsoleCloseable);\n }", "private AbstractTerminal()\n\t{\n\t\tio = new SwingTextTerminal();\n\t}", "public Cli (BufferedReader in,PrintWriter out , Controller thecontroller) {\r\n\t\tsuper(thecontroller);\r\n\t\tthis.in=in;\r\n\t\tthis.out=out;\r\n\t\tthis.commandsSet= controller.getCommandSet();\r\n\t}", "public Console() {\n initComponents();\n }", "public static SubsystemNodeContainer createSubsystemNodeContainer() {\n Map<String, String> properties = new HashMap<String, String>();\n properties.put(\"String\", \"String\");\n TransferHandler handler = new TransferHandler(\"\");\n SubsystemNodeContainer snc = null;\n try {\n snc = new SubsystemNodeContainer(AccuracyTestHelper.createGraphNodeForSubsystem(), properties, handler);\n } catch (IllegalGraphElementException e) {\n TestCase.fail(\"Should not throw exception here.\");\n }\n return snc;\n }", "public ChatClient(){\n System.out.print(\"2c\");\n }", "abstract void initiateConsole();", "public Terminal() {\n initComponents();\n }", "public OutputConsole() {\n initComponents();\n setSize (1520, 750);\n }", "public Connect4TextConsole(){\r\n this.board = new Connect4(); \r\n this.comp = new Connect4ComputerPlayer(this.board);\r\n }", "public MyViewCLI(InputStreamReader in, OutputStreamWriter out, Controller controller) {\r\n\t\tcli = new CLI(in, out, controller);\r\n\t\tthis.controller = controller;\r\n\t}", "PiviDiagram createPiviDiagram();", "public NewTextLineCodecFactory(String charset,String encodingDelimiter, String decodingDelimiter){\n\t\tsuper(Charset.forName(charset),encodingDelimiter,decodingDelimiter);\n\t}", "public CLI(String inputCommand)\r\n\t{\r\n\t\t//lvl = new Level();\r\n\t\tthis.inputCommand = inputCommand;\r\n\t\tin = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\r\n\t}", "public void init() throws ExcecaoGrafo, SecurityException, IOException {\n\t\tlogger.setUseParentHandlers(handleConsole);\n\t\tlogger.addHandler(fileHandler);\n\t\tStringBuilder builder = new StringBuilder();\n\n\t\tString startTimeString = calendar.get(Calendar.DAY_OF_MONTH)+\".\"+\n\t\t\t\tcalendar.getDisplayName(Calendar.MONTH, Calendar.SHORT,Locale.getDefault())+\"-\"+\n\t\t\t\tcalendar.get(Calendar.HOUR_OF_DAY)+\":\"+calendar.get(Calendar.MINUTE)+\":\"+calendar.get(Calendar.SECOND);\n\t\tstart = System.currentTimeMillis();\n\t\tstartTemp = start;\n\t\tbuilder.append(\"Simulation started at \").append(startTimeString).append(System.lineSeparator());\n\n\t\tbuilder.append(\"Simulation Setup:\").append(System.lineSeparator());\n\t\tbuilder.append(\"Data Directory: \" + directory).append(System.lineSeparator());\n\t\tbuilder.append(\"RSSA heuristic policy: \" + algorithm).append(System.lineSeparator());\n\t\tbuilder.append(\"Switch Type: \" + this.switchingType).append(System.lineSeparator());\n\t\tbuilder.append(\"Arrival Process: \" + (isIncremental? \"INCREMENTAL\" : \"POISSON\")).append(System.lineSeparator());\n\t\tbuilder.append(\"Network topology: \" + topology).append(System.lineSeparator());\n\t\tbuilder.append(\"Numbef of K shortest paths: \" + numKShortestPaths).append(System.lineSeparator());\n\t\tbuilder.append(\"number of requests in total: \" + requestLimit).append(System.lineSeparator());\n\t\tbuilder.append(\"Total spectrum slots per fiber: \" + spectralSlots).append(System.lineSeparator());\n\t\tbuilder.append(\"Total of spatial dimensions: \" + spatialDimension).append(System.lineSeparator());\n\t\tbuilder.append(\"Shortest slots per Super Channel: \" + numCarrierSlots).append(System.lineSeparator());\n\t\tbuilder.append(\"SIGNAL BANDWIDTH: \").append(signalBw).append(\" GHz\").append(System.lineSeparator());\n\t\tbuilder.append(\"CHANNEL SPACING: \").append(channelSpacing).append(\" GHz\").append(System.lineSeparator());\n\t\tbuilder.append(\"BAND GUARD WIDTH: \").append(bandGuard).append(\" GHz\").append(System.lineSeparator());\n\t\tbuilder.append(\"SLOT WIDTH: \").append(slotBw).append(\" GHz\").append(System.lineSeparator());\n\t\tbuilder.append(\"MODULATION FORMAT: \").append(modulationFormat).append(System.lineSeparator());\n\n\t\tbuilder.append(\"Seed: \" + seed).append(System.lineSeparator());\n\t\tbuilder.append(\"Mean holding time: \" + holdingTime ).append(System.lineSeparator());\n\t\tbuilder.append(\"initial load: \" + initialLoad ).append(System.lineSeparator());\n\t\tbuilder.append(\"end load: \" + endLoad).append(System.lineSeparator());\n\t\tbuilder.append(\"Load incremental factor: \" + incrementalLoad).append(System.lineSeparator());\n\t\tbuilder.append(\"Use fixed bandwidth: \" + isFixedBandwidth).append(System.lineSeparator());\n\t\tbuilder.append(\"Debug: \" + debug).append(System.lineSeparator());\n\t\tbuilder.append(\"Fiber Type: \" + (isFewModeFiber? \"Few Mode Fiber\" : \"Multicore Fiber\")).append(System.lineSeparator());\n\n\n\t\t//gets the graph\n\t\tgraph = (Grafo) NetworkTopology.getGraph(NetworkTopology.valueOf(topology));\n\t\tif (graph == null) {\n\t\t\tthrow new ExcecaoGrafo(\"The value of topology: '\" + topology + \"' returned null!\");\n\t\t}\n\t\t//sets the total input network load\n\t\ttotalInputNetworkLoad = spectralSlots*spatialDimension*graph.getEnlaces().tamanho()/2;\n\t\tsetTotalInputLoad(totalInputNetworkLoad);\n\n\t\t//creates the spatial super channel classes list\n\t\tcreateSpaceClasses();\n\n\t\t//calculates the mean slot size\n\t\tArrayList<Integer> slotsSizeList = new ArrayList<>();\n\t\tfor (OpticalSuperChannel osc : spaceSC_List) {\n\t\t\tslotsSizeList.add((int)osc.getNumSlots());\n\t\t}\n\t\tmeanSlotSize = mean( slotsSizeList );;\n\n\t\t//calculates the mean distance size hop by hop\n\t\tmeanDistanceSize = getAverageHopsNumberPerPath(graph);\n\n\t\tbuilder.append(\"Total Input Network Load: \" + totalInputNetworkLoad).append(System.lineSeparator());\n\t\tbuilder.append(\"Mean Slot Size: \" + meanSlotSize).append(System.lineSeparator());\n\t\tbuilder.append(\"Mean Distance Size: \" + meanDistanceSize).append(System.lineSeparator());\n\n\t\tlogger.info(builder.toString());\n\n\t}", "public void instantiateCommand() throws SystemException {\r\n\t\t// Check the definitation.\r\n\t\tdefinitionCheck();\r\n\t\t\r\n\t\t// Create the fresh instance.\r\n\t\tcommandInstance = new ReadWriteableAttributes();\r\n\t}", "public abstract UINodeWrapper generateUI(BaseConfigInstance pPCI) throws StructuredProductUIException;", "public PnuematicSubsystem() {\n\n }", "public ExternalServiceLayerCIMFactoryImpl() {\n\t\tsuper();\n\t}", "public HwDiagramFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "public Questionnaire createQuestionnaireConsole(String fileName) throws IOException\n {\n Questionnaire questionnaire = new QuestionnaireConsole();\n return readFile(questionnaire,fileName);\n }", "Container createContainer();", "private Console startConsole( String consoleHost ) throws RemoteException\n {\n Console console = null;\n Registry registry = null;\n int attempt = 0;\n final int numAttempts = 5;\n final int delay = 750; // 0.75 seconds.\n \n if( Launcher.startChameleonConsole( consoleHost ) )\n {\n for( ; attempt < numAttempts; ++attempt )\n {\n try\n {\n registry = LocateRegistry.getRegistry( consoleHost,\n RegistrationManager.PORT );\n console = (Console) registry.lookup( Console.SERVICE_NAME );\n }\n catch( Exception anyException )\n {\n }\n \n if( null == console )\n {\n try\n {\n Thread.sleep( delay );\n }\n catch( InterruptedException interruptedException )\n {\n }\n }\n }\n }\n \n return( console );\n }", "public CommandsFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "Communicator createCommunicator();", "private ConsoleUtils(String name) {\n instance = this;\n fConsole = new IOConsole(\"Mobius\" + name + \" Console\", EImages.TOOL.getDescriptor());\n fConsole.activate();\n ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{fConsole});\n final Display display = PlatformUI.getWorkbench().getDisplay();\n fRed = new Color(display, RED);\n fBlue = new Color(display, BLUE);\n fPurple = new Color(display, PURPLE);\n fBlack = new Color(display, BLACK);\n }", "public SQLCommunicator() {\n logger.info(\"Inside SQLConstructor\");\n try {\n //Connect to the database\n connectionUrl = \"jdbc:derby://localhost:1527/DribbleDerbyDB\";\n\n con = DriverManager.getConnection(connectionUrl, \"APP\", \"dribble\");\n logger.info(\"Connected to Glassfish database\");\n DatabaseMetaData md = con.getMetaData();\n //Check if the table exists in the database\n ResultSet rs = md.getTables(null, \"APP\", \"%\", null);\n //Add a table if the table does not exist\n if (rs.next() == false) {\n Statement stmt = con.createStatement();\n logger.info(\"No table in database. Creating main table...\");\n stmt.execute(\"CREATE TABLE DRIBBLE_SYSTEM_SUBJECTS\"\n + \"(NAME VARCHAR(20),\"\n + \"ID INTEGER NOT NULL,\"\n + \"LATITUDE BIGINT,\"\n + \"LONGITUDE BIGINT,\"\n + \"VIEWS INTEGER default 0,\"\n + \"POSTS INTEGER default 0,\"\n + \"POPULARITY BIGINT default 0,\"\n + \"CURRENTIME BIGINT\"\n + \")\");\n } else {\n logger.info(\"Table exists in database\");\n }\n\n\n } catch (SQLException e) {\n logger.severe(\"SQLexception: \" + e.toString());\n }\n\n logger.info(\"Constructed SQLCommunicator\");\n\n }", "public CLI()\r\n\t{\r\n\t\t//lvl = new Level();\r\n\t\tthis.inputCommand = \"\";\r\n\t\t//this.exitStr = exitStr;\r\n\t\tin = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\r\n\t}", "Commands createCommands();", "Compleja createCompleja();", "public SAP(Digraph G) {\n dg = G;\n }", "private void initializeConsole() {\n\t\tthis.hydraConsole = new HydraConsole(this.stage, this.commands);\n\t\tthis.splitPane.setBottomComponent(this.hydraConsole);\n\t}", "public Container createInterface(){\n\t\tChartTypeInterface.setLayout(new GridLayout(4,2,20,20));\n\t\t\n\t\tMakePie();\n\t\tMakeXYSpline();\n\t\tMakeStacked();\n\t\tMakeScatter();\n\t\tMakeLine();\n\t\tMakeBubble();\n\t\tMakeBar();\n\t\tMakeBar3D();\n\t\t\t\t\t\n\t\treturn ChartTypeInterface;\n\t}", "public ConsoleFrame(String host) {\n\t\t\tsuper(\"Clueless Client\");\n\t\t\tsetDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\t\tsetSize(640, 290);\n\t\t\tsetLocationRelativeTo(null);\n\n\t\t\tContainer consoleContentPane = getContentPane();\n\t\t\tcardLayout = new CardLayout();\n\t\t\tconsoleContentPane.setLayout(cardLayout);\n\t\t\t{\n\t\t\t\tJPanel panel = new JPanel(new BorderLayout());\n\t\t\t\tconsoleContentPane.add(panel, \"progress\");\n\t\t\t\tpanel.add(new JLabel(\"Connecting to \" + host + \"...\"));\n\t\t\t\t{\n\t\t\t\t\tpanel.add(consoleProgressBar = new JProgressBar(), BorderLayout.SOUTH);\n\t\t\t\t\tconsoleProgressBar.setIndeterminate(true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t{\n\t\t\t\tJPanel mainPanel = new JPanel(new BorderLayout());\n\t\t\t\tconsoleContentPane.add(mainPanel, \"clueless\");\n\t\t\t\t{\n\t\t\t\t\tJPanel firstPanel = new JPanel(new GridLayout(1, 2));\n\t\t\t\t\tmainPanel.add(firstPanel);\n\t\t\t\t\t{\n\t\t\t\t\t\tfirstPanel.add(new JScrollPane(consoleTexts = new JList()));\n\t\t\t\t\t\tconsoleTexts.setModel(new DefaultListModel());\n\t\t\t\t\t}\n\t\t\t\t\t{\n\t\t\t\t\t\tfirstPanel.add(new JScrollPane(consoleUserNames = new JList()));\n\t\t\t\t\t\tconsoleUserNames.setModel(new DefaultListModel());\n\t\t\t\t\t}\n\t\t\t\t\tDefaultListSelectionModel disableSelections = new DefaultListSelectionModel() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void setSelectionInterval(int index0, int index1) {\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tconsoleTexts.setSelectionModel(disableSelections);\n\t\t\t\t\tconsoleUserNames.setSelectionModel(disableSelections);\n\t\t\t\t}\n\t\t\t\t{\n\t\t\t\t\tJPanel bottomPanel = new JPanel(new GridBagLayout());\n\t\t\t\t\tmainPanel.add(bottomPanel, BorderLayout.SOUTH);\n\t\t\t\t\tbottomPanel.add(consoleText = new JTextField(), new GridBagConstraints(0, 0, 1, 1, 1, 0,\n\t\t\t\t\t GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));\n\t\t\t\t\tbottomPanel.add(sendButton = new JButton(\"Send\"), new GridBagConstraints(1, 0, 1, 1, 0, 0,\n\t\t\t\t\t GridBagConstraints.CENTER, 0, new Insets(0, 0, 0, 0), 0, 0));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconsoleText.addActionListener(new ActionListener() {\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tsendButton.doClick();\n\t\t\t\t}\n\t\t\t});\n\t\t}", "Concierto createConcierto();", "com.lxd.protobuf.msg.result.console.Console.Console_ getConsole();", "public SAP(Digraph G) {this.G = new Digraph(G);}", "public ConsoleView() {\n\t\tcrapsControl = new CrapsControl();\n\t\tinput = new Scanner(System.in);\n\t}", "AliciaLab createAliciaLab();", "public ConsoleController() {\n\t\tcommandDispatch = new CommandDispatch();\n\t}", "public XpeDccContractLineImpl() {\n }", "public CreateAccout() {\n initComponents();\n showCT();\n ProcessCtr(true);\n }", "public ServerCodeFactory() {\r\n\t\tthis(Charset.forName(\"UTF-8\"));\r\n\t\tLOG.debug(\"ServerCodeFactory()\");\r\n\t}", "public VisualStyle createVizMapper() {\r\n\r\n\t VisualMappingManager manager =\r\n\t Cytoscape.getVisualMappingManager();\r\n\t CalculatorCatalog catalog = manager.getCalculatorCatalog();\r\n\r\n\t VisualStyle existingStyle = catalog.getVisualStyle\r\n\t (BIOMOLECULE_VISUAL_STYLE);\r\n\t \r\n\t System.out.println(\r\n\t \t\t\"Got visual style for \" + BIOMOLECULE_VISUAL_STYLE + \" = \" + \r\n\t \t\texistingStyle);\r\n\r\n\t if (existingStyle != null) {\r\n// System.out.println(\"Got existing visual style: \" + existingStyle);\r\n return null;\r\n\t } else {\r\n\t VisualStyle bpVisualStyle = new VisualStyle(BIOMOLECULE_VISUAL_STYLE);\r\n\t // AJK: 03/29/06 define fields of visual style \r\n\t System.out.println(\"defining visual style: \" + bpVisualStyle);\r\n\t defineVisualStyle (bpVisualStyle, manager, catalog);\r\n\t manager.setVisualStyle(bpVisualStyle);\r\n\r\n\t // The visual style must be added to the Global Catalog\r\n\t // in order for it to be written out to vizmap.props upon user exit\r\n\t System.out.println(\"Adding visual style \" + bpVisualStyle \r\n\t \t\t+ \" to catalog \" + catalog);\r\n\t catalog.addVisualStyle(bpVisualStyle);\r\n\t \r\n\t // for debugging\r\n//\t \t\tVisualStyle vizStyle = catalog.getVisualStyle(BIOMOLECULE_VISUAL_STYLE);\r\n//\t \t\tSystem.out.println (\"Got visual Style from catalog: \" + catalog \r\n//\t \t\t\t\t+ \" = \" + vizStyle);\r\n\t \t\t\r\n\t // try setting the visual style to BioMolecule\r\n\t Cytoscape.getDesktop().setVisualStyle(bpVisualStyle);\r\n\t return bpVisualStyle;\r\n\t }\r\n\t }", "public ConsoleWriter(TextConsole console, int fgColor) {\n this.console = console;\n this.fgColor = fgColor;\n }", "System createSystem();", "public interface Console {\n\t//For know without description\n\t\n\t/**\n\t * Prints all information in XML src\n\t * @param src - document \n\t */\n\tpublic void startInfo(Document src);\n\t\n\t/**\n\t * Reading and printing inform. from console\n\t * @param str - string from console with request\n\t */\n\tpublic void readAndPrint(String str);\n\t\n\t/**\n\t * Starts listening InputStream in\n\t * @param in - in this program it's System.in\n\t */\n\n\tpublic void start(InputStream in, String path);\n\t\n\t/**\n\t * Printing all information about Node n\n\t * @param n\n\t */\n\tpublic void printNode(Node n);\n}", "public static Construtor construtor() {\n return new Construtor();\n }", "public ConsolePanel() throws Exception, SAXException, IOException\r\n\t{\r\n\t\tgame=null;\r\n\t\tgame_started=false;\r\n\t\tgs=new MainMenuDialog();\r\n\t\tMyKeyHandler kh = new MyKeyHandler();\r\n\t\taddKeyListener(kh);\r\n\t\tsetFocusable(true);\r\n\t}", "protected Connection createConnectionFigure() {\n\t\treturn new ResponseFigure();\n\t}", "public ProtocolHexDump() {\n super();\n //noinspection HardCodedStringLiteral\n FxmlConnection.connect(getClass().getResource(\"/fxml/protocolHexDump.fxml\"), this);\n textFlow.getChildren().add(createHeader());\n textFlow.getChildren().add(createPlaceholder());\n }", "static ConsoleCharStream getInstance() {\n if (_i == null)\n _i = new ConsoleCharStream();\n return _i;\n }", "public SecureConnectionDescription() {\n //log.debug(\"Generating bidirectional secure connection description.\");\n }", "public iCimpilir(java.io.InputStream stream, String encoding) {\n if (jj_initialized_once) {\n System.out.println(\"ERROR: Second call to constructor of static parser. \");\n System.out.println(\" You must either use ReInit() or set the JavaCC option STATIC to false\");\n System.out.println(\" during parser generation.\");\n throw new Error();\n }\n jj_initialized_once = true;\n try {\n jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1);\n } catch (java.io.UnsupportedEncodingException e) {\n throw new RuntimeException(e);\n }\n token_source = new iCimpilirTokenManager(jj_input_stream);\n token = new Token();\n jj_ntk = -1;\n jj_gen = 0;\n for (int i = 0; i < 18; i++) {\n jj_la1[i] = -1;\n }\n }", "public CreateGUI() throws IOException{\r\n\t\tthis.setFocusable(false);\r\n\t\tthis.setTitle(\"Dance Dance Revolution - 201B Edition\");\r\n\t\tthis.setSize(800, 600);\t\t \t\r\n\t\tthis.setLocation(100, 100); \t\r\n\t\tthis.setVisible(true);\r\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tthis.setResizable(false);\r\n\t\tcp = getContentPane();\r\n\t\tcp.setBackground(Color.black);\r\n\t\tarrowlistener = new ArrowListener();\r\n\t\tscore = new Score();\r\n\t\tcombo = new ComboImage();\r\n\t}", "public FiltroRaEncerramentoComando() {\r\n }", "public PSystemDitaaFactory(DiagramType diagramType) {\n\t\tsuper(diagramType);\n\t}", "public OscUI(final JFrame myParent) {\n\t\tsuper();\n\t\tparent = myParent;\n\t\tmakeDisplay();\n\t\ttry {\n\t\t\toscPort = new OSCPortOut();\n\t\t} catch (final Exception ex) {\n\t\t\t// this is just a demo program, so this is acceptable behavior\n\t\t\tLOG.error(\"Failed to create test OSC UDP out port\", ex);\n\t\t}\n\t}", "public void forfaitCli() throws IOException, InterruptedException {\n printOut(cliToolsManager.sceneInitializer(80));\n\n for(int i=0;i<15;i++)\n printOut(\"\");\n\n printOut(cliToolsManager.centerThatString(\"TUTTI GLI ALTRI GIOCATORI SI SONO DISCONNESSI\", 80));\n printOut(cliToolsManager.centerThatString(\"HAI VINTO\", 80));\n\n printOut(\"\");\n printOut(\"\");\n\n printOut(cliToolsManager.simpleQuestionsMaker(\"Premi qualsiasi tasto per uscire\", 80, true));\n readIt();\n }", "AdminConsole createAdminConsole();", "public CSSTidier() {\n\t}", "public Ui() {\n this.sc = sc;\n }", "public SSDI_AMImpl() {\n }", "@Override\n\tpublic void createConseille(Conseille c) {\n\t\t\n\t}", "public SAP(Digraph G) {\n this.G = new Digraph(G);\n }", "public BuilderWorkspace(String config_file, boolean create,GlycanRenderer glycanRenderer) {\n\t\tsuper(false);\n\t\tcommonInit(config_file,create,glycanRenderer);\n\t}", "public Console(Client client, Controller controller){\r\n\t\tsuper(client,controller);\r\n\t\tsc = new Scanner(System.in);\r\n\t\tnew Thread(new ReadInput()).start();\r\n\t}", "private void init() throws IOException {\r\n\t\tschermata = new JTabbedPane();\r\n\t\tInetAddress addr = InetAddress.getByName(ip); // ip\r\n\t\tSocket socket = new Socket(addr, port); // Port\r\n\t\tout = new ObjectOutputStream(socket.getOutputStream());\r\n\t\tin = new ObjectInputStream(socket.getInputStream());\r\n\t\t// stream con richieste del client\r\n\t\tiniziale.addWindowListener(new WindowAdapter() {\r\n\t\t\tpublic void windowClosing(WindowEvent ev) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsocket.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t}\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t});\r\n\t\tiniziale.add(schermata);\r\n\r\n\t}", "public AsciiDataEncoder() {\n\t}", "protected Connection createConnectionFigure() {\r\n\t\treturn new ImplicitCallFigure();\r\n\t}", "Schulleiter createSchulleiter();", "public Sistema(){\r\n\t\t\r\n\t}", "public void setConsole(Console c) {\n con = c;\n console = true;\n }", "public Console(/*@ non_null */ CommandHandler ch)\n\t{\n\t\tsuper(\"Console\");\n\t\tthis._handler = ch;\n\t}", "private AlgorithmRegistryCLI() {\n super();\n }", "public interface SnacCmdFactory {\n /**\n * Returns a list of the SNAC command types this factory can possibly\n * convert to <code>SnacCommand</code>s. Note that it is not required to\n * be able to convert every SNAC packet that matches the types returned by\n * this method; rather, this just provides a means of filtering out types\n * that can definitely not be handled (by not including them in the returned\n * list).\n * <br>\n * <br>\n * Also note that <b>the command types contained in the list returned must\n * be consistent between calls to this method</b>; that is, an\n * implementation cannot change the supported command type list after this\n * factory has been created.\n *\n * @return a list of command types that can be passed to\n * <code>genSnacCommand</code>\n */\n List<CmdType> getSupportedTypes();\n\n /**\n * Attempts to convert the given SNAC packet to a <code>SnacCommand</code>.\n * This can return <code>null</code> if no appropriate\n * <code>SnacCommand</code> can be created (for example, if the packet is in\n * an invalid format).\n *\n * @param packet the packet to use for generation of a\n * <code>SnacCommand</code>\n * @return an appropriate <code>SnacCommand</code> for representing the\n * given <code>SnacPacket</code>, or <code>null</code> if no such\n * object can be created\n */\n SnacCommand genSnacCommand(SnacPacket packet);\n}", "protected Container createContainer() {\n\treturn new EditorContainer();\n }", "public ToolBarIO(ToolBarContainer container) {\n\t\tthis.container = container;\n\t}", "public de.uni_koblenz.jgralabtest.schemas.gretl.pddsl.Chassis createChassis();", "private EscidocConfiguration() throws SystemException {\r\n System.setProperty(\"java.awt.headless\", \"true\");\r\n this.properties = loadProperties();\r\n }", "public JPanel_Terminal() {\n // initialize components\n initComponents();\n\n // initialize JTerm\n JTermInputProcessor termProcessor = (String command, JTerm console) -> {\n if (jShellTransport == null) {\n updateShellTransport();\n }\n if (jShellTransport != null) {\n try {\n console.remove(command.length());\n jShellTransport.write(command);\n } catch (IOException ex) {\n jShellTransport = null;\n Log.log(Level.SEVERE, \"ShellTransportWrite\", ex);\n }\n }\n };\n\n jTerm = new JTerm(jTextPane_Jterm, termProcessor, Color.BLACK, Color.GREEN, new Font(Font.MONOSPACED, Font.BOLD, 12));\n }", "public VectorGraphics2D createGraphics() {\n\t\treturn new VectorGraphics2D(new Graphics2DContext(), operations);\n\t}", "public BootstrapInstrumentor(PrintWriter w) {\n this.w = w;\n }", "Schueler createSchueler();", "public Menu(Calendar calendar) {\n this.calendar = calendar;\n input = new Scanner(System.in);\n }", "public JPanel buildConsole()\n\t{\n\t\tJPanel output = new JPanel(new BorderLayout());\n\t\tString hold = \"\";\n\t\t\n output.setBorder (new TitledBorder(new EtchedBorder(),\"Console\")); //Create the border\n output.setPreferredSize(new Dimension(50,150)); //Set the size of the JPanel\n console.insert(hold,0);\n console.setLineWrap(true);\n console.setWrapStyleWord(true);\n console.setEditable(false); //Does not allow the user to edit the output\n JScrollPane Cscroll = new JScrollPane (console); //Create a JScrollPane object\n Cscroll.setVerticalScrollBarPolicy ( ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED ); //Set the scroll bars to appear when necessary\n output.add(Cscroll); //Add the scroll to the JPanel\n textField = new JTextField();\n output.add(BorderLayout.PAGE_END, textField);\n \n\t\treturn output;\n\t}", "private void crearFlujos() throws IOException {\n salidaDecorada = new PrintStream(socket.getOutputStream());\n entradaDecorada = new Scanner(socket.getInputStream());\n }", "public Skeleton() throws IOException {\n\t\tconsoleIn = new BufferedReader(new InputStreamReader(System.in));\n\t}", "public CPRCommand()\r\n {\r\n }", "public CreateConsole pretty(String pretty) {\n put(\"pretty\", pretty);\n return this;\n }", "public void initComponents() {\n\t\tscreen = new JTextArea();\r\n screen.setBackground(Color.black);\r\n screen.setForeground(Color.green);\r\n screen.setCaretColor(Color.green);\r\n ConsoleCaret caret = new ConsoleCaret(); //set up custom caret, for looks\r\n caret.setUpdatePolicy(ConsoleCaret.ALWAYS_UPDATE);\r\n screen.setCaret(caret);\r\n screen.setEditable(false);\r\n screen.addKeyListener(this);\r\n screen.setLineWrap(true);\r\n screen.setFocusable(false);\r\n screen.getCaret().setVisible(true);\r\n initFont();\r\n \r\n commandlib = new CommandLib(this); //init command lib\r\n out = new ConsoleWriter(new ConsoleStream(screen), commandlib, prefix);\r\n commandlib.setOutput(out);\r\n scrollPane = new JScrollPane(screen);\r\n scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);\r\n scrollPane.setForeground(Color.green);\r\n scrollPane.setBackground(Color.black);\r\n scrollPane.requestFocus();\r\n scrollPane.addKeyListener(this);\r\n \r\n }", "private SequencerConnection() { }", "Subprocess createSubprocess();", "public ConnectionScreenController() {\n\n }", "public BaseCatalog()\n {\n System.out.println(\"BaseCatalog: BaseCatalog() ... a new service created\");\n _environment = new Environment();\n _layout = new PageLayout();\n _layoutProj = new LayoutProject();\n _layoutProj.setRegisteredEnvironment(_environment);\n _layoutProj.setRegisteredLayout(_layout);\n }", "Compuesta createCompuesta();", "Console(/*@ non_null */ Properties p, /*@ non_null */ CommandHandler ch)\n\t{\n\t\tsuper(\"Console\");\n\n\t\tthis._handler = ch;\n\t}", "public Service(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String name, final @org.jetbrains.annotations.Nullable imports.k8s.ServiceOptions options) {\n super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);\n software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, \"scope is required\"), java.util.Objects.requireNonNull(name, \"name is required\"), options });\n }", "public static void CreateClient(int port, String ip, String inname, String incolor){\n Client charlie = new Client(port, ip);\n charlie.clientName = inname;\n charlie.outhexColor = incolor; \n //charlie.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n charlie.startRunning(port);\n }", "public CommandFactory(Visualizer vis) {\n\t\tmyVis = vis;\n\n\t\tupdateLanguage(DEFAULT);\n\t}" ]
[ "0.65773356", "0.4865485", "0.48586047", "0.48253563", "0.48177856", "0.4696689", "0.46639678", "0.46634153", "0.4662799", "0.45670366", "0.45659333", "0.45455727", "0.45025524", "0.44943237", "0.4482242", "0.4469986", "0.44328186", "0.44288605", "0.44092575", "0.44089192", "0.43873715", "0.43865767", "0.43848625", "0.4384369", "0.43783966", "0.43760034", "0.43739933", "0.43617177", "0.43603995", "0.43507832", "0.43396842", "0.43389425", "0.4332264", "0.43296322", "0.4320509", "0.43192315", "0.4307536", "0.4307278", "0.4304771", "0.429808", "0.4297671", "0.4286229", "0.42765743", "0.4269604", "0.42618546", "0.4253694", "0.42461002", "0.42460564", "0.4242931", "0.42401153", "0.42297", "0.42296195", "0.42261562", "0.42245767", "0.42196476", "0.4214842", "0.42108884", "0.42099968", "0.42086628", "0.41961712", "0.4186151", "0.41847947", "0.41831037", "0.41821447", "0.4176572", "0.41749072", "0.417005", "0.4169647", "0.41682243", "0.41628644", "0.41599762", "0.41566846", "0.4156361", "0.41508466", "0.41482404", "0.4148052", "0.4146498", "0.4141552", "0.4141408", "0.41396138", "0.41308427", "0.4129444", "0.41283575", "0.41276258", "0.4126283", "0.4125822", "0.4124494", "0.41224822", "0.41170546", "0.4111257", "0.41108546", "0.4103009", "0.41009462", "0.4096221", "0.40955243", "0.40947598", "0.40929493", "0.4088729", "0.40886748", "0.40839648" ]
0.8157727
0
Returns whether the specified chat event is a personal tell to the user.
@Override protected boolean isPersonalTell(ChatEvent evt){ String type = evt.getType(); return "tell".equals(type) || "say".equals(type) || "ptell".equals(type); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean handlePersonalTell(String line){\n if (line.indexOf(\"tells you: \") == -1)\n return false;\n \n Matcher matcher = PERSONAL_TELL_REGEX.matcher(line);\n if (!matcher.matches())\n return false;\n\n String username = matcher.group(1);\n String titles = matcher.group(2);\n String message = matcher.group(3);\n\n if (!processPersonalTell(username, titles, message))\n processLine(line);\n\n return true;\n }", "private boolean isMentioned(MessageReceivedEvent event) {\n Message message = event.getMessage();\n\n if (message.getContentRaw().equals(\"<@!\" + ID.SELF + \">\")) {\n message.reply(\"Hi, my prefix is `\" + Setting.PREFIX + \"`. You can also use `/help` for more info.\").queue();\n return true;\n }\n\n return false;\n }", "@Override\n\tpublic boolean isOwnMessage() {\n\t\ttry {\n\t\t\treturn (this.user.id == AccountManager.current_account.getUser().id);\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\t}", "protected boolean processPersonalTell(String username, String titles, String message){return false;}", "boolean hasUserMessage();", "boolean hasMentionedIn();", "boolean hasIsRedeemed();", "public static Boolean getNeedsAttention(String needsAttnStr) {\n if (needsAttnStr.equals(NEEDS_ATTN_YES)) {\n return true;\n }\n return false;\n }", "public boolean isDangerousToPeople() {\n\t\treturn this.eats.equals(\"people\");\n\t}", "public boolean talkedToEh() {\n\t\treturn talkedTo;\n\t}", "boolean hasUserEmail();", "boolean hasMent();", "boolean hasSenderName();", "boolean hasSenderName();", "protected void processPersonalTell(String teller, String titles, String message, int tellType) {\n if (tellType != ChessclubConstants.REGULAR_TELL) {\n return;\n }\n String myName = userName;\n if (myName.equals(teller)) {\n return;\n }\n boolean jeeves = \"Jeeves\".equals(teller);\n if (jeeves) {\n tellManagers(\"{0} just executed command: {1}\", teller, message);\n teller = \"Ralph\";\n } else {\n \tonCommand(teller, message);\n }\n }", "public boolean hasRelatedIMEventMsg() {\n return fieldSetFlags()[8];\n }", "public boolean hasSpeechEventOffset() {\n return ((bitField0_ & 0x00000004) != 0);\n }", "private boolean handleSayTell(String line){\n if (line.indexOf(\"says: \") == -1)\n return false;\n \n Matcher matcher = SAY_REGEX.matcher(line);\n if (!matcher.matches())\n return false;\n\n String username = matcher.group(1);\n String titles = matcher.group(2);\n String gameNumberString = matcher.group(4);\n String message = matcher.group(5);\n\n int gameNumber = gameNumberString == null ? -1 : Integer.parseInt(gameNumberString);\n\n if (!processSayTell(username, titles, gameNumber, message))\n processLine(line);\n\n return true;\n }", "private boolean isFriend() {\r\n\r\n return isContactableUser() && !StringUtils.isBlank(friendFeed.getContact().getContactId());\r\n }", "boolean hasDidcommInvitation();", "private boolean verifyMessagePresence(){\n boolean overallResult = true;\n \n for(int ii = 0; ii < 3; ii = ii +1){\n if(121 == getHidden(ii)){\n overallResult = true;\n }else{\n overallResult = false;\n }\n }\n \n return overallResult;\n }", "boolean hasUserInterest();", "boolean hasUserInterest();", "public boolean getIsMeeting() throws ServiceLocalException {\n\t\treturn this.getPropertyBag().getObjectFromPropertyDefinition(\n\t\t\t\tAppointmentSchema.IsMeeting) != null;\n\t}", "public boolean hasFollowUp() \n {\n return followUp.equals(Constants.CLOSE);\n }", "public boolean isOngoing(final java.lang.String userEmail) {\n\n return data.get(\"state\").getAsInt() != GameStateID.ENDED\n && (isState(userEmail, PlayerStateID.ACCEPTED)\n || isState(userEmail, PlayerStateID.PLAYING));\n\n }", "public boolean isGivingInformation();", "boolean hasSender();", "boolean hasSender();", "boolean hasSender();", "boolean hasSender();", "boolean hasSender();", "boolean hasSender();", "@java.lang.Override\n public boolean hasSpeechEventOffset() {\n return speechEventOffset_ != null;\n }", "public String getNeedsAttentionDisplay() {\n if (needsAttention.booleanValue()) {\n return NEEDS_ATTN_YES;\n }\n return NEEDS_ATTN_NO;\n }", "boolean isSetWhoOwnsWhom();", "public boolean canSendFeedback(String userID, String eventCode) {\r\n // Get the event from the database\r\n Event e = DatabaseManager.getDatabaseManager().getEventFromCode(eventCode);\r\n\r\n // Return false if the event could not be found\r\n if (e == null)\r\n return false;\r\n\r\n // Get the current time and a placeholder for the time of the latest feedback\r\n long now = Calendar.getInstance().getTimeInMillis();\r\n long latest = 0;\r\n\r\n // Iterate through the feedback for all sent by the given user\r\n for (Feedback feedback : e.getFeedback()) {\r\n if (feedback.getUserID().equals(userID)) {\r\n // Update the latest time if needed\r\n if (latest < feedback.getTimeStamp())\r\n latest = feedback.getTimeStamp();\r\n }\r\n }\r\n // Return true if the latest is over a minute ago\r\n return now - 1000 * 60 > latest;\r\n }", "private boolean handlePTell(String line){\n if (line.indexOf(\"(your partner) tells you: \") == -1)\n return false;\n \n Matcher matcher = PTELL_REGEX.matcher(line);\n if (!matcher.matches())\n return false;\n\n String username = matcher.group(1);\n String titles = matcher.group(2);\n String message = matcher.group(3);\n\n if (!processPTell(username, titles, message))\n processLine(line);\n\n return true;\n }", "public boolean isLiked();", "public boolean isUserMessage() {\n return (msgType == MessageType.USER_MESSAGE);\n }", "boolean hasConversation();", "boolean hasChatType();", "public boolean isPerPerson() {\n return perPerson;\n }", "protected boolean processSayTell(String username, String titles, int gameNumber, String message){return false;}", "public boolean getMeetingRequestWasSent() throws ServiceLocalException {\n\t\treturn this.getPropertyBag().getObjectFromPropertyDefinition(\n\t\t\t\tAppointmentSchema.MeetingRequestWasSent) != null;\n\t}", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "public boolean isWinnerMe() {\n if (gameStatus == null || userId == null) return false;\n return userId.equals(gameStatus.getWinner())\n || (getMyPlayerNumber() == 1 && getPlayerTwoPoints() == 0)\n || (getMyPlayerNumber() == 2 && getPlayerOnePoints() == 0)\n || getMyPlayerNumber() == 1 && getPlayerOnePoints() > getPlayerTwoPoints()\n || getMyPlayerNumber() == 2 && getPlayerOnePoints() < getPlayerTwoPoints();\n }", "boolean hasFriendId();", "boolean isOneToOneChatMessage(String messageId);", "boolean hasEmail();", "boolean hasEmail();", "boolean hasEmail();", "boolean hasEmail();", "boolean hasEmail();", "boolean hasMessageInfoID();", "public boolean isCorrectEvent()\n {\n return m_fCorrectEvent;\n }", "private boolean hasUserImportantView() {\n int userID = this.sharedPreferences.getInt(Constants.SP_USER_ID_KEY, 0);\n return this.sharedPreferences.getBoolean(serverName + \"_\" + userID, false);\n }", "public boolean isPerson (String lemma){\n \n if (lemma.equals(\"man\")){\n return true;\n }\n\n if (this.gNet != null){\n\n List < Synset > synsets ;\n synsets = this.gNet.getSynsets(lemma);\n /*\n * check if synsnet is empty, if not empty, just continue with the block below\n * else, run some morphological analysis, and retry synset.\n * \n * This only covers the person filter. Also need to cover what is and is not a subject expression\n */\n for (Synset synset: synsets){\n List<List<Synset>> hypernyms = synset.getTransRelatedSynsets(ConRel.has_hypernym);\n for (List<Synset> hypernym: hypernyms){\n for (Synset s: hypernym){\n // ID for human / person, not living being in general and ID for group\n if (s.getId() == 34063 || s.getId() == 22562){\n return true;\n }\n }\n\n }\n }\n return false;\n }\n return false;\n }", "public boolean checkForUser(Player p) {\n\t\tif(p.getName(p).equals(\"user\")) {\n\t\t\treturn true;\t\t\t\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean isAlone() {\n\t\tif (getMateFollow() != null)\n\t\t\tif (!getMateFollow().isKO())// Checks if the support is dead\n\t\t\t\treturn false;\n\t\t\telse\n\t\t\t\treturn true;\n\t\telse\n\t\t\treturn true;\n\t}", "private static boolean isMentionedIn(Attribute attr, Test t) {\n\n if (t == null) { \n return false;\n }\n if (t.m_attr == attr.index()) {\n return true;\n }\n return isMentionedIn(attr, t.m_next);\n }", "@Override\n public boolean isCorrespondingTo(String eventName) {\n return eventName.equals(name) || eventName.equals(name_lt) || eventName.equals(name_gt) ;\n }", "boolean hasChatData();", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"True if this Participant has talk privileges in the Conference. False otherwise.\")\n\n public Boolean getTalk() {\n return talk;\n }", "private boolean isSimpleQuestion(String userMessage) {\n List<String> yesNoQuestion = additionalDB.get(\"yesNoQuestion\");\n String firstWord = firstWord(userMessage).toLowerCase();\n for (String str : yesNoQuestion)\n if (firstWord.equals(str))\n return true;\n return false;\n }", "Boolean getIsAnswered();", "private boolean isUserVisibleEvent(int eventType) {\n return eventType != UsageEvents.Event.SYSTEM_INTERACTION\n && eventType != UsageEvents.Event.STANDBY_BUCKET_CHANGED;\n }", "public boolean isRetweet() {\n\t\treturn text.trim().startsWith(\"RT @\");\n\t}", "boolean hasMsg();", "public synchronized boolean isUser(String email) {\r\n return (email != null) && email2user.containsKey(email);\r\n }", "boolean hasSendMessage();", "@Override\n public boolean isCorrespondingTo(Event event){\n String n = event.getName();\n return n.equals(name) || n.equals(name_lt) || n.equals(name_gt);\n }", "public boolean hasPerson() {\n return dataBodyCase_ == 2;\n }", "public boolean reminderExists(Event event) \r\n\t{\r\n\t for (Reminder reminder : this.getAllReminders())\r\n\t {\r\n\t if (reminder.getEvent().equals(event))\r\n\t return true;\r\n\t }\r\n\t \r\n\t return false; \r\n\t}", "@objid (\"0480e45a-6886-42c0-b13c-78b8ab8f713d\")\n boolean isIsEvent();", "private boolean hasPermission(String username, SOAPMessage msg) {\r\n\t\ttry {\r\n\t\t\tNodeList email = msg.getSOAPBody().getElementsByTagName(SOAP_EMAIL_TAG);\r\n\r\n\t\t\t// if request has email\r\n\t\t\tif(email.getLength() > 0) {\r\n\t\t\t\treturn username.equals(msg.getSOAPBody().getElementsByTagName(SOAP_EMAIL_TAG).item(0).getTextContent());\r\n\t\t\t}\r\n\t\t\t// if there's no email field, every user has permissions to access\r\n\t\t\treturn true;\r\n\t\t\t\r\n\t\t} catch (SOAPException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean shouldLetFactionsHandleThisChat(PlayerChatEvent event)\n \t{\n \t\tif (event == null) return false;\n \t\treturn (isPlayerFactionChatting(event.getPlayer()) || isFactionsCommand(event.getMessage()));\n \t}", "protected final boolean anyMsg() {\n\t\tDoorPulseCriterion dpc = new DoorPulseCriterion(this.getPulse() - 1);\n\t\treturn this.existMessage(dpc);\n\t}", "public boolean hasPerson() {\n return dataBodyCase_ == 2;\n }", "boolean hasMsgid();", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Controls whether to decide if notify postmortem on twitter.\")\n\n public Boolean getPostmortemNotifiedTwitter() {\n return postmortemNotifiedTwitter;\n }", "public String getPersonalMessage()\n \t{\n \t\treturn personalMessage;\n \t}", "boolean isDisplayMessageOnRedeem();", "public boolean isUserIdTaken(String userEmailId);", "boolean hasEvent();", "public boolean isSetUserInfo() {\n return this.userInfo != null;\n }", "public boolean isPrivateMessagingContact(Jid contactAddress)\n {\n return ssContactList.isPrivateMessagingContact(contactAddress);\n }", "@Override\n\tprotected boolean needUser(String eventName)\n\t{\n\t\treturn false;\n\t}", "public boolean hasFriend(String friend){\n return friends.contains(friend);\n }", "boolean hasMessageID();", "boolean hasMsgID();", "boolean hasMsgID();", "boolean hasPingerLoc();" ]
[ "0.7025213", "0.6255196", "0.6223183", "0.6082665", "0.6041181", "0.5824652", "0.56077296", "0.5388852", "0.5302565", "0.52666193", "0.52586216", "0.5255707", "0.5247672", "0.5247672", "0.5244977", "0.52075577", "0.51943034", "0.5190677", "0.51905715", "0.5180759", "0.5170388", "0.51587987", "0.51587987", "0.5139422", "0.51342094", "0.51331425", "0.51328224", "0.51324236", "0.51324236", "0.51324236", "0.51324236", "0.51324236", "0.51324236", "0.5083871", "0.5068308", "0.50596035", "0.5051561", "0.5046544", "0.50151885", "0.5008424", "0.4998415", "0.49933553", "0.49892557", "0.49814823", "0.49735796", "0.49620935", "0.49620935", "0.49620935", "0.49620935", "0.49620935", "0.49620935", "0.49620935", "0.49620935", "0.49523336", "0.49496126", "0.4942866", "0.4942665", "0.4942665", "0.4942665", "0.4942665", "0.4942665", "0.49307263", "0.49302024", "0.49246025", "0.4905856", "0.48939264", "0.48908368", "0.48855865", "0.4885419", "0.48781934", "0.48769692", "0.4866687", "0.48634157", "0.48617715", "0.48615766", "0.4860881", "0.48607633", "0.48606667", "0.48569778", "0.4850709", "0.48505637", "0.48450187", "0.48375696", "0.4829823", "0.48287225", "0.482612", "0.48243797", "0.4823479", "0.48205948", "0.48175135", "0.48151726", "0.48110113", "0.4802559", "0.4802193", "0.47860774", "0.47786278", "0.4776288", "0.47741506", "0.47741506", "0.47678643" ]
0.7992493
0
Created by lz on 2017/5/15.
public interface CardLostDAO { int saveByVO(CardLostRecordModel vo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n public void func_104112_b() {\n \n }", "private void poetries() {\n\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "private void init() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "public final void mo51373a() {\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}", "private void kk12() {\n\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n public void init() {\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 void init() {\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private void m50366E() {\n }", "@Override\n public int describeContents() { return 0; }", "private void strin() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public void gored() {\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\n\tpublic void jugar() {\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 }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@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}", "@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 public void init() {}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "protected boolean func_70814_o() { return true; }", "@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 protected void init() {\n }", "@Override\r\n\tpublic void init() {}", "@Override\n protected void getExras() {\n }", "@Override\n protected void initialize() \n {\n \n }", "@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 gravarBd() {\n\t\t\n\t}", "private void init() {\n\n\n\n }", "public void mo4359a() {\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n\tpublic void init() {\n\t}", "public void mo6081a() {\n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n public void initialize() { \n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "private MetallicityUtils() {\n\t\t\n\t}", "@Override\n\tpublic void init()\n\t{\n\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 }", "private void init() {\n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "public void mo21877s() {\n }", "static void feladat4() {\n\t}", "public abstract void mo70713b();", "private void initialize() {\n\t\t\n\t}", "private final zzgy zzgb() {\n }", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}" ]
[ "0.5858299", "0.578621", "0.56555575", "0.5599921", "0.55861473", "0.5577075", "0.5577075", "0.55676985", "0.5542469", "0.5527706", "0.55077195", "0.54925525", "0.5466108", "0.5457711", "0.5451967", "0.5444285", "0.5428479", "0.5428479", "0.5428479", "0.5428479", "0.5428479", "0.54215306", "0.54175", "0.54086924", "0.54046875", "0.5391642", "0.53877395", "0.5383083", "0.5379192", "0.5374762", "0.5373701", "0.53566796", "0.53565586", "0.5354333", "0.53400916", "0.53388536", "0.53267777", "0.5324663", "0.53217804", "0.53202456", "0.53202456", "0.53202456", "0.53202456", "0.53202456", "0.53202456", "0.5309434", "0.5309434", "0.53082323", "0.53082323", "0.5305588", "0.5305588", "0.5305588", "0.5300407", "0.5300407", "0.5300407", "0.52918816", "0.5287025", "0.5281404", "0.52751416", "0.52751416", "0.52751416", "0.52741736", "0.5273619", "0.5272546", "0.52697015", "0.5266731", "0.5266731", "0.52507293", "0.5246695", "0.5246535", "0.523972", "0.5224646", "0.5218653", "0.52172345", "0.52033776", "0.52032197", "0.5200375", "0.519945", "0.5196591", "0.51950413", "0.5193957", "0.5188829", "0.51871246", "0.51871246", "0.51871246", "0.51871246", "0.51871246", "0.51871246", "0.51871246", "0.5154526", "0.5151737", "0.5140265", "0.512539", "0.5125251", "0.5124017", "0.5123698", "0.5121702", "0.51194215", "0.51108897", "0.5108288", "0.5100328" ]
0.0
-1
Ignore swagger and configuration paths for discovery
@Override public void configure(WebSecurity web) throws Exception { web.ignoring().antMatchers("/v2/api-docs", "/configuration/ui", "/swagger-resources", "/configuration/security", "/swagger-ui.html", "/webjars/**", "/v2/swagger.json"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Bean\n public Docket api(){\n //Enables following endpoints once configured\n //http://localhost:8080/swagger-ui.html\n //http://localhost:8080/v2/api-docs\n return new Docket(DocumentationType.SWAGGER_2)\n //.apiInfo(ApiInfo.DEFAULT)\n .apiInfo(DEFAULT_API_INFO)\n .produces(DEFAULT_PRODUCES_AND_CONSUMES)\n .consumes(DEFAULT_PRODUCES_AND_CONSUMES);\n }", "@Bean\n public SwaggerSpringMvcPlugin swaggerSpringMvcPlugin() {\n return new SwaggerSpringMvcPlugin(springSwaggerConfig)\n .includePatterns(\n \"/business.*\",\n \"/api-docs.*\"\n\n )\n .pathProvider(new CustomRelativeSwaggerPathProvider() )\n .apiInfo(apiInfo())\n .build();\n }", "@Bean\r\n public Docket api() {\n\r\n return new Docket(DocumentationType.SWAGGER_2)\r\n .select()\r\n .apis(RequestHandlerSelectors.basePackage(\"com.varun.swaggerapp\"))\r\n .paths(PathSelectors.any())\r\n .build()\r\n .apiInfo(getMyAppInfo());\r\n }", "@Bean\n public Docket swaggerApi() {\n\n return new Docket(DocumentationType.SWAGGER_2).apiInfo(swaggerInfo()).select()\n .apis(RequestHandlerSelectors.basePackage(\"rooftophero.io.toyp2p.api\"))\n .paths(PathSelectors.any())\n// .paths(PathSelectors.ant(\"/api/*\"))\n .build()\n .useDefaultResponseMessages(false); // 기본으로 세팅되는 200,401,403,404 메시지를 표시 하지 않음\n }", "@PostConstruct\n\tpublic void config() {\n\t\tthis.configureSwaggerV1();\n\t}", "@Bean\n public Docket api() {\n return new Docket(DocumentationType.SWAGGER_2)\n .groupName(groupName)\n .select()\n .apis(RequestHandlerSelectors.basePackage(basePackage))\n .paths(PathSelectors.any())\n .build()\n .enable(enable)\n .apiInfo(apiInfo());\n }", "@Bean\n\tpublic Docket api() {\n\t// @formatter:off\n return new Docket(DocumentationType.SWAGGER_2)\n // 為了顯示 CompletableFuture 內的 DTO 描述\n .genericModelSubstitutes(ResponseEntity.class, CompletableFuture.class)\n .apiInfo(this.apiInfo())\n .select()\n .apis(RequestHandlerSelectors.any())\n // 濾掉預設的與監控路徑\n .paths(\n path -> {\n return !(path.matches(\"/error\")\n || path.matches(\"/actuator+(.*)\")\n || path.matches(\"/profile\"));\n })\n .build();\n // @formatter:on\n\t}", "@Bean\n\tpublic Docket api() {\n\t\treturn new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any())\n\t\t\t\t.paths(PathSelectors.any()).build();\n\t}", "@Ignore\n @Test\n public void discoverNoTypes() throws Exception {\n }", "@Override\n protected Path getConfigurationPath() {\n return null;\n }", "@Bean\n\tpublic SwaggerSpringMvcPlugin customImplementation() {\n\t\tboolean enable = ResourceUtils.getBundleValue4Boolean(\"swagger.enable\");\n\t\treturn new SwaggerSpringMvcPlugin(this.springSwaggerConfig).apiInfo(apiInfo()).enable(enable)\n\t\t\t\t.includePatterns(\".*?\");\n\t}", "@Test\r\n\tpublic void testDocket() {\r\n\t\tDocket mm = swaggerConfig.api();\r\n\t\tassertNotNull(mm);\r\n\t}", "@Override\n public void configure(WebSecurity web) throws Exception {\n web.ignoring().antMatchers(\"/v2/api-docs\")//\n .antMatchers(\"/swagger-resources/**\")//\n .antMatchers(\"/swagger-ui.html\")//\n .antMatchers(\"/configuration/**\")//\n .antMatchers(\"/webjars/**\")//\n .antMatchers(\"/public\")\n \n // Un-secure H2 Database (for testing purposes, H2 console shouldn't be unprotected in production)\n .and()\n .ignoring()\n .antMatchers(\"/h2-console/**/**\");;\n }", "@Bean\n public Docket userApi() {\n return new Docket(DocumentationType.SWAGGER_2)\n .apiInfo(metaData())\n .select()\n .apis(RequestHandlerSelectors.basePackage(API_BASE_PACKAGE))\n .apis(RequestHandlerSelectors.any())\n .paths(PathSelectors.any())\n .build();\n }", "@Bean\n\tpublic Docket api() { \n\n\t\tDocket docket= new Docket(DocumentationType.SWAGGER_2) \n\t\t\t\t.select() \n\t\t\t\t.apis(RequestHandlerSelectors.basePackage(\"com.authorizationservice.authorization\")) \n\t\t\t\t.paths(PathSelectors.any()) \n\t\t\t\t.build().apiInfo(apiDetails()); \n\t\tlog.debug(\"Docket{}:\", docket);\n\t\treturn docket;\n\t}", "@Ignore\n @Test\n public void discoverOneTypes() throws Exception {\n }", "@Bean\n public Docket swaggerYogurtApi() {\n return new Docket(DocumentationType.SWAGGER_2)\n .groupName(\"Yogurt\")\n .select()\n .apis(RequestHandlerSelectors.basePackage(\"com.yogurt.controller.v1.api\"))\n .paths(PathSelectors.any())\n .build()\n .apiInfo(apiInfo())\n .securitySchemes(Arrays.asList(apiKey()));\n }", "@Bean\n public Docket productApi() {\n return new Docket(DocumentationType.SWAGGER_2) \t\t\t\t \n\t\t .select()\n\t\t \t//.apis(RequestHandlerSelectors.any())\n\t\t \t.apis(RequestHandlerSelectors.basePackage(\"com.thingtrack.training.vertica.services.controller\"))\n\t\t \t.paths(PathSelectors.any())\t\t \t\t \n\t\t \t.build()\n\t\t .securitySchemes(Lists.newArrayList(apiKey()))\n\t\t .securityContexts(Lists.newArrayList(securityContext()))\t\t \t\n\t\t .apiInfo(metaData());\n }", "@Bean\n public Docket swaggerUserApi() {\n return new Docket(DocumentationType.SWAGGER_2)\n .groupName(\"yogurt v1\")\n .select()\n .apis(RequestHandlerSelectors.basePackage(\"com.yogurt.controller.v1.ap1\"))\n .paths(PathSelectors.any())\n .build()\n .apiInfo(apiInfo())\n .securitySchemes(Arrays.asList(apiKey()));\n }", "@Bean\n public Docket usersApi() {\n return new Docket(DocumentationType.SWAGGER_2)\n .apiInfo(usersApiInfo())\n .select()\n .paths(userPaths())\n .apis(RequestHandlerSelectors.any())\n .build()\n .useDefaultResponseMessages(false);\n }", "public JerseyConfig() {\n\t\tregister(StudentService.class);\n\t\tregister(PromotionService.class);\n\t\tregister(GroupService.class);\n\t\tregister(RoleService.class);\n\t\tregister(RightService.class);\n\t\tregister(AccountService.class);\n\t\tregister(TimesheetService.class);\n\t\tthis.configureSwagger();\n\t}", "@Ignore\n @Test\n public void discoverSeveralTypes() throws Exception {\n }", "@Bean\n\tpublic Docket createRestApi() {\n\t\treturn new Docket(DocumentationType.SWAGGER_2)\n\t\t\t\t.apiInfo(apiInfo())\n\t\t\t\t.groupName(\"rest\")\n\t\t\t\t.select()\n\t\t\t\t.apis(RequestHandlerSelectors.basePackage(\"com.ly.edu.controller\"))\n\t\t\t\t.paths(PathSelectors.any())\n\t\t\t\t.build();\n\t}", "private ApiConfig() {\n }", "@Override\n public void configure(IgnoredTypesBuilder builder, ConfigProperties config) {\n builder\n .ignoreClass(\"org.mockito\")\n .ignoreClass(\"com.zaxxer.hikari.metrics.IMetricsTracker$MockitoMock$\");\n }", "@Bean\n public Docket productApi() {\n return new Docket(DocumentationType.SWAGGER_2)\n .select()\n .paths(PathSelectors.regex(\"/api/.*\"))\n .apis(RequestHandlerSelectors.basePackage(\"com.stackroute.muzix\"))\n .build()\n .apiInfo(apiDetails());\n }", "@Bean\n\tpublic Docket customDocket() {\n\n\t\t//Docket aDocket = new Docket(DocumentationType.SWAGGER_2).host(\"120.79.76.25\");\n\t\tDocket aDocket = new Docket(DocumentationType.SWAGGER_2);\n\n\t\tContact authorContact = new Contact(\"WindRanger\", \"\", \"[email protected]\");\n\t\tApiInfo apiInfo = new ApiInfo(\"Sz91online WindRanger API Document\",\n\t\t\t\t\"本文档描述前台与后台的交互方式、接口和数据。 <br/>后台目前只提供JSON方式数据,http返回请求中的content为json内容,内容只包含业务数据,不包含类似result_code之类的非业务数据。\"\n\t\t\t\t\t\t+ \"非业务数据通过http header返回,如果header中未包含return_code,表示http请求处理正常,否则取return_code作相应的提示。提示的内容取return_msg,return_msg是URLEncode后的中文字符串,使用前需还原。<br/>\"\n\t\t\t\t\t\t+ \"通用错误代码列表:<br/>\" + EBusinessException.MIS_PARAMETER_ERROR + \":缺少必要参数<br/>\" + \"\",\n\t\t\t\t\"V1.0\", \"\", authorContact, \"\", \"\");\n\t\taDocket.apiInfo(apiInfo);\n\n\t\treturn aDocket;\n\t}", "@Override\n public void setupConfiguration(Configuration config)\n {\n\n }", "@Override\n public void checkConfiguration() {\n }", "private void defaultKpiShouldNotBeFound(String filter) throws Exception {\n restKpiMockMvc\n .perform(get(ENTITY_API_URL + \"?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restKpiMockMvc\n .perform(get(ENTITY_API_URL + \"/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(content().string(\"0\"));\n }", "public Docket api( ) {\r\n\t\t return new Docket(DocumentationType.SWAGGER_2)\r\n\t .select()\r\n\t .apis(RequestHandlerSelectors.any())\r\n\t .paths(regex(\"/.*\"))\r\n\t .build().apiInfo(apiInfo());\r\n\t}", "public interface ConsumeServiceConfiguration {\n\n /**\n * @return the interfaces of all services that should be consumed\n */\n Set<Class<?>> getServiceInterfaces();\n\n /**\n * Returns the full URL of the server so that the service name only has to be appended to hit the required endpoint.\n * Must not end with a slash.\n */\n String getServerUrl();\n}", "@PostConstruct\n public void init() {\n configureSwagger();\n }", "protected void beforeDiscovery(Collection<BeanArchiveBuilder> builders) {\n // No-op\n }", "public boolean containsIgnoreDefault(String path) { return configuration.contains(path, true); }", "Map<String, Object> swagger();", "public Configuration() {\n\t\tpackages(\"apiservice.services\");\n\t\tregister(CORSFilter.class);\n\t\tregister(AuthenticationFilter.class);\n\t}", "private void configureRoutesAndExceptions() {\n\n }", "@Bean\n EndpointsSecurityConfig endpointsConfig() {\n return http -> http\n .pathMatchers(HttpMethod.POST, \"/api/users\", \"/api/users/login\").permitAll()\n .pathMatchers(HttpMethod.GET, \"/api/profiles/**\").permitAll()\n .pathMatchers(HttpMethod.GET, \"/api/articles/**\").permitAll()\n .pathMatchers(HttpMethod.GET, \"/api/tags/**\").permitAll()\n .anyExchange().authenticated();\n }", "@Bean\n public Docket api() {\n AuthorizationScope[] authScopes = new AuthorizationScope[1];\n authScopes[0] = new AuthorizationScopeBuilder().scope(\"require_auth\")\n .description(\"Scope that requires authorized access\").build();\n SecurityReference securityReference =\n SecurityReference.builder().reference(\"default\").scopes(authScopes).build();\n List<SecurityContext> securityContexts = Arrays.asList(\n (SecurityContext.builder().securityReferences(Arrays.asList((securityReference))).build()));\n\n // Docket\n return new Docket(DocumentationType.SWAGGER_2)\n .directModelSubstitute(LocalDate.class, java.sql.Date.class)\n .directModelSubstitute(OffsetDateTime.class, java.util.Date.class)\n .consumes(\n Sets.newHashSet(MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE))\n .produces(\n Sets.newHashSet(MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE))\n .securitySchemes(Arrays.asList((new BasicAuth(securityReference.getReference()))))\n .securityContexts(securityContexts).select().apis(RequestHandlerSelectors.any())\n .paths(PathSelectors.any()).build();\n }", "@Override\n public boolean hasAdditionalConfig() { return true; }", "@Bean\n\tpublic Docket postApi() {\n\t\treturn new Docket(DocumentationType.SWAGGER_2)\n\t\t\t\t.apiInfo(metadata()).select().paths(regex(\"/api.*\")).build();\n\t}", "private void defaultAnnotationShouldNotBeFound(String filter) throws Exception {\n restAnnotationMockMvc.perform(get(\"/api/annotations?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restAnnotationMockMvc.perform(get(\"/api/annotations/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(content().string(\"0\"));\n }", "@RequestFilters({ AbiquoAuthentication.class, AppendApiVersionToMediaType.class })\n@Path(\"/config\")\npublic interface ConfigAsyncApi {\n /*********************** License ***********************/\n\n /**\n * @see ConfigApi#listLicenses()\n */\n\n @EnterpriseEdition\n @GET\n @Path(\"/licenses\")\n @Consumes(LicensesDto.BASE_MEDIA_TYPE)\n @JAXBResponseParser\n ListenableFuture<LicensesDto> listLicenses();\n\n /**\n * @see ConfigApi#listLicenses(LicenseOptions)\n */\n @EnterpriseEdition\n @GET\n @Path(\"/licenses\")\n @Consumes(LicensesDto.BASE_MEDIA_TYPE)\n @JAXBResponseParser\n ListenableFuture<LicensesDto> listLicenses(LicenseOptions options);\n\n /**\n * @see ConfigApi#addLicense(LicenseDto)\n */\n @EnterpriseEdition\n @POST\n @Produces(LicenseDto.BASE_MEDIA_TYPE)\n @Consumes(LicenseDto.BASE_MEDIA_TYPE)\n @JAXBResponseParser\n @Path(\"/licenses\")\n ListenableFuture<LicenseDto> addLicense(@BinderParam(BindToXMLPayload.class) LicenseDto license);\n\n /**\n * @see ConfigApi#removeLicense(LicenseDto)\n */\n @DELETE\n @EnterpriseEdition\n ListenableFuture<Void> removeLicense(@EndpointLink(\"edit\") @BinderParam(BindToPath.class) LicenseDto license);\n\n /*********************** Privilege ***********************/\n\n /**\n * @see ConfigApi#listPrivileges()\n */\n @GET\n @Path(\"/privileges\")\n @Consumes(PrivilegesDto.BASE_MEDIA_TYPE)\n @JAXBResponseParser\n ListenableFuture<PrivilegesDto> listPrivileges();\n\n /**\n * @see ConfigApi#getPrivilege(Integer)\n */\n @GET\n @Path(\"/privileges/{privilege}\")\n @Consumes(PrivilegeDto.BASE_MEDIA_TYPE)\n @JAXBResponseParser\n @ExceptionParser(ReturnNullOnNotFoundOr404.class)\n ListenableFuture<PrivilegeDto> getPrivilege(@PathParam(\"privilege\") Integer privilegeId);\n\n /*********************** System Properties ***********************/\n\n /**\n * @see ConfigApi#listSystemProperties()\n */\n @GET\n @Path(\"/properties\")\n @Consumes(SystemPropertiesDto.BASE_MEDIA_TYPE)\n @JAXBResponseParser\n ListenableFuture<SystemPropertiesDto> listSystemProperties();\n\n /**\n * @see ConfigApi#listSystemProperties(PropertyOptions)\n */\n @GET\n @Path(\"/properties\")\n @Consumes(SystemPropertiesDto.BASE_MEDIA_TYPE)\n @JAXBResponseParser\n ListenableFuture<SystemPropertiesDto> listSystemProperties(PropertyOptions options);\n\n /**\n * @see ConfigApi#updateSystemProperty(VirtualDatacenterDto)\n */\n @PUT\n @Produces(SystemPropertyDto.BASE_MEDIA_TYPE)\n @Consumes(SystemPropertyDto.BASE_MEDIA_TYPE)\n @JAXBResponseParser\n ListenableFuture<SystemPropertyDto> updateSystemProperty(\n @EndpointLink(\"edit\") @BinderParam(BindToXMLPayloadAndPath.class) SystemPropertyDto property);\n\n /*********************** Category ***********************/\n\n /**\n * @see ConfigApi#listCategories()\n */\n @GET\n @Path(\"/categories\")\n @Consumes(CategoriesDto.BASE_MEDIA_TYPE)\n @JAXBResponseParser\n ListenableFuture<CategoriesDto> listCategories();\n\n /**\n * @see ConfigApi#getCategory(Integer)\n */\n @GET\n @Path(\"/categories/{category}\")\n @Consumes(CategoryDto.BASE_MEDIA_TYPE)\n @JAXBResponseParser\n @ExceptionParser(ReturnNullOnNotFoundOr404.class)\n ListenableFuture<CategoryDto> getCategory(@PathParam(\"category\") Integer categoryId);\n\n /**\n * @see ConfigApi#createCategory(CategoryDto)\n */\n @POST\n @Path(\"/categories\")\n @Produces(CategoryDto.BASE_MEDIA_TYPE)\n @Consumes(CategoryDto.BASE_MEDIA_TYPE)\n @JAXBResponseParser\n ListenableFuture<CategoryDto> createCategory(@BinderParam(BindToXMLPayload.class) CategoryDto category);\n\n /**\n * @see ConfigApi#updateCategory(CategoryDto)\n */\n @PUT\n @Produces(CategoryDto.BASE_MEDIA_TYPE)\n @Consumes(CategoryDto.BASE_MEDIA_TYPE)\n @JAXBResponseParser\n ListenableFuture<CategoryDto> updateCategory(\n @EndpointLink(\"edit\") @BinderParam(BindToXMLPayloadAndPath.class) CategoryDto category);\n\n /**\n * @see ConfigApi#deleteCategory(CategoryDto)\n */\n @DELETE\n ListenableFuture<Void> deleteCategory(@EndpointLink(\"edit\") @BinderParam(BindToPath.class) CategoryDto category);\n}", "@Api(description = \"supermarket client api\")\npublic interface SupermarketClientApi extends ProductApi {\n}", "@Override\n\tpublic void loadExtraConfigs(Configuration config)\n\t{\n\n\t}", "private void defaultPocketShouldNotBeFound(String filter) throws Exception {\n restPocketMockMvc.perform(get(\"/api/pockets?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n }", "@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 }", "@Override\n public void configure(WebSecurity web) throws Exception {\n web\n .ignoring()\n .antMatchers(\"/resources/**\");\n }", "@Override\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\n\n\t\tregistry.addResourceHandler(\"/photos/**\").addResourceLocations(\"file:///c:/dev/study/temp2/\")\n\t\t\t\t.setCacheControl(CacheControl.noCache());\n\t\t// .setCacheControl(CacheControl.masAge(Duration.ofDays(1));\n\t\tregistry.addResourceHandler(\"/swagger-ui/**\")\n\t\t.addResourceLocations(\"classpath:/META-INF/resources/webjars/springfox-swagger-ui/\")\n\t\t.resourceChain(false);\n\t}", "public boolean shouldOverrideHttpClientConfigurations() {\r\n return configuration.shouldOverrideHttpClientConfigurations();\r\n }", "@Override\n\tpublic void validateConfigurationWithoutLogin() {\n\t\tcheckAuthorization();\n\t}", "@Configuration\n public Option[] config() {\n String pathToTestClass = ServiceOneBundleTest.class.getClassLoader().getResource(\".\").getPath();\n String[] pathParts = pathToTestClass.split(\"OsgiBundleTest\");\n StringBuilder pathToBundle = new StringBuilder(pathParts[0]);\n pathToBundle.append(\"ServiceOneModule/target/ServiceOneModule-1.0-SNAPSHOT.jar\");\n return CoreOptions.options(\n mavenBundle(\"com.google.guava\", \"guava\", \"13.0.1\").startLevel(30),\n bundle(new File(pathToBundle.toString()).toURI().toString()),\n junitBundles()\n );\n }", "@Override\n\tpublic void config(StarConfig config) {\n\t\t\n\t}", "@LogMessage(level = WARN)\n @Message(value = \"Could not find configuration [%s]; using defaults.\", id = 20002)\n void unableToFindConfiguration(String name);", "public interface SwaggerDescriptions {\n\n String VIN = \"Identifies a vehicle. This is a required parameter unless year, make, and model are provided as input values.\";\n String COUNTRY = \"Identifies a country. This country could be different than the country in which the vehicle was manufactured.\";\n String USED = \"Identifies whether the vehicle is used. If set to true, you can specify install options for the vehicle using other input values.\";\n String VEHICLE_YEAR = \"Identifies the year in which the vehicle was manufactured. This is an optional parameter unless VIN is not specified.\";\n String VEHICLE_MAKE = \"Identifies the vehicle make. This is an optional parameter unless VIN is not specified.\";\n String VEHICLE_MODEL = \"Identifies the vehicle model. This is an optional parameter unless VIN is not specified.\";\n String VEHICLE_TRIM = \"Identifies the vehicle trim. If you submit a VIN that returns multiple style ids, you can specify a trim to focus the response on one style id.\";\n String VEHICLE_BODY_STYLE = \"Identifies the vehicle body style to install on the vehicle.\";\n String VEHICLE_ENGINE = \"Identifies the vehicle engine code to install on the vehicle.\";\n String VEHICLE_TRANS = \"Identifies the vehicle transmission to install on the vehicle.\";\n String VEHICLE_EXT_COLOR = \"Identifies the vehicle's exterior color to install on the vehicle.\";\n String VEHICLE_INT_COLOR = \"Identifies the vehicle's interior color to install on the vehicle.\";\n String LIST_OPTIONS = \"Identifies a list of vehicle options to install on the vehicle.\";\n String LIST_UNSTRUCTURED = \"Identifies unstructured text that is mapped to the vehicle features you want installed on the vehicle.\";\n\n String INCLUDE_DEBUG_INFO = \"Include debug information in the response object\";\n String INCLUDE_SUPPORT_INFO = \"Include support information in the response object\";\n\n String LANGUAGE = \"Language\";\n\n String GET_WS_VERSION = \"Get the version of the web service\";\n String GET_WS_HEALTH = \"Check the health of the services\";\n String GET_WS_CONNECTION = \"Get the status of micro service connections\";\n\n String WS_RESPONSE_ID = \"Displays a unique identifier of the web service response.\";\n String WS_DATE_TIME = \"Displays the date and time on the server when the request was made.\";\n\n String WS_MESSAGE = \"Displays messages from the server.\";\n String WS_ERROR = \"Identifies whether an error occurred with the request.\";\n String EXECUTION_TIME = \"Displays the execution time of the request in milliseconds.\";\n String WS_DEBUG_INFO = \"Displays debug information.\";\n String WS_SUPPORT_INFO = \"Displays support information.\";\n String WS_RESULT = \"Displays the web service results.\";\n String WS_EXECUTION_DETAILS = \"Displays Akana related billing informations.\";\n String WS_COPYRIGHT = \"Displays the copywrite message.\";\n\n}", "@Test\n public void testLoadOptionalChildBuilderSuppressErrorLog()\n throws ConfigurationException\n {\n factory.addProperty(\"override.configuration[@fileName]\",\n OPTIONAL_FILE.getAbsolutePath());\n // a special invocation handler which checks that the warn() method of\n // a logger is not called\n InvocationHandler handler = new InvocationHandler()\n {\n public Object invoke(Object proxy, Method method, Object[] args)\n throws Throwable\n {\n String methodName = method.getName();\n if (methodName.startsWith(\"is\"))\n {\n return Boolean.TRUE;\n }\n if (\"warn\".equals(methodName))\n {\n fail(\"Unexpected log output!\");\n }\n return null;\n }\n };\n factory.setLogger((Log) Proxy.newProxyInstance(getClass()\n .getClassLoader(), new Class[] {\n Log.class\n }, handler));\n factory.getConfiguration(false);\n }", "@ProbeBuilder\n public TestProbeBuilder probeConfiguration(TestProbeBuilder probe) {\n probe.setHeader(Constants.DYNAMICIMPORT_PACKAGE, \"*\");\n return probe;\n }", "@Override\n\t protected void applyCustomConfiguration(SiteMeshFilterBuilder builder) {\n\t\t builder.addDecoratorPath(\"/*\", \"/WEB-INF/jsp/decorator/decorator.jsp\")\n//\t\t .addDecoratorPaths(\"/articles/*\", \"/decorators/article.html\",\n//\t\t \"/decoratos/two-page-layout.html\",\n//\t\t \"/decorators/common.html\")\n\t\t // Exclude path from decoration.\n\t\t .addExcludedPath(\"/member/list.do\")\n\t\t .addExcludedPath(\"/base/codeWindow.html*\")\n\t\t .addExcludedPath(\"/base/postWindow.html*\");\n\t\t \n\t\t builder.addTagRuleBundles(new DivExtractingTagRuleBundle());\n\n\t }", "@Override\n public void configure(WebSecurity web) throws Exception {\n web.ignoring().antMatchers(HttpMethod.GET,\"/api/posts/**\")\n .antMatchers(\"api/users/**\");\n }", "private void defaultAnnotationTypeShouldNotBeFound(String filter) throws Exception {\n restAnnotationTypeMockMvc.perform(get(\"/api/projects/{projectId}/annotation-types?sort=id,desc&\" + filter, DEFAULT_PROJECT_ID))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restAnnotationTypeMockMvc.perform(get(\"/api/projects/{projectId}/annotation-types/count?sort=id,desc&\" + filter, DEFAULT_PROJECT_ID))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(content().string(\"0\"));\n }", "private void defaultRecommendationShouldNotBeFound(String filter) throws Exception {\n restRecommendationMockMvc.perform(get(\"/api/recommendations?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restRecommendationMockMvc.perform(get(\"/api/recommendations/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(content().string(\"0\"));\n }", "@Override\n public void registerResources(ResourceRegistrar registrar) {\n registrar.addIgnoredResource(CONNECTIQ_NAMESPACE);\n }", "@Override\n protected void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"swagger-ui.html\")\n .addResourceLocations(\"classpath:/META-INF/resources/\");\n \n registry.addResourceHandler(\"/webjars/**\")\n .addResourceLocations(\"classpath:/META-INF/resources/webjars/\");\n }", "public interface PrivateApiRoutes {\n}", "@SwaggerDefinition(info = @Info(description = \"Ampula API \", version = \"1.0.0\", title = \"Ampula API\"),\n produces = MediaType.APPLICATION_JSON_UTF8_VALUE,\n schemes = SwaggerDefinition.Scheme.HTTPS\n)\n@Api(tags = \"Doctor Service\", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, protocols = \"https\")\n@RequestMapping(value = \"api/doctor/\")\npublic interface DoctorEndpoint {\n\n @ApiOperation(value = \"Add new doctor\")\n @ApiResponses({\n @ApiResponse(code = 200, message = \"OK\")\n })\n @RequestMapping(value = \"/add\", method = RequestMethod.POST)\n GeneralResponse<Long> addNewDoctor(GeneralRequest<Void, CreateDoctorRequest> request);\n\n\n @ApiOperation(value = \"Fire a doctor\")\n @ApiResponses({\n @ApiResponse(code = 200, message = \"OK\"),\n @ApiResponse(code = 500, message = \"Server error\", response = GeneralErrorResponse.class)\n })\n @RequestMapping(value = \"/delete\", method = RequestMethod.DELETE)\n GeneralResponse<Void> deleteDoctor(Long doctor_id);\n\n\n @ApiOperation(value = \"Update doctor data\")\n @ApiResponses({\n @ApiResponse(code = 200, message = \"OK\"),\n @ApiResponse(code = 500, message = \"Server error\", response = GeneralErrorResponse.class)\n })\n @RequestMapping(value = \"/update\", method = RequestMethod.POST)\n GeneralResponse<Void> updateDoctorData(GeneralRequest<Long, UpdateDoctorRequest> request);\n\n\n @ApiOperation(value = \"Get doctor data by ID\")\n @ApiResponses({\n @ApiResponse(code = 200, message = \"OK\"),\n @ApiResponse(code = 500, message = \"Server error\", response = GeneralErrorResponse.class)\n })\n @RequestMapping(value = \"/get\", method = RequestMethod.GET)\n GeneralResponse<DoctorDTO> getDoctor(Long doctor_id);\n\n\n @ApiOperation(value = \"Get all doctor's patients\")\n @ApiResponses({\n @ApiResponse(code = 200, message = \"OK\"),\n @ApiResponse(code = 500, message = \"Server error\", response = GeneralErrorResponse.class)\n })\n @RequestMapping(value = \"/get/all/patients\", method = RequestMethod.GET)\n GeneralResponse<List<CardDTO>> getAllPatients(Long doctor_id);\n\n\n @ApiOperation(value = \"Get all doctors\")\n @ApiResponses({\n @ApiResponse(code = 200, message = \"OK\")\n })\n @RequestMapping(value = \"/get/all\", method = RequestMethod.GET)\n GeneralResponse<List<DoctorDTO>> getAll();\n\n\n}", "@FeignClient(name = \"pc-cloud-client\",\n fallback = ProductSpecificationRepository.ProductSpecificationRepositoryFallback.class)\npublic interface ProductSpecificationRepository {\n\n @RequestMapping(method = RequestMethod.GET, path = \"/catalog/{specificationId}\")\n Object existsById(@PathVariable(\"specificationId\") String specificationId);\n\n @GetMapping(\"/catalog\")\n String getCatalog();\n\n @Component\n class ProductSpecificationRepositoryFallback implements ProductSpecificationRepository {\n @Override\n public Object existsById(String specificationId) {\n return null;\n }\n\n @Override\n public String getCatalog() {\n return \"Fallback catalog\";\n }\n }\n}", "@Override\r\n\tprotected ResponseEntity<Object> handleMissingPathVariable(MissingPathVariableException ex, HttpHeaders headers,\r\n\t\t\tHttpStatus status, WebRequest request) {\n\t\treturn super.handleMissingPathVariable(ex, headers, status, request);\r\n\t}", "protected WeldBeanDeploymentArchive processAnnotatedDiscovery(BeanArchiveBuilder builder) {\n throw new UnsupportedOperationException();\n }", "public void stopDiscovery() {\n if (mApiClient != null) {\n Weave.DEVICE_API.stopLoading(mApiClient, mDiscoveryListener);\n }\n }", "@Override\n\tprotected ResponseEntity<Object> handleMissingPathVariable(MissingPathVariableException ex, HttpHeaders headers,\n\t\t\tHttpStatus status, WebRequest request) {\n\t\treturn super.handleMissingPathVariable(ex, headers, status, request);\n\t}", "@Path(JaxRsActivator.OVERVIEW_ENDPOINT_PATH)\npublic interface ApiOverviewRestEndpoint {\n /**\n * A {@code String} constant representing json v1 \"{@value #MEDIA_TYPE_JSON_V1}\" media type .\n */\n String MEDIA_TYPE_JSON_V1 = \"application/vnd.overview-v1+json\";\n /**\n * A {@link MediaType} constant representing json v1 \"{@value #MEDIA_TYPE_JSON_V1}\" media type.\n */\n MediaType MEDIA_TYPE_JSON_V1_TYPE = new MediaType(\"application\", \"vnd.overview-v1+json\");\n\n /**\n * <pre>\n * http://127.0.0.1:8180/auth-microservice/auth-api/overview/endpoints\n * curl -v -H \"Accept: application/vnd.overview-v1+json\" -H \"Content-Type: application/vnd.overview-v1+json\" -H \"X-BOMC-REQUEST-ID: SET-BY-CURL-123\" -H \"X-BOMC-AUTHORIZATION: BOMC_USER\" -X GET \"127.0.0.1:8180/auth-microservice/auth-api/overview/endpoints\"\n * </pre>\n * @return JSON response for all available endpoints.\n * @description List all available endpoints. responseType javax.json.JsonObject\n * @responseMessage 200 A Response object that wraps the javax.json.JsonObject.\n * @responseMessage 400 Invalid Request.\n * @responseMessage 401 Unauthorized. API key does not need access privileges.\n * @responseMessage 404 Endpoint not found.\n */\n @GET\n @Path(\"/endpoints\")\n @Produces(ApiOverviewRestEndpoint.MEDIA_TYPE_JSON_V1)\n @Cache\n Response getAvailableEndpoints(@Context final Dispatcher dispatcher);\n}", "public void setIgnoreResourceNotFound(boolean ignoreResourceNotFound) {\n\t\tthis.ignoreResourceNotFound = ignoreResourceNotFound;\n\t}", "@Test\n public void testResponderWithOneBadConfigClassname() {\n }", "@Override\n public void configure(WebSecurity web) throws Exception {\n web\n .ignoring()\n .antMatchers(\"/resources/**\", \"/static/**\", \"/css/**\", \"/js/**\", \"/images/**\",\"/documents/**\");\n }", "private void startDiscovery() {\n client.startDiscovery(getResources().getString(R.string.service_id), endpointDiscoveryCallback, new DiscoveryOptions(STRATEGY));\n }", "@PostConstruct\n public void init() {\n ApiClient client = Config.fromToken(url, token, validateSSL);\n io.kubernetes.client.Configuration.setDefaultApiClient(client);\n }", "public static void resetConfiguration() {\n\t\t// Ignore\n\t}", "private void stopDiscovery() {\n if (mDisposable != null) {\n mDisposable.dispose();\n }\n }", "@Path(\"/providers/Microsoft.Compute/locations/{location}\")\n@RequestFilters({ OAuthFilter.class, ApiVersionFilter.class })\n@Consumes(APPLICATION_JSON)\npublic interface OSImageApi {\n\n /**\n * List Publishers in location\n */\n @Named(\"publisher:list\")\n @GET\n @Path(\"/publishers\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n List<Publisher> listPublishers();\n\n /**\n * List Offers in publisher\n */\n @Named(\"offer:list\")\n @GET\n @Path(\"/publishers/{publisher}/artifacttypes/vmimage/offers\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n List<Offer> listOffers(@PathParam(\"publisher\") String publisher);\n\n /**\n * List SKUs in offer\n */\n @Named(\"sku:list\")\n @GET\n @Path(\"/publishers/{publisher}/artifacttypes/vmimage/offers/{offer}/skus\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n List<SKU> listSKUs(@PathParam(\"publisher\") String publisher, @PathParam(\"offer\") String offer);\n\n /**\n * List Versions in SKU\n */\n @Named(\"version:list\")\n @GET\n @Path(\"/publishers/{publisher}/artifacttypes/vmimage/offers/{offer}/skus/{sku}/versions\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n List<Version> listVersions(@PathParam(\"publisher\") String publisher, @PathParam(\"offer\") String offer,\n @PathParam(\"sku\") String sku);\n \n /**\n * Get the details of a Version\n */\n @Named(\"version:get\")\n @GET\n @Path(\"/publishers/{publisher}/artifacttypes/vmimage/offers/{offer}/skus/{sku}/versions/{version}\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n Version getVersion(@PathParam(\"publisher\") String publisher, @PathParam(\"offer\") String offer,\n @PathParam(\"sku\") String sku, @PathParam(\"version\") String version);\n\n}", "@Override\n public void configure() throws Exception {\n restConfiguration().component(\"netty-http\")\n .host(\"localhost\")\n .port(\"9091\")\n .bindingMode(RestBindingMode.auto)\n .enableCORS(true);\n\n rest(\"/api\")\n // Begin: Stations REST endpoints\n .get(\"/stations\")\n .produces(\"application/xml\")\n .route()\n .bean(stations_interactor, \"getAllStations\")\n .endRest()\n\n .get(\"/station/{id}\")\n .produces(\"application/xml\")\n .route()\n .bean(stations_interactor, \"getStation(${header.id})\")\n .endRest()\n\n .put(\"/station/{id}\")\n .type(TransportStation.class)\n .consumes(\"application/xml\")\n .produces(\"application/xml\")\n .route()\n .bean(stations_interactor, \"replaceStation(${header.id}, ${body})\")\n .endRest()\n\n .post(\"/station\")\n .type(TransportStation.class)\n .consumes(\"application/xml\")\n .produces(\"application/xml\")\n .route()\n .bean(stations_interactor, \"createStation(${body})\")\n .endRest()\n\n .delete(\"/station/{id}\")\n .produces(\"application/xml\")\n .route()\n .bean(stations_interactor, \"deleteStation(${header.id})\")\n .endRest()\n\n // Begin: Vehicles REST endpoints\n\n .get(\"/vehicles\")\n .produces(\"application/xml\")\n .route()\n .bean(vehicles_interactor, \"getAllVehicles\")\n .endRest()\n\n .get(\"/vehicle/{id}\")\n .produces(\"application/xml\")\n .route()\n .bean(vehicles_interactor, \"getVehicle(${header.id})\")\n .endRest()\n\n .put(\"/vehicle/{id}\")\n .type(Vehicle.class)\n .consumes(\"application/xml\")\n .produces(\"application/xml\")\n .route()\n .bean(vehicles_interactor, \"replaceVehicle(${header.id}, ${body})\")\n .endRest()\n\n .post(\"/vehicle\")\n .type(Vehicle.class)\n .consumes(\"application/xml\")\n .produces(\"application/xml\")\n .route()\n .bean(vehicles_interactor, \"createVehicle(${body})\")\n .endRest()\n\n .delete(\"/vehicle/{id}\")\n .produces(\"application/xml\")\n .route()\n .bean(vehicles_interactor, \"deleteVehicle(${header.id})\")\n .endRest()\n\n // Begin: TimeTables REST endpoints\n .get(\"/timetables\")\n .produces(\"application/xml\")\n .route()\n .bean(timetables_interactor, \"getAllTimeTables\")\n .endRest()\n\n .get(\"/timetable/{id}\")\n .produces(\"application/xml\")\n .route()\n .bean(timetables_interactor, \"getTimeTable(${header.id})\")\n .endRest()\n\n .put(\"/timetable/{id}\")\n .type(TimeTable.class)\n .consumes(\"application/xml\")\n .produces(\"application/xml\")\n .route()\n .bean(timetables_interactor, \"replaceTimeTable(${header.id}, ${body})\")\n .endRest()\n\n .post(\"/timetable\")\n .type(TimeTable.class)\n .consumes(\"application/xml\")\n .produces(\"application/xml\")\n .route()\n .bean(timetables_interactor, \"createTimeTable(${body})\")\n .endRest()\n\n .delete(\"/timetable/{id}\")\n .produces(\"application/xml\")\n .route()\n .bean(timetables_interactor, \"deleteTimeTable(${header.id})\")\n .endRest();\n }", "interface DeviceAPI {\n /**\n * Get the children of the device.\n *\n * @param device the device\n *\n * @return the children\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getChildrenOfDevice/{device}\")\n List<JsonDevice> childrenOf(@PathParam(\"device\") int device);\n\n /**\n * Get the SensorML description of the device.\n *\n * @param id the id\n *\n * @return the SensorML description\n */\n @GET\n @Produces(MediaType.APPLICATION_XML)\n @Path(\"getDeviceAsSensorML/{device}\")\n String getSensorML(@PathParam(\"device\") int id);\n\n /**\n * Get the list of all devices.\n *\n * @return the devices\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getAllActiveDevicesFast\")\n List<JsonDevice> all();\n\n /**\n * Get the device.\n *\n * @param device the id\n *\n * @return the device\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getDevice/{device}\")\n JsonDevice byId(@PathParam(\"device\") int device);\n\n /**\n * Get all device categories.\n *\n * @return the device categories\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getAllDeviceCategories\")\n List<JsonType> types();\n\n /**\n * Get the device.\n *\n * @param urn the URN\n *\n * @return the device\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getDeviceByUrn/{urn}\")\n JsonDevice byURN(@PathParam(\"urn\") String urn);\n }", "@Override\n public void preProcess(ApiConfigurator c) {\n if(null != rsc && rsc.isEnabled()) {\n c.enableOAuth();\n \n //TODO : scopes\n }\n \n ApiConfig conf = c.config();\n OAuthConfig oauthConfig = conf.getOAuthConfig();\n if(oauthConfig == null ||\n (Strings.isEmpty(oauthConfig.getAuthzEndpointUrl()) && Strings.isEmpty(oauthConfig.getTokenEndpointUrl()))) {\n \n //auto set endpoint url if oauth2 client app is enabled locally.\n if(null != owc && owc.isEnabled()) {\n String authzUrl = owc.getServerAuthorizationEndpointUrl();\n String tokenUrl = owc.getServerTokenEndpointUrl();\n if(oauthConfig == null){\n oauthConfig = new OAuthConfig(false, authzUrl,tokenUrl);\n c.setOAuthConfig(oauthConfig);\n return;\n }\n oauthConfig.setAuthzEndpointUrl(authzUrl);\n oauthConfig.setTokenEndpointUrl(tokenUrl);\n return;\n }\n\n //auto set endpoint url if authz server is enabled locally.\n if(null != asc && asc.isEnabled()) {\n //we cannot know the host name and port of local server.\n String contextPath = app.getContextPath();\n String authzUrl = contextPath + asc.getAuthzEndpointPath();\n String tokenUrl = contextPath + asc.getTokenEndpointPath();\n if(oauthConfig == null){\n oauthConfig = new OAuthConfig(false,authzUrl,tokenUrl);\n c.setOAuthConfig(oauthConfig);\n return;\n }\n oauthConfig.setAuthzEndpointUrl(authzUrl);\n oauthConfig.setTokenEndpointUrl(tokenUrl);\n }\n }\n }", "protected WeldBeanDeploymentArchive processNoneDiscovery(BeanArchiveBuilder builder) {\n return null;\n }", "@GetMapping(\"notfound\")\n public void notFound()\n {\n throw new NotFoundException(\"404\", \"404 Not Found - NotFoundException\");\n }", "private void defaultMotherBedShouldNotBeFound(String filter) throws Exception {\n restMotherBedMockMvc.perform(get(\"/api/mother-beds?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n }", "public interface ApiService {\n\n @GET(\"/tools/mockapi/2793/kdd_config\")\n Call<JsonObject> getConfig();\n}", "@Before\n public void setUp() {\n configuration.resolveAdditionalDependenciesFromClassPath(false);\n }", "public interface JSONRestconfService {\n /**\n * The data tree root path.\n */\n String ROOT_PATH = null;\n\n /**\n * Issues a restconf PUT request to the configuration data store.\n *\n * @param uriPath the yang instance identifier path, eg \"opendaylight-inventory:nodes/node/device-id\".\n * To specify the root, use {@link ROOT_PATH}.\n * @param payload the payload data in JSON format.\n * @throws OperationFailedException if the request fails.\n */\n void put(String uriPath, @Nonnull String payload) throws OperationFailedException;\n\n /**\n * Issues a restconf POST request to the configuration data store.\n *\n * @param uriPath the yang instance identifier path, eg \"opendaylight-inventory:nodes/node/device-id\".\n * To specify the root, use {@link ROOT_PATH}.\n * @param payload the payload data in JSON format.\n * @throws OperationFailedException if the request fails.\n */\n void post(String uriPath, @Nonnull String payload) throws OperationFailedException;\n\n /**\n * Issues a restconf DELETE request to the configuration data store.\n *\n * @param uriPath the yang instance identifier path, eg \"opendaylight-inventory:nodes/node/device-id\".\n * To specify the root, use {@link ROOT_PATH}.\n * @throws OperationFailedException if the request fails.\n */\n void delete(String uriPath) throws OperationFailedException;\n\n /**\n * Issues a restconf GET request to the given data store.\n *\n * @param uriPath the yang instance identifier path, eg \"opendaylight-inventory:nodes/node/device-id\".\n * To specify the root, use {@link ROOT_PATH}.\n * @param datastoreType the data store type to read from.\n * @return an Optional containing the data in JSON format if present.\n * @throws OperationFailedException if the request fails.\n */\n Optional<String> get(String uriPath, LogicalDatastoreType datastoreType)\n throws OperationFailedException;\n\n /**\n * Invokes a yang-defined RPC.\n *\n * @param uriPath the path representing the RPC to invoke, eg \"toaster:make-toast\".\n * @param input the input in JSON format if the RPC takes input.\n * @return an Optional containing the output in JSON format if the RPC returns output.\n * @throws OperationFailedException if the request fails.\n */\n Optional<String> invokeRpc(@Nonnull String uriPath, Optional<String> input) throws OperationFailedException;\n\n /**\n * Issues a restconf PATCH request to the configuration data store.\n *\n * @param uriPath the yang instance identifier path, eg \"opendaylight-inventory:nodes/node/device-id\".\n * To specify the root, use {@link ROOT_PATH}.\n * @param payload the payload data in JSON format.\n * @return an Optional containing the patch response data in JSON format.\n * @throws OperationFailedException if the request fails.\n */\n Optional<String> patch(@Nonnull String uriPath, @Nonnull String payload) throws OperationFailedException;\n}", "public interface ConfigurationServiceV1 {\n \n \n /**\n * Auto generated method signature\n * Documentation goes here.\n * @param getBSConfigRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetBSConfigResponse getBSConfig\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetBSConfigRequest getBSConfigRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * Documentation goes here.\n * @param setServiceLocationRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.SetServiceLocationResponse setServiceLocation\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.SetServiceLocationRequest setServiceLocationRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * Documentation goes here.\n * @param getOPSConfigRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetOPSConfigResponse getOPSConfig\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetOPSConfigRequest getOPSConfigRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * Documentation goes here.\n * @param getClientConfigRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetClientConfigResponse getClientConfig\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetClientConfigRequest getClientConfigRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * \n * @param getQSLocationsRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetQSLocationsResponse getQSLocations\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetQSLocationsRequest getQSLocationsRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * Documentation goes here.\n * @param setClientToBSRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.SetClientToBSResponse setClientToBS\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.SetClientToBSRequest setClientToBSRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * \n * @param getESLocationsRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetESLocationsResponse getESLocations\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetESLocationRequest getESLocationsRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * Documentation goes here.\n * @param setBSToOPSRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.SetBSToOPSResponse setBSToOPS\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.SetBSToOPSRequest setBSToOPSRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * Documentation goes here.\n * @param getBSLocationsRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetBSLocationsResponse getBSLocations\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetBSLocationsRequest getBSLocationsRequest\n )\n ;\n \n \n /**\n * Auto generated method signature\n * \n * @param getOPSLocationsRequest\n */\n\n \n public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetOPSLocationsResponse getOPSLocations\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.GetOPSLocationsRequest getOPSLocationsRequest\n )\n ;\n \n }", "protected boolean isValidSwagger(final String path) {\n return \"/openapi.json\".equals(path) || path.startsWith(\"/swagger-ui/\");\n }", "private OpenApiHandlerConfig(String configName) {\n config = Config.getInstance();\n mappedConfig = config.getJsonMapConfigNoCache(configName);\n setConfigData();\n setConfigMap();\n }", "@Override\n\tpublic void onConfigurationSkip(ITestResult itr) {\n\t\t\n\t}", "public interface SensorAPI {\n\n /**\n * Get the sensor output API.\n *\n * @return the API\n */\n @Path(\"sensorOutputs\")\n SensorOutputAPI sensorOutputs();\n\n /**\n * Get the device API.\n *\n * @return the API\n */\n @Path(\"device\")\n DeviceAPI devices();\n\n /**\n * Get the platform API.\n *\n * @return the API\n */\n @Path(\"platforms\")\n PlatformAPI platforms();\n\n /**\n * JAX-RS interface for the sensor output resource.\n */\n interface SensorOutputAPI {\n /**\n * Get the outputs of the device\n *\n * @param device the device\n *\n * @return the outputs\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getDeviceSensorOutputs/{device}\")\n List<JsonSensorOutput> byDevice(@PathParam(\"device\") int device);\n }\n\n /**\n * JAX-RS interface for the device resource.\n */\n interface DeviceAPI {\n /**\n * Get the children of the device.\n *\n * @param device the device\n *\n * @return the children\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getChildrenOfDevice/{device}\")\n List<JsonDevice> childrenOf(@PathParam(\"device\") int device);\n\n /**\n * Get the SensorML description of the device.\n *\n * @param id the id\n *\n * @return the SensorML description\n */\n @GET\n @Produces(MediaType.APPLICATION_XML)\n @Path(\"getDeviceAsSensorML/{device}\")\n String getSensorML(@PathParam(\"device\") int id);\n\n /**\n * Get the list of all devices.\n *\n * @return the devices\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getAllActiveDevicesFast\")\n List<JsonDevice> all();\n\n /**\n * Get the device.\n *\n * @param device the id\n *\n * @return the device\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getDevice/{device}\")\n JsonDevice byId(@PathParam(\"device\") int device);\n\n /**\n * Get all device categories.\n *\n * @return the device categories\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getAllDeviceCategories\")\n List<JsonType> types();\n\n /**\n * Get the device.\n *\n * @param urn the URN\n *\n * @return the device\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getDeviceByUrn/{urn}\")\n JsonDevice byURN(@PathParam(\"urn\") String urn);\n }\n\n /**\n * JAX-RS interface for the platform resource.\n */\n interface PlatformAPI {\n /**\n * Get all platforms.\n *\n * @return the platforms\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getAllRootItems\")\n List<JsonDevice> all();\n\n /**\n * Get all platform types.\n *\n * @return the platform types\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getAllPlatformTypes\")\n List<JsonType> types();\n }\n\n}", "@Test\n public void testDetectConfigurationCompoundPath() throws Exception {\n\n Config testConfig = ConfigFactory.parseResourcesAnySyntax(\"packagePath.conf\");\n\n StreamsConfigurator.setConfig(testConfig);\n\n ComponentConfigurator<ComponentConfiguration> configurator = new ComponentConfigurator<>(ComponentConfiguration.class);\n\n ComponentConfiguration configuredPojo = configurator.detectConfiguration(\"org.apache.streams.config\");\n\n Assert.assertThat(configuredPojo, is(notNullValue()));\n\n Assert.assertThat(configuredPojo.getInClasses(), is(notNullValue()));\n Assert.assertThat(configuredPojo.getInClasses().size(), is(greaterThan(0)));\n\n Assert.assertThat(configuredPojo.getOutClasses(), is(notNullValue()));\n Assert.assertThat(configuredPojo.getOutClasses().size(), is(greaterThan(0)));\n\n }", "private void defaultDeploymentShouldNotBeFound(String filter) throws Exception {\n restDeploymentMockMvc.perform(get(\"/api/deployments?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restDeploymentMockMvc.perform(get(\"/api/deployments/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(content().string(\"0\"));\n }", "@Override\n protected Set<InjectionPoint> getConfigPropertyInjectionPoints() {\n return super.getConfigPropertyInjectionPoints().stream().sorted((o1, o2) -> {\n if (o1.getMember().getName().equals(\"skip\")) {\n return -1;\n }\n return 0;\n }).collect(Collectors.toCollection(LinkedHashSet::new));\n }", "static void ignore() {\n }", "@SystemApi\n public interface IkeConfigRequest {}", "@Override\n protected void configure() {\n }" ]
[ "0.62163925", "0.62081003", "0.6048387", "0.60347867", "0.58509797", "0.5797619", "0.5691844", "0.56856537", "0.566437", "0.5591929", "0.55692387", "0.5528881", "0.5519662", "0.5506743", "0.5370768", "0.5346333", "0.5344891", "0.5333258", "0.5315038", "0.52358264", "0.5232036", "0.5192603", "0.51878744", "0.51526624", "0.51508856", "0.5108634", "0.5095184", "0.5073535", "0.5072143", "0.50669664", "0.5050063", "0.5026216", "0.49998698", "0.4999504", "0.49965894", "0.49901906", "0.4960936", "0.4945864", "0.4944858", "0.49262753", "0.4917607", "0.49082255", "0.48517996", "0.48007476", "0.47944567", "0.4784812", "0.47780827", "0.4764659", "0.47547635", "0.47529948", "0.47496444", "0.47334862", "0.4733299", "0.47274438", "0.47238505", "0.47196525", "0.47144538", "0.4691678", "0.46827552", "0.46726516", "0.46649915", "0.46572664", "0.46561423", "0.46548837", "0.4646554", "0.46460027", "0.46403202", "0.46391436", "0.4595695", "0.45663422", "0.4564978", "0.4561109", "0.45599398", "0.45500055", "0.45463797", "0.454372", "0.45392787", "0.45294213", "0.45254403", "0.45249346", "0.45216626", "0.45111537", "0.45058948", "0.45035246", "0.4502743", "0.44989702", "0.44893703", "0.44748244", "0.4471017", "0.44637045", "0.446302", "0.44618282", "0.44557747", "0.4452367", "0.44513467", "0.4442178", "0.44400752", "0.44237363", "0.44226265", "0.44205865" ]
0.6053896
2
Info: Access to api is configured via PreAuthorize and PostAuthorize Info: Session management disabled for stateless rest api (authentication is very fast because of JWT)
@Override public void configure(HttpSecurity http) throws Exception { http .addFilterBefore(getFirebaseAuthenticationFilter(), BasicAuthenticationFilter.class).authorizeRequests() .antMatchers(HttpMethod.OPTIONS,"/api/**").permitAll() .antMatchers("/api/**").hasAnyRole(Roles.ANONYMOUS, Roles.USER, Roles.ADMIN) .antMatchers("/**").denyAll() .and().csrf().disable() .anonymous().authorities(Roles.ROLE_ANONYMOUS) .and().exceptionHandling().authenticationEntryPoint(entryPoint) .and().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.NEVER).disable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@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 }", "private void authorize() {\r\n\r\n\t}", "@RestApi\npublic interface SecurityApi {\n\n /**\n * 校验图片验证码是否正确\n *\n * @param captchaCode\n * @param captchaCodeRedisKey\n * @return\n */\n @RequestMapping(\"/inner/securityApi/validateCaptchaCode/{captchaCode}/{captchaCodeRedisKey}\")\n Result<Boolean> validateCaptchaCode(@PathVariable String captchaCode, @PathVariable String captchaCodeRedisKey);\n\n /**\n * 获取图片验证码\n *\n * @param response\n * @return\n */\n @RequestMapping(\"/securityApi/getCaptcha\")\n Result<byte[]> getCaptcha(HttpServletRequest request, HttpServletResponse response);\n\n /**\n * 获取手机验证码\n *\n * @param paramDto\n * @param request\n * @return\n */\n @RequestMapping(\"/securityApi/getPhoneCode\")\n Result<String> getPhoneCode(@Valid DoctorSecurityGetPhoneCodeParamDto paramDto, Errors errors, HttpServletRequest request);\n\n /**\n * 校验手机验证码\n *\n * @param loginName\n * @param phoneValidateCode\n * @param type\n * @return\n */\n @RequestMapping(\"/securityApi/validatePhoneCode\")\n Result<Boolean> validatePhoneCode(String loginName, String phoneValidateCode, String type);\n\n /**\n * 授信\n *\n * @param paramDto\n * @param request\n * @return\n */\n @RequestMapping(\"/securityApi/creditDevice\")\n Result<String> creditDevice(@Valid DoctorSecurityCreditDeviceParamDto paramDto, Errors errors, HttpServletRequest request, HttpServletResponse response);\n\n /**\n * 检验是否第一次登录\n *\n * @param deviceInfoDto\n * @return\n */\n @RequestMapping(\"/inner/securityApi/checkFirstLoginForDoctor\")\n Result<Boolean> checkFirstLoginForDoctor(@RequestBody @Valid DoctorLoginDeviceInfoDto deviceInfoDto, Errors errors);\n\n /**\n * 检验deviceId是否已存在(此设备是否受信)\n *\n * @param deviceInfoDto\n * @return\n */\n @RequestMapping(\"/inner/securityApi/checkDeviceIdExistForDoctor\")\n Result<Boolean> checkDeviceIdExistForDoctor(@RequestBody @Valid DoctorLoginDeviceInfoDto deviceInfoDto, Errors errors);\n\n /**\n * 保存设备信息\n *\n * @param deviceInfoDto\n * @return\n */\n @RequestMapping(\"/inner/securityApi/saveDeviceInfoForDoctor\")\n Result<Boolean> saveDeviceInfoForDoctor(@RequestBody @Valid DoctorLoginDeviceInfoDto deviceInfoDto, Errors errors);\n}", "@Override\n public void configure(AuthorizationServerSecurityConfigurer security) throws Exception {\n security.tokenKeyAccess(\"permitAll()\")\n .checkTokenAccess(\"isAuthenticated()\");\n }", "@Override\n\tpublic boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)\n\t\t\tthrows Exception {\n\t\t System.err.println(\"URI -- \"+request.getRequestURL());\n\t\t if(request.getRequestURI()!=null &&\n\t\t (request.getRequestURI().contains(\"/self/login\"))) return true;\n\t\t \n\t\t \n\t\t String authHeader = request.getHeader(AUTH_HEADER);\n\t\t \n\t\t if (authHeader == null) { \n\t\t\t response.setContentType(JSON_HAL_CONTENT_TYPE);\n\t\t\t response.getOutputStream().write(TOKEN_EXPIRE_MSG.getBytes()); return false;\n\t\t }\n\t\t \n\t\t if (authHeader.contains(\"Basic \")) {\n\t\t \n\t\t String encodedUserNamePassword = authHeader.split(\"Basic \")[1]; String\n\t\t strValue = \"\";\n\t\t try\n\t\t { \n\t\t\t strValue = new String(java.util.Base64.getDecoder().decode(encodedUserNamePassword.getBytes(\n\t\t\t\t\t \t\t)), \"UTF-8\"); \n\t\t }\n\t\t catch (Exception e)\n\t\t { \n\t\t\t e.printStackTrace(); \n\t\t\t // TODO: handle exception return false; \n\t\t }\n\t\t \n\t\t String[] arrayOfString = strValue.split(\"\\\\:\");\n\t\t \n\t\t if (arrayOfString.length > 1) \n\t\t { \n\t\t\t \tString userName = arrayOfString[0]; String\n\t\t\t \tpassword = arrayOfString[1]; System.err.println(userName);\n\t\t\t \tSystem.err.println(password);\n\t\t \n\t\t\t \tpassword = Base64.getEncoder().encodeToString((password + \"\").getBytes(\"utf-8\")); \n\t\t\t \tUsernamePasswordAuthenticationToken\n\t\t\t \tusernamePasswordAuthenticationToken = new\n\t\t\t \tUsernamePasswordAuthenticationToken( userName, password);\n\t\t \n\t\t\t \tAuthentication authentication = null; \n\t\t\t \ttry { authentication =\n\t\t\t \t\t\tautheticationManager.authenticate(usernamePasswordAuthenticationToken);\n\t\t \n\t\t } catch (Exception ex) { \n\t\t\t ex.printStackTrace();\n\t\t\t response.setContentType(JSON_HAL_CONTENT_TYPE);\n\t\t\t response.getOutputStream().write(UNAUTHORISED_ACCESS_MSG.getBytes());\n\t\t \n\t\t\t return false; \n\t\t } \n\t\t if (authentication.isAuthenticated()) {\n\t\t\t SecurityContextHolder.getContext().setAuthentication(authentication);\n\t\t\t return true; \n\t\t } else { \n\t\t\t\n\t\t\tresponse.setContentType(JSON_HAL_CONTENT_TYPE);\n\t\t\t response.getOutputStream().write(UNAUTHORISED_ACCESS_MSG.getBytes()); \n\t\t\t return false; \n\t\t\t } \n\t\t } else { \n\t\t\t String encodedValue = authHeader.split(\"Basic \")[1];\n\t\t \n\t\t\t if (isValidToken(encodedValue)) return true;\n\t\t \n\t\t \tresponse.setContentType(JSON_HAL_CONTENT_TYPE);\n\t\t \tresponse.getOutputStream().write(TOKEN_EXPIRE_MSG.getBytes()); return false;\n\t\t }\n\t\t \n\t\t } \n\t\t response.setContentType(JSON_HAL_CONTENT_TYPE);\n\t\t response.getOutputStream().write(UNAUTHORISED_ACCESS_MSG.getBytes()); return\n\t\t false;\n\t\t \n\t\t\n\t}", "private LoginApi() {\n }", "@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 }", "@PreAuthorize(\"checkPermission('Legal Entity', 'Manage Legal Entities', {'view','create'})\")\n @GetMapping(\n produces = {\"application/json\"})\n @ResponseStatus(HttpStatus.OK)\n public void sampleEndpointThatRequiresUserToHavePermissionsToViewCreateLegalEnitites() {\n LOGGER.info(\"Preauthorize annotation have checked that user has permissions to view/create legal entities\");\n // continue custom implementation ...\n }", "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 }", "private ApiInfo apiDetails() {\n\t\tApiInfo apiInfo= new ApiInfoBuilder()\n\t\t\t\t.title(\"AuthorizationMicroservice Documentation\")\n\t\t\t\t.description(\"Gets the login details and checks the login details if yes it will generate a JWT token which we can use to validate the user.\")\n\t\t\t\t.termsOfServiceUrl(\"Help\")\n\t\t\t\t.license(\"Audit Management System 1.0\")\n\t\t\t\t.contact(new Contact(\"Souraj Mukhopadhyay\",\"cognizant.com\",\"[email protected]\"))\n\t\t\t\t.version(\"1.0\")\t\t\n\t\t\t\t.build();\n\t\tlog.debug(\"API Info{}:\", apiInfo);\n\t\treturn apiInfo;\n\t}", "@Override\n public void configure(AuthorizationServerEndpointsConfigurer endpoints) {\n endpoints\n .authenticationManager(authenticationManager)\n .tokenStore(jwtTokenStore) //jwt\n .accessTokenConverter(accessTokenConverter); //jwt\n }", "@Override\n\tpublic void configure(AuthorizationServerSecurityConfigurer security) throws Exception {\n\t\tsecurity.tokenKeyAccess(\"permitAll()\") //Cualquier cliente puede accesar a la ruta para generar el token\n\t\t.checkTokenAccess(\"isAuthenticated()\"); //Se encarga de validar el token\n\t}", "@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 }", "GlobalAuthorizationConfigurationBuilder authorization();", "@Override\n\tpublic void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {\n\t\t endpoints\n\t\t .tokenStore(tokenStore)// Tell which tokenStore it will use\n\t\t\t .tokenEnhancer(jwtTokenEnhancer)//Required when self signed jwt token is implemented\n\t\t\t //Not required in case of In-MemoryTokenStore and JdbcTokenStore\n\t\t\t .authenticationManager(authenticationManager);\n\t}", "public SessionManager(API api) {\n _api = api;\n }", "Pokemon.RequestEnvelop.AuthInfo.JWT getToken();", "public static void main(String args[]) throws Exception{\n\n System.setProperty(\"env\",\"qa2\");\n AnnotationConfigApplicationContext context=new AnnotationConfigApplicationContext(EnvironmentConfig.class);\n ApiController controller=context.getBean(\"apiController\",ApiController.class);\n/// System.out.println(controller.login().getBody().jsonPath().getString(\"access_token\"));\n\n controller.login();\n System.out.println(controller.createManagementCompany());\n controller.doGeoSetup();\n Thread.sleep(2000);\n System.out.println(controller.defineSegmentTypes().statusCode());\n Thread.sleep(2000);\n System.out.println(controller.defineSegmentCategoryStructure().statusCode());\n Thread.sleep(2000);\n controller.createProperty();\n Thread.sleep(2000);\n controller.createCompanySegment();\n Thread.sleep(2000);\n controller.createSegment();\n //Thread.sleep(2000);\n //controller.deactiveManagementId();\n Thread.sleep(2000);\n // controller.generateRdpData();\n // System.out.println(new Date());\n controller.createImpactEvent();\n // PropertyUser controller=context.getBean(\"propertyUser\",PropertyUser.class);\n UserPermissionData userPermissionData=new UserPermissionData();\n controller.createNewUser(UserTypeConstants.PROPERTY_USER,userPermissionData.getPropertyUserPermission());\n context.close();\n }", "@Bean\n @Override\n protected SessionAuthenticationStrategy sessionAuthenticationStrategy() {\n // required for bearer-only applications.\n // return new NullAuthenticatedSessionStrategy();\n return new RegisterSessionAuthenticationStrategy(new SessionRegistryImpl());\n }", "@Bean\n EndpointsSecurityConfig endpointsConfig() {\n return http -> http\n .pathMatchers(HttpMethod.POST, \"/api/users\", \"/api/users/login\").permitAll()\n .pathMatchers(HttpMethod.GET, \"/api/profiles/**\").permitAll()\n .pathMatchers(HttpMethod.GET, \"/api/articles/**\").permitAll()\n .pathMatchers(HttpMethod.GET, \"/api/tags/**\").permitAll()\n .anyExchange().authenticated();\n }", "private ServicioLogin() {\n super();\n }", "@Override\n\t\tpublic void configure(HttpSecurity http) throws Exception {\n\n\t\t\thttp.csrf().disable();\n\n\t\t\thttp.authorizeRequests().antMatchers(\"/oauth/token\").anonymous();\n\n\t\t\t// TODO: Why we cannot just use @PreAuthorize() ?\n\n\t\t\t// Require all GET requests to have client \"read\" scope\n\t\t\thttp.authorizeRequests().antMatchers(HttpMethod.GET, \"/rest/**\").access(\"#oauth2.hasScope('read')\");\n\t\t\t// Require all other requests to have \"write\" scope\n//\t\t\thttp.authorizeRequests().antMatchers(\"/rest/**\").access(\"#oauth2.hasScope('write')\");\n\t\t}", "@PreAuthorize(\"isAuthenticated()\")\n Feedback save(Feedback feedback);", "@Override\n protected void afterAuthenticating() {\n }", "@Override\n public void configure(AuthorizationServerSecurityConfigurer security) {\n //allow send client_id and client_secret in params\n //otherwise headers:{Authorization: 'Basic client_id:client_secret in base64}\n security.allowFormAuthenticationForClients();\n security.checkTokenAccess(\"isAuthenticated()\");\n// security.checkTokenAccess(\"permitAll()\");\n }", "public interface TestService {\n// @PreAuthorize(\"hasAuthority('test')\")\n String test();\n}", "@OAuthPostAuthorization\n public void postAuthorize() {\n }", "@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 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 }", "@Override\n public User getUserInfo() {\n return User.AUTHORIZED_USER;\n }", "public interface LifeService {\n\n String HEADER_AUTHORIZATION_KEY = \"zGuC1ylBfVvXb-acprZS0xba7IdVtdr7V2NqWO0IhF-GqIvQxuM\";\n\n @POST(\"user/login\")\n Call<LoginResponse> login(@Body LoginRequestBody requestBody);\n\n}", "SecurityProfile securityProfile();", "@Override\r\n\tprotected void configure(HttpSecurity http) throws Exception {\n\t\thttp.cors().and().csrf().disable()\r\n\t\t\r\n\t\t// make sure we use stateless session;\r\n\t\t// session won't be used to store user's state.\r\n\r\n\t\t.exceptionHandling().authenticationEntryPoint(unauthorizedHandler)\r\n\t\t.and().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()\r\n\t\t\t\t\r\n\t\t\t\t// dont authenticate this particular request\r\n\t\t\t\t.authorizeRequests().antMatchers(\"/api/auth/**\").permitAll()\r\n\t\t\t\t.antMatchers(\"/api/test/**\").permitAll()\r\n\t\t\t\t\r\n\t\t\t\t// all other requests need to be authenticated\r\n\t\t\t\t.anyRequest()\r\n\t\t\t\t.authenticated();\r\n\r\n\t\t// Add a filter to validate the tokens with every request\r\n\t\thttp.addFilterBefore(authenticationJwtTokenFilter(), UsernamePasswordAuthenticationFilter.class);\r\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 public void filter(ContainerRequestContext requestContext) throws IOException {\n String authorizationHeader =\n requestContext.getHeaderString(HttpHeaders.AUTHORIZATION);\n\n // Validate the Authorization header\n if (!isTokenBasedAuthentication(authorizationHeader)) {\n abortWithUnauthorized(requestContext);\n return;\n }\n\n // Extract the token from the Authorization header\n String token = authorizationHeader\n .substring(AUTHENTICATION_SCHEME.length()).trim();\n\n try {\n // Check if the token is valid\n validateToken(token);\n\n //extract the data you need\n String username = Jwts.parser().setSigningKey(keyGenerator.getKey()).parseClaimsJws(token).getBody().getIssuer();\n if (username!=null) {\n final SecurityContext securityContext = requestContext.getSecurityContext();\n requestContext.setSecurityContext(new SecurityContext() {\n @Override\n public Principal getUserPrincipal() {\n return new Principal() {\n @Override\n public String getName() {\n return username;\n }\n };\n }\n @Override\n public boolean isUserInRole(String permission) {\n\n List<RoleEntity> roleEntities = userDao.getUserByUsername(username).getRoleEntityList();\n List<PermissionEntity> permissionEntities = new ArrayList<>();\n\n //creating the list containg all the permissionsAllowed\n for (RoleEntity r : roleEntities) {\n for (PermissionEntity p : r.getPermissionEntityList()) {\n if (!permissionEntities.contains(p)) {\n permissionEntities.add(p);\n }\n }\n\n }\n\n List<String> permissionStrings = new ArrayList<>();\n\n //getting all the types (description and id are not important)\n for (PermissionEntity p : permissionEntities) {\n permissionStrings.add(p.getType());\n }\n\n //returns true if the list contains the permission given as parameter\n for (String p : permissionStrings) {\n if (p.equals(permission)) {\n return true;\n }\n }\n return false;\n }\n @Override\n public boolean isSecure() {\n return true;\n }\n @Override\n public String getAuthenticationScheme() {\n return AUTHENTICATION_SCHEME;\n }\n });\n }\n //getting value from annotation\n Method resourceMethod = resourceInfo.getResourceMethod();\n Secured secured = resourceMethod.getAnnotation(Secured.class);\n if (secured != null){\n List<String> permissionStrings = new ArrayList<>();\n for (SecurityPermission s : secured.permissionsAllowed()) {\n permissionStrings.add(s.getText());\n }\n\n //performing authorization\n if (permissionStrings.size() > 0 && !isAuthenticated(requestContext)) {\n refuseRequest();\n }\n\n for (String role : permissionStrings) {\n if (requestContext.getSecurityContext().isUserInRole(role)) {\n return;\n }\n else {\n throw new AuthentificationException(ExceptionMessageCatalog.NOT_ALLOWED);\n }\n }\n\n refuseRequest();\n }\n } catch (AuthentificationException e) {\n abortWithUnauthorized(requestContext);\n }\n }", "@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}", "public static void processOIDCresp(HttpServletRequest req,HttpServletResponse resp) throws IOException, InterruptedException, NoSuchAlgorithmException, InvalidKeySpecException, ClassNotFoundException, SQLException\n\t{\n\t\tHttpSession session=req.getSession();\n\t\t//check the state parameters from the response with state parameter in the session,saved during authorization request\n\t\tString state=(String)req.getParameter(\"state\");\n\t\t\n\t\tif(state!=null)\n\t\t{\n\t\t //Pick up the response type associated with the state parameters\n\t\t String response_type=(String)session.getAttribute(state);\n\t\t if(response_type!=null)\n\t\t {\n\t\t\t if(response_type.contains(\"id_token\"))\n\t\t\t {\n\t\t\t\t//If the response type contains id_token(validate the ID Token create one cookie for authenticated users and send to user agent(browser)\n\t\t\t\t//If the response type contains id_token token(validate the ID Token create one cookie for authenticated users and send to user agent(browser) \n\t\t\t\t//and when users needs to access more profile info using access token we can get it.\n\t\t\t\t \n\t\t\t\t //Decode the ID Token(headers and payload)\n\t\t\t\tArrayList<String>decodeParams=decodeIDTokeheadPay(req.getParameter(\"id_token\"));\n\t\t\t\t//Convert the JSON into key value pairs\n\t\t\t Map<String,Object> headers=processJSON(decodeParams.get(0));\n\t\t\t\tMap<String,Object> payloads=processJSON(decodeParams.get(1));\n\t\t\t\t\n\t\t\t\t//Validate the public key by sending request to issuer(URL) by passing clientid and kid as header parameters\n\t\t\t\tif(ValidateIDissuerKey((String) payloads.get(\"iss\"),(String) headers.get(\"kid\"),resp))\n\t\t\t\t {\n\t\t\t\t\t //Decoded the public key from the encoded kid for signature verifications \n\t\t\t\t\t PublicKey pubkeys=pubkeyEncoder(Base64.getDecoder().decode((String) headers.get(\"kid\")));\n\t\t\t\t\t if(ValidateTokenSignature(req.getParameter(\"id_token\"),pubkeys))\n\t\t\t\t\t {\n\t\t\t\t\t\t responseFormat(payloads,resp);\n\t\t\t\t\t\t \n\t\t\t\t\t\t //another flow of implicit(id_token token)\n\t\t\t\t\t\t if(response_type.contains(\"token\"))\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t//save the token in cookie\n\t\t\t\t\t\t\t//Create one session for that authenticated users and redirected to Home Page\n\t\t\t\t\t\t\t Cookie auth_uesr = new Cookie(\"access_token\",req.getParameter(\"access_token\"));\n\t\t\t\t\t\t\t resp.addCookie(auth_uesr);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t //Redirected to Home Page\n\t\t\t\t\t\t //if(!response_type.contains(\"code\"))\n\t\t\t\t\t\t\t//resp.sendRedirect(\"http://localhost:8080/OPENID/phoneBookHome.jsp\");\n\t\t\t\t\t }\n\t\t\t\t\t else\n\t\t\t\t\t {\n\t\t\t\t\t\t //Signature Invalid and Token become Invalid and reauthenticate again\n\t\t\t\t\t\t resp.sendRedirect(\"http://localhost:8080/OPENID/PhoneBookLogin.jsp\");\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t //issuer invalid\n\t\t\t\t\t resp.sendRedirect(\"http://localhost:8080/OPENID/PhoneBookLogin.jsp\");\n\t\t\t\t }\n\t\t\t }\n\t\t\t //Token Endpoint request for authorization code Flow\n\t\t /* if(response_type.contains(\"code\"))\n\t\t {\n\t\t \t authCodeProcessModel authModel=new authCodeProcessModel();\n\t\t \t authModel.setClientid(\"mano.lmfsktkmyj\");\n\t\t \t authModel.setClientsecret(\"mano.tpeoeothyc\");\n\t\t \t authModel.setCode((String)req.getParameter(\"code\"));\n\t\t \t authModel.setRedirecturi(\"http://localhost:8080/OPENID/msPhoneBook/response1\");\n\t\t \t \n\t\t \t //Get response from the token endpoint\n\t\t \t Map<String,Object> tokenResp=authCodeProcess(authModel,resp);\n\t\t \t //Check if the response returned any error\n\t\t \t if(tokenResp.containsKey(\"error\"))\n\t\t \t {\n\t\t \t //Token response made error redirected to signin with mano page again\n\t\t \t\t resp.sendRedirect(\"http://localhost:8080/OPENID/PhoneBookLogin.jsp\");\n\t\t \t }\n\t\t \t else\n\t\t \t {\n\t\t \t\t responseFormat(tokenResp,resp);\n\t\t \t\t //Validate ID Token\n\t\t \t\t ArrayList<String>decodeParams=decodeIDTokeheadPay((String) tokenResp.get(\"id_token\"));\n\t\t\t\t\t\t//Convert the JSON into key value pairs\n\t\t\t\t\t Map<String,Object> headers=processJSON(decodeParams.get(0));\n\t\t\t\t\t Map<String,Object> payloads=processJSON(decodeParams.get(1));\n\t\t\t\t\t \n\t\t\t\t\t//Validate the public key by sending request to issuer(URL) by passing clientid and kid as header parameters\n\t\t\t\t\t if(ValidateIDissuerKey((String) payloads.get(\"iss\"),(String) headers.get(\"kid\"),resp))\n\t\t\t\t\t {\n\t\t\t\t\t\t //true check signature\n\t\t\t\t\t\t PublicKey pubkeys=pubkeyEncoder(Base64.getDecoder().decode((String) headers.get(\"kid\")));\n\t\t\t\t\t\t //Validate the signature using public key\n\t\t\t\t\t\t if(ValidateTokenSignature((String) tokenResp.get(\"id_token\"),pubkeys))\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t //Valid the access token with the at_hash values in the ID Token\n\t\t\t\t\t\t\t //First hash the access token and compared with at_hash value in the ID Token\n\t\t\t\t\t\t\t if(payloads.get(\"at_hash\").equals(hashPass((String)tokenResp.get(\"access_token\"))))\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t //save access token along with refresh token to client database used when acces token get expired\n\t\t\t\t\t\t\t\t PhoneBookDAO.saveTokens((String)tokenResp.get(\"access_token\"),(String)tokenResp.get(\"refresh_token\"));\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t//Create one cookie for that authenticated users and redirected to Home Page and send cookie to browser\n\t\t\t\t\t\t\t\t session.setAttribute(\"enduser_name\",payloads.get(\"sub\"));\n\t\t\t\t\t\t\t\t Cookie auth_uesr = new Cookie(\"access_token\",(String) tokenResp.get(\"access_token\"));\n\t\t\t\t\t\t\t\t resp.addCookie(auth_uesr);\n\t\t\t\t\t\t\t\t //Redirected to Home Page\n\t\t\t\t\t\t\t resp.sendRedirect(\"http://localhost:8080/OPENID/phoneBookHome.jsp\");\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t //Invalid Access Token(Reauthenticate again)\n\t\t\t\t\t\t\t\t resp.sendRedirect(\"http://localhost:8080/OPENID/PhoneBookLogin.jsp\");\n\t\t\t\t\t\t\t } \n\t\t\t\t\t\t }\n\t\t\t\t\t\t else\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t //Signature invalid\n\t\t\t\t\t\t\t resp.sendRedirect(\"http://localhost:8080/OPENID/PhoneBookLogin.jsp\");\n\t\t\t\t\t\t }\n\t\t \t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t //Invalid issuers or public key(reauthenticate again)\n\t\t\t\t resp.sendRedirect(\"http://localhost:8080/OPENID/PhoneBookLogin.jsp\");\n\t\t\t }\n\t\t }\n\t\t }*/\n\t\t }\n\t\t else\n\t\t {\n\t\t\t//If the state value is not matched with the state value generated during authorization request CSRF attack\n\t\t\t//sign up again\n\t\t\t resp.sendRedirect(\"http://localhost:8080/OPENID/PhoneBookLogin.jsp\");\n\t\t }\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//state missing from server,response may be from unknown server,so sign up again\n\t\t\tresp.sendRedirect(\"http://localhost:8080/OPENID/PhoneBookLogin.jsp\");\n\t\t}\n\t}", "@Before(\"applicationPackagePointcut() && springBeanPointcut()\")\n public void retrieveClientID(JoinPoint joinPoint) throws Throwable {\n HttpServletRequest httpServletRequest = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();\n HttpSession session = httpServletRequest.getSession();\n try {\n if (httpServletRequest == null) {\n log.warn(\"Context undefined, exiting\");\n return;\n }\n\n Object clientId = session.getAttribute(Constants.CLIENT_ID);\n if (clientId != null) {\n String cId = (String) clientId;\n log.info(\"Client ID is already set to {} in the session attribute, returning\", cId);\n return;\n }\n\n // get user principal\n OAuth2Authentication auth = (OAuth2Authentication) httpServletRequest.getUserPrincipal();\n if(auth == null) {\n log.info(\"User principal is undefined (probably because of the public media api), exiting\");\n return;\n }\n\n String principal = (String) auth.getPrincipal();\n if (principal.startsWith(\"service-account-\")) {\n log.info(\"Service account login detected\");\n // Request with API token\n String[] tokens = principal.split(\"service-account-\");\n if (tokens.length != 2) {\n log.warn(\"No client found with the principal {}, exiting\", principal);\n return;\n }\n\n clientId = tokens[1];\n log.info(\"Setting client id to {} and user id to {}\", clientId, principal);\n session.setAttribute(Constants.CLIENT_ID, clientId);\n session.setAttribute(Constants.USER_ID, principal);\n return;\n }\n\n //if we are here, it means the login is user based\n // request with user login\n log.info(\"User account login detected\");\n String userId = principal;\n // ignore admin login as this is the first time\n if (userId.equals(\"admin\")) {\n log.info(\"Logged as admin, returning to the api\");\n return;\n }\n\n String token = \"Bearer \" + (OAuth2AuthenticationDetails.class.cast(auth.getDetails())).getTokenValue();\n HttpHeaders httpHeaders = new HttpHeaders();\n httpHeaders.setContentType(MediaType.APPLICATION_JSON);\n httpHeaders.add(\"Authorization\", token);\n HttpEntity<String> httpEntity = new HttpEntity(httpHeaders);\n ResponseEntity<DegaUserDTO> result = restTemplate.exchange(\n coreServiceUrl+\"dega-users/email/\"+principal, HttpMethod.GET, httpEntity, DegaUserDTO.class);\n\n DegaUserDTO user = result.getBody();\n if (user == null) {\n String errorMsg = \"No dega user found with the id \"+userId+\", exiting\";\n throw new Exception(errorMsg);\n }\n\n // get the organization\n OrganizationDTO orgDTO = user.getOrganizationCurrent();\n if (orgDTO == null) {\n String errorMsg = \"No current organization mapped to the user, exiting\";\n log.error(errorMsg);\n throw new Exception(errorMsg);\n }\n\n clientId = orgDTO.getClientId();\n log.info(\"Setting client id to {} and user id to {}\", clientId, principal);\n session.setAttribute(Constants.CLIENT_ID, clientId);\n session.setAttribute(Constants.USER_ID, principal);\n } catch (IllegalArgumentException e) {\n log.error(\"Illegal argument: {} in {}.{}()\", Arrays.toString(joinPoint.getArgs()),\n joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName());\n\n throw e;\n }\n }", "public interface CustomerService {\n \n\n public void createCustomer(CustomerDto customerDto);\n \n //@PreAuthorize(\"hasRole('ROLE_USER') or hasRole('ROLE_ADMIN')\") \n public CustomerDto getCustomer(Long id) throws DataAccessException;\n\n //@PreAuthorize(\"hasRole('ROLE_USER') or hasRole('ROLE_ADMIN')\") \n public void updateCustomer(CustomerDto customer) throws DataAccessException;\n\n //@PreAuthorize(\"hasRole('ROLE_USER') or hasRole('ROLE_ADMIN')\") \n public void removeCustomer(CustomerDto customer) throws DataAccessException;\n\n //@PreAuthorize(\"hasRole('ROLE_USER') or hasRole('ROLE_ADMIN')\") \n public Collection<CustomerDto> findAllCustomer() throws DataAccessException;\n\n //@PreAuthorize(\"hasRole('ROLE_USER') or hasRole('ROLE_ADMIN')\") \n public Collection<CustomerDto> searchCustomer(String name) throws DataAccessException;\n\n //@PreAuthorize(\"hasRole('ROLE_USER') or hasRole('ROLE_ADMIN')\")\n public CustomerDto findByUsername(String username);\n}", "@GetMapping(path = \"/addUser\")\n @PreAuthorize(\"hasAnyRole('ROLE_ADMIN')\")\n public String addUser(Model model){\n return \"addUser\";\n }", "@Bean\n @Override\n protected NullAuthenticatedSessionStrategy sessionAuthenticationStrategy() {\n return new NullAuthenticatedSessionStrategy();\n }", "@Override\n\tprotected void configure(HttpSecurity http) throws Exception {\n\t\tSystem.setProperty(\"keycloak.enabled\", applicationProperties.getMode() != Mode.keycloak ? \"false\" : \"true\");\n\t\thttp\n\t\t\t// disable csrf because of API mode\n\t\t\t.csrf().disable().sessionManagement()\n\t\t\t// use previously declared bean\n\t\t\t.sessionAuthenticationStrategy(sessionAuthenticationStrategy())\n\t\t\t.sessionCreationPolicy(SessionCreationPolicy.STATELESS);\n\t\tif(this.applicationProperties.getMode() == Mode.basic) {\n\t\t\thttp.httpBasic().authenticationEntryPoint(unauthorizedEntryPoint());\n\t\t\thttp.authorizeRequests().antMatchers(HttpMethod.OPTIONS).permitAll()\n\t\t\t// Autorize GET requests for all roles\n\t .antMatchers(HttpMethod.GET, \"/**\")\n\t .hasAnyRole(adminRole, webclientRole, helpdeskRole, managerRole, batchRole)\n\t // Coleman Batch \n\t // Autorize Coleman batch to execute POST \n\t .antMatchers(HttpMethod.POST, \"/campaigns/**/management-monitoring-info\")\n\t .hasAnyRole(adminRole, webclientRole, batchRole, managerRole)\n\t .antMatchers(HttpMethod.POST, \"/campaigns/**/management-monitoring-infos\").hasAnyRole(adminRole, webclientRole, batchRole)\n\t .antMatchers(HttpMethod.POST, \"/campaigns/**/survey-units\").hasAnyRole(adminRole, webclientRole, batchRole)\n\t\t\t\t\t// Autorize POST FollowUp\n\t\t\t\t\t.antMatchers(HttpMethod.POST, \"/campaigns/**/survey-units/**/follow-up\").hasAnyRole(adminRole, webclientRole)\n\t // Autorize manager to create and update campaigns\n\t .antMatchers(HttpMethod.POST, \"/campaigns\").hasAnyRole(adminRole, webclientRole)\n\t .antMatchers(HttpMethod.PUT, \"/campaigns/**\").hasAnyRole(adminRole, webclientRole)\n\t .antMatchers(HttpMethod.DELETE, \"/campaigns/**\").hasAnyRole(adminRole, webclientRole, managerRole)\n\t .antMatchers(HttpMethod.DELETE, \"/management-monitoring-infos/**\").hasAnyRole(adminRole, webclientRole, managerRole)\n\t .antMatchers(HttpMethod.DELETE, \"/uploads/**\").hasAnyRole(adminRole, webclientRole, managerRole)\n\t .antMatchers(HttpMethod.POST, \"/campaigns/**/uploads\").hasAnyRole(adminRole, webclientRole, managerRole)\n\t .anyRequest().denyAll(); // refuse all other requests\n\t\t}else{\n\t\t\thttp.httpBasic().disable();\n\t\t\thttp.authorizeRequests().antMatchers(HttpMethod.OPTIONS).permitAll()\n\t\t\t// configuration for endpoints\n\t\t\t.antMatchers(\"/campaigns/**/management-monitoring-info\",\n\t\t\t\t\t\"/campaigns/**/management-monitoring-infos\",\n\t\t\t\t\t\"/campaigns/**/survey-units\",\n\t\t\t\t\t\"/campaigns/**/uploads\",\n\t\t\t\t\t\"/campaigns\",\n\t\t\t\t\t\"/campaigns/**\",\n\t\t\t\t\t\"/management-monitoring-infos/**\",\n\t\t\t\t\t\"/uploads/**\",\n\t\t\t\t\t\"/swagger-ui.html\")\n\t\t\t.permitAll();\n\t\t}\n\t}", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n http.cors().and().csrf().disable()\n .exceptionHandling().authenticationEntryPoint(jwtAuthenticationEntryPoint)\n .and()\n .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)\n .and()\n .authorizeRequests().antMatchers(\"/users\", \"/session\").permitAll()\n .anyRequest().authenticated()\n .and()\n .addFilter(jwtAuthenticationFilter());\n }", "@Override\n public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {\n endpoints.authenticationManager(authenticationManager);\n// .tokenStore(tokenStore()).accessTokenConverter(accessTokenConverter());\n }", "public interface ApiService {\n //登陆接口\n @POST(AppURLManager.REQ_LOGIN_PATH)\n Flowable<LoginRespInfo> appLogin(@Body LoginReqModel params);\n}", "@Override\n\tprotected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)\n\t\t\tthrows ServletException, IOException {\n\t\tresponse.addHeader(\"Access-Control-Allow-Origin\", \"*\");\n\t\tresponse.addHeader(\"Access-Control-Allow-Headers\", \n\t\t\t\t\"Origin, Accept, X-Requested-With, Content-Type,\"\n\t\t\t\t+ \"Access-Control-Request-Method, \"\n\t\t\t\t+ \"Access-Control-Request- Headers,\"\n\t\t\t\t+ \"Authorization\");\n\t\t\n\t\tresponse.addHeader(\"Access-Control-Expose-Headers\", \"Access-Control-Allow-Origin, Access-Control-Allow-Credentials, Authorization\");\n\t\t \n\t\t//Verifier si le token exist dans la requette header et le prefix \n\t\tString jwt = request.getHeader(SecurityConstants.HEADER_STRING);\n\t\tSystem.out.println(jwt);\n\t\tif(request.getMethod().equals(\"OPTIONS\")) {\n\t\t\tresponse.setStatus(HttpServletResponse.SC_OK);\n\t\t} \n\t\telse {\n\t\t\tif(jwt == null || !jwt.startsWith(SecurityConstants.TOKEN_PREFIX)) {\n\t\t\t\tfilterChain.doFilter(request, response);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tClaims claims = Jwts.parser()\n\t\t\t\t.setSigningKey(SecurityConstants.SECRET)\n\t\t\t\t.parseClaimsJws(jwt.replace(SecurityConstants.TOKEN_PREFIX, \"\"))\n\t\t\t\t.getBody();\n\t\t\t\t\n\t\t\t\t// Subject contient le username a recuperer\n\t\t\t\tString username = claims.getSubject();\n\t\t\t\tArrayList<Map<String, String>> roles = (ArrayList<Map<String, String>>) claims.get(\"roles\");\n\t\t\t\t//auhorities define le role de l'utilisateur \n\t\t\t\tCollection<GrantedAuthority> authorities = new ArrayList<>();\n\t\t\t\troles.forEach(r -> {\n\t\t\t\tauthorities.add(new SimpleGrantedAuthority(r.get(\"authority\")));\t\t\n\t\t\t\t});\n\t\t\t\t//Recuperer l'identité de l'utilisateur qui a envoyer la requette \n\t\t\t\tUsernamePasswordAuthenticationToken authenticateUser = \n\t\t\t\t\t\tnew UsernamePasswordAuthenticationToken(username , null, authorities);\n\t\t\t\t\t\tSecurityContextHolder.getContext().setAuthentication(authenticateUser);\n\t\t\t\t\t\tfilterChain.doFilter(request, response);\t\t\t\t\t\n\t\t}\n\t\t\n\t}", "public static void example2(ApiEndpoint apiEndpoint, String email, String password) {\n System.out.println(\"--- EXAMPLE 2 ---\");\n try {\n HashMap<String, String> params = new HashMap<>();\n\n System.out.print(\"Retrieving authToken...\");\n AuthToken authToken = AuthService.getAuthToken(apiEndpoint, email, password);\n System.out.println(\"Done!\");\n\n System.out.print(\"Retrieving Vehicle List...\");\n // Uncomment following line, if you want to include the vehicles the user has been granted read rights to.\n //params.put(\"includeAccessGrantVehicles\", \"true\");\n ActionResponse vResp = AuthService.runAction(apiEndpoint, authToken, \"v1/vehicle\", ActionTypes.GET, params, null);\n System.out.println(\"Done!\");\n System.out.println(\"Response \"+vResp.httpCode+\": \"+vResp.jsonArray.toJSONString());\n\n System.out.print(\"Retrieving first vehicle(including all vehicle states) from previous response...\");\n JSONObject firstV = (JSONObject)(vResp.jsonArray.get(0));\n params.clear();\n // we are settings all 'with*' to true here in order to retrieve all vehicle information and not just basic meta data\n params.put(\"withBase\", \"true\");\n params.put(\"withRemoteFunctionsState\", \"true\");\n params.put(\"withLockState\", \"true\");\n params.put(\"withClimaState\", \"true\");\n params.put(\"withDrivingState\", \"true\");\n params.put(\"withGeoState\", \"true\");\n params.put(\"withBatteryState\", \"true\");\n params.put(\"includeAccessGrantVehicles\", \"true\");\n ActionResponse singlevResp = AuthService.runAction(apiEndpoint, authToken, \"v1/vehicle/\"+firstV.get(\"id\"), ActionTypes.GET, params, null);\n System.out.println(\"Done!\");\n System.out.println(\"Response \"+singlevResp.httpCode+\": \"+singlevResp.jsonObject.toJSONString());\n\n // Print out SoC\n JSONObject baseState = (JSONObject)(singlevResp.jsonObject.get(\"base\"));\n if(baseState != null) {\n System.out.println(\"Vehicle SoC: \" + baseState.get(\"soc\"));\n }\n\n } catch (RcmsClientException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n System.out.println(\"--- END OF EXAMPLE 2 ---\");\n }", "@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 }", "@GetMapping(\"/api/v1/login\")\n public String login() {\n return \"Success\";\n }", "@ApiOperation(value=\"Login\", notes=\"Login action\")\n @RequestMapping(value=\"/user/logout\",method= RequestMethod.POST)\n @ResponseBody\n public RetObject logoutHomeconnect(@ApiParam(value = \"account logout\", required = true)@RequestHeader(value = \"PlatID\", required = true) String platID,@RequestHeader(value = \"AppID\", required = false) String appID,\n @RequestHeader HttpHeaders httpHeaders,\n\t\t\t\t\t@RequestHeader(value = \"AccessToken\", required = true) String AccessToken,\n @RequestBody(required = false) LoginReqVO body){\n String url = \"/api/translator/user/logout\";\n RetObject result = RetObject.fail();\n Map<String,String> headerMap = new HashedMap();\n headerMap.put(\"PlatID\", platID);\n headerMap.put(\"AppID\", appID);\n String headers = getJSONString(headerMap);\n String bodyText = getJSONString(body);\n Error headerError = validateHeaders(platID,appID);\n Error bodyError = validateLoginBodyError(body);\n if (bodyError == null && headerError == null){\n result = RetObject.success();\n }\n return result;\n}", "public static void initApiSession(HttpServletRequest request, IApplicationSettings settings)\n {\n \n ViewLearningToolRequestParams parameters = getParams(request.getParameterMap());\n ValidateQueryString(request, settings, parameters);\n // Store received parameters to the session state\n storeParametersToSession(parameters, request.getSession(), settings.getApplicationKey(), settings.getSharedSecret());\n }", "@Override\r\n\tprotected void configure(HttpSecurity http) throws Exception {\r\n\t\thttp.csrf().disable() // Disable csrf for REST API\r\n\t\t\t\t.authorizeRequests()\r\n\t\t\t\t.antMatchers(HttpMethod.POST, SIGN_UP_URL).permitAll() // permit without authentication\r\n\t\t\t\t.antMatchers(HttpMethod.POST, SecurityConstants.FEEDBACK_URL).permitAll()\r\n\t\t\t\t.antMatchers(HttpMethod.GET, SecurityConstants.FEEDBACK_URL).permitAll()\r\n\t\t\t\t.antMatchers(\"/v2/api-docs\",\r\n \"/configuration/ui\",\r\n \"/swagger-resources/**\",\r\n \"/configuration/security\",\r\n \"/swagger-ui.html\",\r\n \"/webjars/**\").permitAll()\r\n\t\t\t\t.anyRequest() // for any other request\r\n\t\t\t\t.authenticated() // do authentication\r\n\t\t\t\t.and().addFilter(getAuthenticaitonFilter()) // Add Authentication Filter\r\n\t\t\t\t.addFilter(new AuthorizationFilter(authenticationManager(), userRepository)).sessionManagement()\r\n\t\t\t\t.sessionCreationPolicy(SessionCreationPolicy.STATELESS);\r\n\t}", "@PreAuthorize(\"hasAuthority('ROLE_USER')\") //got a 401 event though my antMatcher was set to allow all for dist\n @GetMapping(\"distance/{id}\")\n public ResponseEntity<?> getDistanceById(@PathVariable(\"id\") Integer id) throws ResourceNotFoundException{\n log.info(\"getDistanceById\");\n Distance distance = distanceService.getDistanceById(id);\n if (distance == null){\n // return new ResponseEntity<CustomErrorMsg>(new CustomErrorMsg(\"Distance ID \" + id + \" Not Found\"),HttpStatus.NOT_FOUND);\n throw new ResourceNotFoundException(\"Distance ID \" + id + \" Not Found\");\n }\n return new ResponseEntity<Distance>(distance, HttpStatus.OK);\n }", "private boolean isAuthorized() {\n return true;\n }", "void preTokenRequest() throws MsalUiRequiredException, MsalUserCancelException,\n MsalServiceException, MsalClientException {\n mAuthRequestParameters.getAuthority().resolveEndpoints(\n mAuthRequestParameters.getRequestContext(),\n mAuthRequestParameters.getLoginHint()\n );\n }", "public interface UserService {\r\n\r\n\t/**\r\n\t * Returns the user account for the given username.\r\n\t *\r\n\t * @param username\r\n\t * \t\tusername\r\n\t *\r\n\t * @return user account or <code>null</code>\r\n\t */\r\n\t@PreAuthorize(\"hasRole('ROLE_USER')\")\r\n\tpublic UserAccount findUserAccountByUsername(String username);\r\n\r\n\t/**\r\n\t * Returns the user account for the given primary key.\r\n\t *\r\n\t * @param uuid\r\n\t * \t\tprimary key as uuid\r\n\t *\r\n\t * @return user account or <code>null</code>\r\n\t */\r\n\t@PreAuthorize(\"hasRole('ROLE_USER')\")\r\n\tpublic UserAccount findUserAccountByPrimaryKey(String uuid);\r\n\r\n\t/**\r\n\t * Checks if the given username is still available.\r\n\t *\r\n\t * @param username\r\n\t * \t\tusername to check\r\n\t *\r\n\t * @return <code>true</code> if that username is still available\r\n\t */\r\n\t@PreAuthorize(\"hasRole('ROLE_USER')\")\r\n\tpublic boolean isUsernameAvailable(String username);\r\n\r\n\t/**\r\n\t * Creates a new user account.\r\n\t *\r\n\t * @return <code>true</code> if the account was created\r\n\t */\r\n\tpublic void createUserAccount(UserAccount account);\r\n\r\n\t/**\r\n\t * Update an existing user account.\r\n\t *\r\n\t * @return <code>true</code> if the account was updated\r\n\t */\r\n\t@PreAuthorize(\"hasRole('ROLE_USER')\")\r\n\tpublic void updateUserAccount(UserAccount account);\r\n\r\n}", "private void setupEndpoints() {\n\t\tpost(API_CONTEXT + \"/users\", \"application/json\", (request, response) -> {\n\t\t\t//response.status(201);\n\t\t\treturn userService.createNewUser(request.body());\n\t\t}, new JsonTransformer());\n\t\t\n\t\tpost(API_CONTEXT + \"/login\", \"application/json\", (request, response) -> {\n\t\t\t//response.status(201);\n\t\t\treturn userService.find(request.body());\n\t\t}, new JsonTransformer());\n\t\t\n\t\tput(API_CONTEXT + \"/users\", \"application/json\", (request, response)\n\t\t\t\t-> userService.update(request.body()), new JsonTransformer());\n\t\t\n\t\tdelete(API_CONTEXT + \"/users/:email\", \"application/json\", (request, response)\n\t\t\t\t-> userService.deleteUser(request.params(\":email\")), new JsonTransformer());\n\n\t}", "@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 protected void doFilterInternal(\n HttpServletRequest request, HttpServletResponse response, FilterChain chain)\n throws ServletException, IOException {\n\n String token = Optional.ofNullable(request.getHeader(TokenDTO.TOKEN_HEADER))\n .filter(a -> a.startsWith(\"Bearer \"))\n .map(a -> a.replaceAll(\"^Bearer \", \"\"))\n .orElseGet(() -> request.getParameter(\"token\"));\n\n // We should exclude some API methods used for confirm email from this filter\n // due to they have the same parameter as 'token'\n if (token == null ||\n request.getServletPath().startsWith(\"/user/validate-reset-token\") ||\n request.getServletPath().startsWith(\"/user/confirm-email\")) {\n chain.doFilter(request, response);\n return;\n }\n\n try {\n //Validate and parse JWT token, check token expiration.\n DecodedJWT decodedJwt = loginService.decodeJwt(token);\n\n Long id = decodedJwt.getClaim(\"id\").asLong();\n User user = userService.getUserById(id);\n if (user == null) {\n throw new UnauthorizedException(\"No such user with id= \" + id);\n }\n\n List<Role> roles = Collections.singletonList(user.getRole());\n Collection<SimpleGrantedAuthority> authorityList = getSimpleGrantedAuthorities(\n roles);\n\n List<Long> projectIds = projectService.getProjectsByUserId(user.getId()).stream()\n .map(Project::getId)\n .collect(Collectors.toList());\n\n AuthenticatedUser credentials = new AuthenticatedUser(user.getId(), user.getEmail(),\n token,\n authorityList, projectIds,\n user.isLocked() || user.isBlockedByAdmin());\n\n if (!credentials.isAccountNonLocked()) {\n setResponseErrorMsg(response, \"User Account is locked!\");\n return;\n }\n\n Authentication jwtAuthentication =\n new UsernamePasswordAuthenticationToken(credentials, \"\",\n credentials.getAuthorities());\n\n SecurityContextHolder.getContext().setAuthentication(jwtAuthentication);\n } catch (JWTDecodeException | SignatureVerificationException e) {\n setResponseErrorMsg(response, \"JWT token is not valid\");\n return;\n } catch (TokenExpiredException e) {\n setResponseErrorMsg(response, \"JWT token has expired\");\n return;\n } catch (Exception e) {\n setResponseErrorMsg(response, \"JWT authentication failed\");\n return;\n }\n\n chain.doFilter(request, response);\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 }", "public boolean supportsPreemptiveAuthorization() {\n/* 225 */ return true;\n/* */ }", "@Override\n\tpublic void configure(AuthorizationServerSecurityConfigurer oauthServer) throws Exception {\n\t\toauthServer.tokenKeyAccess(\"permitAll()\").checkTokenAccess(\"isAuthenticated()\");\n\t}", "public abstract I_Authenticate getSecurityCtx();", "@PreAuthorize(\"hasRole('ADMIN')\")\n public ProductDto retrieveAuthorizedProducts() { \n return new ProductDto(\"1\", \"iPhone\", 999.99f);\n }", "@PostMapping(\"/login\") //method handles POST requests with this path (login)\n public ResponseEntity<?> authenticateUser(@Valid @RequestBody LoginRequest loginRequest) {\n Authentication authentication = authenticationManager.authenticate(\n new UsernamePasswordAuthenticationToken(loginRequest.getUsername(), loginRequest.getPassword()));\n\n // update the SecurityContext\n SecurityContextHolder.getContext().setAuthentication(authentication);\n\n // generate JWT token\n String jwt = jwtUtils.generateJwtToken(authentication);\n\n // get UserDetails\n UserDetailsImpl userDetails = (UserDetailsImpl) authentication.getPrincipal();\n List<String> roles = userDetails.getAuthorities().stream()\n .map(GrantedAuthority::getAuthority)\n .collect(Collectors.toList());\n\n // return response with JWT token and UserDetails\n return ResponseEntity.ok(new JwtResponse(jwt,\n userDetails.getId(),\n userDetails.getUsername(),\n userDetails.getEmail(),\n roles,\n userDetails.getCategory()\n ));\n }", "@Override\n public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {\n endpoints.tokenServices(tokenServices);\n }", "@RequestMapping(\"/api/user\")\r\npublic interface UserController {\r\n\t\r\n @ApiOperation(value = \"Login user\")\r\n @ApiResponses(value = {\r\n \t\t@ApiResponse(code = 200, message = \"Successfully logued\"),\r\n \t\t@ApiResponse(code = 409, message = \"Fail login\"),\r\n \t\t@ApiResponse(code = 409, message = \"Internal server error\")\r\n })\r\n @PostMapping(path = \"/login\", produces = \"application/json\")\r\n public ResponseEntity<?> login(@RequestBody UserToLoginDto userToLoginDto);\r\n}", "public interface EcAuthService {\n\n /**\n * 接口信息鉴权\n * @param appKey appKey\n * @param appSecrect appSecrect\n * @param url 路径\n * @return 鉴权类信息\n */\n AuthResp auth(String appKey, String appSecrect, String url);\n}", "@Override\n\tprotected void configure(HttpSecurity httpSecurity) throws Exception {\n\t\t// This code creates rules that requires authentication for all endpoints except\n\t\t// /registration and enables HTTP basic authentication.\n\t\thttpSecurity.cors().and().csrf().disable().authorizeRequests().antMatchers(AUTH_WHITELIST).permitAll()\n\t\t\t\t.antMatchers(HttpMethod.POST, \"/auth/v1/signup\", \"/auth/v1/confirmEmail\").permitAll().anyRequest().authenticated().and()\n\t\t\t\t.addFilter(new AuthenticationFilter(authenticationManager(), tokenUtil))\n\t\t\t\t.addFilter(new AuthorizationFilter(authenticationManager(), tokenUtil)).sessionManagement()\n\t\t\t\t.sessionCreationPolicy(SessionCreationPolicy.STATELESS);\n\t}", "private boolean validateAccessToken(String clientId, String clientSecret) {\n log.info(\"Client Id:{} Client Secret:{}\", clientId, clientSecret);\n\n // Enable the Below code when the Introspection URL is ready to test\n /**\n * String auth = clientId + clientSecret; RestTemplate restTemplate = new RestTemplate();\n * HttpHeaders headers = new HttpHeaders(); headers.add(\"Content-Type\",\n * MediaType.APPLICATION_JSON_VALUE); headers.add(\"Authorization\", \"Basic \" +\n * Base64.getEncoder().encodeToString(auth.getBytes())); HttpEntity<String> request = new\n * HttpEntity<String>(headers);\n *\n * <p>log.info(\"Sending Token Intropsection request to Endpoint::::: {}\",\n * tokenIntrospectionURL); ResponseEntity<String> response =\n * restTemplate.exchange(tokenIntrospectionURL, HttpMethod.POST, request, String.class); *\n */\n return true;\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 }", "@Override\n protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {\n String jwtToken = jwtUtilService.extractJwtFromRequest(request);\n\n // Don't need to get the password or give it our own user obj because at this point\n // We would have already passed our Spring config and just need to pass the token\n\n // StringUtils.hasText checks to make sure token is not null and length is greater than 0\n // Using service method to see if it is a valid token\n if (StringUtils.hasText(jwtToken) && jwtUtilService.validateToken(jwtToken)) {\n UserDetails userDetails = new User(jwtUtilService.getUsernameFromToken(jwtToken), \"\",\n jwtUtilService.getRolesFromToken(jwtToken));\n\n logger.info(\"Reached to here\");\n // These steps by pass the need for AuthManager because it produces a full Authentication object\n UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken = new UsernamePasswordAuthenticationToken(\n userDetails, null, userDetails.getAuthorities());\n // After setting the Authentication in the context, we specify\n // that the current user is authenticated. So it passes the\n // Spring Security Configurations successfully.\n logger.info(\"UP Auth Token: \" + usernamePasswordAuthenticationToken);\n SecurityContextHolder.getContext().setAuthentication(usernamePasswordAuthenticationToken);\n } else {\n logger.info(\"Cannot set the Security Context\");\n\n }\n\n filterChain.doFilter(request, response);\n\n }", "@Override\n protected void configure(HttpSecurity http) throws Exception {\n http\n // comunication between client and server is stateless\n .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()\n\n // for unauthorized request send 401 error\n .exceptionHandling().authenticationEntryPoint(restAuthenticationEntryPoint).and()\n\n // don't authenticate this particular request\n .authorizeRequests()\n .antMatchers(HttpMethod.GET, \"/hello\").permitAll()\n\n\n // all other requests need to be authenticated\n .anyRequest().authenticated().and();\n\n // intercept every request and add filter\n http.addFilterBefore(jwtRequestFilter, UsernamePasswordAuthenticationFilter.class);\n\n //http.csrf().disable();\n http.cors().and().csrf().disable();\n\n\t\t/* http.headers().addHeaderWriter(\n new StaticHeadersWriter(\"Access-Control-Allow-Origin\", \"*\"));*/\n\n }", "public String getAPI()\n {\n ResponseEntity<String> person;\n\n /*\n\t\t * Headers for the response type if we want to return JSON response then we\n\t\t * require to add.\n */\n HttpHeaders headers = new HttpHeaders();\n\n /*\n\t\t * Adding of the response header with application/json type\n */\n headers.add(\"Accept\", \"application/json\");\n\n /*\n\t\t * Creation of the Entity object for the adding the headers into request.\n */\n entity = new HttpEntity<>(headers);\n\n /*\n\t\t * Creation of REST TEMPLET object for the executing of the REST calls.\n */\n restTemplate = new RestTemplate();\n\n /*\n\t\t * Adding the basic type of authentication on the REST TEMPLETE.\n */\n restTemplate.getInterceptors()\n .add(new BasicAuthorizationInterceptor(\"Administrator\", \"Oneeight@admin18\"));\n\n /*\n\t\t * Execution of the REST call with basic authentication and JSON response type\n */\n person = restTemplate.exchange(\"http://52.172.222.197:8080/versa/login?username=Administrator&password=Oneeight@admin18\", HttpMethod.POST, entity, String.class);\n System.out.println(\"\"+person.toString());\n //headers.add(\"Cookie\", \"JSESSIONID=0FC37952D64B545C46969EFEC0E4FD12\");\n headers.add(\"Cookie\", person.getHeaders().getFirst(HttpHeaders.SET_COOKIE));\n entity = new HttpEntity<>(headers);\n person = restTemplate.exchange(\"http://52.172.222.197:8080/versa/analytics/v1.0.0/data/provider/tenants/OneEight/features/SDWAN/?qt=summary&start-date=1daysAgo&end-date=today&q=linkusage(site)&metrics=volume-rx&metrics=volume-tx&metrics=volume-rx&metrics=volume-tx&metrics=bandwidth&ds=aggregate&count=10\", HttpMethod.GET, entity, String.class);\n\n /*\n\t\t * Returning the response body with string format that easily readable.\n */\n return person.getBody();\n }", "public boolean isAuthRequired() {\n\t\treturn false;\n\t}", "public interface UserRepository extends JpaRepository<User, Long> {\n @Override\n @PreAuthorize(\"#oauth2.hasScope('read')\")\n List<User> findAll();\n\n @PreAuthorize(\"#oauth2.hasScope('read')\")\n User findById(Long Id);\n\n @PreAuthorize(\"#oauth2.hasScope('read')\")\n User findByName(String name);\n\n @Override\n @PreAuthorize(\"#oauth2.hasScope('write')\")\n <S extends User> S save(S entity);\n}", "@Override\n\tpublic boolean preHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler) throws Exception {\n\t\tString sessionId = request.getHeader(\"sid\");\n\t\tif (sessionId == null || \"\".equals(sessionId)) {\n\t\t\tsessionId = request.getParameter(\"sid\");\n\t\t}\n\t\tString url = request.getRequestURL().toString();\n\t\tif (url.contains(\"admin_user/login\") || url.contains(\"admin_user/test\")\n\t\t\t\t|| url.contains(\"admin_app/download_app\")\n\t\t\t\t|| url.contains(\"admin_user/login_out\")\n\t\t\t\t|| url.contains(\"admin_app/add_app_report\")\n\t\t\t\t|| url.contains(\"admin_user/getDesKey\")) {\n\t\t\treturn true;\n\t\t}\n\t\tResult result = new Result();\n\t\tObjectMapper om = new ObjectMapper();\n\t\tif (StringUtils.isEmpty(sessionId)) {\n\t\t\tresult.setCode(Constance.RESPONSE_USER_ERROR);\n\t\t\tresult.setMsg(\"请登陆!\");\n\t\t\tresponse.setContentType(\"application/json;charset=utf-8\");\n\t\t\tresponse.getWriter().print(om.writeValueAsString(result));\n\t\t\treturn false;\n\t\t}\n\t\tsessionId = Constance.REDIS_USER_PRE + sessionId;\n\t\tif (redisUtil.get(sessionId) == null\n\t\t\t\t|| StringUtils.isEmpty(redisUtil.get(sessionId).toString())) {\n\t\t\tresult.setCode(Constance.RESPONSE_USER_ERROR);\n\t\t\tresult.setMsg(\"请登陆!\");\n\t\t\tresponse.setContentType(\"application/json;charset=utf-8\");\n\t\t\tresponse.getWriter().print(om.writeValueAsString(result));\n\t\t\treturn false;\n\t\t}\n\t\tString userId = redisUtil.get(sessionId).toString();\n\t\tUser user = userMapper.getUserById(userId);\n\n\t\tif (user.getRole() == (short) 1) {\n\t\t\trequest.setAttribute(\"userId\", redisUtil.get(sessionId).toString());\n\t\t\tredisUtil.set(sessionId, request.getAttribute(\"userId\").toString(),\n\t\t\t\t\tLong.valueOf(10 * 60));\n\t\t\t// 校验权限\n\t\t\tboolean bool = checkedAuthorityByAdminAcount(userId, url);\n\t\t\tif (!bool) {\n\t\t\t\tresult.setCode(Constance.RESPONSE_AUTH_ERROR);\n\t\t\t\tresult.setMsg(\"您无权进行此操作!\");\n\t\t\t\tresponse.setContentType(\"application/json;charset=utf-8\");\n\t\t\t\tresponse.getWriter().print(om.writeValueAsString(result));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tresult.setCode(Constance.RESPONSE_AUTH_ERROR);\n\t\t\tresult.setMsg(\"您无权进行此操作!\");\n\t\t\tresponse.setContentType(\"application/json;charset=utf-8\");\n\t\t\tresponse.getWriter().print(om.writeValueAsString(result));\n\t\t\treturn false;\n\t\t}\n\t}", "public interface ApiService {\n\n\n // Upload Documents image\n @POST(\"document_upload\")\n Call<ResponseBody> uploadDocumentImage(@Body RequestBody RequestBody, @Query(\"token\") String token);\n\n // Upload Profile image\n @POST(\"upload_profile_image\")\n Call<ResponseBody> uploadProfileImage(@Body RequestBody RequestBody, @Query(\"token\") String token);\n\n\n //Login\n @GET(\"login\")\n Call<ResponseBody> login(@Query(\"mobile_number\") String mobilenumber, @Query(\"user_type\") String usertype, @Query(\"country_code\") String countrycode, @Query(\"password\") String password, @Query(\"device_id\") String deviceid, @Query(\"device_type\") String devicetype, @Query(\"language\") String language);\n\n\n //Login\n @GET(\"vehicle_details\")\n Call<ResponseBody> vehicleDetails(@Query(\"vehicle_id\") long vehicleid, @Query(\"vehicle_name\") String vehiclename, @Query(\"vehicle_type\") String vehicletype, @Query(\"vehicle_number\") String vehiclenumber, @Query(\"token\") String token);\n\n //Forgot password\n @GET(\"forgotpassword\")\n Call<ResponseBody> forgotpassword(@Query(\"mobile_number\") String mobile_number,@Query(\"user_type\") String user_type, @Query(\"country_code\") String country_code, @Query(\"password\") String password, @Query(\"device_type\") String device_type, @Query(\"device_id\") String device_id, @Query(\"language\") String language);\n\n\n @GET(\"add_payout\")\n Call<ResponseBody> addPayout(@Query(\"email_id\") String emailId, @Query(\"user_type\") String userType, @Query(\"token\") String token);\n\n\n //Cancel trip\n @GET(\"cancel_trip\")\n Call<ResponseBody> cancelTrip(@Query(\"user_type\") String type, @Query(\"cancel_reason\") String cancel_reason, @Query(\"cancel_comments\") String cancel_comments, @Query(\"trip_id\") String trip_id, @Query(\"token\") String token);\n\n //Forgot password\n @GET(\"accept_request\")\n Call<ResponseBody> acceptRequest(@Query(\"user_type\") String type, @Query(\"request_id\") String request_id, @Query(\"status\") String status, @Query(\"token\") String token);\n\n //Confirm Arrival\n @GET(\"cash_collected\")\n Call<ResponseBody> cashCollected(@Query(\"trip_id\") String trip_id, @Query(\"token\") String token);\n\n //Confirm Arrival\n @GET(\"arive_now\")\n Call<ResponseBody> ariveNow(@Query(\"trip_id\") String trip_id, @Query(\"token\") String token);\n\n //Begin Trip\n @GET(\"begin_trip\")\n Call<ResponseBody> beginTrip(@Query(\"trip_id\") String trip_id, @Query(\"begin_latitude\") String begin_latitude, @Query(\"begin_longitude\") String begin_longitude, @Query(\"token\") String token);\n\n //End Trip\n @POST(\"end_trip\")\n Call<ResponseBody> endTrip(@Body RequestBody RequestBody);\n\n /*//End Trip\n @GET(\"end_trip\")\n Call<ResponseBody> endTrip(@Query(\"trip_id\") String trip_id, @Query(\"end_latitude\") String begin_latitude, @Query(\"end_longitude\") String begin_longitude, @Query(\"token\") String token);*/\n\n //Trip Rating\n @GET(\"trip_rating\")\n Call<ResponseBody> tripRating(@Query(\"trip_id\") String trip_id, @Query(\"rating\") String rating,\n @Query(\"rating_comments\") String rating_comments, @Query(\"user_type\") String user_type, @Query(\"token\") String token);\n\n\n // Update location with lat,lng and driverStatus\n @GET(\"updatelocation\")\n Call<ResponseBody> updateLocation(@QueryMap HashMap<String, String> hashMap);\n\n\n @GET(\"update_device\")\n Call<ResponseBody> updateDevice(@QueryMap HashMap<String, String> hashMap);\n\n\n // driverStatus Check\n @GET(\"check_status\")\n Call<ResponseBody> updateCheckStatus(@QueryMap HashMap<String, String> hashMap);\n\n @GET(\"earning_chart\")\n Call<ResponseBody> updateEarningChart(@QueryMap HashMap<String, String> hashMap);\n\n @GET(\"driver_rating\")\n Call<ResponseBody> updateDriverRating(@QueryMap HashMap<String, String> hashMap);\n\n @GET(\"rider_feedback\")\n Call<ResponseBody> updateRiderFeedBack(@QueryMap HashMap<String, String> hashMap);\n\n @GET(\"get_rider_profile\")\n Call<ResponseBody> getRiderDetails(@QueryMap HashMap<String, String> hashMap);\n\n //Number Validation\n @GET(\"register\")\n Call<ResponseBody> registerOtp(@Query(\"user_type\") String type, @Query(\"mobile_number\") String mobilenumber, @Query(\"country_code\") String countrycode, @Query(\"email_id\") String emailid, @Query(\"first_name\") String first_name, @Query(\"last_name\") String last_name, @Query(\"password\") String password, @Query(\"city\") String city, @Query(\"device_id\") String device_id, @Query(\"device_type\") String device_type,@Query(\"language\") String languageCode);\n\n @GET(\"driver_trips_history\")\n Call<ResponseBody> driverTripsHistory(@QueryMap HashMap<String, String> hashMap);\n\n //Driver Profile\n @GET(\"get_driver_profile\")\n Call<ResponseBody> getDriverProfile(@Query(\"token\") String token);\n\n\n\n //Driver Profile\n @GET(\"driver_bank_details\")\n Call<ResponseBody> updateBankDetails(@QueryMap HashMap<String, String> hashMap);\n\n //Currency list\n @GET(\"currency_list\")\n Call<ResponseBody> getCurrency(@Query(\"token\") String token);\n\n //language Update\n @GET(\"language\")\n Call<ResponseBody> language(@Query(\"language\") String languageCode, @Query(\"token\") String token);\n\n // Update User Currency\n @GET(\"update_user_currency\")\n Call<ResponseBody> updateCurrency(@Query(\"currency_code\") String currencyCode, @Query(\"token\") String token);\n\n @GET(\"update_driver_profile\")\n Call<ResponseBody> updateDriverProfile(@QueryMap LinkedHashMap<String, String> hashMap);\n\n //Upload Profile Image\n @POST(\"upload_image\")\n Call<ResponseBody> uploadImage(@Body RequestBody RequestBody, @Query(\"token\") String token);\n\n //Sign out\n @GET(\"logout\")\n Call<ResponseBody> logout(@Query(\"user_type\") String type, @Query(\"token\") String token);\n\n //Add payout perference\n @FormUrlEncoded\n @POST(\"add_payout_preference\")\n Call<ResponseBody> addPayoutPreference(@Field(\"token\") String token, @Field(\"address1\") String address1, @Field(\"address2\") String address2, @Field(\"email\") String email, @Field(\"city\") String city, @Field(\"state\") String state, @Field(\"country\") String country, @Field(\"postal_code\") String postal_code, @Field(\"payout_method\") String payout_method);\n\n //Payout Details\n @GET(\"payout_details\")\n Call<ResponseBody> payoutDetails(@Query(\"token\") String token);\n\n //Get Country List\n @GET(\"country_list\")\n Call<ResponseBody> getCountryList(@Query(\"token\") String token);\n\n //List of Stripe Supported Countries\n @GET(\"stripe_supported_country_list\")\n Call<ResponseBody> stripeSupportedCountry(@Query(\"token\") String token);\n\n //Get pre_payment\n @GET(\"payout_changes\")\n Call<ResponseBody> payoutChanges(@Query(\"token\") String token, @Query(\"payout_id\") String payout_id, @Query(\"type\") String type);\n\n // Add stripe payout preference\n @POST(\"add_payout_preference\")\n Call<ResponseBody> uploadStripe(@Body RequestBody RequestBody, @Query(\"token\") String token);\n\n // this api called to resume the trip from MainActivity while Driver get-in to app\n @GET(\"incomplete_trip_details\")\n Call<ResponseBody> getInCompleteTripsDetails(@Query(\"token\") String token);\n\n // get Trip invoice Details Rider\n @GET(\"get_invoice\")\n Call<ResponseBody> getInvoice(@Query(\"token\") String token,@Query(\"trip_id\") String TripId,@Query(\"user_type\") String userType);\n\n //Force Update API\n @GET(\"check_version\")\n Call<ResponseBody> checkVersion(@Query(\"version\") String code, @Query(\"user_type\") String type, @Query(\"device_type\") String deviceType);\n\n //Check user Mobile Number\n @GET(\"numbervalidation\")\n Call<ResponseBody> numbervalidation(@Query(\"mobile_number\") String mobile_number, @Query(\"country_code\") String country_code, @Query(\"user_type\") String user_type, @Query(\"language\") String language, @Query(\"forgotpassword\") String forgotpassword);\n\n\n//Get Bank Details Prefernce\n /* @GET(\"driver_bank_details\")\n Call<ResponseBody> driver_bank_details(@Query(\"account_holder_name\") String account_holder_name, @Query(\"account_number\") String account_number, @Query(\"bank_location\") String bank_location, @Query(\"bank_name\") String bank_name, @Query(\"token\") String token,@Query(\"user_type\")String user_type);\n*/\n}", "@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 public void configure(AuthorizationServerSecurityConfigurer oauthServer) throws Exception {\n //oauthServer.realm(REALM);\n oauthServer.tokenKeyAccess(\"permitAll()\")\n .checkTokenAccess(\"isAuthenticated()\")\n //.passwordEncoder(this.passwordEncoder)\n .allowFormAuthenticationForClients();\n\n }", "@Override\n protected void successfulAuthentication(HttpServletRequest req,\n HttpServletResponse res,\n FilterChain chain,\n Authentication auth) throws IOException {\n\n log.info(\"Authentication succeed!\");\n UserDetailsImpl user = (UserDetailsImpl) auth.getPrincipal();\n Collection authorities = user.getAuthorities();\n String token = authService.generateOrGetToken(user);\n ReimsUser.Role role = authService.getRoleByString(authorities.iterator().next().toString());\n\n // retrieve informative response for frontend needs\n res.setHeader(HEADER_STRING, token);\n UserResponse userResponse = new UserResponse();\n userResponse.setUsername(user.getUsername());\n userResponse.setId(user.getUserId());\n userResponse.setRole(role);\n\n // Creating Object of ObjectMapper define in Jackson Api\n ObjectMapper objectMapper = new ObjectMapper();\n\n String userJsonString = objectMapper.writeValueAsString(userResponse);\n\n PrintWriter out = res.getWriter();\n res.setContentType(\"application/json\");\n res.setCharacterEncoding(\"UTF-8\");\n out.print(userJsonString);\n out.flush();\n\n Session session = Session.builder().token(token).username(user.getUsername()).role(role).build();\n authService.registerOrUpdateSession(session);\n }", "public interface LoginService {\n\n /**\n * 登录\n *\n * @param data\n * @param req\n * @return\n */\n @ClearAuth\n @Route( code = RouteCode.Ou.LOGIN )\n MemberDTO login( MemberDTO data, RequestMsg req );\n\n /**\n * 注册\n *\n * @param member\n * @param terminal\n * @return\n */\n @ClearAuth\n @Validator\n @Route( code = RouteCode.Ou.REGISTER )\n MemberDTO register( @Valid( groups = Register.class ) MemberDTO member, RequestMsg req );\n\n /**\n * 免密登录\n * <p> 不验证密码直接登录 <p/>\n *\n * @param memberId\n * @param terminal\n * @param ip\n * @param loginInfo\n * @return\n */\n MemberDTO loginNoPwd( Integer memberId, String terminal, String ip, LoginInfoDTO loginInfo );\n\n /**\n * 注册时发送验证码\n *\n * @param mobile\n */\n @ClearAuth\n @Route( code = RouteCode.Ou.SEND_VCODE_4_REGISTER )\n void sendVcode4Register( String mobile );\n\n /**\n * 完善用户资料\n *\n * @param member\n * @param req\n */\n void accomplishMember( MemberDTO member, RequestMsg req );\n}", "@Override\n public boolean isClientAuthEnabled() {\n return true;\n }", "@Override\n protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain,\n Authentication authResult) throws IOException, ServletException {\n ApiUser apiUser = this.apiUsersService.getApiUserByUserName(((User) authResult.getPrincipal()).getUsername());\n String jwtToken = Jwts.builder()\n .setSubject(((User) authResult.getPrincipal()).getUsername())\n .setExpiration(new Date(System.currentTimeMillis() + EXPIRATION_TIME))\n .claim(\"authorities\", ((User) authResult.getPrincipal()).getAuthorities().toArray())\n .claim(\"firstName\", apiUser.getFirstName())\n .claim(\"lastName\", apiUser.getLastName())\n .claim(\"apiUserId\", apiUser.getId())\n .signWith(SignatureAlgorithm.HS512, SECRET.getBytes(StandardCharsets.UTF_8))\n .compact();\n try {\n response.getWriter().write(TOKEN_PREFIX + jwtToken);\n this.eventsService.createEvent(new Event(\"Logged In\", apiUser,\n new Date(System.currentTimeMillis()).getTime(), false));\n } catch (Exception e) {\n authLogger.warn(e.getMessage());\n throw (e);\n }\n response.setStatus(HttpServletResponse.SC_ACCEPTED);\n }", "public interface OAuth2ControllerInterface {\n\n String OAUTH2_CONFIG = \"/oauth2/config\";\n String OAUTH2_ACCESS_TOKEN = \"/oauth2/access-token\";\n String OAUTH2_API_PROTECTION_TOKEN = \"/oauth2/api-protection-token\";\n String OAUTH2_API_USER_INFO = \"/oauth2/user-info\";\n\n @GetMapping(OAUTH2_CONFIG)\n OAuth2Config getOAuth2Config();\n\n @GetMapping(OAUTH2_ACCESS_TOKEN)\n ResponseEntity getAccessToken(@RequestParam String code) throws Exception;\n\n @GetMapping(OAUTH2_API_PROTECTION_TOKEN)\n ResponseEntity getApiProtectionToken(@RequestParam String ujwt) throws Exception;\n\n @PostMapping(OAUTH2_API_USER_INFO)\n ResponseEntity getUserInfo(@RequestBody UserInfoRequest userInfoRequest) throws Exception;\n\n}", "AbstractJwtSessionModule() {\n jwtBuilderFactory = new JwtBuilderFactory();\n }", "@PreAuthorize(\"hasAuthority('ROLE_ADMIN')\")\n @RequestMapping\n public String admin() {\n return \"admin\";\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 }", "private org.json.JSONObject getUserInfo(String url, String token) throws Exception {\n log.info(\"Entering getUserInfo\");\n RestTemplate restTemplateWithInterceptors = new RestTemplate();\n HttpStatus status = null;\n org.json.JSONObject body = null;\n String message = null;\n\n if(!token.substring(0, 7).equals(\"Bearer \")) {\n token = \"Bearer \" + token;\n }\n log.info(\"Just added Bearer as token prefix\");\n\n try {\n List<ClientHttpRequestInterceptor> interceptors = restTemplateWithInterceptors.getInterceptors();\n if (CollectionUtils.isEmpty(interceptors)) {\n interceptors = new ArrayList<>();\n }\n\n interceptors.add(new XCIJVUserInfoHeaderInjectorInterceptor(token));\n restTemplateWithInterceptors.setInterceptors(interceptors);\n log.info(\"Just set interceptor to list\");\n HttpHeaders headers = new HttpHeaders();\n HttpEntity<?> entityUserInfo = new HttpEntity<>(headers);\n log.info(\"HttpEntity<?> entityUserInfo: {}\", entityUserInfo);\n log.info(\"getUserInfo: url: {}\", url);\n HttpEntity<String> response = restTemplateWithInterceptors.exchange(url, HttpMethod.GET, entityUserInfo, String.class);\n log.info(\"Just did carrier userinfo REST call using userinfo_endpoint\");\n body = new org.json.JSONObject(response.getBody());\n\n } catch (RestClientResponseException e) {\n\n if (e.getRawStatusCode() == 401) {\n status = HttpStatus.UNAUTHORIZED;\n message = \"Unauthorized token\";\n log.error(\"HTTP 401: \" + message);\n throw new OauthException(message, status);\n }\n\n if (e.getResponseBodyAsByteArray().length > 0) {\n message = new String(e.getResponseBodyAsByteArray());\n } else {\n message = e.getMessage();\n }\n status = HttpStatus.BAD_REQUEST;\n log.error(\"HTTP 400: \" + message);\n throw new OauthException(message, status);\n\n } catch (Exception e) {\n message = \"Error in calling Bank app end point\" + e.getMessage();\n status = HttpStatus.INTERNAL_SERVER_ERROR;\n log.error(\"HTTP 500: \" + message);\n throw new OauthException(message, status);\n }\n log.info(\"Leaving getUserInfo\");\n\n return body;\n }", "private void debugAuthentcation() {\n\n\t\t/*\n\t\t * XPagesUtil.showErrorMessage(\"bluemix util: serviceName: \" +\n\t\t * serviceName + \", baseUrl: \" + baseUrl + \" username: \" + username +\n\t\t * \" password: \" + password);\n\t\t * XPagesUtil.showErrorMessage(\"bluemix util: service name: \" +\n\t\t * serviceName + \", hardcodedBaseUrl: \" + hardcodedBaseUrl +\n\t\t * \" hardcodedUsername: \" + hardcodedUsername + \" hardcodedPassword: \" +\n\t\t * hardcodedPassword);\n\t\t */\n\t}", "private static Object doAuth(Request req, Response res) {\n \n HashMap<String, String> response = new HashMap<>();\n\t\t \n String email = Jsoup.parse(req.queryParams(\"email\")).text();\n\t\t String password = Jsoup.parse(req.queryParams(\"password\")).text();\n\t\t\n res.type(Path.Web.JSON_TYPE);\n \t\t\n\t\t\n\t\tif(email != null && !email.isEmpty() && password != null && !password.isEmpty() ) {\n \n authenticate = new Authenticate(password);\n\t\t\t//note that the server obj has been created during call to login()\n\t\t\tString M2 = authenticate.getM2(server);\n\t\t\t\n if(M2 != null || !M2.isEmpty()) {\n \n \n\t\t\tSession session = req.session(true);\n\t\t\tsession.maxInactiveInterval(Path.Web.SESSION_TIMEOUT);\n\t\t\tUser user = UserController.getUserByEmail(email);\n\t\t\tsession.attribute(Path.Web.ATTR_USER_NAME, user.getUsername());\n session.attribute(Path.Web.ATTR_USER_ID, user.getId().toString()); //saves the id as String\n\t\t\tsession.attribute(Path.Web.AUTH_STATUS, authenticate.authenticated);\n\t\t\tsession.attribute(Path.Web.ATTR_EMAIL, user.getEmail());\n logger.info(user.toString() + \" Has Logged In Successfully\");\n \n response.put(\"M2\", M2);\n response.put(\"code\", \"200\");\n response.put(\"status\", \"success\");\n response.put(\"target\", Path.Web.DASHBOARD);\n \n String respjson = gson.toJson(response);\n logger.info(\"Final response sent By doAuth to client = \" + respjson);\n res.status(200);\n return respjson;\n }\n\t\t\t\t\n\t\t} \n \n res.status(401);\n response.put(\"code\", \"401\");\n response.put(\"status\", \"Error! Invalid Login Credentials\");\n \n return gson.toJson(response);\n }", "boolean authNeeded();", "@Override\n\tpublic void validateConfigurationWithoutLogin() {\n\t\tcheckAuthorization();\n\t}", "@Override\n public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {\n endpoints.authenticationManager(authenticationManager)\n .tokenStore(tokenStore());\n\n if (env.getUsejwttokenconverter())\n endpoints.accessTokenConverter(tokenEnhance());\n }", "private ApiInfo getApiInfo()\n {\n Contact contact = new Contact(\"Melchior Vrolijk\", \"\",\"[email protected]\");\n\n return new ApiInfo(\n \"Spring boot secure API documentation\",\n \"This is the demo spring boot secure api project documentation\",\n \"1.0\",\"\",contact,\n \"\",\"\",Collections.emptyList());\n }", "public void authenticate(LoginRequest loginRequest) {\n\n }", "@Override\n /**\n * Handles a HTTP GET request. This implements obtaining an authentication token from the server.\n */\n protected void handleGet(Request request, Response response) throws IllegalStateException {\n String username = String.valueOf(request.getAttributes().get(\"username\"));\n String password = String.valueOf(request.getAttributes().get(\"password\"));\n /* Construct MySQL Query. */\n String query = \"SELECT COUNT(id) AS `CNT`, `authToken` FROM accounts WHERE `username` = '\" + username + \"' AND \" +\n \"`password` = '\" + password + \"' LIMIT 0,1;\";\n /* Obtain the account count and existing token pair, as object array. */\n Object[] authenticationArray = dataHandler.handleAuthentication(database.ExecuteQuery(query,\n new ArrayList<String>()));\n int cnt = (int) authenticationArray[0];\n String existingToken = (String) authenticationArray[1];\n String authenticationToken = null;\n if (cnt == 1) { // There is exactly one account matching the parameterised username and password.\n if (existingToken == null) { // No token yet existed, generate one.\n authenticationToken = TokenGenerator.getInstance().generateAuthenticationToken(TOKEN_LENGTH);\n } else {\n authenticationToken = existingToken;\n }\n } else {\n this.returnStatus(response, new IllegalArgumentStatus(null));\n }\n if (!(authenticationToken == null || authenticationToken == \"\")) { // Update the database with the new token.\n Database.getInstance().ExecuteUpdate(\"UPDATE `accounts` SET `authToken` = '\" + authenticationToken +\n \"', `authTokenCreated` = CURRENT_TIMESTAMP WHERE `username` = '\" + username + \"';\",\n new ArrayList<String>());\n this.returnResponse(response, authenticationToken, new TokenSerializer());\n } else {\n this.returnStatus(response, new IllegalArgumentStatus(null));\n }\n }", "@O2BearerToken\n @GET\n @Path(\"/token\")\n public Response bearerAuthorizedGet(@Context final SecurityContext c) {\n return Response.ok().build();\n }", "@Override\n\tprotected void checkLoginRequired() {\n\t\treturn;\n\t}", "@Test\n\tpublic void homePageAccessibleWithToken() throws Exception {\n\t\tmvc.perform(get(\"/\").header(\"Authorization\", \"Bearer FOO\"))\n\t\t\t\t.andExpect(status().isNotFound());\n\t}" ]
[ "0.6223224", "0.6062447", "0.5881205", "0.58767325", "0.58230764", "0.5795497", "0.5759824", "0.5712928", "0.57060903", "0.56407917", "0.56111246", "0.56097996", "0.56011593", "0.55788416", "0.55750555", "0.5573749", "0.55419546", "0.55360204", "0.5482023", "0.54652804", "0.54532355", "0.5452262", "0.54516923", "0.54505086", "0.5445164", "0.54424745", "0.5410594", "0.5405149", "0.539241", "0.53922164", "0.53810215", "0.53791475", "0.53766876", "0.5367748", "0.53378516", "0.53313994", "0.5328084", "0.5323863", "0.5312751", "0.5311401", "0.5308771", "0.5302225", "0.52985114", "0.52948374", "0.5282965", "0.52809924", "0.5268262", "0.5264811", "0.5258067", "0.52568567", "0.5252857", "0.5248276", "0.52481616", "0.5240741", "0.52380145", "0.52362037", "0.52266335", "0.5221789", "0.52175844", "0.5212027", "0.52114284", "0.52099097", "0.52096355", "0.51878995", "0.5185666", "0.5185055", "0.51787716", "0.5176881", "0.51745206", "0.5153551", "0.51489353", "0.5145059", "0.5133016", "0.512577", "0.5125637", "0.51232284", "0.5121508", "0.51201063", "0.5119737", "0.5113891", "0.51068527", "0.5106344", "0.5102298", "0.50998706", "0.5098482", "0.50942194", "0.5089326", "0.5087101", "0.50774467", "0.5074071", "0.50704366", "0.5070365", "0.50627166", "0.5060763", "0.50540763", "0.5053143", "0.5049256", "0.5048882", "0.50467277", "0.5045727" ]
0.5418441
26
patch old apk and patch file to new apk
public static native PatchResult patch(String oldApkPath, String patchPath, String newApkPath);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void fixDexElementsForProtectedApp(Application application, Object[] newDexElements) throws Exception {\n Field zipField = null;\n Field dexFileField = null;\n final Field mFileNameField = ShareReflectUtil.findField(DexFile.class, \"mFileName\");\n final Field mCookieField = ShareReflectUtil.findField(DexFile.class, \"mCookie\");\n final Field mInternalCookieField = ShareReflectUtil.findField(DexFile.class, \"mInternalCookie\");\n\n // Always ignore the last element since it should always be the base.apk.\n for (int i = 0; i < newDexElements.length - 1; ++i) {\n final Object newElement = newDexElements[i];\n\n if (zipField == null && dexFileField == null) {\n zipField = ShareReflectUtil.findField(newElement, \"zip\");\n dexFileField = ShareReflectUtil.findField(newElement, \"dexFile\");\n }\n\n final DexFile origDexFile = oldDexFiles.get(i);\n final String origFileName = (String) mFileNameField.get(origDexFile);\n final Object origCookie = mCookieField.get(origDexFile);\n final Object origInternalCookie = mInternalCookieField.get(origDexFile);\n\n final DexFile dupOrigDexFile = DexFile.loadDex(application.getApplicationInfo().sourceDir, null, 0);\n mFileNameField.set(dupOrigDexFile, origFileName);\n mCookieField.set(dupOrigDexFile, origCookie);\n mInternalCookieField.set(dupOrigDexFile, origInternalCookie);\n\n dexFileField.set(newElement, dupOrigDexFile);\n\n // Just for better looking when dump new classloader.\n // Avoid such output like this: DexPathList{zip file: /xx/yy/zz/uu.odex}\n final File newZip = (File) zipField.get(newElement);\n final String newZipPath = (newZip != null ? newZip.getAbsolutePath() : null);\n if (newZipPath != null && !newZipPath.endsWith(\".zip\") && !newZipPath.endsWith(\".jar\") && !newZipPath.endsWith(\".apk\")) {\n zipField.set(newElement, null);\n }\n }\n }", "public static void createNewBundleInternal(String patchBundleName,ZipFile source, List<ZipEntry> entryList, File target, boolean isDiff, MergeExcutorServices.PrepareCallBack prepareCallBack) throws IOException, MergeException {\n byte[] buffer = new byte[BUFFEREDSIZE];\n ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(target)));\n BufferedOutputStream bo = new BufferedOutputStream(out);\n InputStream in;\n //先写入source中未变的文件\n java.util.Enumeration e = source.entries();\n Boolean isSourceHasDex = false;\n Boolean isPatchHasDex = false;\n ZipEntry originalDex = null;\n ZipEntry patchDex = null;\n File outDex;\n\n while (e.hasMoreElements()) {\n ZipEntry zipEnt = (ZipEntry) e.nextElement();\n String name = zipEnt.getName();\n /**\n * 差量更新需要做dex merge, 过滤出classes.dex\n */\n if (isDiff && name.equals(\"classes.dex\")) {\n// originalDex = zipEnt;\n isSourceHasDex = true;\n continue;\n }\n\n boolean toBeDeleted = isBundleFileUpdated(zipEnt,entryList);\n\n if (!toBeDeleted) {\n\n ZipEntry newEntry = new ZipEntry(name);\n if (name.contains(\"raw/\")||name.contains(\"assets/\")){\n newEntry.setMethod(ZipEntry.STORED);\n newEntry.setCrc(zipEnt.getCrc());\n newEntry.setSize(zipEnt.getSize());\n }\n out.putNextEntry(newEntry);\n in = source.getInputStream(zipEnt);\n write(in, out, buffer);\n bo.flush();\n\n }\n }\n\n if (!isSourceHasDex && isDiff) {\n throw new MergeException(\"Original bundle has no dex\");\n }\n\n //最后写入patch中的内容\n// File[] patchFiles = patch.listFiles();\n// for (File patchFile : patchFiles) {\n// /**\n// * 差量更新需要做dex merge, 过滤出classes.dex\n// */\n// if (isDiff && patchFile.getName().equals(\"classes.dex\")) {\n// patchDex = patchFile;\n// isPatchHasDex = true;\n// MergeExcutorServices.needMergeCount.incrementAndGet();\n// continue;\n// }\n// zip(out, patchFile, patchFile.getName(), bo);\n//\n// }\n for(ZipEntry entry : entryList){\n if(isDiff && (entry.getName().endsWith(\"classes.dex\"))){\n patchDex = entry;\n isPatchHasDex =true;\n MergeExcutorServices.needMergeCount.incrementAndGet();\n continue;\n }\n ZipEntry newEntry = new ZipEntry(entry.getName().substring(entry.getName().indexOf(\"/\")+1));\n if (newEntry.getName().contains(\"raw/\")||newEntry.getName().contains(\"assets/\")){\n newEntry.setMethod(ZipEntry.STORED);\n newEntry.setCrc(entry.getCrc());\n newEntry.setSize(entry.getSize());\n }\n out.putNextEntry(newEntry);\n in = MergeExcutorServices.sZipPatch.getInputStream(entry);\n write(in, out, buffer);\n bo.flush();\n }\n /**\n * 差量更新需要做dex merge\n */\n if (isDiff) {\n // Merge patch dex with origin dex\n if (isPatchHasDex && isSourceHasDex) {\n //发出merge申请\n// File outDexDir = new File(patch, \"out\");\n ByteArrayOutputStream outDexStream=new ByteArrayOutputStream();\n dexMerge(patchBundleName,source, patchDex, outDexStream, prepareCallBack);\n// if (outDexStream.exists()) {\n// /**\n// * caculate the merged dex md5 and report\n// */\n// String md5 = Md5Utils.getFileMD5String(outDex);\n// MonitorReport.getInstance().trace(source.getName(), md5, \"\" + outDex.length());\n// }\n// zip(out, outDex, outDex.getName(), bo);\n ByteArrayInputStream swapStream = new ByteArrayInputStream(outDexStream.toByteArray());\n ZipEntry entry = new ZipEntry(\"classes.dex\");\n out.putNextEntry(entry);\n write(swapStream,out,buffer);\n bo.flush();\n } else if (isSourceHasDex) {\n // Patch has no classes.dex, just use the original dex\n// outDex = new File(patch, \"classes.dex\");\n// inputStreamToFile(source.getInputStream(originalDex), outDex);\n// zip(out, outDex, outDex.getName(), bo);\n ZipEntry entry = new ZipEntry(\"classes.dex\");\n out.putNextEntry(entry);\n in = source.getInputStream(source.getEntry(\"classes.dex\"));\n write(in,out,buffer);\n bo.flush();\n }\n }else {\n MergeExcutorServices.successCount.incrementAndGet();\n }\n\n closeQuitely(out);\n closeQuitely(bo);\n }", "@Test\n public void testApplyToOldFile() throws IOException, PatchFailedException {\n Path oldFile = scratch.file(\"/root/oldfile\", \"line one\");\n Path newFile = scratch.file(\"/root/newfile\", \"line one\");\n Path patchFile =\n scratch.file(\n \"/root/patchfile\",\n \"--- oldfile\",\n \"+++ newfile\",\n \"@@ -1,1 +1,2 @@\",\n \" line one\",\n \"+line two\");\n PatchUtil.apply(patchFile, 0, root);\n ImmutableList<String> newContent = ImmutableList.of(\"line one\", \"line two\");\n assertThat(FileSystemUtils.readLines(oldFile, UTF_8)).isEqualTo(newContent);\n // new file should not change\n assertThat(FileSystemUtils.readLines(newFile, UTF_8)).containsExactly(\"line one\");\n }", "public static void applyPatch(File oldFile, File patchFile, File newFile) throws IOException {\n // Figure out temp directory\n File tempFile = File.createTempFile(\"fbftool\", \"tmp\");\n File tempDir = tempFile.getParentFile();\n tempFile.delete();\n FileByFileV1DeltaApplier applier = new FileByFileV1DeltaApplier(tempDir);\n try (FileInputStream patchIn = new FileInputStream(patchFile);\n BufferedInputStream bufferedPatchIn = new BufferedInputStream(patchIn);\n FileOutputStream newOut = new FileOutputStream(newFile);\n BufferedOutputStream bufferedNewOut = new BufferedOutputStream(newOut)) {\n applier.applyDelta(oldFile, bufferedPatchIn, bufferedNewOut);\n bufferedNewOut.flush();\n }\n }", "public static String openApkAndUpdatePackage(String fileName, Context mContext) {\n File file = new File(mContext.getExternalFilesDir(null), fileName);\n Intent unKnownSourceIntent = new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES).setData(Uri.parse(String.format(\"package:%s\", mContext.getPackageName())));\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n if (!mContext.getPackageManager().canRequestPackageInstalls()) {\n ((Activity) mContext).startActivityForResult(unKnownSourceIntent, OPEN_APK_UPDATE_PACKAGE_CODE);\n } else {\n Uri fileUri = FileProvider.getUriForFile(mContext, mContext.getPackageName() + \".provider\", file);\n Intent intent = new Intent(Intent.ACTION_VIEW, fileUri);\n intent.putExtra(Intent.EXTRA_NOT_UNKNOWN_SOURCE, true);\n intent.setDataAndType(fileUri, \"application/vnd.android.package-archive\");\n intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);\n intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n mContext.startActivity(intent);\n }\n } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n Intent intent1 = new Intent(Intent.ACTION_INSTALL_PACKAGE);\n Uri uri = FileProvider.getUriForFile(mContext, mContext.getPackageName() + \".provider\", file);\n mContext.grantUriPermission(mContext.getPackageName(), uri, Intent.FLAG_GRANT_READ_URI_PERMISSION);\n mContext.grantUriPermission(mContext.getPackageName(), uri, Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\n intent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n intent1.setDataAndType(uri, \"application/*\");\n intent1.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n intent1.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\n mContext.startActivity(intent1);\n } else {\n Intent intent = new Intent(Intent.ACTION_VIEW);\n Uri uri = Uri.fromFile(file);\n intent.setDataAndType(uri, \"application/vnd.android.package-archive\");\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n mContext.startActivity(intent);\n }\n return fileName;\n }", "@Test\n public void testApplyToNewFile() throws IOException, PatchFailedException {\n Path newFile = scratch.file(\"/root/newfile\", \"line one\");\n newFile.setReadable(true);\n newFile.setWritable(true);\n newFile.setExecutable(true);\n Path patchFile =\n scratch.file(\n \"/root/patchfile\",\n \"--- oldfile\",\n \"+++ newfile\",\n \"@@ -1,1 +1,2 @@\",\n \" line one\",\n \"+line two\");\n PatchUtil.apply(patchFile, 0, root);\n ImmutableList<String> newContent = ImmutableList.of(\"line one\", \"line two\");\n assertThat(FileSystemUtils.readLines(newFile, UTF_8)).isEqualTo(newContent);\n // Make sure file permission is preserved.\n assertThat(newFile.isReadable()).isTrue();\n assertThat(newFile.isWritable()).isTrue();\n assertThat(newFile.isExecutable()).isTrue();\n }", "public static void main(String[] args) throws Exception {\n// GameConfig gameConfig = new GameConfig();\n// gameConfig.setGameDir(\"G:\\\\amber2\\\\03_tools\\\\AndriodPackage\\\\Release\\\\GameApk\\\\product_anysdk-release.apk\");\n// gameConfig.setGameOutDir(\"G:\\\\amber2\\\\03_tools\\\\AndriodPackage\\\\Release\\\\GameFolder\");\n// gameConfig.setChannelDir(\"G:\\\\amber2\\\\03_tools\\\\AndriodPackage\\\\Release\\\\ChannelApk\\\\AnySDK_haima.apk\");\n// gameConfig.setChannelOutDir(\"G:\\\\amber2\\\\03_tools\\\\AndriodPackage\\\\Release\\\\ChannelFolder\");\n// gameConfig.setUnitDir(\"G:\\\\amber2\\\\03_tools\\\\AndriodPackage\\\\Release\\\\UniteFolder\");\n// gameConfig.setUnitOutDir(\"G:\\\\amber2\\\\03_tools\\\\AndriodPackage\\\\Release\\\\UniteApk\");\n// IniConfig iniConfig = new IniConfig();\n// gameConfig.setIniConfig(iniConfig);\n// Map<String, Config> configs = new HashMap<String, Config>(8);\n// iniConfig.setConfigs();\n\n decode(gameApk, gameFolder);\n decode(channelApk, channelFolder);\n mergeFolder(channelFolder, gameFolder);\n\n encodeApk(gameFolder, UniteApk + \"\\\\new.apk\");\n signApk(UniteApk + \"\\\\new.apk\");\n if (useAndroidSigner) {\n optimizeApk(UniteApk + \"\\\\new.apk\");\n } else {\n optimizeApk(UniteApk + \"\\\\Signed.apk\");\n }\n\n }", "public String ApkZipAlign(String apkname) {\n\t\tString outname = null;\r\n Runtime rn=Runtime.getRuntime();\r\n try{\r\n \toutname = apkname.substring(0, apkname.lastIndexOf(\".\"))+\"Align.apk\";\r\n \tSystem.out.println(\"ZipAlign \"+outname); \r\n \tFile zipalignf = new File(outname);\r\n \tif(zipalignf.exists())\r\n \t\tzipalignf.delete();\r\n \t\r\n \tProcess process = rn.exec(JarPath+\"zipalign -v 4 \"+apkname+\" \"+outname); \t \t\r\n \tWatchThread wt = new WatchThread(process); \r\n \twt.start(); \r\n \tprocess.waitFor();\r\n \twt.setOver(true); \r\n \twt.join();\r\n \t\r\n \tif(!new File(outname).exists())\r\n \t{\r\n \toutputstr(\"Error: ZipAlign \"+apkname);\r\n \treturn null; \r\n \t}\r\n \telse\r\n \t{\r\n \t\tnew File(apkname).delete();\r\n \t}\r\n }catch(Exception e){\r\n \toutputstr(\"Error: ZipAlign \"+apkname);\r\n \treturn null; \r\n } \t\t\r\n\t\treturn outname;\r\n\t}", "public void patch (File appdir, File patch, ProgressObserver obs)\n throws IOException\n {\n // save this information for later\n _obs = obs;\n _plength = patch.length();\n\n try (ZipFile file = new ZipFile(patch)) {\n Enumeration<? extends ZipEntry> entries = file.entries();\n while (entries.hasMoreElements()) {\n ZipEntry entry = entries.nextElement();\n String path = entry.getName();\n long elength = entry.getCompressedSize();\n\n // depending on the suffix, we do The Right Thing (tm)\n if (path.endsWith(CREATE)) {\n path = strip(path, CREATE);\n log.info(\"Creating \" + path + \"...\");\n createFile(file, entry, new File(appdir, path));\n\n } else if (path.endsWith(PATCH)) {\n path = strip(path, PATCH);\n log.info(\"Patching \" + path + \"...\");\n patchFile(file, entry, appdir, path);\n\n } else if (path.endsWith(DELETE)) {\n path = strip(path, DELETE);\n log.info(\"Removing \" + path + \"...\");\n File target = new File(appdir, path);\n if (!FileUtil.deleteHarder(target)) {\n log.warning(\"Failure deleting '\" + target + \"'.\");\n }\n\n } else {\n log.warning(\"Skipping bogus patch file entry: \" + path);\n }\n\n // note that we've completed this entry\n _complete += elength;\n }\n }\n }", "public void editManifest() {\n byte[] arrby;\n AXmlEditor aXmlEditor = new AXmlEditor();\n File file = new File((Object)Environment.getExternalStorageDirectory() + \"/BIKINAPLIKASI/tmp/AndroidManifest.xml\");\n try {\n this.copyManifest(file);\n }\n catch (IOException iOException) {\n iOException.printStackTrace();\n }\n ArrayList arrayList = new ArrayList();\n File file2 = new File((Object)Environment.getExternalStorageDirectory() + \"/BIKINAPLIKASI/tmp\", \"AndroidManifest.xml\");\n try {\n byte[] arrby2;\n arrby = arrby2 = FileUtil.readFile(file2);\n }\n catch (IOException iOException) {\n iOException.printStackTrace();\n arrby = null;\n }\n try {\n aXmlEditor.read((List<String>)arrayList, arrby);\n }\n catch (IOException iOException) {\n iOException.printStackTrace();\n }\n String string = StringUtils.join((Collection<String>)arrayList, \"\\n\").replaceFirst(\"namatoko\", this.username).replace((CharSequence)\"namatoko.situsbelanja.com\", (CharSequence)(this.username + \".situsbelanja.com\")).replace((CharSequence)\"namatoko.olshp.com\", (CharSequence)(this.username + \".olshp.com\")).replace((CharSequence)\"domainbikinaplikasionlineshop.com\", (CharSequence)this.dataPref.getWebsite()).replace((CharSequence)\"Nama Toko\", (CharSequence)this.namaaplikasi).replaceFirst(\"com.bikinaplikasi.onlineshop\", \"com.bikinaplikasi.\" + this.username).replaceFirst(\"com.bikinaplikasi.onlineshop.permission.C2D_MESSAGE\", \"com.bikinaplikasi.\" + this.username + \".permission.C2D_MESSAGE\").replaceFirst(\"com.bikinaplikasi.onlineshop.google_measurement_service\", \"com.bikinaplikasi.\" + this.username + \".google_measurement_service\").replace((CharSequence)\"android:debuggable=\\\"true\\\"\", (CharSequence)\"android:debuggable=\\\"false\\\"\").replace((CharSequence)\"4.47\", (CharSequence)(this.versi + \".0\"));\n Integer.parseInt((String)this.versi);\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n File file3 = new File((Object)Environment.getExternalStorageDirectory() + \"/BIKINAPLIKASI/tmp\", \"AndroidManifest.xml\");\n try {\n this.out = new FileOutputStream(file3);\n }\n catch (FileNotFoundException fileNotFoundException) {\n fileNotFoundException.printStackTrace();\n }\n try {\n aXmlEditor.write(string.toString(), (OutputStream)byteArrayOutputStream);\n }\n catch (IOException iOException) {\n iOException.printStackTrace();\n }\n try {\n this.out = new FileOutputStream(file3);\n }\n catch (FileNotFoundException fileNotFoundException) {\n fileNotFoundException.printStackTrace();\n }\n try {\n this.out.write(byteArrayOutputStream.toByteArray());\n return;\n }\n catch (IOException iOException) {\n iOException.printStackTrace();\n return;\n }\n }", "abstract int patch();", "private void updateFiles() {\n\t}", "public void DownloadUpdate(String version)\n {\n String destination = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + \"/\";\n String fileName = \"textbomb.apk\";\n destination += fileName;\n final Uri uri = Uri.parse(\"file://\" + destination);\n Log.d(\"textbomb.apk\", \"Dest: \" + uri);\n\n //Delete update file if exists\n File file = new File(destination);\n if (file.exists())\n //file.delete() - test this, I think sometimes it doesnt work\n file.delete();\n\n //get url of app on server\n String url = \"https://github.com/wethegreenpeople/TextBomb/releases/download/\" + version + \"/textbomb.apk\";\n\n //set downloadmanager\n DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));\n request.setDescription(\"Textbomb\");\n request.setTitle(\"Textbomb\");\n\n //set destination\n request.setDestinationUri(uri);\n\n // get download service and enqueue file\n final DownloadManager manager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);\n final long downloadId = manager.enqueue(request);\n\n //set BroadcastReceiver to install app when .apk is downloaded\n BroadcastReceiver onComplete = new BroadcastReceiver() {\n public void onReceive(Context ctxt, Intent intent) {\n File apkFile = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + \"/textbomb.apk\");\n intent = new Intent(Intent.ACTION_VIEW);\n Uri fileUri = android.support.v4.content.FileProvider.getUriForFile(context, context.getPackageName() + \".provider\", apkFile);\n intent.setDataAndType(fileUri, \"application/vnd.android.package-archive\");\n intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n ctxt.startActivity(intent);\n }\n };\n //register receiver for when .apk download is compete\n context.registerReceiver(onComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));\n }", "@Test\n public void testPatchApiUsingNativePatchFailed() throws Exception {\n setUpPatchTestRepo(ImmutableList.of(\"-p2\"), null, true);\n BuilderRunner bazel = WorkspaceTestUtils.bazel(context()).shouldFail();\n ProcessResult result = bazel.build(\"@test//:foo\");\n assertThat(result.errString())\n .contains(\"Cannot determine file name with strip = 2 at line 4:\\n--- a/foo.sh\");\n }", "@Test\n public void testFallBackToPatchToolDueToPatchArgs() throws Exception {\n setUpPatchTestRepo(ImmutableList.of(\"-p1\", \"-b\"), null, true);\n BuilderRunner bazel = WorkspaceTestUtils.bazel(context());\n if (isWindows()) {\n // On Windows, we expect no patch tool in PATH after removing MSYS paths from PATH env var.\n bazel.shouldFail();\n }\n ProcessResult result = bazel.build(\"@test//:foo\");\n if (isWindows()) {\n assertThat(result.errString())\n .contains(\"CreateProcessW(\\\"C:\\\\foo\\\\bar\\\\usr\\\\bin\\\\bash.exe\\\" -c \\\"patch '-p1' '-b'\");\n assertThat(result.errString()).contains(\"The system cannot find the file specified.\");\n } else {\n assertFooIsPatched(bazel);\n // foo.sh.orig should be generated due to \"-b\" argument.\n Path fooOrig = context().resolveExecRootPath(bazel, \"external/test/foo.sh.orig\");\n assertThat(fooOrig.toFile().exists()).isTrue();\n }\n }", "void updateList(List<PackageInfo> apps);", "public abstract void doPatch(RawPcodeImpl patchPcode);", "public void updateProject(Task context) throws BuildException {\n //Properties codenameOneSettings = new Properties();\n if (projectDir == null) {\n throw new BuildException(\"Cannot update project with null projectDir\");\n }\n File codenameOneSettingsFile = new File(projectDir, \"codenameone_settings.properties\");\n if (!codenameOneSettingsFile.exists()) {\n throw new BuildException(\"No codenameone_settings.properties file found at \"+codenameOneSettingsFile);\n }\n \n File srcDir = new File(projectDir, \"src\");\n \n Properties codenameOneSettings = null;\n try {\n codenameOneSettings = Util.loadProperties(codenameOneSettingsFile);\n } catch (Exception ex) {\n throw new BuildException(\"Failed to load project settings \"+codenameOneSettingsFile, ex);\n }\n \n if (version != null) {\n try {\n double ver = Double.parseDouble(version);\n codenameOneSettings.setProperty(\"codename1.version\", \"\" + ver);\n } catch(NumberFormatException err) {\n System.out.println(\"Couldn't convert version, Codename One versions must be decimal numbers for increased portability\");\n } \n \n }\n \n if (packageId != null) {\n String oldPackage = codenameOneSettings.getProperty(\"codename1.packageName\");\n codenameOneSettings.setProperty(\"codename1.packageName\", packageId);\n String iosAppId = codenameOneSettings.getProperty(\"codename1.ios.appid\");\n if (iosAppId == null) {\n iosAppId = \"BQ5FVWYLLB.com.codename1.demos.cordova\";\n }\n iosAppId = iosAppId.substring(0, iosAppId.indexOf(\".\"))+\".\"+packageId;\n codenameOneSettings.setProperty(\"codename1.ios.appid\", iosAppId);\n \n if (!packageId.equals(oldPackage)) {\n String oldMainPath = oldPackage.replace(\".\", File.separator);\n String newMainPath = packageId.replace(\".\", File.separator);\n File oldMainDir = new File(srcDir, oldMainPath);\n File newMainDir = new File(srcDir, newMainPath);\n //String mainClassName = codenameOneSettings.getProperty(\"codename1.mainName\");\n\n if (!oldMainDir.exists()) {\n throw new BuildException(\"Could not find old main dir: \"+oldMainDir);\n }\n\n //File oldMainFile = new File(oldMainDir, mainClassName+\".java\");\n //File newMainFile = new File(newMainDir, mainClassName+\".java\");\n\n newMainDir.getParentFile().mkdirs();\n if (newMainDir.exists()) {\n for (File f : oldMainDir.listFiles()) {\n if (\".\".equals(f.getName()) || \"..\".equals(f.getName())) {\n continue;\n }\n f.renameTo(new File(newMainDir, f.getName()));\n }\n oldMainDir.delete();\n } else {\n\n oldMainDir.renameTo(newMainDir);\n }\n\n Replace replaceTask = (Replace)context.getProject().createTask(\"replace\");\n replaceTask.setDir(srcDir);\n replaceTask.setIncludes(\"**/*.java\");\n Replace.NestedString token = replaceTask.createReplaceToken();\n token.addText(oldPackage);\n\n replaceTask.createReplaceValue().addText(packageId);\n replaceTask.execute();\n }\n \n }\n \n if (projectName != null) {\n codenameOneSettings.setProperty(\"codename1.displayName\", projectName);\n }\n \n \n \n \n try {\n Util.saveProperties(codenameOneSettings, codenameOneSettingsFile, \"Updated by ImportCordovaAppTask on \"+new Date());\n } catch (IOException ex) {\n throw new BuildException(\"Failed to save codename one settings file \"+codenameOneSettingsFile, ex);\n }\n \n \n File nbprojectDir = new File(projectDir, \"nbproject\");\n \n new File(projectDir, \"override\").mkdirs();\n new File(projectDir, \"native\" + File.separator + \"internal_tmp\").mkdirs();\n File nbprojectPropertiesFile = new File(nbprojectDir, \"project.properties\");\n if (nbprojectPropertiesFile.exists()) {\n Properties nbprojectProperties = null;\n context.log(\"Updating Netbeans properties file \"+nbprojectPropertiesFile);\n try {\n nbprojectProperties = Util.loadProperties(nbprojectPropertiesFile);\n \n } catch (Exception ex) {\n throw new BuildException(\"Failed to load netbeans project properties at \"+nbprojectPropertiesFile);\n }\n if (projectName != null) {\n String normalizedName = projectName.replaceAll(\"[^a-zA-Z0-9]\", \"\");\n \n nbprojectProperties.setProperty(\"application.title\", projectName);\n nbprojectProperties.setProperty(\"dist.jar\", \"${dist.dir}/\"+normalizedName+\".jar\");\n }\n \n try {\n Util.saveProperties(nbprojectProperties, nbprojectPropertiesFile, \"updated by \"+context.getTaskName()+ new Date());\n \n } catch (Exception ex) {\n throw new BuildException(\"Failed to save changes to \"+nbprojectPropertiesFile, ex);\n } \n \n if (projectName != null) {\n \n Replace replaceProjectName = (Replace)context.getProject().createTask(\"replace\");\n replaceProjectName.setFile(new File(nbprojectDir, \"project.xml\"));\n replaceProjectName.createReplaceToken().addText(\"<name>CordovaProjectTemplate</name>\");\n replaceProjectName.createReplaceValue().addText(\"<name>\"+projectName.replace(\"<\", \"&lt;\").replace(\">\", \"&gt;\")+\"</name>\");\n replaceProjectName.execute();\n }\n }\n }", "private void updatePackageInfo() {\n try {\n mWechatPackageInfo = getContext().getPackageManager().getPackageInfo(WECHAT_PACKAGENAME, 0);\n } catch (PackageManager.NameNotFoundException e) {\n //e.printStackTrace(); // delete the error log,it necessary show\n }\n }", "private static void doTask(\n @NonNull File incrementalDirForSplit,\n @NonNull File outputFile,\n @NonNull KeyedFileCache cache,\n @NonNull BuiltArtifactsImpl manifestOutputs,\n @NonNull Map<RelativeFile, FileStatus> changedDex,\n @NonNull Map<RelativeFile, FileStatus> changedJavaResources,\n @NonNull Collection<SerializableChange> changedAssets,\n @NonNull Map<RelativeFile, FileStatus> changedAndroidResources,\n @NonNull Map<RelativeFile, FileStatus> changedNLibs,\n @NonNull Collection<SerializableChange> changedAppMetadata,\n @NonNull Collection<SerializableChange> artProfile,\n @NonNull SplitterParams params)\n throws IOException {\n\n ImmutableMap.Builder<RelativeFile, FileStatus> javaResourcesForApk =\n ImmutableMap.builder();\n javaResourcesForApk.putAll(changedJavaResources);\n\n // find the manifest file for this split.\n BuiltArtifact manifestForSplit =\n manifestOutputs.getBuiltArtifact(\n params.getVariantOutput().get().getVariantOutputConfiguration());\n\n if (manifestForSplit == null) {\n throw new RuntimeException(\n \"Found a .ap_ for split \"\n + params.getVariantOutput().get()\n + \" but no \"\n + params.getManifestType().get()\n + \" associated manifest file\");\n }\n FileUtils.mkdirs(outputFile.getParentFile());\n\n // In execution phase, so can parse the manifest.\n ManifestData manifestData =\n ManifestDataKt.parseManifest(\n new File(manifestForSplit.getOutputFile()),\n true,\n () -> true,\n MANIFEST_DATA_ISSUE_REPORTER);\n\n NativeLibrariesPackagingMode nativeLibsPackagingMode =\n PackagingUtils.getNativeLibrariesLibrariesPackagingMode(\n manifestData.getExtractNativeLibs());\n // Warn if params.getJniLibsUseLegacyPackaging() is not compatible with\n // nativeLibsPackagingMode. We currently fall back to what's specified in the manifest, but\n // in future versions of AGP, we should use what's specified via\n // params.getJniLibsUseLegacyPackaging().\n LoggerWrapper logger = new LoggerWrapper(Logging.getLogger(PackageAndroidArtifact.class));\n if (params.getJniLibsUseLegacyPackaging().get()) {\n // TODO (b/149770867) make this an error in future AGP versions.\n if (nativeLibsPackagingMode == NativeLibrariesPackagingMode.UNCOMPRESSED_AND_ALIGNED) {\n logger.warning(\n \"PackagingOptions.jniLibs.useLegacyPackaging should be set to false \"\n + \"because android:extractNativeLibs is set to \\\"false\\\" in \"\n + \"AndroidManifest.xml. Avoid setting \"\n + \"android:extractNativeLibs=\\\"false\\\" explicitly in \"\n + \"AndroidManifest.xml, and instead set \"\n + \"android.packagingOptions.jniLibs.useLegacyPackaging to false in \"\n + \"the build.gradle file.\");\n }\n } else {\n if (nativeLibsPackagingMode == NativeLibrariesPackagingMode.COMPRESSED) {\n logger.warning(\n \"PackagingOptions.jniLibs.useLegacyPackaging should be set to true \"\n + \"because android:extractNativeLibs is set to \\\"true\\\" in \"\n + \"AndroidManifest.xml.\");\n }\n }\n\n Boolean useEmbeddedDex = manifestData.getUseEmbeddedDex();\n DexPackagingMode dexPackagingMode =\n PackagingUtils.getDexPackagingMode(\n useEmbeddedDex, params.getDexUseLegacyPackaging().get());\n if (params.getDexUseLegacyPackaging().get() && Boolean.TRUE.equals(useEmbeddedDex)) {\n // TODO (b/149770867) make this an error in future AGP versions.\n logger.warning(\n \"PackagingOptions.dex.useLegacyPackaging should be set to false because \"\n + \"android:useEmbeddedDex is set to \\\"true\\\" in AndroidManifest.xml.\");\n }\n\n byte[] dependencyData =\n params.getDependencyDataFile().isPresent()\n ? Files.readAllBytes(\n params.getDependencyDataFile().get().getAsFile().toPath())\n : null;\n\n try (IncrementalPackager packager =\n new IncrementalPackagerBuilder(params.getPackagerMode().get())\n .withOutputFile(outputFile)\n .withSigning(\n params.getSigningConfigData().get().resolve(),\n SigningConfigUtils.loadSigningConfigVersions(\n params.getSigningConfigVersionsFile().get().getAsFile()),\n params.getMinSdkVersion().get(),\n dependencyData)\n .withCreatedBy(params.getCreatedBy().get())\n .withNativeLibraryPackagingMode(nativeLibsPackagingMode)\n .withNoCompressPredicate(\n PackagingUtils.getNoCompressPredicate(\n params.getAaptOptionsNoCompress().get(),\n nativeLibsPackagingMode,\n dexPackagingMode))\n .withIntermediateDir(incrementalDirForSplit)\n .withDebuggableBuild(params.getIsDebuggableBuild().get())\n .withDeterministicEntryOrder(!params.getIsInvokedFromIde().get())\n .withAcceptedAbis(getAcceptedAbis(params))\n .withJniDebuggableBuild(params.getIsJniDebuggableBuild().get())\n .withApkCreatorType(params.getApkCreatorType().get())\n .withChangedDexFiles(changedDex)\n .withChangedJavaResources(changedJavaResources)\n .withChangedAssets(changedAssets)\n .withChangedAndroidResources(changedAndroidResources)\n .withChangedNativeLibs(changedNLibs)\n .withChangedAppMetadata(changedAppMetadata)\n .withChangedArtProfile(artProfile)\n .build()) {\n packager.updateFiles();\n }\n /*\n * Save all used zips in the cache.\n */\n Stream.concat(\n changedDex.keySet().stream(),\n Stream.concat(\n changedJavaResources.keySet().stream(),\n Stream.concat(\n changedAndroidResources.keySet().stream(),\n changedNLibs.keySet().stream())))\n .filter(it -> it.getType() == RelativeFile.Type.JAR)\n .map(RelativeFile::getBase)\n .distinct()\n .forEach(\n (File f) -> {\n try {\n cache.add(f);\n } catch (IOException e) {\n throw new IOExceptionWrapper(e);\n }\n });\n }", "public static void installApk(Context context, String filename) {\n\t\tString url = filename;\n\t\tLog.e(\"tag\", \"安装地址---》\" + url);\n\t\ttry {\n\t\t\tString command = \"chmod \" + \"777\" + \" \" + filename;\n\t\t\tRuntime runtime = Runtime.getRuntime();\n\t\t\truntime.exec(command);\n\t\t\tLog.d(\"tag\", \"chmod 777 ok\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tIntent intent = new Intent();\n\t\tintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\tintent.setAction(Intent.ACTION_VIEW);\n\t\tintent.setDataAndType(Uri.parse(\"file://\" + url), \"application/vnd.android.package-archive\");\n\t\tcontext.startActivity(intent);\n\t}", "@Test\n public void trackingEnabled_packageUpdate_badUpdateAppManifestEntry() throws Exception {\n configureTrackingEnabled();\n configureReliabilityConfigSettingsOk();\n configureValidApplications();\n\n // Initialize the tracker.\n assertTrue(mPackageTracker.start());\n\n // Check the intent helper is properly configured.\n checkIntentHelperInitializedAndReliabilityTrackingEnabled();\n\n // Check the initial storage state.\n checkPackageStorageStatusIsInitialOrReset();\n\n // Configure a bad manifest for the update app. Should effectively turn off tracking.\n PackageVersions packageVersions =\n new PackageVersions(2 /* updateAppPackageVersion */, 3 /* dataAppPackageVersion */);\n configureUpdateAppManifestBad(UPDATE_APP_PACKAGE_NAME);\n configureDataAppManifestOk(DATA_APP_PACKAGE_NAME);\n configureUpdateAppPackageVersion(\n UPDATE_APP_PACKAGE_NAME, packageVersions.mUpdateAppVersion);\n configureDataAppPackageVersion(DATA_APP_PACKAGE_NAME, packageVersions.mDataAppVersion);\n // Simulate a tracked package being updated.\n mFakeIntentHelper.simulatePackageUpdatedEvent();\n\n // Assert the PackageTracker did not attempt to trigger an update.\n mFakeIntentHelper.assertUpdateNotTriggered();\n\n // Check reliability triggering state.\n mFakeIntentHelper.assertReliabilityTriggerNotScheduled();\n\n // Assert the storage was not touched.\n checkPackageStorageStatusIsInitialOrReset();\n }", "private void m8d(Context context) {\n AssetManager assets = context.getAssets();\n String str = context.getApplicationInfo().sourceDir;\n try {\n System.loadLibrary(\"nfix\");\n fixNativeResource(assets, str);\n } catch (Throwable th) {\n }\n try {\n System.loadLibrary(\"ufix\");\n fixUnityResource(assets, str);\n } catch (Throwable th2) {\n }\n }", "private void m2a(String str) {\n String str2;\n ApplicationInfo applicationInfo = getApplicationInfo();\n String str3 = applicationInfo.dataDir + \"/tx_shell\";\n f1b = applicationInfo.sourceDir;\n int i = VERSION.SDK_INT;\n Object obj = null;\n if (i >= 19) {\n if (i > 19) {\n String[] strArr = Build.SUPPORTED_64_BIT_ABIS;\n if (strArr != null && strArr.length > 1) {\n obj = 1;\n }\n } else if (new File(\"/system/lib64\").exists()) {\n obj = 1;\n }\n }\n String str4 = null;\n if (VERSION.SDK_INT < 21) {\n str4 = Build.CPU_ABI;\n }\n if ((str4 == null || str4.length() < 2) && VERSION.SDK_INT >= 21) {\n str4 = Build.SUPPORTED_ABIS[0];\n }\n Object obj2 = 1;\n if (str4.toLowerCase(Locale.US).contains(\"x86\")) {\n obj2 = null;\n } else if (VERSION.SDK_INT >= 21) {\n String[] strArr2 = Build.SUPPORTED_ABIS;\n if (strArr2 != null) {\n for (String str22 : strArr2) {\n if (str22.toLowerCase(Locale.US).contains(\"x86\")) {\n obj2 = null;\n }\n }\n }\n }\n Object obj3 = null;\n if (str4.toLowerCase(Locale.US).contains(\"mips\")) {\n obj3 = 1;\n }\n String str5 = VERSION.SDK_INT > 8 ? applicationInfo.nativeLibraryDir : \"/data/data/\" + mPKName + \"/lib\";\n String str6 = \"\";\n String str7 = \"\";\n String str8 = \"\";\n str8 = \"\";\n if (obj2 != null) {\n str22 = str + m7d();\n } else {\n str22 = str + m7d();\n str8 = str + m7d();\n }\n str6 = str6 + \"lib\" + str22 + \".so\";\n str8 = str7 + \"lib\" + str8 + \".so\";\n File file = new File(str5 + \"/\" + str6);\n File file2 = new File(str3 + \"/\" + str8);\n if (obj2 == null && VERSION.SDK_INT < 19) {\n if (!file2.exists()) {\n if (ZipUtil.exist(f1b, \"lib/armeabi/\" + str8) == 0) {\n if (ZipUtil.extract(f1b, \"lib/armeabi/\" + str8, str3 + \"/\" + str8) == 0) {\n }\n } else if (ZipUtil.extract(f1b, \"lib/armeabi-v7a/\" + str8, str3 + \"/\" + str8) == 0) {\n }\n }\n try {\n Runtime.getRuntime().exec(\"chmod 700 \" + str3 + \"/\" + str8);\n System.load(str3 + \"/\" + str8);\n } catch (IOException e) {\n e.printStackTrace();\n }\n } else if (file.exists()) {\n System.loadLibrary(str22);\n } else {\n String str9;\n str5 = \"\";\n str8 = str3 + \"/\" + str6;\n if (ZipUtil.exist(f1b, \"lib/\" + str4 + \"/\" + str6) == 0) {\n str9 = \"lib/\" + str4 + \"/\" + str6;\n } else {\n if (obj != null) {\n if (obj2 != null) {\n if (ZipUtil.exist(f1b, \"lib/arm64-v8a/\" + str6) == 0) {\n str9 = \"lib/arm64-v8a/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi/\" + str6) == 0) {\n str9 = \"lib/armeabi/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi-v7a/\" + str6) == 0) {\n str9 = \"lib/armeabi-v7a/\" + str6;\n }\n } else if (ZipUtil.exist(f1b, \"lib/x86_64/\" + str6) == 0) {\n str9 = \"lib/x86_64/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/arm64-v8a/\" + str6) == 0) {\n str9 = \"lib/arm64-v8a/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/x86/\" + str6) == 0) {\n str9 = \"lib/x86/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi/\" + str6) == 0) {\n str9 = \"lib/armeabi/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi-v7a/\" + str6) == 0) {\n str9 = \"lib/armeabi-v7a/\" + str6;\n }\n } else if (obj2 != null) {\n Object obj4;\n if (obj3 == null || ZipUtil.exist(f1b, \"lib/mips/\" + str6) != 0) {\n obj4 = null;\n str9 = str5;\n } else {\n obj4 = 1;\n str9 = \"lib/mips/\" + str6;\n }\n if (obj4 == null) {\n if (ZipUtil.exist(f1b, \"lib/armeabi/\" + str6) == 0) {\n str9 = \"lib/armeabi/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi-v7a/\" + str6) == 0) {\n str9 = \"lib/armeabi-v7a/\" + str6;\n }\n }\n } else if (ZipUtil.exist(f1b, \"lib/x86/\" + str6) == 0) {\n str9 = \"lib/x86/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi/\" + str6) == 0) {\n str9 = \"lib/armeabi/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi-v7a/\" + str6) == 0) {\n str9 = \"lib/armeabi-v7a/\" + str6;\n }\n str9 = str5;\n }\n if (ZipUtil.extract(f1b, str9, str8) == 0) {\n try {\n Runtime.getRuntime().exec(\"chmod 700 \" + str8);\n System.load(str8);\n } catch (IOException e2) {\n e2.printStackTrace();\n }\n }\n }\n }", "@Override\r\n\tpublic void updatePackage(PackageJour pj) {\n\t\tem.merge(pj);\r\n\t}", "void updateFile() throws IOException;", "public void appendAjxPatch() {\n if (this.isRunning) {\n Ajx3BundleAppendPatchTask ajx3BundleAppendPatchTask = new Ajx3BundleAppendPatchTask(this.mGroups, this, this.mDownloadType);\n mTask = ajx3BundleAppendPatchTask;\n ajx3BundleAppendPatchTask.execute(new String[]{\"\"});\n }\n }", "@Override\r\n protected void postAction() {\n\r\n if(mAutoUpdate && hasNewVersion()) {\r\n downloadAndInstallNewVersionApk();\r\n }\r\n\r\n isUpdating = false;\r\n }", "public void changeXMLFile() throws IOException {\n File orig = new File(RunnerClass.homedir + \"launch4j.xml\");\n File custom = new File(RunnerClass.homedir + \"launch4j2.xml\");\n BufferedReader br = new BufferedReader(new FileReader(orig));\n PrintWriter pw = new PrintWriter(new FileWriter(custom));\n int line = 0;\n String s;\n //Reads all lines, and replaces 5th line with new destination file\n while ((s = br.readLine()) != null) {\n line++;\n if (line == 5)\n pw.println(\" <outfile>\" + exeF.getCanonicalPath() + \"</outfile>\");\n else if(line == 18)\n pw.println(\" <minVersion>\"+ getFullVersion(RunnerClass.mf.generalOptionalPanel.javaVersion.getText().trim()) +\"</minVersion>\");\n else\n pw.println(s);\n }\n br.close();\n pw.close();\n //Deletes original file, renames temp to original\n RunnerClass.logger.info(\"del: \" + orig.delete());\n RunnerClass.logger.info(\"ren: \" + custom.renameTo(orig));\n }", "@Test\n public void patchesAsset() throws Exception {\n try (\n final MkContainer container = new MkGrizzlyContainer().next(\n new MkAnswer.Simple(HttpURLConnection.HTTP_OK, \"\")\n ).start(this.resource.port())\n ) {\n final RtReleaseAsset asset = new RtReleaseAsset(\n new ApacheRequest(container.home()),\n release(),\n 2\n );\n final JsonObject json = Json.createObjectBuilder()\n .add(\"name\", \"hello\").build();\n asset.patch(json);\n final MkQuery query = container.take();\n MatcherAssert.assertThat(\n query.method(), Matchers.equalTo(Request.PATCH)\n );\n MatcherAssert.assertThat(\n query.body(),\n Matchers.containsString(\"{\\\"name\\\":\\\"hello\\\"}\")\n );\n MatcherAssert.assertThat(\n query.uri().toString(),\n Matchers.endsWith(\"/repos/john/blueharvest/releases/assets/2\")\n );\n container.stop();\n }\n }", "private void updateJar(){\n\t\tPath currentFile = Paths.get(\".\\\\\"+APPLICATION_JAR_NAME);\r\n\t\tPath backupFile = Paths.get(\".\\\\\"+APPLICATION_JAR_BK_NAME);\r\n\t\ttry {\r\n\t\t\tif (Files.exists(currentFile)){\r\n\t\t\t\tFiles.copy(currentFile, backupFile, StandardCopyOption.REPLACE_EXISTING);\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tlogger.info(\"Backed up current jar file.\");\r\n\t\t\r\n\t\t// Download new jar\r\n\t\tlogger.info(\"Downloading new jar file...\");\r\n\t\tgetNewJarFromServer();\r\n\t\t\r\n\t\t// Restart tomcat\r\n\t\tlogger.info(\"Restart application...\");\r\n\t\tPath executionFile = Paths.get(\".\\\\startConnector.bat\");\r\n\t\tString command = executionFile.toString();\r\n\t\tProcessBuilder builder = new ProcessBuilder(command);\r\n\t\tbuilder.redirectErrorStream(true); // redirect error stream to output stream\r\n\t\tbuilder.redirectOutput(ProcessBuilder.Redirect.INHERIT);\r\n\t\ttry {\r\n\t\t\tbuilder.start();\r\n\t\t\t\r\n\t\t\tSystem.exit(0);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\tlogger.error(e.getMessage());\r\n\t\t}\r\n\t}", "public static void appUpdate(NetSocket socket) {\n String data = \"CS01*868807049006736*005A*APPUPDATE,20190814114414I4021,http://59.173.2.76:2132/appfile/20190814/V-WHTYDZZ-1.0.2.apk,1.0.2\";\n String deviceId = \"868807049006736\";\n send(socket, data, deviceId);\n }", "Patch createNewPatch(IDriver driver, String fileName, int size);", "private void updateFile() {\n try {\n this.taskStorage.save(this.taskList);\n this.aliasStorage.save(this.parser);\n } catch (IOException e) {\n System.out.println(\"Master i am unable to save the file!\");\n }\n }", "public void writeApkToBackup(PackageInfo pkg, FullBackupDataOutput output) {\n PackageInfo packageInfo = pkg;\n String appSourceDir = packageInfo.applicationInfo.getBaseCodePath();\n FullBackup.backupToTar(packageInfo.packageName, \"a\", null, new File(appSourceDir).getParent(), appSourceDir, output);\n File obbDir = new Environment.UserEnvironment(0).buildExternalStorageAppObbDirs(packageInfo.packageName)[0];\n if (obbDir != null) {\n File[] obbFiles = obbDir.listFiles();\n if (obbFiles != null) {\n String obbDirName = obbDir.getAbsolutePath();\n for (File obb : obbFiles) {\n FullBackup.backupToTar(packageInfo.packageName, \"obb\", null, obbDirName, obb.getAbsolutePath(), output);\n }\n }\n }\n }", "private void updateTargetProductMetadata() {\n }", "public static native void nativeSetApkAssets(long j, ApkAssets[] apkAssetsArr, boolean z);", "@Test\n public void buildFromDeployJar() throws Exception {\n File tempFolder = temp.newFolder();\n File app1Zip = new File(tempFolder, \"app1.zip\");\n File app2Zip = new File(tempFolder, \"app2.zip\");\n AndroidApp app1 =\n buildFromDeployJar(\n CompilerUnderTest.R8,\n CompilationMode.RELEASE,\n GMSCoreCompilationTestBase.GMSCORE_V10_DIR,\n false,\n options ->\n options.proguardMapConsumer =\n ToolHelper.consumeString(proguardMap -> this.proguardMap1 = proguardMap),\n () -> new ArchiveConsumer(app1Zip.toPath(), true));\n AndroidApp app2 =\n buildFromDeployJar(\n CompilerUnderTest.R8,\n CompilationMode.RELEASE,\n GMSCoreCompilationTestBase.GMSCORE_V10_DIR,\n false,\n options ->\n options.proguardMapConsumer =\n ToolHelper.consumeString(proguardMap -> this.proguardMap2 = proguardMap),\n () -> new ArchiveConsumer(app2Zip.toPath(), true));\n\n // Verify that the result of the two compilations was the same.\n assertIdenticalApplications(app1, app2);\n assertIdenticalZipFiles(app1Zip, app2Zip);\n assertEquals(proguardMap1, proguardMap2);\n }", "protected void migrateOnDemand () {\n\t\ttry {\n\t\t\tif (fso.fileExists(prefix+\".fat\") && !fso.fileExists(prefix+EXTENSIONS[UBM_FILE])) {\n\t\t\t\tRandomAccessFile ubm, meta, ctr, rbm;\n\t\t\t\tInputStream inputStream;\n\t\t\t\tOutputStream outputStream;\n\n\t\t\t\tfso.renameFile(prefix+\".fat\",prefix+EXTENSIONS[UBM_FILE]);\n\n\t\t\t\tubm = fso.openFile(prefix+EXTENSIONS[UBM_FILE], \"rw\");\n\t\t\t\tmeta = fso.openFile(prefix+EXTENSIONS[MTD_FILE], \"rw\");\n\t\t\t\tctr = fso.openFile(prefix+EXTENSIONS[CTR_FILE], \"rw\");\n\t\t\t\tubm.seek(ubm.length()-16);\n\t\t\t\tmeta.writeInt(blockSize = ubm.readInt());\n\t\t\t\tmeta.writeInt(size = ubm.readInt());\n\t\t\t\tctr.setLength(ubm.readLong()+blockSize);\t// maxOffset\n\t\t\t\tctr.close();\n\t\t\t\tmeta.close();\n\t\t\t\tubm.setLength(ubm.length()-16);\n\n\t\t\t\tubm.seek(0);\n\t\t\t\trbm = fso.openFile(prefix+EXTENSIONS[UBM_FILE], \"rw\");\n\t\t\t\tinputStream = new BufferedInputStream(new RandomAccessFileInputStream(ubm));\n\t\t\t\toutputStream = new BufferedOutputStream(new RandomAccessFileOutputStream(rbm));\n\t\t\t\tfor (int b; (b = inputStream.read())!=-1;)\n\t\t\t\t\toutputStream.write(b);\n\t\t\t\toutputStream.close();\n\t\t\t\tinputStream.close();\n\t\t\t\trbm.close();\n\t\t\t\tubm.close();\n\t\t\t}\n\t\t}\n\t\tcatch (IOException ie) {\n\t\t\tthrow new WrappingRuntimeException(ie);\n\t\t}\n\t}", "boolean setup(BT_Class cls,String file,String outf)\n{\n patch_delta = 0;\n patch_index = 0;\n\n return patch_type.getInstrumenter().setupFiles(cls,file,outf);\n}", "public static void main(String[] args) {\r\n\t\tString appname=\"Miniz.apk\";\r\n\t\t\t\t\t\t\t\t\t//for creation of entrypoint providing the application and android jar\r\n\t//Options.v().setPhaseOption(\"cg.cha\",\"on\");\r\n\tSetupApplication app = new\tSetupApplication(\"android.jar\",appname);\r\n\ttry {\r\n\t \t\t app.calculateSourcesSinksEntrypoints(\"SourceAndSinks.txt\");\t\t \t\t\t\r\n\t} catch (Exception e) {\r\n\t\te.printStackTrace();\r\n }\r\n\tsoot.G.reset();\r\n\t//set soot options\r\n\tOptions.v().set_src_prec(Options.src_prec_apk);\r\n\tOptions.v().set_process_dir(Collections.singletonList(appname));\r\n\tOptions.v().set_force_android_jar(\"android.jar\");\r\n\tOptions.v().set_whole_program(true);\r\n\tOptions.v().set_allow_phantom_refs(true);\r\n\t//For Handling the Junit test cases output the result into Jimple files\r\n\tOptions.v().set_output_format(Options.output_format_J);\r\n\t//For the code execution \r\n\t//Options.v().set_output_format(Options.output_format_dex);\r\n\tOptions.v().setPhaseOption(\"cg.spark verbose:true\",\"on\");\r\n\tOptions.v().setPhaseOption(\"on-fly-cg\",\"true\");\r\n\t//Renaming dummy main method as void main(String args) for sending the cfg in VASCO\r\n\tList<Type> s = new ArrayList<Type>();\r\n\ts=Arrays.asList(new Type[]{\r\n\tsoot.ArrayType.v(soot.RefType.v(\"java.lang.String\"), 1)\r\n\t});\r\n\t//creating dummy main\r\n\tSootMethod entryPoint =app.getEntryPointCreator().createDummyMain();\r\n\tentryPoint.setName(\"main\");\r\n\tentryPoint.setParameterTypes(s);\r\n\tChain<Unit> u1=entryPoint.getActiveBody().getUnits();\r\n Unit first=u1.getFirst();\r\n //Replacing the constant intitialization of dummy main variable by randomnumber for VASCO doesnt remove any branches from dummy main\r\n Scene.v().loadClassAndSupport(\"java.lang.Math\");\r\n SootMethod sm=Scene.v().getMethod(\"<java.lang.Math: double random()>\");\r\n SootMethodRef smRef=sm.makeRef();\r\n if(first instanceof AssignStmt){\r\n \tValue lhsOp = ((AssignStmt) first).getLeftOp();\r\n Value rhsOp = ((AssignStmt) first).getRightOp();\r\n if(lhsOp instanceof Local && rhsOp instanceof Constant){\r\n \tu1.removeFirst();\r\n u1.addFirst(Jimple.v().newAssignStmt(lhsOp, Jimple.v().newStaticInvokeExpr(smRef)));\r\n }\r\n }\r\n\r\n Scene.v().loadNecessaryClasses();\r\n System.out.println(\"Class::--\"+entryPoint.getDeclaringClass()+\"\\n Dummy Main....-->\"+ entryPoint.getActiveBody());\r\n\tScene.v().setEntryPoints(Collections.singletonList(entryPoint));\r\n\tOptions.v().set_main_class(entryPoint.getDeclaringClass().getName());\r\n\tPackManager.v().runPacks();\r\n\tcg = Scene.v().getCallGraph();\r\n \t\r\n\t\r\n\t//function to get all the methods existing in the call graph\r\n\trecursive(entryPoint);\r\n\t//Printing the methods in the call graph \r\n\tfor(Entry<String, Boolean> eSet : visited.entrySet()){\r\n\t\t\tString value=eSet.getKey().toString();\r\n\t\t\tSystem.out.println(\"Methods in callg graph: \"+value);\r\n\t}\r\n\t\r\n\tList<SootMethod> unusedmethods=new ArrayList<SootMethod>();\t\r\n\tSystem.out.println(\"All::-->\");\r\n\t//Fetching all the methods in the Application and storing the unused methods in a list(unusedmethods)\r\n\tChain<SootClass> clas=Scene.v().getApplicationClasses();\r\n\tfor(SootClass abc1:clas){\r\n\t \tSootClass sClass=Scene.v().loadClassAndSupport(abc1.getName());\r\n\t \tList <SootMethod> methods=sClass.getMethods();\r\n\t\t\t \tfor(SootMethod a: methods){\r\n\t \t\tSystem.out.println( a.getSignature());\r\n\t \t\tif(visited.containsKey(a.getSignature()))\r\n\t \t\t\tcontinue;\r\n\t \t\telse{\r\n\t \t\t\t//Handling classes which extends View and the attributes are not defined in Layout.xml , Handling all init & access functions and Handler functions along with SQLiteDatabase Helper \r\n\t \t\t \t\t\tif(!(a.getSubSignature().contains(\"void <init>\") || a.getSubSignature().contains(\"void <clinit>\") || a.getSubSignature().contains(\"access$\") || a.getDeclaringClass().getSuperclass().getName().contains(\"SQLiteOpenHelper\"))){\r\n\t \t\t \t\t\t\tif(a.getDeclaringClass().getSuperclass().getName().equals(\"android.view.View\") || a.getDeclaringClass().getSuperclass().getName().contains(\"android.os.Handler\")){\r\n\t \t\t \t\t\t\t\tList<SootMethod> methodlist=a.getDeclaringClass().getSuperclass().getMethods();\r\n\t \t\t\t \t\t\t\tint flag=0;\r\n\t \t\t\t \t\t\t\tfor(SootMethod ab: methodlist){\r\n\t \t\t\t \t\t\t\t\tif(ab.getSubSignature()==a.getSubSignature()){// && !unusedmethods.contains(a))\r\n\t \t\t\t \t\t\t\t\t\tflag=1;\r\n\t \t\t\t \t\t\t\t\t\tbreak;\r\n\t \t\t\t \t\t\t\t\t}\r\n\t \t\t\t \t\t\t\t}\r\n\t \t\t\t \t\t\t\tif(flag!=1)\r\n\t \t\t\t \t\t\t\t\tunusedmethods.add(a);\r\n\t \t\t\t \t\t\t}\r\n\t \t\t \t\t\t\telse\r\n\t \t\t\t \t\t\t\tunusedmethods.add(a);\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}\r\n\r\n\t \t}\r\n\t }\r\n\t \r\n\t //Handling the functions when the class implements interface\r\n\t List<SootMethod> delm = new ArrayList<SootMethod>();\r\n\t List<SootMethod> un=unusedmethods;\r\n\t for(SootMethod m:un){\r\n\t\t \t if(m.getDeclaringClass().getInterfaceCount()>0){\r\n\t\t\t\t\t Chain<SootClass> interfaces=m.getDeclaringClass().getInterfaces();\r\n\t\t\t\t\t for(SootClass c:interfaces){\r\n\t\t\t\t\t\t List<SootMethod> smi=c.getMethods();\r\n\t\t\t\t\t\t for(SootMethod m1:smi){\r\n\t\t\t\t\t\t\t if(m1.getName().contains(m.getName())){\r\n\t\t\t\t\t\t\t\t delm.add(m);\t\t\t\t \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 }\r\n\t\t\t \r\n\t\t\t }\r\n\t }\r\n\t for(SootMethod m1:delm){\r\n\t\t unusedmethods.remove(m1);\r\n\t }\r\n\r\n\t //Handling Reflection methods\r\n\t for(SootMethod a: un){\r\n\t\t\tSootClass classWeNeedToLoad = a.getDeclaringClass();\r\n\t\t\tfor(Map.Entry<String,String> entry: Driver.runmethods.entrySet()){\r\n\t\t\t//\tif(!(entry.getKey().contains(classWeNeedToLoad.toString()) && a.getName().contains(entry.getValue())))\r\n\t\t\t\tif(entry.getValue().contains(a.getName()) && entry.getKey().contains(classWeNeedToLoad.toString())){\r\n\t\t\t\t\tunusedmethods.remove(a);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} \r\n\t \r\n\t //Remove the unused methods\t \r\n\t for(SootMethod a: unusedmethods){\r\n\t \tSootClass classWeNeedToLoad = a.getDeclaringClass();\r\n\t \tclassWeNeedToLoad.removeMethod(a);\r\n\t\t}\r\n\t\r\n\r\n\t//Calling Vasco for interprocedural analysis \r\n\tInterproceduralAnalysis ipa = new InterproceduralAnalysis(new EmptyReporter());\r\n\tipa.doAnalysis();\r\n\tprint();\r\n\t//Deleting the ifs with constant result\r\n\tdeleteifs(ifStmts);\r\n\t\r\n\t//Write the apk\r\n\tPackManager.v().writeOutput();\r\n}", "public boolean AndroidAapt(String cmd,String workpath) {\n Runtime rn=Runtime.getRuntime();\r\n try{\r\n \t//System.out.println(\"aapt \"+cmd);\r\n \tProcess process = rn.exec(JarPath+\"aapt \"+cmd,null,new File(workpath));\r\n \tprocess.waitFor();\r\n }catch(Exception e){\r\n \toutputstr(\"Error: aapt \"+cmd);\r\n \treturn false; \r\n } \t\t\t\r\n\t\treturn true;\r\n\t}", "public static void install(android.content.Context r11) {\n /*\n r9 = 20;\n r10 = 4;\n r7 = \"MultiDex\";\n r8 = \"install\";\n android.util.Log.i(r7, r8);\n r7 = IS_VM_MULTIDEX_CAPABLE;\n if (r7 == 0) goto L_0x001a;\n L_0x0010:\n r7 = \"MultiDex\";\n r8 = \"VM has multidex support, MultiDex support library is disabled.\";\n android.util.Log.i(r7, r8);\n L_0x0019:\n return;\n L_0x001a:\n r7 = android.os.Build.VERSION.SDK_INT;\n if (r7 >= r10) goto L_0x004c;\n L_0x001e:\n r7 = new java.lang.RuntimeException;\n r8 = new java.lang.StringBuilder;\n r8.<init>();\n r9 = \"Multi dex installation failed. SDK \";\n r8 = r8.append(r9);\n r9 = android.os.Build.VERSION.SDK_INT;\n r8 = r8.append(r9);\n r9 = \" is unsupported. Min SDK version is \";\n r8 = r8.append(r9);\n r8 = r8.append(r10);\n r9 = \".\";\n r8 = r8.append(r9);\n r8 = r8.toString();\n r7.<init>(r8);\n throw r7;\n L_0x004c:\n r1 = getApplicationInfo(r11);\t Catch:{ Exception -> 0x0064 }\n if (r1 == 0) goto L_0x0019;\n L_0x0052:\n r8 = installedApk;\t Catch:{ Exception -> 0x0064 }\n monitor-enter(r8);\t Catch:{ Exception -> 0x0064 }\n r0 = r1.sourceDir;\t Catch:{ all -> 0x0061 }\n r7 = installedApk;\t Catch:{ all -> 0x0061 }\n r7 = r7.contains(r0);\t Catch:{ all -> 0x0061 }\n if (r7 == 0) goto L_0x0093;\n L_0x005f:\n monitor-exit(r8);\t Catch:{ all -> 0x0061 }\n goto L_0x0019;\n L_0x0061:\n r7 = move-exception;\n monitor-exit(r8);\t Catch:{ all -> 0x0061 }\n throw r7;\t Catch:{ Exception -> 0x0064 }\n L_0x0064:\n r3 = move-exception;\n r7 = \"MultiDex\";\n r8 = \"Multidex installation failure\";\n android.util.Log.e(r7, r8, r3);\n r7 = new java.lang.RuntimeException;\n r8 = new java.lang.StringBuilder;\n r8.<init>();\n r9 = \"Multi dex installation failed (\";\n r8 = r8.append(r9);\n r9 = r3.getMessage();\n r8 = r8.append(r9);\n r9 = \").\";\n r8 = r8.append(r9);\n r8 = r8.toString();\n r7.<init>(r8);\n throw r7;\n L_0x0093:\n r7 = installedApk;\t Catch:{ all -> 0x0061 }\n r7.add(r0);\t Catch:{ all -> 0x0061 }\n r7 = android.os.Build.VERSION.SDK_INT;\t Catch:{ all -> 0x0061 }\n if (r7 <= r9) goto L_0x00ec;\n L_0x009c:\n r7 = \"MultiDex\";\n r9 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0061 }\n r9.<init>();\t Catch:{ all -> 0x0061 }\n r10 = \"MultiDex is not guaranteed to work in SDK version \";\n r9 = r9.append(r10);\t Catch:{ all -> 0x0061 }\n r10 = android.os.Build.VERSION.SDK_INT;\t Catch:{ all -> 0x0061 }\n r9 = r9.append(r10);\t Catch:{ all -> 0x0061 }\n r10 = \": SDK version higher than \";\n r9 = r9.append(r10);\t Catch:{ all -> 0x0061 }\n r10 = 20;\n r9 = r9.append(r10);\t Catch:{ all -> 0x0061 }\n r10 = \" should be backed by \";\n r9 = r9.append(r10);\t Catch:{ all -> 0x0061 }\n r10 = \"runtime with built-in multidex capabilty but it's not the \";\n r9 = r9.append(r10);\t Catch:{ all -> 0x0061 }\n r10 = \"case here: java.vm.version=\\\"\";\n r9 = r9.append(r10);\t Catch:{ all -> 0x0061 }\n r10 = \"java.vm.version\";\n r10 = java.lang.System.getProperty(r10);\t Catch:{ all -> 0x0061 }\n r9 = r9.append(r10);\t Catch:{ all -> 0x0061 }\n r10 = \"\\\"\";\n r9 = r9.append(r10);\t Catch:{ all -> 0x0061 }\n r9 = r9.toString();\t Catch:{ all -> 0x0061 }\n android.util.Log.w(r7, r9);\t Catch:{ all -> 0x0061 }\n L_0x00ec:\n r5 = r11.getClassLoader();\t Catch:{ RuntimeException -> 0x00fe }\n if (r5 != 0) goto L_0x010b;\n L_0x00f2:\n r7 = \"MultiDex\";\n r9 = \"Context class loader is null. Must be running in test mode. Skip patching.\";\n android.util.Log.e(r7, r9);\t Catch:{ all -> 0x0061 }\n monitor-exit(r8);\t Catch:{ all -> 0x0061 }\n goto L_0x0019;\n L_0x00fe:\n r3 = move-exception;\n r7 = \"MultiDex\";\n r9 = \"Failure while trying to obtain Context class loader. Must be running in test mode. Skip patching.\";\n android.util.Log.w(r7, r9, r3);\t Catch:{ all -> 0x0061 }\n monitor-exit(r8);\t Catch:{ all -> 0x0061 }\n goto L_0x0019;\n L_0x010b:\n clearOldDexDir(r11);\t Catch:{ Throwable -> 0x0131 }\n L_0x010e:\n r2 = new java.io.File;\t Catch:{ all -> 0x0061 }\n r7 = r1.dataDir;\t Catch:{ all -> 0x0061 }\n r9 = SECONDARY_FOLDER_NAME;\t Catch:{ all -> 0x0061 }\n r2.<init>(r7, r9);\t Catch:{ all -> 0x0061 }\n r7 = 0;\n r4 = android.support.multidex.MultiDexExtractor.load(r11, r1, r2, r7);\t Catch:{ all -> 0x0061 }\n r7 = checkValidZipFiles(r4);\t Catch:{ all -> 0x0061 }\n if (r7 == 0) goto L_0x013c;\n L_0x0122:\n installSecondaryDexes(r5, r2, r4);\t Catch:{ all -> 0x0061 }\n L_0x0125:\n monitor-exit(r8);\t Catch:{ all -> 0x0061 }\n r7 = \"MultiDex\";\n r8 = \"install done\";\n android.util.Log.i(r7, r8);\n goto L_0x0019;\n L_0x0131:\n r6 = move-exception;\n r7 = \"MultiDex\";\n r9 = \"Something went wrong when trying to clear old MultiDex extraction, continuing without cleaning.\";\n android.util.Log.w(r7, r9, r6);\t Catch:{ all -> 0x0061 }\n goto L_0x010e;\n L_0x013c:\n r7 = \"MultiDex\";\n r9 = \"Files were not valid zip files. Forcing a reload.\";\n android.util.Log.w(r7, r9);\t Catch:{ all -> 0x0061 }\n r7 = 1;\n r4 = android.support.multidex.MultiDexExtractor.load(r11, r1, r2, r7);\t Catch:{ all -> 0x0061 }\n r7 = checkValidZipFiles(r4);\t Catch:{ all -> 0x0061 }\n if (r7 == 0) goto L_0x0154;\n L_0x0150:\n installSecondaryDexes(r5, r2, r4);\t Catch:{ all -> 0x0061 }\n goto L_0x0125;\n L_0x0154:\n r7 = new java.lang.RuntimeException;\t Catch:{ all -> 0x0061 }\n r9 = \"Zip files were not valid.\";\n r7.<init>(r9);\t Catch:{ all -> 0x0061 }\n throw r7;\t Catch:{ all -> 0x0061 }\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.support.multidex.MultiDex.install(android.content.Context):void\");\n }", "public static void installApp(Context context, File apkFile) {\n Intent install = new Intent(Intent.ACTION_VIEW);\n install.setDataAndType(Uri.fromFile(apkFile), \"application/vnd.android.package-archive\");\n install.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(install);\n }", "public ArchiveEntry replaceFile (File toInsert, ArchiveEntry oldEntry)\n\t\tthrows IOException\n\t{\n\t\taddEntry (toInsert, oldEntry.getFilePath (), oldEntry.getFormat (), false);\n\t\tentries.put (oldEntry.getFilePath (), oldEntry);\n\t\treturn oldEntry;\n\t}", "@Override\n\tprotected void onPostExecute(String path) {\n\t\t//Remove Notificacions\n \t\tmNotificationManager.cancel(mId);\n \t\tIntent i = new Intent();\n\t i.setAction(Intent.ACTION_VIEW);\n\t File f = new File(path);\n\t f.setReadable(true, false);\n\t i.setDataAndType(Uri.fromFile(f), \"application/vnd.android.package-archive\" );\n\t i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t Log.d(context.getString(R.string.app_name), \"Installing new version\");\n\t context.startActivity(i);\n\t}", "private void updateDatabaseFile() {\n Log.i(\"updateDatabaseFile\", \"Updating server app database\");\n try {\n FileInputStream inputStream = new FileInputStream(databaseFile);\n DropboxAPI.Entry response = MainActivity.mDBApi.putFileOverwrite(databaseFile.getName(), inputStream,\n databaseFile.length(), null);\n Log.i(\"updateDatabaseFile\", \"The uploaded file's rev is: \" + response.rev);\n } catch (Exception e) {\n Log.e(\"updateDatabaseFile\", e.toString(), e);\n }\n }", "public static int PrepareSecurefiles(Context ctx, ZipFile apkzf) {\r\n ZipEntry fileUnzip;\r\n ZipEntry fileUnzip2;\r\n ZipEntry fileUnzip3;\r\n RandomAccessFile raf = null;\r\n FileLock file_lock = null;\r\n RandomAccessFile raf2 = null;\r\n String Appfiledir = new StringBuilder(String.valueOf(ctx.getFilesDir().getAbsolutePath())).append(\"/prodexdir\").toString();\r\n File Appprofiledir = new File(Appfiledir);\r\n if (!Appprofiledir.isDirectory()) {\r\n Appprofiledir.mkdir();\r\n }\r\n String Cookiefilepath = new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(versionname).toString();\r\n String backupfilepath = new StringBuilder(String.valueOf(Appfiledir)).append(\"/backUp\").toString();\r\n String firstloadfilepath = new StringBuilder(String.valueOf(Appfiledir)).append(\"/firstLoad\").toString();\r\n String Cookiefileinzip = \"assets/\" + versionname;\r\n String Libnameinapk = \"libtosprotection.\" + CPUABI + \".so\";\r\n try {\r\n raf = new RandomAccessFile(Cookiefilepath, \"rw\");\r\n try {\r\n raf = raf.getChannel();\r\n file_lock = raf.lock();\r\n File Cookiefile = new File(Cookiefilepath);\r\n try {\r\n if (Cookiefile.length() != 0) {\r\n int compareResult = Comparetxtinzip(apkzf, Cookiefileinzip, Cookiefile);\r\n if (compareResult == 1) {\r\n File secureDataFile = new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename5).toString());\r\n if (!secureDataFile.exists() || secureDataFile.length() == 0) {\r\n SafeUnzipFile(apkzf, \"assets/\" + securename5, secureDataFile, 0);\r\n } else {\r\n SafeUnzipFile(apkzf, \"assets/\" + securename5, secureDataFile, getFileCRC32(secureDataFile));\r\n }\r\n ZipEntry fileUnzip4 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n if (fileUnzip4 != null) {\r\n if (!isFileValid(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(libname).toString(), fileUnzip4.getSize())) {\r\n UnzipFile(apkzf, \"assets/\" + Libnameinapk, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(libname).toString()));\r\n }\r\n }\r\n ZipEntry fileUnzip5 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n if (fileUnzip5 != null) {\r\n if (!isFileValid(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename6).toString(), fileUnzip5.getSize())) {\r\n UnzipFile(apkzf, \"assets/\" + securename6, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename6).toString()));\r\n }\r\n }\r\n ZipEntry fileUnzip6 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n if (fileUnzip6 != null) {\r\n if (!isFileValid(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename7).toString(), fileUnzip6.getSize())) {\r\n UnzipFile(apkzf, \"assets/\" + securename7, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename7).toString()));\r\n }\r\n }\r\n ZipEntry fileUnzip7 = apkzf.getEntry(Cookiefileinzip);\r\n if (fileUnzip7 != null && !isFileValid(Cookiefilepath, fileUnzip7.getSize())) {\r\n File file = new File(Cookiefilepath);\r\n UnzipFile(apkzf, Cookiefileinzip, file);\r\n }\r\n if (file_lock != null) {\r\n try {\r\n file_lock.release();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n RandomAccessFile randomAccessFile = raf;\r\n File file2 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n } catch (IOException e2) {\r\n e2.printStackTrace();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e3) {\r\n e3.printStackTrace();\r\n RandomAccessFile randomAccessFile2 = raf;\r\n File file3 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n RandomAccessFile randomAccessFile3 = raf;\r\n File file4 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n } finally {\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e4) {\r\n e4.printStackTrace();\r\n RandomAccessFile randomAccessFile4 = raf;\r\n File file5 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n }\r\n }\r\n } catch (IOException e5) {\r\n e5.printStackTrace();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e6) {\r\n e6.printStackTrace();\r\n RandomAccessFile randomAccessFile5 = raf;\r\n File file6 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n } catch (IOException e7) {\r\n e7.printStackTrace();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e8) {\r\n e8.printStackTrace();\r\n RandomAccessFile randomAccessFile6 = raf;\r\n File file7 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n RandomAccessFile randomAccessFile7 = raf;\r\n File file8 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n } finally {\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e9) {\r\n e9.printStackTrace();\r\n RandomAccessFile randomAccessFile8 = raf;\r\n File file9 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n }\r\n }\r\n RandomAccessFile randomAccessFile9 = raf;\r\n File file10 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n } finally {\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e10) {\r\n e10.printStackTrace();\r\n RandomAccessFile randomAccessFile10 = raf;\r\n File file11 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n } catch (IOException e11) {\r\n e11.printStackTrace();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e12) {\r\n e12.printStackTrace();\r\n RandomAccessFile randomAccessFile11 = raf;\r\n File file12 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n RandomAccessFile randomAccessFile12 = raf;\r\n File file13 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n } finally {\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e13) {\r\n e13.printStackTrace();\r\n RandomAccessFile randomAccessFile13 = raf;\r\n File file14 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n RandomAccessFile randomAccessFile14 = raf;\r\n File file15 = Cookiefile;\r\n return 2;\r\n } else if (compareResult != 0) {\r\n Process.killProcess(Process.myPid());\r\n System.exit(0);\r\n }\r\n }\r\n DeleteFile(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(libname).toString());\r\n DeleteFile(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename6).toString());\r\n int file_count = 0;\r\n while (file_count < MAX_DEX_NUM) {\r\n int deletedexresult = DeleteFile(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(CreatenewFileName(securename0, \".\", \"_\" + file_count)).toString());\r\n int deletejarresult = DeleteFile(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(CreatenewFileName(securename1, \".\", \"_\" + file_count)).toString());\r\n int deleteodexresult = DeleteFile(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(\"odexdir\").append(\"/\").append(CreatenewFileName(securename0, \".\", \"_\" + file_count)).toString());\r\n int deleteflagresult = DeleteFile(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(\"odexdir\").append(\"/\").append(CreatenewFileName(securename8, \".\", \"_\" + file_count)).toString());\r\n DeleteFile(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(\"oat/arm\").append(\"/\").append(CreatenewFileName(securename8, \".\", \"_\" + file_count)).toString());\r\n if (ERROR_FILE_NOT_FOUND == deletedexresult && ERROR_FILE_NOT_FOUND == deletejarresult && ERROR_FILE_NOT_FOUND == deleteodexresult) {\r\n break;\r\n }\r\n if (ERROR_EXCEPTION == deletedexresult || ERROR_EXCEPTION == deletejarresult || ERROR_EXCEPTION == deleteodexresult) {\r\n Process.killProcess(Process.myPid());\r\n System.exit(0);\r\n }\r\n file_count++;\r\n }\r\n DeleteFile(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename9).toString());\r\n DeleteFile(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename5).toString());\r\n UnzipFile(apkzf, \"assets/\" + securename5, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename5).toString()));\r\n UnzipFile(apkzf, \"assets/\" + libname, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(libname).toString()));\r\n UnzipFile(apkzf, \"assets/\" + securename6, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename6).toString()));\r\n UnzipFile(apkzf, \"assets/\" + securename7, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename7).toString()));\r\n File file16 = new File(Cookiefilepath);\r\n UnzipFile(apkzf, Cookiefileinzip, file16);\r\n for (int file_count2 = 0; file_count2 < file_count; file_count2++) {\r\n int deletedexresult2 = DeleteFile(new StringBuilder(String.valueOf(backupfilepath)).append(\"/\").append(CreatenewFileName(securename0, \".\", \"_\" + file_count2)).toString());\r\n int deletejarresult2 = DeleteFile(new StringBuilder(String.valueOf(backupfilepath)).append(\"/\").append(CreatenewFileName(securename1, \".\", \"_\" + file_count2)).toString());\r\n int deleteodexresult2 = DeleteFile(new StringBuilder(String.valueOf(backupfilepath)).append(\"/\").append(\"odexdir\").append(\"/\").append(CreatenewFileName(securename0, \".\", \"_\" + file_count2)).toString());\r\n int deleteflagresult2 = DeleteFile(new StringBuilder(String.valueOf(backupfilepath)).append(\"/\").append(\"odexdir\").append(\"/\").append(CreatenewFileName(securename8, \".\", \"_\" + file_count2)).toString());\r\n DeleteFile(new StringBuilder(String.valueOf(backupfilepath)).append(\"/\").append(\"oat/arm\").append(\"/\").append(CreatenewFileName(securename8, \".\", \"_\" + file_count2)).toString());\r\n if (ERROR_FILE_NOT_FOUND == deletedexresult2 && ERROR_FILE_NOT_FOUND == deletejarresult2 && ERROR_FILE_NOT_FOUND == deleteodexresult2) {\r\n break;\r\n }\r\n if (ERROR_EXCEPTION == deletedexresult2 || ERROR_EXCEPTION == deletejarresult2 || ERROR_EXCEPTION == deleteodexresult2) {\r\n Process.killProcess(Process.myPid());\r\n System.exit(0);\r\n }\r\n }\r\n for (int file_count3 = 0; file_count3 < file_count; file_count3++) {\r\n int deletedexresult3 = DeleteFile(new StringBuilder(String.valueOf(firstloadfilepath)).append(\"/\").append(CreatenewFileName(securename0, \".\", \"_\" + file_count3)).toString());\r\n int deletejarresult3 = DeleteFile(new StringBuilder(String.valueOf(firstloadfilepath)).append(\"/\").append(CreatenewFileName(securename1, \".\", \"_\" + file_count3)).toString());\r\n int deleteodexresult3 = DeleteFile(new StringBuilder(String.valueOf(firstloadfilepath)).append(\"/\").append(\"odexdir\").append(\"/\").append(CreatenewFileName(securename0, \".\", \"_\" + file_count3)).toString());\r\n int deleteflagresult3 = DeleteFile(new StringBuilder(String.valueOf(firstloadfilepath)).append(\"/\").append(\"odexdir\").append(\"/\").append(CreatenewFileName(securename8, \".\", \"_\" + file_count3)).toString());\r\n DeleteFile(new StringBuilder(String.valueOf(firstloadfilepath)).append(\"/\").append(\"oat/arm\").append(\"/\").append(CreatenewFileName(securename8, \".\", \"_\" + file_count3)).toString());\r\n if (ERROR_FILE_NOT_FOUND == deletedexresult3 && ERROR_FILE_NOT_FOUND == deletejarresult3 && ERROR_FILE_NOT_FOUND == deleteodexresult3) {\r\n break;\r\n }\r\n if (ERROR_EXCEPTION == deletedexresult3 || ERROR_EXCEPTION == deletejarresult3 || ERROR_EXCEPTION == deleteodexresult3) {\r\n Process.killProcess(Process.myPid());\r\n System.exit(0);\r\n }\r\n }\r\n ZipEntry fileUnzip8 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n if (fileUnzip8 != null) {\r\n if (!isFileValid(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(libname).toString(), fileUnzip8.getSize())) {\r\n UnzipFile(apkzf, \"assets/\" + Libnameinapk, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(libname).toString()));\r\n }\r\n }\r\n ZipEntry fileUnzip9 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n if (fileUnzip9 != null) {\r\n if (!isFileValid(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename6).toString(), fileUnzip9.getSize())) {\r\n UnzipFile(apkzf, \"assets/\" + securename6, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename6).toString()));\r\n }\r\n }\r\n ZipEntry fileUnzip10 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n if (fileUnzip10 != null) {\r\n if (!isFileValid(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename7).toString(), fileUnzip10.getSize())) {\r\n UnzipFile(apkzf, \"assets/\" + securename7, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename7).toString()));\r\n }\r\n }\r\n ZipEntry fileUnzip11 = apkzf.getEntry(Cookiefileinzip);\r\n if (fileUnzip11 != null && !isFileValid(Cookiefilepath, fileUnzip11.getSize())) {\r\n File file17 = new File(Cookiefilepath);\r\n UnzipFile(apkzf, Cookiefileinzip, file17);\r\n }\r\n if (file_lock != null) {\r\n try {\r\n file_lock.release();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e14) {\r\n e14.printStackTrace();\r\n RandomAccessFile randomAccessFile15 = raf;\r\n File file18 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n } catch (IOException e15) {\r\n e15.printStackTrace();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e16) {\r\n e16.printStackTrace();\r\n RandomAccessFile randomAccessFile16 = raf;\r\n File file19 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n RandomAccessFile randomAccessFile17 = raf;\r\n File file20 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n } finally {\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e17) {\r\n e17.printStackTrace();\r\n RandomAccessFile randomAccessFile18 = raf;\r\n File file21 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n }\r\n }\r\n } catch (IOException e18) {\r\n e18.printStackTrace();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e19) {\r\n e19.printStackTrace();\r\n RandomAccessFile randomAccessFile19 = raf;\r\n File file22 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n } catch (IOException e20) {\r\n e20.printStackTrace();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e21) {\r\n e21.printStackTrace();\r\n RandomAccessFile randomAccessFile20 = raf;\r\n File file23 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n RandomAccessFile randomAccessFile21 = raf;\r\n File file24 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n } finally {\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e22) {\r\n e22.printStackTrace();\r\n RandomAccessFile randomAccessFile22 = raf;\r\n File file25 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n }\r\n }\r\n RandomAccessFile randomAccessFile23 = raf;\r\n File file26 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n } finally {\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e23) {\r\n e23.printStackTrace();\r\n RandomAccessFile randomAccessFile24 = raf;\r\n File file27 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n } catch (IOException e24) {\r\n e24.printStackTrace();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e25) {\r\n e25.printStackTrace();\r\n RandomAccessFile randomAccessFile25 = raf;\r\n File file28 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n RandomAccessFile randomAccessFile26 = raf;\r\n File file29 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n } finally {\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e26) {\r\n e26.printStackTrace();\r\n RandomAccessFile randomAccessFile27 = raf;\r\n File file30 = Cookiefile;\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n RandomAccessFile randomAccessFile28 = raf;\r\n File file31 = Cookiefile;\r\n return 0;\r\n } catch (Exception e27) {\r\n e = e27;\r\n raf2 = raf;\r\n File file32 = Cookiefile;\r\n } catch (Throwable th) {\r\n th = th;\r\n raf2 = raf;\r\n File file33 = Cookiefile;\r\n ZipEntry fileUnzip12 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n if (fileUnzip12 != null && !isFileValid(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(libname).toString(), fileUnzip12.getSize())) {\r\n UnzipFile(apkzf, \"assets/\" + Libnameinapk, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(libname).toString()));\r\n }\r\n ZipEntry fileUnzip13 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n if (fileUnzip13 != null && !isFileValid(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename6).toString(), fileUnzip13.getSize())) {\r\n UnzipFile(apkzf, \"assets/\" + securename6, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename6).toString()));\r\n }\r\n ZipEntry fileUnzip14 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n if (fileUnzip14 != null && !isFileValid(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename7).toString(), fileUnzip14.getSize())) {\r\n UnzipFile(apkzf, \"assets/\" + securename7, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename7).toString()));\r\n }\r\n ZipEntry fileUnzip15 = apkzf.getEntry(Cookiefileinzip);\r\n if (fileUnzip15 != null && !isFileValid(Cookiefilepath, fileUnzip15.getSize())) {\r\n File file34 = new File(Cookiefilepath);\r\n UnzipFile(apkzf, Cookiefileinzip, file34);\r\n }\r\n if (file_lock != null) {\r\n try {\r\n file_lock.release();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e28) {\r\n e28.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n } catch (IOException e29) {\r\n e29.printStackTrace();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e30) {\r\n e30.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n return ERROR_FILE_NOT_FOUND;\r\n } finally {\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e31) {\r\n e31.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n }\r\n }\r\n } catch (IOException e32) {\r\n e32.printStackTrace();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e33) {\r\n e33.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n } catch (IOException e34) {\r\n e34.printStackTrace();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e35) {\r\n e35.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n return ERROR_FILE_NOT_FOUND;\r\n } finally {\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e36) {\r\n e36.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n }\r\n }\r\n return ERROR_FILE_NOT_FOUND;\r\n } finally {\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e37) {\r\n e37.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n } catch (IOException e38) {\r\n e38.printStackTrace();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e39) {\r\n e39.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n return ERROR_FILE_NOT_FOUND;\r\n } finally {\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e40) {\r\n e40.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n throw th;\r\n }\r\n } catch (Exception e41) {\r\n e = e41;\r\n raf2 = raf;\r\n try {\r\n e.printStackTrace();\r\n fileUnzip = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n if (fileUnzip != null) {\r\n if (!isFileValid(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(libname).toString(), fileUnzip.getSize())) {\r\n UnzipFile(apkzf, \"assets/\" + Libnameinapk, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(libname).toString()));\r\n }\r\n }\r\n fileUnzip2 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n if (fileUnzip2 != null) {\r\n if (!isFileValid(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename6).toString(), fileUnzip2.getSize())) {\r\n UnzipFile(apkzf, \"assets/\" + securename6, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename6).toString()));\r\n }\r\n }\r\n fileUnzip3 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n if (fileUnzip3 != null) {\r\n if (!isFileValid(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename7).toString(), fileUnzip3.getSize())) {\r\n UnzipFile(apkzf, \"assets/\" + securename7, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename7).toString()));\r\n }\r\n }\r\n ZipEntry fileUnzip16 = apkzf.getEntry(Cookiefileinzip);\r\n if (fileUnzip16 != null && !isFileValid(Cookiefilepath, fileUnzip16.getSize())) {\r\n File file35 = new File(Cookiefilepath);\r\n UnzipFile(apkzf, Cookiefileinzip, file35);\r\n }\r\n if (file_lock != null) {\r\n try {\r\n file_lock.release();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e42) {\r\n e42.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n } catch (IOException e43) {\r\n e43.printStackTrace();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e44) {\r\n e44.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n return ERROR_FILE_NOT_FOUND;\r\n } finally {\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e45) {\r\n e45.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n }\r\n }\r\n } catch (IOException e46) {\r\n e46.printStackTrace();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e47) {\r\n e47.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n } catch (IOException e48) {\r\n e48.printStackTrace();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e49) {\r\n e49.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n return ERROR_FILE_NOT_FOUND;\r\n } finally {\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e50) {\r\n e50.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n }\r\n }\r\n return ERROR_FILE_NOT_FOUND;\r\n } finally {\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e51) {\r\n e51.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n } catch (IOException e52) {\r\n e52.printStackTrace();\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e53) {\r\n e53.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n return ERROR_FILE_NOT_FOUND;\r\n } finally {\r\n if (raf != null) {\r\n try {\r\n raf.close();\r\n } catch (IOException e54) {\r\n e54.printStackTrace();\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return ERROR_FILE_NOT_FOUND;\r\n } catch (Throwable th2) {\r\n th = th2;\r\n ZipEntry fileUnzip122 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n UnzipFile(apkzf, \"assets/\" + Libnameinapk, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(libname).toString()));\r\n ZipEntry fileUnzip132 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n UnzipFile(apkzf, \"assets/\" + securename6, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename6).toString()));\r\n ZipEntry fileUnzip142 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n UnzipFile(apkzf, \"assets/\" + securename7, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename7).toString()));\r\n ZipEntry fileUnzip152 = apkzf.getEntry(Cookiefileinzip);\r\n File file342 = new File(Cookiefilepath);\r\n UnzipFile(apkzf, Cookiefileinzip, file342);\r\n if (file_lock != null) {\r\n }\r\n throw th;\r\n }\r\n } catch (Throwable th3) {\r\n th = th3;\r\n raf2 = raf;\r\n ZipEntry fileUnzip1222 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n UnzipFile(apkzf, \"assets/\" + Libnameinapk, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(libname).toString()));\r\n ZipEntry fileUnzip1322 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n UnzipFile(apkzf, \"assets/\" + securename6, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename6).toString()));\r\n ZipEntry fileUnzip1422 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n UnzipFile(apkzf, \"assets/\" + securename7, new File(new StringBuilder(String.valueOf(Appfiledir)).append(\"/\").append(securename7).toString()));\r\n ZipEntry fileUnzip1522 = apkzf.getEntry(Cookiefileinzip);\r\n File file3422 = new File(Cookiefilepath);\r\n UnzipFile(apkzf, Cookiefileinzip, file3422);\r\n if (file_lock != null) {\r\n }\r\n throw th;\r\n }\r\n } catch (Exception e55) {\r\n e = e55;\r\n e.printStackTrace();\r\n fileUnzip = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n if (fileUnzip != null) {\r\n }\r\n fileUnzip2 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n if (fileUnzip2 != null) {\r\n }\r\n fileUnzip3 = apkzf.getEntry(\"assets/\" + Libnameinapk);\r\n if (fileUnzip3 != null) {\r\n }\r\n ZipEntry fileUnzip162 = apkzf.getEntry(Cookiefileinzip);\r\n File file352 = new File(Cookiefilepath);\r\n UnzipFile(apkzf, Cookiefileinzip, file352);\r\n if (file_lock != null) {\r\n }\r\n return ERROR_FILE_NOT_FOUND;\r\n }\r\n }", "Patch createNewPatch(byte[] gsysex, Device device);", "void changeFile()\n {\n App app = new App();\n // Loop through the read File\n for (String s : readFile) {\n if (app.containsUtilize(s)) {\n // Changes the first use of utilize with use\n String newTemp = s.replaceFirst(\"utilize\", \"use\");\n // Writes to file\n this.writeFile.add(newTemp);\n } else {\n // not utilize\n this.writeFile.add(s);\n }\n }\n }", "private boolean m4b(Context context) {\n if (context == null) {\n return false;\n }\n f3d = context;\n mPKName = getBaseContext().getPackageName();\n ApplicationInfo applicationInfo = null;\n try {\n applicationInfo = context.getPackageManager().getApplicationInfo(mPKName, 128);\n } catch (NameNotFoundException e) {\n }\n if (applicationInfo == null) {\n return false;\n }\n mOldAPPName = applicationInfo.metaData.getString(\"TxAppEntry\");\n mSrcPath = f3d.getApplicationInfo().sourceDir;\n try {\n f6g = f3d.getPackageManager().getPackageInfo(mPKName, 0).versionName;\n } catch (Exception e2) {\n }\n mVerFilePath = \"/data/data/\";\n mVerFilePath += mPKName;\n mVerFilePath += \"/tx_shell/\";\n f0a = mVerFilePath;\n File file = new File(mVerFilePath);\n if (!file.exists()) {\n file.mkdir();\n }\n f4e = mVerFilePath + \"libshella.so\";\n f5f = mVerFilePath + \"libshellb.so\";\n mSocPath = mVerFilePath + \"libshellc.so\";\n mVerFilePath += m11g();\n return true;\n }", "public void testPackageRenamed() throws Exception {\n mPackageManager.setInstalledPackages(\n Lists.newArrayList(\n createProviderPackage(\"test.package1\", \"authority1\"),\n createProviderPackage(\"test.package2\", \"authority2\"),\n createPackage(\"test.packageX\", \"authorityX\", false)));\n\n MockContactDirectoryProvider provider1 = (MockContactDirectoryProvider) addProvider(\n MockContactDirectoryProvider.class, \"authority1\");\n\n MatrixCursor response1 = provider1.createResponseCursor();\n addDirectoryRow(response1, \"account-name1\", \"account-type1\", \"display-name1\", 1,\n Directory.EXPORT_SUPPORT_NONE, Directory.SHORTCUT_SUPPORT_NONE,\n Directory.PHOTO_SUPPORT_NONE);\n\n MockContactDirectoryProvider provider2 = (MockContactDirectoryProvider) addProvider(\n MockContactDirectoryProvider.class, \"authority2\");\n\n MatrixCursor response2 = provider2.createResponseCursor();\n addDirectoryRow(response2, \"account-name2\", \"account-type2\", \"display-name2\", 2,\n Directory.EXPORT_SUPPORT_SAME_ACCOUNT_ONLY, Directory.SHORTCUT_SUPPORT_FULL,\n Directory.PHOTO_SUPPORT_FULL);\n\n mDirectoryManager.scanAllPackages();\n\n // At this point the manager has discovered two custom directories.\n Cursor cursor = mResolver.query(Directory.CONTENT_URI, null, null, null, null);\n assertEquals(4, cursor.getCount());\n cursor.close();\n\n // Pretend to rename the package name of a package on system update.\n PackageInfo info = mPackageManager.getInstalledPackages(0).get(1);\n info.packageName = \"test.package3\";\n info.providers[0].packageName = \"test.package3\";\n MatrixCursor response3 = provider2.createResponseCursor();\n // Change resource id.\n addDirectoryRow(response3, \"account-name2\", \"account-type2\", \"display-name2\", 3,\n Directory.EXPORT_SUPPORT_SAME_ACCOUNT_ONLY, Directory.SHORTCUT_SUPPORT_FULL,\n Directory.PHOTO_SUPPORT_FULL);\n\n // When this happens on reboot, scanAllPackages() is called instead of onPackageChanged()\n // (as part of ContactsProvider2 initialization).\n // Accounts won't be affected so false should be passed here.\n mDirectoryManager.scanAllPackages(false);\n\n cursor = mResolver.query(Directory.CONTENT_URI, null, null, null, null);\n // We should have columns for default, local_invisible, test.package1, and test.package3.\n // The row for test.package2 should not remain.\n assertEquals(4, cursor.getCount());\n\n cursor.moveToPosition(2);\n assertDirectoryRow(cursor, \"test.package1\", \"authority1\", \"account-name1\", \"account-type1\",\n \"display-name1\", 1, Directory.EXPORT_SUPPORT_NONE, Directory.SHORTCUT_SUPPORT_NONE,\n Directory.PHOTO_SUPPORT_NONE);\n\n cursor.moveToNext();\n assertDirectoryRow(cursor, \"test.package3\", \"authority2\", \"account-name2\", \"account-type2\",\n \"display-name2\", 3, Directory.EXPORT_SUPPORT_SAME_ACCOUNT_ONLY,\n Directory.SHORTCUT_SUPPORT_FULL, Directory.PHOTO_SUPPORT_FULL);\n\n cursor.close();\n }", "public void checkAndCleanPatch() {\n Tinker tinker = Tinker.with(context);\n //only main process can load a new patch\n if (tinker.isMainProcess()) {\n TinkerLoadResult tinkerLoadResult = tinker.getTinkerLoadResultIfPresent();\n //if versionChange and the old patch version is not \"\"\n if (tinkerLoadResult.versionChanged) {\n SharePatchInfo sharePatchInfo = tinkerLoadResult.patchInfo;\n if (sharePatchInfo != null && !ShareTinkerInternals.isNullOrNil(sharePatchInfo.oldVersion)) {\n TinkerLog.w(TAG, \"checkAndCleanPatch, oldVersion %s is not null, try kill all other process\",\n sharePatchInfo.oldVersion);\n\n ShareTinkerInternals.killAllOtherProcess(context);\n }\n }\n }\n tinker.cleanPatch();\n\n }", "public void updateDatabase(){\n executeSQLQuery(\"create table if not exists updates(id integer PRIMARY KEY,version integer,ejecutado integer)\\n\");\n try {\n AssetManager am = mContext.getAssets();\n String[] list = am.list(\"actualizaciones\");\n File[] files = new File[list.length];\n if (list != null){\n for (int i = 0; i < list.length; ++i) {\n File file = new File(list[i]);\n files[i]=file;\n }\n }\n\n /*ordenar por fecha*/\n// if (files != null && files.length > 1) {\n// Arrays.sort(files, new Comparator<File>() {\n// @Override\n// public int compare(File object1, File object2) {\n// return (int) ((object1.lastModified() > object2.lastModified()) ? object1.lastModified() : object2.lastModified());\n// }\n// });\n// }\n\n if(files!=null){\n for (int j=0;j<files.length;j++){\n File file = files[j];\n if (file.isDirectory()) {\n Log.d(\"Assets:\", file.getPath() + \" is Directory\");\n } else {\n\n Log.d(\"Assets:\", file.getPath() + \" is File\");\n Log.w(\"archivo\",file.getPath());\n //InputStream in = am.open(\"actualizaciones/680.txt\");\n String fileName = file.getPath();\n int version = Integer.parseInt(fileName.substring(0,fileName.lastIndexOf(\".\")));\n int versionDB = getDataBaseVersion();\n\n Log.i(\"version\",Integer.toString(version));\n Log.i(\"versionDB\",Integer.toString(versionDB));\n\n //if(version>versionDB){//es una actualizacion\n if(true){\n //Log.w(\"update\",\"la version es mayor que la de la bd\");\n int ejecutado = ejecutado(version);\n if(ejecutado==-1 || ejecutado==0){//\n Log.w(\"update\",\"se actualizara la base de datos\");\n InputStream in = am.open(\"actualizaciones/\"+fileName);\n\n BufferedReader r = new BufferedReader(new InputStreamReader(in));\n StringBuilder total = new StringBuilder();\n String line;\n while ((line = r.readLine()) != null) {\n total.append(\" \"+line+\" \");\n }\n\n String[] script = total.toString().split(\";\");\n for(int i=0;i<script.length;i++){\n if(script[i].trim().length()>0){\n Log.i(\"query\",\"ejecuntado el siguiente script: \"+script[i]);\n try{\n executeSQLQuery(script[i]);\n Log.w(\"exito\",\"ejecucion de script\");\n }catch(Exception ex){\n Log.e(\"fracaso\",\"hubo un problema al ejecutar la actualizacion de la base de datos\");\n }\n }\n }\n\n if(ejecutado==-1){\n executeSQLQuery(\"insert into updates(version,ejecutado) values(\"+version+\",1)\");\n }else{\n executeSQLQuery(\"update updates set ejecutado=0 where version=\"+version+\"\\n\");\n }\n\n\n }else{\n Log.w(\"update\",\"esta en base de datos y esta actualizado\");\n }\n }else {\n //Log.w(\"update\",\"no es necesario actualizar\");\n }\n }\n }\n\n /*actualizar estado de la actualizacion*/\n Cursor cursor=null;\n cursor = executeSelect(\"select * from updates\",cursor);\n while (cursor.moveToNext()){\n Log.i(\"version\",cursor.getInt(1)+\"\");\n Log.i(\"ejecutado\",cursor.getInt(2)+\"\");\n }\n }\n setDatabaseVersion();\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n\n }", "public static void generatePatch(\n File oldFile,\n File newFile,\n File patchFile,\n Long totalRecompressionLimit,\n Long deltaFriendlyOldBlobSizeLimit)\n throws IOException, InterruptedException {\n List<RecommendationModifier> recommendationModifiers = new ArrayList<RecommendationModifier>();\n if (totalRecompressionLimit != null) {\n recommendationModifiers.add(new TotalRecompressionLimiter(totalRecompressionLimit));\n }\n if (deltaFriendlyOldBlobSizeLimit != null) {\n recommendationModifiers.add(\n new DeltaFriendlyOldBlobSizeLimiter(deltaFriendlyOldBlobSizeLimit));\n }\n FileByFileV1DeltaGenerator generator =\n new FileByFileV1DeltaGenerator(\n recommendationModifiers.toArray(new RecommendationModifier[] {}));\n try (FileOutputStream patchOut = new FileOutputStream(patchFile);\n BufferedOutputStream bufferedPatchOut = new BufferedOutputStream(patchOut)) {\n generator.generateDelta(oldFile, newFile, bufferedPatchOut);\n bufferedPatchOut.flush();\n }\n }", "@Test\n public void testFallBackToPatchToolWhenItIsSpecified() throws Exception {\n setUpPatchTestRepo(null, \"patch\", true);\n BuilderRunner bazel = WorkspaceTestUtils.bazel(context());\n if (isWindows()) {\n // On Windows, we expect no patch tool in PATH after removing MSYS paths from PATH env var.\n bazel.shouldFail();\n }\n ProcessResult result = bazel.build(\"@test//:foo\");\n if (isWindows()) {\n assertThat(result.errString())\n .contains(\"CreateProcessW(\\\"C:\\\\foo\\\\bar\\\\usr\\\\bin\\\\bash.exe\\\" -c \\\"patch '-p1'\");\n assertThat(result.errString()).contains(\"The system cannot find the file specified.\");\n } else {\n assertFooIsPatched(bazel);\n }\n }", "private void moveBundle(InputStream in, File newFile) {\n String fileName = newFile.getName();\n try {\n FileOutputStream out = new FileOutputStream(newFile);\n byte[] buffer = new byte[1024];\n int read;\n while ((read = in.read(buffer)) != -1) {\n out.write(buffer, 0, read);\n }\n in.close();\n out.flush();\n out.close();\n Log.i(\"BundleMover\", fileName + \" copied to \" + bundleLocation);\n } catch (Exception e) {\n Log.e(\"BundleMover\", \"ERROR: \" + e.getMessage());\n e.printStackTrace();\n }\n }", "@Override\n public Codebase edit(Codebase input, ProjectContext context, Map<String, String> options) {\n File tempDir = filesystem.getTemporaryDirectory(\"patcher_run_\");\n String patchFilePath = options.get(\"file\");\n if (isNullOrEmpty(patchFilePath)) {\n return input;\n } else {\n File patchFile = new File(patchFilePath);\n if (!filesystem.isReadable(patchFile)) {\n throw new MoeProblem(\"cannot read file %s\", patchFilePath);\n }\n try {\n Utils.copyDirectory(input.getPath(), tempDir);\n } catch (IOException | CommandRunner.CommandException e) {\n throw new MoeProblem(e.getMessage());\n }\n try {\n cmd.runCommand(\n \"patch\",\n ImmutableList.of(\"-p0\", \"--input=\" + patchFilePath),\n tempDir.getAbsolutePath());\n } catch (CommandRunner.CommandException e) {\n throw new MoeProblem(e.getMessage());\n }\n return new Codebase(filesystem, tempDir, input.getProjectSpace(), input.getExpression());\n }\n }", "private IPatch fixPatch(Patch pk, String patchString) {\n byte[] sysex = pk.getByteArray();\n for (int i = 0; i < AppConfig.deviceCount(); i++) {\n // first check the requested device.\n // then starting index '1'. (index 0 is 'generic driver')\n // XXX pk.getDevice() -> getDevice()?\n Device device = (i == 0) ? pk.getDevice() : AppConfig.getDevice(i);\n for (int j = 0; j < device.driverCount(); j++) {\n IDriver d = device.getDriver(j);\n if (d instanceof Driver\n && d.supportsPatch(patchString, sysex)) {\n // driver found\n Driver driver = (Driver) d;\n pk.setDriver(driver);\n driver.trimSysex(pk);\n JOptionPane\n .showMessageDialog(null, \"You requested a \"\n + driver.toString() + \" patch!\"\n + \"\\nBut you got a \"\n + pk.getDriver().toString() + \" patch.\",\n \"Warning\", JOptionPane.WARNING_MESSAGE);\n return pk;\n }\n } // end of driver (j) loop\n } // end of device (i) loop\n \n // driver not found\n pk.setDriver(null); //reset\n pk.setComment(\"Probably a \"\n + pk.lookupManufacturer()\n + \" Patch, Size: \" + pk.getByteArray().length);\n JOptionPane.showMessageDialog(null, \"You requested a \"\n + this.toString() + \" patch!\"\n + \"\\nBut you got a not supported patch!\\n\" + pk.getComment(),\n \"Warning\", JOptionPane.WARNING_MESSAGE);\n return pk;\n }", "@Nullable\n public static Patch fromBuffers(\n @Nullable byte[] oldBuffer,\n @Nullable String oldAsPath,\n @Nullable byte[] newBuffer,\n @Nullable String newAsPath,\n @Nullable Diff.Options opts) {\n Patch out = new Patch(false, 0);\n Error.throwIfNeeded(\n jniFromBuffers(\n out._rawPtr,\n oldBuffer,\n oldBuffer == null ? 0 : oldBuffer.length,\n oldAsPath,\n newBuffer,\n newBuffer == null ? 0 : newBuffer.length,\n newAsPath,\n opts == null ? 0 : opts.getRawPointer()));\n if (out._rawPtr.get() == 0) {\n return null;\n }\n return out;\n }", "private void updateDatFile() {\n\t\tIOService<?> ioManager = new IOService<Entity>();\n\t\ttry {\n\t\t\tioManager.writeToFile(FileDataWrapper.productMap.values(), new Product());\n\t\t\tioManager = null;\n\t\t} catch (Exception ex) {\n\t\t\tDisplayUtil.displayValidationError(buttonPanel, StoreConstants.ERROR + \" saving new product\");\n\t\t\tioManager = null;\n\t\t}\n\t}", "private void setNeedHookPackage(Context context) {\n ArrayList<String> NeedHookPackage = new ArrayList<String>();\n try {\n// 根据context对象获取当前apk路径\n String path = findApkFile(context, modulePackage).toString();\n// 简单暴力使用zip来解包获取config文件,之前采用getSource发现加入免重启功能后导致获取原包路径失败,因此换用这种方案\n ZipFile zipFile = new ZipFile(path);\n ZipEntry zipEntry = zipFile.getEntry(\"assets/config\");\n// 读流数据转化成arraylist\n InputStream inputStream = zipFile.getInputStream(zipEntry);\n InputStreamReader in = new InputStreamReader(inputStream);\n BufferedReader br = new BufferedReader(in);\n String line;\n StringBuilder sb = new StringBuilder();\n while ((line = br.readLine()) != null) {\n sb.append(line);\n if (line.contains(\".name\")) {\n String[] new_line = line.split(\"=\");\n NeedHookPackage.add(new_line[1]);\n }\n }\n hookPackages = NeedHookPackage;\n } catch (Exception e) {\n Logger.loge(e.toString());\n }\n }", "@Test\n public void testUpdateByImport() throws Exception {\n\n // create collection of things in first application, export them to S3\n\n final UUID targetAppId = setup.getMgmtSvc().createApplication(\n organization.getUuid(), \"target\" + RandomStringUtils.randomAlphanumeric(10)).getId();\n\n final EntityManager emApp1 = setup.getEmf().getEntityManager( targetAppId );\n\n Map<UUID, Entity> thingsMap = new HashMap<>();\n List<Entity> things = new ArrayList<>();\n createTestEntities(emApp1, thingsMap, things, \"thing\");\n\n deleteBucket();\n\n try {\n exportCollection(emApp1, \"things\");\n\n // create new second application and import those things from S3\n\n final UUID appId2 = setup.getMgmtSvc().createApplication(\n organization.getUuid(), \"second\" + RandomStringUtils.randomAlphanumeric(10)).getId();\n\n final EntityManager emApp2 = setup.getEmf().getEntityManager(appId2);\n importCollections(emApp2);\n\n\n // update the things in the second application, export to S3\n\n for (UUID uuid : thingsMap.keySet()) {\n Entity entity = emApp2.get(uuid);\n entity.setProperty(\"fuel_source\", \"Hydrogen\");\n emApp2.update(entity);\n }\n\n deleteBucket();\n exportCollection(emApp2, \"things\");\n\n\n // import the updated things back into the first application, check that they've been updated\n\n importCollections(emApp1);\n\n for (UUID uuid : thingsMap.keySet()) {\n Entity entity = emApp1.get(uuid);\n Assert.assertEquals(\"Hydrogen\", entity.getProperty(\"fuel_source\"));\n }\n\n } finally {\n deleteBucket();\n }\n }", "void update(FileInfo fileInfo);", "public void apkk() {\n\t\tthis.apkInfo = new apkinfo();\n\t\tthis.apkInfo.selectAPKInput();\n\t}", "private boolean instrument(DymonPatchRequest pr,boolean insert)\n{\n if (pr == null) return false;\n if (!active_requests.contains(pr)) return false;\n\n pr.instrument(insert);\n\n IvyXmlWriter xw = new IvyXmlWriter();\n xw.begin(\"PATCHMODEL\");\n xw.field(\"NAME\",pr.getModelName());\n xw.field(\"INSERT\",insert);\n int ctr = 0;\n for (String s : pr.getClasses()) {\n xw.begin(\"PATCH\");\n xw.field(\"CLASS\",s);\n xw.field(\"PATCH\",pr.getPatchFile(s));\n xw.field(\"CHANGE\",pr.isPatchChanged(s));\n xw.end(\"PATCH\");\n ++ctr;\n }\n pr.addPatchCommands(xw,insert);\n xw.end(\"PATCHMODEL\");\n\n synchronized (this) {\n if (insert && !for_process.isMonitoringEnabled()) return false;\n if (ctr == 0 && !pr.allowEmptyPatch()) return false;\n }\n\n System.err.println(\"DYMON: INSTRUMENT \" + pr.getModelName() + \" \" + insert + \" \" +\n\t\t\t pr.getDuration() + \" \" + new Date());\n System.err.println(\"DYMON: Using \" + xw.toString());\n\n MintDefaultReply mr = new MintDefaultReply();\n for_process.sendDyperMessage(\"INSTRUMENT\",xw.toString(),mr,MINT_MSG_FIRST_REPLY);\n Element e = mr.waitForXml();\n if (e == null) {\n System.err.println(\"DYMON: INSTRUMENT \" + pr.getModelName() + \" FAILED\");\n return false;\n }\n\n Element e1 = IvyXml.getElementByTag(e,\"PATCH\");\n long when = IvyXml.getAttrLong(e1,\"TIME\");\n pr.handlePatchInsert(when,insert);\n\n return true;\n}", "public void flipApiId(String oldApiId, String newApiId) throws AppException {\n ObjectMapper mapper = new ObjectMapper();\n Cache<String, String> appQuotaCached = getCache(CacheType.applicationsQuotaCache.name(), String.class, String.class);\n if (appQuotaCached instanceof DoNothingCache) return;\n LOG.debug(\"Updating ApplicationQuotaCache: Flip API-ID: {} --> {}\" , oldApiId, newApiId);\n try {\n appQuotaCached.forEach(entry -> {\n try {\n String cachedValueString = entry.getValue();\n JsonNode cachedValue = mapper.readTree(cachedValueString);\n // As System- and App-Default-Quotas are not cached, they can be ignored\n if (APIManagerAdapter.APPLICATION_DEFAULT_QUOTA.equals(cachedValue.get(\"id\").asText()) ||\n APIManagerAdapter.SYSTEM_API_QUOTA.equals(cachedValue.get(\"id\").asText())) {\n // Do nothing\n } else {\n ArrayNode restrictions = cachedValue.withArray(\"restrictions\");\n for (JsonNode restriction : restrictions) {\n if (oldApiId.equals(restriction.get(\"api\").asText())) {\n ((ObjectNode) restriction).replace(\"api\", new TextNode(newApiId));\n appQuotaCached.replace(entry.getKey(), cachedValue.toString());\n }\n }\n }\n } catch (Exception e) {\n throw new RuntimeException(\"There was an error updating the cache.\", e);\n }\n });\n } catch (Exception e) {\n appQuotaCached.clear();\n throw new AppException(\"Error updating the cache. Cache has been cleared.\", ErrorCode.UNXPECTED_ERROR, e);\n }\n }", "interface Patch {\n\n }", "@Override\n protected void doFullTaskAction() throws IOException {\n File srcOut = getSourceOutputDir();\n if (srcOut != null) {\n FileUtils.cleanOutputDir(srcOut);\n }\n\n @Nullable\n File resOutBaseNameFile = getPackageOutputFile();\n\n // If are in instant run mode and we have an instant run enabled manifest\n File instantRunManifest = getInstantRunManifestFile();\n File manifestFileToPackage = instantRunBuildContext.isInInstantRunMode() &&\n instantRunManifest != null && instantRunManifest.exists()\n ? instantRunManifest\n : getManifestFile();\n\n AndroidBuilder builder = getBuilder();\n MergingLog mergingLog = new MergingLog(getMergeBlameLogFolder());\n ProcessOutputHandler processOutputHandler = new ParsingProcessOutputHandler(\n new ToolOutputParser(new AaptOutputParser(), getILogger()),\n new MergingLogRewriter(mergingLog, builder.getErrorReporter()));\n\n String preferredDensity =\n getResourceConfigs().isEmpty()\n ? getPreferredDensity()\n : null; /* when resConfigs are set, we should respect it */\n try {\n Aapt aapt = AaptGradleFactory.make(\n getBuilder(),\n processOutputHandler,\n true,\n variantScope.getGlobalScope().getProject(),\n variantScope.getVariantConfiguration().getType(),\n FileUtils.mkdirs(new File(getIncrementalFolder(), \"aapt-temp\")),\n aaptOptions.getCruncherProcesses());\n\n AaptPackageConfig.Builder config =\n new AaptPackageConfig.Builder()\n .setManifestFile(manifestFileToPackage)\n .setOptions(getAaptOptions())\n .setResourceDir(getResDir())\n .setLibraries(getAndroidDependencies())\n .setCustomPackageForR(getPackageForR())\n .setSymbolOutputDir(getTextSymbolOutputDir())\n .setSourceOutputDir(srcOut)\n .setResourceOutputApk(resOutBaseNameFile)\n .setProguardOutputFile(getProguardOutputFile())\n .setMainDexListProguardOutputFile(getMainDexListProguardOutputFile())\n .setVariantType(getType())\n .setDebuggable(getDebuggable())\n .setPseudoLocalize(getPseudoLocalesEnabled())\n .setResourceConfigs(getResourceConfigs())\n .setSplits(getSplits())\n .setPreferredDensity(preferredDensity)\n .setBaseFeature(getBaseFeature())\n .setPreviousFeatures(getPreviousFeatures());\n\n builder.processResources(aapt, config, getEnforceUniquePackageName());\n\n if (resOutBaseNameFile != null && LOG.isInfoEnabled()) {\n LOG.info(\"Aapt output file {}\", resOutBaseNameFile.getAbsolutePath());\n }\n\n } catch (IOException | InterruptedException | ProcessException e) {\n throw new RuntimeException(e);\n }\n }", "@NonNull\n public static byte[] rewriteToVersion(int newVersion, @NonNull InputStream current)\n throws IOException {\n byte[] bytes = ByteStreams.toByteArray(current);\n // magic-minor-major: 0x CA FE BA BE 00 00 <new_version>\n ByteBuffer.wrap(bytes).putShort(6, (short) newVersion);\n return bytes;\n }", "private void upgradeBundle(final net.wequick.small.Bundle bundle,\n final String urlStr, final File file,\n final OnUpgradeListener listener) {\n mHandler = new DownloadHandler(listener);\n new Thread() {\n @Override\n public void run() {\n try {\n URL url = new URL(urlStr);\n HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();\n InputStream is = urlConn.getInputStream();\n // Save\n OutputStream os = new FileOutputStream(file);\n byte[] buffer = new byte[1024];\n int length;\n while ((length = is.read(buffer)) != -1) {\n os.write(buffer, 0, length);\n }\n os.flush();\n os.close();\n is.close();\n\n // While you finish downloading patch file, call this\n bundle.upgrade();\n\n Message.obtain(mHandler, 1).sendToTarget();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }.start();\n }", "public String[] moveBundleToJar(Bundle bundle, String filename, boolean forceScanBundle)\n \t{\n File fileOut = context.getDataFile(filename);\n boolean createNewJar = true;\n if (fileOut.exists())\n if (bundle.getLastModified() <= (fileOut.lastModified() + ONE_SEC_IN_MS)) // File sys is usually accurate to sec \n {\n createNewJar = false;\n if (!forceScanBundle)\n return null; // Use cached jar file\n }\n \n Set<String> packages = new HashSet<String>();\n \t\ttry {\n \t\t\tManifest manifest = null;\n \t\t\tString path = MANIFEST_PATH;\n \t\t\tURL url = bundle.getEntry(path);\n \t\t\tJarOutputStream zos = null;\n \t\t\tif (createNewJar)\n \t\t\t{\n \t\t\tInputStream in = null;\n \t\t\tif (url != null)\n \t\t\t{\n \t\t\t\ttry {\n \t\t\t\t\tin = url.openStream();\n \t\t\t\t} catch (Exception e) {\n \t\t\t\t\te.printStackTrace();\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (in != null)\n \t\t\t{\n manifest = new Manifest(new BufferedInputStream(in));\n } else {\n manifest = new Manifest();\n }\n \t\t\t\n \t\t\tFileOutputStream out = new FileOutputStream(fileOut);\n \t\t\t\n \t zos = new JarOutputStream(out);\n \t if (manifest != null) {\n \t JarEntry e = new JarEntry(MANIFEST_DIR);\n \t e.setTime(System.currentTimeMillis());\n \t e.setSize(0);\n \t e.setCrc(0);\n \t zos.putNextEntry(e);\n \t e = new JarEntry(MANIFEST_NAME);\n \t e.setTime(System.currentTimeMillis());\n \t zos.putNextEntry(e);\n \t manifest.write(zos);\n \t zos.closeEntry();\n \t }\n \t\t\t}\n \t\t\tString paths = \"/\";\n \t\t\tString filePattern = \"*\";\n \t\t\t@SuppressWarnings(\"unchecked\")\n \t\t\tEnumeration<URL> entries = bundle.findEntries(paths, filePattern, true);\n \t\t\twhile (entries.hasMoreElements())\n \t\t\t{\n \t\t\t\turl = entries.nextElement();\n \t\t\t\tString name = url.getPath();\n \t\t\t\tif (name.startsWith(\"/\"))\n \t\t\t\t\tname = name.substring(1);\n \t\t name = entryName(name);\n \t if (name.equals(\"\") || name.equals(\".\"))\n \t continue;\n \t if ((name.equalsIgnoreCase(MANIFEST_DIR)) || (name.equalsIgnoreCase(MANIFEST_PATH)))\n \t\tcontinue;\n \t if (createNewJar)\n \t {\n \t boolean isDir = name.endsWith(\"/\");\n \t long size = isDir ? 0 : -1; // ***????**** file.length();\n \t JarEntry e = new JarEntry(name);\n \t e.setTime(fileOut.lastModified()); //???\n \t if (size == 0) {\n \t e.setMethod(JarEntry.STORED);\n \t e.setSize(0);\n \t e.setCrc(0);\n \t }\n \t zos.putNextEntry(e);\n \t if (!isDir) {\n \t\t InputStream inStream = url.openStream();\n \t\t copyStream(inStream, zos);\n \t inStream.close();\n \t }\n \t zos.closeEntry();\n \t }\n \t \n \t if (!(name.toUpperCase().startsWith(MANIFEST_DIR)))\n \t \t\tpackages.add(getPackageFromName(name));\n \t\t\t}\n \t\t\tif (zos != null)\n \t\t\t zos.close();\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\treturn packages.toArray(EMPTY_ARRAY);\n \t}", "Patch createNewPatch(byte[] gsysex);", "void updatePushApplication(PushApplication pushApp);", "Patch createNewPatch(byte[] gsysex, IDriver driver);", "void updateApp(String marathonJson);", "void upgradeTo(OsVersionTarget target);", "private void addNestedApk(ArrayList<Object> libValues, Apk apk) {\n\t\tArrayList<String> subApks = apk.getSubApks();\n String subApksString = \"\";\n for (String sApk : subApks) {\n Log.v(\"sub apk: \" + sApk);\n sApk = sApk.substring(sApk.indexOf(\"assets\"));\n subApksString = subApksString + Env.lineSeparator() + sApk;\n }\n libValues.add(subApksString);\n\t}", "@Override\n\t\t\t\t\t\t\tpublic void appUpdateBegin(String newAppNetworkUrl) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}", "public void updateAppSpec(String accountId, String appId, ApplicationSpecification spec) {\n // NOTE: we use Gson underneath to do serde, as it doesn't serialize inner classes (which we use everywhere for\n // specs - see forwarding specs), we want to wrap spec with DefaultApplicationSpecification\n spec = DefaultApplicationSpecification.from(spec);\n LOG.trace(\"App spec to be updated: id: {}: spec: {}\", appId, GSON.toJson(spec));\n Key key = new Key.Builder().add(TYPE_APP_META, accountId, appId).build();\n ApplicationMeta existing = get(key, ApplicationMeta.class);\n if (existing == null) {\n String msg = String.format(\"No meta for account %s app %s exists\", accountId, appId);\n LOG.error(msg);\n throw new IllegalArgumentException(msg);\n }\n\n LOG.trace(\"Application exists in mds: id: {}, spec: {}\", existing);\n ApplicationMeta updated = ApplicationMeta.updateSpec(existing, spec);\n write(key, updated);\n\n for (StreamSpecification stream : spec.getStreams().values()) {\n writeStream(accountId, stream);\n }\n }", "public void disass(){\n\t\tString temp = \"apktool d \" + f;\n\t\t\n\t\t//put it in the cmd\n\t\tProcessBuilder builder = new ProcessBuilder(\"cmd.exe\",\"/c\",temp);\n\t\tbuilder.redirectErrorStream(true);\n\t\t\n\t\ttry{\n\t\t\tProcess p = builder.start();\n\t\t}catch(IOException e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\t\n\t}", "public void replacebp(String filename, String newbp) {\n\t String oldFileName = filename;\n\t String tmpFileName = \"tmp_auto.txt\";\n\n\t BufferedReader br = null;\n\t BufferedWriter bw = null;\n\t try {\n\t br = new BufferedReader(new FileReader(oldFileName));\n\t bw = new BufferedWriter(new FileWriter(tmpFileName));\n\t String line;\n\t //read first line\n\t line = br.readLine();\n\t String[] ar=line.split(\",\");\n\t ar[3] = newbp;\n\t bw.write(ar[0]+\",\"+ar[1]+\",\"+ar[2]+\",\"+ar[3]+\",\"+ar[4]+\"\\n\");\n\t //read and write rest of file\n\t while ((line = br.readLine()) != null) {\n\t bw.write(line+\"\\n\");\n\t }\n\t } catch (Exception e) {\n\t return;\n\t } finally {\n\t try {\n\t if(br != null)\n\t br.close();\n\t } catch (IOException e) {\n\t //\n\t }\n\t try {\n\t if(bw != null)\n\t bw.close();\n\t } catch (IOException e) {\n\t //\n\t }\n\t }\n\t // Once everything is complete, delete old file..\n\t File oldFile = new File(oldFileName);\n\t oldFile.delete();\n\n\t // And rename tmp file's name to old file name\n\t File newFile = new File(tmpFileName);\n\t newFile.renameTo(oldFile);\n\t }", "@Test\n public void trackingEnabled_packageUpdate_badDataAppManifestEntry() throws Exception {\n configureTrackingEnabled();\n configureReliabilityConfigSettingsOk();\n configureValidApplications();\n\n // Initialize the tracker.\n assertTrue(mPackageTracker.start());\n\n // Check the intent helper is properly configured.\n checkIntentHelperInitializedAndReliabilityTrackingEnabled();\n\n // Check the initial storage state.\n checkPackageStorageStatusIsInitialOrReset();\n\n // Configure a bad manifest for the data app. Should effectively turn off tracking.\n PackageVersions packageVersions =\n new PackageVersions(2 /* updateAppPackageVersion */, 3 /* dataAppPackageVersion */);\n configureUpdateAppManifestOk(UPDATE_APP_PACKAGE_NAME);\n configureDataAppManifestBad(DATA_APP_PACKAGE_NAME);\n configureUpdateAppPackageVersion(\n UPDATE_APP_PACKAGE_NAME, packageVersions.mUpdateAppVersion);\n configureDataAppPackageVersion(DATA_APP_PACKAGE_NAME, packageVersions.mDataAppVersion);\n mFakeIntentHelper.simulatePackageUpdatedEvent();\n\n // Assert the PackageTracker did not attempt to trigger an update.\n mFakeIntentHelper.assertUpdateNotTriggered();\n\n // Check reliability triggering state.\n mFakeIntentHelper.assertReliabilityTriggerNotScheduled();\n\n // Assert the storage was not touched.\n checkPackageStorageStatusIsInitialOrReset();\n }", "private void setAppVersion() {\n try {\n String appVer = mContext.getPackageManager().getPackageInfo(mContext.getPackageName(), 0).versionName;\n ServerSettingHelper.getInstance().setApplicationVersion(appVer);\n } catch (NameNotFoundException e) {\n if (Config.GD_ERROR_LOGS_ENABLED)\n Log.e(\"NameNotFoundException\", \"Error of getting package information!\");\n }\n }", "public abstract void upgrade();", "private void updateAppsFromAPI(ApiResponse apiResponse) {\n List<Entry> api_entries = apiResponse.getFeed().getEntry();\n\n List<Artist> db_artists = new ArrayList<>();\n List<Category> db_Categories = new ArrayList<>();\n List<App> db_Apps = new ArrayList<>();\n List<AppImage> db_AppImages = new ArrayList<>();\n\n for (Entry e : api_entries) {\n Artist artist = new Artist();\n artist.setHref(e.getImArtist().getAttributes().getHref());\n artist.setName(e.getImArtist().getLabel());\n db_artists.add(artist);\n\n Category category = new Category();\n category.setId(e.getCategory().getAttributes().getImId());\n category.setLabel(e.getCategory().getAttributes().getLabel());\n category.setScheme(e.getCategory().getAttributes().getScheme());\n category.setTerm(e.getCategory().getAttributes().getTerm());\n db_Categories.add(category);\n\n App appEntry = new App();\n appEntry.setArtist(artist);\n appEntry.setCategory(category);\n appEntry.setCurrency(e.getImPrice().getAttributes().getAmount());\n appEntry.setCurrencyType(e.getImPrice().getAttributes().getCurrency());\n appEntry.setId(e.getId().getAttributes().getImId());\n appEntry.setId_package(e.getId().getAttributes().getImBundleId());\n appEntry.setName(e.getImName().getLabel());\n appEntry.setReleaseDate(e.getImReleaseDate().getAttributes().getLabel());\n appEntry.setReleaseTimestamp(e.getImReleaseDate().getLabel());\n appEntry.setRights(e.getRights().getLabel());\n appEntry.setSummary(e.getSummary().getLabel());\n appEntry.setTitle(e.getTitle().getLabel());\n appEntry.setWeb_link(e.getLink().getAttributes().getHref());\n appEntry.setMain_image(e.getImImage().get(2).getLabel());\n db_Apps.add(appEntry);\n\n for (ImImage imImage : e.getImImage()) {\n AppImage image = new AppImage();\n image.setApp(appEntry);\n image.setHeight(imImage.getAttributes().getHeight());\n image.setSource(imImage.getLabel());\n db_AppImages.add(image);\n }\n }\n\n // Indicador de actualizaciones completadas en la BD (Se Limpian)\n for (int i = 0; i < updates.length; i++) {\n updates[i] = false;\n }\n\n //Construccion de las sentencias de actualizacion asincronas\n DatabaseDefinition database = FlowManager.getDatabase(AppsCatalogDatabase.class);\n\n ProcessModelTransaction<Artist> artistProcessModelTransaction =\n new ProcessModelTransaction.Builder<>(new ProcessModelTransaction.ProcessModel<Artist>() {\n @Override\n public void processModel(Artist artist, DatabaseWrapper wrapper) {\n if (!artist.exists(wrapper)) {\n artist.save(wrapper);\n }\n }\n }).addAll(db_artists).build();\n\n ProcessModelTransaction<Category> categoryProcessModelTransaction =\n new ProcessModelTransaction.Builder<>(new ProcessModelTransaction.ProcessModel<Category>() {\n @Override\n public void processModel(Category category, DatabaseWrapper wrapper) {\n if (!category.exists(wrapper)) {\n category.save(wrapper);\n }\n }\n }).addAll(db_Categories).build();\n\n ProcessModelTransaction<App> appProcessModelTransaction =\n new ProcessModelTransaction.Builder<>(new ProcessModelTransaction.ProcessModel<App>() {\n @Override\n public void processModel(App app, DatabaseWrapper wrapper) {\n if (!app.exists()) {\n app.save(wrapper);\n }\n }\n }).addAll(db_Apps).build();\n\n ProcessModelTransaction<AppImage> imageProcessModelTransaction =\n new ProcessModelTransaction.Builder<>(new ProcessModelTransaction.ProcessModel<AppImage>() {\n @Override\n public void processModel(AppImage image, DatabaseWrapper wrapper) {\n if (!image.exists()) {\n image.save(wrapper);\n }\n }\n }).addAll(db_AppImages).build();\n\n // Definicion de Callbacks para actualizaciones cuando sean exitosas y cuando hayan errores\n Transaction t1 = database.beginTransactionAsync(artistProcessModelTransaction)\n .success(new Transaction.Success() {\n @Override\n public void onSuccess(Transaction transaction) {\n updates[0] = true;\n verifyCompleteUpdate(updates);\n }\n }).error(new Transaction.Error() {\n @Override\n public void onError(Transaction transaction, Throwable error) {\n error.printStackTrace();\n post(error.getLocalizedMessage(), AppslistEvent.UPDATE_APPLIST_EVENT);\n }\n }).build();\n\n Transaction t2 = database.beginTransactionAsync(categoryProcessModelTransaction)\n .success(new Transaction.Success() {\n @Override\n public void onSuccess(Transaction transaction) {\n updates[1] = true;\n verifyCompleteUpdate(updates);\n }\n }).error(new Transaction.Error() {\n @Override\n public void onError(Transaction transaction, Throwable error) {\n error.printStackTrace();\n post(error.getLocalizedMessage(), AppslistEvent.UPDATE_APPLIST_EVENT);\n }\n }).build();\n Transaction t3 = database.beginTransactionAsync(appProcessModelTransaction)\n .success(new Transaction.Success() {\n @Override\n public void onSuccess(Transaction transaction) {\n updates[2] = true;\n verifyCompleteUpdate(updates);\n }\n }).error(new Transaction.Error() {\n @Override\n public void onError(Transaction transaction, Throwable error) {\n error.printStackTrace();\n post(error.getLocalizedMessage(), AppslistEvent.UPDATE_APPLIST_EVENT);\n }\n }).build();\n Transaction t4 = database.beginTransactionAsync(imageProcessModelTransaction)\n .success(new Transaction.Success() {\n @Override\n public void onSuccess(Transaction transaction) {\n updates[3] = true;\n verifyCompleteUpdate(updates);\n }\n }).error(new Transaction.Error() {\n @Override\n public void onError(Transaction transaction, Throwable error) {\n error.printStackTrace();\n post(error.getLocalizedMessage(), AppslistEvent.UPDATE_APPLIST_EVENT);\n }\n }).build();\n\n // Ejecutar\n t1.execute();\n t2.execute();\n t3.execute();\n t4.execute();\n\n }", "public static void m9261e(ApplicationLike applicationLike) {\n if (applicationLike == null || applicationLike.getApplication() == null) {\n throw new TinkerRuntimeException(\"tinkerApplication is null\");\n }\n File jh = SharePatchFileUtil.m9383jh(applicationLike.getApplication());\n if (jh.exists()) {\n File auo = SharePatchFileUtil.auo(jh.getAbsolutePath());\n if (auo.exists()) {\n jh = SharePatchFileUtil.aup(jh.getAbsolutePath());\n SharePatchInfo l = SharePatchInfo.m9392l(auo, jh);\n if (l != null) {\n l.AET = true;\n SharePatchInfo.m9390a(auo, l, jh);\n return;\n }\n return;\n }\n C5952a.m9285w(\"Tinker.TinkerApplicationHelper\", \"try to clean patch while patch info file does not exist.\", new Object[0]);\n return;\n }\n C5952a.m9285w(\"Tinker.TinkerApplicationHelper\", \"try to clean patch while there're not any applied patches.\", new Object[0]);\n }", "public void installApk(String filename) {\n // systemLib.Installapk(filename);\n // if (isregister == false) {\n // isregister = true;\n // IntentFilter intentFilter = new IntentFilter(MyIntent.ACTION_INSTALL_BEGIN);\n // intentFilter.addAction(MyIntent.ACTION_INSTALL_END);\n // mContext.registerReceiver(mReceiver, intentFilter);\n // }\n // //start the service\n // Intent startservice = new Intent();\n // startservice.setAction(MyIntent.ACTION_PROXY);\n // startservice.putExtra(MyIntent.EXTRA_OPERATION, MyIntent.EXTRA_INSTALL);\n // startservice.putExtra(MyIntent.EXTRA_ARG1, filename);\n // Log.print(\"startservice intent is \" + startservice);\n // mContext.startService(startservice);\n }", "public App update(App obj) {\n JsonNode n = getClient().put(\n String.format(Routes.APP_UPDATE, obj.getId()),\n toJsonNode(obj)\n );\n obj.merge(getMapper().convertValue(n, App.class));\n return obj;\n }", "private static boolean needsUpdate(File file, File oldFile, JsonObject old_manifest, JsonObject obj, long size, String hash) {\n try {\n boolean check1 = !oldFile.exists();\n if (check1) return true;\n boolean check2 = !file.exists();\n if (check2) return true;\n boolean check3 = file.length() != size;\n if (check3) return true;\n boolean check4 = old_manifest == null;\n if (check4) return true;\n boolean check5 = old_manifest.get(\"files\") == null;\n if (check5) return true;\n boolean check6 = getHashFromPath(old_manifest.get(\"files\").getAsJsonArray(), obj.get(\"path\").getAsString()) == null;\n if (check6) return true;\n boolean check7 = !getHashFromPath(old_manifest.get(\"files\").getAsJsonArray(), obj.get(\"path\").getAsString()).equals(hash);\n if (check7) return true;\n\n return false;\n } catch (Exception ex) {\n StringWriter sw = new StringWriter();\n PrintWriter pw = new PrintWriter(sw);\n ex.printStackTrace(pw);\n log(sw.toString());\n return true;\n }\n }", "private static void download(File gamedir, String manifest_url, boolean onlyForced, String... forceChecks) {\n try {\n /* old manifest file, doesn't need to be effectively present, checked later */\n File old_manifest_file = new File(gamedir, \"manifest.json\");\n\n /* old (on disk), current (on github), new (will replace old on disk) */\n JsonObject old_manifest = old_manifest_file.exists() ? new JsonParser().parse(new FileReader(old_manifest_file)).getAsJsonObject() : null;\n JsonObject current_manifest = getJsonObject(manifest_url);\n JsonObject new_manifest = new JsonObject();\n\n /* hashes & files arrays from the online json */\n JsonArray current_hashes = current_manifest.get(\"hashes\").getAsJsonArray();\n JsonArray files = new JsonArray();\n\n /* Collects the folders that have something wrong and need update, speeds up time (not looking for every file every time) */\n List<String> toUpdate = getFoldersToUpdate(current_manifest, old_manifest, current_hashes, gamedir);\n\n /* Starts to build the new manifest */\n new_manifest.add(\"hashes\", current_hashes);\n\n log();\n\n /* Looping the files to meet something that needs update */\n current_manifest.get(\"files\").getAsJsonArray().forEach(jsonElement -> {\n JsonObject obj = jsonElement.getAsJsonObject();\n\n /* Removing a folder that is not needed (and maybe harmful for the download/load process) */\n String path = obj.get(\"path\").getAsString().replaceAll(\"forgiacraft2/\", \"\");\n\n /* Getting only the first folder that corresponds to \"mods\", \"config\" or \"forge\" */\n String folder = path.split(\"/\")[0];\n\n if ((onlyForced && Arrays.asList(forceChecks).contains(folder)) || (!onlyForced && toUpdate.contains(folder))) {\n long size = obj.get(\"size\").getAsLong();\n String hash = obj.get(\"hash\").getAsString();\n\n File file = new File(gamedir, path);\n\n /* Initializes forge file since found in the manifest */\n if (obj.get(\"path\").getAsString().contains(\"/forge/\")) {\n forgeFile = file;\n }\n\n if (needsUpdate(file, old_manifest_file, old_manifest, obj, size, hash)) {\n performDownload(path, obj.get(\"download_url\").getAsString(), file);\n }\n\n try {\n //adds to the manifest the json object of the correspondent file downloaded\n files.add(obj);\n\n //removes and rewrites the files JsonArray\n if (new_manifest.get(\"files\") != null) {\n new_manifest.remove(\"files\");\n }\n\n new_manifest.add(\"files\", files);\n\n /* Prints the new manifest to file (performed every file downloaded) */\n Gson gson = new GsonBuilder().setPrettyPrinting().create();\n FileUtils.printFile(old_manifest_file, gson.toJson(new_manifest));\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }\n\n });\n } catch (Exception ex) {\n log(gamedir.getAbsolutePath());\n\n StringWriter sw = new StringWriter();\n PrintWriter pw = new PrintWriter(sw);\n ex.printStackTrace(pw);\n log(sw.toString());\n ex.printStackTrace();\n }\n }", "public void getApk() {\n superClass = new SuperClass(context);\n taglockDeviceInfo = new TaglockDeviceInfo(context);\n if (taglockDeviceInfo.isNetworkConnected()) {\n DefaultProfileController defaultProfileController = new DefaultProfileController();\n RealmResults<DefaultProfile> getProfile = defaultProfileController.geDefaultProfileData();\n Log.e(\"ccddd\", String.valueOf(getProfile.size()));\n final String pack = getProfile.get(0).getApp_package_name();\n RequestQueue queue = Volley.newRequestQueue(context);\n try{\n String device_name = PreferenceHelper.getValueString(context, AppConfig.DEVICE_NAME);\n int device_id = PreferenceHelper.getValueInt(context, AppConfig.DEVICE_ID);\n JSONObject jsonObject = new JSONObject();\n jsonObject.put(\"id\",device_id);\n jsonObject.put(\"device_name\",device_name);\n final String request = jsonObject.toString();\n StringRequest stringRequest = new StringRequest(Request.Method.POST, AppConfig.GET_APK_URL, new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n boolean isTagboxInstalled = superClass.appInstalled(pack);\n try {\n JSONObject apk = new JSONObject(response);\n String apk_name = apk.getString(\"apk_name\");\n String version = apk.getString(\"apk_version\");\n Log.e(\"VERT\", apk_name);\n if (isTagboxInstalled) {\n String versionName = version.replace(\".\", \"\");\n String installedVersion = (taglockDeviceInfo.getVersion(context,pack)).replace(\".\", \"\");\n long ver = Long.parseLong(versionName);\n long ins = Long.parseLong(installedVersion);\n if (ver > ins) {\n AlertDialog.Builder alert = new AlertDialog.Builder(context);\n alert.setTitle(\"Updated App!\");\n alert.setMessage(\"Pls Wait as the Software is being updated for your better experience. Time may vary depending on your internet speed\");\n alert.setPositiveButton(\"\",null);\n dialog = alert.create();\n dialog. setCanceledOnTouchOutside(false);\n PreferenceHelper.setValueString(context, AppConfig.APK_NAME, apk_name);\n File dir = new File(Environment.getExternalStorageDirectory() + \"/.taglock/.apkmanagement\");\n TaglockDeviceInfo.deleteDir(dir);\n downloadApk(apk_name);\n dialog.show();\n\n\n } else {\n Log.d(\"App Status\", \"Not downloaded\");\n }\n } else {\n Log.e(\"GGG\", \"mmmmm\");\n PreferenceHelper.setValueString(context, AppConfig.APK_NAME, apk_name);\n File dir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + apk_name);\n TaglockDeviceInfo.deleteDir(dir);\n downloadApk(apk_name);\n }\n } catch (JSONException je) {\n je.printStackTrace();\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n Log.d(\"App Status\", \"Failed to get apk\");\n }\n }) {\n @Override\n public Map<String, String> getHeaders() throws AuthFailureError {\n Map<String, String> parameter = new HashMap<>();\n parameter.put(\"Content-Type\", \"application/json\");\n return parameter;\n }\n\n @Override\n public byte[] getBody() throws AuthFailureError {\n try {\n return request == null ? null : request.getBytes(\"utf-8\");\n } catch (UnsupportedEncodingException uee) {\n VolleyLog.wtf(\"Unsupported Encoding while trying to get the bytes of %s using %s\", request, \"utf-8\");\n return null;\n }\n }\n };\n queue.add(stringRequest);\n }catch (JSONException je){\n je.printStackTrace();\n }\n } else {\n Log.d(\"Network Status\", \"Not connected\");\n }\n }", "public static native void link(String oldpath, String newpath) throws IOException;", "@Override\n\t\t\t\t\t\t\tpublic void appUpdateSave(String version_code, String newAppNetworkUrl) {\n\t\t\t\t\t\t\t\tSettingActivity.this.version_code=version_code;\n\t\t\t\t\t\t\t\tappUpdateUrl=newAppNetworkUrl;\n\t\t\t\t\t\t\t\thandler.sendEmptyMessage(0);\n\t\t\t\t\t\t\t}", "private void refreshJOGL(final File installDir){\r\n try {\r\n Class subAppletClass = Class.forName(subAppletClassName);\r\n // this will block until the applet jar is downloaded\r\n } catch (ClassNotFoundException cnfe){\r\n displayError(\"Start failed : class not found : \" + subAppletClassName);\r\n }\r\n\r\n if (!installDir.exists()){\r\n installDir.mkdirs();\r\n }\r\n\r\n String libURLName = nativeLibsJarNames[osType];\r\n // first, let's get the manifest file from jogl.jar\r\n\r\n URL nativeLibURL;\r\n URLConnection urlConnection;\r\n String path = getCodeBase().toExternalForm() + libURLName;\r\n try {\r\n nativeLibURL = new URL(path);\r\n urlConnection = nativeLibURL.openConnection();\r\n } catch (Exception e){\r\n e.printStackTrace();\r\n displayError(\"Couldn't access the native lib URL : \" + path);\r\n return;\r\n }\r\n\r\n // the timestamp used to determine if we have to download the native again\r\n long lastModified = urlConnection.getLastModified();\r\n\r\n File localNativeFile = new File(installDir, nativeLibsFileNames[osType]);\r\n boolean needsRefresh = (!localNativeFile.exists()) || localNativeFile.lastModified() != lastModified;\r\n\r\n if (needsRefresh){\r\n displayMessage(\"Updating local version of the native libraries\");\r\n // first download the full jar locally\r\n File localJarFile = new File(installDir, nativeLibsJarNames[osType]);\r\n try {\r\n saveNativesJarLocally(localJarFile, urlConnection);\r\n } catch (IOException ioe) {\r\n ioe.printStackTrace();\r\n displayError(\"Unable to install the native file locally\");\r\n return;\r\n }\r\n\r\n InputStream is = null;\r\n BufferedOutputStream out = null;\r\n try {\r\n JarFile jf = new JarFile(localJarFile);\r\n\r\n JarEntry nativeLibEntry = findNativeEntry(jf);\r\n\r\n if (nativeLibEntry == null) {\r\n displayError(\"native library not found in jar file\");\r\n } else {\r\n is = jf.getInputStream(nativeLibEntry);\r\n int totalLength = (int) nativeLibEntry.getSize();\r\n // now we install the file\r\n try {\r\n out = new BufferedOutputStream(new FileOutputStream(localNativeFile));\r\n } catch (FileNotFoundException ex) {\r\n ex.printStackTrace(); // shouldn't happen\r\n return;\r\n }\r\n\r\n byte[] buffer = new byte[1024];\r\n int sum = 0;\r\n int len;\r\n try {\r\n while ( (len = is.read(buffer)) > 0) {\r\n out.write(buffer, 0, len);\r\n sum += len;\r\n int percent = (100 * sum / totalLength);\r\n displayMessage(\"Installing native files\");\r\n progressBar.setValue(percent);\r\n }\r\n displayMessage(\"Download complete\");\r\n } catch (IOException ioe) {\r\n ioe.printStackTrace();\r\n displayMessage(\"An error has occured during native library download\");\r\n return;\r\n } finally {\r\n if (out != null) {\r\n try {\r\n out.close();\r\n } catch (IOException ignore) {\r\n }\r\n }\r\n }\r\n\r\n if (checkNativeCertificates(nativeLibEntry.getCertificates())) {\r\n // security check complete\r\n localNativeFile.setLastModified(lastModified); // same timestamp\r\n\r\n loadNativesAndStart(localNativeFile);\r\n\r\n } else {\r\n displayError(\"The native librairies aren't properly signed\");\r\n }\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n } finally {\r\n // close the files\r\n if (is != null){\r\n try {\r\n is.close();\r\n } catch (IOException ignore) {\r\n }\r\n }\r\n\r\n }\r\n } else {\r\n loadNativesAndStart(localNativeFile);\r\n }\r\n //System.out.println(\"classpath is : \" + classpath);\r\n\r\n }", "public static String convertApplication(String applicationPath, String[] args){\n\n\t\tString [] pathSplitted = applicationPath.split(\"/\");\n\n\t\tString applicationName = pathSplitted[pathSplitted.length-1];\n\n\t\tString path = \"../axt/\"+applicationPath+\"/\";\n\n\t\tFile file = new File(path);\n\t\tfile.mkdirs();\n\n\t\tString result = path+applicationName+\".axt\";\n\n\t\tFile axt = new File(result);\n\t\tlong lastModifiedAxt = axt.lastModified();\n\t\tFile apps = new File(\"../Applications/bin/timeStamp\"); // This file is touched every time the applications are built\n\t\tlong lastAppBuild = apps.lastModified();\n\t\tFile api = new File(\"../API/bin/timeStamp\"); // This file is touched every time the API are built\n\t\tlong lastApiBuild = api.lastModified();\n\n\t\tif(lastModifiedAxt < lastAppBuild || lastModifiedAxt < lastApiBuild){\n\n\t\t\tAxtParameter axtPara = new AxtParameter();\n\t\t\taxtPara.setClassPaths(new String [] {\"../Applications/bin/\", \"../API/bin/\"}); // This is the correct one but does not yet work\n\t\t\tif(args == null){\n\t\t\t\taxtPara.setMainArguments(new String [] {});\n\t\t\t} else {\n\t\t\t\taxtPara.setMainArguments(args);\n\t\t\t}\n\t\t\taxtPara.setMainClass(applicationPath);\n\t\t\taxtPara.setTargetName(applicationName);\n\t\t\taxtPara.setTargetPath(path);\n\n\t\t\ttry {\n\t\t\t\tConverter converter = new Converter(axtPara);\n\t\t\t\tconverter.convert();\n\t\t\t} catch (Utf8EntryException | UnvalidConstantPoolTagException\n\t\t\t\t\t| NotAByteCodeException | ClassNotInClassPathException\n\t\t\t\t\t| ReadInException | IOException | StatisticsException | IllegalArgumentException | IllegalAccessException | ClassFormatException | ParsingByteCodeException | ByteCodeResolveException | NoCorrectCPIndexException | TargetLostException | FileNotInJarException e) {\n\t\t\t\te.printStackTrace(System.err);\n\t\t\t\tthrow new AmidarSimulatorException(\"Error when converting application to AXT format\");\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "@Test\r\n public void testUpdateFile() {\r\n System.out.println(\"updateFile\");\r\n InparseManager instance = ((InparseManager) new ParserGenerator().getNewApplicationInparser());\r\n try {\r\n File file = File.createTempFile(\"TempInpFile\", null);\r\n instance.setlocalPath(file.getAbsolutePath());\r\n } catch (IOException ex) {\r\n Logger.getLogger(ApplicationInparserTest.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n instance.updateFile();\r\n // no assertEquals needed because the method itself would throw an error\r\n // if an error occurs check your connection to the internet\r\n }", "public void diskUpdate(FlockInfo info) {\n/*\nudanax-top.st:16740:FakePacker methodsFor: 'shepherds'!\n{void} diskUpdate: info {FlockInfo | NULL} \n\t\"The flock identified by token is Dirty!! On some later commit, write it to the disk.\"!\n*/\n}", "private void updateOffsets() {\n /*\n // Can't load method instructions: Load method exception: null in method: android.renderscript.AllocationAdapter.updateOffsets():void, dex: in method: android.renderscript.AllocationAdapter.updateOffsets():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.renderscript.AllocationAdapter.updateOffsets():void\");\n }", "private void configureOsgiManifest(Project project) {\n project.afterEvaluate(new Action<Project>() {\n @Override\n public void execute(Project project) {\n project.getTasks().withType(Jar.class, new Action<Jar>() {\n @Override\n public void execute(Jar jar) {\n if (jar.getManifest() instanceof OsgiManifest) {\n OsgiManifest manifest = (OsgiManifest) jar.getManifest();\n if (manifest.getInstructions().containsKey(\"Implementation-Version\")) {\n manifest.instructionReplace(\"Implementation-Version\", configurationStore.getProjectVersion());\n }\n if (manifest.getInstructions().containsKey(\"Specification-Version\")) {\n manifest.instructionReplace(\"Specification-Version\", configurationStore.getProjectVersion());\n }\n }\n }\n });\n }\n });\n }" ]
[ "0.5946261", "0.58735454", "0.5775739", "0.5713917", "0.56437814", "0.5522655", "0.55197406", "0.5320667", "0.5279289", "0.526756", "0.5262805", "0.5198667", "0.5142637", "0.512664", "0.5085214", "0.5059393", "0.50578636", "0.5038234", "0.5026714", "0.50208694", "0.50015223", "0.49679744", "0.4963349", "0.4955183", "0.4909709", "0.49043003", "0.4903104", "0.49012667", "0.48996025", "0.4866147", "0.4863465", "0.4847304", "0.48454127", "0.4842588", "0.48029926", "0.48027837", "0.47856075", "0.4782175", "0.47562036", "0.47493806", "0.47427148", "0.47409654", "0.4737733", "0.47347683", "0.47292116", "0.47150227", "0.47102705", "0.47083998", "0.4697125", "0.46970218", "0.46896276", "0.46871972", "0.46836868", "0.467414", "0.46683004", "0.46680263", "0.46673983", "0.4661209", "0.465642", "0.46536732", "0.46417558", "0.46411777", "0.4632506", "0.46188325", "0.46151164", "0.46142372", "0.46046224", "0.4603779", "0.45986906", "0.45977896", "0.45875773", "0.4575756", "0.45750985", "0.45706555", "0.4568068", "0.45666793", "0.45666364", "0.4538615", "0.4537697", "0.45306715", "0.4519482", "0.44973767", "0.44951192", "0.44908217", "0.44884998", "0.4486526", "0.4486274", "0.44782674", "0.4474294", "0.44584277", "0.44498345", "0.44460624", "0.44391415", "0.4432287", "0.44262835", "0.4423166", "0.44124013", "0.44097024", "0.44054174", "0.4379706" ]
0.7600969
0
TODO Autogenerated method stub
@Override public void resize(int width, int height) { }
{ "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 show() { }
{ "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 hide() { }
{ "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 pause() { }
{ "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 resume() { }
{ "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 dispose() { }
{ "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
Get the String representation of this test status that should be stored in xml
String getValue() { return mValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getStatusString() {\n return status.toString();\n }", "public String getXmlStatus() {\n String msg = \"<object_status idobj=\\\"\" + codObjeto + \"\\\" \";\n msg += \" status=\\\"\" + status + \"\\\" tag=\\\"\" + tag + \"\\\" \";\n msg += \" flagInventario=\\\"\" + flagInventario + \"\\\" \";\n msg += \" iduser=\\\"\" + codUser + \"\\\"\";\n msg += \" posx=\\\"\" + posX + \"\\\" posy=\\\"\" + posY + \"\\\">\";\n msg += \"</object_status>\";\n return msg;\n }", "public String getStatus() {\n return status.toString();\n }", "public String getStatusString() {\n String str = \"\";\n switch (actualStep) {\n case wait: { str = \"WAIT\"; break; }\n case press: { str = \"PRESS\"; break; }\n case hold: { str = \"HOLD\"; break; }\n case release: { str = \"RELEASE\"; break; }\n }\n return str;\n }", "java.lang.String getStatus();", "java.lang.String getStatus();", "java.lang.String getStatus();", "java.lang.String getStatus();", "public String status() {\n return statusEnum().toString();\n }", "private String getStatusMessage() {\n\t\treturn (m_isTestPassed == true) ? \" successfully...\" : \" with failures...\";\n\t}", "public String getStatus() {\r\n return (String) getAttributeInternal(STATUS);\r\n }", "public String getStatus() {\n return (String) getAttributeInternal(STATUS);\n }", "public java.lang.String getStatus() {\r\n return status;\r\n }", "public String getStatus(){\n\t\t\n\t\treturn this.status;\n\t}", "public String getStatus(){\r\n\t\treturn status;\r\n\t}", "public String getStatus() {\r\n return status;\r\n }", "public String getStatus() {\r\n return status;\r\n }", "public String getStatus() {\r\n return status;\r\n }", "public String getStatus() {\r\n return status;\r\n }", "public String getStatus() {\r\n return status;\r\n }", "public java.lang.String getStatus() {\n return status;\n }", "public java.lang.String getStatus() {\n return status;\n }", "public String getStatus () {\r\n return status;\r\n }", "public String getStatus()\n {\n\n return status;\n }", "public String getStatus() {\r\n return status;\r\n }", "public String getStatus() {\r\n return status;\r\n }", "public String getStatusDetails() { return statusDetails; }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public java.lang.String getStatus() {\n java.lang.Object ref = status_;\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 status_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getStatus() {\n java.lang.Object ref = status_;\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 status_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getStatus() {\r\n\t\treturn status;\r\n\t}", "public String getStatus() {\r\n\t\treturn status;\r\n\t}", "public String getStatus() {\r\n\t\treturn status;\r\n\t}", "public String getStatus() {\r\n\t\treturn status;\r\n\t}", "public String getStatus() {\r\n\t\treturn status;\r\n\t}", "public java.lang.String getStatus () {\r\n\t\treturn status;\r\n\t}", "public java.lang.String getStatus() {\n java.lang.Object ref = status_;\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 status_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getStatus() {\n\t\treturn status;\n\t}", "public String getStatus() {\n\t\treturn status;\n\t}", "public String getStatus() {\n\t\treturn status;\n\t}", "public String getStatus() {\n\t\treturn status;\n\t}", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatus() {\n return status;\n }", "public String getStatusName() {\n return status.getText();\n }", "public java.lang.String getStatus() {\n\t\treturn status;\n\t}", "public java.lang.String getStatus() {\n\t\treturn status;\n\t}", "public java.lang.String getStatus () {\n\t\treturn status;\n\t}", "public java.lang.String getStatus () {\n\t\treturn status;\n\t}", "public java.lang.String getStatus () {\n\t\treturn status;\n\t}", "public java.lang.String getStatus () {\n\t\treturn status;\n\t}", "public java.lang.String getStatus () {\n\t\treturn status;\n\t}", "public String getStatus() {\n return this.status;\n }", "public String getStatus() {\n return this.status;\n }", "public String getStatus() {\n return this.status;\n }", "public String getStatus() {\n return this.status;\n }", "public String getStatus() {\n return this.status;\n }", "public String getStatus() {\n return this.status;\n }", "public String getStatus() {\n return this.status;\n }", "public String getStatus()\n \t{\n \t\treturn m_strStatus;\n \t}", "public String getStatus() { return status; }", "public String getStatus() {\n return this.Status;\n }", "public String getStatus() {\n return this.Status;\n }", "String getStatus();", "String getStatus();", "String getStatus();", "String getStatus();", "String getStatus();", "public String getStatus(){\n\n //returns the value of the status field\n return this.status;\n }", "public String toString()\n\t{\n\t\tStringBuilder str = new StringBuilder();\n\t\t\n\t\tstr.append(\"[\");\n\t\tstr.append(getStatus());\n\t\tstr.append(\":\");\n\t\tif ( hasStatusMessage())\n\t\t\tstr.append(getStatusMessage());\n\t\telse\n\t\t\tstr.append(\"<NoMsg>\");\n\t\tstr.append(\":Values=\");\n\t\tstr.append(numberOfResponseValues());\n\t\tstr.append(\"]\");\n\t\t\n\t\treturn str.toString();\n\t}", "public String status() {\n return this.status;\n }", "public String status() {\n return this.status;\n }" ]
[ "0.7675852", "0.7482031", "0.73067266", "0.7185224", "0.71615297", "0.71615297", "0.71615297", "0.71615297", "0.70433366", "0.6983423", "0.69428927", "0.6916544", "0.6890881", "0.68854046", "0.68652785", "0.68608904", "0.68608904", "0.68608904", "0.68608904", "0.68608904", "0.685549", "0.685549", "0.6852523", "0.68414587", "0.6823635", "0.6823635", "0.6822229", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.68170476", "0.6812184", "0.68022215", "0.68022215", "0.6796427", "0.6796427", "0.6796427", "0.6796427", "0.6796427", "0.6770571", "0.67703366", "0.676625", "0.676625", "0.676625", "0.676625", "0.6764326", "0.6764326", "0.6764326", "0.67562956", "0.675016", "0.675016", "0.67327136", "0.67327136", "0.67327136", "0.67327136", "0.67327136", "0.6720327", "0.6720327", "0.6720327", "0.6720327", "0.6720327", "0.6720327", "0.6720327", "0.67048526", "0.66992784", "0.66887534", "0.66887534", "0.66762495", "0.66762495", "0.66762495", "0.66762495", "0.66762495", "0.6671545", "0.66510624", "0.66482335", "0.66482335" ]
0.0
-1
ListView Clicked item index
@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { try { int itemPosition = position; switch (itemPosition) { case 0: objPcControlCMD.CMD_RESTART(getApplicationContext()); break; case 1: objPcControlCMD.CMD_SHUTDOWN(getApplicationContext()); break; case 2: objPcControlCMD.CMD_HIBERNATE(getApplicationContext()); break; case 3: objPcControlCMD.CMD_SLEEP(getApplicationContext()); break; case 4: objPcControlCMD.CMD_PROC(getApplicationContext()); show_ProcListActivity(); break; case 5: CallInputBox(); break; case 6: objPcControlCMD.CMD_LOGOFF(getApplicationContext()); break; case 7: CallInputBoxForP(); break; } // ListView Clicked item value String itemValue = (String) lv.getItemAtPosition(position); // Show Alert Toast.makeText(getApplicationContext(), "Position :" + itemPosition + " ListItem : " + itemValue, Toast.LENGTH_LONG) .show(); } catch (Exception e) { System.out.println(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onItemClick(int position);", "public void onItemClick(View view, int position);", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n\n Intent intent = new Intent(MainActivity.this, ImageActivity.class);\n intent.putExtra(\"index\", i);\n startActivity(intent);\n\n }", "@Override\n public void onListItemClicked(int position) {\n\n }", "void onItemClick(View view, int position);", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n int itemPosition = position;\n\n // ListView Clicked item value\n String itemValue = (String) listView.getItemAtPosition(position);\n\n // Show Alert\n Toast.makeText(getApplicationContext(),\n \"Position :\" + itemPosition + \" ListItem : \" + itemValue, Toast.LENGTH_LONG)\n .show();\n\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n int itemPosition = position;\n\n // ListView Clicked item value\n String itemValue = (String) listView.getItemAtPosition(position);\n\n // Show Alert\n Toast.makeText(getApplicationContext(), \"Position :\" + itemPosition + \" ListItem : \" + itemValue , Toast.LENGTH_LONG).show();\n }", "void onClick(int index);", "@Override\n public void onItemClick(View view, ListItem obj, int position) {\n }", "public void onListItemClick(ListView list, View v, int position, long id)\n {\n Intent intent = new Intent(MainActivity.this, EventActivities.class);\n intent.putExtra(\"c\", position);\n startActivity(intent);\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\r\n public void onItemClick(AdapterView<?> parent, View view,\r\n int position, long id) {\n int itemPosition = position;\r\n\r\n // ListView Clicked item value\r\n String itemValue = (String) listView.getItemAtPosition(position);\r\n\r\n // Show Alert\r\n Toast.makeText(getApplicationContext(),\r\n \"Position :\"+itemPosition+\" ListItem : \" +itemValue , Toast.LENGTH_LONG)\r\n .show();\r\n }", "@Override\r\n public void onItemClick(AdapterView<?> parent, View view,\r\n int position, long id) {\n int itemPosition = position;\r\n\r\n // ListView Clicked item value\r\n String itemValue = (String) listView.getItemAtPosition(position);\r\n\r\n // Show Alert\r\n Toast.makeText(getApplicationContext(),\r\n \"Position :\"+itemPosition+\" ListItem : \" +itemValue , Toast.LENGTH_LONG)\r\n .show();\r\n\r\n }", "@Override\n public void onItemClick(int pos) {\n }", "public void onListItemClick( ListView l, View v, int position, long id )\n {\n }", "@Override\n public void onListItemClick(ListView l, View v, int position, long id) {\n super.onListItemClick(l, v, position, id);\n SkillModel md = (SkillModel) l.getAdapter().getItem(position);\n //SkillModel md = ((pro_adapter)getListAdapter()).getItem(position);\n String pos = Integer.toString(position);\n Log.d(\"click\", pos);\n com.itemSelected(md.id);\n\n\n\n }", "@Override\n public void OnItemClick(int position) {\n }", "public void onItemClick(View view, int position) {\n\n }", "void onItemClickListener(View view, int postion);", "void onClick(View item, View widget, int position, int which);", "@Override\n public void onItemClick(int position) {\n }", "@Override\n public void onClick(View view) {\n clickListener.onItemClicked(getBindingAdapterPosition());\n }", "@Override\n\t\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1,\n\t\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\t\t\n\t\t\t\t\t Log.i(\"MyListViewBase\", \"你点击了ListView条目\"+arg2);\n\t\t\t\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(int position) {\n }", "@Override\n public void onItemClick(int position) {\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1,\n\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\tif (sACTIVITY_POS == arg2) {\n\t\t\t\t\tsACTIVITY_POS = -1;\n\t\t\t\t} else\n\t\t\t\t\tsACTIVITY_POS = arg2;\n\t\t\t//\tsACTIVITY_POS = arg2;\n\t\t\t\tactivityAdapter.notifyDataSetChanged();\n\t\t\t\t\n\n\t\t\t}", "void onChamaItemClicked(int position);", "public void onItemClick(AdapterView<?> parent,\n View v, int position, long id){\n Intent i = new Intent(getApplicationContext(), SingleViewActivity.class);\n // Pass image index\n i.putExtra(\"id\", position);\n startActivity(i);\n }", "@Override\r\n public void onListItemClick(ListView l, View v, int position, long id) {\n }", "@Override\n public void itemClick(int pos) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClicked(int itemPosition, Object dataObject) {\n }", "@Override\n public void onItemClick(View view, int position) {\n }", "@Override\n public void onItemClick(View view, int position) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n }", "void onListInteraction(int index, boolean isLongClicked);", "@Override\n public View getView(final int position, View convertView, ViewGroup parent) {\n Holder holder=new Holder();\n View rowView;\n rowView = inflater.inflate(R.layout.category_listview, null);\n holder.nameTextView=(TextView) rowView.findViewById(R.id.categoryName);\n holder.imgView=(ImageView) rowView.findViewById(R.id.categoryImage);\n holder.nameTextView.setText(categoryNames[position]);\n holder.imgView.setImageResource(categoryImages[position]);\n rowView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n // TODO Auto-generated method stub\n lastSelectedSpotIndex=position;\n Toast.makeText(context, \"You Clicked \"+categoryNames[position], Toast.LENGTH_LONG).show();\n }\n });\n return rowView;\n }", "@Override\n public void onItemClick(Nson parent, View view, int position) {\n }", "@Override\n public void onClick(View v) {\n\n listener.onClickPosition(getAdapterPosition());\n // Log.d(\"TAG\", \"Element \" + getAdapterPosition() + \" clicked. \");\n }", "@Override\n public void onClick(View v) {\n //getAdapterPosition() get's an Integer based on which the position of the current\n //ViewHolder (this) in the Adapter. This is how we get the correct Data.\n ListItem listItem = listOfData.get(\n this.getAdapterPosition()\n );\n\n controller.onListItemClick(\n listItem,\n v\n );\n\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n\n\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { //on click listener\n Intent showDetailActivity = new Intent(getApplicationContext(), DetailActivity.class); //create an intent that points to the DetailActivity class\n showDetailActivity.putExtra(\"com.example.listapp.itemIndex\", i); //we put the index of the item clicked in the intent to get the image\n startActivity(showDetailActivity); //we show the activity in DetailActivity and run the onCreate method there\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Log.w(TAG , \"POSITION : \" + position);\n\n itemClick(position);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(View view, int position) {\n\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View v, int pos, long id) {\n\t\t\t\tSystem.out.println(\"Selected \" + pos);\n\t\t\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n int itemPosition = position;\n \n // ListView Clicked item value\n String itemValue = (String) lvView.getItemAtPosition(position);\n \n Intent newActivity;\n switch( position ) {\n case 0: \n \t \t\tnewActivity = new Intent(Recommendations.this, RecJermaineJemmott.class); \n startActivity(newActivity);\n finish();\n break;\n \n case 1: \n \t \t\tnewActivity = new Intent(Recommendations.this, RecFrankBird.class); \n startActivity(newActivity);\n finish();\n break;\n \n case 2: \n \t \t\tnewActivity = new Intent(Recommendations.this, RecLeeAsh.class); \n startActivity(newActivity);\n finish();\n break;\n \n }\n }", "@Override\n public void onClick(View view) { listener.onItemClick(view, getPosition()); }", "@Override\n public void onItemClick(View view, int position){\n }", "public int getItemIndex() {\n return this.itemIndex;\n }", "public void onClickNom(Personne item, int position);", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {\n JobInterviewPreview.this.goToInterview(position);\n }", "void onItemClick(HorizontalGridView parent, View view, int position,\n long id);", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n Intent intent = new Intent(context, CaculateScoreActivity.class);\n intent.putExtra(\"index\", i);\n intent.putExtra(\"player_info\", gameInfoData.getPlayerInfoJsonString(i));\n startActivityForResult(intent, OPEN_CACULATE_SCORE);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n }", "public void onItemSelecting(AdapterView<?> parent, View view, int oldPosition, int newPosition);", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}", "public void handleListClick(int index) {\n try {\n this.executeCommand(\"view \" + (index + 1));\n } catch (CommandException | ParseException e) {\n logger.info(\"Invalid command: view \" + (index + 1));\n resultDisplay.setFeedbackToUser(e.getMessage());\n }\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\t\n\t\t\t}", "@Override\n public long getItemId(int index) {\n return index;\n }", "@Override\n\tpublic void onClick(View v) {\n\t\tTextView selectedIndex = (TextView) v;\n\t\tlistView.setSelection(index.get(selectedIndex.getText()));\n\t}", "@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}", "@Override\n\t\t\t\t\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\t\t\t\t\t\tint position, long id) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}", "@Override\n\tpublic void onListItemClick(ListView l, View v, int position, long id) {\n\t \n\t }", "@Override\n\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\tlong arg3) {\n\t\t\t\n\t\t}", "@Override\n public void onClick(View v) {\n listener.onItemClick(v, position);\n }", "@Override\n public void onItemClick(View view, int position) {\n Toast.makeText(getContext(), \"You clicked \" + adapter.getItem(position) + \" on row number \" + position, Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Intent intent = new Intent(SearchResultActivity.this, UrbanWordActivity.class);\n intent.putExtra(\"position\", position);\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n int mPosition = getLayoutPosition();\n // Use that to access the affected item in cryptoList.\n double idClicked = cryptoList.get(mPosition).market_cap_rank; //[mPosition].market_cap_rank; //get(mPosition);\n\n Intent i = new Intent(v.getContext(), Detail.class);\n i.putExtra(\"rank\", idClicked);\n v.getContext().startActivity(i);\n\n\n }", "@Override\n public void onClick(View view, int position, boolean isLongClick) {\n Intent foodListIntent = new Intent(Home.this,FoodList.class);\n // CategoryId is a key , so we just get the key of the clicked item\n foodListIntent.putExtra(\"categoryId\" , adapter.getRef(position).getKey());\n startActivity(foodListIntent);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n\n clickedValue = teams.get(position).name.toString();\n\n Intent intent = new Intent(teamSelection.this, Signup.class);\n\n intent.putExtra(\"ListViewClickedValue\", clickedValue);\n startActivity(intent);\n\n }", "public int getItemIndex() {\n return itemIndex;\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {\n posicion_click = position;\n Intent intent = new Intent(getActivity(),select.class);\n startActivity(intent);\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t\t\t}", "@Override\n protected void onListItemClick(ListView l, View v, int position, long id) {\n \t\n \t\n }", "int getItem(int index);", "private AdapterView.OnItemClickListener onItemClick() {\n return new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Intent intent = new Intent(MainActivity.this, CustomerActivity.class);\n intent.putExtra(Arguments.CASE_ARG, position); //TODO\n startActivity(intent);\n }\n };\n }", "@Override\r\n\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\r\n\t\t\t\t\t\t\t\t\t\tint which) {\n\t\t\t\t\t\t\t\t\tif (which == 0) {\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"postion==\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ position);\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"id==\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t+ items.get(position - 1)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getId());\r\n\t\t\t\t\t\t\t\t\t\tboolean delete = databaseHelper\r\n\t\t\t\t\t\t\t\t\t\t\t\t.deleteNoteById(items.get(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tposition - 1).getId());\r\n\t\t\t\t\t\t\t\t\t\t// System.out.println(\"position==\"+position+\",\"+\"delete==\"+delete);\r\n\t\t\t\t\t\t\t\t\t\titems = getData();\r\n\t\t\t\t\t\t\t\t\t\tadapter = new NoteAdapter(\r\n\t\t\t\t\t\t\t\t\t\t\t\tNoteListActivity.this, items,\r\n\t\t\t\t\t\t\t\t\t\t\t\tisNull);\r\n\t\t\t\t\t\t\t\t\t\tlistView.setAdapter(adapter);\r\n\t\t\t\t\t\t\t\t\t} else if (which == 1) {\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\n\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\t\t\t\t\tlong arg3) {\n\t\t\t}", "@Override\r\n\tprotected boolean onTap(int index) {\n\t\tnumber = index;\r\n\t\treturn super.onTap(index);\r\n\t}", "@Override\r\n\t\t\tpublic void onItemClick(AdapterView<?> adapter, View view, int position,\r\n\t\t\t\t\tlong arg3) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}", "@Override\n public void onClick(View v)\n {\n int adapterPosition = getAdapterPosition();\n mCursor.moveToPosition(adapterPosition);\n int recipeID = mCursor.getInt(MainActivity.INDEX_RECIPE_ID);\n String recipeName = mCursor.getString(MainActivity.INDEX_RECIPE_NAME);\n mClickHandler.onClickRecipeAdapter(recipeID, recipeName);\n }", "@Override\r\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\r\n\t}" ]
[ "0.7279279", "0.72405237", "0.71664447", "0.71438044", "0.7133834", "0.71318424", "0.7110673", "0.71055347", "0.7104801", "0.7103004", "0.70707655", "0.70497495", "0.70497495", "0.70439893", "0.7032804", "0.7021206", "0.70159334", "0.6988654", "0.6982371", "0.6959986", "0.6955696", "0.69059885", "0.6826629", "0.6805342", "0.67896724", "0.6787276", "0.6787276", "0.6787276", "0.67768115", "0.67768115", "0.6761681", "0.67480695", "0.67281884", "0.6727152", "0.6722636", "0.67217475", "0.67217475", "0.67217475", "0.67217475", "0.67217475", "0.6713832", "0.6706144", "0.6706144", "0.66922927", "0.66911364", "0.6675773", "0.6672688", "0.6671671", "0.66711855", "0.66680384", "0.6663251", "0.66569453", "0.66446173", "0.66446173", "0.66339207", "0.662333", "0.6613921", "0.6600521", "0.65966564", "0.65877455", "0.6583714", "0.65779406", "0.6560871", "0.65453964", "0.6542855", "0.6525353", "0.65246564", "0.65246564", "0.6520566", "0.6520225", "0.6519993", "0.65199393", "0.6517485", "0.6513664", "0.6501432", "0.6500493", "0.64968705", "0.6496549", "0.6494847", "0.6491186", "0.6488767", "0.64845973", "0.64845973", "0.64811504", "0.6480403", "0.6475012", "0.64558697", "0.6455646", "0.6454188", "0.6450442", "0.64451313", "0.6444073", "0.6434144", "0.64246947", "0.64233476", "0.641881", "0.64136785", "0.64039075", "0.64039075", "0.640343", "0.6400233" ]
0.0
-1
PDFont loads embedded fonts in its constructor so we have to handle IOExceptions from PDFont and translate them into validation errors.
protected void addFontError(COSDictionary dictionary, PreflightContext context, IOException e) { COSName type = dictionary.getCOSName(COSName.TYPE, COSName.FONT); if (!COSName.FONT.equals(type)) { addValidationError(context, new ValidationError(PreflightConstants.ERROR_FONTS_UNKNOWN_FONT_TYPE, "Expected 'Font' dictionary but found '" + type.getName() + "'")); } String fontName = "Unknown"; if (dictionary.containsKey(COSName.BASE_FONT)) { fontName = dictionary.getNameAsString(COSName.BASE_FONT); } COSName subType = dictionary.getCOSName(COSName.SUBTYPE); if (COSName.TYPE1.equals(subType)) { addValidationError(context, new ValidationError(PreflightConstants.ERROR_FONTS_TYPE1_DAMAGED, "The FontFile can't be read for " + fontName + ": " + e.getMessage())); } else if (COSName.MM_TYPE1.equals(subType)) { addValidationError(context, new ValidationError(PreflightConstants.ERROR_FONTS_TYPE1_DAMAGED, "The FontFile can't be read for " + fontName + ": " + e.getMessage())); } else if (COSName.TRUE_TYPE.equals(subType)) { addValidationError(context, new ValidationError(PreflightConstants.ERROR_FONTS_TRUETYPE_DAMAGED, "The FontFile can't be read for " + fontName + ": " + e.getMessage())); } else if (COSName.TYPE3.equals(subType)) { addValidationError(context, new ValidationError(PreflightConstants.ERROR_FONTS_TYPE3_DAMAGED, "The FontFile can't be read for " + fontName + ": " + e.getMessage())); } else if (COSName.TYPE0.equals(subType)) { addValidationError(context, new ValidationError(PreflightConstants.ERROR_FONTS_CID_DAMAGED, "The FontFile can't be read for " + fontName + ": " + e.getMessage())); } else if (COSName.CID_FONT_TYPE0.equals(subType)) { addValidationError(context, new ValidationError(PreflightConstants.ERROR_FONTS_UNKNOWN_FONT_TYPE, "Unexpected CIDFontType0 descendant font for " + fontName + ": " + e.getMessage())); } else if (COSName.CID_FONT_TYPE2.equals(subType)) { addValidationError(context, new ValidationError(PreflightConstants.ERROR_FONTS_UNKNOWN_FONT_TYPE, "Unexpected CIDFontType2 descendant font for " + fontName + ": " + e.getMessage())); } else { addValidationError(context, new ValidationError(PreflightConstants.ERROR_FONTS_UNKNOWN_FONT_TYPE, "Unknown font type for " + fontName)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void init() {\n\n /**\n * FontFile1 = A stream containing a Type 1 font program\n * FontFile2 = A stream containing a TrueType font program\n * FontFile3 = A stream containing a font program other than Type 1 or\n * TrueType. The format of the font program is specified by the Subtype entry\n * in the stream dictionary\n */\n try {\n\n // get an instance of our font factory\n FontFactory fontFactory = FontFactory.getInstance();\n\n if (entries.containsKey(FONT_FILE)) {\n Stream fontStream = (Stream) library.getObject(entries, FONT_FILE);\n if (fontStream != null) {\n font = fontFactory.createFontFile(\n fontStream, FontFactory.FONT_TYPE_1);\n }\n }\n\n if (entries.containsKey(FONT_FILE_2)) {\n Stream fontStream = (Stream) library.getObject(entries, FONT_FILE_2);\n if (fontStream != null) {\n font = fontFactory.createFontFile(\n fontStream, FontFactory.FONT_TRUE_TYPE);\n }\n }\n\n if (entries.containsKey(FONT_FILE_3)) {\n\n Stream fontStream = (Stream) library.getObject(entries, FONT_FILE_3);\n String subType = fontStream.getObject(\"Subtype\").toString();\n if (subType != null &&\n (subType.equals(FONT_FILE_3_TYPE_1C) ||\n subType.equals(FONT_FILE_3_CID_FONT_TYPE_0) ||\n subType.equals(FONT_FILE_3_CID_FONT_TYPE_0C))\n ) {\n font = fontFactory.createFontFile(\n fontStream, FontFactory.FONT_TYPE_1);\n }\n if (subType != null && subType.equals(FONT_FILE_3_OPEN_TYPE)) {\n// font = new NFontOpenType(fontStreamBytes);\n font = fontFactory.createFontFile(\n fontStream, FontFactory.FONT_OPEN_TYPE);\n }\n }\n }\n // catch everything, we can fall back to font substitution if a failure\n // occurs. \n catch (Throwable e) {\n logger.log(Level.FINE, \"Error Reading Embedded Font \", e);\n }\n\n }", "public void fontLoader(){\n try {\n //create the font to use. Specify the size!\n customFont = Font.createFont(Font.TRUETYPE_FONT, new File(\".\\\\resources\\\\DS-DIGI.ttf\")).deriveFont(40f);\n GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\n ge.registerFont(customFont);\n } catch (IOException e) {\n e.printStackTrace();\n } catch(FontFormatException e) {\n e.printStackTrace();\n }\n }", "public Obj getEmbeddedFont() throws PDFNetException {\n/* 809 */ return Obj.__Create(GetEmbeddedFont(this.a), this.b);\n/* */ }", "private void loadFont() {\n\t\ttry {\n\t\t\tfont = Font.createFont(Font.TRUETYPE_FONT, new FileInputStream(\"assets/fonts/forced_square.ttf\"));\n\t\t} catch (Exception e) {\n\t\t\tfont = new Font(\"Helvetica\", Font.PLAIN, 22);\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public PdfFontProgram() {\n super();\n }", "static PDFont loadFont(PDDocument document) {\n Path fontPath = Paths.get(badgeResourcePath, \"/Bitstream - BankGothic Md BT Medium.ttf\");\n\n try (InputStream stream = new FileInputStream(fontPath.toFile())) {\n return PDType0Font.load(document, stream);\n } catch (IOException ex) {\n log.warn(\"Error, couldn't load font '{}'\", fontPath.toAbsolutePath());\n return PDType1Font.HELVETICA_BOLD;\n }\n }", "@Test\n void testAcroFormDefaultFonts() throws IOException\n {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n try (PDDocument doc = new PDDocument())\n {\n PDPage page = new PDPage(PDRectangle.A4);\n doc.addPage(page);\n PDAcroForm acroForm2 = new PDAcroForm(doc);\n doc.getDocumentCatalog().setAcroForm(acroForm2);\n PDResources defaultResources = acroForm2.getDefaultResources();\n assertNull(defaultResources);\n defaultResources = new PDResources();\n acroForm2.setDefaultResources(defaultResources);\n assertNull(defaultResources.getFont(COSName.HELV));\n assertNull(defaultResources.getFont(COSName.ZA_DB));\n\n // getting AcroForm sets the two fonts\n acroForm2 = doc.getDocumentCatalog().getAcroForm();\n defaultResources = acroForm2.getDefaultResources();\n assertNotNull(defaultResources.getFont(COSName.HELV));\n assertNotNull(defaultResources.getFont(COSName.ZA_DB));\n\n // repeat with a new AcroForm (to delete AcroForm cache) and thus missing /DR\n doc.getDocumentCatalog().setAcroForm(new PDAcroForm(doc));\n acroForm2 = doc.getDocumentCatalog().getAcroForm();\n defaultResources = acroForm2.getDefaultResources();\n \n PDFont helv = defaultResources.getFont(COSName.HELV);\n PDFont zadb = defaultResources.getFont(COSName.ZA_DB);\n assertNotNull(helv);\n assertNotNull(zadb);\n doc.save(baos);\n }\n try (PDDocument doc = Loader.loadPDF(baos.toByteArray()))\n {\n PDAcroForm acroForm2 = doc.getDocumentCatalog().getAcroForm();\n PDResources defaultResources = acroForm2.getDefaultResources();\n PDFont helv = defaultResources.getFont(COSName.HELV);\n PDFont zadb = defaultResources.getFont(COSName.ZA_DB);\n assertNotNull(helv);\n assertNotNull(zadb);\n // make sure that font wasn't overwritten\n assertTrue(helv instanceof PDType1Font);\n assertTrue(zadb instanceof PDType1Font);\n PDType1Font helvType1 = (PDType1Font) helv;\n PDType1Font zadbType1 = (PDType1Font) zadb;\n assertEquals(FontName.HELVETICA.getName(), helv.getName());\n assertEquals(FontName.ZAPF_DINGBATS.getName(), zadb.getName());\n assertNull(helvType1.getType1Font());\n assertNull(zadbType1.getType1Font());\n }\n }", "private void setFont() {\n try {\n setFont(Font.loadFont(new FileInputStream(FONT_PATH), 23));\n } catch (FileNotFoundException e) {\n setFont(Font.font(\"Verdana\", 23));\n }\n }", "private FontData() {\n }", "private FontData(InputStream ttf, float size) throws IOException {\n if (ttf.available() > MAX_FILE_SIZE) {\n throw new IOException(\"Can't load font - too big\");\n }\n byte[] data = IOUtils.toByteArray(ttf);\n if (data.length > MAX_FILE_SIZE) {\n throw new IOException(\"Can't load font - too big\");\n }\n\n this.size = size;\n try {\n javaFont = Font.createFont(Font.TRUETYPE_FONT, new ByteArrayInputStream(data));\n TTFFile rawFont = new TTFFile();\n if (!rawFont.readFont(new FontFileReader(data))) {\n throw new IOException(\"Invalid font file\");\n }\n upem = rawFont.getUPEM();\n ansiKerning = rawFont.getAnsiKerning();\n charWidth = rawFont.getAnsiWidth();\n fontName = rawFont.getPostScriptName();\n familyName = rawFont.getFamilyName();\n\n String name = getName();\n System.err.println(\"Loaded: \" + name + \" (\" + data.length + \")\");\n boolean bo = false;\n boolean it = false;\n if (name.indexOf(',') >= 0) {\n name = name.substring(name.indexOf(','));\n\n if (name.indexOf(\"Bold\") >= 0) {\n bo = true;\n }\n if (name.indexOf(\"Italic\") >= 0) {\n it = true;\n }\n }\n\n if ((bo & it)) {\n javaFont = javaFont.deriveFont(Font.BOLD | Font.ITALIC);\n } else if (bo) {\n javaFont = javaFont.deriveFont(Font.BOLD);\n } else if (it) {\n javaFont = javaFont.deriveFont(Font.ITALIC);\n }\n } catch (FontFormatException e) {\n IOException x = new IOException(\"Failed to read font\");\n x.initCause(e);\n throw x;\n }\n }", "public FontFile getEmbeddedFont() {\n return font;\n }", "private void setupFonts()\r\n\t{\r\n\t\tSystem.out.println(\"In setupFonts()\");\r\n\t\t\r\n\t\t// set up the text fonts\r\n\t\ttry\r\n\t\t{\r\n\t\t\ttextFont = Font.createFont(Font.TRUETYPE_FONT, AppletResourceLoader.getFileFromJar(GameConstants.PATH_FONTS + \"FOXLEY8_.ttf\"));\r\n\t\t\ttextFont = textFont.deriveFont(16.0f);\r\n\t\t\ttextFontBold = textFont.deriveFont(Font.BOLD, 16.0f);\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"ERROR IN setupFonts(): \" + e.getClass().getName() + \" - \" + e.getMessage());\r\n\t\t}\r\n\t}", "Font createFont();", "private void loadSystemFont(String font){\n mFont = new Font(font, mFontStyle, (int)mFontSize);\n }", "public String getEmbeddedFontName() throws PDFNetException {\n/* 795 */ return GetEmbeddedFontName(this.a);\n/* */ }", "private static Font[] loadFonts() throws Exception {\r\n Font font = Font.createFont(Font.TRUETYPE_FONT, Class.class.getClass()\r\n .getResource(\"/language/fonts/code2000.ttf\").openStream());\r\n // since 1.6 we could register the font and use it by name\r\n // but using the font directly makes us 1.5 compatible\r\n // GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(font);\r\n return new Font[]{font};\r\n }", "public void init( )\n {\n metFont = new HersheyFont( getDocumentBase(), getParameter(\"font\"));\n }", "public void assertCustomFonts()\n {\n Style root = getStyle(\"base\");\n assertFonts(root);\n }", "@Test\n public void Test_Output_Font() throws Exception {\n String actual_value = \"\";\n String expected_value = \"1 0 obj \\n<< \\n/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] \\n\";\n expected_value += \"/Font \\n<< \\n/F2 \\n<< \\n/Type /Font \\n/BaseFont /Helvetica \\n/SubType /Type1 \\n\";\n expected_value += \">> \\n>> \\n>> \\n\";\n\n PdfResource resrc = new PdfResource();\n resrc.addFont(new PdfFont(PdfFont.HELVETICA, false, false));\n actual_value = new String(resrc.dumpInfo());\n \n assertThat(actual_value, equalTo(expected_value));\n }", "public static Font create(Doc paramDoc, Font paramFont, String paramString) throws PDFNetException {\n/* 157 */ return __Create(Create(paramDoc.__GetHandle(), paramFont.a, paramString), paramDoc);\n/* */ }", "private void setFont() {\n\t}", "private native void init(Font font, String nativeName, int size);", "@Test\n void testAddMissingInformationOnAcroFormAccess()\n {\n try\n {\n byte[] pdfBytes = createAcroFormWithMissingResourceInformation();\n\n try (PDDocument pdfDocument = Loader.loadPDF(pdfBytes))\n {\n PDDocumentCatalog documentCatalog = pdfDocument.getDocumentCatalog();\n \n // this call shall trigger the generation of missing information\n PDAcroForm theAcroForm = documentCatalog.getAcroForm();\n \n // ensure that the missing information has been generated\n // DA entry\n assertEquals(\"/Helv 0 Tf 0 g \", theAcroForm.getDefaultAppearance());\n assertNotNull(theAcroForm.getDefaultResources());\n \n // DR entry\n PDResources acroFormResources = theAcroForm.getDefaultResources();\n assertNotNull(acroFormResources.getFont(COSName.getPDFName(\"Helv\")));\n assertEquals(\"Helvetica\", acroFormResources.getFont(COSName.getPDFName(\"Helv\")).getName());\n assertNotNull(acroFormResources.getFont(COSName.getPDFName(\"ZaDb\")));\n assertEquals(\"ZapfDingbats\", acroFormResources.getFont(COSName.getPDFName(\"ZaDb\")).getName());\n }\n }\n catch (IOException e)\n {\n System.err.println(\"Couldn't create test document, test skipped\");\n return;\n }\n }", "abstract Font getFont();", "FontMapperImpl() {\n/* 55 */ this.substitutes.put(\"Courier\", \n/* 56 */ Arrays.asList(new String[] { \"CourierNew\", \"CourierNewPSMT\", \"LiberationMono\", \"NimbusMonL-Regu\" }));\n/* 57 */ this.substitutes.put(\"Courier-Bold\", \n/* 58 */ Arrays.asList(new String[] { \"CourierNewPS-BoldMT\", \"CourierNew-Bold\", \"LiberationMono-Bold\", \"NimbusMonL-Bold\" }));\n/* */ \n/* 60 */ this.substitutes.put(\"Courier-Oblique\", \n/* 61 */ Arrays.asList(new String[] { \"CourierNewPS-ItalicMT\", \"CourierNew-Italic\", \"LiberationMono-Italic\", \"NimbusMonL-ReguObli\" }));\n/* */ \n/* 63 */ this.substitutes.put(\"Courier-BoldOblique\", \n/* 64 */ Arrays.asList(new String[] { \"CourierNewPS-BoldItalicMT\", \"CourierNew-BoldItalic\", \"LiberationMono-BoldItalic\", \"NimbusMonL-BoldObli\" }));\n/* */ \n/* 66 */ this.substitutes.put(\"Helvetica\", \n/* 67 */ Arrays.asList(new String[] { \"ArialMT\", \"Arial\", \"LiberationSans\", \"NimbusSanL-Regu\" }));\n/* 68 */ this.substitutes.put(\"Helvetica-Bold\", \n/* 69 */ Arrays.asList(new String[] { \"Arial-BoldMT\", \"Arial-Bold\", \"LiberationSans-Bold\", \"NimbusSanL-Bold\" }));\n/* */ \n/* 71 */ this.substitutes.put(\"Helvetica-Oblique\", \n/* 72 */ Arrays.asList(new String[] { \"Arial-ItalicMT\", \"Arial-Italic\", \"Helvetica-Italic\", \"LiberationSans-Italic\", \"NimbusSanL-ReguItal\" }));\n/* */ \n/* 74 */ this.substitutes.put(\"Helvetica-BoldOblique\", \n/* 75 */ Arrays.asList(new String[] { \"Arial-BoldItalicMT\", \"Helvetica-BoldItalic\", \"LiberationSans-BoldItalic\", \"NimbusSanL-BoldItal\" }));\n/* */ \n/* 77 */ this.substitutes.put(\"Times-Roman\", \n/* 78 */ Arrays.asList(new String[] { \"TimesNewRomanPSMT\", \"TimesNewRoman\", \"TimesNewRomanPS\", \"LiberationSerif\", \"NimbusRomNo9L-Regu\" }));\n/* */ \n/* 80 */ this.substitutes.put(\"Times-Bold\", \n/* 81 */ Arrays.asList(new String[] { \"TimesNewRomanPS-BoldMT\", \"TimesNewRomanPS-Bold\", \"TimesNewRoman-Bold\", \"LiberationSerif-Bold\", \"NimbusRomNo9L-Medi\" }));\n/* */ \n/* */ \n/* 84 */ this.substitutes.put(\"Times-Italic\", \n/* 85 */ Arrays.asList(new String[] { \"TimesNewRomanPS-ItalicMT\", \"TimesNewRomanPS-Italic\", \"TimesNewRoman-Italic\", \"LiberationSerif-Italic\", \"NimbusRomNo9L-ReguItal\" }));\n/* */ \n/* */ \n/* 88 */ this.substitutes.put(\"Times-BoldItalic\", \n/* 89 */ Arrays.asList(new String[] { \"TimesNewRomanPS-BoldItalicMT\", \"TimesNewRomanPS-BoldItalic\", \"TimesNewRoman-BoldItalic\", \"LiberationSerif-BoldItalic\", \"NimbusRomNo9L-MediItal\" }));\n/* */ \n/* */ \n/* 92 */ this.substitutes.put(\"Symbol\", Arrays.asList(new String[] { \"Symbol\", \"SymbolMT\", \"StandardSymL\" }));\n/* 93 */ this.substitutes.put(\"ZapfDingbats\", Arrays.asList(new String[] { \"ZapfDingbatsITC\", \"Dingbats\", \"MS-Gothic\" }));\n/* */ \n/* */ \n/* */ \n/* 97 */ for (String baseName : Standard14Fonts.getNames()) {\n/* */ \n/* 99 */ if (!this.substitutes.containsKey(baseName)) {\n/* */ \n/* 101 */ String mappedName = Standard14Fonts.getMappedFontName(baseName);\n/* 102 */ this.substitutes.put(baseName, copySubstitutes(mappedName));\n/* */ } \n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ try {\n/* 110 */ String ttfName = \"/org/apache/pdfbox/resources/ttf/LiberationSans-Regular.ttf\";\n/* 111 */ InputStream ttfStream = FontMapper.class.getResourceAsStream(ttfName);\n/* 112 */ if (ttfStream == null)\n/* */ {\n/* 114 */ throw new IOException(\"Error loading resource: \" + ttfName);\n/* */ }\n/* 116 */ TTFParser ttfParser = new TTFParser();\n/* 117 */ this.lastResortFont = ttfParser.parse(ttfStream);\n/* */ }\n/* 119 */ catch (IOException e) {\n/* */ \n/* 121 */ throw new RuntimeException(e);\n/* */ } \n/* */ }", "private Font(File fontFile, int fontFormat,\n boolean isCopy, CreatedFontTracker tracker)\n throws FontFormatException {\n\tthis.createdFont = true;\n\t/* Font2D instances created by this method track their font file\n\t * so that when the Font2D is GC'd it can also remove the file.\n\t */\n\tthis.font2DHandle =\n\t FontManager.createFont2D(fontFile, fontFormat,\n isCopy, tracker).handle;\n\n\tthis.name = this.font2DHandle.font2D.getFontName(Locale.getDefault());\n\tthis.style = Font.PLAIN;\n\tthis.size = 1;\n\tthis.pointSize = 1f;\n }", "private void LoadContent() {\n\t\ttry { // Récupération de la police d'écriture\n\t\t\tfont1 = Font.createFont(Font.TRUETYPE_FONT, new File(\"res/polices/Coalition.ttf\"));\n\t\t\tfont2 = Font.createFont(Font.TRUETYPE_FONT, new File(\"res/polices/13_Misa.ttf\"));\n\t\t} catch (final Exception err) {\n\t\t\tSystem.err.println(\"Police(s) d'écriture introuvable(s) !\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "FontMatch(FontInfo info) {\n/* 704 */ this.info = info;\n/* */ }", "@Test\n void testBadDA() throws IOException\n {\n try (PDDocument doc = new PDDocument())\n {\n PDPage page = new PDPage();\n doc.addPage(page);\n\n PDAcroForm acroForm = new PDAcroForm(document);\n doc.getDocumentCatalog().setAcroForm(acroForm);\n acroForm.setDefaultResources(new PDResources());\n\n PDTextField textBox = new PDTextField(acroForm);\n textBox.setPartialName(\"SampleField\");\n\n // https://stackoverflow.com/questions/50609478/\n // \"tf\" is a typo, should have been \"Tf\" and this results that no font is chosen\n textBox.setDefaultAppearance(\"/Helv 0 tf 0 g\");\n acroForm.getFields().add(textBox);\n\n PDAnnotationWidget widget = textBox.getWidgets().get(0);\n PDRectangle rect = new PDRectangle(50, 750, 200, 20);\n widget.setRectangle(rect);\n widget.setPage(page);\n\n page.getAnnotations().add(widget);\n \n Assertions.assertThrows(IllegalArgumentException.class, () -> textBox.setValue(\"huhu\"),\n \"IllegalArgumentException should have been thrown\");\n }\n }", "public void allowUnsupportedFont() {\n if (mBuilderPtr == 0) {\n throw new IllegalStateException(\"Unable to allow unsupported font.\");\n }\n nAllowUnsupportedFont(mBuilderPtr);\n }", "public void setFontProgram(PdfFile fontProgram) {\n this.add(fontProgram);\n }", "public FontDescriptor(final PDFont font, final float size) {\n this.font = font;\n this.size = size;\n }", "public OneFont(FontData fd) {\r\n\t\tname = fd.getName();\r\n\t\theight = fd.getHeight();\r\n\t\tstyle = fd.getStyle();\r\n\t\tfont = new Font(Display.getDefault(), fd);\r\n\t}", "private FontBoxFont findFont(FontFormat format, String postScriptName) {\n/* 403 */ if (postScriptName == null)\n/* */ {\n/* 405 */ return null;\n/* */ }\n/* */ \n/* */ \n/* 409 */ if (this.fontProvider == null)\n/* */ {\n/* 411 */ getProvider();\n/* */ }\n/* */ \n/* */ \n/* 415 */ FontInfo info = getFont(format, postScriptName);\n/* 416 */ if (info != null)\n/* */ {\n/* 418 */ return info.getFont();\n/* */ }\n/* */ \n/* */ \n/* 422 */ info = getFont(format, postScriptName.replaceAll(\"-\", \"\"));\n/* 423 */ if (info != null)\n/* */ {\n/* 425 */ return info.getFont();\n/* */ }\n/* */ \n/* */ \n/* 429 */ for (String substituteName : getSubstitutes(postScriptName)) {\n/* */ \n/* 431 */ info = getFont(format, substituteName);\n/* 432 */ if (info != null)\n/* */ {\n/* 434 */ return info.getFont();\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* 439 */ info = getFont(format, postScriptName.replaceAll(\",\", \"-\"));\n/* 440 */ if (info != null)\n/* */ {\n/* 442 */ return info.getFont();\n/* */ }\n/* */ \n/* */ \n/* 446 */ info = getFont(format, postScriptName + \"-Regular\");\n/* 447 */ if (info != null)\n/* */ {\n/* 449 */ return info.getFont();\n/* */ }\n/* */ \n/* 452 */ return null;\n/* */ }", "private void initFonts() {\n Typeface typeFace = Typeface.createFromAsset(getAssets(), \"fonts/BuriedBeforeBB_Reg.otf\");\n\n TextView textViewScore = (TextView) findViewById(R.id.txtScore);\n TextView textViewLives = (TextView) findViewById(R.id.txtLives);\n TextView txtGameOver = (TextView) findViewById(R.id.txtGameOver);\n TextView txtGameOver2 = (TextView) findViewById(R.id.txtGameOver2);\n\n textViewScore.setTypeface(typeFace);\n textViewLives.setTypeface(typeFace);\n txtGameOver.setTypeface(typeFace);\n txtGameOver2.setTypeface(typeFace);\n txtNextLevel.setTypeface(typeFace);\n }", "public BitmapFont loadBitmapFont(String fileFont, String fileImage);", "@Override\n @SuppressWarnings(\"unchecked\")\n public SlickRenderFont loadFont(final Graphics g, final String filename) throws SlickLoadFontException {\n try {\n Font javaFont = loadJavaFont(filename);\n \n if (javaFont == null) {\n throw new SlickLoadFontException(\"Loading TTF Font failed.\");\n }\n \n if (javaFont.getSize() == 1) {\n javaFont = javaFont.deriveFont(12.f);\n }\n \n final UnicodeFont uniFont = new UnicodeFont(javaFont);\n uniFont.addAsciiGlyphs();\n uniFont.getEffects().add(new ColorEffect());\n \n return new UnicodeSlickRenderFont(uniFont, javaFont);\n } catch (final Exception e) {\n throw new SlickLoadFontException(\"Loading the font failed.\", e);\n }\n }", "public FTError.ErrorTag TTLoadGlyph(TTSizeRec ttsize, int glyph_index, Set<Flags.Load> load_flags) {\n FTError.ErrorTag error;\n TTLoaderRec loader;\n\nDebug(0, DebugTag.DBG_LOAD_GLYPH, TAG, String.format(\"TT_Load_Glyph: glyph_index: %d size: \" + ttsize, glyph_index));\n /* if FT_LOAD_NO_SCALE is not set, `ttmetrics' must be valid */\n if (!load_flags.contains(Flags.Load.NO_SCALE) && ttsize.getTtmetrics().isValid() == false) {\n error = FTError.ErrorTag.LOAD_INVALID_SIZE_HANDLE;\n return error;\n }\n if (load_flags.contains(Flags.Load.SBITS_ONLY)) {\n error = FTError.ErrorTag.LOAD_INVALID_ARGUMENT;\n return error;\n }\n loader = new TTLoaderRec();\n error = loader.tt_loader_init(ttsize, this, load_flags, false);\n if (error != FTError.ErrorTag.ERR_OK) {\n return error;\n }\n format = FTTags.GlyphFormat.OUTLINE;\n num_subglyphs = 0;\n outline.setFlags(0);\nDebug(0, DebugTag.DBG_LOAD_GLYPH, TAG, \"load_truetype_glyph\");\n /* main loading loop */\n error = loader.load_truetype_glyph(glyph_index, 0, false);\n if (error == FTError.ErrorTag.ERR_OK) {\n if (format == FTTags.GlyphFormat.COMPOSITE) {\n num_subglyphs = loader.getGloader().getBase().getNum_subglyphs();\n subglyphs = loader.getGloader().getBase().getSubglyphs();\n } else {\n outline = loader.getGloader().getBase().getOutline();\n outline.setFlags(outline.getFlags() & ~Flags.Outline.SINGLE_PASS.getVal());\n /* Translate array so that (0,0) is the glyph's origin. Note */\n /* that this behaviour is independent on the value of bit 1 of */\n /* the `flags' field in the `head' table -- at least major */\n /* applications like Acroread indicate that. */\nloader.getBase().showLoaderZone(\"TTLoadGlyph\", null);\nDebug(0, DebugTag.DBG_LOAD_GLYPH, TAG, String.format(\"loader.pp1.x: %d\", loader.getPp1().getX()));\n int i;\n for (i = 0; i < loader.getGloader().getCurrent().getN_points() + 4; i++) {\n Debug(0, DebugTag.DBG_LOAD_GLYPH, TAG, String.format(\"PP1: i: %d ipoints_idx: %d x: %d y: %d\\n\", i, loader.getGloader().getCurrent().getPoints_idx(), loader.getGloader().getCurrent().getPoint(i).getX(),\n loader.getGloader().getCurrent().getPoint(i).getY()));\n }\n if (loader.getPp1().getX() != 0) {\n outline.OutlineTranslate(-loader.getPp1().getX(), 0);\n }\n }\n\n Debug(0, DebugTag.DBG_LOAD_GLYPH, TAG, \"IS_HINTED: \"+!load_flags.contains(Flags.Load.NO_HINTING));\n if (!load_flags.contains(Flags.Load.NO_HINTING)) {\n if (loader.getExec().graphics_state.isScan_control()) {\n /* convert scan conversion mode to FT_OUTLINE_XXX flags */\n Debug(0, DebugTag.DBG_LOAD_GLYPH, TAG, String.format(\"IS_HINTED2: %d\", loader.getExec().graphics_state.getScan_type()));\n switch (loader.getExec().graphics_state.getScan_type()) {\n case 0: /* simple drop-outs including stubs */\n outline.setFlags(outline.getFlags() | Flags.Outline.INCLUDE_STUBS.getVal());\n break;\n case 1: /* simple drop-outs excluding stubs */\n /* nothing; it's the default rendering mode */\n break;\n case 4: /* smart drop-outs including stubs */\n outline.setFlags(outline.getFlags() | Flags.Outline.SMART_DROPOUTS.getVal() |\n Flags.Outline.INCLUDE_STUBS.getVal());\n break;\n case 5: /* smart drop-outs excluding stubs */\n outline.setFlags(outline.getFlags() | Flags.Outline.SMART_DROPOUTS.getVal());\n break;\n default: /* no drop-out control */\n outline.setFlags(outline.getFlags() | Flags.Outline.IGNORE_DROPOUTS.getVal());\n break;\n }\n } else {\n outline.setFlags(outline.getFlags() | Flags.Outline.IGNORE_DROPOUTS.getVal());\n }\n }\n loader.compute_glyph_metrics(glyph_index);\n }\n /* Set the `high precision' bit flag. */\n /* This is _critical_ to get correct output for monochrome */\n /* TrueType glyphs at all sizes using the bytecode interpreter. */\n /* */\n if (!load_flags.contains(Flags.Load.NO_SCALE) && ttsize.getMetrics().getY_ppem() < 24) {\n outline.setFlags(outline.getFlags() | Flags.Outline.HIGH_PRECISION.getVal());\n }\n return error;\n }", "public abstract Font getFont();", "public CIDFontMapping getCIDFont(String baseFont, PDFontDescriptor fontDescriptor, PDCIDSystemInfo cidSystemInfo) {\n/* 487 */ OpenTypeFont otf1 = (OpenTypeFont)findFont(FontFormat.OTF, baseFont);\n/* 488 */ if (otf1 != null)\n/* */ {\n/* 490 */ return new CIDFontMapping(otf1, null, false);\n/* */ }\n/* */ \n/* */ \n/* 494 */ TrueTypeFont ttf = (TrueTypeFont)findFont(FontFormat.TTF, baseFont);\n/* 495 */ if (ttf != null)\n/* */ {\n/* 497 */ return new CIDFontMapping(null, (FontBoxFont)ttf, false);\n/* */ }\n/* */ \n/* 500 */ if (cidSystemInfo != null) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 506 */ String collection = cidSystemInfo.getRegistry() + \"-\" + cidSystemInfo.getOrdering();\n/* */ \n/* 508 */ if (collection.equals(\"Adobe-GB1\") || collection.equals(\"Adobe-CNS1\") || collection\n/* 509 */ .equals(\"Adobe-Japan1\") || collection.equals(\"Adobe-Korea1\")) {\n/* */ \n/* */ \n/* 512 */ PriorityQueue<FontMatch> queue = getFontMatches(fontDescriptor, cidSystemInfo);\n/* 513 */ FontMatch bestMatch = queue.poll();\n/* 514 */ if (bestMatch != null) {\n/* */ \n/* 516 */ FontBoxFont font = bestMatch.info.getFont();\n/* 517 */ if (font instanceof OpenTypeFont)\n/* */ {\n/* 519 */ return new CIDFontMapping((OpenTypeFont)font, null, true);\n/* */ }\n/* 521 */ if (font != null)\n/* */ {\n/* 523 */ return new CIDFontMapping(null, font, true);\n/* */ }\n/* */ } \n/* */ } \n/* */ } \n/* */ \n/* */ \n/* 530 */ return new CIDFontMapping(null, (FontBoxFont)this.lastResortFont, true);\n/* */ }", "@SuppressWarnings(\"unchecked\")\n public TF addFont() {\n final ParameterizedType pt = (ParameterizedType) getClass()\n .getGenericSuperclass();\n final ParameterizedType paramType = (ParameterizedType) pt\n .getActualTypeArguments()[2];\n final Class<TF> fontClass = (Class<TF>) paramType.getRawType();\n try {\n final Constructor<TF> c = fontClass\n .getDeclaredConstructor(ACellStyle.class);\n return c.newInstance(this);\n }\n catch (final Exception e) {\n throw new ReportBuilderException(e);\n }\n }", "private void setupFont() {\n CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()\n .setDefaultFontPath(\"fonts/Montserrat-Regular.otf\")\n .setFontAttrId(R.attr.fontPath)\n .build()\n );\n }", "Type1Glyph2D(PDSimpleFont font) {\n/* 45 */ this.font = font;\n/* */ }", "private java.awt.Font getFont(Feature feature, Font[] fonts) {\n if (fontFamilies == null) {\n GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\n fontFamilies = new HashSet();\n \n List f = Arrays.asList(ge.getAvailableFontFamilyNames());\n fontFamilies.addAll(f);\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"there are \" + fontFamilies.size() + \" fonts available\");\n }\n }\n \n java.awt.Font javaFont = null;\n \n int styleCode = 0;\n int size = 6;\n String requestedFont = \"\";\n \n for (int k = 0; k < fonts.length; k++) {\n requestedFont = fonts[k].getFontFamily().getValue(feature).toString();\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"trying to load \" + requestedFont);\n }\n \n if (loadedFonts.containsKey(requestedFont)) {\n javaFont = (java.awt.Font) loadedFonts.get(requestedFont);\n \n String reqStyle = (String) fonts[k].getFontStyle().getValue(feature);\n \n if (fontStyleLookup.containsKey(reqStyle)) {\n styleCode = ((Integer) fontStyleLookup.get(reqStyle)).intValue();\n } else {\n styleCode = java.awt.Font.PLAIN;\n }\n \n String reqWeight = (String) fonts[k].getFontWeight().getValue(feature);\n \n if (reqWeight.equalsIgnoreCase(\"Bold\")) {\n styleCode = styleCode | java.awt.Font.BOLD;\n }\n \n size = ((Number) fonts[k].getFontSize().getValue(feature)).intValue();\n \n return javaFont.deriveFont(styleCode, size);\n }\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"not already loaded\");\n }\n \n if (fontFamilies.contains(requestedFont)) {\n String reqStyle = (String) fonts[k].getFontStyle().getValue(feature);\n \n if (fontStyleLookup.containsKey(reqStyle)) {\n styleCode = ((Integer) fontStyleLookup.get(reqStyle)).intValue();\n } else {\n styleCode = java.awt.Font.PLAIN;\n }\n \n String reqWeight = (String) fonts[k].getFontWeight().getValue(feature);\n \n if (reqWeight.equalsIgnoreCase(\"Bold\")) {\n styleCode = styleCode | java.awt.Font.BOLD;\n }\n \n size = ((Number) fonts[k].getFontSize().getValue(feature)).intValue();\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"requesting \" + requestedFont + \" \" + styleCode + \" \" + size);\n }\n \n javaFont = new java.awt.Font(requestedFont, styleCode, size);\n loadedFonts.put(requestedFont, javaFont);\n \n return javaFont;\n }\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"not a system font\");\n }\n \n // may be its a file or url\n InputStream is = null;\n \n if (requestedFont.startsWith(\"http\") || requestedFont.startsWith(\"file:\")) {\n try {\n URL url = new URL(requestedFont);\n is = url.openStream();\n } catch (MalformedURLException mue) {\n // this may be ok - but we should mention it\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"Bad url in java2drenderer\" + requestedFont + \"\\n\" + mue);\n }\n } catch (IOException ioe) {\n // we'll ignore this for the moment\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"IO error in java2drenderer \" + requestedFont + \"\\n\" + ioe);\n }\n }\n } else {\n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"not a URL\");\n }\n \n File file = new File(requestedFont);\n \n //if(file.canRead()){\n try {\n is = new FileInputStream(file);\n } catch (FileNotFoundException fne) {\n // this may be ok - but we should mention it\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"Bad file name in java2drenderer\" + requestedFont + \"\\n\" + fne);\n }\n }\n }\n \n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"about to load\");\n }\n \n if (is == null) {\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"null input stream\");\n }\n \n continue;\n }\n \n try {\n javaFont = java.awt.Font.createFont(java.awt.Font.TRUETYPE_FONT, is);\n } catch (FontFormatException ffe) {\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"Font format error in java2drender \" + requestedFont + \"\\n\" + ffe);\n }\n \n continue;\n } catch (IOException ioe) {\n // we'll ignore this for the moment\n if (LOGGER.isLoggable(Level.INFO)) {\n LOGGER.info(\"IO error in java2drenderer \" + requestedFont + \"\\n\" + ioe);\n }\n \n continue;\n }\n \n loadedFonts.put(requestedFont, javaFont);\n \n return javaFont;\n }\n \n return null;\n }", "public void setFont(Font f) {\n font = f;\n compute();\n }", "public FontMapping<FontBoxFont> getFontBoxFont(String baseFont, PDFontDescriptor fontDescriptor) {\n/* */ TrueTypeFont trueTypeFont;\n/* 348 */ FontBoxFont font = findFontBoxFont(baseFont);\n/* 349 */ if (font != null)\n/* */ {\n/* 351 */ return new FontMapping<FontBoxFont>(font, false);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 356 */ String fallbackName = getFallbackFontName(fontDescriptor);\n/* 357 */ font = findFontBoxFont(fallbackName);\n/* 358 */ if (font == null)\n/* */ {\n/* */ \n/* 361 */ trueTypeFont = this.lastResortFont;\n/* */ }\n/* 363 */ return new FontMapping(trueTypeFont, true);\n/* */ }", "public void initFont() {\r\n\t\tFont dosFont = null;\r\n try {\r\n \t//setup font\r\n\t\t\t\tURL fontUrl = getURL(\"fonts/DOSFont.ttf\");\r\n\t\t \tdosFont = Font.createFont(Font.TRUETYPE_FONT, fontUrl.openStream());\r\n\t \tdosFont = dosFont.deriveFont(Font.PLAIN, 15);\r\n\t \tGraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\r\n\t \tge.registerFont(dosFont);\r\n\t } catch(Exception e) {\r\n\t e.printStackTrace();\r\n\t System.exit(-1);\r\n\t }\r\n screen.setFont(dosFont);//set font on JTextArea\r\n\t}", "public SlickRenderFont loadFont(final Graphics g, final String filename) {\r\n final Iterator<SlickRenderFontLoader> itr = getLoaderIterator();\r\n\r\n while (itr.hasNext()) {\r\n try {\r\n return itr.next().loadFont(g, filename);\r\n } catch (final SlickLoadFontException e) {\r\n // this loader failed... does not matter\r\n }\r\n }\r\n\r\n throw new IllegalArgumentException(\"Failed to load font \\\"\" + filename + \"\\\".\");\r\n }", "public static Typeface loadFont(NgApp ngApp, String fontPath) {\n return Typeface.createFromAsset(ngApp.activity.getAssets(), \"fonts/\" + fontPath);\n }", "public void cargarPdf() {\n\t\tif (pdf != null) {\n\t\t\tFacesMessage message = new FacesMessage(\"Se cargo \", pdf.getFileName() + \" correctamente.\");\n\t\t\tFacesContext.getCurrentInstance().addMessage(null, message);\n\t\t}\n\t}", "private void setFont() {\n Typeface font = Typeface.createFromAsset(getContext().getAssets(), mFontPath);\n setTypeface(font, Typeface.NORMAL);\n }", "public Font createFont() {\n\t\treturn null;\n\t}", "public void loadPdfFile() {\n PDFView.Configurator configurator;\n RelativeLayout relativeLayout = (RelativeLayout)this.pdfView.getParent();\n this.errorTextView = (TextView)relativeLayout.findViewById(2131296408);\n this.progressBar = (ProgressBar)relativeLayout.findViewById(2131296534);\n this.sharedPreferences = Factory.getInstance().getMainNavigationActivity().getSharedPreferences(\"AppsgeyserPrefs\", 0);\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"pdf_saved_page_\");\n stringBuilder.append(this.initialTabId);\n savedPageKey = stringBuilder.toString();\n if (this.pathFile.startsWith(\"file:///\")) {\n String string2 = this.pathFile.replace((CharSequence)\"file:///android_asset/\", (CharSequence)\"\");\n configurator = this.pdfView.fromAsset(string2);\n } else {\n boolean bl = this.pathFile.startsWith(\"http\");\n configurator = null;\n if (bl) {\n String string3 = this.pathFile;\n new LoaderPdf().execute((Object[])new String[]{string3});\n }\n }\n this.pdfView.useBestQuality(true);\n if (configurator == null) return;\n try {\n this.loadConfigurator(configurator);\n return;\n }\n catch (Exception exception) {\n exception.printStackTrace();\n this.progressBar.setVisibility(8);\n }\n }", "private String getFallbackFontName(PDFontDescriptor fontDescriptor) {\n/* */ String fontName;\n/* 235 */ if (fontDescriptor != null) {\n/* */ \n/* */ \n/* 238 */ boolean isBold = false;\n/* 239 */ String name = fontDescriptor.getFontName();\n/* 240 */ if (name != null) {\n/* */ \n/* 242 */ String lower = fontDescriptor.getFontName().toLowerCase();\n/* */ \n/* */ \n/* 245 */ isBold = (lower.contains(\"bold\") || lower.contains(\"black\") || lower.contains(\"heavy\"));\n/* */ } \n/* */ \n/* */ \n/* 249 */ if (fontDescriptor.isFixedPitch()) {\n/* */ \n/* 251 */ fontName = \"Courier\";\n/* 252 */ if (isBold && fontDescriptor.isItalic())\n/* */ {\n/* 254 */ fontName = fontName + \"-BoldOblique\";\n/* */ }\n/* 256 */ else if (isBold)\n/* */ {\n/* 258 */ fontName = fontName + \"-Bold\";\n/* */ }\n/* 260 */ else if (fontDescriptor.isItalic())\n/* */ {\n/* 262 */ fontName = fontName + \"-Oblique\";\n/* */ }\n/* */ \n/* 265 */ } else if (fontDescriptor.isSerif()) {\n/* */ \n/* 267 */ fontName = \"Times\";\n/* 268 */ if (isBold && fontDescriptor.isItalic())\n/* */ {\n/* 270 */ fontName = fontName + \"-BoldItalic\";\n/* */ }\n/* 272 */ else if (isBold)\n/* */ {\n/* 274 */ fontName = fontName + \"-Bold\";\n/* */ }\n/* 276 */ else if (fontDescriptor.isItalic())\n/* */ {\n/* 278 */ fontName = fontName + \"-Italic\";\n/* */ }\n/* */ else\n/* */ {\n/* 282 */ fontName = fontName + \"-Roman\";\n/* */ }\n/* */ \n/* */ } else {\n/* */ \n/* 287 */ fontName = \"Helvetica\";\n/* 288 */ if (isBold && fontDescriptor.isItalic())\n/* */ {\n/* 290 */ fontName = fontName + \"-BoldOblique\";\n/* */ }\n/* 292 */ else if (isBold)\n/* */ {\n/* 294 */ fontName = fontName + \"-Bold\";\n/* */ }\n/* 296 */ else if (fontDescriptor.isItalic())\n/* */ {\n/* 298 */ fontName = fontName + \"-Oblique\";\n/* */ }\n/* */ \n/* */ }\n/* */ \n/* */ } else {\n/* */ \n/* 305 */ fontName = \"Times-Roman\";\n/* */ } \n/* 307 */ return fontName;\n/* */ }", "public static Font create(Doc paramDoc, String paramString1, String paramString2) throws PDFNetException {\n/* 171 */ return __Create(Create(paramDoc.__GetHandle(), paramString1, paramString2), paramDoc);\n/* */ }", "@Test\n public void Test_FontList_Instances() throws Exception {\n PdfFont actual_font = null;\n PdfFont[] expected_font = new PdfFont[2];\n\n PdfResource resrc = new PdfResource();\n resrc.addFont(expected_font[0] = new PdfFont(PdfFont.HELVETICA, false, false));\n resrc.addFont(expected_font[1] = new PdfFont(PdfFont.COURIER, true, true));\n\n ArrayList<PdfFont> list = resrc.getFontList();\n for (int i = 0; i < list.size(); i++) {\n actual_font = (PdfFont) list.get(i);\n assertThat(actual_font, equalTo(expected_font[i]));\n }\n }", "public void setFont(Font font)\n {\n this.font = font;\n }", "@Test\n void testDontAddMissingInformationOnDocumentLoad()\n {\n try\n {\n byte[] pdfBytes = createAcroFormWithMissingResourceInformation();\n \n try (PDDocument pdfDocument = Loader.loadPDF(pdfBytes))\n {\n // do a low level access to the AcroForm to avoid the generation of missing entries\n PDDocumentCatalog documentCatalog = pdfDocument.getDocumentCatalog();\n COSDictionary catalogDictionary = documentCatalog.getCOSObject();\n COSDictionary acroFormDictionary = (COSDictionary) catalogDictionary.getDictionaryObject(COSName.ACRO_FORM);\n\n // ensure that the missing information has not been generated\n assertNull(acroFormDictionary.getDictionaryObject(COSName.DA));\n assertNull(acroFormDictionary.getDictionaryObject(COSName.RESOURCES));\n }\n }\n catch (IOException e)\n {\n System.err.println(\"Couldn't create test document, test skipped\");\n return;\n }\n }", "public FontFactory(String font, int size, String text) {\n this.font = new Font(font, Font.BOLD, size);\n ttf = new TrueTypeFont(this.font, true);\n this.text = text;\n }", "public int getEmbeddedFontBufSize() throws PDFNetException {\n/* 826 */ return GetEmbeddedFontBufSize(this.a);\n/* */ }", "public void setFont(RMFont aFont) { }", "public static Font create(Doc paramDoc, int paramInt, boolean paramBoolean) throws PDFNetException {\n/* 143 */ return __Create(Create(paramDoc.__GetHandle(), paramInt, paramBoolean), paramDoc);\n/* */ }", "public void setFont(Font value) {\r\n this.font = value;\r\n }", "public void init(RtfDocument p_document)\n {\n m_doc = p_document;\n m_stylesheet = null;\n\n // m_defaultParaProperties = null;\n\n m_paragraph = null;\n m_paraProperties = null;\n\n m_charProperties = null;\n m_charPropertiesStack = new RtfTextPropertiesStack();\n\n m_container = null;\n m_containerStack = new RtfCompoundObjectStack();\n }", "private void initFontAndChange(Context context) {\n changeFont(context);\n }", "public static void addFontDirectory(File dir) {\n processFontDirectory(dir, fonts);\n }", "public static Font create(Doc paramDoc, int paramInt) throws PDFNetException {\n/* 128 */ return __Create(Create(paramDoc.__GetHandle(), paramInt, false), paramDoc);\n/* */ }", "public RenderFontProcessing(PApplet app, PGraphics canvas, String filename) {\n\t\t\n\t\tthis.canvas = canvas;\n\t\tif (fileExists(filename)) {\n\t\t\tif ((filename.substring(filename.length() - 3)).equals(\"vlw\")) {\t\t\t\t\n\t\t\t\tthis.font = app.loadFont(filename);\n\t\t\t} else {\n\t\t\t\tSystem.err.println(filename + \" is an invalid filetype, only Processing VLW fonts are accepted.\");\n\t\t\t}\n\t\t} else {\t\t\t\n\t\t\tSystem.err.println(\"File \" + filename + \" not found.\");\n\t\t}\n\t}", "private static native boolean nAddFont(long builderPtr, ByteBuffer font, int ttcIndex,\n int weight, int isItalic);", "private static native Font createFont(String name, GFontPeer peer, int gdkfont);", "public static Font createType1Font(Doc paramDoc, String paramString) throws PDFNetException {\n/* 417 */ return __Create(CreateType1Font(paramDoc.__GetHandle(), paramString, true), paramDoc);\n/* */ }", "public void setFont(Font font) {\n\tthis.font = font;\n }", "public void writeFont(PdfWriter pdfWriter, PdfIndirectReference pdfIndirectReference, Object[] objArr) throws DocumentException, IOException {\n int i;\n int i2 = 0;\n int intValue = objArr[0].intValue();\n int intValue2 = objArr[1].intValue();\n byte[] bArr = objArr[2];\n if (!(objArr[3].booleanValue() && this.subset)) {\n i = bArr.length - 1;\n for (int i3 = 0; i3 < bArr.length; i3++) {\n bArr[i3] = 1;\n }\n } else {\n i2 = intValue;\n i = intValue2;\n }\n PdfIndirectReference pdfIndirectReference2 = null;\n PdfStream fullFontStream = getFullFontStream();\n if (fullFontStream != null) {\n pdfIndirectReference2 = pdfWriter.addToBody(fullFontStream).getIndirectReference();\n }\n PdfDictionary fontDescriptor = getFontDescriptor(pdfIndirectReference2);\n if (fontDescriptor != null) {\n pdfIndirectReference2 = pdfWriter.addToBody(fontDescriptor).getIndirectReference();\n }\n pdfWriter.addToBody((PdfObject) getFontBaseType(pdfIndirectReference2, i2, i, bArr), pdfIndirectReference);\n }", "@Test\n void testIllegalFieldsDefinition() throws IOException, URISyntaxException\n {\n String sourceUrl = \"https://issues.apache.org/jira/secure/attachment/12866226/D1790B.PDF\";\n\n try (PDDocument testPdf = Loader.loadPDF(\n RandomAccessReadBuffer.createBufferFromStream(new URI(sourceUrl).toURL().openStream())))\n {\n PDDocumentCatalog catalog = testPdf.getDocumentCatalog();\n\n assertDoesNotThrow(() -> catalog.getAcroForm(), \"Getting the AcroForm shall not throw an exception\");\n }\n }", "public BDFTextRenderer(BDFFontContainer bdfFont) {\n this.bdfFont = bdfFont;\n }", "private static void processFontDirectory(File dir, ArrayList fonts) {\n if (!dir.exists()) {\n return;\n }\n if (processed.contains(dir)) {\n return;\n }\n processed.add(dir);\n\n File[] sources = dir.listFiles();\n if (sources == null) {\n return;\n }\n\n for (int j = 0; j < sources.length; j++) {\n File source = sources[j];\n\n if (source.getName().equals(\".\")) {\n continue;\n }\n if (source.getName().equals(\"slick/src/test\")) {\n continue;\n }\n if (source.isDirectory()) {\n processFontDirectory(source, fonts);\n continue;\n }\n if (source.getName().toLowerCase().endsWith(\".ttf\")) {\n try {\n if (statusListener != null) {\n statusListener.updateStatus(\"Processing \" + source.getName());\n }\n FontData data = new FontData(new FileInputStream(source), 1);\n fonts.add(data);\n\n String famName = data.getFamilyName();\n if (!families.contains(famName)) {\n families.add(famName);\n }\n\n boolean bo = data.getJavaFont().isBold();\n boolean it = data.getJavaFont().isItalic();\n\n if ((bo) && (it)) {\n bolditalic.put(famName, data);\n } else if (bo) {\n bold.put(famName, data);\n } else if (it) {\n italic.put(famName, data);\n } else {\n plain.put(famName, data);\n }\n } catch (Exception e) {\n if (DEBUG) {\n System.err.println(\"Unable to process: \" + source.getAbsolutePath() + \" (\" + e.getClass() +\n \": \" + e.getMessage() + \")\");\n }\n if (statusListener != null) {\n statusListener.updateStatus(\"Unable to process: \" + source.getName());\n }\n }\n }\n }\n }", "public Fuentes () {\n File filearcade = new File (RUTA_ARCADE_FONT);\n File filechess = new File (RUTA_CHESS_FONT);\n File fileinvaders = new File (RUTA_INVADERS_FONT);\n File filesafety = new File (RUTA_SAFETY_FONT);\n\n try {\n setArcadeFont (Font.createFont (Font.TRUETYPE_FONT, filearcade));\n setChessFont (Font.createFont (Font.TRUETYPE_FONT, filechess));\n setInvadersFont (Font.createFont (Font.TRUETYPE_FONT, fileinvaders));\n setSafetyFont (Font.createFont (Font.TRUETYPE_FONT, filesafety));\n\n } catch (FontFormatException | IOException e) {\n e.printStackTrace ();\n }\n }", "public void setTextFont(Font font);", "public FontDescriptor(Library l, Hashtable h) {\n super(l, h);\n }", "public interface PDType1Equivalent extends PDFontLike\r\n{\r\n /**\r\n * Returns the name of this font.\r\n */\r\n\t@Override\r\n String getName();\r\n\r\n /**\r\n * Returns the glyph name for the given character code.\r\n *\r\n * @param code character code\r\n * @return PostScript glyph name\r\n */\r\n String codeToName(int code) throws IOException;\r\n\r\n /**\r\n * Returns the glyph path for the given character code.\r\n * @param name PostScript glyph name\r\n * @throws java.io.IOException if the font could not be read\r\n */\r\n Path getPath(String name) throws IOException;\r\n\r\n /**\r\n * Returns the embedded or system font for rendering. This font is a Type 1-equivalent, but\r\n * may not be a Type 1 font, it could be a CFF font or TTF font. If there is no suitable font\r\n * then the fallback font will be returned: this method never returns null.\r\n */\r\n Type1Equivalent getType1Equivalent();\r\n}", "public void loadPDF(URL url) throws IOException {\n loadPDF(new BufferedInputStream(url.openConnection().getInputStream()));\n }", "public boolean isFontSet() { return false; }", "public void createFont()\n {\n my_font = new Font(\"Helvetica\", Font.BOLD, (int) (getWidth() * FONT_SIZE));\n }", "FONT createFONT();", "@Override\r\n\tpublic void onCreateResources(\r\n\t\t\tOnCreateResourcesCallback pOnCreateResourcesCallback)\r\n\t\t\tthrows Exception {\r\n\t\t\r\n\t\t// Load our fonts.\r\n\t\tResourceManager.getInstance().loadFonts(mEngine, getAssets());\r\n\r\n\t\t\r\n\t\tpOnCreateResourcesCallback.onCreateResourcesFinished();\r\n\t}", "private static void buildFonts() {\r\n fontSMALL = new Font( strDEFAULT_TYPEFACE, Font.BOLD, FONT_SIZE_SM );\r\n fontMEDIUM = new Font( strDEFAULT_TYPEFACE, Font.BOLD, FONT_SIZE_MD );\r\n fontLARGE = new Font( strDEFAULT_TYPEFACE, Font.BOLD, FONT_SIZE_LG );\r\n }", "private SlickRenderFontLoaders() {\r\n super();\r\n }", "@Test\n @Config(minSdk = P)\n public void testInvalidCmapFont_unsortedEntries() {\n final String[] invalidCMAPFonts = {\n \"fonts/security/unsorted_cmap4.ttf\", \"fonts/security/unsorted_cmap12.ttf\"\n };\n for (final String file : invalidCMAPFonts) {\n final Typeface typeface = Typeface.createFromAsset(context.getAssets(), file);\n assertNotNull(typeface);\n final String testString = \"\\u0100\\u0400\";\n final float widthDefaultTypeface = measureText(testString, Typeface.DEFAULT);\n final float widthCustomTypeface = measureText(testString, typeface);\n assertEquals(widthDefaultTypeface, widthCustomTypeface, 0.0f);\n }\n\n // Following two font files have glyph for U+0400 U+FE00 and U+0100 U+FE00 but the fonts\n // must not be used due to invalid cmap data. For more details, see each ttx source file.\n final String[] invalidCMAPVSFonts = {\n \"fonts/security/unsorted_cmap14_default_uvs.ttf\",\n \"fonts/security/unsorted_cmap14_non_default_uvs.ttf\"\n };\n for (final String file : invalidCMAPVSFonts) {\n final Typeface typeface = Typeface.createFromAsset(context.getAssets(), file);\n assertNotNull(typeface);\n final String testString = \"\\u0100\\uFE00\\u0400\\uFE00\";\n final float widthDefaultTypeface = measureText(testString, Typeface.DEFAULT);\n final float widthCustomTypeface = measureText(testString, typeface);\n assertEquals(widthDefaultTypeface, widthCustomTypeface, 0.0f);\n }\n }", "public static Font getFont(String name) {\r\n\t\treturn (Font) getInstance().addResource(name);\r\n\t}", "public EpsFont(Font font) {\n\t\tthis(font,TYPE_POSTSCRIPT);\n\t}", "private FontBoxFont findFontBoxFont(String postScriptName) {\n/* 374 */ Type1Font t1 = (Type1Font)findFont(FontFormat.PFB, postScriptName);\n/* 375 */ if (t1 != null)\n/* */ {\n/* 377 */ return (FontBoxFont)t1;\n/* */ }\n/* */ \n/* 380 */ TrueTypeFont ttf = (TrueTypeFont)findFont(FontFormat.TTF, postScriptName);\n/* 381 */ if (ttf != null)\n/* */ {\n/* 383 */ return (FontBoxFont)ttf;\n/* */ }\n/* */ \n/* 386 */ OpenTypeFont otf = (OpenTypeFont)findFont(FontFormat.OTF, postScriptName);\n/* 387 */ if (otf != null)\n/* */ {\n/* 389 */ return (FontBoxFont)otf;\n/* */ }\n/* */ \n/* 392 */ return null;\n/* */ }", "public static Font createType1Font(Doc paramDoc, String paramString, boolean paramBoolean) throws PDFNetException {\n/* 432 */ return __Create(CreateType1Font(paramDoc.__GetHandle(), paramString, paramBoolean), paramDoc);\n/* */ }", "public void setFont( Font font ) {\r\n this.font = font;\r\n }", "public static Font getFont(String path, float size) {\n\t\tif (fonts.containsKey(path)) {\n\t\t\treturn fonts.get(path).deriveFont(size);\n\t\t}\n\t\ttry (InputStream is = Assets.class.getResourceAsStream(path)) {\n\t\t Hashtable<TextAttribute, Object> map = new Hashtable<TextAttribute, Object>();\n\t\t map.put(TextAttribute.KERNING, TextAttribute.KERNING_ON);\n\t\t map.put(TextAttribute.TRACKING, 0.08);\n\t\t map.put(TextAttribute.SIZE, size);\n\t\t\tif (is != null) {\n\t\t\t\tFont font = Font.createFont(Font.TRUETYPE_FONT, is).deriveFont(map);\n\t\t\t\tfonts.putIfAbsent(path, font);\n\t\t\t\treturn font;\n\t\t\t}\n\t\t} catch (IOException | FontFormatException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfonts.putIfAbsent(path, NO_FONT);\n\t\treturn NO_FONT.deriveFont(size);\n\t}", "public static Font createTrueTypeFont(Doc paramDoc, String paramString) throws PDFNetException {\n/* 188 */ return __Create(CreateTrueTypeFont(paramDoc.__GetHandle(), paramString, true, true), paramDoc);\n/* */ }", "public void setFont(int fontId){\n this.fontId = fontId;\n }", "public static Font createTrueTypeFont(Doc paramDoc, InputStream paramInputStream) throws PDFNetException {\n/* 205 */ return __Create(CreateTrueTypeFontFromStream(paramDoc.__GetHandle(), paramInputStream, true, true), paramDoc);\n/* */ }", "public void setFont(Font newFont) {\r\n\t\tfont = newFont;\r\n\t}", "private Font bloodBowlFont() throws FontFormatException, IOException {\r\n String fontFileName = \"/bloodbowl/resources/jblack.ttf\";\r\n return Font.createFont(Font.TRUETYPE_FONT, getClass().getResourceAsStream(fontFileName));\r\n }", "public org.openxmlformats.schemas.drawingml.x2006.main.CTTextFont addNewFont()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.openxmlformats.schemas.drawingml.x2006.main.CTTextFont target = null;\n target = (org.openxmlformats.schemas.drawingml.x2006.main.CTTextFont)get_store().add_element_user(FONT$0);\n return target;\n }\n }" ]
[ "0.6951542", "0.6751533", "0.65535104", "0.61729205", "0.60274494", "0.601433", "0.59896773", "0.5917287", "0.5882235", "0.5855622", "0.5721586", "0.56886196", "0.563814", "0.56031644", "0.5528659", "0.55218893", "0.5495313", "0.54741496", "0.5467593", "0.5457413", "0.54494965", "0.54215086", "0.54095954", "0.5408062", "0.53995335", "0.5371467", "0.5371132", "0.5347375", "0.53255445", "0.5316152", "0.53127867", "0.53026015", "0.5283089", "0.5273629", "0.52353513", "0.52235603", "0.52147985", "0.521238", "0.5208292", "0.519897", "0.5182518", "0.51802516", "0.5174831", "0.51719224", "0.516712", "0.5158398", "0.51439553", "0.5139832", "0.5123011", "0.5111607", "0.5111578", "0.51079434", "0.5095452", "0.5092398", "0.5085339", "0.5062158", "0.50567055", "0.5044308", "0.5026604", "0.501981", "0.50076914", "0.5001097", "0.4996771", "0.4996461", "0.49951446", "0.4992603", "0.49838394", "0.49802142", "0.4975351", "0.49743086", "0.49679455", "0.4966906", "0.4960007", "0.49354988", "0.49280608", "0.49210012", "0.4902904", "0.48872167", "0.48692304", "0.48539585", "0.48473716", "0.48454177", "0.48349485", "0.48286846", "0.48267218", "0.4823129", "0.48013464", "0.4799588", "0.4796504", "0.47920868", "0.47908506", "0.47901323", "0.47838303", "0.47824585", "0.477399", "0.47711226", "0.47629806", "0.4761119", "0.47587043", "0.47520962" ]
0.6427246
3
this method should be used to initialize variables instead of the constructor/class scope to avoid race conditions
protected void initVars() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void initVariables() {\n\t\t\r\n\t}", "protected void initialize() {\n\t\tright = left = throttle = turn = forward = 0;\n\t}", "private void init() {\n cloudAmount = null;\n cloudGenus = null;\n cloudAltitude = null;\n cloudDescription = null;\n }", "private void init() {\n }", "private void init() {\n\n\t}", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "private void initialize() {\n }", "protected void initialize() {\n \t\n }", "private void initialize() {\n\t\t\n\t}", "private void initialize() {\n\t}", "private void initialize()\r\n {\r\n this.workspace = null;\r\n this.currentUser = null;\r\n this.created = new Date();\r\n this.securityInfo = null;\r\n }", "protected void initialize() {}", "protected void initialize() {}", "private void initVars(){\n this.dice = new Dice();\n this.playing = true;\n this.currentPlayer = 0;\n this.turn = 0;\n this.xPlayers=new ArrayList<>(); \n this.players = new Player[4];\n this.diceRoller=true;\n this.xTokens=new ArrayList<>();\n this.winners=new ArrayList<>();\n this.computerPlayer= new Autoplay();\n this.gameResults = \"\";\n this.debug = false;\n }", "protected void init()\n {\n Timestamp now = new Timestamp(System.currentTimeMillis());\n timestampCreated = now;\n timestampModified = now;\n createdByAgent = AppContextMgr.getInstance() == null? null : (AppContextMgr.getInstance().hasContext() ? Agent.getUserAgent() : null);\n modifiedByAgent = null;\n }", "private void init() {\n\t\t\n\t\ttry{\t\t\t\n\t\t\tinfos = new HashMap<String, VariableInfo>();\n\t\t\t\n\t\t\tfor(String var : this.problem.getMyVars()){\n\t\t\t\t\n\t\t\t\tif(this.problem.getNbrNeighbors(var) != 0){ // an isolated variable doesn't need a CryptoScheme and therefore no VariableInfo either\n\t\t\t\t\t\n\t\t\t\t\tVariableInfo info = new VariableInfo(var);\n\t\t\t\t\tinfos.put(var, info);\n\t\t\t\t\t\n\t\t\t\t\tinfo.cs = cryptoConstr.newInstance(this.cryptoParameter);\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//initialize request counter for my own variables\n\t\t\trequestCount = new HashMap<String,Integer>(); \n\t\t\tfor(String var : this.problem.getMyVars()){\n\t\t\t\trequestCount.put(var, 0);\n\t\t\t}\n\t\t\t\n\t\t\tthis.started = true;\t\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t}", "public void initialize() {\n // empty for now\n }", "public void init() {\n\t\t}", "public void init() {\n \n }", "public void initialize() {\n\n // Calculate the average unit price.\n calculateAvgUnitPrice() ;\n\n // Calculate the realized profit/loss for this stock\n calculateRealizedProfit() ;\n\n this.itdValueCache = ScripITDValueCache.getInstance() ;\n this.eodValueCache = ScripEODValueCache.getInstance() ;\n }", "protected void init() {\n init(null);\n }", "private void _init() {\n }", "public void init() {\r\n\r\n\t}", "private void init() {\n\n\n\n }", "private void initialize() {\n first = null;\n last = null;\n size = 0;\n dictionary = new Hashtable();\n }", "protected void initialize() {\r\n }", "protected void initialize() {\r\n }", "protected void init() {\n\t}", "protected void init() {\n\t}", "protected void initialize() {\n\t\t\n\t}", "protected void initialize() {\n\t\t\n\t}", "protected void init() {\n }", "public void initialize()\n {\n }", "protected void initialize() {\n\t\tthis.position = Point3D.ZERO;\n\t\t// reset subclasses properties if any\n\t\treset();\n\t}", "@Override\r\n\tprotected void init() {\n\t\tupdateValues();\r\n\t}", "protected void initialize() {\n // Attribute Load\n this.attributeMap.clear();\n this.attributeMap.putAll(this.loadAttribute());\n // RuleUnique Load\n this.unique = this.loadRule();\n // Marker Load\n this.marker = this.loadMarker();\n // Reference Load\n this.reference = this.loadReference();\n }", "protected void init() {\n super.init();\n uriExpr = null;\n uri = null;\n nameExpr = null;\n name = null;\n qname = null;\n attrExpr = null;\n attr = null;\n emptyExpr = null;\n empty = false;\n }", "private void initValues() {\n \n }", "@Override\n\tpublic synchronized void init() {\n\t}", "protected void _init(){}", "public static void init() \r\n {\r\n currentTime = getTime(); \r\n lastTime = getTime(); \r\n }", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "@Override\r\n\tpublic final void init() {\r\n\r\n\t}", "protected void initialize() {\n\n\t}", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "public void init() {\n // These data structures are initialized here because other\n // module's startUp() might be called before ours\n this.systemStartTime = System.currentTimeMillis();\n }", "private void initData() {\n\t}", "protected void initialize() {\n \t\n \tstart_time = System.currentTimeMillis();\n \t\n \tgoal = start_time + duration;\n }", "public void init() {\n\t\t\n\t}", "public void initialize() {\r\n }", "protected void initialize()\r\n {\n }", "@Override\n protected void initialize() {\n m_oldTime = Timer.getFPGATimestamp();\n m_oldError= m_desiredDistance;\n }", "public static void init() {\n\t\t\n\t}", "private void init() {\n\t\tinitProtocol();\n\t\tinitResultStorage();\n\t}", "private void initiliaze() {\r\n\t\tthis.inputFile = cd.getInputFile();\r\n\t\tthis.flowcell = cd.getFlowcell();\r\n\t\tthis.totalNumberOfTicks = cd.getOptions().getTotalNumberOfTicks();\r\n\t\tthis.outputFile = cd.getOutputFile();\r\n\t\tthis.statistics = cd.getStatistic();\r\n\t}", "public void init() {\n\t\n\t}", "protected void initialize() {\n \tstartTime = System.currentTimeMillis();\n \tintake.setLeftPower(power);\n \tintake.setRightPower(power);\n }", "protected void initialize()\n\t{\n\t}", "private void initData() {\n }", "protected void initialize() {\n\t}", "public void init() {\n\t}", "public void init() {\n\t}", "public void init() {\n\t}", "public void initialize() {\n\t}", "public void initialize() {\n\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\n\t\tprotected void initialise() {\n\n\t\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void init() {}", "public void init() {}", "@Override\r\n\tpublic void init() { \r\n\t\t\r\n\t\tsession = -1;\r\n\t\t\r\n\t\tProgressDif = 0;\r\n\t\tnoisFact = 0;\r\n\t\tcompromiseFact = 0;\r\n\t\t\r\n\t\tcompromiseLearn = 20;\r\n\t\tprogressLearn = 10;\r\n\t\tnoisLearn = 0.2;\r\n\t\t\r\n\t\treservationPanic = 0.2;\r\n\t\tmyBids = new ArrayList<Pair<Bid,Double>>();\r\n\t\topponentBidsA = new Vector<ArrayList<Pair<Bid,Double>>>();\r\n\t\topponentBidsB = new Vector<ArrayList<Pair<Bid,Double>>>();\r\n\r\n\t\tdf = utilitySpace.getDiscountFactor();\r\n\t\tif (df==0) df = 1; \r\n\r\n\t\ttry {\r\n\t\t\tinitStates();\r\n\t\t} catch (Exception e) {\r\n \t\t\te.printStackTrace();\r\n\t\t}\t\t\r\n\t}", "public void init() {\n\r\n\t}", "public void init() {\n\r\n\t}", "private void initialize() {\n this.pm10Sensors = new ArrayList<>();\n this.tempSensors = new ArrayList<>();\n this.humidSensors = new ArrayList<>();\n }", "void initialise() {\n this.sleep = false;\n this.owner = this;\n renewNeighbourClusters();\n recalLocalModularity();\n }", "@Override\n protected void init() {\n }", "public void performInitialisation() {\n \t\t// subclasses can override the behaviour for this method\n \t}", "public final void initialize() {\n initialize(0);\n }" ]
[ "0.73910594", "0.7209957", "0.72055095", "0.7111951", "0.70437497", "0.70421916", "0.70421916", "0.70421916", "0.70421916", "0.70229316", "0.701307", "0.6984549", "0.6954564", "0.6950886", "0.6948665", "0.6948665", "0.69345117", "0.69307584", "0.69275635", "0.68945587", "0.685425", "0.68418646", "0.683359", "0.6831378", "0.6827715", "0.6818356", "0.68148506", "0.6766956", "0.6757441", "0.6757441", "0.6748099", "0.6748099", "0.6744178", "0.6744178", "0.6743477", "0.6743408", "0.67391294", "0.6732996", "0.673014", "0.672538", "0.67234194", "0.671147", "0.66984916", "0.6692675", "0.6690464", "0.6690464", "0.6690464", "0.6689693", "0.6687364", "0.6686302", "0.6686302", "0.6686302", "0.6686302", "0.6686302", "0.6686302", "0.6686302", "0.6686302", "0.6686302", "0.6686302", "0.6686302", "0.6686302", "0.6686302", "0.6686302", "0.6686302", "0.6686302", "0.6686302", "0.6686302", "0.6680279", "0.66582763", "0.66559994", "0.6655829", "0.66418445", "0.6637132", "0.66352445", "0.6634781", "0.6633255", "0.66293734", "0.66234916", "0.6623021", "0.66219574", "0.66200036", "0.6609373", "0.6606743", "0.6606743", "0.6606743", "0.6589946", "0.6589946", "0.65885895", "0.6580889", "0.6573603", "0.6566691", "0.6566691", "0.6562998", "0.65617144", "0.65617144", "0.6557291", "0.65570956", "0.65567523", "0.65552497", "0.65486974" ]
0.7903186
0
auth for MQTT such as EMQ:
@RequestMapping(value = "/mqtt/auth", method = { RequestMethod.POST, RequestMethod.GET }) public String auth4MQTT(HttpServletRequest request, HttpServletResponse response) { String r = new String(); Enumeration<String> params = request.getParameterNames(); String userName = request.getParameter("username"); String pwd = request.getParameter("password"); String clientid = request.getParameter("clientid"); // ACL access 方式,1: 发布 2:订阅 // 3:发布/订阅,可用于判断是否是acl校验,null表示是auth校验,非空时表示是acl校验 String access = request.getParameter("access"); String topic = request.getParameter("topic"); String ip = request.getParameter("ipaddr"); if (clientid != null) { if (userName != null) { // check user auth // .... // check silo self if (!offlineMsgService.checkAuthForSilo(userName, pwd)) { response.setStatus(HttpServletResponse.SC_FORBIDDEN); } } else { response.setStatus(HttpServletResponse.SC_FORBIDDEN); } } log.info("=======Mqtt auth clientId:{},user:{},access:{},topic:{},ip:{}========", clientid, userName, access, topic, ip); return r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void connectUsingToken() {\n\t\tString protocol = null;\n\t\tint port = getPortNumber();\n\t\tif (isWebSocket()) {\n\t\t\tprotocol = \"wss://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = WSS_PORT;\n\t\t\t}\n\t\t} else {\n\t\t\tprotocol = \"ssl://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = MQTTS_PORT;\n\t\t\t}\n\t\t} \n\n\t\tString mqttServer = getMQTTServer();\n\t\tif(mqttServer != null){\n\t\t\tserverURI = protocol + mqttServer + \":\" + port;\n\t\t} else {\n\t\t\tserverURI = protocol + getOrgId() + \".\" + MESSAGING + \".\" + this.getDomain() + \":\" + port;\n\t\t}\n\t\ttry {\n\t\t\tmqttAsyncClient = new MqttAsyncClient(serverURI, clientId, DATA_STORE);\n\t\t\tmqttAsyncClient.setCallback(mqttCallback);\n\t\t\tmqttClientOptions = new MqttConnectOptions();\n\t\t\tif (clientUsername != null) {\n\t\t\t\tmqttClientOptions.setUserName(clientUsername);\n\t\t\t}\n\t\t\tif (clientPassword != null) {\n\t\t\t\tmqttClientOptions.setPassword(clientPassword.toCharArray());\n\t\t\t}\n\t\t\tmqttClientOptions.setCleanSession(this.isCleanSession());\n\t\t\tif(this.keepAliveInterval != -1) {\n\t\t\t\tmqttClientOptions.setKeepAliveInterval(this.keepAliveInterval);\n\t\t\t}\n\t\t\tmqttClientOptions.setMaxInflight(getMaxInflight());\n\t\t\tmqttClientOptions.setAutomaticReconnect(isAutomaticReconnect());\n\t\t\t\n\t\t\tSSLContext sslContext = SSLContext.getInstance(\"TLSv1.2\");\n\n\t\t\tsslContext.init(null, null, null);\n\t\t\t\n\t\t\tmqttClientOptions.setSocketFactory(sslContext.getSocketFactory());\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void initMqtt(){\n\n MqttConnectOptions options = new MqttConnectOptions();\n options.setUserName(\"secureIoT\");\n options.setPassword(\"admin\".toCharArray());\n\n String clientId = MqttClient.generateClientId();\n mqttClient = new MqttAndroidClient(this.getApplicationContext(), \"tcp://m21.cloudmqtt.com:18188\", clientId);\n\n try {\n IMqttToken token = mqttClient.connect(options);\n token.setActionCallback(new IMqttActionListener() {\n @Override\n public void onSuccess(IMqttToken asyncActionToken) {\n Log.d(LOG_TAG, \"onSuccess\");\n // Subscribe for messages from server & device\n subscribeMqttTopic(\"/server/\" + deviceMac);\n subscribeMqttTopic(\"/device/\" + deviceMac);\n }\n\n @Override\n public void onFailure(IMqttToken asyncActionToken, Throwable exception) {\n // Something went wrong e.g. connection timeout or firewall problems\n Log.d(LOG_TAG, \"onFailure\");\n exception.printStackTrace();\n\n }\n });\n } catch (MqttException e) {\n e.printStackTrace();\n }\n }", "private void subscribeMqttTopic(String t){\n\n String topic = \"secureIoT\" + t;\n\n int qos = 1;\n try {\n IMqttToken subToken = mqttClient.subscribe(topic, qos);\n subToken.setActionCallback(new IMqttActionListener() {\n @Override\n public void onSuccess(IMqttToken asyncActionToken) {\n // subscription successful\n\n mqttClient.setCallback(new MqttCallback() {\n @Override\n public void connectionLost(Throwable cause) {\n Log.d(LOG_TAG, \"Connection Lost\");\n }\n\n @Override\n public void messageArrived(String topic, MqttMessage message) throws Exception {\n\n Log.d(LOG_TAG, message.toString());\n handleMessage(message);\n }\n\n @Override\n public void deliveryComplete(IMqttDeliveryToken token) {\n Log.d(LOG_TAG, \"Delivery Complete\");\n }\n });\n\n }\n\n @Override\n public void onFailure(IMqttToken asyncActionToken,\n Throwable exception) {\n // The subscription could not be performed, maybe the user was not\n // authorized to subscribe on the specified topic e.g. using wildcards\n }\n\n\n });\n } catch (MqttException e) {\n e.printStackTrace();\n }\n\n }", "java.lang.String getAuth();", "java.lang.String getAuth();", "java.lang.String getAuth();", "private void connectUsingCertificate() {\n\t\tfinal String METHOD = \"connectUsingCertificate\";\n\t\tString protocol = null;\n\t\tint port = getPortNumber();\n\t\tif (isWebSocket()) {\n\t\t\tprotocol = \"wss://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = WSS_PORT;\n\t\t\t}\n\t\t} else {\n\t\t\tprotocol = \"ssl://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = MQTTS_PORT;\n\t\t\t}\n\t\t} \n\n\t\tString mqttServer = getMQTTServer();\n\t\t\n\t\tif(mqttServer != null){\n\t\t\tserverURI = protocol + mqttServer + \":\" + port;\n\t\t} else {\n\t\t\tserverURI = protocol + getOrgId() + \".\" + MESSAGING + \".\" + this.getDomain() + \":\" + port;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tmqttAsyncClient = new MqttAsyncClient(serverURI, clientId, DATA_STORE);\n\t\t\tmqttAsyncClient.setCallback(mqttCallback);\n\t\t\tmqttClientOptions = new MqttConnectOptions();\n\t\t\tif (clientUsername != null) {\n\t\t\t\tmqttClientOptions.setUserName(clientUsername);\n\t\t\t}\n\t\t\tif (clientPassword != null) {\n\t\t\t\tmqttClientOptions.setPassword(clientPassword.toCharArray());\n\t\t\t}\n\t\t\tmqttClientOptions.setCleanSession(this.isCleanSession());\n\t\t\tif(this.keepAliveInterval != -1) {\n\t\t\t\tmqttClientOptions.setKeepAliveInterval(this.keepAliveInterval);\n\t\t\t}\n\t\t\t\n\t\t\tmqttClientOptions.setMaxInflight(getMaxInflight());\n\t\t\tmqttClientOptions.setAutomaticReconnect(isAutomaticReconnect());\n\t\t\t\n\t\t\t/* This isn't needed as the production messaging.internetofthings.ibmcloud.com \n\t\t\t * certificate should already be in trust chain.\n\t\t\t * \n\t\t\t * See: \n\t\t\t * http://stackoverflow.com/questions/859111/how-do-i-accept-a-self-signed-certificate-with-a-java-httpsurlconnection\n\t\t\t * https://gerrydevstory.com/2014/05/01/trusting-x509-base64-pem-ssl-certificate-in-java/\n\t\t\t * http://stackoverflow.com/questions/12501117/programmatically-obtain-keystore-from-pem\n\t\t\t * https://gist.github.com/sharonbn/4104301\n\t\t\t * \n\t\t\t * CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n\t\t\t * InputStream certFile = AbstractClient.class.getResourceAsStream(\"messaging.pem\");\n\t\t\t * Certificate ca = cf.generateCertificate(certFile);\n\t\t\t *\n\t\t\t * KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());\n\t\t\t * keyStore.load(null, null);\n\t\t\t * keyStore.setCertificateEntry(\"ca\", ca);\n\t\t\t * TrustManager trustManager = TrustManagerUtils.getDefaultTrustManager(keyStore);\n\t\t\t * SSLContext sslContext = SSLContextUtils.createSSLContext(\"TLSv1.2\", null, trustManager);\n\t\t\t * \n\t\t\t */\n\n\t\t\tSSLContext sslContext = SSLContext.getInstance(\"TLSv1.2\");\n\t\t\tsslContext.init(null, null, null);\n\t\t\t\n\t\t\t//Validate the availability of Server Certificate\n\t\t\t\n\t\t\tif (trimedValue(options.getProperty(\"Server-Certificate\")) != null){\n\t\t\t\tif (trimedValue(options.getProperty(\"Server-Certificate\")).contains(\".pem\")||trimedValue(options.getProperty(\"Server-Certificate\")).contains(\".der\")||trimedValue(options.getProperty(\"Server-Certificate\")).contains(\".cer\")){\n\t\t\t\t\tserverCert = trimedValue(options.getProperty(\"Server-Certificate\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Only PEM, DER & CER certificate formats are supported at this point of time\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Server Certificate is missing\");\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t//Validate the availability of Client Certificate\n\t\t\tif (trimedValue(options.getProperty(\"Client-Certificate\")) != null){\n\t\t\t\tif (trimedValue(options.getProperty(\"Client-Certificate\")).contains(\".pem\")||trimedValue(options.getProperty(\"Client-Certificate\")).contains(\".der\")||trimedValue(options.getProperty(\"Client-Certificate\")).contains(\".cer\")){\n\t\t\t\t\tclientCert = trimedValue(options.getProperty(\"Client-Certificate\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Only PEM, DER & CER certificate formats are supported at this point of time\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Client Certificate is missing\");\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t//Validate the availability of Client Certificate Key\n\t\t\tif (trimedValue(options.getProperty(\"Client-Key\")) != null){\n\t\t\t\tif (trimedValue(options.getProperty(\"Client-Key\")).contains(\".key\")){\n\t\t\t\t\tclientCertKey = trimedValue(options.getProperty(\"Client-Key\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Only Certificate key in .key format is supported at this point of time\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Client Key is missing\");\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t//Validate the availability of Certificate Password\n\t\t\ttry{\n\t\t\tif (trimedValue(options.getProperty(\"Certificate-Password\")) != null){\n\t\t\t\tcertPassword = trimedValue(options.getProperty(\"Certificate-Password\"));\n\t\t\t\t} else {\n\t\t\t\t\tcertPassword = \"\";\n\t\t\t\t}\n\t\t\t} catch (Exception e){\n\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Certificate Password is missing\", e);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t\n\t\t\tmqttClientOptions.setSocketFactory(getSocketFactory(serverCert, clientCert, clientCertKey, certPassword));\n\n\t\t} catch (Exception e) {\n\t\t\tLoggerUtility.warn(CLASS_NAME, METHOD, \"Unable to configure TLSv1.2 connection: \" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void configureMqtt() {\n\t\tString protocol = null;\n\t\tint port = getPortNumber();\n\t\tif (isWebSocket()) {\n\t\t\tprotocol = \"ws://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = WS_PORT;\n\t\t\t}\n\t\t} else {\n\t\t\tprotocol = \"tcp://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = MQTT_PORT;\n\t\t\t}\n\t\t}\n\t\t\n\t\tString mqttServer = getMQTTServer();\n\t\tif(mqttServer != null){\n\t\t\tserverURI = protocol + mqttServer + \":\" + port;\n\t\t} else {\n\t\t\tserverURI = protocol + getOrgId() + \".\" + MESSAGING + \".\" + this.getDomain() + \":\" + port;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tpersistence = new MemoryPersistence();\n\t\t\tmqttAsyncClient = new MqttAsyncClient(serverURI, clientId, persistence);\n\t\t\tmqttAsyncClient.setCallback(mqttCallback);\n\t\t\tmqttClientOptions = new MqttConnectOptions();\n\t\t\tif (clientUsername != null) {\n\t\t\t\tmqttClientOptions.setUserName(clientUsername);\n\t\t\t}\n\t\t\tif (clientPassword != null) {\n\t\t\t\tmqttClientOptions.setPassword(clientPassword.toCharArray());\n\t\t\t}\n\t\t\tmqttClientOptions.setCleanSession(this.isCleanSession());\n\t\t\tif(this.keepAliveInterval != -1) {\n\t\t\t\tmqttClientOptions.setKeepAliveInterval(this.keepAliveInterval);\n\t\t\t}\n\t\t\tmqttClientOptions.setMaxInflight(getMaxInflight());\n\t\t} catch (MqttException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "interface Auth extends RconConnectionEvent, Cancellable {}", "private void getAUTH_REQUEST() throws Exception {\n\t\t\n\t\tboolean status = true;\n\t\tboolean status2 = false;\n\t\tString msg = \"\";\n\t\t\n\t\t//File filePK = new File(\"identity\");\n\t\n\t\ttry {\n\t\t\t\n\t\t\tmsg = br.readLine();\n\t\t\tGetTimestamp(\"Received Authorization Request from Client: \" + msg);\n\t\t\t\n\t\t\tJSONObject REQUEST = (JSONObject) parser.parse(msg);\n\t String identity = REQUEST.get(\"identity\").toString();\n\t\t\t\n\t\t\t\n\t if((identity.contains(\"aaron@krusty\"))) {\n\n\t \tGetTimestamp(\"Authorization Request from Client is approved: \");\n\n\t \tGetTimestamp(\"Client Publickey is stored: \" ) ;\n\n\t \tString tosend = encrypt1(getSharedKey(), getClientPublicKey());\n\n\t \tGetTimestamp(\"Server sharedkey is being encrypted with Client's publickey to be sent: \") ;\n\n\t \tJSONObject RESPONSE = new JSONObject();\n\t \tRESPONSE.put(\"command\",\"AUTH_RESPONSE\");\n\t \tRESPONSE.put(\"AES128\", tosend);\n\t \tRESPONSE.put(\"status\", status);\n\t \tRESPONSE.put(\"message\", \"public key found\");\n\n\t \tStringWriter out = new StringWriter();\n\t \tRESPONSE.writeJSONString(out);\n\n\t \tString AUTH_RESPONSE = out.toString();\n\t \tSystem.out.println(AUTH_RESPONSE);\n\n\t \tGetTimestamp(\"Sending Authorization Response to Client: \");\n\n\t \tpw.println(AUTH_RESPONSE);\n\t \tpw.flush();\n\n\n\n\t }\n\t else {\n\n\t \tSystem.out.println(\"Client \" + REQUEST.get(\"identity\") + \" has been rejected\");\n\n\t \tJSONObject RESPONSE = new JSONObject();\n\t \tRESPONSE.put(\"command\",\"AUTH_RESPONSE\");\n\t \tRESPONSE.put(\"status\", status2);\n\t \tRESPONSE.put(\"message\", \"public key not found\");\n\n\t \tStringWriter out = new StringWriter();\n\t \tRESPONSE.writeJSONString(out);\n\n\t \tString AUTH_RESPONSE = out.toString();\n\t \tSystem.out.println(AUTH_RESPONSE);\n\n\t \tpw.println(AUTH_RESPONSE);\n\t \tpw.flush();\n\n\t \tcloseConnection();\n\t }\n\t\t\t\t\n\t\t\t\n\t\t} catch (IOException ex) {\n\t\t\tLogger.getLogger(ServerTCP.class.getName()).log(Level.SEVERE, null, ex);\n\t\t}\n\t\tif (msg.equalsIgnoreCase(\"bye\")) {\n\t\t\tSystem.out.println(\"Client has signed out!\");\n\t\t\tcloseConnection();\n\n\t\t} else {\t\n\t\t\tgetMessage();\n\t\t}\n\t}", "default void authByKeys(ActiveMQSslConnectionFactory factory, Broker broker) {\n try {\n factory.setKeyStore(String.format(\"file:///%s\", broker.getKeystorePath()));\n // Password of the private key\n factory.setKeyStoreKeyPassword(broker.getKeystoreKeyPassword());\n // password of the keystore\n factory.setKeyStorePassword(broker.getKeystorePassword());\n // set the truststore jks file\n factory.setTrustStore(String.format(\"file:///%s\", broker.getTruststorePath()));\n // set the truststore password\n factory.setTrustStorePassword(broker.getTruststorePassword());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) throws MqttException, InterruptedException {\n\r\n\r\n\t client = new MqttClient(\"tcp://test.mosquitto.org:1883\",\"F0B5D1A4A5040004\",persistence);\r\n\t MqttConnectOptions mqOptions=new MqttConnectOptions();\r\n\t mqOptions.setCleanSession(true);\r\n\t client.connect(mqOptions);\r\n\t //client.subscribe(\"sensor/1\"); //subscribing to the topic name test/topic\r\n\t \r\n\t MqttMessage message = new MqttMessage(\"2\".getBytes());\r\n\t message.setQos(1);\r\n\t while(true) {\r\n\t client.publish(\"sensor\",message);\r\n\t Thread.sleep(1000);\r\n\t }\r\n \r\n\t}", "@Override\n public void onSuccess(IMqttToken asyncActionToken) {\n String topic = uniqueId+\"/\"+chipid+\"/addCommand\";\n int qos = 1;\n try {\n IMqttToken subToken = client.subscribe(topic, qos);\n subToken.setActionCallback(new IMqttActionListener() {\n @Override\n public void onSuccess(IMqttToken asyncActionToken) {\n MqttCallback mqttCallback = new MqttCallback() {\n\n @Override\n public void connectionLost(Throwable cause) {\n //COMMAND FAIL\n imgCommandPopup.setVisibility(View.INVISIBLE);\n textWaiting.setVisibility(View.INVISIBLE);\n // failed.setVisibility(View.VISIBLE);\n // commandStatus(textCommandPopup,getResources().getString(R.string.command_add_failed),fadePopup,CommandPopup);\n }\n\n @Override\n public void messageArrived(String topic, MqttMessage message) throws Exception {\n espResponse = message.toString();\n // Toast.makeText(TempCom.this, espResponse, Toast.LENGTH_SHORT).show();\n client.disconnect();\n }\n\n @Override\n public void deliveryComplete(IMqttDeliveryToken token) {}\n };\n client.setCallback(mqttCallback);\n }\n\n @Override\n public void onFailure(IMqttToken asyncActionToken, Throwable exception) {\n //COMMAND FAIL\n imgCommandPopup.setVisibility(View.INVISIBLE);\n textWaiting.setVisibility(View.INVISIBLE);\n failed.setVisibility(View.VISIBLE);\n commandStatus(textCommandPopup,getResources().getString(R.string.command_add_failed),fadePopup,CommandPopup);\n }\n });\n } catch (MqttException e) {\n e.printStackTrace();\n }\n }", "private void openDoor(String topic,String mess) {\n\t\tServerMqtt server = new ServerMqtt(topic,mess);\n\t//\tSystem.out.println(roomID+\"++++++++++++\"+payload);\n\t}", "boolean authNeeded();", "@SuppressWarnings(\"empty-statement\")\n public void runClient() {\n // setup MQTT Client\n String clientID = \"apto01\";\n String pass = \"1234\";\n connOpt = new MqttConnectOptions();\n\n connOpt.setCleanSession(true);\n connOpt.setKeepAliveInterval(30);\n connOpt.setUserName(\"isis2503\");\n connOpt.setPassword(pass.toCharArray());\n\n alertaLogic = new AlertLogic();\n\n // Connect to Broker\n try {\n myClient = new MqttClient(BROKER_URL, clientID);\n myClient.setCallback(this);\n myClient.connect(connOpt);\n } catch (MqttException e) {\n e.printStackTrace();\n System.exit(-1);\n }\n\n System.out.println(\"Connected to \" + BROKER_URL);\n\n // setup topic\n // topics on m2m.io are in the form <domain>/<stuff>/<thing>\n // subscribe to topic if subscriber\n if (subscriber) {\n try {\n int subQoS = 0;\n myClient.subscribe(infoInoTopic, subQoS);\n } catch (MqttException e) {\n e.printStackTrace();\n }\n }\n // disconnect\n try {\n // wait to ensure subscribed messages are delivered\n while (subscriber);\n myClient.disconnect();\n } catch (MqttException e) {\n e.printStackTrace();\n }\n }", "private void respAuth() throws Exception {\n DataOutputStream dos = new DataOutputStream(os);\n dos.writeInt(1);\n dos.writeByte(Message.MSG_RESP_AUTH);\n if (haslogin) {\n dos.writeByte(Message.SUCCESS_AUTH);\n } else {\n dos.writeByte(Message.FAILED_AUTH);\n }\n }", "public void authenticate() {\n JSONObject jsonRequest = new JSONObject();\n try {\n jsonRequest.put(\"action\", \"authenticate\");\n jsonRequest.put(\"label\", \"label\");\n JSONObject dataObject = new JSONObject();\n dataObject.put(\"device_token\", CMAppGlobals.TOKEN);\n jsonRequest.put(\"data\", dataObject);\n\n if(CMAppGlobals.DEBUG) Logger.i(TAG, \":: AuthWsManager.authenticate : jsonRequest : \" + jsonRequest);\n\n // send JSON data\n WSManager.getInstance().con(mContext).sendJSONData(jsonRequest);\n\n\n } catch (JSONException e) {\n\n mContext.onWsFailure(e);\n }\n\n }", "private void setupMqttEndpoint() {\n\n this.mqttEndpoint\n .publishHandler(this::publishHandler)\n .publishAcknowledgeHandler(this::pubackHandler)\n .publishReleaseHandler(this::pubrelHandler)\n .publishReceivedHandler(this::pubrecHandler)\n .publishCompletionHandler(this::pubcompHandler)\n .subscribeHandler(this::subscribeHandler)\n .unsubscribeHandler(this::unsubscribeHandler)\n .disconnectHandler(this::disconnectHandler)\n .closeHandler(this::closeHandler);\n }", "public boolean connectBroker(ConnectProperties connPro) throws MqttSecurityException, MqttException {\n\t\tString connStr = \"tcp://\" + connPro.getIpAddress() + \":\" + connPro.getPort();\r\n\t\tif ((mqtt != null) && (!connStr.equals(\r\n\t\t\t\tmqtt.getServerURI()) )) {\r\n\t\t\tmqtt = null;\r\n\t\t}\r\n\t\tif (mqtt == null) {\r\n\t\t\tMqttClientPersistence persistence = null;\r\n\t\t\tif (connPro.getUsePersistence().equals(\"1\")) {\r\n\t\t\t\tpersistence = new MqttDefaultFilePersistence(connPro.getDirectory());\r\n\t\t\t}\r\n\t\t\tmqtt = new MqttClient(connStr, connPro.getClientId(), persistence);\r\n\t\t\tmqtt.setCallback(this);\r\n\t\t\t// Carry the trace setting over to the new MqttClient object\r\n\t\t\tif (connPro.getTarcestart().equals(\"1\")) {\r\n\t\t\t\tSystem.out.println(\"start the trace.......\");\r\n\t\t\t\t// 启动trace\r\n\t\t\t\tstartTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\topts = new MqttConnectOptions();\r\n\t\topts.setCleanSession(connPro.getCleanSession().equals(\"1\"));\r\n\t\topts.setKeepAliveInterval(Integer.parseInt(connPro.getKeepAlive() == \"\" ? \"0\" : connPro.getKeepAlive()));\r\n\t\topts.setUserName(\"kapua-sys\");\r\n\t\topts.setPassword(\"kapua-password\".toCharArray());\r\n\r\n\t\t//System.out.println(\"test1:\"+opts.toString());\r\n\t\tif (connPro.getRetained().equals(\"1\")) {\r\n\t\t\topts.setWill(mqtt.getTopic(\"topic\"), connPro.getData().getBytes(),\r\n\t\t\t\t\tInteger.parseInt(connPro.getQos()), connPro.getRetained().equals(\"1\"));\r\n\t\t}\r\n\t\t//System.out.println(\"test2:\"+opts.toString());\r\n\t\tSystem.out.println(\"connPro:\" + connPro.toString());\r\n\t\ttry {\r\n\t\t\tmqtt.connect(opts);\r\n\t\t\tconnected=true;\r\n\t\t\treturn true;\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public void connect(int numberOfRetryAttempts) throws MqttException {\n\t\tfinal String METHOD = \"connect\";\n\t\t// return if its already connected\n\t\tif(mqttAsyncClient != null && mqttAsyncClient.isConnected()) {\n\t\t\tLoggerUtility.log(Level.WARNING, CLASS_NAME, METHOD, \"Client is already connected\");\n\t\t\treturn;\n\t\t}\n\t\tboolean tryAgain = true;\n\t\tint connectAttempts = 0;\n\t\t// clear the disconnect state when the user connects the client to Watson IoT Platform\n\t\tdisconnectRequested = false; \n\t\tString userCertificate = trimedValue(options.getProperty(\"Use-Secure-Certificate\"));\n\t\t\n\t\tif (getOrgId() == QUICK_START) {\n\t\t\tconfigureMqtt();\n\t\t}else if ((getOrgId() != QUICK_START) && (userCertificate != null && userCertificate.equalsIgnoreCase(\"True\"))){\n\t\t\t\tLoggerUtility.info(CLASS_NAME, METHOD, \"Initiating Certificate based authentication\");\n\t\t\t\tconnectUsingCertificate();\n\t\t\t\tif (isAutomaticReconnect()) {\n\t\t\t\t\tDisconnectedBufferOptions disconnectedOpts = new DisconnectedBufferOptions();\n\t\t\t\t\tdisconnectedOpts.setBufferEnabled(true);\n\t\t\t\t\tdisconnectedOpts.setBufferSize(getDisconnectedBufferSize());\n\t\t\t\t\tmqttAsyncClient.setBufferOpts(disconnectedOpts);\n\t\t\t\t}\n\t\t} else {\n\t\t\t\tLoggerUtility.info(CLASS_NAME, METHOD, \"Initiating Token based authentication\");\n\t\t\t\tconnectUsingToken();\n\t\t\tif (isAutomaticReconnect()) {\n\t\t\t\tDisconnectedBufferOptions disconnectedOpts = new DisconnectedBufferOptions();\n\t\t\t\tdisconnectedOpts.setBufferEnabled(true);\n\t\t\t\tdisconnectedOpts.setBufferSize(getDisconnectedBufferSize());\n\t\t\t\tmqttAsyncClient.setBufferOpts(disconnectedOpts);\n\t\t\t}\n\t\t}\n\t\t\n\t\twhile (tryAgain && disconnectRequested == false) {\n\t\t\tconnectAttempts++;\n\t\t\t\n\t\t\tLoggerUtility.info(CLASS_NAME, METHOD, \"Connecting client \"+ this.clientId + \" to \" + mqttAsyncClient.getServerURI() + \n\t\t\t\t\t\" (attempt #\" + connectAttempts + \")...\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tmqttAsyncClient.connect(mqttClientOptions).waitForCompletion(1000 * 60);\n\t\t\t} catch (MqttSecurityException e) {\n\t\t\t\tSystem.err.println(\"Looks like one or more connection parameters are wrong !!!\");\n\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Connecting to Watson IoT Platform failed - \" +\n\t\t\t\t\t\t\"one or more connection parameters are wrong !!!\", e);\n\t\t\t\tthrow e;\n\t\t\t\t\n\t\t\t} catch (MqttException e) {\n\t\t\t\tif(connectAttempts > numberOfRetryAttempts) {\n\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Connecting to Watson IoT Platform failed\", e);\n\t // We must give up as the host doesn't exist.\n\t throw e;\n\t }\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tif (mqttAsyncClient.isConnected()) {\n\t\t\t\tLoggerUtility.info(CLASS_NAME, METHOD, \"Successfully connected \"\n\t\t\t\t\t\t+ \"to the IBM Watson IoT Platform\");\n\t\t\t\t\n\t\t\t\tif (LoggerUtility.isLoggable(Level.FINEST)) {\n\t\t\t\t\tLoggerUtility.log(Level.FINEST, CLASS_NAME, METHOD, \n\t\t\t\t\t\t\t\" * Connection attempts: \" + connectAttempts);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttryAgain = false;\n\t\t\t} else {\n\t\t\t\twaitBeforeNextConnectAttempt(connectAttempts);\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void clientAuthenticate()\n throws HubIntegrationException {\n try {\n final ArrayList<String> segments = new ArrayList<>();\n segments.add(\"j_spring_security_check\");\n final HttpUrl httpUrl = createHttpUrl(segments, null);\n\n final Map<String, String> content = new HashMap<>();\n final String username = hubServerConfig.getGlobalCredentials().getUsername();\n String password = hubServerConfig.getGlobalCredentials().getEncryptedPassword();\n if (StringUtils.isNotBlank(username) && StringUtils.isNotBlank(password)) {\n try {\n password = hubServerConfig.getGlobalCredentials().getDecryptedPassword();\n\n content.put(\"j_username\", username);\n content.put(\"j_password\", password);\n final Request request = createPostRequest(httpUrl, createEncodedRequestBody(content));\n Response response = null;\n try {\n logRequestHeaders(request);\n response = getClient().newCall(request).execute();\n logResponseHeaders(response);\n if (!response.isSuccessful()) {\n throw new HubIntegrationException(response.message());\n }\n } finally {\n if (response != null) {\n response.close();\n }\n }\n } catch (IllegalArgumentException | EncryptionException e) {\n throw new HubIntegrationException(e.getMessage(), e);\n }\n }\n } catch (final IOException e) {\n throw new HubIntegrationException(e.getMessage(), e);\n }\n }", "boolean authQop() {\n/* 114 */ return this.serverQop;\n/* */ }", "public void logon() throws IOException, GeneralSecurityException {\n String line;\n char response;\n\n if (state != State.CONNECTED) {\n connect();\n }\n\n socketOut.write('0');\n socketOut.flush();\n socketOut.write(VERSION.getBytes());\n socketOut.write('\\n');\n socketOut.write(GETCOMMAND.getBytes());\n socketOut.write('\\n');\n socketOut.write(USERNAME.getBytes());\n socketOut.write(username.getBytes());\n socketOut.write('\\n');\n socketOut.write(PASSPHRASE.getBytes());\n socketOut.write(new String(passphrase).getBytes());\n socketOut.write('\\n');\n socketOut.write(LIFETIME.getBytes());\n socketOut.write(Integer.toString(lifetime).getBytes());\n socketOut.write('\\n');\n if (credname != null) {\n socketOut.write(CREDNAME.getBytes());\n socketOut.write(credname.getBytes());\n socketOut.write('\\n');\n }\n socketOut.flush();\n\n line = readLine(socketIn);\n if (line == null) {\n throw new EOFException();\n }\n if (!line.equals(VERSION)) {\n throw new ProtocolException(\"bad MyProxy protocol VERSION string: \"\n + line);\n }\n line = readLine(socketIn);\n if (line == null) {\n throw new EOFException();\n }\n if (!line.startsWith(RESPONSE)\n || line.length() != RESPONSE.length() + 1) {\n throw new ProtocolException(\n \"bad MyProxy protocol RESPONSE string: \" + line);\n }\n response = line.charAt(RESPONSE.length());\n if (response == '1') {\n StringBuffer errString;\n\n errString = new StringBuffer(\"MyProxy logon failed\");\n while ((line = readLine(socketIn)) != null) {\n if (line.startsWith(ERROR)) {\n errString.append('\\n');\n errString.append(line.substring(ERROR.length()));\n }\n }\n throw new FailedLoginException(errString.toString());\n } else if (response == '2') {\n throw new ProtocolException(\n \"MyProxy authorization RESPONSE not implemented\");\n } else if (response != '0') {\n throw new ProtocolException(\n \"unknown MyProxy protocol RESPONSE string: \" + line);\n }\n while ((line = readLine(socketIn)) != null) {\n if (line.startsWith(TRUSTROOTS)) {\n String filenameList = line.substring(TRUSTROOTS.length());\n trustrootFilenames = filenameList.split(\",\");\n trustrootData = new String[trustrootFilenames.length];\n for (int i = 0; i < trustrootFilenames.length; i++) {\n String lineStart = \"FILEDATA_\" + trustrootFilenames[i]\n + \"=\";\n line = readLine(socketIn);\n if (line == null) {\n throw new EOFException();\n }\n if (!line.startsWith(lineStart)) {\n throw new ProtocolException(\n \"bad MyProxy protocol RESPONSE: expecting \"\n + lineStart + \" but received \" + line);\n }\n trustrootData[i] = new String(Base64.decode(line\n .substring(lineStart.length())));\n }\n }\n }\n state = State.LOGGEDON;\n }", "public Reply login(String hostname) throws ThingsException, InterruptedException;", "public void login(){\n JSONObject clientInfo = new JSONObject();\n try{\n clientInfo.put(\"username\", mUsername);\n clientInfo.put(\"password\", mPassword);\n clientInfo.put(\"deviceID\", getDeviceID());\n clientInfo.put(\"ipAddress\", getClientIP());\n mSocket.emit(\"login\", clientInfo);\n }catch(JSONException ex){\n throw new RuntimeException(ex);\n }\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate synchronized boolean auth(Connection con, JsonObject receivedMSG) throws NullPointerException {\n\t\tJSONObject auth = new JSONObject();\n\t\tString command;\n\t\tString info;\n\n\t\t// If already authenticated then reply with invalid message\n\t\tif (broadConnections.contains(con)) {\n\t\t\tInvalidMessage response = new InvalidMessage();\n\t\t\tresponse.setInfo(\"Already authenticated in this server\");\n\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\treturn true;\n\t\t}\n\t\t// Check if provided secret matches the setting\n\t\tString secret = receivedMSG.get(\"secret\").getAsString();\n\t\tif (!secret.equals(Settings.getSecret())) {\n\t\t\tcommand = AUTHENTICATION_FAIL;\n\t\t\t// String authFailMSG = toJsonString();\n\t\t\tinfo = \"the supplied secret is incorrect: \" + secret;\n\t\t\tauth.put(\"command\", command);\n\t\t\tauth.put(\"info\", info);\n\t\t\tcon.writeMsg(auth.toJSONString());\n\t\t\treturn false;\n\t\t}\n\t\tbroadConnections.add(con);\n\t\treturn true;\n\t}", "public AuthClient(String protocol, String host, Integer port, String context) {\n\t\tthis.protocol = protocol;\n\t\tthis.host = host;\n\t\tthis.port = port;\n\t\tthis.context = context;\n\t}", "ConnectionResult connect(String topicName, String accessToken);", "protected void connect() {\n\t\treadProperties();\n\t\tif (validateProperties())\n\t\t\tjuraMqttClient = createClient();\n\t}", "public FuzzerAuthString(){\r\n\t\tusername = \"\";\r\n\t\tpassword = \"\";\r\n\t}", "@Override\n public void onConnectionReceived(Connection connection, byte[] data) {\n String command = new String(data).trim();\n System.err.println(command);\n switch (command) {\n case \"\":\n break;\n case \"hello\":\n try {\n send(connection, (\"hello my friend \" + connection.getPid().id + \"\\r\\n\").getBytes());\n } catch (Exception e) {\n System.err.println(command + \" ERROR\");\n }\n break;\n case \"close\":\n try {\n send(connection, (\"goodbye my friend \" + connection.getPid().id + \"\\r\\n\").getBytes());\n terminate(connection);\n } catch (Exception e) {\n System.err.println(command + \" ERROR\");\n }\n break;\n case \"reg\":\n try {\n ClientInfo clientInfo = new ClientInfo(\"mqtt\", \"3.1\", \"testCID\", \"testUname\", \"testMP/\", 300);\n register(connection, clientInfo);\n System.err.println(ClientInfo.toErlangDataType(clientInfo));\n } catch (Exception e) {\n System.err.println(command + \" ERROR\");\n }\n break;\n case \"pub\":\n try {\n Message message =\n new Message(\"testId\", 0, \"from\", \"mytopic\", \"pubmessage\".getBytes(), new BigInteger(\"\" + System.currentTimeMillis()));\n publish(connection, message);\n send(connection, (\"publish \" + message.toString()).getBytes());\n } catch (Exception e) {\n System.err.println(command + \" ERROR\");\n }\n break;\n case \"sub\":\n try {\n String topic = \"mytopic\";\n subscribe(connection, topic, 1);\n System.err.println(\"subscribe \" + topic);\n send(connection, (\"subscribe \" + topic + \" qos \" + 1).getBytes());\n } catch (Exception e) {\n System.err.println(command + \" ERROR\");\n }\n break;\n case \"unsub\":\n try {\n String unSubTop = \"mytopic\";\n unsubscribe(connection, unSubTop);\n System.err.println(\"subscribe \" + unSubTop);\n send(connection, (\"unsubscribe \" + unSubTop).getBytes());\n } catch (Exception e) {\n System.err.println(command + \" ERROR\");\n }\n case \"help\":\n try {\n send(connection, help.getBytes());\n } catch (Exception e) {\n System.err.println(command + \" ERROR\");\n }\n break;\n default:\n try {\n send(connection, (\"i don't know \" + command + \"\\r\\n\").getBytes());\n } catch (Exception e) {\n System.err.println(command + \" ERROR\");\n }\n break;\n }\n\n }", "@Override\n\tprotected void setup() {\n\t\t{\n\t\t\tKeyPairGenerator kpg = null;\n\t\t\ttry {\n\t\t\t\tkpg = KeyPairGenerator.getInstance(\"RSA\");\n\t\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\t\te.printStackTrace(); // There is such an algorithm\n\t\t\t}\n\t\t\tkpg.initialize(GlobalPreferences.getKeysize(), new SecureRandom());\n\t\t\tkeys = kpg.genKeyPair();\n\t\t\t\n\t\t\tMLoginInitiate loginInitiate = new MLoginInitiate(keys.getPublic());\n\t\t\tputMessage(loginInitiate);\n\t\t}\n\t\t\n\t\twhile(!loginCompleted)\n\t\t{\n\t\t\ttry {\n\t\t\t\tThread.sleep(50); // Wait a bit for response\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tputMessage(new MLoginCompleted(loginSuccess, -2, \"admin\", \"admin\", false));\n\t}", "private synchronized void doConnect() {\n try {\n String host = agent.getHost();\n int port = agent.getPort();\n log.fine(\"Connecting to server \" + host + ':' + port);\n socket = new Socket(host, port);\n input = socket.getInputStream();\n output = new OutputStreamWriter(socket.getOutputStream());\n disconnected = false;\n new Thread(this).start();\n\n // Automatically login! -> give an auth to the agent...\n TACMessage msg = new TACMessage(\"auth\");\n msg.setParameter(\"userName\", agent.getUser());\n msg.setParameter(\"userPW\", agent.getPassword());\n msg.setMessageReceiver(agent);\n sendMessage(msg);\n\n } catch (Exception e) {\n disconnected = true;\n log.log(Level.SEVERE, \"connection to server failed:\", e);\n socket = null;\n }\n }", "public static void main(String[] args) throws MqttSecurityException, MqttException, InterruptedException,\n\t\t\tKeyManagementException, NoSuchAlgorithmException, KeyStoreException {\n\t\ttry {\n\t\t\tjas=new JsonAnalysis();\n\t\t\tjas.getInfo();\n\t\t\tMqttConfigInfo config = tidyMqttConfig();\n\t\t\tMqttConnectOptions options = tidyMqttOptions(config);\n\t\t\tMqttsClientCallback callback = new MqttsClientCallback();\n\t\t\tMqttClient client = createMqttClient(MqttClient.generateClientId(), callback, config, options);\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"mqtts error 0!\");\n\t\t}\n\t}", "public static void main(String[] args) throws MqttException, InterruptedException {\n Random random = new Random();\n\n // Random temperature\n int temperature;\n\n // Cold, Nice or Hot\n String weather;\n\n // pittsburgh/temperature/coldTemps || pittsburgh/temperature/niceTemps || pittsburgh/temperature/hotTemps\n String topic = \"\";\n\n // Use local mosquitto\n String broker = \"tcp://localhost:1883\";\n\n // clientId used when visit the broker\n String clientId = \"TemperatureSensor\";\n\n // MemoryPersistence sets how the clientid is saved, the default is in memory.\n MemoryPersistence persistence = new MemoryPersistence();\n\n // Create client\n MqttClient client = new MqttClient(broker, clientId, persistence);\n\n // Create connection parameters\n MqttConnectOptions mqtt = new MqttConnectOptions();\n\n // Forget status on reboot and reconnection\n mqtt.setCleanSession(true);\n\n System.out.println(\"Connecting to broker: \"+broker);\n client.connect(mqtt);\n System.out.println(\"Connected\");\n\n while (true) {\n // random number\n temperature = (int)(random.nextDouble()*100);\n\n if (temperature >= 0 && temperature <= 45) {\n topic = \"pittsburgh/temperature/coldTemps\";\n weather = \"cold\";\n } else if (temperature > 45 && temperature <= 80) {\n topic = \"pittsburgh/temperature/niceTemps\";\n weather = \"nice\";\n } else {\n topic = \"pittsburgh/temperature/hotTemps\";\n weather = \"hot\";\n }\n\n // record timestamp\n long time = System.currentTimeMillis();\n String timeStamp = new Date(time).toString();\n\n // transfer message into json format\n String information = \"{\\\"temperature\\\": \\\"\" + temperature + \"\\\", \\\"time\\\": \\\"\" + timeStamp + \"\\\"}\";\n\n // output\n System.out.println(\"Sending a \" + weather + \" temp message to topic \" + topic);\n\n // transfer json into binary byte\n MqttMessage message = new MqttMessage(information.getBytes());\n\n // send message in QoS of 1\n message.setQos(1);\n\n System.out.println(\"Publishing message: It is \" + weather +\" out \" + temperature +\"Farenhite degrees at time: \" + timeStamp);\n //publish the information into MQTT broker\n client.publish(topic, message);\n System.out.println(\"Message published\");\n //send message 5 seconds per time\n Thread.sleep(5000);\n }\n }", "public void TC_04_Authentication_Alert() {\n\n\t\tdriver.get(\"http://admin:[email protected]/basic_auth\");\n\t}", "@Override\n public void authPacketArrived(int reasonCode, MqttProperties properties) {\n log.warning(() -> \"MQTT auth packet arrived: reasonCode=\" + reasonCode + \" properties=\" + properties);\n }", "RedisManager authenticate(AzureTokenCredentials credentials, String subscriptionId);", "public void connect() throws OOBException {\n \t\tlog.debug(\"enter to connect \");\n \t\tJSch jsch = new JSch();\n \t\ttry {\n\t\t\tjsch.addIdentity(PRIVATE_KEY, PASSPHRASE);\n \t\t\tjsch.setKnownHosts(KNOWN_HOSTS);\n \t\t\tlog.debug(\"user \" + user + \"host : \" + host);\n \t\t\tsession = jsch.getSession(user, host, 22);\n \t\t\tsession.connect();\n \t\t} catch (JSchException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}", "public void authenticate(View view) {\n String value = makeXor(xorNum.getBytes(), key.getBytes());\n\n if(socket.isConnected()){\n try {\n socket.getOutputStream().write(value.getBytes());\n socket.getOutputStream().flush();\n Toast.makeText(ControlActivity.this, \"Message Sent\", Toast.LENGTH_SHORT).show();\n } catch (IOException e) {\n e.printStackTrace();\n Toast.makeText(ControlActivity.this, \"Error in sending message\", Toast.LENGTH_SHORT).show();\n }\n }else{\n Toast.makeText(ControlActivity.this, \"Bluetooth connection lost!\", Toast.LENGTH_SHORT).show();\n }\n\n\n }", "public interface AuthManager\n{\n void checkAuthAnnounce(Id<Node> nodeId, DynamicAnnouncement announcement, HttpServletRequest request);\n\n void checkAuthDelete(Id<Node> nodeId, HttpServletRequest request);\n\n void checkAuthReplicate(HttpServletRequest request);\n}", "protected String plainPasswordAuth(Map<String, Object> authMap) {\r\n \tString fullIdentifier = CommonUtil.castAsString(authMap.get(StreamPacketDef.AUTH_IDENTIFIER));\r\n\t\tString clientHost = CommonUtil.castAsString(authMap.get(StreamPacketDef.AUTH_TOKEN));\r\n\t\t\r\n\t\tif(CommonUtil.isEmpty(fullIdentifier) || CommonUtil.isEmpty(clientHost)) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\treturn fullIdentifier;\r\n\t}", "public void sendAuthPackge() throws IOException {\n // 生成认证数据\n byte[] rand1 = RandomUtil.randomBytes(8);\n byte[] rand2 = RandomUtil.randomBytes(12);\n\n // 保存认证数据\n byte[] seed = new byte[rand1.length + rand2.length];\n System.arraycopy(rand1, 0, seed, 0, rand1.length);\n System.arraycopy(rand2, 0, seed, rand1.length, rand2.length);\n this.seed = seed;\n\n // 发送握手数据包\n HandshakePacket hs = new HandshakePacket();\n hs.packetId = 0;\n hs.protocolVersion = Versions.PROTOCOL_VERSION;\n hs.serverVersion = Versions.SERVER_VERSION;\n hs.threadId = id;\n hs.seed = rand1;\n hs.serverCapabilities = getServerCapabilities();\n // hs.serverCharsetIndex = (byte) (charsetIndex & 0xff);\n hs.serverStatus = 2;\n hs.restOfScrambleBuff = rand2;\n hs.write(this);\n\n // asynread response\n // 这里阻塞了不好\n this.asynRead();\n }", "public void auth(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"AUTH\";\n\t\tAPI = \"bp10emu\";\n\t\tAMOUNT = params.get(\"amount\");\n\t\tif (params.containsKey(\"transactionID\")) {\n\t\t\tRRNO = params.get(\"transactionID\");\n\t\t}\n\t}", "private void subscribeToTopic(String topic) {\n try {\n mqttAndroidClient.subscribe(topic, 0, null, new IMqttActionListener() {\n @Override\n public void onSuccess(IMqttToken asyncActionToken) {\n Log.w(\"MQTT\",\"Subscribed!\");\n }\n\n @Override\n public void onFailure(IMqttToken asyncActionToken, Throwable exception) {\n Log.w(\"MQTT\", \"Subscribe fail!\");\n }\n });\n } catch (MqttException ex) {\n System.err.println(\"Exception whilst subscribing\");\n ex.printStackTrace();\n }\n }", "public void setAuth(int pAuth){\n this.auth = pAuth;\n }", "@Override\r\n\tpublic boolean connectTwitterService(String email, String password) throws RemoteException {\n\t\tSystem.out.println(\"connectTwitter print\");\r\n\t\tif(email.equals(email1)){\r\n\t\t\tif(password.equals(pass1)){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Override\n public void onCreate() {\n\n Log.v(TAG, \"called onCreate\");\n IntentFilter intentf = new IntentFilter();\n setClientID();\n intentf.addAction(ConnectivityManager.CONNECTIVITY_ACTION);\n registerReceiver(new MQTTBroadcastReceiver(), new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));\n mConnMan = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);\n }", "public void doConnect() {\n Debug.logInfo(\"Connecting to \" + client.getServerURI() + \" with device name[\" + client.getClientId() + \"]\", MODULE);\n\n IMqttActionListener conListener = new IMqttActionListener() {\n\n public void onSuccess(IMqttToken asyncActionToken) {\n Debug.logInfo(\"Connected.\", MODULE);\n state = CONNECTED;\n carryOn();\n }\n\n public void onFailure(IMqttToken asyncActionToken, Throwable exception) {\n ex = exception;\n state = ERROR;\n Debug.logError(\"connect failed\" + exception.getMessage(), MODULE);\n carryOn();\n }\n\n public void carryOn() {\n synchronized (caller) {\n donext = true;\n caller.notifyAll();\n }\n }\n };\n\n try {\n // Connect using a non-blocking connect\n client.connect(conOpt, \"Connect sample context\", conListener);\n } catch (MqttException e) {\n // If though it is a non-blocking connect an exception can be\n // thrown if validation of parms fails or other checks such\n // as already connected fail.\n state = ERROR;\n donext = true;\n ex = e;\n }\n }", "public void connect(boolean cleanSession, String topic, String message, int qos, boolean retained)\n\t\t\tthrows Exception {\n\t\tif (mqttClient == null) {\n\t\t\tthrow new Exception(\"Client is not created yet\");\n\t\t}\n\t\tif (connected == false) {\n\t\t\tmqttConnectOptions = new MqttConnectOptions();\n\t\t\tmqttConnectOptions.setCleanSession(cleanSession);\n\t\t\tmqttConnectOptions.setPassword(password.toCharArray());\n\t\t\tif (!topic.isEmpty()) {\n\t\t\t\tmqttConnectOptions.setWill(topic, message.getBytes(), qos, retained);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tmqttClient.connect(mqttConnectOptions);\n\t\t\t\tconnected = true;\n\t\t\t} catch (MqttException e) {\n\t\t\t\tthrow new Exception(\"Could not connect to server\", e);\n\t\t\t}\n\t\t}\n\n\t}", "public interface EcAuthService {\n\n /**\n * 接口信息鉴权\n * @param appKey appKey\n * @param appSecrect appSecrect\n * @param url 路径\n * @return 鉴权类信息\n */\n AuthResp auth(String appKey, String appSecrect, String url);\n}", "public boolean auth(boolean reauth) throws IOException {\r\n log.debug(\"auth Authentication method starts\");\r\n if(alreadyAuthorized && !reauth) {\r\n \tlog.debug(\"auth Already Authorized.\");\r\n \treturn true;\r\n }\r\n\r\n AuthCmdPayload sendPayload = new AuthCmdPayload();\r\n log.debug(\"auth Sending CmdPacket with AuthCmdPayload: cmd=\" + Integer.toHexString(sendPayload.getCommand())\r\n + \" len=\" + sendPayload.getPayload().getData().length);\r\n\r\n log.debug(\"auth AuthPayload initial bytes to send: {}\", DatatypeConverter.printHexBinary(sendPayload.getPayload().getData()));\r\n\r\n DatagramPacket recvPack = sendCmdPkt(10000, 2048, sendPayload);\r\n\r\n byte[] data = recvPack.getData();\r\n \r\n if(data.length <= 0) {\r\n log.error(\"auth Received 0 bytes on initial request.\");\r\n alreadyAuthorized = false;\r\n return false;\r\n }\r\n\r\n log.debug(\"auth recv encrypted data bytes (\" + data.length +\") after initial req: {}\", DatatypeConverter.printHexBinary(data));\r\n\r\n byte[] payload = null;\r\n try {\r\n log.debug(\"auth Decrypting encrypted data\");\r\n\r\n payload = decryptFromDeviceMessage(data);\r\n\r\n log.debug(\"auth Decrypted. len=\" + payload.length);\r\n\r\n } catch (Exception e) {\r\n log.error(\"auth Received datagram decryption error. Aborting method\", e);\r\n alreadyAuthorized = false;\r\n return false;\r\n }\r\n\r\n log.debug(\"auth Packet received payload bytes: \" + DatatypeConverter.printHexBinary(payload));\r\n\r\n key = subbytes(payload, 0x04, 0x14);\r\n\r\n log.debug(\"auth Packet received key bytes: \" + DatatypeConverter.printHexBinary(key));\r\n\r\n if (key.length % 16 != 0) {\r\n log.error(\"auth Received key len is not a multiple of 16! Aborting\");\r\n alreadyAuthorized = false;\r\n return false;\r\n }\r\n\r\n // recreate AES object with new key\r\n aes = new AES(iv, key);\r\n\r\n id = subbytes(payload, 0x00, 0x04);\r\n\r\n log.debug(\"auth Packet received id bytes: \" + DatatypeConverter.printHexBinary(id) + \" with ID len=\" + id.length);\r\n\r\n log.debug(\"auth End of authentication method\");\r\n alreadyAuthorized = true;\r\n\r\n return true;\r\n }", "private void verifyAuthWithServer() {\n mResetModel.connect(\n myBinding.editResetEmail.getText().toString());\n //This is an Asynchronous call. No statements after should rely on the\n //result of connect().\n }", "public static void main(String[] args) {\n int qos = 2;\n // using the tcp connection to the MQTT broker\n String broker = \"tcp://localhost:1883\";\n //Id for the client connected to MQTT broker\n String clientId = \"TemperaturePublisher\";\n MemoryPersistence persistence = new MemoryPersistence();\n try {\n // configure the client to the connect to MQTT broker\n MqttClient sampleClient = new MqttClient(broker, clientId, persistence);\n MqttConnectOptions connOpts = new MqttConnectOptions();\n connOpts.setCleanSession(true);\n System.out.println(\"Connecting to broker: \" + broker);\n // connecting to the MQTT broker\n sampleClient.connect(connOpts);\n System.out.println(\"Connected\");\n\n // Timer for 5 second timer\n Timer t = new Timer();\n t.schedule(new TimerTask() {\n @Override\n public void run() {\n //temperatures in the range of 0 to 100\n double range = 100 - 0;\n double scaled = random.nextDouble() * range;\n // to get the timestamp\n String timeStamp = \"{\\\"Timestamp\\\":\\\"\" + new SimpleDateFormat(\"yyyy.MM.dd.HH.mm.ss\").format(new Date()) + \"\\\", \"+ \"\\\"Temperature\\\":\";\n double shifted = scaled + 0;\n String topic;\n // to determine the range of temperatures and accordingly determine the topics to which they need to be sent\n if (shifted >= 0 && shifted <= 45) {\n topic = \"temperature/pittsburgh/coldTemps\";\n } else if (shifted > 45 && shifted <= 80) {\n topic = \"temperature/pittsburgh/niceTemps\";\n } else {\n topic = \"temperature/pittsburgh/hotTemps\";\n }\n String content = (Double.toString(Math.round(shifted*100.0)/100.0));\n content = timeStamp + \"\\\"\" + content + \"\\\"\" + \"}\";\n //create a new message \n MqttMessage message = new MqttMessage(content.getBytes());\n message.setQos(qos);\n try {\n // publish the message to the MQTT broker\n sampleClient.publish(topic, message);\n } // catching and printing the exception\n catch (MqttException me) {\n System.out.println(\"reason \" + me.getReasonCode());\n System.out.println(\"msg \" + me.getMessage());\n System.out.println(\"loc \" + me.getLocalizedMessage());\n System.out.println(\"cause \" + me.getCause());\n System.out.println(\"excep \" + me);\n me.printStackTrace();\n //Logger.getLogger(TemperatureSensor.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }, 0, 5000); // timer for 5000 milliseconds\n } // catching and printing the exception\n catch (MqttException me) {\n System.out.println(\"reason \" + me.getReasonCode());\n System.out.println(\"msg \" + me.getMessage());\n System.out.println(\"loc \" + me.getLocalizedMessage());\n System.out.println(\"cause \" + me.getCause());\n System.out.println(\"excep \" + me);\n me.printStackTrace();\n }\n }", "private void authenticate(String user, String pass) {\n }", "public ClientLoginService(){\n this(MessageConnection.CHANNEL_DEFAULT_RELIABLE);\n }", "String login(String string2, String string3) throws IOException {\n Protocol protocol = this;\n synchronized (protocol) {\n Response response;\n String string4 = this.apopChallenge;\n String string5 = null;\n if (string4 != null) {\n string5 = this.getDigest(string3);\n }\n if (this.apopChallenge != null && string5 != null) {\n response = this.simpleCommand(\"APOP \" + string2 + \" \" + string5);\n } else {\n Response response2 = this.simpleCommand(\"USER \" + string2);\n if (!response2.ok) {\n if (response2.data == null) return \"USER command failed\";\n return response2.data;\n }\n response = this.simpleCommand(\"PASS \" + string3);\n }\n if (response.ok) return null;\n if (response.data == null) return \"login failed\";\n return response.data;\n }\n }", "public void authentication() throws AuthorizationException {\n\t\tclient = new RennClient(API_KEY, SECRET_KEY);\n\t\tclient.authorizeWithClientCredentials();\n\t}", "private AppAuth() {\n }", "@Test\n\tpublic void testTwilioAuthentication() throws LiquidoException {\n\t\tString email = null;\n\t\tString mobilephone;\n\t\tlong userAuthyId;\n\n\t\t//----- create new user\n\t\ttry {\n\t\t\tlong rand5digits = System.currentTimeMillis() & 10000;\n\t\t\temail = \"userFromTest\" + rand5digits + \"@liquido.vote\";\n\t\t\tmobilephone = \"+49111\" + rand5digits;\n\t\t\tString countryCode = \"49\";\n\t\t\tuserAuthyId = client.createTwilioUser(email, mobilephone, countryCode);\n\t\t\tlog.info(\"Created new twilio user[mobilephone=\" + mobilephone + \", authyId=\" + userAuthyId + \"]\");\n\t\t} catch (RestClientException e) {\n\t\t\tlog.error(\"Cannot create twilio user \"+email, e.toString());\n\t\t\tthrow e;\n\t\t}\n\n\t\t//----- send authentication request (via push or SMS)\n\t\ttry {\n\t\t\tlog.debug(\"Send SMS or push notification to mobilephone=\"+mobilephone);\n\t\t\tString res = client.sendSmsOrPushNotification(userAuthyId);\n\t\t\tlog.debug(\" => \"+res);\n\t\t\tif (res.contains(\"ignored\")) {\n\t\t\t\tlog.info(\"Sent push authentication request to userAuthyId=\" + userAuthyId + \" Response:\\n\" + res);\n\t\t\t} else {\n\t\t\t\tlog.info(\"Sent Sms to userAuthyId=\" + userAuthyId + \" Response:\\n\" + res);\n\t\t\t}\n\t\t} catch (LiquidoException e) {\n\t\t\tlog.error(\"Cannot send SMS to twilio userAuthIy=\"+userAuthyId, e);\n\t\t\tthrow e;\n\t\t}\n\n\t\t//----- validate user's token (this cannot be automated.)\n\t\t//String otp = <otp that user entered from his mobile phone> ;\n\t\t//client.verifyOneTimePassword(userAuthyId, otp);\n\n\t\t//----- remove user\n\t\ttry {\n\t\t\tString res = client.removeUser(userAuthyId);\n\t\t\tlog.info(\"Removed user userAuthyId=\" + userAuthyId + \" Respone:\\n\" + res);\n\t\t} catch (RestClientException e) {\n\t\t\tlog.error(\"Cannot remove userAuthIy=\"+userAuthyId, e);\n\t\t\tthrow e;\n\t\t}\n\t}", "protected void onPart(String channel, String sender, String login, String hostname) {}", "public String getAuthToken() throws Exception {\n _log.info(\"3PARDriver:getAuthToken enter, after expiry\");\n String authToken = null;\n ClientResponse clientResp = null;\n String body= \"{\\\"user\\\":\\\"\" + _user + \"\\\", \\\"password\\\":\\\"\" + _password + \"\\\"}\";\n\n try {\n clientResp = _client.post_json(_baseUrl.resolve(URI_LOGIN), body);\n if (clientResp == null) {\n _log.error(\"3PARDriver:There is no response from 3PAR\");\n throw new HP3PARException(\"There is no response from 3PAR\");\n } else if (clientResp.getStatus() != 201) {\n String errResp = getResponseDetails(clientResp);\n throw new HP3PARException(errResp);\n } else {\n JSONObject jObj = clientResp.getEntity(JSONObject.class);\n authToken = jObj.getString(\"key\");\n }\n this._authToken = authToken;\n return authToken;\n } catch (Exception e) {\n throw e;\n } finally {\n if (clientResp != null) {\n clientResp.close();\n }\n _log.info(\"3PARDriver:getAuthToken leave, after expiry\");\n } //end try/catch/finally\n }", "public void setMqttService(MqttService mqttService) {\n this.mqttService = mqttService;\n }", "@Test\n public void addition_isCorrect() throws Exception {\n\n\n DeviceConfigIdentity identity = new DeviceConfigIdentity(\"bo5aph\",\"typedevice\",\"pidevice\");\n DeviceConfigAuth auth = new DeviceConfigAuth(\"123456789\");\n DeviceConfigOptions options = new DeviceConfigOptions();\n options.mqtt.port = 8883;\n options.mqtt.keepAlive = 1;\n DeviceConfig config = new DeviceConfig(identity, auth,options);\n DeviceClient deviceClient2 = new DeviceClient(config);\n deviceClient2.registerCodec(new JsonCodec());\n deviceClient2.connect();\n JsonObject data = new JsonObject();\n data.addProperty(\"mode\", \"manual\");\n data.addProperty(\"dir\", \"F\");\n data.addProperty(\"speed\", \"100\");\n deviceClient2.publishEvent(\"data\", data);\n\n deviceClient2.disconnect();\n }", "public AuthPacket()\n\t{\n\t\tuserID = \"\";\n\t\tpassword = \"\";\n\t\tstudentName = \"\";\n\t\tnew_password = \"\";\n\t\tchangePass = false;\n\t\tgrantAccess = false;\n\t\tstandard = -1;\n\t\terrorCode = -1;\n\t}", "@Test\n public void testOtp(){\n String secret = \"whatever is here is okay\";\n Totp totp = new Totp(secret);\n String now = totp.now();\n assertThat(totp.verify(now)).isEqualTo(true);\n }", "public static String getAuthorization() {\n\t\treturn getServer()+\"wsagenda/v1/agenda\";//\"http://10.0.2.2/wsrest/v1/agenda\";//\"http://10.0.2.2/prueba/ahorro/obtener_gastos.php\";//\"http://10.0.2.2/wsrest/v1/agenda\";\n\t}", "private byte[] handleAuthPt2(byte[] payload) { \n\t\tbyte[] message = ComMethods.decryptRSA(payload, my_n, my_d);\n\t\tComMethods.report(\"SecretServer has decrypted the User's message using SecretServer's private RSA key.\", simMode);\n\t\t\n\t\tif (!Arrays.equals(Arrays.copyOf(message, myNonce.length), myNonce)) {\n\t\t\tComMethods.report(\"ERROR ~ invalid third message in protocol.\", simMode);\n\t\t\treturn \"error\".getBytes();\n\t\t} else {\n\t\t\t// Authentication done!\n\t\t\tcurrentSessionKey = Arrays.copyOfRange(message, myNonce.length, message.length);\n\t\t\tactiveSession = true;\n\t\t\tcounter = 11;\n\n\t\t\t// use \"preparePayload\" from now on for all outgoing messages\n\t\t\tbyte[] responsePayload = preparePayload(\"understood\".getBytes());\n\t\t\tcounter = 13;\n\t\t\treturn responsePayload;\n\t\t} \n\t}", "@Override\n\tpublic void setup(Context context) {\n\t\tlog.debug(\"XXX: try callback to enable authentication\");\n\n final URI uri = context.getPropertyAsURI(\"loginURL\");\n if (uri == null) {\n\t\t\tthrow new IllegalArgumentException(\"loginURL property not defined\");\n }\n\n String loginEmail = context.getString(\"loginEmail\");\n String loginPassword = context.getString(\"loginPassword\");\n if (StringUtils.isBlank(loginEmail) || StringUtils.isBlank(loginPassword)) {\n\t\t\tthrow new IllegalArgumentException(\"loginEmail and loginPassword properties are empty or missing\");\n }\n\n\t\tlog.debug(\"POST auth URL: {}\", uri);\n\t\tHttpPost httppost = new HttpPost(uri);\n\t\thttppost.setHeader(\"Cache-Control\", \"no-cache\");\n\t\tList<NameValuePair> formParams = new ArrayList<NameValuePair>(2);\n\t\tformParams.add(new BasicNameValuePair(\"email\", loginEmail));\n\t\tformParams.add(new BasicNameValuePair(\"id\", loginPassword));\n\t\tfinal HttpResponse response;\n\t\tHttpClient client = null;\n\t\tHttpContext httpContext = localContext;\n\t\ttry {\n\t\t\thttppost.setEntity(new UrlEncodedFormEntity(formParams));\n\t\t\tclient = context.getHttpClient();\n\t\t\tif (httpContext == null) {\n\t\t\t\t// Create a local instance of cookie store\n\t\t\t\tCookieStore cookieStore = new BasicCookieStore();\n\t\t\t\t// Create local HTTP context\n\t\t\t\thttpContext = new BasicHttpContext();\n\t\t\t\t// Bind custom cookie store to the local context\n\t\t\t\thttpContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore);\n\t\t\t}\n\t\t\tresponse = client.execute(httppost, httpContext);\n\t\t\t/*\n\t\t\t <form method='post' action='/auth/developer/callback' noValidate='noValidate'>\n\t\t\t <label for='name'>Name:</label>\n\t\t\t <input type='text' id='name' name='name'/>\n\t\t\t <label for='email'>Email:</label>\n\t\t\t <input type='text' id='email' name='email'/>\n\t\t\t <button type='submit'>Sign In</button> </form>\n\t\t\t */\n\t\t\tif (log.isDebugEnabled() || !checkAuth(response)) {\n ClientHelper.dumpResponse(httppost, response, true);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tlog.error(\"\", e);\n\t\t\treturn;\n\t\t} finally {\n\t\t\tif (client != null)\n\t\t\t\tclient.getConnectionManager().shutdown();\n\t\t}\n\n\t\tfinal StatusLine statusLine = response.getStatusLine();\n\t\tif (statusLine != null && statusLine.getStatusCode() == 302) {\n\t\t\t// HTTP/1.1 302 Moved Temporarily\n\t\t\tHeader cookie = response.getFirstHeader(\"Set-Cookie\");\n\t\t\tif (cookie != null) {\n\t\t\t\tlog.debug(\"XXX: set local context\");\n\t\t\t\tthis.localContext = httpContext;\n\t\t\t}\n\t\t\telse log.error(\"Expected Set-Cookie header in response\");\n\t\t\tif (log.isDebugEnabled()) {\n\t\t\t\tHeader location = response.getFirstHeader(\"Location\");\n\t\t\t\tif (location != null) {\n\t\t\t\t\tcheckAuthentication(context, location.getValue());\n\t\t\t\t\t//log.debug(\"XXX: set local context\");\n\t\t\t\t\t//this.localContext = httpContext;\n\t\t\t\t}\n\t\t\t\telse log.error(\"Expected Location header in response\");\n\t\t\t}\n\t\t} else {\n\t\t\tlog.error(\"Expected 302 status code in response\");\n\t\t}\n\t}", "public String getInputAuth()\n\t{\n\t\treturn inputAuth;\n\t}", "public void messageArrived(String s, MqttMessage mqttMessage) {\n LoCommand command = new Gson().fromJson(new String(mqttMessage.getPayload()), LoCommand.class);\n System.out.println(\"Device command received: \" + new Gson().toJson(command));\n\n LoCommand.LoCommandResponse response = new LoCommand.LoCommandResponse(new HashMap<>(), command.cid);\n response.res.put(\"my-ack\", \"this is my command acknowledge to \" + command.req);\n\n new Thread(() -> {\n try {\n\n String responseJson = new Gson().toJson(response);\n System.out.println(\"Publishing command acknowledge message: \" + responseJson);\n\n MqttMessage message = new MqttMessage(responseJson.getBytes());\n message.setQos(QOS);\n\n mqttClient.publish(MqttTopics.MQTT_TOPIC_RESPONSE_COMMAND, message);\n System.out.println(\"Command ack published\");\n\n } catch (MqttException me) {\n System.out.println(\"reason \" + me.getReasonCode());\n System.out.println(\"msg \" + me.getMessage());\n System.out.println(\"loc \" + me.getLocalizedMessage());\n System.out.println(\"cause \" + me.getCause());\n System.out.println(\"excep \" + me);\n me.printStackTrace();\n }\n }).start();\n }", "public PacketSendAuthentication(OutputStream os, String username, String password) throws IOException {\n\t\tsuper(os);\n\t this.password = password;\n\t this.username = username;\n\t buildPacket();\n\t}", "protected void onPrivateMessage(String sender, String login, String hostname, String message) {}", "private void checkAuthAtMain() {\n val auth = config.getString(\"authAtMain\");\n\n checkArgument(auth.length() > 10, \"auth string (at-main) length is less than or equal to 10!\");\n }", "private boolean createRmqUser(String login, String password){\n String enc = new String( Base64.encodeBase64( \"guest:guest\".getBytes() ) );\n\n try{\n CloseableHttpClient client = HttpClients.createDefault();\n HttpPut putUser = new HttpPut( \"http://\"+Main.getRmqIp()+\":\"+Main.getRmqPort()+\"/api/users/\"+login );\n putUser.addHeader( \"Authorization\", \"Basic \" + enc ); // RabbitMQ requires a user with create permission, create it mannually first\n putUser.addHeader( \"content-type\", \"application/json\" );\n putUser.setEntity( new StringEntity( \"{\\\"password\\\":\\\"\"+password+\"\\\",\\\"tags\\\":\\\"administrator\\\"}\" ) );\n client.execute( putUser );\n\n//After create, configure RabbitMQ permission\n\n HttpPut putConfigPermissions = new HttpPut( \"http://\"+Main.getRmqIp()+\":\"+Main.getRmqPort()+\"/api/permissions/%2f/\"+login );\n putConfigPermissions.addHeader( \"Authorization\", \"Basic \" + enc );\n putConfigPermissions.addHeader( \"content-type\", \"application/json\" );\n putConfigPermissions.setEntity( new StringEntity( \"{\\\"configure\\\":\\\".*\\\",\\\"write\\\":\\\".*\\\",\\\"read\\\":\\\".*\\\"}\" ) ); // Permission you wanna. Check RabbitMQ HTTP API for details\n client.execute( putConfigPermissions );\n\n }catch( Exception ex ){\n log(ex.getMessage());\n return false;\n }\n return true;\n }", "@Override\n public void onFailure(IMqttToken asyncActionToken, Throwable exception) {\n mqttOnline = false;\n }", "public boolean auth() throws IOException {\r\n \treturn auth(false);\r\n }", "private void login() {\n AnonimoTO dati = new AnonimoTO();\n String username = usernameText.getText();\n String password = passwordText.getText();\n\n if (isValidInput(username, password)) {\n dati.username = username;\n dati.password = password;\n\n ComplexRequest<AnonimoTO> request =\n new ComplexRequest<AnonimoTO>(\"login\", RequestType.SERVICE);\n request.addParameter(dati);\n\n SimpleResponse response =\n (SimpleResponse) fc.processRequest(request);\n\n if (!response.getResponse()) {\n if (ShowAlert.showMessage(\n \"Username o password non corretti\", AlertType.ERROR)) {\n usernameText.clear();\n passwordText.clear();\n }\n }\n }\n\n }", "abstract public boolean checkAuth(String userId) throws IOException;", "@Test\n\tpublic void testAuthenticateAndroidUser() {\n\t\t Authenticator auth=new Authenticator();\n \n \n \n AndroidUser anUser=new AndroidUser(\"\", \"asd\", \"asd\", \"asd\", \"asd\", \"asd\", \"asd\");\n \n assertTrue(auth.authenticate(anUser));\n \n \n\t}", "public static String getAuthorizationLoguin() {\n\t\treturn getServer()+\"wsagenda/v1/usuarios/login\";\n\t}", "@Override\n public void onSuccess(IMqttToken asyncActionToken) {\n Toast.makeText(getApplicationContext(), \"We are connected\" , Toast.LENGTH_SHORT).show();\n\n }", "public boolean authToServer() throws ClientChatException{\n\n\t\t// On crée un objet container pour contenir nos donnée\n\t\t// On y ajoute un AdminStream de type Authentification avec comme params le login et le mot de pass\n \tAuthentificationRequest request = new AuthentificationRequest(login, pass);\n\t\t\n\t\t//Auth sur le port actif\n\t\ttry {\n\t\t\t// On tente d'envoyer les données\n\t\t\toos_active.writeObject(request);\n\t\t\t// On tente de recevoir les données\n\t\t\tAuthentificationResponse response = (AuthentificationResponse)ois_active.readObject();\n\n\t\t\t// On switch sur le type de retour que nous renvoie le serveur\n\t\t\t// !!!Le type enum \"Value\" est sujet à modification et va grandir en fonction de l'avance du projet!!!\n\t\t\tswitch(response.getResponseType()){\n\t\t\tcase AUTH_SUCCESS:\n\t\t\t\t\n\t\t\t\towner = response.getOwner();\n\t\t\t\t\n\t\t\t\t//creation du socket\n\t\t\t\ttry {\n\t\t\t\t\ts_passive = new Socket(address, 3003);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new ClientChatException(ClientChatException.IO_ERREUR, \n\t\t\t\t\t\"ERROR : passive socket creation failed!\");\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// On crée le flux sortant !!!OBLIGATOIRE de créer le flux sortant avant le flux entrant!!!\n\t\t\t\ttry {\n\t\t\t\t\toos_passive = new ObjectOutputStream(s_passive.getOutputStream());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new ClientChatException(ClientChatException.IO_ERREUR, \n\t\t\t\t\t\"ERROR : passive OOS creation failed!\");\n\t\t\t\t}\n\t\t\t\t// On crée le flux entrant\n\t\t\t\ttry {\n\t\t\t\t\tois_passive = new ObjectInputStream(s_passive.getInputStream());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tthrow new ClientChatException(ClientChatException.IO_ERREUR, \n\t\t\t\t\t\"ERROR : passive OIS creation failed!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\trequest = new AuthentificationRequest(owner);\t\t\t\n\t\t\t\t//Auth sur le port passif\n\t\t\t\ttry {\n\t\t\t\t\t// On tente d'envoyer les données\n\t\t\t\t\toos_passive.writeObject(request);\n\t\t\t\t\t// On tente de recevoir les données\n\t\t\t\t\tresponse = (AuthentificationResponse)ois_passive.readObject();\n\n\t\t\t\t\t// On switch sur le type de retour que nous renvoie le serveur\n\t\t\t\t\t// !!!Le type enum \"Value\" est sujet à modification et va grandir en fonction de l'avance du projet!!!\n\t\t\t\t\tswitch(response.getResponseType()){\n\t\t\t\t\tcase AUTH_SUCCESS:\n\t\t\t\t\t\topResult = \"Welcome!\";\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tcase AUTH_FAIL:\n\t\t\t\t\t\topResult = \"ERROR : check login/pwd! (passive socket)\";\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} catch(Exception e){\n\t\t\t\t\tthrow new ClientChatException (ClientChatException.IO_ERREUR, \"ERROR: Communication Error (passive)\");\n\t\t\t\t}\n\t\t\t\n\t\t\tcase AUTH_FAIL:\n\t\t\t\topResult = \"ERROR : check login/pwd! (active socket)\";\n\t\t\t\treturn false;\n\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tthrow new ClientChatException (ClientChatException.IO_ERREUR, \"ERROR: Communication Error (active)\");\n\t\t}\n\t\treturn true;\n }", "public CheckAuthCommand() {\n this.authLevel = AUTH_LEVEL_LOGGED_IN;\n }", "public Authenticator(String authUrl, String clientId, String clientSecret)\r\n { \r\n RestTemplate rt = new RestTemplate();\r\n \r\n Map<String, String> vars = new HashMap<String, String>();\r\n\r\n vars.put(\"username\", clientId);\r\n vars.put(\"password\", clientSecret);\r\n this.user = rt.postForObject(authUrl, vars, UserInfo.class);\r\n \r\n }", "public void open(String address, int port, Handler<AsyncResult<AmqpBridge>> openHandler) {\n\n this.client = ProtonClient.create(this.vertx);\n\n // TODO: check correlation between MQTT and AMQP keep alive\n ProtonClientOptions clientOptions = new ProtonClientOptions();\n clientOptions.setHeartbeat(this.mqttEndpoint.keepAliveTimeSeconds() * 1000);\n\n String userName = (this.mqttEndpoint.auth() != null) ? this.mqttEndpoint.auth().getUsername() : null;\n String password = (this.mqttEndpoint.auth() != null) ? this.mqttEndpoint.auth().getPassword() : null;\n // NOTE : if username/password are null then Vert.x Proton just provides SASL ANONYMOUS as supported mechanism\n // otherwise it provides PLAIN with username/password provided here\n this.client.connect(clientOptions, address, port, userName, password, done -> {\n\n String clientIdentifier = this.mqttEndpoint.clientIdentifier();\n if (done.succeeded()) {\n\n this.connection = done.result();\n this.connection\n .closeHandler(remoteClose -> handleRemoteConnectionClose(this.connection, remoteClose))\n .disconnectHandler(this::handleRemoteDisconnect)\n .open();\n\n // setup MQTT endpoint handlers and AMQP endpoints\n this.setupMqttEndpoint();\n this.setupAmqpEndpoits();\n\n // setup a Future for completed connection steps with all services\n // with AMQP_WILL and AMQP_LIST/AMQP_SUBSCRIPTIONS or AMQP_CLOSE handled\n Future<AmqpSubscriptionsMessage> connectionFuture = Future.future();\n connectionFuture.setHandler(ar -> {\n\n try {\n if (ar.succeeded()) {\n\n this.rcvEndpoint.publishHandler(this::publishHandler);\n this.rcvEndpoint.pubrelHandler(this::pubrelHandler);\n\n AmqpSubscriptionsMessage amqpSubscriptionsMessage = ar.result();\n\n if (amqpSubscriptionsMessage != null) {\n this.mqttEndpoint.accept(!amqpSubscriptionsMessage.topicSubscriptions().isEmpty());\n // added topic subscriptions of a previous session in the local collection\n this.grantedQoSLevels = amqpSubscriptionsMessage.topicSubscriptions()\n .stream()\n .collect(Collectors.toMap(amqpTopicSubscription -> amqpTopicSubscription.topic(),\n amqpTopicSubscription -> amqpTopicSubscription.qos()));\n\n } else {\n this.mqttEndpoint.accept(false);\n this.grantedQoSLevels = new HashMap<>();\n }\n LOG.info(\"CONNACK [{}] to MQTT client {} at {}\", CONNECTION_ACCEPTED.ordinal(),\n clientIdentifier, this.remoteAddress);\n\n // open unique client publish address receiver\n this.rcvEndpoint.openPublish();\n\n openHandler.handle(Future.succeededFuture(AmqpBridge.this));\n\n } else {\n\n this.mqttEndpoint.reject(CONNECTION_REFUSED_SERVER_UNAVAILABLE);\n LOG.error(\"CONNACK [{}] to MQTT client {} at {}\", CONNECTION_REFUSED_SERVER_UNAVAILABLE.ordinal(),\n clientIdentifier, this.remoteAddress);\n\n openHandler.handle(Future.failedFuture(ar.cause()));\n }\n }\n finally\n {\n openedFuture.complete();\n }\n });\n\n // step 1 : send AMQP_WILL to Last Will and Testament Service\n Future<ProtonDelivery> willFuture = Future.future();\n // if remote MQTT has specified the will\n if (this.mqttEndpoint.will().isWillFlag()) {\n\n // sending AMQP_WILL\n MqttWill will = this.mqttEndpoint.will();\n\n AmqpWillMessage amqpWillMessage =\n new AmqpWillMessage(will.isWillRetain(),\n will.getWillTopic(),\n MqttQoS.valueOf(will.getWillQos()),\n Buffer.buffer(will.getWillMessageBytes()));\n\n // specified link name for the Last Will and Testament Service as MQTT clientid\n ProtonLinkOptions linkOptions = new ProtonLinkOptions();\n linkOptions.setLinkName(clientIdentifier);\n\n // setup and open AMQP endpoints to Last Will and Testament Service\n ProtonSender wsSender = this.connection.createSender(AmqpLwtServiceEndpoint.LWT_SERVICE_ENDPOINT, linkOptions);\n this.lwtEndpoint = new AmqpLwtServiceEndpoint(wsSender);\n\n this.lwtEndpoint.open();\n this.lwtEndpoint.sendWill(amqpWillMessage, willFuture);\n\n } else {\n\n // otherwise just complete the Future\n willFuture.complete();\n }\n\n willFuture.compose(v -> {\n\n // handling AMQP_SUBSCRIPTIONS reply from Subscription Service\n this.rcvEndpoint.subscriptionsHandler(amqpSubscriptionsMessage -> {\n\n LOG.info(\"Session present: {}\", !amqpSubscriptionsMessage.topicSubscriptions().isEmpty());\n LOG.info(amqpSubscriptionsMessage.toString());\n\n connectionFuture.complete(amqpSubscriptionsMessage);\n });\n\n // step 2 : send AMQP_CLOSE or AMQP_LIST (based on \"clean session\" flag) to Subscription Service\n Future<ProtonDelivery> sessionFuture = Future.future();\n\n if (this.mqttEndpoint.isCleanSession()) {\n\n // sending AMQP_CLOSE\n AmqpCloseMessage amqpCloseMessage =\n new AmqpCloseMessage(clientIdentifier);\n\n this.ssEndpoint.sendClose(amqpCloseMessage, closeAsyncResult -> {\n\n // in case of AMQP_CLOSE, the connection completes on its disposition\n // no other AMQP message will be delivered by Subscription Service (i.e. AMQP_SUBSCRIPTIONS)\n if (closeAsyncResult.succeeded()) {\n connectionFuture.complete();\n } else {\n connectionFuture.fail(closeAsyncResult.cause());\n }\n });\n\n } else {\n\n // sending AMQP_LIST\n AmqpListMessage amqpListMessage =\n new AmqpListMessage(clientIdentifier);\n\n this.ssEndpoint.sendList(amqpListMessage, sessionFuture);\n }\n\n return sessionFuture;\n\n }).compose(v -> {\n // nothing here !??\n }, connectionFuture);\n\n // timeout for the overall connection process\n vertx.setTimer(AMQP_SERVICES_CONNECTION_TIMEOUT, timer -> {\n if (!connectionFuture.isComplete()) {\n connectionFuture.fail(\"Timeout on connecting to AMQP services\");\n }\n });\n\n } else {\n\n LOG.error(\"Error connecting to AMQP services ...\", done.cause());\n final MqttConnectReturnCode code;\n if (done.cause() instanceof SecurityException) {\n // error on the SASL mechanism side\n code = CONNECTION_REFUSED_NOT_AUTHORIZED;\n } else {\n code = CONNECTION_REFUSED_SERVER_UNAVAILABLE;\n\n }\n this.mqttEndpoint.reject(code);\n\n openHandler.handle(Future.failedFuture(done.cause()));\n\n LOG.info(\"CONNACK [{}] to MQTT client {} at {}\", code.ordinal(),\n clientIdentifier, this.remoteAddress);\n }\n\n });\n\n }", "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 }", "protected String getAuthMethod() {\n return \"Token\" ;// TODO this.conf.getAuthMethod();\n }", "private boolean autoAuthenticateDevice(String nonce) {\r\n\t\tString devCode = \"\";\r\n\t\tString authCode = \"\";\r\n\t\tString cr = \"\";\r\n\t\tMessage autoAuthenticate = new Message().addData(\"task\", \"transaction\").addData(\"message\",\r\n\t\t\t\t\"authenticate_device\");\r\n\t\tMessage reply;\r\n\r\n\t\ttry {\r\n\t\t\t// checks if file is existant and reads the device code\r\n\t\t\tFile device = new File(\"resources/device_\" + this.connectionData.getUsername());\r\n\t\t\tif (!device.exists()) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(device));\r\n\t\t\tdevCode = br.readLine();\r\n\t\t\tbr.close();\r\n\t\t\t// generated authcode\r\n\t\t\tauthCode = devCode.split(\";\")[1];\r\n\t\t\tdevCode = devCode.split(\";\")[0];\r\n\r\n\t\t\tdevCode = this.connectionData.getAes().encode(devCode);\r\n\r\n\t\t\t// generate chalange-response\r\n\r\n\t\t\tcr = new Hash(authCode + nonce).toString();\r\n\t\t\tautoAuthenticate.addData(\"device\", devCode);\r\n\t\t\tautoAuthenticate.addData(\"cr\", cr);\r\n\t\t\tthis.connectionData.getConnection().write(autoAuthenticate);\r\n\t\t\treply = this.connectionData.getConnection().read();\r\n\t\t\tif (reply.getData(\"message\").equals(\"failed\")) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "private void debugAuthentcation() {\n\n\t\t/*\n\t\t * XPagesUtil.showErrorMessage(\"bluemix util: serviceName: \" +\n\t\t * serviceName + \", baseUrl: \" + baseUrl + \" username: \" + username +\n\t\t * \" password: \" + password);\n\t\t * XPagesUtil.showErrorMessage(\"bluemix util: service name: \" +\n\t\t * serviceName + \", hardcodedBaseUrl: \" + hardcodedBaseUrl +\n\t\t * \" hardcodedUsername: \" + hardcodedUsername + \" hardcodedPassword: \" +\n\t\t * hardcodedPassword);\n\t\t */\n\t}", "@Test\n public void ShouldInitializeAndThenAuthenticate() throws Exception {\n final CountDownLatch lcd = new CountDownLatch(1);\n kidozen = new KZApplication(AppSettings.KZ_TENANT, AppSettings.KZ_APP, AppSettings.KZ_KEY, false);\n kidozen.Initialize( new ServiceEventListener() {\n @Override\n public void onFinish(ServiceEvent e) {\n lcd.countDown();\n assertThat(e.StatusCode, equalTo(HttpStatus.SC_OK));\n }\n });\n lcd.await(TEST_TIMEOUT_IN_MINUTES, TimeUnit.MINUTES);\n final CountDownLatch alcd = new CountDownLatch(1);\n\n kidozen.Authenticate(AppSettings.KZ_USER, AppSettings.KZ_PASS,AppSettings.KZ_PROVIDER, new ServiceEventListener() {\n @Override\n public void onFinish(ServiceEvent e) {\n alcd.countDown();\n assertThat(e.StatusCode, equalTo(HttpStatus.SC_OK));\n }\n });\n assertEquals(true, kidozen.UserIsAuthenticated);\n alcd.await(TEST_TIMEOUT_IN_MINUTES, TimeUnit.MINUTES);\n }", "@Override\n public void onFailure(IMqttToken asyncActionToken, Throwable exception) {\n Toast.makeText(getApplicationContext(), \"We are not connected\" , Toast.LENGTH_SHORT).show();\n }", "void onNetworkCredentialsRequested();", "public void runClient() {\n\t\tString clientID = \"d:quickstart:MyDevice:\" + deviceId;\r\n\t\tSystem.out.println( \"deviceId=\" + deviceId );\r\n\t\tconnOpt = new MqttConnectOptions();\r\n\t\t\r\n\t\tconnOpt.setCleanSession( true );\r\n\t\tconnOpt.setKeepAliveInterval( 30 );\r\n\r\n\t\t// Connect to Broker\r\n\t\ttry{\r\n\t\t\tmyClient = new MqttClient( BROKER_URL, clientID );\r\n\t\t\tmyClient.setCallback( this );\r\n\t\t\tmyClient.connect( connOpt );\r\n\t\t}catch( MqttException e ){\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.exit( -1 );\r\n\t\t}\r\n\r\n\t\tString myTopic = \"iot-2/evt/estado_\" + dc + \"/fmt/json\";\r\n\t\tMqttTopic topic = myClient.getTopic( myTopic );\r\n\t\t\r\n\t\twhile( true ){\r\n\t\t\ttry{\r\n\t\t\t\tCalendar c = Calendar.getInstance();\r\n\t\t\t\tTimeZone tz = TimeZone.getTimeZone( \"Asia/Tokyo\" );\r\n\t\t\t\tc.setTimeZone( tz );;\r\n\t\t\t\tint y = c.get( Calendar.YEAR );\r\n\t\t\t\tint m = c.get( Calendar.MONTH ) + 1;\r\n\t\t\t\tint d = c.get( Calendar.DAY_OF_MONTH );\r\n\t\t\t\tint h = c.get( Calendar.HOUR_OF_DAY );\r\n\t\t\t\tint n = c.get( Calendar.MINUTE );\r\n\t\t\t\tint s = c.get( Calendar.SECOND );\r\n\t\t\t\tString dt = y\r\n\t\t\t\t\t\t+ \"/\" + ( m < 10 ? \"0\" : \"\" ) + m\r\n\t\t\t\t\t\t+ \"/\" + ( d < 10 ? \"0\" : \"\" ) + d\r\n\t\t\t\t\t\t+ \"T\" + ( h < 10 ? \"0\" : \"\" ) + h\r\n\t\t\t\t\t\t+ \":\" + ( n < 10 ? \"0\" : \"\" ) + n\r\n\t\t\t\t\t\t+ \":\" + ( s < 10 ? \"0\" : \"\" ) + s\r\n\t\t\t\t\t\t+ \"+09:00\";\r\n\r\n\t\t\t\tString out = \"\";\r\n\t\t\t\tHttpClient client = new HttpClient();\r\n\t\t\t\tGetMethod get = new GetMethod( \"http://estado.\" + dc + \".bluemix.net/\" );\r\n\r\n\t\t\t\tint sc = client.executeMethod( get );\r\n\t\t\t\tString html = get.getResponseBodyAsString();\r\n\t\t\t\tint x = html.indexOf( \"<table\" );\r\n\t\t\t\twhile( x > -1 ){\r\n//\t\t\t\tif( x > -1 ){\r\n\t\t\t\t\tint td1 = html.indexOf( \"<td>\", x + 1 );\r\n\t\t\t\t\tint td2 = html.indexOf( \"</td>\", td1 + 4 );\r\n\t\t\t\t\tint td3 = html.indexOf( \"<td>\", td2 + 1 );\r\n\t\t\t\t\tint td4 = html.indexOf( \"</td>\", td3 + 4 );\r\n\t\t\t\t\tif( td1 > -1 && td2 > -1 && td3 > -1 && td4 > -1 ){\r\n\t\t\t\t\t\tString name = html.substring( td1 + 4, td2 );\r\n\t\t\t\t\t\tString svalue = html.substring( td3 + 4, td4 );\r\n\r\n\t\t\t\t\t\tif( svalue.equals( \"down\" ) ){\r\n\t\t\t\t\t\t\tString line = \"\\\"\" + name + \"\\\"\";\r\n\t\t\t\t\t\t\tif( out.length() > 0 ){\r\n\t\t\t\t\t\t\t\tline = \",\" + line;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tout += line;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tx = td4;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = html.indexOf( \"<tr \", x + 1 );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tout = \"{\\\"datetime\\\":\\\"\" + dt + \"\\\",\\\"error_services\\\":[\" + out + \"]}\";\r\n\t\t\t\t//System.out.println( \"out = \" + out );\r\n\t\t\t\t\r\n\t\t\t\t//. MQTT Publish\r\n\t\t \t\tint pubQoS = 0;\r\n\t\t\t\tMqttMessage message = new MqttMessage( out.getBytes() );\r\n\t\t \tmessage.setQos( pubQoS );\r\n\t\t \tmessage.setRetained( false );\r\n\r\n\t\t \t// Publish the message\r\n\t\t \t//System.out.println( \"Publishing to topic \\\"\" + topic + \"\\\" qos \" + pubQoS );\r\n\t\t \tMqttDeliveryToken token = null;\r\n\t\t \ttry{\r\n\t\t \t\t// publish message to broker\r\n\t\t\t\t\ttoken = topic.publish( message );\r\n\t\t\t \t// Wait until the message has been delivered to the broker\r\n\t\t\t\t\ttoken.waitForCompletion();\r\n\t\t\t\t\tThread.sleep( 1000 );\r\n\t\t\t\t}catch( Exception e ){\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//. 次の実行タイミングを待つ\r\n\t\t\t\tCalendar c0 = Calendar.getInstance();\r\n\t\t\t\tint s0 = ( c0.get( Calendar.SECOND ) % interval );\r\n\t\t\t\tint w = 1000 * ( interval - s0 );\r\n\t\t\t\tThread.sleep( w );\r\n\t\t\t}catch( Exception e ){\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public TransportConn(RFTXHost host, int identity) {\n this.host = host;\n this.identity = identity;\n readyToRun=false;\n }", "@Test\n public void ShouldAuthenticate() throws Exception {\n final CountDownLatch alcd = new CountDownLatch(1);\n kidozen = new KZApplication(AppSettings.KZ_TENANT, AppSettings.KZ_APP, AppSettings.KZ_KEY, false);\n kidozen.Authenticate( AppSettings.KZ_USER, AppSettings.KZ_PASS,AppSettings.KZ_PROVIDER, new ServiceEventListener() {\n @Override\n public void onFinish(ServiceEvent e) {\n alcd.countDown();\n assertThat(e.StatusCode, equalTo(HttpStatus.SC_OK));\n }\n });\n assertEquals(true, kidozen.UserIsAuthenticated);\n alcd.await(TEST_TIMEOUT_IN_MINUTES, TimeUnit.MINUTES);\n }", "static @NonNull ByteBuffer getMsg(int typ, int len) {\n ByteBuffer res = ByteBuffer.wrap(new byte[len]); // Create Authentication Request template\n res.put((byte)((ATH_VER << 4) | typ)); // Set the Qi-Authentication version and the Request type\n return res; // Return the Authentication Request template\n }", "private void login() {\n setCredentials();\n setSysProperties();\n\n Properties sysProperties = System.getProperties();\n sysProperties.put(\"mail.store.protocol\", \"imaps\");\n this.session = Session.getInstance(sysProperties,\n new Authenticator() {\n @Override\n protected PasswordAuthentication getPasswordAuthentication() {\n return new PasswordAuthentication(username, password);\n }\n });\n }", "@Override\n public boolean isClientAuthEnabled() {\n return true;\n }" ]
[ "0.6674586", "0.657701", "0.62692004", "0.58566564", "0.58566564", "0.58566564", "0.5789971", "0.5788436", "0.57449496", "0.5708703", "0.57039917", "0.5595171", "0.5584135", "0.5535193", "0.55146664", "0.549262", "0.5487019", "0.5458506", "0.5439111", "0.53791326", "0.5331138", "0.5321477", "0.52984506", "0.52792746", "0.52709883", "0.52649873", "0.5260956", "0.5255824", "0.52509695", "0.52369535", "0.52214956", "0.52207476", "0.52197975", "0.5211622", "0.52091765", "0.5208605", "0.5180409", "0.5174017", "0.51665705", "0.51549643", "0.5120118", "0.5106483", "0.51005447", "0.5099357", "0.50927234", "0.5086843", "0.5084436", "0.50831693", "0.5077217", "0.5075957", "0.50713664", "0.50546616", "0.5051507", "0.5040648", "0.50394315", "0.50389737", "0.5035659", "0.5028917", "0.5020054", "0.50173956", "0.5016974", "0.501116", "0.50108457", "0.5010442", "0.50071347", "0.50062066", "0.500293", "0.4996352", "0.49895588", "0.49858335", "0.4977655", "0.49746802", "0.49686587", "0.49628043", "0.4962641", "0.49584982", "0.49565655", "0.4956464", "0.49541023", "0.49495673", "0.49403074", "0.49397", "0.49340895", "0.49320453", "0.49242762", "0.49170607", "0.49170294", "0.49169526", "0.4914037", "0.49077886", "0.48990032", "0.48975238", "0.48969242", "0.48964298", "0.48888636", "0.48761395", "0.48760006", "0.48692834", "0.48644638", "0.48587483" ]
0.72791
0
TODO Autogenerated method stub
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; case R.id.action_friendship: controller.showFriendshipOptions(); return true; default: return super.onOptionsItemSelected(item); } }
{ "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
Returns the value of the 'Name' attribute. If the meaning of the 'Name' attribute isn't clear, there really should be more of a description here...
String getName();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic String getName() {\n\t\treturn (String) attributes.get(\"name\");\n\t}", "public String getName() {\n\t\treturn (String) get_Value(\"Name\");\n\t}", "public String getName() {\n\t\treturn (String) get_Value(\"Name\");\n\t}", "public String getName() {\n\t\treturn (String) get_Value(\"Name\");\n\t}", "public final String getNameAttribute() {\n return getAttributeValue(\"name\");\n }", "public String getName()\n {\n return (String)getAttributeInternal(NAME);\n }", "public String getName() { \n\t\treturn getNameElement().getValue();\n\t}", "public String getName() { \n\t\treturn getNameElement().getValue();\n\t}", "public String getName() { \n\t\treturn getNameElement().getValue();\n\t}", "public String getName() { return (String)get(\"Name\"); }", "public String getName(){\n\n //returns the value of the name field\n return this.name;\n }", "public String getName() {\n return (String) getValue(NAME);\n }", "public String getName() { return this.Name; }", "public String getName()\n {\n return this.aName;\n }", "public AXValue getName() {\n return name;\n }", "public String getName() { return Name; }", "public String getName()\r\n\t{\r\n\t\treturn name;\r\n\t}", "public String getName()\r\n\t{\r\n\t\treturn name;\r\n\t}", "public String getName()\r\n\t{\r\n\t\treturn name;\r\n\t}", "public String getName()\r\n\t{\r\n\t\treturn name;\r\n\t}", "public String getName()\n \t{\n \t\treturn name;\n \t}", "public String getName() {\r\n \t\t\treturn name;\r\n \t\t}", "public String getName() {\r\n return Name;\r\n }", "public String getName()\n\t{ return name; }", "@Override\n\t\tfinal public String getName() {\n\t\t\treturn this.Name;\n\t\t}", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "public String getName() {\r\n \treturn name;\r\n }", "private String getName() {\n\t\treturn name;\n\t}", "public String getName()\r\n\t{\r\n\t\treturn this._name;\r\n\t}", "public YangString getNameValue() throws JNCException {\n return (YangString)getValue(\"name\");\n }", "public YangString getNameValue() throws JNCException {\n return (YangString)getValue(\"name\");\n }", "@Basic @Raw\r\n\tpublic String getName() {\r\n\t\treturn name;\r\n\t}", "public String getName()\r\n {\r\n\treturn name;\r\n }", "public String getName() {\r\n\t\t\treturn Name;\r\n\t\t}", "public String getName() throws SdpParseException {\n\t\tNameValue nameValue = getAttribute();\n\t\tif (nameValue == null)\n\t\t\treturn null;\n\t\telse {\n\t\t\tString name = nameValue.getName();\n\t\t\tif (name == null)\n\t\t\t\treturn null;\n\t\t\telse\n\t\t\t\treturn name;\n\t\t}\n\t}", "public String getName() \n {\n \treturn name;\n }", "public String getName()\r\n\t{\r\n\t\treturn this.name;\r\n\t}", "public String getName()\r\n\t{\r\n\t\treturn this.name;\r\n\t}", "public String getName()\r\n {\r\n return name;\r\n }", "public String getName()\r\n {\r\n return name;\r\n }", "public String GetName() {\n\t\treturn this.name;\n\t}", "public String getName() \n\t{\n\t\treturn name;\n\t}", "public String getName() {\n return this.Name;\n }", "public String getName() {\n return this.Name;\n }", "public java.lang.String getName()\n {\n return name;\n }", "public java.lang.String getName()\n {\n return name;\n }", "public String getName() {\r\n\t\treturn name.get();\r\n\t}", "public String getName() {\n\t\treturn Name;\n\t}", "public String getName() {\n\t\treturn this.Name;\n\t}", "public Name getName(){\r\n\t\treturn name;\r\n\t}" ]
[ "0.85526824", "0.83111763", "0.83111763", "0.83111763", "0.8163431", "0.8146775", "0.79938203", "0.79938203", "0.79938203", "0.79563904", "0.7912841", "0.7835634", "0.782378", "0.7813174", "0.7806618", "0.77801347", "0.77782315", "0.77782315", "0.77782315", "0.77782315", "0.7776915", "0.77687347", "0.7768726", "0.77682525", "0.77656364", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77654296", "0.77602047", "0.7758867", "0.77519715", "0.7751616", "0.7751616", "0.7745901", "0.773763", "0.77364105", "0.77344704", "0.77333015", "0.7731477", "0.7731477", "0.77278334", "0.77278334", "0.77268493", "0.77185816", "0.77159923", "0.77159923", "0.7713943", "0.7713943", "0.7712153", "0.77114755", "0.77100533", "0.77076495" ]
0.0
-1
/ Selectors and Mutators / End of selectors and mutators / Other shit / / Main game life cycle methods
@Override public void gameInit() { font = new Font("Courier", Font.BOLD, 14); fontInfo = this.getFontMetrics(font); keys = new KeyValues(); background.loadImage("/images/sky.png"); tileset = new TileSet(10,10,32,32); tileset.loadTiles("/images/test_tiles.png"); map = new Map(tileset, 20, 50); map.readMap("res/maps/testmap2.txt"); camera.setDimensions(getScreenWidth(), getScreenHeight()); camera.setXRange(0, map.getWidth() - getScreenWidth()); camera.setYRange(0, map.getHeight() - getScreenHeight()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void tick() {\r\n\r\n\t\t// Switches on the different states of the game that it could be in\r\n\t\tswitch (gameState) {\r\n\t\tcase MAINMENU:\r\n\t\t\t// If there is not already a Main menu instance that exists\r\n\t\t\tif (mainMenu == null) {\r\n\t\t\t\t// Create a new Menu Instance\r\n\t\t\t\tmainMenu = new MainMenu();\r\n\t\t\t}\r\n\t\t\tmainMenu.tick();\r\n\t\t\tbreak;\r\n\t\tcase GAME:\r\n\t\t\t// If there is not already a game instance that exists\r\n\t\t\tif (game == null) {\r\n\t\t\t\t// Create a new game Instance\r\n\t\t\t\tgame = new Game(map, gm);\r\n\t\t\t}\r\n\t\t\t// Every time the state manager ticks it also ticks the current game state\r\n\t\t\tgame.tick();\r\n\t\t\tbreak;\r\n\t\tcase GAME_ONLINE:\r\n\t\t\tif (gameOnline == null) {\r\n\t\t\t\t// Create a new game Instance\r\n\r\n//\t\t\t\tip = JOptionPane.showInputDialog(\"Enter Server Ip\");\r\n//\t\t\t\tportTCP = Integer.parseInt(JOptionPane.showInputDialog(\"Enter TCP PORT\"));\r\n//\t\t\t\tportUDP = Integer.parseInt(JOptionPane.showInputDialog(\"Enter UDP PORT\"));\r\n//\t\t\t\tusername = JOptionPane.showInputDialog(\"Enter Your username\");\r\n\t\t\t\tgameOnline = new GameOnline(username, ip, portUDP, portTCP);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase LEVEL_EDITOR:\r\n\t\t\t// If there is not already a Editor instance that exists\r\n\t\t\tif (levelEditor == null) {\r\n\t\t\t\t// Create a new Editor Instance\r\n\t\t\t\tlevelEditor = new LevelEditor();\r\n\t\t\t}\r\n\t\t\tlevelEditor.tick();\r\n\t\t\tbreak;\r\n\t\tcase LEADERBOARD:\r\n\t\t\tif (leaderBoard == null) {\r\n\t\t\t\tleaderBoard = new Leaderboard();\r\n\t\t\t}\r\n\t\t\tleaderBoard.tick();\r\n\t\t\tbreak;\r\n\t\tcase SPLASHSCREEN_LOADING:\r\n\t\t\tif (splashScreenLoading == null) {\r\n\t\t\t\tsplashScreenLoading = new SplashScreenLoading();\r\n\t\t\t}\r\n\t\t\tsplashScreenLoading.tick();\r\n\t\t\tbreak;\r\n\t\tcase OPTIONS:\r\n\t\t\tbreak;\r\n\t\tcase TESTSCREEN:\r\n\t\t\tif (testScreen == null) {\r\n\t\t\t\ttestScreen = new TestScreen();\r\n\t\t\t}\r\n\t\t\ttestScreen.tick();\r\n\t\t\tbreak;\r\n\t\tcase MAP_SELECT_SCREEN:\r\n\t\t\tif (mapSelectScreen == null) {\r\n\t\t\t\tmapSelectScreen = new MapSelectScreen();\r\n\t\t\t}\r\n\t\t\tmapSelectScreen.tick();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tlong currentTime = System.currentTimeMillis();\r\n\t\tif (currentTime > nextSecond) {\r\n\t\t\tnextSecond += 1000;\r\n\t\t\tframesInLastSecond = framesInCurrentSecond;\r\n\t\t\tframesInCurrentSecond = 0;\r\n\r\n\t\t\t// System.out.println(framesInLastSecond + \"fps\");\r\n\t\t}\r\n\r\n\t\tframesInCurrentSecond++;\r\n\r\n\t}", "public abstract void lifeCycle();", "private Game() {\n\t\tlabyrinth = Labyrinth.getInstance();\n\t\tplayer = Player.getInstance();\n\n\t\tcandies = new HashMap<>();\n\t\tenemies = new HashMap<>();\n\t\tbuttons = new HashMap<>();\n\n\t\tgenerateCandies();\n\t\tgenerateEnemies();\n\t\t//generateButtons();\n\n\t\tscore = Score.getInstance();\n\n\t\t//Put the door randomly.\n int coordX = ThreadLocalRandom.current().nextInt(0, 16);\n int coordY = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tthis.door = Door.getInstance(coordX, coordY);\n\t}", "public void initialize() {\r\n /**********************************/\r\n //this.numOfLives=new hitevent.Counter(START_NUM_LIVES);\r\n //this.blocksCounter = new hitevent.Counter(this.levelInformation.numberOfBlocksToRemove());\r\n //this.gui = new GUI(\"jumping\", WIDTH_SCREEN, HI_SCREEN);\r\n /*****************************************/\r\n //create new point to create the edges of the screen\r\n Point p1 = new Point(-5, 20);\r\n Point p2 = new Point(-5, -5);\r\n Point p3 = new Point(WIDTH_SCREEN - 20, -5);\r\n Point p4 = new Point(-5, HI_SCREEN - 15);\r\n //an array to the blocks of the edges\r\n Block[] edges = new Block[4];\r\n //create the adges of the screen\r\n Counter[] edgeCount = new Counter[4];\r\n edgeCount[0] = new Counter(1);\r\n edges[0] = new Block(new Rectangle(p1, WIDTH_SCREEN + 20, 25), Color.RED, edgeCount[0]);\r\n edgeCount[1] = new Counter(1);\r\n edges[1] = new Block(new Rectangle(p2, 25, HI_SCREEN + 20), Color.RED, edgeCount[1]);\r\n edgeCount[2] = new Counter(1);\r\n edges[2] = new Block(new Rectangle(p3, 25, HI_SCREEN + 20), Color.RED, edgeCount[2]);\r\n edgeCount[3] = new Counter(1);\r\n edges[3] = new Block(new Rectangle(p4, WIDTH_SCREEN + 20, 25), Color.RED, edgeCount[3]);\r\n\r\n //initilize the paddle\r\n initializePaddle();\r\n //sprite collection and game evnironment\r\n SpriteCollection sprite = new SpriteCollection();\r\n GameEnvironment game1 = new GameEnvironment();\r\n\r\n //add the Background of the level to the sprite collection\r\n this.addSprite(this.levelInformation.getBackground());\r\n //create score Indicator, lives Indicator and level name\r\n ScoreIndicator scoreIndicator1 = new ScoreIndicator(score);\r\n LivesIndicator livesIndicator1 = new LivesIndicator(numOfLives);\r\n LevelIndicator levelName = new LevelIndicator(this.levelInformation.levelName());\r\n\r\n game1.addCollidable((Collidable) this.paddle);\r\n sprite.addSprite((Sprite) this.paddle);\r\n sprite.addSprite((Sprite) scoreIndicator1);\r\n sprite.addSprite((Sprite) livesIndicator1);\r\n sprite.addSprite((Sprite) levelName);\r\n\r\n //add the paddle, score Indicator, lives Indicator and level name to the game\r\n this.paddle.addToGame(this);\r\n scoreIndicator1.addToGame(this);\r\n livesIndicator1.addToGame(this);\r\n levelName.addToGame(this);\r\n\r\n //initilize the Blocks\r\n initializeBlocks();\r\n\r\n }", "@Override\n public void beginGame() {\n }", "@Override\n public void buildAndSetGameLoop() {\n }", "public void initialize() {\n // create a runner using a function\n this.createScreenBorders();\n // create a keyboard sensor.\n this.keyboard = this.runner.getGUI().getKeyboardSensor();\n //create the environment for the game (game environment and sprites collection)\n this.createEnvironment();\n // BACKGROUND CREATION //\n this.createBackground();\n // create the counters for the game.\n this.createCounters();\n // LISTENERS CREATION //\n //create a message printing listener.\n HitListener phl = new PrintingHitListener();\n //create a new block remover listener.\n HitListener blockrmv = new BlockRemover(this, blockCounter);\n //create a new ball remover listener.\n HitListener ballrmv = new BallRemover(this, ballCounter);\n //create a new score counter listener.\n HitListener scorelstn = new ScoreTrackingListener(this.scoreCounter);\n // BLOCKS CREATION //\n this.createBlocks(phl, blockrmv, scorelstn);\n // SIDE BLOCKS CREATION //\n this.createSideBlocks();\n // DEATH BLOCK CREATION //\n this.createDeathBlock(ballrmv);\n // LEVEL'S NAME //\n LevelsName name = new LevelsName(this.levelInfo.levelName());\n // add the whole-game indicators to the sprites list.\n this.sprites.addSprite(scoreIndi);\n this.sprites.addSprite(lifeIndi);\n this.sprites.addSprite(name);\n }", "public GameHandler() {\n boardGraph = new BoardGraph();\n reset();\n }", "private void startGame() {\n\t\tmain.next_module = new Game(main, inputs, gameSelectionData);\n\t}", "private UI_Layer() {\n System.out.println(\"UI_Layer Const\");\n renewGameThread(\"10\", \"140\");\n }", "private void Management_Player(){\n\t\t\n\t\t// render the Player\n\t\tswitch(ThisGameRound){\n\t\tcase EndRound:\n\t\t\treturn;\t\t\t\n\t\tcase GameOver:\n\t\t\t// do nothing\n\t\t\tbreak;\n\t\tcase Running:\n\t\t\tif (PauseGame==false){\n\t\t\t\tplayerUser.PlayerMovement();\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse if (PauseGame==true){\n\t\t\t\t// do not update gravity\n\t\t\t}\n\t\t\tbreak;\t\t\n\t\t}\n\t\n\t\tbatch.draw(playerUser.getframe(PauseGame), playerUser.getPosition().x , playerUser.getPosition().y,\n\t \t\tplayerUser.getBounds().width, playerUser.getBounds().height);\n\t\t\n\t\t\n\t\t\n\t\tswitch (playerUser.EquipedToolCycle)\n\t\t{\t\n\t\tcase 0:\n\t\t\tstartTimeTool = System.currentTimeMillis(); \n\t\t\tbreak;\n\t\t\t\n\t\tcase 1: \n\t\t\t\n\t\t\tif (PauseGame==true){\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// tool is grabbed\n\t\t\testimatedTimeEffect = System.currentTimeMillis() - startTimeTool;\t\t\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t\tplayerUser.pe_grab.setPosition(playerUser.getPosition().x + playerUser.getBounds().width/2,\n\t\t\t\t\tplayerUser.getPosition().y + playerUser.getBounds().height/2);\t\n \t\t\n\t\t\t\tplayerUser.pe_grab.update(Gdx.graphics.getDeltaTime());\n\t\t\t\tplayerUser.pe_grab.draw(batch,Gdx.graphics.getDeltaTime()); \t\t\t\t\t\t\t\n\t\t\t\n\t\t\tif (estimatedTimeEffect >= Conf.SYSTIME_MS){\n\t\t\t\testimatedTimeEffect = 0;\n\t\t\t\tplayerUser.ToolEquiped();\n\t\t\t\tstartTimeTool = System.currentTimeMillis(); \n\t\t\t\tplayerUser.EquipedToolCycle++;\n\t\t\t}else{\n\t\t\t\t// do nothing\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\t\t\n\t\tcase 2:\n\t\t\t\n\t\t\tif (PauseGame==true){\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\testimatedTimeEffect = (System.currentTimeMillis() - startTimeTool) / 1000;\t\t\t\t\n\t\t\tplayerUser.pe_equip.setPosition(playerUser.getPosition().x + playerUser.getBounds().width/2,\n\t\t\tplayerUser.getPosition().y + playerUser.getBounds().height/2);\t\n\t\t\tplayerUser.pe_equip.update(Gdx.graphics.getDeltaTime());\n\t\t\tplayerUser.pe_equip.draw(batch,Gdx.graphics.getDeltaTime()); \t\t\t\t\n\t\t\tif (estimatedTimeEffect>=Conf.TOOL_TIME_USAGE_LIMIT){\n\t\t\t\tplayerUser.EquipedToolCycle=0;\t\t\n\t\t\t\tplayerUser.color = Color.NONE;\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif (estimatedTimeEffect>=Conf.TOOL_TIME_USAGE_MUSIC_LIMIT){\n\t\t\t\tPhoneDevice.Settings.setMusicValue(true);\n\t\t\t}\n\t\t}\t\t\t\t\n\t}", "public void start()\r\n\t{\r\n\t\t//build scene\r\n\t\tsetupWorld();\r\n\t \r\n\t\t//setup interfae\r\n\t RightClickMenuListener rightClickMenuListener = new RightClickMenuListener();\r\n\t\trightClickMenu = new JPopupMenu();\r\n\t\tJMenuItem menuItem = new JMenuItem(\"Delete Node\");\r\n\t menuItem.addActionListener(this);\r\n\t rightClickMenu.add(menuItem);\r\n\t \r\n\t this.addMouseListener(rightClickMenuListener);\r\n\t\tthis.addMouseListener(this);\r\n\t this.addMouseMotionListener(this);\r\n\t\tthis.addKeyListener(this);\r\n\t\tthis.setFocusable(true);\r\n\t\tthis.requestFocus();\r\n\t\t\r\n\t\t\r\n\t\t//start the game loop\r\n\t\tint delay = 16;//16ms = 60fps\r\n\t\tlastTime = System.nanoTime();\r\n\t\twhile(GameVars.isRunning)\r\n\t\t{\r\n\t\t\t//update fps once per second\r\n\t\t\t//http://stackoverflow.com/a/20769932 for fps counter\r\n\t\t\tif(System.nanoTime()-lastTime > 1000000000)\r\n\t\t\t{\r\n\t\t\t\tfps = (int)(fpsCounter*1000000000./(System.nanoTime() - lastTime));\r\n\t\t\t\tlastTime = System.nanoTime();\r\n\t\t\t\tfpsCounter = 0;\r\n\t\t\t\t//delay = (int)(1000./fps - 1.);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//delay simulation to set fps\r\n\t\t\ttry {\r\n\t\t\t\tThread.sleep(delay);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//update motion and interactions\r\n\t\t\tupdateMotion();\r\n\t\t\tcheckForCollisions();\r\n\t\t\t//aSquare.checkForInteractions();\r\n\t\t\t\t\r\n\t\t\tfor(Person p:people)\r\n\t\t\t\tp.updatePhysics();\r\n\t\t\t\r\n\t\t\t//redraw image each frame\r\n\t\t\tthis.repaint();\r\n\t\t}\r\n\t}", "public abstract void gameObjectAwakens();", "public void doInitializations(JFrame menu){\n\t\tup = false;\n\t\tdown = false;\n\t\tleft = false;\n\t\tright = false; //sonst läuft Spieler nach Neustart einfach los\n\t\tattack = false;\n\t\tattack2 = false;\n\t\t\n\t\tlevel = 1;\n\t\troom = 1;\n\t\tlast = System.nanoTime();\n\t\tgameover = 0;\n\t\t\n\t\tactors = new CopyOnWriteArrayList<Sprite>();\n\t\tattacks = new CopyOnWriteArrayList<Object>();\n\t\t\n\t\tlib = SpriteLib.getInstance();\n\t\t\n\t\t\n\t\tsoundlib = new SoundLib();\n\t\tsoundlib.loadSound(\"Hintergrund\", \"sound/Greensleeves.wav\");\n\t\tsoundlib.loadSound(\"Angriff\", \"sound/Angriff.wav\");\n\t\tsoundlib.loadSound(\"Zauber\", \"sound/Zauber.wav\");\n\t\tif(sound_running == true){\n\t\tsoundlib.loopSound(\"Hintergrund\");\n\t\t}\n\t\t\t\n\t\t////1 = Coins, 2 = Mana, 3 = Shop, 4 = Rüstung, 5 = Waffe, 6 = NPC\n\t\tplayer = new Player(lib.getSprite(\"resources/pics/player.gif\", 12, 1), 50, 50, 100, this);\n\t\tenemy = new Enemy(lib.getSprite(\"resources/pics/enemy.gif\", 4, 1), 100, 500, 10, 100, this);\n\t\tenemy3 = new IceEnemy(lib.getSprite(\"resources/pics/Eisgegner.gif\", 4, 1), 500, 50, 10, 100, this);\n\t\tenemy4 = new FireEnemy(lib.getSprite(\"resources/pics/Feuergegner.gif\", 4, 1), 600, 50, 10, 100, this);\n\t\tenemy2 = new Enemy(lib.getSprite(\"resources/pics/enemy.gif\", 4, 1), 300, 200, 10, 100, this);\n\t\tcoin = new Item(lib.getSprite(\"resources/pics/coin.gif\", 1, 1), 700, 400, 1, 100, this);\n\t\tcoin2 = new Item(lib.getSprite(\"resources/pics/coin.gif\", 1, 1), 670, 400, 1, 100, this);\n\t\tcoin3 = new Item(lib.getSprite(\"resources/pics/coin.gif\", 1, 1), 640, 400, 1, 100, this);\n\t\tcoin4 = new Item(lib.getSprite(\"resources/pics/coin.gif\", 1, 1), 610, 400, 1, 100, this);\n\t\tcoin5 = new Item(lib.getSprite(\"resources/pics/coin.gif\", 1, 1), 580, 400, 1, 100, this);\n\t\tcoin6 = new Item(lib.getSprite(\"resources/pics/coin.gif\", 1, 1), 100, 50, 1, 100, this);\n\t\tcoin7 = new Item(lib.getSprite(\"resources/pics/coin.gif\", 1, 1), 140, 50, 1, 100, this);\n\t\tcoin8 = new Item(lib.getSprite(\"resources/pics/coin.gif\", 1, 1), 180, 50, 1, 100, this);\n\t\tcoin9 = new Item(lib.getSprite(\"resources/pics/coin.gif\", 1, 1), 220, 50, 1, 100, this);\n\t\tcoin10 = new Item(lib.getSprite(\"resources/pics/coin.gif\", 1, 1), 260, 50, 1, 100, this);\n\t\tmana = new Item(lib.getSprite(\"resources/pics/mana.gif\", 1, 1), 470, 500, 2, 100, this);\n\t\tshop = new Item(lib.getSprite(\"resources/pics/shop.gif\", 1, 1), 400, 500, 3, 100, this);\n\t\tnpc = new Item(lib.getSprite(\"resources/pics/npc.gif\", 1, 1), 100, 100, 6, 100, this);\n\t\tschildeis = new Item(lib.getSprite(\"resources/pics/IceArmour.gif\", 1, 1), 100, 200, 4, 100, this);\n\t\tschildfeuer = new Item(lib.getSprite(\"resources/pics/FireArmour.gif\", 1, 1), 150, 200, 9, 100, this);\n\t\tschwerteis = new Item(lib.getSprite(\"resources/pics/IceSword.gif\", 1, 1), 100, 150, 5, 100, this);\n\t\tschwertfeuer = new Item(lib.getSprite(\"resources/pics/FireSword.gif\", 1, 1), 150, 150, 10, 100, this);\n\t\thealthpack = new Item(lib.getSprite(\"resources/pics/healthpack.gif\", 1, 1), 500, 100, 7, 100, this);\n\t\tquest = new Quest(lib.getSprite(\"resources/pics/quest.gif\", 1, 1), 500, 200, 2, 100, this); //Münz-Quest\n\t\tquest2 = new Quest(lib.getSprite(\"resources/pics/quest.gif\", 1, 1), 100, 250, 1, 100, this); //Mathe-Münz-Quest\n\n\t\tactors.add(enemy); \n\t\tactors.add(enemy2); \n\t\tactors.add(enemy3);\n\t\tactors.add(enemy4); \n\t\tactors.add(coin); \n\t\tactors.add(coin2); \n\t\tactors.add(coin3); \n\t\tactors.add(coin4); \n\t\tactors.add(coin5);\n\t\tactors.add(coin6); \n\t\tactors.add(coin7); \n\t\tactors.add(coin8); \n\t\tactors.add(coin9); \n\t\tactors.add(coin10);\n\t\tactors.add(mana);\n\t\tactors.add(shop);\n\t\tactors.add(npc);\n\t\tactors.add(schwerteis);\n\t\tactors.add(schildeis);\n\t\tactors.add(schwertfeuer);\n\t\tactors.add(schildfeuer);\n\t\tactors.add(healthpack);\n\t\tactors.add(quest);\n\t\tactors.add(quest2);\n\t\tactors.add(player);\n\t\t\n\t\tcheckpointx = 50;\n\t\tcheckpointy = 50;\n\n\t\t\n\t\tplayer.setOldCoins(100);\n\t\tplayer.setOldXP(0);\n\t\tplayer.setOldMana(0);\n\t\tplayer.setOldWeapon(0);\n\t\tplayer.setOldArmour(0);\n\t\tplayer.setCoins(100);\n\t\tplayer.setXP(0);\n\t\tplayer.setOldMaxhealth(100);\n\t\t\n\t\tplayer.setSkillHealth1(false);\n\t\tplayer.setSkillHealth2(false);\n\t\tplayer.setSkillStrength1(false);\n\t\tplayer.setSkillStrength2(false);\n\t\t\n\t\tplayer.setOldSkillHealth1(false);\n\t\tplayer.setOldSkillHealth2(false);\n\t\tplayer.setOldSkillStrength1(false);\n\t\tplayer.setOldSkillStrength2(false);\n\t\t\n\t\t\n\t\tskillsOnce = false;\n\t\t\n\t\t//Erstellen der Karte, wobei die ersten 3 Parameter für die Eingabedateien stehen, die erste Zahl für die Anzahl der Spalten im TileSet, die zweite für die Anzahl der Zeilen\n\t\tmap = new MapDisplay(\"resources/level/TileMap_1_1.txt\", \"resources/pics/tiles_1.gif\", \"resources/pics/shadow.png\", 5, 1, this);\n\t\t\n\t\tinitSkills();\n\t\tmenu.dispose();\n\t\tsetStarted(true);\n\t\t\n\t}", "void gameStarted();", "void gameStarted();", "public void initialize() {\r\n levelInformation.getBackground().addToGame(this);\r\n ScoreTrackingListener scoreTrackingListener = new ScoreTrackingListener(score);\r\n ScoreIndicator scoreIndicator = new ScoreIndicator(score, guiWidth);\r\n BlockRemover blockRemover = new BlockRemover(this, blockCounter);\r\n BallAdder ballAdder = new BallAdder(this, environment, ballCounter);\r\n BallRemover ballRemover = new BallRemover(this, ballCounter);\r\n for (Block blocks : levelInformation.blocks()) {\r\n Block block = blocks;\r\n if (block.getColor() == Color.black) {\r\n block.addHitListener(ballRemover);\r\n }\r\n if (block.getColor() == Color.magenta) {\r\n block.addHitListener(ballAdder);\r\n }\r\n block.addHitListener(blockRemover);\r\n block.addHitListener(scoreTrackingListener);\r\n block.addToGame(this);\r\n }\r\n blockCounter.increase(levelInformation.numberOfBlocksToRemove());\r\n Paddle paddle = new Paddle(new Rectangle(new Point((guiWidth / 2) - (levelInformation.paddleWidth() / 2),\r\n 580), levelInformation.paddleWidth(), 10), Color.YELLOW, keyboard, levelInformation.paddleSpeed());\r\n paddle.addToGame(this);\r\n Block top = new Block(new Rectangle(new Point(0, 0), 800, 20), Color.GRAY);\r\n Block left = new Block(new Rectangle(new Point(0, 10), wallWidth, 630), Color.GRAY);\r\n Block right = new Block(new Rectangle(new Point(guiWidth - wallWidth, 10), wallWidth, 630), Color.GRAY);\r\n Block bottom = new Block(new Rectangle(new Point(0, guiHeight), 800, 10), Color.GRAY);\r\n bottom.addToGame(this);\r\n right.addToGame(this);\r\n left.addToGame(this);\r\n top.addToGame(this);\r\n bottom.addHitListener(ballRemover);\r\n scoreIndicator.addToGame(this);\r\n }", "public ProjectGame() {\n\n super(\"BulletHell\", 1200, 900);\n die = new Event();\n backgroundMusic = new SoundManagerClass();\n playButton.setPositionX(420);\n playButton.setPositionY(180);\n quitButton.setPositionX(623);\n quitButton.setPositionY(181);\n //x = 0;\n reduceLife = new Event();\n fadeOutEvent = new Event();\n PickedUpEvent = new Event();\n die.setEventType(\"playerDeath\");\n fadeOutEvent.setEventType(\"FadeOut\");\n reduceLife.setEventType(\"Collision\");\n collidedEvent = new Event();\n collidedEvent.setEventType(\"CollidedEvent\");\n throwKnife = new Event();\n throwKnife.setEventType(\"throwKnife\");\n\n\n keyIcon.setPositionX(200);\n keyIcon.setPositionY(40);\n\n knifeIcon.setPositionX(205);\n knifeIcon.setPositionY(95);\n\n currentLevel = 0;//0 = base , 3=brigham's level\n\n\n PickedUpEvent.setEventType(\"CoinPickedUp\");\n\n this.addEventListener(myQuestManager, collidedEvent.getEventType());\n\n\n background.setScaleX(5);\n background.setScaleY(5);\n\n background.setScaleX(5);\n background.setScaleY(5);\n\n\n player = new Player(\"player\", \"resources/player_sheet.png\", \"idle_right\");\n player.setSpriteSheetJson(\"resources/player_sheet.json\");\n player.setDelay(100);\n\n player.getLifeArray().get(0).setPositionX(390);\n player.getLifeArray().get(0).setPositionY(40);\n player.getLifeArray().get(1).setPositionX(420);\n player.getLifeArray().get(1).setPositionY(40);\n player.getLifeArray().get(2).setPositionX(450);\n player.getLifeArray().get(2).setPositionY(40);\n // player.setHasPhysics(true);\n keyCount = 0;\n knifeCount = 4;\n // player.setHasPhysics(true);\n\n // platform.setPositionX(50);\n // platform.setPositionY(550);\n\n\n // platform1.setPositionX(150);\n // platform1.setPositionY(150);\n\n\n player.setPositionX(550);\n player.setPositionY(700);\n\n pressE = new Sprite(\"pressE\", \"pressE.png\");\n player.addChild(pressE);\n pressE.setPositionY(-50);\n\n\n coin.setPositionY(250);\n coin.setPositionX(660);\n\n findKey.setPositionX(500);\n findKey.setPositionY(-20);\n\n getToRoom.setPositionX(500);\n getToRoom.setPositionY(-20);\n\n killTurtle.setPositionX(500);\n killTurtle.setPositionY(-20);\n\n\n //Rectangle2D rect = new Rectangle2D.Float(600,400,700,500);\n //coverList = new ArrayList<Rectangle2D>(); //list of cover sprites\n //coverList.add(rect);\n\n ///////////////////////////////////////LEVEL 0 ////////////////////////////////////////////////////////////////\n\n if (currentLevel == 0) {\n\n tutorial = new TutorialLevel1(\"Tutorial\");\n tutorial.run();\n addChild(tutorial);\n\n myLevel = new Level0(\"Room1\");\n myLevel.run();\n addChild(myLevel);\n\n\n myLevel1 = new Level1(\"Room2\");\n myLevel1.run();\n myLevel1.hide();\n addChild(myLevel1);\n\n myLevel2 = new ahmedslevel(\"Room3\", player);\n myLevel2.run();\n myLevel2.hide();\n addChild(myLevel2);\n\n myLevel3 = new BrighamLevel(\"Room4\");\n myLevel3.run();\n myLevel3.hide();\n addChild(myLevel3);\n\n level4 = new AlternatingSpikesLevel(\"Room6\");\n level4.run();\n level4.hide();\n addChild(level4);\n\n bossLevel = new BossLevel(\"Room5\", player);\n bossLevel.run();\n bossLevel.hide();\n addChild(bossLevel);\n\n\n\n tutorial.mapDoorToRoom(0,myLevel);\n myLevel.mapDoorToRoom(0, myLevel1);\n myLevel1.mapDoorToRoom(0, myLevel2);\n myLevel2.mapDoorToRoom(0, myLevel3);\n myLevel3.mapDoorToRoom(0, level4);\n level4.mapDoorToRoom(0, bossLevel);\n //myLevel3.mapDoorToRoom(0,bossLevel);\n\n\n currentRoom = tutorial;\n\n //myLevel1.mapDoorToRoom(0,myLevel2);\n\n //myLevel2.run();\n //myLevel2.hide();\n\n\n //myLevel2.mapDoorToRoom(0,myLevel3);\n //myLevel3.run();\n //myLevel3.hide();\n currentQuestObjective = 0;\n\n }\n\n if (currentLevel == 4) {\n\n\n bossLevel = new BossLevel(\"Room4\", player);\n bossLevel.run();\n currentRoom = bossLevel;\n\n\n }\n\n enemies = currentRoom.enemies;\n pickpocketEnemy = null;\n\n transitionY = 615;\n transitionYCurrent = 615;\n\n\n backgroundMusic.playSoundEffect(\"resources/oceanOperator.wav\", 100);\n\n }", "private DungeonBotsMain() {\n\t\t// Does nothing.\n\t}", "private GameStatePresets()\n {\n\n }", "private void init() {\n\t\tdisplay = new Display(title, width, height);\n\t\tdisplay.getFrame().addKeyListener(keyManager); //lets us access keyboard\n\t\tdisplay.getFrame().addMouseListener(mouseManager);\n\t\tdisplay.getFrame().addMouseMotionListener(mouseManager);\n\t\tdisplay.getCanvas().addMouseListener(mouseManager);\n\t\tdisplay.getCanvas().addMouseMotionListener(mouseManager);\n\t\tAssets.init();\n\t\t\n\t\tgameCamera = new GameCamera(this, 0,0);\n\t\thandler = new Handler(this);\n\t\t\n\t\tgameState = new GameState(handler);\n\t\tmenuState = new MenuState(handler);\n\t\tsettingState = new SettingState(handler);\n\t\tmapState = new mapState(handler);\n\t\tmansionState = new mansionState(handler);\n\t\tparkState = new parkState(handler);\n\t\tjazzState = new jazzState(handler);\n\t\tmansionGardenState = new mansionGardenState(handler);\n\t\tmansionArcadeState = new mansionArcadeState(handler);\n\t\tmansionStudyState = new mansionStudyState(handler);\n\t\tjazzPRoomState = new jazzPRoomState(handler);\n\t\tState.setState(menuState);\n\t}", "public void act() \r\n {\n if(getOneIntersectingObject(Player.class)!=null)\r\n {\r\n if(MenuWorld.gamemode == 1)\r\n //marcheaza regenerarea labirintului(trecere la nivelul urmator in Modul Contra Timp)\r\n TAworld.shouldRegen=true;\r\n else\r\n { \r\n //reseteaza variabilele care tin de modul de joc\r\n MenuWorld.gamemode=-1;\r\n MenuWorld.isPlaying=false;\r\n for(int i=0;i<4;i++)\r\n ItemCounter.gems_taken[i]=0;\r\n \r\n //arata fereastra de castig \r\n PMworld.shouldShowVictoryWindow=true;\r\n }\r\n \r\n }\r\n \r\n }", "public static void main(String[] args) {\n int progressId = 1;\n Map<Integer, Set<Entity>> progressEntities = new HashMap<>();\n Set<Entity> map000entity = new HashSet<>();\n map000entity.add(new Entity(new LocationPair<>(9.5F, 12.5F), Entity.TOWARD_RIGHT, \"Cirno\") {\n int useRefresh = 10;\n int activeTime = 80;\n boolean acting = true;\n\n @Override\n public void onRegisiter() {\n this.setMovingWay(MOVING_FASTER);\n }\n\n @Override\n public void onUnRegisiter() {\n System.out.println(\"Entity was unregisitered.\");\n }\n\n @Override\n public void action() {\n if (acting) {\n if (activeTime >= 0) {\n this.setToward(Entity.TOWARD_RIGHT);\n this.setWonderMoving(Entity.GOTOWARD_RIGHT);\n } else {\n this.setToward(Entity.TOWARD_LEFT);\n this.setWonderMoving(Entity.GOTOWARD_LEFT);\n }\n }\n if (isLastMovingSucceed()) {\n if (++activeTime >= 160) {\n activeTime = -160;\n }\n }\n if (useRefresh > 0) {\n useRefresh--;\n }\n }\n\n @Override\n public void onUse() {\n if (useRefresh == 0) {\n Keyboard.setState(Keyboard.STATE_DIALOG);\n acting = false;\n int moving = this.getMoving();\n int wonderMoving = this.getWonderMoving();\n int toward = this.getToward();\n this.setMoving(Entity.NOTGO);\n this.setWonderMoving(Entity.NOTGO);\n this.facePlayer();\n System.out.println(\"Changed the state of Keyboard.\");\n Case progress = new Case(\"test.entity.prs\", 2, () -> {\n Keyboard.setState(Keyboard.STATE_MOVING);\n acting = true;\n this.setMoving(moving);\n this.setWonderMoving(wonderMoving);\n this.setToward(toward);\n EventManager.getInstance().performedNp(this, 0);\n Resource.regisiterMisc(new Misc() {\n @Override\n public void invoke() {\n if (Resource.getMapId() == 1) {\n this.completed();\n Keyboard.setState(Keyboard.STATE_DIALOG);\n ArrayList<String> str = new ArrayList<>();\n str.add(Localization.query(\"test.misc\"));\n SimpleTalkingDialog std = new SimpleTalkingDialog(str, () -> {\n Keyboard.setState(Keyboard.STATE_MOVING);\n });\n std.init();\n GameFrame.getInstance().regisiterDialog(std);\n System.out.println(\"Invoked misc.\");\n }\n }\n });\n System.out.println(\"Progress ID is now 0.\");\n System.out.println(\"Changed the state of Keyboard.\");\n useRefresh = 40;\n });\n Case hello = new Case(\"test.entity.faq\", 3, () -> {\n ArrayList<String> str = new ArrayList<>();\n str.add(Localization.query(\"test.entity.hello1\"));\n str.add(Localization.query(\"test.entity.hello2\"));\n SimpleTalkingDialog std = new SimpleTalkingDialog(str, () -> {\n Keyboard.setState(Keyboard.STATE_MOVING);\n acting = true;\n this.setMoving(moving);\n this.setWonderMoving(wonderMoving);\n this.setToward(toward);\n useRefresh = 40;\n });\n std.init();\n GameFrame.getInstance().regisiterDialog(std);\n System.out.println(\"Changed the state of Keyboard.\");\n });\n Case back = new Case(\"test.entity.buff\", 4, () -> {\n Keyboard.setState(Keyboard.STATE_MOVING);\n acting = true;\n this.setMoving(moving);\n this.setWonderMoving(wonderMoving);\n this.setToward(toward);\n Resource.getPlayer().addBuff(new SpeedBuff(600, 1.5F));\n System.out.println(\"Changed the state of Keyboard.\");\n useRefresh = 40;\n });\n progress.setRelation(hello, null, hello);\n hello.setRelation(back, progress, back);\n back.setRelation(null, hello, null);\n progress.init();\n hello.init();\n back.init();\n List<Case> cases = new ArrayList<>();\n cases.add(progress);\n cases.add(hello);\n cases.add(back);\n ArrayList<String> strs = new ArrayList<>();\n strs.add(Localization.query(\"test.entity.title\"));\n\t\t\t\t\tTalkingDialog dialog = new TalkingDialog(strs, cases);\n\t\t\t\t\tdialog.init();\n GameFrame.getInstance().regisiterDialog(dialog);\n }\n useRefresh = 10;\n }\n });\n Set<Entity> map002entity = new HashSet<>();\n List<String> greet = new ArrayList<>();\n greet.add(\"test.entity.npc\");\n map002entity.add(new FriendlyNPC(new LocationPair<>(9.5F, 7.5F), Entity.TOWARD_DOWN, \"Sanae\", 3, greet));\n progressEntities.put(0, map000entity);\n progressEntities.put(2, map002entity);\n Map<Integer, Set<Item>> progressItems = new HashMap<>();\n boolean withDefaultProgress = true;\n //*/\n\n\n /*\n int progressId = 0;\n Map<Integer, Set<Entity>> progressEntities = new HashMap<>();\n Map<Integer, Set<Item>> progressItems = new HashMap<>();\n boolean withDefaultProgress = true;\n */\n\n\n try {\n ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(new File(\"resources/object/progress\", \"progress\" + String.format(\"%03d\", progressId) + \".prs\")));\n oos.writeObject(new Progress(progressId, progressEntities, progressItems, withDefaultProgress));\n oos.close();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }", "public void preGame() {\n\n\t}", "@Override\n\tpublic void gameStopped() {\n\t}", "@Override\n public void newGame() {\n //TODO Implement this method\n }", "public void init() {\n state = new GameState();\n gameFrame.addKeyListener(state.getKeyListener());\n gameFrame.addMouseListener(state.getMouseListener());\n gameFrame.addMouseMotionListener(state.getMouseMotionListener());\n gameFrame.addFocusListener(new FocusAdapter() {\n @Override\n public void focusLost(FocusEvent e) {\n state.resetKeys();\n }\n });\n gameFrame.addMouseWheelListener(e -> {\n if (Map.map != null) {\n if (e.getWheelRotation() < 0)\n Map.zoomIn();\n else\n Map.zoomOut();\n }\n });\n //Pause Key Setting\n gameFrame.addKeyListener(new KeyAdapter() {\n @Override\n public void keyPressed(KeyEvent e) {\n keyPressed = true;\n if (e.getKeyCode() == KeyEvent.VK_ESCAPE && !gameFinished)\n pause();\n if (e.getKeyCode() == KeyEvent.VK_F1)\n GameFrame.testMode = !GameFrame.testMode;\n }\n });\n gameFrame.addMouseListener(new MouseAdapter() {\n @Override\n public void mouseClicked(MouseEvent e) {\n keyPressed = true;\n }\n });\n\n gameFrame.addKeyListener(new KeyAdapter() {\n @Override\n public void keyTyped(KeyEvent e) {\n if (e.getKeyChar() >= 'a' && e.getKeyChar() <= 'z')\n Cheater.keyPressed(e.getKeyChar());\n }\n });\n }", "private void init() \n\t{\n\t\tgoalReached = false;\n\t\tGdx.input.setInputProcessor(this);\n\t\tcameraHelper = new CameraHelper();\n\t\tlives = Constants.LIVES_START;\n\t\tlivesVisual = lives;\n\t\ttimeLeftGameOverDelay = 0;\n\t\tinitLevel();\n\n\t}", "@Override\n\tpublic void onEnter(Game game) {\n\t\t\n\t}", "public void gameEngineInitializer() {\n\t\t\r\n\t\tthis.sputacchioGameEngine = new SputacchioGameEngine(supportDeck, mainDeck, mainBoard, players, gamestate, playerDoingTurnNumber);// da implementare alla fine\r\n\t\tthis.classicGameEngine = new ClassicGameEngine(supportDeck, mainDeck, mainBoard, players, gamestate, playerDoingTurnNumber, engineUtility, filter);\r\n\t\t\r\n\t\tthis.gamestate.setCurrentGameType(GameType.CLASSICGAME);//si dovrebbe iniziare dal cucù ma facciamo dopo\r\n\t\tthis.gamestate.setCurrentHandNumber(INITIALHANDNUMBER);\r\n\t\tthis.givePersonalJolly();\r\n\t\t\r\n\t\tthis.classicGameEngine.distributeHands();//queste due si fanno all'inizio di ogni mano, non sono da fare solo la prima volta e basta\r\n\t\tthis.classicGameEngine.substituteJolly();\r\n\t\t\r\n\t\tmainEngine();\r\n\t\t//TODO ci vuole un metodo che, a parte la prima chiamata di Server Room, chiama il sotto-engine giusto in base a game type. Se classic game engine fa una return per segnalare\r\n\t\t//che la mano è finita perchè nessuno ha carte in mano, game engine deve ridare le 6 carte o settare l'ultima mano, o la mano della scala obbligatoria, e cambiare chi inizia a cucù.\r\n\t\t//Poi penso che debba chiamare Filter per mostrare a entrambi cosa accade, stampare le nuove carte e dichiarare l'inizio del cucù.\r\n\t}", "public GameManager(){\r\n init = new Initialisation();\r\n tower=init.getTower();\r\n courtyard=init.getCourtyard();\r\n kitchen=init.getKitchen();\r\n banquetHall=init.getBanquetHall();\r\n stock=init.getStock();\r\n throneHall=init.getThroneHall();\r\n vestibule=init.getVestibule();\r\n stables=init.getStables();\r\n\r\n this.player = new Player(tower);\r\n\r\n push(new IntroductionState());\r\n\t}", "public void run(){\n\t\twhile(game_running){\n\t\t\tif(singleplayer){\n\t\t\t\tcomputeDelta(); //Zeit für vorausgehenden Schleifendurchlauf wird errechnet\n\t\t\t\t//Erst Methoden abarbeiten, wenn Spiel gestartet ist\n\t\t\t\tif(isStarted()){\n\t\t\t\t\t\n\t\t\t\t\tcheckKeys(); //Tastaturabfrage\n\t\t\t\t\tdoLogic(); //Ausführung der Logik\n\t\t\t\t\tmoveObjects(); //Bewegen von Objekten\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\trepaint();\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\tif(System.nanoTime()-last < 16666666){\n\t\t\t\t\t\tThread.sleep((16666666 - (System.nanoTime() - last))/1000000); //Zum flüssigen Spiellauf und stabiler FPS-Rate\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}catch (InterruptedException e){}\n\t\t\t} else{\n\t\t\t\tif(serverMode){\n\t\t\t\t\t //Zeit für vorausgehenden Schleifendurchlauf wird errechnet\n\t\t\t\t\t//Erst Methoden abarbeiten, wenn Spiel gestartet ist\n\t\t\t\t\tcomputeDelta();\n\t\t\t\t\tif(isStarted()){\n\t\t\t\t\t\t\n\t\t\t\t\t\tcheckKeys(); //Tastaturabfrage\n\t\t\t\t\t\tdoLogic(); //Ausführung der Logik\n\t\t\t\t\t\tmoveObjects(); //Bewegen von Objekten\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\trepaint();\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(System.nanoTime() - last);\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif(!isStarted()){\n\t\t\t\t\t\t\tThread.sleep(20);\n\t\t\t\t\t\t}else if(System.nanoTime()-last < 16666666){\n\t\t\t\t\t\t\tThread.sleep((16666666 - (System.nanoTime() - last))/1000000);\n\t\t\t\t\t\t}\n//\t\t\t\t\t\tif(System.nanoTime()-last < 16666666){\n//\t\t\t\t\t\t\tThread.sleep((16666666 - (System.nanoTime() - last))/1000000); //Zum flüssigen Spiellauf und stabiler FPS-Rate\n//\t\t\t\t\t\t}\n\t\t\t\t\t}catch (InterruptedException e){}\n\t\t\t\t}else if(clientMode){\n\t\t\t\t\tcomputeDelta();\n\t\t\t\t\tif(isStarted()){\n\t\t\t\t\t\tcheckKeys();\n\t\t\t\t\t\tdoLogic();\n\t\t\t\t\t\tmoveObjects();\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\trepaint();\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(System.nanoTime() - last);\n\t\t\t\t\ttry{\n\t\t\t\t\t\t//Thread.sleep(20);\n\t\t\t\t\t\tif(!isStarted()){\n\t\t\t\t\t\t\tThread.sleep(20);\n\t\t\t\t\t\t}else if(System.nanoTime()-last < 16666666){\n\t\t\t\t\t\t\tThread.sleep((16666666 - (System.nanoTime() - last))/1000000);\n\t\t\t\t\t\t}\n//\t\t\t\t\t\tif(System.nanoTime()-last < 16666666){\n//\t\t\t\t\t\t\tThread.sleep((16666666 - (System.nanoTime() - last))/1000000); //Zum flüssigen Spiellauf und stabiler FPS-Rate\n//\t\t\t\t\t\t}\n\t\t\t\t\t}catch (InterruptedException e){}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\t\n\t}", "protected void initialize() {\n finished = false;\n Robot.shooter.Spin();//Spin up wheels\n Timer.delay(3);\n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n \n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n \n Robot.shooter.TriggerExtend();//Reset Trigger\n Timer.delay(.2);\n Robot.shooter.FeederExtend();//Drop Frisbee\n Timer.delay(1.5);\n Robot.shooter.TriggerRetract();//Fire frisbee\n Timer.delay(.2);\n Robot.shooter.FeederRetract();//Reset Feeder\n Timer.delay(.4);\n //Robot.shooter.Stop();\n Robot.shooter.TriggerExtend();//Reset Trigger\n \n Robot.driveTrain.DriveBack();//Drives backwards from pyramid\n Timer.delay(1.5);\n Robot.driveTrain.TurnAround();//Turns Bob around\n Timer.delay(1);\n Robot.driveTrain.Stop();//Stops Bob\n \n Robot.pneumatics.CompressorOn();//Turns compressor on\n }", "public void act()\r\n {\n \r\n if (Background.enNum == 0)\r\n {\r\n length = Background.length;\r\n width = Background.width;\r\n getWorld().addObject (new YouWon(), length / 2, width / 2);\r\n \r\n //long lastAdded2 = System.currentTimeMillis();\r\n //long curTime3 = System.currentTimeMillis();\r\n //long curTime3 = System.currentTimeMillis();\r\n //long seconds = curTime3 / 1000;\r\n //sleep = 3;\r\n //try {\r\n //TimeUnit.SECONDS.sleep(sleep);\r\n //} catch(InterruptedException ex) {\r\n //Thread.currentThread().interrupt();\r\n //}\r\n //Greenfoot.delay(3);\r\n //long curTime3 = System.currentTimeMillis();\r\n //long secs2 = curTime3 / 1000;\r\n //long curTime4;\r\n //long secs3;\r\n //do\r\n //{\r\n //getWorld().addObject (new YouWon(), length / 2, width / 2);\r\n //curTime4 = System.currentTimeMillis();\r\n //secs3 = curTime3 / 1000;\r\n //} while (curTime4 / 1000 < curTime3 / 1000 + 3);\r\n //if (System.currentTimeMillis()/1000 - 3 >= secs2)\r\n //{\r\n //do\r\n //{\r\n pause(3000);\r\n Actor YouWon;\r\n YouWon = getOneObjectAtOffset(0, 0, YouWon.class);\r\n World world;\r\n world = getWorld();\r\n world.removeObject(this);\r\n Background.xp += 50;\r\n Background.myGold += 100;\r\n if (Background.xp >= 50 && Background.xp < 100){\r\n Background.myLevel = 2;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 100 && Background.xp < 200){\r\n Background.myLevel = 3;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 200 && Background.xp < 400){\r\n Background.myLevel = 4;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 400 && Background.xp < 800){\r\n Background.myLevel = 5;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 800 && Background.xp < 1600){\r\n Background.myLevel = 6;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 1600 && Background.xp < 3200){\r\n Background.myLevel = 7;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 3200 && Background.xp < 6400){\r\n Background.myLevel = 8;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 6400 && Background.xp < 12800){\r\n Background.myLevel = 9;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n } else if (Background.xp >= 12800){\r\n Background.myLevel = 10;\r\n getWorld().addObject (new Level(), getWorld().getWidth() / 2, getWorld().getHeight() / 2);\r\n }\r\n //curTime3 = System.currentTimeMillis();\r\n //secs2 = curTime3 / 1000;\r\n //index2++;\r\n //Greenfoot.setWorld(new YouWon());\r\n //lastAdded2 = curTime3;\r\n //}\r\n //} while (index2 <= 0);\r\n }\r\n }", "private void initDungeon() {\n\t\tengine = new GameEngine(map, this::handleObjectStateChange);\n\n\t\tplayer = engine.getPlayer();\n\t\tObservableList<Node> nodes = dungeonPane.getChildren();\n\n // draw grids\n resources.drawGridLine(nodes, map.getSizeX(), map.getSizeY());\n\n\t\tfor(GameObject obj: engine.getAllObjects()) {\n resources.createImageViewByGameObject(obj, nodes);\n }\n\n\n\t\tfinal LongProperty lastUpdateTime = new SimpleLongProperty(0);\n\t\tmainAnimation = new AnimationTimer() {\n\t\t\t@Override\n\t\t\tpublic void handle(long now) {\n\t\t\t\tdouble elapsedSeconds = (now - lastUpdateTime.get()) / 1000000000.0 ;\n\t\t\t\t// make sure at most go 40 ms for each frame\n\t\t\t\telapsedSeconds = elapsedSeconds > 0.04 ? 0.04 : elapsedSeconds;\n\t\t\t\ttimeConsumed += elapsedSeconds;\n\n\t\t\t\tupdatePlayerMovingStatus();\n\n\t\t\t\tif(keyPressed.contains(KeyCode.A))\n\t\t\t\t handlePlayerShootArrow();\n\n\t\t\t\tif(keyPressed.contains(KeyCode.B))\n\t\t\t\t handlePlayerSetBomb();\n\n\t\t\t\tif(updateMovingObjects(elapsedSeconds))\n\t\t\t\t return;\n\n\t\t\t\t// update timer last in case bomb went off and player is dead\n timers.updateAll((int)(elapsedSeconds * 1000));\n\t\t\t\tlastUpdateTime.set(now);\n\t\t\t}\n\t\t};\n\t\tmainAnimation.start();\n\t}", "public void update() {\n\n if (!isSelected){\n goalManagement();\n }\n\n if (chair != null){ // si une chaise lui est désigné\n if (!hasAGoal && !isSelected){ // et qu'il n'a pas d'objectif\n setSit(true);\n position.setX(chair.getX());\n }\n\n if (isSit){\n chair.setChairState(Chair.ChairState.OCCUPIED);\n }else {\n chair.setChairState(Chair.ChairState.RESERVED);\n }\n }\n\n if (tired > 0 ){\n tired -= Constants.TIRED_LOSE;\n }\n\n if (isSit && comfort>0){\n comfort -= Constants.COMFORT_LOSE;\n }\n\n if (isSitOnSofa && comfort<100){\n comfort += Constants.COMFORT_WIN;\n }\n\n if (!hasAGoal && moveToCoffee && coffeeMachine!=null){\n moveToCoffee = false;\n tired=100;\n\n coffeeMachine.setCoffeeTimer(new GameTimer()) ;\n coffeeMachine.getCoffeeTimer().setTimeLimit(Constants.COFFEE_TIME_TO_AVAILABLE);\n coffeeMachine = null;\n backToSpawn();\n }\n\n if (!hasAGoal && moveToSofa){\n moveToSofa = false;\n isSitOnSofa = true;\n dir = 0 ;\n position.setY(position.getY()-Constants.TILE_SIZE);\n }\n\n if (isSelected){\n flashingColor ++;\n if (flashingColor > 2 * flashingSpeed){\n flashingColor = 0;\n }\n }\n\n }", "public void init()\n\t{\n\t\tpaused = false;\n\t\tbg.play();\n\t\tdeath.setVolume(10);\n\t\texplosion.setVolume(20);\n\t\tsetGameOver(false);\n\t\tscore = 0;\n\t\tlives = 3;\n\t\tgameTime = 0;\n\t\tgameObj = new GameWorldCollection();\n\t\tshipSpawned = false;\n\t\tsound = true;\n\t\ttotalNPS = 0;\n\t\tcollisionVectorPS = new Vector<ICollider>();\n\t\tcollisionVectorNPS\t = new Vector<ICollider>();\n\t\tcollisionVectorAsteroid = new Vector<ICollider>();\n\t\ttrash\t\t\t\t\t= new Vector<ICollider>();\n\t\tnotifyObservers();\t\n\t}", "@Override\n public void runOpMode() {\n commands.init(hardwareMap);\n\n // Wait for the game to start (driver presses PLAY)\n waitForStart();\n\n // run until the end of the match (driver presses STOP)\n while (opModeIsActive()) {\n sleep(30000);\n }\n }", "public static void create(){\n\t\tstage = new Stage(new StretchViewport(1680, 1050)); \n\t\tCamera camera = stage.getCamera();\n\t\tcamera.update();\n\n\t\t//Instantiate the Managers\n\t\tGdx.input.setInputProcessor(getStage());\t\n\t\tstage.getActors().clear();\n\t\t\n\t\tmapManager = new Game_Map_Manager();\n\t\tmapManager.create(getStage());\n\t\t\n\t\tGame_CardHand cardHand = new Game_CardHand();\n\t\tcardHand.create(getStage());\n\n\t\tGameScreenUI actorManager = new GameScreenUI();\n\t\tactorManager.create(getStage());\n\n\t\tTrainDepotUI trainDepot = new TrainDepotUI();\n\t\ttrainDepot.create(getStage());\n\n\t\tGoalMenu goalScreenManager = new GoalMenu();\n\t\tgoalScreenManager.create(getStage());\n\t\t\n\t\tPlayerGoals ticketManager = new PlayerGoals();\n\t\tticketManager.create(getStage());\t\n\t\t\n\t\tGame_StartingSequence startgameManager = new Game_StartingSequence(replayMode);\n\t\tstartgameManager.create(getStage());\n\t\t\n\t\tGame_Shop shop = new Game_Shop();\n\t\tshop.create(getStage());\n\t\t\n\t\tGame_PauseMenu pauseMenu= new Game_PauseMenu();\n\t\tpauseMenu.create(getStage());\n\t\t\n\t\tWarningMessage warningMessage = new WarningMessage();\n\t\twarningMessage.create(getStage());\n\t\t\n\t\tif (replayMode){\n\t\t\tReplayModeUI replayUI = new ReplayModeUI();\n\t\t\treplayUI.create(getStage());\n\t\t\t\n\t\t\tif (Game_StartingSequence.inProgress){\n\t\t\t\tWorldMap replayMap = WorldMap.getInstance();\n\t\t\t\tGame_StartingSequence.player1 = false;\n\t\t\t\t\n\t\t\t\tStation p1station = replayMap.stationsList.get(0);\n\t\t\t\tfor (Station station : replayMap.stationsList){\n\t\t\t\t\tif (station.getName().equals(LocomotionCommotion.getReplayTurn().getJSONObject(\"player1\").getJSONArray(\"stations\").getJSONObject(0).getString(\"stationName\"))){\n\t\t\t\t\t\tp1station = station;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tStation p2station = replayMap.stationsList.get(1);\n\t\t\t\tfor (Station station : replayMap.stationsList){\n\t\t\t\t\tif (station.getName().equals(LocomotionCommotion.getReplayTurn().getJSONObject(\"player2\").getJSONArray(\"stations\").getJSONObject(0).getString(\"stationName\"))){\n\t\t\t\t\t\tp2station = station;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcreateCoreGame(p1station, p2station);\n\t\t\t\tGame_StartingSequence.startGame();\n\t\t\t\tGameScreenUI.refreshResources();\n\t\t\t\tGame_StartingSequence.inProgress = false;\n\t\t\t}\n\t\t}\n\t}", "public GameState(){\n this.gameResults = \"\";\n initVars();\n this.theme = DEFAULT_THEME;\n this.board = new Board(DEFAULT_BOARD);\n createSetOfPlayers(DEFAULT_PLAYERS, DEFAULT_AUTOPLAYER, DEFAULT_AUTOMODE);\n }", "public GameLogic() {\n this.display = createScreen();\n playerShipHealth = 30;\n enemyShipHealth = 20;\n playerShield = 1;\n enemyShield = 1;\n playerMissile = 10;\n enemyMissile = 5;\n\n isPlayerPilotDamaged = false;\n isPlayerGunLDamaged = false;\n isPlayerGunMDamaged = false;\n isPlayerShieldDamaged = false;\n isPlayerEngineDamaged = false;\n\n isEnemyPilotDamaged = false;\n isEnemyGunLDamaged = false;\n isEnemyGunMDamaged = false;\n isEnemyShieldDamaged = false;\n isEnemyEngineDamaged = false;\n\n playerEvasionPercent = .3;\n enemyEvasionPercent = .3;\n\n }", "public void gameRunning()\n{\n}", "@Override\n\tpublic void update(GameContainer arg0, StateBasedGame arg1, int arg2)\n\t\t\tthrows SlickException {\n\t\tif(!mainMusic.playing()){\n\t\t mainMusic.loop();\n\t\t}\n\t\t\n\t\tif(girl.getRoom() == cat.getRoom() && girl.getRoom().getHumans() == 1){\n\t\t\tcatIsDead = true;\n\t\t\tdeath.play();\n\t\t\tend(arg1);\n\t\t}\n\t\t\n\t\tif(Human.frustration >= 100) {\n\t\t\tdeath.play();\n\t\t\tend(arg1);\n\t\t}\n\t\t\n\t\tif(cat.getHunger() > 90 && cat.getSommeil() > 90){\n\t\t\tend(arg1);\n\t\t}\n\t\t\n\t\tmouseTimer += arg2;\n\t\t\n\t\tdad.timer += arg2;\n\t\tmom.timer += arg2;\n\t\tgirl.timer += arg2;\n\t\tcat.timer += arg2;\n\t\tkitchen.timer += arg2;\n\t\t\n\t\tif (dad.timer > 10000) {\n\t\t\tdad.getRoom().leave(dad);\n\t\t\tdad.update();\n\t\t\tdad.timer = 0;\n\t\t}\n\t\t\n\t\tif (mom.timer > 10000) {\n\t\t\tmom.getRoom().leave(mom);\n\t\t\tmom.update();\n\t\t\tmom.timer = 0;\n\t\t}\n\t\t\n\t\tif (girl.timer > 10000) {\n\t\t\tgirl.getRoom().leave(girl);\n\t\t\tgirl.update();\n\t\t\tgirl.timer = 0;\n\t\t}\n\t\t\n\t\tif(!catIsDead){\n\t\t\tif(arg0.getInput().isMouseButtonDown(Input.MOUSE_LEFT_BUTTON) && mouseTimer > 500){\n\t\t\t\tmouseTimer = 0;\n\t\t\t\tif(!cursorDownActivated){\n\t\t\t\t\targ0.setMouseCursor(CDown, cursorOffsetx, cursorOffsety);\n\t\t\t\t\tcursorDownActivated = true;\n\t\t\t\t\tcursorRegularActivated = false;\n\t\t\t\t\tcursorUpActivated = false;\n\t\t\t\t}\n\t\t\t\tint roomIndex = getClickedRoom(arg0.getInput().getMouseX(), arg0.getInput().getMouseY());\n\t\t\t\t\n\t\t\t\tif(roomIndex == -1){\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Unusable room !\");\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\tRoom ro = map.getRooms().get(roomIndex);\n\t\t\t\t\t\n\t\t\t\t\tif(roomIndex == map.getRooms().indexOf(cat.getRoom())){\n\t\t\t\t\t\t\n\t\t\t\t\t\tint objIndex = getClickedObject(arg0.getInput().getMouseX(), \n\t\t\t\t\t\t\t\targ0.getInput().getMouseY(), ro);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (objIndex == -1) {\n\t\t\t\t\t\t\tSystem.out.println(\"Unusable object !\");\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tif (!((cat.getRoom() instanceof Lounge && cat.getRoom().getHumans() > 1)\n\t\t\t\t\t\t\t\t\t\t|| (cat.getRoom() instanceof Bedroom && cat.getRoom().getHumans() > 0))) {\n\t\t\t\t\t\t\t\t\tcat.action((Usable)ro.getObj().get(objIndex));\n\t\t\t\t\t\t\t\t\tif(normalMeow.playing()){\n\t\t\t\t\t\t\t\t\t\tnormalMeow.stop();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tnormalMeow.play();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\te.printStackTrace();\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} else {\n\t\t\t\t\t\tcat.goTo(ro);\n\t\t\t\t\t}\n\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\n\t\t\t}else if(checkIfHover(arg0.getInput().getMouseX(), arg0.getInput().getMouseY())){\n\t\t\t\tif(!cursorUpActivated){\n\t\t\t\t\t\n\t\t\t\t\targ0.setMouseCursor(CUp, cursorOffsetx, cursorOffsety);\n\t\t\t\t\tcursorDownActivated = false;\n\t\t\t\t\tcursorRegularActivated = false;\n\t\t\t\t\tcursorUpActivated = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else {\n\t\t\t\tif(!cursorRegularActivated){\n\t\t\t\t\t\n\t\t\t\t\targ0.setMouseCursor(Cregular, cursorOffsetx, cursorOffsety);\n\t\t\t\t\tcursorDownActivated = false;\n\t\t\t\t\tcursorRegularActivated = true;\n\t\t\t\t\tcursorUpActivated = false;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Gestion du cat\n\t\t\tif(cat.timer > 2000)\n\t\t\t{\n\t\t\t\tcat.minusFaim();\n\t\t\t\tcat.minusSommeil();\n\t\t\t\tif (cat.getUsed() instanceof Bed) {\n\t\t\t\t\tcat.plusSommeil(3);\n\t\t\t\t}\n\t\t\t\tif (cat.getUsed() instanceof Couch) {\n\t\t\t\t\tcat.plusSommeil(2);\n\t\t\t\t}\n\t\t\t\tcat.timer = 0;\n\t\t\t\tif(Human.frustration > 0)\n\t\t\t\t\tHuman.frustration--;\n\t\t\t\tif(cat.getSommeil() == 0)\n\t\t\t\t\tcatIsDead = true;\n\t\t\t\tif(cat.getHunger() == 0)\n\t\t\t\t\tcatIsDead = true;\n\t\t\t}\n\t\t\t\n\t\t\tif(arg0.getInput().isKeyDown(Input.KEY_C) && arg0.getInput().isKeyDown(Input.KEY_A) \n\t\t\t\t\t&& arg0.getInput().isKeyDown(Input.KEY_T)){\n\t\t\t\tcat.plusFaim(100);\n\t\t\t\tcat.plusSommeil(100);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public Interface() {\n left = new Team();\n right = new Team(left);\n left.setEnemyTeam(right);\n \n int gameSize = getGameSize();\n for(int i = 0; i<gameSize;i++)\n {\n left.add(getType(left.name));\n right.add(getType(right.name));\n displayTeams(left);\n }\n \n AI.strat = Strategy.HPWEIGHT;\n \n initComponents();\n showButtons();\n }", "public void populate() { \n \n // make some grounds\n ground1 = new Body(world, PolygonShape.makeBox(100, 5), Body.Type.STATIC);\n ground1.setPosition(new Vec2(-380, -200));\n \n Body ground2 = new Body(world, PolygonShape.makeBox(100, 5), Body.Type.STATIC);\n ground2.setPosition(new Vec2(-0, -200));\n\n Body ground3 = new Body(world, PolygonShape.makeBox(100, 5), Body.Type.STATIC);\n ground3.setPosition(new Vec2(300, -100));\n \n // make a moving platform \n Body movingPlatform = new SlidingPlatform(world, PolygonShape.makeBox(100, 5), new Vec2(130, 0), 2);\n movingPlatform.setPosition(new Vec2(-260, -150));\n \n // make some bottles\n Bottle bottle1 = new Bottle(game);\n bottle1.putOn(ground1);\n bottle1.setName(\"bottle1\");\n \n Bottle bottle2 = new Bottle(game);\n bottle2.putOn(ground2);\n bottle2.setName(\"bottle2\");\n \n Bottle bottle3 = new Bottle(game);\n bottle3.putOn(ground3);\n bottle3.setName(\"bottle3\");\n \n // show dialog with information about level\n JOptionPane.showMessageDialog(frame, \"Press N or M to throw bottles to kill Boxies.\", \"Level instructions:\", JOptionPane.PLAIN_MESSAGE);\n \n // make some boxies\n Boxy boxy1 = new Boxy(game);\n boxy1.setName(\"boxy1\");\n Vec2 vec1 = new Vec2(100, 0);\n boxy1.move(vec1);\n\n Boxy boxy2 = new Boxy(game);\n boxy2.setName(\"boxy2\");\n Vec2 vec2 = new Vec2(-100, 200);\n boxy2.move(vec2);\n\n Boxy boxy3 = new Boxy(game);\n boxy3.setName(\"boxy3\");\n Vec2 vec3 = new Vec2(-400, 200);\n boxy3.move(vec3);\n \n }", "public void runAll() {\n GameObjectManager.instance.runAll();\n }", "void go() {\n update();\n render();\n}", "public interface Player {\n /**\n * has to be implemented\n * wird von update() in Game aufgerufen.\n * @return eine der Actions aus Rules.getActionsTileMove()\n */\n GameState requestActionTile();\n /**\n * has to be implemented\n * wird von update() in Game aufgerufen.\n * @return eine der Actions aus Rules.getActionsGamePieceMove()\n */\n GameState requestActionGamePiece();\n\n /**\n * has to be implemented\n * wird von update() aufgerufen.\n * @param gameState aktueller GameState\n */\n void updateGameState(GameState gameState);\n\n GameState getGameState();\n\n /**\n * has to be implemented\n * @return the color of the Player\n */\n Color getColor();\n\n void setRules(Rules rules);\n Rules getRules();\n\n void setName(String name);\n String getName();\n\n void setThread(ThreadUpdate thread);\n void setSynchronizer(Object synchronizer);\n\n /**\n * wird von update aufgerufen, sobald ein anderer Spieler eine Karte gewinnt.\n * @param color Farbe des Spielers, der eine Karte gewonnen hat\n * @param symbol auf dieser Karte\n */\n void notifyWonCards(Color color, Symbol symbol);\n\n /**\n * legt die Karte ganz oben auf dem Stapel, die der Spieler als nächstes gewinnen muss fest.\n * Wird von Game_Impl aufgerufen um dem Player seine Karte mitzuteilen\n * @param symbol neue zu erreichende Karte/Symbol\n */\n void setActiveCard(Symbol symbol);\n\n /**\n * has to be implemented\n * @return the activeCard, that was set by Game_Impl\n */\n Symbol getActiveCard();\n\n\n /**\n * creates new instance of chosen player\n *\n * Correct place to add new and more KI players!\n *\n * @param className name of the class to create an instance of\n * @param color chosen color for a player\n * @return new instance of playerclass\n */\n static Player createNewPlayer(String className, Color color) throws IllegalArgumentException {\n switch (className) {\n case \"PlayerKI\":\n return new PlayerKI(color);\n case \"PlayerKI2\":\n return new PlayerKI2(color);\n case \"PlayerKI3\":\n return new PlayerKI3(color);\n case \"PlayerKI4\":\n return new PlayerKI4(color);\n case \"PlayerHuman\":\n return new PlayerPhysical(color);\n default:\n throw new IllegalArgumentException(\"createNewPlayer in Player.java doesn't know how to handle this!\");\n }\n }\n}", "@Override\n\tpublic void update(GameContainer gc) {\n\t\t\n\t}", "protected void updateGameState() {\n }", "public GameScreen() {\n\n\t\tint midPointY = (int) (Const.GAME_HEIGHT / 2);\n\n\t\tworld = new GameWorld(midPointY);\n\t\trenderer = new GameRenderer(world);\n\n\t\tGdx.input.setInputProcessor(new InputHandler(world.getVentilatorUp(), world.getVentilatorDown()));\n\t\t// Gdx.input.setInputProcessor(new\n\t\t// InputHandler(world.getVentilatorTwo()));\n\t}", "@Override\r\n\tpublic void updateGameFinished() {\n\t\t\r\n\t}", "private void start() {\n GameStateManager gameStateManager = new GameStateManager();\n JPanel jPanel = gameStateManager.getGameState().getJPanel();\n jPanel.setVisible(true);\n GUI gui = GUI.getInstance();\n gui.setjPanel(jPanel);\n gui.addKeyListener(gameStateManager);\n GameStateObserver gameStateObserver = new GameStateObserver(gameStateManager,gui);\n gameStateManager.addObserver(gameStateObserver);\n }", "public void reset() {\r\n\r\n\t\tassets.allocateMusic(\"audio/SomniTrack.mp3\");\r\n\t\tassets.allocateMusic(\"audio/PhobiaTrack.mp3\");\r\n\t\tassets.allocateMusic(\"audio/CombinedTrack.mp3\");\r\n//\t\tJsonValue sounds = assets.get(\"sounds\");\r\n//\t\tsomniTrackPath = sounds.get(\"somniTrack\").asString();\r\n//\t\tphobiaTrackPath = sounds.get(\"phobiaTrack\").asString();\r\n//\t\tcombinedTrackPath = sounds.get(\"combinedTrack\").asString();\r\n\r\n\t\tsomniTrackPath = \"audio/SomniTrack.mp3\";\r\n\t\tphobiaTrackPath = \"audio/PhobiaTrack.mp3\";\r\n\t\tcombinedTrackPath = \"audio/CombinedTrack.mp3\";\r\n\r\n\t\tgameScreenActive = true;\r\n\t\tVector2 gravity = new Vector2(world.getGravity() );\r\n\t\tfor(Obstacle obj : objects) {\r\n\t\t\tobj.deactivatePhysics(world);\r\n\t\t}\r\n\t\tfor(Obstacle obj : sharedObjects) {\r\n\t\t\tobj.deactivatePhysics(world);\r\n\t\t}\r\n\t\tfor(Obstacle obj : darkObjects) {\r\n\t\t\tobj.deactivatePhysics(world);\r\n\t\t}\r\n\t\tfor(Obstacle obj : lightObjects) {\r\n\t\t\tobj.deactivatePhysics(world);\r\n\t\t}\r\n\t\tobjects.clear();\r\n\t\tsharedObjects.clear();\r\n\t\tlightObjects.clear();\r\n\t\tdarkObjects.clear();\r\n\t\tmovingObjects.clear();\r\n\t\tplatformController.currRainingPlatforms.clear();\r\n\t\tplatformController.respawningPlatforms.clear();\r\n\t\taddQueue.clear();\r\n\t\tworld.dispose();\r\n\t\tdisposeStages();\r\n\r\n\t\tworld = new World(gravity,false);\r\n\t\tsetComplete(false);\r\n\t\tsetFailure(false);\r\n\t\tfirstTimeRendered=true;\r\n\t\tpopulateLevel();\r\n\r\n\t\tcamera = canvas.getCamera();\r\n\t\tpauseButtonStage = new Stage(new ScreenViewport(camera));\r\n\t\tpauseMenuStage = new Stage(new ScreenViewport(camera));\r\n\t\tstage = new Stage(new ScreenViewport(camera));\r\n\t\twinMenuStage = new Stage(new ScreenViewport(camera));\r\n\t\tfailMenuStage = new Stage(new ScreenViewport(camera));\r\n\r\n\t\tCamera camera = canvas.getCamera();\r\n\t\tVector2 leadPos = somni.getPosition();\r\n\t\tfloat newX = leadPos.x * canvas.PPM;\r\n\t\tnewX = Math.min(newX, widthUpperBound);\r\n\t\tnewX = Math.max(canvas.getWidth() / 2, newX );\r\n\t\tcamera.position.x = newX;\r\n\r\n\t\tfloat newY = leadPos.y * canvas.PPM;\r\n\t\tnewY = Math.min(newY, heightUpperBound);\r\n\t\tnewY = Math.max(canvas.getHeight() / 2, newY );\r\n\t\tcamera.position.y = newY;\r\n\r\n\t\tcamera.update();\r\n\r\n\t\tholdingHands = false;\r\n\r\n\t\tmovementController = new MovementController(somni, phobia, combined, goalDoor, objects, sharedObjects,\r\n\t\t\t\tlightObjects, darkObjects, this);\r\n\t\tmovementController.setCurrRainingPlatforms(currRainingPlatforms);\r\n\t\tworld.setContactListener(movementController);\r\n\r\n\t\tmovementController.setAvatar(somni);\r\n\t\tmovementController.setLead(somni);\r\n\r\n\t\tcreateModalWindow(camera.position.x, camera.position.y);\r\n\t\tcreatePauseButton();\r\n\t\tcreateSliders();\r\n\t\tcreateFailWindow(camera.position.x, camera.position.y);\r\n\t\tcreateWinWindow(camera.position.x, camera.position.y);\r\n\r\n\r\n\t\tplatformController.setMovingObjects(movingObjects);\r\n\t\tplatformController.setLightObjects(lightObjects);\r\n\t\tplatformController.setDarkObjects(darkObjects);\r\n\t\tplatformController.setSharedObjects(sharedObjects);\r\n\t\tplatformController.setCurrRainingPlatforms(currRainingPlatforms);\r\n\r\n\t\tmaskLeader = phobia;\r\n\t\tswitching = false;\r\n\t\tmaskWidth = MIN_MASK_DIMENSIONS.x;\r\n\t\tmaskHeight = MIN_MASK_DIMENSIONS.y;\r\n\t\talphaAmount = 0;\r\n\r\n\r\n\t\tif(!MusicController.getInstance().isActive(\"somniTrack\")) {\r\n\t\t\tMusicController.getInstance().stopAll();\r\n\t\t\tSoundController.getInstance().stop(\"failTrack\");\r\n\t\t\tSoundController.getInstance().stop(\"winTrack\");\r\n\t\t\tMusicController.getInstance().play(\"somniTrack\", somniTrackPath, volume, true);\r\n\t\t\tMusicController.getInstance().play(\"phobiaTrack\", phobiaTrackPath, 0, true);\r\n\t\t\tMusicController.getInstance().play(\"combinedTrack\", combinedTrackPath, 0, true);\r\n\r\n\t\t}\r\n\r\n\t\tif (movementController.isHoldingHands()){\r\n\t\t\tMusicController.getInstance().setVolume(volume, \"combinedTrack\");\r\n\t\t}\r\n\t\telse if (movementController.getAvatar()==somni){\r\n\t\t\tMusicController.getInstance().setVolume(volume, \"somniTrack\");\r\n\t\t}\r\n\t\telse if (movementController.getAvatar()==phobia){\r\n\t\t\tMusicController.getInstance().setVolume(volume, \"phobiaTrack\");\r\n\t\t}\r\n\r\n\r\n\t}", "public void update()\n\t{\n\t\t//\tTHE WORLD HAS ENDED DO NOT EXECUTE FURTHER\n\t\tif( end )\n\t\t{\n\t\t\tsafeEnd = true;\n\t\t\treturn;\n\t\t}\n\n\t\t//Plot graphics\n\t\tif(plot){\n\t\t\thealthyFunction.show(infectedFunction, healthyFunction);\n\t\t\tbusFunction.show(infectedFunction, seasFunction, busFunction, colFunction, ellFunction, smpaFunction, lawFunction);\n\t\t\tplot = false;\n\t\t}\n\n\t\t//\tsafe point to manage human/zombie ratios\n\t\t//\tTODO: Modify infect to also switch zombies to humans\n\t\tinfect();\n\t\tgetWell();\n\t\taddFromQueue();\n\n\t\t//\tupdate all entities\n\t\tfor( Zombie z: zombies )\n\t\t{\n\t\t\tz.update(zombiesPaused);\n\t\t}\n\t\tfor( Entity h: humans )\n\t\t{\n\t\t\th.update(humansPaused);\n\t\t}\n\n\t\tif( zc!=zombies.size() || hc!=humans.size() )\n\t\t{\n\t\t\tzc = zombies.size();\n\t\t\thc = humans.size();\n\t\t\tSystem.out.println(zc+\"/\"+hc);\n\t\t}\n\n\t\t//Add points to our functions\n\t\thealthyFunction.add(time,humans.size());\n\t\tinfectedFunction.add(time,zombies.size());\n\t\tseascount = smpacount = ellcount = lawcount = buscount = colcount = 0;\n\t\tfor (int i = 0; i < humans.size(); i++) {\n\t\t\tEntity curr = humans.get(i);\n\t\t\tif (curr instanceof SEAS) {\n\t\t\t\tseascount++;\n\t\t\t} else if (curr instanceof SMPA) {\n\t\t\t\tsmpacount++;\n\t\t\t} else if (curr instanceof Elliot) {\n\t\t\t\tellcount++;\n\t\t\t} else if (curr instanceof Law) {\n\t\t\t\tlawcount++;\n\t\t\t} else if (curr instanceof Business) {\n\t\t\t\tbuscount++;\n\t\t\t} else if (curr instanceof Columbian) {\n\t\t\t\tcolcount++;\n\t\t\t}\n\t\t}\n\t\tbusFunction.add(time, buscount);\n\t\tcolFunction.add(time, colcount);\n\t\tellFunction.add(time, ellcount);\n\t\tlawFunction.add(time, lawcount);\n\t\tsmpaFunction.add(time, smpacount);\n\t\tseasFunction.add(time, seascount);\n\t\ttime++;\n\t}", "@Override\n public void startState() {\n Spell.clear();\n initGoldRenderers();\n initBackground();\n startBattleState();\n isOver = false;\n }", "@Override\n public void init(GameContainer gc, StateBasedGame stateBasedGame) throws SlickException {\n //Clear all all objects & add them again\n objects.clear();\n objects.add(new Tower());\n objects.add(new Player());\n objects.add(new Enemy());\n\n //Clear the lists\n bulletList.clear();\n enemies.clear();\n basicTowers.clear();\n sniperTowers.clear();\n quickTowers.clear();\n bomberTowers.clear();\n\n //Set the variables when the state is initialized\n enemyCounter = 10;\n enemyHPCounter = 5;\n currentLevel = 0;\n sellTower = false;\n upgradePressed = false;\n timePassedEnemy = 0;\n\n //Loads this seperate, else the map is over-riding all drawn during the game\n loadMap.init(gc, stateBasedGame);\n\n //Run init for all objects\n for (GameObject obj : objects) {\n obj.init(gc, stateBasedGame);\n }\n\n java.awt.Font font = new java.awt.Font(\"Agency FB\", java.awt.Font.BOLD, 16);\n pauseFont = new TrueTypeFont(font,false);\n\n }", "public GameEnvironment() {\r\n this.collidables = new ArrayList<Collidable>();\r\n }", "public GameMain()\n {\n allenBad = new AllenSucks(this);\n }", "public void play() {\n List<String> playersData = getGameInput().getPlayersData();\n for (int id = 0; id < playersData.size() / Constants.DATAENTITY; id++) {\n getHeroes().add(getHeroFactory().getHero(\n playersData.get(id * Constants.DATAENTITY),\n Integer.parseInt(\n playersData.get(\n id * Constants.DATAENTITY\n + Constants.INDEXPOSX)),\n Integer.parseInt(\n playersData.get(\n id * Constants.DATAENTITY\n + Constants.INDEXPOSY)),\n id));\n }\n // We create the angels and add them to angels list.\n List<Integer> numOfAngels = getGameInput().getNumOfAngels();\n List<String> angelsData = getGameInput().getAngelsData();\n for (int i = 0; i < angelsData.size() / Constants.DATAENTITY; i++) {\n getAngels().add(getAngelsFactory().getAngel(\n angelsData.get(i * Constants.DATAENTITY),\n Integer.parseInt(\n angelsData.get(\n i * Constants.DATAENTITY\n + Constants.INDEXPOSX)),\n Integer.parseInt(\n angelsData.get(\n i * Constants.DATAENTITY\n + Constants.INDEXPOSY))));\n }\n\n getUtl().prepareAdmins();\n\n int angelCounter = 0; // To iterate through all angels only once.\n // We start the actual game.\n for (int i = 0; i < getMovements().size(); i++) { // For every round.\n\n getUtl().printRound(i + 1); // We start printing from round 1...\n\n for (int j = 0; j < getHeroes().size(); j++) {\n /* Apply overtime ability if the case and then hero chooses\n * strategy and moves if he is not rooted. Lastly we decrease\n * the amount of rounds that a hero must be affected by. */\n if (!getHeroes().get(j).isDead()) {\n if (getHeroes().get(j).isAffectedByAoT()) {\n getUtl().applyAoT(getHeroes().get(j));\n }\n if (!getHeroes().get(j).isRooted()) {\n getHeroes().get(j).chooseStrategy();\n getHeroes().get(j).move(getMovements().get(i).get(j));\n }\n if (getHeroes().get(j).isAffectedByAoT()) {\n getHeroes().get(j).setAffectedByAoTRounds(\n getHeroes().get(j).getAffectedByAoTRounds()\n - 1);\n }\n }\n }\n\n // Check if there are any players on the same terrain.\n for (int j = 0; j < getHeroes().size(); j++) {\n for (int k = 0; k < getHeroes().size(); k++) {\n if (k == j) {\n continue; // So a hero doesn't fight himself.\n }\n if ((getHeroes().get(j).getPosX()\n == getHeroes().get(k).getPosX())\n && (getHeroes().get(j).getPosY()\n == getHeroes().get(k).getPosY())) {\n // If they are both alive, fight.\n if (!getHeroes().get(j).isDead()\n && !getHeroes().get(k).isDead()) {\n getUtl().fight(getHeroes().get(k),\n getHeroes().get(j), getMap());\n }\n }\n }\n }\n\n // Selecting the angels that appear on round i\n for (int j = 0; j < numOfAngels.get(i); j++) {\n getUtl().spawnAngel(getAngels().get(angelCounter));\n for (int k = 0; k < getHeroes().size(); k++) {\n /* Checking if the selected angel and player k are on the\n * same terrain. */\n if (getAngels().get(angelCounter).getPosX()\n == getHeroes().get(k).getPosX()\n && (getAngels().get(angelCounter).getPosY()\n == getHeroes().get(k).getPosY())) {\n getUtl().affectHeroByAngel(\n getAngels().get(angelCounter),\n getHeroes().get(k));\n }\n }\n angelCounter++;\n }\n\n // When round is complete, everyone can fight again\n for (AbstractHero hero : getHeroes()) {\n hero.setFought(false);\n }\n getUtl().getOutput().add(\"\\n\");\n }\n printResults();\n }", "@Override\r\n\tpublic void gameLoopLogic(double time) {\n\r\n\t}", "@Override\r\n\tpublic void Update() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void Update() {\n\t\t\r\n\t}", "@Override\n public void afterWorldInit() {\n }", "public void initGui() {\n/* 27 */ super.initGui();\n/* 28 */ updateActivePotionEffects();\n/* */ }", "private void startGame() {\n\t\tentities.clear();\n\t\tinitEntities();\n\t\t\n\t\t// blank out any keyboard settings we might currently have\n\t\tleftPressed = false;\n\t\trightPressed = false;\n\t\tfirePressed = false;\n\t}", "public void frame() {\r\n\r\n\r\n\t\t//this will solves a thread issue, to do FX application stuff in a non FX application thread. \r\n\t\tPlatform.runLater(() -> {\r\n\r\n\t\t\tif (Player.isBattle()) {\r\n\r\n\t\t\t\tPlayer.setVelX(0);\r\n\t\t\t\tPlayer.setVelY(0);\r\n\t\t\t\tmainStage.setScene(combatScene);\r\n\r\n\t\t\t} else if (Player.isShop()) {\r\n\t\t\t\tmainStage.setScene(shopScene);\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tcircle.setFill(getColor());\r\n\t\t\t\tmainStage.setScene(mainScene);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\tgetMainScene().setOnKeyPressed(e -> {\r\n\t\t\tPlayer.move(e);\r\n\t\t});\r\n\r\n\t\tgetMainScene().setOnKeyReleased(e -> {\r\n\t\t\tPlayer.stop(e);\t\r\n\t\t});\r\n\r\n\t\tPlayer.update();\r\n\t\tposition();\r\n\t}", "public void initGameModeChoice() {\n\t\tWorld.clear();\n\t\tstate = STATE.MENU;\n\t\tinitBackground();\n\t\tWorld.add(new Logo(Screen.getCenterX() - Logo.WIDTH / 2, Screen\n\t\t\t\t.getHeight() * 3 / 4 - Logo.HEIGHT / 2));\n\t\tWorld.add(new SinglePlayerButton(Screen.getCenterX()\n\t\t\t\t- StartButton.WIDTH / 2, Screen.getHeight() * 3 / 8\n\t\t\t\t- StartButton.HEIGHT / 2, this));\n\t\tWorld.add(new MultiPlayerButton(Screen.getCenterX() - StartButton.WIDTH\n\t\t\t\t/ 2, Screen.getHeight() * 2 / 8 - StartButton.HEIGHT / 2, this));\n\t\tWorld.add(new TextStatic(footerText, Screen.getCenterX()\n\t\t\t\t- footerText.length() * Sprite.CHAR_WIDTH / 2,\n\t\t\t\tSprite.CHAR_HEIGHT, Color.yellow));\n\n\t}", "void selfUpdate();", "public void startNewGame();", "public void initMultiPlayer() {\n\t\tWorld.clear();\n\t\tstate = STATE.MENU;\n\t\tconfig[0] = new PlayerConfig(\"LEFTIE\", Keyboard.KEY_W, Keyboard.KEY_S,\n\t\t\t\tKeyboard.KEY_D, 0);\n\t\tconfig[1] = new PlayerConfig(\"RIGHTIE\", Keyboard.KEY_UP,\n\t\t\t\tKeyboard.KEY_DOWN, Keyboard.KEY_LEFT, 1);\n\n\t\tbat1 = new Bat(100, Screen.getCenterY() - Bat.HEIGHT / 2, config[0]);\n\n\t\tbat2 = new Bat(Screen.getWidth() - 100, Screen.getCenterY()\n\t\t\t\t- Bat.HEIGHT / 2, config[1]);\n\t\tfetchControlInput(config[0], new Callback() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tWorld.clear();\n\t\t\t\tfetchControlInput(config[1], new Callback() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tinitGame();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "public Game() {\r\n\r\n\t\tmakeFrame();\r\n\t\tisClicked = false;\r\n\t\tisPlaying = false;\r\n\t\tlevelEasy = true;\r\n\t\tlevelIntermediate = false;\r\n\t\tlevelHard = false;\r\n\t\tplayerScore = 0;\r\n\r\n\t}", "void game_setup(){\n game_text_setup();\n ship_setup();\n alien_setup();\n timer.start(); // this timer will be stopped automatically by JavaFX when the program terminates\n }", "void newGame() {\n\t\tstate = new model.State () ; \n\t\tif(host != null ) host.show(state) ; \n\t}", "private void buildWorld() {\r\n\t\tremoveAll();\r\n\t\tintro = null;\r\n\t\tfacingEast = true;\r\n\t\t\r\n\t\taddLevels();\r\n\t\taddCharacters();\r\n\t\taddLifeDisplay();\r\n\t}", "private void init(){\n \tdimension.set(0.5f, 0.5f);\n \tsetAnimation(Assets.instance.goldCoin.animGoldCoin);\n \tstateTime = MathUtils.random(0.0f,1.0f);\n \t\n \t//regGoldCoin = Assets.instance.goldCoin.goldCoin;\n \t // Set bounding box for collision detection\n \tbounds.set(0,0,dimension.x, dimension.y);\n \tcollected = false;\n }", "public Othello() {\n\t\tmyBoard = new Board(8);\n\t\tplayerBlack = spawnPlayer(Color.BLACK);\n\t\tplayerWhite = spawnPlayer(Color.WHITE);\n\t\tpropertySupport = new PropertyChangeSupport(this);\n\t\tinitialisationBoard();\n\t\tcurrentPlayer = playerBlack;\n\t\tfoeHasPlay = true;\n\t\taiPlay = false;\n\t}", "public void run() {\n\n\t\t\t\tgetHelmetDetails().material = getRandomMaterial();\n\t\t\t\tgetHelmetMoreDetails().material = getRandomMaterial();\n\n\t\t\t\t// bonus points:\n\t\t\t\t// randomly change the material of the helmet base to a texture\n\t\t\t\t// from the files aloha.png and camouflage.png (or add your own!)\n\t\t\t\tgetHelmetBase().material = getRandomMaterial();\n\t\t\t\tsetRandomLight();\n\n\t\t\t}", "public void init() {\n\t\tfor(int i = 0; i < roamingAliens; ++i) {\n\t\t\tAlien alien = new Alien(ColorUtil.MAGENTA, screenHeight, screenWidth, speed, speedMulti);\n\t\t\tgameObject.add((GameObject) alien); \n\t\t}\n\t\tfor(int i = 0; i < roamingAstronauts; ++i) {\n\t\t\tAstronaut astronaut = new Astronaut(ColorUtil.GREEN, screenHeight, screenWidth, speed, speedMulti);\n\t\t\tgameObject.add((GameObject) astronaut);\n\t\t}\n\t\tgameObject.add((Spaceship.getSpaceship()));\n\t\tthis.setChanged();\n\t\tthis.notifyObservers();\n\t\tthis.clearChanged();\n\t}", "private void init() {\n\t\t\n\t\tdisplay = new Display(title, width, height);\n\t\tdisplay.getFrame().addKeyListener(keyManager);\n\t\tdisplay.getFrame().addMouseListener(mouseManager);\n\t\tdisplay.getFrame().addMouseMotionListener(mouseManager);\n\t\t\n\t\t//Adding the mouseManager to the canvas reduces glitches\n\t\tdisplay.getCanvas().addMouseListener(mouseManager); \n\t\tdisplay.getCanvas().addMouseMotionListener(mouseManager);\n\t\t\n\t\t\n\t\tVisuals.init();\n\n\t\tManager.init(this); // Setting up our manager singleton\n\n\t\tgameCamera = new GameCamera(0, 0);\n\t\tgameTimer = new GameTimer();\n\n\t\tgameState = new GameState();\n\t\t//We want to initialise the states we may switch to for easy access\n\t\t//The main menu state\n\t\tState menuState = new MenuState();\n\t\t//The state for the settings menu\n\t\tState settingState = new SettingState();\n\t\t\n\t\tState.setState(gameState); //This sets the state of the program to our game\n\t\t\n\t}", "void updateEnemies() {\n getEnemies().forEach(e -> {\n if (!e.isAlive()) {\n e.die();\n SoundPlayer.play(SoundPlayer.enemyDestroyed);\n }\n });\n objectsInMap.removeIf(o -> o instanceof Enemy && !(((Enemy) o).isAlive()));//Removing Dead Enemies\n getEnemies().forEach(e -> e.setTarget(objectsInMap.stream().filter(p -> p.identifier.contains(\"PlayerTank0.\") &&\n p.isBlocking && ((Tank) p).isVisible()).collect(Collectors.toList())));//Giving Possible target to enemies to decide\n }", "public void run() {\r\n\t\ttargets = new Hashtable();\r\n\t\ttarget = new Enemy();\r\n\t\ttarget.distance = 100000;\r\n\t\tsetBodyColor(Color.ORANGE);\r\n\t\t// the next two lines mean that the turns of the robot, gun and radar\r\n\t\t// are independant\r\n\t\tsetAdjustGunForRobotTurn(true);\r\n\t\tsetAdjustRadarForGunTurn(true);\r\n\t\tturnRadarRightRadians(2 * PI); // turns the radar right around to get a\r\n\t\t\t\t\t\t\t\t\t\t// view of the field\r\n\t\twhile (true) {\r\n\t\t\tmove();\r\n\t\t\tdoFirePower(); // select the fire power to use\r\n\t\t\tdoScanner(); // Oscillate the scanner over the bot\r\n\t\t\tdoGun();\r\n\t\t\tout.println(target.distance); // move the gun to predict where the\r\n\t\t\t\t\t\t\t\t\t\t\t// enemy will be\r\n\t\t\tfire(firePower);\r\n\t\t\texecute(); // execute all commands\r\n\t\t}\r\n\t}", "private TetrisMain() {\r\n //ensure uninstantiability\r\n }", "@Override\n public void loadGame() {\n\n }", "public interface IGameLogic {\n /**\n * An object that implements the IGameLogic interface\n * has the init method called before the main game loop\n * is started.\n * <p>\n * This method is intended to handle all startup operations.\n * @param window - the game window\n * @throws Exception\n */\n void init(Window window) throws Exception;\n\n /**\n * An object that implements the IGameLogic interface\n * has the input method called once every frame in the\n * main game loop.\n * <p>\n * This method is intended to handle all user\n * inputs.\n * <p>\n * Note: GameEngine handles the InputHandler init and\n * update methods. They do not need to be called by the\n * game logic.\n * @param window - the game window\n * @param inputHandler - the InputHandler for the game window\n * @throws Exception\n */\n void input(Window window, InputHandler inputHandler) throws Exception;\n\n /**\n * An object that implements the IGameLogic interface\n * has the update method called at the UPS interval.\n * <p>\n * This method is intended for all time sensitive game logic that must\n * run on a consistent interval.\n * @param interval - the interval at which the method is called, \n * in seconds\n * @param window - the game window\n * @throws Exception\n */\n void update(float interval, MouseInput mouseInput, Window window) throws Exception;\n\n /**\n * An object that implements the IGameLogic interface\n * has the render method called once every frame in the\n * main game loop.\n * <p>\n * This method is intended to handle all rendering\n * operations.\n * @param window\n * @throws Exception\n */\n void render(Window window) throws Exception;\n\n /**\n * An object that implements the IGameLogic interface\n * has the cleanUp method called during the termination\n * of the game engine.\n * <p>\n * This method is intended to handle the\n * cleaning/freeing of all memory, shaders, etc. that are\n * not handled by the JVM.\n */\n void cleanUp();\n}", "public GameController() {\r\n\t\tsuper();\r\n\t\tthis.model = Main.getModel();\r\n\t\tthis.player = this.model.getPlayer();\r\n\t\tthis.timeline = this.model.getIndefiniteTimeline();\r\n\t}", "public gameWorld()\n { \n // Create a new world with 600x600 cells with a cell size of 1x1 pixels.\n super(600, 600, 1); \n \n addObject(new winSign(), 310, 300);\n addObject(new obscureDecorative(), 300, 400);\n addObject(new obscureDecorative(), 300, 240);\n \n for(int i = 1; i < 5; i++) {\n addObject(new catchArrow(i * 90), 125 * i, 100);\n }\n for (int i = 0; i < 12; i++) {\n addObject(new damageArrowCatch(), 50 * i + 25, 50); \n }\n \n \n //Spawning Interval\n\n if(timerInterval >= 10) {\n arrowNumber = Greenfoot.getRandomNumber(3);\n }\n if(arrowNumber == 0) {\n addObject(new upArrow(directionOfArrow[0], imageOfArrow[0]), 125, 590);\n arrowNumber = 5;\n }\n if(arrowNumber == 1) {\n addObject(new upArrow(directionOfArrow[1], imageOfArrow[1]), 125 * 2, 590);\n arrowNumber = 5;\n }\n if(arrowNumber == 2) {\n addObject(new upArrow(directionOfArrow[2], imageOfArrow[2]), 125 * 3, 590);\n arrowNumber = 5;\n }\n if( arrowNumber == 3) {\n addObject(new upArrow(directionOfArrow[3], imageOfArrow[3]), 125 * 4, 590);\n arrowNumber = 5;\n }\n \n \n\n \n }", "private void Level1() {\n\t\tEngine eng = new Engine();\n\t\teng.Maingame();\n\t\tthis.setVisible(false);\n\t}", "public void beginGame() {\r\n data.gameState = 3;\r\n data.gameStartFlag = true;\r\n setChanged();\r\n notifyObservers(data);\r\n data.gameStartFlag = false; //Set the gameStart flag to false so the relevant update lines aren't ever run a second time\r\n }", "private void constructionPhase() {\n for( final Player p : playerList ) {\n this.player = p;\n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n\n ClickObserver.getInstance().setTerrainFlag(\"\");\n ClickObserver.getInstance().setClickedTerrain(player.getHexesOwned().get(0));\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Board.applyCovers();\n GUI.getRackGui().setOwner(player);\n GUI.getHelpText().setText(\"Construction Phase: \" + p.getName() \n + \", select one of your tiles to build a new tower, or upgrade an existing one.\");\n ClickObserver.getInstance().whenTerrainClicked();\n }\n });\n\t\t\ttry { Thread.sleep(500); } catch( Exception e ){ return; }\n ClickObserver.getInstance().setTerrainFlag(\"Construction: ConstructFort\");\n ArrayList<Terrain> ownedHexes = player.getHexesOwned();\n for (final Terrain t : ownedHexes) {\n if (t.getOwner().getName().equals(player.getName())) {\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n t.uncover();\n }\n });\n }\n }\n while( isPaused ){\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n player.flipAllDown();\n }\n ClickObserver.getInstance().setTerrainFlag(\"\");\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Board.removeCovers();\n }\n });\n }", "public void gameUpdate() {\n\t\t\n\t\t// Remember our homeTilePosition at the first frame\n\t\tif (bwapi.getFrameCount() == 1) {\n\t\t\tint cc = BuildManager.getInstance().getNearestUnit(UnitTypes.Terran_Command_Center.ordinal(), 0, 0);\n\t\t\tif (cc == -1) cc = BuildManager.getInstance().getNearestUnit(UnitTypes.Zerg_Hatchery.ordinal(), 0, 0);\n\t\t\tif (cc == -1) cc = BuildManager.getInstance().getNearestUnit(UnitTypes.Protoss_Nexus.ordinal(), 0, 0);\n\t\t\thomePositionX = bwapi.getUnit(cc).getX();\n\t\t\thomePositionY = bwapi.getUnit(cc).getY();\n\t\t\n\t\t\tResourceManager.getInstance().gameStart(bwapi.getMyUnits());\n\t\t}\n\t\t\n\t\t/*\n\t\tif(ResourceManager.getInstance().numWorkers() == 10 && ScoutManager.getInstance().numScouts() == 0) {\n\t\t\tbwapi.printText(\"Assigning a scout\");\n\t\t\tneedsScout();\n\t\t}\n\t\t*/\n\t\t\n\t\tfor (Manager manager : managers.values())\n\t\t\tmanager.gameUpdate();\n\t\t\n\t\t// Draw debug information on screen\n\t\tdrawDebugInfo();\n\n\t\t\n\t\t// Call the act() method every 30 frames\n\t\tif (bwapi.getFrameCount() % 30 == 0) {\n\t\t\tact();\n\t\t}\n\t}", "@Override\n public void next(){\n balls.translate();\n majGui();\n }", "public void actualGame(Stage gameStage){\r\n\t\tsetStartConditions();\r\n\t\tGroup gamePane = new Group(player1, coins1, enemy1, moneycounter, portal1, portal2);\r\n\t\tScene gameScene = new Scene(gamePane, 46*20, 85*10);\r\n\r\n\r\n\t\t//starts moving player, added links to sprites of player facing different directions\r\n\t\t//not sure how to implement them yet\r\n\t\tgameScene.setOnKeyPressed(new EventHandler<KeyEvent>() {\r\n\t\t\tpublic void handle(KeyEvent pressed){\r\n\r\n\r\n\t\t\t\tif(pressed.getCode() == KeyCode.W){\r\n\t\t\t\t\twhichDirection = Direction.UP;\r\n\t\t\t\t}\r\n\t\t\t\telse if(pressed.getCode() == KeyCode.A){\r\n\t\t\t\t\twhichDirection = Direction.LEFT;\r\n\t\t\t\t}\r\n\t\t\t\telse if(pressed.getCode() == KeyCode.S){\r\n\t\t\t\t\twhichDirection = Direction.DOWN;\r\n\t\t\t\t}\r\n\t\t\t\telse if(pressed.getCode() == KeyCode.D){\r\n\t\t\t\t\twhichDirection = Direction.RIGHT;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t);\r\n\r\n\t\t// stops the player once key is released\r\n\t\tgameScene.setOnKeyReleased(new EventHandler<KeyEvent>(){\r\n\t\t\tpublic void handle(KeyEvent lifted){\r\n\t\t\tif(lifted.getCode()== KeyCode.W){\r\n\t\t\t\twhichDirection = Direction.NONE;\r\n\t\t\t}\r\n\t\t\telse if(lifted.getCode()== KeyCode.A){\r\n\t\t\t\twhichDirection = Direction.NONE;\r\n\t\t\t}\r\n\t\t\telse if(lifted.getCode()== KeyCode.S){\r\n\t\t\t\twhichDirection = Direction.NONE;\r\n\t\t\t}\r\n\t\t\telse if(lifted.getCode()== KeyCode.D){\r\n\t\t\t\twhichDirection = Direction.NONE;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\twhichDirection = Direction.NONE;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t});\r\n\r\n\t\tmoneycounter.setStyle(\"-fx-font-size: 40px;\");\r\n\t\tgameStage.setTitle(\"Try Not to Die Simulator\");\r\n\t\tgameStage.setScene(gameScene);\r\n\t\tgameStage.show();\r\n\r\n\t\t//determines speed of player\r\n\t\tAnimationTimer timer = new AnimationTimer() {\r\n\t\t\tprivate long lastMapUpdate = 0;\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic void handle(long now) {\r\n\t\t\t\t\t\tif(now - lastMapUpdate >= 28_000_000){\r\n\t\t\t\t\t int x = 0;\r\n\t\t\t\t\t int y = 0;\r\n\t\t\t\t\t if (whichDirection != Direction.NONE) {\r\n\r\n\t\t\t\t\t\t Direction enemyMove = gamemap.getEnemy().getMove(gamemap.getPlayer());\r\n\t\t\t\t\t\t isItValid = gamemap.isEnemyValid(gamemap.getEnemy(), enemyMove);\r\n\t\t\t\t\t\t if (isItValid == 2) {\r\n\t\t\t\t\t\t\t gamemap.moving(enemyMove, false);\r\n\t\t\t\t\t\t\t x = gamemap.getEnemy().getX();\r\n\t\t\t\t\t\t\t y = gamemap.getEnemy().getY();\r\n\t\t\t\t\t\t\t enemy1.relocate(x*46 - 46, y*85 - 85);\r\n\r\n\t\t\t\t\t\t } else if (isItValid == 3) {\r\n\t\t\t\t\t\t\t //setStartConditions();\r\n\t\t\t\t\t\t\t gamemap.stop();\r\n\t\t\t\t\t\t\t gameStage.close();\r\n\t\t\t\t\t\t\t gameOver(deadStage);\r\n\t\t\t\t\t\t\t //System.out.println(\"Awww you got caught, try again next time.\");\r\n\t\t\t\t\t\t }\r\n\r\n\t\t\t\t\t\t int isItValid = gamemap.isPlayerValid(gamemap.getPlayer(), whichDirection);\r\n\t\t\t\t\t\t if (isItValid == 2) {\r\n\t\t\t\t\t\t\t gamemap.moving(whichDirection, true);\r\n\t\t\t\t\t\t\t x = gamemap.getPlayer().getX();\r\n\t\t\t\t\t\t\t y = gamemap.getPlayer().getY();\r\n\t\t\t\t\t\t\t player1.relocate(x*46 - 46, y*85 - 85);\r\n\r\n\r\n\r\n\t\t\t\t\t\t } else if (isItValid == 1) {\r\n\t\t\t\t\t\t\t counter++;\r\n\t\t\t\t\t\t\t moneycounter.setText(\"$: \" + Integer.toString(counter));\r\n\t\t\t\t\t\t\t //System.out.println(\"Congratulations you found a bag of gold!\");\r\n\t\t\t\t\t\t\t if(counter ==10) {\r\n\t\t\t\t\t\t\t gamemap.stop();\r\n\t\t\t\t\t\t\t gameStage.close();\r\n\t\t\t\t\t\t\t actualGame2(gameStage2);\r\n\t\t\t\t\t\t\t isItValid = 10;\r\n\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t setStartConditions();\r\n\t\t\t\t\t\t\t isItValid = 0;\r\n\t\t\t\t\t\t } else if(isItValid == 4) {\r\n\t\t\t\t\t\t\t //\t\tportal1.relocate(9*46, 9*85);\r\n\t\t\t\t\t\t\t //\t\tportal2.relocate(9*46, 0*85);\r\n\t\t\t\t\t\t\t\tif (gamemap.getPlayer().getY() != 10) {\r\n\t\t\t\t\t\t\t\t\tgamemap.setPlayerLocation(10, 10);\r\n\t\t\t\t\t\t\t\t\tplayer1.relocate(10*46, 10*85);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tgamemap.setPlayerLocation(10, 1);\r\n\t\t\t\t\t\t\t\t\tplayer1.relocate(10*46, 1*85);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\tgamemap.mapChecker();\r\n\t\t\t\t\t }\r\n\r\n\r\n\t\t\t\t\t lastMapUpdate = now;\r\n\t\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t};\r\n\t\t\ttimer.start();\r\n\r\n\t\t}", "private void movementPhase() {\n ClickObserver.getInstance().setCreatureFlag(\"\");\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getDoneButton().setDisable(false);\n TheCupGUI.update();\n Board.removeCovers();\n }\n });\n for (Player p : playerList) {\n \tplayer = p;\n player.flipAllUp();\n\t ClickObserver.getInstance().setActivePlayer(player);\n\t ClickObserver.getInstance().setCreatureFlag(\"Movement: SelectMovers\");\n\t InfoPanel.uncover(player.getName());\n\t if (p.getHexesWithPiece().size() > 0) {\n\t \tClickObserver.getInstance().setClickedTerrain(p.getHexesWithPiece().get(0));\n\t }\n\t pause();\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \tClickObserver.getInstance().whenTerrainClicked();\n \t GUI.getHelpText().setText(\"Movement Phase: \" + player.getName()\n + \", Move your armies\");\n \t Game.getRackGui().setOwner(player);\n }\n });\n\t \n\t while (isPaused) {\n \ttry { Thread.sleep(100); } catch( Exception e ){ return; } \n\t }\n\t InfoPanel.cover(player.getName());\n player.flipAllDown();\n }\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getDoneButton().setDisable(true);\n }\n });\n ClickObserver.getInstance().setCreatureFlag(\"\");\n }", "@Override\n\tpublic void init(GameContainer gc, StateBasedGame sb) throws SlickException {\n\t\t// background\n\t\t// creating background-entity\n\t\tEntity background = new Entity(Constants.MENU_ID);\n\t\tbackground.setPosition(new Vector2f((OptionsHandler.getWindow_x() / 2), (OptionsHandler.getWindow_y() / 2)));\n\t\tif (!Breakout.getDebug()) {\n\t\t\t// only if not in debug-mode\n\t\t\tbackground.addComponent(new ImageRenderComponent(new Image(ThemeHandler.MENU_BACKGROUND)));\n\t\t}\n\t\tbackground.setScale(Variables.BACKGROUND_SCALE); // scaling\n\t\t// giving StateBasedEntityManager the background-entity\n\t\tentityManager.addEntity(stateID, background);\n\n\t\t// listener entity\n\t\tEntity listener = new Entity(\"listener\");\n\t\tentityManager.addEntity(stateID, listener);\n\t\t// Loop event for various uses (controller input)\n\t\tLoopEvent listenerLoop = new LoopEvent();\n\t\tlistener.addComponent(listenerLoop);\n\n\t\t// new_Game-entity\n\n\t\tButtonEntity newGame = new ButtonEntity(\"newGame\", stateID, Constants.ButtonType.MAINMENU, Variables.MAIN_MENU_BUTTON_1_X, Variables.MAIN_MENU_BUTTON_1_Y);\n\t\tnewGame.addAction((gc1, sb1, delta, event) -> {\n\t\t\tSoundHandler.playButtonPress();\n\t\t\tPlayerHandler.reset();\n\t\t\t// grab the mouse\n\t\t\tgc1.setMouseGrabbed(true);\n\t\t});\n\t\tnewGame.addAction(new ChangeStateInitAction(Breakout.GAMEPLAY_STATE));\n\n\t\t// controller \"listener\" (Button 4)\n\t\tlistenerLoop.addAction((gc1, sb1, delta, event) -> {\n\t\t\tif (ControllerHandler.isButtonPressed(3)) {\n\t\t\t\t// if the button 3 was not pressed before but is pressed now\n\n\t\t\t\t// resetting the players progress / stats\n\t\t\t\tPlayerHandler.reset();\n\n\t\t\t\t// grab the mouse\n\t\t\t\tgc1.setMouseGrabbed(true);\n\n\t\t\t\t// going into GameplayState (like changeStateInitAction)\n\t\t\t\tsb1.enterState(Constants.GAMEPLAY_STATE);\n\n\t\t\t\t// forcing init for all states\n\t\t\t\tBreakout.reinitStates(gc1, sb1, Constants.GAMEPLAY_STATE);\n\t\t\t}\n\t\t});\n\n\t\t// resume_Game-entity\n\t\tButtonEntity resumeGame = new ButtonEntity(\"resumeGame\", stateID, Constants.ButtonType.MAINMENU, Variables.MAIN_MENU_BUTTON_2_X, Variables.MAIN_MENU_BUTTON_1_Y);\n\t\tresumeGame.addAction((gc1, sb1, delta, event) -> {\n\t\t\tif (GameplayState.currentlyRunning) {\n\t\t\t\t// play sound for acceptable button press\n\t\t\t\tSoundHandler.playButtonPress();\n\t\t\t\t// grab the mouse\n\t\t\t\tgc1.setMouseGrabbed(true);\n\t\t\t\t// keep track of the time (pause time ended now)\n\t\t\t\tGameplayState.pauseTime += gc1.getTime() - GameplayState.startPauseTime;\n\t\t\t\tsb1.enterState(Breakout.GAMEPLAY_STATE);\n\t\t\t\tif (gc1.isPaused()) {\n\t\t\t\t\tgc1.resume();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tSoundHandler.playNotAcceptable();\n\t\t\t}\n\t\t});\n\n\t\t// controller \"listener\" (Button 3)\n\t\tlistenerLoop.addAction((gc1, sb1, delta, event) -> {\n\t\t\tif (ControllerHandler.isButtonPressed(2)) {\n\t\t\t\t// if the button 3 was not pressed before but is pressed now\n\n\t\t\t\tif (GameplayState.currentlyRunning) {\n\t\t\t\t\tGameplayState.pauseTime += gc1.getTime() - GameplayState.startPauseTime;\n\t\t\t\t\t// grab the mouse\n\t\t\t\t\tgc1.setMouseGrabbed(true);\n\t\t\t\t\tsb1.enterState(Breakout.GAMEPLAY_STATE);\n\t\t\t\t\tif (gc1.isPaused()) {\n\t\t\t\t\t\tgc1.resume();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tSoundHandler.playNotAcceptable();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// options-entity\n\t\tButtonEntity options = new ButtonEntity(\"options\", stateID, Constants.ButtonType.MAINMENU, Variables.MAIN_MENU_BUTTON_1_X, Variables.MAIN_MENU_BUTTON_2_Y);\n\t\toptions.addAction(new ChangeStateAction(Breakout.OPTIONS_STATE));\n\t\toptions.addAction((gc1, sb1, delta, event) -> SoundHandler.playButtonPress());\n\n\t\t// highscore-entity\n\t\tButtonEntity highscore = new ButtonEntity(\"highscore\", stateID, Constants.ButtonType.MAINMENU, Variables.MAIN_MENU_BUTTON_2_X, Variables.MAIN_MENU_BUTTON_2_Y);\n\t\thighscore.addAction(new ChangeStateAction(Breakout.HIGHSCORE_STATE));\n\t\thighscore.addAction((gc1, sb1, delta, event) -> SoundHandler.playButtonPress());\n\n\n\t\t// quit-entity\n\t\tButtonEntity quit = new ButtonEntity(\"quit\", stateID, Constants.ButtonType.MAINMENU, Variables.MAIN_MENU_BUTTON_1_X, Variables.MAIN_MENU_BUTTON_3_Y);\n\t\tquit.addAction(new QuitAction());\n\n\t\t// controller \"listener\" (Button 2)\n\t\tlistenerLoop.addAction((gc1, sb1, delta, event) -> {\n\t\t\tif (ControllerHandler.isButtonPressed(1)) {\n\t\t\t\t// if the button 3 was not pressed before but is pressed now\n\t\t\t\t// exit the game\n\t\t\t\tgc1.exit();\n\t\t\t}\n\t\t});\n\n\t\t// about-entity\n\t\tButtonEntity about = new ButtonEntity(\"about\", stateID, Constants.ButtonType.MAINMENU, Variables.MAIN_MENU_BUTTON_2_X, Variables.MAIN_MENU_BUTTON_3_Y);\n\t\tabout.addAction(new ChangeStateAction(Breakout.ABOUT_STATE));\n\t\tabout.addAction((gc1, sb1, delta, event) -> SoundHandler.playButtonPress());\n\n\t}", "public void initialize() {\r\n addSprite(this.info.getBackground());\r\n createBorders();\r\n defineDeathBlock();\r\n addIndicators();\r\n BlockRemover removeBlock = new BlockRemover(this, this.remainingBlocks);\r\n// this.remainingBlocks=removeBlock.getRemainingBlocks();\r\n ScoreTrackingListener scoreTrackingListener = new ScoreTrackingListener(this.score);\r\n for (int i = 0; i < info.blocks().size(); i++) {\r\n info.blocks().get(i).addHitListener(removeBlock);\r\n info.blocks().get(i).addHitListener(scoreTrackingListener);\r\n info.blocks().get(i).addToGame(this);\r\n }\r\n }", "public OI(){\n\t\t\n\t//\tc6.whenPressed(new dumpFlapOpen());\n\t\t//c8.whenPressed(new dumpFlapClose()); \n//\t\tl7.whenPressed(new dumpFlapOpen());\n//\n//\t\tx3.whileHeld(new hopperCoil());\n//\t\tx1.whileHeld(new hopperUnCoil());\n//\t\tx2.whileHeld(new climber());\n//\t\tx0.whenPressed(new climberReset());\n//\t\tx8.toggleWhenPressed(new cameraOneInit());\n//\t\tx9.toggleWhenPressed(new cameraTwoInit());\n//\n//\t\tr1.toggleWhenPressed(new driveBaseSwitchDirections());\n\t\t//l1.toggleWhenPressed(new visionSwitchCameras());\n\t\t\n\t\t/* logitech controller */\n\t\tc6.whenPressed(new dumpFlapOpen());\n\t\tc8.whenPressed(new dumpFlapClose()); \n\t\tl7.whenPressed(new dumpFlapOpen());\n\n\t\tc4.whileHeld(new hopperCoil());\n\t\tc3.whileHeld(new hopperUnCoil());\n\t\tc1.whileHeld(new climber());\n\t\tc2.whenPressed(new climberReset());\n\t\tc11.toggleWhenPressed(new cameraOneInit());\n\t\tc12.toggleWhenPressed(new cameraTwoInit());\n\n\t\tr1.toggleWhenPressed(new driveBaseSwitchDirections());\n\t\tl1.toggleWhenPressed(new visionSwitchCameras());\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/* TRASH CONTROLS */\n\t\t//l7.whenPressed(new resetClimberBoolean());\n\t\t//r1.whenPressed(new visionSwitchCameras());\n//\t\tl1.whenPressed(new visionSwitchCameras());\n\t\t//r1.whenActive(new visionSwitchCameras());\n//\t\tc9.whenPressed(new intakeFlapOpen());\n//\t\tc10.whenPressed(new intakeFlapClose()); \n\t\t\n//\t\tc5.whenPressed(new pushGearOut());\n//\t\tc7.whenPressed(new pushGearIn()); \n\t\t\n//\t\tc5.whenActive(new pushGearOut());\n//\t\tc7.whenActive(new pushGearIn()); \n//\t\tc5.toggleWhenPressed(new pushGearOut());\n//\tc7.toggleWhenPressed(new pushGearIn()); \n//\n//\t\tc5.whileHeld(new pushGearOut());\n//\t\tc7.whileHeld(new pushGearIn()); \n\t}", "public void update(float dt) {\n if (codeOn == true) {\n //do nothing\n } else {\n handleinput(dt);\n }\n //movedRight(dt);\n //takes 1 step in the physics simulation 60 times per second\n world.step(1 / 60f, 6, 2);\n player.update(dt);\n\n //if character dies, freeze the camera right where he died\n if (player.currentState != Adventurer.State.DEAD) {\n gamecam.position.x = player.b2body.getPosition().x;\n }\n\n hud.update(dt);\n\n for (Enemy enemy : creator.getDungeonMonster()) {\n enemy.update(dt);\n if (enemy.getX() < player.getX() + 220 / DefaultValues.PPM) {\n enemy.b2body.setActive(true);//activate goomba\n }\n }\n if (DefaultValues.questActivated == true) {\n quest1 = true;\n quest2 = false;\n DefaultValues.questActivated = false;\n stage.addActor(dialog);\n }\n\n if (DefaultValues.quest2Activated == true) {\n quest1 = false;\n quest2 = true;\n DefaultValues.quest2Activated = false;\n stage.addActor(dialog2);\n }\n\n if (touchedFinishline == true) {\n if (progressInsideTaskTwo == 100) {\n if (saveProcessor.checkAchievement() == true) {\n DungeonCoder.manager.get(\"UIElements/Animation/achievement.mp3\", Sound.class).play();\n }\n DungeonCoder.manager.get(\"UIElements/Animation/stagecomplete.mp3\", Sound.class).play();\n hud.stopMusic();\n touchedFinishline = false;\n saveProcessor.insClear();\n System.out.println(\"Total clear:\" + saveProcessor.getTotalCleared());\n System.out.printf(\"You have cleared %d instructional stages.\\n\", saveProcessor.getInsCleared());\n dispose();\n game.setScreen(new StageThreeComplete(game));\n } else {\n touchedFinishline = false;\n new Dialog(\"Dungeon Coder\", skin, \"dialog\") {\n protected void result(Object object) {\n }\n }.text(\"You have not fulfil the requirement to complete the stage!\").button(\" Ok \", true).show(stage);\n }\n }\n\n\n //update gamecam with correct corrdinates after changes\n gamecam.update();\n\n //tell renderer to draw only what our camera can see in our game world\n renderer.setView(gamecam);\n\n }", "public abstract void RunOnGameOpen();", "public void update() {\n\t\ttutorialSteps.writeTime += 2;\n\t\tif (tutorialSteps.currStep() != null) {\n\t\t\tif (tutorialSteps.startTime) {\n\t\t\t\ttutorialSteps.timeElapsed += 1;\n\t\t\t}\n\t\t}\n\t\tif (tutorialSteps.isDone()) {\n\t\t\t// if problem persists, have conditions for if SELECTION mode\n\t\t\tsuper.update();\n\t\t\treturn;\n\t\t}\n\t\tscreen.noScreen();\n\t\tswitch (inGameState) {\n\t\tcase NORMAL:\n\t\t\t// update the character models\n\t\t\tcharacters.update();\n\t\t\teffectController.update(characters, board);\n\t\t\tactionBarController.update();\n\t\t\t// persistingController.update();\n\t\t\tmouseOverController.update(selectionMenuController.getMenu(), characters,\n\t\t\t\t\tselectionMenuController.choosingTarget);\n\t\t\tif (actionBarController.isAISelection) {\n\t\t\t\tpauseTimer = 0;\n\t\t\t\ttargetPauseTime = tutorialSteps.currStep().timeToPause;\n\t\t\t\t// System.out.println(\"next step 1\");\n\t\t\t\t// tutorialSteps.nextStep();\n\t\t\t\t// tutorialSteps.nextStep();\n\t\t\t\tif (!curPaused) {\n\t\t\t\t\tcurPaused = true;\n\t\t\t\t\tregGameState = inGameState;\n\t\t\t\t}\n\t\t\t\tinGameState = InGameState.PAUSED;\n\t\t\t\tif (tutorialSteps.currStep().actions.size() == 0)\n\t\t\t\t\tsuper.aiController.update();\n\t\t\t\telse\n\t\t\t\t\taiController.update();\n\t\t\t}\n\t\t\tif (actionBarController.isAttack) {\n\t\t\t\tinGameState = InGameState.ATTACK;\n\t\t\t} else if (actionBarController.isPlayerSelection) {\n\t\t\t\t// System.out.println(\"next step 2\");\n\t\t\t\ttutorialSteps.nextStep();\n\t\t\t\tif (tutorialSteps.currStep() != null)\n\t\t\t\t\ttargetPauseTime = tutorialSteps.currStep().timeToPause;\n\t\t\t\tpauseTimer = 0;\n\t\t\t\tselectionMenuController.update();\n\t\t\t\tinGameState = InGameState.SELECTION;\n\t\t\t}\n\t\t\t// updateTutorial();\n\t\t\tbreak;\n\t\tcase SELECTION:\n\t\t\tscreen.setJustScreen();\n\t\t\tmouseOverController.clearAll();\n\t\t\tmouseOverController.update(selectionMenuController.getMenu(), characters,\n\t\t\t\t\tselectionMenuController.choosingTarget);\n\t\t\tselectionMenuController.update();\n\t\t\tprompt = \"\";// prompt = \"Choose an Action\";\n\t\t\tselectionMenuController.setPrompt(prompt);\n\t\t\tif (selectionMenuController.isDone()) {\n\t\t\t\tinGameState = InGameState.NORMAL;\n\t\t\t\tprompt = null;\n\t\t\t\tboard.reset();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ATTACK:\n\t\t\tactionController.update();\n\t\t\tpersistingController.updateProjs();\n\t\t\tif (actionController.isDone()) {\n\t\t\t\tif (actionBarController.isPlayerSelection) {\n\t\t\t\t\tinGameState = InGameState.SELECTION;\n\t\t\t\t} else {\n\t\t\t\t\tinGameState = InGameState.NORMAL;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// updateTutorial();\n\t\t\tbreak;\n\t\tcase PAUSEMENU:\n\t\t\tscreen.setJustScreen();\n\t\t\tpauseMenuController.update();\n\t\t\tif (pauseMenuController.doneSelecting) {\n\t\t\t\tString selected = pauseMenuController.selected;\n\t\t\t\tif (selected.equals(\"Resume Game\")) {\n\t\t\t\t\tinGameState = prePauseState;\n\t\t\t\t} else if (selected.equals(\"Retry\")) {\n\t\t\t\t\t// if we end the game without winning, the level will be\n\t\t\t\t\t// reset in gameEngine\n\t\t\t\t\tinGameState = InGameState.DONE;\n\t\t\t\t\treset = true;\n\t\t\t\t} else if (selected.equals(\"Main Menu\")) {\n\t\t\t\t\tInputController.artificialRPressed = true;\n\t\t\t\t}\n\t\t\t\tpauseMenuController.reset();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase PAUSED:\n\t\t\tif (regGameState == InGameState.SELECTION) {\n\t\t\t\tscreen.setJustScreen();\n\t\t\t}\n\t\t\t// System.out.println(\"we are here\");\n\t\t\t// updateTutorial();\n\t\t\tbreak;\n\t\tcase WARNING:\n\t\t\twarningTime++;\n\t\t\tif (warningTime == WARNING_DONE_TIME || InputController.pressedEnter()) {\n\t\t\t\twarningTime = 0;\n\t\t\t\t// if (InputController.pressedEnter()){\n\t\t\t\tinGameState = InGameState.DONE;\n\t\t\t\tif (this.leftsideDead()) {\n\t\t\t\t\tGameEngine.nextLevel = TutorialSteps.levelName;\n\t\t\t\t} else if (this.rightsideDead()) {\n\t\t\t\t\tGameEngine.nextLevel = TutorialSteps.nextLevel;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn;\n\t\tdefault:\n\t\t\t// updateTutorial();\n\t\t\tbreak;\n\t\t}\n\t\tif (inGameState != InGameState.PAUSEMENU && inGameState != InGameState.DONE) {\n\t\t\tupdateTutorial();\n\t\t\tupdateTextMessages();\n\t\t}\n\t\tremoveDead();\n\t\tif (gameOver()) {\n\t\t\t// you are set to done state after the warning time has elapsed\n\t\t\tif (inGameState != InGameState.DONE) {\n\t\t\t\tinGameState = InGameState.WARNING;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (GameEngine.dataGen) {\n\t\t\t\tdataFile.writeString(jsonArray.toString(), false);\n\t\t\t\tfileNumFile.writeString(\"\" + fileNum, false);\n\t\t\t}\n\t\t\tObjectLoader.getInstance().unloadCurrentLevel();\n\t\t}\n\t\tif (InputController.pressedESC() || InputController.pressedP()) {\n\t\t\tif (inGameState != InGameState.PAUSEMENU) {\n\t\t\t\tprePauseState = inGameState;\n\t\t\t\tinGameState = InGameState.PAUSEMENU;\n\t\t\t} else {\n\t\t\t\tinGameState = prePauseState;\n\t\t\t\tpauseMenuController.reset();\n\t\t\t}\n\t\t}\n\n\t}", "public void run (){\n\t\t\t\t\t\t\t\t\tgame.setScreen(game.ui);\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}" ]
[ "0.63480526", "0.6263592", "0.62019175", "0.6182065", "0.6180651", "0.6168016", "0.61165476", "0.602886", "0.60272974", "0.601512", "0.6003341", "0.6002517", "0.59922004", "0.59898174", "0.59516144", "0.59516144", "0.5940732", "0.5939238", "0.5937298", "0.5931008", "0.5923623", "0.59185547", "0.5911677", "0.590358", "0.59025824", "0.58977085", "0.5886559", "0.588541", "0.58836544", "0.58819383", "0.58793956", "0.5878109", "0.5856339", "0.58538884", "0.585076", "0.583277", "0.5830149", "0.58272415", "0.58238053", "0.5823671", "0.5813502", "0.5792941", "0.5785219", "0.57816064", "0.5779854", "0.5778154", "0.577492", "0.57739854", "0.57732713", "0.57643247", "0.5764026", "0.576005", "0.57574993", "0.57496065", "0.5747648", "0.57467276", "0.57456714", "0.5745576", "0.57436836", "0.57428133", "0.5742402", "0.5742299", "0.5742299", "0.5740216", "0.57368296", "0.5734128", "0.5732205", "0.57271415", "0.5723954", "0.5719785", "0.5717772", "0.57169473", "0.57090104", "0.57031107", "0.5702737", "0.5702253", "0.5698671", "0.56974196", "0.569641", "0.5693201", "0.5691206", "0.56898934", "0.5685811", "0.56855166", "0.56852454", "0.5681393", "0.56785417", "0.56750536", "0.567179", "0.5670479", "0.5669552", "0.5668471", "0.56670535", "0.5660051", "0.565538", "0.56546414", "0.56539077", "0.5653407", "0.56528264", "0.56423426", "0.56414944" ]
0.0
-1
IF [dead] then do nothing
@Override public void decide() { if (this.isDead) { return; } if(this.age >= this.lifeSpan) { // DIE this.environment.removeAgent(this.getPosX(), this.getPosY()); this.isDead = true; // Print if required if (this.appConfig.hasTrace()) { System.out.println("Agent;Death;Fish;" + this.getPosX() + ";" + this.getPosY()); } return; } this.age++; this.color = Color.GREEN; boolean canFuck = this.breedTime == 0; int[] coordinates = this.chooseCoordinates(); // fish cannot move or fuck because there is no place to do so if (coordinates == null) { this.breedTime = this.breedTime > 0 ? this.breedTime - 1 : this.breedTime; return; } this.environment.moveAgent(this, coordinates[0], coordinates[1]); // Time to fuck-zer if (canFuck) { this.fuck(this.getPosX(), this.getPosY()); } // Update breedtime in order to wait the holy fuck time else { this.breedTime = this.breedTime > 0 ? this.breedTime - 1 : this.breedTime; } this.posX = coordinates[0]; this.posY = coordinates[1]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void dead() { this.alive = false; }", "private void bringToLife(){\n this.dead = false;\n }", "public boolean isDead();", "public boolean isDead()\n {\n // TODO: replace this line with your code\n }", "Boolean isDead();", "public void setDead(boolean value);", "public boolean getDead();", "public void setDead(boolean dead) {\r\n this.dead = dead;\r\n }", "public void setDead(){\n\t\t//queue this blood for cleanup\n\t\tvisible = false;\n\t\tDEAD = true;\n\t\tcleanUp();\n\t}", "@Override\n\tpublic boolean isDead() {\n\t\treturn dead;\n\t}", "public void setDead(boolean dead) {\n isDead = dead;\n }", "public void setDead(boolean dead) {\n this.isDead = dead;\n }", "public void deadcheck()\n\t{\n\t\tif (this.shield <= 0)\n\t\t{\n\t\t\tthis.drawMissile = false;\n\t\t}\n\t\telse \n\t\t\tthis.drawMissile = true;\n\t}", "default public boolean dead() {\n return life().dead();\n }", "protected boolean isDead(int x, int y){\n \tclearAllSigns();\n \treturn noLife(x, y);\n\t}", "public void setDead(boolean dead) {\n\t\tthis.dead = dead;\n\t}", "@Override\n\tpublic boolean isDead() {\n\t\treturn mRemainedCounters == 0;\n\t}", "private void killBullet() {\r\n this.dead = true;\r\n }", "private void Dead() {\n\t\thunger -= 5;\n\t\tthirst -= 5;\n\t\tif ((thirst < 25) && (hunger < 25)){\t\t\t// Player is very weak\n\t\t\thealth -= 15;\n\t\t}else if ((thirst < 25) || (hunger < 25)){\t\t// Player is kinda weak\n\t\t\thealth -= 5;\n\t\t}\n\t\tif (health <= 0){\t\t\t\t\t\t\t\t// Player is dead\n\t\t\taddMessage(\"Overcome by your weakness you succumb.\", \"AI\");\n\t \t\taddMessage(\"You have died\", \"AI\");\n\t \t\tmenu = MENU.GAME_OVER;\n\t\t}\n\t}", "public void setDead()\r\n/* 107: */ {\r\n/* 108:128 */ if (this.b) {\r\n/* 109:129 */ vs.a(this.world, this, this);\r\n/* 110: */ }\r\n/* 111:132 */ super.setDead();\r\n/* 112: */ }", "@Override\n\tpublic boolean isDead() {\n\t\treturn mProgress>mLife && mLife>=0;\n\t}", "public void markDead() {\r\n\t\tsetNodeWasContacted(0);\r\n\t}", "public boolean isDead() {\r\n \t\treturn this.isDead;\r\n \t}", "public boolean dead() {\r\n\t\treturn goalPushes == Integer.MAX_VALUE;\r\n\t}", "private void physicsTickDead() {\n\t\t// Check the round end counter\n\t\tif (checkRoundEndCounter()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Physics stuff\n\t\tsetThrusts();\n\t\tmoveEverything(deltaTimeDead);\n\t\tageScoreMarkers(deltaTimeAlive);\n\t\tshootBullets();\n\t\t\n\t\tcollideTankToWall();\n\t\tcollideBulletToWall();\n\t}", "@Override\n public boolean isDead() {\n return (this.getLife() <= 0);\n }", "public abstract void turnToDead(int x, int y);", "public boolean isDead() {\r\n\t\treturn this.lives == 0;\r\n\t}", "public void deadPlayer() {\r\n\t\tthis.nbPlayer --;\r\n\t}", "public boolean isDead() {\n\t\treturn dead;\n\t}", "public void playerHasNoSword() {\n\t\tthis.state = cannotBeKilled;\n\t}", "public boolean isDead() {\r\n return this.dead;\r\n }", "public void kill() {\r\n \t\tthis.isDead = true;\r\n \t}", "public void isDeceased(){\r\n\t\t//here is some code that we do not have access to\r\n\t}", "public void setIsDead(boolean isDead) {\n this.isDead = isDead;\n }", "public void setDead(boolean dead) {\n this.dead = dead;\n Graphics g = image.getGraphics();\n g.setColor(Color.BLACK);\n g.fillRect(0,0,pieceSize,pieceSize);\n g = getCoveredImage().getGraphics();\n g.setColor(Color.BLACK);\n g.fillRect(0,0,pieceSize,pieceSize);\n }", "public boolean isDead() {\r\n\t\treturn health <= 0;\r\n\t}", "void blackhole(){ if (zzAtBOL) return; }", "public boolean isDead() {\n return isDead;\n }", "public boolean isDead() {\n return isDead;\n }", "public void notWalkable() \n\t{\n\t\twalkable = false;\n\t}", "void playerHit() {\n if (lives == 0) {//if no lives left\n isDead = true;\n } else {//remove a life and reset positions\n lives -=1;\n immortalityTimer = 100;\n resetPositions();\n }\n }", "public void die()\n\t{\n\t\talive = false;\n\t}", "public boolean mustDie() {\n\t\tif (this.not_fed == 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "String reachedDeadEnd();", "public boolean isDead() {\n return hullStrength <= 0;\n }", "protected boolean isMovementNoisy() {\n/* 1861 */ return (!this.abilities.flying && (!this.onGround || !isDiscrete()));\n/* */ }", "protected void setDead()\n {\n alive = false;\n if(location != null) {\n field.clear(location);\n location = null;\n field = null;\n }\n }", "protected void setDead()\n {\n alive = false;\n if(location != null) {\n field.clear(location);\n location = null;\n field = null;\n }\n }", "@Test\n\tpublic void testIsDead() {\n\t\tnpc.setLevel(1);\n\t\tnpc.setHealth(23);\n\t\tnpc.calHealth();\n\t\tassertFalse(npc.isDead());\n\t\tnpc.changeHealth(-23);\n\t\tassertTrue(npc.isDead());\n\t\tnpc.changeHealth(-100);\n\t\tassertTrue(npc.isDead());\n\t}", "@Override\n\tpublic boolean tick() {\n\t\treturn false;\n\t}", "public boolean isDead ( ) {\n\t\treturn extract ( handle -> handle.isDead ( ) );\n\t}", "@Override\n public void bankrupt() {\n this.mortgaged = false;\n }", "public void setDied();", "public boolean isDead() {\n return this.isDead;\n }", "void unavailable();", "void unavailable();", "public boolean isDead() {\n\t\tif(parts==0) return true; // if no parts left, the snake is dead\n\t\treturn false; // otherwise it's still alive\n\t}", "public void isShot() {\r\n\t\tlives -=1;\r\n\t\tif(isDead())\r\n\t\t{\r\n\t\t\tthis.erase();\r\n\t\t}\r\n\t}", "public boolean isDead() {\n\t\treturn (currentHP<=0);\n\t}", "public void caughtCheating(){\n\t\tinGoodStanding = false;\n\t}", "public boolean isAlive(){\r\n\t\tif(dead==true){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "private Boolean infect( Player player ){\n try {\n player.setHealth( false );\n return true;\n } catch (Exception e) {\n System.out.println(\"Something went wrong.\");\n return false;\n }\n }", "@Override\n public void Die() {\n this.setAlive(false);\n }", "@Override\n public boolean canBeDeadCode(IRCode code, InternalOptions options) {\n return false;\n }", "public boolean sendDeath() {\n return true;\n }", "public boolean notAlive() {\r\n\r\n if (LOG.isLoggable(Level.FINEST)) {\r\n LOG.finest(\"notAlive ( ) called \");\r\n }\r\n\r\n return !alive();\r\n }", "protected void checkDeadLock()\r\n/* 134: */ {\r\n/* 135:165 */ if (channel().isRegistered()) {\r\n/* 136:166 */ super.checkDeadLock();\r\n/* 137: */ }\r\n/* 138: */ }", "public void nullstill();", "@Override\n\tpublic boolean isGameTied() {\t\n\t\treturn false;\n\t}", "boolean stillAlive();", "public boolean isDead() {\r\n\t\treturn !isAlive();\r\n\t}", "public boolean isDead() {\n\t\tif (_currentHealth <= 0)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "@Override\n public boolean use(ActivePokemon p, Battle b) {\n if (!p.isActuallyDead()) {\n return false;\n }\n\n p.removeStatus();\n p.healHealthFraction(.5);\n\n Messages.add(p.getName() + \" was partially revived!\");\n return true;\n }", "@Override\n public void die() {\n// System.out.println(\"STATE = dead\");\n state = ENEMY_DEAD;\n stateTime = 0;\n velocity.x = 0;\n }", "public boolean isDead() {\r\n\t\tif (health <= 0.0) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "public void dontDie()\n\t{\n\t\ttimerList.remove(deathTimer);\n\t}", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tno();\n\t\t\t\t}", "@Override\n public boolean use(ActivePokemon p, Battle b) {\n if (!p.isActuallyDead()) {\n return false;\n }\n\n p.removeStatus();\n p.healHealthFraction(1);\n\n Messages.add(p.getName() + \" was fully revived!\");\n return true;\n }", "@Override\n public boolean use(ActivePokemon p, Battle b) {\n if (!p.isActuallyDead()) {\n return false;\n }\n\n p.removeStatus();\n p.healHealthFraction(1);\n\n Messages.add(p.getName() + \" was fully revived!\");\n return true;\n }", "private void checkDeath() {\n\t\tif (player.getLives() == 0) {\n shooty.setIv(new Image(\"/img/shipdeath.png\"));\n\t\t\tdie();\n\t\t}\n\t\t// another way to die: the blocks hit you\n\t\tif(btnList.get(0).getLayoutY() >= FATAL_BUTTON_DIST) {\n\t\t\tendGame.play();\n\t\t\tdie();\n\t\t}\n\t}", "private void deadvance() {\n if (currColumn == 0) {\n if (currRow != 0) {\n currColumn = 8;\n currRow--;\n }\n } else {\n currColumn--;\n }\n if (!(currRow == 0 && currColumn == 0)) {\n if (startingBoard[currRow][currColumn] != 0) {\n deadvance();\n }\n }\n }", "@Override\n public void checkEffect()\n {\n age(1);\n\n if (!suspended)\n suspend();\n }", "protected void die()\n\t{\n\t\tdead = true;\n\t\tcurrentCell.setOccupant(null);\n\t\tcurrentCell = null;\n\t}", "public boolean deathTick(Game game) {\n\t\treturn false;\n\t}", "public void turnToDead(int x, int y){\n if(isInsideBoard(x, y))\n getBoard()[x][y] = false;\n }", "public void justDie()\n\t{\n\t\tsynchronized (this) {\n\t\tcurrentState.justDie();\n\t\t}\n\t}", "@Override\r\n public boolean canBeCollidedWith()\r\n {\r\n return !this.isDead;\r\n }", "@Test\n\t\tpublic void woeIsMeUnreachabletest() {\n\t\t\tassertTrue(System.currentTimeMillis() > 0);\n\t\t}", "boolean isDeletable() {\n return life == 0;\n }", "public void playerHasInvincibility() {\n\t\tthis.state = canBeKilled;\n\t}", "void onNoCollision();", "public void checkForRemoval()\n {\n if (life <= 0)\n {\n SideScrollingWorld world = (SideScrollingWorld) getWorld(); \n \n world.isPacmanDead = true;\n getWorld().removeObject(this);\n }\n }", "private int check_if_dead(int i) {\n\t\tint ret;\n\t\tif ((abs(dragoes[i].getX_coord() - heroi.getX_coord()) > 1) || (abs(dragoes[i].getY_coord() - heroi.getY_coord()) > 1) ||\n\t\t\t\t((dragoes[i].getY_coord() != heroi.getY_coord()) && (dragoes[i].getX_coord() != heroi.getX_coord())))\n\t\t\tret = -1;\n\t\telse if (heroi.isArmado()) {\n\t\t\tif (dragoes[i].isAlive()) {\n\t\t\t\tif (inter == 0)\n\t\t\t\t\tconsole_interface.dragonKilled();\n\t\t\t\telse if (inter == 3) \n\t\t\t\t\tMazeDisplay.messageDragonKilled();\n\t\t\t\telse {}\n\t\t\t}\n\t\t\tdragoes[i].setAlive(false);\n\t\t\tlabirinto.setLabCell(dragoes[i].getX_coord(), dragoes[i].getY_coord(), ' ');\n\t\t\tret = -1;\n\t\t}\n\t\telse if (dragoes[i].getStatus() == 1)\n\t\t\tret = -1;\n\t\telse\n\t\t\tret = 5;\n\t\tchange_dragon_pos(i);\n\t\treturn ret;\n\t}", "@Override\n protected ExchangeUse getExchangeUse() {return ExchangeUse.DEAD;}", "public boolean mayPickup(Player debug1) {\n/* 112 */ return true;\n/* */ }", "@Override\n\tprotected boolean canDespawn() {\n\t\treturn false;\n\t}", "public void animalDontEat()\n {\n if(animalHungry)\n {\n map.deadAnimalOnMap(this);\n }\n }", "private boolean noVacancy() {\r\n\t\t\treturn removed = false;\r\n\t\t}", "@Override\n \tpublic void notifyDeath() {\n \t\tGame.GAME_STATE = Game.GAME_STATE_DEAD;\n \t\t\n \t}", "public State getDead() {\n\t\treturn dead;\n\t}" ]
[ "0.7619446", "0.74339217", "0.7228164", "0.7225212", "0.71425766", "0.70957136", "0.7024346", "0.69415927", "0.6935935", "0.689847", "0.68572915", "0.68182284", "0.6780286", "0.6771176", "0.6766098", "0.67584455", "0.67421305", "0.6734112", "0.6643957", "0.6574919", "0.6492265", "0.64794576", "0.64749646", "0.64636135", "0.64464545", "0.6440285", "0.6439089", "0.6401906", "0.6372014", "0.6343024", "0.63361126", "0.6266744", "0.6260789", "0.62570184", "0.6256823", "0.6251565", "0.6202682", "0.61550903", "0.6143418", "0.6143418", "0.61331254", "0.61233455", "0.6122299", "0.6103557", "0.60817593", "0.60726744", "0.6069391", "0.60634553", "0.60634553", "0.6062676", "0.6058504", "0.6054275", "0.60451573", "0.6040688", "0.6032063", "0.6028167", "0.6028167", "0.60131216", "0.6003846", "0.5991148", "0.59556925", "0.5947025", "0.59320396", "0.5932026", "0.5929072", "0.5926992", "0.5926912", "0.59247416", "0.5922405", "0.5918527", "0.5915329", "0.5908687", "0.58987385", "0.58884335", "0.5883233", "0.58801275", "0.58767", "0.5865421", "0.5859518", "0.5859518", "0.58590925", "0.5851542", "0.58508563", "0.58461607", "0.5844408", "0.5838919", "0.5834573", "0.58325106", "0.5827216", "0.579447", "0.57843196", "0.57756567", "0.57739085", "0.577114", "0.57511413", "0.5744803", "0.57340497", "0.5727993", "0.57171524", "0.57125974", "0.5710336" ]
0.0
-1
Choose coordinates to move based on the random numbers
private int[] chooseCoordinates() { // Choose new (posX,posY) location for the Fish int pasX, pasY; // at least pasX or pasY not null do { pasX = this.appConfig.getRandom().nextInt(3) - 1; pasY = this.appConfig.getRandom().nextInt(3) - 1; } while (pasX == 0 && pasY == 0); // choose one free cell based on the random steps (+1 logic) for (int x = pasX; x <= 1; x++) { for (int y = pasY; y <= 1; y++) { int newX = this.posX + x; int newY = this.posY + y; // not a good choice with isTorus if (!this.appConfig.isTorus() && this.environment.isOutOfBound(newX, newY)) { continue; } // change x or y if environment is a torus if (this.appConfig.isTorus()) { if (newX < 0) { newX = this.environment.getWidth() - 1; } if (newX >= this.environment.getWidth()) { newX = 0; } if (newY < 0) { newY = this.environment.getHeight() - 1; } if (newY >= this.environment.getHeight()) { newY = 0; } } // Fish can move here if (this.environment.getCell(newX, newY) == null) { return new int[] { newX, newY }; } } } // choose one free cell based on the random steps (-1 logic) for (int x = pasX; x >= -1; x--) { for (int y = pasY; y >= -1; y--) { int newX = this.posX + x; int newY = this.posY + y; // not a good choice with isTorus if (!this.appConfig.isTorus() && this.environment.isOutOfBound(newX, newY)) { continue; } // change x or y if environment is a torus if (this.appConfig.isTorus()) { if (newX < 0) { newX = this.environment.getWidth() - 1; } if (newX >= this.environment.getWidth()) { newX = 0; } if (newY < 0) { newY = this.environment.getHeight() - 1; } if (newY >= this.environment.getHeight()) { newY = 0; } } // Fish can move here if (this.environment.getCell(newX, newY) == null) { return new int[] { newX, newY }; } } } // no available cell if we arrive here return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void generateRandomPosition() {\n\t\tx.set((int)(Math.floor(Math.random()*23+1)));\n\t\ty.set((int)(Math.floor(Math.random()*23+1)));\n\n\t}", "public void randomMove(Random choiceGen){\n\tint choice = choiceGen.nextInt(4);\n\tswitch(choice){\n case 0:\n\tif(position[0] < worldEdge[0]){\n\t position[0] += 1;\n\t break;\n\t}\n\t\n\tcase 1:\n\t if(position[0] > 0){\n\t\tposition[0] -= 1;\n\t }\n\t else{\n\t position[0] += 1;\n\t }\n\t break;\n\tcase 2:\n\t if(position[1] < worldEdge[1]){\n\t\tposition[1] += 1;\n\t\tbreak;\n\t}\n\tcase 3:\n\t if(position[1] > 0){\n\t\tposition[1] -= 1;\n\t }\n\t else{\n\t\tposition[1] += 1;\n\t }\n\t break;\n\t}\n }", "public void randomize() {\n\t\tx = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t\ty = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t}", "public void setCoords() \r\n {\r\n \tthis.coordX = rand.nextInt(10);\r\n \tthis.coordY = rand.nextInt(10);\r\n }", "static void randomMove() {\n int directionNum; // Randomly set to 0, 1, 2, or 3 to choose direction.\n directionNum = ( int )( Math.random() * 4 );\n\n switch ( directionNum ) {\n case 0: // Move up.\n currentRow--;\n if ( currentRow < 0 )\n currentRow = ROWS - 1;\n break;\n case 1 : // Move right.\n currentColumn++;\n if ( currentColumn >= COLUMNS )\n currentColumn = 0;\n break;\n case 2 : // Move down.\n currentRow++;\n if ( currentRow >= ROWS )\n currentRow = 0;\n break;\n case 3 : // Move left.\n currentColumn--;\n if ( currentColumn < 0 )\n currentColumn = COLUMNS - 1;\n break;\n\n }\n }", "public void randomMove() {\r\n\t\tRandom rand = new Random();\r\n\t\tint moveNum = rand.nextInt(100)+100;\r\n\t\tcheck++;\r\n\t\tif(check >= moveNum) {\r\n\t\t\tspeed = speed*-1;\r\n\t\t\tcheck =0;\r\n\r\n\t\t}\r\n\r\n\t\tif(speed > 0) {\r\n\t\t\tsetIcon(rightImage);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tsetIcon(leftImage);\r\n\t\t}\r\n\t\tx += speed; setLocation(x,y); repaint();\r\n\t}", "public void randomTeleport() {\n Random random = new Random(seed);\n seed = random.nextInt(10000);\n int randomY = RandomUtils.uniform(random, 0, worldHeight);\n int randomX = RandomUtils.uniform(random, 0, worldWidth);\n int randomDirection = RandomUtils.uniform(random, 0, 4);\n move(randomX, randomY);\n turn(randomDirection);\n }", "private void randomMove() {\n }", "void moveNorthEast(){\n xpos = xpos + 3;\n ypos = ypos-xspeed;\n if (xpos > width){ // 20\n xpos = random(-width/2, width/2); // 25\n ypos = width; // 30\n }\n }", "void setPosition(){\n Random random =new Random();\n position = new Position(random.nextInt(maxrows),random.nextInt(maxcols));\n\n }", "private void moveRandomly()\r\n {\r\n if (Greenfoot.getRandomNumber (100) == 50)\r\n turn(Greenfoot.getRandomNumber(360));\r\n else\r\n move(speed);\r\n }", "private void random() {\n GameState gs = cc.getGameState();\n ArrayList<int[]> moves = cc.getPlayerMoves(player);\n ArrayList<GameState> states = nextStates(moves, gs);\n for (int[] m : moves) {\n GameState next = checkMove(m, cc);\n states.add(next);\n }\n Random rand = new Random(System.nanoTime());\n int i = rand.nextInt(states.size());\n cc.setAIMove(states.get(i));\n }", "public int decideRandomMove() {\n return (int) (Math.random() * 4);\n }", "public int randomMove()\r\n {\r\n r = new Random();\r\n x = r.nextInt(7);\r\n return x;\r\n }", "@Override\n public void relocatedWithinBounds() {\n x = random.nextInt(maxX - width);\n y = random.nextInt(maxY - height);\n }", "public void randomWalk() {\n if (getX() % GameUtility.GameUtility.TILE_SIZE < 5 && getY() % GameUtility.GameUtility.TILE_SIZE < 5) {\n if (canChangeDirection) {\n direction = (int) (Math.random() * 3);\n direction += 1;\n direction *= 3;\n canChangeDirection = false;\n }\n }\n move(direction);\n if (timer >= timeTillChanngeDirection) {\n canChangeDirection = true;\n timer = 0;\n }\n\n if (lastLocation.x == this.getLocation().x && lastLocation.y == this.getLocation().y) {\n direction = (direction + 3) % 15;\n canChangeDirection = false;\n\n }\n lastLocation = this.getLocation();\n\n }", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "public static void Random() {\n\t\tRandom ran =new Random();\r\n\t\trandom=ran.nextInt(6)+1;\r\n\t\t//random=1;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tif((ch[who].status)>0) {\r\n\t\t\tch[who].location=(ch[who].location)+random;\r\n\t\t\tch[who].status=(ch[who].status)-1;\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\r\n\t}", "public void makeRandomMove() {\n\t\ttry{\r\n\t\t\tif (playerId == game.getState().getTurn()){\r\n\t\t\t\tgame.execute(randPlayer.requestAction(game.getState()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalArgumentException e){\r\n\t\t\t\r\n\t\t}\r\n\t}", "public void move() {\n\n int move_position_x = 0;\n int move_postion_y = 0;\n Random random = new Random();\n do {\n\n move_position_x = 0;\n move_postion_y = 0;\n int direction = random.nextInt(6);\n switch (direction) {\n case 0:\n move_postion_y = -1;\n break;\n case 1:\n case 4:\n move_postion_y = 1;\n break;\n case 2:\n case 5:\n move_position_x = 1;\n break;\n case 3:\n move_position_x = -1;\n }\n } while ((this.positionX + move_position_x < 0) || (this.positionX + move_position_x >= size_of_map) || (\n this.positionY + move_postion_y < 0) || (this.positionY + move_postion_y >= size_of_map));\n this.positionX += move_position_x;\n this.positionY += move_postion_y;\n }", "public Position sampleRandomUniformPosition();", "public void randomX() {\r\n\t\tdouble randomDub = Math.random();\r\n\t\tint randomIntX = (int)randomDub*4;\r\n\t\tthis.xcoord = randomIntX;\r\n\t}", "public int[] move(){\n double inProb = Math.random();\n if (inProb < .25){\n y--;\n }\n else if (inProb < .5){\n y ++;\n }\n else if (inProb <.75){\n x--;\n }\n else {\n x++;\n }\n int[]loc = new int[2];\n loc[0] = x;\n loc[1] = y;\n \n return loc;\n }", "public Point randomLocation() {\r\n\t\tRandom rand = new Random();\r\n\t\treturn new Point(this.location.getPosition().getX()+ rand.nextInt() % location.getSize().getHeight(),this.location.getPosition().getY()+ rand.nextInt() % location.getSize().getWidth());\r\n\t}", "public static Point pos(){\r\n\t\tRandom random = new Random();\r\n\t\tint x = 0;\r\n\t\tint y = 0;\r\n\t\t//acts as a 4 sided coin flip\r\n\t\t//this is to decide which side the asteroid will appear\r\n\t\tint pos = random.nextInt(4);\r\n\t\t//west\r\n\t\tif(pos == 0){\r\n\t\t\tx = 0;\r\n\t\t\ty = random.nextInt(601);\r\n\t\t}\r\n\t\t//north\r\n\t\telse if(pos == 1){\r\n\t\t\tx = random.nextInt(801);\r\n\t\t\ty = 0;\r\n\t\t}\r\n\t\t//east\r\n\t\telse if(pos == 2){\r\n\t\t\tx = 800;\r\n\t\t\ty = random.nextInt(601);\r\n\t\t}\r\n\t\t//\r\n\t\telse if(pos == 3){\r\n\t\t\tx = random.nextInt(801);\r\n\t\t\ty = 600;\r\n\t\t}\r\n\t\tPoint p = new Point(x,y);\r\n\t\treturn p;\r\n\t}", "void moveSouthEast(){\n xpos = xpos + 15;\n ypos = ypos + 15;\n if (xpos > width){ // 25\n xpos = random(-width, width); // 30\n ypos = 0; // 35\n }\n }", "private int Rand_Move() {\n\t\tRandom r = new Random();\n\t\tint move = NO_MOVE;\n\t\tdo{\n\t\t\tmove = r.nextInt(9);\n\t\t}while(square_empty[move] == false);\n\t\treturn move;\n\t}", "public void newCoord() {\n\t\tx = Data.generateRandomX();\n\t\ty = Data.generateRandomY();\n\t}", "public void positionShipsRandomly() {\r\n\t\tfor(Ship ship:ships) {\r\n\t\t\tpositionShipRandomly(ship,occupiedFields);\r\n\t\t}\r\n\t}", "public void setRandomSpawn(final Random random)\r\n {\r\n final List<Double> rows = new ArrayList<>();\r\n \r\n final double column;\r\n \r\n //get a random true/false result\r\n if (random.nextBoolean())\r\n {\r\n //here we will do west\r\n column = 0.5;\r\n }\r\n else\r\n {\r\n //here we will do east\r\n column = COLUMNS - 0.5;\r\n }\r\n \r\n for (double row=0; row < ROWS; row++)\r\n {\r\n //if platform exists add this as a possibility\r\n if (getObject(Type.Platform, (int)column, row) != null)\r\n rows.add(row);\r\n }\r\n \r\n super.setCol(column);\r\n \r\n final int index = random.nextInt(rows.size());\r\n super.setRow(rows.get(index) + 0.5);\r\n }", "public void randomizeDirection()\n\t{\n\t\txSpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed);\n\t\tySpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed);\n\t}", "private PointF getRandCoordinate() {\n Random r = new Random();\n float xRand = (r.nextInt(getWidth()) / density) + 1;\n float y = 10 / density;\n\n return new PointF(xRand, y);\n }", "public void takeStep() {\n \tRandom rand = new Random();\n\t\tint number = rand.nextInt(4);\n\t if(number == 0) {\n\t \tmoveNorth();\n\t \t}\n\t \telse if(number == 1) {\n\t \t\tmoveSouth();\n\t \t}\n \telse if(number == 2) {\n \t\tmoveWest();\n\t }\n\t \telse if(number == 3) {\n\t \t\tmoveEast();\n\t \t}\n }", "@Override\n public final void move() {\n int x = getPosisi().getX();\n int y = getPosisi().getY();\n int dx = 0, dy = 0;\n\n if (getWaktu() % getDeltaTime() == 0) {\n do {\n do {\n Random randomGenerator = new Random();\n dx = randomGenerator.nextInt(N_RAND) - 1;\n dy = randomGenerator.nextInt(N_RAND) - 1;\n } while (dx == 0 && dy == 0);\n } while (x + dx < 0 || x + dx > getWorldSize() - 1\n || y + dy < 0 || y + dy > getWorldSize() - 1);\n }\n setPX(x + dx);\n setPY(y + dy);\n }", "private void generateRandomPosition() {\r\n int indexX, indexY;\r\n boolean collidesWithPlayers;\r\n playerState.position.x = Integer.MIN_VALUE; // While we trying...\r\n playerState.position.y = Integer.MIN_VALUE;\r\n final ExtensiveMovingObject testObject = new ExtensiveMovingObject( 0.0f, 0.0f, 0.0f, 0.0f, GeneralConsts.WORM_WIDTH, GeneralConsts.WORM_HEIGHT );\r\n int positionGenerationTrialFailureCounter = 0;\r\n do {\r\n do {\r\n indexX = 1 + (int) ( Math.random() * ( map.getWidth () - 1 ) );\r\n indexY = 1 + (int) ( Math.random() * ( map.getHeight() - 1 ) );\r\n if ( positionGenerationTrialFailureCounter++ == MAX_POSITION_GENERATION_TRIAL_FAILURE_COUNT )\r\n if ( map.getWall( indexX, indexY ) == Map.WALL_STONE )\r\n map.setWall( indexX, indexY, Map.WALL_BRICK ); // Not to empty: it can be under water!!\r\n } while( map.getWall( indexX, indexY ) == Map.WALL_STONE ); // Stone can't be cleared: it can be part of swimming pool boundaries. (But if there isn't other places where to start, we clear it!)\r\n testObject.position.x = ( indexX << GeneralConsts.WALL_WIDTH_SHIFT ) + GeneralConsts.WALL_WIDTH / 2;\r\n testObject.position.y = ( indexY << GeneralConsts.WALL_HEIGHT_SHIFT ) + GeneralConsts.WALL_HEIGHT / 2;\r\n collidesWithPlayers = false;\r\n for ( int playerIndex = 0; playerIndex < players.length && !collidesWithPlayers; playerIndex++ )\r\n if ( playerIndex != ownIndex && players[ playerIndex ] != null && testObject.hitsExtensiveObject( players[ playerIndex ].playerState ) )\r\n collidesWithPlayers = true;\r\n try {\r\n Thread.sleep( 0, 100 );\r\n }\r\n catch( InterruptedException ie ) {\r\n }\r\n } while ( collidesWithPlayers );\r\n playerState.position.x = testObject.position.x;\r\n playerState.position.y = testObject.position.y;\r\n map.clearMapForEnteringPlayer( indexX, indexY );\r\n }", "public void randomizePointer(){\n\n pointerPos.set(p.random(BASE_POS.x,BASE_POS.x+300),p.random(BASE_POS.y-300,BASE_POS.y+300));\n while(pointerPos.dist(BASE_POS)>280 || pointerPos.dist(BASE_POS)<80 || p.atan2(pointerPos.y-BASE_POS.y,pointerPos.x - BASE_POS.x)>p.radians(60)){\n pointerPos.set(p.random(BASE_POS.x,BASE_POS.x+300),p.random(BASE_POS.y-300,BASE_POS.y+300));\n }\n }", "private void rngDirection() {\r\n Random direction = new Random();\r\n float rngX = (direction.nextFloat() -0.5f) *2;\r\n float rngY = (direction.nextFloat() -0.5f) *2;\r\n\r\n rngX = Float.parseFloat(String.format(java.util.Locale.US, \"%.1f\", rngX));\r\n rngY = Float.parseFloat(String.format(java.util.Locale.US, \"%.1f\", rngY));\r\n\r\n\r\n while(rngX == 0) {\r\n rngX = (direction.nextFloat() -0.5f) *2;\r\n }\r\n\r\n while(rngY == 0) {\r\n rngY = (direction.nextFloat() -0.5f) *2;\r\n }\r\n\r\n setSpeedX(rngX);\r\n setSpeedY(rngY);\r\n }", "public void move() {\n super.move(DIRECTION.getRandom());\n }", "public PositionInTheGameBoard()\r\n\t{\r\n\t\tthis.X = new Random().nextInt(PositionInTheGameBoard.max_X);\r\n\t\tthis.Y = new Random().nextInt(PositionInTheGameBoard.max_Y);\r\n\t}", "private void goRandomDirection() {\n\t\tdesiredDirection = Math.random() * 360.0;\n\t}", "@Override\n\tpublic void move() {\n\t\theading = Heading.randHeading();\n\t\tif (heading == Heading.NORTH) {\n\t\t\tthis.location.y -= Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t} else if (heading == Heading.EAST) {\n\t\t\tthis.location.x += Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t} else if (heading == Heading.SOUTH) {\n\t\t\tthis.location.y += Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t} else if (heading == Heading.WEST) {\n\t\t\tthis.location.x -= Utilities.rng.nextInt(Simulation.WORLD_SIZE/10);\n\t\t}\n\t\tadjustPos();\n\t\tinfect();\n\t}", "private Point randomIndex() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val1 = rand.nextInt(rows_size);\r\n\t\tint val2 = rand.nextInt(columns_size);\r\n\t\twhile (!isEmpty(val1,val2)) {\r\n\t\t\tval1 = rand.nextInt(rows_size);\r\n\t\t\tval2 = rand.nextInt(columns_size);\r\n\t\t}\r\n\t\treturn new Point(val1,val2);\r\n\t}", "public void randomMove(){\n ArrayList<Hole> availableHoles = availableMoves(nextToPlay);\n int holeIndex = (int)(Math.random() * (((availableHoles.size()-1) - 0) + 1)) + 0;\n ArrayList<Korgool> korgools = availableHoles.get(holeIndex).getKoorgools();\n while(korgools.size() == 0){\n holeIndex = (int)(Math.random() * (((availableHoles.size()-1) - 0) + 1)) + 0;\n korgools = availableHoles.get(holeIndex).getKoorgools();\n }\n redistribute(availableHoles.get(holeIndex).getHoleIndex());\n }", "public void move() {\n health -= 2; //health decrement\n age++; //age increment\n if (yPos > 300) {\n speed += 3;\n }\n boolean canMove = false;\n int distancex = (int) (Math.random() * speed);\n int distancey = (int) (Math.random() * speed);\n int counterx = r.nextInt(2);\n int countery = r.nextInt(2);\n while (!canMove) {\n distancex = (int) (Math.random() * speed);\n distancey = (int) (Math.random() * speed);\n counterx = r.nextInt(2);\n countery = r.nextInt(2);\n if (counterx == 0 && this.xPos - distancex > 0\n && countery == 0 && this.yPos - distancey > 0) {\n canMove = true;\n } else if (counterx == 1 && this.xPos + distancex < 510\n && countery == 1 && this.yPos + distancey < 530) {\n canMove = true;\n }\n }\n if (counterx == 0 && countery == 0) {\n xPos -= distancex;\n yPos -= distancey;\n } else if (counterx == 0 && countery == 1) {\n xPos -= distancex;\n yPos += distancey;\n } else if (counterx == 1 && countery == 0) {\n xPos += distancex;\n yPos -= distancey;\n } else if (counterx == 1 && countery == 1) {\n xPos += distancex;\n yPos += distancey;\n }\n }", "private void createRandomGame() {\n ArrayList<int[]> usedCoordinates = new ArrayList<>();\n\n // make sure the board is empty\n emptyBoard();\n\n //find different coordinates\n while (usedCoordinates.size() < 25) {\n int[] temp = new int[]{randomNumberGenerator.generateInteger(size), randomNumberGenerator.generateInteger(size)};\n\n // default contains(arraylist) doesn't work because it compares hashcodes\n if (! contains(usedCoordinates, temp)) {\n usedCoordinates.add(temp);\n }\n }\n\n for (int[] usedCoordinate : usedCoordinates) {\n board.setSquare(usedCoordinate[0], usedCoordinate[1], randomNumberGenerator.generateInteger(size) + 1);\n }\n\n //save start locations\n startLocations = usedCoordinates;\n }", "public Position randposition()\r\n\t{\n\t\tRandom random = new Random();\r\n\t\tPosition position = new Position(random.nextInt(7680), random.nextInt(4320), random.nextDouble());\r\n\t\treturn position;\r\n\t}", "private Vector3 randomLocationMonster() {\n\t\t\n\t\tVector3 center = this.getEngine().getSceneManager().getRootSceneNode().getLocalPosition();\n\t\tVector3 randomPosition;\n\t\tfloat[] randomFloat;\n\t\tdo {\n\t\t\trandomFloat = randomFloatArray(1000);\n\t\t\trandomPosition = Vector3f.createFrom(randomFloat[0], 1.5f, randomFloat[2]);\n\t\t} while (distanceFrom(center, randomPosition) > 380f);\n\t\treturn randomPosition;\n\t}", "private void setMines(){\n Random random = new Random();\r\n int counter = mines;\r\n while(counter>0){\r\n int rx = random.nextInt(this.x); //without +1 because it can be 0\r\n int ry = random.nextInt(this.y);\r\n if( ! this.grid[rx][ry].isMine() ){\r\n this.grid[rx][ry].setMine();\r\n counter--; \r\n }\r\n }\r\n \r\n }", "public static int randomPosition(){\r\n int max = 4;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n int pos = randNum;\r\n \r\n return pos;\r\n }", "public void generateRandomPosition(Zone samusZone) {\n\t\t\n\t\tint i = samusZone.getI(), j = samusZone.getJ();\n\t\twhile(i == samusZone.getI() && j == samusZone.getJ()) {\n\t\t\ti = ThreadLocalRandom.current().nextInt(1, 12 + 1);\n\t\t\tj = ThreadLocalRandom.current().nextInt(1, 12 + 1);\n\t\t}\n\t\t\n\t\tsamusZone.getSamus().setI(i);\n\t\tsamusZone.getSamus().setJ(j);\n\t}", "public void random_dragao(int pos) {\n\t\tint randomX = 1;\n\t\tint randomY = 1;\n\t\twhile (true) {\n\t\t\trandomX = (int)(1 + Math.random()*labirinto.getSize());\n\t\t\trandomY = (int)(1 + Math.random()*labirinto.getSize());\n\t\t\trandomX--;\n\t\t\trandomY--;\n\t\t\tif (labirinto.getLab()[randomX][randomY] == ' ')\n\t\t\t\tbreak;\n\t\t}\n\t\tdragoes[pos].setX_coord(randomX);\n\t\tdragoes[pos].setY_coord(randomY);\n\t\tchange_dragon_pos(pos);\n\t}", "public void randomY() {\r\n\t\tdouble randomDub = Math.random();\r\n\t\tint randomIntY = (int)randomDub*4;\r\n\t\tthis.ycoord = randomIntY;\r\n\t}", "private void locateApple() {\n xApplePosition = random.nextInt(32);\n yApplePosition = random.nextInt(21);\n }", "public void placeRandomNumbers() {\n\t\t\n\t\tArrayList<HexLocation> locations = getShuffledLocations();\n\t\tint[] possibleNumbers = new int[] {2, 3, 3, 4, 4, 5, 5, 6, 6, 8, 8, 9, 9, 10, 10, 11, 11, 12};\n\t\t\n\t\tfor (int i = 0; i < possibleNumbers.length; i++)\n\t\t\tnumbers.get(possibleNumbers[i]).add(locations.get(i));\n\t}", "private static Position fetchRandomPosition(){\n return new Position(0,0).returnRandomPosition();\n }", "private PositionData getRandomPoint() {\r\n int posX = new Random().nextInt(Constants.WIDTH);\r\n int posY = new Random().nextInt(Constants.HEIGHT);\r\n //make sure point is open\r\n while(!isOpenSpace(posX, posY)) {\r\n posX = new Random().nextInt(Constants.WIDTH);\r\n posY = new Random().nextInt(Constants.HEIGHT);\r\n }\r\n return new PositionData(posX, posY, Constants.PLAYER_A_ID);\r\n }", "public static void randomMove(Board b){\r\n if (!b.getGameOver()){ //make sure game is not already over\r\n Random rand = new Random();\r\n int xIndex = rand.nextInt(7);\r\n int yIndex = 0;\r\n \r\n // make sure random column is not already full\r\n while (b.getGameGridCircle(xIndex,yIndex).getState() != 0) {\r\n xIndex = (xIndex + 1)%7;\r\n }\r\n //find the lowest empty slot in the chosen column\r\n //Place a circle there\r\n while(b.getGameGridCircle(xIndex, yIndex+1).getState() == 0){\r\n yIndex++;\r\n if (yIndex == b.numRows - 1) {\r\n break;\r\n }\r\n }\r\n\t //change state,turn,draw counter and refresh the board\r\n b.getGameGridCircle(xIndex,yIndex).setState(b.getTurn());\r\n b.setTurn(1);\r\n b.repaint();\r\n b.setDrawCounter(b.getDrawCounter() + 1);\r\n }\r\n }", "public void randomWalk(){\r\n int newAngle = (int) ( (double) Math.random() * 360) ;\r\n\r\n super.xVelocity = (velocity * Math.cos(newAngle * Math.PI/180));\r\n super.yVelocity = (velocity * Math.cos(newAngle * Math.PI/180));\r\n }", "public static int randomPos(int grid) {\n Random rand = new Random();\n return rand.nextInt((grid));\n }", "private Position getRandomMove(TicTacToeBoard state) {\r\n\t\tArrayList<Position> availableMoves = new ArrayList<Position>();\r\n\t\tfor( int row = 0; row < TicTacToeBoard.SIZE; row++ ) {\r\n\t\t\tfor( int col = 0; col < TicTacToeBoard.SIZE; col++ ) {\r\n\t\t\t\tif( state.getState(row,col) == TicTacToeBoard.BLANK ) {\r\n\t\t\t\t\tavailableMoves.add(new Position(row,col));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (Position)availableMoves.get(rand.nextInt(availableMoves.size()));\r\n\t}", "public Coordinate generatePosition() {\n Random rng = new Random();\n return new Coordinate(rng.nextFloat(), rng.nextFloat());\n }", "private void locate() {\n possibleLocations[0][0] = false;\n possibleLocations[0][1] = false;\n possibleLocations[1][0] = false;\n do {\n location.randomGenerate();\n } while (!possibleLocations[location.y][location.x]);\n }", "@Override\r\n\tpublic void nextStep() {\n\t\tif (this.oldX == this.coord.x && this.oldY == this.coord.y) { \r\n\t\t\tthis.currentPoint = (int) (Math.random()*this.patrol.size());\r\n\t\t\tthis.targetX = this.patrol.get(currentPoint).x;\r\n\t\t\tthis.targetY = this.patrol.get(currentPoint).y;\r\n\r\n\t\t}\r\n\r\n\t\t// target point reached, make new random target point\r\n\t\tif (this.targetX == this.coord.x && this.targetY == this.coord.y) {\r\n\t\t\tif (this.currentPoint < patrol.size() - 1)\r\n\t\t\t\tthis.currentPoint++;\r\n\t\t\telse\r\n\t\t\t\tthis.currentPoint = 0;\r\n\r\n\t\t\tthis.targetX = this.patrol.get(currentPoint).x;\r\n\t\t\tthis.targetY = this.patrol.get(currentPoint).y;\r\n\t\t}\r\n\t\tint step = (this.speed == Speed.fast ? 8 : 4);\r\n\t\t// int stepX = (int) (1 + Math.random() * step);\r\n\t\t// int stepY = (int) (1 + Math.random() * step);\r\n\t\tint x0 = (int) (this.coord.getX());\r\n\t\tint y0 = (int) (this.coord.getY());\r\n\r\n\t\tint dx = this.targetX - x0;\r\n\t\tint signX = Integer.signum(dx); // get the sign of the dx (1-, 0, or\r\n\t\t\t\t\t\t\t\t\t\t// +1)\r\n\t\tint dy = this.targetY - y0;\r\n\t\tint signY = Integer.signum(dy);\r\n\t\tthis.nextX = x0 + step * signX;\r\n\t\tthis.nextY = y0 + step * signY;\r\n\t\tthis.oldX = this.coord.x;\r\n\t\tthis.oldY = this.coord.y;\r\n\t\t// System.err.println(\"targetX,targetY \"+targetX+\" \"+targetY);\r\n\t}", "public void move() {\n\t\tif (type.equals(\"Fast\")) {\n\t\t\tspeed = 2;\n\t\t}else if (type.equals(\"Slow\")){\n\t\t\tspeed = 4;\n\t\t}\n\t\t\n\t\tif (rand.nextInt(speed) == 1){\n\t\t\tif (currentLocation.x - ChristopherColumbusLocation.x < 0) {\n\t\t\t\tif (currentLocation.x + 1 < oceanMap.getDimensions()) {\n\t\t\t\t\tcurrentLocation.x++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (currentLocation.x != 0) {\t\t\t\t\n\t\t\t\t\tcurrentLocation.x--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (currentLocation.y - ChristopherColumbusLocation.y < 0) {\n\t\t\t\tif (currentLocation.y + 1 < oceanMap.getDimensions()) {\n\t\t\t\t\tcurrentLocation.y++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (currentLocation.y != 0) {\n\t\t\t\t\tcurrentLocation.y--;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t}", "private Vector3 randomLocationDolphin() {\n\t\tVector3 center = this.getEngine().getSceneManager().getRootSceneNode().getLocalPosition();\n\t\tVector3 randomPosition;\n\t\tfloat[] randomFloat;\n\t\tdo {\n\t\t\trandomFloat = randomFloatArray(1000);\n\t\t\trandomPosition = Vector3f.createFrom(randomFloat[0], 0.0f, randomFloat[2]);\n\t\t} while (distanceFrom(center, randomPosition) < 420f);\n\t\treturn randomPosition;\n\t}", "public Location selectMoveLocation(ArrayList<Location> locs)\n {\n int n = locs.size();\n if (n == 0)\n return getLocation();\n int r = (int) (Math.random() * n);\n return locs.get(r);\n }", "@Override\r\n public void move(List<Building> landmark, List<Pair<Integer, Integer>> orderedPath) {\r\n int moveChoice = (new Random()).nextInt(2);\r\n // 50% chance to move or not move\r\n if (moveChoice == 0){\r\n // Does not move, i.e. does nothing\r\n }\r\n else if (moveChoice == 1){\r\n // Move\r\n int directionChoice = (new Random()).nextInt(2);\r\n if (directionChoice == 0) {\r\n moveUpPath();\r\n } else if (directionChoice == 1) {\r\n moveDownPath();\r\n }\r\n }\r\n }", "void move()\n {\n Random rand = new Random();\n int moveOrNot = rand.nextInt(2);//50% chance\n if(moveOrNot == 1)\n super.move();\n }", "private void initPosition() {\r\n while (true) {\r\n int x = RandomUtil.nextInt(boardLength);\r\n int y = RandomUtil.nextInt(boardLength);\r\n if (board.isSimple(x, y)) {\r\n heroTeam.setPosition(x, y);\r\n board.setTeamPosition(x, y);\r\n break;\r\n }\r\n }\r\n }", "City(){\n x_coordinate = (int)(Math.random()*200);\n y_coordinate = (int)(Math.random()*200);\n }", "public Location getRandomLocation() {\n\t\tint x = rand.nextInt(WORLD_SIZE);\n\t\tint y = 12;\n\t\tint z = rand.nextInt(WORLD_SIZE);\n\t\treturn new Location(x, y, z);\n\t}", "public static Location genRandomSpawn() {\n final Random r = new Random();\n\n final World world = Bukkit.getWorld(\"Normal_tmp\");\n\n final int half = WIDTH / 2,\n x = randomBetween(r, -half + CENTERX, half + CENTERX),\n z = randomBetween(r, -half + CENTERZ, half + CENTERZ);\n\n return permutateLocation(new Location(world, x, 0, z));\n }", "private void randomPosBoats(GameData gameData) {\n int x0 = 0;\n int y0 = 0;\n for ( int n = gameData.getBoatArray().size()-1; n>=0; n--){\n Boat b = gameData.getBoatArray().get(n);\n Random rand = new Random();\n int l = b.getLength();\n\n boolean retry = true;\n while(retry) {\n int direction = rand.nextInt(2);\n\n //HORIZONTAL\n if (direction == 1) {\n x0 = rand.nextInt(gameData.getBoard().getWidth() - l);\n y0 = rand.nextInt(gameData.getBoard().getHeight());\n\n // we suppose it's a good starting point\n retry = false;\n for (int i = 0; i < l; i++) {\n //if one of the tiles already has a boat\n if (gameData.existsBoatAround(x0 + i, y0)) {\n retry = true;\n }\n }\n //POSITION BOAT\n if (!retry) {\n ArrayList pos = new ArrayList();\n for (int i = 0; i < l; i++) {\n int x = x0 + i;\n gameData.getMatrix()[y0][x] = b.getBoatid();\n pos.add(new int[]{x, y0});\n }\n b.setPositions(pos);\n }\n\n //VERTICAL\n } else {\n // determine the tile on which to start\n x0 = rand.nextInt(gameData.getBoard().getWidth());\n y0 = rand.nextInt(gameData.getBoard().getHeight() - l);\n\n // we suppose it's a good starting point\n retry = false;\n for (int i = 0; i < l; i++) {\n if (gameData.existsBoatAround(x0, y0 + i)) {\n retry = true;\n }\n }\n if(!retry){\n ArrayList pos = new ArrayList();\n for (int i = 0; i < l; i++) {\n int y = y0 + i;\n gameData.getMatrix()[y][x0] = b.getBoatid();\n pos.add(new int[]{x0, y});\n }\n b.setPositions(pos);\n }\n }\n }\n }\n }", "public void randomize() {\r\n\t\tRandom random = new Random();// random generator used to get random int\r\n\t\tint r;// will hold the random int\r\n\t\tint num;// will hold the filtered random int that determines with entity to use for a tile\r\n\t\tfor (int i = 0; i < WIDTH_TILES; i++) {// loops x-coords\r\n\t\t\tfor (int j = 0; j < HEIGHT_TILES; j++) {// loops y-coords\r\n\t\t\t\tr = random.nextInt(32);// gets random int from 0 to 32\r\n\t\t\t\tif (r < 4) num = 0; else if (r < 8) num = 1; else if (r < 31) num = 2; else num = 3;// distributes different objects\r\n\t\t\t\tif (nodes[i * WIDTH_TILES + j].isOccupied() == false) {// if tile empty or random chosen\r\n\t\t\t\t\tnodes[i * WIDTH_TILES + j] = new Node(new Point(i * BOARD_WIDTH / WIDTH_TILES, j * BOARD_WIDTH / HEIGHT_TILES), new ImageIcon(icons[num]).getImage(), true, occupants[num]);// creates random tile\r\n\t\t\t\t}// if (random)\r\n\t\t\t}// for (j)\r\n\t\t}// for (i)\r\n\t}", "public void move() {\n\t\tif (isLuck) {\n\t\t\tif (rand.nextBoolean()) {\n\t\t\t\txPos++;\n\t\t\t}\n\t\t} else {\n\t\t\tif (rightCount < skill) {\n\t\t\t\trightCount++;\n\t\t\t\txPos++;\n\t\t\t}\n\t\t}\n\t}", "@Override\n public Move makeMove() {\n Random random = new Random();\n int max = this.board.getBoardDimension()*4 - 1;\n int row = random.nextInt(max);\n int col = random.nextInt(max);\n Point point = new Point(row, col);\n\n while (!this.board.validPoint(point)) {\n row = random.nextInt(max);\n col = random.nextInt(max);\n point.setPoint(row, col);\n }\n\n Move m = new Move();\n m.P = this.player;\n m.Row = row;\n m.Col = col;\n\n this.board.update(m);\n return m;\n }", "public Location getRandomLocationForPlayers() {\n\t\tfinal Location temp = getRandomLocationForMobs();\n\t\t\n\t\treturn new Location(temp.getWorld(), temp.getBlockX(), temp.getBlockY() + 1, temp.getBlockZ());\n\t}", "public Location getRandomLocationForMobs() {\n\t\tfinal Location temp = getRandomLocation();\n\t\t\n\t\treturn new Location(temp.getWorld(), temp.getBlockX() + 0.5, temp.getBlockY() + 0.5, temp.getBlockZ() + 0.5);\n\t}", "public void randomHit() throws LocationHitException{\r\n\t\t// Random ran = new Random();\r\n\t\tint x = randomX();\r\n\t\tint y = randomY();\r\n\r\n\t\tboolean newHit = false;\r\n\t\twhile (!newHit) {\r\n\t\t\tif (Player.userGrid[x][y] == 2) {\r\n\t\t\t\tx = ran.nextInt(9);\r\n\t\t\t\ty = ran.nextInt(11);\r\n\t\t\t} else\r\n\t\t\t\tnewHit = true;\r\n\t\t}\r\n\t\tint hitCoord[] = { x, y };\r\n\t\tsetCoords(hitCoord);\r\n\t\tString coordx = Integer.toString(x);\r\n\t\tString coordy = Integer.toString(y);\r\n\t\tif (Player.userGrid[x][y] == 1) {\r\n\t\t\t// change the grid value from 1 to 2 to signify hit\r\n\t\t\tPlayer.userGrid[x][y] = 2;\r\n\t\t\t\r\n\t\t\tif(!time1) {\r\n\t\t\t\ttimea=java.lang.System.currentTimeMillis();\r\n\t\t\t\ttime1=!time1;\r\n\t\t\t}else if(!time2) {\r\n\t\t\t\ttimeb=java.lang.System.currentTimeMillis();\r\n\t\t\t\t\ttime2=!time2;\r\n\t\t\t}else {\r\n\t\t\t\tdouble t=timeb-timea;\r\n\t\t\t\tif(t<3000) {\r\n\t\t\t\t\tsetScore(20);\r\n\t\t\t\t}\r\n\t\t\t\ttime1=false;\r\n\t\t\t\ttime2=false;\r\n\t\t\t\ttimea=0;\r\n\t\t\t\ttimeb=0;\r\n\t\t\t\t\r\n\t\t\t}//if time between consecutive hit is less than 3 seconds ,then bonus score\r\n\t\t\tsetScore(10);\r\n\t\t\tPlayer.coordinatesHit.add(coordx + \",\" + coordy);\r\n\t\t\tsetReply(\"It's a Hit!!!!!\");\r\n\r\n\t\t} else if (Player.userGrid[x][y] == 0) {\r\n\t\t\tPlayer.userGrid[x][y] = 3;\r\n\t\t\tsetScore(-1);\r\n\t\t\tsetReply(\"It's a miss!!!!!\");\r\n\t\t} else if (Player.userGrid[x][y] == 2 || Player.userGrid[x][y] == 3) {\r\n\t\t\tsetReply(\"The location has been hit earlier\");\r\n\t\t\t //throw new LocationHitException(\"The location has been hit earlier\");\r\n\t\t}\r\n\t}", "private void computerTurn() {\r\n\t\tPoint index = randomIndex();\r\n\t\tSETslot((int)index.getX(), (int)index.getY(), randomValue());\r\n\t}", "public void randomizeLocations() {\n\t// Get a seeded pseudo random-number generator\n\tDate today = new Date();\n\tRandom random = new Random(today.getTime());\n\t// Reset our min and max values\n\tresetNodes();\n\n\tfor (LayoutNode node: nodeList) {\n\n\t if (!node.isLocked()) {\n\t\tdouble x = random.nextDouble() * width;\n\t\tdouble y = random.nextDouble() * height;\n\t\tnode.setLocation(x, y);\n\t\tupdateMinMax(x, y);\n\t } else {\n\t\tupdateMinMax(node.getX(), node.getY());\n\t }\n\t}\n }", "@Test\n public void testplaceRandomChecker()\n {\n player2.placeChecker(0, 0);\n \n // 1) Create Available Moves & Add To Player 1's Moves Collection\n // 2) Pick an Available Move at Random\n Move randomMove = player1.generateRandomMove();\n \n int x = randomMove.getX();\n int y = randomMove.getY();\n \n // Check that X coordinate of Random Move is Up/Down/Unchanged\n assertTrue(x == player2.getXPosition()+1 || x== player2.getXPosition()-1 || x== player2.getXPosition());\n \n // Check that Y coordinate of Random Move is Left/Right/Unchanged\n assertTrue(y == player2.getYPosition()+1 || y== player2.getYPosition()-1 || y== player2.getYPosition());\n \n // Check Random Move Was Successfull\n assertEquals(player1,game.getBoard()[x][y].getOwner()); \n \n }", "public void mouseMovements() throws InterruptedException{\n\t\t\r\n\t\tint intMouseX = (int)random(10,700);\r\n\t\tint intMouseY = (int)random(10,400);\r\n\t\tint randomMouse = (int)random(0,1000);\r\n\t\t\r\n\t\t// small movements\r\n\t\tif (randomMouse <= 400) {\r\n\t\t\tgetMouse().move(intMouseX,intMouseY);\r\n\t\t\tsleep(random(100,300));\r\n\t\t\tgetMouse().move((intMouseX + random(20,70)),(intMouseY + random(10,50)));\r\n\t\t\tsleep(random(100,300));\r\n\t\t\r\n\t\t\tif (randomMouse <= 300) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(20,70)),(intMouseY + random(10,50)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (randomMouse <= 375) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(20,70)),(intMouseY + random(10,50)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\tgetMouse().move((intMouseX + random(20,70)),(intMouseY + random(10,50)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// medium movements\r\n\t\telse if (randomMouse <= 800) {\r\n\t\t\tgetMouse().move(intMouseX,intMouseY);\r\n\t\t\tsleep(random(100,300));\r\n\t\t\tgetMouse().move((intMouseX + random(100,200)),(intMouseY + random(100,200)));\r\n\t\t\tsleep(random(100,300));\r\n\t\t\r\n\t\t\tif (randomMouse <= 600) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(100,200)),(intMouseY + random(100,200)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (randomMouse <= 675) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(100,200)),(intMouseY + random(100,200)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\tgetMouse().move((intMouseX + random(100,200)),(intMouseY + random(100,200)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// large movements\r\n\t\telse if (randomMouse <= 1000) {\r\n\t\t\tgetMouse().move(intMouseX,intMouseY);\r\n\t\t\tsleep(random(100,300));\r\n\t\t\tgetMouse().move((intMouseX + random(200,300)),(intMouseY + random(200,300)));\r\n\t\t\tsleep(random(100,300));\r\n\t\t\r\n\t\t\tif (randomMouse <= 950) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(200,300)),(intMouseY + random(200,300)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (randomMouse <= 990) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(200,300)),(intMouseY + random(200,300)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\tgetMouse().move((intMouseX + random(200,300)),(intMouseY + random(200,300)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tlog(\"something went wrong with antiban mouse movement\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public void mouseMovements() throws InterruptedException{\n\t\t\r\n\t\tint intMouseX = (int)random(10,700);\r\n\t\tint intMouseY = (int)random(10,400);\r\n\t\tint randomMouse = (int)random(0,1000);\r\n\t\t\r\n\t\t// small movements\r\n\t\tif (randomMouse <= 400) {\r\n\t\t\tgetMouse().move(intMouseX,intMouseY);\r\n\t\t\tsleep(random(100,300));\r\n\t\t\tgetMouse().move((intMouseX + random(20,70)),(intMouseY + random(10,50)));\r\n\t\t\tsleep(random(100,300));\r\n\t\t\r\n\t\t\tif (randomMouse <= 300) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(20,70)),(intMouseY + random(10,50)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (randomMouse <= 375) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(20,70)),(intMouseY + random(10,50)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\tgetMouse().move((intMouseX + random(20,70)),(intMouseY + random(10,50)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// medium movements\r\n\t\telse if (randomMouse <= 800) {\r\n\t\t\tgetMouse().move(intMouseX,intMouseY);\r\n\t\t\tsleep(random(100,300));\r\n\t\t\tgetMouse().move((intMouseX + random(100,200)),(intMouseY + random(100,200)));\r\n\t\t\tsleep(random(100,300));\r\n\t\t\r\n\t\t\tif (randomMouse <= 600) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(100,200)),(intMouseY + random(100,200)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (randomMouse <= 675) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(100,200)),(intMouseY + random(100,200)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\tgetMouse().move((intMouseX + random(100,200)),(intMouseY + random(100,200)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// large movements\r\n\t\telse if (randomMouse <= 1000) {\r\n\t\t\tgetMouse().move(intMouseX,intMouseY);\r\n\t\t\tsleep(random(100,300));\r\n\t\t\tgetMouse().move((intMouseX + random(200,300)),(intMouseY + random(200,300)));\r\n\t\t\tsleep(random(100,300));\r\n\t\t\r\n\t\t\tif (randomMouse <= 950) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(200,300)),(intMouseY + random(200,300)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (randomMouse <= 990) {\r\n\t\t\t\tgetMouse().move((intMouseX + random(200,300)),(intMouseY + random(200,300)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\tgetMouse().move((intMouseX + random(200,300)),(intMouseY + random(200,300)));\r\n\t\t\t\tsleep(random(100,300));\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tlog(\"something went wrong with antiban mouse movement\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public void step()\n {\n\t int rows = grid.length-1;\n\t int cols = grid[0].length-1;\n\t int direction = (int) (Math.random()*3);\n\t direction--;\n\t int row = (int) (Math.random()*rows);\n\t //System.out.println(row);\n\t int col = (int) (Math.random()*cols);\n\t //System.out.println(col);\n\t if(grid[row][col] == SAND && (grid[row+1][col] == EMPTY || grid[row+1][col] == WATER)) {\n\t\t grid[row+1][col] = SAND;\n\t\t grid[row][col] = EMPTY;\n\t }\n\t if(grid[row][col] == WATER && grid[row+1][col] == EMPTY) {\n\t\t if(col != 0) {\n\t\t\t grid[row+1][col+direction] = WATER;\n\t\t\t grid[row][col] = EMPTY;\n\t\t }\n\t\t else {\n\t\t\t grid[row+1][col] = WATER;\n\t\t\t grid[row][col] = EMPTY;\n\t\t }\n\t }\n }", "public void moveTaxiesRandomly() {\n\t\tRandom rand = new Random();\n\t\tfor (Taxi taxi : taxiSet.getTaxies()) {\n\t\t\tint shiftX = rand.nextInt(3) - 1;\n\t\t\tint shiftY = rand.nextInt(3) - 1;\n\t\t\ttaxi.move(shiftX, shiftY);\n\t\t} \n\n\t}", "private void move()\r\n {\r\n int num = Game.random(4);\r\n String direction;\r\n if (num == 0)\r\n direction = \"north\";\r\n else if (num == 1)\r\n direction = \"east\";\r\n else if (num == 2)\r\n direction = \"south\";\r\n else //num == 3\r\n direction = \"west\";\r\n Room nextRoom = room.nextRoom(direction);\r\n if (nextRoom != null)\r\n {\r\n changeRoom(nextRoom);\r\n \r\n //Monster or Robot greets everyone was already in the room\r\n ArrayList<Person> peopleList = new ArrayList<Person>();\r\n \r\n peopleList = nextRoom.getPeople();\r\n peopleList.remove(name);\r\n \r\n String greetings =\"Hey \";\r\n for (int i=0; i<peopleList.size(); i++)\r\n \tgreetings += peopleList.get(i).getName() + \", \";\r\n\r\n if (!(peopleList.size()==0))\r\n \tsay(greetings);\r\n } \r\n \r\n }", "public abstract void randomMoves();", "private GameWorld.Position randomAvatarPosition(GameWorld world) {\n int xVal = world.getRand().nextInt(world.WIDTH - 1);\n int yVal = world.getRand().nextInt(world.HEIGHT - 1);\n if (world.getNumOfSq() > 0) {\n while (!(world.world[xVal][yVal].equals(Tileset.FLOOR))) {\n xVal = world.getRand().nextInt(world.WIDTH - 1);\n yVal = world.getRand().nextInt(world.HEIGHT - 1);\n }\n System.out.println(yVal);\n System.out.println(\"therethere\");\n world.avatarPosition = new GameWorld.Position(xVal, yVal);\n return world.avatarPosition;\n }\n return new GameWorld.Position(xVal, yVal);\n }", "public void changeSpeed() {\n Random gen = new Random();\n speedX += gen.nextInt(3);\n speedY += gen.nextInt(3);\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}", "protected boolean teleportRandomly() {\n double x = this.posX + (this.rand.nextDouble() - 0.5) * 64.0;\n double y = this.posY + (this.rand.nextInt(64) - 32);\n double z = this.posZ + (this.rand.nextDouble() - 0.5) * 64.0;\n return this.teleportTo(x, y, z);\n }", "public static double setRot(Point position){\r\n\t\tRandom random = new Random();\r\n\t\t//the canvas gets divided into 4 parts\r\n\t\t//west side\r\n\t\tif(position.x < 400){\r\n\t\t\t//north west\r\n\t\t\tif(position.y < 300){\r\n\t\t\t\treturn random.nextInt(61-30) + 30;\r\n\t\t\t}\r\n\t\t\t//south west\r\n\t\t\telse{\r\n\t\t\t\treturn random.nextInt(331-300) + 300;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//east side\r\n\t\telse{\r\n\t\t\t//north east\r\n\t\t\tif(position.y < 300){\r\n\t\t\t\treturn random.nextInt(151-120) + 120;\r\n\t\t\t}\r\n\t\t\t//south east\r\n\t\t\telse{\r\n\t\t\t\treturn random.nextInt(241-210) + 210;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void shield_random_start() {\n\t\tint randomX;\n\t\tint randomY;\n\t\twhile (true) {\n\t\t\trandomX = (int)(1 + Math.random()*labirinto.getSize());\n\t\t\trandomY = (int)(1 + Math.random()*labirinto.getSize());\n\t\t\trandomX--;\n\t\t\trandomY--;\n\t\t\tif (labirinto.getLab()[randomX][randomY] == ' ')\n\t\t\t\tbreak;\n\t\t}\n\t\tescudo.setX_coord(randomX); \n\t\tescudo.setY_coord(randomY);\n\t\tchange_escudo_pos();\n\t}", "private Point getRandomMiniPoint()\n {\n Random r = new Random();\n\n // Random x value\n int minX = 0;\n int x = 0;\n int maxX = findViewById(R.id.the_canvas).getWidth() - ((GameBoard)findViewById(R.id.the_canvas)).getMiniSpriteWidth();\n x = r.nextInt(maxX-minX+1)+minX;\n\n // Start at the top\n int y = 0;\n\n return new Point (x,y);\n }", "private void createPosition() {\n\n switch (new Random().nextInt(4)) {\n\n case 0:\n sendString = enemyPositionX.nextInt(Window.WIDTH) + \":-90\";\n break;\n\n case 1:\n sendString = enemyPositionX.nextInt(Window.WIDTH) + \":\" + (Window.HEIGHT + 90);\n break;\n\n case 2:\n sendString = \"-90:\" + enemyPositionY.nextInt(Window.HEIGHT);\n break;\n\n case 3:\n sendString = (Window.WIDTH + 90) + \":\" + enemyPositionY.nextInt(Window.HEIGHT);\n break;\n }\n sendString += \":\" + new Random().nextInt(4);\n sendString += \":\" + new Random().nextInt(2);\n }", "public void update() {\n if(mGame.getState() != Game.States.PLAYING) return;\n\n if(mMap.getX() >= next) {\n generate(rand.nextInt(3) + 1);\n }\n }", "private MoveAction wanderRandomly() {\n\t\tint intDir = rand.nextInt(8) + 1;\n\t\tDirection direction = Direction.fromInt(intDir);\n\t\treturn moveInDirection(direction);\n\t}", "public void selectMoveLocation(ArrayList<Location> locs) {\n\n\tif (!locs.isEmpty()) {\n\n\t int size = locs.size();\n\t int maxIndex = 0;\n\t Location loc = getLocation();\n\t double totalWeight = 0;\n\t double key;\n\t double weight;\n\n\t for (int direction : dirCounter.keySet()) {\n\t \n\t\ttotalWeight += dirCounter.get(direction);\n\t }\n\n\t weight = (double)dirCounter.get(loc.getDirectionToward(locs.get(0))) / totalWeight;\n\t double maxKey = Math.pow(Math.random(), (1.0 / weight));\n\t for (int i = 1; i < size; i++) {\n\n\t\tweight = dirCounter.get(loc.getDirectionToward(locs.get(i))) / totalWeight;\n\t\tkey = Math.pow(Math.random(), (1.0 / weight ));\n\n\t\tif (maxKey < key) {\n\t\t maxKey = key;\n\t\t maxIndex = i;\n\t\t}\n\t }\n\t next = locs.get(maxIndex);\n\t}\n\n }", "private void moveComputer(String[][] gameState) {\n possiblemoves possibleMoves = new possiblemoves();\r\n String moves = possibleMoves.calculateMoves(gameState);\r\n String[] arrMoves = moves.split(\"\\\\r?\\\\n\");\r\n int randIndex = (int) (Math.random() * arrMoves.length);\r\n // Choose one of the possible moves at random\r\n String choosenSpace = arrMoves[randIndex];\r\n int xPosition = Character.getNumericValue(choosenSpace.charAt(0));\r\n int yPosition = Character.getNumericValue(choosenSpace.charAt(2));\r\n gameState[xPosition][yPosition] = \"o\";\r\n }" ]
[ "0.8080077", "0.76190615", "0.7458756", "0.74246293", "0.73824584", "0.73442775", "0.7324188", "0.729575", "0.7288303", "0.7269668", "0.72268575", "0.7178555", "0.715377", "0.71534175", "0.7128515", "0.7048326", "0.7020311", "0.6998797", "0.69938254", "0.69878525", "0.6951908", "0.6946723", "0.69259155", "0.69040775", "0.69009715", "0.6866189", "0.6864071", "0.6863037", "0.68552667", "0.6848236", "0.6842485", "0.6821664", "0.67952996", "0.67879874", "0.6732773", "0.6708654", "0.670742", "0.6681268", "0.6635191", "0.66297483", "0.66221017", "0.6612364", "0.66058797", "0.6598688", "0.65864474", "0.65767926", "0.65766585", "0.65765476", "0.6570512", "0.65594995", "0.65456694", "0.653819", "0.65230346", "0.651608", "0.6493226", "0.6491391", "0.6487572", "0.64832425", "0.6482621", "0.6481362", "0.6480752", "0.64602834", "0.64566827", "0.6455231", "0.6443887", "0.6438275", "0.6434709", "0.64271957", "0.6422286", "0.6404546", "0.64016485", "0.63957995", "0.63910156", "0.6386538", "0.63810056", "0.6374559", "0.63671774", "0.6366546", "0.6362302", "0.6357263", "0.6344714", "0.63392895", "0.63316", "0.63316", "0.63284796", "0.63260007", "0.631", "0.6293289", "0.6290426", "0.6286586", "0.62820154", "0.62704796", "0.62697476", "0.62400824", "0.6215502", "0.62143135", "0.6202175", "0.6192761", "0.6178717", "0.6176335" ]
0.6716599
35
Current fish fucks in order to create another fish at the coordinates in parameters
private void fuck(int x, int y) { Fish son = new Fish(x, y, this.environment, this.appConfig, this.scheduler); son.color = Color.YELLOW; // yellow when fish is a newborn this.environment.addAgent(son, x, y); this.scheduler.birth(son); this.breedTime = this.appConfig.getFishBreedTime(); // reset breed time }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void eat(ArrayList<Fish> list) {\n\t\tSystem.out.println(\">>>>>\"+list.size());\n\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\t// ¾ØÐÎÏཻ¾ÍÅжÏsize\n\t\t\tFish fish1 = this;\n\t\t\tFish fish2 = list.get(i);\n\t\t\tif (fish1 != fish2\n\t\t\t\t\t&& ((fish1.x >= fish2.x && fish1.x <= fish2.x + fish2.size && fish1.y >= fish2.y\n\t\t\t\t\t\t\t&& fish1.y <= fish2.y + fish2.size)\n\t\t\t\t\t|| (fish1.x >= fish2.x && fish1.x <= fish2.x + fish2.size && fish1.y + fish1.size >= fish2.y\n\t\t\t\t\t\t\t&& fish1.y + fish1.size <= fish2.y + fish2.size)\n\t\t\t\t\t|| (fish1.x + fish1.size >= fish2.x && fish1.x + fish1.size <= fish2.x + fish2.size\n\t\t\t\t\t\t\t&& fish1.y >= fish2.y && fish1.y <= fish2.y + fish2.size)\n\t\t\t\t\t|| (fish1.x + fish1.size >= fish2.x && fish1.x + fish1.size <= fish2.x + fish2.size\n\t\t\t\t\t\t\t&& fish1.y + fish1.size >= fish2.y && fish1.y + fish1.size <= fish2.y + fish2.size))) {\n\n\t\t\t\tif (fish1.size > fish2.size) {\n\t\t\t\t\tfish1.size += fish2.size / 4;\n\t\t\t\t\tfish2.size = 0;\n\t\t\t\t\t//musiceat.playEatMusic();\n\t\t\t\t} else if (fish1.size < fish2.size) {\n\t\t\t\t\tfish2.size += fish1.size / 4;\n\t\t\t\t\tfish1.size = 0;\n\t\t\t\t\t //musiceat.playEatMusic();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public Fish(FishType species, Direction direction, int fW, int fH, int xS, int yS, int xL, int yL) {\n\t\tthis.species = species;\n\t\tthis.direction = direction;\n\t\tthis.isCaught = false;\n\t\tframeWidth = fW;\n\t\tframeHeight = fH;\n\t\t\n\t\txSpeed = xS;\n\t\tySpeed = yS;\n\t\txloc = xL;\n\t\tyloc = yL;\n\t\t\n\t\ttopYBound = 0;\n\t\tbottomYBound = frameHeight;\n\t}", "public Fish(String n, String c, String s, int f) {\n name = n;\n color = c;\n species = s;\n fins = f;\n count++;\n }", "private int[] chooseCoordinates() {\n\t\t// Choose new (posX,posY) location for the Fish\n\t\tint pasX, pasY;\n\n\t\t// at least pasX or pasY not null\n\t\tdo {\n\t\t\tpasX = this.appConfig.getRandom().nextInt(3) - 1;\n\t\t\tpasY = this.appConfig.getRandom().nextInt(3) - 1;\n\t\t} while (pasX == 0 && pasY == 0);\n\n\t\t// choose one free cell based on the random steps (+1 logic)\n\t\tfor (int x = pasX; x <= 1; x++) {\n\t\t\tfor (int y = pasY; y <= 1; y++) {\n\t\t\t\tint newX = this.posX + x;\n\t\t\t\tint newY = this.posY + y;\n\n\t\t\t\t// not a good choice with isTorus\n\t\t\t\tif (!this.appConfig.isTorus() && this.environment.isOutOfBound(newX, newY)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// change x or y if environment is a torus\n\t\t\t\tif (this.appConfig.isTorus()) {\n\t\t\t\t\tif (newX < 0) {\n\t\t\t\t\t\tnewX = this.environment.getWidth() - 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (newX >= this.environment.getWidth()) {\n\t\t\t\t\t\tnewX = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (newY < 0) {\n\t\t\t\t\t\tnewY = this.environment.getHeight() - 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (newY >= this.environment.getHeight()) {\n\t\t\t\t\t\tnewY = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Fish can move here\n\t\t\t\tif (this.environment.getCell(newX, newY) == null) {\n\t\t\t\t\treturn new int[] { newX, newY };\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// choose one free cell based on the random steps (-1 logic)\n\t\tfor (int x = pasX; x >= -1; x--) {\n\t\t\tfor (int y = pasY; y >= -1; y--) {\n\t\t\t\tint newX = this.posX + x;\n\t\t\t\tint newY = this.posY + y;\n\n\t\t\t\t// not a good choice with isTorus\n\t\t\t\tif (!this.appConfig.isTorus() && this.environment.isOutOfBound(newX, newY)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// change x or y if environment is a torus\n\t\t\t\tif (this.appConfig.isTorus()) {\n\t\t\t\t\tif (newX < 0) {\n\t\t\t\t\t\tnewX = this.environment.getWidth() - 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (newX >= this.environment.getWidth()) {\n\t\t\t\t\t\tnewX = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (newY < 0) {\n\t\t\t\t\t\tnewY = this.environment.getHeight() - 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (newY >= this.environment.getHeight()) {\n\t\t\t\t\t\tnewY = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Fish can move here\n\t\t\t\tif (this.environment.getCell(newX, newY) == null) {\n\t\t\t\t\treturn new int[] { newX, newY };\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// no available cell if we arrive here\n\t\treturn null;\n\t}", "public void food ()\r\n {\r\n\t//local colour variable for the food container\r\n\tColor container = new Color (191, 175, 178); //black shadows\r\n\t//local variable for the label\r\n\tColor label = new Color (196, 30, 58); //cardinal\r\n\t//local variable for the fish on the container\r\n\tColor fish = new Color (30, 133, 255); //dodger blue\r\n\t//local colour variable for the fish food\r\n\tColor fishFood = new Color (131, 105, 83); //pastel brown\r\n\r\n\t//loop used to animate the food container\r\n\tfor (int x = 0 ; x < 400 ; x++)\r\n\t{\r\n\t //array of local variable of x coordinates to the fish upper tail\r\n\t int upX[] = {832 - x, 832 - x, 845 - x};\r\n\t //array of local variable of y coordinates to the fish upper tail\r\n\t int upY[] = {88, 100, 85};\r\n\t //array of local variable of x coordinates to the fish lower tail\r\n\t int bottomX[] = {832 - x, 832 - x, 845 - x};\r\n\t //array of local variable of y coordinates to the fish lower tail\r\n\t int bottomY[] = {90, 102, 105};\r\n\r\n\t c.setColor (container);\r\n\t //container\r\n\t c.fillRect (775 - x, 20, 80, 110);\r\n\r\n\t c.setColor (label);\r\n\t //label\r\n\t c.fillRect (775 - x, 45, 80, 20);\r\n\r\n\t c.setColor (Color.black);\r\n\t c.setFont (new Font (\"Calibri\", 1, 15));\r\n\t //letters\r\n\t c.drawString (\"FISH FOOD\", 775 - x, 60);\r\n\r\n\t c.setColor (Color.white);\r\n\t //mouth\r\n\t c.fillArc (794 - x, 90, 10, 9, 220, 280);\r\n\r\n\t c.setColor (fish);\r\n\t //fish body\r\n\t c.fillOval (800 - x, 80, 35, 30);\r\n\t //fish tail\r\n\t c.setColor (fish);\r\n\t c.fillPolygon (upX, upY, 3);\r\n\t c.setColor (fish);\r\n\t c.fillPolygon (bottomX, bottomY, 3);\r\n\r\n\t c.setColor (Color.white);\r\n\t //eye\r\n\t c.fillOval (805 - x, 85, 17, 17);\r\n\r\n\t c.setColor (Color.black);\r\n\t //inner eye\r\n\t c.fillOval (808 - x, 92, 6, 6);\r\n\r\n\t c.setColor (fishFood);\r\n\t //food\r\n\t c.fillOval (788 - x, 92, 5, 5);\r\n\t c.setColor (fishFood);\r\n\t c.fillOval (785 - x, 87, 5, 5);\r\n\t c.setColor (fishFood);\r\n\t c.fillOval (782 - x, 96, 5, 5);\r\n\r\n\t //delay\r\n\t try\r\n\t {\r\n\t\tsleep (7);\r\n\t }\r\n\t catch (Exception e)\r\n\t {\r\n\t }\r\n\r\n\t}\r\n\r\n\t//loop used to animate the fish food container going down\r\n\tfor (int x = 0 ; x < 30 ; x++)\r\n\t{\r\n\t //array of local variable of x coordinates to the fish upper tail\r\n\t int upX[] = {432, 432, 445};\r\n\t //array of local variable of y coordinates to the fish upper tail\r\n\t int upY[] = {88 - x, 100 - x, 85 - x};\r\n\t //array of local variable of x coordinates to the fish lower tail\r\n\t int bottomX[] = {432, 432, 445};\r\n\t //array of local variable of y coordinates to the fish lower tail\r\n\t int bottomY[] = {90 - x, 102 - x, 105 - x};\r\n\r\n\t c.setColor (container);\r\n\t //container\r\n\t c.fillRect (375, 20 - x, 80, 110);\r\n\r\n\t c.setColor (label);\r\n\t //label\r\n\t c.fillRect (375, 45 - x, 80, 20);\r\n\r\n\t c.setColor (Color.black);\r\n\t c.setFont (new Font (\"Calibri\", 1, 15));\r\n\t //letters\r\n\t c.drawString (\"FISH FOOD\", 382, 60 - x);\r\n\r\n\t c.setColor (Color.white);\r\n\t //mouth\r\n\t c.fillArc (394, 90 - x, 10, 9, 220, 280);\r\n\r\n\t c.setColor (fish);\r\n\t //fish body\r\n\t c.fillOval (400, 80 - x, 35, 30);\r\n\t //fish tail\r\n\t c.setColor (fish);\r\n\t c.fillPolygon (upX, upY, 3);\r\n\t c.setColor (fish);\r\n\t c.fillPolygon (bottomX, bottomY, 3);\r\n\r\n\t c.setColor (Color.white);\r\n\t //eye\r\n\t c.fillOval (405, 85 - x, 17, 17);\r\n\r\n\t c.setColor (Color.black);\r\n\t //inner eye\r\n\t c.fillOval (408, 92 - x, 6, 6);\r\n\r\n\t c.setColor (fishFood);\r\n\t //food\r\n\t c.fillOval (388, 92 - x, 5, 5);\r\n\t c.setColor (fishFood);\r\n\t c.fillOval (385, 87 - x, 5, 5);\r\n\t c.setColor (fishFood);\r\n\t c.fillOval (382, 96 - x, 5, 5);\r\n\r\n\t //delay\r\n\t try\r\n\t {\r\n\t\tsleep (7);\r\n\t }\r\n\t catch (Exception e)\r\n\t {\r\n\t }\r\n\r\n\t}\r\n\r\n\t//loop used to animate the fish food going down\r\n\tfor (int x = 0 ; x < 30 ; x++)\r\n\t{\r\n\t //array of local variable of x coordinates to the fish upper tail\r\n\t int upX[] = {432, 432, 445};\r\n\t //array of local variable of y coordinates to the fish upper tail\r\n\t int upY[] = {58 + x, 70 + x, 55 + x};\r\n\t //array of local variable of x coordinates to the fish lower tail\r\n\t int bottomX[] = {432, 432, 445};\r\n\t //array of local variable of y coordinates to the fish lower tail\r\n\t int bottomY[] = {60 + x, 72 + x, 75 + x};\r\n\r\n\t c.setColor (container);\r\n\t //container\r\n\t c.fillRect (375, -10 + x, 80, 110);\r\n\r\n\t c.setColor (label);\r\n\t //label\r\n\t c.fillRect (375, 15 + x, 80, 20);\r\n\r\n\t c.setColor (Color.black);\r\n\t c.setFont (new Font (\"Calibri\", 1, 15));\r\n\t //letters\r\n\t c.drawString (\"FISH FOOD\", 382, 30 + x);\r\n\r\n\t c.setColor (Color.white);\r\n\t //mouth\r\n\t c.fillArc (394, 60 + x, 10, 9, 220, 280);\r\n\r\n\t c.setColor (fish);\r\n\t //fish body\r\n\t c.fillOval (400, 50 + x, 35, 30);\r\n\t //fish tail\r\n\t c.setColor (fish);\r\n\t c.fillPolygon (upX, upY, 3);\r\n\t c.setColor (fish);\r\n\t c.fillPolygon (bottomX, bottomY, 3);\r\n\r\n\t c.setColor (Color.white);\r\n\t //eye\r\n\t c.fillOval (405, 55 + x, 17, 17);\r\n\r\n\t c.setColor (Color.black);\r\n\t //inner eye\r\n\t c.fillOval (408, 62 + x, 6, 6);\r\n\r\n\t c.setColor (fishFood);\r\n\t //food\r\n\t c.fillOval (388, 62 + x, 5, 5);\r\n\t c.setColor (fishFood);\r\n\t c.fillOval (385, 57 + x, 5, 5);\r\n\t c.setColor (fishFood);\r\n\t c.fillOval (382, 66 + x, 5, 5);\r\n\r\n\t //delay\r\n\t try\r\n\t {\r\n\t\tsleep (7);\r\n\t }\r\n\t catch (Exception e)\r\n\t {\r\n\t }\r\n\t}\r\n\r\n\t//loop used to animate the fish food container going out\r\n\tfor (int x = 0 ; x < 400 ; x++)\r\n\t{\r\n\t //array of local variable of x coordinates to the fish upper tail\r\n\t int upX[] = {432 + x, 432 + x, 445 + x};\r\n\t //array of local variable of y coordinates to the fish upper tail\r\n\t int upY[] = {88, 100, 85};\r\n\t //array of local variable of x coordinates to the fish lower tail\r\n\t int bottomX[] = {432 + x, 432 + x, 445 + x};\r\n\t //array of local variable of y coordinates to the fish lower tail\r\n\t int bottomY[] = {90, 102, 105};\r\n\r\n\t c.setColor (container);\r\n\t //container\r\n\t c.fillRect (375 + x, 20, 80, 110);\r\n\r\n\t c.setColor (label);\r\n\t //label\r\n\t c.fillRect (375 + x, 45, 80, 20);\r\n\r\n\t c.setColor (Color.black);\r\n\t c.setFont (new Font (\"Calibri\", 1, 15));\r\n\t //letters\r\n\t c.drawString (\"FISH FOOD\", 382 + x, 60);\r\n\r\n\t c.setColor (Color.white);\r\n\t //mouth\r\n\t c.fillArc (394 + x, 90, 10, 9, 220, 280);\r\n\r\n\t c.setColor (fish);\r\n\t //fish body\r\n\t c.fillOval (400 + x, 80, 35, 30);\r\n\t //fish tail\r\n\t c.setColor (fish);\r\n\t c.fillPolygon (upX, upY, 3);\r\n\t c.setColor (fish);\r\n\t c.fillPolygon (bottomX, bottomY, 3);\r\n\r\n\t c.setColor (Color.white);\r\n\t //eye\r\n\t c.fillOval (405 + x, 85, 17, 17);\r\n\r\n\t c.setColor (Color.black);\r\n\t //inner eye\r\n\t c.fillOval (408 + x, 92, 6, 6);\r\n\r\n\t c.setColor (fishFood);\r\n\t //food\r\n\t c.fillOval (388 + x, 92, 5, 5);\r\n\t c.setColor (fishFood);;\r\n\t c.fillOval (385 + x, 87, 5, 5);\r\n\t c.setColor (fishFood);\r\n\t c.fillOval (382 + x, 96, 5, 5);\r\n\r\n\t //delay\r\n\t try\r\n\t {\r\n\t\tsleep (7);\r\n\t }\r\n\t catch (Exception e)\r\n\t {\r\n\t }\r\n\r\n\t}\r\n }", "public void fly(){\n\t\t\n\t\t//If bird is facing up.\n\t\tif (i == 0){\n\t\t\t\n\t\t\t//Move up one position and change direction (i).\n\t\t\tsuper.p.y = super.p.y - 1;\n\t\t\ti = 1;\n\t\t\t\n\t\t\t//If bird is facing to the left.\n\t\t\t} else if (i == 1){\n\t\t\n\t\t\t//Move to the left one position and change direction (i).\n\t\t\tsuper.p.x = super.p.x - 1;\n\t\t\ti = 2;\n\t\t\t\n\t\t\t//If bird is facing down.\n\t\t\t} else if (i == 2){\n\t\t\n\t\t\t//Move down right one position and change direction (i).\n\t\t\tsuper.p.y = super.p.y + 1;\n\t\t\ti = 3;\n\t\t\t\n\t\t\t//If bird is facing to the right.\n\t\t\t} else if (i == 3){\n\t\t\n\t\t\t//Move to the right one position and change direction (i).\n\t\t\tsuper.p.x = super.p.x + 1;\n\t\t\ti = 0;\n\t\t}\n\t\t\n\t\t//Increase count of flights.\n\t\tsuper.countfly++;\n\t}", "public void move(Fish fish, Pond pond, double x, double y)\n\t{\n double[] location = pond.findNearestPlant(x, y);\n fish.swimTowards(location[0], location[1]);\n\t}", "public void setFocalPoints() {\n Equation e = new Equation();\n // read the refractive index and the curvature radius from the sliders and divide their slider values by 100\n double index = indexSlider.getValue() / 100;\n double radius = radiusSlider.getValue() / 100;\n // calls the focalLength method from the equation class and bring the index and radius as the parameters\n focalLength = e.focalLength(index, radius);\n\n // set the X coordinates of focal point one and focal point two\n // focal point one is on the left side of the lens\n // X = X of lensCenter - focal Length\n // focal point two is on the right side of the lens\n // X = X of lensCenter + focal Length\n focalOne.setLayoutX(lensCenterX - (focalLength * 100));\n focalTwo.setLayoutX(lensCenterX + (focalLength * 100));\n }", "Frog(){\n\t\tx = frogInitX;\n\t\ty = frogInitY;\n\t\tdx = 0;\n\t\tdy = 0;\n\t\talive = true;\n\t\torientation = Orientation.UP;\n\t}", "private void scout() {\n\t\ttargetFlower = null;\n\t\t// fly to flower if nearby\n\t\tif(foundFlower()) {\n\t\t\tstate = \"TARGETING\";\n\t\t}\n\t\t// otherwise keep scouting\n\t\telse{\n\t\t\t// change angle randomly during flight\n\t\t\tcurrentAngle += RandomHelper.nextDoubleFromTo(-Math.PI/8, Math.PI/8);\n\t\t\tspace.moveByVector(this, 4, currentAngle,0);\n\t\t\tNdPoint myPoint = space.getLocation(this);\n\t\t\tgrid.moveTo(this, (int) myPoint.getX(), (int) myPoint.getY());\n\t\t\tfood -= highMetabolicRate;\n\t\t}\n\t}", "void placeFruit()\n\t{\n\t\t// .first is x-coordinate, it gets a number between 1 and 16\n\t\tfruit[0] = randomPoint();\n\t\t// .second is y-coordinate, it gets a number between 1 and 16\n\t\tfruit[1] = randomPoint();\n\t\tfruit[2] = randomPoint();\n\n\t\t// loops the snakes length\n\t\tfor (int i = 0; i < theSnake.getLength(); i++)\n\t\t{\n\t\t\t// checks for fruit being on/under snake\n\t\t\tif (theSnake.getXofPartI(i) == fruit[0] && theSnake.getYofPartI(i) == fruit[1] && theSnake.getZofPartI(i) == fruit[2])\n\t\t\t{\n\t\t\t\t// Picks new spot for fruit, because it was found on the snake\n\t\t\t\tfruit[0] = randomPoint();\n\t\t\t\tfruit[1] = randomPoint();\n\t\t\t\tfruit[2] = randomPoint();\n\t\t\t\t// just in case the fruit landed on the snake again\n\t\t\t\ti = 0;\n\t\t\t}\n\t\t}\n\t}", "public Fish() {\r\n\t}", "private void createShips() {\n //context,size, headLocation, bodyLocations\n Point point;\n Ship scout_One, scout_Two, cruiser, carrier, motherShip;\n if(player) {\n point = new Point(maxN - 1, 0); //row, cell\n scout_One = new Ship(1, point, maxN, \"Scout One\", player);\n ships.add(scout_One);\n point = new Point(maxN - 1, 1);\n scout_Two = new Ship(1, point, maxN, \"Scout Two\", player);\n ships.add(scout_Two);\n point = new Point(maxN - 2, 2);\n cruiser = new Ship(2, point, maxN, \"Cruiser\", player);\n ships.add(cruiser);\n point = new Point(maxN - 2, 3);\n carrier = new Ship(4, point, maxN, \"Carrier\", player);\n ships.add(carrier);\n point = new Point(maxN - 4, 5);\n motherShip = new Ship(12, point, maxN, \"MotherShip\", player);\n ships.add(motherShip);\n\n }else{\n Random rand = new Random();\n int rowM = maxN-3;\n int colM = maxN -2;\n int row = rand.nextInt(rowM);\n int col = rand.nextInt(colM);\n point = new Point(row, col);\n motherShip = new Ship(12, point, maxN, \"MotherShip\", player);\n updateOccupiedCells(motherShip.getBodyLocationPoints());\n ships.add(motherShip);\n\n rowM = maxN - 1;\n colM = maxN -1;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n carrier = new Ship(4, point, maxN, \"Carrier\", player);\n updateOccupiedCells(carrier.getBodyLocationPoints());\n ships.add(carrier);\n checkIfOccupiedForSetShip(carrier, row, col, rowM, colM);\n\n\n rowM = maxN - 1;\n colM = maxN;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n cruiser = new Ship(2, point, maxN, \"Cruiser\", player);\n updateOccupiedCells(cruiser.getBodyLocationPoints());\n ships.add(cruiser);\n checkIfOccupiedForSetShip(cruiser, row, col, rowM, colM);\n\n\n rowM = maxN;\n colM = maxN;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n scout_Two = new Ship(1, point, maxN, \"Scout_Two\", player);\n updateOccupiedCells(scout_Two.getBodyLocationPoints());\n ships.add(scout_Two);\n checkIfOccupiedForSetShip(scout_Two, row, col, rowM, colM);\n\n rowM = maxN;\n colM = maxN;\n row = rand.nextInt(rowM);\n col = rand.nextInt(colM);\n point = new Point(row, col);\n scout_One = new Ship(1, point, maxN, \"Scout_One\", player);\n updateOccupiedCells(scout_One.getBodyLocationPoints());\n ships.add(scout_One);\n checkIfOccupiedForSetShip(scout_One, row, col, rowM, colM);\n\n\n\n\n }\n //Need an algorithm to set enemy ship locations at random without overlaps\n }", "private void follow() {\n\t\t// calculate distance back to hive\n\t\tdouble distToHive = grid.getDistance(grid.getLocation(this),grid.getLocation(hive));\n\t\t// if close to flower from dance information, start scouting\n\t\tif(distToHive > followDist - 5) {\n\t\t\tstate = \"SCOUTING\";\n\t\t}\n\t\t// otherwise keep flying in direction of dance\n\t\telse{\n\t\t\t// deviate slightly from correct angle because bee's aren't perfect (I don't think)\n\t\t\tcurrentAngle += RandomHelper.nextDoubleFromTo(-Math.PI/50, Math.PI/50);\n\t\t\tspace.moveByVector(this, 4, currentAngle,0);\n\t\t\tNdPoint myPoint = space.getLocation(this);\n\t\t\tgrid.moveTo(this, (int) myPoint.getX(), (int) myPoint.getY());\n\t\t\tfood -= highMetabolicRate;\n\t\t}\n\t}", "public PoisonBrick(Flyweight newFlyweight) {\n hitpoints = 2;\n flyweight = newFlyweight;\n for (Observer observer: flyweight.getObservers()) {\n addObserver(observer);\n }\n }", "public Pair<Integer, Boolean> intersectsPlayerFish(PlayerFish aPlayerFish) {\n for (int i = 0; i < fEnemyFishList.size(); i++) {\n Entity currEnemyFish = fEnemyFishList.get(i);\n if (aPlayerFish.intersects(currEnemyFish)) {\n BoundingBox currEnemyFishBoundingBox = currEnemyFish.getSprite().getBoundingBox();\n int currEnemyFishSize = currEnemyFishBoundingBox.getWidth();\n BoundingBox aPlayerFishBoundingBox = aPlayerFish.getSprite().getBoundingBox();\n int aPlayerFishSize = aPlayerFishBoundingBox.getWidth();\n if (currEnemyFishSize < aPlayerFishSize) {\n GameLoop.updateScore(currEnemyFish);\n return new Pair<Integer, Boolean>(i, false);\n } else if (aPlayerFish.getLives() > 1) {\n aPlayerFish.decrementLives();\t\n return new Pair<Integer, Boolean>(i, false);\n } else {\n return new Pair<Integer, Boolean>(i, true);\n }\n }\n }\n return new Pair<>(-1, false);\n }", "public void buildPathes() {\n\n for (Fruit fruit :game.getFruits()) {\n\n GraphNode.resetCounterId();\n changePlayerPixels();\n addBlocksVertices();\n Point3D fruitPixels = new Point3D(fruit.getPixels()[0],fruit.getPixels()[1]);\n GraphNode fruitNode = new GraphNode(fruitPixels);\n vertices.add(fruitNode);\n Target target = new Target(fruitPixels, fruit);\n\n //find the neigbours\n BFS();\n\n // build the grpah\n buildGraph(target);\n }\n }", "public void setVels(Fighter f1,boolean[] inputs, Platform plat)\r\n {\r\n //if the fighter is on the ground and pressed the up button\r\n if (inputs[0] == true && f1.getPos()[1] == plat.getY()- f1.getSize())\r\n {\r\n //set the upward momentum to the jump force\r\n f1.setMvmtVel(f1.getMvmtVel()[0], -j);\r\n }\r\n //if pressing the right button\r\n if (inputs[3] == true)\r\n {\r\n f1.setRight(true);\r\n //if it's moving left\r\n if (f1.getMvmtVel()[0] < 0){ \r\n f1.setMvmtVel(s, f1.getMvmtVel()[1]); //sets the horizontal momentum to s\r\n }\r\n else{\r\n f1.setMvmtVel(f1.getMvmtVel()[0] + s, f1.getMvmtVel()[1]); //sets the horizontal momentum to the current momentum + s\r\n }\r\n \r\n }\r\n\r\n //if pressing the left button\r\n else if (inputs[1] == true)\r\n {\r\n f1.setRight(false);\r\n //if it's moving right\r\n if (f1.getMvmtVel()[0] > 0){\r\n f1.setMvmtVel(-s, f1.getMvmtVel()[1]); //sets the horizontal momentum to -s\r\n }\r\n else{\r\n f1.setMvmtVel(f1.getMvmtVel()[0] - s, f1.getMvmtVel()[1]); //sets the horizontal momentum to the current momentum - s\r\n }\r\n }\r\n\r\n f1.setPos(f1.getPos()[0] + f1.getMvmtVel()[0],f1.getPos()[1] + f1.getMvmtVel()[1]); //changes the position based on their momentum\r\n f1.setMvmtVel(f1.getMvmtVel()[0]/f, f1.getMvmtVel()[1] + g); //decreases their momentum using friction and gravity\r\n\r\n\r\n }", "@Override\n\tpublic void act(long now) {\n\n\t\tcheckIsFrogAtTheEdge();\n\t\t\tif (getIntersectingObjects(Car.class).size() >= 1 ||\n\t\t\t\tgetIntersectingObjects(Truck.class).size() >= 1 ||\n\t\t\t\tgetIntersectingObjects(LongTruck.class).size() >= 1)\n\t\t\t\t{\n\t\t\t\t\tintersectCar = true;\n\t\t\t\t}\n\n\t\t\telse if (getIntersectingObjects(Log.class).size() >= 1 && !death) {\n\t\t\t\tmove(frogSpeed.ObjSpeed(frogLevel, 6), 0);\n\t\t\t}\n\n\t\t\telse if (getIntersectingObjects(LongLog.class).size() >= 1 && !death) {\n\n\t\t\t\tmove(frogSpeed.ObjSpeed(frogLevel, 8), 0);\n\t\t\t}\n\n\t\t\telse if (getIntersectingObjects(Turtle.class).size() >= 1) {\n\t\t\t\tmove(frogSpeed.ObjSpeed(frogLevel, 7), 0);\n\t\t\t}\n\t\t\telse if (getIntersectingObjects(WetTurtle.class).size() >= 1){\n\t\t\t\tif (getIntersectingObjects(WetTurtle.class).get(0).isSunk()) {\n\t\t\t\t\tintersectWater = true;\n\t\t\t\t} else {\n\t\t\t\t\tmove(frogSpeed.ObjSpeed(frogLevel, 7), 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t else if (getIntersectingObjects(End.class).size() >= 1) {\n\n\t\t\t\t\tIntersectEnd();\n\t\t\t\t}\n\n\t\t\telse if (getY() < waterPositionY) {\n\t\t\t\tintersectWater = true;\n\t\t\t}\n\t\t\tgetlives();\n\n\t\t\tCheckIntersect(intersectCar, intersectWater, now);\n\t\t}", "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 }", "private void drawFireworks() {\n\t\tgc.setFill(BACKGROUND_COLOUR);\r\n\t\tgc.fillRect(0, 0, canvas.getWidth(), canvas.getHeight());\r\n\t\tif (fireworks.size() > 0){\r\n\t\t\tfor (Particle firework : fireworks) {\r\n\t\t\t\t// Get the position for the Particle\r\n\t\t\t\tdouble[] pos = firework.getPosition();\r\n\t\t\t\tif (firework instanceof Streak){\r\n\t\t\t\t\t// Streaks are lines from the firework to the origin\r\n\t\t\t\t\tdouble[] origin = ((Streak) firework).getOrigin();\r\n\t\t\t\t\tgc.setFill(spreadColor(firework.getColour()));\r\n\t\t\t\t\tgc.strokeLine(xPos(origin[0]),yPos(origin[1]),xPos(pos[0]),yPos(pos[1]));\r\n\t\t\t\t}\r\n\t\t\t\telse if (firework instanceof BurningParticle){\r\n\t\t\t\t\t// Burning Particles are the stars themselves\r\n\t\t\t\t\t// Saves the star object to test for a collision later\r\n\t\t\t\t\tStar1 = (BurningParticle) firework.clone();\r\n\t\t\t\t\tgc.setFill(firework.getColour());\r\n\t\t\t\t\tgc.fillOval(xPos(pos[0]),yPos(pos[1]), 6, 6);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// Everything else is a spark and can have a random color / transparency \r\n\t\t\t\t\tgc.setFill(spreadColor(firework.getColour()));\r\n\t\t\t\t\tgc.fillOval(xPos(pos[0]),yPos(pos[1]), 1 + 3*Math.random(), 1 + 3*Math.random());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// update the current time and the fireworks attribute\r\n\t\t\ttime = (time + TIME_INTERVAL);\r\n\t\t\tfireworks = manager1.getFireworks(time);\r\n\t\t}\r\n\t}", "private void coins_fG(){\n\t\tthis.cube[31] = this.cube[27]; \n\t\tthis.cube[27] = this.cube[33];\n\t\tthis.cube[33] = this.cube[35];\n\t\tthis.cube[35] = this.cube[29];\n\t\tthis.cube[29] = this.cube[31];\n\t}", "public void FEvent(ArrayList<ArrayList<Shape>> faces) {\r\n \tint u1 = CUBE7, l1 = CUBE9, r1 = CUBE1, b1 = CUBE3;\r\n \tfor(int i = 0; i < 3; i++) {\r\n \t\tColor color = faces.get(TOP).get(u1).getColor();\r\n \tfaces.get(TOP).get(u1).changeColor(faces.get(LEFT).get(l1).getColor());\r\n \tfaces.get(LEFT).get(l1).changeColor(faces.get(BOTTOM).get(b1).getColor());\r\n \tfaces.get(BOTTOM).get(b1).changeColor(faces.get(RIGHT).get(r1).getColor());\r\n \tfaces.get(RIGHT).get(r1).changeColor(color);\r\n \tu1++;\r\n \tl1 -= SHIFT_ROW;\r\n \tb1--;\r\n \tr1 += SHIFT_ROW;\r\n \t} \r\n \r\n \tColor color = faces.get(FRONT).get(CUBE1).getColor();\r\n \tfaces.get(FRONT).get(CUBE1).changeColor(faces.get(FRONT).get(CUBE7).getColor());\r\n \tfaces.get(FRONT).get(CUBE7).changeColor(faces.get(FRONT).get(CUBE9).getColor());\r\n \tfaces.get(FRONT).get(CUBE9).changeColor(faces.get(FRONT).get(CUBE3).getColor());\r\n \tfaces.get(FRONT).get(CUBE3).changeColor(color);\r\n \tcolor = faces.get(FRONT).get(CUBE2).getColor();\r\n \tfaces.get(FRONT).get(CUBE2).changeColor(faces.get(FRONT).get(CUBE4).getColor());\r\n \tfaces.get(FRONT).get(CUBE4).changeColor(faces.get(FRONT).get(CUBE8).getColor());\r\n \tfaces.get(FRONT).get(CUBE8).changeColor(faces.get(FRONT).get(CUBE6).getColor());\r\n \tfaces.get(FRONT).get(CUBE6).changeColor(color);\r\n }", "public void update() {\n\n if (!isSelected){\n goalManagement();\n }\n\n if (chair != null){ // si une chaise lui est désigné\n if (!hasAGoal && !isSelected){ // et qu'il n'a pas d'objectif\n setSit(true);\n position.setX(chair.getX());\n }\n\n if (isSit){\n chair.setChairState(Chair.ChairState.OCCUPIED);\n }else {\n chair.setChairState(Chair.ChairState.RESERVED);\n }\n }\n\n if (tired > 0 ){\n tired -= Constants.TIRED_LOSE;\n }\n\n if (isSit && comfort>0){\n comfort -= Constants.COMFORT_LOSE;\n }\n\n if (isSitOnSofa && comfort<100){\n comfort += Constants.COMFORT_WIN;\n }\n\n if (!hasAGoal && moveToCoffee && coffeeMachine!=null){\n moveToCoffee = false;\n tired=100;\n\n coffeeMachine.setCoffeeTimer(new GameTimer()) ;\n coffeeMachine.getCoffeeTimer().setTimeLimit(Constants.COFFEE_TIME_TO_AVAILABLE);\n coffeeMachine = null;\n backToSpawn();\n }\n\n if (!hasAGoal && moveToSofa){\n moveToSofa = false;\n isSitOnSofa = true;\n dir = 0 ;\n position.setY(position.getY()-Constants.TILE_SIZE);\n }\n\n if (isSelected){\n flashingColor ++;\n if (flashingColor > 2 * flashingSpeed){\n flashingColor = 0;\n }\n }\n\n }", "public void updateGoalPositions() {\n // Convert angle to unit vector\n double downUnitX = MathUtils.quickCos((float) (anchorAngle + Math.PI));\n double downUnitY = MathUtils.quickSin((float) (anchorAngle + Math.PI));\n double sideUnitX = MathUtils.quickCos((float) (anchorAngle + Math.PI / 2));\n double sideUnitY = MathUtils.quickSin((float) (anchorAngle + Math.PI / 2));\n\n // Create troops and set starting positions for each troop\n double topX = anchorX - (width - 1) * unitStats.spacing * sideUnitX / 2;\n double topY = anchorY - (width - 1) * unitStats.spacing * sideUnitY / 2;\n\n // Update troops goal positions\n for (int row = 0; row < aliveTroopsFormation.length; row++) {\n for (int col = 0; col < aliveTroopsFormation[0].length; col++) {\n BaseSingle troop = aliveTroopsFormation[row][col];\n if (troop == null) continue;\n double xGoalSingle;\n double yGoalSingle;\n // If the person is the flanker, go straight to the assigned position in flankers offset.\n if (state == UnitState.FIGHTING) {\n if (row < flankersCount[col]) {\n double offsetSide = flankerOffsets[col].get(row)[0];\n double offsetDown = flankerOffsets[col].get(row)[1];\n xGoalSingle = this.unitFoughtAgainst.getAverageX() + offsetSide * sideUnitX + offsetDown * downUnitX;\n yGoalSingle = this.unitFoughtAgainst.getAverageY() + offsetSide * sideUnitY + offsetDown * downUnitY;\n } else {\n xGoalSingle = topX + col * unitStats.spacing * sideUnitX\n + (row - flankersCount[col]) * unitStats.spacing * downUnitX;\n yGoalSingle = topY + col * unitStats.spacing * sideUnitY\n + (row - flankersCount[col]) * unitStats.spacing * downUnitY;\n }\n } else {\n xGoalSingle = topX + col * unitStats.spacing * sideUnitX\n + row * unitStats.spacing * downUnitX;\n yGoalSingle = topY + col * unitStats.spacing * sideUnitY\n + row * unitStats.spacing * downUnitY;\n }\n // Set the goal and change the state\n troop.setxGoal(xGoalSingle);\n troop.setyGoal(yGoalSingle);\n troop.setAngleGoal(anchorAngle);\n }\n }\n }", "public String[] getFishableFish() {\n return PondTile.fishableFish;\n }", "FuelingStation createFuelingStation();", "private void createFishExplosions() {\n \n for (Map.Entry<GlowFish, GlowFish> e : fishCollisions.entrySet()) {\n \n //combine the colours\n Vector4 combine = ColourUtil.combine(\n e.getKey().getColour(), e.getValue().getColour());\n entities.add(new Explosion(e.getKey().getPos().clone(), combine));\n e.getKey().remove();\n e.getValue().remove();\n \n //play sound\n FxManager.play3d(sound, e.getKey().getPos(), 1.0f);\n }\n }", "public Frog(int xIn, int yIn, int frogSizeIn, int frogVelocityXIn)\n\t{\n\t\t// Nothing to do but save the data in the object's data fields.\n\t\tx = xIn;\n\t\ty = yIn;\n\t\tfrogSize = frogSizeIn;\n\t\tfrogVelocityX = frogVelocityXIn;\n\t}", "private void eat(List<Cell> fishList, Cell cell)\n\t{\n\t\tCell movedTo = duplicateToRandCell(cell, fishList);\n\t\tkill(cell);\n\t\tresetStarveTime(movedTo);\n\t}", "private boolean isAtFish(){\n final RSNPC[] fishing_spots = NPCs.findNearest(\"Fishing spot\");\n if (fishing_spots.length < 1){\n return false;\n }\n return fishing_spots[0].isOnScreen();\n }", "@Override\n \tpublic int step( ArrayList<Boid> school ) {\n \t//public void update( PVector accel ) {\n \t\t\n \t\tPVector accel = calculateAccel( school );\n \t\taccel = avoidEgdes(accel);\n \t\t\n \t\t\n \t\t// If accel == null, skip down to end\n \t\tif( accel != null ) {\n \t\t\t\n \t\t\tPVector accelLocal = matrixMult( Fish.inverse(basis), accel );\n \t\t\t\t// accelLocal is now a cordinate vector in the fish's local coordinate system,\n \t\t\t\t// defined by the fish's basis\t\t\t\n \t\t\t\n \t\t\t/*\n \t\t\t * To limit it's max steering angle to a defined degree, we make sure the acceleration perpendicular \n \t\t\t * to its velocity is <= the parallel acceleration.\n \t\t\t */\n \t\t\t\n \t\t\t// TODO should we be doing this w/ speed, not accel?\n \t\t\t// If turning angle is greater than the maximum allowed ...\n \t\t\tif( Math.abs( accelLocal.y)/Math.abs(accelLocal.x) > MAX_TURN_RATIO ) {\n \n \t\t\t\t\n \t\t\t\t// Sets y's magnitude to x's magnitude, keeping y's sign\n \t\t\t\taccelLocal.y = ((accelLocal.y < 0) ? -1 : 1) * Math.abs(accelLocal.x);\n \t\t\t\t\n \t\t\t\t// TODO put in settings for min coasting speed\n \t\t\t\t// If we are turning extremely slowly (and we're here because we want to turn hard),\n \t\t\t\t// speed up so we can turn\n \t\t\t\tif( accelLocal.mag() < Set.FISH_MaxAccel/3 ) {\n \t\t\t\t\taccelLocal.normalize();\n \t\t\t\t\taccelLocal.mult( Set.FISH_MaxAccel/3 );\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t// If the desired acceleration is > max, set it to max\n \t\t\tif( accel.mag() > Set.FISH_MaxAccel ) {\n \t\t\t\taccel.normalize();\n \t\t\t\taccel.mult(Set.FISH_MaxAccel);\n \t\t\t}\n \t\t\t\n \t\t\t// not sure TODO\n \t\t\tif( speed.mag() + accelLocal.x < Set.FISH_MinSpeed) {\n \t\t\t\taccelLocal.x = -accelLocal.x;\n \t\t\t}\n \t\t\t\n \t\t\t// Update recentAccel. basis * accelLocal -> accel in global\n \t\t\trecentAccel = matrixMult(basis, accelLocal); \t\n \t\t\t\n \t\t\t// update speed. \n \t\t\tspeed.add( recentAccel );\n \t\t\t\n \t\t\t// If the new speed is > max, set it to max\n \t\t\tif( speed.mag() > Set.FISH_MaxSpeed ) {\n \t\t\t\tspeed.normalize();\n \t\t\t\tspeed.mult(Set.FISH_MaxSpeed);\n \t\t\t}\t\n \t\t\t\n \t\t} else { // Jumps to here if accel == null\n \t\t\trecentAccel = null;\n \t\t}\n \t\t\n \t\t\n \t\t// Update position\n \t\tposition.add(speed);\n \t\t\n \t\t// Make sure the new position is onscreen; if not, wrap it\n \t\tif( position.x < 0 ) position.x += Set.SCREEN_Width;\n \t\tif( position.y < 0 ) position.y += Set.SCREEN_Height;\n \t\tposition.x %= Set.SCREEN_Width;\n \t\tposition.y %= Set.SCREEN_Height;\n \t\t\n \t\t// Update basis\n \t\tbasis[0].set(speed);\n \t\tPVector.cross( basis[0], Z_VECTOR, basis[1]);\n \t\tbasis[0].normalize();\n \t\tbasis[1].normalize();\n \t\t\n \t\t// Update opacity\n \t\tcolor = Sim.colors.get( COLOR_OFFSETS[style]+(Sim.frameCounter+FRAME_OFFSET)%Set.FISH_ShimmerCycle );\n \t\thead_color = Sim.colors.get( Set.FISH_ShimmerCycle+COLOR_OFFSETS[style]+(Sim.frameCounter+FRAME_OFFSET)%Set.FISH_ShimmerCycle );\n \t\t\n \t\t// no change in school\n \t\treturn 0;\n \t}", "@Override\r\n public Food createFood(List<Coordinate> obstacles) {\r\n Random random = new Random();\r\n double num = random.nextDouble();\r\n\r\n if (num <= MushroomPowerUp.rarity) {\r\n return new MushroomPowerUp(randomCoordinates(obstacles));\r\n }\r\n if (num <= DoubleScorePowerUp.rarity + MushroomPowerUp.rarity) {\r\n return new DoubleScorePowerUp(randomCoordinates(obstacles));\r\n }\r\n return new AppleFactory().createFood();\r\n }", "public float getFish_X() {\n\t\treturn this.fish_x;\n\t}", "public static int bfs() {\r\n check = new int[N][N]; // check 변수 초기화\r\n q = new LinkedList<Point>();\t\t\t\t\t//bfs 할때 필요한 그 stack. first in first out\r\n q.offer(new Point(shark.x, shark.y));\t\t\t//q.offer == 해당 큐의 맨 뒤에 전달된 요소를 삽입함. list에서 list.add와 같은 말임.\r\n check[shark.x][shark.y] = 1;\r\n\r\n int FishCheck = 0;\t\t\t\t\t\t\t\t//the number of the fish in the sea map\r\n Shark fish = new Shark(N, N);\t\t\t\t\t//new shark initiation\r\n loop: while (!q.isEmpty()) {\r\n int r = q.peek().x;\t\t\t\t\t\t\t//q.peek == 해당 큐의 맨 앞에 있는(제일 먼저 저장된) 요소를 반환함\r\n int c = q.poll().y;\t\t\t\t\t\t\t//q.poll == 해당 큐의 맨 앞에 있는(제일 먼저 저장된) 요소를 반환하고, 해당 요소를 큐에서 제거함. 만약 큐가 비어있으면 null을 반환함.\r\n\r\n for (int d = 0; d < dr.length; d++) {\r\n int nr = r + dr[d];\t\t\t\t\t\t//북(0),남(1),동(2),서(3) 순으로. nr == new row\r\n int nc = c + dc[d];\t\t\t\t\t\t//북(0),남(1),동(2),서(3) 순으로. nc == new column\r\n\r\n // 지나갈 수 있는 곳: 자신보다 큰 물고기가 없는 곳\r\n if (isIn(nr, nc) && check[nr][nc] == 0 && sea[nr][nc] <= shark.lv) {\r\n check[nr][nc] = check[r][c] + 1;\r\n q.offer(new Point(nr, nc));\r\n\r\n // 위치가 더 커질 경우, 더이상 확인할 필요 X\r\n if (FishCheck != 0 && FishCheck < check[nr][nc]) {\r\n break loop;\r\n }\r\n \r\n // 처음 먹을 수 있는 자기보다 물고기가 발견 되었을 때\r\n if (0 < sea[nr][nc] && sea[nr][nc] < shark.lv && FishCheck == 0) {\r\n FishCheck = check[nr][nc];\r\n fish.x = nr;\r\n fish.y = nc;\r\n fish.lv = sea[nr][nc];\r\n }\r\n // 같은 위치에 여러 마리 있을 경우, 가장 위의 가장 왼쪽 물고기부터 먹음\r\n else if (FishCheck == check[nr][nc] && 0 < sea[nr][nc] && sea[nr][nc] < shark.lv) {\r\n if (nr < fish.x) { // 가장 위에 있는 거 우선권\r\n fish.x = nr;\r\n fish.y = nc;\r\n fish.lv = sea[nr][nc];\r\n } else if (nr == fish.x && nc < fish.y) { // 다 가장 위일 경우, 가장 왼쪽 우선권\r\n fish.x = nr;\r\n fish.y = nc;\r\n fish.lv = sea[nr][nc];\r\n }\r\n\r\n }\r\n\r\n }else if(isIn(nr, nc) && check[nr][nc] == 0) {\r\n check[nr][nc] = -1;\r\n }\r\n }\r\n }\r\n // idx 초과 안날 경우\r\n if (fish.x != N && fish.y != N) {\r\n eatFish(fish);\r\n }\r\n \r\n return (FishCheck - 1);\r\n }", "public Fighter[] update(Fighter[] fs, Platform plat, boolean[][] inputs)\r\n {\r\n //check if the player is starting a block\r\n setBlocking(fs[0],inputs[0]);\r\n setBlocking(fs[1],inputs[1]);\r\n\r\n //increase the timers and change the state of the block\r\n incrementBlock(fs[0]);\r\n incrementBlock(fs[1]);\r\n\r\n //check if the player is starting an attack and set the attack\r\n setAttacking(fs[0],plat,inputs[0]);\r\n setAttacking(fs[1],plat,inputs[1]);\r\n\r\n //increase the timers, change the state of the attack, and deal damage/knockback to the other fighter\r\n incrementAttack(fs[0],fs[1]);\r\n incrementAttack(fs[1],fs[0]);\r\n \r\n //if they aren't currently attacking, change their velocity and move the fighter\r\n if(fs[0].getAttacking() != 1)\r\n {\r\n setVels(fs[0],inputs[0],plat);\r\n }\r\n if(fs[1].getAttacking() != 1)\r\n {\r\n setVels(fs[1],inputs[1],plat);\r\n }\r\n\r\n //moves them based on knockback\r\n fs[0].setPos(fs[0].getPos()[0] + fs[0].getKnockBackVel()[0],fs[0].getPos()[1] + fs[0].getKnockBackVel()[1]);\r\n fs[1].setPos(fs[1].getPos()[0] + fs[1].getKnockBackVel()[0],fs[1].getPos()[1] + fs[1].getKnockBackVel()[1]);\r\n\r\n //decreases knockback\r\n fs[0].setKnockBackVel(fs[0].getKnockBackVel()[0]/kf, fs[0].getKnockBackVel()[1]/kf);\r\n fs[1].setKnockBackVel(fs[1].getKnockBackVel()[0]/kf, fs[1].getKnockBackVel()[1]/kf);\r\n\r\n //brings the fighters above the platform\r\n bringAbove(fs[0], plat);\r\n bringAbove(fs[1], plat);\r\n\r\n //brings the fighters back onto the screen\r\n bringBack(fs[0]);\r\n bringBack(fs[1]);\r\n \r\n return fs; \r\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}", "private void coins_fW(){\n\t\tthis.cube[4] = this.cube[0]; \n\t\tthis.cube[0] = this.cube[6];\n\t\tthis.cube[6] = this.cube[8];\n\t\tthis.cube[8] = this.cube[2];\n\t\tthis.cube[2] = this.cube[4];\n\t}", "public void fly(float fly){\n\t}", "protected BrotherhoodOfSteel(KnownFactions faction) {\n super(faction);\n }", "private void fish()\n {\n fishing.set(true);\n final int DELAY_VARIANCE = 5000, BASE_SLEEP = 2000;\n\n Tools.sleep(BASE_SLEEP);\n while (!interrupted)\n {\n /* Logout if either the user set a logout time or we ran out of lures. */\n final LocalTime logTime = timeProperty.get();\n if ((logTime != null && Tools.timePassed(logTime))\n || (lureQuit.get() && lure.isOutOfLures()))\n {\n Tools.typeStr(Lang.EN_LOGOUT);\n Controller.sendMessage(Lang.EN_MSG_LOGOUT_CONFIRM);\n break;\n }\n\n /* If a lure needs to be re-applied, use one. */\n if (lure.shouldApply()) lure.apply();\n\n Tools.typeStr(Lang.EN_CAST_FISHING);\n if (scan())\n Controller.sendMessage(reelIn() ? Lang.EN_MSG_FISH_CAUGHT\n : Lang.EN_ERROR_SPLASH_MISSING);\n else\n Controller.sendMessage(Lang.EN_ERROR_BOBBER_MISSING);\n /* Sleep for at least BASE_SLEEP plus an additional random amount. */\n Tools.sleep(BASE_SLEEP + Tools.fluctuate((long) (DELAY_VARIANCE * Math.random())));\n }\n fishing.set(false);\n }", "public Image getFishImage() {\r\n\t\treturn fishImage;\r\n\t}", "private void arretes_fG(){\n\t\tthis.cube[31] = this.cube[28]; \n\t\tthis.cube[28] = this.cube[30];\n\t\tthis.cube[30] = this.cube[34];\n\t\tthis.cube[34] = this.cube[32];\n\t\tthis.cube[32] = this.cube[31];\n\t}", "public Villager(int newF) {\n this.faction = newF;\n }", "public void setFloors(int floors);", "private int[] placeFruit() {\n\t\t\n\t\tint []point = new int[2];\n\t\t\n\t\tint helpX, helpY, foodX = 0, foodY = 0;\n\t\tboolean helpS,helpO;\t// for Snake and Obstacles\n\t\tboolean collision = true;\n\t\tArrayList<Obstacle> obstacles = Controller.getInstance().getObstacles();\n\n\t\twhile(collision) {\n\t\t\t\t\n\t\t\thelpS =helpO= false;\n\t\t\tfoodX = (rand.nextInt(BWIDTH)*GameObject.SIZE)+GameObject.SIZE/2;\n\t\t\tfoodY = (rand.nextInt(BHEIGHT)*GameObject.SIZE)+GameObject.SIZE/2;\n\t\t\t\t\n\t\t\tfor(int i = 0; i < snake.getSize(); ++i) {\n\t\t\t\t\t\n\t\t\t\thelpX = snake.getBodyPart(i).getX();\n\t\t\t\thelpY = snake.getBodyPart(i).getY();\n\t\n\t\t\t\tif(helpX == foodX && helpY == foodY) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\tif(i == snake.getSize() - 1) {\n\t\t\t\t\thelpS = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(helpS) {\n\n\n\n\t\t\t\t\tfor(int i = 0; i < obstacles.size(); ++i) {\n\n\t\t\t\t\t\thelpX = obstacles.get(i).getX();\n\t\t\t\t\t\thelpY = obstacles.get(i).getY();\n\n\t\t\t\t\t\tif(foodX == helpX && foodY == helpY) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(i == obstacles.size() - 1) {\n\t\t\t\t\t\t\thelpO = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\tif(helpO) {\n\t\t\t\t\tcollision = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpoint[0] = foodX;\n\t\tpoint[1] = foodY;\n\t\treturn point;\t\n\t}", "public static void main(String[] args) {\n World world = new World();\n Bug bug = new Bug();\n Bug bug2 = new Bug();\n Flower flower = new Flower();\n Flower flower2 = new Flower();\n Location location = new Location(3,4);\n \n Location location2 = world.getRandomEmptyLocation();\n Location left = location2.getAdjacentLocation(270);\n Location right = location2.getAdjacentLocation(90);\n\t world.show();\n\t world.add(left, flower);\n\t world.add(right, flower2);\n world.add(location,bug);\n world.add(location2,bug2);\n bug2.setColor(Color.BLUE);\n bug2.setDirection(90);\n for (int i = 0; i < world.getGrid().getNumCols()-1; i++) {\n\t\tfor (int j = 0; j <world.getGrid().getNumRows()-1 ; j++) {\n\t\tLocation current = new Location(i,j);\n\t\tworld.add(current, new Flower());\n\t\t}\n\t}\n\t}", "public void act() \n {\n EggFactory eggFactory = new EggFactory();\n \n move(4);\n int random = Greenfoot.getRandomNumber(5000);\n if((random>200 & random<300) || ((Farm)getWorld()).atWorldEdge(this))\n {\n turn(180);\n getImage().mirrorVertically();\n move(4);\n \n }\n\n if( Greenfoot.getRandomNumber(100) ==0)\n {\n\n Farm farm = (Farm)getWorld();\n Egg egg = null; \n int eggPicker = Greenfoot.getRandomNumber(80);\n //DropEggStrategy dropEgg = new DropEggStrategy(); //Strategy pattern\n\n IEggStrategy whiteStrategy = new WhiteEggStrategy(eggFactory);\n IEggStrategy blackStrategy = new BlackEggStrategy(eggFactory);\n IEggStrategy goldenStrategy = new GoldenEggStrategy(eggFactory);\n \n DropEggContext context = new DropEggContext();\n \n if(eggPicker >= 50 && eggPicker <= 60){\n \n context.setIEggStrategy(goldenStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n else if(eggPicker >= 60 && eggPicker <= 70){\n\n context.setIEggStrategy(blackStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n else{\n context.setIEggStrategy(whiteStrategy);\n egg = context.dropEgg();\n getWorld().addObject(egg, this.getX(), this.getY()+45);\n }\n \n egg.register(farm.getLifeObserver());//register life creator observer into egg subject \n\n \n\n }\n\n }", "public Fish(String name, String gender){\n this.name = name;\n this.gender = gender;\n this.value = 10;\n this.eats = whatItEats(new fishFood());\n this.portionSize = 20;\n this.minimumOffspring = 1;\n this.maximumOffspring = 12;\n this.maxAge = 4;\n this.vetCost = 2;\n }", "@Override\n\tpublic void movefrut(game_service game) throws JSONException {\n\t\tthis.fru = new ArrayList<fruit>();\n\t\tfor (String fruit1 : game.getFruits()) {\n\t\t\tfru.add(new fruit(fruit1));\n\t\t}\n\t}", "public void movF(){\r\n\t\t\r\n\t\t\r\n\t\t/*\r\n\t\t * fallos , la f3 de la cara 4 pasa a la c0 de cara 2\r\n\t\t * la columna 0 de cara dos pasa a fila 1 cara 5\r\n\t\t * columna 3 de cara 0 para a fila 0 cara 4\r\n\t\t * fila 0 cara 5 pasa a columna 3 cara 0\r\n\t\t */\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tint aux[][] = new int[1][3];\r\n\t\tint aux2[][] = new int[3][1];\r\n\t\tint aux3[][] = new int[1][3];\r\n\t\tint aux4[][] = new int[3][1];\r\n\t\t\r\n\t\tint aux5[][]= new int [1][3];\r\n\t\tint aux6[][]= new int [1][3];\r\n\t\tint aux7[][]= new int [1][3];\r\n\t\t\r\n\t\t//copiamos en un aux la primera fila de zona 5\r\n\t\taux=cloneF(5,0);\r\n\t\taux2=cloneC(0,2);\r\n\t\taux3=cloneF(4,2); //bloque 4 fila 2\r\n\t\taux4=cloneC(2,0);//bloque 2 col 0\r\n\t\t\r\n\t\taux5=cloneF(1,0);\r\n\t\taux6=cloneF(1,1);\r\n\t\taux7=cloneF(1,2);\r\n\t\t\r\n\t\t\r\n\t\tthis.copiaEnColumnaUnaFila(aux, 0, 2);//copiamos en bl0 col2\r\n\t\tthis.copiaEnFilaUnaColumnaReverse(aux2, 4, 2);\r\n\t\t\r\n\t\tthis.copiaEnColumnaUnaFila(aux3, 2, 0);//copiamos en bl0 la col0\r\n\t\tthis.copiaEnFilaUnaColumnaReverse(aux4, 5, 0);\r\n\t\t\r\n\t\tthis.copiaEnColumnaUnaFila(aux5, 1, 2);\r\n\t\tthis.copiaEnColumnaUnaFila(aux6, 1, 1);\r\n\t\tthis.copiaEnColumnaUnaFila(aux7, 1, 0);\r\n\t\t\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\n Fish fish2 = new Fish(\"tom\",17, \"red\");\n System.out.println(fish2.getName());\n System.out.println(fish2.getAge()); \n System.out.println(fish2.getColor());\n\n }", "private void arretes_fO(){\n\t\tthis.cube[40] = this.cube[37]; \n\t\tthis.cube[37] = this.cube[39];\n\t\tthis.cube[39] = this.cube[43];\n\t\tthis.cube[43] = this.cube[41];\n\t\tthis.cube[41] = this.cube[40];\n\t}", "private void initEntities() {\n \n for (int i = 0; i < 15; ++i) {\n \n //generate random position and direction\n Vector3 pos = new Vector3(\n ((ValuesUtil.rand.nextFloat() * 2.0f) - 1.0f) *\n TransformationsUtil.getOpenGLDim().x,\n ((ValuesUtil.rand.nextFloat() * 2.0f) - 1.0f) *\n TransformationsUtil.getOpenGLDim().y,\n 0.0f);\n float rot = ValuesUtil.rand.nextFloat() * 360.0f;\n \n entities.add(new GlowFish(pos, new Vector3(0.0f, 0.0f, rot)));\n }\n \n //fader\n entities.add(new Fader(FadeDirection.FADE_IN, 0.02f,\n new Vector4(0.0f, 0.0f, 0.0f, 1.0f), true));\n }", "public PVector cohesion (ArrayList<Shark> sharks) {\n float neighbordist = 50;\n PVector sum = new PVector(0, 0); // Start with empty vector to accumulate all positions\n int count = 0;\n for (Shark other : sharks) {\n float d = PVector.dist(position, other.position);\n if ((d > 0) && (d < neighbordist)) {\n sum.add(other.position); // Add position\n count++;\n }\n }\n if (count > 0) {\n sum.div(count);\n return seek(sum); // Steer towards the position\n } else {\n return new PVector(0, 0);\n }\n }", "public STFBehaviour(Faction faction)\n\t{\n\t\tfFaction = faction;\n fRandom = new Random();\n\t}", "private void coins_fO(){\n\t\tthis.cube[40] = this.cube[36]; \n\t\tthis.cube[36] = this.cube[42];\n\t\tthis.cube[42] = this.cube[44];\n\t\tthis.cube[44] = this.cube[38];\n\t\tthis.cube[38] = this.cube[40];\n\t}", "private void arretes_fW(){\n\t\tthis.cube[4] = this.cube[1]; \n\t\tthis.cube[1] = this.cube[3];\n\t\tthis.cube[3] = this.cube[7];\n\t\tthis.cube[7] = this.cube[5];\n\t\tthis.cube[5] = this.cube[4];\n\t}", "public Fish create(){\n\t\tMovementStyle style = new NoMovement();\n\t\treturn new Shark(style);\n\t}", "void currentFrame(List<IShape> shapes);", "@Override\n public void addNewForce(Force f) {\n\n }", "@Override\n\tpublic void setPositions(){\n\t\ttirePositions[0]=new Vector2(2f,-2.9f);// Rear\n\t\ttirePositions[1]=new Vector2(-2f,-2.9f); \n\n\t\ttirePositions[2]=new Vector2(2f,2.8f); //Fronts\n\t\ttirePositions[3]=new Vector2(-2f,2.8f);\n\t}", "private void aimlessScout() {\n\t\ttargetFlower = null;\n\t\t// if bee is sufficiently far from flower, look for other flowers\n\t\tif((clock.time - tempTime) > 0.15) {\n\t\t\tstate = \"SCOUTING\";\n\t\t}\n\t\t// otherwise keep flying\n\t\telse{\n\t\t\tcurrentAngle += RandomHelper.nextDoubleFromTo(-Math.PI/8, Math.PI/8);\n\t\t\tspace.moveByVector(this, 4, currentAngle,0);\n\t\t\tNdPoint myPoint = space.getLocation(this);\n\t\t\tgrid.moveTo(this, (int) myPoint.getX(), (int) myPoint.getY());\n\t\t\t//energy -= exhaustionRate;\n\t\t\tfood -= highMetabolicRate;\n\t\t}\n\t}", "public void FPrimeEvent(ArrayList<ArrayList<Shape>> faces) {\r\n \tint u1 = CUBE7, l1 = CUBE9, r1 = CUBE1, b1 = CUBE3;\r\n \tfor(int i = 0; i < 3; i++) {\r\n \t\tColor color = faces.get(TOP).get(u1).getColor();\r\n \tfaces.get(TOP).get(u1).changeColor(faces.get(RIGHT).get(r1).getColor());\r\n \tfaces.get(RIGHT).get(r1).changeColor(faces.get(BOTTOM).get(b1).getColor());\r\n \tfaces.get(BOTTOM).get(b1).changeColor(faces.get(LEFT).get(l1).getColor());\r\n \tfaces.get(LEFT).get(l1).changeColor(color);\r\n \tu1++;\r\n \tl1 -= SHIFT_ROW;\r\n \tb1--;\r\n \tr1 += SHIFT_ROW;\r\n \t} \r\n \r\n \tColor color = faces.get(FRONT).get(CUBE1).getColor();\r\n \tfaces.get(FRONT).get(CUBE1).changeColor(faces.get(FRONT).get(CUBE3).getColor());\r\n \tfaces.get(FRONT).get(CUBE3).changeColor(faces.get(FRONT).get(CUBE9).getColor());\r\n \tfaces.get(FRONT).get(CUBE9).changeColor(faces.get(FRONT).get(CUBE7).getColor());\r\n \tfaces.get(FRONT).get(CUBE7).changeColor(color);\r\n \tcolor = faces.get(FRONT).get(CUBE2).getColor();\r\n \tfaces.get(FRONT).get(CUBE2).changeColor(faces.get(FRONT).get(CUBE6).getColor());\r\n \tfaces.get(FRONT).get(CUBE6).changeColor(faces.get(FRONT).get(CUBE8).getColor());\r\n \tfaces.get(FRONT).get(CUBE8).changeColor(faces.get(FRONT).get(CUBE4).getColor());\r\n \tfaces.get(FRONT).get(CUBE4).changeColor(color);\r\n }", "public void missedFish(ArrayList<Fish> hitList){\r\n for(Fish missing: hitList){\r\n getChildren().remove(missing.fishView);\r\n activeFish.remove(missing);\r\n }\r\n }", "@Override\r\n\tpublic void fly() {\n\t\tsuper.fly();\r\n\t\tsuper.fly();\r\n\t\tsuper.fly();\r\n\t}", "public void frogReposition() {\n\t\tsetY(FrogPositionY);\n\t\tsetX(FrogPositionX);\t\t\n\t\t}", "public void lookHere(int x, int y, int ID){\n\n\n\n switch (ID){\n case FLY:\n //find faces close enough\n /*for(int i=0;i<mFaces.size();i++){\n Face face = mFaces.get(i);\n if(ViewTools.getDistancetoNonSQRTD(x,y,face.getCenterX(),face.getCenterY())<FlyFocusDistanceNONSQRTD){\n lookHere(x,y,face,FLY);\n }else StopLookingOne(FLY, face);\n }*/\n\n //pick one face\n class faceDistance{\n public float distance;\n public Face face;\n faceDistance(float distance, Face face) {\n this.distance = distance;\n this.face = face;\n }\n\n }\n ArrayList<faceDistance> distances = new ArrayList<faceDistance>();\n for(int i=0;i<mFaces.size();i++){\n Face face = mFaces.get(i);\n float flyDistance = ViewTools.getDistancetoNonSQRTD(x, y, face.getCenterX(), face.getCenterY());\n //Log.d(\"BRAIN\", \"FLY DISTANCE SQUARED:\" + FlyFocusDistanceNONSQRTD + \" this face distance: \"+ flyDistance);\n if(flyDistance <FlyFocusDistanceNONSQRTD){\n distances.add(new faceDistance(flyDistance,mFaces.get(i)));\n }else StopLookingOne(FLY, face);\n\n }\n\n ArrayList<faceDistance> distancesSorted = new ArrayList<faceDistance>();\n if(distances.size()>0)distancesSorted.add(distances.get(0));\n for(int i=1;i<distances.size();i++){\n int distanceSortedSize=distancesSorted.size();\n for(int i2=0;i2<distanceSortedSize;i2++){\n if(i2==distancesSorted.size()-1)distancesSorted.add(distances.get(i));\n else if(distances.get(i).distance<distancesSorted.get(i2).distance){\n distancesSorted.add(i2,distances.get(i));\n i2=distancesSorted.size();\n }\n }\n\n }\n\n\n for(int i=0;i<distancesSorted.size();i++){\n if(i< MAX_FLY_FOCUSES||MAX_FLY_FOCUSES==UNRESTRICTED)lookHere(x,y,distancesSorted.get(i).face,FLY);\n else StopLookingOne(FLY,distancesSorted.get(i).face);\n\n }\n\n ///picking one face\n\n\n break;\n case FINGER:\n for(int i=0;i<mFaces.size();i++){\n Face face = mFaces.get(i);\n if(ViewTools.getDistancetoNonSQRTD(x,y,face.getCenterX(),face.getCenterY())<FlyFocusDistanceNONSQRTD*2){\n lookHere(x,y,face,FINGER);\n }else StopLookingOne(FINGER, face);\n }\n break;\n case FROG:\n ///select a face to look at the frog\n //command to look only sent once, eyes stay looking at frog, until relase code sent\n int faceSelected = mRandom.nextInt(mFaces.size()-1);\n if(faceSelected== mFrogIndex)faceSelected++;\n mFaces.get(faceSelected).SetEyeAdjustDuration(true);\n lookHere(x, y, mFaces.get(faceSelected), FROG);\n\n new lookAway(mFaces.get(faceSelected),mFrog.getFrogLookAttentionLength());\n\n //mFrog.setFrogLookAttentionLength(mFrog.getFrogLookAttentionLength()*2);\n //mFrog.setFrogLookInterval((long) (mFrog.getFrogLookInterval()*.90));\n //Log.d(\"Brain\", \"frog look interval:\"+ mFrog.getFrogLookInterval());\n //Log.d(\"Brain\", \"frog look lenght:\"+ mFrog.getFrogLookAttentionLength());\n\n break;\n case REVEALED_FROG:\n ///\n break;\n\n }\n\n }", "public Bee(ContinuousSpace<Object> s, Grid<Object> g, Hive h, Clock c, List<Flower> f) {\n \t\t\n \t\t// initialize properties of bee\n\t\tspace = s;\n\t\tgrid = g;\n\t\tfood = startingCrop;\n\t\ttargetFlower = null;\n\t\tstate = \"SLEEPING\";\n\t\thive = h;\n\t\tclock = c;\n\t\tflowers = f;\n\t\t\n\t\t// define semi-random preferred foraging times for bee\n\t\tstartForagingTime = RandomHelper.nextDoubleFromTo(avgStartForagingTime - 2.0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tavgStartForagingTime + 2.0);\n\t\tendForagingTime = RandomHelper.nextDoubleFromTo(avgEndForagingTime - 2.0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tavgEndForagingTime + 2.0);\n\t}", "public void settleForce(Force f){\n if(!f.getOwner().equals(this.owner)){\n if(this.troops != 0)\n throw new IllegalArgumentException(\"Can't settle a Force in an occupied Territory\");\n this.owner = f.getOwner();\n }\n this.troops += f.getTroops();\n inGameInvariant();\n }", "abstract void fly();", "@Override\n public void resetFog()\n {\n confirmedVisibles.clear();\n for( int y = 0; y < mapHeight; ++y )\n {\n for( int x = 0; x < mapWidth; ++x )\n {\n isFogged[x][y] = true;\n }\n }\n // then reveal what we should see\n if (null == viewer)\n return;\n for( Army army : master.game.armies )\n {\n if( viewer.isEnemy(army) )\n continue;\n for( Commander co : army.cos )\n {\n for( Unit unit : co.units )\n {\n for( XYCoord coord : Utils.findVisibleLocations(this, unit, false) )\n {\n revealFog(coord, false);\n }\n // We need to do a second pass with piercing vision so we can know whether to reveal the units\n for( XYCoord coord : Utils.findVisibleLocations(this, unit, true) )\n {\n revealFog(coord, true);\n }\n }\n for( XYCoord xyc : co.ownedProperties )\n {\n revealFog(xyc, true); // Properties can see themselves and anything on them\n MapLocation loc = master.getLocation(xyc);\n for( XYCoord coord : Utils.findVisibleLocations(this, loc.getCoordinates(), Environment.PROPERTY_VISION_RANGE) )\n {\n revealFog(coord, false);\n }\n }\n }\n }\n }", "private void setShips(){\n\t\t\n\t\tint x,y;\n\t\tboolean orientacja;\n\t\tRandom generator = new Random();\n\t\t\n\t\tint ilosc = 1;\n\t\tint j = 0;\n\t\tfor(int i = 4; i > 0 ; i--){\n\t\t\twhile( j < ilosc ){\n\t\t\t\tx = generator.nextInt( 13 );\t\t\n\t\t\t\ty = generator.nextInt( 13 );\n\t\t\t\torientacja = generator.nextBoolean();\n\t\t\t\tif( isPossibleAddShip(x, y, i, orientacja) ) j++;\t\n\t\t\t}\n\t\tilosc++;\n\t\tj=0;\n\t\t}\n\t\t\n\t}", "@Override\r\n\tpublic void fly() {\n\t\t\r\n\t}", "public void faceUp(){\r\n changePlace(hand);\r\n //do a magical work\r\n changePlace(graveYard);\r\n }", "public void addFurniture(List<HomePieceOfFurniture> furniture) {\n addFurniture(furniture, null);\n }", "@Override\n public void fly() {\n System.out.println(getName() + \" is flapping\");\n }", "public static void main(String[] args) {\n Ator a = new Ator(\"Alberto\");\r\n Ator b = new Ator(\"Vagner moura\");\r\n Ator c = new Ator(\"Ator 1\");\r\n\r\n Filme f= new Filme(\"Tropa de elite\", 2011);\r\n\r\n f.addPapel(a,\"papel 1\", false);\r\n f.addPapel(b,\"papel 2\", true);\r\n f.addPapel(c,\"papel 3\", true);\r\n\r\n\r\n System.out.println(a.getFilmes());\r\n /*System.out.println(f.getProtagonista());\r\n System.out.println(f);\r\n System.out.println(a);\r\n System.out.println(b);\r\n System.out.println(c);*/\r\n\r\n\r\n }", "protected ArrayList<Ship> initiateShips(){\n ArrayList<Ship> initialShips = new ArrayList<>();\n\n //battleship\n for (int i=0;i<1;i++){\n Battleship battleship = new Battleship();\n initialShips.add(battleship);\n }\n\n //cruiser\n for (int i=0;i<2;i++){\n Cruiser cruiser = new Cruiser();\n initialShips.add(cruiser);\n }\n\n //destroyer\n for (int i=0;i<3;i++){\n Destroyer destroyer = new Destroyer();\n initialShips.add(destroyer);\n }\n\n //submarine\n for (int i=0;i<4;i++){\n Submarine submarine = new Submarine();\n initialShips.add(submarine);\n }\n\n return initialShips;\n }", "public void REvent(ArrayList<ArrayList<Shape>> faces) {\r\n \tint cube = CUBE3, backCube = CUBE7;\r\n \tfor(int i = 0; i < 3; i++) {\r\n \t\tColor color = faces.get(FRONT).get(cube).getColor();\r\n \tfaces.get(FRONT).get(cube).changeColor(faces.get(BOTTOM).get(cube).getColor());\r\n \tfaces.get(BOTTOM).get(cube).changeColor(faces.get(BACK).get(backCube).getColor());\r\n \tfaces.get(BACK).get(backCube).changeColor(faces.get(TOP).get(cube).getColor());\r\n \tfaces.get(TOP).get(cube).changeColor(color);\r\n \tcube += SHIFT_ROW;\r\n \tbackCube -= SHIFT_ROW;\r\n \t\r\n \t} \r\n \r\n \tColor color = faces.get(RIGHT).get(CUBE1).getColor();\r\n \tfaces.get(RIGHT).get(CUBE1).changeColor(faces.get(RIGHT).get(CUBE7).getColor());\r\n \tfaces.get(RIGHT).get(CUBE7).changeColor(faces.get(RIGHT).get(CUBE9).getColor());\r\n \tfaces.get(RIGHT).get(CUBE9).changeColor(faces.get(RIGHT).get(CUBE3).getColor());\r\n \tfaces.get(RIGHT).get(CUBE3).changeColor(color);\r\n \tcolor = faces.get(RIGHT).get(CUBE2).getColor();\r\n \tfaces.get(RIGHT).get(CUBE2).changeColor(faces.get(RIGHT).get(CUBE4).getColor());\r\n \tfaces.get(RIGHT).get(CUBE4).changeColor(faces.get(RIGHT).get(CUBE8).getColor());\r\n \tfaces.get(RIGHT).get(CUBE8).changeColor(faces.get(RIGHT).get(CUBE6).getColor());\r\n \tfaces.get(RIGHT).get(CUBE6).changeColor(color);\r\n }", "protected void fallingSnow(){\r\n\t\tsnowPileImage = new Image(GameData.getRegion(\"snow\"));\r\n\t\tsnowPileImage.setWidth(Gdx.graphics.getWidth());\r\n\t\t\r\n\t\tdouble snowRatio = GameData.getRegion(\"snow\").getRegionWidth()/GameData.getRegion(\"snow\").getRegionHeight();\r\n\t\tsnowPileImage.setHeight((int)(snowPileImage.getWidth()/snowRatio));\r\n\t\tsnowPileImage.setName(SNOW_PILE_Z);\r\n\t\t\r\n\t\tfor(int i=0; i<SNOW_FLAKES_NUMBER; i++){\r\n\t\t\tstage.addActor(new Snowflake(GameData.getRegion(\"snowflake\"), 1f, true, stage));\r\n\t\t\tstage.addActor(new Snowflake(GameData.getRegion(\"snowflake\"), 0.5f, false, stage));\r\n\t\t}\r\n\t\tstage.addActor(snowPileImage);\r\n\r\n\t}", "public static void setFishableFish() {\n PondTile.fishableFish = new String[0];\n }", "public void makeShips()\n\t{\n\t\t//The below is firstly to create the five ships \n\t\tint[] shipSizes= {2,3,3,4,5};\n\n\t\t//### Creating battleship to be put in the playerBattleShipsList\n\t\tfor (int x = 0; x < shipSizes.length; x ++) \n\t\t{\n\t\t\t//This creates a new battleship of size X from index's of shipSizes\n\t\t\tBattleShip newPlayerBattleShip = new BattleShip(shipSizes[x]);\n\n\t\t\t//This add the new battleship of size x (above) to a part in the array\n\t\t\tplayerBattleShipsList[x] = newPlayerBattleShip;\n\t\t}\n\n\t\t//### Creating battleship to be put in the aiBattleShipsList\n\n\t\tfor (int y = 0; y < shipSizes.length; y ++) \n\t\t{\n\t\t\t//This creates a new battleship of size X from index's of shipSizes\n\t\t\tBattleShip newAIBattleShip = new BattleShip(shipSizes[y]);\n\n\t\t\t//This add the new battleship of size x (above) to a part in the array\n\t\t\taiBattleShipsList[y] = newAIBattleShip;\n\t\t}\n\n\t}", "public Frogger()\n\t{\n\t\tfor(int i = 0; i < logs.length; i++)\n\t\t{\n\t\t\tint logLength = LOG_IMAGE_LENGTH;\n\t\t\tint logX = LOG_START_X + i * STEP_SIZE;\n\t\t\tint logY = LOG_START_Y;\n\t\t\tint logDx = LOG_VELOCITY;\t\n\t\t\tif (i % 3 == 0)\n\t\t\t{\n\t\t\t\tlogY = LOG_START_Y + 0 * STEP_SIZE;\n\t\t\t\tlogDx = LOG_VELOCITY + 0;\n\t\t\t}\t\t\n\t\t\telse if (i % 3 == 1)\n\t\t\t{\n\t\t\t\tlogY = LOG_START_Y + 1 * STEP_SIZE;\n\t\t\t\tlogLength = LOG_IMAGE_LENGTH + 4;\n\t\t\t\tlogDx = LOG_VELOCITY * NEGATIVE_ONE;\n\t\t\t}\t\n\t\t\telse if (i % 3 == 2)\n\t\t\t{\n\t\t\t\tlogY = LOG_START_Y + 2 * STEP_SIZE;\n\t\t\t\tlogDx = LOG_VELOCITY + 0;\n\t\t\t\t\n\t\t\t}\t\n\n\t\t\tlogs[i] = new Log(logX, logY, logLength, logDx);\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i = 0; i < carsRight.length; i++)\n\t\t{\n\t\t\tint carLength = CAR_LENGTH;\n\t\t\tint carRightX = MIN_WIDTH + i * STEP_SIZE_CAR;\n\t\t\tint carRightY = CAR_START_Y;\n\t\t\tint carDx = CAR_VELOCITY;\t\n\t\t\t\n\t\t\tif(i >= NUMBER_OF_CARS)\n\t\t\t{\n\t\t\t\tcarRightY = CAR_START_Y + CAR_Y_STEP_SIZE;\n\t\t\t\tcarDx = CAR_VELOCITY + CAR_VELOCITY_STEPSIZE;\n\t\t\t}\n\t\t\t\n\t\t\tcarsRight[i] = new Car(carRightX, carRightY, carLength, carDx);\t\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < carsLeft.length; i++)\n\t\t{\n\t\t\tint carLength = CAR_LENGTH;\n\t\t\tint carLeftX = MIN_WIDTH + i * STEP_SIZE_CAR;\n\t\t\tint carLeftY = CAR_START_Y + (CAR_Y_STEP_SIZE / 3);\n\t\t\tint carDx = CAR_VELOCITY * - CAR_VELOCITY_STEPSIZE;\t\n\t\t\t\n\t\t\tif(i >= NUMBER_OF_CARS)\n\t\t\t{\n\t\t\t\tcarLeftY = CAR_START_Y + CAR_Y_STEP_SIZE + (CAR_Y_STEP_SIZE/2);\n\t\t\t\tcarDx = CAR_VELOCITY * NEGATIVE_ONE - 3;\n\t\t\t}\n\t\t\t\n\t\t\tcarsLeft[i] = new Car(carLeftX, carLeftY, carLength, carDx);\n\t\t}\t\n\t\t\n\t\tint frogSize = FROG_SIZE;\n\t\tint x = START_X;\n\t\tint y = START_Y;\n\t\tint frogVelocityX = FROG_START_VELOCITY;\n\t\t\n\t\tfroggy = new Frog(x, y, frogSize, frogVelocityX);\n\n\t\tsetSize(MAX_WIDTH, MAX_HEIGHT);\n\t\tsetVisible(true);\t\n\n\t\tTimer clock= new Timer(DELAY_IN_MILLISEC, this);\t\t\t\n\t\tclock.start();\t\t\t\t\n\t}", "@Override\n\tpublic void decide() {\n\t\tif (this.isDead) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(this.age >= this.lifeSpan) {\n\t\t\t// DIE\n\t\t\tthis.environment.removeAgent(this.getPosX(), this.getPosY());\n\t\t\tthis.isDead = true;\n\n\t\t\t// Print if required\n\t\t\tif (this.appConfig.hasTrace()) {\n\t\t\t\tSystem.out.println(\"Agent;Death;Fish;\" + this.getPosX() + \";\" + this.getPosY());\n\t\t\t}\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\tthis.age++;\n\t\tthis.color = Color.GREEN;\n\t\tboolean canFuck = this.breedTime == 0;\n\n\t\tint[] coordinates = this.chooseCoordinates();\n\n\t\t// fish cannot move or fuck because there is no place to do so\n\t\tif (coordinates == null) {\n\t\t\tthis.breedTime = this.breedTime > 0 ? this.breedTime - 1 : this.breedTime;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.environment.moveAgent(this, coordinates[0], coordinates[1]);\n\n\t\t// Time to fuck-zer\n\t\tif (canFuck) {\n\t\t\tthis.fuck(this.getPosX(), this.getPosY());\n\t\t}\n\t\t// Update breedtime in order to wait the holy fuck time\n\t\telse {\n\t\t\tthis.breedTime = this.breedTime > 0 ? this.breedTime - 1 : this.breedTime;\n\t\t}\n\t\tthis.posX = coordinates[0];\n\t\tthis.posY = coordinates[1];\n\t}", "@Override\n\tpublic void fly() {\n\t\t\n\t}", "@Override\n\tpublic Pizza crearPizza(FactoriaIngredientes fi) {\n\t\treturn null;\n\t}", "void fly();", "public void setPickAnotherCard(List<ClientTowerFloor> clientTowerFloors)\n {\n this.pickAnotherCard = clientTowerFloors;\n this.currentState = ClientStateName.CHOOSE_NEW_CARD;\n setChanged();\n notifyObservers(currentState);\n }", "@Override\n\tpublic boolean equals(Object other) { \n\t\tif (other instanceof Fish) {\n\t\t\tFish otherFish =((Fish) other);\n\t\t\treturn this.xloc == otherFish.getXLoc() && this.yloc == otherFish.getYLoc()\n\t\t\t\t\t\t\t\t&& this.isCaught == otherFish.isCaught && this.direction\n\t\t\t\t\t\t\t\t== otherFish.direction && this.species == otherFish.species;\n\t\t}\n\t\treturn false;\n\t}", "public Fish(String id, String name, String type, String species, double energy, double visionRange, double maxDistTravel, double x, double y) {\n\t\tsuper(id, name, type, energy, visionRange, maxDistTravel, x, y);\n\t\tthis.setSpecies(species);\n\n\t\tSystem.out.println(\"Fish::Fish: Created a fish of the species: \"+species);\n\t}", "public void swim(){// this class only for fish class\n System.out.println(name+\" swimming\");\n }", "public void flap(){\n bird.setY(bird.getY() - 6);\n }", "@Override\n\tpublic ArrayList<Edge> makeMove(Graph graph, int iteration) {\n\t\t// Create a value associated with each position\n\t\tIterator<Edge> edges = graph.edges();\n\t\twhile (edges.hasNext()) {\n\t\t\tEdge edge = edges.next();\n\t\t\tVertex v1 = edge.getFromVertex();\n\t\t\tVertex v2 = edge.getToVertex();\n\t\t\t// We favor free spots\n\t\t\tif (edge.getProperty().equals(Property.FREE)) {\n\t\t\t\t// We dislike being close to opposing settlements\n\t\t\t\tif (v1.getProperty().equals(Property.FREE) && v2.getProperty().equals(Property.FREE)) {\n\t\t\t\t\tthis.discount(edge);\n\t\t\t\t}\n\t\t\t\t// We favor areas close by\n\t\t\t\tif (v1.getProperty().equals(super.getProperty())) {\n\t\t\t\t\tthis.discount(edge);\n\t\t\t\t}\n\t\t\t\t// Early in the game we want roads and settlements\n\t\t\t\tif (iteration < Constants.INFLECTION_ROUND) {\n\t\t\t\t\tif (v1.getResources().contains(Resource.BRICK) || v1.getResources().contains(Resource.LUMBER)) {\n\t\t\t\t\t\tthis.discount(edge);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Towards the end of the game we want cities\n\t\t\t\tif (iteration >= Constants.INFLECTION_ROUND) {\n\t\t\t\t\tif (v1.getResources().contains(Resource.ORE) || v1.getResources().contains(Resource.GRAIN)) {\n\t\t\t\t\t\tthis.discount(edge);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// We favor hexes with high probability rolls\n\t\t\t\tif (v1.getRolls().contains(5) || v1.getRolls().contains(6) || v1.getRolls().contains(8)) {\n\t\t\t\t\tthis.discount(edge);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tKruskalAlgo kruskal = new KruskalAlgo(graph);\n\t\treturn kruskal.getMinSpanForest(graph);\n\t}", "public void solucioInicial2() {\n int grupsRecollits = 0;\n for (int i=0; i<numCentres*helisPerCentre; ++i) {\n Helicopter hel = new Helicopter();\n helicopters.add(hel);\n }\n int indexHelic = 0;\n int indexGrup = 0;\n int places = 15;\n while (indexGrup < numGrups) {\n int trajecte[] = {-1,-1,-1};\n for (int i=0; i < 3 && indexGrup<numGrups; ++i) {\n Grupo grup = grups.get( indexGrup );\n if (places - grup.getNPersonas() >= 0) {\n places -= grup.getNPersonas();\n trajecte[i] = indexGrup;\n indexGrup++;\n\n }\n else i = 3;\n }\n Helicopter helicopter = helicopters.get( indexHelic );\n helicopter.addTrajecte( trajecte, indexHelic/helisPerCentre );\n places = 15;\n indexHelic++;\n if (indexHelic == numCentres*helisPerCentre) indexHelic = 0;\n }\n }", "private void fire()\n {\n if (frames % 300 == 0 || frames == 0)\n {\n for(int i = 0; i <=6; i++)\n {\n FireBall fireBall = new FireBall();\n getWorld().addObject(fireBall, getX()+30, getY()); \n }\n }\n }", "public void render(Graphics g) {\n int sxtemp = sx, sytemp = sy;\n g.drawImage(background, 0, 0, 1024, 768, sxtemp, sytemp-768, sxtemp+1024, sytemp, null);\n \n for (Obstacle1 obstacle : floors) {\n\t Rectangle range = new Rectangle(obstacle.getLocation(), obstacle.getSize());\n g.drawImage(obstacle.getImage(), range.x - sx , range.y - sy + 768, range.width, range.height, null);\n //g.drawImage(obstacle, 666, 444, obstacle.getWidth(), obstacle.getHeight(), null);\n\t}\n\tfor (Obstacle2 stair : stairs) {\n\t Rectangle range = new Rectangle(stair.getLocation(), stair.getSize());\n if (stair.getFace() == Direction.RIGHT) {\n g.drawImage(stair.getImage(), range.x + range.width - sx, range.y - sy + 768, -range.width, range.height, null);\n } else {\n g.drawImage(stair.getImage(), range.x - sx , range.y - sy + 768, range.width, range.height, null);\n }\n //g.drawImage(obstacle, 666, 444, obstacle.getWidth(), obstacle.getHeight(), null);\n\t}\n\tfor (Obstacle3 obstacle : rocks) {\n\t Rectangle range = new Rectangle(obstacle.getLocation(), obstacle.getSize());\n g.drawImage(obstacle.getImage(), range.x - sx , range.y - sy + 768, range.width, range.height, null);\n\t}\n\t\n for (Sprite sprite : sprites) {\n //System.out.println(sprite.location);\n //System.out.printf(\"%d %d\\n\", sxtemp, sytemp);\n sprite.setLocation(new Point(sprite.getX()-sxtemp, sprite.getY()-sytemp+768));\n //System.out.printf(\"%d %d\\n\", sxtemp, sytemp);\n sprite.render(g);\n sprite.setLocation(new Point(sprite.getX()+sxtemp, sprite.getY()+sytemp-768));\n }\n for(DropItem dropItem : dropItems) {\n dropItem.setLocation(new Point(dropItem.getLocation().x-sxtemp, dropItem.getLocation().y-sytemp+768));\n dropItem.render(g);\n dropItem.setLocation(new Point(dropItem.getLocation().x+sxtemp, dropItem.getLocation().y+sytemp-768));\n }\n sx = sxtemp; sy = sytemp;\n\n BufferedImage bg = resizeImage((BufferedImage)background, background.getWidth(null)/16, background.getHeight(null)/16);\n g.drawImage(bg, 0, 0, null);\n for (Sprite sprite : sprites) {\n g.setColor(Color.RED);\n Point p = sprite.getLocation();\n if(sprite instanceof Boss) g.fillOval((int)(p.getX()/16), (int)(p.getY()/16), 16, 16);\n else g.fillOval((int)(p.getX()/16), (int)(p.getY()/16), 6, 6);\n }\n for(Obstacle obstacle : floors) {\n Point p = obstacle.getLocation();\n int w = obstacle.getImage().getWidth(null), h = obstacle.getImage().getHeight(null);\n BufferedImage img = resizeImage((BufferedImage)obstacle.getImage(), w/16, h/16);\n g.drawImage(img, (int)(p.getX()/16), (int)(p.getY()/16), null);\n }\n for(Obstacle obstacle : rocks) {\n Point p = obstacle.getLocation();\n int w = obstacle.getImage().getWidth(null), h = obstacle.getImage().getHeight(null);\n BufferedImage img = resizeImage((BufferedImage)obstacle.getImage(), w/16, h/16);\n g.drawImage(img, (int)(p.getX()/16), (int)(p.getY()/16), null);\n }\n for(Obstacle obstacle : stairs) {\n Point p = obstacle.getLocation();\n int w = obstacle.getImage().getWidth(null), h = obstacle.getImage().getHeight(null);\n BufferedImage img = resizeImage((BufferedImage)obstacle.getImage(), w/16, h/16);\n g.drawImage(img, (int)(p.getX()/16), (int)(p.getY()/16), null);\n }\n\n\n g.setColor(Color.green);\n Point p = player.getLocation();\n g.fillOval((int)(p.getX()/16), (int)(p.getY()/16), 8, 8);\n g.setColor(Color.black);\n g.drawOval((int)(p.getX()/16), (int)(p.getY()/16), 8, 8);\n\n g.drawImage(pause, 950, 0, null);\n\n g.setColor(Color.pink);\n g.fillRect(350, 650, 300, 80);\n g.setColor(Color.black);\n g.drawRect(350, 650, 300, 80);\n Image pl;\n try {\n pl = ImageIO.read(new File(\"assets/others/player.png\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(pl, 365, 655, null);\n g.setColor(Color.black);\n g.setFont(new Font(\"TimesRoman\", Font.BOLD, 16));\n g.drawString(\"LV. \" + player.lv, 415, 700); //player.exp + \"/\" + player.lv*100\n g.drawString(\"exp \", 480, 675);\n\n g.setFont(new Font(\"TimesRoman\", Font.PLAIN, 16));\n g.setColor(Color.GRAY);\n g.fillRect(510, 660, 120, 15);\n g.setColor(Color.YELLOW);\n g.fillRect(510, 660, (int) (player.exp * 120 / (player.lv*100)), 15);\n g.setColor(Color.BLACK);\n g.drawRect(510, 660, 120, 15);\n g.drawString(player.exp + \"/\" + player.lv*100, 520, 675);\n\n HealthPointBar hpBar = player.hpBar;\n int width = (int) (hpBar.getHp() * 120 / player.KNIGHT_HP);\n int widthMp = (int) (hpBar.getMp() * 120 / player.KNIGHT_MP);\n g.setColor(Color.RED);\n g.fillRect(510, 685, 120, 15);\n g.setColor(Color.GREEN);\n g.fillRect(510, 685, width, 15);\n g.setColor(Color.WHITE);\n g.fillRect(510, 705, 120, 15);\n g.setColor(Color.BLUE);\n g.fillRect(510, 705, widthMp, 15);\n g.setColor(Color.black);\n g.drawRect(510, 685, 120, 15);\n g.drawRect(510, 705, 120, 15);\n g.setFont(new Font(\"TimesRoman\", Font.PLAIN, 16));\n g.setColor(Color.black);\n g.drawString(\"HP \", 480, 700);\n g.drawString(\"MP \", 480, 720);\n g.drawString(hpBar.getHp() + \"/\" + player.KNIGHT_HP, 520, 700);\n g.drawString(hpBar.getMp() + \"/\" + player.KNIGHT_MP, 520, 720);\n\n\n //boss\n if(bossAppear && !bossDies) {\n g.setColor(Color.pink);\n g.fillRect(350, 0, 300, 80);\n g.setColor(Color.black);\n g.drawRect(350, 0, 300, 80);\n Image bo;\n try {\n bo = ImageIO.read(new File(\"assets/others/boss.png\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(bo, 560, -5, null);\n g.setColor(Color.black);\n\n g.setFont(new Font(\"TimesRoman\", Font.PLAIN, 16));\n hpBar = boss.hpBar;\n width = (int) (hpBar.getHp() * 150 / boss.HP);\n g.setColor(Color.RED);\n g.fillRect(420, 35, 150, 15);\n g.setColor(Color.GREEN);\n g.fillRect(420, 35, width, 15);\n g.setColor(Color.black);\n g.drawRect(420, 35, 150, 15);\n g.setFont(new Font(\"TimesRoman\", Font.PLAIN, 16));\n g.setColor(Color.black);\n g.drawString(\"HP \", 380, 50);\n g.drawString(hpBar.getHp() + \"/\" + boss.HP, 425, 50);\n\n }\n\n if(player.levelUping > 0) {\n player.levelUping--;\n Image lvup;\n try {\n lvup = ImageIO.read(new File(\"assets/lvup/\" + player.lv + \".png\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(lvup, 290, 80, null);\n }\n\n g.setFont(new Font(\"TimesRoman\", Font.BOLD, 16));\n g.setColor(Color.gray);\n if(player.lv >= 1) {\n Image skillu;\n try {\n skillu = ImageIO.read(new File(\"assets/skillicon/skillu.jpg\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(skillu, 0, 680, null);\n g.drawString(\"u\", 20, 675);\n }\n if(player.lv >= 2) {\n Image twoStepJump;\n try {\n twoStepJump = ImageIO.read(new File(\"assets/skillicon/2stepjump.jpg\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(twoStepJump, 50, 680, null);\n g.drawString(\"space\", 50, 675);\n }\n if(player.lv >= 3) {\n Image skilli;\n try {\n skilli = ImageIO.read(new File(\"assets/skillicon/skilli.jpg\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(skilli, 100, 680, null);\n g.drawString(\"i\", 120, 675);\n }\n if(player.lv >= 4) {\n Image skillo;\n try {\n skillo = ImageIO.read(new File(\"assets/skillicon/heal.png\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(skillo, 150, 680, null);\n g.drawString(\"o\", 170, 675);\n }\n\n int hp = player.hpPotionCount, mp = player.mpPotionCount, ring = player.ringCount;\n g.setColor(Color.yellow);\n g.fillRect(860, 680, 150, 50);\n g.setColor(Color.black);\n g.drawRect(860, 680, 50, 50);\n g.drawRect(910, 680, 50, 50);\n g.drawRect(960, 680, 50, 50);\n\n g.setFont(new Font(\"TimesRoman\", Font.BOLD, 16));\n g.setColor(Color.black);\n Image im;\n try {\n im = ImageIO.read(new File(\"assets/dropitem/33.png\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(im, 860, 680, null);\n g.setColor(Color.gray);\n g.drawString(\"1\", 895, 695);\n g.setColor(Color.black);\n g.drawString(\"\" + hp, 895, 730);\n\n try {\n im = ImageIO.read(new File(\"assets/dropitem/22.png\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(im, 910, 680, null);\n g.setColor(Color.gray);\n g.drawString(\"2\", 945, 695);\n g.setColor(Color.black);\n g.drawString(\"\" + mp, 945, 730);\n\n try {\n im = ImageIO.read(new File(\"assets/dropitem/11.png\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n g.drawImage(im, 960, 680, null);\n g.setColor(Color.gray);\n g.drawString(\"3\", 995, 695);\n g.setColor(Color.black);\n g.drawString(\"\" + ring, 995, 730);\n }", "public void flyingFeature() { // method implemented\n\t\tSystem.out.println(\"Flying feature of flying car\");\n\t}", "public void updateFruit() {\n\t\t\n\t\tint foodX = 0, foodY = 0; // foodX, foodY - coordinates for normal fruit, with s for super\n\t\tint []place; // place on board, will hold X and Y\n\n\t\tif(fruits.size() <= 0) { // if there's no fruit\n\n\t\t\tplace = placeFruit();\n\t\t\tfoodX = place[0];\n\t\t\tfoodY = place[1];\n\n\t\t\taddFruit(foodX, foodY);\n\t\t}\n\t}", "Fish findFish(){\r\n\t\t//step through GameCollection using iterator to find first instance of a fish\r\n\t\tIterator iterator = gc.getIterator();\r\n\t\twhile(iterator.hasNext()){\r\n\t\t\tGameObject g = iterator.getNext();\r\n\t\t\tif (g instanceof Fish)return (Fish)g;\r\n\t\t}\r\n\treturn nullFish;\r\n\t}" ]
[ "0.6042808", "0.5983264", "0.57832086", "0.566268", "0.56612754", "0.5589112", "0.5536637", "0.5502327", "0.5498041", "0.54937357", "0.54794866", "0.54565936", "0.54392534", "0.5409706", "0.5388489", "0.53830945", "0.5370405", "0.53378433", "0.5334281", "0.53305924", "0.53295386", "0.530442", "0.5300575", "0.5287367", "0.5276213", "0.5275117", "0.5274805", "0.52741206", "0.5244789", "0.5238621", "0.52239484", "0.5213368", "0.5208114", "0.51978534", "0.519069", "0.51758516", "0.51689285", "0.5168377", "0.51676774", "0.5164978", "0.5153743", "0.5148991", "0.51467425", "0.5143692", "0.5130477", "0.51166564", "0.5112037", "0.5105457", "0.50955784", "0.5092726", "0.5089348", "0.5086076", "0.50855505", "0.508538", "0.5082548", "0.5074897", "0.506806", "0.50671077", "0.5065655", "0.5062099", "0.5060833", "0.5046754", "0.5045251", "0.50451267", "0.50439584", "0.5043453", "0.50431204", "0.5028808", "0.5028581", "0.50283873", "0.50194776", "0.50175285", "0.5016238", "0.5015979", "0.5010889", "0.5009732", "0.50081897", "0.5002071", "0.50004554", "0.49975193", "0.49908808", "0.49904734", "0.49877867", "0.49820873", "0.49810627", "0.49728608", "0.49709156", "0.49679488", "0.4966876", "0.49666208", "0.49652857", "0.4964539", "0.49533257", "0.494807", "0.4943934", "0.4942459", "0.4940251", "0.4938144", "0.4930392", "0.49293512" ]
0.6228327
0
TODO implement logic with ID
@Override public long getItemId(int position) { return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Integer getId() { return this.id; }", "protected abstract String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "private int getId() {\r\n\t\treturn id;\r\n\t}", "@Override public String getID() { return id;}", "java.lang.String getID();", "public int getId() {return id;}", "public void setID(String idIn) {this.id = idIn;}", "Object getId();", "public int id() {return id;}", "public int getId(){ return id; }", "public abstract String getId();", "public abstract String getId();", "public abstract String getId();", "public abstract String getId();", "public abstract String getId();", "public abstract String getId();", "public int getId() {return Id;}", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();" ]
[ "0.6911468", "0.6905102", "0.6842361", "0.6842361", "0.6842361", "0.6842361", "0.6842361", "0.6842361", "0.6842361", "0.6842361", "0.6842361", "0.6842361", "0.6842361", "0.6842361", "0.6842361", "0.6842361", "0.6842361", "0.6842361", "0.6842361", "0.6842361", "0.6842361", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68279743", "0.68210477", "0.68210477", "0.68210477", "0.68210477", "0.68210477", "0.68210477", "0.67774725", "0.6769681", "0.6742965", "0.6718868", "0.6703256", "0.6671863", "0.6669357", "0.6659799", "0.6621367", "0.6621367", "0.6621367", "0.6621367", "0.6621367", "0.6621367", "0.6585675", "0.65845263", "0.65845263", "0.65845263", "0.65845263", "0.65845263", "0.65845263", "0.65845263", "0.65845263", "0.65845263", "0.65845263", "0.65845263", "0.65845263", "0.65845263", "0.65845263", "0.65845263", "0.65845263" ]
0.0
-1
/ sendVerificationBtn.setVisibility(View.INVISIBLE); inputPhoneNumEt.setVisibility(View.INVISIBLE); verifyBtn.setVisibility(View.VISIBLE); inputCodeEt.setVisibility(View.VISIBLE);
@Override public void onClick(View view) { String numberPhone = inputPhoneNumEt.getText().toString(); if(TextUtils.isEmpty(numberPhone)){ showToastMessage("phone number required!"); }else{ //loading bar put here ///... // [START start_phone_auth] PhoneAuthProvider.getInstance().verifyPhoneNumber( numberPhone, // Phone number to verify 60, // Timeout duration TimeUnit.SECONDS, // Unit of timeout PhoneLoginActivity.this, // Activity (for callback binding) mCallbacks); // OnVerificationStateChangedCallbacks // [END start_phone_auth] } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void onClick(View v) {\n\t\ttxt1.setVisibility(View.GONE);\r\n\t txt2.setVisibility(View.GONE);\r\n\t txt3.setVisibility(View.GONE);\r\n\t txt4.setVisibility(View.GONE);\r\n\t txt5.setVisibility(View.GONE);\r\n\t txt6.setVisibility(View.GONE);\r\n\t /* txt7.setVisibility(View.GONE);\r\n\t txt8.setVisibility(View.GONE);*/\r\n\t txt9.setVisibility(View.GONE);\r\n\t txt10.setVisibility(View.GONE);\r\n\t \r\n\t img2.setVisibility(View.VISIBLE);\r\n\t img3.setVisibility(View.VISIBLE);\r\n\t img4.setVisibility(View.VISIBLE);\r\n\t \r\n\t btn2.setVisibility(View.VISIBLE);\r\n\t btn3.setVisibility(View.VISIBLE);\r\n\t btn4.setVisibility(View.VISIBLE);\r\n\t back.setVisibility(View.GONE);\r\n\t scr.setVisibility(View.GONE);\r\n\t myBrowser.setVisibility(View.GONE);\r\n\t scr.setVisibility(View.GONE);\r\n\t \r\n\t \r\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t\r\n\t\t\t\ttxt1.setVisibility(View.VISIBLE);\r\n\t\t\t txt2.setVisibility(View.VISIBLE);\r\n\t\t\t txt3.setVisibility(View.VISIBLE);\r\n\t\t\t txt4.setVisibility(View.VISIBLE);\r\n\t\t\t txt5.setVisibility(View.VISIBLE);\r\n\t\t\t txt9.setVisibility(View.VISIBLE);\r\n\t\t\t txt10.setVisibility(View.VISIBLE);\r\n\t\t\t \r\n\t\t\t img2.setVisibility(View.GONE);\r\n\t\t\t img3.setVisibility(View.GONE);\r\n\t\t\t img4.setVisibility(View.GONE);\r\n\t\t\t \r\n\t\t\t btn2.setVisibility(View.GONE);\r\n\t\t\t btn3.setVisibility(View.GONE);\r\n\t\t\t btn4.setVisibility(View.GONE);\r\n\t\t\t back.setVisibility(View.VISIBLE);\r\n\t\t\t \r\n\t\t\t txt6.setVisibility(View.GONE);\r\n\t\t\t myBrowser.setVisibility(View.GONE);\r\n\t\t\t //txt7.setVisibility(View.GONE);\r\n\t\t\t // txt8.setVisibility(View.GONE);\r\n\t\t\t scr.setVisibility(View.GONE);\r\n\r\n\t\t\t}", "private void hideEmail() {\n\t\tButton emailButton = (Button) findViewById(R.id.b_recipeEmail);\n\t\temailButton.setVisibility(4);\n\t}", "@Override\n public void onClick(View v) {\n BSelectImage.setVisibility(View.INVISIBLE);\n BCaptureImage.setVisibility(View.INVISIBLE);\n IVPreviewImage.setVisibility(View.INVISIBLE);\n Rotate.setVisibility(View.INVISIBLE);\n Process.setVisibility(View.INVISIBLE);\n\n cameraKitView.setVisibility(View.VISIBLE);\n cameraBtn.setVisibility(View.VISIBLE);\n\n\n\n }", "public void resetRegisterFieldBlockVisibility(){\n registerPersonalInfoBlock.setVisibility(View.GONE);\n registerAddressBlock.setVisibility(View.GONE);\n registerContactBlock.setVisibility(View.GONE);\n }", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tbtnEnquiry.setVisibility(View.VISIBLE);\n\t\t\t\t\tlinearLayoutEnquiry.setVisibility(View.GONE);\n\t\t\t\t\t\n\t\t\t\t}", "private void initializeViews(){\n\n\n if(callType){\n accept_call_btn.setVisibility(ImageButton.VISIBLE);\n deny_call_btn.setVisibility(ImageButton.VISIBLE);\n\n }\n else{\n accept_call_btn.setVisibility(ImageButton.GONE);\n deny_call_btn.setVisibility(ImageButton.VISIBLE);\n caller_name.setText(sipNameOutcome);\n }\n\n }", "public void onRadioButtonClick(View v){\n if (internalBtn.isChecked()){\n field1.setVisibility(View.VISIBLE);\n field2.setVisibility(View.VISIBLE);\n field3.setVisibility(View.GONE);\n }\n else if (externalBtn.isChecked()){\n field1.setVisibility(View.GONE);\n field2.setVisibility(View.VISIBLE);\n field3.setVisibility(View.VISIBLE);\n }\n else if (depositBtn.isChecked()){\n field1.setVisibility(View.VISIBLE);\n field2.setVisibility(View.GONE);\n field3.setVisibility(View.GONE);\n }\n }", "@Override\n public void run() {\n mButton_Buy_Ticket.setVisibility(View.VISIBLE);\n ln_view_number.setVisibility(View.VISIBLE);\n }", "@Override\n public void run() {\n mButton_Buy_Ticket.setVisibility(View.VISIBLE);\n ln_view_number.setVisibility(View.VISIBLE);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tbtnEnquiry.setVisibility(View.GONE);\n\t\t\t\tlinearLayoutEnquiry.setVisibility(View.VISIBLE);\n\t\t\t\t\n\t\t\t}", "private void setButtonVisibilities(){\n\n if(eventType.equals(EventType.ORGANISE)){\n btnUpdateOrSignIn.setVisibility(View.VISIBLE);\n btnUpdateOrSignIn.setText(R.string.update);\n }\n else if(timeType.equals(TimeType.ONGOING) && eventType.equals(EventType.ATTEND)){\n btnUpdateOrSignIn.setVisibility(View.VISIBLE);\n btnUpdateOrSignIn.setText(R.string.sign_in);\n }\n else{\n btnUpdateOrSignIn.setVisibility(View.GONE);\n }\n }", "@Override\r\n\tpublic void onClick(View v) {\n\t\ttxt1.setVisibility(View.GONE);\r\n\t txt2.setVisibility(View.GONE);\r\n\t txt3.setVisibility(View.GONE);\r\n\t txt4.setVisibility(View.GONE);\r\n\t txt5.setVisibility(View.GONE);\r\n\t txt9.setVisibility(View.GONE);\r\n\t txt10.setVisibility(View.GONE);\r\n\t \r\n\t img2.setVisibility(View.GONE);\r\n\t img3.setVisibility(View.GONE);\r\n\t img4.setVisibility(View.GONE);\r\n\t \r\n\t btn2.setVisibility(View.GONE);\r\n\t btn3.setVisibility(View.GONE);\r\n\t btn4.setVisibility(View.GONE);\r\n\t back.setVisibility(View.GONE);\r\n\t \r\n\t txt6.setVisibility(View.VISIBLE);\r\n\t l1.setVisibility(View.VISIBLE);\r\n\t // txt7.setVisibility(View.VISIBLE);\r\n\t // txt8.setVisibility(View.VISIBLE);\r\n\t myBrowser.setVisibility(View.VISIBLE);\r\n\t scr.setVisibility(View.VISIBLE);\r\n\t \r\n\t myBrowser.loadUrl(\"file:///android_asset/rules.html\");\r\n\r\n\t}", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(checkPhoneNum()){\r\n\t\t\t\t\tet_phone.setVisibility(View.GONE);\r\n\t\t\t\t\tly_two.setVisibility(View.VISIBLE);\r\n\t\t\t\t\tbt_next.setVisibility(View.GONE);\r\n\t\t\t\t\tbt_login.setVisibility(View.VISIBLE);\r\n\t\t\t\t\tsetTextSend();\r\n\t\t\t\t\tsendSmsNew(phoneNum);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tToast.makeText(mContext, \"请输入正确的手机号\", Toast.LENGTH_LONG).show();\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n public void initView() {\n etNo = (EditText) findViewById(R.id.etStudentNo);\n// etPassword = (EditText) findViewById(R.id.etPassword);\n tvNoErrorPrmpt = (TextView) findViewById(R.id.tvStuNoErrorPrmpt);\n// tvPasswordErrorPrmpt = (TextView) findViewById(R.id.tvPasswordErrorPrmpt);\n// ivPasswordVisiable = (ImageView)findViewById(R.id.ivPasswordVisiable);\n// tvForgotPassword = (TextView)findViewById(R.id.tvForgotPassword);\n ivDeleteNo = (ImageView)findViewById(R.id.ivDeleteNo);\n btConfirm = (Button) findViewById(R.id.btGetVerificationCode);\n\n// ivPasswordDelete = (ImageView)findViewById(R.id.ivPasswordDelete);\n// tvForgotPassword.setOnClickListener(this);\n findViewById(R.id.ibClose).setOnClickListener(this);\n findViewById(R.id.ivDeleteNo).setOnClickListener(this);\n// findViewById(R.id.ivPasswordDelete).setOnClickListener(this);\n// findViewById(R.id.tvForgotPassword).setOnClickListener(this);\n// findViewById(R.id.ivPasswordVisiable).setOnClickListener(this);\n// btLogin.setOnClickListener(this);\n\n etNo.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {\n\n }\n\n @Override\n public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {\n\n }\n\n @Override\n public void afterTextChanged(Editable editable) {\n if(editable.toString().length()>0){\n ivDeleteNo.setVisibility(View.VISIBLE);\n }else{\n ivDeleteNo.setVisibility(View.GONE);\n }\n }\n });\n\n// etPassword.addTextChangedListener(new TextWatcher() {\n// @Override\n// public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {\n//\n// }\n//\n// @Override\n// public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {\n//\n// }\n//\n// @Override\n// public void afterTextChanged(Editable editable) {\n// if(editable.toString().length()>0){\n// ivPasswordDelete.setVisibility(View.VISIBLE);\n// }else{\n// ivPasswordDelete.setVisibility(View.GONE);\n// }\n// }\n// });\n }", "private void setViews4Display() {\n nameView.setFocusable(false);\n nameView.setClickable(false);\n nameView.setInputType(InputType.TYPE_NULL);\n\n ageView.setFocusable(false);\n ageView.setClickable(false);\n ageView.setInputType(InputType.TYPE_NULL);\n\n phoneView.setFocusable(false);\n phoneView.setClickable(false);\n phoneView.setInputType(InputType.TYPE_NULL);\n\n workView.setFocusable(false);\n workView.setClickable(false);\n workView.setInputType(InputType.TYPE_NULL);\n\n emailView.setFocusable(false);\n emailView.setClickable(false);\n emailView.setInputType(InputType.TYPE_NULL);\n\n save.setVisibility(View.GONE);\n\n if (nameView.getText().toString().equals(\"\"))\n nameView.setVisibility(View.GONE);\n if (ageView.getText().toString().equals(\"\"))\n ageView.setVisibility(View.GONE);\n if (emailView.getText().toString().equals(\"\"))\n emailView.setVisibility(View.GONE);\n if (workView.getText().toString().equals(\"\"))\n workView.setVisibility(View.GONE);\n if (phoneView.getText().toString().equals(\"\"))\n phoneView.setVisibility(View.GONE);\n\n // check if user have past activities\n int childCount = past_activities.getChildCount();\n if (childCount == 1)\n past_activities.setVisibility(View.GONE);\n }", "private void hideElements(){\n question.setVisibility(View.GONE);\n yes_for_joke.setVisibility(View.GONE);\n no_for_joke.setVisibility(View.GONE);\n progressBar.setVisibility(View.VISIBLE);\n }", "private void showIndicator() {\n mProgressBarHolder.setVisibility(View.VISIBLE);\n mEmailView.setFocusableInTouchMode(false);\n mEmailView.setFocusable(false);\n mEmailView.setEnabled(false);\n mPasswordView.setFocusableInTouchMode(false);\n mPasswordView.setFocusable(false);\n mPasswordView.setEnabled(false);\n mRegister.setEnabled(false);\n mEmailSignInButton.setEnabled(false);\n }", "private void hideLoginScreen()\n {\n logIngEditText.setVisibility(View.INVISIBLE);\n passwordEditText.setVisibility(View.INVISIBLE);\n loginButton.setVisibility(View.INVISIBLE);\n textViewLabel.setVisibility(View.INVISIBLE);\n }", "public void onClick(View view){\n\n if(view.getId() == R.id.LoginTextView) {\n\n Button signUpButton = (Button) findViewById(R.id.signUp);\n\n if(signUpCheck) {\n\n signUpCheck = false;\n signUpButton.setText(\"Log In\");\n LoginTextView.setText(\"Don't have an account?\");\n title.setText(\"Log In\");\n email.setVisibility(view.GONE);\n }\n else{\n\n signUpCheck = true;\n signUpButton.setText(\"Sign Up\");\n LoginTextView.setText(\"Already have an account?\");\n title.setText(\"Sign Up\");\n email.setVisibility(view.VISIBLE);\n\n }\n }\n else if(view.getId() == R.id.background || view.getId() == R.id.toolbar) {\n\n InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);\n inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);\n\n }\n\n }", "public void HideValidation() {\n try {\n rl_validation.setVisibility(View.GONE);\n } catch (Exception e) {\n e.printStackTrace();\n appsingleton.ToastMessage(\"\" + e.getMessage());\n }\n }", "@Override\n public void onClick(View v) {\n Log.d(\"prof\",\"edit\");\n editDetails();\n// btn_prof_save.setVisibility(View.VISIBLE);\n// btn_prof_edit.setVisibility(View.INVISIBLE);\n }", "private void showHideButtons() {\n mBinding.ibPrev.setVisibility(vm.shouldShowPrevBtn() ? View.VISIBLE : View.INVISIBLE);\n mBinding.ibNext.setVisibility(vm.shouldShowNextBtn() ? View.VISIBLE : View.INVISIBLE);\n }", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tshuaxin.setVisibility(8);\r\n\t\t\t}", "private void checkButtonVisibility() {\n\n if (leftBlockIndex > 0) {\n buttonLeft.setVisibility(View.VISIBLE);\n } else {\n buttonLeft.setVisibility(View.INVISIBLE);\n }\n\n if (leftBlockIndex < blockCount - 2) {\n buttonRight.setVisibility(View.VISIBLE);\n } else {\n buttonRight.setVisibility(View.INVISIBLE);\n }\n\n }", "@Override\n public void onClick(View v) {\n if(!applicationWithdrawalFragment.financialCardCheck) {\n holder.radioButton.setVisibility(View.GONE);\n if (holder.ll_card_detail_view.getVisibility() != View.VISIBLE)\n holder.ll_card_detail_view.setVisibility(View.VISIBLE);\n else\n holder.ll_card_detail_view.setVisibility(View.GONE);\n }\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(phoneet.getText().toString().length()==11){\r\n\t\t\t\t\tphonell.setVisibility(View.GONE);\r\n\t\t\t\t\tyanzhengmall.setVisibility(View.VISIBLE);\r\n\t\t\t\t\tphonetv.setTextColor(getResources().getColor(R.color.bg_Black));\r\n\t\t\t\t\tyanzhengmatv.setTextColor(getResources().getColor(R.color.top_background));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tToastUtil.showToast(RegisterActivity.this, \"手机号格式不正确\");\r\n\t\t\t\t}\r\n\t\t\t}", "private void setVisibleView(SignInView currentView){\n switch(currentView){\n case SIGN_IN:\n mLoadingBar.setVisibility(View.GONE);\n mSignInButton.setVisibility(View.VISIBLE);\n break;\n\n case LOADING:\n mSignInButton.setVisibility(View.GONE);\n mLoadingBar.setVisibility(View.VISIBLE);\n break;\n }\n }", "@Override\n public void onClick(View view) {\n if(username.length()>15 || username.length()<=4){\n username.setError(\"Please enter a username between 5-15 characters\");\n }\n //When username is accepted the name is set to the Badge button and capitalized properly\n else if(username.length()>=5 || username.length()<=15){\n stringUsername=username.getText().toString();\n String str = stringUsername;\n String cap = str.substring(0,1).toUpperCase()+str.substring(1);\n ((Button) findViewById(R.id.btnYourBadges)).setText(cap+\"'s Earned Badge\");\n\n\n }\n //Password validation incorrect\n if(password.length()<=4){\n password.setError(\"Please enter a password between 5-15 characters\");\n }\n else if(password.length()>=5 || password.length()<=15){\n stringPassword=password.getText().toString();\n //When password is accepted the login disappears\n findViewById(R.id.txtViewUserName).setVisibility(view.GONE);\n findViewById(R.id.txtViewPassword).setVisibility(view.GONE);\n findViewById(R.id.editTxtUserName).setVisibility(view.GONE);\n findViewById(R.id.editTxtPassword).setVisibility(view.GONE);\n findViewById(R.id.btnSubmit).setVisibility(view.GONE);\n\n findViewById(R.id.txtViewHelp).setVisibility(view.VISIBLE);\n findViewById(R.id.imageView).setVisibility(view.VISIBLE);\n\n findViewById(R.id.btnYourBadges).setEnabled(true);\n findViewById(R.id.btnAvailableBdg).setEnabled(true);\n }\n }", "private void showNothing(){\n errorTextView.setVisibility(View.INVISIBLE);\n errorButton.setVisibility(View.INVISIBLE);\n errorButton.setEnabled(false);\n recyclerView.setVisibility(View.INVISIBLE);\n progressBar.setVisibility(View.INVISIBLE);\n noFavoriteMoviesTextView.setVisibility(View.INVISIBLE);\n }", "@Override\n protected void updateConnectButtonState() {\n boolean connected = getPlusClient().isConnected();\n\n //mSignOutButtons.setVisibility(connected ? View.VISIBLE : View.GONE);\n //mPlusSignInButton.setVisibility(connected ? View.GONE : View.VISIBLE);\n //mEmailLoginFormView.setVisibility(connected ? View.GONE : View.VISIBLE);\n }", "private void hideOrShowSomeViews() {\n if (mIsWithMultimediaMethod) {\n mBtnMedia.setVisibility(View.VISIBLE);\n mBtnEmotion.setVisibility(View.VISIBLE);\n } else {\n mBtnMedia.setVisibility(View.GONE);\n mBtnEmotion.setVisibility(View.GONE);\n }\n\n // 重新 inflate 面板,并设置点击事件\n layoutMediaWrapper.removeAllViews();\n if (mIsWithCallMethod) {\n LayoutInflater.from(mContext).inflate(R.layout.msg_message_composer_inputmedia,\n layoutMediaWrapper, true);\n } else {\n LayoutInflater.from(mContext).inflate(R.layout.msg_message_composer_inputmedia_without_call,\n layoutMediaWrapper, true);\n }\n setupMediaInputButtonsClickEventHandler();\n }", "private void makeButtonVisible() {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n btnDetectObject.setVisibility(View.VISIBLE);\n }\n });\n }", "@Override\n\t\tpublic void onClick(View v) {\n\t\t\ttextView.setVisibility(View.GONE);\n\t\t\tbar.setVisibility(View.GONE);\n\t\t\tlookButton.setVisibility(View.GONE);\n\t\t\texitButton.setVisibility(View.GONE);\n\n\t\t\tmyImageView.setVisibility(View.VISIBLE);\n\t\t\tmyImageView2.setVisibility(View.VISIBLE);\n\t\t\tmyImageView3.setVisibility(View.VISIBLE);\n\t\t\tmyImageView4.setVisibility(View.VISIBLE);\n\t\t}", "@Override\r\n public void onClick(View v) {\n mPhotoImage.setVisibility(View.GONE);\r\n mCameraButton.setVisibility(View.VISIBLE);\r\n mGallaryButton.setVisibility(View.VISIBLE);\r\n mCameraButton.setEnabled(true);\r\n mGallaryButton.setEnabled(true);\r\n mConfirmButton.setEnabled(false);\r\n mPhotoframeText.setText(R.string.upload_photo_label);\r\n }", "@OnClick({R.id.ed_phone, R.id.agin_verification_code, R.id.confirm_btn})\n public void onViewClicked(View view) {\n switch (view.getId()) {\n case R.id.ed_phone:\n edPhone.setCursorVisible(true);//光标显示\n break;\n case R.id.agin_verification_code:\n if (ObjectUtils.isEmpty(phone)) {\n ToastUtils.showLongToast(context, getResources().getString(R.string.the_cell_phone_number_cannot_be_empty));\n return;\n }\n// if (!RegexUtils.isMobileExact(phone)) {\n// ToastUtils.showLongToast(context, getResources().getString(R.string.please_input_the_correct_mobile_phone_number));\n// return;\n// }\n mPresent.getCode(context, phone);// 1 綁定手机号\n break;\n case R.id.confirm_btn:\n String newDealPwd = edConfirmNewPwd.getText().toString().toString().trim();\n String code = edVerificationCode.getText().toString().trim();\n if (ObjectUtils.isEmpty(code)) {\n ToastUtils.showLongToast(context, getResources().getString(R.string.the_verification_code_cannot_be_empty));\n return;\n }\n if (ObjectUtils.isEmpty(newDealPwd)) {\n ToastUtils.showLongToast(context, getResources().getString(R.string.please_enter_your_new_deal_password));\n return;\n }\n if(newDealPwd.length()<6){\n ToastUtils.showShortToast(context,getResources().getString(R.string.please_enter_six_digit_trading_password));\n return;\n }\n\n showLoadingDialog();\n mPresent.modifyPwd(context, \"2\", \"\", code, newDealPwd);\n break;\n }\n }", "private void showElements(){\n question.setVisibility(View.VISIBLE);\n yes_for_joke.setVisibility(View.VISIBLE);\n no_for_joke.setVisibility(View.VISIBLE);\n progressBar.setVisibility(View.GONE);\n }", "private void m50375a(TextView textView) {\n textView.setVisibility(8);\n }", "@Override\n protected void onPreExecute() {\n pb.setVisibility(View.VISIBLE);\n }", "@Override\n public void onClick(View v) {\n if(textViewDescription.getVisibility() != View.VISIBLE && textViewDescription.getText().toString() != null){\n\n textViewDescription.setVisibility(View.VISIBLE);\n barreHorizontale.setVisibility(View.VISIBLE);\n }else{\n barreHorizontale.setVisibility(View.GONE);\n textViewDescription.setVisibility(View.GONE);\n }\n\n }", "@Override\n public void onClick(View v) {\n if (v == ButtonCar1){\n if(red_line.isVisible()){\n red_line.setVisible(false);\n }\n if(yellow_line.isVisible()){\n yellow_line.setVisible(false);\n }\n else{\n yellow_line.setVisible(true);\n }\n }\n\n if( v == ButtonCar2) {\n if(yellow_line.isVisible()){\n yellow_line.setVisible(false);\n }\n if(red_line.isVisible()){\n red_line.setVisible(false);\n }\n else{\n red_line.setVisible(true);\n }\n }\n\n\n }", "private void showLoginScreen()\n {\n logIngEditText.setVisibility(View.VISIBLE);\n passwordEditText.setVisibility(View.VISIBLE);\n loginButton.setVisibility(View.VISIBLE);\n textViewLabel.setVisibility(View.VISIBLE);\n }", "@Override\n\t\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\t\t\tebar.setVisibility(View.VISIBLE);\n\t\t\t\t\t\t\t\t\t\t\t\t\tesend.setVisibility(View.GONE);\n\t\t\t\t\t\t\t\t\t\t\t\t\tetopic.setEnabled(false);\n\t\t\t\t\t\t\t\t\t\t\t\t\tetext.setEnabled(false);\n\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\n\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}", "private void hideMe() {\n\t\tthis.setVisible(false);\n\t\ttxtName.setText(\"\");\n\t\ttxtEmail.setText(\"\");\n\t\ttxtPhone.setText(\"\");\n\t}", "public void checkoutSuccessFragment() {\n\n cardNameInput.setVisibility(View.INVISIBLE);\n cardNumberInput.setVisibility(View.INVISIBLE);\n cvvInput.setVisibility(View.INVISIBLE);\n expiryInput.setVisibility(View.INVISIBLE);\n checkoutButton.setVisibility(View.INVISIBLE);\n checkoutSuccessLabel.setVisibility(View.VISIBLE);\n goBackButton.setVisibility(View.VISIBLE);\n\n }", "public void gamereset() {\n Button tmp = (Button) findViewById(R.id.resetbutton);\n tmp.setVisibility(View.VISIBLE);\n }", "public void updateVoiceButtonState() {\n if (!this.mVoiceButtonEnabled || !TextUtils.isEmpty(this.mEditText.getText().toString())) {\n this.mVoiceButton.setVisibility(8);\n } else {\n this.mVoiceButton.setVisibility(0);\n }\n }", "private void setSignOutButton() {\n findViewById(R.id.sign_out_button).setOnClickListener(this);\n findViewById(R.id.sign_in_button).setVisibility(View.GONE);\n findViewById(R.id.sign_out_button).setVisibility(View.VISIBLE);\n }", "public void mo3388b(View view) {\n C0661j3.this.f2802a.setVisibility(0);\n }", "private void setTVnotication()\n {\n if(countnoti == 0)\n {\n tv_none_notification.setVisibility(View.VISIBLE);\n }\n else\n if(countnoti > 0)\n {\n tv_none_notification.setVisibility(View.GONE);\n }\n }", "private void hideSave() {\n\t\tButton saveButton = (Button) findViewById(R.id.b_recipeSave);\n\t\tsaveButton.setVisibility(4);\n\t}", "private void setVisibility( int answer_visibility )\n {\n int yes_no_visibility = View.VISIBLE;\n\n if ( answer_visibility == View.VISIBLE )\n {\n yes_no_visibility = View.INVISIBLE;\n }\n\n TextView question = (TextView) findViewById( R.id.question );\n question.setVisibility( yes_no_visibility );\n\n ImageView butterfly_icon = (ImageView) findViewById( R.id.butterfly_icon );\n \n if ( yes_no_visibility == View.VISIBLE )\n {\n ((AnimationDrawable) butterfly_icon.getBackground()).start();\n }\n else\n {\n ((AnimationDrawable) butterfly_icon.getBackground()).stop();\n }\n\n butterfly_icon.setVisibility( yes_no_visibility );\n\n ImageView caterpillar_icon = (ImageView) findViewById( R.id.caterpillar_icon );\n \n if ( yes_no_visibility == View.VISIBLE )\n {\n caterpillar_icon.startAnimation( caterpillar_icon_animation );\n }\n else\n {\n caterpillar_icon_animation.cancel();\n caterpillar_icon.clearAnimation();\n }\n\n caterpillar_icon.setVisibility(yes_no_visibility);\n\n TextView answer = (TextView) findViewById( R.id.answer );\n answer.setVisibility(answer_visibility);\n\n ImageView answer_rectangle = (ImageView) findViewById( R.id.answer_rectangle );\n answer_rectangle.setVisibility(answer_visibility);\n }", "@Override\n public void onClick(View v) {\n \tif (tgl_btn.isChecked()) {\n \t\tlay_feather.setVisibility(View.VISIBLE);\n \t\tlay_nail.setVisibility(View.GONE);\n\t\t\t\t}\n \telse {\n \t\tlay_feather.setVisibility(View.GONE);\n \t\tlay_nail.setVisibility(View.VISIBLE);\n\t\t\t\t}\n }", "public void editSlotVisibilityToggle(View view){\n //get slot and panel\n LinearLayout slot = (LinearLayout) view.getParent();\n LinearLayout editPanel = (LinearLayout) slot.getChildAt(1);\n FloatingActionButton fab = (FloatingActionButton) view;\n //focus on the page\n linearLayoutBody = (LinearLayout) slot.getParent();\n //toggle visibility\n if (editPanel.getVisibility() == View.VISIBLE){\n editPanel.setVisibility(View.INVISIBLE);\n } else if (editPanel.getVisibility() == View.INVISIBLE){\n editPanel.setVisibility(View.VISIBLE);\n }\n }", "public void updateBtnClearSearchView() {\n this.mBtnClearSearchView.setVisibility(this.mEdtSearch.getText().length() > 0 ? 0 : 8);\n }", "@Override\n\t\tpublic void onCheckedChanged(CompoundButton buttonView,\n\t\t\t\tboolean isChecked) {\n\t\t\tif (isChecked) {\n\t\t\t\taddinfobt.setVisibility(View.VISIBLE);\n\t\t\t\tnameinfoinput.setVisibility(View.VISIBLE);\n\t\t\t\tinfolist.setVisibility(View.VISIBLE);\n\t\t\t} else {\n\t\t\t\taddinfobt.setVisibility(View.GONE);\n\t\t\t\tnameinfoinput.setVisibility(View.GONE);\n\t\t\t\tinfolist.setVisibility(View.GONE);\n\t\t\t}\n\t\t}", "private void setupView() {\n\t\tphoneEditView = (EditText) findViewById(R.id.edit_phone);\n\n\t\tconfirmBtn = (ImageView) findViewById(R.id.btnStart);\n\t\tconfirmBtn.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\tboolean isRegularPhoneNumber = phoneEditView.getText()\n\t\t\t\t\t\t.toString().matches(\"[0-9]{10}\");\n\t\t\t\tphoneCheckRes(isRegularPhoneNumber);\n\t\t\t}\n\t\t});\n\t}", "public void setVisibilityWidget()\n {\n if (SettingsSpotifyActivity.getSwitchCineStatus() == 1) {\n CinemaL.setVisibility(View.VISIBLE);\n cinemaStatus = 1;\n } else {\n CinemaL.setVisibility(View.GONE);\n cinemaStatus = 0;\n }\n if (SettingsSpotifyActivity.getSwitchWeatherStatus() == 1) {\n WeatherL.setVisibility(View.VISIBLE);\n weatherStatus = 1;\n } else {\n WeatherL.setVisibility(View.GONE);\n weatherStatus = 0;\n }\n if (SettingsSpotifyActivity.getSwitchfacebookStatus() == 1) {\n FacebookL.setVisibility(View.VISIBLE);\n facebookStatus = 1;\n } else {\n FacebookL.setVisibility(View.GONE);\n facebookStatus = 0;\n }\n if (SettingsSpotifyActivity.getSwitchPaypalStatus() == 1) {\n PaypalL.setVisibility(View.VISIBLE);\n paypalStatus = 1;\n } else {\n PaypalL.setVisibility(View.GONE);\n paypalStatus = 0;\n }\n if (SettingsSpotifyActivity.getSwitchImgurStatus() == 1) {\n ImgurL.setVisibility(View.VISIBLE);\n ImgurStatus = 1;\n } else {\n ImgurL.setVisibility(View.GONE);\n ImgurStatus = 0;\n }\n if (SettingsSpotifyActivity.getSwitchSpotifyStatus() == 1) {\n SpotifyL.setVisibility(View.VISIBLE);\n SpotifyStatus = 1;\n } else {\n SpotifyL.setVisibility(View.GONE);\n SpotifyStatus = 0;\n }\n if (SettingsSpotifyActivity.getSwitchSpotifySUserStatus() == 1) {\n SpotifySUserStatus = 1;\n } else {\n SpotifySUserStatus = 0;\n }\n if (SettingsSpotifyActivity.getSwitchSpotifySMusicStatus() == 1) {\n SpotifySMusicStatus = 1;\n } else {\n SpotifySMusicStatus = 0;\n }\n if (SettingsSpotifyActivity.getSwitchSpotifyPlaylistStatus() == 1) {\n SpotifyPlaylistStatus = 1;\n } else {\n SpotifyPlaylistStatus = 0;\n }\n }", "public void infoProgressOff (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourInfoBinding.tourInfoProgress.getVisibility() != View.GONE) {\n tabTourInfoBinding.tourInfoProgress.setVisibility(View.GONE);\n }\n if (tabTourInfoBinding.tourInfoLayout.getVisibility() != View.VISIBLE) {\n tabTourInfoBinding.tourInfoLayout.setVisibility(View.VISIBLE);\n }\n }\n });\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(details_video_introduce.getVisibility()==View.VISIBLE){\n\t\t\t\t\tdetails_video_introduce.setVisibility(View.GONE);\n\t\t\t\t\tdetails_recommend.setVisibility(View.VISIBLE);\n\t\t\t\t\tdetails_key_arts.setVisibility(View.GONE);\n\t\t\t\t}else{\n\t\t\t\t\tdetails_key_arts.setVisibility(View.GONE);\n\t\t\t\t\tdetails_video_introduce.setVisibility(View.VISIBLE);\n\t\t\t\t\tdetails_recommend.setVisibility(View.GONE);\n\t\t\t\t}\n\t\t\t}", "private void showfivetype() {\n\r\n\t\tbtn_menu1.setText(ticketname[btn_menu1_int]);\r\n\t\tbtn_menu2.setText(ticketname[btn_menu2_int]);\r\n\t\tbtn_menu3.setText(ticketname[btn_menu3_int]);\r\n\t\tbtn_menu4.setText(ticketname[btn_menu4_int]);\r\n\t\tbtn_menu5.setText(ticketname[btn_menu5_int]);\r\n\t\tif (btn_menu1_int == 0) {\r\n\t\t\tbtn_menu1.setVisibility(View.GONE);\r\n\t\t} else {\r\n\t\t\tbtn_menu1.setVisibility(View.VISIBLE);\r\n\t\t}\r\n\t\tif (btn_menu2_int == 0) {\r\n\t\t\tbtn_menu2.setVisibility(View.GONE);\r\n\t\t} else {\r\n\t\t\tbtn_menu2.setVisibility(View.VISIBLE);\r\n\t\t}\r\n\t\tif (btn_menu3_int == 0) {\r\n\t\t\tbtn_menu3.setVisibility(View.GONE);\r\n\t\t} else {\r\n\t\t\tbtn_menu3.setVisibility(View.VISIBLE);\r\n\t\t}\r\n\t\tif (btn_menu4_int == 0) {\r\n\t\t\tbtn_menu4.setVisibility(View.GONE);\r\n\t\t} else {\r\n\t\t\tbtn_menu4.setVisibility(View.VISIBLE);\r\n\t\t}\r\n\t\tif (btn_menu5_int == 0) {\r\n\t\t\tbtn_menu5.setVisibility(View.GONE);\r\n\t\t} else {\r\n\t\t\tbtn_menu5.setVisibility(View.VISIBLE);\r\n\t\t}\r\n\t}", "@Override\n public void onClick(View view) {\n\n View add_funds_btn = findViewById(R.id.not_enough_funds_button);\n add_funds_btn.setVisibility(View.INVISIBLE);\n\n View animatedView = findViewById(R.id.send_donation_button);\n int fromY = findViewById(R.id.send_donation_button).getHeight();\n TranslateAnimation animate = new TranslateAnimation(0,0,fromY,0);\n animate.setDuration(FADE_OUT_DURATION);\n animatedView.startAnimation(animate);\n animatedView.setVisibility(View.VISIBLE);\n }", "@Override\n public void onClick(View v) {\n if (tries.getVisibility() == View.VISIBLE) {\n // do nothing\n\n } else {\n\n boulder_points.setText(R.string.nulll);\n boulder_grade.setText(R.string.nulll);\n boulder_class.setText(R.string.nulll);\n boulder_completed.setText(R.string.nulll);\n boulder_avgTries.setText(R.string.nulll);\n boulder_progress.setText(R.string.nulll);\n completeBoulder.setVisibility(View.INVISIBLE);\n updateTries.setVisibility(View.INVISIBLE);\n updateGrade.setVisibility(View.GONE);\n }\n\n }", "public void loggedIn(){\n Button view = findViewById(R.id.buttonView);\n view.setVisibility(View.VISIBLE);\n Button logout = findViewById(R.id.buttonLogout);\n logout.setVisibility(View.VISIBLE);\n EditText username = findViewById(R.id.username);\n username.setVisibility(View.INVISIBLE);\n EditText pass = findViewById(R.id.password);\n pass.setVisibility(View.INVISIBLE);\n Button login = findViewById(R.id.buttonLogin);\n login.setVisibility(View.INVISIBLE);\n Button createAcc = findViewById(R.id.buttonCreateAccount);\n createAcc.setVisibility(View.INVISIBLE);\n TextView accountName = findViewById(R.id.accountName);\n accountName.setVisibility(View.VISIBLE);\n accountName.setText(user);\n }", "private void showPlayerOptions() {\n playStartLinearLayout.setVisibility(View.INVISIBLE);\n timeInfoLinearLayout.setVisibility(View.INVISIBLE);\n gsOpenPlayImage.setVisibility(View.VISIBLE);\n\n\n }", "@SuppressWarnings(\"ConstantConditions\")\n @Override\n public void setUserVisibleHint(boolean visible) {\n super.setUserVisibleHint(visible);\n if (visible) {\n setUpScreen();\n }\n else {\n try {\n ViewFlipper layout = (ViewFlipper)getView().findViewById(R.id.currency_items);\n layout.removeAllViews();\n TextView viewAmount = (TextView)getView().findViewById(R.id.txtAmount);\n viewAmount.setBackground(null);\n }\n catch (NullPointerException npe) {\n // This happens when this is called before the view is created\n }\n }\n }", "private void checkInputData(){\n if(!TextUtils.isEmpty(email.getText())){\n if(!TextUtils.isEmpty(password.getText())){\n //Below code is only for testing purposes.\n //signInprogressBar.setVisibility(View.VISIBLE);\n mainSignInBtn.setEnabled(true);\n mainSignInBtn.setTextColor(Color.rgb(255,255,255));\n\n }else {\n mainSignInBtn.setEnabled(false);\n mainSignInBtn.setTextColor(Color.argb(50,255,255,255));\n }\n }else {\n mainSignInBtn.setEnabled(false);\n mainSignInBtn.setTextColor(Color.argb(50,255,255,255));\n }\n }", "private void addlisteners() {\n\t\tbtn.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tif(phoneet.getText().toString().length()==11){\r\n\t\t\t\t\tphonell.setVisibility(View.GONE);\r\n\t\t\t\t\tyanzhengmall.setVisibility(View.VISIBLE);\r\n\t\t\t\t\tphonetv.setTextColor(getResources().getColor(R.color.bg_Black));\r\n\t\t\t\t\tyanzhengmatv.setTextColor(getResources().getColor(R.color.top_background));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tToastUtil.showToast(RegisterActivity.this, \"手机号格式不正确\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tbtn1.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\tif(code!=null){\r\n\t\t\t\t\t//String s=code;\r\n\t\t\t\t\t//String sd=codeedittext.getText().toString();\r\n\t\t\t\t\tif(codeedittext.getText().toString().equals(code)){\r\n\t\t\t\t\t\tyanzhengmall.setVisibility(View.GONE);\r\n\t\t\t\t\t\tphonell.setVisibility(View.GONE);\r\n\t\t\t\t\t\tzhucell.setVisibility(View.VISIBLE);\r\n\t\t\t\t\t\tphonetv.setTextColor(getResources().getColor(R.color.bg_Black));\r\n\t\t\t\t\t\tyanzhengmatv.setTextColor(getResources().getColor(R.color.bg_Black));\r\n\t\t\t\t\t\tpasswordtv.setTextColor(getResources().getColor(R.color.top_background));\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tToastUtil.showToast(RegisterActivity.this, \"验证码不正确\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tgetcodebtn.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\tnew GetCodetask().execute(Consts.URL);\r\n\t\t\t\tTimer timer = new Timer(true);\r\n\t\t\t\tTimerTask task = new TimerTask() {\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\tMessage msg = new Message();\r\n\t\t\t\t\t\tmsg.what = 1;\r\n\t\t\t\t\t\thandler.sendMessage(msg);\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\ttimer.schedule(task, 0, 1000);\r\n\t\t\t\tgetcodebtn.setClickable(false);\r\n\t\t\t}\r\n\t\t});\r\n\t\tregisterbtn.setOnClickListener(new OnClickListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tif(passwordet.getText().toString().equals(querenpasswordet.getText().toString())){\r\n\t\t\t\t\tnew SetPassWordTask().execute(Consts.URL);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tToastUtil.showToast(RegisterActivity.this, \"两次输入的密码不同\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tbackimageview.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tRegisterActivity.this.finish();\r\n\t\t\t}\r\n\t\t});\r\n\t}", "@Override\n\t public void onClick(View v) {\n \t\tsmia.setVisibility(View.VISIBLE);\n \t\t kfja.setVisibility(View.INVISIBLE);\n \t\t croa.setVisibility(View.INVISIBLE);\n \t\t dancea.setVisibility(View.INVISIBLE);\n \t\t starters.setVisibility(View.INVISIBLE);\n \t\t diz1.setVisibility(View.INVISIBLE); \n \t\t\t diz2.setVisibility(View.INVISIBLE);\n \t\t\t plaa.setVisibility(View.INVISIBLE);\n \t\t\tstarteres.setVisibility(View.INVISIBLE);\n \t \t\t diz3.setVisibility(View.INVISIBLE); \n \t\t\t diz4.setVisibility(View.INVISIBLE);\n \t\t\ttjza.setVisibility(View.INVISIBLE);\n \t startAnimationsmi();\n \t b = 0 ;\n \t }", "private void handleVisibility(int previousView) {\n switch (previousView) {\n case 1:\n tvFitstreetOrganizedContests.setVisibility(View.GONE);\n break;\n case 2:\n tvFitstreetParticipateContests.setVisibility(View.GONE);\n break;\n case 3:\n tvFitstreetContestsPrizeMoney.setVisibility(View.GONE);\n break;\n }\n }", "public void get_password(View view) {\n forgot_pass_textView.setVisibility(View.VISIBLE);\n submit_btn.setVisibility(View.VISIBLE);\n\n password.setVisibility(View.GONE);\n forgot_pass_textView.setVisibility(View.GONE);\n login_btn.setVisibility(View.GONE);\n }", "@Override\n public void onStart() {\n Log.d(LOG, \"Started in EditProfileActivity\");\n mColorRelativeLayout.setVisibility(View.GONE);\n mCancel.setVisibility(View.GONE);\n mSave.setVisibility(View.GONE);\n mProgresBar.setVisibility(View.VISIBLE);\n }", "private void showPaySuccessCardView() {\r\n runOnUiThread(new Runnable() {\r\n @Override\r\n public void run() {\r\n paySuccessCardView.setVisibility(View.VISIBLE);\r\n }\r\n });\r\n try {\r\n Thread.sleep(1200);\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n runOnUiThread(new Runnable() {\r\n @Override\r\n public void run() {\r\n paySuccessCardView.setVisibility(View.GONE);\r\n }\r\n });\r\n\r\n }", "public void editFieldConfirm(TextView tv, EditText et, Button btn, String field)\n {\n tv.setText(field + et.getText().toString());\n et.setVisibility(View.INVISIBLE);\n et.setText(\"\");\n btn.setVisibility(View.INVISIBLE);\n tv.setVisibility(View.VISIBLE);\n }", "private void hideButtons(View rowView) {\n\t\tImageButton bikeButton = (ImageButton) rowView.findViewById(R.id.truckProfileHubwayButton);\n\t\tImageButton walkButton = (ImageButton) rowView.findViewById(R.id.truckProfileWalkingButton);\n\t\tImageButton subwayButton = (ImageButton) rowView.findViewById(R.id.truckProfileSubwayButton);\n\t\t\n\t\tbikeButton.setFocusable(false);\n\t\tbikeButton.setFocusableInTouchMode(false);\n\t\tbikeButton.setVisibility(View.GONE);\n\t\t\n\t\twalkButton.setFocusable(false);\n\t\twalkButton.setFocusableInTouchMode(false);\n\t\twalkButton.setVisibility(View.GONE);\n\t\t\n\t\tsubwayButton.setFocusable(false);\n\t\tsubwayButton.setFocusableInTouchMode(false);\n\t\tsubwayButton.setVisibility(View.GONE);\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\ttime=30;\n\t\t\t\tverfy_button.setEnabled(false);\n\t\t\t\thandler.postDelayed(runnable, 1000); \n\t\t\t\tinitSDK();\n\t\t\t\tSMSSDK.getVerificationCode(\"86\",textview_phone.getText().toString());\n\t\t\t\t\n\t\t\t}", "public void showStopButton(){\n\t((Button)findViewById(R.id.stopButton)).setVisibility(View.VISIBLE);\n\t((Button)findViewById(R.id.startButton)).setVisibility(View.GONE);\n\t((Button)findViewById(R.id.resetButton)).setVisibility(View.GONE);\n}", "private void hideLoadingAndUpdate() {\n image.setVisibility(View.VISIBLE);\n loadingBar.setVisibility(View.INVISIBLE);\n shareBtn.setVisibility(shareBtnVisibility);\n\n }", "@Override\n public void onClick(View v) {\n recorderButton.post(new Runnable() {\n @Override\n public void run() {\n lyVoice.setVisibility(View.VISIBLE);\n }\n });\n }", "void updateButtons(){\n if (gameBoard[0] != 0){\n buttonGame1.setVisibility(View.INVISIBLE);\n }else {\n buttonGame1.setVisibility(View.VISIBLE);\n }\n if (gameBoard[1] != 0){\n buttonGame2.setVisibility(View.INVISIBLE);\n }else\n {\n buttonGame2.setVisibility(View.VISIBLE);\n }\n\n if (gameBoard[2] != 0){\n buttonGame3.setVisibility(View.INVISIBLE);\n }else {\n buttonGame3.setVisibility(View.VISIBLE);\n }\n\n if (gameBoard[3] != 0){\n buttonGame4.setVisibility(View.INVISIBLE);\n }else{\n buttonGame4.setVisibility(View.VISIBLE);\n }\n\n if (gameBoard[4] != 0){\n buttonGame5.setVisibility(View.INVISIBLE);\n }else{\n buttonGame5.setVisibility(View.VISIBLE);\n }\n\n if (gameBoard[5] != 0){\n buttonGame6.setVisibility(View.INVISIBLE);\n }else{\n buttonGame6.setVisibility(View.VISIBLE);\n }\n\n if (gameBoard[6] != 0){\n buttonGame7.setVisibility(View.INVISIBLE);\n }else{\n buttonGame7.setVisibility(View.VISIBLE);\n }\n\n if (gameBoard[7] != 0){\n buttonGame8.setVisibility(View.INVISIBLE);\n }else{\n buttonGame8.setVisibility(View.VISIBLE);\n }\n if (gameBoard[8] != 0){\n buttonGame9.setVisibility(View.INVISIBLE);\n }else{\n buttonGame9.setVisibility(View.VISIBLE);\n }\n }", "public void m16205g() {\n this.f13125b.f13131e = false;\n if (this.f13199d.getVisibility() == 0) {\n this.f13199d.setVisibility(8);\n this.f13199d.setFocusableInTouchMode(false);\n this.f13199d.setOnKeyListener(null);\n this.f13199d.mo23480c();\n }\n }", "@Override\n\n public void onClick(View v) {\n if (tl.getVisibility() == View.VISIBLE) {\n tl.setVisibility(View.GONE);\n } else {\n tl.setVisibility(View.VISIBLE);\n }\n\n }", "@Override\n public boolean setUiBeforShow() {\n Log.e(\" ##IS_FAV\", isFavourite + \"\");\n\n if(isFavourite) {\n txtAddToFavorite.setTextColor(context.getResources().getColor(R.color.yellow));\n Drawable[] drawables = txtAddToFavorite.getCompoundDrawables();\n Drawable leftDrawable = drawables[0];\n\n leftDrawable.setColorFilter(new PorterDuffColorFilter(context.getResources().getColor(R.color.yellow), PorterDuff.Mode.MULTIPLY));\n txtAddToFavorite.setCompoundDrawables(leftDrawable, null, null, null);\n } else {\n txtAddToFavorite.setTextColor(context.getResources().getColor(R.color.white));\n\n Drawable[] drawables = txtAddToFavorite.getCompoundDrawables();\n Drawable leftDrawable = drawables[0];\n\n leftDrawable.setColorFilter(new PorterDuffColorFilter(context.getResources().getColor(R.color.white), PorterDuff.Mode.MULTIPLY));\n txtAddToFavorite.setCompoundDrawables(leftDrawable, null, null, null);\n }\n\n\n\n imgCancel.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n dismiss();\n }\n });\n\n txtRename.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n _renameClick.onRenameOptionClick(pos, \"\");\n dismiss();\n }\n });\n\n txtAddToFavorite.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n _favoriteClick.onFavoriteOptionClick(pos);\n dismiss();\n }\n });\n\n txtAddToScene.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n _addToSceneClick.onAddToSceneOptionClick(pos);\n dismiss();\n }\n });\n\n txtAddToScheduler.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n _addSchedulerClick.onAddSchedulerOptionClick(pos);\n dismiss();\n }\n });\n\n return true;\n }", "@Override\n public void onPause() {\n super.onPause();\n\n groceryList.setVisibility(View.GONE);\n groceryListHeader.setVisibility(View.GONE);\n addButton.setVisibility(View.GONE);\n }", "@Override\n\tprotected void initView() {\n\t\tsuper.initView();\n\t\t// 不显示暂停原因\n\t\t/*\n\t\t * rsnET.setFocusable(true); rsnTV.setText(\"取消原因:\");\n\t\t */\n\t\trsnET.setVisibility(View.GONE);\n\t\trsnTV.setVisibility(View.GONE);\n\t}", "@Override\r\n\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\t\tPropertyRepairActivity.this.runOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnonemsgtext.setVisibility(View.GONE);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t}", "@Override\r\n\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\t\tPropertyRepairActivity.this.runOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnonemsgtext.setVisibility(View.GONE);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t}", "private void hideMenuScreen()\n {\n logoutButton.setVisibility(textViewLabel.INVISIBLE);\n battleButton.setVisibility(View.INVISIBLE);\n char1.setVisibility(View.INVISIBLE);\n char2.setVisibility(View.INVISIBLE);\n char3.setVisibility(View.INVISIBLE);\n }", "private void hideEditDelete() {\n\t\tButton editButton = (Button) findViewById(R.id.b_recipeEdit);\n\t\tButton deleteButton = (Button) findViewById(R.id.b_recipeDelete);\n\t\teditButton.setVisibility(4);\n\t\tdeleteButton.setVisibility(4);\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(edittext_phone.length()!=11)\n\t\t\t\t{\n\t\t\t\t\tToast.makeText(getBaseContext(), \"手机号码有误!\", Toast.LENGTH_LONG).show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(edittext_pas.length()<1)\n\t\t\t\t{\n\t\t\t\t\tToast.makeText(getBaseContext(), \"请输入密码!\", Toast.LENGTH_LONG).show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tverfy_button.setEnabled(false);\n\t\t\t\ttime=30;\n\t\t\t\trelativeLayoutregist.setVisibility(View.INVISIBLE);\n\t\t\t\trelativeLayouttijiao.setVisibility(View.VISIBLE);\n\t\t\t\t//传电话号码\n\t\t\t\ttextview_phone.setText(edittext_phone.getText().toString());\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Todo 发送短信,获取验证码\n\t\t\t\tinitSDK();\n\t\t\t\tSMSSDK.getVerificationCode(\"86\",textview_phone.getText().toString());\n\t\t\t\t\t\n\t\t\t\thandler.postDelayed(runnable, 1000); \n\t\t\t\t \n\t\t\t}", "public void onClick(View v) {\n if(v.getId()== R.id.btn_price){\n Message message = Message.obtain();\n message.what = 8;\n Bundle bundle = new Bundle();\n bundle.putInt(\"payType\",payType);\n message.setData(bundle);\n mHandler.sendMessage(message);\n dismiss();\n }\n if(v.getId()== R.id.ll_weixin){\n payType=1;\n iv_checked.setVisibility(View.VISIBLE);\n iv_zhifubao_checked.setVisibility(View.GONE);\n\n }\n if(v.getId()== R.id.ll_zhifubao){\n payType=2;\n iv_checked.setVisibility(View.GONE);\n iv_zhifubao_checked.setVisibility(View.VISIBLE);\n }\n\n }", "void setWaitScreen(boolean set) {\n // findViewById(R.id.screen_main).setVisibility(set ? View.GONE : View.VISIBLE);\n // findViewById(R.id.screen_wait).setVisibility(set ? View.VISIBLE : View.GONE);\n }", "private void setAllGone() {\n ivOne.setVisibility(View.GONE);\n ivTwo.setVisibility(View.GONE);\n ivThree.setVisibility(View.GONE);\n ivFour.setVisibility(View.GONE);\n ivFive.setVisibility(View.GONE);\n ivSix.setVisibility(View.GONE);\n ivSeven.setVisibility(View.GONE);\n ivEight.setVisibility(View.GONE);\n ivNine.setVisibility(View.GONE);\n }", "private void showBuddyUpEmptyView() {\n mRecyclerView.setVisibility(View.GONE);\n emptyViewRoot.setVisibility(View.VISIBLE);\n emptyViewBudddyUp.setVisibility(View.VISIBLE);\n emptyViewPickUp.setVisibility(View.GONE);\n emptyViewNoInternet.setVisibility(View.GONE);\n }", "private void showResult() {\n mTvErrorMessage.setVisibility(View.INVISIBLE); // set the visibility of the error message to invisible\n mCryptoRecyclerView.setVisibility(View.VISIBLE); // set the visibility of the recycler to visible\n }", "private void showNewCoursesLayoutOnClick(){\n newCourses.setVisibility(View.VISIBLE);\n\n }", "@Override\r\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tPropertyRepairActivity.this.runOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\tnonemsgtext.setVisibility(View.GONE);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}", "@Override\n public void onAnimationStart(Animator animation) {\n findViewById(R.id.btn_sticker1).setVisibility(View.GONE);\n findViewById(R.id.btn_sticker2).setVisibility(View.GONE);\n findViewById(R.id.btn_sticker3).setVisibility(View.GONE);\n findViewById(R.id.btn_camera_sticker_album).setVisibility(View.VISIBLE);\n findViewById(R.id.btn_camera_filter_album).setVisibility(View.VISIBLE);\n findViewById(R.id.btn_return).setVisibility(View.VISIBLE);\n\n\n\n //瞬间隐藏掉面板上的东西\n mStickerLayout.setVisibility(View.GONE);\n }", "private void showErrorMessage(){\n mErrorMessageDisplay.setVisibility(View.VISIBLE);\n mGridView.setVisibility(View.INVISIBLE);\n }", "private void showNoInternetEmptyView() {\n emptyViewPickUp.setVisibility(View.GONE);\n emptyViewBudddyUp.setVisibility(View.GONE);\n emptyViewNoInternet.setVisibility(View.VISIBLE);\n }", "@Override\n protected void onResume() {\n \tsuper.onResume();\n \tdb.open();\n \tCursor cur = db.getEmpValues();\n \tif (cur.getCount() > 0) {\n \t\tbtn_Reg.setVisibility(View.GONE);\n\t\t}else {\n\t\t\tbtn_Reg.setVisibility(View.VISIBLE);\n\t\t}\n \tdb.close();\n }" ]
[ "0.76236486", "0.7504797", "0.7060643", "0.70239884", "0.70159", "0.6988551", "0.6964159", "0.69500315", "0.6944646", "0.6944646", "0.6921754", "0.69122934", "0.6885477", "0.68660367", "0.68561876", "0.6853251", "0.66842914", "0.6596626", "0.6593318", "0.65841365", "0.65601933", "0.65503687", "0.65384275", "0.6513295", "0.65013385", "0.64998657", "0.6498897", "0.64260334", "0.6415195", "0.6414952", "0.6407764", "0.63925624", "0.6391102", "0.6381492", "0.6377101", "0.6375841", "0.63629884", "0.63484126", "0.6320202", "0.62940043", "0.6283019", "0.6267506", "0.62518907", "0.62430155", "0.6242509", "0.6239246", "0.6234054", "0.62227505", "0.6209419", "0.62077963", "0.6182291", "0.6175567", "0.6147747", "0.61407745", "0.6137647", "0.6110657", "0.61054474", "0.61049855", "0.6104808", "0.6090698", "0.609052", "0.6087305", "0.60814047", "0.60690945", "0.6066774", "0.6051654", "0.60501647", "0.6046546", "0.6044839", "0.6039187", "0.6038902", "0.6035045", "0.60325366", "0.6030158", "0.602488", "0.60167366", "0.6015105", "0.6008583", "0.6007791", "0.59972316", "0.59935236", "0.59765136", "0.59699327", "0.5962533", "0.5954555", "0.59526545", "0.59526545", "0.5951344", "0.59378713", "0.59376", "0.59368396", "0.5932576", "0.5932461", "0.5928749", "0.5915886", "0.5909551", "0.59083426", "0.5886234", "0.5884813", "0.58828694", "0.5879788" ]
0.0
-1
The SMS verification code has been sent to the provided phone number, we now need to ask the user to enter the code and then construct a credential by combining the code with a verification ID.
@Override public void onCodeSent(@NonNull String verificationId, @NonNull PhoneAuthProvider.ForceResendingToken token) { Log.d(TAG, "onCodeSent:" + verificationId); showToastMessage("code has been sent!"); // Save verification ID and resending token so we can use them later mVerificationId = verificationId; mResendToken = token; //change ui sendVerificationBtn.setVisibility(View.INVISIBLE); inputPhoneNumEt.setVisibility(View.INVISIBLE); verifyBtn.setVisibility(View.VISIBLE); inputCodeEt.setVisibility(View.VISIBLE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onVerificationCompleted(PhoneAuthCredential credential) {\n Toast.makeText(activity, \"credentials : \"+credential, Toast.LENGTH_SHORT).show();\n Toast.makeText(activity, \"Sms : \"+smsCode, Toast.LENGTH_SHORT).show();\n Toast.makeText(activity, \"phone verification Id : \"+phoneVerificationId, Toast.LENGTH_SHORT).show();\n smsMessage = credential.getSmsCode();\n }", "@Override\n public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {\n code = phoneAuthCredential.getSmsCode();\n\n //sometimes the code is not detected automatically\n //in this case the code will be null\n //so user has to manually enter the code\n if (code != null) {\n\n codeValues_into_views(code);\n\n stop_timer();\n //verify the code\n verifyVerificationCode(code);\n }\n }", "private void sendVerificationCode() {\n\n PhoneAuthProvider.getInstance().verifyPhoneNumber(\n \"+91\" + phoneNumber, // Phone number to verify\n 60, // Timeout and unit\n TimeUnit.SECONDS,\n this,\n mCallbacks\n );\n }", "@Override\n public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {\n String code = phoneAuthCredential.getSmsCode();\n\n Toast.makeText(OTPActivity.this, \"Reached here\", Toast.LENGTH_SHORT).show();\n\n //sometime the code is not detected automatically\n //in this case the code will be null\n //so user has to manually enter the code\n if (code != null) {\n loading.setVisibility(View.VISIBLE);\n etOtp.setText(code);\n etOtp.setEnabled(false);\n Toast.makeText(OTPActivity.this, \"Reached here\", Toast.LENGTH_SHORT).show();\n //verifying the code\n verifyVerificationCode(code);\n }\n }", "private void sendVerificationCode(String number) {\n PhoneAuthOptions options =\n PhoneAuthOptions.newBuilder(mAuth)\n .setPhoneNumber(number) // Phone number to verify\n .setTimeout(60L, TimeUnit.SECONDS) // Timeout and unit\n .setActivity(this) // Activity (for callback binding)\n .setCallbacks(mCallBack) // OnVerificationStateChangedCallbacks\n .build();\n PhoneAuthProvider.verifyPhoneNumber(options);\n // auto verification of user.\n\n\n\n Toast.makeText(this, \"Verification Code sent!\", Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {\n String code = phoneAuthCredential.getSmsCode();\n Log.d(TAG, \"onVerificationCompleted: RECEIVED OTP \"+code);\n if(code != null){\n code_received.setText(code);\n verifyCode(code);\n }\n }", "private void sendVerificationCode(String number) {\n PhoneAuthOptions options =\n PhoneAuthOptions.newBuilder(mAuth)\n .setPhoneNumber(number) // Phone number to verify\n .setTimeout(60L, TimeUnit.SECONDS) // Timeout and unit\n .setActivity(this) // Activity (for callback binding)\n .setCallbacks(mCallBack) // OnVerificationStateChangedCallbacks\n .build();\n PhoneAuthProvider.verifyPhoneNumber(options);\n }", "@Override\n public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {\n // below line is used for getting OTP code\n // which is sent in phone auth credentials.\n final String code = phoneAuthCredential.getSmsCode();\n\n // checking if the code\n // is null or not.\n if (code != null) {\n // if the code is not null then\n // we are setting that code to\n // our OTP edittext field.\n // after setting this code\n // to OTP edittext field we\n // are calling our verifycode method.\n verifyCode(code);\n }\n }", "@Override\n public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {\n code = phoneAuthCredential.getSmsCode();\n\n //sometime the code is not detected automatically\n //in this case the code will be null\n //so user has to manually enter the code\n if (code != null) {\n phoneAuthView.setVerificationCode(code);\n //verifying the code\n verifyVerificationCode(code);\n }\n }", "@Override\n public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {\n String code=phoneAuthCredential.getSmsCode ();\n if (code != null) {\n etUIDPasscode.setText (code);\n verifyCode (code);\n }\n }", "private void sendVerificationCode(String phone_number){\n Log.d(TAG, \"sendVerificationCode: SENDING OTP\");\n progressBar.setVisibility(View.VISIBLE);\n PhoneAuthProvider.getInstance().verifyPhoneNumber(\n phone_number,\n 60,\n TimeUnit.SECONDS,\n TaskExecutors.MAIN_THREAD,\n mCallBack\n );\n }", "@Override\n\n public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {\n\n\n Toast.makeText(otpsignin.this,\"Code send to your phone\",Toast.LENGTH_SHORT).show();\n\n signInWithPhoneAuthCredential(phoneAuthCredential);\n\n }", "@Override\n public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {\n final String code = phoneAuthCredential.getSmsCode();\n if (code != null) {\n OTP.setText(code);\n verifyCode(code);\n }\n }", "private void verifyCode(String code) {\n // below line is used for getting getting\n // credentials from our verification id and code.\n PhoneAuthCredential credential = PhoneAuthProvider.getCredential(verificationId, code);\n\n // after getting credential we are\n // calling sign in method.\n signInWithCredential(credential);\n }", "@Override\n public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {\n String code = phoneAuthCredential.getSmsCode();\n if (code != null){\n progressBar.setVisibility(View.VISIBLE);\n System.out.println(\"PhoneAuthProvider onVerificationCompleted \"+phoneAuthCredential);\n verifyCode(code);\n }\n }", "private void showVerificationDialog(String phoneNumber) {\n\t\tnew AlertDialog.Builder(this)\n\t\t\t\t.setTitle(R.string.phoneVerification_confirmTitle)\n\t\t\t\t.setMessage(getString(R.string.phoneVerification_confirmText, phoneNumber))\n\t\t\t\t.setPositiveButton(R.string.app_yes, (dialog, which) -> requestVerificationCode(phoneNumber))\n\t\t\t\t.setNegativeButton(R.string.app_no, (dialog, which) -> phoneInput.getEditText().selectAll())\n\t\t\t\t.show();\n\t}", "@Override\n public void onVerificationCompleted(PhoneAuthCredential credential) {\n Log.d(TAG, \"onVerificationCompleted:\" + credential);\n otp = credential.getSmsCode();\n pinEntered.setText(otp);\n signInWithPhoneAuthCredential(credential);\n }", "public void getVerified() {\n Toast.makeText(this, \"Enter your registered mobile number\", Toast.LENGTH_LONG).show();\n\n authCallback = new AuthCallback() {\n\n @Override\n public void success(DigitsSession session, final String phoneNumber) {\n\n //In case phone number gets verified.. call successMethod() function..\n h.post(new Runnable() {\n @Override\n public void run() {\n\n successMethod(phoneNumber);\n containerForgotPassword.setVisibility(View.VISIBLE);\n\n }\n });\n }\n\n @Override\n public void failure(DigitsException exception) {\n //In case phone number isn't verified, finish() this activity displaying appropriate toast..\n Toast.makeText(ForgotPassword.this, \"Couldn't verify phone number\", Toast.LENGTH_SHORT).show();\n finish();\n }\n };\n\n Digits.clearActiveSession();\n getAuthCallback();\n AuthConfig.Builder authConfigBuilder = new AuthConfig.Builder()\n .withAuthCallBack(authCallback)\n .withPhoneNumber(\"+91\");\n Digits.authenticate(authConfigBuilder.build());\n }", "@Override\n\n public void onCodeSent(String verificationId,\n PhoneAuthProvider.ForceResendingToken token) {\n\n Toast.makeText(otpsignin.this, verificationId, Toast.LENGTH_SHORT).show();\n\n Log.d(TAG, \"onCodeSent:\" + verificationId);\n\n Toast.makeText(otpsignin.this,\"On code sent meathod\",Toast.LENGTH_SHORT).show();\n\n // Save verification ID and resending token so we can use them later\n\n btntype=1;\n\n\n mVerificationId = verificationId;\n\n mResendToken = token;\n\n btnOTP.setText(\"Verify code\");\n\n // ...\n }", "public static void RegisterPhone(final Activity activity,final String phoneNumber,final Dialog dialog,final EditText input,final Button send,final Button resend,final GifImageView counter){\n smsCode = phoneVerificationId;\n\n\n FirebaseAuth firebaseAuth = FirebaseAuth.getInstance();\n FirebaseAuthSettings firebaseAuthSettings = firebaseAuth.getFirebaseAuthSettings();\n\n// Configure faking the auto-retrieval with the whitelisted numbers.\n firebaseAuthSettings.setAutoRetrievedSmsCodeForPhoneNumber(phoneNumber, smsCode);\n\n PhoneAuthProvider phoneAuthProvider = PhoneAuthProvider.getInstance();\n phoneAuthProvider.verifyPhoneNumber(\n phoneNumber,\n 60L,\n TimeUnit.SECONDS,\n activity, /* activity */\n mCallbacks = new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {\n @Override\n public void onVerificationCompleted(PhoneAuthCredential credential) {\n // Instant verification is applied and a credential is directly returned.\n // ...\n //SignInWithPhoneAuthCredential(activity,credential,dialog,input,send,resend,counter);\n Toast.makeText(activity, \"credentials : \"+credential, Toast.LENGTH_SHORT).show();\n Toast.makeText(activity, \"Sms : \"+smsCode, Toast.LENGTH_SHORT).show();\n Toast.makeText(activity, \"phone verification Id : \"+phoneVerificationId, Toast.LENGTH_SHORT).show();\n smsMessage = credential.getSmsCode();\n }\n\n @Override\n public void onVerificationFailed(FirebaseException e) {\n Log.e(TAG, \"Error adding document\", e);\n if (e instanceof FirebaseAuthInvalidCredentialsException) {\n Log.d(constants.PhoneRegTag, \"Invalid Credentials\");\n } else if (e instanceof FirebaseTooManyRequestsException) {\n Log.d(constants.PhoneRegTag, \"SMS Verification Pin needed\");\n }\n }\n\n @Override\n public void onCodeSent(String verificationId, PhoneAuthProvider.ForceResendingToken token) {\n phoneVerificationId = verificationId;\n resendingToken = token;\n //PhoneAuthCredential credential = PhoneAuthProvider.getCredential(phoneVerificationId,token.toString());\n //smsMessage = credential.getSmsCode();\n counter.setVisibility(View.GONE);\n input.setVisibility(View.VISIBLE);\n input.requestFocus();\n send.setVisibility(View.VISIBLE);\n resend.setVisibility(View.VISIBLE);\n // The SMS verification code has been sent to the provided phone number, we\n // now need to ask the user to enter the code and then construct a credential\n //and then execute your method if number entered is correct.\n }\n\n\n });\n\n }", "void requestSendSMSCode(Context context,String phone);", "@When(\"^I enter my code on Phone Number Verification page$\")\n public void IEnterCode() throws Exception {\n final String verificationCode = BackendAPIWrappers.getLoginCodeByPhoneNumber(\n AndroidTabletTestContextHolder.getInstance().getTestContext().getUsersManager()\n .getSelfUserOrThrowError().getPhoneNumber());\n getTabletPhoneNumberVerificationPage().inputConfirmationCode(verificationCode);\n }", "@Override\n public void onCodeSent(@NonNull String s, @NonNull PhoneAuthProvider.ForceResendingToken forceResendingToken) {\n super.onCodeSent(s, forceResendingToken);\n verificationId = s;\n // start showing the pin view and verify button\n Toast.makeText(MainActivity.this, \"Enter OTP to verify\", Toast.LENGTH_SHORT).show();\n OTP.setVisibility(View.VISIBLE);\n verifyButton.setVisibility(View.VISIBLE);\n }", "public void requestConfirmationCode() {\n PhoneNumberVerificationRequest.forPhoneNumberVerification(this.airPhone.formattedPhone()).withListener((Observer) this.phoneNumberVerificationRequestListener).execute(this.requestManager);\n }", "@And(\"^Enter user phone and confirmation code$\")\t\t\t\t\t\n public void Enter_user_phone_and_confirmation_code() throws Throwable \t\t\t\t\t\t\t\n { \t\t\n \tdriver.findElement(By.id(\"phoneNumberId\")).sendKeys(\"01116844320\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvPhoneNext']/content/span\")).click();\n driver.findElement(By.id(\"code\")).sendKeys(\"172978\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvVerifyNext']/content/span\")).click();\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\t\t\n }", "@Override\n public void onCodeSent(String verificationId,\n PhoneAuthProvider.ForceResendingToken token) {\n Toast.makeText(PhoneActivity.this,\"Verification code has been send on your number\",Toast.LENGTH_SHORT).show();\n // Save verification ID and resending token so we can use them later\n mVerificationId = verificationId;\n mResendToken = token;\n mPhoneNumber.setVisibility(View.GONE);\n mSendOTP.setVisibility(View.GONE);\n mRideName1.setVisibility(View.GONE);\n\n mRideName2.setVisibility(View.VISIBLE);\n mOTP.setVisibility(View.VISIBLE);\n mVerifyOTP.setVisibility(View.VISIBLE);\n // ...\n }", "@Step\n public void enterSmsIntoInput(String smsCode){\n actionWithWebElements.enterTextIntoInput(confirmationSmsCodeInput, smsCode);\n }", "@Override\n public void onVerificationCompleted(PhoneAuthCredential credential) {\n }", "@Override\n public void onVerificationCompleted(PhoneAuthCredential credential) {\n }", "@Override\n public void onVerificationCompleted(PhoneAuthCredential credential) {\n }", "@Override\n public void onVerificationCompleted(PhoneAuthCredential credential) {\n }", "public void verifyCodePressed(View view) {\r\n emailTo = String.valueOf(etEmail.getText());\r\n //Generate the random verify code\r\n verifyCode = (int)((Math.random() * 9 + 1) * 100000);\r\n Toast.makeText(ForgetPswActivity.this,\"Sending..... the verify code\", Toast.LENGTH_LONG).show();\r\n Thread thread = new Thread(){\r\n @Override\r\n public void run() {\r\n EmailUtil.getInstance().sendEmail(emailTo,\"Verify Code from Digital Learner Logbook\",\r\n \"DLL send a verify code: \" + verifyCode +\r\n \", This code is for reset the password only!\" );\r\n\r\n Looper.prepare();\r\n Toast.makeText(ForgetPswActivity.this,\"Sent the verify code\", Toast.LENGTH_LONG).show();\r\n Looper.loop();\r\n }\r\n };\r\n thread.start();\r\n\r\n }", "@Override\n public void onCodeSent(@NonNull String verificationId,\n @NonNull PhoneAuthProvider.ForceResendingToken token) {\n Log.d(TAG, \"onCodeSent:\" + verificationId);\n\n open_otp(verificationId);\n }", "public void onClick(View v) {\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tString phoneno=phonenoET.getText().toString();\n\t\t\t\t\t\t\tif(phoneno.equals(\"\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),\"Enter Phone No.\",Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(phoneno.length()!=10)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),\"Wrong Phone No.\",Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//uniquecode=\"hello\";\n\t\t\t\t\t\t\t\t//double code=Math.random();\n\t\t\t\t\t\t\t\t//Toast.makeText(getApplicationContext(),\"\"+code+\"\",Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t\tuniquecode=Integer.toString((int)(Math.random()*1000000000));\n\t\t\t\t\t\t\t\t//Toast.makeText(getApplicationContext(),\"Unique CODE: \"+uniquecode,Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t\tSmsManager sms=SmsManager.getDefault();\n\t\t\t\t\t\t\t\tsms.sendTextMessage(phoneno, null,\"Unique CODE: \"+uniquecode, null, null);\n\t\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),\"Msg Sent\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\t\tDate date = new Date();\n\t\t\t\t\t\t\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\t\t\t\t\t\t\tString currentDate = dateFormat.format(date);\n\t\t\t\t\t\t\t\tSimpleDateFormat timeFormat = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\t\t\t\t\t\tString currentTime = timeFormat.format(date);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tmBuilder.setContentTitle(\"Unique Code Sent\");\n\t\t\t\t\t\t\t\tmBuilder.setContentText(\"to \"+phoneno+\"\\non \"+currentDate+\"\");\n\t\t\t\t\t\t\t\tmBuilder.setTicker(\"Password Alert!\");\n\t\t\t\t\t\t\t\tmBuilder.setSmallIcon(R.drawable.ic_launcher);\n\t\t\t\t\t\t\t\t//mBuilder.setNumber(++numMessages);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tmNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\t\t\t\t\t\t\t\t/* notificationID allows you to update the notification later on. */ \n\t\t\t\t\t\t\t\tmNotificationManager.notify((int)(Math.random()*1000), mBuilder.build());\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//Intent i=new Intent(getApplicationContext(),Read_Activity.class);\n\t\t\t\t\t\t\t\t//startActivity(i);\n\t\t\t\t\t\t\t\tphonenoET.setEnabled(false);\n\t\t\t\t\t\t\t\tsendb.setEnabled(false);\n\t\t\t\t\t\t\t\tucodeET.setVisibility(0);\n\t\t\t\t\t\t\t\tnextb.setVisibility(0);\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\tcatch(Exception ex)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),ex.toString(),Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),\"Msg not Sent\",Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "public void SetCheckoutRegistrationPhonecode_number(String phoneno){\r\n\r\n\t\tString Phoneno = getValue(phoneno);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Registration Phone code and number should be entered as , \"+Phoneno);\r\n\t\ttry{\r\n\r\n\r\n\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonenumber\"),Phoneno);\r\n\t\t\tSystem.out.println(\"Registration Phone code and number is entered as , \"+Phoneno);\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Registration Phone code and number is entered as , \"+Phoneno);\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Registration Phone number is not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"checkoutregistrationPhonenumber\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" / \"+elementProperties.getProperty(\"checkoutregistrationPhonenumber\").toString().replace(\"By.\", \" \")+\r\n\t\t\t\t\t\" not found\");\r\n\t\t}\r\n\r\n\t}", "@Override\n public void onCodeSent(String s, PhoneAuthProvider.ForceResendingToken forceResendingToken) {\n super.onCodeSent(s, forceResendingToken);\n // when we receive the OTP it\n // contains a unique id which\n // we are storing in our string\n // which we have already created.\n verificationId = s;\n }", "@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n progress.hide();\n\n\n try {\n JSONObject resultJson = new JSONObject(result);\n if (resultJson.getString(\"code\").trim().contentEquals(\"200\")) {\n final AlertDialog.Builder builder1 = new AlertDialog.Builder(\n activity);\n final View view = activity.getLayoutInflater().inflate(R.layout.verify_dialog, null, false);\n builder1.setView(view);\n builder1.setTitle(\"Mobile Verification Code\");\n\n builder1.setCancelable(false);\n builder1.setPositiveButton(\"verify\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog,\n int id) {\n\n String otpCode = ((EditText) view.findViewById(R.id.otp_code_edit_text)).getText().toString();\n new VerifyUserAsyncTask(activity).execute(otpCode);\n\n dialog.cancel();\n //activity.finish();\n }\n });\n AlertDialog alert11 = builder1.create();\n alert11.show();\n\n IntentFilter intentFilter = new IntentFilter(\"SmsMessage.intent.MAIN\");\n BroadcastReceiver receiver = new BroadcastReceiver() {\n @Override\n public void onReceive(Context context, Intent intent) {\n String msg = intent.getStringExtra(\"get_msg\");\n\n //Process the sms format and extract body &amp; phoneNumber\n msg = msg.replace(\"\\n\", \"\");\n String message = msg.substring(msg.lastIndexOf(\":\") + 1, msg.length());\n Log.d(\"Received Message Body :\", message.toString());\n\n StringTokenizer tokens = new StringTokenizer(message, \".\");\n tokens.nextToken();\n tokens.nextToken();\n tokens.nextToken();\n // this will contain \"Your Aptamitra verification code is\"\n String code = tokens.nextToken();// this will contain \"XXXX\"\n tokens.nextToken();// this will contain \"for any query visit aptamitra.in\"\n ((EditText) view.findViewById(R.id.otp_code_edit_text)).setText(code);\n Log.d(\"otp:\", code);\n\n\n }\n };\n\n activity.registerReceiver(receiver, intentFilter);\n\n\n } else if (resultJson.getString(\"code\").trim().contentEquals(\"505\")) {\n AlertDialog.Builder builder1 = new AlertDialog.Builder(\n activity);\n builder1.setMessage(\"User already exists!\");\n builder1.setCancelable(true);\n builder1.setPositiveButton(\"Ok\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog,\n int id) {\n dialog.cancel();\n activity.finish();\n }\n });\n AlertDialog alert11 = builder1.create();\n alert11.show();\n } else {\n AlertDialog.Builder builder1 = new AlertDialog.Builder(\n activity);\n builder1.setMessage(\"Registration failed.Try Again\");\n builder1.setCancelable(true);\n builder1.setPositiveButton(\"Ok\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog,\n int id) {\n dialog.cancel();\n activity.finish();\n }\n });\n AlertDialog alert11 = builder1.create();\n alert11.show();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n // Toast.makeText(activity, result, Toast.LENGTH_SHORT).show();\n\n\n }", "public void SetCheckoutRegistrationPhonecode_number(String code, String phoneno){\r\n\t\tString Code = getValue(code);\r\n\t\tString Phoneno = getValue(phoneno);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:- \"+Code+\" , \"+Phoneno);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Registration Phone code and Phone number should be entered as '\"+Code+\"' , '\"+Phoneno+\"' \");\r\n\t\ttry{\r\n\t\t\tif((countrygroup_phoneNo).contains(countries.get(countrycount))){\r\n\t\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonenumber\"),Phoneno);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonecode\"),Code);\r\n\t\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonenumber\"),Phoneno);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tSystem.out.println(\"Registration Phone code and number is entered as '\"+Code+\"' , '\"+Phoneno+\"' \");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Registration Phone code and number is entered as '\"+Code+\"' , '\"+Phoneno+\"' \");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Registration Phone code and number is not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtcheckoutregistrationPhonecode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" / \"+elementProperties.getProperty(\"txtcheckoutregistrationPhonenumber\").toString().replace(\"By.\", \" \")+\r\n\t\t\t\t\t\" not found\");\r\n\t\t}\r\n\r\n\t}", "@Override\n public void onVerifyPhoneNumberSuccessfully(PhoneVerification verification) {\n// if (BuildConfig.DEBUG){// TODO: 26/10/2017 this hard code should be removed later\n// gotoPhoneSignInScreen();\n// return;\n// }\n if (verification.isExists){\n gotoPhoneSignInScreen();\n }else{\n showConfirmDialog(verification.otpToken);\n }\n }", "@Override\n public void onCodeSent(String s, PhoneAuthProvider.ForceResendingToken forceResendingToken){\n super.onCodeSent(s, forceResendingToken);\n Log.d(TAG, \"sendVerificationCode: VERIFY SENT\");\n verificationId = s;\n }", "public void sendVerificationCode(int code,String mail,String password) {\n\n headers = new HashMap<>();\n headers.put(\"code\", String.valueOf(code));\n headers.put(\"mail\",mail);\n headers.put(\"password\",password);\n headers.put(\"Content-Type\", \"application/json\");\n try {\n databaseURL = \"http://ec2-18-216-46-195.us-east-2.compute.amazonaws.com:6868/verifiication_complete\";\n sendRequest(databaseURL);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void setVerificationCode(String OTP) {\n\t\thelper.findElementById(otpFieldId).sendKeys(OTP);\n\t}", "public void VerifyCodeRecieved(View view) {\n StringBuilder codebuilder = new StringBuilder();\n\n for (TextInputEditText et_code : code_input_Array){\n codebuilder.append(et_code.getText().toString());\n }\n\n if (!codebuilder.toString().isEmpty() && codebuilder.toString().length() == 6){\n //Toast.makeText(getApplicationContext(),codebuilder.toString(),Toast.LENGTH_LONG).show();\n verifyVerificationCode(codebuilder.toString());\n }else {\n common.Mysnackbar(findViewById(R.id.const_verify_layout),\n \"Enter Verification Code\", Snackbar.LENGTH_LONG).show();\n }\n\n }", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t realCode = GenerateCodeActivity.getInstance().getCode();\n\t\t\t\t\t\t\tString phoneCode = et_phoneCode.getText().toString();\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\tif(phoneCode.equals(realCode))\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tIntent intent=new Intent(pre_registerActivity.this, RegisterActivity.class);\n\t\t\t\t\t\t\t\tintent.putExtra(\"phone\",et_phoneNum.getText().toString());//传到跳转页面\n\t\t\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tToast.makeText(pre_registerActivity.this, \"验证码错误\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\t\t\n\t\t\t\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}", "private void verifyPhoneNumber() {\n showSnackbar(\"Verifying Phone Number\");\n\n //Remove Social Sign-ins\n// disableViews(mBinding.imageButtonFacebook, mBinding.imageButtonGoogle);\n //Remove Login Button\n disableViews(mBinding.buttonLogin);\n\n mPhoneNumber = getTextFromTextInputLayout(mBinding.textPhoneNumber);\n PhoneAuthOptions authOptions = PhoneAuthOptions.newBuilder(mFirebaseAuth)\n .setPhoneNumber(getString(R.string.country_code) + mPhoneNumber)\n .setTimeout(60L, TimeUnit.SECONDS).setActivity(this).setCallbacks(mCallBacks).build();\n\n PhoneAuthProvider.verifyPhoneNumber(authOptions);\n }", "private void verifyCode() {\n com.explara_core.login.LoginScreenManager.getInstance().verifyCode(getActivity().getApplicationContext(), mCode, mEmail, new com.explara_core.login.LoginScreenManager.VerifyCodeListener() {\n @Override\n public void onCodeVerified(com.explara_core.login.login_dto.LoginResponseDto loginResponse) {\n if (getActivity() != null && loginResponse != null) {\n if (loginResponse.status.equals(Constants.STATUS_ERROR)) {\n //Constants.createToastWithMessage(this, response.getMessage());\n mMaterialProgressDialog.dismiss();\n AppUtility.createSnackWithMessage(getActivity().findViewById(R.id.forgot_verification_activity_relative_layout), loginResponse.message);\n } else {\n mMaterialProgressDialog.dismiss();\n mMaterialAlertDialog = new MaterialDialog.Builder(getActivity())\n .title(\"Alert\")\n .content(loginResponse.message)\n .positiveText(\"Ok\")\n .positiveColor(Color.RED)\n .negativeColor(Color.GRAY)\n .callback(new MaterialDialog.ButtonCallback() {\n @Override\n public void onPositive(MaterialDialog dialog) {\n super.onPositive(dialog);\n // navigate to login screen\n navigateToResetPage();\n }\n\n @Override\n public void onNegative(MaterialDialog dialog) {\n super.onNegative(dialog);\n }\n })\n .show();\n\n }\n }\n }\n\n @Override\n public void onCodeVerifyFailed() {\n if (getActivity() != null) {\n mMaterialProgressDialog.dismiss();\n Toast.makeText(getActivity(), \"Oops! Could not verify the code.\", Toast.LENGTH_SHORT).show();\n }\n }\n }, TAG);\n }", "@Override\n public void onClick(DialogInterface dialog,\n int which) {\n showDialog(getResources()\n .getString(\n R.string.smssdk_get_verification_code_content));\n new MessageVerify(phone, new MessageVerify.SuccessCallBack() {\n @Override\n public void onSuccess(JSONObject obj) {\n try {\n String message = obj.getString(Config.KEY_RETURN_MESSAGE);\n sessionId = obj.getString(Config.KEY_SESSIONID);\n //token = obj.getString(Config.KEY_TOKEN);\n\n\n Config.cacheSessionId(RegisterActivity.this, sessionId);\n // Config.cacheToken(RegisterActivity.this, token);\n Log.i(\"info\",\"从服务器获取的sessionId:\" + sessionId);\n Log.i(\"info\",\"从缓存中取出的sessionId:\" + Config.getCacheSessionId(RegisterActivity.this));\n\n Toast.makeText(RegisterActivity.this, message, Toast.LENGTH_SHORT).show();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }, new MessageVerify.FailCallBack() {\n @Override\n public void onFail(String message) {\n Toast.makeText(RegisterActivity.this, message, Toast.LENGTH_SHORT).show();\n }\n });\n\n closeDialog();\n\n }", "@Override\n public void onVerificationCompleted(PhoneAuthCredential credential) {\n mVerificationInProgress = false;\n Toast.makeText(PhoneActivity.this,\"Verification Complete\",Toast.LENGTH_SHORT).show();\n dialog.setMessage(\"Logging you in..\");\n dialog.show();\n signInWithPhoneAuthCredential(credential);\n }", "@Override\n public void onVerificationCompleted(PhoneAuthCredential credential) {\n Log.d(TAG, \"onVerificationCompleted:\" + credential);\n\n signInWithPhoneAuthCredential(credential);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\ttime=30;\n\t\t\t\tverfy_button.setEnabled(false);\n\t\t\t\thandler.postDelayed(runnable, 1000); \n\t\t\t\tinitSDK();\n\t\t\t\tSMSSDK.getVerificationCode(\"86\",textview_phone.getText().toString());\n\t\t\t\t\n\t\t\t}", "private void getVerifyCode() {\n\t\t\n\t\tNetworkTask task = new NetworkTask((CApplication) getActivity().getApplication(), \"user_isdn_code\", false){\n\t\t\t\n\t\t\tprivate ProgressDialog mProgressDialog;\n\t\t\t\n\t\t\t@Override\n\t\t\tprotected void onPreExecute() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tsuper.onPreExecute();\n\t\t\t\tmProgressDialog = new ProgressDialog(getActivity());\n\t\t\t\tmProgressDialog.setCanceledOnTouchOutside(false);\n\t\t\t\tmProgressDialog.setCancelable(false);\n\t\t\t\tmProgressDialog.show();\n\t\t\t}\n\t\t\t\n\t\t\t\n\n\t\t\t@Override\n\t\t\tprotected void onPostExecute(JSONObject result) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tsuper.onPostExecute(result);\n\t\t\t\t\n\t\t\t\tmProgressDialog.dismiss();\n\t\t\t\t\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tprotected void responseData(String str, boolean isBackground) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tsuper.responseData(str, isBackground);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tJSONObject result = new JSONObject(str);\n\t\t\t\t\tint status = result.getInt(\"status\");\n\t\t\t\t\tif(status == 0){\n\t\t\t\t\t\t\n\t\t\t\t\t\tJSONArray array = result.getJSONObject(\"result\").getJSONArray(\"dataset\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(array.length() > 0){\n\t\t\t\t\t\t\tJSONObject obj = array.getJSONObject(0);\n\t\t\t\t\t\t\tverifyCode = obj.getString(\"code\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tmGetVerifyCode.countDown(AccountResetPwdFragment.this);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} catch (JSONException 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\t\n\t\t\t}\n\t\t\t\n\t\t};\n\t\t\n\t\ttry {\n\t\t\tString isdn = mPhone.getText().toString();\n\t\t\tJSONObject params = new JSONObject();\n\t\t\tparams.put(\"isdn\", isdn);\n\t\t\ttask.execute(params);\n\t\t} catch (JSONException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "@Override\n public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential)\n {\n signInWithPhoneAuthCredential(phoneAuthCredential);\n\n }", "@Override\n public void onClick(View view) {\n\n String numberPhone = inputPhoneNumEt.getText().toString();\n if(TextUtils.isEmpty(numberPhone)){\n showToastMessage(\"phone number required!\");\n }else{\n //loading bar put here\n ///...\n // [START start_phone_auth]\n PhoneAuthProvider.getInstance().verifyPhoneNumber(\n numberPhone, // Phone number to verify\n 60, // Timeout duration\n TimeUnit.SECONDS, // Unit of timeout\n PhoneLoginActivity.this, // Activity (for callback binding)\n mCallbacks); // OnVerificationStateChangedCallbacks\n // [END start_phone_auth]\n }\n }", "public void onClick(View v) {\n\t\tswitch (v.getId()) {\n\t\tcase R.id.button1://获取验证码短信\n\t\t\tif(!TextUtils.isEmpty(phoneText.getText().toString())){\n\t\t\t\tSMSSDK.getVerificationCode(\"86\",phoneText.getText().toString()); \n\t\t\t\tphString=phoneText.getText().toString();\n\t\t\t\t\n\t\t\t}else {\n\t\t\t\tToast.makeText(RegisterActivity.this,\"电话不能为空\", Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase R.id.button2:\n\t\t\tSMSSDK.submitVerificationCode(\"86\", phString, codeText.getText().toString());\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\n public void onClick(View v) {\n String phoneNumber=PhoneNumberEdit.getText().toString();\n\n //if you don't write anything on pone number\n if (PhoneNumberEdit.getText().toString().isEmpty())\n {\n //setting error\n PhoneNumberEdit.setError(\"Phone number is EMPTY \");\n PhoneNumberEdit.requestFocus();\n\n }\n //if the phone number length didn't match with indian std\n else if (PhoneNumberEdit.getText().toString().length()!=10)\n {\n //setting the error\n PhoneNumberEdit.setError(\"The number you entered didn't have 10 digit \");\n PhoneNumberEdit.requestFocus();\n }\n else\n {\n\n //if those two are ok then this happen\n //phone authentication in authentication firebase\n PhoneAuthOptions options=PhoneAuthOptions.newBuilder(mAuth)\n //giving the phone number to send otp\n .setPhoneNumber(\"+91\"+phoneNumber)\n //setting the timer\n .setTimeout(60L, TimeUnit.SECONDS)\n //setting activity\n .setActivity(MainActivity.this)\n //callback function to know we get the response\n .setCallbacks(mCallBacks)\n //build it\n .build();\n\n //passing the object of phone auth options\n PhoneAuthProvider.verifyPhoneNumber(options);\n\n }\n\n }", "public String getMessage(String phone) {\n\t\t\tString sendCode=smsCode();\r\n\t\t\tString content=getContent(sendCode);\r\n\t\t\tString timestamp=getStamp();\r\n\t\t\tString sig=MD5util.md5(accountSid+authToken+timestamp);\r\n\t\t\tOutputStreamWriter out=null;\r\n\t\t\tBufferedReader br=null;\r\n\t\t\tStringBuilder sBuilder=new StringBuilder();\r\n\t\t\ttry {\r\n\t\t\t\tURL url=new URL(path);\r\n\t\t\t\tHttpURLConnection connection=(HttpURLConnection)url.openConnection();\r\n\t\t\t\tconnection.setRequestMethod(\"POST\");\r\n\t\t\t\tconnection.setDoInput(true);\r\n\t\t\t\tconnection.setDoOutput(true);\r\n\t\t\t\tconnection.setConnectTimeout(5000);\r\n\t\t\t\tconnection.setReadTimeout(10000);\r\n\t\t\t\tconnection.setRequestProperty(\"content-type\", \"application/x-www-form-urlencoded\");\r\n\t\t\t\tout=new OutputStreamWriter(connection.getOutputStream(), \"UTF-8\");\r\n\t\t\t\tString args=getArgs(content,phone,sig,timestamp);\r\n\t\t\t\tout.write(args);\r\n\t\t\t\tout.flush();\r\n\t\t\t\tbr=new BufferedReader(new InputStreamReader(connection.getInputStream(), \"UTF-8\"));\r\n\t\t\t\tString temp=\"\";\r\n\t\t\t\twhile((temp=br.readLine())!=null) {\r\n\t\t\t\t\tsBuilder.append(temp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\tcatch (Exception e) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\tJSONObject jsonObject=(JSONObject)JSON.parse(sBuilder.toString());\r\n\t\t\t\tString code=jsonObject.getString(\"respCode\");\r\n\t\t\t\tString defaut=\"00000\";\r\n\t\t\t\tif(defaut.equals(code)) {\r\n\t\t\t\t\treturn sendCode;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn code;\r\n\t\t\t\t}\r\n\t\t\t}", "private void signInWithPhoneAuthCredential(PhoneAuthCredential credential) {\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n Log.d(TAG, \"signInWithCredential:success\");\n\n FirebaseUser user = task.getResult().getUser();\n storingNewUserData();\n Intent intent = new Intent(OTP_verification_screen.this, Login.class);\n startActivity(intent);\n } else {\n // Sign in failed, display a message and update the UI\n Log.w(TAG, \"signInWithCredential:failure\", task.getException());\n if (task.getException() instanceof FirebaseAuthInvalidCredentialsException) {\n // The verification code entered was invalid\n Toast.makeText(getApplicationContext(),\"ERROR IN VERIFICATION\", Toast.LENGTH_LONG).show();\n }\n }\n }\n });\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(edittext_verfy.getText().toString().length()<1)\n\t\t\t\t{\n\t\t\t\t\tToast.makeText(getBaseContext(), \"请填写验证码\", Toast.LENGTH_LONG).show();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tverfyCode=edittext_verfy.getText().toString();\n\t\t\t\t\tSMSSDK.submitVerificationCode(\"86\", textview_phone.getText().toString(),verfyCode);\n\t\t\t\t}\n\t\t\t}", "@Override\n public OTPResponse requestToAuthenticateWithEmailAddress(EmailAddressUserAuthenticationRequest mobileNoAuthenticationRequest) {\n User user = userService.getUserByEmailAddress(mobileNoAuthenticationRequest.getEmailAddress());\n\n OTP otp = generateOTP(user.getId());\n\n String messageTitle = \"PocketChat Verification Code: \" + otp.getOtp();\n\n String messageContent = generateOTPMessageContent(otp);\n\n sendSMSAndEmail(messageTitle, messageContent, user.getMobileNo(), user.getEmailAddress());\n\n return otpResponseMapper(otp);\n }", "@Override\n public OTPResponse requestToAuthenticateWithMobileNo(MobileNoUserAuthenticationRequest mobileNoUserAuthenticationRequest) {\n User user = userService.getUserByMobileNo(mobileNoUserAuthenticationRequest.getMobileNo());\n\n OTP otp = generateOTP(user.getId());\n\n String messageTitle = \"PocketChat Verification Code: \" + otp.getOtp();\n\n String messageContent = generateOTPMessageContent(otp);\n\n sendSMSAndEmail(messageTitle, messageContent, user.getMobileNo(), user.getEmailAddress());\n\n return otpResponseMapper(otp);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(edittext_phone.length()!=11)\n\t\t\t\t{\n\t\t\t\t\tToast.makeText(getBaseContext(), \"手机号码有误!\", Toast.LENGTH_LONG).show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(edittext_pas.length()<1)\n\t\t\t\t{\n\t\t\t\t\tToast.makeText(getBaseContext(), \"请输入密码!\", Toast.LENGTH_LONG).show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tverfy_button.setEnabled(false);\n\t\t\t\ttime=30;\n\t\t\t\trelativeLayoutregist.setVisibility(View.INVISIBLE);\n\t\t\t\trelativeLayouttijiao.setVisibility(View.VISIBLE);\n\t\t\t\t//传电话号码\n\t\t\t\ttextview_phone.setText(edittext_phone.getText().toString());\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Todo 发送短信,获取验证码\n\t\t\t\tinitSDK();\n\t\t\t\tSMSSDK.getVerificationCode(\"86\",textview_phone.getText().toString());\n\t\t\t\t\t\n\t\t\t\thandler.postDelayed(runnable, 1000); \n\t\t\t\t \n\t\t\t}", "private void _verifyAuthCode(Device device,String authCode){\r\n \t\tdevice.setModified(0); // reset modified to get current time.\r\n \t\tif (device.getStatus() != DeviceStatus.Authing.getStatus()) {\r\n \t\t\tthrow new RentException(RentErrorCode.ErrorStatusViolate,\r\n \t\t\t\t\t\"device auth status not match current status is \"+device.getStatus());\r\n \t\t}\r\n \t\t//\r\n \t\t// if device modified + timeout > current time then throw timeout exception.\r\n \t\t// check verify timeout\r\n \t\t//\r\n \t\tMap<String,Object> setting = applicationConfig.get(\"general\");\r\n \tlong time=java.util.Calendar.getInstance().getTimeInMillis()/1000;\r\n \t\tint timeout = (Integer)setting.get(\"auth_verify_timeout\");\r\n \tif (time > device.getModified() + timeout ) {\t\r\n \t\t\tthrow new RentException(RentErrorCode.ErrorAuthExpired,\r\n \t\t\t\t\t\"verify mobile auth code has been timeout\");\r\n \t}\r\n \t\r\n \t\t//\r\n \t\t// check retry count\r\n \t\t//\r\n \t\tint retryLimit = (Integer)setting.get(\"auth_retry_limit\");\r\n \t\tif(logger.isDebugEnabled()) {\r\n \t\t\tlogger.debug(\"retry limit is \"+retryLimit+\" current auth retry is \"+device.getAuthRetry());\r\n \t\t}\r\n \t\tif (device.getAuthRetry() > retryLimit) {\r\n \t\t\tthrow new RentException(RentErrorCode.ErrorExceedLimit,\r\n \t\t\t\t\t\"mobile verify auth retry too many time try:\"\r\n \t\t\t\t\t\t\t+ device.getAuthRetry() + \" > \" + retryLimit);\r\n \t\t}\r\n \r\n \t\t//\r\n \t\t// check auth code\r\n \t\t//\r\n \t\tString token = device.getToken();\r\n \t\tif (!authCode.equals(this.encodeUtility.decrypt(token, Device.ENCRYPT_KEY))) {\r\n \t\t\t//\r\n \t\t\t// if fail update retry status\r\n \t\t\t//\r\n \t\t\tlogger.debug(\"token not match, token is \"+token);\r\n \t\t\tint ret =deviceDao.updateStatusAndRetryCount(device.getId(), device.getUserId(),\r\n \t\t\t\t\tDeviceStatus.Authing.getStatus(),\r\n \t\t\t\t\tDeviceStatus.Init.getStatus(), device.getModified());\r\n \t\t\tif (ret != 1) {\r\n \t\t\t\tthrow new RentException(RentErrorCode.ErrorStatusViolate,\r\n \t\t\t\t\t\t\"update device status count is not 1\");\r\n \t\t\t}\r\n \t\t\tthrow new RentException(RentErrorCode.ErrorAuthFail,\r\n \t\t\t\t\t\"device id \"+device.getId()+\" enter auth code not match\");\r\n \r\n \t\t}\r\n \t\t\r\n \t\t//\r\n \t\t// update device and user in database.\r\n \t\t//\r\n \t\tlogger.debug(\"update device status to authed\");\r\n \t\tdeviceDao.updateStatusAndRetryCount(device.getId(),device.getUserId(),\r\n \t\t\t\tDeviceStatus.Authed.getStatus(),\r\n \t\t\t\tDeviceStatus.Authing.getStatus(),\r\n \t\t\t\tdevice.getModified());\r\n \t\tUser user = device.getUser();\r\n \t\tif (user.getStatus() == UserStatus.Init.getStatus()){\r\n \t\t\tlogger.debug(\"update user status to authed\");\r\n \t\t\tuser.setModified((long)0);\r\n \t\t\tuserDao.updateUserStatus(user.getId(), UserStatus.Authed.getStatus()\r\n \t\t\t\t\t, UserStatus.Init.getStatus(), user.getModified());\r\n \t\t}\r\n \t\t\r\n \t}", "public String PhoneVerify() throws Exception {\r\n\t\t\ttry {\r\n\t\t\t\telement = driver.findElement(phoneverified);\r\n\t\t\t\tStr_phoneverified = element.getText();\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tthrow new Exception(\"Phone Number NOT FOUND:: \"+e.getLocalizedMessage());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn Str_phoneverified;\r\n\t\t\t\r\n\t\t}", "@Override\n public void onCodeSent(String verificationId, PhoneAuthProvider.ForceResendingToken token) {\n Log.d(TAG, \"onCodeSent:\" + verificationId);\n\n // Save verification ID and resending token so we can use them later\n mVerificationId = verificationId;\n mResendToken = token;\n\n // Update UI\n updateUI(STATE_CODE_SENT);\n }", "private static void verify(String code) throws IOException {\n URL obj = new URL(TOKEN_URL);\n HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();\n\n String urlParameters = \"grant_type=authorization_code&code=\" + code;\n\n //add request header\n con.setRequestMethod(\"POST\");\n con.setRequestProperty(\"Authorization\", \"Basic \" + new String(Base64.getEncoder().encode((CLIENT_KEY + \":\" + CLIENT_SECRET).getBytes())));\n con.setRequestProperty(\"Content-Length\", String.valueOf(urlParameters.length()));\n con.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\n con.setDoOutput(true);\n con.setDoInput(true);\n\n DataOutputStream output = new DataOutputStream(con.getOutputStream());\n output.writeBytes(urlParameters);\n output.close();\n DataInputStream input = new DataInputStream(con.getInputStream());\n\n generateAuthObject(input);\n }", "@WangZheng\n public void getChallengeCode(){\n try {\n sendMessage(\"getChallengeCodeCallBack\");\n } catch (Exception e) {\n dealWithException(e);\n }\n }", "public void enterPhoneAreaCode() throws IOException {\n\t\tLoginSignupCompanyPage sp = new LoginSignupCompanyPage(driver);\n\t\tlog.info(\"Verifying the Phone Area Code is available or not\");\n\t\tWaitClass.WaitForElementisDisplay(driver, 5, enterPhoneAreaCode);\n\t\tAssert.assertTrue(enterPhoneAreaCode.isDisplayed());\n\t\tenterPhoneAreaCode.sendKeys(BasePage.getCellData(xlsxName, sheetName, 8, 0));\n\n\t}", "public void receiveResultterminal_Code_Verify(\n com.xteam.tourismpay.PFTMXStub.Terminal_Code_VerifyResponse result) {\n }", "public static final String number2show(String phoneNumber) throws Exception {\n\t\tif (phoneNumber == null || phoneNumber.length() == 0) {\n\t\t\treturn phoneNumber;\n\t\t}\n\n\t\tboolean isIpCall = false;\n\n\t\tint lth = phoneNumber.length();\n\t\tif(lth >= CHINA_MOBILE_LDC.length()){\n\t\t\tif (phoneNumber.substring(0, 5).equals(CHINA_MOBILE_LDC)) {\n\t\t\t\tisIpCall = true;\n\n\t\t\t\tphoneNumber = phoneNumber.substring(5);\n\t\t\t}\n\t\t}\n\t\t//phone not encrypt yet, like 10086/955555 etc, it is not a cipher text\n\t\tif (phoneNumber.length() != CIPHER_FIXED_LENGTH) {\n\t\t\t//with '+'\n\t\t\tif (phoneNumber.length() != 22) {\n\t\t\t\tif (isIpCall) {\n\t\t\t\t\treturn CHINA_MOBILE_LDC + phoneNumber;\n\t\t\t\t}\n\t\t\t\treturn phoneNumber;\n\t\t\t} else {\n\t\t\t\t// with '+' maybe\n\t\t\t\t//TODO: strange here\n\t\t\t\tchar first = phoneNumber.charAt(0);\n\t\t\t\tif (first != '+') {\n\t\t\t\t\tif (isIpCall) {\n\t\t\t\t\t\treturn CHINA_MOBILE_LDC + phoneNumber;\n\t\t\t\t\t}\n\t\t\t\t\treturn phoneNumber;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn phoneNumber;\n\t\t}\n\t\tif (phoneNumber.charAt(0) == '+') {\n\t\t\tphoneNumber = phoneNumber.substring(1);\n\t\t}\n\t\t\n\t\t//TODO when input length is 21, can not know it is a \n\t\t//plain text or encrypt text\n\t\t//check the last two bit, if more than 19, return \n\t\tint length = phoneNumber.length();\n\t\tString twobitString = phoneNumber.substring(length - 2);\n\t\tint twobitInt = 0;\n\t\ttry{\n\t\t\ttwobitInt = Integer.parseInt(twobitString);\n\t\t}catch(Exception e){\n\t\t\treturn phoneNumber;\n\t\t}\n\t\t\n\t\tif(twobitInt > CIPHER_FIXED_LENGTH - LAST_TWO_BITS_INDICATOR){\n\t\t\treturn phoneNumber;\n\t\t}\n\t\t//do the real work, it is must the valid encrypt phone\n\t\tString body = unpadding(phoneNumber);\n\n\t\tString realPhone = show(body, TIMES);\n\t\tif (!isEmpty(realPhone) || realPhone.length() >= 2) {\n\t\t\tString with86 = realPhone.substring(0, 2);\n\n\t\t\tif (with86.equals(\"86\")) {\n\t\t\t\trealPhone = realPhone.substring(2);\n\t\t\t}\n\t\t}\n\n\t\tif (isIpCall) {\n\t\t\treturn CHINA_MOBILE_LDC + realPhone;\n\t\t}\n\t\treturn realPhone;\n\t}", "@Override\n public void onCodeSent(@NonNull String verificationId,\n @NonNull PhoneAuthProvider.ForceResendingToken token) {\n Log.d(TAG, \"onCodeSent:\" + verificationId);\n\n // Save verification ID and resending token so we can use them later\n mVerificationId = verificationId;\n mResendToken = token;\n }", "private void confirmCode(final String name,final String email1, final String number, final String password) {\n LayoutInflater li = LayoutInflater.from(this);\n //Creating a view to get the dialog box\n View confirmDialog = li.inflate(R.layout.dialog_confirm, null);\n\n //Initializing confirm button fo dialog box and edit text of dialog box\n buttonConfirm = (AppCompatButton) confirmDialog.findViewById(R.id.buttonConfirm);\n edCode = (EditText) confirmDialog.findViewById(R.id.editTextOtp);\n\n AlertDialog.Builder alert = new AlertDialog.Builder(this);\n\n //Adding our dialog box to the view of alert dialog\n alert.setView(confirmDialog);\n\n //Creating an alert dialog\n final AlertDialog alertDialog = alert.create();\n\n //Displaying the alert dialog\n alertDialog.show();\n\n //On the click of the confirm button from alert dialog\n buttonConfirm.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n //Hiding the alert dialog\n alertDialog.dismiss();\n\n //Displaying a progressbar\n //pDialog.show();\n\n //Getting the user entered otp from edittext\n final String code = edCode.getText().toString().trim();\n\n // RequestQueue requestQueue = Volley.newRequestQueue(Register.this);\n\n //Creating an string request\n StringRequest stringRequest = new StringRequest(Request.Method.POST,Config.registeracustomer,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n //if the server response is success\n if (response.equalsIgnoreCase(\"success\")) {\n //dismissing the progressbar\n //pDialog.dismiss();\n //Starting a new activity\n startActivity(new Intent(SignUpNewActivity.this, LoginActivity.class));\n\n } if (response.equalsIgnoreCase(\"failed\")){\n //Displaying a toast if the otp entered is wrong\n Toast.makeText(SignUpNewActivity.this, \"Wrong Code Please Try Again\", Toast.LENGTH_LONG).show();\n\n }\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n alertDialog.dismiss();\n Toast.makeText(SignUpNewActivity.this, error.getMessage(), Toast.LENGTH_LONG).show();\n }\n }) {\n @Override\n protected Map<String, String> getParams() throws AuthFailureError {\n Map<String, String> params = new HashMap<>();\n //Adding the parameters otp and username\n params.put(\"code\", code);\n params.put(\"full_name\", name);\n params.put(\"mobile_number\", number);\n params.put(\"password\", password);\n return params;\n\n }\n };\n //Adding the request to the queue\n MySingleton.getInstance(getApplicationContext()).addToRequestQueue(stringRequest);\n }\n });\n }", "@Override\n public boolean validateOTP(SmsCode smsCode) {\n Object principal = SecurityContextHolder.getContext().getAuthentication();\n SmsCodeDTO auth = (SmsCodeDTO) principal;\n// if (principal instanceof SmsCodeDTO) {\n// String phoneNumberKey = String.valueOf(auth.getPrincipal());\n//// int cachedOTP = this.getOTP(phoneNumberKey);\n// if (String.valueOf(cachedOTP).equals(smsCode.getCode())) {\n// this.clearOTP(String.valueOf(auth.getPrincipal()));\n// List<GrantedAuthority> grantedAuthorities = new ArrayList<GrantedAuthority>\n// (Collections.singleton(new SimpleGrantedAuthority(\"ROLE_USER\")));\n// SmsCodeDTO smsCodeDTO = new SmsCodeDTO(phoneNumberKey, auth.getOtp(), grantedAuthorities);\n// SecurityContextHolder.getContext().setAuthentication(smsCodeDTO);\n// return true;\n// } else {\n// return false;\n// }\n// } else return false;\n return false;\n }", "public MobileAuthResponse verifyMobileAuthRequestCode(MobileAuthRequest request){\t\t\r\n \t\t//\r\n \t\t// check status and user match\r\n \t\t//\r\n \t\tString authCode = request.getAuthCode();\r\n \t\trequest = this.mobileAuthRequestDao.get(request.getRequestId());\r\n \t\tif (request == null) {\r\n \t\t\tthrow new RentException(RentException.RentErrorCode.ErrorNotFound,\r\n \t\t\t\t\t\"request id not found in database\");\r\n \t\t}\r\n \t\r\n \t\tif (request.getStatus() != DeviceStatus.Authing.getStatus()\r\n \t\t\t\t&& request.getStatus() != DeviceStatus.Authed.getStatus()) {\r\n \t\t\tthrow new RentException(RentErrorCode.ErrorStatusViolate,\r\n \t\t\t\t\t\"request status isn't authing or authed but \" + request.getStatus());\r\n \t\t}\r\n \t\t//\r\n \t\t// check expire\r\n \t\t//\r\n \t\tMap<String,Object> setting = applicationConfig.get(\"general\");\r\n \tlong time=java.util.Calendar.getInstance().getTimeInMillis()/1000;\r\n \t\tint timeout = (Integer)setting.get(\"auth_verify_timeout\");\r\n \tif (time > request.getRequestTime() + timeout ) {\t\r\n \t\t\tthrow new RentException(RentErrorCode.ErrorAuthExpired,\r\n \t\t\t\t\t\"verify mobile auth code has been timeout\");\r\n \t}\t\t\r\n \t\tint retryLimit = (Integer)setting.get(\"auth_retry_limit\");\r\n \t\t//\r\n \t\t// check retry count\r\n \t\t//\r\n \t\tdontTryService.doTry(request.getRequestId(), DontTryType.Life,\r\n \t\t\t\tretryLimit);\r\n \t\t//\r\n \t\t// check auth code\r\n \t\t//\r\n \t\tString decryptToken = encodeUtility.decrypt(request.getToken(), Device.ENCRYPT_KEY);\r\n \t\tif (!authCode.equals(decryptToken)) {\r\n \t\t\tthrow new RentException(RentException.RentErrorCode.ErrorGeneral,\r\n \t\t\t\t\t\"token not match \"+decryptToken);\r\n \t\t}\r\n \t\t//\r\n \t\t// update user database\r\n \t\t//\r\n \t\tUser user = this.userDao.getUserByUserId(request.getUserId());\r\n \t\tif (user == null) {\r\n \t\t\tthrow new RentException(RentException.RentErrorCode.ErrorNotFound,\r\n \t\t\t\t\t\"user \" + request.getUserId() + \" not found\");\r\n \t\t}\r\n \t\tif (user.getStatus() == UserStatus.Init.getStatus()){\r\n \t\t\tlogger.debug(\"update user status to authed\");\r\n \t\t\tuser.setModified((long)0);\r\n \t\t\tuserDao.updateUserStatus(user.getId(), UserStatus.Authed.getStatus()\r\n \t\t\t\t\t, UserStatus.Init.getStatus(), user.getModified());\r\n \t\t}\r\n \t\t//\r\n \t\t// prepare response\r\n \t\t//\r\n \t\tMobileAuthResponse response = new MobileAuthResponse();\r\n \t\tresponse.setResponseTime(0);\r\n \t\tresponse.setUser(user);\r\n \t\tresponse.setStatus(DeviceStatus.Authed.getStatus());\r\n \t\tresponse.setRequestId(request.getRequestId());\r\n \t\t//\r\n \t\t// sign response\r\n \t\t//\r\n \t\tDevice requestFrom = this.deviceDao.getDeviceByDeviceIdAndUserId(\r\n \t\t\t\tIUserService.SSO_DEVICE_ID, request.getRequestFrom());\r\n \t\tif (requestFrom == null) {\r\n \t\t\tthrow new RentException(RentException.RentErrorCode.ErrorNotFound,\r\n \t\t\t\t\t\"request from user not found\");\r\n \t\t}\r\n \t\tString responseSign = EncodeUtility.sha1(response.toString(requestFrom.getToken()));\r\n \t\tresponse.setSign(responseSign);\r\n \t\t//\r\n \t\t// update mobile auth response into database.\r\n \t\t//\r\n \t\tthis.mobileAuthResponseDao.updateResponse(response);\r\n \t\treturn response;\r\n \t}", "public String getVerifyCode() {\r\n return verifyCode;\r\n }", "@And(\"^I enter the plenti phone number using mobile website$\")\n public void I_enter_the_plenti_phone_number_using_mobile_website() throws Throwable {\n TextBoxes.typeTextbox(Elements.element(\"plenti_enroll.phone_number\"), TestUsers.getuslCustomer(null).getUser().getProfileAddress().getBestPhone());\n }", "private HashMap<String,String> generateVerificationForSMS(HashMap<String, String> data){\n return null;\n }", "@Override\n public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {\n Log.d(TAG, \"onVerificationCompleted:\" + phoneAuthCredential);\n mVerificationInProgress = false;\n\n // Update the UI and attempt sign in with the phone credential\n updateUI(STATE_VERIFY_SUCCESS, phoneAuthCredential);\n signInWithPhoneAuthCredential(phoneAuthCredential);\n }", "public String createVerificationCode() {\n\t\tverification = VerificationCode.generateWord();\r\n\t\treturn verification;\r\n\t}", "private static String getContent(String sendCode) {\n\t\t\treturn \"【宇鑫科技】登录验证码:\"+sendCode+\",如非本人操作,请忽略此短信。\";\r\n\t\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n final Bundle bundle = intent.getExtras();\n boolean verify=false;\n try {\n if (bundle != null) {\n final Object[] pdusObj = (Object[]) bundle.get(\"pdus\");\n for (int i = 0; i < pdusObj.length; i++) {\n SmsMessage currentMessage = SmsMessage.createFromPdu((byte[]) pdusObj[i]);\n String message = currentMessage.getDisplayMessageBody();\n\n String[] inputSplitNewLine = message.split(\"\\\\n\");\n for (int j = 0; j < inputSplitNewLine.length; j++) {\n System.out.println(inputSplitNewLine[j]);\n if (inputSplitNewLine[j].contains(\"Your Zaparound verification code is\")) {\n String verifyCode = inputSplitNewLine[j].replaceAll(\"[^0-9]\", \"\");\n et_username.setText(verifyCode);\n verify=true;\n //Verify(new View(VerificationActivity.this));\n break;\n }\n }//end of for\n }//end of for\n if(verify)\n Verify(new View(VerificationActivity.this));\n }\n } catch (Exception e) {\n Log.e(\"SmsReceiver\", \"Exception smsReceiver\" + e);\n }\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tnew verify().execute(code.getText().toString(),String.valueOf(ID));\r\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic JSONObject getTelMessageCode(HttpServletRequest request) {\n\t\t\n\t\tJSONObject obj = new JSONObject();\n\t\tString tel = request.getParameter(\"tel\");\n\n\t\t//判断参数是否为空以及数字型参数格式是否正确\n\t\tif(ConfigUtil.isNull(tel)){\n\t\t\tobj.put(\"resultCode\",\"0001\");\n\t\t\treturn obj;\n\t\t}\n\t\t//发送短信并保存到数据库\n\t\tMessageInfo msg = new MessageInfo();\n\t\tString code = NumUtil.getRandomTelCode(6);\n\t\ttry{\n\t\t\tString str = \"注册校验码 :\" + code + \"请及时完成注册。\";\n\t\t\tif(MessageUtil.sendMessage(tel, str)){\n\t\t\t\tmsg.setTel(tel);\n\t\t\t\tmsg.setData(str);\n\t\t\t\tmsg.setType(0);\n\t\t\t\tmsg.setState(0);//默认可用\n\t\t\t\tinsert(msg);\n\t\t\t\tlog.info(\"send \"+ code +\" to \" + tel + \"suc .\");\n\t\t\t}else{\n\t\t\t\tlog.error(\"send \"+ code +\" to \" + tel + \"error .\");\n\t\t\t\tobj.put(\"resultCode\", \"0002\");\n\t\t\t\treturn obj;\n\t\t\t}\n\t\t}catch(Exception e){\n\t\t\tlog.error(\"insert essage error .\" + e.getMessage());\n\t\t}\n\t\tobj.put(\"msgCode\", code);\n\t\tobj.put(\"resultCode\",\"0000\");\n\t\treturn obj;\t\t\n\t}", "@Step\n public void waitUntilSmsCodeWillBeSent(){\n Utils.waitABit(3);\n actionWithWebElements.waitVisibilityOfElement(confirmationCodeFromSmsHeader);\n actionWithWebElements.waitVisibilityOfElement(confirmationSmsCodeInput);\n }", "public void signInWithCredential(PhoneAuthCredential credential) {\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(new OnCompleteListener<AuthResult> () {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\nemailVerificationProgressBar.setVisibility (View.GONE);\n new CallUtils ().uidSignUp (phoneNo, address, address, address, username, address, actionProfileVerificationInstance, getContext (), email, password);\n\n\n } else {\n emailVerificationProgressBar.setVisibility (View.GONE);\n Toast.makeText(getContext (), task.getException().getMessage(), Toast.LENGTH_LONG).show();\n }\n }\n });\n }", "public String Login(String phoneNum, String passwd) {\n return \"123\";\n }", "private static String smsCode() {\n\t\t\tString random=new Random().nextInt(1000000)+\"\";\r\n\t\t\treturn random;\r\n\t\t}", "public boolean verifyCode(int inputCode){\n \n if(confirmationCode == inputCode)\n return true;\n else\n return false;\n \n }", "public void setVerifyCode(String verifyCode) {\r\n this.verifyCode = verifyCode;\r\n }", "public void verifyCode(String code, String exchange_id, String verificationType, String requestId, String usageType, EventResult<LoginCredentialsResponseEntity> loginResult) {\n AuthenticateEntity authenticateEntity = new AuthenticateEntity(exchange_id, code, verificationType);\n LoginRequest loginRequest = new LoginRequest();\n loginRequest.setUsageType(usageType);\n PasswordlessLoginController.getShared(context).authenticateVerification(authenticateEntity, verificationType, requestId, loginRequest, loginResult);\n }", "private void signInWithCredential(PhoneAuthCredential credential) {\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // if the code is correct and the task is successful\n // we are sending our user to new activity.\n\n\n dialog.dismiss();\n startActivity(new Intent(MainActivity.this,Home.class));\n finish();\n\n } else {\n // if the code is not correct then we are\n // displaying an error message to the user.\n Toast.makeText(MainActivity.this, task.getException().getMessage(), Toast.LENGTH_LONG).show();\n }\n }\n });\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n\n\n code = intent.getStringExtra(SMSreceiver.CODE);\n System.out.println(\"got the code information\");\n if (code.length() == 4) {\n try {\n\n otp1.setText(String.valueOf(code).charAt(0));\n otp2.setText(String.valueOf(code.charAt(1)));\n otp3.setText(String.valueOf(code.charAt(2)));\n otp4.setText(String.valueOf(code.charAt(3)));\n SharedPreferences sharedpreferences = getSharedPreferences(\"buddyotp\", Context.MODE_PRIVATE);\n w = sharedpreferences.getInt(\"shareflow\", 1);\n }\n catch (Exception e)\n {}}}", "@Override\n\tvoid doSecondStep(String code) throws SmsException {\n\t\tString action = getElement(\"<form name=\\\"__aspnetForm\\\" method=\\\"post\\\" action=\\\"\", \"\\\"\");\n\t\tString postUrl = baseUrl + action;\n\t\t\n\t\t//Set input parameters:\n\t\tNameValuePair[] postParameters = {\n\t\t\tnew NameValuePair(\"__VIEWSTATE\", getElement(\"name=\\\"__VIEWSTATE\\\" value=\\\"\", \"\\\"\")),\n\t\t\tnew NameValuePair(\"SmsSender:PrePhone\", def),\n\t\t\tnew NameValuePair(\"SmsSender:phoneNumber\", phoneNumber),\n\t\t\tnew NameValuePair(\"SmsSender:smsText\", message),\n\t\t\tnew NameValuePair(\"SmsSender:code\", code),\n\t\t\tnew NameValuePair(\"SmsSender:Button1\", \"Отправить\") };\n\t\t\n\t\tpostData(postUrl, postParameters);\n\t\t\n\t}", "public interface IMessageAuthentication {\n void getMessageCode(String phone,IMessageAuth iMessageAuth);\n\n void submitMessageCode(String code,String phone,IMessageAuth iMessageAuth);\n\n //取消短信验证码注册\n void unRegisterMessage();\n\n}", "com.weizhu.proto.LoginProtos.SmsCode getSmsCode(int index);", "public void verifyOTP() {\n HashMap<String, String> commonParams = new CommonParams.Builder()\n .add(AppConstant.KEY_COUNTRY_CODE, mCountryCode)\n .add(AppConstant.KEY_PHONE, mPhoneno)\n .add(AppConstant.KEY_OTP, mOTP).build().getMap();\n ApiInterface apiInterface = RestClient.getApiInterface();\n apiInterface.userVerifyOTP(\"bearer\" + \" \" + CommonData.getAccessToken(), commonParams)\n .enqueue(new ResponseResolver<CommonResponse>(OtpActivity.this, true, true) {\n @Override\n public void success(final CommonResponse commonResponse) {\n Log.d(\"debug\", commonResponse.getMessage());\n\n }\n\n @Override\n public void failure(final APIError error) {\n Log.d(\"debug\", error.getMessage());\n\n }\n });\n }", "private void signInWithCredential(PhoneAuthCredential credential) {\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(task -> {\n if (task.isSuccessful()) {\n // register the phone no in the database\n registerUser(number);\n\n } else {\n Toast.makeText(MainActivity.this, Objects.requireNonNull(task.getException()).getMessage(), Toast.LENGTH_LONG).show();\n }\n });\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n // there are cases where the contact picker may end up sending us more than one\n // request. We want to ignore the request if we're not in the correct state.\n if (requestCode == VOICEMAIL_PROVIDER_CFG_ID) {\n if (resultCode != RESULT_OK) {\n if (DBG) log(\"onActivityResult: vm provider cfg result not OK.\");\n return;\n }\n if (data == null) {\n if (DBG) log(\"onActivityResult: vm provider cfg result has no data\");\n return;\n }\n String vmNum = data.getStringExtra(VM_NUMBER_EXTRA);\n if (vmNum == null) {\n if (DBG) log(\"onActivityResult: vm provider cfg result has no vmnum\");\n return;\n }\n saveVoiceMailNumber(vmNum);\n return;\n }\n \n if (resultCode != RESULT_OK) {\n if (DBG) log(\"onActivityResult: contact picker result not OK.\");\n return;\n }\n \n Cursor cursor = getContentResolver().query(data.getData(),\n NUM_PROJECTION, null, null, null);\n if ((cursor == null) || (!cursor.moveToFirst())) {\n if (DBG) log(\"onActivityResult: bad contact data, no results found.\");\n return;\n }\n \n switch (requestCode) {\n case VOICEMAIL_PREF_ID:\n mSubMenuVoicemailSettings.onPickActivityResult(cursor.getString(0));\n break;\n default:\n // TODO: may need exception here.\n }\n }", "public void onNextClicked(View v) {\n // TODO: format phone number\n final String email = etEmail.getText().toString();\n final String mobile = etMobile.getText().toString();\n final String password = etPassword.getText().toString();\n\n if (email.isEmpty() || mobile.isEmpty() || password.isEmpty()) {\n Toast.makeText(this, \"Please complete the form\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n if (password.length() < 5) {\n Toast.makeText(this, \"Password must have at least 5 characters\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n if (!DeviceUtil.hasConnection(this)) {\n Toast.makeText(this, \"No Internet connection\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n final IdentityVerifier identityVerifier = new IdentityVerifier(this, new IdentityVerifier.ResultCallback() {\n @Override\n public void handleResult(int result) {\n if (result == IdentityVerifier.RESULT_PASS) {\n clearError();\n goToCreateProfile(email, mobile, password);\n } else {\n showError(result);\n }\n }\n\n @Override\n public void handleFault(ParseException fault) {\n if (fault != null) {\n Logger.e(TAG, fault.getMessage());\n Toast.makeText(RegisterActivity.this, fault.getMessage(), Toast.LENGTH_SHORT).show();\n }\n }\n });\n\n identityVerifier.verify(email, mobile);\n }", "public String createRegisterVerificationCode() {\n\t\tregisterVerification = VerificationCode.generateWord();\r\n\t\treturn registerVerification;\r\n\t}", "@Override\r\n public void onClick(View v) {\r\n try {\r\n InputMethodManager imm = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);\r\n imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);\r\n } catch (Exception e) {\r\n // TODO: handle exception\r\n }\r\n\r\n otp = OTP_ET_1.getText().toString() +\r\n OTP_ET_2.getText().toString() + OTP_ET_3.getText().toString() +\r\n OTP_ET_4.getText().toString();\r\n if (otp.equals(\"null\")||otp.isEmpty()||otp.length()<4){\r\n Toast.makeText(ThirdActivity.this, \"Please enter OTP\", Toast.LENGTH_SHORT).show();\r\n return;\r\n }\r\n\r\n HashMap<String, String> params = new HashMap<>();\r\n params.put(\"action\", \"verifyOtp\");\r\n params.put(\"center_id\", centreId);\r\n params.put(\"otp\", otp);\r\n params.put(\"mobile\", number);\r\n progressDialog.show();\r\n apiCall.sendData(Request.Method.POST, OTP_VERIFY, params, \"sendOtp\");\r\n\r\n }" ]
[ "0.78353745", "0.7744453", "0.7704671", "0.7639931", "0.7581702", "0.7501231", "0.7390606", "0.7349715", "0.7342952", "0.7306408", "0.72993594", "0.7265084", "0.7263813", "0.7158405", "0.7154066", "0.6855513", "0.6804123", "0.6795792", "0.6763582", "0.6738477", "0.6704396", "0.6704125", "0.66979235", "0.66619474", "0.6631418", "0.65603435", "0.6422473", "0.6400847", "0.6400847", "0.6400847", "0.6400847", "0.63955736", "0.63145316", "0.63012636", "0.62766355", "0.626274", "0.6251154", "0.6249677", "0.6247486", "0.6212916", "0.62070376", "0.619703", "0.6152404", "0.61267155", "0.6120166", "0.6111683", "0.60988617", "0.60903263", "0.6088388", "0.60583425", "0.6053548", "0.60048205", "0.60048157", "0.5998544", "0.59335506", "0.59119046", "0.5900223", "0.59001493", "0.5893508", "0.5893019", "0.5866724", "0.5811547", "0.57746756", "0.57632166", "0.5745661", "0.56978816", "0.56924206", "0.56609184", "0.56599236", "0.5647917", "0.56439644", "0.56269217", "0.56267744", "0.5617253", "0.55819935", "0.5580915", "0.55720055", "0.55712736", "0.5571051", "0.5548597", "0.55478096", "0.5540251", "0.55299044", "0.5529686", "0.55240035", "0.55036575", "0.54938245", "0.54917955", "0.5486152", "0.5485401", "0.5485288", "0.54811054", "0.5471577", "0.54689544", "0.5463627", "0.54531676", "0.54489833", "0.5445426", "0.54432297", "0.54368484" ]
0.6289761
34
Creates a new instance of UpgradeData
public UpgradeData(int c) { super(); JLabel l; // GridLayout grid; JPanel pan; JButton val; confignb = c; String fichier; NumberFormatter formatter = new NumberFormatter(new DecimalFormat("0")); formatter.setAllowsInvalid(false); try { sz_rss = new JFormattedTextField((NumberFormatter) formatter.clone()); sz_fleet = new JFormattedTextField((NumberFormatter) formatter.clone()); sz_def = new JFormattedTextField((NumberFormatter) formatter.clone()); sz_bld = new JFormattedTextField((NumberFormatter) formatter.clone()); sz_techno = new JFormattedTextField((NumberFormatter) formatter.clone()); } catch (Exception e) { sz_rss = new JTextField(); sz_fleet = new JTextField(); sz_def = new JTextField(); sz_bld = new JTextField(); sz_techno = new JTextField(); } this.setLayout(new BorderLayout()); Configuration configC = null; Configuration configL = null; try { configC = new Configuration("config.ini"); fichier = "lang_" + configC.getConfig("active_language") + ".ini"; configL = new Configuration(fichier); this.add(l = new JLabel("<html><center><font color='#FF0000'><u>" + configL.getConfig("color24") + ":</u></font></center></html>"), BorderLayout.NORTH); l.setHorizontalAlignment(JLabel.CENTER); pan = new JPanel(); pan.setLayout(new BorderLayout()); sl_rss = newJTextField("ER_GOODS"); sl_fleet = newJTextField("ER_FLEET"); sl_def = newJTextField("ER_DEFENCES"); sl_bld = newJTextField("ER_BUILDINGS"); sl_techno = newJTextField("ER_TECHNO"); final JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); tabbedPane.addTab(configL.getConfig("ER_RESS"), null, newpart(sz_rss, sl_rss, configC.getConfig("user_sz_rss" + c), "ER_GOODS")); tabbedPane.addTab(configL.getConfig("ER_FLT"), null, newpart(sz_fleet, sl_fleet, configC.getConfig("user_sz_fleet" + c), "ER_FLEET")); tabbedPane.addTab(configL.getConfig("ER_DEF"), null, newpart(sz_def, sl_def, configC.getConfig("user_sz_def" + c), "ER_DEFENCES")); tabbedPane.addTab(configL.getConfig("ER_BLD"), null, newpart(sz_bld, sl_bld, configC.getConfig("user_sz_def" + c), "ER_BUILDINGS")); tabbedPane.addTab(configL.getConfig("ER_THN"), null, newpart(sz_techno, sl_techno, configC.getConfig("user_sz_def" + c), "ER_TECHNO")); pan.add(tabbedPane); this.add(pan, BorderLayout.CENTER); this.add(val = new JButton(configL.getConfig("validate_button")), BorderLayout.SOUTH); val.addActionListener(this); val.setIcon(new ImageIcon(this.getClass().getResource("images/valid.png"))); } catch (final Exception e) { ExceptionAlert.createExceptionAlert(e); e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected VersionData() {}", "public DataMigration(int version) {\n super(MigrationType.DATA, version);\n }", "public ReportVersionData() {\n this(\"report_version_data\", null);\n }", "public void init() {\r\n\t\tdbVersion = new DBVersion( getDefaultDatabase(), progress, upgradeFile.versionTableName, upgradeFile.logTableName );\r\n\t}", "DataPackage createDataPackage();", "public void onUpgrade() {\r\n\t\t// Create New table\r\n\t\tDataBaseCreatorTable newt = new DataBaseCreatorTable();\r\n\t\t// Update Table Items\r\n\t\tcreatorClass.onCreate(newt);\r\n\t\t// Update Data Base\r\n\t\t//...\r\n\t\ttable = newt;\r\n\t}", "public AppData() {\n super(0,Entry.DataColumn.values().length);\n setColumnIdentifiers(Arrays.stream(Entry.DataColumn.values()).map(Entry.DataColumn::getName).toArray());\n System.out.println(\"a new AppData has been constructed\");\n }", "CreationData creationData();", "public InternalData createInternalData2() {\r\n return new InternalData(); // returns data which is not exported from Module modb\r\n }", "public CreateData() {\n\t\t\n\t\t// TODO Auto-generated constructor stub\n\t}", "public TradeData() {\r\n\r\n\t}", "public InitialData(){}", "public RegisterNewData() {\n }", "public Data() {}", "public abstract void upgrade();", "@Override\n public void upgrade() {\n log.trace(\">upgrade\");\n if (Float.compare(LATEST_VERSION, getVersion()) != 0) {\n // Does nothing currently\n data.put(VERSION, new Float(LATEST_VERSION));\n }\n log.trace(\"<upgrade\");\n }", "public ChangeData()\r\n\t\t{\r\n\t\t}", "protected abstract D createData();", "public ProductImpl(ActivationID id, MarshalledObject data) \n throws RemoteException, IOException, ClassNotFoundException\n { \n super(id, 0);\n name = (String) data.get();\n System.out.println(\"Constructed \" + name);\n }", "public Object create( DataWrapper data) {\n return LoadManager.getItem(data.getString(\"type\"),data.getName());\n }", "public Data() {\n }", "public Data() {\n }", "public DataManager() {\n\t\tthis(PUnit == null ? \"eElectionsDB\" : PUnit);\n\t}", "@Override\n\t@SystemSetup(extension = FrameitcoreConstants.EXTENSIONNAME, process = Process.ALL, type = Type.ESSENTIAL)\n\tpublic void createEssentialData() {\n\t\t// Import essential data\n\t\tLOG.info(\"Importing essential data...\");\n\n\t\tsuper.importData(\"/essentialData/countries.impex\");\n\n\t\tLOG.info(\"Essential data import complete.\");\n\t}", "public ItemData(String androidVersionName) {\n AndroidVersionName = androidVersionName;\n }", "public Builder setData(final Version2e.Data value) {\n _data = value;\n return this;\n }", "public Data() {\n \n }", "public void setUpgrade(UpgradeEntity upgrade) {\n this.upgrade = upgrade;\n }", "public static DataModelBuilder create() {\n return new DataModelBuilder();\n }", "public mainData() {\n }", "public abstract void doUpgrade();", "public abstract DataType<T> newInstance();", "protected VendorCheck createVendorCheck() {\r\n VendorCheck vendorCheck = new VendorCheck();\r\n vendorCheck.setVendorCheckId(new Long(99999));\r\n return vendorCheck;\r\n }", "DataType createDataType();", "public DataModel()\r\n {\r\n System.out.println(\"New DataModel created\");\r\n \r\n languageList = new LanguageList();\r\n }", "@Override\n\tpublic boolean upgrade() {\n\t\treturn true;\n\t}", "public UserData() {\n }", "public void setUpgradeFile( UpgradeFile file ) {\r\n\t\tupgradeFile = file;\r\n\t}", "private void initData() {\n\n }", "private TradeForDataGen initializeData(String type,String t,String securityName,String securityType, int quantity, double price, String traderName, String brokerName) {\n\t\tTradeForDataGen tempTrade = new TradeForDataGen();\n\t\tTimestamp timestamp = Timestamp.valueOf(t);\n\t\ttempTrade.setType(type);\n\t\ttempTrade.setTimestamp(timestamp);\n\t\ttempTrade.setQuantity(quantity);\n\t\ttempTrade.setBrokerName(brokerName);\n\t\ttempTrade.setPrice(price);\n\t\ttempTrade.setSecurityName(securityName);\n\t\ttempTrade.setTraderName(traderName);\n\t\ttempTrade.setSecurityType(securityType);\n\t\treturn tempTrade;\n\t}", "public ApplicationReleaseData(){\r\n }", "@Override()\n protected RelationshipData createNewData(final String _name)\n {\n return new RelationshipData(this, _name);\n }", "DataElement createDataElement();", "@SuppressFBWarnings(\"HARD_CODE_PASSWORD\")\n public PSPluginResponse process(IPSUpgradeModule config, Element elemData)\n {\n FileInputStream in = null;\n String bkptablename = \"RXSYSCOMPONENTPROPERTY\" +\n PSJdbcPlanBuilder.BACKUP_SUFFIX;\n Connection conn = null;\n try\n {\n in = new FileInputStream(new File(RxUpgrade.getRxRoot() +\n File.separator + config.REPOSITORY_PROPFILEPATH));\n Properties props = new Properties();\n props.load(in);\n props.setProperty(PSJdbcDbmsDef.PWD_ENCRYPTED_PROPERTY, \"Y\");\n PSJdbcDbmsDef dbmsDef = new PSJdbcDbmsDef(props);\n PSJdbcDataTypeMap dataTypeMap =\n new PSJdbcDataTypeMap(props.getProperty(\"DB_BACKEND\"),\n props.getProperty(\"DB_DRIVER_NAME\"), null);\n conn = RxLogTables.createConnection(props);\n\n Document propsDoc = PSUpgradePluginGeneralTables.getTableDataDoc(conn,\n dbmsDef, dataTypeMap, bkptablename);\n if(propsDoc == null)\n {\n config.getLogStream().println(\"Could not extract data out \"\n + \"of \" + bkptablename + \" table\");\n config.getLogStream().println(\"Table upgrade aborted\");\n return null;\n }\n\n NodeList propRows = propsDoc.getElementsByTagName(\"row\");\n if(propRows == null || propRows.getLength() < 1)\n {\n config.getLogStream().println(\n \"No data in \" + bkptablename + \" table\");\n config.getLogStream().println(\"Table upgrade aborted\");\n return null;\n }\n\n Element elem = null;\n Element temp = null;\n String value = null;\n Text text = null;\n for(int i=0; i<propRows.getLength(); i++)\n {\n elem = (Element)propRows.item(i);\n //Add column PROPERTYID\n temp = propsDoc.createElement(\"column\");\n temp.setAttribute(\"name\", \"PROPERTYID\");\n try\n {\n value = Integer.toString(i+1);\n }\n catch(Throwable t)\n {\n }\n text = propsDoc.createTextNode(value);\n temp.appendChild(text);\n elem.appendChild(temp);\n }\n PSJdbcTableSchema tableSchema = null;\n tableSchema = PSJdbcTableFactory.catalogTable(conn, dbmsDef,\n dataTypeMap, \"RXSYSCOMPONENTPROPERTY\", true);\n if(tableSchema == null)\n {\n config.getLogStream().println(\n \"null value for tableSchema RXSYSCOMPONENTPROPERTY table\");\n config.getLogStream().println(\"Table upgrade aborted\");\n return null;\n }\n\n propsDoc.getDocumentElement().setAttribute(\"onCreateOnly\", \"no\");\n PSJdbcTableData tableData =\n new PSJdbcTableData(propsDoc.getDocumentElement());\n tableSchema.setTableData(tableData);\n\n PSJdbcTableFactory.processTable(\n conn, dbmsDef, tableSchema, config.getLogStream(), false);\n }\n catch(Exception e)\n {\n e.printStackTrace(config.getLogStream());\n }\n finally\n {\n try\n {\n if(in != null)\n {\n in.close();\n in =null;\n }\n }\n catch(Throwable t)\n {\n }\n if (conn != null)\n {\n try\n {\n conn.close();\n }\n catch (SQLException e)\n {\n }\n conn = null;\n }\n }\n config.getLogStream().println(\"leaving the process() of the plugin...\");\n return null;\n }", "private void initData() {\n }", "public static void initGenerateOfflineTestData(){\n dbInstance = Database.newInstance();\n initPlayer();\n initMatches();\n }", "public void initData() {\n }", "public void initData() {\n }", "private Builder() {\n super(baconhep.TTau.SCHEMA$);\n }", "private void initData() {\n\t}", "public AddonInstaller() {\n \n }", "@SuppressWarnings(\"unused\")\n\tprivate LedgerInitProposalData() {\n\t}", "static RodUpgrades newInstance(int num) {\n RodUpgrades f = new RodUpgrades();\n\n return f;\n }", "public SensorData() {\n\n\t}", "public interface IUpgradeDataParser\n{\n public static final int MODE_NOT_YET = 0;\n\n public static final int MODE_PROMPT = 1;\n\n public static final int MODE_FORCE = 2;\n\n public static final int MODE_INVALID = -1;\n\n int getUpgradeMode(JSONObject upgradeData);\n\n String getUpgradeDescription(JSONObject upgradeData);\n\n String getUpgradeLatestVersoin(JSONObject upgradeData);\n\n String getUpgradePackageUrl(JSONObject upgradeData);\n\n String getUpgradeOptions(JSONObject upgradeData);\n\n}", "private void initData() {\n\t\tnamesInfo = new NameSurferDataBase(fileName);\n\n\t}", "public hu.blackbelt.epsilon.runtime.model.test1.data.DataModel build() {\n final hu.blackbelt.epsilon.runtime.model.test1.data.DataModel _newInstance = hu.blackbelt.epsilon.runtime.model.test1.data.DataFactory.eINSTANCE.createDataModel();\n if (m_featureNameSet) {\n _newInstance.setName(m_name);\n }\n if (m_featureEntitySet) {\n _newInstance.getEntity().addAll(m_entity);\n } else {\n if (!m_featureEntityBuilder.isEmpty()) {\n for (hu.blackbelt.epsilon.runtime.model.test1.data.util.builder.IDataBuilder<? extends hu.blackbelt.epsilon.runtime.model.test1.data.Entity> builder : m_featureEntityBuilder) {\n _newInstance.getEntity().add(builder.build());\n }\n }\n }\n return _newInstance;\n }", "private void initData(){\n\n }", "public \n OfflineExtFactory\n (\n String workUser, \n TreeMap<String,TreeSet<VersionID>> versions\n ) \n {\n super(workUser, versions); \n }", "@Override\n\tpublic Legacydb create(long legacydbid) {\n\t\tLegacydb legacydb = new LegacydbImpl();\n\n\t\tlegacydb.setNew(true);\n\t\tlegacydb.setPrimaryKey(legacydbid);\n\n\t\treturn legacydb;\n\t}", "org.landxml.schema.landXML11.CrashDataDocument.CrashData addNewCrashData();", "public TestDataBean() {\n\t}", "@Override\n protected void initData() {\n }", "@Override\n protected void initData() {\n }", "@Override\n\t\tpublic void onCreate(SQLiteDatabase db) {\n\t\t\tEventData.create(db);\n\t\t\tTriggerData.create(db);\n\t\t\tHostData.create(db);\n\t\t\tHostGroupData.create(db);\n\t\t\tItemData.create(db);\n\t\t\tApplicationData.create(db);\n\t\t\tCacheData.create(db);\n\t\t\tApplicationItemRelationData.create(db);\n\t\t\tHistoryDetailData.create(db);\n\t\t\tScreenData.create(db);\n\t\t\tScreenItemData.create(db);\n\t\t\tGraphData.create(db);\n\t\t\tGraphItemData.create(db);\n\t\t}", "public static DataFactory init() {\n\t\ttry {\n\t\t\tDataFactory theDataFactory = (DataFactory)EPackage.Registry.INSTANCE.getEFactory(DataPackage.eNS_URI);\n\t\t\tif (theDataFactory != null) {\n\t\t\t\treturn theDataFactory;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception exception) {\n\t\t\tEcorePlugin.INSTANCE.log(exception);\n\t\t}\n\t\treturn new DataFactoryImpl();\n\t}", "@Override\n\tprotected void initData(){\n\t\tsuper.initData();\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}", "private createSingletonDatabase()\n\t{\n\t\tConnection conn = createDatabase();\n\t\tcreateTable();\n\t\tString filename = \"Summer expereince survey 2016 for oliver.csv\"; \n\t\timportData(conn, filename);\n\t}", "@Override\n\tpublic void getDatas() {\n\t\tAutoUpdate autoUpdate=new AutoUpdate();\n\t\tautoUpdate.getVersionData(this, \"0\");\n\t}", "public ReportVersionData(String alias) {\n this(alias, REPORT_VERSION_DATA);\n }", "@Override\n\tpublic void initData() {\n\n\n\n\t}", "public VersionModel() {\n }", "public RecipeData(LuaTable t) {\n this.ingredients = LuaUtil.getList(t, \"ingredients\", Ingredient::new);\n if (this.ingredients.isEmpty()) {\n throw new RuntimeException();\n }\n\n LuaValue result = t.rawget(\"result\");\n LuaValue results = t.rawget(\"results\");\n if (result.isnil() && results.istable()) {\n this.results = LuaUtil.getList(t, \"results\", Product::new);\n } else if (result.isstring() && results.isnil()) {\n this.results = List.of(new Product(result.checkjstring(), LuaUtil.getInt(t, \"result_count\", 1)));\n } else {\n throw new RuntimeException();\n }\n if (this.results.isEmpty()) {\n throw new RuntimeException();\n }\n\n this.time = LuaUtil.getBigRational(t, \"energy_required\", BigRationalConstants.ONE_OVER_TWO);\n this.allowDecomposition = LuaUtil.getBoolean(t, \"allow_decomposition\", true);\n }", "public UpgradeSignatureRequest() {\n }", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "private void InitData() {\n\t}", "Udt createUdt();", "protected @Override\r\n abstract void initData();", "public LiveBusData() {\n mData = NOT_SET;\n mVersion = START_VERSION;\n }", "public MoreVersionsAdapter(List<ParseObject> data, Activity context) {\n mData = data;\n appcontext = context;\n }", "private static Version createNewVersion(Version.VERSION_TYPE versionType, String username, String description,\r\n String oldVersionName) {\r\n Version version = new Version();\r\n String newVersionName = version.getNewVersionName(oldVersionName, versionType);\r\n\r\n version.setVersion(newVersionName);\r\n version.setVersionComment(description);\r\n version.setVersionDate(DateBean.toCompactString());\r\n version.setVersionUser(username);\r\n\r\n return version;\r\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}", "public static EpitrelloDataServerice creator() {\n\t\tif(dataServerice == null) {\n\t\t\tdataServerice = new DataService();\n\t\t}\n\t\treturn dataServerice;\n\t}", "public void makeData() {\n\t\tFile file = null;\r\n try {\r\n if (!m.getDataFolder().exists()) { //Check if the directory of the plugin exists...\r\n \tm.getDataFolder().mkdirs(); //If not making one.\r\n }\r\n file = new File(m.getDataFolder(), \"data.yml\"); // Defining file to data.yml NOTE: This file has to be also in your Project, even if it's empty.\r\n if (!file.exists()) { //Check if it exists\r\n \tm.getLogger().info(\"data.yml not found, creating!\"); //Log that it is creating\r\n \tm.saveResource(\"data.yml\", true); //Saving the resource, This is all by Java done no Spigot noeeded. \r\n } else {\r\n \tm.getLogger().info(\"data.yml found, loading!\"); //If it is already there, load it.\r\n \t//TODO: Loading...\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();//If something returned a NPE or something it will print a stacktrace...\r\n }\r\n\t}", "public static TransitDataMapFragment newInstance() {\n Bundle bundle = new Bundle();\n TransitDataMapFragment mapFragment = new TransitDataMapFragment();\n mapFragment.setArguments(bundle);\n return mapFragment;\n }", "@Override\r\n\tpublic void initData() {\n\t}", "static SchemaBuilder newInstance() {\n return new SchemaBuilderImpl();\n }", "public void createDataStore (){\n\t\tcloseActiveStoreData ();\n\t\tif (_usablePersistenceManager){\n\t\t\tclosePersistence ();\n\t\t}\n\t\tsetDatastoreProperties ();\n\t\tthis.pm = DataStoreUtil.createDataStore (getDataStoreEnvironment (), true);\n\t\t_usablePersistenceManager = true;\n\t}", "public DesastreData() { //\r\n\t}", "@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)\n {\n if(newVersion > oldVersion){\n try {\n this.dbCreate();\n }catch (Exception e){\n e.printStackTrace();\n }\n }\n }", "public DataFactoryImpl() {\n\t\tsuper();\n\t}", "public void initAfterUnpersistence() {\n //From a legacy bundle\n if (sources == null) {\n sources = Misc.newList(getName());\n }\n super.initAfterUnpersistence();\n openData();\n }" ]
[ "0.63204193", "0.6075206", "0.57975286", "0.54515153", "0.5362934", "0.5286586", "0.5277172", "0.52296853", "0.5228756", "0.51951396", "0.5147757", "0.5147555", "0.51216644", "0.51106703", "0.5075847", "0.5036384", "0.5024973", "0.50139636", "0.49913493", "0.4965204", "0.4961464", "0.4961464", "0.4952329", "0.49394903", "0.49388996", "0.49377882", "0.49262762", "0.4924659", "0.49139264", "0.4905873", "0.49034694", "0.4888547", "0.48651287", "0.48555702", "0.48553023", "0.4822917", "0.48120815", "0.47989967", "0.479482", "0.47941285", "0.4788602", "0.47884086", "0.4785313", "0.4762901", "0.47600335", "0.47587606", "0.475763", "0.475763", "0.47279507", "0.47100058", "0.47083446", "0.4686825", "0.46727234", "0.46673402", "0.46658236", "0.46644792", "0.46578524", "0.46547967", "0.46541426", "0.46529797", "0.46446076", "0.46238402", "0.46181127", "0.46181127", "0.46153536", "0.46151116", "0.46137938", "0.4611827", "0.4611827", "0.4611827", "0.4609337", "0.46082586", "0.46036744", "0.4592129", "0.45916992", "0.45890158", "0.4585676", "0.45848617", "0.45848617", "0.45828694", "0.4581489", "0.4580698", "0.457703", "0.4576215", "0.45726234", "0.457261", "0.457261", "0.457261", "0.457261", "0.457261", "0.457261", "0.45712137", "0.45706573", "0.45681053", "0.45667413", "0.45605534", "0.4557936", "0.45568642", "0.45556995", "0.45511752", "0.45508885" ]
0.0
-1
Use this factory method to create a new instance of this fragment using the provided parameters.
public static Add_simple_dish newInstance(String param1, String param2) { Add_simple_dish fragment = new Add_simple_dish(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static FragmentTousWanted newInstance() {\n FragmentTousWanted fragment = new FragmentTousWanted();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "protected abstract Fragment createFragment();", "public void createFragment() {\n\n }", "@Override\n protected Fragment createFragment() {\n Intent intent = getIntent();\n\n long id = intent.getLongExtra(MovieDetailFragment.EXTRA_ID, -1);\n return MovieDetailFragment.newInstance(id);\n }", "public CuartoFragment() {\n }", "public StintFragment() {\n }", "public ExploreFragment() {\n\n }", "public RickAndMortyFragment() {\n }", "public FragmentMy() {\n }", "public LogFragment() {\n }", "public FeedFragment() {\n }", "public HistoryFragment() {\n }", "public HistoryFragment() {\n }", "public static MyFeedFragment newInstance() {\n return new MyFeedFragment();\n }", "public WkfFragment() {\n }", "public static ScheduleFragment newInstance() {\n ScheduleFragment fragment = new ScheduleFragment();\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 ProfileFragment(){}", "public WelcomeFragment() {}", "public static ForumFragment newInstance() {\n ForumFragment fragment = new ForumFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n\n return fragment;\n }", "public static NotificationFragment newInstance() {\n NotificationFragment fragment = new NotificationFragment();\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 progFragment() {\n }", "public HeaderFragment() {}", "public static RouteFragment newInstance() {\n RouteFragment fragment = new RouteFragment();\n Bundle args = new Bundle();\n //fragment.setArguments(args);\n return fragment;\n }", "public EmployeeFragment() {\n }", "public Fragment_Tutorial() {}", "public NewShopFragment() {\n }", "public FavoriteFragment() {\n }", "public static MyCourseFragment newInstance() {\n MyCourseFragment fragment = new MyCourseFragment();\r\n// fragment.setArguments(args);\r\n return fragment;\r\n }", "public static MessageFragment newInstance() {\n MessageFragment fragment = new MessageFragment();\n Bundle args = new Bundle();\n\n fragment.setArguments(args);\n return fragment;\n }", "public static ReservationFragment newInstance() {\n\n ReservationFragment _fragment = new ReservationFragment();\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 CreateEventFragment() {\n // Required empty public constructor\n }", "public static RecipeListFragment newInstance() {\n RecipeListFragment fragment = new RecipeListFragment();\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 static Fragment newInstance() {\n\t\treturn new ScreenSlidePageFragment();\n\t}", "public NoteActivityFragment() {\n }", "public static WeekViewFragment newInstance(int param1, int param2) {\n WeekViewFragment fragment = new WeekViewFragment();\n //WeekViewFragment 객체 생성\n Bundle args = new Bundle();\n //Bundle 객체 생성\n args.putInt(ARG_PARAM1, param1);\n //ARG_PARAM1에 param1의 정수값 넣어서 args에 저장\n args.putInt(ARG_PARAM2, param2);\n //ARG_PARAM2에 param2의 정수값 넣어서 args에 저장\n fragment.setArguments(args);\n //args를 매개변수로 한 setArguments() 메소드 수행하여 fragment에 저장\n return fragment; //fragment 반환\n }", "public static Fragment0 newInstance(String param1, String param2) {\n Fragment0 fragment = new Fragment0();\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 static QueenBEmbassyF newInstance() {\n QueenBEmbassyF fragment = new QueenBEmbassyF();\n //the way to pass arguments between fragments\n Bundle args = new Bundle();\n\n fragment.setArguments(args);\n return fragment;\n }", "public static Fragment newInstance() {\n StatisticsFragment fragment = new StatisticsFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "public EventHistoryFragment() {\n\t}", "public HomeFragment() {}", "public PeopleFragment() {\n // Required empty public constructor\n }", "public static FeedFragment newInstance() {\n FeedFragment fragment = new FeedFragment();\n return fragment;\n }", "public static MainFragment newInstance(String param1, String param2) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "public VantaggiFragment() {\n // Required empty public constructor\n }", "public AddressDetailFragment() {\n }", "public ArticleDetailFragment() { }", "public static DropboxMainFrag newInstance() {\n DropboxMainFrag fragment = new DropboxMainFrag();\n // set arguments in Bundle\n return fragment;\n }", "public RegisterFragment() {\n }", "public EmailFragment() {\n }", "public static CommentFragment newInstance() {\n CommentFragment fragment = new CommentFragment();\n\n return fragment;\n }", "public static FragmentComida newInstance(String param1) {\n FragmentComida fragment = new FragmentComida();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n fragment.setArguments(args);\n return fragment;\n\n\n }", "public static ParqueosFragment newInstance() {\n ParqueosFragment fragment = new ParqueosFragment();\n return fragment;\n }", "public ForecastFragment() {\n }", "public FExDetailFragment() {\n \t}", "public static AddressFragment newInstance(String param1) {\n AddressFragment fragment = new AddressFragment();\n\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n fragment.setArguments(args);\n\n return fragment;\n }", "public TripNoteFragment() {\n }", "public ItemFragment() {\n }", "public NoteListFragment() {\n }", "public CreatePatientFragment() {\n\n }", "public DisplayFragment() {\n\n }", "public static frag4_viewcompliment newInstance(String param1, String param2) {\r\n frag4_viewcompliment fragment = new frag4_viewcompliment();\r\n Bundle args = new Bundle();\r\n args.putString(ARG_PARAM1, param1);\r\n args.putString(ARG_PARAM2, param2);\r\n fragment.setArguments(args);\r\n return fragment;\r\n }", "public static fragment_profile newInstance(String param1, String param2) {\n fragment_profile fragment = new fragment_profile();\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 }", "@Override\n\tprotected Fragment createFragment() {\n\t\treturn new FormFragment();\n\t}", "public static MainFragment newInstance() {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "public ProfileFragment() {\n\n }", "public BackEndFragment() {\n }", "public CustomerFragment() {\n }", "public static FriendsFragment newInstance(int sectionNumber) {\n \tFriendsFragment fragment = new FriendsFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public ArticleDetailFragment() {\n }", "public ArticleDetailFragment() {\n }", "public ArticleDetailFragment() {\n }", "public static Fragment newInstance() {\n return new SettingsFragment();\n }", "public SummaryFragment newInstance()\n {\n return new SummaryFragment();\n }", "public PeersFragment() {\n }", "public TagsFragment() {\n }", "public static ProfileFragment newInstance() {\n ProfileFragment fragment = new ProfileFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, \"\");\n args.putString(ARG_PARAM2, \"\");\n fragment.setArguments(args);\n return fragment;\n }", "public static FriendsFragment newInstance() {\n FriendsFragment fragment = new FriendsFragment();\n\n return fragment;\n }", "public HomeSectionFragment() {\n\t}", "public static FirstFragment newInstance(String text) {\n\n FirstFragment f = new FirstFragment();\n Bundle b = new Bundle();\n b.putString(\"msg\", text);\n\n f.setArguments(b);\n\n return f;\n }", "public PersonDetailFragment() {\r\n }", "public static LogFragment newInstance(Bundle params) {\n LogFragment fragment = new LogFragment();\n fragment.setArguments(params);\n return fragment;\n }", "public RegisterFragment() {\n // Required empty public constructor\n }", "public VehicleFragment() {\r\n }", "public static Fine newInstance(String param1, String param2) {\n Fine fragment = new Fine();\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 static FriendsFragment newInstance(String param1, String param2) {\n FriendsFragment fragment = new FriendsFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "public static ChangesViewFragment newInstance() {\n\t\tChangesViewFragment fragment = new ChangesViewFragment();\n\t\tBundle args = new Bundle();\n\t\targs.putInt(HomeViewActivity.ARG_SECTION_NUMBER, 2);\n\t\tfragment.setArguments(args);\n\t\treturn fragment;\n\t}", "public static NoteFragment newInstance(String param1, String param2) {\n NoteFragment fragment = new NoteFragment();\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 static MainFragment newInstance(Context context) {\n MainFragment fragment = new MainFragment();\n if(context != null)\n fragment.setVariables(context);\n return fragment;\n }", "@Override\n\tprotected Fragment createFragment() {\n\t\treturn new CrimeListFragment();\n\t}", "public static MoneyLogFragment newInstance() {\n MoneyLogFragment fragment = new MoneyLogFragment();\n return fragment;\n }", "public static ForecastFragment newInstance() {\n\n //Create new fragment\n ForecastFragment frag = new ForecastFragment();\n return(frag);\n }", "public static MainFragment newInstance(String param1, String param2) {\n MainFragment fragment = new MainFragment();\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 static MainFragment newInstance(String param1, String param2) {\n MainFragment fragment = new MainFragment();\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 static MainFragment newInstance(String param1, String param2) {\n MainFragment fragment = new MainFragment();\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 static MyTaskFragment newInstance(String param1) {\n MyTaskFragment fragment = new MyTaskFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n fragment.setArguments(args);\n return fragment;\n }", "public static MyProfileFragment newInstance(String param1, String param2) {\n MyProfileFragment fragment = new MyProfileFragment();\n return fragment;\n }", "public static MainFragment newInstance(int param1, String param2) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_PARAM1, param1);\n\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public PlaylistFragment() {\n }", "public static HistoryFragment newInstance() {\n HistoryFragment fragment = new HistoryFragment();\n return fragment;\n }", "public static SurvivorIncidentFormFragment newInstance(String param1, String param2) {\n// SurvivorIncidentFormFragment fragment = new SurvivorIncidentFormFragment();\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\n SurvivorIncidentFormFragment fragment = new SurvivorIncidentFormFragment();\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\n\n }", "public static PersonalFragment newInstance(String param1, String param2) {\n PersonalFragment fragment = new PersonalFragment();\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 }" ]
[ "0.7259329", "0.72331375", "0.71140355", "0.69909847", "0.69902235", "0.6834592", "0.683074", "0.68134046", "0.6801526", "0.6801054", "0.67653185", "0.6739714", "0.6739714", "0.6727412", "0.6717231", "0.6705855", "0.6692112", "0.6691661", "0.66869426", "0.66606814", "0.6646188", "0.66410166", "0.6640725", "0.6634425", "0.66188246", "0.66140765", "0.6608169", "0.66045964", "0.65977716", "0.6592119", "0.659137", "0.65910816", "0.65830594", "0.65786606", "0.6562876", "0.65607685", "0.6557126", "0.65513307", "0.65510213", "0.65431285", "0.6540448", "0.65336084", "0.6532555", "0.6528302", "0.6524409", "0.652328", "0.6523149", "0.6516528", "0.65049976", "0.6497274", "0.6497235", "0.64949715", "0.64944136", "0.6484968", "0.6484214", "0.64805835", "0.64784926", "0.64755154", "0.64710265", "0.6466466", "0.6457089", "0.645606", "0.6454554", "0.6452161", "0.64520335", "0.6450325", "0.64488834", "0.6446765", "0.64430225", "0.64430225", "0.64430225", "0.64420956", "0.6441306", "0.64411277", "0.6438451", "0.64345145", "0.64289486", "0.64287597", "0.6423755", "0.64193285", "0.6418699", "0.6414679", "0.6412867", "0.6402168", "0.6400724", "0.6395624", "0.6395109", "0.6391252", "0.63891554", "0.63835025", "0.63788056", "0.63751805", "0.63751805", "0.63751805", "0.6374796", "0.63653135", "0.6364529", "0.6360922", "0.63538784", "0.6351111", "0.635067" ]
0.0
-1
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v=inflater.inflate(R.layout.fragment_add_simple_dish, container, false); ((AppCompatActivity)getActivity()).getSupportActionBar().setTitle(R.string.actionBar_addDish); data=sData.getdata(); newDish=sData.getdata().getNewDish(); name= (EditText)v.findViewById(R.id.nd_et_1); vegan=(CheckBox)v.findViewById(R.id.nd_ck_1); vegetarian=(CheckBox)v.findViewById(R.id.nd_ck_2); hot=(CheckBox)v.findViewById(R.id.nd_ck_3); glutenFree=(CheckBox)v.findViewById(R.id.nd_ck_4); TextView add_tags= (TextView) v.findViewById(R.id.editTags); add_tags.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Simple_menu_add_tags tags_frag=new Simple_menu_add_tags(); getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.fragment_holder,tags_frag).commit(); } }); //showTags(v); Button add= (Button)v.findViewById(R.id.ad_add); add.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { newDish.setName(name.getText().toString()); newDish.setVegan(vegan.isChecked()); newDish.setGlutenFree(glutenFree.isChecked()); newDish.setVegetarian(vegetarian.isChecked()); newDish.setSpicy(hot.isChecked()); FirebaseDatabase db=FirebaseDatabase.getInstance(); DatabaseReference ref=db.getReference("course"); ref.child(newDish.getCid()).setValue(newDish.toMap()).addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { getFragmentManager().popBackStack(); } }); } }); Spinner cuisine = (Spinner) v.findViewById(R.id.nd_type); cuisine.setAdapter(new ArrayAdapter<String>(getContext(),android.R.layout.simple_spinner_dropdown_item,getResources().getStringArray(R.array.cuisine))); Spinner type = (Spinner) v.findViewById(R.id.nd_type_2); type.setAdapter(new ArrayAdapter<String>(getContext(),android.R.layout.simple_spinner_dropdown_item,getResources().getStringArray(R.array.type))); view=v; return v; }
{ "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
TODO: Rename method, update argument and hook method into UI event
public void onButtonPressed(Uri uri) { if (mListener != null) { mListener.onFragmentInteraction(uri); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void handle(ActionEvent event) {\n\n\t\t\t\t}", "@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t}", "public abstract void update(UIReader event);", "@Override\r\n\t\t\tpublic void handle(ActionEvent arg0) {\n\t\t\t}", "@Override\n\tpublic void handle(ActionEvent event) {\n\t\t\n\t}", "@Override\n\tpublic void handle(ActionEvent event) {\n\n\t}", "@Override\n\tpublic void handleUpdateUI(String text, int code) {\n\t\t\n\t}", "@Override\n\tpublic void update(Event e) {\n\t}", "public abstract void onInvoked(CommandSender sender, String[] args);", "@Override\r\n public void updateUI() {\r\n }", "@Override\r\n\tpublic void handle(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}", "@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}", "@Override\n\tpublic void processEvent(Event e) {\n\n\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t\t \n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t\t \n\t\t\t}", "@Override\n\tpublic void processCommand(JMVCommandEvent arg0) {\n\t}", "@Override\n\tpublic void inputChanged( Viewer arg0, Object arg1, Object arg2 ) {\n\t}", "@Override\n\tpublic void handleEvent(Event arg0) {\n\t\t\n\t}", "@Override\r\n\tpublic void onCustomUpdate() {\n\t\t\r\n\t}", "public void updateUI(){}", "private synchronized void updateScreen(String arg){\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n setChanged();\n notifyObservers(arg);\n }\n });\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}", "@Override\r\n public void actionPerformed( ActionEvent e )\r\n {\n }", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\tpublic void updateObjectListener(ActionEvent e) {\n\t\t\r\n\t}", "Event () {\n // Nothing to do here.\n }", "void onArgumentsChanged();", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "void eventChanged();", "@Override\r\n\t\t\tpublic void execute(LiftEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void execute(LiftEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override public void handle(ActionEvent e)\n\t {\n\t }", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\r\n\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override //se repita\r\n public void actionPerformed(ActionEvent ae) {\r\n \r\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t}", "public abstract CommandResponse onCommand(CommandSender sender, String label, String[] args);", "@Override\n public void actionPerformed(ActionEvent actionEvent) {\n }", "@Override\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t}", "@Override\r\n public void actionPerformed(ActionEvent e) {\n \r\n }", "public abstract void onCommand(MessageEvent context) throws Exception;", "@Override\r\n\tpublic void onEvent(Event arg0) {\n\r\n\t}", "private void addParameterEventHandler(){\n\t\t\n\t\tgetParameterNameListBox().addDoubleClickHandler(new DoubleClickHandler() {\n\t\t\t@Override\n\t\t\tpublic void onDoubleClick(DoubleClickEvent event) {\n\t\t\t\tparameterAceEditor.clearAnnotations();\n\t\t\t\tparameterAceEditor.removeAllMarkers();\n\t\t\t\tparameterAceEditor.redisplay();\n\t\t\t\tSystem.out.println(\"In addParameterEventHandler on DoubleClick isPageDirty = \" + getIsPageDirty() + \" selectedIndex = \" + getParameterNameListBox().getSelectedIndex());\n\t\t\t\tsetIsDoubleClick(true);\n\t\t\t\tsetIsNavBarClick(false);\n\t\t\t\tif (getIsPageDirty()) {\n\t\t\t\t\tshowUnsavedChangesWarning();\n\t\t\t\t} else {\n\t\t\t\t\tint selectedIndex = getParameterNameListBox().getSelectedIndex();\n\t\t\t\t\tif (selectedIndex != -1) {\n\t\t\t\t\t\tfinal String selectedParamID = getParameterNameListBox().getValue(selectedIndex);\n\t\t\t\t\t\tcurrentSelectedParamerterObjId = selectedParamID;\n\t\t\t\t\t\tif(getParameterMap().get(selectedParamID) != null){\n\t\t\t\t\t\t\tgetParameterNameTxtArea().setText(getParameterMap().get(selectedParamID).getParameterName());\n\t\t\t\t\t\t\tgetParameterAceEditor().setText(getParameterMap().get(selectedParamID).getParameterLogic());\n\t\t\t\t\t\t\tSystem.out.println(\"In Parameter DoubleClickHandler, doing setText()\");\n\t\t\t\t\t\t\t//disable parameterName and Logic fields for Default Parameter\n\t\t\t\t\t\t\tboolean isReadOnly = getParameterMap().get(selectedParamID).isReadOnly();\n\t\t\t\t\t\t\tgetParameterButtonBar().getDeleteButton().setTitle(\"Delete\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(MatContext.get().getMeasureLockService()\n\t\t\t\t\t\t\t\t\t.checkForEditPermission()){\n\t\t\t\t\t\t\t\tsetParameterWidgetReadOnly(!isReadOnly);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// load most recent used cql artifacts\n\t\t\t\t\t\t\tMatContext.get().getMeasureService().getUsedCQLArtifacts(MatContext.get().getCurrentMeasureId(), new AsyncCallback<GetUsedCQLArtifactsResult>() {\n\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\t\t\t\tWindow.alert(MatContext.get().getMessageDelegate().getGenericErrorMessage());\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\t@Override\n\t\t\t\t\t\t\t\tpublic void onSuccess(GetUsedCQLArtifactsResult result) {\n\t\t\t\t\t\t\t\t\tif(result.getUsedCQLParameters().contains(getParameterMap().get(selectedParamID).getParameterName())) {\n\t\t\t\t\t\t\t\t\t\tgetParameterButtonBar().getDeleteButton().setEnabled(false);\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\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\tsuccessMessageAlert.clearAlert();\n\t\t\t\t\terrorMessageAlert.clearAlert();\n\t\t\t\t\twarningMessageAlert.clearAlert();\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t}", "@Override\n public void handle(Event event) {\n }", "@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n public void actionPerformed(AnActionEvent e) {\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\r\n\tpublic void handleEvent(Event event) {\n\r\n\t}", "public void ImageView(ActionEvent event) {\n\t}", "@Override\n public void updateUi() {\n\n }", "@Override\n public void updateUi() {\n\n }", "@Override\n public void updateUi() {\n\n }", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "public void runInUi(ElexisEvent ev){}", "@Override\n public void delta() {\n \n }", "@Override\n\tpublic void onClick(ClickEvent arg0) {\n\t\t\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n }", "@Override\n\tprotected void OnClick() {\n\t\t\n\t}", "@Override\n public void actionPerformed(ActionEvent ev) {\n }", "@Override\n public void actionPerformed(ActionEvent e)\n {\n \n }", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\n public void update(Observable o, Object arg)\n {\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tupdate();\n\t\t\t}", "@Override\r\n public void processEvent(IAEvent e) {\n\r\n }" ]
[ "0.6619185", "0.65246344", "0.6473144", "0.6473144", "0.64351684", "0.6325494", "0.62368196", "0.6189416", "0.6158721", "0.61455715", "0.6123594", "0.6107332", "0.6101038", "0.6092755", "0.6049496", "0.6049496", "0.60442764", "0.604003", "0.604003", "0.6007846", "0.59999037", "0.59848183", "0.59776366", "0.59587413", "0.5940049", "0.5925668", "0.5925668", "0.59208333", "0.5915737", "0.5915737", "0.5915737", "0.5915737", "0.5915737", "0.5915554", "0.5909643", "0.5895144", "0.58947057", "0.589277", "0.58885247", "0.58885247", "0.58885247", "0.58671176", "0.58671176", "0.58671176", "0.58636886", "0.5862447", "0.5862447", "0.58613557", "0.5855828", "0.5846504", "0.5846504", "0.5846504", "0.5846504", "0.5837475", "0.58366984", "0.5820788", "0.58068436", "0.58022934", "0.5772422", "0.57714665", "0.5770862", "0.5765655", "0.5763872", "0.57544947", "0.57542855", "0.57542855", "0.57450074", "0.57441026", "0.57441026", "0.57441026", "0.5741053", "0.574037", "0.5739314", "0.57367086", "0.57367086", "0.57367086", "0.57322264", "0.57322264", "0.57322264", "0.57322264", "0.57322264", "0.57322264", "0.57322264", "0.57235956", "0.57232994", "0.5721006", "0.571978", "0.571978", "0.57187414", "0.57177836", "0.57133436", "0.57110935", "0.57110935", "0.57110935", "0.57110935", "0.57110935", "0.57110935", "0.5707859", "0.5707546", "0.5704973", "0.57016516" ]
0.0
-1
This interface must be implemented by activities that contain this fragment to allow an interaction in this fragment to be communicated to the activity and potentially other fragments contained in that activity. See the Android Training lesson Communicating with Other Fragments for more information.
public interface OnFragmentInteractionListener { // TODO: Update argument type and name void onFragmentInteraction(Uri uri); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface OnFragmentInteractionListener {\n void onFragmentMessage(String TAG, Object data);\n}", "public interface FragmentInteraction {\n void switchToBoardView();\n void switchToPinsView();\n void switchToPins(PDKBoard pdkBoard);\n void switchToDescription(PDKPin pin);\n}", "public interface IFragmentView {\n public Activity getActivity();\n public void onItemClick(int position);\n}", "public interface OnFragmentInteractionListener {\n void onMainFragmentInteraction(String string);\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n if (context instanceof RequestFragmentInterface) {\n mInterface = (RequestFragmentInterface) context;\n } else {\n throw new RuntimeException(context.toString()\n + \" must implement OnFragmentInteractionListener\");\n }\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onCallBellPressed(MessageReason reason);\n }", "void onFragmentInteraction();", "void onFragmentInteraction();", "void onFragmentInteraction();", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n\n\n void onFragmentInteraction(String mId, String mProductName, String mItemRate, int minteger, int update);\n }", "public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction();\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onComidaSelected(int comidaId);\n }", "public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(Qualification q);\n }", "public interface OnFragmentInteractionListener {\n void onReceiverAcceptRequest(int nextState, String requestId);\n }", "public interface FragMainLife\n{\n\tpublic void onResumeFragMainLife();\n}", "public interface OnFragmentListener {\n\n void onAction(Intent intent);\n}", "public interface IBaseFragmentActivity {\n void onFragmentExit(BaseFragment fragment);\n\n void onFragmentStartLoading(BaseFragment fragment);\n\n void onFragmentFinishLoad(BaseFragment fragment);\n}", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction(String string);\n }", "void onFragmentInteraction(Object ref);", "public interface OnParametersFragmentInteractionListener {\n public void startTask();\n }", "public interface OnFragmentInteractionListener {\n // Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n void onFragmentInteraction(Parcelable selectedItem);\n }", "public interface FragmentInterface {\r\n void fragmentBecameVisible();\r\n}", "public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(String key);\n }", "public interface OnFragmentInteractionListener {\n void newList();\n\n void searchList();\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void pasarALista();\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n\n /**\n * This interface's single method. The hosting Activity must implement this interface and\n * provide an implementation of this method so that this Fragment can communicate with the\n * Activity.\n *\n * @param spotId\n */\n// void onFragmentInteraction(Uri uri);\n void onFragmentInteraction(int spotId);\n// void onFragmentInteraction(LatLng spotPosition);\n\n }", "public interface MainGameActivityCallBacks {\n public void onMsgFromFragmentToMainGame(String sender, String strValue);\n}", "public interface IFragment {\n void onFragmentRefresh();\n\n void onMenuClick();\n}", "public interface FragmentInterface {\n\n void onCreate();\n\n void initLayout();\n\n void updateLayout();\n\n void sendInitialRequest();\n}", "public interface OnFragmentInteractionListener {\n void onFragmentInteraction(String accessToken, String network);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction(View v);\n }", "public interface OnFragmentInteractionListener {\n void swapFragments(SetupActivity.SetupActivityFragmentType type);\n\n void addServer(String name, String ipAddress, String port);\n }", "public interface OnFragmentInteractionListener {\n\t\tvoid restUp(IGameState gameState);\n\t\tvoid restartGame();\n\t}", "public interface OnFragmentInteractionListener\n {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface PersonalFragmentView extends BaseMvpView {\n\n}", "public interface OnFragmentInteractionListener {\n void onFinishCreatingRequest();\n }", "void onFragmentInteraction(View v);", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction(ArrayList<Recepie> recepieList);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction(String id);\n }", "void onFragmentInteractionMain();", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void showRestaurantDetail(Map<String, Object> objectMap);\n\n public void showAddRestaurantFragment(String location);\n }", "public interface FragmentNavigator {\n\n void SwitchFragment(Fragment fragment);\n}", "public interface FragmentModellnt {\n void FragmentM(OnFinishListener onFinishListener,String dataId);\n}", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n //void onFragmentInteraction(Uri uri);\n }", "void onFragmentInteraction(String id);", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction(ArrayList naleznosci, String KLUCZ);\n }", "public interface OnFragmentInteractionListener {\r\n // TODO: Update argument type and name\r\n void onEditFragmentInteraction(Student student);\r\n }", "public interface OnFragmentInteractionListener {\n void onStartFragmentStarted();\n\n void onStartFragmentStartTracking();\n\n void onStartFragmentStopTracking();\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n Long onFragmentInteraction();\n }", "public interface OnFragmentInteractionListener {\n void onFragmentInteraction(Uri uri);\n void onFragmentInteraction(String id);\n}", "public interface IBaseFragment extends IBaseView {\n /**\n * 出栈到目标fragment\n * @param targetFragmentClass 目标fragment\n * @param includeTargetFragment 是否包涵目标fragment\n * true 目标fragment也出栈\n * false 出栈到目标fragment,目标fragment不出栈\n */\n void popToFragment(Class<?> targetFragmentClass, boolean includeTargetFragment);\n\n /**\n * 跳转到新的fragment\n * @param supportFragment 新的fragment继承SupportFragment\n */\n void startNewFragment(@NonNull SupportFragment supportFragment);\n\n /**\n * 跳转到新的fragment并出栈当前fragment\n * @param supportFragment\n */\n void startNewFragmentWithPop(@NonNull SupportFragment supportFragment);\n\n /**\n * 跳转到新的fragment并返回结果\n * @param supportFragment\n * @param requestCode\n */\n void startNewFragmentForResult(@NonNull SupportFragment supportFragment,int requestCode);\n\n /**\n * 设置fragment返回的result\n * @param requestCode\n * @param bundle\n */\n void setOnFragmentResult(int requestCode, Bundle bundle);\n\n /**\n * 跳转到新的Activity\n * @param clz\n */\n void startNewActivity(@NonNull Class<?> clz);\n\n /**\n * 携带数据跳转到新的Activity\n * @param clz\n * @param bundle\n */\n void startNewActivity(@NonNull Class<?> clz,Bundle bundle);\n\n /**\n * 携带数据跳转到新的Activity并返回结果\n * @param clz\n * @param bundle\n * @param requestCode\n */\n void startNewActivityForResult(@NonNull Class<?> clz,Bundle bundle,int requestCode);\n\n /**\n * 当前Fragment是否可见\n * @return true 可见,false 不可见\n */\n boolean isVisiable();\n\n /**\n * 获取当前fragment绑定的activity\n * @return\n */\n Activity getBindActivity();\n\n}", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onSocialLoginInteraction();\n }", "public interface OnFragmentInteractionListener {\n /**\n * On fragment interaction.\n *\n * @param uri the uri\n */\n// TODO: Update argument type and name\n public void onFragmentInteraction(Uri uri);\n }", "public interface OnFragmentListener {\n void onClick(Fragment fragment);\n}", "public interface OnFragmentInteractionListener {\n void playGame(Uri location);\n }", "public interface LoginFragmentListener {\n public void OnRegisterClicked();\n public void OnLoginClicked(String User, String Pass);\n}", "public interface MoveFragment {\n\n\n public void moveFragment(Fragment selectedFragment);\n\n}", "public interface ChangeFragmentListener {\n void changeFragment();\n}", "public interface OnProductItemFragmentInteraction{\r\n public void itemSelected(Producto product);\r\n }", "public interface FragmentInterface {\n public void fragmentResult(Fragment fragment, String title);\n}", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n //this registers this fragment to recieve any EventBus\n EventBus.getDefault().register(this);\n }", "void onFragmentInteraction(int position);", "public interface AddFarmFragmentView extends BaseView {\n\n\n}", "void OpenFragmentInteraction();", "public interface OnFragmentInteractionListener {\n\t\t// TODO: Update argument type and name\n\t\tpublic void onFragmentInteraction(Uri uri);\n\t}", "public interface FragmentDataObserver {\n void getDataFromActivity(String data);\n\n}", "public interface OnFragInteractionListener {\n\n // replace top fragment with this fragment\n interface OnMainFragInteractionListener {\n void onWifiFragReplace();\n void onHistoryFragReplace();\n void onHistoryWithOsmMapFragReplace();\n void onMainFragReplace();\n }\n\n // interface for WifiPresenterFragment\n interface OnWifiScanFragInteractionListener {\n void onGetDataAfterScanWifi(ArrayList<WifiLocationModel> list);\n void onAllowToSaveWifiHotspotToDb(String ssid, String pass, String encryption, String bssid);\n }\n\n // interface for HistoryPresenterFragment\n interface OnHistoryFragInteractionListener {\n // get wifi info\n void onGetWifiHistoryCursor(Cursor cursor);\n // get mobile network generation\n void onGetMobileHistoryCursor(Cursor cursor);\n // get wifi state and date\n void onGetWifiStateAndDateCursor(Cursor cursor);\n }\n\n interface OnMapFragInteractionListerer {\n void onGetWifiLocationCursor(Cursor cursor);\n }\n}", "public interface PesonageFragmentView extends MvpView {\n\n}", "public interface OnUsersFragmentInteractionListener {\n void onListFragmentInteraction(User item);\n }", "public interface MainScreeInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteractionMain();\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onClickNextTurn();\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction();\n\n void changeBottomNavSelection(int menuItem);\n }", "public interface OnFragmentInteractionListener {\n void onFragmentInteraction(Uri uri);\n}", "public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(Uri uri);\n }", "public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(Uri uri);\n }", "public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(Uri uri);\n }", "public interface OnFragmentInteractionListener {\n void onSignoutClicked();\n\n void onExtraScopeRequested();\n }", "interface OnMainFragInteractionListener {\n void onWifiFragReplace();\n void onHistoryFragReplace();\n void onHistoryWithOsmMapFragReplace();\n void onMainFragReplace();\n }", "public interface OnListFragmentInteractionListener {\n void onListFragmentInteraction(Note note);\n}" ]
[ "0.7324436", "0.7207491", "0.71337754", "0.7124179", "0.71227044", "0.70147455", "0.6976635", "0.6976635", "0.6976635", "0.69738007", "0.6967322", "0.69654423", "0.6960806", "0.69540006", "0.6943718", "0.6933451", "0.69287443", "0.6926101", "0.692234", "0.6910855", "0.6902918", "0.68964857", "0.6893978", "0.68813074", "0.68811053", "0.6874986", "0.686401", "0.6860292", "0.68598825", "0.6856936", "0.68540967", "0.6843697", "0.6839221", "0.68294585", "0.68174195", "0.6816103", "0.6808509", "0.6786238", "0.67694134", "0.6768847", "0.6768847", "0.6768847", "0.6768847", "0.6768847", "0.6768847", "0.6768847", "0.6768847", "0.6768847", "0.6766064", "0.6760941", "0.67561656", "0.6752685", "0.6697832", "0.6680396", "0.66731244", "0.6670543", "0.6669405", "0.666108", "0.66607827", "0.6655241", "0.6651397", "0.66439337", "0.6643591", "0.6643591", "0.6643591", "0.6643591", "0.6643591", "0.6643591", "0.6643591", "0.6643591", "0.6643591", "0.6643591", "0.6643591", "0.66379166", "0.663537", "0.6630641", "0.6625269", "0.6624003", "0.66175336", "0.6609315", "0.66086006", "0.6607863", "0.6605729", "0.6597798", "0.65954506", "0.65874064", "0.6571864", "0.65683347", "0.6559594", "0.6558649", "0.6554332", "0.655001", "0.65480477", "0.6542947", "0.6538417", "0.6533733", "0.6533733", "0.6533733", "0.6519384", "0.6516993", "0.6516588" ]
0.0
-1
TODO: Update argument type and name
void onFragmentInteraction(Uri uri);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public String getFirstArg() {\n return name;\r\n }", "@Override\n public int getNumberArguments() {\n return 1;\n }", "java.lang.String getArg();", "@Override\n public int getArgLength() {\n return 4;\n }", "Argument createArgument();", "@Override\r\n\tpublic String getFirstArg() {\n\t\treturn null;\r\n\t}", "@Override\n protected PacketArgs.ArgumentType[] getArgumentTypes() {\n return new PacketArgs.ArgumentType[] { PacketArgs.ArgumentType.String };\n }", "@Override\n\tpublic void traverseArg(UniArg node) {\n\t}", "@Override\n\t\t\t\t\tpublic Parameter handleParameter(Method parent,\n\t\t\t\t\t\t\tEParamType direction, FArgument src) {\n\t\t\t\t\t\treturn super.handleParameter(parent, direction, src);\n\t\t\t\t\t}", "Object[] getArguments();", "Object[] getArguments();", "String getArguments();", "@Override\n\tpublic void handleArgument(ArrayList<String> argument) {\n\t\t\n\t}", "@Override\n public final int parseArguments(Parameters params) {\n return 1;\n }", "ArgList createArgList();", "public Object[] getArguments() { return args;}", "@Override\n public String getInputArg(String argName) {\n Log.w(TAG, \"Test input args is not supported.\");\n return null;\n }", "@Override\n protected String getName() {return _parms.name;}", "private static AbstractType<?>[] argumentsType(@Nullable StringType algorithmArgumentType)\n {\n return algorithmArgumentType == null\n ? DEFAULT_ARGUMENTS\n : new AbstractType<?>[]{ algorithmArgumentType };\n }", "uicargs createuicargs();", "java.util.List<com.mwr.jdiesel.api.Protobuf.Message.Argument> \n getArgumentList();", "java.util.List<com.mwr.jdiesel.api.Protobuf.Message.Argument> \n getArgumentList();", "public static void main(String[] args) {\n\t\t\tmeth(args);\r\n\t\t\targument_test:meth(args);\r\n\t}", "@Override\r\n\tpublic int getSecondArg() {\n\t\treturn 0;\r\n\t}", "public getType_args(getType_args other) {\n }", "Object[] args();", "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 }", "@Test\n void getArgString() {\n }", "@Override\n\t\t\t\t\tpublic Parameter handleParameter(Method parent,\n\t\t\t\t\t\t\tEParamType direction, FEnumerator src) {\n\t\t\t\t\t\treturn super.handleParameter(parent, direction, src);\n\t\t\t\t\t}", "@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 }", "@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 }", "int getArgIndex();", "@Override\n\tpublic void addArg(FormulaElement arg){\n\t}", "public Type[] getArgumentTypes() {\n/* 236 */ return Type.getArgumentTypes(this.desc);\n/* */ }", "@Override\n public Object[] getArguments() {\n return null;\n }", "public login_1_argument() {\n }", "Optional<String[]> arguments();", "private Main(String... arguments) {\n this.operations = new ArrayDeque<>(List.of(arguments));\n }", "@Override\n\tprotected GATKArgumentCollection getArgumentCollection() {\n\t\treturn argCollection;\n\t}", "protected void sequence_Argument(ISerializationContext context, Argument semanticObject) {\n\t\tif (errorAcceptor != null) {\n\t\t\tif (transientValues.isValueTransient(semanticObject, TdlPackage.Literals.ARGUMENT__NAME) == ValueTransient.YES)\n\t\t\t\terrorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TdlPackage.Literals.ARGUMENT__NAME));\n\t\t}\n\t\tSequenceFeeder feeder = createSequencerFeeder(context, semanticObject);\n\t\tfeeder.accept(grammarAccess.getArgumentAccess().getNameSTRINGTerminalRuleCall_0_0(), semanticObject.getName());\n\t\tfeeder.finish();\n\t}", "void setArguments(String arguments);", "@Override\n\tpublic List<String> getArgumentDesc() {\n\t\treturn desc;\n\t}", "OpFunctionArgAgregate createOpFunctionArgAgregate();", "protected abstract Feature<T,?> convertArgument(Class<?> parameterType, Feature<T,?> originalArgument);", "void visitArgument(Argument argument);", "public Thaw_args(Thaw_args other) {\r\n }", "@Override\r\n\tpublic List<String> getArguments()\r\n\t{\n\t\treturn null;\r\n\t}", "private static String getArgumentString(Object arg) {\n if (arg instanceof String) {\n return \"\\\\\\\"\"+arg+\"\\\\\\\"\";\n }\n else return arg.toString();\n }", "public interface Param {\n\n int[] args();\n String exec(ExecutePack pack);\n String label();\n}", "@Override\n public void verifyArgs(ArrayList<String> args) throws ArgumentFormatException {\n super.checkNumArgs(args);\n _args = true;\n }", "public abstract ValidationResults validArguments(String[] arguments);", "public ArgumentException() {\n super(\"Wrong arguments passed to function\");\n }", "public String getArgumentString() {\n\t\treturn null;\n\t}", "@Override\n public String kind() {\n return \"@param\";\n }", "@Override\n\t\t\t\t\tpublic Parameter handleParameter(Method parent,\n\t\t\t\t\t\t\tEParamType direction, FEnumerationType src) {\n\t\t\t\t\t\treturn super.handleParameter(parent, direction, src);\n\t\t\t\t\t}", "public void addArgumentTypeSerialization(String functionName, String argumentName, TensorType type) {\n wrappedSerializationContext.addArgumentTypeSerialization(functionName, argumentName, type);\n }", "void setArgument(int idx,int v) \t\t{ setArgument(idx,Integer.valueOf(v)); }", "@Override\n\tprotected byte[] getArgByte() {\n\t\treturn paramsJson.getBytes();\n\t}", "void onArgumentsChanged();", "com.google.protobuf.ByteString\n\t\tgetArgBytes();", "@Override public int getNumArguments()\t\t\t{ return arg_list.size(); }", "MyArg(int value){\n this.value = value;\n }", "public ArgList(Object arg1) {\n super(1);\n addElement(arg1);\n }", "public Clear_args(Clear_args other) {\r\n }", "private ParameterInformation processArgumentReference(Argument argument,\n List<NameDescriptionType> argTypeSet,\n SequenceEntryType seqEntry,\n int seqIndex)\n {\n ParameterInformation argumentInfo = null;\n\n // Initialize the argument's attributes\n String argName = argument.getName();\n String dataType = null;\n String arraySize = null;\n String bitLength = null;\n BigInteger argBitSize = null;\n String enumeration = null;\n String description = null;\n UnitSet unitSet = null;\n String units = null;\n String minimum = null;\n String maximum = null;\n\n // Step through each command argument type\n for (NameDescriptionType argType : argTypeSet)\n {\n // Check if this is the same command argument referenced in the argument list (by\n // matching the command and argument names between the two)\n if (argument.getArgumentTypeRef().equals(argType.getName()))\n {\n boolean isInteger = false;\n boolean isUnsigned = false;\n boolean isFloat = false;\n boolean isString = false;\n\n // Check if this is an array parameter\n if (seqEntry instanceof ArrayParameterRefEntryType)\n {\n arraySize = \"\";\n\n // Store the reference to the array parameter type\n ArrayDataTypeType arrayType = (ArrayDataTypeType) argType;\n argType = null;\n\n // Step through each dimension for the array variable\n for (Dimension dim : ((ArrayParameterRefEntryType) seqEntry).getDimensionList().getDimension())\n {\n // Check if the fixed value exists\n if (dim.getEndingIndex().getFixedValue() != null)\n {\n // Build the array size string\n arraySize += String.valueOf(Integer.valueOf(dim.getEndingIndex().getFixedValue()) + 1)\n + \",\";\n }\n }\n\n arraySize = CcddUtilities.removeTrailer(arraySize, \",\");\n\n // The array parameter type references a non-array parameter type that\n // describes the individual array members. Step through each data type in the\n // parameter type set in order to locate this data type entry\n for (NameDescriptionType type : argTypeSet)\n {\n // Check if the array parameter's array type reference matches the data\n // type name\n if (arrayType.getArrayTypeRef().equals(type.getName()))\n {\n // Store the reference to the array parameter's data type and stop\n // searching\n argType = type;\n break;\n }\n }\n }\n\n // Check if a data type entry for the parameter exists in the parameter type set\n // (note that if the parameter is an array the steps above locate the data type\n // entry for the individual array members)\n if (argType != null)\n {\n long dataTypeBitSize = 0;\n\n // Check if the argument is an integer data type\n if (argType instanceof IntegerArgumentType)\n {\n IntegerArgumentType icmd = (IntegerArgumentType) argType;\n\n // Get the number of bits occupied by the argument\n argBitSize = icmd.getSizeInBits();\n\n // Get the argument units reference\n unitSet = icmd.getUnitSet();\n\n // Check if integer encoding is set to 'unsigned'\n if (icmd.getIntegerDataEncoding().getEncoding().equalsIgnoreCase(\"unsigned\"))\n {\n isUnsigned = true;\n }\n\n // Determine the smallest integer size that contains the number of bits\n // occupied by the argument\n dataTypeBitSize = 8;\n\n while (argBitSize.longValue() > dataTypeBitSize)\n {\n dataTypeBitSize *= 2;\n }\n\n // Get the argument alarm\n IntegerArgumentType.ValidRangeSet alarmType = icmd.getValidRangeSet();\n\n // Check if the argument has an alarm\n if (alarmType != null)\n {\n // Get the alarm range\n List<IntegerRangeType> alarmRange = alarmType.getValidRange();\n\n // Check if the alarm range exists\n if (alarmRange != null)\n {\n // Store the minimum alarm value\n minimum = alarmRange.get(0).getMinInclusive();\n\n // Store the maximum alarm value\n maximum = alarmRange.get(0).getMaxInclusive();\n }\n }\n\n isInteger = true;\n }\n // Check if the argument is a floating point data type\n else if (argType instanceof FloatArgumentType)\n {\n // Get the float argument attributes\n FloatArgumentType fcmd = (FloatArgumentType) argType;\n dataTypeBitSize = fcmd.getSizeInBits().longValue();\n unitSet = fcmd.getUnitSet();\n\n // Get the argument alarm\n FloatArgumentType.ValidRangeSet alarmType = fcmd.getValidRangeSet();\n\n // Check if the argument has an alarm\n if (alarmType != null)\n {\n // Get the alarm range\n List<FloatRangeType> alarmRange = alarmType.getValidRange();\n\n // Check if the alarm range exists\n if (alarmRange != null)\n {\n // Get the minimum value\n Double min = alarmRange.get(0).getMinInclusive();\n\n // Check if a minimum value exists\n if (min != null)\n {\n // Get the minimum alarm value\n minimum = String.valueOf(min);\n }\n\n // Get the maximum value\n Double max = alarmRange.get(0).getMaxInclusive();\n\n // Check if a maximum value exists\n if (max != null)\n {\n // Get the maximum alarm value\n maximum = String.valueOf(max);\n }\n }\n }\n\n isFloat = true;\n }\n // Check if the argument is a string data type\n else if (argType instanceof StringDataType)\n {\n // Get the string argument attributes\n StringDataType scmd = (StringDataType) argType;\n dataTypeBitSize = Integer.valueOf(scmd.getStringDataEncoding()\n .getSizeInBits()\n .getFixed()\n .getFixedValue());\n unitSet = scmd.getUnitSet();\n isString = true;\n }\n // Check if the argument is an enumerated data type\n else if (argType instanceof EnumeratedDataType)\n {\n EnumeratedDataType ecmd = (EnumeratedDataType) argType;\n EnumerationList enumList = ecmd.getEnumerationList();\n\n // Check if any enumeration parameters are defined\n if (enumList != null)\n {\n // Step through each enumeration parameter\n for (ValueEnumerationType enumType : enumList.getEnumeration())\n {\n // Check if this is the first parameter\n if (enumeration == null)\n {\n // Initialize the enumeration string\n enumeration = \"\";\n }\n // Not the first parameter\n else\n {\n // Add the separator for the enumerations\n enumeration += \", \";\n }\n\n // Begin building this enumeration\n enumeration += enumType.getValue() + \" | \" + enumType.getLabel();\n }\n\n argBitSize = ecmd.getIntegerDataEncoding().getSizeInBits();\n unitSet = ecmd.getUnitSet();\n\n // Check if integer encoding is set to 'unsigned'\n if (ecmd.getIntegerDataEncoding().getEncoding().equalsIgnoreCase(\"unsigned\"))\n {\n isUnsigned = true;\n }\n\n // Determine the smallest integer size that contains the number of bits\n // occupied by the argument\n dataTypeBitSize = 8;\n\n while (argBitSize.longValue() > dataTypeBitSize)\n {\n dataTypeBitSize *= 2;\n }\n\n isInteger = true;\n }\n }\n\n // Get the name of the data type from the data type table that matches the base\n // type and size of the parameter\n dataType = getMatchingDataType(dataTypeBitSize / 8,\n isInteger,\n isUnsigned,\n isFloat,\n isString,\n dataTypeHandler);\n\n // Check if the description exists\n if (argType.getLongDescription() != null)\n {\n // Store the description\n description = argType.getLongDescription();\n }\n\n // Check if the argument bit size exists\n if (argBitSize != null && argBitSize.longValue() != dataTypeBitSize)\n {\n // Store the bit length\n bitLength = argBitSize.toString();\n }\n\n // Check if the units exists\n if (unitSet != null)\n {\n List<UnitType> unitType = unitSet.getUnit();\n\n // Check if the units is set\n if (!unitType.isEmpty())\n {\n // Store the units\n units = unitType.get(0).getContent();\n }\n }\n\n argumentInfo = new ParameterInformation(argName,\n dataType,\n arraySize,\n bitLength,\n enumeration,\n units,\n minimum,\n maximum,\n description,\n 0,\n seqIndex);\n }\n\n break;\n }\n }\n\n return argumentInfo;\n }", "public abstract interface QueryArgs {\n\n /** Return the catalog associated with this object */\n public Catalog getCatalog();\n\n /** Set the value for the ith parameter */\n public void setParamValue(int i, Object value);\n\n /** Set the value for the parameter with the given label */\n public void setParamValue(String label, Object value);\n\n /** Set the min and max values for the parameter with the given label */\n public void setParamValueRange(String label, Object minValue, Object maxValue);\n\n /** Set the int value for the parameter with the given label */\n public void setParamValue(String label, int value);\n\n /** Set the double value for the parameter with the given label */\n public void setParamValue(String label, double value);\n\n /** Set the double value for the parameter with the given label */\n public void setParamValueRange(String label, double minValue, double maxValue);\n\n /** Set the array of parameter values directly. */\n public void setParamValues(Object[] values);\n\n /** Get the value of the ith parameter */\n public Object getParamValue(int i);\n\n /** Get the value of the named parameter\n *\n * @param label the parameter name or id\n * @return the value of the parameter, or null if not specified\n */\n public Object getParamValue(String label);\n\n /**\n * Get the value of the named parameter as an integer.\n *\n * @param label the parameter label\n * @param defaultValue the default value, if the parameter was not specified\n * @return the value of the parameter\n */\n public int getParamValueAsInt(String label, int defaultValue);\n\n /**\n * Get the value of the named parameter as a double.\n *\n * @param label the parameter label\n * @param defaultValue the default value, if the parameter was not specified\n * @return the value of the parameter\n */\n public double getParamValueAsDouble(String label, double defaultValue);\n\n /**\n * Get the value of the named parameter as a String.\n *\n * @param label the parameter label\n * @param defaultValue the default value, if the parameter was not specified\n * @return the value of the parameter\n */\n public String getParamValueAsString(String label, String defaultValue);\n\n\n /**\n * Return the object id being searched for, or null if none was defined.\n */\n public String getId();\n\n /**\n * Set the object id to search for.\n */\n public void setId(String id);\n\n\n /**\n * Return an object describing the query region (center position and\n * radius range), or null if none was defined.\n */\n public CoordinateRadius getRegion();\n\n /**\n * Set the query region (center position and radius range) for\n * the search.\n */\n public void setRegion(CoordinateRadius region);\n\n\n /**\n * Return an array of SearchCondition objects indicating the\n * values or range of values to search for.\n */\n public SearchCondition[] getConditions();\n\n /** Returns the max number of rows to be returned from a table query */\n public int getMaxRows();\n\n /** Set the max number of rows to be returned from a table query */\n public void setMaxRows(int maxRows);\n\n\n /** Returns the query type (an optional string, which may be interpreted by some catalogs) */\n public String getQueryType();\n\n /** Set the query type (an optional string, which may be interpreted by some catalogs) */\n public void setQueryType(String queryType);\n\n /**\n * Returns a copy of this object\n */\n public QueryArgs copy();\n\n /**\n * Optional: If not null, use this object for displaying the progress of the background query\n */\n public StatusLogger getStatusLogger();\n}", "@Override\n public void doExeception(Map<String, Object> args)\n {\n \n }", "@Override\n public void doExeception(Map<String, Object> args)\n {\n \n }", "@Override\n\tprotected Collection<ArgumentTypeDescriptor> getArgumentTypeDescriptors() {\n\t\treturn Arrays.asList(new VCFWriterArgumentTypeDescriptor(engine, System.out, bisulfiteArgumentSources), new SAMReaderArgumentTypeDescriptor(engine),\n\t\t\t\tnew SAMFileWriterArgumentTypeDescriptor(engine, System.out), new OutputStreamArgumentTypeDescriptor(engine, System.out));\n\t}", "@Override\n public int getArgent() {\n return _argent;\n }", "private static @NonNull String resolveInputName(@NonNull Argument<?> argument) {\n String inputName = argument.getAnnotationMetadata().stringValue(Bindable.NAME).orElse(null);\n if (StringUtils.isEmpty(inputName)) {\n inputName = argument.getName();\n }\n return inputName;\n }", "private Object[] getArguments (String className, Object field)\n\t{\n\t\treturn ((field == null) ? new Object[]{className} : \n\t\t\tnew Object[]{className, field});\n\t}", "PermissionSerializer (GetArg arg) throws IOException, ClassNotFoundException {\n\tthis( \n\t create(\n\t\targ.get(\"targetType\", null, Class.class),\n\t\targ.get(\"type\", null, String.class),\n\t\targ.get(\"targetName\", null, String.class),\n\t\targ.get(\"targetActions\", null, String.class) \n\t )\n\t);\n }", "public Type getArgumentDirection() {\n return direction;\n }", "public String argTypes() {\n return \"I\";//NOI18N\n }", "public static void main(String arg[]) {\n\n }", "godot.wire.Wire.Value getArgs(int index);", "@Override\n protected String[] getArguments() {\n String[] args = new String[1];\n args[0] = _game_file_name;\n return args;\n }", "public void setArgs(java.lang.String value) {\n this.args = value;\n }", "private Argument(Builder builder) {\n super(builder);\n }", "@Override\n public void execute(String[] args) {\n\n }", "@Override\n\tprotected final void setFromArgument(CommandContext<ServerCommandSource> context, String name) {\n\t}", "UUID createArgument(ArgumentCreateRequest request);", "@Override\n public void initialise(String[] arguments) {\n\n }", "public static ParameterExpression parameter(Class type, String name) { throw Extensions.todo(); }", "protected abstract void parseArgs() throws IOException;" ]
[ "0.7164074", "0.6946075", "0.6714363", "0.65115863", "0.63969076", "0.6375468", "0.63481104", "0.63162106", "0.6260299", "0.6208487", "0.6208487", "0.62070644", "0.6197276", "0.61806154", "0.6177103", "0.61530507", "0.61472267", "0.61243707", "0.60771817", "0.6054482", "0.59906125", "0.59906125", "0.5984017", "0.59791875", "0.5977681", "0.59532714", "0.5946838", "0.59457266", "0.59452903", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.5909717", "0.5889277", "0.588111", "0.5871162", "0.5866624", "0.58613646", "0.58519953", "0.58381283", "0.58083445", "0.58059824", "0.5795826", "0.57816726", "0.57670826", "0.57556796", "0.57471323", "0.57418406", "0.5729463", "0.57291526", "0.5716928", "0.5713024", "0.56974274", "0.56782854", "0.56723106", "0.5664594", "0.5664104", "0.5660337", "0.5652865", "0.5647883", "0.5642134", "0.5635645", "0.5634968", "0.562251", "0.56210977", "0.56167537", "0.56138444", "0.56044126", "0.56044126", "0.5602371", "0.56012225", "0.55986875", "0.55893147", "0.5588273", "0.5583255", "0.5582767", "0.55681497", "0.55626017", "0.55577534", "0.55524325", "0.5549442", "0.55378276", "0.5536797", "0.5527675", "0.5511817", "0.55099154", "0.550257" ]
0.0
-1
Though the numbering of the "id" of article summaries starts at 1, this method expects earliest "start" value to be 0.
public List<ArticleSummary> getArticleSummariesDescFromTo(long start, int count, String tags) throws SQLException { return this.getArticleSummariesFromTo(start, count, tags, "desc"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setStart(long start) { this.start = start; }", "public void setStart(int start) {\r\n this.start = start;\r\n }", "public void setStart(int start) {\n this.start=start;\n }", "public void setStart(int start) {\n\t\tthis.start = start;\n\t}", "void setStartAt(final Long startAt);", "Long getStartAt();", "OffsetDateTime usageStart();", "public int getStart() {\r\n return start;\r\n }", "public void setStart(int start)\n {\n if(start >= 0)\n {\n this.start = start;\n }\n else\n {\n System.out.println(\"Cannot be negative.\");\n }\n }", "public int getStart() {\n return start;\n }", "public int getStart() {\n return start;\n }", "public int getStart() {\r\n\t\treturn start;\r\n\t}", "org.hl7.fhir.Integer getStart();", "public int getStart()\n {\n return start;\n }", "public void setStart(int startId) throws IllegalArgumentException, IllegalStateException;", "public int getStart() {\n return this.start;\n }", "public int start() { return _start; }", "public void setNumPublicationsAtStart(int numPublicationsAtStart)\n\t\tthrows TarlException {\n\t\tif (numPublicationsAtStart >= 0)\n\t\t\tthis.numPublicationsAtStart = numPublicationsAtStart;\n\t\telse\n\t\t\tthrow (new TarlException(new String(\n\t\t\t \"Number of publications at the start cannot be negative\\n\")));\n\t}", "public int getStart() {\n\t\treturn start;\n\t}", "public void IncrementCounter()\r\n {\r\n \tif (startAtUsed==false\r\n \t\t\t|| (!counter.encounteredAlready)) {\r\n \t\t// Defer setting the startValue until the list\r\n \t\t// is actually encountered in the main document part,\r\n \t\t// since otherwise earlier numbering (using the\r\n \t\t// same abstract number) would use this startValue\r\n \tcounter.setCurrentValue(this.startValue); \r\n \tlog.debug(\"not encounteredAlready; set to startValue \" + startValue);\r\n \tcounter.encounteredAlready = true;\r\n \tstartAtUsed = true;\r\n \t}\r\n counter.IncrementCounter();\r\n }", "public void setNumAuthorsAtStart(int numAuthorsAtStart)\n\t\tthrows TarlException {\n\t\tif (numAuthorsAtStart > 0)\n\t\t\tthis.numAuthorsAtStart = numAuthorsAtStart;\n\t\telse\n\t\t\tthrow (new TarlException(new String(\n\t\t\t \"Number of authors at the start cannot be zero or negative\\n\")));\n\t}", "public int getStart ()\n {\n\n return this.start;\n\n }", "public int start() {\n return start;\n }", "public int getStart() {\n\t\t\treturn start;\n\t\t}", "public void setRangeStart(@IntRange(from = MIN_NUMBER) long start) {\n setRange(start, mRange, mIsPositive);\n }", "public void setStartMark(Integer startMark) {\n this.startMark = startMark;\n }", "MinmaxEntity getStart();", "public long getStart() {\n return start;\n }", "public void setBegin(int begin)\n {\n this.begin = begin;\n this.beginSpecified = true;\n }", "private static int getStartID(HashMap<Integer, ActivityPrediction> model) {\n int startID = 0;\n for (ActivityPrediction predictionNode : model.values()) {\n if (predictionNode.isStart()) {\n startID = predictionNode.getActivityID();\n }\n }\n return startID;\n }", "public void setBegin(int begin) {\n\t\tthis.begin = begin;\n\t}", "public int getNumAuthorsAtStart() {\n\t\treturn numAuthorsAtStart;\n\t}", "public int getStart() {\r\n\t\treturn this.offset;\r\n\t}", "public int getNumPublicationsAtStart() {\n\t\treturn numPublicationsAtStart;\n\t}", "public void setStartDate(Date start)\r\n {\r\n this.startDate = start;\r\n }", "public void setBeginOffset(Integer beginOffset) {\n this.beginOffset = beginOffset;\n }", "int getStart();", "public void setStartLine(final int startLine) {\n this.startLine = startLine;\n }", "public void setExpectedStart(long expectedStart) {\n this.expectedStart = expectedStart;\n }", "public Integer getStartMark() {\n return startMark;\n }", "public ElasticInteger(int valueAtStart, long duration) {\n super(valueAtStart, duration);\n }", "public ItemSequence(final int start) {\n\t\tlookupPrefix = null;\n\t\tsequenceStartNumber = start;\n\t\tcurrentSequenceNumber = Integer.MIN_VALUE;\n\t}", "public void setSrc(String startId) {\r\n\t\tsrc = startId;\r\n\t}", "public void setStartLine(int startLine) {\r\n this.startLine = startLine;\r\n }", "public void setFirstResult(int begin) {\n\r\n\t}", "private int findBeginIndex(){\n\t\tint begin=Integer.MAX_VALUE;\n\t\tfor(int i=0;i<modelNames.size();i++){\n\t\t\tif(Integer.parseInt(modelNames.get(i).substring(0,8))>=this.date_begin)\n\t\t\t{begin=i;break;}\n\t\t}\n\t\treturn begin;\n\t}", "public void setStartTimestamp(long value) {\n this.startTimestamp = value;\n }", "public int[] start() {\n\t\treturn null;\n\t}", "public void setDayStart(Integer dayStart) {\n this.dayStart = dayStart;\n }", "void setStartSearch(int startSearch);", "abstract Long getStartTimestamp();", "long getStartTimestamp();", "public final void setStartRow(java.lang.Integer startrow)\r\n\t{\r\n\t\tsetStartRow(getContext(), startrow);\r\n\t}", "public void markRunStart(){\r\n runStart = stepCount;\r\n }", "public M csseStartStart(Object start){this.put(\"csseStartStart\", start);return this;}", "@Override\n public void start() throws MuleException {\n // Increment this counter as a demonstration.\n // Should be able to see this in mbean viewer.\n metricRegistry.counter(\"MetricAgent.start\").inc();\n }", "public String getStart() {\r\n\t\treturn this.start;\r\n\t}", "private int processBeginDate(int count) {\n String line = this.result.get(count);\n if (line.indexOf(\"char:\") == 0) {\n checkEmptyLine(line);\n line = this.result.get(++count);\n }\n if (!line.equals(\"start:begin-date\")) {\n throw new IllegalArgumentException(\"Not find begin-date tag.\");\n }\n line = this.result.get(++count).replace(\"\\t\", \"\").trim();\n if ((line.indexOf(\"char:\") != 0) || line.substring(5).trim().length() == 0) {\n throw new IllegalArgumentException(\"No date.\");\n }\n String strDate = line.substring(5).trim();\n DateTimeFormatter format = DateTimeFormatter.ofPattern(\"yyyy-MM-dd\");\n try {\n this.beginDate = LocalDate.parse(strDate, format);\n }\n catch (DateTimeParseException e) {\n throw new IllegalArgumentException(\"Illegal date: \" + e.getMessage());\n }\n checkDate(strDate, this.beginDate);\n line = this.result.get(++count);\n if (line.indexOf(\"char:\") == 0) {\n checkEmptyLine(line);\n line = this.result.get(++count);\n }\n if (!line.equals(\"end:begin-date\")) {\n throw new IllegalArgumentException(\"Not find begin-date end tag.\");\n }\n this.state = ProcessState.WAIT_END_DATE;\n return ++count;\n }", "public String getStart(){\n\t\treturn start;\n\t}", "@Override\n\tpublic int skipTo(int docId) {\n\t\treturn 0;\n\t}", "public int getStartLineNumber() {\n return startLineNumber_;\n }", "public int deleteStart()\r\n {\n int temp = start.item;\r\n if(start.next == null)\r\n end = null;\r\n start = start.next;\r\n return temp;\r\n }", "public double getStart() {\n return start;\n }", "int getStartSegment();", "public int getStartIdx() {\n return this.startIdx;\n }", "public String getStart() {\n return start;\n }", "@Override\n\tpublic int getStartOffset() {\n\t\treturn 0;\n\t}", "public void setStartSoc(Integer startSoc) {\n this.startSoc = startSoc;\n }", "void setOpenBodyRangeStart(int start) {\n this.fOpenBodyRange[0] = start;\n }", "public void setMinimum(Number min) {\n ((ADocument) getDocument()).setMinimum(min);\n }", "private int skipLeadingWhite( List content, int start) {\r\n if (start < 0) {\r\n start = 0;\r\n }\r\n\r\n int index = start;\r\n int size = content.size();\r\n if (currentFormat.trimAllWhite\r\n || currentFormat.textNormalize\r\n || currentFormat.textTrim) {\r\n while( index < size) {\r\n if ( !isAllWhitespace( content.get(index))) {\r\n return index;\r\n }\r\n index++;\r\n }\r\n }\r\n return index;\r\n }", "public void setStartPoint(int s) {\r\n\t\tstartPoint = s;\r\n\t}", "public int getSeriesStart() { return _dataSet.getSeriesStart(); }", "public abstract long getStartTimestamp();", "public int getStartLineNumber() {\n return startLineNumber_;\n }", "@Override\n\t\tpublic long getStartMillis() {\n\t\t\treturn 0;\n\t\t}", "@Override\n\tpublic Long updateStartDate() {\n\t\treturn null;\n\t}", "public Node getStart(){\n return start;\n }", "ActualStartType getActualStart();", "public abstract long startTimestamp();", "public void setSeriesStart(int aValue) { _dataSet.setSeriesStart(aValue); }", "public void setStartOffset(int offset) {\n this.startOffset = offset;\n }", "public Long getTimestampStart();", "public void start() {\n start(mRangeStart, mRange, mIsPositive);\n }", "public void resetContainerIdCounter(long containerIdStart) {\n this.containerIdCounter.set(containerIdStart);\n }", "public void setStartIndex(Integer startIndex) {\r\n this.startIndex = startIndex;\r\n }", "public void setItemRangeStart(Long itemRangeStart) {\n\t\tthis.itemRangeStart = itemRangeStart;\n\t}", "void changeStart(int newStart) {\n if (newStart < 0 || newStart >= endBeat) {\n throw new IllegalArgumentException(\"Invalid startBeat\");\n }\n this.startBeat = newStart;\n }", "public int getStartOffset() {\n return startOffset;\n }", "public void insertAtStart(int val)\n {\n List nptr = new List(val, null, null); \n if(start == null)\n {\n start = nptr;\n end = start;\n }\n else\n {\n start.setListPrev(nptr);\n nptr.setListNext(start);\n start = nptr;\n }\n size++;\n }", "public Point start() {\r\n return this.start;\r\n }", "public Position getStart() {\r\n return start;\r\n }", "public int startOffset();", "public Point getStart() {\n\t\treturn _start;\n\t}", "protected abstract List<Sentence> prepareSummary(Article article);", "public myCounter(int startValue) {\n\t\tcounter = startValue;\n\t}", "public long getRangeStart() {\n return mRangeStart;\n }", "public Date getStart() {\n return start;\n }", "public int getFirstInInterval(int start) {\n if (start > last()) {\n return -1;\n }\n if (start <= first) {\n return first;\n }\n if (stride == 1) {\n return start;\n }\n int offset = start - first;\n int i = offset / stride;\n i = (offset % stride == 0) ? i : i + 1; // round up\n return first + i * stride;\n }", "public long getStartDate() {\n return startDate_;\n }", "public java.lang.Integer getStartResult()\n {\n return this.startResult;\n }" ]
[ "0.63636935", "0.6243586", "0.6161345", "0.61278826", "0.60557973", "0.587199", "0.56884587", "0.56818414", "0.5656996", "0.56518173", "0.56418395", "0.5636907", "0.5633753", "0.56170017", "0.5611194", "0.5592746", "0.556587", "0.5559018", "0.5558201", "0.55464417", "0.5545973", "0.55185205", "0.5498755", "0.54973626", "0.54815704", "0.54600257", "0.5383813", "0.533752", "0.53299695", "0.52745783", "0.522695", "0.51653683", "0.5162113", "0.5151129", "0.5101137", "0.508997", "0.5078607", "0.50505376", "0.5047373", "0.50420994", "0.5017248", "0.5013742", "0.5010474", "0.49974895", "0.49857664", "0.49849474", "0.49828228", "0.49660817", "0.49517745", "0.49366927", "0.4933454", "0.49289274", "0.4915419", "0.49042153", "0.4902314", "0.48952243", "0.48945114", "0.48940516", "0.48883525", "0.4882442", "0.48812145", "0.4879633", "0.48779634", "0.48772022", "0.48726726", "0.48658738", "0.48609447", "0.48582238", "0.48568836", "0.48543912", "0.48521957", "0.4847078", "0.48450482", "0.48447186", "0.4835736", "0.48346236", "0.48340055", "0.48312828", "0.4827173", "0.48230517", "0.48227644", "0.48224103", "0.48099628", "0.480651", "0.4803946", "0.48009568", "0.47990358", "0.47977898", "0.4797747", "0.47900745", "0.47889063", "0.4785852", "0.47774896", "0.47749984", "0.477433", "0.47741127", "0.47730324", "0.47716993", "0.4769551", "0.4769349", "0.4767293" ]
0.0
-1
getArticleCount returns the number of articles, marked as published or not with the given tag list (comma separated) The authoring tool doradeblogauthoring has a better version of this method. And of many other methods.
public long getArticleCount(boolean published, String tags) throws SQLException { return this.getArticleOrShortCount(published, tags, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getTagCount();", "public int countByArticle(java.lang.String articleId);", "public int countByArticle(java.lang.String articleId);", "int postsCount();", "public Integer getCount(String tag) {\n\t\treturn tagList.get(tag);\n\t}", "int getAuthoritiesCount();", "int getNewsindentifydetailCount();", "int getDocumentCount();", "public int getNumberOfPostOnBlog(){\n List<BlogPost>blogs = blogPostFacade.findAll();\n int k=0;\n for(BlogPost temp: blogs){\n if(temp.getBlog().getId().equals(blogPost.getBlog().getId())){\n k++;\n System.out.println(\"Mes \"+temp.getMessage());\n }\n \n }\n return k ;\n }", "public int getSUB2AnonimCommentCount(WebElement article) {\n String countText = baseFunc.getElement(MOB_SUB2_ANON_ARTICLE_COUNT).getText();\n String count = countText.substring(countText.indexOf(\"(\") + 1, countText.indexOf(\")\"));\n return Integer.valueOf(count);\n }", "public int countArticle(){\n\n DatabaseHelper databaseHelper = DatabaseHelper.getInstance(this.mExecutionContext);\n SQLiteDatabase sqLiteDatabase = databaseHelper.getReadableDatabase();\n\n Cursor Count= sqLiteDatabase.rawQuery(\"select count(*) from\"+ ConfigDAO.TABLE_AISLE, null);\n Count.moveToFirst();\n int count= Count.getInt(0);\n Count.close();\n return count;\n }", "public int getNumberOfPosts() throws DatabaseException;", "public long getTotalPosts();", "public int getTagCount() {\n return tag_.size();\n }", "public int getNumberOfBlogPost(){\n return blogPostFacade.findAll().size();\n }", "public int getSUB2RegisteredCommentCount(WebElement article) {\n String countText = baseFunc.getElement(MOB_SUB2_REG_ARTICLE_COUNT).getText();\n String count = countText.substring(countText.indexOf(\"(\") + 1, countText.indexOf(\")\"));\n return Integer.valueOf(count);\n }", "int getEntryCount();", "public int getAdvisorCount();", "int getTotalTags(String userName);", "int getNoticeListCount();", "public long getTotalPostsByKeyword(final Set<String> keywords);", "static int countAppearances(String article, String keyword) {\n\t\tif(keyword.isEmpty()){\n\t\t\treturn 0;\n\t\t}\n\t\tString newArticle = article.replace(keyword, \"\");\n\t\treturn (article.length() - newArticle.length())/keyword.length();\n\t}", "int getTotalTags(int accountId);", "public int getAnnounceCount() {\n\t\tCursor c = db.query(TABLE_TEACHER_ANNOUNCEMENT,\n\t\t\t\tnew String[] { KEY_ROW_ID }, null, null, null, null, null);\n\t\treturn c == null ? 0 : c.getCount();\n\t}", "public int getTagCount() {\n if (tagBuilder_ == null) {\n return tag_.size();\n } else {\n return tagBuilder_.getCount();\n }\n }", "public int getCount() {\n\t\treturn Dispatch.get(object, \"Count\").getInt();\n\t}", "int getMetadataCount();", "int getMetadataCount();", "int getMetadataCount();", "int getMetadataCount();", "private int numTags(int tagname) {\n\t\tCVSTag[] tags = logEntry.getTags();\n\t\tint count = 0;\n\t\tfor (CVSTag tag : tags) {\n\t\t\tif (tag.getType() == tagname) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "int findAllCount() ;", "long countByExample(ArticleDoExample example);", "public int getCountForum();", "long countByExample(WpPostsExample example);", "@Override\n public int getItemCount() {\n return mArticles.size();\n }", "public int countByA_A(java.lang.String articleId, boolean approved);", "@Override\n public int getCount(Map<String, Object> params)\n {\n return advertisementMapper.getCount(params);\n }", "@Override\n\tpublic int getCount(String field, String query, boolean pub) {\n\t\treturn noticeDao.getCount(field, query, pub);\n\t}", "@Override\n\tpublic int getCount() {\n\t\tLog.d(\"jereh\",\"getCount()\");\n\t\treturn newsList.size();\n\t}", "int getEventMetadataCount();", "int countByExample(TagDataExample example);", "public int getAuthoritiesCount() {\n return authorities_.size();\n }", "@Override\n\tpublic int countNews() {\n\t\treturn comNewsMapper.selectCountNews();\n\t}", "int commentsCount();", "public int numberAuthors() {\n return authors.size();\n }", "public int getTagsNumber()\n {\n return tags.size();\n }", "public int countEntities(Map<String, Object> parms) {\n\t\treturn 0;\n\t}", "public int countEntities(Map<String, Object> parms) {\n\t\treturn 0;\n\t}", "public int getCustomTagsCount() {\n if (customTagsBuilder_ == null) {\n return customTags_.size();\n } else {\n return customTagsBuilder_.getCount();\n }\n }", "public int numTags() {\n return mTags.size();\n }", "public int getAuthoritiesCount() {\n return authorities_.size();\n }", "int getLinksCount();", "public int getTotalArticle() {\n int listLimit;\n int total;\n int totalPage;\n listLimit = getArticleRowCount();\n clickGoToLastPageBtn();\n // Has to used this method instead of goToPageBtn().size() since the maximum size of the goToPageBtn list is always 10\n totalPage = Integer.parseInt(goToPageBtn().get(goToPageBtn().size() - 1).getText().trim());\n total = getArticleRowCount() + listLimit * totalPage;\n return total;\n }", "public int getURLCount(int list) {\n/* 93 */ int result = 0;\n/* 94 */ List urls = (List)this.urlSeries.get(list);\n/* 95 */ if (urls != null) {\n/* 96 */ result = urls.size();\n/* */ }\n/* 98 */ return result;\n/* */ }", "@java.lang.Override\n public int getCustomTagsCount() {\n return customTags_.size();\n }", "int getListCount();", "int getCountOfAllBooks();", "public int getCount() {\n return definition.getInteger(COUNT, 1);\n }", "@GET\r\n\t@Path(\"count\")\r\n\t@Produces(MediaType.TEXT_PLAIN)\r\n\tpublic String getCount() {\r\n\t\tint count = TodoDao.instance.getMovies().size();\r\n\t\treturn String.valueOf(count);\r\n\t}", "int getAnnotationCount();", "public int get_count();", "@Override\n\tpublic long count(String documentCollection) {\n\t\ttry {\n\t\t\treturn getStore().documentCount();\n\t\t} catch (JsonException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "int getPriceCount();", "int countByExample(NewsExample example);", "int getContentsCount();", "public Integer entitiesCount() {\n return this.entitiesCount;\n }", "public Integer getPageCount();", "int getInterestsCount();", "public int countByA_P_L_A(java.lang.String articleId, long groupId,\n\t\tjava.lang.String language, boolean approved);", "int getNumberOfDocuments();", "public static int getAnnouncementsCount()\n throws com.liferay.portal.kernel.exception.SystemException {\n return getService().getAnnouncementsCount();\n }", "public long numPostingEntries();", "int getItemsCount();", "int getItemsCount();", "@Override\r\n\tpublic int countTopics() {\n\t\treturn 0;\r\n\t}", "int getProtectedPodCount();", "int getViewsCount();", "int getSeenInfoCount();", "int getCategoryCount() {\r\n\t\treturn aCount;\r\n\t}", "void countTagStatistics(){\t\n\t\thtmlParsed.traverse(new NodeVisitor() {\n\t\t\tdouble count = 0.;\n\t\t\tString tagName = \"\";\n\t\t public void head(Node node, int depth) {\n\t\t \tif (node instanceof Element) {\n\t\t \t\ttagName = ((Element) node).tagName();\n\t\t \t\tif(countTags.containsKey(tagName)){\n\t\t \t\t\tcount = countTags.get(tagName) + 1.;\n\t\t \t\t\tcountTags.put(tagName, count);\n\t\t \t\t}\n\t\t \t\telse if(tagName.matches(\"^[a-zA-Z:]+\"))\n\t\t \t\t\t\tcountTags.put(tagName, 1.);\n\t\t \t}\n\t\t }\n\t\t public void tail(Node node, int depth) {\n\t\t }\n\t\t});\t\n\t\t\t\n\t}", "int getIdsCount();", "public int getToDoCount(String tag_name) { \t \n String selectQuery = \"SELECT * FROM \" + TABLE_TODO + \" td, \"\n + TABLE_TAG + \" tg, \" + TABLE_TODO_TAG + \" tt WHERE tg.\"\n + KEY_TAG_NAME + \" = '\" + tag_name + \"'\" + \" AND tg.\" + KEY_ID\n + \" = \" + \"tt.\" + KEY_TAG_ID + \" AND td.\" + KEY_ID + \" = \"\n + \"tt.\" + KEY_TODO_ID;\n \n SQLiteDatabase db = this.getReadableDatabase();\n Cursor c = db.rawQuery(selectQuery, null);\n int pom = 0;\n if (c.moveToFirst()) {\n do {\n pom++;\n } while (c.moveToNext());\n }\n \n return pom;\n }", "@Override\n public int getCount() {\n return articlesList.size();\n }", "int countByExample(NewsInfoExample example);", "int getHotelImageURLsCount();", "public int getNumberOfEnablePosts_inForum(int forumID)\r\n throws DatabaseException;", "Long getAllCount();", "public Integer CounterPublishNum(int count){\r\n\t\treturn ++count;\r\n\t}", "private int getHitsAndArticlesByURL(Category node, String url)\r\n\t{\r\n\t\tDocumentBuilderFactory domfac = DocumentBuilderFactory.newInstance();\r\n\t\tint NumRes = 0;\r\n\t\tString totalHits;\r\n\t\ttry{\r\n\t\t\tURL queryurl = new URL(url);\r\n\t\t\tURLConnection connection = queryurl.openConnection();\r\n\t\t\tconnection.setDoInput(true);\r\n\t\t\tInputStream inStream = connection.getInputStream();\r\n\t\t\tDocumentBuilder dombuilder = domfac.newDocumentBuilder();\r\n\t\t\tDocument doc = dombuilder.parse(inStream);\r\n\t\t\tElement root = doc.getDocumentElement();\r\n\t\t\tNodeList resultset_web = root.getElementsByTagName(\"resultset_web\");\r\n\t\t\tNode resultset = resultset_web.item(0);\r\n\t\t\t\r\n\t\t\ttotalHits = resultset.getAttributes().getNamedItem(\"totalhits\").getNodeValue();\r\n\t\t\tNumRes = Integer.parseInt(totalHits);\r\n\t\t\t\r\n\t\t\tint count = 0;\r\n\t\t\tNodeList results = resultset.getChildNodes(); \r\n\t\t\tif(results != null)\r\n\t\t\t{\t\t\t\r\n\t\t\t\tfor(int i = 0 ; i < results.getLength(); i++){\r\n\t\t\t\t\tNode result = results.item(i);\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tArticle newArticle = new Article();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(result.getNodeType()==Node.ELEMENT_NODE){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor(Node node1 = result.getFirstChild(); node1 != null; node1 = node1.getNextSibling()){\r\n\t\t\t\t\t\t\tif(node1.getNodeType()==Node.ELEMENT_NODE){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(node1.getNodeName().equals(\"url\") && node1.getFirstChild() != null && count < 4){\r\n\t\t\t\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t\t\t\t\tString pageUrl = node1.getFirstChild().getNodeValue();\r\n\t\t\t\t\t\t\t\t\tArticle article = new Article();\r\n\t\t\t\t\t\t\t\t\tarticle.URL = pageUrl;\r\n\t\t\t\t\t\t\t\t\tarticle.words = getWordsLynx.runLynx(pageUrl);\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tnode.articles.add(article);\r\n\t\t\t\t\t\t\t\t}\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}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}catch(ParserConfigurationException e){\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn -1;\r\n\t\t}catch(SAXException e){\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn -1;\r\n\t\t}catch(IOException e){\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn -1;\r\n\t\t}\r\n\r\n\t\treturn NumRes;\r\n\t}", "public static int getKeywordCount()\r\n\t{\r\n\t\treturn keywordCount;\r\n\t}", "public int getPublishedModulesCounts(String buildName, String date) {\n ResultSet rs = null;\n String buildQuery = \"SELECT count(*) as cnt FROM build_modules\\n\" +\n \"left join builds on builds.build_id=build_modules.build_id \\n\" +\n \"where builds.build_number=? and builds.build_date=?\";\n try {\n rs = jdbcHelper.executeSelect(buildQuery,buildName,date);\n if (rs.next()) {\n return rs.getInt(1);\n }\n } catch (SQLException e) {\n log.error(e.toString());\n } finally {\n DbUtils.close(rs);\n }\n return 0;\n }", "int getVersionsCount();", "public int getProductCount();", "@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)\n\tpublic int getArtworksCount();", "int getMetaInformationCount();", "int getMetaInformationCount();", "int getMetaInformationCount();", "int getMetaInformationCount();", "int getMetaInformationCount();" ]
[ "0.64362454", "0.62700206", "0.62680477", "0.62453616", "0.62081504", "0.60767376", "0.58373356", "0.57347405", "0.5723713", "0.56114763", "0.55615336", "0.54852104", "0.545206", "0.5394923", "0.53772634", "0.5355111", "0.5305282", "0.53020996", "0.5290516", "0.52774316", "0.52687323", "0.52122086", "0.5208965", "0.52056056", "0.5201248", "0.51995367", "0.5197159", "0.5197159", "0.5197159", "0.5197159", "0.51860774", "0.51839936", "0.51791716", "0.51757157", "0.5171496", "0.51614386", "0.5154924", "0.5148817", "0.5148052", "0.51437455", "0.51126164", "0.5112198", "0.51120365", "0.510671", "0.50762177", "0.5073179", "0.5071874", "0.5069798", "0.5069798", "0.5061577", "0.5052312", "0.50518256", "0.5048233", "0.50447613", "0.5042137", "0.5039644", "0.503795", "0.5035954", "0.50332206", "0.50210375", "0.50195384", "0.50113744", "0.5002708", "0.49972463", "0.49825013", "0.4981379", "0.49762037", "0.49671116", "0.494965", "0.4949474", "0.49472168", "0.493761", "0.49374062", "0.49210516", "0.49210516", "0.491905", "0.49177405", "0.49141935", "0.49089354", "0.49063498", "0.49061248", "0.4901479", "0.48999155", "0.48985645", "0.48931172", "0.48878473", "0.4885151", "0.48804298", "0.48754847", "0.4875411", "0.487359", "0.48675135", "0.48659748", "0.4853915", "0.48536974", "0.4853143", "0.4853143", "0.4853143", "0.4853143", "0.4853143" ]
0.70360786
0
Time Complexity: O(N) Runtime: 44ms, beats 91.06%
public int lengthOfLongestSubstring(String s){ if(s == null || s.length() == 0){ return 0; } char[] ch = s.toCharArray(); int[] map = new int[128]; int start = 0, end = 0, count = 0, maxLen = 0; while(end < s.length()){ // If map[ch[end]] > 0, it means ch[end] is duplicated now. if(map[ch[end]] > 0){ count++; } map[ch[end]]++; end++; // deal with the duplicated cases while(count > 0){ if(map[ch[start]] > 1){ count--; } map[ch[start]]--; start++; } maxLen = Math.max(maxLen, end - start); } return maxLen; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int f2(int N) { \n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n)\n // O(n)`\n for(int j = 0; j < i; j++) \n x++;\n return x;\n }", "public static int f1(int N) {\n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n) \n x++; \n return x; \n \n }", "public static int example2(int[] arr) { // O(1)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j += 2) // note the increment of 2 // O(1)\r\n\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Once Again, we have a (for) loop and it runs (n) times and this\r\n\t\t * for loop dominates the runtime.So this is linear time and the answer is O(n).\r\n\t\t * \r\n\t\t */\r\n\t}", "public static int example3(int[] arr) { // O(n)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j++) // loop from 0 to n-1 // O(n^2)\r\n\t\t\tfor (int k = 0; k <= j; k++) // loop from 0 to j\r\n\t\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Since we have nested for loop which dominates here and it is\r\n\t\t * O(n^2) and we always take the maximum. so the answer is quadratic time O(n^2)\r\n\t\t * \r\n\t\t */\r\n\t}", "public static int example4(int[] arr) { // O(1)\r\n\t\tint n = arr.length, prefix = 0, total = 0; // O(1), O(1), (1)\r\n\t\tfor (int j = 0; j < n; j++) { // loop from 0 to n-1 // O(n)\r\n\t\t\tprefix += arr[j];\r\n\t\t\ttotal += prefix;\r\n\t\t}\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: The method contains a (for) loop and it runs (n) times.This loop\r\n\t\t * dominates the runtime.We always aim for the worse-case and maximum time. The\r\n\t\t * answer is it is linear time of O(n) notation.\r\n\t\t * \r\n\t\t */\r\n\t}", "public int[] squareUp(int n) {\r\n int[]arreglo=new int[(n*n)]; // O(1)\r\n if(n==0){ // O(1)\r\n return arreglo; // O(1)\r\n }\r\n for(int i=n-1;i<arreglo.length;i=i+n){ // O(n)\r\n for (int j=i;j>=i-(i/n);j--){ // O(1)\r\n arreglo[j]=1+(i-j); // O(1)\r\n }\r\n }\r\n return arreglo; // O(1)\r\n}", "public static int example1(int[] arr) { // O(1)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j++) // loop from 0 to n-1 // O(n)\r\n\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\t}", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}", "public int[] fix34(int[] nums) {\r\n\tint i=0; // O(1)\r\n while(i<nums.length && nums[i]!=3) // O(n)\r\n i++; // n+1\r\n int j=i; // O(1)\r\n while(j+1<nums.length && nums[j+1]!=4) // O(n)\r\n j++; // n+1\r\n while(i<nums.length){ // O(n)\r\n if(nums[i]==3){ // O(1)\r\n int temp=nums[i+1]; // O(1)\r\n nums[i+1]=nums[j+1]; //O(1)\r\n nums[j+1]=temp; // O(1)\r\n while(j+1<nums.length && nums[j+1] != 4) //O(n)\r\n j++; // n+1\r\n }\r\n i++; // n+1\r\n }\r\n return nums; //O(1)\r\n}", "private final int m()\n\t { int n = 0;\n\t int i = 0;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break; i++;\n\t }\n\t i++;\n\t while(true)\n\t { while(true)\n\t { if (i > j) return n;\n\t if (cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t n++;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t }\n\t }", "@Override\r\n public long problem2() {\r\n ArrayList<String> arrList = new ArrayList<>();\r\n long start = System.currentTimeMillis(); \r\n for(int i = 0; i<1234567; i++){\r\n arrList.add(Integer.toString(i));\r\n }\r\n long end = System.currentTimeMillis(); \r\n return end - start; \r\n }", "public static int f5(int N) { \n int x = 0;\n // log(n)\n for(int i = N; i > 0; i = i/2)\n // O(n) + O(n/2) + O(n/4)\n x += f1(i);\n \n return x; \n \n }", "public static void main(String[] args) {\n\t\tint a[]= {15,3,7,1,9,2};\n\t\tsubarraysum(a,11);//Time complexity O(n^2) space O(1)\n\n\t\tsubarraysum_reducecomplexity(a,11,a.length); //Time complexity O(n) space O(1)\n\n\t}", "public boolean linearIn(int[] outer, int[] inner) {\r\n int comp=0; // O(1)\r\n int count=0; // O(1)\r\n if(inner.length==0) // O(1)\r\n return true; // O(1)\r\n for(int i=0; i<outer.length; i++) { // O(n)\r\n if(outer[i]==inner[count]) { // O(1)\r\n comp++; // O(1)\r\n count++; // O(1)\r\n } else if(outer[i]>inner[count]) // O(1)\r\n return false; // O(1)\r\n if (comp==inner.length) // O(1)\r\n return true; // O(1)\r\n }\r\n return false; // O(1)\r\n}", "public static void main(String args[] ) throws Exception {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n int[] seqArray = new int[n];\n for (int i = 0; i < n; i++) {\n seqArray[i] = scanner.nextInt();\n }\n // getSeqValue(seqArray); //this method is an accepted one on Hackerrank but time complexity is not order n; i.e. !O(n);\n getLinearOrderY(seqArray); // trying to get O(n) time complexity;\n }", "@Override public short getComplexity() {\n return 0;\n }", "public int findDuplicate(int[] nums) {\n if(nums == null || nums.length == 0) return 0;\n\n int slow = nums[0];\n int fast = nums[nums[0]];\n\n while(slow != fast) {\n slow = nums[slow];\n fast = nums[nums[fast]];\n }\n\n fast = 0;\n while(slow != fast) {\n slow = nums[slow];\n fast = nums[fast];\n }\n\n return slow;\n}", "public static void main(String[] args) {\n\n pairsSum();\n\n printAllSubArrays();\n\n tripletZero();\n\n // int[][] sub = subsets();\n\n PairsSum sum = new PairsSum();\n int[] arr = { 10, 1, 2, 3, 4, 5, 6, 1 };\n boolean flag = sum.almostIncreasingSequence(arr);\n System.out.println(flag);\n\n String s = \"\";\n for (int i = 0; i < 100000; i++) {\n // s += \"CodefightsIsAwesome\";\n }\n long start = System.currentTimeMillis();\n // int k = subStr(s, \"IsA\");\n System.out.println(System.currentTimeMillis() - start);\n // System.out.println(k);\n\n String[] a = { \"aba\", \"aa\", \"ad\", \"vcd\", \"aba\" };\n String[] b = sum.allLongestStrings(a);\n System.out.println(Arrays.deepToString(b));\n\n List<String> al = new ArrayList<>();\n al.toArray();\n\n Map<Integer, Integer> map = new HashMap<>();\n Set<Integer> keySet = map.keySet();\n for (Integer integer : keySet) {\n\n }\n\n String st = reverseBracksStack(\"a(bc(de)f)g\");\n System.out.println(st);\n\n int[] A = { 1, 2, 3, 2, 2, 3, 3, 33 };\n int[] B = { 1, 2, 2, 2, 2, 3, 2, 33 };\n\n System.out.println(sum.isIPv4Address(\"2.2.34\"));\n\n Integer[] AR = { 5, 3, 6, 7, 9 };\n int h = sum.avoidObstacles(AR);\n System.out.println(h);\n\n int[][] image = { { 36, 0, 18, 9 }, { 27, 54, 9, 0 }, { 81, 63, 72, 45 } };\n int[][] im = { { 7, 4, 0, 1 }, { 5, 6, 2, 2 }, { 6, 10, 7, 8 }, { 1, 4, 2, 0 } };\n int[][] res = sum.boxBlur(im);\n\n for (int i = 0; i < res.length; i++) {\n for (int j = 0; j < res[0].length; j++) {\n System.out.print(res[i][j] + \" \");\n }\n System.out.println();\n }\n\n boolean[][] ms = { { true, false, false, true }, { false, false, true, false }, { true, true, false, true } };\n int[][] mines = sum.minesweeper(ms);\n for (int i = 0; i < mines.length; i++) {\n for (int j = 0; j < mines[0].length; j++) {\n System.out.print(mines[i][j] + \" \");\n }\n System.out.println();\n }\n\n System.out.println(sum.variableName(\"var_1__Int\"));\n\n System.out.println(sum.chessBoard());\n\n System.out.println(sum.depositProfit(100, 20, 170));\n\n String[] inputArray = { \"abc\", \"abx\", \"axx\", \"abx\", \"abc\" };\n System.out.println(sum.stringsRearrangement(inputArray));\n\n int[][] queens = { { 1, 1 }, { 3, 2 } };\n int[][] queries = { { 1, 1 }, { 0, 3 }, { 0, 4 }, { 3, 4 }, { 2, 0 }, { 4, 3 }, { 4, 0 } };\n boolean[] r = sum.queensUnderAttack(5, queens, queries);\n\n }", "static long findSum(int N)\n\t{\n\t\tif(N==0) return 0;\n\t\treturn (long)((N+1)>>1)*((N+1)>>1)+findSum((int)N>>1);\n\t\t\n\t}", "private void faster() {\n BigInteger[] denoms = new BigInteger[1000];\n BigInteger[] nums = new BigInteger[1000];\n\n nums[0] = BigInteger.valueOf(3);\n denoms[0] = BigInteger.valueOf(2);\n\n for (int i = 1; i < 1000; i++) {\n denoms[i] = nums[i - 1].add(denoms[i - 1]);\n nums[i] = denoms[i].add(denoms[i - 1]);\n }\n\n int count = 0;\n for (int i = 1; i < 1000; i++) {\n if (nums[i].toString().length() > denoms[i].toString().length()) {\n count++;\n }\n }\n this.answer = count;\n }", "public static int solveEfficient(int n) {\n if (n == 0 || n == 1)\n return 1;\n\n int n1 = 1;\n int n2 = 1;\n int sum = 0;\n\n for (int i = 2; i <= n; i++) {\n sum = n1 + n2;\n n1 = n2;\n n2 = sum;\n }\n return sum;\n }", "public void sum2(int n){\n int sum =0; //1\n for (int j = 0; j < n; j++) //2n+2\n for (int k = 0; k < n; k++) //2n+2\n sum += k + j; //1\n for (int l = 0; l < n; l++) //2n+2\n sum += l; //1\n }", "public List<List<Integer>> threeSum(int[] nums) {\n List<List<Integer>> result = new ArrayList<>(nums.length);\n\n // Prepare\n Arrays.sort(nums);\n// int firstPositiveIndex = 0;\n// int negativeLength = 0;\n// List<Integer> numsFiltered = new ArrayList<>();\n// for (int i = 0; i < nums.length; i++) {\n// if (i == 0 || i == 1 || nums[i] == 0 || (nums[i] != nums[i-2])) {\n// numsFiltered.add(nums[i]);\n// if ((nums[i] >= 0) && (firstPositiveIndex == 0)) {\n// firstPositiveIndex = numsFiltered.size() - 1;\n// }\n// if ((nums[i] <= 0)) {\n// negativeLength = numsFiltered.size();\n// }\n// }\n// }\n// nums = numsFiltered.stream().mapToInt(i->i).toArray();\n\n // Func\n\n for(int i=0; (i < nums.length) && (nums[i] <= 0); i++) {\n if (i != 0 && nums[i] == nums[i-1]) {\n continue;\n }\n for(int j=i+1; j<nums.length; j++) {\n if (j != i+1 && nums[j] == nums[j-1]) {\n continue;\n }\n for(int k=nums.length-1; (k>j) && nums[k] >= 0; k--) {\n if (k != nums.length-1 && nums[k] == nums[k+1]) {\n continue;\n }\n int sum = nums[i]+nums[j]+nums[k];\n if (sum > 0) {\n continue;\n } else if (sum < 0) {\n break;\n }\n\n List<Integer> ok = new ArrayList<>();\n ok.add(nums[i]);\n ok.add(nums[j]);\n ok.add(nums[k]);\n result.add(ok);\n break;\n }\n }\n }\n\n// System.out.println(\"Finish time = \" + (System.nanoTime() - start) / 1_000_000);\n// System.out.println(\"result size = \" + result.size());\n\n return result;\n }", "static long nPolyNTime(int[] n) {\n int temp = n.length;\n long sum = 0;\n if(n == null || n.length == 0) return -1;\n for(int i = 0; i < n.length; ++i) {\n while(temp --> 0) {\n for(int j = 0; j < n.length; ++j) {\n sum += n[i] + n[j];\n }\n }\n }\n return sum;\n }", "int minOperations(int[] arr) {\n // Write your code here\n Set<String> set = new HashSet<>();//store visited string\n Queue<String> queue = new LinkedList<>(); // store next strs\n int counter = 0;\n\n queue.offer(getKey(arr));\n set.add(getKey(arr));\n\n while (!queue.isEmpty()) {\n int size = queue.size();\n List<String> curs = new ArrayList<>();\n while (size > 0) {\n curs.add(queue.poll());\n size--;\n }\n\n for(String cur : curs) {\n if (isIncreasing(cur)) {\n return counter;\n }\n\n for(int i = 0; i < cur.length(); i++) {\n String next = reverseString(cur, i);\n if (!set.contains(next)) {\n set.add(next);\n queue.offer(next);\n }\n }\n }\n\n counter++;\n }\n\n return counter;\n }", "private int d(@Nullable K ☃) {\r\n/* 127 */ return (xq.f(System.identityHashCode(☃)) & Integer.MAX_VALUE) % this.b.length;\r\n/* */ }\r\n/* */ private int b(@Nullable K ☃, int i) {\r\n/* */ int j;\r\n/* 131 */ for (j = i; j < this.b.length; j++) {\r\n/* 132 */ if (this.b[j] == ☃) {\r\n/* 133 */ return j;\r\n/* */ }\r\n/* 135 */ if (this.b[j] == a) {\r\n/* 136 */ return -1;\r\n/* */ }\r\n/* */ }", "public static int degreeOfArray(List<Integer> arr) { arr.length = n\n // num of Keys = k\n // O(n + k)\n // max value count = m\n //\n PriorityQueue<Node> pq = new PriorityQueue<>((i, j)-> j.count - i.count);\n Map<Integer, NodePosition> posMap = new HashMap<>();\n Map<Integer, Node> countMap = new HashMap<>();\n // [1, 2, 3, 4, 5, 6]\n for (int i = 0; i < arr.size(); i++) {\n int cur = arr.get(i);\n\n if (!countMap.containsKey(cur)) {\n countMap.put(cur, new Node(cur, 1));\n } else {\n Node curNode = countMap.get(cur);\n curNode.count++;\n countMap.put(cur, curNode);\n }\n\n if (!posMap.containsKey(cur)) {\n posMap.put(cur, new NodePosition(i, i));\n } else {\n NodePosition curNodePos = posMap.get(cur);\n curNodePos.endIndex = i;\n posMap.put(cur, curNodePos);\n }\n }\n //Iterator<Map.Entry<Integer, Node> it = new Iterator<>(countMap);\n for (Map.Entry<Integer, Node> e : countMap.entrySet()) {\n pq.add(e.getValue());\n }\n\n // [1, 2, 1, 3 ,2]\n // 1 , 2 , 3\n Node curNode = pq.remove();\n int maxCount = curNode.count;\n\n int minRange = posMap.get(curNode.num).endIndex - posMap.get(curNode.num).startIndex;\n\n while (!pq.isEmpty() && maxCount == pq.peek().count) {\n curNode = pq.remove();\n NodePosition nPos = posMap.get(curNode.num);\n minRange = Math.min(minRange, nPos.endIndex - nPos.startIndex);\n }\n\n return minRange + 1;\n }", "static void UseArrayList(ArrayList<Integer> myList2){\r\n\t\tLong start = System.currentTimeMillis();\r\n\t\tfor (int n=0; n<myList2.size();n++)\r\n\t\t{\r\n\t\t\tfor (int m=n+1; m<myList2.size();m++){\r\n\t\t\t\tif( myList2.get(n)== myList2.get(m) ) {System.out.println(\"Duplicate found \"+myList2.get(n));}\r\n\t\t\t}\r\n\t\t}\r\n\t\tLong End = System.currentTimeMillis();\r\n\t\tSystem.out.println(\"Total time taken for executing this code is: \" + (End-start));\r\n\t}", "public static int[] exe1(int[] arr){ // Solution O(n) in time and constant in Memory\n int nzeros=0;\n\n for (int i=0; i<arr.length; i++) {\n arr[i-nzeros] = arr[i];\n if (arr[i] == 0) {\n nzeros++;\n }\n }\n for (int i=arr.length-1; i>arr.length-nzeros-1; i--) {\n arr[i] = 0;\n }\n\n return arr;\n }", "static int[] sol1(int[]a, int n){\r\n\t\tMap <Integer,Integer> map= new HashMap();\r\n\t\tfor (int i = 0; i< a.length; i++){\r\n\t\t\tmap.put(a[i],i);\r\n\t\t}\r\n\t\tArrays.sort(a);\r\n\t\tint i = 0; \r\n\t\tint j = a.length -1;\r\n\t\twhile (i <= j){\r\n\t\t\tif(a[i]+a[j]>n) j--;\r\n\t\t\telse if (a[i]+a[j]<n) i++;\r\n\t\t\telse break;\r\n\t\t}\r\n\t\tint[] ans= {map.get(a[i]),map.get(a[j])};\r\n\t\treturn ans;\r\n\t}", "private static int betterSolution(int n) {\n return n*n*n;\n }", "private static void get4ElementsSumCountFastest(String inputLine, int target) {\n String[] arr = inputLine.split(\" \");\n if (arr.length < 3) {\n System.out.println(0);\n return;\n }\n\n Map<Integer, Set<String>> pairSumMap = new HashMap<>();\n List<Integer> list = new ArrayList<>(arr.length);\n for (String s : arr) {\n list.add(Integer.parseInt(s.trim()));\n }\n\n int sum = 0, diff = 0;\n for (int i = 0; i < arr.length; i++) {\n for (int j = i + 1; j < arr.length; j++) {\n sum = list.get(i) + list.get(j);\n if (sum < target) {\n pairSumMap.putIfAbsent(sum, new HashSet<>());\n pairSumMap.get(sum).add(i + \"-\" + j);\n }\n }\n }\n\n for (Map.Entry<Integer, Set<String>> mk : pairSumMap.entrySet()) {\n diff = target - mk.getKey();\n if (pairSumMap.containsKey(diff)) {\n Set<String> indexesList = mk.getValue();\n for (String index : indexesList) {\n int indexOrgX = Integer.parseInt(index.split(\"-\")[0]);\n int indexOrgY = Integer.parseInt(index.split(\"-\")[1]);\n for (String newIdx : pairSumMap.get(diff)) {\n int indexNewX = Integer.parseInt(newIdx.split(\"-\")[0]);\n int indexNewY = Integer.parseInt(newIdx.split(\"-\")[1]);\n if (indexOrgX != indexNewX && indexOrgX != indexNewY && indexOrgY != indexNewX && indexOrgY != indexNewY) {\n System.out.println(1);\n return;\n }\n }\n }\n }\n }\n System.out.println(0);\n }", "public static ArrayList<ArrayList<Integer>> fourSum(ArrayList<Integer> a, int k) {\n Collections.sort(a);\n System.out.println(a);\n LinkedHashMap<Integer, List<List<Integer>>> m = new LinkedHashMap<Integer, List<List<Integer>>>();\n for (int i = 0; i <= a.size() - 3; i++) {\n for (int j = i + 1; j <= a.size() - 2; j++) {\n if (m.get(a.get(i) + a.get(j)) == null) {\n ArrayList<List<Integer>> v = new ArrayList<List<Integer>>();\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n } else {\n List<List<Integer>> v = m.get(a.get(i) + a.get(j));\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n }\n\n }\n }\n LinkedHashSet<ArrayList<Integer>> res = new LinkedHashSet<ArrayList<Integer>>();\n for (int i = 2; i <= a.size() - 1; i++) {\n for (int j = i + 1; j < a.size(); j++) {\n List<List<Integer>> v = m.get(k - (a.get(i) + a.get(j)));\n if (v != null && v.size() >= 1) {\n for (List<Integer> l : v) {\n\n if (l.get(0) < l.get(1) && l.get(1) < i && l.get(1) < j) {\n //System.out.println(l.get(0) + \" \" + l.get(1) + \" \" + i + \" \" + j);\n ArrayList<Integer> out = new ArrayList<Integer>();\n out.add(a.get(l.get(0)));\n out.add(a.get(l.get(1)));\n out.add(a.get(i));\n out.add(a.get(j));\n Collections.sort(out);\n //System.out.println(out);\n res.add(out);\n }\n }\n }\n }\n }\n return new ArrayList<ArrayList<Integer>>(res);\n }", "public static int f3(int N) {\n \n // O(1)\n if (N == 0) return 1;\n else{ \n \n int x = 0;\n // O(N)\n for(int i = 0; i < N; i++)\n x += f3(N-1);\n return x;\n }\n }", "void h(List<List<Integer>> r, List<Integer> t, int n, int s){ \n for(int i = s; i*i <= n; i++){\n if(n % i != 0) continue; \n t.add(i);\n t.add(n / i);\n r.add(new ArrayList<>(t));\n t.remove(t.size() - 1);\n h(r, t, n/i, i);\n t.remove(t.size() - 1);\n }\n }", "public static int ulam(int n) {\n\n List<Integer> list = new ArrayList<>();\n list.add(1);\n list.add(2);\n\n int i = 3;\n while (list.size() < n) {\n\n int count = 0;\n for (int j = 0; j < list.size() - 1; j++) {\n\n for (int k = j + 1; k < list.size(); k++) {\n if (list.get(j) + list.get(k) == i)\n count++;\n if (count > 1)\n break;\n }\n if (count > 1)\n break;\n }\n if (count == 1)\n list.add(i);\n i++;\n }\n return list.get(n - 1);\n }", "private static int f(int n, int complete, int other, int[] arr) {\n if(n<=0)\n return 0;\n int res=0;\n ArrayList<Integer>list=new ArrayList<Integer>();\n for(int a:arr)\n if(a>0)\n list.add(a);\n int brr[]=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n while(brr.length!=0){\n int index=0;\n for(int i=1;i<brr.length;i++)\n if(brr[index]<brr[i])\n index=i;\n for(int i=0;i<brr.length;i++){\n if(index==i)\n brr[i]-=complete;\n else\n brr[i]-=other;\n }\n list=new ArrayList<Integer>();\n for(int a:brr)\n if(a>0)\n list.add(a);\n brr=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n res++;\n }\n return res;\n }", "@Override\r\n public long problem1(int size) {\r\n StringBuilder sb = new StringBuilder();\r\n long start = System.currentTimeMillis();\r\n for (int i=0; i<size; i++) {\r\n sb.append(i);\r\n }\r\n long end = System.currentTimeMillis();\r\n return end - start;\r\n }", "public static boolean find3Numbers(int A[], int n, int X) { \n \n // Your code \n for(int i=0;i<n-2;i++)\n {\n HashSet<Integer> set = new HashSet<>();\n int toFind=X-A[i];\n for(int j=i+1;j<n;j++)\n {\n if(set.contains(toFind-A[j]))\n {\n return true;\n }\n set.add(A[j]);\n }\n }\n return false;\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int T = sc.nextInt();\n for(int i = 0 ; i < T; i++) {\n int n = sc.nextInt();\n int a = sc.nextInt();\n int b = sc.nextInt();\n PriorityQueue<Integer> queue = new PriorityQueue<Integer>();\n int[][] m = new int[n][n];\n //n^2 * log(n)\n for(int row = 0; row < n; row++) {\n for(int col = 0; col < n; col++) {\n if(row == 0 && col == 0 && n != 1) {\n continue;\n }else if(row == 0) {\n m[row][col] = m[row][col - 1] + a;\n }else if(col == 0) {\n m[row][col] = m[row-1][col] + b;\n }else {\n m[row][col] = m[row-1][col-1] + a + b;\n }\n\n if(row + col == (n -1)) {\n pool.add(m[row][col]); //log(n)\n }\n }\n }\n //O(n*log(n))\n for (Integer item:pool) {\n queue.add(item); //O(logn)\n }\n while(!queue.isEmpty()) {\n System.out.print(queue.poll() + \" \"); //O(1)\n }\n System.out.println();\n queue.clear();\n pool.clear();\n }\n }", "private static long calc1()\n {\n final int min = 1000;\n final int max = 10000;\n\n // initialize\n List<List<Integer>> m = new ArrayList<>();\n for (int k = 0; k < end; k++) {\n List<Integer> list = new ArrayList<Integer>();\n int n = 1;\n while (k >= start) {\n int p = pkn(k, n);\n if (p >= max) {\n break;\n }\n if (p >= min) {\n list.add(p);\n }\n n++;\n }\n m.add(list);\n }\n\n boolean[] arr = new boolean[end];\n arr[start] = true;\n\n List<Integer> solutions = new ArrayList<>();\n List<Integer> list = m.get(start);\n for (Integer first : list) {\n LinkedList<Integer> values = new LinkedList<>();\n values.add(first);\n f(m, arr, values, 1, solutions);\n // we stop at the first solution found\n if (!solutions.isEmpty()) {\n break;\n }\n }\n\n // solutions.stream().forEach(System.out::println);\n int res = solutions.stream().reduce(0, Integer::sum);\n return res;\n }", "public int findFirstUniqueNumber (List<Integer> numberList) {\n\n ////// Solution 1:\n LinkedHashMap<Integer, Integer> occurMap = new LinkedHashMap<>();\n\n for (int number: numberList) { // O(n)\n if (occurMap.containsKey(number) && occurMap.get(number) != 0) {\n occurMap.replace(number, occurMap.get(number), 0);\n }\n occurMap.putIfAbsent(number, 1);\n }\n\n for (Map.Entry<Integer, Integer> entry: occurMap.entrySet()) {\n if (entry.getValue() == 1) {\n return entry.getKey();\n }\n }\n\n ////// Solution 2: O(n * n)\n// for (int n: numberList) {\n// if (numberList.indexOf(n) == numberList.lastIndexOf(n)) { // O(n * n)\n// return n;\n// }\n// }\n\n return -1;\n }", "public static void main(String[] args) \n {\n int[] numOfPoints = { 1000, 10000, 7000, 10000, 13000 };\n for(int count = 0; count < numOfPoints.length; count++)\n {\n List<Point> pointsTobeUsed = new ArrayList<Point>();\n int current = numOfPoints[count];\n int inc = 0;\n \n //creating list of points to be used\n for(int x = 0; x <= current; x++)\n {\n \n if(x <= current/2)\n {\n pointsTobeUsed.add(new Point(x,x));\n \n }\n else\n {\n pointsTobeUsed.add(new Point(x, x - (1 + 2*(inc)) ) );\n inc++;\n }\n }\n \n //n logn implementation of Pareto optimal\n long timeStart = System.currentTimeMillis();\n \n // n logn quicksort\n pointsTobeUsed = quickSort(pointsTobeUsed, 0, pointsTobeUsed.size() -1 );\n \n \n \n ParetoOptimal(pointsTobeUsed);\n \n \n long timeEnd = System.currentTimeMillis();\n System.out.println(\"final:\" + \" exper: \" + (timeEnd - timeStart) + \" N: \" + current ); \n }\n }", "public static void arraySpeedTestRemove0() {\n ArrayList<Integer> list = new ArrayList<Integer>();\n\t\tfor(int n = 0; n < 8000000; n++) {\n list.add(n);\n }\n\n //Displaying quantity of elements\n\t\tSystem.out.println(\"*** Quantity of elements in the collection: \" + list.size());\n\n //Deleting last element in the collection\n long begin = System.currentTimeMillis();\n\t\tlist.remove(list.size()-1);\n long end = System.currentTimeMillis();\n\n //Displaying time of deletion\n\t\tSystem.out.println(\"*** Removing last element has taken: \" + (end - begin) + \"ms\");\n\n //Deleting first element from collection\n begin = System.currentTimeMillis();\n\t\tlist.remove(0);\n end = System.currentTimeMillis();\n\n //Displaying time of deletion\n\t\tSystem.out.println(\"*** Removing first element has taken: \" + (end - begin) + \"ms\");\n}", "public static void targetSumPair(int[] arr, int target){\n //write your code here\n Arrays.sort(arr); // O(nlogn)\n int i=0, j=arr.length-1;\n while(i < j) {\n if(arr[i]+arr[j] < target) {\n i++;\n }\n else if(arr[i] + arr[j] > target)\n j--;\n else {\n System.out.println(arr[i] + \", \" + arr[j]);\n i++; j--;\n }\n }\n }", "private static int distance(ArrayList<Integer>[] adj, ArrayList<Integer>[] cost, int s, int t) {\n\n Set<Integer> visited = new HashSet<>(); //option 1\n Map<Integer, Integer> distance = new HashMap<>();\n// Queue<Integer> q = new PriorityQueue<>(11, (o1, o2) -> { //option 0\n// Integer d1 = distance.get(o1); //option 0\n// Integer d2 = distance.get(o2); //option 0\n Queue<Map.Entry<Integer, Integer>> q = new PriorityQueue<>(11, (o1, o2) -> { //option 1\n Integer d1 = o1.getValue(); //option 1\n Integer d2 = o2.getValue(); //option 1\n\n if (Objects.equals(d1, d2)) return 0;\n if (d1 == null) return 1;\n if (d2 == null) return -1;\n\n return d1 - d2;\n });\n\n distance.put(s, 0);\n// q.addAll(IntStream.range(0, adj.length).boxed().collect(Collectors.toList())); //option 0\n q.add(new AbstractMap.SimpleImmutableEntry<>(s, 0)); //option 1\n\n while (!q.isEmpty()) {\n// int u = q.remove(); //option 0\n int u = q.remove().getKey(); //option 1\n\n if (u == t) {\n Integer dist = distance.get(u);\n if (dist == null) return -1;\n return dist;\n }\n\n if (visited.contains(u)) continue; //option 1\n visited.add(u); //option 1\n\n List<Integer> adjList = adj[u];\n List<Integer> costList = cost[u];\n for (int i = 0; i < adjList.size(); i++) {\n int v = adjList.get(i);\n int w = costList.get(i);\n Integer dist = distance.get(v);\n Integer newDist = distance.get(u);\n if (newDist != null) newDist += w;\n\n if (newDist != null && (dist == null || dist > newDist)) {\n //relax\n distance.put(v, newDist);\n// q.remove(v); //option 0\n// q.add(v); //option 0\n q.add(new AbstractMap.SimpleImmutableEntry<>(v, distance.get(v))); //option 1\n }\n }\n }\n\n return -1;\n }", "private int e(amj paramamj)\r\n/* 202: */ {\r\n/* 203:221 */ alq localalq = paramamj.b();\r\n/* 204:222 */ int i = paramamj.b;\r\n/* 205: */ \r\n/* 206:224 */ int j = d(paramamj);\r\n/* 207:225 */ if (j < 0) {\r\n/* 208:226 */ j = j();\r\n/* 209: */ }\r\n/* 210:228 */ if (j < 0) {\r\n/* 211:229 */ return i;\r\n/* 212: */ }\r\n/* 213:231 */ if (this.a[j] == null)\r\n/* 214: */ {\r\n/* 215:232 */ this.a[j] = new amj(localalq, 0, paramamj.i());\r\n/* 216:233 */ if (paramamj.n()) {\r\n/* 217:234 */ this.a[j].d((fn)paramamj.o().b());\r\n/* 218: */ }\r\n/* 219: */ }\r\n/* 220:238 */ int k = i;\r\n/* 221:239 */ if (k > this.a[j].c() - this.a[j].b) {\r\n/* 222:240 */ k = this.a[j].c() - this.a[j].b;\r\n/* 223: */ }\r\n/* 224:242 */ if (k > p_() - this.a[j].b) {\r\n/* 225:243 */ k = p_() - this.a[j].b;\r\n/* 226: */ }\r\n/* 227:246 */ if (k == 0) {\r\n/* 228:247 */ return i;\r\n/* 229: */ }\r\n/* 230:250 */ i -= k;\r\n/* 231:251 */ this.a[j].b += k;\r\n/* 232:252 */ this.a[j].c = 5;\r\n/* 233: */ \r\n/* 234:254 */ return i;\r\n/* 235: */ }", "public static void main(String[] args) {\n\t\tArrays.fill(arr, 1);\n\t\tlong startTime = System.nanoTime();\n\t\t// Traverse till square root of MAX\n\t\t// Using logic similar to sieve of eratosthenes to\n\t\t// populate factor sum array\n\t\tint limit = (int)Math.sqrt(MAX);\n\t\tfor (int i = 2; i <= limit; ++i) {\n\t\t\tint j = i+i;\n\t\t\tint count = 2;\n\t\t\twhile (j <= MAX){\n\t\t\t\t// As we already add count (j/i) to the factor sum when adding i,\n\t\t\t\t// we don't add when i is equal to or greater than count\n\t\t\t\tif (i < count) {\n\t\t\t\t\t// Adding i and count (j/i) to the factor sum of j\n\t\t\t\t\tarr[j] += i;\n\t\t\t\t\tarr[j] += count;\n\t\t\t\t}\n\t\t\t\tj += i;\n\t\t\t\tcount++;\n\t\t\t} \n\t\t}\n\t\t\n\t\tint count = 0;\n\t\tSystem.out.println(\"The following are amicable numbers\");\n\t\tfor (int i = 2; i <= MAX; ++i) {\n\t\t\tint num = arr[i];\n\t\t\tif (num <= MAX && num > i) {\n\t\t\t\tif (arr[num] == i) {\n\t\t\t\t\tSystem.out.println(count+\": \"+i+\" and \"+num);\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tlong endTime = System.nanoTime();\n\t\tdouble duration = timeInSec(endTime,startTime) ;\n\t\tSystem.out.println(\"Run time \" + duration + \" : secs\");\t\t\n\t}", "public static void a2v2(int[] A)\n {\n Map<Integer, List<Integer>> hashMap = new HashMap<>();\n\n insert(hashMap, 0, -1);\n\n int sum = 0;\n\n for (int i = 0; i < A.length; i++)\n {\n sum += A[i];\n\n if (hashMap.containsKey(sum))\n {\n List<Integer> list = hashMap.get(sum);\n\n // find all subarrays with the same sum\n for (Integer value: list)\n {\n System.out.println(\"Subarray [\" + (value + 1) + \"…\" +\n i + \"]\");\n }\n }\n\n // insert (sum so far, current index) pair into the hashmap\n insert(hashMap, sum, i);\n }\n }", "public long findFastestTime()\r\n {\r\n for(int top = 1; top < listOfTimes.size(); top++)\r\n { \r\n long item = listOfTimes.get(top); \r\n int i = top;\r\n\r\n while(i > 0 && item < listOfTimes.get(i - 1))\r\n {\r\n listOfTimes.set(i, listOfTimes.get(i- 1));\r\n i--;\r\n }//end while \r\n\r\n listOfTimes.set(i, item);\r\n }//end for \r\n\r\n return listOfTimes.get(0);\r\n }", "static int[] OnepassSol1(int[]a, int n){\r\n Map<Integer, Integer> map = new HashMap<>();\r\n for (int i = 0; i < a.length; i++) {\r\n int complement = n - a[i];\r\n if (map.containsKey(complement)) {\r\n return new int[] { map.get(complement), i };\r\n }\r\n map.put(a[i], i);\r\n }\r\n int[] ans = {-1,-1};\r\n return ans;\r\n }", "static long arrayManipulation(int n, int[][] queries) {\r\n long result = 0, sum = 0;\r\n long[] arr = new long[n];\r\n for(int i = 0; i < queries.length; i++){\r\n int firstIndex = queries[i][0] - 1;\r\n int lastIndex = queries[i][1] - 1;\r\n long numberToAdd = queries[i][2];\r\n arr[firstIndex] += numberToAdd;\r\n if (lastIndex+1 < n)\r\n arr[lastIndex+1] -= numberToAdd;\r\n }\r\n\r\n for(long l : arr){\r\n sum += l;\r\n if(sum > result)\r\n result = sum;\r\n }\r\n\r\n return result;\r\n }", "private void baseAlgorithm() {\n\t\tlong start = System.nanoTime();\n\t\tinitCentroids();\n\t\tint counter = 0;\n\t\twhile (counter < 1000\n\t\t\t\t&& (lastCentroids == null || !SeriesComparator.equalClustering(lastCentroids, centroids))) {\n\t\t\tresetClusters();\n\t\t\tassignPoints();\n\t\t\tlastCentroids = new ArrayList<Point2D>(centroids);\n\t\t\tcalculateNewMean();\n\t\t\tbasicIterations++;\n\t\t\tcounter++;\n\t\t}\n\t\tconvertToClustering();\n\t\tbasicRuntime = System.nanoTime() - start;\n\t}", "public void sum(int n) {\n int sum = 0;\n for (int j = 0; j < n; j++) // 2n+2\n sum += j;\n for (int k = 0; k < n; k++) // 2n+2\n sum += k;\n for (int l = 0; l < n; l++) //2n+2\n sum += l;\n }", "static int logTime(int[] n, int start, int end, int val) {\n if(n == null || n.length == 0) return -1;\n int mid = (start + end) / 2;\n if(val < n[mid]) logTime(n, 0, mid, val);\n if(val > n[mid]) logTime(n, mid + 1, n.length, val);\n return n[mid];\n }", "static int countSubarrWithEqualZeroAndOne(int arr[], int n)\n {\n int count=0;\n int currentSum=0;\n HashMap<Integer,Integer> mp=new HashMap<>();\n for(int i=0;i<arr.length;i++)\n {\n if(arr[i]==0)\n arr[i]=-1;\n currentSum+=arr[i];\n \n if(currentSum==0)\n count++;\n if(mp.containsKey(currentSum))\n count+=mp.get(currentSum);\n if(!mp.containsKey(currentSum))\n mp.put(currentSum,1);\n else\n mp.put(currentSum,mp.get(currentSum)+1);\n \n \n }\n return count;\n }", "static public int solve(int n,int A[])\n {\n int freqArr[] = new int[1001];\n int dp[] = new int[1001];\n\n for(int i=0; i<n; i++){\n freqArr[A[i]]++;\n }\n\n dp[0] = 0;\n dp[1] = freqArr[1] > 0 ? freqArr[1] : 0;\n\n for(int i=2; i<=1000; i++){\n dp[i] = Math.max(dp[i-2] + i*freqArr[i], dp[i-1]);\n }\n return dp[1000];\n }", "static int[] find2(int a[]){\r\n int sum = a[0];\r\n int pro = a[0];\r\n for(int i=1;i<a.length;i++){\r\n sum += a[i];\r\n pro += a[i]*a[i];\r\n }\r\n int s = (n*(n+1))/2 - sum;\r\n int p = (n*(n+1)*(2*n+1))/6 - pro;\r\n return solveSP(s, p);\r\n }", "public boolean containsNearbyDuplicate2(int[] nums, int k) {\n\n int max = Integer.MIN_VALUE;\n for (int i = 0; i < nums.length; i++) {\n max=Math.max(max,nums[i]);\n }\n Integer[] map = new Integer[max+1];\n for (int i = 0; i < nums.length; i++) {\n Integer c = map[nums[i]];\n if(c!=null && i-c<=k){\n return true;\n }else {\n map[nums[i]]=i;\n }\n }\n return false;\n }", "public int solution(int K, int[] A) {\n HashMap<Integer,ArrayList<Integer>> map = new HashMap<Integer,ArrayList<Integer>>();\n \n int dup=0,nonDup=0;\n for (int i=0;i< A.length;i++){\n if(2*A[i]==K){\n if(!map.containsKey(A[i])){\n dup++;\n map.put(A[i],new ArrayList<Integer>());\n }\n continue;\n }\n \n if(!map.containsKey(A[i])){\n \tmap.put(A[i],new ArrayList<Integer>());\n }\n map.get(A[i]).add(i);\n nonDup+=map.get(K-A[i]).size();\n }\n return nonDup*2+dup;\n }", "public static long journeyToMoon(int n, List<List<Integer>> astronaut) {\n // Write your code here\n Map<Integer, Node<Integer>> countryMap = new HashMap<>();\n for(List<Integer> pairs: astronaut) {\n Node<Integer> node1 = countryMap.computeIfAbsent(pairs.get(0), Node::new);\n Node<Integer> node2 = countryMap.computeIfAbsent(pairs.get(1), Node::new);\n node1.connected.add(node2);\n node2.connected.add(node1);\n }\n\n List<Integer> countryCluster = new ArrayList<>();\n for(Node<Integer> node: countryMap.values()) {\n if(node.connected.size() == 0) {\n countryCluster.add(1);\n } else if(!node.visited){\n countryCluster.add(getNodeCount3(node));\n }\n }\n List<Integer> countryNodes = countryMap.values().stream().map(nn -> nn.value).collect(Collectors.toList());\n List<Integer> missingNodes = new ArrayList<>();\n for(int i=0; i < n; i++) {\n if(!countryNodes.contains(i))\n missingNodes.add(i);\n }\n\n for(int i=0; i < missingNodes.size(); i++) {\n countryCluster.add(1);\n }\n\n long ans = 0;\n //For one country we cannot pair with any other astronauts\n if(countryCluster.size() >= 2) {\n ans = (long) countryCluster.get(0) * countryCluster.get(1);\n if(countryCluster.size() > 2) {\n int sum = countryCluster.get(0) + countryCluster.get(1);\n for(int i=2; i < countryCluster.size(); i++) {\n ans += (long) sum * countryCluster.get(i);\n sum += countryCluster.get(i);\n }\n }\n }\n\n /*\n permutation of two set with size A and B = AxB\n permutation of three set with size A,B,C = AxB + AxC + BxC = AxB + (A+B)xC\n permutation of four set with size A,B,C,D = AxB + AxC + AxD + BxC + BxD + CxD = AxB + (A+B)xC + (A+B+C)xD\n */\n /*\n if(keys.length == 1) {\n ans = keys[0].size();\n } else {\n ans = keys[0].size() * keys[1].size();\n if(keys.length > 2) {\n int sum = keys[0].size() + keys[1].size();\n for (int i = 2; i < keys.length; i++) {\n ans += sum * keys[i].size();\n sum += keys[i].size();\n }\n }\n }\n */\n return ans;\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tint sum = sc.nextInt();\n\t\tHashMap<Integer,Integer> map = new HashMap<>();\n \t\tArrays.sort(arr);\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint reqSum = sum-temp;\n\t\t\tarr[i]=0;\n\t\t\tint l=0;\n\t\t\tint r = n-1;\n\t\t\twhile(l<r) {\n\t\t\t\t//System.out.println(\"l \" + l + \" r \" + r + \" i = \"+ i);\n\t\t\t\tif(arr[l] + arr[r]==reqSum && arr[l]!=0 && arr[r]!=0 ) {\n\t\t\t\t\tint arr2[] = new int[3];\n\t\t\t\t\tarr2[0] = temp;\n\t\t\t\t\tarr2[1] = arr[l];\n\t\t\t\t\tarr2[2] = arr[r];\n\t\t\t\t\tif(map.containsKey(arr2[0]) || map.containsKey(arr2[1]) || map.containsKey(arr2[2])) {\n\t\t\t\t\t\t\n\t\t\t\t\t}else {\n\t\t\t\t\t\tArrays.sort(arr2);\n\t\t\t\t\t\tSystem.out.println(arr2[0] + \" \" + arr2[1] + \" \" + arr2[2]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tl++;\n\t\t\t\t}else if(arr[l] + arr[r] < reqSum) {\n\t\t\t\t\tl++;\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tr--;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tarr[i] = temp;\t\n\t\t\tmap.put(arr[i], 1);\n\t\t}\n\t}", "public static boolean addUpToFast(int[] array, int n){\n\t\tHashSet<Integer> hs = new HashSet<Integer>();\n\t\tfor(int i = 0; i < array.length; i++){\n\t\t\tif(hs.contains(n-array[i]))\n\t\t\t\treturn true;\n\t\t\ths.add(array[i]);\n\t\t}\n\t\treturn false;\n\t}", "static BigInteger findSum(BigInteger n) {\n if (n.equals(BigInteger.ZERO))\n return BigInteger.ZERO;\n BigInteger TWO = BigInteger.valueOf(2);\n\n BigInteger sum = BigInteger.ZERO;\n sum = sum.add(\n n.multiply(n.add(BigInteger.ONE))\n .divide(TWO)\n );\n\n BigInteger flooredN = findFraction(n);\n sum = sum.add(\n n.multiply(flooredN)\n );\n\n sum = sum.subtract(\n flooredN.multiply(flooredN.add(BigInteger.ONE))\n .divide(TWO)\n );\n\n sum = sum.subtract(findSum(flooredN));\n\n return sum;\n }", "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}", "static int trappingWater(int arr[], int n) {\r\n\r\n // Your code here\r\n /** *** tle\r\n for(int i=1;i<n-1;i++){\r\n int l=arr[i];\r\n for (int j = 0; j < i; j++) {\r\n l=l < arr[j] ? arr[j] : l;\r\n }\r\n int r=arr[i];\r\n for (int j = i+1; j <n ; j++) {\r\n r=r < arr[j] ? arr[j] : r;\r\n }\r\n\r\n s=s+(l>r? r:l) -arr[i];\r\n }\r\n return s;\r\n\r\n //////////////////////////////////////////////\r\n SC=O(N)\r\n if(n<=2)\r\n return 0;\r\n int[] left=new int[n];\r\n int[] right=new int[n];\r\n left[0]=0;\r\n int leftmax=arr[0];\r\n for (int i = 1; i <n ; ++i) {\r\n left[i]=leftmax;\r\n leftmax=Math.max(leftmax,arr[i]);\r\n }\r\n right[n-1]=0;\r\n int mxright=arr[n-1];\r\n for (int i = n-2; i >=0 ; --i) {\r\n right[i]=mxright;\r\n mxright=Math.max(mxright,arr[i]);\r\n }\r\n int s=0;\r\n for (int i = 1; i < n-1; ++i) {\r\n if(arr[i]<left[i] && arr[i]<right[i]){\r\n s+=Math.min(left[i],right[i])-arr[i];\r\n }\r\n }\r\n return s;\r\n /////////////////////////////////////////////////////\r\n **/\r\n\r\n if(n<=2)\r\n return 0;\r\n\r\n int leftMax = arr[0];\r\n int rightMax = arr[n-1];\r\n\r\n int left = 1;\r\n int right = n-2;\r\n int water = 0;\r\n\r\n while(left <= right) {\r\n if (leftMax < rightMax) {\r\n if (arr[left] >= leftMax) {\r\n leftMax = arr[left];\r\n } else\r\n water = water + (leftMax - arr[left]);\r\n\r\n //leftMax = Math.max(leftMax, arr[left]);\r\n left++;\r\n } else {\r\n if (arr[right] > rightMax) {\r\n rightMax = arr[right];\r\n }\r\n\r\n water = water + (rightMax - arr[right]);\r\n right--;\r\n }\r\n }\r\n return water;\r\n\r\n }", "public static int solution(int[] arr) {\n int n = arr.length;\n for (int i = 0; i < n; i++) {\n while (arr[i] != i + 1 && arr[i] < n && arr[i] > 0) {\n int temp = arr[i];\n if (temp == arr[temp - 1])\n break;\n arr[i] = arr[temp - 1];\n arr[temp - 1] = temp;\n }\n }\n for (int i = 0; i < n; i++)\n if (arr[i] != i + 1)\n return i + 1;\n return n + 1;\n }", "public static void main(String[] args) {\n int N = 100, i, j, min;\n System.out.println(\"Value of N: \" + N);\n\n for (i = 1; i <= N; i++)\n {\n for (j = 1; j <= N; j++)\n {\n min = i < j ? i : j;\n System.out.print(N - min + 1);\n }\n System.out.println();\n\n\n\n\n }\n}", "public static void main(String[] args){\n int MIN = Integer.parseInt(args[0]);\n MAX = Integer.parseInt(args[1]);\n cutoffs = new int[args.length - 2];\n cache = new ArrayList<IndexedArrayList<SuperSavvyTrieHelper2>>();\n for (int i = 2; i < args.length; i++){\n cutoffs[i - 2] = Integer.parseInt(args[i]);\n cache.add(new IndexedArrayList<SuperSavvyTrieHelper2>());\n }\n for (int i = 0; i < cutoffs.length / 2; i++){\n int temp = cutoffs[i];\n cutoffs[i] = cutoffs[cutoffs.length - 1 - i];\n cutoffs[cutoffs.length - 1 - i] = temp;\n }\n multiplicitiesUsed = new boolean[MAX + 1];\n basesUsed = new DoublyLinkedArray(MAX + 1);\n SuperSavvyTrieHelper2.setCorrespondance(basesUsed);\n /*\n long count1 = lowerRecursion(MAX, 0);\n long count2 = middleRecursion(MAX, 0);\n long count3 = upperRecursion(MAX, 0);\n long total = count1 + count2 + count3;\n System.out.printf(\"%d + %d + %d = %d\\n\", count1, count2, count3, total);\n */\n hitCounts = new long[cutoffs.length];\n missCounts = new long[cutoffs.length];\n statCollector = new StatCollector(cutoffs);\n\n long startTime = System.nanoTime();\n long[] values = new long[MAX - MIN + 1];\n for (int i = MIN; i <= MAX; i++) {\n values[i - MIN] = upperRecursionWrapper(i);\n }\n //long[] testValues = new long[] {1752443,1911046, 2067456,2249444,2429337, 2647532,2852449,3101167,3350292,3632299,3916575};\n for (int i = 0; i < values.length; i++){\n //if (testValues[i] != values[i]){\n System.out.printf(\"%d: %d\\n\", i + MIN, values[i]);\n //}\n }\n long endTime = System.nanoTime();\n System.out.printf(\"%f,\", (double)(endTime - startTime) / 1000000000.0);\n long totalMissCounts = 0;\n long totalMissWeight1 = 0;\n long totalMissWeight2 = 0;\n long totalMissWeight3 = 0;\n /*\n for (int i = 0; i < cutoffs.length; i++){\n long totalCounts = hitCounts[i] + missCounts[i];\n totalMissCounts += missCounts[i];\n totalMissWeight1 += missCounts[i] * cutoffs[i];\n totalMissWeight2 += (hitCounts[i] / missCounts[i]) * cutoffs[i];\n totalMissWeight3 += (hitCounts[i] - missCounts[i]) * cutoffs[i] * cutoffs[i];\n System.out.printf(\"\\tCache %d: %d/%d/%d (%.5f%%)\", cutoffs[i], hitCounts[i], missCounts[i], totalCounts, (double) hitCounts[i] / totalCounts);\n }\n System.out.printf(\"\\t\\tMissCounts: %d, weighted: %d, ratio: %d, diff^2: %d\\n\", totalMissCounts, totalMissWeight1, totalMissWeight2, totalMissWeight3);\n */\n statCollector.printAll();\n }", "static int runningTime(int[] arr) {\n return insertionSort(arr);\n \n }", "public static int[] twoSum(int[] numbers, int target) {\n // Start typing your Java solution below\n // DO NOT write main() function\n int[] aux = new int[numbers.length];\n HashMap<Integer, Integer> valueToIndex = new HashMap<Integer, Integer>();\n for (int i = 0; i < numbers.length; i++) {\n valueToIndex.put(numbers[i], i);\n aux[i] = numbers[i];\n }\n \n int i = 0, j = numbers.length - 1;\n boolean found = false;\n \n Arrays.sort(aux);\n \n while (i != j) {\n if (aux[i] + aux[j] < target) i++;\n else if (aux[i] + aux[j] > target) j--;\n else {\n found = true;\n break;\n }\n }\n \n if (!found) return null;\n \n int[] result = new int[2];\n if (aux[i] == aux[j]) { /* Handle duplicates */\n int first = -1, second = -1;\n for (int k = 0; k < numbers.length; k++) {\n if (numbers[k] == aux[i]) {\n if (first == -1) {\n first = k;\n } else if (second == -1) {\n second = k;\n break;\n }\n }\n }\n result[0] = first + 1;\n result[1] = second + 1;\n return result;\n }\n \n \n if (valueToIndex.get(aux[i]) < valueToIndex.get(aux[j])) {\n result[0] = valueToIndex.get(aux[i]) + 1;\n result[1] = valueToIndex.get(aux[j]) + 1;\n } else {\n result[0] = valueToIndex.get(aux[j]) + 1;\n result[1] = valueToIndex.get(aux[i]) + 1;\n }\n return result;\n }", "public static void main(String[] args){\n int s = 80;\n int n = (int) Math.pow(10, 7);\n Integer[] a = new Integer[n];\n Random rand = new Random();\n for (int i = 0; i < n; i++){\n a[i] = (int) (n*rand.nextDouble());\n }\n double binTime = binSearchT(s, a);\n double linTime = linSearchT(s, a);\n System.out.println(\"binTime: \"+ binTime);\n System.out.println(\"linTime: \"+ linTime);\n\n }", "private int getCondensedIndex(int n, int i, int j) {\n if (i < j) {\n return n * i - (i * (i + 1) / 2) + (j - i - 1);\n }\n else if (i > j) {\n return n * j - (j * (j + 1) / 2) + (i - j - 1);\n }\n else{\n return 0;\n }\n }", "public static void cntArray(int A[], int N) \n { \n // initialize result with 0 \n int result = 0; \n \n for (int i = 0; i < N; i++) { \n \n // all size 1 sub-array \n // is part of our result \n result++; \n \n // element at current index \n int current_value = A[i]; \n \n for (int j = i + 1; j < N; j++) { \n \n // Check if A[j] = A[i] \n // increase result by 1 \n if (A[j] == current_value) { \n result++; \n } \n } \n } \n \n // print the result \n System.out.println(result); \n }", "public static int solutionN2(int[] A) {\n\n\t\tclass Pair {\n\t\t\tpublic int start;\n\t\t\tpublic int end;\n\n\t\t\tpublic Pair(int start, int end) {\n\t\t\t\tthis.start = start;\n\t\t\t\tthis.end = end;\n\t\t\t}\n\t\t}\n\n\t\tPair[] pairs = new Pair[A.length];\n\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tpairs[i] = new Pair(i - A[i], i + A[i]);\n\t\t}\n\n\t\tArrays.sort(pairs, new Comparator<Pair>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Pair o1, Pair o2) {\n\t\t\t\treturn o1.start - o2.start;\n\t\t\t}\n\t\t});\n\n\t\tint countIntersection = 0;\n\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tPair current = pairs[i];\n\n\t\t\tfor (int j = i + 1; j < A.length; j++) {\n\t\t\t\tPair p = pairs[j];\n\t\t\t\tif (current.end >= p.start) {\n\t\t\t\t\tcountIntersection++;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (countIntersection > 10000000)\n\t\t\treturn -1;\n\n\t\treturn countIntersection;\n\t}", "private static void traverse(int i, int j) {\r\n\t\tif(i + j == SIZE + SIZE){\r\n\t\t\tCOUNT++;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(i < SIZE){\r\n\t\t\ttraverse(i + 1, j);\r\n\t\t}\r\n\t\tif(j < SIZE){\r\n\t\t\ttraverse(i, j + 1);\r\n\t\t}\r\n\t}", "public int solution(int N) {\n\n int l = 0; // 2*l - r\n int r = 1; // 2*r - l\n\n return search(l, r, N);\n }", "private void discretization(int[] nums) {\n\t\tint[] sorted = nums.clone();\n\t\tArrays.sort(sorted);\n\t\tfor (int i = 0; i < nums.length; i++) {\n\t\t\tnums[i] = Arrays.binarySearch(sorted, nums[i]);\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tboolean[] primes = new boolean[1000000];\r\n\t\tArrayList<Integer> consecutivePrimeSums = new ArrayList<>();\r\n\t\tfor (int i = 0; i < primes.length; i++) {\r\n\t\t\tprimes[i] = true;\r\n\t\t}\r\n\t\tprimes[0] = false;//1 is not prime number\r\n\t\tfor (int p = 2; p*p <= 1000000; p++) {\r\n\t\t\tif (primes[p-1] == true) {\r\n\t\t\t\tfor (int q = p*p; q <= 1000000; q += p) {\r\n\t\t\t\t\tprimes[q-1] = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Store the consecutive prime sums as we iterate through the boolean array\r\n\t\tconsecutivePrimeSums.add(0);\r\n\t\tint currentIndex = 1;\r\n\t\tfor (int j = 0; j < primes.length; j++) {\r\n\t\t\tif (primes[j] == true) {\r\n\t\t\t\tconsecutivePrimeSums.add(consecutivePrimeSums.get(currentIndex-1) + (j+1));\r\n\t\t\t\tcurrentIndex++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Now we use 2 nested for loops to loop through all possible consecutive prime sums\r\n\t\tint maxLength = 0;\r\n\t\tint ans = 0;\r\n\t\tfor (int k = consecutivePrimeSums.size()-1; k >= 2; k--) {\r\n\t\t\tfor (int m = k-2; m >= 0; m--) {\r\n\t\t\t\tint currentSum = consecutivePrimeSums.get(k) - consecutivePrimeSums.get(m);\r\n\t\t\t\tif (currentSum >= 1000000)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif (primes[currentSum-1] == true && (k-m) > maxLength) {\r\n\t\t\t\t\tans = currentSum;\r\n\t\t\t\t\tmaxLength = k-m;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(ans);\r\n\t\t/*long endTime = System.nanoTime();\r\n\t\tlong timeElapsed = endTime - startTime;\r\n\t\tSystem.out.println(timeElapsed/1000000 + \" ms\");*/\r\n\t}", "static int getMissingByAvoidingOverflow(int a[], int n)\n\t {\n\t int total = 2;\n\t for (int i = 3; i <= (n + 1); i++)\n\t {\n\t total =total+ i -a[i - 2];\n\t //total =total- a[i - 2];\n\t }\n\t return total;\n\t }", "static long solve(long[] d) {\n int len = d.length;\n long[] dp = new long[len];\n\n Set<Long> set = new HashSet<>();\n\n for (int index1 = len - 1; index1 >= 0; index1--) {\n int count = 0;\n for (int index2 = index1 + 1; index2 < len; index2++) {\n if (d[index2] > d[index1]) {\n if( set.contains(d[index2] ) )continue;\n set.add(d[index2]);\n count++;\n }\n }\n set = new HashSet<>();\n dp[index1] = count;\n }\n\n long res = 0;\n Set<Long> distinct = new HashSet<>();\n for (int index1 = 0; index1 < len; index1++) {\n long curr = d[index1];\n if (distinct.contains(curr)) {\n continue;\n } else distinct.add(curr);\n for (int index2 = index1 + 1; index2 < len; index2++) {\n if (d[index2] > curr) {\n if (set.contains(d[index2])) continue;\n res += dp[index2];\n set.add(d[index2]);\n }\n }\n set = new HashSet<>();\n }\n\n return res;\n\n }", "public int findDuplicate(int[] nums) {\n int slow = nums[0];\n int fast = nums[0];\n do {\n slow = nums[slow];\n fast = nums[nums[fast]];\n } while (slow != fast);\n \n slow = nums[0];\n while (slow != fast) {\n slow = nums[slow];\n fast = nums[fast];\n }\n return slow;\n }", "static int linearLogTime(int[] n, int[] m) {\n if(n == null || n.length == 0 || m == null || m.length == 0) return -1;\n int sum = 0;\n for(int i = 0; i < n.length; ++i) {\n sum += logTime(m, 0, m.length, 15);\n }\n return sum;\n }", "public static void main(String[] args) throws NumberFormatException, IOException {\n\r\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n\t\tint T = Integer.parseInt(br.readLine());\r\n\t\tStringTokenizer st;\r\n\t\tfor (int test_case = 1; test_case <= T; test_case++) {\r\n\t\t\tst = new StringTokenizer(br.readLine());\r\n\t\t\tN = Integer.parseInt(st.nextToken());\r\n\t\t\tK = Integer.parseInt(st.nextToken());\r\n\t\t\tst = new StringTokenizer(br.readLine());\r\n\t\t\tlist = new ArrayList[N + 1];\r\n\t\t\tfor (int i = 1; i <= N; i++) {\r\n\t\t\t\tlist[i] = new ArrayList<Integer>();\r\n\t\t\t}\r\n\t\t\tfor (int i = 1; i <= N; i++) {\r\n\t\t\t\tint k = Integer.parseInt(st.nextToken());\r\n\t\t\t\tlist[k].add(i);\r\n\t\t\t}\r\n//\t\t\tfor (int i = 1; i <= N; i++) {\r\n//\t\t\t\tfor (int j = 0; j < list[i].size(); j++)\r\n//\t\t\t\t\tSystem.out.print(i + \", \" + list[i].get(j) + \" \");\r\n//\t\t\t}\r\n//\t\t\tSystem.out.println();\r\n\r\n\t\t\tQueue<Integer> q;\r\n//\t\t\tfor(int i = 1; i<=N;i++) {\r\n//\t\t\t\tif(list[i].size()==0) {\r\n//\t\t\t\t\tq.add(i);\r\n//\t\t\t\t}\r\n//\t\t\t}\r\n\t\t\tint visited[];\r\n\t\t\tint answer = 0;\r\n\t\t\tfor (int i = 1; i <= N; i++) {// 각 굴에 대해서 인원 센다\r\n\t\t\t\tq = new LinkedList<Integer>();\r\n\t\t\t\tvisited = new int[N + 1];\r\n\t\t\t\tint count = K;\r\n//\t\t\t\tfor (int j = 1; j < K; j++) {// 지날 수 있는 굴의 최대갯수 K\r\n\t\t\t\tif (list[i].size() < 1) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tint idx;\r\n\t\t\t\tfor (int u = 0; u < list[i].size(); u++) {\r\n\t\t\t\t\tidx = list[i].get(u);\r\n\t\t\t\t\tq.add(idx);\r\n\t\t\t\t}\r\n\t\t\t\twhile (count > 0 && !q.isEmpty()) {\r\n\t\t\t\t\tidx = q.poll();\r\n\r\n\t\t\t\t\tfor (int m = 0; m < list[idx].size(); m++) {\r\n\r\n\t\t\t\t\t\tint dd = list[idx].get(m);\r\n\t\t\t\t\t\tif (visited[dd] == 0 && dd != i) {\r\n\t\t\t\t\t\t\tvisited[dd] = 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tq.add(list[idx].get(m));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcount--;\r\n\r\n\t\t\t\t}\r\n//\t\t\t\t}\r\n\t\t\t\tfor (int e = 1; e <= N; e++) {\r\n\t\t\t\t\tif (visited[e] == 1)\r\n\t\t\t\t\t\tanswer++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"#\" + test_case + \" \" + answer);\r\n\r\n\t\t}\r\n\r\n\t}", "private int find(int p){\n while(p!=id[p]){\n p=id[p];\n eachDoUnionArrayAccessTimes+=2; //遍历读取某个元素算一次,设置值也算一次,所以加2次\n }\n eachDoUnionArrayAccessTimes++; //查询p的时候依然会读取一次\n return p;\n }", "private static void task3(int nUMS, BinarySearchTree<Integer> t) {\n\t\t\n\t\t long start = System.nanoTime();\n\t\t System.out.println( \"Deletion in the table...\" );\n\t\t int count=0;\n\t\t\tfor( int i = 1; i <= nUMS; i++)\n\t\t\t{\n\t\t\t\tif(t.isEmpty() == false)\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\tt.remove(i);\n\t\t\t\t\n\t\t\t\t}\n//\t\t\t\tSystem.out.println(GenerateInt.generateNumber());\n\n\t\t\t}\n\t\t\tSystem.out.println(\"Total Size \" + count);\n\t\t\tSystem.out.println(\"Is it empty \" + t.isEmpty());\n\t\t\tlong end = System.nanoTime();;\n\t\t\tlong elapsedTime = end - start;\n\t\t\tSystem.out.println(elapsedTime + \" NanoSeconds\");\n\t\t\tSystem.out.println(\"Average Time \" + elapsedTime/nUMS);\n\t\t \n\t\t }", "public void log(int[] numbers) {\n\t\tSystem.out.println(); // O(1)\n\t\tfor (int number: numbers) // O(n)\n\t\t\tSystem.out.println(number);\n\t\tSystem.out.println(); // O(1)\n\t\t\n\t\t// O(2n), O(n+n)\n\t\t// We can drop 2* constant, O(n). Both represent linear growth\n\t\t// as we care only about input size\n\t\tfor (int number: numbers) // O(n)\n\t\t\tSystem.out.println(number);\n\t\tfor (int number: numbers) // O(n)\n\t\t\tSystem.out.println(number);\n\t\t\n\t\t\n\t\t\n\t}", "void solve() throws IOException {\n int[] nk = ril(2);\n int n = nk[0];\n int k = nk[1];\n int[] p = ril(n);\n int[] b = ril(k);\n for (int i = 0; i < n; i++) p[i]--;\n for (int i = 0; i < k; i++) b[i]--;\n\n int[] numToIdx = new int[n];\n for (int i = 0; i < n; i++) numToIdx[p[i]] = i;\n\n boolean[] remove = new boolean[n];\n Arrays.fill(remove, true);\n for (int bi : b) remove[bi] = false;\n List<Integer> toRemove = new ArrayList<>(n - k);\n for (int i = 0; i < n; i++) if (remove[i]) toRemove.add(i);\n Collections.sort(toRemove);\n\n int[] prevSmaller = new int[n];\n prevSmaller[0] = -1;\n int prevIdx = remove[p[0]] ? -1 : 0;\n for (int i = 1; i < n; i++) {\n int j = prevIdx;\n while (j != -1 && p[i] < p[j]) j = prevSmaller[j];\n prevSmaller[i] = j;\n if (!remove[p[i]]) prevIdx = i;\n }\n int[] nextSmaller = new int[n];\n nextSmaller[n-1] = n;\n prevIdx = remove[p[n-1]] ? n : n-1;\n for (int i = n-2; i >= 0; i--) {\n int j = prevIdx;\n while (j != n && p[i] < p[j]) j = nextSmaller[j];\n nextSmaller[i] = j;\n if (!remove[p[i]]) prevIdx = i;\n }\n\n int[] init = new int[n];\n Arrays.fill(init, 1);\n SegmentTree st = new SegmentTree(init);\n long ans = 0;\n for (int x : toRemove) {\n int idx = numToIdx[x];\n int l = prevSmaller[idx] + 1;\n int r = nextSmaller[idx] - 1;\n ans += st.query(l, r+1);\n st.modify(idx, 0);\n }\n pw.println(ans);\n }", "public static float assessComplexity(StereoMolecule mol) {\n\t\tint bondCount = Math.min(mol.getBonds()/2, MAX_BOND_COUNT);\n\n\t\tif (bondCount < 2)\n\t\t\treturn 0;\n\n\t\tmol.ensureHelperArrays(Molecule.cHelperSymmetrySimple);\n\t\tStereoMolecule fragment = new StereoMolecule(mol.getAtoms(), mol.getBonds());\n\t\tTreeSet<String> fragmentSet = new TreeSet<>();\n\t\tint[] atomMap = new int[mol.getAllAtoms()];\n\n\t\tboolean[][] bondsTouch = new boolean[mol.getBonds()][mol.getBonds()];\n\t\tfor (int atom=0; atom<mol.getAtoms(); atom++) {\n\t\t\tfor (int i=1; i<mol.getConnAtoms(atom); i++) {\n\t\t\t\tfor (int j=0; j<i; j++) {\n\t\t\t\t\tint bond1 = mol.getConnBond(atom, i);\n\t\t\t\t\tint bond2 = mol.getConnBond(atom, j);\n\t\t\t\t\tbondsTouch[bond1][bond2] = true;\n\t\t\t\t\tbondsTouch[bond2][bond1] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tboolean[] bondIsMember = new boolean[mol.getBonds()];\n\t\tint maxLevel = bondCount - 2;\n\t\tint[] levelBond = new int[maxLevel+1];\n\t\tfor (int rootBond=0; rootBond<mol.getBonds(); rootBond++) {\n\t\t\tbondIsMember[rootBond] = true;\n\t\t\tint level = 0;\n\t\t\tlevelBond[0] = rootBond;\n\t\t\twhile (true) {\n\t\t\t\tboolean levelBondFound = false;\n\t\t\t\twhile (!levelBondFound && levelBond[level] < mol.getBonds()-1) {\n\t\t\t\t\tlevelBond[level]++;\n\t\t\t\t\tif (!bondIsMember[levelBond[level]]) {\n\t\t\t\t\t\tfor (int bond=rootBond; bond<mol.getBonds(); bond++) {\n\t\t\t\t\t\t\tif (bondIsMember[bond] && bondsTouch[bond][levelBond[level]]) {\n\t\t\t\t\t\t\t\tlevelBondFound = true;\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\n\t\t\t\tif (levelBondFound) {\n\t\t\t\t\tbondIsMember[levelBond[level]] = true;\n\t\t\t\t\tif (level == maxLevel) {\n\t\t\t\t\t\tmol.copyMoleculeByBonds(fragment, bondIsMember, true, atomMap);\n\t\t\t\t\t\tfragmentSet.add(new Canonizer(fragment).getIDCode());\n\t\t\t\t\t\tbondIsMember[levelBond[level]] = false;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tlevel++;\n\t\t\t\t\t\tlevelBond[level] = rootBond;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (--level < 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tbondIsMember[levelBond[level]] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbondIsMember[rootBond] = false;\n\t\t}\n\n\t\treturn (float)Math.log(fragmentSet.size()) / bondCount;\n\t}", "private static void task03(int nUMS, AVLTree<Integer> h) {\n\t\t long start = System.nanoTime();\n\t\t System.out.println( \"Deletion in the table...\" );\n\t\t int count=0;\n\t\t\tfor( int i = 1; i <= nUMS; i++)\n\t\t\t{\n\t\t\t\tif(h.isEmpty() == false)\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\th.remove(i);\n\t\t\t\t\n\t\t\t\t}\n//\t\t\t\tSystem.out.println(GenerateInt.generateNumber());\n\n\t\t\t}\n\t\t\tSystem.out.println(\"Total Size \" + count);\n\t\t\tSystem.out.println(\"Is it empty \" + h.isEmpty());\n\t\t\tlong end = System.nanoTime();;\n\t\t\tlong elapsedTime = end - start;\n\t\t\tSystem.out.println(elapsedTime + \" NanoSeconds\");\n\t\t\tSystem.out.println(\"Average Time \" + elapsedTime/nUMS);\n\n\t\t\n\t}", "private static boolean findEqualSumSubsetBottomUp(int[] arr, int n) {\n\t\tint sum=0;\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tsum+=arr[i];\n\t\t}\n\t\tif(sum%2==1) {\n\t\t\treturn false;\n\t\t}\n \t\treturn findEqualSumBottomUp(arr,n,sum/2);\n\t}", "public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {\n if (t < 0) return false;\n long sz = (long)t + 1;\n Map<Long, Long> map = new HashMap<>();\n for (int i = 0; i < nums.length; ++i) {\n long bucket = getBucket(nums[i], sz);\n if (map.containsKey(bucket)) return true;\n if (map.containsKey(bucket + 1) && Math.abs(nums[i] - map.get(bucket + 1)) < sz) return true;\n if (map.containsKey(bucket - 1) && Math.abs(nums[i] - map.get(bucket - 1)) < sz) return true;\n map.put(bucket, (long)nums[i]);\n if (i >= k) map.remove(getBucket(nums[i - k], sz));\n }\n return false;\n}", "private static int solution2(String s) {\r\n int n = s.length();\r\n int ans = 0;\r\n for (int i = 0; i < n; i++)\r\n for (int j = i + 1; j <= n; j++)\r\n if (allUnique(s, i, j)) ans = Math.max(ans, j - i);\r\n return ans;\r\n }", "public List<List<Integer>> fourSum_optimization(int[] nums, int target) {\n int len = nums.length;\n Arrays.sort(nums);\n if (len < 4)\n return Collections.emptyList();\n List<List<Integer>> arr = new ArrayList<>();\n\n for (int i = 0; i < len - 1; i++) {\n for (int j = i + 1; j < len - 1; j++) {\n int Left = j + 1;\n int Right = len - 1;\n int left_target_sum = target - nums[i] + nums[j];\n\n while (Left < Right) {\n int two_sum = nums[Left] + nums[Right];\n if (two_sum < left_target_sum)\n Left++;\n else if (two_sum > left_target_sum)\n Right--;\n else {\n List<Integer> arr2 = new ArrayList<>();\n if (left_target_sum + two_sum == target) {\n arr2.add(nums[i]);\n arr2.add(nums[j]);\n arr2.add(nums[Left]);\n arr2.add(nums[Right]);\n arr.add(arr2);\n }\n while (Left < Right && nums[Left] == arr2.get(2))\n ++Left;\n while (Left < Right && nums[Right] == arr2.get(3))\n --Right;\n }\n }\n while (i + 1 < len && nums[i + 1] == nums[i])\n ++i;\n while (j + 1 < len && nums[j + 1] == nums[j])\n ++j;\n }\n }\n\n return arr;\n }", "public static int[] mostCompetitive(int[] nums, int k) {\n int[] copy = Arrays.copyOf(nums, nums.length); // 复制一个数组\n Arrays.sort(copy); // 排序\n for (int value : copy) { // 挨个顺序作为最小竞争子序列的头元素\n for (int j = 0; j < nums.length; j++) {\n if (nums[j] == value) {\n // 判断后续元素个数可够k长度\n if(k == 1){\n int[] ret = new int[1];\n ret[0] = nums[j];\n return ret;\n }\n if (j + k > nums.length) break;\n else if (j + k == nums.length) return Arrays.copyOfRange(nums, j, nums.length);\n else {\n int[] child = Arrays.copyOfRange(nums, j + 1, nums.length);\n int[] childMost = mostCompetitive(child, k - 1);\n System.out.println(Arrays.toString(childMost));\n // 取前k-1即为最优解\n int[] ret = new int[k];\n ret[0] = nums[j];\n System.arraycopy(childMost, 0, ret, 1, k - 1);\n System.out.println(Arrays.toString(ret));\n return ret;\n }\n }\n }\n }\n // [10, 23, 61, 62, 34, 41, 80, 25, 91, 43, 4, 75, 65, 13, 37, 41, 46, 90, 55, 8, 85, 61, 95, 71]\n // [10, 23, 61, 62, 34, 41, 80, 25, 91, 43, 4, 75, 65, 13, 37, 41, 46, 90, 55, 8, 85, 61, 95, 71]\n /* 2\n 4 3 3 5 4 9 6 3\n 3\n 3 5 4 9 6 3\n 2\n 5 4 9 6\n 1\n */\n return Arrays.copyOf(nums, k); // 这步不会执行\n }", "private static void task03333(int nUMS, SplayTree<Integer> j) {\n\n\t\tlong start = System.nanoTime();\n\t System.out.println( \"Deletion in the table...\" );\n\t int count=0;\n\t\tfor( int i = 1; i <= nUMS; i++)\n\t\t{\n\t\t\tif(j.isEmpty() == false)\n\t\t\t{\n\t\t\t\n\t\t\tj.remove(i);\n\t\t\t\n\t\t\t}\n//\t\t\tSystem.out.println(GenerateInt.generateNumber());\n\n\t\t}\n\t\tSystem.out.println(\"Total Size \" + count);\n\t\tSystem.out.println(\"Is it empty \" + j.isEmpty());\n\t\tlong end = System.nanoTime();;\n\t\tlong elapsedTime = end - start;\n\t\tSystem.out.println(elapsedTime + \" NanoSeconds\");\n\t\tSystem.out.println(\"Average Time \" + elapsedTime/nUMS);\n\t}", "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: */ }", "long getLsum(int n, int i, int k){ \r\n return (i-k+1)>=0 ? (i-k+1) + ssum(k) : ssum(k) - ssum(k-i-1);\r\n }", "@Override\n public long getComplexity() {\n final long[] complexity = {0};\n getChecks().forEachRemaining(element -> {\n complexity[0] += element.getComplexity();\n });\n return complexity[0];\n }", "public static void main(String[] args) {\n\t\tArrayList<Integer> array = new ArrayList<>();\n\t\tLinkedList<Integer> linked = new LinkedList<>();\n\t\t\n\t\tlong aStart = System.currentTimeMillis();\n\t\tint i;\n\t\tfor(i = 0; i<100000; i++){\n\t\t\tarray.add(i);\n\t\t}\n\t\tlong aEnd = System.currentTimeMillis();\n\t\tlong aTime = aEnd - aStart;\n\t\tSystem.out.println(\"Elapsed Time for the array and \"+i+\" elements : \"+aTime+\"ms\");\n\t\t\n\t\t\n\t\tlong lStart = System.currentTimeMillis();\n\t\tfor(i = 0; i<100000; i++){\n\t\t\tlinked.add(i);\n\t\t}\n\t\tlong lEnd = System.currentTimeMillis();\n\t\tlong lTime = lEnd - lStart;\n\t\tSystem.out.println(\"Elapsed Time for the array and \"+i+\" elements : \"+lTime+\"ms\");\n\t\tfor(i = 0; i<100000; i++){\n\t\t\tlinked.add(i);\n\t\t}\n\t\t\n\t\t\n\t\taStart = System.currentTimeMillis();\n\t\tfor(i = 0; i<1000000; i++){\n\t\t\tarray.add(i);\n\t\t}\n\t\taEnd = System.currentTimeMillis();\n\t\taTime = aEnd - aStart;\n\t\tSystem.out.println(\"Elapsed Time for the array and \"+i+\" elements : \"+aTime+\"ms\");\n\t\t\n\t\t\n\t\tlStart = System.currentTimeMillis();\n\t\tfor(i = 0; i<100000; i++){\n\t\t\tlinked.add(i);\n\t\t}\n\t\tlEnd = System.currentTimeMillis();\n\t\tlTime = lEnd - lStart;\n\t\tSystem.out.println(\"Elapsed Time for the array and \"+i+\" elements : \"+lTime+\"ms\");\n\t\tfor(i = 0; i<100000; i++){\n\t\t\tlinked.add(i);\n\t\t}\n\t}", "public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {\n if (t < 0) return false;\n TreeSet<Long> set = new TreeSet<>();\n for (int i = 0; i < nums.length; ++i) {\n long num = (long)nums[i];\n Long floor = set.floor(num), ceiling = set.ceiling(num);\n if (floor != null && num - floor <= t || ceiling != null && ceiling - num <= t) return true;\n set.add(num);\n if (i >= k) set.remove((long)nums[i - k]);\n }\n return false;\n}" ]
[ "0.73321944", "0.7092962", "0.6770475", "0.64221746", "0.64106935", "0.6344654", "0.61546445", "0.61410195", "0.6066928", "0.5894695", "0.5884094", "0.588319", "0.58682126", "0.5840537", "0.57564944", "0.574463", "0.5741454", "0.5732252", "0.5700291", "0.5660659", "0.56265277", "0.5607783", "0.5604634", "0.55851215", "0.5573721", "0.5531593", "0.5519729", "0.55154586", "0.5512954", "0.55086505", "0.55017406", "0.54946995", "0.54784834", "0.5472526", "0.54495835", "0.5441797", "0.53955984", "0.53760034", "0.5375589", "0.5369437", "0.5366373", "0.53617513", "0.5350418", "0.532599", "0.53203386", "0.5284879", "0.5278871", "0.52686244", "0.5254139", "0.5239193", "0.5237519", "0.52350765", "0.52247065", "0.51961064", "0.5190438", "0.51855594", "0.5184391", "0.51814973", "0.5181373", "0.5177731", "0.5172021", "0.51678634", "0.51610583", "0.51610506", "0.5151979", "0.5147324", "0.51417685", "0.51314604", "0.51308715", "0.5130616", "0.5128959", "0.51284355", "0.5116044", "0.51123476", "0.5112132", "0.5109612", "0.5094027", "0.5092362", "0.5089973", "0.5089062", "0.508845", "0.5088256", "0.5085176", "0.5081603", "0.5074315", "0.50734144", "0.507324", "0.50667655", "0.5065986", "0.5065769", "0.50612354", "0.5060895", "0.5060218", "0.50584495", "0.505571", "0.50534195", "0.50458515", "0.5045413", "0.50432396", "0.5038766", "0.5037848" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) throws UnsupportedEncodingException, FileNotFoundException { RiffRaff riff = new RiffRaff(); riff.readIn(); }
{ "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
Loads a provided config object from a given JSON file. If the file does not exist it also creates the file using the given object defaults
public static <T> T loadConfig(Class<T> clazz, File file, T fallback) throws IOException { if (file.createNewFile()) { //File does not exist, save fallback to file String json = gson.toJson(fallback); try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8))) { writer.write(json); } } // Load from file StringBuilder stringBuilder = new StringBuilder(); try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8))) { String line; while ((line = reader.readLine()) != null) { stringBuilder.append(line); } } return gson.fromJson(stringBuilder.toString(), clazz); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void init(File jsonFile) throws PluginException {\n try {\n config = new JsonSimpleConfig(jsonFile);\n reset();\n } catch (IOException e) {\n log.error(\"Error reading config: \", e);\n }\n }", "void importDefaultConfiguration(Map<String, Object> config);", "public static void initialize() {\r\n\t\tjson = new JSONFile(filePath);\t\r\n\t}", "private void readSettingsFromJson(String jsonFilePath) throws FileNotFoundException {\n File jsonFile = new File(jsonFilePath);\n GsonBuilder builder = new GsonBuilder().setPrettyPrinting();\n Gson gson = builder.create();\n if (jsonFile.exists()) {\n // try to read the settings from provided file\n FileReader fileReader = new FileReader(jsonFile);\n serverConfig = gson.fromJson(fileReader, ServerConfig.class);\n log.info(\"reading config from file {}\", jsonFile.getAbsoluteFile());\n } else {\n // file was not found, fall back to default config\n log.warn(\"settings file {} not found, falling back to default config\", jsonFile.getAbsoluteFile());\n serverConfig = ServerConfig.getDefaultConfig();\n String jsonStr = gson.toJson(serverConfig);\n\n try (PrintWriter out = new PrintWriter(jsonFile)) {\n out.print(jsonStr);\n }\n }\n\n // additionally create a map for easy access to repositories based on identifier\n for (ServerRepository serverRepository : serverConfig.getRepositories()) {\n this.serverRepositories.put(serverRepository.getIdentifier(), serverRepository);\n }\n }", "private static void loadJsonFile() throws FileNotFoundException {\n Log.println(Log.INFO, \"FileAccessing\", \"Loading settings file.\");\n StringBuilder stringBuilder = new StringBuilder();\n InputStreamReader inputStreamReader = new InputStreamReader(context.openFileInput(\"settingDetails.json\"), StandardCharsets.UTF_8);\n try (BufferedReader reader = new BufferedReader(inputStreamReader)) {\n String line = reader.readLine();\n while (line != null) {\n stringBuilder.append(line).append('\\n');\n line = reader.readLine();\n }\n } catch (IOException e) {\n Log.println(Log.ERROR, \"FileAccessing\", \"Settings file reading error.\");\n throw new FileNotFoundException();\n }\n if (stringBuilder.toString().equals(\"\")) {\n Log.println(Log.INFO, \"FileAccessing\", \"Settings file does not exist.\");\n throw new FileNotFoundException();\n }\n\n Gson gson = new Gson();\n JsonObject jsonObject = gson.fromJson(stringBuilder.toString(), JsonObject.class);\n if (jsonObject == null) {\n throw new FileNotFoundException();\n }\n JsonArray mappingControls = (JsonArray) jsonObject.get(\"mappingControls\");\n\n TaskDetail.actionToTask.clear();\n for (JsonElement o : mappingControls) {\n JsonObject individualMapping = (JsonObject) o;\n byte combinedAction = individualMapping.get(\"combinedAction\").getAsByte();\n int outerControl = individualMapping.get(\"task\").getAsInt();\n TaskDetail.actionToTask.put(combinedAction, TaskDetail.taskDetails.get(outerControl));\n }\n\n int setting = 0;\n JsonArray generalSettings = (JsonArray) jsonObject.get(\"generalSettings\");\n for (JsonElement o : generalSettings) {\n JsonObject individualSetting = (JsonObject) o;\n int status = individualSetting.get(\"status\").getAsInt();\n SettingDetail.settingDetails.get(setting++).changeSetting(status);\n }\n\n DeviceDetail.deviceDetails.clear();\n JsonArray deviceList = (JsonArray) jsonObject.get(\"devices\");\n for (JsonElement o : deviceList) {\n JsonObject individualDevice = (JsonObject) o;\n String deviceName = individualDevice.get(\"name\").getAsString();\n String deviceMac = individualDevice.get(\"mac\").getAsString();\n DeviceDetail.deviceDetails.add(new DeviceDetail(deviceMac, deviceName));\n }\n\n SensitivitySetting.sensitivitySettings.clear();\n JsonArray sensitivityList = (JsonArray) jsonObject.get(\"sensitivities\");\n for (JsonElement o : sensitivityList) {\n JsonObject individualSensitivity = (JsonObject) o;\n int multiplicativeFactor = individualSensitivity.get(\"factor\").getAsInt();\n int sensitivity = individualSensitivity.get(\"sensitivity\").getAsInt();\n SensitivitySetting.sensitivitySettings.add(new SensitivitySetting(multiplicativeFactor, sensitivity));\n }\n\n int currentDevice = jsonObject.get(\"currentlySelected\").getAsInt();\n DeviceDetail.setIndexSelected(currentDevice);\n\n updateAllSetting(false);\n }", "private static ConfigImpl loadJson(Path path) throws IOException {\n final ConfigImpl ret;\n try (FileInputStream stream = new FileInputStream(path.toFile())) {\n try (InputStreamReader reader = new InputStreamReader(stream, UTF_8)) {\n ret = loadJson(reader);\n }\n }\n return ret;\n }", "private static ConfigImpl loadJson(Reader reader) {\n ConfigImpl ret = new ConfigImpl();\n JsonParser parser = new JsonParser();\n JsonElement element = parser.parse(reader);\n loadJson(element, ret, \"\");\n return ret;\n }", "private JsonObject loadJSONFile(String jsonFilePath) throws IOException {\r\n\tInputStream is = new FileInputStream(jsonFilePath);\r\n\tJsonReader jsonReader = Json.createReader(is);\r\n\tJsonObject json = jsonReader.readObject();\r\n\tjsonReader.close();\r\n\tis.close();\r\n\treturn json;\r\n }", "private static void manageGameConfigFile(File configFile) {\n Gson gson = new Gson();\n try {\n GameConfig.setInstance(gson.fromJson(new FileReader(configFile), GameConfig.class));\n } catch (FileNotFoundException e) {\n LogUtils.error(\"FileNotFoundException => \", e);\n }\n }", "public T loadConfig(File file) throws IOException;", "public FileConfiguration loadConfiguration(File file);", "public ConfigData loadConfigFile(String path) {\n ConfigData config = null;\n if (path != null) {\n try {\n String data = loadTextFile(path);\n config = Resources.loadJson(data, ConfigData.class);\n } catch (IOException e) {\n LoggerFactory.getLogger(Resources.class).error(\"Unable to load the config file at \"\n + path + \", creating a default config file.\", e);\n }\n // Create a new config file and save it if none exists.\n if (config == null) {\n config = new ConfigData();\n Gson gson = new GsonBuilder().setPrettyPrinting().create();\n String outputData = gson.toJson(config, ConfigData.class);\n try {\n writeData(outputData, path);\n } catch (IOException ex) {\n throw new IOError(ex);\n }\n }\n } else {\n config = new ConfigData();\n }\n\n return config;\n }", "static ConfigImpl load(Path source) {\n log.info(\"Loading config from \" + source);\n\n ConfigImpl ret = null;\n\n if (Files.exists(source)) {\n try {\n try {\n ret = loadJson(source);\n } catch (JsonParseException e) {\n // It's invalid Json ... maybe it is a properties file instead?\n ret = loadProperties(source);\n }\n } catch (IOException e) {\n log.info(\"Failed to load config file \" + source + \". Assuming empty config\", e);\n }\n } else {\n log.info(\"Config source \" + source + \" not found. Assuming empty config\");\n }\n\n if (ret == null) {\n ret = new ConfigImpl();\n }\n\n return ret;\n }", "public static Config createConfig(String path) throws FileNotFoundException {\n Gson gson = new GsonBuilder().setPrettyPrinting().create();\n BufferedReader br = new BufferedReader(new FileReader(path));\n\n Config saps = gson.fromJson(br, Config.class);\n return saps;\n }", "private static Config loadConfig(String name) {\n\n\t\tString path;\n\t\tif (name == null) {\n\t\t\tpath = \"application.json\";\n\t\t} else {\n\t\t\tpath = \"src/\"+extensionsPackage+\"/\" + name + \"/config.json\";\n\t\t}\n\n\t\tGson gson = new Gson();\n\t\tConfig config = null;\n\n\t\ttry {\n\t\t\tconfig = gson.fromJson(new FileReader(path), Config.class);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn config;\n\t}", "public Config createConfig(String filename);", "@Test\n void check_mappingConfigFromJsonFile_key_priority_json_conf() {\n MappingConfig externalMappingConfig =\n new MergeableMappingConfigSupplier(new ArrayList<String>() {\n {\n add(\"src/test/resources/json/mappingconfig3.json\");\n add(\"src/test/resources/json/mappingconfig4.conf\");\n }\n }).get();\n\n assertEquals(externalMappingConfig.getGenerateToString(), false);\n assertEquals(externalMappingConfig.getGenerateApis(), true);\n }", "public void loadObject() {\n\n obj = new Properties();\n try {\n obj.load(new FileInputStream(\"./src/test/resources/config.properties\"));\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "@Test\n void check_mappingConfigFromJsonFile_key_priority_hocon_json() {\n MappingConfig externalMappingConfig =\n new MergeableMappingConfigSupplier(new ArrayList<String>() {\n {\n add(\"src/test/resources/json/mappingconfig4.conf\");\n add(\"src/test/resources/json/mappingconfig3.json\");\n }\n }).get();\n\n assertEquals(externalMappingConfig.getGenerateToString(), true);\n assertEquals(externalMappingConfig.getGenerateApis(), true);\n }", "@Override\n\tpublic Object load(String path, Object defaultObject) throws Exception {\n\t\tfinal Object[] object = new Object[1];\n\t\t\n\t\t// Stream\n\t\ttry {\n\t\t\tfinal FileInputStream fis = new FileInputStream(path);\n\t\t\tfinal ObjectInputStream ois = new ObjectInputStream(fis);\n\n\t\t\t// Load an object\n\t\t\tobject[0] = ois.readObject();\n\n\t\t\t// Close stream\n\t\t\tois.close();\n\t\t} catch (FileNotFoundException fileNotFoundException){\n\t\t\t// Assign default object when the file is not found.\n\t\t\tobject[0] = defaultObject;\n\t\t}\n\t\t\n\t\t// Return object\n\t\treturn object[0];\n\t}", "@Test\n void check_mappingConfigFromJsonFile() {\n MappingConfig externalMappingConfig =\n new MergeableMappingConfigSupplier(new ArrayList<String>() {\n {\n add(\"src/test/resources/json/mappingconfig.json\");\n add(\"src/test/resources/json/mappingconfig2.json\");\n }\n }).get();\n\n assertEquals(\"com.kobylynskyi.graphql.testconfigjson\", externalMappingConfig.getPackageName());\n // If the previous configuration file does not contain a key, the later one will be used.\n assertEquals(externalMappingConfig.getGenerateToString(), true);\n assertTrue(externalMappingConfig.getGenerateApis());\n assertEquals(\"java.math.BigDecimal\", externalMappingConfig.getCustomTypesMapping().get(\"Price.amount\"));\n assertNull(externalMappingConfig.getApiPackageName());\n }", "@Test\n void check_mappingConfigFromJsonFile_key_priority_json_json() {\n MappingConfig externalMappingConfig =\n new MergeableMappingConfigSupplier(new ArrayList<String>() {\n {\n add(\"src/test/resources/json/mappingconfig2.json\");\n add(\"src/test/resources/json/mappingconfig3.json\");\n }\n }).get();\n\n assertEquals(\"com.kobylynskyi.graphql.testconfigjson\", externalMappingConfig.getPackageName());\n assertEquals(externalMappingConfig.getGenerateToString(), true);\n }", "public void load() throws IOException {\r\n\t\tFile file = new File(projectDir, TERN_PROJECT);\r\n\t\tif (file.exists()) {\r\n\t\t\tJSONParser parser = new JSONParser();\r\n\t\t\ttry {\r\n\t\t\t\tJSONObject result = (JSONObject) parser.parse(new FileReader(\r\n\t\t\t\t\t\tfile));\r\n\t\t\t\tsuper.putAll(result);\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void initialize() {\n if (!BungeeBan.getInstance().getDataFolder().exists()) {\n BungeeBan.getInstance().getDataFolder().mkdirs();\n }\n File file = this.getConfigurationFile();\n if (!file.exists()) {\n try {\n file.createNewFile();\n if (this.defaultConfig != null) {\n try (InputStream is = BungeeBan.getInstance().getResourceAsStream(this.defaultConfig);\n OutputStream os = new FileOutputStream(file)) {\n ByteStreams.copy(is, os);\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n this.reload();\n }", "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 }", "@Override\n\tpublic void loadDefaults(String version, SystemConfig config, SystemContext systemContext, RtwsProperties properties) \n\t\t\t\t\t\t\t\t\t\tthrows MarshalException, DefaultConfigurationException {\n\t\ttry{\n\t\t\tthis.properties = properties; //initialize properties\n\t\t\tthis.outDir = config.getOutputConfDir() + confDir;\n\t\t\tSystemBuilderUtil.mkdir(this.outDir); //create directory\n\t\t\tthis.templateDir = RtwsConfig.getInstance().getString(\"sysbuilder.template.dir\");\n\t\t\t\n\t\t\tString templatePipeline = RtwsConfig.getInstance().getString(\"sysbuilder.datasink.pipeline.template\");\n\t\t\t\n\t\t\tfactoryDefinition = serializer.createObject(templatePipeline, FactoryDefinition.class);\n\t\t\t\n\t\t\t//load ingest api json information\n\t\t\tingestApiDatasinks();\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tlogger.error(e.toString(), e);\n\t\t\te.printStackTrace();\n\t\t\tthrow new DefaultConfigurationException(e.toString(), e);\n\t\t}\n\t\t\n\t}", "void importConfiguration(Map<String, Object> config);", "@Config.LoadPolicy(Config.LoadType.MERGE)\[email protected]({\n \"classpath:test.properties\",\n \"system:properties\",\n \"system:env\"})\npublic interface UserConfiguration extends Config {\n\n @DefaultValue(\"default_Name\")\n @Key(\"user.name\")\n String name();\n @Key(\"user.email\")\n String email();\n @Key(\"user.password\")\n String password();\n}", "public static JSONObject loadMOTD() {\n File JSONFile = new File(plugin.getDataFolder() + \"/motd.json\");\n \n if (!JSONFile.exists()){\n Logger.getLogger(MOTDHandler.class.getName()).log(Level.INFO, \"motd.json was not found in the config directory. Attempting to create a blank file.\");\n boolean worked = saveMOTD(new JSONObject());\n if (worked) Logger.getLogger(MOTDHandler.class.getName()).log(Level.INFO, \"motd.json created!\");\n else Logger.getLogger(MOTDHandler.class.getName()).log(Level.INFO, \"JawaToolBox was unable to generate the blank motd.json. This is likely a permissions problem.\");\n return new JSONObject();\n }\n\n try {\n String source = new String(Files.readAllBytes(Paths.get(JSONFile.toURI())));\n return new JSONObject(source);\n } catch (FileNotFoundException ex) {\n return new JSONObject();\n } catch (IOException ex) {\n Logger.getLogger(MOTDHandler.class.getName()).log(Level.SEVERE, \"Something went wrong JawaToolBox wasn't able to read the motd.json. Check directory permissions.\");\n Logger.getLogger(MOTDHandler.class.getName()).log(Level.SEVERE, null, ex);\n return new JSONObject();\n }\n }", "public void loadConfig(){\n \t\tFile configDir = this.getDataFolder();\n \t\tif (!configDir.exists())\n \t\t\tconfigDir.mkdir();\n \n \t\t// Check for existance of config file\n \t\tFile configFile = new File(this.getDataFolder().toString() + \"/config.yml\");\n \t\tconfig = YamlConfiguration.loadConfiguration(configFile);\n \t\t\n \t\t// Adding Variables\n \t\tif(!config.contains(\"Debug\"))\n \t\t{\n \t\t\tconfig.addDefault(\"Debug\", false);\n \t \n \t config.addDefault(\"Worlds\", \"ExampleWorld1, ExampleWorld2\");\n \t\n\t config.addDefault(\"Regions.Residence\", \"ExampleWorld.ExampleResRegion1, ExampleWorld.ExampleResRegion2\");\n \t \n\t config.addDefault(\"Regions.WorldGuard\", \"ExampleWorld.ExampleWGRegion1, ExampleWorld.ExampleWGRegion2\"); \n \t\t}\n \n // Loading the variables from config\n \tdebug = (Boolean) config.get(\"Debug\");\n \tpchestWorlds = (String) config.get(\"Worlds\");\n \tpchestResRegions = (String) config.get(\"Regions.Residence\");\n \tpchestWGRegions = (String) config.get(\"Regions.WorldGuard\");\n \n if(pchestWorlds != null)\n {\n \tlog.info(\"[\"+getDescription().getName()+\"] All Chests Worlds: \" + pchestWorlds);\n }\n \n if(pchestResRegions != null)\n {\n \tlog.info(\"[\"+getDescription().getName()+\"] All Residence Regions: \" + pchestResRegions);\n }\n \n if(pchestWGRegions != null)\n {\n \tlog.info(\"[\"+getDescription().getName()+\"] All World Guard Regions: \" + pchestWGRegions);\n }\n \n config.options().copyDefaults(true);\n try {\n config.save(configFile);\n } catch (IOException ex) {\n Logger.getLogger(JavaPlugin.class.getName()).log(Level.SEVERE, \"Could not save config to \" + configFile, ex);\n }\n }", "public Config(String filename, String defaultConfig) {\n this.filename = filename;\n this.defaultConfig = defaultConfig;\n }", "public Object loadFromFile(String fileName) {\n\t Object obj = null;\n\t try{\n\t\t FileInputStream FIS = new FileInputStream((defaultPath+\"\\\\\" + fileName));\n\t\t ObjectInputStream onjIn = new ObjectInputStream(FIS);\n\t\t obj = onjIn.readObject();\n\t } catch (NoSuchFileException e){\n\t\t saveToFile(fileName, null); \n\t } catch (IOException e) {\n\t } catch (ClassNotFoundException e) {\n\t } \n\t return obj;\n }", "@Test\n\tpublic void testLoadExistingConfig() throws IOException\n\t{\n\t\tFileWriter out = new FileWriter(outfile, true);\n\t\tout.write(\"\\nTestEntry=TestData\");\n\t\tout.close();\n\t\t\n\t\t// Creating it again forces it to read the modified config\n\t\tproperties = new Configuration(outfile);\n\t\t\n\t\tassertEquals(\"TestData\", properties.get(\"TestEntry\"));\n\t}", "public void reloadFile() {\n if (configuration == null) {\n file = new File(plugin.getDataFolder(), fileName);\n }\n configuration = YamlConfiguration.loadConfiguration(file);\n\n // Look for defaults in the jar\n Reader defConfigStream = null;\n try {\n defConfigStream = new InputStreamReader(plugin.getResource(fileName), \"UTF8\");\n } catch (UnsupportedEncodingException ex) {}\n\n if (defConfigStream != null) {\n YamlConfiguration defConfig = YamlConfiguration.loadConfiguration(defConfigStream);\n configuration.setDefaults(defConfig);\n }\n }", "@Override\n public void fromFile(final String file) {\n // Model会关心文件路径,所以这里需要这个操作\n this.jsonFile = file;\n final JsonObject data = Ut.ioJObject(this.jsonFile);\n this.fromJson(data);\n }", "public void reload() {\n\t\tfileConfiguration = YamlConfiguration.loadConfiguration(configFile);\n\t\tfinal InputStream defaultConfigStream = plugin.getResource(fileName);\n\t\tif (defaultConfigStream != null) {\n\t\t\tfinal Reader defConfigStream = new InputStreamReader(defaultConfigStream, StandardCharsets.UTF_8);\n\t\t\tfinal YamlConfiguration defConfig = YamlConfiguration.loadConfiguration(defConfigStream);\n\t\t\tfileConfiguration.setDefaults(defConfig);\n\t\t}\n\t}", "private void createConfig() {\n try {\n if (!getDataFolder().exists()) {\n getDataFolder().mkdirs();\n }\n File file = new File(getDataFolder(), \"config.yml\");\n if (!file.exists()) {\n getLogger().info(\"config.yml not found :( Creating one with default values...\");\n saveDefaultConfig();\n } else {\n getLogger().info(\"config.yml found :) Loading...\");\n }\n } catch (Exception e) {\n e.printStackTrace();\n\n }\n\n }", "public void loadConfig(){\n this.saveDefaultConfig();\n //this.saveConfig();\n\n\n }", "private void loadLocalConfig()\n {\n try\n {\n // Load the system config file.\n URL fUrl = Config.class.getClassLoader().getResource( PROP_FILE );\n config.setDelimiterParsingDisabled( true );\n if ( fUrl == null )\n {\n String error = \"static init: Error, null cfg file: \" + PROP_FILE;\n LOG.warn( error );\n }\n else\n {\n LOG.info( \"static init: found from: {} path: {}\", PROP_FILE, fUrl.getPath() );\n config.load( fUrl );\n LOG.info( \"static init: loading from: {}\", PROP_FILE );\n }\n\n URL fUserUrl = Config.class.getClassLoader().getResource( USER_PROP_FILE );\n if ( fUserUrl != null )\n {\n LOG.info( \"static init: found user properties from: {} path: {}\", USER_PROP_FILE, fUserUrl.getPath() );\n config.load( fUserUrl );\n }\n }\n catch ( org.apache.commons.configuration.ConfigurationException ex )\n {\n String error = \"static init: Error loading from cfg file: [\" + PROP_FILE\n + \"] ConfigurationException=\" + ex;\n LOG.error( error );\n throw new CfgRuntimeException( GlobalErrIds.FT_CONFIG_BOOTSTRAP_FAILED, error, ex );\n }\n }", "public static Properties loadOrCreateProperties(String filename, Properties defaultProperties) {\n\n Properties properties = new Properties();\n try {\n properties.load(new FileInputStream(filename));\n } catch (Exception loadException) {\n try {\n FileOutputStream out = new FileOutputStream(filename);\n if (defaultProperties != null) {\n defaultProperties.store(out, null);\n }\n out.close();\n properties.load(new FileInputStream(filename));\n } catch (Exception writeException) {\n // Do nothing\n return null;\n }\n }\n return properties;\n }", "@Override\n public Object loadFromJson(Context context) {\n Gson gson = new Gson();\n String json = FileManager.getInstance().loadFromFile(getFileName(), context);\n if(json.equals(\"\")) {\n return null;\n }\n\n return gson.fromJson(json, MatchStorage.class);\n\n }", "@Test\n public void testLoadConfigurationFromURL() throws Exception\n {\n factory = new DefaultConfigurationBuilder(TEST_FILE.toURI().toURL());\n checkConfiguration();\n }", "private static HisPatientInfoConfiguration loadConfiguration(String filePath) throws HisServiceException{\n File file = new File(filePath);\n if(file != null && file.exists() && file.isFile() ) {\n try {\n configuration = new Yaml().loadAs(new FileInputStream(file), HisPatientInfoConfiguration.class);\n } catch(FileNotFoundException e) {\n log.error(e.getMessage());\n isOK = false;\n throw new HisServiceException(HisServerStatusEnum.NO_CONFIGURATION);\n }\n }\n else {\n isOK = false;\n }\n return configuration;\n }", "void loadFromFile() {\n\t\ttry {\n\t\t\tFile directory = GameApplication.getInstance().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS);\n\t\t\tFile source = new File(directory, FILE_NAME);\n\t\t\tMap<String, Scoreboard> scoreboards = new HashMap<String, Scoreboard>();\n\t\t\tif (source.exists()) {\n\t\t\t\tJsonReader reader = new JsonReader(new FileReader(source));\n\t\t\t\treader.beginArray();\n\t\t\t\twhile (reader.hasNext()) {\n\t\t\t\t\tScoreboard scoreboard = readScoreboard(reader);\n\t\t\t\t\tscoreboards.put(scoreboard.getName(), scoreboard);\n\t\t\t\t}\n\t\t\t\treader.endArray();\n\t\t\t\treader.close();\n\t\t\t} else {\n\t\t\t\tsource.createNewFile();\n\t\t\t}\n\t\t\tthis.scoreboards = scoreboards;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public interface ConfigFileLoader {\n\n /**\n * Save the map of the node instance,\n * to the file instance.\n *\n * @throws IOException When it fails to save {@see IOException}.\n */\n void save() throws IOException;\n\n /**\n * Load the map of the file instance,\n * in the node instance.\n *\n * @throws IOException When it fails to load {@see IOException}.\n */\n void load() throws IOException;\n\n /**\n * Change the file instance to new file instance.\n *\n * @param file new file instance.\n */\n void setNewFile(File file);\n\n}", "void overwriteDefaultConfiguration(Map<String, Object> config);", "public void load() throws FileNotFoundException {\n loadConfig();\n initRepos();\n }", "@SuppressWarnings(\"unchecked\")\r\n\tprivate void readMapFromFile() {\r\n\t\ttry {\r\n\t\t\tType type = new TypeToken<HashMap<String, Country>>() {}.getType();\r\n\t\t\tthis.daoMap = (HashMap<String, Country>) gson.fromJson(new FileReader(path), type);\r\n\t\t} catch (JsonSyntaxException | JsonIOException | FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}", "public static void loadFromFile() {\n\t\tloadFromFile(Main.getConfigFile(), Main.instance.getServer());\n\t}", "void config(final JsonObject config);", "private void loadDefaultConfig() {\r\n ResourceBundle bundle = ResourceLoader.getProperties(DEFAULT_CONFIG_NAME);\r\n if (bundle != null) {\r\n putAll(bundle);\r\n } else {\r\n LOG.error(\"Can't load default Scope config from: \" + DEFAULT_CONFIG_NAME);\r\n }\r\n }", "private static void loadJson(JsonPrimitive primitive, ConfigImpl config, String key) {\n String value = null;\n if (primitive.isBoolean()) {\n boolean bool = primitive.getAsBoolean();\n value = bool ? \"true\" : \"false\";\n } else if (primitive.isString()) {\n value = primitive.getAsString();\n } else if (primitive.isNumber()) {\n value = Double.toString(primitive.getAsDouble());\n }\n config.set(key, value);\n }", "private <T> T readConfig(final ConfigurationFactory<T> factory, final String filePath) {\n try (final BufferedReader reader = Files.newBufferedReader(getDataFolder().toPath().resolve(filePath))) {\n return factory.create(YamlConfiguration.loadConfiguration(reader));\n } catch (final IOException e) {\n throw new RuntimeException(String.format(\"Could not read configuration file %s in plugin data-folder\",\n filePath), e);\n }\n }", "private void readFromJSON(String filename) {\n JSONParser parser = new JSONParser();\n\n try\n {\n Object obj = parser.parse(new FileReader(filename));\n JSONObject jsonObject = (JSONObject) obj;\n Menu drinks = getMenu(jsonObject, \"Drink\");\n Menu types = getMenu(jsonObject, \"Type\");\n Menu toppings = getMenu(jsonObject, \"Toppings\");\n Menu sizes = getMenu(jsonObject, \"Size\");\n menuMap.put(\"Drink\", drinks);\n menuMap.put(\"Size\", sizes);\n menuMap.put(\"Toppings\", toppings);\n menuMap.put(\"Type\", types);\n\n } catch (FileNotFoundException e) {\n System.out.println(\"Not found menu.json, exit now.\");\n System.exit(1);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n }", "public Configuration(File configFile) {\r\n \t\tproperties = loadProperties(configFile);\r\n \t}", "public void init(JSONObject config) throws Exception {\n\n }", "@Test\n public void testLoadConfigurationFromFileName()\n throws ConfigurationException\n {\n factory = new DefaultConfigurationBuilder(TEST_FILE.getAbsolutePath());\n checkConfiguration();\n }", "private void loadJSON() throws FileNotFoundException\n\t{\n\n\t\tGsonBuilder builder= new GsonBuilder();\n\t\tGson gson = builder.create();\n\t\t\t\t\n\t\t//get a list of folders in the data directory\n\t\t\n\t\tFile[] directories = new File(\"data\").listFiles();\n\n\t\t//Loop through folders in data directory\n\t\tfor(File folder : directories)\n\t\t\t{\n\t\t\t\t//get a list of files inside the folder\n\t\t\t\tFile[] jsonItems = new File(folder.toString()).listFiles();\n\t\t\t\t\n\t\t\t\t//Loop through files inside the folder \n\t\t\t\tfor(File file : jsonItems)\n\t\t\t\t{\n\t\t\t\t\t//Store in directory map... substring to remove the \"data/\" portion... placed by filename to foldername\n\t\t\t\t\tString dir = file.toString().substring(5);\n\t\t\t\t\t\n\t\t\t\t\t//Generate player data from gson\n\t\t\t\t\tJsonReader reader = new JsonReader(new FileReader(file));\n\t\t\t\t\tPlayer player = gson.fromJson(reader, Player.class);\n\t\t\t\t\t\n\t\t\t\t\t//Store it in the map tied to it's directory\n\t\t\t\t\tplayerData.put(dir, player);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void load(){\n // Recover docIDs\n try(Reader reader = new FileReader(\"postings/docIDs.json\")){\n this.docIDs = (new Gson()).fromJson(reader,\n new TypeToken<Map<String, String>>(){}.getType());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n try(Reader reader = new FileReader(\"postings/docLengths.json\")){\n this.docLengths = (new Gson()).fromJson(reader,\n new TypeToken<Map<String, Integer>>(){}.getType());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n try(Reader reader = new FileReader(\"postings/titleToNumber.json\")){\n this.titleToNumber = (new Gson()).fromJson(reader,\n new TypeToken<Map<String, Integer>>(){}.getType());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void loadDefaultConfig() {\n currentConfigFileName = defaultConfigFileName;\n mesoCfgXML = (SCANConfigMesoXML) readDefaultConfig();\n createAttributeMap(getAttributes());\n }", "public static JsonObject readFile(String path) throws FileNotFoundException\n\t{\n\t\tJsonReaderFactory factory = Json.createReaderFactory(null);\n\t\tInputStream is = new FileInputStream(path);\n\t\tJsonReader rdr = factory.createReader(is, java.nio.charset.StandardCharsets.UTF_8);\n\t\tJsonObject obj = rdr.readObject();\n\t\trdr.close();\n\t\treturn obj;\n\t}", "public static void load(){\n StringBuilder maleNamesString = new StringBuilder();\n try (Scanner maleNamesFile = new Scanner(mnames)){\n while (maleNamesFile.hasNext()) {\n maleNamesString.append(maleNamesFile.next());\n }\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n //Create a string from the fnames.json file\n StringBuilder femaleNamesString = new StringBuilder();\n try (Scanner femaleNamesFile = new Scanner(fnames)){\n while (femaleNamesFile.hasNext()) {\n femaleNamesString.append(femaleNamesFile.next());\n }\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n //Create a string from the snames.json file\n StringBuilder surNamesString = new StringBuilder();\n try (Scanner surNamesFile = new Scanner(snames)){\n while (surNamesFile.hasNext()) {\n surNamesString.append(surNamesFile.next());\n }\n\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n //Create a string from the locations.json file\n StringBuilder locationsString = new StringBuilder();\n try (Scanner locationsFile = new Scanner(locationsJson)){\n while (locationsFile.hasNext()) {\n locationsString.append(locationsFile.next());\n }\n\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n maleNames = (Names)convertJsonToObject(maleNamesString.toString(), new Names());\n\n femaleNames = (Names)convertJsonToObject(femaleNamesString.toString(), new Names());\n\n surNames = (Names)convertJsonToObject(surNamesString.toString(), new Names());\n\n locations = (Locations)convertJsonToObject(locationsString.toString(), new Locations());\n }", "@SneakyThrows\n public static AgentConfig createAgentConfig(final String filename) {\n if (Objects.isNull(filename)) {\n return new AgentConfig();\n }\n try (InputStream inputStream = new FileInputStream(filename)) {\n return YAML_MAPPER.readValue(inputStream, AgentConfig.class);\n }\n }", "public static void acceptConfig() {\r\n\t\t//Here, it tries to read over the config file using try-catch in case of Exception\r\n\t\ttry {\r\n\t\t\tProperties properties = new Properties();\r\n\t\t\tFileInputStream fis = new FileInputStream(new File(\"config.properties\"));\r\n\t\t\tproperties.load(fis);\r\n\t\t\tString storage = properties.getProperty(\"storage\");\r\n\t\t\tif(storage == null) \r\n\t\t\t\tthrow new IllegalArgumentException(\"Property 'storage' not found\");\r\n\t\t\tif(storage.equals(\"tree\"))\r\n\t\t\t\tdata = new BinarySearchTree();\r\n\t\t\tif(storage.equals(\"trie\"))\r\n\t\t\t\tdata = new Trie();\r\n\t\t\tif(data == null) \r\n\t\t\t\tthrow new IllegalArgumentException(\"Not valid storage configuration.\");\r\n\t\t}\r\n\t\t//If an Exception occurs, it just prints a message\r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\tSystem.out.println(\"Configuration file not found.\");\r\n\t\t\tSystem.exit(1);\r\n\t\t} catch (IllegalArgumentException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\tSystem.exit(1);\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"Error reading the configuration file.\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t}", "public void load(File configFile) {\n try {\n this.getProperties().load(new FileInputStream(configFile));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Test\n void check_mappingConfigFromJsonFile_key_priority_hocon_hocon() {\n MappingConfig externalMappingConfig =\n new MergeableMappingConfigSupplier(new ArrayList<String>() {\n {\n add(\"src/test/resources/json/mappingconfig5.conf\");\n add(\"src/test/resources/json/mappingconfig4.conf\");\n }\n }).get();\n\n assertEquals(externalMappingConfig.getGenerateToString(), false);\n assertEquals(externalMappingConfig.getGenerateApis(), false);\n }", "@Test\n public void testLoadConfigurationFromFile() throws ConfigurationException\n {\n factory = new DefaultConfigurationBuilder(TEST_FILE);\n checkConfiguration();\n }", "abstract public Config createConfig(String path);", "private static JSONTile parse(String configFile) {\n Gson gson = new Gson();\n\n try (BufferedReader reader = new BufferedReader(\n new InputStreamReader(new FileInputStream(configFile), StandardCharsets.UTF_8))) {\n return gson.fromJson(reader, JSONTile.class);\n } catch (IOException e) {\n throw new IllegalArgumentException(\"Error when reading file: \" + configFile, e);\n }\n }", "public void load(JSONObject obj);", "@Override\n\tpublic void init(String file_name) { deserialize(file_name); }", "<T> T readJson(FsPath path, Class<T> clazz);", "static JsonResource forFile( File file ) {\n return new JsonResource() {\n @Override\n public <T> T readFrom( ReadMethod<T> consumer ) throws IOException {\n try ( FileInputStream stream = new FileInputStream(file) ) {\n return consumer.read(stream);\n }\n }\n };\n }", "private void loadCustomConfig() {\r\n ResourceBundle bundle = ResourceLoader.getProperties(DEFAULT_CUSTOM_CONFIG_NAME);\r\n if (bundle != null) {\r\n putAll(bundle);\r\n LOG.info(\"Load custom Scope config from \" + DEFAULT_CUSTOM_CONFIG_NAME + \".properties\");\r\n } else {\r\n LOG.warn(\"Can't load custom Scope config from \" + DEFAULT_CUSTOM_CONFIG_NAME + \".properties\");\r\n }\r\n }", "@Test\n public final void testConfigurationParser() {\n URL resourceUrl = this.getClass().getResource(configPath);\n File folder = new File(resourceUrl.getFile());\n for (File configFile : folder.listFiles()) {\n try {\n System.setProperty(\"loadbalancer.conf.file\", configFile.getAbsolutePath());\n LoadBalancerConfiguration.getInstance();\n } finally {\n LoadBalancerConfiguration.clear();\n }\n }\n }", "public WorldConfig getWorldConfig(World grabfor) {\n\t\tif (this.SingleWorldConfig != null)\n\t\t\treturn SingleWorldConfig;\n\t\tString worldName = grabfor.getName();\n\n\t\t// if it's not in the hashmap...\n\t\tif (!WorldCfg.containsKey(worldName)) {\n\t\t\t// special code: it's possible a configuration might already exist\n\t\t\t// for this file, so we'll\n\t\t\t// check\n\t\t\tString checkyamlfile = WorldConfig.getWorldConfig(worldName);\n\t\t\t// if it exists...\n\t\t\tif (new File(checkyamlfile).exists()) {\n\t\t\t\t// attempt to load the configuration from the given file.\n\t\t\t\tYamlConfiguration existingcfg = YamlConfiguration.loadConfiguration(new File(checkyamlfile));\n\t\t\t\tYamlConfiguration outConfiguration = new YamlConfiguration();\n\t\t\t\t// place it in the hashmap.\n\t\t\t\tWorldCfg.put(worldName, new WorldConfig(worldName, existingcfg, outConfiguration));\n\t\t\t\t// try to save it. this can error out for who knows what reason.\n\t\t\t\t// If it does, we'll\n\t\t\t\t// squirt the issue to the log.\n\t\t\t\ttry {\n\t\t\t\t\toutConfiguration.save(new File(checkyamlfile));\n\t\t\t\t} catch (IOException iex) {\n\t\t\t\t\tGriefPrevention.instance.getLogger().log(Level.SEVERE, \"Failed to save World Config for world \" + worldName);\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// if the file doesn't exist, then we will go ahead and create a\n\t\t\t\t// new configuration.\n\t\t\t\t// set the input Yaml to default to the template.\n\t\t\t\t// if the template file exists, load it's configuration and use\n\t\t\t\t// the result as useSource.\n\t\t\t\t// Otherwise, we create a blank configuration.\n\t\t\t\tDebugger.Write(\"Failed to find world configuration for World \" + worldName, DebugLevel.Errors);\n\t\t\t\tFile TemplFile = new File(TemplateFile);\n\t\t\t\tFileConfiguration useSource = null;\n\t\t\t\tif (TemplFile.exists()) {\n\t\t\t\t\tuseSource = YamlConfiguration.loadConfiguration(TemplFile);\n\t\t\t\t} else {\n\t\t\t\t\tDebugger.Write(\"Template file \\\"\" + TemplateFile + \" \\\"Not Found.\", DebugLevel.Errors);\n\t\t\t\t\tuseSource = new YamlConfiguration();\n\t\t\t\t}\n\n\t\t\t\t// The target save location.\n\t\t\t\tFileConfiguration Target = new YamlConfiguration();\n\t\t\t\t// place it in the hashmap.\n\t\t\t\tWorldCfg.put(worldName, new WorldConfig(grabfor.getName(), useSource, Target));\n\t\t\t\ttry {\n\t\t\t\t\tTarget.save(new File(checkyamlfile));\n\t\t\t\t} catch (IOException ioex) {\n\t\t\t\t\tGriefPrevention.instance.getLogger().log(Level.SEVERE, \"Failed to write world configuration to \" + checkyamlfile);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t// save target\n\t\t}\n\t\t// after the above logic, we know it's in the hashmap, so return that.\n\t\treturn WorldCfg.get(worldName);\n\n\t}", "public static void load() {\n try {\n File confFile = SessionService.getConfFileByPath(Const.FILE_CONFIGURATION);\n UtilSystem.recoverFileIfRequired(confFile);\n // Conf file doesn't exist at first launch\n if (confFile.exists()) {\n // Now read the conf file\n InputStream str = new FileInputStream(confFile);\n try {\n properties.load(str);\n } finally {\n str.close();\n }\n }\n } catch (Exception e) {\n Log.error(e);\n Messages.showErrorMessage(114);\n }\n }", "public static void saveConfig(Object config, File file) throws IOException {\n file.createNewFile();\n String json = gson.toJson(parser.parse(gson.toJson(config)));\n try (PrintWriter out = new PrintWriter(file)) {\n out.println(json);\n }\n }", "private static YamlConfig load(File file) {\n\t\tif (file == null) {\n\t\t\tthrow new IllegalArgumentException(\"Config file is null\");\n\t\t}\n\t\tif (!file.exists()) {\n\t\t\tthrow new IllegalArgumentException(\"Config file '\" + file + \"' does not exist\");\n\t\t}\n\t\tif (!file.canRead()) {\n\t\t\tthrow new IllegalArgumentException(\"Config file '\" + file + \"' cannot be read\");\n\t\t}\n\t\ttry {\n\t\t\treturn new YamlConfig(file);\n\t\t} catch (IOException exn) {\n\t\t\tthrow new IllegalArgumentException(exn);\n\t\t}\n\t}", "@Test\n public void testLoadOptionalForceCreate() throws ConfigurationException\n {\n factory.setBasePath(TEST_FILE.getParent());\n CombinedConfiguration config = prepareOptionalTest(\"xml\", true);\n assertEquals(\"Wrong number of configurations\", 1, config\n .getNumberOfConfigurations());\n FileConfiguration fc = (FileConfiguration) config\n .getConfiguration(OPTIONAL_NAME);\n assertNotNull(\"Optional config not found\", fc);\n assertEquals(\"File name was not set\", \"nonExisting.xml\", fc\n .getFileName());\n assertNotNull(\"Base path was not set\", fc.getBasePath());\n }", "private static void loadParser() {\n if(parser_ == null)\n parser_ = ConfigIOFactory.getInstance(\"json\");\n }", "private Resource createResource(final File file) throws IOException {\n\n // TODO: see this gist to prevent re-reading the same resource file if it's already registered\n // https://gist.github.com/3998818\n\n Registry<String, String> properties = ResourceUtil.readConfiguration(file);\n String resourceName = properties.getEntryValue(ResourceConstants.RESOURCE_NAME);\n\n String rootNode = properties.getEntryValue(ResourceConstants.RESOURCE_ROOT_NODE);\n\n String objectClassKey = properties.getEntryValue(ResourceConstants.RESOURCE_OBJECT);\n Class objectClass = classRegistry.getEntryValue(objectClassKey);\n\n String algorithmKey = properties.getEntryValue(ResourceConstants.RESOURCE_ALGORITHM_CLASS);\n Algorithm algorithm = algorithmFactory.createImplementation(algorithmKey);\n\n String resolverKey = properties.getEntryValue(ResourceConstants.RESOURCE_URI_RESOLVER_CLASS);\n Resolver resolver = resolverFactory.createImplementation(resolverKey);\n\n Resource resource = new ObjectResource(resourceName, rootNode, objectClass, algorithm, resolver);\n\n Object uniqueField = properties.getEntryValue(ResourceConstants.RESOURCE_UNIQUE_FIELD);\n List<String> uniqueFields = new ArrayList<String>();\n if (uniqueField != null)\n uniqueFields = Arrays.asList(StringUtil.split(uniqueField.toString(), \",\"));\n\n List<String> ignoredField = ResourceConstants.NON_SEARCHABLE_FIELDS;\n Map<String, String> entries = properties.getEntries();\n for (String fieldName : entries.keySet()) {\n if (!ignoredField.contains(fieldName)) {\n Boolean unique = Boolean.FALSE;\n if (uniqueFields.contains(fieldName))\n unique = Boolean.TRUE;\n resource.addFieldDefinition(fieldName, entries.get(fieldName), unique);\n }\n }\n\n return resource;\n }", "public void loadStorageConfiguration() throws IOException {\n String loadedConfigurationFile;\n if (this.configFile != null) {\n loadedConfigurationFile = this.configFile;\n this.configuration = StorageConfiguration.load(new FileInputStream(new File(this.configFile)));\n } else {\n // We load configuration file either from app home folder or from the JAR\n Path path = Paths.get(appHome + \"/conf/storage-configuration.yml\");\n if (appHome != null && Files.exists(path)) {\n loadedConfigurationFile = path.toString();\n this.configuration = StorageConfiguration.load(new FileInputStream(path.toFile()));\n } else {\n loadedConfigurationFile = StorageConfiguration.class.getClassLoader().getResourceAsStream(\"storage-configuration.yml\")\n .toString();\n this.configuration = StorageConfiguration\n .load(StorageConfiguration.class.getClassLoader().getResourceAsStream(\"storage-configuration.yml\"));\n }\n }\n\n // logLevel parameter has preference in CLI over configuration file\n if (this.logLevel == null || this.logLevel.isEmpty()) {\n this.logLevel = \"info\";\n }\n configureDefaultLog(this.logLevel);\n\n // logFile parameter has preference in CLI over configuration file, we first set the logFile passed\n// if (this.logFile != null && !this.logFile.isEmpty()) {\n// this.configuration.setLogFile(logFile);\n// }\n\n // If user has set up a logFile we redirect logs to it\n// if (this.logFile != null && !this.logFile.isEmpty()) {\n// org.apache.log4j.Logger rootLogger = LogManager.getRootLogger();\n//\n// // If a log file is used then console log is removed\n// rootLogger.removeAppender(\"stderr\");\n//\n// // Creating a RollingFileAppender to output the log\n// RollingFileAppender rollingFileAppender = new RollingFileAppender(new PatternLayout(\"%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - \"\n// + \"%m%n\"), this.logFile, true);\n// rollingFileAppender.setThreshold(Level.toLevel(this.logLevel));\n// rootLogger.addAppender(rollingFileAppender);\n// }\n\n logger.debug(\"Loading configuration from '{}'\", loadedConfigurationFile);\n }", "public static void loadGameConfiguration() {\n File configFile = new File(FileUtils.getRootFile(), Constant.CONFIG_FILE_NAME);\n manageGameConfigFile(configFile);\n }", "public void forceDefaultConfig()\n {\n plugin.saveResource(fileName, true);\n }", "private static void loadConfigs(String[] args) {\n String chosenConfigFile, chosenSensorsFile;\n\n // select config files (allow for specifying)\n if(args.length >= 2) {\n chosenConfigFile = args[0];\n chosenSensorsFile = args[1];\n }\n else {\n chosenConfigFile = DEFAULT_CONFIG_FILE;\n chosenSensorsFile = DEFAULT_SENSORS_FILE;\n }\n // filenames starting with \"/\" and \"./\" are later interpreted as being outside JAR\n if(chosenConfigFile.charAt(0) == '/' || chosenConfigFile.substring(0, 2).equals(\"./\"))\n System.out.println(\"retreiving \" + chosenConfigFile + \" from this filesystem (not the JAR)\");\n if(chosenSensorsFile.charAt(0) == '/' || chosenSensorsFile.substring(0, 2).equals(\"./\"))\n System.out.println(\"retreiving \" + chosenSensorsFile + \" from this filesystem (not the JAR)\");\n\n // load general configuration\n Properties props = new Properties();\n try {\n if(chosenConfigFile.charAt(0) == '/' || chosenConfigFile.substring(0, 2).equals(\"./\"))\n // get the config file from the user's filesystem\n props.load(new FileInputStream(new File(chosenConfigFile)));\n else\n // get the config file saved in this JAR\n props.load(Main.class.getResourceAsStream(\"/\" + chosenConfigFile));\n } catch (IOException e) {\n e.printStackTrace();\n System.exit(1);\n }\n\n // load sensors\n if(chosenSensorsFile.charAt(0) == '/' || chosenSensorsFile.substring(0, 2).equals(\"./\"))\n // get the sensors file from the user's filesystem\n sensors = ConfigLoader.getSensorsFromFile(chosenSensorsFile);\n else\n // get the sensors file saved in this JAR\n sensors = ConfigLoader.getSensorsFromFile(Main.class.getResourceAsStream(\"/\" + chosenSensorsFile));\n }", "public static void loadPracticeListFromFile() {\n JSONParser jsonParser = new JSONParser();\n\n try (FileReader reader = new FileReader(\"src/practiceList.json\")) {\n // Read JSON file\n Object object = jsonParser.parse(reader);\n\n //Iterate over word list array\n JSONArray wordList = (JSONArray) object;\n for (Object o : wordList) {\n\n JSONObject next = (JSONObject) o;\n String extra = \"\";\n\n if (((String) next.get(\"wordType\")).equalsIgnoreCase(\"verb\")) {\n extra = \"to \";\n }\n\n Word loadedWord = new Word(extra + next.get(\"english\"), (String) next.get(\"welsh\"), (String) next.get(\"wordType\"));\n\n addIntoPracticedWords(loadedWord);\n }\n\n } catch (ParseException | IOException e) {\n System.out.println(\"PracticeList file not found, will be created on exit.\");\n }\n }", "@Override\n public void init(String jsonString) throws PluginException {\n try {\n config = new JsonSimpleConfig(jsonString);\n reset();\n } catch (IOException e) {\n log.error(\"Error reading config: \", e);\n }\n }", "private void loadInterpreterSettingFromDefaultDir(boolean override) throws IOException {\n String interpreterJson = conf.getInterpreterJson();\n ClassLoader cl = Thread.currentThread().getContextClassLoader();\n if (Files.exists(interpreterDirPath)) {\n try (DirectoryStream<Path> directoryPaths = Files\n .newDirectoryStream(interpreterDirPath,\n entry -> Files.exists(entry)\n && Files.isDirectory(entry)\n && shouldRegister(entry.toFile().getName()))) {\n for (Path interpreterDir : directoryPaths) {\n\n String interpreterDirString = interpreterDir.toString();\n /**\n * Register interpreter by the following ordering\n * 1. Register it from path {ZEPPELIN_HOME}/interpreter/{interpreter_name}/\n * interpreter-setting.json\n * 2. Register it from interpreter-setting.json in classpath\n * {ZEPPELIN_HOME}/interpreter/{interpreter_name}\n */\n if (!registerInterpreterFromPath(interpreterDirString, interpreterJson, override) &&\n !registerInterpreterFromResource(cl, interpreterDirString, interpreterJson, override)) {\n LOGGER.warn(\"No interpreter-setting.json found in {}\", interpreterDirString);\n }\n }\n }\n } else {\n LOGGER.warn(\"InterpreterDir {} doesn't exist\", interpreterDirPath);\n }\n }", "@BeforeSuite\n public void initiateData() throws FileNotFoundException, IOException {\n jsonTestData = new JsonClass();\n userDirectory = System.getProperty(\"user.dir\");\n String log4jConfigFile = userDirectory + File.separator + \"src\" + File.separator + \"test\" + File.separator + \"resources\" + File.separator\n + \"log4j.properties\";\n ConfigurationSource source = new ConfigurationSource(new FileInputStream(log4jConfigFile));\n Configurator.initialize(null, source);\n logger = Logger.getLogger(getClass());\n }", "@Test(expected = ConfigurationException.class)\n public void testLoadOptionalWithException() throws ConfigurationException\n {\n factory.setFile(OPTIONALEX_FILE);\n factory.getConfiguration();\n }", "public JSONObject LoadJson(String filename) {\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\t\tnew FileInputStream(filename), \"UTF-8\"));\n\t\t\tStringBuffer buffer = new StringBuffer(1024);\n\t\t\tString line;\n\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tbuffer.append(line);\n\t\t\t}\n\t\t\treader.close();\n\n\t\t\treturn new JSONObject(buffer.toString());\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.format(\"[Error]Failed to open file %s!\", filename);\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t} catch (JSONException e) {\n\t\t\tSystem.err.format(\"[Error]Failed to parse json file %s!\", filename);\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "void overwriteConfiguration(Map<String, Object> config);", "private void initConfig() {\n Path walletPath;\n Wallet wallet;\n\n // load a CCP\n Path networkConfigPath; \n \n try {\n \t\n \tif (!isLoadFile) {\n // Load a file system based wallet for managing identities.\n walletPath = Paths.get(\"wallet\");\n wallet = Wallet.createFileSystemWallet(walletPath);\n\n // load a CCP\n networkConfigPath = Paths.get(\"\", \"..\", \"basic-network\", configFile);\n \n builder = Gateway.createBuilder();\n \n \tbuilder.identity(wallet, userId).networkConfig(networkConfigPath).discovery(false);\n \t\n \tisLoadFile = true;\n \t}\n } catch (Exception e) {\n \te.printStackTrace();\n \tthrow new RuntimeException(e);\n }\n\t}", "@Test\n public void testLoadConfiguration() throws ConfigurationException\n {\n factory.setFile(TEST_FILE);\n checkConfiguration();\n }", "public BotConfig(Path dir) {\n\t\tthis.dir = dir;\n\t\tif (!(Files.exists(dir) && Files.isDirectory(dir))) {\n\t\t\tif (!Files.exists(dir)) {\n\t\t\t\ttry {\n\t\t\t\t\tFiles.createDirectories(dir);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tlog.error(\"Could not create config directory \" + dir, e);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlog.error(\"File exists at config directory path {}\", dir);\n\t\t\t}\n\t\t}\n\t\tthis.guilds = new ConcurrentHashMap<>();\n\t\tGson gson = new Gson();\n\t\tPath systemsFile = dir.resolve(SYSTEMS_FILE);\n\t\tif (Files.exists(systemsFile)) {\n\t\t\ttry (var reader = Files.newBufferedReader(systemsFile)) {\n\t\t\t\tthis.systemsConfig = gson.fromJson(reader, SystemsConfig.class);\n\t\t\t\tlog.info(\"Loaded systems config from {}\", systemsFile);\n\t\t\t} catch (JsonSyntaxException e) {\n\t\t\t\tlog.error(\"Invalid JSON found! Please fix or remove config file \" + systemsFile + \" and restart.\", e);\n\t\t\t\tthrow e;\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new UncheckedIOException(e);\n\t\t\t}\n\t\t} else {\n\t\t\tlog.info(\"No systems config file found. Creating an empty one at {}\", systemsFile);\n\t\t\tthis.systemsConfig = new SystemsConfig();\n\t\t\tthis.flush();\n\t\t}\n\t}", "public JsonReader(String file) {\n this.file = file;\n }", "AuditYamlConfig loadConfig() throws ConfigurationException\n {\n if (hasCustomConfigPath())\n {\n return loadConfigAtCustomPath();\n }\n else if (hasConfigAtDefaultPath())\n {\n return loadConfigAtDefaultPath();\n }\n else\n {\n return AuditYamlConfig.createWithoutFile();\n }\n }", "public static void main(String[] args) {\n// final Config config = Config.create(classpath(\"aa.json\").mediaType(\"application/json\"));\n// System.out.println(config.get(\"aa\").asString().get());\n\n// final Config config = Config.create(classpath(\"aa.json\").parser(HoconConfigParserBuilder.buildDefault()));\n// System.out.println(config.get(\"aa\").asString().get());\n System.out.println(config.get(\"greeting\").asString().get());\n }", "@Override\n void loadData() {\n langConfigFile = new File(plugin.getDataFolder() + \"/messages.yml\");\n // Attempt to read the config in the config file.\n langConfig = YamlConfiguration.loadConfiguration(langConfigFile);\n // If the config file is null (due to the config file being invalid or not there) create a new one.\n // If the file doesnt exist, populate it from the template.\n if (!langConfigFile.exists()) {\n langConfigFile = new File(plugin.getDataFolder() + \"/messages.yml\");\n langConfig = YamlConfiguration.loadConfiguration(new InputStreamReader(plugin.getResource(\"messages.yml\")));\n saveData();\n }\n }" ]
[ "0.61410385", "0.61386997", "0.604861", "0.59651315", "0.59535646", "0.5917394", "0.58762276", "0.58471304", "0.5846469", "0.5843314", "0.58357304", "0.57612544", "0.5712057", "0.56717575", "0.5667756", "0.56518406", "0.5650711", "0.5636564", "0.5609583", "0.55956084", "0.5555621", "0.5518664", "0.5452201", "0.5441961", "0.544085", "0.5421709", "0.54194635", "0.53765", "0.53735095", "0.53694385", "0.53645533", "0.5355949", "0.5347039", "0.53451526", "0.5339264", "0.52937067", "0.5288022", "0.5263575", "0.5260726", "0.52427745", "0.5241943", "0.523963", "0.52165073", "0.52081627", "0.5204474", "0.5195065", "0.518932", "0.51698905", "0.51690865", "0.5165145", "0.51532966", "0.5147481", "0.5122617", "0.50991637", "0.50984067", "0.5095441", "0.50879776", "0.5077955", "0.5074899", "0.5073593", "0.5059142", "0.5058948", "0.5058036", "0.5056956", "0.50523597", "0.50426775", "0.50353855", "0.50237894", "0.5006865", "0.5005882", "0.50053644", "0.49943414", "0.49939364", "0.49934876", "0.49693048", "0.49626508", "0.49502525", "0.4948218", "0.49411935", "0.49363482", "0.4925367", "0.491791", "0.4917842", "0.48954788", "0.4880995", "0.4880987", "0.4862505", "0.4851884", "0.48503482", "0.48467463", "0.4846116", "0.4842978", "0.4838504", "0.4834568", "0.48284325", "0.4814703", "0.4814661", "0.48141965", "0.4804165", "0.47976243" ]
0.63650435
0
Saves a config object to the specified file in JSON format
public static void saveConfig(Object config, File file) throws IOException { file.createNewFile(); String json = gson.toJson(parser.parse(gson.toJson(config))); try (PrintWriter out = new PrintWriter(file)) { out.println(json); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void exportJsonFile(File configFile) {\n Gson gson = new Gson();\n \n // Java object to JSON, and assign to a String\n String jsonInString = gson.toJson(GameConfig.getInstance());\n \n try {\n FileWriter writer = new FileWriter(configFile);\n \n writer.append(jsonInString);\n writer.flush();\n writer.close();\n } catch (IOException e) {\n LogUtils.error(\"exportJsonFile => \",e);\n }\n }", "public static void saveGameConfiguration() {\n exportJsonFile(new File(FileUtils.getRootFile(), Constant.CONFIG_FILE_NAME));\n }", "public void writeConfig(Config config) throws IOException {\n\t\tFile configFile = new File(this.configPath);\n\n\t\tif (configFile.exists()) return;\n\t\tBufferedWriter writer = new BufferedWriter(\n\t\t\tnew OutputStreamWriter(new FileOutputStream(configFile))\n\t\t);\n\t\twriter.write(new Gson().toJson(config));\n\t\twriter.flush();\n\t\twriter.close();\n\t}", "public void saveJSON(String fileName, Object o){\n // System.err.println(\"accessing disk\");\n Gson gson = new Gson();\n try(FileWriter writer = new FileWriter(fileName)){\n gson.toJson(o, writer);\n //System.err.println(\"\\n Token stored\");\n }catch (IOException e) {\n e.printStackTrace();\n }\n }", "private static void saveJsonFile() {\n Log.println(Log.INFO, \"FileAccessing\", \"Writing settings file.\");\n JsonObject toSave = new JsonObject();\n JsonArray mappingControls = new JsonArray();\n for (int i = 0; i < TaskDetail.actionToTask.size(); i++) {\n JsonObject individualMapping = new JsonObject();\n TaskDetail detail = TaskDetail.actionToTask.valueAt(i);\n byte combinedAction = (byte) TaskDetail.actionToTask.keyAt(i);\n assert detail != null;\n int outerControl = detail.getTask();\n individualMapping.addProperty(\"combinedAction\", combinedAction);\n individualMapping.addProperty(\"task\", outerControl);\n mappingControls.add(individualMapping);\n }\n toSave.add(\"mappingControls\", mappingControls);\n\n JsonArray generalSettings = new JsonArray();\n for (SettingDetail setting : SettingDetail.settingDetails) {\n JsonObject individualSetting = new JsonObject();\n int status = setting.getCurrentIdx();\n individualSetting.addProperty(\"status\", status);\n generalSettings.add(individualSetting);\n }\n toSave.add(\"generalSettings\", generalSettings);\n\n JsonArray deviceList = new JsonArray();\n for (DeviceDetail device : DeviceDetail.deviceDetails) {\n JsonObject individualDevice = new JsonObject();\n individualDevice.addProperty(\"name\", device.deviceName);\n individualDevice.addProperty(\"mac\", device.macAddress);\n deviceList.add(individualDevice);\n }\n toSave.add(\"devices\", deviceList);\n\n JsonArray sensitivityList = new JsonArray();\n for (SensitivitySetting sensitivity : SensitivitySetting.sensitivitySettings) {\n JsonObject individualSensitivity = new JsonObject();\n individualSensitivity.addProperty(\"factor\", sensitivity.multiplicativeFactor);\n individualSensitivity.addProperty(\"sensitivity\", sensitivity.sensitivity);\n sensitivityList.add(individualSensitivity);\n }\n toSave.add(\"sensitivities\", sensitivityList);\n\n toSave.addProperty(\"currentlySelected\", DeviceDetail.getIndexSelected());\n\n try {\n FileOutputStream outputStreamWriter = context.openFileOutput(\"settingDetails.json\", Context.MODE_PRIVATE);\n outputStreamWriter.write(toSave.toString().getBytes());\n outputStreamWriter.close();\n } catch (IOException e) {\n Log.println(Log.ERROR, \"FileAccessing\", \"Settings file writing error.\");\n }\n }", "public static void SaveWorldConfiguration(WorldConfiguration worldConfig, String path) {\n Gson gson = new Gson();\n String jsonWorldConfig = gson.toJson(worldConfig);\n StoreJsonToFile(path, jsonWorldConfig);\n }", "public void save() {\n if (worldOreConfig == null) {\n return;\n }\n\n final WorldOreConfig worldOreConfig;\n\n if (!(this.worldOreConfig instanceof ConfigurationSerializable)) {\n worldOreConfig = new WorldOreConfigYamlImpl(this.worldOreConfig.getName(), this.worldOreConfig.getConfigType(), this.worldOreConfig.getOreSettings(), this.worldOreConfig.getBiomeOreSettings());\n } else {\n worldOreConfig = this.worldOreConfig;\n }\n\n final Config config = new Config(file);\n\n config.set(\"value\", worldOreConfig);\n\n try {\n config.options().header(\"This file is machine generated, please use the in game commands and gui to change values. \\nModifying this file per hand on your own risk.\").copyHeader(true);\n config.save(file);\n } catch (final IOException e) {\n throw new RuntimeException(\"Unexpected error while saving WorldOreConfig \" + worldOreConfig.getName() + \" to disk!\", e);\n }\n }", "public void save() {\n\t\tif (fileConfiguration == null || configFile == null)\n\t\t\treturn;\n\n\t\ttry {\n\t\t\tgetConfig().save(configFile);\n\t\t} catch (final IOException e) {\n\t\t\tplugin.getLogger().severe(String.format(\"[%s] Could not save config to %s : %s\", plugin.getName(), configFile, e));\n\t\t}\n\t}", "private void writeToFile() {\n try {\n FileOutputStream fos = new FileOutputStream(f);\n String toWrite = myJSON.toString(4);\n byte[] b = toWrite.getBytes();\n fos.write(b);\n fos.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void guardarEnJSON () {\n Gson gson = new GsonBuilder().setPrettyPrinting().create();\n String s = gson.toJson(this);\n try {\n FileWriter fw = new FileWriter(\"files/graph.json\");\n fw.write(s);\n fw.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void saveProject() {\n File f = new File(getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS), projectName + File.separator + \"render.cfg\");\n\n JSONObject json = new JSONObject();\n\n try {\n json.put(\"frames\", frames);\n json.put(\"a\", a);\n json.put(\"b\", b);\n json.put(\"P\", P);\n } catch (JSONException e) {\n Log.v(\"RenderSettings\", \"saveProject failed with a JSON Exception: \" + e.getMessage());\n }\n\n try (FileWriter file = new FileWriter(f)) {\n file.write(json.toString());\n } catch (IOException e) {\n Log.v(\"RenderSettings\", \"saveProject failed with a IO Exception: \" + e.getMessage());\n }\n }", "public void save() {\n try {\n yml.save(config);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void saveConfig () {\n if (fileConfiguration == null || config == null) {\n \n if (debug) {\n log.info(\"Can't save config - null\");\n }\n \n return;\n } else {\n try {\n getConfig().save(config);\n } catch (IOException e) {\n log.severe(\"Something happened while saving \" + configName);\n }\n if (debug) {\n log.info(\"Saved \" + configName + \" successfully.\");\n }\n }\n }", "public static void writeJsonObjectFile(JsonEntity objectToWrite, String filePath) \n\t{\n\t\tGson gsonParser = new Gson();\n\t\t\n\t\ttry \n\t\t{\n\t\t\tFiles.write(gsonParser.toJson(objectToWrite).getBytes(), new File(filePath));\n\t\t}\n\t\tcatch (IOException e) \n\t\t{\n\t\t\tSystem.err.println(\"Can't write to the json file\" + e.getMessage());\n\t\t}\n\t}", "private void saveConfiguration() {\n }", "public void exportAsJsonFile(String path) throws IOException {\n Gson gson = new GsonBuilder().setPrettyPrinting().create();\n String json = gson.toJson(this);\n\n FileWriter writer = new FileWriter(path);\n writer.write(json);\n writer.close();\n }", "public void save(File configFile) {\n configFile.getParentFile().mkdirs();\n\n try {\n this.getProperties().store(new FileWriter(configFile), \"Redis Credentials\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void save() throws FileNotFoundException, IOException\n {\n settings.store(new FileOutputStream(FILE), \"N3TPD Config File\");\n }", "void saveToFile() {\n\t\ttry {\n\t\t\tFile directory = GameApplication.getInstance().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS);\n\t\t\tFile target = new File(directory, FILE_NAME);\n\t\t\tif (!target.exists()) {\n\t\t\t\ttarget.createNewFile();\n\t\t\t}\n\t\t\tJsonWriter writer = new JsonWriter(new FileWriter(target));\n\t\t\twriter.setIndent(\" \");\n\t\t\twriter.beginArray();\n\t\t\tfor (Scoreboard scoreboard : scoreboards.values()) {\n\t\t\t\twriteScoreboard(writer, scoreboard);\n\t\t\t}\n\t\t\twriter.endArray();\n\t\t\twriter.flush();\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void saveProperties() throws IOException {\r\n\t\tsetProperties();\r\n\t\tOutputStream outputStream;\r\n\t\toutputStream = new FileOutputStream(configFile);\r\n\t\tconfigProps.store(outputStream, \"Lot Data Mapper Application\");\r\n\t\tString msg = \"SAVING PROPERTIES WITH VALUES: \\n\\t 1 \\t\" + dt.Root+\"\\n \\t 2 \\t\" + dt.Map+\" \\n\\t 3 \\t\" + dt.Out+\" \\n\\t 4 \\t\" + Trans.ReportTypeName+\" \\n\\t 5 \\t\"+Trans.ReportedByPersonName+\" \\n\\t 6\\t\"+Trans.ReportedDate + \"\\n PROPERTIIES SAVED\";\r\n\t\tlg.l(msg);\r\n\t\toutputStream.close();\r\n\t}", "public void save() {\n try {\n ConfigurationProvider.getProvider(YamlConfiguration.class).save(this.configuration, this.getConfigurationFile());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void save() {\n // Convert the settings to a string\n String output = readSettings();\n \n try {\n // Make sure the file exists\n if (!settingsFile.exists()) {\n File parent = settingsFile.getParentFile();\n parent.mkdirs();\n settingsFile.createNewFile(); \n }\n \n // Write the data into the file\n BufferedWriter writer = new BufferedWriter(new FileWriter(settingsFile));\n writer.write(output);\n writer.close(); \n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void saveGame(String fileName){\n Gson gson = new Gson();\n String userJson = gson.toJson(player);\n\n try(Writer w = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(fileName), \"UTF-8\"))) {\n w.write(userJson);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void save(Object o, String file) {\n\t\t\n\t}", "void writeConfiguration(String fileName) throws IOException;", "public boolean saveJson(String pathFile) {\n try {\n jsonObject.put(\"namespace\", this.numNamespace);\n jsonObject.put(\"class\", this.numClasses);\n jsonObject.put(\"interface\", this.numInterfaces);\n jsonObject.put(\"method\", this.numMethods);\n jsonObject.put(\"enumItem\", this.numEnumItem);\n jsonObject.put(\"enum\", this.numEnum);\n jsonObject.put(\"page\", this.numLinks);\n jsonObject.put(\"Classes\", classlist);\n jsonObject.put(\"Interfaces\", interfacelist);\n jsonObject.put(\"Enum\", enumlist);\n FileWriter file = new FileWriter(pathFile + this.fileName + \".json\");\n file.write(jsonObject.toJSONString());\n file.flush();\n file.close();\n return true;\n } catch (IOException e) {\n return false;\n }\n }", "public void run() {\n WriteConfigJson(jsonString,path);\r\n }", "private void save(String fileName, String json){\n mJSonNotifications = getSharedPreferences(fileName, MODE_PRIVATE);\n mJSonNotifications.edit().putString(fileName, json).apply();\n }", "public static void saveObj(Object obj, File file)\n {\n try(ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file)))\n {\n oos.writeObject(obj);\n }\n \n catch(IOException e)\n {\n JOptionPane.showMessageDialog(null, \"[Error] Failed to save file: \" + e.getMessage());\n }\n }", "public void save(String json, Map<String,Object> properties);", "private static void manageGameConfigFile(File configFile) {\n Gson gson = new Gson();\n try {\n GameConfig.setInstance(gson.fromJson(new FileReader(configFile), GameConfig.class));\n } catch (FileNotFoundException e) {\n LogUtils.error(\"FileNotFoundException => \", e);\n }\n }", "public static void save(OneDriveConfiguration configuration,\n String configFile) throws ConfigurationException {\n setProperties(configuration);\n config.save(new File(configFile));\n }", "protected void saveToFile(final File regionsFile, final JsonObject json) throws IOException {\n LOGGER.fine(\"Storing ANSS Authoritative Regions to \" + regionsFile);\n // save regions if needed later\n FileUtils.writeFileThenMove(\n new File(regionsFile.toString() + \".temp\"),\n regionsFile,\n json.toString().getBytes());\n LOGGER.finer(\"Stored ANSS Regions to \" + regionsFile);\n }", "public static void createJsonFile(JsonObject json) throws IOException {\n\r\n FileWriter file = new FileWriter(\"outputfile\", false);\r\n try {\r\n file.write(Jsoner.prettyPrint(json.toJson(),2));\r\n file.flush();\r\n } catch (IOException e) {\r\n out.println(\"Error \" + e);\r\n }\r\n }", "@Override\n\tpublic void save(String file_name) {\n\t\tserialize(file_name);\n\t}", "private void saveInFile() {\n try {\n FileOutputStream fos = openFileOutput(FILENAME,\n Context.MODE_PRIVATE);//goes stream based on filename\n BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fos)); //create buffer writer\n Gson gson = new Gson();\n gson.toJson(countbookList, out);//convert java object to json string & save in output\n out.flush();\n fos.close();\n } catch (FileNotFoundException e) {\n throw new RuntimeException();\n } catch (IOException e) {\n throw new RuntimeException();\n }\n }", "private void saveInFile() {\n try {\n FileOutputStream fOut = openFileOutput(FILENAME,\n Context.MODE_PRIVATE);\n\n OutputStreamWriter writer = new OutputStreamWriter(fOut);\n Gson gson = new Gson();\n gson.toJson(counters, writer);\n writer.flush();\n\n fOut.close();\n\n } catch (FileNotFoundException e) {\n throw new RuntimeException();\n } catch (IOException e) {\n throw new RuntimeException();\n }\n }", "public final void writeConfig(Json json) {\n json.writeObjectStart();\n \n // Yeah, this isn't really an array, but DodlesActors assume they're in an array... :(\n json.writeArrayStart(\"actor\");\n actor.writeConfig(json);\n json.writeArrayEnd();\n \n json.writeArrayStart(\"instances\");\n for (CharacterInstance instance : instances) {\n instance.writeConfig(json);\n }\n json.writeArrayEnd();\n \n json.writeValue(\"characterName\", characterName);\n \n json.writeObjectEnd();\n }", "public void save() {\n try {\n FileOutputStream fos = new FileOutputStream(file);\n properties.store(fos, \"Preferences\");\n } catch (FileNotFoundException e) {\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public static void saveTestSequenceToJson(TestSequenceList testSequenceList, String absoluteFilePath) {\n Gson gson = new GsonBuilder().enableComplexMapKeySerialization().setPrettyPrinting().create();\r\n String jsonString = gson.toJson(testSequenceList);\r\n try {\r\n FileWriter fileWriter = new FileWriter(absoluteFilePath);\r\n fileWriter.write(jsonString);\r\n System.out.println(\"File saved successfully\");\r\n fileWriter.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "private void save() {\n if (mCacheFile.exists()) {\n mCacheFile.delete();\n }\n\n try (JsonWriter writer = new JsonWriter(new BufferedWriter(new FileWriter(mCacheFile)))) {\n writer.beginObject();\n writer.name(PRINTER_LIST_NAMES.get(0));\n writer.beginArray();\n for (DiscoveredPrinter printer : mSavedPrinters) {\n printer.write(writer);\n }\n writer.endArray();\n writer.endObject();\n } catch (NullPointerException | IOException e) {\n Log.w(TAG, \"Error while storing to \" + mCacheFile, e);\n }\n }", "String saveToFile(Object data, String fileName, FileFormat fileFormat) throws IOException;", "synchronized public void saveToFile() {\n try {\n saveObjToFile(this, saveFilePath);\n } catch (IOException e) {\n e.printStackTrace();\n log(\"error saving resource to file\");\n }\n }", "@SuppressWarnings(\"unused\")\n public void SaveJsonCollectionsToFiles(){\n try {\n String formattedDate = FileNameUtils.DATE_FORMAT.format(new Date());\n ObjectWriter writer = mapper.writer(new DefaultPrettyPrinter());\n writer.writeValue(new File(FileNameUtils.GetValuesFileName(formattedDate)), jsonObjects);\n }\n catch(IOException exp){\n System.err.println(\"Error while creating JSON file. Reason: \" + exp.getMessage());\n }\n }", "public static void writeListToJsonFile(Object jsonObj, Path filePath) throws JsonGenerationException, JsonMappingException, IOException {\n\n final OutputStream out = new ByteArrayOutputStream();\n ObjectMapper mapper = new ObjectMapper();\n mapper.writeValue(out, jsonObj);\n\n final byte[] data = ((ByteArrayOutputStream) out).toByteArray();\n\n Files.write(filePath, data);\n\n }", "public void saveToFile(Map<String, T> data) throws IOException{\n\t\tOutputStream file = new FileOutputStream(filePath);\n OutputStream buffer = new BufferedOutputStream(file);\n ObjectOutput output = new ObjectOutputStream(buffer);\n\n // serialize the Map\n output.writeObject(data);\n output.close();\n\t}", "@Override\r\n public <T> void saveConfig(ConfigStorageClient<T> client, T value) {\r\n String name = client.getName();\r\n JsonElement json = client.toJson(gson, value);\r\n synchronized (serializedConfig) {\r\n serializedConfig.put(name, json);\r\n scheduleCommitLocked();\r\n }\r\n }", "public void save() {\r\n try {\r\n FileOutputStream fos = new FileOutputStream(REPO_STATE_FILE_NAME);\r\n fos.write(CodecUtils.toJson(this).getBytes());\r\n fos.close();\r\n } catch (Exception e) {\r\n Logging.logError(e);\r\n }\r\n }", "public static void save() throws IOException {\n FileOutputStream f_out = new\n FileOutputStream(settingsFile);\n ObjectOutputStream o_out = new\n ObjectOutputStream(f_out);\n SettingsSaver s = new SettingsSaver();\n o_out.writeObject(s);\n o_out.close();\n f_out.close();\n }", "public static void writeToJsonGzFile(Object jsonObj, Path filePath) throws JsonGenerationException, JsonMappingException, IOException {\n\n GZIPOutputStream gzipOS = new GZIPOutputStream(Files.newOutputStream(filePath));\n WritableByteChannel out = Channels.newChannel(gzipOS);\n\n ObjectMapper mapper = new ObjectMapper();\n byte[] jsonOut = mapper.writeValueAsBytes(jsonObj);\n out.write(ByteBuffer.wrap(jsonOut));\n out.close();\n\n }", "public static void writeJsonToFile(List<Object> objLst, File file) throws Exception {\n writeJsonToFile(objLst, file, false);\n }", "public JSONObject save();", "private void saveWorld() {\n try {\n jsonWriter.open();\n jsonWriter.write(world);\n jsonWriter.close();\n System.out.println(\"Saved world to \" + JSON_STORE);\n } catch (FileNotFoundException e) {\n System.out.println(\"Unable to write to file: \" + JSON_STORE);\n }\n }", "private static void jsonWriter(JSONObject bookList) throws Exception{\r\n FileWriter file = new FileWriter(\"libreria.json\");\r\n file.write(bookList.toJSONString());\r\n file.flush();\r\n }", "public void save() throws IOException {\r\n\t\tprojectDir.mkdirs();\r\n\t\tWriter writer = null;\r\n\t\ttry {\r\n\t\t\twriter = new FileWriter(new File(projectDir, TERN_PROJECT));\r\n\t\t\tsuper.writeJSONString(writer);\r\n\t\t} finally {\r\n\t\t\tif (writer != null) {\r\n\t\t\t\tIOUtils.closeQuietly(writer);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static boolean saveSharedPreferencesToJsonFile(File dst, Context context) {\n\t\t\n\t\tSharedPreferences pref = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(context);\n\t\tSharedPreferences adminPreferences = context.getSharedPreferences(\n\t\t\t\tAdminPreferencesActivity.ADMIN_PREFERENCES, 0);\n\n\t\tGson gson = new Gson();\n\t\tString jsonPrefs = \"{\\n\\\"general_preferences\\\": \" + gson.toJson(pref.getAll()) + \",\\n\" \n\t\t\t\t\t\t+ \"\\\"admin_preferences\\\": \" + gson.toJson(adminPreferences.getAll())\n\t\t\t\t\t\t+ \"}\";\n\t\tLog.d(\"AdminPreferencesActivity\", jsonPrefs);\n\t\t\n\t\treturn FileUtils.writeStringToFile(dst, jsonPrefs);\n\t}", "private void writeObject(String filePath, Object obj) throws IOException {\n OutputStream file = new FileOutputStream(filePath);\n OutputStream buffer = new BufferedOutputStream(file);\n ObjectOutput output = new ObjectOutputStream(buffer);\n output.writeObject(obj);\n output.close();\n }", "public void writeToFile (String json) {\n // reset fos to null for checks\n FileOutputStream fos = null;\n try {\n String FILE_NAME = \"ExportedLearningCards.json\";\n fos = openFileOutput(FILE_NAME, MODE_PRIVATE);\n fos.write(json.getBytes());\n Toast.makeText(this, \"Saved to \" + getFilesDir() + \"/\" + FILE_NAME,\n Toast.LENGTH_LONG).show();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (fos != null) {\n try {\n fos.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }", "private void saveInFile() {\n try {\n FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);\n\n BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fos));\n\n Gson gson = new Gson();\n Log.d(\"PersonList\", personList.toString());\n gson.toJson(personList, out);\n out.flush();\n\n fos.close();\n\n } catch (FileNotFoundException e){\n throw new RuntimeException();\n } catch (IOException e){\n e.printStackTrace();\n }\n\n }", "static void save(Schedules schedules, String filename) throws IOException, RBEConfigObjectException\n {\n\t\tFileWriter fw = new FileWriter(filename);\n\t\tschedules.toXML(fw);\n\t\tfw.close();\n }", "private void saveConfiguration() {\r\n\tnew File(PROPERTIES_FILE).getParentFile().mkdirs();\r\n\tProperties props = new Properties();\r\n\ttry {\r\n\t props.setProperty(KEY_LAST_SOURCE_DIR, lastSourceDir);\r\n\t props.setProperty(KEY_LAST_TARGET_DIR, lastTargetDir);\r\n\t logger.debug(\"Speichere \" + props + \" nach \" + PROPERTIES_FILE);\r\n\t FileOutputStream stream = new FileOutputStream(PROPERTIES_FILE);\r\n\r\n\t props.store(stream, \"Do not change!\");\r\n\t stream.close();\r\n\t} catch (IOException e) {\r\n\t logger.error(\"Konfiguration konnte nicht gespeichert werden!\", e);\r\n\t}\r\n }", "private void saveInFile() {\n\t\tthis.deleteFile();\n\t\tfor (CounterModel obj : counterListModel.getCounterList()) {\n\t\t\ttry {\n\t\t\t\tGson gson = new Gson();\n\t\t\t\tif (obj.getCounterName().equals(counterModel.getCounterName())) {\n\t\t\t\t\tobj = counterModel;\n\t\t\t\t}\n\t\t\t\tString json = gson.toJson(obj) +'\\n';\n\t\t\t\tFileOutputStream fos = openFileOutput(FILENAME,\n\t\t\t\t\t\tContext.MODE_APPEND);\n\t\t\t\tfos.write(json.getBytes());\n\t\t\t\tfos.close();\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}\n\t}", "private void writeMapToFile() {\r\n\t\ttry {\r\n\t\t\tString dm = gson.toJson(daoMap);// gson.toJson(entity);\r\n\t\t\tFileWriter fileWriter = new FileWriter(path);\r\n\t\t\t\r\n\t\t\tfileWriter.write(dm);\r\n\t\t\tfileWriter.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void writeToConfigFile() {\n if(properties == null) {\n return;\n }\n\n properties.put(\"MAN-LATITUDE\", String.valueOf(Location.getMan_latitude()));\n properties.put(\"MAN-LONGITUDE\", String.valueOf(Location.getMan_longitude()));\n properties.put(\"CURRENT-DESTINATION-NAME\", currentDestinationName);\n properties.put(\"CURRENT-DESTINATION-ADDRESS\", currentDestination.getCSVAddress());\n properties.put(\"EVENT-START-TIME\", ClockDriver.dfFull.format(Event.globalEventStartTime));\n double[] coefficients = Location.getAdjustmentCoefficients();\n String adjustmentCoefficients = String.valueOf(coefficients[0]) + ',' +\n String.valueOf(coefficients[1]) + ',' + String.valueOf(coefficients[2]) + ',' +\n String.valueOf(coefficients[3]);\n properties.put(\"ADJUSTMENT-COEFFICIENTS\", adjustmentCoefficients);\n StringBuilder blockStringBuilder = new StringBuilder();\n for(Object[] block : Location.getBlockDistances()) {\n if(block.length == 2) {\n blockStringBuilder.append(block[0]);\n blockStringBuilder.append(',');\n blockStringBuilder.append(block[1]);\n blockStringBuilder.append(';');\n }\n }\n properties.put(\"BLOCK-DISTANCES\", blockStringBuilder.toString());\n\n try {\n properties.store(new FileOutputStream(configPath), \"\");\n } catch(IOException e) {\n logger.warning(this.getClass(),\n \"IOException while writing to config file \\'\" + configPath + \"\\': \" + e.getMessage());\n }\n }", "private void saveInFile(final String fileName, ArrayList<Habit> habitArray) {\r\n try {\r\n FileOutputStream fos = openFileOutput(fileName, 0);\r\n BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fos));\r\n Gson gson = new Gson();\r\n gson.toJson(habitArray, out);\r\n out.flush();\r\n\r\n fos.close();\r\n } catch (FileNotFoundException e) {\r\n // TODO Auto-generated catch block\r\n throw new RuntimeException();\r\n } catch (IOException e) {\r\n // TODO Auto-generated catch block\r\n throw new RuntimeException();\r\n }\r\n }", "private static void persistSettings() {\n\t\ttry {\n\t\t\tBufferedWriter userConf = new BufferedWriter(new FileWriter(\n\t\t\t\t\tconf.getAbsolutePath()));\n\t\t\tproperties.store(userConf, null);\n\t\t\t// flush and close streams\n\t\t\tuserConf.flush();\n\t\t\tuserConf.close();\n\t\t} catch (IOException e) {\n\t\t\tlog.severe(\"Couldn't save config file.\");\n\t\t}\n\t}", "public void saveData() {\n try {\n JsonWriter jw = new JsonWriter(openFileOutput(DATA_FILE, Context.MODE_PRIVATE));\n jw.write(user);\n jw.close();\n } catch(Exception e) {\n Log.i(\"Exception :\", e.toString());\n }\n }", "public void saveToDoList() {\n try {\n jsonWriter.open();\n jsonWriter.write(toDoList);\n jsonWriter.close();\n\n System.out.println(\"Saved \" + toDoList.getName() + \" to \" + JSON_STORE);\n } catch (FileNotFoundException e) {\n System.out.println(\"Unable to write to file: \" + JSON_STORE);\n }\n }", "public <T> String SerializeJson(T obj, String pathToRoot) {\n this.lastPath = pathToRoot + obj.getClass().getSimpleName().toLowerCase() + \"_object-\" + Math.abs(new Random().nextLong()) + \".json\";\n File file = new File(this.lastPath);\n ObjectMapper mapper = new ObjectMapper();\n\n mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);\n mapper.registerModule(new JavaTimeModule());\n mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);\n\n try {\n file.createNewFile();\n mapper.writeValue(file, obj);\n System.out.println(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(obj));\n return mapper.writeValueAsString(obj);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return \"\";\n }", "public void saveArchive() throws FileNotFoundException {\n jsonWriter.open();\n Archive archive = new Archive(cameraCollection, filmCollection);\n jsonWriter.write(archive);\n jsonWriter.close();\n }", "public static void saveNewConfig() throws IOException {\n\t\tOutputStream os = new FileOutputStream(fileLocation);\n\t\tconfigurationFile.store(os, \"\");\n\t\tos.flush();\n\t\tos.close();\n\t\tupdateConfigFile();\n\t}", "public void saveTodo() {\r\n File file = new File(\"C:\\\\Users\\\\Dalia\\\\Desktop\\\\CPSC 210\\\\Project\\\\project_b2h3b\\\\data\");\r\n JFileChooser chooser = new JFileChooser();\r\n chooser.setDialogTitle(\"Specify a file to save\");\r\n chooser.setCurrentDirectory(file);\r\n int userSelection = chooser.showSaveDialog(null);\r\n if (userSelection == JFileChooser.APPROVE_OPTION) {\r\n File f = chooser.getSelectedFile();\r\n System.out.println(\"Save as file: \" + f.getAbsolutePath());\r\n String tempFileName = f.getAbsolutePath();\r\n writer = new MyTodoJsonWriter(tempFileName);\r\n try {\r\n writer.open();\r\n writer.write(myTodo);\r\n fileName = tempFileName;\r\n playSound(\"c1.wav\");\r\n } catch (IOException ioException) {\r\n JOptionPane.showMessageDialog(null, \"Cannot save todolist!\");\r\n } finally {\r\n writer.close();\r\n JOptionPane.showMessageDialog(null, \"Save successful!\");\r\n }\r\n todoListGui();\r\n }\r\n }", "public void saveAccountConfig () {\n\t\ttry {\n\t\t\tthis.accountConfig.store(new FileWriter(new File(this.accountAddress)), \"\");\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"[ERROR] Could not save initialization to account properties file: \" + accountAddress);\n\t\t\tSystem.err.println(e.getMessage());\n\t\t}\n\t}", "@Override\n public void saveConfig() {\n IPathManager pm = PathManagerFactory.getPathManager();\n LocalizationContext context = pm.getContext(\n LocalizationType.COMMON_STATIC, LocalizationLevel.SITE);\n String newFileName = getExistingConfigFilePath();\n ILocalizationFile locFile = pm.getLocalizationFile(context,\n newFileName);\n\n try {\n statusHandler.info(\"Saving -- \" + locFile.getPath());\n try (SaveableOutputStream os = locFile.openOutputStream()) {\n jaxb.marshalToStream(mesoCfgXML, os);\n os.save();\n }\n } catch (Exception e) {\n statusHandler.handle(Priority.PROBLEM,\n \"Failed to save \" + getExistingConfigFilePath(), e);\n }\n }", "public void save(List<T> data) {\n\t\ttry {\n\t\t\tFile file = new File(getFileLocation());\n\t\t\tif (!file.getParentFile().exists()) {\n\t\t\t\tfile.getParentFile().mkdirs();\n\t\t\t}\n\t\t\tFileWriter fw = new FileWriter(getFileLocation());\n\t\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\tbw.write(gson.toJson(data));\n\t\t\tbw.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void storeUserPrefs(User user) {\n //start writing (open the file)\n SharedPreferences.Editor editor = prefs.edit();\n //put the data\n Gson gson = new Gson();\n String json = gson.toJson(user);\n editor.putString(USER_PREFS, json);\n //close the file\n editor.apply();\n }", "public static boolean writeToJson(Quote[] quotes, String filename) throws IOException {\n Gson write = new Gson();\n OutputStream outStream = new FileOutputStream(filename);\n BufferedWriter buffer = new BufferedWriter(new OutputStreamWriter(outStream));\n write.toJson(quotes, buffer);\n buffer.close();\n return true;\n }", "public static void writeJSONToFile(File file, JSONObject jsonObject) throws IOException {\n writeToFile(file, JSONObject.toJSONString(jsonObject));\n }", "public static void saveSettings() {\n\n Writer output = null;\n try {\n output = new BufferedWriter(new FileWriter(getConfigFile()));\n final Set<String> set = m_Settings.keySet();\n final Iterator<String> iter = set.iterator();\n while (iter.hasNext()) {\n final String sKey = iter.next();\n final String sValue = m_Settings.get(sKey);\n output.write(sKey + \"=\" + sValue + \"\\n\");\n }\n }\n catch (final IOException e) {\n Sextante.addErrorToLog(e);\n }\n finally {\n if (output != null) {\n try {\n output.close();\n }\n catch (final IOException e) {\n Sextante.addErrorToLog(e);\n }\n }\n }\n\n }", "private void saveSettings() {\n SettingsModel settingsModel = new SettingsModel();\n settingsModel.saveState(NJNPStartActivity.this);\n\n File NJNPSettingsDirectory = new File(NJNPConstants.DIRECTORY_PATH + NJNPConstants.SETTINGS_FOLDER);\n NJNPSettingsDirectory.mkdirs();\n\n File file = new File(NJNPSettingsDirectory.getPath(), NJNPConstants.SETTINGS_FILE_NAME);\n\n FileOutputStream fos = null;\n ObjectOutputStream os = null;\n try {\n fos = new FileOutputStream(file);\n os = new ObjectOutputStream(fos);\n os.writeObject(settingsModel);\n os.close();\n fos.close();\n } catch (FileNotFoundException e) {\n Log.e(NJNP_ACTIVITY_TAG, \"File not found exception when saving settings: \" + e.getMessage());\n } catch (IOException e) {\n Log.e(NJNP_ACTIVITY_TAG, \"IO Exception when saving settings: \" + e.getMessage());\n }\n\n }", "@Override\n public boolean save(String file) {\n /*\n Create a builder for the specific JSON format\n */\n GsonBuilder gsonBuilder = new GsonBuilder();\n gsonBuilder.setPrettyPrinting();\n JsonSerializer<DWGraph_DS> serializer = new JsonSerializer<DWGraph_DS>() {\n @Override\n public JsonElement serialize(DWGraph_DS dwGraph_ds, Type type, JsonSerializationContext jsonSerializationContext) {\n JsonObject jsonGraph = new JsonObject();\n jsonGraph.add(\"Nodes\", new JsonArray());\n jsonGraph.add(\"Edges\", new JsonArray());\n\n for (node_data node : G.getV()) {\n JsonObject jsonNodeObject = new JsonObject();\n\n StringBuilder pos = new StringBuilder();\n pos.append(node.getLocation().x());\n pos.append(',');\n pos.append(node.getLocation().y());\n pos.append(',');\n pos.append(node.getLocation().z());\n jsonNodeObject.addProperty(\"pos\", pos.toString());\n jsonNodeObject.addProperty(\"id\", node.getKey());\n jsonNodeObject.addProperty(\"info\", node.getInfo());\n jsonNodeObject.addProperty(\"tag\", node.getTag());\n jsonGraph.get(\"Nodes\").getAsJsonArray().add(jsonNodeObject);\n for (edge_data e : G.getE(node.getKey())) {\n JsonObject jsonEdgeObject = new JsonObject();\n jsonEdgeObject.addProperty(\"src\", e.getSrc());\n jsonEdgeObject.addProperty(\"w\", e.getWeight());\n jsonEdgeObject.addProperty(\"dest\", e.getDest());\n jsonEdgeObject.addProperty(\"info\", e.getInfo());\n jsonEdgeObject.addProperty(\"tag\", e.getTag());\n jsonGraph.get(\"Edges\").getAsJsonArray().add(jsonEdgeObject);\n }\n }\n return jsonGraph;\n }\n };\n gsonBuilder.registerTypeAdapter(DWGraph_DS.class, serializer);\n Gson graphGson = gsonBuilder.create();\n try {\n PrintWriter writer = new PrintWriter(new FileWriter(file));\n writer.write(graphGson.toJson(G));\n writer.flush();\n writer.close();\n return true;\n } catch (IOException e) {\n e.printStackTrace();\n return false;\n }\n }", "public static void saveObjToFile(Object obj, String filePath) throws IOException {\n // create the enclosing folders if it doesn't exist\n createDir(filePath);\n\n FileOutputStream file = new FileOutputStream(filePath);\n ObjectOutputStream out = new ObjectOutputStream(file);\n out.writeObject(obj);\n out.close();\n }", "@Test\n public void testToJSONString() {\n System.out.println(\"toJSONString\");\n Setting s = Setting.factory();\n s.setStype(Setting.SETTING_TYPE.TPATH);\n s.setName(\"mytest\");\n String userFile = System.getProperty(\"user.dir\");\n\n s.setValue(Paths.get(userFile));\n String jResult = s.toJSONString();\n String jExpected = \"{\\\"stype\\\":\\\"TPATH\\\",\\\"name\\\":\\\"mytest\\\",\\\"value\\\":\\\"J:\\\\\\\\Java\\\\\\\\DBCUtilLib\\\"}\";\n assertEquals(jExpected, jResult);\n\n s.setValue(Setting.SETTING_TYPE.TPATH, Paths.get(userFile));\n jResult = s.toJSONString();\n assertEquals(jExpected, jResult);\n\n }", "public static void saveJSON(List<JSONObject> objects, String outputFile) {\n try (FileWriter file = new FileWriter(outputFile)) {\n for (JSONObject obj: objects)\n file.write(obj.toString() + '\\n');\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@POST\n @Path(\"/config/save\")\n public Response configSave(@Context HttpServletRequest request,@Context HttpServletResponse response,@Context ServletContext servletContext) throws JsonGenerationException, JsonMappingException, IOException{\n log.info(\"Saving config\");\n Config newConfig=Json.newObjectMapper(true).readValue(request.getInputStream(), Config.class);\n \n log.debug(\"New Config = \"+Json.newObjectMapper(true).writeValueAsString(newConfig));\n newConfig.save();\n \n // re-start the heartbeat with a new interval\n //TODO: reset the heartbeat ONLY if the interval changed from what it was before\n// String startTime=(String)Config.get().getOptions().get(\"heartbeat.startTime\");\n// if (null==startTime) startTime=\"21:00\"; // default to 9PM\n// String heartbeatInterval=newConfig.getOptions().get(\"heartbeat.intervalInSeconds\");\n// if (null!=heartbeatInterval && heartbeatInterval.matches(\"\\\\d+\")){\n// log.info(\"Re-setting heartbeat with interval: \"+heartbeatInterval);\n Heartbeat2.stop();\n Heartbeat2.start(Config.get());\n// Heartbeat2.start(Long.parseLong(heartbeatInterval));\n// Heartbeat2.start(Config.get());\n// }\n \n String maxEvents=newConfig.getOptions().get(\"events.max\");\n if (null!=maxEvents && maxEvents.matches(\"\\\\d+\")){\n Database2.MAX_EVENT_ENTRIES=Integer.parseInt(maxEvents);\n }\n \n Database2.resetInstance();\n Database2.get(); //reload it\n \n log.debug(\"Config Saved\");\n return Response.status(200).entity(Json.newObjectMapper(true).writeValueAsString(Config.get())).build();\n }", "@Override\n public boolean save(String file) {\n boolean ans = false;\n ObjectOutputStream oos;\n try {\n FileOutputStream fileOut = new FileOutputStream(file, true);\n oos = new ObjectOutputStream(fileOut);\n oos.writeObject(this);\n ans= true;\n }\n catch (FileNotFoundException e) {\n e.printStackTrace(); }\n catch (IOException e) {e.printStackTrace();}\n return ans;\n }", "private void saveJSON(String myList, String saveFile, ArrayList<JSONObject> arr) {\n SharedPreferences sharedPreferences = getSharedPreferences(saveFile, MODE_PRIVATE);\n SharedPreferences.Editor prefEditor = sharedPreferences.edit();\n Gson gson = new Gson();\n String typeList = gson.toJson(arr);\n prefEditor.putString( myList, typeList );\n System.out.println(\"saveJSON myList = \" + myList);\n prefEditor.apply();\n }", "public static void savePlayerConfig(String name, FileConfiguration config) {\r\n if (!name.endsWith(\".yml\")) {\r\n \tname += \".yml\";\r\n }\r\n File file = new File(plugin.getDataFolder() + File.separator + \"players\", name);\r\n try {\r\n config.save(file);\r\n } catch (IOException e) {\r\n \tFPSCaste.log(\"Could not save: \" + name + \", is the disk full?\", Level.WARNING);\r\n }\r\n\t\t}", "private void exportConfiguration() {\n if (!Files.exists(languageConfigPath)) this.saveResource(\"language.yml\", false);\n if (!Files.exists(propertiesConfigPath)) this.saveResource(\"properties.yml\", false);\n }", "private static void saveSettings() {\n try {\n File settings = new File(\"settings.txt\");\n FileWriter writer = new FileWriter(settings);\n //Options\n writer.append(defaultSliderPosition + \"\\n\");\n writer.append(isVerticalSplitterPane + \"\\n\");\n writer.append(verboseCompiling + \"\\n\");\n writer.append(warningsEnabled + \"\\n\");\n writer.append(clearOnMethod + \"\\n\");\n writer.append(compileOptions + \"\\n\");\n writer.append(runOptions + \"\\n\");\n //Colors\n for(int i = 0; i < colorScheme.length; i++) \n writer.append(colorScheme[i].getRGB() + \"\\n\");\n writer.append(theme + \"\\n\");\n\n writer.close(); \n } catch (IOException i) {\n println(\"IO exception when saving settings.\", progErr);\n }\n }", "private void save(WorkPanel panel, File file) {\n\t\tManagement.getScheduler().execute(() -> {\n\t\t\ttry {\n\t\t\t\tConfigSystem.saveFile(panel, file);\n\t\t\t} catch (Exception ex) {\n\t\t\t\tWindowManager.getDialogs().showError(\"Fehler beim Schreiben\", ex);\n\t\t\t}\n\t\t});\n\t}", "void config(final JsonObject config);", "public static void saveMapConfig(String name, FileConfiguration config) {\r\n if (!name.endsWith(\".yml\")) {\r\n \tname += \".yml\";\r\n }\r\n \r\n File file = new File(plugin.getDataFolder() + File.separator + \"maps\", name);\r\n try {\r\n config.save(file);\r\n } catch (IOException e) {\r\n \tFPSCaste.log(\"Could not save map: \" + name + \", is the disk full?\", Level.WARNING);\r\n }\r\n\t\t}", "public void commit() {\n\t\tif (commit) {\n\t\t\t// Récupérer le path du JSON\n\t\t\tSystem.out.println(ClassLoader.getSystemResource(jsonFile));\n\t\t\tURL url = ClassLoader.getSystemResource(jsonFile);\n\t\t\t// On ouvre un flux d'écriture vers le fichier JSON\n\t\t\ttry (OutputStream ops = new FileOutputStream(Paths.get(url.toURI()).toFile())) {\n\t\t\t\t// Ecriture du fichier JSON avec formatage\n\t\t\t\t// (WithDefaultPrettyPrinter)\n\t\t\t\tobjectMapper.writerWithDefaultPrettyPrinter().writeValue(ops, database);\n\t\t\t\tlogger.info(\"OK - fichier JSON mis à jour \" + jsonFile);\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tlogger.info(\"KO - FILE_NOT_FOUND\" + jsonFile);\n\t\t\t\tthrow new DataRepositoryException(\"KO - FILE_NOT_FOUND\", e);\n\t\t\t} catch (IOException e) {\n\t\t\t\tlogger.info(\"KO - I/O ERROR\" + jsonFile);\n\t\t\t\tthrow new DataRepositoryException(\"KO - I/O ERROR\", e);\n\t\t\t} catch (URISyntaxException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "private static boolean saveMOTD(JSONObject motdObj) {\n File JSONFile = new File(plugin.getDataFolder() + \"/motd.json\");\n\n try ( //open our writer and write the player file\n PrintWriter writer = new PrintWriter(JSONFile)) {\n //System.out.println(obj);\n writer.print(motdObj.toString(4));\n writer.close();\n Logger.getLogger(MOTDHandler.class.getName()).log(Level.INFO, \"Successfully updated motd.json\");\n return true;\n } catch (FileNotFoundException ex) {\n\n Logger.getLogger(MOTDHandler.class.getName()).log(Level.SEVERE, null, ex);\n return false;\n }\n }", "public void exportJSON()\n {\n Gson JSONConverter = new Gson();\n FileWriter writer;\n\n try\n {\n // wipe the file\n PrintWriter write = new PrintWriter(new File(fp));\n write.print(\"\");\n write.close();\n\n // Initialize FileWriter to write Strings into JSON file.\n writer = new FileWriter(fp + \"/queue.json\");\n\n Iterator<ComparableCalendar> iter = this.queue.iterator();\n // Loop through the PQ.\n while(iter.hasNext())\n {\n ComparableCalendar nextObject = iter.next();\n // Convert an issue object into a JSON-formatted representation of it, as a String.\n String representationJSON = JSONConverter.toJson(nextObject);\n\n // Write that String to the file.\n writer.write(representationJSON + \"\\n\");\n }\n // Close the FileWriter to conserve system resources.\n writer.close();\n\n }\n catch (Exception e)\n {\n // Print any error messages that results to the console.\n e.printStackTrace();\n }\n\n }", "void save(File file);", "private void saveProperties()\n {\n PSConfigUtils.saveObjectToFile(m_props, getPropertiesFile());\n }", "public void save(String filePath){\r\n Scanner in = new Scanner(System.in);\r\n File saveFile = new File(filePath);\r\n if (saveFile.exists()){\r\n System.out.println(\"Do you really, really want to overwrite your previous game?\");\r\n System.out.println(\"Yes: '1', No: '0'.\");\r\n int input = in.nextInt();\r\n if (input!=1){\r\n return;\r\n }\r\n }\r\n File saveDir = new File(this.savePath);\r\n if (!saveDir.exists()){\r\n saveDir.mkdir();\r\n }\r\n FileOutputStream fos = null;\r\n ObjectOutputStream out = null;\r\n try {\r\n fos = new FileOutputStream(saveFile);\r\n out = new ObjectOutputStream(fos);\r\n out.writeObject(this.serialVersionUID);\r\n out.writeObject(p);\r\n out.writeObject(map);\r\n out.close();\r\n } catch (Exception ex) {\r\n System.out.println(\"Make sure you don't use spaces in your folder names.\");\r\n ex.printStackTrace();\r\n }\r\n }", "@Override\n\tpublic boolean save(String file) {\n\t\n\t\tGson gson = new GsonBuilder().create();\n\t\tJsonArray arrEdges = new JsonArray();\n\t\tJsonArray arrNodes = new JsonArray();\n\t\tCollection<node_data> arrV = this.dwg.getV();\n\t\tfor(node_data vertex : arrV) {\n\t\t\tJsonObject nodesObj = new JsonObject();\n\t\t\tgeo_location gl = vertex.getLocation();\n\t\t\tnodesObj.addProperty(\"pos\",String.valueOf(gl.x())+\",\"+String.valueOf(gl.y())+\",\"+String.valueOf(gl.z()));\n\t\t\tnodesObj.addProperty(\"id\",vertex.getKey());\n\t\t\tarrNodes.add(nodesObj);\n\t\t\tCollection<edge_data> arrE = this.dwg.getE(vertex.getKey());\n\t\t\tfor(edge_data edge : arrE) {\n\t\t\t\tJsonObject edgesObj = new JsonObject();\n\t\t\t\tedgesObj.addProperty(\"src\",edge.getSrc());\n\t\t\t\tedgesObj.addProperty(\"w\",edge.getWeight());\n\t\t\t\tedgesObj.addProperty(\"dest\",edge.getDest());\n\t\t\t\tarrEdges.add(edgesObj);\n\t\t\t}\n\t\t}\n\t\tJsonObject graphObj = new JsonObject();\n\t\tgraphObj.add(\"Edges\",arrEdges);\n\t\tgraphObj.add(\"Nodes\",arrNodes);\n\t\tString ans = gson.toJson(graphObj);\n\n\t\ttry{\n\t\t\tPrintWriter pw = new PrintWriter(new File(file));\n\t\t\tpw.write(ans);\n\t\t\tpw.close();\n\t\t}\n\t\tcatch (FileNotFoundException e){\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}" ]
[ "0.7676084", "0.7147372", "0.6953834", "0.68290913", "0.6592396", "0.65648115", "0.6522556", "0.64761084", "0.6447715", "0.64374214", "0.6403147", "0.63787997", "0.63712573", "0.6361357", "0.63358575", "0.6330719", "0.62724817", "0.626979", "0.6225841", "0.62009794", "0.60815996", "0.60455775", "0.60306275", "0.59496206", "0.59457976", "0.59395957", "0.593161", "0.5931502", "0.5927233", "0.5927155", "0.5850929", "0.5845107", "0.5824172", "0.5820958", "0.58071566", "0.57920444", "0.57916826", "0.57857424", "0.57727754", "0.57688326", "0.57608926", "0.5755423", "0.5749851", "0.57462645", "0.5745923", "0.5738827", "0.5736693", "0.57293165", "0.5707429", "0.56838906", "0.5679427", "0.5676198", "0.56721956", "0.5657403", "0.5653983", "0.56445533", "0.5641866", "0.5628305", "0.56066185", "0.5606322", "0.56002516", "0.55829906", "0.55809814", "0.5561149", "0.5557829", "0.5543862", "0.55362266", "0.55229557", "0.5520772", "0.5511334", "0.55087984", "0.5508214", "0.5507126", "0.5506167", "0.5503974", "0.5500129", "0.54969585", "0.54881114", "0.5488096", "0.5477914", "0.5468639", "0.5444744", "0.54419976", "0.5434954", "0.54298973", "0.5426157", "0.54216534", "0.54091847", "0.54018503", "0.5399656", "0.53953356", "0.5366264", "0.5362951", "0.5347579", "0.53396493", "0.53308004", "0.5330734", "0.53289616", "0.5318063", "0.53178716" ]
0.85376084
0
Create a new MoneyCommand which is used to display a user's balance.
public MoneyCommand() { super("money", "Displays the player's money", "/money", Arrays.asList("bal", "m")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Command createCommand();", "abstract Valuable createMoney(double value);", "public void gameUI(String username, BigDecimal balance){\n\n System.out.println(ANSI_RESET + username + \", balance: \" + ANSI_YELLOW + balance + \"\\n\" +\n ANSI_PURPLE + \"Command:\");\n }", "UserAccount createUserAccount(User user, double amount);", "private Command createUserCommand(Command command) {\n int count = command.getParameters().get(0).getParameters().size();\n var param = new ListBody();\n while(count > 0) {\n param.addParameter(getCommandTree());\n count--;\n }\n command.addParameter(param);\n return command;\n }", "public BankAccount(int balance) {\n\n this.balance = balance;\n\n }", "IDbCommand createCommand();", "public Deposit(int userAccountNumber, Screen atmScreen, BankDataBase bankDatabase, UserInterface UI, DepositSlot atmDepositSlot)\n {\n super( userAccountNumber, atmScreen, bankDatabase);\n face = UI;\n depositSlot = atmDepositSlot;\n }", "public Payment(User to, User from, double cashAmount, String paymentName) {\n this.cashAmount = cashAmount;\n this.to = to;\n this.from = from;\n this.paymentName = paymentName;\n paymentID = rand.nextInt(max - min + 1) + min;\n }", "public Account() {\n\t\t//starting amount is 1500\n\t\tmoney = 1500;\n\t}", "private View createBalance() {\r\n\t\tTextView balance = new TextView(getContext());\r\n\t\tLayoutParams blp = new LayoutParams(android.view.ViewGroup.LayoutParams.WRAP_CONTENT,\r\n\t\t\t\tandroid.view.ViewGroup.LayoutParams.WRAP_CONTENT, 1);\r\n\t\tbalance.setGravity(Gravity.RIGHT);\r\n\t\tbalance.setLayoutParams(blp);\r\n\t\tbalance.setText(\"\" + account.getBalance());\r\n\t\tbalance.setTextSize(16);\r\n\t\tbalance.setTypeface(Typeface.DEFAULT_BOLD);\r\n\t\tif (account.getBalance() < 0) {\r\n\t\t\tbalance.setTextColor(getContext().getResources().getColor(R.color.negative));\r\n\t\t} else {\r\n\t\t\tbalance.setTextColor(getContext().getResources().getColor(R.color.positive));\r\n\t\t}\r\n\t\treturn balance;\r\n\t}", "Command createCommandWith(CommandCreator creator);", "public BankAccount() {\n\t\tthis.money = 0;\n\t}", "public MoneyTransfer() {\n }", "public depositMoneyInBank() {\n\n commands = new Command[2];\n Command noCommand = new NoCommand();\n for (int i = 0; i < 2; i++) {\n commands[i] = noCommand;\n }\n\n storage = new Stack<Command>();\n }", "public Command(User owner, String value) {\n this(owner, \"Untitled\", \"None\", LocalDate.now(), false, value);\n }", "@Override\n\tpublic Valuable createMoney(double value) {\n\t\tValuable thaiMoney = null;\n\t\tif ( isCoin(value) ) {\n\t\t\tthaiMoney = new Coin(value);\n\t\t} else if ( isBankNote(value) ) {\n\t\t\tthaiMoney = new BankNote(value, nextSerialNumber++);\n\t\t} else {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\treturn thaiMoney;\n\t}", "public static ATMAccount createAccount() {\r\n\t\tString userName;\r\n\t\tdouble userBalance;\r\n\t\tint digit = -1;\r\n\r\n\t\tSystem.out.println(\"Please enter a name for the account: \");\r\n\t\tuserInput.nextLine();\r\n\t\tuserName = userInput.nextLine();\r\n\r\n\t\t//Requests digits 1 by 1 for the pin number\r\n\t\tString accPin = \"\";\r\n\t\tfor (int i = 1; i < 5; i++) {\r\n\t\t\tdigit = -1;\r\n\t\t\tSystem.out.println(\"Please enter digit #\" + i + \" of\" + \"your pin.\");\r\n\t\t\tdo {\r\n\t\t\t\tdigit = userInput.nextInt();\r\n\t\t\t} while (digit < 0 || digit > 9);\r\n\t\t\taccPin += digit;\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Please put the amount of money you would like to \" + \"initially deposit into the account: \");\r\n\t\tuserBalance = userInput.nextDouble();\r\n\t\tRandom accountIDGenerator = new Random();\r\n\t\tint userID = accountIDGenerator.nextInt(2147483647);\r\n\t\tATMAccount account = new ATMAccount(userID, userName, Integer.parseInt(accPin), userBalance);\r\n\t\tSystem.out.println(\"Acount Information: \\n\"+account.toString());\r\n\t\treturn account;\r\n\t}", "Valuable createMoney(String value) {\n\t\ttry {\n\t\t\tDouble.parseDouble(value);\n\t\t} catch (NumberFormatException e) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\treturn createMoney(Double.parseDouble(value));\n\t}", "public void addBalance() {\r\n List<String> choices = new ArrayList<>();\r\n choices.add(\"10\");\r\n choices.add(\"20\");\r\n choices.add(\"50\");\r\n ChoiceDialog<String> addBalanceDialog = new ChoiceDialog<>(\"10\", choices);\r\n addBalanceDialog.setTitle(\"Add Balance\");\r\n addBalanceDialog.setContentText(\"Please enter the balance you want to add\");\r\n Optional<String> result = addBalanceDialog.showAndWait();\r\n result.ifPresent(\r\n s -> cardSelected.addMoney(Double.parseDouble(addBalanceDialog.getSelectedItem())));\r\n }", "public Deposit(int userAccountNumber, Screen atmScreen, BankDatabase atmBankDatabase,\n Keypad atmKeypad, DepositSlot atmDepositSlot) {\n // initialize superclass variables\n super(userAccountNumber, atmScreen, atmBankDatabase);\n // initialize references to keypad and deposit slot\n keypad = atmKeypad;\n depositSlot = atmDepositSlot;\n }", "public Wallet() {\n total_bal = 10;\n }", "public GetPriceCmd() {\n\n\t}", "public BankAccount(double basicMoney) {\n\t\tthis.money = basicMoney;\n\t}", "private Command createDrawCommand(String command) {\n\t\tString[] tokens = command.split(\" \");\n\t\treturn new DrawCommand(Double.parseDouble(tokens[1]));\n\t}", "public BankAccount(String holderName, String number, float balance){\r\n\t\tthis.holderName = holderName;\r\n\t\tthis.number = number;\r\n\t\tthis.balance = balance;\r\n\t}", "public Debit_Money() {\n initComponents();\n }", "public CreateUserCommand() {\n userReceiver = new UserReceiver();\n roleReceiver = new RoleReceiver();\n next = new GetRolesCommand();\n result = new CommandResult();\n }", "public Player(int balance){\n this.hand = new Hand();\n this.balance = balance;\n this.scoreboard = new Scoreboard(balance);\n }", "public Account(Holder holder, int balance) {\n this.holder = holder;\n this.balance = balance;\n }", "public void createAccount(double balance) {\r\n\t\tAccount account = new Account(balance);\r\n\t\tsetPlayerAccount(account);\r\n\t}", "@Override\r\n\tpublic Money calculateFee(TransferCommand command) {\r\n\t\treturn new Money(\"SGD\", 1d);\r\n\t}", "Command createCommand() throws ServiceException, AuthException;", "public Account(String name, double balance){\n\n this.name = name;\n\n if (balance > 0.0 )\n this.balance = balance;\n }", "private Transaction setUpTransaction(double amount, Transaction.Operation operation, String username){\n Transaction transaction = new Transaction();\n transaction.setDate(Date.valueOf(LocalDate.now()));\n transaction.setAmount(amount);\n transaction.setOperation(operation);\n transaction.setUserId(userRepository.getByUsername(username).getId());\n return transaction;\n }", "Account(int account_number,double balance) //pramiterized constrector\n {\n this.account_number=account_number;\n this.balance=balance;\n }", "public BankAccount(int accountNum, String customerName, double balance){\n this.accountNum = accountNum;\n this. customerName = customerName;\n this.balance = balance;\n }", "public CardBalance(Integer dollar, Integer cent) {\n this.dollar = dollar;\n this.cent = cent;\n }", "public Money(BigDecimal amount) {\n this(amount, null);\n }", "public Player(double money)\n {\n spendingMoney = money;\n }", "public Balance(final BigDecimal value) {\r\n this.value = value;\r\n }", "public Account(double balance) {\n\t\tthis.balance = balance;\n\t}", "Commands createCommands();", "public void createAccount() {\n\t\tSystem.out.print(\"Enter Name: \");\n\t\tString name = nameCheck(sc.next());\n\t\tSystem.out.print(\"Enter Mobile No.: \");\n\t\tlong mobNo = mobCheck(sc.nextLong());\n\t\tlong accNo = mobNo - 1234;\n\t\tSystem.out.print(\"Enter Balance: \"); \n\t\tfloat balance = amountCheck(sc.nextFloat());\n\t\tuserBean BeanObjCreateAccountObj = new userBean(accNo, name, mobNo, balance);\n\t\tSystem.out.println(\"Account created with Account Number: \" +accNo);\n\t\tServiceObj.bankAccountCreate(BeanObjCreateAccountObj);\n\t\t\n\t\n\t}", "public Account(int id, double balance) {\n this();\n this.name = \"Account\";\n this.id = id;\n this.balance = balance;\n }", "public Command create(Object... param);", "public BankAccount() {\n this(12346, 5.00, \"Default Name\", \"Default Address\", \"default phone\");\n }", "public BankAccount(String holderName, String number){\r\n\t\tthis.holderName = holderName;\r\n\t\tthis.number = number;\r\n\t\tthis.balance = 0;\r\n\t}", "private View createCurrency() {\r\n\t\tTextView t = new TextView(getContext());\r\n\t\tLayoutParams blp = new LayoutParams(android.view.ViewGroup.LayoutParams.WRAP_CONTENT,\r\n\t\t\t\tandroid.view.ViewGroup.LayoutParams.WRAP_CONTENT);\r\n\t\tblp.leftMargin = 5;\r\n\t\tt.setLayoutParams(blp);\r\n\r\n\t\tif (account.getCurrency().length() > 3) {\r\n\t\t\tt.setText(account.getCurrency().substring(3));\r\n\t\t} else {\r\n\t\t\tt.setText(account.getCurrency());\r\n\t\t}\r\n\t\tt.setTextSize(16);\r\n\t\tTypeface font = CurrencyUtil.currencyFace;\r\n\t\tt.setTypeface(font);\r\n\t\tif (account.getBalance() < 0) {\r\n\t\t\tt.setTextColor(getContext().getResources().getColor(R.color.negative));\r\n\t\t} else {\r\n\t\t\tt.setTextColor(getContext().getResources().getColor(R.color.positive));\r\n\t\t}\r\n\t\treturn t;\r\n\t}", "public TodoCommand(String userInputCommand) {\n this.userInputCommand = userInputCommand;\n }", "public BankAccount() {\t\n\t\tthis.accountNumber = UUID.randomUUID().toString().substring(0, 6);\n\t\tthis.balance = 0;\n\t\tthis.accountType = \"Bank account\";\n\t}", "public Account()\n {\n // initialise instance variables\n balance = 0.00;\n remainder = 0;\n }", "public void balanceMenu(){\n\t\tstate = ATM_State.BALANCE;\n\t\tdouble balance = Bank.getBalance(accountID); \n\t\tgui.setDisplay(\"Current balance: \\n$\" + balance);\t\n\t}", "public Money getTotalBalance();", "Payment(float bill, float balance, boolean premiumSubscription) {\n this.bill = bill;\n this.balance = balance;\n this.premiumSubscription = premiumSubscription;\n amount = balance;\n }", "public Command() {\n }", "public static NumberAmount create(){\n NumberAmount NA = new NumberAmount(new AdvancedOperations(Digit.Zero()));\n return NA;\n }", "public User(int id, String name, int cash) {\n DoubleProperty[] doubles = new DoubleProperty[4];\n Arrays.fill(doubles,new SimpleDoubleProperty(0));\n skills = Arrays.asList(doubles);\n \n DoubleProperty[] doubles2 = new DoubleProperty[4];\n Arrays.fill(doubles2,new SimpleDoubleProperty(1));\n potions = Arrays.asList(doubles2);\n \n this.id = id;\n this.name = name;\n this.cash.setValue(String.valueOf(cash));\n }", "Account(int balance) {\n if(balance <0) this.balance=0;\n this.balance = balance;\n }", "private JPanel withdrawMoney() {\n JPanel withdraw = new JPanel();\n currentMoneyLabel = new JLabel(String.format(\"<html>Current Available Money in Machine:<b>$%.2f</html>\", moneyInMachine));\n withdraw.add(currentMoneyLabel);\n withdraw.add(Box.createHorizontalStrut(15));\n JButton withdrawButton = new JButton(\"withdraw funds\");\n withdrawButton.addActionListener(new withdrawMoneyListen());\n withdraw.add(withdrawButton);\n return withdraw;\n }", "public Account(final String username, final String type, final double balance) {\n this.type = type;\n this.username = username;\n this.balance = balance;\n }", "Account create();", "@Override\n\tpublic Valuable createMoney(double value) {\n\t\tboolean check = false;\n\t\tfor(double d: MONEY){\n\t\t\tif(d == value) check = true;\n\t\t}\n\t\tif(!check) throw new IllegalArgumentException(String.format(\"No %.2f %s money\", value, MARLAY_CURR));\n\t\tif(value > 1) return new BankNote(value, MARLAY_CURR, nextSerialNumber++);\n\t\treturn new Coin(value, MARLAY_CURR);\n\t}", "public static void bankChargesDemo() {\n BankCharges charge0 = new BankCharges();\n\n // Initialize the checksUsed field\n charge0.assignChecksUsed();\n\n // Initialize the accountBalance field\n charge0.setAccountBalance(399.00);\n\n // Display the bank statement\n System.out.println(charge0.statement());\n }", "public BankAccount() {\r\n\t\tbalance=0;\r\n\t\t\r\n\t}", "protected String commandRequestBalanceAdd(Integer connectionId, String amount) {\n Long amountAslong = Long.decode(amount);\n UserMovieRental user = (UserMovieRental)mapOfLoggedInUsersByConnectedIds.get(connectionId);\n long newBalance = user.addBalance(amountAslong);\n user.setBalance(newBalance);\n updateUserJson();\n updateServiceJson();\n return \"ACK balance \" + newBalance + \" added \" + amount;\n }", "public Command(User owner, String name, String group, LocalDate dateModified, boolean shared, String value) {\n this.name = name;\n this.group = group;\n this.dateModified = dateModified;\n this.value = value;\n this.shared = shared;\n this.owner = owner;\n }", "public Balance() {\r\n value = BigDecimal.ZERO;\r\n }", "public BankAccount(double initialBalance) {\r\n\t\tbalance=initialBalance;\r\n\t}", "public Bank(double cash, double interest)\r\n {\r\n super(cash);\r\n this.interest = interest;\r\n }", "public InsuffificentBalance(String message){\n super(message);\n }", "public BankAccount(int accountNum, String customerName){\n this.accountNum = accountNum;\n this.customerName = customerName;\n balance = 0;\n }", "public Command(int Player) {\r\n\t\tmyPlayer = Player;\r\n\t}", "@Post(uri = \"/{accountId}/deposits\", consumes = MediaType.APPLICATION_JSON)\n @Operation(summary = \"Creates deposit\")\n void create(@Parameter(description = \"Account ID\") BigInteger accountId,\n @Parameter(description = \"Deposit model\") BalanceChangeRequest balanceChangeRequest);", "public Account(int id, String name, double balance){\n this(id, balance);\n this.name = name;\n }", "private Command createCommand(String command) {\n\t\tString[] tokens = command.split(\" \");\n\t\tswitch(tokens[0].toLowerCase()) {\n\t\tcase DRAW:\n\t\t\treturn createDrawCommand(command);\n\t\t\n\t\tcase SKIP:\n\t\t\treturn createSkipCommmand(command);\n\t\t\t\n\t\tcase SCALE:\n\t\t\treturn createScaleCommand(command);\n\t\t\t\n\t\tcase ROTATE:\n\t\t\treturn createRotateCommand(command);\n\t\t\t\n\t\tcase PUSH:\n\t\t\treturn createPushCommand();\n\t\t\t\n\t\tcase POP:\n\t\t\treturn createPopCommand();\n\t\t\t\n\t\tcase COLOR:\n\t\t\treturn createColorCommand(command);\n\t\t\t\n\t\tdefault:\n\t\t\tthrow new IllegalArgumentException(\"Invalid command argument\");\n\t\t}\n\t}", "protected Account(String n, float b) {\n this(n); \n balance = b;\n }", "Bank(String name, double currentAmount) {\n this.accountName = name;\n this.currentAmount = currentAmount;\n }", "public void DepositMoneyInBank() {\n\n for (int i = 0; i < commands.length; i++) {\n commands[i].execute();\n storage.push(commands[i]);\n }\n }", "public static void main(String[] args) {\n Account firstAccount = new Account(\"first Account\",100.00);\n \n \n System.out.println(\"Initial State\");\n System.out.println(firstAccount);\n \n \n firstAccount.deposit(20);\n System.out.println(\"the balance of first Account is : \" + firstAccount.toString());\n \n \n }", "public SavingsAccount(double balance)\n {\n startingBalance = balance;\n }", "public double selectCurrentBalance(int choice, String getUser);", "public void userCreated(UserCreateCommand command) {\n\t\t}", "private Command createColorCommand(String command) {\n\t\tString[] tokens = command.split(\" \");\n\t\tColor color = new Color(Integer.decode(\"#\" + tokens[1]));\n\t\treturn new ColorCommand(color);\n\t}", "static TradeAllowanceCharge create(boolean chargeIndicator, Amount amount, Amount baseAmount, BigDecimal percentage) {\r\n\t\treturn new TradeAllowanceCharge(chargeIndicator, amount, baseAmount, percentage);\r\n\t}", "public Command(EpicBoss boss)\r\n\t{\r\n\t\teb = boss;\r\n\t}", "public Command createInstance() {\n\t\t\n\t\tif(name == \"Direction\")\n\t\t\treturn new Direction();\n\t\t\n\t\tif(name == \"Gear\")\n\t\t\treturn new Gear();\n\t\t\n\t\tif(name == \"Pause\")\n\t\t\treturn new Pause();\n\t\t\n\t\treturn null;\n\t\t\n\t}", "Account(String name, double balance)\r\n\t{\r\n\t\t\r\n\t\tthis.name = name; //assign name to the instance variable name \r\n\t\t\r\n\t\t// validate that the balance is greater that 0.0; if it is not,\r\n\t\t// instance variable balance keeps its default value 0.0\r\n\t\tif(balance > 0.0) // if balance is valid\r\n\t\t\tthis.balance = balance; // assign balance to the instance variable balance\t\t\t\t\t\r\n\t}", "public Builder setMoney(double value) {\n \n money_ = value;\n onChanged();\n return this;\n }", "public MoneyTransfer(BigDecimal amount, Long sourceAccountId, Long targetAccountId) {\n this.amount = amount;\n this.sourceAccountId = sourceAccountId;\n this.targetAccountId = targetAccountId;\n }", "public void execute() {\n\t\t// get references to bank database and screen\n\t\tatmg.BankDatabase bankDatabase = getBankDatabase();\n\n\t\t// get the available balance for the account involved\n\t\tdouble availableBalance = bankDatabase.getAvailableBalance(getAccountNumber());\n\n\t\t// get the total balance for the account involved\n\t\tdouble totalBalance = bankDatabase.getTotalBalance(getAccountNumber());\n\n\t\t// display the balance information on the screen\n\t\tint input = JOptionPane.showOptionDialog(null,\n\t\t\t\t\"\\nBalance Information:\" + \"\\n\" + \" - Available balance: \" + availableBalance + \"\\n - Total balance:\"\n\t\t\t\t\t\t+ totalBalance + \"\\n\\n\",\n\t\t\t\tnull, JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null,\n\t\t\t\tnew String[] { \"OK\"}, \"default\");\n\t\tif (input == JOptionPane.OK_OPTION) {\n\t\t\t\n\n\t\t} else {\n\t\t\t//windowT.disable();\n\t\t}\n\n\t}", "public Account(int id, double balance) {\n this();\n this.id = id;\n this.balance = balance;\n }", "public Transaction(final double newBalance) { // but This shouldn't happen\n this(newBalance, 0, null);\n }", "public BankCustomerRole(String task, double moneyToDeposit, double moneyRequired, String name) {\n\t\tthis.task = task;\n\t\tthis.name = name;\n\t\tthis.moneyRequired = moneyRequired;\n\t\tthis.moneyToDeposit = moneyToDeposit;\n\t\tcustomerGui = new BankCustomerGui(this);\n\t}", "private Builder() {\n super(QueryBankBalanceMessage.SCHEMA$);\n }", "public Account(String currency) {\n //numAccount += 1;\n incrementNumAccount();\n this.accountID = numAccount;\n this.dateOfCreation = LocalDate.now();\n\n setPrimaryCurrency(currency);\n this.currencyBalance = Money.of(0, this.primaryCurrency);\n ownerID = new ArrayList<>();\n }", "public void setAmount(int moneyOption);", "void setManageTransactionBalance(String balance);", "private Command createScaleCommand(String command) {\n\t\tString[] tokens = command.split(\" \");\n\t\treturn new ScaleCommand(Double.parseDouble(tokens[1]));\n\t}", "public Command createCommand(String name, final Value handler) {\n return new Command(name) {\n public boolean execute(CommandSender sender, String commandLabel, String[] args) {\n return handler.execute(sender, commandLabel, args).asBoolean();\n }\n };\n }" ]
[ "0.5730454", "0.56525093", "0.5616938", "0.5603008", "0.55654204", "0.5495277", "0.5478692", "0.54314184", "0.53864527", "0.5373799", "0.53495324", "0.533951", "0.52961606", "0.52695113", "0.5265302", "0.52401584", "0.5204202", "0.5200816", "0.5194283", "0.51795185", "0.5173318", "0.51730907", "0.51611954", "0.51417065", "0.5110815", "0.5102226", "0.50988734", "0.50881195", "0.5049143", "0.5037268", "0.5030522", "0.5026499", "0.50229156", "0.50167865", "0.50075936", "0.49930263", "0.49867207", "0.49833435", "0.498028", "0.497833", "0.49755034", "0.4949266", "0.49270695", "0.49146697", "0.49088675", "0.48879084", "0.48831585", "0.48782772", "0.48750696", "0.48713434", "0.48695615", "0.48546624", "0.4850557", "0.48424652", "0.4842241", "0.48287544", "0.48191008", "0.48178595", "0.48159787", "0.4811408", "0.48037776", "0.47936946", "0.47912687", "0.47881633", "0.4770382", "0.4768059", "0.47632587", "0.47573528", "0.47561592", "0.47555447", "0.47496906", "0.47422045", "0.47396648", "0.47375464", "0.47361666", "0.4726456", "0.4725043", "0.47212493", "0.47137877", "0.4701208", "0.47010675", "0.46982682", "0.46957406", "0.46935716", "0.4693278", "0.46895638", "0.46830755", "0.46816435", "0.4679645", "0.46760485", "0.46705917", "0.4666732", "0.4660031", "0.46588138", "0.4655294", "0.46492496", "0.4647599", "0.4640082", "0.4638153", "0.46343955" ]
0.7761249
0
racers are displayed in reverse queue order
private void displayRacerList(ArrayList<Racer> raceList, int finishIndex, int startIndex) { for(int i = startIndex; i >= finishIndex; i--) { if(timestamp.equals("")) { if(raceList == finishList) { cTEH.display += raceList.get(i).getNumber() + " " + cTEH.timer.getRunDuration(raceList.get(i).getStartTime(), raceList.get(i).getFinishTime()); } else { cTEH.display += raceList.get(i).getNumber() + " " + cTEH.timer.getRunDuration(raceList.get(i).getStartTime(), cTEH.timer.getCurrentChronoTime()); } } else cTEH.display += raceList.get(i).getNumber() + " " + //for testing purposes cTEH.timer.getRunDuration(raceList.get(i).getStartTime(), timestamp); if(raceList == startList && i == 0) cTEH.display += " >\n"; else if(raceList == runningList) cTEH.display += " R\n"; else if (raceList == finishList) cTEH.display += " F\n"; else cTEH.display += "\n"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void reverse()\n\t{\n\t\tint a;\n\t\tif(isEmpty())\n\t\t\treturn;\n\t\telse\n\t\t{\t\n\t\t\ta = dequeue();\n\t\t\treverse(); \n\t\t\tenqueue(a);\n\t\t}\n\t}", "public void display() {\n\t\tSystem.out.println(\"Queue display\");\n\t\tint maxi = (front < rear) ? rear : (rear + MAX_QUEUE_SIZE);\n\t\tfor (int i = front + 1; i <= maxi; i++) {\n\t\t\tSystem.out.println(data[i]);\n\t\t}\n\t}", "@Override\r\n\tpublic void Display() {\n\t\t System.out.print(\"\\nQueue = \");\r\n\t if (len == 0)\r\n\t {\r\n\t System.out.print(\"Empty\\n\");\r\n\t return ;\r\n\t }\r\n\t for (int i = front; i <= rear; i++)\r\n\t System.out.print(queue[i]+\" \");\r\n\t System.out.println(); \r\n\t\t\r\n\t}", "void printqueue()\n\t{\n\t\tint i;\n\t\tif(!isEmpty())\n\t\t{\n\t\t\tfor(i=front;i<=rear;i++)\n\t\t\t\tSystem.out.print(queue[i]+\" \");\n\t\t\tSystem.out.println();\n\n\t\t}\n\t}", "private void re_queue() {\n\n Queue<String> queue = new LinkedList<>();\n queue.offer(\"我\");\n queue.offer(\"爱\");\n queue.offer(\"刷\");\n queue.offer(\"题\");\n queue.offer(\"呵呵\");\n\n System.out.println(\"*********queue*********\");\n System.out.println(queue);\n System.out.println(\"*********queue*********\");\n System.out.println(\"查看队首元素,不改变队列结构:\" + queue.peek());\n System.out.println(queue.size());\n System.out.println(\"*********queue*********\");\n System.out.println(\"取出队首元素,改变队列结构:\" + queue.poll());\n System.out.println(queue.size());\n System.out.println(\"*********queue*********\");\n while (queue.size() > 0) {\n System.out.println(queue.poll());\n System.out.println(queue);\n }\n }", "public void showRRQueue()\n {\n boolean goodTogo = true;\n SimProcess p;\n while(goodTogo)\n {\n //Retreive the element from the queue and display it with its arrival time and process number\n try\n {\n p = rrQueue.remove();\n System.out.println(\"Arrival Time: \" + p.getArrivalTime() + \" , Process#: \" + p.getProcessNumber());\n }\n catch(NoSuchElementException e)\n {\n goodTogo = false;\n }\n }\n }", "public void revPrintList(){\n\t\tCollections.reverse(listStr); //reverse ArrayList\n\t\t//cast the array list to a linked list\n\t\tLinkedList<Object> linkedString = new LinkedList<Object>(listStr);\n\t\t//while there is something in the LinkedList, run following code\n\t\twhile (linkedString.size() > 0) {\n\t\t\t//print out the current first in \"queue\" word\n\t\t\tSystem.out.print(linkedString.get(0) + \" \");\n\t\t\t//remove the first item in the linked list\n\t\t\tlinkedString.removeFirst();\n\t\t}\n\t\t//print out a new blank line for better readability\n\t\tSystem.out.println(\"\\n\");\n\t}", "private void print() {\n\t\t// reorganize a wraparound queue and print\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tSystem.out.print(bq[(head + i) % bq.length] + \" \");\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t}", "void FlipBook()\r\n\t\t{\r\n\t\t\t Collections.reverse(this);\r\n\t\t}", "protected void printQueue()\r\n\t{\r\n\t\tint south = 1;\r\n\t\tint west = 2;\r\n\t\tint midwest = 3;\r\n\t\t\r\n\t\tgetPriorityHeader(south);\r\n\t\tSystem.out.println(State.getHeader());\r\n\t\tdisplaySouth();\r\n\t\t\r\n\t\tgetPriorityHeader(west);\r\n\t\tSystem.out.println(State.getHeader());\r\n\t\tdisplayWest();\r\n\t\t\r\n\t\tgetPriorityHeader(midwest);\r\n\t\tSystem.out.println(State.getHeader());\r\n\t\tdisplayMidwest();\r\n\t}", "public void reversePrint()\n {\n reversePrint(size-1);\n }", "public void display(){\n for(int i = 0;i < n_items;++i){\n System.out.print(queue_array[(i + front) % max_size] + \" \");\n }\n System.out.println();\n }", "public void display()\n\t{\n\t\tif(isEmpty())\n\t\t{\n\t\t\tSystem.out.println(\"Queue is empty\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Queue is : \");\n\t\t\n\t\tint i=front;\n\t\tif(front<=rear)\n\t\t{\n//\t\t\tprints all elements from front to rear\n\t\t\twhile(i<=rear)\n\t\t\t\tSystem.out.println(queueArray[i++] + \" \");\n\t\t}\n\t\telse\n\t\t{\n//\t\t\tdisplay all elements from front to last index of array\n\t\t\twhile(i<=queueArray.length-1)\n\t\t\t\tSystem.out.println(queueArray[i++] + \" \");\n\t\t\ti=0;\n//\t\t\tthen display all the elements from index 0 to rear\n\t\t\twhile(i<=rear)\n\t\t\t\tSystem.out.println(queueArray[i++] + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public String toString()\n\t{\n\t\tString queueAsString = \"\";\n\t\tint index = front - 1;\n\t\tfor (int i = 0; i < counter; i++)\n\t\t{\n\t\t\tindex = next(index);\n\t\t\tqueueAsString += list[index] + \" \";\n\t\t}\n\t\treturn queueAsString;\n\t}", "public void displayBckwrd() {\n\t\tSystem.out.print(\"Displaying in backward direction [last-->first] : \");\n\t\tNode tempDisplay = last; // start at the end of linkedList\n\t\twhile (tempDisplay != null) {// Executes until we don't find start of\n\t\t\t\t\t\t\t\t\t\t// list.\n\t\t\ttempDisplay.displayNode();\n\t\t\ttempDisplay = tempDisplay.previous; // move to previous Node\n\t\t}\n\t\tSystem.out.println(\"\");\n\t}", "public void printQueue();", "public static void main(String[] args) {\n// reverse(queue);\n// System.out.println(queue);\n\n Stack<Integer> stack=new Stack<>();\n stack.push(1);\n stack.push(2);\n stack.push(3);\n stack.push(4);\n System.out.println(stack);\n stack=reverse(stack);\n System.out.println(stack);\n\n\n\n\n }", "public static void display() {\n System.out.println();\t \n System.out.println(\"Contents of the queue are: \" + queue);\n }", "public void reverse() {\n\t\tif (!this.isEmpty()) {\n\t\t\tT x = this.peek();\n\t\t\tthis.pop();\n\t\t\treverse();\n\t\t\tinsert_at_bottom(x);\n\t\t} else\n\t\t\treturn;\n\t}", "public static void main(String[] args) {\n Queue<Integer> queue = new LinkedListQueue<>();\n\n for (int i = 0; i < 21; i++) {\n queue.enqueue(i);\n System.out.println(queue);\n }\n\n for (int i = 0; i < 16; i++) {\n queue.dequeue();\n System.out.println(queue);\n }\n System.out.println(queue);\n }", "static Queue<Integer> reverseQueueUsingRecursion(Queue<Integer> queue)\n {\n int data;\n if (queue.isEmpty())\n {\n return queue;\n }\n else\n {\n data = queue.poll();\n //queue.remove();\n queue = reverseQueueUsingRecursion(queue);\n queue.add(data);\n return queue;\n }\n }", "public void printQueue() {\n \t\n \tif(this.front == null) {\t\n \t\tSystem.out.println(\"Queue Empty!!\");\n \t\treturn;\n \t}\n \t\n \twhile(this.front != null) {\n \t\tSystem.out.print(\"(\"+this.front.data+ \") \");\n \t\tthis.front = this.front.next;\n \t}\n }", "private void printDeque() {\n\t\tint i=front;\r\n\t\tif(rear==-1 && front==-1) {\r\n\t\t\tSystem.out.println(\"Dequeue is empty\");\r\n\t\t}else {\r\n\t\t\twhile(i!=rear) {\r\n\t\t\t\tSystem.out.print(arr[i]+\" \");\r\n\t\t\t\ti=(i+1)%arr.length;\r\n\t\t\t}\r\n\t\t\tSystem.out.print(arr[rear]);\r\n\t\t}\r\n\t\t\r\n\t}", "public DoubleLinkedSeq reverse(){\r\n\t DoubleLinkedSeq rev = new DoubleLinkedSeq();\r\n\t for(cursor = head; cursor != null; cursor = cursor.getLink()){\r\n\t\t rev.addBefore(this.getCurrent());\r\n\t }\r\n\t \r\n\t return rev; \r\n }", "@Override\n\tpublic String toString()\n\t{\n\n\t\tStringBuffer sb = new StringBuffer(\"top->\");\n\t\tif (!isEmpty())\n\t\t{\n for(int i = getSize() - 1; i >= 0; i--)\n {\n if(i == getSize() - 1)\n {\n sb.append(list.get(i));\n }\n else \n {\n sb.append( \"->\" + list.get(i));\n }\n }\n //System.out.println(sb.toString());\n\t\t}\n\t\treturn sb.toString();\n\t}", "@Override\n\tpublic String toString() {\n\t\tStringBuilder sb=new StringBuilder();\n\t\tif(isEmpty()){\n\t\t\tsb.append(String.format(\"ArrayQueueLoop:[] %d/%d\",size,data.length));\n\t\t}else{\n\t\t\tsb.append(\"ArrayQueueLoop:[\");\n\t\t\tfor(int i=front;i!=rear;i=(i+1)%data.length){\n\t\t\t\tif((i+1)%data.length==rear){\n\t\t\t\t\tsb.append(data[i]+\"]\");\n\t\t\t\t}else{\n\t\t\t\t\tsb.append(data[i]+\",\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tsb.append(String.format(\" %d/%d\",size,data.length));\n\t\t}\n\t\t\n\t\treturn sb.toString();\n\t}", "public void pop() {\n move();\n reverseQueue.poll();\n }", "static void dump(Queue queue) {\n String temp = \" queue = \";\n System.out.print(temp);\n while (queue.isEmpty()) {\n System.out.println(((TreeNode) queue.remove()).data + \" \");\n }\n }", "private void printHistoryReverse()\r\n\t{\r\n\t\tStack temp = new Stack(SIZE);\r\n\t\t\r\n\t\tSystem.out.println(\"\\nBrowsing History (Most Recent to Oldest):\");\r\n\t\tfor (int i = 0; i < siteVisited; i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(chronological.peek());\t\t//print out value currently at the top of stack\r\n\t\t\ttemp.push(chronological.pop());\t\t\t\t\t//pop the top of stack and push to another stack\r\n\t\t}\r\n\t\tfor (int i = 0; i < siteVisited; i++)\r\n\t\t\tchronological.push(temp.pop());\t\t\t\t\t//push all elements of temp back to the original stack\r\n\t}", "public void printInReverseOrder() {\n\t\tNode currentNode = headNode;\n\t\tNode previousNode = headNode;\n\t\t\n\t\tif(currentNode==null) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tList<Node> listOfNodes = new ArrayList<Node>();\n\t\t\t//deal One element LinkedList\n\t\t\tif(currentNode.getNextNode()==null) {\n\t\t\t\tSystem.out.println(currentNode.getData());\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\twhile(currentNode.getNextNode()!=null) {\n\t\t\t\t\tpreviousNode = currentNode;\n\t\t\t\t\tcurrentNode = currentNode.getNextNode();\n\t\t\t\t\tlistOfNodes.add(previousNode);\n\t\t\t\t\tSystem.out.println(\" Adding Node value to the List as \"+currentNode.getData());\n\t\t\t\t}\n\t\t\t\tif(currentNode!=null) {\n\t\t\t\t\tSystem.out.println(\" The Last Node is \"+currentNode.getData());\n\t\t\t\t\tcurrentNode = previousNode.getNextNode();\n\t\t\t\t\tSystem.out.println(\" The Last Node's Next Node is \"+currentNode.getData());\n\n\t\t\t\t\tlistOfNodes.add(currentNode);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(listOfNodes!=null && listOfNodes.size()>0) {\n\t\t\t\t\tCollections.reverse(listOfNodes);\n\t\t\t\t\tlistOfNodes.stream().forEach(elem->System.out.print(elem.data+\" =>\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "void dequeue() {\r\n\t\tfirst.nextSet(first.next.next);\r\n\t\tfirst.next.prevSet(first);\r\n\t\tlength--;\r\n\t}", "public void _reverse() {\n\n var prev = first;\n var current = first.next;\n last = first;\n last.next = null;\n while (current != null) {\n var next = current.next;\n current.next = prev;\n prev = current;\n current = next;\n\n }\n first = prev;\n\n }", "public void display() {\n\n for (int i=top;i>=0;i--)\n {\n System.out.println(stack[i]);\n }\n }", "public static void showNodeQueue(AYQueue<Node> q)\n {\n for (int i = 0; i < q.size(); i++)\n {\n Node node = q.dequeue();\n System.out.format(\"Element #%d = [%s]%n\", i, node.getNodeID());\n q.enqueue(node);\n } //for\n\n }", "private static void printList() {\n\tNode n=head;\n\tint size=0;\n\twhile(n!=null)\n\t{\n\t\tSystem.out.print(n.data+\" \");\n\t\tn=n.next;\n\t\tsize++;\n\t}\n\tn=head;\n\tfor(int i=0;i<size-1;i++)\n\t\tn=n.next;\n\tSystem.out.println(\"\\nreverse direction\");\n\twhile(n!=null)\n\t{\n\t\t\n\t\tSystem.out.print(n.data+\" \");\n\t\tn=n.prev;\n\t}\n\t\n}", "@Override\n public void printDeque(){\n\n int front = backward(nextFront);\n\n for(int i = 1; i <= size; i++){\n\n System.out.print(items[front] + \" \");\n\n front = backward(front);\n }\n\n }", "public void reverse() {\n ArrayList<Character> newSeq = new ArrayList<Character>();\n for (int i = 0; i < seq.size(); i++) {\n newSeq.add(seq.get(seq.size() - 1 - i));\n }\n seq = newSeq;\n }", "public static void main(String[] args) {\n CircleArrayQueue circleArrayQueue = new CircleArrayQueue(4);\n circleArrayQueue.addQueue(1);\n circleArrayQueue.addQueue(2);\n circleArrayQueue.addQueue(3);\n System.out.println(circleArrayQueue.getQueue());\n circleArrayQueue.showQueue();\n// System.out.println(circleArrayQueue.getQueue());\n// System.out.println(circleArrayQueue.getQueue());\n circleArrayQueue.addQueue(4);\n circleArrayQueue.showQueue();\n\n System.out.println(circleArrayQueue.getQueue());\n circleArrayQueue.showQueue();\n\n circleArrayQueue.addQueue(5);\n circleArrayQueue.showQueue();\n System.out.println(circleArrayQueue.getQueue());\n circleArrayQueue.showQueue();\n\n circleArrayQueue.addQueue(5);\n circleArrayQueue.showQueue();\n// System.out.println(circleArrayQueue.getQueue());\n }", "public void reverse() {\n var previous = first;\n var current = first.next;\n\n last = first;\n last.next = null;\n while (current != null) {\n var next = current.next;\n current.next = previous;\n previous = current;\n current = next;\n\n }\n first = previous;\n\n }", "public void printBasinSizes(){\n PriorityQueue<Integer> BasinQueue = new PriorityQueue<Integer>(sinkCounter, Collections.reverseOrder());\n String toPrint = \"\";\n for(int x: sinkCounterMap.values()){\n BasinQueue.add(x);\n \n }\n \n for(int i=0; i<(sinkCounter); i++){\n toPrint = toPrint + BasinQueue.poll() + \" \";\n }\n \n System.out.println(toPrint);\n }", "Digraph reverse() {\n return null;\n }", "public int dequeueRear();", "private List<TrackElement> getRenderOrder(Timeline timeline) {\n List<Track> tracks = new ArrayList<>(timeline.getTracks());\n Collections.reverse(tracks);\n return tracks.stream().flatMap(t -> t.getAllElements().stream()).collect(Collectors.toList());\n }", "public void printQueue() {\n\t\tcurrent = front;\n\n\t\tif (isEmpty()) {\n\t\t\tSystem.out.println(\"The queue is empty.\");\n\t\t}\n\t\twhile (current.next != null) {\n\t\t\tSystem.out.println(current.data);\n\t\t\tcurrent = current.next;\n\t\t}\n\t}", "QNode dequeue() \r\n\t { \r\n\t \t\r\n\t // If queue is empty, return NULL. \r\n\t if (this.front == null) {\r\n\t \tsize=0;\r\n\t \tthis.rear = null;\r\n\t return null; \r\n\t }\r\n\t \r\n\t // Store previous front and move front one node ahead \r\n\t else {\r\n\t\t QNode temp = this.front; \r\n\t\t this.front = this.front.next; \r\n\t\t \r\n\t\t if(temp!= null && this.front!= null) {\r\n\t\t \t//every time it dequeues figure out the wait time of each customers\r\n\t\t\t this.front.wait_time = getWaitTime(this.front.arrival_time, temp);\r\n\t\t\t longestBreaktime(this.front.wait_time, temp);\r\n\t\t\t System.out.println(this.front.wait_time);\r\n\t\t\t //decrease size by 1 whenever it deques\r\n\t\t\t size--;\r\n\t\t\t System.out.println(\"break \"+ breaktime);\r\n\t\t\t System.out.println(\"longest \" + longest);\r\n\t\t\t \r\n\t\t\t return temp;\r\n\t\t }\r\n\t\t else {\r\n\t\t \treturn temp;\r\n\t\t }\r\n\t\t \r\n\t }\r\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 void swapEventQueues ()\r\n {\n myNextEventQueue.addAll(0, myCurrentEventQueue);\r\n myCurrentEventQueue.clear();\r\n\r\n LinkedList<IFiredEvent> temp = myCurrentEventQueue;\r\n\r\n myCurrentEventQueue = myNextEventQueue;\r\n // for memory efficiency, recycle the old queue\r\n myNextEventQueue = temp;\r\n myNextEventQueue.clear();\r\n }", "void dequeue() \n { \n // If queue is empty, return NULL. \n if (this.front == null) \n return; \n \n // Store previous front and move front one node ahead \n LinkedListQueue temp = this.front; \n this.front = this.front.next; \n \n // If front becomes NULL, then change rear also as NULL \n if (this.front == null) \n this.rear = null; \n }", "private void printBrowsingHistory()\r\n\t{\r\n\t\tQueue temp = new Queue(SIZE);\r\n\t\tObject element;\r\n\t\t\r\n\t\tSystem.out.println(\"\\nBrowsing History (Oldest to Most Recent):\");\r\n\t\tfor (int i = 0; i < queueCount; i++)\r\n\t\t{\r\n\t\t\telement = rChronological.dequeue();\t\t\t\t//dequeue first element to the variable element\r\n\t\t\tSystem.out.println(element);\t\t\t\t\t//print out the value of element (the URL)\r\n\t\t\ttemp.enqueue(element);\t\t\t\t\t\t\t//enqueue element to a temporary queue\r\n\t\t}\r\n\t\tfor (int i = 0; i < queueCount; i++)\r\n\t\t\trChronological.enqueue(temp.dequeue());\t\t\t//put all elements in temp back to the original queue\r\n\t}", "public static void main(String[] args) {\n\t\tNode head=GroupReverse.createList();\n\t\thead=GroupReverse.reverseK2(head, 3);\n\t\tint count=0;\n\t\twhile(head!=null)\n\t\t{\n\t\t\tSystem.out.print(head.value+\" \");\n\t\t\thead=head.next;\n\t\t}\n\t\t\n\t}", "public void reverse() {\n\t\tif(isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\tNodo <T> pri_n= fin;\n\t\t\n\t\tint cont= tamanio-1;\n\t\tNodo<T> nodo_act= pri_n;\n\t\twhile(cont >0) {\n\t\t\tNodo <T> aux= getNode(cont-1);\n\t\t\tnodo_act.setSiguiente(aux);\n\t\t\tnodo_act= aux;\n\t\t\tcont--;\n\t\t}\n\t\tinicio = pri_n;\n\t\tfin= nodo_act;\n\t\tfin.setSiguiente(null);\n\t}", "public Reversal() {\n\t\tsuper();\n\t}", "public static void main(String args[]) {\r\n /* Create a queue with items 1 2 3 */\r\n Queue q = new Queue();\r\n q.stack1 = new Stack<>();\r\n q.stack2 = new Stack<>();\r\n enQueue(q, 1);\r\n enQueue(q, 2);\r\n enQueue(q, 3);\r\n\r\n /* Dequeue items */\r\n System.out.print(deQueue(q) + \" \");\r\n System.out.print(deQueue(q) + \" \");\r\n System.out.println(deQueue(q) + \" \");\r\n }", "void updateDisplay()\r\n {\r\n\tCustomerNode temp = q.front();\r\n\tint i = 0;\r\n\r\n\tdisplayArea.setText(\"\");\r\n\t\r\n\tif (q.isEmpty())\r\n\t{\r\n displayArea.setText(\"Nobody waiting...\\n\");\r\n\t}\r\n\telse\r\n\t{\r\n do\r\n {\r\n displayArea.append(\"\" + ++i + \": \" + temp.getName()\r\n + \" \" + temp.getPhone() + \"\\n\");\r\n //temp = q.getNext(temp);\r\n temp = temp.getNext();\r\n }\r\n while (temp != null);\r\n\t}\r\n }", "@Test\n\tpublic void testPopBack2() {\n\t\tcircularlist.pushBack(4);\n\t\tcircularlist.pushBack(12);\n\t\tcircularlist.pushBack(7);\n\t\tcircularlist.pushBack(9);\n\t\t\n\t\tcircularlist.popBack();\n\t\tcircularlist.popBack();\n\t\t\n\t\tSystem.setOut(new PrintStream(Actualout));\n\t\t\n\t\tcircularlist.display();\n\t\t\n\t\tassertEquals(\"List : 4 12\\r\\n\", Actualout.toString());\n\t}", "public void dequeueFromBack() {\r\n\t\tif (head == null) { //If there is no head (meaning the list is empty), don't do anything\r\n\t\t\tprintQueue();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tNode current = head; //Instantiated node to cycle through list\r\n\t\tfor(int i = 1; i < size; i++) { //Loop to get instantiated node to the end of the list\r\n\t\t\tcurrent = current.next;\r\n\t\t\tcurrent.prev.index--;\r\n\t\t}\r\n\t\t\r\n\t\tif(current.prev == tail && current.next == tail) { //If there is only one node left, set it equal to null\r\n\t\t\thead = null;\r\n\t\t\tprintQueue();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tcurrent.prev.next = head; //The previous node's next node is removed\r\n\t\ttail = current.prev;\r\n\t\tsize--;\r\n\t\tprintQueue();\r\n\t}", "private void flip() {\n ObservableList<Node> tmp = FXCollections.observableArrayList(this.getChildren());\n Collections.reverse(tmp);\n getChildren().setAll(tmp);\n setAlignment(Pos.TOP_LEFT);\n }", "private void flip() {\n ObservableList<Node> tmp = FXCollections.observableArrayList(this.getChildren());\n Collections.reverse(tmp);\n getChildren().setAll(tmp);\n setAlignment(Pos.TOP_LEFT);\n }", "private void flip() {\n ObservableList<Node> tmp = FXCollections.observableArrayList(this.getChildren());\n Collections.reverse(tmp);\n getChildren().setAll(tmp);\n setAlignment(Pos.TOP_LEFT);\n }", "public void print() {\r\n\t\tfor (int i = front; i <= rear; i++) {\r\n\t\t\tSystem.out.print(arr[i].getData() + \"\\t\");\r\n\t\t}\r\n\t}", "public void requeue() {\n\t\tenqueue(queue.removeFirst());\n\t}", "@Override\r\n\tpublic String toString() {\r\n\t\tString queueList = \"\";\r\n\t\tArrayList<T> dataCopy = new ArrayList<T>();\r\n\t\tdataCopy = data;\r\n\r\n\t\tfor(T e: dataCopy) {\r\n\t\t\tqueueList += e;\r\n\t\t}\r\n\t\treturn queueList;\r\n\t}", "private String redo() {\n this.undos.push(History.copy(this));\n if (!redos.isEmpty()) {\n History history = redos.pop();\n this.undos.push(History.copy(this));\n pasteHistory(history);\n }\n\n //return sb.toString();\n return printList();\n }", "public void printListRev(){\n System.out.println(\"My current doubly linked list in reverse:\");\n if (head.next != tail || tail.prev != head){\n MyDoubleNode<T> counter = tail;\n while (counter.prev != head){\n counter = counter.prev;\n if (counter.prev != head){\n System.out.print(counter.data + \", \");\n }\n else {\n System.out.print(counter.data + \"\\n\");\n }\n }\n }\n }", "public void printDescend() {\r\n\t\tMovieListNode<m> cur = tail;\r\n\t\twhile (cur != null) {\r\n\t\t\tSystem.out.println(cur);\t//prints current node\r\n\t\t\tcur = cur.prev;\t\t//moves back to previous node\r\n\t\t}\r\n\t}", "private void displaySouth()\r\n\t{\r\n\t\tfor\t(int i = 0; i < southElem; i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(southQueue[i].toString());\r\n\t\t\tremoveSouth();\r\n\t\t}\r\n\t}", "public Graphe reverse()\t{\r\n \tfor(Liaison route : this.routes)\r\n \t\tif(route.isSensUnique())\r\n \t\t\troute.reverse();\t//TODO check si reverse marche bien\r\n \treturn this;\r\n }", "@Test\n\tpublic void testPopFront2() {\n\t\tcircularlist.pushBack(4);\n\t\tcircularlist.pushBack(12);\n\t\tcircularlist.pushBack(7);\n\t\tcircularlist.pushBack(9);\n\t\t\n\t\tcircularlist.popFront();\n\t\tcircularlist.popFront();\n\t\t\n\t\tSystem.setOut(new PrintStream(Actualout));\n\t\t\n\t\tcircularlist.display();\n\t\t\n\t\tassertEquals(\"List : 7 9\\r\\n\", Actualout.toString());\n\t}", "private static void iterateLinkedListInReverseOrder() {\n\t\tLinkedList<Integer> list = new LinkedList<Integer>();\n\t\tlist.add(10);\n\t\tlist.add(20);\n\t\tlist.add(30);\n\t\tlist.add(40);\n\t\tlist.add(50);\n\t\tSystem.out.println(\"LinkedList is : \" + list);\n\t\tCollections.reverse(list);\n\t\tSystem.out.println(\"Reverse the LinkedList is : \" + list);\n\t}", "public static String deQueue(Queue q){ \n String front = q.names[0]; //Store the front element to be returned and printed if wanted \n if (q.queuesize != 0){ //IF the queue is not empty \n for (int i = 0; i < q.queuesize; i++){ //For the all of the non zero elements in the queue\n q.names[i] = q.names[i+1]; // Overwrite the first element to get rid of it and shove all of the others up 1\n }\n q.queuesize -=1; //Decrease the size by 1 as someone left \n }\n else{\n System.out.print(\"Empty Queue\"); //State the queue is empty and nothing can be removed\n }\n return front; //Return the element that was once in front - This can be printed \n }", "public static void main(String[] args) {\n Queue queue = new Queue();\n // Inserting elements in Circular Queue\n queue.enQueue(24);\n queue.enQueue(94);\n queue.enQueue(6);\n queue.enQueue(18);\n queue.enQueue(20);\n queue.enQueue(19);\n queue.enQueue(11);\n\n // Display elements present in Circular Queue\n queue.displayQueue();\n\n // Deleting elements from Circular Queue\n System.out.println(\"Deleted value = \" + queue.deQueue());\n System.out.println(\"Deleted value = \" + queue.deQueue());\n\n // Remaining elements in Circular Queue\n queue.displayQueue();\n\n queue.enQueue(1);\n queue.enQueue(92);\n queue.displayQueue();\n }", "static void levelOrder(Node root){\n Queue<Node> queue = new LinkedList<Node>();\r\n \r\n queue.add(root);\r\n while (!queue.isEmpty()) {\r\n Node head = queue.remove();\r\n\r\n if (head == null) {\r\n continue;\r\n }\r\n\r\n System.out.print(head.data + \" \");\r\n\r\n queue.add(head.left);\r\n queue.add(head.right);\r\n }\r\n System.out.println();\r\n \r\n }", "public void printDeque() {\n for (int index = 0; index < size; index++) {\n System.out.print(get(index) + \" \");\n }\n System.out.println(\"\\n\");\n\n }", "public static void main(String[] args) {\n \n LinkedList<Integer> l = new LinkedList<Integer>();\n l.add(1);\n l.add(2);\n l.add(3);\n l.add(4);\n ReverseCollection rev = new ReverseCollection();\n rev.reverse(l);\n System.out.println(Arrays.toString(l.toArray()));\n\n }", "void dequeue(){\n if(isEmpty()!=1){\n\n for(int i=0;i<size-1;i++){\n values[i] = values[i+1];\n }\n\n values[size-1] = (-1);\n }\n }", "public static void main(String[] args) {\n RandomizedQueue<String> rq = new RandomizedQueue<String>();\n rq.enqueue(\"a\");\n rq.enqueue(\"b\");\n rq.enqueue(\"c\");\n Iterator<String> i1 = rq.iterator();\n Iterator<String> i2 = rq.iterator();\n while(i1.hasNext()) {\n System.out.print(i1.next() + \",\");\n }\n System.out.println();\n rq.dequeue();\n while(i2.hasNext()) {\n System.out.print(i2.next() + \",\");\n }\n System.out.println();\n }", "void reverseTurnOrder() {\n turnOrder *= -1;\n }", "public Object todequeue() {\n\t\tif(rear == 0)\n\t\t\treturn null;\n\t\telse {\n\t\t\tObject to_return = arr[front];\n\t\t\tfront++;\n\t\t\tsize--;\n\t\t\treturn to_return;\n\t\t}\n\t}", "public static void main(String[] args)throws Exception {\n\t\t IQueue queue=new Queue_using_LL();\n\t\t queue.enqueue(10);\n\t\t queue.enqueue(20);\n\t\t queue.enqueue(30);\n\t\t queue.display();\n\t\t queue.dequeue();\n\t\t queue.display();\n\tSystem.out.println( queue.size());\n\t\t\n\t}", "public void popRight() {\n if (size == 0) {\n System.out.println(\"Deck is empty\");\n return;\n }\n E data = tail.data;\n Deque thead = head;\n while (thead.next != tail) {\n thead = thead.next;\n }\n thead.next = null;\n tail = thead;\n size--;\n System.out.println(print());\n }", "public void printRightView(){\n \n if(root == null)\n return;\n\n // Take a queue and enqueue root and null\n // every level ending is signified by null\n // since there is just one node at root we enqueue root as well as null\n // take a bool value printed = false\n Queue<Node<T>> queue = new LinkedList<>();\n queue.add(root);\n queue.add(null);\n Node<T> lastVal = null;\n\n while(queue.size() != 0){\n Node<T> node = queue.remove();\n if(node != null){\n\n // keep track of last node and dont print it\n lastVal = node;\n\n // Enqueue left and right child if they exist\n if(node.left != null)\n queue.add(node.left);\n if(node.right != null)\n queue.add(node.right);\n }else{\n // print last node\n System.out.println(lastVal.data + \" ,\");\n if(queue.size() == 0)\n break;\n queue.add(null);\n }\n }\n }", "public static void main(String[] args) {\n\t\tQueue<Integer> q = new LinkedList<Integer>();\n\t\tq.add(5);\n\t\tq.add(3);\n\t\tq.add(1);\n for(Integer a : q){\n System.out.println(a);\n }\n q.peek();\n q.poll();\n q.remove();\n Iterator<Integer> t = q.iterator();\n\t\twhile(t.hasNext()){\n\t\t System.out.println(t.next());\n }\n\n\n\n\t}", "public static void main(String[] args) {\n ArrayQueue<String> qu = new ArrayQueue<>();\n\n qu.enqueue(\"this\");\n System.out.println(qu);\n\n qu.enqueue(\"is\");\n System.out.println(qu);\n\n qu.enqueue(\"a\");\n System.out.println(qu);\n\n System.out.println(qu.dequeue());\n System.out.println(qu);\n\n qu.enqueue(\"queue\");\n System.out.println(qu);\n\n qu.enqueue(\"of\");\n System.out.println(qu);\n\n // qu.enqueue(\"strings\");\n // System.out.println(qu);\n\n\n while (!qu.isEmpty()) {\n System.out.println(qu.dequeue());\n System.out.println(qu);\n }\n\n }", "public void reverse() {\n\t\t// write you code for reverse using the specifications above\t\t\n\t\tNode nodeRef = head;\n\t\thead = null;\n\t\t\n\t\twhile(nodeRef != null) {\n\t\t\tNode tmp = nodeRef;\n\t\t\tnodeRef = nodeRef.next;\n\t\t\ttmp.next = head;\n\t\t\thead = tmp;\n\t\t}\n\t}", "public void printQueue() {\r\n\t\tNode current = head; //Instantiated node which will cycle through\r\n\t\tfor(int i = 0; i < size; i++) { //While the current instantiated node isn't null (meaning thats it's in the list), increment through the list and print the data\r\n\t\t\tSystem.out.print(current.data + \"[\" +current.index+ \"] \");\r\n\t\t\tcurrent = current.next;\r\n\t\t}\r\n\t\tif(head == null) System.out.println(\"THE QUEUE IS EMPTY!\");\r\n\t\tSystem.out.println(\"\\n\");\r\n\t}", "public static void main(String[] args) {\n\t// write your code here\n System.out.println(\"Welcome to Frontline Electronics :\");\n admin();\n customer();\n /* for (int i =0; i<ll.size();i++) {\n System.out.println(ll.get(i));\n }*/\n // System.out.println(ll.getLast());\n Iterator it = pal.iterator();//.descendingIterator();\n while (it.hasNext())\n {\n System.out.println(it.next());\n }\n\n }", "public void dequeue() {\n if (!isEmpty()) { //se estiver vazia retorna -1\n\n No temp = inicio;\n // move o topo para o prox nó\n inicio = inicio.next;\n if (inicio == null) {\n fim = null;\n }\n size--;\n }\n\n }", "public void dequeue() {\r\n\t\tif(head.prev == null && head.next == null) { //If the only node in the list is the head, set everything equal to null and return\r\n\t\t\thead = null;\r\n\t\t\tprintQueue();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\thead = head.next; //The new head is the node after the previous head\r\n\t\thead.prev = tail; //The previous node to the head is set to tail\r\n\t\tsize--;\r\n\t\tprintQueue();\r\n\t}", "public void printKillRing() {\n AssassinNode current = poolFront;\n while (current.next != null) {\n System.out.println(\" \" + current.name + \" is stalking \" + current.next.name);\n current = current.next;\n }\n System.out.println(\" \" + current.name + \" is stalking \" + poolFront.name);\n }", "public void showBowlingOrder()\n\t{\n\t\twhile(bowlers.size()!=0)\n\t\t{\n\t\t\tbowlers.get(0).setBall(bowlers.get(0).getBall()-1);\n\t\t\tSystem.out.println(bowlers.get(0).getName()+\" throw this ball and left with \"+bowlers.get(0).getBall());\n\t\t\tif(bowlers.get(0).getBall()==0)\n\t\t\t{\n\t\t\t\tbowlers.remove(0);\n\t\t\t}\n\t\t\tthis.shortSort();\n\t\t}\n\t}", "public void reverse() {\n\t\tNode<E> temp = null;\n\t\tNode<E> n = root;\n\n\t\twhile (n != null) {\n\t\t\ttemp = n.getBefore();\n\t\t\tn.setBefore(n.getNext());\n\t\t\tn.setNext(temp);\n\t\t\tn = n.getBefore();\n\t\t}\n\n\t\ttemp = root;\n\t\troot = tail;\n\t\ttail = temp;\n\t}", "public static void main(String[] args) {\n\t\tQueue<Integer> queue = new LinkedList<Integer>();\r\n\t\t\r\n\t\tqueue.offer(1);//queue에 주입\r\n\t\tqueue.offer(2);\r\n\t\tqueue.offer(3);\r\n\t\t\r\n\t\t\r\n\t\tint header = queue.element(); // 1 반환\r\n\t\tint tail = queue.peek(); // 1 반환\r\n\t\t\r\n\t\tSystem.out.println(header);\r\n\t\tSystem.out.println(tail);\r\n\t\t\r\n\t\twhile(!queue.isEmpty()) {\r\n\t\t\tint re = queue.remove(); //앞에서 부터 꺼내옴\r\n\t\t\t\r\n\t\t\tSystem.out.println(re);\r\n\t\t}\r\n\t}", "public int dequeueFront();", "public void reverseDi() {\n int hi = size - 1;\n int lo = 0;\n\n while (lo < hi) {\n Node left = getNodeAt(lo);\n Node right = getNodeAt(hi);\n\n Object temp = left.data;\n left.data = right.data;\n right.data = temp;\n\n lo++;\n hi--;\n }\n }", "private void addFromQueue()\n\t{\n\t\twhile( humanQueue.size()>0 )\n\t\t\thumans.add(humanQueue.remove(0));\n\t\twhile( zombieQueue.size()>0 )\n\t\t\tzombies.add(zombieQueue.remove(0));\n\t}", "public void displayReceivedRewards() {\n ;////System.out.println(\"\");\n ;////System.out.println(\"displayReceivedRewards() called...\");\n ;////System.out.println(\"-playerModelDiff1: \" + playerModelDiff1.toString());\n ;////System.out.println(\"-playerModelDiff4: \" + playerModelDiff4.toString());\n ;////System.out.println(\"-playerModelDiff7: \" + playerModelDiff7.toString());\n }", "public void reverse() {\n\t\t\n\t\tif(isEmpty()==false){\n\t\t\tDoubleNode left=head, right=tail;\n\t\t\tchar temp;\n\t\t\twhile(left!=right&&right!=left.getPrev()){\n\t\t\t\ttemp=left.getC();\n\t\t\t\tleft.setC(right.getC());\n\t\t\t\tright.setC(temp);\n\t\t\t\tleft=left.getNext();\n\t\t\t\tright=right.getPrev();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "@Override\n public void printDeque() {\n int position = plusOne(nextFirst);\n for (int i = 0; i < size; i += 1) {\n System.out.print(array[position]);\n System.out.print(' ');\n position = plusOne(position);\n }\n System.out.print('\\n');\n }", "@Override\n public void printDeque() {\n int index = moveForward(nextFirst, 1);\n for (int count = 1; count <= size; count++) {\n System.out.print(items[index] + \" \");\n index = moveForward(index, 1);\n }\n }", "public String toString()\n\t{\n\t\treturn postOrder().toString();\n\t}", "public static void main( String args[]){\n CircularArrayDeque mydeque = new CircularArrayDeque();\n System.out.println(\"My deque capacity should be 100 and is \" + mydeque.capacity);\n System.out.println(\"----------------------------------------------------------\" );\n mydeque = new CircularArrayDeque(10);\n System.out.println(\"Now my deque capacity should be 10 and is \" + mydeque.capacity);\n System.out.println(\"----------------------------------------------------------\" );\n mydeque.addAtFront(20);\n mydeque.addAtFront(40);\n mydeque.addAtFront(60);\n mydeque.addAtFront(80);\n mydeque.addAtFront(20);\n mydeque.addAtFront(40);\n mydeque.addAtFront(60);\n mydeque.addAtFront(80);\n mydeque.addAtFront(60);\n \n mydeque.PrintAllElementsInDeque();\n mydeque.addAtFront(80);\n mydeque.addAtFront(60);\n \n mydeque.removeFromFront();\n mydeque.removeFromFront();\n mydeque.removeFromFront();\n mydeque.removeFromFront();\n \n \n mydeque.removeFromRear();\n mydeque.removeFromRear();\n mydeque.removeFromRear();\n mydeque.removeFromRear();\n mydeque.removeFromRear();\n mydeque.removeFromRear();\n mydeque.addAtFront(80);\n mydeque.addAtFront(60);\n mydeque.addAtRear(20);\n mydeque.addAtRear(40);\n mydeque.addAtRear(60);\n \n mydeque.PrintAllElementsInDeque();\n }" ]
[ "0.6740046", "0.6724584", "0.64971554", "0.6386743", "0.6352476", "0.6296186", "0.6245367", "0.6245147", "0.6108861", "0.6104501", "0.610203", "0.6096433", "0.6086682", "0.6081689", "0.6062907", "0.60360295", "0.6025986", "0.60192716", "0.5985682", "0.5949913", "0.59428245", "0.59164035", "0.58896804", "0.5882786", "0.584009", "0.5839015", "0.5802079", "0.5784163", "0.5767965", "0.57564867", "0.57429224", "0.574079", "0.5735015", "0.57238644", "0.57118803", "0.57043254", "0.5653648", "0.5631119", "0.56182885", "0.561483", "0.55898166", "0.55785793", "0.5577838", "0.5561078", "0.55595666", "0.5555285", "0.55425316", "0.5541541", "0.55413556", "0.5535711", "0.55355257", "0.5531701", "0.552013", "0.5516823", "0.5513707", "0.5513396", "0.55123323", "0.55123323", "0.55123323", "0.5510333", "0.5506936", "0.5505471", "0.55034804", "0.550131", "0.5499993", "0.5499656", "0.54784423", "0.54520327", "0.5443999", "0.543226", "0.54253644", "0.5423942", "0.54211384", "0.5420771", "0.54074347", "0.54052955", "0.5402906", "0.5401817", "0.5389082", "0.5382276", "0.53705794", "0.53705525", "0.5368444", "0.5366176", "0.534435", "0.5340595", "0.53351957", "0.5328251", "0.5325584", "0.53239816", "0.53176385", "0.5315981", "0.53156203", "0.5305603", "0.5302466", "0.52998835", "0.5297678", "0.52935624", "0.5292871", "0.5281316", "0.5278329" ]
0.0
-1
Pulls information out of the d1 array along rows then columns;
public Matrix3D(double[] d1) { super(3,3); int k = -1; for (int i=0 ; i<3 ; i++) { // loop over rows for (int j=0 ; j<3 ; j++) { // loop over columns k++; set(i,j,d1[k]); // d[i][j] = d1[k]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long[][] flatTo2D (long[] in_array1d){\n\t\tint sl = (int)Math.sqrt(in_array1d.length);\n\t\tlong[][] out_array = new long[sl][sl]; //declares output 2D array\n\t\tint q = 0; //temporary variable, used in following nested for loop\n\t\tfor(int a = 0; a < sl; a++){ //loops until a == side length\n\t\t\tfor(int b = 0; a < sl ; b++){ //loops until b == side length\n\t\t\t\t//q is initially set to zero. With each iteration of the b for-loop, the value of\n\t\t\t\t//out_array[a][b] is replaced with in_array[q], and q is incremented by 1. This means\n\t\t\t\t//that, for every iteration of the a for-loop, q is incremented by sl\n\t\t\t\tout_array[a][b] = in_array1d[q]; \n\t\t\t\tq = q + 1;\n\t\t\t\t}\n\t\t\t}\n\t\treturn out_array;\n\t\t}", "public double[] getColumnPackedCopy() {\n double[] vals = new double[m*n];\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n vals[i+j*m] = data[i][j];\n }\n }\n return vals;\n }", "public Matrix extract(){\r\n\t\t\r\n\t\tDouble[][] newVal = new Double[col][row - 1];\r\n\t\t\r\n\t\tfor(Double[] row: AllVal){\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public static void print2DArr1(int[][] myArr2D)\n {\n for(int row = 0; row < myArr2D.length; row++)\n { \n for( int col = 0; col < myArr2D[row].length; col++)\n {\n if(col == myArr2D[row].length-1)\n System.out.format(\"%4d%n\",myArr2D[row][col]);\n else\n System.out.format(\"%4d\",myArr2D[row][col]);\n }\n }\n }", "public static void main(String[] args) { \r\n int[][] a = new int[3][5]; // прямоугольный массив\r\n int size1 = a.length;\r\n int size2 = a[0].length;\r\n int[][] b = new int[3][]; // массив переменной длины (тут - треугольный)\r\n b[0] = new int[1];\r\n b[1] = new int[2];\r\n b[2] = new int[3];\r\n int c[] = new int[] {1,2,3,};\r\n c = new int[]{0,1,2,3}; // а вот так не сработает: c = {0,1,2,3};\r\n \r\n int[] array1D= {0,1,2,3}; \r\n int[][] array2D= {{0,1,5,10},{2,3,1,0,5,55,16},{0,1}};\r\n int[][][] array3D= {\r\n { {2,3,1,0},\r\n {2,3,1,0},\r\n {2,3,1,0}},\r\n \r\n { {2,3,1,0},\r\n {2,3,1,0},\r\n {2,3,1,0}},\r\n \r\n { {2,3,1,0},\r\n {2,3,1,0},\r\n {2,3,1,0}}};\r\n System.out.println(\"============array1D==========\");\r\n System.out.println(array1D);\r\n System.out.println(Arrays.toString(array1D)); //Работает на глубину одного измерения (для одномерных масивов)\r\n System.out.println(\"============array2D==========\");\r\n System.out.println(array2D);\r\n System.out.println(Arrays.toString(array2D)); \r\n System.out.println(Arrays.deepToString(array2D));\r\n System.out.println(\"============array3D==========\");\r\n System.out.println(array3D);\r\n System.out.println(Arrays.toString(array3D));\r\n System.out.println(Arrays.deepToString(array3D));\r\n }", "public void printArray1D(int[] array1D) {\r\n\t\tfor (int i = 0; i < array1D.length; i++) {\r\n\t\t\tSystem.out.print(array1D[i] + \", \");\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println();\r\n\t}", "private int[][] convertTo2D(char[] array1D)\n {\n int n = (int) Math.sqrt(array1D.length);\n int[][] array2D = new int[n][n];\n \n for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < n; j++)\n {\n array2D[i][j] = (int) (array1D[i * n + j]);\n }\n }\n \n return array2D;\n }", "public static void print1DArr(int[] myArr1D)\n {\n for(int i = 0; i < myArr1D.length; i++)\n {\n if(i == myArr1D.length-1)\n System.out.format(\"%4d%n\",myArr1D[i]);\n else\n System.out.format(\"%4d\", myArr1D[i]);\n }\n }", "public static void extract (int []n1, int off1, int n2[], int off2, int len2) {\n\t\tfor (int i = 0; i < len2; i++) {\n\t\t\tn1[off1+i] = n2[off2+i];\n\t\t}\n\t}", "private static void demoMultiDArrays() {\r\n\t\tint[][] nums = new int[3][5];\r\n\t\tnums[0][2] = 10;\r\n//\t\tcompact, hard to read version: **note: slower. its worse in every way.**\r\n//\t\tnums[nums.length-1][nums[nums.length-1].length-1] = 14;\r\n\t\tint lastRow = nums.length-1;\r\n\t\tint lastCol = nums[lastRow].length-1;\r\n\t\tnums[lastRow][lastCol] = 14;\r\n//\t\tcompact, hard to read version: **note: slower. its worse in every way.**\r\n//\t\tnums[0][0] = nums[0][2] + nums[nums.length-1][nums[nums.length-1].length-1];\r\n\t\tnums[0][0] = nums[0][2]+nums[lastRow][lastCol];\r\n\t\t\r\n\t\t//return length of the cols in nums\r\n\t\t//return the length of the rows in nums\r\n\t\tfor (int[] rowData : nums) {\r\n\t\t\tSystem.out.print(\"[\");\r\n\t\t\tfor (int colData : rowData) {\r\n\t\t\t\tSystem.out.print(colData);\r\n\t\t\t\tSystem.out.print(\",\\t\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"], \");\r\n\t\t}\r\n\t\t\r\n\t}", "private int getSumD2(int[][] a) {\n int sum = 0;\n\n int jd1 = 0;\n int jd2 = a.length - 1;\n while (jd1 < a.length) {\n sum += a[jd1][jd2];\n jd2--;\n jd1++;\n }\n return sum;\n }", "public int[][] create2DArrayFrom1D(int[] array1D, int height, int width) {\r\n\t\t//printArray1D(array1D);\r\n\t\tint[][] array2D = new int[height][width];\r\n\t\tfor (int i = 0; i < height; i++) {\r\n\t\t\tfor (int j = 0; j < width; j++) {\r\n\t\t\t\t//System.out.println(\"i: \"+i+\" j: \"+j+\" width: \"+width);\r\n\t\t\t\tarray2D[i][j] = array1D[i * width + j];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//printArray2D(array2D);\r\n\t\treturn array2D;\r\n\t}", "public static void print2DArr2(int[][] myArr2D)\n {\n for(int row = 0; row <myArr2D.length; row++)\n print1DArr(myArr2D[row]);\n }", "public static void main(String [] args) {\n\t\tint [][] numbers =new int[2][3];\n\t\t\n\t //enter into array into row index 0 and column index 2\n\t\tnumbers[0][2] =8; \n\t\tnumbers[1][0] =5;\n\t\tnumbers[0][0] =9;\n\t\tnumbers[0][1] =6;\n\t\tnumbers[1][1] =2;\n\t\tnumbers[1][2]= 3;\n\t\t\n\t\n\t\t\n\t\t\n\t\t//2nd way of creating 2D-Array\n\t\tint [][] numbers2 = {{5,6,8},\n\t\t\t\t {9,2,3}\n\t\t };\n\t\t\n\t\tSystem.out.println(\"Let`s get some values from numbers2\");\n\t\t//first get it, then print it\n\t\tint value =numbers2[1][0];\n System.out.println(value);\n \n //get and print in one step\n System.out.println(numbers2[1][1]);\n\t \n \n //1D array is married to for loop\n //2D array is married to nested loop\n \n \n //how many rows?\n int row= numbers2.length;\n \n //how many coloumns iin first row?\n int coloumns=numbers2[0].length;\n \n for(int row=0; row<numbers2.length; row++) {\n \tSystem.out.println(\"I am in the \"+row+\" row\");\n \tfor(int col=0; col<numbers2[row].length; col++) {\n \t\tSystem.out.println(\"I am in the column\" +col);\n \t\tSystem.out.println(\"The value is \"+numbers2[row][col]);\n \t}\n \tSystem.out.println();\n }\n \n\n}", "public Object[] getColumn(int c) {\n// Object[] dta = new Object[data.rows];\n// for (int i = 0; i < data.rows; i++)\n// dta[i] = data.values[c][c];\n return data.values[c];\n }", "public T extractMatrix( int y0, int y1, int x0, int x1 ) {\n if (y0 == SimpleMatrix.END) y0 = mat.getNumRows();\n if (y1 == SimpleMatrix.END) y1 = mat.getNumRows();\n if (x0 == SimpleMatrix.END) x0 = mat.getNumCols();\n if (x1 == SimpleMatrix.END) x1 = mat.getNumCols();\n\n T ret = createMatrix(y1 - y0, x1 - x0, mat.getType());\n\n ops.extract(mat, y0, y1, x0, x1, ret.mat, 0, 0);\n\n return ret;\n }", "private static Object[][] getData(Database d) {\n\t\tdb = d;\n\t\tEntity[] data = db.getData();\n\t\tObject[][] toReturn = new Object[data.length][];\n\t\tfor(int i = 0; i < toReturn.length; i++) {\n\t\t\ttoReturn[i] = data[i].getObject();\n\t\t}\n\t\treturn toReturn;\n\t}", "public static void main(String[] args) {\n\t\tint[][] no1 = {{1,2,3},{4,5,6}};\r\n\t\t\r\n\t\tint[][] no2 = new int[3][2];\r\n\t\t\r\n\t\tfor(int[]arr : no1) {\r\n\t\t\tSystem.out.println(Arrays.toString(arr));\r\n\t\t}\r\n\t\tfor(int i=0; i<no2.length; i++) {\r\n\t\t\tfor(int j=0; j<no2[i].length; j++) {\r\n\t\t\t\tno2[i][j] = no1[j][i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t\tfor(int[]arr : no2) {\r\n\t\t\tSystem.out.println(Arrays.toString(arr));\r\n\t\t}\r\n\t}", "public void dorbdb6_(INTEGER M1,INTEGER M2,INTEGER N,double[] X1,INTEGER INCX1,double[] X2,INTEGER INCX2,double[] Q1,INTEGER LDQ1,double[] Q2,INTEGER LDQ2,double[] WORK,INTEGER LWORK,INTEGER INFO);", "public static void print1( int[][] a )\n {\n for(int x = 0; a.length > x; x++) { //for the amount of rows...\n\t for(int y = 0; a[x].length > y; y++){//...and for the length of the\n\t //nested array\n\t System.out.println(a[x][y]); //print out that specific array point\n\t }\n }\n }", "public static void main(String[] args) {\n int[][] array = {{1,3,6}, {5,6,7}};\n\n int[] a = array[1];\n int b = array[1][1];\n System.out.println(a[1]);\n System.out.println(b);\n }", "private String[][] twoDArray(LinkedList<QuadTree> Linked) {\n if (Linked.size() < 1) {\n return new String[0][0];\n } else if (Linked.size() == 1) {\n return new String[1][1];\n } else {\n int rowCount, columnCount;\n Set<Double> count = new HashSet<>();\n for (QuadTree q : Linked) {\n count.add(q.ullat);\n }\n rowCount = count.size();\n columnCount = Linked.size() / rowCount;\n return new String[rowCount][columnCount];\n }\n }", "static void TwoDimTrav(int[][] arr, int row, int col){\n\n int[] dr = new int[]{ -1, 1, 0, 0};\n int[] dc = new int[]{ 0, 0, 1, -1};\n\n for(int i = 0; i < 4; i++){\n int newRow = row + dr[i];\n int newCol = col + dc[i];\n\n if(newRow < 0 || newCol < 0 || newRow >= arr.length || newCol >= arr[0].length)\n continue;\n\n // do your code here\n\n }\n\n // All Directions\n // North, South, East, West, NW NE SW SE\n // dr = [ -1, 1, 0, 0 -1, -1, 1, 1 ]\n // dc = [ 0, 0, 1, -1 -1, 1, 1, -1 ]\n\n// int[] dr = new int[]{ -1, 1, 0, 0, -1, -1, 1, 1};\n// int[] dc = new int[]{ 0, 0, 1, -1, -1, 1, -1, 1};\n//\n// for(int i = 0; i < 8; i++){\n// int newRow = row + dr[i];\n// int newCol = col + dc[i];\n//\n// if(newRow < 0 || newCol < 0 || newRow >= arr.length || newCol >= arr[0].length)\n// continue;\n//\n// // do your code here\n//\n// }\n }", "public static void main(String[] args) {\n\t\t\n\t\tint[] arr1D = {1,2,3};\n\t\t\n\t//\t2 dimensional array: array that contains multiple 1 dimensional arrays\n\t\t\n\t\tint[][] arr2D = { {1,2,3} , {4,5,6} };\n\t\t\n\t\t\n\t\tString[] arr = {\"A\" ,\"B\"};\n\t\t\n\t\t//\t\t\t\t\t\t 0 1 0 1 2\n\t\tString[][] str2D = { {\"A\" ,\"B\"} , {\"C\" ,\"D\",\"E\"} };\n\t\t//\t\t\t\t\t\t\t 0 1\n\t\t\n// [represents the index number of 1 dimensional arrays ][ represents the index number of the values]\n\t\t\n\t\t\t\t// print A:\n\t\t\t\tSystem.out.println( str2D[0][0] );\n\t\t\t\t\n\t\t\t\t// print D:\n\t\t\t\tSystem.out.println( str2D[1][1] );\n\t\t\t\t\n\t\t\t\t//print E:\n\t\t\t\tSystem.out.println(str2D[1][2]);\n\t\t\n\t\t\t\t// print [A ,B]:\n\t\t\t\tSystem.out.println( str2D[0] );\n\t\t\t\tSystem.out.println( Arrays.toString( str2D[0] ) );\n\t\t\t\t\n\t\t\t\t// print [C, D, E]:\n\t\t\t\tSystem.out.println( str2D[1] );\n\t\t\t\tSystem.out.println( Arrays.toString( str2D[1] ));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//print [[A,B], [C, D, E]]\n\t\t\t\tSystem.out.println( Arrays.toString(str2D) );\n\t\t\t\tSystem.out.println( Arrays.deepToString( str2D ) );\n\t\n\t\t\t// Arrays.deepToString(variableName ): converts multi-Dimensional Arrays to STring value\n\t\t\t\n\t\t\t\t\n\t\t\t// \t 0 1 0 1 0 1 \n\t\t\tint[][] Numbers2D = {\t{1,2} , {3, 4} , {5, 6, 7, 8, 9 , 10} };\n\t\t\t//\t\t\t\t\t 0 1 2\n\t\t\t\t\n\t\t\t\t// print 6:\n\t\t\tSystem.out.println( Numbers2D[2][1] );\n\t\t\t\n\t\t\t\t// print 10:\n\t\t\tSystem.out.println( Numbers2D[2][5] );\n\t\t\t\n\t\t\t\t// print {5, 6, 7, 8, 9 , 10}:\n\t\t\tSystem.out.println( Numbers2D[2] );\n\t\t\tSystem.out.println( Arrays.toString( Numbers2D[2] ) );\n\t\t\t\n\t\t\t\t// print the entire 2D array:\n\t\t\tSystem.out.println(Arrays.deepToString( Numbers2D ));\n\t\t\t\t\n\t\t\t\t\n\t\t// 3 dimensional array contains multiple 2 dimensional arrays\n\t\tint[][] Array2D = { {1,2}, {3,4} };\n\t\t//\t\t\t\t\t\t\t 0 1 0 1\n\t\tint[][][] Array3D = { { {1,2}, {3,4} } , { {5, 6}, {7, 8} } };\n// 0 1\t\n//[index numbers of 2D array][ index number of 1D array] [ index number of value]\n\n\t\t\t//print 8:\n\t\tSystem.out.println(Array3D[1][1][1]);\n\t\t\n\t\t// print {5, 6}:\n\t\tSystem.out.println( Array3D[1][0] );\n\t\tSystem.out.println( Arrays.toString( Array3D[1][0] ) );\n\t\t\n\t\t// print { {5, 6}, {7, 8} }:\n\t\tSystem.out.println( Array3D[1] );\n\t\tSystem.out.println( Arrays.toString( Array3D[1] ) );\n\t\tSystem.out.println( Arrays.deepToString( Array3D[1] ));\n\t\t\n\t\t\n\t\t// print the entire 3d array:\n\t\t\tSystem.out.println(Arrays.deepToString( Array3D ));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\tint[][][] numbers3D = { { {1,2} } , { {3,4} } };\t\n\t\t\n\t\t\n\t\t\n\t//\t4 dimensional array contains multiple 3 dimensional arrays\n\tint[][][][] numbers4D = { { { {1,2} } , { {3,4} } } , { { {1,2} } , { {3,4} } } };\t\n\t\n\t\n\t\n\t\n\t\t\n\t}", "public void determined0d1() {\n\n\t\tint upperBound = (int) (Math.log(this.numNVertices + this.numWVertices)); // pg 184 in paper\n\n\t\tthis.d0 = upperBound / 2;\n\t\tthis.d1 = upperBound;\n\n\t}", "@Override\n public Matrix idct(final MatrixView in) {\n check(in);\n double[][] out = new double[in.getRows()][in.getColumns()];\n double tmp1, tmp2, tmp3, tmp4;\n double tmpm0 = 0, tmpm1 = 0, tmpm2 = 0, tmpm3 = 0, tmpm4 = 0, tmpm5 = 0, tmpm6 = 0, tmpm7 = 0;\n double tmpm20, tmpm21, tmpm22, tmpm23, tmpm24, tmpm25, tmpm26, tmpm27 = 0;\n double[] outtmpmyi = null;\n\n for (int my = 0; my < in.getRows(); my += SIZE) {\n for (int mx = 0; mx < in.getColumns(); mx += SIZE) {\n for (int i = 0; i < 8; i++) {\n outtmpmyi = out[my + i];\n\n tmpm0 = in.getDouble(my + i, mx + 0);\n tmpm1 = in.getDouble(my + i, mx + 1);\n tmpm2 = in.getDouble(my + i, mx + 2);\n tmpm3 = in.getDouble(my + i, mx + 3);\n tmpm4 = in.getDouble(my + i, mx + 4);\n tmpm5 = in.getDouble(my + i, mx + 5);\n tmpm6 = in.getDouble(my + i, mx + 6);\n tmpm7 = in.getDouble(my + i, mx + 7);\n\n tmp1 = (tmpm1 * Z7) - (tmpm7 * Z1);\n tmp4 = (tmpm7 * Z7) + (tmpm1 * Z1);\n tmp2 = (tmpm5 * Z3) - (tmpm3 * Z5);\n tmp3 = (tmpm3 * Z3) + (tmpm5 * Z5);\n\n tmpm20 = (tmpm0 + tmpm4) * Z4;\n tmpm21 = (tmpm0 - tmpm4) * Z4;\n tmpm22 = (tmpm2 * Z6) - (tmpm6 * Z2);\n tmpm23 = (tmpm6 * Z6) + (tmpm2 * Z2);\n tmpm4 = tmp1 + tmp2;\n tmpm25 = tmp1 - tmp2;\n tmpm26 = tmp4 - tmp3;\n tmpm7 = tmp4 + tmp3;\n\n tmpm5 = (tmpm26 - tmpm25) * Z0;\n tmpm6 = (tmpm26 + tmpm25) * Z0;\n tmpm0 = tmpm20 + tmpm23;\n tmpm1 = tmpm21 + tmpm22;\n tmpm2 = tmpm21 - tmpm22;\n tmpm3 = tmpm20 - tmpm23;\n\n outtmpmyi[mx + 0] = tmpm0 + tmpm7;\n outtmpmyi[mx + 7] = tmpm0 - tmpm7;\n outtmpmyi[mx + 1] = tmpm1 + tmpm6;\n outtmpmyi[mx + 6] = tmpm1 - tmpm6;\n outtmpmyi[mx + 2] = tmpm2 + tmpm5;\n outtmpmyi[mx + 5] = tmpm2 - tmpm5;\n outtmpmyi[mx + 3] = tmpm3 + tmpm4;\n outtmpmyi[mx + 4] = tmpm3 - tmpm4;\n\n }\n\n for (int i = 0; i < 8; i++) {\n\n tmpm0 = out[my + 0][mx + i];\n tmpm1 = out[my + 1][mx + i];\n tmpm2 = out[my + 2][mx + i];\n tmpm3 = out[my + 3][mx + i];\n tmpm4 = out[my + 4][mx + i];\n tmpm5 = out[my + 5][mx + i];\n tmpm6 = out[my + 6][mx + i];\n tmpm7 = out[my + 7][mx + i];\n\n tmp1 = (tmpm1 * Z7) - (tmpm7 * Z1);\n tmp4 = (tmpm7 * Z7) + (tmpm1 * Z1);\n tmp2 = (tmpm5 * Z3) - (tmpm3 * Z5);\n tmp3 = (tmpm3 * Z3) + (tmpm5 * Z5);\n\n tmpm20 = (tmpm0 + tmpm4) * Z4;\n tmpm21 = (tmpm0 - tmpm4) * Z4;\n tmpm22 = (tmpm2 * Z6) - (tmpm6 * Z2);\n tmpm23 = (tmpm6 * Z6) + (tmpm2 * Z2);\n tmpm4 = tmp1 + tmp2;\n tmpm25 = tmp1 - tmp2;\n tmpm26 = tmp4 - tmp3;\n tmpm7 = tmp4 + tmp3;\n\n tmpm5 = (tmpm26 - tmpm25) * Z0;\n tmpm6 = (tmpm26 + tmpm25) * Z0;\n tmpm0 = tmpm20 + tmpm23;\n tmpm1 = tmpm21 + tmpm22;\n tmpm2 = tmpm21 - tmpm22;\n tmpm3 = tmpm20 - tmpm23;\n\n out[my + 0][mx + i] = tmpm0 + tmpm7;\n out[my + 7][mx + i] = tmpm0 - tmpm7;\n out[my + 1][mx + i] = tmpm1 + tmpm6;\n out[my + 6][mx + i] = tmpm1 - tmpm6;\n out[my + 2][mx + i] = tmpm2 + tmpm5;\n out[my + 5][mx + i] = tmpm2 - tmpm5;\n out[my + 3][mx + i] = tmpm3 + tmpm4;\n out[my + 4][mx + i] = tmpm3 - tmpm4;\n }\n }\n }\n\n return new DoubleMatrix(in.getRows(), in.getColumns(), out);\n }", "public double[] getRowPackedCopy() {\n double[] vals = new double[m*n];\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n vals[i*n+j] = data[i][j];\n }\n }\n return vals;\n }", "public static void main(String args[]){\n int int2DArr[][] = new int[4][5];\n int k=0;\n for (int i=0;i<4;i++) {\n for (int j=0;j<5;j++){\n int2DArr[i][j] = k++;\n }\n }\n for (int i=0;i<4;i++) {\n for (int j=0;j<5;j++){\n System.out.print(int2DArr[i][j] + \" \");\n }\n System.out.println();\n }\n }", "public static void main(String[] args) {\n double[][] dArray = new double[5][4];\n\n dArray[2][1] = 3;\n \n //Use initializer to create array\n int[][] arr = {{1,2,3},{4,5,6},{7,8,9}};\n\n int rows = dArray.length;\n // Each row can have a different number of columns (but we will not use that)\n int columns = dArray[0].length;\n int total_entries = rows * columns;\n\n // Walk through 2D array example\n for(int r = 0; r < dArray.length; r++) {\n for(int c = 0; c < dArray[r].length; c++) {\n dArray[r][c] = 2 * r + c;\n }\n }\n\n for(int r = 0; r < dArray.length; r++) {\n for(int c = 0; c < dArray[r].length; c++) {\n System.out.print(dArray[r][c] + \" \");\n }\n System.out.print(\"\\n\");\n }\n\n for(int r = 0; r < arr.length; r++) {\n for(int c = 0; c < arr[r].length; c++) {\n System.out.print(arr[r][c] + \" \");\n }\n System.out.print(\"\\n\");\n }\n\n System.out.println(total_entries);\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 }", "private Cell[] concatArray(Cell[] arr1, Cell[] arr2) {\r\n\t\tCell[] concat = new Cell[arr1.length + arr2.length];\r\n\t\tfor (int k = 0; k < concat.length; k++) {\r\n\t\t\tif (k < arr1.length) {\r\n\t\t\t\tconcat[k] = arr1[k];\r\n\t\t\t} else {\r\n\t\t\t\tconcat[k] = arr2[k - arr1.length];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn concat;\r\n\t}", "private int getSumD1(int[][] a) {\n int sum = 0;\n for (int j = 0; j < a.length; j++) {\n sum += a[j][j];\n }\n return sum;\n }", "public int getXD1 ()\n\t{\n\t\treturn xDimension1;\n\t}", "private Board swapTiles1d(short[] swap1, short[] swap2) {\n short[][] arr = tempArray(arr1d, N);\n int[][] tempTiles = new int[N][N];\n for (int i = 0; i < N; i++)\n for (int j = 0; j < N; j++)\n tempTiles[i][j] = (int) arr[i][j];\n int temp = tempTiles[swap1[0]][swap1[1]];\n tempTiles[swap1[0]][swap1[1]] = tempTiles[swap2[0]][swap2[1]];\n tempTiles[swap2[0]][swap2[1]] = temp;\n return new Board(tempTiles);\n }", "public int[][] get2DAsteroids(){\n int[][] result = new int[field.length][2];\n for (int i = 0; i<field.length;i++){\n //casting to int maybe inaccurate but this is used for 2d representation so its not that important\n //NOTE: being able to access the x and y fields is very unsafe (getters/setters?)\n result[i][0] = (int)field[i].x;\n result[i][1] = (int)field[i].y;\n }\n return result;\n }", "public void dorcsd2by1_(CHARACTER JOBU1,CHARACTER JOBU2,CHARACTER JOBV1T,INTEGER M,INTEGER P,INTEGER Q,double[] X11,INTEGER LDX11,double[] X21,INTEGER LDX21,double[] THETA,double[] U1,INTEGER LDU1,double[] U2,INTEGER LDU2,double[] V1T,INTEGER LDV1T,double[] WORK,INTEGER LWORK,int[] IWORK,INTEGER INFO);", "public int[] boardConvertto1d() {\n for (int i = 0; i < 9; i++) {\n int row = i / 3;\n int col = i % 3;\n board[i] = board2d[row][col];\n }\n return board;\n }", "public int getd1() {\n\t\treturn d1;\n\t}", "private int xyTo1D(final int row, final int col) {\n return (row - 1) * size + (col - 1);\n }", "public long[][] getS1() {\n\t\treturn S1;\n\t}", "public Double[][] toPresent() throws IndexOutOfBoundsException;", "public int[] create1DArrayFrom2D(int[][] array2D) {\r\n\t\t//printArray2D(array2D);\r\n\t\tint[] array1D = new int[array2D.length * array2D[0].length];\r\n\t\tfor (int i = 0; i < array2D.length; i++) {\r\n\t\t\tfor (int j = 0; j < array2D[i].length; j++) {\r\n\t\t\t\t//System.out.println(\"i: \"+i+\" j: \"+j+\" length: \"+array2D[0].length);\r\n\t\t\t\tarray1D[i * array2D[0].length + j] = array2D[i][j];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//printArray1D(array1D);\r\n\t\treturn array1D;\r\n\t}", "static int[][] getColumns(int[] array){\n int[][] rezultArray = new int[n][n];\n int index = 0;\n for (int i = 0; i < n; i++){\n for (int j = i; j < n * n; j += n){\n rezultArray[i][index++] = array[j];\n }\n index = 0;\n }\n return rezultArray;\n }", "private void populateFieldArray() \r\n\t{\r\n\t\tInteger fieldId;\r\n\t\t/** get input column names which is populated based on the input file\r\n\t\t * format specified in the command file */\r\n\t\tString [] inputColNames = getInputColNames();\r\n\t\tint arrLength; /** Number of columns in the input file*/\r\n\t\tif (null == inputColNames)\r\n\t\t{\r\n\t\t\t/** set array length 2 for two default columns (probeset and chip description)*/\r\n\t\t\tarrLength = 2; \r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/** Basic Probeset ID and description fields are present for all files \r\n\t\t\t * but the other supplementary information like accession number, unigene and\r\n\t\t\t * entrezgene ids may be present one or many based on the file format */\r\n\t\t\tarrLength = 2 + inputColNames.length; /** add other columns*/\r\n\t\t}\r\n\t\t/** Field array base elements are Probeset and Chip_Desc plus any of acc_no, ugid, & locusid/organism */\r\n\t\tfieldIndexArray = new int [arrLength];\r\n\t\t\r\n\t\t/** Now 0th field in input file is probeset*/\r\n\t\tfieldIndexArray[0] = ((Integer) fieldIdTable.get(\"CIN_PROBESET\")).intValue();\r\n\t\t\r\n\t\tif (inputColNames != null) \r\n\t\t{\r\n\t\t\t/** get the field ids for all column names*/\r\n\t\t\tfor (int i=0; i< inputColNames.length; i++)\r\n\t\t\t{\r\n\t\t\t\t/** Pick up the column from the list of inout columns as obtained based on\r\n\t\t\t\t * the input file format. Then fetch its ID from the FieldIdTable */\r\n\t\t\t\tfieldId = (Integer) fieldIdTable.get(inputColNames[i].toUpperCase());\r\n\t\t\t\tif (null == fieldId)\r\n\t\t\t\t{\r\n\t\t\t\t\t/** no such column name allowed*/\r\n\t\t\t\t\tLogger.log(\"Column name \" + inputColNames[i] + \" is not a valid name\",Logger.WARNING);\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/** add the field id to the index array. Thus fieldIndexArray will have all the \r\n\t\t\t\t\t * column names depending on the file format*/\r\n\t\t\t\t\tfieldIndexArray[1+i] = fieldId.intValue();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t/** ChipDesc field is the last column in the input file. First we have added the default first field\r\n\t\t * as probeset id , then all the middle fields based on the file format and now the last default\r\n\t\t * field which is chipdescription */\r\n\t\tfieldIndexArray[fieldIndexArray.length-1] = ((Integer) fieldIdTable.get(\"CIN_CHIP_DESCRIPTION\")).intValue();\r\n\t\tLogger.log(\"populateFieldArray complete \",Logger.DEBUG);\r\n\t}", "public static double[][] array1Dto2D(int[] matrixVal) {\n int size = (int) Math.sqrt(matrixVal.length);\n double[][] values = new double[size][size];\n int i, j, k;\n for (i = 0, k = 0; i < size; ++i) {\n for (j = 0; j < size; ++j) {\n values[i][j] = matrixVal[k];\n k++;\n }\n }\n return values;\n }", "public static void main(String[] args) {\n\t\tint[][] array = new int[5][6];\r\n\t\tint[] x = {1,2};array[0] = x;\r\n\t\tSystem.out.println(\"array[0][1] is \" + array[0][1]);\r\n\t\tSystem.out.println(Arrays.deepToString(array));\r\n\t\t\r\n\t\tint[][] arr = {{1,2}, {3,4}, {5,6}};\r\n\t\tfor (int i = arr.length - 1; i >= 0; i--) \r\n\t\t{for (int j = arr[i].length - 1; j >= 0; j--)\r\n\t\t\tSystem.out.print(arr[i][j] + \" \");\r\n\t\tSystem.out.println();\r\n\t\t}\r\n\t\tint[][] array1 = {{1,2}, {3,4}, {5,6}};\r\n\t\tint sum = 0;\r\n\t\tfor (int i = 0; i < array1.length; i++)\r\n\t\t\tsum += array1[i][0];\r\n\t\tSystem.out.println(sum);\r\n\t\r\n\tint [][]matrix = new int [10] [10];\r\n\t\r\n\tfor (int row = 0; row < matrix.length; row++) {\r\n\t\tfor (int column = 0; column < matrix[row].length; column++) {\r\n\t\tmatrix[row][column] = (int)(Math.random() * 100); }}\r\n\tSystem.out.println(Arrays.deepToString(matrix));\r\n\r\n\tfor (int i = 0; i < matrix.length; i++) {\r\n\t\tfor (int j = 0; j < matrix[i].length; j++) {\r\n\t\t\tint i1 = (int)(Math.random() * matrix.length);\r\n\t\t\tint j1 = (int)(Math.random() * matrix[i].length);\r\n\t\t\tint temp = matrix[i][j];\r\n\t\t\tmatrix[i][j] = matrix[i1][j1];\r\n\t\t\tmatrix[i1][j1] = temp;\r\n\t\t}\r\n\t}System.out.println(Arrays.deepToString(matrix));\r\n\t}", "private int xyTo1D(int row, int col)\n {\n validate(row, col);\n return (row-1) * gridSize + col-1;\n }", "public void displayData(int[][] arr);", "public void dorbdb5_(INTEGER M1,INTEGER M2,INTEGER N,double[] X1,INTEGER INCX1,double[] X2,INTEGER INCX2,double[] Q1,INTEGER LDQ1,double[] Q2,INTEGER LDQ2,double[] WORK,INTEGER LWORK,INTEGER INFO);", "private void collectTags\n (int[] i, int i0, int i1, long[] T) {\n for (int o=i0; o<i1; o++) // 1\n T[o] = data[i[o]]; // 1\n }", "private void printBoards(int[][] g1) {\n for(int i=0;i<g1.length;i++){\n for(int j=0;j<g1[i].length;j++){\n System.out.print(g1[i][j]); \n }\n System.out.println();\n }\n }", "public static void main(String[] args) {\n\t\tlong[] Longarr = {20, 400, 500, 300, 10, 20};\n\t\tSystem.out.println(Arrays.toString(Longarr)); // [20, 400, 500, 300, 10, 20]\n\t\t\t\t\t\t\t\t// I we do not use sort method\n\t\t\n\t\tArrays.sort(Longarr); \n\t\tSystem.out.println(Arrays.toString(Longarr)); // [10, 20, 20, 300, 400, 500]\n\t\t\n\t\t\n\t\t\n\t\t\t\tSystem.out.println(\"---------------------------------------\");\n\t\n\t\t\n\t\t\n\t\t// deepToString():\n\t\t\n\t\tint[][] arr2D = { {1,2}, {3,4} } ;\n\t\t// index 0 1\n\t\t\n\t\tSystem.out.println(Arrays.toString(arr2D)); // [[I@4517d9a3, [I@372f7a8d]\n\t\t\t\t\t\t\t\t\t\t // because arrays.toString cannot convert MD arrays to String\n\t\t\n\t\tSystem.out.println(Arrays.deepToString(arr2D)); // [[1, 2], [3, 4]]\n\t\t\n\t\t\n\t\t\n\t\t\t\tSystem.out.println(\"-----------------------------------------\");\n\t\t\t\t\n\t\t\n\t\t// in 2D array: [index number of 1D arrays][index number of values]\n\t\t \n\t\t\n\t\t// print :{3,4}\n\t\tSystem.out.println(arr2D[1]); // [I@372f7a8d ==> needs to be converted to String\n\t\tSystem.out.println(Arrays.toString(arr2D[1])); // [3, 4]\n\t\t\n\t\t// print :4\n System.out.println(arr2D[1][1]); //4\n\t\t\n\t\t// arr2D = { {1,2}, {3,4} } ;\n\t\tfor(int[]each1DArray: arr2D) {\n\t\t\tfor(int eachValue : each1DArray) {\n\t\t\t\tSystem.out.print(eachValue); // 1234\n\t\t\t}\n\t\t\t\n\t\t\t // System.out.println(Arrays.toString(each1DArray)); // [3, 4]\n\t\t}\n\t\t\n\t}", "public static double[][] array1Dto2D(Integer[] matrixVal) {\n int size = (int) Math.sqrt(matrixVal.length);\n double[][] values = new double[size][size];\n int i, j, k;\n for (i = 0, k = 0; i < size; ++i) {\n for (j = 0; j < size; ++j) {\n values[i][j] = matrixVal[k];\n k++;\n }\n }\n return values;\n }", "public static void main(String[] args) {\n\t\tint[][] t1 = new int[4][];\r\n\t\tt1[0]= new int[4];\r\n\t\tSystem.out.println(t1[0]);\r\n\t\tSystem.out.println(t1[0][0]);\r\n\t\tint[][] t2 = {{1,2,3,4,5},{44,66,77,99,12,21},{11,22}};\r\n\t\tfor(int i=0 ; i<t2.length;i++) {\r\n\t\t\tfor(int j=0 ; j < t2[i].length ;j++) {\r\n\t\t\t\tSystem.out.print(t2[i][j]+\" \");\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\r\n\t\t\t}\r\n\t\tchar[][]s = {\r\n\t\t\t\t{'x','x','x'},\r\n\t\t\t\t{'x','o','x'},\r\n\t\t\t\t{'x','x','o'},\r\n\t\t\t\t{'x','x','x'}\r\n\t\t};\r\n\t\t\r\n\t\tfor(int i=0 ; i<s.length ; i++) {\r\n\t\t\tfor(int j=0 ; j<s[i].length;j++) {\r\n\t\t\t\tif(s[i][j]=='o') {\r\n\t\t\t\t\tSystem.out.printf(\"[%2d행%2d열}%n\",i,j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t}", "public Object[][] get2DArray();", "public int getYD1 ()\n\t{\n\t\treturn yDimension1;\n\t}", "public static DoubleMatrixDataset<String, String> parseGeoTables(String fileInput, boolean debug) throws IOException {\n System.out.println(\"\\tNow parsing file: \"+fileInput);\n LinkedHashSet<Integer> desiredColPos = new LinkedHashSet<Integer>();\n \n int columnOffset = 1;\n int rowOffset = 1;\n TextFile in = new TextFile(fileInput, TextFile.R);\n String str = in.readLine(); // header\n while (str.startsWith(\"#\") || str.startsWith(\"\\\"#\") || str.matches(\"^\\\\s*$\") || str.equals(\"\") || str.startsWith(\"This is our raw data.\") || str.matches(\"^GSM[0-9]+.*\")\n || str.startsWith(\"Illumina Inc. GenomeStudio\") || str.startsWith(\"Array Content =\") || str.startsWith(\"Normalization =\") || str.startsWith(\"log\")) {\n str = in.readLine();\n rowOffset++;\n }\n \n String[] headerData = SPLIT_ON_TAB.split(str);\n String str2 = in.readLine();\n String[] nextRowData = SPLIT_ON_TAB.split(str2);\n \n for (int s = 0; s < headerData.length; s++) {\n if ((headerData[s].toLowerCase().contains(\"probe\") && headerData[s].toLowerCase().contains(\"id\")) || (headerData[s].toLowerCase().contains(\"ref\") && headerData[s].toLowerCase().contains(\"id\")) || (headerData[s].toLowerCase().contains(\"array\") && headerData[s].toLowerCase().contains(\"address\"))) {\n columnOffset = (s + 1);\n break;\n }\n }\n int tmpCols = (headerData.length - columnOffset);\n \n LinkedHashMap<String, Integer> colMap = new LinkedHashMap<String, Integer>((int) Math.ceil(tmpCols / 0.75));\n \n int storedCols = 0;\n \n for (int s = 0; s < tmpCols; s++) {\n String colName = headerData[s + columnOffset];\n if (!colMap.containsKey(colName) && !colName.equals(\"\") && !colName.equalsIgnoreCase(\"Target ID\") && !colName.equalsIgnoreCase(\"TargetID\") && !colName.equalsIgnoreCase(\"Probe ID\") && !colName.toLowerCase().contains(\".p=\") && !colName.toLowerCase().contains(\"pval\") && !colName.toLowerCase().contains(\"detection\") && !colName.toLowerCase().contains(\"p-val\") && !colName.toLowerCase().contains(\"array\") && !colName.toLowerCase().contains(\"bead\")) {\n if((nextRowData.length > (s+columnOffset))){\n if((isNumeric(nextRowData[ s + columnOffset]))) {\n colMap.put(colName, storedCols);\n desiredColPos.add(s+columnOffset);\n storedCols++;\n } else if(debug) {\n System.out.println(\"In non-numeric, entry: \"+nextRowData[s + columnOffset]);\n System.out.println(\"###############################\");\n }\n }\n } else if(colMap.containsKey(colName)) {\n LOGGER.warning(\"Duplicated column name:\" + colName + \"! In file: \" + fileInput);\n throw new IOException(\"Problem with parsing file\");\n } \n else if (debug) {\n System.out.println(\"Empthy colname:\"+colName.equals(\"\"));\n System.out.println(\"Colname contains \\\"target id\\\":\"+colName.equalsIgnoreCase(\"Target ID\"));\n System.out.println(\"Colname contains \\\"probe id\\\":\"+colName.equalsIgnoreCase(\"Probe ID\"));\n System.out.println(\"Colname contains \\\".p\\\":\"+colName.toLowerCase().contains(\".p=\"));\n System.out.println(\"Colname contains \\\"pval\\\":\"+colName.toLowerCase().contains(\"pval\"));\n System.out.println(\"Colname contains \\\"p-val\\\":\"+colName.toLowerCase().contains(\"p-val\"));\n System.out.println(\"Colname contains \\\"detection\\\":\"+colName.toLowerCase().contains(\"detection\"));\n System.out.println(\"Colname contains \\\"array\\\":\"+colName.toLowerCase().contains(\"array\"));\n System.out.println(\"Colname contains \\\"bead\\\":\"+colName.toLowerCase().contains(\"bead\"));\n System.out.println(\"###############################\");\n }\n }\n if (colMap.size() == 0) {\n if(debug){\n System.out.println(\"#Nothing added for this file: \"+fileInput+\". First two rows:\");\n System.out.println(\"Parsing of values oke? \"+ isNumeric(nextRowData[columnOffset]));\n System.out.println(str);\n System.out.println(str2);\n System.out.println(fileInput);\n }\n return null;\n }\n int tmpRows = 1;\n \n while (in.readLine() != null) {\n tmpRows++;\n }\n \n in.close();\n \n double[][] initialMatrix = new double[tmpRows][storedCols];\n \n in.open();\n String headerRow = null;\n for (int i = 0; i < rowOffset; ++i) {\n headerRow = in.readLine(); // read header\n }\n int row = 0;\n \n LinkedHashMap<String, Integer> rowMap = new LinkedHashMap<String, Integer>((int) Math.ceil(tmpRows / 0.75));\n \n boolean correctData = true;\n while ((str = in.readLine()) != null) {\n String[] data = SPLIT_ON_TAB.split(str);\n if(data.length == headerData.length){\n if (!rowMap.containsKey(data[columnOffset - 1])) {\n rowMap.put(data[columnOffset - 1], row);\n int columnToPut = 0;\n for (int s : desiredColPos) {\n double d;\n try {\n d = Double.parseDouble(data[s]);\n } catch (NumberFormatException e) {\n correctData = false;\n d = Double.NaN;\n }\n initialMatrix[row][columnToPut] = d;\n columnToPut++;\n }\n row++;\n } else {\n LOGGER.warning(\"Duplicated row name!\");\n LOGGER.warning(\"Duplicated row name: \"+data[columnOffset - 1]);\n System.out.println(str);\n throw new IOException(\"Problem in reading file.\");\n }\n }\n }\n if (!correctData) {\n LOGGER.warning(\"Your data contains NaN/unparseable values!\");\n }\n in.close();\n \n DoubleMatrixDataset<String, String> dataset;\n \n if ((tmpRows * tmpCols) < (Integer.MAX_VALUE - 2)) {\n dataset = new SmallDoubleMatrixDataset<String, String>(new DenseDoubleMatrix2D(initialMatrix), rowMap, colMap);\n } else {\n DenseLargeDoubleMatrix2D matrix = new DenseLargeDoubleMatrix2D(tmpRows, tmpCols);\n matrix.assign(initialMatrix);\n dataset = new LargeDoubleMatrixDataset<String, String>(matrix, rowMap, colMap);\n }\n \n LOGGER.log(Level.INFO, \"''{0}'' has been loaded, nrRows: {1} nrCols: {2}\", new Object[]{fileInput, dataset.rows(), dataset.columns()});\n return dataset;\n }", "public int getElementArray1(int index)\n {\n return array1[index];\n }", "private Object getEntry( Object[] row, String rrName ) {\n Integer icol = colMap_.get( rrName );\n return icol == null ? null : row[ icol.intValue() ];\n }", "Nda<V> concatAt( int axis, Nda<V> other, Nda<V>... ndArrays );", "private static double[] getDimensions(Map<String, String> row) {\n\t\tint dimensionCount = row.size() - TRAIT_CLASSES.size() - 1; // -1 for authid column\n\t\tdouble[] dimensions = new double[dimensionCount];\n\t\tfor(int i = 0; i < dimensionCount; i++) {\n\t\t\tString columnName = \"D_\" + (i + 1);\n\t\t\tdimensions[i] = Double.parseDouble(row.get(columnName));\n\t\t}\n\t\treturn dimensions;\n\t}", "protected int xyTo1D(final int i, final int j) {\n return i * m + j;\n }", "private int xyTo1D(int i, int j) {\n return (mGridSize * (i - 1) + j);\n }", "public static void print2DArray(int input[][]) {\n int m = input.length;\n if (m == 0)\n return;\n int n = input[0].length;\n\n for (int i = 0; i < m; i++) {\n int k = i;\n while (k < m) {\n for (int j = 0; j < n; j++) {\n System.out.print(input[i][j] + \" \");\n }\n k++;\n System.out.println();\n }\n }\n }", "String[][] packData();", "public static void main(String[] args) {\n\t\tint[] marks = {10,20,30,60,40,50,70}; // element = 7\n\t\tint[] marks2 = new int[10]; \n\t\tmarks2[0] = 10;\n\t\tmarks2[1] = 10;\n\t\tmarks2[2] = 10;\n\t\tmarks2[3] = 10;\n\t\tmarks2[4] = 10;\n\t\tmarks2[5] = 10;\n\t\tmarks2[6] = 10;\n\t\tmarks2[7] = 10;\n\t\tmarks2[8] = 10;\n\t\tmarks2[9] = 10;\n\t\t\n\t\t// array works on index concept.\n\t\t// 7 - length of this array\n\t\t// highest index - 6\n\t\t// System.out.println(marks.length); // size = 7\n\t\t\n//\t\tfor(int i = 0; i < marks2.length; i++) {\n//\t\t\tSystem.out.println(marks2[i]);\n//\t\t}\n\t\t\n\t\tfor(int i = (marks.length-1) ; i >= 0 ;i--) {\n\t\t\tSystem.out.println(marks[i]);\n\t\t}\n\t\t\n\t\t// advantages\n\t\t// keep the collection\n\t\t// fastest available collection in any object oriented language\n\t\t// when we create array - we have to give size of that array \n\t\t// 10 of int(4) = 10*4 = 40 byte (JVM )\n\t\t\n\t\t// disavantage \n\t\t// array - we cannot chnage the size \n\t\t\n\t\t\n\t\t// multidimentional - 1D array\n\t\t// 2D array - 2 dimentions\n\t\tint[][] matrix = {{10,20},{20,30}}; // directly values \n\t\t\n\t\tint[][] matrix2 = new int[2][2]; // directly values\n\t\tmatrix2[0][0] = 10;\n\t\tmatrix2[0][1] = 20;\n\t\tmatrix2[1][0] = 20;\n\t\tmatrix2[1][1] = 30;\n\t\t\n\t\tint[][] matrix1 = new int[2][6]; // size\n\t\t// student 1 marks\n\t\tmatrix1[0][0] = 10;\n\t\tmatrix1[0][1] = 20;\n\t\tmatrix1[0][2] = 20;\n\t\tmatrix1[0][3] = 20;\n\t\tmatrix1[0][4] = 20;\n\t\tmatrix1[0][5] = 20;\n\t\t// student 2 marks\n\t\tmatrix1[1][0] = 10;\n\t\tmatrix1[1][1] = 20;\n\t\tmatrix1[1][2] = 20;\n\t\tmatrix1[1][3] = 20;\n\t\tmatrix1[1][4] = 20;\n\t\tmatrix1[1][5] = 20;\n\t\t\n\t\t\n\t\t\n\t}", "private int xyToOneD(int row, int col) {\n return ((row - 1) * grid.length) + (col - 1);\n }", "private void selectPlane(H5CompoundDS ds,int d1, int d2, int first) {\r\n\t\tds.clearData();\r\n\t\tlong[] selected = ds.getSelectedDims();\r\n\t\tlong[] start = ds.getStartDims();\r\n\t\tlong[] stride = ds.getStride( );\r\n\t\t//long[] d = en.getDims( );\r\n\t\t//long[] m = en.getMaxDims( );\r\n\t\tint[] selectedIndex = ds.getSelectedIndex( );\r\n\t\tArrays.fill(start, 0);\r\n\t\tArrays.fill(stride, 1);\r\n\t\tselected[0] = 1;\r\n\t\tselected[1] = d1;\r\n\t\tselected[2] = d2;\r\n\t\tstart[0] = first;\r\n\t\tselectedIndex[0] = 1;\r\n\t\tselectedIndex[1] = 2;\r\n\t\tselectedIndex[2] = 0;\r\n\t}", "public void printdia(int[][] array){\n\t\tint dim = array.length;\n\n\t for( int k = 0 ; k < dim * 2 ; k++ ) {\n\t for( int j = 0 ; j <= k ; j++ ) {\n\t int i = k - j;\n\t if( i < dim && j < dim ) {\n\t System.out.print( array[i][j] + \" \" );\n\t }\n\t }\n\t System.out.println();\n\t }\n\t}", "int FE_Extract(byte[] data1, int w1, int h1,\n int step1, byte[] buffer);", "public native short[][] __short2dArrayMethod( long __swiftObject, short[][] arg );", "public ReducedCellInfo[] getEntries(double delta)\r\n {\r\n\r\n ReducedCellInfo compareTo = DataBase[0];\r\n\r\n Vector< ReducedCellInfo > V = new Vector< ReducedCellInfo >( );\r\n\r\n for( int i = 1 ; i < 45 ; i++ )\r\n\r\n if ( DataBase[i].distance( compareTo ) < delta )\r\n V.addElement( DataBase[i] );\r\n\r\n return V.toArray( new ReducedCellInfo[ 0 ] );\r\n }", "@Override\n\tpublic Object getValueAt(int arg0, int arg1) {\n\t\treturn dataAll[arg0][arg1];\n\t}", "short[][] productionTable();", "public static void main(String[] args) {\n\t\t\r\n\t\tint[][] arr=new int[][]{{21,22},{32,25},{25,58}};\r\nfor (int i = 0; i < arr.length; i++) {\r\n\tfor (int j = 0; j < 2; j++) {\r\n\t\tSystem.out.println(arr[i][j]+\" \");\r\n\t\t\r\n\t}\r\n\tSystem.out.println(\" \");\r\n\t\r\n}\r\n//int[][][] arr2=new int[][][] {{{10,12},{30}},{{30,15},{80}}};\r\n//for (int i = 0; i < arr2.length; i++) {\r\n//\tfor (int j = 0; j < 2; j++) {\r\n//\t\tfor (int j2 = 0; j2 < 3; j2++) {\r\n//\t\t\tSystem.out.println(arr2[i][j][j2]+\" \");\r\n//\t\t\t\r\n//\t\t}\r\n//\t\tSystem.out.println(\" \");\r\n//\t\t\r\n//\t}\r\n//\t\r\n//}\r\n\t}", "public Object[][] retrieveDataRunTime(ArrayList<String> sortColumns, char[] rowDataTypes,Container container) {\n Object cellData;\r\n Object[][] data = new Object[this.viewSequence.size()][sortColumns.size()];\r\n// Datafacade \r\n int j;\r\n\r\n for (int i = 0; i < this.viewSequence.size(); i++) {\r\n j = 0;\r\n for (String column : sortColumns) {\r\n if (rowDataTypes[j] == 'N') {\r\n cellData = this.getMeasureColumnData(column, this.viewSequence.get(i));//this.getFieldValueBigDecimal(i,column);\r\n } else if (rowDataTypes[j] == 'C') {//\r\n try {\r\n String data1 = \"\";\r\n if (column.equalsIgnoreCase(\"A_TIME\") || column.equalsIgnoreCase(\"A_O_TIME\") || column.equalsIgnoreCase(\"TIME\")) {\r\n data1 = (this.getDimensionColumnDate(column, this.viewSequence.get(i)));\r\n } else {\r\n data1 = this.getDimensionColumnData(column, this.viewSequence.get(i));\r\n }\r\n cellData = data1;\r\n } catch (Exception exception) {\r\n cellData = this.getDimensionColumnData(column, this.viewSequence.get(i));\r\n }\r\n\r\n } else {\r\n try {\r\n BigDecimal bigDecimal1 = new BigDecimal(this.getDimensionColumnData(column, this.viewSequence.get(i)));\r\n cellData = bigDecimal1; //hardcoding not good assuming C is Dimension\r\n } catch (Exception exception) {\r\n //\r\n cellData = this.getDimensionColumnData(column, this.viewSequence.get(i));\r\n }\r\n }\r\n data[i][j] = cellData;\r\n j++;\r\n }\r\n }\r\n // long endTime = System.currentTimeMillis();\r\n// \r\n return data;\r\n }", "public double[] getColumn(int j) {\n\t double out[] = new double[data.length];\n for (int i = 0; i < data.length; i++) {\n out[i] = data[i][j];\n }\n return out;\n }", "private double[][] createTwoDArray(double[][] result, double[][] observed){\n //set up an array to hold the new merged data\n //the fist dimension is only 2 elements, one for each of the \n //arrays to be merged\n double[][] d = new double[2][result.length * result[0].length];\n \n //create an int counter to keep track of the index value for the \n //new array \n int index = 0;\n //cycle through both dimensions for the results and observed\n for (int i = 0; i < result.length; i++) {\n for (int j = 0; j < result[i].length; j++) {\n //add the values into the new array\n //observed in dimension 1\n d[0][index] = observed[i][j];\n //result in dimension 2\n d[1][index] = result[i][j];\n //inrement the index for the new array\n index++;\n }\n }\n //return the new 2D array\n return d;\n }", "public Object[] getRow(int r) {\n Object[] dta = new Object[data.columns];\n for (int i = 0; i < data.columns; i++)\n dta[i] = data.values[i][r];\n return dta;\n }", "Dimension[] getDimension()\n\t\t{\n\t\t\treturn d;\n\t\t}", "public char[] extract(int[][] warpedArray)\n {\n char[] result = new char[81];\n\n int startY, startX;\n\n // Crop 4 pixels off each edge for an array size divisible by 9. (56);\n int cellSize = (512 - 8) / 9;\n\n // Loop through each cell block, finding a value if it exists.\n StringBuilder sb = new StringBuilder();\n\n CellOCR cellOCR = new CellOCR(context);\n\n for (int y = 0; y < 9; y++) {\n\n startY = (y * cellSize) + 4;\n\n for (int x = 0; x < 9; x++) {\n startX = (x * cellSize) + 4;\n int[][] croppedCell = cropCell(startY, startX, cellSize, warpedArray);\n Bitmap croppedImage = Utils.intToBitmap(croppedCell);\n CellImage cellImage = new CellImage(croppedCell, croppedImage);\n result[(y * 9) + x] = cellOCR.computeDigit(cellImage);\n sb.append(result[(y * 9) + x]);\n }\n }\n\n result = sb.toString().toCharArray();\n\n return result;\n }", "public int arrayToHeap(DHeap_Item[] array1) \n {\n \tthis.size= array1.length;\n \tthis.array=array1.clone();\n \tint compCnt=0;\n \tfor (int i=parent(this.getSize()-1, this.d); i>=0; i--) {\n \t\tcompCnt+=heapifyDown(this ,i);\n \t}\n return compCnt;\n }", "Nda<V> concatAt( int axis, Nda<V> other );", "public static void main(String[] args) {\n\r\n\t\tString[] Array1D = {\"THIS IS A NEW ARRAY\", \"AND THE SECOND VALUE\"};\r\n\r\n\t\tSystem.out.println(\"Arrays: \"+Arrays.toString(Array1D));\r\n\t\t\r\n\t\tString[][] Array2D = {\r\n\t\t\t\t{\"THIS IS A NEW ARRAY 1 \", \"AND THE SECOND VALUE 1 \"},\r\n\t\t\t\t{\"THIS IS A NEW ARRAY 2\", \"AND THE SECOND VALUE 2 \"},\r\n\t\t\t\t{\"THIS IS A NEW ARRAY 3 \", \"AND THE SECOND VALUE 3 \"},\r\n\t\t\t\t{\"THIS IS A NEW ARRAY 4\", \"AND THE SECOND VALUE 4\"},\r\n\t\t};\r\n\r\n\t\tfor(String i: Array1D)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"i: \"+i);\r\n\t\t}\r\n\t\t\r\n\t\tfor(String[] i: Array2D)\r\n\t\t{\r\n\t\t\tfor(String j: i)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"i:\"+i.hashCode()+\" j: \"+j);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void main (String[] args) {\n int[][] twoD = new int[3][4];\n// Where x is an integer\n// [[x, x, x, x],\n// [x, x, x, x],\n// [x, x, x, x]]\n\n// int[][][] threeD = new int[3][4][3];\n\n// 4x3\n int[][] twoDInit = {{1, 3, 5}, {4, 3, 5}, {1, 4, 5}, {4, 3, 5}};\n\n for (int i = 0; i < twoDInit.length; i++) {\n for (int j = 0; j < twoDInit[i].length; j++) {\n System.out.println(twoDInit[i][j]);\n }\n }\n\n for (int[] ints : twoDInit) {\n for (int anInt : ints) {\n System.out.println(anInt);\n }\n }\n\n for (int i = 0; i < 5; i++) {\n for (int j = 0; j < 7; j++) {\n System.out.print(\"*\");\n }\n System.out.println();\n }\n\n for (int i = 0; i < 5; i++) {\n for (int j = 0; j < i + 1; j++) {\n System.out.print(\"*\");\n }\n System.out.println();\n }\n }", "public static void main(String[] args) {\r\n\t\t// creating 2D array\r\n//\t\tchar arrayCharacter[][] = new char[5][2];\r\n//\t\t// inserting values in it\r\n//\t\t//1st row\r\n//\t\tarrayCharacter[0][0] = 'a';\r\n//\t\tarrayCharacter[0][1] = 'b';\r\n//\t\t//2nd row\r\n//\t\tarrayCharacter[1][0] = 'c';\r\n//\t\tarrayCharacter[1][1] = 'd';\r\n//\t\t//3rd row\r\n//\t\tarrayCharacter[2][0] = 'e';\r\n//\t\tarrayCharacter[2][1] = 'f';\r\n//\t\t//4th row\r\n//\t\tarrayCharacter[3][0] = 'g';\r\n//\t\tarrayCharacter[3][1] = 'h';\r\n//\t\t//5th row\r\n//\t\tarrayCharacter[4][0] = 'i';\r\n//\t\tarrayCharacter[5][1] = 'j';\r\n\t\t\r\n\t\tchar arrayCharacter[][] = {{'a','b'},{'c','d'},{'e','f'},{'g','h'},{'i','j'}};\r\n\t\t\r\n//\t\tSystem.out.println(arrayCharacter[3][1]);\r\n//\t\tSystem.out.println(arrayCharacter[0][0]+\" \"+arrayCharacter[4][1]);\r\n\t\t\r\n//\t\tSystem.out.println(\"Number of rows: \"+arrayCharacter.length); // number of rows\r\n//\t\tSystem.out.println(\"Number of column: \"+arrayCharacter[0].length); // number of columns\r\n\t\t\r\n\t\t// traversing into 2D array -> using 2 for loops: 1st for loop for row & 2nd for loop or column\r\n//\t\tfor(int i=0;i<arrayCharacter.length; i++) { // traverses through rows\r\n//\t\t\tfor(int j=0; j<arrayCharacter[i].length; j++) { // traverses through column\r\n//\t\t\t\tSystem.out.print(arrayCharacter[i][j]+\"|\");\r\n//\t\t\t}\r\n//\t\t}\r\n\t\t\r\n\r\n\t\tint arrayInt[][] = {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15}};\r\n\t\t\r\n\t\tSystem.out.println(\"Number of rows: \"+arrayInt.length); // number of rows\r\n\t\tSystem.out.println(\"Number of column: \"+arrayInt[0].length); // number of columns\r\n\t\t\r\n\t\tfor(int i=0;i<arrayInt.length; i++) { // traverses through rows\r\n\t\t\tfor(int j=0; j<arrayInt[i].length; j++) { // traverses through column\r\n\t\t\t\tSystem.out.print(arrayInt[i][j]+\"|\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// Assignment:\r\n//\t\t\t1. 1D array => FirstName, LastName, DOB, Age then traverse through using both for & while loop to extract data\r\n//\t\t\t2. 2D array => Customer Name, email address, phone number then traverse through it using for loop to extract data -> try while as well\t\r\n\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\t\r\n\t\t\r\n\t\t\r\n\r\n\t}", "public static void pullOutSubArrays( GroupIDGen myGIDG, ArrayFloat data, // changed from ArrayInt\n ArraySpec spec, int[] extractionShape,\n int[] ones,\n HashMap<GroupID, Array> returnMap) {\n\n /*LOG.info(\"pullOutSubArrays passed ArraySpec: \" + spec.toString() +\n \" ex shape: \" + Utils.arrayToString(extractionShape));*/\n GroupID[] gids = myGIDG.getBoundingGroupIDs( spec, extractionShape);\n /*LOG.info(\"getBoundingGroupIDs: getBounding returned \" + gids.length + \" gids \" +\n \" for ArraySpec: \" + spec.toString() +\n \" ex shape: \" + Utils.arrayToString(extractionShape));*/\n\n ArraySpec tempArraySpec;\n ArrayFloat tempFloatArray; // changed form ArrayInt\n int[] readCorner = new int[extractionShape.length];\n\n for( GroupID gid : gids ) {\n //System.out.println(\"gid: \" + gid);\n\n tempArraySpec = getGIDArraySpec( spec, gid, extractionShape, ones);\n try {\n\n // note, the tempArraySpec is in the global space\n // need to translate that into the local space prior to pull out the subarray\n for( int i=0; i<readCorner.length; i++) {\n readCorner[i] = tempArraySpec.getCorner()[i] - spec.getCorner()[i];\n }\n\n //System.out.println(\"\\t\\tlocal read corner: \" + Utils.arrayToString(readCorner) );\n tempFloatArray = (ArrayFloat)data.sectionNoReduce(readCorner, tempArraySpec.getShape(), ones);\n\n /* \n System.out.println(\"\\tsubArray ( gid: \" + gid.toString(extractionShape) + \n \" ex shape: \" + Utils.arrayToString(extractionShape) + \")\" + \n \" read corner: \" + Utils.arrayToString(readCorner) + \n \" read shape: \" + Utils.arrayToString(tempArraySpec.getShape()) + \n \"\\n\"); \n */\n\n returnMap.put(gid, tempFloatArray);\n\n } catch (InvalidRangeException ire) {\n System.out.println(\"Caught an ire in GroupIDGen.pullOutSubArrays()\");\n }\n }\n\n return;\n }", "ArrayList<ArrayList<Cell>> cells(ArrayList<ArrayList<Double>> d) {\n ArrayList<ArrayList<Cell>> result1 = new ArrayList<ArrayList<Cell>>();\n for (int i = 0; i < d.size(); i = i + 1) {\n ArrayList<Cell> result = new ArrayList<Cell>();\n for (int j = 0; j < d.get(i).size(); j = j + 1) {\n double height = d.get(i).get(j);\n if (height <= 0.0) {\n result.add(new OceanCell(height, i, j));\n }\n else {\n result.add(new Cell(height, i, j));\n }\n }\n result1.add(result);\n }\n return result1;\n }", "public String get2dQuery() throws SQLException {\r\n String temp = \"\";\r\n String utemp = \"\";\r\n String sqlstr = \"\";\r\n String temp1 = \"\";\r\n String in_qry = \"\";\r\n\r\n int nocol = 0;\r\n\r\n Connection con = null;\r\n CallableStatement st = null;\r\n ResultSet rs = null;\r\n ProgenConnection pg = null;\r\n// pg = new ProgenConnection();\r\n nonViewByList = new ArrayList();\r\n nonViewByListRT = new ArrayList();\r\n\r\n\r\n sqlstr = this.headerQuery;\r\n nonViewbyColumnList = null;\r\n try {\r\n\r\n con = getConnection(this.elementIdForConn);\r\n st = con.prepareCall(sqlstr);\r\n rs = st.executeQuery();\r\n\r\n\r\n\r\n\r\n int i = 1;\r\n\r\n while (rs.next()) {\r\n temp = rs.getString(1).replace(\"'\", \"''\");\r\n /*\r\n * if (temp.length()>=30) temp1= temp.substring(1,20) +\"..\"\r\n * +temp.substring(temp.length()-5,temp.length()-1); else\r\n temp1=temp;\r\n */\r\n temp1 = \"A\" + i;\r\n i++;\r\n\r\n //temp1= temp1.replace(\" & \",\"\");\r\n\r\n if (nonViewbyColumnList == null) {\r\n nonViewbyColumnList = temp;\r\n } else {\r\n nonViewbyColumnList += \",\" + temp;\r\n }\r\n nonViewByList.add(temp1);\r\n nonViewByListRT.add(temp1);\r\n nonViewByMap.put(temp1, temp);\r\n if (this.summReq.equalsIgnoreCase(\"COUNTDISTINCT\")) {\r\n utemp = utemp + \" , nvl( count (distinct ( Case when \" + headerViewByCol + \" = '\" + temp + \"' then \" + this.measureName + \" else null end )) ,0) \\\"\" + temp1 + \"\\\" \";\r\n } else {\r\n utemp = utemp + \" , nvl(\" + this.summReq + \"( Case when \" + headerViewByCol + \" = '\" + temp + \"' then \" + this.measureName + \" else null end ) ,0) \\\"\" + temp1 + \"\\\" \";\r\n }\r\n\r\n nocol = nocol + 1;\r\n }\r\n } catch (SQLException e) {\r\n logger.error(\"Exception:\", e);\r\n } finally {\r\n if (rs != null) {\r\n rs.close();\r\n }\r\n if (st != null) {\r\n st.close();\r\n }\r\n if (con != null) {\r\n con.close();\r\n }\r\n }\r\n\r\n temp = \"\";\r\n sqlstr = \"\";\r\n //nonViewByListRT.add(\"r_total\");\r\n //nonViewByMap.put(\"r_total\", \"Total\");\r\n\r\n\r\n\r\n\r\n {\r\n in_qry = \"\";\r\n in_qry = in_qry + \" select \" + viewByCol + \" \";\r\n in_qry = in_qry + utemp + \" \";\r\n //in_qry = in_qry + utemp + \" , nvl(\" + this.summReq + \" ( \" + this.measureName + \" ),0 ) \\\"r_total\\\" \";\r\n in_qry = in_qry + this.fromTables;\r\n in_qry = in_qry + this.whereClause;\r\n in_qry = in_qry + \"group by \" + viewByColGroup + \" , \" + orderByColGroup + \" \";\r\n if (this.summReq.equalsIgnoreCase(\"COUNTDISTINCT\")) {\r\n in_qry = in_qry + \" having nvl(ABS( count(distinct ( \" + this.measureName + \" ) )),0 ) >0 \";\r\n } else {\r\n in_qry = in_qry + \" having nvl(ABS(\" + this.summReq + \" ( \" + this.measureName + \" ) ),0 ) >0 \";\r\n }\r\n if (defaultSortedColumn != null && !\"\".equalsIgnoreCase(defaultSortedColumn)) {\r\n if (!defaultSortedColumn.equalsIgnoreCase(\"Time\")) {\r\n //in_qry = in_qry + \"order by \" + orderByColGroup + \" \";\r\n in_qry = in_qry + \"order by \" + defaultSortedColumn + \" \";\r\n }\r\n } else {\r\n in_qry = in_qry + \"order by \" + orderByColGroup + \" \";\r\n //in_qry = in_qry + \"order by \" + \"A_\" + defaultSortedColumn + \" \";\r\n }\r\n\r\n //in_qry = in_qry + \"order by \" + orderByColGroup + \" \";\r\n\r\n\r\n sqlstr = in_qry;\r\n\r\n }\r\n return sqlstr;\r\n }", "@Override public double atd_impl(int idx) {\n if( null==_fact ) return _c[0].atd(idx); // simple wrapping of 1 vec\n _t.reset();\n for(int i = 0; i < _c.length; i++)\n _t.setInput(i, _c[i].atd(idx));\n return _t.apply(); // Make the call per-row\n }", "public void displayData(){\n\n //Function to display the entries\n int i , j;\n for(i=0;i<number_of_rows;++i){\n\n for(j=0;j<number_of_cols;++j){\n\n System.out.print(dataEntries[i][j]);\n }\n System.out.println(\" \");\n }\n }", "public int getColumn(){ return (Integer)args[1]; }", "@Override\n public Chunk d(int i0, int i1) {\n return null;\n }", "protected void findCdtDimensions(RectData tempVector) {\n\t\tprintln(\"Finding Cdt Dimensions\");\t\t\n\t\t\n////\tString [] firstLine =(String []) tempVector.elementAt(0);\n\t\tint gweightCol = -1;\n\t\tint rectCol = tempVector.getCol();\n////\tfor (int i =0; i < firstLine.length; i++) {\n\t\tfor (int i = 0; i < rectCol; i++){\n////\t\tString s = firstLine[i];\n\t\t\tString s = tempVector.getColumnName(i);\n\t\t\tif (s == null) {\n\t\t\t\tsetHadProblem(true);\n\t\t\t\tprintln(\"Got null header, setting to empty string\");\n\t\t\t\ts = \"\";\n\t\t\t}\n\t\t\tif (s.equalsIgnoreCase(\"GWEIGHT\")) {\n\t\t\t\tgweightCol = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (gweightCol == -1) {\n////\t\tif (firstLine[0].equalsIgnoreCase(\"GID\")) {\n\t\t\tif (tempVector.getColumnName(0).equalsIgnoreCase(\"GID\")){\n\t\t\tnGenePrefix = 3;\n\t\t\t} else {\n\t\t\t\tnGenePrefix = 2;\n\t\t\t}\n\t\t} else {\n\t\t\tnGenePrefix = gweightCol + 1;\n\t\t}\n\t\t\n////\tnexpr = firstLine.length - nGenePrefix;\n\t\tnExpr = rectCol - nGenePrefix;\n\t\tint eweightRow = -1;\n\t\tif (tempVector.getColumnName(0).equalsIgnoreCase(\"EWEIGHt\")){\n\t\t\teweightRow = 0;\n\t\t}else{\n\t\t\tint rectRow = tempVector.getRow(); \n\t\t\tfor (int i = 0; i < rectRow; i++) {\n////\t\tString s = ((String []) tempVector.elementAt(i))[0];\n\t\t\t\tString s = tempVector.getString(i, 0);\n\t\t\t\tif (s.equalsIgnoreCase(\"EWEIGHT\")) {\n\t\t\t\t\teweightRow = i+1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (eweightRow == -1) {\n////\t\tString [] secondLine =(String []) tempVector.elementAt(1);\n////\t\tif (secondLine[0].equalsIgnoreCase(\"AID\")) {\n\t\t\tif(tempVector.getString(0, 0).equalsIgnoreCase(\"AID\")){\n\t\t\t\tnExprPrefix = 2;\n\t\t\t} else {\n\t\t\t\tnExprPrefix = 1;\n\t\t\t}\n\t\t} else {\n\t\t\tnExprPrefix = eweightRow + 1;\n\t\t}\n\t\t\n\t\tnGene = tempVector.size() - nExprPrefix;\n\t\tsetLength(100);\n\t\tsetValue(100);\n\t\ttargetModel.setEweightFound(eweightRow != -1);\n\t\ttargetModel.setGweightFound(gweightCol != -1);\n\t}", "static int[] getFirstResultString(int[] array){\n int from = (n * (lineNumber-1));\n int[] rezultColumn = Arrays.copyOfRange(array, from, from + n);\n return rezultColumn;\n }", "public Object[][] retrieveDataBasedOnViewSeq(ArrayList<String> columns) {\n Object cellData;\r\n Object[][] data = new Object[this.viewSequence.size()][columns.size()];\r\n int j;\r\n int columnType;\r\n\r\n for (int i = 0; i < this.viewSequence.size(); i++) {\r\n j = 0;\r\n for (String column : columns) {\r\n columnType = this.getColumnType(column);\r\n\r\n if (isNumberColumn(columnType)) {\r\n cellData = this.getMeasureColumnData(column, this.viewSequence.get(i));//this.getFieldValueBigDecimal(i,column);\r\n } else {\r\n cellData = this.getDimensionColumnData(column, this.viewSequence.get(i)); //hardcoding not good assuming C is Dimension\r\n }\r\n data[i][j] = cellData;\r\n j++;\r\n }\r\n }\r\n // long endTime = System.currentTimeMillis();\r\n// \r\n return data;\r\n }", "public int[][] toCloneMatrix(String[] array, int length){\n\t\tint[][] matrix = new int[length][4];\n\t\tfor(int i = 0; i < length; i++){\t\t\n\t\t\tfor(int j = 0; j < 6; j++){\t\n\t\t\t\tif(j == 0){\n\t\t\t\t\tmatrix[i][j] = Integer.valueOf(toWord(array[i])[0]); //matrix[i][0] = array[i][0] CLONE ID\n\t\t\t\t}\n\t\t\t\telse if(j == 1){\n\t\t\t\t\tString temp = toWord(array[i])[1];\n\t\t\t\t\tString[] tempArray = temp.split(\"\\\\.\");\n\t\t\t\t\tmatrix[i][j] = Integer.valueOf(tempArray[0]); //matrix[i][1] = array[i][1] FILE ID\n\t\t\t\t}\n\t\t\t\telse if(j == 2){\n\t\t\t\t\tString temp = toWord(array[i])[1];\n\t\t\t\t\tString[] tempArray = temp.split(\"\\\\.\");\n\t\t\t\t\ttemp = tempArray[1]; //bg-end\n\t\t\t\t\ttempArray = temp.split(\"\\\\-\");\n\t\t\t\t\tmatrix[i][j] = Integer.valueOf(tempArray[0]); //matrix[i][2] = array[i][2] SL\n\t\t\t\t}\n\t\t\t\telse if(j == 3){\n\t\t\t\t\tString temp = toWord(array[i])[1];\n\t\t\t\t\tString[] tempArray = temp.split(\"\\\\.\");\n\t\t\t\t\ttemp = tempArray[1]; //bg-end\n\t\t\t\t\ttempArray = temp.split(\"\\\\-\");\n\t\t\t\t\tmatrix[i][j] = Integer.valueOf(tempArray[1]); //matrix[i][3] = array[i][3] EL\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn matrix;\n\t}", "@Override\r\n\tpublic Object getValueAt(int arg0, int arg1) {\n\t\treturn rowData[arg0][arg1];\r\n\t}", "public int[] getCol() { return _col; }", "public static int[][] intArray1Dto2D(int[] matrixVal) {\n int size = (int) Math.sqrt(matrixVal.length);\n int[][] values = new int[size][size];\n int i, j, k;\n for (i = 0, k = 0; i < size; ++i) {\n for (j = 0; j < size; ++j) {\n values[i][j] = matrixVal[k];\n k++;\n }\n }\n return values;\n }" ]
[ "0.602927", "0.5714732", "0.56951874", "0.56204283", "0.55582213", "0.5421743", "0.53885484", "0.53769946", "0.5305653", "0.5269704", "0.52525294", "0.52270967", "0.5219647", "0.5195788", "0.51846075", "0.5183402", "0.5174487", "0.51654553", "0.51590854", "0.5133432", "0.5128223", "0.5124487", "0.50986975", "0.50932", "0.5087881", "0.50862324", "0.50801593", "0.5071229", "0.50355625", "0.5026468", "0.5021484", "0.50110155", "0.5001959", "0.4980573", "0.49719098", "0.49706125", "0.4965383", "0.49652365", "0.49636528", "0.49611962", "0.4932308", "0.4931556", "0.49286845", "0.49148995", "0.4907067", "0.49053955", "0.4895886", "0.4893223", "0.48910937", "0.48873082", "0.48787522", "0.48743394", "0.48684067", "0.48524284", "0.48466867", "0.48465496", "0.4828001", "0.48141834", "0.48027176", "0.48018754", "0.47996956", "0.479701", "0.4795306", "0.47913438", "0.47908792", "0.47901085", "0.4789342", "0.47841108", "0.47789124", "0.4778786", "0.4774065", "0.4770775", "0.47685397", "0.47537524", "0.47535598", "0.47527453", "0.4750586", "0.4744209", "0.473222", "0.47237733", "0.47173363", "0.47151563", "0.47144917", "0.4714393", "0.47126296", "0.47087434", "0.47041026", "0.4700144", "0.4695972", "0.46916157", "0.46889356", "0.46863666", "0.46842155", "0.4681078", "0.46785027", "0.46784472", "0.46766958", "0.46753806", "0.46752083", "0.466876" ]
0.5579274
4
Static Methods Multiplies C=AB
public static Matrix3D times(Matrix3D A, Matrix3D B) { Matrix3D C = new Matrix3D(); for (int i=0 ; i<=2 ; i++) { // loop over each row of A for (int j=0 ; j<=2 ; j++) { // loop over each column of B // Calculate the dot product of the ith row of A with the jth column of B: double v = 0; for (int k=0 ; k<=2 ; k++) { // loop over each item in the row/column v += A.d[i][k] * B.d[k][j]; } C.set(i,j,v); } } return C; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void mul() {\n\n\t}", "@Override\r\n\tpublic int mul() {\n\t\treturn 0;\r\n\t}", "public void multiply() {\n\t\t\n\t}", "public int mult()\r\n\t{\r\n\t\tint a=10;\r\n\t\tint b=20;\r\n\t\tint c = a*b;\r\n\t\treturn(c);\r\n\t}", "public void sampleMethod()\n {\n int a = 6;\n System.out.println(a *= a);\n \n }", "public static void main(String[] args) {\n int a = 15;\n int b = 17;\n\n System.out.println(\"a = \"+a+\" b = \"+b);\n\n a = a^b;\n b = a^b;\n a = a^b;\n\n System.out.println(\"a = \"+a+\" b = \"+b);\n }", "public AncientEgyptianMultiplication( ) {\r\n }", "private int mcCalc(int a, int b) {\n if (a == 1) {\n return b;\n } else if (a == 2) {\n return mc2[b / 16][b % 16] ^ 0x42;\n } else if (a == 3) {\n return mc3[b / 16][b % 16] ^ 0x42;\n }\n return 0;\n }", "public Inatnum multiply(Inatnum a) {\n Inatnum zero = new zeronatnum(); // we need a new zero natural number for our res\n Inatnum res = zero;// this is our res value where we store our information, it needs to start at 0\n //INV: i>0 && i-1 <= this.getval() && res = a^(i) ==> i=this.getval()-(this.getval()z-1)\n for(int i = this.getVal(); i>0;i--) {// setting our i value to our this and if its greater than zero decrement by 1\n //INV: i>0 && i <= this.getval() && res = a^i ==> i=this.getval()-(this.getval()\n\t\t\tres = res.add(a);//now we save our res value as the previous res value plus a. we do this as many times as we are multiplying by. So if it is 3 times\n //INV: i>0 && i <= this.getval() && res = a^i ==> i=this.getval()-(this.getval()-1) \n \t\t\t//i-- => i = this.getval()-(this.getval()-1-1)\n \t\t\t //INV: i>0 && i-1 <= this.getval() && res = a^(i) ==> i=this.getval()-(this.getval()-1-1)\n \t\t\t //INV: i>0 && i-1 <= this.getval() && res = a^(i) ==> i=this.getval()-(this.getval()z-1) \n\t\t\t // 4 then we are adding 4 3 times\n }\n\t\t\t //INV: i<0 && i-1 < this.getval() ==> i ==0 && res = a^i ==> i=this.getval()\n //Termination Argument: i starts at this.getval(), i decrements each time through the loop\n\t\t\t\t\t\t return res;// we need to return our res value that holds our current value.\n }", "abstract void mulS();", "public int m3(int a,int b){\r\n\t\tint c=a+b;\r\n\t\treturn c;\r\n\t}", "@Override\npublic void mul(int a, int b) {\n\t\n}", "private native double SumaC(double operador_1, double operador_2);", "int multiply (int a, int b) {\n\t\t//let me do it in one step\n\t\treturn a * b; \n\t\t\n\t\t\n\t}", "int luasPP(int a, int b){\r\n return a*b;\r\n }", "public void cpl() {\n\t\tint op = registers.getRegister(Register.A);\n\t\tint result = invert(op);\n\t\tregisters.setRegister(Register.A, result);\n\n\t\tregisters.setFlag(Flag.H, true);\n\t\tregisters.setFlag(Flag.N, true);\n\t}", "public static int multiply(int lafoot,int lapaki){\n\treturn 0;\n}", "Multiply createMultiply();", "private void coins_a1B(){\n\t\tthis.cube[22] = this.cube[9]; \n\t\tthis.cube[9] = this.cube[45];\n\t\tthis.cube[45] = this.cube[36];\n\t\tthis.cube[36] = this.cube[0];\n\t\tthis.cube[0] = this.cube[22];\n\t}", "@Override\n\tpublic double multiply(double in1, double in2) {\n\t\treturn 0;\n\t}", "@Override\n\tdouble chuVi() {\n\t\treturn (canhA + canhB) * 2;\n\t}", "public String multiply()\r\n {\r\n\r\n return First.multiply(Second).stripTrailingZeros().toString();\r\n }", "private void aretes_aB(){\n\t\tthis.cube[22] = this.cube[12]; \n\t\tthis.cube[12] = this.cube[48];\n\t\tthis.cube[48] = this.cube[39];\n\t\tthis.cube[39] = this.cube[3];\n\t\tthis.cube[3] = this.cube[22];\n\t}", "BaseNumber multiply(BaseNumber operand);", "public void enfoncerMult() {\n\t\ttry {\n\t\t\tthis.op = new Mult();\n\t\t\tif (!raz) {\n\t\t\t\tthis.pile.push(valC);\n\t\t\t}\n\t\t\tint a = this.pile.pop(); int b = this.pile.pop();\n\t\t\tthis.valC = this.op.eval(b,a);\n\t\t\tthis.pile.push(this.valC);\n\t\t\tthis.raz = true;\n\t\t}\n\t\tcatch (EmptyStackException e) {\n\t\t\tSystem.out.println(\"Erreur de syntaxe : Saisir deux operandes avant de saisir un operateur\");\n\t\t}\n\t}", "private void coins_a2B(){\n\t\tthis.cube[22] = this.cube[15]; \n\t\tthis.cube[15] = this.cube[51];\n\t\tthis.cube[51] = this.cube[42];\n\t\tthis.cube[42] = this.cube[6];\n\t\tthis.cube[6] = this.cube[22];\n\t}", "C3676k mo12649b();", "@Override\r\n\tpublic int mul(int a,int b) {\n\t\treturn a*b;\r\n\t}", "private static int calc(int c) {\n\t\treturn 1;\n\t}", "IVec3 mult(IVec3 v);", "private static void directProd(DMatrixRMaj a, DMatrixRMaj b, DMatrixRMaj c) {\n for (int i=0; i<5; ++i) {\n for (int j=0; j<5; ++j) {\n c.unsafe_set(i, j, a.unsafe_get(i, 0)*b.unsafe_get(j, 0));\n }\n }\n }", "Up(int z) {x *= 3; }", "public int b(String paramString, int paramInt)\r\n/* 588: */ {\r\n/* 589:589 */ return this.a * c(paramString, paramInt).size();\r\n/* 590: */ }", "private void coins_fB(){\n\t\tthis.cube[22] = this.cube[18]; \n\t\tthis.cube[18] = this.cube[24];\n\t\tthis.cube[24] = this.cube[26];\n\t\tthis.cube[26] = this.cube[20];\n\t\tthis.cube[20] = this.cube[22];\n\t}", "@Override\r\n\tpublic void mul(int x, int y) {\n\t\t\r\n\t}", "public C5874a mo12437c() {\n AppMethodBeat.m2504i(98887);\n C5874a c5874a = (C5874a) super.mo12430a();\n c5874a.f1597d = (C46783fa) c5874a.f1595c;\n AppMethodBeat.m2505o(98887);\n return c5874a;\n }", "public final void mo75262ac() {\n super.mo75262ac();\n m110455aC();\n m110453aA();\n m110465az();\n }", "public int getProduct() {\n int a = 5;\n int b = 14;\n int c = a * b;\n return c;\n }", "private void j()\n/* */ {\n/* 223 */ c localc = this.b;\n/* 224 */ this.b = this.c;\n/* 225 */ this.c = localc;\n/* 226 */ this.c.b();\n/* */ }", "private static final int mult (int a, int b, int g) {\n int p = 0;\n while (b != 0) {\n if ((b & 0x01) != 0) p ^= a;\n a <<= 1;\n if (a > 0xFF) a ^= g;\n b >>>= 1;\n }\n return p;\n }", "@Override\n\tdouble chuVi() {\n\t\treturn canhA + canhB + canhC;\n\t}", "@Override\n\tpublic double multiply(double a, double b) {\n\t\treturn (a*b);\n\t}", "public double multiplica(double a, double b) {\n\t\treturn a*b;\n\t}", "int kelilingPP(int a, int b){\r\n return 2*(a+b);\r\n }", "abstract int multiplication(int num1, int num2);", "int method01(int a, int b) {\n\n\t\ta = a + b;\n\t\treturn a;\n\t}", "private void coins_a2R(){\n\t\tthis.cube[13] = this.cube[53]; \n\t\tthis.cube[53] = this.cube[18];\n\t\tthis.cube[18] = this.cube[0];\n\t\tthis.cube[0] = this.cube[27];\n\t\tthis.cube[27] = this.cube[13];\n\t}", "public int mo8854a() {\n return mo8857b();\n }", "protected void o()\r\n/* 156: */ {\r\n/* 157:179 */ int i = 15 - aib.b(this);\r\n/* 158:180 */ float f = 0.98F + i * 0.001F;\r\n/* 159: */ \r\n/* 160:182 */ this.xVelocity *= f;\r\n/* 161:183 */ this.yVelocity *= 0.0D;\r\n/* 162:184 */ this.zVelocity *= f;\r\n/* 163: */ }", "public Polynomial operate(){\n Polynomial result = a.multiplyPolynomial(b);\n return result;\n }", "public abstract long c(int i2, int i3);", "private void multiplication()\n\t{\n\t\tFun = Function.MULTIPLY; //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}", "public abstract C mo29734a();", "private void coins_a2G(){\n\t\tthis.cube[31] = this.cube[11]; \n\t\tthis.cube[11] = this.cube[2];\n\t\tthis.cube[2] = this.cube[38];\n\t\tthis.cube[38] = this.cube[47];\n\t\tthis.cube[47] = this.cube[31];\n\t}", "public int zzB() {\n return 0;\n }", "private int m1283a(int i, int i2) {\r\n int i3 = 1;\r\n for (int i4 = 0; i4 < i2; i4++) {\r\n i3 *= i;\r\n }\r\n return i3;\r\n }", "@Test\n public void testCyclicalIdentity() {\n Vector a = Vector.of(Variable.of(\"a1\"), Variable.of(\"a2\"), Variable.of(\"a3\"));\n Vector b = Vector.of(Variable.of(\"b1\"), Variable.of(\"b2\"), Variable.of(\"b3\"));\n Vector c = Vector.of(Variable.of(\"c1\"), Variable.of(\"c2\"), Variable.of(\"c3\"));\n Vector lhs = a.cross(b).cross(c);\n lhs = lhs.simplify();\n Vector rhs = b.times(a.dot(c)).plus(a.times(b.dot(c)).times(Constant.MINUS_ONE));\n rhs = rhs.simplify();\n Assert.assertEquals(lhs.getValues()[0], rhs.getValues()[0]);\n Assert.assertEquals(lhs.getValues()[1], rhs.getValues()[1]);\n Assert.assertEquals(lhs.getValues()[2], rhs.getValues()[2]);\n Assert.assertEquals(lhs, rhs);\n }", "void mo12647a(C3333i iVar);", "C3577c mo19678C();", "private void coins_a2W(){\n\t\tthis.cube[4] = this.cube[17]; \n\t\tthis.cube[17] = this.cube[20];\n\t\tthis.cube[20] = this.cube[36];\n\t\tthis.cube[36] = this.cube[33];\n\t\tthis.cube[33] = this.cube[4];\n\t}", "Sum getMultiplier();", "public static int Multiplication(int a,int b){\n\tint result=a*b;\n\treturn result;\n}", "C7904c mo24084a();", "public final /* synthetic */ Object a() {\r\n return c.a(this.a, b.d());\r\n }", "private static int galoisMult(int a, int b)\n\t{\n\t\tint result = 0;\n\t\tfor (int i=0; i<8; i++)\n\t\t{\n\t\t\tif((b&1) == 1) //low bit of b set\n\t\t\t\tresult = result^a;\n\t\t\tboolean aHighSet = (a & 128) == 128; //8th bit of a set\n\t\t\ta <<= 1;\n\t\t\tassert (a&1) == 0;\n\t\t\t\n\t\t\ta &= 255; //getting rid of 9th bit\n\t\t\tassert ((a&256) != 256);\n\t\t\t\n\t\t\tif (aHighSet)\n\t\t\t\ta ^= (0x1b);\n\t\t\t\n\t\t\tb >>= 1;\n\t\t\tassert (b&128) != 128; //8 bit is zero\n\t\t}\n\t\treturn result;\n\t}", "private int Maj(int x, int y, int z) {\n return (x & y) ^ (x & z) ^ (y & z);\n }", "public static double discr(double a, double b, double c) {\n return sq(b) - 4 * a * c;\n }", "@Override\n\tdouble dienTich() {\n\t\treturn canhA * canhB;\n\t}", "public abstract C0631bt mo9227aB();", "public final void mo31291c() {\n C5108gb gbVar = C5108gb.this;\n if (gbVar.f13978c == this) {\n gbVar.f13978c = null;\n }\n if (C5108gb.this.f13977b == C5116c.f14001c) {\n C5108gb gbVar2 = C5108gb.this;\n int i = C5116c.f13999a;\n int i2 = C5116c.f14001c;\n gbVar2.mo31283a(i);\n }\n }", "public static BinaryExpression powerAssign(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "public void mul()\n\t{\n\t\t\n\t\tSystem.out.println(\"Hey I am in base class********** and addition is 2500\");\n\t}", "public T mul(T first, T second);", "public static byte GMul(int a, int b) {\n\n byte p = 0;\n byte counter;\n byte hi_bit_set;\n for (counter = 0; counter < 8; counter++) {\n if ((b & 1) != 0) {\n p ^= a;\n }\n hi_bit_set = (byte) (a & 0x80);\n a <<= 1;\n if (hi_bit_set != 0) {\n a ^= 0x1b; /* x^8 + x^4 + x^3 + x + 1 */\n }\n b >>= 1;\n }\n return p;\n}", "private int mcHelper(int[][] arr, int[][] g, int i, int j) {\n int mcsum = 0;\n for (int k = 0; k < 4; k++) {\n int a = g[i][k] ^ 0x42;\n int b = arr[k][j];\n mcsum ^= mcCalc(a, b);\n }\n return mcsum;\n }", "private static void multiply(float[] a, float[] b, float[] destination) {\r\n\t\tfor(int i = 0; i < 4; i++){\r\n\t\t\tfor(int j = 0; j < 4; j++){\r\n\t\t\t\tfor(int k = 0; k < 4; k++){\r\n\t\t\t\t\tset(destination, i, j, get(destination, i, j) + get(a, i, k) * get(b, k, j));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void coins_a1G(){\n\t\tthis.cube[31] = this.cube[17]; \n\t\tthis.cube[17] = this.cube[8];\n\t\tthis.cube[8] = this.cube[44];\n\t\tthis.cube[44] = this.cube[53];\n\t\tthis.cube[53] = this.cube[31];\n\t}", "private void createMulAcc(Code32 code, int op, int cond, int Rd, int Ra, int Rn, int Rm) {\r\n\t\tcode.instructions[code.iCount] = (cond << 28) | op | (Rd << 16) | (Ra << 12) | (Rm << 8) | (0x9 << 4) | Rn;\r\n\t\tcode.incInstructionNum();\r\n\t}", "public cew a(blc ☃, axk axk1, el el1) {\r\n/* 96 */ byw byw = axk1.b(el1.a());\r\n/* 97 */ if (byw.c().a(this.b)) {\r\n/* 98 */ return cet.b();\r\n/* */ }\r\n/* */ \r\n/* 101 */ return this.o.computeIfAbsent(☃, ☃ -> {\r\n/* */ byw byw = ☃.s();\r\n/* */ return cet.a(0.0D, 0.0D, 0.0D, 1.0D, byw.f(), 1.0D);\r\n/* */ }", "void mul(double val) {\r\n\t\tresult = result * val;\r\n\t}", "@Override\r\n\tpublic void computeConstant() {\n\t\t\r\n\t}", "void mo86a(C0163d c0163d);", "@Override\r\n\tpublic int call(int a, int b) {\n\t\treturn a*b;\r\n\t}", "public void doCalculation(int a ,int b , int c){\r\n\t \r\n\tint finalValue = variableNumber(a)-add(b,c);\r\n\t \r\n System.out.println(finalValue);\r\n\t \r\n\t}", "final public Vector3 mul(double c){\n return new Vector3(x*c, y*c, z*c);\n }", "int mul( int a , int b)\n {\n double c,d;\n \tif (a==0)\n\t c=65536;\n\tif(b==0)\n\t d=65536;\n c=(double)a;\n d=(double)b;\n a= (int)((c*d)%65537);\n return a;\n }", "static int comb(int big, int smal) \n\t{ \n\t\treturn (int) ((long) fact[big] * invfact[smal] % mod \n\t\t\t\t* invfact[big - smal] % mod); \n\t}", "protected final void mo4165a() throws IllegalAccessException, InvocationTargetException {\n this.b.f26978d = Long.valueOf(-1);\n this.b.f26979e = Long.valueOf(-1);\n int[] iArr = (int[]) this.c.invoke(null, new Object[]{this.a.m20204a()});\n synchronized (this.b) {\n this.b.f26978d = Long.valueOf((long) iArr[0]);\n this.b.f26979e = Long.valueOf((long) iArr[1]);\n if (((Boolean) aja.m19221f().m19334a(alo.bq)).booleanValue() && iArr[2] != Integer.MIN_VALUE) {\n this.b.f26964N = Long.valueOf((long) iArr[2]);\n }\n }\n }", "public final void a() {\n this.f10063c.e();\n this.f10061a = 0;\n this.f10062b = 0;\n }", "private void coins_a2Y(){\n\t\tthis.cube[49] = this.cube[44]; \n\t\tthis.cube[44] = this.cube[24];\n\t\tthis.cube[24] = this.cube[9];\n\t\tthis.cube[9] = this.cube[29];\n\t\tthis.cube[29] = this.cube[49];\n\t}", "public int producto(){\r\n return x*y;\r\n }", "public static BinaryExpression powerAssign(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }", "private int Ch(int x, int y, int z) {\n return (x & y) ^ (~x & z);\n }", "Aweme mo62993e();", "public long a() {\n long l2;\n long l3;\n if (this.c()) {\n a.i.a a2 = this.l;\n a.i.a a4 = a.i.a.b;\n boolean bl = false;\n if (a2 == a4) {\n bl = true;\n }\n long l4 = bl ? this.m * (long)this.k : (long)Math.scalb((float)this.m, (int)(this.k - 1));\n l2 = this.n;\n l3 = Math.min((long)18000000L, (long)l4);\n do {\n return l3 + l2;\n break;\n } while (true);\n }\n boolean bl = this.d();\n long l5 = 0L;\n if (bl) {\n long l6 = System.currentTimeMillis();\n long l7 = this.n;\n if (l7 == l5) {\n l7 = l6 + this.g;\n }\n long l8 = this.i LCMP this.h;\n boolean bl2 = false;\n if (l8 != false) {\n bl2 = true;\n }\n if (bl2) {\n if (this.n != l5) return l5 + (l7 + this.h);\n l5 = -1L * this.i;\n return l5 + (l7 + this.h);\n }\n if (this.n == l5) return l7 + l5;\n l5 = this.h;\n return l7 + l5;\n }\n l3 = this.n;\n if (l3 == l5) {\n l3 = System.currentTimeMillis();\n }\n l2 = this.g;\n return l3 + l2;\n }", "private void coins_a1W(){\n\t\tthis.cube[4] = this.cube[15]; \n\t\tthis.cube[15] = this.cube[26];\n\t\tthis.cube[26] = this.cube[38];\n\t\tthis.cube[38] = this.cube[27];\n\t\tthis.cube[27] = this.cube[4];\n\t}", "float getCpMultiplier();", "private void arretes_fB(){\n\t\tthis.cube[22] = this.cube[19]; \n\t\tthis.cube[19] = this.cube[21];\n\t\tthis.cube[21] = this.cube[25];\n\t\tthis.cube[25] = this.cube[23];\n\t\tthis.cube[23] = this.cube[22];\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println('a' == 'A');\n\t\tSystem.out.println(\"mul --> \"+(1000000L*2000000L));\n\t\t\n\n\t}", "public abstract double calcSA();", "@Override\r\n\tpublic int mulNo(int a, int b) {\n\t\treturn a*b;\r\n\t}" ]
[ "0.6239144", "0.62061983", "0.6042975", "0.60426706", "0.5975087", "0.5971196", "0.5921341", "0.58958495", "0.5844507", "0.57877433", "0.575175", "0.5715783", "0.569373", "0.56499183", "0.5648438", "0.5642151", "0.558846", "0.5576457", "0.5564965", "0.5550902", "0.5548569", "0.55452293", "0.5530838", "0.5521445", "0.55150527", "0.55064195", "0.54895407", "0.5470296", "0.5448569", "0.54477614", "0.54457444", "0.54440886", "0.54307336", "0.54244673", "0.54212755", "0.5399547", "0.53840894", "0.5380612", "0.5363594", "0.53536826", "0.5353602", "0.53508836", "0.53506386", "0.5349289", "0.53478205", "0.5333519", "0.53283644", "0.53119534", "0.5304952", "0.5291006", "0.52652735", "0.5265025", "0.5260306", "0.5254689", "0.5245152", "0.524113", "0.5229847", "0.5229441", "0.522703", "0.52247435", "0.52237105", "0.52209955", "0.52200997", "0.5217532", "0.5214287", "0.5212475", "0.52079475", "0.51943475", "0.5188214", "0.5184973", "0.5177418", "0.5176679", "0.51764536", "0.5173172", "0.51690286", "0.5168589", "0.5166586", "0.5162438", "0.51621187", "0.51612794", "0.5160089", "0.5157946", "0.515766", "0.51572376", "0.51543784", "0.51518005", "0.51487523", "0.5141179", "0.513726", "0.51324755", "0.5127731", "0.5127188", "0.512559", "0.512318", "0.5119934", "0.51121604", "0.5109376", "0.5095791", "0.5094071", "0.50940484", "0.5092065" ]
0.0
-1
THESE ARE BODY ROTATIONS! Rotation around x axis.
public static Matrix3D rotX(double theta) { Matrix3D m = new Matrix3D(); m.set(1,1, Math.cos(theta)); m.set(1,2,-Math.sin(theta)); m.set(2,1, Math.sin(theta)); m.set(2,2, Math.cos(theta)); m.set(0,0, 1.0); return m; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void xRotate() {\n\t\t\n\t}", "public void rotate() {\n // amoeba rotate\n // Here i will use my rotation_x and rotation_y\n }", "@Override\n \t\t\t\tpublic void doRotateX() {\n \n \t\t\t\t}", "public void zRotate() {\n\t\t\n\t}", "@Override\r\n\tpublic void rotate() {\n\t\t\r\n\t}", "private void rotate() {\n byte tmp = topEdge;\n topEdge = leftEdge;\n leftEdge = botEdge;\n botEdge = rightEdge;\n rightEdge = tmp;\n tmp = reversedTopEdge;\n reversedTopEdge = reversedLeftEdge;\n reversedLeftEdge = reversedBotEdge;\n reversedBotEdge = reversedRightEdge;\n reversedRightEdge = tmp;\n tmp = ltCorner;\n ltCorner = lbCorner;\n lbCorner = rbCorner;\n rbCorner = rtCorner;\n rtCorner = tmp;\n\n }", "@Override\r\n\tpublic void rotar() {\n\r\n\t}", "void rotate();", "@Override\n\tpublic float getOrientation() {\n\t\treturn body.getAngle();\n\t}", "public void rotateShip(){\n if (this.orientation == false){\n this.orientation = true;\n }else\n orientation = false;\n \n return;\n }", "@Override\n\tpublic void rotate() {\n\t}", "public void rotRight()\n\t{\n\t\t//only rotate if a PlayerShip is currently spawned\n\t\tif(gameObj[1].size() > 0)\n\t\t{\n\t\t\t((PlayerShip)gameObj[1].get(0)).moveRight();\n\t\t\tSystem.out.println(\"Heading -10 degrees\");\n\t\t}else {\n\t\t\tSystem.out.println(\"there is not currently a player ship spawned\");\n\t\t}\n\t}", "public void rotateCCW(){\n rotState = (rotState + 3) % 4;\n for (int i = 0; i < tiles.length; ++i){\n tiles[i] = new Point(tiles[i].y , -tiles[i].x);\n }\n }", "void rotate() {\n startAnimation(allSubCubes(), Axis.Y, Direction.CLOCKWISE);\n rotateCubeSwap();\n }", "@Override\n \t\t\t\tpublic void doRotateZ() {\n \n \t\t\t\t}", "public void rotLeft()\n\t{\n\t\t//only rotate if a PlayerShip is currently spawned\n\t\tif(gameObj[1].size() > 0)\n\t\t{\n\t\t\t((PlayerShip)gameObj[1].get(0)).moveLeft();\n\t\t\tSystem.out.println(\"Heading +10 degrees\");\n\t\t}else {\n\t\t\tSystem.out.println(\"there is not currently a player ship spawned\");\n\t\t}\n\t}", "public void setRotation(Array<Body> objects) {\n this.state.setRotation(this, objects);\n }", "@Override\n\tfinal public void rotate(double angle, Axis axis)\n\t{\n\t\t//center.setDirection(angle);\n\t}", "public abstract void rotate();", "public void rotateTransform(Vector3f rot) {\r\n\t\tMatrix4f rx = new Matrix4f();\r\n\t\tMatrix4f ry = new Matrix4f();\r\n\t\tMatrix4f rz = new Matrix4f();\r\n\t\t\t\t\r\n\t\t// Convert the angles to radians\r\n\t\tfloat x = (float) Math.toRadians(rot.x);\r\n\t\tfloat y = (float) Math.toRadians(rot.y);\r\n\t\tfloat z = (float) Math.toRadians(rot.z);\r\n\r\n\t\t// Create the X-Rotation matrix\r\n\t\trx.m[0][0] = 1.0f; rx.m[0][1] = 0.0f;\t \t\t\t rx.m[0][2] = 0.0f; \t\t\t\trx.m[0][3] = 0.0f;\r\n\t rx.m[1][0] = 0.0f; rx.m[1][1] = (float) Math.cos(x); rx.m[1][2] = (float) -Math.sin(x); rx.m[1][3] = 0.0f;\r\n\t rx.m[2][0] = 0.0f; rx.m[2][1] = (float) Math.sin(x); rx.m[2][2] = (float) Math.cos(x) ; rx.m[2][3] = 0.0f;\r\n\t rx.m[3][0] = 0.0f; rx.m[3][1] = 0.0f; \t\t\t\t rx.m[3][2] = 0.0f;\t\t \t\t\trx.m[3][3] = 1.0f;\r\n\r\n\t // Create the Y-Rotation matrix\r\n\t ry.m[0][0] = (float) Math.cos(y); ry.m[0][1] = 0.0f; ry.m[0][2] = (float) -Math.sin(y); ry.m[0][3] = 0.0f;\r\n\t ry.m[1][0] = 0.0f; \t\t\t\t ry.m[1][1] = 1.0f; ry.m[1][2] = 0.0f; \t\t\t\try.m[1][3] = 0.0f;\r\n\t ry.m[2][0] = (float) Math.sin(y); ry.m[2][1] = 0.0f; ry.m[2][2] = (float) Math.cos(y) ; ry.m[2][3] = 0.0f;\r\n\t ry.m[3][0] = 0.0f; \t\t\t\t ry.m[3][1] = 0.0f; ry.m[3][2] = 0.0f; \t\t\t\try.m[3][3] = 1.0f;\r\n\r\n\t // Create the Z-Rotation matrix\r\n\t rz.m[0][0] = (float) Math.cos(z); rz.m[0][1] = (float) -Math.sin(z); rz.m[0][2] = 0.0f; rz.m[0][3] = 0.0f;\r\n\t rz.m[1][0] = (float) Math.sin(z); rz.m[1][1] = (float) Math.cos(z) ; rz.m[1][2] = 0.0f; rz.m[1][3] = 0.0f;\r\n\t rz.m[2][0] = 0.0f; \t\t\t\t rz.m[2][1] = 0.0f; \t\t\t\t rz.m[2][2] = 1.0f; rz.m[2][3] = 0.0f;\r\n\t rz.m[3][0] = 0.0f; \t\t\t\t rz.m[3][1] = 0.0f; \t\t\t\t rz.m[3][2] = 0.0f; rz.m[3][3] = 1.0f;\r\n\t\t\t\r\n\t // Multiply all the matrices together\r\n\t\tMatrix4f rzy = rz.mult(ry);\r\n\t\tMatrix4f r = rzy.mult(rx);\r\n\t\t\t \r\n\t\tm = r.m;\r\n\r\n\t}", "public void rotate(){\n\t\t\n\t\tfor(Vertex v : vertices){\n\n\t\t\tMatrix m = ViewSettings.getRotationMatrix4().multiply(v);\n\n\t\t\tv.setX(m.getValue(0, 0));\n\t\t\tv.setY(m.getValue(1, 0));\n\t\t\tv.setZ(m.getValue(2, 0));\n\t\t\tv.setW(m.getValue(3, 0));\n\t\t}\n\t}", "void rotateInv() {\n startAnimation(allSubCubes(), Axis.Y, Direction.ANTICLOCKWISE);\n rotateCubeSwap();\n rotateCubeSwap();\n rotateCubeSwap();\n }", "public void setRotation(){\n\t\t\tfb5.accStop();\n\t\t\twt.turning = true;\n\t\t\tif(state == BotMove.RIGHT_15){\n\t\t\t\tfb5.turnRightBy(6);\n\t\t\t\tangle = (angle+360-20)%360;\n\t\t\t}\n\t\t\telse if(state == BotMove.RIGHT_10){\n\t\t\t\tfb5.turnRightBy(3);\n\t\t\t\tangle = (angle+360-10)%360;\n\t\t\t}\n\t\t\telse if(state == BotMove.LEFT_5){\n\t\t\t\tfb5.turnLeftBy(2);\n\t\t\t\tangle = (angle+360+5)%360;\n\t\t\t}\n\t\t}", "public void setRotationAngles(float parTime, float parSwingSuppress, float par3, float parHeadAngleY, float parHeadAngleX, float par6, EntityElephant parEntity)\n {\n \t// return rotation point in case there was previous rearing animation\n \thead.setRotationPoint(headRotPointXDefault, headRotPointYDefault, headRotPointZDefault);\n body.setRotationPoint(bodyRotPointXDefault, bodyRotPointYDefault, bodyRotPointZDefault);\n legFrontRight.setRotationPoint(legFrontRightRotPointXDefault, legFrontRightRotPointYDefault, legFrontRightRotPointZDefault);\n legFrontLeft.setRotationPoint(legFrontLeftRotPointXDefault, legFrontLeftRotPointYDefault, legFrontLeftRotPointZDefault);\n childHead.setRotationPoint(childHeadRotPointXDefault, childHeadRotPointYDefault, childHeadRotPointZDefault);\n\n head.rotateAngleX = degToRad(parHeadAngleX);\n head.rotateAngleY = degToRad(parHeadAngleY);\n childHead.rotateAngleX = degToRad(parHeadAngleX);\n childHead.rotateAngleY = degToRad(parHeadAngleY);\n body.rotateAngleX = ((float)Math.PI / 2F);\n // swingSuppress goes to 0 when still so gates the movement\n legRearRight.rotateAngleX = MathHelper.cos(parTime * 0.6662F) * 1.4F * parSwingSuppress;\n legRearLeft.rotateAngleX = MathHelper.cos(parTime * 0.6662F + (float)Math.PI) * 1.4F * parSwingSuppress;\n legFrontRight.rotateAngleX = MathHelper.cos(parTime * 0.6662F + (float)Math.PI) * 1.4F * parSwingSuppress;\n legFrontLeft.rotateAngleX = MathHelper.cos(parTime * 0.6662F) * 1.4F * parSwingSuppress;\n trunk1.rotateAngleX = MathHelper.cos(degToRad(parEntity.ticksExisted*7)) * degToRad(15);\n childTrunk1.rotateAngleX = MathHelper.cos(degToRad(parEntity.ticksExisted*7)) * degToRad(15);\n trunk2.rotateAngleX = trunk1.rotateAngleX * 3;\n\n // flick ears\n ear1.rotateAngleY = (float) Math.pow(MathHelper.cos(degToRad(parEntity.ticksExisted*3)), 6) * degToRad(15);\n ear2.rotateAngleY = (float) Math.pow(MathHelper.cos(degToRad(parEntity.ticksExisted*3)), 6) * degToRad(-15);\n childEar1.rotateAngleY = (float) Math.pow(MathHelper.cos(degToRad(parEntity.ticksExisted*3)), 6) * degToRad(15);\n childEar2.rotateAngleY = (float) Math.pow(MathHelper.cos(degToRad(parEntity.ticksExisted*3)), 6) * degToRad(-15);\n\n // raise trunk if in water \n if (parEntity.isInWater())\n {\n \ttrunk1.rotateAngleX = degToRad(-150);\n \ttrunk2.rotateAngleX = degToRad(-20);\n \tchildTrunk1.rotateAngleX = degToRad(-150);\n }\n \n // perform rearing animation if appropriate\n if (parEntity.isRearing())\n {\n \tint rearingCounter = parEntity.getRearingCounter();\n// \t// DEBUG\n// \tSystem.out.println(\"ModelElephant entity is rearing with rearing counter = \"+rearingCounter);\n \t\n \t// move retain connection between body parts, hind legs stay where they were\n \thead.setRotationPoint(headRotPointXDefault, headRotPointYDefault+rearingOffsetCycle[rearingCounter][0], headRotPointZDefault+rearingOffsetCycle[rearingCounter][1]);\n body.setRotationPoint(bodyRotPointXDefault, bodyRotPointYDefault+rearingOffsetCycle[rearingCounter][2], bodyRotPointZDefault+rearingOffsetCycle[rearingCounter][3]);\n legFrontRight.setRotationPoint(legFrontRightRotPointXDefault, legFrontRightRotPointYDefault+rearingOffsetCycle[rearingCounter][4], legFrontRightRotPointZDefault+rearingOffsetCycle[rearingCounter][5]);\n legFrontLeft.setRotationPoint(legFrontLeftRotPointXDefault, legFrontLeftRotPointYDefault+rearingOffsetCycle[rearingCounter][6], legFrontLeftRotPointZDefault+rearingOffsetCycle[rearingCounter][7]);\n childHead.setRotationPoint(childHeadRotPointXDefault, childHeadRotPointYDefault+rearingOffsetCycle[rearingCounter][8], childHeadRotPointZDefault+rearingOffsetCycle[rearingCounter][9]);\n \n // rotate for rearing\n \tbody.rotateAngleX += degToRad(rearingAngleCycle[rearingCounter][0]);\n head.rotateAngleX += degToRad(rearingAngleCycle[rearingCounter][0]);\n \tchildHead.rotateAngleX += degToRad(rearingAngleCycle[rearingCounter][0]);\n \ttrunk1.rotateAngleX = degToRad(rearingAngleCycle[rearingCounter][1]);\n \ttrunk2.rotateAngleX = degToRad(rearingAngleCycle[rearingCounter][2]);\n \tchildTrunk1.rotateAngleX = degToRad(rearingAngleCycle[rearingCounter][1]);\n \tlegFrontRight.rotateAngleX = degToRad(rearingAngleCycle[rearingCounter][0]);\n \tlegFrontLeft.rotateAngleX = degToRad(rearingAngleCycle[rearingCounter][0]);\n }\n }", "void setRotation (DMatrix3C R);", "public void rotate(vec3 axis, float angle){\n mat4 m = math3d.axisRotation(axis, angle);\n worldMatrix = worldMatrix.mul(m);\n }", "public void calculateRotation() {\r\n float x = this.getX();\r\n float y = this.getY();\r\n\r\n float mouseX = ((float) Mouse.getX() - 960) / (400.0f / 26.0f);\r\n float mouseY = ((float) Mouse.getY() - 540) / (400.0f / 23.0f);\r\n\r\n float b = mouseX - x;\r\n float a = mouseY - y;\r\n\r\n rotationZ = (float) Math.toDegrees(Math.atan2(a, b)) + 90;\r\n\r\n forwardX = (float) Math.sin(Math.toRadians(rotationZ));\r\n forwardY = (float) -Math.cos(Math.toRadians(rotationZ));\r\n }", "@Override\n\tpublic void rotate90() {\n\n\t\tint[][] rotate = new int[this.frame[0].length][this.frame.length];\n\n\t\tfor (int x = 0; x < rotate[0].length; x++) {\n\t\t\tfor (int y = 0; y < rotate.length; y++) {\n\t\t\t\trotate[y][x] = this.frame[this.frame.length - x - 1][y];\n\t\t\t}\n\t\t} \n\n\t\tthis.frame = rotate;\n\n\t}", "public void rotateLeft() {\n // I fucked up? Rotations are reversed, just gonna switch em\n// tileLogic = getRotateLeft();\n tileLogic = getRotateRight();\n// rotateLeftTex();\n rotateRightTex();\n }", "@Override\n \t\t\t\tpublic void doRotateY() {\n \n \t\t\t\t}", "private void rotateView(float x, float y)\n\t{\n\t\tfinal float dx = x - myStartX;\n\t\tfinal float dy = y - myStartY;\n\n\t\tmyAngleX = (dy / myRadius) * myScrollSpeed * TOUCH_SCALE_FACTOR;\n\t\tmyAngleY = (-dx / myRadius) * myScrollSpeed * TOUCH_SCALE_FACTOR;\n\n\n\t\tmyArmoire.setAngleX(myAngleX);\n\t\tmyArmoire.setAngleY(myAngleY);\n\t\tmyArmoire.update(myCenterX, myCenterY, myShiftLeft);\n\n\n\t}", "void rotate(float x, float y, float z) {\n target_angle[0] += x;\n target_angle[1] += y;\n target_angle[2] += z;\n postSetAngle();\n }", "public void onUpdate() {\n/* 89 */ this.lastTickPosX = this.posX;\n/* 90 */ this.lastTickPosY = this.posY;\n/* 91 */ this.lastTickPosZ = this.posZ;\n/* 92 */ super.onUpdate();\n/* 93 */ this.motionX *= 1.15D;\n/* 94 */ this.motionZ *= 1.15D;\n/* 95 */ this.motionY += 0.04D;\n/* 96 */ moveEntity(this.motionX, this.motionY, this.motionZ);\n/* 97 */ float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);\n/* 98 */ this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);\n/* */ \n/* 100 */ for (this.rotationPitch = (float)(Math.atan2(this.motionY, var1) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F);\n/* */ \n/* */ \n/* */ \n/* */ \n/* 105 */ while (this.rotationPitch - this.prevRotationPitch >= 180.0F)\n/* */ {\n/* 107 */ this.prevRotationPitch += 360.0F;\n/* */ }\n/* */ \n/* 110 */ while (this.rotationYaw - this.prevRotationYaw < -180.0F)\n/* */ {\n/* 112 */ this.prevRotationYaw -= 360.0F;\n/* */ }\n/* */ \n/* 115 */ while (this.rotationYaw - this.prevRotationYaw >= 180.0F)\n/* */ {\n/* 117 */ this.prevRotationYaw += 360.0F;\n/* */ }\n/* */ \n/* 120 */ this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;\n/* 121 */ this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;\n/* */ \n/* 123 */ if (this.fireworkAge == 0 && !isSlient())\n/* */ {\n/* 125 */ this.worldObj.playSoundAtEntity(this, \"fireworks.launch\", 3.0F, 1.0F);\n/* */ }\n/* */ \n/* 128 */ this.fireworkAge++;\n/* */ \n/* 130 */ if (this.worldObj.isRemote && this.fireworkAge % 2 < 2)\n/* */ {\n/* 132 */ this.worldObj.spawnParticle(EnumParticleTypes.FIREWORKS_SPARK, this.posX, this.posY - 0.3D, this.posZ, this.rand.nextGaussian() * 0.05D, -this.motionY * 0.5D, this.rand.nextGaussian() * 0.05D, new int[0]);\n/* */ }\n/* */ \n/* 135 */ if (!this.worldObj.isRemote && this.fireworkAge > this.lifetime) {\n/* */ \n/* 137 */ this.worldObj.setEntityState(this, (byte)17);\n/* 138 */ setDead();\n/* */ } \n/* */ }", "private final void \n\tdoRotation( \n\t\t\tfinal float x, \n\t\t\tfinal float y ) {\n\t\t\n\t\tif( this.mLastRotation[1] >= 0 && this.mLastRotation[2] >= 0 ) {\n\t\t\tGLES11.glTranslatef( this.mLastRotation[1], this.mLastRotation[2], 0f);\n\t\t} else {\n\t\t\tGLES11.glTranslatef( x, y, 0f);\n\t\t}\n\t\t\n\t\tGLES11.glRotatef(this.mLastRotation[0], 0f, 0f, 1f);\n\t\tif( this.mLastRotation[1] >= 0 && this.mLastRotation[2] >= 0 ) {\n\t\t\tGLES11.glTranslatef( -this.mLastRotation[1], -this.mLastRotation[2], 0f);\n\t\t} else {\n\t\t\tGLES11.glTranslatef( -x, -y, 0f);\n\t\t}\n\t}", "private void rotate(int direction){\n\t\t//Gdx.app.debug(TAG, \"rotating, this.x: \" + this.x + \", this.y: \" + this.y);\n\t\tif (direction == 1 || direction == -1){\n\t\t\tthis.orientation = (this.orientation + (direction*-1) + 4) % 4;\n\t\t\t//this.orientation = (this.orientation + direction) % 4;\n\t\t} else{\n\t\t\tthrow new RuntimeException(\"Tile invalid direction\");\n\t\t}\n\t}", "public abstract void rotateLeft();", "public void rotate(float angle);", "public void rotate() {\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\ttmp_grid[i][j] = squares[i][j];\n\t\t\t// copy back rotated 90 degrees\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\tsquares[j][i] = tmp_grid[i][3-j];\n \n //log rotation\n LogEvent(\"rotate\");\n\t\t}", "public void rotRight()\n\t{\n\t\t//only rotate if a PlayerShip is currently spawned\n\t\tIIterator iter = gameObj.getIterator();\n\t\twhile(iter.hasNext())\n\t\t{\n\t\t\tGameObject current = (GameObject)iter.getNext();\n\t\t\tif(current instanceof PlayerShip)\n\t\t\t{\n\t\t\t\t((PlayerShip)current).moveRight();\n\t\t\t\tSystem.out.println(\"Heading +20\");\n\t\t\t\tnotifyObservers();\n\t\t\t\treturn;\n\t\t\t}\t\n\t\t}\n\t\tSystem.out.println(\"There is no playerShip spawned\");\n\t}", "public static double rotation()\r\n\t{\r\n\t\treturn -(mxp.getAngle()/45);\r\n\t}", "void rotateTurtle(int turtleIndex, double degrees);", "public void rotate(float txy,float tzx,float tyz){\r\n\t\tSystem.out.println(\"err: you can not rotate the grid!\");\r\n\t}", "Node leftRotate(Node x) \n { \n Node y = x.right; \n Node T2 = y.left; \n \n // Perform rotation \n y.left = x; \n x.right = T2; \n \n // Update heights \n x.height = max(height(x.left), height(x.right)) + 1; \n y.height = max(height(y.left), height(y.right)) + 1; \n \n // Return new root \n return y; \n }", "@Override\r\n\tpublic void rotateLeft() {\n\t\tsetDirection((this.getDirection() + 3) % 4);\r\n\t}", "public float getRotation()\n {\n return rotation;\n }", "public double getRotation();", "void setOffsetWorldRotation(DMatrix3C R);", "Node rightRotate(Node x)\n\t{\n\t\tNode y=x.left;\n\t\tNode T2=y.right;\n\t\t\n\t\t//rotate\n\t\t\n\t\ty.right=x;\n\t\tx.left=T2;\n\t\t\n\t\t//update heights\n\t\ty.height=max(height(y.left),height(y.left) +1 ) ;\n\t\tx.height=max(height(x.left),height(x.left) +1 ) ;\n\t\t\n\t\t// new root\n\t\treturn y;\n\t}", "public void rotateServos() {\n if (gamepad1.x) { //change to y and x\n left.setPosition(.69); //.63 with other arms\n right.setPosition(.24); //.3 with other arms\n }\n \n if (gamepad1.y) {\n left.setPosition(0);\n right.setPosition(1);\n }\n }", "@Override\r\n\tpublic void rotateLeft() {\n\t\tfinal int THETA = 10;\r\n\t\tint dir = this.getDirection();\r\n\t\tthis.setDirection(dir - THETA);\r\n\t\t\r\n\t}", "public int getRotation() {\n\treturn rotation;\n\t//return rotation;\n}", "public void rotateY90() {\n\t\tfor (int v = 0; v < vertexCount; v++) {\n\t\t\tint x_ = vertexX[v];\n\t\t\tvertexX[v] = vertexZ[v];\n\t\t\tvertexZ[v] = -x_;\n\t\t}\n\t}", "public void rotateStick(double eX, double eY){\n\t\t\tdouble dx = eX - (x + 100); //uses basic trignometry to figure out the points, then ints them for drawing\n\t\t\tdouble dy = 595 - (eY);\n\t\t\tdouble slope = dy/dx;\n\t\t\ttheta = Math.atan(slope);\n\t\t\t\n\t\t\tif (dx < 0 && dy > 0) theta = theta+Math.PI;\n\t\t\telse if (dx < 0 && dy < 0) theta = theta + Math.PI;\n\t\t\tlx = x + 100 + 105*Math.cos(theta);\n\t\t\tly = (595 - 105*Math.sin(theta));\n\t\t}", "public static void waltz() {\n //test code written by bokun: self rotation\n leftMotor.setSpeed(ROTATE_SPEED);\n rightMotor.setSpeed(ROTATE_SPEED);\n leftMotor.forward();\n rightMotor.backward();\n }", "private void setRotation()\n\t{\n\t\tGL11.glPushMatrix();\n\t\tGL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);\n\t}", "void setRotations(Vec2 rotations);", "public void startRotate()\n {\n rotateAroundYAxis(miniEarth).play();\n }", "Node leftRotate(Node x) \n { \n Node y = x.right; \n Node T2 = y.left; \n\n // Perform rotation \n y.left = x; \n x.right = T2; \n\n // Update heights \n x.height = Math.max(height(x.left), height(x.right)) + 1; \n y.height = Math.max(height(y.left), height(y.right)) + 1; \n\n // Return new root \n return y; \n }", "public void updateRotations() {\n try {\n switch (this.mode) {\n case Packet:\n mc.player.renderYawOffset = this.yaw;\n mc.player.rotationYawHead = this.yaw;\n break;\n case Legit:\n mc.player.rotationYaw = this.yaw;\n mc.player.rotationPitch = this.pitch;\n break;\n case None:\n break;\n }\n } catch (Exception ignored) {\n\n }\n }", "private void rotateRight() {\n robot.leftBack.setPower(TURN_POWER);\n robot.leftFront.setPower(TURN_POWER);\n robot.rightBack.setPower(-TURN_POWER);\n robot.rightFront.setPower(-TURN_POWER);\n }", "public double getXRotate() {\n\t\tif (Math.abs(getRawAxis(Axis_XRotate)) > stickDeadband) {\n\t\t\treturn getRawAxis(Axis_XRotate);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "@Override\n\tpublic float getCenterOfRotationX() {\n\t\treturn 0.25f;\n\t}", "private void resetAngles() {\n \ttorso_front.rotateAngleX = 0;\n \tleg_front_left.rotateAngleX = leg_front_right.rotateAngleX = 0;\n \tleg_front_left.rotateAngleY = leg_front_right.rotateAngleY = 0;\n \tleg_front_left.rotateAngleZ = leg_front_right.rotateAngleZ = 0;\n \tleg_back_left.rotateAngleX = leg_front_left.rotateAngleX;\n \tleg_back_right.rotateAngleX = leg_front_right.rotateAngleX;\n \tleg_back_right.rotateAngleY = leg_back_left.rotateAngleY = 0;\n \tleg_back_right.rotateAngleZ = leg_back_left.rotateAngleZ = 0;\n\t\tknee_front_left.rotateAngleX = knee_front_right.rotateAngleX = 0;\n\t\tknee_back_left.rotateAngleX = knee_back_right.rotateAngleX = 0;\n\t\ttail_stub.rotateAngleX = -1.05f;\n\t\ttail_segment_1.rotateAngleX = 1.1f;\n\t\ttail_segment_2.rotateAngleX = tail_segment_3.rotateAngleX = 0;\n\t\tneck.rotateAngleX = 0.17453292519943295f;\n }", "private void rotateLeft() {\n robot.leftBack.setPower(-TURN_POWER);\n robot.leftFront.setPower(-TURN_POWER);\n robot.rightBack.setPower(TURN_POWER);\n robot.rightFront.setPower(TURN_POWER);\n }", "DMatrix3C getRotation();", "public void rotLauncher()\n\t{\n\t\t//only rotate if a PlayerShip, and therefore a MissileLauncher is spawned\n\t\tif(gameObj[1].size() > 0)\n\t\t{\n\t\t\t((PlayerShip)gameObj[1].get(0)).moveLauncher();\n\t\t\tSystem.out.println(\"Launcher rotated 10 degrees\");\n\t\t}else\n\t\t\tSystem.out.println(\"A player ship is not currently spawned\");\n\t}", "void rotatePolygon() {\n\t\tfor (int i = 0; i < amount; i++)\n\t\t\tpoint[i].rotate();\n\t}", "public abstract void rotar();", "public float getAngle () {\n\t\treturn body.getAngle();\n\t}", "public void rotate(Vector3 mousePos) {\n direction.x = mousePos.x - position.x;\n direction.y = mousePos.y - position.y;\n direction.nor();\n rotation = direction.angle();\n }", "public void rotLeft()\n\t{\n\t\t//only rotate if a PlayerShip is currently spawned\n\t\tIIterator iter = gameObj.getIterator();\n\t\twhile(iter.hasNext ())\n\t\t{\n\t\t\tGameObject current = (GameObject)iter.getNext();\n\t\t\tif(current instanceof PlayerShip)\n\t\t\t{\n\t\t\t\t((PlayerShip)current).moveLeft();\n\t\t\t\tSystem.out.println(\"Heading -20\");\n\t\t\t\tnotifyObservers();\n\t\t\t\treturn;\n\t\t\t}\t\n\t\t}\n\t\tSystem.out.println(\"There is no playerShip spawned\");\n\t}", "@Override\n\tpublic void rotateLeft(int degrees) {\n\t\t\n\t}", "@Override\r\n\tpublic void rotateRight() {\n\t\tsetDirection((this.getDirection() + 1) % 4);\r\n\t}", "public void rotateRight() {\n// tileLogic = getRotateRight();\n tileLogic = getRotateLeft();\n// rotateRightTex();\n rotateLeftTex();\n }", "public abstract Vector4fc rotateZ(float angle);", "public abstract void rotateRight();", "@Override\n\tpublic void rotation(double rx, double ry, double rz) {\n\t\tint i;\n\t\t\n\t\tfor (i = 0; i<6; i++) {\n\t\t\tthis.plans.get(i).rotation(rx, ry, rz);\n\t\t}\n\t\t//Ca me parait un peu foireux comme methode faudra voir apres ave l'interface graphique si\n\t\t//�a marche comme �a.\n\t}", "@Override\n\tpublic void rotateRight(int degrees) {\n\t\t\n\t}", "Node rightRotate(Node y) \n { \n Node x = y.left; \n Node T2 = x.right; \n \n // Perform rotation \n x.right = y; \n y.left = T2; \n \n // Update heights \n y.height = max(height(y.left), height(y.right)) + 1; \n x.height = max(height(x.left), height(x.right)) + 1; \n \n // Return new root \n return x; \n }", "public float getRotationX() {\n return mRotationX;\n }", "@Override\n\tprotected void rotate(double steps)\n\t{\n\t\tif (currentAxisIsOrigin())\n\t\t\tsuper.rotate(steps);\n\t\t\n\t\t// Otherwise rotates the object around a specific axis\n\t\telse\n\t\t\trotateAroundRelativePoint(getRotation() * steps, \n\t\t\t\t\tthis.currentRotationAxis);\n\t}", "public final void rotX(float angle) {\n\tdouble c = Math.cos(angle);\n\tdouble s = Math.sin(angle);\n\tm00 = 1.0f; m01 = 0.0f; m02 = 0.0f;\n\tm10 = 0.0f; m11 = (float)c; m12 = (float)-s;\n\tm20 = 0.0f; m21 = (float)s; m22 = (float)c;\n }", "@SideOnly(Side.CLIENT)\r\n\t public boolean shouldRotateAroundWhenRendering() {\r\n\t return true;\r\n\t }", "public float getBaseRotation() {\n return this.baseRotation;\n }", "private void rotate(final MouseEvent event) {\r\n\r\n\t\t// reset transform3D\r\n\t\tthis.rotation.rotY(0);\r\n\r\n\t\t// rotate around y-axis\r\n\t\tif (super.x_last - event.getPoint().x > 0) {\r\n\t\t\t// rotate leftwards\r\n\t\t\tthis.rotation.rotY(this.angle);\r\n\t\t} else {\r\n\t\t\t// rotate rightwards\r\n\t\t\tthis.rotation.rotY(-this.angle);\r\n\t\t}\r\n\r\n\t\t// apply rotation\r\n\t\tsuper.transformGroup.getTransform(this.transform);\r\n\t\tthis.transform.mul(this.rotation);\r\n\t\tsuper.transformGroup.setTransform(this.transform);\r\n\t}", "private Node rotateright(Node y) {\n Node x = y.left;\n Node z = x.right;\n\n // Perform rotation\n x.right = y;\n y.left = z;\n\n // updating the heights for y and x\n y.height = max(height(y.left), height(y.right)) + 1;\n x.height = max(height(x.left), height(x.right)) + 1;\n\n return x;\n }", "public void Rotation(int i) {\n mRender.Rotation(i);\n }", "public void rotateCCW() {\n for (Vector2D vec : template) {\n CCW.matrixVectorProductInPlace(vec);\n }\n }", "Node leftRotate(Node x)\n\t\t{\n\t\t\tNode y=x.right;\n\t\t\tNode T2=y.left;\n\t\t\t\n\t\t\t//rotate\n\t\t\t\n\t\t\ty.left=x;\n\t\t\tx.right=T2;\n\t\t\t\n\t\t\t//update heights\n\t\t\ty.height=max(height(y.left),height(y.left) +1 ) ;\n\t\t\tx.height=max(height(x.left),height(x.left) +1 ) ;\n\t\t\t\n\t\t\t// new root\n\t\t\treturn y;\n\t\t}", "public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity)\n {\n ModelRenderer[] var8 = this.squidTentacles;\n int var9 = var8.length;\n\n for (int var10 = 0; var10 < var9; ++var10)\n {\n ModelRenderer var11 = var8[var10];\n var11.rotateAngleX = par3;\n }\n }", "Node leftRotate(Node x) {\n Node y = x.right;\n Node T2 = y.left;\n\n // Perform rotation\n y.left = x;\n x.right = T2;\n\n // Update heights\n x.height = max(height(x.left), height(x.right)) + 1;\n y.height = max(height(y.left), height(y.right)) + 1;\n\n // Return new root\n return y;\n }", "LocalMaterialData rotate();", "@Override\r\n\tpublic void rotateRight() {\n\t\tfinal int THETA = 10;\r\n\t\tint dir = this.getDirection();\r\n\t\tthis.setDirection(dir + THETA);\r\n\t\t\r\n\t}", "public Node rotateleft(Node x) {\n Node y = x.right;\n Node z = y.left;\n\n // Perform rotation\n y.left = x;\n x.right = z;\n\n // Update heights\n x.height = max(height(x.left), height(x.right)) + 1;\n y.height = max(height(y.left), height(y.right)) + 1;\n\n return y;\n }", "public int getRotation() {\r\n\t\treturn rotation;\r\n\t}", "void copyRotation(DMatrix3 R);", "public void rightRotate(SplayNode x) {\n\t\t\t SplayNode y = x.left;\n\t\t x.left = y.right;\n\t\t if(y.right != null) {\n\t\t y.right.parent = x;\n\t\t }\n\t\t y.parent = x.parent;\n\t\t if(x.parent == null) { //x is root\n\t\t this.root = y;\n\t\t }\n\t\t else if(x == x.parent.right) { //x is left child\n\t\t x.parent.right = y;\n\t\t }\n\t\t else { //x is right child\n\t\t x.parent.left = y;\n\t\t }\n\t\t y.right = x;\n\t\t x.parent = y;\n\t\t }", "public double getRot() {\n return this.rot;\n }", "public void rotateLeft() {\n\t\tif (rotLeft == null) {\n\t\t\tQuaternion quat = new Quaternion();\n\t\t\tquat.fromAngles(0f, (float) Math.toRadians(90), 0f);\n\t\t\trotLeft = quat.toRotationMatrix();\n\t\t}\n\n\t\tgetNode().getLocalRotation().apply(rotLeft);\n\t}", "private void rotateSkybox() {\n\t\tthis.mc.getTextureManager().bindTexture(this.field_110351_G);\n\t\tGL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);\n\t\tGL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);\n\t\tGL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256);\n\t\tGlStateManager.enableBlend();\n\t\tGlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);\n\t\tGlStateManager.colorMask(true, true, true, false);\n\t\tTessellator var2 = Tessellator.getInstance();\n\t\tWorldRenderer var3 = var2.getWorldRenderer();\n\t\tvar3.startDrawingQuads();\n\t\tGlStateManager.disableAlpha();\n\t\tbyte var4 = 3;\n\n\t\tvar2.draw();\n\t\tGlStateManager.enableAlpha();\n\t\tGlStateManager.colorMask(true, true, true, true);\n\t}", "public void setRotation(int degree) {\n\trotation = degree;\n}" ]
[ "0.6961154", "0.6851926", "0.6639045", "0.65035766", "0.6471454", "0.646612", "0.6438126", "0.6351201", "0.63490885", "0.6339042", "0.6332363", "0.627259", "0.6255892", "0.62261754", "0.6218166", "0.6198597", "0.61980295", "0.61874604", "0.6135561", "0.61041987", "0.6101537", "0.60844153", "0.60810536", "0.6039542", "0.6035521", "0.6030569", "0.60198605", "0.60071385", "0.5991746", "0.59665203", "0.5963946", "0.59623873", "0.595713", "0.595365", "0.593321", "0.59292364", "0.5920104", "0.59149253", "0.59025246", "0.5902478", "0.58886313", "0.58814263", "0.58800787", "0.5873919", "0.5862582", "0.58578515", "0.5857439", "0.58553845", "0.5845184", "0.5825574", "0.582355", "0.58234215", "0.5822134", "0.5816127", "0.5781897", "0.5774166", "0.5771151", "0.5756624", "0.5745434", "0.5733269", "0.57331234", "0.57310355", "0.57287633", "0.5720788", "0.57060975", "0.57026124", "0.57010275", "0.56967527", "0.5680412", "0.5678614", "0.56703895", "0.566839", "0.56678", "0.56639737", "0.56620854", "0.56605107", "0.56603193", "0.5659556", "0.56496894", "0.56491727", "0.5636133", "0.56280315", "0.56226003", "0.562217", "0.56200475", "0.5616517", "0.56157535", "0.56133217", "0.5612864", "0.56118244", "0.5605901", "0.5604922", "0.56031376", "0.56021094", "0.5594179", "0.5591418", "0.5583486", "0.55830634", "0.55776054", "0.5573174", "0.55715394" ]
0.0
-1
Rotation around y axis.
public static Matrix3D rotY(double theta) { Matrix3D m = new Matrix3D(); m.set(0,0, Math.cos(theta)); m.set(0,2, Math.sin(theta)); m.set(2,0,-Math.sin(theta)); m.set(2,2, Math.cos(theta)); m.set(1,1, 1.0); return m; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n \t\t\t\tpublic void doRotateY() {\n \n \t\t\t\t}", "public double getYRotate() {\n\t\tif (Math.abs(getRawAxis(Axis_YRotate)) > stickDeadband) {\n\t\t\treturn getRawAxis(Axis_YRotate);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public float getRotationY() {\n return mRotationY;\n }", "public final void rotY(float angle) {\n\tdouble c = Math.cos(angle);\n\tdouble s = Math.sin(angle);\n\tm00 = (float)c; m01 = 0.0f; m02 = (float)s;\n\tm10 = 0.0f; m11 = 1.0f; m12 = 0.0f;\n\tm20 = (float)-s; m21 = 0.0f; m22 = (float)c;\n }", "public void setRotationY(float rotationY) {\n mRotationY = rotationY;\n }", "public void setToRotationY(double theta_y) {\r\n\t\tthis.set(getRotateX(theta_y));\r\n\t}", "public static Transform newYRotation(float th){\n float sinth = (float) Math.sin(th);\n float costh = (float) Math.cos(th);\n return new Transform(new float[][]{\n {costh, 0.0f, sinth, 0.0f},\n {0.0f, 1.0f, 0.0f, 0.0f},\n {-sinth, 0.0f, costh, 0.0f},\n {0.0f, 0.0f, 0.0f, 1.0f}\n });\n }", "public void rotY(double rad) {\r\n rot(rad, new Vector3d(0, 1, 0));\r\n }", "public void reverseDirectionY()\n\t{\n\t\t\n\t\tvy = -vy;\n\t}", "public double getYDirection() {\r\n return Math.sin(Math.toRadians(angle));\r\n }", "@Override\n\tpublic float getCenterOfRotationY() {\n\t\treturn 0.5f;\n\t}", "public ActionListener getRotationYListener() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn new ActionListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tit.rotationY(Math.PI/32);\r\n\t\t\t}\r\n\t\t};\r\n\t}", "public AVLNode rotateRight(AVLNode y) {\n AVLNode x = y.getLeft();\n AVLNode T2 = x.getRight();\n \n //rotation\n x.setRight(y);\n y.setLeft(T2);\n \n //update heights\n x.setHeight(Math.max(getHeight(x.getLeft()), getHeight(x.getRight())) + 1);\n y.setHeight(Math.max(getHeight(y.getLeft()), getHeight(y.getRight())) + 1);\n \n return x;\n }", "default void setY(double y)\n {\n getAxis().setY(y);\n }", "public Vector rotateAroundAxisY(Vector center, double theta) {\n double cosTheta = Math.cos(theta);\n double sinTheta = Math.sin(theta);\n Vector centered = difference(center);\n Vector rotated = new Vector(\n centered.z * sinTheta - centered.x * cosTheta,\n centered.y,\n centered.z * cosTheta + centered.x * sinTheta\n );\n return rotated.sum(center);\n }", "private Node rotateright(Node y) {\n Node x = y.left;\n Node z = x.right;\n\n // Perform rotation\n x.right = y;\n y.left = z;\n\n // updating the heights for y and x\n y.height = max(height(y.left), height(y.right)) + 1;\n x.height = max(height(x.left), height(x.right)) + 1;\n\n return x;\n }", "public double getGyroAngleY() {\n return m_gyro.getAngleY();\n }", "public void setRotY(double rad) {\r\n setRot(rad, new Vector3d(0, 1, 0));\r\n }", "public double getRightJoystickVertical() {\n\t\treturn getRawAxis(RIGHT_STICK_VERTICAL) * -1;\n\t}", "public void rotY(float angleRad) {\n float rotY = cameraRot.getY();\n rotY += angleRad;\n cameraRot.setY(rotY);\n }", "public ChartYAxis getYAxis() { return _yaxis; }", "public void reverseYVelocity() {\n yVelocity = -yVelocity + 50;\n this.normalizeVelocity(this.xVelocity, this.yVelocity);\n }", "Node rightRotate(Node y) {\n Node x = y.left;\n Node T2 = x.right;\n\n // Perform rotation\n x.right = y;\n y.left = T2;\n\n // Update heights\n y.height = max(height(y.left), height(y.right)) + 1;\n x.height = max(height(x.left), height(x.right)) + 1;\n\n // Return new root\n return x;\n }", "Node rightRotate(Node y) \n { \n Node x = y.left; \n Node T2 = x.right; \n\n // rotation \n x.right = y; \n y.left = T2; \n\n // heights \n y.height = Math.max(height(y.left), height(y.right)) + 1; \n x.height = Math.max(height(x.left), height(x.right)) + 1; \n\n // Return new root \n return x; \n }", "public double getRotation2() {\n return rotation2;\n }", "public float setRotationY(float hand_positionX, float r_mapY_start) {\n r_yStart = r_mapY_start - ((270.0f / (1200.0f-100.0f)) * (hand_positionX-100.0f));\n return r_yStart;\n}", "private double y(double pt){\n pt = -pt;\n if (pt<=0) pt = 90 + -pt;\n else pt = 90 - pt;\n\n pt = 180-pt;\n return pt;\n }", "public int getY()\n {\n return yaxis;\n }", "Node rightRotate(Node y) \n { \n Node x = y.left; \n Node T2 = x.right; \n \n // Perform rotation \n x.right = y; \n y.left = T2; \n \n // Update heights \n y.height = max(height(y.left), height(y.right)) + 1; \n x.height = max(height(x.left), height(x.right)) + 1; \n \n // Return new root \n return x; \n }", "public double getRotation() {\n return Degrees.atan2(y, x);\n }", "public static AffineTransform3D getRotateY(double theta) {\r\n\r\n\t\tAffineTransform3D rv = new AffineTransform3D();\r\n\t\tdouble sin = Math.sin(theta);\r\n\t\tdouble cos = Math.cos(theta);\r\n\t\trv.M11 = cos;\r\n\t\trv.M31 = sin;\r\n\t\trv.M13 = -sin;\r\n\t\trv.M33 = cos;\r\n\t\trv.M22 = 1;\r\n\t\trv.M12 = 0;\r\n\t\trv.M23 = 0;\r\n\t\trv.M14 = 0;\r\n\t\trv.M21 = 0;\r\n\t\trv.M24 = 0;\r\n\t\trv.M32 = 0;\r\n\t\trv.M34 = 0;\r\n\t\trv.M41 = 0;\r\n\t\trv.M42 = 0;\r\n\t\trv.M43 = 0;\r\n\t\trv.M44 = 1;\r\n\t\treturn rv;\r\n\t}", "public double getRotation();", "public double getRightYAxis() {\n\t\treturn getRawAxis(Axis_RightY);\n\t}", "public void testYAxisRotation() {\n v = 1;\n theta = 2*pi;\n double[] point = new double[] {1, 1, 0};\n RotationMatrix rM = new RotationMatrix(a, b, c, u, v, w, theta);\n double[] result = rM.timesXYZ(point);\n double[] expect = new double[] {1, 1, 0, 1};\n for(int i=0; i<result.length; i++) {\n assertEquals(expect[i], result[i], TOLERANCE);\n }\n\n theta = 12*pi;\n rM = new RotationMatrix(a, b, c, u, v, w, theta);\n //rM.logMatrix();\n result = rM.timesXYZ(point);\n expect = new double[] {1, 1, 0, 1};\n for(int i=0; i<result.length; i++) {\n assertEquals(\"coord: \"+i, expect[i], result[i], TOLERANCE);\n }\n\n theta = pi;\n rM = new RotationMatrix(a, b, c, u, v, w, theta);\n //rM.logMatrix();\n result = rM.timesXYZ(point);\n expect = new double[] {-1, 1, 0, 1};\n for(int i=0; i<result.length; i++) {\n assertEquals(\"coord: \"+i, expect[i], result[i], TOLERANCE);\n }\n\n theta = pi/2;\n rM = new RotationMatrix(a, b, c, u, v, w, theta);\n result = rM.timesXYZ(point);\n expect = new double[] {0, 1, -1, 1};\n for(int i=0; i<result.length; i++) {\n assertEquals(\"coord: \"+i, expect[i], result[i], TOLERANCE);\n }\n\n theta = pi/4;\n rM = new RotationMatrix(a, b, c, u, v, w, theta);\n result = rM.timesXYZ(point);\n expect = new double[] {Math.sqrt(2)/2, 1, -Math.sqrt(2)/2, 1};\n for(int i=0; i<result.length; i++) {\n assertEquals(\"coord: \"+i, expect[i], result[i], TOLERANCE);\n }\n }", "public String getYKey(){\n return getAxisKey(Axis.Y);\n }", "private void resetIconYAxis(View view) {\n if (view.getRotationY() != 0) {\n view.setRotationY(0);\n }\n }", "private void resetIconYAxis(View view) {\n if (view.getRotationY() != 0) {\n view.setRotationY(0);\n }\n }", "double deltaY() {\n return Math.sin(Math.toRadians(this.theta)) * this.length;\n }", "void setArrowTranslateY(double y) {\n setTranslateY(y);\n triangle.setTranslateY(y);\n }", "public void rotateY(double angle) {\n\t\tthis.vector.rotateY(angle);\n\t}", "public void setY(double y)\r\n\t{\t\r\n\t\tvirtualDxfPoint.setTransformationY(y);\r\n\t\tAnchor.setY(y);\r\n\t}", "public void SetY2()\n\t{\n\t\tdouble h;\n\t\th = Math.pow(this.length, 2) - Math.pow((this.length/2), 2);\n\t\th = Math.sqrt(h);\n\t\tthis.y[2] = this.y[0] - h;\n\t}", "public int getYDir() {\r\n\t\treturn yDir;\r\n\t}", "void rightRotate(Node<K, V> y) {\n\t\tassert IsNotNil(y.getLeft());\n\t\tNode<K, V> x = y.getLeft();\n\n\t\t// B in postion\n\t\ty.setLeft(x.getRight());\n\n\t\t// X to root\n\t\tif (y == root) {\n\t\t\troot = x;\n\t\t} else if (y.isRightChild()) {\n\t\t\ty.getParent().setRight(x);\n\t\t} else if (y.isLeftChild()) {\n\t\t\ty.getParent().setLeft(x);\n\t\t}\n\n\t\t// y in position\n\t\tx.setRight(y);\n\t}", "int getEndRotationDegree();", "public float getTiltY() {\n return pm.pen.getLevelValue(PLevel.Type.TILT_Y);\n }", "public double getY() {\n\t\treturn bassY;\n\t}", "public void setYPosition(double y)\n\t{\n\t\tthis.yPosition = y;\n\t}", "public double getModY() {\n return (modY != 0 ? ( modY > 0 ? (modY - RESTADOR) : (modY + RESTADOR) ) : modY);\n }", "public void rotateY( float angle )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.rotY( angle );\n\t\tmat.mul( opMat );\n\t}", "public double getAngleYZ() {\r\n\t\tdouble l = this.lenght();\r\n\t\tif (l==0)\r\n\t\t\treturn 0;\r\n\t\treturn Math.asin(this.x/l);\r\n\t}", "public void moveY() {\n\t\tsetY( getY() + getVy() );\n\t}", "public double getRotationAngleInRadians() {\n return Math.toRadians(rotationAngle);\n }", "public double getY() {\n return mY;\n }", "public static TreapNode rightRotate(TreapNode y)\n {\n TreapNode x = y.left, T2 = x.right;\n\n // Perform rotation\n x.right = y;\n y.left = T2;\n\n // Return new root\n return x;\n }", "public void setY(double y) {\n\t\tthis.y = y;\n\t}", "public void rotateY180() {\n\t\tfor (int v = 0; v < vertexCount; v++) {\n\t\t\tvertexZ[v] = -vertexZ[v];\n\t\t}\n\t\tfor (int f = 0; f < faceCount; f++) {\n\t\t\tint a = faceVertexA[f];\n\t\t\tfaceVertexA[f] = faceVertexC[f];\n\t\t\tfaceVertexC[f] = a;\n\t\t}\n\t}", "public void setY(Double y) {\n\t\tthis.y = y;\n\t}", "public double GetY(){\n return this._Y;\n }", "public double getAngle2() {\n\n // We experimentally determined the Z axis is the axis we want to use for heading angle.\n // We have to process the angle because the imu works in euler angles so the Z axis is\n // returned as 0 to +180 or 0 to -180 rolling back to -179 or +179 when rotation passes\n // 180 degrees. We detect this transition and track the total cumulative angle of rotation.\n\n Orientation angles = imu.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.ZYX, AngleUnit.DEGREES);\n\n\n\n double deltaAngle = angles.firstAngle - lastAngles.firstAngle;\n\n if (deltaAngle < -180)\n deltaAngle += 360;\n else if (deltaAngle > 180)\n deltaAngle -= 360;\n\n\n globalAngle += deltaAngle;\n\n lastAngles = angles;\n\n return (globalAngle);\n\n }", "@Override\n\tpublic double getY() {\n\t\treturn y;\n\t}", "public void setY(double y) {\n this.y = y;\n }", "public void setY(double y) {\n this.y = y;\n }", "public void setY(double y) {\n this.y = y;\n }", "public void moveVertical(int y)\n {\n wall.moveVertical(y);\n roof.moveVertical(y);\n window.moveVertical(y);\n }", "public float getYComponent() {\n return this.vy;\n }", "public void reverseY()\r\n {\r\n\t if(moveY < 0)\r\n\t\t moveY = moveY * (-1);\r\n\t else if(moveY > 0)\r\n\t\t moveY = moveY * (-1);\r\n }", "public void setY(double y) {\n this.y = y;\r\n }", "public float reverseEngineerY(float y) {\r\n\t\treturn y + this.getYPos();\r\n\t}", "public void setY(int y){\n\t\tthis.y_location = y;\n\t}", "public double getDeltaY() {\n return deltaY;\n }", "public double getDeltaY() {\n return deltaY;\n }", "void setY(int y) {\n position = position.setY(y);\n }", "public final double getY() {\n return y;\n }", "public void setY(double y)\n\t{\n\t\tthis.y = y;\n\t}", "public void setY(double y)\n {\n this.y = y;\n }", "public void rotateRight() {\n\t\tthis.direction = this.direction.rotateRight();\n\t}", "public void animeRotateY(boolean state){\n if(ani==null) {\n ani = ObjectAnimator.ofFloat(findViewById(R.id.menu_button) // 動畫目標\n , \"rotationY\" // 動畫效果 (Y 軸翻轉)\n , 0f // 開始角度\n , 180f // 結束角度\n );\n ani.setDuration(1500); // 動畫時間\n ani.setRepeatCount(ValueAnimator.INFINITE);\n }\n if(!state)\n ani.start();\n else\n ani.end();\n }", "public final double getY() {\n return y;\n }", "public void setMovementY(int directionY) {\r\n movementY = directionY;\r\n }", "public void setY(double y){\n this.y = y;\n }", "public void setY(double y){\n this.y = y;\n }", "@Basic\n\tpublic double getY() {\n\t\treturn this.y;\n\t}", "public void setY( int y ) {\n\t\t//not checking if y is valid because that depends on the coordinate system\n\t\tthis.y = y;\n\t}", "public void setY(float y) {\r\n\t\tthis.y = y;\r\n\t}", "public void setPositionY(float y) {\n\t\tthis.position.set(this.position.x, y, 0);\n\t}", "public void drawYaxis(Graphics2D g)\r\n { \r\n //draw y axis\r\n g.drawLine( 0, 0, 0, -height );\r\n \r\n //scale y axis\r\n for (double i = 0; i <= yRange; i += yScale)\r\n {\r\n int yP = -yPixScale(i);\r\n g.drawLine(-dWidth, yP, dWidth, yP);\r\n String numLabel = Fun.round( (i + yStart), scaleSigFig ) + \"\";\r\n drawStringY( numLabel, -dWidth - 1, yP, g );\r\n }\r\n \r\n //label y axis, and the label has to be sideways\r\n \r\n //orig = the way g is oriented right now\r\n AffineTransform orig = g.getTransform();\r\n \r\n //move g and display the label\r\n g.translate( -leftSpace/2 - 10, -height/2 );\r\n g.rotate(-Math.PI / 2); //-90 degrees\r\n drawStringX(yName, 0, 0, g);\r\n\r\n //move g back\r\n g.setTransform(orig);\r\n }", "public double getDeltaY() {\n return deltaY;\n }", "public NodeRB rotateRight(NodeRB y) {\n NodeRB x = y.left;\r\n //System.out.println(\"[...] Left of the pivot: \" + x.value);\r\n NodeRB c = x.right;\r\n NodeRB p = fetchParentOf(y.value);\r\n //System.out.println(y.value + \" is now the right of \" + x.value);\r\n if (y == this.root){\r\n this.root = x;\r\n }\r\n x.right = y;\r\n y.left = c;\r\n if (p != null){\r\n //System.out.print(\"[....] The pivot has a parent \" + p.value + \". Setting \" + x.value + \" to its \");\r\n if (p.getRight() == y){\r\n //System.out.println(\"right.\");\r\n p.right = (x);\r\n }\r\n else{\r\n //System.out.println(\"left.\");\r\n p.left = (x);\r\n }\r\n }\r\n return x;\r\n }", "@Override\n\tpublic void setY(int y) {\n\t\tyPos = y;\n\t}", "public void setY(int y) {\n\t\tthis.Y = y;\n\t}", "@Override\n\tpublic float getY() \n\t{\n\t\treturn _y;\n\t}", "public void getY() {\n APIlib.getInstance().addJSLine(jsBase + \".getY();\");\n }", "public void setY(Float y) {\n\t\tthis.y = y;\n\t}", "@Override\n\tpublic double GetY() {\n\t\treturn 0f;\n\t}", "public double getY() {\n\t\treturn y;\n\t}", "public double getY() {\n\t\treturn y;\n\t}", "public double getY() {\n\t\treturn y;\n\t}", "public double getY() {\n\t\treturn y;\n\t}", "public Direction rotate270() {\n return values()[r270index];\n }" ]
[ "0.7661506", "0.7576765", "0.75416565", "0.734768", "0.7234285", "0.7112417", "0.675216", "0.6722399", "0.6602971", "0.65965724", "0.64878064", "0.64750445", "0.64525497", "0.6402456", "0.6396811", "0.6394187", "0.63940394", "0.63881695", "0.6348112", "0.62663066", "0.625686", "0.62062013", "0.61901426", "0.6158973", "0.61539775", "0.61106527", "0.6106882", "0.60871524", "0.6075495", "0.60612655", "0.6058502", "0.60328484", "0.6023311", "0.5964099", "0.59372467", "0.5934475", "0.5934475", "0.59266084", "0.59253466", "0.5920903", "0.5890276", "0.5883928", "0.5878555", "0.5873736", "0.58721954", "0.5857525", "0.5856006", "0.58448416", "0.58379", "0.58349913", "0.5797992", "0.57926816", "0.5788835", "0.57757735", "0.57705975", "0.57623184", "0.57582706", "0.5749015", "0.57479334", "0.5737609", "0.5731486", "0.5725966", "0.5725966", "0.5725966", "0.57190293", "0.5714881", "0.57094103", "0.57086325", "0.5707392", "0.56858104", "0.5673618", "0.5673618", "0.56677735", "0.5664666", "0.56643033", "0.5660202", "0.5658436", "0.5657483", "0.5655298", "0.56541795", "0.56514484", "0.56514484", "0.5634865", "0.5632151", "0.56259054", "0.56257784", "0.5624867", "0.5620268", "0.5614613", "0.5611883", "0.56018305", "0.5601192", "0.56003803", "0.55936277", "0.5592527", "0.5591572", "0.5591572", "0.5591572", "0.5591572", "0.5589751" ]
0.58839786
41
Rotation around z axis.
public static Matrix3D rotZ(double theta) { Matrix3D m = new Matrix3D(); m.set(0,0, Math.cos(theta)); m.set(0,1,-Math.sin(theta)); m.set(1,0, Math.sin(theta)); m.set(1,1, Math.cos(theta)); m.set(2,2, 1.0); return m; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void zRotate() {\n\t\t\n\t}", "@Override\n \t\t\t\tpublic void doRotateZ() {\n \n \t\t\t\t}", "public float getRotateZ() { return rotateZ; }", "public void rotateZ( float angle )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.rotZ( angle );\n\t\tmat.mul( opMat );\n\t}", "void rotate(float x, float y, float z) {\n target_angle[0] += x;\n target_angle[1] += y;\n target_angle[2] += z;\n postSetAngle();\n }", "DMatrix3C getRotation();", "public final void rotZ(float angle) {\n\tdouble c = Math.cos(angle);\n\tdouble s = Math.sin(angle);\n\tm00 = (float)c; m01 = (float)-s; m02 = 0.0f;\n\tm10 = (float)s; m11 = (float)c; m12 = 0.0f;\n\tm20 = 0.0f; m21 = 0.0f; m22 = 1.0f;\n }", "public void rotate( float x, float y, float z, float angle )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.set( new AxisAngle4f( x, y, z, angle ) );\n\t\tmat.mul( opMat );\n\t}", "public void setRotateAngle(Cuboid modelRenderer, float x, float y, float z) {\n modelRenderer.rotationPointX = x;\n modelRenderer.rotationPointY = y;\n modelRenderer.rotationPointZ = z;\n }", "public static Transform newZRotation(float th){\n float sinth = (float) Math.sin(th);\n float costh = (float) Math.cos(th);\n return new Transform(new float[][]{\n {costh, -sinth, 0.0f, 0.0f},\n {sinth, costh, 0.0f, 0.0f},\n {0.0f, 0.0f, 1.0f, 0.0f},\n {0.0f, 0.0f, 0.0f, 1.0f}\n });\n }", "public abstract Vector4fc rotateZ(float angle);", "public double getRotation();", "public void rotateZ(double angle) {\n\t\tthis.vector.rotateZ(angle);\n\t}", "public void setToRotationZ(double theta_z) {\r\n\t\tthis.set(getRotateX(theta_z));\r\n\t}", "void setRotation (DMatrix3C R);", "public void rotZ(double rad) {\r\n rot(rad, new Vector3d(0, 0, 1));\r\n }", "public Vector rotateAboutZAxis(double theta){\n\t\tdouble newX = x*Math.cos(theta) - y*Math.sin(theta);\n\t\tdouble newY = x*Math.sin(theta) + y*Math.cos(theta);\n\t\t\n\t\treturn new Vector(newX, newY, z);\n\t\t\n\t\t\n\t}", "private void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z)\n {\n modelRenderer.rotateAngleX = x;\n modelRenderer.rotateAngleY = y;\n modelRenderer.rotateAngleZ = z;\n }", "@Override\n\tpublic Rotation3 GetRotation() {\n\t\treturn new Rotation3(0f);\n\t}", "public void rotate(float angle, float x, float y, float z) {\n Matrix.rotateM(mModelMatrix, 0, angle, x, y, z);\n }", "public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {\n\t\tmodelRenderer.rotateAngleX = x;\n\t\tmodelRenderer.rotateAngleY = y;\n\t\tmodelRenderer.rotateAngleZ = z;\n\t}", "public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {\n\t\tmodelRenderer.rotateAngleX = x;\n\t\tmodelRenderer.rotateAngleY = y;\n\t\tmodelRenderer.rotateAngleZ = z;\n\t}", "public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {\n\t\tmodelRenderer.rotateAngleX = x;\n\t\tmodelRenderer.rotateAngleY = y;\n\t\tmodelRenderer.rotateAngleZ = z;\n\t}", "public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {\n\t\tmodelRenderer.rotateAngleX = x;\n\t\tmodelRenderer.rotateAngleY = y;\n\t\tmodelRenderer.rotateAngleZ = z;\n\t}", "public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {\n\t\tmodelRenderer.rotateAngleX = x;\n\t\tmodelRenderer.rotateAngleY = y;\n\t\tmodelRenderer.rotateAngleZ = z;\n\t}", "public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {\n modelRenderer.rotateAngleX = x;\n modelRenderer.rotateAngleY = y;\n modelRenderer.rotateAngleZ = z;\n }", "public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {\n modelRenderer.rotateAngleX = x;\n modelRenderer.rotateAngleY = y;\n modelRenderer.rotateAngleZ = z;\n }", "public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {\n modelRenderer.rotateAngleX = x;\n modelRenderer.rotateAngleY = y;\n modelRenderer.rotateAngleZ = z;\n }", "public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {\n modelRenderer.rotateAngleX = x;\n modelRenderer.rotateAngleY = y;\n modelRenderer.rotateAngleZ = z;\n }", "public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {\n modelRenderer.rotateAngleX = x;\n modelRenderer.rotateAngleY = y;\n modelRenderer.rotateAngleZ = z;\n }", "public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {\n modelRenderer.rotateAngleX = x;\n modelRenderer.rotateAngleY = y;\n modelRenderer.rotateAngleZ = z;\n }", "public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {\n modelRenderer.rotateAngleX = x;\n modelRenderer.rotateAngleY = y;\n modelRenderer.rotateAngleZ = z;\n }", "public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {\n modelRenderer.rotateAngleX = x;\n modelRenderer.rotateAngleY = y;\n modelRenderer.rotateAngleZ = z;\n }", "public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {\n modelRenderer.rotateAngleX = x;\n modelRenderer.rotateAngleY = y;\n modelRenderer.rotateAngleZ = z;\n }", "public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {\n modelRenderer.rotateAngleX = x;\n modelRenderer.rotateAngleY = y;\n modelRenderer.rotateAngleZ = z;\n }", "public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {\n modelRenderer.rotateAngleX = x;\n modelRenderer.rotateAngleY = y;\n modelRenderer.rotateAngleZ = z;\n }", "public void setRotZ(double rad) {\r\n setRot(rad, new Vector3d(0, 0, 1));\r\n }", "public static Matrix RotationYawPitchRoll(float x, float y, float z) {\n return getRotationX(x).times(getRotationY(y));\n }", "public void setRotateAngle(RendererModel RendererModel, float x, float y, float z)\n\t{\n\t\tRendererModel.rotateAngleX = x;\n\t\tRendererModel.rotateAngleY = y;\n\t\tRendererModel.rotateAngleZ = z;\n\t}", "public float getRotation() {\n return this.rotation;\n }", "public static double rotation()\r\n\t{\r\n\t\treturn -(mxp.getAngle()/45);\r\n\t}", "public float getRotation()\n {\n return rotation;\n }", "public void setRotateAngle(Cuboid model, float x, float y, float z) {\n model.pitch = x;\n model.yaw = y;\n model.roll = z;\n }", "void orientation(double xOrientation, double yOrientation, double zOrientation);", "public abstract Vector4fc rotateAbout(float angle, float x, float y, float z);", "public void calculateRotation() {\r\n float x = this.getX();\r\n float y = this.getY();\r\n\r\n float mouseX = ((float) Mouse.getX() - 960) / (400.0f / 26.0f);\r\n float mouseY = ((float) Mouse.getY() - 540) / (400.0f / 23.0f);\r\n\r\n float b = mouseX - x;\r\n float a = mouseY - y;\r\n\r\n rotationZ = (float) Math.toDegrees(Math.atan2(a, b)) + 90;\r\n\r\n forwardX = (float) Math.sin(Math.toRadians(rotationZ));\r\n forwardY = (float) -Math.cos(Math.toRadians(rotationZ));\r\n }", "private void m128161c(boolean z) {\n if (z) {\n ObjectAnimator ofFloat = ObjectAnimator.ofFloat(this.f104234x, \"rotation\", new float[]{0.0f, 180.0f});\n ofFloat.setDuration(300);\n ofFloat.start();\n } else {\n ObjectAnimator ofFloat2 = ObjectAnimator.ofFloat(this.f104234x, \"rotation\", new float[]{180.0f, 0.0f});\n ofFloat2.setDuration(300);\n ofFloat2.start();\n }\n this.f104235y.mo99814a(z);\n }", "public void increaseRotation(float dx, float dy, float dz);", "public void rotateTransform(Vector3f rot) {\r\n\t\tMatrix4f rx = new Matrix4f();\r\n\t\tMatrix4f ry = new Matrix4f();\r\n\t\tMatrix4f rz = new Matrix4f();\r\n\t\t\t\t\r\n\t\t// Convert the angles to radians\r\n\t\tfloat x = (float) Math.toRadians(rot.x);\r\n\t\tfloat y = (float) Math.toRadians(rot.y);\r\n\t\tfloat z = (float) Math.toRadians(rot.z);\r\n\r\n\t\t// Create the X-Rotation matrix\r\n\t\trx.m[0][0] = 1.0f; rx.m[0][1] = 0.0f;\t \t\t\t rx.m[0][2] = 0.0f; \t\t\t\trx.m[0][3] = 0.0f;\r\n\t rx.m[1][0] = 0.0f; rx.m[1][1] = (float) Math.cos(x); rx.m[1][2] = (float) -Math.sin(x); rx.m[1][3] = 0.0f;\r\n\t rx.m[2][0] = 0.0f; rx.m[2][1] = (float) Math.sin(x); rx.m[2][2] = (float) Math.cos(x) ; rx.m[2][3] = 0.0f;\r\n\t rx.m[3][0] = 0.0f; rx.m[3][1] = 0.0f; \t\t\t\t rx.m[3][2] = 0.0f;\t\t \t\t\trx.m[3][3] = 1.0f;\r\n\r\n\t // Create the Y-Rotation matrix\r\n\t ry.m[0][0] = (float) Math.cos(y); ry.m[0][1] = 0.0f; ry.m[0][2] = (float) -Math.sin(y); ry.m[0][3] = 0.0f;\r\n\t ry.m[1][0] = 0.0f; \t\t\t\t ry.m[1][1] = 1.0f; ry.m[1][2] = 0.0f; \t\t\t\try.m[1][3] = 0.0f;\r\n\t ry.m[2][0] = (float) Math.sin(y); ry.m[2][1] = 0.0f; ry.m[2][2] = (float) Math.cos(y) ; ry.m[2][3] = 0.0f;\r\n\t ry.m[3][0] = 0.0f; \t\t\t\t ry.m[3][1] = 0.0f; ry.m[3][2] = 0.0f; \t\t\t\try.m[3][3] = 1.0f;\r\n\r\n\t // Create the Z-Rotation matrix\r\n\t rz.m[0][0] = (float) Math.cos(z); rz.m[0][1] = (float) -Math.sin(z); rz.m[0][2] = 0.0f; rz.m[0][3] = 0.0f;\r\n\t rz.m[1][0] = (float) Math.sin(z); rz.m[1][1] = (float) Math.cos(z) ; rz.m[1][2] = 0.0f; rz.m[1][3] = 0.0f;\r\n\t rz.m[2][0] = 0.0f; \t\t\t\t rz.m[2][1] = 0.0f; \t\t\t\t rz.m[2][2] = 1.0f; rz.m[2][3] = 0.0f;\r\n\t rz.m[3][0] = 0.0f; \t\t\t\t rz.m[3][1] = 0.0f; \t\t\t\t rz.m[3][2] = 0.0f; rz.m[3][3] = 1.0f;\r\n\t\t\t\r\n\t // Multiply all the matrices together\r\n\t\tMatrix4f rzy = rz.mult(ry);\r\n\t\tMatrix4f r = rzy.mult(rx);\r\n\t\t\t \r\n\t\tm = r.m;\r\n\r\n\t}", "public static AffineTransform3D getRotateZ(double theta) {\r\n\r\n\t\tAffineTransform3D rv = new AffineTransform3D();\r\n\t\tdouble sin = Math.sin(theta);\r\n\t\tdouble cos = Math.cos(theta);\r\n\t\trv.M11 = cos;\r\n\t\trv.M12 = sin;\r\n\t\trv.M21 = -sin;\r\n\t\trv.M22 = cos;\r\n\t\trv.M33 = 1;\r\n\t\trv.M13 = 0;\r\n\t\trv.M31 = 0;\r\n\t\trv.M14 = 0;\r\n\t\trv.M32 = 0;\r\n\t\trv.M24 = 0;\r\n\t\trv.M23 = 0;\r\n\t\trv.M34 = 0;\r\n\t\trv.M41 = 0;\r\n\t\trv.M42 = 0;\r\n\t\trv.M43 = 0;\r\n\t\trv.M44 = 1;\r\n\t\treturn rv;\r\n\t}", "public Matrix4 setToRotation(float axisX, float axisY, float axisZ, float angle) {\n if (angle != 0.0f) {\n return set(quat.set(tmpV.set(axisX, axisY, axisZ), angle));\n }\n idt();\n return this;\n }", "public void rotZ(float angleRad) {\n float rotZ = cameraRot.getZ();\n rotZ += angleRad;\n cameraRot.setZ(rotZ);\n }", "public float getRotation() {\n\t\treturn rotation;\n\t}", "public void rotate(float txy,float tzx,float tyz){\r\n\t\tSystem.out.println(\"err: you can not rotate the grid!\");\r\n\t}", "public Transform getRotationTransformation() {\n Transform t = Transform.newXRotation(rotation.x);\n t = t.compose(Transform.newYRotation(rotation.y));\n t = t.compose(Transform.newZRotation(rotation.z));\n return t;\n }", "public Quaternion getPhysicsRotation(){\n return getPhysicsRotation(null);\n }", "public void rotate() {\n // amoeba rotate\n // Here i will use my rotation_x and rotation_y\n }", "public void rotate(float angle);", "public Vector3f getRotationVec() {\n\t\treturn m_xforms[NvCameraXformType.MAIN].m_rotate;\n\t}", "public Vec4 rotateZ(final double alpha) {\n expectDirection();\n final double sin = Math.sin(alpha);\n final double cos = Math.cos(alpha);\n return new Vec4(cos * x - sin * y, sin * x + cos * y, z, false);\n }", "void rotate() {\n startAnimation(allSubCubes(), Axis.Y, Direction.CLOCKWISE);\n rotateCubeSwap();\n }", "int getRotationDegrees() {\n return rotationDegrees;\n }", "public void postRotate(float angle, float x, float y, float z){\n angle = (float)Math.toRadians(angle);\n \n float len = (float) Math.sqrt(x*x+y*y+z*z);\n if(len != 1){\n x /= len;\n y /= len;\n z /= len;\n }\n float c = (float) Math.cos(angle);\n float s = (float) Math.sin(angle);\n \n float[] r = {\n x*x*(1-c)+c , x*y*(1-c)-z*s, x*z*(1-c)+y*s, 0,\n y*x*(1-c)+z*s, y*y*(1-c)+c, y*z*(1-c)-x*s, 0,\n x*z*(1-c)-y*s, y*z*(1-c)+x*s, z*z*(1-c)+c, 0,\n 0, 0 , 0, 1};\n\n matrix = mulMM(matrix, r);\n }", "public int getRotation() {\r\n\t\treturn rotation;\r\n\t}", "public void rotate(double theta_x, double theta_y, double theta_z) {\r\n\t\tthis.set(MatrixMult(this, getRotateInstance(theta_x, theta_y, theta_z)));\r\n\t}", "public void postRotateQuat(float x, float y, float z, float w) {\n \n float len = (float) Math.sqrt(x*x+y*y+z*z+w*w);\n if(len != 1){\n x /= len;\n y /= len;\n z /= len;\n w /= len;\n }\n \n float[] r = { \n 1 - (2*y*y + 2*z*z), 2*x*y - 2*z*w, 2*x*z+2*y*w, 0,\n 2*x*y + 2*z*w, 1 - (2*x*x + 2*z*z), 2*y*z-2*x*w, 0,\n 2*x*z - 2*y*w, 2*y*z + 2*x*w, 1 - (2*x*x+2*y*y), 0,\n 0, 0, 0, 1.0f};\n matrix = mulMM(matrix, r);\n }", "void rotate();", "public static AffineTransform3D getRotateInstance(double theta_x,\r\n\t\t\tdouble theta_y, double theta_z) {\r\n\t\tAffineTransform3D rv = new AffineTransform3D();\r\n\t\trv = MatrixMult(MatrixMult(getRotateX(theta_x), getRotateY(theta_y)),\r\n\t\t\t\tgetRotateZ(theta_z));\r\n\t\treturn rv;\r\n\t}", "public Matrix4 rotate(float axisX, float axisY, float axisZ, float angle) {\n if (angle == 0.0f) {\n return this;\n }\n quat.set(tmpV.set(axisX, axisY, axisZ), angle);\n return rotate(quat);\n }", "public void setRotation(int degree) {\n\trotation = degree;\n}", "@Override\n\tpublic float getRotation() {\n\t\treturn player.getRotation();\n\t}", "public int getRotation() {\n\treturn rotation;\n\t//return rotation;\n}", "public ActionListener getRotationZListener() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn new ActionListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tit.rotationZ(Math.PI/32);\r\n\t\t\t}\r\n\t\t};\r\n\t}", "public void rotate(){\n\t\t\n\t\tfor(Vertex v : vertices){\n\n\t\t\tMatrix m = ViewSettings.getRotationMatrix4().multiply(v);\n\n\t\t\tv.setX(m.getValue(0, 0));\n\t\t\tv.setY(m.getValue(1, 0));\n\t\t\tv.setZ(m.getValue(2, 0));\n\t\t\tv.setW(m.getValue(3, 0));\n\t\t}\n\t}", "public Vector rotateAroundAxisZ(Vector center, double theta) {\n double cosTheta = Math.cos(theta);\n double sinTheta = Math.sin(theta);\n Vector centered = difference(center);\n Vector rotated = new Vector(\n centered.x * cosTheta - centered.y * sinTheta,\n centered.x * sinTheta + centered.y * cosTheta,\n centered.z\n );\n return rotated.sum(center);\n }", "public static Matrix rotateZ(double rad) {\n List<List<Double>> backingArray = get2DListOfSize(4);\n /*\n |cosr -sinr 0 0|\n |sinr cosr 0 0|\n |0 0 1 0|\n |0 0 0 1|\n */\n double cos = Math.cos(rad);\n double sin = Math.sin(rad);\n\n backingArray.get(0).set(0, cos);\n backingArray.get(0).set(1, -1*sin);\n backingArray.get(1).set(0, sin);\n backingArray.get(1).set(1, cos);\n backingArray.get(2).set(2, 1d);\n backingArray.get(3).set(3, 1d);\n\n return new Matrix(backingArray);\n }", "LocalMaterialData rotate();", "public void Rotation(int i) {\n mRender.Rotation(i);\n }", "public void rotate(double yaw, double pitch, double roll)\n {\n double yawRadians = Math.toRadians(yaw);\n double pitchRadians = Math.toRadians(pitch);\n double rollRadians = Math.toRadians(roll);\n\n double x = this.x;\n double y = this.y;\n double z = this.z;\n\n this.x = x * Math.cos(yawRadians) * Math.cos(pitchRadians) + z * (Math.cos(yawRadians) * Math.sin(pitchRadians) * Math.sin(rollRadians) - Math.sin(yawRadians) * Math.cos(rollRadians)) + y * (Math.cos(yawRadians) * Math.sin(pitchRadians) * Math.cos(rollRadians) + Math.sin(yawRadians) * Math.sin(rollRadians));\n this.z = x * Math.sin(yawRadians) * Math.cos(pitchRadians) + z * (Math.sin(yawRadians) * Math.sin(pitchRadians) * Math.sin(rollRadians) + Math.cos(yawRadians) * Math.cos(rollRadians)) + y * (Math.sin(yawRadians) * Math.sin(pitchRadians) * Math.cos(rollRadians) - Math.cos(yawRadians) * Math.sin(rollRadians));\n this.y = -x * Math.sin(pitchRadians) + z * Math.cos(pitchRadians) * Math.sin(rollRadians) + y * Math.cos(pitchRadians) * Math.cos(rollRadians);\n }", "public static Point PointRotate3D(final Point origin, final Point toRotate, final Vector rotationAxis, final float angle) { \n Vector axis = (rotationAxis.magnitude() == 1) ? rotationAxis : rotationAxis.normal();\n float dist = sqrt(sq(axis.y) + sq(axis.z)); \n Matrix T = new Matrix(new double[][]{\n new double[] {1, 0, 0, -origin.x},\n new double[] {0, 1, 0, -origin.y},\n new double[] {0, 0, 1, -origin.z},\n new double[] {0, 0, 0, 1},\n });\n Matrix TInv = T.inverse();\n\n float aZ = (axis.z == 0 && dist == 0) ? 0 : (axis.z / dist);\n float aY = (axis.y == 0 && dist == 0) ? 0 : (axis.y / dist);\n Matrix Rx = new Matrix(new double[][]{\n new double[] {1, 0, 0, 0},\n new double[] {0, aZ, -aY, 0},\n new double[] {0, aY, aZ, 0},\n new double[] {0, 0, 0, 1},\n });\n\n Matrix RxInv = new Matrix(new double[][]{\n new double[] {1, 0, 0, 0},\n new double[] {0, aZ, aY, 0},\n new double[] {0, -aY, aZ, 0},\n new double[] {0, 0, 0, 1},\n });\n\n Matrix Ry = new Matrix(new double[][]{\n new double[] {dist, 0, -axis.x, 0},\n new double[] {0, 1, 0, 0},\n new double[] {axis.x, 0, dist, 0},\n new double[] {0, 0, 0, 1},\n });\n\n Matrix RyInv = Ry.inverse();\n\n Matrix Rz = new Matrix(new double[][]{\n new double[] {cos(angle), -sin(angle), 0, 0},\n new double[] {sin(angle), cos(angle), 0, 0},\n new double[] {0, 0, 1, 0},\n new double[] {0, 0, 0, 1},\n });\n\n Matrix origSpace = new Matrix(new double[][] {\n new double[]{toRotate.x},\n new double[]{toRotate.y},\n new double[]{toRotate.z},\n new double[]{1}\n });\n Matrix rotated = TInv.times(RxInv).times(RyInv).times(Rz).times(Ry).times(Rx).times(T).times(origSpace);\n\n return new Point((float) rotated.get(0, 0), (float) rotated.get(1, 0), (float) rotated.get(2, 0));\n }", "public double getRotationAngle() {\n\t\treturn _rotationAngle;\n\t}", "public double getRotation()\n\t{\n\t\tdouble determinant = this.basisDeterminant();\n\t\tTransform2D m = orthonormalized();\n\t\tif (determinant < 0) \n\t\t{\n\t\t\tm.scaleBasis(new Vector2(1, -1)); // convention to separate rotation and reflection for 2D is to absorb a flip along y into scaling.\n\t\t}\n\t\treturn Math.atan2(m.matrix[0].y, m.matrix[0].x);\n\t}", "ArrayList<Point3D> CameraRotate(ArrayList<Point3D>three_list){\r\n\t\tdouble theta=((double)pCanvas.iterations/1000)*2*Math.PI; //updates theta\r\n\t\tif(rotateCamera==1){\r\n\t\t\tthree_list=utils.rotateAllPointsAroundX(three_list, -theta);\r\n\r\n\t\t}\r\n\t\tif(rotateCamera==2){\r\n\t\tthree_list=utils.rotateAllPointsAroundY(three_list, -theta);\r\n\t\t}\r\n\t\tif(rotateCamera==3){\r\n\t\t\tthree_list=utils.rotateAllPointsAroundZ(three_list, -theta);\r\n\r\n\t\t}\r\n\t\treturn three_list;\r\n\t}", "public void setToRotation(double theta_x, double theta_y, double theta_z) {\r\n\t\tthis.set(getRotateInstance(theta_x, theta_y, theta_z));\r\n\t}", "@Override\n\tfinal public void rotate(double angle, Axis axis)\n\t{\n\t\t//center.setDirection(angle);\n\t}", "@Override\r\n\tpublic void rotateAboutAxis(final double angle, final double p1x,\r\n\t\t\tfinal double p1y, final double p1z, final double p2x,\r\n\t\t\tfinal double p2y, final double p2z) {\r\n\r\n\t\tfinal WB_Transform raa = new WB_Transform();\r\n\t\traa.addRotateAboutAxis(angle, new WB_Point3d(p1x, p1y, p1z),\r\n\t\t\t\tnew WB_Normal3d(p2x - p1x, p2y - p1y, p2z - p1z));\r\n\t\traa.applySelf(this);\r\n\t}", "public double getAngleYZ() {\r\n\t\tdouble l = this.lenght();\r\n\t\tif (l==0)\r\n\t\t\treturn 0;\r\n\t\treturn Math.asin(this.x/l);\r\n\t}", "public int getZ()\n {\n return zaxis;\n }", "@Override\n public void setOrientation(float x, float y, float z) {\n String degreeString = getString(R.string.motion_orientation_degree);\n /*orientationX.setText(String.format(degreeString, x));\n orientationY.setText(String.format(degreeString, y));\n orientationZ.setText(String.format(degreeString, z));\n*/\n if (gdxAdapter != null) {\n gdxAdapter.setOrientation(x, y, z);\n }\n }", "public void rot(double rad, Vector3d axis) {\r\n Transform3D temp = new Transform3D();\r\n temp.setRotation(new AxisAngle4d(axis.x, axis.y, axis.z, rad));\r\n transform3D.mul(temp);\r\n transformGroup.setTransform(transform3D);\r\n }", "public mat4 getRotation() {\n return worldMatrix.getRotation(pr, yr, pr);\n }", "public void rotate(double angle) {\t\t\n\t\t// precompute values\n\t\tVector t = new Vector(this.a14, this.a24, this.a34);\n\t\tif (t.length() > 0) t = t.norm();\n\t\t\n\t\tdouble x = t.x();\n\t\tdouble y = t.y();\n\t\tdouble z = t.z();\n\t\t\n\t\tdouble s = Math.sin(angle);\n\t\tdouble c = Math.cos(angle);\n\t\tdouble d = 1 - c;\n\t\t\n\t\t// precompute to avoid double computations\n\t\tdouble dxy = d*x*y;\n\t\tdouble dxz = d*x*z;\n\t\tdouble dyz = d*y*z;\n\t\tdouble xs = x*s;\n\t\tdouble ys = y*s;\n\t\tdouble zs = z*s;\n\t\t\n\t\t// update matrix\n\t\ta11 = d*x*x+c; a12 = dxy-zs; a13 = dxz+ys;\n\t\ta21 = dxy+zs; a22 = d*y*y+c; a23 = dyz-xs;\n\t\ta31 = dxz-ys; a32 = dyz+xs; a33 = d*z*z+c;\n\t}", "public void testZAxisRotation() {\n w = 1;\n theta = 2*pi;\n double[] point = new double[] {1, 1, 0};\n RotationMatrix rM = new RotationMatrix(a, b, c, u, v, w, theta);\n double[] result = rM.timesXYZ(point);\n double[] expect = new double[] {1, 1, 0, 1};\n for(int i=0; i<result.length; i++) {\n assertEquals(expect[i], result[i], TOLERANCE);\n }\n\n theta = pi;\n rM = new RotationMatrix(a, b, c, u, v, w, theta);\n //rM.logMatrix();\n result = rM.timesXYZ(point);\n expect = new double[] {-1, -1, 0, 1};\n for(int i=0; i<result.length; i++) {\n assertEquals(\"coord: \"+i, expect[i], result[i], TOLERANCE);\n }\n\n theta = pi/2;\n rM = new RotationMatrix(a, b, c, u, v, w, theta);\n //rM.logMatrix();\n result = rM.timesXYZ(point);\n expect = new double[] {-1, 1, 0, 1};\n for(int i=0; i<result.length; i++) {\n assertEquals(\"coord: \"+i, expect[i], result[i], TOLERANCE);\n }\n\n theta = pi/4;\n rM = new RotationMatrix(a, b, c, u, v, w, theta);\n result = rM.timesXYZ(point);\n expect = new double[] {0, Math.sqrt(2), 0, 1};\n for(int i=0; i<result.length; i++) {\n assertEquals(\"coord: \"+i, expect[i], result[i], TOLERANCE);\n }\n\n theta = 3*pi/4;\n rM = new RotationMatrix(a, b, c, u, v, w, theta);\n result = rM.timesXYZ(point);\n expect = new double[] {-Math.sqrt(2), 0, 0, 1};\n for(int i=0; i<result.length; i++) {\n assertEquals(\"coord: \"+i, expect[i], result[i], TOLERANCE);\n }\n\n theta = -3*pi/4;\n rM = new RotationMatrix(a, b, c, u, v, w, theta);\n result = rM.timesXYZ(point);\n expect = new double[] {0, -Math.sqrt(2), 0, 1};\n for(int i=0; i<result.length; i++) {\n assertEquals(\"coord: \"+i, expect[i], result[i], TOLERANCE);\n }\n }", "public void rotateY90() {\n\t\tfor (int v = 0; v < vertexCount; v++) {\n\t\t\tint x_ = vertexX[v];\n\t\t\tvertexX[v] = vertexZ[v];\n\t\t\tvertexZ[v] = -x_;\n\t\t}\n\t}", "public double getRotation() {\n return Degrees.atan2(y, x);\n }", "@Override\n\tpublic void rotation(double rx, double ry, double rz) {\n\t\tint i;\n\t\t\n\t\tfor (i = 0; i<6; i++) {\n\t\t\tthis.plans.get(i).rotation(rx, ry, rz);\n\t\t}\n\t\t//Ca me parait un peu foireux comme methode faudra voir apres ave l'interface graphique si\n\t\t//�a marche comme �a.\n\t}", "public static native long GetRotation(long lpjFbxDualQuaternion);", "public float getRotationAngle() {\n return this.mRotationAngle;\n }", "void copyRotation(DMatrix3 R);", "public void rotate(vec3 axis, float angle){\n mat4 m = math3d.axisRotation(axis, angle);\n worldMatrix = worldMatrix.mul(m);\n }" ]
[ "0.7878506", "0.7466755", "0.73135215", "0.7092782", "0.7009573", "0.69555837", "0.6918366", "0.6901382", "0.68494064", "0.6824227", "0.6781541", "0.6778907", "0.6757401", "0.67133147", "0.6674749", "0.66664016", "0.66145897", "0.6493475", "0.64648926", "0.6445018", "0.64246356", "0.64246356", "0.64246356", "0.64246356", "0.64246356", "0.6424394", "0.6424394", "0.6424394", "0.6424394", "0.6424394", "0.6424394", "0.6424394", "0.6424394", "0.6424394", "0.6424394", "0.6424394", "0.64084584", "0.6404032", "0.6357952", "0.63450754", "0.62951535", "0.6276236", "0.6267586", "0.6246573", "0.623313", "0.6227632", "0.62171924", "0.6192879", "0.61793363", "0.617193", "0.6142414", "0.61328214", "0.61230445", "0.6099489", "0.609821", "0.6067928", "0.6057339", "0.60519195", "0.60466117", "0.6032348", "0.6003008", "0.600029", "0.60000724", "0.59739906", "0.59690034", "0.5936422", "0.5933265", "0.59318715", "0.59183407", "0.59091043", "0.5901987", "0.5887373", "0.5873852", "0.5851489", "0.58342737", "0.5830977", "0.5818521", "0.57893634", "0.5784136", "0.57790715", "0.5776196", "0.57747054", "0.57457536", "0.5744737", "0.5743339", "0.5739105", "0.57385665", "0.57366455", "0.5736161", "0.5729416", "0.5718074", "0.571694", "0.57138157", "0.57135624", "0.5706234", "0.5706211", "0.5705215", "0.57007796", "0.56943935", "0.5692897" ]
0.60388
59
Private Methods Multiplies y(i)=M_ix (dot product with a single row).
private double timesRow(int i,MyPoint3D x) { return d[i][0]*x.getX() + d[i][1]*x.getY() + d[i][2]*x.getZ(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void matrixMultiply(Matrix m) {\n if (cols == m.getRows()) {\n ArrayList<double[]> result = newMatrix(rows, m.getCols());\n for (int i=0; i<rows; i++) {\n for (int k=0; k<m.getCols(); k++) {\n double sum = 0;\n for (int j=0; j<cols; j++) {\n sum += matrix.get(i)[j] * m.get(j, k);\n }\n result.get(i)[k] = sum;\n }\n }\n setMatrix(result, rows, m.getCols()); // Rows is that of original matrix, Columns is that of the multiplying matrix\n }\n else {\n throw new MatrixMultiplicationDimensionException();\n }\n }", "public static int[][] multiply(int[][] x,int[][] y){\n int[][] result = new int[x.length][x.length];\n int[] tempRow = new int[x.length];\n int[] tempCol = new int[x.length];\n for (int i = 0; i < x.length; i++) {\n for (int j = 0; j < x.length; j++) {\n //make 2 array then multiple respective number and add them up\n for (int k = 0; k < x.length; k++) {\n tempRow[k] = x[i][k];\n }\n for (int k = 0; k < x.length; k++) {\n tempCol[k] = y[k][j];\n }\n for (int k = 0; k < x.length; k++) {\n result[i][j] += tempRow[k]*tempCol[k];\n }\n }\n }\n return result;\n }", "Matrix mul(Matrix m){\n if(m.cols != this.cols || m.rows != this.rows) throw new RuntimeException(String.format(\"Wrong dimensions\"));\n Matrix matrix_to_return = new Matrix(m.rows, m.cols);\n for(int i=0; i<m.rows * m.cols; i++){\n matrix_to_return.data[i] = this.data[i] * m.data[i];\n }\n return matrix_to_return;\n }", "@Override\n\tpublic IMatrix nMultiply(IMatrix other) {\n\n\t\tif (this.getColsCount() != other.getRowsCount()) {\n\t\t\tthrow new IncompatibleOperandException(\n\t\t\t\t\t\"For matrix multiplication first matrix must have same number of columns as number of rows of the other matrix!\");\n\t\t}\n\t\tint m = this.getRowsCount();\n\t\tint n = other.getColsCount();\n\t\tint innerDimension = this.getColsCount();\n\t\tdouble[][] p = new double[m][n];\n\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\tdouble sum = 0;\n\t\t\t\tfor (int k = 0; k < innerDimension; k++) {\n\t\t\t\t\tsum += this.get(i, k) * other.get(k, j);\n\t\t\t\t}\n\t\t\t\tp[i][j] = sum;\n\t\t\t}\n\t\t}\n\t\treturn new Matrix(m, n, p, true);\n\t}", "Matrix dot(Matrix m){\n if(this.cols != m.rows) throw new RuntimeException(String.format(\"Wrong dimensions\"));\n double[][] tmp_this = this.asArray();\n double[][] tmp_m = m.asArray();\n Matrix matrix_to_return = new Matrix(this.rows, m.cols);\n for(int i=0; i<matrix_to_return.rows; i++){\n for(int j=0; j<matrix_to_return.cols; j++){\n for(int k=0; k<matrix_to_return.rows; k++)\n matrix_to_return.data[i*this.cols + j] += tmp_this[i][k] * tmp_m[k][j];\n }\n }\n return matrix_to_return;\n }", "private static double[] matrixMultiply(double[][] bezier, double[] matrixVars) {\r\n\t\tdouble[] result = {0,0,0,0};\r\n\t\tfor (int i = 0; i < bezier.length; i++) {\r\n\t\t\tfor (int j=0; j < matrixVars.length; j++) {\r\n\t\t\t\tresult[i] += bezier[i][j]*matrixVars[j];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n }", "public void MatrixChainMultiply(int[] p) {\n n = p.length - 1;\t// how many matrices are in the chain\n m = new int[n + 1][n + 1];\t// overallocate m, so that we don't use index 0\n s = new int[n + 1][n + 1];\t// same for s\n matrixChainOrder(p);\t// run the dynamic-programming algorithm\n }", "public Matrix multiply(int i) {\n\t\treturn multiply(new Fraction(i));\n\t}", "@Override\r\n\tpublic void mul(int x, int y) {\n\t\t\r\n\t}", "public long[][] smultiply(int i){\n\t\tint sl = this.mat.length; //jumps to method sideLength to obtain the side length n of the matrix A\n\t\t//the global record contains an array of columns, where each column is an array of row elements. i.e.\n\t\t//the record contains the transpose of matrix A, where every row in the record is a column in A\n\t\t//a temporary 2D array tempMatA, and is made equal to the transpose of A\n\t\tlong[][] tempMatA = transpose(this.mat);\n\t\tlong[][] tempMat2 = new long[sl][sl]; //creates a temporary 2D matrix of the same size as tempMatA\n\t\tlong[][] outMat = new long[sl][sl];\n\t\t\n\t\tif (i > 1){\n\t\t\t//see for loop explanation in class \"Matrix3x3flat\"+\n\t\t\tfor (int j = 1; j < i; j ++){ //loops until j == input variable i.\n\t\t\t\t//j == 1 because matrix multiplication will occur on the first loop, so if i == 2, tempMat2 == A^3, not A^2\n\t\t\t\tfor (int a = 0; a < 3; a++){ //loops until a == side length of A\n\t\t\t\t\tfor (int b = 0; b < 3; b++){ //loops until b == side length of A\n\t\t\t\t\t\tfor (int c = 0; c < 3; c++){ //loops until c == side length of A\n\t\t\t\t\t\t\ttempMat2[a][b] = tempMat2[a][b] + (tempMatA[a][c] * tempMatA[c][b]);\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\t//returns tempMat2 as output matrix\n\t\t\toutMat = copy(tempMat2, outMat);\n\t\t}\n\t\t//returns A as output matrix, since A^1 = A\n\t\telse if (i == 1){\n\t\t\toutMat = copy(tempMatA, outMat);\n\t\t}\n\t\t//returns a 3x3 matrix filled with ones if i == 0\n\t\t//A^0 = 1\n\t\telse if (i == 0){\n\t\t\tfor (int m = 0; m < 3; m++){\n\t\t\t\tfor (int n = 0; n < 3; n++){\n\t\t\t\t\tif (m == n){\n\t\t\t\t\t\toutMat[m][n] = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\toutMat[m][n] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//return matrix must be re-transposed to return a the proper format of 2D array for the global array\n\t\toutMat = transpose(outMat);\n\t\treturn outMat;\n\t}", "public static long[][] multiply(long F[][], long M[][]){\n long x = F[0][0]*M[0][0] + F[0][1]*M[1][0]; \n long y = F[0][0]*M[0][1] + F[0][1]*M[1][1]; \n long z = F[1][0]*M[0][0] + F[1][1]*M[1][0]; \n long w = F[1][0]*M[0][1] + F[1][1]*M[1][1]; \n\n return new long[][]{{x,y},{z,w}};\n }", "public void multL(TransformationMatrix m) {\n\t\tdouble b11, b12, b13, b14, b21, b22, b23, b24, b31, b32, b33, b34;\n\t\tb11 = m.a11*a11 + m.a12*a21 + m.a13*a31;\n\t\tb12 = m.a11*a12 + m.a12*a22 + m.a13*a32;\n\t\tb13 = m.a11*a13 + m.a12*a23 + m.a13*a33;\n\t\tb14 = m.a11*a14 + m.a12*a24 + m.a13*a34 + m.a14;\n\t\tb21 = m.a21*a11 + m.a22*a21 + m.a23*a31;\n\t\tb22 = m.a21*a12 + m.a22*a22 + m.a23*a32;\n\t\tb23 = m.a21*a13 + m.a22*a23 + m.a23*a33;\n\t\tb24 = m.a21*a14 + m.a22*a24 + m.a23*a34 + m.a24;\n\n\t\tb31 = m.a31*a11 + m.a32*a21 + m.a33*a31;\n\t\tb32 = m.a31*a12 + m.a32*a22 + m.a33*a32;\n\t\tb33 = m.a31*a13 + m.a32*a23 + m.a33*a33;\n\t\tb34 = m.a31*a14 + m.a32*a24 + m.a33*a34 + m.a34;\n\n\t\ta11 = b11; a12 = b12; a13 = b13; a14 = b14;\n\t\ta21 = b21; a22 = b22; a23 = b23; a24 = b24;\n\t\ta31 = b31; a32 = b32; a33 = b33; a34 = b34;\n\t}", "public static BigDecimal[][] multiplyMatrices(BigDecimal[][] m1, BigDecimal[][] m2){\n\t\t\n\t\tint size = m1.length;\n\t\t\n\t\tBigDecimal[][] next = new BigDecimal[size][size];\n\t\tfor(int i = 0; i < size; i++){\n\t\t\tfor(int j = 0; j < size; j++){\n\t\t\t\tBigDecimal current = new BigDecimal(0);\n\t\t\t\tfor(int k = 0; k < size; k++)\n\t\t\t\t\tcurrent = current.add(m1[i][k].multiply(m2[k][j]));\n\n\t\t\t\tnext[i][j] = current;\n\t\t\t}\n\t\t}\n\t\treturn next;\n\t}", "public void testMultiply() {\r\n System.out.println(\"Multiply\");\r\n Double [][] n = new Double[][]{{-3., -2.5, -1., 0., 1., 2., 3.4, 3.5, 1.1E100, -1.1E100}, \r\n {-3., 2.5, 0., 0., 1., -2., 3., 3.7, 1.1E100, 1.1E100}, \r\n {9., -6.25, 0., 0., 1., -4., 10.2, 12.95, 1.21E200, -1.21E200}};\r\n for(int i = 0; i < 10; i++){\r\n Double x = n[0][i];\r\n Double y = n[1][i];\r\n double expResult = n[2][i];\r\n double result = MathOp.Multiply(x, y);\r\n assertEquals(expResult, result, 0.001);\r\n }\r\n }", "public static void prod(double[] x, double[] y, double[][] w) {\r\n// System.out.println(\"GOT HERE!!!\");\r\n// System.out.println(x + \" : \" + y + \" : \" + w);\r\n// System.out.format(\"%d \\t %d \\t %d,%d\\n\", x.length, y.length, w.length, w[0].length);\r\n for (int i = 0; i < x.length; i++) {\r\n for (int j = 0; j < y.length; j++) {\r\n w[i][j] = x[i] * y[j];\r\n }\r\n }\r\n }", "private void computeMiter(int ix0, int iy0, int ix1, int iy1, int ix0p,\n int iy0p, int ix1p, int iy1p, int[] m) {\n long x0 = ix0;\n long y0 = iy0;\n long x1 = ix1;\n long y1 = iy1;\n\n long x0p = ix0p;\n long y0p = iy0p;\n long x1p = ix1p;\n long y1p = iy1p;\n\n long x10 = x1 - x0;\n long y10 = y1 - y0;\n long x10p = x1p - x0p;\n long y10p = y1p - y0p;\n\n long den = (x10 * y10p - x10p * y10) >> 16;\n if (den == 0) {\n m[0] = ix0;\n m[1] = iy0;\n return;\n }\n\n long t = (x1p * (y0 - y0p) - x0 * y10p + x0p * (y1p - y0)) >> 16;\n m[0] = (int) (x0 + (t * x10) / den);\n m[1] = (int) (y0 + (t * y10) / den);\n }", "public static Matrix product(Matrix m) {\n int rows_c = m.rows(), cols_c = m.cols();\n Matrix d;\n if (rows_c == 1) {\n return m;\n } else {\n d = MatrixFactory.getMatrix(1, cols_c, m);\n for (int col = 1; col <= cols_c; col++) {\n double prodCol = 1D;\n for (int row = 1; row <= rows_c; row++) {\n prodCol = prodCol * m.get(row, col);\n }\n d.set(1, col, prodCol);\n }\n }\n return d;\n }", "public static void multiply(int[][] matrix1, int[][] matrix2) {\n\t\t int matrix1row = matrix1.length;\r\n\t\t int matrix1column = matrix1[0].length;//same as rows in B\r\n\t\t int matrix2column = matrix2[0].length;\r\n\t\t int[][] matrix3 = new int[matrix1row][matrix2column];\r\n\t\t for (int i = 0; i < matrix1row; i++) {//outer loop refers to row position\r\n\t\t for (int j = 0; j < matrix2column; j++) {//refers to column position\r\n\t\t for (int k = 0; k < matrix1column; k++) {\r\n\t\t \t //adds the products of row*column elements until the row/column is complete\r\n\t\t \t //updates to next row/column\r\n\t\t matrix3[i][j] = matrix3[i][j] + matrix1[i][k] * matrix2[k][j];\r\n\t\t }\r\n\t\t }\r\n\t\t }\r\n\t\t print(matrix3);\r\n\t\t }", "static float[] mulMM(float[] m1, float[] m2){\n \t\n \t\tif(m1.length != 16 || m2.length != 16){\n \t\t\tthrow new IllegalArgumentException();\n \t\t}\n \t\n float[] result = new float[16];\n for(int i = 0; i < 4; i++){ \n for(int j = 0; j < 4; j++){ \n float rij = 0;\n for(int k = 0; k < 4; k++){\n rij += m1[j*4+k] * m2[i+4*k];\n }\n// result[i*4+j] = rij;\n result[i+j*4] = rij;\n }\n }\n return result;\n }", "public int Multipy(int x, int y, int y){\n\t\t\treturn x*y*z;\n\t}", "public static void multiplyMatrixes( double[][] m1, double[][] m2, double[][] result) {\n result[0][0] = m1[0][0]*m2[0][0] + m1[0][1]*m2[1][0] + m1[0][2]*m2[2][0];\n result[0][1] = m1[0][0]*m2[0][1] + m1[0][1]*m2[1][1] + m1[0][2]*m2[2][1];\n result[0][2] = m1[0][0]*m2[0][2] + m1[0][1]*m2[1][2] + m1[0][2]*m2[2][2];\n\n result[1][0] = m1[1][0]*m2[0][0] + m1[1][1]*m2[1][0] + m1[1][2]*m2[2][0];\n result[1][1] = m1[1][0]*m2[0][1] + m1[1][1]*m2[1][1] + m1[1][2]*m2[2][1];\n result[1][2] = m1[1][0]*m2[0][2] + m1[1][1]*m2[1][2] + m1[1][2]*m2[2][2];\n\n result[2][0] = m1[2][0]*m2[0][0] + m1[2][1]*m2[1][0] + +m1[2][2]*m2[2][0];\n result[2][1] = m1[2][0]*m2[0][1] + m1[2][1]*m2[1][1] + +m1[2][2]*m2[2][1];\n result[2][2] = m1[2][0]*m2[0][2] + m1[2][1]*m2[1][2] + +m1[2][2]*m2[2][2];\n }", "private int[] multiply(int[] x, int[] y, int[] z)\n {\n for (int i = z.length - 1; i >= 0; i--)\n {\n long a = z[i] & IMASK;\n long value = 0;\n\n for (int j = y.length - 1; j >= 0; j--)\n {\n value += a * (y[j] & IMASK) + (x[i + j + 1] & IMASK);\n\n x[i + j + 1] = (int)value;\n\n value >>>= 32;\n }\n\n x[i] = (int)value;\n }\n\n return x;\n }", "public Mat2 mult(Mat2 m) {\n\t\tdouble[][] newData = new double[rows][m.cols];\n\t\t//if(rows != m.cols) throw new IllegalArgumentException(\"cannot multiply a \" + rows + \" by \" + cols + \n\t\t\t//\t\" matrix and a \" + m.rows + \" by \" + m.cols + \" matrix\");\n\t\tfor(int i=0; i<rows; i++) {\n\t\t\tfor(int j=0; j<m.cols; j++) {\n\t\t\t\tdouble total = 0.0;\n\t\t\t\tfor(int c=0; c<cols; c++) {\n\t\t\t\t\ttotal += data[i][c] * m.data[c][j];\n\t\t\t\t}\n\t\t\t\tnewData[i][j] = total;\n\t\t\t}\n\t\t}\n\t\treturn new Mat2(newData);\n\t}", "public void multiply() {\n\t\t\n\t}", "public void multiply(double skalar) {\r\n for (int i = 0; i < matrix.length; i++) {\r\n for (int j = 0; j < matrix[0].length; j++) {\r\n matrix[i][j] *= skalar;\r\n }\r\n }\r\n }", "public int multiply(int x, int y) {\n int n1 = x; //n1 = c_n * 2^n + c_n-1 * 2^n-1 + ... + c_1 * 2 + c_0 * 1 where c_i = {0, 1} \n int n2 = y; //n2 = c_m * 2^m + c_m-1 * 2^m-1 + ... + c_1 * 2 + c_0 * 1 where c_i ] {0, 1}\n int sum = 0; //named sum b/c represent the product of n1 and n2 as the sum of their constituent parts\n /*\n let n1 be rep as in its binary form (***...***) a bit string\n n1*n2 = (***...***)(c_m * 2^m + ... + c_0 * 1)\n = (***...***)(c_0 * 1) + (***...***)(c_1 * 2) + ... + (***...***)(c_m * 2^m)\n since << has the effect of multiplying a number by 2, can rep as\n = (***...***)(c_0 * 1) + (***...***)(c_1 * 1) << 1 + (***...***)(c_2 * 1) << 2 + ... + (***...***)(c_m * 1) << m\n so for each loop through a loop left shift n1 by one to simulate multiplying the next term by 2\n also right shift n2 to find c_i, the value of the bit in the bit string n2\n */\n while (n2 != 0) { // if n2 == 0 run through the length of n2 and nothing left to do\n if ((n2 & 1) == 0) { //find the last bit of n2; if it is 0 then do nothing because the n1 term will be multiplied by 0\n } else {//else it is 1 so add n1 to the sum\n sum = add(sum, n1); //bitwise addition has already been defined (implemented)\n }\n n1 = n1 << 1; //leftshift n1 to mult by 2; see above comments\n n2 = n2 >>> 1; //rightshift n2 to find value of next bit in bit string\n }\n return sum;\n }", "@Override\r\n\tpublic int multi(int x, int y) {\n\t\treturn x * y;\r\n\t}", "public void mult(Mat2 m, Mat2 dest) {\n\t\tfor(int i=0; i<rows; i++) {\n\t\t\tfor(int j=0; j<m.cols; j++) {\n\t\t\t\tdouble total = 0.0f;\n\t\t\t\tfor(int c=0; c<cols; c++) {\n\t\t\t\t\ttotal += data[i][c] * m.data[c][j];\n\t\t\t\t}\n\t\t\t\tdest.set(i, j, total);\n\t\t\t}\n\t\t}\n\t}", "private void mul() {\n\n\t}", "public static double[] multiply(double[] x, double[][] a) {\n int m = a.length;\n int n = a[0].length;\n if (x.length != m) throw new RuntimeException(\"Illegal matrix dimensions.\");\n double[] y = new double[n];\n for (int j = 0; j < n; j++)\n for (int i = 0; i < m; i++)\n y[j] += a[i][j] * x[i];\n return y;\n }", "public static double[] multiply(double[] x, double[][] a) {\n int m = a.length;\n int n = a[0].length;\n if (x.length != m) throw new RuntimeException(\"Illegal matrix dimensions.\");\n double[] y = new double[n];\n for (int j = 0; j < n; j++)\n for (int i = 0; i < m; i++)\n y[j] += a[i][j] * x[i];\n return y;\n }", "public Matrix multiply(Matrix m2)\n\t{\n\t\tMatrix result = new Matrix(new double[matrix.length][matrix[0].length]);\n\t\tfor(int i = 0; i < matrix.length; i++)\n\t\t{\n\t\t\tfor(int j = 0; j < matrix.length; j++)\n\t\t\t{\n\t\t\t\tfor (int k = 0; k < matrix.length; k++)\n\t\t\t\t{\n\t\t\t\t\tresult.matrix[i][j] = result.matrix[i][j] + matrix[i][k] * m2.matrix[k][j];\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t\treturn result;\n\t}", "public static double[] multiply(double[][] a, double[] x) {\n int m = a.length;\n int n = a[0].length;\n if (x.length != n) throw new RuntimeException(\"Illegal matrix dimensions.\");\n double[] y = new double[m];\n for (int i = 0; i < m; i++)\n for (int j = 0; j < n; j++)\n y[i] += a[i][j] * x[j];\n return y;\n }", "public void multR(TransformationMatrix m) {\n\t\tdouble b11, b12, b13, b14, b21, b22, b23, b24, b31, b32, b33, b34;\n\t\tb11 = a11*m.a11 + a12*m.a21 + a13*m.a31;\n\t\tb12 = a11*m.a12 + a12*m.a22 + a13*m.a32;\n\t\tb13 = a11*m.a13 + a12*m.a23 + a13*m.a33;\n\t\tb14 = a11*m.a14 + a12*m.a24 + a13*m.a34 + a14;\n\t\tb21 = a21*m.a11 + a22*m.a21 + a23*m.a31;\n\t\tb22 = a21*m.a12 + a22*m.a22 + a23*m.a32;\n\t\tb23 = a21*m.a13 + a22*m.a23 + a23*m.a33;\n\t\tb24 = a21*m.a14 + a22*m.a24 + a23*m.a34 + a24;\n\n\t\tb31 = a31*m.a11 + a32*m.a21 + a33*m.a31;\n\t\tb32 = a31*m.a12 + a32*m.a22 + a33*m.a32;\n\t\tb33 = a31*m.a13 + a32*m.a23 + a33*m.a33;\n\t\tb34 = a31*m.a14 + a32*m.a24 + a33*m.a34 + a34;\n\n\t\ta11 = b11; a12 = b12; a13 = b13; a14 = b14;\n\t\ta21 = b21; a22 = b22; a23 = b23; a24 = b24;\n\t\ta31 = b31; a32 = b32; a33 = b33; a34 = b34;\n\t}", "public Matrix mult(Matrix MatrixB) {\n\t\tDouble[][] newValue = new Double[row][MatrixB.col()];\r\n\t\tVector[] MatBcol = MatrixB.getCol();\r\n\t\t\r\n\r\n\t\tfor (int x = 0; x < row; x++) {\r\n\t\t\tfor (int y = 0; y < MatrixB.col(); y++) {\r\n\t\t\t\tVector rowVecI = rowVec[x];\r\n\t\t\t\tVector colVecI = MatBcol[y];\r\n\t\t\t\tnewValue[x][y] = rowVecI.DotP(colVecI);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new Matrix(newValue);\r\n\t}", "@Override\r\n\tpublic int mul() {\n\t\treturn 0;\r\n\t}", "@Override\n public ComplexFloat dotu(IComplexNDArray x, IComplexNDArray y) {\n return new ComplexFloat(NativeBlas.cdotu(x.length(), x.data(), x.offset(), 1, y.data(), y.offset(), 1));\n }", "private static BigInteger[][] multiply (BigInteger a[][], BigInteger b[][])\n {\n BigInteger x = (a[0][0].multiply(b[0][0])).add(a[0][1].multiply(b[1][0]));\n BigInteger y = (a[0][0].multiply(b[0][1])).add(a[0][1].multiply(b[1][1]));\n BigInteger z = (a[1][0].multiply(b[0][0])).add(a[1][1].multiply(b[1][0]));\n BigInteger w = (a[1][0].multiply(b[0][1])).add(a[1][1].multiply(b[1][1]));\n \n return new BigInteger[][]{{x, y},{z, w}};\n }", "@Override\n\tpublic void mul(double dx, double dy) {\n\t\t\n\t}", "public int mul(int i,int j){\n\t\treturn i*j;\n\t}", "private static int[] multiply(int[] x, int[] y, int[] z)\n {\n int i = z.length;\n\n if (i < 1)\n {\n return x;\n }\n\n int xBase = x.length - y.length;\n\n for (;;)\n {\n long a = z[--i] & IMASK;\n long val = 0;\n\n for (int j = y.length - 1; j >= 0; j--)\n {\n val += a * (y[j] & IMASK) + (x[xBase + j] & IMASK);\n\n x[xBase + j] = (int)val;\n\n val >>>= 32;\n }\n\n --xBase;\n\n if (i < 1)\n {\n if (xBase >= 0)\n {\n x[xBase] = (int)val;\n }\n break;\n }\n\n x[xBase] = (int)val;\n }\n\n return x;\n }", "private static void multiplyMonty(int[] a, int[] x, int[] y, int[] m, int mDash, boolean smallMontyModulus)\n // mDash = -m^(-1) mod b\n {\n int n = m.length;\n long y_0 = y[n - 1] & IMASK;\n\n // 1. a = 0 (Notation: a = (a_{n} a_{n-1} ... a_{0})_{b} )\n for (int i = 0; i <= n; i++)\n {\n a[i] = 0;\n }\n\n // 2. for i from 0 to (n - 1) do the following:\n for (int i = n; i > 0; i--)\n {\n long a0 = a[n] & IMASK;\n long x_i = x[i - 1] & IMASK;\n\n long prod1 = x_i * y_0;\n long carry = (prod1 & IMASK) + a0;\n\n // 2.1 u = ((a[0] + (x[i] * y[0]) * mDash) mod b\n long u = ((int)carry * mDash) & IMASK;\n\n // 2.2 a = (a + x_i * y + u * m) / b\n long prod2 = u * (m[n - 1] & IMASK);\n carry += (prod2 & IMASK);\n// assert (int)carry == 0;\n carry = (carry >>> 32) + (prod1 >>> 32) + (prod2 >>> 32);\n\n for (int j = n - 2; j >= 0; j--)\n {\n prod1 = x_i * (y[j] & IMASK);\n prod2 = u * (m[j] & IMASK);\n\n carry += (prod1 & IMASK) + (prod2 & IMASK) + (a[j + 1] & IMASK);\n a[j + 2] = (int)carry;\n carry = (carry >>> 32) + (prod1 >>> 32) + (prod2 >>> 32);\n }\n\n carry += (a[0] & IMASK);\n a[1] = (int)carry;\n a[0] = (int)(carry >>> 32);\n }\n\n // 3. if x >= m the x = x - m\n if (!smallMontyModulus && compareTo(0, a, 0, m) >= 0)\n {\n subtract(0, a, 0, m);\n }\n\n // put the result in x\n System.arraycopy(a, 1, x, 0, n);\n }", "public void multiply(double multiplier) {\n x *= multiplier;\n y *= multiplier;\n }", "public int mul(int i, int j) {\n\t\treturn i*j;\r\n\t}", "public void rightMultiply(Matrix other){\n \tdouble[][] temp = new double[4][4];\n\n //record copy of this matrix \n\tfor (int i = 0; i < 4; i++) {\n\t for (int j = 0; j < 4; j++) {\n\t\ttemp[i][j] = array[i][j];\n\t }\n\t}\n\t//user copy of matrix to left multiply while writing dot products into matrix values\n\tfor (int i = 0; i < 4; i++) {\n\t for (int j = 0; j < 4; j++) {\n\t\tarray[i][j] = 0;\n\t\tfor (int k = 0 ; k < 4 ; k++) {\n \t\t array[i][j] += other.array[i][k] * temp[k][j];\n\t\t}\n\t }\n\t}\n }", "public abstract Vector4fc mul(IMatrix4f mat);", "public final void mul() {\n\t\tif (size > 1) {\n\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tpush(secondTopMostValue * topMostValue);\n\t\t}\n\t}", "public abstract <M extends AbstractMatrix> M elementwiseProduct(M b);", "public void multiply(Monom m){\r\n\t\tint temp_power = this.get_power();\r\n\t\tdouble temp_coaf = this.get_coefficient();\r\n\t\ttemp_power += m.get_power();\r\n\t\ttemp_coaf *= m.get_coefficient();\r\n\t\tthis.set_power(temp_power);\r\n\t\tthis.set_coefficient(temp_coaf);\r\n\t}", "public double componentProduct()\n {\n return this.x * this.y;\n }", "public static double innerProduct(VectorIntf x, VectorIntf y) {\r\n if (x==null) throw new IllegalArgumentException(\"1st arg is null\");\r\n if (y==null) throw new IllegalArgumentException(\"2nd arg is null\");\r\n final int n = x.getNumCoords();\r\n if (n!=y.getNumCoords())\r\n throw new IllegalArgumentException(\"dimensions don't match\");\r\n double res=0.0;\r\n\t\t// test if x or y are sparse vectors \r\n\t\tif (x instanceof DblArray1SparseVector) {\r\n\t\t\tDblArray1SparseVector xs = (DblArray1SparseVector) x;\r\n\t\t\tif (Double.compare(xs.getDefaultValue(),0.0)==0) { // else makes no sense\r\n\t\t\t\tfinal int xsnz = xs.getNumNonZeros();\r\n\t\t\t\tfor (int i=0; i<xsnz; i++) {\r\n\t\t\t\t\tint xipos = xs.getIthNonZeroPos(i);\r\n\t\t\t\t\tdouble xi = xs.getIthNonZeroVal(i);\r\n\t\t\t\t\tres += xi*y.getCoord(xipos);\r\n\t\t\t\t}\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (y instanceof DblArray1SparseVector) {\r\n\t\t\tDblArray1SparseVector ys = (DblArray1SparseVector) y;\r\n\t\t\tif (Double.compare(ys.getDefaultValue(),0.0)==0) { // else makes no sense\r\n\t\t\t\tfinal int ysnz = ys.getNumNonZeros();\r\n\t\t\t\tfor (int i=0; i<ysnz; i++) {\r\n\t\t\t\t\tint yipos = ys.getIthNonZeroPos(i);\r\n\t\t\t\t\tdouble yi = ys.getIthNonZeroVal(i);\r\n\t\t\t\t\tres += yi*x.getCoord(yipos);\r\n\t\t\t\t}\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// revert to full inner product computation of vectors in R^n.\r\n for (int i=0; i<n; i++) {\r\n res += x.getCoord(i)*y.getCoord(i);\r\n }\r\n return res;\r\n }", "public static BigFraction[] multiply(BigFraction[] x, BigFraction[][] A) {\n int m = A.length;\n int n = A[0].length;\n if (x.length != m) throw new RuntimeException(\"Illegal matrix dimensions.\");\n BigFraction[] y = new BigFraction[n];\n for (int j = 0; j < n; j++)\n for (int i = 0; i < m; i++)\n y[j].add(A[i][j].multiply(x[i]));\n return y;\n }", "public static void testMulRec() {\n\n try {\n\n Matrix m1 = new Matrix(new double[][]{\n {1, 2, 3, 4},\n {5, 6, 7, 8},\n {1, 2, 3, 4},\n {5, 6, 7, 8}});\n\n Matrix m2 = new Matrix(new double[][]{\n {1, 2, 3, 4},\n {5, 6, 7, 8},\n {1, 2, 3, 4},\n {5, 6, 7, 8}});\n\n Matrix m3 = Matrix.multiplyRec(m1, m2, 0);\n\n System.out.println(m3);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "@Override\n public void run() {\n result.prod(indexes.getI(),indexes.getJ(),matrix1,matrix2);\n }", "public static BigFraction[] multiply(BigFraction[][] A, BigFraction[] x) {\n int m = A.length;\n int n = A[0].length;\n if (x.length != n) throw new RuntimeException(\"Illegal matrix dimensions.\");\n BigFraction[] y = new BigFraction[m];\n for (int i = 0; i < m; i++)\n for (int j = 0; j < n; j++)\n y[i].add(A[i][j].multiply(x[j]));\n return y;\n }", "public void multiplyYBy(double amount) {\n y *= amount;\n }", "public static double[] matrixVectorMult(double[][] A, double[] x) {\n\t\tint n = A.length;\n\t\tint m = x.length;\n\n\t\tdouble[] y = new double[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ty[i] = 0;\n\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\ty[i] += A[i][j] * x[j];\n\t\t\t}\n\t\t}\n\n\t\treturn y;\n\t}", "public Matrix multiply(Matrix other) {\n if (this.cols != other.rows)\n throw new RuntimeException(\"Illegal matrix dimensions\");\n\n Matrix result = new Matrix(this.rows, other.cols); //Matrix full of zeros\n for (int i = 0; i < this.rows; i++) {\n for (int j = 0; j < other.cols; j++) {\n for (int k = 0; k < this.cols; k++) {\n result.data[i][j] += (this.data[i][k] * other.data[k][j]);\n }\n }\n }\n\n return result;\n }", "public Row3 smultiply(int i){\n\t\tRow3 tempRec = this.mat; //creates a temporary duplicate of the global record\n\t\tlong[][] tempMatA = new long[3][3]; //creates the matrix A as a 2D array\n\t\ttempMatA[0][0] = tempRec.r1.col1;\n\t\ttempMatA[0][1] = tempRec.r1.col2;\n\t\ttempMatA[0][2] = tempRec.r1.col3;\n\t\ttempMatA[1][0] = tempRec.r2.col1;\n\t\ttempMatA[1][1] = tempRec.r2.col2;\n\t\ttempMatA[1][2] = tempRec.r2.col3;\n\t\ttempMatA[2][0] = tempRec.r3.col1;\n\t\ttempMatA[2][1] = tempRec.r3.col2;\n\t\ttempMatA[2][2] = tempRec.r3.col3;\n\t\t\n\t\tlong[][] tempMat2 = new long[3][3]; //creates a 2D array of the same size as A\n\t\tlong[][] outMat = new long[3][3];\n\t\t\n\t\tif (i > 1){\n\t\t\t//see for loop explanation in class \"Matrix3x3flat\"\n\t\t\tfor (int j = 1; j < i; j ++){ //loops until j == input variable i.\n\t\t\t\t//j == 1 because matrix multiplication will occur on the first loop, so if i == 2, tempMat2 == A^3, not A^2\n\t\t\t\tfor (int a = 0; a < 3; a++){ //loops until a == side length of A\n\t\t\t\t\tfor (int b = 0; b < 3; b++){ //loops until b == side length of A\n\t\t\t\t\t\tfor (int c = 0; c < 3; c++){ //loops until c == side length of A\n\t\t\t\t\t\t\ttempMat2[a][b] = tempMat2[a][b] + (tempMatA[a][c] * tempMatA[c][b]);\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\t//returns tempMat2 as output matrix\n\t\t\toutMat = copy(tempMat2, outMat);\n\t\t}\n\t\t//returns A as output matrix, since A^1 = A\n\t\telse if (i == 1){\n\t\t\toutMat = copy(tempMatA, outMat);\n\t\t}\n\t\t//returns a 3x3 matrix filled with ones if i == 0\n\t\t//A^0 = 1\n\t\telse if (i == 0){\n\t\t\tfor (int m = 0; m < 3; m++){\n\t\t\t\tfor (int n = 0; n < 3; n++){\n\t\t\t\t\tif (m == n){\n\t\t\t\t\t\toutMat[m][n] = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\toutMat[m][n] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//after matrix multiplication is performed, the respective elements of the 2D array tempMatA are stored in\n\t\t//the temporary register tempRec2, which is then returned\n\t\tcolRow3 a1 = new colRow3(outMat[0][0], outMat[0][1], outMat[0][2]);\n\t\tcolRow3 b1 = new colRow3(outMat[1][0], outMat[1][1], outMat[1][2]);\n\t\tcolRow3 c1 = new colRow3(outMat[2][0], outMat[2][1], outMat[2][2]);\n\t\tRow3 tempRec2 = new Row3(a1, b1, c1);\n\t\treturn tempRec2;\n\t}", "public abstract Vector4fc mul(IMatrix4x3f mat);", "public void multiply(double val) {\n for (int i = 0; i < numRows; i++) {\n for (int j = 0; j < numCols; j++) {\n data[i][j] = data[i][j] * val;\n }\n }\n }", "public void scalarMultiply(double s) {\n for (int i=0; i<rows; i++) {\n for (int j=0; j<cols; j++) {\n matrix.get(i)[j] *= s;\n }\n }\n }", "private static void directProd(DMatrixRMaj a, DMatrixRMaj b, DMatrixRMaj c) {\n for (int i=0; i<5; ++i) {\n for (int j=0; j<5; ++j) {\n c.unsafe_set(i, j, a.unsafe_get(i, 0)*b.unsafe_get(j, 0));\n }\n }\n }", "public Matrix multiplyTransposeM(Matrix m) {\n\t\tMatrix newMatrix = new Matrix(nbRows, m.getNbRows());\n\t\tmultiplyTransposeB(this, m, newMatrix);\n\n\t\treturn newMatrix;\n\t}", "@Test\n\tpublic void testMultiply() {\n\t\tdouble epsilon = 0.0000000001;\n\n\t\tdouble[][] values2 = {{1.1, 1.2, 1.3}, {2.1, 2.2, 2.3}};\n\t\tMatrix m2 = new Matrix(values2);\n\n\t\tdouble[][] expectedValues = {{3.73, 3.96, 4.19}, {9.67, 10.24, 10.81}, {-2.07, -2.24, -2.41}};\n\t\tMatrix expected = new Matrix(expectedValues);\n\n\t\tMatrix product = m1.multiply(m2);\n\n\t\tassertEquals(3, product.getRowCount(), \"Product have unexpected number of rows.\");\n\t\tassertEquals(3, product.getColCount(), \"Product have unexpected number of columns.\");\n\n\t\tfor (int i = 0; i < product.getRowCount(); i++) {\n\t\t\tfor (int j = 0; j < product.getColCount(); j++) {\n\t\t\t\tassertTrue(Math.abs(product.get(i, j) - expected.get(i, j)) < epsilon,\n\t\t\t\t\t\"Unexpected value on row \" + i + \" column \" + j + \".\");\n\t\t\t}\n\t\t}\n\t}", "Matrix mul(double w){\n Matrix matrix_to_return = new Matrix(this.rows, this.cols);\n for(int i=0; i<this.rows * this.cols; i++){\n matrix_to_return.data[i] = this.data[i] * w;\n }\n return matrix_to_return;\n }", "private static void multMatVect(double[] v, double[][] A, double m1,\n double[][] B, double m2) {\n double[] vv = new double[3];\n for(int i = 0; i < 3; i++)\n vv[i] = v[i];\n ArithmeticMod.matVecModM(A, vv, vv, m1);\n for(int i = 0; i < 3; i++)\n v[i] = vv[i];\n\n for(int i = 0; i < 3; i++)\n vv[i] = v[i + 3];\n ArithmeticMod.matVecModM(B, vv, vv, m2);\n for(int i = 0; i < 3; i++)\n v[i + 3] = vv[i];\n }", "public double Multiply(double x, double y){\n\t\treturn x*y;\n\t}", "static float[] mulMV(float[] m, float[] v, float v3){ 0\n // 1\n // 2\n // 3\n\t // 0 1 2 3 \n\t // 4 5 6 7\n\t // 8 9 10 11\n\t // 12 13 14 15\n\t // \n \n return new float[]{\n \t m[ 0]*v[0] + m[ 1]*v[1] + m[ 2]*v[2] + m[ 3]*v3,\n \t m[ 4]*v[0] + m[ 5]*v[1] + m[ 6]*v[2] + m[ 7]*v3,\n \t m[ 8]*v[0] + m[ 9]*v[1] + m[10]*v[2] + m[11]*v3,\n \t m[12]*v[0] + m[13]*v[1] + m[14]*v[2] + m[15]*v3};\n }", "public DVec multiply(DVec arg0) {\n\t\tDVec vec = new DVec(arg0.rowCount());\n\t\tfor (int i = 0; i < rowCount(); i++)\n\t\t\tfor (int j = 0; j < columnCount(); j++)\n\t\t\t\tvec.set(i, get(i, j) * arg0.get(i));\n\t\treturn vec;\n\t}", "public int multiplication(int[] dsMat, int i, int j, int[][] T)\n\t{\n\t\tif (i == j) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t// variable to store cost of scalar multiplications\n\t\tint min = Integer.MAX_VALUE;\n\n\t\t// if this value is calculted for first time\n\t\tif (T[i][j] == 0)\n\t\t{\n /* M[i,j]\n /\\\n / \\\n / \\\n M[i,k] M[k+1,j] \n */\n\n\t\t\tfor (int k = i ; k < j; k++)\n\t\t\t{\n\t\t\t\t // recur for i x k matrix // recur for k+1 x j matrix \n int cost = multiplication(dsMat, i, k, T) + multiplication(dsMat, k+1, j, T);\n\n // cost to multiply two (i x k) and (k+1 x j) matrix\n cost+= dsMat[i-1] * dsMat[k] * dsMat[j];\n \n // take minimum possible cost\n\t\t\t\tif (cost < min)\n\t\t\t\t\tmin = cost;\n }\n \n // put in table for future reference\n\t\t\tT[i][j] = min;\n\t\t}\n\n\t\t// return min cost to multiply M[i,j]\n\t\treturn T[i][j];\n\t}", "public static double[] sequentialMultiplyMatrixVector(double[][] m, double[] v) {\n double[] result = new double[v.length];\n for(int rowM = 0; rowM < v.length; rowM++) {\n double c = 0.0;\n for (int columnM = 0; columnM < v.length; columnM++)\n c+= m[rowM][columnM] * v[columnM]; /* columnA = rowB */\n result[rowM] = c;\n }\n return result;\n }", "public double innerProduct(double[] x1, double[] x2) {\n\t\tdouble result = 0.0d;\n\t\tfor (int i = 0; i < x1.length; i++) {\n\t\t\tresult += x1[i] * x2[i];\n\t\t}\n\t\treturn result;\n\t}", "public Matrix times(Matrix B) throws JPARSECException {\n if (B.m != n) {\n throw new JPARSECException(\"Matrix inner dimensions must agree.\");\n }\n Matrix X = new Matrix(m,B.n);\n double[][] C = X.getArray();\n double[] Bcolj = new double[n];\n for (int j = 0; j < B.n; j++) {\n for (int k = 0; k < n; k++) {\n Bcolj[k] = B.data[k][j];\n }\n for (int i = 0; i < m; i++) {\n double[] Arowi = data[i];\n double s = 0;\n for (int k = 0; k < n; k++) {\n s += Arowi[k]*Bcolj[k];\n }\n C[i][j] = s;\n }\n }\n return X;\n }", "Matrix mult(Matrix M){\n if(this.getSize() != M.getSize()){\n throw new RuntimeException(\"Matrix\");\n\n } \n int newMatrixSize = this.getSize();\n Matrix newM = M.transpose();\n Matrix resultMatrix = new Matrix(newMatrixSize);\n double resultMatrix_Entry = 0;\n for(int i = 1; i <= newMatrixSize; i++){\n for(int j = 1; j<= newMatrixSize; j++){\n List itRow_A = this.rows[i - 1];\n List itRow_B = newM.rows[j-1];\n itRow_A.moveFront();\n itRow_B.moveFront();\n while((itRow_A.index() != -1) && (itRow_B.index() != -1)){\n Entry c_A = (Entry)itRow_A.get();\n Entry c_B = (Entry) itRow_B.get();\n if(c_A.column == c_B.column){\n resultMatrix_Entry += (c_A.value)*(c_B.value);\n itRow_A.moveNext();\n itRow_B.moveNext();\n\n } else if(c_A.column > c_B.column){\n itRow_B.moveNext();\n\n }else{\n itRow_A.moveNext();\n }\n\n }\n resultMatrix.changeEntry(i, j, resultMatrix_Entry);\n resultMatrix_Entry = 0;\n }\n }\n return resultMatrix;\n\n }", "public void multiply(double amount) {\n x *= amount;\n y *= amount;\n }", "public static long[][] multiplyMod(long F[][], long M[][]){\n long x = (F[0][0]*M[0][0])%MOD + (F[0][1]*M[1][0])%MOD; \n long y = (F[0][0]*M[0][1])%MOD + (F[0][1]*M[1][1])%MOD; \n long z = (F[1][0]*M[0][0])%MOD + (F[1][1]*M[1][0])%MOD; \n long w = (F[1][0]*M[0][1])%MOD + (F[1][1]*M[1][1])%MOD; \n\n return new long[][]{{x,y},{z,w}};\n }", "public double multiply(double x, double y) {\n\t\treturn x * y;\n\t}", "public int multiply(int x , int y ) {\n\t\tif( x==0 || y == 0)\n\t\t\treturn 0;\n\t\treturn exp[ log[x] + log[y]];\n\t}", "public int multi(Integer x, Integer y) {\n\t\treturn x*y;\n\t}", "public static double[][] multiplyMatrixes( double[][] m1, double[][] m2 ) {\n double[][] result = new double[3][3];\n multiplyMatrixes( m1, m2, result );\n return result;\n }", "public static VectorIntf componentProduct(VectorIntf x, VectorIntf y) {\r\n if (x==null) throw new IllegalArgumentException(\"1st arg is null\");\r\n if (y==null) throw new IllegalArgumentException(\"2nd arg is null\");\r\n final int n = x.getNumCoords();\r\n if (n!=y.getNumCoords())\r\n throw new IllegalArgumentException(\"dimensions don't match\");\r\n VectorIntf z = x.newInstance(); // x.newCopy();\r\n try {\r\n for (int i = 0; i < n; i++) {\r\n z.setCoord(i, x.getCoord(i) * y.getCoord(i));\r\n }\r\n }\r\n catch (parallel.ParallelException e) {\r\n e.printStackTrace(); // can never get here\r\n }\r\n return z;\r\n }", "@Override\n public float dot(INDArray x, INDArray y) {\n //return NativeBlas.ddot(x.length(), x.data(), 0, 1, y.data(), 0, 1);\n return JavaBlas.rdot(x.length(), x.data(), x.offset(), 1, y.data(), y.offset(), 1);\n }", "Matrix scalarMult(double x){\n int newMatrixSize = this.getSize();\n Matrix newM = new Matrix(newMatrixSize);\n for(int i = 1; i <= newMatrixSize; i++){\n List itRow = rows[i - 1];\n itRow.moveFront();\n while(itRow.index() != -1){\n Entry c = (Entry)itRow.get();\n newM.changeEntry(i, c.column, (x*c.value));\n itRow.moveNext();\n }\n }\n\n return newM;\n }", "public boolean rightMult(PointMatrix m2) {\n if (numCols() == m2.numRows()) {\n for (int j = 0; j < m2.numCols(); j++) {\n double[] cur = new double[m2.numRows()];\n for (int i = 0; i < cur.length; i++) {\n cur[i] = 0;\n for (int k = 0; k < m2.numRows(); k++) {\n cur[i] += getEl(i, k) * m2.getEl(k, j);\n }\n }\n for (int i = 0; i < cur.length; i++) {\n m2.replace(i, j, cur[i]);\n }\n }\n return true;\n } else {\n return false;\n }\n }", "public int producto(){\r\n return x*y;\r\n }", "public int Multiply(int x, int y){\n\t\treturn x*y;\n\t}", "public Matrix4f GetMultipliedMatrix(Matrix4f m) {\n\n\t/*\n\tinputs--\n\t\n\tm :\n\t The input matrix m, instance of Matrix4f\n\t*/\n\t\n\t/*\n\toutputs--\n\t\n\tmul :\n\t The matrix this times m\n\t*/\n\t\n\t// Create new matrix to hold the results\n\tMatrix4f mul = new Matrix4f();\n\t\n\t// Double for loop based standard multiplication\n\tfor (int n_i = 0; n_i < 4; n_i ++) {\n\t \n\t for(int n_j = 0; n_j < 4 ; n_j ++) {\n\t\t\n\t\t// Set entry one by one\n\t\tfloat f_val = 0;\n\t\tfor (int n_k = 0; n_k < 4; n_k ++) {\n\t\t\n\t\t f_val += this.mat_f_m[n_i][n_k]*m.GetComponent(n_k, n_j);\n\t\t\n\t\t}\n\t\tmul.SetComponent(n_i, n_j, f_val);\n\t\t\n\t }\n\t\n\t}\n\t\n\t// Return the multiplied matrix\n\treturn mul;\n \n }", "public static int[][] transposeMultMatrix(int initialValue,int rows,int columns)\n {\n int[][] ori = new int[rows][columns];\n int[][] orit = new int[columns][rows];\n int[][] res = new int[rows][rows];\n int i,j;\n for(i=0; i<rows; i++) {\n for(j=0; j<columns; j++) {\n ori[i][j] = initialValue;\n orit[j][i] = initialValue;\n initialValue++;\n }\n }\n int xi,yj;\n for(i=0; i<rows; i++) {\n for(j=0; j<rows; j++) {\n for(xi=0,yj=0; xi<columns&&yj<columns; xi++,yj++) {\n res[i][j] += ori[i][xi]*orit[yj][j];\n }\n }\n }\n return res;\n }", "public static double v_m(double a, double m, double[] x, double[] y) {\r\n\t\tdouble v_b = 0;\r\n\t\tfor (int i = 0; i < x.length; i++) {\r\n\t\t\tv_b = v_b + a * Math.log(x[i]) * v_a(a, m, x, y);\r\n\t\t}\r\n\t\treturn v_b;\r\n\t}", "private static void multiplyArray(double [][] matrixA, double [][] matrixB, double [][] matrixC) {\n\t\t\n\t\tmatrixC[0][0] = ((matrixA[0][0] * matrixB[0][0]) + (matrixA[0][1] * matrixB[1][0]));\n\t\tmatrixC[0][1] = ((matrixA[0][0] * matrixB[0][1]) + (matrixA[0][1] * matrixB[1][1]));\n\t\tmatrixC[1][0] = ((matrixA[1][0] * matrixB[0][0]) + (matrixA[1][1] * matrixB[1][0]));\n\t\tmatrixC[1][1] = ((matrixA[1][0] * matrixB[0][1]) + (matrixA[1][1] * matrixB[1][1]));\n\t}", "private static int multiply(int i, int j) {\n\t\tint k=1;\n\t\tint sum=0;\n\t\twhile(k<=j)\n\t\t{\n\t\t\tsum = sum +i;\n\t\t\tk++;\n\t\t\t\n\t\t}\n\t\treturn sum;\n\t}", "public void multiply()\r\n {\r\n resultDoubles = Operations.multiply(leftOperand, rightOperand);\r\n resultResetHelper();\r\n }", "public interface IMatrixMultiplicator {\n\n\t/**\n\t * Multiplies two matrixes and returns the result in a new matrix \n\t * \n\t * @param matrixA first matrix\n\t * @param matrixB second matrix \n\t * @return result of the multiplication\n\t */\n\tpublic long multiplyMatrix(final Matrix matrixA, final Matrix matrixB, final Matrix res);\n\t \n\t\n}", "public static double[][] multiply(double[][] a, double[][] b) {\n int m1 = a.length;\n int n1 = a[0].length;\n int m2 = b.length;\n int n2 = b[0].length;\n if (n1 != m2) throw new RuntimeException(\"Illegal matrix dimensions.\");\n double[][] c = new double[m1][n2];\n for (int i = 0; i < m1; i++)\n for (int j = 0; j < n2; j++)\n for (int k = 0; k < n1; k++)\n c[i][j] += a[i][k] * b[k][j];\n return c;\n }", "public static double[][] multiplyMatrices(double[][] firstMatrix, double[][] secondMatrix, int r1, int c1, int c2) {\r\n\t double[][] product = new double[r1][c2];\r\n\t for(int i = 0; i < r1; i++) {\r\n\t for (int j = 0; j < c2; j++) {\r\n\t for (int k = 0; k < c1; k++) {\r\n\t product[i][j] += firstMatrix[i][k] * secondMatrix[k][j];\r\n\t }\r\n\t }\r\n\t }\r\n\r\n\t return product;\r\n\t }", "static public double[][] MatrixMult( double [][] A , double [][] B) {\n\t// A [NxK] * B[KxZ] = M[NxZ]\n\tif ( A.length == 0 || B.length == 0 || A[0].length != B.length ) {\n\t System.out.println( \"Matrix Mult Error, Invalid Input Matricies\" );\n\t return new double[1][1];\n\t}\n\tint Rows = A.length , Cols = B[0].length;\n\tdouble [][] M = new double[Rows][Cols];\n\tfor( int i = 0; i < Rows ; i++ ) {\n\t for( int j = 0; j < Cols ; j++ ) {\n\t\tM[i][j] = multRowByCol( A , B , i , j );\n\t }\n\t}\n\treturn M;\n }", "public static int MatrixChainMult(int i, int j){ //\n\n if(i == j)\n return 0;\n if(mem[i][j] != 0)\n return mem[i][j];\n int min_ans = Integer.MAX_VALUE;\n\n for(int k=i;k<j;k++){\n int count = MatrixChainMult(i , k)\n + MatrixChainMult(k+1 , j)\n + ar[i-1] * ar[k] * ar[j];\n \n min_ans = Math.min(min_ans, count);\n\n }\n //memoization\n mem[i][j] = min_ans;\n return min_ans;\n }", "@Test(expectedExceptions = IllegalArgumentException.class)\n\tpublic void testMultiplyWrongDimensions() {\n\t\tm1.multiply(m1);\n\t}", "public byte[][] multiplyMatricesFiniteField(byte[][] m1, byte[][] m2) {\n\n byte[][] result = new byte[m1.length][m2[0].length];\n\n int rows = m1.length;\n int cols = m2[0].length;\n\n for(int i = 0; i < rows; i++) {\n int sum = 0;\n for(int j = 0; j < cols; j++) {\n for(int k = 0; k < 4; k++) {\n sum ^= multiplyPolynomialsMod(m1[i][k],m2[k][j], reductionPolynomial);\n }\n result[i][j] = (byte)sum;\n }\n }\n\n return result;\n }", "public void multiplyOneMinusP0H(){\n\t\t\n\t\tfor (int I : targetLengthSet)\n\t\t for (int i = 1; i < I+1; i++)\n\t\t\t\tfor (int j = 1; j < I+1; j++)\n\t\t\t\t a[i][j][I] *= (1-p0H);\n\t\tfor (int I : targetLengthSet){\n\t\t for (int i = 1; i < I+1; i++){\n\t\t\t\tfor (int j = 1; j < I+1; j++){\n\t\t\t\t a[i][i + I][I] = p0H;\n\t\t a[i + I][i + I][I] = p0H;\n\t\t a[i+I][j][I] = a[i][j][I];\n\t\t\t\t}\n\t\t }\n\t\t}\n\t}" ]
[ "0.6701933", "0.66132826", "0.64722264", "0.6402359", "0.6356819", "0.6347038", "0.6248077", "0.6245773", "0.6238487", "0.6193377", "0.6165633", "0.6126732", "0.6126488", "0.60866207", "0.60855955", "0.60555464", "0.60508776", "0.60178375", "0.6009139", "0.5995921", "0.598542", "0.59388995", "0.5936862", "0.58977234", "0.5891406", "0.58850354", "0.5863492", "0.5831622", "0.5822252", "0.57642025", "0.57642025", "0.572805", "0.5714147", "0.5707881", "0.57042485", "0.570034", "0.5680305", "0.56671536", "0.56605834", "0.56466514", "0.5643337", "0.5635709", "0.5632883", "0.56131506", "0.5609098", "0.5607552", "0.5599242", "0.5594081", "0.5580063", "0.55790794", "0.5570414", "0.55633444", "0.5539935", "0.5509474", "0.549154", "0.54890186", "0.5481818", "0.5481073", "0.547916", "0.54760134", "0.54754645", "0.5467923", "0.5460582", "0.5456787", "0.5434349", "0.54271996", "0.54024625", "0.5398151", "0.5374281", "0.5363816", "0.53614247", "0.5360569", "0.53539234", "0.5341233", "0.5340936", "0.5336729", "0.5329679", "0.5325315", "0.5319384", "0.5305563", "0.5293176", "0.5288636", "0.52733445", "0.5270798", "0.52626985", "0.5260393", "0.52555245", "0.5249804", "0.52476484", "0.5247497", "0.52390873", "0.5225736", "0.52240133", "0.5211891", "0.5205593", "0.5203721", "0.52030563", "0.5186247", "0.51823694", "0.51783335", "0.5175571" ]
0.0
-1
Read the rotation matrix:
@Override public String readSessionInformation(BufferedReader reader, boolean merge) { String textLine = FileUtils.readLine(reader); if (textLine==null) { return "Reading rotation matrix line."; } return readSessionInformation(reader,textLine); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "DMatrix3C getRotation();", "void calculateRotationMatrix() {\n R[0][0] = (float) (Math.cos(angle[0]) * Math.cos(angle[1]));\n R[1][0] = (float) (Math.sin(angle[0]) * Math.cos(angle[1]));\n R[0][1] = (float) (Math.cos(angle[0]) * Math.sin(angle[1]) * Math.sin(angle[2]) - Math.sin(angle[0]) * Math.cos(angle[2]));\n R[1][1] = (float) (Math.sin(angle[0]) * Math.sin(angle[1]) * Math.sin(angle[2]) + Math.cos(angle[0]) * Math.cos(angle[2]));\n R[0][2] = (float) (Math.cos(angle[0]) * Math.sin(angle[1]) * Math.cos(angle[2]) + Math.sin(angle[0]) * Math.sin(angle[2]));\n R[1][2] = (float) (Math.sin(angle[0]) * Math.sin(angle[1]) * Math.cos(angle[2]) - Math.cos(angle[0]) * Math.sin(angle[2]));\n R[2][0] = (float) - Math.sin(angle[1]);\n R[2][1] = (float) (Math.cos(angle[1]) * Math.sin(angle[2]));\n R[2][2] = (float) (Math.cos(angle[1]) * Math.cos(angle[2]));\n }", "public double getRotation();", "public Matrix getCurrentRotation() throws ManipulatorException;", "void setRotation (DMatrix3C R);", "void copyRotation(DMatrix3 R);", "LocalMaterialData rotate();", "public byte getSystem_rotation() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readByte(__io__address + 5);\n\t\t} else {\n\t\t\treturn __io__block.readByte(__io__address + 5);\n\t\t}\n\t}", "public static native long GetRotation(long lpjFbxDualQuaternion);", "public mat4 getRotation() {\n return worldMatrix.getRotation(pr, yr, pr);\n }", "public String readSessionInformation(BufferedReader reader, String textLineIn) {\n String textLine = textLineIn;\n if (textLine==null) { return \"Reading rotation matrix line.\"; }\n textLine = textLine.trim();\n String[] ss = textLine.split(\"[ ]+\",10);\n if (ss.length<9) { return \"Not enough values on rotation matrix line.\"; }\n try {\n int k = -1;\n for (int i=0 ; i<3 ; i++) {\n for (int j=0 ; j<3 ; j++) {\n k++;\n d[i][j] = Double.parseDouble(ss[k].trim()); // converts to Double\n }\n }\n } catch (NumberFormatException e) { return \"Parsing rotation matrix elements.\"; }\n // Return successfully:\n return null;\n }", "public int getRotation() {\n\t\treturn config & 0x3;\n\t}", "@Override\n public float[] getRotationMatrix(){\n float[] baseCorrection = Maths.buildRotationMatrix(new float[]{0, 1, 0, 0});\n\n float[] rotationX = {(float) Math.toDegrees(theta), 1, 0, 0};\n float[] rotationY = {(float) -Math.toDegrees(phi), 0, 1, 0};\n\n float[] rotationMatrix = new float[16];\n float[] coreMotionMatrix = Maths.buildRotationMatrix(rotationY, rotationX);\n Matrix.multiplyMM(rotationMatrix, 0, baseCorrection, 0, coreMotionMatrix, 0);\n\n return rotationMatrix;\n }", "public int getCameraSensorRotation();", "DMatrix3C getOffsetRotation();", "public int getRotation() {\r\n\t\treturn rotation;\r\n\t}", "private Rotor readRotor() {\n try {\n String currCycle = _config.next();\n String permutation = \"\";\n while (currCycle.contains(\"(\")) {\n if (!currCycle.contains(\")\") || currCycle.contains(\"*\")) {\n throw error(\"Wrong cycle format\");\n }\n if (_config.hasNext()) {\n permutation = permutation + currCycle;\n currCycle = _config.next();\n } else if (!_config.hasNext()) {\n permutation = permutation + currCycle;\n break;\n }\n }\n String tempname = _name.toUpperCase();\n if (_config.hasNext()) {\n _name = currCycle;\n }\n if (notches.charAt(0) == 'M') {\n return new MovingRotor(tempname,\n new Permutation(permutation, _alphabet),\n notches.substring(1));\n } else if (notches.charAt(0) == 'N') {\n return new FixedRotor(tempname,\n new Permutation(permutation, _alphabet));\n } else {\n return new Reflector(tempname,\n new Permutation(permutation, _alphabet));\n }\n } catch (NoSuchElementException excp) {\n throw error(\"bad rotor description\");\n }\n }", "public int getRotation() {\n\treturn rotation;\n\t//return rotation;\n}", "void copyOffsetRotation (DMatrix3 R);", "@Test\n public void testGetRotationMatrix() {\n \n AxisRotation rotation = new AxisRotation(0, 0, 1, 54);\n Mat3D rotationMatrix1 = rotation.getRotationMatrix();\n \n AxisRotation rotation2 = new AxisRotation(0, 0, 1, 324);\n Mat3D rotationMatrix2 = rotation2.getRotationMatrix();\n \n System.out.println(\"test\");\n }", "private static int readExifRotation(InputStream is) {\n\n int orientation = 0;\n\n try {\n Metadata metadata = ImageMetadataReader.readMetadata(is);\n orientation = convertExifRotationToDegrees(readRawExifRotation(metadata));\n } catch (ImageProcessingException | IOException e) {\n e.printStackTrace();\n }\n\n return orientation;\n }", "public int getDeviceRotation();", "public float getRotation()\n {\n return rotation;\n }", "public static double rotation()\r\n\t{\r\n\t\treturn -(mxp.getAngle()/45);\r\n\t}", "public float getRotation() {\n return this.rotation;\n }", "int getSensorRotationDegrees();", "public int getRotations();", "public void testRotationMatrix() {\n\n u = 1;\n RotationMatrix rM = new RotationMatrix(a, b, c, u, v, w, theta);\n // This should be the identity matrix\n double[][] m = rM.getMatrix();\n for(int i=0; i<m.length; i++) {\n for(int j=0; j<m.length; j++) {\n if(j==i) {\n assertEquals(m[i][j], 1, TOLERANCE);\n } else {\n assertEquals(m[i][j], 0, TOLERANCE);\n }\n }\n }\n }", "public double getRotation() {\n return getDouble(\"ts\");\n }", "public float getRotation() {\n\t\treturn rotation;\n\t}", "@Override\n\tpublic void readImpl()\n\t{\n\t\t_degree = readD();\n\t\t_side = readD();\n\t}", "public void rotateTransform(Vector3f rot) {\r\n\t\tMatrix4f rx = new Matrix4f();\r\n\t\tMatrix4f ry = new Matrix4f();\r\n\t\tMatrix4f rz = new Matrix4f();\r\n\t\t\t\t\r\n\t\t// Convert the angles to radians\r\n\t\tfloat x = (float) Math.toRadians(rot.x);\r\n\t\tfloat y = (float) Math.toRadians(rot.y);\r\n\t\tfloat z = (float) Math.toRadians(rot.z);\r\n\r\n\t\t// Create the X-Rotation matrix\r\n\t\trx.m[0][0] = 1.0f; rx.m[0][1] = 0.0f;\t \t\t\t rx.m[0][2] = 0.0f; \t\t\t\trx.m[0][3] = 0.0f;\r\n\t rx.m[1][0] = 0.0f; rx.m[1][1] = (float) Math.cos(x); rx.m[1][2] = (float) -Math.sin(x); rx.m[1][3] = 0.0f;\r\n\t rx.m[2][0] = 0.0f; rx.m[2][1] = (float) Math.sin(x); rx.m[2][2] = (float) Math.cos(x) ; rx.m[2][3] = 0.0f;\r\n\t rx.m[3][0] = 0.0f; rx.m[3][1] = 0.0f; \t\t\t\t rx.m[3][2] = 0.0f;\t\t \t\t\trx.m[3][3] = 1.0f;\r\n\r\n\t // Create the Y-Rotation matrix\r\n\t ry.m[0][0] = (float) Math.cos(y); ry.m[0][1] = 0.0f; ry.m[0][2] = (float) -Math.sin(y); ry.m[0][3] = 0.0f;\r\n\t ry.m[1][0] = 0.0f; \t\t\t\t ry.m[1][1] = 1.0f; ry.m[1][2] = 0.0f; \t\t\t\try.m[1][3] = 0.0f;\r\n\t ry.m[2][0] = (float) Math.sin(y); ry.m[2][1] = 0.0f; ry.m[2][2] = (float) Math.cos(y) ; ry.m[2][3] = 0.0f;\r\n\t ry.m[3][0] = 0.0f; \t\t\t\t ry.m[3][1] = 0.0f; ry.m[3][2] = 0.0f; \t\t\t\try.m[3][3] = 1.0f;\r\n\r\n\t // Create the Z-Rotation matrix\r\n\t rz.m[0][0] = (float) Math.cos(z); rz.m[0][1] = (float) -Math.sin(z); rz.m[0][2] = 0.0f; rz.m[0][3] = 0.0f;\r\n\t rz.m[1][0] = (float) Math.sin(z); rz.m[1][1] = (float) Math.cos(z) ; rz.m[1][2] = 0.0f; rz.m[1][3] = 0.0f;\r\n\t rz.m[2][0] = 0.0f; \t\t\t\t rz.m[2][1] = 0.0f; \t\t\t\t rz.m[2][2] = 1.0f; rz.m[2][3] = 0.0f;\r\n\t rz.m[3][0] = 0.0f; \t\t\t\t rz.m[3][1] = 0.0f; \t\t\t\t rz.m[3][2] = 0.0f; rz.m[3][3] = 1.0f;\r\n\t\t\t\r\n\t // Multiply all the matrices together\r\n\t\tMatrix4f rzy = rz.mult(ry);\r\n\t\tMatrix4f r = rzy.mult(rx);\r\n\t\t\t \r\n\t\tm = r.m;\r\n\r\n\t}", "int getRotationDegrees() {\n return rotationDegrees;\n }", "@Test\n public void testParseMatrix() {\n String path1 = \"c:\\\\Voici\\\\input.txt\";\n MatrixReader reader = new MatrixReader(path1);\n Matrix data = reader.getMatrix();\n Matrix[] parsedMatrix = MatrixReader.parseMatrix(data, 10);\n assertEquals(parsedMatrix[0].get(4, 2), data.get(4, 2), 0.001);\n assertEquals(parsedMatrix[2].get(0, 0), data.get(32, 0), 0.001);\n assertEquals(parsedMatrix[1].get(0, 0), data.get(16, 0), 0.001);\n }", "public float getRotation() {\n return pm.pen.getLevelValue(PLevel.Type.ROTATION);\n }", "public double getRotation()\n\t{\n\t\tdouble determinant = this.basisDeterminant();\n\t\tTransform2D m = orthonormalized();\n\t\tif (determinant < 0) \n\t\t{\n\t\t\tm.scaleBasis(new Vector2(1, -1)); // convention to separate rotation and reflection for 2D is to absorb a flip along y into scaling.\n\t\t}\n\t\treturn Math.atan2(m.matrix[0].y, m.matrix[0].x);\n\t}", "@Test\n public void testGetMatrix() {\n String path1 = \"c:\\\\Voici\\\\input.txt\";\n MatrixReader reader = new MatrixReader(path1);\n assertEquals(reader.getMatrix().get(0, 0), -10.615, 0.001);\n assertEquals(reader.getMatrix().get(9, 1), 10.148, 0.001);\n }", "public final Vector3f[] getInvRot() {\n/* 154 */ Vector3f[] result = new Vector3f[3];\n/* 155 */ result[0] = new Vector3f(this.M.mf[0], this.M.mf[1], this.M.mf[2]);\n/* 156 */ result[1] = new Vector3f(this.M.mf[4], this.M.mf[5], this.M.mf[6]);\n/* 157 */ result[2] = new Vector3f(this.M.mf[8], this.M.mf[9], this.M.mf[10]);\n/* 158 */ return result;\n/* */ }", "public static int readExifRotation(File file) {\n\n int orientation = 0;\n\n try {\n Metadata metadata = ImageMetadataReader.readMetadata(file);\n orientation = convertExifRotationToDegrees(readRawExifRotation(metadata));\n } catch (ImageProcessingException | IOException e) {\n e.printStackTrace();\n }\n\n return orientation;\n }", "public Vector3f getRotationVec(int xform) {\n\t\treturn m_xforms[xform].m_rotate;\n\t}", "private int getOrientation(int rotation) {\n // Sensor orientation is 90 for most devices, or 270 for some devices (eg. Nexus 5X)\n // We have to take that into account and rotate JPEG properly.\n // For devices with orientation of 90, we simply return our mapping from ORIENTATIONS.\n // For devices with orientation of 270, we need to rotate the JPEG 180 degrees.\n return (ORIENTATIONS.get(rotation) + mSensorOrientation + 270) % 360;\n }", "private int getOrientation(int rotation) {\n // Sensor orientation is 90 for most devices, or 270 for some devices (eg. Nexus 5X)\n // We have to take that into account and rotate JPEG properly.\n // For devices with orientation of 90, we simply return our mapping from ORIENTATIONS.\n // For devices with orientation of 270, we need to rotate the JPEG 180 degrees.\n if (isFrontFacing && INVERSE_ORIENTATIONS.get(rotation) == 180) {\n return (ORIENTATIONS.get(rotation) + mSensorOrientation + 90) % 360;\n } else {\n return (ORIENTATIONS.get(rotation) + mSensorOrientation + 270) % 360;\n }\n\n }", "Vec3[] getInvRot()\n {\n Vec3[] pvRot = new Vec3[3];\n pvRot[0] = m.<Vec4>getColumn(0).getXYZ();\n pvRot[1] = m.<Vec4>getColumn(1).getXYZ();\n pvRot[2] = m.<Vec4>getColumn(2).getXYZ();\n return pvRot;\n }", "public float getSavedRotation() {\n return pm.pen.getLevelValue(PLevel.Type.ROTATION);\n }", "public abstract double getOrientation();", "public Vector3f getRotationVec() {\n\t\treturn m_xforms[NvCameraXformType.MAIN].m_rotate;\n\t}", "private void determineOrientation(float[] rotationMatrix) {\n\t\t\t float[] orientationValues = new float[3];\n\t\t SensorManager.getOrientation(rotationMatrix, orientationValues);\n\t\t double azimuth = Math.toDegrees(orientationValues[0]);\n\t\t double pitch = Math.toDegrees(orientationValues[1]);\n\t\t double roll = Math.toDegrees(orientationValues[2]);\n\t\t if (pitch <= 10)\n\t\t { \n\t\t if (Math.abs(roll) >= 170)\n\t\t {\n\t\t onFaceDown();\n\t\t }\n\t\t else if (Math.abs(roll) <= 10)\n\t\t {\n\t\t onFaceUp();\n\t\t }\n\t\t }\n\t\t\t\n\t\t}", "static PMatrix3D getRotMatrixForRodrigues(PVector rodrigues ) {\n PMatrix3D R =new PMatrix3D();\n float theta=rodrigues.mag();\n if (theta<0.0001)return R;\n PVector normalized=PVector.mult(rodrigues, 1.0f/theta);\n\n\n float x = normalized.x;\n float y = normalized.y;\n float z = normalized.z;\n\n float c = (float)Math.cos( theta );\n float s = (float)Math.sin( theta );\n float oc = 1.0f - c;\n\n R.m00 = c + x * x * oc;\n R.m01 = x * y * oc - z * s;\n R.m02 = x * z * oc + y * s;\n\n R.m10 = y * x * oc + z * s;\n R.m11 = c + y * y * oc;\n R.m12 = y * z * oc - x * s;\n\n R.m20 = z * x * oc - y * s;\n R.m21 = z * y * oc + x * s;\n R.m22 = c + z * z * oc;\n\n return R;\n }", "public void rotate() {\n // amoeba rotate\n // Here i will use my rotation_x and rotation_y\n }", "public boolean hasRotate() { return hasRotate; }", "@Override\n\tpublic Rotation3 GetRotation() {\n\t\treturn new Rotation3(0f);\n\t}", "public double getRot() {\n return this.rot;\n }", "public static byte[][] rotate(byte[][] toRotate, byte direction){\n byte[][] newMatrix = {{-1, -1, -1},{-1, -1, -1},{-1, -1, -1}};\n //iterating throug each element of the matrix and placing them to the right spot\n //only works for 3x3 matrixes\n for(byte y = 0; y < 3; y ++){\n for(byte x = 0; x < 3; x ++){\n if(direction == 1){\n newMatrix[x][2-y] = toRotate[y][x];\n }\n else{\n newMatrix[2-x][y] = toRotate[y][x];\n }\n \n }\n }\n return newMatrix;\n }", "public int getMediaRecorderRotation() {\n return this.mMediaRemcoderRotation;\n }", "@Override\n\tprotected void readImpl()\n\t{\n\t\t_x = readD();\n\t\t_y = readD();\n\t\t_z = readD();\n\t\t_heading = readD();\n\t}", "void rotate();", "public IOrientation getOrientation();", "void setOffsetRotation(DMatrix3C R);", "@Override\n\tpublic Mat GetRomateMatrix()\n\t{\n\t\treturn mR;\n\t}", "public Matrix3f getPhysicsRotationMatrix(Matrix3f rotation) {\n if (rotation == null) {\n rotation = new Matrix3f();\n }\n rBody.getCenterOfMassTransform(tempTrans);\n return Converter.convert(tempTrans.basis, rotation);\n }", "@Override\n\tpublic Vec3 getRotationData(IBlockState state) {\n\t\treturn null;\n\t}", "public int getRotationState() {\n return this.rotationState;\n }", "public double[][] convert_img_mat()\n\t{\n\t\tif(orderflag)\n\t\t{\n\t\t\tputpixel_1();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//rotate the image and get the pixels as usual form\t\n \t\tputpixel_2();\n\t\t}\n\treturn matrix;\n\t}", "public float getRawRotationAngle() {\n return this.mRawRotationAngle;\n }", "public double getRotation1() {\n return rotation1;\n }", "default void get(FrameCommonMatrix3DBasics rotationMatrixToPack)\n {\n rotationMatrixToPack.setReferenceFrame(getReferenceFrame());\n get((CommonMatrix3DBasics) rotationMatrixToPack);\n }", "public static float getRawImageRotation (String rawImageFilePath)\r\n throws IOException\r\n {\r\n float angle = 0;\r\n ExifInterface exifReader;\r\n exifReader = new ExifInterface(rawImageFilePath);\r\n\r\n int orientation =\r\n exifReader.getAttributeInt(ExifInterface.TAG_ORIENTATION, -1);\r\n\r\n switch (orientation)\r\n {\r\n case ExifInterface.ORIENTATION_NORMAL:\r\n case ExifInterface.ORIENTATION_FLIP_HORIZONTAL:\r\n angle = 0;\r\n break;\r\n case ExifInterface.ORIENTATION_ROTATE_180:\r\n case ExifInterface.ORIENTATION_FLIP_VERTICAL:\r\n angle = 180;\r\n break;\r\n case ExifInterface.ORIENTATION_TRANSPOSE:\r\n case ExifInterface.ORIENTATION_ROTATE_90:\r\n angle = 90;\r\n break;\r\n case ExifInterface.ORIENTATION_TRANSVERSE:\r\n case ExifInterface.ORIENTATION_ROTATE_270:\r\n angle = 270;\r\n default:\r\n break;\r\n }\r\n return angle;\r\n }", "public void loadMatrixIO() {\n qMatrixFile = new FileIO(\"qMatrix.txt\");\n sMatrixFile = new FileIO(\"sMatrix.txt\");\n\n }", "public double getRotationAngle() {\n\t\treturn _rotationAngle;\n\t}", "private static int getMetadataBasedOnRotation(int rotation) {\n\t\t if (rotation >= 315 || rotation < 45) {\n\t\t\t return 1;\n\t\t } \n\t\t \n\t\t else if (rotation >= 45 && rotation < 135) {\n\t\t\t return 2;\n\t\t } \n\t\t \n\t\t else if (rotation >= 135 && rotation < 225) {\n\t\t\t return 0;\n\t\t } \n\t\t \n\t\t else {\n\t\t\t return 3;\n\t\t }\n\t }", "public float getBaseRotation() {\n return this.baseRotation;\n }", "public void rotate(double deg) {\n deg = deg % 360;\n// System.out.println(\"Stopni:\" + deg);\n double e = 0;\n double f = 0;\n\n// for(int i = 0; i < pixels.length; i++) {\n// for(int j = 0; j < pixels[i].length; j++) {\n// e += pixels[i][j].getX();\n// f += pixels[i][j].getY();\n// }\n// }\n //e = e / (pixels.length * 2);\n //f = f / (pixels[0].length * 2);\n e = pixels.length / 2;\n f = pixels[0].length / 2;\n System.out.println(e);\n System.out.println(f);\n\n// System.out.println(e + \":\" + f);\n Matrix affineTransform;\n Matrix translateMinus = Matrix.translateRotate(-e, -f);\n Matrix translatePlus = Matrix.translateRotate(e, f);\n Matrix movedTransform = Matrix.multiply(translateMinus, Matrix.rotate(deg));\n //movedTransform.display();\n affineTransform = Matrix.multiply(movedTransform, translatePlus);\n //affineTransform.display();\n\n for(int i = 0; i < pixels.length; i++) {\n for(int j = 0; j < pixels[i].length; j++) {\n double[][] posMatrix1 = {{pixels[i][j].getX()}, {pixels[i][j].getY()}, {1}};\n Matrix m1 = new Matrix(posMatrix1);\n Matrix result1;\n result1 = Matrix.multiply(Matrix.transpose(affineTransform.v), m1);\n\n pixels[i][j].setX(Math.round(result1.v[0][0]));\n pixels[i][j].setY(Math.round(result1.v[1][0]));\n }\n }\n\n\n }", "public double getRotationAngleInRadians() {\n return Math.toRadians(rotationAngle);\n }", "public void readMatriz(String message)\n {\n //definir dados\n int i;\n int j;\n int lin;\n int col;\n String linha;\n\n //obter dimensoes\n lin = lines();\n col = columns();\n\n //verificar se dimensoes sao validas\n if( lin <= 0 || col <= 0 )\n {\n IO.println(\"ERRO: Tamanho invalido. \" );\n } //end\n else\n {\n //mostrar mensagem antes de ler dados\n IO.println(message);\n\n //obter tamanho da matriz\n lin = this.lines();\n col = this.columns();\n\n //repetir para cada posicao da matriz\n for(i = 0; i < lin; i++)\n {\n for(j = 0; j < col; j++)\n {\n //ler linha do teclado\n linha = IO.readln();\n\n //armazenar em uma posicao da matriz\n //com objeto em String\n table[i][j] = linha;\n } //end repetir\n } //end repetir\n } //end se\n }", "private double getRotationMomentum()\n\t{\n\t\treturn getRotation() * this.currentMomentMass;\n\t}", "private void RLRotation(IAVLNode node)\r\n\t{\r\n\t\tLLRotation(node.getRight());\r\n\t\tRRRotation(node);\r\n\t}", "public void setRotation(double angle)\n\t{\n\t\tdouble cos = Math.cos(angle);\n\t\tdouble sin = Math.sin(angle);\n\t\tmatrix[0].x=cos;\n\t\tmatrix[0].y=sin;\n\t\tmatrix[1].x=-sin;\n\t\tmatrix[1].y=cos;\n\t}", "public static Matrix read(BufferedReader input) throws java.io.IOException, JPARSECException {\n StreamTokenizer tokenizer= new StreamTokenizer(input);\n\n // Although StreamTokenizer will parse numbers, it doesn't recognize\n // scientific notation (E or D); however, Double.valueOf does.\n // The strategy here is to disable StreamTokenizer's number parsing.\n // We'll only get whitespace delimited words, EOL's and EOF's.\n // These words should all be numbers, for Double.valueOf to parse.\n\n tokenizer.resetSyntax();\n tokenizer.wordChars(0,255);\n tokenizer.whitespaceChars(0, ' ');\n tokenizer.eolIsSignificant(true);\n java.util.Vector v = new java.util.Vector();\n\n // Ignore initial empty lines\n while (tokenizer.nextToken() == StreamTokenizer.TT_EOL);\n if (tokenizer.ttype == StreamTokenizer.TT_EOF)\n throw new java.io.IOException(\"Unexpected EOF on matrix read.\");\n do {\n v.addElement(Double.valueOf(tokenizer.sval)); // Read & store 1st row.\n } while (tokenizer.nextToken() == StreamTokenizer.TT_WORD);\n\n int n = v.size(); // Now we've got the number of columns!\n double row[] = new double[n];\n for (int j=0; j<n; j++) // extract the elements of the 1st row.\n row[j]=((Double)v.elementAt(j)).doubleValue();\n v.removeAllElements();\n v.addElement(row); // Start storing rows instead of columns.\n while (tokenizer.nextToken() == StreamTokenizer.TT_WORD) {\n // While non-empty lines\n v.addElement(row = new double[n]);\n int j = 0;\n do {\n if (j >= n) throw new java.io.IOException\n (\"Row \" + v.size() + \" is too long.\");\n row[j++] = Double.valueOf(tokenizer.sval).doubleValue();\n } while (tokenizer.nextToken() == StreamTokenizer.TT_WORD);\n if (j < n) throw new java.io.IOException\n (\"Row \" + v.size() + \" is too short.\");\n }\n int m = v.size(); // Now we've got the number of rows.\n double[][] A = new double[m][];\n v.copyInto(A); // copy the rows out of the vector\n return new Matrix(A);\n }", "public int getOrientation(){ return mOrientation; }", "public static Matrix getR3(double angle)\n\t{\n\t\tMatrix m = new Matrix(3, 3);\n\t\tm.data[0] = new double[] {Math.cos(angle), Math.sin(angle), 0.0};\n\t\tm.data[1] = new double[] {-Math.sin(angle), Math.cos(angle), 0.0};\n\t\tm.data[2] = new double[] {0.0, 0.0, 1.0};\n\t\treturn m;\n\t}", "private Bitmap rotateBitmapOrientation(String photoFilePath) {\n BitmapFactory.Options bounds = new BitmapFactory.Options();\n bounds.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(photoFilePath, bounds);\n BitmapFactory.Options opts = new BitmapFactory.Options();\n Bitmap bm = BitmapFactory.decodeFile(photoFilePath, opts);\n // Read EXIF Data\n ExifInterface exif = null;\n try {\n exif = new ExifInterface(photoFilePath);\n } catch (IOException e) {\n e.printStackTrace();\n }\n String orientString = exif.getAttribute(ExifInterface.TAG_ORIENTATION);\n int orientation = orientString != null ? Integer.parseInt(orientString) : ExifInterface.ORIENTATION_NORMAL;\n int rotationAngle = 0;\n if (orientation == ExifInterface.ORIENTATION_ROTATE_90) rotationAngle = 90;\n if (orientation == ExifInterface.ORIENTATION_ROTATE_180) rotationAngle = 180;\n if (orientation == ExifInterface.ORIENTATION_ROTATE_270) rotationAngle = 270;\n // Rotate Bitmap\n Matrix matrix = new Matrix();\n matrix.setRotate(rotationAngle, (float) bm.getWidth() / 2, (float) bm.getHeight() / 2);\n Bitmap rotatedBitmap = Bitmap.createBitmap(bm, 0, 0, bounds.outWidth, bounds.outHeight, matrix, true);\n // Return result\n return rotatedBitmap;\n }", "@Test\n public void testGetSetRollPitchYawAngles() throws WrongSizeException {\n UniformRandomizer randomizer = new UniformRandomizer(new Random());\n double roll = randomizer.nextDouble(2.0 * MIN_ANGLE_DEGREES, \n 2.0 * MAX_ANGLE_DEGREES) * Math.PI / 180.0;\n double pitch = randomizer.nextDouble(MIN_ANGLE_DEGREES, \n MAX_ANGLE_DEGREES) * Math.PI / 180.0;\n double yaw = randomizer.nextDouble(2.0 * MIN_ANGLE_DEGREES, \n 2.0 * MAX_ANGLE_DEGREES) * Math.PI / 180.0;\n \n MatrixRotation3D rotation = new MatrixRotation3D();\n \n //set angles\n rotation.setRollPitchYaw(roll, pitch, yaw);\n \n //retrieve angles to check correctness\n assertTrue(Math.abs(rotation.getRollAngle() - roll) < ABSOLUTE_ERROR ||\n Math.abs(rotation.getRollAngle2() - roll) < ABSOLUTE_ERROR);\n assertTrue(Math.abs(rotation.getPitchAngle() - pitch) < ABSOLUTE_ERROR ||\n Math.abs(rotation.getPitchAngle2() - roll) < ABSOLUTE_ERROR);\n assertTrue(Math.abs(rotation.getYawAngle() - yaw) < ABSOLUTE_ERROR ||\n Math.abs(rotation.getYawAngle2() - yaw) < ABSOLUTE_ERROR);\n\n //check internal matrix\n Matrix rotationMatrix = rotation.getInternalMatrix();\n \n Matrix rotationMatrix2 = new Matrix(ROTATION_ROWS, ROTATION_COLS);\n rotationMatrix2.setElementAt(0, 0, Math.cos(pitch) * Math.cos(yaw));\n rotationMatrix2.setElementAt(1, 0, Math.cos(pitch) * Math.sin(yaw));\n rotationMatrix2.setElementAt(2, 0, -Math.sin(pitch));\n \n rotationMatrix2.setElementAt(0, 1, -Math.cos(roll) * Math.sin(yaw) + \n Math.sin(roll) * Math.sin(pitch) * Math.cos(yaw));\n rotationMatrix2.setElementAt(1, 1, Math.cos(roll) * Math.cos(yaw) + \n Math.sin(roll) * Math.sin(pitch) * Math.sin(yaw));\n rotationMatrix2.setElementAt(2, 1, Math.sin(roll) * Math.cos(pitch));\n \n rotationMatrix2.setElementAt(0, 2, Math.sin(roll) * Math.sin(yaw) + \n Math.cos(roll) * Math.sin(pitch) * Math.cos(yaw));\n rotationMatrix2.setElementAt(1, 2, -Math.sin(roll) * Math.cos(yaw) +\n Math.cos(roll) * Math.sin(pitch) * Math.sin(yaw));\n rotationMatrix2.setElementAt(2, 2, Math.cos(roll) * Math.cos(pitch));\n \n //check that rotation matrices are equal (up to a certain error)\n assertTrue(rotationMatrix.equals(rotationMatrix2, ABSOLUTE_ERROR));\n }", "int getStartRotationDegree();", "public float getRotationAngle() {\n return this.mRotationAngle;\n }", "public Matrix3f getPhysicsRotationMatrix() {\n return getPhysicsRotationMatrix(null);\n }", "public static Matrix rotateZ(double rad) {\n List<List<Double>> backingArray = get2DListOfSize(4);\n /*\n |cosr -sinr 0 0|\n |sinr cosr 0 0|\n |0 0 1 0|\n |0 0 0 1|\n */\n double cos = Math.cos(rad);\n double sin = Math.sin(rad);\n\n backingArray.get(0).set(0, cos);\n backingArray.get(0).set(1, -1*sin);\n backingArray.get(1).set(0, sin);\n backingArray.get(1).set(1, cos);\n backingArray.get(2).set(2, 1d);\n backingArray.get(3).set(3, 1d);\n\n return new Matrix(backingArray);\n }", "private String[] readMaterials() throws IOException\n {\n final int materialCount = this.reader.readByte();\n final String[] materials = new String[materialCount];\n for (int i = 0; i < materialCount; i++)\n {\n materials[i] = this.reader.readString(this.reader.readByte());\n }\n return materials;\n }", "int getMinRotation();", "public Bitmap rotateBitmapOrientation(String file) {\n\t BitmapFactory.Options bounds = new BitmapFactory.Options();\n\t bounds.inJustDecodeBounds = true;\n\t BitmapFactory.decodeFile(file, bounds);\n\t BitmapFactory.Options opts = new BitmapFactory.Options();\n\t Bitmap bm = BitmapFactory.decodeFile(file, opts);\n\t CameraPreview cp = (CameraPreview) findViewById(R.id.camera_preview);\n\t bm = Bitmap.createScaledBitmap(bm, cp.getWidth(), cp.getHeight(), true);\n\t // Read EXIF Data\n\t ExifInterface exif;\n\t\ttry {\n\t\t\texif = new ExifInterface(file);\n\t\t String orientString = exif.getAttribute(ExifInterface.TAG_ORIENTATION);\n\t\t int orientation = orientString != null ? Integer.parseInt(orientString) : ExifInterface.ORIENTATION_NORMAL;\n\t\t int rotationAngle = 0;\n\t\t if (orientation == ExifInterface.ORIENTATION_ROTATE_90) rotationAngle = 90;\n\t\t if (orientation == ExifInterface.ORIENTATION_ROTATE_180) rotationAngle = 180;\n\t\t if (orientation == ExifInterface.ORIENTATION_ROTATE_270) rotationAngle = 270;\n\t\t // Rotate Bitmap\n\t\t Matrix matrix = new Matrix();\n\t\t matrix.setRotate(rotationAngle, (float) bm.getWidth() / 2, (float) bm.getHeight() / 2);\n\t\t Bitmap rotatedBitmap = Bitmap.createBitmap(bm, 0, 0, cp.getWidth(), cp.getHeight(), matrix, true);\n\t\t // Return result\n\t\t return rotatedBitmap;\n\t\t} catch (IOException 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}", "private double[][] csvData2Matrix() throws IOException {\n\n\t\tString fullPath = defineAbsoluteFilePath();\n\n\t\treturn csvData2Matrix(fullPath);\n\n\t}", "private Bitmap rotateImage(final String path) {\n\n Bitmap b = decodeFileFromPath(path);\n\n try {\n ExifInterface ei = new ExifInterface(path);\n int orientation = ei.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);\n Matrix matrix = new Matrix();\n switch (orientation) {\n case ExifInterface.ORIENTATION_ROTATE_90:\n matrix.postRotate(90);\n b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);\n\n break;\n case ExifInterface.ORIENTATION_ROTATE_180:\n matrix.postRotate(180);\n b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);\n break;\n case ExifInterface.ORIENTATION_ROTATE_270:\n matrix.postRotate(270);\n b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);\n break;\n default:\n b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);\n //b.copyPixelsFromBuffer(ByteBuffer.)\n break;\n }\n } catch (Throwable e) {\n e.printStackTrace();\n }\n return b;\n }", "public Rotation(){\n\t\timageData = new int[][] {{1,2,3,4}, {5,6,7,8},{9, 10, 11, 12},{13, 14, 15 ,16}};\n\t\tn = 4;\n\t}", "public Bitmap decodeFile(Bitmap bitmap) {\n\t\tint orientation;\n\t\ttry {\n\t\t\torientation = ExifInterface.ORIENTATION_ROTATE_90;\n\t\t\tLog.e(\"orientation\", \"\" + orientation);\n\t\t\tMatrix m = new Matrix();\n\t\t\tif (orientation == ExifInterface.ORIENTATION_ROTATE_90) {\n\t\t\t\tm.postRotate(90);\n\t\t\t\tLog.e(\"in orientation\", \"\" + orientation);\n\t\t\t\tbitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(),\n\t\t\t\t\t\tbitmap.getHeight(), m, true);\n\t\t\t\treturn bitmap;\n\t\t\t} else if ((orientation == ExifInterface.ORIENTATION_ROTATE_180)) {\n\t\t\t\tm.postRotate(180);\n\t\t\t\tLog.e(\"in orientation\", \"\" + orientation);\n\t\t\t\tbitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(),\n\t\t\t\t\t\tbitmap.getHeight(), m, true);\n\t\t\t\treturn bitmap;\n\t\t\t} else if (orientation == ExifInterface.ORIENTATION_ROTATE_270) {\n\t\t\t\tm.postRotate(270);\n\t\t\t\tLog.e(\"in orientation\", \"\" + orientation);\n\t\t\t\tbitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(),\n\t\t\t\t\t\tbitmap.getHeight(), m, true);\n\t\t\t\treturn bitmap;\n\t\t\t}\n\t\t\treturn bitmap;\n\t\t} catch (Exception e) {\n\t\t\treturn null;\n\t\t}\n\t}", "public int getOrientation()\n {\n return m_orientation;\n }", "public TextRotation getRotationRelativity();", "public static int getOrientation(File in) throws IOException {\r\n\r\n\t\tint orientation = 1;\r\n\r\n\t\tMetadata metadata;\r\n\r\n\t\tDirectory directory;\r\n\r\n\t\ttry {\r\n\r\n\t\t\tmetadata = ImageMetadataReader.readMetadata(in);\r\n\r\n\t\t\tdirectory = metadata.getFirstDirectoryOfType(ExifIFD0Directory.class);\r\n\r\n\t\t\t\r\n\r\n\t\t\tif(directory != null){\r\n\r\n\t\t\t\torientation = directory.getInt(ExifIFD0Directory.TAG_ORIENTATION);\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (ImageProcessingException e) {\r\n\r\n\t\t\t//System.err.println(\"[ImgUtil] could not process image\");\r\n\r\n\t\t\t//e.printStackTrace();\r\n\r\n\t\t} catch (MetadataException e) {\r\n\r\n\t\t\t//System.err.println(\"[ImgUtil] could not get orientation from image\");\r\n\r\n\t\t\t//e.printStackTrace();\r\n\r\n\t\t}\r\n\r\n\t\t\r\n\r\n\t\treturn getDegreeForOrientation(orientation);\r\n\r\n\t}", "public void rotate() {\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\ttmp_grid[i][j] = squares[i][j];\n\t\t\t// copy back rotated 90 degrees\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\tsquares[j][i] = tmp_grid[i][3-j];\n \n //log rotation\n LogEvent(\"rotate\");\n\t\t}", "public static int [] readMatrix(){\n int[] matrix=null;\n try {\n String linea;\n if((linea = br.readLine()) != null){\n String[] split = linea.split(\",\");\n matrix = new int[split.length];\n for (int i = 0; i < matrix.length; i++) {\n matrix[i] = Integer.parseInt(split[i]);\n }\n }else{\n br.close();\n }\n } catch (IOException ex) {\n System.err.println(\"Error al leer del buffer\");\n }\n return matrix;\n }", "public float getOrientation() {\n return this.orientation + this.baseRotation;\n }", "public float getTargetRotation ()\n {\n return _targetRotation;\n }" ]
[ "0.70386183", "0.6855661", "0.64768124", "0.6414966", "0.62423855", "0.62044686", "0.618571", "0.6173442", "0.6159509", "0.60352415", "0.60268474", "0.6003769", "0.5975681", "0.5954922", "0.59498036", "0.59245247", "0.592292", "0.5914075", "0.590865", "0.58580726", "0.5851055", "0.5839519", "0.57971257", "0.5789776", "0.57665193", "0.57395124", "0.5737615", "0.5727488", "0.5712582", "0.56960607", "0.56722766", "0.56487435", "0.56251115", "0.55938333", "0.55917907", "0.5564358", "0.5561674", "0.5559216", "0.55241364", "0.5497435", "0.54901445", "0.5472954", "0.5469941", "0.5463941", "0.5461847", "0.5454738", "0.5447348", "0.5445641", "0.5439461", "0.5427794", "0.5414366", "0.5397914", "0.53660065", "0.53479344", "0.5347792", "0.5333292", "0.5313747", "0.53088546", "0.5307245", "0.52966547", "0.5294112", "0.5286677", "0.52795166", "0.5271961", "0.5259359", "0.5258482", "0.5251616", "0.52487874", "0.5248181", "0.5241006", "0.52329373", "0.52250016", "0.5215652", "0.52151066", "0.5209853", "0.5207378", "0.5202957", "0.5198204", "0.5197433", "0.5196282", "0.51926917", "0.5189235", "0.5174657", "0.5167254", "0.51664674", "0.5160859", "0.5159635", "0.5156527", "0.51550674", "0.5153847", "0.5147826", "0.5147442", "0.51471543", "0.5128197", "0.5124857", "0.5115343", "0.51145256", "0.5113141", "0.51084375", "0.510154" ]
0.5515337
39
Read the rotation matrix:
public String readSessionInformation(BufferedReader reader, String textLineIn) { String textLine = textLineIn; if (textLine==null) { return "Reading rotation matrix line."; } textLine = textLine.trim(); String[] ss = textLine.split("[ ]+",10); if (ss.length<9) { return "Not enough values on rotation matrix line."; } try { int k = -1; for (int i=0 ; i<3 ; i++) { for (int j=0 ; j<3 ; j++) { k++; d[i][j] = Double.parseDouble(ss[k].trim()); // converts to Double } } } catch (NumberFormatException e) { return "Parsing rotation matrix elements."; } // Return successfully: return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "DMatrix3C getRotation();", "void calculateRotationMatrix() {\n R[0][0] = (float) (Math.cos(angle[0]) * Math.cos(angle[1]));\n R[1][0] = (float) (Math.sin(angle[0]) * Math.cos(angle[1]));\n R[0][1] = (float) (Math.cos(angle[0]) * Math.sin(angle[1]) * Math.sin(angle[2]) - Math.sin(angle[0]) * Math.cos(angle[2]));\n R[1][1] = (float) (Math.sin(angle[0]) * Math.sin(angle[1]) * Math.sin(angle[2]) + Math.cos(angle[0]) * Math.cos(angle[2]));\n R[0][2] = (float) (Math.cos(angle[0]) * Math.sin(angle[1]) * Math.cos(angle[2]) + Math.sin(angle[0]) * Math.sin(angle[2]));\n R[1][2] = (float) (Math.sin(angle[0]) * Math.sin(angle[1]) * Math.cos(angle[2]) - Math.cos(angle[0]) * Math.sin(angle[2]));\n R[2][0] = (float) - Math.sin(angle[1]);\n R[2][1] = (float) (Math.cos(angle[1]) * Math.sin(angle[2]));\n R[2][2] = (float) (Math.cos(angle[1]) * Math.cos(angle[2]));\n }", "public double getRotation();", "public Matrix getCurrentRotation() throws ManipulatorException;", "void setRotation (DMatrix3C R);", "void copyRotation(DMatrix3 R);", "LocalMaterialData rotate();", "public byte getSystem_rotation() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readByte(__io__address + 5);\n\t\t} else {\n\t\t\treturn __io__block.readByte(__io__address + 5);\n\t\t}\n\t}", "public static native long GetRotation(long lpjFbxDualQuaternion);", "public mat4 getRotation() {\n return worldMatrix.getRotation(pr, yr, pr);\n }", "public int getRotation() {\n\t\treturn config & 0x3;\n\t}", "@Override\n public float[] getRotationMatrix(){\n float[] baseCorrection = Maths.buildRotationMatrix(new float[]{0, 1, 0, 0});\n\n float[] rotationX = {(float) Math.toDegrees(theta), 1, 0, 0};\n float[] rotationY = {(float) -Math.toDegrees(phi), 0, 1, 0};\n\n float[] rotationMatrix = new float[16];\n float[] coreMotionMatrix = Maths.buildRotationMatrix(rotationY, rotationX);\n Matrix.multiplyMM(rotationMatrix, 0, baseCorrection, 0, coreMotionMatrix, 0);\n\n return rotationMatrix;\n }", "public int getCameraSensorRotation();", "DMatrix3C getOffsetRotation();", "public int getRotation() {\r\n\t\treturn rotation;\r\n\t}", "private Rotor readRotor() {\n try {\n String currCycle = _config.next();\n String permutation = \"\";\n while (currCycle.contains(\"(\")) {\n if (!currCycle.contains(\")\") || currCycle.contains(\"*\")) {\n throw error(\"Wrong cycle format\");\n }\n if (_config.hasNext()) {\n permutation = permutation + currCycle;\n currCycle = _config.next();\n } else if (!_config.hasNext()) {\n permutation = permutation + currCycle;\n break;\n }\n }\n String tempname = _name.toUpperCase();\n if (_config.hasNext()) {\n _name = currCycle;\n }\n if (notches.charAt(0) == 'M') {\n return new MovingRotor(tempname,\n new Permutation(permutation, _alphabet),\n notches.substring(1));\n } else if (notches.charAt(0) == 'N') {\n return new FixedRotor(tempname,\n new Permutation(permutation, _alphabet));\n } else {\n return new Reflector(tempname,\n new Permutation(permutation, _alphabet));\n }\n } catch (NoSuchElementException excp) {\n throw error(\"bad rotor description\");\n }\n }", "public int getRotation() {\n\treturn rotation;\n\t//return rotation;\n}", "void copyOffsetRotation (DMatrix3 R);", "@Test\n public void testGetRotationMatrix() {\n \n AxisRotation rotation = new AxisRotation(0, 0, 1, 54);\n Mat3D rotationMatrix1 = rotation.getRotationMatrix();\n \n AxisRotation rotation2 = new AxisRotation(0, 0, 1, 324);\n Mat3D rotationMatrix2 = rotation2.getRotationMatrix();\n \n System.out.println(\"test\");\n }", "private static int readExifRotation(InputStream is) {\n\n int orientation = 0;\n\n try {\n Metadata metadata = ImageMetadataReader.readMetadata(is);\n orientation = convertExifRotationToDegrees(readRawExifRotation(metadata));\n } catch (ImageProcessingException | IOException e) {\n e.printStackTrace();\n }\n\n return orientation;\n }", "public int getDeviceRotation();", "public float getRotation()\n {\n return rotation;\n }", "public static double rotation()\r\n\t{\r\n\t\treturn -(mxp.getAngle()/45);\r\n\t}", "public float getRotation() {\n return this.rotation;\n }", "int getSensorRotationDegrees();", "public int getRotations();", "public void testRotationMatrix() {\n\n u = 1;\n RotationMatrix rM = new RotationMatrix(a, b, c, u, v, w, theta);\n // This should be the identity matrix\n double[][] m = rM.getMatrix();\n for(int i=0; i<m.length; i++) {\n for(int j=0; j<m.length; j++) {\n if(j==i) {\n assertEquals(m[i][j], 1, TOLERANCE);\n } else {\n assertEquals(m[i][j], 0, TOLERANCE);\n }\n }\n }\n }", "public double getRotation() {\n return getDouble(\"ts\");\n }", "public float getRotation() {\n\t\treturn rotation;\n\t}", "@Override\n\tpublic void readImpl()\n\t{\n\t\t_degree = readD();\n\t\t_side = readD();\n\t}", "public void rotateTransform(Vector3f rot) {\r\n\t\tMatrix4f rx = new Matrix4f();\r\n\t\tMatrix4f ry = new Matrix4f();\r\n\t\tMatrix4f rz = new Matrix4f();\r\n\t\t\t\t\r\n\t\t// Convert the angles to radians\r\n\t\tfloat x = (float) Math.toRadians(rot.x);\r\n\t\tfloat y = (float) Math.toRadians(rot.y);\r\n\t\tfloat z = (float) Math.toRadians(rot.z);\r\n\r\n\t\t// Create the X-Rotation matrix\r\n\t\trx.m[0][0] = 1.0f; rx.m[0][1] = 0.0f;\t \t\t\t rx.m[0][2] = 0.0f; \t\t\t\trx.m[0][3] = 0.0f;\r\n\t rx.m[1][0] = 0.0f; rx.m[1][1] = (float) Math.cos(x); rx.m[1][2] = (float) -Math.sin(x); rx.m[1][3] = 0.0f;\r\n\t rx.m[2][0] = 0.0f; rx.m[2][1] = (float) Math.sin(x); rx.m[2][2] = (float) Math.cos(x) ; rx.m[2][3] = 0.0f;\r\n\t rx.m[3][0] = 0.0f; rx.m[3][1] = 0.0f; \t\t\t\t rx.m[3][2] = 0.0f;\t\t \t\t\trx.m[3][3] = 1.0f;\r\n\r\n\t // Create the Y-Rotation matrix\r\n\t ry.m[0][0] = (float) Math.cos(y); ry.m[0][1] = 0.0f; ry.m[0][2] = (float) -Math.sin(y); ry.m[0][3] = 0.0f;\r\n\t ry.m[1][0] = 0.0f; \t\t\t\t ry.m[1][1] = 1.0f; ry.m[1][2] = 0.0f; \t\t\t\try.m[1][3] = 0.0f;\r\n\t ry.m[2][0] = (float) Math.sin(y); ry.m[2][1] = 0.0f; ry.m[2][2] = (float) Math.cos(y) ; ry.m[2][3] = 0.0f;\r\n\t ry.m[3][0] = 0.0f; \t\t\t\t ry.m[3][1] = 0.0f; ry.m[3][2] = 0.0f; \t\t\t\try.m[3][3] = 1.0f;\r\n\r\n\t // Create the Z-Rotation matrix\r\n\t rz.m[0][0] = (float) Math.cos(z); rz.m[0][1] = (float) -Math.sin(z); rz.m[0][2] = 0.0f; rz.m[0][3] = 0.0f;\r\n\t rz.m[1][0] = (float) Math.sin(z); rz.m[1][1] = (float) Math.cos(z) ; rz.m[1][2] = 0.0f; rz.m[1][3] = 0.0f;\r\n\t rz.m[2][0] = 0.0f; \t\t\t\t rz.m[2][1] = 0.0f; \t\t\t\t rz.m[2][2] = 1.0f; rz.m[2][3] = 0.0f;\r\n\t rz.m[3][0] = 0.0f; \t\t\t\t rz.m[3][1] = 0.0f; \t\t\t\t rz.m[3][2] = 0.0f; rz.m[3][3] = 1.0f;\r\n\t\t\t\r\n\t // Multiply all the matrices together\r\n\t\tMatrix4f rzy = rz.mult(ry);\r\n\t\tMatrix4f r = rzy.mult(rx);\r\n\t\t\t \r\n\t\tm = r.m;\r\n\r\n\t}", "int getRotationDegrees() {\n return rotationDegrees;\n }", "@Test\n public void testParseMatrix() {\n String path1 = \"c:\\\\Voici\\\\input.txt\";\n MatrixReader reader = new MatrixReader(path1);\n Matrix data = reader.getMatrix();\n Matrix[] parsedMatrix = MatrixReader.parseMatrix(data, 10);\n assertEquals(parsedMatrix[0].get(4, 2), data.get(4, 2), 0.001);\n assertEquals(parsedMatrix[2].get(0, 0), data.get(32, 0), 0.001);\n assertEquals(parsedMatrix[1].get(0, 0), data.get(16, 0), 0.001);\n }", "public float getRotation() {\n return pm.pen.getLevelValue(PLevel.Type.ROTATION);\n }", "public double getRotation()\n\t{\n\t\tdouble determinant = this.basisDeterminant();\n\t\tTransform2D m = orthonormalized();\n\t\tif (determinant < 0) \n\t\t{\n\t\t\tm.scaleBasis(new Vector2(1, -1)); // convention to separate rotation and reflection for 2D is to absorb a flip along y into scaling.\n\t\t}\n\t\treturn Math.atan2(m.matrix[0].y, m.matrix[0].x);\n\t}", "@Test\n public void testGetMatrix() {\n String path1 = \"c:\\\\Voici\\\\input.txt\";\n MatrixReader reader = new MatrixReader(path1);\n assertEquals(reader.getMatrix().get(0, 0), -10.615, 0.001);\n assertEquals(reader.getMatrix().get(9, 1), 10.148, 0.001);\n }", "public final Vector3f[] getInvRot() {\n/* 154 */ Vector3f[] result = new Vector3f[3];\n/* 155 */ result[0] = new Vector3f(this.M.mf[0], this.M.mf[1], this.M.mf[2]);\n/* 156 */ result[1] = new Vector3f(this.M.mf[4], this.M.mf[5], this.M.mf[6]);\n/* 157 */ result[2] = new Vector3f(this.M.mf[8], this.M.mf[9], this.M.mf[10]);\n/* 158 */ return result;\n/* */ }", "public static int readExifRotation(File file) {\n\n int orientation = 0;\n\n try {\n Metadata metadata = ImageMetadataReader.readMetadata(file);\n orientation = convertExifRotationToDegrees(readRawExifRotation(metadata));\n } catch (ImageProcessingException | IOException e) {\n e.printStackTrace();\n }\n\n return orientation;\n }", "@Override\n public String readSessionInformation(BufferedReader reader, boolean merge) {\n String textLine = FileUtils.readLine(reader);\n if (textLine==null) { return \"Reading rotation matrix line.\"; }\n return readSessionInformation(reader,textLine);\n }", "public Vector3f getRotationVec(int xform) {\n\t\treturn m_xforms[xform].m_rotate;\n\t}", "private int getOrientation(int rotation) {\n // Sensor orientation is 90 for most devices, or 270 for some devices (eg. Nexus 5X)\n // We have to take that into account and rotate JPEG properly.\n // For devices with orientation of 90, we simply return our mapping from ORIENTATIONS.\n // For devices with orientation of 270, we need to rotate the JPEG 180 degrees.\n return (ORIENTATIONS.get(rotation) + mSensorOrientation + 270) % 360;\n }", "private int getOrientation(int rotation) {\n // Sensor orientation is 90 for most devices, or 270 for some devices (eg. Nexus 5X)\n // We have to take that into account and rotate JPEG properly.\n // For devices with orientation of 90, we simply return our mapping from ORIENTATIONS.\n // For devices with orientation of 270, we need to rotate the JPEG 180 degrees.\n if (isFrontFacing && INVERSE_ORIENTATIONS.get(rotation) == 180) {\n return (ORIENTATIONS.get(rotation) + mSensorOrientation + 90) % 360;\n } else {\n return (ORIENTATIONS.get(rotation) + mSensorOrientation + 270) % 360;\n }\n\n }", "Vec3[] getInvRot()\n {\n Vec3[] pvRot = new Vec3[3];\n pvRot[0] = m.<Vec4>getColumn(0).getXYZ();\n pvRot[1] = m.<Vec4>getColumn(1).getXYZ();\n pvRot[2] = m.<Vec4>getColumn(2).getXYZ();\n return pvRot;\n }", "public float getSavedRotation() {\n return pm.pen.getLevelValue(PLevel.Type.ROTATION);\n }", "public abstract double getOrientation();", "public Vector3f getRotationVec() {\n\t\treturn m_xforms[NvCameraXformType.MAIN].m_rotate;\n\t}", "private void determineOrientation(float[] rotationMatrix) {\n\t\t\t float[] orientationValues = new float[3];\n\t\t SensorManager.getOrientation(rotationMatrix, orientationValues);\n\t\t double azimuth = Math.toDegrees(orientationValues[0]);\n\t\t double pitch = Math.toDegrees(orientationValues[1]);\n\t\t double roll = Math.toDegrees(orientationValues[2]);\n\t\t if (pitch <= 10)\n\t\t { \n\t\t if (Math.abs(roll) >= 170)\n\t\t {\n\t\t onFaceDown();\n\t\t }\n\t\t else if (Math.abs(roll) <= 10)\n\t\t {\n\t\t onFaceUp();\n\t\t }\n\t\t }\n\t\t\t\n\t\t}", "static PMatrix3D getRotMatrixForRodrigues(PVector rodrigues ) {\n PMatrix3D R =new PMatrix3D();\n float theta=rodrigues.mag();\n if (theta<0.0001)return R;\n PVector normalized=PVector.mult(rodrigues, 1.0f/theta);\n\n\n float x = normalized.x;\n float y = normalized.y;\n float z = normalized.z;\n\n float c = (float)Math.cos( theta );\n float s = (float)Math.sin( theta );\n float oc = 1.0f - c;\n\n R.m00 = c + x * x * oc;\n R.m01 = x * y * oc - z * s;\n R.m02 = x * z * oc + y * s;\n\n R.m10 = y * x * oc + z * s;\n R.m11 = c + y * y * oc;\n R.m12 = y * z * oc - x * s;\n\n R.m20 = z * x * oc - y * s;\n R.m21 = z * y * oc + x * s;\n R.m22 = c + z * z * oc;\n\n return R;\n }", "public void rotate() {\n // amoeba rotate\n // Here i will use my rotation_x and rotation_y\n }", "public boolean hasRotate() { return hasRotate; }", "@Override\n\tpublic Rotation3 GetRotation() {\n\t\treturn new Rotation3(0f);\n\t}", "public double getRot() {\n return this.rot;\n }", "public static byte[][] rotate(byte[][] toRotate, byte direction){\n byte[][] newMatrix = {{-1, -1, -1},{-1, -1, -1},{-1, -1, -1}};\n //iterating throug each element of the matrix and placing them to the right spot\n //only works for 3x3 matrixes\n for(byte y = 0; y < 3; y ++){\n for(byte x = 0; x < 3; x ++){\n if(direction == 1){\n newMatrix[x][2-y] = toRotate[y][x];\n }\n else{\n newMatrix[2-x][y] = toRotate[y][x];\n }\n \n }\n }\n return newMatrix;\n }", "public int getMediaRecorderRotation() {\n return this.mMediaRemcoderRotation;\n }", "@Override\n\tprotected void readImpl()\n\t{\n\t\t_x = readD();\n\t\t_y = readD();\n\t\t_z = readD();\n\t\t_heading = readD();\n\t}", "void rotate();", "public IOrientation getOrientation();", "void setOffsetRotation(DMatrix3C R);", "@Override\n\tpublic Mat GetRomateMatrix()\n\t{\n\t\treturn mR;\n\t}", "public Matrix3f getPhysicsRotationMatrix(Matrix3f rotation) {\n if (rotation == null) {\n rotation = new Matrix3f();\n }\n rBody.getCenterOfMassTransform(tempTrans);\n return Converter.convert(tempTrans.basis, rotation);\n }", "@Override\n\tpublic Vec3 getRotationData(IBlockState state) {\n\t\treturn null;\n\t}", "public int getRotationState() {\n return this.rotationState;\n }", "public double[][] convert_img_mat()\n\t{\n\t\tif(orderflag)\n\t\t{\n\t\t\tputpixel_1();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//rotate the image and get the pixels as usual form\t\n \t\tputpixel_2();\n\t\t}\n\treturn matrix;\n\t}", "public float getRawRotationAngle() {\n return this.mRawRotationAngle;\n }", "public double getRotation1() {\n return rotation1;\n }", "default void get(FrameCommonMatrix3DBasics rotationMatrixToPack)\n {\n rotationMatrixToPack.setReferenceFrame(getReferenceFrame());\n get((CommonMatrix3DBasics) rotationMatrixToPack);\n }", "public static float getRawImageRotation (String rawImageFilePath)\r\n throws IOException\r\n {\r\n float angle = 0;\r\n ExifInterface exifReader;\r\n exifReader = new ExifInterface(rawImageFilePath);\r\n\r\n int orientation =\r\n exifReader.getAttributeInt(ExifInterface.TAG_ORIENTATION, -1);\r\n\r\n switch (orientation)\r\n {\r\n case ExifInterface.ORIENTATION_NORMAL:\r\n case ExifInterface.ORIENTATION_FLIP_HORIZONTAL:\r\n angle = 0;\r\n break;\r\n case ExifInterface.ORIENTATION_ROTATE_180:\r\n case ExifInterface.ORIENTATION_FLIP_VERTICAL:\r\n angle = 180;\r\n break;\r\n case ExifInterface.ORIENTATION_TRANSPOSE:\r\n case ExifInterface.ORIENTATION_ROTATE_90:\r\n angle = 90;\r\n break;\r\n case ExifInterface.ORIENTATION_TRANSVERSE:\r\n case ExifInterface.ORIENTATION_ROTATE_270:\r\n angle = 270;\r\n default:\r\n break;\r\n }\r\n return angle;\r\n }", "public void loadMatrixIO() {\n qMatrixFile = new FileIO(\"qMatrix.txt\");\n sMatrixFile = new FileIO(\"sMatrix.txt\");\n\n }", "public double getRotationAngle() {\n\t\treturn _rotationAngle;\n\t}", "private static int getMetadataBasedOnRotation(int rotation) {\n\t\t if (rotation >= 315 || rotation < 45) {\n\t\t\t return 1;\n\t\t } \n\t\t \n\t\t else if (rotation >= 45 && rotation < 135) {\n\t\t\t return 2;\n\t\t } \n\t\t \n\t\t else if (rotation >= 135 && rotation < 225) {\n\t\t\t return 0;\n\t\t } \n\t\t \n\t\t else {\n\t\t\t return 3;\n\t\t }\n\t }", "public float getBaseRotation() {\n return this.baseRotation;\n }", "public void rotate(double deg) {\n deg = deg % 360;\n// System.out.println(\"Stopni:\" + deg);\n double e = 0;\n double f = 0;\n\n// for(int i = 0; i < pixels.length; i++) {\n// for(int j = 0; j < pixels[i].length; j++) {\n// e += pixels[i][j].getX();\n// f += pixels[i][j].getY();\n// }\n// }\n //e = e / (pixels.length * 2);\n //f = f / (pixels[0].length * 2);\n e = pixels.length / 2;\n f = pixels[0].length / 2;\n System.out.println(e);\n System.out.println(f);\n\n// System.out.println(e + \":\" + f);\n Matrix affineTransform;\n Matrix translateMinus = Matrix.translateRotate(-e, -f);\n Matrix translatePlus = Matrix.translateRotate(e, f);\n Matrix movedTransform = Matrix.multiply(translateMinus, Matrix.rotate(deg));\n //movedTransform.display();\n affineTransform = Matrix.multiply(movedTransform, translatePlus);\n //affineTransform.display();\n\n for(int i = 0; i < pixels.length; i++) {\n for(int j = 0; j < pixels[i].length; j++) {\n double[][] posMatrix1 = {{pixels[i][j].getX()}, {pixels[i][j].getY()}, {1}};\n Matrix m1 = new Matrix(posMatrix1);\n Matrix result1;\n result1 = Matrix.multiply(Matrix.transpose(affineTransform.v), m1);\n\n pixels[i][j].setX(Math.round(result1.v[0][0]));\n pixels[i][j].setY(Math.round(result1.v[1][0]));\n }\n }\n\n\n }", "public double getRotationAngleInRadians() {\n return Math.toRadians(rotationAngle);\n }", "public void readMatriz(String message)\n {\n //definir dados\n int i;\n int j;\n int lin;\n int col;\n String linha;\n\n //obter dimensoes\n lin = lines();\n col = columns();\n\n //verificar se dimensoes sao validas\n if( lin <= 0 || col <= 0 )\n {\n IO.println(\"ERRO: Tamanho invalido. \" );\n } //end\n else\n {\n //mostrar mensagem antes de ler dados\n IO.println(message);\n\n //obter tamanho da matriz\n lin = this.lines();\n col = this.columns();\n\n //repetir para cada posicao da matriz\n for(i = 0; i < lin; i++)\n {\n for(j = 0; j < col; j++)\n {\n //ler linha do teclado\n linha = IO.readln();\n\n //armazenar em uma posicao da matriz\n //com objeto em String\n table[i][j] = linha;\n } //end repetir\n } //end repetir\n } //end se\n }", "private double getRotationMomentum()\n\t{\n\t\treturn getRotation() * this.currentMomentMass;\n\t}", "private void RLRotation(IAVLNode node)\r\n\t{\r\n\t\tLLRotation(node.getRight());\r\n\t\tRRRotation(node);\r\n\t}", "public void setRotation(double angle)\n\t{\n\t\tdouble cos = Math.cos(angle);\n\t\tdouble sin = Math.sin(angle);\n\t\tmatrix[0].x=cos;\n\t\tmatrix[0].y=sin;\n\t\tmatrix[1].x=-sin;\n\t\tmatrix[1].y=cos;\n\t}", "public static Matrix read(BufferedReader input) throws java.io.IOException, JPARSECException {\n StreamTokenizer tokenizer= new StreamTokenizer(input);\n\n // Although StreamTokenizer will parse numbers, it doesn't recognize\n // scientific notation (E or D); however, Double.valueOf does.\n // The strategy here is to disable StreamTokenizer's number parsing.\n // We'll only get whitespace delimited words, EOL's and EOF's.\n // These words should all be numbers, for Double.valueOf to parse.\n\n tokenizer.resetSyntax();\n tokenizer.wordChars(0,255);\n tokenizer.whitespaceChars(0, ' ');\n tokenizer.eolIsSignificant(true);\n java.util.Vector v = new java.util.Vector();\n\n // Ignore initial empty lines\n while (tokenizer.nextToken() == StreamTokenizer.TT_EOL);\n if (tokenizer.ttype == StreamTokenizer.TT_EOF)\n throw new java.io.IOException(\"Unexpected EOF on matrix read.\");\n do {\n v.addElement(Double.valueOf(tokenizer.sval)); // Read & store 1st row.\n } while (tokenizer.nextToken() == StreamTokenizer.TT_WORD);\n\n int n = v.size(); // Now we've got the number of columns!\n double row[] = new double[n];\n for (int j=0; j<n; j++) // extract the elements of the 1st row.\n row[j]=((Double)v.elementAt(j)).doubleValue();\n v.removeAllElements();\n v.addElement(row); // Start storing rows instead of columns.\n while (tokenizer.nextToken() == StreamTokenizer.TT_WORD) {\n // While non-empty lines\n v.addElement(row = new double[n]);\n int j = 0;\n do {\n if (j >= n) throw new java.io.IOException\n (\"Row \" + v.size() + \" is too long.\");\n row[j++] = Double.valueOf(tokenizer.sval).doubleValue();\n } while (tokenizer.nextToken() == StreamTokenizer.TT_WORD);\n if (j < n) throw new java.io.IOException\n (\"Row \" + v.size() + \" is too short.\");\n }\n int m = v.size(); // Now we've got the number of rows.\n double[][] A = new double[m][];\n v.copyInto(A); // copy the rows out of the vector\n return new Matrix(A);\n }", "public int getOrientation(){ return mOrientation; }", "public static Matrix getR3(double angle)\n\t{\n\t\tMatrix m = new Matrix(3, 3);\n\t\tm.data[0] = new double[] {Math.cos(angle), Math.sin(angle), 0.0};\n\t\tm.data[1] = new double[] {-Math.sin(angle), Math.cos(angle), 0.0};\n\t\tm.data[2] = new double[] {0.0, 0.0, 1.0};\n\t\treturn m;\n\t}", "private Bitmap rotateBitmapOrientation(String photoFilePath) {\n BitmapFactory.Options bounds = new BitmapFactory.Options();\n bounds.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(photoFilePath, bounds);\n BitmapFactory.Options opts = new BitmapFactory.Options();\n Bitmap bm = BitmapFactory.decodeFile(photoFilePath, opts);\n // Read EXIF Data\n ExifInterface exif = null;\n try {\n exif = new ExifInterface(photoFilePath);\n } catch (IOException e) {\n e.printStackTrace();\n }\n String orientString = exif.getAttribute(ExifInterface.TAG_ORIENTATION);\n int orientation = orientString != null ? Integer.parseInt(orientString) : ExifInterface.ORIENTATION_NORMAL;\n int rotationAngle = 0;\n if (orientation == ExifInterface.ORIENTATION_ROTATE_90) rotationAngle = 90;\n if (orientation == ExifInterface.ORIENTATION_ROTATE_180) rotationAngle = 180;\n if (orientation == ExifInterface.ORIENTATION_ROTATE_270) rotationAngle = 270;\n // Rotate Bitmap\n Matrix matrix = new Matrix();\n matrix.setRotate(rotationAngle, (float) bm.getWidth() / 2, (float) bm.getHeight() / 2);\n Bitmap rotatedBitmap = Bitmap.createBitmap(bm, 0, 0, bounds.outWidth, bounds.outHeight, matrix, true);\n // Return result\n return rotatedBitmap;\n }", "@Test\n public void testGetSetRollPitchYawAngles() throws WrongSizeException {\n UniformRandomizer randomizer = new UniformRandomizer(new Random());\n double roll = randomizer.nextDouble(2.0 * MIN_ANGLE_DEGREES, \n 2.0 * MAX_ANGLE_DEGREES) * Math.PI / 180.0;\n double pitch = randomizer.nextDouble(MIN_ANGLE_DEGREES, \n MAX_ANGLE_DEGREES) * Math.PI / 180.0;\n double yaw = randomizer.nextDouble(2.0 * MIN_ANGLE_DEGREES, \n 2.0 * MAX_ANGLE_DEGREES) * Math.PI / 180.0;\n \n MatrixRotation3D rotation = new MatrixRotation3D();\n \n //set angles\n rotation.setRollPitchYaw(roll, pitch, yaw);\n \n //retrieve angles to check correctness\n assertTrue(Math.abs(rotation.getRollAngle() - roll) < ABSOLUTE_ERROR ||\n Math.abs(rotation.getRollAngle2() - roll) < ABSOLUTE_ERROR);\n assertTrue(Math.abs(rotation.getPitchAngle() - pitch) < ABSOLUTE_ERROR ||\n Math.abs(rotation.getPitchAngle2() - roll) < ABSOLUTE_ERROR);\n assertTrue(Math.abs(rotation.getYawAngle() - yaw) < ABSOLUTE_ERROR ||\n Math.abs(rotation.getYawAngle2() - yaw) < ABSOLUTE_ERROR);\n\n //check internal matrix\n Matrix rotationMatrix = rotation.getInternalMatrix();\n \n Matrix rotationMatrix2 = new Matrix(ROTATION_ROWS, ROTATION_COLS);\n rotationMatrix2.setElementAt(0, 0, Math.cos(pitch) * Math.cos(yaw));\n rotationMatrix2.setElementAt(1, 0, Math.cos(pitch) * Math.sin(yaw));\n rotationMatrix2.setElementAt(2, 0, -Math.sin(pitch));\n \n rotationMatrix2.setElementAt(0, 1, -Math.cos(roll) * Math.sin(yaw) + \n Math.sin(roll) * Math.sin(pitch) * Math.cos(yaw));\n rotationMatrix2.setElementAt(1, 1, Math.cos(roll) * Math.cos(yaw) + \n Math.sin(roll) * Math.sin(pitch) * Math.sin(yaw));\n rotationMatrix2.setElementAt(2, 1, Math.sin(roll) * Math.cos(pitch));\n \n rotationMatrix2.setElementAt(0, 2, Math.sin(roll) * Math.sin(yaw) + \n Math.cos(roll) * Math.sin(pitch) * Math.cos(yaw));\n rotationMatrix2.setElementAt(1, 2, -Math.sin(roll) * Math.cos(yaw) +\n Math.cos(roll) * Math.sin(pitch) * Math.sin(yaw));\n rotationMatrix2.setElementAt(2, 2, Math.cos(roll) * Math.cos(pitch));\n \n //check that rotation matrices are equal (up to a certain error)\n assertTrue(rotationMatrix.equals(rotationMatrix2, ABSOLUTE_ERROR));\n }", "int getStartRotationDegree();", "public float getRotationAngle() {\n return this.mRotationAngle;\n }", "public Matrix3f getPhysicsRotationMatrix() {\n return getPhysicsRotationMatrix(null);\n }", "public static Matrix rotateZ(double rad) {\n List<List<Double>> backingArray = get2DListOfSize(4);\n /*\n |cosr -sinr 0 0|\n |sinr cosr 0 0|\n |0 0 1 0|\n |0 0 0 1|\n */\n double cos = Math.cos(rad);\n double sin = Math.sin(rad);\n\n backingArray.get(0).set(0, cos);\n backingArray.get(0).set(1, -1*sin);\n backingArray.get(1).set(0, sin);\n backingArray.get(1).set(1, cos);\n backingArray.get(2).set(2, 1d);\n backingArray.get(3).set(3, 1d);\n\n return new Matrix(backingArray);\n }", "private String[] readMaterials() throws IOException\n {\n final int materialCount = this.reader.readByte();\n final String[] materials = new String[materialCount];\n for (int i = 0; i < materialCount; i++)\n {\n materials[i] = this.reader.readString(this.reader.readByte());\n }\n return materials;\n }", "int getMinRotation();", "public Bitmap rotateBitmapOrientation(String file) {\n\t BitmapFactory.Options bounds = new BitmapFactory.Options();\n\t bounds.inJustDecodeBounds = true;\n\t BitmapFactory.decodeFile(file, bounds);\n\t BitmapFactory.Options opts = new BitmapFactory.Options();\n\t Bitmap bm = BitmapFactory.decodeFile(file, opts);\n\t CameraPreview cp = (CameraPreview) findViewById(R.id.camera_preview);\n\t bm = Bitmap.createScaledBitmap(bm, cp.getWidth(), cp.getHeight(), true);\n\t // Read EXIF Data\n\t ExifInterface exif;\n\t\ttry {\n\t\t\texif = new ExifInterface(file);\n\t\t String orientString = exif.getAttribute(ExifInterface.TAG_ORIENTATION);\n\t\t int orientation = orientString != null ? Integer.parseInt(orientString) : ExifInterface.ORIENTATION_NORMAL;\n\t\t int rotationAngle = 0;\n\t\t if (orientation == ExifInterface.ORIENTATION_ROTATE_90) rotationAngle = 90;\n\t\t if (orientation == ExifInterface.ORIENTATION_ROTATE_180) rotationAngle = 180;\n\t\t if (orientation == ExifInterface.ORIENTATION_ROTATE_270) rotationAngle = 270;\n\t\t // Rotate Bitmap\n\t\t Matrix matrix = new Matrix();\n\t\t matrix.setRotate(rotationAngle, (float) bm.getWidth() / 2, (float) bm.getHeight() / 2);\n\t\t Bitmap rotatedBitmap = Bitmap.createBitmap(bm, 0, 0, cp.getWidth(), cp.getHeight(), matrix, true);\n\t\t // Return result\n\t\t return rotatedBitmap;\n\t\t} catch (IOException 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}", "private double[][] csvData2Matrix() throws IOException {\n\n\t\tString fullPath = defineAbsoluteFilePath();\n\n\t\treturn csvData2Matrix(fullPath);\n\n\t}", "private Bitmap rotateImage(final String path) {\n\n Bitmap b = decodeFileFromPath(path);\n\n try {\n ExifInterface ei = new ExifInterface(path);\n int orientation = ei.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);\n Matrix matrix = new Matrix();\n switch (orientation) {\n case ExifInterface.ORIENTATION_ROTATE_90:\n matrix.postRotate(90);\n b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);\n\n break;\n case ExifInterface.ORIENTATION_ROTATE_180:\n matrix.postRotate(180);\n b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);\n break;\n case ExifInterface.ORIENTATION_ROTATE_270:\n matrix.postRotate(270);\n b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);\n break;\n default:\n b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);\n //b.copyPixelsFromBuffer(ByteBuffer.)\n break;\n }\n } catch (Throwable e) {\n e.printStackTrace();\n }\n return b;\n }", "public Rotation(){\n\t\timageData = new int[][] {{1,2,3,4}, {5,6,7,8},{9, 10, 11, 12},{13, 14, 15 ,16}};\n\t\tn = 4;\n\t}", "public Bitmap decodeFile(Bitmap bitmap) {\n\t\tint orientation;\n\t\ttry {\n\t\t\torientation = ExifInterface.ORIENTATION_ROTATE_90;\n\t\t\tLog.e(\"orientation\", \"\" + orientation);\n\t\t\tMatrix m = new Matrix();\n\t\t\tif (orientation == ExifInterface.ORIENTATION_ROTATE_90) {\n\t\t\t\tm.postRotate(90);\n\t\t\t\tLog.e(\"in orientation\", \"\" + orientation);\n\t\t\t\tbitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(),\n\t\t\t\t\t\tbitmap.getHeight(), m, true);\n\t\t\t\treturn bitmap;\n\t\t\t} else if ((orientation == ExifInterface.ORIENTATION_ROTATE_180)) {\n\t\t\t\tm.postRotate(180);\n\t\t\t\tLog.e(\"in orientation\", \"\" + orientation);\n\t\t\t\tbitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(),\n\t\t\t\t\t\tbitmap.getHeight(), m, true);\n\t\t\t\treturn bitmap;\n\t\t\t} else if (orientation == ExifInterface.ORIENTATION_ROTATE_270) {\n\t\t\t\tm.postRotate(270);\n\t\t\t\tLog.e(\"in orientation\", \"\" + orientation);\n\t\t\t\tbitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(),\n\t\t\t\t\t\tbitmap.getHeight(), m, true);\n\t\t\t\treturn bitmap;\n\t\t\t}\n\t\t\treturn bitmap;\n\t\t} catch (Exception e) {\n\t\t\treturn null;\n\t\t}\n\t}", "public int getOrientation()\n {\n return m_orientation;\n }", "public TextRotation getRotationRelativity();", "public static int getOrientation(File in) throws IOException {\r\n\r\n\t\tint orientation = 1;\r\n\r\n\t\tMetadata metadata;\r\n\r\n\t\tDirectory directory;\r\n\r\n\t\ttry {\r\n\r\n\t\t\tmetadata = ImageMetadataReader.readMetadata(in);\r\n\r\n\t\t\tdirectory = metadata.getFirstDirectoryOfType(ExifIFD0Directory.class);\r\n\r\n\t\t\t\r\n\r\n\t\t\tif(directory != null){\r\n\r\n\t\t\t\torientation = directory.getInt(ExifIFD0Directory.TAG_ORIENTATION);\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (ImageProcessingException e) {\r\n\r\n\t\t\t//System.err.println(\"[ImgUtil] could not process image\");\r\n\r\n\t\t\t//e.printStackTrace();\r\n\r\n\t\t} catch (MetadataException e) {\r\n\r\n\t\t\t//System.err.println(\"[ImgUtil] could not get orientation from image\");\r\n\r\n\t\t\t//e.printStackTrace();\r\n\r\n\t\t}\r\n\r\n\t\t\r\n\r\n\t\treturn getDegreeForOrientation(orientation);\r\n\r\n\t}", "public void rotate() {\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\ttmp_grid[i][j] = squares[i][j];\n\t\t\t// copy back rotated 90 degrees\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\tsquares[j][i] = tmp_grid[i][3-j];\n \n //log rotation\n LogEvent(\"rotate\");\n\t\t}", "public static int [] readMatrix(){\n int[] matrix=null;\n try {\n String linea;\n if((linea = br.readLine()) != null){\n String[] split = linea.split(\",\");\n matrix = new int[split.length];\n for (int i = 0; i < matrix.length; i++) {\n matrix[i] = Integer.parseInt(split[i]);\n }\n }else{\n br.close();\n }\n } catch (IOException ex) {\n System.err.println(\"Error al leer del buffer\");\n }\n return matrix;\n }", "public float getOrientation() {\n return this.orientation + this.baseRotation;\n }", "public float getTargetRotation ()\n {\n return _targetRotation;\n }" ]
[ "0.70386183", "0.6855661", "0.64768124", "0.6414966", "0.62423855", "0.62044686", "0.618571", "0.6173442", "0.6159509", "0.60352415", "0.6003769", "0.5975681", "0.5954922", "0.59498036", "0.59245247", "0.592292", "0.5914075", "0.590865", "0.58580726", "0.5851055", "0.5839519", "0.57971257", "0.5789776", "0.57665193", "0.57395124", "0.5737615", "0.5727488", "0.5712582", "0.56960607", "0.56722766", "0.56487435", "0.56251115", "0.55938333", "0.55917907", "0.5564358", "0.5561674", "0.5559216", "0.55241364", "0.5515337", "0.5497435", "0.54901445", "0.5472954", "0.5469941", "0.5463941", "0.5461847", "0.5454738", "0.5447348", "0.5445641", "0.5439461", "0.5427794", "0.5414366", "0.5397914", "0.53660065", "0.53479344", "0.5347792", "0.5333292", "0.5313747", "0.53088546", "0.5307245", "0.52966547", "0.5294112", "0.5286677", "0.52795166", "0.5271961", "0.5259359", "0.5258482", "0.5251616", "0.52487874", "0.5248181", "0.5241006", "0.52329373", "0.52250016", "0.5215652", "0.52151066", "0.5209853", "0.5207378", "0.5202957", "0.5198204", "0.5197433", "0.5196282", "0.51926917", "0.5189235", "0.5174657", "0.5167254", "0.51664674", "0.5160859", "0.5159635", "0.5156527", "0.51550674", "0.5153847", "0.5147826", "0.5147442", "0.51471543", "0.5128197", "0.5124857", "0.5115343", "0.51145256", "0.5113141", "0.51084375", "0.510154" ]
0.60268474
10
System.out.println(" FeatureInfo String: " + result);
public void init(String result) { resultStr.setText(result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getFeature();", "String getFeature();", "public String getInfoString();", "public String feature() {\n return feature;\n }", "public String getFeature() {\r\n return feature;\r\n }", "@Override\n public String toString() {\n return mFeatureStructures.toString();\n }", "String getInfo();", "@Override\r\n\tpublic String toString() {\n\t\treturn result;\r\n\t}", "public String getFeatVect();", "public String getInfoString() {\n/* 140 */ return this.info;\n/* */ }", "public String toString() {\r\n\t\treturn result;\r\n\t}", "public void info()\n {\n System.out.println(toString());\n }", "java.lang.String getFeatures(int index);", "@Override\n public String toString() {\n return info();\n }", "@Override\n\tpublic String toString() {\n\t\treturn fileName + \" \" + features + \" -> \" + lemma + \", \" + classification;\n\t}", "public String getInfoText();", "public String toString(){\n return \"info\";\n }", "public String getFeatureFlagString() {\n return featureFlagString;\n }", "String diagnosticsOutput();", "public synchronized String toString() {\n StringBuffer oBuffer = new StringBuffer();\n\n oBuffer\n .append(\"Preprocessing params: \").append(this.oPreprocessingParams).append(\"\\n\")\n .append(\"Feature extraction params: \").append(this.oFeatureExtractionParams).append(\"\\n\")\n .append(\"Classification params: \").append(this.oClassificationParams);\n\n return oBuffer.toString();\n }", "String getOutput();", "java.lang.String getOutput();", "@Override\n public String toString() {\n return \"Exterior : [\" + this.exteriorFeature + \"]\";\n }", "String getLayer1Info();", "public String toString() {\nString output = new String();\n\noutput = \"shortName\" + \" : \" + \"\" + shortName +\"\\n\"; \noutput += \"type\" + \" : \" + \"\" + type + \"\\n\";\noutput += \"description\" + \" : \" + \"\" + description + \"\\n\"; \n\nreturn output; \n}", "public static String getOpResult (){\n \treturn opResult;\n }", "java.lang.String getLastrunresult();", "java.util.List<iet.distributed.telemetry.Feature> \n getFeatureList();", "int getFeatureValue();", "public void disp(){\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"------------------------------------------- \");\r\n\t\t\tSystem.out.println(\"Feature Model \");\r\n\t\t\tSystem.out.println(\"------------------------------------------- \");\r\n\t\t\tSystem.out.println(\"The mandatory feature:\");\r\n\t\t\tfor(int i = 0; i < this.mandatoryFeatures.size(); i++ ){\r\n\t\t\t\tthis.mandatoryFeatures.get(i).disp();\r\n\t\t\t}//for\r\n\t\t\tSystem.out.println(\"Optional features:\");\r\n\t\t\tfor(int i = 0; i < this.optionalFeatures.size(); i++ ){\r\n\t\t\t\tthis.optionalFeatures.get(i).disp();\r\n\t\t\t}//for\r\n\t\t\tfor(int i = 0; i < this.alternativeFeatureGroup.size(); i++ ){\r\n\t\t\t\tSystem.out.println(\"Alternative features:\");\r\n\t\t\t\tfor(int j = 0; j < alternativeFeatureGroup.get(i).getFeatures().size(); j++ ){\r\n\t\t\t\t\talternativeFeatureGroup.get(i).getFeatures().get(j).disp();\r\n\t\t\t\t}//for\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < this.orFeatureGroup.size(); i++ ){\r\n\t\t\t\tSystem.out.println(\"Or features:\");\r\n\t\t\t\tfor(int j = 0; j < orFeatureGroup.get(i).getFeatures().size(); j++ ){\r\n\t\t\t\t\torFeatureGroup.get(i).getFeatures().get(j).disp();\r\n\t\t\t\t}//for\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Constraints:\");\r\n\t\t\tfor(int i = 0; i < this.constraints.size(); i++ ){\r\n\t\t\t\tthis.constraints.get(i).disp();\r\n\t\t\t}//for\r\n\t\t}", "public Integer getFeature() {\n return feature;\n }", "public String toString()\n {\n String str = \"\";\n str += \"topic: \" + label + \", at activation level \" + activation + \"\\n\";\n \n str += \"\\t\" + response1 +\"\\n\";\n str += \"\\t\" + response2 +\"\\n\";\n str += \"\\t\" + response3 +\"\\n\";\n \n return str;\n }", "@Override\n\tpublic String toString() {\n\t\treturn name+\" : \"+test;\n\t}", "private List<String> extractFeatures() {\n List<String> result = new ArrayList<String>();\n\n int startPoint = -1;\n\n List<TextPosition> featureItem;\n for (int i = 0; i < infoBlock.size(); i++) {\n // To get index of the text in the information block, if the text does not exist, the index will be -1.\n int index = CommonUtils.collectTextBuffer(infoBlock.get(i)).indexOf(FEATURE_KEY);\n if (index != -1) {\n startPoint = i + 1;\n\n // To locate the PDF object from the text feature to the end of the information block.\n featureItem = infoBlock.get(i).subList(index, index + FEATURE_KEY.length());\n\n // To extract information vertically. startPoint now is where the information block next to the\n // one that contains text feature.\n if (startPoint != -1) {\n result = filterTextBuffersVerical(featureItem, infoBlock, startPoint, 10);\n/*\t\t\t\t\t\tfor(String item: result)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(item);\n\t\t\t\t\t\t}*/\n }\n\n break;\n }\n }\n\n return result;\n }", "void gaInfo(String text);", "public void display() {\n \n //Print the features representation\n System.out.println(\"\\nDENSE REPRESENTATION\\n\");\n \n //Print the header\n System.out.print(\"ID\\t\");\n for (short i = 0 ; i < dimension; i++) {\n System.out.format(\"%s\\t\\t\", i);\n }\n System.out.println();\n \n //Print all the instances\n for (Entry<String, Integer> entry : mapOfInstances.entrySet()) {\n System.out.format(\"%s\\t\", entry.getKey());\n for (int i = 0; i < vectorDimension(); i++) {\n //System.out.println(allFeatures.get(entry.getValue())[i]);\n System.out.format(\"%f\\t\", allValues.get(entry.getValue())[i]); \n }\n System.out.println();\n }\n }", "@Override\r\n public void onResult(String result)\r\n {\n handler.sendMessage(handler.obtainMessage(SHOWTOAST, \"Firmware version = \"+result));\r\n }", "public static String getInfo() {\n/* 327 */ return \"\";\n/* */ }", "public String getInfo()\n {\n return info;\n }", "String getLayer2Info();", "public void onTestSuccess(ITestResult result) {\n\t\tSystem.out.println(result.getName()+\"**********Test Success.............This is result.getName\");\r\n\t\t\r\n\t}", "List<String> getFeatures();", "public String toString() { return kind() + \":\"+ text() ; }", "public String getResult()\n {\n return result;\n }", "public String logResult(List<EvaluatedCandidate<NAryTree>> result) {\r\n\t\tStringBuilder str = new StringBuilder();\r\n\r\n\t\tfor (EvaluatedCandidate<NAryTree> cand : result) {\r\n\t\t\tNAryTree tree = cand.getCandidate();\r\n\r\n\t\t\tString detailedFitness = \"\";\r\n\t\t\tif (centralRegistry != null && centralRegistry.isFitnessKnown(tree)) {\r\n\t\t\t\tdetailedFitness = centralRegistry.getFitness(tree).toString();\r\n\t\t\t}\r\n\r\n\t\t\t//Log the fitnessValue tree detailedFitness\r\n\t\t\tstr.append(String.format(\"f: %2.10f %s %s \\r\\n\", cand.getFitness(),\r\n\t\t\t\t\tTreeUtils.toString(tree, centralRegistry.getEventClasses()), detailedFitness));\r\n\t\t}\r\n\r\n\t\treturn str.toString();\r\n\t}", "iet.distributed.telemetry.Feature getFeature(int index);", "@Override\n\tpublic String getResult() {\n\t\treturn result;\n\t}", "public String toString() {\n return label + \"(\" + MathUtil.doubleString(value, 1) + \")\\tweight: \" + MathUtil.doubleString(weight, 2) + \"\\tFeatureVector: \" + featureVector.toString();\n }", "public String getTapOccurrenceFeatures() {\n double[] linAccMeans = getMean(linAccSample);\n double[] linAccStdDevs = getStdDev(linAccSample);\n double[] linAccSkewness = getSkewness(linAccSample);\n double[] linAccKurtosis = getKurtosis(linAccSample);\n\n double linAcc1Norm = getL1Norm(linAccMatrix);\n double linAccInfNorm = getInfNorm(linAccMatrix);\n double linAccFroNorm = getFroNorm(linAccMatrix);\n double[] linAccNorms = new double[]{linAcc1Norm, linAccInfNorm, linAccFroNorm};\n\n // 15 gyroscope features\n double[] gyroMeans = getMean(gyroSample);\n double[] gyroStdDevs = getStdDev(gyroSample);\n double[] gyroSkewness = getSkewness(gyroSample);\n double[] gyroKurtosis = getKurtosis(gyroSample);\n\n double gyro1Norm = getL1Norm(gyroMatrix);\n double gyroInfNorm = getInfNorm(gyroMatrix);\n double gyroFroNorm = getFroNorm(gyroMatrix);\n double[] gyroNorms = new double[] {gyro1Norm, gyroInfNorm, gyroFroNorm};\n\n // 9 pearson features\n double[] pearsonCoeffs = getPearsonCoeff(linAccSample, gyroSample);\n\n double[] featureArray = merge(\n linAccMeans, linAccStdDevs, linAccSkewness, linAccKurtosis, linAccNorms,\n gyroMeans, gyroStdDevs, gyroSkewness, gyroKurtosis, gyroNorms,\n pearsonCoeffs);\n\n StringBuilder featureString = new StringBuilder();\n for (int i = 0; i < featureArray.length; i++) {\n featureString.append(i+1);\n featureString.append(':');\n featureString.append(featureArray[i]);\n featureString.append(' ');\n }\n return featureString.toString();\n }", "Feature getFeature();", "Feature getFeature();", "String toSVMString();", "public String toString(){\n\n String s;\n Exemplar cur = m_Exemplars;\n int i;\t\n\n if (m_MinArray == null) {\n return \"No classifier built\";\n }\n int[] nbHypClass = new int[m_Train.numClasses()];\n int[] nbSingleClass = new int[m_Train.numClasses()];\n for(i = 0; i<nbHypClass.length; i++){\n nbHypClass[i] = 0;\n nbSingleClass[i] = 0;\n }\n int nbHyp = 0, nbSingle = 0;\n\n s = \"\\nNNGE classifier\\n\\nRules generated :\\n\";\n\n while(cur != null){\n s += \"\\tclass \" + m_Train.attribute(m_Train.classIndex()).value((int) cur.classValue()) + \" IF : \";\n s += cur.toRules() + \"\\n\";\n nbHyp++;\n nbHypClass[(int) cur.classValue()]++;\t \n if (cur.numInstances() == 1){\n\tnbSingle++;\n\tnbSingleClass[(int) cur.classValue()]++;\n }\n cur = cur.next;\n }\n s += \"\\nStat :\\n\";\n for(i = 0; i<nbHypClass.length; i++){\n s += \"\\tclass \" + m_Train.attribute(m_Train.classIndex()).value(i) + \n\t\" : \" + Integer.toString(nbHypClass[i]) + \" exemplar(s) including \" + \n\tInteger.toString(nbHypClass[i] - nbSingleClass[i]) + \" Hyperrectangle(s) and \" +\n\tInteger.toString(nbSingleClass[i]) + \" Single(s).\\n\";\n }\n s += \"\\n\\tTotal : \" + Integer.toString(nbHyp) + \" exemplars(s) including \" + \n Integer.toString(nbHyp - nbSingle) + \" Hyperrectangle(s) and \" +\n Integer.toString(nbSingle) + \" Single(s).\\n\";\n\t\n s += \"\\n\";\n\t\n s += \"\\tFeature weights : \";\n\n String space = \"[\";\n for(int ii = 0; ii < m_Train.numAttributes(); ii++){\n if(ii != m_Train.classIndex()){\n\ts += space + Double.toString(attrWeight(ii));\n\tspace = \" \";\n }\n }\n s += \"]\";\n s += \"\\n\\n\";\n return s;\n }", "void getInfo() {\n\tSystem.out.println(\"My name is \"+name+\" and I am going to \"+school+\" and my grade is \"+grade);\n\t}", "public String getResult()\r\n\t{\r\n\t\treturn result;\r\n\t}", "public static String SAVE_FEATURE(Feature f) {\n String ret = \"\";\n ret += f.name + \"\\t\" + f.type + \"\\t\";\n int i;\n\n if (Feature.IS_NOMINAL(f.type)) {\n if (f.modalities == null) ret += \"null\";\n else if (f.modalities.size() == 0) ret += \"{}\";\n else\n for (i = 0; i < f.modalities.size(); i++) {\n ret += (String) f.modalities.elementAt(i);\n if (i < f.modalities.size() - 1) ret += \"\\t\";\n }\n } else if (Feature.IS_CONTINUOUS(f.type)) {\n ret += f.dmin + \"\\t\" + f.dmax;\n if (f.dmin_from_data != f.dmax_from_data)\n ret += \"\\t\" + f.dmin_from_data + \"\\t\" + f.dmax_from_data;\n } else if (Feature.IS_INTEGER(f.type)) {\n ret += f.imin + \"\\t\" + f.imax;\n if (f.imin_from_data != f.imax_from_data)\n ret += \"\\t\" + f.imin_from_data + \"\\t\" + f.imax_from_data;\n }\n return ret;\n }", "java.util.List<java.lang.String> getFeaturesList();", "FTCommand getFeature();", "public String getResult();", "public String getResult();", "public String getResult();", "@Override\r\n\tpublic String showResult() {\n\t\treturn rps.toString();\r\n\t}", "public String getInfo() {\n return this.info;\n }", "public String toString()\r\n\t{\r\n\t final String TAB = \" \";\r\n\t \r\n\t String retValue = \"\";\r\n\t \r\n\t retValue = \"Scenario ( \"\r\n\t + super.toString() + TAB\r\n\t + \"key = \" + this.key + TAB\r\n\t + \"description = \" + this.description + TAB\r\n\t + \"response = \" + this.response + TAB\r\n\t + \"delayInMilliSec = \" + this.delayInMilliSec + TAB\r\n\t + \" )\";\r\n\t\r\n\t return retValue;\r\n\t}", "public abstract String getInfo();", "public abstract String getInfo();", "public void mo34874a(String str) {\n Class<C9780c> cls = C9780c.class;\n boolean[] a = m45645a();\n try {\n C9780c.m45630a(this.f25962b, System.currentTimeMillis(), this.f25961a);\n a[1] = true;\n InstabugSDKLogger.m46622d(cls, \"Features fetched successfully\");\n a[2] = true;\n JSONObject jSONObject = new JSONObject(str);\n a[3] = true;\n boolean optBoolean = jSONObject.optBoolean(\"crash_reporting\", true);\n a[4] = true;\n this.f25962b.mo34866a(Feature.CRASH_REPORTING, optBoolean);\n a[5] = true;\n boolean optBoolean2 = jSONObject.optBoolean(\"push_notifications\", true);\n a[6] = true;\n this.f25962b.mo34866a(Feature.PUSH_NOTIFICATION, optBoolean2);\n a[7] = true;\n boolean optBoolean3 = jSONObject.optBoolean(\"white_label\", true);\n a[8] = true;\n this.f25962b.mo34866a(Feature.WHITE_LABELING, optBoolean3);\n a[9] = true;\n boolean optBoolean4 = jSONObject.optBoolean(\"in_app_messaging\", true);\n a[10] = true;\n this.f25962b.mo34866a(Feature.IN_APP_MESSAGING, optBoolean4);\n a[11] = true;\n boolean optBoolean5 = jSONObject.optBoolean(\"multiple_attachments\", true);\n a[12] = true;\n this.f25962b.mo34866a(Feature.MULTIPLE_ATTACHMENTS, optBoolean5);\n String str2 = com.instabug.library.model.State.KEY_USER_STEPS;\n a[13] = true;\n boolean optBoolean6 = jSONObject.optBoolean(str2, true);\n a[14] = true;\n this.f25962b.mo34866a(Feature.TRACK_USER_STEPS, optBoolean6);\n a[15] = true;\n boolean optBoolean7 = jSONObject.optBoolean(\"repro_steps\", true);\n a[16] = true;\n this.f25962b.mo34866a(Feature.REPRO_STEPS, optBoolean7);\n String str3 = com.instabug.library.model.State.KEY_CONSOLE_LOG;\n a[17] = true;\n boolean optBoolean8 = jSONObject.optBoolean(str3, true);\n a[18] = true;\n this.f25962b.mo34866a(Feature.CONSOLE_LOGS, optBoolean8);\n a[19] = true;\n boolean optBoolean9 = jSONObject.optBoolean(\"ibg_log\", true);\n a[20] = true;\n this.f25962b.mo34866a(Feature.INSTABUG_LOGS, optBoolean9);\n a[21] = true;\n boolean optBoolean10 = jSONObject.optBoolean(com.instabug.library.model.State.KEY_USER_DATA, true);\n a[22] = true;\n this.f25962b.mo34866a(Feature.USER_DATA, optBoolean10);\n a[23] = true;\n boolean optBoolean11 = jSONObject.optBoolean(\"surveys\", true);\n a[24] = true;\n this.f25962b.mo34866a(Feature.SURVEYS, optBoolean11);\n String str4 = BugEntry.COLUMN_VIEW_HIERARCHY;\n a[25] = true;\n boolean optBoolean12 = jSONObject.optBoolean(str4, true);\n a[26] = true;\n this.f25962b.mo34866a(Feature.VIEW_HIERARCHY, optBoolean12);\n a[27] = true;\n boolean optBoolean13 = jSONObject.optBoolean(\"user_events\", true);\n a[28] = true;\n this.f25962b.mo34866a(Feature.USER_EVENTS, optBoolean13);\n a[29] = true;\n boolean optBoolean14 = jSONObject.optBoolean(\"disclaimer_text\", false);\n a[30] = true;\n this.f25962b.mo34866a(Feature.DISCLAIMER, optBoolean14);\n a[31] = true;\n boolean optBoolean15 = jSONObject.optBoolean(com.instabug.library.model.State.KEY_SESSIONS_PROFILER, true);\n a[32] = true;\n this.f25962b.mo34866a(Feature.SESSION_PROFILER, optBoolean15);\n a[33] = true;\n boolean optBoolean16 = jSONObject.optBoolean(\"feature_requests\", true);\n a[34] = true;\n this.f25962b.mo34866a(Feature.FEATURE_REQUESTS, optBoolean16);\n a[35] = true;\n boolean optBoolean17 = jSONObject.optBoolean(\"vp_customizations\", false);\n a[36] = true;\n this.f25962b.mo34866a(Feature.VP_CUSTOMIZATION, optBoolean17);\n a[37] = true;\n SDKCoreEventPublisher.post(new SDKCoreEvent(\"features\", Feature.VALUE_FETCHED));\n a[38] = true;\n } catch (JSONException e) {\n a[39] = true;\n InstabugSDKLogger.m46624e(cls, \"Something went wrong while parsing fetching features request's response\", e);\n a[40] = true;\n }\n a[41] = true;\n }", "private String labelFeature(int feature) {\r\n\t\treturn label[feature];\r\n\t}", "Information getInfo();", "@Override\n public String getInfo(){\n return info;\n }", "public String getResult() \n\t{\n\t\treturn strResult;\n\t}", "java.lang.String getResult();", "public String getInfo(){\n return \"Name: \" + name + \"\\n\"\n + \"Min Range: \" + minRange + \"\\n\"\n + \"Max Range: \" + maxRange + \"\\n\"\n + \"Attack: \" + attack + \"\\n\"\n + \"Cost: \" + buildCost;\n }", "public String getInfo(){\n return \" name: \" + this.name;\n }", "public void getInfo() {\n System.out.println(\"Content : \" + content);\n System.out.println(\"Name : \" + name);\n System.out.println(\"Location : (\" + locX + \",\" + locY + \")\");\n System.out.println(\"Weight : \" + String.format(\"%.5f\", weight) + \" kg/day\");\n System.out.println(\"Habitat : \" + habitat);\n System.out.println(\"Type : \" + type);\n System.out.println(\"Diet : \" + diet);\n System.out.println(\"Fodder : \" + String.format(\"%.5f\", getFodder()) + \" kg\");\n System.out.println(tamed ? \"Tame : Yes \" : \"Tame : No \");\n System.out.println(\"Number of Legs : \" + legs);\n }", "String getAdditionalInfo();", "public String getInfo() {\n return info;\n }", "public String toString(){\n return this.Tea;\n }", "public String getResult() {\n return result;\n }", "public String getResult() {\n return result;\n }", "public String getResult() {\n return result;\n }", "public String toString() {\r\n\treturn data;\r\n }", "@Override\n\tpublic String toString()\n\t{\n\t\treturn \"Statistical output: \"\n\t\t\t\t+\"replication size = \"+this.replicationSize+\"; \"\n\t\t\t\t+\"sample size = \"+this.sampleSize+\"; \"\n\t\t\t\t+\"mean = \"+this.mean+\"; \"\n\t\t\t\t+\"std. dev. = \"+this.stDev+\"; \"\n\t\t\t\t+\"CI width (alpha = \"+this.alpha+\"; \"+this.nameOfStatisticalTest+\" ) = \"+this.CIWidth+\".\";\n\t}", "@Override\npublic String toString() {\n\treturn \tthis.getCity() + \"\\n\" +this.situation +\", temperature=\" + this.temperature +\", humidity= \" + this.humidity + \", wind= \" + this.wind ;\n}", "public void printInfo(){\n\t}", "public void printInfo(){\n\t}", "public void info() {\r\n System.out.println(\" Name: \" + name + \" Facility: \" + facility + \" Floor: \" + floor + \" Covid: \"\r\n + positive + \" Age: \" + age + \" ID: \" + id);\r\n }", "public String getOutput() {\n\t\treturn results.getOutput() ;\n\t}", "@Override\n public String toString() {\n String toStr = String.format(\"ChiefExecutiveOfHA | %s, leadership %d, medicine %d, experience %d\", isReady() ? \"READY\" : \"DONE\",leadership, medicine, experience);\n return toStr;\n }", "void printInfo();", "@Override\n\tpublic String getFeatureName() {\n\t\treturn this.name();\n\t}", "String returnInfo() {\n String info = \n this.toString() +\n \"\\n\\tOn: \" + this.getOnStatus() +\n \"\\n\\tSpeed: \" + this.getSpeed() +\n \"\\n\\tRadius: \" + this.getRadius() +\n \"\\n\\tColor: \" + this.getColor();\n return info;\n }", "public String toString(){\n\t\treturn (word + \" \" + wordCount);\n\t}", "public String toString() {\r\n\treturn \"interfaceID = \" + interfaceID + \"; versionInfoID = \" + versionInfoID + \"; blender = \" + blender;\r\n }", "public String infoName();", "String getFpDescription();", "public String toString() {\r\n\t\treturn getDescription();\r\n\t}", "@Override\n public String toString() {\n final String lineSeparator = System.getProperty(\"line.separator\");\n return new StringBuilder(\"TableOfConfusion\").append(lineSeparator)\n .append(\"precision: \").append(calculatePrecision()).append(lineSeparator)\n .append(\"recall: \").append(calculateRecall()).append(lineSeparator)\n .append(\"specificity: \").append(calculateSpecificity()).append(lineSeparator)\n .append(\"accuracy: \").append(calculateAccuracy()).append(lineSeparator)\n .append(\"fscore: \").append(calculateFScore()).append(lineSeparator)\n .toString();\n }", "public String getOutputInfo(int index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn \"The table containing the population\";\n\t\t\tdefault:\n\t\t\t\treturn \"No such input\";\n\t\t}\n\t}", "public String toString() {\n return \"[ProcessingResults: successes(\" + successes.size() + \")=\" + successes +\n \", failures(\" + failures.size() + \")=\" + failures + \"]\";\n }", "public String toString() {\n\t\t// WRITE YOUR CODE HERE!\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tbuffer.append(\"Virtual dataset with \" +attributes.length+\" attribute(s) and \"+map.length+\" row(s)\"+ System.lineSeparator());\n\t\tbuffer.append(\"Dataset is a view over weather-nominal.csv\"+System.lineSeparator());\n\t\tbuffer.append(\"Row indices in this dataset (w.r.t its source dataset) [\");\n\n\t\tfor(int i = 0; i < map.length; i++){\n\t\t\tbuffer.append(map[i]);\n\t\t\tif(i!=map.length-1)\n\t\t\t\tbuffer.append(\",\");\n\t\t}\n\t\tbuffer.append(\"]\").append(System.lineSeparator());\n\t\tfor(int i =0; i<attributes.length; i++){\n\t\t\tbuffer.append(attributes[i]);\n\t\t\tbuffer.append(System.lineSeparator());\n\t\t}\n\t\treturn buffer.toString();\n\t}" ]
[ "0.6781825", "0.6781825", "0.657504", "0.6564545", "0.6443367", "0.6334075", "0.63258964", "0.6173087", "0.6113375", "0.60552067", "0.6016998", "0.5986442", "0.5977848", "0.5969622", "0.5961911", "0.59471667", "0.5938622", "0.5928048", "0.59272814", "0.5925714", "0.59132326", "0.58452344", "0.5828247", "0.5816432", "0.5791898", "0.57658035", "0.57441306", "0.572608", "0.5721385", "0.5714312", "0.5703274", "0.56958157", "0.56660515", "0.5653252", "0.5649457", "0.56370586", "0.5636544", "0.56342936", "0.56195325", "0.5618912", "0.5618803", "0.5612609", "0.560543", "0.5597192", "0.5595773", "0.5587794", "0.5587351", "0.55820495", "0.55802524", "0.5575066", "0.5575066", "0.5574723", "0.557414", "0.5570466", "0.5559357", "0.55557954", "0.5554377", "0.5553431", "0.5551221", "0.5551221", "0.5551221", "0.55446434", "0.55266863", "0.5525051", "0.5521018", "0.5521018", "0.5500218", "0.54985327", "0.54983246", "0.548187", "0.5481727", "0.5478216", "0.54713506", "0.5469218", "0.5454266", "0.5452638", "0.5449609", "0.54491305", "0.5447002", "0.5447002", "0.5447002", "0.5438073", "0.5422014", "0.5409967", "0.5402524", "0.5402524", "0.5394133", "0.53934187", "0.539144", "0.53884435", "0.5388115", "0.5385091", "0.5379618", "0.5374888", "0.53661764", "0.53659654", "0.5363511", "0.5361488", "0.5356673", "0.5352284", "0.53502846" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { Scanner sc = new Scanner(System.in); String N = sc.next(); int[] array = new int[N.length()]; String result = ""; for(int i=0;i<N.length();i++) { array[i] = (int)N.charAt(i)-'0'; } Arrays.sort(array); for(int j=array.length-1;j>=0;j--) { result += array[j]; } System.out.println(result); }
{ "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
Convert a String to a MessageType.
public static Result<MessageType, JSONException> fromString(String str) { return Result.ofRuntime(() -> valueOf(str)) .mapError(ignored -> new JSONException("command not recognised")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static MessageType parseMessageType(String messageType) {\n MessageType mt = null;\n for(MessageType messageType1 : values()) {\n if(messageType1.name().equals(messageType)) {\n mt = messageType1;\n }\n }\n\n return mt;\n }", "public <T extends org.ros.internal.message.Message> T buildMessage(String typeString) {\n return messageFactory.newFromType(typeString);\n }", "public static MessageType getType(String type){\n\t\t\tMessageType msgType = PING;\n\t\t\tswitch(type){\n\t\t\tcase \"login\" : msgType = LOGIN; break;\n\t\t\tcase \"get\" : msgType = GET_TOPIC; break;\n\t\t\tcase \"new\" : msgType = NEW; break;\n\t\t\tcase \"ping\" : msgType = PING; break;\n\t\t\tcase \"select\" : msgType = SELECT; break;\n\t\t\tcase \"append\" : msgType = APPEND; break;\n\t\t\t}\n\t\t\treturn msgType;\n\t\t}", "private MessageType(String value) {\n\t\tthis.value = value;\n\t}", "public abstract MessageType getType();", "public abstract MessageType getType();", "public void setMessageType(java.lang.String messageType) {\r\n this.messageType = messageType;\r\n }", "public Builder setMsgType(com.eze.ezecli.ApiInput.MessageType value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n msgType_ = value;\n onChanged();\n return this;\n }", "MessageProto.MSG getType();", "MessageType createMessageType();", "public MessageType getType() {\n return msgType;\n }", "public void setMessageType(String messageType)\r\n\t{\r\n\t\tthis.messageType = messageType;\r\n\t}", "protected abstract MessageType getMessageType();", "public String getMessageType()\r\n\t{\r\n\t\treturn this.messageType;\r\n\t}", "public java.lang.String getMsgType() {\n java.lang.Object ref = msgType_;\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 msgType_ = s;\n return s;\n }\n }", "public static void parseMessage(String jsonString) {\n\t\n\t\tJSONRPC2Message msg;\n\t\t\n\t\ttry {\n\t\t\tmsg = JSONRPC2Message.parse(jsonString);\n\t\t\t\n\t\t} catch (JSONRPC2ParseException e) {\n\t\t\tSystem.err.println(e);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (msg instanceof JSONRPC2Request) {\n\t\t\tSystem.out.println(\"The message is a Request\");\n\t\t}\n\t\telse if (msg instanceof JSONRPC2Notification) {\n\t\t\tSystem.out.println(\"The message is a Notification\");\n\t\t}\n\t\telse if (msg instanceof JSONRPC2Response) {\n\t\t\tSystem.out.println(\"The message is a Response\");\n\t\t}\n\t}", "public Message createMessage(MessageType type, String message) throws MessageFormatException {\n String salesMessage[] = message.split(\" \");\n switch (type) {\n case SINGLE:\n if (salesMessage.length == 2) {\n return new SingleSaleMessage(salesMessage);\n }\n throw new MessageFormatException(\"Message type \\\"single\\\" should contain the product type and price.\" +\n \"e.g. \\\"single apple 10p\\\"\");\n case MULTIPLE:\n if (salesMessage.length == 3) {\n return new MultipleSaleMessage(salesMessage);\n }\n throw new MessageFormatException(\"Message type \\\"multiple\\\" should contain the quantity, product type and price.\" +\n \"e.g. \\\"multiple 10 apple 10p\\\"\");\n case ADJUSTMENT:\n if (salesMessage.length == 3) {\n return new PriceAdjustmentMessage(salesMessage);\n }\n throw new MessageFormatException(\"Message type \\\"adjustment\\\" should contain the adjustment operation,\" +\n \" adjustment price and product type. e.g. \\\"adjustment add 10p apple\\\"\");\n default:\n throw new MessageFormatException(\"Message type %s not supported.\" +\n \"Supported message types are %s\", type.toString(), Arrays.toString(MessageType.values()));\n }\n }", "public java.lang.String getMessageType() {\r\n return messageType;\r\n }", "public Utils.MessageType getMessageType() {\n return messageType;\n }", "public Builder setMsgType(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n msgType_ = value;\n onChanged();\n return this;\n }", "public java.lang.String getMsgType() {\n java.lang.Object ref = msgType_;\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 msgType_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public static String getMessageType(TextMessage message) {\n JSONObject json = new JSONObject(message.getPayload());\n String type = json.keys().next();\n\n return type;\n }", "public String getMessageType() {\n return type.getMessage().getName();\n }", "MessageType getType();", "public interface MessageType {\n\n /**\n * 心跳消息\n */\n byte PING = 1;\n\n /**\n * 心跳回复\n */\n byte PONG = 2;\n\n /**\n * 业务数据\n */\n byte BUSINESS = 3;\n}", "public MPTMessageType getMessageType()\n {\n \tint value = mMessage.getInt( B1_MESSAGE_TYPE );\n\n \treturn MPTMessageType.fromNumber( value );\n }", "public MessageType getMessageType() {\n\t\treturn messageType;\n\t}", "public static CMakeModuleType parse(String str) {\n return Enums.parse(CMakeModuleType.class, str);\n }", "private MessageType(String nameId) {\r\n\t\tthis.nameId = nameId;\r\n\t}", "public void setMessageType(MessageType messageType) {\n\t\tthis.messageType = messageType;\n\t}", "public static CMakeModuleType tryParse(String str) {\n return Enums.tryParse(CMakeModuleType.class, str);\n }", "com.randomm.server.ProtoBufMessage.Message.InputType getType();", "public MessageType getMessageType() {\n return messageType;\n }", "public void setMessageType(Integer messageType) {\n this.messageType = messageType;\n }", "public void setMessageType(MessageType messageType) {\n this.messageType = messageType;\n }", "public MessageType getType() {\n return m_type;\n }", "public com.google.protobuf.ByteString\n getMsgTypeBytes() {\n java.lang.Object ref = msgType_;\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 msgType_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "com.example.cs217b.ndn_hangman.MessageBuffer.Messages.MessageType getType();", "public ChatMessage(MessageType type, Object message) {\n m_type = type;\n m_message = message;\n }", "public static com.nhcsys.webservices.getmessages.getmessagestypes.v1.MessageType newInstance() {\n return (com.nhcsys.webservices.getmessages.getmessagestypes.v1.MessageType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader()\n .newInstance(type,\n null);\n }", "public static FieldType fromString(String s) \n {\n if (s!=null) \n for (FieldType t : FieldType.values())\n if (s.equalsIgnoreCase(t.name))\n return t;\n \n return null;\n }", "public Builder setMsgTypeBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n msgType_ = value;\n onChanged();\n return this;\n }", "public Message generateMessage(MessageType messageType) {\n Message msg = null;\n switch (messageType) {\n case REGISTER:\n msg = new RegisterMessage(deviceID);\n break;\n case UPDATE:\n break;\n case MAP_UPDATE:\n break;\n case QUERY:\n msg = new QueryMessage(deviceID);\n break;\n case REPLY:\n msg = new ReplyMessage(deviceID);\n break;\n case REQUEST:\n msg = new RequestMessage(deviceID);\n break;\n case RESPONSE:\n msg = new ResponseMessage(deviceID);\n break;\n }\n\n return msg;\n }", "public static Message parse(String messageData)\n {\n // Split by new line\n String[] messageParts = messageData.split(\"\\n\");\n\n // Assume first line is the action\n int action = Integer.parseInt(messageParts[0]);\n\n // And second line is the client\n int clientID = Integer.parseInt(messageParts[1]);\n\n // Set default for recipient\n int recipient = -1;\n\n // If the 3rd line is not a new line\n if(messageParts[2] != \"\\n\") {\n // We assume it's the recipient ID\n recipient = Integer.parseInt(messageParts[2]);\n }\n\n // The last part is always the message body\n String body = messageParts[messageParts.length - 1];\n return new Message(action, clientID, recipient, body);\n }", "public Integer getMessageType() {\n return messageType;\n }", "public Message newMessage(String type, String addr) {\n\tMessage message = null;\n\n\tif (type.equals(MessageConnection.TEXT_MESSAGE)) {\n\n\t message = new TextObject(addr);\n\t} else {\n\t if (type.equals(MessageConnection.BINARY_MESSAGE)) {\n\n message = new BinaryObject(addr);\n\t } else {\n throw new IllegalArgumentException(\n \"Message type not supported\");\n\t }\n\t}\n\n\n\treturn message;\n }", "public static BlobType parse(final String typeString) {\n if (Utility.isNullOrEmpty(typeString)) {\n return UNSPECIFIED;\n }\n else if (\"blockblob\".equals(typeString.toLowerCase(Locale.US))) {\n return BLOCK_BLOB;\n }\n else if (\"pageblob\".equals(typeString.toLowerCase(Locale.US))) {\n return PAGE_BLOB;\n }\n else {\n return UNSPECIFIED;\n }\n }", "public Message(String type, Object message) {\n\t\tthis.type = type;\n\t\tthis.message = message;\n\t}", "public com.google.protobuf.ByteString\n getMsgTypeBytes() {\n java.lang.Object ref = msgType_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n msgType_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public static void typeMessage(String message) {\n\n }", "public int getMessageType()\r\n {\r\n return msgType;\r\n }", "public static grms_schema.types.LocalrmnameType valueOf(\n java.lang.String string) {\n java.lang.Object obj = null;\n\n if (string != null) {\n obj = _memberTable.get(string);\n }\n\n if (obj == null) {\n String err = \"'\" + string + \"' is not a valid LocalrmnameType\";\n throw new IllegalArgumentException(err);\n }\n\n return (LocalrmnameType) obj;\n }", "MessagesType createMessagesType();", "com.mycompany.midtermproject2.proto.ServerMessageOuterClass.ServerMessage.MsgType getType();", "public static JavaDataType fromString(String type) {\r\n switch (type) {\r\n case \"String\":\r\n return STRING;\r\n case \"Integer\":\r\n return INTEGER;\r\n case \"Boolean\":\r\n return BOOLEAN;\r\n case \"Double\":\r\n return DOUBLE;\r\n case \"Float\":\r\n return FLOAT;\r\n case \"Long\":\r\n return LONG;\r\n }\r\n return null;\r\n }", "public abstract String getMessageType();", "public com.eze.ezecli.ApiInput.MessageType getMsgType() {\n return msgType_;\n }", "public abstract MessageType getHandledMessageType();", "public Builder setType(com.example.cs217b.ndn_hangman.MessageBuffer.Messages.MessageType value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n type_ = value;\n onChanged();\n return this;\n }", "public void handleStringMessage(String message) {\n\n }", "public static Mensaje fromString (String str) {\n String[] stringArray = str.split(\",\");\n Boolean respuesta = Boolean.parseBoolean(stringArray[0]);\n int valor = Integer.parseInt(stringArray[1]);\n int porcentaje = Integer.parseInt(stringArray[3]);\n int peso = Integer.parseInt(stringArray[2]);\n double monto = Double.parseDouble(stringArray[4]);\n if (respuesta){\n return new Mensaje(monto);\n }\n else{\n return new Mensaje(valor, peso, porcentaje);\n }\n }", "private static String getMessageTypeAsString(int messageType)\n\t{\n\t\tswitch (messageType)\n\t\t{\n\t\tcase WARNING_MESSAGE:\n\t\t\treturn \"Warning\";\n\n\t\tcase ERROR_MESSAGE:\n\t\t\treturn \"Error\";\n\n\t\tdefault:\n\t\t\treturn \"\";\n\t\t}\n\t}", "public Message newMessage(String type) {\n\tString address = null;\n\n\t/*\n * Provide the default address from the original open.\n */\n\n\tif (((m_mode & Connector.WRITE) > 0) && (host != null)) {\n\t address = ADDRESS_PREFIX + host;\n\t if (m_iport != 0) {\n\t\taddress = address + \":\" + String.valueOf(m_iport);\n\t }\n\t}\n\n\treturn newMessage(type, address);\n }", "public static FileType fromString(String str) {\n if (str.equals(\"FILE\")) {\n return FILE;\n } else if (str.equals(\"DIRECTORY\")) {\n return DIRECTORY;\n } else if (str.equals(\"SYMLINK\")) {\n return SYMLINK;\n }\n //TODO: FIXME \n return FILE;\n }", "public com.eze.ezecli.ApiInput.MessageType getMsgType() {\n return msgType_;\n }", "com.nhcsys.webservices.getmessages.getmessagestypes.v1.SupportMessageType.Enum getType();", "messages.Basemessage.BaseMessage.Type getType();", "public MessageProto.MSG getType() {\n MessageProto.MSG result = MessageProto.MSG.valueOf(type_);\n return result == null ? MessageProto.MSG.UNRECOGNIZED : result;\n }", "public static Time fromString(String str) {\n checkFormat(str);\n int h = Integer.parseInt(str.substring(0, 2));\n int m = Integer.parseInt(str.substring(3, 5));\n String mStr = str.substring(6);\n boolean b = mStr.equals(\"PM\");\n\n return new Time(h, m, b);\n }", "public static ContentType parseFromString(String s)\n\t{\n\t\tfor (ContentType type : values())\n\t\t{\n\t\t\tif (type.toString().equalsIgnoreCase(s))\n\t\t\t\treturn type;\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public static ConnectionDirection fromString(String s) {\n if (s != null) {\n for (ConnectionDirection cd : ConnectionDirection.values()) {\n if (s.equals(cd.text)) {\n return cd;\n }\n }\n }\n return ConnectionDirection.INVALID;\n }", "public Builder setType(MessageProto.MSG value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n type_ = value.getNumber();\n onChanged();\n return this;\n }", "public CloudQueueMessage(String content) {\n\t\tthis(content.getBytes());\n\t}", "private void SendMessage(Object m, MessageType type)\n\t{\n\t\tMessage message = new Message();\n\t\tmessage.messageType = type;\n\t\tmessage.message = m;\n\t\t\n\t\ttry {\n\t\t\tout.writeObject(message);\n\t\t\tout.flush();\n\t\t} catch (IOException e) {\n\t\t\tApplicationManager.textChat.write(\"Cant send message\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public ModelMessage(MessageType messageType, String id, FreeColGameObject source) {\n this(messageType, id, source, getDefaultDisplay(messageType, source));\n }", "String getMessageMimeType(String msgId);", "Message newMessage(Uuid id, Uuid author, Uuid conversation, String body, Time creationTime);", "public static Type stringToType(final String newType) {\r\n\t\t\r\n\t\tType returnType = Type.Undeclared;\r\n\t\t\r\n\t\tif (newType.toLowerCase().equalsIgnoreCase(\"int\")) {\r\n\t\t\treturnType = Attribute.Type.Int;\r\n\t\t} else if (newType.toLowerCase().equalsIgnoreCase(\"long\")) {\r\n\t\t\treturnType = Attribute.Type.Long;\r\n\t\t} else if (newType.toLowerCase().equalsIgnoreCase(\"boolean\") \r\n\t\t\t\t|| newType.toLowerCase().equalsIgnoreCase(\"bool\")) {\r\n\t\t\treturnType = Attribute.Type.Boolean;\r\n\t\t} else if (newType.toLowerCase().toLowerCase().startsWith(\"char\") \r\n\t\t\t\t|| newType.toLowerCase().toLowerCase().startsWith(\"character\")) {\r\n\t\t\treturnType = Attribute.Type.Char;\r\n\t\t} else if (newType.toLowerCase().equalsIgnoreCase(\"float\")) {\r\n\t\t\treturnType = Attribute.Type.Float;\r\n\t\t} else if (newType.toLowerCase().equalsIgnoreCase(\"double\")) {\r\n\t\t\treturnType = Attribute.Type.Double;\r\n\t\t} else if (newType.toLowerCase().equalsIgnoreCase(\"datetime\")) {\r\n\t\t\treturnType = Attribute.Type.DateTime;\r\n\t\t} else {\r\n\t\t\treturnType = Attribute.Type.Undeclared;\r\n\t\t}\t\r\n\t\treturn returnType;\r\n\t}", "void setType(\n com.nhcsys.webservices.getmessages.getmessagestypes.v1.SupportMessageType.Enum type);", "public MessageProto.MSG getType() {\n MessageProto.MSG result = MessageProto.MSG.valueOf(type_);\n return result == null ? MessageProto.MSG.UNRECOGNIZED : result;\n }", "public int getMsgType() {\n return msgType_;\n }", "public void sendMessage(String message) {\r\n sendMessageAsByte(message.getBytes());\r\n }", "public Builder setType(com.czht.face.recognition.Czhtdev.MessageType value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n type_ = value.getNumber();\n onChanged();\n return this;\n }", "public static ResourceOperation.Type parseType(String str) {\n if (StringComparator.isSameIgnoreCase(str, \"added\")) {\n return ADDED;\n } else if (StringComparator.isSameIgnoreCase(str, \"removed\")) {\n return REMOVED;\n } else if (StringComparator.isSameIgnoreCase(str, \"moved_from\")) {\n return MOVED_FROM;\n } else if (StringComparator.isSameIgnoreCase(str, \"moved_to\")) {\n return MOVED_TO;\n } else if (StringComparator.isSameIgnoreCase(str, \"renamed_from\")) {\n return RENAMED_FROM;\n } else if (StringComparator.isSameIgnoreCase(str, \"renamed_to\")) {\n return RENAMED_TO;\n }\n \n return OTHERS;\n }", "public int getMsgType() {\n return msgType_;\n }", "private static final Object newObjectFromString(Class<?> type, String message) {\r\n Constructor<?> constructor;\r\n try {\r\n constructor = type.getDeclaredConstructor(String.class);\r\n constructor.setAccessible(true);\r\n } catch (Exception ex) {\r\n throw new RuntimeException(String.format(MSG_MISSINGCONSTRUCTOR, type.getSimpleName(), ex.getMessage()), ex);\r\n }\r\n try {\r\n return constructor.newInstance(message);\r\n } catch (Exception ex) {\r\n throw new RuntimeException(String.format(MSG_COULDNOTINSTANTIATECLASS, type.getName(), type.getSimpleName()), ex);\r\n }\r\n }", "public java.lang.String getMsg() {\n java.lang.Object ref = msg_;\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 msg_ = s;\n }\n return s;\n }\n }", "@JsonCreator\n public static IntermediateType fromString(final String text) {\n if (text != null) {\n for (final IntermediateType v : IntermediateType.values()) {\n if (text.equalsIgnoreCase(v.text)) {\n return v;\n }\n }\n }\n throw new IllegalArgumentException(\"Unrecognized type: \" + text);\n }", "public com.example.cs217b.ndn_hangman.MessageBuffer.Messages.MessageType getType() {\n return type_;\n }", "public Builder setMessage(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n message_ = value;\n onChanged();\n return this;\n }", "public Builder setMessage(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n message_ = value;\n onChanged();\n return this;\n }", "public Builder setMessage(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n message_ = value;\n onChanged();\n return this;\n }", "public Builder setMessage(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n message_ = value;\n onChanged();\n return this;\n }", "public Builder setMessage(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n message_ = value;\n onChanged();\n return this;\n }", "public Builder setMessage(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n message_ = value;\n onChanged();\n return this;\n }", "public com.example.cs217b.ndn_hangman.MessageBuffer.Messages.MessageType getType() {\n return type_;\n }", "public static Enum forString(java.lang.String s)\n { return (Enum)table.forString(s); }", "public static Enum forString(java.lang.String s)\n { return (Enum)table.forString(s); }", "public static Enum forString(java.lang.String s)\n { return (Enum)table.forString(s); }", "public static String convertToJavaMessage(String message) {\n Component component = BEDROCK_SERIALIZER.deserialize(message);\n return GSON_SERIALIZER.serialize(component);\n }" ]
[ "0.7217342", "0.6437474", "0.6116049", "0.6030784", "0.601958", "0.601958", "0.59887654", "0.5812574", "0.5808455", "0.5754057", "0.57092166", "0.56675005", "0.5599833", "0.5573379", "0.5533414", "0.55068547", "0.5500879", "0.5484394", "0.5457261", "0.54428464", "0.5439355", "0.5414443", "0.5403286", "0.53932726", "0.53657603", "0.5324758", "0.5319953", "0.52931416", "0.52715373", "0.52646965", "0.5255276", "0.52286816", "0.5207837", "0.51987296", "0.5193806", "0.51827466", "0.51359284", "0.51280195", "0.5127121", "0.5118056", "0.51102865", "0.5086483", "0.5046096", "0.50401163", "0.50373596", "0.50296146", "0.5022115", "0.499613", "0.49905562", "0.49880204", "0.49772415", "0.4952242", "0.4893654", "0.48927838", "0.48635188", "0.48511514", "0.48399633", "0.48193923", "0.48171622", "0.4816762", "0.48082215", "0.47991648", "0.4788915", "0.4787595", "0.47707957", "0.47285378", "0.47246656", "0.47190502", "0.4705677", "0.4683385", "0.4679156", "0.46665722", "0.4655725", "0.46519822", "0.4639686", "0.46298936", "0.46282563", "0.4627302", "0.4626695", "0.4624445", "0.4608523", "0.46068358", "0.45836335", "0.45827812", "0.45766056", "0.4566992", "0.4566809", "0.45540825", "0.45506904", "0.45366293", "0.45366293", "0.4534169", "0.4534169", "0.4534169", "0.4534169", "0.45251688", "0.4524807", "0.4524807", "0.4524807", "0.45188743" ]
0.5890625
7
/ / / /
public MKMapView() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void divide() {\n\t\t\n\t}", "public static void slashes() {\n\t\tSystem.out.println(\"//////////////////////\");\r\n\r\n\t}", "public abstract String division();", "public void division() {\n\t\tx=1;\n\t\ty=0;\n\t\tz=x/y;\n\t\t\t\t\n\t}", "private boolean slash() {\r\n return MARK(OPERATOR) && CHAR('/') && gap();\r\n }", "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 }", "public void gored() {\n\t\t\n\t}", "public String toString(){ return \"DIV\";}", "private int parent(int i){return (i-1)/2;}", "public String ring();", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "private int leftChild(int i){return 2*i+1;}", "double passer();", "static void pyramid(){\n\t}", "public void stg() {\n\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 }", "void mo33732Px();", "Operations operations();", "private int rightChild(int i){return 2*i+2;}", "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}", "@Override\n\tpublic float dividir(float op1, float op2) {\n\t\treturn op1 / op2;\n\t}", "void sharpen();", "void sharpen();", "double defendre();", "public int generateRoshambo(){\n ;]\n\n }", "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 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 }", "String divideAtWhite()[]{ return null; }", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "double volume(){\n return width*height*depth;\n }", "public void skystonePos4() {\n }", "void ringBell() {\n\n }", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\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}", "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}", "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 method1(){\n System.out.println(\"*****\");\n System.out.println(\"*****\");\n System.out.println(\" * *\");\n System.out.println(\" *\");\n System.out.println(\" * *\");\n }", "public int division(int x,int y){\n System.out.println(\"division methods\");\n int d=x/y;\n return d;\n\n }", "void mo21076g();", "private boolean dividingByZero(String operator){\n if (numStack.peek() == 0 && operator.equals(\"/\")){\n return true;\n }\n return false;\n }", "@Override\n public void bfs() {\n\n }", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "Parallelogram(){\n length = width = height = 0;\n }", "public Divide(){\n }", "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 }", "@Override\r\n\tpublic void div(int x, int y) {\n\t\t\r\n\t}", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "@Override\npublic void div(int a, int b) {\n\t\n}", "private double triangleBase() {\n return cellWidth() / BASE_WIDTH;\n }", "double volume() {\n\treturn width*height*depth;\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 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}", "int getWidth() {return width;}", "int width();", "public void divide(int dirOp1, int dirOp2, int dirRes) {\n //traduce casos de direccionamiento indirecto\n dirOp1 = traduceDirIndirecto(dirOp1);\n dirOp2 = traduceDirIndirecto(dirOp2);\n if (ManejadorMemoria.isConstante(dirOp1)) { // OPERANDO 1 CTE\n String valor1 = this.directorioProcedimientos.getConstantes().get(dirOp1).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirOp2)) { // OPERANDO 2 GLOBAL\n String valor2 = this.registroGlobal.getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else if (ManejadorMemoria.isConstante(dirOp2)) { // OPERANDO 2 CTE\n String valor2 = this.directorioProcedimientos.getConstantes().get(dirOp2).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else { // OPERANDO 2 LOCAL\n String valor2 = this.pilaRegistros.peek().getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { //RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n }\n } else if (ManejadorMemoria.isGlobal(dirOp1)) { // OPERANDO 1 GLOBAL\n String valor1 = this.registroGlobal.getValor(dirOp1);\n if (ManejadorMemoria.isGlobal(dirOp2)) { // OPERANDO 2 GLOBAL\n String valor2 = this.registroGlobal.getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else if (ManejadorMemoria.isConstante(dirOp2)) { // OPERANDO 2 CTE\n String valor2 = this.directorioProcedimientos.getConstantes().get(dirOp2).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else { // OPERANDO 2 LOCAL\n String valor2 = this.pilaRegistros.peek().getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n }\n } else { // OPERANDO 1 LOCAL\n String valor1 = this.pilaRegistros.peek().getValor(dirOp1);\n if (ManejadorMemoria.isGlobal(dirOp2)) { // OPERANDO 2 GLOBAL\n String valor2 = this.registroGlobal.getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES 2 LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else if (ManejadorMemoria.isConstante(dirOp2)) { // OPERANDO 2 CTE\n String valor2 = this.directorioProcedimientos.getConstantes().get(dirOp2).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else { //OPERANDO 2 LOCAL\n String valor2 = this.pilaRegistros.peek().getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n }\n }\n }", "public static void main(String[] args) {\n\n\n\n System.out.println(4 * (1.0 - (1 / 3) + (1 / 5) - (1 / 7) + (1 / 9) - (1 / 11)));\n\n System.out.println(4 * (1.0 - (1/3) + (1/5) - (1/7)\n + (1 / 9) - (1/11) + (1/13)));\n }", "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 }", "@Override\r\n\tpublic int div() {\n\t\treturn 0;\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 }", "public double getWidth() { return _width<0? -_width : _width; }", "double getPerimeter(){\n return 2*height+width;\n }", "public void mo3376r() {\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}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic double divide(double in1, double in2) {\n\t\treturn 0;\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: */ }", "public static void main (String[] args){\n Scanner s=new Scanner(System.in);\n int n=s.nextInt();\n if(n%2==1)\n {\n n=n/2;\n n++;\n }\n else\n {\n n=n/2;\n }\n for(int i=1;i<=n;i++)\n {\n for(int k=1;k<=i-1;k++)\n {\n System.out.print(\" \");\n }\n for(int j=1;j<=((2*n-1)-2*(i-1));j++)\n {\n if(j==1||j==((2*n-1)-2*(i-1)))\n System.out.print(\"*\");\n else\n System.out.print(\" \");\n }\n System.out.println();\n }\n for(int i=2;i<=n;i++)\n {\n for(int k=1;k<=n-i;k++)\n {\n System.out.print(\" \");\n }\n for(int j=1;j<i*2;j++)\n {\n if(j==1||j==(i*2-1))\n System.out.print(\"*\");\n else\n System.out.print(\" \");\n }\n System.out.println();\n }\n\t}", "public RMPath getPath() { return RMPath.unitRectPath; }", "void walk() {\n\t\t\n\t}", "public static void giant() {\n System.out.println(\" --------- \");\n System.out.println(\" | / \\\\| \");\n System.out.println(\" ZZZZZH | O | HZZZZZ \");\n System.out.println(\" H ----------- H \");\n System.out.println(\" ZZZZZHHHHHHHHHHHHHHHHHHHHHZZZZZ \");\n System.out.println(\" H HHHHHHHHHHH H \");\n System.out.println(\" ZZZZZH HHHHHHHHHHH HZZZZZ \");\n System.out.println(\" HHHHHHHHHHH \");\n System.out.println(\" HHH HHH \");\n System.out.println(\" HHH HHH \");\n }", "public void title ()\n {\n\tprintSlow (\" _ __\");\n\tprintSlow (\" ___ | ' \\\\\");\n\tprintSlow (\" ___ \\\\ / ___ ,'\\\\_ | .-. \\\\ /|\");\n\tprintSlow (\" \\\\ / | |,'__ \\\\ ,'\\\\_ | \\\\ | | | | ,' |_ /|\");\n\tprintSlow (\" _ | | | |\\\\/ \\\\ \\\\ | \\\\ | |\\\\_| _ | |_| | _ '-. .-',' |_ _\");\n\tprintSlow (\" // | | | |____| | | |\\\\_|| |__ // | | ,'_`. | | '-. .-',' `. ,'\\\\_\");\n\tprintSlow (\" \\\\\\\\_| |_,' .-, _ | | | | |\\\\ \\\\ // .| |\\\\_/ | / \\\\ || | | | / |\\\\ \\\\| \\\\\");\n\tprintSlow (\" `-. .-'| |/ / | | | | | | \\\\ \\\\// | | | | | || | | | | |_\\\\ || |\\\\_|\");\n\tprintSlow (\" | | | || \\\\_| | | | /_\\\\ \\\\ / | |` | | | || | | | | .---'| |\");\n\tprintSlow (\" | | | |\\\\___,_\\\\ /_\\\\ _ // | | | \\\\_/ || | | | | | /\\\\| |\");\n\tprintSlow (\" /_\\\\ | | //_____// .||` `._,' | | | | \\\\ `-' /| |\");\n\tprintSlow (\" /_\\\\ `------' \\\\ | AND `.\\\\ | | `._,' /_\\\\\");\n\tprintSlow (\" \\\\| HIS `.\\\\\");\n\tprintSlow (\" __ __ _ _ _ _ \");\n\tprintSlow (\" | \\\\/ | (_) | | /\\\\ | | | | \");\n\tprintSlow (\" | \\\\ / | __ _ __ _ _ ___ __ _| | / \\\\ __| |_ _____ _ __ | |_ _ _ _ __ ___ \");\n\tprintSlow (\" | |\\\\/| |/ _` |/ _` | |/ __/ _` | | / /\\\\ \\\\ / _` \\\\ \\\\ / / _ \\\\ '_ \\\\| __| | | | '__/ _ \\\\\");\n\tprintSlow (\" | | | | (_| | (_| | | (_| (_| | | / ____ \\\\ (_| |\\\\ V / __/ | | | |_| |_| | | | __/\");\n\tprintSlow (\" |_| |_|\\\\__,_|\\\\__, |_|\\\\___\\\\__,_|_| /_/ \\\\_\\\\__,_| \\\\_/ \\\\___|_| |_|\\\\__|\\\\__,_|_| \\\\___|\");\n\tprintSlow (\" __/ | \");\n\tprintSlow (\" |___/ \\n\\n\\n\");\n\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}", "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}", "double area() {\nSystem.out.println(\"Inside Area for Triangle.\");\nreturn dim1 * dim2 / 2;\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}", "public int mo9774x() {\n /*\n r5 = this;\n int r0 = r5.f9082i\n int r1 = r5.f9080g\n if (r1 != r0) goto L_0x0007\n goto L_0x006a\n L_0x0007:\n byte[] r2 = r5.f9079f\n int r3 = r0 + 1\n byte r0 = r2[r0]\n if (r0 < 0) goto L_0x0012\n r5.f9082i = r3\n return r0\n L_0x0012:\n int r1 = r1 - r3\n r4 = 9\n if (r1 >= r4) goto L_0x0018\n goto L_0x006a\n L_0x0018:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 7\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x0024\n r0 = r0 ^ -128(0xffffffffffffff80, float:NaN)\n goto L_0x0070\n L_0x0024:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r1 = r1 << 14\n r0 = r0 ^ r1\n if (r0 < 0) goto L_0x0031\n r0 = r0 ^ 16256(0x3f80, float:2.278E-41)\n L_0x002f:\n r1 = r3\n goto L_0x0070\n L_0x0031:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 21\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x003f\n r2 = -2080896(0xffffffffffe03f80, float:NaN)\n r0 = r0 ^ r2\n goto L_0x0070\n L_0x003f:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r4 = r1 << 28\n r0 = r0 ^ r4\n r4 = 266354560(0xfe03f80, float:2.2112565E-29)\n r0 = r0 ^ r4\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r3 = r2[r3]\n if (r3 >= 0) goto L_0x0070\n int r3 = r1 + 1\n byte r1 = r2[r1]\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r3 = r2[r3]\n if (r3 >= 0) goto L_0x0070\n int r3 = r1 + 1\n byte r1 = r2[r1]\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r2 = r2[r3]\n if (r2 >= 0) goto L_0x0070\n L_0x006a:\n long r0 = r5.mo9776z()\n int r0 = (int) r0\n return r0\n L_0x0070:\n r5.f9082i = r1\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p213q.p217b.p301c.p302a.p311j0.p312a.C3656k.C3659c.mo9774x():int\");\n }", "public SoNode \ngetCurPathTail() \n{\n//#ifdef DEBUG\n if (currentpath.getTail() != (SoFullPath.cast(getCurPath())).getTail()){\n SoDebugError.post(\"SoAction::getCurPathTail\\n\", \n \"Inconsistent path tail. Did you change the scene graph\\n\"+\n \"During traversal?\\n\");\n }\n//#endif /*DEBUG*/\n return(currentpath.getTail());\n}", "@Override\n\tpublic void breath() {\n\n\t}", "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}", "@Override\n\tpublic void div(double dx, double dy) {\n\t\t\n\t}", "public PathCode getCurPathCode() { return /*appliedTo.curPathCode*/currentpathcode;}", "@Override\n public double getPerimiter() {\n return 4 * width;\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}", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "static String division (String s1, String s2) {\r\n if (s2==null || s2.length()==0) return s1;\r\n return product (s1, invert(s2));\r\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 }", "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 void star(float x, float y, float r, float R) {\n float angle = TWO_PI / 5;\n float halfAngle = angle/2.0f;\n beginShape();\n noStroke();\n for (float a = 0; a < TWO_PI; a += angle) {\n float sx = x + cos(a) * r;\n float sy = y + sin(a) * r;\n vertex(sx, sy);\n sx = x + cos(a+halfAngle) * R;\n sy = y + sin(a+halfAngle) * R;\n vertex(sx, sy);\n }\n endShape(CLOSE);\n}", "@Override\r\n\tpublic void CalcPeri() {\n\t\tSystem.out.println(4*side);\t\r\n\t}", "public int upright();", "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}", "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 void backSlash() {\n text.append(\"\\\\\");\n }", "public static void main(String[] args){\t\n\t\tchar op = '/';\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.println(\"첫번째 정수입니다.\");\n\t\tint num1 = scan.nextInt();\n\t\t\n\t\tSystem.out.println(\"두번째 정수입니다.\");\n\t\tint num2 = scan.nextInt();\n\t\tint num3=0;\n\t\tif(op=='+'){\n\t\t\tnum3 = num1+num2;\n\t\t}\n\t\telse if(op=='-'){\n\t\t\tnum3 = num1-num2;\n\t\t}\n\t\telse if(op=='*'){\n\t\t\tnum3 = num1*num2;\n\t\t}\n\t\telse if(op=='/'){\n\t\t\tif(num2==0){\n\t\t\tSystem.out.println(\"오류입니다.\");\n\t\t}\n\t\t\t\n\t\t\tnum3 = num1/num2;\n\t\t}\n\t\tSystem.out.printf(\"%d%c%d=%d\" ,num1,op,num2,num3);\n\t\t\n\t\t\n\t}", "public final void testSlash() \n\t\t\tthrows ParserConfigurationException, IOException, SAXException \n\t{\n//\t\tassertSingleDocWithValue(\"8\", fldName, \"nnðýþnn\");\n//\t\tassertSingleDocWithValue(\"8\", fldName, \"nnønn\");\n\t\tassertSingleResult(\"8\", fldName, \"nnunn\");\n\t}", "AngleResource inclination();", "public abstract void squareRootThis();", "public UniquePathsII() {\n\t\t// Initialization here. \n\t\t//\t\tcount = 0;\n\t}", "@Override\n\tpublic void space() {\n\t\t\n\t}" ]
[ "0.5906264", "0.55749613", "0.5428019", "0.53241616", "0.5294036", "0.527193", "0.52582306", "0.5256754", "0.51585066", "0.5141374", "0.51100975", "0.5097357", "0.5026707", "0.50235814", "0.50100124", "0.49757177", "0.4967908", "0.49668512", "0.4931213", "0.49272057", "0.49150687", "0.4878608", "0.4873821", "0.4873821", "0.48564616", "0.48415148", "0.4840844", "0.48408422", "0.48392275", "0.48380315", "0.48342562", "0.48335755", "0.48189583", "0.4816532", "0.4803844", "0.47991633", "0.4790358", "0.4785782", "0.47707185", "0.47659388", "0.47607136", "0.4756167", "0.47525582", "0.4750556", "0.47465262", "0.47439283", "0.47427607", "0.47368544", "0.47283906", "0.4719052", "0.4715935", "0.4711951", "0.47046372", "0.47023433", "0.46957722", "0.46894073", "0.46882662", "0.46872112", "0.46870187", "0.46838596", "0.46826214", "0.46721044", "0.4671648", "0.46691796", "0.46658975", "0.46658975", "0.46634644", "0.46593347", "0.46569487", "0.46532407", "0.46484405", "0.46472803", "0.4647124", "0.46426368", "0.46379653", "0.4635675", "0.46356165", "0.46343538", "0.46343073", "0.46324328", "0.46307802", "0.46292034", "0.46249497", "0.46220893", "0.46138567", "0.46130696", "0.46125302", "0.4608751", "0.46084386", "0.4605762", "0.46052104", "0.4602023", "0.46015334", "0.45995793", "0.45948967", "0.459342", "0.45930445", "0.45923406", "0.45910415", "0.45878932", "0.45863274" ]
0.0
-1
/ / / /
@Method(selector = "setRegion:animated:") public native void setRegion(@ByVal MKCoordinateRegion region, boolean animated);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void divide() {\n\t\t\n\t}", "public static void slashes() {\n\t\tSystem.out.println(\"//////////////////////\");\r\n\r\n\t}", "public abstract String division();", "public void division() {\n\t\tx=1;\n\t\ty=0;\n\t\tz=x/y;\n\t\t\t\t\n\t}", "private boolean slash() {\r\n return MARK(OPERATOR) && CHAR('/') && gap();\r\n }", "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 }", "public void gored() {\n\t\t\n\t}", "public String toString(){ return \"DIV\";}", "private int parent(int i){return (i-1)/2;}", "public String ring();", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "private int leftChild(int i){return 2*i+1;}", "double passer();", "static void pyramid(){\n\t}", "public void stg() {\n\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 }", "void mo33732Px();", "Operations operations();", "private int rightChild(int i){return 2*i+2;}", "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}", "@Override\n\tpublic float dividir(float op1, float op2) {\n\t\treturn op1 / op2;\n\t}", "void sharpen();", "void sharpen();", "double defendre();", "public int generateRoshambo(){\n ;]\n\n }", "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 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 }", "String divideAtWhite()[]{ return null; }", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "double volume(){\n return width*height*depth;\n }", "public void skystonePos4() {\n }", "void ringBell() {\n\n }", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\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}", "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}", "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 method1(){\n System.out.println(\"*****\");\n System.out.println(\"*****\");\n System.out.println(\" * *\");\n System.out.println(\" *\");\n System.out.println(\" * *\");\n }", "public int division(int x,int y){\n System.out.println(\"division methods\");\n int d=x/y;\n return d;\n\n }", "void mo21076g();", "private boolean dividingByZero(String operator){\n if (numStack.peek() == 0 && operator.equals(\"/\")){\n return true;\n }\n return false;\n }", "@Override\n public void bfs() {\n\n }", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "Parallelogram(){\n length = width = height = 0;\n }", "public Divide(){\n }", "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 }", "@Override\r\n\tpublic void div(int x, int y) {\n\t\t\r\n\t}", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "@Override\npublic void div(int a, int b) {\n\t\n}", "private double triangleBase() {\n return cellWidth() / BASE_WIDTH;\n }", "double volume() {\n\treturn width*height*depth;\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 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}", "int getWidth() {return width;}", "int width();", "public void divide(int dirOp1, int dirOp2, int dirRes) {\n //traduce casos de direccionamiento indirecto\n dirOp1 = traduceDirIndirecto(dirOp1);\n dirOp2 = traduceDirIndirecto(dirOp2);\n if (ManejadorMemoria.isConstante(dirOp1)) { // OPERANDO 1 CTE\n String valor1 = this.directorioProcedimientos.getConstantes().get(dirOp1).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirOp2)) { // OPERANDO 2 GLOBAL\n String valor2 = this.registroGlobal.getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else if (ManejadorMemoria.isConstante(dirOp2)) { // OPERANDO 2 CTE\n String valor2 = this.directorioProcedimientos.getConstantes().get(dirOp2).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else { // OPERANDO 2 LOCAL\n String valor2 = this.pilaRegistros.peek().getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { //RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n }\n } else if (ManejadorMemoria.isGlobal(dirOp1)) { // OPERANDO 1 GLOBAL\n String valor1 = this.registroGlobal.getValor(dirOp1);\n if (ManejadorMemoria.isGlobal(dirOp2)) { // OPERANDO 2 GLOBAL\n String valor2 = this.registroGlobal.getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else if (ManejadorMemoria.isConstante(dirOp2)) { // OPERANDO 2 CTE\n String valor2 = this.directorioProcedimientos.getConstantes().get(dirOp2).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else { // OPERANDO 2 LOCAL\n String valor2 = this.pilaRegistros.peek().getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n }\n } else { // OPERANDO 1 LOCAL\n String valor1 = this.pilaRegistros.peek().getValor(dirOp1);\n if (ManejadorMemoria.isGlobal(dirOp2)) { // OPERANDO 2 GLOBAL\n String valor2 = this.registroGlobal.getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES 2 LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else if (ManejadorMemoria.isConstante(dirOp2)) { // OPERANDO 2 CTE\n String valor2 = this.directorioProcedimientos.getConstantes().get(dirOp2).getValorConstante();\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n } else { //OPERANDO 2 LOCAL\n String valor2 = this.pilaRegistros.peek().getValor(dirOp2);\n if (ManejadorMemoria.isGlobal(dirRes)) { // RES GLOBAL\n this.registroGlobal.guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n } else { // RES LOCAL\n this.pilaRegistros.peek().guardaValor(dirRes, auxOperacion(dirOp1, dirOp2, valor1, valor2, Codigos.DIV));\n }\n }\n }\n }", "public static void main(String[] args) {\n\n\n\n System.out.println(4 * (1.0 - (1 / 3) + (1 / 5) - (1 / 7) + (1 / 9) - (1 / 11)));\n\n System.out.println(4 * (1.0 - (1/3) + (1/5) - (1/7)\n + (1 / 9) - (1/11) + (1/13)));\n }", "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 }", "@Override\r\n\tpublic int div() {\n\t\treturn 0;\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 }", "public double getWidth() { return _width<0? -_width : _width; }", "double getPerimeter(){\n return 2*height+width;\n }", "public void mo3376r() {\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}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic double divide(double in1, double in2) {\n\t\treturn 0;\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: */ }", "public static void main (String[] args){\n Scanner s=new Scanner(System.in);\n int n=s.nextInt();\n if(n%2==1)\n {\n n=n/2;\n n++;\n }\n else\n {\n n=n/2;\n }\n for(int i=1;i<=n;i++)\n {\n for(int k=1;k<=i-1;k++)\n {\n System.out.print(\" \");\n }\n for(int j=1;j<=((2*n-1)-2*(i-1));j++)\n {\n if(j==1||j==((2*n-1)-2*(i-1)))\n System.out.print(\"*\");\n else\n System.out.print(\" \");\n }\n System.out.println();\n }\n for(int i=2;i<=n;i++)\n {\n for(int k=1;k<=n-i;k++)\n {\n System.out.print(\" \");\n }\n for(int j=1;j<i*2;j++)\n {\n if(j==1||j==(i*2-1))\n System.out.print(\"*\");\n else\n System.out.print(\" \");\n }\n System.out.println();\n }\n\t}", "public RMPath getPath() { return RMPath.unitRectPath; }", "void walk() {\n\t\t\n\t}", "public static void giant() {\n System.out.println(\" --------- \");\n System.out.println(\" | / \\\\| \");\n System.out.println(\" ZZZZZH | O | HZZZZZ \");\n System.out.println(\" H ----------- H \");\n System.out.println(\" ZZZZZHHHHHHHHHHHHHHHHHHHHHZZZZZ \");\n System.out.println(\" H HHHHHHHHHHH H \");\n System.out.println(\" ZZZZZH HHHHHHHHHHH HZZZZZ \");\n System.out.println(\" HHHHHHHHHHH \");\n System.out.println(\" HHH HHH \");\n System.out.println(\" HHH HHH \");\n }", "public void title ()\n {\n\tprintSlow (\" _ __\");\n\tprintSlow (\" ___ | ' \\\\\");\n\tprintSlow (\" ___ \\\\ / ___ ,'\\\\_ | .-. \\\\ /|\");\n\tprintSlow (\" \\\\ / | |,'__ \\\\ ,'\\\\_ | \\\\ | | | | ,' |_ /|\");\n\tprintSlow (\" _ | | | |\\\\/ \\\\ \\\\ | \\\\ | |\\\\_| _ | |_| | _ '-. .-',' |_ _\");\n\tprintSlow (\" // | | | |____| | | |\\\\_|| |__ // | | ,'_`. | | '-. .-',' `. ,'\\\\_\");\n\tprintSlow (\" \\\\\\\\_| |_,' .-, _ | | | | |\\\\ \\\\ // .| |\\\\_/ | / \\\\ || | | | / |\\\\ \\\\| \\\\\");\n\tprintSlow (\" `-. .-'| |/ / | | | | | | \\\\ \\\\// | | | | | || | | | | |_\\\\ || |\\\\_|\");\n\tprintSlow (\" | | | || \\\\_| | | | /_\\\\ \\\\ / | |` | | | || | | | | .---'| |\");\n\tprintSlow (\" | | | |\\\\___,_\\\\ /_\\\\ _ // | | | \\\\_/ || | | | | | /\\\\| |\");\n\tprintSlow (\" /_\\\\ | | //_____// .||` `._,' | | | | \\\\ `-' /| |\");\n\tprintSlow (\" /_\\\\ `------' \\\\ | AND `.\\\\ | | `._,' /_\\\\\");\n\tprintSlow (\" \\\\| HIS `.\\\\\");\n\tprintSlow (\" __ __ _ _ _ _ \");\n\tprintSlow (\" | \\\\/ | (_) | | /\\\\ | | | | \");\n\tprintSlow (\" | \\\\ / | __ _ __ _ _ ___ __ _| | / \\\\ __| |_ _____ _ __ | |_ _ _ _ __ ___ \");\n\tprintSlow (\" | |\\\\/| |/ _` |/ _` | |/ __/ _` | | / /\\\\ \\\\ / _` \\\\ \\\\ / / _ \\\\ '_ \\\\| __| | | | '__/ _ \\\\\");\n\tprintSlow (\" | | | | (_| | (_| | | (_| (_| | | / ____ \\\\ (_| |\\\\ V / __/ | | | |_| |_| | | | __/\");\n\tprintSlow (\" |_| |_|\\\\__,_|\\\\__, |_|\\\\___\\\\__,_|_| /_/ \\\\_\\\\__,_| \\\\_/ \\\\___|_| |_|\\\\__|\\\\__,_|_| \\\\___|\");\n\tprintSlow (\" __/ | \");\n\tprintSlow (\" |___/ \\n\\n\\n\");\n\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}", "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}", "double area() {\nSystem.out.println(\"Inside Area for Triangle.\");\nreturn dim1 * dim2 / 2;\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}", "public int mo9774x() {\n /*\n r5 = this;\n int r0 = r5.f9082i\n int r1 = r5.f9080g\n if (r1 != r0) goto L_0x0007\n goto L_0x006a\n L_0x0007:\n byte[] r2 = r5.f9079f\n int r3 = r0 + 1\n byte r0 = r2[r0]\n if (r0 < 0) goto L_0x0012\n r5.f9082i = r3\n return r0\n L_0x0012:\n int r1 = r1 - r3\n r4 = 9\n if (r1 >= r4) goto L_0x0018\n goto L_0x006a\n L_0x0018:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 7\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x0024\n r0 = r0 ^ -128(0xffffffffffffff80, float:NaN)\n goto L_0x0070\n L_0x0024:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r1 = r1 << 14\n r0 = r0 ^ r1\n if (r0 < 0) goto L_0x0031\n r0 = r0 ^ 16256(0x3f80, float:2.278E-41)\n L_0x002f:\n r1 = r3\n goto L_0x0070\n L_0x0031:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 21\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x003f\n r2 = -2080896(0xffffffffffe03f80, float:NaN)\n r0 = r0 ^ r2\n goto L_0x0070\n L_0x003f:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r4 = r1 << 28\n r0 = r0 ^ r4\n r4 = 266354560(0xfe03f80, float:2.2112565E-29)\n r0 = r0 ^ r4\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r3 = r2[r3]\n if (r3 >= 0) goto L_0x0070\n int r3 = r1 + 1\n byte r1 = r2[r1]\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r3 = r2[r3]\n if (r3 >= 0) goto L_0x0070\n int r3 = r1 + 1\n byte r1 = r2[r1]\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r2 = r2[r3]\n if (r2 >= 0) goto L_0x0070\n L_0x006a:\n long r0 = r5.mo9776z()\n int r0 = (int) r0\n return r0\n L_0x0070:\n r5.f9082i = r1\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p213q.p217b.p301c.p302a.p311j0.p312a.C3656k.C3659c.mo9774x():int\");\n }", "public SoNode \ngetCurPathTail() \n{\n//#ifdef DEBUG\n if (currentpath.getTail() != (SoFullPath.cast(getCurPath())).getTail()){\n SoDebugError.post(\"SoAction::getCurPathTail\\n\", \n \"Inconsistent path tail. Did you change the scene graph\\n\"+\n \"During traversal?\\n\");\n }\n//#endif /*DEBUG*/\n return(currentpath.getTail());\n}", "@Override\n\tpublic void breath() {\n\n\t}", "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}", "@Override\n\tpublic void div(double dx, double dy) {\n\t\t\n\t}", "public PathCode getCurPathCode() { return /*appliedTo.curPathCode*/currentpathcode;}", "@Override\n public double getPerimiter() {\n return 4 * width;\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}", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "static String division (String s1, String s2) {\r\n if (s2==null || s2.length()==0) return s1;\r\n return product (s1, invert(s2));\r\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 }", "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 void star(float x, float y, float r, float R) {\n float angle = TWO_PI / 5;\n float halfAngle = angle/2.0f;\n beginShape();\n noStroke();\n for (float a = 0; a < TWO_PI; a += angle) {\n float sx = x + cos(a) * r;\n float sy = y + sin(a) * r;\n vertex(sx, sy);\n sx = x + cos(a+halfAngle) * R;\n sy = y + sin(a+halfAngle) * R;\n vertex(sx, sy);\n }\n endShape(CLOSE);\n}", "@Override\r\n\tpublic void CalcPeri() {\n\t\tSystem.out.println(4*side);\t\r\n\t}", "public int upright();", "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}", "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 void backSlash() {\n text.append(\"\\\\\");\n }", "public static void main(String[] args){\t\n\t\tchar op = '/';\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.println(\"첫번째 정수입니다.\");\n\t\tint num1 = scan.nextInt();\n\t\t\n\t\tSystem.out.println(\"두번째 정수입니다.\");\n\t\tint num2 = scan.nextInt();\n\t\tint num3=0;\n\t\tif(op=='+'){\n\t\t\tnum3 = num1+num2;\n\t\t}\n\t\telse if(op=='-'){\n\t\t\tnum3 = num1-num2;\n\t\t}\n\t\telse if(op=='*'){\n\t\t\tnum3 = num1*num2;\n\t\t}\n\t\telse if(op=='/'){\n\t\t\tif(num2==0){\n\t\t\tSystem.out.println(\"오류입니다.\");\n\t\t}\n\t\t\t\n\t\t\tnum3 = num1/num2;\n\t\t}\n\t\tSystem.out.printf(\"%d%c%d=%d\" ,num1,op,num2,num3);\n\t\t\n\t\t\n\t}", "public final void testSlash() \n\t\t\tthrows ParserConfigurationException, IOException, SAXException \n\t{\n//\t\tassertSingleDocWithValue(\"8\", fldName, \"nnðýþnn\");\n//\t\tassertSingleDocWithValue(\"8\", fldName, \"nnønn\");\n\t\tassertSingleResult(\"8\", fldName, \"nnunn\");\n\t}", "AngleResource inclination();", "public abstract void squareRootThis();", "public UniquePathsII() {\n\t\t// Initialization here. \n\t\t//\t\tcount = 0;\n\t}", "@Override\n\tpublic void space() {\n\t\t\n\t}" ]
[ "0.5906264", "0.55749613", "0.5428019", "0.53241616", "0.5294036", "0.527193", "0.52582306", "0.5256754", "0.51585066", "0.5141374", "0.51100975", "0.5097357", "0.5026707", "0.50235814", "0.50100124", "0.49757177", "0.4967908", "0.49668512", "0.4931213", "0.49272057", "0.49150687", "0.4878608", "0.4873821", "0.4873821", "0.48564616", "0.48415148", "0.4840844", "0.48408422", "0.48392275", "0.48380315", "0.48342562", "0.48335755", "0.48189583", "0.4816532", "0.4803844", "0.47991633", "0.4790358", "0.4785782", "0.47707185", "0.47659388", "0.47607136", "0.4756167", "0.47525582", "0.4750556", "0.47465262", "0.47439283", "0.47427607", "0.47368544", "0.47283906", "0.4719052", "0.4715935", "0.4711951", "0.47046372", "0.47023433", "0.46957722", "0.46894073", "0.46882662", "0.46872112", "0.46870187", "0.46838596", "0.46826214", "0.46721044", "0.4671648", "0.46691796", "0.46658975", "0.46658975", "0.46634644", "0.46593347", "0.46569487", "0.46532407", "0.46484405", "0.46472803", "0.4647124", "0.46426368", "0.46379653", "0.4635675", "0.46356165", "0.46343538", "0.46343073", "0.46324328", "0.46307802", "0.46292034", "0.46249497", "0.46220893", "0.46138567", "0.46130696", "0.46125302", "0.4608751", "0.46084386", "0.4605762", "0.46052104", "0.4602023", "0.46015334", "0.45995793", "0.45948967", "0.459342", "0.45930445", "0.45923406", "0.45910415", "0.45878932", "0.45863274" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { int n,sum = 0; System.out.println("enter the number:"); Scanner sc=new Scanner(System.in); n=sc.nextInt(); for(int i=0;i<=n;i++){ sum=sum+i; } System.out.println("sum is: " +sum); System.out.println("------------------------------------------------------------"); System.out.println("Now check with while loop how can get sum value"); int k=1,sum1 = 0; while(k<=n){ sum1=sum1+k; k++; } System.out.println("sum is: " +sum1); }
{ "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
Created by e211303 on 3/24/2016. API interfaces General API for replay state management.
public interface ReplayState<T, I> { /** @return true if the subject has reached a terminal state. */ boolean terminated(); /** * Replay contents to the given observer. * @param observer the receiver of events * @return true if the subject has caught up */ boolean replayObserver(SubjectSubscriptionManager.SubjectObserver<? super T> observer); /** * Replay the buffered values from an index position and return a new index * @param idx the current index position * @param observer the receiver of events * @return the new index position */ I replayObserverFromIndex( I idx, SubjectSubscriptionManager.SubjectObserver<? super T> observer); /** * Replay the buffered values from an index position while testing for stale entries and return a new index * @param idx the current index position * @param observer the receiver of events * @return the new index position */ I replayObserverFromIndexTest( I idx, SubjectSubscriptionManager.SubjectObserver<? super T> observer, long now); /** * Add an OnNext value to the buffer * @param value the value to add */ void next(T value); /** * Add an OnError exception and terminate the subject * @param e the exception to add */ void error(Throwable e); /** * Add an OnCompleted exception and terminate the subject */ void complete(); /** * @return the number of non-terminal values in the replay buffer. */ int size(); /** * @return true if the replay buffer is empty of non-terminal values */ boolean isEmpty(); /** * Copy the current values (minus any terminal value) from the buffer into the array * or create a new array if there isn't enough room. * @param a the array to fill in * @return the array or a new array containing the current values */ T[] toArray(T[] a); /** * Returns the latest value that has been buffered or null if no such value * present. * @return the latest value buffered or null if none */ T latest(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void replay() {\n\t\tcmd = new ReplayRecordCommand(editor);\n\t\tinvoker = new MiniEditorInvoker(cmd);\n\t\tinvoker.action();\n\t}", "public interface IState \n{\n\t/**\n\t * Gets the state\n\t * \n\t * @pre none\n\t * @post returns the state as defined in the shared definitions\n\t */\n\tpublic shared.definitions.TurnStatus getState();\n\t\n\t/**\n\t * Advances to the next state in the turn \n\t * \n\t * @pre the player is finished with all required actions in this state\n\t * @post the state is advanced to the next state\n\t * \n\t */\n\tpublic void finishPhase(TurnTracker turn_tracker_pointer, int player_index);\n\t\n\t/**\n\t * Forces this player into the Discarding State\n\t * @throws Exception \n\t * \n\t * @pre the player is in the Waiting or Rolling State\n\t * @post the player is in the Discarding state\n\t */\n\tpublic void forceDiscard(TurnTracker turn_tracker_pointer, int player_index) throws Exception;\n}", "@Override\n\tpublic void onReplayFailed(Throwable cause) {\n\n\t}", "@Override\n public void restoreState(Map<String, Object> state) {\n\n }", "public IReplayImpl( final Replay replay ) {\r\n\t\tthis.replay = replay;\r\n\t\tinitData = replay.initData;\r\n\t\tdetails = replay.details;\r\n\t}", "public String getReplayContext() {\n return replayContext;\n }", "@Override\n public void onRestate() {\n }", "@Override\n public Map<String, Object> currentState() {\n\n return new HashMap<>();\n }", "private void setMockControlStateToReplay() {\n this.xmlRpcElementFactoryControl.replay();\n this.xmlRpcRequestParserControl.replay();\n this.xmlRpcResponseWriterControl.replay();\n this.xmlRpcServiceExporterControl.replay();\n }", "@Override\r\n\tpublic void nextState() {\n\t\t\r\n\t}", "@Override\r\n\tpublic ReplayFactoryApi getReplayFactoryApi() {\r\n\t\treturn this;\r\n\t}", "public interface GameControllerState {\n}", "public void replayCommonBehavior() {\n\t\treplay(bundleContextMock);\n\t\treplay(bundleMock);\n\t\treplay(applicationContextMock);\n\t\tthis.replayed = true;\n\t}", "public Replays replays() {\n return this.replays;\n }", "@Override\r\n\tpublic void receive() {\n\t\tcurrentState.receive();\r\n\t}", "public String getReplayId() {\n return replayId;\n }", "public interface State {\n /**\n * Does the state its own job\n * @param player which player is in \"the\" state\n */\n void doAction(Player player);\n\n /**\n * Get type of the state\n * @return State name\n */\n String getState();\n}", "private void play() {\n\t\tParcel pc = Parcel.obtain();\n\t\tParcel pc_reply = Parcel.obtain();\n\t\ttry {\n\t\t\tSystem.out.println(\"DEBUG>>>pc\" + pc.toString());\n\t\t\tSystem.out.println(\"DEBUG>>>pc_replay\" + pc_reply.toString());\n\t\t\tib.transact(1, pc, pc_reply, 0);\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public interface State {\n public void insertQuarter();\n public void ejectQuarter();\n public void turnCrank();\n public void dispense();\n}", "public interface State {\r\n\r\n}", "public void getState();", "public interface State extends Serializable {\n void insertQuarter();\n\n void ejectQuarter();\n\n void turnCrank();\n\n void dispense();\n}", "void nextState();", "ESMFState getState();", "Object getState();", "public interface GamePlayState {\n\n void drawThreeDestCards(String username, String gameName);\n\n void returnDestCards(String username, String gameName, int destCards);\n\n void drawTrainCardFromDeck(String username, String gameName);\n\n void drawTrainCardFaceUp(String username, String gameName, int index);\n\n void claimRoute(String username, String gameName, int routeID, List<Integer> trainCards);\n\n void claimRoute(String username, String gameName, int routeID, AppCompatActivity context);\n\n}", "public State() {\n resetTransitions();\n id = next_id++;\n }", "@Override\n T restart();", "public interface IState extends Remote {\n\t\n\t/*\n\t * Simulate node failure.\n\t */\n\tpublic void setFailed() throws RemoteException;\n\t\n\t/*\n\t * The key for a node.\n\t */\n\tpublic NodeInfo getNodeInfo() throws RemoteException, Error;\n\t\n\t/*\n\t * Get all values stored under a key.\n\t */\n\tpublic String[] get(String k) throws RemoteException, Error;\n\n\t/*\n\t * Add a binding under a key (always cumulative).\n\t */\n\tpublic void add(String k, String v) throws RemoteException, Error;\n\n\t/*\n\t * Delete a binding under a key.\n\t */\n\tpublic void delete(String k, String v) throws RemoteException, Error;\n\t\n\t/*\n\t * Clear all bindings (necessary if a node joins a network with pre-existing bindings).\n\t */\n\tpublic void clear() throws RemoteException, Error;\n\t\n\t\n\t/*\n\t * These operations support the protocol for data transfers between pred & succ.\n\t */\n\t\n\t/*\n\t * The successor uses this operation to create a table of some of its bindings,\n\t * for transmission to its predecessor. TableRep also contains succ pointer,\n\t * so predecessor can alert successor to take over if this node fails.\n\t */\n\tpublic TableRep extractBindings(int predId) throws RemoteException, Error;\n\t\n\tpublic TableRep extractBindings() throws RemoteException, Error;\n\n\t/*\n\t * The successor uses this to remove bindings it has transferred to the predecessor.\n\t */\n\tpublic void dropBindings(int id) throws RemoteException, Error;\n\t\n\t/*\n\t * The predecessor uses this operation to install all bindings \n\t * into its internal hash table, as part of its own initialization.\n\t */\n\tpublic void installBindings(TableRep bindings) throws RemoteException, Error;\n\t\n\t/*\n\t * The successor uses this operation to install the predecessor's bindings\n\t * into backup storage. Each node is also a hot standby for its predecessor.\n\t */\n\tpublic void backupBindings(TableRep bindings) throws RemoteException, Error;\n\t\n\t/*\n\t * Each node backs up the successor pointer of its successor,\n\t * and notifies the succ of the succ when it should take over from succ.\n\t */\n\tpublic void backupSucc(TableRep bindings) throws RemoteException, Error;\n\n\t\n\t/*\n\t * Backup up the bindings in the table to a file.\n\t */\n\tpublic void backup(String filename) throws IOException, RemoteException, Error;\n\n\t/*\n\t * Reload the bindings from a file.\n\t */\n\tpublic void reload(String filename) throws IOException, RemoteException, Error;\n\t\n\t/*\n\t * Display the contents of the local hash table.\n\t */\n\tpublic void display() throws RemoteException;\n\n\t// TODO, Ranger\n\t\n\tpublic NodeInfo getBackupSucc() throws RemoteException, Error;\n\n\tpublic void setBackupSucc(NodeInfo succOfSucc) throws RemoteException, Error;\n\n\tpublic void addBackup(String k, String v) throws RemoteException, Error;\n\n\tpublic void delBackup(String k, String v) throws RemoteException, Error;\n\n\tpublic TableRep failoverBindings() throws RemoteException, Error;\n\n\tpublic void display(Table tb) throws RemoteException;\n\n\tpublic void setPred(NodeInfo info) throws RemoteException, Error;\n\n}", "public State getState(){return this.state;}", "public interface IState {\n int getLevel();\n\n float getClock();\n\n int getLives();\n\n int getCurrentScore();\n\n int getRequiredScore();\n\n boolean isGameOver();\n\n @Override\n String toString();\n}", "public interface MonsterStateTransitions {\n //state transitions\n void toVulnerableState();\n void toProtectedState();\n\n //actions\n void init();\n\n}", "public void saveState() { }", "public abstract State getSourceState ();", "private interface C0249a {\n void m352b(LifecycleDelegate lifecycleDelegate);\n\n int getState();\n }", "interface ReplayBuffer<T> {\n void complete();\n\n void error(Throwable th);\n\n void next(T t);\n\n void replay(InnerDisposable<T> innerDisposable);\n }", "LifecycleState lifecycleState();", "LifecycleState lifecycleState();", "boolean replayObserver(SubjectSubscriptionManager.SubjectObserver<? super T> observer);", "public interface GameState {\n\n\t/**\n * Method used by a player in order to perform transfer of stones \n * @param pitId the identifier of the pit by which the player will start (the associated pit must belong to him) This is the only method that can change the state \n * @return map {@link Map Map.class} with (pitId,#stones) as entries\n */\n\tpublic Map<Integer, Integer> move(final int pitId);\n\t\n\t/**\n\t * @return the {@link GameStateEnum GameStateEnum.class} that corresponds to {@link GameState GameState.class} concretions\n\t */\n\tpublic GameStateEnum getStateEnum();\n}", "public interface ITrackerState\n{\n\n public abstract void checkState(ITrackerStateContext itrackerstatecontext);\n\n public abstract TrackingStates getStateId();\n\n public abstract void onApplicationExit(ITrackerStateContext itrackerstatecontext);\n\n public abstract void onInvitationAccepted(ITrackerStateContext itrackerstatecontext);\n\n public abstract void onInvitationDeclined(ITrackerStateContext itrackerstatecontext);\n\n public abstract void onNetworkDisconnected(ITrackerStateContext itrackerstatecontext);\n\n public abstract void onSurveyAborted(ITrackerStateContext itrackerstatecontext);\n\n public abstract void onSurveyCompleted(ITrackerStateContext itrackerstatecontext);\n\n public abstract boolean shouldPersist();\n\n public abstract void triggerInvitation(String s, ITrackerStateContext itrackerstatecontext);\n\n public abstract void triggerSurvey(String s, ITrackerStateContext itrackerstatecontext);\n}", "private GameStatePresets()\n {\n\n }", "@Override\r\n\tpublic void resume() {\n\t\tcurrentState.resume();\r\n\t}", "State getState();", "State getState();", "State getState();", "State getState();", "private StateUtils() {}", "StatePacBuilder lifecycleState(LifecycleState lifecycleState);", "public void onRestorePendingState() {\n }", "@Override\n public void restore() {\n }", "public interface VideoStoryPersistentState {\n int mo420a();\n\n void mo421a(int i);\n\n @Nullable\n AutoplayStateManager mo422b();\n\n EventTriggerType mo423c();\n}", "@PlayerState\n public abstract int getPlayerState();", "public IState getState();", "StateClass() {\r\n restored = restore();\r\n }", "@Override\n protected void incrementStates() {\n\n }", "private void next() {\n\t\tParcel pc = Parcel.obtain();\n\t\tParcel pc_reply = Parcel.obtain();\n\t\ttry {\n\t\t\tSystem.out.println(\"DEBUG>>>pc\" + pc.toString());\n\t\t\tSystem.out.println(\"DEBUG>>>pc_replay\" + pc_reply.toString());\n\t\t\tib.transact(2, pc, pc_reply, 0);\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private RCProxy() {\n\t\tstate = new DefaultState();\n\t\tSTBListener.instance().addObserver(this);\n\t}", "public interface StateMachineListener\n{\n //================| Public Methods |====================================\n \n /**\n * Notification that the state of the game has changed.\n\n * @param oldState \n * @param newState\n */\n void stateChanged( final GameState oldState, final GameState newState );\n}", "@Test\n public void testStateTransitions2()\n {\n theEngine.start();\n letPlayerWin();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inWonState());\n \n //Player won -> Halted\n theEngine.quit();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inWonState());\n \n //Player won -> Player died\n killPlayerByPlayerMove();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inWonState());\n \n //Undo from player won state\n theEngine.undoLastMove();\n //didn't throw assertion error, so this is fine\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inHaltedState());\n }", "protected ReplayingDecoder(S initialState) {\n state = initialState;\n }", "@Test\n public void testStateTransitions1()\n { \n assertTrue(theEngine.inStartingState());\n \n //Starting -> Halted\n theEngine.quit();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inStartingState());\n\n //Starting -> Player died\n killPlayerByPlayerMove();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inStartingState());\n \n //Starting -> Player won\n letPlayerWin();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inStartingState());\n \n theEngine.start();\n theEngine.quit();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inHaltedState());\n \n //Halted -> Starting\n //impossible through code\n\n //Halted -> Player died\n killPlayerByPlayerMove();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inHaltedState());\n\n //Halted -> Player won\n letPlayerWin();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inHaltedState());\n\n theEngine.start();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inPlayingState());\n \n //Playing -> Starting\n //impossible by code\n \n killPlayerByPlayerMove();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inDiedState());\n \n //Player died -> Halted\n theEngine.quit();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inDiedState());\n \n //Player died -> Player won\n letPlayerWin();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inDiedState());\n \n //Undo from player died state\n theEngine.undoLastMove();\n //this didn't throw assertion error, so this is fine\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inHaltedState());\n }", "public State state();", "public abstract interface State {\r\n\r\n public void render(SpriteBatch batch);\r\n\r\n public void update(float dt);\r\n\r\n}", "public void replay() {\n if (currentAnimation == null) play();\n else currentAnimation.playFromStart();\n }", "@Nonnull \r\n\tpublic static <T> Observable<T> replay(\r\n\t\t\t@Nonnull final Observable<? extends T> source\r\n\t) {\r\n\t\treturn replay(source, scheduler());\r\n\t}", "protected void doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)\n {\n this.doMyRestoreState(rs, context);\n }", "protected abstract int newState();", "public void startReplay() {\n resetMove();\n Move m;\n \n getCurrentMove().show();\n while ((m = nextMove()) != null) {\n m.show();\n }\n }", "public interface RoboticState {\r\n\t\r\n\tpublic void walk();\r\n\tpublic void cook();\r\n\tpublic void off();\r\n\r\n}", "@Override\n public int getState() {\n return myState;\n }", "public interface IState {\n\n /**\n * Click on button to load a new map from file.\n */\n void btnLoadMap();\n\n /**\n * Click on button to load a new planning from file.\n */\n void btnLoadPlanning();\n\n /**\n * Click on button to compute the best route to make deliveries.\n */\n void btnGenerateRoute();\n\n /**\n * Click on button to cancel a loading action.\n */\n void btnCancel();\n\n /**\n * Click on button to load file.\n *\n * @param file File to load as a map or a planning depending on the state.\n */\n void btnValidateFile(File file);\n\n /**\n * Left click pressed on a delivery.\n */\n void leftClickPressedOnDelivery();\n\n /**\n * Left click released on another delivery.\n *\n * @param sourceDelivery Delivery to switch with target delivery.\n * @param targetDelivery Delivery to switch with sourceDelivery.\n */\n void leftClickReleased(Delivery sourceDelivery, Delivery targetDelivery);\n\n /**\n * Simple click on a delivery.\n *\n * @param delivery The delivery clicked.\n */\n void clickOnDelivery(Delivery delivery);\n\n /**\n * Simple click somewhere else (not a interactive point).\n */\n void clickSomewhereElse();\n\n /**\n * Click on an empty node (not a delivery or warehouse node).\n *\n * @param node The empty node clicked.\n */\n void clickOnEmptyNode(Node node);\n\n /**\n * Click on button to add a new delivery.\n *\n * @param node The node to deliver.\n * @param previousDeliveryNode The node with the previous delivery.\n * @param timeSlot The time slot of the new delivery.\n */\n void btnAddDelivery(Node node, Node previousDeliveryNode, TimeSlot timeSlot);\n\n /**\n * Click on button to remove a delivery.\n *\n * @param delivery The delivery to remove.\n */\n void btnRemoveDelivery(Delivery delivery);\n\n /**\n * Click on a specific node : the warehouse.\n *\n * @param warehouse The warehouse node clicked.\n */\n void clickOnWarehouse(Node warehouse);\n\n /**\n * Click on button to close the current map already loaded.\n */\n void btnCloseMap();\n\n /**\n * Click on button to clear the current planning already loaded.\n */\n void btnClearPlanning();\n\n /**\n * Set the default view for this state (enable/disable buttons ...).\n */\n void initView();\n}", "public S getCurrentState();", "public abstract void restore();", "@Override\n\tpublic int getState() {\n\t\treturn 0;\n\t}", "public interface Starter extends State {\n}", "public interface IStates {\n\n\t/**\n\t * applyExtraActionPoint. adds extra action point whit the type received by\n\t * parameter\n\t *\n\t * @param extra\n\t * a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.Constants.EXTRA}\n\t * object.\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates applyExtraActionPoint(EXTRA extra);\n\n\t/**\n\t * applyRallyTroops. applies rally troops\n\t *\n\t * @param plusOne\n\t * a boolean.\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates applyRallyTroops(boolean plusOne);\n\n\t/**\n\t * archersAttack. performs archers attack\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates archersAttack();\n\n\t/**\n\t * attack. performs attack\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t * @param name\n\t * a {@link java.lang.String} object.\n\t */\n\tIStates attack(String name);\n\n\t/**\n\t * boilingWaterAttack. performs boiling water attack\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates boilingWaterAttack();\n\n\t/**\n\t * capture. performs capture\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates capture();\n\n\t/**\n\t * checkStatus. check the current status\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates checkStatus();\n\n\t/**\n\t * closeCombatAttack. performs close combat attack\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates closeCombatAttack();\n\n\t/**\n\t * coupure. performs coupure\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates coupure();\n\n\t/**\n\t * <p>\n\t * dont.\n\t * </p>\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates dont();\n\n\t/**\n\t * drawTopCard. draws the card on the top of the deck\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates drawTopCard();\n\n\t/**\n\t * endOfTurn. performs the end of the turn\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates endOfTurn();\n\n\t/**\n\t * extraActionPoint. checks if is possible to add extra action point\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates extraActionPoint();\n\n\t/**\n\t * <p>\n\t * fastMovement.\n\t * </p>\n\t *\n\t * @param up\n\t * a boolean.\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates fastMovement(boolean up);\n\n\t/**\n\t * finish. finishes the game\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates finish();\n\n\t/**\n\t * <p>\n\t * freeMovement.\n\t * </p>\n\t *\n\t * @param up\n\t * a boolean.\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates freeMovement(boolean up);\n\n\t/**\n\t * <p>\n\t * leaveLocation.\n\t * </p>\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates leaveLocation();\n\n\t/**\n\t * playAgain.\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates playAgain();\n\n\t/**\n\t * rallyTroops. performs rally troops\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates rallyTroops();\n\n\t/**\n\t * sabotage. performs sabotage\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates sabotage();\n\n\t/**\n\t * start. starts the game\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates start();\n\n\t/**\n\t * <p>\n\t * StartOfTheTurn.\n\t * </p>\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates StartOfTheTurn();\n\n\t/**\n\t * supplyRaid.\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates supplyRaid();\n\n\t/**\n\t * tunnelMovement. performs tunnel movement\n\t *\n\t * @return a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.states.IStates}\n\t * object.\n\t */\n\tIStates tunnelMovement();\n}", "protected Expectations() {\n RecordAndReplayExecution execution = new RecordAndReplayExecution(this, (Object[]) null);\n //noinspection ConstantConditions\n currentPhase = execution.getRecordPhase();\n }", "public GameState() {}", "public ActionState createActionState();", "public interface StateBase {\n String GetName();\n\n void OnEnter(SurfaceView _view);\n void OnExit();\n void Render(Canvas _canvas);\n void Update(float _dt);\n}", "public interface AbstractState {\r\n abstract void toNextState(ChessBoard chessBoard,AbstractState state);\r\n}", "private SyncState() {}", "public int getState() {return state;}", "public int getState() {return state;}", "public interface State {\n void info();\n}", "public interface BaseState extends EventRegister {\n\n}", "public interface ThingState\n{\n\n}", "private PlayerStateDataAccess() {\n }", "public interface PttState {\n\n}", "@Override\n\tpublic void reset(){\n\t\tstate.reset();\n\t\toldState.reset();\n\t\treturnAction = new boolean[Environment.numberOfButtons]; \n\t\trewardSoFar = 0;\n\t\tcurrentReward = 0;\n\t}", "ControllerState getNewObjectState();", "@Override\r\n\tpublic GameState save() {\n\t\treturn null;\r\n\t}", "public GameState(){\n this.gameResults = \"\";\n initVars();\n this.theme = DEFAULT_THEME;\n this.board = new Board(DEFAULT_BOARD);\n createSetOfPlayers(DEFAULT_PLAYERS, DEFAULT_AUTOPLAYER, DEFAULT_AUTOMODE);\n }", "public PlaybackStateCompat mo738h() throws RemoteException {\n Parcel obtain = Parcel.obtain();\n Parcel obtain2 = Parcel.obtain();\n try {\n obtain.writeInterfaceToken(\"android.support.v4.media.session.IMediaSession\");\n this.f822a.transact(28, obtain, obtain2, 0);\n obtain2.readException();\n return obtain2.readInt() != 0 ? (PlaybackStateCompat) PlaybackStateCompat.CREATOR.createFromParcel(obtain2) : null;\n } finally {\n obtain2.recycle();\n obtain.recycle();\n }\n }", "private void replayNextOp() {\n\t\topNum++;\n\t\tif (opNum > ops.length) {\n\t\t\topNum = -1;\n\t\t\tupdate();\n\t\t} else if (!getExited()) {\n\t\t\tjavax.swing.SwingUtilities.invokeLater(doReplayNextOp);\n\t\t}\n\t}", "public void restoreState() {\n\t\tsuper.restoreState();\n\t}", "@VisibleForTesting\n int getInternalState() {\n return currentState;\n }", "StateManager getStateManager();", "private Object getState() {\n\treturn null;\r\n}" ]
[ "0.6607655", "0.63401884", "0.61592424", "0.6150541", "0.61393344", "0.6035547", "0.5986939", "0.598561", "0.59681237", "0.59241945", "0.5872595", "0.5862003", "0.5825834", "0.58208275", "0.5746807", "0.5746295", "0.57452226", "0.5739802", "0.57323074", "0.5727993", "0.5693792", "0.5677338", "0.5666924", "0.5647697", "0.5637031", "0.5626702", "0.555241", "0.553299", "0.55231947", "0.55194795", "0.5517169", "0.55138487", "0.55126554", "0.5504995", "0.54912454", "0.548719", "0.5486652", "0.5486652", "0.54859567", "0.5483959", "0.54779047", "0.54726815", "0.54708004", "0.54595464", "0.54595464", "0.54595464", "0.54595464", "0.54580575", "0.545492", "0.54519653", "0.544347", "0.5442406", "0.5441319", "0.5422778", "0.5415974", "0.5398587", "0.539486", "0.5392769", "0.5389466", "0.53892833", "0.5388936", "0.53886396", "0.53836864", "0.5382265", "0.53492415", "0.5341342", "0.53319484", "0.53296775", "0.53276885", "0.5323746", "0.5319959", "0.53111494", "0.53069526", "0.5301434", "0.52873874", "0.5286702", "0.5285404", "0.52851313", "0.52770007", "0.52758414", "0.5267159", "0.52658916", "0.5260371", "0.5260259", "0.5260259", "0.52538055", "0.52473676", "0.52420896", "0.52344084", "0.5228338", "0.5225099", "0.52196693", "0.52086073", "0.51997316", "0.5196864", "0.51880217", "0.5185576", "0.51843435", "0.518044", "0.5176939" ]
0.64578307
1
Replay contents to the given observer.
boolean replayObserver(SubjectSubscriptionManager.SubjectObserver<? super T> observer);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void replay() {\n for (InnerDisposable<T> rp : (InnerDisposable[]) this.observers.get()) {\n this.buffer.replay(rp);\n }\n }", "I replayObserverFromIndex(\n I idx, SubjectSubscriptionManager.SubjectObserver<? super T> observer);", "I replayObserverFromIndexTest(\n I idx, SubjectSubscriptionManager.SubjectObserver<? super T> observer, long now);", "public void replay() {\n\t\tcmd = new ReplayRecordCommand(editor);\n\t\tinvoker = new MiniEditorInvoker(cmd);\n\t\tinvoker.action();\n\t}", "public void subscribeActual(Observer<? super Response<T>> observer) {\r\n Call clone = this.originalCall.clone();\r\n CallCallback callCallback = new CallCallback(clone, observer);\r\n observer.onSubscribe(callCallback);\r\n clone.enqueue(callCallback);\r\n }", "public void subscribeActual(Observer<? super T> observer) {\n this.observable.subscribe(observer);\n }", "public void replayFinal() {\n for (InnerDisposable<T> rp : (InnerDisposable[]) this.observers.getAndSet(TERMINATED)) {\n this.buffer.replay(rp);\n }\n }", "public void subscribe(p019io.reactivex.Observer<? super T> r6) {\n /*\n r5 = this;\n L_0x0000:\n java.util.concurrent.atomic.AtomicReference<io.reactivex.internal.operators.observable.ObservableReplay$ReplayObserver<T>> r0 = r5.curr\n java.lang.Object r0 = r0.get()\n io.reactivex.internal.operators.observable.ObservableReplay$ReplayObserver r0 = (p019io.reactivex.internal.operators.observable.ObservableReplay.ReplayObserver) r0\n if (r0 != 0) goto L_0x0020\n io.reactivex.internal.operators.observable.ObservableReplay$BufferSupplier<T> r1 = r5.bufferFactory\n io.reactivex.internal.operators.observable.ObservableReplay$ReplayBuffer r1 = r1.call()\n io.reactivex.internal.operators.observable.ObservableReplay$ReplayObserver r2 = new io.reactivex.internal.operators.observable.ObservableReplay$ReplayObserver\n r2.<init>(r1)\n java.util.concurrent.atomic.AtomicReference<io.reactivex.internal.operators.observable.ObservableReplay$ReplayObserver<T>> r3 = r5.curr\n r4 = 0\n boolean r3 = r3.compareAndSet(r4, r2)\n if (r3 != 0) goto L_0x001f\n goto L_0x0000\n L_0x001f:\n r0 = r2\n L_0x0020:\n io.reactivex.internal.operators.observable.ObservableReplay$InnerDisposable r1 = new io.reactivex.internal.operators.observable.ObservableReplay$InnerDisposable\n r1.<init>(r0, r6)\n r6.onSubscribe(r1)\n r0.add(r1)\n boolean r2 = r1.isDisposed()\n if (r2 == 0) goto L_0x0035\n r0.remove(r1)\n return\n L_0x0035:\n io.reactivex.internal.operators.observable.ObservableReplay$ReplayBuffer<T> r2 = r0.buffer\n r2.replay(r1)\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p019io.reactivex.internal.operators.observable.ObservableReplay.ReplaySource.subscribe(io.reactivex.Observer):void\");\n }", "public interface ReplayState<T, I> {\n /** @return true if the subject has reached a terminal state. */\n boolean terminated();\n /**\n * Replay contents to the given observer.\n * @param observer the receiver of events\n * @return true if the subject has caught up\n */\n boolean replayObserver(SubjectSubscriptionManager.SubjectObserver<? super T> observer);\n /**\n * Replay the buffered values from an index position and return a new index\n * @param idx the current index position\n * @param observer the receiver of events\n * @return the new index position\n */\n I replayObserverFromIndex(\n I idx, SubjectSubscriptionManager.SubjectObserver<? super T> observer);\n /**\n * Replay the buffered values from an index position while testing for stale entries and return a new index\n * @param idx the current index position\n * @param observer the receiver of events\n * @return the new index position\n */\n I replayObserverFromIndexTest(\n I idx, SubjectSubscriptionManager.SubjectObserver<? super T> observer, long now);\n /**\n * Add an OnNext value to the buffer\n * @param value the value to add\n */\n void next(T value);\n /**\n * Add an OnError exception and terminate the subject\n * @param e the exception to add\n */\n void error(Throwable e);\n /**\n * Add an OnCompleted exception and terminate the subject\n */\n void complete();\n /**\n * @return the number of non-terminal values in the replay buffer.\n */\n int size();\n /**\n * @return true if the replay buffer is empty of non-terminal values\n */\n boolean isEmpty();\n\n /**\n * Copy the current values (minus any terminal value) from the buffer into the array\n * or create a new array if there isn't enough room.\n * @param a the array to fill in\n * @return the array or a new array containing the current values\n */\n T[] toArray(T[] a);\n /**\n * Returns the latest value that has been buffered or null if no such value\n * present.\n * @return the latest value buffered or null if none\n */\n T latest();\n}", "interface ReplayBuffer<T> {\n void complete();\n\n void error(Throwable th);\n\n void next(T t);\n\n void replay(InnerDisposable<T> innerDisposable);\n }", "@Nonnull \r\n\tpublic static <T> Observable<T> replay(\r\n\t\t\t@Nonnull final Observable<? extends T> source\r\n\t) {\r\n\t\treturn replay(source, scheduler());\r\n\t}", "public void setObserver(BoardObserver observer){\n this.observer = observer;\n }", "public void subscribeActual(SingleObserver<? super R> observer) {\n this.source.subscribe(new ReduceSeedObserver(observer, this.reducer, this.seed));\n }", "public void subscribeActual(Observer<? super T> observer) {\n this.onSubscribe.subscribe(observer);\n }", "public void updateObserver();", "@Override\n public void subscribe(Observer observer) {\n this.observers.add(observer);\n }", "@Nonnull \r\n\tpublic static <T> Observable<T> replay(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\tfinal int bufferSize\r\n\t) {\r\n\t\treturn replay(source, bufferSize, scheduler());\r\n\t}", "void notifyObserver();", "public void sendReplay (String path){\n connect();\n\n try {\n doStream.writeUTF(\"NEW_REPLAY\");\n doStream.writeUTF(currentUser.getUserName());\n doStream.writeUTF(path);\n BufferedReader br = new BufferedReader(new FileReader(path));\n String aux;\n while((aux = br.readLine()) != null) {\n doStream.writeUTF(aux);\n }\n doStream.writeUTF(\"END\");\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n disconnect();\n }", "private void play() {\n\t\tParcel pc = Parcel.obtain();\n\t\tParcel pc_reply = Parcel.obtain();\n\t\ttry {\n\t\t\tSystem.out.println(\"DEBUG>>>pc\" + pc.toString());\n\t\t\tSystem.out.println(\"DEBUG>>>pc_replay\" + pc_reply.toString());\n\t\t\tib.transact(1, pc, pc_reply, 0);\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void setObserver(OnMessageListener observer) {\n\t\tthis.observer = observer;\n\t}", "@Override\n protected synchronized void subscribeActual(Observer<? super Response<T>> observer) {\n Call<T> call = originalCall.clone();\n\n try {\n for (Annotation annotation : annotations) {\n if (annotation instanceof Cache) {\n time = ((Cache) annotation).time();\n bindParams = ((Cache) annotation).bindParams();\n break;\n }\n }\n MethodFactoryAdapter adapter = new MethodFactoryAdapter(call.request(), bindParams);\n MethodFactory factory = adapter.get();\n HashMap<String, String> parseParameters = factory.parseParameters();\n String url = call.request().url().toString();\n boolean isFirst = true;\n StringBuffer buffer = new StringBuffer();\n for (HashMap.Entry<String, String> entry : parseParameters.entrySet()) {\n String key = entry.getKey();\n String value = entry.getValue();\n if (isFirst) {\n buffer.append(\"?\").append(key).append(\"=\").append(value);\n isFirst = false;\n } else {\n buffer.append(\"&\").append(key).append(\"=\").append(value);\n }\n }\n String cacheUrl = url + buffer.toString();\n long nowTime = System.currentTimeMillis();\n fileName = cacheUrl + \"&\" + nowTime;\n\n cache = DiskLruCacheHelper.createCache(APP.app, URL_CACHE);\n String responseCacheData = DiskLruCacheHelper.readCacheToString(cache, cacheUrl);\n int indexOfTime = responseCacheData.indexOf(\"\\n\");\n String[] times = responseCacheData.substring(0, indexOfTime).split(\":\");\n responseCacheData = responseCacheData.substring(indexOfTime + 1);\n long diskCacheTime = Long.parseLong(times[1]);\n if (!TextUtils.isEmpty(responseCacheData) && diskCacheTime != -1 && nowTime - time <= diskCacheTime) {\n E e = new Gson().fromJson(responseCacheData, E.class);\n Response<T> cacheResponse = (Response<T>) Response.success(e);\n observer.onNext(cacheResponse);\n } else {\n cache.delete();\n cache = null;\n\n }\n } catch (Exception e) {\n if (cache != null && !cache.isClosed()) {\n try {\n cache.delete();\n } catch (IOException e1) {\n\n }\n call = null;\n }\n }\n\n\n CallDisposable disposable = new CallDisposable(call);\n observer.onSubscribe(disposable);\n\n boolean terminated = false;\n try {\n Response<T> response = call.execute();\n E e = (E) response.body();\n String responseData = new Gson().toJson(e);\n if (cache == null) {\n cache = DiskLruCacheHelper.createCache(APP.app, URL_CACHE);\n }\n DiskLruCacheHelper.writeStringToCache(cache, responseData, fileName);\n if (!disposable.isDisposed()) {\n observer.onNext(response);\n }\n if (!disposable.isDisposed()) {\n terminated = true;\n observer.onComplete();\n }\n } catch (Throwable t) {\n Exceptions.throwIfFatal(t);\n if (terminated) {\n RxJavaPlugins.onError(t);\n } else if (!disposable.isDisposed()) {\n try {\n observer.onError(t);\n } catch (Throwable inner) {\n Exceptions.throwIfFatal(inner);\n RxJavaPlugins.onError(new CompositeException(t, inner));\n }\n }\n }\n }", "public void startReplay() {\n resetMove();\n Move m;\n \n getCurrentMove().show();\n while ((m = nextMove()) != null) {\n m.show();\n }\n }", "public IReplayImpl( final Replay replay ) {\r\n\t\tthis.replay = replay;\r\n\t\tinitData = replay.initData;\r\n\t\tdetails = replay.details;\r\n\t}", "String registerObserver(StreamObserver observer);", "@NonNull\n protected abstract void retrieve(@NonNull SCMHeadObserver observer,\n @NonNull TaskListener listener)\n throws IOException, InterruptedException;", "public void replay() {\n if (currentAnimation == null) play();\n else currentAnimation.playFromStart();\n }", "public void subscribeActual(MaybeObserver<? super T> observer) {\n try {\n ((MaybeSource) ObjectHelper.requireNonNull(this.maybeSupplier.call(), \"The maybeSupplier returned a null MaybeSource\")).subscribe(observer);\n } catch (Throwable ex) {\n Exceptions.throwIfFatal(ex);\n EmptyDisposable.error(ex, (MaybeObserver<?>) observer);\n }\n }", "public void setObserver (BoardObserver obs)\n {\n _observer = obs;\n if (_observer == null) {\n // observer cleared?\n return;\n }\n\n // locate all flips, balls; inform\n _observer.newBoard();\n for (int ii=0; ii < _flips.length; ii++) {\n _observer.configureFlip(_flips[ii], ii);\n if (_flips[ii].ball != null) {\n _observer.ballAdded(_flips[ii].ball);\n }\n }\n }", "public void registerObserver(Observer observer);", "@Override\n\tpublic void onReplayFailed(Throwable cause) {\n\n\t}", "@Override\r\n public Subscription onSubscribe(final Observer<? super String> observer) {\n final Thread t = new Thread(new Runnable() {\r\n @Override\r\n public void run() {\r\n for (int i = 0; i < 75; i++) {\r\n observer.onNext(\"anotherValue_\" + i);\r\n }\r\n // After sending all values we complete the sequence\r\n observer.onCompleted();\r\n }\r\n });\r\n t.start();\r\n \r\n return new Subscription() {\r\n @Override\r\n public void unsubscribe() {\r\n // Ask the thread to stop doing work.\r\n // For this simple example it just interrupts.\r\n t.interrupt();\r\n }\r\n };\r\n }", "public void subscribe( Observer< S, Info > obs );", "@Override\n public synchronized void addTileObserver(final TileObserver observer) {\n observers = addTileObserver(observers, observer);\n }", "ReplayableHttpServletResponse getReplayableResponse();", "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 }", "@Nonnull \r\n\tpublic static <T, U> Observable<U> replay(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\t@Nonnull final Func1<? super Observable<? extends T>, ? extends Observable<U>> selector,\r\n\t\t\tfinal int bufferSize\r\n\t) {\r\n\t\treturn replay(selector.invoke(source), bufferSize);\r\n\t}", "@Nonnull \r\n\tpublic static <T, U> Observable<U> replay(\r\n\t\t\t@Nonnull final Observable<T> source,\r\n\t\t\t@Nonnull final Func1<? super Observable<? extends T>, ? extends Observable<U>> selector,\r\n\t\t\tfinal int bufferSize,\r\n\t\t\t@Nonnull final Scheduler scheduler\r\n\t) {\r\n\t\treturn replay(selector.invoke(source), bufferSize, scheduler);\r\n\t}", "public abstract IObserver getMediatedObserver();", "@Override\r\n\tpublic void registerObserver(Observer observer) {\n\t\t\r\n\t}", "void addObserver(Observer observer);", "void addObserver(Observer observer);", "@Override\n public void subscribe() {\n registerLocalObserver();\n\n loadVideos();\n }", "@Override\n\tpublic void NotifyObserver() {\n\n\t}", "@Nonnull \r\n\tpublic static <T> Observable<T> replay(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\t@Nonnull final Scheduler scheduler\r\n\t) {\r\n\t\treturn new Observable<T>() {\r\n\t\t\t/** The read-write lock. */\r\n\t\t\tfinal ReadWriteLock rwLock = new ReentrantReadWriteLock(true);\r\n\t\t\t/** The read lock for reading elements of the buffer. */\r\n\t\t\tfinal Lock readLock = rwLock.readLock();\r\n\t\t\t/** The write lock to write elements of the buffer and add new listeners. */\r\n\t\t\tfinal Lock writeLock = rwLock.writeLock();\r\n\t\t\t/** The buffer that holds the observed values so far. */\r\n\t\t\t@GuardedBy(\"rwLock\")\r\n\t\t\tfinal List<Option<T>> buffer = new ArrayList<Option<T>>();\r\n\t\t\t/** The single registration handler. */\r\n\t\t\t@GuardedBy(\"writeLock\")\r\n\t\t\tCloseable sourceClose;\r\n\t\t\t/** The set of listeners active. */\r\n\t\t\t@GuardedBy(\"writeLock\")\r\n\t\t\tSet<SingleLaneExecutor<Integer>> listeners = new HashSet<SingleLaneExecutor<Integer>>();\r\n\t\t\t@Override\r\n\t\t\tprotected void finalize() throws Throwable {\r\n\t\t\t\tCloseables.closeSilently(sourceClose);\r\n\t\t\t\tsuper.finalize();\r\n\t\t\t}\r\n\t\t\t@Override\r\n\t\t\t@Nonnull \r\n\t\t\tpublic Closeable register(@Nonnull final Observer<? super T> observer) {\r\n\t\t\t\twriteLock.lock();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (sourceClose == null) {\r\n\t\t\t\t\t\tsourceClose = source.register(new Observer<T>() {\r\n\t\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t\t * Buffer and submit the option to all registered listeners.\r\n\t\t\t\t\t\t\t * @param opt the option to submit\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\tvoid doOption(Option<T> opt) {\r\n\t\t\t\t\t\t\t\twriteLock.lock();\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tbuffer.add(opt);\r\n\t\t\t\t\t\t\t\t\tfor (SingleLaneExecutor<Integer> l : listeners) {\r\n\t\t\t\t\t\t\t\t\t\tl.add(buffer.size());\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} finally {\r\n\t\t\t\t\t\t\t\t\twriteLock.unlock();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void error(@Nonnull Throwable ex) {\r\n\t\t\t\t\t\t\t\tdoOption(Option.<T>error(ex));\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void finish() {\r\n\t\t\t\t\t\t\t\tdoOption(Option.<T>none());\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void next(T value) {\r\n\t\t\t\t\t\t\t\tdoOption(Option.some(value));\r\n\t\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} finally {\r\n\t\t\t\t\twriteLock.unlock();\r\n\t\t\t\t}\r\n\t\t\t\tfinal AtomicBoolean cancel = new AtomicBoolean();\r\n\t\t\t\tfinal SingleLaneExecutor<Integer> playback = SingleLaneExecutor.create(scheduler, new Action1<Integer>() {\r\n\t\t\t\t\t/** The local buffer reader index. */\r\n\t\t\t\t\t@GuardedBy(\"readLock\")\r\n\t\t\t\t\tint index = 0;\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic void invoke(Integer value) {\r\n\t\t\t\t\t\treadLock.lock();\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\twhile (index < value && !cancel.get()) {\r\n\t\t\t\t\t\t\t\tdispatch(observer, buffer.get(index++));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} finally {\r\n\t\t\t\t\t\t\treadLock.unlock();\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\twriteLock.lock();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tplayback.add(buffer.size());\r\n\t\t\t\t\tlisteners.add(playback);\r\n\t\t\t\t} finally {\r\n\t\t\t\t\twriteLock.unlock();\r\n\t\t\t\t}\r\n\t\t\t\tfinal Closeable c = new Closeable() {\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic void close() throws IOException {\r\n\t\t\t\t\t\tcancel.set(true);\r\n\t\t\t\t\t\twriteLock.lock();\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tlisteners.remove(playback);\r\n\t\t\t\t\t\t} finally {\r\n\t\t\t\t\t\t\twriteLock.unlock();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tCloseables.closeSilently(playback);\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\treturn c;\r\n\t\t\t}\r\n\t\t};\r\n\t}", "void addPlayerObserver(PlayerObserver observer);", "@Nonnull \r\n\tpublic static <T> Observable<T> replay(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\tfinal int bufferSize,\r\n\t\t\tfinal long timeSpan,\r\n\t\t\t@Nonnull final TimeUnit unit\r\n\t) {\r\n\t\treturn replay(source, bufferSize, timeSpan, unit, scheduler());\r\n\t}", "public void removeObserver(Observer observer);", "public abstract O getObserver();", "public void detachObserver(jObserver observer);", "void scheduleReaction( @Nonnull final Observer observer )\n {\n if ( Arez.shouldCheckInvariants() )\n {\n invariant( () -> !_pendingObservers.contains( observer ),\n () -> \"Arez-0099: Attempting to schedule observer named '\" + observer.getName() +\n \"' when observer is already pending.\" );\n }\n observer.setScheduledFlag();\n if ( observer.isHighPriority() )\n {\n _pendingObservers.addFirst( Objects.requireNonNull( observer ) );\n }\n else\n {\n _pendingObservers.add( Objects.requireNonNull( observer ) );\n }\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 execute() {\n System.out.println(\"---------- OBSERVER PATTERN ----------\");\n Subject subject = new Subject();\n\n //create observers and pass in subject they want to observe (constructor code will add them as observers to the subject)\n new ObserverA(subject);\n new ObserverB(subject);\n\n //subject data changes and automatically updates all observers...triggering their souts (reporting the changed number)\n subject.changeUnstableInt();\n }", "public static <T> void run(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\t@Nonnull final Observer<? super T> observer) throws InterruptedException {\r\n\t\tfinal CountDownLatch latch = new CountDownLatch(1);\r\n\t\tCloseable c = source.register(new DefaultObserver<T>(true) {\r\n\t\t\t@Override\r\n\t\t\tpublic void onError(@Nonnull Throwable ex) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tobserver.error(ex);\r\n\t\t\t\t} finally {\r\n\t\t\t\t\tlatch.countDown();\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 onFinish() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tobserver.finish();\r\n\t\t\t\t} finally {\r\n\t\t\t\t\tlatch.countDown();\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 onNext(T value) {\r\n\t\t\t\tobserver.next(value);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t\ttry {\r\n\t\t\tlatch.await();\r\n\t\t} finally {\r\n\t\t\tCloseables.closeSilently(c);\r\n\t\t}\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\t\t\t\tpublic void run()\n\t\t\t\t{\n\t\t\t\t\tSocket cliente = null;\n\t\t\t\t\tArrayList<Data> dataReceived;\n\t\t\t\t\tlong initialTime = System.currentTimeMillis();\n\t\t\t\t\twhile(!observer.isClosed())\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"esperando atualizacao do Subject: \");\n\t\t\t\t\t\t\tcliente = observer.accept();\n\t\t\t\t\t\t\tSystem.out.println(\"Observer conectado: \"+cliente.getInetAddress().getHostAddress());\n\t\t\t\t\t\t\tObjectInputStream input = new ObjectInputStream(cliente.getInputStream());\n\t\t\t\t\t\t\ttry \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdataReceived= (ArrayList<Data>) input.readObject();\n\t\t\t\t\t\t\t\tSystem.out.println(\"Tempo decorrido desde a ultima \"\n\t\t\t\t\t\t\t\t\t\t+ \"atualizacao \" + (System.currentTimeMillis()-initialTime));\n\t\t\t\t\t\t\t\tinitialTime = System.currentTimeMillis();\n\t\t\t\t\t\t\t\tinput.close();\n\t\t\t\t\t\t\t\tcliente.close();\n\t\t\t\t\t\t\t\tfor(Data it:dataReceived) {\n\t\t\t\t\t\t\t\t\tCliente.this.point(it.getFramePos(), it.getPosX(), it.getPosY(),\n\t\t\t\t\t\t\t\t\t\t\tit.getColor(), it.getSize());\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} catch (ClassNotFoundException e) {\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (IOException e1) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tcliente.close();\n\t\t\t\t\t\t\t\tthis.run();\n\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}", "public void addObserver(IObserver observer)\n {\n observers.add(observer);\n }", "private void setMockControlStateToReplay() {\n this.xmlRpcElementFactoryControl.replay();\n this.xmlRpcRequestParserControl.replay();\n this.xmlRpcResponseWriterControl.replay();\n this.xmlRpcServiceExporterControl.replay();\n }", "public void subscribeActual(MaybeObserver<? super T> maybeObserver) {\n this.source.subscribe(new DetachMaybeObserver(maybeObserver));\n }", "public void notifyObservers();", "public void notifyObservers();", "public void notifyObservers();", "public void setupRevive(GameView gameView)\n {\n for(ReviveObserver ro : reviveObservers)\n {\n ro.update(gameView);\n }\n //gameView.getPlayerInstance().revive();\n //gameView.resume();\n\n gameView.resume();\n\n\n\n\n\n }", "@Nonnull \r\n\tpublic static <T, U> Observable<U> replay(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\t@Nonnull final Func1<? super Observable<? extends T>, ? extends Observable<U>> selector,\r\n\t\t\tfinal int bufferSize,\r\n\t\t\tfinal long timeSpan,\r\n\t\t\t@Nonnull final TimeUnit unit,\r\n\t\t\t@Nonnull final Scheduler scheduler\r\n\t) {\r\n\t\treturn replay(selector.invoke(source), bufferSize, timeSpan, unit, scheduler);\r\n\t}", "protected void doSomeWork() {\n\n //PublishSubject就像鼠标事件,不管有没有订阅者,他都按照他的设定发事件,什么时候有订阅者,那么订阅者就从那个时候获取事件。\n //与之相反的是ReplaySubject,不管订阅者什么时候订阅,都能获取完整事件。\n PublishSubject<Integer> source = PublishSubject.create();\n source.onNext(-1);\n source.onNext(0);\n\n source.subscribe(this.<Integer>getObserver(\"First\")); // it will get 1, 2, 3, 4 and onComplete\n\n source.onNext(1);\n source.onNext(2);\n source.onNext(3);\n //source.onComplete();//如果在这里onComplete了,那么后面的订阅者只能收到onComplete事件\n\n /*\n * it will emit 4 and onComplete for second observer also.\n */\n source.subscribe(this.<Integer>getObserver(\"Second\"));\n\n source.onNext(4);\n source.onComplete();\n\n }", "@Override\n\tpublic void detach(Observer observer) {\n\t\tobs.remove(observer);\n\t}", "@Nonnull \r\n\tpublic static <T, U> Observable<U> replay(\r\n\t\t\t@Nonnull final Observable<T> source,\r\n\t\t\t@Nonnull final Func1<? super Observable<T>, ? extends Observable<U>> selector\r\n\t) {\r\n\t\treturn selector.invoke(source);\r\n\t}", "private static void createColdObservable() {\n var observable = Observable.just(1, 2, 3, 4, 5);\n\n observable.subscribe(item -> LOG.info(\"Observer 1: {}\", item));\n\n pause(1000);\n\n observable.subscribe(item -> LOG.info(\"Observer 2: {}\", item));\n }", "public void notifyObservers() {}", "public void replayCommonBehavior() {\n\t\treplay(bundleContextMock);\n\t\treplay(bundleMock);\n\t\treplay(applicationContextMock);\n\t\tthis.replayed = true;\n\t}", "public void addObserver(jObserver observer);", "public interface Observer {\n //method to update the observer, used by subject\n public void update();\n\n}", "public abstract void addObserver(IObserver anIObserver);", "@NonNull\n public final <O extends SCMHeadObserver> O fetch(@NonNull O observer,\n @CheckForNull TaskListener listener)\n throws IOException, InterruptedException {\n retrieve(observer, defaultListener(listener));\n return observer;\n }", "public void ObserverIO() {\r\n\t\twhile(running && !gameover) {\r\n\t\t\tif (engine.begin) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tToClient.writeBoolean(running);\r\n\t\t\t\t\tToClient.writeBoolean(engine.gameOver);\r\n\t\t\t\t\t// Exit the loop if game over\r\n\t\t\t\t\tif(engine.gameOver)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tturnDelta = engine.getActiveTurn();\r\n\t\t\t\t\tToClient.writeBoolean(turnDelta != recordedTurn);\r\n\t\t\t\t\tif (turnDelta != recordedTurn) {\r\n\t\t\t\t\t\tToClient.writeUTF(engine.OutputData());\r\n\t\t\t\t\t\trecordedTurn = turnDelta;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tyield();\r\n\t\t\t\t\t}\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\tSystem.out.println(\"Thread Connection lost\");\r\n\t\t\t\t\tinterrupt();\r\n\t\t\t\t} \r\n\t\t\t} else {\r\n\t\t\t\tyield();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(engine.gameOver) {\r\n\t\t\ttry {\r\n\t\t\t\tToClient.writeUTF(engine.getGameOverMessage(TYPE));\r\n\t\t\t} catch (IOException 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}", "public void mo35836a(Observer<? super V> observer) {\n try {\n Iterator it = this.f33042f.iterator();\n C12324b.m32836a(it, \"The iterator returned by other is null\");\n Iterator it2 = it;\n try {\n if (!it2.hasNext()) {\n C12459c.m32982a(observer);\n } else {\n this.f33041e.subscribe(new C12683a(observer, it2, this.f33043g));\n }\n } catch (Throwable th) {\n C12285a.m32748b(th);\n C12459c.m32985a(th, observer);\n }\n } catch (Throwable th2) {\n C12285a.m32748b(th2);\n C12459c.m32985a(th2, observer);\n }\n }", "@Override\n public void registerObserver(Observer observer) {\n observers[counterObservers++]=observer;\n\n }", "@Override\n\tpublic void Notify() {\n\t\tfor (Observer observer : obs) {\n\t\t\tobserver.update();\n\t\t}\n\t}", "public static interface Observer {\n\n\t\tpublic void turnoIniciado(TableroInmutable estadoTablero, Ficha turno);\n\t\tpublic void onMovimientoEnd(TableroInmutable estadoTablero, Ficha turno, Ficha siguiente);\n\t\tpublic void onMovimientoIncorrecto(java.lang.String explicacion, TableroInmutable estadoTablero, Ficha turno);\n\t\tpublic void onMovimientoStart(Ficha turno);\n\t\tpublic void onReset(TableroInmutable estadoInicial, Ficha turno);\n\t\tpublic void onUndo(TableroInmutable estadoTablero, Ficha turno, boolean hayMas);\n\t\tpublic void onUndoNotPossible();\n\t\tpublic void partidaTerminada(TableroInmutable tableroFinal, Ficha ganador);\n\t}", "public Ice.AsyncResult begin_addObserver(ServiceObserverPrx observer);", "boolean removeObserver(Observer observer);", "private void rxPlayView() {\n Button button = new Button(PlaygroundApplication.app());\n\n Observable<OnClickEvent> clickObservable = ViewObservable.clicks(button);\n\n clickObservable\n // Skip first click...\n .skip(1)\n .subscribe(new Action1<OnClickEvent>() {\n @Override\n public void call(OnClickEvent onClickEvent) {\n log(\"Buttonwa Clicketh\");\n }\n });\n\n // Ah, maybe it will...\n button.callOnClick();\n button.callOnClick();\n }", "@Override\n public synchronized void removeTileObserver(final TileObserver observer) {\n observers = removeTileObserver(observers, observer);\n }", "public abstract void addObserver(Observer observer);", "public void notifyObservers(Observable observable,Board board) { \n\t\tGame.ui.get(0).update(observable,board); \n\t}", "@Nonnull \r\n\tpublic static <T, U> Observable<U> replay(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\t@Nonnull final Func1<? super Observable<? extends T>, ? extends Observable<U>> selector,\r\n\t\t\tfinal int bufferSize,\r\n\t\t\tfinal long timeSpan,\r\n\t\t\t@Nonnull final TimeUnit unit\r\n\t) {\r\n\t\treturn replay(selector.invoke(source), bufferSize, timeSpan, unit);\r\n\t}", "public ReactivePreferences intercept(ReactivePreferences prefs) {\n\t\treturn prefs;\n\t}", "public void startReloading() {\n reload.setTimeOffset(1);\n reload.play();\n }", "public interface CBIObservable {\n public void reload();\n}", "void notifyObservers();", "void notifyObservers();", "@Override\n void detach(Observer observer) {\n observers.remove(observer);\n }", "@Override\n\tpublic void attach(Observer observer) {\n\t\tobs.add(observer);\n\t}", "public void setUpObserver(Observable observable) {\n observable.addObserver(this);\n }", "private interface Observable{\n void registerObserver(Observer observer);\n void removeObserver(Observer observer);\n void updateScore(String score);\n void notifyObservers();\n void notifyObservers(String errorMessage);\n }", "public void replay(int cycles) {\n play(cycles);\n }", "public interface Observer<T> {\n\n void modified(T obj);\n}", "public static Observable<String> myObserve()\r\n {\r\n return Observable.<String>create(subscriber -> {\r\n MessageSource source = new MessageSource();\r\n source.setListener(\r\n new MessageListener<String>() {\r\n public void onMessage(String message)\r\n {\r\n subscriber.onNext(message);\r\n }\r\n }\r\n );\r\n subscriber.setCancellable(source::stop);\r\n source.start();\r\n });\r\n }", "void removeObserver(EntityObserver observer);", "public void detach(Observer observer) {\n\t\tsubscribers.remove(observer);\n\t}" ]
[ "0.74213403", "0.6571156", "0.6098495", "0.5965146", "0.58885235", "0.5839954", "0.5822746", "0.56979156", "0.5654034", "0.5579722", "0.54445344", "0.53664", "0.53651977", "0.5355315", "0.52461827", "0.5230057", "0.5185858", "0.5127896", "0.5106174", "0.5093706", "0.5079831", "0.50774837", "0.5067829", "0.5066649", "0.5037403", "0.50356835", "0.5032781", "0.50207776", "0.4951785", "0.49515107", "0.49514112", "0.49318737", "0.49295667", "0.4910793", "0.4900444", "0.48935372", "0.48728898", "0.48656023", "0.48351544", "0.48077917", "0.48002", "0.48002", "0.47944883", "0.47753865", "0.47730663", "0.4766443", "0.4765864", "0.4759418", "0.4757115", "0.47561732", "0.4755411", "0.47267777", "0.4725491", "0.46989435", "0.4684759", "0.46841297", "0.46580705", "0.46556416", "0.4652224", "0.46481487", "0.46481487", "0.46481487", "0.46441916", "0.46336868", "0.4631306", "0.46062773", "0.45991918", "0.45940357", "0.45927304", "0.45867223", "0.45824504", "0.4573633", "0.45721415", "0.456428", "0.45569614", "0.4554956", "0.45525873", "0.45466685", "0.45455956", "0.45449147", "0.45399106", "0.4538419", "0.45359397", "0.4535776", "0.4530188", "0.45229188", "0.4519001", "0.45171142", "0.45053193", "0.45047447", "0.45047447", "0.45026112", "0.44882873", "0.4485162", "0.44839466", "0.4479444", "0.44748646", "0.44742203", "0.4471817", "0.44690946" ]
0.74693376
0
Replay the buffered values from an index position and return a new index
I replayObserverFromIndex( I idx, SubjectSubscriptionManager.SubjectObserver<? super T> observer);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Integer mutate(int index);", "private long newBufferAndOffset(E[] nextBuffer, long index)\r\n/* 222: */ {\r\n/* 223:475 */ this.consumerBuffer = nextBuffer;\r\n/* 224:476 */ this.consumerMask = (LinkedArrayQueueUtil.length(nextBuffer) - 2 << 1);\r\n/* 225:477 */ return LinkedArrayQueueUtil.modifiedCalcElementOffset(index, this.consumerMask);\r\n/* 226: */ }", "protected abstract int readInternal(int index);", "int getReadPosition(int index) {\n/* 170 */ return index - this.origPos + this.readerIndex;\n/* */ }", "private E newBufferPoll(E[] nextBuffer, long index)\r\n/* 200: */ {\r\n/* 201:451 */ long offset = newBufferAndOffset(nextBuffer, index);\r\n/* 202:452 */ E n = UnsafeRefArrayAccess.lvElement(nextBuffer, offset);\r\n/* 203:453 */ if (n == null) {\r\n/* 204:455 */ throw new IllegalStateException(\"new buffer must have at least one element\");\r\n/* 205: */ }\r\n/* 206:457 */ UnsafeRefArrayAccess.soElement(nextBuffer, offset, null);\r\n/* 207:458 */ soConsumerIndex(index + 2L);\r\n/* 208:459 */ return n;\r\n/* 209: */ }", "I replayObserverFromIndexTest(\n I idx, SubjectSubscriptionManager.SubjectObserver<? super T> observer, long now);", "private int newIndex() {\n //return indexes.remove(0);\n return random.nextInt(81);\n }", "protected int realIndex(int index) {\n return index & (buf.length -1);\n }", "@Override\n public int previousIndex()\n {\n return idx-1;\n }", "@Override\n public synchronized int getCurrentIndex() {\n return mCurrentIndex;\n }", "private int next(int index) {\n return (index + 2) & mask;\n }", "private int getRealIndex()\r\n\t{\r\n\t\treturn index - 1;\r\n\t}", "void setReadPosition(int minus) {\n/* 159 */ this.pos -= minus;\n/* 160 */ this.readerIndex = getReadPosition(this.pos);\n/* 161 */ this.buffer.readerIndex(this.readerIndex);\n/* */ }", "public static void update() {\n if (!isEnd()) index++;\n state++;\n return;\n }", "com.google.protobuf.ByteString getCached(int index);", "public void onIndexReset();", "public void testCurrPos() {\n for (int i = 0; i < 10; i++) {\n test1.append(new Buffer(i, rec));\n }\n for (int i = 0; i < 10; i++) {\n test1.next();\n }\n assertEquals(10, test1.currPos());\n }", "public T get(int pos) {\n // System.out.println(\"RA.get pos=\" + pos + \" nextPos=\" + nextPos + \" nextWrite=\" + nextWrite +\n // \" count=\" + count);\n while (pos >= nextPos) {\n if (count == buffer.length) {\n @SuppressWarnings(\"unchecked\")\n T[] newBuffer =\n (T[])\n new Resettable\n [ArrayUtil.oversize(1 + count, RamUsageEstimator.NUM_BYTES_OBJECT_REF)];\n // System.out.println(\" grow length=\" + newBuffer.length);\n System.arraycopy(buffer, nextWrite, newBuffer, 0, buffer.length - nextWrite);\n System.arraycopy(buffer, 0, newBuffer, buffer.length - nextWrite, nextWrite);\n for (int i = buffer.length; i < newBuffer.length; i++) {\n newBuffer[i] = newInstance();\n }\n nextWrite = buffer.length;\n buffer = newBuffer;\n }\n if (nextWrite == buffer.length) {\n nextWrite = 0;\n }\n // Should have already been reset:\n nextWrite++;\n nextPos++;\n count++;\n }\n assert inBounds(pos) : \"pos=\" + pos + \" nextPos=\" + nextPos + \" count=\" + count;\n final int index = getIndex(pos);\n // System.out.println(\" pos=\" + pos + \" nextPos=\" + nextPos + \" -> index=\" + index);\n // assert buffer[index].pos == pos;\n return buffer[index];\n }", "@Override\n public int nextIndex()\n {\n return idx+1; \n }", "private void setIndices() {\r\n\r\n\t\t// Index where dry sample is written\r\n\t writeIndex = 0;\r\n\t\treadIndexBLow = 0;\r\n\t\treadIndexBHigh = 0;\r\n\r\n\t\tif (sweepUp) {\r\n\t\t\t// Sweeping upward, start at max delay\r\n\t\t readIndexALow = AudioConstants.SAMPLEBUFFERSIZE;\r\n\t\t\r\n\t\t}\telse\t{\r\n\t\t\r\n\t\t\t// Sweeping downward, start at min delay\r\n\t\t\tif (numberOfChannels == 1)\r\n\t\t\t\treadIndexALow = delayBufferSize - 2;\r\n\t\t\telse\r\n\t\t\t\treadIndexALow = delayBufferSize - 4;\r\n\t\t}\r\n\t\t// Initialize other read ptr\r\n\t\tif (numberOfChannels == 1)\r\n\t\t\treadIndexAHigh = readIndexALow + 1;\r\n\t\telse\r\n\t\t\treadIndexAHigh = readIndexALow + 2;\r\n\t}", "private int nextIndex() {\n return ThreadLocalRandom.current().nextInt(currentIndex, tracks.size());\n }", "@Override\n public void get(long position, ByteBuffer dst, int count) {\n final ByteBuffer bd = this.bb.duplicate();\n bd.limit(NumbersUtils.asInt(position + count));\n bd.position(NumbersUtils.asInt(position));\n dst.limit(count);\n dst.position(0);\n dst.put(bd);\n dst.flip();\n }", "public int getSeekIndex() {\n return getIntegerProperty(\"Index\");\n }", "public abstract void reset(int index);", "public void replay() {\n for (InnerDisposable<T> rp : (InnerDisposable[]) this.observers.get()) {\n this.buffer.replay(rp);\n }\n }", "private static <T> void backtracking(T[] arr, int index, List<T[]> result) {\n if (index == arr.length) {\n result.add(arr.clone());\n }\n for (int i = index; i < arr.length; i++) {\n swap(index, i, arr);\n backtracking(arr, index + 1, result);\n swap(index, i, arr);\n }\n }", "private static void copyRemainder(ArrayList<Integer> inputList, int inputIndex, ArrayList<Integer> outList, int outIndex) {\n while (inputIndex < inputList.size()) {\n outList.set(outIndex, inputList.get(inputIndex));\n\n inputIndex++;\n outIndex++;\n }\n }", "public abstract void get(long position, ByteBuffer dst, int count);", "public void updateIndex() {\n int i = this.index;\n if (i == -1 || i > HashBiMap.this.size || !Objects.equal(HashBiMap.this.keys[this.index], this.key)) {\n this.index = HashBiMap.this.findEntryByKey(this.key);\n }\n }", "public int getPosition(int index);", "private E newBufferPeek(E[] nextBuffer, long index)\r\n/* 212: */ {\r\n/* 213:464 */ long offset = newBufferAndOffset(nextBuffer, index);\r\n/* 214:465 */ E n = UnsafeRefArrayAccess.lvElement(nextBuffer, offset);\r\n/* 215:466 */ if (null == n) {\r\n/* 216:468 */ throw new IllegalStateException(\"new buffer must have at least one element\");\r\n/* 217: */ }\r\n/* 218:470 */ return n;\r\n/* 219: */ }", "public Record getRecord(int index) throws IOException{\n\t\t//buff.checkBuffers(index);\n\t\t//buff=new BufferPool();\n\t\t//System.out.println(\"f\");\n\t\tRecord rec = buff.checkBuffers(index);\n\t\t//System.out.println(\"f\");\n\t\tif(rec.getKey()==-1){\n\t\tRecord recs = buff.doLRU(index);\n\t\t\treturn recs;\n\t\t}\n\t\t\n\t\t//buff.checkBuff(index)\n\t\t\n\t\t\n\t\treturn rec;\n\t\t\n\t\t//looks to see if index is in buffer length.\n\t\t//if not. checks which buffer is dirty\n\t\t//if none, still write buffer back to file if all are full\n\t\t//then read in what hasnt been read from index\n\t\t\n\t\t\n\t}", "int readerIndex();", "protected int arrayIndex(long windowIndex) {\n return (int) (windowIndex % length());\n }", "public ByteBuffer internalNioBuffer(int index, int length)\r\n/* 311: */ {\r\n/* 312:325 */ checkIndex(index, length);\r\n/* 313:326 */ return (ByteBuffer)internalNioBuffer().clear().position(index).limit(index + length);\r\n/* 314: */ }", "public void flipIndexes() {\n int temp = index1;\n index1 = index2;\n index2 = temp;\n }", "public void incrementCurrentIndex() {\n currentIndex++;\n }", "public int getIndex() { return this.index; }", "@Override\n public void get(long position, ByteBuffer dst, int count) {\n final ByteBuffer bd = this.getOrCreateBackingBB(position).duplicate();\n final long offset = this.getBackingBBOffset();\n bd.limit(NumbersUtils.asInt(position-offset + count));\n bd.position(NumbersUtils.asInt(position-offset));\n dst.limit(count);\n dst.position(0);\n dst.put(bd);\n dst.flip();\n }", "abstract int get(int index);", "private void goForwardOne() \n {\n if (m_bufferOffset_ < 0) {\n // we're working on the source and not normalizing. fast path.\n // note Thai pre-vowel reordering uses buffer too\n m_source_.setIndex(m_source_.getIndex() + 1);\n }\n else {\n // we are in the buffer, buffer offset will never be 0 here\n m_bufferOffset_ ++;\n }\n }", "private int getNext(int index) {\n return index + (index & -index);\n }", "private int calculate(int index) {\n return (head + index) % data.length;\n }", "private Buffer getBufferByPosition(int pos)\n throws IOException\n {\n return getBuffer(pos / BLOCK_SIZE);\n }", "public abstract void updateIndex();", "@Override\n protected int nextIndex() {\n if (_expectedSize != _hash.size()) {\n throw new ConcurrentModificationException();\n }\n\n byte[] states = _hash._states;\n int i = _index;\n while (i-- > 0 && (states[i] != TPrimitiveHash.FULL)) ;\n return i;\n }", "public PhyphoxBuffer getCopyFromIndex(int startIndex) {\n\t\treturn new PhyphoxBuffer(this, startIndex);\n\t}", "private void changeCurIndex() {\n\t\tint TexID=-1;\r\n\t\tif(ApplicationInfo.Destination == Constants.TO_FRONT)\r\n\t\t{\r\n\t\t\tCurIndex=++CurIndex >= mApplications.size()? 0 : CurIndex;\r\n\t\t\tif((TexID=mApplications.get(getPreIndex()).getReady()) != -1)\r\n\t\t\t\tunSetTexID(TexID);\r\n \t\t\tmApplications.get(getPreIndex()).setReady(-1);\r\n\t\t}\r\n\t\telse if(ApplicationInfo.Destination == Constants.TO_BACK)\r\n\t\t{\r\n\t\t\tCurIndex=--CurIndex < 0? mApplications.size()-1 : CurIndex;\r\n\t\t\tif((TexID=mApplications.get(getNextIndex()).getReady()) != -1)\r\n\t\t\t\tunSetTexID(TexID);\r\n\t\t\tmApplications.get(getNextIndex()).setReady(-1);\r\n\t\t}\r\n\t\tLog.d(TAG, \"changeCurIndex :\"+CurIndex);\r\n\t}", "void indexReset();", "protected void soConsumerIndex(long newValue)\r\n/* 27: */ {\r\n/* 28:139 */ C_INDEX_UPDATER.lazySet(this, newValue);\r\n/* 29: */ }", "public int get(int index);", "private int consumeElement(int index) throws InterruptedException {\n\t while (sharedBuffer.isEmpty()) {\r\n\t synchronized (sharedBuffer) {\r\n\t \tString msg=\"Queue is empty \" + Thread.currentThread().getName()\r\n + \" is waiting , size: \" + sharedBuffer.size();\r\n\t \t\r\n\t // \t System.out.println(msg);\r\n\t\t writeLn(msg);\r\n\r\n\t sharedBuffer.wait();\r\n\t \r\n\t }\r\n\t }\r\n\r\n\t // Consume data from Buffer and Notify Producer that Data has been consumed from Buffer\r\n\t synchronized (sharedBuffer) {\r\n\t \tsharedBuffer.notifyAll();\r\n\t \t\r\n\t return (Integer) sharedBuffer.poll();\r\n\t }\r\n\t }", "public interface ReplayState<T, I> {\n /** @return true if the subject has reached a terminal state. */\n boolean terminated();\n /**\n * Replay contents to the given observer.\n * @param observer the receiver of events\n * @return true if the subject has caught up\n */\n boolean replayObserver(SubjectSubscriptionManager.SubjectObserver<? super T> observer);\n /**\n * Replay the buffered values from an index position and return a new index\n * @param idx the current index position\n * @param observer the receiver of events\n * @return the new index position\n */\n I replayObserverFromIndex(\n I idx, SubjectSubscriptionManager.SubjectObserver<? super T> observer);\n /**\n * Replay the buffered values from an index position while testing for stale entries and return a new index\n * @param idx the current index position\n * @param observer the receiver of events\n * @return the new index position\n */\n I replayObserverFromIndexTest(\n I idx, SubjectSubscriptionManager.SubjectObserver<? super T> observer, long now);\n /**\n * Add an OnNext value to the buffer\n * @param value the value to add\n */\n void next(T value);\n /**\n * Add an OnError exception and terminate the subject\n * @param e the exception to add\n */\n void error(Throwable e);\n /**\n * Add an OnCompleted exception and terminate the subject\n */\n void complete();\n /**\n * @return the number of non-terminal values in the replay buffer.\n */\n int size();\n /**\n * @return true if the replay buffer is empty of non-terminal values\n */\n boolean isEmpty();\n\n /**\n * Copy the current values (minus any terminal value) from the buffer into the array\n * or create a new array if there isn't enough room.\n * @param a the array to fill in\n * @return the array or a new array containing the current values\n */\n T[] toArray(T[] a);\n /**\n * Returns the latest value that has been buffered or null if no such value\n * present.\n * @return the latest value buffered or null if none\n */\n T latest();\n}", "public RingBuffer<T> publishReadIndex(int num_elements_read) {\n this.ri=realIndex(this.ri + num_elements_read);\n\n lock.lock();\n try {\n this.count-=num_elements_read;\n not_full.signalAll(); // wake up all writers\n return this;\n }\n finally {\n lock.unlock();\n }\n }", "private void replayNextOp() {\n\t\topNum++;\n\t\tif (opNum > ops.length) {\n\t\t\topNum = -1;\n\t\t\tupdate();\n\t\t} else if (!getExited()) {\n\t\t\tjavax.swing.SwingUtilities.invokeLater(doReplayNextOp);\n\t\t}\n\t}", "public void getNextRawSamples( double[] rawBuffer, int offset, int nSamples )\n throws IndexOutOfBoundsException;", "public ByteBuf getBytes(int index, ByteBuffer dst)\r\n/* 239: */ {\r\n/* 240:256 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 241:257 */ return super.getBytes(index, dst);\r\n/* 242: */ }", "public int getDataIndexAndIncrement() {\n\t\tint x = dataIndex;\n\t\tnext();\n\t\treturn x;\n\t}", "@Override\n\tpublic IBasicObject getAccessedAtIdx() {\n\t\treturn heldObj.getAccessedAtIdx();\n\t}", "public Item get(int index) {\n int track = nextFirst; //It does not modify nextFirst\n track = moveForward(track, index + 1);\n return items[track];\n }", "public ByteBuf setInt(int index, int value)\r\n/* 289: */ {\r\n/* 290:304 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 291:305 */ return super.setInt(index, value);\r\n/* 292: */ }", "public ByteBuf getBytes(int index, ByteBuf dst)\r\n/* 209: */ {\r\n/* 210:226 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 211:227 */ return super.getBytes(index, dst);\r\n/* 212: */ }", "public abstract int getSourceIndex(int index);", "private void advanceCommitIndex() {\n // 获取quorum matchIndex\n int peerNum = configuration.getServersList().size();\n long[] matchIndexes = new long[peerNum];\n int i = 0;\n for (RaftProto.Server server : configuration.getServersList()) {\n if (server.getServerId() != localServer.getServerId()) {\n Peer peer = peerMap.get(server.getServerId());\n matchIndexes[i++] = peer.getMatchIndex();\n }\n }\n matchIndexes[i] = raftLog.getLastLogIndex();\n Arrays.sort(matchIndexes);\n long newCommitIndex = matchIndexes[peerNum / 2];\n LOG.debug(\"newCommitIndex={}, oldCommitIndex={}\", newCommitIndex, commitIndex);\n if (raftLog.getEntryTerm(newCommitIndex) != currentTerm) {\n LOG.debug(\"newCommitIndexTerm={}, currentTerm={}\",\n raftLog.getEntryTerm(newCommitIndex), currentTerm);\n return;\n }\n\n if (commitIndex >= newCommitIndex) {\n return;\n }\n long oldCommitIndex = commitIndex;\n commitIndex = newCommitIndex;\n raftLog.updateMetaData(currentTerm, null, raftLog.getFirstLogIndex(), commitIndex);\n // 同步到状态机\n for (long index = oldCommitIndex + 1; index <= newCommitIndex; index++) {\n RaftProto.LogEntry entry = raftLog.getEntry(index);\n if (entry.getType() == RaftProto.EntryType.ENTRY_TYPE_DATA) {\n stateMachine.apply(entry.getData().toByteArray());\n } else if (entry.getType() == RaftProto.EntryType.ENTRY_TYPE_CONFIGURATION) {\n applyConfiguration(entry);\n }\n }\n lastAppliedIndex = commitIndex;\n LOG.debug(\"commitIndex={} lastAppliedIndex={}\", commitIndex, lastAppliedIndex);\n commitIndexCondition.signalAll();\n }", "public void Reset() \r\n {\r\n _index = -1;\r\n }", "public ByteBuf getBytes(int index, byte[] dst)\r\n/* 227: */ {\r\n/* 228:244 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 229:245 */ return super.getBytes(index, dst);\r\n/* 230: */ }", "public void set(long index);", "public void reset() {\n index = 0;\n }", "private int forwardPosition() {\n\t\treturn (position + 1) % (maxPosition + 1);\n\t}", "public int[] getIndexCopy(){\r\n \tint[] indcopy = new int[this.nrow];\r\n \tfor(int i=0; i<this.nrow; i++){\r\n \t\tindcopy[i]=this.index[i];\r\n \t}\r\n \treturn indcopy;\r\n \t}", "private int adjustIndex(int index)\n {\n int max = values.length;\n return ((index % max) + max) % max;\n }", "public final int getIndex(){\n return index_;\n }", "public ByteBuf copy(int index, int length)\r\n/* 691: */ {\r\n/* 692:700 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 693:701 */ return super.copy(index, length);\r\n/* 694: */ }", "int toIndex(Position pos);", "public void onIndexUpdate();", "public T get(int index) {\n return items[(nextFirst + 1 + index) % capacity];\n }", "private int increment(int index) {\n\t\treturn (++index < this.capacity) ? index : 0;\n\t}", "public int resetToNextPoint() {\n if (curPointIndex + 1 >= numPoints)\n return ++curPointIndex;\n int diff = curPointIndex ^ (curPointIndex + 1);\n int pos = 0; // Position of the bit that is examined.\n while ((diff >> pos) != 0) {\n if (((diff >> pos) & 1) != 0) {\n cachedCurPoint[0] ^= 1 << (outDigits - numCols + pos);\n for (int j = 1; j <= dim; j++)\n cachedCurPoint[j] ^= genMat[(j-1) * numCols + pos];\n }\n pos++;\n }\n curCoordIndex = 0;\n return ++curPointIndex;\n }", "protected final int nextIndex() {\n\t\t\tif ( _expectedSize != TOrderedHashMap.this.size() ) { throw new ConcurrentModificationException(); }\n\n\t\t\tObject[] set = TOrderedHashMap.this._set;\n\t\t\tint i = _index + 1;\n\t\t\twhile (i <= _lastInsertOrderIndex &&\n\t\t\t\t(_indicesByInsertOrder[i] == EMPTY || set[_indicesByInsertOrder[i]] == TObjectHash.FREE || set[_indicesByInsertOrder[i]] == TObjectHash.REMOVED)) {\n\t\t\t\ti++;\n\t\t\t}\n\t\t\treturn i <= _lastInsertOrderIndex ? i : -1;\n\t\t}", "public abstract long getIndex();", "protected int populateBuffer()\n {\n interlock.beginReading();\n // System.out.println(\"populateBuffer: 2\");\n return byteBuffer.limit();\n }", "protected final int getIndex() {\n return index;\n }", "@java.lang.Override\n public int getIndex() {\n return index_;\n }", "public synchronized void resetCurrentIndex()\n {\n // Reset the current index to start from 1 (speechgen0001.mp3)\n currentIndex = 1;\n }", "private int addBuffer( FloatBuffer directBuffer, FloatBuffer newBuffer ) {\n int oldPosition = directBuffer.position();\n if ( ( directBuffer.capacity() - oldPosition ) >= newBuffer.capacity() ) {\n directBuffer.put( newBuffer );\n } else {\n oldPosition = -1;\n }\n return oldPosition;\n }", "public int getHolder() {\n return this.pIndex;\n }", "public void incrementIndex() {\n\t\tindex++;\n\t\tif (nextItem != null) {\n\t\t\tnextItem.incrementIndex();\n\t\t}\n\t}", "private void rewind() {\n currentPos = markPos;\n }", "public int getIndex() { \n\t\t\treturn currIndex;\n\t\t}", "public static void bgfx_update_dynamic_index_buffer(@NativeType(\"bgfx_dynamic_index_buffer_handle_t\") short _handle, @NativeType(\"uint32_t\") int _startIndex, @NativeType(\"bgfx_memory_t const *\") BGFXMemory _mem) {\n nbgfx_update_dynamic_index_buffer(_handle, _startIndex, _mem.address());\n }", "public int[][] iterate()\n {\n Random r = new Random();\n for (int i = 0; i < buffersize; i++) {\n if (unprocessed.isEmpty()) \n {\n finished = true;\n break;\n }\n int randomIndex = r.nextInt(unprocessed.size());\n nodemap.changeColor(unprocessed.get(randomIndex), 1);\n unprocessed.remove(randomIndex);\n }\n return nodemap.getIntMap();\n }", "public byte[] getBuffer () {\n\t\t\t\n\t\t\tif (index < 0)\n\t\t\t\treturn null;\n\n\t\t\tint len = index;\n\t\t\tbyte[] b = new byte[len+1];\n\t\t\tfor (int k=0; k <= len; k++)\n\t\t\t\tb[k] = buf[k];\n\n\t\t\treturn b;\n\t\t}", "Buffer slice();", "int sampleOffset();", "@Override\n\tpublic void reset(int index) {\n\t\tif (sorted) {\n\t\t\tsortedReader.reset(index);\n\t\t}\n\t}", "public ByteBuffer getIndicesBuffer() {\n \treturn indicesBuf;\n }", "@Override\n\t\tpublic int previousIndex() {\n\t\t\treturn 0;\n\t\t}", "public final int getPos() { return i; }", "public ByteBuf setInt(int index, int value)\r\n/* 476: */ {\r\n/* 477:490 */ ensureAccessible();\r\n/* 478:491 */ _setInt(index, value);\r\n/* 479:492 */ return this;\r\n/* 480: */ }", "public void reset() {\n this.index = this.startIndex;\n }" ]
[ "0.59935766", "0.5838666", "0.5830717", "0.5786531", "0.5779041", "0.57525325", "0.57290465", "0.5725044", "0.57248867", "0.56862164", "0.56792796", "0.5674554", "0.56134075", "0.5610091", "0.559925", "0.55871373", "0.55718386", "0.5551345", "0.55442286", "0.5505092", "0.54786986", "0.54718465", "0.54154956", "0.53862685", "0.5383813", "0.53662777", "0.5362193", "0.5352507", "0.532501", "0.53208965", "0.5314421", "0.53019154", "0.5301659", "0.5294782", "0.52840436", "0.5279501", "0.52791435", "0.52593255", "0.5259216", "0.5253762", "0.52495795", "0.5236138", "0.5235892", "0.5234267", "0.52281636", "0.52059126", "0.51997554", "0.51982456", "0.5196694", "0.51955026", "0.5192419", "0.5190265", "0.51841694", "0.51805264", "0.517681", "0.5163321", "0.5148451", "0.51483786", "0.51442975", "0.514085", "0.51405257", "0.5140112", "0.5129239", "0.51250625", "0.51233816", "0.51159257", "0.511237", "0.5098359", "0.5084118", "0.5079187", "0.5078311", "0.50732654", "0.5069995", "0.50675863", "0.5066584", "0.50629807", "0.5062549", "0.5050368", "0.5047838", "0.50412667", "0.5038623", "0.5036573", "0.503484", "0.50346506", "0.5030854", "0.50300294", "0.5028206", "0.5024124", "0.5024059", "0.50218815", "0.5016324", "0.50120103", "0.50118905", "0.5011887", "0.5008616", "0.5002662", "0.500218", "0.49919233", "0.4989655", "0.49890363" ]
0.5848894
1
Replay the buffered values from an index position while testing for stale entries and return a new index
I replayObserverFromIndexTest( I idx, SubjectSubscriptionManager.SubjectObserver<? super T> observer, long now);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateIndex() {\n int i = this.index;\n if (i == -1 || i > HashBiMap.this.size || !Objects.equal(HashBiMap.this.keys[this.index], this.key)) {\n this.index = HashBiMap.this.findEntryByKey(this.key);\n }\n }", "protected final int nextIndex() {\n\t\t\tif ( _expectedSize != TOrderedHashMap.this.size() ) { throw new ConcurrentModificationException(); }\n\n\t\t\tObject[] set = TOrderedHashMap.this._set;\n\t\t\tint i = _index + 1;\n\t\t\twhile (i <= _lastInsertOrderIndex &&\n\t\t\t\t(_indicesByInsertOrder[i] == EMPTY || set[_indicesByInsertOrder[i]] == TObjectHash.FREE || set[_indicesByInsertOrder[i]] == TObjectHash.REMOVED)) {\n\t\t\t\ti++;\n\t\t\t}\n\t\t\treturn i <= _lastInsertOrderIndex ? i : -1;\n\t\t}", "@Override\n protected int nextIndex() {\n if (_expectedSize != _hash.size()) {\n throw new ConcurrentModificationException();\n }\n\n byte[] states = _hash._states;\n int i = _index;\n while (i-- > 0 && (states[i] != TPrimitiveHash.FULL)) ;\n return i;\n }", "private void skipStaleEntries()\n {\n while (this.index < keys.size() && !HashBijectiveMap.this.containsKey(keys.get(this.index)))\n this.index++;\n }", "public static void update() {\n if (!isEnd()) index++;\n state++;\n return;\n }", "private E newBufferPoll(E[] nextBuffer, long index)\r\n/* 200: */ {\r\n/* 201:451 */ long offset = newBufferAndOffset(nextBuffer, index);\r\n/* 202:452 */ E n = UnsafeRefArrayAccess.lvElement(nextBuffer, offset);\r\n/* 203:453 */ if (n == null) {\r\n/* 204:455 */ throw new IllegalStateException(\"new buffer must have at least one element\");\r\n/* 205: */ }\r\n/* 206:457 */ UnsafeRefArrayAccess.soElement(nextBuffer, offset, null);\r\n/* 207:458 */ soConsumerIndex(index + 2L);\r\n/* 208:459 */ return n;\r\n/* 209: */ }", "private long newBufferAndOffset(E[] nextBuffer, long index)\r\n/* 222: */ {\r\n/* 223:475 */ this.consumerBuffer = nextBuffer;\r\n/* 224:476 */ this.consumerMask = (LinkedArrayQueueUtil.length(nextBuffer) - 2 << 1);\r\n/* 225:477 */ return LinkedArrayQueueUtil.modifiedCalcElementOffset(index, this.consumerMask);\r\n/* 226: */ }", "com.google.protobuf.ByteString getCached(int index);", "protected void soConsumerIndex(long newValue)\r\n/* 27: */ {\r\n/* 28:139 */ C_INDEX_UPDATER.lazySet(this, newValue);\r\n/* 29: */ }", "public Integer mutate(int index);", "public Record getRecord(int index) throws IOException{\n\t\t//buff.checkBuffers(index);\n\t\t//buff=new BufferPool();\n\t\t//System.out.println(\"f\");\n\t\tRecord rec = buff.checkBuffers(index);\n\t\t//System.out.println(\"f\");\n\t\tif(rec.getKey()==-1){\n\t\tRecord recs = buff.doLRU(index);\n\t\t\treturn recs;\n\t\t}\n\t\t\n\t\t//buff.checkBuff(index)\n\t\t\n\t\t\n\t\treturn rec;\n\t\t\n\t\t//looks to see if index is in buffer length.\n\t\t//if not. checks which buffer is dirty\n\t\t//if none, still write buffer back to file if all are full\n\t\t//then read in what hasnt been read from index\n\t\t\n\t\t\n\t}", "public void onIndexReset();", "private int newIndex() {\n //return indexes.remove(0);\n return random.nextInt(81);\n }", "protected abstract int readInternal(int index);", "private void advanceCommitIndex() {\n // 获取quorum matchIndex\n int peerNum = configuration.getServersList().size();\n long[] matchIndexes = new long[peerNum];\n int i = 0;\n for (RaftProto.Server server : configuration.getServersList()) {\n if (server.getServerId() != localServer.getServerId()) {\n Peer peer = peerMap.get(server.getServerId());\n matchIndexes[i++] = peer.getMatchIndex();\n }\n }\n matchIndexes[i] = raftLog.getLastLogIndex();\n Arrays.sort(matchIndexes);\n long newCommitIndex = matchIndexes[peerNum / 2];\n LOG.debug(\"newCommitIndex={}, oldCommitIndex={}\", newCommitIndex, commitIndex);\n if (raftLog.getEntryTerm(newCommitIndex) != currentTerm) {\n LOG.debug(\"newCommitIndexTerm={}, currentTerm={}\",\n raftLog.getEntryTerm(newCommitIndex), currentTerm);\n return;\n }\n\n if (commitIndex >= newCommitIndex) {\n return;\n }\n long oldCommitIndex = commitIndex;\n commitIndex = newCommitIndex;\n raftLog.updateMetaData(currentTerm, null, raftLog.getFirstLogIndex(), commitIndex);\n // 同步到状态机\n for (long index = oldCommitIndex + 1; index <= newCommitIndex; index++) {\n RaftProto.LogEntry entry = raftLog.getEntry(index);\n if (entry.getType() == RaftProto.EntryType.ENTRY_TYPE_DATA) {\n stateMachine.apply(entry.getData().toByteArray());\n } else if (entry.getType() == RaftProto.EntryType.ENTRY_TYPE_CONFIGURATION) {\n applyConfiguration(entry);\n }\n }\n lastAppliedIndex = commitIndex;\n LOG.debug(\"commitIndex={} lastAppliedIndex={}\", commitIndex, lastAppliedIndex);\n commitIndexCondition.signalAll();\n }", "int cacheRowsWhenScan();", "public T get(int pos) {\n // System.out.println(\"RA.get pos=\" + pos + \" nextPos=\" + nextPos + \" nextWrite=\" + nextWrite +\n // \" count=\" + count);\n while (pos >= nextPos) {\n if (count == buffer.length) {\n @SuppressWarnings(\"unchecked\")\n T[] newBuffer =\n (T[])\n new Resettable\n [ArrayUtil.oversize(1 + count, RamUsageEstimator.NUM_BYTES_OBJECT_REF)];\n // System.out.println(\" grow length=\" + newBuffer.length);\n System.arraycopy(buffer, nextWrite, newBuffer, 0, buffer.length - nextWrite);\n System.arraycopy(buffer, 0, newBuffer, buffer.length - nextWrite, nextWrite);\n for (int i = buffer.length; i < newBuffer.length; i++) {\n newBuffer[i] = newInstance();\n }\n nextWrite = buffer.length;\n buffer = newBuffer;\n }\n if (nextWrite == buffer.length) {\n nextWrite = 0;\n }\n // Should have already been reset:\n nextWrite++;\n nextPos++;\n count++;\n }\n assert inBounds(pos) : \"pos=\" + pos + \" nextPos=\" + nextPos + \" count=\" + count;\n final int index = getIndex(pos);\n // System.out.println(\" pos=\" + pos + \" nextPos=\" + nextPos + \" -> index=\" + index);\n // assert buffer[index].pos == pos;\n return buffer[index];\n }", "private void ensureRowCached(int rowIndex) {\n if(!isRowCached(rowIndex)) {\n //HAVE TO FETCH DATA FROM THE REMOTE STORE\n \n //SET THE toIndex AND fromIndex VARIABLES\n \n //TEST IF THE USER IS DESCENDING THE TABLE\n if (rowIndex >= lastRequiredFetchRowIndex) {\n fromIndex = rowIndex;\n toIndex = rowIndex+chunkSize;\n\t\n\t\t\t\ttry {\n if(toIndex > tableDescription.getRowCount()) {\n toIndex = tableDescription.getRowCount();\n }\n\t\t\t\t}\n\t\t\t\tcatch(Exception ex) {\n\t\t\t\t\tex.printStackTrace();\t\n\t\t\t\t}\n }\n \n //USER IS ASCENDING THE TABLE\n else {\n fromIndex = rowIndex-chunkSize;\n if(fromIndex < 0) {\n fromIndex = 0;\n }\n toIndex = rowIndex+1;\n }\n \n Object[][] rows = null;\n //RETRIEVE THE DATA\n try {\n rows = tableDataSource.retrieveRows(fromIndex, toIndex);\n }\n catch(Exception ex) {\n ex.printStackTrace();\n throw new RuntimeException(\"Problem occurred retrieving table data \\n\");\n }\n \n //ADD THE DATA TO THE CACHE\n for(int i = 0; i < rows.length; i++) {\n //SET THE VALUE IN THE DATA ARRAY\n data[writePositionIndex] = rows[i];\n \n //CREATE AN INDEX TO THE NEW CACHED DATA\n tableIndex = fromIndex+i;\n rowIndexLookup[writePositionIndex] = tableIndex;\n \n //CLOCK UP writePositionIndex AND REZERO IF NECESSARY\n if(writePositionIndex == (maximumCacheSize-1)) {\n writePositionIndex = 0;\n }\n else {\n writePositionIndex++;\n }\n lastRequiredFetchRowIndex = rowIndex;\n }\n }\n }", "public abstract void updateIndex();", "protected int realIndex(int index) {\n return index & (buf.length -1);\n }", "private E newBufferPeek(E[] nextBuffer, long index)\r\n/* 212: */ {\r\n/* 213:464 */ long offset = newBufferAndOffset(nextBuffer, index);\r\n/* 214:465 */ E n = UnsafeRefArrayAccess.lvElement(nextBuffer, offset);\r\n/* 215:466 */ if (null == n) {\r\n/* 216:468 */ throw new IllegalStateException(\"new buffer must have at least one element\");\r\n/* 217: */ }\r\n/* 218:470 */ return n;\r\n/* 219: */ }", "I replayObserverFromIndex(\n I idx, SubjectSubscriptionManager.SubjectObserver<? super T> observer);", "@Override\r\n public void extractIndexBetween(List<HistoricalIndexElement> index, long start, long end) {\n historicalBuffersLock.lock();\r\n try {\r\n for (Block block : historicalBlocks) {\r\n HistoricalIndexElement[] elements = block.index.toSortedElements();\r\n for (HistoricalIndexElement historicalIndexElement : elements) {\r\n long time = historicalIndexElement.getTime();\r\n if (time >= start && time < end) {\r\n index.add(historicalIndexElement);\r\n }\r\n }\r\n }\r\n } finally {\r\n historicalBuffersLock.unlock();\r\n }\r\n\r\n if (currentBlock != null) {\r\n // Now the current block\r\n HistoricalIndexElement[] elements = currentBlock.index.toSortedElements();\r\n for (HistoricalIndexElement historicalIndexElement : elements) {\r\n long time = historicalIndexElement.getTime();\r\n if (time >= start && time < end) {\r\n index.add(historicalIndexElement);\r\n }\r\n }\r\n }\r\n\r\n }", "private int getRealIndex()\r\n\t{\r\n\t\treturn index - 1;\r\n\t}", "@Override\n public synchronized int getCurrentIndex() {\n return mCurrentIndex;\n }", "@Override\n public int previousIndex()\n {\n return idx-1;\n }", "public void testCurrPos() {\n for (int i = 0; i < 10; i++) {\n test1.append(new Buffer(i, rec));\n }\n for (int i = 0; i < 10; i++) {\n test1.next();\n }\n assertEquals(10, test1.currPos());\n }", "@Test\n public void testPartialCheckpointNewIndexRows() throws Exception {\n String cacheName = DEFAULT_CACHE_NAME;\n\n IgniteEx n = prepareNodeToCreateNewIndex(cacheName, 100_000, false);\n\n String idxName = \"IDX0\";\n SlowdownBuildIndexConsumer slowdownIdxCreateConsumer = addSlowdownIdxCreateConsumer(n, idxName, 10);\n\n IgniteInternalFuture<List<List<?>>> createIdxFut = createIdxAsync(n.cache(cacheName), idxName);\n\n slowdownIdxCreateConsumer.startBuildIdxFut.get(getTestTimeout());\n\n checkInitStatus(n, cacheName, false, 1);\n\n String reason = getTestIgniteInstanceName();\n IgniteInternalFuture<Void> awaitBeforeCpBeginFut = awaitBeforeCheckpointBeginAsync(n, reason);\n IgniteInternalFuture<Void> disableCpFut = enableCheckpointsAsync(n, reason, false);\n\n awaitBeforeCpBeginFut.get(getTestTimeout());\n slowdownIdxCreateConsumer.finishBuildIdxFut.onDone();\n\n disableCpFut.get(getTestTimeout());\n slowdownIdxCreateConsumer.sleepTime.set(0);\n\n createIdxFut.get(getTestTimeout());\n\n checkCompletedStatus(n, cacheName);\n\n stopGrid(0);\n\n IndexesRebuildTaskEx.prepareBeforeNodeStart();\n StopBuildIndexConsumer stopRebuildIdxConsumer = addStopRebuildIndexConsumer(n, cacheName);\n\n n = startGrid(0);\n stopRebuildIdxConsumer.startBuildIdxFut.get(getTestTimeout());\n\n IgniteInternalFuture<?> rebIdxFut = indexRebuildFuture(n, CU.cacheId(cacheName));\n assertNotNull(rebIdxFut);\n\n checkInitStatus(n, cacheName, true, 0);\n assertTrue(allIndexes(n).containsKey(new QueryIndexKey(cacheName, idxName)));\n\n stopRebuildIdxConsumer.finishBuildIdxFut.onDone();\n rebIdxFut.get(getTestTimeout());\n\n forceCheckpoint();\n\n checkNoStatus(n, cacheName);\n assertEquals(100_000, selectPersonByName(n.cache(cacheName)).size());\n }", "@Override\n public int nextIndex()\n {\n return idx+1; \n }", "@Test\n public void numberOfIndexValuesStatIsUpdatedWhenEntryInvalidated() throws Exception {\n IndexStatistics stats = index.getStatistics();\n region.invalidate(\"3\");\n assertEquals(3, stats.getNumberOfValues());\n SelectResults results = region.query(\"status = 'active'\");\n assertEquals(2, results.size());\n }", "@Override\n\tpublic IBasicObject getAccessedAtIdx() {\n\t\treturn heldObj.getAccessedAtIdx();\n\t}", "void indexReset();", "public void onIndexUpdate();", "private int next(int index) {\n return (index + 2) & mask;\n }", "private final void advance() {\n if (currentIterator == null) {\n currentIterator = intMaps[index].entrySet().iterator();\n } else {\n if (!currentIterator.hasNext()) {\n // we want advance to next iterator only when this iterator is exhausted\n if (index < intMaps.length - 1) {\n // we can advance to next iterator only if currentIterator is not the last iterator\n ++index;\n if (!fetched[index]) {\n GetAllCustomMap.this.fetchValuesForIndex(index);\n }\n currentIterator = intMaps[index].entrySet().iterator();\n } else {\n // we can not advance to next iterator because this iterator is the last iterator\n }\n } else {\n // we do not want to advance to next iterator because this iterator is not fully exhausted\n }\n }\n }", "Object getAfterMiss(ThreadLocal<?> key) {\n Object[] table = this.table;\n int index = key.hash & mask;\n\n // If the first slot is empty, the search is over.\n if (table[index] == null) {\n Object value = key.initialValue();\n\n // If the table is still the same and the slot is still empty...\n if (this.table == table && table[index] == null) {\n table[index] = key.reference;\n table[index + 1] = value;\n size++;\n\n cleanUp();\n return value;\n }\n\n // The table changed during initialValue().\n put(key, value);\n return value;\n }\n\n // Keep track of first tombstone. That's where we want to go back\n // and add an entry if necessary.\n int firstTombstone = -1;\n\n // Continue search.\n for (index = next(index);; index = next(index)) {\n Object reference = table[index];\n if (reference == key.reference) {\n return table[index + 1];\n }\n\n // If no entry was found...\n if (reference == null) {\n Object value = key.initialValue();\n\n // If the table is still the same...\n if (this.table == table) {\n // If we passed a tombstone and that slot still\n // contains a tombstone...\n if (firstTombstone > -1\n && table[firstTombstone] == TOMBSTONE) {\n table[firstTombstone] = key.reference;\n table[firstTombstone + 1] = value;\n tombstones--;\n size++;\n\n // No need to clean up here. We aren't filling\n // in a null slot.\n return value;\n }\n\n // If this slot is still empty...\n if (table[index] == null) {\n table[index] = key.reference;\n table[index + 1] = value;\n size++;\n\n cleanUp();\n return value;\n }\n }\n\n // The table changed during initialValue().\n put(key, value);\n return value;\n }\n\n if (firstTombstone == -1 && reference == TOMBSTONE) {\n // Keep track of this tombstone so we can overwrite it.\n firstTombstone = index;\n }\n }\n }", "private static <T> void backtracking(T[] arr, int index, List<T[]> result) {\n if (index == arr.length) {\n result.add(arr.clone());\n }\n for (int i = index; i < arr.length; i++) {\n swap(index, i, arr);\n backtracking(arr, index + 1, result);\n swap(index, i, arr);\n }\n }", "int getReadPosition(int index) {\n/* 170 */ return index - this.origPos + this.readerIndex;\n/* */ }", "private void resetCurrentMemoryIndex() throws Exception {\n // by using the globalParameters, the memory index can startup counters etc.\n // we set the documentCount to ensure all documents are given a unique number.\n tupleFlowParameters.getJSON().set(\"documentNumberOffset\", this.globalDocumentCount);\n currentMemoryIndex = new MemoryIndex(tupleFlowParameters);\n }", "protected int insertionIndex(int key) {\r\n\t\tint hash = key & 0x7fffffff;\r\n\t\tint index = this.hashFunc1(hash) * FREE.length;\r\n\t\t// int stepSize = hashFunc2(hash);\r\n\t\tbyte[] cur = new byte[4];\r\n\t\tkeys.position(index);\r\n\t\tkeys.get(cur);\r\n int storehash=(cur[0] << 24)+ ((cur[1] & 0xFF) << 16)+ ((cur[2] & 0xFF) << 8)+ (cur[3] & 0xFF);\r\n\r\n\t\tif (Arrays.equals(cur, FREE)) {\r\n\t\t\treturn index; // empty, all done\r\n\t\t} else if (storehash==key) {\r\n\t\t\treturn -index - 1; // already stored\r\n\t\t} else { // already FULL or REMOVED, must probe\r\n\t\t\t// compute the double hash\r\n\t\t\tfinal int probe = (1 + (hash % (size - 2))) * FREE.length;\r\n\r\n\t\t\t// if the slot we landed on is FULL (but not removed), probe\r\n\t\t\t// until we find an empty slot, a REMOVED slot, or an element\r\n\t\t\t// equal to the one we are trying to insert.\r\n\t\t\t// finding an empty slot means that the value is not present\r\n\t\t\t// and that we should use that slot as the insertion point;\r\n\t\t\t// finding a REMOVED slot means that we need to keep searching,\r\n\t\t\t// however we want to remember the offset of that REMOVED slot\r\n\t\t\t// so we can reuse it in case a \"new\" insertion (i.e. not an update)\r\n\t\t\t// is possible.\r\n\t\t\t// finding a matching value means that we've found that our desired\r\n\t\t\t// key is already in the table\r\n\t\t\tif (!Arrays.equals(cur, REMOVED)) {\r\n\t\t\t\t// starting at the natural offset, probe until we find an\r\n\t\t\t\t// offset that isn't full.\r\n\t\t\t\tdo {\r\n\t\t\t\t\tindex += (probe); // add the step\r\n\t\t\t\t\tindex %= (size * FREE.length); // for wraparound\r\n\t\t\t\t\tcur = new byte[FREE.length];\r\n\t\t\t\t\tkeys.position(index);\r\n\t\t\t\t\tkeys.get(cur);\r\n\t\t\t\t} while (!Arrays.equals(cur, FREE)\r\n\t\t\t\t\t\t&& !Arrays.equals(cur, REMOVED)\r\n\t\t\t\t\t\t&& storehash!=hash);\r\n\t\t\t}\r\n\r\n\t\t\t// if the index we found was removed: continue probing until we\r\n\t\t\t// locate a free location or an element which equal()s the\r\n\t\t\t// one we have.\r\n\t\t\tif (Arrays.equals(cur, REMOVED)) {\r\n\t\t\t\tint firstRemoved = index;\r\n\t\t\t\twhile (!Arrays.equals(cur, FREE)\r\n\t\t\t\t\t\t&& (Arrays.equals(cur, REMOVED) || storehash!=hash)) {\r\n\t\t\t\t\tindex += (probe); // add the step\r\n\t\t\t\t\tindex %= (size * FREE.length); // for wraparound\r\n\t\t\t\t\tcur = new byte[FREE.length];\r\n\t\t\t\t\tkeys.position(index);\r\n\t\t\t\t\tkeys.get(cur);\r\n\t\t\t\t}\r\n\t\t\t\t// NOTE: cur cannot == REMOVED in this block\r\n\t\t\t\treturn (!Arrays.equals(cur, FREE)) ? -index - 1 : firstRemoved;\r\n\t\t\t}\r\n\t\t\t// if it's full, the key is already stored\r\n\t\t\t// NOTE: cur cannot equal REMOVE here (would have retuned already\r\n\t\t\t// (see above)\r\n\t\t\treturn storehash!=hash ? -index - 1 : index;\r\n\t\t}\r\n\t}", "private void readIndex() throws IOException {\n\t\t\tif (this.keys != null)\n\t\t\t\treturn;\n\t\t\tkeys = new HashMap<K, Long>(1024);\n\t\t\ttry {\n\t\t\t\twhile (index.hasNext()) {\n\t\t\t\t\tPair<K, Long> pair;// = new Pair<K, Long>(index.getSchema());\n\t\t\t\t\tpair = index.next();\n\t\t\t\t\tkeys.put(pair.key(), pair.value());\n\t\t\t\t\tif (firstKey == null)\n\t\t\t\t\t\tfirstKey = pair.key();\n\t\t\t\t\tfinalKey = pair.key();\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\n\t\t\t}finally {\n\t\t\t\tindexClosed = true;\n\t\t\t\tindex.close();\n\t\t\t}\n\t\t}", "public static void updateLaterIndices(int[] currentPredIndices, int indexUpdated, int lastPredInd) {\n for (int index = indexUpdated; index < lastPredInd; index++) {\n currentPredIndices[index+1] = currentPredIndices[index]+1;\n }\n }", "public abstract long getIndex();", "public int getSeekIndex() {\n return getIntegerProperty(\"Index\");\n }", "@Override\n\tpublic void reset(int index) {\n\t\tif (sorted) {\n\t\t\tsortedReader.reset(index);\n\t\t}\n\t}", "IndexData finLastQueuedData();", "@Test public void skipsRedundantIndexingInATrace() throws IOException {\n Span[] trace = new Span[101];\n trace[0] = TestObjects.CLIENT_SPAN;\n long rootTimestamp = trace[0].timestampAsLong();\n\n for (int i = 0; i < 100; i++) {\n trace[i + 1] =\n Span.newBuilder()\n .traceId(trace[0].traceId())\n .parentId(trace[0].id())\n .id(i + 1)\n .name(String.valueOf(i + 1))\n .timestamp(rootTimestamp + i * 1000L) // child span timestamps happen 1 ms later\n .addAnnotation(trace[0].annotations().get(0).timestamp() + i * 1000, \"bar\")\n .build();\n }\n\n accept(storage.spanConsumer(), trace);\n assertThat(rowCount(Tables.ANNOTATIONS_INDEX)).isEqualTo(5L);\n assertThat(rowCount(Tables.SERVICE_REMOTE_SERVICE_NAME_INDEX)).isEqualTo(1L);\n assertThat(rowCount(Tables.SERVICE_NAME_INDEX)).isEqualTo(1L);\n assertThat(rowCount(Tables.SERVICE_SPAN_NAME_INDEX)).isEqualTo(1L);\n\n // redundant store doesn't change the indexes\n accept(storage.spanConsumer(), trace);\n assertThat(rowCount(Tables.ANNOTATIONS_INDEX)).isEqualTo(5L);\n assertThat(rowCount(Tables.SERVICE_REMOTE_SERVICE_NAME_INDEX)).isEqualTo(1L);\n assertThat(rowCount(Tables.SERVICE_NAME_INDEX)).isEqualTo(1L);\n assertThat(rowCount(Tables.SERVICE_SPAN_NAME_INDEX)).isEqualTo(1L);\n }", "public static void bgfx_update_dynamic_index_buffer(@NativeType(\"bgfx_dynamic_index_buffer_handle_t\") short _handle, @NativeType(\"uint32_t\") int _startIndex, @NativeType(\"bgfx_memory_t const *\") BGFXMemory _mem) {\n nbgfx_update_dynamic_index_buffer(_handle, _startIndex, _mem.address());\n }", "public RingBuffer<T> publishReadIndex(int num_elements_read) {\n this.ri=realIndex(this.ri + num_elements_read);\n\n lock.lock();\n try {\n this.count-=num_elements_read;\n not_full.signalAll(); // wake up all writers\n return this;\n }\n finally {\n lock.unlock();\n }\n }", "public void taskIndexReset(){\n String queryCommand = \"SELECT * FROM \" + TABLE_NAME;\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor cursor = db.rawQuery(queryCommand, null);\n int i =0;\n if (cursor.moveToFirst()) {\n do {//id, label, time\n ContentValues values = new ContentValues();\n String oldid=cursor.getString(0);\n values.put(KEY_ID,String.valueOf(i));\n i++;\n values.put(KEY_LABEL, cursor.getString(1));\n String timestamp = cursor.getString(2);\n values.put(KEY_TIME, timestamp);\n db.update(TABLE_NAME, values, KEY_TIME+\" = ?\",\n new String[] { String.valueOf(timestamp) });\n } while (cursor.moveToNext());\n }\n }", "@Test\n public void testRandomAccessSameCache()\n {\n doStressTest(\"IdxTestRASC\", getCacheName0(), getCacheName0(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(oKeyNatural, Base.getRandom().nextInt(20));\n }\n },\n /*nServers*/1, /*cRollingRestart*/0);\n }", "public void replay() {\n for (InnerDisposable<T> rp : (InnerDisposable[]) this.observers.get()) {\n this.buffer.replay(rp);\n }\n }", "private int nextIndex() {\n return ThreadLocalRandom.current().nextInt(currentIndex, tracks.size());\n }", "private SAMRecord markDuplicatesAndGetTheNextAvailable() {\n\n // Check if there are any we can flush output buffer\n { // NB: braces to limit the scope of 'record'\n final SAMRecord record = flush();\n if (null != record) return record;\n }\n\n // Check if there are any more records to read in\n if (!backingIterator.hasNext()) { // no more records to read in\n\n // Check if there are any more to mark\n if (toMarkQueue.isEmpty()) {\n // check if there are any that can be outputted\n if (outputBuffer.isEmpty()) {\n return null;\n } // no need to flush; no records in the queue and buffer\n } else {\n // force marking duplicates on the remaining records\n tryPollingTheToMarkQueue(true, null);\n }\n\n /* Since we have no more records to read in, and no more records that need duplicate marking run, we\n update our coordinate to past the end of the reference\n */\n referenceIndex = header.getSequenceDictionary().getSequences().size();\n\n /* Now we recurse, so that we can flush from the outputBuffer until it is empty, then return null when\n * all of the input, queue, and buffer are empty */\n return markDuplicatesAndGetTheNextAvailable();\n }\n\n /* We need to retrieve more records from the input iterator and duplicate mark, until we can return one that\n * has been through duplicate marking.\n */\n while (backingIterator.hasNext()) {\n\n // NB: we could get rid of this if we made nextRecord into a list...\n // NB: we do not actually remove this record from the backing iterator until much later, to help with processing unmapped reads at the EOF\n SAMRecord record = backingIterator.peek(); // peek: used for unmapped reads\n final SamRecordWithOrdinal samRecordWithOrdinal = new SamRecordWithOrdinalAndSetDuplicateReadFlag(record, backingIteratorRecordIndex);\n\n ReadEndsForMateCigar readEnds = null;\n boolean performedChunkAndMarkTheDuplicates = false;\n\n // remove duplicate information\n record.setDuplicateReadFlag(false);\n\n /* Check for pairs that have both ends mapped and missing mate cigar. */\n if (ignoreDueToMissingMateCigar(samRecordWithOrdinal)) {\n continue;\n }\n\n // check for an unmapped read\n if (record.getReadUnmappedFlag()) {\n // unmapped reads at the end of the file!\n if (-1 == record.getReferenceIndex()) {\n // NB: this may call markDuplicatesAndGetTheNextAvailable if this is the first time a EOF unmapped record has been seen\n return nextIfRecordIsUnmappedAtEOF(record);\n } else if (!record.isSecondaryOrSupplementary()) {\n // update metrics\n final DuplicationMetrics metrics = getMetrics(record);\n ++metrics.UNMAPPED_READS;\n }\n // we will check for unmapped reads later so as not to add them to mark queue\n } else {\n // If not already set, this sets the minimum distance to twice the read length, or 100, whichever is larger\n if (-1 == toMarkQueue.getToMarkQueueMinimumDistance()) {\n // use twice the first read's length\n toMarkQueue.setToMarkQueueMinimumDistance(Math.max(2 * record.getReadBases().length, 100));\n }\n\n // build a read end for use in the toMarkQueue\n readEnds = new ReadEndsForMateCigar(header, samRecordWithOrdinal, opticalDuplicateFinder, libraryIdGenerator.getLibraryId(samRecordWithOrdinal.getRecord()));\n\n // check that the minimumDistance was not too small\n checkForMinimumDistanceFailure(readEnds);\n\n /*\n * If we can do some duplicate marking, lets do it!\n * IMPORTANT: this does not flush the to-mark-queue, so the minimum distance needs to be set for us to infer\n * which records will never be supplemented (i.e. are non-duplicate).\n */\n performedChunkAndMarkTheDuplicates = tryPollingTheToMarkQueue(false, readEnds);\n }\n\n // We can now remove the record from the input\n backingIterator.next();\n\n // Add this to the outputBuffer so it can be tracked. It will not be available to emit until it has been through duplicate marking.\n addRecordToTheOutputBuffer(samRecordWithOrdinal);\n backingIteratorRecordIndex++; // Each record is has an index and is emitted in the same order. This helps that.\n\n // We do not consider secondary, supplementary, or unmapped alignments for duplicate marking. We can thus mark that duplicate marking on them has been completed.\n final DuplicationMetrics metrics = getMetrics(record);\n if (record.isSecondaryOrSupplementary() || record.getReadUnmappedFlag()) {\n outputBuffer.setResultState(samRecordWithOrdinal, false);\n if(record.isSecondaryOrSupplementary()){\n ++metrics.SECONDARY_OR_SUPPLEMENTARY_RDS;\n }\n } else {\n // Bring the simple metrics up to date\n if (!record.getReadPairedFlag() || record.getMateUnmappedFlag()) {\n ++metrics.UNPAIRED_READS_EXAMINED;\n } else {\n ++metrics.READ_PAIRS_EXAMINED; // will need to be divided by 2 at the end\n }\n\n // Add the record for duplicate marking, which may in fact cause it to be duplicate marked or stored for later\n toMarkQueue.add(readEnds, outputBuffer, getMetrics(readEnds.getRecord()));\n }\n\n // Check if there are any we can flush, which happens if we just performed duplicate marking\n if (performedChunkAndMarkTheDuplicates) {\n record = flush();\n if (null != record) return record;\n }\n }\n\n // try again, as we may have records we can flush, or we want to see if we are at the EOF\n return markDuplicatesAndGetTheNextAvailable();\n }", "private void updateBlockBuffer() {\n for (Block b : blockBuffer) {\n if (++b.ttl > BLOCK_CACHE_THRESH) {\n blockBuffer.remove(b);\n }\n }\n\n prevBlockBufferSize = blockBuffer.size();\n }", "public ByteBuffer internalNioBuffer(int index, int length)\r\n/* 311: */ {\r\n/* 312:325 */ checkIndex(index, length);\r\n/* 313:326 */ return (ByteBuffer)internalNioBuffer().clear().position(index).limit(index + length);\r\n/* 314: */ }", "abstract int get(int index);", "public interface ReplayState<T, I> {\n /** @return true if the subject has reached a terminal state. */\n boolean terminated();\n /**\n * Replay contents to the given observer.\n * @param observer the receiver of events\n * @return true if the subject has caught up\n */\n boolean replayObserver(SubjectSubscriptionManager.SubjectObserver<? super T> observer);\n /**\n * Replay the buffered values from an index position and return a new index\n * @param idx the current index position\n * @param observer the receiver of events\n * @return the new index position\n */\n I replayObserverFromIndex(\n I idx, SubjectSubscriptionManager.SubjectObserver<? super T> observer);\n /**\n * Replay the buffered values from an index position while testing for stale entries and return a new index\n * @param idx the current index position\n * @param observer the receiver of events\n * @return the new index position\n */\n I replayObserverFromIndexTest(\n I idx, SubjectSubscriptionManager.SubjectObserver<? super T> observer, long now);\n /**\n * Add an OnNext value to the buffer\n * @param value the value to add\n */\n void next(T value);\n /**\n * Add an OnError exception and terminate the subject\n * @param e the exception to add\n */\n void error(Throwable e);\n /**\n * Add an OnCompleted exception and terminate the subject\n */\n void complete();\n /**\n * @return the number of non-terminal values in the replay buffer.\n */\n int size();\n /**\n * @return true if the replay buffer is empty of non-terminal values\n */\n boolean isEmpty();\n\n /**\n * Copy the current values (minus any terminal value) from the buffer into the array\n * or create a new array if there isn't enough room.\n * @param a the array to fill in\n * @return the array or a new array containing the current values\n */\n T[] toArray(T[] a);\n /**\n * Returns the latest value that has been buffered or null if no such value\n * present.\n * @return the latest value buffered or null if none\n */\n T latest();\n}", "public Item get(int index) {\n int track = nextFirst; //It does not modify nextFirst\n track = moveForward(track, index + 1);\n return items[track];\n }", "@Test\n\t@Transactional\n\t@DirtiesContext\n\tpublic void testRestart() throws Exception {\n\n\t\tgetAsItemStream(reader).open(executionContext);\n\t\t\n\t\tFoo foo1 = reader.read();\n\t\tassertEquals(1, foo1.getValue());\n\n\t\tFoo foo2 = reader.read();\n\t\tassertEquals(2, foo2.getValue());\n\n\t\tgetAsItemStream(reader).update(executionContext);\n\t\n\t\tgetAsItemStream(reader).close();\n\n\t\t// create new input source\n\t\treader = createItemReader();\n\n\t\tgetAsItemStream(reader).open(executionContext);\n\n\t\tFoo fooAfterRestart = reader.read();\n\t\tassertEquals(3, fooAfterRestart.getValue());\n\t}", "private void setIndices() {\r\n\r\n\t\t// Index where dry sample is written\r\n\t writeIndex = 0;\r\n\t\treadIndexBLow = 0;\r\n\t\treadIndexBHigh = 0;\r\n\r\n\t\tif (sweepUp) {\r\n\t\t\t// Sweeping upward, start at max delay\r\n\t\t readIndexALow = AudioConstants.SAMPLEBUFFERSIZE;\r\n\t\t\r\n\t\t}\telse\t{\r\n\t\t\r\n\t\t\t// Sweeping downward, start at min delay\r\n\t\t\tif (numberOfChannels == 1)\r\n\t\t\t\treadIndexALow = delayBufferSize - 2;\r\n\t\t\telse\r\n\t\t\t\treadIndexALow = delayBufferSize - 4;\r\n\t\t}\r\n\t\t// Initialize other read ptr\r\n\t\tif (numberOfChannels == 1)\r\n\t\t\treadIndexAHigh = readIndexALow + 1;\r\n\t\telse\r\n\t\t\treadIndexAHigh = readIndexALow + 2;\r\n\t}", "public void set(long index);", "private void flushCurrentIndexBlock() throws IOException {\n if (currentMemoryIndex.documentsInIndex() < 1) {\n return;\n }\n\n logger.info(\"Flushing current memory Index. id = \" + indexBlockCount);\n\n final MemoryIndex flushingMemoryIndex = currentMemoryIndex;\n final File shardFolder = getNextIndexShardFolder(1);\n\n try {\n // reset the current index\n // - this makes the flush operation thread safe while continuing to add new documents.\n resetCurrentMemoryIndex();\n } catch (Exception ex) {\n throw new IOException(ex);\n }\n\n try {\n // first flush the index to disk\n FlushToDisk.flushMemoryIndex(flushingMemoryIndex, shardFolder.getAbsolutePath(), false);\n\n // indicate that the flushing part of this thread is done\n synchronized (geometricParts) {\n // add flushed index to the set of bins -- needs to be a synconeous action\n geometricParts.add(0, shardFolder.getAbsolutePath());\n updateIndex();\n flushingMemoryIndex.close();\n }\n\n } catch (IOException e) {\n logger.severe(e.toString());\n }\n }", "com.google.search.now.wire.feed.mockserver.MockServerProto.MockUpdate getMockUpdates(int index);", "public int next() {\n moveToNextIndex();\n return _hash._set[_index];\n }", "public int getIndex() { return this.index; }", "public void Reset() \r\n {\r\n _index = -1;\r\n }", "public void flipIndexes() {\n int temp = index1;\n index1 = index2;\n index2 = temp;\n }", "public abstract void reset(int index);", "ServerToB.SeenInfo getSeenInfo(int index);", "private void reIndex()\n {\n for(int i = 0; i < NodeList.size(); i++)\n NodeList.get(i).setID(i);\n ID = NodeList.size();\n }", "@Override\n public Map<Chunk.Id<?>, Storage.Index> getIndices(final Address start, final Address end) throws IOException, InterruptedException {\n Map<Chunk.Id<?>, Storage.Index> indices = this.cache.getIndices(start, end);\n // System.out.println(\"hit \" + this.hit + \" miss \" + this.miss);\n if (indices != null) {\n // this.hit++;\n return indices;\n } else {\n // this.miss++;\n indices = this.base.getIndices(start, end);\n this.cache.add(start, end, new HashMap<>(indices)); // 防御的複製。\n return indices;\n }\n }", "public ByteBuf getBytes(int index, ByteBuf dst)\r\n/* 209: */ {\r\n/* 210:226 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 211:227 */ return super.getBytes(index, dst);\r\n/* 212: */ }", "private int getNext(int index) {\n return index + (index & -index);\n }", "public void setSwapArrayElements(int borrowedIndex) \n\t{\n\t\tint localIntHolder = 0; \n\t\tString localStringHolder = \"\";\n\t\tdouble localDoubleHolder = 0.0;\n\n\t\tif(orderTotals[borrowedIndex] > 0.0) \n\t\t{\n\t\t\tlocalIntHolder = itemIDs[borrowedIndex];\n\t\t\titemIDs[borrowedIndex] = itemIDs[borrowedIndex + 1];\n\t\t\titemIDs[borrowedIndex + 1] = localIntHolder;\n\n\t\t\tlocalStringHolder = itemNames[borrowedIndex];\n\t\t\titemNames[borrowedIndex] = itemNames[borrowedIndex + 1];\n\t\t\titemNames[borrowedIndex + 1] = localStringHolder;\n\n\t\t\tlocalDoubleHolder = itemPrices[borrowedIndex];\n\t\t\titemPrices[borrowedIndex] = itemPrices[borrowedIndex + 1];\n\t\t\titemPrices[borrowedIndex + 1] = localDoubleHolder;\n\n\t\t\tlocalIntHolder = orderQuantity[borrowedIndex];\n\t\t\torderQuantity[borrowedIndex] = orderQuantity[borrowedIndex + 1];\n\t\t\torderQuantity[borrowedIndex + 1] = localIntHolder; \n\n\t\t\tlocalDoubleHolder = orderTotals[borrowedIndex];\n\t\t\torderTotals[borrowedIndex] = orderTotals[borrowedIndex + 1];\n\t\t\torderTotals[borrowedIndex + 1] = localDoubleHolder;\n\n\t\t}\n\t\telse \n\t\t{\n\n\t\t\tlocalIntHolder = itemIDs[borrowedIndex];\n\t\t\titemIDs[borrowedIndex] = itemIDs[borrowedIndex + 1];\n\t\t\titemIDs[borrowedIndex + 1] = localIntHolder;\n\n\t\t\tlocalStringHolder = itemNames[borrowedIndex];\n\t\t\titemNames[borrowedIndex] = itemNames[borrowedIndex + 1];\n\t\t\titemNames[borrowedIndex + 1] = localStringHolder;\n\n\t\t\tlocalDoubleHolder = itemPrices[borrowedIndex];\n\t\t\titemPrices[borrowedIndex] = itemPrices[borrowedIndex + 1];\n\t\t\titemPrices[borrowedIndex + 1] = localDoubleHolder;\n\n\t\t\tlocalIntHolder = inStockCounts[borrowedIndex];\n\t\t\tinStockCounts[borrowedIndex] = inStockCounts[borrowedIndex + 1];\n\t\t\tinStockCounts[borrowedIndex + 1] = localIntHolder;\n\t\t}\n\t}", "public ByteBuf getBytes(int index, ByteBuffer dst)\r\n/* 239: */ {\r\n/* 240:256 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 241:257 */ return super.getBytes(index, dst);\r\n/* 242: */ }", "protected final void moveToNextIndex() {\n\t\t\t// doing the assignment && < 0 in one line shaves\n\t\t\t// 3 opcodes...\n\t\t\tif ( (_index = nextIndex()) < 0 ) { throw new NoSuchElementException(); }\n\t\t}", "private void goForwardOne() \n {\n if (m_bufferOffset_ < 0) {\n // we're working on the source and not normalizing. fast path.\n // note Thai pre-vowel reordering uses buffer too\n m_source_.setIndex(m_source_.getIndex() + 1);\n }\n else {\n // we are in the buffer, buffer offset will never be 0 here\n m_bufferOffset_ ++;\n }\n }", "private int increment(int index) {\n\t\treturn (++index < this.capacity) ? index : 0;\n\t}", "public T get(int index) {\n return items[(nextFirst + 1 + index) % capacity];\n }", "private Iterable<Entry<K, V>> snapShot(int startIndex, K stop) {\n\t\tDoublyLinkedList<Entry<K, V>> buffer = new DoublyLinkedList<>();\n\t\tint j = startIndex;\n\t\twhile ( j < map.size() && (stop == null || stop.compareTo(map.get(j).getKey()) > 0 )) {\n\t\t\tbuffer.addLast(map.get(j++));\n\t\t}\n\t\treturn buffer;\n\t}", "public boolean get(long index);", "@Test\n public void testPreservesLocksAtOrAfterCutoff() throws BackendException {\n final long cutoff = 10L;\n\n Entry currentLock = StaticArrayEntry.of(codec.toLockCol(cutoff,\n defaultLockRid), BufferUtil.getIntBuffer(0));\n Entry futureLock = StaticArrayEntry.of(codec.toLockCol(cutoff + 1,\n defaultLockRid), BufferUtil.getIntBuffer(0));\n EntryList locks = StaticArrayEntryList.of(currentLock, futureLock);\n\n // Don't increment cutoff: lockCol is exactly at the cutoff timestamp\n del = new StandardLockCleanerRunnable(store, kc, tx, codec, cutoff);\n\n expect(store.getSlice(eq(ksq), eq(tx))).andReturn(locks);\n\n ctrl.replay();\n del.run();\n }", "@Test\n\tpublic void cursorDirtyRead() throws IOException {\n\t\tfinal ArangoCursor<VPackSlice> cursor = arango.db().query(\"FOR i IN 1..4 RETURN i\",\n\t\t\tnew AqlQueryOptions().batchSize(1).allowDirtyRead(true), VPackSlice.class);\n\t\t// get the initial result\n\t\tassertThat(cursor.hasNext(), is(true));\n\t\tassertThat(cursor.next().isInteger(), is(true));\n\t\t// get the second batch\n\t\tassertThat(cursor.hasNext(), is(true));\n\t\tassertThat(cursor.next().isInteger(), is(true));\n\t\t// close the cursor before fetching the all batches\n\t\tcursor.close();\n\t}", "private SAMRecord flush() {\n // Check that there is at least one record in the coordinate-sorted buffer, and that the head record has been through duplicate-marking\n while (!outputBuffer.isEmpty() && outputBuffer.canEmit()) {\n // the buffer contains wrapped SAMRecords, which we want to unwrap\n final SAMRecord record = outputBuffer.next().getRecord();\n\n // If this read is a duplicate, do we want to remove it (continue the loop) or return it for emission?\n if (!removeDuplicates || !record.getDuplicateReadFlag()) {\n return record;\n }\n }\n return null;\n }", "protected void checkpoint() {\n checkpoint = internalBuffer().readerIndex();\n }", "public IndexRecord getIterator() {\n return (iter == -1 ? null : data[iter]);\n}", "@Override\n public int peekaboo(){\n if (callCheck())\n return EMPTY_INDEX;\n return last.getValue();\n }", "public final void testCreateRecordingListIterator() throws Exception\n {\n Vector vect = new Vector();\n final long modifier = 100;\n long sdArr[][] = { { 0, 10 }, { 0, 12 }, { 0, 8 }, { -5, 20 } };\n\n patchArray(sdArr, modifier);\n\n for (int i = 0; i < sdArr.length; i++)\n {\n vect.addElement(new RecordingImplMock(new Date(sdArr[i][0]), sdArr[i][1]));\n }\n RecordingList recordingList = new RecordingListImpl(vect);\n\n RecordingListIterator rli = recordingList.createRecordingListIterator();\n assertNotNull(\"recordingListIterator\", rli);\n\n RecordingRequest req = null;\n\n // first entry\n assertTrue(rli.getPosition() == 0);\n assertTrue(rli.hasNext());\n req = rli.nextEntry(); // 0\n verifyDuration(req, sdArr[0][1]);\n\n // second entry\n assertTrue(rli.getPosition() == 1);\n assertTrue(rli.hasNext());\n req = rli.nextEntry(); // 1\n verifyDuration(req, sdArr[1][1]);\n //\n // back to the first entry\n //\n assertTrue(rli.getPosition() == 2);\n assertTrue(rli.hasPrevious());\n req = rli.previousEntry(); // 1\n verifyDuration(req, sdArr[1][1]);\n //\n // test getEntry\n //\n assertTrue(rli.getPosition() == 1);\n req = rli.getEntry(2);\n verifyDuration(req, sdArr[2][1]);\n assertTrue(rli.getPosition(req) == 2);\n assertTrue(rli.getPosition() == 1);\n //\n // reset to the beginning\n //\n rli.toBeginning();\n assertTrue(rli.getPosition() == 0);\n req = rli.nextEntry();\n verifyDuration(req, sdArr[0][1]);\n assertTrue(rli.getPosition() == 1);\n //\n // try getting an invalid entry\n //\n try\n {\n req = rli.getEntry(15);\n fail(\"Expected an exception\");\n }\n catch (IndexOutOfBoundsException exc)\n {\n // expected outcome\n }\n try\n {\n req = rli.getEntry(-1);\n fail(\"Expected an exception\");\n }\n catch (IndexOutOfBoundsException exc)\n {\n // expected outcome\n }\n //\n // at first, test getPrevious throws exception\n //\n rli.toBeginning();\n assertTrue(!rli.hasPrevious());\n try\n {\n req = rli.previousEntry();\n fail(\"Expected an exception\");\n }\n catch (NoSuchElementException exc)\n {\n // expected outcome\n }\n //\n // at last, test getNext throws exception\n //\n rli.toEnd();\n assertTrue(!rli.hasNext());\n try\n {\n req = rli.nextEntry();\n fail(\"Expected an exception\");\n }\n catch (NoSuchElementException exc)\n {\n // expected outcome\n }\n }", "public synchronized TimeSeriesIterator read() {\n //TODO: The read object returns the values at a point instead of returning all values when\n // called. Change it.\n return new CachingVarBitTimeSeriesIterator(size, timestamps.read(), values.read());\n }", "@Override\n public void get(long position, ByteBuffer dst, int count) {\n final ByteBuffer bd = this.getOrCreateBackingBB(position).duplicate();\n final long offset = this.getBackingBBOffset();\n bd.limit(NumbersUtils.asInt(position-offset + count));\n bd.position(NumbersUtils.asInt(position-offset));\n dst.limit(count);\n dst.position(0);\n dst.put(bd);\n dst.flip();\n }", "private int adjustIndex(int index)\n {\n int max = values.length;\n return ((index % max) + max) % max;\n }", "public int getDataIndexAndIncrement() {\n\t\tint x = dataIndex;\n\t\tnext();\n\t\treturn x;\n\t}", "private int consumeElement(int index) throws InterruptedException {\n\t while (sharedBuffer.isEmpty()) {\r\n\t synchronized (sharedBuffer) {\r\n\t \tString msg=\"Queue is empty \" + Thread.currentThread().getName()\r\n + \" is waiting , size: \" + sharedBuffer.size();\r\n\t \t\r\n\t // \t System.out.println(msg);\r\n\t\t writeLn(msg);\r\n\r\n\t sharedBuffer.wait();\r\n\t \r\n\t }\r\n\t }\r\n\r\n\t // Consume data from Buffer and Notify Producer that Data has been consumed from Buffer\r\n\t synchronized (sharedBuffer) {\r\n\t \tsharedBuffer.notifyAll();\r\n\t \t\r\n\t return (Integer) sharedBuffer.poll();\r\n\t }\r\n\t }", "public HitCounterReadWriteLock() {\r\n hits = new int[300];\r\n times = new int[300];\r\n }", "public ByteBuf getBytes(int index, byte[] dst)\r\n/* 227: */ {\r\n/* 228:244 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 229:245 */ return super.getBytes(index, dst);\r\n/* 230: */ }", "int get(int idx);", "public com.google.protobuf.ByteString getCached(int index) {\n return cached_.get(index);\n }", "public void UpdatePushIndex() {\n\t\tsetorgetState(true,false);\n\t}", "public void reset() {\n index = 0;\n }" ]
[ "0.6001579", "0.575533", "0.5727954", "0.564463", "0.56252956", "0.5573084", "0.550007", "0.54929304", "0.5463387", "0.54553366", "0.5440937", "0.5375598", "0.5370254", "0.53108525", "0.5308621", "0.5287324", "0.5274577", "0.52584714", "0.5245459", "0.52173567", "0.52131146", "0.52119046", "0.5211415", "0.52089834", "0.5205563", "0.51928645", "0.518026", "0.5151945", "0.5137569", "0.51220596", "0.51216966", "0.5082728", "0.5050237", "0.5049067", "0.50447434", "0.5020274", "0.49778593", "0.49653774", "0.4958612", "0.49390918", "0.4930665", "0.4927067", "0.49141163", "0.49119604", "0.49035478", "0.4898036", "0.48938367", "0.48925132", "0.4872923", "0.48687565", "0.48569387", "0.48519796", "0.48508584", "0.48471397", "0.48463017", "0.48453847", "0.48383373", "0.4837137", "0.48327398", "0.48295578", "0.48210084", "0.4809799", "0.48081788", "0.47988927", "0.4785227", "0.47806817", "0.47788867", "0.4773533", "0.4767024", "0.47621402", "0.47620884", "0.4760343", "0.4758486", "0.47577253", "0.47436976", "0.47435176", "0.473345", "0.47322094", "0.4731734", "0.47308013", "0.47274974", "0.47253165", "0.47250468", "0.4723032", "0.472097", "0.47201827", "0.4719407", "0.47137424", "0.47104836", "0.4709657", "0.4709453", "0.46973148", "0.46969637", "0.4696363", "0.46961707", "0.46961024", "0.46937203", "0.4693156", "0.46919304", "0.46850377" ]
0.54704714
8
Add an OnNext value to the buffer
void next(T value);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void onNext();", "@Override\n\t\t\t\t\tpublic void onNext(Object p1) {\n\t\t\t\t\t}", "void onNext(T item);", "protected abstract void onNewNext(T t);", "@Override\n public void onNext(Void aVoid) {\n }", "@Override\n public void onNext(String value) {\n\n }", "public void onNextImpl(T t) {\n }", "void onNext(CorfuStreamEntries results);", "public final void next(java.nio.FloatBuffer fb, int off)\r\n {\r\n fb.put(off++, (d0 >>> 8) * 0x1p-24f);\r\n fb.put(off++, (d1 >>> 8) * 0x1p-24f);\r\n fb.put(off, (d2 >>> 8) * 0x1p-24f);\r\n updateState();\r\n }", "@Override\n\tpublic void onNext(Long value_long) {\n\t\tSystem.out.println(value_long);\n\t\titems.add(value_long);\n\t\t\n\t}", "public void insertNextSample( byte[] buffer, int byteOffset );", "void setNext(MessageProcessor next);", "@Override\n public void onNext(final T value) {\n innerHandler.onNext(value);\n idlenessSource.check();\n }", "public void next (CallContext context);", "@Override\r\n\tpublic void next() {\n\n\t}", "IHandler next();", "@Override\n\tpublic void setNext(ByteBuffer buff, Integer position) {\n\t\tbyte[] tmp = new byte[3];\n\t\tbuff.get(tmp);\n\t\tbuff.position(position);\n\t\tif (new String(tmp) == \"GSO\") this.hasNext = true;\n\t\telse this.hasNext = false;\n\t}", "@Override\n public void onNext(TransportEvent value) {\n LOG.log(Level.FINEST, \"{0}\", value);\n stage.onNext(value);\n }", "void nextPayload(PayloadCallback callback);", "@Override\n\tpublic void next()\n\t{\n\n\t}", "void visit(final NextVal nextVal);", "@Override // com.p118pd.sdk.AbstractC5477Il11\n public void onNext(T t) {\n if (!this.OooO0O0) {\n try {\n if (!LLIL.this.OooO00o.call(t).booleanValue()) {\n this.OooO0O0 = true;\n this.f16418OooO00o.setValue(false);\n unsubscribe();\n }\n } catch (Throwable th) {\n IIl11.OooO00o(th, this, t);\n }\n }\n }", "public void next() {\n\t\t}", "void setNext(IBitmapCacheHandler next);", "@Override\n\tpublic void next() {\n\t\t\n\t}", "public void onNext(T r10) {\n /*\n r9 = this;\n r1 = 0;\n r8 = 1;\n r0 = r9.terminated;\n if (r0 == 0) goto L_0x0007;\n L_0x0006:\n return;\n L_0x0007:\n monitor-enter(r9);\n r0 = r9.terminated;\t Catch:{ all -> 0x000e }\n if (r0 == 0) goto L_0x0011;\n L_0x000c:\n monitor-exit(r9);\t Catch:{ all -> 0x000e }\n goto L_0x0006;\n L_0x000e:\n r0 = move-exception;\n monitor-exit(r9);\t Catch:{ all -> 0x000e }\n throw r0;\n L_0x0011:\n r0 = r9.emitting;\t Catch:{ all -> 0x000e }\n if (r0 == 0) goto L_0x002b;\n L_0x0015:\n r0 = r9.queue;\t Catch:{ all -> 0x000e }\n if (r0 != 0) goto L_0x0020;\n L_0x0019:\n r0 = new rx.observers.SerializedObserver$FastList;\t Catch:{ all -> 0x000e }\n r0.<init>();\t Catch:{ all -> 0x000e }\n r9.queue = r0;\t Catch:{ all -> 0x000e }\n L_0x0020:\n r1 = r9.nl;\t Catch:{ all -> 0x000e }\n r1 = r1.next(r10);\t Catch:{ all -> 0x000e }\n r0.add(r1);\t Catch:{ all -> 0x000e }\n monitor-exit(r9);\t Catch:{ all -> 0x000e }\n goto L_0x0006;\n L_0x002b:\n r0 = 1;\n r9.emitting = r0;\t Catch:{ all -> 0x000e }\n monitor-exit(r9);\t Catch:{ all -> 0x000e }\n r0 = r9.actual;\t Catch:{ Throwable -> 0x0046 }\n r0.onNext(r10);\t Catch:{ Throwable -> 0x0046 }\n L_0x0034:\n r2 = r1;\n L_0x0035:\n r0 = 1024; // 0x400 float:1.435E-42 double:5.06E-321;\n if (r2 >= r0) goto L_0x0034;\n L_0x0039:\n monitor-enter(r9);\n r0 = r9.queue;\t Catch:{ all -> 0x0043 }\n if (r0 != 0) goto L_0x004f;\n L_0x003e:\n r0 = 0;\n r9.emitting = r0;\t Catch:{ all -> 0x0043 }\n monitor-exit(r9);\t Catch:{ all -> 0x0043 }\n goto L_0x0006;\n L_0x0043:\n r0 = move-exception;\n monitor-exit(r9);\t Catch:{ all -> 0x0043 }\n throw r0;\n L_0x0046:\n r0 = move-exception;\n r9.terminated = r8;\n r1 = r9.actual;\n rx.exceptions.Exceptions.throwOrReport(r0, r1, r10);\n goto L_0x0006;\n L_0x004f:\n r3 = 0;\n r9.queue = r3;\t Catch:{ all -> 0x0043 }\n monitor-exit(r9);\t Catch:{ all -> 0x0043 }\n r3 = r0.array;\n r4 = r3.length;\n r0 = r1;\n L_0x0057:\n if (r0 >= r4) goto L_0x007e;\n L_0x0059:\n r5 = r3[r0];\n if (r5 == 0) goto L_0x007e;\n L_0x005d:\n r6 = r9.nl;\t Catch:{ Throwable -> 0x006b }\n r7 = r9.actual;\t Catch:{ Throwable -> 0x006b }\n r5 = r6.accept(r7, r5);\t Catch:{ Throwable -> 0x006b }\n if (r5 == 0) goto L_0x007b;\n L_0x0067:\n r0 = 1;\n r9.terminated = r0;\t Catch:{ Throwable -> 0x006b }\n goto L_0x0006;\n L_0x006b:\n r0 = move-exception;\n r9.terminated = r8;\n rx.exceptions.Exceptions.throwIfFatal(r0);\n r1 = r9.actual;\n r0 = rx.exceptions.OnErrorThrowable.addValueAsLastCause(r0, r10);\n r1.onError(r0);\n goto L_0x0006;\n L_0x007b:\n r0 = r0 + 1;\n goto L_0x0057;\n L_0x007e:\n r0 = r2 + 1;\n r2 = r0;\n goto L_0x0035;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: rx.observers.SerializedObserver.onNext(java.lang.Object):void\");\n }", "public void next(){\n\t\tif(generated)\n\t\t\tcurr++;\n\t}", "public void next();", "public void next();", "@Override\n public void subscribe(FlowableEmitter<Integer> e) throws Exception {\n for (int i = 0; i < 128; i++) {\n Log.e(TAG, \"emit \" + i);\n e.onNext(i);\n }\n }", "public final void next(float[] v) { next(v,0); }", "@Override\n public void onNext(List<ByteBuffer> buffers) {\n for (ByteBuffer buffer : buffers) {\n if (buffer.limit() != buffer.capacity()) {\n final int limit = buffer.limit();\n final int position = buffer.position();\n buffer.position(buffer.limit());\n buffer.limit(buffer.capacity());\n while (buffer.hasRemaining())\n buffer.put((byte)'X');\n buffer.position(position); // restore original position\n buffer.limit(limit); // restore original limit\n }\n }\n asString.onNext(buffers);\n }", "public void testNext() {\n for (int i = 0; i < 10; i++) {\n test1.append(new Buffer(i, rec));\n }\n assertTrue(test1.getValue().inRange(0));\n test1.next();\n assertTrue(test1.getValue().inRange(1));\n test1.next();\n assertTrue(test1.getValue().inRange(2));\n for (int i = 0; i < 10; i++) {\n test1.next();\n }\n assertEquals(10, test1.currPos());\n }", "public final void next(float[] v, int off)\r\n {\r\n v[off++] = (d0 >>> 8) * 0x1p-24f;\r\n v[off++] = (d1 >>> 8) * 0x1p-24f;\r\n v[off++] = (d2 >>> 8) * 0x1p-24f;\r\n \r\n updateState();\r\n }", "void setNextValue() {\n this.value = this.value * 2;\n }", "public synchronized void add(int value)\n\t{\n\t\tint position = writeIndex;\n\t\t\n\t\ttry {\n\t\t\tThread.sleep(generator.nextInt(500));\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tarray[position] = value;\n\t\tSystem.out.printf(\"%s wrote %2d to element %d.\\n\",Thread.currentThread().getName(),value,position);\n\t\t++writeIndex;\n\t\tSystem.out.printf(\"Next write index: %d\\n\",writeIndex);\n\t}", "@Override\n\t\t\tpublic void onNext(AutoNewTicketRequest value) {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"On Next is what!!\");\n\t\t\t\tList<TicketData> ticktDataList = new ArrayList<TicketData>();\n\t\t\t\tSystem.out.println(\"Total Ticket is : \"+ ticktDataList.size());\n\t\t\t\tfor(Ticket t : SimpleTicketStore.getTickets()) {\n\t\t\t\t\tticktDataList.add(Ticket2TicketData(t));\n\t\t\t\t}\n\t\t\t\tIterable<TicketData> ticktDataIterable=ticktDataList;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tint i=0;\n\t\t\t\tfor(StreamObserver<GetAllTicketResponse> observer: connected_clients) {\n\t\t\t\t\tSystem.out.println(\"Writing down to clietns\");\n\t\t\t\t\tobserver.onNext(GetAllTicketResponse.newBuilder().addAllTicketData(ticktDataIterable).build());\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tSystem.out.println(i);\n\t\t\t}", "public final void next(java.nio.FloatBuffer fb)\r\n {\r\n fb.put((d0 >>> 8) * 0x1p-24f);\r\n fb.put((d1 >>> 8) * 0x1p-24f);\r\n fb.put((d2 >>> 8) * 0x1p-24f);\r\n updateState();\r\n }", "public abstract void next();", "public boolean add(BufferSlot bs);", "public void writeNext(NVImmutable item) throws ThingsException;", "public void getNextRawSamples( double[] rawBuffer );", "public void put(T value) {\n if (buffer.length > 0) {\n buffer[head] = value;\n\n index = head;\n\n head = (head + 1) % buffer.length;\n\n if (entries < buffer.length) {\n ++entries;\n }\n }\n\n }", "@Override\n public void onNext(T t) {\n if (t == null) {\n this.onError(new NullPointerException(\"onNext called with null. Null values are generally not allowed in 2.x operators and sources.\"));\n return;\n } else {\n if (this.isDisposed()) return;\n {\n this.observer.onNext(t);\n return;\n }\n }\n }", "@Override\r\n\tprotected void doNext() {\n\t\t\r\n\t}", "@Override\n\tpublic void playerPCMFeedBuffer(boolean b, int i, int i2) {}", "private E newBufferPoll(E[] nextBuffer, long index)\r\n/* 200: */ {\r\n/* 201:451 */ long offset = newBufferAndOffset(nextBuffer, index);\r\n/* 202:452 */ E n = UnsafeRefArrayAccess.lvElement(nextBuffer, offset);\r\n/* 203:453 */ if (n == null) {\r\n/* 204:455 */ throw new IllegalStateException(\"new buffer must have at least one element\");\r\n/* 205: */ }\r\n/* 206:457 */ UnsafeRefArrayAccess.soElement(nextBuffer, offset, null);\r\n/* 207:458 */ soConsumerIndex(index + 2L);\r\n/* 208:459 */ return n;\r\n/* 209: */ }", "protected abstract List<Integer> doEmit(OUT flinkTuple);", "@Override\n\t\tpublic void onNext(String t) {\n\t\t\tSystem.out.println(\"Observer : \"+ t);\n\t\t}", "public void next() {\n\t\tif ((position == 0) && (pause != 3)) {\n\t\t\tpause++;\n\t\t} else {\n\t\t\tposition++;\n\t\t\tpause = 0;\n\t\t\tif (position == (origionalMessage.length() + 10)) {\n\t\t\t\tposition = 0;\n\t\t\t}\n\t\t}\n\n\t}", "public void setNext(Variable next){\n\t\tthis.next = next;\n\t}", "Object nextValue() throws IOException;", "private int addFromStream( FloatBuffer directBuffer, ObjectInputStream in )\n throws IOException {\n int numberOfValues = in.readInt();\n int oldPosition = -1;\n if ( numberOfValues != -1 ) {\n oldPosition = directBuffer.position();\n if ( ( directBuffer.capacity() - oldPosition ) >= numberOfValues ) {\n for ( int i = 0; i < numberOfValues; ++i ) {\n directBuffer.put( in.readFloat() );\n }\n }\n }\n return oldPosition;\n }", "@Override // com.google.common.util.concurrent.AbstractFuture.AtomicHelper\n public void putNext(Waiter waiter, Waiter newValue) {\n UNSAFE.putObject(waiter, WAITER_NEXT_OFFSET, newValue);\n }", "public abstract void next ();", "public void put_next_index(long next_index, long number) {\n ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putLong((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 13), next_index);\n }", "@Override // org.reactivestreams.Subscriber\n public void onNext(T t) {\n if (this.done) {\n return;\n }\n if (this.sourceMode == 0) {\n try {\n this.actual.onNext(ObjectHelper.requireNonNull(this.a.apply(t), \"The mapper returned a null value\"));\n } catch (Throwable th) {\n fail(th);\n }\n } else {\n this.actual.onNext(null);\n }\n }", "@Override\n public void onNext(T item) {\n limiter.limit(item, completeAction);\n }", "@Override\n public void accLateral(int value, int timestamp) {\n }", "public void setNextValue(final String nextValue);", "public boolean onNextRecord(IDataTableRecord record) throws Exception;", "@Override\n public void onBuffering(int percent) {\n }", "@Override\n void advance() {\n }", "void next();", "public void append(IoBuffer buffer) {\n data.offerLast(buffer);\n updateBufferList();\n }", "private synchronized void addNext(final RequestResponseMsg reqRespMsg) {\n\t\tshowTotalSend(); \n\n\t\tif (this.isAlreadyClosed()) {\n\t\t\tmakeNewOsgpServiceClient(reqRespMsg);\n\t\t} else {\n\t\t\tif (reqRespMsg == null) {\n\t\t\t\tcloseStream();\n\t\t\t} else {\n\t\t\t\tthis.msgCount++;\n\t\t\t\taddNextRequest(reqRespMsg);\n\t\t\t\tif (this.msgCount >= MAX_MSG_COUNT) {\n\t\t\t\t\tcloseStream();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void visit(Addition arg0) {\n\t\t\n\t}", "@Override\r\n\tpublic void PushToBuffer(ByteBuffer buffer)\r\n\t{\r\n\t\r\n\t}", "@Override\n public void onNext(LongGreetResponse value) {\n System.out.println(\"Received a response from the server\");\n System.out.println(value.getResult());\n // on next will be called only once because of Client Streaming\n }", "private void buffer(Runnable action) {\n actions.add(action);\n }", "@Override\n\tpublic void add(Generator generator) {\n\t}", "private void goForwardOne() \n {\n if (m_bufferOffset_ < 0) {\n // we're working on the source and not normalizing. fast path.\n // note Thai pre-vowel reordering uses buffer too\n m_source_.setIndex(m_source_.getIndex() + 1);\n }\n else {\n // we are in the buffer, buffer offset will never be 0 here\n m_bufferOffset_ ++;\n }\n }", "@Override\r\n\t\tpublic Item next() {\r\n\t\t\treturn arr[index++];\r\n\t\t}", "public int getNextUnSafeSequence(){ return value++;}", "@Override\n\tpublic void visit(Addition arg0) {\n\n\t}", "@Override\n public void onNext(JSONObject jsonObject) {\n }", "public Object next();", "public Object next();", "@Override\n public Object next() {\n Object retval = this.nextObject;\n advance();\n return retval;\n }", "public T next(){\r\n return itrArr[position++];\r\n }", "public synchronized void add(int value)\n\t{\n\t\tint position = writeIndex; // store the write index\n\t\ttry\n\t\t{\n\t\t\t// in real applications, you shouldn't sleep while holding a lock\n\t\t\tThread.sleep(generator.nextInt(500)); // for demo only\n\t\t}\n\t\tcatch (InterruptedException ex)\n\t\t{\n\t\t\tThread.currentThread().interrupt();\n\t\t}\n\t\t\n\t\t// put value in the appropriate element\n\t\tarray[position] = value;\n\t\t\n\t\t// I/O should not be performed in synchronized blocks,\n\t\tSystem.out.printf(\"%s wrote %2d to element %d.%n\",\n\t\t\t\tThread.currentThread().getName(), value, position);\n\t\t\n\t\t++writeIndex; // increment index of element to be written next\n\t\tSystem.out.printf(\"Next write index: %d%n\", writeIndex);\n\t}", "@Override\n public void onNext(String s) {\n Toast.makeText(MainActivity.this, \"OBSERVER ->\" + s, Toast.LENGTH_SHORT).show();\n textView.setText(s);\n }", "public T next() {\n return array[current++];\n }", "public NV readNext() throws ThingsException;", "public void next() {\n\t\tSystem.out.println(al.get(pos));\r\n\t\tpos++;\r\n\t}", "private long newBufferAndOffset(E[] nextBuffer, long index)\r\n/* 222: */ {\r\n/* 223:475 */ this.consumerBuffer = nextBuffer;\r\n/* 224:476 */ this.consumerMask = (LinkedArrayQueueUtil.length(nextBuffer) - 2 << 1);\r\n/* 225:477 */ return LinkedArrayQueueUtil.modifiedCalcElementOffset(index, this.consumerMask);\r\n/* 226: */ }", "@Override\n E next();", "public void next( long time );", "public void bufferPacket(UtpTimestampedPacketDTO pkt) throws IOException {\r\n\t\tint sequenceNumber = pkt.utpPacket().getSequenceNumber() & 0xFFFF;\r\n\t\tint position = sequenceNumber - expectedSequenceNumber;\r\n\t\tdebug_lastSeqNumber = sequenceNumber;\r\n\t\tif (position < 0) {\r\n\t\t\tposition = mapOverflowPosition(sequenceNumber);\r\n\t\t}\r\n\t\tdebug_lastPosition = position;\r\n\t\telementCount++;\r\n\t\ttry {\r\n\t\t\tbuffer[position] = pkt;\t\t\t\r\n\t\t} catch (ArrayIndexOutOfBoundsException ioobe) {\r\n\t\t\tlog.error(\"seq, exp: \" + sequenceNumber + \" \" + expectedSequenceNumber + \" \");\r\n\t\t\tioobe.printStackTrace();\r\n\r\n\t\t\tdumpBuffer(\"oob: \" + ioobe.getMessage());\r\n\t\t\tthrow new IOException();\r\n\t\t}\r\n\r\n\t}", "public T next(){\n return (T)data[ci++];\n }", "public void setNextHandler(Handler nextHandler){\n\n this.nextHandler = nextHandler;\n\n }", "boolean onTag(ByteBuffer buffer, int tagIndex, int tagLen, int valueLen);", "private void handleIdleIncrease() {\n int i;\n int i2;\n if (curState == 0 && (i = targetBuffer) < (i2 = raiseBufferMax)) {\n targetBuffer = i + raiseBufferStep;\n targetBuffer = Math.min(targetBuffer, i2);\n Trace.traceBegin(8, \"increaseBuffer:\" + targetBuffer);\n int i3 = targetBuffer;\n setBuffer(i3, i3 - lowBufferStep, highBufferStep + i3, swapReserve);\n Trace.traceEnd(8);\n }\n Message msg = handler.obtainMessage();\n msg.what = 11;\n handler.sendMessageDelayed(msg, (long) (raiseBufferTimeWidth * 1000));\n }", "public byte NEXT() {\r\n\t\t//log(\"Frame.NEXT mp=\"+mp);\r\n\t\tint addr=base+(mp++);\r\n\t\tbyte b=heap.readByte(addr);\r\n\t\t//log(\"Frame.NEXT addr=\"+addr+\"; byte=\"+b+\" \"+hexByte(b));\r\n\t\treturn b;\r\n\t}", "@Override\n public int nextIndex()\n {\n return idx+1; \n }", "@Override\n public final PipeStep pipeStepSetNext(final PipeStep nextPipeStep) {\n // This is global to all encoders\n Encoder.nextPipeStep = nextPipeStep;\n return nextPipeStep;\n }", "private void next() {\n\t\tParcel pc = Parcel.obtain();\n\t\tParcel pc_reply = Parcel.obtain();\n\t\ttry {\n\t\t\tSystem.out.println(\"DEBUG>>>pc\" + pc.toString());\n\t\t\tSystem.out.println(\"DEBUG>>>pc_replay\" + pc_reply.toString());\n\t\t\tib.transact(2, pc, pc_reply, 0);\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void addToBuffer(byte[] value, boolean isClient) {\n byte[] buffer;\n\n if (isClient) {\n buffer = mClientBuffer;\n } else {\n buffer = mServerBuffer;\n }\n\n if (buffer == null) {\n buffer = new byte[0];\n }\n byte[] tmp = new byte[buffer.length + value.length];\n System.arraycopy(buffer, 0, tmp, 0, buffer.length);\n System.arraycopy(value, 0, tmp, buffer.length, value.length);\n\n if (isClient) {\n mClientBuffer = tmp;\n } else {\n mServerBuffer = tmp;\n }\n }", "ManagedEndpoint next();", "public synchronized void add(Integer item) {\r\n while (true) {\r\n if (buffer.size() == SIZE) {\r\n try {\r\n wait();\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n buffer.add(item);\r\n notifyAll();\r\n return;\r\n }\r\n }" ]
[ "0.6900522", "0.666959", "0.6578822", "0.6515503", "0.6446011", "0.62715197", "0.6246077", "0.5993429", "0.5843866", "0.5806261", "0.5783926", "0.5732113", "0.5656993", "0.5653539", "0.5650458", "0.5647323", "0.5639855", "0.5639085", "0.56258357", "0.5621151", "0.5616576", "0.5613819", "0.5613676", "0.5585647", "0.5579735", "0.54936934", "0.5466261", "0.5412603", "0.5412603", "0.539358", "0.53856885", "0.5382866", "0.53785944", "0.5374533", "0.5372475", "0.5343948", "0.53390884", "0.5336253", "0.5305516", "0.5302163", "0.53005975", "0.52927315", "0.528611", "0.52833045", "0.52535564", "0.52372026", "0.523186", "0.5227031", "0.5221852", "0.5217102", "0.52045304", "0.51890945", "0.51799023", "0.51786655", "0.51751", "0.5158951", "0.51562077", "0.5127181", "0.5118325", "0.5107596", "0.5106327", "0.5094324", "0.5089884", "0.5064911", "0.5061051", "0.50550497", "0.50385433", "0.5034653", "0.50311565", "0.5028322", "0.5028107", "0.50269926", "0.50258636", "0.5023567", "0.5022309", "0.50206643", "0.5018171", "0.5018171", "0.50171334", "0.5014798", "0.5008128", "0.5003089", "0.50024205", "0.5001936", "0.49992847", "0.49991733", "0.49978566", "0.49898013", "0.4987926", "0.49878404", "0.4981155", "0.49666512", "0.4965119", "0.49574995", "0.49572134", "0.49571666", "0.494596", "0.49361068", "0.49277294", "0.49262688" ]
0.6105589
7
Add an OnCompleted exception and terminate the subject
void complete();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void taskFinished(Throwable t);", "void complete() {\n try {\n try {\n subscriber.onComplete();\n } catch (Throwable e) {\n Exceptions.handleUncaught(Conformance.onCompleteThrew(e));\n }\n } finally {\n // no need to remove ourselves from psm.\n terminate();\n }\n }", "public void tryTerminate() {\n if (wip.decrementAndGet() != 0) {\n return;\n }\n if (queue.isEmpty()) {\n completableSubscriber.onCompleted();\n } else {\n completableSubscriber.onError(CompletableOnSubscribeMerge.collectErrors(queue));\n }\n }", "@Override\n public void onComplete() {\n refCause.compareAndSet(null, DELIBERATE_EXCEPTION);\n }", "public void end(Throwable cause) {}", "public void onCompletedImpl() {\n }", "public void completeExceptionally(Throwable exception) {\n messageFuture.completeExceptionally(exception);\n futures.remove(this.correlationId);\n }", "public void signalError(Throwable th) {\r\n InnerSubscription[] innerSubscriptionArr;\r\n for (InnerSubscription innerSubscription : (InnerSubscription[]) this.subscribers.getAndSet(TERMINATED)) {\r\n if (!innerSubscription.isCancelled()) {\r\n innerSubscription.downstream.onError(th);\r\n }\r\n }\r\n }", "public boolean onExceptionalCompletion(Throwable paramThrowable, CountedCompleter<?> paramCountedCompleter)\n/* */ {\n/* 489 */ return true;\n/* */ }", "@Override\n public void onFailure(@NonNull Exception e) {\n finish();\n }", "@Override\n\tpublic void run(Throwable escalation) throws Throwable {\n\t\tAssert.assertFalse(\"Flow already flagged as complete\", this.isComplete);\n\t\tthis.failure = escalation;\n\t\tthis.isComplete = true;\n\t}", "@Override\n\t\t\tpublic void onError(PerunException error) {\n\t\t\t\tevents.onFinished(null);\n\t\t\t}", "@Override\n\tpublic void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n\t\tsubject = null;\n\t\tsuper.afterCompletion(request, response, handler, ex);\n\t}", "public void terminate() {\n Queue<Throwable> q;\n if (this.wip.decrementAndGet() == 0) {\n Queue<Throwable> q2 = this.errors;\n if (q2 == null || q2.isEmpty()) {\n this.actual.onCompleted();\n return;\n }\n Throwable e = CompletableOnSubscribeMerge.collectErrors(q2);\n if (ONCE.compareAndSet(this, 0, 1)) {\n this.actual.onError(e);\n } else {\n RxJavaPlugins.getInstance().getErrorHandler().handleError(e);\n }\n } else if (!this.delayErrors && (q = this.errors) != null && !q.isEmpty()) {\n Throwable e2 = CompletableOnSubscribeMerge.collectErrors(q);\n if (ONCE.compareAndSet(this, 0, 1)) {\n this.actual.onError(e2);\n } else {\n RxJavaPlugins.getInstance().getErrorHandler().handleError(e2);\n }\n }\n }", "@Override\n\t\tpublic void onCompleted() {\n\t\t}", "@Override\n protected void onFailure(Throwable e) {\n // terminate thread\n terminate(false);\n }", "@Override public final boolean onExceptionalCompletion(Throwable ex, CountedCompleter caller ) {\n if( _nleft != null ) _nleft.cancel(true); _nleft = null;\n if( _nrite != null ) _nrite.cancel(true); _nrite = null;\n _left = null;\n _rite = null;\n return super.onExceptionalCompletion(ex, caller);\n }", "@Override\n\t\t\t\t\tpublic void onError(PerunException error) {\n\t\t\t\t\t\tevents.onFinished(null);\n\t\t\t\t\t}", "void failed (Exception e);", "private void signalDone(boolean exceptionOccurred) {\n\t\tif (ui != null) {\n\t\t\tui.access(() -> done(exceptionOccurred));\n\t\t} else {\n\t\t\tdone(exceptionOccurred);\n\t\t}\n\t}", "@Override\n public void onError(Throwable t) {\n callback.onError(t);\n //Calling the finally..callback\n callback.onFinally();\n }", "public void onCompleted() {\n\t\t\n\t\t }", "void onComplete(Consumer<? super Try<T>> action);", "protected void onEnd() {}", "private void disconnectCompleted(AsyncResult<?> result) {\n\n if (log.isDebugEnabled()) {\n log.debug(String.format(\"Disconnect completed - result: %s, cause: %s\", result.result(), result.cause()));\n }\n\n connectionClosed(result.cause());\n }", "public void performCompletion() {\n/* 536 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public void end_addObserver(Ice.AsyncResult __result);", "public void end() throws Exception;", "@Override\n public void abort(RuntimeStep exe) {\n }", "public synchronized void onExceptionSend(HttpPipelineRequest p_onExceptionSend_1_, Exception p_onExceptionSend_2_) {\n/* 339 */ terminate(p_onExceptionSend_2_);\n/* */ }", "public void afterExecute(Runnable runnable, Throwable th) {\n Task task = (Task) runnable;\n task.setFinished(true);\n task.setError(th);\n getQueue().recycleBlockedQueue();\n super.afterExecute(runnable, th);\n }", "public void on() throws Exception;", "@Override\n public void onCompleted() {\n }", "@Override\n public void onCompleted() {\n }", "@Override\r\n\t\t\tpublic void onCompleted() {\n\r\n\t\t\t}", "@Override\n protected void succeeded() {\n eventService.publish(new TaskEndedEvent(this));\n\n }", "@Override\n public void Wsdl2CodeFinishedWithException(Exception ex) {\n }", "public void runFinally() {\n if (compareAndSet(0, 1)) {\n try {\n this.onFinally.run();\n } catch (Throwable th) {\n Exceptions.throwIfFatal(th);\n RxJavaPlugins.onError(th);\n }\n }\n }", "private void failWithExceptionOnExecutor(CronetException e) {\n mException = e;\n // Do not call into mCallback if request is complete.\n synchronized (mNativeStreamLock) {\n if (isDoneLocked()) {\n return;\n }\n mReadState = mWriteState = State.ERROR;\n destroyNativeStreamLocked(false);\n }\n try {\n mCallback.onFailed(this, mResponseInfo, e);\n } catch (Exception failException) {\n Log.e(CronetUrlRequestContext.LOG_TAG, \"Exception notifying of failed request\",\n failException);\n }\n mInflightDoneCallbackCount.decrement();\n }", "@Override\n public void onFailure(IMqttToken asyncActionToken, Throwable exception) {\n }", "@Override public final boolean onExceptionalCompletion(Throwable ex, CountedCompleter caller ) {\n //if( _nleft != null ) _nleft.cancel(true); _nleft = null;\n //if( _nrite != null ) _nrite.cancel(true); _nrite = null;\n //if( _left != null ) _left.cancel(true); _left = null;\n //if( _rite != null ) _rite.cancel(true); _rite = null;\n _nleft = _nrite = null;\n _left = _rite = null;\n return super.onExceptionalCompletion(ex, caller);\n }", "@Override\n public void onFailure(IMqttToken asyncActionToken,\n Throwable exception) {\n }", "@Override\n public void onFailure(IMqttToken asyncActionToken,\n Throwable exception) {\n }", "@Override\n public void onFailure(IMqttToken asyncActionToken,\n Throwable exception) {\n }", "@Override\n public void onFailure(IMqttToken asyncActionToken,\n Throwable exception) {\n }", "@Override\n\tpublic void finishFailure(Exception cause) {\n\t\tSystem.err.println(\"finishFailure\");\n\n\t}", "void terminated(@Nullable Throwable cause);", "void errorFinal(Throwable t) {\n try {\n try {\n subscriber.onError(t);\n } catch (Throwable e) {\n Exceptions.handleUncaught(t);\n Exceptions.handleUncaught(Conformance.onErrorThrew(e));\n }\n } finally {\n // no need to remove ourselves from psm.\n terminate();\n }\n }", "@Override\n public void completed(Integer result, String attachment)\n {\n }", "public static void error() {\n Observable<String> myObservable = Observable.error(\n () -> new Exception(\"Exception from error observable\"));\n myObservable.subscribe(genericObserver1);\n }", "public void done() {\n if (!isCancelled()) {\n try {\n C0637h.this.mo7991a(get());\n } catch (InterruptedException | ExecutionException e) {\n C0637h.this.mo7992a(e.getCause());\n }\n } else {\n C0637h.this.mo7992a((Throwable) new CancellationException());\n }\n }", "void afterThrow(T resource, Exception exception);", "public void onAbort() {\n releaseInitialRef.run();\n }", "@Override\n public void onFailure(Call call, IOException e) {\n emitter.onNext(e+\"\");\n }", "void completed(TestResult tr);", "String getOnExceptionEnd();", "public abstract Task onDeath() throws Exception;", "@Override\n\tprotected void doAfterCompletion(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object obj, Exception e) {\n\t\t\n\t}", "public void finish() throws Exception {\n\t\t\n\t}", "void onSynchronizationFailed(SyncException e);", "@NonBlocking\n void error(Throwable throwable);", "@Override // io.reactivex.functions.Consumer\n public void accept(Throwable th) {\n }", "public void onFailure(Exception t);", "protected void finalize() throws Throwable {\n\t\ttry {\n\t\t\tthis.listen_socket.close();\n\t\t} catch (IOException e1) {\n\t\t}\n\t}", "@Override\n public void onFailure(IMqttToken asyncActionToken,\n Throwable exception) {\n }", "public void checkException() {\n/* 642 */ checkException(voidPromise());\n/* */ }", "public void afterCompletion(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, Exception arg3)\n throws Exception {\n }", "@Override\r\n\tprotected void finalize() throws Exception\r\n\t{\r\n\t\tif(!this.cleanUpDone )\r\n\t\t\tthis.terminate();\r\n\t}", "public void finished() {\n Object obj = get();\n if (obj instanceof Exception)\n mCallback.run(null, (Exception)obj, mRock);\n else\n mCallback.run(obj, null, mRock);\n }", "@Override\n\t\tpublic void asyncFailure(long id, Exception e)\n\t\t\t\tthrows ConnectorException {\n\t\t\t\n\t\t}", "@Override\n\tpublic void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object arg2, Exception arg3)\n\t\t\tthrows Exception {\n\t\t\n\t}", "void innerFinish() {\r\n\t\t\t\t\t\tobserver.finish();\r\n\t\t\t\t\t\tclose();\r\n\t\t\t\t\t}", "@Override\n public boolean onError(Throwable t) {\n connected.completeExceptionally(t);\n return true; //hints at handler to disconnect due to this error\n }", "public void finish() {\n/* 187 */ this.mTouchEventSubject.onComplete();\n/* */ }", "@Override\n public void onFailure(IMqttToken asyncActionToken,\n Throwable exception) {\n\n }", "void onCompleted(T response);", "public void onComplete() {\n /*\n r3 = this;\n monitor-enter(r3)\n U r0 = r3.l // Catch:{ all -> 0x0022 }\n if (r0 != 0) goto L_0x0007\n monitor-exit(r3) // Catch:{ all -> 0x0022 }\n return\n L_0x0007:\n r1 = 0\n r3.l = r1 // Catch:{ all -> 0x0022 }\n monitor-exit(r3) // Catch:{ all -> 0x0022 }\n d.a.a0.c.e<U> r1 = r3.f13249d\n r1.offer(r0)\n r0 = 1\n r3.f13251f = r0\n boolean r0 = r3.f()\n if (r0 == 0) goto L_0x0021\n d.a.a0.c.e<U> r0 = r3.f13249d\n d.a.s<? super V> r1 = r3.f13248c\n r2 = 0\n d.a.a0.j.q.c(r0, r1, r2, r3, r3)\n L_0x0021:\n return\n L_0x0022:\n r0 = move-exception\n monitor-exit(r3) // Catch:{ all -> 0x0022 }\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: d.a.a0.e.d.o.b.onComplete():void\");\n }", "public final void m63104a(Throwable th) {\n C0001a.c(th, \"Cannot observe state: stream is terminated\", new Object[0]);\n }", "@Override\n public void errorReceived(Exception ex) {\n }", "@Override\n public void errorReceived(Exception ex) {\n }", "public void onFailure(Throwable caught) {\n\t\t\t\t\n\t\t\t}", "public void innerError(InnerObserver innerObserver, Throwable th) {\n this.set.c(innerObserver);\n onError(th);\n }", "@Override\n\tpublic void eventFinished() {\n\t\tstatus=EventCompleted;\n\t}", "private void complete(MasterProcedureEnv env, Throwable error) {\n if (isFinished()) {\n LOG.info(\"This procedure {} is already finished, skip the rest processes\", this.getProcId());\n return;\n }\n if (event == null) {\n LOG.warn(\"procedure event for {} is null, maybe the procedure is created when recovery\",\n getProcId());\n return;\n }\n if (error == null) {\n LOG.info(\"finish snapshot {} on region {}\", snapshot.getName(), region.getEncodedName());\n succ = true;\n }\n\n event.wake(env.getProcedureScheduler());\n event = null;\n }", "public void onFailure(Throwable caught) {\n\t\t\t\t\t}", "@Override\n public void onFailure(Throwable t) {\n isSucessful.compareAndSet(true, false);\n failedMessages.put(id.getName(), t.getMessage());\n handleIfFinished(t, isSucessful.get());\n }", "public final void afterRanInterruptibly(V v, Throwable th) {\n if (th == null) {\n TrustedListenableFutureTask.this.set(v);\n } else {\n TrustedListenableFutureTask.this.setException(th);\n }\n }", "@Override\n\tpublic void endFail() {\n\t\t\n\t}", "void m70531a(Throwable th) {\n try {\n this.f61096d.call(th);\n } catch (Throwable th2) {\n this.f61095c.unsubscribe();\n }\n this.f61095c.unsubscribe();\n }", "@Override\n public void onFailure(IMqttToken asyncActionToken, Throwable exception) {\n Log.d(\"mqtt\", \"onFailure\");\n\n }", "public void onError( Throwable ex );", "Object proceed() throws Throwable;", "public Object proceed() throws Throwable;", "void error(Throwable t) {\n t = Conformance.onNextThrew(t);\n try {\n try {\n subscriber.onError(t);\n } catch (Throwable e) {\n Exceptions.handleUncaught(t);\n Exceptions.handleUncaught(Conformance.onErrorThrew(e));\n }\n } finally {\n try {\n cancel();\n } catch (Throwable t3) {\n Exceptions.handleUncaught(Conformance.cancelThrew(t3));\n }\n }\n }", "void handleSubchannelTerminated() {\n executorPool.returnObject(executor);\n terminatedLatch.countDown();\n }", "public final void onComplete(com.google.android.gms.c.f<TResult> r3) {\n /*\n r2 = this;\n boolean r0 = r3.isSuccessful()\n if (r0 == 0) goto L_0x001e\n java.lang.Object r0 = r2.f2708a\n monitor-enter(r0)\n com.google.android.gms.c.d<? super TResult> r1 = r2.f2709b // Catch:{ all -> 0x001b }\n if (r1 != 0) goto L_0x000f\n monitor-exit(r0) // Catch:{ all -> 0x001b }\n return\n L_0x000f:\n monitor-exit(r0) // Catch:{ all -> 0x001b }\n java.util.concurrent.Executor r0 = r2.c\n com.google.android.gms.c.s r1 = new com.google.android.gms.c.s\n r1.<init>(r2, r3)\n r0.execute(r1)\n goto L_0x001e\n L_0x001b:\n r3 = move-exception\n monitor-exit(r0) // Catch:{ all -> 0x001b }\n throw r3\n L_0x001e:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.c.r.onComplete(com.google.android.gms.c.f):void\");\n }", "public void onError(Exception e);", "@Override\n public void onTosRejected() {\n finish();\n }", "@Override\n\tpublic void afterCompletion(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler, Exception ex)\n\t\t\tthrows Exception {\n\t}", "public void onPostExecute(Throwable th) {\n if (th != null) {\n this.pdfView.loadError(th);\n } else if (!this.cancelled) {\n this.pdfView.loadComplete(this.pdfDocument);\n }\n }", "@Override\n public void onCompleted(Flow flow) {}" ]
[ "0.65650773", "0.61948603", "0.604851", "0.6010226", "0.58855313", "0.58359057", "0.58109677", "0.57388514", "0.57337797", "0.57142675", "0.5685713", "0.5644306", "0.56376284", "0.5626602", "0.5614355", "0.5607882", "0.56037796", "0.55909383", "0.55706817", "0.5538115", "0.5529389", "0.55202574", "0.5516273", "0.54927695", "0.5464195", "0.5462906", "0.5454353", "0.54528487", "0.54485077", "0.5446427", "0.5440141", "0.54288375", "0.5415416", "0.5415416", "0.5403481", "0.53786284", "0.5376605", "0.5370618", "0.53705233", "0.53665257", "0.5361873", "0.5353346", "0.5353346", "0.5353346", "0.5353346", "0.53461415", "0.5344303", "0.53422964", "0.53276587", "0.5320115", "0.5317446", "0.5311994", "0.52986753", "0.5296628", "0.52884597", "0.5277576", "0.5274538", "0.52637535", "0.52611446", "0.5260853", "0.52592397", "0.525858", "0.5239198", "0.5237433", "0.52246517", "0.52141416", "0.52099985", "0.51919186", "0.5189364", "0.5181919", "0.5180329", "0.51800865", "0.51800805", "0.51772356", "0.5176128", "0.51748806", "0.5172837", "0.5166726", "0.51666284", "0.51666284", "0.5164145", "0.5162039", "0.5161879", "0.5160885", "0.51597583", "0.5158991", "0.51588356", "0.5155229", "0.5148249", "0.5147089", "0.51429385", "0.5138099", "0.5136455", "0.5134483", "0.51340437", "0.5130348", "0.5127806", "0.51192415", "0.5110918", "0.5109421", "0.5106896" ]
0.0
-1
Copy the current values (minus any terminal value) from the buffer into the array or create a new array if there isn't enough room.
T[] toArray(T[] a);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String[] getBufferAndFlush() {\r\n\t\tString[] answer = new String[this.BUFFER.getSize()];\r\n\r\n\t\tfor (int i = 0; i < answer.length; i++)\r\n\t\t\tanswer[i] = this.BUFFER.remove();\r\n\r\n\t\treturn answer;\r\n\t}", "public int[] toArray() {\n return Arrays.copyOf(buffer, elementsCount);\n }", "public byte[] getBuffer () {\n\t\t\t\n\t\t\tif (index < 0)\n\t\t\t\treturn null;\n\n\t\t\tint len = index;\n\t\t\tbyte[] b = new byte[len+1];\n\t\t\tfor (int k=0; k <= len; k++)\n\t\t\t\tb[k] = buf[k];\n\n\t\t\treturn b;\n\t\t}", "public int[] reset() {\n return Arrays.copyOf(origin, origin.length);\n }", "public Array<T> compactClone()\n {\n Array<T> out = Array.fromUnsafe(new Object[next], next);\n System.arraycopy(array, 0, out.array, 0, next);\n return out;\n }", "private static char[] growBuffer(char[] dest, int index, int size) {\n char[] copy = new char[size];\n if (index > 0) {\n System.arraycopy(dest, 0, copy, 0, index);\n }\n return copy;\n }", "Buffer copy();", "public final void copyBuffer(char[] buffer, int offset, int length) { \n\t\tgrowTermBuffer(length);\n\t System.arraycopy(buffer, offset, mTermBuffer, 0, length);\n\t mTermLength = length;\n\t}", "private void grow() {\n int oldCapacity = this.values.length;\n int newCapacity = oldCapacity + (oldCapacity >> 1);\n Object[] newValues = new Object[newCapacity];\n System.arraycopy(this.values, 0, newValues, 0, oldCapacity);\n this.values = newValues;\n }", "public byte[] toByteArray() \r\n {\r\n \tbyte newbuf[] = new byte[count];\r\n \tSystem.arraycopy(buf, 0, newbuf, 0, count);\r\n \treturn newbuf;\r\n }", "private int[] reset() {\n return data;\n }", "public byte[] readBytes() {\n\t\tif (bufferIndex == bufferLast)\n\t\t\treturn null;\n\n\t\tsynchronized (buffer) {\n\t\t\tint length = bufferLast - bufferIndex;\n\t\t\tbyte outgoing[] = new byte[length];\n\t\t\tSystem.arraycopy(buffer, bufferIndex, outgoing, 0, length);\n\n\t\t\tbufferIndex = 0; // rewind\n\t\t\tbufferLast = 0;\n\t\t\treturn outgoing;\n\t\t}\n\t}", "@Override\n public byte [] toArray()\n \n {\n final int size = size();\n final byte [] array = \n new byte [size]; \n \n\n int i = 0;\n for (ByteCursor c : this)\n {\n array[i++] = c.value;\n }\n return array;\n }", "public static IntegerVarArray make(int[] buffer) {\n\t\treturn new IntegerVarArray(buffer);\n\t}", "public RealBuffer copyOf()\n {\n float[] copy = Arrays.copyOf(mSamples, mSamples.length);\n\n return new RealBuffer(copy);\n }", "@Override\n public Object[] toArray() {\n return Arrays.copyOf(data, size);\n }", "public ByteBuffer toBuffer() {\n return ByteBuffer.wrap(buf, 0, count);\n }", "public int[] cloneMemory(){\n return memory.clone();\n }", "private void ensureCap(){\n T[] temp = (T[])new Object[arr.length * 2];\n for(int i = 0; i < numItems; i++){\n temp[i] = this.arr[i];\n }\n this.arr = temp;\n }", "public void extendArray() {\n int index = size();\n Object[] temp = new Object[index + 1];\n for (int i=0; i < index; i++) {\n temp[i] = AL[i];\n }\n AL = temp;\n }", "@SuppressWarnings(\"unchecked\")\n public final T[] obtainArrayCopy() {\n final T[] localArray = array;\n if (localArray == null) return (T[]) Array.newInstance(clazz, 0);\n\n return Arrays.copyOf(localArray, localArray.length);\n }", "private static byte[] get(byte[] array, int offset, int length) {\n byte[] result = new byte[length];\n System.arraycopy(array, offset, result, 0, length);\n return result;\n }", "private void grow() {\n T[] arr_temp = (T[]) new Object[arr.length*2];\n for (int i=0; i<arr.length; i++){\n arr_temp[i] = arr[i];\n }\n arr = arr_temp;\n }", "long[] getBuffer() {\n\t\treturn buffer;\n\t}", "public static void bufferoverflowExample() {\n\t\tint[] intArray = new int[5];\n\t\tfor(int i = 0 ;i < 10 ; i++) \n\t\t{\n\t\t\tintArray[i] = i++;\n\t\t\tSystem.out.println(\"value of intArray[i] = \" + intArray[i]);\n\t\t}\n\t}", "byte [] getBuffer ();", "public int[] reset() {\n\t\t\treturn originalArr;\n\t\t}", "protected final char[] getCopyBuffer()\n {\n char[] buf = mCopyBuffer;\n if (buf == null) {\n mCopyBuffer = buf = mConfig.allocMediumCBuffer(DEFAULT_COPYBUFFER_LEN);\n }\n return buf;\n }", "private byte[] truncate(ByteBuffer buffer, int length) {\n assert length < buffer.remaining();\n byte[] array = new byte[length];\n buffer.get(array);\n return array;\n }", "@Override\n public T[] toArray() {\n return this.copyArray(this.data, this.size);\n }", "public final byte[] serializeArray_copy() {\n final ByteBuffer b = this.serialize();\n return ByteBuffer.allocate(b.limit()).put(b).array();\n }", "public void compact()\n {\n array = toArray();\n }", "public char[] toCharArray() {\n\t\t// Cannot use Arrays.copyOf because of class initialization order issues\n\t\tchar result[] = new char[value.length];\n\t\tSystem.arraycopy(value, 0, result, 0, value.length);\n\t\treturn result;\n\t}", "public static void fillArray() {\r\n\t\tfor (int i = 0; i < myOriginalArray.length - 1; i++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\tmyOriginalArray[i] = rand.nextInt(250);\r\n\t\t}\r\n\t\t// Copies original array 4 times for algorithm arrays\r\n\t\tmyBubbleArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmySelectionArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmyInsertionArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmyQuickArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t}", "private float[] initialPositionData () {\n float[] ret = new float[ this.positionQueue.size() ];\n for ( int i = 0, len = ret.length ; i < len ; i++ )\n ret[ i ] = this.positionQueue.poll();\n return ret;\n }", "public Object[] toArray() {\n\t\tObject[] ret = new Object[currentSize];\n\t\tfor (int i = 0; i < currentSize; i++)\n\t\t\tret[i] = array[i];\n\t\treturn ret;\n\t}", "@Override\n public Object[] toArray() {\n Object[] result = new Object[currentSize];\n System.arraycopy(container, 0, result, 0, currentSize);\n return result;\n }", "public static byte[] cloneAsArray(ByteBuffer targetBuffer) {\n\t\treturn targetBuffer.array();\n\t}", "public final T[] getArrayCopy() {\n final T[] localArray = array;\n if (localArray == null) {\n return null;\n }\n\n return Arrays.copyOf(localArray, localArray.length);\n }", "IArray getArrayCurrent() throws InvalidRangeException;", "private void setArray(byte[] initialArray)\r\n/* 60: */ {\r\n/* 61: 95 */ this.array = initialArray;\r\n/* 62: 96 */ this.tmpNioBuf = null;\r\n/* 63: */ }", "void makeNewArray() {\r\n\t\tint[] newStack = new int[stack.length*2];\r\n\t\tfor (int i=0; i<stack.length; i++)\r\n\t\t\tnewStack[i] = stack[i];\r\n\t\t\r\n\t\tstack = newStack;\r\n\t}", "public byte[] toByteArray() {\n byte[] array = new byte[count];\n System.arraycopy(buf, 0, array, 0, count);\n return array;\n }", "public double[] getArray(){\n\t\t\tdouble[] temp = new double[count];\n\t\t\tfor (int i = 0; i < count; i++){\n\t\t\t\ttemp[i] = anArray[i];\n\t\t\t}\n\t\t\treturn temp;\n\t\t}", "public void newArray() {\n\t\t\n\t\tE[] newArray= (E[]) new Object[list.length * 2]; //Holds the old elements from the list array while new list array is being made\n\t\t\n\t\tfor(int i = 0; i < list.length; i++) {\n\t\t\t\n\t\t\tnewArray[i] = list[i]; //Copy the old list array into the newArray\n\t\t}\n\t\t\n\t\tlist = newArray; //Point the old array at the newArray starting memory location\n\t\t\n\t}", "T[] toArray(T[] a){\n if(isEmpty()){\n return null;\n }\n for(int i=0;i<tail;i++){\n a[i] = (T) queueArray[i];\n }\n return a;\n }", "private IntPlus[] cloneArr(final IntPlus[] origArr) {\n return Arrays.copyOf(origArr, origArr.length);\n }", "public char[] getResultBuffer() { return b; }", "private void doubleArray()\n\t{\n\t\tT[] oldList = list;\n\t\tint oldSize = oldList.length;\n\t\t\n\t\tlist = (T[]) new Object[2 * oldSize];\n\t\t\n\t\t// copy entries from old array to new, bigger array\n\t\tfor (int index = 0; index < oldSize; index++)\n\t\t\tlist[index] = oldList[index];\n\t}", "public NavArc[] copyIncoming() {\r\n NavArc[] result = new NavArc[incoming.size()];\r\n int i = 0;\r\n for (NavArc arc : incoming) {\r\n result[i] = arc;\r\n ++i;\r\n }\r\n\r\n return result;\r\n }", "public void trimToSize() {\n if (size() != this.buffer.length) {\n this.buffer = toArray();\n }\n }", "public static byte[] getArray(ByteBuffer source) {\n int sourceP = source.position();\n byte[] arr = new byte[source.remaining()];\n source.get(arr);\n return arr;\n }", "private void resetBuffer() {\n baos.reset();\n }", "@Override\n public byte[] getBuffer() {\n return EMPTY_RESULT;\n }", "public Object getValueArray(int offset, int length);", "private Object[] copyArray(Object[] source, int size) {\n\t\tObject[] destination = new Object[size];\n\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tdestination[i] = source[i];\n\t\t}\n\n\t\treturn destination;\n\t}", "public Object[] getArray() {\n compress();\n return O;\n }", "public int[] toArray() \n {\n \treturn arrayCopy(state);\n }", "public void fixArray(){\n if (size == 0 || queue.length < 1){\n return;\n }\n E[] newer = ((E[])new Comparable[queue.length]);\n\n int x = 0;\n for(Object cur : queue){\n if (cur != null){\n newer[x++] = (E)cur;\n }\n }\n\n this.queue = newer;\n this.size = x;\n\n }", "Buffer slice();", "private void ensureCapacity() {\n int newLength = (this.values.length * 3) / 2 + 1;\n Object[] newValues = new Object[newLength];\n System.arraycopy(this.values, 0, newValues, 0, this.values.length);\n this.values = newValues;\n }", "public E[] toArray() {\n return (E[]) Arrays.copyOfRange(queue, startPos, queue.length);\n }", "private int[] cloneArr(final int[] origArr) {\n return Arrays.copyOf(origArr, origArr.length);\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate void growArray() {\n\t\tint tempSize = size * 2;\n\t\tE[] tempList = (E[]) new Object[tempSize];\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\ttempList[i] = list[i];\n\t\t}\n\t\tlist = tempList;\n\t}", "public byte[] drain() {\n return drainTo(new ByteArrayOutputStream()).toByteArray();\n }", "protected double[] toArrayNotIncludingNoDataValues() {\r\n boolean handleOutOfMemoryError = false;\r\n Grids_GridDouble g = getGrid();\r\n int nrows = g.getChunkNRows(ChunkID, handleOutOfMemoryError);\r\n int ncols = g.getChunkNCols(ChunkID, handleOutOfMemoryError);\r\n double noDataValue = g.getNoDataValue(handleOutOfMemoryError);\r\n long n = getN();\r\n if (n != (int) n) {\r\n throw new Error(\"Error n != (int) n \");\r\n }\r\n double[] array = new double[(int) getN()];\r\n int row;\r\n int col;\r\n int count = 0;\r\n double value;\r\n for (row = 0; row < nrows; row++) {\r\n for (col = 0; col < ncols; col++) {\r\n value = getCell( row, col);\r\n if (value != noDataValue) {\r\n array[count] = value;\r\n count++;\r\n }\r\n }\r\n }\r\n return array;\r\n }", "public ParseBuffer get(byte[] dst, int offset, int length) throws TLVEncodingException {\r\n\t\tif (length > limit - cursor)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid length field\");\r\n\r\n\t\tSystem.arraycopy(buffer, cursor, dst, offset, length);\r\n\t\tcursor += length;\r\n\r\n\t\treturn this;\r\n\t}", "public byte[] fillMergeInputBuffers(byte[] buffer, int offset)\r\n throws IOException {\r\n file.seek(offset);\r\n file.read(buffer);\r\n return buffer;\r\n }", "public static byte[] getAPDUBuffer(byte[] buffer) {\n short len = SATAccessor.getAPDUBufferLength();\n \n for (short i = 0; i < len; i++) {\n buffer[i] = SATAccessor.getAPDUBufferByte(i);\n }\n return buffer;\n }", "@Override\n\tpublic void releaseBuffer() {\n\t\tr.clear();\n\t\toriginRange = \"\";\n\t\tr = XStaticFixedValue.nullList;\n\t}", "@Override\n public <T> T[] toArray(final T[] array) {\n\n if (array.length < this.size) {\n return (T[]) this.copyArray(this.data, this.size);\n } else if (array.length > this.size) {\n array[this.size] = null;\n }\n\n for (int i = 0; i < this.size; i++) {\n array[i] = (T) this.data[i];\n }\n\n return array;\n }", "private static int[] copyArray(int[] array) {\n\t\tint[] copy = new int[array.length]; \n\t\tfor(int i = 0; i < array.length; i ++) {\n\t\t\tcopy[i] = array[i];\n\t\t}\n\t\treturn copy;\n\t}", "public Object[] toArray() {\n return Arrays.copyOf(this.values, this.index);\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate void growArray() {\n\t\tObject[] newList = new Object[size * 2];\n\t\tfor (int i = 0; i < size(); i++) {\n\t\t\tnewList[i] = get(i);\n\t\t}\n\t\tlist = (E[]) newList;\n\t\tsize *= 2;\n\t}", "protected int populateBuffer()\n {\n interlock.beginReading();\n // System.out.println(\"populateBuffer: 2\");\n return byteBuffer.limit();\n }", "public static <T> Array<T> copyOf(T[] array, int from, int to)\n {\n Array<T> out = Array.ofSize(to - from);\n out.copyFrom(array, from, to, to - from);\n return out;\n }", "private void grow()\r\n\t{\r\n\t\tint [] temp = new int[count * 2]; // new array to hold the data\r\n\r\n\t\t// copy old data in new array\r\n\t\tfor (int i = 0; i < count; i++)\r\n\t\t\ttemp[i] = array[i];\r\n\r\n\t\tarray = temp; // update the new array\r\n\t}", "public T[] getClonedTrimmed(T[] ar) {\r\n for (int i = offset; i < offset + count; i++) {\r\n @SuppressWarnings(\"unchecked\")\r\n T v = (T)objects[i];\r\n ar[i] = v;\r\n }\r\n return ar;\r\n }", "private void copyToBuffer(int sourceOffset, int[] buffer, int bufferOffset, int length, int backgroundGrey) {\n if (length < 1) {\n return;\n }\n synchronized (backingData) {\n try {\n backingData.position(origo + sourceOffset);\n backingData.get(bulkGetBuffer, 0, length);\n } catch (IndexOutOfBoundsException e) {\n throw new RuntimeException(String.format(\n \"IndexOutOfBounds for origo=%d, sourceOffset=%d, length=%d, o+d+l=%d, backing.limit=%d\",\n origo, sourceOffset, length, origo+sourceOffset+length, backingData.limit()));\n }\n for (int i = 0; i < length; i++) {\n final int grey = 0xFF & bulkGetBuffer[i];\n buffer[bufferOffset + i] = grey == Util.MISSING_GREY ? backgroundGrey : grey;\n }\n/* for (int i = 0 ; i < length ; i++) {\n // TODO: Bulk loading of each row should speed this up, but requires a synchronized bulk method\n int grey = getByteAsInt(sourceOffset+i);\n buffer[bufferOffset+i] = grey;\n }*/\n }\n }", "@Override\n public EditHistory[] newArray(int size) {\n return new EditHistory[size];\n }", "public byte [] getBuf() {\r\n return bop.getBuf();\r\n }", "private void clearBuffer() {\n\t\tfor (int i = 0; i < buffer.length; i++) {\n\t\t\tbuffer[i] = 0x0;\n\t\t}\n\t}", "void getChars(char dst[], int dstBegin) {\n\t\tSystem.arraycopy(value, 0, dst, dstBegin, value.length);\n\t}", "public static void main(String[] args) {\n\t\tint [] Num = {1,2,3,4,5};\n\t\tint [] newNum = new int[10];\n//\t\tfor(int i=0;i<Num.length;i++) {\n//\t\t\tnewNum[i] = Num[i];\n//\t\t}\n//\t\tnewNum = Num;\n\t\tSystem.arraycopy(Num,0, newNum,0,Num.length);\n\t\tSystem.out.println(newNum);\n\t}", "public synchronized Object[] clearIncoming() {\n Object[] incoming = new Object[ content.size() ] ;\n for (int i=0;i<content.size();i++) {\n incoming[i] = content.get(i) ;\n }\n content.clear();\n return incoming ;\n }", "public Double[][] toPast() throws IndexOutOfBoundsException;", "public ShallowCopyEx(int[] values) {\n data = values;\n }", "@Override\n public void clear() {\n array.reset();\n }", "@Override\n BinaryArrayReadWrite clone();", "public ArrayList<Object> readTrendBuffer(){\n try {\n ReadRangeAck ack = DeviceService.localDevice.send(bacnetDevice, new ReadRangeRequest(getObjectIdentifier(),\n PropertyIdentifier.logBuffer, null,\n new ReadRangeRequest.ByPosition(0,1000))).get();\n return new ArrayList<>(ack.getItemData().getValues());\n } catch (BACnetException e) {\n LOG.warn(\"Can't read {} of: {}\",PropertyIdentifier.logBuffer.toString(),getObjectName());\n }\n return null;\n }", "public SortingBuffer(int numberOfThreads) \r\n {\r\n this.numberOfThreads = numberOfThreads;\r\n currentValue = new int[numberOfThreads];\r\n // Use a sentinel value to initialize array\r\n Arrays.fill(currentValue, Integer.MIN_VALUE);\r\n }", "@Override\r\n\tpublic T[] toArray() {\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tT[] result = (T[])new Object[topIndex + 1];\r\n\t\tfor(int index = 0; index < result.length; index ++) {\r\n\t\t\tresult[index] = stack[index];\r\n\t\t}\r\n\treturn result;\r\n\t}", "public static byte[] ByteCopy(ByteBuffer b) {\n \tbyte[] output = new byte[b.limit()];\n \tfor (int i = 0; i < b.limit(); i++) {\n \t\toutput[i] = b.get(i);\n \t}\n \treturn output;\n }", "public int[] clone()\n\t{\t\n\t\tint[] newArray = new int[array.length];\n\t\tfor (int index = 0; index < arraySize; index++)\n\t\t{\n\t\t\tnewArray[index] = array[index];\n\t\t}\n\t\treturn newArray;\n\t}", "public final char[] resizeBuffer(int newSize) { \n\t\tif (mTermBuffer.length < newSize){\n\t\t\t// Not big enough; create a new array with slight\n\t\t\t// over allocation and preserve content\n\t\t\tfinal char[] newCharBuffer = new char[ArrayUtil.oversize(newSize, JvmUtil.NUM_BYTES_CHAR)];\n\t System.arraycopy(mTermBuffer, 0, newCharBuffer, 0, mTermBuffer.length);\n\t mTermBuffer = newCharBuffer;\n\t\t}\n\t\treturn mTermBuffer;\n\t}", "public void copyInto(Object[] anArray);", "public static float[] copyOfRange(float[] original, int from, int to)\r\n\t{\r\n\t\tif (from > to)\r\n\t\t\tthrow new IllegalArgumentException(\"The initial index is after \" +\r\n\t\t\t\t\t\"the final index.\");\r\n\t\tfloat[] newArray = new float[to - from];\r\n\t\tif (to > original.length)\r\n\t\t{\r\n\t\t\tSystem.arraycopy(original, from, newArray, 0,\r\n\t\t\t\t\toriginal.length - from);\r\n\t\t\tArrays.fill(newArray, original.length, newArray.length, 0f);\r\n\t\t}\r\n\t\telse\r\n\t\t\tSystem.arraycopy(original, from, newArray, 0, to - from);\r\n\t\treturn newArray;\r\n\t}", "private static Tuple parseArray(ABIToken leafToken, int arrayLength, ByteBuffer buffer) {\n Object[] array = (Object[]) Array.newInstance(leafToken.abiType, arrayLength);\n // Now, populate the required length.\n for (int i = 0; i < arrayLength; i++) {\n ABIToken token = TOKEN_MAP.get(buffer.get());\n Tuple object = parseNonArray(token, buffer);\n array[i] = object.value;\n }\n return new Tuple(array.getClass(), array);\n }", "public void initializeArray(){\n if(topOfStack==-1){\n for(int i=0;i<this.arr.length;i++){\n this.arr[i]=Integer.MIN_VALUE;\n }\n }\n }", "private String getDataFromBuffer(){\r\n int bufferDataSize = mBufferData.size();\r\n StringBuilder temp = new StringBuilder();\r\n \r\n for (int i = 0; i < bufferDataSize; i++) {\r\n temp.append(mBufferData.remove());\r\n }\r\n return temp.toString();\r\n }", "public long[] toArray() {\n/* 406 */ long[] array = new long[(int)(this.max - this.min + 1L)];\n/* 407 */ for (int i = 0; i < array.length; i++) {\n/* 408 */ array[i] = this.min + i;\n/* */ }\n/* 410 */ return array;\n/* */ }" ]
[ "0.60725766", "0.5932532", "0.5895393", "0.5620845", "0.5603334", "0.55717784", "0.55674475", "0.5547964", "0.55476254", "0.5535233", "0.5518511", "0.55051696", "0.5476427", "0.5464652", "0.5449132", "0.5427052", "0.54217184", "0.5416602", "0.5392184", "0.53866374", "0.5379005", "0.5359689", "0.5351614", "0.5336535", "0.5336321", "0.5335201", "0.5329718", "0.53233725", "0.5310235", "0.52764344", "0.5272166", "0.5271511", "0.51938856", "0.5182866", "0.51723546", "0.5158571", "0.514971", "0.5149103", "0.51201737", "0.5104844", "0.50939065", "0.5079593", "0.50762475", "0.5064465", "0.50630623", "0.5032082", "0.5027019", "0.501742", "0.50129706", "0.5010282", "0.5010005", "0.49921617", "0.49913108", "0.49821624", "0.49805677", "0.49791443", "0.4978351", "0.4976706", "0.4975237", "0.4966977", "0.49661395", "0.49643236", "0.49608782", "0.49604547", "0.4957915", "0.49572307", "0.49570248", "0.49498218", "0.49465844", "0.4944799", "0.49415153", "0.49220625", "0.49218974", "0.4919362", "0.49043253", "0.4903317", "0.49018347", "0.4899762", "0.48967892", "0.48891842", "0.4885434", "0.48841244", "0.4884065", "0.48712286", "0.48706782", "0.48691836", "0.48663402", "0.48515838", "0.48441303", "0.48368162", "0.48361963", "0.4832471", "0.48312622", "0.48273274", "0.48184088", "0.48152664", "0.4806815", "0.48038727", "0.4796812", "0.47954035", "0.47873008" ]
0.0
-1
Returns the latest value that has been buffered or null if no such value present.
T latest();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public E pollLast() {\r\n\t\tif (isEmpty()) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tE ret = (E) data.get(data.size() - 1);\r\n\t\tdata.remove(data.size() - 1);\r\n\t\treturn ret;\r\n\t}", "public T getLast() {\n if (this.getSize() > 0) {\n return buffer[index];\n }\n return null;\n }", "@Override\r\n\tpublic E pollLast() {\n\t\treturn null;\r\n\t}", "public synchronized Object get() {\n try {\n Object obj = queue.take().getElement();\n\n // set next offset\n delayOffset = System.currentTimeMillis();\n\n return obj;\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n return null;\n }", "synchronized public long peek() {\n return currValue;\n }", "public Object peek()\n {\n return queue.peekLast();\n }", "@Override\n\tpublic T peek() {\n\t\treturn last.getValue();\n\t}", "public E peek() {\n try {\n return b(1, (Long) null, (TimeUnit) null);\n } catch (InterruptedException unused) {\n return null;\n }\n }", "@Override\n\tpublic SmCdr2 getCurrentValue() throws IOException, InterruptedException {\n\t\treturn null;\n\t}", "public process get_last() {\n\t\treturn queue.getLast();\n\t}", "public E poll() {\r\n\t\tif (isEmpty()) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tE ret = (E) data.get(0);\r\n\t\tdata.remove(0);\r\n\t\treturn ret;\r\n\t}", "public Object peek() {\n\t\treturn get(getSize() - 1);\n\t}", "public T poll() {\n if (this.size > 0) {\n T min = (T) pq[0];\n pq[0] = pq[this.size - 1];\n size--;\n percolateDown(0);\n return min;\n } else {\n return null;\n }\n }", "public T peek() {\n if(fillCount==0){\n throw new RuntimeException(\"Ring buffer underflow\");\n }\n T return_val_p = rb[first];\n return return_val_p;\n }", "public E pollLast() {\n\t\tif (mSize == 0)\n\t\t\treturn null;\n\t\n\t\tE retVal = remove(getNode(size() - 1));\n\n\t\tmSize--;\n\t\tmodCount++;\n\n\t\treturn retVal;\n\t}", "public T getLast() {\n return this.getHelper(this.indexCorrespondingToTheLatestElement).data;\n }", "public E poll() {\n try {\n return b(2, (Long) null, (TimeUnit) null);\n } catch (InterruptedException unused) {\n return null;\n }\n }", "public int last() {\n\t\tif (bufferIndex == bufferLast)\n\t\t\treturn -1;\n\t\tsynchronized (buffer) {\n\t\t\tint outgoing = buffer[bufferLast - 1];\n\t\t\tbufferIndex = 0;\n\t\t\tbufferLast = 0;\n\t\t\treturn outgoing;\n\t\t}\n\t}", "public E pollLast();", "@Override\r\n\tpublic Object last(){\r\n\t\tcheck();\r\n\t\treturn tail.value;\r\n\t}", "@Override\n public ImmutableBytesWritable getLatestValue(ColumnReference ref, long ts) {\n if (isEmptyKeyValue(table, ref)) {\n return null;\n }\n byte[] family = ref.getFamily();\n byte[] qualifier = ref.getQualifier();\n Map<byte [], List<Cell>> familyMap = dataMutation.getFamilyCellMap();\n List<Cell> kvs = familyMap.get(family);\n if (kvs == null) {\n return null;\n }\n for (Cell kv : kvs) {\n if (Bytes.compareTo(kv.getFamilyArray(), kv.getFamilyOffset(), kv.getFamilyLength(), family, 0, family.length) == 0 &&\n Bytes.compareTo(kv.getQualifierArray(), kv.getQualifierOffset(), kv.getQualifierLength(), qualifier, 0, qualifier.length) == 0) {\n ImmutableBytesPtr ptr = new ImmutableBytesPtr();\n kvBuilder.getValueAsPtr(kv, ptr);\n return ptr;\n }\n }\n return null;\n }", "public E poll() {\n\t\tif (mSize == 0)\n\t\t\treturn null;\n\t\tE retVal = mHead.next.data;\n\t\tremove(mHead.next);\n\n\t\tmodCount++;\n\t\tmSize--;\n\n\t\treturn retVal;\n\t}", "public T peek() {\n if (isEmpty()) {\n throw new RuntimeException(\"Ring buffer underflow\");\n }\n return rb[first];\n // Return the first item. None of your instance variables should change.\n }", "public Object get() {\n while(isLocked() ) {\n try {\n Thread.sleep(10);\n }\n catch(InterruptedException ie) {\n // do nothing\n }\n }\n \n Object retVal = getHead();\n LAST_READ_TIME = now();\n return retVal;\n }", "public synchronized final Object readObject() {\n\t\tif (!inQueue.isEmpty())\n\t\t\treturn inQueue.dequeue();\n\t\telse return null;\n\t}", "public synchronized VideoData popVideoData() {\r\n if (needBuffering)\r\n return null;\r\n LogUtil.e(tag, \"popVideoData poll\");\r\n return m_videoframePool.poll();\r\n }", "@Override\r\n public Entry<K, V> pollLastEntry() {\n return null;\r\n }", "@Override\r\n\tpublic E pollFirst() {\n\t\treturn null;\r\n\t}", "public final T getValue() {\n return this.getValue(this.getBuffer());\n }", "public Result getCurrentValue() throws IOException, InterruptedException {\n return value;\n }", "public T peek() {\r\n return get(size() - 1);\r\n\t}", "@Override\r\n\tpublic E poll() {\n\t\treturn null;\r\n\t}", "ZonedDateTime lastRefTimestamp() {\n ArticleRef last = buffer.peekLast();\n if(last == null) {\n return null;\n }\n return last.getTimestamp();\n }", "public E pollFirst() {\n\t\tif (mSize == 0)\n\t\t\treturn null;\n\t\tE retVal = mHead.next.data;\n\t\tremove(mHead.next);\n\n\t\tmodCount++;\n\t\tmSize--;\n\n\t\treturn retVal;\n\t}", "public E poll(){\n int cnt = 0;\n long expect = front;\n int index;\n int curTryNum = tryNum;\n E e ;\n for(;;) {\n HighPerformanceQueue q = this;\n expect = front;\n index = (int)(expect&(max_size-1));\n if(available[index]) {\n e = (E) data[index];\n //TODO Additional write burden is added to the read operation\n available[index] = false;\n if (help.compareAndSwapLong(q, frontOffset, expect, expect + 1)) {\n // TODO Dynamic maintenance retries\n break;\n }\n available[index] = true;\n }\n cnt++;\n if(cnt==tryNum){\n return null;\n }\n }\n return e;\n }", "public V getLatest() {\n return lastItemOfList(versions);\n }", "@Override\r\n\tpublic Text getCurrentValue() throws IOException, InterruptedException {\n\t\treturn this.value;\r\n\t}", "public T peek()\n {\n if (isEmpty())\n return null;\n \n return first.getData();\n }", "public ByteBuffer getUnboundedValue(T key) {\n int index = evaluator.evaluate(key);\n if (index < 0) {\n return null;\n }\n return mappedBuffer.asReadOnlyBuffer().position(offsets[index]).order(ByteOrder.LITTLE_ENDIAN);\n }", "public V get() {\n\t\treturn this.get(0, TimeUnit.SECONDS);\n\t}", "public RTWValue lastAsValue();", "synchronized byte getCurrentValueLo()\n {\n return (byte)getCurrentValue();\n }", "public T poll() {\n if(size==0)\n return null;\n else {\n T temp= (T) pq[0];\n pq[0]=pq[size-1];\n size--;\n percolateDown(0);\n return temp;\n\n\n }\n }", "public int peek()\n\t{\n\t\tif (head == null)\n\t\t{\n\t\t\tthrow new NullPointerException(\"Queue is empty\");\n\t\t}\n\t\treturn head.value;\n\t}", "public Estimate poll() {\n Estimate e = null;\n Estimate[] newQueue = new Estimate[queue.length];\n \n if (last > 0) {\n for(int i = 0; i < last; i ++) {\n newQueue[i] = queue[i +1]; \n }\n }\n last--;\n e = queue[0];\n queue = newQueue;\n \n return e;\n }", "public O last()\r\n {\r\n if (isEmpty()) return null;\r\n return last.getObject();\r\n }", "@Override\r\n\tpublic E peekLast() {\n\t\treturn null;\r\n\t}", "public Buffer getBuffer() {\n return buffer.getCopy();\n }", "@Nullable\n\tfinal T blockingGet() {\n\t\tif (Schedulers.isInNonBlockingThread()) {\n\t\t\tthrow new IllegalStateException(\"block()/blockFirst()/blockLast() are blocking, which is not supported in thread \" + Thread.currentThread().getName());\n\t\t}\n\t\tif (getCount() != 0) {\n\t\t\ttry {\n\t\t\t\tawait();\n\t\t\t}\n\t\t\tcatch (InterruptedException ex) {\n\t\t\t\tdispose();\n\t\t\t\tThread.currentThread().interrupt();\n\t\t\t\tthrow Exceptions.propagate(ex);\n\t\t\t}\n\t\t}\n\n\t\tThrowable e = error;\n\t\tif (e != null) {\n\t\t\tRuntimeException re = Exceptions.propagate(e);\n\t\t\t//this is ok, as re is always a new non-singleton instance\n\t\t\tre.addSuppressed(new Exception(\"#block terminated with an error\"));\n\t\t\tthrow re;\n\t\t}\n\t\treturn value;\n\t}", "int poll() {\n\n\t\t// check if element can be polled from the queue\n\t\tif (!canPoll)\n\t\t\tthrow new IllegalStateException(\"Queue is Empty!\");\n\n\t\t// poll element into variable and shift pointer\n\t\tint result = queue[qPoll++];\n\t\t\n\t\t// set canPush flag, cuz there's now at least one empty space in the queue\n\t\tcanPush = true;\n\t\t\n\t\t/*\n\t\t * If poll pointer went beyond array bounds - return it to the first position\n\t\t */\n\t\t\n\t\tif (qPoll == queue.length)\n\t\t\tqPoll = 0;\n\t\t\n\t\t/*\n\t\t * If poll pointer now points to the push pointer - then queue is empty\n\t\t * Set flag\n\t\t */\n\t\t\n\t\tif (qPoll == qPush)\n\t\t\tcanPoll = false;\n\t\t\n\t\t// return previously saved element\n\t\t\n\t\treturn result;\n\t}", "public T peek()\n {\n\n if (ll.getSize()==0){\n return null;\n }else\n return ll.getData(ll.getSize()-1);\n }", "protected ValueVersion getLastChunk() {\n\n if (numChunks < 0) {\n throw new IllegalStateException(\"Chunk count is unknown:\" +\n numChunks);\n }\n\n if (numChunks == 0) {\n return null;\n }\n\n final long superChunkId = ((numChunks - 1) / chunksPerPartition) + 1;\n final long chunkId = ((numChunks - 1) % chunksPerPartition) + 1;\n\n final Key lastChunkKey =\n chunkKeyFactory.create(internalLOBKey, superChunkId, chunkId);\n\n return kvsImpl.get(lastChunkKey, Consistency.ABSOLUTE,\n chunkTimeoutMs, TimeUnit.MILLISECONDS);\n }", "T poll(){\n if(isEmpty()){\n return null;\n }\n T temp = (T) queueArray[0];\n for(int i=0; i<tail-1;i++){\n queueArray[i] = queueArray[i+1];\n }\n tail--;\n return temp;\n }", "EmulatorDriver.Cmd poll()\n {\n synchronized (QUEUE_LOCK)\n {\n if ( ! queue.isEmpty() )\n {\n return queue.remove(0);\n }\n return isWaiting() ? take() : null;\n }\n }", "@Override\n public E getLast() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"No elements in dequeue\");\n }\n return dequeue[tail];\n }", "private int availableFirst() {\n return data.isEmpty() ? 0 : data.getFirst().remaining();\n }", "@Override\r\n public CustomProcess peekBest() {\r\n if (data[0] == null || isEmpty()) {\r\n throw new NoSuchElementException(\"queue is empty\");\r\n }\r\n return data[0];\r\n }", "public int peek()\n\t{\n\t\tif (isEmpty() == true)\n\t\t{\n\t\t\tthrow new NullPointerException(\"Queue is empty!\");\n\t\t}\n\t\treturn head.value;\n\t}", "public long poll() {\n\t\tsuper.lockSingle();\n\t\ttry {\n\t\t\tif (!array.isEmpty()) {\n\t\t\t\treturn array.poll();\n\t\t\t}\n\t\t} catch (Throwable exp) {\n\n\t\t} finally {\n\t\t\tsuper.unlockSingle();\n\t\t}\n\t\treturn 0L;\n\t}", "public synchronized V getValue(K key) {\n SoftReference<V> ref = cache.get(key);\n\n // Is the key-value pair absent from the cache?\n if (ref == null) {\n return null;\n }\n\n // Is the reference to the value dead?\n V value = ref.get();\n recentlyUsed.remove(key);\n if (value == null) {\n cache.remove(key);\n } else {\n recentlyUsed.add(0, key);\n }\n return value;\n }", "public T get(int position) {\n if (this.getSize() > 0) {\n return buffer[position];\n }\n return null;\n }", "public V getLastValue()\n\t{\n\t\tV amount = null;\n\t\tfinal Entry< Double, V > entry = getLastEntry();\n\t\tif( entry != null )\n\t\t{\n\t\t\tamount = entry.getElement();\n\t\t}\n\t\treturn amount;\n\t}", "public double getReadingOnce() {\n return this.getDataRef().getOnce();\n }", "public Object peek()\n {\n if(this.isEmpty()){throw new QueueUnderflowException();}\n return front.getData();\n }", "public Object get() {\r\n Object res;\r\n synchronized (this) {\r\n while (empty) {\r\n try {\r\n wait();\r\n } catch (InterruptedException ex) {\r\n System.err.println(\"Unexpected interrupt\");\r\n }\r\n }\r\n res= data;\r\n empty= true;\r\n notifyAll();\r\n }\r\n return res;\r\n }", "public Block getLatestBlock() {\n int totalLength = blockChain.size();\n return this.blockChain.get(totalLength - 1);\n }", "public Double peek() {\n\t\tif (arr.length > 0) {\n\t\t\treturn arr[0];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public E poll() {\n E item;\n try {\n item = remove();\n } catch (NoSuchElementException e) {\n return null;\n }\n return item;\n }", "public ValueType peek() {\r\n // TODO\r\n return null;\r\n }", "public T poll() {\n if (size == 0) {\n return null;\n }\n\n // set returned value to queue[0]\n T value = (T) array[0];\n\n // decrease size - we are removing element\n size--;\n\n // move queue 1 place left\n System.arraycopy(array, 1, array, 0, size);\n\n // clear last element\n array[size] = null;\n\n return value;\n }", "public E last() {\n if (this.isEmpty()) return null;\r\n return this.tail.getElement();\r\n }", "public LocalVariable latestLocalVariable()\n {\n return lastLocal;\n }", "public Object firstElement() {\n return _queue.firstElement();\n }", "synchronized public ClientMessage poll() {\n if (!initialized) {\n init();\n }\n if (head == size) {\n return null;\n }\n ClientMessage tmp = reqs[order[head++]];\n reqs[order[head - 1]] = null;\n if (head == order.length) {\n head = 0;\n }\n //System.out.println(\"pulled from rc queue\");\n bSize -= tmp.getTotalSize();\n entries--;\n return tmp;\n }", "public int peekBack() {\n if(tail == null) {\n return Integer.MIN_VALUE;\n }\n\n return tail.val;\n }", "public SensorData getLastSensorData() {\n if (mSensorData.size() > 0) {\n for (SensorData sensorData : mSensorData) {\n if (sensorData.isDatasetComplete()) {\n return sensorData;\n }\n }\n }\n return null;\n }", "@Deprecated\n/* */ public Queue<Object> lastInboundBuffer() {\n/* 265 */ return inboundMessages();\n/* */ }", "public Object peek() {\n\t\t\n\t\t// Check: Queue is empty\n\t\tif (isEmpty()) {\n\t\t\tthrow new NoSuchElementException(\"Queue is empty. Nothing to peek at.\");\n\t\t}\n\t\t\n\t\treturn head.data;\n\t}", "public E peek() {\n\t\tif (isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\treturn apq.get(1);\n\t}", "public synchronized Card peek()\n {\n if (cards.isEmpty())\n return null;\n \n return cards.lastElement();\n }", "public int top() {\n return queue.getLast();\n }", "public process get_first() {\n\t\treturn queue.getFirst();\n\t}", "public T pollFirst() {\n if (!isEmpty()) {\n T polled = (T) list[startIndex];\n startIndex++;\n if (isEmpty()) {\n startIndex = 0;\n nextindex = 0;\n }\n return polled;\n }\n return null;\n }", "public int top() {\n return queue.peekLast();\n }", "public FixedBitSet getLastValue() {\n return value;\n }", "public float getLastValue() {\n // ensure float division\n return ((float)(mLastData - mLow))/mStep;\n }", "public abstract VALUEIN getCurrentValue() throws IOException, \n InterruptedException;", "@Override\n public Runnable poll() {\n return LIFO ? super.pollLast() : super.poll();\n }", "public GameMessage getLatestBid(String gameId) {\r\n Deque<GameMessage> msgs = (Deque)msgMapping.get(gameId);\r\n if (msgs != null) {\r\n return msgs.getLast();\r\n }\r\n return null;\r\n }", "public E peek(){\r\n if(isEmpty())\r\n return null;\r\n\r\n return queue[currentSize-1]; //return the object without removing it\r\n }", "public Object peek() {return collection.get(collection.size() - 1);}", "public E poll() {\n\t\tif (apq.isEmpty())\n\t\t\treturn null;\n\t\tE retValue = apq.get(1);\n\t\tswap(1, apq.size() - 1); // -1 changed, change back if it doesnt work\n\t\tapq.remove(apq.size() - 1); // -1 changed, change back if it doesnt work\n\t\tdownheap(1);\n\t\treturn retValue; // implement this method\n\t}", "public Object getLastObject()\n {\n\tcurrentObject = lastObject;\n\n if (lastObject == null)\n \treturn null;\n else\n \treturn AL.get(AL.size()-1);\n }", "public int peek() {\n return queue.firstElement();\n }", "@Override\n public int peek() {\n int result = 0;\n if (first != null) {\n result = first.value;\n }\n return result;\n }", "public Object peek() {\r\n\t\treturn al.getElementAt(al.listSize - 1);\r\n\t}", "public frameTableElement findVictimFIFO(){\n int smallestLoadTime = Integer.MAX_VALUE;\n frameTableElement correspondingElement = null;\n\n for(int i=0; i< frameTable.getSize(); i++){\n frameTableElement currElement = frameTable.getElement(i);\n if(currElement.getTimeLoaded() < smallestLoadTime){\n smallestLoadTime = currElement.getTimeLoaded();\n correspondingElement = currElement;\n }\n }\n\n return correspondingElement;\n\n }", "public Object peek() {\n\t\tcheckIfStackIsEmpty();\n\t\tint indexOfLastElement = collection.size() - 1;\n\t\tObject lastElement = collection.get(indexOfLastElement);\n\t\t\n\t\treturn lastElement;\n\t}", "public long currentReadBytes()\r\n/* 209: */ {\r\n/* 210:398 */ return this.currentReadBytes.get();\r\n/* 211: */ }", "public T peek() {\n return top.getData();\n }", "public Buffer getEmptyBuffer()\n {\n // System.out.println(getClass().getName()+\":: getEmptyBuffer\");\n\n switch (protocol)\n {\n case ProtocolPush:\n if (!isEmptyBufferAvailable() && reset)\n return null;\n reset = false;\n return circularBuffer.getEmptyBuffer();\n case ProtocolSafe:\n synchronized (circularBuffer)\n {\n reset = false;\n while (!reset && !isEmptyBufferAvailable())\n {\n try\n {\n circularBuffer.wait();\n } catch (Exception e)\n {\n }\n }\n if (reset)\n return null;\n Buffer buffer = circularBuffer.getEmptyBuffer();\n circularBuffer.notifyAll();\n return buffer;\n }\n\n default:\n throw new RuntimeException();\n }\n }" ]
[ "0.68346936", "0.67748296", "0.67212117", "0.6687552", "0.6436464", "0.6401183", "0.6398918", "0.6355749", "0.6321633", "0.6307649", "0.6300775", "0.6157277", "0.6157098", "0.61472964", "0.6058", "0.60370314", "0.6032514", "0.60274005", "0.6013877", "0.6010723", "0.5984883", "0.59681904", "0.5964315", "0.5958298", "0.59577614", "0.5948271", "0.5873591", "0.5869191", "0.58533436", "0.5853139", "0.58450884", "0.5821999", "0.58125186", "0.58077633", "0.5787286", "0.5786641", "0.57662565", "0.57632154", "0.5759641", "0.5731601", "0.57217956", "0.5717539", "0.57118154", "0.5691483", "0.56877756", "0.56786734", "0.5672855", "0.5668669", "0.56643623", "0.5661784", "0.5660871", "0.56577677", "0.56535614", "0.5641954", "0.564184", "0.5641414", "0.56354153", "0.5631312", "0.56284237", "0.56120574", "0.56010556", "0.55988306", "0.5591976", "0.55902016", "0.5584288", "0.5584153", "0.5583319", "0.55709636", "0.55682415", "0.5564831", "0.55644006", "0.55636805", "0.5560042", "0.5549228", "0.55483127", "0.55463", "0.55428344", "0.5542043", "0.5530816", "0.5529826", "0.55271935", "0.55233896", "0.55160266", "0.551516", "0.55146146", "0.55091155", "0.5507016", "0.55059785", "0.5505738", "0.5495506", "0.5493954", "0.54921407", "0.5491366", "0.54888755", "0.5481277", "0.547957", "0.54716504", "0.5465914", "0.5462336", "0.54508835", "0.5440878" ]
0.0
-1
It is the main function
public static void main(String args[]) { f=new steg(); f.setSize(800,800); f.setTitle("STEGANOGRAPHY "); f.show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main() {\n \n }", "public static void main()\n\t{\n\t}", "public static void main(){\n\t}", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "public static void main(String[]args) {\n\t\n\t\t\n\n}", "public static void main(String[] args)\r\t{", "public static void main(String[] args) {\n \n \n \n \n }", "public static void main(String[] args) {\n \n \n \n\t}", "public static void main(String[] args) {\n \r\n\t}", "public static void main(String[] args)\r\n {\n \r\n \r\n }", "public static void main(String[] args) {\r\n// Use for unit testing\r\n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n \n }", "public static void main(String[] args) {\n \n \n }", "public static void main(String[] args){\n\t\t\n\t\t\n \t}", "public static void main(String[] args) {\r\n \r\n }", "public static void main(String[] args) {\r\n \r\n }", "public Main() {\n \n \n }", "public static void main(String[] args) throws Exception {\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public static void main() {\n }", "public static void main (String args[]) {\n\t\t\n }", "private Main() {\n\n super();\n }", "public static void main (String []args){\n }", "public static void main(String[] args) {\n\t \t\n\t \t\n\t }", "public static void main(String []args){\n\n }", "public void main(){\n }", "public static void main(String args[]){\n\t\t\n\t\n\t}", "public static void main(String[] args)\r\n {\r\n \r\n \r\n \r\n }", "public static void main(String args[]) {\r\n }", "public static void main(String[] args) {\n \n\n }", "public static void main(String[] args) {\n \n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args){\n\t\t\r\n\t}", "public static void main (String[] args) {\r\n\t\t \r\n\t\t}", "public static void main(String args[]){\n\t\t\n\t}", "public static void main(String[] args) {\n\n\t\t\n\t\t\n\t}", "public static void main(String []args){\n }", "public static void main(String []args){\n }", "public static void main(String[] args){\n \t\n }", "public static void main(String[] args) {\n\r\n\t\t\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n \r\n}", "public static void main (String[] args) {\n\t\t\n\t}", "public static void main(String[] args) \n {\n\t \n\t \n\t \n}", "public static void main(String[] args) {\n\t \t\n\t \t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\t\n\n\t}", "public static void main(String[] args) {\n \n\t\t}", "public static void main(String[] args) {\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\t\n\t\t\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n \n\t}", "public static void main(String[] args) {\n\t\r\n}", "public static void main(String args[]){\n\t\t\r\n\t}", "public static void main (String [] args){\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public Main() {\r\n\t}", "public static void main(String[] args){\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n }", "public void Main(){\n }", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\n\t}", "public Main() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\r\n\t}", "public static void main(String args[]) { \r\n }" ]
[ "0.78501505", "0.7673759", "0.76420206", "0.7559538", "0.7514963", "0.7502621", "0.7405485", "0.73506206", "0.734914", "0.73310703", "0.73179835", "0.73142284", "0.73142284", "0.73142284", "0.73142284", "0.73142284", "0.73142284", "0.7303846", "0.7303846", "0.73014796", "0.730034", "0.730034", "0.7290007", "0.7281259", "0.72804904", "0.72797775", "0.7249657", "0.72477674", "0.724352", "0.72422904", "0.72372466", "0.723122", "0.72126436", "0.7199777", "0.71991605", "0.71953225", "0.71904534", "0.71904534", "0.7187625", "0.7182196", "0.71761936", "0.7175264", "0.71681076", "0.71681076", "0.71626943", "0.71622795", "0.7156799", "0.71510786", "0.71486294", "0.7146589", "0.7133668", "0.7133118", "0.7131984", "0.71317077", "0.7119476", "0.7119476", "0.7119476", "0.7119476", "0.71143186", "0.7113456", "0.7097432", "0.70872986", "0.7084929", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.7084639", "0.70806974", "0.70806974", "0.70806974", "0.70806974", "0.7078694", "0.70774126", "0.7076459", "0.7074374", "0.7060922", "0.7059808" ]
0.0
-1
It reads the encrypted data from the image
public void init241() { width= p2[21]<<24 | p2[20]<<16 | p2[19]<<8 | p2[18]; height= p2[25]<<24 | p2[24]<<16 | p2[23]<<8 | p2[22]; int extra=(width*3)%4; if(extra!=0) padding=4-extra; int x,z=54; l=0; int j=0; i=0; for(int q=0;q<height;q++) { x=0; while(x<width) { b=p2[z]&0xff; binary[j++]=b&0x01; g=p2[z+1]&0xff; binary[j++]=g&0x01; r=p2[z+2]&0xff; binary[j++]=r&0x01; pix[l]= 255<<24 | r<<16 | g<<8 | b; z=z+3; x++; l++; } z=z+padding; } int k; x=0; stringcon(); for(i=l-width;i>=0;i=i-width) { for(k=0;k<width;k++) { pixels[x]=pix[i+k]; // pixels1[x]=pix[i+k]; x++; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public byte[] getEncryptedContent() throws CoseException{\n if (rgbEncrypt == null) throw new CoseException(\"No Encrypted Content Specified\");\n \n return rgbEncrypt;\n }", "public void readDataFromFile(View view) throws GeneralSecurityException, IOException {\n encryptedFile = new EncryptedFile.Builder(\n context,\n new File(MainActivity.this.getFilesDir(),\"test.txt\"), // File want to read\n mainKey, // Master key for encryption\n EncryptedFile.FileEncryptionScheme.AES256_GCM_HKDF_4KB) // Algorithm or FileEncryptionScheme for encryption\n .build();\n\n\n InputStream inputStream = encryptedFile.openFileInput(); // Open the encrypted file to read\n int next = inputStream.read(); // Read the encrypted file\n\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); // ByteArrayOutputStream to print the content of file to read\n\n while (next != -1){\n byteArrayOutputStream.write(next); // Write the file content in byteArrayOutputStream object\n next = inputStream.read(); // Read the next character until it encounter the end (-1)\n }\n\n byte[] plainText = byteArrayOutputStream.toByteArray(); // Convert into byte array\n\n String textString = new String(plainText); // Create a new string with converted plain text byte array\n\n textView.setText(textString); // display the file content in textView\n }", "protected int readEncrypted()\n throws IOException\n {\n ByteBuffer buff = f_buffEncIn;\n int ofPos = buff.position();\n int ofLimit = buff.limit();\n int cbRead = 0;\n\n try\n {\n // prep the buffer for additional writes\n if (ofLimit == ofPos)\n {\n buff.clear();\n ofLimit = ofPos = 0;\n }\n else\n {\n buff.position(buff.limit())\n .limit(buff.capacity());\n }\n\n return cbRead = f_delegate.read(buff);\n }\n finally\n {\n // restore the position and limit to reference just the encrypted\n // segment\n buff.position(ofPos)\n .limit(ofLimit + (cbRead < 0 ? 0 : cbRead));\n }\n }", "public static void main(String[] args) \r\n {\r\n /*\r\n String data = \"This is a very important statement.\";\r\n String key = \"How old is my computer?\";\r\n KeyGenerator kGen = new KeyGenerator(key);\r\n String nK = kGen.getNumericKey();\r\n \r\n ArmstrongManager aMgr = new ArmstrongManager(nK);\r\n ColorManager cMgr = new ColorManager(nK);\r\n \r\n String encData =\"\";\r\n int temp;\r\n int i;\r\n for(i =0 ; i < data.length(); i++)\r\n {\r\n temp = aMgr.encrypt(data.charAt(i));\r\n temp = cMgr.encrypt(temp);\r\n encData = encData + (char)temp;\r\n }\r\n \r\n String decData= \"\";\r\n for(i =0 ; i < encData.length(); i++)\r\n {\r\n temp = cMgr.decrypt(encData.charAt(i));\r\n temp = aMgr.decrypt(temp);\r\n \r\n decData = decData + (char)temp;\r\n }\r\n \r\n \r\n System.out.println(\"data: \"+ data + \" \" + data.length());\r\n System.out.println(\"enc data: \"+ encData + \" \" + encData.length());\r\n System.out.println(\"dec data: \"+ decData + \" \" + decData.length());\r\n */\r\n \r\n try\r\n {\r\n //String src = \"d:/a.txt\";//images/kids.jpg\";\r\n //String enc = \"d:/e_a.txt\";//images/e_kids.jpg\";\r\n //String dec = \"d:/d_a.txt\";//images/d_kids.jpg\";\r\n String src = \"d:/images/kids.jpg\";\r\n String enc = \"d:/images/e_kids.jpg\";\r\n String dec = \"d:/images/d_kids.jpg\";\r\n\r\n String key = \"How old is my computer?\";\r\n\r\n Encryptor objEnc = new Encryptor(key);\r\n Decryptor objDec = new Decryptor(key);\r\n\r\n objEnc.encrypt(src, enc);\r\n System.out.println(\"Encryption Done\");\r\n \r\n objDec.decrypt(enc, dec);\r\n System.out.println(\"Decryption Done\");\r\n \r\n\r\n }\r\n catch(Exception ex)\r\n {\r\n System.out.println(\"Err: \" +ex.getMessage());\r\n }\r\n }", "@Override\n public int read() throws IOException {\n int r = -1;\n \n if (encryptedDataBuffer!=null && pos>=encryptedDataBuffer.length && !closed)\n fillBuffer();\n \n if (encryptedDataBuffer!=null && pos<encryptedDataBuffer.length)\n r = (int)encryptedDataBuffer[pos++]; // next element in the buffer\n return r;\n }", "byte[] readBytes();", "public byte[] readImagePNG(BufferedImage bufferedimage) throws IOException{\n byte[] data = ImageUtil.toByteArray(bufferedimage);\r\n /* \r\n for (int i = 0; i < data.length; i++) {\r\n if(i!=0&&i%4==0)\r\n System.out.println();\r\n System.out.format(\"%02X \",data[i]);\r\n }\r\n */ \r\n \r\n \r\n \r\n \r\n byte[] stximage = getStximage();\r\n byte[] etximage = getEtximage();\r\n \r\n byte[] stxdata = new byte[stximage.length];\r\n byte[] etxdata = new byte[etximage.length];\r\n byte[] length = new byte[4];\r\n \r\n boolean stxsw=false;\r\n boolean etxsw=false;\r\n byte[] full_data=null;\r\n byte[] only_data=null;\r\n try{\r\n for (int i = 0; i < data.length; i++) {\r\n System.arraycopy(data, i, stxdata,0, stxdata.length);\r\n stxsw = ByteUtil.equals(stximage, stxdata);\r\n int subindex=i+stxdata.length;\r\n if(stxsw){\r\n System.arraycopy(data, subindex, length,0, length.length);\r\n int length_fulldata = ConversionUtil.toInt(length);\r\n // System.out.format(\"%02X %d subIndex[%d]\",data[subindex],length_fulldata,subindex);\r\n \r\n \r\n subindex+=i+length.length;\r\n int etx_index= subindex+ length_fulldata;\r\n // System.out.println(\"subindex : \"+subindex+\" etx_index : \"+etx_index);\r\n System.arraycopy(data, etx_index, etxdata,0, etxdata.length);\r\n \r\n// for (int j = 0; j < etxdata.length; j++) {\r\n// System.out.format(\"%02X \",etxdata[j]);\r\n// }\r\n \r\n etxsw = ByteUtil.equals(etximage, etxdata);\r\n if(etxsw){\r\n full_data = new byte[etx_index-subindex];\r\n System.arraycopy(data, subindex, full_data,0, full_data.length); //fulldata\r\n break;\r\n }else{\r\n continue;\r\n }\r\n }\r\n \r\n \r\n }\r\n \r\n /////only data search\r\n System.arraycopy(full_data, 0, length,0, length.length);\r\n int length_onlydata = ConversionUtil.toInt(length); \r\n only_data = new byte[length_onlydata];\r\n System.arraycopy(full_data, length.length, only_data,0, only_data.length);\r\n \r\n \r\n \r\n }catch (Exception e) {\r\n return null;\r\n }\r\n \r\n return only_data;\r\n \r\n }", "public static void decrypt() throws IOException{\n\t\tBufferedInputStream in = new BufferedInputStream(new FileInputStream(inFilename));\n\t\tBufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(outFilename));\n\n\t\tbyte[] key; //holds the encryption key\n\n\t\t//get the file length\n\t\tlong fileLength = (new File(inFilename)).length();\n\n\t\t//check the file header marker\n\t\tbyte[] actualHeader = new byte[FILE_HEADER.length];\n\t\tin.read(actualHeader); //read header from the file\n\t\tif (!Arrays.equals(actualHeader, FILE_HEADER)){\n\t\t\tSystem.out.println(\"The file was not encrypted with this program.\");\n\t\t\tSystem.exit(-1); //-1 is an error code\n\t\t}\n\n\t\t/* STAGE 1 - generate decryption key */\n\t\t//read the #padded bits and random salt from the file\n\t\tbyte[] dataFromFile = new byte[129]; //1 byte for #padded bits + 128 bytes for salt\n\t\tin.read(dataFromFile);\n\t\t//separate the #padded bits for use later\n\t\tint numPad = (int)(dataFromFile[0]);\n\t\t//next, generate the message for CubeHash: (password + dataFromFile)\n\t\tbyte[] message = new byte[password.length + dataFromFile.length];\n\t\tSystem.arraycopy(password, 0, message, 0, password.length); //add the password\n\t\tSystem.arraycopy(dataFromFile, 0, message, password.length, dataFromFile.length); //add dataFromFile\n\t\t//finally, (re)generate the encryption key\n\t\tkey = CryptoLib.CubeHash.doCubeHash(message);\n\n\t\t/* STAGE 2 - apply decryption */\n\t\tint currPiece = 0; //keeps track of which piece of the key is being used\n\t\tbyte[] currData = new byte[8]; //holds the data currently being decrypted\n\n\t\t//split the key into 4 pieces of 128 bits each\n\t\tbyte[][] keyPieces = new byte[4][16];\n\t\tfor (int i = 0; i < 4; i++){\n\t\t\tSystem.arraycopy(key, i*16, keyPieces[i], 0, 16);\n\t\t}\n\n\t\t//loop through the rest of the file (except the last block), 8 bytes at a time\n\t\tfor (long i = FILE_HEADER.length + 129; i < fileLength - 8; i += 8){\n\t\t\t//put a chunk of data in currData\n\t\t\tin.read(currData);\n\n\t\t\t//do RC4(key, unTEA(key, data)), then write to file\n\t\t\tout.write(CryptoLib.RC4.doRC4(keyPieces[currPiece],\n\t\t\t\t\t\tCryptoLib.TEA.doUnTEA(keyPieces[currPiece], currData)));\n\n\t\t\t//increment currPiece\n\t\t\tcurrPiece = (currPiece + 1) % 4;\n\t\t}\n\n\t\t//deal with the last chunk of data:\n\t\t//first, read it..\n\t\tin.read(currData);\n\t\t//..decrypt it..\n\t\tcurrData = CryptoLib.RC4.doRC4(keyPieces[currPiece],\n\t\t\t\tCryptoLib.TEA.doUnTEA(keyPieces[currPiece], currData));\n\t\t//..then write it to the file\n\t\tout.write(currData, 0, (8 - numPad));\n\n\t\t/* STAGE 3 - done! */\n\t\tin.close();\n\t\tout.close();\n\t\tSystem.out.println(\"\\nDecryption complete.\");\n\t}", "private void readImage(final InputStream inputStream) throws IOException\n {\n final int lzwCode = inputStream.read();\n\n if (lzwCode < 0)\n {\n throw new IOException(\"No enough data to read LZW code\");\n }\n\n this.colorIndexes = new int[this.width * this.height];\n SubBlock subBlock = SubBlock.read(inputStream);\n\n if (subBlock == SubBlock.EMPTY)\n {\n return;\n }\n\n byte[] data = subBlock.getData();\n\n if (data.length < 4)\n {\n // To avoid some malformed GIF\n return;\n }\n\n this.buffer32 = (data[0] & 0xFF) | ((data[1] & 0xFF) << 8) | ((data[2] & 0xFF) << 16) | ((data[3] & 0xFF) << 24);\n final int clearCode = 1 << lzwCode;\n final int endCode = clearCode + 1;\n int code, oldCode = 0;\n final int[] prefix = new int[4096];\n final byte[] suffix = new byte[4096];\n final byte[] initial = new byte[4096];\n final int[] length = new int[4096];\n final byte[] string = new byte[4096];\n this.initializeStringTable(prefix, suffix, initial, length, lzwCode);\n int tableIndex = (1 << lzwCode) + 2;\n int codeSize = lzwCode + 1;\n int codeMask = (1 << codeSize) - 1;\n Pair<Integer, SubBlock> pair = new Pair<Integer, SubBlock>(0, subBlock);\n\n while (pair.element1 != endCode)\n {\n pair = this.getCode(codeSize, codeMask, inputStream, subBlock, endCode);\n code = pair.element1;\n subBlock = pair.element2;\n\n if (code == clearCode)\n {\n this.initializeStringTable(prefix, suffix, initial, length, lzwCode);\n tableIndex = (1 << lzwCode) + 2;\n codeSize = lzwCode + 1;\n codeMask = (1 << codeSize) - 1;\n\n pair = this.getCode(codeSize, codeMask, inputStream, subBlock, endCode);\n code = pair.element1;\n subBlock = pair.element2;\n if (code == endCode)\n {\n return;\n }\n }\n else if (code == endCode)\n {\n return;\n }\n else\n {\n int newSuffixIndex;\n if (code < tableIndex)\n {\n newSuffixIndex = code;\n }\n else\n { // code == tableIndex\n newSuffixIndex = oldCode;\n if (code != tableIndex)\n {\n // warning - code out of sequence\n // possibly data corruption\n Debug.println(DebugLevel.WARNING, \"Out-of-sequence code!\");\n }\n }\n\n final int ti = tableIndex;\n\n prefix[ti] = oldCode;\n suffix[ti] = initial[newSuffixIndex];\n initial[ti] = initial[oldCode];\n length[ti] = length[oldCode] + 1;\n\n tableIndex++;\n if ((tableIndex == (1 << codeSize)) && (tableIndex < 4096))\n {\n codeSize++;\n codeMask = (1 << codeSize) - 1;\n }\n }\n\n // Reverse code\n int c = code;\n final int len = length[c];\n for (int i = len - 1; i >= 0; i--)\n {\n string[i] = suffix[c];\n c = prefix[c];\n }\n\n this.writeImage(string, len);\n oldCode = code;\n }\n }", "private String decrypt(String encryptedData) throws Exception {\n Key key = generateKey();\n Cipher c = Cipher.getInstance(ALGO);\n c.init(Cipher.DECRYPT_MODE, key);\n byte[] decordedValue = Base64.getDecoder().decode(encryptedData);\n byte[] decValue = c.doFinal(decordedValue);\n String result = new String(decValue);\n return result;\n }", "private static String decryptAES() {\n\t\tString inFilename = \"7hex.txt\";\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(inFilename);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\n\t\t\tfinal String keyHex = asciiToHex(\"YELLOW SUBMARINE\");\n\t\t\tfinal String cipherHex = br.readLine();\n\n\t\t\tSecretKey key = new SecretKeySpec(DatatypeConverter.parseHexBinary(keyHex), \"AES\");\n\t\t\tCipher cipher = Cipher.getInstance(\"AES/ECB/NoPadding\");\n\t\t\tcipher.init(Cipher.DECRYPT_MODE, key);\n\t\t\tbyte[] result = cipher.doFinal(DatatypeConverter.parseHexBinary(cipherHex));\n\n\t\t\tbr.close();\n\t\t\tfr.close();\n\n\t\t\treturn new String(result);\n\t\t} catch (Exception e) {\n\t\t\treturn null;\n\t\t}\n\t}", "byte[] getData();", "byte[] getData();", "byte[] getData();", "byte[] getData();", "private void encryptionAlgorithm() {\n\t\ttry {\n\t\t\t\n\t\t\tFileInputStream fileInputStream2=new FileInputStream(\"D:\\\\program\\\\key.txt\");\n\t\t\tchar key=(char)fileInputStream2.read();\n\t\t\tSystem.out.println(key);\n\t\t\tFileInputStream fileInputStream1=new FileInputStream(\"D:\\\\program\\\\message.txt\");\n\t\t\tint i=0;\n\t\t\t\n\t\t\tStringBuilder message=new StringBuilder();\n\t\t\twhile((i= fileInputStream1.read())!= -1 )\n\t\t\t{\n\t\t\t\tmessage.append((char)i);\n\t\t\t}\n\t\t\tString s=message.toString();\n\t\t\tchar[] letters=new char[s.length()];\n\t\t\tStringBuilder en=new StringBuilder();\n\t\t\tfor(int j = 0;j < letters.length;j++)\n\t\t\t{\n\t\t\t\ten.append((char)(byte)letters[j]+key);\n\t\t\t}\t\t\n\t\t\tFileOutputStream fileoutput=new FileOutputStream(\"D:\\\\program\\\\encryptedfile.txt\");\n\t\t\t\n\t\t\tfileInputStream1.close();\n\t\t\tfileInputStream2.close();\n\t\t\t\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t\n\t}", "public byte[] decrypt(String key, String encryptedText) throws IOException, InvalidCipherTextException {\n\n if (encryptedText != null) {\n byte[] inputData = Base64.decode(encryptedText.getBytes());\n InputStream fis = new ByteArrayInputStream(inputData);\n\n ByteArrayOutputStream fos = new ByteArrayOutputStream();\n decrypt(key, fis, fos);\n byte[] byt = fos.toByteArray();\n return byt;\n }\n return null;\n }", "public java.lang.String getEncryptedData() {\r\n return encryptedData;\r\n }", "void decryption(String file)\n {\n try\n {\n fdec=new DataOutputStream(new FileOutputStream(\"dec.txt\"));\n fenc1=new FileInputStream(file);\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n try\n {\n size=fenc1.available();\n np=0;\n p=size%8;\n if(p!=0)\n np=8-p;\n size+=np;\n if(p==0)\n nl=size/8;\n else\n nl=size/8+1;\n buf1=new byte[size+10];\n buf=new byte[8];\n fenc1.read(buf1);\n mark=-8;\n int arr[]=new int [8];\n for(k1=0;k1<nl;k1++)\n {\n mark+=8;\n for(int k2=0;k2<8;k2++)\n buf[k2]=buf1[mark+k2];\n for(int k2=0;k2<8;k2++)\n\t {\n\t arr[k2]=0;\n\t if(buf[k2]>=0)\n\t arr[k2]=buf[k2];\n\t else\n\t arr[k2]=buf[k2]+256;\n }\n\t j1=0;i1=0;\n while( i1<=3)\n\t\t {\n\t\t if((j1+1)%2==0)\n\t {\n x[i1]|=arr[j1]; // dividing 64 bit cypher block into four 16 bit registers\n\t i1++;\n\t\t }\n\t else\n\t {\n\t \t x[i1]=arr[j1];\n\t x[i1]<<=8;\n\t }\n\t j1++;\n\t }\n for(int t=0;t<4;t++)\n {\n\t ft1 =x[t]&255;\n\t ft=x[t]>>8;\n\t }\n step1=mul( x[0] , minverse( z[48] ));\n step2=( x[1] + ainverse( z[49] )) % 65536;\n step3=( x[2] + ainverse( z[50] )) % 65536;\n step4=mul( x[3] , minverse( z[51] ));\n step5=step1^step3;\n step6=step2^step4;\n step7=mul(step5,z[46]);\n step8=(step6+step7)%65536;\n step9=mul(step8,z[47]);\n step10=(step7+step9)%65536;\n step11=step1^step9;\n step12=step3^step9;\n step13=step2^step10;\n step14=step4^step10;\n x[0]=step11;\n x[1]=step12;\n x[2]=step13;\n x[3]=step14;\n// 2nd round\n\tint j2=40;\n\t\tfor(j1=1;j1<=7;j1++)\n \t\t {\n step1=mul( x[0] , minverse( z[j2+2] ));\n step2=( x[1] + ainverse( z[j2+4] )) % 65536;\n step3=( x[2] + ainverse( z[j2+3] )) % 65536;\n t=step2;\n step2=step3;\n step3=t;\n step4=mul( x[3] , minverse( z[j2+5] ));\n step5=step1^step3;\n step6=step2^step4;\n step7=mul(step5,z[j2+0]);\n step8=(step6+step7)%65536;\n step9=mul(step8,z[j2+1]);\n step10=(step7+step9)%65536;\n step11=step1^step9;\n step12=step3^step9;\n step13=step2^step10;\n step14=step4^step10;\n x[0]=step11;\n x[1]=step12;\n x[2]=step13;\n x[3]=step14;\n j2=j2-6;\n }\n x[0]=mul(x[0],minverse(z[0]));\n x[1]=(x[1]+ainverse(z[2]))%65536;\n x[2]=(x[2]+ainverse(z[1]))%65536;\n x[3]=mul(x[3],minverse(z[3]));\n t=x[1];\n x[1]=x[2];\n x[2]=t;\n\t for(int t=0;t<4;t++)\n {\n\t ft1 =x[t]&255;\n\t ft=x[t]>>8;\n\t fdec.write((char)ft);\n\t fdec.write((char)ft1);\n\t }\n }\n\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n }", "public void setEncryptedContent(byte[] rgb) {\n rgbEncrypt = rgb;\n }", "public byte[] getBytesFromFile(String imagePath) throws IOException {\n File file = new File(imagePath);\n return Files.readAllBytes(file.toPath());\n }", "public String decode(BufferedImage stegoImage){\n // Setup data to be used for decoding\n setupData(stegoImage);\n\n // Check parameter data will allow for successful decoding\n checkData();\n\n // Decode data from the image\n StringBuilder binary = decodeSecretData();\n\n // Convert the data back to text\n String text = getText(binary);\n\n // Return the retrieved text\n return text;\n }", "public byte[] decrypt(byte[] data) throws Exception {\n // call overriden function with offset = 0\n return decrypt(data, 0);\n }", "@Override\n public byte[] getBytes(EscPosImage image) {\n ByteArrayOutputStream bytes = new ByteArrayOutputStream();\n //\n bytes.write(ESC);\n bytes.write('a');\n bytes.write(justification.value);\n //\n int paramSize = image.getRasterSizeInBytes() + 10;\n int pL = paramSize & 0xFF;\n int pH = (paramSize & 0xFF00) >> 8 ;\n\n bytes.write(GS);\n bytes.write('(');\n bytes.write('L');\n bytes.write(pL); // pl\n bytes.write(pH); // ph\n bytes.write(48); // m\n bytes.write(112); //fn\n bytes.write(48); // a\n bytes.write(graphicsImageBxBy.bx); // bx\n bytes.write(graphicsImageBxBy.by); // by\n bytes.write(49); // c\n\n // bits in horizontal direction for the bit image\n int horizontalBits = image.getWidthOfImageInBits();\n int xL = horizontalBits & 0xFF;\n int xH = (horizontalBits & 0xFF00) >> 8 ;\n // \n // bits in vertical direction for the bit image\n int verticalBits = image.getHeightOfImageInBits();\n // getting first and second bytes separatted\n int yL = verticalBits & 0xFF;\n int yH = (verticalBits & 0xFF00) >> 8 ;\n \n bytes.write(xL);\n bytes.write(xH);\n bytes.write(yL);\n bytes.write(yH);\n // write bytes\n byte [] rasterBytes = image.getRasterBytes().toByteArray();\n bytes.write(rasterBytes,0,rasterBytes.length);\n \n // function 050\n bytes.write(GS);\n bytes.write('(');\n bytes.write('L');\n bytes.write(2); // pl\n bytes.write(0); // ph\n bytes.write(48); //m\n bytes.write(50); //fn\n \n \n \n\n //\n return bytes.toByteArray();\n \n }", "public byte[] getImageData() {\r\n return imageData;\r\n }", "public byte[] read();", "public String decrypt(final String encryptedBlob)\n throws GeneralSecurityException, IOException {\n final String methodName = \":decrypt\";\n Logger.v(TAG + methodName, \"Starting decryption\");\n\n if (StringExtensions.isNullOrBlank(encryptedBlob)) {\n throw new IllegalArgumentException(\"Input is empty or null\");\n }\n\n int encodeVersionLength = encryptedBlob.charAt(0) - 'a';\n if (encodeVersionLength <= 0) {\n final String message = String.format(\n \"Encode version length: '%s' is not valid, it must be greater of equal to 0. \" +\n \"Assuming string is not encrypted. Returning input blob.\",\n encodeVersionLength\n );\n Logger.w(TAG + methodName, message);\n return encryptedBlob;\n }\n\n if (!encryptedBlob.substring(1, 1 + encodeVersionLength).equals(ENCODE_VERSION)) {\n final String message = String.format(\n \"Unsupported encode version received. Encode version supported is: %s. \" +\n \"Assuming string is not encrypted. Returning input blob.\",\n ENCODE_VERSION\n );\n Logger.w(TAG + methodName, message);\n return encryptedBlob;\n }\n\n final byte[] bytes = Base64\n .decode(encryptedBlob.substring(1 + encodeVersionLength), Base64.DEFAULT);\n\n // get key version used for this data. If user upgraded to different\n // API level, data needs to be updated\n final String keyVersion = new String(bytes, 0, KEY_VERSION_BLOB_LENGTH,\n AuthenticationConstants.ENCODING_UTF8);\n Logger.i(TAG + methodName, \"\", \"Encrypt version:\" + keyVersion);\n\n final SecretKey secretKey = getKey(keyVersion);\n final SecretKey hmacKey = getHMacKey(secretKey);\n\n // byte input array: encryptedData-iv-macDigest\n final int ivIndex = bytes.length - DATA_KEY_LENGTH - HMAC_LENGTH;\n final int macIndex = bytes.length - HMAC_LENGTH;\n final int encryptedLength = ivIndex - KEY_VERSION_BLOB_LENGTH;\n if (ivIndex < 0 || macIndex < 0 || encryptedLength < 0) {\n throw new IOException(\"Invalid byte array input for decryption.\");\n }\n\n // Calculate digest again and compare to the appended value\n // incoming message: version+encryptedData+IV+Digest\n // Digest of EncryptedData+IV excluding key Version and digest\n final Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);\n final Mac mac = Mac.getInstance(HMAC_ALGORITHM);\n mac.init(hmacKey);\n mac.update(bytes, 0, macIndex);\n final byte[] macDigest = mac.doFinal();\n\n // Compare digest of input message and calculated digest\n assertHMac(bytes, macIndex, bytes.length, macDigest);\n\n // Get IV related bytes from the end and set to decrypt mode with\n // that IV.\n // It is using same cipher for different version since version# change\n // will mean upgrade to AndroidKeyStore and new Key.\n cipher.init(Cipher.DECRYPT_MODE, secretKey, new IvParameterSpec(bytes, ivIndex,\n DATA_KEY_LENGTH));\n\n // Decrypt data bytes from 0 to ivindex\n final String decrypted = new String(cipher.doFinal(bytes, KEY_VERSION_BLOB_LENGTH,\n encryptedLength), AuthenticationConstants.ENCODING_UTF8);\n Logger.v(TAG + methodName, \"Finished decryption\");\n return decrypted;\n }", "private byte[] getImageBytes(File image){\n byte[] imageInByte = null;\n try{\n \n\tBufferedImage originalImage = \n ImageIO.read(image);\n \n\tByteArrayOutputStream baos = new ByteArrayOutputStream();\n\tImageIO.write( originalImage, \"png\", baos );\n\tbaos.flush();\n\timageInByte = baos.toByteArray();\n\tbaos.close();\n \n\t}catch(IOException e){\n\t\tSystem.out.println(e.getMessage());\n\t}finally{\n return imageInByte;\n }\n }", "public static String decryptText(byte[] byteCipherText, SecretKey secKey) throws Exception {\n\r\n Cipher aesCipher = Cipher.getInstance(\"AES\");\r\n\r\n aesCipher.init(Cipher.DECRYPT_MODE, secKey);\r\n\r\n byte[] bytePlainText = aesCipher.doFinal(byteCipherText);\r\n\r\n return new String(bytePlainText);\r\n\r\n}", "public final byte[] SchlüsselTausch() throws Exception{\n File datei = new File(\"AES.key\");\n \n //Key auslesen\n FileInputStream fis = new FileInputStream(datei);\n byte[] encodedKey = new byte[(int) datei.length()];\n fis.read(encodedKey);\n fis.close();\n \n System.out.println(encodedKey);\n //Das byte[] des Schlüssels zurückgeben\n return(encodedKey);\n}", "public byte[] process(byte[] data) throws Exception {\r\n\t\t\tif (data == null || data.length != 8) {\r\n\t\t\t\tthrow new IllegalArgumentException(\"Argument 'data' must be 8 bytes (64 bits)\");\r\n\t\t\t}\r\n\t\t\tint transformedLength = cipher.getOutputSize(data.length);\r\n\t\t\tbyte[] transformedData = new byte[transformedLength];\r\n\t\t\tint tl1 = cipher.update(data, 0, data.length, transformedData, 0);\r\n\t\t\tint tl2 = tl1 + cipher.doFinal(transformedData, tl1);\r\n\t\t\treturn transformedData;\r\n\t\t}", "public void runDecrypt(String filePath) {\n try {\n byte[] paramArrayOfbyte = Files.readAllBytes(Paths.get(filePath));\n if (paramArrayOfbyte.length >= 1024 && ((paramArrayOfbyte[0] == 73 && paramArrayOfbyte[1] == 71\n && paramArrayOfbyte[2] == 69 && paramArrayOfbyte[3] == 70)\n || (paramArrayOfbyte[0] == 67 && paramArrayOfbyte[1] == 68 && paramArrayOfbyte[2] == 69\n && paramArrayOfbyte[3] == 70))) {\n // TODO: figure out why it only selects 1024 bytes.\n if (paramArrayOfbyte.length != 1024) {\n byte[] arrayOfByte = new byte[1024];\n System.arraycopy(paramArrayOfbyte, 0, arrayOfByte, 0, 1024);\n paramArrayOfbyte = arrayOfByte;\n }\n\n // Not sure why needing this section?\n byte[] arrayOfByte1 = new byte[12];\n byte[] arrayOfByte2 = new byte[12];\n System.arraycopy(paramArrayOfbyte, 4, arrayOfByte1, 0, 12);\n System.arraycopy(paramArrayOfbyte, 16, arrayOfByte2, 0, 12);\n\n // Init the most important object.\n com.b.a.b.aa.a h = new com.b.a.b.aa.a(new com.b.a.b.aa.b() {\n public byte[] a() {\n return null;\n }\n\n public int b() {\n return 3;\n }\n });\n\n String str1 = (new String(paramArrayOfbyte, 28, 32)).intern();\n // String str2 = a.a(this.n, str1);\n String str2 = Decrypt.DECRYPTION_KEY;\n int i = h.a(str2.getBytes());\n byte[] guessResult = h.b();\n h.b(guessResult); // Digest, this also sets com.b.a.a.aa.a.b. (The hashmap)\n if (i != 0)\n System.out.println(Dumper.dump(h.a(i)));\n else\n System.out.println(\"error in i.\");\n\n // Using the official file reader.\n net.zamasoft.reader.book.a.b randomAccessFile = new net.zamasoft.reader.book.a.b(new File(filePath));\n System.out.println(\"file length: \" + randomAccessFile.length());\n System.out.println(\"key: \" + com.b.a.a.a.c.a.getBLatest());\n ArrayList<Byte> bytes = new ArrayList<>();\n while (!randomAccessFile.isEOF()) {\n byte b = (byte) randomAccessFile.read();\n bytes.add(b);\n }\n assert randomAccessFile.length() == bytes.size();\n byte[] bs = new byte[bytes.size()];\n for (int ii = 0; ii < bs.length; ii++) {\n bs[ii] = bytes.get(ii);\n }\n System.out.println(\"bytes length: \" + bytes.size());\n System.out.println(new String(bs, \"utf-8\"));\n } else {\n System.out.println(\"NOOOOOOOO!\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public void gen_encrypted_image(double mat[][])\n\t{\n\t\tif(orderflag)\n\t\t{\n\t\t\tgetpixel_1(mat);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tgetpixel_2(mat);\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tImageIO.write(img, \"jpg\", new File(folder+\"Encrypted_\"+name));\n\t\t\tRuntime.getRuntime().exec(folder+\"Encrypted_\"+name);\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t}\t\t\n }", "public String decode(String path, String name) {\n byte[] decode;\n try {\n // user space is necessary for decrypting\n BufferedImage image = user_space(getImage(image_path(\n path,\n name,\n \"png\")));\n decode = decode_text(get_byte_data(image));\n return (new String(decode));\n }\n catch (Exception e) {\n JOptionPane.showMessageDialog(\n null,\n \"There is no hidden message in this image!\",\n \"Error\",\n JOptionPane.ERROR_MESSAGE);\n return \"\";\n }\n }", "public byte[] getData();", "public String decodeData(String encrypted) throws InvalidConfigurationException, IOException {\n checkNotNull(encrypted, \"encrypted message cannot be null\");\n SecurityLevel securityLevel = getSecurityLevel(encrypted);\n if (encrypted.startsWith(securityLevel.getPrefix())) {\n encrypted = encrypted.substring(securityLevel.getPrefix().length());\n }\n switch (securityLevel) {\n case PLAIN_TEXT:\n return encrypted;\n case OBFUSCATED:\n return decryptAndBase64(encrypted, createObfuscatingCipher(), OBFUSCATING_KEY);\n case ENCRYPTED:\n KeyPair keyPair = sensitiveDataCodecHelper.getKeyPair();\n return decryptAndBase64(\n encrypted, createEncryptingCipher(keyPair), keyPair.getPrivate());\n default:\n throw new InvalidConfigurationException(\"Invalid SecurityLevel \" + securityLevel);\n }\n }", "private void receiveKey() throws Exception {\n System.out.println(\"Receive Key\");\n DataInputStream dis = new DataInputStream(is);\n String keyBase64 = dis.readUTF();\n byte[] key = Util.convertBase64ToBytes(keyBase64);\n byte[] rc4key = Util.RSADecrypt(key, prikey);\n synchronized (GUITracker.onlinePeer) {\n GUITracker.RC4KeyByte = rc4key;\n }\n RC4Key = RC4.convertBytesToSecretKey(rc4key);\n encrypt = new RC4(RC4Key, RC4.ENCRYPT);\n decrypt = new RC4(RC4Key, RC4.DECRYPT);\n CipherInputStream cis = decrypt.getBindingInputStream(socket.getInputStream());\n CipherOutputStream cos = encrypt.getBindingOutputStream(socket.getOutputStream());\n is = cis;\n os = cos;\n System.out.println(\"Get symmetric key from: \" + addressPort);\n }", "public static String[] decryptAESBlock(byte[] data) {\n byte[] decrypted = CryptoUtil.decryptAESCBC(AES_DATA_KEY_BYTES, data);\n if (decrypted == null) {\n throw new RuntimeException(\"Failed to decrypt\");\n }\n\n int offset = 0;\n String[] result = new String[5];\n result[0] = HexUtil.byteArrayToHexString(decrypted, offset, 4);\n offset += 4;\n result[1] = HexUtil.byteArrayToHexString(decrypted, offset, 16);\n offset += 16;\n\n int index = -1;\n while (offset < decrypted.length && decrypted[offset] != 0) {\n int c = decrypted[offset] & 0xff;\n\n switch (c) {\n case 0xF1: {\n index = 2;\n result[index] = \"\";\n break;\n }\n case 0xF2: {\n index = 3;\n result[index] = \"\";\n break;\n }\n case 0xF3: {\n index = 4;\n result[index] = \"\";\n break;\n }\n default: {\n if (index != -1) {\n result[index] += (char) c;\n }\n }\n }\n offset++;\n }\n\n if (offset >= (decrypted.length - 2) || decrypted[offset] != 0\n || CryptoUtil.crcccit(decrypted, 0, offset + 1) != (((decrypted[offset + 1] & 0xff) << 8)) + (decrypted[offset + 2] & 0xff)) {\n throw new RuntimeException(\"Wrong key\");\n }\n\n return result;\n }", "private static ByteString readImageBytes(BlobKey blobKey) throws IOException {\n BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();\n BlobInfo blobInfo = new BlobInfoFactory().loadBlobInfo(blobKey);\n long blobSize = blobInfo.getSize();\n\n ByteArrayOutputStream outputBytes = new ByteArrayOutputStream();\n int fetchSize = BlobstoreService.MAX_BLOB_FETCH_SIZE;\n long currentByteIndex = 0;\n\n // Fetch all the bytes from the blob in fragments of the maximum fetch size.\n while (currentByteIndex < blobSize) {\n // End index is inclusive, so subtract 1 to get fetchSize bytes.\n // Get data starting at currentByteIndex until either the fetch size or\n // the end of the blob is reached.\n byte[] bytes =\n blobstoreService.fetchData(blobKey, currentByteIndex, currentByteIndex + fetchSize - 1);\n outputBytes.write(bytes);\n\n currentByteIndex += fetchSize;\n }\n\n return ByteString.copyFrom(outputBytes.toByteArray());\n }", "public void decrypt() {\n try {\n // Create input and output streams\n System.out.println(\"Loading files\");\n FileInputStream in = new FileInputStream(this.input);\n FileOutputStream out = new FileOutputStream(this.output);\n\n // Skip IV values\n in.getChannel().position(cipher.getBlockSize());\n\n /*\n Using CipherInputStream object to read from encrypted file\n cipherIn reads data from input stream and and returns the decrypted value\n */\n System.out.println(\"Creating cipher stream\");\n CipherInputStream cipherIn = new CipherInputStream(in, this.cipher);\n\n System.out.println(\"Starting file decryption\");\n byte[] buffer = new byte[Common.BLOCK_SIZE];\n int len;\n // Reading from the input stream\n while ((len = cipherIn.read(buffer)) != -1)\n // Write the decrypted message to output stream\n out.write(buffer, 0, len);\n\n // Close all streams\n System.out.println(\"Closing file streams\");\n cipherIn.close();\n out.flush();\n out.close();\n\n System.out.println(\"Decryption complete\");\n } catch (Exception e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n }", "public static byte[] encryptText(String plainText,SecretKey secKey) throws Exception{\n\r\n Cipher aesCipher = Cipher.getInstance(\"AES\");\r\n\r\n aesCipher.init(Cipher.ENCRYPT_MODE, secKey);\r\n\r\n byte[] byteCipherText = aesCipher.doFinal(plainText.getBytes());\r\n\r\n return byteCipherText;\r\n\r\n}", "public byte[] encrypt(final byte[] data) throws Exception {\n final byte[] secret = new byte[] {42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42};\n final SecretKeySpec key = new SecretKeySpec(secret, \"AES\");\n\n final Cipher encryptCipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n encryptCipher.init(Cipher.ENCRYPT_MODE, key);\n final byte[] iv = encryptCipher.getIV();\n final byte[] encrypted = encryptCipher.doFinal(data);\n\n final int outputLength = encrypted.length;\n final int ivLength = iv.length;\n\n final byte[] results = new byte[outputLength + ivLength];\n System.arraycopy(iv, 0, results, 0, ivLength);\n System.arraycopy(encrypted, 0, results, ivLength, outputLength);\n\n return DatatypeConverter.printBase64Binary(encoded);\n}", "public String getData(String key) {\n return decrypt(message, key);\n }", "public String entschlüsseln(SecretKey key, String nachricht) throws Exception{\n BASE64Decoder myDecoder2 = new BASE64Decoder();\n byte[] crypted2 = myDecoder2.decodeBuffer(nachricht);\n\n // Entschluesseln\n Cipher cipher2 = Cipher.getInstance(\"AES\");\n cipher2.init(Cipher.DECRYPT_MODE, key);\n byte[] cipherData2 = cipher2.doFinal(crypted2);\n String erg = new String(cipherData2);\n\n // Klartext\n return(erg);\n\n}", "public static void encrypt() throws IOException{\n\t\tBufferedInputStream in = new BufferedInputStream(new FileInputStream(inFilename));\n\t\tBufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(outFilename));\n\n\t\tSecureRandom randomGen = new SecureRandom(); //used for the salt and the padding\n\t\tbyte[] key; //holds the encryption key\n\n\t\t//get the file length\n\t\tlong fileLength = (new File(inFilename)).length();\n\n\t\t//write the file header marker\n\t\tout.write(FILE_HEADER);\n\n\t\t/* STAGE 1 - generate encryption key */\n\t\t//find the number of bytes we have to pad and write it to the file\n\t\tint numPad;\n\t\tif (fileLength % 8 == 0)\n\t\t\tnumPad = 0;\n\t\telse\n\t\t\tnumPad = (int)(8 - (fileLength % 8));\n\t\tout.write(numPad);\n\t\t//generate a 128-byte random salt and write it to the file\n\t\tbyte[] salt = new byte[128];\n\t\trandomGen.nextBytes(salt);\n\t\tout.write(salt);\n\t\t//generate the message for CubeHash: (password + #padded bits + random salt)\n\t\tbyte[] message = new byte[password.length + 1 + salt.length];\n\t\tSystem.arraycopy(password, 0, message, 0, password.length); //add the password\n\t\tmessage[password.length] = (byte)numPad; //add #padded bits\n\t\tSystem.arraycopy(salt, 0, message, password.length + 1, salt.length); //add random salt\n\t\t//finally, generate the encryption key\n\t\tkey = CryptoLib.CubeHash.doCubeHash(message);\n\n\t\t/* STAGE 2 - apply encryption */\n\t\tint currPiece = 0; //keeps track of which piece of the key is being used\n\t\tbyte[] currData = new byte[8]; //holds the piece of data currently being encrypted\n\n\t\t//split the key into 4 pieces of 128 bits each\n\t\tbyte[][] keyPieces = new byte[4][16];\n\t\tfor (int i = 0; i < 4; i++){\n\t\t\tSystem.arraycopy(key, i*16, keyPieces[i], 0, 16);\n\t\t}\n\n\t\t//loop through the file (except the last block), 8 bytes at a time\n\t\tfor (long i = 0; i < fileLength - 8; i += 8){\n\t\t\t//put a chunk of data in currData\n\t\t\tin.read(currData);\n\n\t\t\t//do TEA(key, RC4(key, data)), then write to file\n\t\t\tout.write(CryptoLib.TEA.doTEA(keyPieces[currPiece],\n\t\t\t\t\t\tCryptoLib.RC4.doRC4(keyPieces[currPiece], currData)));\n\n\t\t\t//increment currPiece\n\t\t\tcurrPiece = (currPiece + 1) % 4;\n\t\t}\n\n\t\t//deal with the last block of data:\n\t\t//first, read it..\n\t\tin.read(currData);\n\t\t//..pad it with random data..\n\t\tfor (int i = 7; i >= (8 - numPad); i--){\n\t\t\tcurrData[i] = (byte)randomGen.nextInt();\n\t\t}\n\t\t//..then encrypt it\n\t\tout.write(CryptoLib.TEA.doTEA(keyPieces[currPiece],\n\t\t\t\t\tCryptoLib.RC4.doRC4(keyPieces[currPiece], currData)));\n\n\t\t/* STAGE 3 - done! */\n\t\tin.close();\n\t\tout.close();\n\t\tSystem.out.println(\"\\nEncryption complete.\");\n\t}", "OutputFile encryptingOutputFile();", "private static void crypting(boolean encrypt, String filename, String cryptedFilename) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tSystem.out.println(\"Please provide password as hex-encoded text (16 bytes, i.e. 32 hex-digits): \");\n\t\tSystem.out.print(\">\");\n\t\tString keyText = sc.nextLine();\n\n\t\tSystem.out.println(\"Please provide initialization vector as hex-encoded text (32 hex-digits): \");\n\t\tSystem.out.print(\">\");\n\t\tString ivText = sc.nextLine();\n\t\tsc.close();\n\n\t\tSecretKeySpec keySpec = new SecretKeySpec(Util.hextobyte(keyText), \"AES\");\n\t\tAlgorithmParameterSpec paramSpec = new IvParameterSpec(Util.hextobyte(ivText));\n\t\tCipher cipher = null;\n\n\t\ttry {\n\t\t\tcipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n\t\t\tcipher.init(encrypt ? Cipher.ENCRYPT_MODE : Cipher.DECRYPT_MODE, keySpec, paramSpec);\n\n\t\t} catch (NoSuchAlgorithmException | NoSuchPaddingException exc) {\n\t\t\tSystem.out.println(\"Transformation is in invalid format or contains padding scheme that is unavailable. \");\n\t\t\tSystem.exit(1);\n\t\t} catch (InvalidKeyException | InvalidAlgorithmParameterException exc) {\n\t\t\tSystem.out.println(\"Given key or algorithm is invalid for this cipher.\");\n\t\t\tSystem.exit(1);\n\n\t\t}\n\n\t\ttry (InputStream inputStream = new BufferedInputStream(new FileInputStream(filename));\n\t\t\t\tOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(cryptedFilename))) {\n\n\t\t\tint nRead;\n\t\t\tbyte[] buffer = new byte[4096];\n\t\t\tbyte[] inputfile = null;\n\n\t\t\twhile ((nRead = inputStream.read(buffer, 0, buffer.length)) != -1) {\n\t\t\t\tinputfile = cipher.update(buffer, 0, nRead);\n\t\t\t\toutputStream.write(inputfile);\n\t\t\t}\n\n\t\t\tinputfile = cipher.doFinal();\n\t\t\toutputStream.write(inputfile);\n\n\t\t} catch (FileNotFoundException exc) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"File does not exist, is a directory rather than a regular file, or cannot be opened for reading because of some other reason. \");\n\t\t\tSystem.exit(1);\n\n\t\t} catch (IOException exc) {\n\t\t\tSystem.out.println(\"Input stream couldn't be initialized.\");\n\t\t\tSystem.exit(1);\n\n\t\t} catch (IllegalBlockSizeException | BadPaddingException e) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"Encryption algorithm is unable to process the input data provided or the decrypted data is not bounded by the appropriate padding bytes. \");\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\tif (encrypt) {\n\t\t\tSystem.out.printf(\"Encryption completed. Generated file %s based on file %s.\\n\", cryptedFilename, filename);\n\t\t} else {\n\t\t\tSystem.out.printf(\"Decryption completed. Generated file %s based on file %s.\\n\", cryptedFilename, filename);\n\t\t}\n\n\t}", "public String decrypt(String text) {\n byte[] dectyptedText = null;\n try {\n // decrypt the text using the private key\n cipher.init(Cipher.DECRYPT_MODE, publicKey);\n byte[] data=Base64.decode(text, Base64.NO_WRAP);\n String str=\"\";\n for(int i=0;i<data.length;i++)\n {\n str+=data[i]+\"\\n\";\n }\n android.util.Log.d(\"ali\",str);\n dectyptedText = cipher.doFinal(Base64.decode(text, Base64.NO_WRAP));\n return new String(dectyptedText);\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n return null;\n }", "Object getChannelData() {\r\n return imageData;\r\n }", "@Override\n public InputStream decrypt(InputStream in, DecryptionKey privateKey) throws IOException {\n byte[] keyLenBytes = new byte[4];\n int triesLeft = 10;\n for (int i = 0; i < 4; i++) {\n while (in.read(keyLenBytes, i, 1) < 1 && --triesLeft > 0) {\n ;\n }\n }\n if (triesLeft == 0)\n throw new IOException(\"didn't get keylen data from ciphertext\");\n int keyLen = ByteBuffer.wrap(keyLenBytes).getInt();\n\n //Deserialize the encapsulated key\n byte[] encapsulatedKeyBytes = new byte[keyLen];\n triesLeft = 10;\n for (int i = 0; i < keyLen; i++) {\n while (in.read(encapsulatedKeyBytes, i, 1) < 1 && --triesLeft > 0) {\n ; //TODO: don't read byte by byte...\n }\n }\n if (triesLeft == 0)\n throw new IOException(\"couldn't read encapulated key from ciphertext\");\n CipherText encapsulatedKey =\n kem.restoreEncapsulatedKey(new JSONConverter().deserialize(new String(encapsulatedKeyBytes)));\n\n //decaps the encapsulated key\n SymmetricKey symmetricKey = kem.decaps(encapsulatedKey, privateKey);\n\n //Return a stream where caller can read the decrypted payload\n return symmetricScheme.decrypt(in, symmetricKey);\n }", "public byte[] decode_text(byte[] image) {\n int length = 0;\n int offset = 32;\n // loop through 32 bytes of data to determine text length\n for (int i = 0; i < 32; ++i) // i=24 will also work, as only the 4th\n // byte contains real data\n {\n length = (length << 1) | (image[i] & 1);\n }\n\n byte[] result = new byte[length];\n\n // loop through each byte of text\n for (int b = 0; b < result.length; ++b) {\n // loop through each bit within a byte of text\n for (int i = 0; i < 8; ++i, ++offset) {\n // assign bit: [(new byte value) << 1] OR [(text byte) AND 1]\n result[b] = (byte) ((result[b] << 1) | (image[offset] & 1));\n }\n }\n return result;\n }", "byte[] encrypt(String plaintext);", "public void secretMode()\n {\n \tsecret = true;\n \ttry {\n\t\t\timg = ImageIO.read(new File(\"DatBoi.png\"));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n }", "protected void setEncrypted() {\n content = this.aesKey.encrypt(this.content);\n }", "public InputStream getWrappedInputStream() {\n return this.decryptedContents;\n }", "public static byte[] getIv()\r\n/* 161: */ {\r\n/* 162: */ try\r\n/* 163: */ {\r\n/* 164:139 */ return getPropertyBytes(\"aesiv\");\r\n/* 165: */ }\r\n/* 166: */ catch (Exception e)\r\n/* 167: */ {\r\n/* 168:141 */ log.warning(\"Error getting secret: \" + e.getMessage());\r\n/* 169: */ }\r\n/* 170:143 */ return new byte[0];\r\n/* 171: */ }", "public void run(boolean encrypted) throws Exception {\n InputStream inputStream = context.getContentResolver().openInputStream(uri);\n\n //read file\n BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));\n\n //initiate empty array list to store records retrieved\n ArrayList<Record> newRecords = new ArrayList<>();\n\n //initiate base64 for decoding\n CryptographyBase64 b64 = new CryptographyBase64();\n\n //check if file is encrypted\n if (encrypted){\n //read encrypted file\n String line;\n StringBuilder encryptedMessage = new StringBuilder();\n while ((line = reader.readLine()) != null ){\n encryptedMessage.append(line);\n }\n //decrypt message and add transactions to database\n String decrypted = new Cryptography(context).Decrypt(encryptedMessage.toString());\n for (String dataLine : decrypted.split(\"\\n\")){\n\n //separate data by delimiter\n String[] data = dataLine.split(delimiter);\n\n //decode images if not null\n byte[] decodedImg = (!data[6].equals(\"null\")) ? b64.b64ToBytes(data[6]) : null;\n\n //add record to arrayList\n newRecords.add(new Record(data[0], data[1],Double.parseDouble(data[2]), data[3], data[4],data[5], decodedImg, wallet.getWalletId()));\n }\n }\n else{\n //read file line by line\n String line;\n while ((line = reader.readLine()) != null ){\n String[] data = line.split(delimiter); //separate data by delimiter\n\n //decode images if not null\n byte[] decodedImg = (!data[6].equals(\"null\")) ? b64.b64ToBytes(data[6]) : null;\n\n //add record to arrayList\n newRecords.add(new Record(data[0], data[1],Double.parseDouble(data[2]), data[3], data[4],data[5], decodedImg, wallet.getWalletId()));\n }\n }\n\n //insert records to database in bulk when completed\n dbHandler.addRangeRecord(newRecords);\n Toast.makeText(context, \"File successfully imported\", Toast.LENGTH_SHORT).show();\n }", "void encrypt()\n {\n try\n {\n size=fin.available();\n p=size%8;\n if(p!=0)\n np=8-p;\n size+=np;\n if(p==0)\n nl=size/8;\n else\n nl=size/8+1;\n buf=new byte[8];\n buf1=new byte[size+10];\n fin.read(buf1);\n int enc[]=new int[size];\n mark=-8;\n k2=0;\n for(k=0;k<nl;k++)\n {\n mark+=8;\n for(int k1=0;k1<8;k1++)\n buf[k1]=buf1[mark+k1];\n i=0;\n\t for(i=0;i<4;i++)\n x[i]=0;\n\t j1=0;i1=0;\n while( i1<=3)\n {\n\t if((j1+1)%2==0)\n\t {\n\t x[i1]|=buf[j1]; // dividing 64 bit cipher block into four 16 bit registers\n\t i1++;\n\t\t }\n\t else\n {\n\t x[i1]=buf[j1];\n\t x[i1]<<=8;\n }\n j1++;\n\t }\n // 7 rounds and 14 steps\n for(i=0 ; i <48 ; )\n {\n step1=mul(x[0],z[i+0]);\n step2=(x[1]+z[i+1])%65536;\n step3=(x[2]+z[i+2])%65536;\n step4=mul(x[3],z[i+3]);\n step5=step1^step3;\n step6=step2^step4;\n step7=mul(step5,z[i+4]);\n step8=(step6+step7)%65536;\n step9=mul(step8,z[i+5]);\n step10=(step7+step9)%65536;\n step11=step1^step9;\n step12=step3^step9;\n step13=step2^step10;\n step14=step4^step10;\n x[0]=step11;\n x[1]=step13;\n x[2]=step12;\n x[3]=step14;\n i=i+6;\n }\n x[0]=mul(x[0],z[48]);\n x[1]=(x[1]+z[49])%65536;\n x[2]=(x[2]+z[50])%65536;\n x[3]=mul(x[3],z[51]);\n for(int t=0;t<4;t++)\n {\n ft1 =x[t]&255;\n ft=x[t]>>8;\n fenc.write((char)ft);\n fenc.write((char)ft1);\n }\n}\nfin.close();\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n}", "private String decrypt(SecretKey key, String encrypted) {\n\t\ttry {\n\t\t\tCipher cipher = Cipher.getInstance(\"AES\");\n\t\t\tcipher.init(Cipher.DECRYPT_MODE, key);\n\n\t\t\tbyte[] original = cipher.doFinal(Base64.decodeBase64(encrypted));\n\n\t\t\treturn new String(original);\n\t\t} catch (InvalidKeyException | NoSuchAlgorithmException | BadPaddingException | IllegalBlockSizeException\n\t\t\t\t| NoSuchPaddingException ex) {\n\t\t\tSystem.out.println(ex.getMessage());\n\t\t}\n\n\t\treturn null;\n\t}", "public byte[] packAllData1(byte[] data) {\n byte[] message = null;\n try{\n //CRC\n int crc16 = alisa.CRC.crc16(data, 0, data.length);\n byte hi = (byte)((crc16 >> 8) & 0xff);\n byte lo = (byte)(crc16 & 0xff);\n\n //crcData <- data + [hi][lo]\n byte[] crcData = new byte[data.length + 2];\n System.arraycopy(data, 0, crcData, 0, data.length);\n crcData[crcData.length-2] = hi;\n crcData[crcData.length-1] = lo;\n System.out.println(\"File-\" + this._id + \": key length = \" +this._key.length);\n byte[] secret = new Encode().encrypt(crcData, this._key);\n\n //check, can the encoded data be decode and crc?. before send it to server\n byte[] decode = new Encode().decrypt(secret, this._key);\n if(alisa.CRC.crc16(decode, 0, decode.length) != 0){\n System.out.println(\"File-\" + this._id + \": Wrong Encoding data!!\");\n return packAllData1(data);\n }\n\n System.out.println(\"File-\" + this._id + \": Password = \" +this._password + \"\\n\" + \"File-\" + this._id + \": Hash = \" + new String(this._key, \"ISO-8859-1\"));\n // //---------show crc data------------------------\n // String show2 = \"\";\n // for(int i =0; i < crcData.length; i++){\n // show2 += (int)crcData[i] + \" \";\n // }\n // System.out.println(\"File-\" + this._id + \" crcData: \" + show2);\n // //------------------------------------------\n // //---------show encnrypted data-----------------\n // String show3 = \"\";\n // for(int i =0; i < secret.length; i++){\n // show3 += (int)secret[i] + \" \";\n // }\n // System.out.println(\"File-\" + this._id + \" secret(no header): \" + show3);\n // //------------------------------------------\n // //---------show decnrypted data-----------------\n // String show4 = \"\";\n // for(int i =0; i < decode.length; i++){\n // show4 += (int)decode[i] + \" \";\n // }\n // System.out.println(\"File-\" + this._id + \" decodeed secret: \" + show4);\n // //------------------------------------------\n\n message = new byte[secret.length + 4];\n System.arraycopy(secret, 0, message, 3, secret.length);\n message[0] = (byte)255;\n message[1] = (byte)((this._id >> 8) & 0xff);\n message[2] = (byte)(this._id & 0xff);\n message[message.length-1] = (byte)254;\n }catch(Exception e){\n System.out.println(\"File-\" + this._id + \": packAllData Error\");\n try { Thread.sleep(this._interval); } catch (InterruptedException ex) { }\n return packAllData1(data);\n }\n return message;\n }", "private static final byte[] pkgsave_image() {\n\t\tbyte data[] = { 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -29, 0, 0, 0, 0,\n\t\t\t\t0, -91, 42, 42, -128, -128, -128, 94, 94, 94, 94, 24, 24, 0, 0,\n\t\t\t\t-128, -1, -1, -1, -1, -1, 0, -64, -64, -64, -1, -1, -1, -1, -1,\n\t\t\t\t-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n\t\t\t\t33, -2, 14, 77, 97, 100, 101, 32, 119, 105, 116, 104, 32, 71,\n\t\t\t\t73, 77, 80, 0, 33, -7, 4, 1, 10, 0, 9, 0, 44, 0, 0, 0, 0, 16,\n\t\t\t\t0, 16, 0, 0, 4, 83, 48, 73, 32, 103, -67, 9, -128, 64, 51, -17,\n\t\t\t\t-43, 22, -116, -38, 72, 98, -101, 38, 12, 37, 120, 1, 66, 60,\n\t\t\t\t-60, 110, -8, -83, 45, 106, 126, 123, -35, 18, -127, -126, -31,\n\t\t\t\t64, 36, 26, 10, -109, 13, 80, 104, 104, 58, -111, -98, -64,\n\t\t\t\t114, 88, 60, 28, 67, -128, -87, -13, -119, 2, 20, -66, 96, 48,\n\t\t\t\t70, -14, 69, -104, -51, -33, 113, -94, -116, 40, -89, -57, 108,\n\t\t\t\t55, 20, -61, 62, 127, 35, 0, 59 };\n\t\treturn data;\n\t}", "byte[] getProfileImage();", "private static final byte[] xfsim_image() {\n\t\tbyte data[] = { 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -62, 0, 0, -128,\n\t\t\t\t-128, -128, -64, -64, -64, 0, 0, 0, -1, -1, -1, 0, 0, -1, -1,\n\t\t\t\t-1, -1, -1, -1, -1, -1, -1, -1, 33, -2, 14, 77, 97, 100, 101,\n\t\t\t\t32, 119, 105, 116, 104, 32, 71, 73, 77, 80, 0, 33, -7, 4, 1,\n\t\t\t\t10, 0, 5, 0, 44, 0, 0, 0, 0, 16, 0, 16, 0, 0, 3, 72, 88, -70,\n\t\t\t\t-36, 14, 48, -58, 23, -86, -83, 64, 48, 48, -70, -17, -112,\n\t\t\t\t-74, 112, 66, 105, 14, -31, 54, 8, 68, -37, -94, -103, -54,\n\t\t\t\t-70, 4, 44, 42, 36, 93, -89, -29, -9, 101, -112, -111, 105, 88,\n\t\t\t\t2, 4, 68, 28, -97, -57, 24, 43, -124, -128, 2, 104, -54, 40,\n\t\t\t\t56, 90, -85, 88, 77, 82, -23, 57, 42, -120, -32, -110, 99, -20,\n\t\t\t\t72, 0, 0, 59 };\n\t\treturn data;\n\t}", "byte[] getSignatureImage();", "Encryption encryption();", "private byte[] getData() {\n\t\tStorage storage;\n\t\tint cont = 0;\n\t\tbyte[] data = null;\n\t\tsynchronized (store) {\n\t\t\tstorage = (Storage) store.getContents();\n\t\t\tif (storage != null && storage.data != null) {\n\t\t\t\tdata = storage.data;\n\t\t\t\tcont = storage.cont;\n\t\t\t}\n\t\t}\n\t\tif (cont == 0 || data == null) {\n\t\t\tdata = getImage();\n\t\t\tif (data == null)\n\t\t\t\treturn null;\n\t\t\tcont++;// It increments twice so on the next run it doesn't get\n\t\t\t// updated again\n\t\t}\n\t\tif (cont > 5)\n\t\t\tcont = 0; // it increments just next, so it never stays 0 (wich\n\t\t// is only initial state)\n\t\tcont++;\n\t\tsynchronized (store) {\n\t\t\tif (storage == null) {\n\t\t\t\tstorage = new Storage();\n\t\t\t}\n\t\t\tstorage.cont = cont;\n\t\t\tstore.setContents(storage);\n\t\t\tstore.commit();\n\t\t}\n\n\t\treturn data;\n\t}", "@Override\n public int read(ByteBuffer dst) throws IOException {\n if (dst == null) {\n throw new NullPointerException(\"The destination buffer is null.\");\n }\n if (dst.limit() == 0) {\n throw new IllegalArgumentException(\"The destination buffer has zero length.\");\n }\n if (!_open)\n return -1;\n\n // Make an attempt to read up to r bytes from the channel, where\n // r is the number of bytes remaining in the buffer, that is,\n // dst.remaining(), at the moment this method is invoked.\n long _here = position();\n\n // Build temporary storage.\n int remain = dst.remaining();\n byte[] data = new byte[remain];\n\n int length = _backing.read(data, 0, remain);\n\n if (length > 0) {\n\n // Iterate thru each byte of temporary storage and decrypt those\n // bytes back\n // into the buffer\n for (int index = 0; index < length; index++) {\n data[index] = _head.crypt(data[index], index + _here);\n } // Decrypt all bytes.\n dst.put(data, 0, length);\n }\n return length;\n }", "public void runAES(String infoFilePath) {\n System.out.println(\"test\");\n try {\n FileInputStream fileInputStream = new FileInputStream(infoFilePath);\n StringBuffer stringBuffer = new StringBuffer();\n for (int i = fileInputStream.read(); i != 19; i = fileInputStream.read())\n stringBuffer.append((char) i);\n // long l = Long.parseLong(stringBuffer.toString());\n\n // This is the Long object in the `info` file.\n // byte[] builtSecretKey = buildSecretKey(-345585222195293739L);\n byte[] builtSecretKey = buildSecretKey(6874628185188049249L);\n\n MessageDigest messageDigest = MessageDigest.getInstance(\"MD5\");\n SecretKeySpec secretKeySpec = new SecretKeySpec(messageDigest.digest(builtSecretKey), \"AES\");\n Cipher cipher = Cipher.getInstance(\"AES\");\n cipher.init(2, secretKeySpec);\n ObjectInputStream objectInputStream = new ObjectInputStream(new CipherInputStream(fileInputStream, cipher));\n\n long secretKey = objectInputStream.readLong();\n HashMap<String, com.b.a.b.a> n = (HashMap<String, com.b.a.b.a>) objectInputStream.readObject();\n String k = (String) objectInputStream.readObject();\n String l = (String) objectInputStream.readObject();\n Boolean p = ((Boolean) objectInputStream.readObject()).booleanValue();\n Boolean o = ((Boolean) objectInputStream.readObject()).booleanValue();\n\n // Print everything\n System.out.println(secretKey);\n System.out.println(\"key_info:\");\n for (String key : n.keySet()) {\n com.b.a.b.a a = n.get(key);\n System.out.println(\" \" + key + \":\");\n System.out.println(\" a.a: \" + a.a.a());\n System.out.println(\" b: \" + a.a.b());\n System.out.println(\" c: \" + a.a.c());\n System.out.println(\" d: \" + a.a.d());\n System.out.println(\" e: \" + a.a.e().toString());\n System.out.println(\" f: \" + a.a.f());\n System.out.println(\" a.b: \" + a.b); // This is my key, existing in every file.\n System.out.println(\" a.c: \" + a.c);\n }\n System.out.println(k);\n System.out.println(l);\n System.out.println(p);\n System.out.println(o);\n\n objectInputStream.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public byte[] getImage() {\n return image;\n }", "public byte[] getImage() {\n return image;\n }", "public byte[] getImage() {\n return image;\n }", "public void opentextfile(String path1)\n {\n FileInputStream fin,fin1;\n \tint i,j=0;\n String s=JOptionPane.showInputDialog(this,\"Enter key with 16 letters\");\n char ch[]=new char[s.length()];\n ch=s.toCharArray();\n try\n {\n FileOutputStream f=new FileOutputStream(\"key1.txt\");\n for(i=0;i<ch.length;i++)\n f.write(ch[i]);\n f.close();\n ideaalgo a=new ideaalgo(path1);\n a.procedure();\n a.encrypt();\n BufferedReader d;\n StringBuffer sb=new StringBuffer();\n d=new BufferedReader(new FileReader(path1));\n String line;\n while((line=d.readLine())!=null)\n sb.append(line+\"\\n\");\n ta.setText(sb.toString());\n d.close();\n fin=new FileInputStream(\"enc.txt\");\n do\n \t {\n\t i=fin.read();\n \t if(i!=-1)\n \t\t{\n bytes[j++]=i;\n }\n } while(i!=-1);\n max=j;\n fin.close();\n binarycon();\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n }", "public void stringcon()\n {\n int i,j,k;\n int temp[]=new int[8];\n int a[]=new int[32];\n i=0;\n j=0;\n for(i=0;i<10000;i++)\n bytes[i]=0;\n i=0;\n maxbinary1=0;\n for(i=0;i<24;i++)\n a[i]=binary[i];\n for(i=0;i<24;i++)\n maxbinary1+=a[i]*Math.pow(2,23-i);\n maxbinary2=maxbinary1*8;\n ivalue=0;\n for(i=24,j=0;i<32;i++,j++)\n {\n a[j]=binary[i];\n ivalue+=a[j]*Math.pow(2,7-j);\n }\n if(ivalue==73)\n {\n i=32;\n while(i<maxbinary2)\n {\n for(k=0;k<=7;k++)\n temp[k]=binary[i++];\n for(k=0;k<=7;k++)\n bytes[j]+=temp[k]*Math.pow(2,7-k);\n j++;\n }\n String s=JOptionPane.showInputDialog(this,\"Enter key with 16 letters\");\n char ch[]=new char[s.length()];\n ch=s.toCharArray();\n try\n {\n FileOutputStream f=new FileOutputStream(\"key1.txt\");\n for(i=0;i<ch.length;i++)\n f.write(ch[i]);\n f.close();\n FileOutputStream fout=new FileOutputStream(\"enc1.txt\");\n DataOutputStream d=new DataOutputStream(fout);\n \t\ti=8;\n while(i<(maxbinary1))\n \t\t {\n \t\t\td.write(bytes[i]);\n\t\t i++;\n \t\t }\n fout.close();\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n\n ideaalgo b=new ideaalgo();\n b.procedure();\n b.decryption(\"enc1.txt\");\n try\n {\n BufferedReader d;\n StringBuffer sb=new StringBuffer();\n d=new BufferedReader(new FileReader(\"dec.txt\"));\n String line;\n while((line=d.readLine())!=null)\n sb.append(line+\"\\n\");\n ta.setText(sb.toString());\n d.close();\n }\ncatch(Exception e)\n {\n System.out.println(e);\n }\n }\n}", "public static final byte[] encryptData(final byte data[]) {\n\n for (int j = 0; j < 6; j++) {\n byte remember = 0;\n byte dataLength = (byte) (data.length & 0xFF);\n // printByteArray(data);\n if (j % 2 == 0) {\n for (int i = 0; i < data.length; i++) {\n byte cur = data[i];\n cur = BitTools.rollLeft(cur, 3);\n cur += dataLength;\n cur ^= remember;\n remember = cur;\n cur = BitTools.rollRight(cur, (int) dataLength & 0xFF);\n cur = ((byte) ((~cur) & 0xFF));\n cur += 0x48;\n dataLength--;\n data[i] = cur;\n }\n } else {\n for (int i = data.length - 1; i >= 0; i--) {\n byte cur = data[i];\n cur = BitTools.rollLeft(cur, 4);\n cur += dataLength;\n cur ^= remember;\n remember = cur;\n cur ^= 0x13;\n cur = BitTools.rollRight(cur, 3);\n dataLength--;\n data[i] = cur;\n }\n }\n //System.out.println(\"enc after iteration \" + j + \": \" + HexTool.toString(data) + \" al: \" + al);\n }\n return data;\n }", "private static final byte[] pkgsave_d_image() {\n\t\tbyte data[] = { 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -29, 0, 0, 96,\n\t\t\t\t96, 96, -96, -96, -96, -33, -33, -33, 96, 96, 96, 96, 96, 96,\n\t\t\t\t-128, -128, -128, -112, -112, -112, -64, -64, -64, -112, -112,\n\t\t\t\t-112, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n\t\t\t\t-1, -1, -1, -1, -1, -1, -1, 33, -2, 14, 77, 97, 100, 101, 32,\n\t\t\t\t119, 105, 116, 104, 32, 71, 73, 77, 80, 0, 33, -7, 4, 1, 10, 0,\n\t\t\t\t9, 0, 44, 0, 0, 0, 0, 16, 0, 16, 0, 0, 4, 83, 48, 73, 32, 103,\n\t\t\t\t-67, 9, -128, 64, 51, -17, -43, 22, -116, -38, 72, 98, -101,\n\t\t\t\t38, 12, 37, 120, 1, 66, 60, -60, 110, -8, -83, 45, 106, 126,\n\t\t\t\t123, -35, 18, -127, -126, -31, 64, 36, 26, 10, -109, 13, 80,\n\t\t\t\t104, 104, 58, -111, -98, -64, 114, 88, 60, 28, 67, -128, -87,\n\t\t\t\t-13, -119, 2, 20, -66, 96, 48, 70, -14, 69, -104, -51, -33,\n\t\t\t\t113, -94, -116, 40, -89, -57, 108, 55, 20, -61, 62, 127, 35, 0,\n\t\t\t\t59 };\n\t\treturn data;\n\t}", "@Override\n public String decrypt(String encryptedText) {\n if (StringUtils.isBlank(encryptedText)) {\n return null;\n }\n\n try {\n byte[] decoded = Base64.getDecoder().decode(encryptedText);\n\n byte[] iv = Arrays.copyOfRange(decoded, 0, GCM_IV_LENGTH);\n\n Cipher cipher = Cipher.getInstance(ENCRYPT_ALGORITHM);\n GCMParameterSpec ivSpec = new GCMParameterSpec(GCM_TAG_LENGTH * Byte.SIZE, iv);\n cipher.init(Cipher.DECRYPT_MODE, getKeyFromPassword(), ivSpec);\n\n byte[] ciphertext = cipher.doFinal(decoded, GCM_IV_LENGTH, decoded.length - GCM_IV_LENGTH);\n\n return new String(ciphertext, StandardCharsets.UTF_8);\n } catch (NoSuchAlgorithmException\n | IllegalArgumentException\n | InvalidKeyException\n | InvalidAlgorithmParameterException\n | IllegalBlockSizeException\n | BadPaddingException\n | NoSuchPaddingException e) {\n LOG.debug(ERROR_DECRYPTING_DATA, e);\n throw new EncryptionException(e);\n }\n }", "public static void decryptFile(File encryptedFile, File result, String password) throws IOException {\n byte[] b = readBytes(encryptedFile);\n String decryptedImageString = new RNCryptorNative().decrypt(new String(b), password);\n byte[] decodedBytes = Base64.decode(decryptedImageString, 0);\n writeBytes(result, decodedBytes);\n }", "@Override\n int doCryptoOperation(byte[] arrby, byte[] object) throws BadPaddingException, IllegalBlockSizeException {\n if (this.encrypting) {\n if (!this.usingPrivateKey) return NativeCrypto.RSA_public_encrypt(arrby.length, arrby, (byte[])object, this.key.getNativeRef(), this.padding);\n return NativeCrypto.RSA_private_encrypt(arrby.length, arrby, (byte[])object, this.key.getNativeRef(), this.padding);\n }\n try {\n if (!this.usingPrivateKey) return NativeCrypto.RSA_public_decrypt(arrby.length, arrby, (byte[])object, this.key.getNativeRef(), this.padding);\n return NativeCrypto.RSA_private_decrypt(arrby.length, arrby, (byte[])object, this.key.getNativeRef(), this.padding);\n }\n catch (SignatureException signatureException) {\n object = new IllegalBlockSizeException();\n ((Throwable)object).initCause(signatureException);\n throw object;\n }\n }", "public void test(String path){\n File file = new File(path);\n byte[] image = new byte[(int) file.length()];\n try {\n FileInputStream fis = new FileInputStream(file);\n fis.read(image); //read file into bytes[]\n\n fis.close();\n test(image);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "private static byte[] getKeyData(String filePath) {\n File file = new File(filePath);\n byte[] buffer = new byte[(int) file.length()];\n FileInputStream fis = null;\n try {\n fis = new FileInputStream(file);\n fis.read(buffer);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (fis != null)\n try {\n fis.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return buffer;\n }", "public ImageData getImageData() {\n\t\treturn this.data.getImageData();\n\t}", "static Image bityNaObraz(String image) throws IOException\n {\n byte[] rysunek = DatatypeConverter.parseBase64Binary(image); \n BufferedImage img = ImageIO.read(new ByteArrayInputStream(rysunek));\n return img;\n }", "public String getData() {\n\t\t\tString[] columns = new String[] { KEY_ID, KEY_IMAGE, KEY_NAME ,KEY_DES};\n\t\t\tCursor c = ourDatabase.query(DATABASE_NAME, columns, null, null, null, null, null);\n\t\t\tString result = \"\";\n\n\t\t\tint irow = c.getColumnIndex(KEY_ID);\n\t\t\tint iimg = c.getColumnIndex(KEY_IMAGE);\n\t\t\tint iname = c.getColumnIndex(KEY_NAME);\n\t\t\tint ides = c.getColumnIndex(KEY_DES);\n\n\t\t\tfor (c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) {\n\t\t\t\tresult = result + c.getString(irow) + \" \"+c.getString(iimg) + \" \"+c.getString(iname) + \" \"+c.getString(ides) + \" \"+\"\\n\";\n\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}", "public byte[] get_byte_data(BufferedImage image) {\n WritableRaster raster = image.getRaster();\n DataBufferByte buffer = (DataBufferByte) raster.getDataBuffer();\n return buffer.getData();\n }", "ImageContentData findContentData(String imageId);", "public static String decrypt(String encrypted, Keys keys) throws GeneralSecurityException {\n Cipher cipher = Cipher.getInstance(ENC_SYSTEM);\n String[] data = COLON.split(encrypted);\n if (data.length != 3) {\n throw new GeneralSecurityException(\"Invalid encrypted data!\");\n }\n String mac = data[0];\n String iv = data[1];\n String cipherText = data[2];\n\n // Verify that the ciphertext and IV haven't been tampered with first\n String dataToAuth = iv + \":\" + cipherText;\n if (!computeMac(dataToAuth, keys.getMacKey()).equals(mac)) {\n throw new GeneralSecurityException(\"Incorrect MAC!\");\n }\n\n // Decrypt the ciphertext\n byte[] ivBytes = decodeBase64(iv);\n cipher.init(Cipher.DECRYPT_MODE, keys.getEncKey(), new IvParameterSpec(ivBytes));\n byte[] bytes = cipher.doFinal(decodeBase64(cipherText));\n\n // Decode the plaintext bytes into a String\n CharsetDecoder decoder = Charset.defaultCharset().newDecoder();\n decoder.onMalformedInput(CodingErrorAction.REPORT);\n decoder.onUnmappableCharacter(CodingErrorAction.REPORT);\n /*\n * We are coding UTF-8 (guaranteed to be the default charset on\n * Android) to Java chars (UTF-16, 2 bytes per char). For valid UTF-8\n * sequences, then:\n * 1 byte in UTF-8 (US-ASCII) -> 1 char in UTF-16\n * 2-3 bytes in UTF-8 (BMP) -> 1 char in UTF-16\n * 4 bytes in UTF-8 (non-BMP) -> 2 chars in UTF-16 (surrogate pair)\n * The decoded output is therefore guaranteed to fit into a char\n * array the same length as the input byte array.\n */\n CharBuffer out = CharBuffer.allocate(bytes.length);\n CoderResult result = decoder.decode(ByteBuffer.wrap(bytes), out, true);\n if (result.isError()) {\n /* The input was supposed to be the result of encrypting a String,\n * so something is very wrong if it cannot be decoded into one! */\n throw new GeneralSecurityException(\"Corrupt decrypted data!\");\n }\n decoder.flush(out);\n return out.flip().toString();\n }", "public static byte[] decrypt(byte[] encryptedIvTextBytes, String key) throws Exception {\n int ivSize = 16;\n int keySize = 16;\n\n // Generacion IV (Vector de inicializacion)\n byte[] iv = new byte[ivSize];\n System.arraycopy(encryptedIvTextBytes, 0, iv, 0, iv.length);\n IvParameterSpec ivParameterSpec = new IvParameterSpec(iv);\n\n // Elimina el IV del archivo encriptado \n int encryptedSize = encryptedIvTextBytes.length - ivSize;\n byte[] encryptedBytes = new byte[encryptedSize];\n System.arraycopy(encryptedIvTextBytes, ivSize, encryptedBytes, 0, encryptedSize);\n\n // Generacion de hash de la clave secreta.\n byte[] keyBytes = new byte[keySize];\n MessageDigest md = MessageDigest.getInstance(\"SHA-256\");\n md.update(key.getBytes());\n System.arraycopy(md.digest(), 0, keyBytes, 0, keyBytes.length);\n SecretKeySpec secretKeySpec = new SecretKeySpec(keyBytes, \"AES\");\n\n // Llamado a libreria de cifrado de java\n Cipher cipherDecrypt = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n cipherDecrypt.init(Cipher.DECRYPT_MODE, secretKeySpec, ivParameterSpec);\n byte[] decrypted = cipherDecrypt.doFinal(encryptedBytes);\n\n return decrypted;\n }", "public void encryptFile(String fitxer, SecretKey clau) throws FileNotFoundException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IOException, IllegalBlockSizeException, BadPaddingException {\r\n //Creamos el FileInput Stream para leer el archivo.\r\n FileInputStream fis = new FileInputStream(fitxer);\r\n //Creamos el FileOutputStream para escribir en el fichero.\r\n FileOutputStream fos = new FileOutputStream(new File(\"mensajeCifrado.txt\"));\r\n \r\n //Creamos un cifrador para cifrar el texto.\r\n Cipher cifrador = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\r\n IvParameterSpec iv = new IvParameterSpec(cadena_iv.getBytes());\r\n cifrador.init(Cipher.ENCRYPT_MODE, clau);\r\n \r\n //Creamos un buffer que es un array de bytes donde almacenaremos el texto.\r\n byte[] buffer = new byte[1024];\r\n \r\n int bytes;\r\n //Utilizamos un bucle para ir leyendo el archivo de texto que le hemos pasado.\r\n while((bytes = fis.read(buffer, 0, buffer.length))!=-1){\r\n byte [] update = cifrador.update(buffer, 0, bytes);\r\n fos.write(cifrador.doFinal());\r\n }\r\n \r\n //Cerramos recursos.\r\n fos.write(cifrador.doFinal());\r\n fis.close();\r\n fos.close();\r\n \r\n \r\n }", "com.google.protobuf.ByteString getImgData(int index);", "public int decryptStorage(String password) throws RemoteException;", "public static final byte[] decryptData(final byte data[]) {\n for (int j = 1; j <= 6; j++) {\n byte remember = 0;\n byte dataLength = (byte) (data.length & 0xFF);\n byte nextRemember = 0;\n\n if (j % 2 == 0) {\n for (int i = 0; i < data.length; i++) {\n byte cur = data[i];\n cur -= 0x48;\n cur = ((byte) ((~cur) & 0xFF));\n cur = BitTools.rollLeft(cur, (int) dataLength & 0xFF);\n nextRemember = cur;\n cur ^= remember;\n remember = nextRemember;\n cur -= dataLength;\n cur = BitTools.rollRight(cur, 3);\n data[i] = cur;\n dataLength--;\n }\n } else {\n for (int i = data.length - 1; i >= 0; i--) {\n byte cur = data[i];\n cur = BitTools.rollLeft(cur, 3);\n cur ^= 0x13;\n nextRemember = cur;\n cur ^= remember;\n remember = nextRemember;\n cur -= dataLength;\n cur = BitTools.rollRight(cur, 4);\n data[i] = cur;\n dataLength--;\n }\n }\n //System.out.println(\"dec after iteration \" + j + \": \" + HexTool.toString(data));\n }\n return data;\n }", "public String decrypt(String encrypted) {\n try {\n IvParameterSpec iv = new IvParameterSpec(initVector);\n SecretKeySpec skeySpec = new SecretKeySpec(privateKey, \"AES\");\n\n Cipher cipher = Cipher.getInstance(\"AES/CBC/PKCS5PADDING\");\n cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);\n\n byte[] original = cipher.doFinal(Base64Coder.decode(encrypted));\n\n return new String(original);\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n\n return null;\n }", "public int read() throws IOException {\n if (!_open)\n return -1;\n long _here = position();\n int val = _backing.read();\n if (val >= 0) {\n val = _head.crypt((byte) val, _here);\n }\n return val;\n }", "public byte[] decrypt(byte[] data, int token, String pin) \n\t\tthrows SignedDocException;", "private void encryptingData(File fileToEncrrypt, Signature dataSigner) throws Exception {\n\t\tFileOutputStream fos = null;\n\t\tFileInputStream fis = null;\n\t\tCipherInputStream cis = null;\n\t\ttry {\n\t\t\tfos = new FileOutputStream(localWorkingDirectoryPath + \"\\\\Encrypted_File.txt\");\n\t\t\tfis = new FileInputStream(fileToEncrrypt);\n\t\t\tbyte[] encryptedDataByteArray = new byte[8];\n\t\t\tcis = new CipherInputStream(fis, myCipher);\n\t\t\tint i = cis.read(encryptedDataByteArray);\n\t\t\twhile (i != -1) {\n\t\t\t\t// Updating the data inside the Signer\n\t\t\t\tdataSigner.update(encryptedDataByteArray);\n\t\t\t\t// writing the encrypted data to the file\n\t\t\t\tfos.write(encryptedDataByteArray, 0, i);\n\t\t\t\ti = cis.read(encryptedDataByteArray);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\twriteToLog(\"Error While trying to encrypt the data: \" + e.getMessage());\n\t\t\tLogWriter.close();\n\t\t\tthrow new Exception(\"Error: While trying to encrypt the data\", e);\n\t\t} finally {\n\t\t\tcis.close();\n\t\t\tfis.close();\n\t\t\tfos.close();\n\t\t}\n\t}", "@Test\n\tpublic void testImageFromWindowsPhotoEditor2() throws IOException, ImageProcessingException, MetadataException {\n\t\tURL url = new URL(\"https://dbis-thure.uibk.ac.at/f/Get?id=BTCMSAGPZYLKPPLZWWQLSMKY\");\n\t\tRotatedBufferedImage bi = (RotatedBufferedImage) TrpImageIO.read(url);\n\t\tlogger.info(\"TrpImageIO result = \" + bi.getImageTransformation().toString());\n\t\t\n\t\tImageTransformation t = TrpImgMdParser.readImageDimension(url);\n\t\tlogger.info(\"TrpImgMdParser result = \" + t.toString());\n\t}", "public static byte[] encrypt(byte[] plainFile, String key) throws Exception {\n\n // Generacion IV (Vector de inicializacion)\n int ivSize = 16;\n byte[] iv = new byte[ivSize];\n SecureRandom random = new SecureRandom();\n random.nextBytes(iv);\n IvParameterSpec ivParameterSpec = new IvParameterSpec(iv);\n\n // Generacion de hash de la clave secreta.\n MessageDigest digest = MessageDigest.getInstance(\"SHA-256\"); // SHA-256: Algoritmo de Hashing que genera una clave de 256 bits\n digest.update(key.getBytes(\"UTF-8\"));\n byte[] keyBytes = new byte[16];\n System.arraycopy(digest.digest(), 0, keyBytes, 0, keyBytes.length);\n SecretKeySpec secretKeySpec = new SecretKeySpec(keyBytes, \"AES\");\n\n // Llamado a libreria de cifrado de java.\n Cipher cipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec);\n byte[] encrypted = cipher.doFinal(plainFile);\n\n // Agrega IV al vector del archivo encriptado \n byte[] encryptedIVAndText = new byte[ivSize + encrypted.length];\n System.arraycopy(iv, 0, encryptedIVAndText, 0, ivSize);\n System.arraycopy(encrypted, 0, encryptedIVAndText, ivSize, encrypted.length);\n\n return encryptedIVAndText;\n }", "public byte[] decrypt(byte[] data, int offset) throws Exception {\n // check if there is data to decrypt after the offset and iv\n if (data.length <= BLOCK_SIZE_BYTES + offset) {\n throw new Exception(\"No data to decrypt\");\n }\n\n // get iv value from the beggining of data\n byte[] iv = new byte[BLOCK_SIZE_BYTES];\n System.arraycopy(data, offset, iv, 0, BLOCK_SIZE_BYTES);\n\n // init cipher instance\n m_cipher.init(javax.crypto.Cipher.DECRYPT_MODE, m_keySpec, new IvParameterSpec(iv));\n\n // return decrypted value\n return m_cipher.doFinal(data, (BLOCK_SIZE_BYTES + offset), data.length - (BLOCK_SIZE_BYTES + offset));\n }", "public byte[] encode(RenderedImage image) throws java.io.IOException;", "public String getImageBase64() {\n return this.imageBase64;\n }", "public BufferedImage getImage() {\n\t\tString base64ImageString = getData();\n\t\tByteArrayInputStream byteStream = new ByteArrayInputStream(Base64\n\t\t\t\t.decodeBase64(base64ImageString.getBytes()));\n\t\ttry {\n\t\t\treturn ImageIO.read(byteStream);\n\t\t} catch (Exception e) {\n\t\t\treturn null;\n\t\t}\n\t}" ]
[ "0.6370612", "0.62066126", "0.61649454", "0.5901222", "0.5722494", "0.5721898", "0.5671536", "0.56549835", "0.56174994", "0.56144613", "0.560085", "0.55910975", "0.55910975", "0.55910975", "0.55910975", "0.558564", "0.5534256", "0.55155694", "0.5481103", "0.5461444", "0.5456622", "0.5448183", "0.54293895", "0.53769934", "0.5372391", "0.5309763", "0.53079116", "0.5280884", "0.5278352", "0.5271708", "0.52697194", "0.52684796", "0.5252085", "0.5237222", "0.5233993", "0.5226189", "0.5217933", "0.5208189", "0.5203717", "0.51999366", "0.51821554", "0.5176296", "0.517394", "0.51687056", "0.5164177", "0.5135903", "0.51339406", "0.51333463", "0.51164323", "0.51126885", "0.5108105", "0.50957376", "0.5093912", "0.5086226", "0.50828135", "0.5081268", "0.5079877", "0.5079218", "0.5079111", "0.5069783", "0.50688636", "0.50468034", "0.503682", "0.5035609", "0.50345", "0.5026747", "0.50227845", "0.5008581", "0.500354", "0.500354", "0.500354", "0.5003299", "0.49926534", "0.4980843", "0.49778557", "0.49730217", "0.49614763", "0.49591255", "0.49573788", "0.49496266", "0.4945682", "0.49427915", "0.49419352", "0.49401253", "0.49329704", "0.49280435", "0.49259436", "0.49253228", "0.49248913", "0.4922374", "0.49210402", "0.49199504", "0.4914667", "0.49123877", "0.49104258", "0.4909376", "0.49043834", "0.4902759", "0.48970476", "0.48965508", "0.4888705" ]
0.0
-1
It converts the data obtained from the image into binary data
public void stringcon() { int i,j,k; int temp[]=new int[8]; int a[]=new int[32]; i=0; j=0; for(i=0;i<10000;i++) bytes[i]=0; i=0; maxbinary1=0; for(i=0;i<24;i++) a[i]=binary[i]; for(i=0;i<24;i++) maxbinary1+=a[i]*Math.pow(2,23-i); maxbinary2=maxbinary1*8; ivalue=0; for(i=24,j=0;i<32;i++,j++) { a[j]=binary[i]; ivalue+=a[j]*Math.pow(2,7-j); } if(ivalue==73) { i=32; while(i<maxbinary2) { for(k=0;k<=7;k++) temp[k]=binary[i++]; for(k=0;k<=7;k++) bytes[j]+=temp[k]*Math.pow(2,7-k); j++; } String s=JOptionPane.showInputDialog(this,"Enter key with 16 letters"); char ch[]=new char[s.length()]; ch=s.toCharArray(); try { FileOutputStream f=new FileOutputStream("key1.txt"); for(i=0;i<ch.length;i++) f.write(ch[i]); f.close(); FileOutputStream fout=new FileOutputStream("enc1.txt"); DataOutputStream d=new DataOutputStream(fout); i=8; while(i<(maxbinary1)) { d.write(bytes[i]); i++; } fout.close(); } catch(Exception e) { System.out.println(e); } ideaalgo b=new ideaalgo(); b.procedure(); b.decryption("enc1.txt"); try { BufferedReader d; StringBuffer sb=new StringBuffer(); d=new BufferedReader(new FileReader("dec.txt")); String line; while((line=d.readLine())!=null) sb.append(line+"\n"); ta.setText(sb.toString()); d.close(); } catch(Exception e) { System.out.println(e); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public native byte[] imageToBlob(ImageInfo imageInfo);", "public byte[] get_byte_data(BufferedImage image) {\n WritableRaster raster = image.getRaster();\n DataBufferByte buffer = (DataBufferByte) raster.getDataBuffer();\n return buffer.getData();\n }", "private byte[] imageViewToByte(ImageView image){\n Bitmap bitmap = ((BitmapDrawable)image.getDrawable()).getBitmap();\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);\n byte[] byteArray = stream.toByteArray();\n return byteArray;\n }", "public static byte[] getImageBinary(File f) {\n BufferedImage bi;\n try {\n bi = ImageIO.read(f);\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n ImageIO.write(bi, \"jpg\", baos);\n byte[] bytes = baos.toByteArray();\n return bytes;\n //return encoder.encodeBuffer(bytes).trim();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public byte[] encode(RenderedImage image) throws java.io.IOException;", "public byte[] getImageBytes()\n {\n byte[] buff = null;\n \n try\n {\n ByteArrayOutputStream bos = new ByteArrayOutputStream() ;\n ImageIO.write(img, \"jpg\", bos);\n buff = bos.toByteArray();\n bos.flush();\n bos.close();\n }\n catch(Exception ex)\n {\n System.out.println(\"Problem Serializeing PicNode\");\n ex.printStackTrace();\n }\n return buff;\n }", "private byte[] convertImageBitmanToByte(Bitmap bitmap){\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos); //bm is the bitmap object\n byte[] b = baos.toByteArray();\n\n return b;\n }", "public byte[] convertImage(Image image) {\n BufferedImage bytesImage = SwingFXUtils.fromFXImage(image, null);\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n byte[] bytesArray = null;\n try {\n ImageIO.write(bytesImage, \"png\", baos);\n //coloca los bytes de la imagen en un arreglo de bytes\n bytesArray = baos.toByteArray();\n baos.close();\n return bytesArray;\n } catch (IOException ex) {\n Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);\n }\n return null;\n }", "public static byte[] imageToByteArray(BufferedImage image) {\n if (image != null) {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n try {\n ImageIO.write(image, \"png\", baos);\n baos.flush();\n byte[] imageInByte = baos.toByteArray();\n baos.close();\n return imageInByte;\n } catch (IOException ex) {\n log.error(\"error while converting to byte array\", ex);\n }\n WritableRaster raster = image.getRaster();\n DataBufferByte data = (DataBufferByte) raster.getDataBuffer();\n return data.getData();\n }\n return new byte[0];\n }", "byte[] getData();", "byte[] getData();", "byte[] getData();", "byte[] getData();", "public byte[] convertCircleBitmapToByteArray(Bitmap imagem){\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n imagem.compress(Bitmap.CompressFormat.JPEG, 100, stream);\n byte imagemBytes[] = stream.toByteArray();\n return imagemBytes;\n\n }", "public byte[] Img2Bin (String path){\t \n\t\tByteArrayOutputStream bin = new ByteArrayOutputStream();\n\t\t\n\t\ttry {\n\t\t\tBufferedImage image = ImageIO.read(new File(path));\n\t\t\tImageIO.write(image, \"jpg\", bin);\n\t\t} catch (IOException e) {\n\t\t\tLOG.error(\"Img2Bin didn't succeed. Error: {}\",e);\n\t\t\treturn null;\n\t\t}\n\n\t return bin.toByteArray();\n\t}", "private void getBinaryImage() {\n //apply gaussianfilter\n Imgproc.GaussianBlur(currentGray, currentGray, new Size(gauss,gauss), 0);\n\n // subtract backgroundGray from current image and store in currentGray\n Core.subtract(currentGray, backgroundGray, currentGray);\n\n //get Binary image using Otsu\n Imgproc.threshold(currentGray, binary, 0, 255, Imgproc.THRESH_BINARY + Imgproc.THRESH_OTSU);\n }", "public byte[] getImageData() {\r\n return imageData;\r\n }", "public byte[] getData();", "static public byte[] bitmapToByte(Bitmap bitmap) {\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.PNG, 0 /*ignored for PNG*/, bos);\n byte[] bitmapdata = bos.toByteArray();\n try {\n bos.close();\n } catch (IOException e) {\n Log.d(\"close\",\"io exception in convert bitmap to byte[] happened\");\n }\n return bitmapdata;\n }", "private byte[] getImageBytes(File image){\n byte[] imageInByte = null;\n try{\n \n\tBufferedImage originalImage = \n ImageIO.read(image);\n \n\tByteArrayOutputStream baos = new ByteArrayOutputStream();\n\tImageIO.write( originalImage, \"png\", baos );\n\tbaos.flush();\n\timageInByte = baos.toByteArray();\n\tbaos.close();\n \n\t}catch(IOException e){\n\t\tSystem.out.println(e.getMessage());\n\t}finally{\n return imageInByte;\n }\n }", "public abstract byte[] toByteArray();", "public abstract byte[] toByteArray();", "public byte[] bitmap();", "static String convertToBase64(byte[] image){\n return !Objects.isNull(image)\n ? Base64.getEncoder().encodeToString(image)\n : \"\";\n }", "public byte[] readImagePNG(BufferedImage bufferedimage) throws IOException{\n byte[] data = ImageUtil.toByteArray(bufferedimage);\r\n /* \r\n for (int i = 0; i < data.length; i++) {\r\n if(i!=0&&i%4==0)\r\n System.out.println();\r\n System.out.format(\"%02X \",data[i]);\r\n }\r\n */ \r\n \r\n \r\n \r\n \r\n byte[] stximage = getStximage();\r\n byte[] etximage = getEtximage();\r\n \r\n byte[] stxdata = new byte[stximage.length];\r\n byte[] etxdata = new byte[etximage.length];\r\n byte[] length = new byte[4];\r\n \r\n boolean stxsw=false;\r\n boolean etxsw=false;\r\n byte[] full_data=null;\r\n byte[] only_data=null;\r\n try{\r\n for (int i = 0; i < data.length; i++) {\r\n System.arraycopy(data, i, stxdata,0, stxdata.length);\r\n stxsw = ByteUtil.equals(stximage, stxdata);\r\n int subindex=i+stxdata.length;\r\n if(stxsw){\r\n System.arraycopy(data, subindex, length,0, length.length);\r\n int length_fulldata = ConversionUtil.toInt(length);\r\n // System.out.format(\"%02X %d subIndex[%d]\",data[subindex],length_fulldata,subindex);\r\n \r\n \r\n subindex+=i+length.length;\r\n int etx_index= subindex+ length_fulldata;\r\n // System.out.println(\"subindex : \"+subindex+\" etx_index : \"+etx_index);\r\n System.arraycopy(data, etx_index, etxdata,0, etxdata.length);\r\n \r\n// for (int j = 0; j < etxdata.length; j++) {\r\n// System.out.format(\"%02X \",etxdata[j]);\r\n// }\r\n \r\n etxsw = ByteUtil.equals(etximage, etxdata);\r\n if(etxsw){\r\n full_data = new byte[etx_index-subindex];\r\n System.arraycopy(data, subindex, full_data,0, full_data.length); //fulldata\r\n break;\r\n }else{\r\n continue;\r\n }\r\n }\r\n \r\n \r\n }\r\n \r\n /////only data search\r\n System.arraycopy(full_data, 0, length,0, length.length);\r\n int length_onlydata = ConversionUtil.toInt(length); \r\n only_data = new byte[length_onlydata];\r\n System.arraycopy(full_data, length.length, only_data,0, only_data.length);\r\n \r\n \r\n \r\n }catch (Exception e) {\r\n return null;\r\n }\r\n \r\n return only_data;\r\n \r\n }", "private void bitToByte(Bitmap bmap) {\n\t\ttry {\n\t\t\tByteArrayOutputStream bos = new ByteArrayOutputStream();\n\t\t\tbmap.compress(Bitmap.CompressFormat.PNG, 100, bos);\n\t\t\tbytePhoto = bos.toByteArray();\n\t\t\tbos.close();\n\t\t} catch (IOException ioe) {\n\n\t\t}\n\t}", "static byte[] getBytes(Bitmap bitmap) {\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bitmap.compress(CompressFormat.PNG, 0, stream);\n return stream.toByteArray();\n }", "public static byte[] bitmapToByte(Bitmap bitmap) {\n Bitmap bmpCompressed = Bitmap.createScaledBitmap(bitmap, 640, 480, true);\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n\n // CompressFormat set up to JPG, you can change to PNG or whatever you want;\n boolean isCompressSuccess = bmpCompressed.compress(Bitmap.CompressFormat.JPEG, 100, bos);\n Log.d(TAG, \"bitmapToByte() called with: bitmap isCompressSuccess = \" + isCompressSuccess);\n byte[] data = bos.toByteArray();\n\n Log.d(TAG, \"bitmapToByte() called. Returning data= \\n\" + data +\"\\n \\n<END>\\n \\n\");\n\n return data;\n }", "public byte[] getAsBytes() {\n return (byte[])data;\n }", "Picture binaryComponentImage() throws Exception;", "Object getChannelData() {\r\n return imageData;\r\n }", "public static byte[] convertBitmapToByte(Bitmap bitmap) {\n\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.JPEG, 50, stream);\n// Log.e(\"ImageUtil-Bitmap Size\", String.valueOf(bitmap.getByteCount()));\n byte[] bytes = stream.toByteArray();\n\n return bytes;\n }", "public TE doInBackground(byte[]... data) {\n return PhotoModule.this.convertN21ToBitmap(data[0]);\n }", "private byte[] getBytesFromBitmap(Bitmap bitmap) {\r\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\r\n bitmap.compress(Bitmap.CompressFormat.JPEG, 70, stream);\r\n return stream.toByteArray();\r\n }", "public byte[] bufferedImageToByteArray(BufferedImage bufferedImage) {\n byte[] byteImage = null;\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n try {\n ImageIO.write(bufferedImage, \"jpg\", baos);\n baos.flush();\n byteImage = baos.toByteArray();\n baos.close();\n } catch (IOException ex) {\n Logger.getLogger(ProcessImage.class.getName()).log(Level.SEVERE, null, ex);\n }\n return byteImage;\n }", "public abstract byte[] toBytes() throws Exception;", "byte[] getBytes();", "byte[] getBytes();", "com.google.protobuf.ByteString getImgData(int index);", "public void setImageData(byte[] value) {\r\n this.imageData = ((byte[]) value);\r\n }", "public ImageData getImageData() {\n\t\treturn this.data.getImageData();\n\t}", "public byte[] getImageByteArray(Bitmap bitmap) {\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream);\n return byteArrayOutputStream.toByteArray();\n }", "public static byte[] getBytes(Bitmap bitmap) {\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.PNG, 0, stream);\n return stream.toByteArray();\n }", "public abstract byte[] getEncoded();", "@Override\r\n public byte[] getCustomImageInBytes() {\r\n\r\n return imageInByte;\r\n }", "private byte[] downloadBinaryData(String imageUrlText)\r\n\t\t\tthrows MalformedURLException, IOException {\r\n\t\t// retrieve the image from the webpage and put it in HashMap\r\n\t\tURL url = new URL(imageUrlText);\r\n\r\n\t\t// input from image\r\n\t\tBufferedInputStream in = new BufferedInputStream(url.openStream());\r\n\t\t// downloaded bytes\r\n\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\r\n\t\t// download buffer\r\n\t\tfinal int BUFFERSIZE = 4096;\r\n\t\tbyte[] buffer = new byte[BUFFERSIZE];\r\n\t\tint bytesToWrite;\r\n\r\n\t\twhile ((bytesToWrite = in.read(buffer)) != -1) {\r\n\t\t\tout.write(buffer, 0, bytesToWrite);\r\n\t\t}\r\n\r\n\t\tbyte[] imgArray = out.toByteArray();\r\n\r\n\t\tin.close();\r\n\t\tout.close();\r\n\t\treturn imgArray;\r\n\t}", "public byte[] getFileDataFromDrawable(Bitmap bitmap) {\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.JPEG, 80, byteArrayOutputStream);\n return byteArrayOutputStream.toByteArray();\n }", "public byte[] getByteData() { return bytedata; }", "protected byte[] stream2blob(InputStream is) throws IOException, IllegalArgumentException {\n return StreamUtils.stream2blob(is);\n }", "public byte[] getByteArray(Uri image)\n {\n Bitmap pic = null;\n try{\n pic = MediaStore.Images.Media.getBitmap(getContentResolver(),image);\n }\n catch (IOException e){\n e.printStackTrace();\n }\n\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n pic.compress(Bitmap.CompressFormat.PNG,90,byteArrayOutputStream);\n return byteArrayOutputStream.toByteArray();\n\n }", "public static BufferedImage BToBI(Blob image) throws SQLException, IOException {\n\t\tInputStream in = image.getBinaryStream(); \n\t\tBufferedImage toReturn = ImageIO.read(in);\n\t\treturn toReturn;\n\t}", "public static byte[] getBytes(Bitmap bitmap) {\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.PNG, 0, stream);\n return stream.toByteArray();\n }", "public static byte[] getBytes(Bitmap bitmap) {\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.PNG, 0, stream);\n return stream.toByteArray();\n }", "public static byte[] getBytes(Bitmap bitmap) {\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.PNG, 0, stream);\n return stream.toByteArray();\n }", "public static byte[] getBytes(Bitmap bitmap) {\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.PNG, 0, stream);\n return stream.toByteArray();\n }", "private static void writeBLOBData() {\n\t\tConnection conn = null;\n\t\tPreparedStatement stmt = null;\n\t\ttry {\n\t\t\tconn = JDBCUtils.getMySQLConnection();\n\t\t\tString sql = \"INSERT INTO testblob(name, img) values(?,?)\";\n\t\t\tstmt = conn.prepareStatement(sql);\n\t\t\tstmt.setString(1, \"ke\");\n\t\t\tFile file = new File(\"D:\" + File.separator + \"test.jpg\");\n\t\t\tInputStream in = new FileInputStream(file);\n\t\t\tstmt.setBinaryStream(2, in, (int)file.length());\n\t\t\tstmt.executeUpdate();\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\tJDBCUtils.release(stmt, conn);\n\t\t}\n\t}", "public String emitAsImageBase64() {\n BufferedImage img = emitAsBufferedImage();\n ByteArrayOutputStream os = new ByteArrayOutputStream();\n try {\n ImageIO.write(img, \"png\", os);\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n Base64 b64 = new Base64();\n String result = b64.encode(os.toByteArray());\n try {\n os.close();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return result;\n }", "public byte[] asByteArray() {\n return data;\n }", "private void uploadImage(byte[] imageData) {\n\n }", "public ByteArray getBin() {\n return bin;\n }", "public byte[] getData() {\n\treturn null;\n }", "public byte[] GetBytes() {\n return data;\n }", "public static String encodeTobase64(Bitmap image){\n if(image != null) {\n Bitmap image2 = image;\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n image2.compress(Bitmap.CompressFormat.PNG, 100, baos);\n byte[] b = baos.toByteArray();\n String imageEncoded = Base64.encodeToString(b, Base64.DEFAULT);\n\n Log.d(\"Image Log:\", imageEncoded);\n return imageEncoded;\n }\n else{\n return \"\";\n }\n }", "@Override\n protected void onBinaryData(InputStream is) throws IOException {\n }", "public int[][][] getdata(){\r\n\t\theight = BfImage.getHeight();\r\n\t\twidth = BfImage.getWidth();\r\n\t\tint[][][] data = new int[height][width][3];\r\n\t\t\r\n\t\tfor (int x = 0; x < width; x++)\t\t\t\t//store image's RGB data\r\n\t\t\tfor (int y = 0; y < height; y++) {\r\n\t\t\t\tint rgb = BfImage.getRGB(x, y);\r\n\t\t\t\tif (rgb == 0 || rgb == 3){\t//is transparent || Transparency.TRANSLUCENT\r\n\t\t\t\t\tdata[y][x][0] = -1;\r\n\t\t\t\t\tdata[y][x][1] = -1;\r\n\t\t\t\t\tdata[y][x][2] = -1;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tdata[y][x][0] = Utils.getR(rgb);\r\n\t\t\t\t\tdata[y][x][1] = Utils.getG(rgb);\r\n\t\t\t\t\tdata[y][x][2] = Utils.getB(rgb);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn data;\r\n\t}", "@Override\n protected Map<String, DataPart> getByteData()\n {\n Map<String, DataPart> params = new HashMap<>();\n long imagename = System.currentTimeMillis();\n params.put(Keys.message, new DataPart(imagename + \".png\", getFileDataFromDrawable(bitmap)));\n return params;\n }", "public byte[] getData() {\n/* 91 */ return (this.pbData == null) ? null : this.pbData.getByteArray(0L, this.cbData);\n/* */ }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n long imagename = System.currentTimeMillis();\n params.put(\"pic\", new DataPart(imagename + \".jpg\", getFileDataFromDrawable(bitmap)));\n return params;\n }", "private byte[] convertPhotoFileTOBytes(File file) throws IOException {\r\n FileInputStream fis = new FileInputStream(file);\r\n Bitmap bm = BitmapFactory.decodeStream(fis);\r\n return getBytesFromBitmap(bm);\r\n }", "public native void blobToImage(ImageInfo imageInfo, byte[] blob)\n\t\t\tthrows MagickException;", "public String convertImage(ImageView itemImage){\n Bitmap bmp = ((BitmapDrawable)itemImage.getDrawable()).getBitmap();\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bmp.compress(Bitmap.CompressFormat.PNG, 100, stream);\n byte[] byteArray = stream.toByteArray();\n String imageFile = Base64.encodeToString(byteArray, Base64.DEFAULT);\n return imageFile;\n }", "byte[] getData() {\n return data;\n }", "@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n ref.child(\"user\").child(fUser.getUid()).child(\"age\").setValue(age);\n ref.child(\"user\").child(fUser.getUid()).child(\"bio\").setValue(bio);\n //object to convert image to byte array for storage on firebase\n ByteArrayOutputStream imgConverted = new ByteArrayOutputStream();\n\n //save the image as a .jpg file\n img.compress(Bitmap.CompressFormat.JPEG, 100, imgConverted);\n\n String imageEncoded = Base64.encodeToString(imgConverted.toByteArray(), Base64.DEFAULT);\n ref.child(\"user\").child(fUser.getUid()).child(\"image\").setValue(imageEncoded);\n }", "private Bitmap convertToBitmap(byte[] b){\n\n return BitmapFactory.decodeByteArray(b, 0, b.length);\n\n }", "public byte[] getImageData() {\n return profilePictureBytes;\n }", "private static Bitmap getImage(byte[] image) {\n /**\n * @brief convert from byte array to bitmap\n */\n return BitmapFactory.decodeByteArray(image, 0, image.length);\n }", "public static Try<byte[]> imageToPng(BufferedImage image) {\n return Try.of(() -> Imaging.writeImageToBytes(image, ImageFormats.PNG, null))\n .logIfFailure(TAG, err -> \"failed to convert image to bytes\");\n }", "public static byte[] bitmapToByte(Bitmap b) {\n\n ByteArrayOutputStream o = new ByteArrayOutputStream();\n\n b.compress(Bitmap.CompressFormat.PNG, 100, o);\n\n return o.toByteArray();\n\n }", "@Override\n public IIOMetadata getImageData() {\n return super.imageData;\n }", "public IntBuffer getData(BufferedImage img)\n\t{\n\t\tIntBuffer buf = IntBuffer.allocate(img.getWidth()*img.getHeight());\n\t\t//ByteBuffer b = ByteBuffer.allocate(buf.capacity()*4);\n\n\t\tfor(int i=0; i<img.getHeight(); i++)\n\t\t{\n\t\t\tfor(int j=0; j<img.getWidth(); j++)\n\t\t\t{\n\t\t\t\t// We need to shuffle the RGB values to pass them correctly to OpenGL. \n\t\t\t\tint in = img.getRGB(j,i);\n\t\t\t\tint out = ((in & 0x000000FF) << 16) | (in & 0x0000FF00) | ((in & 0x00FF0000) >> 16);\n\t\t\t\tbuf.put((img.getHeight()-i-1)*img.getWidth()+j, out);\n\t\t\t}\n\t\t}\n\t\t//b.asIntBuffer().put(buf);\n\t\treturn buf;\n\t}", "byte[] getResult();", "private void convertBitmapToFile(Bitmap response, CustomRepoListener<File> listener) {\n //create a file to write bitmap data\n\n File f = new File(getFilename());\n try {\n f.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n//Convert bitmap to byte array\n Bitmap bitmap = response;\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.PNG, 0 /*ignored for PNG*/, bos);\n byte[] bitmapdata = bos.toByteArray();\n\n//write the bytes in file\n FileOutputStream fos = null;\n try {\n fos = new FileOutputStream(f);\n fos.write(bitmapdata);\n fos.flush();\n fos.close();\n listener.onSuccess(f);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public byte[] getImage() {\n return image;\n }", "public byte[] getImage() {\n return image;\n }", "public byte[] getImage() {\n return image;\n }", "private byte[] getImage(){\n byte image[] = null;\n try {\n if(isImageGiven()) {\n image = getImageBytes();\n }\n }catch (IOException e){\n Toast.makeText(this,\"Error in Creating the image \"+e, Toast.LENGTH_SHORT).show();\n }\n return image;\n }", "com.google.protobuf.ByteString\n getImageBytes();", "private boolean setImageData(DataBuffer db) {\r\n AwtImageBackdoorAccessor dbAccess = AwtImageBackdoorAccessor.getInstance();\r\n try {\r\n imageData = dbAccess.getData(db);\r\n } catch (IllegalArgumentException e) {\r\n return false; // Unknown data buffer type\r\n }\r\n\r\n return true;\r\n }", "public byte[] marshall();", "public byte[] toBinary(JSONObject message) {\n\t\tString messageToConvert = message.toString();\n\t\tbyte[] converted = null;\n\t\ttry {\n\t\t\tconverted = messageToConvert.getBytes(\"UTF-8\");\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn converted;\n\t}", "byte[] jsonConverter(Object doctorData) throws JsonProcessingException {\n\t\tObjectMapper objMap = new ObjectMapper();\n\t\treturn objMap.writeValueAsBytes(doctorData);\n\t}", "String convertImageToBase64String(final BufferedImage img) {\n final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n try {\n ImageIO.write(img, \"png\", byteArrayOutputStream);\n return Base64.getEncoder().encodeToString(byteArrayOutputStream.toByteArray());\n } catch (IOException e) {\n logger.error(\"cannot convert image to base 64\", e);\n }\n return null;\n }", "static Image bityNaObraz(String image) throws IOException\n {\n byte[] rysunek = DatatypeConverter.parseBase64Binary(image); \n BufferedImage img = ImageIO.read(new ByteArrayInputStream(rysunek));\n return img;\n }", "private static final byte[] xfsim_image() {\n\t\tbyte data[] = { 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -62, 0, 0, -128,\n\t\t\t\t-128, -128, -64, -64, -64, 0, 0, 0, -1, -1, -1, 0, 0, -1, -1,\n\t\t\t\t-1, -1, -1, -1, -1, -1, -1, -1, 33, -2, 14, 77, 97, 100, 101,\n\t\t\t\t32, 119, 105, 116, 104, 32, 71, 73, 77, 80, 0, 33, -7, 4, 1,\n\t\t\t\t10, 0, 5, 0, 44, 0, 0, 0, 0, 16, 0, 16, 0, 0, 3, 72, 88, -70,\n\t\t\t\t-36, 14, 48, -58, 23, -86, -83, 64, 48, 48, -70, -17, -112,\n\t\t\t\t-74, 112, 66, 105, 14, -31, 54, 8, 68, -37, -94, -103, -54,\n\t\t\t\t-70, 4, 44, 42, 36, 93, -89, -29, -9, 101, -112, -111, 105, 88,\n\t\t\t\t2, 4, 68, 28, -97, -57, 24, 43, -124, -128, 2, 104, -54, 40,\n\t\t\t\t56, 90, -85, 88, 77, 82, -23, 57, 42, -120, -32, -110, 99, -20,\n\t\t\t\t72, 0, 0, 59 };\n\t\treturn data;\n\t}", "static void processPicture(byte[][] img) {\n\t\tcontrastImage(img);\n\t\t//generateDebugImage(img);\n\t\t\n\t\t\n\t\tPoint[] ergs = raster(img);\n\t\tprintPoints(ergs);\n\t\tergs = Cluster.cluster(ergs);\n\t\tprintPoints(ergs);\n\t\tBlume[] blumen = Radiuserkennung.erkennen(img, ergs);\n\t\t\n\t\t//Blumen veröffentlichen!\n\t\tDaten.setNewBlumen(blumen);\n\t\t\n\t\tprintBlumen(blumen);\n\t}", "public byte[] getDataByte() {\n\t\t\n\t\tif (!isDoubleType)\n\t\t{\n\t\t\treturn ipixel_o;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t}", "private static void writeBinaryData(int id, InputStream data, File f) throws IOException {\n \n XMLOutputFactory factory = XMLOutputFactory.newInstance();\n try {\n XMLStreamWriter writer = factory.createXMLStreamWriter(new FileWriter(f));\n\n writer.writeStartDocument(PlanXMLConstants.ENCODING,\"1.0\");\n writer.writeStartElement(\"data\");\n writer.writeAttribute(\"id\", \"\" + id);\n\n Base64InputStream base64EncodingIn = new Base64InputStream( data, true, PlanXMLConstants.BASE64_LINE_LENGTH, PlanXMLConstants.BASE64_LINE_BREAK);\n \n OutputStream out = new WriterOutputStream(new XMLStreamContentWriter(writer) , PlanXMLConstants.ENCODING);\n // read the binary data and encode it on the fly\n IOUtils.copy(base64EncodingIn, out);\n out.flush();\n \n // all data is written - end \n writer.writeEndElement();\n writer.writeEndDocument();\n\n writer.flush();\n writer.close();\n\n } catch (XMLStreamException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } \n }", "private byte[] decode(Node root) {\n BitSet dataInBits = BitSet.valueOf(Arrays.copyOfRange(buffer.array(), bufferPosition, buffer.capacity()));\n int bitIndex = 0;\n\n ByteBuffer result = ByteBuffer.allocate(inputFileSize);\n\n for (int i = 0; i < inputFileSize; i++) {\n Node node = root;\n while (!node.hasValue() && i < inputFileSize) {\n boolean bit = dataInBits.get(bitIndex);\n bitIndex += 1;\n if (bit) node = node.getRightChild();\n else node = node.getLeftChild();\n }\n if (node.hasValue()) {\n result.put(node.getValue());\n }\n }\n\n // preparing byte buffer for converting to byte array\n int pos = result.position();\n result.flip();\n byte[] resultArray = new byte[pos];\n result.get(resultArray);\n return resultArray;\n }", "com.google.protobuf.ByteString\n getDataBytes();", "public byte[] getData() {\n return ByteExtensions.clone(this.data);\n }", "public int[] convertByteToInt(BufferedImage img) throws IOException {\r\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n ImageIO.write(img, \"png\", baos);\r\n byte[] byteArr = baos.toByteArray();\r\n int[] intArr = new int[byteArr.length];\r\n for(int i = 0; i < byteArr.length; i++) {\r\n intArr[i] = (int)byteArr[i] & 0xFF;\r\n }\r\n return intArr;\r\n }" ]
[ "0.68547195", "0.6737765", "0.6722451", "0.6596411", "0.6534461", "0.6529222", "0.6407696", "0.636699", "0.6366107", "0.6338203", "0.6338203", "0.6338203", "0.6338203", "0.631516", "0.6297488", "0.6248478", "0.6223186", "0.6205343", "0.6159953", "0.6108813", "0.5980674", "0.5980674", "0.59624827", "0.59542656", "0.5873107", "0.5866546", "0.5861636", "0.5855698", "0.5850669", "0.5826087", "0.58228856", "0.5795482", "0.5792161", "0.57243085", "0.5722271", "0.57143736", "0.57025576", "0.57025576", "0.5680331", "0.5657976", "0.5654513", "0.56517655", "0.5641068", "0.5612218", "0.5586444", "0.5586424", "0.5575709", "0.5572898", "0.5565902", "0.55650496", "0.5555976", "0.5526368", "0.5526368", "0.5526368", "0.5526368", "0.55206275", "0.55108047", "0.5502756", "0.54870677", "0.54765266", "0.5466327", "0.54662997", "0.5465374", "0.54650724", "0.5464824", "0.5449507", "0.5448143", "0.544808", "0.543531", "0.5427224", "0.542624", "0.54256505", "0.5425208", "0.54191244", "0.54145944", "0.54100597", "0.5405014", "0.5386334", "0.5374858", "0.536551", "0.53615314", "0.53531796", "0.5350081", "0.5350081", "0.5350081", "0.5349127", "0.5346728", "0.53437394", "0.534276", "0.53115696", "0.5309827", "0.53032315", "0.5292218", "0.528085", "0.5278604", "0.5272661", "0.52671045", "0.5265521", "0.5259428", "0.5256881", "0.5250944" ]
0.0
-1
It opens the text file and converts the data into cipher text
public void opentextfile(String path1) { FileInputStream fin,fin1; int i,j=0; String s=JOptionPane.showInputDialog(this,"Enter key with 16 letters"); char ch[]=new char[s.length()]; ch=s.toCharArray(); try { FileOutputStream f=new FileOutputStream("key1.txt"); for(i=0;i<ch.length;i++) f.write(ch[i]); f.close(); ideaalgo a=new ideaalgo(path1); a.procedure(); a.encrypt(); BufferedReader d; StringBuffer sb=new StringBuffer(); d=new BufferedReader(new FileReader(path1)); String line; while((line=d.readLine())!=null) sb.append(line+"\n"); ta.setText(sb.toString()); d.close(); fin=new FileInputStream("enc.txt"); do { i=fin.read(); if(i!=-1) { bytes[j++]=i; } } while(i!=-1); max=j; fin.close(); binarycon(); } catch(Exception e) { System.out.println(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void readDataFromFile(View view) throws GeneralSecurityException, IOException {\n encryptedFile = new EncryptedFile.Builder(\n context,\n new File(MainActivity.this.getFilesDir(),\"test.txt\"), // File want to read\n mainKey, // Master key for encryption\n EncryptedFile.FileEncryptionScheme.AES256_GCM_HKDF_4KB) // Algorithm or FileEncryptionScheme for encryption\n .build();\n\n\n InputStream inputStream = encryptedFile.openFileInput(); // Open the encrypted file to read\n int next = inputStream.read(); // Read the encrypted file\n\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); // ByteArrayOutputStream to print the content of file to read\n\n while (next != -1){\n byteArrayOutputStream.write(next); // Write the file content in byteArrayOutputStream object\n next = inputStream.read(); // Read the next character until it encounter the end (-1)\n }\n\n byte[] plainText = byteArrayOutputStream.toByteArray(); // Convert into byte array\n\n String textString = new String(plainText); // Create a new string with converted plain text byte array\n\n textView.setText(textString); // display the file content in textView\n }", "public void decryptFile(File cipherInputFile, File textOutputFile) throws FileNotFoundException{\n Scanner in = new Scanner(cipherInputFile);\n PrintStream out = new PrintStream(textOutputFile);\n\n while (in.hasNextLine()) {\n String line = in.nextLine();\n out.print(decrypt(line));\n }\n }", "public void encryptFile(File textInputFile, File cipherOutputFile) throws FileNotFoundException{\n Scanner in = new Scanner(textInputFile);\n PrintStream out = new PrintStream(cipherOutputFile);\n\n while (in.hasNextLine()) {\n String line = in.nextLine() + NEW_LINE;\n out.print(encrypt(line));\n }\n }", "private void encryptionAlgorithm() {\n\t\ttry {\n\t\t\t\n\t\t\tFileInputStream fileInputStream2=new FileInputStream(\"D:\\\\program\\\\key.txt\");\n\t\t\tchar key=(char)fileInputStream2.read();\n\t\t\tSystem.out.println(key);\n\t\t\tFileInputStream fileInputStream1=new FileInputStream(\"D:\\\\program\\\\message.txt\");\n\t\t\tint i=0;\n\t\t\t\n\t\t\tStringBuilder message=new StringBuilder();\n\t\t\twhile((i= fileInputStream1.read())!= -1 )\n\t\t\t{\n\t\t\t\tmessage.append((char)i);\n\t\t\t}\n\t\t\tString s=message.toString();\n\t\t\tchar[] letters=new char[s.length()];\n\t\t\tStringBuilder en=new StringBuilder();\n\t\t\tfor(int j = 0;j < letters.length;j++)\n\t\t\t{\n\t\t\t\ten.append((char)(byte)letters[j]+key);\n\t\t\t}\t\t\n\t\t\tFileOutputStream fileoutput=new FileOutputStream(\"D:\\\\program\\\\encryptedfile.txt\");\n\t\t\t\n\t\t\tfileInputStream1.close();\n\t\t\tfileInputStream2.close();\n\t\t\t\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t\n\t}", "private static void crypto(String filePath1, String filePath2) {\n\n\t\t// Retrieve the cipher\n\t\tCipher cipher;\n\t\ttry {\n\t\t\tcipher = obtainCipher();\n\n\t\t} catch (InvalidKeyException | InvalidAlgorithmParameterException | NoSuchAlgorithmException\n\t\t\t\t| NoSuchPaddingException e) {\n\t\t\tSystem.out.println(\"Exception while obtaining cypher: \" + e.getMessage());\n\t\t\treturn;\n\t\t}\n\n\t\tPath p = Paths.get(filePath1);\n\t\tPath p2 = Paths.get(filePath2);\n\n\t\t// Open the file input and output stream\n\t\ttry (InputStream is = Files.newInputStream(p); OutputStream os = Files.newOutputStream(p2)) {\n\t\t\tbyte[] buff = new byte[4096];\n\n\t\t\twhile (true) {\n\t\t\t\tint r = is.read(buff);\n\n\t\t\t\tif (r == -1) {\n\t\t\t\t\t// Finishing the cipher\n\t\t\t\t\ttry {\n\t\t\t\t\t\tos.write(cipher.doFinal());\n\t\t\t\t\t} catch (IllegalBlockSizeException | BadPaddingException e) {\n\t\t\t\t\t\tSystem.out.println(\"Exception while finalizaing cipher: \" + e.getMessage());\n\t\t\t\t\t\tSystem.exit(1);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Update cipher and write into new file\n\t\t\t\tos.write(cipher.update(buff, 0, r));\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Exception while opening the file: \" + e.getMessage());\n\t\t\tSystem.exit(1);\n\n\t\t}\n\n\t\tSystem.out.println((encrypt ? \"Encryption\" : \"Decryption\") + \" completed. Generated file \" + filePath2\n\t\t\t\t+ \" based on file \" + filePath1 + \".\");\n\n\t}", "static void experiment2Day1Part1() {\n\n File file = new File(\"src/main/java/weekone/input01.txt\");\n FileInputStream fis = null;\n\n try {\n fis = new FileInputStream(file);\n\n System.out.println(\"Total file size to read (in bytes) : \"\n + fis.available());\n\n int content;\n while ((content = fis.read()) != -1) {\n // convert to char and display it\n char converted = (char) content;\n System.out.print(converted);\n\n\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (fis != null)\n fis.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n\n\n }", "public void decrypt() {\n try {\n // Create input and output streams\n System.out.println(\"Loading files\");\n FileInputStream in = new FileInputStream(this.input);\n FileOutputStream out = new FileOutputStream(this.output);\n\n // Skip IV values\n in.getChannel().position(cipher.getBlockSize());\n\n /*\n Using CipherInputStream object to read from encrypted file\n cipherIn reads data from input stream and and returns the decrypted value\n */\n System.out.println(\"Creating cipher stream\");\n CipherInputStream cipherIn = new CipherInputStream(in, this.cipher);\n\n System.out.println(\"Starting file decryption\");\n byte[] buffer = new byte[Common.BLOCK_SIZE];\n int len;\n // Reading from the input stream\n while ((len = cipherIn.read(buffer)) != -1)\n // Write the decrypted message to output stream\n out.write(buffer, 0, len);\n\n // Close all streams\n System.out.println(\"Closing file streams\");\n cipherIn.close();\n out.flush();\n out.close();\n\n System.out.println(\"Decryption complete\");\n } catch (Exception e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\ttxtContent.setText(\"\");\n\t\t\t\tif (filename == null) {\n\t\t\t\t\tJOptionPane.showMessageDialog(frame, \"You haven't selected any files yet!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if (cbOption.getSelectedItem().toString() == \"Encrypt\") {\n\t\t\t\t\tswitch (cbAlgorithm.getSelectedItem().toString()) {\n\t\t\t\t\tcase \"AES\":\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tAES.encrypt(keyStr, filename, new File(\"document.encrypted\"));\n\t\t\t\t\t\t\tBufferedReader br = new BufferedReader(new FileReader(\"document.encrypted\"));\n\t\t\t\t\t\t\tString line;\n\t\t\t\t\t\t\twhile((line = br.readLine()) != null) {\n\t\t\t\t\t\t \ttxtContent.append(line + \"\\n\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbr.close();\n\t\t\t\t\t\t} catch (CryptoException | IOException e1) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(frame, \"Wrong key size. Your key must contain exactly \" + String.valueOf(keyLength/4) +\n\t\t\t\t\t\t\t\t\t\" characters including WS!\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"DES\":\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tDES.encrypt(keyStr, filename, new File(\"document.encrypted\"));\n\t\t\t\t\t\t\tBufferedReader br = new BufferedReader(new FileReader(\"document.encrypted\"));\n\t\t\t\t\t\t\tString line;\n\t\t\t\t\t\t\twhile((line = br.readLine()) != null) {\n\t\t\t\t\t\t \ttxtContent.append(line + \"\\n\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbr.close();\n\t\t\t\t\t\t} catch (InvalidKeySpecException | CryptoException | IOException e1) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(frame, \"Wrong key size. Your key must contain exactly 16 characters including WS!\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tkeyPath = cbSelectKey.getSelectedItem().toString();\n\t\t\t\t\t\t\tkeyStr = Base64.getEncoder().encodeToString(RSA.loadPublicKey(URL_DIR + keyPath).getEncoded());\n\t\t\t\t\t\t\tRSA.encrypt(keyStr, filename, new File(\"document.encrypted\"));\n\t\t\t\t\t\t\tBufferedReader br = new BufferedReader(new FileReader(\"document.encrypted\"));\n\t\t\t\t\t\t\tString line;\n\t\t\t\t\t\t\twhile((line = br.readLine()) != null) {\n\t\t\t\t\t\t\t\ttxtContent.append(line + \"\\n\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbr.close();\n\t\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tswitch (cbAlgorithm.getSelectedItem().toString()) {\n\t\t\t\t\tcase \"AES\":\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tAES.decrypt(keyStr, filename, new File(\"document.decrypted\"));\n\t\t\t\t\t\t\tBufferedReader br = new BufferedReader(new FileReader(\"document.decrypted\"));\n\t\t\t\t\t\t\tString line;\n\t\t\t\t\t\t\twhile((line = br.readLine()) != null) {\n\t\t\t\t\t\t\t\ttxtContent.append(line + \"\\n\");\n\t\t\t\t\t\t \thMACLine = line;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbr.close();\n\t\t\t\t\t\t\ttxtFileMac.setText(hMACLine.substring(hMACLine.length() - 64));\n\t\t\t\t\t\t\ttxtCalculatedMac.setText(HMAC.hmacDigestDecrypt(new File(\"document.decrypted\"), keyStr));\n\t\t\t\t\t\t\tlblPercent.setVisible(true);\n\t\t\t\t\t\t\tlblPercent.setText(Integer.toString(ByteDifference(txtFileMac.getText().toCharArray(), txtCalculatedMac.getText().toCharArray())) + \"%\");\n\t\t\t\t\t\t\trewritingHashedFile(new File(\"document.decrypted\"));\n\t\t\t\t\t\t} catch (CryptoException | IOException e1) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(frame, \"Wrong key size. Your key must contain exactly \" + String.valueOf(keyLength/4) +\n\t\t\t\t\t\t\t\t\t\" characters including WS!\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"DES\":\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tDES.decrypt(keyStr, filename, new File(\"document.decrypted\"));\n\t\t\t\t\t\t\tBufferedReader br = new BufferedReader(new FileReader(\"document.decrypted\"));\n\t\t\t\t\t\t\tString line;\n\t\t\t\t\t\t\twhile((line = br.readLine()) != null) {\n\t\t\t\t\t\t\t\ttxtContent.append(line + \"\\n\");\n\t\t\t\t\t\t \thMACLine = line;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbr.close();\n\t\t\t\t\t\t\ttxtFileMac.setText(hMACLine.substring(hMACLine.length() - 64));\n\t\t\t\t\t\t\ttxtCalculatedMac.setText(HMAC.hmacDigestDecrypt(new File(\"document.decrypted\"), keyStr));\n\t\t\t\t\t\t\tlblPercent.setVisible(true);\n\t\t\t\t\t\t\tlblPercent.setText(Integer.toString(ByteDifference(txtFileMac.getText().toCharArray(), txtCalculatedMac.getText().toCharArray())) + \"%\");\n\t\t\t\t\t\t\trewritingHashedFile(new File(\"document.decrypted\"));\n\t\t\t\t\t\t} catch (InvalidKeySpecException | CryptoException | IOException e1) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(frame, \"Wrong key size. Your key must contain exactly 16 characters including WS!\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tkeyPath = cbSelectKey.getSelectedItem().toString();\n\t\t\t\t\t\t\tkeyStr = Base64.getEncoder().encodeToString(RSA.loadPrivateKey(URL_DIR + keyPath).getEncoded());\n\t\t\t\t\t\t\tpubKeyStr = Base64.getEncoder().encodeToString(RSA.loadPublicKey(URL_DIR + keyPath.replace(\"PrivateKey\", \"PublicKey\")).getEncoded());\n\t\t\t\t\t\t\tRSA.decrypt(keyStr, filename, new File(\"document.decrypted\"));\n\t\t\t\t\t\t\tBufferedReader br = new BufferedReader(new FileReader(\"document.decrypted\"));\n\t\t\t\t\t\t\tString line;\n\t\t\t\t\t\t\twhile((line = br.readLine()) != null) {\n\t\t\t\t\t\t \ttxtContent.append(line);\n\t\t\t\t\t\t \ttxtContent.append(\"\\n\");\n\t\t\t\t\t\t \thMACLine = line;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbr.close();\n\t\t\t\t\t\t\ttxtFileMac.setText(hMACLine.substring(hMACLine.length() - 64));\n\t\t\t\t\t\t\ttxtCalculatedMac.setText(HMAC.hmacDigestDecrypt(new File(\"document.decrypted\"), pubKeyStr));\n\t\t\t\t\t\t\tlblPercent.setVisible(true);\n\t\t\t\t\t\t\tlblPercent.setText(Integer.toString(ByteDifference(txtFileMac.getText().toCharArray(), txtCalculatedMac.getText().toCharArray())) + \"%\");\n\t\t\t\t\t\t\trewritingHashedFile(new File(\"document.decrypted\"));\n\t\t\t\t\t\t} catch (InvalidKeySpecException | CryptoException | IOException e1) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public String textExtractor(File file) {\n StringBuilder textBuilder = new StringBuilder();\n\n try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file), \"UTF-8\"))) {\n while (bufferedReader.ready()) {\n textBuilder.append(bufferedReader.readLine()).append(\"\\n\");\n }\n } catch (IOException exc) {\n exc.printStackTrace();\n }\n\n return textBuilder.toString();\n }", "public void readText(String filename) throws IOException{\n\t\t\n\t\tif(sentences == null){\n\t\t\tsentences = new ArrayList<Sentence>();\n\t\t}\n\t\t\n\t\t//read from file\n\t\tFileInputStream inputStream = new FileInputStream(filename);\n\t\tDataInputStream stream = new DataInputStream(inputStream);\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(stream));\n\t\tString line;\n\t\twhile((line = reader.readLine()) != null){\n\t\t\tsentences.add(new Sentence(line));\n\t\t}\n\t\treader.close();\n\t\tstream.close();\n\t\tinputStream.close();\n\t\t\n\t\t\n\t}", "public void GetData(String nameFile) throws IOException {\n File file = new File(nameFile);\n BufferedReader finalLoad = new BufferedReader(new FileReader(file));\n int symbol = finalLoad.read();\n int indexText = 0;\n while (symbol != -1) {\n text[indexText++] = (char) symbol;\n if (indexText >= Constants.MAX_TEXT - 1) {\n PrintError(\"to mach size of file\".toCharArray(), \"\".toCharArray());\n break;\n }\n symbol = finalLoad.read();\n }\n text[indexText++] = '\\n';\n text[indexText] = '\\0';\n finalLoad.close();\n //System.exit(1);\n }", "private void encryptingData(File fileToEncrrypt, Signature dataSigner) throws Exception {\n\t\tFileOutputStream fos = null;\n\t\tFileInputStream fis = null;\n\t\tCipherInputStream cis = null;\n\t\ttry {\n\t\t\tfos = new FileOutputStream(localWorkingDirectoryPath + \"\\\\Encrypted_File.txt\");\n\t\t\tfis = new FileInputStream(fileToEncrrypt);\n\t\t\tbyte[] encryptedDataByteArray = new byte[8];\n\t\t\tcis = new CipherInputStream(fis, myCipher);\n\t\t\tint i = cis.read(encryptedDataByteArray);\n\t\t\twhile (i != -1) {\n\t\t\t\t// Updating the data inside the Signer\n\t\t\t\tdataSigner.update(encryptedDataByteArray);\n\t\t\t\t// writing the encrypted data to the file\n\t\t\t\tfos.write(encryptedDataByteArray, 0, i);\n\t\t\t\ti = cis.read(encryptedDataByteArray);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\twriteToLog(\"Error While trying to encrypt the data: \" + e.getMessage());\n\t\t\tLogWriter.close();\n\t\t\tthrow new Exception(\"Error: While trying to encrypt the data\", e);\n\t\t} finally {\n\t\t\tcis.close();\n\t\t\tfis.close();\n\t\t\tfos.close();\n\t\t}\n\t}", "void decryptFile(String path) throws IOException {\n try (BufferedReader reader = new BufferedReader(new FileReader(path))) {\n PrintWriter writer = new PrintWriter(System.out);\n decryptFile(reader, writer);\n } catch (FileNotFoundException e) {\n System.out.println(\"Error: Input file not found\");\n }\n }", "public String originalText(String cipher_text, String key)\n{\n String orig_text=\"\";\n \n for (int i = 0 ; i < cipher_text.length() && \n i < key.length(); i++)\n {\n if(cipher_text.charAt(i) == ' ' || cipher_text.charAt(i) == '\\n')\n orig_text+=cipher_text.charAt(i);\n else{\n // converting in range 0-25\n int x = (cipher_text.charAt(i) - \n key.charAt(i) + 26) %26; \n // convert into alphabets(ASCII)\n x += 'A';\n orig_text+=(char)(x);\n }\n }\n return orig_text;\n}", "public void encryptFile(String fitxer, SecretKey clau) throws FileNotFoundException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IOException, IllegalBlockSizeException, BadPaddingException {\r\n //Creamos el FileInput Stream para leer el archivo.\r\n FileInputStream fis = new FileInputStream(fitxer);\r\n //Creamos el FileOutputStream para escribir en el fichero.\r\n FileOutputStream fos = new FileOutputStream(new File(\"mensajeCifrado.txt\"));\r\n \r\n //Creamos un cifrador para cifrar el texto.\r\n Cipher cifrador = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\r\n IvParameterSpec iv = new IvParameterSpec(cadena_iv.getBytes());\r\n cifrador.init(Cipher.ENCRYPT_MODE, clau);\r\n \r\n //Creamos un buffer que es un array de bytes donde almacenaremos el texto.\r\n byte[] buffer = new byte[1024];\r\n \r\n int bytes;\r\n //Utilizamos un bucle para ir leyendo el archivo de texto que le hemos pasado.\r\n while((bytes = fis.read(buffer, 0, buffer.length))!=-1){\r\n byte [] update = cifrador.update(buffer, 0, bytes);\r\n fos.write(cifrador.doFinal());\r\n }\r\n \r\n //Cerramos recursos.\r\n fos.write(cifrador.doFinal());\r\n fis.close();\r\n fos.close();\r\n \r\n \r\n }", "OutputFile encryptingOutputFile();", "public String readTextFromFile()\n\t{\n\t\tString fileText = \"\";\n\t\tString filePath = \"/Users/zcon5199/Documents/\";\n\t\tString fileName = filePath + \"saved text.txt\";\n\t\tFile inputFile = new File(fileName);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tScanner fileScanner = new Scanner(inputFile);\n\t\t\twhile(fileScanner.hasNext())\n\t\t\t{\n\t\t\t\tfileText += fileScanner.nextLine() + \"\\n\";\n\t\t\t}\n\t\t\t\n\t\t\tfileScanner.close();\n\t\t\t\n\t\t}\n\t\tcatch(FileNotFoundException fileException)\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(baseFrame, \"the file is not here :/\");\n\t\t}\n\t\t\n\t\treturn fileText;\n\t}", "public static void experiment1(String plain, String file) {\n\t\tList<String> lines = FileUtil.loadFrom(file);\n\t\t\n\t\tString cipher = Ciphers.cipher[1].cipher;\n\t\tint pos = Ciphers.cipher[1].solution.indexOf(plain.toLowerCase());\n\t\tString sub = cipher.substring(pos, pos+plain.length()); \n\t\t\n\t\tMap<Character, Character> decoder = new HashMap<Character, Character>();\n\t\tfor (String line : lines) {\n\t\t\tfor (int i=0; i<line.length(); i++) {\n\t\t\t\tchar chcipher = sub.charAt(i);\n\t\t\t\tchar chplain = line.charAt(i);\n\t\t\t\tdecoder.put(chcipher, chplain);\n\t\t\t}\n\t\t\t\n\t\t\tStringBuffer decoded = new StringBuffer();\n\t\t\tfor (int i=0; i<cipher.length(); i++) {\n\t\t\t\tchar key = cipher.charAt(i);\n\t\t\t\tCharacter val = decoder.get(key);\n\t\t\t\tif (val == null || (i >= pos && i <= pos+plain.length()-1)) decoded.append(\" \");\n\t\t\t\telse decoded.append(val);\n\t\t\t}\n\t\t\tSystem.out.println(line + \", \" + decoded + \", \" + NGrams.zkscore(decoded));\n\t\t\t\n\t\t}\n\t\t\n\t\t//System.out.println(sub);\n\t}", "void encryptFile(String path) throws IOException {\n try (BufferedReader reader = new BufferedReader(new FileReader(path))) {\n PrintWriter writer = new PrintWriter(System.out);\n encryptFile(reader, writer);\n } catch (FileNotFoundException e) {\n System.out.println(\"Error: Input file not found\");\n }\n }", "public VCipher(String keyword, String fileName, boolean actionB)\n\t{\n\t\talphabet = new char [SIZE];\n\t\tfor (int i = 0; i < SIZE; i++) \n\t\t{\n\t\t\talphabet[i] = (char)('A' + i);\n\t\t}\n\t\tStringBuilder keybuilder = new StringBuilder(keyword);\t\t\n\t\tint k = (int)keybuilder.length();\n\t\tcipher = new char [k][SIZE];\n\t\tfor (int i=0;i<k;i++)\n\t\t{\n\t\t\tint j=0;\n\t\t\tcipher[i][j] = keybuilder.charAt(i);\n\t\t\tint position = Character.getNumericValue(keybuilder.charAt(i))-9;\n\t\t\tint t =SIZE - position;\n\t\t\tfor (j=1;j<=t;j++)\n\t\t\t{\n\t\t\t\tcipher[i][j] = alphabet[position];\n\t\t\t\tposition ++;\n\t\t\t}\n\t\t\tposition=0;\n\t\t\tfor(j=t+1;j<SIZE;j++)\n\t\t\t{\n\t\t\t\tcipher[i][j] = alphabet[position];\n\t\t\t\tposition ++;\n\t\t\t}\n\t\t}\n\t\tString inFile = fileName+\".txt\";\n\t\tString outFile = this.fileProcessVigenere(fileName, actionB);\n\t\ttry{\t\n\t\t\tFileReader reader = new FileReader(inFile);\n\t\t\tFileWriter writer = new FileWriter(outFile);\n\t\t\tScanner in = new Scanner(reader);\n\t\t\twhile (in.hasNextLine()) {\n\t\t\t\tStringBuilder line = new StringBuilder(in.nextLine());\n\t\t\t\t//System.err.println(\"\\n\"+line+\"\\nCIBE JMGRI XNQJICBVKW\");\n\t\t\t\tint b=0;\n\t\t\t\tchar chr;\n\t\t\t\tint p=0;\n\t\t\t\twhile (b < line.length()) {\n\t\t\t\t\tif (p==k)\n\t\t\t\t\t{\n\t\t\t\t\t\tp=0;\n\t\t\t\t\t}\n\t\t\t\t\tif ((chr = line.charAt(b)) >= 'A' && (chr = line.charAt(b)) <= 'Z') \n\t\t\t\t\t{\n\t\t\t\t\t\tif (actionB==false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchar temp = this.encode(chr,p);\n\t\t\t\t\t\t\twriter.write(temp);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\twriter.write(this.decode(chr,p));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tp +=1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\twriter.write(line.charAt(b));\n\t\t\t\t\t}\n\t\t\t\t\tb +=1;\n\t\t\t\t}\n\t\t\t\twriter.write(\"\\r\\n\");\n\t\t\t}\n\t\t\t\treader.close();\n\t\t\t\twriter.close();\n\t\t\t\tnew LetterFrequencies(outFile);\n\t\t\t}\n\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\tSystem.err.println(\"File not Found\");\n\t\t\t}\n\t}", "private static void crypting(boolean encrypt, String filename, String cryptedFilename) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tSystem.out.println(\"Please provide password as hex-encoded text (16 bytes, i.e. 32 hex-digits): \");\n\t\tSystem.out.print(\">\");\n\t\tString keyText = sc.nextLine();\n\n\t\tSystem.out.println(\"Please provide initialization vector as hex-encoded text (32 hex-digits): \");\n\t\tSystem.out.print(\">\");\n\t\tString ivText = sc.nextLine();\n\t\tsc.close();\n\n\t\tSecretKeySpec keySpec = new SecretKeySpec(Util.hextobyte(keyText), \"AES\");\n\t\tAlgorithmParameterSpec paramSpec = new IvParameterSpec(Util.hextobyte(ivText));\n\t\tCipher cipher = null;\n\n\t\ttry {\n\t\t\tcipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n\t\t\tcipher.init(encrypt ? Cipher.ENCRYPT_MODE : Cipher.DECRYPT_MODE, keySpec, paramSpec);\n\n\t\t} catch (NoSuchAlgorithmException | NoSuchPaddingException exc) {\n\t\t\tSystem.out.println(\"Transformation is in invalid format or contains padding scheme that is unavailable. \");\n\t\t\tSystem.exit(1);\n\t\t} catch (InvalidKeyException | InvalidAlgorithmParameterException exc) {\n\t\t\tSystem.out.println(\"Given key or algorithm is invalid for this cipher.\");\n\t\t\tSystem.exit(1);\n\n\t\t}\n\n\t\ttry (InputStream inputStream = new BufferedInputStream(new FileInputStream(filename));\n\t\t\t\tOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(cryptedFilename))) {\n\n\t\t\tint nRead;\n\t\t\tbyte[] buffer = new byte[4096];\n\t\t\tbyte[] inputfile = null;\n\n\t\t\twhile ((nRead = inputStream.read(buffer, 0, buffer.length)) != -1) {\n\t\t\t\tinputfile = cipher.update(buffer, 0, nRead);\n\t\t\t\toutputStream.write(inputfile);\n\t\t\t}\n\n\t\t\tinputfile = cipher.doFinal();\n\t\t\toutputStream.write(inputfile);\n\n\t\t} catch (FileNotFoundException exc) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"File does not exist, is a directory rather than a regular file, or cannot be opened for reading because of some other reason. \");\n\t\t\tSystem.exit(1);\n\n\t\t} catch (IOException exc) {\n\t\t\tSystem.out.println(\"Input stream couldn't be initialized.\");\n\t\t\tSystem.exit(1);\n\n\t\t} catch (IllegalBlockSizeException | BadPaddingException e) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"Encryption algorithm is unable to process the input data provided or the decrypted data is not bounded by the appropriate padding bytes. \");\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\tif (encrypt) {\n\t\t\tSystem.out.printf(\"Encryption completed. Generated file %s based on file %s.\\n\", cryptedFilename, filename);\n\t\t} else {\n\t\t\tSystem.out.printf(\"Decryption completed. Generated file %s based on file %s.\\n\", cryptedFilename, filename);\n\t\t}\n\n\t}", "public static void main(String[] args) throws IOException {\n char[][] key = new char[8][8];\n\n String[] lines = new String[8];\n\n File fileCardan = new File(\"cardan.txt\");\n\n Scanner fileScanner = new Scanner(fileCardan);\n\n for (int i = 0; i < 8; i++) {\n lines[i] = fileScanner.nextLine();\n }\n\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n key[i][j] = lines[i].charAt(j);\n }\n\n }\n\n // reading text from input.txt file and getting count of 64 char blocks\n String text = new String(Files.readAllBytes(Paths.get(\"input.txt\")));\n\n int blocksCount = text.length() / 64 + 1;\n\n FileWriter fw = new FileWriter(\"encode.txt\");\n\n // encoding all 64 char blocks\n for (int i = 0; i < blocksCount; i++) {\n\n char[][] res;\n if(64+i*64 > text.length())\n res = encode(key, text.substring(i*64));\n else\n res = encode(key, text.substring(i*64,64+i*64));\n fileWrite(res,fw);\n\n }\n\n fw.close();\n\n text = new String(Files.readAllBytes(Paths.get(\"encode.txt\")));\n\n fw = new FileWriter(\"decode.txt\");\n\n for (int i = 0; i < blocksCount; i++) {\n\n fw.write(decode(text.substring(i*64,i*64+64),key));\n\n }\n\n fw.close();\n\n\n\n }", "private static String readTextFile(File file) throws IOException {\n return Files.lines(file.toPath()).collect(Collectors.joining(\"\\n\"));\n }", "public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\r\n System.out.println(\"Enter The Cipher Text Here\");\r\n String cipherText= input.nextLine();\r\n //remove all spaces from input string\r\n String CTremovingSpaces = cipherText.replaceAll(\"\\\\s\", \"\");\r\n //convert the input string into UpperCase letters\r\n CTremovingSpaces = CTremovingSpaces.toUpperCase();\r\n //remove all special characters from the input String\r\n System.out.println(CTremovingSpaces.replaceAll(\"[^a-zA-Z0-9]\", \"\"));\r\n \r\n //create object of class indexOfCharacters\r\n indexOfCharacters indexOfDecryptedText = new indexOfCharacters();\r\n \r\n // loop for characters\r\n for(int i =0; i<26; i++){\r\n //variable to hold the results of PlainText\r\n String plainText=\"\";\r\n //key\r\n int key = i;\r\n //loop for final cipher text after removing spaces and special characters\r\n for(int j=0; j<CTremovingSpaces.length();j++){\r\n //display the character of CTRS then display its index in characters in class indxofchar.\r\n int index=indexOfDecryptedText.indexOf(CTremovingSpaces.charAt(j));\r\n \r\n if(index == -1){\r\n System.out.println(\"the character does not occur\");\r\n }\r\n if((index-key)>=0)\r\n {\r\n //display the character that output from index-key then store it in plainText\r\n plainText+=indexOfDecryptedText.charAt(index-key);\r\n }\r\n else\r\n {\r\n plainText+=indexOfDecryptedText.charAt((index-key)+26);\r\n }\r\n } \r\n \r\n System.out.println(\"The Plain Text using Key \" + key + \": \" + plainText);\r\n \r\n //convert the string of PlainText into character array\r\n char[] characters2= plainText.toCharArray();\r\n //store the length of the array\r\n int lengthOfArray = characters2.length;\r\n int aCount = 0;\r\n int eCount = 0;\r\n int tCount = 0;\r\n int oCount = 0;\r\n for(int x = 0; x < lengthOfArray; x++)\r\n\r\n {\r\n char characters = characters2[x];\r\n switch (characters) \r\n {\r\n case 'A': \r\n aCount++;\r\n break;\r\n case 'E': \r\n eCount++;\r\n break; \r\n case 'T': \r\n tCount++;\r\n break; \r\n case 'O': \r\n oCount++;\r\n break;}\r\n \r\n }\r\n System.out.println(\"Character of A = \" + aCount);\r\n System.out.println(\"Character of E = \" + eCount);\r\n System.out.println(\"Character of T = \" + tCount);\r\n System.out.println(\"Character of O = \" + oCount);\r\n int sum; \r\n sum = aCount + eCount + tCount + oCount;\r\n System.out.println(\"The sum of AETO = \" + sum);\r\n ///the program will display the count numbers of AETO then calculate the sum of these numbers\r\n ///the greatest number of the sum of AETO will be the plain text (based on cryptanalysis)\r\n \r\n \r\n }}", "public String decrypt(String cipherText);", "public void setText(String text){\n String _text = dcode.enCode(new String[] { encodeType, title, passWd, text });\n if(statusKey == ALRIGHT){\n setFileText(/*ccode == null ? */_text/* : ccode.enCrype(_text)*/);\n } else{\n System.err.println(\"You can't writes this file.\");\n System.err.println(\"This file contains unknown encode or is encrypted.\");\n }\n }", "void decryption(String file)\n {\n try\n {\n fdec=new DataOutputStream(new FileOutputStream(\"dec.txt\"));\n fenc1=new FileInputStream(file);\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n try\n {\n size=fenc1.available();\n np=0;\n p=size%8;\n if(p!=0)\n np=8-p;\n size+=np;\n if(p==0)\n nl=size/8;\n else\n nl=size/8+1;\n buf1=new byte[size+10];\n buf=new byte[8];\n fenc1.read(buf1);\n mark=-8;\n int arr[]=new int [8];\n for(k1=0;k1<nl;k1++)\n {\n mark+=8;\n for(int k2=0;k2<8;k2++)\n buf[k2]=buf1[mark+k2];\n for(int k2=0;k2<8;k2++)\n\t {\n\t arr[k2]=0;\n\t if(buf[k2]>=0)\n\t arr[k2]=buf[k2];\n\t else\n\t arr[k2]=buf[k2]+256;\n }\n\t j1=0;i1=0;\n while( i1<=3)\n\t\t {\n\t\t if((j1+1)%2==0)\n\t {\n x[i1]|=arr[j1]; // dividing 64 bit cypher block into four 16 bit registers\n\t i1++;\n\t\t }\n\t else\n\t {\n\t \t x[i1]=arr[j1];\n\t x[i1]<<=8;\n\t }\n\t j1++;\n\t }\n for(int t=0;t<4;t++)\n {\n\t ft1 =x[t]&255;\n\t ft=x[t]>>8;\n\t }\n step1=mul( x[0] , minverse( z[48] ));\n step2=( x[1] + ainverse( z[49] )) % 65536;\n step3=( x[2] + ainverse( z[50] )) % 65536;\n step4=mul( x[3] , minverse( z[51] ));\n step5=step1^step3;\n step6=step2^step4;\n step7=mul(step5,z[46]);\n step8=(step6+step7)%65536;\n step9=mul(step8,z[47]);\n step10=(step7+step9)%65536;\n step11=step1^step9;\n step12=step3^step9;\n step13=step2^step10;\n step14=step4^step10;\n x[0]=step11;\n x[1]=step12;\n x[2]=step13;\n x[3]=step14;\n// 2nd round\n\tint j2=40;\n\t\tfor(j1=1;j1<=7;j1++)\n \t\t {\n step1=mul( x[0] , minverse( z[j2+2] ));\n step2=( x[1] + ainverse( z[j2+4] )) % 65536;\n step3=( x[2] + ainverse( z[j2+3] )) % 65536;\n t=step2;\n step2=step3;\n step3=t;\n step4=mul( x[3] , minverse( z[j2+5] ));\n step5=step1^step3;\n step6=step2^step4;\n step7=mul(step5,z[j2+0]);\n step8=(step6+step7)%65536;\n step9=mul(step8,z[j2+1]);\n step10=(step7+step9)%65536;\n step11=step1^step9;\n step12=step3^step9;\n step13=step2^step10;\n step14=step4^step10;\n x[0]=step11;\n x[1]=step12;\n x[2]=step13;\n x[3]=step14;\n j2=j2-6;\n }\n x[0]=mul(x[0],minverse(z[0]));\n x[1]=(x[1]+ainverse(z[2]))%65536;\n x[2]=(x[2]+ainverse(z[1]))%65536;\n x[3]=mul(x[3],minverse(z[3]));\n t=x[1];\n x[1]=x[2];\n x[2]=t;\n\t for(int t=0;t<4;t++)\n {\n\t ft1 =x[t]&255;\n\t ft=x[t]>>8;\n\t fdec.write((char)ft);\n\t fdec.write((char)ft1);\n\t }\n }\n\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n }", "public static void main(String[] args) throws IOException \r\n\t{\n\t\tFile matrixData = new File(\"matrixData.txt\");\r\n\t\tScanner matrixIn = new Scanner(matrixData);\r\n\t\tString key = matrixIn.nextLine();\r\n\t\tmatrixIn.close();\r\n\t\r\n\r\n\t\t// read the text to encipher\r\n\t\tFile inFile = new File(\"textToEncipher.txt\");\r\n\t\tFileInputStream fis = new FileInputStream(inFile);\r\n\t\tBufferedInputStream bis = new BufferedInputStream(fis);\r\n\t\tStringBuilder plain = new StringBuilder(\"\");\r\n\t\twhile (bis.available() > 0)\r\n\t\t{\r\n\t\t\tplain.append((char)bis.read());\r\n\t\t}\r\n\t\t\r\n\t\t// initialize the output file PrintWriter\r\n\t\tFile outFile = new File(\"hillEncipherOutput.txt\");\r\n\t\tPrintWriter dataOut = new PrintWriter(outFile);\r\n\t\t\r\n\t\tHillEncipherer hill = new HillEncipherer(key, plain.toString());\r\n\t\tdataOut.print(hill.encipher());\r\n\t\t\r\n\t\tfis.close();\r\n\t\tbis.close();\r\n\t\tdataOut.close();\r\n\t}", "private void get_text() {\n InputStream inputStream = JsonUtil.class.getClassLoader().getResourceAsStream(\"data.txt\");\n BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));\n StringBuilder sb = new StringBuilder();\n String line = null;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line);\n }\n } catch (Exception e) {\n e.printStackTrace();\n System.out.println(e.getMessage());\n }\n this.text = sb.toString().trim();\n }", "public void inputForAnalysis() throws IOException\n {\n ArrayList<String> words = new ArrayList<String>(0);\n \n File fileName = new File(\"ciphertext.txt\");\n Scanner inFile = new Scanner(fileName);\n \n int index = 0;\n while(inFile.hasNext())\n {\n words.add(inFile.next());\n index++;\n }\n inFile.close();\n analyze(words);\n }", "void encryptText() {\n\n ArrayList<Character> punctuation = new ArrayList<>(\n Arrays.asList('\\'', ':', ',', '-', '-', '.', '!', '(', ')', '?', '\\\"', ';'));\n\n for (int i = 0; i < text.length(); ++i) {\n\n if (punctuation.contains(this.text.charAt(i))) {\n\n // only remove punctuation if not ? or . at the very end\n if (!((i == text.length() - 1) && (this.text.charAt(i) == '?' || this.text.charAt(i) == '.'))) {\n this.text.deleteCharAt(i);\n\n // go back to previous position since current char was deleted,\n // meaning the length of the string is now 1 less than before\n --i;\n }\n }\n }\n \n \n // Step 2: convert phrase to lowerCase\n\n this.setText(new StringBuilder(this.text.toString().toLowerCase()));\n\n \n // Step 3: split the phrase up into words and encrypt each word separately using secret key\n\n ArrayList<String> words = new ArrayList<>(Arrays.asList(this.text.toString().split(\" \")));\n\n \n // Step 3.1:\n\n ArrayList<Character> vowels = new ArrayList<>(Arrays.asList('a', 'e', 'i', 'o', 'u'));\n\n for (int i = 0; i < words.size(); ++i) {\n\n // if first char is vowel, add y1x3x4 to the end of word\n if (vowels.contains(words.get(i).charAt(0))) \n words.set(i, words.get(i).substring(0, words.get(i).length()) + this.secretKey.substring(3, 6));\n\n // otherwise, move first char to end of the word, then add x1x2 to the end of word\n else \n words.set(i, words.get(i).substring(1, words.get(i).length()) + words.get(i).charAt(0) + this.secretKey.substring(0, 2));\n }\n\n StringBuilder temp = new StringBuilder(\"\");\n\n for (String word : words)\n temp.append(word + \" \");\n\n this.setText(temp);\n\n \n // Step 3.2:\n\n // go through entire phrase\n for (int i = 0; i < this.getText().length(); ++i) {\n\n // if position is a multiple of z, insert the special char y2\n if ((i % Character.getNumericValue(this.secretKey.charAt(7)) == 0) && (i != 0)) {\n this.getText().replace(0, this.getText().length(), this.getText().substring(0, i) + this.secretKey.charAt(8)\n + this.getText().substring(i, this.getText().length()));\n }\n }\n \n }", "private static String decryptAES() {\n\t\tString inFilename = \"7hex.txt\";\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(inFilename);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\n\t\t\tfinal String keyHex = asciiToHex(\"YELLOW SUBMARINE\");\n\t\t\tfinal String cipherHex = br.readLine();\n\n\t\t\tSecretKey key = new SecretKeySpec(DatatypeConverter.parseHexBinary(keyHex), \"AES\");\n\t\t\tCipher cipher = Cipher.getInstance(\"AES/ECB/NoPadding\");\n\t\t\tcipher.init(Cipher.DECRYPT_MODE, key);\n\t\t\tbyte[] result = cipher.doFinal(DatatypeConverter.parseHexBinary(cipherHex));\n\n\t\t\tbr.close();\n\t\t\tfr.close();\n\n\t\t\treturn new String(result);\n\t\t} catch (Exception e) {\n\t\t\treturn null;\n\t\t}\n\t}", "private void ReadTextFile(String FilePath) {\n\t\t\n\t\t\n\t}", "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 }", "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 String cipherText(String str, String key)\n{\n String cipher_text=\"\";\n \n for (int i = 0; i < str.length(); i++)\n {\n // converting in range 0-25\n if(str.charAt(i) == ' ' || str.charAt(i) == '\\n')\n cipher_text+= str.charAt(i);\n else{ \n int x = (str.charAt(i) + key.charAt(i)) %26;\n // convert into alphabets(ASCII)\n x += 'A';\n \n cipher_text+=(char)(x);}\n }\n return cipher_text;\n}", "String encode(File message, File key,File crypted);", "public static void textToBinary(){\r\n\t\tScanner textIn3 = null;\r\n\t\tObjectOutputStream binOut = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\ttextIn3 = new Scanner(new FileInputStream(\"textFile.txt\"));\r\n\t\t\tbinOut = new ObjectOutputStream(new FileOutputStream(\"binFile.dat\"));\r\n\t\t} catch (FileNotFoundException e){\r\n\t\t\tSystem.out.println(\"Error finding or opening txt file\");\r\n\t\t\tSystem.exit(0);\r\n\t\t} catch (IOException f){\r\n\t\t\tSystem.out.println(\"Error making bin file\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\t\r\n\t\t//Loop reads until the end of the file\r\n\t\twhile (textIn3.hasNext()){\r\n\t\t\ttry {\r\n\t\t\t\tbinOut.writeDouble(Double.parseDouble(textIn3.nextLine()));\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tSystem.out.println(\"Error closing bin file\");\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\ttextIn3.close();\r\n\t\ttry {\r\n\t\t\tbinOut.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"Error closing bin file\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\tSystem.out.println(\"Binary File Created from Text File\");\r\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tFile file = new File(FILE_NAME);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tFileInputStream fis = openFileInput(FILE_NAME);\n\t\t\t\t\tInputStreamReader isr = new InputStreamReader(fis);\n\t\t\t\t\t\n\t\t\t\t\tchar[] data = new char[fis.available()];\n\t\t\t\t\tisr.read(data);\n\t\t\t\t\t\n\t\t\t\t\tString buf = new String(data);\n\t\t\t\t\ttext.setText(buf);\n\t\t\t\t\t\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\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\t\n\t\t\t}", "@Override\r\n\t\t\t\tpublic void run() {\n\t\t\t\t\tparseFile(\"english_file.txt\");\r\n\t\t\t\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n filePanel.getFrame().getController().decrypt(filePanel.getSource(), filePanel.getDestination());\n }", "public static void decrypt() throws IOException{\n\t\tBufferedInputStream in = new BufferedInputStream(new FileInputStream(inFilename));\n\t\tBufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(outFilename));\n\n\t\tbyte[] key; //holds the encryption key\n\n\t\t//get the file length\n\t\tlong fileLength = (new File(inFilename)).length();\n\n\t\t//check the file header marker\n\t\tbyte[] actualHeader = new byte[FILE_HEADER.length];\n\t\tin.read(actualHeader); //read header from the file\n\t\tif (!Arrays.equals(actualHeader, FILE_HEADER)){\n\t\t\tSystem.out.println(\"The file was not encrypted with this program.\");\n\t\t\tSystem.exit(-1); //-1 is an error code\n\t\t}\n\n\t\t/* STAGE 1 - generate decryption key */\n\t\t//read the #padded bits and random salt from the file\n\t\tbyte[] dataFromFile = new byte[129]; //1 byte for #padded bits + 128 bytes for salt\n\t\tin.read(dataFromFile);\n\t\t//separate the #padded bits for use later\n\t\tint numPad = (int)(dataFromFile[0]);\n\t\t//next, generate the message for CubeHash: (password + dataFromFile)\n\t\tbyte[] message = new byte[password.length + dataFromFile.length];\n\t\tSystem.arraycopy(password, 0, message, 0, password.length); //add the password\n\t\tSystem.arraycopy(dataFromFile, 0, message, password.length, dataFromFile.length); //add dataFromFile\n\t\t//finally, (re)generate the encryption key\n\t\tkey = CryptoLib.CubeHash.doCubeHash(message);\n\n\t\t/* STAGE 2 - apply decryption */\n\t\tint currPiece = 0; //keeps track of which piece of the key is being used\n\t\tbyte[] currData = new byte[8]; //holds the data currently being decrypted\n\n\t\t//split the key into 4 pieces of 128 bits each\n\t\tbyte[][] keyPieces = new byte[4][16];\n\t\tfor (int i = 0; i < 4; i++){\n\t\t\tSystem.arraycopy(key, i*16, keyPieces[i], 0, 16);\n\t\t}\n\n\t\t//loop through the rest of the file (except the last block), 8 bytes at a time\n\t\tfor (long i = FILE_HEADER.length + 129; i < fileLength - 8; i += 8){\n\t\t\t//put a chunk of data in currData\n\t\t\tin.read(currData);\n\n\t\t\t//do RC4(key, unTEA(key, data)), then write to file\n\t\t\tout.write(CryptoLib.RC4.doRC4(keyPieces[currPiece],\n\t\t\t\t\t\tCryptoLib.TEA.doUnTEA(keyPieces[currPiece], currData)));\n\n\t\t\t//increment currPiece\n\t\t\tcurrPiece = (currPiece + 1) % 4;\n\t\t}\n\n\t\t//deal with the last chunk of data:\n\t\t//first, read it..\n\t\tin.read(currData);\n\t\t//..decrypt it..\n\t\tcurrData = CryptoLib.RC4.doRC4(keyPieces[currPiece],\n\t\t\t\tCryptoLib.TEA.doUnTEA(keyPieces[currPiece], currData));\n\t\t//..then write it to the file\n\t\tout.write(currData, 0, (8 - numPad));\n\n\t\t/* STAGE 3 - done! */\n\t\tin.close();\n\t\tout.close();\n\t\tSystem.out.println(\"\\nDecryption complete.\");\n\t}", "public static void main(String[] args) \r\n {\r\n /*\r\n String data = \"This is a very important statement.\";\r\n String key = \"How old is my computer?\";\r\n KeyGenerator kGen = new KeyGenerator(key);\r\n String nK = kGen.getNumericKey();\r\n \r\n ArmstrongManager aMgr = new ArmstrongManager(nK);\r\n ColorManager cMgr = new ColorManager(nK);\r\n \r\n String encData =\"\";\r\n int temp;\r\n int i;\r\n for(i =0 ; i < data.length(); i++)\r\n {\r\n temp = aMgr.encrypt(data.charAt(i));\r\n temp = cMgr.encrypt(temp);\r\n encData = encData + (char)temp;\r\n }\r\n \r\n String decData= \"\";\r\n for(i =0 ; i < encData.length(); i++)\r\n {\r\n temp = cMgr.decrypt(encData.charAt(i));\r\n temp = aMgr.decrypt(temp);\r\n \r\n decData = decData + (char)temp;\r\n }\r\n \r\n \r\n System.out.println(\"data: \"+ data + \" \" + data.length());\r\n System.out.println(\"enc data: \"+ encData + \" \" + encData.length());\r\n System.out.println(\"dec data: \"+ decData + \" \" + decData.length());\r\n */\r\n \r\n try\r\n {\r\n //String src = \"d:/a.txt\";//images/kids.jpg\";\r\n //String enc = \"d:/e_a.txt\";//images/e_kids.jpg\";\r\n //String dec = \"d:/d_a.txt\";//images/d_kids.jpg\";\r\n String src = \"d:/images/kids.jpg\";\r\n String enc = \"d:/images/e_kids.jpg\";\r\n String dec = \"d:/images/d_kids.jpg\";\r\n\r\n String key = \"How old is my computer?\";\r\n\r\n Encryptor objEnc = new Encryptor(key);\r\n Decryptor objDec = new Decryptor(key);\r\n\r\n objEnc.encrypt(src, enc);\r\n System.out.println(\"Encryption Done\");\r\n \r\n objDec.decrypt(enc, dec);\r\n System.out.println(\"Decryption Done\");\r\n \r\n\r\n }\r\n catch(Exception ex)\r\n {\r\n System.out.println(\"Err: \" +ex.getMessage());\r\n }\r\n }", "public static void main(String[] args){\n\n String mode = \"enc\";\n String data = \"\";\n String out = \"\";\n String path;\n String alg = \"unicode\";\n int key = 0;\n\n try {\n for (int i = 0; i < args.length; i++) {\n if (args[i].equals(\"-data\") || args[i].equals(\"-in\")) {\n data = args[i + 1];\n }\n if (args[i].equals(\"-mode\")) {\n mode = args[i + 1];\n }\n if (args[i].equals(\"-key\")) {\n key = Integer.parseInt(args[i + 1]);\n }\n if (args[i].equals(\"-out\")) {\n out = args[i + 1];\n }\n if (args[i].equals(\"-alg\")) {\n alg = args[i + 1];\n }\n }\n } catch (ArrayIndexOutOfBoundsException e) {\n System.out.println(\"Missing option\");\n }\n\n File file = new File(data);\n\n if (file.exists() && !file.isDirectory()) {\n path = data;\n\n switch (mode){\n case \"enc\":\n EncryptionContext encryptionContext = new EncryptionContext();\n if(alg.equals(\"shift\")) {\n encryptionContext.setMethod(new ShiftEncryptionMethod());\n } else {\n encryptionContext.setMethod(new UnicodeTableEncryptionMethod());\n }\n data = encryptionContext.encryptFromFile(path, key);\n break;\n\n case \"dec\":\n DecryptionContext decryptionContext = new DecryptionContext();\n if(alg.equals(\"shift\")) {\n decryptionContext.setMethod(new ShiftDecryptionMethod());\n } else {\n decryptionContext.setMethod(new UnicodeTableDecryptionMethod());\n }\n data = decryptionContext.decryptFromFile(path,key);\n break;\n }\n\n } else {\n switch (mode){\n case \"enc\":\n EncryptionContext encryptionContext = new EncryptionContext();\n if(alg.equals(\"shift\")) {\n encryptionContext.setMethod(new ShiftEncryptionMethod());\n } else {\n encryptionContext.setMethod(new UnicodeTableEncryptionMethod());\n }\n data = encryptionContext.encrypt(key, data);\n break;\n\n case \"dec\":\n DecryptionContext decryptionContext = new DecryptionContext();\n if(alg.equals(\"shift\")) {\n decryptionContext.setMethod(new ShiftDecryptionMethod());\n } else {\n decryptionContext.setMethod(new UnicodeTableDecryptionMethod());\n }\n data = decryptionContext.decrypt(key, data);\n break;\n }\n }\n\n if (out.isEmpty()) {\n System.out.println(data);\n } else {\n writeIntoFile(out, data);\n }\n\n }", "public String read(File file) throws IOException {\n\t\t\tInputStream is = null;\r\n\t\t\tis = new FileInputStream(file);\r\n\t\t\t\r\n\t\t\tAccessTextFile test = new AccessTextFile();\r\n//\t\t\tInputStream is = new FileInputStream(\"E:\\\\test.txt\");\r\n\t\t\tStringBuffer buffer = new StringBuffer();\r\n\t\t\ttest.readToBuffer(buffer, is);\r\n\t\t\tSystem.out.println(buffer); // 将读到 buffer 中的内容写出来\r\n\t\t\tis.close();\t\t\r\n\t\t\treturn buffer.toString();\r\n\t\t }", "public static String readTextFile(File file) throws IOException {\n StringBuffer sb = new StringBuffer();\n BufferedReader fileReader = new BufferedReader(new FileReader(file));\n FileHelper.read(sb, fileReader);\n return sb.toString();\n }", "public static String readTextFile(File file) {\n\n\t\tBufferedInputStream bis = null;\n\t\tFileInputStream fis = null;\n\t\tStringBuffer sb = new StringBuffer();\n\t\ttry {\n\t\t\t// FileInputStream to read the file\n\t\t\tfis = new FileInputStream(file);\n\n\t\t\t/*\n\t\t\t * Passed the FileInputStream to BufferedInputStream For Fast read\n\t\t\t * using the buffer array.\n\t\t\t */\n\t\t\tbis = new BufferedInputStream(fis);\n\n\t\t\t/*\n\t\t\t * available() method of BufferedInputStream returns 0 when there\n\t\t\t * are no more bytes present in the file to be read\n\t\t\t */\n\t\t\twhile (bis.available() > 0) {\n\t\t\t\tsb.append((char) bis.read());\n\t\t\t}\n\n\t\t} catch (FileNotFoundException fnfe) {\n\t\t\tSystem.out.println(\"The specified file not found\" + fnfe);\n\t\t} catch (IOException ioe) {\n\t\t\tSystem.out.println(\"I/O Exception: \" + ioe);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (bis != null && fis != null) {\n\t\t\t\t\tfis.close();\n\t\t\t\t\tbis.close();\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t\tSystem.out.println(\"Error in InputStream close(): \" + ioe);\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\n\t}", "public static void main(String[] args)\n\t\t\tthrows FileNotFoundException, IOException {\n\t\tFileReader reader=new FileReader();\n\t\tEncryptDencrypt enDencrypt=new EncryptDencrypt();\n\t\tFileWriter writer=new FileWriter();\n\t\t\n\t\tSystem.out.println(\"加密文件:\");\n\t\tString plainStr=reader.read(\"src.txt\");\n\t\tString encryptStr=enDencrypt.encrypt(plainStr);\n\t\twriter.write(encryptStr, \"desprotype.txt\");\n\t\t\n\t\tSystem.out.println(\"解密文件:\");\n\t\tString enStr=reader.read(\"desprotype.txt\");\n\t\tString proStr=enDencrypt.deencrypyt(enStr);\n\t\twriter.write(proStr, \"srcprotype.txt\");\n\t}", "private void decoding(String cipherText)\n\t{\n\t\ttextLength = cipherText.length();\n\n\t\tdo\n\t\t{\n\t\t\tStringBuffer sb = new StringBuffer(textLength);\n\t\t\tchar currentLetter[] = cipherText.toCharArray();\n\n\t\t\tfor(int i = ZERO; i < textLength; i++)\n\t\t\t{\n\t\t\t\tif(i % TWO ==0)\n\t\t\t\tsb.append(currentLetter[i]);\n\t\t\t} // Ending bracket of for loop\n\n\t\t\tfor(int i = ZERO; i < textLength; i++)\n\t\t\t{\n\t\t\t\tif(i % TWO != ZERO)\n\t\t\t\tsb.append(currentLetter[i]);\n\t\t\t} // Ending bracket of for loop\n\n\t\t\tdecodedText = sb.toString();\n\t\t\tcipherText = decodedText;\n\t\t\tloopIntDecode++;\n\t\t}while(loopIntDecode < shiftAmount);\n\t}", "public static String Encrypt(String plainText,int key,String alphabet) throws IOException\n {\n plainText=plainText.toUpperCase();\n String cipherText=\"\";\n\n for(int i=0;i< plainText.length();i++)\n {\n int index=indexOfChar(plainText.charAt(i),alphabet);\n\n if(index==-1)\n {\n cipherText+=plainText.charAt(i);\n\n continue;\n }\n if((index+key)%alphabet.length()==0)\n {\n cipherText+=charAtIndex(index+key,alphabet);\n }\n else\n {\n cipherText+=charAtIndex((index+key)%alphabet.length(),alphabet);\n }\n }\n return cipherText;\n }", "public static void main(String [] args) throws IOException\n {\n System.out.println(\"PLAINTEXT FREQUENCY\");\n \n FrequencyAnalysis fa = new FrequencyAnalysis(); \n PrintWriter outFile1 = new PrintWriter (new File(\"plaintextfreq.txt\")); \n fa.readFile(\"plaintext.txt\"); \n int total1 = fa.getTotal();\n System.out.printf(\"%-10s%11s%16s%n\", \"Letter\", \"Count\", \"Frequency\");\n outFile1.printf(\"%-10s%11s%16s%n\", \"Letter\", \"Count\", \"Frequency\");\n int l = 0;\n for (int k : fa.getFrequency())\n {\n System.out.printf(\"%-10s%10d%16.2f%n\", (char) (65 + l), k, (((double) k / total1) * 100));\n outFile1.printf(\"%-10s%10d%16.2f%n\", (char) (65 + l), k, (((double) k / total1) * 100));\n l++;\n }\n outFile1.close();\n \n System.out.println();\n System.out.println();\n System.out.println(\"CIPHER FREQUENCY\");\n \n FrequencyAnalysis cfa = new FrequencyAnalysis(); \n PrintWriter outFile2 = new PrintWriter (new File(\"ciphertextfreq.txt\")); \n cfa.readFile(\"ciphertext.txt\"); \n int total2 = cfa.getTotal();\n System.out.printf(\"%-10s%11s%16s%n\", \"Letter\", \"Count\", \"Frequency\");\n outFile2.printf(\"%-10s%11s%16s%n\", \"Letter\", \"Count\", \"Frequency\");\n l = 0;\n for (int k : cfa.getFrequency())\n {\n System.out.printf(\"%-10s%10d%16.2f%n\", (char) (65 + l), k, (((double) k / total2) * 100));\n outFile2.printf(\"%-10s%10d%16.2f%n\", (char) (65 + l), k, (((double) k / total2) * 100));\n l++;\n }\n outFile2.close();\n \n \n }", "private void readFromFile(){\n\t\t\n\t\ttry {\n\t\t\tFile file=new File(\"controller.txt\");\n\t\t\tFileInputStream fin;\n\t\t\tfin = new FileInputStream(file);\n\t\t\tDataInputStream din=new DataInputStream(fin);\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(din));\n\t\t\t\n\t\t\tfor(int i=0; i<2; i++){\n\t\t\t\tif(i==0)\n\t\t\t\t\tcodedUserName=br.readLine();\n\t\t\t\telse \n\t\t\t\t\tcodedPassword=br.readLine();\n\t\t\t}\n\t\t\t\n\t\t} catch (FileNotFoundException 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\t\t\n\t}", "static void decryptECB(String filename, String key) {\n try {\n Scanner s = new Scanner(new File(filename + EXT), \"UTF-8\");\n File newFile = new File(filename + \"_dec\" + EXT);\n newFile.delete();\n newFile.createNewFile();\n PrintWriter w = new PrintWriter(newFile);\n processHeader(s, w);\n while (s.hasNext()) {\n readBlock(s);\n block = stateToBits(AES.decrypt(bitsToHexString(block), key));\n writeBlock(w);\n }\n w.flush();\n w.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public String readText(String _filename) {\r\n\t\treturn readText(_filename, \"text\", (java.net.URL) null);\r\n\t}", "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 }", "public EnigmaFile() throws Exception\n {\n\n String path = Main.class.getClassLoader().getResource(\"filein.txt\").getPath();\n File currentDirectory=new File(path);\n finstream = new FileInputStream(currentDirectory);\n\n\n String pathToWrite = path.replaceFirst(\"filein.txt\",\"fileout.txt\");\n File outputFile = new File(pathToWrite);\n br = new BufferedReader(new InputStreamReader(finstream));\n outputFile.createNewFile();\n FileWriter fileWrite = new FileWriter(outputFile.getAbsoluteFile());\n writer = new BufferedWriter(fileWrite);\n\n\n }", "private String encodageCesar(String text) {\n if (text == null || text.equals(\"\")) {\n throw new AssertionError(\"Aucun texte n'est saisie\");\n }\n SubstCipher encodingText = new SubstCipher(this.shiftAlea);\n encodingText.buildShiftedTextFor(text);\n String encoding = encodingText.getLastShiftedText();\n return encodageMot(encoding);\n }", "public String txtToStiring(File file) {\n\t\tString linea = \"\";\n\t\tString out = \"\";\n\t\tStringBuilder cadena = new StringBuilder();\n\t\tFileReader f;\n\t\ttry {\n\t\t\tf = new FileReader(file);\n\t\t\tBufferedReader b = new BufferedReader(f);\n\t\t\twhile ((linea = b.readLine()) != null) {\n\t\t\t\tcadena.append(linea);\n\t\t\t}\n\t\t\tout = cadena.toString();\n\t\t\tb.close();\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\treturn out;\n\t}", "public String loadTextFile(String path) throws IOException {\n File file = new File(path);\n\n // Convert the file to a string.\n String output;\n try {\n output = Files.toString(file, Charsets.UTF_8);\n } catch (IOException ex) {\n LoggerFactory.getLogger(Resources.class).error(\"Unable to locate the resource at \" + path + \".\", ex);\n throw ex;\n }\n\n return output;\n }", "public String readFile(File file) {\r\n\t\tString line;\r\n\t\tString allText = \"\";\r\n\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(file))) {\r\n\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\r\n\t\t\t\tallText += line + \"\\n\";\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn allText;\r\n\t}", "public String textExtractor(String filePath) {\n\n StringBuilder textBuilder = new StringBuilder();\n try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(\"/\" + filePath), \"UTF-8\"))) {\n while (bufferedReader.ready()) {\n textBuilder.append(bufferedReader.readLine()).append(\"/n\");\n }\n\n } catch (IOException exc) {\n exc.printStackTrace();\n }\n return textBuilder.toString();\n }", "static void encryptCBC(String filename, String key, String IV) {\n try {\n Scanner s = new Scanner(new File(filename + EXT), \"UTF-8\");\n File newFile = new File(filename + \"_CBC\" + EXT);\n newFile.delete();\n newFile.createNewFile();\n PrintWriter w = new PrintWriter(newFile);\n processHeader(s, w);\n cipherBlock = hexStringToBits(IV);\n while (s.hasNext()) {\n readBlock(s);\n block = xor(block, cipherBlock);\n block = stateToBits(AES.encrypt(bitsToHexString(block), key));\n for (int i = 0; i < block.length; i++) {\n cipherBlock[i] = block[i];\n }\n writeBlock(w);\n }\n w.flush();\n w.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void ReadTextFile() {\n\t\t// Using Buffered Stream I/O\n\t\ttry (BufferedInputStream in = new BufferedInputStream(new FileInputStream(inFileStr))) {\n\t\t\tbyte[] contents = new byte[bufferSize];\n\t\t\tstartTime = System.nanoTime();\n\t\t\tint bytesCount;\n\t\t\twhile ((bytesCount = in.read(contents)) != -1) {\n\t\t\t\tsnippets.add(new String(contents));\n\t\t\t}\n\t\t\tin.close();\n\t\t} catch (IOException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "private void encodeMessage() {\n encodedMessage = \"\";\n try(BufferedReader inputBuffer = Files.newBufferedReader(inputPath)) {\n String inputLine;\n while((inputLine = inputBuffer.readLine()) != null) {\n //walks the input message and builds the encode message\n for(int i = 0; i < inputLine.length(); i++) {\n encodedMessage = encodedMessage + codeTable[inputLine.charAt(i)];\n }\n encodedMessage = encodedMessage + codeTable[10];\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n //writes to the output file\n try(BufferedWriter outputBuffer = Files.newBufferedWriter(outputPath)) {\n outputBuffer.write(encodedMessage, 0, encodedMessage.length());\n outputBuffer.newLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public static void main(String[] args) throws FileNotFoundException\n\t{\n\t\tString input;\n//\t\tString output = \"\";\n\t\tFile f = new File(\"PlayfairKey.txt\");\n\t\tScanner reader = new Scanner(f);\n\t\tScanner in = new Scanner(System.in);\n\t\t//fills in the key array\n\t\tfor(int y = 0; y < 5; y++)\n\t\t{\n\t//\t\tSystem.out.println(\"Reached x\");\n\t\t\tfor(int x = 0; x < 5; x++)\n\t\t\t{\n\t\t\t\tString temp = reader.nextLine();\n\t//\t\t\tSystem.out.println(\"Reached y\");\n\t\t\t\tkey[x][y] = temp.charAt(0);\n\t\t\t}\n\t\t}\n\t\t\n\t\treader.close();\n\t\t/*\n\t\tfor(int y = 0; y < 5; y++)\n\t\t{\n\t\t\tfor(int x = 0; x < 5; x++)\n\t\t\t{\n\t\t\t\tSystem.out.print(key[x][y]+\" \");\n\t\t\t\t//System.out.print(x+\",\"+y+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\\t\");\n\t\t}\n\t\t*/\n\t\t\n\t\t/*\n\t\tfor(int y = 0; y < 5; y++)\n\t\t{\n\t\t\tfor(int x = 0; x < 5; x++)\n\t\t\t{\n\t\t\t\t//System.out.print(key[x][y]+\" \");\n\t\t\t\tSystem.out.print(x+\",\"+y+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\\t\");\n\t\t}\n\t\t*/\n\t\t\n\t\t\n\t\t\n\t\t//test\n\t//\tSystem.out.println(\"Enter 1 to encrypt, 2 to decrypt, -1 to end the program\");\n\t\twhile(condition != -1)\n\t\t{\n\t\t\t\n\t\t\tSystem.out.println(\"Enter 1 to encrypt, 2 to decrypt, -1 to end the program\");\n\t\t\n\t\t\tcondition = in.nextInt();\n\t\t\n\t\t\tif(condition == -1)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Enter a String:\");\n\t\t\tin.nextLine();\n\t\t\tinput = in.nextLine();\n\t\t\t\n\t\t\tinput = input.replaceAll(\" \",\"\");\n\t\t\n\t\t\tinput = input.toLowerCase();\n\t\t\t\n\t\t\t\n\t\t\tif(condition == 1)\n\t\t\t{\n\t\t\t\tinput = input.replaceAll(\"j\",\"i\");\n\t\t\t\tchar[] tempInputArray = input.toCharArray();\n\t\t\t\tint found = 1;\n\t\t\t\t\n\t\t\t\tfor(int i =0; i < tempInputArray.length-1; i++)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif(tempInputArray[i] == tempInputArray[i+1])\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tinput = input.substring(0, i+found) + \"x\" + input.substring(i+found, input.length());\n\t\t\t\t\t\tfound++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(input.length() % 2 != 0)\n\t\t\t\t{\n\t\t\t\t\tinput+=\"x\";\n\t\t\t\t}\n\t\t\t\t\n//\t\t\t\tSystem.out.println(input);\n\t\t\t\t\n\t\t\t\tchar[] inputArray = input.toCharArray();\n\t\t\t\tSystem.out.println(\"Encrypted:\");\n\t\t\t\tencrypt(inputArray);\n\t\t\t}\n\t\t\telse if(condition == 2)\n\t\t\t{\n//\t\t\t\tSystem.out.println(input);\n\t\t\t\tchar[] inputArray = input.toCharArray();\n\t\t\t\tSystem.out.println(\"Decrypted:\");\n\t\t\t\tdecrypt(inputArray);\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"\\n\\n\");\n\t\t\t\n\t\t}\n\n\t\t\n\t}", "private void prga(){\n int i = 0;\n int a = 0;\n int b = 0;\n StringBuilder sb = new StringBuilder();\n fileEncrypted.clear();\n\n byte[] code = new byte[filePlain.size()];\n while (i<filePlain.size()){\n a = (a + 1) % 256;\n b = (b + s_box.get(a)) % 256;\n Collections.swap(s_box, a, b);\n\n int key_int = s_box.get((s_box.get(a) + s_box.get(b))% 256);\n byte cypher = (byte) (key_int^filePlain.get(i));\n\n fileEncrypted.add(cypher);\n sb.append((char)cypher);\n code[i] = cypher;\n i++;\n }\n\n System.out.println(\"aaa\");\n// export file\n Helper.exportFile(code, extension, true);\n }", "public void LoadTxt(File Arquivo) {\n if (Arquivo.exists()) {\r\n\r\n try {\r\n\r\n FileReader FR = new FileReader(Arquivo);\r\n BufferedReader BW = new BufferedReader(new InputStreamReader(new FileInputStream(Arquivo.getAbsolutePath()), \"ISO-8859-1\"));\r\n\r\n //BufferedReader BW = new BufferedReader(FR);\r\n\r\n String dados;\r\n String[] paraArray = new String[3];\r\n String matricula;\r\n \r\n String serie = Arquivo.getName();\r\n int pos = serie.lastIndexOf(\".\");\r\n if (pos > 0) {\r\n serie = serie.substring(0, pos);\r\n }\r\n\r\n Sala novaSala = new Sala(serie); //CRIANDO SALA COM NOME DE TURMA\r\n salas2.add(novaSala); // ADICIONANDO SALA NA LISTA DE SALAS\r\n while ((dados = BW.readLine()) != null) {\r\n paraArray = dados.split(\";\");\r\n\r\n matricula = /*Integer.parseInt*/ (paraArray[0]);\r\n //senha = /*Integer.parseInt*/(paraArray[2]);\r\n Dados novoDado = new Dados(matricula, paraArray[1], paraArray[2]);\r\n\r\n novoDado.setSerie(serie); //ADICIONANDO TURMA AO DADO\r\n novaSala.getDadosalas().add(novoDado); //ADICIONANDO DADOS A LISTA DE DADOS QUE ESTA EM SALA\r\n\r\n }\r\n \r\n\r\n BW.close();\r\n FR.close();\r\n\r\n } catch (Exception e) {\r\n System.out.println(\"Erro ao carregar arquivo acima\");\r\n System.out.println(e.getMessage());\r\n\r\n }\r\n\r\n } else {\r\n System.out.println(\"Nenhum arquivo de dados encontrado\");\r\n }\r\n\r\n }", "String transcribeFile(String filePath);", "static void encryptECB(String filename, String key) {\n try {\n Scanner s = new Scanner(new File(filename + EXT), \"UTF-8\");\n File newFile = new File(filename + \"_ECB\" + EXT);\n newFile.delete();\n newFile.createNewFile();\n PrintWriter w = new PrintWriter(newFile);\n processHeader(s, w);\n while (s.hasNext()) {\n readBlock(s);\n block = stateToBits(AES.encrypt(bitsToHexString(block), key));\n writeBlock(w);\n }\n w.flush();\n w.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "String decrypt(String text) {\n\t\tchar letter;\n\t\tString finalString = \"\";\t\t\t\t\t// slutliga klartexten\n\t\tint start = key.getStart();\t\t\t\t\t// deklarerar nyckelns startläge\n\t\tint k ;\t\t\t\t\t\t\t\t\t\t// variabel för bokstavens startläge i vanliga alfabetet\n\t\tStringBuilder sb = new StringBuilder();\t\t\t\t\t// skapar en stringbuilder som kan modifieras, bygger upp textsträngar av olika variabler\n\t\t\t\t\t\t\n\t\t// loopen går igenom alla tecken i min krypterade text \t\t\t\n\t\tfor(int i = 0; i < text.length(); i++) {\t\t\t// for-loop för att gå igenom hela texten\t\t\t\t\n\t\t\tletter = text.charAt(i);\t\t\t\t\t\t// ger bokstaven på platsen 0,1,2,3.....\n\t\t\tif(letter == ' ') {\t\t\t\t\t\t\t\t// om det är ett blanktecken så ska det vara ett blanktecken\n\t\t\t\tsb.append(' ');\t\t\t\t\t\t\t\t// sparar blanksteg i en stringBuilder\n\t\t\t} else {\n\t\t\t\tint index=0;\n\t\t\t\tstart=start%26;\t\t\t\t\t\t\t\t// vi behöver endast 26 värden\n\t\t\t\tkey.getStart();\n\n\t\t\t\t\n\t\t\t\twhile(index<26 &&(letter!=key.getLetter(index))) {\t\t// så länge som chiffret inte motsvarar förskjutningen\n\t\t\t\t\tindex++;\t\t\t\t\t\t\t\t\t\t\t// så fortsätter den leta\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tk=index-start;\n\t\t\t\t\n\t\t\t\tif(k>=0)\n\t\t\t\t\tletter=(char)('A'+k);\n\t\t\t\telse letter=(char)('Z'-(start-1-index));\t\t\t\t// räknar från index, om index mindre än start så räknar den bakåt\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// så att det inte blir tokigt mellan Z och A.\n\t\t\t\t\n\t\t\t\tsb.append(letter);\t\t\t\t\t\t\t\t\t\t//lagrar bokstav i stringBuilder\n\t\t\t\tstart++;\t\t\t\t\t\t\t\t\t\t\t\t//chiffret börjar om\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\n\t\t\t}\n\t\treturn sb.toString();\t\t\t\t\t\t\t\t\t\t// returnerar sluttexten\n\t\t}", "public static void files() throws IOException {\n\n\n try {\n BufferedReader reader = new BufferedReader(new FileReader(\"D:\\\\Text.txt\"));\n String line;\n while ((line = reader.readLine()) != null) {\n Palindroms.palindromeByReverse(line);\n BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(\"D:\\\\output.txt\")));\n writer.append(line);\n writer.close();\n }\n reader.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n System.out.println(\"Bye!\");\n }\n }", "private String decodageCesar(String text) {\n if (text == null || text.equals(\"\")) {\n throw new AssertionError(\"Aucun texte n'est saisie\");\n }\n String decoding = decodageMot(text);\n SubstCipher decodingText = new SubstCipher(this.shiftAlea);\n decodingText.ensureNegativeShift();\n decodingText.buildShiftedTextFor(decoding);\n return decodingText.getLastShiftedText();\n }", "@Override\n\tpublic void ReadTextFile() {\n\t\t// Using a programmer-managed byte-array\n\t\ttry (FileInputStream in = new FileInputStream(inFileStr)) {\n\t\t\tstartTime = System.nanoTime();\n\t\t\tbyte[] byteArray = new byte[bufferSize];\n\t\t\tint bytesCount;\n\t\t\twhile ((bytesCount = in.read(byteArray)) != -1) {\n\t\t\t\tsnippets.add(new String(byteArray));\n\t\t\t}\n\t\t\tin.close();\n\t\t} catch (IOException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "public void stringcon()\n {\n int i,j,k;\n int temp[]=new int[8];\n int a[]=new int[32];\n i=0;\n j=0;\n for(i=0;i<10000;i++)\n bytes[i]=0;\n i=0;\n maxbinary1=0;\n for(i=0;i<24;i++)\n a[i]=binary[i];\n for(i=0;i<24;i++)\n maxbinary1+=a[i]*Math.pow(2,23-i);\n maxbinary2=maxbinary1*8;\n ivalue=0;\n for(i=24,j=0;i<32;i++,j++)\n {\n a[j]=binary[i];\n ivalue+=a[j]*Math.pow(2,7-j);\n }\n if(ivalue==73)\n {\n i=32;\n while(i<maxbinary2)\n {\n for(k=0;k<=7;k++)\n temp[k]=binary[i++];\n for(k=0;k<=7;k++)\n bytes[j]+=temp[k]*Math.pow(2,7-k);\n j++;\n }\n String s=JOptionPane.showInputDialog(this,\"Enter key with 16 letters\");\n char ch[]=new char[s.length()];\n ch=s.toCharArray();\n try\n {\n FileOutputStream f=new FileOutputStream(\"key1.txt\");\n for(i=0;i<ch.length;i++)\n f.write(ch[i]);\n f.close();\n FileOutputStream fout=new FileOutputStream(\"enc1.txt\");\n DataOutputStream d=new DataOutputStream(fout);\n \t\ti=8;\n while(i<(maxbinary1))\n \t\t {\n \t\t\td.write(bytes[i]);\n\t\t i++;\n \t\t }\n fout.close();\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n\n ideaalgo b=new ideaalgo();\n b.procedure();\n b.decryption(\"enc1.txt\");\n try\n {\n BufferedReader d;\n StringBuffer sb=new StringBuffer();\n d=new BufferedReader(new FileReader(\"dec.txt\"));\n String line;\n while((line=d.readLine())!=null)\n sb.append(line+\"\\n\");\n ta.setText(sb.toString());\n d.close();\n }\ncatch(Exception e)\n {\n System.out.println(e);\n }\n }\n}", "public static void writeFile(String text) throws IOException {\n\t\tWriter out = null;\n\t\ttry {\n\t\t\tout = new BufferedWriter(\n\t\t\t\t\tnew OutputStreamWriter(new FileOutputStream(\"toTranslate.txt\"), StandardCharsets.UTF_8));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\tLOGGER.log(Level.WARNING, \"FileNotFoundException\", e1);\n\t\t\t;\n\t\t}\n\t\ttry {\n\t\t\tif (out != null)\n\t\t\t\tout.write(text);\n\t\t\telse\n\t\t\t\tSystem.out.println();\n\t\t} catch (IOException e) {\n\t\t\tLOGGER.log(Level.WARNING, \"IOException\", e);\n\t\t\t;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (out != null)\n\t\t\t\t\tout.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tLOGGER.log(Level.WARNING, \"IOException\", e);\n\t\t\t\tThread.currentThread().interrupt();\n\t\t\t}\n\t\t}\n\t}", "static void decryptCBC(String filename, String key, String IV) {\n try {\n Scanner s = new Scanner(new File(filename + EXT), \"UTF-8\");\n File newFile = new File(filename + \"_dec\" + EXT);\n newFile.delete();\n newFile.createNewFile();\n PrintWriter w = new PrintWriter(newFile);\n processHeader(s, w);\n cipherBlock = hexStringToBits(IV);\n while (s.hasNext()) {\n readBlock(s);\n int[] temp = new int[128];\n for (int i = 0; i < block.length; i++) {\n temp[i] = block[i];\n }\n block = stateToBits(AES.decrypt(bitsToHexString(block), key));\n block = xor(block, cipherBlock);\n cipherBlock = temp;\n writeBlock(w);\n }\n w.flush();\n w.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public TextFile(String filepath) {\n try {\n toFile = new File(filepath);\n if(toFile == null) {\n System.err.println(filepath + \" could not be created\");\n return;\n }\n writer = new BufferedWriter(new FileWriter(toFile));\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n \n }", "public String encrypt(String plainText);", "public static String textToString( String fileName )\n { \n String temp = \"\";\n try {\n Scanner input = new Scanner(new File(fileName));\n \n //add 'words' in the file to the string, separated by a single space\n while(input.hasNext()){\n temp = temp + input.next() + \" \";\n }\n input.close();\n \n }\n catch(Exception e){\n System.out.println(\"Unable to locate \" + fileName);\n }\n //make sure to remove any additional space that may have been added at the end of the string.\n return temp.trim();\n }", "void decryptFile(String inPath, String outPath) throws IOException {\n try (BufferedReader reader = new BufferedReader(new FileReader(inPath))) {\n try (PrintWriter writer = new PrintWriter(outPath)) {\n decryptFile(reader, writer);\n } catch (FileNotFoundException e) {\n System.out.println(\"Error: Output file not found\");\n }\n } catch (FileNotFoundException e) {\n System.out.println(\"Error: Input file not found\");\n }\n }", "private void openTextFile() {\n\t\tFile openTextFile = fileChooser.getInputFile(this, \"Open Saved Text File\"); \n\t\tif (openTextFile == null)\n\t\t\treturn;\n\t\t\n\t\ttry {\n\t\t\tScanner read = new Scanner(openTextFile); \n\t\t\tif (!read.nextLine().equals(\"New textImage\")) {\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Sorry, This is not an valid file. \\nPlease try again.\"); \n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tColor savedBg = new Color(read.nextInt(),read.nextInt(),read.nextInt());\n\t\t\tArrayList<DrawTextItem> newStrings = new ArrayList<DrawTextItem>(); \n\t\t\tDrawTextItem newText;\n\t\t\tread.nextLine();\n\t\t\twhile (read.hasNext() && read.nextLine().equals(\"theString:\")) { \n\t\t\t\tnewText = new DrawTextItem(read.nextLine(), read.nextInt(), read.nextInt());\n\t\t\t\tread.nextLine();\n\t\t\t\tnewText.setFont(new Font(read.nextLine(), read.nextInt(), read.nextInt()));\n\t\t\t\tnewText.setTextColor(new Color(read.nextInt(), read.nextInt(), read.nextInt()));\n\t\t\t\tnewText.setTextTransparency(read.nextDouble());\n\t\t\t\t\n\t\t\t\tint r = read.nextInt(); \n\t\t\t\tint g = read.nextInt();\n\t\t\t\tint b = read.nextInt();\n\t\t\t\tif (r == -1)\n\t\t\t\t\tnewText.setBackground(null); \n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\tnewText.setBackground(new Color(r, g, b));\n\t\t\t\t\n\t\t\t\tnewText.setBackgroundTransparency(read.nextDouble()); \n\t\t\t\tnewText.setBorder(read.nextBoolean());\n\t\t\t\tnewText.setMagnification(read.nextDouble());\n\t\t\t\tnewText.setRotationAngle(read.nextDouble());\n\t\t\t\tread.nextLine();\n\t\t\t\tnewStrings.add(newText); \n\t\t\t}\n\t\t\t\n\t\t\tcanvas.setBackground(savedBg);\n\t\t\ttheString = newStrings;\n\t\t} catch (Exception e) {\n\t\t\tJOptionPane.showMessageDialog(this, \n\t\t\t\t\t\"Sorry, an error occurred while trying to load the save progress.\\n\" + \"Error message: \" + e);\n\t\t}\n\t}", "public String encrypt(String text) {\n return content.encrypt(text);\n }", "public String decrypt(String text) {\n return content.decrypt(text);\n }", "private static void ReadText(String path) {\n\t\t//reads the file, throws an error if there is no file to open\n\t\ttry {\n\t\t\tinput = new Scanner(new File(path));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error opening file...\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tString line; //stores the string of text from the .txt file\n\t\tString parsedWord; //Stores the word of the parsed word\n\t\tint wordLength; //Stores the length of the word\n\t\tint lineNum = 1; //Stores the number of line\n\t\ttry {\n\t\t\t//loops while there is still a new line in the .txt file\n\t\t\twhile ((line = input.nextLine()) != null) {\n\t\t\t\t//separates the lines by words\n\t\t\t\tStringTokenizer st = new StringTokenizer(line);\n\t\t\t\t//loops while there are still more words in the line\n\t\t\t\twhile (st.hasMoreTokens()) {\n\t\t\t\t\tparsedWord = st.nextToken();\n\t\t\t\t\twordLength = parsedWord.length();\n\t\t\t\t\t//Regex gets rid of all punctuation\n\t\t\t\t\tif (parsedWord.matches(\".*\\\\p{Punct}\")) {\n\t\t\t\t\t\tparsedWord = parsedWord.substring(0, wordLength - 1);\n\t\t\t\t\t}\n\t\t\t\t\t//add the word to the list\n\t\t\t\t\twordList.add(parsedWord);\n\t\t\t\t\tlineList.add(lineNum);\n\t\t\t\t}\n\t\t\t\tlineNum++;\n\t\t\t}\n\t\t} catch (NoSuchElementException e) {\n\t\t\t//Do nothing\n\t\t}\n\t\tinput.close();\n\t}", "public static void main(String [] args) {\n\t cryptanalysis();\n\t \n\t for (char cipherChar : cipherText.toCharArray())\n\t\t if (Character.isLetter(cipherChar)) { // only letters are encrypted, punctuation marks and whitespace are not\n\t\t\t // following line converts letters to numbers between 0 and 25\n\t\t\t int cipher = (int) cipherChar - alphaIndex;\n\t\t\t int plain = decrypt(cipher);\n\t\t\t // following line coverts numbers between 0 and 25 to letters\n\t\t\t char plainChar = (char) (plain + alphaIndex);\n\t\t\t System.out.print(plainChar);\n\t\t }\n\t\t else\n\t\t\t System.out.print(cipherChar);\n }", "public static byte[] encrypt(byte[] plainFile, String key) throws Exception {\n\n // Generacion IV (Vector de inicializacion)\n int ivSize = 16;\n byte[] iv = new byte[ivSize];\n SecureRandom random = new SecureRandom();\n random.nextBytes(iv);\n IvParameterSpec ivParameterSpec = new IvParameterSpec(iv);\n\n // Generacion de hash de la clave secreta.\n MessageDigest digest = MessageDigest.getInstance(\"SHA-256\"); // SHA-256: Algoritmo de Hashing que genera una clave de 256 bits\n digest.update(key.getBytes(\"UTF-8\"));\n byte[] keyBytes = new byte[16];\n System.arraycopy(digest.digest(), 0, keyBytes, 0, keyBytes.length);\n SecretKeySpec secretKeySpec = new SecretKeySpec(keyBytes, \"AES\");\n\n // Llamado a libreria de cifrado de java.\n Cipher cipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec);\n byte[] encrypted = cipher.doFinal(plainFile);\n\n // Agrega IV al vector del archivo encriptado \n byte[] encryptedIVAndText = new byte[ivSize + encrypted.length];\n System.arraycopy(iv, 0, encryptedIVAndText, 0, ivSize);\n System.arraycopy(encrypted, 0, encryptedIVAndText, ivSize, encrypted.length);\n\n return encryptedIVAndText;\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 }", "String readText(FsPath path);", "public void decryptFile(String fitxerEncriptat, SecretKey clave, String fitxerDesencriptat) throws FileNotFoundException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IOException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException {\r\n //Creamos el FileInputStream\r\n FileInputStream fis = new FileInputStream(fitxerEncriptat);\r\n //Creamos el FileOutputStream para escribir en el fichero.\r\n FileOutputStream fos = new FileOutputStream(new File(fitxerDesencriptat));\r\n \r\n //Creamos un descifrador para descifrar el texto del fichero Encriptado.\r\n Cipher descifrador = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\r\n IvParameterSpec iv = new IvParameterSpec(cadena_iv.getBytes());\r\n descifrador.init(Cipher.DECRYPT_MODE, clave, iv);\r\n\r\n byte[] buffer = new byte[1024];\r\n int bytes;\r\n \r\n //Utilizamos un bucle para ir leyendo el archivo de texto Encriptado que le hemos pasado.\r\n while((bytes = fis.read(buffer, 0, buffer.length))!=-1){\r\n byte [] update = descifrador.update(buffer, 0, bytes);\r\n fos.write(descifrador.doFinal());\r\n }\r\n \r\n //Cerramos recursos.\r\n fos.write(descifrador.doFinal());\r\n fis.close();\r\n fos.close();\r\n \r\n \r\n }", "public static StringBuffer decrypt(String text) {\r\n int s = 5;\r\n byte ctoi[];\r\n int check;\r\n StringBuffer result = new StringBuffer();\r\n ctoi = text.getBytes();\r\n for (int i = 0; i < text.length(); i++) {\r\n if (Character.isUpperCase(text.charAt(i))) {\r\n check = 0;\r\n check = ((ctoi[i] - s) - 65) % 26;\r\n if (check < 0) {\r\n char ch = (char) ((((((int) text.charAt(i) - s) - 65) % 26) + 65) + 26);\r\n result.append(ch);\r\n } else {\r\n char ch = (char) (((((int) text.charAt(i) - s) - 65) % 26) + 65);\r\n result.append(ch);\r\n }\r\n\r\n } else if (Character.isLowerCase(text.charAt(i))) {\r\n check = 0;\r\n check = ((ctoi[i] - s) - 97) % 26;\r\n if (check < 0) {\r\n char ch = (char) ((((((int) text.charAt(i) - s) - 97) % 26) + 97) + 26);\r\n result.append(ch);\r\n } else {\r\n char ch = (char) (((((int) text.charAt(i) - s) - 97) % 26) + 97);\r\n result.append(ch);\r\n }\r\n\r\n } else {\r\n char ch = text.charAt(i);\r\n result.append(ch);\r\n }\r\n }\r\n return result;\r\n }", "public static void main(String[] args) throws Exception {\n FileReader fr = new FileReader(\"data/text.txt\");\n\n int i;\n while ((i=fr.read()) != -1)\n System.out.print((char)i);\n\n }", "public static void main(String[] args) {\n\n /** Reading a message from the keyboard **/\n // @SuppressWarnings(\"resource\")\n // Scanner scanner = new Scanner(System.in);\n // System.out.println(\"Please enter a message to be encoded: \");\n // String inputString = scanner.nextLine();\n //\n // System.out.println(\"Please enter the code length: \");\n // String codeLen = scanner.nextLine();\n // int num = Integer.parseInt(codeLen);\n // Encode encodeThis = new Encode(inputString, num);\n // encodeThis.createFrequencyTable();\n // encodeThis.createPriorityQueue();\n // while (encodeThis.stillEncoding()) {\n // encodeThis.build();\n // }\n // String codedMessage = encodeThis.getEncodedMessage();\n // /** Printing message to the screen **/\n // System.out.println(codedMessage);\n\n /** Reading message from a file **/\n ArrayList<String> info = new ArrayList<String>();\n try {\n File file = new File(\"/Users/ugoslight/Desktop/message.txt\");\n Scanner reader = new Scanner(file);\n\n while (reader.hasNextLine()) {\n String data = reader.nextLine();\n info.add(data);\n }\n reader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"No file found.\");\n e.printStackTrace();\n }\n\n /** Encoding message from file **/\n Encode encodeThis = new Encode(info.get(0), Integer.parseInt(info.get(1)));\n encodeThis.createFrequencyTable();\n encodeThis.createPriorityQueue();\n while (encodeThis.stillEncoding()) {\n encodeThis.build();\n }\n String codedMessage = encodeThis.getEncodedMessage();\n /** Create new file **/\n try {\n File myObj = new File(\"/Users/ugoslight/Desktop/filename.txt\");\n if (myObj.createNewFile()) {\n System.out.println(\"File created: \" + myObj.getName());\n } else {\n System.out.println(\"File already exists.\");\n }\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n /** Write to file **/\n try {\n FileWriter myWriter = new FileWriter(\"/Users/ugoslight/Desktop/filename.txt\");\n myWriter.write(codedMessage);\n myWriter.close();\n System.out.println(\"Successfully wrote to the file.\");\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n\n\n\n }", "private String readText(NdefRecord record) throws UnsupportedEncodingException {\n\n byte[] payload = record.getPayload();\n\n // Get the Text Encoding\n String textEncoding = ((payload[0] & 128) == 0) ? \"UTF-8\" : \"UTF-16\";\n\n // Get the Language Code\n int languageCodeLength = payload[0] & 0063;\n\n // String languageCode = new String(payload, 1, languageCodeLength, \"US-ASCII\");\n // e.g. \"en\"\n\n // Get the Text\n return new String(payload, languageCodeLength + 1, payload.length - languageCodeLength - 1, textEncoding);\n }", "public static void open() {\n JFileChooser fileChooser;\n String fileContent;\n String path = FileLoader.loadFile(\"path.txt\");\n if (path != null) {\n fileChooser = new JFileChooser(path);\n } else {\n fileChooser = new JFileChooser((FileSystemView.getFileSystemView().getHomeDirectory()));\n }\n\n fileChooser.setDialogTitle(\"Select text file\");\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"Text files\",\"mytxt\");\n fileChooser.addChoosableFileFilter(filter);\n fileChooser.setAcceptAllFileFilterUsed(true);\n\n if (fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {\n path = fileChooser.getSelectedFile().getParent();\n FileLoader.saveFile(\"path.txt\", path, false);\n fileContent = FileLoader.loadFile(fileChooser.getSelectedFile().getAbsolutePath());\n TextEditor.setFileName(fileChooser.getSelectedFile().getAbsolutePath());\n TextEditor.getTextArea().setText(fileContent);\n }\n }", "private String readFile(String file) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n\n try (Stream<String> stream = Files.lines(Paths.get(file), StandardCharsets.UTF_8)) {\n stream.forEach(s -> contentBuilder.append(s));\n }\n\n return contentBuilder.toString();\n\n }", "public static void openTextFile() {\n\t\ttry {\n\t\t\tin1 = new Scanner(new File(file1));\n\t\t\tin2 = new Scanner(new File(file2));\n\t\t} catch(FileNotFoundException ex) {\n\t\t\tSystem.err.println(\"Error opening file\" + ex);\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "public void leseTextEin()\r\n\t{\n\t\tif( this.text != \"\" )\r\n\t\t\treturn;\r\n\t\t\r\n\t StringBuffer buffer = new StringBuffer();\r\n\t BufferedReader input = null;\r\n\t \r\n\t try \r\n\t {\r\n\t \tinput = new BufferedReader( new FileReader(this.dateipfad) );\r\n\t \tString line = null; \r\n\t \twhile ((line=input.readLine()) != null)\r\n\t \t{\r\n\t \t\tbuffer.append(line); \r\n\t \t\tbuffer.append(System.getProperty(\"line.separator\"));\r\n\t \t}\r\n\t }\r\n\t catch (IOException ex)\r\n\t { ex.printStackTrace(); }\r\n\t finally \r\n\t {\r\n\t \ttry\r\n\t \t{\r\n\t \t\tif (input!= null) \r\n\t \t\t\tinput.close();\r\n\t \t}\r\n\t \tcatch (IOException ex)\r\n\t \t{ ex.printStackTrace(); }\r\n\t }\r\n\t this.text = buffer.toString();\r\n\t}", "public static void encryptFile(File inFile, String pass) throws IOException, GeneralSecurityException {\n\t\tbyte[] decData;\n\t\tbyte[] encData;\n\n\t\tCipher cipher = FileEncryptor.makeCipher(pass, true);\n\t\tif (cipher == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tFileInputStream inStream = new FileInputStream(inFile);\n\t\tint blockSize = 8;\n\t\tint paddedCount = blockSize - ((int) inFile.length() % blockSize);\n\t\tint padded = (int) inFile.length() + paddedCount;\n\n\t\tdecData = new byte[padded];\n\t\tinStream.read(decData);\n\t\tinStream.close();\n\n\t\tfor (int i = (int) inFile.length(); i < padded; ++i) {\n\t\t\tdecData[i] = (byte) paddedCount;\n\t\t}\n\n\t\tencData = cipher.doFinal(decData);\n\t\tFileOutputStream outStream = new FileOutputStream(inFile);\n\t\toutStream.write(encData);\n\t\toutStream.close();\n\t}", "public String encrypt(String geheimtext);", "public static void decryptFile(File file, String pass) throws GeneralSecurityException, IOException {\n\t\tbyte[] encData;\n\t\tbyte[] decData;\n\n\t\tCipher cipher = FileEncryptor.makeCipher(pass, false);\n\t\tif (cipher == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tFile inFile = new File(file.getAbsolutePath() + \".tmp\");\n\t\tcopy(file.toPath(), inFile.toPath());\n\t\tFileInputStream inStream = new FileInputStream(inFile);\n\t\tencData = new byte[(int) inFile.length()];\n\t\tinStream.read(encData);\n\t\tinStream.close();\n\t\tdecData = cipher.doFinal(encData);\n\n\t\tint padCount = (int) decData[decData.length - 1];\n\n\t\tif (padCount >= 1 && padCount <= 8) {\n\t\t\tdecData = Arrays.copyOfRange(decData, 0, decData.length - padCount);\n\t\t}\n\n\t\tFileOutputStream target = new FileOutputStream(inFile);\n\t\ttarget.write(decData);\n\t\ttarget.close();\n\t}" ]
[ "0.6926417", "0.67512655", "0.66810083", "0.65449506", "0.576895", "0.5750334", "0.5740568", "0.57085997", "0.57060945", "0.56314886", "0.5616689", "0.56040823", "0.5588604", "0.55769867", "0.55652267", "0.55149835", "0.5483514", "0.54832304", "0.5467983", "0.5459097", "0.54535234", "0.5440188", "0.5430494", "0.542962", "0.5424735", "0.54024816", "0.5376081", "0.5373434", "0.535873", "0.53508604", "0.5348658", "0.5346813", "0.5310138", "0.529439", "0.529119", "0.52682954", "0.5252282", "0.5218307", "0.52065146", "0.5206107", "0.51983625", "0.51941466", "0.51919895", "0.519166", "0.51548874", "0.515214", "0.514566", "0.5135709", "0.51274365", "0.512509", "0.5122586", "0.51109016", "0.5107817", "0.5106044", "0.51052433", "0.5096458", "0.50938994", "0.50907713", "0.508134", "0.5068938", "0.50584614", "0.5055806", "0.5053693", "0.5051621", "0.50478387", "0.5041713", "0.50402313", "0.50378805", "0.503696", "0.50357175", "0.5017673", "0.50151813", "0.5013511", "0.5011316", "0.5010373", "0.5007057", "0.49975854", "0.49893075", "0.49751282", "0.49657395", "0.496129", "0.49601468", "0.49583006", "0.4957137", "0.49521956", "0.49390483", "0.49355543", "0.4930899", "0.4929891", "0.49267516", "0.49266553", "0.49263397", "0.49260986", "0.4920764", "0.49169952", "0.49139684", "0.4913718", "0.4906545", "0.48962784", "0.4896049" ]
0.5974969
4
It converts the encrypted data into binary data
public void binarycon() { int i,j,k,t; int temp[]=new int[10]; int m=0; for(i=0;i<600000;i++) binary[i]=0; int b[]=new int[32]; int dum; dum=max; i=0; while(dum!=0) { b[i]=dum%2; i=i+1; dum/=2; } j=24-i; for(k=j,t=i-1;k<(i+j);k++,t--) binary[k]=b[t]; dum=73; i=0; while(dum!=0) { b[i]=dum%2; i=i+1; dum/=2; } j=32-i; for(k=j,t=i-1;k<32;k++,t--) binary[k]= b[t]; m=32; for( i=0 ; i < max ; i++) { j=0; while( bytes[i]!= 0 ) { temp[j++]=bytes[i]%2; bytes[i]=bytes[i]/2; } for( k=0;k<8-j ; k++) binary[m++]=0; for(k=j-1; k >=0 ; k--) binary[m++]=temp[k]; } maxbinary=m; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public byte[] process(byte[] data) throws Exception {\r\n\t\t\tif (data == null || data.length != 8) {\r\n\t\t\t\tthrow new IllegalArgumentException(\"Argument 'data' must be 8 bytes (64 bits)\");\r\n\t\t\t}\r\n\t\t\tint transformedLength = cipher.getOutputSize(data.length);\r\n\t\t\tbyte[] transformedData = new byte[transformedLength];\r\n\t\t\tint tl1 = cipher.update(data, 0, data.length, transformedData, 0);\r\n\t\t\tint tl2 = tl1 + cipher.doFinal(transformedData, tl1);\r\n\t\t\treturn transformedData;\r\n\t\t}", "byte[] getData();", "byte[] getData();", "byte[] getData();", "byte[] getData();", "public byte[] encrypt(final byte[] data) throws Exception {\n final byte[] secret = new byte[] {42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42};\n final SecretKeySpec key = new SecretKeySpec(secret, \"AES\");\n\n final Cipher encryptCipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n encryptCipher.init(Cipher.ENCRYPT_MODE, key);\n final byte[] iv = encryptCipher.getIV();\n final byte[] encrypted = encryptCipher.doFinal(data);\n\n final int outputLength = encrypted.length;\n final int ivLength = iv.length;\n\n final byte[] results = new byte[outputLength + ivLength];\n System.arraycopy(iv, 0, results, 0, ivLength);\n System.arraycopy(encrypted, 0, results, ivLength, outputLength);\n\n return DatatypeConverter.printBase64Binary(encoded);\n}", "public abstract byte[] toByteArray();", "public abstract byte[] toByteArray();", "byte[] encrypt(String plaintext);", "public abstract byte[] getEncoded();", "public abstract byte[] toBytes() throws Exception;", "public static String encB64(byte[] data) {\n return Base64.encodeToString(data,Base64.DEFAULT);\n }", "byte[] decodeBytes();", "private byte[] toBytes(String obj){\n return Base64.getDecoder().decode(obj);\n }", "public static final byte[] encryptData(final byte data[]) {\n\n for (int j = 0; j < 6; j++) {\n byte remember = 0;\n byte dataLength = (byte) (data.length & 0xFF);\n // printByteArray(data);\n if (j % 2 == 0) {\n for (int i = 0; i < data.length; i++) {\n byte cur = data[i];\n cur = BitTools.rollLeft(cur, 3);\n cur += dataLength;\n cur ^= remember;\n remember = cur;\n cur = BitTools.rollRight(cur, (int) dataLength & 0xFF);\n cur = ((byte) ((~cur) & 0xFF));\n cur += 0x48;\n dataLength--;\n data[i] = cur;\n }\n } else {\n for (int i = data.length - 1; i >= 0; i--) {\n byte cur = data[i];\n cur = BitTools.rollLeft(cur, 4);\n cur += dataLength;\n cur ^= remember;\n remember = cur;\n cur ^= 0x13;\n cur = BitTools.rollRight(cur, 3);\n dataLength--;\n data[i] = cur;\n }\n }\n //System.out.println(\"enc after iteration \" + j + \": \" + HexTool.toString(data) + \" al: \" + al);\n }\n return data;\n }", "public byte[] getData();", "public byte[] packAllData1(byte[] data) {\n byte[] message = null;\n try{\n //CRC\n int crc16 = alisa.CRC.crc16(data, 0, data.length);\n byte hi = (byte)((crc16 >> 8) & 0xff);\n byte lo = (byte)(crc16 & 0xff);\n\n //crcData <- data + [hi][lo]\n byte[] crcData = new byte[data.length + 2];\n System.arraycopy(data, 0, crcData, 0, data.length);\n crcData[crcData.length-2] = hi;\n crcData[crcData.length-1] = lo;\n System.out.println(\"File-\" + this._id + \": key length = \" +this._key.length);\n byte[] secret = new Encode().encrypt(crcData, this._key);\n\n //check, can the encoded data be decode and crc?. before send it to server\n byte[] decode = new Encode().decrypt(secret, this._key);\n if(alisa.CRC.crc16(decode, 0, decode.length) != 0){\n System.out.println(\"File-\" + this._id + \": Wrong Encoding data!!\");\n return packAllData1(data);\n }\n\n System.out.println(\"File-\" + this._id + \": Password = \" +this._password + \"\\n\" + \"File-\" + this._id + \": Hash = \" + new String(this._key, \"ISO-8859-1\"));\n // //---------show crc data------------------------\n // String show2 = \"\";\n // for(int i =0; i < crcData.length; i++){\n // show2 += (int)crcData[i] + \" \";\n // }\n // System.out.println(\"File-\" + this._id + \" crcData: \" + show2);\n // //------------------------------------------\n // //---------show encnrypted data-----------------\n // String show3 = \"\";\n // for(int i =0; i < secret.length; i++){\n // show3 += (int)secret[i] + \" \";\n // }\n // System.out.println(\"File-\" + this._id + \" secret(no header): \" + show3);\n // //------------------------------------------\n // //---------show decnrypted data-----------------\n // String show4 = \"\";\n // for(int i =0; i < decode.length; i++){\n // show4 += (int)decode[i] + \" \";\n // }\n // System.out.println(\"File-\" + this._id + \" decodeed secret: \" + show4);\n // //------------------------------------------\n\n message = new byte[secret.length + 4];\n System.arraycopy(secret, 0, message, 3, secret.length);\n message[0] = (byte)255;\n message[1] = (byte)((this._id >> 8) & 0xff);\n message[2] = (byte)(this._id & 0xff);\n message[message.length-1] = (byte)254;\n }catch(Exception e){\n System.out.println(\"File-\" + this._id + \": packAllData Error\");\n try { Thread.sleep(this._interval); } catch (InterruptedException ex) { }\n return packAllData1(data);\n }\n return message;\n }", "public String encrypt(String key, byte[] data) throws IOException, InvalidCipherTextException {\n if (!data.equals(\"\")) {\n\n InputStream inData = new ByteArrayInputStream(data);\n ByteArrayOutputStream outData = new ByteArrayOutputStream();\n encrypt(key, inData, outData);\n\n byte[] byt = outData.toByteArray();\n\n return new String(org.bouncycastle.util.encoders.Base64.encode(byt));\n }\n return null;\n }", "public static byte[] decB64(String data) {\n return Base64.decode(data, Base64.DEFAULT);\n }", "public byte[] encrypt(String data, Key privatekey) {\r\n\t\tif (!presentkey) {\r\n\t\t\t//TODO\r\n\t\t\tkeyDiffieHellmanFirst();\r\n\t\t\t// need to send these values to other side\r\n\t\t\t// wait\r\n\t\t\tkeyDiffieHellmanFinal(//nummer uit packet from the other side);\r\n\t\t}\r\n\t\tbyte[] encrypt = OFB.EnDecrypt(data.getBytes(), diffie.getKey().toByteArray());\r\n\t\tString sign = ((Integer) data.hashCode()).toString();\r\n\t\tbyte[] signed = RSA.encrypt(sign, privatekey);\r\n\t\tbyte[] encrypted = new byte[encrypt.length + signed.length];\r\n\t\tSystem.arraycopy(encrypt, 0, encrypted, 0, encrypt.length);\r\n\t\tSystem.arraycopy(signed, 0, encrypted, encrypt.length, signed.length);\r\n\t\treturn encrypted;\r\n\t}", "byte[] encrypt(final byte[] dataToEncrypt) throws RegBaseCheckedException;", "public static byte[] base64ToByte(String data) throws IOException {\n BASE64Decoder decoder = new BASE64Decoder();\n return decoder.decodeBuffer(data);\n }", "public java.lang.String getEncryptedData() {\r\n return encryptedData;\r\n }", "public static String toBase64(byte[] data)\n {\n return Base64.encodeToString(data, Base64.NO_WRAP);\n }", "public static byte[] encryptText(String plainText,SecretKey secKey) throws Exception{\n\r\n Cipher aesCipher = Cipher.getInstance(\"AES\");\r\n\r\n aesCipher.init(Cipher.ENCRYPT_MODE, secKey);\r\n\r\n byte[] byteCipherText = aesCipher.doFinal(plainText.getBytes());\r\n\r\n return byteCipherText;\r\n\r\n}", "public void stringcon()\n {\n int i,j,k;\n int temp[]=new int[8];\n int a[]=new int[32];\n i=0;\n j=0;\n for(i=0;i<10000;i++)\n bytes[i]=0;\n i=0;\n maxbinary1=0;\n for(i=0;i<24;i++)\n a[i]=binary[i];\n for(i=0;i<24;i++)\n maxbinary1+=a[i]*Math.pow(2,23-i);\n maxbinary2=maxbinary1*8;\n ivalue=0;\n for(i=24,j=0;i<32;i++,j++)\n {\n a[j]=binary[i];\n ivalue+=a[j]*Math.pow(2,7-j);\n }\n if(ivalue==73)\n {\n i=32;\n while(i<maxbinary2)\n {\n for(k=0;k<=7;k++)\n temp[k]=binary[i++];\n for(k=0;k<=7;k++)\n bytes[j]+=temp[k]*Math.pow(2,7-k);\n j++;\n }\n String s=JOptionPane.showInputDialog(this,\"Enter key with 16 letters\");\n char ch[]=new char[s.length()];\n ch=s.toCharArray();\n try\n {\n FileOutputStream f=new FileOutputStream(\"key1.txt\");\n for(i=0;i<ch.length;i++)\n f.write(ch[i]);\n f.close();\n FileOutputStream fout=new FileOutputStream(\"enc1.txt\");\n DataOutputStream d=new DataOutputStream(fout);\n \t\ti=8;\n while(i<(maxbinary1))\n \t\t {\n \t\t\td.write(bytes[i]);\n\t\t i++;\n \t\t }\n fout.close();\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n\n ideaalgo b=new ideaalgo();\n b.procedure();\n b.decryption(\"enc1.txt\");\n try\n {\n BufferedReader d;\n StringBuffer sb=new StringBuffer();\n d=new BufferedReader(new FileReader(\"dec.txt\"));\n String line;\n while((line=d.readLine())!=null)\n sb.append(line+\"\\n\");\n ta.setText(sb.toString());\n d.close();\n }\ncatch(Exception e)\n {\n System.out.println(e);\n }\n }\n}", "public byte[] toBinary(JSONObject message) {\n\t\tString messageToConvert = message.toString();\n\t\tbyte[] converted = null;\n\t\ttry {\n\t\t\tconverted = messageToConvert.getBytes(\"UTF-8\");\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn converted;\n\t}", "private static String convertToHex(byte[] data) throws IOException {\n //create new instance of string buffer\n StringBuffer stringBuffer = new StringBuffer();\n String hex = \"\";\n\n //encode byte data with base64\n hex = Base64.getEncoder().encodeToString(data);\n stringBuffer.append(hex);\n\n //return string\n return stringBuffer.toString();\n }", "byte[] getBytes();", "byte[] getBytes();", "@Override\n public <T> byte[] serialize( final T obj )\n throws IOException\n {\n final byte[] unencrypted = serializer.serialize(obj);\n return encrypt(unencrypted);\n }", "public static String byteToBase64(byte[] data){\n BASE64Encoder endecoder = new BASE64Encoder();\n return endecoder.encode(data);\n }", "public byte[] getAsBytes() {\n return (byte[])data;\n }", "public static void main(String[] args) {\n \n byte[] cadena = null;\n byte[] cadenaEncriptada = null;\n byte[] cadenaDencriptada = null;\n String cadena2=\"Hola, bona tarda!, com estas? qqoepoepoepoepooepoepoepoepoepoe\";\n \n SecretKey key=null;\n \n cadena=cadena2.getBytes();\n key=keygenKeyGeneration(128);\n cadenaEncriptada=encryptData(key,cadena);\n System.out.println(cadena2);\n cadena2=cadenaEncriptada.toString();\n System.out.println(cadena2);\n cadenaDencriptada=dencryptData(key,cadenaEncriptada);\n String misstageDencriptat = new String(cadenaDencriptada);\n System.out.println(misstageDencriptat);\n \n }", "public doEncryptNotifdeEncode() {\n\t}", "public byte[] encryptDES(byte[] key, byte[] data) {\n\n try {\n SecretKey secretKey;\n SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(\"DES\");\n DESKeySpec desKeySpec = new DESKeySpec(key);\n\n secretKey = keyFactory.generateSecret(desKeySpec);\n\n secretKey = keyFactory.translateKey(secretKey);\n\n Cipher cipher = Cipher.getInstance(\"DES/ECB/NoPadding\");\n cipher.init(Cipher.ENCRYPT_MODE, secretKey);\n\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n try (CipherOutputStream cipherOS = new CipherOutputStream(bos, cipher)) {\n cipherOS.write(data);\n cipherOS.flush();\n }\n\n byte[] bytesEncrypted = bos.toByteArray();\n System.out.println(\"Encryption length is\\t\" + bytesEncrypted.length + ConvertUtils.bytesToHex(bytesEncrypted));\n\n return bytesEncrypted;\n\n } catch (UnsupportedEncodingException ex) {\n System.out.println(\"UnsupportedEncodingException\\t\" + ex.getMessage());\n } catch (NoSuchAlgorithmException ex) {\n System.out.println(\"NoSuchAlgorithmException\\t\" + ex.getMessage());\n } catch (InvalidKeySpecException ex) {\n System.out.println(\"InvalidKeySpecException\\t\" + ex.getMessage());\n } catch (InvalidKeyException ex) {\n System.out.println(\"InvalidKeyException\\t\" + ex.getMessage());\n }/*catch(IllegalBlockSizeException ex)\n {\n System.out.println(\"IllegalBlockSizeException\\t\"+ex.getMessage());\n }catch(BadPaddingException ex){\n System.out.println(\"BadPaddingException\\t\"+ex.getMessage());\n }*/ catch (NoSuchPaddingException ex) {\n System.out.println(\"NoSuchPaddingException\\t\" + ex.getMessage());\n } catch (IOException ex) {\n System.out.println(\"IOException\\t\" + ex.getMessage());\n }\n return null;\n }", "private static String encodeToBase64(byte[] data) {\n return Base64.encodeToString(data, BASE64_EFLAGS);\n }", "private String decrypt(String encryptedData) throws Exception {\n Key key = generateKey();\n Cipher c = Cipher.getInstance(ALGO);\n c.init(Cipher.DECRYPT_MODE, key);\n byte[] decordedValue = Base64.getDecoder().decode(encryptedData);\n byte[] decValue = c.doFinal(decordedValue);\n String result = new String(decValue);\n return result;\n }", "public static String encrypt(String data){\n\t\tif (data.equals(\"\") || data.equals(\"null\"))\n\t\t\treturn data;\n\t\ttry{\n\t\t\tjavax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance(CIPHER);\n\t\t\tcipher.init(javax.crypto.Cipher.ENCRYPT_MODE, new SecretKeySpec(ENCRYPTION_KEY.getBytes(Charset.forName(\"UTF-8\")), \"AES\"), new IvParameterSpec(new byte[16]));\n\t\t\tbyte[] encryptedBytes = cipher.doFinal(data.getBytes(Charset.forName(\"UTF-8\")));\n\t\t\treturn ENCRYPTION_PREFIX + new String(Base64.encodeBase64(encryptedBytes), Charset.forName(\"UTF-8\"));\n\t\t}catch (Exception e) {\n\t\t\tSystem.err.println( \"Error in EncryptionUtil.encrypt: \" + e );\n\t\t\treturn data;\n\t\t}\n\t}", "public abstract byte[] encode () throws IOException;", "public final static byte[] _encode(byte[] byteData) {\n\tif (byteData == null) {\n\t throw new IllegalArgumentException(\"byteData cannot be null\");\n\t}\n\n\t/*\n\t * Declare working variables including an array of bytes that will contain the encoded data to be returned to the caller. Note that the encoded array is about 1/3 larger than the input. This\n\t * is because every group of 3 bytes is being encoded into 4 bytes.\n\t */\n\tint iSrcIdx; // index into source (byteData)\n\tint iDestIdx; // index into destination (byteDest)\n\t// byte[] byteData = (byte[])byteData_in.clone();\n\t// byte[] byteData = byteData_in;\n\tbyte[] byteDest = new byte[((byteData.length + 2) / 3) * 4];\n\n\t/*\n\t * Walk through the input array, 24 bits at a time, converting them from 3 groups of 8 to 4 groups of 6 with two unset bits between. as per Base64 spec see\n\t * http://www.javaworld.com/javaworld/javatips/jw-javatip36-p2.html for example explanation\n\t */\n\tfor (iSrcIdx = 0, iDestIdx = 0; iSrcIdx < byteData.length - 2; iSrcIdx += 3) {\n\t byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx] >>> 2) & 077);\n\t byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx + 1] >>> 4) & 017 | (byteData[iSrcIdx] << 4) & 077);\n\t byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx + 2] >>> 6) & 003 | (byteData[iSrcIdx + 1] << 2) & 077);\n\t byteDest[iDestIdx++] = (byte) (byteData[iSrcIdx + 2] & 077);\n\t}\n\n\t/*\n\t * If the number of bytes we received in the input array was not an even multiple of 3, convert the remaining 1 or 2 bytes.\n\t */\n\tif (iSrcIdx < byteData.length) {\n\t byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx] >>> 2) & 077);\n\t if (iSrcIdx < byteData.length - 1) {\n\t\tbyteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx + 1] >>> 4) & 017 | (byteData[iSrcIdx] << 4) & 077);\n\t\tbyteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx + 1] << 2) & 077);\n\t } else\n\t\tbyteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx] << 4) & 077);\n\t}\n\n\t/*\n\t * Use the encoded data as indexes into the Base64 alphabet. (The Base64 alphabet is completely documented in RFC 1521.)\n\t */\n\tfor (iSrcIdx = 0; iSrcIdx < iDestIdx; iSrcIdx++) {\n\t if (byteDest[iSrcIdx] < 26)\n\t\tbyteDest[iSrcIdx] = (byte) (byteDest[iSrcIdx] + 'A');\n\t else if (byteDest[iSrcIdx] < 52)\n\t\tbyteDest[iSrcIdx] = (byte) (byteDest[iSrcIdx] + 'a' - 26);\n\t else if (byteDest[iSrcIdx] < 62)\n\t\tbyteDest[iSrcIdx] = (byte) (byteDest[iSrcIdx] + '0' - 52);\n\t else if (byteDest[iSrcIdx] < 63)\n\t\tbyteDest[iSrcIdx] = '+';\n\t else\n\t\tbyteDest[iSrcIdx] = '/';\n\t}\n\n\t/* Pad any unused bytes in the destination string with '=' characters. */\n\tfor (; iSrcIdx < byteDest.length; iSrcIdx++)\n\t byteDest[iSrcIdx] = '=';\n\n\treturn byteDest;\n }", "private String toBinary( byte[] bytes )\n\t{\n \t\tStringBuilder sb = new StringBuilder(bytes.length * Byte.SIZE);\n\t\tfor( int i = 0; i < Byte.SIZE * bytes.length; i++ )\n\t\t\tsb.append((bytes[i / Byte.SIZE] << i % Byte.SIZE & 0x80) == 0 ? '0' : '1');\n\t\treturn sb.toString();\n\t}", "public static byte[] dataStringToByteArray(String inDataString) throws JCavernInternalError\n\t{\n\t\tStringTokenizer aTokenizer = new StringTokenizer(inDataString);\n\t\tint\t\t\t\tindex = 0;\n\t\tbyte[]\t\t\ttheBytes = new byte[aTokenizer.countTokens()];\n\n\t\twhile (aTokenizer.hasMoreTokens())\n\t\t{\n\t\t\tString\taToken = aTokenizer.nextToken();\n\t\t\ttheBytes[index] = (byte) Integer.parseInt(aToken, 16);\n\t\t\tindex++;\n\t\t}\n\t\t\n\t\treturn theBytes;\n\t}", "public byte[] encrypt(final PrivateKeyInterface key, final byte[] data)\n {\n return this.encryptionCipher().encrypt(key, data);\n }", "static StringBuilder convert_to_binary(String msg) {\n byte[] bytes = msg.getBytes();\r\n StringBuilder binary = new StringBuilder();\r\n for (byte b : bytes) {\r\n int val = b;\r\n for (int i = 0; i < 8; i++) {\r\n binary.append((val & 128) == 0 ? 0 : 1);\r\n val <<= 1;\r\n }\r\n binary.append(\"\");\r\n }\r\n return binary;\r\n }", "public byte[] getByteData() { return bytedata; }", "public static byte[] fromBase64(String data)\n {\n return Base64.decode(data, Base64.NO_WRAP);\n }", "static public byte[] encode( byte[] binaryData ) {\n if (binaryData == null)\n return null;\n int lengthData = binaryData.length;\n int lengthEncode = lengthData * 2;\n byte[] encodedData = new byte[lengthEncode];\n for( int i = 0; i<lengthData; i++ ){\n encodedData[i*2] = lookUpHexAlphabet[ binaryData[i] >> 4];\n encodedData[i*2+1] = lookUpHexAlphabet[ binaryData[i] & 0xf];\n }\n return encodedData;\n }", "@Override\n public String convertToEntityAttribute(String dbData) {\n\n String message = null;\n\n try {\n Cipher cipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n KeyGenerator keyGenerator = KeyGenerator.getInstance(\"AES\");\n SecureRandom secureRandom = new SecureRandom();\n int keyBitSize = 256;\n keyGenerator.init(keyBitSize, secureRandom);\n SecretKey secretKey = keyGenerator.generateKey ();\n\n byte[] bytes = dbData.getBytes();\n cipher.init(Cipher.DECRYPT_MODE, secretKey);\n message = cipher.doFinal(bytes).toString();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return message;\n }", "Encryption encryption();", "public static String[] decryptAESBlock(byte[] data) {\n byte[] decrypted = CryptoUtil.decryptAESCBC(AES_DATA_KEY_BYTES, data);\n if (decrypted == null) {\n throw new RuntimeException(\"Failed to decrypt\");\n }\n\n int offset = 0;\n String[] result = new String[5];\n result[0] = HexUtil.byteArrayToHexString(decrypted, offset, 4);\n offset += 4;\n result[1] = HexUtil.byteArrayToHexString(decrypted, offset, 16);\n offset += 16;\n\n int index = -1;\n while (offset < decrypted.length && decrypted[offset] != 0) {\n int c = decrypted[offset] & 0xff;\n\n switch (c) {\n case 0xF1: {\n index = 2;\n result[index] = \"\";\n break;\n }\n case 0xF2: {\n index = 3;\n result[index] = \"\";\n break;\n }\n case 0xF3: {\n index = 4;\n result[index] = \"\";\n break;\n }\n default: {\n if (index != -1) {\n result[index] += (char) c;\n }\n }\n }\n offset++;\n }\n\n if (offset >= (decrypted.length - 2) || decrypted[offset] != 0\n || CryptoUtil.crcccit(decrypted, 0, offset + 1) != (((decrypted[offset + 1] & 0xff) << 8)) + (decrypted[offset + 2] & 0xff)) {\n throw new RuntimeException(\"Wrong key\");\n }\n\n return result;\n }", "public static String decryptText(byte[] byteCipherText, SecretKey secKey) throws Exception {\n\r\n Cipher aesCipher = Cipher.getInstance(\"AES\");\r\n\r\n aesCipher.init(Cipher.DECRYPT_MODE, secKey);\r\n\r\n byte[] bytePlainText = aesCipher.doFinal(byteCipherText);\r\n\r\n return new String(bytePlainText);\r\n\r\n}", "public byte[] toBytes() {\n return PaddingUtil.pad(\n PADDING,\n ByteArrayListUtil.merge(\n contactPublicKeyBytes,\n haNonce,\n haCiphertext,\n additionalData\n )\n );\n }", "public byte[] encryptStringToBytes(char[] sPlainText)\n\t{\n\t\tlong lCBCIV = _rnd.nextLong();\n\t\treturn encStrToBytes(sPlainText, lCBCIV);\n\t}", "public byte[] marshall();", "public byte[] getBytes(){\n\t\treturn m_EncKeyValue;\n\t}", "byte[] inflate(byte[] data) throws IOException;", "public String decrypt(final String encryptedBlob)\n throws GeneralSecurityException, IOException {\n final String methodName = \":decrypt\";\n Logger.v(TAG + methodName, \"Starting decryption\");\n\n if (StringExtensions.isNullOrBlank(encryptedBlob)) {\n throw new IllegalArgumentException(\"Input is empty or null\");\n }\n\n int encodeVersionLength = encryptedBlob.charAt(0) - 'a';\n if (encodeVersionLength <= 0) {\n final String message = String.format(\n \"Encode version length: '%s' is not valid, it must be greater of equal to 0. \" +\n \"Assuming string is not encrypted. Returning input blob.\",\n encodeVersionLength\n );\n Logger.w(TAG + methodName, message);\n return encryptedBlob;\n }\n\n if (!encryptedBlob.substring(1, 1 + encodeVersionLength).equals(ENCODE_VERSION)) {\n final String message = String.format(\n \"Unsupported encode version received. Encode version supported is: %s. \" +\n \"Assuming string is not encrypted. Returning input blob.\",\n ENCODE_VERSION\n );\n Logger.w(TAG + methodName, message);\n return encryptedBlob;\n }\n\n final byte[] bytes = Base64\n .decode(encryptedBlob.substring(1 + encodeVersionLength), Base64.DEFAULT);\n\n // get key version used for this data. If user upgraded to different\n // API level, data needs to be updated\n final String keyVersion = new String(bytes, 0, KEY_VERSION_BLOB_LENGTH,\n AuthenticationConstants.ENCODING_UTF8);\n Logger.i(TAG + methodName, \"\", \"Encrypt version:\" + keyVersion);\n\n final SecretKey secretKey = getKey(keyVersion);\n final SecretKey hmacKey = getHMacKey(secretKey);\n\n // byte input array: encryptedData-iv-macDigest\n final int ivIndex = bytes.length - DATA_KEY_LENGTH - HMAC_LENGTH;\n final int macIndex = bytes.length - HMAC_LENGTH;\n final int encryptedLength = ivIndex - KEY_VERSION_BLOB_LENGTH;\n if (ivIndex < 0 || macIndex < 0 || encryptedLength < 0) {\n throw new IOException(\"Invalid byte array input for decryption.\");\n }\n\n // Calculate digest again and compare to the appended value\n // incoming message: version+encryptedData+IV+Digest\n // Digest of EncryptedData+IV excluding key Version and digest\n final Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);\n final Mac mac = Mac.getInstance(HMAC_ALGORITHM);\n mac.init(hmacKey);\n mac.update(bytes, 0, macIndex);\n final byte[] macDigest = mac.doFinal();\n\n // Compare digest of input message and calculated digest\n assertHMac(bytes, macIndex, bytes.length, macDigest);\n\n // Get IV related bytes from the end and set to decrypt mode with\n // that IV.\n // It is using same cipher for different version since version# change\n // will mean upgrade to AndroidKeyStore and new Key.\n cipher.init(Cipher.DECRYPT_MODE, secretKey, new IvParameterSpec(bytes, ivIndex,\n DATA_KEY_LENGTH));\n\n // Decrypt data bytes from 0 to ivindex\n final String decrypted = new String(cipher.doFinal(bytes, KEY_VERSION_BLOB_LENGTH,\n encryptedLength), AuthenticationConstants.ENCODING_UTF8);\n Logger.v(TAG + methodName, \"Finished decryption\");\n return decrypted;\n }", "private byte[] encStrToBytes(char[] sPlainText, long lNewCBCIV)\n\t{\n\t\tint nI, nPos, nStrLen;\n\t\tchar cActChar;\n\t\tbyte bPadVal;\n\t\tbyte[] buf;\n\t\tint nNumBytes;\n\t\tnStrLen = sPlainText.length;\n\t\tnNumBytes = ((nStrLen << 1) & ~7) + 8;\n\t\tbuf = new byte[nNumBytes];\n\t\t// System.out.println(\"CBCIV = [\" + Long.toString(lNewCBCIV) + \"] hex = [\" + Long.toHexString(lNewCBCIV) + \"]\");\n\t\t// System.out.print(\"text = [\");\n\t\t// for (int i = 0; i < sPlainText.length; i++ ) {\n\t\t// System.out.print( sPlainText[i]);\n\t\t// System.out.print( \",\");\n\t\t// }\n\t\t// System.out.println(\"]\");\n\t\t// System.out.println(\"Alocated \" + nNumBytes + \" byte buffer\");\n\t\t// System.out.println(\"Buffer length = \" + buf.length + \" bytes\");\n\t\tnPos = 0;\n\t\tfor (nI = 0; nI < nStrLen; nI++)\n\t\t{\n\t\t\tcActChar = sPlainText[nI];\n\t\t\tbuf[nPos++] = (byte) ((cActChar >> 8) & 0x0ff);\n\t\t\tbuf[nPos++] = (byte) (cActChar & 0x0ff);\n\t\t}\n\t\tbPadVal = (byte) (buf.length - (nStrLen << 1));\n\t\twhile (nPos < buf.length)\n\t\t{\n\t\t\tbuf[nPos++] = bPadVal;\n\t\t}\n\t\t// int bytesPrinted = 0;\n\t\t// System.out.print(\"unencryp bytes=[\");\n\t\t// for (int i = 0; i < nNumBytes; i++){\n\t\t// System.out.print( (int)buf[i]);\n\t\t// System.out.print( \",\");\n\t\t// bytesPrinted++;\n\t\t// }\n\t\t// System.out.println(\"]\");\n\t\t// System.out.println(\"Buf length check \" + nNumBytes + \" = \" + buf.length);\n\t\t// System.out.println(\"Bytes printed = \" + bytesPrinted);\n\t\tm_bfc.setCBCIV(lNewCBCIV);\n\t\tm_bfc.encrypt(buf, 0, buf, 0, buf.length);\n\t\t// System.out.println(\"Encrypted buffer length = \" + buf.length + \" bytes\");\n\t\t// System.out.print(\" encryp bytes=[\");\n\t\t// for (int i = 0; i < nNumBytes; i++){\n\t\t// System.out.print( buf[i]);\n\t\t// System.out.print( \",\");\n\t\t// }\n\t\t// System.out.println(\"]\");\n\t\tint totalNumBytes = EQBlowfishECB.BLOCKSIZE + buf.length;\n\t\tbyte[] result = new byte[totalNumBytes];\n\t\tEQBinConverter.longToByteArray(lNewCBCIV, result, 0);\n\t\tint count = 0;\n\t\tfor (int i = EQBlowfishECB.BLOCKSIZE; i < totalNumBytes; i++)\n\t\t{\n\t\t\tresult[i] = buf[count++];\n\t\t}\n\t\t// System.out.print(\" CBCIV bytes=[\");\n\t\t// for (int i = 0; i < EQBlowfishCBC.BLOCKSIZE; i++){\n\t\t// System.out.print( result[i]);\n\t\t// System.out.print( \",\");\n\t\t// }\n\t\t// System.out.println(\"]\");\n\t\t// System.out.println(\"Final Buffer length = \" + result.length + \" bytes\");\n\t\t// System.out.print(\" final bytes=[\");\n\t\t// for (int i = 0; i < totalNumBytes; i++){\n\t\t// System.out.print( result[i]);\n\t\t// System.out.print( \",\");\n\t\t// }\n\t\t// System.out.println(\"]\");\n\t\treturn result;\n\t}", "public static byte[] encode(String key, byte[] data) {\n\t //.locals 11\n\t //.parameter \"key\"\n\t //.parameter \"data\"\n\t\t//.local v0, dataLen:I\n\t //.local v2, keyData:[B\n\t\t//.local v4, result:[B\n\t\t//.local v3, keyXor:B\n\t \n\t //.prologue\n\t //const/4 v10, 0x1\n\t\t//const/4 v9, 0x0\n\t\t//.line 5\n\t //invoke-virtual {p0}, Ljava/lang/String;->getBytes()[B \n\t //move-result-object v2\n\t byte[] keyData = key.getBytes();\n\t //.line 7\n\t //.local v2, keyData:[B\n\t //array-length v0, p1\n\t int dataLen = data.length;\n\t //.line 8\n\t //.local v0, dataLen:I\n\t //array-length v7, v2\n\t //add-int/2addr v7, v0\n\t //new-array v4, v7, [B\n\t byte[] result = new byte[keyData.length + dataLen];\n\t //.line 10\n\t //.local v4, result:[B\n\t //aget-byte v3, v2, v9\n\t byte keyXor = keyData[0];\n\t //.line 13\n\t //.local v3, keyXor:B\n\t \n\t //const/4 v1, 0x0\n\t //.local v1, i:I\n\t //:goto_0\n\t //if-lt v1, v0, :cond_0\n\t for (int i = 0;i < dataLen; i++) {\n\t \t//goto :cond_0;\n\t\n\t \t//.line 14\n\t //.end local v5 #resultLength:I\n\t \t//:cond_0\n\t //aget-byte v7, p1, v1\n\t //xor-int/2addr v7, v3\n\t //int-to-byte v7, v7\n\t //aput-byte v7, v4, v1\n\t result[i] = (byte)(data[i]^keyXor);\n\t //.line 15\n\t //aget-byte v3, v4, v1\n\t keyXor = result[i];\n\t //.line 13\n\t //add-int/lit8 v1, v1, 0x1\n\t //goto :goto_0\n\t }\n\t \n\t \n\n\t\t//.local v0, dataLen:I\n\t //.local v2, keyData:[B\n\t\t//.local v4, result:[B\n\t\t//.local v3, keyXor:B\n\t \n\t //.line 17\n\t //const/4 v1, 0x0\n\t //:goto_1;\n\t //array-length v7, v2\n\t //if-lt v1, v7, :cond_1\n\t for (int i = 0; i < keyData.length; i++) {\n\t \t//goto :cond_1;\n\t \t//.line 18\n\t //:cond_1\n\t //add-int v7, v1, v0\n\t \t//aget-byte v8, v2, v1\n\t \t//xor-int/2addr v8, v3\n\t \t//int-to-byte v8, v8\n\t //aput-byte v8, v4, v7\n\t \tresult[i + dataLen] = (byte) (keyData[i] ^ keyXor);\n\t //.line 19\n\t //add-int v7, v1, v0\n\t //aget-byte v3, v4, v7\n\t keyXor = result[i + dataLen];\n\t //.line 17\n\t //add-int/lit8 v1, v1, 0x1\n\t //goto :goto_1\n\t }\n\t\n\t //.line 22\n\t //array-length v5, v4\n\t int resultLength = result.length;\n\t //.line 24\n\t //.local v5, resultLength:I\n\t //const/4 v1, 0x0\n\t //:goto_2\n\t //shr-int/lit8 v7, v5, 0x1\n\t //if-lt v1, v7, :cond_2\n\t for (int i = 0; i < (resultLength >> 1); i++) {\n\t \t//goto :cond_2;\n\t \t\n\t \t//.line 25\n\t //.restart local v5 #resultLength:I\n\t //:cond_2\n\t //aget-byte v6, v4, v1\n\t byte tmp = result[i];\n\t //.line 26\n\t //.local v6, tmp:B\n\t //sub-int v7, v5, v1\n\t //sub-int/2addr v7, v10\n\t //aget-byte v7, v4, v7\n\t //aput-byte v7, v4, v1\n\t result[i] = result[resultLength - i - 1];\n\t //.line 27\n\t //sub-int v7, v5, v1\n\t //sub-int/2addr v7, v10\n\t //aput-byte v6, v4, v7\n\t result[resultLength - i - 1] = tmp;\n\t //.line 24\n\t //add-int/lit8 v1, v1, 0x1\n\t //goto :goto_2\n\t }\n\t \n\t //.line 30\n\t //aget-byte v3, v2, v9\n\t keyXor = keyData[0];\n\t //.line 31\n\t //const/4 v1, 0x0\n\t //:goto_3\n\t //if-lt v1, v5, :cond_3\n\t for (int i=0; i < resultLength; i++) {\n\t \t//goto :cond_3;\n\t \t//.line 32\n\t //.end local v6 #tmp:B\n\t //:cond_3\n\t //aget-byte v7, v4, v1\n\t //xor-int/2addr v7, v3\n\t //int-to-byte v7, v7\n\t //aput-byte v7, v4, v1\n\t result[i] = (byte)(result[i] ^ keyXor);\n\t //.line 33\n\t //aget-byte v3, v4, v1\n\t keyXor = result[i];\n\t //.line 31\n\t //add-int/lit8 v1, v1, 0x1\n\t //goto :goto_3\n\t }\n\t\n\t //.line 36\n\t //return-object v4\n\t return result;\n\t}", "public byte[] encriptarArchivo (String nombreArchivo, String key, String ruta) throws Exception{\n\n \n FileInputStream fileInputStream = null;\n byte[] encrypted = null;\n File file = new File(nombreArchivo);\n byte[] archivo = new byte[(int) file.length()];\n\n //Convertir archivo a bytes[]\n fileInputStream = new FileInputStream(file);\n fileInputStream.read(archivo);\n //llamada a libreria de encriptacion\n encrypted = encrypt(archivo, key);\n Path archivo_enc = Paths.get(ruta);\n //Creacion de archivo encriptado \n Files.write(archivo_enc, encrypted);\n \n return encrypted;\n \n }", "private void encryptionAlgorithm() {\n\t\ttry {\n\t\t\t\n\t\t\tFileInputStream fileInputStream2=new FileInputStream(\"D:\\\\program\\\\key.txt\");\n\t\t\tchar key=(char)fileInputStream2.read();\n\t\t\tSystem.out.println(key);\n\t\t\tFileInputStream fileInputStream1=new FileInputStream(\"D:\\\\program\\\\message.txt\");\n\t\t\tint i=0;\n\t\t\t\n\t\t\tStringBuilder message=new StringBuilder();\n\t\t\twhile((i= fileInputStream1.read())!= -1 )\n\t\t\t{\n\t\t\t\tmessage.append((char)i);\n\t\t\t}\n\t\t\tString s=message.toString();\n\t\t\tchar[] letters=new char[s.length()];\n\t\t\tStringBuilder en=new StringBuilder();\n\t\t\tfor(int j = 0;j < letters.length;j++)\n\t\t\t{\n\t\t\t\ten.append((char)(byte)letters[j]+key);\n\t\t\t}\t\t\n\t\t\tFileOutputStream fileoutput=new FileOutputStream(\"D:\\\\program\\\\encryptedfile.txt\");\n\t\t\t\n\t\t\tfileInputStream1.close();\n\t\t\tfileInputStream2.close();\n\t\t\t\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t\n\t}", "OutputFile encryptingOutputFile();", "public byte[] encrypt(final PublicKeyInterface key, final byte[] data)\n {\n return this.encryptionCipher().encrypt(key, data);\n }", "public byte[] asByteArray() {\n return data;\n }", "public static byte[] getEncryptRawKey() {\n\n try {\n /*byte[] bytes64Key = App.RealmEncryptionKey.getBytes(\"UTF-8\");\n KeyGenerator kgen = KeyGenerator.getInstance(\"AES\");\n SecureRandom sr = SecureRandom.getInstance(\"SHA1PRNG\");\n sr.setSeed(bytes64Key);\n kgen.init(128, sr);\n SecretKey skey = kgen.generateKey();\n byte[] raw = skey.getEncoded();*/\n\n byte[] key = new BigInteger(App.RealmEncryptionKey, 16).toByteArray();\n return key;\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n }", "default void sendBinary(byte[] data) {\n ByteBuffer buffer = ByteBuffer.wrap(data);\n sendBinary(buffer);\n }", "@Test\n public void testEncodeDecodeBase64() {\n ///////////////////////////////\n // plaintext=\"Text to convert.\";\n plaintext=\"ABCDEFGHIJKLMNOPQRSTUPVWYZ123456789\";\n /////////////////////////////////\n System.out.println(\"Convert following text: \"+plaintext);\n \n System.out.println(\"::encodeBase64::\");\n \n byte[] plaindata = plaintext.getBytes();\n byte[] tmp = Base64Encoder.encodeBase64(plaindata);\n this.storeEncoding=new String(tmp);\n System.out.println(storeEncoding);\n System.out.println(\"::decodeBase64::\");\n byte[] base64Message = this.storeEncoding.getBytes();\n byte[] expResult = plaindata;\n byte[] result = Base64Encoder.decodeBase64(base64Message);\n String decodedText=new String(result);\n System.out.println(\"Decoded Text: \"+decodedText);\n assertArrayEquals(expResult, result);\n }", "public /*byte[]*/String BinaryCaster(Object item){\n String Sitem = Integer.toBinaryString((int)item);\n //byte[] b = new byte[Sitem.length()];\n //for(int i=0;i<Sitem.length();i++){\n // b[i] = (byte)Sitem.charAt(i);\n //}\n //return b;\n return Sitem;\n }", "public static byte[] decode(String data) {\n\t\treturn Base64.getDecoder().decode(data);\n\t}", "public void invoke() throws Exception {\n\tchar[] DIGITS = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };\n\t \ntry\n{\n int l = in_data.length;\n\n char[] out = new char[l << 1];\n\n // two characters form the hex value.\n for (int i = 0, j = 0; i < l; i++) {\n out[j++] = DIGITS[(0xF0 & in_data[i]) >>> 4];\n out[j++] = DIGITS[0x0F & in_data[i]];\n }\n\n\tout_data = new String(out);\n\n} catch (Exception e) {\n\t System.out.println(\"-------------------------\");\n\t System.out.println(\"doEncryptNotif ERROR: \" + e.getMessage() + \".\");\n\t System.out.println(\"-------------------------\");\n\t throw e;\n} \n\n\t}", "public static byte[] encryptAES2Base64(final byte[] data,\n final byte[] key,\n final String transformation,\n final byte[] iv) {\n return base64Encode(encryptAES(data, key, transformation, iv));\n }", "public static String encode(byte[] data) {\t\t\n\t\tif (data == null || data.length == 0) {\n\t\t\treturn \"\";\n\t\t}\n\t\t\n\t\tStringBuilder resultBuffer = new StringBuilder();\n\t\t//mod\n\t\tint m = data.length % 3;\n\t\t//amount of data group with 3 byte\n\t\tint g = (m == 0) ? (data.length / 3) : (data.length / 3 + 1);\n\t\tfinal byte[] _clear_buff = {0, 0, 0};\n\t\tbyte[] dataBuffer = new byte[3];\n\t\tchar[] codeBuffer = new char[4];\n\t\tint offset = 0;\n\t\tfor (int i = 0; i < g; ++i) {\n\t\t\t//clear buffer\n\t\t\tSystem.arraycopy(_clear_buff, 0, dataBuffer, 0, 3);\n\t\t\t//copy data for handling\n\t\t\tint copySize = (m != 0 && i == g - 1) ? m : 3;\n\t\t\tSystem.arraycopy(data, offset, dataBuffer, 0, copySize);\n\t\t\t//concatenate the byte data buffer as an integer\n\t\t\tint tmp = 0x00000000;\n\t\t\tfor (int j = 0, z = 2; j < 3; ++j, --z) {\n\t\t\t\tint tt = ((dataBuffer[j] & 0xff) << (z * 8));\n\t\t\t\ttmp ^= tt;\n\t\t\t}\n\t\t\t//encode current data buffer with base64\n\t\t\tfor (int k = 0; k < 4; ++k) {\n\t\t\t\tint p = (tmp >> (k * 6)) & 0x0000003F;\n\t\t\t\tcodeBuffer[3 - k] = _dict_[p];\n\t\t\t}\n\t\t\t\n\t\t\tif (copySize != 3) {\n\t\t\t\tfor (int e = 0; e < 3 - copySize; ++e) {\n\t\t\t\t\tcodeBuffer[3 - e] = '=';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tresultBuffer.append(codeBuffer);\n\t\t\toffset += 3;\n\t\t}\n\t\t\n\t\tString encodeText = resultBuffer.toString();\n\t\tresultBuffer.delete(0, resultBuffer.length());\n\t\treturn encodeText;\n\t}", "public byte[] toByteArray() throws IOException{\r\n ByteArrayOutputStream ba = new ByteArrayOutputStream();\r\n DataOutputStream dos = new DataOutputStream(ba);\r\n\r\n dos.writeUTF(this.nome);\r\n dos.writeUTF(this.email);\r\n dos.writeUTF(this.endereco);\r\n // System.out.println(ba);\r\n \r\n return ba.toByteArray();\r\n }", "ByteArray(String s) {\n\tdata = StringConverter.hexToByte(s);\n }", "default byte[] decodificarBase64(String archivoBase64) {\n\t\treturn Base64.getDecoder().decode(archivoBase64);\n\t}", "public byte[] toBytes()\n {\n String rep = sessionid + \"_\" + version + \"_\" + message;\n return rep.getBytes();\n }", "byte[] readBytes();", "private void prga(){\n int i = 0;\n int a = 0;\n int b = 0;\n StringBuilder sb = new StringBuilder();\n fileEncrypted.clear();\n\n byte[] code = new byte[filePlain.size()];\n while (i<filePlain.size()){\n a = (a + 1) % 256;\n b = (b + s_box.get(a)) % 256;\n Collections.swap(s_box, a, b);\n\n int key_int = s_box.get((s_box.get(a) + s_box.get(b))% 256);\n byte cypher = (byte) (key_int^filePlain.get(i));\n\n fileEncrypted.add(cypher);\n sb.append((char)cypher);\n code[i] = cypher;\n i++;\n }\n\n System.out.println(\"aaa\");\n// export file\n Helper.exportFile(code, extension, true);\n }", "com.google.protobuf.ByteString\n getEncodedBytes();", "public String encrypt(final String clearText)\n throws GeneralSecurityException, IOException {\n final String methodName = \":encrypt\";\n Logger.v(TAG + methodName, \"Starting encryption\");\n\n if (StringExtensions.isNullOrBlank(clearText)) {\n throw new IllegalArgumentException(\"Input is empty or null\");\n }\n\n // load key for encryption if not loaded\n mKey = loadSecretKeyForEncryption();\n mHMACKey = getHMacKey(mKey);\n\n Logger.i(TAG + methodName, \"\", \"Encrypt version:\" + mBlobVersion);\n final byte[] blobVersion = mBlobVersion.getBytes(AuthenticationConstants.ENCODING_UTF8);\n final byte[] bytes = clearText.getBytes(AuthenticationConstants.ENCODING_UTF8);\n\n // IV: Initialization vector that is needed to start CBC\n final byte[] iv = new byte[DATA_KEY_LENGTH];\n mRandom.nextBytes(iv);\n final IvParameterSpec ivSpec = new IvParameterSpec(iv);\n\n // Set to encrypt mode\n final Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);\n final Mac mac = Mac.getInstance(HMAC_ALGORITHM);\n cipher.init(Cipher.ENCRYPT_MODE, mKey, ivSpec);\n\n final byte[] encrypted = cipher.doFinal(bytes);\n\n // Mac output to sign encryptedData+IV. Keyversion is not included\n // in the digest. It defines what to use for Mac Key.\n mac.init(mHMACKey);\n mac.update(blobVersion);\n mac.update(encrypted);\n mac.update(iv);\n final byte[] macDigest = mac.doFinal();\n\n // Init array to store blobVersion, encrypted data, iv, macdigest\n final byte[] blobVerAndEncryptedDataAndIVAndMacDigest = new byte[blobVersion.length\n + encrypted.length + iv.length + macDigest.length];\n System.arraycopy(blobVersion, 0, blobVerAndEncryptedDataAndIVAndMacDigest, 0,\n blobVersion.length);\n System.arraycopy(encrypted, 0, blobVerAndEncryptedDataAndIVAndMacDigest,\n blobVersion.length, encrypted.length);\n System.arraycopy(iv, 0, blobVerAndEncryptedDataAndIVAndMacDigest, blobVersion.length\n + encrypted.length, iv.length);\n System.arraycopy(macDigest, 0, blobVerAndEncryptedDataAndIVAndMacDigest, blobVersion.length\n + encrypted.length + iv.length, macDigest.length);\n\n final String encryptedText = new String(Base64.encode(blobVerAndEncryptedDataAndIVAndMacDigest,\n Base64.NO_WRAP), AuthenticationConstants.ENCODING_UTF8);\n Logger.v(TAG + methodName, \"Finished encryption\");\n\n return getEncodeVersionLengthPrefix() + ENCODE_VERSION + encryptedText;\n }", "public native static long getConvertBytes();", "private static void writeBinaryData(int id, InputStream data, File f) throws IOException {\n \n XMLOutputFactory factory = XMLOutputFactory.newInstance();\n try {\n XMLStreamWriter writer = factory.createXMLStreamWriter(new FileWriter(f));\n\n writer.writeStartDocument(PlanXMLConstants.ENCODING,\"1.0\");\n writer.writeStartElement(\"data\");\n writer.writeAttribute(\"id\", \"\" + id);\n\n Base64InputStream base64EncodingIn = new Base64InputStream( data, true, PlanXMLConstants.BASE64_LINE_LENGTH, PlanXMLConstants.BASE64_LINE_BREAK);\n \n OutputStream out = new WriterOutputStream(new XMLStreamContentWriter(writer) , PlanXMLConstants.ENCODING);\n // read the binary data and encode it on the fly\n IOUtils.copy(base64EncodingIn, out);\n out.flush();\n \n // all data is written - end \n writer.writeEndElement();\n writer.writeEndDocument();\n\n writer.flush();\n writer.close();\n\n } catch (XMLStreamException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } \n }", "public static byte [] encrypt(byte [] plainText, PublicKey encryptionKey) {\r\n\t\tif(plainText == null) return null;\r\n\t\t// needed len = wrappedKey + E[ encodedVerificationKey + Signature + plainText ]\r\n\t\tbyte [] outputBuffer = new byte[plainText.length+MIN_BUF_SIZE];\r\n\t\ttry {\r\n\t\t\t// generate a secret symmetric key\r\n\t\t\tKeyGenerator keyGenerator = KeyGenerator.getInstance(symmetricKeyAlgorithm);\r\n\t\t\tkeyGenerator.init(SYMMETRIC_KEY_LENGTH);\r\n\t\t\tSecretKey secretKey = keyGenerator.generateKey();\r\n\t\t\t// encrypt (wrap) the secret symmetric key using the public encryption key of the receiver\r\n\t\t\tCipher wrapper = Cipher.getInstance(encryptionAlgorithm);\r\n\t\t\twrapper.init(Cipher.WRAP_MODE, encryptionKey);\r\n\t\t\tbyte [] wrappedSecretKey = wrapper.wrap(secretKey);\r\n\r\n\t\t\t// place the length of the wrappedKey followed by the wrapped key into the output buffer at outputBuffer[0]\r\n\t\t\t// cursor points to the next available location in outputBuffer\r\n\t\t\tint cursor = packToByteArray(wrappedSecretKey, outputBuffer, 0);\r\n\t\t\tint encryptionCursor = cursor;\t// marker for start of encryption\r\n\r\n\t\t\t// add the length of the plain text to the message. We only push the length\r\n\t\t\t// of the message into the buffer, because we can do encryption in steps and avoid copies\r\n\t\t\toutputBuffer[cursor] = (byte)((plainText.length & 0xff00) >>> 8);\t// msb of plainText\r\n\t\t\toutputBuffer[cursor+1] = (byte)(plainText.length & 0xff);\t\t\t// lsb of plainText\r\n\t\t\tcursor += 2;\r\n\r\n\t\t\t// encrypt the message {PkLen,PublicKey,SLen,Signature,PtLen,PlainText}\r\n\t\t\tCipher encryptor = Cipher.getInstance(symmetricKeyAlgorithm);\r\n\t\t\tencryptor.init(Cipher.ENCRYPT_MODE, secretKey);\r\n\t\t\t// encrypt upto the cursor, and reset cursor to point to the end of the encrypted stream in the output buffer\r\n\t\t\tcursor = encryptionCursor + encryptor.update(outputBuffer,encryptionCursor,cursor-encryptionCursor,outputBuffer,encryptionCursor);\r\n\t\t\t// encrypt the plain text. Cursor points to the end of the output buffer\r\n\t\t\tcursor += encryptor.doFinal(plainText, 0, plainText.length, outputBuffer, cursor);\r\n\r\n\t\t\t// return the encrypted bytes\r\n\t\t\treturn Arrays.copyOfRange(outputBuffer, 0, cursor);\r\n\t\t} catch(Exception e){\r\n\t\t\tlogger.log(Level.WARNING,\"Unable to encrypt message \"+new String(Arrays.copyOf(plainText, 10))+\"...\",e);\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static byte[] encryptMD2(final byte[] data) {\n return hashTemplate(data, \"MD2\");\n }", "public byte[] encryptPassword(String password) {\n byte[] encodedBytes = null;\n\n try {\n Cipher c = Cipher.getInstance(\"AES\");\n c.init(Cipher.ENCRYPT_MODE, sks);\n encodedBytes = c.doFinal(password.getBytes());\n } catch (Exception e) {\n Log.e(TAG, \"AES encryption error\");\n }\n\n //String encryptedText = Base64.encodeToString(encodedBytes, Base64.DEFAULT);\n\n //Log.v(\"Encrypted Text\", encryptedText);\n\n return encodedBytes;\n }", "public static byte[] encryptBase64(final byte[] input, final PublicKey key) throws DattackSecurityException {\n return Base64.getEncoder().encode(execEncryptionOperation(input, Cipher.ENCRYPT_MODE, key));\n }", "public void onDataEncoded(byte[] encodedData);", "public byte[] GetBytes() {\n return data;\n }", "private byte[] encode(byte[] msg) {\r\n\t\treturn Base64.encode(msg);\r\n\t}", "protected abstract byte[] encode(Object o) throws EncoderException;", "public void convert_Hex_To_Binary(String hex) {\n String binary_string = hexToBinary(hex, true);\n int[] data = new int[64];\n for (int k = 0; k < data.length; k++)\n data[k] = Character.getNumericValue(binary_string.charAt(k));\n key_user = data;\n }", "public static byte[] To_Byte_Array (String filename) throws java.security.NoSuchAlgorithmException {\n byte[] data = null;\n // MessageDigest hash = MessageDigest.getInstance(\"SHA-512\");//SHA2 //removed\n\n //Streams, in:\n File textFile;//Textdatei\n FileInputStream in;//Dateieingabe-Stream\n\n try {\n\n textFile = new File(filename);\n in = new FileInputStream(textFile);\n int size = (int)textFile.length(); // Dateilaenge\n int read = 0; // Anzahl der gelesenen Zeichen\n data = new byte[size]; // Lesepuffer\n // Auslesen der Datei\n while (read < size)\n read =+ in.read(data, read, size-read);\n in.close();\n // Schreiben des Lesepuffers in Instanz von MessageDigest und speichern des Hash-Werts in message\n //hash.update (data);//removed\n //message=hash.digest ();//removed\n\n\n }//try\n catch (IOException ex) {\n ex.printStackTrace();\n }\n return data;//added\n }", "byte[] getEncoded() {\n return hmacKey.getEncoded();\n }", "protected int writeEncrypted()\n throws IOException\n {\n int cb = f_delegate.write(f_buffEncOut);\n\n if (!f_buffEncOut.hasRemaining())\n {\n endProtocol();\n }\n return cb;\n }", "private String encrypt(String plainData) throws Exception {\n Key key = generateKey();\n Cipher c = Cipher.getInstance(ALGO);\n c.init(Cipher.ENCRYPT_MODE, key);\n byte[] encValue = c.doFinal(plainData.getBytes());\n return Base64.getEncoder().encodeToString(encValue);\n }", "public static String encode(byte[] binaryData) {\n \n if (binaryData == null)\n return null;\n \n int lengthDataBits = binaryData.length*EIGHTBIT;\n if (lengthDataBits == 0) {\n return \"\";\n }\n \n int fewerThan24bits = lengthDataBits%TWENTYFOURBITGROUP;\n int numberTriplets = lengthDataBits/TWENTYFOURBITGROUP;\n int numberQuartet = fewerThan24bits != 0 ? numberTriplets+1 : numberTriplets;\n int numberLines = (numberQuartet-1)/19+1;\n char encodedData[] = null;\n \n encodedData = new char[numberQuartet*4+numberLines];\n \n byte k=0, l=0, b1=0,b2=0,b3=0;\n \n int encodedIndex = 0;\n int dataIndex = 0;\n int i = 0;\n if (fDebug) {\n System.out.println(\"number of triplets = \" + numberTriplets );\n }\n \n for (int line = 0; line < numberLines-1; line++) {\n for (int quartet = 0; quartet < 19; quartet++) {\n b1 = binaryData[dataIndex++];\n b2 = binaryData[dataIndex++];\n b3 = binaryData[dataIndex++];\n \n if (fDebug) {\n System.out.println( \"b1= \" + b1 +\", b2= \" + b2 + \", b3= \" + b3 );\n }\n \n l = (byte)(b2 & 0x0f);\n k = (byte)(b1 & 0x03);\n \n byte val1 = ((b1 & SIGN)==0)?(byte)(b1>>2):(byte)((b1)>>2^0xc0);\n \n byte val2 = ((b2 & SIGN)==0)?(byte)(b2>>4):(byte)((b2)>>4^0xf0);\n byte val3 = ((b3 & SIGN)==0)?(byte)(b3>>6):(byte)((b3)>>6^0xfc);\n \n if (fDebug) {\n System.out.println( \"val2 = \" + val2 );\n System.out.println( \"k4 = \" + (k<<4));\n System.out.println( \"vak = \" + (val2 | (k<<4)));\n }\n \n encodedData[encodedIndex++] = lookUpBase64Alphabet[ val1 ];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ val2 | ( k<<4 )];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ (l <<2 ) | val3 ];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ b3 & 0x3f ];\n \n i++;\n }\n encodedData[encodedIndex++] = 0xa;\n }\n \n for (; i<numberTriplets; i++) {\n b1 = binaryData[dataIndex++];\n b2 = binaryData[dataIndex++];\n b3 = binaryData[dataIndex++];\n \n if (fDebug) {\n System.out.println( \"b1= \" + b1 +\", b2= \" + b2 + \", b3= \" + b3 );\n }\n \n l = (byte)(b2 & 0x0f);\n k = (byte)(b1 & 0x03);\n \n byte val1 = ((b1 & SIGN)==0)?(byte)(b1>>2):(byte)((b1)>>2^0xc0);\n \n byte val2 = ((b2 & SIGN)==0)?(byte)(b2>>4):(byte)((b2)>>4^0xf0);\n byte val3 = ((b3 & SIGN)==0)?(byte)(b3>>6):(byte)((b3)>>6^0xfc);\n \n if (fDebug) {\n System.out.println( \"val2 = \" + val2 );\n System.out.println( \"k4 = \" + (k<<4));\n System.out.println( \"vak = \" + (val2 | (k<<4)));\n }\n \n encodedData[encodedIndex++] = lookUpBase64Alphabet[ val1 ];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ val2 | ( k<<4 )];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ (l <<2 ) | val3 ];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ b3 & 0x3f ];\n }\n \n // form integral number of 6-bit groups\n if (fewerThan24bits == EIGHTBIT) {\n b1 = binaryData[dataIndex];\n k = (byte) ( b1 &0x03 );\n if (fDebug) {\n System.out.println(\"b1=\" + b1);\n System.out.println(\"b1<<2 = \" + (b1>>2) );\n }\n byte val1 = ((b1 & SIGN)==0)?(byte)(b1>>2):(byte)((b1)>>2^0xc0);\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ val1 ];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ k<<4 ];\n encodedData[encodedIndex++] = PAD;\n encodedData[encodedIndex++] = PAD;\n } else if (fewerThan24bits == SIXTEENBIT) {\n b1 = binaryData[dataIndex];\n b2 = binaryData[dataIndex +1 ];\n l = ( byte ) ( b2 &0x0f );\n k = ( byte ) ( b1 &0x03 );\n \n byte val1 = ((b1 & SIGN)==0)?(byte)(b1>>2):(byte)((b1)>>2^0xc0);\n byte val2 = ((b2 & SIGN)==0)?(byte)(b2>>4):(byte)((b2)>>4^0xf0);\n \n encodedData[encodedIndex++] = lookUpBase64Alphabet[ val1 ];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ val2 | ( k<<4 )];\n encodedData[encodedIndex++] = lookUpBase64Alphabet[ l<<2 ];\n encodedData[encodedIndex++] = PAD;\n }\n \n //encodedData[encodedIndex] = 0xa;\n \n return new String(encodedData);\n }", "public static final byte[] decryptData(final byte data[]) {\n for (int j = 1; j <= 6; j++) {\n byte remember = 0;\n byte dataLength = (byte) (data.length & 0xFF);\n byte nextRemember = 0;\n\n if (j % 2 == 0) {\n for (int i = 0; i < data.length; i++) {\n byte cur = data[i];\n cur -= 0x48;\n cur = ((byte) ((~cur) & 0xFF));\n cur = BitTools.rollLeft(cur, (int) dataLength & 0xFF);\n nextRemember = cur;\n cur ^= remember;\n remember = nextRemember;\n cur -= dataLength;\n cur = BitTools.rollRight(cur, 3);\n data[i] = cur;\n dataLength--;\n }\n } else {\n for (int i = data.length - 1; i >= 0; i--) {\n byte cur = data[i];\n cur = BitTools.rollLeft(cur, 3);\n cur ^= 0x13;\n nextRemember = cur;\n cur ^= remember;\n remember = nextRemember;\n cur -= dataLength;\n cur = BitTools.rollRight(cur, 4);\n data[i] = cur;\n dataLength--;\n }\n }\n //System.out.println(\"dec after iteration \" + j + \": \" + HexTool.toString(data));\n }\n return data;\n }", "public byte[] serialize();", "@Override\n public String convertToDatabaseColumn(String attribute) {\n String bytes = null;\n try {\n\n bytes = Base64.getEncoder().encodeToString(encrypt(attribute));\n// bytes = encrypt(attribute).toString();\n\n }catch (Exception e){\n e.printStackTrace();\n }\n\n return bytes;\n\n }", "public static byte[] encryptDES2Base64(final byte[] data,\n final byte[] key,\n final String transformation,\n final byte[] iv) {\n return base64Encode(encryptDES(data, key, transformation, iv));\n }" ]
[ "0.60807556", "0.6069512", "0.6069512", "0.6069512", "0.6069512", "0.6059566", "0.6044065", "0.6044065", "0.5988122", "0.59141016", "0.58816546", "0.5871909", "0.58565414", "0.5845296", "0.5800529", "0.57908297", "0.5775746", "0.5737777", "0.5736748", "0.5720678", "0.5677366", "0.56632334", "0.5661019", "0.5650445", "0.56237733", "0.56227446", "0.5603341", "0.55888164", "0.55854243", "0.55854243", "0.55697006", "0.5557221", "0.5536114", "0.552545", "0.55009365", "0.54839855", "0.5483287", "0.5472399", "0.5463351", "0.5450365", "0.5446821", "0.5439106", "0.5428866", "0.54156005", "0.5411275", "0.5410232", "0.53797585", "0.53776276", "0.53746027", "0.5371462", "0.5359212", "0.5353402", "0.5340586", "0.5328304", "0.5320989", "0.5320515", "0.53200877", "0.53175783", "0.52835435", "0.52802926", "0.52763194", "0.5275937", "0.5268676", "0.52676785", "0.5255314", "0.5245394", "0.5241894", "0.5240943", "0.52316", "0.52232206", "0.5221857", "0.5220028", "0.52011317", "0.519809", "0.5192941", "0.51892865", "0.51886415", "0.5186725", "0.51865137", "0.5181142", "0.5181123", "0.51810795", "0.5180878", "0.5179755", "0.51767486", "0.5175702", "0.51726437", "0.51661766", "0.5163614", "0.516021", "0.5154767", "0.51523036", "0.5148814", "0.5146252", "0.5144479", "0.5141646", "0.51266533", "0.51235265", "0.5122633", "0.5114596", "0.51130116" ]
0.0
-1
It opens the image file and hides the data in images
public void openimagefile(String fn,int sno) { try { i=0; FileInputStream fis = new FileInputStream(fn); DataInputStream dis=new DataInputStream(fis); while((ch=dis.readUnsignedByte())!=-1) { p[i]=ch; p1[i]=ch; i++; } fis.close(); dis.close(); } catch(Exception e) { maxp=i; switch(p[28]) { case 24: { init24(); break; } //case 24 ends } // switchp[28] ends } //catch() ends img=createImage(new MemoryImageSource(width,height,pixels,0,width)); img1=createImage(new MemoryImageSource(width,height,pixels1,0,width)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void hidePics(){\n\t\t\tfor (int i = 0; i < 3; i++)\n\t\t\t\tfor (int j = 0; j < 3; j++)\n\t\t\t\t\tpics[i][j].setVisible(false);\n\t\t}", "private void showView() {\n\t\tfinal ImageView image = (ImageView) findViewById(R.id.image); \n\t\t//screen.addView(image);\n\t\t//image.setImageResource(images[0]);\n\n\t\tString fileName = getFilesDir().getPath() + \"/\" + FILE_NAME;\n\t\t//System.out.println(fileName);\n\t\tBitmap bm = BitmapFactory.decodeFile(fileName); \n\t\t\n\t\timage.setImageBitmap(bm); \n\t\t\n\t\t//System.out.println(\"show done!\\n\");\t\t\n\t\t\n\t}", "private void showImageDetail() {\n }", "public void closeImage() {\n\n\t}", "public void openFile()\n { \n JFileChooser chooser = new JFileChooser();\n chooser.setCurrentDirectory(new File(\".\"));\n \n chooser.setFileFilter(new\n javax.swing.filechooser.FileFilter()\n { \n public boolean accept(File f)\n { \n String name = f.getName().toLowerCase();\n return name.endsWith(\".gif\") || name.endsWith(\".jpg\") || name.endsWith(\".jpeg\")\n || f.isDirectory();\n }\n public String getDescription() { return \"Image files\"; }\n });\n\n int r = chooser.showOpenDialog(this);\n if(r != JFileChooser.APPROVE_OPTION) return;\n\n try\n {\n image = ImageIO.read(chooser.getSelectedFile());\n }\n catch (IOException e)\n {\n JOptionPane.showMessageDialog(this, e);\n }\n repaint();\n }", "@Override\n public void componentHidden(ComponentEvent e) {\n IImage img = fc.imageSelection.getSelectedImage();\n fc.imageSelection.removeComponentListener(this);\n \n if(img == null){\n image.setImage(null);\n imgName = null;\n imgDir = null;\n }else{\n image.setImage(img.getImage());\n imgName = img.getName();\n imgDir = img.getDir();\n }\n }", "public void readImage(File f) {\r\n try {\r\n //JFrame f2 = new JFrame();\r\n images.add(ImageIO.read(f));\r\n //JLabel lb = new JLabel(new ImageIcon(images.get(0)));\r\n //f2.add(lb);\r\n //f2.setVisible(true);\r\n } catch(Exception e) {\r\n JOptionPane.showMessageDialog(null, \"read image failed.\", \"System Message\", JOptionPane.ERROR_MESSAGE);\r\n e.printStackTrace();\r\n }\r\n }", "private void openImageFile(ImageActions action) {\n\t\tsetImageHolder(action, RGPTUIUtil.getImageFile(this));\r\n\t}", "public static void testHidePicture(){\n\t Picture wall = new Picture(\"wall.jpg\");\n\t Picture caterpillar = new Picture(\"caterpillar.jpg\");\n\t wall.explore();\n\t wall.hidePicture(caterpillar);\n\t wall.explore();\n\t \n }", "public void openDialog() {\r\n\t\tString filename = this.getFileName();\r\n\t\tif (filename.equals(null) || filename.equals(\"\") ) {\r\n\t\t\ttext.append(\"\\nPlease select valid image\");\r\n\t\t\topenDialog();\r\n\t\t}\r\n\t\tdisplay_img = this.loadImage(filename);\r\n\r\n\t}", "private void helperDisplayInputImage()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//---- Get currently selected file index in the combo box\r\n\t\t\tint index = mainFormLink.getComponentPanelLeft().getComponentComboboxFileName().getSelectedIndex();\r\n\r\n\t\t\t//---- Check the index if the action is invoked by image deletion then causes error\r\n\t\t\tint imageCount = DataController.getTable().getTableSize();\r\n\r\n\t\t\tif (index >= 0 && index < imageCount)\r\n\t\t\t{\r\n\t\t\t\t//---- Get file path of the table\r\n\r\n\t\t\t\tString filePath = DataController.getTable().getElement(index).getDataFile().getFilePath();\r\n\r\n\t\t\t\tmainFormLink.getComponentPanelCenter().getComponentPanelImageView().displayPolygonStop();\r\n\t\t\t\tmainFormLink.getComponentPanelCenter().getComponentPanelImageView().loadImage(filePath);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (ExceptionMessage e)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(e);\r\n\t\t}\r\n\t}", "private void displayImage() {\n if (currentPhotoPath != null) {\n // checkPicture = true; depreciated, try catch to catch if photo exists\n Bitmap temp = fixOrientation(BitmapFactory.decodeFile(currentPhotoPath));\n bitmapForAnalysis = temp;\n imageView.setImageBitmap(temp);\n } else {\n Toast.makeText(this, \"Image Path is null\", Toast.LENGTH_LONG).show();\n }\n }", "private void showBitmap() {\n Bitmap bitmap = BitmapFactory.decodeByteArray(mImgData, 0, mImgData.length);\n mImgView.setImageBitmap(bitmap);\n }", "private void actionViewOriginalImage ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t\tif (tableSize != 0)\r\n\t\t\t{\r\n\t\t\t\tint imagIndex = mainFormLink.getComponentPanelLeft().getComponentComboboxFileName().getSelectedIndex();\r\n\r\n\t\t\t\t//---- Get path to the original image\r\n\t\t\t\tString filePath = DataController.getTable().getElement(imagIndex).getDataFile().getFilePath();\r\n\r\n\t\t\t\t//---- Load the image into the image viewer\r\n\t\t\t\tmainFormLink.getComponentPanelCenter().getComponentPanelImageView().displayPolygonStop();\r\n\t\t\t\tmainFormLink.getComponentPanelCenter().getComponentPanelImageView().loadImage(filePath);\r\n\r\n\t\t\t\t//---- Change button icon\r\n\t\t\t\tImageIcon iconButton = FormUtils.getIconResource(FormStyle.RESOURCE_PATH_ICO_ORIGINAL_IMAGE);\r\n\r\n\t\t\t\tmainFormLink.getComponentToolbar().getComponentButtonViewImage().setIcon(iconButton);\r\n\t\t\t\tmainFormLink.getComponentToolbar().getComponentButtonViewImage().setActionCommand(FormMainHandlerCommands.AC_VIEW_CELL);\r\n\t\t\t\tmainFormLink.getComponentToolbar().getComponentButtonViewImage().setToolTipText(\"View cells\");\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tcatch (ExceptionMessage exception)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(exception);\r\n\t\t}\r\n\t}", "private void openFile(File file)\n {\n String imagePath = file.toURI().toString();\n Image image = new Image(imagePath);\n if ( image == null || image.isError())\n {\n showInvalidFileFormatError();\n } else\n {\n bufferImage = image;\n changeAvatarCircle.setFill(new ImagePattern(image));\n imagePathLabel.setText(imagePath);\n }\n }", "public BufferedImage open() {\n\t\tJFileChooser choose = new JFileChooser(); //Removed path from the chooser!\n\n\t\tif (choose.showOpenDialog(null) != JFileChooser.APPROVE_OPTION)\n\t\t\treturn null;\n\t\tString file = choose.getSelectedFile().getAbsolutePath();\n\t\ttry {\n\t\t\tthis.x = 0;\n\t\t\tthis.y = 0;\n\t\t\tFileInputStream fis = new FileInputStream(file); \n\t\t\tObjectInputStream ois = new ObjectInputStream(fis);\n\t\t\tString iden = \"\";\n\t\t\tiden += ois.readChar();\n\t\t\tiden += ois.readChar();\n\t\t\tiden += ois.readChar();\n\t\t\t\n\t\t\tif (iden.compareTo(\"PPL\") != 0)\treturn null;\n\t\t\tbyte by = ois.readByte();\n\t\t\tSystem.out.println(by);\n\t\t\t\n\t\t\tswitch (by) {\n\t\t\t\tcase 0:\n\t\t\t\t\tthis.image = loadRGB(ois);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.image = loadCMY(ois);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tthis.image = loadGS(ois);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tthis.image = loadBW(ois);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tthis.image = loadLT(ois);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tois.close();\n\t\t\t//int b = ois.readByte(); //lee 8 bits, lee -16, y no 240\n\t\t\t//si el bit mas significativo del byte antes de introducirse fue 1, el numero leido se interpreta como negativo\n\t\t\t//if(b < 0) b += 256; //para leer bytes sin signo\n\t\t\t//int i = ois.readInt(); //lee 32 bits, lee 3500\n\t\t} catch (FileNotFoundException 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\t\treturn image;\n\t}", "public void Func_imagefile(){\n\n\t\tswf_env.containImg = true;\n\n\n\t\tthis.value = new SWFValue(\"Func\");\n\n\t\tString path = this.getAtt(\"path\", \".\");\n\t\tString filename = this.getAtt(\"default\");\n\t\tString type = \"auto\";\n\t\tvalue.instanceName = \"img\"+ Integer.toString(swf_env.instanceID);\n\t\tvalue.data = \"\";\n\t\tvalue.imgpath = path + \"/\" + filename;\n\t\tvalue.inter_imgpath = path + \"/\" + filename;\n\t\tvalue.inter_name = \"intimg\" + Integer.toString(swf_env.interactionImgNUM);\n\t\tvalue.tmp = \"tmp\" + Integer.toString(swf_env.interactionImgNUM);\n\t\tvalue.lnum = Integer.toString(swf_env.visibleflag_counter);\n\n\n\t\tif(!path.startsWith(\"/\")) {\n\t\t\tString basedir = GlobalEnv.getBaseDir();\n\t\t\tLog.out(\"basedir= \" +basedir);\n\t\t\tif(basedir != null && basedir != \"\") {\n\t\t\t\tpath = basedir + path;\n\t\t\t}\n\t\t}\n\n\t\tString filepath = path + \"/\" + filename;\n\n\n\t\tsetDecoration1();\n\t\tvalue.margin = margin;\n\n\n\t\tSystem.out.println(\"filepath = \"+filepath);\n\t\tint img = swf_env.open_image_file(type, filepath);\n\t\tvalue.img = img;\n\n\t\tdata_width = swf_env.get_value(\"imagewidth\", img);\n\t\tdata_height = swf_env.get_value(\"imageheight\", img);\n\t\tSystem.out.println(\"imagesize: \"+data_width+\" \"+data_height);\n\t\twidth = data_width + margin * 2;\n\t\theight = data_height + margin * 2;\n\n\n\t\tsetDecoration2();\n\n\t\tif(data_width > width){\n\t\t\tint original_width = data_width;\n\t\t\tdata_width = width - margin * 2;\n\t\t\tint scale = data_width / original_width;\n\t\t\tdata_height = data_height * scale;\n\t\t\theight = data_height + margin * 2;\n\t\t}\n\t\tif(data_height > height){\n\t\t\tint original_height = data_height;\n\t\t\tdata_height = height - margin * 2;\n\t\t\tint scale = data_height / original_height;\n\t\t\tdata_width = data_width * scale;\n\t\t\twidth = data_width + margin * 2;\n\t\t}\n\n\t\tvalue.data_width = data_width;\n\t\tvalue.data_height = data_height;\n\t\tvalue.width = width;\n\t\tvalue.height = height;\n\t\t//morya wrote\n\t\tvalue.int_w = width;\n\t\tvalue.int_h = height;\n\n\n\t\tsetDecoration3();\n\n\t\tswf_env.tmp_width = width;\n\t\tswf_env.tmp_height = height;\n\n\n\t\tswf_env.instanceID++;\n\n\t}", "public Label getPic(){\n //try {//getPic is only called if isPic is true, so side1 would contain picture path\n /*BufferedImage unsized = ImageIO.read(new File(side1));\n BufferedImage resized = resizeImage(unsized,275,250, unsized.getType());\n frontPic.setIcon(new ImageIcon(resized));*/\n\n\t\t\tImage image = new Image(new File(side1).toURI().toString());\n\t\t\tImageView iv = new ImageView(image);\n\t\t\tLabel imageLabel = new Label(\"Image\");\n\t\t\timageLabel.setGraphic(iv);\n\t\t\treturn imageLabel;\n /*} catch (IOException ex) {\n System.out.println(\"Trouble reading from the file: \" + ex.getMessage());\n }\n return frontPic;*/\n }", "public void openImage() {\t\n\t\ttry {\n\t\t\timg.openImage(list);\n\t\t} \t\n\n\t\tcatch (BrokenImageException ex) {\n\t\t\ttry{\n\t\t\t\tif(!validImageContent())\n\t\t\t\t\tthrow new BadImageContentException(\"The image is broken \"\n\t\t\t\t\t\t\t+ \"due to corrupt content\");\n\t\t\t\tif(!validImageHeader())\n\t\t\t\t\tthrow new BadImageHeaderException(\"The image is broken\"\n\t\t\t\t\t\t\t+ \" due to a damaged header\");\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\"Please catch the proper Image-related Exception.\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "protected void hideAllPics() {\n\t\tfor (int i = 0; i < ROWS; i++) { //hide pictures in all rooms\n\t\t\tfor (int j = 0; j < COLS; j++){\n\t\t\t\tsquares[i][j].setBackground(Color.WHITE);\n\t\t\t\tsquares[i][j].hidePics();\n\t\t\t}\n\t\t}\n\t}", "public void openImage() {\n InputStream f = Controller.class.getResourceAsStream(\"route.png\");\n img = new Image(f, mapImage.getFitWidth(), mapImage.getFitHeight(), false, true);\n h = (int) img.getHeight();\n w = (int) img.getWidth();\n pathNodes = new GraphNodeAL[h * w];\n mapImage.setImage(img);\n //makeGrayscale();\n }", "@Override\r\n public void onClick(View arg0) {\n popWindow.setVisibility(View.INVISIBLE);\r\n mBottomBar.setVisibility(View.VISIBLE);\r\n mEditLayout.setVisibility(View.INVISIBLE);\r\n mFaceEditor.updateImage(false);\r\n\r\n mImgView.setImageBitmap(null);\r\n mImgView.setImageBitmap(mFaceEditor.getDisplayImage());\r\n\r\n\r\n }", "@FXML\r\n public void imageButtonClicked() {\r\n File file = fileChooser.showOpenDialog(viewHandler.getPrimaryStage());\r\n if (file != null) {\r\n try {\r\n viewModel.setImageurl(ImageConverter.ImageToByte(file));\r\n Image img = new Image(new ByteArrayInputStream(viewModel.getImageurl()));\r\n dogPicture.setFill(new ImagePattern(img));\r\n } catch (FileNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }", "public ModelImage readImage(boolean one) throws IOException {\r\n // The data types are Sun, hence the byte order is big-endian.\r\n int i;\r\n int num; //image number within file\r\n\r\n boolean endianess = LITTLE_ENDIAN;\r\n\r\n try {\r\n file = new File(fileDir + fileName);\r\n raFile = new RandomAccessFile(file, \"r\");\r\n progressBar = new ViewJProgressBar(ViewUserInterface.getReference().getProgressBarPrefix() + fileName,\r\n ViewUserInterface.getReference().getProgressBarPrefix() + \"BioRad image(s) ...\", 0, 100,\r\n false, null, null);\r\n xDim = getSignedShort(endianess); // 0\r\n yDim = getSignedShort(endianess); // 2\r\n zDim = getSignedShort(endianess); // 4\r\n ramp1Min = (short)getSignedShort(endianess); // 6\r\n ramp1Max = (short)getSignedShort(endianess); // 8\r\n notes = getInt(endianess); // 10\r\n byteFormat = (short)getSignedShort(endianess); // 14\r\n num = (short)getSignedShort(endianess); // 16\r\n\r\n setProgressBarVisible(!one);\r\n\r\n for (i = 0; i < 32; i++) {\r\n name[i] = 0;\r\n }\r\n readAgain = true;\r\n i = 0;\r\n while(readAgain) {\r\n name[i++] = raFile.readByte(); // 18\r\n if (name[i-1] == 0) {\r\n readAgain = false;\r\n }\r\n }\r\n fName = new String(name,0,i-1);\r\n raFile.seek(50);\r\n merged = (short)getSignedShort(endianess); // 50\r\n color1 = getUnsignedShort(endianess); // 52\r\n fileID = getUnsignedShort(endianess); // 54\r\n if (fileID != 12345) {\r\n throw new IOException(\"fileID is an illegal \" + fileID);\r\n }\r\n ramp2Min = (short)getSignedShort(endianess); // 56\r\n ramp2Max = (short)getSignedShort(endianess); // 58\r\n color2 = getUnsignedShort(endianess); // 60\r\n edited = (short)getSignedShort(endianess); // 62\r\n lens = (short)getSignedShort(endianess); // 64\r\n magFactor = getFloat(endianess); // 66\r\n // Position to the start of the image data\r\n raFile.seek(76);\r\n\r\n fileInfo = new FileInfoBioRad(fileName, fileDir, FileBase.BIORAD); // dummy fileInfo\r\n fileInfo.setEndianess(endianess);\r\n if (zDim > 1) {\r\n imgExtents = new int [3];\r\n imgExtents[0] = xDim;\r\n imgExtents[1] = yDim;\r\n imgExtents[2] = zDim;\r\n }\r\n else {\r\n imgExtents = new int [2];\r\n imgExtents[0] = xDim;\r\n imgExtents[1] = yDim;\r\n }\r\n\r\n fileInfo.setExtents(imgExtents);\r\n if (byteFormat == 1) {\r\n dataType = ModelStorageBase.UBYTE;\r\n bufferSize = xDim*yDim;\r\n }\r\n else { // byteFormat == 0\r\n dataType = ModelStorageBase.SHORT;\r\n bufferSize = xDim*yDim;\r\n }\r\n /*else { // merged pseudocolor\r\n dataType = ModelStorageBase.ARGB;\r\n bufferSize = 4*xDim*yDim;\r\n }*/\r\n fileInfo.setDataType(dataType);\r\n\r\n if (one) {\r\n image = new ModelImage(dataType, new int[] {imgExtents[0], imgExtents[1]}, fileInfo.getFileName(), UI);\r\n zDim = 1;\r\n }\r\n else {\r\n image = new ModelImage(dataType, imgExtents, fileInfo.getFileName(), UI);\r\n }\r\n\r\n imgBuffer = new float[bufferSize];\r\n for (i = 0; i < zDim; i++){\r\n try {\r\n if (one && imgExtents.length > 2) {\r\n if (dataType == ModelStorageBase.UBYTE) {\r\n raFile.seek(imgExtents[2]/2*xDim*yDim);\r\n }\r\n else {\r\n raFile.seek(imgExtents[2]*xDim*yDim);\r\n }\r\n readBuffer(imgExtents[2]/2, imgBuffer);\r\n }\r\n else {\r\n readBuffer(i, imgBuffer); // Slice a time;\r\n }\r\n image.setFileInfo(fileInfo, i);\r\n }\r\n catch (IOException error){\r\n throw new IOException(\"FileTiff: read: \" + error);\r\n }\r\n image.importData(i*bufferSize, imgBuffer, false);\r\n } // for (i = 0; i < imageSlice; i++)\r\n\r\n raFile.close();\r\n progressBar.dispose();\r\n }\r\n catch (OutOfMemoryError error) {\r\n if (image != null) {\r\n image.disposeLocal();\r\n image = null;\r\n }\r\n byteBuffer = null;\r\n System.gc();\r\n throw error;\r\n }\r\n\r\n return image;\r\n }", "private void updateImage(File file) throws IOException {\n\t\t\tfileLabel.setText(\"\");\n\n\t\t\ttry {\n\t\t\t\tMyImageD tmpImage = null;\n\t\t\t\tString fileName = file.getName();\n\n\t\t\t\t// Update preview for opening ggb files\n\t\t\t\tif (fileChooser\n\t\t\t\t\t\t.getMode() == GeoGebraFileChooser.MODE_GEOGEBRA) {\n\n\t\t\t\t\tif (fileName.endsWith(\".ggb\")) {\n\t\t\t\t\t\ttmpImage = new MyImageD(MyXMLioD.getPreviewImage(file)); // load\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// preview\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// from\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// zip\n\n\t\t\t\t\t\tStringBuilder fileInfo = new StringBuilder();\n\n\t\t\t\t\t\tif (fileName.length() > 20) {\n\t\t\t\t\t\t\tfileInfo.append(fileName.substring(0, 20));\n\t\t\t\t\t\t\tfileInfo.append(\"..\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfileInfo.append(fileName);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfileInfo.append(\" : \");\n\t\t\t\t\t\tfileInfo.append(file.length() / 1024);\n\t\t\t\t\t\tfileInfo.append(\" kB\");\n\t\t\t\t\t\tfileLabel.setText(fileInfo.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Update preview for saving a ggb file\n\t\t\t\telse if (fileChooser\n\t\t\t\t\t\t.getMode() == GeoGebraFileChooser.MODE_GEOGEBRA_SAVE) {\n\t\t\t\t\ttmpImage = (MyImageD)\n\t\t\t\t\t\t\tapp.getExportImage(MyXMLio.THUMBNAIL_PIXELS_X,\n\t\t\t\t\t\t\t\t\tMyXMLio.THUMBNAIL_PIXELS_Y);\n\t\t\t\t\t// TODO: show file size info?\n\t\t\t\t\tfileLabel.setText(null);\n\t\t\t\t}\n\n\t\t\t\t// Update preview for images\n\t\t\t\telse {\n\t\t\t\t\t// fails for a few JPEGs so turn off preview for large files\n\t\t\t\t\tif (file.length() < 1024 * maxImageSize) {\n\n\t\t\t\t\t\ttmpImage = MyImageD.fromFile(file, fileName);\n\t\t\t\t\t\tStringBuilder imgInfo = new StringBuilder();\n\n\t\t\t\t\t\tif (fileName.length() > 20) {\n\t\t\t\t\t\t\timgInfo.append(fileName.substring(0, 20));\n\t\t\t\t\t\t\timgInfo.append(\"..\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\timgInfo.append(fileName);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (tmpImage != null) {\n\t\t\t\t\t\t\timgInfo.append(\" : \");\n\t\t\t\t\t\t\timgInfo.append(tmpImage.getWidth());\n\t\t\t\t\t\t\timgInfo.append(\" x \");\n\t\t\t\t\t\t\timgInfo.append(tmpImage.getHeight());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfileLabel.setText(imgInfo.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// resize tmp image if necessary\n\t\t\t\tif (tmpImage != null) {\n\n\t\t\t\t\tint oldWidth = tmpImage.getWidth();\n\t\t\t\t\tint oldHeight = tmpImage.getHeight();\n\n\t\t\t\t\tint newWidth;\n\t\t\t\t\tint newHeight;\n\n\t\t\t\t\tif (oldWidth > ImagePanel.SIZE\n\t\t\t\t\t\t\t|| oldHeight > ImagePanel.SIZE) {\n\t\t\t\t\t\tif (oldWidth > oldHeight) {\n\t\t\t\t\t\t\tnewWidth = ImagePanel.SIZE;\n\t\t\t\t\t\t\tnewHeight = (ImagePanel.SIZE * oldHeight)\n\t\t\t\t\t\t\t\t\t/ oldWidth;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnewWidth = (ImagePanel.SIZE * oldWidth) / oldHeight;\n\t\t\t\t\t\t\tnewHeight = ImagePanel.SIZE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Create a new image for the scaled preview image\n\t\t\t\t\t\tsetImg(new MyImageD(new BufferedImage(newWidth,\n\t\t\t\t\t\t\t\tnewHeight, BufferedImage.TYPE_INT_RGB)));\n\n\t\t\t\t\t\tGGraphics2DD graphics2D = (GGraphics2DD) getImg()\n\t\t\t\t\t\t\t\t.createGraphics();\n\t\t\t\t\t\tif (tmpImage.isSVG()) {\n\t\t\t\t\t\t\tgraphics2D.setColor(GColor.WHITE);\n\t\t\t\t\t\t\tgraphics2D.fillRect(0, 0, newWidth, newHeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgraphics2D.drawImageScaled(tmpImage, newWidth, newHeight);\n\t\t\t\t\t\tgraphics2D.dispose();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetImg(tmpImage);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsetImg(null);\n\t\t\t\t}\n\n\t\t\t\trepaint();\n\t\t\t} catch (IllegalArgumentException iae) {\n\t\t\t\t// This is thrown if you select .ico files\n\t\t\t\tsetImg(null);\n\t\t\t} catch (Throwable t) {\n\t\t\t\tt.printStackTrace();\n\t\t\t\tLog.debug(t.getClass() + \"\");\n\t\t\t\tsetImg(null);\n\t\t\t}\n\t\t}", "public void openImage(String name) throws ViewerException {\n\n\t}", "public static void clickrun2() {\n JFileChooser file = new JFileChooser();\n file.setCurrentDirectory(new File(System.getProperty(\"user.home\")));\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"*.images\", \"jpg\", \"png\");\n file.addChoosableFileFilter(filter);\n int result = file.showSaveDialog(null);\n if (result == JFileChooser.APPROVE_OPTION) {\n File selectedFile = file.getSelectedFile();\n String path = selectedFile.getAbsolutePath();\n lblAnhsanphamsua.setIcon(ResizeImage2(path, null));\n ImagePast2 = path;\n System.out.println(ImagePast2);\n } else {\n\n }\n }", "private ImageView createImageView(final File imageFile) {\n\n ImageView imageView = null;\n try {\n final Image image = new Image(new FileInputStream(imageFile), 150, 0, true,\n true);\n imageView = new ImageView(image);\n imageView.setFitWidth(150);\n imageView.setOnMouseClicked(new EventHandler<MouseEvent>() {\n\n @Override\n public void handle(MouseEvent mouseEvent) {\n\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\n\n if(mouseEvent.getClickCount() == 2){\n try {\n BorderPane borderPane = new BorderPane();\n ImageView imageView = new ImageView();\n Image image = new Image(new FileInputStream(imageFile));\n imageView.setImage(image);\n imageView.setStyle(\"-fx-background-color: BLACK\");\n imageView.setFitHeight(window1Stage.getHeight() - 10);\n imageView.setPreserveRatio(true);\n imageView.setSmooth(true);\n imageView.setCache(true);\n borderPane.setCenter(imageView);\n borderPane.setStyle(\"-fx-background-color: BLACK\");\n Stage newStage = new Stage();\n newStage.setWidth(window1Stage.getWidth());\n newStage.setHeight(window1Stage.getHeight());\n newStage.setTitle(imageFile.getName());\n Scene scene = new Scene(borderPane, Color.BLACK);\n newStage.setScene(scene);\n newStage.show();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n }\n }\n }\n });\n } catch (FileNotFoundException ex) {\n ex.printStackTrace();\n }\n return imageView;\n }", "@Override\r\n public void onClick(View arg0) {\n popWindow.setVisibility(View.INVISIBLE);\r\n mBottomBar.setVisibility(View.VISIBLE);\r\n mEditLayout.setVisibility(View.INVISIBLE);\r\n mFaceEditor.updateImage(true);\r\n mImgView.setImageBitmap(null);\r\n mImgView.setImageBitmap(mFaceEditor.getDisplayImage());\r\n }", "@FXML\n public void onBrowseButtonClick() {\n\t\tFileChooser fileChooser = new FileChooser();\n\t\tfileChooser.setTitle(\"Open\");\n\t\tfileChooser.getExtensionFilters().addAll(\n\t\t\t\tnew FileChooser.ExtensionFilter(\"Images\", \"*.jpg\", \"*.png\", \"*.jpeg\")\n\t\t);\n\n\t\t// Opens the file chooser and grabs the image the user selected\n\t\tFile file = fileChooser.showOpenDialog(root.getScene().getWindow());\n\t\tif (file == null)\n\t\t\treturn;\n\n\t\t// Saves the image in the program\n\t\tImage originalImage = new Image(file.toURI().toString());\n\t\tMain.setOriginalImage(originalImage);\n\n\t\t// Shows the path text and saves the original image in the program\n\t\toriginalImageView.setImage(originalImage);\n\n\t\t// Centers the image in the tiny space it has\n\t\tdouble imageViewOffset = originalImageView.getBoundsInParent().getWidth() / 2;\n\t\toriginalImageView.setLayoutX(128 - imageViewOffset);\n\n\t\tcreateRectifiedImage();\n\t\tshowRectifiedImage();\n\t}", "private void readFile(){\n File file = new File(Environment.getExternalStorageDirectory()+\"/saved_images/profile.jpg\");\n myPictureForShow = BitmapFactory.decodeFile(file.getAbsolutePath());\n }", "public void removeImage() {\n setFileImage(null);\n getSelected().setUrlImage(null);\n RequestContext.getCurrentInstance().update(\"image\");\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n JFileChooser fc = new JFileChooser(); \n int returnVal = fc.showOpenDialog(null);\n if (returnVal == JFileChooser.APPROVE_OPTION) {\n File file = fc.getSelectedFile();\n System.out.println(file.getAbsolutePath()); \n image = loadImage( file);\n }\n }", "public void OpenActionPerformed(ActionEvent evt) { \r\n\r\n //open file from file browser and display the image in the drawing panel\r\n if (jfcOpen.showOpenDialog(this) == JFileChooser.APPROVE_OPTION){\r\n //get selected image file\r\n File fileOpen = jfcOpen.getSelectedFile();\r\n \r\n //get image file path\r\n String fileName = fileOpen.toString();\r\n \r\n //set image path and display image\r\n drawingPanel.setPath(fileName); \r\n }\r\n }", "@Override\n protected void onWindowVisibilityChanged(int visibility) {\n super.onWindowVisibilityChanged(visibility);\n\n if(visibility==RelativeLayout.GONE){\n if(null!=this.mBitmap){\n this.mBitmap.recycle();\n this.mBitmap = null;\n }\n }else{\n if(null!=this.mBitmap){\n this.mBitmap.recycle();\n this.mBitmap = null;\n }\n if(null!=this.mPath){\n\n\n //this.mBitmap = BitmapFactory.decodeFile(this.mPath);\n this.mBitmap = ImageUtils.getBitmap(this.mPath, IMAGE_WIDTH_HEIGHT, IMAGE_WIDTH_HEIGHT);\n this.setImageBitmap(mBitmap);\n }\n\n }\n Log.e(\"my\",\"onWindowVisibilityChanged:\"+visibility);\n }", "public void closeLock(ImageView imageView, int whichImage){\n\n Image imageOne = new Image(getClass().getResource(\"/IMG_2657.JPG\").toString());\n Image imageTwo = new Image(getClass().getResource(\"/IMG_2658.JPG\").toString());\n imageView.setImage((whichImage == 1) ? imageOne: imageTwo);\n\n }", "@Override\n\tpublic void desenhar() {\n\t\tSystem.out.println(\"desenhar imagem png\");\n\t\t\n\t}", "public String getImage(){\n StringBuilder sb = new StringBuilder();\n for (char[] subArray : hidden) {\n sb.append(subArray);\n sb.append(\"\\n\");\n }\n return sb.toString();\n }", "private void displayNoImage() {\n\t\tGRect imageRect = new GRect(LEFT_MARGIN, nameY + IMAGE_MARGIN,\n\t\t\t\tIMAGE_WIDTH, IMAGE_HEIGHT);\n\t\tadd(imageRect);\n\t\tGLabel noImage = new GLabel(\"No Image\");\n\t\tnoImage.setFont(PROFILE_IMAGE_FONT);\n\t\tdouble labelWidth = LEFT_MARGIN + IMAGE_WIDTH / 2 - noImage.getWidth()\n\t\t\t\t/ 2;\n\t\tdouble labelHeight = nameY + IMAGE_MARGIN + IMAGE_HEIGHT / 2;\n\t\tadd(noImage, labelWidth, labelHeight);\n\t}", "public BufferedImage open(String id, int no)\n throws FormatException, IOException\n {\n if (!id.equals(currentId)) initFile(id);\n \n if (no < 0 || no >= getImageCount(id)) {\n throw new FormatException(\"Invalid image number: \" + no);\n }\n \n // First initialize:\n in.seek(offsets[no] + 12);\n byte[] toRead = new byte[4];\n in.read(toRead);\n int blockSize = batoi(toRead);\n toRead = new byte[1];\n in.read(toRead);\n // right now I'm gonna skip all the header info\n // check to see whether or not this is v2 data\n if (toRead[0] == 1) {\n in.skipBytes(128);\n }\n in.skipBytes(169);\n // read in the block of data\n toRead = new byte[blockSize];\n int read = 0;\n int left = blockSize;\n while (left > 0) {\n int i = in.read(toRead, read, left);\n read += i;\n left -= i;\n }\n byte[] pixelData = new byte[blockSize];\n int pixPos = 0;\n \n Dimension dim;\n try { dim = pictReader.getDimensions(toRead); }\n catch (Exception e) { dim = new Dimension(0, 0); }\n \n int length = toRead.length;\n int num, size, blockEnd;\n int totalBlocks = -1; // set to allow loop to start.\n int expectedBlock = 0;\n int pos = 0;\n int imagePos = 0;\n int imageSize = dim.width * dim.height;\n short[] flatSamples = new short[imageSize];\n byte[] temp;\n boolean skipflag;\n \n // read in deep grey pixel data into an array, and create a\n // BufferedImage out of it\n //\n // First, checks the existence of a deep gray block. If it doesn't exist,\n // assume it is PICT data, and attempt to read it.\n \n // check whether or not there is deep gray data\n while (expectedBlock != totalBlocks) {\n skipflag = false;\n while (pos + 7 < length &&\n (toRead[pos] != 73 || toRead[pos + 1] != 86 ||\n toRead[pos + 2] != 69 || toRead[pos + 3] != 65 ||\n toRead[pos + 4] != 100 || toRead[pos + 5] != 98 ||\n toRead[pos + 6] != 112 || toRead[pos + 7] != 113))\n {\n pos++;\n }\n if (pos + 32 > length) { // The header is 32 bytes long.\n if (expectedBlock == 0 && imageType[no] < 9) {\n // there has been no deep gray data, and it is supposed\n // to be a pict... *crosses fingers*\n try { return pictReader.openBytes(toRead); }\n catch (Exception e) {\n e.printStackTrace();\n throw new FormatException(\"No iPic comment block found\", e);\n }\n }\n else {\n throw new FormatException(\"Expected iPic comment block not found\");\n }\n }\n \n pos += 8; // skip the block type we just found\n \n // Read info from the iPic comment. This serves as a\n // starting point to read the rest.\n temp = new byte[] {\n toRead[pos], toRead[pos+1], toRead[pos+2], toRead[pos+3]\n };\n num = batoi(temp);\n if (num != expectedBlock) {\n throw new FormatException(\"Expected iPic block not found\");\n }\n expectedBlock++;\n temp = new byte[] {\n toRead[pos+4], toRead[pos+5], toRead[pos+6], toRead[pos+7]\n };\n if (totalBlocks == -1) {\n totalBlocks = batoi(temp);\n }\n else {\n if (batoi(temp) != totalBlocks) {\n throw new FormatException(\"Unexpected totalBlocks numbein.read\");\n }\n }\n \n // skip to size\n pos += 16;\n temp = new byte[] {\n toRead[pos], toRead[pos+1], toRead[pos+2], toRead[pos+3]\n };\n size = batoi(temp);\n pos += 8;\n blockEnd = pos + size;\n \n // copy into our data array.\n System.arraycopy(toRead, pos, pixelData, pixPos, size);\n pixPos += size;\n }\n int pixelValue = 0;\n pos = 0;\n \n // Now read the data and wrap it in a BufferedImage\n \n while (true) {\n if (pos + 1 < pixelData.length) {\n pixelValue = pixelData[pos] < 0 ? 256 + pixelData[pos] :\n (int) pixelData[pos] << 8;\n pixelValue += pixelData[pos + 1] < 0 ? 256 + pixelData[pos + 1] :\n (int) pixelData[pos + 1];\n }\n else throw new FormatException(\"Malformed LIFF data\");\n flatSamples[imagePos] = (short) pixelValue;\n imagePos++;\n if (imagePos == imageSize) { // done, return it\n return ImageTools.makeImage(flatSamples,\n dim.width, dim.height, 1, false);\n }\n }\n }", "private void infalteImageOnCoverPhoto(String fileName) {\n\t\tif(fileName!=null){\n\t\t\tDisplayImageOptions options = new DisplayImageOptions.Builder()\n\t\t\t.showImageOnLoading(R.drawable.ic_stub)\n\t\t\t.showImageForEmptyUri(R.drawable.ic_empty)\n\t\t\t.showImageOnFail(R.drawable.ic_error)\n\t\t\t.cacheInMemory(true)\n\t\t\t.cacheOnDisk(true)\n\t\t\t.considerExifParams(true)\n\t\t\t.displayer(new com.nostra13.universalimageloader.core.display.RoundedVignetteBitmapDisplayer(2, 2))\n\t\t\t.build();\n\t\t\tcoverPhotoName=fileName;\n\t\t\tString url=\"http://www1.kitchengardens.in/sites/default/files/\"+fileName;\n\t\t\tImageLoader.getInstance().displayImage(url, coverPhoto, options, animateFirstListener);\n\t\t}\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t mImgLayout.setVisibility(View.GONE);\n\t\t\t\t \n\t\t\t}", "public void drawImage() {\n ImageView imageView = (ImageView) findViewById(R.id.photo);\n imageView.setVisibility(View.VISIBLE);\n Glide.with(MainActivity.this).load(iURI).fitCenter().into(imageView);\n }", "static void disableImageViews() {\n\t\tfor (int i=0; i<Play.NUM[TOTAL]; i++) {\n\t\t\tPlay.pieceViews.get(i).setEnabled(false);\n\t\t}\n\t}", "@Override\n\tpublic void readImages() {\n\t\t\n\t}", "private void previewCapturedImage(){\n \ttry{\n \t\timgPreview.setVisibility(View.VISIBLE);\n \t\t\n \t\t//Bitmap Factory\n \t\tBitmapFactory.Options options = new BitmapFactory.Options();\n \t\t\n \t\t//Downsizing image as it throws OutOfMemory Exception for large images\n \t\toptions.inSampleSize = 4;\n \t\t\n \t\tfinal Bitmap bitmap = BitmapFactory.decodeFile(fileUri.getPath(), options);\n \t\t\n \t\timgPreview.setImageBitmap(bitmap);\n \t}catch(NullPointerException e){\n \t\te.printStackTrace();\n \t}catch(OutOfMemoryError e){\n \t\te.printStackTrace();\n \t}\n }", "public void hideMultipleImages(boolean hide){\n this.hideMultipleImages = hide;\n }", "public static void showImage(Stage primaryStage) {\n Pane pane = new HBox(10);\n pane.setPadding(new Insets(5, 5, 5, 5));\n Image image = new Image(\"image/us.gif\"); //load image from file\n pane.getChildren().add(new ImageView(image));\n\n ImageView imageView2 = new ImageView(image);\n imageView2.setFitHeight(100);\n imageView2.setFitWidth(100);\n pane.getChildren().add(imageView2);\n\n ImageView imageView3 = new ImageView(image);\n imageView3.setRotate(90);\n pane.getChildren().add(imageView3);\n\n // Create a scene and place it in the stage\n Scene scene = new Scene(pane);\n primaryStage.setTitle(\"ShowImage\"); // Set the stage title\n primaryStage.setScene(scene); // Place the scene in the stage\n primaryStage.show(); // Display the stage\n }", "private void showPreview() {\n Glide.with(this)\n .load(imageUri)\n .into(imagePreview);\n imagePreviewLayout.setVisibility(View.VISIBLE);\n imageOriginOptionsLayout.setVisibility(View.GONE);\n }", "public void actionPerformed(ActionEvent e) {\n\tif (\"open\".equals(e.getActionCommand())) {\n\t\tfd.show(); \n\t\t if (fd.getFile() == null) \n\t\t { \n\t\t Label1.setText(\"You have not select\"); \n\t\t } else \n\t\t { \n\t\t in = new File [30];\n\t\t\tin = fd.getFiles ();\t\n\t\t\tLabel1.setText(\"You have selected \" + in.length + \" images\"); \n\t\t }\n\t}\n\tif (\"apply\".equals(e.getActionCommand())) {\n\t\tif (in == null) Label1.setText(\"You have not select\"); \n\t\telse {\n\t\t\tif (in.length < 30) Label1.setText(\"Chưa đủ 30 ảnh. Đã có \" + in.length + \"/30 ảnh\"); \n\t\t\telse {\n\t\tString S = nameImage.getText();\n\t\tif (S.equals(\"\")) Label1.setText(\"Không được để trống tên\");\n\t\telse {\n\t\tFile file = new File(\"D:\\\\java\\\\PROJECT_I\\\\src\\\\\"+ S);\n\t\t if (!file.exists()) {\n\t\t if (file.mkdir()) {\n\t\t System.out.println(\"Directory is created!\");\n\t\t } else {\n\t\t System.out.println(\"Failed to create directory!\");\n\t\t }\n\t\t }\n\t\t InputStream inStream= null;\n\t\t OutputStream outStream = null;\n\t\t \n\t\t //for(int i = 0; i <= in.length - 1; i ++) System.out.println(\"i = \" + i +\" name: \" + in[i].toString());\n\t\t \n\t\t try {\n\t\t\t //File [] getFiles () \n\t\t\t for(int i = 0; i <= in.length - 1; i ++) {\n\t\t\t if (i == 30) {\n\t\t\t\t //Label1.setText(\"Thừa ảnh. Bỏ từ ảnh \"+ in[i].getName()); \n JOptionPane.showMessageDialog(fr, \"Thừa ảnh. Bỏ từ ảnh \"+ in[i].getName());\n\t\t\t break;\n\t\t\t }\n\t\t inStream = new FileInputStream(in[i]);\n\t\t outStream = new FileOutputStream(new File(\"D:\\\\java\\\\PROJECT_I\\\\src\\\\\"+ S+\"\\\\icon\"+(i+1)+\".jpg\"));\n\n\t\t int length;\n\t\t byte[] buffer = new byte[2097152];\n\n\t\t // copy the file content in bytes\n\t\t while ((length = inStream.read(buffer)) > 0) {\n\t\t outStream.write(buffer, 0, length);\n\t\t }\n\t\t\t }\n\t\t System.out.println(\"File is copied successful!\");\n\t\t \n\t\t } catch (IOException ex) {\n\t\t ex.printStackTrace();\n\t\t }\t\t \n\t\t fr.setVisible(false);\n\t\t}}}\n\t}\n\tif (\"replace\".equals(e.getActionCommand())) {\n\t\tif (in == null) Label1.setText(\"You have not select\"); \n\t\telse {\n\t\t\tif (in.length > 30) Label1.setText(\"Thừa ảnh\"); \n\t\t\telse {\n\t\t\tfd.setDirectory(\"D:\\\\java\\\\PROJECT_I\\\\src\\\\\");\n\t\t\tfd.show(); \n\t\t\tFile[] in2;\n\t\t\t in2 = new File [30];\n\t\t\t\tin2 = fd.getFiles ();\n\t\t File tmp = new File(in2[0].getParent());\n\t\t String tv = tmp.getName();\n\t\t int kq = 0;\n\t\t File folder = new File(\"D:\\\\java\\\\PROJECT_I\\\\src\");\n\t\t\t //&& s != \"HighScore\" && s !=\"icon\" && s != \"icon\" && s != \"sound\"\n\t\t\t for (final File fileEntry : folder.listFiles()) {\n\t\t\t if (fileEntry.isDirectory()) {\n\t\t\t \tString s = fileEntry.getName();\n\t\t if (!s.equals(\"Game_lat_hinh\") && !s.equals(\"HighScore\") && !s.equals(\"icon\") && !s.equals(\"img\") && !s.equals(\"sound\")) {\n\t\t \tif (s.equals(tv)) kq = 1; \t\n\t\t }\n\t\t\t }\n\t\t\t }\n\t\t if (kq == 0) Label1.setText(\"File đã chọn không trong thư viện\" );\n\t\t else {\n if (in2.length != in.length ) Label1.setText(\"Số lượng chọn sai . Đã chọn\" + in2.length + \"/\" + in.length + \" ảnh\"); \n else {\n\t\t InputStream inStream= null;\n\t\t OutputStream outStream = null;\n\t\t \n\t\t //for(int i = 0; i <= in.length - 1; i ++) System.out.println(\"i = \" + i +\" name: \" + in[i].toString());\n\t\t \n\t\t try {\n\t\t\t //File [] getFiles () \n\t\t\t for(int i = 0; i <= in2.length - 1; i ++) {\t\t\n\t\t inStream = new FileInputStream(in[i]);\n\t\t outStream = new FileOutputStream(new File(in2[i].getAbsolutePath()));\n\t\t\t in2[i].delete();\n\t\t int length;\n\t\t byte[] buffer = new byte[2097152];\n\n\t\t // copy the file content in bytes\n\t\t while ((length = inStream.read(buffer)) > 0) {\n\t\t outStream.write(buffer, 0, length);\n\t\t }\n\t\t\t }\n\t\t System.out.println(\"File is copied successful!\");\n\t\t \n\t\t } catch (IOException ex) {\n\t\t ex.printStackTrace();\n\t\t }\t\t \n\t\t fr.setVisible(false);\n }}}}\n}\n}", "private void showFileChooser() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), PICK_IMAGE_REQUEST);\n }", "private void showFileChooser() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), PICK_IMAGE_REQUEST);\n }", "private void viewImage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint id= Integer.parseInt(request.getParameter(\"fileId\"));\n\t\tFiles file= new FilesDAO().view(id);\n\t\trequest.setAttribute(\"files\", file);\n\t\trequest.setAttribute(\"path\", path);\n\t\trequest.getRequestDispatcher(\"viewImage.jsp\").forward(request, response);\n\t\tSystem.out.println(file);\n\t}", "private void showFileChooser() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), PICK_IMAGE_REQUEST);\n }", "private void jMenuItem1ActionPerformed(ActionEvent evt) {\n\n\t\tif (!entry.isDisabled) {\n\n\t\t\tBufferedImage selectedImage;\n\n\t\t\tJFileChooser _fileChooser = new JFileChooser();\n\t\t\tint retval = _fileChooser.showOpenDialog(Main.this);\n\n\t\t\t/**\n\t\t\t * extensions of images user is allowed to choose\n\t\t\t */\n\t\t\tfinal String[] okFileExtensions = new String[] { \"jpg\", \"png\", \"gif\", \"bmp\", \"jpeg\" };\n\t\t\tFile file;\n\n\t\t\tif (retval == JFileChooser.APPROVE_OPTION) {\n\t\t\t\ttry {\n\t\t\t\t\tfile = _fileChooser.getSelectedFile();\n\t\t\t\t\tBoolean flag = false;\n\t\t\t\t\tfor (String extension : okFileExtensions) {\n\t\t\t\t\t\tif (file.getName().toLowerCase().endsWith(extension)) {\n\t\t\t\t\t\t\toutputFile = file;\n\t\t\t\t\t\t\tfileExtension = extension;\n\t\t\t\t\t\t\tflag = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!flag) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(this, \"Please choose a jpg, jpeg, png, bmp or gif file only.\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tentry.SavedImages.clear();\n\t\t\t\t\tentry.RedoImages.clear();\n\t\t\t\t\tselectedImage = ImageIO.read(file);\n\t\t\t\t\tImage tmg = createImage(((Image) selectedImage).getWidth(this), ((Image) selectedImage).getHeight(this));\n\t\t\t\t\tGraphics tg = tmg.getGraphics();\n\t\t\t\t\ttg.drawImage(selectedImage, 0, 0, null);\n\t\t\t\t\tentry.SavedImages.push(selectedImage);\n\t\t\t\t\tentryImage = tmg;\n\t\t\t\t\tentry.showImage(entryImage);\n\t\t\t\t\tentry.setPreferredSize(new Dimension(entryImage.getWidth(this), entryImage.getHeight(this)));\n\t\t\t\t\tint w = Math.min(entryImage.getWidth(this) + 3, getContentPane().getWidth());\n\t\t\t\t\tint h = Math.min(entryImage.getHeight(this) + 3, getContentPane().getHeight());\n\t\t\t\t\tpictureScrollPane.setBounds((getContentPane().getWidth() - w) / 2, (getContentPane().getHeight() - h) / 2, w, h);\n\t\t\t\t\tpictureScrollPane.setViewportView(entry);\n\t\t\t\t} catch (IOException ex) {\n\t\t\t\t\tLogger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public AbstractIOImage(String filePath, boolean dontLoadImage) {\n super(filePath, dontLoadImage);\n }", "void disableAutomaticHeaderImage();", "private void showFileChooser() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), 234);\n }", "public void displayImage() {\n RealImage real = new RealImage(url);\n real.displayImage();\n }", "private void setImage() throws FileNotFoundException {\n\t\timage = new Image(new FileInputStream(path));\n\t}", "private void displaySelectedImage(Intent data) {\n if (data == null) {\n return;\n }\n\n // checkPicture = true; depreciated, try catch to catch if photo exists\n Uri selectedImage = data.getData();\n String[] filePathColumn = {MediaStore.Images.Media.DATA};\n Cursor cursor = getContentResolver().query(selectedImage,\n filePathColumn, null, null, null);\n cursor.moveToFirst();\n int columnIndex = cursor.getColumnIndex(filePathColumn[0]);\n currentPhotoPath = cursor.getString(columnIndex);\n cursor.close();\n Bitmap temp = fixOrientation(BitmapFactory.decodeFile(currentPhotoPath));\n bitmapForAnalysis = temp;\n imageView.setImageBitmap(temp);\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\ti++;\n\t\t\t\tif(i >= fileList.length)i = 0;\n\t\t\t\tShowImage.multiple = 1;\n\t\t\t\tjscrollPanel.setVisible(false);\n\t\t\t\tremove(jscrollPanel);\n\t\t\t\tshowImage = new ShowImage(fileList[i]);\n\t\t\t\tjscrollPanel = new JScrollPane(showImage,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);\n\t\t\t\tjscrollPanel.setSize(xSize, ySize);\n\t\t\t\tjscrollPanel.setBounds(0, 60, xSize, ySize);\n\t\t\t\tadd(jscrollPanel);\n\t\t\t\tjscrollPanel.setVisible(false);\n\t\t\t\tjscrollPanel.setVisible(true);\n\t\t\t}", "private void botaoImagemClienteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botaoImagemClienteMouseClicked\n\n // Instancia seletor de arquivo.\n JFileChooser arquivo = new JFileChooser();\n\n // Insere filtro para png e jgp.\n arquivo.setFileFilter(filtro);\n\n // Inicia variavel para parametrizar imagem.\n BufferedImage img;\n\n // Variavel para receber imagem.\n Icon novaImg = null;\n\n // Parametro para seletor selecionar somente o pre determinado\n arquivo.setAcceptAllFileFilterUsed(false);\n\n // Instancia seletor no frame.\n arquivo.showOpenDialog(painelCadastrarCliente);\n\n // Titulo.\n arquivo.setDialogTitle(\"Escolha imagem: extensao jpg e png\");\n\n // Impede mais de uma selecao.\n arquivo.setMultiSelectionEnabled(true);\n\n // Se alguma imagem for selecionada.\n if (arquivo.getSelectedFile() != null) {\n\n // Verifica erro de Io\n try {\n\n // Parametriza a dimensao de imagem.\n int largura = 161, altura = 158;\n\n // Recebe arquivo selecionado.\n img = ImageIO.read(arquivo.getSelectedFile());\n\n // Recebe imagem parametrizada.\n novaImg = new ImageIcon(img.getScaledInstance(largura, altura,\n java.awt.Image.SCALE_SMOOTH));\n\n // Insere imagem na tela por um label.\n imgCaminho = arquivo.getSelectedFile().getAbsolutePath();\n\n } catch (IOException ex) {\n\n // Mensagem de erro.\n JOptionPane.showMessageDialog(null, \"Erro na imagem\", \"Erro\", JOptionPane.ERROR);\n\n }\n\n // Substitui label por imagem.\n imagemCliente.setIcon(novaImg);\n imagemCliente.setVisible(true);\n\n }\n }", "static void switchOriginal() {\n\n for (Iterator<Media> Fullsize = DataItem.get(currentAlbum).iterator(); Fullsize.hasNext(); ) {\n final Media Image = Fullsize.next();\n\n if (Image.MediaID.equals(CurrentPictureId)) {\n\n int imageWidth = Window.getClientWidth() - 200;\n\n FULLSIZE.setUrl(base + Image.MediaFullsizePath + \"&size=\" + imageWidth);\n FULLSIZE.setVisible(true);\n showDescription(Image);\n } else {\n DOM.getElementById(Image.MediaID).removeClassName(\"active\");\n }\n\n Action.showOriginal();\n }\n }", "public void show() {\n\t\tImageJFunctions.show( imageFloat );\t\t\n\t}", "static BufferedImage loadImage(String filename){\r\n\t\t\r\n\t\tBufferedImage image = null;\r\n\t\ttry{\r\n\t\t\timage = ImageIO.read(View.class.getResource(filename));\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace(System.err);\r\n\t\t}\r\n\t\t\r\n\t\treturn image;\r\n\t}", "public void openCustomPictureCreator() {\n\n\t\tFXMLLoader fxmlL = new FXMLLoader(getClass().getResource(\"AvatarDrawingTool.fxml\"));\n\t\ttry {\n\t\t\tBorderPane login = (BorderPane) fxmlL.load();\n\n\t\t\tScene scene = new Scene(login, 600, 400);\n\n\t\t\tStage stage = new Stage();\n\t\t\tstage.setScene(scene);\n\t\t\tstage.initModality(Modality.APPLICATION_MODAL);\n\n\t\t\tstage.showAndWait();\n\t\t\t\n\t\t\tif(custom) {\n\t\t\t\tsetImg();\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t JFileChooser chooser = new JFileChooser();\r\n\t\t\t FileNameExtensionFilter filter = new FileNameExtensionFilter(\"Image files\", ImageIO.getReaderFileSuffixes());\r\n\t\t\t chooser.setAcceptAllFileFilterUsed(false);\r\n\t\t\t chooser.setFileFilter(filter);\r\n\t\t\t int returnVal = chooser.showOpenDialog(getParent());\r\n\t\t\t if(returnVal == JFileChooser.APPROVE_OPTION) {\r\n\t\t\t try {\r\n\t\t\t\t\t loaded=chooser.getSelectedFile();\r\n\t\t\t\t\t image=new ImageIcon(ImageIO.read(loaded));\r\n\t\t\t\t\t imagename.setForeground(Color.DARK_GRAY);\r\n\t\t\t\t\t imagename.setText(loaded.getName());\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\t\t flag=true;\r\n\t\t\t \r\n\t\t\t }\r\n\t\t}", "private void fileListValueChanged() {\r\n if (this.fileList.getSelectedIndex() >= 0) {\r\n File file = listFiles.get(this.fileList.getSelectedIndex());\r\n BufferedImage myPicture;\r\n try {\r\n myPicture = ImageIO.read(file);\r\n this.setPicture(myPicture);\r\n this.SetPictureLabel(file.getName() + \" Width: \" + myPicture.getWidth() + \"px Height: \" + myPicture.getHeight() + \"px\");\r\n } catch (Exception e) {\r\n this.setPicture(null);\r\n this.SetPictureLabel(\"Could not read file.\");\r\n }\r\n /*BufferedImage myPicture = null;\r\n try {\r\n File file = listFiles.get(this.fileList.getSelectedIndex());\r\n myPicture = ImageIO.read(file);\r\n Image scaled = myPicture.getScaledInstance(jScrollPane1.getWidth(), jScrollPane1.getHeight(), Image.SCALE_SMOOTH);\r\n photoScrollPane.setIcon(new ImageIcon(scaled));\r\n //photoScrollPane.setIcon(new ImageIcon(ImageIO.read(listFiles.get(this.fileList.getSelectedIndex()))));\r\n SetPictureLabel(file.getName() + \" Width: \" + myPicture.getWidth() + \" Height: \" + myPicture.getHeight());\r\n } catch (Exception e) {\r\n photoScrollPane.setIcon(null);\r\n photoScrollPane.setText(\"Could not read file\");\r\n } */\r\n }\r\n }", "void setImageFromFile(File imageFile);", "public void subir_file()\n {\n FileChooser fc = new FileChooser();\n\n fc.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(\"PDF Files\",\"*.pdf\")\n , new FileChooser.ExtensionFilter(\"Jpg Images\",\"*.jpg\",\"*.JPEG\",\"*.JPG\",\"*.jpeg\",\"*.PNG\",\"*.png\"));\n\n File fileSelected = fc.showOpenDialog(null);\n\n if (fileSelected!= null){\n txt_ruta.setText(fileSelected.getPath());\n\n if(txt_ruta.getText().contains(\".pdf\"))\n {\n System.out.println(\"si es pdf\");\n Image image = new Image(\"/sample/Clases/pdf.png\");\n image_esquema.setImage(image);\n\n }\n else\n {\n File file = new File(txt_ruta.getText());\n javafx.scene.image.Image image = new Image(file.toURI().toString());\n image_esquema.setImage(image);\n }\n\n }\n else{\n System.out.println(\"no se seleccinoó\");\n }\n }", "void loadPhoto(String filename) throws IOException;", "public void saveAsImage(){\n\t\tif(currentView == null){\r\n\t\t\tJOptionPane.showMessageDialog(this, \"A tab must be open before an image can be saved\", \"Information\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tcurrentView.saveAsImage();\r\n\t}", "private void getImage() {\n\n Intent intent = new Intent(\n Intent.ACTION_PICK,\n android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n\n //intent.setType(\"text/xls\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n\n try {\n startActivityForResult(\n Intent.createChooser(intent, \"Complete action using\"),\n MY_INTENT_CLICK);\n }catch (Exception e) {\n e.getMessage();\n }\n }", "public void loadInputImage()\n{\n selectInput(\"Select a file to process:\", \"imageLoader\"); // select image window -> imageLoader()\n}", "@Override\n\t\t\tpublic boolean onActionItemClicked(ActionMode arg0, MenuItem arg1) {\n\t\t\t\t\n\t\t\t switch (arg1.getItemId()) {\n\t\t\t case R.id.hide:\n\t\t\t \n\t\t\t \t for(String msg:fake){\n\t\t\t \t\t File source = new File(msg);\n\t\t\t \t\t Uri imageUri = Uri.fromFile(source);\n\t\t\t \t\t String filenames=imageUri.getLastPathSegment();\n\t\t\t \t\t File destination = new File(ImageFolder, filenames);\n\t\t\t destination.list();\n\t\t\t addImageGallery(destination);\n\t\t\t try {\n\t\t\t\t\t \t\t \tmove(source, destination);\t\t\t\t\t\n\t\t\t\t\t\t\t\t source.delete();\n\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\tToast.makeText(getApplicationContext(), \"Exception1\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\t}\n\t\t\t \t \t }\n\t\t\t \t \n\t\t\t \t Toast.makeText(getApplicationContext(),count+ \" Image Unhide Successfully\", Toast.LENGTH_LONG).show();\n\t\t\t \t count=0;\n\t\t\t \t arg0.finish();\n\t\t\t return true;\n\t\t\t \t\t\t default:\n\t\t\t \t \t\t return false;\n\t\t\t }\n\t\t\t\t\t\t\t}", "public void handleActionChosenImageView(MouseEvent event){\n Integer actionSelected = buttonAction.get(event.getSource());\n System.out.println(\"input sent from gameboard Controller : execute action \" + actionSelected.toString());\n sender.sendInput(\"execute action \" + actionSelected.toString());\n\n for (Map.Entry<Integer, ImageView> entry : coverImages.entrySet()) {\n\n entry.getValue().setVisible(false);\n }\n\n }", "@Override\n\t\t\t\tpublic void onClick() {\n\t\t\t\t\tshowSDImg();\n\t\t\t\t\tdialog.dismiss();\n\t\t\t\t}", "@Override\r\n\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\tEnlargePicture_K large = new EnlargePicture_K(filePath);\r\n\t\t}", "public void openLock(ImageView imageView, int whichImage) {\n Image imageOne = new Image(getClass().getResource(\"/IMG_2657.JPG\").toString());\n Image imageTwo = new Image(getClass().getResource(\"/IMG_2658.JPG\").toString());\n imageView.setImage((whichImage == 1) ? imageOne : imageTwo);\n }", "public void setImage2(String file){ \n try {\n player = ImageIO.read(new File(file));\n } catch (IOException ex) {\n Logger.getLogger(GridSquarePanel.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void secretMode()\n {\n \tsecret = true;\n \ttry {\n\t\t\timg = ImageIO.read(new File(\"DatBoi.png\"));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n }", "@FXML\n public void pickOwnPicture(ActionEvent event) {\n FileChooser fc = new FileChooser();\n fc.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(\"Image Files\", \"*.jpg\", \"*.png\"));\n File selectedFile = fc.showOpenDialog(null);\n\n\n if (selectedFile != null) {\n pathToFile = selectedFile.getAbsolutePath();\n ;\n Image img = new Image(selectedFile.toURI().toString());\n\n ImageView mainImageView = new ImageView(img);\n mainImageView.setPreserveRatio(true);\n mainImageView.setFitWidth(imageStackPane.getWidth());\n mainImageView.setFitHeight(imageStackPane.getHeight());\n imageStackPane.getChildren().clear();\n imageStackPane.getChildren().add(mainImageView);\n\n\n }\n }", "public void setImage(String file){ \n try {\n image = ImageIO.read(new File(file));\n } catch (IOException ex) {\n Logger.getLogger(GridSquarePanel.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private boolean isHidden(Path file) {\n try {\n return Files.isHidden(file);\n } catch (IOException ioe) {\n return false;\n }\n }", "private void openCVImage(){\n Imgcodecs codec = new Imgcodecs();\n image = codec.imread(currentPhotoPath, Imgcodecs.IMREAD_COLOR);\n }", "private BufferedImage getImage(String f) {\n BufferedImage image = null;\n File file = new File(f);\n\n try {\n image = ImageIO.read(file);\n }\n catch (Exception ex) {\n JOptionPane.showMessageDialog(\n null,\n \"Image could not be read!\",\n \"Error\",\n JOptionPane.ERROR_MESSAGE);\n }\n return image;\n }", "public final void setImportantImageInfo() {\r\n int ix = 0, iy = 0, iz = 0;\r\n int i;\r\n \r\n i = 0;\r\n if (getDimElem(0).name.equalsIgnoreCase(\"time\")) {\r\n i = 1;\r\n }\r\n final String firstDim = getDimElem(i).name;\r\n Preferences.debug(\"firstDim = \" + firstDim + \"\\n\", Preferences.DEBUG_FILEIO);\r\n\r\n final String secondDim = getDimElem(i+1).name;\r\n Preferences.debug(\"secondDim = \" + secondDim + \"\\n\", Preferences.DEBUG_FILEIO);\r\n\r\n String thirdDim = null;\r\n if (getExtents().length > 2) {\r\n thirdDim = getDimElem(i+2).name;\r\n Preferences.debug(\"thirdDim = \" + thirdDim + \"\\n\", Preferences.DEBUG_FILEIO);\r\n }\r\n\r\n for (i = 0; i < varArray.length; i++) {\r\n\r\n if (varArray[i].name.equals(\"image\")) {\r\n setOffset(varArray[i].begin);\r\n Preferences.debug(\"Image offset = \" + getOffset() + \"\\n\", Preferences.DEBUG_FILEIO);\r\n\r\n switch (varArray[i].nc_type) {\r\n\r\n case NC_BYTE:\r\n if (varArray[i].signtype.equals(\"unsigned\")) {\r\n Preferences.debug(\"Data type = UBYTE\\n\", Preferences.DEBUG_FILEIO);\r\n setDataType(ModelStorageBase.UBYTE);\r\n } else {\r\n Preferences.debug(\"Data type = BYTE\\n\", Preferences.DEBUG_FILEIO);\r\n setDataType(ModelStorageBase.BYTE);\r\n }\r\n\r\n break;\r\n\r\n case NC_SHORT:\r\n if (varArray[i].signtype.equals(\"unsigned\")) {\r\n Preferences.debug(\"Data type = USHORT\\n\", Preferences.DEBUG_FILEIO);\r\n setDataType(ModelStorageBase.USHORT);\r\n } else {\r\n Preferences.debug(\"Data type = SHORT\\n\", Preferences.DEBUG_FILEIO);\r\n setDataType(ModelStorageBase.SHORT);\r\n }\r\n\r\n break;\r\n\r\n case NC_INT:\r\n if (varArray[i].signtype.equals(\"unsigned\")) {\r\n Preferences.debug(\"Data type = UINTEGER\\n\", Preferences.DEBUG_FILEIO);\r\n setDataType(ModelStorageBase.UINTEGER);\r\n } else {\r\n Preferences.debug(\"Data type = INTEGER\\n\", Preferences.DEBUG_FILEIO);\r\n setDataType(ModelStorageBase.INTEGER);\r\n }\r\n\r\n break;\r\n\r\n case NC_FLOAT:\r\n Preferences.debug(\"Data type = FLOAT\\n\", Preferences.DEBUG_FILEIO);\r\n setDataType(ModelStorageBase.FLOAT);\r\n break;\r\n\r\n case NC_DOUBLE:\r\n Preferences.debug(\"Data type = DOUBLE\\n\", Preferences.DEBUG_FILEIO);\r\n setDataType(ModelStorageBase.DOUBLE);\r\n break;\r\n\r\n default:\r\n Preferences.debug(\"varArray[\" + i + \"].nc_type illegally = \" + varArray[i].nc_type + \"\\n\", \r\n \t\tPreferences.DEBUG_FILEIO);\r\n MipavUtil.displayError(\"Invalid type in FileInfoMinc\");\r\n }\r\n\r\n for (final FileMincAttElem elem : varArray[i].vattArray) {\r\n if (elem.name.equals(\"valid_range\")) {\r\n\r\n switch (elem.nc_type) {\r\n\r\n case NC_BYTE:\r\n vmin = ((Byte) elem.values[0]).byteValue();\r\n vmax = ((Byte) elem.values[1]).byteValue();\r\n break;\r\n\r\n case NC_CHAR:\r\n vmin = ((Character) elem.values[0]).charValue();\r\n vmax = ((Character) elem.values[1]).charValue();\r\n break;\r\n\r\n case NC_SHORT:\r\n vmin = ((Short) elem.values[0]).shortValue();\r\n vmax = ((Short) elem.values[1]).shortValue();\r\n break;\r\n\r\n case NC_INT:\r\n vmin = ((Integer) elem.values[0]).intValue();\r\n vmax = ((Integer) elem.values[1]).intValue();\r\n break;\r\n\r\n case NC_FLOAT:\r\n vmin = ((Float) elem.values[0]).floatValue();\r\n vmax = ((Float) elem.values[1]).floatValue();\r\n break;\r\n\r\n case NC_DOUBLE:\r\n vmin = ((Double) elem.values[0]).doubleValue();\r\n vmax = ((Double) elem.values[1]).doubleValue();\r\n }\r\n\r\n Preferences.debug(\"vmin = \" + vmin + \"\\n\", Preferences.DEBUG_FILEIO);\r\n Preferences.debug(\"vmax = \" + vmax + \"\\n\", Preferences.DEBUG_FILEIO);\r\n } else if (elem.name.equals(\"valid_max\")) {\r\n\r\n switch (elem.nc_type) {\r\n\r\n case NC_BYTE:\r\n vmax = ((Byte) elem.values[0]).byteValue();\r\n break;\r\n\r\n case NC_CHAR:\r\n vmax = ((Character) elem.values[0]).charValue();\r\n break;\r\n\r\n case NC_SHORT:\r\n vmax = ((Short) elem.values[0]).shortValue();\r\n break;\r\n\r\n case NC_INT:\r\n vmax = ((Integer) elem.values[0]).intValue();\r\n break;\r\n\r\n case NC_FLOAT:\r\n vmax = ((Float) elem.values[0]).floatValue();\r\n break;\r\n\r\n case NC_DOUBLE:\r\n vmax = ((Double) elem.values[0]).doubleValue();\r\n }\r\n\r\n Preferences.debug(\"vmax = \" + vmax + \"\\n\", Preferences.DEBUG_FILEIO);\r\n } else if (elem.name.equals(\"valid_min\")) {\r\n\r\n switch (elem.nc_type) {\r\n\r\n case NC_BYTE:\r\n vmin = ((Byte) elem.values[0]).byteValue();\r\n break;\r\n\r\n case NC_CHAR:\r\n vmin = ((Character) elem.values[0]).charValue();\r\n break;\r\n\r\n case NC_SHORT:\r\n vmin = ((Short) elem.values[0]).shortValue();\r\n break;\r\n\r\n case NC_INT:\r\n vmin = ((Integer) elem.values[0]).intValue();\r\n break;\r\n\r\n case NC_FLOAT:\r\n vmin = ((Float) elem.values[0]).floatValue();\r\n break;\r\n\r\n case NC_DOUBLE:\r\n vmin = ((Double) elem.values[0]).doubleValue();\r\n }\r\n\r\n Preferences.debug(\"vmin = \" + vmin + \"\\n\", Preferences.DEBUG_FILEIO);\r\n }\r\n }\r\n } else if (varArray[i].name.equals(thirdDim)) {\r\n axisOrientation[0] = FileInfoMinc.setOrientType(thirdDim, (varArray[i].step > 0));\r\n ix = i;\r\n } else if (varArray[i].name.equals(secondDim)) {\r\n axisOrientation[1] = FileInfoMinc.setOrientType(secondDim, (varArray[i].step > 0));\r\n iy = i;\r\n } else if (varArray[i].name.equals(firstDim)) {\r\n axisOrientation[2] = FileInfoMinc.setOrientType(firstDim, (varArray[i].step > 0));\r\n iz = i;\r\n }\r\n }\r\n\r\n if ( (varArray[ix].cosines != null) && (varArray[iy].cosines != null) && (varArray[iz].cosines != null)) {\r\n final TransMatrix mat = new TransMatrix(3);\r\n mat.set(0, 0, varArray[ix].cosines[0]);\r\n mat.set(1, 0, varArray[ix].cosines[1]);\r\n mat.set(2, 0, varArray[ix].cosines[2]);\r\n mat.set(0, 1, varArray[iy].cosines[0]);\r\n mat.set(1, 1, varArray[iy].cosines[1]);\r\n mat.set(2, 1, varArray[iy].cosines[2]);\r\n mat.set(0, 2, varArray[iz].cosines[0]);\r\n mat.set(1, 2, varArray[iz].cosines[1]);\r\n mat.set(2, 2, varArray[iz].cosines[2]);\r\n axisOrientation = FileInfoMinc.getAxisOrientation(mat);\r\n\r\n if (varArray[ix].step < 0) {\r\n axisOrientation[0] = FileInfoBase.oppositeOrient(axisOrientation[0]);\r\n }\r\n\r\n if (varArray[iy].step < 0) {\r\n axisOrientation[1] = FileInfoBase.oppositeOrient(axisOrientation[1]);\r\n }\r\n\r\n if (varArray[iz].step < 0) {\r\n axisOrientation[2] = FileInfoBase.oppositeOrient(axisOrientation[2]);\r\n }\r\n }\r\n\r\n for (i = 0; i < axisOrientation.length; i++) {\r\n\r\n switch (axisOrientation[i]) {\r\n\r\n case ORI_UNKNOWN_TYPE:\r\n Preferences.debug(\"axisOrientation[\" + i + \"] = ORI_UNKNOWN_TYPE\\n\", Preferences.DEBUG_FILEIO);\r\n break;\r\n\r\n case ORI_R2L_TYPE:\r\n Preferences.debug(\"axisOrientation[\" + i + \"] = ORI_R2L_TYPE\\n\", Preferences.DEBUG_FILEIO);\r\n break;\r\n\r\n case ORI_L2R_TYPE:\r\n Preferences.debug(\"axisOrientation[\" + i + \"] = ORI_L2R_TYPE\\n\", Preferences.DEBUG_FILEIO);\r\n break;\r\n\r\n case ORI_P2A_TYPE:\r\n Preferences.debug(\"axisOrientation[\" + i + \"] = ORI_P2A_TYPE\\n\", Preferences.DEBUG_FILEIO);\r\n break;\r\n\r\n case ORI_A2P_TYPE:\r\n Preferences.debug(\"axisOrientation[\" + i + \"] = ORI_A2P_TYPE\\n\", Preferences.DEBUG_FILEIO);\r\n break;\r\n\r\n case ORI_I2S_TYPE:\r\n Preferences.debug(\"axisOrientation[\" + i + \"] = ORI_I2S_TYPE\\n\", Preferences.DEBUG_FILEIO);\r\n break;\r\n\r\n case ORI_S2I_TYPE:\r\n Preferences.debug(\"axisOrientation[\" + i + \"] = ORI_S2I_TYPE\\n\", Preferences.DEBUG_FILEIO);\r\n break;\r\n }\r\n }\r\n }", "private void jb_reporteusuariosActionPerformed(java.awt.event.ActionEvent evt) {\n ini.Tabla.Imprimir();\n File file2 = new File( \"C:\\\\Users\\\\Rodrigo Carcuz\\\\Desktop\\\\EDD_2S2019_PY2_201700633\\\\HashTable.jpg\" );\n try {\n Desktop.getDesktop().open(file2);\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null,\"NO SE ENCONTRO LA IMAGEN\" );\n }\n }", "public void actionPerformed(ActionEvent e) {\n img = readImage(tfIDRead.getText());\n repaint();\n }", "private void viewFileChooser() {\n try {\n JFileChooser chooser = new JFileChooser();\n chooser.showOpenDialog(null);\n f = chooser.getSelectedFile();\n// this.attachmentName = f.getName();\n// this.attachmentPath = f.getAbsolutePath();//dan mokdda karanna ona// meke file ek \n// txtAttachment.setText(attachmentPath);\n System.out.println(f.getName());\n System.out.println(f.getAbsolutePath());\n \n// Icon icon = new ImageIcon(getClass().getResource(\"/image/file.png\"));\n lblPath.setText(f.getName());\n// lblPath.setIcon(icon);\n lblPath.setVisible(true);\n \n \n } catch (NullPointerException e) {\n \n } \n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJFileChooser jfc=new JFileChooser(); \r\n\t\t jfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES ); \r\n\t\t jfc.showDialog(new JLabel(), \"选择\"); \r\n\t\t File file=jfc.getSelectedFile();\r\n\t\t if(null==file){\r\n\t\t \treturn;\r\n\t\t }\r\n\t\t if(file.isDirectory()){\r\n\t\t System.out.println(\"文件夹:\"+file.getAbsolutePath()); \r\n\t\t }else if(file.isFile()){\r\n\t\t System.out.println(\"文件:\"+file.getAbsolutePath()); \r\n\t\t }\r\n\t\t if(Util.isImage(file)){\r\n\t\t \tImageIcon img = new ImageIcon(file.getAbsolutePath());\r\n\t\t\t\t\tlbImage.setIcon(img);\r\n\t\t\t\t\tMain.img = img.getImage();\r\n\t\t }else{\r\n\t\t \tJOptionPane.showMessageDialog(Main.this, \"请选择图片\");\r\n\t\t }\r\n\t\t\t}", "private ImageIcon loadImage(String filename) {\r\n\t\tImageIcon MyImage = new ImageIcon (filename);\r\n\t\tImage img = MyImage.getImage();\r\n\r\n\t\tImage newImg = img.getScaledInstance(800,800, Image.SCALE_SMOOTH);\r\n\t\tImageIcon image = new ImageIcon(newImg);\r\n\t\treturn image;\r\n\r\n }", "private void showImage() {\n this.animalKind = (String) imageCbox.getSelectedItem();\n try {\n ImageIcon imageIcon = new ImageIcon(getClass().getResource(\"/\" + animalKind + \"E.png\")); // load the image to a imageIcon\n Image image = imageIcon.getImage(); // transform it\n Image newImg = image.getScaledInstance(120, 120, Image.SCALE_SMOOTH); // scale it the smooth way\n imageIcon = new ImageIcon(newImg);// transform it back\n imgLabel.setIcon(imageIcon);\n this.add(imgLabel, gbc);\n\n } catch (Exception exception) {\n exception.printStackTrace();\n }\n repaint();\n }", "@OnThread(Tag.Swing)\n public static void editImage(File file)\n {\n boolean success = false;\n if (imageEditor != null) {\n success = launchProgram(new File(imageEditor), file.toString());\n if(!success) {\n System.err.println(\"Could not launch the external program: \" + imageEditor);\n } \n }\n if(!success) {\n editFile(file);\n }\n }", "protected BufferedImage loadImage(String nameOfFile)\n {\n BufferedImage img;\n try{\n img= ImageIO.read(new File(\"\"+nameOfFile));\n return img;\n }\n catch(IOException e)\n {\n System.out.println(e);\n }\n return null;\n }", "public static void testDecodePicture(){\n\t Picture wall = new Picture(\"wall.jpg\");\n\t Picture caterpillar = new Picture(\"caterpillar.jpg\");\n\t wall.hidePicture(caterpillar);\n\t wall.explore();\n\t wall.decodePicture();\n\t wall.explore();\n }", "public BufferedImage readImage() throws IOException{\n\t\tFile read = new File(\"src/blue_plate.png\");\n\t\t//decodes a supplied File and returns a BufferedImage\n\t\tBufferedImage master = ImageIO.read(read);\n\t\treturn master;\n\t\t\n\t}", "public void processAddImageOverlay() {\n PropertiesManager props = PropertiesManager.getPropertiesManager();\n\n // AND NOW ASK THE USER FOR THE FILE TO OPEN\n FileChooser fc = new FileChooser();\n fc.setInitialDirectory(new File(PATH_WORK));\n fc.setTitle(props.getProperty(LOAD_WORK_TITLE));\n File imageOverlayFile = fc.showOpenDialog(app.getGUI().getWindow());\n \n // SEND THE IMAGE FILE TO DATA MANAGER\n dataManager.setImageOverlayFile(imageOverlayFile);\n \n // CHANGE THE CURSOR\n Scene scene = app.getGUI().getPrimaryScene();\n scene.setCursor(Cursor.CROSSHAIR);\n \n // CHANGE THE STATE\n dataManager.setState(mmmState.ADD_IMAGE_MODE);\n }", "public void openImage() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(intent, IMAGE_REQUEST);\n }" ]
[ "0.64555657", "0.62676626", "0.6207651", "0.61660725", "0.6101619", "0.60968846", "0.60757947", "0.60743743", "0.60560095", "0.6026526", "0.60242933", "0.5977768", "0.59182715", "0.5911839", "0.59081966", "0.59024185", "0.58983207", "0.58976036", "0.5880383", "0.58020115", "0.5793752", "0.5789598", "0.5783469", "0.57793885", "0.5759909", "0.57420594", "0.5739394", "0.57119006", "0.57092774", "0.56911", "0.56766975", "0.56759775", "0.5674282", "0.5669992", "0.5665094", "0.5657508", "0.5638468", "0.5624701", "0.5619237", "0.5607584", "0.5588048", "0.5580652", "0.5566517", "0.5565605", "0.55494016", "0.5542424", "0.5533121", "0.55248815", "0.552037", "0.5508174", "0.5501152", "0.5501152", "0.54899484", "0.5483964", "0.5483123", "0.5471794", "0.54699165", "0.5469113", "0.5465726", "0.5465328", "0.54616773", "0.54514843", "0.54442084", "0.5442312", "0.5439576", "0.54348654", "0.5420662", "0.5416456", "0.54103196", "0.5405077", "0.54017216", "0.53962004", "0.5394049", "0.53935987", "0.5371209", "0.53701484", "0.5365645", "0.5365128", "0.5359281", "0.5358784", "0.5337657", "0.53336483", "0.5318805", "0.531075", "0.5310191", "0.5301304", "0.5300374", "0.5295821", "0.5292819", "0.5277979", "0.5269015", "0.52687967", "0.5268114", "0.5268088", "0.5255853", "0.5248069", "0.52468354", "0.5242055", "0.5238512", "0.5233808" ]
0.5563681
44
openfile ends It hides the binary data in the least significant bit of the image
public void init24() { width= p[21]<<24 | p[20]<<16 | p[19]<<8 | p[18]; height= p[25]<<24 | p[24]<<16 | p[23]<<8 | p[22]; int extra=(width*3)%4; if(extra!=0) padding=4-extra; int x,z=54; l=0; int j=0; for(int q=0;q<height;q++) { x=0; while(x<width) { b=p[z]&0xff; if(j<maxbinary) { if(binary[j]!=0) { p1[z]=p[z]&0xff|binary[j++]; b1=p1[z]&0xff; } else { p1[z]=p[z]&0xff & (binary[j++]|0xfe); b1=p1[z]&0xff; } } else b1=p[z]&0xff; g=p[z+1]&0xff; if(j<maxbinary) { if(binary[j]!=0) { p1[z+1]=p[z+1]&0xff|binary[j++]; g1=p[z+1]&0xff; } else { p1[z+1]=p[z+1]&0xff & (binary[j++]|0xfe); g1=p1[z+1]&0xff; } } else g1=p[z]&0xff; r=p[z+2]&0xff; if(j<maxbinary) { if(binary[j]!=0) { p1[z+2]=p[z+2]&0xfe|binary[j++]; r1=p[z+2]&0xff; } else { p1[z+2]=p[z+2]&0xff & (binary[j++]|0xfe); r1=p1[z+2]&0xff; } } else r1=p[z]&0xff; z=z+3; pix[l]= 255<<24 | r<<16 | g<<8 | b; pix1[l]= 255<<24 | r1<<16 | g1<<8 | b1; l++; x++; } z=z+padding; } int k; x=0; for(i=l-width;i>=0;i=i-width) //l=WIDTH * height { for(k=0;k<width;k++) { pixels[x]=pix[i+k]; pixels1[x]=pix[i+k]; x++; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BufferedImage open(String id, int no)\n throws FormatException, IOException\n {\n if (!id.equals(currentId)) initFile(id);\n \n if (no < 0 || no >= getImageCount(id)) {\n throw new FormatException(\"Invalid image number: \" + no);\n }\n \n // First initialize:\n in.seek(offsets[no] + 12);\n byte[] toRead = new byte[4];\n in.read(toRead);\n int blockSize = batoi(toRead);\n toRead = new byte[1];\n in.read(toRead);\n // right now I'm gonna skip all the header info\n // check to see whether or not this is v2 data\n if (toRead[0] == 1) {\n in.skipBytes(128);\n }\n in.skipBytes(169);\n // read in the block of data\n toRead = new byte[blockSize];\n int read = 0;\n int left = blockSize;\n while (left > 0) {\n int i = in.read(toRead, read, left);\n read += i;\n left -= i;\n }\n byte[] pixelData = new byte[blockSize];\n int pixPos = 0;\n \n Dimension dim;\n try { dim = pictReader.getDimensions(toRead); }\n catch (Exception e) { dim = new Dimension(0, 0); }\n \n int length = toRead.length;\n int num, size, blockEnd;\n int totalBlocks = -1; // set to allow loop to start.\n int expectedBlock = 0;\n int pos = 0;\n int imagePos = 0;\n int imageSize = dim.width * dim.height;\n short[] flatSamples = new short[imageSize];\n byte[] temp;\n boolean skipflag;\n \n // read in deep grey pixel data into an array, and create a\n // BufferedImage out of it\n //\n // First, checks the existence of a deep gray block. If it doesn't exist,\n // assume it is PICT data, and attempt to read it.\n \n // check whether or not there is deep gray data\n while (expectedBlock != totalBlocks) {\n skipflag = false;\n while (pos + 7 < length &&\n (toRead[pos] != 73 || toRead[pos + 1] != 86 ||\n toRead[pos + 2] != 69 || toRead[pos + 3] != 65 ||\n toRead[pos + 4] != 100 || toRead[pos + 5] != 98 ||\n toRead[pos + 6] != 112 || toRead[pos + 7] != 113))\n {\n pos++;\n }\n if (pos + 32 > length) { // The header is 32 bytes long.\n if (expectedBlock == 0 && imageType[no] < 9) {\n // there has been no deep gray data, and it is supposed\n // to be a pict... *crosses fingers*\n try { return pictReader.openBytes(toRead); }\n catch (Exception e) {\n e.printStackTrace();\n throw new FormatException(\"No iPic comment block found\", e);\n }\n }\n else {\n throw new FormatException(\"Expected iPic comment block not found\");\n }\n }\n \n pos += 8; // skip the block type we just found\n \n // Read info from the iPic comment. This serves as a\n // starting point to read the rest.\n temp = new byte[] {\n toRead[pos], toRead[pos+1], toRead[pos+2], toRead[pos+3]\n };\n num = batoi(temp);\n if (num != expectedBlock) {\n throw new FormatException(\"Expected iPic block not found\");\n }\n expectedBlock++;\n temp = new byte[] {\n toRead[pos+4], toRead[pos+5], toRead[pos+6], toRead[pos+7]\n };\n if (totalBlocks == -1) {\n totalBlocks = batoi(temp);\n }\n else {\n if (batoi(temp) != totalBlocks) {\n throw new FormatException(\"Unexpected totalBlocks numbein.read\");\n }\n }\n \n // skip to size\n pos += 16;\n temp = new byte[] {\n toRead[pos], toRead[pos+1], toRead[pos+2], toRead[pos+3]\n };\n size = batoi(temp);\n pos += 8;\n blockEnd = pos + size;\n \n // copy into our data array.\n System.arraycopy(toRead, pos, pixelData, pixPos, size);\n pixPos += size;\n }\n int pixelValue = 0;\n pos = 0;\n \n // Now read the data and wrap it in a BufferedImage\n \n while (true) {\n if (pos + 1 < pixelData.length) {\n pixelValue = pixelData[pos] < 0 ? 256 + pixelData[pos] :\n (int) pixelData[pos] << 8;\n pixelValue += pixelData[pos + 1] < 0 ? 256 + pixelData[pos + 1] :\n (int) pixelData[pos + 1];\n }\n else throw new FormatException(\"Malformed LIFF data\");\n flatSamples[imagePos] = (short) pixelValue;\n imagePos++;\n if (imagePos == imageSize) { // done, return it\n return ImageTools.makeImage(flatSamples,\n dim.width, dim.height, 1, false);\n }\n }\n }", "public BufferedImage open() {\n\t\tJFileChooser choose = new JFileChooser(); //Removed path from the chooser!\n\n\t\tif (choose.showOpenDialog(null) != JFileChooser.APPROVE_OPTION)\n\t\t\treturn null;\n\t\tString file = choose.getSelectedFile().getAbsolutePath();\n\t\ttry {\n\t\t\tthis.x = 0;\n\t\t\tthis.y = 0;\n\t\t\tFileInputStream fis = new FileInputStream(file); \n\t\t\tObjectInputStream ois = new ObjectInputStream(fis);\n\t\t\tString iden = \"\";\n\t\t\tiden += ois.readChar();\n\t\t\tiden += ois.readChar();\n\t\t\tiden += ois.readChar();\n\t\t\t\n\t\t\tif (iden.compareTo(\"PPL\") != 0)\treturn null;\n\t\t\tbyte by = ois.readByte();\n\t\t\tSystem.out.println(by);\n\t\t\t\n\t\t\tswitch (by) {\n\t\t\t\tcase 0:\n\t\t\t\t\tthis.image = loadRGB(ois);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.image = loadCMY(ois);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tthis.image = loadGS(ois);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tthis.image = loadBW(ois);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tthis.image = loadLT(ois);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tois.close();\n\t\t\t//int b = ois.readByte(); //lee 8 bits, lee -16, y no 240\n\t\t\t//si el bit mas significativo del byte antes de introducirse fue 1, el numero leido se interpreta como negativo\n\t\t\t//if(b < 0) b += 256; //para leer bytes sin signo\n\t\t\t//int i = ois.readInt(); //lee 32 bits, lee 3500\n\t\t} catch (FileNotFoundException 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\t\treturn image;\n\t}", "private native void TIFFClose();", "private void openFile(File file)\n {\n String imagePath = file.toURI().toString();\n Image image = new Image(imagePath);\n if ( image == null || image.isError())\n {\n showInvalidFileFormatError();\n } else\n {\n bufferImage = image;\n changeAvatarCircle.setFill(new ImagePattern(image));\n imagePathLabel.setText(imagePath);\n }\n }", "public void openimagefile(String fn,int sno)\n {\n\t try\n\t {\n\t i=0;\n\t FileInputStream fis = new FileInputStream(fn);\n\t DataInputStream dis=new DataInputStream(fis);\n\t while((ch=dis.readUnsignedByte())!=-1)\n\t {\n\t\tp[i]=ch;\n p1[i]=ch;\n\t\ti++;\n\t }\n fis.close();\n dis.close();\n }\n catch(Exception e)\n\t{\n maxp=i;\n switch(p[28])\n\t {\n \t case 24:\n \t\t{\n init24();\n\t \tbreak;\n } //case 24 ends\n\t } // switchp[28] ends\n\t} //catch() ends\n img=createImage(new MemoryImageSource(width,height,pixels,0,width));\n img1=createImage(new MemoryImageSource(width,height,pixels1,0,width));\n }", "public ModelImage readImage(boolean one) throws IOException {\r\n // The data types are Sun, hence the byte order is big-endian.\r\n int i;\r\n int num; //image number within file\r\n\r\n boolean endianess = LITTLE_ENDIAN;\r\n\r\n try {\r\n file = new File(fileDir + fileName);\r\n raFile = new RandomAccessFile(file, \"r\");\r\n progressBar = new ViewJProgressBar(ViewUserInterface.getReference().getProgressBarPrefix() + fileName,\r\n ViewUserInterface.getReference().getProgressBarPrefix() + \"BioRad image(s) ...\", 0, 100,\r\n false, null, null);\r\n xDim = getSignedShort(endianess); // 0\r\n yDim = getSignedShort(endianess); // 2\r\n zDim = getSignedShort(endianess); // 4\r\n ramp1Min = (short)getSignedShort(endianess); // 6\r\n ramp1Max = (short)getSignedShort(endianess); // 8\r\n notes = getInt(endianess); // 10\r\n byteFormat = (short)getSignedShort(endianess); // 14\r\n num = (short)getSignedShort(endianess); // 16\r\n\r\n setProgressBarVisible(!one);\r\n\r\n for (i = 0; i < 32; i++) {\r\n name[i] = 0;\r\n }\r\n readAgain = true;\r\n i = 0;\r\n while(readAgain) {\r\n name[i++] = raFile.readByte(); // 18\r\n if (name[i-1] == 0) {\r\n readAgain = false;\r\n }\r\n }\r\n fName = new String(name,0,i-1);\r\n raFile.seek(50);\r\n merged = (short)getSignedShort(endianess); // 50\r\n color1 = getUnsignedShort(endianess); // 52\r\n fileID = getUnsignedShort(endianess); // 54\r\n if (fileID != 12345) {\r\n throw new IOException(\"fileID is an illegal \" + fileID);\r\n }\r\n ramp2Min = (short)getSignedShort(endianess); // 56\r\n ramp2Max = (short)getSignedShort(endianess); // 58\r\n color2 = getUnsignedShort(endianess); // 60\r\n edited = (short)getSignedShort(endianess); // 62\r\n lens = (short)getSignedShort(endianess); // 64\r\n magFactor = getFloat(endianess); // 66\r\n // Position to the start of the image data\r\n raFile.seek(76);\r\n\r\n fileInfo = new FileInfoBioRad(fileName, fileDir, FileBase.BIORAD); // dummy fileInfo\r\n fileInfo.setEndianess(endianess);\r\n if (zDim > 1) {\r\n imgExtents = new int [3];\r\n imgExtents[0] = xDim;\r\n imgExtents[1] = yDim;\r\n imgExtents[2] = zDim;\r\n }\r\n else {\r\n imgExtents = new int [2];\r\n imgExtents[0] = xDim;\r\n imgExtents[1] = yDim;\r\n }\r\n\r\n fileInfo.setExtents(imgExtents);\r\n if (byteFormat == 1) {\r\n dataType = ModelStorageBase.UBYTE;\r\n bufferSize = xDim*yDim;\r\n }\r\n else { // byteFormat == 0\r\n dataType = ModelStorageBase.SHORT;\r\n bufferSize = xDim*yDim;\r\n }\r\n /*else { // merged pseudocolor\r\n dataType = ModelStorageBase.ARGB;\r\n bufferSize = 4*xDim*yDim;\r\n }*/\r\n fileInfo.setDataType(dataType);\r\n\r\n if (one) {\r\n image = new ModelImage(dataType, new int[] {imgExtents[0], imgExtents[1]}, fileInfo.getFileName(), UI);\r\n zDim = 1;\r\n }\r\n else {\r\n image = new ModelImage(dataType, imgExtents, fileInfo.getFileName(), UI);\r\n }\r\n\r\n imgBuffer = new float[bufferSize];\r\n for (i = 0; i < zDim; i++){\r\n try {\r\n if (one && imgExtents.length > 2) {\r\n if (dataType == ModelStorageBase.UBYTE) {\r\n raFile.seek(imgExtents[2]/2*xDim*yDim);\r\n }\r\n else {\r\n raFile.seek(imgExtents[2]*xDim*yDim);\r\n }\r\n readBuffer(imgExtents[2]/2, imgBuffer);\r\n }\r\n else {\r\n readBuffer(i, imgBuffer); // Slice a time;\r\n }\r\n image.setFileInfo(fileInfo, i);\r\n }\r\n catch (IOException error){\r\n throw new IOException(\"FileTiff: read: \" + error);\r\n }\r\n image.importData(i*bufferSize, imgBuffer, false);\r\n } // for (i = 0; i < imageSlice; i++)\r\n\r\n raFile.close();\r\n progressBar.dispose();\r\n }\r\n catch (OutOfMemoryError error) {\r\n if (image != null) {\r\n image.disposeLocal();\r\n image = null;\r\n }\r\n byteBuffer = null;\r\n System.gc();\r\n throw error;\r\n }\r\n\r\n return image;\r\n }", "public void closeImage() {\n\n\t}", "public static void downloadimage(String file) throws IOException {\r\n\t\t\r\n\t\t//work with the given url to split it into the host and path\r\n\t\tint from = file.indexOf(\"//\") + 2;\r\n\t\tint to = file.indexOf(\"/\", from);\r\n\t\tString temphost = file.substring(from, to);\r\n\t\tString path = file.substring(to);\r\n\r\n\t\t//make new socket and streams\r\n\t\tlistenSocket(temphost,port);\r\n\r\n\t\tint buffersize = 2048;\r\n\t\tbyte[] b = new byte[buffersize];\r\n\t\tint length=0;\r\n\t\tString[] tokens = file.split(\"\\\\/(?=[^\\\\/]+$)\");\r\n\t\t\r\n\t\t//get request\r\n\t\tout.println(\"GET \" + file + \" HTTP/1.1\\r\\nHost: \" + temphost + \"\\r\\n\");\r\n\t\t\r\n\t\t//sleep for one second\r\n\t\ttry{\r\n\t\t\tTimeUnit.SECONDS.sleep(1);\r\n\t\t}\r\n\t\tcatch (Exception e){\r\n\t\t\tSystem.out.println(\"failed to wait\");\r\n\t\t}\r\n\t\tOutputStream os = new FileOutputStream(tokens[1]);\r\n\t\tSystem.out.println(\"Image: \" + tokens[1] + \"\\n\");\r\n\t\t\r\n\t\tboolean tempboolean = true;\t\r\n\t\t\r\n\t\t//read the first interval of bytes\r\n\t\tlength = dis.read(b, 0, buffersize);\r\n\t\tint i=0;\r\n\r\n\t\t//search for the string \"\\r\\n\\r\\n\" and move the index to the postion after the string\r\n\t\twhile (true)\r\n\t\t{\t\r\n\t\t\tif (b[i]==13)\r\n\t\t\t{\r\n\t\t\t\tif (b[i+1] ==10)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (b[i+2] ==13)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (b[i+3] ==10)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\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\ti++;\r\n\t\t}\r\n\t\ti = i+4;\r\n\r\n\t\t//write the rest of the buffer after the found index to the file.\r\n\t\tos.write(b, i, buffersize-i);\r\n\t\tos.flush();\r\n\t\t\r\n\t\t//write the rest of the file to the buffer until done.\r\n\t\twhile (tempboolean) {\r\n\t\t\tlength = dis.read(b);\r\n\r\n\t\t\tos.write(b, 0, length);\r\n\t\t\tos.flush();\r\n\t\t\ttempboolean = (length >= buffersize);\r\n\t\t}\r\n\t\tos.close();\r\n\t}", "private void updateImageFile() throws FileNotFoundException {\n \t\tfinal PrintWriter out = new PrintWriter(asciiImageFile);\n \t\tout.print(asciiImage(false));\n \t\tout.close();\n \t}", "public void openImage() {\t\n\t\ttry {\n\t\t\timg.openImage(list);\n\t\t} \t\n\n\t\tcatch (BrokenImageException ex) {\n\t\t\ttry{\n\t\t\t\tif(!validImageContent())\n\t\t\t\t\tthrow new BadImageContentException(\"The image is broken \"\n\t\t\t\t\t\t\t+ \"due to corrupt content\");\n\t\t\t\tif(!validImageHeader())\n\t\t\t\t\tthrow new BadImageHeaderException(\"The image is broken\"\n\t\t\t\t\t\t\t+ \" due to a damaged header\");\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\"Please catch the proper Image-related Exception.\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void Func_imagefile(){\n\n\t\tswf_env.containImg = true;\n\n\n\t\tthis.value = new SWFValue(\"Func\");\n\n\t\tString path = this.getAtt(\"path\", \".\");\n\t\tString filename = this.getAtt(\"default\");\n\t\tString type = \"auto\";\n\t\tvalue.instanceName = \"img\"+ Integer.toString(swf_env.instanceID);\n\t\tvalue.data = \"\";\n\t\tvalue.imgpath = path + \"/\" + filename;\n\t\tvalue.inter_imgpath = path + \"/\" + filename;\n\t\tvalue.inter_name = \"intimg\" + Integer.toString(swf_env.interactionImgNUM);\n\t\tvalue.tmp = \"tmp\" + Integer.toString(swf_env.interactionImgNUM);\n\t\tvalue.lnum = Integer.toString(swf_env.visibleflag_counter);\n\n\n\t\tif(!path.startsWith(\"/\")) {\n\t\t\tString basedir = GlobalEnv.getBaseDir();\n\t\t\tLog.out(\"basedir= \" +basedir);\n\t\t\tif(basedir != null && basedir != \"\") {\n\t\t\t\tpath = basedir + path;\n\t\t\t}\n\t\t}\n\n\t\tString filepath = path + \"/\" + filename;\n\n\n\t\tsetDecoration1();\n\t\tvalue.margin = margin;\n\n\n\t\tSystem.out.println(\"filepath = \"+filepath);\n\t\tint img = swf_env.open_image_file(type, filepath);\n\t\tvalue.img = img;\n\n\t\tdata_width = swf_env.get_value(\"imagewidth\", img);\n\t\tdata_height = swf_env.get_value(\"imageheight\", img);\n\t\tSystem.out.println(\"imagesize: \"+data_width+\" \"+data_height);\n\t\twidth = data_width + margin * 2;\n\t\theight = data_height + margin * 2;\n\n\n\t\tsetDecoration2();\n\n\t\tif(data_width > width){\n\t\t\tint original_width = data_width;\n\t\t\tdata_width = width - margin * 2;\n\t\t\tint scale = data_width / original_width;\n\t\t\tdata_height = data_height * scale;\n\t\t\theight = data_height + margin * 2;\n\t\t}\n\t\tif(data_height > height){\n\t\t\tint original_height = data_height;\n\t\t\tdata_height = height - margin * 2;\n\t\t\tint scale = data_height / original_height;\n\t\t\tdata_width = data_width * scale;\n\t\t\twidth = data_width + margin * 2;\n\t\t}\n\n\t\tvalue.data_width = data_width;\n\t\tvalue.data_height = data_height;\n\t\tvalue.width = width;\n\t\tvalue.height = height;\n\t\t//morya wrote\n\t\tvalue.int_w = width;\n\t\tvalue.int_h = height;\n\n\n\t\tsetDecoration3();\n\n\t\tswf_env.tmp_width = width;\n\t\tswf_env.tmp_height = height;\n\n\n\t\tswf_env.instanceID++;\n\n\t}", "private void openImageFile(ImageActions action) {\n\t\tsetImageHolder(action, RGPTUIUtil.getImageFile(this));\r\n\t}", "void nikon_e900_load_raw()\n{\n int offset=0, irow, row, col;\n\n for (irow=0; irow < height; irow++) {\n row = irow * 2 % height;\n if (row == 1)\n offset = - (-offset & -4096);\n CTOJ.fseek (ifp, offset, CTOJ.SEEK_SET);\n offset += raw_width;\n getbits(-1);\n for (col=0; col < width; col++)\n BAYER(row,col, (short)getbits(10));\n }\n}", "private static native long imread_0(String filename, int flags);", "void loadPhoto(String filename) throws IOException;", "public void run() {\n System.out.print(Thread.currentThread().getId() + \"\\n\");\n try {\n try {\n File outfile = new File(dataPath + imageFile.getName().replace(\"jpg\", \"txt\"));\n if (outfile.exists()) {\n return;\n }\n String ms = \"nada\";\n records.write(\"<\");\n records.write(imageFile.getName() + \">\\n\");\n BufferedImage bin = ImageHelpers.readAsBufferedImage(imageFile.getAbsolutePath());\n bin = ImageHelpers.scale(bin, maxHeight);\n orig = ImageHelpers.readAsBufferedImage(imageFile.getAbsolutePath());\n orig = ImageHelpers.scale(orig, maxHeight);\n BufferedImage stored = cloneImage(ImageHelpers.scale(orig, maxHeight));\n BufferedImage copy = ImageHelpers.readAsBufferedImage(imageFile.getAbsolutePath());\n copy = ImageHelpers.scale(copy, maxHeight);\n records.flush();\n System.out.println(imageFile.getName());\n PlanarImage threshedImage = JAI.create(\"fileload\", imageFile.getAbsolutePath());\n BufferedImage ok = threshedImage.getAsBufferedImage();\n bin = ImageHelpers.scale(ImageHelpers.binaryThreshold(ok, 4), maxHeight);\n for (int i = 0; i < bin.getWidth(); i++) {\n for (int j = 0; j < bin.getHeight(); j++) {\n orig.setRGB(i, j, -1);\n }\n }\n Boolean doBlobExtract = true;\n if (doBlobExtract) {\n for (int i = 0; i < bin.getWidth(); i++) {\n for (int j = 0; j < bin.getHeight(); j++) {\n orig.setRGB(i, j, -1);\n }\n }\n //ImageHelpers.writeImage(bin, \"/usr/web/broken/\" + imageFile.getName() + \"bin\" + \".jpg\");\n Vector<blob> blobs = new Vector<blob>();\n for (int i = 0; i < bin.getWidth(); i++) {\n for (int j = 0; j < bin.getHeight(); j++) {\n if (bin.getRGB(i, j) != -1) {\n blob thisOne = new blob(i, j);\n thisOne.copy = orig;\n if (blobs.size() % 3 == 0) {\n thisOne.color = 0xcc0000;\n }\n if (blobs.size() % 3 == 1) {\n thisOne.color = 0x000099;\n }\n if (blobs.size() % 3 == 2) {\n thisOne.color = 0x006600;\n }\n thisOne.count(bin, thisOne.getX(), thisOne.getY());\n if (thisOne.size > 5) {\n blobs.add(thisOne);\n if ((thisOne.getSize() - (thisOne.getSize() % 10)) != 5000 && (thisOne.getSize() - (thisOne.getSize() % 10)) != 0) {\n\n thisOne.calculateRelativeCoordinates();\n thisOne.drawBlob(orig, thisOne.color);\n\n }\n }\n }\n }\n }\n BufferedWriter blobWriter = new BufferedWriter(new FileWriter(outfile));\n\n int ctr = 1;\n for (int i = 0; i < blobs.size(); i++) {\n if ((blobs.get(i).size < 4000)) {\n try {\n blobs.get(i).id = ctr;\n ctr++;\n //blobs.get(i).color=0x000000;\n blobs.get(i).arrayVersion = blobs.get(i).pixels.toArray(new pixel[blobs.get(i).pixels.size()]);\n int maxX = 0;\n for (int k = 0; k < blobs.get(i).arrayVersion.length; k++) {\n if (blobs.get(i).arrayVersion[k].x > maxX) {\n maxX = blobs.get(i).arrayVersion[k].x;\n }\n }\n blobs.get(i).width = maxX;\n int maxY = 0;\n for (int k = 0; k < blobs.get(i).arrayVersion.length; k++) {\n if (blobs.get(i).arrayVersion[k].y > maxY) {\n maxY = blobs.get(i).arrayVersion[k].y;\n }\n }\n blobs.get(i).height = maxY;\n\n\n blobs.get(i).matrixVersion = new matrixBlob(blobs.get(i));\n } catch (Exception e) {\n e.printStackTrace();\n }\n // blob.writeBlob(blobWriter, blobs.get(i));\n blob.writeMatrixBlob(blobWriter, blobs.get(i));\n blobs.set(i, null);//.matrixVersion=null;\n //blobs.get(i).arrayVersion=null;\n // blob.writeBlob(blobWriter, blobs.get(i));\n //blob.drawBlob(orig, blobs.get(i).x, blobs.get(i).y, blobs.get(i), 0x000000);\n }\n }\n System.out.print(\"found \" + ctr + \" blobs\\n\");\n\n }\n\n try {\n\n\n if (!doBlobExtract) {\n orig = bin;\n }\n //ImageHelpers.writeImage(orig, \"/usr/web/broken/\" + imageFile.getName() + \"broken\" + \".jpg\");\n\n Vector<line> lines = new Vector();\n createViewableVerticalProfile(orig, imageFile.getName(), lines);\n //ImageHelpers.writeImage(ImageHelpers.createViewableVerticalProfile(orig, imageFile.getName(), lines), \"/usr/web/broken/profile\" + imageFile.getName() + \"broken\" + \".jpg\");\n FileWriter writer = null;\n //writer = new FileWriter(new File(\"/usr/web/queries/\" + imageFile.getName() + \"\"));\n orig = ImageHelpers.scale(orig, 1000);\n Detector d = new Detector(orig, orig);\n if (lines.size() > 3) {\n lines = new Vector();\n lines.add(new line());\n lines.get(0).setStartHorizontal(0);\n lines.get(0).setStartVertical(0);\n lines.get(0).setWidth(orig.getWidth());\n lines.get(0).setDistance(maxHeight);\n }\n //d.detect();\n for (int i = 0; i < lines.size(); i++) {\n line col = lines.get(i);\n BufferedImage storedBin = ImageHelpers.binaryThreshold(stored, 4);\n BufferedImage colOnly = storedBin.getSubimage(col.getStartHorizontal(), col.getStartVertical(), col.getWidth(), col.getDistance());\n d = new Detector(colOnly, colOnly);\n d.debugLabel = imageFile.getName();\n d.forceSingle = true;\n d.detect();\n System.out.print(\"total lines in col is \" + d.lines.size() + \"\\n\");\n for (int j = 0; j < d.lines.size(); j++) {\n line r = d.lines.get(j);\n r.setStartHorizontal(r.getStartHorizontal() + col.getStartHorizontal());\n r.setStartVertical(r.getStartVertical() + col.getStartVertical());\n //r.commitQuery(writer, imageFile.getName());\n if (j % 2 == 1) {\n int color = 0x0000ff;\n stored = highlightBlock(stored, r.getStartHorizontal(), r.getStartVertical() - r.getDistance(), r.getDistance(), r.getWidth(), color);\n } else {\n int color = 0xff0000;\n stored = highlightBlock(stored, r.getStartHorizontal(), r.getStartVertical() - r.getDistance(), r.getDistance(), r.getWidth(), color);\n }\n }\n }\n //ImageHelpers.writeImage(stored, \"\" + \"/usr/web/processed/\" + imageFile.getName());\n\n\n\n //writer.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n } catch (IOException ex) {\n System.out.print(ex.getMessage() + \"\\n\");\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return;\n }", "public void openImage() {\n InputStream f = Controller.class.getResourceAsStream(\"route.png\");\n img = new Image(f, mapImage.getFitWidth(), mapImage.getFitHeight(), false, true);\n h = (int) img.getHeight();\n w = (int) img.getWidth();\n pathNodes = new GraphNodeAL[h * w];\n mapImage.setImage(img);\n //makeGrayscale();\n }", "public void descargarArchivoVeri()throws SQLException, IOException {\n //conexion con el resultset\n st = cn.createStatement();\n\n // consulta de descarga el getId es la variable que utilizo para ubicarme en la base de datos\n ResultSet rs = st.executeQuery(\"select anexo_veri, nombre FROM anexoverificacion where idverificacion=\"+rt.getId());\ntry {\n \nrs.next();\n// pone en la variable el nombre del archivo de la base de datos\nnombre= rs.getString(\"nombre\");\n// inserta la ruta completa\nFile file = new File(rt.getPath()+nombre);\n// salida del archivo de flujo\nFileOutputStream output = new FileOutputStream(file);\nBlob archivo = rs.getBlob(1);\nInputStream inStream = archivo.getBinaryStream();\n// almacenamiento del tamaño y descarga byte a byte\nint length= -1;\nint size = (int) archivo.length();\nbyte[] buffer = new byte[size];\nwhile ((length = inStream.read(buffer)) != -1) {\noutput.write(buffer, 0, length);\nJOptionPane.showMessageDialog(null,\"El archivo se descargo correctamente\");\n// output.flush();\n\n}\n// inStream.close();\noutput.close();\n} catch (Exception ioe) {\nthrow new IOException(ioe.getMessage());\n}\n}", "public void openFile()\n { \n JFileChooser chooser = new JFileChooser();\n chooser.setCurrentDirectory(new File(\".\"));\n \n chooser.setFileFilter(new\n javax.swing.filechooser.FileFilter()\n { \n public boolean accept(File f)\n { \n String name = f.getName().toLowerCase();\n return name.endsWith(\".gif\") || name.endsWith(\".jpg\") || name.endsWith(\".jpeg\")\n || f.isDirectory();\n }\n public String getDescription() { return \"Image files\"; }\n });\n\n int r = chooser.showOpenDialog(this);\n if(r != JFileChooser.APPROVE_OPTION) return;\n\n try\n {\n image = ImageIO.read(chooser.getSelectedFile());\n }\n catch (IOException e)\n {\n JOptionPane.showMessageDialog(this, e);\n }\n repaint();\n }", "protected void initFile(String id) throws FormatException, IOException {\n super.initFile(id);\n in = new RandomAccessFile(id, \"r\");\n \n // initialize an array containing tag offsets, so we can\n // use an O(1) search instead of O(n) later.\n // Also determine whether we will be reading color or grayscale\n // images\n \n //in.seek(0);\n byte[] toRead = new byte[4];\n in.read(toRead);\n long order = batoi(toRead); // byte ordering\n little = toRead[2] != 0xff || toRead[3] != 0xff;\n \n toRead = new byte[4];\n Vector v = new Vector(); // a temp vector containing offsets.\n \n // Get first offset.\n in.seek(16);\n in.read(toRead);\n int nextOffset = batoi(toRead);\n int nextOffsetTemp;\n \n boolean first = true;\n while(nextOffset != 0) {\n in.seek(nextOffset + 4);\n in.read(toRead);\n // get next tag, but still need this one\n nextOffsetTemp = batoi(toRead);\n in.read(toRead);\n if ((new String(toRead)).equals(\"PICT\")) {\n boolean ok = true;\n if (first) {\n // ignore first image if it is called \"Original Image\" (pure white)\n first = false;\n in.skipBytes(47);\n byte[] layerNameBytes = new byte[127];\n in.read(layerNameBytes);\n String layerName = new String(layerNameBytes);\n if (layerName.startsWith(\"Original Image\")) ok = false;\n }\n if (ok) v.add(new Integer(nextOffset)); // add THIS tag offset\n }\n if (nextOffset == nextOffsetTemp) break;\n nextOffset = nextOffsetTemp;\n }\n \n in.seek(((Integer) v.firstElement()).intValue());\n \n // create and populate the array of offsets from the vector\n numBlocks = v.size();\n offsets = new int[numBlocks];\n for (int i = 0; i < numBlocks; i++) {\n offsets[i] = ((Integer) v.get(i)).intValue();\n }\n \n // populate the imageTypes that the file uses\n toRead = new byte[2];\n imageType = new int[numBlocks];\n for (int i = 0; i < numBlocks; i++) {\n in.seek(offsets[i]);\n in.skipBytes(40);\n in.read(toRead);\n imageType[i] = batoi(toRead);\n }\n \n initMetadata();\n }", "private void readFile(){\n File file = new File(Environment.getExternalStorageDirectory()+\"/saved_images/profile.jpg\");\n myPictureForShow = BitmapFactory.decodeFile(file.getAbsolutePath());\n }", "public void closeFile(){\n }", "public void closeFile() throws IOException{\r\n\t\toutRCVictim.close();\r\n\t\tf[0][0].close();\r\n\t\t\r\n\t}", "public int closeFile() {\n int test=0;\n try{\n _file=null;\n rows.clear();\n _fis.close();\n _bis.close();\n _dis.close();\n test=1;\n }catch( IOException ioe){\n test=0;\n }\n return test;\n }", "public boolean GetImgPagina(int cod, String filePathName) throws SQLException {\n try {\n\n Connection con = model.connectionDataBase.ConnectionDB.Connect();\n\n \n PreparedStatement stmt = con.prepareStatement(\"SELECT `immagine_pagina` FROM `pagine_opera` WHERE cod_pagina = ?\");\n\n stmt.setInt(1, cod);\n ResultSet rs = stmt.executeQuery();\n\n\n while (rs.next()) {\n InputStream in = rs.getBinaryStream(1);\n OutputStream f = new FileOutputStream(new File(filePathName));\n \n int n = 0;\n while ((n = in.read()) > -1) {\n f.write(n);\n }\n f.close();\n in.close();\n\n return true;\n }\n } catch(Exception ex){\n System.out.println(ex.getMessage());\n }\n return false;\n }", "public void descargarArchivo()throws SQLException, IOException {\n //conexion con el resultset\n st = cn.createStatement();\n\n // consulta de descarga el getId es la variable que utilizo para ubicarme en la base de datos\n ResultSet rs = st.executeQuery(\"select anexo_justi, nombre FROM anexoitem where iditem=\"+rt.getId());\ntry {\n \nrs.next();\n// pone en la variable el nombre del archivo de la base de datos\nnombre= rs.getString(\"nombre\");\n// inserta la ruta completa\nFile file = new File(rt.getPath()+nombre);\n// salida del archivo de flujo\nFileOutputStream output = new FileOutputStream(file);\nBlob archivo = rs.getBlob(1);\nInputStream inStream = archivo.getBinaryStream();\n// almacenamiento del tamaño y descarga byte a byte\nint length= -1;\nint size = (int) archivo.length();\nbyte[] buffer = new byte[size];\nwhile ((length = inStream.read(buffer)) != -1) {\noutput.write(buffer, 0, length);\nJOptionPane.showMessageDialog(null,\"El archivo se descargo correctamente\");\n// output.flush();\n\n}\n// inStream.close();\noutput.close();\n} catch (Exception ioe) {\nthrow new IOException(ioe.getMessage());\n}\n}", "public void openFileAction(File file) {\n\t\tmultimediaPanel.changeImagePanelContent(file);\n\n\t\tselectedAnimalModel.setIsChanged(true);\n\t\tbyte[] bytes = multimediaPanel.getImageByteArray();\n\t\tif (bytes == null) {\n\t\t\tshowDialog(ERROR_MESSAGE, \"Cannot open file.\");\n\t\t\treturn;\n\t\t}\n\n\t\tisImageChangedFlag = true;\n\t}", "private void openCVImage(){\n Imgcodecs codec = new Imgcodecs();\n image = codec.imread(currentPhotoPath, Imgcodecs.IMREAD_COLOR);\n }", "private static final byte[] pkgclose_image() {\n\t\tbyte data[] = { 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -29, 0, 0, 0, 0,\n\t\t\t\t0, -91, 42, 42, -128, -128, -128, 94, 94, 94, 94, 24, 24, 0, 0,\n\t\t\t\t-128, -1, -1, -1, -1, -1, 0, -64, -64, -64, -1, -1, -1, -1, -1,\n\t\t\t\t-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n\t\t\t\t33, -1, 11, 78, 69, 84, 83, 67, 65, 80, 69, 50, 46, 48, 3, 1,\n\t\t\t\t0, 0, 0, 33, -2, 14, 77, 97, 100, 101, 32, 119, 105, 116, 104,\n\t\t\t\t32, 71, 73, 77, 80, 0, 33, -7, 4, 1, 10, 0, 5, 0, 44, 0, 0, 0,\n\t\t\t\t0, 16, 0, 16, 0, 0, 4, 75, -80, 72, 32, 103, -67, 5, -128, 64,\n\t\t\t\t51, -17, -43, 22, -116, -38, 72, 98, -101, 38, 12, 37, 120, 1,\n\t\t\t\t66, 60, -60, 110, -8, -83, 45, 106, 126, 123, -35, 18, 31,\n\t\t\t\t-115, 80, 51, -39, 0, 1, -120, -92, 18, -47, 17, 29, -103, 74,\n\t\t\t\t36, 72, -13, -124, 34, -103, 40, 77, 52, -118, -103, 36, -91,\n\t\t\t\t-33, 110, 6, -6, -59, 118, -81, 75, 115, 118, 40, -116, 0, 0,\n\t\t\t\t33, -7, 4, 1, 10, 0, 1, 0, 44, 7, 0, 7, 0, 9, 0, 9, 0, 0, 4,\n\t\t\t\t22, 16, -56, 73, -111, -67, 72, -26, 11, 114, -33, -97, 102,\n\t\t\t\t125, -34, -72, -107, 100, 39, 98, 30, 69, 69, 0, 59 };\n\t\treturn data;\n\t}", "@Override\n public void corrupt(File file) throws IOException\n {\n FileChannel.open(file.toPath(), StandardOpenOption.WRITE).truncate(file.length() - CodecUtil.footerLength() - 2).close();\n }", "private void jb_reporteusuariosActionPerformed(java.awt.event.ActionEvent evt) {\n ini.Tabla.Imprimir();\n File file2 = new File( \"C:\\\\Users\\\\Rodrigo Carcuz\\\\Desktop\\\\EDD_2S2019_PY2_201700633\\\\HashTable.jpg\" );\n try {\n Desktop.getDesktop().open(file2);\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null,\"NO SE ENCONTRO LA IMAGEN\" );\n }\n }", "@Override\r\n public Object getBufferedFileInputStream(String name) {\n return null; \r\n }", "private void viewImage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint id= Integer.parseInt(request.getParameter(\"fileId\"));\n\t\tFiles file= new FilesDAO().view(id);\n\t\trequest.setAttribute(\"files\", file);\n\t\trequest.setAttribute(\"path\", path);\n\t\trequest.getRequestDispatcher(\"viewImage.jsp\").forward(request, response);\n\t\tSystem.out.println(file);\n\t}", "private void updateImage(File file) throws IOException {\n\t\t\tfileLabel.setText(\"\");\n\n\t\t\ttry {\n\t\t\t\tMyImageD tmpImage = null;\n\t\t\t\tString fileName = file.getName();\n\n\t\t\t\t// Update preview for opening ggb files\n\t\t\t\tif (fileChooser\n\t\t\t\t\t\t.getMode() == GeoGebraFileChooser.MODE_GEOGEBRA) {\n\n\t\t\t\t\tif (fileName.endsWith(\".ggb\")) {\n\t\t\t\t\t\ttmpImage = new MyImageD(MyXMLioD.getPreviewImage(file)); // load\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// preview\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// from\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// zip\n\n\t\t\t\t\t\tStringBuilder fileInfo = new StringBuilder();\n\n\t\t\t\t\t\tif (fileName.length() > 20) {\n\t\t\t\t\t\t\tfileInfo.append(fileName.substring(0, 20));\n\t\t\t\t\t\t\tfileInfo.append(\"..\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfileInfo.append(fileName);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfileInfo.append(\" : \");\n\t\t\t\t\t\tfileInfo.append(file.length() / 1024);\n\t\t\t\t\t\tfileInfo.append(\" kB\");\n\t\t\t\t\t\tfileLabel.setText(fileInfo.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Update preview for saving a ggb file\n\t\t\t\telse if (fileChooser\n\t\t\t\t\t\t.getMode() == GeoGebraFileChooser.MODE_GEOGEBRA_SAVE) {\n\t\t\t\t\ttmpImage = (MyImageD)\n\t\t\t\t\t\t\tapp.getExportImage(MyXMLio.THUMBNAIL_PIXELS_X,\n\t\t\t\t\t\t\t\t\tMyXMLio.THUMBNAIL_PIXELS_Y);\n\t\t\t\t\t// TODO: show file size info?\n\t\t\t\t\tfileLabel.setText(null);\n\t\t\t\t}\n\n\t\t\t\t// Update preview for images\n\t\t\t\telse {\n\t\t\t\t\t// fails for a few JPEGs so turn off preview for large files\n\t\t\t\t\tif (file.length() < 1024 * maxImageSize) {\n\n\t\t\t\t\t\ttmpImage = MyImageD.fromFile(file, fileName);\n\t\t\t\t\t\tStringBuilder imgInfo = new StringBuilder();\n\n\t\t\t\t\t\tif (fileName.length() > 20) {\n\t\t\t\t\t\t\timgInfo.append(fileName.substring(0, 20));\n\t\t\t\t\t\t\timgInfo.append(\"..\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\timgInfo.append(fileName);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (tmpImage != null) {\n\t\t\t\t\t\t\timgInfo.append(\" : \");\n\t\t\t\t\t\t\timgInfo.append(tmpImage.getWidth());\n\t\t\t\t\t\t\timgInfo.append(\" x \");\n\t\t\t\t\t\t\timgInfo.append(tmpImage.getHeight());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfileLabel.setText(imgInfo.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// resize tmp image if necessary\n\t\t\t\tif (tmpImage != null) {\n\n\t\t\t\t\tint oldWidth = tmpImage.getWidth();\n\t\t\t\t\tint oldHeight = tmpImage.getHeight();\n\n\t\t\t\t\tint newWidth;\n\t\t\t\t\tint newHeight;\n\n\t\t\t\t\tif (oldWidth > ImagePanel.SIZE\n\t\t\t\t\t\t\t|| oldHeight > ImagePanel.SIZE) {\n\t\t\t\t\t\tif (oldWidth > oldHeight) {\n\t\t\t\t\t\t\tnewWidth = ImagePanel.SIZE;\n\t\t\t\t\t\t\tnewHeight = (ImagePanel.SIZE * oldHeight)\n\t\t\t\t\t\t\t\t\t/ oldWidth;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnewWidth = (ImagePanel.SIZE * oldWidth) / oldHeight;\n\t\t\t\t\t\t\tnewHeight = ImagePanel.SIZE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Create a new image for the scaled preview image\n\t\t\t\t\t\tsetImg(new MyImageD(new BufferedImage(newWidth,\n\t\t\t\t\t\t\t\tnewHeight, BufferedImage.TYPE_INT_RGB)));\n\n\t\t\t\t\t\tGGraphics2DD graphics2D = (GGraphics2DD) getImg()\n\t\t\t\t\t\t\t\t.createGraphics();\n\t\t\t\t\t\tif (tmpImage.isSVG()) {\n\t\t\t\t\t\t\tgraphics2D.setColor(GColor.WHITE);\n\t\t\t\t\t\t\tgraphics2D.fillRect(0, 0, newWidth, newHeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgraphics2D.drawImageScaled(tmpImage, newWidth, newHeight);\n\t\t\t\t\t\tgraphics2D.dispose();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetImg(tmpImage);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsetImg(null);\n\t\t\t\t}\n\n\t\t\t\trepaint();\n\t\t\t} catch (IllegalArgumentException iae) {\n\t\t\t\t// This is thrown if you select .ico files\n\t\t\t\tsetImg(null);\n\t\t\t} catch (Throwable t) {\n\t\t\t\tt.printStackTrace();\n\t\t\t\tLog.debug(t.getClass() + \"\");\n\t\t\t\tsetImg(null);\n\t\t\t}\n\t\t}", "public void close() throws IOException {\r\n\r\n // System.out.println(\"FileDICOM.close\");\r\n this.finalize();\r\n }", "private void downFile(HttpServletRequest req, HttpServletResponse res, String file_path ,String file_id, String file_name) throws Exception{\n\t\tSystem.out.println(file_path);\n\t\tSystem.out.println(file_id);\n\t\tSystem.out.println(file_name);\n\t\tFile file = null;\n\t\tBufferedInputStream fin = null;\n\t\tBufferedOutputStream outs = null;\n\ttry {\n\n\t\tfile = new File(file_path + \"\\\\\" + file_id);\n\t // ���� ����\n\t int filelength = (int) file.length();\n\t byte[] bytestream = new byte[2048];\n\t int read = 0;\n\t \n\t if(!file.exists()){\n\t \tthrow new Exception(\"mis.file.noexist\");\n\t }\n\t\t\n\t fin = new BufferedInputStream(new FileInputStream(file));\n\t outs = new BufferedOutputStream(res.getOutputStream());\n\t \n\t\n\t\tString clientHead = req.getHeader(\"User-Agent\");\n\t\t\n\t\tres.setContentLength(filelength);\n\t\tif (clientHead.indexOf(\"MSIE 5.5\") > -1)\n\t\t{\t\t\t\n\t\t\tres.setContentType(\"application/x-filler; charset=EUC-KR\");\n\t\t\tres.setHeader(\"Content-Type\", \"doesn/matter;\");\n\t\t\tres.setHeader(\"Content-Disposition\", \"filename=\\\"\" + file_name + \"\\\";\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tres.setHeader(\"Content-Type\", \"application/octet-stream;\");\n\t\t\tres.setHeader(\"Content-Disposition\", \"attachment;filename=\\\"\" + file_name + \"\\\";\");\n\t\t}\n\t\tres.setHeader (\"Content-Length\", \"\" + filelength);\n\t\n\t //try {\n\t\tif(filelength>0) {\n\t\t\twhile ((read = fin.read(bytestream)) != -1) {\n\t\t\t\touts.write(bytestream, 0, read);\n\t\t\t}\n\t\t}\n\t \n\t //close\n\t outs.close();\n\t fin.close();\n\t} catch (Exception e) {\n\t\t\n\t} finally {\n\t\tif(outs != null) { try { outs.close(); } catch(Exception e) {} }\n\t\tif(fin != null) { try { fin.close(); } catch(Exception e) {} }\n\t}\n}", "private static native boolean read_0(long nativeObj, long image_nativeObj);", "@Override\n public void corrupt(File file) throws IOException\n {\n try (FileChannel channel = FileChannel.open(file.toPath(), StandardOpenOption.WRITE))\n {\n channel.truncate(file.length() - CodecUtil.footerLength() - 2);\n }\n }", "private static void readJPG(DataInputStream dis, int length){ \n\t\ttry{\n\t\t\tbyte[] arrBytes= new byte[length];\n\t\t\tfor(int i= 0; i<length;i++){\n\t\t\t\tarrBytes[i] = dis.readByte();\n\t\t\t}\n\t\t\tBufferedImage img = ImageIO.read(new ByteArrayInputStream(arrBytes));\n\t\t\tobjWriter.addFrame(1.0f/4.0f, img, 1.0f);\n\t\t\timageCount++;\n\t\t\t// Printing Image count for fun so that you don't get bored. :-P\n\t\t\tSystem.out.print(imageCount +\"\\t\");\n\t\t\tif(imageCount % 10 == 0){\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t}\n\t\t}catch(Exception e){e.printStackTrace();}\n\t}", "void downloadNdvi(File file, int id) throws IOException, SQLException;", "public static byte[] getImageBinary(File f) {\n BufferedImage bi;\n try {\n bi = ImageIO.read(f);\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n ImageIO.write(bi, \"jpg\", baos);\n byte[] bytes = baos.toByteArray();\n return bytes;\n //return encoder.encodeBuffer(bytes).trim();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public void openImage(String name) throws ViewerException {\n\n\t}", "void downloadSavi(File file, int id) throws IOException, SQLException;", "void downloadNdwi5(File file, int id) throws IOException, SQLException;", "File openFile();", "public void OpenActionPerformed(ActionEvent evt) { \r\n\r\n //open file from file browser and display the image in the drawing panel\r\n if (jfcOpen.showOpenDialog(this) == JFileChooser.APPROVE_OPTION){\r\n //get selected image file\r\n File fileOpen = jfcOpen.getSelectedFile();\r\n \r\n //get image file path\r\n String fileName = fileOpen.toString();\r\n \r\n //set image path and display image\r\n drawingPanel.setPath(fileName); \r\n }\r\n }", "protected void close() {\r\n\t\ttry {\r\n\t\t\t_asciiIn.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\r\n\t\t\t\t\t\"Error ocurred while closing file \" + _directory + _filename + _filetype + \":\" + e.getMessage());\r\n\t\t} // catch\r\n\t}", "public boolean open() {\n\t\tif (RTS_COMMON.Option.VERBOSE)\n\t\t\tTRACE_OPEN(\"open Outbytefile\");\n\t\tif (_OPEN)\n\t\t\treturn (false);\n\t\tFile file = doCreateAction();\n\t\ttry {\n\t\t\toutputStream = new FileOutputStream(file, _APPEND);\n\t\t} catch (FileNotFoundException e) {\n\t\t\tif (RTS_COMMON.Option.VERBOSE)\n\t\t\t\te.printStackTrace();\n\t\t\treturn (false);\n\t\t}\n\t\t_OPEN = true;\n\t\t_BYTESIZE = _DEFAULT_BYTESIZE;\n\t\treturn (true);\n\t}", "public void open() throws IOException;", "public static void testDecodePicture(){\n\t Picture wall = new Picture(\"wall.jpg\");\n\t Picture caterpillar = new Picture(\"caterpillar.jpg\");\n\t wall.hidePicture(caterpillar);\n\t wall.explore();\n\t wall.decodePicture();\n\t wall.explore();\n }", "public IMAGEFILETYPE fileTypeByParsingTheHeaderBytes(byte[] img) {\n return IMAGEFILETYPE.FT_UNKNOWN;\n }", "FileObject getFile();", "FileObject getFile();", "public void imageSaveControl(byte[] readByte, SocketChannel client,int userNumber){\n\t\ttry{\n\t\t\tString dirtyResult = new String(readByte,\"ISO-8859-1\");\n\t\t\tif(dirtyResult.contains(\"ULMImg\")){\t\t\t\t\t\t\n\t\t\t\tSystem.out.println(\"userNumber = \" + userNumber);\n\t\t\t\tUsers[userNumber].setIsFile(true);\n\t\t\t\tint l = (\"ULMImg\" + c.STATEND).length();\n\t\t\t\tint position = dirtyResult.indexOf(\"ULMImg\");\n\t\t\t\tString remain = dirtyResult.substring(position + l);\n\t\t\t\tif(remain.length() > 0){\n\t\t\t\t\tSystem.out.println(\"^^^^^\");\n\t\t\t\t\tbyte [] remains = remain.getBytes(\"ISO-8859-1\");\n\t\t\t\t\tsaveImage(userNumber,remains);\n\t\t\t\t\tbyte another[] = dirtyResult.substring(0,position).getBytes(\"ISO-8859-1\");\n\t\t\t\t\tif(another.length > 0){\n\t\t\t\t\t\tprepareParse(another,client,userNumber);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(dirtyResult.contains(\"SMImgD\")){\t\t\t\t\n\t\t\t\tUsers[userNumber].setIsFile(false);\n\t\t\t\tUsers[userNumber].setIsFileSended(true);\n\t\t\t\tint l = (\"SMImgD\" + c.STATEND).length();\n\t\t\t\tint position = dirtyResult.indexOf(\"SMImgD\");\n\t\t\t\tString remain = dirtyResult.substring(0,position);\n\t\t\t\tif(remain.length() > 0){\n\t\t\t\t\tSystem.out.println(\"vvvvv\");\n\t\t\t\t\tbyte [] remains = remain.getBytes(\"ISO-8859-1\");\n\t\t\t\t\tsaveImage(userNumber,remains);\n\t\t\t\t\tbyte another[] = dirtyResult.substring(position + l).getBytes(\"ISO-8859-1\");\n\t\t\t\t\tif(another.length > 0){\n\t\t\t\t\t\tprepareParse(another,client,userNumber);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(Users[userNumber].imgTempNum != -1){\t\t\t\t\t\t//image can't be null\n\t\t\t\t\tSystem.out.println(\"imagesize:\" + imgTemps[Users[userNumber].imgTempNum].getTempLength());\n\t\t\t\t\ttry{\t\t\t\t\t\t\t\t\t\t\t\t\t//save to disk\n\t\t\t\t\t\tFile fWrite = new File(c.imagepath + Users[userNumber].getId() + \".PNG\");\n\t\t\t\t\t\tFileOutputStream out = new FileOutputStream(fWrite);\n\t\t\t\t\t\tout.write(imgTemps[Users[userNumber].imgTempNum].getNewFiles(),0,imgTemps[Users[userNumber].imgTempNum].getTempLength());\n\t\t\t\t\t\tout.close();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\tSystem.out.println(e);\n\t\t\t\t\t\tif(c.debug){\te.printStackTrace();}\n\t\t\t\t\t}\n\t\t\t\t\timgTemps[Users[userNumber].imgTempNum].userNumber = -1;\n\t\t\t\t\timgTemps[Users[userNumber].imgTempNum].newFiles = null;\t\n\t\t\t\t\timgTemps[Users[userNumber].imgTempNum].setTempLength(0);\n\t\t\t\t}\n\t\t\t\tUsers[userNumber].setIsFile(false);\n\t\t\t\tUsers[userNumber].setIsFileSended(true);\n\t\t\t\tString result = \"setIsFileSended;true\";\n\t\t\t\tc.sendInforBack(client,result);\n\t\t\t}\n\n\t\t\tif(Users[userNumber].getIsFile()){\t\t\t\t\t\t\t\t\n\t\t\t\tif((!dirtyResult.contains(\"ULMImg\")) && (!dirtyResult.contains(\"SMImgD\"))) {\n\t\t\t\t\tsaveImage(userNumber,readByte);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(e);\n\t\t\tif(c.debug){\te.printStackTrace();}\n\t\t}\n\t}", "public ImageFile(String filename) throws ImageException, FileNotFoundException, IOException {\r\n\tFile file = new File(filename);\r\n\tif (!file.exists()){\r\n\t\tthrow new ImageException(\"image file '\"+filename+\"' not found\");\r\n\t}\r\n\ttry {\r\n\t\t//\r\n\t\t// try native format\r\n\t\t//\r\n\t\tloadNativeFormat(filename);\r\n\t\tSystem.out.println(\"ImageFile.ImageFile(\"+filename+\"), read successfully as native format\");\r\n\t}catch (Exception e){\r\n\t\tSystem.out.println(\"ImageFile.ImageFile(\"+filename+\"), exception loading native format, trying TIFF, exception=\"+e.getMessage());\r\n\t\ttry {\t\t\t\t\r\n\t\t\t// try TIFF format\r\n\t\t\tloadTIFFFormat(new FileTiffInputSource(filename));\r\n\t\t\tSystem.out.println(\"ImageFile.ImageFile(\"+filename+\"), read successfully as TIFF\");\r\n\t\t\treturn;\r\n\t\t}catch (Exception e2){\r\n\t\t\tSystem.out.println(\"ImageFile:ImageFile(\"+filename+\"), exception loading TIFF, trying zip format, exception=\"+e2.getMessage());\r\n\t\t\tbyte buffer[] = new byte[65536];\r\n\t\t\tFileInputStream fis = new FileInputStream(filename);\r\n\t\t\ttry {\r\n\t\t\t\tByteArrayOutputStream bos = new ByteArrayOutputStream();\r\n\t\t\t\tint numBytesRead = 0;\r\n\t\t\t\twhile ((numBytesRead = fis.read(buffer)) > 0){\r\n\t\t\t\t\tbos.write(buffer,0,numBytesRead);\r\n\t\t\t\t}\r\n\t\t\t\tbyte imageData[] = bos.toByteArray();\r\n\t\t\t\tbyte entries[][] = getZipFileEntries(imageData);\r\n\t\t\t\tif (entries!=null){\r\n\t\t\t\t\tVCImage vcImage = getVCImageFromZSeries(entries);\r\n\t\t\t\t\tcreateFromVCImage(vcImage);\r\n\t\t\t\t\tSystem.out.println(\"ImageFile.ImageFile(\"+filename+\"), read successfully\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthrow new ImageException(\"Image format not recognized for file '\"+filename+\"'\");\r\n\t\t\t\t}\r\n\t\t\t}finally {\r\n\t\t\t\tif (fis!=null){\r\n\t\t\t\t\tfis.close();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n}", "void open() throws IOException;", "void downloadNdwi6(File file, int id) throws IOException, SQLException;", "public void dispose() {\n TIFFClose();\n }", "public void test(String path){\n File file = new File(path);\n byte[] image = new byte[(int) file.length()];\n try {\n FileInputStream fis = new FileInputStream(file);\n fis.read(image); //read file into bytes[]\n\n fis.close();\n test(image);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public void close() {\n try {\n ptr_file.close();\n suf_file.close();\n int k;\n for (k = 0; k < ptr_parts_num; ++k) {\n ptr_buff[k] = null;\n }\n for (k = 0; k < suf_parts_num; ++k) {\n suf_buff[k] = null;\n }\n } catch (IOException e) {\n System.out.println(e.getMessage());\n System.exit(1);\n }\n }", "public native double testyolo(String imgfile);", "private Promise<ApduFile> openApduFile(ElementaryFileID fileID) {\n Promise<byte[]> firstChunk;\n if (fileID.isShortIDAvailable()) {\n firstChunk = this.presentationLayer.readBinary(fileID, (byte)0);//If short file id is available, a read will also instantly select the file.\n } else {\n firstChunk = this.presentationLayer.selectEF(fileID).then((v) -> this.presentationLayer.readBinary((byte)0));//Select and read the first part.\n }\n return firstChunk.then((data) -> {\n try {\n ApduFile result = new ApduFile(data);\n return Promise.resolve(result);\n }catch (Exception e) {\n return Promise.reject(e);\n }\n });\n }", "public void opened();", "Picture binaryComponentImage() throws Exception;", "@Override\n public StorageInputStream open(File file) throws FileNotFoundException {\n\treturn null;\n }", "@Override\n public int getFile() {\n return file;\n }", "public abstract File mo41088k();", "public ImageFile(BufferedImage img) throws ImageException{\r\n\tloadImage(img);\r\n}", "public void salvaAula()\n { \n JFileChooser fileChooser = new JFileChooser();\n String strFilePlan = \"out/\" + this.myAula.getNome()+ \"_plan\"+ \".png\";\n System.out.println(\"scrivo su file \"+ strFilePlan);\n File fp = new File(strFilePlan);\n String strFileDati = \"out/\" + this.myAula.getNome()+ \"_dati\"+ \".png\";\n File fd = new File(strFileDati);\n fileChooser.setSelectedFile(fd);\n try\n { \n ImageIO.write(this.getPlan(), \"png\", fp);\n ImageIO.write(this.getDati(), \"png\", fd);\n }\n catch (Exception ex)\n {\n System.out.println(\"errore in Salvataggio aula su file\");\n }\n \n JOptionPane.showMessageDialog(this, \"file salvati correttamente sotto cartella /out\",\"Info\", JOptionPane.INFORMATION_MESSAGE);\n }", "private Bitmap decodeFile(File f)\n {\n try \n {\n //decode image size\n BitmapFactory.Options o = new BitmapFactory.Options();\n o.inJustDecodeBounds = true;\n BitmapFactory.decodeStream(new FileInputStream(f),null,o);\n \n //Find the correct scale value. It should be the power of 2.\n int width_tmp=o.outWidth, height_tmp=o.outHeight;\n int scale=1;\n while(true)\n {\n if(width_tmp/2<REQUIRED_WIDTH || height_tmp/2<REQUIRED_HEIGHT)\n break;\n width_tmp/=2;\n height_tmp/=2;\n scale++;\n }\n \n //decode with inSampleSize\n BitmapFactory.Options o2 = new BitmapFactory.Options();\n o2.inSampleSize=scale;\n o2.inPreferredConfig = Bitmap.Config.RGB_565;\n o2.inDither = true;\n \n o2.inPurgeable=true; //Tell to gc that whether it needs free memory, the Bitmap can be cleared\n o2.inInputShareable=true; //Which kind of reference will be used to recover the Bitmap data after being clear, when it will be used in the future\n\n Bitmap bitmap = null;\n\t\t try\n\t\t {\n\t\t\t bitmap = BitmapFactory.decodeFileDescriptor(new FileInputStream(f).getFD(), null, o2);\n\t\t }\n\t\t catch (IOException e)\n\t\t {\n\t\t\t stopThread();\n\t\t\t photoLoaderThread.start();\n\t\t\t e.printStackTrace();\n\t\t }\n\t\t catch (OutOfMemoryError e)\n\t\t {\n\t\t\t stopThread();\n\t\t\t photoLoaderThread.start();\n\t\t\t e.printStackTrace();\n\t\t }\n \n return bitmap;\n } \n catch (FileNotFoundException e) \n {\n \tstopThread();\n \tphotoLoaderThread.start();\n }\n catch(OutOfMemoryError e)\n {\n \tstopThread();\n \tphotoLoaderThread.start();\n }\n return null;\n }", "public void write(String filename) throws IOException {\n \t\n\t\tFileOutputStream os = null;\n\t\ttry {\n\t\t \tos = new FileOutputStream(new File(\"./OutputImage.txt\"));\n\t\t\tString header = (\"P6\\n\" + width + \"\\n\" + height + \"\\n255\\n\")//.getBytes() missing for converting the string into bytes;\n\t\t\t// For P6 there is no \\n after each spec. Use: new (\"P6 \"+width+\" \"+h+\" 255\\n\").getBytes())\n\t\t\tos.write(header);\n\t\t\tos.write(data);\n\t\t} catch (IOException e) {\n\t\t \t e.printStackTrace();\n\t\t}finally{\n\t\t try {\n\t\t\tos.close();\n\t\t } catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t \t}\n \t}\n \n\n}", "@Override\n public void actionPerformed(ActionEvent e) {\n JFileChooser fc = new JFileChooser(); \n int returnVal = fc.showOpenDialog(null);\n if (returnVal == JFileChooser.APPROVE_OPTION) {\n File file = fc.getSelectedFile();\n System.out.println(file.getAbsolutePath()); \n image = loadImage( file);\n }\n }", "public FITSImage(String url) throws Exception {\n\n // access the FITS file\n Fits fits = new Fits(url);\n\n // get basic information from file\n BasicHDU hdu = (ImageHDU) fits.readHDU();\n int bitsPerPixel = hdu.getBitPix();\n header = hdu.getHeader();\n\n if (bitsPerPixel == BasicHDU.BITPIX_BYTE) {\n\n // get image row data\n byte[][] data2D = (byte[][]) ((hdu).getKernel());\n\n // get width and height of image\n int width = data2D[0].length;\n int height = data2D.length;\n\n // transform image row data into 1D image row data\n byte[] data = new byte[width * height];\n\n int counter = 0;\n for (int h = 0; h < height; h++) {\n for (int w = 0; w < width; w++) {\n data[counter] = data2D[h][w];\n counter++;\n }\n }\n\n // create buffered image from row data\n SingleChannelByte8ImageData imageData = new SingleChannelByte8ImageData(width, height, data, new ColorMask());\n image = imageData.getBufferedImage();\n\n } else if (bitsPerPixel == BasicHDU.BITPIX_SHORT) {\n\n // get image row data\n short[][] data2D = (short[][]) ((hdu).getKernel());\n\n // get width and height of image\n int width = data2D[0].length;\n int height = data2D.length;\n\n // transform image row data into 1D image row data and\n // analyze the highest value when transfering the data\n short[] data = new short[width * height];\n\n int highestValue = Integer.MIN_VALUE;\n int counter = 0;\n boolean hasNegativValue = false;\n\n for (int h = 0; h < height; h++) {\n for (int w = 0; w < width; w++) {\n\n if (!hasNegativValue)\n hasNegativValue = data2D[h][w] < 0;\n\n highestValue = data2D[h][w] > highestValue ? data2D[h][w] : highestValue;\n data[counter] = data2D[h][w];\n counter++;\n }\n }\n\n // if first bit is not set, shift bits\n if (!hasNegativValue) {\n // compute number of bits to shift\n int shiftBits = BasicHDU.BITPIX_SHORT - ((int) Math.ceil(Math.log(highestValue) / Math.log(2)));\n\n // shift bits of all values\n for (int i = 0; i < data.length; i++) {\n data[i] = (short) (data[i] << shiftBits);\n }\n }\n\n // create buffered image from row data\n SingleChannelShortImageData imageData = new SingleChannelShortImageData(width, height, bitsPerPixel, data, new ColorMask());\n image = imageData.getBufferedImage();\n\n } else if (bitsPerPixel == BasicHDU.BITPIX_INT) {\n\n // get image row data\n int[][] data2D = (int[][]) ((hdu).getKernel());\n\n // get width and height of image\n int width = data2D[0].length;\n int height = data2D.length;\n\n // transform image row data into 1D image row data\n int[] data = new int[width * height];\n\n int counter = 0;\n for (int h = 0; h < height; h++) {\n for (int w = 0; w < width; w++) {\n data[counter] = data2D[h][w];\n counter++;\n }\n }\n\n // create buffered image from row data\n JavaBufferedImageData imageData = new ARGBInt32ImageData(width, height, data, new ColorMask());\n image = imageData.getBufferedImage();\n\n } else if (bitsPerPixel == BasicHDU.BITPIX_FLOAT) {\n\n // get image row data\n float[][] data2D = (float[][]) ((hdu).getKernel());\n\n // get width and height of image\n int width = data2D[0].length;\n int height = data2D.length;\n\n // transform image row data into 1D image row data\n short[] data = new short[width * height];\n\n // if it is an MDI magnetogram image use threshold when converting\n // the data\n // otherwise set minimum value to zero and maximum value to 2^16 and\n // scale values between\n String instrument = header.getStringValue(\"INSTRUME\");\n String measurement = header.getStringValue(\"DPC_OBSR\");\n\n if (instrument != null && measurement != null && instrument.equals(\"MDI\") && measurement.equals(\"FD_Magnetogram_Sum\")) {\n\n int counter = 0;\n float doubleThreshold = MDI_THRESHOLD * 2.0f;\n\n for (int h = 0; h < height; h++) {\n for (int w = 0; w < width; w++) {\n\n float value = data2D[h][w] + MDI_THRESHOLD;\n value = value < 0.0f ? 0.0f : value > doubleThreshold ? doubleThreshold : value;\n data[counter] = (short) ((value * 65535) / doubleThreshold);\n counter++;\n }\n }\n\n } else {\n\n // get the minimum and maximum value from current data\n float minValue = Float.MAX_VALUE;\n float maxValue = Float.MIN_VALUE;\n\n for (int h = 0; h < height; h++) {\n for (int w = 0; w < width; w++) {\n\n minValue = data2D[h][w] < minValue ? data2D[h][w] : minValue;\n maxValue = data2D[h][w] > maxValue ? data2D[h][w] : maxValue;\n }\n }\n\n // transform image row data into 1D image row data\n int counter = 0;\n float difference = maxValue - minValue;\n\n for (int h = 0; h < height; h++) {\n for (int w = 0; w < width; w++) {\n data[counter] = (short) (((data2D[h][w] - minValue) / difference) * 65536.0f);\n counter++;\n }\n }\n }\n\n // create buffered image from row data\n SingleChannelShortImageData imageData = new SingleChannelShortImageData(width, height, 16, data, new ColorMask());\n image = imageData.getBufferedImage();\n }\n }", "private static final byte[] pkgclose_d_image() {\n\t\tbyte data[] = { 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -29, 0, 0, 96,\n\t\t\t\t96, 96, -96, -96, -96, -33, -33, -33, 94, 94, 94, 94, 24, 24,\n\t\t\t\t-128, -128, -128, -1, -1, -1, -128, -128, -128, -112, -112,\n\t\t\t\t-112, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n\t\t\t\t-1, -1, -1, -1, -1, -1, -1, 33, -2, 14, 77, 97, 100, 101, 32,\n\t\t\t\t119, 105, 116, 104, 32, 71, 73, 77, 80, 0, 33, -7, 4, 1, 10, 0,\n\t\t\t\t3, 0, 44, 0, 0, 0, 0, 16, 0, 16, 0, 0, 4, 75, 112, 72, 32, 103,\n\t\t\t\t-67, 3, -128, 64, 51, -17, -43, 22, -116, -38, 72, 98, -101,\n\t\t\t\t38, 104, 41, 54, 9, 48, 16, -69, -98, -54, 114, -88, -7, -23,\n\t\t\t\t-32, -108, 110, -123, -96, 80, -24, -29, 4, 10, -120, -92, 18,\n\t\t\t\t81, -104, -112, -114, 76, 37, -78, -23, 3, 38, -89, 87, 20, 0,\n\t\t\t\t121, -107, -46, -72, 88, -26, 55, -38, -91, 98, -72, 75, -79,\n\t\t\t\t107, -56, -114, 0, 0, 59 };\n\t\treturn data;\n\t}", "public void readImage(File f) {\r\n try {\r\n //JFrame f2 = new JFrame();\r\n images.add(ImageIO.read(f));\r\n //JLabel lb = new JLabel(new ImageIcon(images.get(0)));\r\n //f2.add(lb);\r\n //f2.setVisible(true);\r\n } catch(Exception e) {\r\n JOptionPane.showMessageDialog(null, \"read image failed.\", \"System Message\", JOptionPane.ERROR_MESSAGE);\r\n e.printStackTrace();\r\n }\r\n }", "public IMAGE_FILE_HEADER getFileHeader() { return peHeader; }", "private void loadJava(byte[] encodedData, int offset, int len, String file){\n try{\n PngReader reader = new PngReader();\n pixels = reader.read(new ByteArrayInputStream(encodedData, offset, len));\n width = reader.width;\n height = reader.height;\n handle = -1;\n pixels.position(0).limit(pixels.capacity());\n }catch(Exception e){\n throw new ArcRuntimeException(\"Failed to load PNG data\" + (file == null ? \"\" : \" (\" + file + \")\"), e);\n }\n }", "void downloadEvi(File file, int id) throws IOException, SQLException;", "public void openFile() {\n\t\tfc.setCurrentDirectory(new File(System.getProperty(\"user.dir\")));\n\t\tint returnVal = fc.showOpenDialog(null);\n\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = fc.getSelectedFile();\n\t filename.setText(file.getName());\n\t try {\n\t\t\t\tmodel.FileContent(file);\t//read the content of the input file\n\t\t\t\tplotContent.repaint();\t//repaint the JComponent\n\t\t\t\t\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "private void displayImage() {\n if (currentPhotoPath != null) {\n // checkPicture = true; depreciated, try catch to catch if photo exists\n Bitmap temp = fixOrientation(BitmapFactory.decodeFile(currentPhotoPath));\n bitmapForAnalysis = temp;\n imageView.setImageBitmap(temp);\n } else {\n Toast.makeText(this, \"Image Path is null\", Toast.LENGTH_LONG).show();\n }\n }", "boolean getBinaryFileAttribute();", "@GetMapping(\"/retrive/{fileId}\")\r\n public ResponseEntity<ByteArrayResource> downloadFile(@PathVariable Integer fileId) {\n Optional<Image> image;\r\n image = imgrepo.findById(fileId);\r\n Image ima=null;\r\n if(image.isPresent()) {\r\n ima = image.get();\r\n }\r\n return ResponseEntity.ok()\r\n .contentType(MediaType.parseMediaType(ima.getFileType()))\r\n .header(HttpHeaders.CONTENT_DISPOSITION, \"attachment; filename=\\\"\" + ima.getFileName() + \"\\\"\")\r\n .body(new ByteArrayResource(ima.getData()));\r\n\t\r\n\t\r\n }", "private void putProfPic(Blob gbPhoto) throws SQLException, FileNotFoundException, IOException {\n if(gbPhoto == null){\n ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();\n File file = new File(externalContext.getRealPath(\"\")+\"\\\\resources\\\\images\\\\user_default.png\");\n imagePic = new OracleSerialBlob(FileUtils.getBytes(file));\n Long size = imagePic.length();\n photo_profile = new ByteArrayContent(imagePic.getBytes(1, size.intValue()));\n }else{\n imagePic = gbPhoto;\n Long size = gbPhoto.length();\n photo_profile = new ByteArrayContent(gbPhoto.getBytes(1, size.intValue()));\n }\n }", "@Override\n\tpublic void desenhar() {\n\t\tSystem.out.println(\"desenhar imagem png\");\n\t\t\n\t}", "private void decodeImageData() throws IOException {\n\t\t\tfinal int nullCode = -1;\n\t\t\tfinal int npix = getMetadata().getIw() * getMetadata().getIh();\n\n\t\t\tbyte[] pixels = getMetadata().getPixels();\n\n\t\t\tif (pixels == null || pixels.length < npix) pixels = new byte[npix];\n\n\t\t\tshort[] prefix = getMetadata().getPrefix();\n\t\t\tbyte[] suffix = getMetadata().getSuffix();\n\t\t\tbyte[] pixelStack = getMetadata().getPixelStack();\n\n\t\t\tif (prefix == null) prefix = new short[MAX_STACK_SIZE];\n\t\t\tif (suffix == null) suffix = new byte[MAX_STACK_SIZE];\n\t\t\tif (pixelStack == null) pixelStack = new byte[MAX_STACK_SIZE + 1];\n\n\t\t\tgetMetadata().setPrefix(prefix);\n\t\t\tgetMetadata().setSuffix(suffix);\n\t\t\tgetMetadata().setPixelStack(pixelStack);\n\n\t\t\t// initialize GIF data stream decoder\n\n\t\t\tfinal int read = getSource().read();\n\t\t\tfinal int dataSize = read & 0xff;\n\n\t\t\tfinal int clear = 1 << dataSize;\n\t\t\tfinal int eoi = clear + 1;\n\t\t\tint available = clear + 2;\n\t\t\tint oldCode = nullCode;\n\t\t\tint codeSize = dataSize + 1;\n\t\t\tint codeMask = (1 << codeSize) - 1;\n\t\t\tint code = 0, inCode = 0;\n\t\t\tfor (code = 0; code < clear; code++) {\n\t\t\t\tprefix[code] = 0;\n\t\t\t\tsuffix[code] = (byte) code;\n\t\t\t}\n\n\t\t\t// decode GIF pixel stream\n\n\t\t\tint datum = 0, first = 0, top = 0, pi = 0, bi = 0, bits = 0, count = 0;\n\t\t\tint i = 0;\n\n\t\t\tfor (i = 0; i < npix;) {\n\t\t\t\tif (top == 0) {\n\t\t\t\t\tif (bits < codeSize) {\n\t\t\t\t\t\tif (count == 0) {\n\t\t\t\t\t\t\tcount = readBlock();\n\t\t\t\t\t\t\tif (count <= 0) break;\n\t\t\t\t\t\t\tbi = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdatum += (getMetadata().getdBlock()[bi] & 0xff) << bits;\n\t\t\t\t\t\tbits += 8;\n\t\t\t\t\t\tbi++;\n\t\t\t\t\t\tcount--;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// get the next code\n\t\t\t\t\tcode = datum & codeMask;\n\t\t\t\t\tdatum >>= codeSize;\n\t\t\t\t\tbits -= codeSize;\n\n\t\t\t\t\t// interpret the code\n\n\t\t\t\t\tif ((code > available) || (code == eoi)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (code == clear) {\n\t\t\t\t\t\t// reset the decoder\n\t\t\t\t\t\tcodeSize = dataSize + 1;\n\t\t\t\t\t\tcodeMask = (1 << codeSize) - 1;\n\t\t\t\t\t\tavailable = clear + 2;\n\t\t\t\t\t\toldCode = nullCode;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (oldCode == nullCode) {\n\t\t\t\t\t\tpixelStack[top++] = suffix[code];\n\t\t\t\t\t\toldCode = code;\n\t\t\t\t\t\tfirst = code;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tinCode = code;\n\t\t\t\t\tif (code == available) {\n\t\t\t\t\t\tpixelStack[top++] = (byte) first;\n\t\t\t\t\t\tcode = oldCode;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (code > clear) {\n\t\t\t\t\t\tpixelStack[top++] = suffix[code];\n\t\t\t\t\t\tcode = prefix[code];\n\t\t\t\t\t}\n\t\t\t\t\tfirst = suffix[code] & 0xff;\n\n\t\t\t\t\tif (available >= MAX_STACK_SIZE) break;\n\t\t\t\t\tpixelStack[top++] = (byte) first;\n\t\t\t\t\tprefix[available] = (short) oldCode;\n\t\t\t\t\tsuffix[available] = (byte) first;\n\t\t\t\t\tavailable++;\n\n\t\t\t\t\tif (((available & codeMask) == 0) && (available < MAX_STACK_SIZE)) {\n\t\t\t\t\t\tcodeSize++;\n\t\t\t\t\t\tcodeMask += available;\n\t\t\t\t\t}\n\t\t\t\t\toldCode = inCode;\n\t\t\t\t}\n\t\t\t\ttop--;\n\t\t\t\tpixels[pi++] = pixelStack[top];\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\tfor (i = pi; i < npix; i++)\n\t\t\t\tpixels[i] = 0;\n\t\t\tgetMetadata().setPixels(pixels);\n\t\t\tsetPixels();\n\t\t}", "private static native boolean open_0(long nativeObj, String filename);", "public void openDialog() {\r\n\t\tString filename = this.getFileName();\r\n\t\tif (filename.equals(null) || filename.equals(\"\") ) {\r\n\t\t\ttext.append(\"\\nPlease select valid image\");\r\n\t\t\topenDialog();\r\n\t\t}\r\n\t\tdisplay_img = this.loadImage(filename);\r\n\r\n\t}", "private void showImageDetail() {\n }", "@Test\n\tpublic void testImageFromWindowsPhotoEditor2() throws IOException, ImageProcessingException, MetadataException {\n\t\tURL url = new URL(\"https://dbis-thure.uibk.ac.at/f/Get?id=BTCMSAGPZYLKPPLZWWQLSMKY\");\n\t\tRotatedBufferedImage bi = (RotatedBufferedImage) TrpImageIO.read(url);\n\t\tlogger.info(\"TrpImageIO result = \" + bi.getImageTransformation().toString());\n\t\t\n\t\tImageTransformation t = TrpImgMdParser.readImageDimension(url);\n\t\tlogger.info(\"TrpImgMdParser result = \" + t.toString());\n\t}", "private void closeFile() {\n if (fileSpec != null) {\n boolean modOK = modIfChanged();\n if (currentFileModified) {\n filePrefs.handleClose();\n }\n }\n currentFileModified = false;\n }", "@Override\n\tpublic byte[] fetchFile(String fileName) throws RemoteException {\n return null;\n\n\t}", "@Override\n protected void onBinaryData(InputStream is) throws IOException {\n }", "public static void Bildeinfuegen()\r\n\t{\n\t\tPath path = FileSystems.getDefault().getPath(\"bilder\", \"bild2.jpg\");\r\n\t\tFile file=path.toFile();\r\n\t\t//File file = new File(getCacheDirectory() + \"\\\\results.txt\");\r\n\t\t\r\n\t\tString INSERT_DATA_SQL=\"INSERT INTO bilder VALUES (?, ?)\";\r\n\t\ttry {\r\n\r\n\t\t\tFileInputStream fis= new FileInputStream(file);\r\n\t\t\tconn = DriverManager.getConnection(DB_URL,USER,PASS);\r\n\t\t\tpstmt = conn.prepareStatement(INSERT_DATA_SQL);\r\n\t\t\tfis = new FileInputStream(file);\r\n\t\t\t//pstmt = conn.prepareStatement(\"INSERT INTO bilder VALUES (?, ?)\");\r\n\t\t\tpstmt.setString(1, file.getName());\r\n\t\t\tpstmt.setBinaryStream(2, fis, (int)file.length());\r\n\t\t\tpstmt.executeUpdate();\r\n\r\n\t\t\tpstmt.close();\r\n\t\t\tfis.close();\r\n\t\t} catch (FileNotFoundException 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\te.printStackTrace();\r\n\t\t}catch (IOException 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\t\tSystem.out.println(\"Daten in Datenbank gepeichert.\");\r\n\t}", "private static native long imdecode_0(long buf_nativeObj, int flags);", "public void writeImage(File file, String id) {\n try {\n FileInputStream in = new FileInputStream(file);\n PreparedStatement pstmt = conn.prepareStatement(\n \"UPDATE vehicles vehicles SET photo=? WHERE veh_reg_no = ?\");\n pstmt.setBinaryStream(1, (InputStream)in, (int)file.length());\n pstmt.setString(2, id);\n System.out.println(pstmt); // for debugging\n int returnCode = pstmt.executeUpdate();\n System.out.println(returnCode + \" record updated\");\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "private void readImage(final InputStream inputStream) throws IOException\n {\n final int lzwCode = inputStream.read();\n\n if (lzwCode < 0)\n {\n throw new IOException(\"No enough data to read LZW code\");\n }\n\n this.colorIndexes = new int[this.width * this.height];\n SubBlock subBlock = SubBlock.read(inputStream);\n\n if (subBlock == SubBlock.EMPTY)\n {\n return;\n }\n\n byte[] data = subBlock.getData();\n\n if (data.length < 4)\n {\n // To avoid some malformed GIF\n return;\n }\n\n this.buffer32 = (data[0] & 0xFF) | ((data[1] & 0xFF) << 8) | ((data[2] & 0xFF) << 16) | ((data[3] & 0xFF) << 24);\n final int clearCode = 1 << lzwCode;\n final int endCode = clearCode + 1;\n int code, oldCode = 0;\n final int[] prefix = new int[4096];\n final byte[] suffix = new byte[4096];\n final byte[] initial = new byte[4096];\n final int[] length = new int[4096];\n final byte[] string = new byte[4096];\n this.initializeStringTable(prefix, suffix, initial, length, lzwCode);\n int tableIndex = (1 << lzwCode) + 2;\n int codeSize = lzwCode + 1;\n int codeMask = (1 << codeSize) - 1;\n Pair<Integer, SubBlock> pair = new Pair<Integer, SubBlock>(0, subBlock);\n\n while (pair.element1 != endCode)\n {\n pair = this.getCode(codeSize, codeMask, inputStream, subBlock, endCode);\n code = pair.element1;\n subBlock = pair.element2;\n\n if (code == clearCode)\n {\n this.initializeStringTable(prefix, suffix, initial, length, lzwCode);\n tableIndex = (1 << lzwCode) + 2;\n codeSize = lzwCode + 1;\n codeMask = (1 << codeSize) - 1;\n\n pair = this.getCode(codeSize, codeMask, inputStream, subBlock, endCode);\n code = pair.element1;\n subBlock = pair.element2;\n if (code == endCode)\n {\n return;\n }\n }\n else if (code == endCode)\n {\n return;\n }\n else\n {\n int newSuffixIndex;\n if (code < tableIndex)\n {\n newSuffixIndex = code;\n }\n else\n { // code == tableIndex\n newSuffixIndex = oldCode;\n if (code != tableIndex)\n {\n // warning - code out of sequence\n // possibly data corruption\n Debug.println(DebugLevel.WARNING, \"Out-of-sequence code!\");\n }\n }\n\n final int ti = tableIndex;\n\n prefix[ti] = oldCode;\n suffix[ti] = initial[newSuffixIndex];\n initial[ti] = initial[oldCode];\n length[ti] = length[oldCode] + 1;\n\n tableIndex++;\n if ((tableIndex == (1 << codeSize)) && (tableIndex < 4096))\n {\n codeSize++;\n codeMask = (1 << codeSize) - 1;\n }\n }\n\n // Reverse code\n int c = code;\n final int len = length[c];\n for (int i = len - 1; i >= 0; i--)\n {\n string[i] = suffix[c];\n c = prefix[c];\n }\n\n this.writeImage(string, len);\n oldCode = code;\n }\n }", "public String getFileTypeDescription() {\n return \"GrADS Binary Gridded Data\";\n }", "public ImageVisualizer(String fileName, boolean hex, int start, int end)\n {\n oFile = new File(fileName);\n this.hex = hex;\n this.startingPos = start;\n this.endingPos = end;\n try{\n oReader = new BufferedReader(new FileReader(oFile));\n } catch(Exception e)\n {\n e.printStackTrace();\n }\n }", "public void close() throws IOException {\n/* 202 */ this.randomAccessFile.close();\n/* */ }", "static public void wyslijObraz(Image image) throws IOException\n {\n if(Klient.czyRysuje == true)\n {\n String obrazek = \"<<OBRAZ>>\";\n obrazek += DatatypeConverter.printBase64Binary(obrazNaBity(image));//Konwersja obrazka do Base64Binary \n out.println(obrazek);\n }\n }", "private void readFile(String fileName)\n {\n System.out.println(\"reading File\");\n try\n {\n String line;\n BufferedReader input = new BufferedReader(\n new FileReader(fileName));\n while((line = input.readLine()) != null)\n logImage += line + \"\\n\";\n }\n catch(Exception e)\n {\n System.out.println(\"There was an error while reading the file\");\n }\n }" ]
[ "0.62628454", "0.6158847", "0.5945291", "0.5902", "0.5835235", "0.56020635", "0.55871546", "0.5575149", "0.5551728", "0.55357707", "0.5503908", "0.549602", "0.53277695", "0.53188646", "0.53051555", "0.5292985", "0.52864426", "0.5283837", "0.52622825", "0.5234493", "0.52068764", "0.5182981", "0.5176454", "0.51729953", "0.51636225", "0.514784", "0.5145156", "0.5104571", "0.5101355", "0.5078409", "0.50692093", "0.5040905", "0.5028081", "0.50254744", "0.50251114", "0.5019019", "0.5018327", "0.50166476", "0.5014942", "0.5012453", "0.500771", "0.5007252", "0.50037503", "0.49995548", "0.49784923", "0.4963699", "0.494346", "0.49397787", "0.49383432", "0.49378026", "0.49340203", "0.49289495", "0.49289495", "0.49283898", "0.49283862", "0.4927313", "0.4927052", "0.49266398", "0.49258447", "0.49201196", "0.49163637", "0.49121973", "0.49059656", "0.49024105", "0.48993436", "0.48919645", "0.48918247", "0.4891284", "0.4867565", "0.48651433", "0.48622704", "0.48556897", "0.48504105", "0.48444623", "0.48417255", "0.48407295", "0.48399216", "0.48387027", "0.48369792", "0.4834608", "0.48304835", "0.48289263", "0.4821207", "0.48197946", "0.48135567", "0.48119903", "0.4811719", "0.48041454", "0.48033527", "0.4801614", "0.47981364", "0.47935632", "0.47935092", "0.47929025", "0.47890598", "0.4785051", "0.47839403", "0.4783517", "0.47810894", "0.4779394", "0.47752503" ]
0.0
-1
It generates 52 keys which is used to encrypt the data
void procedure() { try { fkey=new FileInputStream(file2); } catch(Exception e) { System.out.println(e); } keybuf= new byte[16]; try { fkey.read(keybuf); z= new int[52]; j1=0; i1=0; for(i=0;i<52;i++) z[i]=0; while( i1<8) { if((j1+1)%2==0) { z[i1]|=keybuf[j1]; // dividing 64 bit cypher block into four 16 bit registers i1++; } else { z[i1]=keybuf[j1]; z[i1]<<=8; } j1++; } i=0; for(j1=1;j1<=5;j1++) { i++; z[i+7]=((z[i]<<9)&0xfe00)|((z[i+1]>>7)&0x1ff); z[i+8]=((z[i+1]<<9)&0xfe00)|((z[i+2]>>7)&0x1ff); z[i+9]=((z[i+2]<<9)&0xfe00)|((z[i+3]>>7)&0x1ff); z[i+10]=((z[i+3]<<9)&0xfe00)|((z[i+4]>>7)&0x1ff); z[i+11]=((z[i+4]<<9)&0xfe00)|((z[i+5]>>7)&0x1ff); z[i+12]=((z[i+5]<<9)&0xfe00)|((z[i+6]>>7)&0x1ff); z[i+13]=((z[i+6]<<9)&0xfe00)|((z[i-1]>>7)&0x1ff); z[i+14]=((z[i-1]<<9)&0xfe00)|((z[i]>>7)&0x1ff); i=i+7; } i1=41; z[48]=((z[i1]<<9)&0xfe00)|((z[i1+1]>>7)&0x1ff); z[49]=((z[i1+1]<<9)&0xfe00)|((z[i1+2]>>7)&0x1ff); z[50]=((z[i1+2]<<9)&0xfe00)|((z[i1+3]>>7)&0x1ff); z[51]=((z[i1+3]<<9)&0xfe00)|((z[i1+4]>>7)&0x1ff); } catch(Exception e) { System.out.println(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected String generateKey(){\n Random bi= new Random();\n String returnable= \"\";\n for(int i =0;i<20;i++)\n returnable += bi.nextInt(10);\n return returnable;\n }", "void genKey(){\n Random rand = new Random();\n int key_length = 16;\n String key_alpha = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n StringBuilder sb = new StringBuilder(key_length);\n for(int i = 0; i < key_length; i++){\n int j = rand.nextInt(key_alpha.length());\n char c = key_alpha.charAt(j);\n sb.append(c);\n }\n this.key = sb.toString();\n }", "public void generateKeys(){\n\t\t//Apply permutation P10\n\t\tString keyP10 = permutation(key,TablesPermutation.P10);\n\t\tresults.put(\"P10\", keyP10);\n\t\t//Apply LS-1\n\t\tString ls1L = leftShift(keyP10.substring(0,5),1);\n\t\tString ls1R = leftShift(keyP10.substring(5,10),1);\n\t\tresults.put(\"LS1L\", ls1L);\n\t\tresults.put(\"LS1R\", ls1R);\n\t\t//Apply P8 (K1)\n\t\tk1 = permutation(ls1L+ls1R, TablesPermutation.P8);\n\t\tresults.put(\"K1\", k1);\n\t\t//Apply LS-2\n\t\tString ls2L = leftShift(ls1L,2);\n\t\tString ls2R = leftShift(ls1R,2);\n\t\tresults.put(\"LS2L\", ls2L);\n\t\tresults.put(\"LS2R\", ls2R);\n\t\t//Apply P8 (K2)\n\t\tk2 = permutation(ls2L+ls2R, TablesPermutation.P8);\n\t\tresults.put(\"K2\", k2);\n\t}", "public void generateKeys() {\r\n try {\r\n SecureRandom random = SecureRandom.getInstance(Constants.SECURE_RANDOM_ALGORITHM);\r\n KeyPairGenerator generator = KeyPairGenerator.getInstance(Constants.ALGORITHM);\r\n generator.initialize(Constants.KEY_BIT_SIZE, random);\r\n \r\n KeyPair keys = generator.genKeyPair();\r\n \r\n persistPrivateKey(keys.getPrivate().getEncoded());\r\n persistPublicKey(keys.getPublic().getEncoded());\r\n logger.log(Level.INFO, \"Done with generating persisting Public and Private Key.\");\r\n \r\n } catch (NoSuchAlgorithmException ex) {\r\n logger.log(Level.SEVERE, \"En error occured while generating the Public and Private Key\");\r\n }\r\n }", "private String generateSecretKey(){\n SecureRandom random = new SecureRandom();\n byte[] bytes = new byte[20];\n\n random.nextBytes(bytes);\n Base32 base32 = new Base32();\n return base32.encodeToString(bytes);\n }", "public RSAKeyContents generateKeys() {\r\n\t\tlock.lock();\r\n\t\ttry {\r\n\t\t\tButtermilkRSAKeyPairGenerator kpGen = new ButtermilkRSAKeyPairGenerator();\r\n\t\t\tkpGen.init(new RSAKeyGenerationParameters(DEFAULT_PUBLIC_EXPONENT, rand, KEY_STRENGTH, CERTAINTY));\r\n\t\t\treturn kpGen.generateKeys();\r\n\t\t} finally {\r\n\t\t\tlock.unlock();\r\n\t\t}\r\n\t}", "public void generateKey() {\n\twhile(true){\n\t rsaKeyA = (int)(Math.random()*20000 + 26);\n\t if(isPrime(rsaKeyA)){\n\t\tbreak;\n\t }\n\t}\n\twhile(true){\n\t rsaKeyB = (int)(Math.random()* 20000 + 26);\n\t if(isPrime(rsaKeyB)&& rsaKeyB != rsaKeyA){\n\t\tbreak;\n\t }\n\t}\n \n }", "public void generateKeys()\n\t{\n\t\tmyP = BigInteger.probablePrime(myView.getBitLength(), rand());\n\t\tmyQ = BigInteger.probablePrime(myView.getBitLength(), rand());\n\t\tif(confirmPrimes(myP, myQ))\n\t\t{\n\t\t\tpublicKey = myP.multiply(myQ);\n\t\t\tmyView.displayPublicKey(publicKey.toString());\n\t\t\tmyPhi = (myP.subtract(BigInteger.ONE).multiply(myQ.subtract(BigInteger.ONE)));\n\t\t\tprivateKey = E.modInverse(myPhi);\n\t\t\tmyView.displayPrivateKey(privateKey.toString());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tgenerateKeys();\n\t\t}\n\t}", "void generateSecretKey() {\n\n Random rand = new Random();\n \n // randomly generate alphabet chars\n this.secretKey.setCharAt(0, (char) (rand.nextInt(26) + 'a'));\n this.secretKey.setCharAt(1, (char) (rand.nextInt(26) + 'a'));\n this.secretKey.setCharAt(4, (char) (rand.nextInt(26) + 'a'));\n this.secretKey.setCharAt(5, (char) (rand.nextInt(26) + 'a'));\n\n // randomly generate special chars\n // special chars are between 33-47 and 58-64 on ASCII table\n if (rand.nextBoolean()) {\n this.secretKey.setCharAt(3, (char) (rand.nextInt(15) + '!'));\n this.secretKey.setCharAt(8, (char) (rand.nextInt(15) + '!'));\n } else {\n this.secretKey.setCharAt(3, (char) (rand.nextInt(7) + ':'));\n this.secretKey.setCharAt(8, (char) (rand.nextInt(7) + ':'));\n }\n \n // randomly generate int between 2 and 5\n this.secretKey.setCharAt(7, (char) (rand.nextInt(4) + '2'));\n }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public int generateKey() {\n SecureRandom secureRandom = new SecureRandom();\n try {\n secureRandom = SecureRandom.getInstance(\"SHA1PRNG\");\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n return secureRandom.nextInt(26);\n }", "private static String m5297cj() {\n try {\n KeyGenerator instance = KeyGenerator.getInstance(\"AES\");\n instance.init(128);\n return Base64.encodeToString(instance.generateKey().getEncoded(), 0);\n } catch (Throwable unused) {\n return null;\n }\n }", "private void generateCipher()\n {\n for (int i = 0; i < 26; i++)\n {\n if (((i + shiftKey) < 26) && ((i + shiftKey) >= 0))\n {\n cipherAlphabet[i] = Alphabet[i + shiftKey];\n }\n else\n {\n cipherAlphabet[i] = Alphabet[(i + shiftKey) - 26];\n }\n } \n }", "public String[] keyGen(){\n \n p1 = BigInteger.probablePrime(N / 2, random);\n p2 = BigInteger.probablePrime(N / 2, random);\n phi0 = (p1.subtract(one)).multiply(p2.subtract(one));\n \n BigInteger modulus = p1.multiply(p2);\n BigInteger privateKey = setPrivateKey(modulus);\n BigInteger publicKey = privateKey.modInverse(phi0);\n \n /* Retourne un tableau de 3 chaine de caractere contenant dans cette ordre */\n /* cle publique, modulus, cle prive */\n String tab[] = {publicKey + \"\", modulus + \"\", privateKey + \"\"};\n return tab;\n \n }", "@Override\n public String generateKey(int round) {\n return this.key.substring(4 * round, 4 * round + 16);\n }", "public void generateKeyPair() {\n\t\ttry {\n\t\t\tKeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"DSA\", \"SUN\");\n\t\t\tSecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n\t\t\tkeyGen.initialize(1024, random);\n\t\t\tKeyPair pair = keyGen.generateKeyPair();\n\t\t\tprivateKey = pair.getPrivate();\n\t\t\tpublicKey = pair.getPublic();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public Key generateKey2(int l) throws IOException{\n int b = l/32;\r\n int [] unos = new int[b];\r\n for(int i=0;i<b;i++){\r\n unos[i] = 1;\r\n }\r\n byte [] aB = int2byte(unos);\r\n\r\n return new SecretKeySpec(aB, \"AES\");\r\n }", "public static String generateActivationKey() {\n return RandomStringUtils.randomNumeric(DEF_COUNT);\n }", "public static String generateActivationKey() {\n return RandomStringUtils.randomNumeric(DEF_COUNT);\n }", "public static void main(String[] args) {\n generateKeys(\"DSA\", 1024);\n\n // Generate a 576-bit DH key pair\n generateKeys(\"DH\", 576);\n\n // Generate a 1024-bit RSA key pair\n generateKeys(\"RSA\", 1024);\n }", "@Test\n public void testKeyGeneration() {\n final int NUM_KEYS = 10;\n Set<byte[]> generatedKeys = new HashSet<>(NUM_KEYS);\n\n for (int i = 0; i < NUM_KEYS; ++i) {\n byte[] newKey = KeyGenerator.instance().generateKey();\n\n assertFalse(\"Duplicate key generated #\" + i, generatedKeys.contains(newKey));\n generatedKeys.add(newKey);\n }\n }", "public byte[] generateKey()\n\t{\n\t\tImageKeyGenerate ikg = ImageKeyGenerate.getMD5SHA256();\n\t\tthis.rowKey = MyBytes.toBytes(CommonUtils.byteArrayToHexString(ikg.generate(imageData)));\n\t\treturn this.rowKey;\n\t}", "private void initKey() {\n String del = \":\";\n byte[] key;\n if (MainGame.applicationType == Application.ApplicationType.Android) {\n key = StringUtils.rightPad(Build.SERIAL + del + Build.ID + del, 32, \"~\").getBytes();\n } else if (MainGame.applicationType == Application.ApplicationType.Desktop) {\n key = new byte[]{0x12, 0x2d, 0x2f, 0x6c, 0x1f, 0x7a, 0x4f, 0x10, 0x48, 0x56, 0x17, 0x4b, 0x4f, 0x48, 0x3c, 0x17, 0x04, 0x06, 0x4b, 0x6d, 0x1d, 0x68, 0x4b, 0x52, 0x50, 0x50, 0x1f, 0x06, 0x29, 0x68, 0x5c, 0x65};\n } else {\n key = new byte[]{0x77, 0x61, 0x6c, 0x0b, 0x04, 0x5a, 0x4f, 0x4b, 0x65, 0x48, 0x52, 0x68, 0x1f, 0x1d, 0x3c, 0x4a, 0x5c, 0x06, 0x1f, 0x2f, 0x12, 0x32, 0x50, 0x19, 0x3c, 0x52, 0x04, 0x17, 0x48, 0x4f, 0x6d, 0x4b};\n }\n for (int i = 0; i < key.length; ++i) {\n key[i] = (byte) ((key[i] << 2) ^ magic);\n }\n privateKey = key;\n }", "private static byte[] generateSymetricKey(int length) {\n\t\tSecureRandom random = new SecureRandom();\n\t\tbyte[] keyBytes = new byte[length];\n\t\trandom.nextBytes(keyBytes);\n\t\tSecretKeySpec key = new SecretKeySpec(keyBytes, \"AES\");\n\t\treturn key.getEncoded();\n\t}", "public void generateAllKeys(){\n\t\tboolean isWhite;\n//\t\tint pitchOffset = 21;\n\t\tint pitchOffset = 1;\n\t\tint keyWidth = this.width / this.numKeys;\n\t\t\n\t\tfor(int i = 0; i<88; i++){\n\t\t\tswitch (i%12){\n\t\t\tcase 1:\n\t\t\tcase 3:\n\t\t\tcase 6:\n\t\t\tcase 8:\n\t\t\tcase 10:\tisWhite = false;\n\t\t\t\t\t\tbreak;\n\t\t\tdefault:\tisWhite = true;\n\t\t\t}\n\t\t\t\n\t\t\tif(isWhite)\n\t\t\t\tallKeys[i] = new vafusion.gui.KeyComponent(0, 0, this.height, keyWidth, i+ pitchOffset, isWhite);\n\t\t\telse\n\t\t\t\tallKeys[i] = new vafusion.gui.KeyComponent(0, 0, this.height / 2, (keyWidth * 2)/3, i+ pitchOffset, isWhite);\n\t\t}\n\t}", "public KeyGenerator() {\n this.publicList = new SinglyLinkedList();\n this.privateList = new PrivateKey();\n }", "private static Key generateKey() {\n return new SecretKeySpec(keyValue, ALGO);\n }", "public void generateKeys() {\n\t\t// p and q Length pairs: (1024,160), (2048,224), (2048,256), and (3072,256).\n\t\t// q must be a prime; choosing 160 Bit for q\n\t\tSystem.out.print(\"Calculating q: \");\n\t\tq = lib.generatePrime(160);\n\t\tSystem.out.println(q + \" - Bitlength: \" + q.bitLength());\n\t\t\n\t\t// p must be a prime\n\t\tSystem.out.print(\"Calculating p \");\n\t\tp = calculateP(q);\n\t System.out.println(\"\\np: \" + p + \" - Bitlength: \" + p.bitLength());\n\t System.out.println(\"Test-Division: ((p-1)/q) - Rest: \" + p.subtract(one).mod(q));\n\t \n\t // choose an h with (1 < h < p−1) and try again if g comes out as 1.\n \t// Most choices of h will lead to a usable g; commonly h=2 is used.\n\t System.out.print(\"Calculating g: \");\n\t BigInteger h = BigInteger.valueOf(2);\n\t BigInteger pMinusOne = p.subtract(one);\n\t do {\n\t \tg = h.modPow(pMinusOne.divide(q), p);\n\t \tSystem.out.print(\".\");\n\t }\n\t while (g == one);\n\t System.out.println(\" \"+g);\n\t \n\t // Choose x by some random method, where 0 < x < q\n\t // this is going to be the private key\n\t do {\n\t \tx = new BigInteger(q.bitCount(), lib.getRandom());\n }\n\t while (x.compareTo(zero) == -1);\n\t \n\t // Calculate y = g^x mod p\n\t y = g.modPow(x, p);\n\t \n System.out.println(\"y: \" + y);\n System.out.println(\"-------------------\");\n System.out.println(\"Private key (x): \" + x);\n\t}", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "@Override\n\tprotected SessionKey generateSessionKey() {\n\n\t\tSessionKey sk = new SessionKey();\n\t\t\n\t\tSecureRandom random = null;\n\t\ttry {\n\t\t\trandom = SecureRandom.getInstance(\"SHA1PRNG\");\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tbyte bytes[] = new byte[16];\n\t\trandom.nextBytes(bytes);\n\n\t\tbyte transformation[] = \"AES/CBC/PKCS5Padding\".getBytes();\n\t\tsk.setTransformationName(transformation);\n\t\tsk.setKey(bytes); // 128 Bits\n\t\trandom.nextBytes(bytes);\n\t\tsk.setIV(bytes); // 128 Bits\n\n\t\t\n\t\treturn sk;\n\t}", "protected SecretKey generateRandomAESKey() throws GeneralSecurityException {\n fixPrng();\n // Instantiante KeyGenerator\n KeyGenerator keyGenerator = KeyGenerator.getInstance(AES_INSTANCE);\n // Initialize generator with the desired keylength\n keyGenerator.init(AES_128);\n // Return new key\n return keyGenerator.generateKey();\n }", "public static byte[] generateRandomKey_AES128() {\n return ByteUtil.randomBytes(16);\n }", "byte[] genKeyBlock(byte[] mastersecret, int[]clientRandom, int[]serverRandom) throws NoSuchAlgorithmException, IOException{\n byte[] part1 = md5andshaprocessing(\"AA\", mastersecret, clientRandom, serverRandom);\r\n byte[] part2 = md5andshaprocessing(\"BB\", mastersecret, clientRandom, serverRandom);\r\n byte[] part3 = md5andshaprocessing(\"CCC\", mastersecret, clientRandom, serverRandom);\r\n byte[] part4 = md5andshaprocessing(\"DDDD\", mastersecret, clientRandom, serverRandom);\r\n byte[] part5 = md5andshaprocessing(\"EEEEE\", mastersecret, clientRandom, serverRandom);\r\n byte[] part6 = md5andshaprocessing(\"FFFFFF\", mastersecret, clientRandom, serverRandom);\r\n \r\n baos.write(part1);\r\n baos.write(part2);\r\n baos.write(part3);\r\n baos.write(part4);\r\n baos.write(part5);\r\n baos.write(part6);\r\n \r\n byte[] keyblock = baos.toByteArray();\r\n baos.reset();\r\n \r\n client_macsecret = new byte[20];\r\n server_macsecret = new byte[20];\r\n client_writekey = new byte[24];\r\n server_writekey = new byte[24];\r\n \r\n System.arraycopy(keyblock, 0, client_macsecret, 0, 20);\r\n System.arraycopy(keyblock, 20, server_macsecret, 0, 20);\r\n System.arraycopy(keyblock, 40, client_writekey, 0, 24);\r\n System.arraycopy(keyblock, 64, server_writekey, 0, 24);\r\n return keyblock;\r\n }", "private static byte[] genKey(String algorithm, int keySize) throws NoSuchAlgorithmException {\n KeyGenerator keyGenerator = KeyGenerator.getInstance(algorithm);\n\n keyGenerator.init(keySize);\n\n SecretKey secretKey = keyGenerator.generateKey();\n\n return secretKey.getEncoded();\n }", "public static String generateActivationKey() {\n return RandomStringUtils.randomNumeric(RESET_CODE_DIGIT_COUNT);\n }", "public static byte[] getEncryptRawKey() {\n\n try {\n /*byte[] bytes64Key = App.RealmEncryptionKey.getBytes(\"UTF-8\");\n KeyGenerator kgen = KeyGenerator.getInstance(\"AES\");\n SecureRandom sr = SecureRandom.getInstance(\"SHA1PRNG\");\n sr.setSeed(bytes64Key);\n kgen.init(128, sr);\n SecretKey skey = kgen.generateKey();\n byte[] raw = skey.getEncoded();*/\n\n byte[] key = new BigInteger(App.RealmEncryptionKey, 16).toByteArray();\n return key;\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n }", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "public Add128(){\n key = new byte[128];\n Random rand = new Random();\n rand.nextBytes(key);\n }", "private byte[][] ECDSAgeneratePublicAndPrivateKey(){\r\n int length = 0;\r\n byte[][] keys;\r\n \r\n do{\r\n \r\n\tECKeyPairGenerator gen = new ECKeyPairGenerator();\r\n\tSecureRandom secureRandom = new SecureRandom();\r\n X9ECParameters secnamecurves = SECNamedCurves.getByName(\"secp256k1\");\r\n\tECDomainParameters ecParams = new ECDomainParameters(secnamecurves.getCurve(), secnamecurves.getG(), secnamecurves.getN(), secnamecurves.getH());\r\n\tECKeyGenerationParameters keyGenParam = new ECKeyGenerationParameters(ecParams, secureRandom);\r\n\tgen.init(keyGenParam);\r\n\tAsymmetricCipherKeyPair kp = gen.generateKeyPair();\r\n\tECPrivateKeyParameters privatekey = (ECPrivateKeyParameters)kp.getPrivate();\r\n\tECPoint dd = secnamecurves.getG().multiply(privatekey.getD());\r\n\tbyte[] publickey=new byte[65];\r\n\tSystem.arraycopy(dd.getY().toBigInteger().toByteArray(), 0, publickey, 64-dd.getY().toBigInteger().toByteArray().length+1, dd.getY().toBigInteger().toByteArray().length);\r\n\tSystem.arraycopy(dd.getX().toBigInteger().toByteArray(), 0, publickey, 32-dd.getX().toBigInteger().toByteArray().length+1, dd.getX().toBigInteger().toByteArray().length);\r\n\tpublickey[0]=4;\r\n length = privatekey.getD().toByteArray().length;\r\n keys = new byte[][]{privatekey.getD().toByteArray(),publickey};\r\n \r\n }while(length != 32);\r\n\treturn keys;\r\n}", "public static String generateHalfKey(){\n return randomChars(HALF_KEY_LENGTH);\n }", "ArrayList<ExportedKeyData> generatePublicKeyList();", "public RSAKeyContents generateKeys(char [] password) {\r\n\t\tlock.lock();\r\n\t\ttry {\r\n\t\t\tButtermilkRSAKeyPairGenerator kpGen = new ButtermilkRSAKeyPairGenerator(password);\r\n\t\t\tkpGen.init(new RSAKeyGenerationParameters(DEFAULT_PUBLIC_EXPONENT, rand, KEY_STRENGTH, CERTAINTY));\r\n\t\t\treturn kpGen.generateKeys();\r\n\t\t} finally {\r\n\t\t\tlock.unlock();\r\n\t\t}\r\n\t}", "private void generateIntegrityKeyPair(boolean clientMode) throws UnsupportedEncodingException, IOException, NoSuchAlgorithmException {\n byte[] cimagic = CLIENT_INT_MAGIC.getBytes(encoding);\n byte[] simagic = SVR_INT_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n byte[] keyBuffer = new byte[H_A1.length + cimagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, H_A1.length);\n System.arraycopy(cimagic, 0, keyBuffer, H_A1.length, cimagic.length);\n md5.update(keyBuffer);\n byte[] Kic = md5.digest();\n System.arraycopy(simagic, 0, keyBuffer, H_A1.length, simagic.length);\n md5.update(keyBuffer);\n byte[] Kis = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST12:Kic: \", Kic);\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST13:Kis: \", Kis);\n }\n if (clientMode) {\n myKi = Kic;\n peerKi = Kis;\n } else {\n myKi = Kis;\n peerKi = Kic;\n }\n }", "public String generateApiKey() {\r\n\t\t\r\n\t\tString key = \"\";\r\n\t\t\r\n\t\tfor (int i = 0; i < API_LENGTH; i++) {\r\n\t\t\tchar letter = (char) (Math.random() * (90 - 65 + 1) + 65);\r\n\t\t\tkey += letter;\r\n\t\t}\r\n\t\t\r\n\t\treturn key;\r\n\t}", "public static void main(String[] args) {\n \n byte[] cadena = null;\n byte[] cadenaEncriptada = null;\n byte[] cadenaDencriptada = null;\n String cadena2=\"Hola, bona tarda!, com estas? qqoepoepoepoepooepoepoepoepoepoe\";\n \n SecretKey key=null;\n \n cadena=cadena2.getBytes();\n key=keygenKeyGeneration(128);\n cadenaEncriptada=encryptData(key,cadena);\n System.out.println(cadena2);\n cadena2=cadenaEncriptada.toString();\n System.out.println(cadena2);\n cadenaDencriptada=dencryptData(key,cadenaEncriptada);\n String misstageDencriptat = new String(cadenaDencriptada);\n System.out.println(misstageDencriptat);\n \n }", "private static Key generateKey() throws NoSuchAlgorithmException {\r\n\t\tif (key == null) {\r\n\t\t\tgenerator = KeyGenerator.getInstance(\"DES\");\r\n\t\t\tgenerator.init(new SecureRandom());\r\n\t\t\tkey = generator.generateKey();\r\n\t\t}\r\n\t\treturn key;\r\n\t}", "public interface IKeyCreator {\n byte[] generateKey(int n);\n\n byte[] getKeyFromFile(String p);\n\n byte[] inputKey(String s);\n}", "public String cipher() {\n int[] r1taps = {13, 16, 17, 18};\n int[] r2taps = {20, 21};\n int[] r3taps = {7, 20, 21, 22};\n\n // Set register size and majority bits\n final int R1 = 19;\n final int R1M = 8;\n final int R2 = 22;\n final int R2M = 10;\n final int R3 = 23;\n final int R3M = 10;\n\n // Initialize variables\n String bs = \"\";\n byte[] key = HexStringToBytes(symKey);\n BitSet keySet = new BitSet();\n BitSet keyStream = new BitSet();\n BitSet messageSet = new BitSet();\n\n // Create a byte array length of sample message\n byte[] messageArray = new byte[message.length()];\n\n // Convert the sample message to a byte array\n try {\n messageArray = message.getBytes(\"ISO-8859-1\");\n } catch (Exception e) {\n System.out.println(\"Error: \" + e);\n }\n\n // Convert message sample byte array to string\n String as = \"\";\n for (int i = 0; i < messageArray.length; i++) {\n byte b1 = messageArray[i];\n String s = String.format(\"%8s\", Integer.toBinaryString(b1 & 0xFF))\n .replace(' ', '0');\n as += s;\n }\n\n // Convert string of bits to a BitSet\n messageSet = BitStringToBitSet(as);\n\n // Creates string from key byte array\n for (int i = 0; i < 8; i++) {\n byte b1 = key[i];\n String s = String.format(\"%8s\", Integer.toBinaryString(b1 & 0xFF))\n .replace(' ', '0');\n bs += s;\n }\n\n // Convert string of bits to a BitSet\n keySet = BitStringToBitSet(bs);\n\n // Initialize registers\n BitSet r1 = new BitSet();\n BitSet r2 = new BitSet();\n BitSet r3 = new BitSet();\n\n // Process key into registers\n for (int i = 0; i < 64; i++) {\n r1 = ShiftSet(r1, R1, keySet.get(i) ^ Tap(r1, r1taps));\n r2 = ShiftSet(r2, R2, keySet.get(i) ^ Tap(r2, r2taps));\n r3 = ShiftSet(r3, R3, keySet.get(i) ^ Tap(r3, r3taps));\n }\n\n // Clock additional 100 times for additional security (GSM standard)\n for (int i = 0; i < 100; i++) {\n int maj = 0;\n boolean[] ar = {false, false, false};\n if (r1.get(R1M) == true) {\n ar[0] = true;\n maj += 1;\n }\n if (r2.get(R2M) == true) {\n ar[1] = true;\n maj += 1;\n }\n if (r3.get(R3M) == true) {\n ar[2] = true;\n maj += 1;\n }\n // If majority is false (0 bit)\n if (maj <= 1) {\n if (ar[0] == false) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == false) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == false) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n // Else majority is true\n } else {\n if (ar[0] == true) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == true) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == true) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n }\n }\n\n // Create keystream as long as the sample message\n for (int i = 0; i < message.length() * 8; i++) {\n\n // Get keystream bit\n keyStream.set(i, r1.get(R1 - 1) ^ r2.get(R2 - 1) ^ r3.get(R3 - 1));\n\n // Shift majority registers\n int maj = 0;\n boolean[] ar = {false, false, false};\n if (r1.get(R1M) == true) {\n ar[0] = true;\n maj += 1;\n }\n if (r2.get(R2M) == true) {\n ar[1] = true;\n maj += 1;\n }\n if (r3.get(R3M) == true) {\n ar[2] = true;\n maj += 1;\n }\n // If majority is false (0 bit)\n if (maj <= 1) {\n if (ar[0] == false) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == false) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == false) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n // Else majority is true\n } else {\n if (ar[0] == true) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == true) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == true) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n }\n\n }\n\n // XOR the message with the created keystream and return as string\n messageSet.xor(keyStream);\n return BitStringToText(ReturnSet(messageSet, message.length() * 8));\n }", "public short key();", "private static void keyPairGenerator() throws NoSuchAlgorithmException, IOException {\n KeyPairGenerator kpg = KeyPairGenerator.getInstance(\"RSA\");\n kpg.initialize(2048);\n KeyPair keyPair = kpg.generateKeyPair();\n\n //Get public and private keys\n Key publicKey = keyPair.getPublic();\n Key privateKey = keyPair.getPrivate();\n\n String outFile = files_path + \"/Client_public\";\n PrintStream out = null;\n out = new PrintStream(new FileOutputStream(outFile + \".key\"));\n out.write(publicKey.getEncoded());\n out.close();\n\n outFile = files_path + \"/Client_private\";\n out = new PrintStream(new FileOutputStream(outFile + \".key\"));\n out.write(privateKey.getEncoded());\n out.close();\n\n System.err.println(\"Private key format: \" + privateKey.getFormat());\n // prints \"Private key format: PKCS#8\" on my machine\n\n System.err.println(\"Public key format: \" + publicKey.getFormat());\n // prints \"Public key format: X.509\" on my machine\n\n }", "private List<Key> createSequenceKeys(int count) {\n\t\tList<Key> keys = new ArrayList<Key>();\n\t\tdouble id = new Date().getTime();\n\t\tfor (int i = 0; i < count; i++) {\n\t\t\tdouble id2 = id + (i / count);\n\t\t\tdouble random = Math.random();\n\t\t\tid2 += random / count;\n\t\t\tlong id3 = (long) (id2 * (1 << 18));\n\t\t\tKey key = Datastore.createKey(UserItemMeta.get(), id3);\n\t\t\tkeys.add(key);\n\t\t}\n\t\treturn keys;\n\t}", "static void generate() throws Exception {\n\t\t\n\t\tKeyPairGenerator keyGenerator = KeyPairGenerator.getInstance(\"RSA\");\n\t\tkeyGenerator.initialize(2048);\n\t\tKeyPair kp = keyGenerator.genKeyPair();\n\t\tRSAPublicKey publicKey = (RSAPublicKey)kp.getPublic();\n\t\tRSAPrivateKey privateKey = (RSAPrivateKey)kp.getPrivate();\n\t\t\n\t\tSystem.out.println(\"RSA_public_key=\"+Base64.getEncoder().encodeToString(publicKey.getEncoded()));\n\t\tSystem.out.println(\"RSA_private_key=\"+Base64.getEncoder().encodeToString(privateKey.getEncoded()));\n\t\tSystem.out.println(\"RSA_public_key_exponent=\"+ Base64.getEncoder().encodeToString(BigIntegerUtils.toBytesUnsigned(publicKey.getPublicExponent())));\n\t\tSystem.out.println(\"RSA_private_key_exponent=\"+Base64.getEncoder().encodeToString(BigIntegerUtils.toBytesUnsigned(privateKey.getPrivateExponent())));\n\t}", "OpenSSLKey mo134201a();", "private final void configureKeys() {\n\t\t// SecretServer's public key\n\t\tString line = ComMethods.getValueFor(\"SecretServer\", pubkeysfn);\n\t\tint x = line.indexOf(',');\n\t\tmy_n = new BigInteger(line.substring(0,x));\n\t\tmy_e = new Integer(line.substring(x+1,line.length()));\n\n\t\t// SecretServer's private key\n\t\tline = ComMethods.getValueFor(\"SecretServer\", privkeysfn);\n\t\tx = line.indexOf(',');\n\t\tmy_d = new BigInteger(line.substring(x+1,line.length()));\n\n\t\t// Public keys for all registered Users\n\t\tusersPubKeys1 = new BigInteger[validUsers.length];\n\t\tusersPubKeys2 = new int[validUsers.length];\n\t\tfor (int i=0; i<validUsers.length; i++) {\n\t\t\tline = ComMethods.getValueFor(validUsers[i], pubkeysfn);\n\t\t\tx = line.indexOf(',');\n\t\t\tusersPubKeys1[i] = new BigInteger(line.substring(0,x));\n\t\t\tusersPubKeys2[i] = new Integer(line.substring(x+1,line.length()));\n\t\t}\n\t}", "private void generateBack() {\n\t\tCharacter[] encodeChar = (Character[]) map.values().toArray(new Character[map.size()]);\n\t\tCharacter[] trueChar = (Character[]) map.keySet().toArray(new Character[map.size()]);\n\n\t\tString allencode = \"\";\n\t\tString allTrue = \"\";\n\n\t\tfor (int i = 0; i < encodeChar.length; i++) {\n\t\t\tallencode += encodeChar[i];\n\t\t\tallTrue += trueChar[i];\n\t\t}\n\n\t\tString code = \"import java.util.HashMap;\\n\" + \"import java.util.Map;\\n\" + \"import java.util.Scanner;\\n\"\n\t\t\t\t+ \"public class MyKey {\\n\"\n\t\t\t\t+ \"private static Map<Character, Character> map = new HashMap<Character, Character>();\\n\"\n\t\t\t\t+ \"private static char[] encodeChar = \\\"\" + allencode + \"\\\".toCharArray();\\n\"\n\t\t\t\t+ \"private static char[] trueChar = \\\"\" + allTrue + \"\\\".toCharArray();\\n\"\n\t\t\t\t+ \"private static void mapSetUp() {\\n\" + \"for (int i = 0; i < encodeChar.length; i++) {\\n\"\n\t\t\t\t+ \"map.put(encodeChar[i], trueChar[i]);\\n\" + \"}\\n\" + \"}\\n\"\n\t\t\t\t+ \"private static String decodeMessage(String message) {\\n\" + \"String decode = \\\"\\\";\\n\"\n\t\t\t\t+ \"for (int i = 0; i < message.length(); i++) {\\n\" + \"decode += map.get(message.charAt(i));\\n\" + \"}\\n\"\n\t\t\t\t+ \"return decode;\\n\" + \"}\\n\" + \"public static void main(String[] args){\\n\"\n\t\t\t\t+ \"Scanner sc = new Scanner(System.in);\\n\" + \"System.out.print(\\\"Input your encrypted message : \\\");\"\n\t\t\t\t+ \"String enMessage = sc.nextLine();\" + \"mapSetUp();\\n\"\n\t\t\t\t+ \"System.out.println(\\\"Decrypted message : \\\"+decodeMessage(enMessage));\\n\" + \"}}\";\n\t\tFile f = new File(\"MyKey.java\");\n\t\ttry {\n\t\t\tFileWriter fw = new FileWriter(f);\n\t\t\tBufferedWriter bf = new BufferedWriter(fw);\n\t\t\tbf.write(code);\n\t\t\tbf.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error about IO.\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public static Keys generateKeys() throws GeneralSecurityException {\n KeyGenerator gen = KeyGenerator.getInstance(ENC_ALGORITHM);\n gen.init(KEYLEN);\n SecretKey encKey = gen.generateKey();\n\n /* XXX: It's probably unnecessary to create a different keygen for the\n * MAC, but JCA's API design suggests we should just in case ... */\n gen = KeyGenerator.getInstance(MAC_ALGORITHM);\n gen.init(KEYLEN);\n SecretKey macKey = gen.generateKey();\n\n return new Keys(encKey, macKey);\n }", "public static String generateResetKey() {\n return RandomStringUtils.randomNumeric(SHORT_DEF_COUNT);\n }", "public static String generateApiKey(int length) throws NoSuchAlgorithmException {\n\n SecureRandom random = new SecureRandom();\n byte [] bytes = new byte[length/8];\n random.nextBytes(bytes);\n\n return DatatypeConverter.printHexBinary(bytes).toLowerCase();\n }", "private static void generate(long count, int bits) {\n final SecureRandom rnd = new SecureRandom();\n System.out.println(\"Generating \" + GENERATED_KEY_COUNT + \" keys\");\n getConsole().println(\"Generating \" + GENERATED_KEY_COUNT + \" keys\");\n\n String filename = \"keycheck.\" + (bits * 2) + \"b.csv\";\n try (BufferedWriter writer = new BufferedWriter(new FileWriter(filename))) {\n lastStatusMessageTime = System.nanoTime();\n long numOfKeys = GENERATED_KEY_COUNT,\n startFileTime = System.nanoTime(),\n startKeyTime = System.currentTimeMillis();\n for (int actualKey = 0; actualKey < count; actualKey++) {\n BigInteger p = new BigInteger(bits, 40, rnd);\n BigInteger q = new BigInteger(bits, 40, rnd);\n BigInteger modulus = p.multiply(q);\n BigInteger phi = modulus.subtract(p).subtract(q).add(BigInteger.ONE);\n if (!phi.gcd(EXPONENT_FOR_GENERATED).equals(BigInteger.ONE)) {\n actualKey--;\n continue;\n }\n int time = (int) (System.currentTimeMillis() - startKeyTime);\n\n Params params = new Params();\n params.setP(p);\n params.setQ(q);\n params.setExponent(EXPONENT_FOR_GENERATED);\n params.setModulus(modulus);\n params.setTime(time);\n\n params.writeToFile(writer, actualKey + 1);\n\n showProgress(actualKey + 1, numOfKeys, startFileTime);\n startKeyTime = System.currentTimeMillis();\n }\n } catch (FileNotFoundException ex) {\n System.err.println(\"File '\" + filename + \"' not found\");\n } catch (IOException ex) {\n System.err.println(\"Error on write to file '\" + filename + \"'\");\n } finally {\n consoleDoneLine();\n }\n }", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public static String generateResetKey() {\n return RandomStringUtils.randomNumeric(DEF_COUNT);\n }", "static KeyPair generateKeyPair() throws NoSuchAlgorithmException {\n\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(ALGORITHM);\n\n keyGen.initialize(2048);\n\n //Log.e(TAG, \"generateKeyPair: this is public key encoding \" + Arrays.toString(generateKeyPair.getPrivate().getEncoded()));\n\n return keyGen.generateKeyPair();\n }", "public void stringcon()\n {\n int i,j,k;\n int temp[]=new int[8];\n int a[]=new int[32];\n i=0;\n j=0;\n for(i=0;i<10000;i++)\n bytes[i]=0;\n i=0;\n maxbinary1=0;\n for(i=0;i<24;i++)\n a[i]=binary[i];\n for(i=0;i<24;i++)\n maxbinary1+=a[i]*Math.pow(2,23-i);\n maxbinary2=maxbinary1*8;\n ivalue=0;\n for(i=24,j=0;i<32;i++,j++)\n {\n a[j]=binary[i];\n ivalue+=a[j]*Math.pow(2,7-j);\n }\n if(ivalue==73)\n {\n i=32;\n while(i<maxbinary2)\n {\n for(k=0;k<=7;k++)\n temp[k]=binary[i++];\n for(k=0;k<=7;k++)\n bytes[j]+=temp[k]*Math.pow(2,7-k);\n j++;\n }\n String s=JOptionPane.showInputDialog(this,\"Enter key with 16 letters\");\n char ch[]=new char[s.length()];\n ch=s.toCharArray();\n try\n {\n FileOutputStream f=new FileOutputStream(\"key1.txt\");\n for(i=0;i<ch.length;i++)\n f.write(ch[i]);\n f.close();\n FileOutputStream fout=new FileOutputStream(\"enc1.txt\");\n DataOutputStream d=new DataOutputStream(fout);\n \t\ti=8;\n while(i<(maxbinary1))\n \t\t {\n \t\t\td.write(bytes[i]);\n\t\t i++;\n \t\t }\n fout.close();\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n\n ideaalgo b=new ideaalgo();\n b.procedure();\n b.decryption(\"enc1.txt\");\n try\n {\n BufferedReader d;\n StringBuffer sb=new StringBuffer();\n d=new BufferedReader(new FileReader(\"dec.txt\"));\n String line;\n while((line=d.readLine())!=null)\n sb.append(line+\"\\n\");\n ta.setText(sb.toString());\n d.close();\n }\ncatch(Exception e)\n {\n System.out.println(e);\n }\n }\n}", "public static void generateRoundKeys(String input){\n int i =0;\n\t\tfor (int col1 = 0; col1 <=3; col1++) {\t\t\t\n for (int row1 = 0; row1 <=3; row1 = row1+1) {\n\t\t\toriginalKey[row1][col1] = input.substring(i,i+2);\n\t\t\ti=i+2;\n } \n\t\t} \n //take the original key and make it be the first four columns of W\n for(int row2 = 0; row2<=3; row2++){\n for(int col2 = 0; col2 < 4; col2++){\n W[row2][col2] = originalKey[row2][col2];\n }\n } \n //Starting to create next 40 columns of W\n //temporary matrix temp_w for processing\n String[][] temp_w = null;\n for(int column = 4; column<=43; column++){\n /*Part 1 : if the index of column is not divisible by 4, \n XOR the fourth past and last column with respect to column index*/\n if(column % 4 != 0){\n for(int row = 0; row<=3; row++){\n W[row][column] = performXOR(W[row][column-4], W[row][column-1]); \n }\n }\n else {\n /*Part 2 : if the index of column is divisible by 4,\n step 1: Use temp matrix temp_w to store previous column values.\n Tanspose previous column values to row values\n step 2 : Shif to the left of column values of temp_w*/\n temp_w = new String[1][4]; \n \n temp_w[0][0] = W[1][column - 1];\n temp_w[0][1] = W[2][column - 1];\n temp_w[0][2] = W[3][column - 1];\n temp_w[0][3] = W[0][column - 1];\n \n //step 3 : transform each of the four bytes in temp_w using an S-box function\n for(int m =0 ; m<1; m++){\n for(int n =0; n<=3 ; n++){\n int x = Integer.parseInt(temp_w[m][n].split(\"\")[0],16);\n int y = Integer.parseInt(temp_w[m][n].split(\"\")[1],16);\n temp_w[m][n] = SBOX[x][y]; \n\t\t\t}\n }\n \n //step 4 : Getting RCon coefficient values and performing XOR operation\n //find number of round\n int numRound = column/4;\n //get RCon of the same column number form Rcon table and xOR with first element\n temp_w[0][0] = performXOR(RCON[0][numRound],temp_w[0][0]);\n \n //step 5 : Perform final XOR\n for(int row3 = 0; row3<=3; row3++){\n W[row3][column] = performXOR(W[row3][column-4], temp_w[0][row3]);\n }\n \n }\n }\n \n //Printing Round Keys\n int Rounds = 1;\n int k = 0;\n while (Rounds <=11){ \n for(int column1 = 0; column1<=3; k++, column1++){\n for(int row =0; row<=3; row++){\n System.out.print(W[row][k]);\n }\n } \n System.out.println();\n Rounds++;\n } \n System.out.println(\"\");\n }", "public void generateEphemeralKey(){\n esk = BIG.randomnum(order, rng); //ephemeral secret key, x\n epk = gen.mul(esk); //ephemeral public key, X = x*P\n }", "public static String generateShortActivationKey() {\n return RandomStringUtils.randomNumeric(SHORT_DEF_COUNT);\n }", "public static synchronized int[] createConversationKey() {\r\n\t\tlong millisecs = seed++;\r\n\t\tlong nanosecs = System.nanoTime();\r\n\t\tlong k = millisecs * nanosecs * (nanosecs + millisecs);\r\n\t\t\r\n\t\tint[] key = new int[4];\r\n\t\tkey[0] = setOddParityWord((int)((k >>> 48) & 0xFFFFL));\r\n\t\tkey[1] = setOddParityWord((int)((k >>> 32) & 0xFFFFL));\r\n\t\tkey[2] = setOddParityWord((int)((k >>> 16) & 0xFFFFL));\r\n\t\tkey[3] = setOddParityWord((int)(k & 0xFFFFL));\r\n\t\treturn key;\r\n\t}", "public StringBuilder generateNewKey(int length) {\n\t\tStringBuilder k = new StringBuilder();\n\t\tif (length < 64) {\n\t\t\tlength = 64;\n\t\t}\n\t\tint pv = -1;\n\t\tfor (int i = 0; i < length; i++) {\n\t\t\tint v = pv;\n\t\t\twhile (v == pv) {\n\t\t\t\tv = ZRandomize.getRandomInt(0,99999999);\n\t\t\t}\n\t\t\tk.append(v);\n\t\t\tif (k.length()>=length) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (k.length()>length) {\n\t\t\tk.delete(length,k.length());\n\t\t}\n\t\treturn k;\n\t}", "private static byte[] genKeyWithSeed(String seed) throws Exception {\n\t\tKeyGenerator kg = KeyGenerator.getInstance(ALGORITHM);\n\t\tkg.init(256, new SecureRandom(seed.getBytes()));\n\n\t\tSecretKey secretKey = kg.generateKey();\n\t\treturn secretKey.getEncoded();\n\t}", "public MHKEncryption_Array(){\n\t\t\tBigInteger wgenerator = new BigInteger(\"2\");\n\t\t\twsum = BigInteger.ZERO;\n\t\t\tfor(int i = 0;i < 640;i++){\n\t\t\t\twgenerator = wgenerator.multiply(new BigInteger(\"2\")).subtract(BigInteger.ONE); \n\t\t\t\tw[i] = wgenerator;\n\t\t\t\twsum = wsum.add(wgenerator);\n\t\t\t}\n\t}", "protected static boolean[] generateSecretKey() {\n\n\t\t//Creating the key generator\n\n\t\tKeyGenerator gen = null;\n\t\ttry {\n\t\t gen = KeyGenerator.getInstance(\"AES\");\n\t\t} catch (NoSuchAlgorithmException e1) {\n\t\t System.out.println(\"Algoritmo non supportato\");\n\t\t System.exit(1);\n\t\t}\n\n\t\t//Generating the secret key\n\n\t\tgen.init(new SecureRandom());\n\n\t\tKey k = gen.generateKey();\n\t\tbyte[] key = k.getEncoded();\n\t\t\n\t\tString stringKey = Base64.getEncoder().encodeToString(key);\n\t\t\n\t\tJTextArea textarea= new JTextArea(stringKey);\n\t\ttextarea.setEditable(false);\n\t\tJOptionPane.showMessageDialog(null, textarea, \"This is your SECRET KEY, keep it safe!\", JOptionPane.WARNING_MESSAGE);\n\t\t\n\t\tStego_Model\tmodel = new Stego_Model();\n\t\tboolean[] boolSecretKey = model.bytesToBooleans(key);\n\t\treturn boolSecretKey;\n\t\t}", "public void generate(){\n\t\t//Key Generation\n\t\tint p = 41, q = 67; //two hard-coded prime numbers\n\t\tint n = p * q;\n\t\tint w = (p-1) * (q-1);\n\t\tint d = 83; //hard-coded number relatively prime number to w\n\t\t\n\t\tthis.privatekey = new PrivateKey(d,n); //public key generation completed\n\t\t\n\t\t//Extended Euclid's algorithm\n\t\tint \ta = w, \n\t\t\t\tb = d,\n\t\t\t\tv = a/b;\n\t\tArrayList<Integer> \tx = new ArrayList<Integer>(), \n\t\t\t\t\ty = new ArrayList<Integer>(),\n\t\t\t\t\tr = new ArrayList<Integer>();\n\t\t\n\t\t\n\t\t//Iteration 0\n\t\tint i = 0;\n\t\tx.add(1);\n\t\ty.add(0);\n\t\tr.add(a);\n\t\ti++;\n\t\t//Iteration 1\n\t\tx.add(0);\n\t\ty.add(1);\n\t\tr.add(b);\n\t\ti++;\n\t\t//Iteration 2\n\t\t //iteration counter\n\t\tint e = y.get(i-1);\n\t\tv = r.get(i-2) / r.get(i-1);\n\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t+b*(y.get(i-2)-v*y.get(i-1))); \n\t\ti++;\n\t\t\n\t\t//Iterate until r == 0, then get the previous iteration's value of d\n\t\twhile(r.get(i-1) > 0){\n\t\t\te = y.get(i-1);\n\t\t\tv = r.get(i-2) / r.get(i-1);\n\t\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t\t+b*(y.get(i-2) -(v*y.get(i-1))));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t//if number is negative, add w to keep positive\n\t\tif (e < 0){\n\t\t\te = w+e;\n\t\t}\n\t\tthis.publickey = new PublicKey(e,n); //private key generation completed\n\t\t\n\t\t//print values to console\n\t\tSystem.out.println(\"Value of public key: \" + e + \", private key: \" + d + \", modulus: \" + n);\n\t\tSystem.out.println();\n\t}", "private void generateKeyMappings(HashMap<Integer, Integer> keys)\n {\n int count = 0;\n for (int i = 0; i < 256; i++)\n {\n byte value = (byte) i;\n int transitions = 0;\n int last = value & 1;\n for (int k = 1; k < 8; k++)\n {\n if (((value >> k) & 1) != last)\n {\n last = ((value >> k) & 1);\n transitions++;\n if (transitions > 2)\n {\n break;\n }\n }\n }\n if (transitions <= 2)\n {\n keys.put(i, count++);\n }\n }\n }", "public String generateKey(long duration) throws Exception;", "public KeyPair generadorAleatori() {\n KeyPair keys = null;\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n keyGen.initialize(2048);\n keys = keyGen.genKeyPair();\n } catch (Exception e) {\n System.err.println(\"Generador no disponible.\");\n }\n return keys;\n }", "public static Tuple<String, String> generateKey() {\r\n\t\t// Get the KeyGenerator\r\n\t\ttry {\r\n\t\t\tKeyGenerator kgen;\r\n\t\t\tkgen = KeyGenerator.getInstance(\"AES\");\r\n\t\t\tkgen.init(256);\r\n\t\t\t// Generate the secret key specs.\r\n\t\t\tSecretKey skey = kgen.generateKey();\r\n\t\t\tbyte[] raw = skey.getEncoded();\r\n\t\t\tString key = new Base64().encodeAsString(raw);\r\n\r\n\t\t\tSecureRandom randomSecureRandom = SecureRandom\r\n\t\t\t\t\t.getInstance(\"SHA1PRNG\");\r\n\t\t\tCipher cipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\r\n\t\t\tbyte[] iv = new byte[cipher.getBlockSize()];\r\n\t\t\trandomSecureRandom.nextBytes(iv);\r\n\t\t\tString ivStr = new Base64().encodeAsString(iv);\r\n\t\t\treturn new Tuple(key, ivStr);\r\n\r\n\t\t} catch (NoSuchAlgorithmException e) {\r\n\t\t\tLogger.error(\"Error while generating key: %s\",\r\n\t\t\t\t\t\"NoSuchAlgorithmException\");\r\n\t\t} catch (NoSuchPaddingException e) {\r\n\t\t\tLogger.error(\"Error while generating key: %s\",\r\n\t\t\t\t\t\"NoSuchPaddingException\");\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static String generateRandomKey(int keyLength) {\n String result = \"\";\n Random rand = new Random();\n\n for(int i = 0; i<keyLength; i++) {\n result+=(char)(rand.nextInt(90-65 +1) +65);\n }\n\n return result;\n }", "public void initialize() {\n\t\tString alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n\t\tint N = alphabet.length();\n\n\t\tRandom r = new Random();\n\t\tString key = \"\";\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tkey+= alphabet.charAt(r.nextInt(N));\n\t\t}\n\t\tthis.key = key;\n\t}", "public void KGC(byte[] id_){\n RAND set = new RAND(); \n byte[] RAW = new byte[100];\n for (int i=0;i<100;i++) RAW[i]=(byte)(i);\n set.clean();\n \tset.seed(100,RAW); //create constant key for KGC\n\n id = id_;\n hash1 = new HASH256(); //SHA256\n hash2 = new HASH512(); //SHA512\n gen = ECP.generator(); //generator\n order = new BIG(ROM.CURVE_Order); //order\n skS = BIG.randomnum(order, set); //KGC secret key\n pkS = gen.mul(skS); //KGC public key\n r = BIG.randomnum(order, rng); //KGC random secret key\n R = gen.mul(r); //KGC random public key\n\n hash = hashing(id_, R, hash1, order); //hash with SHA256\n hash.mod(order);\n S = BIG.modadd((BIG.modmul(hash, skS, order)), r, order); //calculate partial private key\n }", "@Override\n\tpublic SecretKey generateDataEncryptionKey() {\n\n\t\ttry {\n\t\t\tKeyGenerator keyGenerator = KeyGenerator.getInstance(\"DESede\"); // Triple\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// DES\n\t\t\treturn keyGenerator.generateKey();\n\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "public void mo2479c() {\n Collections.shuffle(mo2625k(), C0817u.f2167a);\n }", "byte[] getKey();", "private void generatePrivacyKeyPair(boolean clientMode) throws IOException, UnsupportedEncodingException, NoSuchAlgorithmException, SaslException {\n byte[] ccmagic = CLIENT_CONF_MAGIC.getBytes(encoding);\n byte[] scmagic = SVR_CONF_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n int n;\n if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_40])) {\n n = 5;\n } else if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_56])) {\n n = 7;\n } else {\n n = 16;\n }\n byte[] keyBuffer = new byte[n + ccmagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, n);\n System.arraycopy(ccmagic, 0, keyBuffer, n, ccmagic.length);\n md5.update(keyBuffer);\n byte[] Kcc = md5.digest();\n System.arraycopy(scmagic, 0, keyBuffer, n, scmagic.length);\n md5.update(keyBuffer);\n byte[] Kcs = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST24:Kcc: \", Kcc);\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST25:Kcs: \", Kcs);\n }\n byte[] myKc;\n byte[] peerKc;\n if (clientMode) {\n myKc = Kcc;\n peerKc = Kcs;\n } else {\n myKc = Kcs;\n peerKc = Kcc;\n }\n try {\n SecretKey encKey;\n SecretKey decKey;\n if (negotiatedCipher.indexOf(CIPHER_TOKENS[RC4]) > -1) {\n encCipher = Cipher.getInstance(\"RC4\");\n decCipher = Cipher.getInstance(\"RC4\");\n encKey = new SecretKeySpec(myKc, \"RC4\");\n decKey = new SecretKeySpec(peerKc, \"RC4\");\n encCipher.init(Cipher.ENCRYPT_MODE, encKey);\n decCipher.init(Cipher.DECRYPT_MODE, decKey);\n } else if ((negotiatedCipher.equals(CIPHER_TOKENS[DES])) || (negotiatedCipher.equals(CIPHER_TOKENS[DES3]))) {\n String cipherFullname, cipherShortname;\n if (negotiatedCipher.equals(CIPHER_TOKENS[DES])) {\n cipherFullname = \"DES/CBC/NoPadding\";\n cipherShortname = \"des\";\n } else {\n cipherFullname = \"DESede/CBC/NoPadding\";\n cipherShortname = \"desede\";\n }\n encCipher = Cipher.getInstance(cipherFullname);\n decCipher = Cipher.getInstance(cipherFullname);\n encKey = makeDesKeys(myKc, cipherShortname);\n decKey = makeDesKeys(peerKc, cipherShortname);\n IvParameterSpec encIv = new IvParameterSpec(myKc, 8, 8);\n IvParameterSpec decIv = new IvParameterSpec(peerKc, 8, 8);\n encCipher.init(Cipher.ENCRYPT_MODE, encKey, encIv);\n decCipher.init(Cipher.DECRYPT_MODE, decKey, decIv);\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST26:\" + negotiatedCipher + \" IVcc: \", encIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST27:\" + negotiatedCipher + \" IVcs: \", decIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST28:\" + negotiatedCipher + \" encryption key: \", encKey.getEncoded());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST29:\" + negotiatedCipher + \" decryption key: \", decKey.getEncoded());\n }\n }\n } catch (InvalidKeySpecException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported key \" + \"specification used.\", e);\n } catch (InvalidAlgorithmParameterException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid cipher \" + \"algorithem parameter used to create cipher instance\", e);\n } catch (NoSuchPaddingException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported \" + \"padding used for chosen cipher\", e);\n } catch (InvalidKeyException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid data \" + \"used to initialize keys\", e);\n }\n }", "public CaesarCipherOne(int key) {this.key=key;}", "public ECP getKGCRandomKey(){return R;}", "public Base64StringKeyGenerator() {\n this(DEFAULT_KEY_LENGTH);\n }", "Encryption encryption();", "private SecretKey generatePukBaseKey(byte[] derivedKeyBytes) {\n // Extract bytes 10-25 as recovery puk base key bytes\n final byte[] recoveryPukBaseKeyBytes = new byte[16];\n System.arraycopy(derivedKeyBytes, 10, recoveryPukBaseKeyBytes, 0, 16);\n return keyConvertor.convertBytesToSharedSecretKey(recoveryPukBaseKeyBytes);\n }", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "public String createSmartKey(long ... ids);", "protected void generateRandomKey(String randomLetters) {\n\n if (randomKeys == null || randomKeys.length == 0) {\n randomLetters = new String(new char[40]).replace(\"\\0\", randomLetters);\n randomKeys = shuffleArray(randomLetters.toCharArray());\n charCount = 0;\n //Log.d(CLASS_NAME, \"Random key generated\"+ new String(randomKeys));\n }\n\n generatedKey = String.valueOf(randomKeys[charCount++]);\n if (randomKeys.length - 1 == charCount) {\n generatedKey = \"All keys are finished\";\n }\n //setting the generatedkey to textview\n TextView generateKeyForTextView = (TextView) findViewById(R.id.textView_key);\n generateKeyForTextView.setText(generatedKey);\n }", "short generateKeyAndWrap(byte[] applicationParameter, short applicationParameterOffset, byte[] publicKey, short publicKeyOffset, byte[] keyHandle, short keyHandleOffset, byte info);", "private int generateSecret() {\n int secret = secretGenerator.nextInt();\n while (secretToNumber.containsKey(secret)) {\n secret = secretGenerator.nextInt();\n }\n return secret;\n }", "public void setKeyEncode(byte[] keys) {\n\t\ttry {\n\t\t\tthis.key = (SecretKey) new SecretKeySpec(keys, algorithm);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void prga(){\n int i = 0;\n int a = 0;\n int b = 0;\n StringBuilder sb = new StringBuilder();\n fileEncrypted.clear();\n\n byte[] code = new byte[filePlain.size()];\n while (i<filePlain.size()){\n a = (a + 1) % 256;\n b = (b + s_box.get(a)) % 256;\n Collections.swap(s_box, a, b);\n\n int key_int = s_box.get((s_box.get(a) + s_box.get(b))% 256);\n byte cypher = (byte) (key_int^filePlain.get(i));\n\n fileEncrypted.add(cypher);\n sb.append((char)cypher);\n code[i] = cypher;\n i++;\n }\n\n System.out.println(\"aaa\");\n// export file\n Helper.exportFile(code, extension, true);\n }", "@Parameterized.Parameters\n public static Collection<Object[]> generateData() {\n return Arrays.asList(new Object[][] { { ArrayConverter.hexStringToByteArray(\"001d00050466726564\"), 0,\n ExtensionType.PWD_PROTECT, 5, 4, ArrayConverter.hexStringToByteArray(\"66726564\") } });\n }", "public void testCaesar(){\n int key1 = 23;\n int key2 = 17;\n String encrypted = encrypt(\"At noon be in the conference room with your hat on for a surprise party. YELL LOUD!\", 15);\n System.out.println(\"key is 15\" + \"\\n\" + encrypted);\n String encrypted2 = encryptTwoKeys(\"At noon be in the conference room with your hat on for a surprise party. YELL LOUD!\", 8, 21);\n System.out.println(\"key are 8 and 21\" + \"\\n\" + encrypted2);\n }", "public SaltedKeyGenerator(int numOfBuckets, Charset charset) {\n this.numOfBuckets = numOfBuckets;\n this.charset = charset.name();\n // Calculated format is stored to avoid subsequent calculations of it\n paddingFormat = \"%0\" + Integer.toString(numOfBuckets - 1).length() + 'd';\n }", "private String generateToken () {\n SecureRandom secureRandom = new SecureRandom();\n long longToken;\n String token = \"\";\n for ( int i = 0; i < 3; i++ ) {\n longToken = Math.abs( secureRandom.nextLong() );\n token = token.concat( Long.toString( longToken, 34 + i ) );//max value of radix is 36\n }\n return token;\n }", "public BigInteger random(int k){\r\n \tSecureRandom sr = new SecureRandom();\r\n byte[] ba = new byte[k];\r\n ba[0] = (byte) (sr.nextInt(9)+49);\r\n for (int d = 1;d<k;d++){\r\n ba[d] = (byte) (sr.nextInt(10)+48); \r\n }\r\n return new BigInteger(new String(ba));\r\n }" ]
[ "0.7148992", "0.70701253", "0.7026112", "0.701586", "0.6948425", "0.6832915", "0.6805064", "0.67139417", "0.6678743", "0.66774654", "0.6671068", "0.6629034", "0.6561478", "0.65556794", "0.6536969", "0.6524178", "0.64922523", "0.6436647", "0.6436647", "0.63937074", "0.63846153", "0.63766164", "0.63760495", "0.635809", "0.63512236", "0.634357", "0.6324497", "0.6321206", "0.6256243", "0.62551254", "0.62497675", "0.62486935", "0.6248588", "0.623449", "0.62269926", "0.62259007", "0.62216985", "0.6197075", "0.61908823", "0.6167515", "0.6142529", "0.6123828", "0.6119273", "0.61112297", "0.60897666", "0.60795337", "0.60745466", "0.6064518", "0.60447496", "0.6037709", "0.60266757", "0.60251015", "0.6024323", "0.60227454", "0.6022048", "0.60176694", "0.6009078", "0.60018957", "0.5997108", "0.5996128", "0.5972953", "0.5970359", "0.59652704", "0.5960912", "0.5955187", "0.595467", "0.5947147", "0.59352577", "0.593396", "0.59114295", "0.5909943", "0.59047043", "0.58999133", "0.5899207", "0.5887015", "0.5855717", "0.5846007", "0.58374196", "0.582894", "0.58150613", "0.57998043", "0.5794232", "0.57779133", "0.5767465", "0.57583976", "0.57480097", "0.5746601", "0.57416165", "0.5729322", "0.5727954", "0.57205063", "0.57124966", "0.5705583", "0.57051736", "0.5697209", "0.56793356", "0.5672888", "0.5669776", "0.5658782", "0.56499654" ]
0.57218444
90
This function encrypts the data using 52 keys and place the //o/p in a file
void encrypt() { try { size=fin.available(); p=size%8; if(p!=0) np=8-p; size+=np; if(p==0) nl=size/8; else nl=size/8+1; buf=new byte[8]; buf1=new byte[size+10]; fin.read(buf1); int enc[]=new int[size]; mark=-8; k2=0; for(k=0;k<nl;k++) { mark+=8; for(int k1=0;k1<8;k1++) buf[k1]=buf1[mark+k1]; i=0; for(i=0;i<4;i++) x[i]=0; j1=0;i1=0; while( i1<=3) { if((j1+1)%2==0) { x[i1]|=buf[j1]; // dividing 64 bit cipher block into four 16 bit registers i1++; } else { x[i1]=buf[j1]; x[i1]<<=8; } j1++; } // 7 rounds and 14 steps for(i=0 ; i <48 ; ) { step1=mul(x[0],z[i+0]); step2=(x[1]+z[i+1])%65536; step3=(x[2]+z[i+2])%65536; step4=mul(x[3],z[i+3]); step5=step1^step3; step6=step2^step4; step7=mul(step5,z[i+4]); step8=(step6+step7)%65536; step9=mul(step8,z[i+5]); step10=(step7+step9)%65536; step11=step1^step9; step12=step3^step9; step13=step2^step10; step14=step4^step10; x[0]=step11; x[1]=step13; x[2]=step12; x[3]=step14; i=i+6; } x[0]=mul(x[0],z[48]); x[1]=(x[1]+z[49])%65536; x[2]=(x[2]+z[50])%65536; x[3]=mul(x[3],z[51]); for(int t=0;t<4;t++) { ft1 =x[t]&255; ft=x[t]>>8; fenc.write((char)ft); fenc.write((char)ft1); } } fin.close(); } catch(Exception e) { System.out.println(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "OutputFile encryptingOutputFile();", "private void encryptionAlgorithm() {\n\t\ttry {\n\t\t\t\n\t\t\tFileInputStream fileInputStream2=new FileInputStream(\"D:\\\\program\\\\key.txt\");\n\t\t\tchar key=(char)fileInputStream2.read();\n\t\t\tSystem.out.println(key);\n\t\t\tFileInputStream fileInputStream1=new FileInputStream(\"D:\\\\program\\\\message.txt\");\n\t\t\tint i=0;\n\t\t\t\n\t\t\tStringBuilder message=new StringBuilder();\n\t\t\twhile((i= fileInputStream1.read())!= -1 )\n\t\t\t{\n\t\t\t\tmessage.append((char)i);\n\t\t\t}\n\t\t\tString s=message.toString();\n\t\t\tchar[] letters=new char[s.length()];\n\t\t\tStringBuilder en=new StringBuilder();\n\t\t\tfor(int j = 0;j < letters.length;j++)\n\t\t\t{\n\t\t\t\ten.append((char)(byte)letters[j]+key);\n\t\t\t}\t\t\n\t\t\tFileOutputStream fileoutput=new FileOutputStream(\"D:\\\\program\\\\encryptedfile.txt\");\n\t\t\t\n\t\t\tfileInputStream1.close();\n\t\t\tfileInputStream2.close();\n\t\t\t\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t\n\t}", "private void prga(){\n int i = 0;\n int a = 0;\n int b = 0;\n StringBuilder sb = new StringBuilder();\n fileEncrypted.clear();\n\n byte[] code = new byte[filePlain.size()];\n while (i<filePlain.size()){\n a = (a + 1) % 256;\n b = (b + s_box.get(a)) % 256;\n Collections.swap(s_box, a, b);\n\n int key_int = s_box.get((s_box.get(a) + s_box.get(b))% 256);\n byte cypher = (byte) (key_int^filePlain.get(i));\n\n fileEncrypted.add(cypher);\n sb.append((char)cypher);\n code[i] = cypher;\n i++;\n }\n\n System.out.println(\"aaa\");\n// export file\n Helper.exportFile(code, extension, true);\n }", "public void writeKeysToFile(){\n if(d == null){\n calculateKeypair();\n }\n FileHandler fh = new FileHandler();\n fh.writeFile(sbPrivate.toString(), \"sk.txt\");\n fh.writeFile(sbPublic.toString(), \"pk.txt\");\n }", "public static void encrypt() throws IOException{\n\t\tBufferedInputStream in = new BufferedInputStream(new FileInputStream(inFilename));\n\t\tBufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(outFilename));\n\n\t\tSecureRandom randomGen = new SecureRandom(); //used for the salt and the padding\n\t\tbyte[] key; //holds the encryption key\n\n\t\t//get the file length\n\t\tlong fileLength = (new File(inFilename)).length();\n\n\t\t//write the file header marker\n\t\tout.write(FILE_HEADER);\n\n\t\t/* STAGE 1 - generate encryption key */\n\t\t//find the number of bytes we have to pad and write it to the file\n\t\tint numPad;\n\t\tif (fileLength % 8 == 0)\n\t\t\tnumPad = 0;\n\t\telse\n\t\t\tnumPad = (int)(8 - (fileLength % 8));\n\t\tout.write(numPad);\n\t\t//generate a 128-byte random salt and write it to the file\n\t\tbyte[] salt = new byte[128];\n\t\trandomGen.nextBytes(salt);\n\t\tout.write(salt);\n\t\t//generate the message for CubeHash: (password + #padded bits + random salt)\n\t\tbyte[] message = new byte[password.length + 1 + salt.length];\n\t\tSystem.arraycopy(password, 0, message, 0, password.length); //add the password\n\t\tmessage[password.length] = (byte)numPad; //add #padded bits\n\t\tSystem.arraycopy(salt, 0, message, password.length + 1, salt.length); //add random salt\n\t\t//finally, generate the encryption key\n\t\tkey = CryptoLib.CubeHash.doCubeHash(message);\n\n\t\t/* STAGE 2 - apply encryption */\n\t\tint currPiece = 0; //keeps track of which piece of the key is being used\n\t\tbyte[] currData = new byte[8]; //holds the piece of data currently being encrypted\n\n\t\t//split the key into 4 pieces of 128 bits each\n\t\tbyte[][] keyPieces = new byte[4][16];\n\t\tfor (int i = 0; i < 4; i++){\n\t\t\tSystem.arraycopy(key, i*16, keyPieces[i], 0, 16);\n\t\t}\n\n\t\t//loop through the file (except the last block), 8 bytes at a time\n\t\tfor (long i = 0; i < fileLength - 8; i += 8){\n\t\t\t//put a chunk of data in currData\n\t\t\tin.read(currData);\n\n\t\t\t//do TEA(key, RC4(key, data)), then write to file\n\t\t\tout.write(CryptoLib.TEA.doTEA(keyPieces[currPiece],\n\t\t\t\t\t\tCryptoLib.RC4.doRC4(keyPieces[currPiece], currData)));\n\n\t\t\t//increment currPiece\n\t\t\tcurrPiece = (currPiece + 1) % 4;\n\t\t}\n\n\t\t//deal with the last block of data:\n\t\t//first, read it..\n\t\tin.read(currData);\n\t\t//..pad it with random data..\n\t\tfor (int i = 7; i >= (8 - numPad); i--){\n\t\t\tcurrData[i] = (byte)randomGen.nextInt();\n\t\t}\n\t\t//..then encrypt it\n\t\tout.write(CryptoLib.TEA.doTEA(keyPieces[currPiece],\n\t\t\t\t\tCryptoLib.RC4.doRC4(keyPieces[currPiece], currData)));\n\n\t\t/* STAGE 3 - done! */\n\t\tin.close();\n\t\tout.close();\n\t\tSystem.out.println(\"\\nEncryption complete.\");\n\t}", "public void stringcon()\n {\n int i,j,k;\n int temp[]=new int[8];\n int a[]=new int[32];\n i=0;\n j=0;\n for(i=0;i<10000;i++)\n bytes[i]=0;\n i=0;\n maxbinary1=0;\n for(i=0;i<24;i++)\n a[i]=binary[i];\n for(i=0;i<24;i++)\n maxbinary1+=a[i]*Math.pow(2,23-i);\n maxbinary2=maxbinary1*8;\n ivalue=0;\n for(i=24,j=0;i<32;i++,j++)\n {\n a[j]=binary[i];\n ivalue+=a[j]*Math.pow(2,7-j);\n }\n if(ivalue==73)\n {\n i=32;\n while(i<maxbinary2)\n {\n for(k=0;k<=7;k++)\n temp[k]=binary[i++];\n for(k=0;k<=7;k++)\n bytes[j]+=temp[k]*Math.pow(2,7-k);\n j++;\n }\n String s=JOptionPane.showInputDialog(this,\"Enter key with 16 letters\");\n char ch[]=new char[s.length()];\n ch=s.toCharArray();\n try\n {\n FileOutputStream f=new FileOutputStream(\"key1.txt\");\n for(i=0;i<ch.length;i++)\n f.write(ch[i]);\n f.close();\n FileOutputStream fout=new FileOutputStream(\"enc1.txt\");\n DataOutputStream d=new DataOutputStream(fout);\n \t\ti=8;\n while(i<(maxbinary1))\n \t\t {\n \t\t\td.write(bytes[i]);\n\t\t i++;\n \t\t }\n fout.close();\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n\n ideaalgo b=new ideaalgo();\n b.procedure();\n b.decryption(\"enc1.txt\");\n try\n {\n BufferedReader d;\n StringBuffer sb=new StringBuffer();\n d=new BufferedReader(new FileReader(\"dec.txt\"));\n String line;\n while((line=d.readLine())!=null)\n sb.append(line+\"\\n\");\n ta.setText(sb.toString());\n d.close();\n }\ncatch(Exception e)\n {\n System.out.println(e);\n }\n }\n}", "public void writeKeyData(File f) throws IOException;", "public void opentextfile(String path1)\n {\n FileInputStream fin,fin1;\n \tint i,j=0;\n String s=JOptionPane.showInputDialog(this,\"Enter key with 16 letters\");\n char ch[]=new char[s.length()];\n ch=s.toCharArray();\n try\n {\n FileOutputStream f=new FileOutputStream(\"key1.txt\");\n for(i=0;i<ch.length;i++)\n f.write(ch[i]);\n f.close();\n ideaalgo a=new ideaalgo(path1);\n a.procedure();\n a.encrypt();\n BufferedReader d;\n StringBuffer sb=new StringBuffer();\n d=new BufferedReader(new FileReader(path1));\n String line;\n while((line=d.readLine())!=null)\n sb.append(line+\"\\n\");\n ta.setText(sb.toString());\n d.close();\n fin=new FileInputStream(\"enc.txt\");\n do\n \t {\n\t i=fin.read();\n \t if(i!=-1)\n \t\t{\n bytes[j++]=i;\n }\n } while(i!=-1);\n max=j;\n fin.close();\n binarycon();\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n }", "public static void encryptFile(File in, File out, Key pubKey) throws Exception {\n FileInputStream fin;\n FileOutputStream fout;\n int nread = 0; \n byte[] inbuf = new byte[1024];\n fout = new FileOutputStream(out);\n fin = new FileInputStream(in);\n\n SecureRandom random = new SecureRandom();\n // symmetric wrapping\n Key sKey = createKeyForAES(Config.SYM_CRYPTO_STR, random);\n IvParameterSpec sIvSpec = createCtrIvForAES(0, random);\n\n // encrypt symmetric key with RSA/pub key\n Cipher xCipher = Cipher.getInstance(Config.RSA_INSTANCE);\n xCipher.init(Cipher.ENCRYPT_MODE, pubKey, random);\n byte[] keyBlock = xCipher.doFinal(packKeyAndIv(sKey, sIvSpec));\n\n fout.write(keyBlock);\n\n // encrypt data with symmetric key\n Cipher sCipher = Cipher.getInstance(Config.AES_INSTANCE);\n sCipher.init(Cipher.ENCRYPT_MODE, sKey, sIvSpec);\n\n // Now read our file and encrypt it.\n while((nread = fin.read(inbuf)) > 0) {\n fout.write(sCipher.update(inbuf, 0, nread)); // cannot be null, by construction\n }\n // NB doFinal() cannot return null, but can return a zero-length array, which is benign below.\n fout.write(sCipher.doFinal());\n\n fout.flush();\n fin.close();\n fout.close();\n}", "private void encryptFile() {\r\n\t\tisEncryptComplete = false;\r\n\t\tlogger.encryStart = System.currentTimeMillis();\r\n\t\tif(file == null || !file.exists())\r\n\t\t\treturn;\r\n\t\t\r\n\t\tMDFSEncoder encoder = new MDFSEncoder(file, n1, n2, k1, k2);\r\n\t\t/*\r\n\t\t * n1=4;n2=4;k1=3;k2=4; MDFSEncoder encoder = new MDFSEncoder(file, 4,\r\n\t\t * 4, 3, 2);\r\n\t\t */\r\n\t\tif (!encoder.encode()) {\r\n\t\t\tlistener.onError(\"File Encryption Failed\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlogger.encryStop = System.currentTimeMillis();\r\n\t\tList<FragmentInfo> fragInfos = encoder.getFileFragments();\r\n\t\tkeyShares = encoder.getKeyShares();\r\n\r\n\t\t// Store the file fragments in local SDCard\r\n\t\tFile fragsDir = AndroidIOUtils.getExternalFile(Constants.DIR_ROOT + \"/\"\r\n\t\t\t\t+ MDFSFileInfo.getDirName(file.getName(), file.lastModified()));\r\n\r\n\t\tMDFSDirectory directory = serviceHelper.getDirectory();\r\n\t\t// Create file fragments\r\n\t\tfor (FragmentInfo frag : fragInfos) {\r\n\t\t\tFile tmp = IOUtilities.createNewFile(fragsDir, frag.getFileName()\r\n\t\t\t\t\t+ \"__frag__\" + frag.getFragmentNumber());\r\n\t\t\tif (IOUtilities.writeObjectToFile(frag, tmp)) {\r\n\t\t\t\tdirectory.addFileFragment(file.lastModified(),\r\n\t\t\t\t\t\tfrag.getFragmentNumber());\r\n\t\t\t}\r\n\t\t}\r\n\t\tlistener.statusUpdate(\"Encryption Complete\");\r\n\t\tisEncryptComplete = true;\r\n\t\tdistributeFragments();\r\n\t}", "String encode(File message, File key,File crypted);", "public static void main(String[] args) throws IOException {\n char[][] key = new char[8][8];\n\n String[] lines = new String[8];\n\n File fileCardan = new File(\"cardan.txt\");\n\n Scanner fileScanner = new Scanner(fileCardan);\n\n for (int i = 0; i < 8; i++) {\n lines[i] = fileScanner.nextLine();\n }\n\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n key[i][j] = lines[i].charAt(j);\n }\n\n }\n\n // reading text from input.txt file and getting count of 64 char blocks\n String text = new String(Files.readAllBytes(Paths.get(\"input.txt\")));\n\n int blocksCount = text.length() / 64 + 1;\n\n FileWriter fw = new FileWriter(\"encode.txt\");\n\n // encoding all 64 char blocks\n for (int i = 0; i < blocksCount; i++) {\n\n char[][] res;\n if(64+i*64 > text.length())\n res = encode(key, text.substring(i*64));\n else\n res = encode(key, text.substring(i*64,64+i*64));\n fileWrite(res,fw);\n\n }\n\n fw.close();\n\n text = new String(Files.readAllBytes(Paths.get(\"encode.txt\")));\n\n fw = new FileWriter(\"decode.txt\");\n\n for (int i = 0; i < blocksCount; i++) {\n\n fw.write(decode(text.substring(i*64,i*64+64),key));\n\n }\n\n fw.close();\n\n\n\n }", "private void encryptFile(BufferedReader reader, PrintWriter writer) throws IOException {\n while (reader.ready()) {\n String msg = reader.readLine();\n String encMsg = encryptMsg(msg);\n writer.println(encMsg);\n }\n }", "public void write_copy_to_stream(OutputStream out) throws IOException, KeePassDataBaseException {\n\t try {\n\t\tHeaderV1 header = new HeaderV1();\n\t\theader.setGroups(groups.size());\n\t\theader.setEntries(entries.size());\n\t\t\n\t\thash = HashFactory.getHash(Hash.SHA_256);\n\t\tcipher = CipherFactory.getCipher(Cipher.AES);\n\t\t\n\t\tmasterSeed = header.getMasterSeed();\n\t\tmasterSeed2 = header.getMasterSeed2();\n\t\tencryptionIv = header.getEncryptionIV();\n\t\tkeyEncRounds = header.getKeyEncRounds();\n\t\t\n\n\t\tint total_length = 0;\n\t\t// calculate buffer size....\n\t\tfor (Group g : groups) {\n\t\t total_length += GroupSerializer.serialize(g, null);\n\t\t}\n\t\t\n\t\tfor (Entry e: entries) {\n\t\t total_length += EntrySerializer.serialize(e, null);\n\t\t}\n\n \t\tByteBuffer bb = ByteBuffer.allocate(total_length);\n\t\tbb.order(ByteOrder.LITTLE_ENDIAN);\n\n\t\t// serialize groups:\n\n\t\tfor (Group g : groups) {\n\t\t GroupSerializer.serialize(g, bb);\n\t\t}\n\n\t\t// serialize entries:\n\t\tfor (Entry e : entries) {\n\t\t EntrySerializer.serialize(e, bb);\n\t\t}\n\t\t\n\t\tbyte[] plaintext_content = bb.array();\n\t\t\n\t\theader.setContentsHash(hash.hash(plaintext_content));\n\t\t\n\t\tvalidateHeader(header);\n\t\t\n\t\tbyte h[] = header.getHeader();\n\t\tout.write(h);\n\t\t\n\t\tbyte[] content = encrypt(plaintext_content);\n\t\t\n\t\tout.write(content);\n\t\tArrays.fill(plaintext_content, Field.OVERWRITE);\n\t } catch (CipherException ex) {\n\t\tthrow new KeePassDataBaseException(\"encryption failed\", ex);\n\t }\n\t}", "String encryption(Long key, String encryptionContent);", "public static void main(String[] args) \r\n {\r\n /*\r\n String data = \"This is a very important statement.\";\r\n String key = \"How old is my computer?\";\r\n KeyGenerator kGen = new KeyGenerator(key);\r\n String nK = kGen.getNumericKey();\r\n \r\n ArmstrongManager aMgr = new ArmstrongManager(nK);\r\n ColorManager cMgr = new ColorManager(nK);\r\n \r\n String encData =\"\";\r\n int temp;\r\n int i;\r\n for(i =0 ; i < data.length(); i++)\r\n {\r\n temp = aMgr.encrypt(data.charAt(i));\r\n temp = cMgr.encrypt(temp);\r\n encData = encData + (char)temp;\r\n }\r\n \r\n String decData= \"\";\r\n for(i =0 ; i < encData.length(); i++)\r\n {\r\n temp = cMgr.decrypt(encData.charAt(i));\r\n temp = aMgr.decrypt(temp);\r\n \r\n decData = decData + (char)temp;\r\n }\r\n \r\n \r\n System.out.println(\"data: \"+ data + \" \" + data.length());\r\n System.out.println(\"enc data: \"+ encData + \" \" + encData.length());\r\n System.out.println(\"dec data: \"+ decData + \" \" + decData.length());\r\n */\r\n \r\n try\r\n {\r\n //String src = \"d:/a.txt\";//images/kids.jpg\";\r\n //String enc = \"d:/e_a.txt\";//images/e_kids.jpg\";\r\n //String dec = \"d:/d_a.txt\";//images/d_kids.jpg\";\r\n String src = \"d:/images/kids.jpg\";\r\n String enc = \"d:/images/e_kids.jpg\";\r\n String dec = \"d:/images/d_kids.jpg\";\r\n\r\n String key = \"How old is my computer?\";\r\n\r\n Encryptor objEnc = new Encryptor(key);\r\n Decryptor objDec = new Decryptor(key);\r\n\r\n objEnc.encrypt(src, enc);\r\n System.out.println(\"Encryption Done\");\r\n \r\n objDec.decrypt(enc, dec);\r\n System.out.println(\"Decryption Done\");\r\n \r\n\r\n }\r\n catch(Exception ex)\r\n {\r\n System.out.println(\"Err: \" +ex.getMessage());\r\n }\r\n }", "Encryption encryption();", "void procedure()\n {\n try\n {\n fkey=new FileInputStream(file2);\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n keybuf= new byte[16];\n try\n {\n fkey.read(keybuf);\n z= new int[52];\n j1=0;\n i1=0;\n for(i=0;i<52;i++)\n z[i]=0;\n while( i1<8)\n {\n if((j1+1)%2==0)\n {\n z[i1]|=keybuf[j1]; // dividing 64 bit cypher block into four 16 bit registers\n\t i1++;\n }\n else\n \t {\n\t z[i1]=keybuf[j1];\n\t z[i1]<<=8;\n }\n\t j1++;\n }\n i=0;\n\t for(j1=1;j1<=5;j1++)\n\t {\n\t i++;\n\t z[i+7]=((z[i]<<9)&0xfe00)|((z[i+1]>>7)&0x1ff);\n\t z[i+8]=((z[i+1]<<9)&0xfe00)|((z[i+2]>>7)&0x1ff);\n\t z[i+9]=((z[i+2]<<9)&0xfe00)|((z[i+3]>>7)&0x1ff);\n\t z[i+10]=((z[i+3]<<9)&0xfe00)|((z[i+4]>>7)&0x1ff);\n\t z[i+11]=((z[i+4]<<9)&0xfe00)|((z[i+5]>>7)&0x1ff);\n\t z[i+12]=((z[i+5]<<9)&0xfe00)|((z[i+6]>>7)&0x1ff);\n z[i+13]=((z[i+6]<<9)&0xfe00)|((z[i-1]>>7)&0x1ff);\n\t z[i+14]=((z[i-1]<<9)&0xfe00)|((z[i]>>7)&0x1ff);\n\t i=i+7;\n\t }\n i1=41;\n\t z[48]=((z[i1]<<9)&0xfe00)|((z[i1+1]>>7)&0x1ff);\n\t z[49]=((z[i1+1]<<9)&0xfe00)|((z[i1+2]>>7)&0x1ff);\n\t z[50]=((z[i1+2]<<9)&0xfe00)|((z[i1+3]>>7)&0x1ff);\n\t z[51]=((z[i1+3]<<9)&0xfe00)|((z[i1+4]>>7)&0x1ff);\n}\ncatch(Exception e)\n{\nSystem.out.println(e);\n}\n}", "void encryptFile(String path) throws IOException {\n try (BufferedReader reader = new BufferedReader(new FileReader(path))) {\n PrintWriter writer = new PrintWriter(System.out);\n encryptFile(reader, writer);\n } catch (FileNotFoundException e) {\n System.out.println(\"Error: Input file not found\");\n }\n }", "private void encryptingData(File fileToEncrrypt, Signature dataSigner) throws Exception {\n\t\tFileOutputStream fos = null;\n\t\tFileInputStream fis = null;\n\t\tCipherInputStream cis = null;\n\t\ttry {\n\t\t\tfos = new FileOutputStream(localWorkingDirectoryPath + \"\\\\Encrypted_File.txt\");\n\t\t\tfis = new FileInputStream(fileToEncrrypt);\n\t\t\tbyte[] encryptedDataByteArray = new byte[8];\n\t\t\tcis = new CipherInputStream(fis, myCipher);\n\t\t\tint i = cis.read(encryptedDataByteArray);\n\t\t\twhile (i != -1) {\n\t\t\t\t// Updating the data inside the Signer\n\t\t\t\tdataSigner.update(encryptedDataByteArray);\n\t\t\t\t// writing the encrypted data to the file\n\t\t\t\tfos.write(encryptedDataByteArray, 0, i);\n\t\t\t\ti = cis.read(encryptedDataByteArray);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\twriteToLog(\"Error While trying to encrypt the data: \" + e.getMessage());\n\t\t\tLogWriter.close();\n\t\t\tthrow new Exception(\"Error: While trying to encrypt the data\", e);\n\t\t} finally {\n\t\t\tcis.close();\n\t\t\tfis.close();\n\t\t\tfos.close();\n\t\t}\n\t}", "public static void execEnkripsi(File fileTemp, String pathTempFileEncryptName, String pathEncryptedSecretKeyFile, String pemContent, SimpleDateFormat sdf, String outputFileNameZip) throws Exception{\n String secretKey=RandomStringUtils.randomAlphanumeric(16);\r\n System.out.println(\"Generated Secret Key :\"+secretKey);\r\n File exportedFile;\r\n CompressingUtils compressingUtils = new CompressingUtils();\r\n String tmpPlainZipped = lokasiHasil+\"/tmp\"+outputFileNameZip;\r\n List<File> lsFile = new ArrayList<>();\r\n lsFile.add(fileTemp);\r\n if(compressingUtils.createZipWithoutPassword(lsFile, tmpPlainZipped)){\r\n exportedFile = new File(tmpPlainZipped);\r\n //delete file awal yang telah dikompresi\r\n for(File dfile : lsFile){\r\n dfile.delete();\r\n }\r\n }else{\r\n throw new Exception(\"gagal melakukan kompresi file\");\r\n }\r\n System.out.println(\"file kompresi berhasil dibuat \"+ outputFileNameZip);\r\n\r\n /*Step 3 : enkripsi file dengan kunci acak */\r\n System.out.println(\"Step 3 : enkripsi file dengan kunci acak\");\r\n\r\n\r\n String fileOutputEcnryptedname = lokasiHasil+\"/\"+outputFileNameZip;\r\n\r\n File tempFileEncryptName = new File(pathTempFileEncryptName);\r\n try {\r\n CryptoUtils.encrypt(secretKey, exportedFile, tempFileEncryptName);\r\n } catch (CryptoException e) {\r\n throw new Exception(\"Enkripsi file gagal : \" + e.getMessage());\r\n }\r\n\r\n EncryptionUtils utils = new EncryptionUtils();\r\n PublicKey publicKey = utils.getPublicKeyFromX509(pemContent);\r\n\r\n /*Step 4 : Enkripsi kunci acak dengan public key dari DJP*/\r\n System.out.println(\"Step 4 : enkripsi kunci acak dengan public key dari DJP\");\r\n\r\n String encryptedSecretKey;\r\n try{\r\n encryptedSecretKey = CryptoUtils.encrypt(secretKey, publicKey);\r\n }catch (CryptoException e) {\r\n throw new Exception(\"Enkripsi kunci gagal : \" + e.getMessage());\r\n }\r\n File encryptedSecretKeyFile = new File(pathEncryptedSecretKeyFile);\r\n try {\r\n FileOutputStream outputStream = new FileOutputStream(encryptedSecretKeyFile);\r\n outputStream.write(encryptedSecretKey.getBytes());\r\n outputStream.close();\r\n }catch (FileNotFoundException e){\r\n throw new Exception(\"kunci yang dienkripsi tidak ditemukan : \" + pathEncryptedSecretKeyFile);\r\n } catch (IOException e) {\r\n throw new Exception(\"gagal membentuk kunci enkripsi\");\r\n }\r\n\r\n /*Step 5: Compress data dan key kedalam file zip dan menjadi hasil akhir*/\r\n System.out.println(\"Step 5: Compress enkripsi file dan kunci kedalam file zip\");\r\n\r\n List<File> listFiles = new ArrayList<File>();\r\n listFiles.add(tempFileEncryptName);\r\n listFiles.add(encryptedSecretKeyFile);\r\n\r\n if(listFiles.size() != 2){\r\n for (File file : listFiles) {\r\n file.delete();\r\n }\r\n throw new Exception(\"file enkripsi dan/atau key enkripsi salah satunya tidak ada\");\r\n }\r\n\r\n compressingUtils = new CompressingUtils();\r\n if (compressingUtils.createZip(listFiles, fileOutputEcnryptedname)) {\r\n /*Step 6 : hapus file data dan key, hasil dari step 3 dan 4 */\r\n System.out.println(\"Step 6 : hapus file data dan key, hasil dari step 3 dan 4\");\r\n\r\n for (File file : listFiles) {\r\n file.delete();\r\n }\r\n /*Step 7: hapus file zip, hasil dari step 2 */\r\n System.out.println(\"Step 7: hapus file zip, hasil dari step 2\");\r\n\r\n exportedFile.delete();\r\n }\r\n\r\n System.out.println(\"Proses enkripsi selesai, nama file : \" + fileOutputEcnryptedname);\r\n }", "protected void writeCipherAndIVToFileBase64(CipherIV data, String filename) throws IOException {\n super.saveBytesToFileBase64(filename + CIPHER_PART, data.getCipher());\n super.saveBytesToFileBase64(filename + IV_PART, data.getIv());\n }", "public static void main(String[] args) throws FileNotFoundException\n\t{\n\t\tString input;\n//\t\tString output = \"\";\n\t\tFile f = new File(\"PlayfairKey.txt\");\n\t\tScanner reader = new Scanner(f);\n\t\tScanner in = new Scanner(System.in);\n\t\t//fills in the key array\n\t\tfor(int y = 0; y < 5; y++)\n\t\t{\n\t//\t\tSystem.out.println(\"Reached x\");\n\t\t\tfor(int x = 0; x < 5; x++)\n\t\t\t{\n\t\t\t\tString temp = reader.nextLine();\n\t//\t\t\tSystem.out.println(\"Reached y\");\n\t\t\t\tkey[x][y] = temp.charAt(0);\n\t\t\t}\n\t\t}\n\t\t\n\t\treader.close();\n\t\t/*\n\t\tfor(int y = 0; y < 5; y++)\n\t\t{\n\t\t\tfor(int x = 0; x < 5; x++)\n\t\t\t{\n\t\t\t\tSystem.out.print(key[x][y]+\" \");\n\t\t\t\t//System.out.print(x+\",\"+y+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\\t\");\n\t\t}\n\t\t*/\n\t\t\n\t\t/*\n\t\tfor(int y = 0; y < 5; y++)\n\t\t{\n\t\t\tfor(int x = 0; x < 5; x++)\n\t\t\t{\n\t\t\t\t//System.out.print(key[x][y]+\" \");\n\t\t\t\tSystem.out.print(x+\",\"+y+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\\t\");\n\t\t}\n\t\t*/\n\t\t\n\t\t\n\t\t\n\t\t//test\n\t//\tSystem.out.println(\"Enter 1 to encrypt, 2 to decrypt, -1 to end the program\");\n\t\twhile(condition != -1)\n\t\t{\n\t\t\t\n\t\t\tSystem.out.println(\"Enter 1 to encrypt, 2 to decrypt, -1 to end the program\");\n\t\t\n\t\t\tcondition = in.nextInt();\n\t\t\n\t\t\tif(condition == -1)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Enter a String:\");\n\t\t\tin.nextLine();\n\t\t\tinput = in.nextLine();\n\t\t\t\n\t\t\tinput = input.replaceAll(\" \",\"\");\n\t\t\n\t\t\tinput = input.toLowerCase();\n\t\t\t\n\t\t\t\n\t\t\tif(condition == 1)\n\t\t\t{\n\t\t\t\tinput = input.replaceAll(\"j\",\"i\");\n\t\t\t\tchar[] tempInputArray = input.toCharArray();\n\t\t\t\tint found = 1;\n\t\t\t\t\n\t\t\t\tfor(int i =0; i < tempInputArray.length-1; i++)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif(tempInputArray[i] == tempInputArray[i+1])\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tinput = input.substring(0, i+found) + \"x\" + input.substring(i+found, input.length());\n\t\t\t\t\t\tfound++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(input.length() % 2 != 0)\n\t\t\t\t{\n\t\t\t\t\tinput+=\"x\";\n\t\t\t\t}\n\t\t\t\t\n//\t\t\t\tSystem.out.println(input);\n\t\t\t\t\n\t\t\t\tchar[] inputArray = input.toCharArray();\n\t\t\t\tSystem.out.println(\"Encrypted:\");\n\t\t\t\tencrypt(inputArray);\n\t\t\t}\n\t\t\telse if(condition == 2)\n\t\t\t{\n//\t\t\t\tSystem.out.println(input);\n\t\t\t\tchar[] inputArray = input.toCharArray();\n\t\t\t\tSystem.out.println(\"Decrypted:\");\n\t\t\t\tdecrypt(inputArray);\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"\\n\\n\");\n\t\t\t\n\t\t}\n\n\t\t\n\t}", "private static void encryptFile(String fileInput, String publicKeyFilename) throws Exception {\n\n\t\t// Load the public key bytes\n\t\tFileInputStream fis = new FileInputStream(publicKeyFilename);\n\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\n\n\t\tint theByte = 0;\n\t\twhile ((theByte = fis.read()) != -1) {\n\t\t\tbaos.write(theByte);\n\t\t}\n\t\tfis.close();\n\n\t\tbyte[] keyBytes = baos.toByteArray();\n\t\tbaos.close();\n\n\t\t// Turn the encoded key into a real RSA public key.\n\t\t// Public keys are encoded in X.509.\n\t\tX509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);\n\t\tKeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n\t\tPublicKey publicKey = keyFactory.generatePublic(keySpec);\n\n\t\t// Open up an output file for the output of the encryption\n\t\tString fileOutput = fileInput + ENCRYPTED_FILENAME_SUFFIX;\n\t\tDataOutputStream output = new DataOutputStream(new FileOutputStream(fileOutput));\n\n\t\t// Create a cipher using that key to initialize it\n\t\tCipher rsaCipher = Cipher.getInstance(\"RSA/ECB/PKCS1Padding\");\n\t\trsaCipher.init(Cipher.ENCRYPT_MODE, publicKey);\n\n\t\t// Now create a new 256 bit Rijndael key to encrypt the file itself.\n\t\t// This will be the session key.\n\t\tKeyGenerator rijndaelKeyGenerator = KeyGenerator.getInstance(\"Rijndael\");\n\t\trijndaelKeyGenerator.init(256);\n\t\tSystem.out.println(\"Generating session key...\");\n\t\tKey rijndaelKey = rijndaelKeyGenerator.generateKey();\n\t\tSystem.out.println(\"Done generating key.\");\n\n\t\t// Encrypt the Rijndael key with the RSA cipher\n\t\t// and write it to the beginning of the file.\n\t\tbyte[] encodedKeyBytes = rsaCipher.doFinal(rijndaelKey.getEncoded());\n\t\toutput.writeInt(encodedKeyBytes.length);\n\t\toutput.write(encodedKeyBytes);\n\n\t\t// Now we need an Initialization Vector for the symmetric cipher in CBC mode\n\t\tSecureRandom random = new SecureRandom();\n\t\tbyte[] iv = new byte[16];\n\t\trandom.nextBytes(iv);\n\n\t\t// Write the IV out to the file.\n\t\toutput.write(iv);\n\t\tIvParameterSpec spec = new IvParameterSpec(iv);\n\n\t\t// Create the cipher for encrypting the file itself.\n\t\tCipher symmetricCipher = Cipher.getInstance(\"Rijndael/CBC/PKCS5Padding\");\n\t\tsymmetricCipher.init(Cipher.ENCRYPT_MODE, rijndaelKey, spec);\n\n\t\tCipherOutputStream cos = new CipherOutputStream(output, symmetricCipher);\n\n\t\tSystem.out.println(\"Encrypting the file...\");\n\n\t\tFileInputStream input = new FileInputStream(fileInput);\n\n\t\ttheByte = 0;\n\t\twhile ((theByte = input.read()) != -1) {\n\t\t\tcos.write(theByte);\n\t\t}\n\t\tinput.close();\n\t\tcos.close();\n\t\tSystem.out.println(\"File encrypted.\");\n\t\treturn;\n\t}", "static void encryptECB(String filename, String key) {\n try {\n Scanner s = new Scanner(new File(filename + EXT), \"UTF-8\");\n File newFile = new File(filename + \"_ECB\" + EXT);\n newFile.delete();\n newFile.createNewFile();\n PrintWriter w = new PrintWriter(newFile);\n processHeader(s, w);\n while (s.hasNext()) {\n readBlock(s);\n block = stateToBits(AES.encrypt(bitsToHexString(block), key));\n writeBlock(w);\n }\n w.flush();\n w.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private static void crypto(String filePath1, String filePath2) {\n\n\t\t// Retrieve the cipher\n\t\tCipher cipher;\n\t\ttry {\n\t\t\tcipher = obtainCipher();\n\n\t\t} catch (InvalidKeyException | InvalidAlgorithmParameterException | NoSuchAlgorithmException\n\t\t\t\t| NoSuchPaddingException e) {\n\t\t\tSystem.out.println(\"Exception while obtaining cypher: \" + e.getMessage());\n\t\t\treturn;\n\t\t}\n\n\t\tPath p = Paths.get(filePath1);\n\t\tPath p2 = Paths.get(filePath2);\n\n\t\t// Open the file input and output stream\n\t\ttry (InputStream is = Files.newInputStream(p); OutputStream os = Files.newOutputStream(p2)) {\n\t\t\tbyte[] buff = new byte[4096];\n\n\t\t\twhile (true) {\n\t\t\t\tint r = is.read(buff);\n\n\t\t\t\tif (r == -1) {\n\t\t\t\t\t// Finishing the cipher\n\t\t\t\t\ttry {\n\t\t\t\t\t\tos.write(cipher.doFinal());\n\t\t\t\t\t} catch (IllegalBlockSizeException | BadPaddingException e) {\n\t\t\t\t\t\tSystem.out.println(\"Exception while finalizaing cipher: \" + e.getMessage());\n\t\t\t\t\t\tSystem.exit(1);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Update cipher and write into new file\n\t\t\t\tos.write(cipher.update(buff, 0, r));\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Exception while opening the file: \" + e.getMessage());\n\t\t\tSystem.exit(1);\n\n\t\t}\n\n\t\tSystem.out.println((encrypt ? \"Encryption\" : \"Decryption\") + \" completed. Generated file \" + filePath2\n\t\t\t\t+ \" based on file \" + filePath1 + \".\");\n\n\t}", "private static void crypting(boolean encrypt, String filename, String cryptedFilename) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tSystem.out.println(\"Please provide password as hex-encoded text (16 bytes, i.e. 32 hex-digits): \");\n\t\tSystem.out.print(\">\");\n\t\tString keyText = sc.nextLine();\n\n\t\tSystem.out.println(\"Please provide initialization vector as hex-encoded text (32 hex-digits): \");\n\t\tSystem.out.print(\">\");\n\t\tString ivText = sc.nextLine();\n\t\tsc.close();\n\n\t\tSecretKeySpec keySpec = new SecretKeySpec(Util.hextobyte(keyText), \"AES\");\n\t\tAlgorithmParameterSpec paramSpec = new IvParameterSpec(Util.hextobyte(ivText));\n\t\tCipher cipher = null;\n\n\t\ttry {\n\t\t\tcipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n\t\t\tcipher.init(encrypt ? Cipher.ENCRYPT_MODE : Cipher.DECRYPT_MODE, keySpec, paramSpec);\n\n\t\t} catch (NoSuchAlgorithmException | NoSuchPaddingException exc) {\n\t\t\tSystem.out.println(\"Transformation is in invalid format or contains padding scheme that is unavailable. \");\n\t\t\tSystem.exit(1);\n\t\t} catch (InvalidKeyException | InvalidAlgorithmParameterException exc) {\n\t\t\tSystem.out.println(\"Given key or algorithm is invalid for this cipher.\");\n\t\t\tSystem.exit(1);\n\n\t\t}\n\n\t\ttry (InputStream inputStream = new BufferedInputStream(new FileInputStream(filename));\n\t\t\t\tOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(cryptedFilename))) {\n\n\t\t\tint nRead;\n\t\t\tbyte[] buffer = new byte[4096];\n\t\t\tbyte[] inputfile = null;\n\n\t\t\twhile ((nRead = inputStream.read(buffer, 0, buffer.length)) != -1) {\n\t\t\t\tinputfile = cipher.update(buffer, 0, nRead);\n\t\t\t\toutputStream.write(inputfile);\n\t\t\t}\n\n\t\t\tinputfile = cipher.doFinal();\n\t\t\toutputStream.write(inputfile);\n\n\t\t} catch (FileNotFoundException exc) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"File does not exist, is a directory rather than a regular file, or cannot be opened for reading because of some other reason. \");\n\t\t\tSystem.exit(1);\n\n\t\t} catch (IOException exc) {\n\t\t\tSystem.out.println(\"Input stream couldn't be initialized.\");\n\t\t\tSystem.exit(1);\n\n\t\t} catch (IllegalBlockSizeException | BadPaddingException e) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"Encryption algorithm is unable to process the input data provided or the decrypted data is not bounded by the appropriate padding bytes. \");\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\tif (encrypt) {\n\t\t\tSystem.out.printf(\"Encryption completed. Generated file %s based on file %s.\\n\", cryptedFilename, filename);\n\t\t} else {\n\t\t\tSystem.out.printf(\"Decryption completed. Generated file %s based on file %s.\\n\", cryptedFilename, filename);\n\t\t}\n\n\t}", "public void encrypt() {\n // JOptionPane.showMessageDialog(null, \"Encrypting ... Action-Type = \" + DES_action_type);\n int[] flipped_last2_cipher_rounds = new int[64];\n for (int i = 0; i < 32; i++) {\n flipped_last2_cipher_rounds[i] = DES_cipher_sequence[17][i];\n flipped_last2_cipher_rounds[32 + i] = DES_cipher_sequence[16][i];\n }\n DES_ciphertext = select(flipped_last2_cipher_rounds, FP);\n }", "public static void main(String[] args) {\n \n byte[] cadena = null;\n byte[] cadenaEncriptada = null;\n byte[] cadenaDencriptada = null;\n String cadena2=\"Hola, bona tarda!, com estas? qqoepoepoepoepooepoepoepoepoepoe\";\n \n SecretKey key=null;\n \n cadena=cadena2.getBytes();\n key=keygenKeyGeneration(128);\n cadenaEncriptada=encryptData(key,cadena);\n System.out.println(cadena2);\n cadena2=cadenaEncriptada.toString();\n System.out.println(cadena2);\n cadenaDencriptada=dencryptData(key,cadenaEncriptada);\n String misstageDencriptat = new String(cadenaDencriptada);\n System.out.println(misstageDencriptat);\n \n }", "public void encrypt() throws Exception {\n\t\tLogWriter = new BufferedWriter(new FileWriter(localWorkingDirectoryPath + \"\\\\Log_Encryption.txt\"));\n\t\tFileOutputStream configurationFileOutputStream = null;\n\n\t\t// Loading the store with the giving arguments\n\t\twriteToLog(\"Step 1: Loading the store with the giving arguments\");\n\t\tloadStore();\n\n\t\t// Getting the receiver's public-key\n\t\twriteToLog(\"Step 2: Getting the receiver's public-key\");\n\t\tCertificate receiverCert = keyStore.getCertificate(receiverSelfSignedCertAlias);\n\t\tif (receiverCert == null) {\n\t\t\twriteToLog(\"The entered certificate alias: \\\"\" + receiverSelfSignedCertAlias\n\t\t\t\t\t+ \"\\\" dose not exist in the keys store.\");\n\t\t\tLogWriter.close();\n\t\t\tthrow new Exception(\"The entered certificate alias: \\\"\" + receiverSelfSignedCertAlias\n\t\t\t\t\t+ \"\\\" dose not exist in the keys store.\");\n\t\t}\n\t\tPublicKey receiverPublicKey = receiverCert.getPublicKey();\n\n\t\t// Getting my private key in order to generate a signature\n\t\twriteToLog(\"Step 3: Getting the encryptor's private-key\");\n\t\tPrivateKey myPrivateKey = getMyPrivateKey();\n\t\t\n\t\t// Generating a symmetric key\n\t\twriteToLog(\"Step 4: Generating a symmetric key\");\n\t\tKeyGenerator kg = KeyGenerator.getInstance(\"AES\");\n\t\tSecretKey semetricKey = kg.generateKey();\n\n\t\t// Generating a random IV\n\t\twriteToLog(\"Step 5: Generating a random IV\");\n\t\tbyte[] iv = generateRandomIV();\n\n\t\t// Initializing the cipher\n\t\twriteToLog(\"Step 6: Initilatzing the cipher Object\");\n\t\ttry {\n\t\t\tmyCipher = createCipher();\n\t\t\tmyCipher.init(Cipher.ENCRYPT_MODE, semetricKey, new IvParameterSpec(iv));\n\t\t}catch(Exception e) {\n\t\t\twriteToLog(\"Error While tring to Initializing the cipher with the giving arguments: \" + e.getMessage());\n\t\t\tLogWriter.close();\n\t\t\tthrow new Exception(\"Error: While tring to Initializing the cipher with the giving arguments\",e);\n\t\t}\n\t\t\n\n\t\t// Initializing the signature with my private-key\n\t\twriteToLog(\"Step 7: Initilatzing the signature Object with the encryptor's private-key\");\n\t\tSignature dataSigner = Signature.getInstance(\"SHA256withRSA\");\n\t\tdataSigner.initSign(myPrivateKey);\n\n\t\t// Encrypting\n\t\twriteToLog(\"Step 8: Encrypting... \");\n\t\tFile fileToEncrrypt = new File(fileToEncryptPath);\n\t\tencryptingData(fileToEncrrypt, dataSigner);\n\n\t\t// Signing on the encrypted data\n\t\twriteToLog(\"Step 9: Signing on the encrypted data \");\n\t\tbyte[] mySignature = dataSigner.sign();\n\n\t\t// Encrypt the symmetric key with the public of the receiver\n\t\twriteToLog(\"Step 10: Encrypt the symmetric key with the public of the receiver \");\n\t\tbyte[] encryptedSymmetricKey = encryptSymmetricKey(receiverPublicKey, semetricKey);\n\n\t\t// Saving the IV, Encrypted Symmetric-Key and Signature to the configurations file\n\t\twriteToLog(\"Step 11: Saving the IV, Encrypted Semetric-Key and Signature to the configurations file \");\n\t\tsavingToConfigurationsFile(configurationFileOutputStream, iv, encryptedSymmetricKey, mySignature);\n\n\t\tLogWriter.write(\"Encryption completed, No Errors Were Found\");\n\t\tLogWriter.close();\n\t}", "public static void encode()\n {\n \n String s = BinaryStdIn.readString();\n //String s = \"ABRACADABRA!\";\n int len = s.length();\n int key = 0;\n \n // generating rotating string table\n String[] table = new String[len];\n for (int i = 0 ; i < len; i++)\n {\n table[i] = rotate(s, i, len);\n }\n \n // sort the table\n String[] sorted = new String[len];\n for(int i = 0 ; i < len; i++)\n {\n sorted[i] = table[i];\n }\n sort(sorted, len);\n \n //generating encoded string\n StringBuilder result = new StringBuilder();\n for(int i = 0 ; i < len; i++)\n result.append(sorted[i].charAt(len-1));\n \n //find the key index \n for(int i = 0 ; i < table.length; i++)\n {\n if(sorted[i].equals(s))\n {\n key = i;\n break;\n }\n }\n \n // output part\n \n BinaryStdOut.write(key);\n \n for(int i = 0 ; i < len; i++)\n BinaryStdOut.write(result.charAt(i)); // generate the output character by character\n \n BinaryStdOut.close();\n \n }", "public static void execEnkripsiBulk(List<File> lsFileTemp, String pathZippedFile, String pathTempFileEncryptName, String pathEncryptedSecretKeyFile, SimpleDateFormat sdf, String pemContent) throws Exception{\r\n /*Step 2 : kompresi file*/\r\n// System.out.println(\"Step 2 : kompresi file\");\r\n\r\n //Generate Secret Key untuk setiap file yang dienkripsi\r\n /**\r\n * Kunci acak 16 Digit, dan setiap pengekripsian harus beda\r\n * contoh : A1b2C3D4E5F6G7h8\r\n * */\r\n String secretKey=RandomStringUtils.randomAlphanumeric(16);\r\n System.out.println(\"Generated Secret Key :\"+secretKey);\r\n\r\n File exportedFile;\r\n CompressingUtils compressingUtils = new CompressingUtils();\r\n String outputTmpFileNameZip = pathZippedFile.replace(\".\",\"\")+\"Tmp.zip\";\r\n String outputFileNameZip = pathZippedFile.replace(\".\",\"\")+sdf.format(new Date())+\".zip\";\r\n\r\n compressingUtils = new CompressingUtils();\r\n if(compressingUtils.createZipWithoutPassword(lsFileTemp, outputTmpFileNameZip)){\r\n exportedFile = new File(outputTmpFileNameZip);\r\n }else{\r\n throw new Exception(\"gagal melakukan kompresi file tanpa password\");\r\n }\r\n\r\n\r\n //delete file hasil enkripsi per file yang telah dimasukan ke dalam file kompresi untuk enkripsi tahap gabungan file\r\n for(File file : lsFileTemp){\r\n file.delete();\r\n }\r\n\r\n System.out.println(\"file kompresi berhasil dibuat \"+ outputFileNameZip);\r\n\r\n /*Step 3 : enkripsi file dengan kunci acak */\r\n System.out.println(\"Step 3 : enkripsi file dengan kunci acak\");\r\n\r\n\r\n String fileOutputEcnryptedname = outputFileNameZip;\r\n\r\n File tempFileEncryptName = new File(pathTempFileEncryptName);\r\n try {\r\n CryptoUtils.encrypt(secretKey, exportedFile, tempFileEncryptName);\r\n } catch (CryptoException e) {\r\n throw new Exception(\"Enkripsi file gagal : \" + e.getMessage());\r\n }\r\n\r\n\r\n EncryptionUtils utils = new EncryptionUtils();\r\n PublicKey publicKey = utils.getPublicKeyFromX509(pemContent);\r\n\r\n /*Step 4 : Enkripsi kunci acak dengan public key dari DJP*/\r\n System.out.println(\"Step 4 : enkripsi kunci acak dengan public key dari DJP\");\r\n\r\n String encryptedSecretKey;\r\n try{\r\n encryptedSecretKey = CryptoUtils.encrypt(secretKey, publicKey);\r\n }catch (CryptoException e) {\r\n throw new Exception(\"Enkripsi kunci gagal : \" + e.getMessage());\r\n }\r\n File encryptedSecretKeyFile = new File(pathEncryptedSecretKeyFile);\r\n try {\r\n FileOutputStream outputStream = new FileOutputStream(encryptedSecretKeyFile);\r\n outputStream.write(encryptedSecretKey.getBytes());\r\n outputStream.close();\r\n }catch (FileNotFoundException e){\r\n throw new Exception(\"kunci yang dienkripsi tidak ditemukan : \" + pathEncryptedSecretKeyFile);\r\n } catch (IOException e) {\r\n throw new Exception(\"gagal membentuk kunci enkripsi\");\r\n }\r\n\r\n /*Step 5: Compress data dan key kedalam file zip dan menjadi hasil akhir*/\r\n System.out.println(\"Step 5: Compress enkripsi file dan kunci kedalam file zip\");\r\n\r\n List<File> listFiles = new ArrayList<File>();\r\n listFiles.add(tempFileEncryptName);\r\n listFiles.add(encryptedSecretKeyFile);\r\n\r\n if(listFiles.size() != 2){\r\n for (File file : listFiles) {\r\n file.delete();\r\n }\r\n throw new Exception(\"file enkripsi dan/atau key enkripsi salah satunya tidak ada\");\r\n }\r\n\r\n compressingUtils = new CompressingUtils();\r\n if (compressingUtils.createZip(listFiles, fileOutputEcnryptedname)) {\r\n /*Step 6 : hapus file data dan key, hasil dari step 3 dan 4 */\r\n System.out.println(\"Step 6 : hapus file data dan key, hasil dari step 3 dan 4\");\r\n\r\n for (File file : listFiles) {\r\n file.delete();\r\n }\r\n /*Step 7: hapus file zip, hasil dari step 2 */\r\n System.out.println(\"Step 7: hapus file zip, hasil dari step 2\");\r\n\r\n exportedFile.delete();\r\n }\r\n\r\n System.out.println(\"Proses enkripsi selesai, nama file : \" + fileOutputEcnryptedname);\r\n }", "void serializeToFile(String fileName, BigInteger mod, BigInteger exp) throws IOException {\r\n ObjectOutputStream ObjOut = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(fileName)));\r\n\r\n try {\r\n ObjOut.writeObject(mod);\r\n ObjOut.writeObject(exp);\r\n System.out.println(\"Key File Created: \" + fileName);\r\n } catch (Exception e) {\r\n throw new IOException(\" Error while writing the key object\", e);\r\n } finally {\r\n ObjOut.close();\r\n }\r\n }", "public void encryptFile(File textInputFile, File cipherOutputFile) throws FileNotFoundException{\n Scanner in = new Scanner(textInputFile);\n PrintStream out = new PrintStream(cipherOutputFile);\n\n while (in.hasNextLine()) {\n String line = in.nextLine() + NEW_LINE;\n out.print(encrypt(line));\n }\n }", "void encryptFile(String inPath, String outPath) throws IOException {\n try (BufferedReader reader = new BufferedReader(new FileReader(inPath))) {\n try (PrintWriter writer = new PrintWriter(outPath)) {\n encryptFile(reader, writer);\n } catch (FileNotFoundException e) {\n System.out.println(\"Error: Output file not found\");\n }\n } catch (FileNotFoundException e) {\n System.out.println(\"Error: Input file not found\");\n }\n }", "public void writeKey(File file) throws FileNotFoundException {\n if (key == null) {\n throw new IllegalStateException(\"Cannot write key. Key not generated.\");\n }\n PrintStream ps = new PrintStream(file);\n for (int i = 0; i < key.length; i++) {\n for (int j = 0; j < key.length; j++) {\n ps.print(key[i][j] + \" \");\n }\n ps.println();\n }\n ps.close();\n }", "void exportSecretKey(long KeyID, OutputStream outputStream) throws PGPException, IOException, KeyNotFoundException;", "public void encryptFile(String fitxer, SecretKey clau) throws FileNotFoundException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IOException, IllegalBlockSizeException, BadPaddingException {\r\n //Creamos el FileInput Stream para leer el archivo.\r\n FileInputStream fis = new FileInputStream(fitxer);\r\n //Creamos el FileOutputStream para escribir en el fichero.\r\n FileOutputStream fos = new FileOutputStream(new File(\"mensajeCifrado.txt\"));\r\n \r\n //Creamos un cifrador para cifrar el texto.\r\n Cipher cifrador = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\r\n IvParameterSpec iv = new IvParameterSpec(cadena_iv.getBytes());\r\n cifrador.init(Cipher.ENCRYPT_MODE, clau);\r\n \r\n //Creamos un buffer que es un array de bytes donde almacenaremos el texto.\r\n byte[] buffer = new byte[1024];\r\n \r\n int bytes;\r\n //Utilizamos un bucle para ir leyendo el archivo de texto que le hemos pasado.\r\n while((bytes = fis.read(buffer, 0, buffer.length))!=-1){\r\n byte [] update = cifrador.update(buffer, 0, bytes);\r\n fos.write(cifrador.doFinal());\r\n }\r\n \r\n //Cerramos recursos.\r\n fos.write(cifrador.doFinal());\r\n fis.close();\r\n fos.close();\r\n \r\n \r\n }", "private static void initVoters() {\n\t\t try {\n\t\t\t FileWriter fw = new FileWriter(\"myfile.csv\");\n\t\t\t PrintWriter writer = new PrintWriter(fw);\n\t\t\t for(int i=0; i<10; i++) {\n\t\t\t \tKeyPair key = Crypto.generateKeys();\n\t\t\t \twriter.println(Crypto.getPrivateKeyasString(key)+\",\"+Crypto.getPublicKeyasString(key)+\"\\n\");\n\t\t\t }\n\t\t\t writer.close();\n\t\t\t}\n\t\t\tcatch (IOException ex) {\n\t\t\t System.out.println(\"An error occured :: \" + ex.getMessage());\n\t\t\t}\n\t\t }", "void exportSecretKey(PGPSecretKeyRing key, OutputStream outputStream) throws IOException;", "void saveKeys(String publicKeyFileLocation, String secretKeyFileLocation) throws IOException;", "public void testCaesar(){\n String msg = \"At noon be in the conference room with your hat on for a surprise party. YELL LOUD!\";\n \n /*String encrypted = encrypt(msg, key);\n System.out.println(\"encrypted \" +encrypted);\n \n String decrypted = encrypt(encrypted, 26-key);\n System.out.println(\"decrypted \" + decrypted);*/\n \n \n String encrypted = encrypt(msg, 15);\n System.out.println(\"encrypted \" +encrypted);\n \n }", "public byte[] encrypt3DES(byte[] key, byte[] data) {\n\n try {\n\n //method def in javadoc\n //arraycopy(Object src, int srcPos, Object dest, int destPos, int length)\n //byte[] keyToUse = new byte[24];\n //Pad the key if not yet 24 bytes\n /*if (key.length == 8) {\n System.arraycopy(key, 0, keyToUse, 0, 8);\n System.arraycopy(key, 0, keyToUse, 8, 8);\n System.arraycopy(key, 0, keyToUse, 16, 8);\n } else if (key.length == 16) {\n //keyToUse = key;\n System.arraycopy(key, 0, keyToUse, 0, 8);\n System.arraycopy(key, 0, keyToUse, 8, 8);\n System.arraycopy(key, 0, keyToUse, 16, 8);\n }*/\n\n // System.out.println(\"Key in is\"+ConvertUtils.bytesToHex(key)+\"\\tKey length is \\t\"+key.length+\"The final Key used for 3DES encrption is\\t\" + ConvertUtils.bytesToHex(key) + \"\\tPlease remove this statement\");\n\n SecretKey secretKey;\n SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(\"DESede\");\n DESedeKeySpec desedeKeySpec = new DESedeKeySpec(key);\n\n secretKey = keyFactory.generateSecret(desedeKeySpec);\n\n secretKey = keyFactory.translateKey(secretKey);\n\n Cipher cipher = Cipher.getInstance(\"DESede/ECB/NoPadding\");\n cipher.init(Cipher.ENCRYPT_MODE, secretKey);\n\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n CipherOutputStream cipherOS = new CipherOutputStream(bos, cipher);\n cipherOS.write(data);\n cipherOS.flush();\n cipherOS.close();\n bos.flush();\n bos.close();\n \n\n byte[] bytesEncrypted = bos.toByteArray();\n\n return bytesEncrypted;\n\n } catch (UnsupportedEncodingException ex) {\n System.out.println(\"UnsupportedEncodingException\\t\" + ex.getMessage());\n } catch (NoSuchAlgorithmException ex) {\n System.out.println(\"NoSuchAlgorithmException\\t\" + ex.getMessage());\n } catch (InvalidKeySpecException ex) {\n System.out.println(\"InvalidKeySpecException\\t\" + ex.getMessage());\n } catch (InvalidKeyException ex) {\n System.out.println(\"InvalidKeyException\\t\" + ex.getMessage());\n }/*catch(IllegalBlockSizeException ex)\n {\n System.out.println(\"IllegalBlockSizeException\\t\"+ex.getMessage());\n }catch(BadPaddingException ex){\n System.out.println(\"BadPaddingException\\t\"+ex.getMessage());\n }*/ catch (NoSuchPaddingException ex) {\n System.out.println(\"NoSuchPaddingException\\t\" + ex.getMessage());\n } catch (IOException ex) {\n System.out.println(\"IOException\\t\" + ex.getMessage());\n }\n return null;\n }", "public void testCaesar(){\n int key1 = 23;\n int key2 = 17;\n String encrypted = encrypt(\"At noon be in the conference room with your hat on for a surprise party. YELL LOUD!\", 15);\n System.out.println(\"key is 15\" + \"\\n\" + encrypted);\n String encrypted2 = encryptTwoKeys(\"At noon be in the conference room with your hat on for a surprise party. YELL LOUD!\", 8, 21);\n System.out.println(\"key are 8 and 21\" + \"\\n\" + encrypted2);\n }", "@Test\n\tpublic void doEncrypt() {\n\t\tString src = \"18903193260\";\n\t\tString des = \"9oytDznWiJfLkOQspiKRtQ==\";\n\t\tAssert.assertEquals(Encryptor.getEncryptedString(KEY, src), des);\n\n\t\t/* Encrypt some plain texts */\n\t\tList<String> list = new ArrayList<String>();\n\t\tlist.add(\"18963144219\");\n\t\tlist.add(\"13331673185\");\n\t\tlist.add(\"18914027730\");\n\t\tlist.add(\"13353260117\");\n\t\tlist.add(\"13370052053\");\n\t\tlist.add(\"18192080531\");\n\t\tlist.add(\"18066874640\");\n\t\tlist.add(\"15357963496\");\n\t\tlist.add(\"13337179174\");\n\t\tfor (String str : list) {\n\t\t\tSystem.out.println(Encryptor.getEncryptedString(KEY, str));\n\t\t}\n\t}", "static void encryptCBC(String filename, String key, String IV) {\n try {\n Scanner s = new Scanner(new File(filename + EXT), \"UTF-8\");\n File newFile = new File(filename + \"_CBC\" + EXT);\n newFile.delete();\n newFile.createNewFile();\n PrintWriter w = new PrintWriter(newFile);\n processHeader(s, w);\n cipherBlock = hexStringToBits(IV);\n while (s.hasNext()) {\n readBlock(s);\n block = xor(block, cipherBlock);\n block = stateToBits(AES.encrypt(bitsToHexString(block), key));\n for (int i = 0; i < block.length; i++) {\n cipherBlock[i] = block[i];\n }\n writeBlock(w);\n }\n w.flush();\n w.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public String encrypt() {\n StringBuilder encryptedText = new StringBuilder();\n //Make sure the key is valid.\n if (key < 0 || key > 25) {\n Log.d(\"TAG\", \"encrypt: Error in Keu=y \");\n return \"Key Must be 0 : 25\";\n }\n if (plaintext.length() <= 0) {\n Log.d(\"TAG\", \"encrypt: Error in Plain\");\n return \"Error in Plaintext\";\n }\n //Eliminates any whitespace and non alpha char's.\n plaintext = plaintext.trim();\n plaintext = plaintext.replaceAll(\"\\\\W\", \"\");\n if (plaintext.contains(\" \")) {\n plaintext = plaintext.replaceAll(\" \", \"\");\n }\n //Makes sure that all the letters are uppercase.\n plaintext = plaintext.toUpperCase();\n Log.i(\"Caesar\", \"encrypt: plainis : \" + plaintext);\n for (int i = 0; i < plaintext.length(); i++) {\n char letter = plaintext.charAt(i);\n if (charMap.containsKey(letter) && charMap.get(letter) != null) {\n int lookUp = (charMap.get(letter) + key) % 26;\n encryptedText.append(encryptionArr[lookUp]);\n }\n }\n Log.d(\"Caesar.java\", \"encrypt: the Data is \" + encryptedText.toString());\n return encryptedText.toString();\n }", "private String exportkey() {\n\n\t\ttry {\n\t\t\tbyte[] keyBytes = serversharedkey.getEncoded();\n\t\t\tString encodedKey = new String(Base64.encodeBase64(keyBytes), \"UTF-8\");\n\t\t\tFile file = new File(\"serversharedKey\");\n\t\t\t//System.out.println(\"The server Private key: \" + encodedKey);\n\t\t\tPrintWriter writer = new PrintWriter(file, \"UTF-8\");\n\t\t\twriter.println(encodedKey);\n\t\t\twriter.close();\n\n\t\t\treturn encodedKey;\n\n\t\t} catch (UnsupportedEncodingException | FileNotFoundException ex) {\n\t\t\tLogger.getLogger(ClientTCP.class.getName()).log(Level.SEVERE, null, ex);\n\t\t}\n\t\treturn null;\n\t}", "public static KeyPair GenrateandEncrypt(String keyname) throws NoSuchAlgorithmException, InvalidKeySpecException, IOException\n\t {\n\t \tKeyPairGenerator kpg;\n\t kpg = KeyPairGenerator.getInstance(\"RSA\");\n kpg.initialize(4096);\n \n KeyPair kp = kpg.genKeyPair();\n PublicKey publicKey = kp.getPublic();\n PrivateKey privateKey = kp.getPrivate();\n\n //save keys \n \n \n String sPublic = Base64.getEncoder().encodeToString( publicKey.getEncoded());\n String sPrivate = Base64.getEncoder().encodeToString( privateKey.getEncoded());\n\n File file1 = new File(keyname+\"public.txt\");\n\t\t\tFileWriter fileWriter1 = new FileWriter(file1);\n\t\t\tfileWriter1.write(sPublic);\n\t\t\t\n\t\t\t\n\t\t\tFile file2 = new File(keyname+\"private.txt\");\n\t\t\tFileWriter fileWriter2 = new FileWriter(file2);\n\t\t\tfileWriter2.write(sPrivate);\n\t\t\t \n fileWriter1.flush();\n fileWriter1.close();\n \n fileWriter2.flush();\n fileWriter2.close();\n ////////////\n \n return kp;\n\t }", "public static void main(String[] args) throws IOException \r\n\t{\n\t\tFile matrixData = new File(\"matrixData.txt\");\r\n\t\tScanner matrixIn = new Scanner(matrixData);\r\n\t\tString key = matrixIn.nextLine();\r\n\t\tmatrixIn.close();\r\n\t\r\n\r\n\t\t// read the text to encipher\r\n\t\tFile inFile = new File(\"textToEncipher.txt\");\r\n\t\tFileInputStream fis = new FileInputStream(inFile);\r\n\t\tBufferedInputStream bis = new BufferedInputStream(fis);\r\n\t\tStringBuilder plain = new StringBuilder(\"\");\r\n\t\twhile (bis.available() > 0)\r\n\t\t{\r\n\t\t\tplain.append((char)bis.read());\r\n\t\t}\r\n\t\t\r\n\t\t// initialize the output file PrintWriter\r\n\t\tFile outFile = new File(\"hillEncipherOutput.txt\");\r\n\t\tPrintWriter dataOut = new PrintWriter(outFile);\r\n\t\t\r\n\t\tHillEncipherer hill = new HillEncipherer(key, plain.toString());\r\n\t\tdataOut.print(hill.encipher());\r\n\t\t\r\n\t\tfis.close();\r\n\t\tbis.close();\r\n\t\tdataOut.close();\r\n\t}", "public static void main(String[] args) throws FileNotFoundException, NullPointerException{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tSystem.out.print(\"Date Encryption:\\n\\tMessage: \");\n\t\tString message = RunLengthEncoding.encodeRLE8(scanner.nextLine(), RunLengthEncoding.Encode.Binary);\n\t\tSystem.out.print( \"\\tKey: \");\n\t\tString key = scanner.nextLine();\n\t\tscanner.close();\n\t\t\n\t\tSystem.out.print(\"\\nBitMessage:\\t\\t\" + message);\n\t\tSystem.out.print(\"\\nKeyMessage:\\t\\t\" + TextToBinary(key));\n\t\t\n\t\tmessage = encrypt(message, key);\n\t\tSystem.out.println(\"\\nEncryptedMessage:\\t\" + message);\n\n\t\tFileHandler.createFile(\"data/encrypted\");\n\t\tFileHandler.writeFile(\"data/encrypted\", message);\n\n\t\tSystem.out.println(\"\\n\" + RunLengthEncoding.decodeRLE8(encrypt(FileHandler.getStrings(\"data/encrypted\"), key), RunLengthEncoding.Encode.Binary));\n\t}", "private static void createKeyFiles(String pass, String publicKeyFilename, String privateKeyFilename) throws Exception {\n\t\tString password = null;\n\t\tif (pass.isEmpty()) {\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tSystem.out.print(\"Password to encrypt the private key: \");\n\t\t\tpassword = in.readLine();\n\t\t\tSystem.out.println(\"Generating an RSA keypair...\");\n\t\t} else {\n\t\t\tpassword = pass;\n\t\t}\n\t\t\n\t\t// Create an RSA key\n\t\tKeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(\"RSA\");\n\t\tkeyPairGenerator.initialize(1024);\n\t\tKeyPair keyPair = keyPairGenerator.genKeyPair();\n\n\t\tSystem.out.println(\"Done generating the keypair.\\n\");\n\n\t\t// Now we need to write the public key out to a file\n\t\tSystem.out.print(\"Public key filename: \");\n\n\t\t// Get the encoded form of the public key so we can\n\t\t// use it again in the future. This is X.509 by default.\n\t\tbyte[] publicKeyBytes = keyPair.getPublic().getEncoded();\n\n\t\t// Write the encoded public key out to the filesystem\n\t\tFileOutputStream fos = new FileOutputStream(publicKeyFilename);\n\t\tfos.write(publicKeyBytes);\n\t\tfos.close();\n\n\t\t// Now we need to do the same thing with the private key,\n\t\t// but we need to password encrypt it as well.\n\t\tSystem.out.print(\"Private key filename: \");\n \n\t\t// Get the encoded form. This is PKCS#8 by default.\n\t\tbyte[] privateKeyBytes = keyPair.getPrivate().getEncoded();\n\n\t\t// Here we actually encrypt the private key\n\t\tbyte[] encryptedPrivateKeyBytes = passwordEncrypt(password.toCharArray(), privateKeyBytes);\n\n\t\tfos = new FileOutputStream(privateKeyFilename);\n\t\tfos.write(encryptedPrivateKeyBytes);\n\t\tfos.close();\n\t}", "public void runAES(String infoFilePath) {\n System.out.println(\"test\");\n try {\n FileInputStream fileInputStream = new FileInputStream(infoFilePath);\n StringBuffer stringBuffer = new StringBuffer();\n for (int i = fileInputStream.read(); i != 19; i = fileInputStream.read())\n stringBuffer.append((char) i);\n // long l = Long.parseLong(stringBuffer.toString());\n\n // This is the Long object in the `info` file.\n // byte[] builtSecretKey = buildSecretKey(-345585222195293739L);\n byte[] builtSecretKey = buildSecretKey(6874628185188049249L);\n\n MessageDigest messageDigest = MessageDigest.getInstance(\"MD5\");\n SecretKeySpec secretKeySpec = new SecretKeySpec(messageDigest.digest(builtSecretKey), \"AES\");\n Cipher cipher = Cipher.getInstance(\"AES\");\n cipher.init(2, secretKeySpec);\n ObjectInputStream objectInputStream = new ObjectInputStream(new CipherInputStream(fileInputStream, cipher));\n\n long secretKey = objectInputStream.readLong();\n HashMap<String, com.b.a.b.a> n = (HashMap<String, com.b.a.b.a>) objectInputStream.readObject();\n String k = (String) objectInputStream.readObject();\n String l = (String) objectInputStream.readObject();\n Boolean p = ((Boolean) objectInputStream.readObject()).booleanValue();\n Boolean o = ((Boolean) objectInputStream.readObject()).booleanValue();\n\n // Print everything\n System.out.println(secretKey);\n System.out.println(\"key_info:\");\n for (String key : n.keySet()) {\n com.b.a.b.a a = n.get(key);\n System.out.println(\" \" + key + \":\");\n System.out.println(\" a.a: \" + a.a.a());\n System.out.println(\" b: \" + a.a.b());\n System.out.println(\" c: \" + a.a.c());\n System.out.println(\" d: \" + a.a.d());\n System.out.println(\" e: \" + a.a.e().toString());\n System.out.println(\" f: \" + a.a.f());\n System.out.println(\" a.b: \" + a.b); // This is my key, existing in every file.\n System.out.println(\" a.c: \" + a.c);\n }\n System.out.println(k);\n System.out.println(l);\n System.out.println(p);\n System.out.println(o);\n\n objectInputStream.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private static byte[] crypt(byte[] input, byte[] key, int mode) throws Exception {\n Provider sunJce = new net.munki.util.security.SunJCE();\r\n Security.addProvider(sunJce);\r\n \r\n javax.crypto.KeyGenerator kgen = javax.crypto.KeyGenerator.getInstance(\"Blowfish\");\r\n\r\n kgen.init(448);\r\n SecretKey skey = kgen.generateKey();\r\n\r\n byte[] raw = key;\r\n SecretKeySpec skeySpec = new SecretKeySpec(raw, \"Blowfish\");\r\n \r\n Cipher cipher = Cipher.getInstance(\"Blowfish/ECB/PKCS5Padding\");\r\n cipher.init(mode, skeySpec);\r\n\r\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\r\n ByteArrayInputStream bis = new ByteArrayInputStream(input);\r\n CipherOutputStream cos = new CipherOutputStream(bos, cipher);\r\n\r\n int length = 0;\r\n byte[] buffer = new byte[8192];\r\n\r\n while ((length = bis.read(buffer)) != -1) {\r\n cos.write(buffer, 0, length);\r\n }\r\n\r\n bis.close();\r\n cos.close();\r\n\r\n return bos.toByteArray();\r\n }", "private void encode(){\r\n \r\n StringBuilder sb = new StringBuilder();\r\n \r\n /*\r\n *if a character code is >126 after adding the encryption key, subtract \r\n *95 to wrap\r\n */\r\n for(int i = 0; i < message.length(); i++){\r\n if(message.charAt(i) + key > 126){\r\n int wrappedKey = message.charAt(i) + key - 95;\r\n \r\n sb.append((char) wrappedKey);\r\n \r\n /*\r\n *if a character code ins't > 126 after adding the encryption key\r\n */\r\n } else{\r\n int wrappedKey = message.charAt(i) + key;\r\n sb.append( (char) wrappedKey);\r\n }\r\n }\r\n /*\r\n *case coded message to a string\r\n */\r\n codedMessage = sb.toString();\r\n }", "void saveKeys() throws IOException;", "public static String encryptSave(String toSave){\r\n\t\tbyte[] checksum = null;\r\n\t\ttry{\r\n\t\t\tMessageDigest md = MessageDigest.getInstance(\"SHA-256\");\r\n\t\t\tchecksum = md.digest(toSave.getBytes());\t//maybe something other than getBytes()?\r\n\t\t\tStringBuilder sb = new StringBuilder(\"\");\r\n\t\t\tfor(int j = 0; j < checksum.length; j++){\r\n\t\t\t\tsb.append(Integer.toString((checksum[j] & 0xff) + 0x100, 16).substring(1)); \r\n\t\t\t}\r\n\t\t\ttoSave = toSave + sb.toString();\r\n\t\t}catch(NoSuchAlgorithmException nsae){\r\n\t\t\tSystem.out.println(\"ERROR: Could not encrypt save file\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\treturn toSave;\r\n\t}", "void exportPublicKey(long KeyId, OutputStream os) throws PGPException, IOException, KeyNotFoundException;", "void writeFile(File file, String password, String cnt);", "public static void encryptBytes() {\r\n\t\tBigInteger[] rArray = new BigInteger[1000000];\r\n\t\ttry {\r\n\t\t\tURL url = Encrypt.class.getResource(\"PrimeBank.txt\");\r\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader(\r\n\t\t\t\t\turl.getPath()));\r\n\t\t\tString line = null;\r\n\t\t\tfor(int i = 0; i < rArray.length; i++) {\r\n\t\t\t\tline = reader.readLine();\r\n\t\t\t\trArray[i] = new BigInteger((String) line);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tprime = rArray;\r\n\t\t\t\r\n\t\t} catch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t\tSystem.out.println(\"Probably no file found?\");\r\n\t\t\t\r\n\t\t} \r\n\t}", "private void encrypt(final String path, final String password, PasswordDeriveData keyData) {\r\n File file = null;\r\n if (path.contains(Environment.getExternalStorageDirectory().getAbsolutePath())) {\r\n file = new File(path);\r\n } else {\r\n file = new File(Environment.getExternalStorageDirectory(), path);\r\n }\r\n System.out.println(file.getAbsolutePath());\r\n\r\n if (!file.exists()) {\r\n showUserInfo(\"file / folder doesn't exist\");\r\n return;\r\n }\r\n\r\n if (password.isEmpty()) {\r\n showUserInfo(\"password cant be empty\");\r\n return;\r\n }\r\n\r\n // if no key is given\r\n if (keyData == null) {\r\n // BUG 1: Key derivation should not be performed outside a foreach block that is using its return value.\r\n // Otherwise all operations in \"encrypt directory\" have the same encryption key\r\n // TODO changed a little bit\r\n try {\r\n keyData = WeakPasswordDerivation.DerivePassword(password);\r\n } catch (NoSuchAlgorithmException | InvalidKeySpecException e) {\r\n showUserInfo(e.getMessage());\r\n e.printStackTrace();\r\n }\r\n }\r\n\r\n if (file.isDirectory()) {\r\n for (File child : file.listFiles()) {\r\n encrypt(child.getAbsolutePath(), password, keyData);\r\n }\r\n } else /* file isn't directory */ {\r\n try {\r\n CryptoWrapper.EncryptFileWithPassword(file, password);\r\n } catch (Throwable e) {\r\n showUserInfo(e.getClass().getSimpleName() + \": \" + e.getMessage());\r\n e.printStackTrace();\r\n }\r\n }\r\n }", "public synchronized void writeNow(String data){\n\t\tlog.debug(\"[SC] Writing now unencrypted - \"+data, 4);\n\t\tif(out!=null){\n\t\t\ttry {\n\t\t\t\tif(!data.endsWith(\"\\n\")){\n\t\t\t\t\tdata = data + \"\\n\";\n\t\t\t\t}\n\t\t\t\tout.write(data.getBytes());\n\t\t\t\tout.flush();\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.error(\"[SC] Could not write to socket\");\n\t\t\t}\t\n\t\t}else{\n\t\t\tlog.error(\"[SC] Could not write to socket\");\n\t\t}\n\t}", "public byte[] encrypt(String data, Key privatekey) {\r\n\t\tif (!presentkey) {\r\n\t\t\t//TODO\r\n\t\t\tkeyDiffieHellmanFirst();\r\n\t\t\t// need to send these values to other side\r\n\t\t\t// wait\r\n\t\t\tkeyDiffieHellmanFinal(//nummer uit packet from the other side);\r\n\t\t}\r\n\t\tbyte[] encrypt = OFB.EnDecrypt(data.getBytes(), diffie.getKey().toByteArray());\r\n\t\tString sign = ((Integer) data.hashCode()).toString();\r\n\t\tbyte[] signed = RSA.encrypt(sign, privatekey);\r\n\t\tbyte[] encrypted = new byte[encrypt.length + signed.length];\r\n\t\tSystem.arraycopy(encrypt, 0, encrypted, 0, encrypt.length);\r\n\t\tSystem.arraycopy(signed, 0, encrypted, encrypt.length, signed.length);\r\n\t\treturn encrypted;\r\n\t}", "public static final byte[] encryptData(final byte data[]) {\n\n for (int j = 0; j < 6; j++) {\n byte remember = 0;\n byte dataLength = (byte) (data.length & 0xFF);\n // printByteArray(data);\n if (j % 2 == 0) {\n for (int i = 0; i < data.length; i++) {\n byte cur = data[i];\n cur = BitTools.rollLeft(cur, 3);\n cur += dataLength;\n cur ^= remember;\n remember = cur;\n cur = BitTools.rollRight(cur, (int) dataLength & 0xFF);\n cur = ((byte) ((~cur) & 0xFF));\n cur += 0x48;\n dataLength--;\n data[i] = cur;\n }\n } else {\n for (int i = data.length - 1; i >= 0; i--) {\n byte cur = data[i];\n cur = BitTools.rollLeft(cur, 4);\n cur += dataLength;\n cur ^= remember;\n remember = cur;\n cur ^= 0x13;\n cur = BitTools.rollRight(cur, 3);\n dataLength--;\n data[i] = cur;\n }\n }\n //System.out.println(\"enc after iteration \" + j + \": \" + HexTool.toString(data) + \" al: \" + al);\n }\n return data;\n }", "static void saveAllPlayersToFiles(){\n \tfor( String playername : GoreaProtect.playersData.getKeys(false))\n \t{\n \t\tFile playerfile = new File(GoreaProtect.datafolder + File.separator + \"Protections\");\n \t\tFile fileplayer= new File(playerfile, playername + \".yml\");\n\n \t\tConfigurationSection playerdata = GoreaProtect.playersData.getConfigurationSection(playername);\n\n \t\tYamlConfiguration PlayersDatayml = new YamlConfiguration();\n\n \t\tfor (String aaa:playerdata.getKeys(false))\n \t\tPlayersDatayml.set(aaa, playerdata.get(aaa));\n \t\t\n \t\t\n \t\ttry {\n\t\t\t\tPlayersDatayml.save(fileplayer);\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} \n }", "void decryption(String file)\n {\n try\n {\n fdec=new DataOutputStream(new FileOutputStream(\"dec.txt\"));\n fenc1=new FileInputStream(file);\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n try\n {\n size=fenc1.available();\n np=0;\n p=size%8;\n if(p!=0)\n np=8-p;\n size+=np;\n if(p==0)\n nl=size/8;\n else\n nl=size/8+1;\n buf1=new byte[size+10];\n buf=new byte[8];\n fenc1.read(buf1);\n mark=-8;\n int arr[]=new int [8];\n for(k1=0;k1<nl;k1++)\n {\n mark+=8;\n for(int k2=0;k2<8;k2++)\n buf[k2]=buf1[mark+k2];\n for(int k2=0;k2<8;k2++)\n\t {\n\t arr[k2]=0;\n\t if(buf[k2]>=0)\n\t arr[k2]=buf[k2];\n\t else\n\t arr[k2]=buf[k2]+256;\n }\n\t j1=0;i1=0;\n while( i1<=3)\n\t\t {\n\t\t if((j1+1)%2==0)\n\t {\n x[i1]|=arr[j1]; // dividing 64 bit cypher block into four 16 bit registers\n\t i1++;\n\t\t }\n\t else\n\t {\n\t \t x[i1]=arr[j1];\n\t x[i1]<<=8;\n\t }\n\t j1++;\n\t }\n for(int t=0;t<4;t++)\n {\n\t ft1 =x[t]&255;\n\t ft=x[t]>>8;\n\t }\n step1=mul( x[0] , minverse( z[48] ));\n step2=( x[1] + ainverse( z[49] )) % 65536;\n step3=( x[2] + ainverse( z[50] )) % 65536;\n step4=mul( x[3] , minverse( z[51] ));\n step5=step1^step3;\n step6=step2^step4;\n step7=mul(step5,z[46]);\n step8=(step6+step7)%65536;\n step9=mul(step8,z[47]);\n step10=(step7+step9)%65536;\n step11=step1^step9;\n step12=step3^step9;\n step13=step2^step10;\n step14=step4^step10;\n x[0]=step11;\n x[1]=step12;\n x[2]=step13;\n x[3]=step14;\n// 2nd round\n\tint j2=40;\n\t\tfor(j1=1;j1<=7;j1++)\n \t\t {\n step1=mul( x[0] , minverse( z[j2+2] ));\n step2=( x[1] + ainverse( z[j2+4] )) % 65536;\n step3=( x[2] + ainverse( z[j2+3] )) % 65536;\n t=step2;\n step2=step3;\n step3=t;\n step4=mul( x[3] , minverse( z[j2+5] ));\n step5=step1^step3;\n step6=step2^step4;\n step7=mul(step5,z[j2+0]);\n step8=(step6+step7)%65536;\n step9=mul(step8,z[j2+1]);\n step10=(step7+step9)%65536;\n step11=step1^step9;\n step12=step3^step9;\n step13=step2^step10;\n step14=step4^step10;\n x[0]=step11;\n x[1]=step12;\n x[2]=step13;\n x[3]=step14;\n j2=j2-6;\n }\n x[0]=mul(x[0],minverse(z[0]));\n x[1]=(x[1]+ainverse(z[2]))%65536;\n x[2]=(x[2]+ainverse(z[1]))%65536;\n x[3]=mul(x[3],minverse(z[3]));\n t=x[1];\n x[1]=x[2];\n x[2]=t;\n\t for(int t=0;t<4;t++)\n {\n\t ft1 =x[t]&255;\n\t ft=x[t]>>8;\n\t fdec.write((char)ft);\n\t fdec.write((char)ft1);\n\t }\n }\n\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n }", "private boolean replaceSecretWith(String user, String newSecret) {\n\n//\nSystem.out.println();\t\nSystem.out.println();\t\nSystem.out.println();\t\tSystem.out.println(\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\");\nSystem.out.println(\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\");\nSystem.out.println(\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\");\n\t\tSystem.out.println(\"WRITING TO FILE\");\n\t\tSystem.out.println(\"encryptedSecret = \"+newSecret);\n\t\tSystem.out.println(\"-------------------\");\n\t\tSystem.out.println(\"encryptedSecret in bytes:\");\t\t\n\t\tComMethods.charByChar(newSecret.getBytes(), true);\nSystem.out.println(\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\");\nSystem.out.println(\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\");\nSystem.out.println(\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\");\nSystem.out.println();\nSystem.out.println();\nSystem.out.println();\n//\n\t\ttry {\n\t\t\tFile oldFile = new File(secretsfn);\n\n\t\t\tif (!oldFile.isFile()) {\n\t\t\t\tSystem.out.println(\"ERROR ~~ \"+secretsfn+\" is not the name of an existing file.\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Build up new secrets file in a temp file, will rename later\n\t\t\tFile newFile = File.createTempFile(\"secretstmp\", \"\");\n\t\t\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(oldFile));\n\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(newFile));\n\n//\n\t\t\tSystem.out.println(\"User is \"+user+\".\");\n//\n\t\t\tString l;\n\t\t\twhile (null != (l = br.readLine())) {\n\t\t\t\tbw.write(String.format(\"%s%n\", l));\n//\n\t\t\t\tSystem.out.println(\"Wrote line \"+l+\" to newFile.\");\n//\n\t\t\t\tif (l.equals(user)) {\n\t\t\t\t\tl = br.readLine();\n\t\t\t\t\tbw.write(String.format(\"%s%n\", newSecret));\n//\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Condition Triggered: l.equals(user).\");\n\t\t\t\t\tSystem.out.println(\"Wrote \"+newSecret+\" to newFile.\");\n//\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\t\t\tbw.close();\n\n\t\t\t// Delete original file\n\t\t\tif (!oldFile.delete()) {\n\t\t\t\tSystem.out.println(\"Could not delete file.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// Rename temp file to name of original file\n\t\t\tif (!newFile.renameTo(oldFile)) {\n\t\t\t\t// Still a success, but change filename temporarily\n\t\t\t\tSystem.out.println(\"WARNING ~ Could not rename file.\");\n\t\t\t\tSystem.out.println(\"WARNING ~ Secret file temporarily named: \\\"\"+newFile.getName()+\"\\\".\");\n\t\t\t\tsecretsfn = newFile.getName(); \n\t\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\treturn true;\n\t}", "public byte[] encriptarArchivo (String nombreArchivo, String key, String ruta) throws Exception{\n\n \n FileInputStream fileInputStream = null;\n byte[] encrypted = null;\n File file = new File(nombreArchivo);\n byte[] archivo = new byte[(int) file.length()];\n\n //Convertir archivo a bytes[]\n fileInputStream = new FileInputStream(file);\n fileInputStream.read(archivo);\n //llamada a libreria de encriptacion\n encrypted = encrypt(archivo, key);\n Path archivo_enc = Paths.get(ruta);\n //Creacion de archivo encriptado \n Files.write(archivo_enc, encrypted);\n \n return encrypted;\n \n }", "public interface IFileCrypter\n{\n\tpublic void encrypt( int pPartNumber , byte[] pData , int pOffset , int pLength );\n\t\n\tpublic void decrypt( int pPartNumber , byte[] pData , int pOffset , int pLength );\n}", "private void blockEncrypt (byte[] in, int off, byte[] out, int outOff) {\n int L = (in[off++] & 0xFF) << 24 |\n (in[off++] & 0xFF) << 16 |\n (in[off++] & 0xFF) << 8 |\n in[off++] & 0xFF;\n int R = (in[off++] & 0xFF) << 24 |\n (in[off++] & 0xFF) << 16 |\n (in[off++] & 0xFF) << 8 |\n in[off ] & 0xFF;\n int a;\n\n for (int i = 0; i < ROUNDS;) { // encrypt with the 16 subkeys\n a = R ^ sKey[i++];\n L ^= P[S[ a & 0xFFF] & 0xFF] |\n P[S[(a >>> 8) & 0xFFF] & 0xFF] << 1 |\n P[S[(a >>> 16) & 0xFFF] & 0xFF] << 2 |\n P[S[(a >>> 24 | a << 8) & 0xFFF] & 0xFF] << 3;\n\n a = L ^ sKey[i++];\n R ^= P[S[ a & 0xFFF] & 0xFF] |\n P[S[(a >>> 8) & 0xFFF] & 0xFF] << 1 |\n P[S[(a >>> 16) & 0xFFF] & 0xFF] << 2 |\n P[S[(a >>> 24 | a << 8) & 0xFFF] & 0xFF] << 3;\n }\n out[outOff++] = (byte)(R >>> 24);\n out[outOff++] = (byte)(R >>> 16);\n out[outOff++] = (byte)(R >>> 8);\n out[outOff++] = (byte) R;\n out[outOff++] = (byte)(L >>> 24);\n out[outOff++] = (byte)(L >>> 16);\n out[outOff++] = (byte)(L >>> 8);\n out[outOff ] = (byte) L;\n }", "private static void keyPairGenerator() throws NoSuchAlgorithmException, IOException {\n KeyPairGenerator kpg = KeyPairGenerator.getInstance(\"RSA\");\n kpg.initialize(2048);\n KeyPair keyPair = kpg.generateKeyPair();\n\n //Get public and private keys\n Key publicKey = keyPair.getPublic();\n Key privateKey = keyPair.getPrivate();\n\n String outFile = files_path + \"/Client_public\";\n PrintStream out = null;\n out = new PrintStream(new FileOutputStream(outFile + \".key\"));\n out.write(publicKey.getEncoded());\n out.close();\n\n outFile = files_path + \"/Client_private\";\n out = new PrintStream(new FileOutputStream(outFile + \".key\"));\n out.write(privateKey.getEncoded());\n out.close();\n\n System.err.println(\"Private key format: \" + privateKey.getFormat());\n // prints \"Private key format: PKCS#8\" on my machine\n\n System.err.println(\"Public key format: \" + publicKey.getFormat());\n // prints \"Public key format: X.509\" on my machine\n\n }", "public String save(){\r\n StringBuilder saveString = new StringBuilder(\"\");\r\n //currentPlayer, numPlayer, players[], \r\n saveString.append(currentPlayer + \" \");\r\n saveString.append(numPlayers + \" \");\r\n \r\n int i = 0;\r\n while(i < numPlayers){\r\n saveString.append(playerToString(players[i]) + \" \");\r\n i = i + 1;\r\n }\r\n\t\t\r\n\t\t//encrypt saveString\r\n\t\tString result = encryptSave(saveString.toString());\r\n \r\n return result;\r\n }", "public static byte[] encryptText(String plainText,SecretKey secKey) throws Exception{\n\r\n Cipher aesCipher = Cipher.getInstance(\"AES\");\r\n\r\n aesCipher.init(Cipher.ENCRYPT_MODE, secKey);\r\n\r\n byte[] byteCipherText = aesCipher.doFinal(plainText.getBytes());\r\n\r\n return byteCipherText;\r\n\r\n}", "protected int writeEncrypted()\n throws IOException\n {\n int cb = f_delegate.write(f_buffEncOut);\n\n if (!f_buffEncOut.hasRemaining())\n {\n endProtocol();\n }\n return cb;\n }", "public void jiemi(String pathin, String pathout) {\n\t\ttry {\n\t\t\tRuntime.getRuntime().exec(new String[]{\"openssl\",\"enc\", \"-d\",\"-aes-128-cbc\", \"-in\",pathin,\"-out\",pathout,\"-k\",\"123abc\"});\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\tSystem.out.println(\"-------------------jiemi end------------------------\");\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "private void generateBack() {\n\t\tCharacter[] encodeChar = (Character[]) map.values().toArray(new Character[map.size()]);\n\t\tCharacter[] trueChar = (Character[]) map.keySet().toArray(new Character[map.size()]);\n\n\t\tString allencode = \"\";\n\t\tString allTrue = \"\";\n\n\t\tfor (int i = 0; i < encodeChar.length; i++) {\n\t\t\tallencode += encodeChar[i];\n\t\t\tallTrue += trueChar[i];\n\t\t}\n\n\t\tString code = \"import java.util.HashMap;\\n\" + \"import java.util.Map;\\n\" + \"import java.util.Scanner;\\n\"\n\t\t\t\t+ \"public class MyKey {\\n\"\n\t\t\t\t+ \"private static Map<Character, Character> map = new HashMap<Character, Character>();\\n\"\n\t\t\t\t+ \"private static char[] encodeChar = \\\"\" + allencode + \"\\\".toCharArray();\\n\"\n\t\t\t\t+ \"private static char[] trueChar = \\\"\" + allTrue + \"\\\".toCharArray();\\n\"\n\t\t\t\t+ \"private static void mapSetUp() {\\n\" + \"for (int i = 0; i < encodeChar.length; i++) {\\n\"\n\t\t\t\t+ \"map.put(encodeChar[i], trueChar[i]);\\n\" + \"}\\n\" + \"}\\n\"\n\t\t\t\t+ \"private static String decodeMessage(String message) {\\n\" + \"String decode = \\\"\\\";\\n\"\n\t\t\t\t+ \"for (int i = 0; i < message.length(); i++) {\\n\" + \"decode += map.get(message.charAt(i));\\n\" + \"}\\n\"\n\t\t\t\t+ \"return decode;\\n\" + \"}\\n\" + \"public static void main(String[] args){\\n\"\n\t\t\t\t+ \"Scanner sc = new Scanner(System.in);\\n\" + \"System.out.print(\\\"Input your encrypted message : \\\");\"\n\t\t\t\t+ \"String enMessage = sc.nextLine();\" + \"mapSetUp();\\n\"\n\t\t\t\t+ \"System.out.println(\\\"Decrypted message : \\\"+decodeMessage(enMessage));\\n\" + \"}}\";\n\t\tFile f = new File(\"MyKey.java\");\n\t\ttry {\n\t\t\tFileWriter fw = new FileWriter(f);\n\t\t\tBufferedWriter bf = new BufferedWriter(fw);\n\t\t\tbf.write(code);\n\t\t\tbf.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error about IO.\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public static void main(String[] args) throws Exception{\n Key chave;\r\n //Ler a chave do arquivo Chave.key\r\n ObjectInputStream in = \r\n new ObjectInputStream(new FileInputStream(\"Chave.key\"));\r\n chave = (Key)in.readObject();\r\n in.close(); \r\n //Definir qual cifra será usada (DES)\r\n Cipher cipher = Cipher.getInstance(\"DES/ECB/PKCS5Padding\");\r\n cipher.init(Cipher.ENCRYPT_MODE, chave);\r\n \r\n System.out.println(\"Digite uma mensagem a ser cifrada: \");\r\n String mensagem = new java.util.Scanner(System.in).nextLine();\r\n \r\n byte[] bytesMensagem = mensagem.getBytes(\"UTF8\");\r\n \r\n byte[] dadosCifrados = cipher.doFinal(bytesMensagem);\r\n \r\n System.out.println(new String(dadosCifrados));\r\n }", "public boolean encrypt(FileInputStream inputStream, FileOutputStream destinationStream) throws IOException {\r\n\t\tint read;\r\n\t\tCipherInputStream cis = null;\r\n\t\ttry {\r\n\t\t\tCipher encipher = Cipher.getInstance(\"AES\");\r\n\t\t\tencipher.init(Cipher.ENCRYPT_MODE, simmetricKey);\r\n\t\t\tcis = new CipherInputStream(inputStream, encipher);\r\n\t\t\t// Reads until reaches end of file\r\n\t\t\tsynchronized (cis) {\r\n\t\t\t\twhile ((read = cis.read()) != -1) {\r\n\t\t\t\t\tdestinationStream.write((char) read);\r\n\t\t\t\t\t//destinationStream.flush(); it bugs everything,cipher calls it automatic\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (IOException | NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tThread.sleep(500);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tif (cis != null) {\r\n\t\t\t\tcis.close();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static void main(String[] args){\n\n String mode = \"enc\";\n String data = \"\";\n String out = \"\";\n String path;\n String alg = \"unicode\";\n int key = 0;\n\n try {\n for (int i = 0; i < args.length; i++) {\n if (args[i].equals(\"-data\") || args[i].equals(\"-in\")) {\n data = args[i + 1];\n }\n if (args[i].equals(\"-mode\")) {\n mode = args[i + 1];\n }\n if (args[i].equals(\"-key\")) {\n key = Integer.parseInt(args[i + 1]);\n }\n if (args[i].equals(\"-out\")) {\n out = args[i + 1];\n }\n if (args[i].equals(\"-alg\")) {\n alg = args[i + 1];\n }\n }\n } catch (ArrayIndexOutOfBoundsException e) {\n System.out.println(\"Missing option\");\n }\n\n File file = new File(data);\n\n if (file.exists() && !file.isDirectory()) {\n path = data;\n\n switch (mode){\n case \"enc\":\n EncryptionContext encryptionContext = new EncryptionContext();\n if(alg.equals(\"shift\")) {\n encryptionContext.setMethod(new ShiftEncryptionMethod());\n } else {\n encryptionContext.setMethod(new UnicodeTableEncryptionMethod());\n }\n data = encryptionContext.encryptFromFile(path, key);\n break;\n\n case \"dec\":\n DecryptionContext decryptionContext = new DecryptionContext();\n if(alg.equals(\"shift\")) {\n decryptionContext.setMethod(new ShiftDecryptionMethod());\n } else {\n decryptionContext.setMethod(new UnicodeTableDecryptionMethod());\n }\n data = decryptionContext.decryptFromFile(path,key);\n break;\n }\n\n } else {\n switch (mode){\n case \"enc\":\n EncryptionContext encryptionContext = new EncryptionContext();\n if(alg.equals(\"shift\")) {\n encryptionContext.setMethod(new ShiftEncryptionMethod());\n } else {\n encryptionContext.setMethod(new UnicodeTableEncryptionMethod());\n }\n data = encryptionContext.encrypt(key, data);\n break;\n\n case \"dec\":\n DecryptionContext decryptionContext = new DecryptionContext();\n if(alg.equals(\"shift\")) {\n decryptionContext.setMethod(new ShiftDecryptionMethod());\n } else {\n decryptionContext.setMethod(new UnicodeTableDecryptionMethod());\n }\n data = decryptionContext.decrypt(key, data);\n break;\n }\n }\n\n if (out.isEmpty()) {\n System.out.println(data);\n } else {\n writeIntoFile(out, data);\n }\n\n }", "public String encrypt(String geheimtext);", "static void encryptCTR(String filename, String key, String counter) {\n try {\n Scanner s = new Scanner(new File(filename + EXT), \"UTF-8\");\n File newFile = new File(filename + \"_CTR\" + EXT);\n newFile.delete();\n newFile.createNewFile();\n PrintWriter w = new PrintWriter(newFile);\n processHeader(s, w);\n BigInteger b = new BigInteger(counter, 16);\n while (s.hasNext()) {\n readBlock(s);\n String n = b.toString(16).toUpperCase();\n if (n.length() < 32) {\n for (int i = n.length(); i < 32; i++) {\n n = \"0\" + n;\n }\n } else if (n.length() > 32) {\n n = n.substring(0, 32);\n }\n cipherBlock = stateToBits(AES.encrypt(n, key));\n block = xor(block, cipherBlock);\n writeBlock(w);\n b.add(new BigInteger(\"1\"));\n }\n w.flush();\n w.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void readDataFromFile(View view) throws GeneralSecurityException, IOException {\n encryptedFile = new EncryptedFile.Builder(\n context,\n new File(MainActivity.this.getFilesDir(),\"test.txt\"), // File want to read\n mainKey, // Master key for encryption\n EncryptedFile.FileEncryptionScheme.AES256_GCM_HKDF_4KB) // Algorithm or FileEncryptionScheme for encryption\n .build();\n\n\n InputStream inputStream = encryptedFile.openFileInput(); // Open the encrypted file to read\n int next = inputStream.read(); // Read the encrypted file\n\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); // ByteArrayOutputStream to print the content of file to read\n\n while (next != -1){\n byteArrayOutputStream.write(next); // Write the file content in byteArrayOutputStream object\n next = inputStream.read(); // Read the next character until it encounter the end (-1)\n }\n\n byte[] plainText = byteArrayOutputStream.toByteArray(); // Convert into byte array\n\n String textString = new String(plainText); // Create a new string with converted plain text byte array\n\n textView.setText(textString); // display the file content in textView\n }", "@Override\n\tpublic void encryptXml(File xmlDocument, File jks, String nazivCert) throws IOException {\n\t\tSecurity.addProvider(new BouncyCastleProvider());\n\t\torg.apache.xml.security.Init.init();\n\n\t\tDocument doc = loadDocument(xmlDocument.getCanonicalPath());\n\t\t// generise tajni kljuc\n\n\t\tSecretKey secretKey = generateDataEncryptionKey();\n\t\t// ucitava sertifikat za kriptovanje tajnog kljuca\n\t\tCertificate cert = readCertificate(jks.getCanonicalPath(), nazivCert);\n\t\t// kriptuje se dokument\n\n\t\tdoc = encrypt(doc, secretKey, cert);\n\t\t// snima se tajni kljuc\n\t\t// snima se dokument\n\t\tsaveDocument(doc, xmlDocument.getCanonicalPath());\n\n\t}", "public byte[] packAllData1(byte[] data) {\n byte[] message = null;\n try{\n //CRC\n int crc16 = alisa.CRC.crc16(data, 0, data.length);\n byte hi = (byte)((crc16 >> 8) & 0xff);\n byte lo = (byte)(crc16 & 0xff);\n\n //crcData <- data + [hi][lo]\n byte[] crcData = new byte[data.length + 2];\n System.arraycopy(data, 0, crcData, 0, data.length);\n crcData[crcData.length-2] = hi;\n crcData[crcData.length-1] = lo;\n System.out.println(\"File-\" + this._id + \": key length = \" +this._key.length);\n byte[] secret = new Encode().encrypt(crcData, this._key);\n\n //check, can the encoded data be decode and crc?. before send it to server\n byte[] decode = new Encode().decrypt(secret, this._key);\n if(alisa.CRC.crc16(decode, 0, decode.length) != 0){\n System.out.println(\"File-\" + this._id + \": Wrong Encoding data!!\");\n return packAllData1(data);\n }\n\n System.out.println(\"File-\" + this._id + \": Password = \" +this._password + \"\\n\" + \"File-\" + this._id + \": Hash = \" + new String(this._key, \"ISO-8859-1\"));\n // //---------show crc data------------------------\n // String show2 = \"\";\n // for(int i =0; i < crcData.length; i++){\n // show2 += (int)crcData[i] + \" \";\n // }\n // System.out.println(\"File-\" + this._id + \" crcData: \" + show2);\n // //------------------------------------------\n // //---------show encnrypted data-----------------\n // String show3 = \"\";\n // for(int i =0; i < secret.length; i++){\n // show3 += (int)secret[i] + \" \";\n // }\n // System.out.println(\"File-\" + this._id + \" secret(no header): \" + show3);\n // //------------------------------------------\n // //---------show decnrypted data-----------------\n // String show4 = \"\";\n // for(int i =0; i < decode.length; i++){\n // show4 += (int)decode[i] + \" \";\n // }\n // System.out.println(\"File-\" + this._id + \" decodeed secret: \" + show4);\n // //------------------------------------------\n\n message = new byte[secret.length + 4];\n System.arraycopy(secret, 0, message, 3, secret.length);\n message[0] = (byte)255;\n message[1] = (byte)((this._id >> 8) & 0xff);\n message[2] = (byte)(this._id & 0xff);\n message[message.length-1] = (byte)254;\n }catch(Exception e){\n System.out.println(\"File-\" + this._id + \": packAllData Error\");\n try { Thread.sleep(this._interval); } catch (InterruptedException ex) { }\n return packAllData1(data);\n }\n return message;\n }", "public VCipher(String keyword, String fileName, boolean actionB)\n\t{\n\t\talphabet = new char [SIZE];\n\t\tfor (int i = 0; i < SIZE; i++) \n\t\t{\n\t\t\talphabet[i] = (char)('A' + i);\n\t\t}\n\t\tStringBuilder keybuilder = new StringBuilder(keyword);\t\t\n\t\tint k = (int)keybuilder.length();\n\t\tcipher = new char [k][SIZE];\n\t\tfor (int i=0;i<k;i++)\n\t\t{\n\t\t\tint j=0;\n\t\t\tcipher[i][j] = keybuilder.charAt(i);\n\t\t\tint position = Character.getNumericValue(keybuilder.charAt(i))-9;\n\t\t\tint t =SIZE - position;\n\t\t\tfor (j=1;j<=t;j++)\n\t\t\t{\n\t\t\t\tcipher[i][j] = alphabet[position];\n\t\t\t\tposition ++;\n\t\t\t}\n\t\t\tposition=0;\n\t\t\tfor(j=t+1;j<SIZE;j++)\n\t\t\t{\n\t\t\t\tcipher[i][j] = alphabet[position];\n\t\t\t\tposition ++;\n\t\t\t}\n\t\t}\n\t\tString inFile = fileName+\".txt\";\n\t\tString outFile = this.fileProcessVigenere(fileName, actionB);\n\t\ttry{\t\n\t\t\tFileReader reader = new FileReader(inFile);\n\t\t\tFileWriter writer = new FileWriter(outFile);\n\t\t\tScanner in = new Scanner(reader);\n\t\t\twhile (in.hasNextLine()) {\n\t\t\t\tStringBuilder line = new StringBuilder(in.nextLine());\n\t\t\t\t//System.err.println(\"\\n\"+line+\"\\nCIBE JMGRI XNQJICBVKW\");\n\t\t\t\tint b=0;\n\t\t\t\tchar chr;\n\t\t\t\tint p=0;\n\t\t\t\twhile (b < line.length()) {\n\t\t\t\t\tif (p==k)\n\t\t\t\t\t{\n\t\t\t\t\t\tp=0;\n\t\t\t\t\t}\n\t\t\t\t\tif ((chr = line.charAt(b)) >= 'A' && (chr = line.charAt(b)) <= 'Z') \n\t\t\t\t\t{\n\t\t\t\t\t\tif (actionB==false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchar temp = this.encode(chr,p);\n\t\t\t\t\t\t\twriter.write(temp);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\twriter.write(this.decode(chr,p));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tp +=1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\twriter.write(line.charAt(b));\n\t\t\t\t\t}\n\t\t\t\t\tb +=1;\n\t\t\t\t}\n\t\t\t\twriter.write(\"\\r\\n\");\n\t\t\t}\n\t\t\t\treader.close();\n\t\t\t\twriter.close();\n\t\t\t\tnew LetterFrequencies(outFile);\n\t\t\t}\n\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\tSystem.err.println(\"File not Found\");\n\t\t\t}\n\t}", "public String SAVE(String filename){\n try{\n //File will be rewritten\n BufferedWriter writer = new BufferedWriter(new FileWriter(filename, false));\n Enumeration keys = this.clientData.keys();\n while(keys.hasMoreElements()){\n String keyToAppend = (String) keys.nextElement();\n writer.append(keyToAppend + \",\" + this.clientData.get(keyToAppend) + '\\n');\n }\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n return \"ERROR CANNOT WRITE TO THE FILE\";\n }\n return \"OK\";\n }", "public void saveData() throws InterruptedException{\n\t\ttry{\n\t\t\tPrintWriter saver = new PrintWriter(this.loadFile);\n\t\t\tQueue<String> q = this.typos.keys();\n\t\t\tCorrection c;\n\t\t\twhile(!q.isEmpty()){\n\t\t\t\tc = this.typos.get(q.dequeue());\n\t\t\t\tsaver.println(c.toString());\n\t\t\t}saver.close();\n\t\t}catch(FileNotFoundException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public int encrypt(int clock){\n clock = clock * 10;\n try {\n os_obj = socket_obj.getOutputStream();\n osw_obj = new OutputStreamWriter(os_obj);\n bw_obj = new BufferedWriter(osw_obj);\n\n int message = clock;\n bw_obj.write(message);\n bw_obj.flush();\n\n }\n\n catch(Exception e)\n {\n e.printStackTrace();\n }\n\n\n return 0;\n }", "public void Write_data() {\n // add-write text into file\n try {\n FileOutputStream fileout=openFileOutput(\"savedata11.txt\", MODE_PRIVATE);\n OutputStreamWriter outputWriter=new OutputStreamWriter(fileout);\n outputWriter.write(Integer.toString(_cnt));\n outputWriter.close();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public interface CryptoService {\n /**\n * Read encrypted password file.\n *\n * @param file Encrypted file instance.\n * @param password Password to decrypt file.\n *\n * @return file content.\n *\n * */\n String readFile(File file, String password);\n\n /**\n * Write and encrypt content to file.\n *\n * @param file encrypted file location.\n * @param password password which will be used to encrypt file.\n * @param cnt file content.\n * */\n void writeFile(File file, String password, String cnt);\n\n /**\n * Encrypt content\n *\n * @param password password which will be used to encrypt file.\n * @param textToEncrypt text which will be encrypted\n * @return encrypted content\n * */\n String encrypt(String password, String textToEncrypt);\n\n /**\n * Decrypt content\n *\n * @param password password which will be used to encrypt file.\n * @param textToDecrypt text which will be decrypted\n * @return decrypted content\n * */\n String decrypt(String password, String textToDecrypt);\n\n /**\n * Write and encrypt the password database.\n *\n * @param passwordDatabase passwords database which will be saved to encrypted file.\n * */\n void writeFile(PasswordDatabase passwordDatabase) throws JsonConversionException;\n}", "public void encrypt(byte[] vanillaInformation){\n SecretKey symmetricKey = getSymmetricEncryption().createSecretKey();\n getSymmetricEncryption().encrypt(symmetricKey, vanillaInformation);\n setEncryptedInformation(getSymmetricEncryption().getEncryptedInformation());\n\n //encrypt symmetric key with user public key\n try {\n Cipher symmetricKeyEncryption = Cipher.getInstance(\"RSA\");\n symmetricKeyEncryption.init(Cipher.ENCRYPT_MODE, getPublicKey());\n setEncryptedSymmetricKey(symmetricKeyEncryption.doFinal(symmetricKey.getEncoded()));\n } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {\n e.printStackTrace();\n }\n }", "public String encrypt(final PublicKeyInterface key, final String data)\n {\n return this.encryptionCipher().encrypt(key, data);\n }", "public void writeToFile(List<Float> x, List<Float> y, List<Float> z, List<Float> x_g, List<Float> y_g, List<Float> z_g, int minVal) {\n File file = new File(PATH + \"/data.txt\");\n //File acc_file = new File(PATH + \"/accData.txt\");\n //File gyro_file = new File(PATH + \"/gyroData.txt\");\n FileOutputStream fOut = null;\n //FileOutputStream accfOut = null;\n //FileOutputStream gyrofOut = null;\n\n try {\n fOut = new FileOutputStream(file, true);\n //accfOut = new FileOutputStream(acc_file, true);\n //gyrofOut = new FileOutputStream(gyro_file, true);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n for(int i=0; i<minVal; i++){\n String x_acc= Float.toString(x.get(i));\n String y_acc= Float.toString(y.get(i));\n String z_acc= Float.toString(z.get(i));\n\n String x_gyro = Float.toString(x_g.get(i));\n String y_gyro = Float.toString(y_g.get(i));\n String z_gyro = Float.toString(z_g.get(i));\n try {\n fOut.write((x_acc+\",\").getBytes());\n fOut.write((y_acc+\",\").getBytes());\n fOut.write((z_acc+\",\").getBytes());\n fOut.write((x_gyro+\",\").getBytes());\n fOut.write((y_gyro+\",\").getBytes());\n fOut.write((z_gyro+\",\").getBytes());\n fOut.write((subject+\",\").getBytes());\n fOut.write((activity_label+\"\\n\").getBytes());\n\n Log.d(\"Data\", \"Data Written\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n try {\n fOut.close();\n //accfOut.close();\n //gyrofOut.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void writeIDfile(String ID,String password)throws IOException\n {\n\n\n List<String> lines = Files.readAllLines(Paths.get(\"idpassword.txt\"));\n /*write part*/\n\n BufferedWriter bw = null;\n FileWriter fw = null;\n try {\n int j=0;\n String content = \"\";\n while (j<lines.size())\n {\n content+= lines.get(j)+\"\\n\";\n j++;\n }\n content+=ID+\",\"+password;\n\n fw = new FileWriter(\"idpassword.txt\");\n bw = new BufferedWriter(fw);\n bw.write(content);\n\n bw.close();\n fw.close();\n\n } catch (IOException e) {\n\n e.printStackTrace();\n\n } finally {\n\n try {\n\n if (bw != null)\n bw.close();\n\n if (fw != null)\n fw.close();\n\n } catch (IOException ex) {\n\n ex.printStackTrace();\n\n }\n\n }\n }", "private static String encrypt(String in){\n\n\t String alphabet = \"1234567890\";\n\n\t String scramble1 = \"<;\\'_$,.?:|)\";\n\t String scramble2 = \"XYZVKJUTHM\";\n\t String scramble3 = \"tuvwxyz&*}\";\n\t String scramble4 = \"~!-+=<>%@#\";\n\t String scramble5 = \"PUDHCKSXWZ\";\n\n\t char messageIn[] = in.toCharArray();\n\t String r = \"\";\n\n\t for(int i = 0; i < in.length(); i++){\n\n\t int letterIndex = alphabet.indexOf(in.charAt(i));\n\n\t if(i % 3 == 0){\n\t r += scramble1.charAt(letterIndex);\n\t }else if (i % 3 == 1){\n\t \tr += scramble2.charAt(letterIndex);\n\t }else if(i % 3 == 2){\n\t \tr += scramble3.charAt(letterIndex);\n\t }\n\t }\n\t\t\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------\");\n\t\t\t\tSystem.out.println(\" Encoded Message: \" + r);\n\t\t\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------\\n\\n\");\n\t\treturn r;\n\t}", "private static void storingTheObjectToDisk1(InputStream objectContent, String key) {\n FileOutputStream fos = null;\n BufferedOutputStream bos = null;\n byte[] buff = new byte[50*1024];\n int count;\n try {\n bos = new BufferedOutputStream(new FileOutputStream(\"/home/ubuntu/\" + key));\n while( (count = objectContent.read(buff)) != -1)\n {\n bos.write(buff, 0, count);\n }\n bos.close();\n objectContent.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void saveData(int argLowAlpha, int argHighAlpha, int argLowBeta, int argHighBeta, int argLowGamma, int argMidGamma, int argDelta, int argTheta) {\n\n try {\n File sdCard = Environment.getExternalStorageDirectory();\n File dir = new File(sdCard.getAbsolutePath() + \"/cerebro_files/\");\n dir.mkdirs();\n\n if (fileCountFlag == 0) {\n File[] files = dir.listFiles();\n int numberOfFiles = files.length;\n String index = new Integer(numberOfFiles + 1).toString();\n Toast.makeText(getApplicationContext(), \"Number of files is: \"+index, Toast.LENGTH_SHORT).show();\n filename = \"file\" + index + \".csv\";\n fileCountFlag = 1;\n }\n\n //File file = new File(dir, \"filename1.csv\"+index);\n File file = new File(dir, filename);\n //Toast.makeText(getApplicationContext(), \"init file\",Toast.LENGTH_SHORT).show();\n\n FileOutputStream f = new FileOutputStream(file, true);\n\n //Toast.makeText(getApplicationContext(), \"got output stream\",Toast.LENGTH_SHORT).show();\n\n //String strLowAlpha = new Integer(lowAlpha).toString();\n String strHighAlpha = new Integer(argHighAlpha).toString();\n String strLowBeta = new Integer(argLowBeta).toString();\n String strHighBeta = new Integer(argHighBeta).toString();\n String strLowGamma = new Integer(argLowGamma).toString();\n String strMidGamma = new Integer(argMidGamma).toString();\n String strDelta = new Integer(argDelta).toString();\n String strTheta = new Integer(argTheta).toString();\n\n //string1 = string1 + \"\\n\";\n\n String strCSV = new Integer(argLowAlpha).toString();\n\n strCSV = strCSV+','+strHighAlpha+','+strLowBeta+','+strHighBeta+','+strLowGamma+','+strMidGamma+','+strDelta+','+strTheta+'\\n';\n\n //f.write(string.getBytes());\n //bf.write(passData.getBytes());\n f.write(strCSV.getBytes());\n //Toast.makeText(getApplicationContext(), \"Done writing\",Toast.LENGTH_SHORT).show();\n f.close();\n //Toast.makeText(getApplicationContext(), \"File buffer closed\",Toast.LENGTH_SHORT).show();\n } catch (Exception e) {\n e.printStackTrace();\n Toast.makeText(getApplicationContext(), \"failed to write\",Toast.LENGTH_SHORT).show();\n }\n }", "void encryptText() {\n\n ArrayList<Character> punctuation = new ArrayList<>(\n Arrays.asList('\\'', ':', ',', '-', '-', '.', '!', '(', ')', '?', '\\\"', ';'));\n\n for (int i = 0; i < text.length(); ++i) {\n\n if (punctuation.contains(this.text.charAt(i))) {\n\n // only remove punctuation if not ? or . at the very end\n if (!((i == text.length() - 1) && (this.text.charAt(i) == '?' || this.text.charAt(i) == '.'))) {\n this.text.deleteCharAt(i);\n\n // go back to previous position since current char was deleted,\n // meaning the length of the string is now 1 less than before\n --i;\n }\n }\n }\n \n \n // Step 2: convert phrase to lowerCase\n\n this.setText(new StringBuilder(this.text.toString().toLowerCase()));\n\n \n // Step 3: split the phrase up into words and encrypt each word separately using secret key\n\n ArrayList<String> words = new ArrayList<>(Arrays.asList(this.text.toString().split(\" \")));\n\n \n // Step 3.1:\n\n ArrayList<Character> vowels = new ArrayList<>(Arrays.asList('a', 'e', 'i', 'o', 'u'));\n\n for (int i = 0; i < words.size(); ++i) {\n\n // if first char is vowel, add y1x3x4 to the end of word\n if (vowels.contains(words.get(i).charAt(0))) \n words.set(i, words.get(i).substring(0, words.get(i).length()) + this.secretKey.substring(3, 6));\n\n // otherwise, move first char to end of the word, then add x1x2 to the end of word\n else \n words.set(i, words.get(i).substring(1, words.get(i).length()) + words.get(i).charAt(0) + this.secretKey.substring(0, 2));\n }\n\n StringBuilder temp = new StringBuilder(\"\");\n\n for (String word : words)\n temp.append(word + \" \");\n\n this.setText(temp);\n\n \n // Step 3.2:\n\n // go through entire phrase\n for (int i = 0; i < this.getText().length(); ++i) {\n\n // if position is a multiple of z, insert the special char y2\n if ((i % Character.getNumericValue(this.secretKey.charAt(7)) == 0) && (i != 0)) {\n this.getText().replace(0, this.getText().length(), this.getText().substring(0, i) + this.secretKey.charAt(8)\n + this.getText().substring(i, this.getText().length()));\n }\n }\n \n }", "public static void main(String[] args)\n\t\t\tthrows FileNotFoundException, IOException {\n\t\tFileReader reader=new FileReader();\n\t\tEncryptDencrypt enDencrypt=new EncryptDencrypt();\n\t\tFileWriter writer=new FileWriter();\n\t\t\n\t\tSystem.out.println(\"加密文件:\");\n\t\tString plainStr=reader.read(\"src.txt\");\n\t\tString encryptStr=enDencrypt.encrypt(plainStr);\n\t\twriter.write(encryptStr, \"desprotype.txt\");\n\t\t\n\t\tSystem.out.println(\"解密文件:\");\n\t\tString enStr=reader.read(\"desprotype.txt\");\n\t\tString proStr=enDencrypt.deencrypyt(enStr);\n\t\twriter.write(proStr, \"srcprotype.txt\");\n\t}", "public final byte[] SchlüsselTausch() throws Exception{\n File datei = new File(\"AES.key\");\n \n //Key auslesen\n FileInputStream fis = new FileInputStream(datei);\n byte[] encodedKey = new byte[(int) datei.length()];\n fis.read(encodedKey);\n fis.close();\n \n System.out.println(encodedKey);\n //Das byte[] des Schlüssels zurückgeben\n return(encodedKey);\n}" ]
[ "0.7519572", "0.73924416", "0.70577127", "0.69228834", "0.68532443", "0.66753924", "0.66217965", "0.6541634", "0.6503229", "0.63254297", "0.6289588", "0.62834305", "0.6200167", "0.61731523", "0.616838", "0.615262", "0.613044", "0.61103934", "0.61023027", "0.6075133", "0.6023841", "0.59724087", "0.59682614", "0.59462976", "0.5922952", "0.5870734", "0.5852978", "0.5827285", "0.58261454", "0.58203715", "0.577854", "0.57746524", "0.5772489", "0.5771005", "0.5707064", "0.5697213", "0.568811", "0.5669104", "0.56614476", "0.5637395", "0.5627753", "0.5626155", "0.55638516", "0.554359", "0.5539147", "0.5523614", "0.5512199", "0.55093443", "0.5497087", "0.5473243", "0.5464329", "0.5464101", "0.54625386", "0.5454203", "0.54472744", "0.54436725", "0.5427427", "0.5426014", "0.5416784", "0.54155415", "0.5405755", "0.53886014", "0.53812593", "0.53776306", "0.5372705", "0.53698415", "0.53606284", "0.5357881", "0.534946", "0.5342251", "0.5337779", "0.5335861", "0.5323257", "0.53178835", "0.5314664", "0.5312287", "0.53117466", "0.53111356", "0.53066283", "0.52903396", "0.52842754", "0.5270645", "0.526881", "0.5263517", "0.523683", "0.52353466", "0.5231363", "0.52259725", "0.52190685", "0.5209203", "0.52078307", "0.52015746", "0.5196383", "0.5190721", "0.5190473", "0.5184172", "0.51814824", "0.5177328", "0.51730967", "0.5155776" ]
0.6058754
20
This function decrypts the data which in text file by using 52 keys
void decryption(String file) { try { fdec=new DataOutputStream(new FileOutputStream("dec.txt")); fenc1=new FileInputStream(file); } catch(Exception e) { System.out.println(e); } try { size=fenc1.available(); np=0; p=size%8; if(p!=0) np=8-p; size+=np; if(p==0) nl=size/8; else nl=size/8+1; buf1=new byte[size+10]; buf=new byte[8]; fenc1.read(buf1); mark=-8; int arr[]=new int [8]; for(k1=0;k1<nl;k1++) { mark+=8; for(int k2=0;k2<8;k2++) buf[k2]=buf1[mark+k2]; for(int k2=0;k2<8;k2++) { arr[k2]=0; if(buf[k2]>=0) arr[k2]=buf[k2]; else arr[k2]=buf[k2]+256; } j1=0;i1=0; while( i1<=3) { if((j1+1)%2==0) { x[i1]|=arr[j1]; // dividing 64 bit cypher block into four 16 bit registers i1++; } else { x[i1]=arr[j1]; x[i1]<<=8; } j1++; } for(int t=0;t<4;t++) { ft1 =x[t]&255; ft=x[t]>>8; } step1=mul( x[0] , minverse( z[48] )); step2=( x[1] + ainverse( z[49] )) % 65536; step3=( x[2] + ainverse( z[50] )) % 65536; step4=mul( x[3] , minverse( z[51] )); step5=step1^step3; step6=step2^step4; step7=mul(step5,z[46]); step8=(step6+step7)%65536; step9=mul(step8,z[47]); step10=(step7+step9)%65536; step11=step1^step9; step12=step3^step9; step13=step2^step10; step14=step4^step10; x[0]=step11; x[1]=step12; x[2]=step13; x[3]=step14; // 2nd round int j2=40; for(j1=1;j1<=7;j1++) { step1=mul( x[0] , minverse( z[j2+2] )); step2=( x[1] + ainverse( z[j2+4] )) % 65536; step3=( x[2] + ainverse( z[j2+3] )) % 65536; t=step2; step2=step3; step3=t; step4=mul( x[3] , minverse( z[j2+5] )); step5=step1^step3; step6=step2^step4; step7=mul(step5,z[j2+0]); step8=(step6+step7)%65536; step9=mul(step8,z[j2+1]); step10=(step7+step9)%65536; step11=step1^step9; step12=step3^step9; step13=step2^step10; step14=step4^step10; x[0]=step11; x[1]=step12; x[2]=step13; x[3]=step14; j2=j2-6; } x[0]=mul(x[0],minverse(z[0])); x[1]=(x[1]+ainverse(z[2]))%65536; x[2]=(x[2]+ainverse(z[1]))%65536; x[3]=mul(x[3],minverse(z[3])); t=x[1]; x[1]=x[2]; x[2]=t; for(int t=0;t<4;t++) { ft1 =x[t]&255; ft=x[t]>>8; fdec.write((char)ft); fdec.write((char)ft1); } } } catch(Exception e) { System.out.println(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void runDecrypt(String filePath) {\n try {\n byte[] paramArrayOfbyte = Files.readAllBytes(Paths.get(filePath));\n if (paramArrayOfbyte.length >= 1024 && ((paramArrayOfbyte[0] == 73 && paramArrayOfbyte[1] == 71\n && paramArrayOfbyte[2] == 69 && paramArrayOfbyte[3] == 70)\n || (paramArrayOfbyte[0] == 67 && paramArrayOfbyte[1] == 68 && paramArrayOfbyte[2] == 69\n && paramArrayOfbyte[3] == 70))) {\n // TODO: figure out why it only selects 1024 bytes.\n if (paramArrayOfbyte.length != 1024) {\n byte[] arrayOfByte = new byte[1024];\n System.arraycopy(paramArrayOfbyte, 0, arrayOfByte, 0, 1024);\n paramArrayOfbyte = arrayOfByte;\n }\n\n // Not sure why needing this section?\n byte[] arrayOfByte1 = new byte[12];\n byte[] arrayOfByte2 = new byte[12];\n System.arraycopy(paramArrayOfbyte, 4, arrayOfByte1, 0, 12);\n System.arraycopy(paramArrayOfbyte, 16, arrayOfByte2, 0, 12);\n\n // Init the most important object.\n com.b.a.b.aa.a h = new com.b.a.b.aa.a(new com.b.a.b.aa.b() {\n public byte[] a() {\n return null;\n }\n\n public int b() {\n return 3;\n }\n });\n\n String str1 = (new String(paramArrayOfbyte, 28, 32)).intern();\n // String str2 = a.a(this.n, str1);\n String str2 = Decrypt.DECRYPTION_KEY;\n int i = h.a(str2.getBytes());\n byte[] guessResult = h.b();\n h.b(guessResult); // Digest, this also sets com.b.a.a.aa.a.b. (The hashmap)\n if (i != 0)\n System.out.println(Dumper.dump(h.a(i)));\n else\n System.out.println(\"error in i.\");\n\n // Using the official file reader.\n net.zamasoft.reader.book.a.b randomAccessFile = new net.zamasoft.reader.book.a.b(new File(filePath));\n System.out.println(\"file length: \" + randomAccessFile.length());\n System.out.println(\"key: \" + com.b.a.a.a.c.a.getBLatest());\n ArrayList<Byte> bytes = new ArrayList<>();\n while (!randomAccessFile.isEOF()) {\n byte b = (byte) randomAccessFile.read();\n bytes.add(b);\n }\n assert randomAccessFile.length() == bytes.size();\n byte[] bs = new byte[bytes.size()];\n for (int ii = 0; ii < bs.length; ii++) {\n bs[ii] = bytes.get(ii);\n }\n System.out.println(\"bytes length: \" + bytes.size());\n System.out.println(new String(bs, \"utf-8\"));\n } else {\n System.out.println(\"NOOOOOOOO!\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public static void decrypt() throws IOException{\n\t\tBufferedInputStream in = new BufferedInputStream(new FileInputStream(inFilename));\n\t\tBufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(outFilename));\n\n\t\tbyte[] key; //holds the encryption key\n\n\t\t//get the file length\n\t\tlong fileLength = (new File(inFilename)).length();\n\n\t\t//check the file header marker\n\t\tbyte[] actualHeader = new byte[FILE_HEADER.length];\n\t\tin.read(actualHeader); //read header from the file\n\t\tif (!Arrays.equals(actualHeader, FILE_HEADER)){\n\t\t\tSystem.out.println(\"The file was not encrypted with this program.\");\n\t\t\tSystem.exit(-1); //-1 is an error code\n\t\t}\n\n\t\t/* STAGE 1 - generate decryption key */\n\t\t//read the #padded bits and random salt from the file\n\t\tbyte[] dataFromFile = new byte[129]; //1 byte for #padded bits + 128 bytes for salt\n\t\tin.read(dataFromFile);\n\t\t//separate the #padded bits for use later\n\t\tint numPad = (int)(dataFromFile[0]);\n\t\t//next, generate the message for CubeHash: (password + dataFromFile)\n\t\tbyte[] message = new byte[password.length + dataFromFile.length];\n\t\tSystem.arraycopy(password, 0, message, 0, password.length); //add the password\n\t\tSystem.arraycopy(dataFromFile, 0, message, password.length, dataFromFile.length); //add dataFromFile\n\t\t//finally, (re)generate the encryption key\n\t\tkey = CryptoLib.CubeHash.doCubeHash(message);\n\n\t\t/* STAGE 2 - apply decryption */\n\t\tint currPiece = 0; //keeps track of which piece of the key is being used\n\t\tbyte[] currData = new byte[8]; //holds the data currently being decrypted\n\n\t\t//split the key into 4 pieces of 128 bits each\n\t\tbyte[][] keyPieces = new byte[4][16];\n\t\tfor (int i = 0; i < 4; i++){\n\t\t\tSystem.arraycopy(key, i*16, keyPieces[i], 0, 16);\n\t\t}\n\n\t\t//loop through the rest of the file (except the last block), 8 bytes at a time\n\t\tfor (long i = FILE_HEADER.length + 129; i < fileLength - 8; i += 8){\n\t\t\t//put a chunk of data in currData\n\t\t\tin.read(currData);\n\n\t\t\t//do RC4(key, unTEA(key, data)), then write to file\n\t\t\tout.write(CryptoLib.RC4.doRC4(keyPieces[currPiece],\n\t\t\t\t\t\tCryptoLib.TEA.doUnTEA(keyPieces[currPiece], currData)));\n\n\t\t\t//increment currPiece\n\t\t\tcurrPiece = (currPiece + 1) % 4;\n\t\t}\n\n\t\t//deal with the last chunk of data:\n\t\t//first, read it..\n\t\tin.read(currData);\n\t\t//..decrypt it..\n\t\tcurrData = CryptoLib.RC4.doRC4(keyPieces[currPiece],\n\t\t\t\tCryptoLib.TEA.doUnTEA(keyPieces[currPiece], currData));\n\t\t//..then write it to the file\n\t\tout.write(currData, 0, (8 - numPad));\n\n\t\t/* STAGE 3 - done! */\n\t\tin.close();\n\t\tout.close();\n\t\tSystem.out.println(\"\\nDecryption complete.\");\n\t}", "private static String decryptAES() {\n\t\tString inFilename = \"7hex.txt\";\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(inFilename);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\n\t\t\tfinal String keyHex = asciiToHex(\"YELLOW SUBMARINE\");\n\t\t\tfinal String cipherHex = br.readLine();\n\n\t\t\tSecretKey key = new SecretKeySpec(DatatypeConverter.parseHexBinary(keyHex), \"AES\");\n\t\t\tCipher cipher = Cipher.getInstance(\"AES/ECB/NoPadding\");\n\t\t\tcipher.init(Cipher.DECRYPT_MODE, key);\n\t\t\tbyte[] result = cipher.doFinal(DatatypeConverter.parseHexBinary(cipherHex));\n\n\t\t\tbr.close();\n\t\t\tfr.close();\n\n\t\t\treturn new String(result);\n\t\t} catch (Exception e) {\n\t\t\treturn null;\n\t\t}\n\t}", "static void decryptECB(String filename, String key) {\n try {\n Scanner s = new Scanner(new File(filename + EXT), \"UTF-8\");\n File newFile = new File(filename + \"_dec\" + EXT);\n newFile.delete();\n newFile.createNewFile();\n PrintWriter w = new PrintWriter(newFile);\n processHeader(s, w);\n while (s.hasNext()) {\n readBlock(s);\n block = stateToBits(AES.decrypt(bitsToHexString(block), key));\n writeBlock(w);\n }\n w.flush();\n w.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "void procedure()\n {\n try\n {\n fkey=new FileInputStream(file2);\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n keybuf= new byte[16];\n try\n {\n fkey.read(keybuf);\n z= new int[52];\n j1=0;\n i1=0;\n for(i=0;i<52;i++)\n z[i]=0;\n while( i1<8)\n {\n if((j1+1)%2==0)\n {\n z[i1]|=keybuf[j1]; // dividing 64 bit cypher block into four 16 bit registers\n\t i1++;\n }\n else\n \t {\n\t z[i1]=keybuf[j1];\n\t z[i1]<<=8;\n }\n\t j1++;\n }\n i=0;\n\t for(j1=1;j1<=5;j1++)\n\t {\n\t i++;\n\t z[i+7]=((z[i]<<9)&0xfe00)|((z[i+1]>>7)&0x1ff);\n\t z[i+8]=((z[i+1]<<9)&0xfe00)|((z[i+2]>>7)&0x1ff);\n\t z[i+9]=((z[i+2]<<9)&0xfe00)|((z[i+3]>>7)&0x1ff);\n\t z[i+10]=((z[i+3]<<9)&0xfe00)|((z[i+4]>>7)&0x1ff);\n\t z[i+11]=((z[i+4]<<9)&0xfe00)|((z[i+5]>>7)&0x1ff);\n\t z[i+12]=((z[i+5]<<9)&0xfe00)|((z[i+6]>>7)&0x1ff);\n z[i+13]=((z[i+6]<<9)&0xfe00)|((z[i-1]>>7)&0x1ff);\n\t z[i+14]=((z[i-1]<<9)&0xfe00)|((z[i]>>7)&0x1ff);\n\t i=i+7;\n\t }\n i1=41;\n\t z[48]=((z[i1]<<9)&0xfe00)|((z[i1+1]>>7)&0x1ff);\n\t z[49]=((z[i1+1]<<9)&0xfe00)|((z[i1+2]>>7)&0x1ff);\n\t z[50]=((z[i1+2]<<9)&0xfe00)|((z[i1+3]>>7)&0x1ff);\n\t z[51]=((z[i1+3]<<9)&0xfe00)|((z[i1+4]>>7)&0x1ff);\n}\ncatch(Exception e)\n{\nSystem.out.println(e);\n}\n}", "private void encryptionAlgorithm() {\n\t\ttry {\n\t\t\t\n\t\t\tFileInputStream fileInputStream2=new FileInputStream(\"D:\\\\program\\\\key.txt\");\n\t\t\tchar key=(char)fileInputStream2.read();\n\t\t\tSystem.out.println(key);\n\t\t\tFileInputStream fileInputStream1=new FileInputStream(\"D:\\\\program\\\\message.txt\");\n\t\t\tint i=0;\n\t\t\t\n\t\t\tStringBuilder message=new StringBuilder();\n\t\t\twhile((i= fileInputStream1.read())!= -1 )\n\t\t\t{\n\t\t\t\tmessage.append((char)i);\n\t\t\t}\n\t\t\tString s=message.toString();\n\t\t\tchar[] letters=new char[s.length()];\n\t\t\tStringBuilder en=new StringBuilder();\n\t\t\tfor(int j = 0;j < letters.length;j++)\n\t\t\t{\n\t\t\t\ten.append((char)(byte)letters[j]+key);\n\t\t\t}\t\t\n\t\t\tFileOutputStream fileoutput=new FileOutputStream(\"D:\\\\program\\\\encryptedfile.txt\");\n\t\t\t\n\t\t\tfileInputStream1.close();\n\t\t\tfileInputStream2.close();\n\t\t\t\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t\n\t}", "public void decrypt() {\n try {\n // Create input and output streams\n System.out.println(\"Loading files\");\n FileInputStream in = new FileInputStream(this.input);\n FileOutputStream out = new FileOutputStream(this.output);\n\n // Skip IV values\n in.getChannel().position(cipher.getBlockSize());\n\n /*\n Using CipherInputStream object to read from encrypted file\n cipherIn reads data from input stream and and returns the decrypted value\n */\n System.out.println(\"Creating cipher stream\");\n CipherInputStream cipherIn = new CipherInputStream(in, this.cipher);\n\n System.out.println(\"Starting file decryption\");\n byte[] buffer = new byte[Common.BLOCK_SIZE];\n int len;\n // Reading from the input stream\n while ((len = cipherIn.read(buffer)) != -1)\n // Write the decrypted message to output stream\n out.write(buffer, 0, len);\n\n // Close all streams\n System.out.println(\"Closing file streams\");\n cipherIn.close();\n out.flush();\n out.close();\n\n System.out.println(\"Decryption complete\");\n } catch (Exception e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n }", "public void stringcon()\n {\n int i,j,k;\n int temp[]=new int[8];\n int a[]=new int[32];\n i=0;\n j=0;\n for(i=0;i<10000;i++)\n bytes[i]=0;\n i=0;\n maxbinary1=0;\n for(i=0;i<24;i++)\n a[i]=binary[i];\n for(i=0;i<24;i++)\n maxbinary1+=a[i]*Math.pow(2,23-i);\n maxbinary2=maxbinary1*8;\n ivalue=0;\n for(i=24,j=0;i<32;i++,j++)\n {\n a[j]=binary[i];\n ivalue+=a[j]*Math.pow(2,7-j);\n }\n if(ivalue==73)\n {\n i=32;\n while(i<maxbinary2)\n {\n for(k=0;k<=7;k++)\n temp[k]=binary[i++];\n for(k=0;k<=7;k++)\n bytes[j]+=temp[k]*Math.pow(2,7-k);\n j++;\n }\n String s=JOptionPane.showInputDialog(this,\"Enter key with 16 letters\");\n char ch[]=new char[s.length()];\n ch=s.toCharArray();\n try\n {\n FileOutputStream f=new FileOutputStream(\"key1.txt\");\n for(i=0;i<ch.length;i++)\n f.write(ch[i]);\n f.close();\n FileOutputStream fout=new FileOutputStream(\"enc1.txt\");\n DataOutputStream d=new DataOutputStream(fout);\n \t\ti=8;\n while(i<(maxbinary1))\n \t\t {\n \t\t\td.write(bytes[i]);\n\t\t i++;\n \t\t }\n fout.close();\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n\n ideaalgo b=new ideaalgo();\n b.procedure();\n b.decryption(\"enc1.txt\");\n try\n {\n BufferedReader d;\n StringBuffer sb=new StringBuffer();\n d=new BufferedReader(new FileReader(\"dec.txt\"));\n String line;\n while((line=d.readLine())!=null)\n sb.append(line+\"\\n\");\n ta.setText(sb.toString());\n d.close();\n }\ncatch(Exception e)\n {\n System.out.println(e);\n }\n }\n}", "public String decrypt(String key);", "static void decryptCBC(String filename, String key, String IV) {\n try {\n Scanner s = new Scanner(new File(filename + EXT), \"UTF-8\");\n File newFile = new File(filename + \"_dec\" + EXT);\n newFile.delete();\n newFile.createNewFile();\n PrintWriter w = new PrintWriter(newFile);\n processHeader(s, w);\n cipherBlock = hexStringToBits(IV);\n while (s.hasNext()) {\n readBlock(s);\n int[] temp = new int[128];\n for (int i = 0; i < block.length; i++) {\n temp[i] = block[i];\n }\n block = stateToBits(AES.decrypt(bitsToHexString(block), key));\n block = xor(block, cipherBlock);\n cipherBlock = temp;\n writeBlock(w);\n }\n w.flush();\n w.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private static void decryptFile(String fileInput, String privateKeyFilename, String password) throws Exception {\n\n\t\t// Load the private key bytes\n\t\tFileInputStream fis = new FileInputStream(privateKeyFilename);\n\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\n\n\t\tint theByte = 0;\n\t\twhile ((theByte = fis.read()) != -1) {\n\t\t\tbaos.write(theByte);\n\t\t}\n\t\tfis.close();\n\n\t\tbyte[] keyBytes = baos.toByteArray();\n\t\tbaos.close();\n\n\t\tkeyBytes = passwordDecrypt(password.toCharArray(), keyBytes);\n\n\t\t// Turn the encoded key into a real RSA private key.\n\t\t// Private keys are encoded in PKCS#8.\n\t\tPKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes);\n\t\tKeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n\t\tPrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n\n\t\t// Create a cipher using that key to initialize it\n\t\tCipher rsaCipher = Cipher.getInstance(\"RSA/ECB/PKCS1Padding\");\n\n\t\t// Read in the encrypted bytes of the session key\n\t\tDataInputStream dis = new DataInputStream(new FileInputStream(fileInput + ENCRYPTED_FILENAME_SUFFIX));\n\t\tbyte[] encryptedKeyBytes = new byte[dis.readInt()];\n\t\tdis.readFully(encryptedKeyBytes);\n\n\t\t// Decrypt the session key bytes.\n\t\trsaCipher.init(Cipher.DECRYPT_MODE, privateKey);\n\t\tbyte[] rijndaelKeyBytes = rsaCipher.doFinal(encryptedKeyBytes);\n\n\t\t// Transform the key bytes into an actual key.\n\t\tSecretKey rijndaelKey = new SecretKeySpec(rijndaelKeyBytes, \"Rijndael\");\n\n\t\t// Read in the Initialization Vector from the file.\n\t\tbyte[] iv = new byte[16];\n\t\tdis.read(iv);\n\t\tIvParameterSpec spec = new IvParameterSpec(iv);\n\n\t\tCipher cipher = Cipher.getInstance(\"Rijndael/CBC/PKCS5Padding\");\n\t\tcipher.init(Cipher.DECRYPT_MODE, rijndaelKey, spec);\n\t\tCipherInputStream cis = new CipherInputStream(dis, cipher);\n\n\t\tSystem.out.println(\"Decrypting the file...\");\n\t\tFileOutputStream fos = new FileOutputStream(fileInput + DECRYPTED_FILENAME_SUFFIX);\n\n\t\t// Read through the file, decrypting each byte.\n\t\ttheByte = 0;\n\t\twhile ((theByte = cis.read()) != -1) {\n\t\t\tfos.write(theByte);\n\t\t}\n\t\tcis.close();\n\t\tfos.close();\n\t\tSystem.out.println(\"Done.\");\n\t\treturn;\n\t}", "public void opentextfile(String path1)\n {\n FileInputStream fin,fin1;\n \tint i,j=0;\n String s=JOptionPane.showInputDialog(this,\"Enter key with 16 letters\");\n char ch[]=new char[s.length()];\n ch=s.toCharArray();\n try\n {\n FileOutputStream f=new FileOutputStream(\"key1.txt\");\n for(i=0;i<ch.length;i++)\n f.write(ch[i]);\n f.close();\n ideaalgo a=new ideaalgo(path1);\n a.procedure();\n a.encrypt();\n BufferedReader d;\n StringBuffer sb=new StringBuffer();\n d=new BufferedReader(new FileReader(path1));\n String line;\n while((line=d.readLine())!=null)\n sb.append(line+\"\\n\");\n ta.setText(sb.toString());\n d.close();\n fin=new FileInputStream(\"enc.txt\");\n do\n \t {\n\t i=fin.read();\n \t if(i!=-1)\n \t\t{\n bytes[j++]=i;\n }\n } while(i!=-1);\n max=j;\n fin.close();\n binarycon();\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n }", "private void prga(){\n int i = 0;\n int a = 0;\n int b = 0;\n StringBuilder sb = new StringBuilder();\n fileEncrypted.clear();\n\n byte[] code = new byte[filePlain.size()];\n while (i<filePlain.size()){\n a = (a + 1) % 256;\n b = (b + s_box.get(a)) % 256;\n Collections.swap(s_box, a, b);\n\n int key_int = s_box.get((s_box.get(a) + s_box.get(b))% 256);\n byte cypher = (byte) (key_int^filePlain.get(i));\n\n fileEncrypted.add(cypher);\n sb.append((char)cypher);\n code[i] = cypher;\n i++;\n }\n\n System.out.println(\"aaa\");\n// export file\n Helper.exportFile(code, extension, true);\n }", "void decryptFile(String path) throws IOException {\n try (BufferedReader reader = new BufferedReader(new FileReader(path))) {\n PrintWriter writer = new PrintWriter(System.out);\n decryptFile(reader, writer);\n } catch (FileNotFoundException e) {\n System.out.println(\"Error: Input file not found\");\n }\n }", "public void readDataFromFile(View view) throws GeneralSecurityException, IOException {\n encryptedFile = new EncryptedFile.Builder(\n context,\n new File(MainActivity.this.getFilesDir(),\"test.txt\"), // File want to read\n mainKey, // Master key for encryption\n EncryptedFile.FileEncryptionScheme.AES256_GCM_HKDF_4KB) // Algorithm or FileEncryptionScheme for encryption\n .build();\n\n\n InputStream inputStream = encryptedFile.openFileInput(); // Open the encrypted file to read\n int next = inputStream.read(); // Read the encrypted file\n\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); // ByteArrayOutputStream to print the content of file to read\n\n while (next != -1){\n byteArrayOutputStream.write(next); // Write the file content in byteArrayOutputStream object\n next = inputStream.read(); // Read the next character until it encounter the end (-1)\n }\n\n byte[] plainText = byteArrayOutputStream.toByteArray(); // Convert into byte array\n\n String textString = new String(plainText); // Create a new string with converted plain text byte array\n\n textView.setText(textString); // display the file content in textView\n }", "public void decryptFile(String fitxerEncriptat, SecretKey clave, String fitxerDesencriptat) throws FileNotFoundException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IOException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException {\r\n //Creamos el FileInputStream\r\n FileInputStream fis = new FileInputStream(fitxerEncriptat);\r\n //Creamos el FileOutputStream para escribir en el fichero.\r\n FileOutputStream fos = new FileOutputStream(new File(fitxerDesencriptat));\r\n \r\n //Creamos un descifrador para descifrar el texto del fichero Encriptado.\r\n Cipher descifrador = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\r\n IvParameterSpec iv = new IvParameterSpec(cadena_iv.getBytes());\r\n descifrador.init(Cipher.DECRYPT_MODE, clave, iv);\r\n\r\n byte[] buffer = new byte[1024];\r\n int bytes;\r\n \r\n //Utilizamos un bucle para ir leyendo el archivo de texto Encriptado que le hemos pasado.\r\n while((bytes = fis.read(buffer, 0, buffer.length))!=-1){\r\n byte [] update = descifrador.update(buffer, 0, bytes);\r\n fos.write(descifrador.doFinal());\r\n }\r\n \r\n //Cerramos recursos.\r\n fos.write(descifrador.doFinal());\r\n fis.close();\r\n fos.close();\r\n \r\n \r\n }", "public void decryptFile(File cipherInputFile, File textOutputFile) throws FileNotFoundException{\n Scanner in = new Scanner(cipherInputFile);\n PrintStream out = new PrintStream(textOutputFile);\n\n while (in.hasNextLine()) {\n String line = in.nextLine();\n out.print(decrypt(line));\n }\n }", "public static void main(String[] args) throws FileNotFoundException\n\t{\n\t\tString input;\n//\t\tString output = \"\";\n\t\tFile f = new File(\"PlayfairKey.txt\");\n\t\tScanner reader = new Scanner(f);\n\t\tScanner in = new Scanner(System.in);\n\t\t//fills in the key array\n\t\tfor(int y = 0; y < 5; y++)\n\t\t{\n\t//\t\tSystem.out.println(\"Reached x\");\n\t\t\tfor(int x = 0; x < 5; x++)\n\t\t\t{\n\t\t\t\tString temp = reader.nextLine();\n\t//\t\t\tSystem.out.println(\"Reached y\");\n\t\t\t\tkey[x][y] = temp.charAt(0);\n\t\t\t}\n\t\t}\n\t\t\n\t\treader.close();\n\t\t/*\n\t\tfor(int y = 0; y < 5; y++)\n\t\t{\n\t\t\tfor(int x = 0; x < 5; x++)\n\t\t\t{\n\t\t\t\tSystem.out.print(key[x][y]+\" \");\n\t\t\t\t//System.out.print(x+\",\"+y+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\\t\");\n\t\t}\n\t\t*/\n\t\t\n\t\t/*\n\t\tfor(int y = 0; y < 5; y++)\n\t\t{\n\t\t\tfor(int x = 0; x < 5; x++)\n\t\t\t{\n\t\t\t\t//System.out.print(key[x][y]+\" \");\n\t\t\t\tSystem.out.print(x+\",\"+y+\" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\\t\");\n\t\t}\n\t\t*/\n\t\t\n\t\t\n\t\t\n\t\t//test\n\t//\tSystem.out.println(\"Enter 1 to encrypt, 2 to decrypt, -1 to end the program\");\n\t\twhile(condition != -1)\n\t\t{\n\t\t\t\n\t\t\tSystem.out.println(\"Enter 1 to encrypt, 2 to decrypt, -1 to end the program\");\n\t\t\n\t\t\tcondition = in.nextInt();\n\t\t\n\t\t\tif(condition == -1)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Enter a String:\");\n\t\t\tin.nextLine();\n\t\t\tinput = in.nextLine();\n\t\t\t\n\t\t\tinput = input.replaceAll(\" \",\"\");\n\t\t\n\t\t\tinput = input.toLowerCase();\n\t\t\t\n\t\t\t\n\t\t\tif(condition == 1)\n\t\t\t{\n\t\t\t\tinput = input.replaceAll(\"j\",\"i\");\n\t\t\t\tchar[] tempInputArray = input.toCharArray();\n\t\t\t\tint found = 1;\n\t\t\t\t\n\t\t\t\tfor(int i =0; i < tempInputArray.length-1; i++)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif(tempInputArray[i] == tempInputArray[i+1])\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tinput = input.substring(0, i+found) + \"x\" + input.substring(i+found, input.length());\n\t\t\t\t\t\tfound++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(input.length() % 2 != 0)\n\t\t\t\t{\n\t\t\t\t\tinput+=\"x\";\n\t\t\t\t}\n\t\t\t\t\n//\t\t\t\tSystem.out.println(input);\n\t\t\t\t\n\t\t\t\tchar[] inputArray = input.toCharArray();\n\t\t\t\tSystem.out.println(\"Encrypted:\");\n\t\t\t\tencrypt(inputArray);\n\t\t\t}\n\t\t\telse if(condition == 2)\n\t\t\t{\n//\t\t\t\tSystem.out.println(input);\n\t\t\t\tchar[] inputArray = input.toCharArray();\n\t\t\t\tSystem.out.println(\"Decrypted:\");\n\t\t\t\tdecrypt(inputArray);\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"\\n\\n\");\n\t\t\t\n\t\t}\n\n\t\t\n\t}", "public PrivateKey decryptPrivateKeyFile(String filePath, SecretKey secretKey) {\n\t\tPath path = Paths.get(filePath);\n\t\tbyte[] fileData = null;\n\t\ttry {\n\t\t\tfileData = Files.readAllBytes(path);\n\t\t} catch ( IOException e ) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Decrypting data to PEM format\n\t\tCipher cipher = null;\n\t\tbyte[] pemData = null;\n\t\ttry {\n\t\t\tcipher = Cipher.getInstance(\"DES/ECB/PKCS5Padding\");\n\t\t\tcipher.init(Cipher.DECRYPT_MODE, secretKey);\n\t\t\tpemData = cipher.doFinal(fileData);\n\t\t} catch ( NoSuchAlgorithmException e ) {\n\t\t\tSystem.err.println(\"[ERROR-PRIVATE KEY DECRYPT] Non-existing algorithm for Cipher: DES/ECB/PKCS5Padding\");\n\t\t\tSystem.exit(1);\n\t\t} catch ( NoSuchPaddingException e ) {\n\t\t\tSystem.err.println(\"[ERROR-PRIVATE KEY DECRYPT] Non-existing padding for Cipher: DES/ECB/PKCS5Padding\");\n\t\t\tSystem.exit(1);\n\t\t} catch ( InvalidKeyException e ) {\n\t\t\tSystem.err.println(\"[ERROR-PRIVATE KEY DECRYPT] Invalid secret key\");\n\t\t\treturn null;\n\t\t\t//System.exit(1);\n\t\t} catch ( IllegalBlockSizeException e ) {\n\t\t\tSystem.err.println(\"[ERROR-PRIVATE KEY DECRYPT] Actual encrypted private key data byte size (\" + Integer.toString(fileData.length) + \") doesn't match with expected by Cipher\");\n\t\t\tSystem.exit(1);\n\t\t} catch ( BadPaddingException e ) {\n\t\t\tSystem.err.println(\"[ERROR-PRIVATE KEY DECRYPT] Bad padding in private key file data expected by Cipher\");\n\t\t\treturn null;\n\t\t\t//System.exit(1);\n\t\t}\n\n\t\tString privKeyPEM = null;\n\t\ttry {\n\t\t\tprivKeyPEM = new String(pemData, \"UTF-8\");\n\t\t} catch ( UnsupportedEncodingException e ) {\n\t\t\tSystem.err.println(\"[ERROR-PRIVATE KEY DECRYPT] Non-supported character encoding for PEM data: UTF-8\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t//System.out.println(\"PEM format:\\n\" + privKeyPEM);\n\n // Decoding Base64\n privKeyPEM = privKeyPEM.replace(\"-----BEGIN PRIVATE KEY-----\\n\", \"\").replace(\"-----END PRIVATE KEY-----\", \"\").replaceAll(\"\\\\s\",\"\");\n\t\t//System.out.println(\"Base64 code:\\n\" + privKeyPEM + \"\\n\");\n\t\tbyte[] pkcs8Data = Base64.getDecoder().decode(privKeyPEM);\n\t\t//System.out.println(\"PKCS8 encrypted key:\\n\" + new String(pkcs8Data, \"UTF-8\") + \"\\n\");\n\n\t\t// Generating private key\n \tPKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(pkcs8Data);\n \tKeyFactory keyFactory = null;\n \tPrivateKey privateKey = null;\n \ttry {\n \t\tkeyFactory = KeyFactory.getInstance(\"RSA\");\n \t\tprivateKey = keyFactory.generatePrivate(keySpec);\n \t} catch ( NoSuchAlgorithmException e ) {\n \t\tSystem.err.println(\"[ERROR-PRIVATE KEY DECRYPT] Non-existing algorithm for KeyFactory: RSA\");\n\t\t\tSystem.exit(1);\n \t} catch ( InvalidKeySpecException e ) {\n \t\tSystem.err.println(\"[ERROR-PRIVATE KEY DECRYPT] Invalid encoding to generate private key\");\n\t\t\tSystem.exit(1);\n \t}\n\t\treturn privateKey;\n \n }", "public static void main(String[] args) \r\n {\r\n /*\r\n String data = \"This is a very important statement.\";\r\n String key = \"How old is my computer?\";\r\n KeyGenerator kGen = new KeyGenerator(key);\r\n String nK = kGen.getNumericKey();\r\n \r\n ArmstrongManager aMgr = new ArmstrongManager(nK);\r\n ColorManager cMgr = new ColorManager(nK);\r\n \r\n String encData =\"\";\r\n int temp;\r\n int i;\r\n for(i =0 ; i < data.length(); i++)\r\n {\r\n temp = aMgr.encrypt(data.charAt(i));\r\n temp = cMgr.encrypt(temp);\r\n encData = encData + (char)temp;\r\n }\r\n \r\n String decData= \"\";\r\n for(i =0 ; i < encData.length(); i++)\r\n {\r\n temp = cMgr.decrypt(encData.charAt(i));\r\n temp = aMgr.decrypt(temp);\r\n \r\n decData = decData + (char)temp;\r\n }\r\n \r\n \r\n System.out.println(\"data: \"+ data + \" \" + data.length());\r\n System.out.println(\"enc data: \"+ encData + \" \" + encData.length());\r\n System.out.println(\"dec data: \"+ decData + \" \" + decData.length());\r\n */\r\n \r\n try\r\n {\r\n //String src = \"d:/a.txt\";//images/kids.jpg\";\r\n //String enc = \"d:/e_a.txt\";//images/e_kids.jpg\";\r\n //String dec = \"d:/d_a.txt\";//images/d_kids.jpg\";\r\n String src = \"d:/images/kids.jpg\";\r\n String enc = \"d:/images/e_kids.jpg\";\r\n String dec = \"d:/images/d_kids.jpg\";\r\n\r\n String key = \"How old is my computer?\";\r\n\r\n Encryptor objEnc = new Encryptor(key);\r\n Decryptor objDec = new Decryptor(key);\r\n\r\n objEnc.encrypt(src, enc);\r\n System.out.println(\"Encryption Done\");\r\n \r\n objDec.decrypt(enc, dec);\r\n System.out.println(\"Decryption Done\");\r\n \r\n\r\n }\r\n catch(Exception ex)\r\n {\r\n System.out.println(\"Err: \" +ex.getMessage());\r\n }\r\n }", "static void decryptCTR(String filename, String key, String counter) {\n try {\n Scanner s = new Scanner(new File(filename + EXT), \"UTF-8\");\n File newFile = new File(filename + \"_dec\" + EXT);\n newFile.delete();\n newFile.createNewFile();\n PrintWriter w = new PrintWriter(newFile);\n processHeader(s, w);\n BigInteger b = new BigInteger(counter, 16);\n while (s.hasNext()) {\n readBlock(s);\n String n = b.toString(16);\n if (n.length() < 32) {\n for (int i = n.length(); i < 32; i++) {\n n = \"0\" + n;\n }\n } else if (n.length() > 32) {\n n = n.substring(0, 32);\n }\n cipherBlock = stateToBits(AES.encrypt(n, key));\n block = xor(block, cipherBlock);\n writeBlock(w);\n b.add(new BigInteger(\"1\"));\n }\n w.flush();\n w.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "void encrypt()\n {\n try\n {\n size=fin.available();\n p=size%8;\n if(p!=0)\n np=8-p;\n size+=np;\n if(p==0)\n nl=size/8;\n else\n nl=size/8+1;\n buf=new byte[8];\n buf1=new byte[size+10];\n fin.read(buf1);\n int enc[]=new int[size];\n mark=-8;\n k2=0;\n for(k=0;k<nl;k++)\n {\n mark+=8;\n for(int k1=0;k1<8;k1++)\n buf[k1]=buf1[mark+k1];\n i=0;\n\t for(i=0;i<4;i++)\n x[i]=0;\n\t j1=0;i1=0;\n while( i1<=3)\n {\n\t if((j1+1)%2==0)\n\t {\n\t x[i1]|=buf[j1]; // dividing 64 bit cipher block into four 16 bit registers\n\t i1++;\n\t\t }\n\t else\n {\n\t x[i1]=buf[j1];\n\t x[i1]<<=8;\n }\n j1++;\n\t }\n // 7 rounds and 14 steps\n for(i=0 ; i <48 ; )\n {\n step1=mul(x[0],z[i+0]);\n step2=(x[1]+z[i+1])%65536;\n step3=(x[2]+z[i+2])%65536;\n step4=mul(x[3],z[i+3]);\n step5=step1^step3;\n step6=step2^step4;\n step7=mul(step5,z[i+4]);\n step8=(step6+step7)%65536;\n step9=mul(step8,z[i+5]);\n step10=(step7+step9)%65536;\n step11=step1^step9;\n step12=step3^step9;\n step13=step2^step10;\n step14=step4^step10;\n x[0]=step11;\n x[1]=step13;\n x[2]=step12;\n x[3]=step14;\n i=i+6;\n }\n x[0]=mul(x[0],z[48]);\n x[1]=(x[1]+z[49])%65536;\n x[2]=(x[2]+z[50])%65536;\n x[3]=mul(x[3],z[51]);\n for(int t=0;t<4;t++)\n {\n ft1 =x[t]&255;\n ft=x[t]>>8;\n fenc.write((char)ft);\n fenc.write((char)ft1);\n }\n}\nfin.close();\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n}", "public static void main(String[] args) throws IOException {\n char[][] key = new char[8][8];\n\n String[] lines = new String[8];\n\n File fileCardan = new File(\"cardan.txt\");\n\n Scanner fileScanner = new Scanner(fileCardan);\n\n for (int i = 0; i < 8; i++) {\n lines[i] = fileScanner.nextLine();\n }\n\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n key[i][j] = lines[i].charAt(j);\n }\n\n }\n\n // reading text from input.txt file and getting count of 64 char blocks\n String text = new String(Files.readAllBytes(Paths.get(\"input.txt\")));\n\n int blocksCount = text.length() / 64 + 1;\n\n FileWriter fw = new FileWriter(\"encode.txt\");\n\n // encoding all 64 char blocks\n for (int i = 0; i < blocksCount; i++) {\n\n char[][] res;\n if(64+i*64 > text.length())\n res = encode(key, text.substring(i*64));\n else\n res = encode(key, text.substring(i*64,64+i*64));\n fileWrite(res,fw);\n\n }\n\n fw.close();\n\n text = new String(Files.readAllBytes(Paths.get(\"encode.txt\")));\n\n fw = new FileWriter(\"decode.txt\");\n\n for (int i = 0; i < blocksCount; i++) {\n\n fw.write(decode(text.substring(i*64,i*64+64),key));\n\n }\n\n fw.close();\n\n\n\n }", "private void decryptFile(BufferedReader reader, PrintWriter writer) throws IOException {\n while (reader.ready()) {\n String msg = reader.readLine();\n String decMsg = decryptMsg(msg);\n writer.println(decMsg);\n }\n }", "public static final byte[] decryptData(final byte data[]) {\n for (int j = 1; j <= 6; j++) {\n byte remember = 0;\n byte dataLength = (byte) (data.length & 0xFF);\n byte nextRemember = 0;\n\n if (j % 2 == 0) {\n for (int i = 0; i < data.length; i++) {\n byte cur = data[i];\n cur -= 0x48;\n cur = ((byte) ((~cur) & 0xFF));\n cur = BitTools.rollLeft(cur, (int) dataLength & 0xFF);\n nextRemember = cur;\n cur ^= remember;\n remember = nextRemember;\n cur -= dataLength;\n cur = BitTools.rollRight(cur, 3);\n data[i] = cur;\n dataLength--;\n }\n } else {\n for (int i = data.length - 1; i >= 0; i--) {\n byte cur = data[i];\n cur = BitTools.rollLeft(cur, 3);\n cur ^= 0x13;\n nextRemember = cur;\n cur ^= remember;\n remember = nextRemember;\n cur -= dataLength;\n cur = BitTools.rollRight(cur, 4);\n data[i] = cur;\n dataLength--;\n }\n }\n //System.out.println(\"dec after iteration \" + j + \": \" + HexTool.toString(data));\n }\n return data;\n }", "private static int decrypt(int index) {\n\t int k1_inv = 9; \n\t int k2 = 1;\n\t // add 26 to index to avoid error when (index - k2) <= 0\n\t index = (((index+26) - k2)*(k1_inv))%26;\n\t return index;\n }", "public void runAES(String infoFilePath) {\n System.out.println(\"test\");\n try {\n FileInputStream fileInputStream = new FileInputStream(infoFilePath);\n StringBuffer stringBuffer = new StringBuffer();\n for (int i = fileInputStream.read(); i != 19; i = fileInputStream.read())\n stringBuffer.append((char) i);\n // long l = Long.parseLong(stringBuffer.toString());\n\n // This is the Long object in the `info` file.\n // byte[] builtSecretKey = buildSecretKey(-345585222195293739L);\n byte[] builtSecretKey = buildSecretKey(6874628185188049249L);\n\n MessageDigest messageDigest = MessageDigest.getInstance(\"MD5\");\n SecretKeySpec secretKeySpec = new SecretKeySpec(messageDigest.digest(builtSecretKey), \"AES\");\n Cipher cipher = Cipher.getInstance(\"AES\");\n cipher.init(2, secretKeySpec);\n ObjectInputStream objectInputStream = new ObjectInputStream(new CipherInputStream(fileInputStream, cipher));\n\n long secretKey = objectInputStream.readLong();\n HashMap<String, com.b.a.b.a> n = (HashMap<String, com.b.a.b.a>) objectInputStream.readObject();\n String k = (String) objectInputStream.readObject();\n String l = (String) objectInputStream.readObject();\n Boolean p = ((Boolean) objectInputStream.readObject()).booleanValue();\n Boolean o = ((Boolean) objectInputStream.readObject()).booleanValue();\n\n // Print everything\n System.out.println(secretKey);\n System.out.println(\"key_info:\");\n for (String key : n.keySet()) {\n com.b.a.b.a a = n.get(key);\n System.out.println(\" \" + key + \":\");\n System.out.println(\" a.a: \" + a.a.a());\n System.out.println(\" b: \" + a.a.b());\n System.out.println(\" c: \" + a.a.c());\n System.out.println(\" d: \" + a.a.d());\n System.out.println(\" e: \" + a.a.e().toString());\n System.out.println(\" f: \" + a.a.f());\n System.out.println(\" a.b: \" + a.b); // This is my key, existing in every file.\n System.out.println(\" a.c: \" + a.c);\n }\n System.out.println(k);\n System.out.println(l);\n System.out.println(p);\n System.out.println(o);\n\n objectInputStream.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private static void decrypt(File fileToDecrypt, File configFile, File keystoreFile, int[] elementsSizes)\n\t{\n\t\tbyte[] signature = new byte[elementsSizes[0]];\n\t\tbyte[] encryptKey = new byte[elementsSizes[1]];\n\t\tbyte[] encodedAlgoParams = new byte[elementsSizes[2]];\n\t\tbyte[] signatureAlgoArray = new byte[elementsSizes[3]];\n\n\t\tgetElementsFromConfigFile(signature, encryptKey, encodedAlgoParams, signatureAlgoArray, configFile);\n\n\t\tString signatureAlgo = new String(signatureAlgoArray);\n\t\tAlgorithmParameters algoParams = null;\n\t\ttry\n\t\t{\n\t\t\talgoParams = AlgorithmParameters.getInstance(inputAlgorithmForFileEncryption);\n\t\t\talgoParams.init(encodedAlgoParams);\n\t\t} catch (NoSuchAlgorithmException | IOException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tKeyPair keyPair = getKeyPair(keystoreFile);\n\t\tKey symKey = decryptSymmetricKey(keyPair, encryptKey);\n\n\t\tbyte[] decryptData = decryptFileContent(algoParams, symKey, fileToDecrypt);\n\t\tverifyDigitalSignature(decryptData, signature, keyPair, signatureAlgo);\n\t}", "public String Decrypt(String s);", "private static java.io.File a(java.io.File r8, java.lang.String r9, java.lang.String r10) {\n /*\n r0 = 0;\n r1 = 0;\n r2 = r8.getName();\t Catch:{ Exception -> 0x006b, all -> 0x0067 }\n r3 = \".decrypt\";\n r4 = r8.getParentFile();\t Catch:{ Exception -> 0x006b, all -> 0x0067 }\n r2 = java.io.File.createTempFile(r2, r3, r4);\t Catch:{ Exception -> 0x006b, all -> 0x0067 }\n r3 = new javax.crypto.spec.IvParameterSpec;\t Catch:{ Exception -> 0x0062, all -> 0x0067 }\n r4 = \"UTF-8\";\n r10 = r10.getBytes(r4);\t Catch:{ Exception -> 0x0062, all -> 0x0067 }\n r3.<init>(r10);\t Catch:{ Exception -> 0x0062, all -> 0x0067 }\n r10 = new javax.crypto.spec.SecretKeySpec;\t Catch:{ Exception -> 0x0062, all -> 0x0067 }\n r4 = \"UTF-8\";\n r9 = r9.getBytes(r4);\t Catch:{ Exception -> 0x0062, all -> 0x0067 }\n r4 = \"AES\";\n r10.<init>(r9, r4);\t Catch:{ Exception -> 0x0062, all -> 0x0067 }\n r9 = \"AES/CBC/PKCS7PADDING\";\n r9 = javax.crypto.Cipher.getInstance(r9);\t Catch:{ Exception -> 0x0062, all -> 0x0067 }\n r4 = 2;\n r9.init(r4, r10, r3);\t Catch:{ Exception -> 0x0062, all -> 0x0067 }\n r10 = new java.io.FileInputStream;\t Catch:{ Exception -> 0x0062, all -> 0x0067 }\n r10.<init>(r8);\t Catch:{ Exception -> 0x0062, all -> 0x0067 }\n r3 = new javax.crypto.CipherInputStream;\t Catch:{ Exception -> 0x005e, all -> 0x005a }\n r3.<init>(r10, r9);\t Catch:{ Exception -> 0x005e, all -> 0x005a }\n r9 = new java.io.FileOutputStream;\t Catch:{ Exception -> 0x0057, all -> 0x0054 }\n r9.<init>(r2);\t Catch:{ Exception -> 0x0057, all -> 0x0054 }\n r4 = 1024; // 0x400 float:1.435E-42 double:5.06E-321;\n r4 = new byte[r4];\t Catch:{ Exception -> 0x0052 }\n L_0x0045:\n r5 = r3.read(r4);\t Catch:{ Exception -> 0x0052 }\n r6 = -1;\n if (r5 == r6) goto L_0x0050;\n L_0x004c:\n r9.write(r4, r0, r5);\t Catch:{ Exception -> 0x0052 }\n goto L_0x0045;\n L_0x0050:\n r0 = 1;\n goto L_0x007e;\n L_0x0052:\n r4 = move-exception;\n goto L_0x0070;\n L_0x0054:\n r8 = move-exception;\n r9 = r1;\n goto L_0x008f;\n L_0x0057:\n r4 = move-exception;\n r9 = r1;\n goto L_0x0070;\n L_0x005a:\n r8 = move-exception;\n r9 = r1;\n r3 = r9;\n goto L_0x008f;\n L_0x005e:\n r4 = move-exception;\n r9 = r1;\n r3 = r9;\n goto L_0x0070;\n L_0x0062:\n r4 = move-exception;\n r9 = r1;\n r10 = r9;\n r3 = r10;\n goto L_0x0070;\n L_0x0067:\n r8 = move-exception;\n r9 = r1;\n r3 = r9;\n goto L_0x0090;\n L_0x006b:\n r4 = move-exception;\n r9 = r1;\n r10 = r9;\n r2 = r10;\n r3 = r2;\n L_0x0070:\n r5 = \"DecryptUtils\";\n r6 = \"decryptByPair decrypt hotfix patch file error\";\n r7 = new java.lang.Object[r0];\t Catch:{ all -> 0x008e }\n com.taobao.sophix.e.d.a(r5, r6, r4, r7);\t Catch:{ all -> 0x008e }\n if (r2 == 0) goto L_0x007e;\n L_0x007b:\n r2.delete();\t Catch:{ all -> 0x008e }\n L_0x007e:\n com.taobao.sophix.e.b.a(r10);\n com.taobao.sophix.e.b.a(r3);\n com.taobao.sophix.e.b.a(r9);\n if (r0 == 0) goto L_0x008d;\n L_0x0089:\n r8.delete();\n return r2;\n L_0x008d:\n return r1;\n L_0x008e:\n r8 = move-exception;\n L_0x008f:\n r1 = r10;\n L_0x0090:\n com.taobao.sophix.e.b.a(r1);\n com.taobao.sophix.e.b.a(r3);\n com.taobao.sophix.e.b.a(r9);\n throw r8;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.taobao.sophix.e.a.a(java.io.File, java.lang.String, java.lang.String):java.io.File\");\n }", "void decryptCode() {\n StringBuilder temp = new StringBuilder(\"\");\n\n // go through entire phrase\n for (int i = 0; i < this.getText().length(); ++i) {\n\n // append char to temp if char at i is not a multiple of z\n if (!(i % Character.getNumericValue(this.secretKey.charAt(7)) == 0) || i == 0)\n temp.append(this.getText().charAt(i));\n }\n\n this.setText(temp);\n\n \n // Step 2:\n\n // split phrase up into words\n ArrayList<String> words = new ArrayList<>(Arrays.asList(this.text.toString().split(\" \")));\n\n for (int i = 0; i < words.size(); ++i) {\n\n // if y1x3x4 is at the end of the word, remove it from word\n \n if (words.get(i).substring(words.get(i).length() - 3, words.get(i).length())\n .equals(this.getSecretKey().substring(3, 6)))\n words.set(i, words.get(i).substring(0, words.get(i).length() - 3));\n\n // if x1x2 is at the end of the word\n else {\n // remove x1x2 from end\n words.set(i, words.get(i).substring(0, words.get(i).length() - 2));\n \n // move last char to beginning\n words.set(i, words.get(i).charAt(words.get(i).length() - 1) + words.get(i).substring(0, words.get(i).length() - 1));\n }\n }\n\n temp = new StringBuilder(\"\");\n\n for (String word : words)\n temp.append(word + \" \");\n\n this.setText(temp);\n }", "public String decrypt( String nonce, String ciphertext ) throws Exception\n\t{\n\t\t// read key from file\n\t\tBufferedReader buf = new BufferedReader( new FileReader(keyFile) );\n\t\tString keystr = buf.readLine();\n\t\tbuf.close();\n\n\t\t// create secret key\n\t\tString keyType = \"PBEWithMD5AndDES\";\n\t\tchar[] keyChars = keystr.toCharArray();\n\t\tbyte[] nonceBytes = nonce.getBytes();\n \tSecretKeyFactory factory = SecretKeyFactory.getInstance( keyType );\n \tPBEKeySpec spec = new PBEKeySpec( keyChars, nonceBytes, 1024, 128 );\n \tSecretKey raw = factory.generateSecret( spec );\n \tSecretKey key = new SecretKeySpec( raw.getEncoded(), \"AES\" );\n\n\t\t// decode and decrypt\n\t\tbyte[] decoded = Base64.decodeBase64( ciphertext );\n\t\tCipher cipher = Cipher.getInstance( \"AES/CBC/PKCS5Padding\" );\n\t\tIvParameterSpec params = new IvParameterSpec( nonceBytes );\n\t\tcipher.init( Cipher.DECRYPT_MODE, key, params );\n\t\treturn new String( cipher.doFinal(decoded) );\n\t}", "private static void crypting(boolean encrypt, String filename, String cryptedFilename) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tSystem.out.println(\"Please provide password as hex-encoded text (16 bytes, i.e. 32 hex-digits): \");\n\t\tSystem.out.print(\">\");\n\t\tString keyText = sc.nextLine();\n\n\t\tSystem.out.println(\"Please provide initialization vector as hex-encoded text (32 hex-digits): \");\n\t\tSystem.out.print(\">\");\n\t\tString ivText = sc.nextLine();\n\t\tsc.close();\n\n\t\tSecretKeySpec keySpec = new SecretKeySpec(Util.hextobyte(keyText), \"AES\");\n\t\tAlgorithmParameterSpec paramSpec = new IvParameterSpec(Util.hextobyte(ivText));\n\t\tCipher cipher = null;\n\n\t\ttry {\n\t\t\tcipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n\t\t\tcipher.init(encrypt ? Cipher.ENCRYPT_MODE : Cipher.DECRYPT_MODE, keySpec, paramSpec);\n\n\t\t} catch (NoSuchAlgorithmException | NoSuchPaddingException exc) {\n\t\t\tSystem.out.println(\"Transformation is in invalid format or contains padding scheme that is unavailable. \");\n\t\t\tSystem.exit(1);\n\t\t} catch (InvalidKeyException | InvalidAlgorithmParameterException exc) {\n\t\t\tSystem.out.println(\"Given key or algorithm is invalid for this cipher.\");\n\t\t\tSystem.exit(1);\n\n\t\t}\n\n\t\ttry (InputStream inputStream = new BufferedInputStream(new FileInputStream(filename));\n\t\t\t\tOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(cryptedFilename))) {\n\n\t\t\tint nRead;\n\t\t\tbyte[] buffer = new byte[4096];\n\t\t\tbyte[] inputfile = null;\n\n\t\t\twhile ((nRead = inputStream.read(buffer, 0, buffer.length)) != -1) {\n\t\t\t\tinputfile = cipher.update(buffer, 0, nRead);\n\t\t\t\toutputStream.write(inputfile);\n\t\t\t}\n\n\t\t\tinputfile = cipher.doFinal();\n\t\t\toutputStream.write(inputfile);\n\n\t\t} catch (FileNotFoundException exc) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"File does not exist, is a directory rather than a regular file, or cannot be opened for reading because of some other reason. \");\n\t\t\tSystem.exit(1);\n\n\t\t} catch (IOException exc) {\n\t\t\tSystem.out.println(\"Input stream couldn't be initialized.\");\n\t\t\tSystem.exit(1);\n\n\t\t} catch (IllegalBlockSizeException | BadPaddingException e) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"Encryption algorithm is unable to process the input data provided or the decrypted data is not bounded by the appropriate padding bytes. \");\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\tif (encrypt) {\n\t\t\tSystem.out.printf(\"Encryption completed. Generated file %s based on file %s.\\n\", cryptedFilename, filename);\n\t\t} else {\n\t\t\tSystem.out.printf(\"Decryption completed. Generated file %s based on file %s.\\n\", cryptedFilename, filename);\n\t\t}\n\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 void breakVigenere(int keyLength) {\n FileResource fr = new FileResource();\n String s = fr.asString();\n int[] key = tryKeyLength(s, keyLength, 'e');\n VigenereCipher vc = new VigenereCipher(key);\n String msg = vc.decrypt(s);\n System.out.println(msg);\n }", "public static String decryptCaesar(String encryptedText, int key) {\r\n\t\t// copying plaintext into char array.\r\n\t\tchar[] ipArr = encryptedText.toCharArray();\r\n\t\tchar[] opArr = new char[ipArr.length];\r\n\t\tint tmp = '0';\r\n\t\twhile(key > RANGE)\r\n\t\t{\r\n\t\t\tkey=key-RANGE;\r\n\t\t}\t\t\t\r\n\t\tfor (int i = 0; i < ipArr.length; i++) {\r\n\t\t\t\r\n\t\t\t\ttmp = (ipArr[i]+RANGE)-key;\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t\tif(tmp>UPPER_BOUND) \r\n\t\t\t\t{\r\n\t\t\t\t\ttmp=tmp-RANGE;\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tif(tmp<LOWER_BOUND) \r\n\t\t\t\t{\r\n\t\t\t\t\ttmp=tmp+RANGE;\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\topArr[i]=(char)tmp;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\treturn new String(opArr);\r\n\t}", "public String decrypt(String cipherText);", "public String decrypt(String text) {\n byte[] dectyptedText = null;\n try {\n // decrypt the text using the private key\n cipher.init(Cipher.DECRYPT_MODE, publicKey);\n byte[] data=Base64.decode(text, Base64.NO_WRAP);\n String str=\"\";\n for(int i=0;i<data.length;i++)\n {\n str+=data[i]+\"\\n\";\n }\n android.util.Log.d(\"ali\",str);\n dectyptedText = cipher.doFinal(Base64.decode(text, Base64.NO_WRAP));\n return new String(dectyptedText);\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n return null;\n }", "public void desencriptarArchivo (String rutaEncriptado, String key, String ruta) throws Exception{\n \n FileInputStream fileInputStream = null;\n File file = new File(rutaEncriptado);\n byte[] archivoEnBytes = new byte[(int) file.length()];\n fileInputStream = new FileInputStream(file);\n fileInputStream.read(archivoEnBytes);\n \n // Llamada a libreria de encriptacion\n byte[] decrypted = decrypt(archivoEnBytes,key);\n \n try {\n // Generacion del archivo desencriptado\n Path archivo = Paths.get(ruta);\n Files.write(archivo, decrypted);\n } catch (IOException e) {\n e.printStackTrace();\n } \n \n }", "public static void decryptFile(File file, String pass) throws GeneralSecurityException, IOException {\n\t\tbyte[] encData;\n\t\tbyte[] decData;\n\n\t\tCipher cipher = FileEncryptor.makeCipher(pass, false);\n\t\tif (cipher == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tFile inFile = new File(file.getAbsolutePath() + \".tmp\");\n\t\tcopy(file.toPath(), inFile.toPath());\n\t\tFileInputStream inStream = new FileInputStream(inFile);\n\t\tencData = new byte[(int) inFile.length()];\n\t\tinStream.read(encData);\n\t\tinStream.close();\n\t\tdecData = cipher.doFinal(encData);\n\n\t\tint padCount = (int) decData[decData.length - 1];\n\n\t\tif (padCount >= 1 && padCount <= 8) {\n\t\t\tdecData = Arrays.copyOfRange(decData, 0, decData.length - padCount);\n\t\t}\n\n\t\tFileOutputStream target = new FileOutputStream(inFile);\n\t\ttarget.write(decData);\n\t\ttarget.close();\n\t}", "@Override\n\tpublic void Decrypt(Object key) {\n\n\t}", "public static String decryptText(byte[] byteCipherText, SecretKey secKey) throws Exception {\n\r\n Cipher aesCipher = Cipher.getInstance(\"AES\");\r\n\r\n aesCipher.init(Cipher.DECRYPT_MODE, secKey);\r\n\r\n byte[] bytePlainText = aesCipher.doFinal(byteCipherText);\r\n\r\n return new String(bytePlainText);\r\n\r\n}", "void decryptFile(String inPath, String outPath) throws IOException {\n try (BufferedReader reader = new BufferedReader(new FileReader(inPath))) {\n try (PrintWriter writer = new PrintWriter(outPath)) {\n decryptFile(reader, writer);\n } catch (FileNotFoundException e) {\n System.out.println(\"Error: Output file not found\");\n }\n } catch (FileNotFoundException e) {\n System.out.println(\"Error: Input file not found\");\n }\n }", "public Decryption(int key)\n {\n // initialise instance variables\n shiftKey = key;\n generateCipher();\n }", "private static void crypto(String filePath1, String filePath2) {\n\n\t\t// Retrieve the cipher\n\t\tCipher cipher;\n\t\ttry {\n\t\t\tcipher = obtainCipher();\n\n\t\t} catch (InvalidKeyException | InvalidAlgorithmParameterException | NoSuchAlgorithmException\n\t\t\t\t| NoSuchPaddingException e) {\n\t\t\tSystem.out.println(\"Exception while obtaining cypher: \" + e.getMessage());\n\t\t\treturn;\n\t\t}\n\n\t\tPath p = Paths.get(filePath1);\n\t\tPath p2 = Paths.get(filePath2);\n\n\t\t// Open the file input and output stream\n\t\ttry (InputStream is = Files.newInputStream(p); OutputStream os = Files.newOutputStream(p2)) {\n\t\t\tbyte[] buff = new byte[4096];\n\n\t\t\twhile (true) {\n\t\t\t\tint r = is.read(buff);\n\n\t\t\t\tif (r == -1) {\n\t\t\t\t\t// Finishing the cipher\n\t\t\t\t\ttry {\n\t\t\t\t\t\tos.write(cipher.doFinal());\n\t\t\t\t\t} catch (IllegalBlockSizeException | BadPaddingException e) {\n\t\t\t\t\t\tSystem.out.println(\"Exception while finalizaing cipher: \" + e.getMessage());\n\t\t\t\t\t\tSystem.exit(1);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Update cipher and write into new file\n\t\t\t\tos.write(cipher.update(buff, 0, r));\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Exception while opening the file: \" + e.getMessage());\n\t\t\tSystem.exit(1);\n\n\t\t}\n\n\t\tSystem.out.println((encrypt ? \"Encryption\" : \"Decryption\") + \" completed. Generated file \" + filePath2\n\t\t\t\t+ \" based on file \" + filePath1 + \".\");\n\n\t}", "public byte[] decrypt3DES(byte[] key, byte[] data) {\n\n try {\n\n //method def in javadoc\n //arraycopy(Object src, int srcPos, Object dest, int destPos, int length)\n byte[] keyToUse = new byte[24];\n //Pad the key if not yet 24 bytes\n if (key.length == 8) {\n System.arraycopy(key, 0, keyToUse, 0, 8);\n System.arraycopy(key, 0, keyToUse, 8, 8);\n System.arraycopy(key, 0, keyToUse, 16, 8);\n } else if (key.length == 16) {\n System.arraycopy(key, 0, keyToUse, 0, 8);\n System.arraycopy(key, 0, keyToUse, 8, 8);\n System.arraycopy(key, 0, keyToUse, 16, 8);\n }\n\n System.out.println(\"The final Key used for 3DES decryption is\\t\" + ConvertUtils.bytesToHex(keyToUse));\n\n SecretKey secretKey;\n //byte[] keyByte = key.getBytes(\"UTF-8\");\n SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(\"DESede\");\n DESedeKeySpec desedeKeySpec = new DESedeKeySpec(keyToUse);\n\n secretKey = keyFactory.generateSecret(desedeKeySpec);\n\n secretKey = keyFactory.translateKey(secretKey);\n\n Cipher cipher = Cipher.getInstance(\"DESede/ECB/NoPadding\");\n\n //Used as the Initialition vector for CBC mode(variable no used)\n //gives the same result with ECB mode when 16 0s are used\n IvParameterSpec ivp = new IvParameterSpec(ConvertUtils.hexToBytes(\"0000000000000000\"));\n\t\t\t//CBC mode\n //cipher.init(Cipher.DECRYPT_MODE,secretKey,ivp);\n\n //ECB mode\n cipher.init(Cipher.DECRYPT_MODE, secretKey);\n\n ByteArrayOutputStream bos;\n CipherOutputStream cipherOS;\n\n bos = new ByteArrayOutputStream();\n cipherOS = new CipherOutputStream(bos, cipher);\n cipherOS.write(data);\n cipherOS.flush();\n cipherOS.close();\n\n byte[] bytesDecrypted = bos.toByteArray();\n System.out.println(\"Encryption length is\\t\" + bytesDecrypted.length + ConvertUtils.bytesToHex(bytesDecrypted));\n\n return bytesDecrypted;\n } catch (UnsupportedEncodingException ex) {\n System.out.println(\"UnsupportedEncodingException\\t\" + ex.getMessage());\n } catch (NoSuchAlgorithmException ex) {\n System.out.println(\"NoSuchAlgorithmException\\t\" + ex.getMessage());\n } catch (InvalidKeySpecException ex) {\n ex.printStackTrace(System.out);\n System.out.println(\"InvalidKeySpecException\\t\" + ex.getMessage());\n } catch (InvalidKeyException ex) {\n System.out.println(\"InvalidKeyException\\t\" + ex.getMessage());\n }/*catch(IllegalBlockSizeException ex)\n {\n System.out.println(\"IllegalBlockSizeException\\t\"+ex.getMessage());\n }catch(BadPaddingException ex){\n System.out.println(\"BadPaddingException\\t\"+ex.getMessage());\n }*/ catch (NoSuchPaddingException ex) {\n System.out.println(\"NoSuchPaddingException\\t\" + ex.getMessage());\n } catch (IOException ex) {\n System.out.println(\"IOException\\t\" + ex.getMessage());\n }\n return null;\n }", "public static void dec(String cipherText, String key) {\n char msg[] = cipherText.toCharArray();\n int msglen = msg.length;\n int i,j;\n \n // Creating new char arrays\n char keygenerator[] = new char[msglen];\n char encMsg[] = new char[msglen];\n char decdMsg[] = new char[msglen];\n \n /* Generate key, using keyword in cyclic manner equal to the length of original message i.e plaintext */\n for(i = 0, j = 0; i <msglen; ++i, ++j)\n {\n if(j == key.length() - 1)\n {\n j = 0;\n }\n keygenerator[i] = key.charAt(j);\n }\n \n //Decryption\n for(i = 0; i < msglen; ++i) {\n decdMsg[i] = (char)((((encMsg[i] - keygenerator[i]) + 26) % 26) + 'A');\n }\n\n System.out.println(\"Decrypted Message: \" + String.valueOf(decdMsg));\n }", "public ArrayList<Integer> decryptCycle() {\r\n\r\n for (int i = 0; i < 416; i++) {\r\n for (int j = 0; j < 8; j++) {\r\n pulse();\r\n }\r\n updateDecrypt();\r\n }\r\n return ciphertext;\r\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 }", "void updateDecrypt() {\r\n\r\n for (int i = 0; i < 56; i++) {\r\n queue.set(i, queue.get(i + 8));\r\n }\r\n\r\n //adding results of plaintext XOR keystream to ciphertext\r\n ciphertext.addAll(xor(plaintext, keystream));\r\n\r\n //takes last 8 bits of ciphertext and copies to right 8 bits in queue \r\n int ciphertextIndexOfLast = ciphertext.size();\r\n\r\n //notice here the bits being pushed into queue are from the ciphertext generated during encryption. although the information\r\n //is stored in a variable named \"plaintext,\" the encrypted ciphertext is what was actually passed into that plaintext variable\r\n //for decryption\r\n for (int i = ciphertextIndexOfLast - 8; i < ciphertextIndexOfLast; i++) {\r\n queue.set((i - ((ciphertextIndexOfLast - 8)) + 56), plaintext.get(i));\r\n }\r\n\r\n //using the new queue, populates registers with new data\r\n resetRegisters(queue);\r\n\r\n }", "public String Decrypt(String Message, int PrimeNo, String EncoderKeyPath) throws IOException\r\n {\r\n Scanner sc = new Scanner(System.in);\r\n Key key1 = new Key();\r\n char[] msg=new char[Message.length()];\r\n int s, x;\r\n System.out.println(\"Enter Your Secret Key To Decode \");\r\n x=sc.nextInt();\r\n int key = key1.Skey(PrimeNo, x, EncoderKeyPath);\r\n char s1;\r\n int len=Message.length();\r\n int res=0;\r\n\tfor(int i=0;i<len;i++)\r\n\t{\r\n res=i%key;\r\n s=Message.charAt(i);\r\n s-=res;\r\n s1= (char) s;\r\n msg[i]=s1;\t\r\n\t}\r\n String msg1 = new String(msg);\r\n return msg1; \r\n }", "String decrypt(String text) {\n\t\tchar letter;\n\t\tString finalString = \"\";\t\t\t\t\t// slutliga klartexten\n\t\tint start = key.getStart();\t\t\t\t\t// deklarerar nyckelns startläge\n\t\tint k ;\t\t\t\t\t\t\t\t\t\t// variabel för bokstavens startläge i vanliga alfabetet\n\t\tStringBuilder sb = new StringBuilder();\t\t\t\t\t// skapar en stringbuilder som kan modifieras, bygger upp textsträngar av olika variabler\n\t\t\t\t\t\t\n\t\t// loopen går igenom alla tecken i min krypterade text \t\t\t\n\t\tfor(int i = 0; i < text.length(); i++) {\t\t\t// for-loop för att gå igenom hela texten\t\t\t\t\n\t\t\tletter = text.charAt(i);\t\t\t\t\t\t// ger bokstaven på platsen 0,1,2,3.....\n\t\t\tif(letter == ' ') {\t\t\t\t\t\t\t\t// om det är ett blanktecken så ska det vara ett blanktecken\n\t\t\t\tsb.append(' ');\t\t\t\t\t\t\t\t// sparar blanksteg i en stringBuilder\n\t\t\t} else {\n\t\t\t\tint index=0;\n\t\t\t\tstart=start%26;\t\t\t\t\t\t\t\t// vi behöver endast 26 värden\n\t\t\t\tkey.getStart();\n\n\t\t\t\t\n\t\t\t\twhile(index<26 &&(letter!=key.getLetter(index))) {\t\t// så länge som chiffret inte motsvarar förskjutningen\n\t\t\t\t\tindex++;\t\t\t\t\t\t\t\t\t\t\t// så fortsätter den leta\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tk=index-start;\n\t\t\t\t\n\t\t\t\tif(k>=0)\n\t\t\t\t\tletter=(char)('A'+k);\n\t\t\t\telse letter=(char)('Z'-(start-1-index));\t\t\t\t// räknar från index, om index mindre än start så räknar den bakåt\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// så att det inte blir tokigt mellan Z och A.\n\t\t\t\t\n\t\t\t\tsb.append(letter);\t\t\t\t\t\t\t\t\t\t//lagrar bokstav i stringBuilder\n\t\t\t\tstart++;\t\t\t\t\t\t\t\t\t\t\t\t//chiffret börjar om\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\n\t\t\t}\n\t\treturn sb.toString();\t\t\t\t\t\t\t\t\t\t// returnerar sluttexten\n\t\t}", "@Test\r\n public void testDecrypt()\r\n {\r\n System.out.println(\"decrypt\");\r\n String input = \"0fqylTncsgycZJQ+J5pS7v6/fj8M/fz4bavB/SnIBOQ=\";\r\n KeyMaker km = new KeyMaker();\r\n SecretKeySpec sks = new SecretKeySpec(km.makeKeyDriver(\"myPassword\"), \"AES\");\r\n EncyptDecrypt instance = new EncyptDecrypt();\r\n String expResult = \"Hello how are you?\";\r\n String result = instance.decrypt(input, sks);\r\n assertEquals(expResult, result);\r\n }", "public static String decryptCaesar(String encryptedText, int key) {\r\n\t\t// Variables\r\n\t\tString decrypted = \"\"; // Decrypted text string, needs to be built character by character\r\n\t\t\r\n\t\t// Loops\r\n\t\tfor (int i = 0; i < encryptedText.length(); i++) {\r\n\t\t\tchar c = encryptedText.charAt(i); // Encrypted character at index i of string encryptedText\r\n\t\t\tint dc = (int)c - key;\r\n\t\t\t\r\n\t\t\t// Loops\r\n\t\t\twhile (dc < LOWER_BOUND) { dc += RANGE; }\r\n\t\t\t\r\n\t\t\t// Append to string\r\n\t\t\tdecrypted += (char) dc;\r\n\t\t}\r\n\t\t\r\n\t\t// Return\r\n\t\treturn decrypted;\r\n\t}", "OutputFile encryptingOutputFile();", "public void readPrivateKey(String filename) {\n FileHandler fh = new FileHandler();\n Map<String, BigInteger> skMap= fh.getKeyFromFile(filename);\n this.n = skMap.get(\"n\");\n this.d = skMap.get(\"key\");\n }", "@SuppressWarnings(\"static-method\")\r\n\tprivate List<String> decrypt(final List<String> encryptedLines)\r\n\t{\r\n\t\tfinal List<String> decryptedLines = new ArrayList<String>();\r\n\t\tchar[] plainChars = null;\r\n\t\tchar[] encryptedChars = null;\r\n\r\n\t\tfor (final String line : encryptedLines)\r\n\t\t{\r\n\t\t\tencryptedChars = line.toCharArray();\r\n\t\t\tplainChars = new char[encryptedChars.length];\r\n\r\n\t\t\tfor (int i = 0; i < encryptedChars.length; i++)\r\n\t\t\t\tplainChars[i] = (char) ((encryptedChars[i] - encryptedLines.size()) - encryptedChars.length);\r\n\r\n\t\t\tdecryptedLines.add(new String(plainChars));\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Decrypted.\");\r\n\r\n\t\treturn decryptedLines;\r\n\t}", "public String tableDecrypt(String ciphertext, String key) {\n\t\treturn AESMain2.AESDecrypt(ciphertext, key);\n\t}", "public static String decryptCaesar(String encryptedText, int key) {\r\n\t\tchar [] eText = encryptedText.toCharArray();\r\n\t\tchar [] pText = new char[encryptedText.length()];\r\n\t\t\r\n\t\tint i = 0;\r\n\t\tdo {\r\n\t\t\tfor(char t: eText) {\r\n\t\t\t\t\r\n\t\t\t\tt -=key;\r\n\t\t\t\tpText[i] = t;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t}while(i<encryptedText.length());\r\n\t\tString st = String.valueOf(pText);\r\n\t\treturn st;\r\n\t}", "public byte[] Tdecryption() {\n int[] plaintext = new int[message.length];\n\n for (int j = 0, k = 1; j < message.length && k < message.length; j = j + 2, k = k + 2) {\n sum = delta << 5;\n l = message[j];\n r = message[k];\n for (int i = 0; i < 32; i++) {\n r = r - (((l << 4) + key[2]) ^ (l + sum) ^ ((l >> 5) + key[3]));\n l = l - (((r << 4) + key[0]) ^ (r + sum) ^ ((r >> 5) + key[1]));\n sum = sum - delta;\n }\n plaintext[j] = l;\n plaintext[k] = r;\n }\n return this.Inttobyte(plaintext);\n }", "private void blockDecrypt (byte[] in, int off, byte[] out, int outOff) {\n int L = (in[off++] & 0xFF) << 24 |\n (in[off++] & 0xFF) << 16 |\n (in[off++] & 0xFF) << 8 |\n in[off++] & 0xFF;\n int R = (in[off++] & 0xFF) << 24 |\n (in[off++] & 0xFF) << 16 |\n (in[off++] & 0xFF) << 8 |\n in[off ] & 0xFF;\n int a;\n\n for (int i = ROUNDS; i > 0;) { // subkeys in reverse order\n a = R ^ sKey[--i];\n L ^= P[S[ a & 0xFFF] & 0xFF] |\n P[S[(a >>> 8) & 0xFFF] & 0xFF] << 1 |\n P[S[(a >>> 16) & 0xFFF] & 0xFF] << 2 |\n P[S[(a >>> 24 | a << 8) & 0xFFF] & 0xFF] << 3;\n\n a = L ^ sKey[--i];\n R ^= P[S[ a & 0xFFF] & 0xFF] |\n P[S[(a >>> 8) & 0xFFF] & 0xFF] << 1 |\n P[S[(a >>> 16) & 0xFFF] & 0xFF] << 2 |\n P[S[(a >>> 24 | a << 8) & 0xFFF] & 0xFF] << 3;\n }\n out[outOff++] = (byte)(R >>> 24);\n out[outOff++] = (byte)(R >>> 16);\n out[outOff++] = (byte)(R >>> 8);\n out[outOff++] = (byte) R;\n out[outOff++] = (byte)(L >>> 24);\n out[outOff++] = (byte)(L >>> 16);\n out[outOff++] = (byte)(L >>> 8);\n out[outOff ] = (byte) L;\n }", "private boolean decryptFile(File file) {\n try {\n // ===================================\n // Extract data from file\n byte[] fileBytes = FileUtil.readFile(file);\n int numberOfHeaders = new BigInteger(Arrays.copyOfRange(fileBytes, 0, Constants.HEADERS_NUMBER_FLAG_LENGTH)).intValue();\n byte[] data = Arrays.copyOfRange(fileBytes, Constants.HEADERS_NUMBER_FLAG_LENGTH, fileBytes.length);\n\n // ===================================\n // Iterate over the headers\n Header header = null;\n for(int i = 0; i <= numberOfHeaders && header == null; i++) {\n byte[] encryptedHeader = byteRange(data,i * Constants.HEADER_LENGTH, Constants.HEADER_LENGTH + (i * Constants.HEADER_LENGTH));\n // Decrypt header\n header = decryptHeader(encryptedHeader);\n }\n\n // ===================================\n // Extract the body\n if(header != null) {\n byte[] encryptedBody = byteRange(data, Constants.HEADER_LENGTH * numberOfHeaders, data.length);\n // Decrypt body\n Body body = decryptBody(header, encryptedBody);\n\n // Create the file\n FileUtil.writeFile(destination + File.separator + body.nameFile + \".decrypted\", body.body);\n return true;\n }\n\n return false;\n } catch (Exception e) {\n e.printStackTrace();\n return false;\n }\n }", "@Override\n\tpublic String decryptAES(byte[] key, String cipherText) {\n\t\ttry{\n\t\t\tbyte[] encryptedIvTextBytes = DatatypeConverter.parseHexBinary(cipherText);\n\t int ivSize = 16;\n\n\t byte[] iv = new byte[ivSize];\n\t System.arraycopy(encryptedIvTextBytes, 0, iv, 0, iv.length);\n\t IvParameterSpec ivParameterSpec = new IvParameterSpec(iv);\n\t int encryptedSize = encryptedIvTextBytes.length - ivSize;\n\t byte[] encryptedBytes = new byte[encryptedSize];\n\t System.arraycopy(encryptedIvTextBytes, ivSize, encryptedBytes, 0, encryptedSize);\n\t SecretKeySpec secretKeySpec = new SecretKeySpec(key, \"AES\");\n\t Cipher cipherDecrypt = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n\t cipherDecrypt.init(Cipher.DECRYPT_MODE, secretKeySpec, ivParameterSpec);\n\t byte[] decrypted = cipherDecrypt.doFinal(encryptedBytes);\n\n\t return new String(decrypted);\n\t\t}catch(Exception e) {\n\t\t\t\n\t\t}\n\t\treturn null;\n\t}", "public static String decrypt(String encrypted, Keys keys) throws GeneralSecurityException {\n Cipher cipher = Cipher.getInstance(ENC_SYSTEM);\n String[] data = COLON.split(encrypted);\n if (data.length != 3) {\n throw new GeneralSecurityException(\"Invalid encrypted data!\");\n }\n String mac = data[0];\n String iv = data[1];\n String cipherText = data[2];\n\n // Verify that the ciphertext and IV haven't been tampered with first\n String dataToAuth = iv + \":\" + cipherText;\n if (!computeMac(dataToAuth, keys.getMacKey()).equals(mac)) {\n throw new GeneralSecurityException(\"Incorrect MAC!\");\n }\n\n // Decrypt the ciphertext\n byte[] ivBytes = decodeBase64(iv);\n cipher.init(Cipher.DECRYPT_MODE, keys.getEncKey(), new IvParameterSpec(ivBytes));\n byte[] bytes = cipher.doFinal(decodeBase64(cipherText));\n\n // Decode the plaintext bytes into a String\n CharsetDecoder decoder = Charset.defaultCharset().newDecoder();\n decoder.onMalformedInput(CodingErrorAction.REPORT);\n decoder.onUnmappableCharacter(CodingErrorAction.REPORT);\n /*\n * We are coding UTF-8 (guaranteed to be the default charset on\n * Android) to Java chars (UTF-16, 2 bytes per char). For valid UTF-8\n * sequences, then:\n * 1 byte in UTF-8 (US-ASCII) -> 1 char in UTF-16\n * 2-3 bytes in UTF-8 (BMP) -> 1 char in UTF-16\n * 4 bytes in UTF-8 (non-BMP) -> 2 chars in UTF-16 (surrogate pair)\n * The decoded output is therefore guaranteed to fit into a char\n * array the same length as the input byte array.\n */\n CharBuffer out = CharBuffer.allocate(bytes.length);\n CoderResult result = decoder.decode(ByteBuffer.wrap(bytes), out, true);\n if (result.isError()) {\n /* The input was supposed to be the result of encrypting a String,\n * so something is very wrong if it cannot be decoded into one! */\n throw new GeneralSecurityException(\"Corrupt decrypted data!\");\n }\n decoder.flush(out);\n return out.flip().toString();\n }", "@Override\n public InputStream decrypt(InputStream in, DecryptionKey privateKey) throws IOException {\n byte[] keyLenBytes = new byte[4];\n int triesLeft = 10;\n for (int i = 0; i < 4; i++) {\n while (in.read(keyLenBytes, i, 1) < 1 && --triesLeft > 0) {\n ;\n }\n }\n if (triesLeft == 0)\n throw new IOException(\"didn't get keylen data from ciphertext\");\n int keyLen = ByteBuffer.wrap(keyLenBytes).getInt();\n\n //Deserialize the encapsulated key\n byte[] encapsulatedKeyBytes = new byte[keyLen];\n triesLeft = 10;\n for (int i = 0; i < keyLen; i++) {\n while (in.read(encapsulatedKeyBytes, i, 1) < 1 && --triesLeft > 0) {\n ; //TODO: don't read byte by byte...\n }\n }\n if (triesLeft == 0)\n throw new IOException(\"couldn't read encapulated key from ciphertext\");\n CipherText encapsulatedKey =\n kem.restoreEncapsulatedKey(new JSONConverter().deserialize(new String(encapsulatedKeyBytes)));\n\n //decaps the encapsulated key\n SymmetricKey symmetricKey = kem.decaps(encapsulatedKey, privateKey);\n\n //Return a stream where caller can read the decrypted payload\n return symmetricScheme.decrypt(in, symmetricKey);\n }", "void decrypt(ChannelBuffer buffer, Channel c);", "static void encryptECB(String filename, String key) {\n try {\n Scanner s = new Scanner(new File(filename + EXT), \"UTF-8\");\n File newFile = new File(filename + \"_ECB\" + EXT);\n newFile.delete();\n newFile.createNewFile();\n PrintWriter w = new PrintWriter(newFile);\n processHeader(s, w);\n while (s.hasNext()) {\n readBlock(s);\n block = stateToBits(AES.encrypt(bitsToHexString(block), key));\n writeBlock(w);\n }\n w.flush();\n w.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public byte[] decrypt(byte[] data, int token, String pin) \n\t\tthrows SignedDocException;", "private void readKeyDataToIdentifyTransactions(){\n\t\t\n\t\tBufferedReader reader = null;\n\t\t\n\t\ttry{\n\t\t\treader = new BufferedReader(new FileReader(keyFile));\n\t\t\tString line;\n\t\t\twhile((line = reader.readLine()) != null){\n\t\t\t\tif((line.startsWith(\"#\")) || (line.equals(\"\")))\n\t\t\t\t\tcontinue;\n\t\t\t\telse{\n\t\t\t\t\tString transacName = line.split(\";\")[0];\n\t\t\t\t\tchar transacType = line.split(\";\")[1].charAt(0);\n\t\t\t\t\ttypeTransData.put(transacName,transacType);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\treader.close();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(\"Sorry!! \"+ keyFile +\" required for processing!!!\");\n\t\t\tSystem.out.println(\"Please try again !!!\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t}", "@Test\r\n\tpublic void testSimple() throws IOException, URISyntaxException, IllegalKeyException{\r\n\t\tbyte data [] = {97,98,99,100};\r\n\t\tbyte [] keys = {50};\r\n\t\tEncryptionDecryptionManager man = new AlgoritemManaging();\r\n\t\tCaesarEncryption ce = new CaesarEncryption(man);\r\n\t\tbyte[] encData = ce.Encrypt(keys,data);\r\n\t\t\r\n\t\tCaesarDecryption c = new CaesarDecryption(man);\r\n\t\tbyte[] decData = c.Decrypt(keys,encData);\r\n\t\tassert decData [0] == (byte)(97);\r\n\t\tassert decData [1] == (byte)(98);\r\n\t\tassert decData [2] == (byte)(99);\r\n\t\tassert decData [3] == (byte)(100);\r\n\t}", "public static String decryptString(String text, int key) {\r\n String decryptedText = \"\";\r\n String alpha = shiftAlphabet(0);\r\n String newAlpha = shiftAlphabet(key);\r\n text = ungroupify(text);\r\n for (int i = 0; i < text.length(); i++) {\r\n String currentLetter = String.valueOf(text.charAt(i));\r\n int indexOfLetter = newAlpha.indexOf(currentLetter);\r\n String letterReplacement = String.valueOf(alpha.charAt(indexOfLetter));\r\n decryptedText += letterReplacement;\r\n\r\n }\r\n return decryptedText;\r\n }", "private static String decrypt(String in){\n\n\t\t\tString alphabet = \"1234567890\";\n\n\t\t\tString scramble1 = \"<;\\'_$,.?:|)\";\n\t\t String scramble2 = \"XYZVKJUTHM\";\n\t\t String scramble3 = \"tuvwxyz&*}\";\n\t\t String scramble4 = \"~!-+=<>%@#\";\n\t\t String scramble5 = \"PUDHCKSXWZ\";\n\n\t\t char messageIn[] = in.toCharArray();\n\t\t String r = \"\";\n\n\t\t for(int i = 0; i < in.length(); i++){\n\t\t if(i % 3 == 0){\n\t\t int letterIndex = scramble1.indexOf(in.charAt(i));\n\t\t r += alphabet.charAt(letterIndex);\n\t\t }else if (i % 3 == 1){\n\t\t int letterIndex = scramble2.indexOf(in.charAt(i));\n\t\t r += alphabet.charAt(letterIndex);\n\t\t }else if (i % 3 == 2){\n\t\t int letterIndex = scramble3.indexOf(in.charAt(i));\n\t\t r += alphabet.charAt(letterIndex);\n\t\t }\n\t\t }\n\t\treturn r;\n\t}", "public static int[] teaDecrypt(int[] cipherText) {\n int mult = 255 / 32;\n int l = cipherText[0];\n int r = cipherText[1];\n int sum = DELTA << 5;\n \n for(int i = 0; i < 32; i++) {\n r -= ((l << 4) + KEY) ^ (l + sum) ^ ((l >> 5) + KEY);\n l -= ((r << 4) + KEY) ^ (r + sum) ^ ((r >> 5) + KEY);\n sum -= DELTA;\n }\n int[] plainText = {l, r};\n return plainText;\n }", "public static String[] decryptAESBlock(byte[] data) {\n byte[] decrypted = CryptoUtil.decryptAESCBC(AES_DATA_KEY_BYTES, data);\n if (decrypted == null) {\n throw new RuntimeException(\"Failed to decrypt\");\n }\n\n int offset = 0;\n String[] result = new String[5];\n result[0] = HexUtil.byteArrayToHexString(decrypted, offset, 4);\n offset += 4;\n result[1] = HexUtil.byteArrayToHexString(decrypted, offset, 16);\n offset += 16;\n\n int index = -1;\n while (offset < decrypted.length && decrypted[offset] != 0) {\n int c = decrypted[offset] & 0xff;\n\n switch (c) {\n case 0xF1: {\n index = 2;\n result[index] = \"\";\n break;\n }\n case 0xF2: {\n index = 3;\n result[index] = \"\";\n break;\n }\n case 0xF3: {\n index = 4;\n result[index] = \"\";\n break;\n }\n default: {\n if (index != -1) {\n result[index] += (char) c;\n }\n }\n }\n offset++;\n }\n\n if (offset >= (decrypted.length - 2) || decrypted[offset] != 0\n || CryptoUtil.crcccit(decrypted, 0, offset + 1) != (((decrypted[offset + 1] & 0xff) << 8)) + (decrypted[offset + 2] & 0xff)) {\n throw new RuntimeException(\"Wrong key\");\n }\n\n return result;\n }", "private String teaDecrypt(String ciphertext, String password) {\n if (ciphertext.length() == 0) {\n return (\"\");\n }\n int[] v = hexStrToLongs(ciphertext);\n int[] k = strToLongs(password.substring(0, 16).toLowerCase());\n int n = v.length;\n\n // int z = v[n - 1], y = v[0], delta = 0x9E3779B9;\n // int mx, e, q = (int) Math.floor(6 + 52 / n), sum = q * delta;\n int z = v[n - 1];\n int y = v[0];\n int delta = 0x9E3779B9;\n int mx;\n int e;\n int q = (int) Math.floor(6 + 52 / n);\n int sum = q * delta;\n\n while (sum != 0) {\n e = sum >>> 2 & 3;\n for (int p = n - 1; p >= 0; p--) {\n z = v[p > 0 ? p - 1 : n - 1];\n mx = (z >>> 5 ^ y << 2) + (y >>> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z);\n y = v[p] -= mx;\n }\n sum -= delta;\n }\n\n String plaintext = longsToStr(v);\n\n // strip trailing null chars resulting from filling 4-char blocks:\n\n return plaintext;\n }", "@Test\n public void testEncryptDecrypt3() throws InvalidCipherTextException {\n\n // password generation using KDF\n String password = \"Aa1234567890#\";\n byte[] kdf = Password.generateKeyDerivation(password.getBytes(), 32);\n\n byte[] plain = \"0123456789\".getBytes();\n byte[] plainBytes = new byte[100000000];\n for (int i = 0; i < plainBytes.length / plain.length; i++) {\n System.arraycopy(plain, 0, plainBytes, i * plain.length, plain.length);\n }\n\n byte[] encData = AESEncrypt.encrypt(plainBytes, kdf);\n byte[] plainData = AESEncrypt.decrypt(encData, kdf);\n\n assertArrayEquals(plainBytes, plainData);\n\n }", "@Override\n public void decrypt() {\n algo.decrypt();\n String cypher = vigenereAlgo(false);\n this.setValue(cypher);\n }", "public String decode(String cipherText){\n String decodedMsg = cipherText;\n for(int i=0;i<n;i++)\n decodedMsg = reShuffle(decodedMsg);\n return decodedMsg;\n }", "private void decrypt(final String path, final String password) {\r\n File file = null;\r\n if (path.contains(Environment.getExternalStorageDirectory().getAbsolutePath())) {\r\n file = new File(path);\r\n } else {\r\n file = new File(Environment.getExternalStorageDirectory(), path);\r\n }\r\n System.out.println(file.getAbsolutePath());\r\n\r\n if (!file.exists()) {\r\n showUserInfo(\"file / folder doesn't exist\");\r\n return;\r\n }\r\n\r\n if (password.isEmpty()) {\r\n showUserInfo(\"password cant be empty\");\r\n return;\r\n }\r\n\r\n if (file.isDirectory()) {\r\n for (File child : file.listFiles()) {\r\n decrypt(child.getAbsolutePath(), password);\r\n }\r\n } else /* file isn't directory */ {\r\n try {\r\n CryptoWrapper.DecryptFileWithPassword(file, password);\r\n } catch (Throwable e) {\r\n showUserInfo(e.getClass().getSimpleName() + \": \" + e.getMessage());\r\n e.printStackTrace();\r\n }\r\n }\r\n }", "public static void main(String[] args) throws Exception{\n Key chave;\r\n //Ler a chave do arquivo Chave.key\r\n ObjectInputStream in = \r\n new ObjectInputStream(new FileInputStream(\"Chave.key\"));\r\n chave = (Key)in.readObject();\r\n in.close(); \r\n //Definir qual cifra será usada (DES)\r\n Cipher cipher = Cipher.getInstance(\"DES/ECB/PKCS5Padding\");\r\n cipher.init(Cipher.ENCRYPT_MODE, chave);\r\n \r\n System.out.println(\"Digite uma mensagem a ser cifrada: \");\r\n String mensagem = new java.util.Scanner(System.in).nextLine();\r\n \r\n byte[] bytesMensagem = mensagem.getBytes(\"UTF8\");\r\n \r\n byte[] dadosCifrados = cipher.doFinal(bytesMensagem);\r\n \r\n System.out.println(new String(dadosCifrados));\r\n }", "@Test\n\tpublic void testDecrypt() throws GeneralSecurityException, IOException {\n\t\tString cipher = \"4VGdDR9qJlq36bQGI+Sx3A==\";\n\t\tString key = \"io.github.odys-z\";\n\t\tString iv = \"DITVJZA2mSDAw496hBz6BA==\";\n\t\tString plain = AESHelper.decrypt(cipher, key,\n\t\t\t\t\t\t\tAESHelper.decode64(iv));\n\t\tassertEquals(\"Plain Text\", plain.trim());\n\n\t\tplain = \"-----------admin\";\n\t\tkey = \"----------123456\";\n\t\tiv = \"ZqlZsmoC3SNd2YeTTCkbVw==\";\n\t\t// PCKS7 Padding results not suitable for here - AES-128/CBC/NoPadding\n\t\tassertNotEquals(\"3A0hfZiaozpwMeYs3nXdAb8mGtVc1KyGTyad7GZI8oM=\",\n\t\t\t\tAESHelper.encrypt(plain, key, AESHelper.decode64(iv)));\n\t\t\n\t\tiv = \"CTpAnB/jSRQTvelFwmJnlA==\";\n\t\tassertEquals(\"WQiXlFCt5AGCabjSCkVh0Q==\",\n\t\t\t\tAESHelper.encrypt(plain, key, AESHelper.decode64(iv)));\n\t}", "public static int[] xnsDesDecrypt(int[] key, int[] data) throws Exception {\r\n\t\tif (data == null || data.length == 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"Argument 'data' may not be null or empty\");\r\n\t\t}\r\n\t\t\r\n\t\tECBProcessor processor = getDecrypter(key);\r\n\t\tint[] checksum = { 0, 0, 0, 0 };\r\n\t\tint[] inBlock = { 0, 0, 0, 0 };\r\n\t\tint[] lastInBlock = { 0, 0, 0, 0 }; // this is the initialization vector in case of the first block\r\n\t\tint[] outBlock;\r\n\t\t\r\n\t\tint[] result = new int[((data.length + 3) / 4) * 4]; // data.length should always be a multiple of 4 for encrypted data, but who knows\r\n\t\tint resultPos = 0;\r\n\t\t\r\n\t\tint dataPos = 0;\r\n\t\tint remaining = data.length;\r\n\t\twhile(remaining > 0) {\r\n\t\t\t// build input block\r\n\t\t\tfor (int i = 0; i < 4; i++, dataPos++) {\r\n\t\t\t\tif (dataPos < data.length) {\r\n\t\t\t\t\tinBlock[i] = data[dataPos];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tinBlock[i] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// decrypt the block\r\n\t\t\toutBlock = toWords(processor.process(inBlock));\r\n\t\t\t\r\n\t\t\t// block chaining xor and append it to the result\r\n\t\t\txor(lastInBlock, outBlock); // lastInBlock ^ outBlock -> ouBlock\r\n\t\t\t\r\n\t\t\t// remember the inBlock just decrypted for next block\r\n\t\t\tfor (int i = 0; i < 4; i++) {\r\n\t\t\t\tlastInBlock[i] = inBlock[i];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// handle checksum: cumulate if not the last block, else xor the last block with the checksum\r\n\t\t\tif (remaining > 4) {\r\n\t\t\t\t// not the last block\r\n\t\t\t\txor(outBlock, checksum); // outBlock ^ checksum -> checksum\r\n\t\t\t} else {\r\n\t\t\t\t// last block: apply current checksum to inBlock before processing it \r\n\t\t\t\txor(checksum, outBlock); // checksum ^ outBlock -> outBlock\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// append current outBlock to the result\r\n\t\t\tfor (int i = 0; i < outBlock.length; i++) {\r\n\t\t\t\tresult[resultPos++] = outBlock[i];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// this block is done\r\n\t\t\tremaining -= 4;\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\t\r\n\t}", "public static void encrypt() throws IOException{\n\t\tBufferedInputStream in = new BufferedInputStream(new FileInputStream(inFilename));\n\t\tBufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(outFilename));\n\n\t\tSecureRandom randomGen = new SecureRandom(); //used for the salt and the padding\n\t\tbyte[] key; //holds the encryption key\n\n\t\t//get the file length\n\t\tlong fileLength = (new File(inFilename)).length();\n\n\t\t//write the file header marker\n\t\tout.write(FILE_HEADER);\n\n\t\t/* STAGE 1 - generate encryption key */\n\t\t//find the number of bytes we have to pad and write it to the file\n\t\tint numPad;\n\t\tif (fileLength % 8 == 0)\n\t\t\tnumPad = 0;\n\t\telse\n\t\t\tnumPad = (int)(8 - (fileLength % 8));\n\t\tout.write(numPad);\n\t\t//generate a 128-byte random salt and write it to the file\n\t\tbyte[] salt = new byte[128];\n\t\trandomGen.nextBytes(salt);\n\t\tout.write(salt);\n\t\t//generate the message for CubeHash: (password + #padded bits + random salt)\n\t\tbyte[] message = new byte[password.length + 1 + salt.length];\n\t\tSystem.arraycopy(password, 0, message, 0, password.length); //add the password\n\t\tmessage[password.length] = (byte)numPad; //add #padded bits\n\t\tSystem.arraycopy(salt, 0, message, password.length + 1, salt.length); //add random salt\n\t\t//finally, generate the encryption key\n\t\tkey = CryptoLib.CubeHash.doCubeHash(message);\n\n\t\t/* STAGE 2 - apply encryption */\n\t\tint currPiece = 0; //keeps track of which piece of the key is being used\n\t\tbyte[] currData = new byte[8]; //holds the piece of data currently being encrypted\n\n\t\t//split the key into 4 pieces of 128 bits each\n\t\tbyte[][] keyPieces = new byte[4][16];\n\t\tfor (int i = 0; i < 4; i++){\n\t\t\tSystem.arraycopy(key, i*16, keyPieces[i], 0, 16);\n\t\t}\n\n\t\t//loop through the file (except the last block), 8 bytes at a time\n\t\tfor (long i = 0; i < fileLength - 8; i += 8){\n\t\t\t//put a chunk of data in currData\n\t\t\tin.read(currData);\n\n\t\t\t//do TEA(key, RC4(key, data)), then write to file\n\t\t\tout.write(CryptoLib.TEA.doTEA(keyPieces[currPiece],\n\t\t\t\t\t\tCryptoLib.RC4.doRC4(keyPieces[currPiece], currData)));\n\n\t\t\t//increment currPiece\n\t\t\tcurrPiece = (currPiece + 1) % 4;\n\t\t}\n\n\t\t//deal with the last block of data:\n\t\t//first, read it..\n\t\tin.read(currData);\n\t\t//..pad it with random data..\n\t\tfor (int i = 7; i >= (8 - numPad); i--){\n\t\t\tcurrData[i] = (byte)randomGen.nextInt();\n\t\t}\n\t\t//..then encrypt it\n\t\tout.write(CryptoLib.TEA.doTEA(keyPieces[currPiece],\n\t\t\t\t\tCryptoLib.RC4.doRC4(keyPieces[currPiece], currData)));\n\n\t\t/* STAGE 3 - done! */\n\t\tin.close();\n\t\tout.close();\n\t\tSystem.out.println(\"\\nEncryption complete.\");\n\t}", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "public String entschlüsseln(SecretKey key, String nachricht) throws Exception{\n BASE64Decoder myDecoder2 = new BASE64Decoder();\n byte[] crypted2 = myDecoder2.decodeBuffer(nachricht);\n\n // Entschluesseln\n Cipher cipher2 = Cipher.getInstance(\"AES\");\n cipher2.init(Cipher.DECRYPT_MODE, key);\n byte[] cipherData2 = cipher2.doFinal(crypted2);\n String erg = new String(cipherData2);\n\n // Klartext\n return(erg);\n\n}", "@Override\n public byte[] decrypt(byte[] ciphertext) {\n ECPoint point = checkPointOnCurve(ciphertext);\n BigInteger privateKeyInverse = privateKey.getS().modInverse(privateKey.getParams().getOrder());\n return point.multiply(privateKeyInverse).getEncoded(true);\n }", "@Override\n public int finalDecrypt(byte[] text) {\n if ( text.length != blockSize()) throw new IllegalArgumentException(\"text.length != cipher.blockSize())\");\n decrypt(text);\n int n = 0;\n for(int i = text.length-1; text[i] == 0x00; --i){\n n += 1;\n }\n return text.length - n - 1;\n }", "private void decoding(String cipherText)\n\t{\n\t\ttextLength = cipherText.length();\n\n\t\tdo\n\t\t{\n\t\t\tStringBuffer sb = new StringBuffer(textLength);\n\t\t\tchar currentLetter[] = cipherText.toCharArray();\n\n\t\t\tfor(int i = ZERO; i < textLength; i++)\n\t\t\t{\n\t\t\t\tif(i % TWO ==0)\n\t\t\t\tsb.append(currentLetter[i]);\n\t\t\t} // Ending bracket of for loop\n\n\t\t\tfor(int i = ZERO; i < textLength; i++)\n\t\t\t{\n\t\t\t\tif(i % TWO != ZERO)\n\t\t\t\tsb.append(currentLetter[i]);\n\t\t\t} // Ending bracket of for loop\n\n\t\t\tdecodedText = sb.toString();\n\t\t\tcipherText = decodedText;\n\t\t\tloopIntDecode++;\n\t\t}while(loopIntDecode < shiftAmount);\n\t}", "@Override\n public void decrypt(byte[] text) {\n if ( text.length != blockSize()) throw new IllegalArgumentException(\"text.length != cipher.blockSize())\");\n byte []temp = new byte[nonce.length];\n System.arraycopy(text, 0, temp, 0, blockSize());\n ciper.setKey(key);\n ciper.decrypt(text);\n xor_nonce(text);\n System.arraycopy(temp, 0, nonce, 0, blockSize());\n }", "protected void engineInitDecrypt (Key key)\n throws KeyException {\n Key[] keys = splitKey(key);\n\n des1.initDecrypt(keys[2]);\n des2.initEncrypt(keys[1]);\n des3.initDecrypt(keys[0]);\n }", "public final byte[] SchlüsselTausch() throws Exception{\n File datei = new File(\"AES.key\");\n \n //Key auslesen\n FileInputStream fis = new FileInputStream(datei);\n byte[] encodedKey = new byte[(int) datei.length()];\n fis.read(encodedKey);\n fis.close();\n \n System.out.println(encodedKey);\n //Das byte[] des Schlüssels zurückgeben\n return(encodedKey);\n}", "@Override\n public void actionPerformed(ActionEvent e) {\n filePanel.getFrame().getController().decrypt(filePanel.getSource(), filePanel.getDestination());\n }", "public static void main(String[] args) {\n System.out.println(decryptFunction());\n //decryptFunction();\n\n }", "protected void setDecripted() {\n content = this.aesKey.decrypt(this.content);\n }", "public static byte [] decrypt(byte [] cipherText, SecretKey key){\r\n\t\ttry {\r\n\t\t\tbyte [] initVector = unpackFromByteArray(cipherText, 0);\r\n\t\t\tint cursor = initVector.length+2;\t\t\t\r\n\t\t\tCipher cipher = Cipher.getInstance(symmetricKeyCryptoMode);\r\n\t\t\tcipher.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(initVector));\t\t\t\r\n\t\t\treturn cipher.doFinal(cipherText,cursor,cipherText.length-cursor);\r\n\t\t} catch (Exception e){\r\n\t\t\tthrow new ModelException(ExceptionReason.INVALID_PARAMETER, \"Error decrypting cipherText \"+cipherText,e);\r\n\t\t}\r\n\t}", "static String decrypt(byte[] cipherTextArray, PrivateKey privateKey) throws Exception {\n Cipher cipher = Cipher.getInstance(RSA__PADDING);\n\n //Initialize Cipher for DECRYPT_MODE\n cipher.init(Cipher.DECRYPT_MODE, privateKey);\n\n //Perform Decryption\n byte[] decryptedTextArray = cipher.doFinal(cipherTextArray);\n\n return new String(decryptedTextArray);\n }", "public static String decrypt(String text, int key) {\n return encrypt(text, -key);\n }", "public byte[] decrypt(byte[] input, String privateKeyFilePath) throws Exception {\n\t\treturn decrypt(input, getPrivateKey(privateKeyFilePath));\t\n\t}", "public static String caesar3decrypt(String x) {\n char y[]=x.toCharArray();\n for (int i = 0; i < x.length(); i++) {\n int asciivalue = (int) y[i];\n if ((asciivalue >= 68 && asciivalue <= 90) || (asciivalue >= 100 && asciivalue <= 122)) {\n y[i] = (char) (asciivalue - 3);\n } else if ((asciivalue >= 65 && asciivalue <= 67) || (asciivalue >= 97 && asciivalue <= 99)) {\n y[i] = (char) (asciivalue + 23);\n }\n }\n return (new String(y));\n }", "public void testCaesar(){\n String msg = \"At noon be in the conference room with your hat on for a surprise party. YELL LOUD!\";\n \n /*String encrypted = encrypt(msg, key);\n System.out.println(\"encrypted \" +encrypted);\n \n String decrypted = encrypt(encrypted, 26-key);\n System.out.println(\"decrypted \" + decrypted);*/\n \n \n String encrypted = encrypt(msg, 15);\n System.out.println(\"encrypted \" +encrypted);\n \n }" ]
[ "0.72404695", "0.70562214", "0.6938328", "0.67914814", "0.66123295", "0.65946054", "0.65827274", "0.65657276", "0.6468313", "0.6445604", "0.6277517", "0.6267178", "0.6241336", "0.62179375", "0.6182292", "0.61812955", "0.61703485", "0.6159048", "0.6080669", "0.60492885", "0.60469794", "0.59993094", "0.5974127", "0.593642", "0.5931817", "0.59232575", "0.59052515", "0.58991903", "0.5897958", "0.5881086", "0.5847894", "0.58436924", "0.5815702", "0.58144057", "0.5802579", "0.57671124", "0.5744161", "0.572637", "0.5717501", "0.5717168", "0.5710677", "0.5704433", "0.57036257", "0.56951714", "0.56943417", "0.56855667", "0.5663189", "0.56573313", "0.56430966", "0.56372046", "0.56302667", "0.5625546", "0.5625312", "0.5621336", "0.56093436", "0.56052786", "0.5595177", "0.5586699", "0.55819786", "0.5575735", "0.5539549", "0.55121535", "0.5490359", "0.5482235", "0.5478793", "0.5469885", "0.5468496", "0.54434663", "0.5441557", "0.5439253", "0.54371667", "0.5423823", "0.5416743", "0.5416222", "0.54139924", "0.5403547", "0.54029375", "0.5394296", "0.53878117", "0.5384223", "0.5382555", "0.53813046", "0.5377061", "0.5374263", "0.5371602", "0.53640896", "0.5360129", "0.53551173", "0.5340324", "0.533688", "0.53303355", "0.53247786", "0.5323343", "0.53212243", "0.53175175", "0.5315199", "0.53059995", "0.5305939", "0.5301473", "0.529474" ]
0.7316792
0
It multiplies two numbers and returns (ab)%65537
int mul( int a , int b) { double c,d; if (a==0) c=65536; if(b==0) d=65536; c=(double)a; d=(double)b; a= (int)((c*d)%65537); return a; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int modExp(int a, int b, int n) {\n\n // get a char array of the bits in b\n char[] k = (Integer.toBinaryString(b)).toCharArray();\n\n // initialize variables\n int c = 0, f = 1;\n // loop over every bit in k\n for (int i = 0; i < k.length; i ++) {\n\n // for every bit, i.e. if 0 or 1, do this\n c *= 2;\n f = (f * f) % n;\n\n // If current bit is equal to 1, then do this\n if (k[i] == '1') {\n c += 1;\n f = (f * a) % n;\n }\n }\n\n // returns the remainder\n return f;\n }", "private static final int mult (int a, int b, int g) {\n int p = 0;\n while (b != 0) {\n if ((b & 0x01) != 0) p ^= a;\n a <<= 1;\n if (a > 0xFF) a ^= g;\n b >>>= 1;\n }\n return p;\n }", "private static long modPow(long a, long b, long c) {\n long res = 1;\n for (int i = 0; i < b; i++)\n {\n res *= a;\n res %= c;\n }\n return res % c;\n }", "public static byte GMul(int a, int b) {\n\n byte p = 0;\n byte counter;\n byte hi_bit_set;\n for (counter = 0; counter < 8; counter++) {\n if ((b & 1) != 0) {\n p ^= a;\n }\n hi_bit_set = (byte) (a & 0x80);\n a <<= 1;\n if (hi_bit_set != 0) {\n a ^= 0x1b; /* x^8 + x^4 + x^3 + x + 1 */\n }\n b >>= 1;\n }\n return p;\n}", "private static int galoisMult(int a, int b)\n\t{\n\t\tint result = 0;\n\t\tfor (int i=0; i<8; i++)\n\t\t{\n\t\t\tif((b&1) == 1) //low bit of b set\n\t\t\t\tresult = result^a;\n\t\t\tboolean aHighSet = (a & 128) == 128; //8th bit of a set\n\t\t\ta <<= 1;\n\t\t\tassert (a&1) == 0;\n\t\t\t\n\t\t\ta &= 255; //getting rid of 9th bit\n\t\t\tassert ((a&256) != 256);\n\t\t\t\n\t\t\tif (aHighSet)\n\t\t\t\ta ^= (0x1b);\n\t\t\t\n\t\t\tb >>= 1;\n\t\t\tassert (b&128) != 128; //8 bit is zero\n\t\t}\n\t\treturn result;\n\t}", "public int fastPower(int a, int b, int n) {\n // write your code here\n long base = a, ans = 1;\n while (n > 0) {\n if (n % 2 == 1) {\n ans = ans * base % b;\n }\n n /= 2;\n base = base * base % b;\n }\n return (int) ans % b;\n }", "private static int cprModFunction(int a, int b) {\n\t\tint res = a % b;\n\t\tif (res < 0)\n\t\t\tres += b;\n\t\treturn res;\n\t}", "public String multiply(String num1, String num2) {\n int[] n1 = new int[num1.length()];\r\n for(int i = 0; i < num1.length(); i++) {\r\n \tn1[i] = num1.charAt(i) - '0';\r\n }\r\n int[] n2 = new int[num2.length()];\r\n for(int i = 0; i < num2.length(); i++) {\r\n \tn2[i] = num2.charAt(i) - '0';\r\n }\r\n //the result\r\n int[] result = new int[num1.length() + num2.length()];\r\n \r\n //multiple two large numbers\r\n for(int i = n2.length - 1; i >=0; i--) {\r\n \t//the starting point in the result array\r\n \tint v2 = n2[i];\r\n \tint startPoint = result.length - 1 - (n2.length - 1 - i);\r\n \tint carrier = 0;\r\n \tfor(int j = n1.length - 1; j >= 0; j--) {\r\n \t\tint index = startPoint - (n1.length - 1 - j);\r\n \t\tint v1 = n1[j];\r\n \t\t\r\n// \t\tSystem.out.println(\"i: \" + i + \": \" + v2 + \", j: \" + j + \": \" + v1 + \", carrier: \" + carrier);\r\n \t\t\r\n \t\tint finalValue = v1*v2 + carrier + result[index];\r\n \t\tcarrier = finalValue/10;\r\n \t\tresult[index] = finalValue % 10;\r\n \t\t//update the last\r\n \t\tif(j == 0) {\r\n \t\t\tif(carrier > 0) {\r\n \t\t\t\tresult[index - 1] = carrier; //XXX note, need to write to the array cell\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n// \tthis.printArray(result);\r\n }\r\n \r\n //convert to the result\r\n StringBuilder sb = new StringBuilder();\r\n boolean zero = true;\r\n for(int i : result) {\r\n \tif(i != 0 && zero) {\r\n \t\tzero = false;\r\n \t}\r\n \tif(!zero) {\r\n \t sb.append(i);\r\n \t}\r\n }\r\n if(sb.length() == 0) {\r\n \tsb.append(\"0\"); //all ZERO\r\n }\r\n return sb.toString();\r\n }", "private static long namuji(long a, long b) {\n\t\tlong temp = 0;\n\t\tif(b == 1 ) {\n\t\t\treturn a%C;\n\t\t}\n\t\tif(b%2==0) {\n\t\t\ttemp = namuji(a,b/2);\n\t\t\treturn (temp*temp)%C;\n\t\t}else {\n\t\t\ttemp = namuji(a,(b-1)/2);\n\t\t\tlong temp2 = (temp*temp)%C;\n\t\t\treturn (A*temp2)%C;\n\t\t}\n\t\t\n\t}", "private static BigInteger multiplyToomCook3(BigInteger a, BigInteger b) {\n int alen = a.mag.length;\n int blen = b.mag.length;\n\n int largest = Math.max(alen, blen);\n\n // k is the size (in ints) of the lower-order slices.\n int k = (largest+2)/3; // Equal to ceil(largest/3)\n\n // r is the size (in ints) of the highest-order slice.\n int r = largest - 2*k;\n\n // Obtain slices of the numbers. a2 and b2 are the most significant\n // bits of the numbers a and b, and a0 and b0 the least significant.\n BigInteger a0, a1, a2, b0, b1, b2;\n a2 = a.getToomSlice(k, r, 0, largest);\n a1 = a.getToomSlice(k, r, 1, largest);\n a0 = a.getToomSlice(k, r, 2, largest);\n b2 = b.getToomSlice(k, r, 0, largest);\n b1 = b.getToomSlice(k, r, 1, largest);\n b0 = b.getToomSlice(k, r, 2, largest);\n\n BigInteger v0, v1, v2, vm1, vinf, t1, t2, tm1, da1, db1;\n\n v0 = a0.multiply(b0);\n da1 = a2.add(a0);\n db1 = b2.add(b0);\n vm1 = da1.subtract(a1).multiply(db1.subtract(b1));\n da1 = da1.add(a1);\n db1 = db1.add(b1);\n v1 = da1.multiply(db1);\n v2 = da1.add(a2).shiftLeft(1).subtract(a0).multiply(\n db1.add(b2).shiftLeft(1).subtract(b0));\n vinf = a2.multiply(b2);\n\n // The algorithm requires two divisions by 2 and one by 3.\n // All divisions are known to be exact, that is, they do not produce\n // remainders, and all results are positive. The divisions by 2 are\n // implemented as right shifts which are relatively efficient, leaving\n // only an exact division by 3, which is done by a specialized\n // linear-time algorithm.\n t2 = v2.subtract(vm1).exactDivideBy3();\n tm1 = v1.subtract(vm1).shiftRight(1);\n t1 = v1.subtract(v0);\n t2 = t2.subtract(t1).shiftRight(1);\n t1 = t1.subtract(tm1).subtract(vinf);\n t2 = t2.subtract(vinf.shiftLeft(1));\n tm1 = tm1.subtract(t2);\n\n // Number of bits to shift left.\n int ss = k*32;\n\n BigInteger result = vinf.shiftLeft(ss).add(t2).shiftLeft(ss).add(t1).shiftLeft(ss).add(tm1).shiftLeft(ss).add(v0);\n\n if (a.signum != b.signum) {\n return result.negate();\n } else {\n return result;\n }\n }", "long power(int a, int b){\r\n\t\tlong pow=1;\r\n\t\tfor(int i=0;i<b;i++)\r\n\t\t{\r\n\t\t\tpow=pow*a;\r\n\t\t}\r\n\t\treturn pow;\r\n\t}", "public HugeUInt mod(HugeUInt b) {\r\n \t HugeUInt q = new HugeUInt(this);\r\n HugeUInt t;\r\n HugeUInt m;\r\n int lenA = q.getSize();\r\n int lenB = b.getSize();\r\n int sh = lenA - lenB;\r\n int d; \r\n while (b.compareTo(q) <= 0) {\r\n \tsh = lenA - lenB;\r\n t = q.shiftRight(sh);\r\n if (t.compareTo(b) < 0) {\r\n sh--;\r\n }\r\n d = 9;\r\n m = b.multiply(d).shiftLeft(sh);\r\n while (q.compareTo(m) < 0) {\r\n d--;\r\n m = b.multiply(d).shiftLeft(sh);\r\n }\r\n q = q.subtract(m);\r\n q.trim();\r\n lenA = q.getSize();\r\n }\r\n q.trim();\r\n return q;\r\n }", "static int comb(int big, int smal) \n\t{ \n\t\treturn (int) ((long) fact[big] * invfact[smal] % mod \n\t\t\t\t* invfact[big - smal] % mod); \n\t}", "public static void main(String[] args) {\n\tint base=3 ,exponent=4 , result =1;\r\n\twhile (exponent!=0)\r\n\t{\r\n\t\tresult = result*base;\r\n\t\t--exponent;\r\n\t\t\t}\r\nSystem.out.println(\"the answer is \"+ result);\t\r\n\r\n\t}", "private static final byte exp31 (int b, int g) {\n if (b == 0) return 0;\n\n int r = b; // r = b ** 1\n b = mult(b, b, g); // b = b ** 2\n r = mult(r, b, g); // r = b ** 3\n b = mult(b, b, g); // b = b ** 4\n r = mult(r, b, g); // r = b ** 7\n b = mult(b, b, g); // b = b ** 8\n r = mult(r, b, g); // r = b ** 15\n b = mult(b, b, g); // b = b ** 16\n return (byte)mult(r, b, g); // r = b ** 31\n }", "int luasPP(int a, int b){\r\n return a*b;\r\n }", "public int fastPower(int a, int b, int n) {\n if (n == 0){\n return 1 % b;\n }\n\n if (n == 1) {\n return a % b;\n }\n\n long ans = fastPower(a, b, n / 2);\n ans = (ans * ans) % b;\n if (n % 2 == 1){\n ans = (ans*a) % b;\n }\n return (int) ans;\n }", "@Test\n public void testPowerMod_0_0_2() {\n NaturalNumber n = new NaturalNumber2(0);\n NaturalNumber p = new NaturalNumber2(0);\n NaturalNumber m = new NaturalNumber2(2);\n CryptoUtilities.powerMod(n, p, m);\n assertEquals(\"1\", n.toString());\n assertEquals(\"0\", p.toString());\n assertEquals(\"2\", m.toString());\n }", "public static int getProduct(int b, int n1, int n2){\n int r1=0,pow=1,res1=0,res=0,carry=0,sum=0;\n while(n1 !=0)\n {\n r1=n1%10;\n n1/=10;\n res1=multiply(r1,n2,b,pow);\n res=SumAnybase(res1,res,b);\n pow=pow*10;\n }\n return res;\n }", "@Test\n public void testLargeALargeM() {\n assertEquals(11479907, PiGenerator.powerMod(123456, 2, 42423131));\n }", "public static void main(String args[] ) throws Exception {\n Scanner in = new Scanner(System.in);\n \n String original = in.next();\n int n = original.length();\n long moda = 1000000007;\n long ones = 1;\n long sum=0; \n for (int s=original.length()-1; s>=0; s--) {\n sum = (sum + (s+1) * (original.charAt(s) - '0') * ones) %moda; \n ones = (ones * 10 + 1) % moda;\n \n }\n \n System.out.println(sum);\n \n }", "@Test\n public void testLargeA() {\n assertEquals(18, PiGenerator.powerMod(123456, 2, 23));\n }", "@Override\r\n\tpublic int mul(int a,int b) {\n\t\treturn a*b;\r\n\t}", "int multiply (int a, int b) {\n\t\t//let me do it in one step\n\t\treturn a * b; \n\t\t\n\t\t\n\t}", "public static int intPow(int a, int b){\n\t\tint r = 1;\n\t\tint i = 1;\n\t\tif(b > 8){\n\t\t\tr = A;\n\t\t\ti = 2; //i++;\n\t\t\twhile(i <= B){\n\t\t\t\tr *= r;\n\t\t\t\ti *= 2;\n\t\t\t}\n\t\t\ti /= 2; // >>= 2;\n\t\t}\n\t\tif(i < b){\n\t\t\tdo{\n\t\t\t\ti++;\n\t\t\t\tr *= a;\n\t\t\t} while(i <= b);\n\t\t}\n\t\treturn r;\n\t}", "public Inatnum multiply(Inatnum a) {\n Inatnum zero = new zeronatnum(); // we need a new zero natural number for our res\n Inatnum res = zero;// this is our res value where we store our information, it needs to start at 0\n //INV: i>0 && i-1 <= this.getval() && res = a^(i) ==> i=this.getval()-(this.getval()z-1)\n for(int i = this.getVal(); i>0;i--) {// setting our i value to our this and if its greater than zero decrement by 1\n //INV: i>0 && i <= this.getval() && res = a^i ==> i=this.getval()-(this.getval()\n\t\t\tres = res.add(a);//now we save our res value as the previous res value plus a. we do this as many times as we are multiplying by. So if it is 3 times\n //INV: i>0 && i <= this.getval() && res = a^i ==> i=this.getval()-(this.getval()-1) \n \t\t\t//i-- => i = this.getval()-(this.getval()-1-1)\n \t\t\t //INV: i>0 && i-1 <= this.getval() && res = a^(i) ==> i=this.getval()-(this.getval()-1-1)\n \t\t\t //INV: i>0 && i-1 <= this.getval() && res = a^(i) ==> i=this.getval()-(this.getval()z-1) \n\t\t\t // 4 then we are adding 4 3 times\n }\n\t\t\t //INV: i<0 && i-1 < this.getval() ==> i ==0 && res = a^i ==> i=this.getval()\n //Termination Argument: i starts at this.getval(), i decrements each time through the loop\n\t\t\t\t\t\t return res;// we need to return our res value that holds our current value.\n }", "public String multiply(String num1, String num2) {\n\t int[] result=new int[num1.length()+num2.length()];\n\t int[] temp1=new int[num1.length()];\n\t int[] temp2=new int[num2.length()];\n\t for(int i=0;i<temp1.length;i++) {\n\t \ttemp1[i]=num1.charAt(i)-'0';\n\t }\n\t for(int i=0;i<temp2.length;i++){\n\t \ttemp2[i]=num2.charAt(i)-'0';\n\t }\n\t \n\t for(int j=temp1.length-1;j>=0;j--) {\n\t \tfor(int k=temp2.length-1;k>=0;k--) {\n\t \t\t result[j+k+1]+=temp1[j]*temp2[k];\n\t \t}\n\t }\n\t int carry=0;\n\t for(int i=result.length-1;i>=0;i--) {\n\t \t int temp=(result[i]+carry)%10;\n\t \t carry=(result[i]+carry)/10;\n\t \t result[i]=temp;\n\t }\n\t StringBuilder b1=new StringBuilder();\n\t for(int num:result) b1.append(num);\n\t while (b1.length() != 0 && b1.charAt(0) == '0') b1.deleteCharAt(0);\n return b1.length() == 0 ? \"0\" : b1.toString();\n\t \n }", "public static void main(String[] args) {\n BigDecimal bigDecimal = new BigDecimal(2);\n BigDecimal divisor = bigDecimal.pow(256);\n BigDecimal dividend = divisor.add(new BigDecimal(-1));\n BigDecimal multiplier = new BigDecimal(2).pow(128);\n// BigDecimal result = dividend.divide(divisor).pow(multiplier);\n// System.out.println(result);\n }", "private static int wrap(int a, int b)\n {\n return (a < 0) ? (a % b + b) : (a % b);\n }", "public void operacionletradni(int dni, int result){\n this.result=dni%23;}", "public static void main(String[] args) {\nInteger f=1;\r\nInteger num=Integer.parseInt(args[0]);\r\nfor(Integer i= 1; i<= num ; i++)\r\n{\r\n\tf=f*i;\r\n\tSystem.out.println(\"fact is : \"+f);\r\n\t\r\n}\r\nBigInteger f1=new BigInteger(\"1\");\r\nfor(Integer i=1; i<=num; i++) {\r\n\tf1=f1.multiply(new BigInteger(\"\"+i));\r\n\tSystem.out.println(\"fact is \"+f1);\r\n}\r\n\t}", "static long mpow(long x, int k) {\n\t long result = 1;\n\t for(; k > 0; k >>= 1) {\n\t if(k % 2 == 1) {\n\t result = mod(result * x ,511);\n\t }\n\t x = mod(x * x , 511);\n\t }\n\t return result;\n\t}", "long mo1636a(long j, alb alb);", "java.math.BigInteger getNcbieaa();", "static void pregenFact() \n\t{ \n\t\tfact[0] = fact[1] = 1; \n\t\tfor (int i = 1; i <= 1000000; ++i) \n\t\t{ \n\t\t\tfact[i] = (int) ((long) fact[i - 1] * i % mod); \n\t\t} \n\t}", "private static long rl(long a, String b) {\r\n long res = a;\r\n for (int c = 0; c < b.length() - 2; c += 3) {\r\n char dChar = b.charAt(c + 2);\r\n long dInt = dChar >= 'a' ? (int) dChar - 87 : Long.valueOf(String.valueOf(dChar));\r\n char char2 = b.charAt(c + 1);\r\n long dInt2 = char2 == '+' ? res >>> dInt : res << dInt;\r\n res = b.charAt(c) == '+' ? res + dInt2 & 4294967295l : res ^ dInt2;\r\n }\r\n return res;\r\n }", "private static void jieCheng(int number){\n int result = 1;\n for (int i = 1; i < number; i++) {\n result = result * (i+1);\n }\n System.out.println(result);\n }", "@Test\n public void testLargeM() {\n assertEquals(32, PiGenerator.powerMod(2, 5, 42423131));\n }", "public static void main(String[] args) {\n\t\t\n\t\tint base = 8;\n\t\tint exponent = 4;\n\t\t\n\t\tlong result = 1;\n\t\t\n\t\twhile(exponent !=0)\n\t\t{\n\t\t\tresult *=base;\n\t\t\t--exponent;\n\t\t}\n\t\tSystem.out.println(result);\n\n\t}", "public static int solve(String a, String b) {\n\n final BigInteger ba = new BigInteger(a);\n final BigInteger bb = new BigInteger(b);\n final BigInteger m = BigInteger.valueOf(1000000007);\n\n return ba.modPow(bb, m).intValue();\n }", "private int mcCalc(int a, int b) {\n if (a == 1) {\n return b;\n } else if (a == 2) {\n return mc2[b / 16][b % 16] ^ 0x42;\n } else if (a == 3) {\n return mc3[b / 16][b % 16] ^ 0x42;\n }\n return 0;\n }", "int ainverse(int z)\n {\n return (65536-z);\n }", "public static void main(String args[]) {\n\t\tBigDecimal start = new BigDecimal(\"2658455991569831744654692615953842176\");\n//\t\tBigDecimal start = new BigDecimal(\"8128\");\n//\t\tBigDecimal dd = start.divide(next, 0);\n//\t\tSystem.out.println(dd);\n\t\t\n\t\tList<BigDecimal> fs = new PerfectNumber().factor2(start, 10, null);\n\t\tBigDecimal multiply = new BigDecimal(1);\n\t\tBigDecimal sum = new BigDecimal(0);\n\t\tfor (BigDecimal d : fs) {\n\t\t\tSystem.out.println(d);\n\t\t\tmultiply = multiply.multiply(d);\n\t\t\tsum = sum.add(d);\n\t\t}\n\t\tSystem.out.println(\"sum = \" + sum);\n\t\tSystem.out.println(\"multiply = \" + multiply);\n\t}", "private void ModInvBigNbr(int[] a, int[] inv, int[] b, int NumberLength) {\r\n\t\tint i;\r\n\t\tint Dif, E;\r\n\t\tint st1, st2;\r\n\t\tlong Yaa, Yab; // 2^E * A' = Yaa A + Yab B\r\n\t\tlong Yba, Ybb; // 2^E * B' = Yba A + Ybb B\r\n\t\tlong Ygb0; // 2^E * Mu' = Yaa Mu + Yab Gamma + Ymb0 B0\r\n\t\tlong Ymb0; // 2^E * Gamma' = Yba Mu + Ybb Gamma + Ygb0 B0\r\n\t\tint Iaa, Iab, Iba, Ibb;\r\n\t\tlong Tmp1, Tmp2, Tmp3, Tmp4, Tmp5;\r\n\t\tint B0l;\r\n\t\tint invB0l;\r\n\t\tint Al, Bl, T1, Gl, Ml;\r\n\t\tlong carry1, carry2, carry3, carry4;\r\n\t\tint Yaah, Yabh, Ybah, Ybbh;\r\n\t\tint Ymb0h, Ygb0h;\r\n\t\tlong Pr1, Pr2, Pr3, Pr4, Pr5, Pr6, Pr7;\r\n\t\tlong[] B = this.CalcAuxModInvBB;\r\n\t\tlong[] CalcAuxModInvA = this.CalcAuxModInvA;\r\n\t\tlong[] CalcAuxModInvB = this.CalcAuxModInvB;\r\n\t\tlong[] CalcAuxModInvMu = this.CalcAuxModInvMu;\r\n\t\tlong[] CalcAuxModInvGamma = this.CalcAuxModInvGamma;\r\n\r\n\t\tif (NumberLength >= 2 && b[NumberLength - 1] == 0 && b[NumberLength - 2] < 0x40000000) {\r\n\t\t\tNumberLength--;\r\n\t\t}\r\n\t\tConvert31To32Bits(a, CalcAuxModInvA, NumberLength);\r\n\t\tConvert31To32Bits(b, CalcAuxModInvB, NumberLength);\r\n\t\tSystem.arraycopy(CalcAuxModInvB, 0, B, 0, NumberLength);\r\n\t\tB0l = (int) B[0];\r\n\t\tinvB0l = B0l; // 2 least significant bits of inverse correct.\r\n\t\tinvB0l = invB0l * (2 - B0l * invB0l); // 4 LSB of inverse correct.\r\n\t\tinvB0l = invB0l * (2 - B0l * invB0l); // 8 LSB of inverse correct.\r\n\t\tinvB0l = invB0l * (2 - B0l * invB0l); // 16 LSB of inverse correct.\r\n\t\tinvB0l = invB0l * (2 - B0l * invB0l); // 32 LSB of inverse correct.\r\n\t\tfor (i = NumberLength - 1; i >= 0; i--) {\r\n\t\t\tCalcAuxModInvGamma[i] = 0;\r\n\t\t\tCalcAuxModInvMu[i] = 0;\r\n\t\t}\r\n\t\tCalcAuxModInvMu[0] = 1;\r\n\t\tDif = 0;\r\n\t\touter_loop: for (;;) {\r\n\t\t\tIaa = Ibb = 1;\r\n\t\t\tIab = Iba = 0;\r\n\t\t\tAl = (int) CalcAuxModInvA[0];\r\n\t\t\tBl = (int) CalcAuxModInvB[0];\r\n\t\t\tE = 0;\r\n\t\t\tif (Bl == 0) {\r\n\t\t\t\tfor (i = NumberLength - 1; i >= 0; i--) {\r\n\t\t\t\t\tif (CalcAuxModInvB[i] != 0)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (i < 0)\r\n\t\t\t\t\tbreak; // Go out of loop if CalcAuxModInvB = 0\r\n\t\t\t}\r\n\t\t\tfor (;;) {\r\n\t\t\t\tT1 = 0;\r\n\t\t\t\twhile ((Bl & 1) == 0) {\r\n\t\t\t\t\tif (E == 31) {\r\n\t\t\t\t\t\tYaa = Iaa;\r\n\t\t\t\t\t\tYab = Iab;\r\n\t\t\t\t\t\tYba = Iba;\r\n\t\t\t\t\t\tYbb = Ibb;\r\n\t\t\t\t\t\tGl = (int) CalcAuxModInvGamma[0];\r\n\t\t\t\t\t\tMl = (int) CalcAuxModInvMu[0];\r\n\t\t\t\t\t\tDif++;\r\n\t\t\t\t\t\tT1++;\r\n\t\t\t\t\t\tYaa <<= T1;\r\n\t\t\t\t\t\tYab <<= T1;\r\n\t\t\t\t\t\tYmb0 = (-(int) Yaa * Ml - (int) Yab * Gl) * invB0l;\r\n\t\t\t\t\t\tYgb0 = (-Iba * Ml - Ibb * Gl) * invB0l;\r\n\t\t\t\t\t\tcarry1 = carry2 = carry3 = carry4 = 0;\r\n\t\t\t\t\t\tYaah = (int) (Yaa >> 32);\r\n\t\t\t\t\t\tYabh = (int) (Yab >> 32);\r\n\t\t\t\t\t\tYbah = (int) (Yba >> 32);\r\n\t\t\t\t\t\tYbbh = (int) (Ybb >> 32);\r\n\t\t\t\t\t\tYmb0h = (int) (Ymb0 >> 32);\r\n\t\t\t\t\t\tYgb0h = (int) (Ygb0 >> 32);\r\n\t\t\t\t\t\tYaa &= 0xFFFFFFFFL;\r\n\t\t\t\t\t\tYab &= 0xFFFFFFFFL;\r\n\t\t\t\t\t\tYba &= 0xFFFFFFFFL;\r\n\t\t\t\t\t\tYbb &= 0xFFFFFFFFL;\r\n\t\t\t\t\t\tYmb0 &= 0xFFFFFFFFL;\r\n\t\t\t\t\t\tYgb0 &= 0xFFFFFFFFL;\r\n\r\n\t\t\t\t\t\tst1 = Yaah * 6 + Yabh * 2 + Ymb0h;\r\n\t\t\t\t\t\tst2 = Ybah * 6 + Ybbh * 2 + Ygb0h;\r\n\t\t\t\t\t\tfor (i = 0; i < NumberLength; i++) {\r\n\t\t\t\t\t\t\tPr1 = Yaa * (Tmp1 = CalcAuxModInvMu[i]);\r\n\t\t\t\t\t\t\tPr2 = Yab * (Tmp2 = CalcAuxModInvGamma[i]);\r\n\t\t\t\t\t\t\tPr3 = Ymb0 * (Tmp3 = B[i]);\r\n\t\t\t\t\t\t\tPr4 = (Pr1 & 0xFFFFFFFFL) + (Pr2 & 0xFFFFFFFFL) + (Pr3 & 0xFFFFFFFFL) + carry3;\r\n\t\t\t\t\t\t\tPr5 = Yaa * (Tmp4 = CalcAuxModInvA[i]);\r\n\t\t\t\t\t\t\tPr6 = Yab * (Tmp5 = CalcAuxModInvB[i]);\r\n\t\t\t\t\t\t\tPr7 = (Pr5 & 0xFFFFFFFFL) + (Pr6 & 0xFFFFFFFFL) + carry1;\r\n\t\t\t\t\t\t\tswitch (st1) {\r\n\t\t\t\t\t\t\tcase -9:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1 - Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -8:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1 - Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -7:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -6:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -5:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1 + Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -4:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1 + Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -3:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -2:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -1:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = 0;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\t\t\tcarry3 = 0;\r\n\t\t\t\t\t\t\t\tcarry1 = 0;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1 - Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 4:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1 - Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 5:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 6:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 7:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1 + Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 8:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1 + Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcarry3 += (Pr1 >>> 32) + (Pr2 >>> 32) + (Pr3 >>> 32) + (Pr4 >> 32);\r\n\t\t\t\t\t\t\tcarry1 += (Pr5 >>> 32) + (Pr6 >>> 32) + (Pr7 >> 32);\r\n\t\t\t\t\t\t\tif (i > 0) {\r\n\t\t\t\t\t\t\t\tCalcAuxModInvMu[i - 1] = Pr4 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\t\t\tCalcAuxModInvA[i - 1] = Pr7 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tPr1 = Yba * Tmp1;\r\n\t\t\t\t\t\t\tPr2 = Ybb * Tmp2;\r\n\t\t\t\t\t\t\tPr3 = Ygb0 * Tmp3;\r\n\t\t\t\t\t\t\tPr4 = (Pr1 & 0xFFFFFFFFL) + (Pr2 & 0xFFFFFFFFL) + (Pr3 & 0xFFFFFFFFL) + carry4;\r\n\t\t\t\t\t\t\tPr5 = Yba * Tmp4;\r\n\t\t\t\t\t\t\tPr6 = Ybb * Tmp5;\r\n\t\t\t\t\t\t\tPr7 = (Pr5 & 0xFFFFFFFFL) + (Pr6 & 0xFFFFFFFFL) + carry2;\r\n\t\t\t\t\t\t\tswitch (st2) {\r\n\t\t\t\t\t\t\tcase -9:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1 - Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -8:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1 - Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -7:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -6:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -5:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1 + Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -4:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1 + Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -3:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -2:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -1:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = 0;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\t\t\tcarry4 = 0;\r\n\t\t\t\t\t\t\t\tcarry2 = 0;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1 - Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 4:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1 - Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 5:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 6:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 7:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1 + Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 8:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1 + Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcarry4 += (Pr1 >>> 32) + (Pr2 >>> 32) + (Pr3 >>> 32) + (Pr4 >> 32);\r\n\t\t\t\t\t\t\tcarry2 += (Pr5 >>> 32) + (Pr6 >>> 32) + (Pr7 >> 32);\r\n\t\t\t\t\t\t\tif (i > 0) {\r\n\t\t\t\t\t\t\t\tCalcAuxModInvGamma[i - 1] = Pr4 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\t\t\tCalcAuxModInvB[i - 1] = Pr7 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ((int) CalcAuxModInvA[i - 1] < 0) {\r\n\t\t\t\t\t\t\tcarry1 -= Yaa;\r\n\t\t\t\t\t\t\tcarry2 -= Yba;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ((int) CalcAuxModInvB[i - 1] < 0) {\r\n\t\t\t\t\t\t\tcarry1 -= Yab;\r\n\t\t\t\t\t\t\tcarry2 -= Ybb;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ((int) CalcAuxModInvMu[i - 1] < 0) {\r\n\t\t\t\t\t\t\tcarry3 -= Yaa;\r\n\t\t\t\t\t\t\tcarry4 -= Yba;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ((int) CalcAuxModInvGamma[i - 1] < 0) {\r\n\t\t\t\t\t\t\tcarry3 -= Yab;\r\n\t\t\t\t\t\t\tcarry4 -= Ybb;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tCalcAuxModInvA[i - 1] = carry1 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\tCalcAuxModInvB[i - 1] = carry2 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\tCalcAuxModInvMu[i - 1] = carry3 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\tCalcAuxModInvGamma[i - 1] = carry4 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\tcontinue outer_loop;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tBl >>= 1;\r\n\t\t\t\t\tDif++;\r\n\t\t\t\t\tE++;\r\n\t\t\t\t\tT1++;\r\n\t\t\t\t} /* end while */\r\n\t\t\t\tIaa <<= T1;\r\n\t\t\t\tIab <<= T1;\r\n\t\t\t\tif (Dif >= 0) {\r\n\t\t\t\t\tDif = -Dif;\r\n\t\t\t\t\tif (((Al + Bl) & 3) == 0) {\r\n\t\t\t\t\t\tT1 = Iba;\r\n\t\t\t\t\t\tIba += Iaa;\r\n\t\t\t\t\t\tIaa = T1;\r\n\t\t\t\t\t\tT1 = Ibb;\r\n\t\t\t\t\t\tIbb += Iab;\r\n\t\t\t\t\t\tIab = T1;\r\n\t\t\t\t\t\tT1 = Bl;\r\n\t\t\t\t\t\tBl += Al;\r\n\t\t\t\t\t\tAl = T1;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tT1 = Iba;\r\n\t\t\t\t\t\tIba -= Iaa;\r\n\t\t\t\t\t\tIaa = T1;\r\n\t\t\t\t\t\tT1 = Ibb;\r\n\t\t\t\t\t\tIbb -= Iab;\r\n\t\t\t\t\t\tIab = T1;\r\n\t\t\t\t\t\tT1 = Bl;\r\n\t\t\t\t\t\tBl -= Al;\r\n\t\t\t\t\t\tAl = T1;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (((Al + Bl) & 3) == 0) {\r\n\t\t\t\t\t\tIba += Iaa;\r\n\t\t\t\t\t\tIbb += Iab;\r\n\t\t\t\t\t\tBl += Al;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tIba -= Iaa;\r\n\t\t\t\t\t\tIbb -= Iab;\r\n\t\t\t\t\t\tBl -= Al;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tDif--;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (CalcAuxModInvA[0] != 1) {\r\n\t\t\tSubtractBigNbr32(B, CalcAuxModInvMu, CalcAuxModInvMu, NumberLength);\r\n\t\t}\r\n\t\tif ((int) CalcAuxModInvMu[i = NumberLength - 1] < 0) {\r\n\t\t\tAddBigNbr32(B, CalcAuxModInvMu, CalcAuxModInvMu, NumberLength);\r\n\t\t}\r\n\t\tfor (; i >= 0; i--) {\r\n\t\t\tif (B[i] != CalcAuxModInvMu[i])\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif (i < 0 || B[i] < CalcAuxModInvMu[i]) { // If B < Mu\r\n\t\t\tSubtractBigNbr32(CalcAuxModInvMu, B, CalcAuxModInvMu, NumberLength); // Mu <- Mu - B\r\n\t\t}\r\n\t\tConvert32To31Bits(CalcAuxModInvMu, inv, NumberLength);\r\n\t}", "public void multiplyTwoNumbers(int num1, int num2) {\n\t\t\n\t\tint product = num1*num2; //A\n\t\tSystem.out.println(\"**************************************************************\");\n\t\tSystem.out.println(\"Product of these 2 numbers is: \"+product);\n\t\tint remainder = getRemainder(num1, num2); //C\n\t\tint finalResult = product+remainder; //B\n\t\tSystem.out.println(\"Final Result of these 2 numbers is: \"+ finalResult);\n\t\n\t\t\n\t}", "long mo25071a(long j);", "int main()\n{\n int a;\n std::cin>>a;\n int b=(a%10)+(a/1000);\n std::cout<<b;\n}", "@Test\n public void testLargeB() {\n assertEquals(12, PiGenerator.powerMod(2, 42, 13));\n }", "public static long pow(long a, long n, long mod) {\n//\t\ta %= mod;\n long ret = 1;\n int x = 63 - Long.numberOfLeadingZeros(n);\n for (; x >= 0; x--) {\n ret = ret * ret % mod;\n if (n << 63 - x < 0) {\n ret = ret * a % mod;\n }\n }\n return ret;\n }", "@Override\r\n\tpublic int mulNo(int a, int b) {\n\t\treturn a*b;\r\n\t}", "public static void main(String[] args) {\n\tString NUM = \"73167176531330624919225119674426574742355349194934\" +\n \"96983520312774506326239578318016984801869478851843\" +\n \"85861560789112949495459501737958331952853208805511\" +\n \"12540698747158523863050715693290963295227443043557\" +\n \"66896648950445244523161731856403098711121722383113\" +\n \"62229893423380308135336276614282806444486645238749\" +\n \"30358907296290491560440772390713810515859307960866\" +\n \"70172427121883998797908792274921901699720888093776\" +\n \"65727333001053367881220235421809751254540594752243\" +\n \"52584907711670556013604839586446706324415722155397\" +\n \"53697817977846174064955149290862569321978468622482\" +\n \"83972241375657056057490261407972968652414535100474\" +\n \"82166370484403199890008895243450658541227588666881\" +\n \"16427171479924442928230863465674813919123162824586\" +\n \"17866458359124566529476545682848912883142607690042\" +\n \"24219022671055626321111109370544217506941658960408\" +\n \"07198403850962455444362981230987879927244284909188\" +\n \"84580156166097919133875499200524063689912560717606\" +\n \"05886116467109405077541002256983155200055935729725\" +\n \"71636269561882670428252483600823257530420752963450\";\n\n //greatest combo array\n int[] greatestCombo = new int[13];\n //array to iterate through NUMS\n int[] combos = new int[13];\n //adjacency\n boolean adjacent = true;\n //product\n long product = 1;\n //maxProduct\n long maxProduct = 0;\n\n\t//iterating through the entire NUM string\n\tfor(int i = 0 ; i < NUM.length()-13; i++){\n\t //make a temporary array with the combination of the three numbers\n\t for(int c = 0; c < 13; c++){\n\t combos[c] = NUM.charAt(i+c);\n }\n\n\t //loop to determine if the numbers are adjacent\n for(int k = 1; k < 13; k++){\n if(abs(combos[k-1]-combos[k])>1){\n adjacent = false;\n break;\n }\n }\n\n //now that we have an adjacent 13-number array\n if(adjacent){\n //find the product\n for(int r = 0; r < 13; r++){\n product *= combos[r];\n }\n\n if(product > maxProduct){\n maxProduct = product;\n for(int p = 0; p < 13; p++){\n greatestCombo[p]=combos[p];\n }\n }\n }\n\n }\n System.out.println(maxProduct);\n\n }", "long mo107678c(Integer num);", "BaseNumber multiply(BaseNumber operand);", "public int ppcm(int a, int b) throws Exception {\n return a*b / pgcdByDE(a,b);\n }", "private static int findLCM(int a, int b) {\n return a * (b / findGCD(a, b));\n }", "public static int decimalToAnyBase(int n, int b){\n int val = 0;\n\n int p = 1;\n while(n > 0){\n int d = n % b;\n n = n / b;\n val += p * d;\n p = p * 10;\n }\n\n return val;\n}", "static int modPow(int b, int p, int m) {\n b = b % m;\n int res = 1;\n\n while (p > 0) {\n if (p % 2 == 1)\n res = (res * b) % m;\n p /= 2;\n b = b * b % m;\n }\n return res;\n }", "private static int pair_GCF(int a, int b) {\n int t;\n while (b != 0) {\n t = a;\n a = b;\n b = t % b;\n }\n return a;\n }", "public static void main(String[] args) {\n\t\tScanner input1 = new Scanner (System.in);\n\n\t\tSystem.out.println (\"Enter a number\");\n\n\t\tint a = input1.nextInt();\n\t\t\n\t\t// variável para ser utilizada no ciclo\n\t\tint b = a;\n\t\t\n\t\tint factorialDigit = 0;\n\t\tint factorialValue = 1;\n\t\t\n\t\t// ciclo para retirar um digito de cada vez e multiplica-lo pelo próximo\n\t\twhile (b > 0){\n\t\t\tfactorialDigit = b;\n\t\t\tfactorialValue = factorialDigit * factorialValue;\n\t\t\tb-=1;\n\t\t}\n\t\t\n\t\tSystem.out.println (a + \"!\" + \" = \" + factorialValue);\t\n\t\t\n\t}", "private int getLCD(int a, int b){\n return ( (a * b) / getGCD(a, b) ); \n }", "public static String mult(String bytes,int size, int value){\n if(value<=1||size<1||size>bytes.length()||!Cript2010x8b.USEDIVMULT) return bytes; \n value=Math.abs(value);\n \n size=Operations.multAndDivFixer(size);\n \n String out=\"\"; \n int max=bytes.length()/size; \n if(bytes.length()%size!=0) \n max++; \n for(int i=0;i<max;i++){ \n String subStr=\"\"; \n for(int l=0;l<size;l++) \n try{ \n subStr+=bytes.charAt(i*size+(size-l-1)); \n }catch(Exception e){ \n String bug=bytes.substring(i*size); \n bug=addLong(bug,1,value); \n return out+bug; \n } \n BigInteger current=strToBInt(subStr); \n current=current.multiply(BigInteger.valueOf(value)); \n while(current.compareTo(BigInteger.valueOf(2).pow(8*size))>0)current=current.add(BigInteger.valueOf(2).pow(8*size).negate()); \n while(current.compareTo(BigInteger.ZERO)<0)current=current.add(BigInteger.valueOf(2).pow(8*size)); \n \n out+=BintToStr(current,size); \n } \n return out; \n }", "public int multiplicationFunction(int a, int b) {\n return a*b;\n }", "public String multiply(String num1, String num2) {\n int len1 = num1.length();\n int len2 = num2.length();\n int[] products = new int[len1 + len2];\n //1. compute products from each pair of digits from num1 and num2.\n for (int i = len1 - 1; i >= 0; i -- ) {\n for (int j = len2 - 1; j >= 0; j--) {\n int digit1 = num1.charAt(i) - '0';\n int digit2 = num2.charAt(j) - '0';\n products[i+j+1] += digit1 * digit2;\n }\n }\n //2.carry each element over\n int carry = 0;\n for (int i =products.length - 1; i >= 0; i--){\n int tmp = (products[i] + carry) % 10;\n carry = (products[i] + carry) / 10;\n products[i] = tmp;\n }\n //3.output the solution\n StringBuilder sb = new StringBuilder();\n for (int num : products) sb.append(num);\n // eliminate the leading 0\n while (sb.length() != 0 && sb.charAt(0) == '0') sb.deleteCharAt(0);\n return sb.length() == 0 ? \"0\" : sb.toString();\n }", "public static int anyBaseToDecimal(int n, int b){\n int val = 0;\n\n int p = 1;\n while(n > 0){\n int d = n % 10;\n n = n / 10;\n val += p * d;\n p = p * b;\n }\n\n return val;\n}", "public int modulo(int a, int b) {\n return a % b;\n }", "public HugeUInt mod(int b) {\r\n return mod(new HugeUInt(b));\r\n }", "public static long PGCD (int a, int b) {\r\n\r\n\t\tlong pgcd = 0;\r\n\t\tint r = 0;\r\n\r\n\t\ta = Math.abs(a);\r\n\t\tb = Math.abs(b);\r\n\r\n\t\twhile(true){\r\n\t\t\tif (b == 0) {\r\n\t\t\t\tpgcd = a;\r\n\t\t\t\tbreak;\r\n\t\t\t} else {\r\n\t\t\t\tr = a % b;\r\n\t\t\t\ta = b;\r\n\t\t\t\tb = r;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn pgcd;\r\n\r\n\t}", "public static Digit multiply(Digit first, Digit second){\n Digit result = Digit.Zero();\n Digit multiplier = second.copy();\n\n while(!multiplier.isZero()){\n result = Operations.plus(result, first.copy());\n multiplier = multiplier.previous();\n }\n return result;\n }", "public static void main(String[] args) {\n int a = 15;\n int b = 17;\n\n System.out.println(\"a = \"+a+\" b = \"+b);\n\n a = a^b;\n b = a^b;\n a = a^b;\n\n System.out.println(\"a = \"+a+\" b = \"+b);\n }", "public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tBigInteger num = new BigInteger(\"2\");\r\n\t\tnum = num.pow(1000);\r\n\t\tString str = num.toString();\r\n\t\tint sum = 0;\r\n\t\tfor(int i = 0; i < str.length(); i++) {\r\n\t\t\tString sub = str.substring(i,i+1);\r\n\t\t\tsum = sum + Integer.parseInt(sub);\r\n\t\t}\r\n\t\tSystem.out.println(sum);\r\n\t}", "public static BigDecimal cheng(BigDecimal a, BigDecimal b) {\n\t\tif (a == null || b == null) {\n\t\t\tthrow new RuntimeException(\"乘法参数错误,a:[\" + a + \"],b:[\" + b + \"]\");\n\t\t}\n\t\tBigDecimal multiply = a.multiply(b);\n\t\tBigDecimal result = multiply.setScale(SCALE, RoundingMode.HALF_EVEN);\n\t\tif (LOG.isDebugEnabled()) {\n\t\t\tString str;\n\t\t\tint scale = multiply.scale();\n\t\t\tif (scale > SCALE) {\n\t\t\t\tstr = \"[\" + a + \" * \" + b + \" = \" + multiply + \" ≈ \" + result + \"]\";\n\t\t\t} else if(scale == SCALE) {\n\t\t\t\tstr = \"[\" + a + \" * \" + b + \" = \" + multiply + \"]\";\n\t\t\t} else {\n\t\t\t\tstr = \"[\" + a + \" * \" + b + \" = \" + multiply + \" = \" + result + \"]\";\n\t\t\t}\n\t\t\tLOG.debug(str);\n\t\t}\n\t\treturn result;\n\t}", "abstract int multiplication(int num1, int num2);", "BigInteger getNumber();", "public static int LCM(int a, int b){\r\n int lowest = a * b / GCD(a,b);\r\n //System.out.print(lowest);\r\n return lowest;\r\n }", "public int multiplication(int a, int b) {\n return a * b;\n }", "public static int mul(int value1, int value2){\r\n return value1 * value2;\r\n }", "public int multiply(int a, int b) {\r\n\t\treturn a*b;\r\n\t}", "private static BigInteger multiplyKaratsuba(BigInteger x, BigInteger y) {\n int xlen = x.mag.length;\n int ylen = y.mag.length;\n\n // The number of ints in each half of the number.\n int half = (Math.max(xlen, ylen)+1) / 2;\n\n // xl and yl are the lower halves of x and y respectively,\n // xh and yh are the upper halves.\n BigInteger xl = x.getLower(half);\n BigInteger xh = x.getUpper(half);\n BigInteger yl = y.getLower(half);\n BigInteger yh = y.getUpper(half);\n\n BigInteger p1 = xh.multiply(yh); // p1 = xh*yh\n BigInteger p2 = xl.multiply(yl); // p2 = xl*yl\n\n // p3=(xh+xl)*(yh+yl)\n BigInteger p3 = xh.add(xl).multiply(yh.add(yl));\n\n // result = p1 * 2^(32*2*half) + (p3 - p1 - p2) * 2^(32*half) + p2\n BigInteger result = p1.shiftLeft(32*half).add(p3.subtract(p1).subtract(p2)).shiftLeft(32*half).add(p2);\n\n if (x.signum != y.signum) {\n return result.negate();\n } else {\n return result;\n }\n }", "public static int mcm(int a, int b, int c) {\r\n\t\tint num1,i;\r\n\t\tnum1 = a; \r\n\t if ( b > num1) {\r\n\t num1 = b;\r\n\t \t}\r\n\t if ( c > num1 ) {\r\n\t num1 = c;\r\n\t }\r\n\t i = num1;\r\n\t while ((i % a != 0) || (i % b != 0) || (i % c != 0))\r\n\t i++;\r\n\t\tSystem.out.println(\"--------- Ana, Bernardo y Carlos se reencontraran en la universidad en: \"+i+\" dias. -------------\");\r\n\t\treturn a;\r\n\t}", "java.math.BigInteger getNcbistdaa();", "int kelilingPP(int a, int b){\r\n return 2*(a+b);\r\n }", "public static void main(String[] args){\n Long n = Long.valueOf(5);\n Long q = Long.valueOf(6);\n if(++n == q){\n System.out.println(\"equals\");\n }else{\n System.out.println(\"non-equals\");\n }\n //int m = s.nextInt();\n// BigInteger m1 = new BigInteger(Integer.toString(m));\n// BigInteger fibo1 = fibonaci(n);\n// BigInteger result = fibo1.mod(m1);\n System.out.println();\n// int n = 10;\n// int m = 2;\n// BigInteger fibo1 = fibonaci(n);\n// BigInteger fibo2 = fibonaci(m);\n// BigInteger result = fibo1.mod(fibo2);\n // System.out.println(fibo1 + \" % \" + fibo2 + \" = \" + result + \", \" + BigInteger.);\n }", "public static void main(String[] args) {\n\t\t\r\n\t\ta= a*b;//36\r\n\t\tb=a/b;//9\r\n\t\ta=a/b;//4\r\n\t\t\r\n\t\tSystem.out.println(\"a=\"+a);\r\n\t\t\r\n\t\tSystem.out.println(\"b=\"+b);\r\n\t}", "public static void main(String[] args) {\n System.out.print(\"a= \");\n int a= new Scanner(System.in).nextInt();\n System.out.print(\"b= \");\n int b = new Scanner(System.in).nextInt();\n int c=a*b;\n while (a!=b){\n if (a>b) a=a-b;\n else b=b-a;\n }\n System.out.println(\"UCLN= \"+a);\n System.out.println(\"BCNN= \"+(c/a));\n\n }", "@Test\n public void testReduceToGCD_0_0() {\n NaturalNumber n = new NaturalNumber2(0);\n NaturalNumber m = new NaturalNumber2(0);\n CryptoUtilities.reduceToGCD(n, m);\n assertEquals(\"0\", n.toString());\n assertEquals(\"0\", m.toString());\n }", "@Test\n public void test(){\n int a = 3;\n int b = 6;\n System.out.println(a % b);\n System.out.println(Long.MAX_VALUE);\n }", "static Integer mul(final Integer a, final Integer b) {\n\t\tif (a > b) {\n\t\t\treturn doMul(a, b, null);\n\t\t} else {\n\t\t\treturn doMul(b, a, null);\n\t\t}\n\t}", "public static HugeUInt modPow(HugeUInt m, HugeUInt e, HugeUInt n) {\r\n \tHugeUInt two = new HugeUInt(2);\r\n \tHugeUInt one = new HugeUInt(1);\r\n \tHugeUInt zero = new HugeUInt(0);\r\n \tHugeUInt acc = one;\r\n \tif(e.compareTo(zero)==0){\r\n \t\treturn one;\r\n \t}\r\n \tHugeUInt c = one.multiply(m);\r\n \twhile(e.compareTo(one)>0){\r\n \t\tif(e.mod(two).compareTo(zero)==0){\r\n \t\t\tc = c.multiply(c).mod(n);\r\n \t\t}\r\n \t\telse if(e.mod(two).compareTo(one)==0){\r\n \t\t\tacc = acc.multiply(c).mod(n);\r\n \t\t\tc = c.multiply(c).mod(n);\r\n \t\t}\r\n \t\te = e.divide(two);\r\n \t}\r\n \treturn c.multiply(acc).mod(n);\r\n }", "public static void multiply(int[] n1, int[] n2, int[] result) {\n\t\tint pos = result.length-1;\n\t\t// clear all values....\n\t\tfor (int i = 0; i < result.length; i++) {result[i] = 0; }\n\t\t\n\t\tint off;\n\t\tfor (int m = n1.length-1; m>=0; m--) {\n\t\t\toff = n1.length-1 - m;\n\t\t\tif (n1[m] == 0) {\n\t\t\t\tcontinue; // skip zero multiplier! Won't affect total.\n\t\t\t}\n\t\t\tfor (int n = n2.length-1; n>=0; n--) {\n\t\t\t\tint prod = n1[m]*n2[n];\n\t\t\t\t\n\t\t\t\tresult[pos-off] += prod % 10;\n\t\t\t\tif (result[pos-off] > 9) { // carry internally\n\t\t\t\t\tdo {\n\t\t\t\t\t\tresult[pos-off] -= 10;\n\t\t\t\t\t\tresult[pos-off-1]++;\n\t\t\t\t\t} while (result[pos-off] > 9);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (prod > 9) {\n\t\t\t\t\tresult[pos-off-1] += prod / 10; // deal with carry sum later\n\t\t\t\t}\n\t\t\t\toff++;\n\t\t\t}\n\t\t}\n\t}", "public static long m33345a(long j, long j2) {\n long j3 = j + j2;\n if (j3 < 0) {\n return Long.MAX_VALUE;\n }\n return j3;\n }", "public HugeUInt multiply(int arg) {\r\n HugeUInt result = new HugeUInt(this);\r\n int cur = 0;\r\n for (int i = 0; i < getSize(); i++) {\r\n int m = array[i] * arg + cur;\r\n cur = m / 10;\r\n result.array[i] = m % 10;\r\n }\r\n int[] tmp = new int[10];\r\n int ctr = 0;\r\n while (cur > 0) {\r\n tmp[ctr] = cur % 10;\r\n cur /= 10;\r\n ctr++;\r\n }\r\n int[] mult = new int[ctr+getSize()];\r\n if(ctr > 0){\r\n \tfor(int i = 0;i<getSize();i++){\r\n \t\tmult[i] = result.array[i];\r\n \t}\r\n \tfor(int i = 0;i<ctr;i++){\r\n \t\tmult[i+getSize()] = tmp[i];\r\n \t}\r\n \tresult.array = mult;\r\n }\r\n result.trim();\r\n return result;\r\n }", "private static void helloHelloModulo() {\n int a = 1;\n int b = 10;\n int c = 1 / 10;\n\n int d = 1 % 10;\n\n\n System.out.println(\" Result deleniya \" + c);\n System.out.println(\" Result deleniya \" + d);\n\n\n int делимое = 75;\n int делитель = 13;\n int f = делимое % делитель;\n\n int остаток = делимое - (делимое / делитель) * делитель;\n int j = 7 % 2;\n\n System.out.println(f);\n System.out.println(остаток);\n\n\n }", "long modInverse(long a, long m) \r\n { \r\n\t\t long m0 = m; \r\n long y = 0, x = 1; \r\n \r\n if (m == 1) \r\n return 0; \r\n \r\n while (a > 1) \r\n { \r\n // q is quotient \r\n \tlong q = a / m; \r\n \r\n \tlong t = m; \r\n \r\n // m is remainder now, process \r\n // same as Euclid's algo \r\n m = a % m; \r\n a = t; \r\n t = y; \r\n \r\n // Update x and y \r\n y = x - q * y; \r\n x = t; \r\n } \r\n \r\n // Make x positive \r\n if (x < 0) \r\n x += m0; \r\n \r\n return x; \r\n }", "public static BigInteger bigIntEncrypt(String txt){\n\n\t String res = \"\"; //empty result string\n\n\t for(int i = 0; i < txt.length(); i++){ // for loop to get value of each char and adds to result\n\n\t res += (int)txt.charAt(i) + shift; // adds the num value of ascii to res string\n\n\t }\n\t\t\tSystem.out.println(\"------------------------------------------------\");\n\t System.out.println(\" String of char value + shift: \" + res); // shows the txt in big string format\n\t\t\tSystem.out.println(\"------------------------------------------------\\n\\n\");\n\n\t BigInteger bg = new BigInteger(res); // makes bigint out of res\n\n\n\t BigInteger newBg = bg.multiply(key); // math done to bigint\n\t\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------------------------------------\");\n\t System.out.println(\" String of char values * speical prime: \" + newBg);\n\t\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------------------------------------\\n\\n\");\n\n\t return newBg; // returns bigint, a very very big int\n\t }", "@LargeTest\n public void testMandelbrotfp64() {\n TestAction ta = new TestAction(TestName.MANDELBROT_DOUBLE);\n runTest(ta, TestName.MANDELBROT_DOUBLE.name());\n }", "public static int Multiplication(int a,int b){\n\tint result=a*b;\n\treturn result;\n}", "public static long u(int n)\r\n\t{\r\n\t\tlong result = 0;\r\n\t\tlong current = 1;\r\n\t\tfor (int i = 0; i <= 10; i++)\r\n\t\t{\r\n\t\t\tif (i % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\tresult += current;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tresult -= current;\r\n\t\t\t}\r\n\t\t\tcurrent *= n;\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}", "short digits();", "java.math.BigInteger getNcbi8Aa();", "static int exp(int base, long n) {\n\n // 2^3=8 , 2^x=8 -> x = ln8/ln2 , otherwise x=Math.log(8)/Math/log(2)\n\n return (int) ( Math.log(n)/Math.log(base) );\n }" ]
[ "0.6787988", "0.66366357", "0.6591648", "0.651365", "0.6501512", "0.6426463", "0.6281901", "0.6116628", "0.611173", "0.6088869", "0.60771424", "0.6039374", "0.60372263", "0.6026559", "0.6018412", "0.6009468", "0.59974384", "0.5968792", "0.5923944", "0.59104186", "0.58942175", "0.5887651", "0.58815634", "0.5859184", "0.5848154", "0.5837091", "0.58341986", "0.5824099", "0.58235914", "0.58039856", "0.57996786", "0.57970583", "0.5790724", "0.57765746", "0.57727575", "0.5750377", "0.57300836", "0.57290715", "0.5723922", "0.5716978", "0.57152796", "0.5689229", "0.56652045", "0.5660455", "0.56500834", "0.56477475", "0.5645436", "0.5634505", "0.5634236", "0.5618216", "0.56005603", "0.5597537", "0.5590217", "0.55726564", "0.5561164", "0.5547785", "0.5546432", "0.55271816", "0.5522341", "0.5521644", "0.55162024", "0.55141073", "0.5508783", "0.55086", "0.550694", "0.5489134", "0.5484401", "0.5483459", "0.54818743", "0.5480917", "0.5478785", "0.54782623", "0.5476922", "0.5471952", "0.5462064", "0.5458126", "0.54574144", "0.5456665", "0.5454941", "0.54523534", "0.5452025", "0.54411364", "0.54403913", "0.5433867", "0.54303724", "0.54244953", "0.54035693", "0.54029125", "0.5402492", "0.5402231", "0.5400655", "0.53995425", "0.53946674", "0.5391787", "0.53887266", "0.53777975", "0.53745073", "0.5372213", "0.53603405", "0.53592575" ]
0.7887663
0
It returns the multiplicative inverse modulo 65537 of z
int minverse(int z) { int to,t1; int q,y; if(z<=1) return z; t1=0x10001/z; y=0x10001%z; if(y==1) return (0xffff&(1-t1)); to=1; do { q=z/y; z=z%y; to+=q*t1; if(z==1) return to; q=y/z; y=y%z; t1+=q*to; }while(y!=1); return (0xffff&(1-t1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int ainverse(int z)\n {\n return (65536-z);\n }", "public static double inverseSquare(double z){ //TODO: This needs a little love. Should probably use the repel method instead.\n boolean positive = z >= 0;\n z += positive? 1:(-1);\n double square = Math.pow(z,2);\n return positive? 1/square:square;\n }", "private BigInteger oddModPow(BigInteger y, BigInteger z) {\n /*\n * The algorithm is adapted from Colin Plumb's C library.\n *\n * The window algorithm:\n * The idea is to keep a running product of b1 = n^(high-order bits of exp)\n * and then keep appending exponent bits to it. The following patterns\n * apply to a 3-bit window (k = 3):\n * To append 0: square\n * To append 1: square, multiply by n^1\n * To append 10: square, multiply by n^1, square\n * To append 11: square, square, multiply by n^3\n * To append 100: square, multiply by n^1, square, square\n * To append 101: square, square, square, multiply by n^5\n * To append 110: square, square, multiply by n^3, square\n * To append 111: square, square, square, multiply by n^7\n *\n * Since each pattern involves only one multiply, the longer the pattern\n * the better, except that a 0 (no multiplies) can be appended directly.\n * We precompute a table of odd powers of n, up to 2^k, and can then\n * multiply k bits of exponent at a time. Actually, assuming random\n * exponents, there is on average one zero bit between needs to\n * multiply (1/2 of the time there's none, 1/4 of the time there's 1,\n * 1/8 of the time, there's 2, 1/32 of the time, there's 3, etc.), so\n * you have to do one multiply per k+1 bits of exponent.\n *\n * The loop walks down the exponent, squaring the result buffer as\n * it goes. There is a wbits+1 bit lookahead buffer, buf, that is\n * filled with the upcoming exponent bits. (What is read after the\n * end of the exponent is unimportant, but it is filled with zero here.)\n * When the most-significant bit of this buffer becomes set, i.e.\n * (buf & tblmask) != 0, we have to decide what pattern to multiply\n * by, and when to do it. We decide, remember to do it in future\n * after a suitable number of squarings have passed (e.g. a pattern\n * of \"100\" in the buffer requires that we multiply by n^1 immediately;\n * a pattern of \"110\" calls for multiplying by n^3 after one more\n * squaring), clear the buffer, and continue.\n *\n * When we start, there is one more optimization: the result buffer\n * is implcitly one, so squaring it or multiplying by it can be\n * optimized away. Further, if we start with a pattern like \"100\"\n * in the lookahead window, rather than placing n into the buffer\n * and then starting to square it, we have already computed n^2\n * to compute the odd-powers table, so we can place that into\n * the buffer and save a squaring.\n *\n * This means that if you have a k-bit window, to compute n^z,\n * where z is the high k bits of the exponent, 1/2 of the time\n * it requires no squarings. 1/4 of the time, it requires 1\n * squaring, ... 1/2^(k-1) of the time, it reqires k-2 squarings.\n * And the remaining 1/2^(k-1) of the time, the top k bits are a\n * 1 followed by k-1 0 bits, so it again only requires k-2\n * squarings, not k-1. The average of these is 1. Add that\n * to the one squaring we have to do to compute the table,\n * and you'll see that a k-bit window saves k-2 squarings\n * as well as reducing the multiplies. (It actually doesn't\n * hurt in the case k = 1, either.)\n */\n // Special case for exponent of one\n if (y.equals(ONE))\n return this;\n\n // Special case for base of zero\n if (signum == 0)\n return ZERO;\n\n int[] base = mag.clone();\n int[] exp = y.mag;\n int[] mod = z.mag;\n int modLen = mod.length;\n\n // Select an appropriate window size\n int wbits = 0;\n int ebits = bitLength(exp, exp.length);\n // if exponent is 65537 (0x10001), use minimum window size\n if ((ebits != 17) || (exp[0] != 65537)) {\n while (ebits > bnExpModThreshTable[wbits]) {\n wbits++;\n }\n }\n\n // Calculate appropriate table size\n int tblmask = 1 << wbits;\n\n // Allocate table for precomputed odd powers of base in Montgomery form\n int[][] table = new int[tblmask][];\n for (int i=0; i < tblmask; i++)\n table[i] = new int[modLen];\n\n // Compute the modular inverse\n int inv = -MutableBigInteger.inverseMod32(mod[modLen-1]);\n\n // Convert base to Montgomery form\n int[] a = leftShift(base, base.length, modLen << 5);\n\n MutableBigInteger q = new MutableBigInteger(),\n a2 = new MutableBigInteger(a),\n b2 = new MutableBigInteger(mod);\n\n MutableBigInteger r= a2.divide(b2, q);\n table[0] = r.toIntArray();\n\n // Pad table[0] with leading zeros so its length is at least modLen\n if (table[0].length < modLen) {\n int offset = modLen - table[0].length;\n int[] t2 = new int[modLen];\n for (int i=0; i < table[0].length; i++)\n t2[i+offset] = table[0][i];\n table[0] = t2;\n }\n\n // Set b to the square of the base\n int[] b = squareToLen(table[0], modLen, null);\n b = montReduce(b, mod, modLen, inv);\n\n // Set t to high half of b\n int[] t = Arrays.copyOf(b, modLen);\n\n // Fill in the table with odd powers of the base\n for (int i=1; i < tblmask; i++) {\n int[] prod = multiplyToLen(t, modLen, table[i-1], modLen, null);\n table[i] = montReduce(prod, mod, modLen, inv);\n }\n\n // Pre load the window that slides over the exponent\n int bitpos = 1 << ((ebits-1) & (32-1));\n\n int buf = 0;\n int elen = exp.length;\n int eIndex = 0;\n for (int i = 0; i <= wbits; i++) {\n buf = (buf << 1) | (((exp[eIndex] & bitpos) != 0)?1:0);\n bitpos >>>= 1;\n if (bitpos == 0) {\n eIndex++;\n bitpos = 1 << (32-1);\n elen--;\n }\n }\n\n int multpos = ebits;\n\n // The first iteration, which is hoisted out of the main loop\n ebits--;\n boolean isone = true;\n\n multpos = ebits - wbits;\n while ((buf & 1) == 0) {\n buf >>>= 1;\n multpos++;\n }\n\n int[] mult = table[buf >>> 1];\n\n buf = 0;\n if (multpos == ebits)\n isone = false;\n\n // The main loop\n while (true) {\n ebits--;\n // Advance the window\n buf <<= 1;\n\n if (elen != 0) {\n buf |= ((exp[eIndex] & bitpos) != 0) ? 1 : 0;\n bitpos >>>= 1;\n if (bitpos == 0) {\n eIndex++;\n bitpos = 1 << (32-1);\n elen--;\n }\n }\n\n // Examine the window for pending multiplies\n if ((buf & tblmask) != 0) {\n multpos = ebits - wbits;\n while ((buf & 1) == 0) {\n buf >>>= 1;\n multpos++;\n }\n mult = table[buf >>> 1];\n buf = 0;\n }\n\n // Perform multiply\n if (ebits == multpos) {\n if (isone) {\n b = mult.clone();\n isone = false;\n } else {\n t = b;\n a = multiplyToLen(t, modLen, mult, modLen, a);\n a = montReduce(a, mod, modLen, inv);\n t = a; a = b; b = t;\n }\n }\n\n // Check if done\n if (ebits == 0)\n break;\n\n // Square the input\n if (!isone) {\n t = b;\n a = squareToLen(t, modLen, a);\n a = montReduce(a, mod, modLen, inv);\n t = a; a = b; b = t;\n }\n }\n\n // Convert result out of Montgomery form and return\n int[] t2 = new int[2*modLen];\n System.arraycopy(b, 0, t2, modLen, modLen);\n\n b = montReduce(t2, mod, modLen, inv);\n\n t2 = Arrays.copyOf(b, modLen);\n\n return new BigInteger(1, t2);\n }", "static void pregenInverse() \n\t{ \n\t\tinvfact[0] = invfact[1] = 1; \n\n\t\t// calculates the modInverse of \n\t\t// the last factorial \n\t\tinvfact[1000000] = modInverse(fact[1000000], mod); \n\n\t\t// precalculates the modInverse of \n\t\t// all factorials by formulae \n\t\tfor (int i = 999999; i > 1; --i) \n\t\t{ \n\t\t\tinvfact[i] = (int) (((long) invfact[i + 1] \n\t\t\t\t\t* (long) (i + 1)) % mod); \n\t\t} \n\t}", "private double Phi(double z) {\r\n if (z < -8.0) return 0.0;\r\n if (z > 8.0) return 1.0;\r\n double sum = 0.0, term = z;\r\n for (int i = 3; sum + term != sum; i += 2) {\r\n sum = sum + term;\r\n term = term * z * z / i;\r\n }\r\n return 0.5 + sum * phi(z);\r\n }", "public final int zzj() {\n return this.zzab % 32;\n }", "public Inatnum multiply(Inatnum a) {\n Inatnum zero = new zeronatnum(); // we need a new zero natural number for our res\n Inatnum res = zero;// this is our res value where we store our information, it needs to start at 0\n //INV: i>0 && i-1 <= this.getval() && res = a^(i) ==> i=this.getval()-(this.getval()z-1)\n for(int i = this.getVal(); i>0;i--) {// setting our i value to our this and if its greater than zero decrement by 1\n //INV: i>0 && i <= this.getval() && res = a^i ==> i=this.getval()-(this.getval()\n\t\t\tres = res.add(a);//now we save our res value as the previous res value plus a. we do this as many times as we are multiplying by. So if it is 3 times\n //INV: i>0 && i <= this.getval() && res = a^i ==> i=this.getval()-(this.getval()-1) \n \t\t\t//i-- => i = this.getval()-(this.getval()-1-1)\n \t\t\t //INV: i>0 && i-1 <= this.getval() && res = a^(i) ==> i=this.getval()-(this.getval()-1-1)\n \t\t\t //INV: i>0 && i-1 <= this.getval() && res = a^(i) ==> i=this.getval()-(this.getval()z-1) \n\t\t\t // 4 then we are adding 4 3 times\n }\n\t\t\t //INV: i<0 && i-1 < this.getval() ==> i ==0 && res = a^i ==> i=this.getval()\n //Termination Argument: i starts at this.getval(), i decrements each time through the loop\n\t\t\t\t\t\t return res;// we need to return our res value that holds our current value.\n }", "private int[] multiply(int[] x, int[] y, int[] z)\n {\n for (int i = z.length - 1; i >= 0; i--)\n {\n long a = z[i] & IMASK;\n long value = 0;\n\n for (int j = y.length - 1; j >= 0; j--)\n {\n value += a * (y[j] & IMASK) + (x[i + j + 1] & IMASK);\n\n x[i + j + 1] = (int)value;\n\n value >>>= 32;\n }\n\n x[i] = (int)value;\n }\n\n return x;\n }", "private static int[] multiply(int[] x, int[] y, int[] z)\n {\n int i = z.length;\n\n if (i < 1)\n {\n return x;\n }\n\n int xBase = x.length - y.length;\n\n for (;;)\n {\n long a = z[--i] & IMASK;\n long val = 0;\n\n for (int j = y.length - 1; j >= 0; j--)\n {\n val += a * (y[j] & IMASK) + (x[xBase + j] & IMASK);\n\n x[xBase + j] = (int)val;\n\n val >>>= 32;\n }\n\n --xBase;\n\n if (i < 1)\n {\n if (xBase >= 0)\n {\n x[xBase] = (int)val;\n }\n break;\n }\n\n x[xBase] = (int)val;\n }\n\n return x;\n }", "static String invert (String s) {return power(s,-1);}", "public Complex apply(Complex z) {\r\n\t\tComplex result = Complex.ZERO;\r\n\r\n\t\tfor (int i = 0; i < factors.length; i++) {\r\n\t\t\tresult = result.add(z.power(i).multiply(factors[i]));\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}", "public static void main(String args[]) {\n System.out.print(\"please enter the value of n: \");\n Scanner in = new Scanner(System.in);\n Long n = in.nextLong();\n // generate a prime number p\n p = GEN_pq(n);\n System.out.println(\"p: \" + p);\n // generate a prime number q\n do {\n q = GEN_pq(n);\n } while(p==q);\n\n System.out.println(\"q: \" + q);\n // compute the value of N\n N = p * q;\n System.out.println(\"N: \" + N);\n // compute the value of phi(N)\n phi_N = (p - 1) * (q - 1);\n System.out.println(\"phi(N) : \" + phi_N);\n // generate the exponential number e (e must be smaller than phi(N)\n // and it must be relative prime with phi(N))\n e = GEN_e(phi_N);\n System.out.println(\"e: \" + e);\n // the trapdoor for RSA: d = (k * phi(N) + 1) / e\n d = GEN_d(phi_N);\n// d = (2 * (phi_N) + 1) / e;\n System.out.println(\"d: \" + d);\n // find and add all possible values into set Zn*\n Z = new ArrayList<Long>();\n for (long i = 1; i < N; i++) {\n if (gcd(i, N) == 1) {\n Z.add(i);\n }\n }\n // randomly select an element from the set Zn*\n Random rand = new Random();\n int index = rand.nextInt(Z.size() - 1);\n x = Z.get(index);\n System.out.println(\"x: \" + x);\n long y = encrypt(x, e, N);\n System.out.println(\"y: \" + y);\n long x_prime = decrpyt(y, d, N);\n System.out.println(\"decrypted x: \" + x_prime);\n if (x_prime == x) System.out.println(\"The RSA algorithm is functioning correctly\");\n }", "public int getExponent();", "public static int m22558b(boolean z) {\n return 1;\n }", "java.math.BigInteger getNcbieaa();", "int mul( int a , int b)\n {\n double c,d;\n \tif (a==0)\n\t c=65536;\n\tif(b==0)\n\t d=65536;\n c=(double)a;\n d=(double)b;\n a= (int)((c*d)%65537);\n return a;\n }", "private BigInteger squareToomCook3() {\n int len = mag.length;\n\n // k is the size (in ints) of the lower-order slices.\n int k = (len+2)/3; // Equal to ceil(largest/3)\n\n // r is the size (in ints) of the highest-order slice.\n int r = len - 2*k;\n\n // Obtain slices of the numbers. a2 is the most significant\n // bits of the number, and a0 the least significant.\n BigInteger a0, a1, a2;\n a2 = getToomSlice(k, r, 0, len);\n a1 = getToomSlice(k, r, 1, len);\n a0 = getToomSlice(k, r, 2, len);\n BigInteger v0, v1, v2, vm1, vinf, t1, t2, tm1, da1;\n\n v0 = a0.square();\n da1 = a2.add(a0);\n vm1 = da1.subtract(a1).square();\n da1 = da1.add(a1);\n v1 = da1.square();\n vinf = a2.square();\n v2 = da1.add(a2).shiftLeft(1).subtract(a0).square();\n\n // The algorithm requires two divisions by 2 and one by 3.\n // All divisions are known to be exact, that is, they do not produce\n // remainders, and all results are positive. The divisions by 2 are\n // implemented as right shifts which are relatively efficient, leaving\n // only a division by 3.\n // The division by 3 is done by an optimized algorithm for this case.\n t2 = v2.subtract(vm1).exactDivideBy3();\n tm1 = v1.subtract(vm1).shiftRight(1);\n t1 = v1.subtract(v0);\n t2 = t2.subtract(t1).shiftRight(1);\n t1 = t1.subtract(tm1).subtract(vinf);\n t2 = t2.subtract(vinf.shiftLeft(1));\n tm1 = tm1.subtract(t2);\n\n // Number of bits to shift left.\n int ss = k*32;\n\n return vinf.shiftLeft(ss).add(t2).shiftLeft(ss).add(t1).shiftLeft(ss).add(tm1).shiftLeft(ss).add(v0);\n }", "@Test\n public void testPowerMod_0_0_2() {\n NaturalNumber n = new NaturalNumber2(0);\n NaturalNumber p = new NaturalNumber2(0);\n NaturalNumber m = new NaturalNumber2(2);\n CryptoUtilities.powerMod(n, p, m);\n assertEquals(\"1\", n.toString());\n assertEquals(\"0\", p.toString());\n assertEquals(\"2\", m.toString());\n }", "long modInverse(long a, long m) \r\n { \r\n\t\t long m0 = m; \r\n long y = 0, x = 1; \r\n \r\n if (m == 1) \r\n return 0; \r\n \r\n while (a > 1) \r\n { \r\n // q is quotient \r\n \tlong q = a / m; \r\n \r\n \tlong t = m; \r\n \r\n // m is remainder now, process \r\n // same as Euclid's algo \r\n m = a % m; \r\n a = t; \r\n t = y; \r\n \r\n // Update x and y \r\n y = x - q * y; \r\n x = t; \r\n } \r\n \r\n // Make x positive \r\n if (x < 0) \r\n x += m0; \r\n \r\n return x; \r\n }", "static int yeusOptimized(){\n for(int x=9;x>=0;--x){\tint a=x*100001; //Setting up palindrome. 100001 * 9 = 900009\n for(int y=9;y>=0;--y){\tint b=a+y*10010; //Setting up the inner numbers so 10010*9. 90090 + 900009 = 990099\n for(int z=9;z>=0;--z){\tint n=b+z*1100; //Final inner numbers 9900+990099 = 999999 Palindrome\n for(int i=990;i>99;i-=11){ //Since we start with the largest palindrome, we just need to make sure it is a factor of two 3 digit numbers.\n if(n%i==0){//If there is a remainder, i isn't a factor.\n int t=n/i; //t is the palindrome divided by the factor to get the other factor\n if(t<1000)return n; //make sure that other factor was also a 3 digit number (only one check since we're starting from the maximum possible values)\n }}}}} //And return the palindrome\n return 0;}", "long solve2() {\n\n\t\tfinal long Z = in.nextLong();\n\t\tint p2 = find_prime_index_at_most_n((int) Math.sqrt(Z) + 1) + 1;\n\t\tint p1 = p2 - 1;\n\t\t// out.printf(\"---> primes[%d] = %d\\n\", p2, primes[p2]);\n\t\tlong product = 0;\n\t\twhile (true) {\n\t\t\tlong tmp = primes[p1] * primes[p2];\n\n\t\t\tif (tmp <= Z) {\n\t\t\t\tproduct = tmp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t--p1;\n\t\t\t--p2;\n\t\t}\n\t\treturn product;\n\t}", "public int ItoZ(int i){\n return i%zDim;\n }", "public boolean mo856e(boolean z) {\n int i = this.f630y;\n this.f630y = (z ? 0 : 8) | (i & -9);\n if (i != this.f630y) {\n return true;\n }\n return false;\n }", "private static int modExp(int a, int b, int n) {\n\n // get a char array of the bits in b\n char[] k = (Integer.toBinaryString(b)).toCharArray();\n\n // initialize variables\n int c = 0, f = 1;\n // loop over every bit in k\n for (int i = 0; i < k.length; i ++) {\n\n // for every bit, i.e. if 0 or 1, do this\n c *= 2;\n f = (f * f) % n;\n\n // If current bit is equal to 1, then do this\n if (k[i] == '1') {\n c += 1;\n f = (f * a) % n;\n }\n }\n\n // returns the remainder\n return f;\n }", "private BigInteger modInversePow2(BigInteger m)\n {\n\n if (!testBit(0))\n {\n throw new ArithmeticException(\"Numbers not relatively prime.\");\n }\n\n int pow = m.bitLength() - 1;\n\n long inv64 = modInverse64(longValue());\n if (pow < 64)\n {\n inv64 &= ((1L << pow) - 1);\n }\n\n BigInteger x = BigInteger.valueOf(inv64);\n\n if (pow > 64)\n {\n BigInteger d = this.remainder(m);\n int bitsCorrect = 64;\n\n do\n {\n BigInteger t = x.multiply(d).remainder(m);\n x = x.multiply(TWO.subtract(t)).remainder(m);\n bitsCorrect <<= 1;\n }\n while (bitsCorrect < pow);\n }\n\n if (x.sign < 0)\n {\n x = x.add(m);\n }\n\n return x;\n }", "BigInteger generatePublicExponent(BigInteger p, BigInteger q) {\n return new BigInteger(\"65537\");\n }", "public int R_M(){\n\t\tBigInteger nminus1=n.subtract(BigInteger.ONE);\n\t\tdo{\n\t\t\tif(nminus1.mod(two.pow(a)).equals(BigInteger.ZERO)){\n\t\t\t\ttable.add(a);\n\t\t\t}\n\t\t\titerator++;\n\t\t\ta++;\n\t\t}while(!(two.pow(a).compareTo(n)>0));\n\t\t\n\t\ta=table.get(table.size()-1);\n\t\tBigInteger m=nminus1.divide(two.pow(a));\n\t\tint wlen=n.bitLength();\n\t\tBigInteger b;\n\t\tBigInteger z;\n\t\tfor(int i=0;i<iterations;i++){\n\t\t\tint straznik=0;\n\t\t\tint straznik1=0;\n\t\t\tdo{\n\t\t\t b=new BigInteger(wlen,new Random());\n\t\t\t}while(!(b.compareTo(BigInteger.ONE)>0) && !(b.compareTo(nminus1)<0));\n\t\t\tz=b.modPow(m, n);\n\t\t\tif(z.equals(BigInteger.ONE) || z.equals(nminus1)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfor(int j=0;j<a-1;j++){\n\t\t\t\t\tz=z.pow(2).mod(n);\n\t\t\t\t\tif(z.equals(nminus1)){\n\t\t\t\t\t\tstraznik++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif(z.equals(BigInteger.ONE)){\n\t\t\t\t\t\tstraznik1++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(straznik==1){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(straznik1==1){\n\t\t\t\t\tgetComposite();\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\t}\n\t\t\tgetComposite();\n\t\t\treturn 0;\n\t\t}\n\t\tgetProbablyPrime();\n\t\treturn 1;\n\t\t}", "private static long modInverse64(long d)\n {\n long x = d + (((d + 1L) & 4L) << 1); // d.x == 1 mod 2**4\n x *= 2 - d * x; // d.x == 1 mod 2**8\n x *= 2 - d * x; // d.x == 1 mod 2**16\n x *= 2 - d * x; // d.x == 1 mod 2**32\n x *= 2 - d * x; // d.x == 1 mod 2**64\n// assert d * x == 1L;\n return x;\n }", "private static final byte exp31 (int b, int g) {\n if (b == 0) return 0;\n\n int r = b; // r = b ** 1\n b = mult(b, b, g); // b = b ** 2\n r = mult(r, b, g); // r = b ** 3\n b = mult(b, b, g); // b = b ** 4\n r = mult(r, b, g); // r = b ** 7\n b = mult(b, b, g); // b = b ** 8\n r = mult(r, b, g); // r = b ** 15\n b = mult(b, b, g); // b = b ** 16\n return (byte)mult(r, b, g); // r = b ** 31\n }", "public static long[] depair(long z) {\n long t = (int) (Math.floor((Math.sqrt(8 * z + 1) - 1) / 2));\n long x = t * (t + 3) / 2 - z;\n long y = z - t * (t + 1) / 2;\n return new long[]{x, y}; //Returning an array containing the two numbers\n }", "public static void main(String[] args) {\n\tint base=3 ,exponent=4 , result =1;\r\n\twhile (exponent!=0)\r\n\t{\r\n\t\tresult = result*base;\r\n\t\t--exponent;\r\n\t\t\t}\r\nSystem.out.println(\"the answer is \"+ result);\t\r\n\r\n\t}", "public Integer getExponent();", "static int modInverse(int a, int m) \n\t{ \n\t\tint m0 = m; \n\t\tint y = 0, x = 1; \n\t\tif (m == 1) \n\t\t{ \n\t\t\treturn 0; \n\t\t} \n\n\t\twhile (a > 1) \n\t\t{ \n\n\t\t\t// q is quotient \n\t\t\tint q = a / m; \n\t\t\tint t = m; \n\n\t\t\t// m is remainder now, process \n\t\t\t// same as Euclid's algo \n\t\t\tm = a % m; \n\t\t\ta = t; \n\t\t\tt = y; \n\n\t\t\t// Update y and x \n\t\t\ty = x - q * y; \n\t\t\tx = t; \n\t\t} \n\n\t\t// Make x positive \n\t\tif (x < 0) \n\t\t{ \n\t\t\tx += m0; \n\t\t} \n\n\t\treturn x; \n\t}", "private static long modPow(long a, long b, long c) {\n long res = 1;\n for (int i = 0; i < b; i++)\n {\n res *= a;\n res %= c;\n }\n return res % c;\n }", "public final synchronized void mo39730e(boolean z) {\n this.f40702C += z ? 1 : -1;\n if (this.f40702C <= 0 && this.f40729k != null) {\n this.f40729k.mo37831q();\n }\n }", "private static int Maj(int x, int y, int z) {\n\t\treturn (x & y) | (z & (x ^ y));\n\t}", "public long mo9776z() {\n long j = 0;\n for (int i = 0; i < 64; i += 7) {\n byte u = mo9771u();\n j |= ((long) (u & Byte.MAX_VALUE)) << i;\n if ((u & 128) == 0) {\n return j;\n }\n }\n throw C3606c0.m8178e();\n }", "private int Ch(int x, int y, int z) {\n return (x & y) ^ (~x & z);\n }", "public double getModZ() {\n return (modZ != 0 ? ( modZ > 0 ? (modZ - RESTADOR) : (modZ + RESTADOR) ) : modZ);\n }", "private int Maj(int x, int y, int z) {\n return (x & y) ^ (x & z) ^ (y & z);\n }", "public long mo9763z() {\n long j = 0;\n for (int i = 0; i < 64; i += 7) {\n byte u = mo9758u();\n j |= ((long) (u & Byte.MAX_VALUE)) << i;\n if ((u & 128) == 0) {\n return j;\n }\n }\n throw C3606c0.m8178e();\n }", "java.math.BigInteger getNcbistdaa();", "public static long pow(long a, long n, long mod) {\n//\t\ta %= mod;\n long ret = 1;\n int x = 63 - Long.numberOfLeadingZeros(n);\n for (; x >= 0; x--) {\n ret = ret * ret % mod;\n if (n << 63 - x < 0) {\n ret = ret * a % mod;\n }\n }\n return ret;\n }", "static /* synthetic */ C5894b m23546a(C5670a aVar, boolean z) {\n C5894b bVar = new C5894b();\n int limit = aVar.f18205b.limit();\n ByteBuffer byteBuffer = aVar.f18205b;\n if (z && limit >= 1024 && !aVar.f18204a.mo28228c()) {\n ByteBuffer byteBuffer2 = aVar.f18205b;\n byte[] array = byteBuffer2.array();\n int position = byteBuffer2.position();\n int limit2 = byteBuffer2.limit() - byteBuffer2.position();\n byte[] bArr = new byte[(limit2 + 4 + (limit2 / 1000) + 12)];\n Deflater deflater = new Deflater();\n deflater.setInput(array, position, limit2);\n deflater.finish();\n int deflate = deflater.deflate(bArr);\n deflater.end();\n byteBuffer = ByteBuffer.allocate(deflate + 4);\n byteBuffer.order(ByteOrder.LITTLE_ENDIAN);\n byteBuffer.putInt(limit2);\n byteBuffer.put(bArr, 0, deflate);\n byteBuffer.flip();\n limit = byteBuffer.limit();\n aVar.f18204a.mo28230e();\n }\n C5888a aVar2 = aVar.f18204a;\n int i = 5;\n if (aVar.f18204a.mo28229d()) {\n i = 7;\n }\n aVar2.mo28222a(i + limit);\n bVar.mo28249a((C5891a) aVar.f18204a);\n bVar.mo28251a(byteBuffer);\n return bVar;\n }", "public static double f(double z){\n return 1 / (1 + Math.exp(-z));\n }", "public static long u(int n)\r\n\t{\r\n\t\tlong result = 0;\r\n\t\tlong current = 1;\r\n\t\tfor (int i = 0; i <= 10; i++)\r\n\t\t{\r\n\t\t\tif (i % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\tresult += current;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tresult -= current;\r\n\t\t\t}\r\n\t\t\tcurrent *= n;\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}", "public static int m8448e(int i) {\n return (-(i & 1)) ^ (i >>> 1);\n }", "public static long zigzagDecode(long value)\n {\n return (value >>> 1) ^ -(value & 1);\n }", "static long mpow(long x, int k) {\n\t long result = 1;\n\t for(; k > 0; k >>= 1) {\n\t if(k % 2 == 1) {\n\t result = mod(result * x ,511);\n\t }\n\t x = mod(x * x , 511);\n\t }\n\t return result;\n\t}", "private static BigInteger encrypt(BigInteger x, BigInteger e, BigInteger n) {\r\n\t\treturn x.modPow(e, n);\r\n\t}", "public static void main(String[] args) {\n\t\tScanner inp= new Scanner(System.in);\n\t\tBigInteger n,m,z;\n\t\tBigInteger x=inp.nextBigInteger();\n\t\tn= x.subtract(new BigInteger(\"1\"));\n\t\tz=x.subtract(new BigInteger(\"3\"));\n\t\tm=n.multiply(z);\n\t\tm=m.add(new BigInteger(\"1\"));\n\t\tSystem.out.println(m);\n\t\t\n\n\t}", "public void m9731b(boolean z) {\r\n this.f6261j = bw.m10068a(this.f6261j, 1, z);\r\n }", "public int mo46249b(boolean z) {\n return C14794o.m64623b(this.f43069b, z);\n }", "private void ModInvBigNbr(int[] a, int[] inv, int[] b, int NumberLength) {\r\n\t\tint i;\r\n\t\tint Dif, E;\r\n\t\tint st1, st2;\r\n\t\tlong Yaa, Yab; // 2^E * A' = Yaa A + Yab B\r\n\t\tlong Yba, Ybb; // 2^E * B' = Yba A + Ybb B\r\n\t\tlong Ygb0; // 2^E * Mu' = Yaa Mu + Yab Gamma + Ymb0 B0\r\n\t\tlong Ymb0; // 2^E * Gamma' = Yba Mu + Ybb Gamma + Ygb0 B0\r\n\t\tint Iaa, Iab, Iba, Ibb;\r\n\t\tlong Tmp1, Tmp2, Tmp3, Tmp4, Tmp5;\r\n\t\tint B0l;\r\n\t\tint invB0l;\r\n\t\tint Al, Bl, T1, Gl, Ml;\r\n\t\tlong carry1, carry2, carry3, carry4;\r\n\t\tint Yaah, Yabh, Ybah, Ybbh;\r\n\t\tint Ymb0h, Ygb0h;\r\n\t\tlong Pr1, Pr2, Pr3, Pr4, Pr5, Pr6, Pr7;\r\n\t\tlong[] B = this.CalcAuxModInvBB;\r\n\t\tlong[] CalcAuxModInvA = this.CalcAuxModInvA;\r\n\t\tlong[] CalcAuxModInvB = this.CalcAuxModInvB;\r\n\t\tlong[] CalcAuxModInvMu = this.CalcAuxModInvMu;\r\n\t\tlong[] CalcAuxModInvGamma = this.CalcAuxModInvGamma;\r\n\r\n\t\tif (NumberLength >= 2 && b[NumberLength - 1] == 0 && b[NumberLength - 2] < 0x40000000) {\r\n\t\t\tNumberLength--;\r\n\t\t}\r\n\t\tConvert31To32Bits(a, CalcAuxModInvA, NumberLength);\r\n\t\tConvert31To32Bits(b, CalcAuxModInvB, NumberLength);\r\n\t\tSystem.arraycopy(CalcAuxModInvB, 0, B, 0, NumberLength);\r\n\t\tB0l = (int) B[0];\r\n\t\tinvB0l = B0l; // 2 least significant bits of inverse correct.\r\n\t\tinvB0l = invB0l * (2 - B0l * invB0l); // 4 LSB of inverse correct.\r\n\t\tinvB0l = invB0l * (2 - B0l * invB0l); // 8 LSB of inverse correct.\r\n\t\tinvB0l = invB0l * (2 - B0l * invB0l); // 16 LSB of inverse correct.\r\n\t\tinvB0l = invB0l * (2 - B0l * invB0l); // 32 LSB of inverse correct.\r\n\t\tfor (i = NumberLength - 1; i >= 0; i--) {\r\n\t\t\tCalcAuxModInvGamma[i] = 0;\r\n\t\t\tCalcAuxModInvMu[i] = 0;\r\n\t\t}\r\n\t\tCalcAuxModInvMu[0] = 1;\r\n\t\tDif = 0;\r\n\t\touter_loop: for (;;) {\r\n\t\t\tIaa = Ibb = 1;\r\n\t\t\tIab = Iba = 0;\r\n\t\t\tAl = (int) CalcAuxModInvA[0];\r\n\t\t\tBl = (int) CalcAuxModInvB[0];\r\n\t\t\tE = 0;\r\n\t\t\tif (Bl == 0) {\r\n\t\t\t\tfor (i = NumberLength - 1; i >= 0; i--) {\r\n\t\t\t\t\tif (CalcAuxModInvB[i] != 0)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (i < 0)\r\n\t\t\t\t\tbreak; // Go out of loop if CalcAuxModInvB = 0\r\n\t\t\t}\r\n\t\t\tfor (;;) {\r\n\t\t\t\tT1 = 0;\r\n\t\t\t\twhile ((Bl & 1) == 0) {\r\n\t\t\t\t\tif (E == 31) {\r\n\t\t\t\t\t\tYaa = Iaa;\r\n\t\t\t\t\t\tYab = Iab;\r\n\t\t\t\t\t\tYba = Iba;\r\n\t\t\t\t\t\tYbb = Ibb;\r\n\t\t\t\t\t\tGl = (int) CalcAuxModInvGamma[0];\r\n\t\t\t\t\t\tMl = (int) CalcAuxModInvMu[0];\r\n\t\t\t\t\t\tDif++;\r\n\t\t\t\t\t\tT1++;\r\n\t\t\t\t\t\tYaa <<= T1;\r\n\t\t\t\t\t\tYab <<= T1;\r\n\t\t\t\t\t\tYmb0 = (-(int) Yaa * Ml - (int) Yab * Gl) * invB0l;\r\n\t\t\t\t\t\tYgb0 = (-Iba * Ml - Ibb * Gl) * invB0l;\r\n\t\t\t\t\t\tcarry1 = carry2 = carry3 = carry4 = 0;\r\n\t\t\t\t\t\tYaah = (int) (Yaa >> 32);\r\n\t\t\t\t\t\tYabh = (int) (Yab >> 32);\r\n\t\t\t\t\t\tYbah = (int) (Yba >> 32);\r\n\t\t\t\t\t\tYbbh = (int) (Ybb >> 32);\r\n\t\t\t\t\t\tYmb0h = (int) (Ymb0 >> 32);\r\n\t\t\t\t\t\tYgb0h = (int) (Ygb0 >> 32);\r\n\t\t\t\t\t\tYaa &= 0xFFFFFFFFL;\r\n\t\t\t\t\t\tYab &= 0xFFFFFFFFL;\r\n\t\t\t\t\t\tYba &= 0xFFFFFFFFL;\r\n\t\t\t\t\t\tYbb &= 0xFFFFFFFFL;\r\n\t\t\t\t\t\tYmb0 &= 0xFFFFFFFFL;\r\n\t\t\t\t\t\tYgb0 &= 0xFFFFFFFFL;\r\n\r\n\t\t\t\t\t\tst1 = Yaah * 6 + Yabh * 2 + Ymb0h;\r\n\t\t\t\t\t\tst2 = Ybah * 6 + Ybbh * 2 + Ygb0h;\r\n\t\t\t\t\t\tfor (i = 0; i < NumberLength; i++) {\r\n\t\t\t\t\t\t\tPr1 = Yaa * (Tmp1 = CalcAuxModInvMu[i]);\r\n\t\t\t\t\t\t\tPr2 = Yab * (Tmp2 = CalcAuxModInvGamma[i]);\r\n\t\t\t\t\t\t\tPr3 = Ymb0 * (Tmp3 = B[i]);\r\n\t\t\t\t\t\t\tPr4 = (Pr1 & 0xFFFFFFFFL) + (Pr2 & 0xFFFFFFFFL) + (Pr3 & 0xFFFFFFFFL) + carry3;\r\n\t\t\t\t\t\t\tPr5 = Yaa * (Tmp4 = CalcAuxModInvA[i]);\r\n\t\t\t\t\t\t\tPr6 = Yab * (Tmp5 = CalcAuxModInvB[i]);\r\n\t\t\t\t\t\t\tPr7 = (Pr5 & 0xFFFFFFFFL) + (Pr6 & 0xFFFFFFFFL) + carry1;\r\n\t\t\t\t\t\t\tswitch (st1) {\r\n\t\t\t\t\t\t\tcase -9:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1 - Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -8:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1 - Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -7:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -6:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -5:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1 + Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -4:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1 + Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -3:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -2:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -1:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = 0;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\t\t\tcarry3 = 0;\r\n\t\t\t\t\t\t\t\tcarry1 = 0;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1 - Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 4:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1 - Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 5:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 6:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 7:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1 + Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 8:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1 + Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcarry3 += (Pr1 >>> 32) + (Pr2 >>> 32) + (Pr3 >>> 32) + (Pr4 >> 32);\r\n\t\t\t\t\t\t\tcarry1 += (Pr5 >>> 32) + (Pr6 >>> 32) + (Pr7 >> 32);\r\n\t\t\t\t\t\t\tif (i > 0) {\r\n\t\t\t\t\t\t\t\tCalcAuxModInvMu[i - 1] = Pr4 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\t\t\tCalcAuxModInvA[i - 1] = Pr7 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tPr1 = Yba * Tmp1;\r\n\t\t\t\t\t\t\tPr2 = Ybb * Tmp2;\r\n\t\t\t\t\t\t\tPr3 = Ygb0 * Tmp3;\r\n\t\t\t\t\t\t\tPr4 = (Pr1 & 0xFFFFFFFFL) + (Pr2 & 0xFFFFFFFFL) + (Pr3 & 0xFFFFFFFFL) + carry4;\r\n\t\t\t\t\t\t\tPr5 = Yba * Tmp4;\r\n\t\t\t\t\t\t\tPr6 = Ybb * Tmp5;\r\n\t\t\t\t\t\t\tPr7 = (Pr5 & 0xFFFFFFFFL) + (Pr6 & 0xFFFFFFFFL) + carry2;\r\n\t\t\t\t\t\t\tswitch (st2) {\r\n\t\t\t\t\t\t\tcase -9:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1 - Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -8:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1 - Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -7:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -6:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -5:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1 + Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -4:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1 + Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -3:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -2:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -1:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = 0;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\t\t\tcarry4 = 0;\r\n\t\t\t\t\t\t\t\tcarry2 = 0;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1 - Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 4:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1 - Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 5:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 6:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 7:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1 + Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 8:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1 + Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcarry4 += (Pr1 >>> 32) + (Pr2 >>> 32) + (Pr3 >>> 32) + (Pr4 >> 32);\r\n\t\t\t\t\t\t\tcarry2 += (Pr5 >>> 32) + (Pr6 >>> 32) + (Pr7 >> 32);\r\n\t\t\t\t\t\t\tif (i > 0) {\r\n\t\t\t\t\t\t\t\tCalcAuxModInvGamma[i - 1] = Pr4 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\t\t\tCalcAuxModInvB[i - 1] = Pr7 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ((int) CalcAuxModInvA[i - 1] < 0) {\r\n\t\t\t\t\t\t\tcarry1 -= Yaa;\r\n\t\t\t\t\t\t\tcarry2 -= Yba;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ((int) CalcAuxModInvB[i - 1] < 0) {\r\n\t\t\t\t\t\t\tcarry1 -= Yab;\r\n\t\t\t\t\t\t\tcarry2 -= Ybb;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ((int) CalcAuxModInvMu[i - 1] < 0) {\r\n\t\t\t\t\t\t\tcarry3 -= Yaa;\r\n\t\t\t\t\t\t\tcarry4 -= Yba;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ((int) CalcAuxModInvGamma[i - 1] < 0) {\r\n\t\t\t\t\t\t\tcarry3 -= Yab;\r\n\t\t\t\t\t\t\tcarry4 -= Ybb;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tCalcAuxModInvA[i - 1] = carry1 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\tCalcAuxModInvB[i - 1] = carry2 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\tCalcAuxModInvMu[i - 1] = carry3 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\tCalcAuxModInvGamma[i - 1] = carry4 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\tcontinue outer_loop;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tBl >>= 1;\r\n\t\t\t\t\tDif++;\r\n\t\t\t\t\tE++;\r\n\t\t\t\t\tT1++;\r\n\t\t\t\t} /* end while */\r\n\t\t\t\tIaa <<= T1;\r\n\t\t\t\tIab <<= T1;\r\n\t\t\t\tif (Dif >= 0) {\r\n\t\t\t\t\tDif = -Dif;\r\n\t\t\t\t\tif (((Al + Bl) & 3) == 0) {\r\n\t\t\t\t\t\tT1 = Iba;\r\n\t\t\t\t\t\tIba += Iaa;\r\n\t\t\t\t\t\tIaa = T1;\r\n\t\t\t\t\t\tT1 = Ibb;\r\n\t\t\t\t\t\tIbb += Iab;\r\n\t\t\t\t\t\tIab = T1;\r\n\t\t\t\t\t\tT1 = Bl;\r\n\t\t\t\t\t\tBl += Al;\r\n\t\t\t\t\t\tAl = T1;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tT1 = Iba;\r\n\t\t\t\t\t\tIba -= Iaa;\r\n\t\t\t\t\t\tIaa = T1;\r\n\t\t\t\t\t\tT1 = Ibb;\r\n\t\t\t\t\t\tIbb -= Iab;\r\n\t\t\t\t\t\tIab = T1;\r\n\t\t\t\t\t\tT1 = Bl;\r\n\t\t\t\t\t\tBl -= Al;\r\n\t\t\t\t\t\tAl = T1;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (((Al + Bl) & 3) == 0) {\r\n\t\t\t\t\t\tIba += Iaa;\r\n\t\t\t\t\t\tIbb += Iab;\r\n\t\t\t\t\t\tBl += Al;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tIba -= Iaa;\r\n\t\t\t\t\t\tIbb -= Iab;\r\n\t\t\t\t\t\tBl -= Al;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tDif--;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (CalcAuxModInvA[0] != 1) {\r\n\t\t\tSubtractBigNbr32(B, CalcAuxModInvMu, CalcAuxModInvMu, NumberLength);\r\n\t\t}\r\n\t\tif ((int) CalcAuxModInvMu[i = NumberLength - 1] < 0) {\r\n\t\t\tAddBigNbr32(B, CalcAuxModInvMu, CalcAuxModInvMu, NumberLength);\r\n\t\t}\r\n\t\tfor (; i >= 0; i--) {\r\n\t\t\tif (B[i] != CalcAuxModInvMu[i])\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif (i < 0 || B[i] < CalcAuxModInvMu[i]) { // If B < Mu\r\n\t\t\tSubtractBigNbr32(CalcAuxModInvMu, B, CalcAuxModInvMu, NumberLength); // Mu <- Mu - B\r\n\t\t}\r\n\t\tConvert32To31Bits(CalcAuxModInvMu, inv, NumberLength);\r\n\t}", "private BigInteger decrypt(BigInteger encryptedMessage) {\n return encryptedMessage.modPow(d, n);\n }", "long mo25071a(long j);", "private Proof notDividesStepGreater(int n, int m, Expression z) {\n Expression a = intToLit(n); //[n]\n Expression b = intToLit(m); //[m]\n java.util.function.Function<Proof, Proof> stepFunction = p -> faxm2ConvertTwice(faxm8Gen(a, z), p);\n Expression equal = equal(multi(a, succ(z)), b); //a * z' = b\n Proof notGreaterLemma = notGreaterLemma(multi(a, z), n, m); //!(a*z+[n]=[m])\n return subNot(equal, notGreaterLemma, stepFunction); //(a*z'=b) -> (!a*z+[n]=[m]) -> ... -> !([n]*z'=m)\n }", "BigInteger getNumber();", "public static int maximumPower(String s) {\n int power = 1,maxpower=1;\n for (int i = 0; i < s.length()-1; i++) {\n System.out.println(\"i \" + i);\n System.err.println(s + \" \" + Integer.parseInt(s, 2));\n int decimal = Integer.parseInt(s, 2);\n power = 1;\n System.out.println(\"result \" + decimal / Math.pow(2, power));\n if (decimal % Math.pow(2, power) == 0)\n {\n maxpower = max(maxpower,power);\n while(decimal % Math.pow(2, ++power) == 0){}\n maxpower = max(maxpower,power);\n\n } \n else if (decimal % Math.pow(2, power) < 0) {\n System.out.println(\"inside \" + decimal / Math.pow(2, power));\n s = leftrotate(s) + \"\";\n continue;\n } else {\n\n while (decimal >= Math.pow(2, ++power) / 2) {\n System.out.println(\"inside while \" + decimal / Math.pow(2, power));\n if (decimal % Math.pow(2, power) == 0)\n maxpower = max(maxpower, power);\n else if (decimal % Math.pow(2, power) < 0)\n break;\n }\n }\n System.out.println(\"End \");\n s = leftrotate(s) + \"\";\n\n }\n\n return maxpower;\n\n }", "Up(int z) {x *= 3; }", "public void m9727a(boolean z) {\r\n this.f6261j = bw.m10068a(this.f6261j, 0, z);\r\n }", "public static int FermatPT(int n) {\n\n for (int i = 2; i < (n/3); i++) {\n\n if((longPow(i,n-1,n))!=1){\n return i;\n }\n\n }\n\n\t\treturn 0;\n\t}", "private int z(int i, Complex prevZ) {\n\t\t\tif(i == 0) return z(1, Complex.ZERO);\n\t\t\tif(i >= maxIts) return maxIts;\n\t\t\telse {\n\t\t\t\tComplex res = c.add(prevZ.square());\n\t\t\t\tif (res.modulusSquared() < 4.0) {\n\t\t\t\t\treturn z(i+1, res);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tescapeZ = res;\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}", "@Test\n public void testInversePrime() {\n final GaloisPrimeField field = new GaloisPrimeField(13);\n final GaloisElement element = field.element(9);\n final GaloisElement inverse = galoisInverse.invert(element);\n Assertions.assertEquals(BigInteger.valueOf(3), inverse.value());\n }", "public long mo9787z() {\n long j = 0;\n for (int i = 0; i < 64; i += 7) {\n byte u = mo9782u();\n j |= ((long) (u & Byte.MAX_VALUE)) << i;\n if ((u & 128) == 0) {\n return j;\n }\n }\n throw C3606c0.m8178e();\n }", "public static int m8644b(int i, boolean z) {\n return m8669h(i) + 1;\n }", "public final int hashCode() {\n int n = 0;\n int n2 = this.getClass().getName().hashCode();\n int n3 = Arrays.hashCode(this.zzlmn);\n int n4 = this.zzlmo == null ? 0 : this.zzlmo.hashCode();\n long l = Double.doubleToLongBits(this.zzlmp);\n int n5 = (int)(l ^ l >>> 32);\n int n6 = Float.floatToIntBits(this.zzlmq);\n int n7 = (int)(this.zzlmr ^ this.zzlmr >>> 32);\n int n8 = this.zzlms;\n int n9 = this.zzlmt;\n int n10 = this.zzlmu ? 1231 : 1237;\n int n11 = zzfjq.hashCode(this.zzlmv);\n int n12 = zzfjq.hashCode(this.zzlmw);\n int n13 = zzfjq.hashCode(this.zzlmx);\n int n14 = zzfjq.hashCode(this.zzlmy);\n int n15 = zzfjq.hashCode(this.zzlmz);\n int n16 = (int)(this.zzlna ^ this.zzlna >>> 32);\n int n17 = n;\n if (this.zzpnc == null) return (((((((n10 + ((((((n4 + ((n2 + 527) * 31 + n3) * 31) * 31 + n5) * 31 + n6) * 31 + n7) * 31 + n8) * 31 + n9) * 31) * 31 + n11) * 31 + n12) * 31 + n13) * 31 + n14) * 31 + n15) * 31 + n16) * 31 + n17;\n if (this.zzpnc.isEmpty()) {\n n17 = n;\n return (((((((n10 + ((((((n4 + ((n2 + 527) * 31 + n3) * 31) * 31 + n5) * 31 + n6) * 31 + n7) * 31 + n8) * 31 + n9) * 31) * 31 + n11) * 31 + n12) * 31 + n13) * 31 + n14) * 31 + n15) * 31 + n16) * 31 + n17;\n }\n n17 = this.zzpnc.hashCode();\n return (((((((n10 + ((((((n4 + ((n2 + 527) * 31 + n3) * 31) * 31 + n5) * 31 + n6) * 31 + n7) * 31 + n8) * 31 + n9) * 31) * 31 + n11) * 31 + n12) * 31 + n13) * 31 + n14) * 31 + n15) * 31 + n16) * 31 + n17;\n }", "public final byte[] mo9765a(int i, boolean z) {\n byte[] f = mo9766f(i);\n if (f != null) {\n if (z) {\n f = (byte[]) f.clone();\n }\n return f;\n }\n int i2 = this.f9082i;\n int i3 = this.f9080g;\n int i4 = i3 - i2;\n this.f9084k += i3;\n this.f9082i = 0;\n this.f9080g = 0;\n List g = mo9767g(i - i4);\n byte[] bArr = new byte[i];\n System.arraycopy(this.f9079f, i2, bArr, 0, i4);\n Iterator it = ((ArrayList) g).iterator();\n while (it.hasNext()) {\n byte[] bArr2 = (byte[]) it.next();\n System.arraycopy(bArr2, 0, bArr, i4, bArr2.length);\n i4 += bArr2.length;\n }\n return bArr;\n }", "public final HashMap<Integer, Long> zzu() {\n HashMap<Integer, Long> hashMap = new HashMap<>();\n hashMap.put(0, this.zzsp);\n hashMap.put(1, this.zzsq);\n hashMap.put(2, this.zzsr);\n hashMap.put(3, this.zzfr);\n hashMap.put(4, this.zzfp);\n hashMap.put(5, this.zzss);\n hashMap.put(6, this.zzst);\n hashMap.put(7, this.zzsu);\n hashMap.put(8, this.zzfw);\n hashMap.put(9, this.zzfv);\n hashMap.put(10, this.zzsv);\n return hashMap;\n }", "public static void main(String[] args) {\n BigDecimal bigDecimal = new BigDecimal(2);\n BigDecimal divisor = bigDecimal.pow(256);\n BigDecimal dividend = divisor.add(new BigDecimal(-1));\n BigDecimal multiplier = new BigDecimal(2).pow(128);\n// BigDecimal result = dividend.divide(divisor).pow(multiplier);\n// System.out.println(result);\n }", "private int m10266c(int i) {\r\n return (i << 1) ^ (i >> 31);\r\n }", "private void m11877b(boolean z) {\n if (z) {\n m11880e();\n if (this.f9672a != null && ((Integer) C8946b.f24361M.mo22117a()).intValue() > 0) {\n this.f9672a.mo9587b(((Integer) C8946b.f24361M.mo22117a()).intValue());\n }\n }\n }", "private static long m22586i(long j) {\n return (j >> 63) ^ (j << 1);\n }", "public final void mo25936b(boolean z) {\n mo25943g();\n }", "public static HugeUInt modPow(HugeUInt m, HugeUInt e, HugeUInt n) {\r\n \tHugeUInt two = new HugeUInt(2);\r\n \tHugeUInt one = new HugeUInt(1);\r\n \tHugeUInt zero = new HugeUInt(0);\r\n \tHugeUInt acc = one;\r\n \tif(e.compareTo(zero)==0){\r\n \t\treturn one;\r\n \t}\r\n \tHugeUInt c = one.multiply(m);\r\n \twhile(e.compareTo(one)>0){\r\n \t\tif(e.mod(two).compareTo(zero)==0){\r\n \t\t\tc = c.multiply(c).mod(n);\r\n \t\t}\r\n \t\telse if(e.mod(two).compareTo(one)==0){\r\n \t\t\tacc = acc.multiply(c).mod(n);\r\n \t\t\tc = c.multiply(c).mod(n);\r\n \t\t}\r\n \t\te = e.divide(two);\r\n \t}\r\n \treturn c.multiply(acc).mod(n);\r\n }", "private static int m31084a(zzss zzss) {\n int a = zzss.mo32193a(5);\n if (a == 31) {\n return zzss.mo32193a(6) + 32;\n }\n return a;\n }", "public BigIntegerMod decrypt(Ciphertext ciphertext);", "public long mo9786y() {\n long j;\n long j2;\n long j3;\n byte b;\n long j4 = this.f9091i;\n if (this.f9090h != j4) {\n long j5 = j4 + 1;\n byte a = C3691q1.m8803a(j4);\n if (a >= 0) {\n this.f9091i = j5;\n return (long) a;\n } else if (this.f9090h - j5 >= 9) {\n long j6 = j5 + 1;\n byte a2 = a ^ (C3691q1.m8803a(j5) << 7);\n if (a2 < 0) {\n b = a2 ^ Byte.MIN_VALUE;\n } else {\n long j7 = j6 + 1;\n byte a3 = a2 ^ (C3691q1.m8803a(j6) << 14);\n if (a3 >= 0) {\n j = (long) (a3 ^ 16256);\n } else {\n j6 = j7 + 1;\n byte a4 = a3 ^ (C3691q1.m8803a(j7) << 21);\n if (a4 < 0) {\n b = a4 ^ -2080896;\n } else {\n j7 = j6 + 1;\n long a5 = ((long) a4) ^ (((long) C3691q1.m8803a(j6)) << 28);\n if (a5 >= 0) {\n j3 = 266354560;\n } else {\n long j8 = j7 + 1;\n long a6 = a5 ^ (((long) C3691q1.m8803a(j7)) << 35);\n if (a6 < 0) {\n j2 = -34093383808L;\n } else {\n j7 = j8 + 1;\n a5 = a6 ^ (((long) C3691q1.m8803a(j8)) << 42);\n if (a5 >= 0) {\n j3 = 4363953127296L;\n } else {\n j8 = j7 + 1;\n a6 = a5 ^ (((long) C3691q1.m8803a(j7)) << 49);\n if (a6 < 0) {\n j2 = -558586000294016L;\n } else {\n j7 = j8 + 1;\n j = (a6 ^ (((long) C3691q1.m8803a(j8)) << 56)) ^ 71499008037633920L;\n if (j < 0) {\n long j9 = 1 + j7;\n if (((long) C3691q1.m8803a(j7)) >= 0) {\n j6 = j9;\n this.f9091i = j6;\n return j;\n }\n }\n }\n }\n }\n j = a6 ^ j2;\n j6 = j8;\n this.f9091i = j6;\n return j;\n }\n j = a5 ^ j3;\n }\n }\n j6 = j7;\n this.f9091i = j6;\n return j;\n }\n j = (long) b;\n this.f9091i = j6;\n return j;\n }\n }\n return mo9787z();\n }", "static long flippingBits(long n) {\n\n String strBinary = String.format(\"%32s\", Long.toBinaryString(n)).replace(' ', '0');\n String strBinaryFlip = \"\";\n\n for (int i = 0; i < strBinary.length(); i++) {\n if (strBinary.charAt(i) == '0') {\n strBinaryFlip = strBinaryFlip + '1';\n } else {\n strBinaryFlip = strBinaryFlip + '0';\n }\n }\n\n String result = String.format(\"%32s\", strBinaryFlip).replace(' ', '0');\n long base10 = parseLong(result,2);\n return base10;\n }", "public final void mo13474e(boolean z) {\n mo13387d();\n int i = this.f4883i;\n boolean[] zArr = this.f4882h;\n if (i == zArr.length) {\n boolean[] zArr2 = new boolean[C0843a.m432H(i, 3, 2, 1)];\n System.arraycopy(zArr, 0, zArr2, 0, i);\n this.f4882h = zArr2;\n }\n boolean[] zArr3 = this.f4882h;\n int i2 = this.f4883i;\n this.f4883i = i2 + 1;\n zArr3[i2] = z;\n }", "public abstract long mo9748m();", "private int m690g(int i) {\n return (-(i & 1)) ^ (i >>> 1);\n }", "static void pregenFact() \n\t{ \n\t\tfact[0] = fact[1] = 1; \n\t\tfor (int i = 1; i <= 1000000; ++i) \n\t\t{ \n\t\t\tfact[i] = (int) ((long) fact[i - 1] * i % mod); \n\t\t} \n\t}", "public BitSet factor(Z n) {\n if (n == null || Z.ZERO.equals(n)) {\n return null;\n }\n final BitSet v = new BitSet(size());\n if (n.signum() < 0) {\n v.set(0);\n n = n.negate();\n }\n for (int i = 1; i < size(); ++i) {\n final int p = mFactorBase[i];\n // check for 2 since we can do this quicker than normal\n if (p == 2) {\n final Z on = n.makeOdd();\n if ((n.auxiliary() & 1) != 0) {\n v.set(i);\n }\n n = on;\n continue;\n }\n boolean c = false;\n Z t = n.divide(p);\n while (n.auxiliary() == 0) {\n n = t;\n c ^= true;\n t = n.divide(p);\n }\n if (c) {\n v.set(i);\n }\n if (Z.ONE.equals(n)) {\n return v;\n }\n }\n return null;\n }", "public int zzz() {\n int i = 0;\n int zzz = super.zzz();\n if (!Arrays.equals(this.zzbuO, zzsx.zzbuD)) {\n zzz += zzsn.zzb(1, this.zzbuO);\n }\n if (this.zzbuP != null && this.zzbuP.length > 0) {\n int i2 = 0;\n int i3 = 0;\n while (i < this.zzbuP.length) {\n byte[] bArr = this.zzbuP[i];\n if (bArr != null) {\n i3++;\n i2 += zzsn.zzG(bArr);\n }\n i++;\n }\n zzz = (zzz + i2) + (i3 * 1);\n }\n return this.zzbuQ ? zzz + zzsn.zzf(3, this.zzbuQ) : zzz;\n }", "private int hashFunc(String input) {\n\t\tBigInteger value = BigInteger.valueOf(0);\n\t\tBigInteger k2 = new BigInteger(\"27\");\n\t\tchar c = input.charAt(0);\n\t\tlong i1 = (int) c - 96;\n\t\tBigInteger k1 = new BigInteger(\"0\");\n\t\tk1 = k1.add(BigInteger.valueOf(i1));\n\t\tvalue = k1;\n\n\t\tfor (int i = 1; i < input.length(); i++) {\n\n\t\t\tchar c2 = input.charAt(i);\n\n\t\t\tvalue = value.multiply(k2);\n\n\t\t\tlong i2 = (int) c2 - 96;\n\t\t\tBigInteger k3 = new BigInteger(\"0\");\n\t\t\tk3 = k3.add(BigInteger.valueOf(i2));\n\n\t\t\tvalue = value.add(k3);\n\n\t\t}\n\t\tBigInteger size = new BigInteger(\"0\");\n\t\tsize = size.add(BigInteger.valueOf(this.size));\n\t\tvalue = value.mod(size);\n\n\t\treturn value.intValue();\n\t}", "@Test\n public void testLargeM() {\n assertEquals(32, PiGenerator.powerMod(2, 5, 42423131));\n }", "BigInteger multiply(long v) {\n if (v == 0 || signum == 0)\n return ZERO;\n if (v == BigDecimal.INFLATED)\n return multiply(BigInteger.valueOf(v));\n int rsign = (v > 0 ? signum : -signum);\n if (v < 0)\n v = -v;\n long dh = v >>> 32; // higher order bits\n long dl = v & LONG_MASK; // lower order bits\n\n int xlen = mag.length;\n int[] value = mag;\n int[] rmag = (dh == 0L) ? (new int[xlen + 1]) : (new int[xlen + 2]);\n long carry = 0;\n int rstart = rmag.length - 1;\n for (int i = xlen - 1; i >= 0; i--) {\n long product = (value[i] & LONG_MASK) * dl + carry;\n rmag[rstart--] = (int)product;\n carry = product >>> 32;\n }\n rmag[rstart] = (int)carry;\n if (dh != 0L) {\n carry = 0;\n rstart = rmag.length - 2;\n for (int i = xlen - 1; i >= 0; i--) {\n long product = (value[i] & LONG_MASK) * dh +\n (rmag[rstart] & LONG_MASK) + carry;\n rmag[rstart--] = (int)product;\n carry = product >>> 32;\n }\n rmag[0] = (int)carry;\n }\n if (carry == 0L)\n rmag = java.util.Arrays.copyOfRange(rmag, 1, rmag.length);\n return new BigInteger(rmag, rsign);\n }", "@Override\n public Z computeNext() {\n int n = size();\n if (n <= 2) {\n return Z.valueOf(mInits[n]);\n }\n final int pow2 = Integer.highestOneBit(n);\n final int j = n - pow2;\n Z result = a(j).multiply(mFaj0).add(a(j + 1).multiply(mFaj1));\n if (j == pow2 - 1) {\n result = result.add(1);\n }\n return result;\n \n }", "public final C26661i mo68364c(boolean z) {\n this.f70294k = z;\n return this;\n }", "public int mo3844z() {\n return mo3828p() + this.f1431F;\n }", "public int reverseBits5(int n) {\n long x = 0;\n for(int i=0;i<32;i++){\n x+= Math.pow(2,31-i)*(n>>i&1);\n }\n return (int)x;\n }", "private int computeZi(int i) {\r\n\t\tdouble counter = 1;\r\n\t\tfor (int j = 1; j <= Party.n; j++) {\r\n\t\t\tif (j != i) {\r\n\t\t\t\tcounter = counter * Polynomial.fieldDiv(-j, i - j);\r\n\t\t\t\t// ((double)-j/ (double)(i-j));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn Gate.modField((int) counter);\r\n\t}", "@Test\n public void testInverseStressPrime() {\n final GaloisPrimeField field = new GaloisPrimeField(15_485_863);\n final GaloisElement element = field.element(1_000_000);\n final GaloisElement inverse = galoisInverse.invert(element);\n Assertions.assertEquals(BigInteger.valueOf(2_540_812), inverse.value());\n }", "public void calcS(){\n if (n.subtract(one).mod(new BigNumber(\"2\")).compareTo(zero)!=0){\n s=zero;\n return;\n }\n while(n.subtract(one).mod(pow(two,s)).compareTo(zero)!=0){\n //System.out.println(s);\n s=s.add(one);\n }\n s=s.subtract(one);\n }", "public static void main(String args[] ) throws Exception {\n Scanner in = new Scanner(System.in);\n \n String original = in.next();\n int n = original.length();\n long moda = 1000000007;\n long ones = 1;\n long sum=0; \n for (int s=original.length()-1; s>=0; s--) {\n sum = (sum + (s+1) * (original.charAt(s) - '0') * ones) %moda; \n ones = (ones * 10 + 1) % moda;\n \n }\n \n System.out.println(sum);\n \n }", "public int reverseBits3(int n) {\n int x = 0;\n for(int i=0;i<32;i++){\n x = (x<<1) + (n&1);\n n=n>>1;\n }\n return x;\n }", "private int m10275g(int i) {\r\n return (i >>> 1) ^ (-(i & 1));\r\n }", "@Test\n public void testNegativeM() {\n assertEquals(-1, PiGenerator.powerMod(2, 2, -1));\n }", "private int m1283a(int i, int i2) {\r\n int i3 = 1;\r\n for (int i4 = 0; i4 < i2; i4++) {\r\n i3 *= i;\r\n }\r\n return i3;\r\n }" ]
[ "0.778067", "0.639217", "0.6385185", "0.6111918", "0.5846904", "0.5837657", "0.5832245", "0.58249086", "0.5799687", "0.5679355", "0.5656584", "0.56472445", "0.5640302", "0.5626046", "0.5601423", "0.5599251", "0.5590304", "0.55807996", "0.5545214", "0.55431056", "0.5542029", "0.5533301", "0.55331355", "0.552504", "0.55065566", "0.5506126", "0.54979795", "0.54892516", "0.54878116", "0.54647017", "0.5450426", "0.5443904", "0.5442666", "0.54307073", "0.5430355", "0.54127866", "0.54099244", "0.5403743", "0.5393629", "0.5361334", "0.533524", "0.53185594", "0.52795255", "0.52530307", "0.5239054", "0.5233005", "0.52194035", "0.5208878", "0.5205815", "0.52015007", "0.51743245", "0.5172783", "0.5169319", "0.5163308", "0.5155724", "0.5154815", "0.51437885", "0.5143613", "0.5143232", "0.5142845", "0.5138145", "0.5132513", "0.5127422", "0.5126094", "0.5124543", "0.51219743", "0.5105607", "0.51031023", "0.5093821", "0.50933784", "0.5090494", "0.5089326", "0.5085666", "0.50609404", "0.5060757", "0.5052535", "0.50513166", "0.5051064", "0.5037116", "0.5028595", "0.50272983", "0.5018743", "0.5013512", "0.5013045", "0.50118697", "0.50028133", "0.5002353", "0.49967957", "0.49967253", "0.4994127", "0.4993574", "0.49930784", "0.49876243", "0.49848226", "0.497961", "0.4976141", "0.49737987", "0.49692783", "0.4966889", "0.4960364" ]
0.6458997
1
It return the additive inverse of z
int ainverse(int z) { return (65536-z); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static double inverseSquare(double z){ //TODO: This needs a little love. Should probably use the repel method instead.\n boolean positive = z >= 0;\n z += positive? 1:(-1);\n double square = Math.pow(z,2);\n return positive? 1/square:square;\n }", "Matrix InverseT()\n {\n Matrix ad = new Matrix( y.cross(z), z.cross(x), x.cross(y) );\n float inv_det = 1.0f / ( x.dot( ad.x ) );\n ad.timesEqual( inv_det );\n return ad;\n }", "public double fInvSum(double x, double y, double z);", "public void addToZ(int z){\n\t\tcurrentSet().Z.add(z);\n\t\tcurrentSet().inZ[z] = true;\n\t}", "public Complex Minus (Complex z) {\n\nreturn new Complex(u-z.u,v-z.v);\n\n}", "public double activation(double z);", "private int z(int i, Complex prevZ) {\n\t\t\tif(i == 0) return z(1, Complex.ZERO);\n\t\t\tif(i >= maxIts) return maxIts;\n\t\t\telse {\n\t\t\t\tComplex res = c.add(prevZ.square());\n\t\t\t\tif (res.modulusSquared() < 4.0) {\n\t\t\t\t\treturn z(i+1, res);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tescapeZ = res;\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}", "public Complex negate() {\n return new Complex(-re, -im);\n }", "public Complex apply(Complex z) {\r\n\t\tComplex result = Complex.ZERO;\r\n\r\n\t\tfor (int i = 0; i < factors.length; i++) {\r\n\t\t\tresult = result.add(z.power(i).multiply(factors[i]));\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}", "public Quaternion conjugate()\n {\n x = -x;\n y = -y;\n z = -z;\n\n return this;\n }", "public Fraction inverse() {\n return new Fraction (denominator, numerator).reduce();\n }", "public double activationDerivative(double z);", "public Complex Plus (Complex z) {\nreturn new Complex(u+z.u,v+z.v);\n\n}", "float getZ();", "float getZ();", "float getZ();", "public double Iz() {\r\n\t\tdouble iz = 0;\r\n\t\tfor(int i = 0;i < liczbaPunktow;i++) {\r\n\t\t\tiz = iz + A[i].getMasa() * (Math.pow((XYZC[0] - A[i].getPozX()),2) + Math.pow((XYZC[1] - A[i].getPozY()),2));\r\n\t\t}\r\n\t\treturn iz;\r\n\t}", "public void removeFromZ(int z){\n\t\tcurrentSet().Z.remove(new Integer(z));\n\t\tcurrentSet().inZ[z] = false;\n\t}", "public final zzgol<zzgop<?>> zzn() {\n zzr();\n return this.zzae;\n }", "public static int comparitiveInt(int x, int y, int z){\n\t\tint zed = (z << 12);\n\t\tint cosum = x + y;\n\t\treturn zed + cosum;\n\t}", "public Vector3 invert()\n {\n this.scale(-1);\n return this;\n }", "private int computeZi(int i) {\r\n\t\tdouble counter = 1;\r\n\t\tfor (int j = 1; j <= Party.n; j++) {\r\n\t\t\tif (j != i) {\r\n\t\t\t\tcounter = counter * Polynomial.fieldDiv(-j, i - j);\r\n\t\t\t\t// ((double)-j/ (double)(i-j));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn Gate.modField((int) counter);\r\n\t}", "public float getLocalZ(){\n\t\treturn this.z;\n\t}", "public int ItoZ(int i){\n return i%zDim;\n }", "public static Vector3f negate(Vector3f vec) {\n\t\tVector3f result = new Vector3f();\n\n\t\tresult.x = -vec.x;\n\t\tresult.y = -vec.y;\n\t\tresult.z = -vec.z;\n\n\t\treturn result;\n\t}", "public Double z() {\n return z;\n }", "public float getZ(){\n\t\tif(!isRoot()){\n\t\t\treturn getParent().getZ() + z;\n\t\t}else{\n\t\t\treturn z;\n\t\t}\n\t}", "public Vector3 negateLocal () {\n return negate(this);\n }", "public double getZ() {\r\n\t\treturn z;\t\r\n\t\t}", "public double getZ(){\n\t\treturn z;\n\t}", "public static double f(double z){\n return 1 / (1 + Math.exp(-z));\n }", "public double getZ() {\n\t\treturn z;\n\t}", "public double getZ() {\n\t\treturn z;\n\t}", "public final int zzb() {\n return this.zzc.zzc() + this.zza + this.zzb;\n }", "public static String NRZi(String input) {\n ArrayList<String> out = new ArrayList<>();\n out.add(\"UP\");\n for (int i = 0; i < input.length(); i++) {\n if ((Character.toString(input.charAt(i))).equals(\"0\")) {\n String before = out.get(out.size() - 1);\n out.add(before);\n } else {\n String before = out.get(out.size() - 1);\n out.add(inverse(before));\n }\n }\n out.remove(out.size()-1);\n String output = ArraytoString(out);\n return output;\n }", "public double Z_r() {\r\n \t\treturn getZ();\r\n \t}", "public CubieCube inverseCube() {\n\n CubieCube clone = this.clone();\n for (int i = 0; i < edgesValues.length; i++) {\n clone.eo[i] = this.eo[clone.ep[i]];\n }\n for (int i = 0; i < cornerValues.length; i++) {\n char ori = this.co[clone.cp[i]];\n if (ori >= 3)\n clone.co[i] = ori;\n else {\n clone.co[i] = (char) -ori;\n if (clone.co[i] < 0)\n clone.co[i] += 3;\n }\n }\n return clone;\n }", "int invert(int c) {\n int index = wrap(c);\n if (_inverse != null && _inverse.containsKey(index)) {\n return _inverse.get(index);\n } else {\n return index;\n }\n }", "public DynamicCuboid setExtraZ(float z) {\n this.extraZ = z;\n return this;\n }", "@Override\n\tpublic double getZ() {\n\t\treturn z;\n\t}", "public Vector2f negateLocal ()\n {\n return negate(this);\n }", "public double getModZ() {\n return (modZ != 0 ? ( modZ > 0 ? (modZ - RESTADOR) : (modZ + RESTADOR) ) : modZ);\n }", "public final double getZ() {\n return z;\n }", "int minverse(int z)\n {\n int to,t1;\n int q,y;\n if(z<=1)\n return z;\n t1=0x10001/z;\n y=0x10001%z;\n if(y==1)\n return (0xffff&(1-t1));\n to=1;\n do\n {\n q=z/y;\n z=z%y;\n to+=q*t1;\n if(z==1)\n return to;\n q=y/z;\n y=y%z;\n t1+=q*to;\n }while(y!=1);\n return (0xffff&(1-t1));\n }", "int getZ();", "int getZ();", "int getZ();", "public double getZ() {\r\n return z;\r\n }", "private double Phi(double z) {\r\n if (z < -8.0) return 0.0;\r\n if (z > 8.0) return 1.0;\r\n double sum = 0.0, term = z;\r\n for (int i = 3; sum + term != sum; i += 2) {\r\n sum = sum + term;\r\n term = term * z * z / i;\r\n }\r\n return 0.5 + sum * phi(z);\r\n }", "public int zzu() {\n int zzu = super.zzu();\n if (this.zzcwX) {\n zzu += zzbyc.zzh(1, this.zzcwX);\n }\n if (this.score != 0) {\n zzu += zzbyc.zzL(2, this.score);\n }\n return (this.zzcwY == null || this.zzcwY.equals(\"\")) ? zzu : zzu + zzbyc.zzr(3, this.zzcwY);\n }", "public RMTransform getTransformInverse() { return getTransform().invert(); }", "public static long[] depair(long z) {\n long t = (int) (Math.floor((Math.sqrt(8 * z + 1) - 1) / 2));\n long x = t * (t + 3) / 2 - z;\n long y = z - t * (t + 1) / 2;\n return new long[]{x, y}; //Returning an array containing the two numbers\n }", "Edge inverse() {\n return bond.inverse().edge(u, v);\n }", "public float getZ() {\r\n return z;\r\n }", "public float dst2(float x, float y, float z) {\r\n\t\tfinal float a = x - this.x;\r\n\t\tfinal float b = y - this.y;\r\n\t\tfinal float c = z - this.z;\r\n\t\treturn a * a + b * b + c * c;\r\n\t}", "public static double getYFromZ(double z) {\n\t\treturn 0.23 + 2.41 * z;\n\t}", "public void invert() {\n\t\tthis.vector.setXYZ(-this.vector.x(), -this.vector.y(), -this.vector.z());\n\t\tthis.energy = -this.energy;\n\t}", "@Override\n public Optional<Curve> inverse() {\n Optional<Curve> invF = f.inverse();\n Optional<Curve> invG = g.inverse();\n\n if (invF.isPresent() && invG.isPresent()) {\n return Optional.of(new ComposedCurve(invF.get(), invG.get()));\n } else {\n return Optional.empty();\n }\n }", "public Fp12_2Over3Over2 inverse() {\n final Fp6_3Over2 t0 = c0.square();\n final Fp6_3Over2 t1 = c1.square();\n final Fp6_3Over2 t2 = t0.sub(mulByNonResidue(t1));\n final Fp6_3Over2 t3 = t2.inverse();\n\n return new Fp12_2Over3Over2(c0.mul(t3), c1.mul(t3).negate(), Fp12Parameters);\n }", "@NullableDecl\n public K putInverse(@NullableDecl V v, @NullableDecl K k, boolean z) {\n int smearedHash = Hashing.smearedHash(v);\n int findEntryByValue = findEntryByValue(v, smearedHash);\n if (findEntryByValue != -1) {\n K k2 = this.keys[findEntryByValue];\n if (Objects.equal(k2, k)) {\n return k;\n }\n replaceKeyInEntry(findEntryByValue, k, z);\n return k2;\n }\n int i = this.lastInInsertionOrder;\n int smearedHash2 = Hashing.smearedHash(k);\n int findEntryByKey = findEntryByKey(k, smearedHash2);\n if (!z) {\n Preconditions.checkArgument(findEntryByKey == -1, \"Key already present: %s\", (Object) k);\n } else if (findEntryByKey != -1) {\n i = this.prevInInsertionOrder[findEntryByKey];\n removeEntryKeyHashKnown(findEntryByKey, smearedHash2);\n }\n ensureCapacity(this.size + 1);\n K[] kArr = this.keys;\n int i2 = this.size;\n kArr[i2] = k;\n this.values[i2] = v;\n insertIntoTableKToV(i2, smearedHash2);\n insertIntoTableVToK(this.size, smearedHash);\n int i3 = i == -2 ? this.firstInInsertionOrder : this.nextInInsertionOrder[i];\n setSucceeds(i, this.size);\n setSucceeds(this.size, i3);\n this.size++;\n this.modCount++;\n return null;\n }", "@Override\n public synchronized UnitConverter inverse() {\n if (inverse == null) {\n inverse = new ConcatenatedConverter(c2.inverse(), c1.inverse());\n inverse.inverse = this;\n }\n return inverse;\n }", "public float getZ() {\n return z_;\n }", "public int getZ() {\n\t\treturn z;\n\t}", "float getAccZ();", "private int Maj(int x, int y, int z) {\n return (x & y) ^ (x & z) ^ (y & z);\n }", "Up(int z) {x *= 3; }", "static String invert (String s) {return power(s,-1);}", "public static Geometry addZ(Geometry geometry, double z) {\n if (geometry == null) {\n return null;\n }\n geometry.apply(new AddZCoordinateSequenceFilter(z));\n return geometry;\n }", "public final void aw(boolean z) {\n long nanoTime = System.nanoTime();\n int as = z & ad.as(244587008);\n if (as != 0) {\n ad.az(this.ad * -741699531, this.aq * -811519509, (byte) -1);\n ad.au(this.ad * -741699531, this.aq * -811519509, -2053924975);\n ad.ax(this.al * 1369093391, this.aj * 584615187, this.ai * -475191339, this.ae * -1618628917, 21417922);\n if (this.ak) {\n ad.aj(1653707327);\n } else {\n ad.al((byte) 64);\n }\n ad.aw(this.ar, -1367293456);\n ad.ah((byte) -63);\n }\n if (!this.ak) {\n ad.ao(as, 1030553594);\n }\n this.am = (as != 0 ? ad.bk(103890613) : 0) * 1274222927;\n this.ak = false;\n ad.ai(as, 958667652);\n this.as = (System.nanoTime() - nanoTime) * 4035494141653645513L;\n ad.ae((short) -1771);\n }", "public Matrix inverse() {\n\t\tMatrix a = copy();\n\t\tif (a.M != a.N) {\n\t\t\tthrow new RuntimeException(\"This matrix is not square!\");\n\t\t}\n\t\tMatrix i = identity(a.N);\n\t\tMatrix ai = a.augment(i);\n\t\tai = ai.specialrref();\n\t\tMatrix[] split = ai.split(a.N);\n\t\tif (split[0].equals(i)) {\n\t\t\treturn split[1];\n\t\t} else {\n\t\t\tthrow new RuntimeException(\"This matrix is not invertible!\");\n\t\t}\n\t}", "public int zzz() {\n int i = 0;\n int zzz = super.zzz();\n if (!Arrays.equals(this.zzbuO, zzsx.zzbuD)) {\n zzz += zzsn.zzb(1, this.zzbuO);\n }\n if (this.zzbuP != null && this.zzbuP.length > 0) {\n int i2 = 0;\n int i3 = 0;\n while (i < this.zzbuP.length) {\n byte[] bArr = this.zzbuP[i];\n if (bArr != null) {\n i3++;\n i2 += zzsn.zzG(bArr);\n }\n i++;\n }\n zzz = (zzz + i2) + (i3 * 1);\n }\n return this.zzbuQ ? zzz + zzsn.zzf(3, this.zzbuQ) : zzz;\n }", "@Override\n public void invert() {\n getInvertibles().parallelStream().forEach(Invertible::invert);\n }", "public final void ac(boolean z) {\n long nanoTime = System.nanoTime();\n int as = z & ad.as(-1409706074);\n if (as != 0) {\n ad.az(this.ad * -741699531, this.aq * -811519509, (byte) -50);\n ad.au(this.ad * -2014038998, this.aq * -707040389, 1246179272);\n ad.ax(this.al * -1470761931, this.aj * -944397439, this.ai * -653460071, this.ae * -1618628917, 21417922);\n if (this.ak) {\n ad.aj(1653707327);\n } else {\n ad.al((byte) 64);\n }\n ad.aw(this.ar, -1367293456);\n ad.ah((byte) -9);\n }\n if (!this.ak) {\n ad.ao(as, 225366076);\n }\n this.am = (as != 0 ? ad.bk(-1896751802) : 0) * 1274222927;\n this.ak = false;\n ad.ai(as, 2071987460);\n this.as = (System.nanoTime() - nanoTime) * 4035494141653645513L;\n ad.ae((short) -30360);\n }", "public DynamicCuboid setZ(float z) {\n this.z = z;\n return this;\n }", "public float getZ() {\n return z_;\n }", "double getz() {\nreturn this.z;\n }", "@java.lang.Override\n public godot.wire.Wire.Vector3 getZ() {\n return z_ == null ? godot.wire.Wire.Vector3.getDefaultInstance() : z_;\n }", "public abstract O reciprocal();", "public VectorA scalarAdd(double z)\n {\n return new VectorA(this.x+z, this.y+z);\n }", "public static double eyeZToNormalizedEyeZ(double ze, double n, double f)\n\t{\n\t\treturn (f + n) / (f - n) - 2 * f * n / (f - n) / ze;\n\t}", "public Binary negative(){\n\n Binary ret1= this.flip();\n Binary ret2= ret1.suma1();\n return ret2;\n }", "public FImage inverse() {\n\t\tfinal int cs = real.getCols();\n\t\tfinal int rs = real.getRows();\n\n\t\tfinal FloatFFT_2D fft = new FloatFFT_2D(rs, cs);\n\t\tfinal float[][] prepared = new float[rs][cs * 2];\n\t\tfor (int y = 0; y < rs; y++) {\n\t\t\tfor (int x = 0; x < cs; x++) {\n\t\t\t\tprepared[y][x * 2] = real.pixels[y][x];\n\t\t\t\tprepared[y][1 + x * 2] = imaginary.pixels[y][x];\n\t\t\t}\n\t\t}\n\n\t\tfft.complexInverse(prepared, true);\n\n\t\tfinal FImage image = new FImage(cs, rs);\n\t\tFourierTransform.unprepareData(prepared, image, centre);\n\n\t\treturn image;\n\t}", "public boolean isInversed() {\n return isinv != null && isinv.booleanValue();\n }", "private int Ch(int x, int y, int z) {\n return (x & y) ^ (~x & z);\n }", "public void SEZ() {\n konami.cc |= CC_Z;\n }", "public Vector4d setZ(double z) {\n\t\tthis.z = z;\n\t\treturn this;\n\t}", "public JTensor cinv() {\n JTensor r = new JTensor();\n TH.THTensor_(cinv)(r, this);\n return r;\n }", "public Matrix getInversematrixS()\n {\n // Build alpha * I\n double [][] alphainvmatrix;\n alphainvmatrix = new double[x + 1][x + 1];\n for(int i = 0; i < x + 1; i++)\n {\n alphainvmatrix[i][i] = alpha;\n\n }\n Matrix alphamatrixnew = new Matrix(alphainvmatrix);\n\n // calculate summation\n Matrix sum = new Matrix(x + 1, 1);\n int i = 1;\n while (i <= arraylistofprices.size() - 1) {\n phimatrix(i);\n\n sum.plusEquals(phi);\n\n i++;\n }\n Matrix summation = sum.times(phiT);\n summation.timesEquals(beta); \n\n // alpha * I + beta * sum\n Matrix sInv = alphamatrixnew.plus(summation);\n return sInv;\n }", "private void makeInverse() {\n if (_map != null) {\n for (Map.Entry<Integer, Integer> e : _map.entrySet()) {\n _inverse.put(e.getValue(), e.getKey());\n }\n }\n }", "@Override\n public void Invert() {\n\t \n }", "public int getZ() {\r\n return z;\r\n }", "public final /* synthetic */ void zzx() {\n zzbu zzw = zzw();\n if (zzw != null) {\n this.zzbb.add(zzw);\n }\n }", "public final void invert() {\n\tdouble s = determinant();\n\tif (s == 0.0)\n\t return;\n\ts = 1/s;\n\t// alias-safe way.\n\tset(\n\t m11*m22 - m12*m21, m02*m21 - m01*m22, m01*m12 - m02*m11,\n\t m12*m20 - m10*m22, m00*m22 - m02*m20, m02*m10 - m00*m12,\n\t m10*m21 - m11*m20, m01*m20 - m00*m21, m00*m11 - m01*m10\n\t );\n\tmul((float)s);\n }", "public int getZ() {\n return z;\n }", "@java.lang.Override\n public float getZ() {\n return z_;\n }", "@java.lang.Override\n public float getZ() {\n return z_;\n }", "public int getBlockZ()\n\t {\n\t\t if(z >= 0.0) return (int)z;\n\t\t return -1 + (int)(z);\n\t }", "private static double[] xyzToIzazbz(CieXyzAbs xyz) {\n // This equation (#4) is wrong in the paper; below is the correct version.\n // It can be derived from the inverse model (supplementary paper) or the original Jzazbz paper.\n double xp = B*xyz.x - (B-1)*xyz.z;\n double yp = G*xyz.y - (G-1)*xyz.x;\n\n double rp = pqInv( 0.41478972*xp + 0.579999*yp + 0.0146480*xyz.z);\n double gp = pqInv(-0.20151000*xp + 1.120649*yp + 0.0531008*xyz.z);\n double bp = pqInv(-0.01660080*xp + 0.264800*yp + 0.6684799*xyz.z);\n\n double az = 3.524000*rp + -4.066708*gp + 0.542708*bp;\n double bz = 0.199076*rp + 1.096799*gp + -1.295875*bp;\n double Iz = gp - EPSILON;\n\n return new double[]{Iz, az, bz};\n }", "public final int zza() {\n int zza = super.zza();\n if (this.zzaue != null) {\n zza += zzacb.zzf(1, this.zzaue.intValue());\n }\n if (this.zzauf != null) {\n zza += zzacb.zzc(2, this.zzauf);\n }\n if (this.zzaug != null) {\n this.zzaug.booleanValue();\n zza += zzacb.zzaq(3) + 1;\n }\n if (this.zzauh == null || this.zzauh.length <= 0) {\n return zza;\n }\n int i = 0;\n int i2 = 0;\n int i3 = 0;\n while (i3 < this.zzauh.length) {\n int zzfr;\n String str = this.zzauh[i3];\n if (str != null) {\n i++;\n zzfr = zzacb.zzfr(str) + i2;\n } else {\n zzfr = i2;\n }\n i3++;\n i2 = zzfr;\n }\n return (zza + i2) + (i * 1);\n }", "public Index invert() {\n \t\tint n=length();\n \t\tIndex ni=new Index(n);\n \t\tfor (int i=0; i<n; i++) {\n \t\t\tni.set(this.get(i), i);\n \t\t}\n \t\treturn ni;\n \t}" ]
[ "0.7178958", "0.6150118", "0.6141441", "0.6020324", "0.5948845", "0.57555944", "0.57495636", "0.57223505", "0.5703836", "0.5646365", "0.5632647", "0.5622921", "0.5618788", "0.557676", "0.557676", "0.557676", "0.5527771", "0.5523165", "0.5514064", "0.5438532", "0.54328907", "0.54248327", "0.54110503", "0.5400331", "0.5380775", "0.53801984", "0.53754145", "0.5358652", "0.5347952", "0.5323283", "0.52768576", "0.5262249", "0.5262249", "0.5255619", "0.5251116", "0.52462065", "0.52371985", "0.52361745", "0.5230943", "0.5226685", "0.522151", "0.52117985", "0.52068096", "0.51901305", "0.5183741", "0.5183741", "0.5183741", "0.51827466", "0.5175047", "0.516705", "0.515814", "0.51573384", "0.5155124", "0.51423377", "0.5140819", "0.5134844", "0.51347345", "0.5124725", "0.51191545", "0.5098661", "0.5096311", "0.5093152", "0.50893545", "0.5085171", "0.50832605", "0.5081404", "0.50808775", "0.5079901", "0.50792575", "0.5077841", "0.50604683", "0.50575703", "0.5056179", "0.5028395", "0.5016393", "0.5012314", "0.50114477", "0.5005677", "0.49984053", "0.4993573", "0.4993266", "0.49902323", "0.49854222", "0.4984304", "0.4982067", "0.49768233", "0.49485776", "0.4944612", "0.49418443", "0.4941712", "0.49414852", "0.49405438", "0.4935245", "0.49349022", "0.4933278", "0.4933278", "0.49290642", "0.492897", "0.4920138", "0.4914923" ]
0.73771346
0
Default constructor for test class Segment1Test
public Segment1Test() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public SegmentTree() {}", "public ZTest1() {\n this(\"z_test1\", null);\n }", "public SegmentInformationTable()\n\t{\n\n\t}", "@Test\n public void constructorTest() throws IOException {\n LogSegment segment = getSegment(\"log_current\", LogSegmentTest.STANDARD_SEGMENT_SIZE, false);\n Assert.assertEquals(\"Start offset should be 0 when no headers are written\", 0, segment.getStartOffset());\n }", "protected TestBench() {}", "public PathTest() {\r\n \tsuper(null);\r\n }", "public StrandUnitTest()\n {\n }", "public Spec__1() {\n }", "public Test()\n {\n }", "@Test\n\tpublic void testConstructor() {\n\t\tassertEquals(\"testID\", this.getId());\n\t\tassertEquals(\"/namespaces/test\", this.getPath());\n\t}", "public RoadTest()\n {\n }", "public SegmentNode(String p_segment)\n {\n m_strSegment = p_segment;\n }", "public Test() {\n }", "public BookcaseTest () {\n }", "Segment createSegment();", "public SsOhMapTest()\n {\n }", "public TestPrelab2()\n {\n }", "public Tests(){\n \n }", "public Test05() {\n this(0);\n n2 = \"n2\";\n n4 = \"n4\";\n }", "public TestGPSpingPhase1()\n {\n }", "public PerezosoTest()\n {\n }", "public TestSequence() {\n }", "public TestArithmetic()\n {\n }", "private SectionSets ()\r\n {\r\n }", "public CSSTidier() {\n\t}", "public tester() {\r\n }", "private StressTestHelper() {\n // Empty constructor.\n }", "public AllLaboTest() {\n }", "@Test\n public void marketSegmentTest() {\n // TODO: test marketSegment\n }", "@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 void testConstructor1() {\n XIntervalDataItem item1 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0);\n }", "public SwerveAutoTest() {\n // Initialize base classes.\n // All via self-construction.\n\n // Initialize class members.\n // All via self-construction.\n }", "public Simulator(){}", "public LogSegmentTest() throws IOException {\n tempDir = Files.createTempDirectory((\"logSegmentDir-\" + (UtilsTest.getRandomString(10)))).toFile();\n tempDir.deleteOnExit();\n MetricRegistry metricRegistry = new MetricRegistry();\n metrics = new StoreMetrics(metricRegistry);\n }", "public TestBSSVRequest() {\r\n }", "public ClimbingClubTest()\n {\n \n }", "public TestCase()\r\n {\r\n super();\r\n resetIO();\r\n }", "public TestDriverProgram(){\n iTestList = new SortableArray(iSize); // tests if parameterized constructor works\n iTestFileList = new SortableArray(); // tests if default constructor works\n runAllTests(); // run all of the tests\n }", "@Test\n\tpublic void constructorTest() {\n\t\tCTRNN testCtrnn = new CTRNN(layout1, phenotype1, false);\n\t\tAssert.assertEquals(1.0, testCtrnn.inputWeights[0], 0.001);\n\t\tAssert.assertEquals(2.0, testCtrnn.hiddenWeights[0][0], 0.001);\n\t\tAssert.assertArrayEquals(new double[] {3.0, 4.0}, testCtrnn.biasWeights, 0.001);\n\t\tAssert.assertArrayEquals(new double[] {5.0, 6.0}, testCtrnn.gains, 0.001);\n\t\tAssert.assertArrayEquals(new double[] {7.0, 8.0}, testCtrnn.timeConstants, 0.001);\n\t\t\n\t}", "public UnitTests()\n {\n }", "public Vending_MachineTest()\n {\n // initialise instance variables\n \n \n }", "public void testConstructor() {\n Measurement a = new Measurement();\n assertTrue(a.getFeet() == 0);\n assertTrue(a.getInches() == 0);\n \n Measurement b = new Measurement(5);\n assertTrue(b.getFeet() == 5);\n assertTrue(b.getInches() == 0);\n \n Measurement c = new Measurement(4, 3);\n assertTrue(c.getFeet() == 4);\n assertTrue(c.getInches() == 3);\n }", "public SectionDesc ()\r\n {\r\n }", "protected TeststepRunner() {}", "public Tester()\n {\n // initialise instance variables\n x = 0;\n }", "public Demo3() {}", "public test() {\n\t\tsuper();\n\t}", "public BookingSystemTest()\n {\n }", "public RookTest()\r\n {\r\n }", "@Test\r\n\tpublic void testConstructor() {\r\n\t\tnew ConstructorTestClass();\r\n\t}", "@Test\r\n\tpublic void testConstructor() {\r\n\t\tnew ConstructorTestClass();\r\n\t}", "public Student()\r\n {\r\n //This is intended to be empty\r\n }", "public FlightTest(){\n }", "@Test\n\tpublic void testConstructor() {\n\t\tnew ConstructorTestClass();\n\t}", "@Test\n\tpublic void testConstructor() {\n\t\tnew ConstructorTestClass();\n\t}", "TestViewpoint createTestViewpoint();", "public AcuityTest() {\r\n }", "public ServerTest() {\n\t\tsuper();\n\t}", "public ZTest1(String alias) {\n this(alias, Z_TEST1);\n }", "public LoadBasedDivision() {\n }", "public ProjektTest()\n {\n }", "private TbusRoadGraph() {}", "public Demo() {\n\t\t\n\t}", "@Test\n public void TestConstructor() {\n assertNotNull(q1);\n }", "public FindSegments() {\n\t\tthis(\"find_segments\", null);\n\t}", "public TestCloudbaseVertexFormat(String testName) {\n super(testName);\n }", "public void testConstructors()\n {\n VectorThresholdInformationGainLearner<String> subLearner = null;\n double percentToSample = RandomSubVectorThresholdLearner.DEFAULT_PERCENT_TO_SAMPLE;\n VectorFactory<?> vectorFactory = VectorFactory.getDefault();\n int[] dimensionsToConsider = null;\n RandomSubVectorThresholdLearner<String> instance = new RandomSubVectorThresholdLearner<String>();\n assertSame(subLearner, instance.getSubLearner());\n assertEquals(percentToSample, instance.getPercentToSample());\n assertSame(dimensionsToConsider, instance.getDimensionsToConsider());\n assertNotNull(instance.getRandom());\n assertSame(vectorFactory, instance.getVectorFactory());\n\n subLearner = new VectorThresholdInformationGainLearner<String>();\n percentToSample = percentToSample / 2.0;\n instance = new RandomSubVectorThresholdLearner<String>(subLearner,\n percentToSample, random);\n assertSame(subLearner, instance.getSubLearner());\n assertEquals(percentToSample, instance.getPercentToSample());\n assertSame(dimensionsToConsider, instance.getDimensionsToConsider());\n assertSame(random, instance.getRandom());\n assertSame(vectorFactory, instance.getVectorFactory());\n\n vectorFactory = VectorFactory.getSparseDefault();\n instance = new RandomSubVectorThresholdLearner<String>(subLearner,\n percentToSample, random, vectorFactory);\n assertSame(subLearner, instance.getSubLearner());\n assertEquals(percentToSample, instance.getPercentToSample());\n assertSame(dimensionsToConsider, instance.getDimensionsToConsider());\n assertSame(random, instance.getRandom());\n assertSame(vectorFactory, instance.getVectorFactory());\n \n dimensionsToConsider = new int[] {5, 12};\n vectorFactory = VectorFactory.getSparseDefault();\n instance = new RandomSubVectorThresholdLearner<String>(subLearner,\n percentToSample, dimensionsToConsider, random, vectorFactory);\n assertSame(subLearner, instance.getSubLearner());\n assertEquals(percentToSample, instance.getPercentToSample());\n assertSame(dimensionsToConsider, instance.getDimensionsToConsider());\n assertSame(random, instance.getRandom());\n assertSame(vectorFactory, instance.getVectorFactory());\n }", "public TestSharedObject() {\n super();\n }", "public void testConstructor() {\r\n assertNotNull(\"unable to create instance\", instance);\r\n }", "public BasicLoader() {\n }", "public Test() {\n super(0, \"A task\");\n this.answersArray = new String[]{\"a\", \"b\", \"c\"};\n }", "void DefaultConstructor(){}", "@Test\n\tpublic void testConstructor() {\n double[] startPosition = {50, 30, 0};\n GroundVehicle gv = new GroundVehicle(startPosition, 0, 0);\n Simulator sim = new Simulator();\n\n UserController uc = new UserController(sim, gv);\n\n assertEquals(sim, uc.getSimulator());\n assertEquals(gv, uc.getUserVehicle());\n\t}", "public PthTestContentsInfo() {\n }", "public SoretdLinkedListTest()\n {\n }", "private CoverageParser() {\n }", "ConstructorPractice () {\n\t\tSystem.out.println(\"Default Constructor\");\n\t}", "public helptest()\n {\n // initialise instance variables\n x = 0;\n }", "private CircleSampler() {\n\t}", "public GenericTest()\n {\n }", "public TrieST() {\n }", "@Test public void simpleEquationSegment_SmallPointGenerationTest()\n {\n System.out.print(\"running EquationSegment_SmallPointGenerationTest...\");\n \n //create the segment\n Point point1 = new Point(\"point1\", 1, 3);\n Point point2 = new Point(\"point2\", 7, 8);\n \n EquationSegment eqSegment = new EquationSegment(point2, point1);\n \n// System.out.println(\"eqSegment point1: \" + eqSegment.getPoint1());\n// System.out.println(\"eqSegment point2: \" + eqSegment.getPoint2());\n// System.out.println(\"eqSegment slope: \" + eqSegment.slope());\n// System.out.println(\"eqSegment constant: \" + eqSegment.getConstant());\n \n // generate 10 points on the segment\n for (int i = 0; i < 10; i++)\n {\n Point genPoint = eqSegment.getRandomPoint();\n //System.out.println(\"Point \" + i + \": \" + genPoint);\n assert (genPoint.getX() >= 1 && genPoint.getX() <= 7);\n assert (genPoint.getY() >= 3 && genPoint.getY() <= 8);\n assert (doubleCompare(0.0000000001, genPoint.getX() * ((double)5/6) + ((double)13/6), genPoint.getY()));\n }\n System.out.println(\"Done\\n\");\n }", "public RecognitionTest(String testName) {\n super(testName);\n }", "public RegistroTest()\n {\n }", "public Constructor(){\n\t\t\n\t}", "public SaverLoaderTest(String testName)\n {\n super(testName);\n }", "@Test\n\tpublic void testConstructor() {\n @SuppressWarnings(\"unused\")\n ConstructorTestClass constructorTestClass = new ConstructorTestClass();\t\t\n }", "@Test\n\tpublic void testConstructor() {\n @SuppressWarnings(\"unused\")\n ConstructorTestClass constructorTestClass = new ConstructorTestClass();\t\t\n }", "@Test\n\tpublic void testConstructor() {\n @SuppressWarnings(\"unused\")\n ConstructorTestClass constructorTestClass = new ConstructorTestClass();\t\t\n }", "public Basic() {}", "@Test\r\n public void testConstructor() {\r\n System.out.println(\"testConstructor\");\r\n try{\r\n new AddMetaInfoToGameService(2L, 3L, 5000);\r\n new AddMetaInfoToGameService(2L, 3L, 0);\r\n //fail();\r\n }catch(Exception e){\r\n e.getMessage();\r\n }\r\n }", "Testcase createTestcase();", "@Test\n public void testDefaultConstructor() {\n final ConfigSearchResult<?> result = new ConfigSearchResult<>();\n assertTrue(result.getDocuments().isEmpty());\n assertNull(result.getPaging());\n assertEquals(result.getVersionCorrection(), VersionCorrection.LATEST);\n }", "public AcceptanceTestRun() {\n }", "public Pitonyak_09_02() {\r\n }", "public RenderableTest()\n {\n }", "public Student(){}", "@Test\n\tpublic void constructorTest() throws PassengerException{\n\t\tFirst myPassenger = new First(10,100);\n\t\tassertNotNull(myPassenger);\n\t}", "@Override\n\tpublic void testConstructors() {\n\t\tassertEquals(opthand1.getOptionCode(), 4);\n\t\tassertEquals(opthand2.getOptionCode(), 8);\n\t\tassertEquals(opthand3.getOptionCode(), 91);\n\t\tsuper.testConstructors();\n\t}", "public ShapeLibraryTest()\n {\n }" ]
[ "0.7204998", "0.6777912", "0.67096615", "0.6623738", "0.65404665", "0.64950246", "0.644031", "0.6407246", "0.6402404", "0.63869244", "0.6383983", "0.63393605", "0.6335447", "0.6322168", "0.63196105", "0.6307264", "0.6306414", "0.62477", "0.62448055", "0.6194718", "0.6190053", "0.615518", "0.6137505", "0.60943604", "0.6082525", "0.607785", "0.6074668", "0.60687035", "0.60668457", "0.6064877", "0.60621667", "0.60553944", "0.60457295", "0.6042419", "0.6040254", "0.6017895", "0.5999373", "0.59863955", "0.594211", "0.5942105", "0.5932674", "0.59320253", "0.59225637", "0.59216774", "0.5917929", "0.5912726", "0.59080255", "0.5902125", "0.58987355", "0.5893231", "0.5893231", "0.5884338", "0.58768094", "0.5874762", "0.5874762", "0.5869684", "0.58695614", "0.58525264", "0.58520156", "0.58346844", "0.58216196", "0.58201885", "0.5813378", "0.5807202", "0.5794944", "0.57910526", "0.5791047", "0.5790953", "0.5787923", "0.5782407", "0.57730377", "0.577246", "0.5771189", "0.57590926", "0.5757347", "0.5755546", "0.5754743", "0.57392645", "0.57329124", "0.57295716", "0.572926", "0.57160646", "0.5714613", "0.57092005", "0.5708971", "0.5704565", "0.5704447", "0.5704447", "0.5704447", "0.57004225", "0.5694717", "0.5689413", "0.5682979", "0.56814927", "0.5681184", "0.56788975", "0.5674346", "0.56688696", "0.566852", "0.56661177" ]
0.90371186
0
Sets up the test fixture. Called before every test case method.
@Before public void setUp() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Before public void setUp() { }", "protected void setUp() {\n\t}", "protected void setUp()\n {\n }", "protected void setUp()\n {\n }", "protected void setUp() {\n\n }", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before\n\t\t public void setUp() throws Exception {\n\t\t\t testHelper.setUp();\n\t\t }", "public void setUp() {\n\n\t}", "@Before\n public void setup() {\n Helpers.fillData();\n }", "@Override\r\n\tpublic void setUp() {\n\t\t\r\n\t}", "@Before\r\n\tpublic void setup() {\r\n\t}", "@Before\n\t public void setUp() {\n\t }", "@BeforeEach\n public void setup() {\n }", "protected void setUp()\r\n {\r\n /* Add any necessary initialization code here (e.g., open a socket). */\r\n }", "@Before\r\n\t public void setUp(){\n\t }", "public void setUp()\r\n {\r\n //empty on purpose\r\n }", "protected void setUp()\n {\n /* Add any necessary initialization code here (e.g., open a socket). */\n }", "@BeforeClass\n\t public void setUp() {\n\t }", "@Before\n public void setup() {\n }", "@Before\n public void setup() {\n }", "@Before\n public void setup() {\n }", "@Before\r\n\tpublic void setUp() {\n\t}", "@BeforeEach\n public void setup() {\n testTaskList = new TaskList();\n testUi = new Ui();\n\n Event testEvent = new Event(\"Daily Work\", \"CS2113T\", Parser.parseDate(\"31/01/20 0800\"),\n Parser.parseDate(\"31/01/20 1200\"), \"testing\");\n Assignment testAssign = new Assignment(\"Daily Work\", \"CS2113T\", Parser.parseDate(\"20/03/20 0000\"),\n \"testing\");\n testTaskList.addTask(testEvent);\n testTaskList.addTask(testAssign);\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Override\r\n\tpublic void setUp() {\n\r\n\t}", "@Before\n\tpublic void setup() \n\t{\n\t\tsuper.setup();\n\t\t\n }", "@BeforeClass\n\tpublic static void setup() {\n\n\t}", "@Before\n\tpublic void setUp() {\n\t}", "@Before\n\tpublic void setup() {\n\t\t\n\t\t\n\t}", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Override\n public void setUp() {\n }", "@Before\n public void setUp () {\n }", "@Before\n public void setup() {\n }", "@Before\n public void setUp() {\n System.out.println(\"\\n@Before - Setting Up Stuffs: Pass \"\n + ++setUpCount);\n // write setup code that must be executed before each test method run\n }", "@Before\n\tpublic void setUp()\n\t{\n\t\tOptionsManager.getSingleton().setTestMode(true);\n\t\tQuestManager.resetSingleton();\n\t}", "@Before\n public void setUp() {\n }", "protected void setUp() throws Exception {\n super.setUp();\n }", "protected void setUp() throws Exception {\n }", "protected void setUp() throws Exception {\n \n }", "@Before\n public void setUp() {\n }", "@Before\n\tpublic void testEachSetup() {\n\t\ttestGrid = new Grid(50,50);\n\t\tundoRedo_TestStack = new UndoRedo();\n\t\tSystem.out.println(\"Setting up test...\");\n\t}", "@Before\r\n\tpublic void setUp() throws Exception {\r\n\t}", "@Before\r\n\tpublic void setUp() throws Exception {\r\n\t}", "@BeforeMethod\r\n\tpublic void beforeMethod() {\r\n\t\t//initializeTestBaseSetup();\r\n\t}", "protected void setUp() throws Exception {\n }", "@BeforeMethod\r\n\tpublic void startTestCase() {\n\t\ttest = extent.createTest(testCaseName, testCaseDescription);\r\n\t\ttest.assignAuthor(author);\r\n\t\ttest.assignCategory(category);\r\n\t}", "@Before\n public void setUp() throws Exception {\n }", "@Before\n public void setUp() throws Exception {\n }", "protected void setUp() {\n config = new ContestConfig();\n }", "@Before\n\tpublic void setUp() throws Exception\n\t{\n\t}", "@BeforeClass\n public static void setUp() {\n }", "@BeforeEach\n\tvoid setup(){\n\t}", "@Override\r\n protected void setUp() {\r\n // nothing yet\r\n }", "@Before\n public void setup () {\n driver = new HtmlUnitDriver( true );\n wait = new WebDriverWait( driver, 10 );\n HibernateDataGenerator.generateTestFaculties();\n }", "@Before\n public void setUp()\n throws Exception\n {\n super.setUp();\n }", "@BeforeClass\n\tpublic static void testSetup() {\n\t\t// do something before all tests\n\t}", "@BeforeClass\n public void setUp() {\n }", "@BeforeClass\n\tpublic static void setup() {\n\t\tdataMunger = new DataMunger();\n\n\t}", "@Before\n public void setUp() throws Exception {\n\n }", "@Before\n public final void setUp() throws Exception\n {\n // Empty\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t}", "@Before\n\tpublic void setUp() throws Exception {\n\t}", "@Before\n public void setUp() {\n fixture = new WordCounter(testMap);\n }", "public void setUpTestdata() {\n\t\tsetDefaultUserName(Config.getProperty(\"defaultUserName\"));\r\n\t\tsetDefaultPassword(Config.getProperty(\"defaultPassword\"));\r\n\t\tsetTestsiteurl(Config.getProperty(\"testsiteurl\"));\r\n\t\tsetChromeDriverPath(Config.getProperty(\"chromeDriverPath\"));\r\n\t\tsetGeckoDriverPath(Config.getProperty(\"geckoDriverPath\"));\r\n\t\tsetIeDriverPath(Config.getProperty(\"ieDriverPath\"));\r\n\t}", "@Before\n\tpublic void setUp() throws Exception {\n\t\t\n\t}", "@Before\n public void setUp() throws Exception {\n\n }", "@Before\r\n public void setup() {\r\n dbwMock.userId = \"testUser\";\r\n dbw = new DatabaseWrapper(dbwMock);\r\n\r\n context = ApplicationProvider.getApplicationContext();\r\n\r\n book = new Book();\r\n\r\n requester = new Profile();\r\n }", "@BeforeMethod\n\tpublic void setup() {\n\t\tinitialization();\n\t\tloginpage = new LoginPage();\n\t\tcontactpage=new ContactPage();\n\t\ttestutil = new TestUtil();\n\t\thomepage=loginpage.login(prop.getProperty(\"username\"), prop.getProperty(\"password\"));\n\t}", "@Before\n\tpublic void setupTeste()\n\t{\n\t\tSystem.out.println(\"ESTOU FAZENDO O SETUP\");\n\t}", "@BeforeClass\n public static void setup() {\n System.out.println(\"*** Before Class ***\");\n }", "@Before\n public void postSetUpPerTest(){\n\n }", "@BeforeEach\n public void setUp() throws Exception\n {\n // Set up a new thread context class loader\n setUpClassloader();\n\n // Set up Servlet API Objects\n setUpServletObjects();\n\n // Set up JSF API Objects\n FactoryFinder.releaseFactories();\n\n setFactories();\n\n setUpJSFObjects();\n }" ]
[ "0.7875802", "0.78508884", "0.7750591", "0.7750591", "0.77189946", "0.7699059", "0.7699059", "0.7699059", "0.7699059", "0.7699059", "0.768649", "0.76622325", "0.7629051", "0.7627999", "0.7623902", "0.76179224", "0.76017296", "0.7595511", "0.7594185", "0.7586097", "0.75814986", "0.75737566", "0.7557952", "0.7557952", "0.7557952", "0.7522663", "0.7519688", "0.7513291", "0.7513291", "0.7513291", "0.7513291", "0.75050044", "0.7503437", "0.75006294", "0.7495462", "0.74870163", "0.74853647", "0.74853647", "0.74853647", "0.74853647", "0.74853647", "0.7478835", "0.7464619", "0.74596", "0.74396664", "0.7431611", "0.74279267", "0.7411373", "0.73935205", "0.73847294", "0.7379531", "0.73744226", "0.73630786", "0.73630786", "0.7360901", "0.73559475", "0.7327842", "0.7323795", "0.7323795", "0.73062146", "0.73023367", "0.73020965", "0.72988224", "0.72978383", "0.7297745", "0.7296684", "0.7286866", "0.7284355", "0.7277352", "0.7271452", "0.72590035", "0.725855", "0.725855", "0.72548056", "0.7248891", "0.72468114", "0.7243883", "0.7232875", "0.72304004", "0.7198173", "0.71965957", "0.71962297", "0.7190208" ]
0.7462182
58
Tears down the test fixture. Called after every test case method.
@After public void tearDown() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@After\n public void tearDown() {\n fixture.cleanUp();\n }", "@After\n public void tearDown() {\n fixture = null;\n }", "@AfterClass\r\n\tpublic static void testCleanup() {\r\n\t\tConfig.teardown();\r\n\t}", "@AfterTest\n\tpublic void teardown()\n\t{\n\t\t\n\t\tdriver.close();\n\t}", "protected void tearDown() {\n testEnv.close();\n }", "@AfterSuite\n\tpublic void teardown() {\n\t\t\n\t\tdriver.quit();\n\t}", "@AfterClass\n\tpublic static void teardown() {\n\t\tdataMunger = null;\n\n\t}", "public void teardown() {\n LOGGER.info(\"Shutting down driver\");\n driver.quit();\n }", "@AfterSuite\n\tpublic void teardown() {\n\t\tlogger.info(\"ALL TESTS COMPLETED: Quiting driver\");\n\t\tgmailPg.quitDriver();\n\t}", "@After\r\n public void tearDown() throws Exception {\r\n super.tearDown();\r\n TestHelper.cleanupEnvironment();\r\n instance = null;\r\n }", "@After\n\t\t public void tearDown() throws Exception {\n\t\t\t testHelper.tearDown();\n\t\t }", "void teardown();", "void teardown();", "public static void teardown() {\n\t\tdriver.quit();\n\t}", "@After\n public void tearDown() throws Exception {\n testInstance = null;\n }", "@After\n\tpublic void teardown() {\n\t\tdrv.quit();\n\t}", "@AfterClass\n\tpublic void teardown(){\n\t}", "@After\n\tpublic void teardown() {\n\t\tthis.driver.quit();\n\t}", "@Override\n\tpublic void teardown() {\n\t}", "@Override\n public void teardown() {\n }", "@AfterClass\n\tpublic void teardown()\n\t{\n\t\tdriver.close();\n\t}", "@Override\n public void tearDown() {\n testEngine = null;\n }", "@AfterEach\n public void teardown() {\n mockDAO = null;\n addFlight = null;\n flight = null;\n }", "@AfterSuite\r\n\tpublic void tearDown() {\r\n\t\tSystem.out.println(\"Driver teared down\");\r\n\t}", "@AfterTest\n\tpublic void tearDown() throws Exception\n\t{\n\t\tlog.info(\"Starting tear Down\");\n//\t\t\t\tdriver.close();\n\t}", "@AfterMethod(alwaysRun = true)\n public void cleanupTest() throws Exception {\n busService.getBus().unregister(testListener);\n busService.getBus().stop();\n \n // STOP NOTIFICATION QUEUE\n ((Engine)entitlementService).stop();\n\n log.warn(\"DONE WITH TEST\\n\");\n }", "@After\n public void teardown() {\n RoboGuice.Util.reset();\n }", "@AfterClass\n\tpublic static void testCleanup() {\n\t}", "public void tearDown() throws Exception {\n TestHelper.clearTemp();\n super.tearDown();\n }", "public void tearDown() {\n tearDown(true);\n }", "@AfterTest\n public void tearDown() {\n Log.endLog(\"Test is ending!\");\n driver.close();\n }", "@After\n public void cleanUp(){\n mockUserRepo = null;\n mockSession = null;\n sut = null;\n }", "protected void tearDown() {\n config = null;\n }", "@AfterEach\n public void tearDown() throws Exception\n {\n\n application = null;\n config = null;\n externalContext = null;\n if (facesContext != null)\n {\n facesContext.release();\n }\n facesContext = null;\n lifecycle = null;\n lifecycleFactory = null;\n renderKit = null;\n request = null;\n response = null;\n servletContext = null;\n session = null;\n FactoryFinder.releaseFactories();\n ResourceBundleVarNames.resetNames();\n\n tearDownClassloader();\n }", "@After\n\tpublic void testEachCleanup() {\n\t\tSystem.out.println(\"Test Completed!\");\n\t}", "@AfterClass\n public static void tear() {\n System.out.println(\"*** After class ***\");\n }", "@AfterTest\r\n public void tearDown() {\n }", "protected void tearDown() {\n\t}", "@Override\r\n\t@After\r\n\tpublic void callTearDown() throws Exception\r\n\t{\r\n\t\tsuper.callTearDown();\r\n\t}", "protected void tearDown() throws Exception {\n super.tearDown();\n FailureTestHelper.unloadData();\n FailureTestHelper.unloadConfig();\n }", "@AfterClass\n public void cleanUp() {\n }", "@After\n public void tearDown()\n {\n mockDependencies.verifyMocks();\n mockDependencies = null;\n assertNull(\"'mockDependencies' should be null at the end of teardown\", mockDependencies);\n\n parser = null;\n assertNull(\"'parser' should be null at the end of teardown\", parser);\n }", "@AfterClass\r\n public static void tearDown() throws Exception {\r\n instance = null;\r\n }", "@After\n public void teardown() {\n for (UseTypeEntity thisEntity : entities) {\n me.deleteUseTypeEntity(thisEntity);\n }\n\n // clean up\n me = null;\n testEntity = null;\n entities = null;\n\n }", "protected void tearDown() throws Exception {\n instance = null;\n manager = null;\n AccuracyTestsHelper.clearConfig();\n }", "@Override\n public void tearDown() {\n setName(caseLabel + '-' + getName());\n\n if (env != null) {\n try {\n closeAll();\n } catch (Throwable e) {\n System.out.println(\"During tearDown: \" + e);\n }\n }\n envHome = null;\n env = null;\n store = null;\n caseCls = null;\n caseObj = null;\n caseLabel = null;\n\n /* Do not delete log files so they can be used by 2nd phase of test. */\n }", "@After\n\tpublic void tearDown() throws Exception {\n\t\teventDao = null;\t\t\n\t\tcontroller = null;\n\t\tresponse = null;\n\t\trequest = null;\n\t}", "protected void tearDown() throws Exception {\r\n super.tearDown();\r\n FailureTestHelper.unloadConfig();\r\n }", "@AfterClass(alwaysRun = true)\n public void tearDownClass() throws Exception {\n testNGCucumberRunner.finish();\n }", "protected void tearDown() \n\t{\n\t\tif (container != null) \n\t\t{\n\t\t\tcontainer.dispose();\n\t\t}\n\t\tcontainer = null;\n\t}", "protected void tearDown()\r\n {\r\n /* Add any necessary cleanup code here (e.g., close a socket). */\r\n }", "protected void tearDown() throws Exception {\r\n validator = null;\r\n bundle = null;\r\n TestHelper.clearConfiguration();\r\n }", "@After\n public void tearDown()\n {\n example = null;\n example2 = null;\n example3 = null;\n }", "@AfterClass\n\tpublic void classTearDown() {\n\t\tlogger.info(\"Inside the classTearDown() method for HealthAssessment class...\");\n\t\tindexPageData = null;\n\t}", "@AfterMethod\r\n\t\tpublic void tearDown(){\r\n\t\t\t\r\n\t\t \r\n\t\t\tdriver.close();\r\n\t\t\tdriver.quit();\r\n\t\t\t\t\r\n\t\t\t}", "private void tearDown() {\n if (tempDir != null) {\n OS.deleteDirectory(tempDir);\n tempFiles.clear();\n tempDir = null;\n }\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@After\n\tpublic void tearDown() throws Exception {\n\t\tydelseService.setEntityManager(null);\n\t}", "@AfterClass\n public static void tearDownClass() {\n }", "@AfterClass\n public static void tearDownClass() {\n }", "@AfterSuite\n\tpublic void tearDown() {\n\t\tremoveSingleFileOrAllFilesInDirectory(\"file\", \"./Logs/Log4j.log\");\n\n\t\t// Flushing extent report after completing all test cases\n\t\treports.endTest(extent);\n\t\treports.flush();\n\t}", "@After\r\n\tpublic void tearDown() {\r\n\t\tvend = null; \r\n\t\tcsListen = null;\r\n\t\tdcListen = null;\r\n\t}", "@After\n\tpublic void tearDown() {}", "@AfterClass\n public static void teardown() {\n app = null;\n\n }", "@AfterClass\n\tpublic static void tearDownAfterClass() throws Exception {\n\t\tydelseService = null;\n\t}", "protected void tearDown()\n {\n /* Add any necessary cleanup code here (e.g., close a socket). */\n }", "@AfterClass\n public static void closeTestFixture() {\n entityManager.close();\n entityManagerFactory.close();\n }", "@AfterMethod\n public void teardown(){\n driver.quit();\n }", "@AfterClass\r\n public static void cleanUpTestFixture(){\r\n entityManagerFactory.close();\r\n }", "public void tearDown() {\n instance = null;\n }", "public void tearDown() {\n }", "@After\r\n\tpublic void tearDown() {\n\t}", "@After\n public void tearDown() throws Exception {\n databaseTester.onTearDown();\n }", "@Teardown\n public void tearDown() {\n if (channel != null) {\n channel.shutdownNow();\n channel = null;\n }\n }", "@After \n public void tearDownTest()\n {\n\t System.out.println(\"Test Complete\\n\\n\\n\\n\\n\");\n }", "@AfterClass\n\tpublic static void tearDown() {\n\t\tdriver.quit();\n\t}", "@AfterClass\n\tpublic static void cleanup() {\n\t\ttestDir.delete();\n\t\tfile.delete();\n\t}", "@AfterMethod\r\n\tpublic void tearDown() {\r\n\t\tdriver.quit();\r\n\t\tsoftAssert.assertAll();\r\n\t}", "@AfterClass\r\n\t\t\tpublic static void tearDown(){\r\n\t\t\t\t//Cierra navegador y la instancia del driver\r\n\t\t\t\tdriver.quit();\t\t\r\n\t\t\t}", "protected void tearDown() throws Exception {\n actionManager = null;\n TestHelper.clearConfig();\n super.tearDown();\n }", "@Override\r\n protected void tearDown() throws Exception {\r\n ctx = null;\r\n projectService = null;\r\n }", "protected void tearDown() throws Exception {\n TestHelper.clearConfig();\n super.tearDown();\n }", "public static void tearDown() {\n\t\tif (driver != null) {\n\t\t\tdriver.quit();\n\t\t}\n\t}", "@After\n public void tearDown() {\n GWTMockUtilities.restore();\n }", "@AfterMethod\n\tpublic void tearDown()\n\t{\n\t\tdriver.close();\n\t\tdriver.quit();\n\t}", "@After\n\tpublic void tearDown() {\n\n\t}", "@After\n\tpublic void afterTest() {\n\t\tmyD.close();\n\n\t}", "@After\n public void tearDown(){\n choose = null;\n tmp = null;\n }", "@AfterClass(alwaysRun = true)\n\tpublic void destroy() throws Exception {\n\t\tsuper.cleanup();\n\t}", "@After\n\tpublic void tearDown() throws Exception {\n\t\tFileUtils.cleanDirectory(new File(this.tempFolderPath));\n\t}", "@After\n public void tearDown() {\n \n }", "protected void tearDown() throws Exception {\r\n this.testedInstances = null;\r\n super.tearDown();\r\n }" ]
[ "0.8343327", "0.8295237", "0.80239624", "0.80069876", "0.79356796", "0.79144764", "0.78988177", "0.78834516", "0.78801274", "0.7873192", "0.7862262", "0.7791972", "0.7791972", "0.77516323", "0.773132", "0.77117425", "0.7695534", "0.7691877", "0.767808", "0.76658434", "0.7658981", "0.7641331", "0.7627408", "0.76007277", "0.7587928", "0.75714475", "0.75664705", "0.75209236", "0.75154793", "0.74966156", "0.7494638", "0.7472204", "0.7469792", "0.7467009", "0.74600995", "0.7449917", "0.74439096", "0.7393639", "0.7384236", "0.73832864", "0.7378633", "0.7369458", "0.73680395", "0.7364464", "0.7357696", "0.7356001", "0.735393", "0.73417443", "0.73383963", "0.7337043", "0.7327399", "0.73215586", "0.7308286", "0.7302456", "0.73014194", "0.73011833", "0.7300301", "0.7300301", "0.7300301", "0.7300301", "0.7300301", "0.7300301", "0.7300301", "0.7300301", "0.7300301", "0.7300301", "0.7298629", "0.7291006", "0.7291006", "0.7274972", "0.7274848", "0.7273374", "0.7269732", "0.7269024", "0.7267168", "0.72644246", "0.72528553", "0.7252839", "0.7251117", "0.7247232", "0.7239139", "0.7229776", "0.7223881", "0.72163874", "0.72137153", "0.7212735", "0.7211984", "0.72078454", "0.72009313", "0.7195705", "0.7194817", "0.71901697", "0.71884584", "0.7187696", "0.71805936", "0.71770656", "0.7176737", "0.71746355", "0.71714205", "0.71677065", "0.71653444" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { Scanner sc = new Scanner(System.in); String inputString; do { System.out.print(">"); inputString = sc.nextLine(); System.out.println(inputString); }while(!inputString.equals("q")); System.out.println("end"); }
{ "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
Creates a new instance of JTextAreaAdapter
public J2DAreaAdapter(SwingDesigner designer, Component component) { super(designer, component); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TEXTAREA createTEXTAREA();", "void init(RichTextArea textArea, Config config);", "private JTextArea initializeChatArea() {\r\n\t\t// create and set properties of chat area.\r\n\t\tchatArea = new JTextArea();\r\n\t\tchatArea.setEditable(false);\r\n\t\tchatArea.setAutoscrolls(true);\r\n\t\tchatArea.setFont(new Font(\"Tahoma\", 0, 12));\r\n\t\treturn chatArea;\r\n\t}", "public static TextArea createTextArea() {\n\t\tTextArea txt = new TextArea();\n\t\ttxt.setText(\" \");\n\t\ttxt.setPrefWidth(350);\n\t\ttxt.setPrefHeight(50);\n\t\treturn txt;\n\t}", "public KScrollTextArea() {\n\n super();\n \n MyTextArea = new KTextArea();\n this.initScrollPane();\n\n }", "public Object clone()\n{\n\tOzTextArea ta = new OzTextArea();\n\tta.setFont(textArea().getFont());\n\tta.setCursor(getCursor());\n\treturn ta;\n}", "public TextArea()\n {\n super(AreaId.TEXT, new AsciiByteFormatter());\n }", "private JTextArea getJTextArea() {\n\t\tif (jTextArea == null) {\n\t\t\tjTextArea = new JTextArea();\n\t\t\tjTextArea.setBounds(new Rectangle(143, 75, 137, 19));\n\t\t\tjTextArea.setColumns(10);\n\t\t\tjTextArea.setFont(new Font(\"Dialog\", Font.PLAIN, 14));\n\t\t\tjTextArea.addKeyListener(new java.awt.event.KeyAdapter() {\n\t\t\t\tpublic void keyTyped(java.awt.event.KeyEvent e) {\n\t\t\t\t\tif (jTextArea.getText().length() > 10) {\n\t\t\t\t\t\tjTextArea.setText(jTextArea.getText().substring(0,10));\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t\tjTextArea.addCaretListener(new javax.swing.event.CaretListener() {\n\t\t\t\tpublic void caretUpdate(javax.swing.event.CaretEvent e) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn jTextArea;\n\t}", "public void addTextArea(String text) throws BadLocationException {\n\t\tcurrentTextArea = new JTextArea(text == null ? \"\" : text);\n AbstractDocument document = (AbstractDocument) currentTextArea.getDocument();\n document.setDocumentFilter(new Filter());\n\t\tcurrentTextArea.setBorder(BorderFactory.createLineBorder(Color.white));\n\t\tcurrentTextArea.setSize(750,2);\n\t\tcontainer.add(currentTextArea);\n\t\tcurrentTextArea.requestFocusInWindow();\n\t\tcurrentTextArea.setCaretPosition(currentTextArea.getDocument().getLength());\n\n\t\tcurrentTextArea.addKeyListener(new java.awt.event.KeyAdapter() {\n\t\t\tpublic void keyPressed(java.awt.event.KeyEvent evt) {\n\t\t\t\ttry {\n\t\t\t\t\tjTextArea1WriteCommand(evt);\n\t\t\t\t} catch (BadLocationException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\trefreshView();\n\t}", "public JTextArea createText(JTextArea a, String name, Font newFont, int boundX, int boundY, int x, int y) {\r\n\t\ta = new JTextArea(name);\r\n\t\ta.setFont(newFont);\r\n\t\ta.setBounds(boundX, boundY, x, y);\r\n\t\ta.setBackground(Color.lightGray);\r\n\t\treturn a;\r\n\t}", "private void setupTextArea() {\n\t\tcourseInfo = new JTextPane();\n\t\tinfoScrollPane = new JScrollPane(courseInfo);\n\t\tinfoScrollPane.setPreferredSize(new Dimension(350, 175));\n\t\tcourseInfo.setEditable(false);\n\t\tdisplay.add(infoScrollPane);\n\t}", "public TextArea makeInputArea (double height, double width) {\r\n TextArea cmdBox = new TextArea();\r\n cmdBox.setPrefColumnCount(INPUT_FIELD_WIDTH);\r\n cmdBox.setPrefHeight(height);\r\n cmdBox.setPrefWidth(width);\r\n return cmdBox;\r\n }", "private JTextArea getJTextArea() {\r\n\t\tif (jTextArea == null) {\r\n\t\t\tjTextArea = new JTextArea();\r\n\t\t\tjTextArea.setBounds(new Rectangle(227, 123, 395, 345));\r\n\t\t\tjTextArea.setEditable(false);\r\n\t\t}\r\n\t\treturn jTextArea;\r\n\t}", "private JTextArea getJTextArea() {\r\n\t\tif (jTextArea == null) {\r\n\t\t\tjTextArea = new JTextArea();\r\n\t\t\tjTextArea.setBounds(new Rectangle(11, 5, 139, 127));\r\n\t\t\tjTextArea.setText(\"This is the stroy\\nof the hare who\\nlost his spectacles.\");\r\n\t\t}\r\n\t\treturn jTextArea;\r\n\t}", "private void setupFeedbackDisplayTextArea(){\n\t\tfeedback_display = new JTextArea();\n\t\tfeedback_display.setFont(new Font(\"Calibri Light\", Font.PLAIN, 25));\n\t\tfeedback_display.setEditable(false);\n\t\tfeedback_display.setLineWrap(true);\n\t\tfeedback_display.setWrapStyleWord(true);\n\t\tfeedback_display.setOpaque(true);\n\n\t\tJScrollPane scrolling_pane = new JScrollPane(feedback_display);\n\t\tadd(scrolling_pane);\n\t\tscrolling_pane.setBounds(32, 222, 1284, 252);\n\t\tscrolling_pane.setBackground(Color.WHITE);\n\t}", "protected void createOutputTextArea() {\r\n\t\tthis.outputTextArea = new JTextArea(80, 30);\r\n\t\tthis.outputTextArea.setRows(2);\r\n\t\tthis.outputTextArea.setEditable(false);\r\n\t\tthis.outputTextArea.setLineWrap(false);\r\n\t\tthis.outputScrollPane = new JScrollPane(this.outputTextArea,\r\n\t\t\t\tVERTICAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_AS_NEEDED);\r\n\t\t// outputTA.setBackground( Color.gray );\r\n\t\tthis.outputScrollPane.setMinimumSize(new Dimension(60, 30));\r\n\t\tthis.outputScrollPane.setPreferredSize(new Dimension(100, 30));\r\n\t}", "public OzTextArea()\n{\n\tsetLayout(new BorderLayout());\n\tJScrollPane jsp = new JScrollPane(textArea);\n\tjsp.setBorder(\n\t\tBorderFactory.createCompoundBorder(\n\t\t\tBorderFactory.createRaisedBevelBorder(),\n\t\t\tBorderFactory.createEmptyBorder(5, 5, 5, 5)));\n\tadd(jsp, \"Center\");\n}", "public MarcoAreaTexto() {\r\n \r\n super(\"Demostración JTextArea\");\r\n Box cuadro = Box.createHorizontalBox();\r\n String demo = \"Texto de ejemplo\\npara mostrar como\\n\" +\r\n \"se copia texto por\\neventoexterno (Salu2)\";\r\n \r\n areaTexto1 = new JTextArea(demo, 10, 15); \r\n cuadro.add(new JScrollPane(areaTexto1) );\r\n copiar = new JButton(\"Copiar >>> \");\r\n cuadro.add(copiar);\r\n copiar.addActionListener(\r\n \r\n new ActionListener() {\r\n \r\n public void actionPerformed(ActionEvent event) {\r\n \r\n areaTexto2.setText(areaTexto1.getSelectedText() );\r\n } //Fin del método actionPerformed\r\n } //Clase interna anónima\r\n ); //Clase interna anónima\r\n \r\n areaTexto2 = new JTextArea(10, 15);\r\n areaTexto2.setEditable(false);\r\n cuadro.add(new JScrollPane(areaTexto2) );\r\n add(cuadro);\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jTextArea1 = new javax.swing.JTextArea();\n\n setClosable(true);\n setIconifiable(true);\n setMaximizable(true);\n setResizable(true);\n\n jTextArea1.setColumns(20);\n jTextArea1.setRows(5);\n jScrollPane1.setViewportView(jTextArea1);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 367, Short.MAX_VALUE)\n );\n\n pack();\n }", "private JTextArea getDetailsTextArea() {\r\n\t\tif (detailsTextArea == null) {\r\n\t\t\ttry {\r\n\t\t\t\tdetailsTextArea = new JTextArea();\r\n\t\t\t} catch (java.lang.Throwable e) {\r\n\t\t\t\t// TODO: Something\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn detailsTextArea;\r\n\t}", "private JTextArea getTxtInput() {\r\n\t\tif (txtInput == null) {\r\n\t\t\ttxtInput = new JTextArea();\r\n\t\t\ttxtInput.setLineWrap(true);\r\n\t\t\ttxtInput.addKeyListener(new java.awt.event.KeyAdapter() {\r\n\t\t\t\tpublic void keyTyped(java.awt.event.KeyEvent e) {\r\n\t\t\t\t\tif(e.getKeyChar() == '\\n' || e.getKeyChar() == '#') {\r\n\t\t\t\t\t\tinputReady = true;\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\treturn txtInput;\r\n\t}", "public ReportPanel() {\n initComponents();\n writer = new JTextAreaWriter(jTextArea1);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n textoArea = new javax.swing.JTextArea();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n textoArea.setColumns(20);\n textoArea.setRows(5);\n jScrollPane1.setViewportView(textoArea);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 326, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 382, Short.MAX_VALUE)\n );\n\n pack();\n }", "public static void GenerateTextArea(int id)\n\t{\n\t\tareaHeight += 210;\n\t\tHome.createArticle.setPreferredSize(new Dimension(800, areaHeight));\n\t\ti++; \n\t\tgbc.gridx = 0;\n\t\tgbc.gridy = i;\n\t\tgbc.gridwidth = 1;\n\t\tgbc.insets = new Insets(10, 0, 0, 5);\n\t\tgbc.anchor = GridBagConstraints.LINE_END;\n\t\tHome.createArticle.add(textLabels.get(id), gbc);\n\t\t\n\t\tgbc.gridx = 1;\n\t\tgbc.gridwidth = 3;\n\t\tgbc.insets = new Insets(10, 0, 0, 0);\n\t\tgbc.anchor = GridBagConstraints.LINE_START;\n\t\tgbc.weighty = 10;\n\t\tHome.createArticle.add(textAreas.get(id), gbc);\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jTextArea1 = new javax.swing.JTextArea();\n\n setTitle(\"Base XML\");\n\n jTextArea1.setColumns(20);\n jTextArea1.setRows(5);\n jScrollPane1.setViewportView(jTextArea1);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)\n );\n\n pack();\n }", "public JTextArea getJTextAreaDescription() {\n\t\tif (jTextAreaDescription == null) {\n\t\t\tjTextAreaDescription = new JTextArea();\n\t\t\tjTextAreaDescription.setCaretColor(new Color(212, 208, 200));\n\t\t\tjTextAreaDescription.setBackground(this.getBackground());\n\t\t\tjTextAreaDescription.setLineWrap(true);\n\t\t\tjTextAreaDescription.setWrapStyleWord(true);\n\t\t\tjTextAreaDescription.setEditable(false);\n\t\t\tjTextAreaDescription.setFont(new Font(\"SansSerif\", Font.PLAIN, 12));\n\t\t\tjTextAreaDescription.setDisabledTextColor(new Color(212, 208, 200));\n\t\t}\n\t\treturn jTextAreaDescription;\n\t}", "public final void addTextArea(final int rows) {\n\t\tfinal TextArea<String> textArea = new TextArea<String>(\"textArea\") {\n\t\t\t@Override\n\t\t\tprotected void onComponentTag(final ComponentTag tag) {\n\t\t\t\tsuper.onComponentTag(tag);\n\t\t\t\ttag.put(\"rows\", rows);\n\t\t\t}\n\t\t};\n\t\taddDecoratorForBuiltInFormComponent(textArea, \"textAreaFragment\");\n\t}", "private JTextArea getJTextArea1() {\r\n\t\tif (jTextArea1 == null) {\r\n\t\t\tjTextArea1 = new JTextArea();\r\n\t\t\tjTextArea1.setBounds(new Rectangle(21, 331, 185, 94));\r\n\t\t\tjTextArea1.setText(\"You can use '*' or '?'.\\n If you type 'ma*' ,\" +\r\n\t\t\t\t\t\" will appear\\n all the words wich start with 'ma'.\" +\r\n\t\t\t\t\t\"\\n If you type 'm?' ,\" +\r\n\t\t\t\t\t\" will appear\\n all the words with two letters\\nwich start with 'm'.\");\r\n\t\t\tjTextArea1.setBackground(Color.green);\r\n\t\t\tjTextArea1.setEditable(false);\r\n\t\t}\r\n\t\treturn jTextArea1;\r\n\t}", "private JTextArea Tekstas() {\n\t JTextArea detailTA = new JTextArea();\n\t detailTA.setFont(new Font(\"Monospaced\", Font.PLAIN, 14));\n\t detailTA.setTabSize(3);\n\t detailTA.setLineWrap(true);\n\t detailTA.setWrapStyleWord(false);\n\t return (detailTA);\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n pn_mostrar = new javax.swing.JScrollPane();\n txt_mostrar = new javax.swing.JTextArea();\n\n setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n setClosable(true);\n setMaximizable(true);\n setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\n txt_mostrar.setEditable(false);\n txt_mostrar.setBackground(new java.awt.Color(51, 51, 51));\n txt_mostrar.setColumns(20);\n txt_mostrar.setFont(new java.awt.Font(\"Arial\", 0, 18)); // NOI18N\n txt_mostrar.setForeground(new java.awt.Color(255, 255, 255));\n txt_mostrar.setRows(5);\n txt_mostrar.setSelectionColor(new java.awt.Color(51, 255, 0));\n pn_mostrar.setViewportView(txt_mostrar);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(pn_mostrar, javax.swing.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(pn_mostrar, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE)\n );\n\n pack();\n }", "private JTextArea getJTextFieldData() {\r\n\t\tif (jTextAreaData == null) {\r\n\t\t\tjTextAreaData = new JTextArea();\r\n\t\t\tjTextAreaData.setForeground(new Color(0, 0, 204));\r\n\t\t\tjTextAreaData.setFont(new Font(\"微软雅黑\", Font.PLAIN, 13));\r\n\t\t}\r\n\t\treturn jTextAreaData;\r\n\t}", "private ZapTextArea getTxtDescription() {\n if (txtDescription == null) {\n txtDescription = new ZapTextArea();\n txtDescription.setBorder(\n javax.swing.BorderFactory.createBevelBorder(\n javax.swing.border.BevelBorder.LOWERED));\n txtDescription.setLineWrap(true);\n }\n return txtDescription;\n }", "@Override\r\n\tpublic DTextArea add(final DNode newChild) throws DOMException {\r\n\t\tsuper.add(newChild) ;\r\n\t\treturn this ;\r\n\t}", "public JTextArea getJTextAreaPreview() {\n\t\tif (jTextAreaPreview == null) {\n\t\t\tjTextAreaPreview = new JTextArea();\n\t\t\tjTextAreaPreview.setBackground(this.getBackground());\n\t\t\tjTextAreaPreview.setFont(new Font(\"Courier\", Font.PLAIN, 13));\n\t\t\tjTextAreaPreview.setEditable(false);\n\t\t\tjTextAreaPreview.setDisabledTextColor(new Color(212, 208, 200));\n\t\t\tjTextAreaPreview.setCaretColor(new Color(212, 208, 200));\n\t\t\tjTextAreaPreview.setWrapStyleWord(true);\n\t\t\tjTextAreaPreview.setLineWrap(true);\n\t\t\tjTextAreaPreview.setCursor(new Cursor(Cursor.TEXT_CURSOR));\n\t\t}\n\t\treturn jTextAreaPreview;\n\t}", "MenuList()\r\n\t{\r\n\t\t\r\n\t\tsetLayout(new GridLayout(2,1));\r\n\t\t\r\n\t\t\r\n\t\treadTax();\r\n\t\t\r\n\t\treceiptList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r\n\t\t\r\n\t\treceiptList.setFont(new Font(Font.SERIF,Font.PLAIN,16));\r\n\r\n\t\tadd(new JScrollPane(receiptList, \r\n\t\t\t\tScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));\r\n\t\tadd(description);\r\n\t\tdescription.setText(\"jTextArea1\");\r\n\t\t\r\n\t}", "private void createMessageArea() {\n\t\tthis.message = new JTextArea(\"Message\");\n\t\tthis.message.setRows(1);\n\t\tthis.message.setBorder(BorderFactory.createTitledBorder(\"Message\"));\n\t\tthis.message.setLineWrap(true);\n\t\tthis.message.setWrapStyleWord(true);\n\n\t\t// maximum lenght of the message\n\t\tfinal int MAX_LENGTH = 140;\n\t\tfinal int MAX_NEWLN = 4;\n\t\tthis.message.setDocument(new PlainDocument() {\n\t\t\t@Override\n\t\t\tpublic void insertString(int offs, String str, AttributeSet a) throws BadLocationException {\n\t\t\t\tint lines = message.getText().split(\"\\r\\n|\\r|\\n\", -1).length;\n\t\t\t\tif (str == null || message.getText().length() >= MAX_LENGTH || lines >= MAX_NEWLN) {\n\t \treturn;\n\t \t}\n\t\t\t\tsuper.insertString(offs, str, a);\n\t \t}\n\t\t});\n\t}", "public static TextArea wrap(Element element, boolean isHTMLFormElement) {\n\t\tassert Document.get().getBody().isOrHasChild(element);\n\n\t\tTextArea textArea = new TextArea(element);\n\n\t\t// Mark it attached and remember it for cleanup.\n\t\ttextArea.onAttach();\n\t\tif(!isHTMLFormElement){\n\t\t\tRootPanel.detachOnWindowClose(textArea);\n\t\t}\n\t\t//\n\n\t\treturn textArea;\n\t}", "public final TEditorWidget addEditor(final String text, final int x,\n final int y, final int width, final int height) {\n\n return new TEditorWidget(this, text, x, y, width, height);\n }", "public void setUpTextArea() {\n noteContent.textProperty().addListener(new ChangeListener<String>() {\n @Override\n public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {\n int remaining = NoteText.NOTE_MAX_CHARACTER_LIMIT - newValue.length();\n feedbackLabel.setStyle(\"-fx-font-size: 12; -fx-text-fill: white;\");\n feedbackLabel.setText(\"Characters remaining: \" + remaining);\n }\n });\n\n noteContent.setTextFormatter(new TextFormatter<String>(text ->\n text.getControlNewText().length() <= NoteText.NOTE_MAX_CHARACTER_LIMIT\n ? text : null));\n }", "public TextPanel(String text) {\n\t\tthis.setLayout(new MigLayout());\n\t\tthis.text = text;\n\t\tjta = new JTextArea(text);\n\t\tjta.setEditable(false);\n\t\tjta.setLineWrap(true);\n\t\tjsp = new JScrollPane(jta);\n\n\t\tthis.add(jsp, \"push,grow\");\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jTextArea1 = new javax.swing.JTextArea();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"invoiceIT Release Info\");\n\n jTextArea1.setColumns(20);\n jTextArea1.setRows(5);\n jScrollPane1.setViewportView(jTextArea1);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 897, Short.MAX_VALUE)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 389, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n pack();\n }", "private JTextArea getTxtDsDocPendente() {\r\n\t\tif (txtDsDocPendente == null) {\r\n\t\t\ttxtDsDocPendente = new JTextArea();\r\n\t\t\ttxtDsDocPendente.setBounds(new Rectangle(12, 94, 375, 126));\r\n\t\t\ttxtDsDocPendente.setToolTipText(\"Descrição do documento pendente do aluno\");\r\n\t\t}\r\n\t\treturn txtDsDocPendente;\r\n\t}", "protected JTextComponent createDefaultEditor() {\n JTextComponent textComponent = new JTextPane() {\n private static final long serialVersionUID = 6954176332471863456L;\n\n /**\n * Set some rendering hints - if we don't then the rendering can be inconsistent. Also, Swing doesn't work correctly with fractional metrics.\n */\n public void paint(Graphics g) {\n Graphics2D g2 = (Graphics2D) g;\n\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);\n g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\n g2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_OFF);\n\n super.paint(g);\n }\n\n /**\n * If the standard scroll rect to visible is on, then you can get weird behaviors if the canvas is put in a scroll pane.\n */\n @SuppressWarnings(\"unused\")\n public void scrollRectToVisible() {\n }\n };\n textComponent.setBorder(new CompoundBorder(new LineBorder(Color.black), new EmptyBorder(3, 3, 3, 3)));\n\n Font newFont = textComponent.getFont().deriveFont(Font.PLAIN, fontSize);\n textComponent.setFont(newFont);\n return textComponent;\n }", "private void setupView(JTextArea view, int w, int h, int x, int y) {\n\n view.setSize(w,h);\n view.setLocation(x,y);\n\n add(view);\n\n }", "private JTextArea getSelectedTextArea() {\r\n\t\tint index = tabbedPane.getSelectedIndex();\r\n\t\tif (index == -1) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tJScrollPane sp = (JScrollPane) tabbedPane.getComponent(index);\r\n\t\tJTextArea editor = (JTextArea) sp.getViewport().getView();\r\n\t\t\r\n\t\treturn editor;\r\n\t}", "public TextAreaOutputStream( JTextArea control ) {\r\n textControl = control;\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n txtenviobackup = new javax.swing.JTextArea();\n\n setClosable(true);\n setTitle(\"CREAR BACKUP\");\n\n txtenviobackup.setColumns(20);\n txtenviobackup.setRows(5);\n jScrollPane1.setViewportView(txtenviobackup);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 625, Short.MAX_VALUE)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 388, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(62, Short.MAX_VALUE))\n );\n\n pack();\n }", "public TextArea getInputPane();", "public T casetextArea(textArea object) {\n\t\treturn null;\n\t}", "private void initComponents() {\n\n jTextAreaTop = new javax.swing.JTextArea();\n jScrollPane1 = new javax.swing.JScrollPane();\n jEditorPane1 = new javax.swing.JEditorPane();\n jTextAreaBottom = new javax.swing.JTextArea();\n\n setBorder(javax.swing.BorderFactory.createEmptyBorder(12, 12, 0, 11));\n setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.Y_AXIS));\n\n jTextAreaTop.setBackground(getBackground());\n jTextAreaTop.setColumns(20);\n jTextAreaTop.setEditable(false);\n jTextAreaTop.setFont(new java.awt.Font(\"Dialog\", 1, 12));\n jTextAreaTop.setLineWrap(true);\n jTextAreaTop.setRows(1);\n jTextAreaTop.setText(bundle.getString(\"MSG_LicenseDlgLabelTop\"));\n jTextAreaTop.setWrapStyleWord(true);\n jTextAreaTop.setFocusable(false);\n jTextAreaTop.setMargin(new java.awt.Insets(0, 0, 2, 0));\n jTextAreaTop.setRequestFocusEnabled(false);\n add(jTextAreaTop);\n\n jEditorPane1.setEditable(false);\n jEditorPane1.setPreferredSize(new java.awt.Dimension(500, 500));\n jScrollPane1.setViewportView(jEditorPane1);\n\n add(jScrollPane1);\n\n jTextAreaBottom.setBackground(getBackground());\n jTextAreaBottom.setColumns(20);\n jTextAreaBottom.setEditable(false);\n jTextAreaBottom.setFont(new java.awt.Font(\"Dialog\", 1, 12));\n jTextAreaBottom.setLineWrap(true);\n jTextAreaBottom.setRows(2);\n jTextAreaBottom.setText(bundle.getString(\"MSG_LicenseDlgLabelBottom\"));\n jTextAreaBottom.setWrapStyleWord(true);\n jTextAreaBottom.setFocusable(false);\n jTextAreaBottom.setRequestFocusEnabled(false);\n add(jTextAreaBottom);\n }", "public Adapter createEObjectAdapter()\n {\n return null;\n }", "public Adapter createEObjectAdapter()\n {\n return null;\n }", "public Adapter createEObjectAdapter()\n {\n return null;\n }", "public Adapter createEObjectAdapter()\n {\n return null;\n }", "public Adapter createEObjectAdapter()\n {\n return null;\n }", "public Adapter createEObjectAdapter()\n {\n return null;\n }", "public Adapter createEObjectAdapter()\n {\n return null;\n }", "public Adapter createEObjectAdapter()\n {\n return null;\n }", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public Adapter createEObjectAdapter() {\n\t\treturn null;\n\t}", "public face2(){\r\n\tsuper(\"library\");\r\n\tface1.any1();\r\n\t//y=new GridLayout(face1.b,0);\r\n\tsetLayout(new BorderLayout());\r\n\tString s=\"\";\r\n\t//d=new JLabel[face1.b];\r\n\t\r\n\tfor(int i=0;i<face1.b;i++)\r\n\t{//d[i]=new JLabel(face1.a[i]);\r\n\t//add (d[i]);\r\n\ts=s+face1.a[i]+\"\\n\";\r\n\t}\r\n\tJTextArea f=new JTextArea(s,5,5);\r\n\t\t\tf.setEditable(false);\r\n\t\t\tadd(new JScrollPane(f), BorderLayout.CENTER);\r\n\t\t\r\n\t}", "public static TextField makeTextArea (String prompt) {\n TextField field = new TextField();\n field.setPromptText(prompt);\n return field;\n }", "public Adapter createEObjectAdapter() {\n return null;\n }", "public Adapter createEObjectAdapter() {\n return null;\n }", "public Messagespace(PetalEditor petal_editor,\n Model petal_model) {\n super(new GridLayout(1,1));\n\n this.petal_editor = petal_editor;\n this.petal_model = petal_model;\n this.editor = editor;\n\n JTabbedPane tabbedPane = new JTabbedPane();\n tabbedPane.setTabPlacement(JTabbedPane.RIGHT);\n\n\n s_errorsTextArea = new JTextArea();\n s_errorsTextArea.setRows(Constants.TEXTROWS);\n JPanel errorsPanel = new JPanel(new GridLayout(1,1));\n errorsPanel.add(new JScrollPane(s_errorsTextArea));\n tabbedPane.addTab(ERRORS, errorsPanel);\n\n s_statisticsTextArea = new JTextArea();\n s_statisticsTextArea.setRows(Constants.TEXTROWS);\n JPanel statisticsPanel = new JPanel(new GridLayout(1,1));\n statisticsPanel.add(new JScrollPane(s_statisticsTextArea));\n tabbedPane.addTab(STATISTICS, statisticsPanel);\n\n s_messagesTextArea = new JTextArea();\n s_messagesTextArea.setRows(Constants.TEXTROWS);\n JPanel messagesPanel = new JPanel(new GridLayout(1,1));\n messagesPanel.add(new JScrollPane(s_messagesTextArea));\n tabbedPane.addTab(MESSAGES, messagesPanel);\n\n add(tabbedPane);\n\n setBorder(new LineBorder(Color.black,1));\n\n s_errorsTextArea.setEditable(false);\n s_statisticsTextArea.setEditable(false);\n s_messagesTextArea.setEditable(false);\n\n tabbedPane.setSelectedIndex(MESSAGES_ID);\n \n \n\n }", "public JPanel createVersionHistoryPanel()\n\t{\n\t\t// Create and configure JPanel\n\t\tversionHistoryPanel = new JPanel();\n\t\tversionHistoryPanel.setLayout(new BorderLayout());\n\t\tversionHistoryPanel.setBorder(new CompoundBorder(new TitledBorder(\"Version history\"), new EmptyBorder(8, 0, 0, 0)));\n\t\t\n\t\t// Create components\t\t\n\t\ttextAreaVersions = new JTextArea(5, 20);\n\t\ttextAreaVersions.setEditable(false);\n\t\ttextAreaVersions.setOpaque(false);\n\t\t\n\t\tscrollPaneVersions = new JScrollPane(textAreaVersions);\n\t\tscrollPaneVersions.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);\n\t\tscrollPaneVersions.setOpaque(false);\n\n\t\t// Attach components to JPanel\t\n\t\tversionHistoryPanel.add(scrollPaneVersions);\n\t\t\n\t\treturn versionHistoryPanel;\n\t}", "public AreaMap()\r\n {\r\n map = new JTextArea[10][10];\r\n \r\n for (JTextArea[] map1 : map)\r\n {\r\n for (int i = 0; i<map[0].length; i++)\r\n {\r\n map1[i] = new JTextArea();\r\n map1[i].setBackground(Color.black);\r\n map1[i].setEditable(false);\r\n map1[i].setText(\"\");\r\n }\r\n }\r\n setup();\r\n \r\n \r\n }", "public Adapter createEObjectAdapter() {\r\n\t\treturn null;\r\n\t}", "public Adapter createEObjectAdapter() {\r\n\t\treturn null;\r\n\t}", "public Adapter createEObjectAdapter() {\r\n\t\treturn null;\r\n\t}", "public Adapter createEObjectAdapter() {\r\n\t\treturn null;\r\n\t}", "public Adapter createEObjectAdapter() {\r\n\t\treturn null;\r\n\t}", "public Adapter createEObjectAdapter() {\r\n\t\treturn null;\r\n\t}", "public Adapter createEObjectAdapter() {\r\n\t\treturn null;\r\n\t}", "public void initCon() {\n\t\t\n\t\t//ImageIcon icon = new ImageIcon(this.getClass().getResource(\"lib/data/icon/log.png\"));\n\t\t//txtArea.setLineWrap(true);\n\t\ttxtArea = new JTextArea(16,70);\n\t\t//txtArea.setLineWrap(true);\n\t\tJTabbedPane tPane = new JTabbedPane();\n\t\t\n\t\tJScrollPane scrollPane = new JScrollPane(txtArea); \n\t\t\n\t\t\n\t\tJPanel top = new JPanel();\n\t\tJPanel center = new JPanel();\n\t\t\n\t\tbottom = new JPanel();\n\t\tColor color = UIManager.getColor ( \"Panel.background\" );\n\t\t\n\t\ttop.add( scrollPane );\n\t\ttPane.addTab(\"Console\", top);\n\t\t\n\t\t\n\t\t//set colors\n\t\treadout.setBackground(color);\n\t\ttop.setBackground(color);\n\t\tcenter.setBackground(color);\n\t\tbottom.setBackground(color);\n\t\t//.setOpaque(true);\n\t\t\n\t\tbottom.setLayout(new GridLayout(1,2));\n\t\tbottom.add(readout);\n\t\tcenter.setLayout(new GridLayout(2,1));\n\t\tadd(center, BorderLayout.CENTER);\n\t\tadd(bottom, BorderLayout.SOUTH);\n\t\tadd(tPane, BorderLayout.NORTH);\n\t}", "private void generateTextArea()\n {\n //Clear the textArea\n textArea.selectAll();\n textArea.replaceSelection(\"\");\n\n MyCircle circle = panel.getCircle();\n\n //Add all of the required information to the textarea\n textArea.append(String.format(\"AREA: %.2f %n\", circle.getArea()));\n textArea.append(\"RADIUS: \"+circle.getRadius()+\"\\n\");\n textArea.append(\"DIAMETER: \"+circle.getDiameter()+\"\\n\");\n textArea.append(String.format(\"CIRCUMFERENCE: %.2f %n\", circle.getCircumference()));\n }" ]
[ "0.66755235", "0.63999176", "0.6375636", "0.61590457", "0.60340947", "0.5929267", "0.592778", "0.5925644", "0.5917901", "0.5877851", "0.58162284", "0.57809323", "0.5750643", "0.5699874", "0.5671469", "0.5653839", "0.5651041", "0.5622375", "0.5498631", "0.54765844", "0.54479367", "0.5425979", "0.5405873", "0.53963745", "0.53838193", "0.53778857", "0.5364162", "0.5363322", "0.5358942", "0.5322458", "0.5233319", "0.52304775", "0.5190991", "0.5157981", "0.5157028", "0.51393974", "0.5127121", "0.5126341", "0.51211333", "0.5087145", "0.50747216", "0.5064078", "0.50323033", "0.5011747", "0.4999169", "0.49957222", "0.49938992", "0.49936846", "0.49874443", "0.49630675", "0.4957416", "0.4957416", "0.4957416", "0.4957416", "0.4957416", "0.4957416", "0.4957416", "0.4957416", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.49494824", "0.4942756", "0.49293903", "0.49223226", "0.49223226", "0.49210146", "0.49196765", "0.49169374", "0.49153024", "0.49153024", "0.49153024", "0.49153024", "0.49153024", "0.49153024", "0.49153024", "0.48953107", "0.48930323" ]
0.53482646
29
Insertion d'une collection d'objets.
public void saveList(List<T> ListObject) throws DaoException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic long insertObjs(Collection<T> t) {\n\t\treturn insertObjs(false, t);\n\t}", "@Override\n\tpublic void insertar() {\n\t\t\n\t}", "@Override\n\tpublic void insert(Unidade obj) {\n\n\t}", "@Override\n\tpublic void insert() {\n\t\t\n\t}", "public void insert(\n Collection<? extends ContentObject> objects\n )\n {\n int index = 0;\n int size = objects.size();\n for(ContentObject object : objects)\n {\n insert(object);\n\n if(++index < size)\n {moveNext();}\n }\n }", "public void insert()\n\t{\n\t}", "@Override\n\tpublic long insertObjs(T... t) {\n\t\tList<T> list = new ArrayList<T>();\n\t\tfor (T obj : t) {\n\t\t\tlist.add(obj);\n\t\t}\n\t\treturn insertObjs(list);\n\t\t// int optNum = 0;\n\t\t// for(T obj : t){\n\t\t// InsertBuider<T> buider = insertBuider();\n\t\t// buider.addValue(obj);\n\t\t// helper.getDatabase(false).insert(buider.tableInfo.tableName, null,\n\t\t// buider.cvs);\n\t\t// optNum++;\n\t\t// }\n\t\t// return optNum;\n\t}", "@Override\n\tpublic int insert_all(Object[] ob) {\n\t\treturn 0;\n\t}", "private void populaObjetivoCat()\n {\n objetivoCatDAO.insert(new ObjetivoCat(\"Hipertrofia\", \"weight\"));\n objetivoCatDAO.insert(new ObjetivoCat(\"Saude\", \"apple\"));\n objetivoCatDAO.insert(new ObjetivoCat(\"Emagrecer\", \"gloves\"));\n }", "@Override\r\n\tpublic Integer insert(Wt_collection record) {\n\t\treturn 0;\r\n\t}", "public void insert(Object item);", "public void insert(\n ContentObject object\n )\n {\n if(index == -1)\n {index = 0;}\n\n objects.add(index,object);\n refresh();\n }", "@Override\n\tpublic int insert(Object ob) {\n\t\treturn 0;\n\t}", "public void insert(Conge conge) ;", "public void insert(int i, T obj);", "@Override\r\n\tpublic Ngo insert(Ngo obj) {\n\t\treturn null;\r\n\t}", "private void insertData() {\n compra = factory.manufacturePojo(CompraVentaEntity.class);\n compra.setId(1L);\n compra.setQuejasReclamos(new ArrayList<>());\n em.persist(compra);\n\n for (int i = 0; i < 3; i++) {\n QuejasReclamosEntity entity = factory.manufacturePojo(QuejasReclamosEntity.class);\n entity.setCompraVenta(compra);\n em.persist(entity);\n data.add(entity);\n compra.getQuejasReclamos().add(entity);\n }\n }", "private void insertar(ArrayList<Estado> hijos) {\r\n\t\tfor (Estado p : hijos) { // Añado hijos a nodos abiertos\r\n\t\t\tabiertos.add(p);\r\n\t\t\tif (abiertos.size() > estados_abiertos)\r\n\t\t\t\testados_abiertos = abiertos.size(); // Variable para contar el numero maximo de estados abiertos\r\n\t\t}\r\n\t}", "public void insert(T o);", "public void addElement(Replicated obj)\r\n\t{\n\t\tinsert(obj, seq.size());\r\n\t}", "@Override\n\tpublic void preInsert() {\n\n\t}", "public void insert(E e);", "@Override\n\tpublic WriteResult insertNewDocCollection(List<Object> lista) {\n\t\treturn null;\n\t}", "public void insert(E item) {\n // FILL IN\n }", "private void insertData() {\r\n \r\n TeatroEntity teatro = factory.manufacturePojo(TeatroEntity.class);\r\n em.persist(teatro);\r\n FuncionEntity funcion = factory.manufacturePojo(FuncionEntity.class);\r\n List<FuncionEntity> lista = new ArrayList();\r\n lista.add(funcion);\r\n em.persist(funcion);\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n sala.setFuncion(lista);\r\n em.persist(sala);\r\n data.add(sala);\r\n }\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n em.persist(sala);\r\n sfdata.add(sala);\r\n }\r\n \r\n }", "int insert(Collect record);", "public abstract String insert(Object obj) ;", "private void insertData() {\n for (int i = 0; i < 3; i++) {\n PodamFactory factory = new PodamFactoryImpl();\n VisitaEntity entity = factory.manufacturePojo(VisitaEntity.class);\n em.persist(entity);\n data.add(entity);\n }\n }", "@Override\r\n\tpublic void inserOrder(Good_ordVO good_ordVO, List<PointgoodsVO> list) {\n\t\t\r\n\t}", "private void addSomeItemsToDB () throws Exception {\n/*\n Position pos;\n Course course;\n Ingredient ing;\n\n PositionDAO posdao = new PositionDAO();\n CourseDAO coursedao = new CourseDAO();\n IngredientDAO ingdao = new IngredientDAO();\n\n ing = new Ingredient(\"Mozzarella\", 10,30);\n ingdao.insert(ing);\n\n // Salads, Desserts, Main course, Drinks\n pos = new Position(\"Pizza\");\n posdao.insert(pos);\n\n course = new Course(\"Salads\", \"Greek\", \"Cucumber\", \"Tomato\", \"Feta\");\n coursedao.insert(course);\n\n ing = new Ingredient(\"-\", 0,0);\n ingdao.insert(ing);\n */\n }", "@Override\n\tpublic void insertProcess() {\n\t\t\n\t}", "public void insert(T object) {\n\t createInternalStorage(object.getIndexes().length);\n\t for(int i=0;i<object.getIndexes().length;i++) {\n\t\tLinkedList<T> value = internalStorage.get(i).get(object.getIndexes()[i]);\n\t\tif (value == null) {\n\t\t value = new LinkedList<T>();\n\t\t internalStorage.get(i).put(object.getIndexes()[i], value);\n\t\t}\n\t\tvalue.add(object);\n\t }\n\t\t\n\t}", "public Emmanuel_salcedoBST(E[] objects) {\r\n\t\tfor (int i = 0; i < objects.length; i++)\r\n\t\t\tinsert(objects[i]);\r\n\t}", "private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n VueltasConDemoraEnOficinaEntity entity = factory.manufacturePojo(VueltasConDemoraEnOficinaEntity.class);\n \n em.persist(entity);\n data.add(entity);\n }\n }", "private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n ViajeroEntity entity = factory.manufacturePojo(ViajeroEntity.class);\n\n em.persist(entity);\n data.add(entity);\n }\n }", "@Override\n\tpublic void Insert(PersonelContract entity) {\n\n\t}", "public void insert(KeyedItem o){\r\n\t\tinsert(this,o);\r\n\t}", "public void insertAll(ArrayList<Object> objects){\n\t\tfor(Object o: objects) insert(o);\n\t}", "public void insert(Object element1, Object element2, Object element3);", "public int insertElements(Collection<T> col, int index) {\r\n\t\tobjectCollection.addAll(index, col);\r\n\t\treturn selectElement(index);\r\n\t}", "public void processInsertar() {\n }", "void insert(Object value, int position);", "@Override\n\tpublic int insert_all(Object[] ob) {\n\t\tint res = 0;\n\n\t\tfor (Object obb : ob)\n\t\t\tres += session.insert(\"play.play_insert\", obb);\n\t\tSystem.out.println(\"플레이: 인서트 갯수:\" + res);\n\t\treturn res;\n\t}", "private void insertBoger() {\r\n\t\tEmne emne;\r\n\t\tBog bog;\r\n\t\tForfatter forfatter;\r\n\r\n\t\temne = _database.getEmne().get(0);\r\n\t\tbog = new BogEksemplar(\"Titel-1\", emne, 2001,1);\r\n\t\tforfatter = _database.getForfatter().get(0);\r\n\t\tbog.addForfatter(forfatter);\r\n\t\t_database.addBog(bog);\r\n\t\t\r\n\t\temne = _database.getEmne().get(0);\r\n\t\tbog = new BogEksemplar(\"Titel-1\", emne, 2001,2);\r\n\t\tforfatter = _database.getForfatter().get(0);\r\n\t\tbog.addForfatter(forfatter);\r\n\t\t_database.addBog(bog);\r\n\r\n\t\temne = _database.getEmne().get(0);\r\n\t\tbog = new BogEksemplar(\"Titel-2\", emne, 2002,1);\r\n\t\tforfatter = _database.getForfatter().get(1);\r\n\t\tbog.addForfatter(forfatter);\r\n\t\t_database.addBog(bog);\r\n\t\t\r\n\t\temne = _database.getEmne().get(1);\r\n\t\tbog = new BogEksemplar(\"Titel-3\", emne, 2003,1);\r\n\t\tforfatter = _database.getForfatter().get(1);\r\n\t\tbog.addForfatter(forfatter);\r\n\t\t_database.addBog(bog);\r\n\t\t\r\n\t\temne = _database.getEmne().get(0);\r\n\t\tbog = new BogEksemplar(\"Titel-4\", emne, 2001,1);\r\n\t\tforfatter = _database.getForfatter().get(2);\r\n\t\tbog.addForfatter(forfatter);\r\n\t\t_database.addBog(bog);\r\n\t\t\r\n\t}", "@Override\n\tpublic <S extends Basket> List<S> insert(Iterable<S> arg0) {\n\t\treturn null;\n\t}", "private void insertData() {\n\n cliente = factory.manufacturePojo(ClienteEntity.class);\n em.persist(cliente);\n for (int i = 0; i < 3; i++) {\n FormaPagoEntity formaPagoEntity = factory.manufacturePojo(FormaPagoEntity.class);\n formaPagoEntity.setCliente(cliente);\n em.persist(formaPagoEntity);\n data.add(formaPagoEntity);\n }\n }", "@Override\r\n\tpublic Integer insertSelective(Wt_collection record) {\n\t\treturn 0;\r\n\t}", "private void insert(Replicated obj, int index)\r\n\t{\n\t\tSync.putObject(obj);\r\n\t\tObjectID oid = obj.getObjectID();\r\n //System.out.println(\"oid: \" + oid);\r\n\t\tif (original.containsKey(oid)) {\r\n\t\t\tif (del_mod.get(oid) instanceof SequenceDeleteChange) del_mod.remove(oid);\r\n //System.out.println(\"Move change\");\r\n\t\t\tins_mov.put(oid, new SequenceMoveChange(getObjectID(), oid));\r\n\t\t} else {\r\n\t\t\tobj.setParent(this);\r\n\t\t\tins_mov.put(oid, new SequenceInsertChange(getObjectID(), oid, obj));\r\n\t\t}\r\n //System.out.println(\"Added insert change\" + ins_mov);\r\n\t\tseq.insertElementAt(obj, index);\r\n //System.out.println(\"calling set changed\");\r\n\t\tsetChanged();\r\n //System.out.println(\"finished set changed\");\r\n\t}", "int insert(VoteList record);", "int insert(Sequipment record);", "@Override\n\tpublic <T> void insertMany(List<T> list) throws Exception {\n\t\t\n\t}", "private void insertData() \n {\n for (int i = 0; i < 3; i++) {\n TarjetaPrepagoEntity entity = factory.manufacturePojo(TarjetaPrepagoEntity.class);\n em.persist(entity);\n data.add(entity);\n }\n for(int i = 0; i < 3; i++)\n {\n PagoEntity pagos = factory.manufacturePojo(PagoEntity.class);\n em.persist(pagos);\n pagosData.add(pagos);\n\n }\n \n data.get(2).setSaldo(0.0);\n data.get(2).setPuntos(0.0);\n \n double valor = (Math.random()+1) *100;\n data.get(0).setSaldo(valor);\n data.get(0).setPuntos(valor); \n data.get(1).setSaldo(valor);\n data.get(1).setPuntos(valor);\n \n }", "int insert(Tourst record);", "WriteRequest insert(Iterable<? extends PiEntity> entities);", "public void insert(List<T> entity) throws NoSQLException;", "private void insertData() {\r\n PodamFactory factory = new PodamFactoryImpl();\r\n for (int i = 0; i < 3; i++) {\r\n MonitoriaEntity entity = factory.manufacturePojo(MonitoriaEntity.class);\r\n\r\n em.persist(entity);\r\n data.add(entity);\r\n }\r\n }", "public void insert(TdiaryArticle obj) throws SQLException {\n\r\n\t}", "int insert(Clazz record);", "@Override\n\tpublic void insertArticle(BoardVO vo) {\n\t\tarticles.add(vo);\n\t}", "@Test\r\n public void testInsertion() {\r\n int numOfIntersections = newData.getAllIntersections().size();\r\n int numOfConnections = 0;\r\n // Test initialization of data wrangler object\r\n if(intersections.size() != numOfIntersections)\r\n fail(\"Failed to grab all intersections\");\r\n // Test insertion of intersections into map\r\n if(map.getVertexCount() != numOfIntersections)\r\n fail(\"Failed to insert all intersections into map\");\r\n // Test insertion of edges into map\r\n for(int i = 0; i < intersections.size(); i++) {\r\n // Grab connections\r\n numOfConnections += intersections.get(i).getConnections().size();\r\n }\r\n if(map.getEdgeCount() != numOfConnections)\r\n fail(\"Failed to insert connections into map\");\r\n }", "public void insert(AsxDataVO entity) {\n\t\tmongoTemplate.insert(entity); \r\n\t}", "public Etudiant insert(Etudiant obj) {\n\t\treturn null;\n\t}", "@Override\n\tpublic int insert(Object model) {\n\t\treturn 0;\n\t}", "@Override\n\tpublic Boolean insert(Intervention item) {\n\t\treturn true;\n\t}", "int insert(Commet record);", "@Override\r\n\tpublic String insert() {\n\t\treturn \"insert\";\r\n\t}", "<T> int insert(T obj);", "int insert(Ltsprojectpo record);", "@Override\n public boolean insert(T o) {\n // Makes sure only the same Object in in the Array\n/*\n if(type == null){\n type = o.getClass();\n }\n if(type != o.getClass()) return false;\n*/\n\n if(o == null) return false;\n if(contains(o)) return false;\n int hcode = hash(o);\n hcode %= array.length;\n array[hcode].add(o);\n return true;\n }", "@Override\r\n\tpublic void insert(BbsDto dto) {\n\t}", "@Override\n\tpublic void insert(DeptVO deptVO) {\n\t\t\n\t}", "@Override\n\tpublic void insert(Category entitiy) {\n\n\t}", "int insertSelective(Collect record);", "private void insertData() {\n for (int i = 0; i < 3; i++) {\n RecipeEntity books = factory.manufacturePojo(RecipeEntity.class);\n em.persist(books);\n data.add(books);\n }\n }", "void insert(organize_infoBean record);", "@Override\n public void insert(J34SiscomexOrigemDi j34SiscomexOrigemDi) {\n super.doInsert(j34SiscomexOrigemDi);\n }", "int insert(Tour record);", "@Override\n\tpublic ResultMessage insertCar(Carpo po) {\n\t\treturn inList.insert(po);\n\t}", "public void insert() {\r\n\t\tinitFinish = false;\r\n\t\twhile (isEmpty()) {\r\n\t\t\tfor (int i = 0; i < size; i++) {\r\n\t\t\t\tfor (int j = 0; j < size; j++) {\r\n\t\t\t\t\tif (candyBoard[i][j] == null||!(candyBoard[i][j] instanceof RegularCandy)) {\r\n\t\t\t\t\t\tcandyBoard[i][j] = candyRandom();\r\n\t\t\t\t\t\tcandyBoard[i][j].setCoord(i, j);\r\n\t\t\t\t\t\tactiveCandies.add(candyBoard[i][j]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}// for j\r\n\t\t\t}// for i\r\n\t\t\tfor (Candy candy : activeCandies) {\r\n\t\t\t\tif (move(candy, candy)) {\r\n\t\t\t\t\tincreaseMulty();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}// while\r\n\t\tactiveCandies.removeAllElements();\r\n\t\tinitFinish = true;\r\n\t}", "public void inserir(Comentario c);", "@Override\n\tpublic void insert(Computer computer) {\n\t\t\n\t}", "@Override\n\tpublic boolean insert(E e) {\n\t\treturn add(e);\n\t}", "public void insert() {\n\t\tSession session = DBManager.getSession();\n\t\tsession.beginTransaction();\n\t\tsession.save(this);\n\t\tsession.getTransaction().commit();\n\t}", "int insert(DictDoseUnit record);", "org.landxml.schema.landXML11.RoadsideDocument.Roadside insertNewRoadside(int i);", "public final void insert(Envelope envelope, final int item) {\n visit(envelope, true, (bin, mapKey) -> {\n /*\n * Note: here we can end-up having several time the same object in the same bin, if\n * the client insert multiple times the same object with different envelopes.\n * However we do filter duplicated when querying, so apart for memory/performance\n * reasons it should work. If this becomes a problem, we can use a set instead of a\n * list.\n */\n bin.add(item);\n nEntries++;\n return false;\n });\n nObjects++;\n }", "public void inserirLigas() throws SQLException {\n observableListLigas = FXCollections.observableArrayList(ligas);\n selecionarLiga.setItems(observableListLigas);\n \n }", "private void insertData() {\n\n for (int i = 0; i < 3; i++) {\n ProveedorEntity proveedor = factory.manufacturePojo(ProveedorEntity.class);\n BonoEntity entity = factory.manufacturePojo(BonoEntity.class);\n int noOfDays = 8;\n Date dateOfOrder = new Date();\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(dateOfOrder);\n calendar.add(Calendar.DAY_OF_YEAR, noOfDays);\n Date date = calendar.getTime();\n entity.setExpira(date);\n noOfDays = 1;\n calendar = Calendar.getInstance();\n calendar.setTime(dateOfOrder);\n calendar.add(Calendar.DAY_OF_YEAR, noOfDays);\n date = calendar.getTime();\n entity.setAplicaDesde(date);\n entity.setProveedor(proveedor);\n em.persist(entity);\n ArrayList lista=new ArrayList<>();\n lista.add(entity);\n proveedor.setBonos(lista);\n em.persist(proveedor);\n pData.add(proveedor);\n data.add(entity); \n }\n }", "int insert(TDictAreas record);", "public void insertFact(Fact fact);", "@Insert(onConflict = OnConflictStrategy.IGNORE)\n void insert(DataTugas dataTugas);", "@Override\r\n\tpublic void k_insert(ManufacturersVO MANUFACTURERSVO) {\n\t\t\r\n\t}", "int insert(Cargo record);", "int insert(Mallscroerule record);", "public static void inserir(Estoque estoque){\r\n lerXml();//le o XML e preenche a lista de estoque\r\n //pega o ultimo estoque cadastrado\r\n int ultimaPosicao = lista.size()-1;\r\n if(ultimaPosicao >= 0){ //se a lista não estiver vazia\r\n Estoque ultimoEstoque = lista.get(ultimaPosicao);\r\n estoque.setNumCompra(ultimoEstoque.getNumCompra()+1);\r\n }else{\r\n // se não tem niguem na lista, o ncompra é 1\r\n estoque.setNumCompra(1);\r\n }\r\n lista.add(estoque);//adiciona um estoque pro final da lista\r\n salvarXml();//atualiza o XML com o que tem na lista\r\n \r\n \r\n \r\n }", "@Test\n\tpublic void testInsertObj() {\n\t}", "Reservierung insert(Reservierung reservierung) throws ReservierungException;", "int insert(Goodexistsingle record);", "int insertSelective(Tourst record);", "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}", "private void toBeAddedEntities()\n\t{\n\t\tif( entitiesToAdd.isEmpty() )\n\t\t{\n\t\t\treturn ;\n\t\t}\n\n\t\tfinal List<Event<?>> events = MalletList.<Event<?>>newList() ;\n\n\t\tfinal int size = entitiesToAdd.size() ;\n\t\tfor( int i = 0; i < size; ++i )\n\t\t{\n\t\t\tfinal Entity entity = entitiesToAdd.get( i ) ;\n\t\t\thookEntity( eventSystem, events, entity ) ;\n\t\t\tentities.add( entity ) ;\n\t\t}\n\t\tentitiesToAdd.clear() ;\n\t\t\n\t\tif( size > capacity )\n\t\t{\n\t\t\t// If the size of entitiesToAdd exceeds our capacity then \n\t\t\t// we want to resize the array - it's easy for an \n\t\t\t// array to expand, it's much harder to shrink it!\n\t\t\tentitiesToAdd = MalletList.<Entity>newList( capacity ) ;\n\t\t}\n\t}" ]
[ "0.7279337", "0.701082", "0.6927793", "0.67186624", "0.6717179", "0.6645136", "0.6593111", "0.65545714", "0.65017414", "0.64688885", "0.6465261", "0.6404409", "0.6394096", "0.636218", "0.633605", "0.62721664", "0.62537223", "0.62066644", "0.62004817", "0.61336267", "0.61212885", "0.61110985", "0.61069155", "0.610039", "0.60965127", "0.60944146", "0.6065431", "0.60642326", "0.6063876", "0.6062921", "0.6044848", "0.6041791", "0.6039873", "0.6038928", "0.60361665", "0.6023724", "0.60182846", "0.60121775", "0.601023", "0.59954786", "0.59862304", "0.5977167", "0.59721", "0.5969494", "0.5965278", "0.5955841", "0.5953437", "0.59471387", "0.5946505", "0.59443676", "0.5940266", "0.59387165", "0.5929781", "0.5926034", "0.592312", "0.5912939", "0.5910785", "0.59073114", "0.5899236", "0.58962965", "0.5868135", "0.5863869", "0.5852144", "0.5844764", "0.5844152", "0.5844001", "0.58403534", "0.5835388", "0.58335346", "0.5832774", "0.5816335", "0.5810971", "0.5801712", "0.58002007", "0.5799905", "0.5795773", "0.57931674", "0.57927", "0.5791803", "0.5778656", "0.57708496", "0.5758794", "0.5753745", "0.57507116", "0.5749824", "0.57481176", "0.5740636", "0.57398295", "0.57381845", "0.573755", "0.5737509", "0.57292026", "0.57249033", "0.57231236", "0.5721064", "0.5719796", "0.5715615", "0.5715322", "0.5714794", "0.5708803", "0.5706905" ]
0.0
-1
Modification d'une collection d'objets.
public void updateList(List<T> ListObject) throws DaoException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(\"serial\")\n\t@Test\n\tpublic void updateCollection() {\n\t\tdb.close();\n\t\tEmbeddedConfiguration config = Db4oEmbedded.newConfiguration();\n\t\tconfig.common().objectClass(Car.class).cascadeOnUpdate(true);\n\t\tdb = Db4oEmbedded.openFile(config, DB4OFILENAME);\n\t\tObjectSet<Car> results = db.query(new Predicate<Car>() {\n\t\t\tpublic boolean match(Car candidate) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t});\n\n\t\tAssert.assertTrue(results.hasNext());\n\n\t\tCar car = results.next();\n\n\t\tcar.getHistory().remove(0);\n\t\tdb.store(car.getHistory());\n\t\tresults = db.query(new Predicate<Car>() {\n\t\t\tpublic boolean match(Car candidate) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t});\n\n\t\twhile (results.hasNext()) {\n\t\t\tcar = results.next();\n\t\t\tfor (int idx = 0; idx < car.getHistory().size(); idx++) {\n\t\t\t\tSystem.out.println(car.getHistory().get(idx));\n\t\t\t}\n\t\t}\n\n\t}", "private void updateCollection(Resource subject, Property property,\r\n\t\t\tCollection<?> c) {\r\n\t\tif (supportsDelete(c))\r\n\t\t\tsubject.removeAll(property);\r\n\t\tAddSaver saver = new AddSaver(subject, property);\r\n\t\tfor (Object o : c)\r\n\t\t\tif (isPrimitive(o))\r\n\t\t\t\tsaver.write(o); // leaf\r\n\t\t\telse\r\n\t\t\t\tsubject.addProperty(property, _write(o, true)); // recursive\r\n\t}", "public void revolver() {\n this.lista = Lista.escojerAleatorio(this, this.size()).lista;\n }", "void refresh(Collection<? extends BaseModel> objects);", "public static void main(String[] args) {\n Collection collection= new ArrayList();\n collection.add(1500);\n collection.add(true);\n collection.add(12.32);\n collection.add(\"s\");\n collection.add('f');\n //System.out.println(collection);\n\n //Collection add(item) bunda item qo'sha olsa true aksi bo'lsa false qataradi\n System.out.println(collection.add(2200)); // bunda console da true bo'ladi 2200 qo'sha olgani uchun\n\n /* Collection ni addAll metothdi bu bizga collection methodiga narsalarni collection1 b-n\n ketma ketlikda qo'shish imkonini beradi*/\n\n Collection collection1=new ArrayList();\n collection1.addAll(collection);\n collection1.add(\"otherNumber1\");\n collection1.add(\"otherNumber2\");\n collection1.add(\"otherNumber3\");\n System.out.println(collection1);\n\n // boolean remove(object item) bu ko'rsatilgan obyektni collectionda o'chiradi listlarda index bilan bajariladi\n collection1.remove(12.32);\n System.out.println(collection1);\n\n // boolean removeAll(Collection<?> col)\n collection1.removeAll(collection);\n System.out.println(collection1);\n\n\n\n\n\n }", "public void vide_Objet_en_memoire(){\n\t\t\n\t\tfor (int i =0; i < this.objets_instanciated.size(); i++)\n\t\t\t\tthis.objets_instanciated.elementAt(i).clear();\n\t\n\t\t\tthis.nombre_objets = 0;\n\t\t}", "public void updateAnimalList(){\r\n // if (animals != null && animals.size() > 0)\r\n // {\r\n // \r\n // }\r\n // else\r\n // {\r\n animals.clear();\r\n \r\n for (fit5042.assign.repository.entity.Animal animal : animalManagedBean.getAllAnimals())//for each animal entry in the Entity Class Animal, get all animals\r\n {\r\n animals.add(animal); //add Animal data to the ArrayList<Animal> animals\r\n }\r\n \r\n setAnimal(animals); //set the global ArrayList attribute with the local ArrayList attribute\r\n // }\r\n }", "private void actualizeazaModel() {\n model.clear();\n listaContacte.forEach((o) -> {\n model.addElement(o);\n });\n }", "public void obrniListu() {\n if (prvi != null && prvi.veza != null) {\n Element preth = null;\n Element tek = prvi;\n \n while (tek != null) {\n Element sled = tek.veza;\n \n tek.veza = preth;\n preth = tek;\n tek = sled;\n }\n prvi = preth;\n }\n }", "public void enleverTousLesObs() {\n\n\t\tobstaclesList.removeAll(obstaclesList);\n\t}", "public void clearChangeSet()\r\n\t{\n\t\toriginal = new Hashtable(10);\r\n\t\t//System.out.println(\"111111 in clearChangeSet()\");\r\n\t\tins_mov = new Hashtable(10);\r\n\t\tdel_mod = new Hashtable(10);\r\n\r\n\t\tfor (int i = 0; i < seq.size(); i++) {\r\n\t\t\tReplicated elt = (Replicated) seq.elementAt(i);\r\n\t\t\toriginal.put(elt.getObjectID(), elt);\r\n\t\t}\r\n\t}", "public void supprimerCollection(){\r\n collection.clear();\r\n }", "@Override\n\tpublic boolean update(Eleve o) {\n\t\tmap.replace(o.getId(), o);\n\t\treturn true;\n\t}", "public void updateByObject()\r\n\t{\n\t}", "private static void test1() {\n HashSet<Contact> contacts = new HashSet<>();\n\n Contact contact1 = new Contact(123, \"Vasiliy\", \"+380681234136\");\n\n contacts.add(contact1);\n\n\n //------------------------------------------\n\n\n Contact contact2 = new Contact(123, \"Vasiliy\", \"+380689876543\");\n\n contacts.remove(contact2);\n contacts.add(contact2);\n\n printCollection(contacts);\n }", "void setPrestitoCollection(Collection<Prestito> prestitoCollection);", "public <T> Collection<T> updateAll(Collection<T> entities);", "Collect getColl();", "@Override\n public void reset() {\n iterator = collection.iterator();\n }", "@Override\n public boolean update(Revue objet) {\n return false;\n }", "public void populateListaObjetos() {\n listaObjetos.clear();\n Session session = HibernateUtil.getSessionFactory().openSession();\n try {\n String tipo = null;\n if (selectedTipo.equals(\"submenu\")) {\n tipo = \"menu\";\n } else if (selectedTipo.equals(\"accion\")) {\n tipo = \"submenu\";\n }\n\n Criteria cObjetos = session.createCriteria(Tblobjeto.class);\n cObjetos.add(Restrictions.eq(\"tipoObjeto\", tipo));\n Iterator iteObjetos = cObjetos.list().iterator();\n while (iteObjetos.hasNext()) {\n Tblobjeto o = (Tblobjeto) iteObjetos.next();\n listaObjetos.add(new SelectItem(new Short(o.getIdObjeto()).toString(), o.getNombreObjeto(), \"\"));\n }\n } catch (HibernateException e) {\n //logger.throwing(getClass().getName(), \"populateListaObjetos\", e);\n } finally {\n session.close();\n }\n }", "public void fireOIFitsCollectionChanged() {\n fireOIFitsCollectionChanged(this, null);\n }", "@Override\r\n\tpublic void notifyObservers(){\n\t\tfor (Observer o : ol){\r\n\t\t\t//iterate through GameCollection to avoid passing iterator to views\r\n\t\t\tIterator iterator = gc.getIterator();\r\n\t\t\t//if MapView, iterate through game list and provide new state information\r\n\t\t\tif (o instanceof MapView){\r\n\t\t\t\twhile(iterator.hasNext()){\r\n\t\t \t\tGameObject g = iterator.getNext();\r\n\t\t\t\t\to.update(gwp, g);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//if PointsView, get all point values from GameCollection and provide values\r\n\t\t\telse if (o instanceof PointsView){\r\n\t\t\t\t//cast as PointsView to use overloaded update methods\r\n\t\t\t\tPointsView p = (PointsView)o;\r\n\t\t\t\t//update all point values using overloaded update method, providing string tag to PointsView to differentiate which value is which\r\n\t\t\t\t//also pass in \"hard\" values accessed from GameCollection to avoid giving views access directly to GameCollection\r\n\t\t\t\tp.update(gwp, \"time\", (600-gc.getElapsedTime())/10);\r\n\t\t\t\tp.update(gwp, \"pointsForFish\", gc.getPointsForFish());\r\n\t\t\t\tp.update(gwp, \"pointsFishInNet\", tempPointsFishInNet);\r\n\t\t\t\tp.update(gwp, \"totalPoints\", gc.getTotalPoints());\r\n\t\t\t\tp.update(gwp, \"sharksScooped\", gc.getSharksScooped());\r\n\t\t\t\t//use 2nd overloaded update() method in PointsView to pass sound as a boolean\r\n\t\t\t\tp.update(gwp,gc.getSound());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void effacerObjetSelec( int objetSelec) {\n\n\t\tobstaclesList.remove(objetSelec);\n\t}", "void setData(OrderedRealmCollection<LessonData> lessons)\n {\n if (filteredLessons == lessons)\n return;\n this.filteredLessons = lessons;\n notifyDataSetChanged();\n }", "@Override\n\tpublic void update(Unidade obj) {\n\n\t}", "public void clear() {collection.clear();}", "void setLibroCollection1(Collection<Libro> libroCollection1);", "public void analyzeSetModified(AnalyzeInfo info)\n {\n ExprGenerator objGen = ((ExprPro) _objExpr).getGenerator();\n\n objGen.analyzeSetModified(info);\n }", "@Override\n\t\t\t\tpublic void ontologyModified(KIDSGUIOracle o){\n\t\t\t\t\tlogme.debug(String.format(\"Received ontology modified event; repopulating list for class %s\", ourClass));\n\t\t\t\t\trepopulateList(individualJListModel);\n\t\t\t\t}", "public void updateObjectLists() {\n Enumeration e = inspectors.elements();\n while (e.hasMoreElements())\n ((InspectorInterface)e.nextElement()).updateObjectList();\n}", "public void setCollection(ArrayList<Fonds> collection){\r\n this.collection = collection;\r\n }", "public void triCollection(){\r\n Collections.sort(collection);\r\n }", "private void clearCollection() {\n \n collection_ = getDefaultInstance().getCollection();\n }", "private void mueveObjetos()\n {\n // Mueve las naves Ufo\n for (Ufo ufo : ufos) {\n ufo.moverUfo();\n }\n \n // Cambia el movimiento de los Ufos\n if (cambiaUfos) {\n for (Ufo ufo : ufos) {\n ufo.cambiaMoverUfo();\n }\n cambiaUfos = false;\n }\n\n // Mueve los disparos y los elimina los disparos de la nave Guardian\n if (disparoGuardian.getVisible()) {\n disparoGuardian.moverArriba();\n if (disparoGuardian.getPosicionY() <= 0) {\n disparoGuardian.setVisible(false);\n }\n }\n\n // Dispara, mueve y elimina los disparos de las naves Ufo\n disparaUfo();\n if (disparoUfo.getVisible()) {\n disparoUfo.moverAbajo();\n if (disparoUfo.getPosicionY() >= altoVentana) {\n disparoUfo.setVisible(false);\n }\n }\n\n // Mueve la nave Guardian hacia la izquierda\n if (moverIzquierda) {\n guardian.moverIzquierda();\n }\n // Mueve la nave Guardian hacia la derecha\n if (moverDerecha) {\n guardian.moverDerecha();\n }\n // Hace que la nave Guardian dispare\n if (disparar) {\n disparaGuardian();\n }\n }", "@Override\r\n\tpublic void update(Cidade obj) {\n\r\n\t}", "@Override\n\tpublic void updateObservateur() {\n\t\tfor (Observateur obs : this.listObservateur)\n\t\t\tobs.update(hour);\n\n\t}", "private void actualizarEnemigosItems() {\n if(estadoMapa== EstadoMapa.RURAL || estadoMapa== EstadoMapa.RURALURBANO ){\n moverCamionetas();\n moverAves();\n }\n if(estadoMapa== EstadoMapa.URBANO || estadoMapa == EstadoMapa.URBANOUNIVERSIDAD){\n moverCarroLujo();\n moverAves();\n }\n if(estadoMapa== EstadoMapa.UNIVERSIDAD){\n moverCarritoGolf();\n moverAves();\n }\n if (estadoMapa == EstadoMapa.SALONES){\n moverLamparas();\n moverSillas();\n }\n actualizaPuntuacion();\n moverTareas();\n moverItemCorazon();\n verificarColisiones();\n verificarMuerte();\n moverItemRayo();\n /*\n IMPLEMENTAR\n\n //moverPajaro();\n //etc\n */\n }", "public void merge(WModelObject otherObject)\n\t{\n\t\tWCollection collection = null;\n\n\t\t// Check to see if the argument is a WCollection object\n\t\ttry\n\t\t{\n\t\t\tcollection = (WCollection)otherObject;\n\t\t}\n\t\tcatch (ClassCastException exc)\n\t\t{\n\t\t\tcom.ing.connector.Registrar.logError(getClass().getName() + \": Collection objects can only be merged with other Collection objects\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Check to see if the two objects are of the same class\n\t\tClass thisClass = getClass();\n\t\tClass objClass = otherObject.getClass();\n\n\t\tif (thisClass.getName().compareTo(objClass.getName()) != 0)\n\t\t{\n\t\t\tcom.ing.connector.Registrar.logError(thisClass.getName() + \": Cannot compare two different collection objects\");\n\t\t\treturn;\n\t\t}\n\n\t\tWCollection primCollection = new WCollection(thisClass.getName());\t//JFG6.0\n\n\t\tint iObjectCount = this.size();\t\t\t\t\t\t\t//JFG6.0\n\t\tcom.ing.connector.Registrar.logDebugMessage(\"prim object size = \" + iObjectCount);\n\t\tfor (int iCount = 0; iCount < iObjectCount; ++iCount)\t\t\t\t//JFG6.0\n\t\t{\n\t\t\tprimCollection.addElement(this.elementAt(iCount));\t\t\t//JFG6.0\n\t\t\t//com.ing.connector.Registrar.logDebugMessage(\"Entering inside()\");\n\t\t}\n\n primCollection.sort(\"ClassKey\",true);\t\t\t\t\t\t//JFG6.0\n collection.sort(\"ClassKey\",true);\t\t\t\t\t\t\t//JFG6.0\n\n\t\tint iSecObjectCount = collection.size();\n int iStart = 0;\t\t\t\t\t\t\t\t\t\t//JFG6.0\n com.ing.connector.Registrar.logDebugMessage(\"Sec object size = \" + iSecObjectCount);\n\t\tfor (int iSecCount = 0; iSecCount < iSecObjectCount; ++iSecCount)\n\t\t{\n\t\t WModelObject secObject = null;\n\t\t WModelObject primObject = null;\n\n\t\t secObject = collection.elementAt(iSecCount);\n\t\t boolean keyFound = false;\n\n\t\t int iPrimObjectCount = primCollection.size();\n\t\t for (int iPrimCount = iStart; iPrimCount < iPrimObjectCount; ++iPrimCount)\n\t\t {\n\t\t primObject = primCollection.elementAt(iPrimCount);\n\n int iCompare = primObject.compareTo(secObject, \"ClassKey\");\n //com.ing.connector.Registrar.logDebugMessage(\"primObject.compareTo iCompare = \" + iCompare);\n \n\t\t if (iCompare == 0)\n\t\t {\n\t\t\tkeyFound = true;\n\t\t\tcom.ing.connector.Registrar.logDebugMessage(\"prim object and sec object are equal class \" + primObject.getClass().getName());\n\t\t\tprimObject.merge(secObject);\t//LPMO264\n iStart = iPrimCount + 1;\t\t\t\t\t\t\t//JFG6.0\n \n\t\t\tbreak;\n\t\t }\n else\t\t\t\t\t\t\t\t\t\t\t//JFG6.0\n {\n\t\t if (iCompare > 0)\t\t\t\t\t\t\t\t\t//JFG6.0\n\t\t {\n\t\t\t keyFound = false;\t\t\t\t\t\t\t\t//JFG6.0\n iStart = iPrimCount;\t\t\t\t\t\t\t\t//JFG6.0\n \n\t\t break;\t\t\t\t\t\t\t\t\t\t//JFG6.0\n\n }\n }\n\t\t }\n\t\t \n\t\t //com.ing.connector.Registrar.logDebugMessage(\"is keyFound \" + keyFound);\n\t\t if (!keyFound)\n\t\t {\n\t\t addElement(secObject);\n\t\t }\n\t\t}\n\n\t\tprimCollection = null;\t\t\t\t\t\t\t\t\t//JFG6.0\n\n//\t\tint iObjectCount = collection.size();\n//\t\tfor (int iCount = 0; iCount < iObjectCount; ++iCount)\n//\t\t{\n//\t\t\taddElement(collection.elementAt(iCount));\n//\t\t}\n\t}", "public void updateUniversidades() {\n\t\t\n\t\tlistaUniversidades = (ArrayList<Universidades>)hibernateController.selectUniversidades();\n\t}", "private static <T> void cloneCollection(Collection<T> originalCollection, Collection<T> clonedCollection, PropertyFilter propertyFilter) {\n\t\tJpaCloner jpaCloner = new JpaCloner(propertyFilter);\n\t\tSet<Object> exploredEntities = new HashSet<Object>();\n\t\tfor (T root : originalCollection) {\n\t\t\tclonedCollection.add(clone(root, jpaCloner, exploredEntities));\n\t\t}\n\t}", "@Override\n\tpublic void posModify() {\n\t\tgetEntityManager().refresh(instance);\n\t\tcambiarTipoCuenta(instance);\n\t\tgetEntityManager().flush();\n\t\tgetEntityManager().refresh(instance);\n\t\tresultList = null;\n\t\trootNode = null;\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic Iterable<ObjetoDelJuego> getObjetosDelMapa() {\n\t\t\n\t\t// Pido al mapa los objetos que no sean enemigos, y le agrego los enemigos que guarda el nivel\n\t\tArrayList<ObjetoDelJuego> it = new ArrayList<ObjetoDelJuego>();\t\n\t\tit = (ArrayList<ObjetoDelJuego>) mapa.getGameObjects().clone();\n\t\tArrayList<Enemigo> clon = (ArrayList<Enemigo>) listaDeEnemigos.clone();\n\t\tit.addAll(clon);\n\t\t\n\t\treturn it;\n\t}", "public void setTheObjects(List newTheObjects) {\r\n theObjects = newTheObjects;\r\n }", "public void edit(List<InsertObject> inserts);", "public static void main(String[] args) {\n\t\tCollection c=new ArrayList();\n\t\t\n\t\tc.add(23);\n\t\tc.add(34);\n\t\t\n\t\tCollection c1=new ArrayList();\n\t\t\n\tc1.add(45);\n\tc1.add(67);\n\t\n\tc.addAll(c1);\n\tSystem.out.println(c);\n\t\n\t\n\tCollection c2=new ArrayList();\n\tc2.add(12);\n\tc2.add(23);\n\tc2.add(25);\n\t\n\tCollection c3=new ArrayList();\n\tc3.add(34);\n\tc3.add(45);\n\tc3.add(25);\n\tc3.add(25);\n\t\n\tc2.addAll(c3);\n\t\n\tSystem.out.println(c2);\n\tSystem.out.println(\"-------------------\");\n\t\n\t\n\tc2.removeAll(c3);\n\tSystem.out.println(c2);\n\t\n\tSystem.out.println(\"-------------------\");\n\tCollection c4=new ArrayList();\n\tc4.add(25);\n\tc4.add(23);\n\tc4.add(86);\n\tc4.add(98);\n\t\n\t\n\t\n\tCollection c5=new ArrayList();\n\tc5.add(25);\n\tc5.add(23);\n\tc5.add(12);\n\tc5.add(13);\n\t\n\tc4.retainAll(c5);\n\tSystem.out.println(c4);\n\t\n\tSystem.out.println(\"-------------------\");\n\t\n\tCollection c6=new ArrayList();\n\tc6.add(12);\n\tc6.add(23);\n\t\n\tObject a[]= c6.toArray();\n\tfor(int i=0;i < a.length ; i++)\n\t{\n\t\tSystem.out.println(a[i]);\n\t}\n\t\n\t\n\t\n\t\n\t\n\t\n\n\t\n\t\n\tc4.clear();\n\tSystem.out.println(c4);\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t}", "public void setCamino(ArrayList<Posicion> camino)\n{\n m_camino = camino;\n}", "public Collection<V> remove(Object obj) {\n Collection collection = (Collection) this.Pu.remove(obj);\n if (collection == null) {\n return null;\n }\n Collection<V> ry = AbstractMapBasedMultimap.this.ry();\n ry.addAll(collection);\n AbstractMapBasedMultimap.this.Ps = AbstractMapBasedMultimap.this.Ps - collection.size();\n collection.clear();\n return ry;\n }", "public void update(){\r\n\t\tList<Point> list = new ArrayList<Point>();\r\n\t\t\r\n\t\tlist.addAll(Arrays.asList(points));\r\n\t\t\r\n\t\tsetPoints(list);\r\n\t}", "public void updateList() \n { \n model.clear();\n for(int i = ScholarshipTask.repository.data.size() - 1; i >= 0; i--) \n {\n model.addElement(ScholarshipTask.repository.data.get(i));\n }\n }", "@Override\r\n\tpublic boolean updateTable() {\r\n\t\t/*\r\n\t\t * VERSION 1\r\n\t\t *\r\n\t\tobjectCollection.clear();\r\n\t\tobjectCollection.addAll(retrieveObjects());\r\n\t\trefreshTable();*/\r\n\t\tlong size=objectCollection.size();\r\n\t\tobjectCollection.clear();\r\n\t\tint index=getSelectionIndex();\r\n\t\tupdateTable(SWT.DEFAULT);\r\n\t\tselectElement(index);\r\n\t\treturn objectCollection.size()!=size;\r\n\t}", "public void reloadTableEmpleado() {\n\n this.removeAllData();// borramos toda la data \n for (int i = 0; i < (listae.size()); i++) { // este for va de la primera casilla hast ael largo del arreglo \n Empleado object = listae.get(i);\n this.AddtoTableEmpleado(object);\n }\n\n }", "private List<Object> serializeActualCollectionMembers(AbstractPersistentCollection collection)\r\n\t{\r\n\t\tList<Object> result = new ArrayList<Object>();\r\n\t\tif (!collection.wasInitialized())\r\n\t\t{\r\n\t\t\tcollection.forceInitialization();\r\n\t\t}\r\n\t\tIterator<Object> itr = collection.entries(null);\r\n\t\twhile (itr.hasNext())\r\n\t\t{\r\n\t\t\tObject next = itr.next();\r\n\t\t\tObject newObj = serialize(next);\r\n\t\t\tresult.add(newObj);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "void setCopiaelettronicaCollection(Collection<Copiaelettronica> copiaelettronicaCollection);", "public void indexCollectionWasUpdated(Iterable<? extends V> objectsRemoved, Iterable<? extends V> objectsAdded) {\n if (objectsRemoved != null) {\n objectsRemoved.forEach(v -> cache.remove(cacheKeyMaker.makeKey(v), v));\n }\n if (objectsAdded != null) {\n objectsAdded.forEach(v -> cache.put(cacheKeyMaker.makeKey(v), v));\n }\n }", "public ArrayList<Messier> getModifiedMessierObjects()\n\t{\n\t\treturn messierList;\n\t}", "public void reloadTableCliente() {\n\n this.removeAllData();// borramos toda la data \n for (int i = 0; i < (lista.size()); i++) { // este for va de la primera casilla hast ael largo del arreglo \n Cliente object = lista.get(i);\n this.AddtoTableCliente(object);\n }\n\n }", "private void updateObjects(final Set<Object> objectsToUpdate, \n final Set<Object> objectsToRemove)\n throws CvqException {\n \n for (Object object : objectsToUpdate) {\n logger.debug(\"updateObjects() Updating \" + object);\n \n // only for children because new adults are written when calling\n // modify method (because we need their login and pwd)\n // FIXME REFACTORING : validate this \n if (object instanceof Child) {\n Child child = (Child) object;\n individualService.assignLogin(child);\n }\n }\n \n for (Object object : objectsToRemove) {\n logger.debug(\"updateObjects() Removing \" + object);\n genericDAO.delete(object);\n }\n }", "public void updateResidencias() {\n\n\t\tArrayList<Residencias> list = (ArrayList<Residencias>) hibernateController.selectResidencias();\n\t\tArrayList<ResidenciaBean> listBean = new ArrayList<ResidenciaBean>();\n\n\t\tfor (Residencias r : list) {\n\t\t\tlistBean.add(new ResidenciaBean(r));\n\t\t}\n\n\t\tObservableList<ResidenciaBean> ObsUniversidades = FXCollections.observableArrayList(listBean);\n\t\ttable.setItems(ObsUniversidades);\t\t\n\n\t}", "protected void refreshFromRepository() {\n\t\t\r\n\t\tObject[] elements = new Object[]{};\r\n\t\tmodelObject.eContainer();\r\n\t\t\r\n\t\tif (fFilteredList != null) {\r\n\t\t\t\r\n\t\t\tfFilteredList.setAllowDuplicates(showDuplicates);\r\n\t\t\tfFilteredList.setElements(elements);\r\n\t\t\tfFilteredList.setEnabled(true);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif (fTreeViewer != null) {\r\n\t\t\tfTreeViewer.setInput(null);\r\n\t\t}\t\t\r\n\t}", "private void moverCarroLujo() {\n for (Auto auto : arrEnemigosAuto) {\n auto.render(batch);\n\n auto.moverIzquierda();\n }\n }", "@Test\n public void testSubList_SubList_Item_Update_idempotent() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n Collection c = Arrays.asList(1, 1, 7, 7, 1, 1, 1);\n instance.addAll(c);\n\n List<Integer> expResult = Arrays.asList(1, 7, 7);\n SegmentedOasisList<Integer> result = (SegmentedOasisList<Integer>) instance.subList(1, 4);\n\n instance.set(3, 8);\n\n assertTrue(isEqual(expResult, result));\n\n }", "public void updateAttributeRemoveObjectFromCollection(String attributeName, Object mapKey, Object value) {\n DatabaseMapping mapping = this.query.getDescriptor().getMappingForAttributeName(attributeName);\n if (mapping == null) {\n throw DescriptorException.mappingForAttributeIsMissing(attributeName, getDescriptor());\n }\n\n Object clone = this.getObject();\n Object cloneValue = value;\n Object original = null;\n\n //only set the original object if we need to update it, ie before the merge takes place\n if ((this.eventCode == DescriptorEventManager.PostCloneEvent) || (this.eventCode == DescriptorEventManager.PostMergeEvent)) {\n original = this.getOriginalObject();\n }\n Object originalValue = value;\n ObjectChangeSet eventChangeSet = this.getChangeSet();\n Object valueForChangeSet = value;\n\n if ((this.query != null) && this.query.isObjectLevelModifyQuery()) {\n clone = ((ObjectLevelModifyQuery)this.query).getObject();\n eventChangeSet = ((ObjectLevelModifyQuery)this.query).getObjectChangeSet();\n }\n ClassDescriptor descriptor = getSession().getDescriptor(value.getClass());\n\n if (descriptor != null) {\n //There is a descriptor for the value being passed in so we must be carefull\n // to convert the value before assigning it.\n if (eventChangeSet != null) {\n valueForChangeSet = descriptor.getObjectBuilder().createObjectChangeSet(value, (UnitOfWorkChangeSet)eventChangeSet.getUOWChangeSet(), getSession());\n }\n if (original != null) {\n // must be a unitOfWork because only the postMerge, and postClone events set this attribute\n originalValue = ((UnitOfWorkImpl)getSession()).getOriginalVersionOfObject(value);\n }\n }\n if (clone != null) {\n Object collection = mapping.getRealCollectionAttributeValueFromObject(clone, getSession());\n mapping.getContainerPolicy().removeFrom(mapKey, cloneValue, collection, getSession());\n }\n if (original != null) {\n Object collection = mapping.getRealCollectionAttributeValueFromObject(original, getSession());\n mapping.getContainerPolicy().removeFrom(mapKey, originalValue, collection, getSession());\n }\n if (getRecord() != null) {\n AbstractRecord tempRow = getDescriptor().getObjectBuilder().createRecord();\n\n // pass in temp Row because most mappings use row.add() not row.put() for\n // perf reasons. We are using writeFromObjectIntoRow in order to support\n // a large number of types.\n mapping.writeFromObjectIntoRow(clone, tempRow, getSession());\n ((AbstractRecord)getRecord()).mergeFrom(tempRow);\n }\n if (eventChangeSet != null) {\n mapping.simpleRemoveFromCollectionChangeRecord(mapKey, valueForChangeSet, eventChangeSet, getSession());\n }\n }", "@Override\n\tpublic void delObservateur() {\n\t\tthis.listObservateur = new ArrayList<Observateur>();\n\t}", "public void afficherPoints(){\n for(Point point : pointArrayList){\n getMapPane().getChildren().add(point.getImageView());\n visualObjects.add(point);\n }\n }", "public void reloadTable() {\n\n this.removeAllData();// borramos toda la data \n for (int i = 0; i < (list.size()); i++) { // este for va de la primera casilla hast ael largo del arreglo \n Balanza object = list.get(i);\n this.AddtoTable(object);\n }\n\n }", "@Override\n\tpublic void modifyItem(Object toUpdated) {}", "protected Object undoCollection(Object potentialCollection, Object otherObject) {\n if ((otherObject != null) && (potentialCollection instanceof Collection) &&\n !(otherObject instanceof Collection)) {\n if ((((Collection<?>) potentialCollection).size() == 1) && ((Collection) potentialCollection).iterator()\n .next().getClass().equals(otherObject.getClass())) {\n potentialCollection = ((Collection) potentialCollection).iterator().next();\n }\n }\n return potentialCollection;\n }", "public void testTypedCollection()\r\n\t{\r\n broker.beginTransaction();\r\n for (int i = 1; i < 4; i++)\r\n {\r\n ProductGroupWithTypedCollection example = new ProductGroupWithTypedCollection();\r\n example.setId(i);\r\n ProductGroupWithTypedCollection group =\r\n (ProductGroupWithTypedCollection) broker.getObjectByQuery(\r\n new QueryByIdentity(example));\r\n assertEquals(\"should be equal\", i, group.getId());\r\n //System.out.println(group + \"\\n\\n\");\r\n\r\n broker.delete(group);\r\n broker.store(group);\r\n }\r\n broker.commitTransaction();\r\n\t}", "private void updatePolygons() {\n for ( Polygon p : polygons ) {\n p.update();\n }\n }", "public void deleteNonSerializableObjects() {\n \n ArrayList<VisualObject> delList = new ArrayList<VisualObject>();\n \n for (CanvasWindow w : this) {\n \n if (w instanceof VisualObject) {\n VisualObject o = (VisualObject) w;\n \n VisualCanvas mainCanvas = (VisualCanvas) getMainCanvas();\n \n int inspectorID = o.getObjectRepresentation().getObjectID();\n \n Object result = mainCanvas.getInspector().getObject(inspectorID);\n \n if (!(result instanceof Serializable)) {\n delList.add(o);\n } else {\n String value = Base64.encodeObject((Serializable) result);\n if (value == null) {\n delList.add(o);\n }\n }\n }\n }\n \n for (VisualObject vObj : delList) {\n \n if (vObj == null) {\n getMainCanvas().getMessageBox().addMessage(\n \"Error: object does not exist\",\n \"Error: null obj in visual-object-list\",\n MessageType.ERROR);\n continue;\n }\n \n VisualCanvas canvas = (VisualCanvas) getMainCanvas();\n \n Object o = canvas.getInspector().\n getObject(vObj.getObjectRepresentation().getObjectID());\n \n removeObjectWithoutEffect(vObj.getID());\n \n if (o == null) {\n getMainCanvas().getMessageBox().addMessage(\n \"Error: object does not exist\",\n \"Error: object with id \"\n + vObj.getObjectRepresentation().getObjectID()\n + \" is null!\",\n MessageType.ERROR);\n \n System.err.println(\"Error: object with id \"\n + vObj.getObjectRepresentation().getObjectID()\n + \" is null!\");\n \n continue;\n }\n \n if (!(o instanceof IgnoreNotSerializableWarnings)\n && !ComponentUtil.isSerializationEnabled(o.getClass())) {\n \n getMainCanvas().getMessageBox().addMessage(\n \"Warning: Can't save some objects\",\n \"Some objects are not serializable and had to be\"\n + \" removed.<br><br> <p>Please ensure that all \"\n + \"objects implement the <b><i>Serializable</i></b> \"\n + \"interface and that properties don't prevent\"\n + \" serialization. \"\n + \"Use <b><i>transient</i></b> in this case.<p>\"\n + \"Classes added from shell cannot be deserialized\"\n + \" because source code definition is not available.\"\n + \"This can be fixed by adding a new \"\n + \"<b><i>AbstractCode</i></b> to the canvas before\"\n + \"saving the session.\",\n MessageType.WARNING);\n }\n }\n }", "public GameObjectCollection() {\n\t\tgameObjects = new Vector<GameObject>();\n\t}", "private void changeSet(String type){\n activeList = new ArrayList<>();\n int size = allResultRestaurants.size();\n\n Restaurante aux;\n for(int i = 0; i < size; i++){\n aux = allResultRestaurants.get(i);\n\n if(type.contains(aux.getType())){\n activeList.add(aux);\n }\n }\n\n clear();\n addAll(activeList);\n }", "public void updateAttributeAddObjectToCollection(String attributeName, Object mapKey, Object value) {\n DatabaseMapping mapping = this.query.getDescriptor().getMappingForAttributeName(attributeName);\n if (mapping == null) {\n throw DescriptorException.mappingForAttributeIsMissing(attributeName, getDescriptor());\n }\n\n Object clone = this.getObject();\n Object cloneValue = value;\n Object original = null;\n\n //only set the original object if we need to update it, ie before the merge takes place\n if ((this.eventCode == DescriptorEventManager.PostCloneEvent) || (this.eventCode == DescriptorEventManager.PostMergeEvent)) {\n original = this.getOriginalObject();\n }\n Object originalValue = value;\n ObjectChangeSet eventChangeSet = this.getChangeSet();\n Object valueForChangeSet = value;\n\n if ((this.query != null) && this.query.isObjectLevelModifyQuery()) {\n clone = ((ObjectLevelModifyQuery)this.query).getObject();\n eventChangeSet = ((ObjectLevelModifyQuery)this.query).getObjectChangeSet();\n }\n ClassDescriptor descriptor = getSession().getDescriptor(value.getClass());\n\n if (descriptor != null) {\n //There is a descriptor for the value being passed in so we must be carefull\n // to convert the value before assigning it.\n if (eventChangeSet != null) {\n valueForChangeSet = descriptor.getObjectBuilder().createObjectChangeSet(value, (UnitOfWorkChangeSet)eventChangeSet.getUOWChangeSet(), getSession());\n }\n if (original != null) {\n // must be a unitOfWork because only the postMerge, and postClone events set this attribute\n originalValue = ((UnitOfWorkImpl)getSession()).getOriginalVersionOfObject(value);\n }\n }\n\n if (clone != null) {\n Object collection = mapping.getRealCollectionAttributeValueFromObject(clone, getSession());\n mapping.getContainerPolicy().addInto(mapKey, cloneValue, collection, getSession());\n }\n if (original != null) {\n Object collection = mapping.getRealCollectionAttributeValueFromObject(original, getSession());\n mapping.getContainerPolicy().addInto(mapKey, originalValue, collection, getSession());\n }\n if (getRecord() != null) {\n AbstractRecord tempRow = getDescriptor().getObjectBuilder().createRecord();\n\n // pass in temp Row because most mappings use row.add() not row.put() for\n // perf reasons. We are using writeFromObjectIntoRow in order to support\n // a large number of types.\n mapping.writeFromObjectIntoRow(clone, tempRow, getSession());\n ((AbstractRecord)getRecord()).mergeFrom(tempRow);\n }\n if (eventChangeSet != null) {\n mapping.simpleAddToCollectionChangeRecord(mapKey, valueForChangeSet, eventChangeSet, getSession());\n }\n }", "@Test\n public void testSet() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n Collection c = Arrays.asList(1, 1, 7, 1, 1, 1, 1);\n instance.addAll(c);\n Integer expResult = 7;\n Integer result = instance.set(2, 9);\n assertEquals(expResult, result);\n\n }", "public void transformandoObjectsToView() {\n //Transformacion a objetos de interfaz\n this.studyView = ConverterDTOtoDomain.getStudy(this.study);\n\n for (Factor factorStudy : this.factorsDtoStudy) {\n // exluded hardcoded study conditions\n if (!\"STUDY\".equals(factorStudy.getFname())){\n this.studyConditions.add(\n ConverterDTOtoDomain.getCondition(\n factorStudy,\n this.mapaLabes));\n }\n }\n for (Factor factorTrial : this.factorsDtoTrial) {\n this.conditions.add(\n ConverterDTOtoDomain.getCondition(\n factorTrial,\n this.mapaLabes));\n }\n for (Factor factorDtoView : this.factorsDtoAllFactorsView) {\n this.factorsView.add(\n ConverterDTOtoDomain.getFactor(\n factorDtoView,\n this.mapaLabes));\n }\n }", "private void garbageColl(){\n\t\tfor(Page p: pageList){\n\t\t\tp.garbageColl();\n\t\t}\n\t\tpageIndex = 0;\n\t}", "void refreshEntities(Collection<Entity> entities);", "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 void iterateUpdate()\n\t{\n\t\tSystem.out.println(\"ITERATE\");\n\t\t\t\n\t\tfor (Organism org : simState.getOrganisms()) \n\t\t{\n\t\t\torganismViewData.resetOrganismView(org);\n\t\t}\n\t\t\n\t\tIterationResult result = simEngine.iterate();\n\t\t\n\t\t// Process born and dead organisms\n\t\taddBornModels(result.getBorn());\n\t\tremoveDeadModels(result.getLastDead());\n\t\t\n\t\trotateAnimals();\t\t\n\t}", "@Override\n\tpublic Cours updateCours(Cours cours) {\n\t\tSystem.out.println(\"-------------->\"+cours.getEtudiants().size());\n\n\t\tfor (Etudiant et : cours.getEtudiants()) {\n\t\t\tSystem.out.println(\"-- : \"+et.getNom());\n\t\t}\n\t\tem.merge(cours);\n\t\treturn cours;\n\t}", "@Override\n\tpublic void update(Object entidade) {\n\t\t\n\t}", "protected abstract Collection createCollection();", "public void oppdaterJliste()\n {\n bModel.clear();\n\n Iterator<Boligsoker> iterator = register.getBoligsokere().iterator();\n\n while(iterator.hasNext())\n bModel.addElement(iterator.next());\n }", "public void updateFakeEntities() { \n for(ViewableEntity playerEntity : replicatedEntites.values()) {\n playerEntity.update();\n }\n }", "public abstract void setTecnico_peticion(\n\t\tjava.util.Collection aTecnico_peticion);", "public void updateList(List<?> listOfObjects){\n this.radioObjects = listOfObjects;\n }", "private void moverCarritoGolf() {\n for (AutoGolf carrito : arrEnemigosCarritoGolf) {\n carrito.render(batch);\n\n carrito.moverIzquierda();\n }\n }", "@Override\n\tpublic long insertObjs(Collection<T> t) {\n\t\treturn insertObjs(false, t);\n\t}", "public static void cleanNonSerializables(Collection c) {\n\t\tIterator it = c.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tObject o = it.next();\n\t\t\t\n\t\t\tClass objClass = o.getClass();\n\t\t\tif (shouldRemove(o)) {\n\t\t\t\tit.remove();\n\t\t\t\tlogger.info(\"Remove obj: \" + o);\n\t\t\t}\n\t\t\t\n\t\t\t/*if (blackObjects.contains(o.getClass())) {\n\t\t\tit.remove();\n\t\t} else if (!attemptSerialization(o)) {\n\t\t\tblackObjects.add(o.getClass());\n\t\t\tlogger.info(\"Remove non-serializable obj: \" + o);\n\t\t\t\n\t\t\tit.remove();\n\t\t}*/\n\t\t}\n\t}", "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 }", "public void setTodo(java.util.Collection aTodo);", "public void vincula(){\n for (Nodo n : exps)\n n.vincula();\n }", "public void dependencyUpdateVal(Set updatingObjects);", "public void svuotaCaselle() {\n for (CasellaGraphic casella : listaCaselle) {\n casella.getPedine().getChildren().clear();\n }\n }", "@Test\n public void testAddAll_int_Collection_Order() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n\n Collection c = Arrays.asList(1, 2, 3);\n instance.addAll(1, c);\n\n List expResult = Arrays.asList(3, 1, 2, 3, 2);\n\n for (int i = 0; i < expResult.size(); i++) {\n assertEquals(expResult.get(i), instance.get(i));\n }\n }", "public void removeAllPartOfSet() {\r\n\t\tBase.removeAll(this.model, this.getResource(), PARTOFSET);\r\n\t}", "public void enleverlaDerniereObs() {\n\n\t\tobstaclesList.remove(obstaclesList.size()-1);\n\t}", "private void updateList() {\n Model.instace.getAllArticles(new ArticleFirebase.GetAllArticlesAndObserveCallback() {\n @Override\n public void onComplete(List<Article> list) {\n data.clear();\n data = list;\n adapter.notifyDataSetChanged();\n }\n\n @Override\n public void onCancel() {\n\n }\n });\n }", "@Override\n\tpublic void operation() {\n\t\tfor(Object object:list) {\n\t\t\t((Component)object).operation();\n\t\t}\n\t}", "public void update(Observable o, Object arg) {\n listaDeportes = (ListaDeportes) arg;\n }" ]
[ "0.60899", "0.6041123", "0.5847127", "0.5821891", "0.5814912", "0.5776313", "0.5769907", "0.5694286", "0.5682128", "0.56672215", "0.56573004", "0.5626837", "0.5621934", "0.5610463", "0.5606564", "0.5598287", "0.5593051", "0.5577678", "0.5575545", "0.5567408", "0.55516887", "0.5526762", "0.55072075", "0.5459464", "0.5456492", "0.54472834", "0.5425523", "0.5423365", "0.54219484", "0.5412613", "0.54107887", "0.54024184", "0.5394376", "0.5390468", "0.53890556", "0.53870404", "0.53819203", "0.5377909", "0.53777784", "0.5376656", "0.5365567", "0.5358011", "0.5352882", "0.534588", "0.5336608", "0.53327817", "0.53272873", "0.5316849", "0.5310565", "0.53036004", "0.529831", "0.52826726", "0.5282469", "0.5280042", "0.5278022", "0.52573735", "0.5256583", "0.5250537", "0.5244225", "0.52423584", "0.52406836", "0.5230988", "0.52296454", "0.52209145", "0.52193636", "0.52165794", "0.5213287", "0.52132136", "0.5212178", "0.5181895", "0.5172758", "0.51717746", "0.5170936", "0.5163752", "0.51599324", "0.5158276", "0.5157326", "0.5151022", "0.51506984", "0.514927", "0.51464826", "0.51433975", "0.51394117", "0.51362294", "0.51337916", "0.51266205", "0.5125947", "0.51164985", "0.51158094", "0.5112493", "0.5111812", "0.51073736", "0.5104804", "0.5100517", "0.5099904", "0.50982535", "0.50901777", "0.50876063", "0.5087524", "0.5087315", "0.5084833" ]
0.0
-1
public T getFromId(U id) throws DaoException ;
public T getFromId(U id, Class<T> clazz) throws DaoException ;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "T getById(int id);", "T get(PK id);", "T getById(ID id);", "T get(Integer id);", "T getById(PK id);", "T get(ID id);", "T getById(Long id);", "T getbyId(I id);", "T queryForId(ID id) throws SQLException, DaoException;", "public T get( final int id )\n\t{\n\t\treturn this.dao.findById( id ).get();\n\t}", "public abstract T byId(ID id);", "E getById(long id);", "T findById(ID id) ;", "@Override\n public T findById(ID id) throws SQLException {\n\n return this.dao.queryForId(id);\n\n }", "T findById(Integer id);", "@Override\n\tpublic T get(ID id) {\n\t\tOptional<T> obj = getDao().findById(id);\n\t\tif (obj.isPresent()) {\n\t\t\treturn obj.get();\n\t\t}\t\t\n\t\treturn null;\n\t}", "public T findById(int id) {\n\t\tConnection connection = null;\n\t\tPreparedStatement st = null;\n\t\tResultSet rs = null;\n\t\tString query = createSelectQuery(\"id\");\n\t\ttry {\n\t\t\tconnection = ConnectionFactory.createCon();\n\t\t\tst = connection.prepareStatement(query);\n\t\t\tst.setInt(1, id);\n\t\t\trs = st.executeQuery();\n\t\t\t\n\t\t\treturn createObjects(rs).get(0);\n\t\t}catch(SQLException e) {\n\t\t\tLOGGER.fine(type.getName() + \"DAO:findBy\" + e.getMessage());\n\t\t}\n\t\treturn null;\n\t}", "D getById(K id);", "public T getByID(int id) {\n\t\treturn this.data.get(id);\n\t}", "@Override\n\t@Transactional\n\tpublic T getById(Integer id) {\n\t\tif (id == null) {\n\t\t\treturn null;\n\t\t}\n\t\tObject result = hibernateTemplate.getSessionFactory().getCurrentSession()\n\t\t\t\t.createCriteria(getGenericClass())\n\t\t\t\t.add(Restrictions.idEq(id))\n\t\t\t\t.uniqueResult();\n\t\treturn initialize(checkType(result));\n\t}", "public T from_id(int id) {\n\t\ttry {\n\t\t\treturn first(id_name(), new Integer(id));\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "Object get(ID id) throws Exception;", "M getById(Serializable id) throws DataAccessException;", "public T findById(int id)\n {\n Connection connection = null;\n PreparedStatement statement = null;\n ResultSet resultSet = null;\n String query = createSelectQuery(\"id\");\n try\n {\n connection = ConnectionFactory.getConnection();\n statement = connection.prepareStatement(query);\n statement.setInt(1,id);\n resultSet = statement.executeQuery();\n\n return createObjects(resultSet).get(0);\n }catch (SQLException e)\n {\n LOGGER.log(Level.WARNING,type.getName() + \"DAO:findById\"+ e.getMessage());\n }finally {\n ConnectionFactory.close(resultSet);\n ConnectionFactory.close(statement);\n ConnectionFactory.close(connection);\n }\n return null;\n }", "@Override\n\tpublic T getById(long id) {\n\t\treturn null;\n\t}", "public o selectById(long id);", "@SuppressWarnings(\"unchecked\")\n\tprotected <ID extends Serializable> T get(ID id) {\n\t\tT retValue = null;\n\t\tSession session = null;\n\t\ttry {\n\t\t\tsession = mDbHelper.beginTransaction();\n\t\t\tretValue = (T) session.get(mClazz, id);\n\t\t\tmDbHelper.endTransaction(session);\n\t\t} catch (Exception e) {\n\t\t\tmDbHelper.cancelTransaction(session);\n\t\t\tAppLogger.error(e, \"Failed to execute get by id\");\n\t\t}\n\n\t\treturn retValue;\n\t}", "public TEntity getById(int id){\n String whereClause = String.format(\"Id = %1$s\", id);\n Cursor cursor = db.query(tableName, columns, whereClause, null, null, null, null);\n\n if (cursor.getCount() == 1) {\n cursor.moveToFirst();\n return fromCursor(cursor);\n }\n return null;\n }", "T load(PK id);", "public Data findById(Object id);", "public T get(ID id) {\n\t\treturn (T) sessionFactory.getCurrentSession().get(clazz, id);\n\t}", "T findById(long pk);", "@SuppressWarnings(\"unchecked\")\n\tpublic T get(Long id) {\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\t\n\t\treturn (T) session.get(target, id);\n\t}", "O obtener(PK id) throws DAOException;", "public T find(int id) {\n\t \treturn getEntityManager().find(getEntityClass(), id);\n\t }", "public abstract T findOne(int id);", "T findOne(I id);", "public T get(int id) {\n return this.session.get(this.type, id);\n }", "public Etudiant getById(int id) {\n\t\treturn dao.getById(id);\r\n\t}", "@Override\n @SuppressWarnings(\"unchecked\")\n public T findById(ID id) {\n return (T) this.getSession().load(this.getPersistentClass(), id);\n }", "public abstract T findByID(ID id) ;", "@SuppressWarnings(\"unchecked\")\r\n\tpublic T findOne(final int id) {\r\n\t\tEntityManager manager = factory.createEntityManager();\r\n\t\tEntityTransaction transaction = manager.getTransaction();\r\n\t Object obj = null;\r\n\t \r\n\t try {\r\n\t \t transaction.begin();\r\n\t obj = (T) manager.find(genericClass, id);\r\n\t transaction.commit();\r\n\t } catch (HibernateException e) {\r\n\t \t if(transaction != null)\r\n\t \t\t transaction.rollback();\r\n\t e.printStackTrace(); \r\n\t } finally {\r\n\t manager.close(); \r\n\t }\r\n\t\treturn (T) obj;\r\n\t}", "T findOne(Long id);", "@Override\r\n\tpublic UserAccount get(int id) {\n\t\tConnection con = MysqlDatabase.getInstance().getConnection();\r\n\t\tUserAccount ua = null;\r\n\t\ttry {\r\n\t\t\tPreparedStatement ps = con.prepareStatement(GetById);\r\n\t\t\tps.setInt(1, id);\r\n\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\tif (rs.next()) {\r\n\t\t\t\tua = generate(rs);\r\n\t\t\t}\r\n\t\t\tcon.close();\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\t\treturn ua;\r\n\t}", "@SuppressWarnings(\"unchecked\")\n public T retrieveById(Id id) throws EntityNotFoundException, DAOException {\n if (id == null) {\n throw new IllegalArgumentException(\"'id' should not be null.\");\n }\n if ((id instanceof Long) && ((Long) id) <= 0) {\n throw new IllegalArgumentException(\"'id' should not be <= 0.\");\n }\n Helper.checkEntityManager(entityManager);\n\n String queryString = \"select e from \"\n + entityBeanType.getCanonicalName()\n + \" e where e.id = :id and (e.deleted is null or e.deleted = false)\";\n Query query = entityManager.createQuery(queryString);\n query.setParameter(\"id\", id);\n\n // Involves an unchecked conversion:\n try {\n return (T) query.getSingleResult();\n } catch (NoResultException e) {\n throw new EntityNotFoundException(\"Cannot find entity with id:\"\n + id + \".\", e);\n } catch (Exception e) {\n throw new DAOException(\"Failed to get entity.\", e);\n }\n }", "T readOne(int id);", "public abstract T findEntityById(int id);", "User selectByPrimaryKey(String id);", "EtpBase selectByPrimaryKey(String id);", "public T get(int objectId) throws SQLException;", "@Override\n\tpublic T getEntryById(Serializable id) {\n\t\treturn (T) this.hibernateTemplate.get(this.classt, id);\n\t}", "@Override\r\n\tpublic T findById(Long id) {\n\t\tif(id==null)\r\n\t\t\treturn null;\r\n\t\treturn (T) getSession().get(clazz, id);\r\n\t}", "@Override\n public User get(int id) {\n\n String sqlGet = sqlQuery + \" where u.id=:id\";\n //Этот класс предназначен для передачи в простой Map значений параметров методам NamedParameterJdbcTemplate класса.\n MapSqlParameterSource parameterSource = new MapSqlParameterSource()\n .addValue(\"id\",id);\n List<User> list = namedParameterJdbcTemplate.query(sqlGet,parameterSource, new UserRowMapper());\n\n return DataAccessUtils.singleResult(list);//Возвращает один объект результата из данной коллекции.\n }", "@Override\n public Result readById(final int id) throws DaoException {\n throw new DaoException(\"Unsupported operation. Result has no id\");\n }", "@Override\n\tpublic T findById(ID id) {\n\t\treturn parserEntity(this.getConcreteDAO().findById(id));\n\t}", "Factory selectByPrimaryKey(Long id);", "protected abstract T getEntityById(Long id);", "T getByPk(int key) throws PersistException;", "Clazz selectByPrimaryKey(Integer id);", "UUser selectByPrimaryKey(Integer id);", "@Override\r\n\tpublic Etudiant GetById(int id) throws SQLException {\n\t\treturn null;\r\n\t}", "User selectByPrimaryKey(Integer id);", "User selectByPrimaryKey(Integer id);", "User selectByPrimaryKey(Integer id);", "User selectByPrimaryKey(Integer id);", "User selectByPrimaryKey(Integer id);", "public User read(String id);", "public T findById(final String id)\n\t{\n\t\treturn em.find(entityClass, id);\n\t}", "@Override\n\tpublic T findById(Class<T> entidade, Long id) throws Exception {\n\t\treturn null;\n\t}", "String get(String id);", "@Override\r\n\tpublic User getDocterById(int id) {\n\t\treturn docterMapper.selById(id);\r\n\t}", "Object get(Class<?> clazz, Serializable id) throws HibernateException;", "@Override\n public User findById(long id) {\n return dao.findById(id);\n }", "@Override\n public T findById(Long id) {\n return manager.find(elementClass, id);\n }", "<T> T get(Class<T> entityClass, Serializable id);", "User selectByPrimaryKey(Long id);", "Transaction get(String id) throws Exception;", "SysType selectByPrimaryKey(Integer id);", "HuoDong selectByPrimaryKey(Integer id);", "public T findById(final UUID id) {\n\t\tfinal T result = em.find(persistentClass, id);\n\t\treturn result;\n\t}", "public Transaction getById(String id) throws Exception;", "V get(K id);", "@Override\n\tpublic Object findByIdObject(Class<T> entidade, Long id) throws Exception {\n\t\treturn null;\n\t}", "public User getUserById(Long id) throws Exception;", "@Override\n public E getById(final I id) {\n LOG.info(\"[getById] Start: Id = \" + id);\n LOG.info(\"[getById] End\");\n return entityManager.find(entityClass, id);\n }", "Dormitory selectByPrimaryKey(Integer id);", "public Usuario getByIdUsuario(int id){\r\n Usuario user = new Usuario();\r\n try{\r\n PreparedStatement ps = bd.prepareStatement(SQLR);\r\n ps.setInt(1, id);\r\n ResultSet rs = ps.executeQuery();\r\n if(rs.next()){\r\n user.setId(rs.getInt(\"id\"));\r\n user.setUsuario(rs.getString(\"usuario\"));\r\n user.setNome(rs.getString(\"nome\"));\r\n user.setEmail(rs.getString(\"email\"));\r\n user.setSenha(rs.getString(\"senha\"));\r\n user.setPin(rs.getString(\"pin\"));\r\n user.setUrlfoto(rs.getString(\"urlfoto\"));\r\n user.setAcesso(rs.getTimestamp(\"acesso\"));\r\n user.setAdmin(rs.getInt(\"admin\"));\r\n }\r\n rs.close();\r\n ps.close();\r\n ConexaoBD.fechar(bd);\r\n } catch(SQLException sqle){\r\n System.out.println(\"Erro no getByIdUsuario no DAO: \" + sqle.getMessage());\r\n }\r\n return user;\r\n }", "User get(Key id);", "@Override\r\n\tpublic Code get(int id) {\n\t\treturn this.getHibernateTemplate().get(Code.class, id);\r\n\t}", "User get(int userId) throws UserNotFoundException, SQLException;", "@Override\n public T findById(ID id) {\n return crudRepository.findById(id).orElseThrow(\n () -> new ResourceNotFoundException(\"Can not find an entity with id: \" + id));\n }", "public <T> PersistableDataObject<T> queryById(final Serializable id) {\n PersistableDataObject<T> retVal = txTemplate\n .execute(new TransactionCallback<PersistableDataObject<T>>() {\n @Override\n @SuppressWarnings(\"unchecked\")\n public PersistableDataObject<T> doInTransaction(\n TransactionStatus status) {\n return (PersistableDataObject<T>) getHibernateTemplate()\n .get(daoClass, id);\n }\n });\n return retVal;\n }", "public User fetchById(int id)\n {\n String query = \"SELECT * FROM user WHERE id = ?\";\n RowMapper<User> userRowMapper = new BeanPropertyRowMapper<>(User.class);\n User user; // a specific user that will be returned\n try\n {\n user = template.queryForObject(query, userRowMapper, id); // call the database\n } catch (EmptyResultDataAccessException e)\n {\n user = null; // return a null user\n }\n return user;\n }", "public UserTO getUser (String id);", "@Transactional(propagation = Propagation.REQUIRED, readOnly = true)\n\tpublic <T> T getById(final Class<T> obj, final String id){\n\t\treturn dao.get(obj, id);\n\t}", "AccessModelEntity selectByPrimaryKey(String id);", "UserEntity selectByPrimaryKey(Integer id);", "public Item getByID(Integer id) {\r\n Item item = null;\r\n //Transaction trans = null;\r\n Session session = HibernateUtil.getSessionFactory().openSession();\r\n\r\n try {\r\n //trans = session.beginTransaction();\r\n\r\n item = (Item) session.get(Item.class, id);\r\n\r\n //trans.commit();\r\n } catch (HibernateException e) {\r\n //if (trans != null) { trans.rollback(); }\r\n e.printStackTrace();\r\n } finally {\r\n session.close();\r\n }\r\n return item;\r\n }", "@Override\n public User findById(Integer id) {\n try {\n return runner.query(con.getThreadConnection(),\"select *from user where id=?\",new BeanHandler<User>(User.class),id);\n } catch (SQLException e) {\n System.out.println(\"执行失败\");\n throw new RuntimeException(e);\n }\n }", "Optional<T> getEntityById(ID_TYPE id);" ]
[ "0.8493229", "0.84843236", "0.8435004", "0.83929235", "0.8384984", "0.8310041", "0.8301448", "0.8198754", "0.80903053", "0.7987158", "0.79735297", "0.79240113", "0.79207504", "0.78955483", "0.7854958", "0.7788961", "0.77643836", "0.7748939", "0.7731292", "0.7730835", "0.7660994", "0.76559144", "0.7625916", "0.7622647", "0.76212794", "0.7602665", "0.7598271", "0.7596122", "0.75432646", "0.7540171", "0.753257", "0.7511506", "0.7508554", "0.7495668", "0.7481863", "0.746501", "0.7427688", "0.7425265", "0.74062353", "0.73819596", "0.73793685", "0.73708606", "0.7364091", "0.7322055", "0.73070663", "0.73014086", "0.72960186", "0.7293014", "0.72685355", "0.72677696", "0.7263792", "0.72558427", "0.7255396", "0.72418517", "0.7235366", "0.7231367", "0.7226003", "0.7212398", "0.7201399", "0.7186465", "0.71717274", "0.71609837", "0.71609837", "0.71609837", "0.71609837", "0.71609837", "0.7146691", "0.7143151", "0.7137404", "0.7118708", "0.7118067", "0.7117116", "0.7099325", "0.7095222", "0.7093247", "0.7091154", "0.70887876", "0.70811135", "0.7061484", "0.7049183", "0.7044477", "0.7043613", "0.70279914", "0.7025613", "0.700212", "0.7001498", "0.69999325", "0.6992221", "0.69844604", "0.6975981", "0.69669676", "0.6964354", "0.69638777", "0.69632965", "0.6951786", "0.6943172", "0.6938799", "0.69382185", "0.6933477", "0.69330275" ]
0.85406077
0
timecomplexity o(n), 2 pass
public int[] twoSum2(int[] nums, int target) { int[] res = new int[2]; int n = nums.length; Map<Integer, Integer> map = new HashMap<>(); for (int i = 0; i < n; i++) { map.put(nums[i], i); } for (int i = 0; i < n; i++) { int key = target - nums[i]; if (map.containsKey(key) && map.get(key) != i) { res[0] = i; res[1] = map.get(key); return res; } } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int f2(int N) { \n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n)\n // O(n)`\n for(int j = 0; j < i; j++) \n x++;\n return x;\n }", "public static int f1(int N) {\n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n) \n x++; \n return x; \n \n }", "public static int f5(int N) { \n int x = 0;\n // log(n)\n for(int i = N; i > 0; i = i/2)\n // O(n) + O(n/2) + O(n/4)\n x += f1(i);\n \n return x; \n \n }", "public static int example2(int[] arr) { // O(1)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j += 2) // note the increment of 2 // O(1)\r\n\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Once Again, we have a (for) loop and it runs (n) times and this\r\n\t\t * for loop dominates the runtime.So this is linear time and the answer is O(n).\r\n\t\t * \r\n\t\t */\r\n\t}", "public static int solveEfficient(int n) {\n if (n == 0 || n == 1)\n return 1;\n\n int n1 = 1;\n int n2 = 1;\n int sum = 0;\n\n for (int i = 2; i <= n; i++) {\n sum = n1 + n2;\n n1 = n2;\n n2 = sum;\n }\n return sum;\n }", "static long nPolyNTime(int[] n) {\n int temp = n.length;\n long sum = 0;\n if(n == null || n.length == 0) return -1;\n for(int i = 0; i < n.length; ++i) {\n while(temp --> 0) {\n for(int j = 0; j < n.length; ++j) {\n sum += n[i] + n[j];\n }\n }\n }\n return sum;\n }", "public static void main(String args[] ) throws Exception {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n int[] seqArray = new int[n];\n for (int i = 0; i < n; i++) {\n seqArray[i] = scanner.nextInt();\n }\n // getSeqValue(seqArray); //this method is an accepted one on Hackerrank but time complexity is not order n; i.e. !O(n);\n getLinearOrderY(seqArray); // trying to get O(n) time complexity;\n }", "public static int example3(int[] arr) { // O(n)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j++) // loop from 0 to n-1 // O(n^2)\r\n\t\t\tfor (int k = 0; k <= j; k++) // loop from 0 to j\r\n\t\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Since we have nested for loop which dominates here and it is\r\n\t\t * O(n^2) and we always take the maximum. so the answer is quadratic time O(n^2)\r\n\t\t * \r\n\t\t */\r\n\t}", "public void sum2(int n){\n int sum =0; //1\n for (int j = 0; j < n; j++) //2n+2\n for (int k = 0; k < n; k++) //2n+2\n sum += k + j; //1\n for (int l = 0; l < n; l++) //2n+2\n sum += l; //1\n }", "public int[] squareUp(int n) {\r\n int[]arreglo=new int[(n*n)]; // O(1)\r\n if(n==0){ // O(1)\r\n return arreglo; // O(1)\r\n }\r\n for(int i=n-1;i<arreglo.length;i=i+n){ // O(n)\r\n for (int j=i;j>=i-(i/n);j--){ // O(1)\r\n arreglo[j]=1+(i-j); // O(1)\r\n }\r\n }\r\n return arreglo; // O(1)\r\n}", "public void sum(int n) {\n int sum = 0;\n for (int j = 0; j < n; j++) // 2n+2\n sum += j;\n for (int k = 0; k < n; k++) // 2n+2\n sum += k;\n for (int l = 0; l < n; l++) //2n+2\n sum += l;\n }", "private static int betterSolution(int n) {\n return n*n*n;\n }", "static int[] sol1(int[]a, int n){\r\n\t\tMap <Integer,Integer> map= new HashMap();\r\n\t\tfor (int i = 0; i< a.length; i++){\r\n\t\t\tmap.put(a[i],i);\r\n\t\t}\r\n\t\tArrays.sort(a);\r\n\t\tint i = 0; \r\n\t\tint j = a.length -1;\r\n\t\twhile (i <= j){\r\n\t\t\tif(a[i]+a[j]>n) j--;\r\n\t\t\telse if (a[i]+a[j]<n) i++;\r\n\t\t\telse break;\r\n\t\t}\r\n\t\tint[] ans= {map.get(a[i]),map.get(a[j])};\r\n\t\treturn ans;\r\n\t}", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tint a[]= {15,3,7,1,9,2};\n\t\tsubarraysum(a,11);//Time complexity O(n^2) space O(1)\n\n\t\tsubarraysum_reducecomplexity(a,11,a.length); //Time complexity O(n) space O(1)\n\n\t}", "static int solve(int n) \n\t{ \n\t // base case \n\t if (n < 0) \n\t return 0; \n\t if (n == 0) \n\t return 1; \n\t \n\t return solve(n-1) + solve(n-3) + solve(n-5); \n\t}", "static int linearLogTime(int[] n, int[] m) {\n if(n == null || n.length == 0 || m == null || m.length == 0) return -1;\n int sum = 0;\n for(int i = 0; i < n.length; ++i) {\n sum += logTime(m, 0, m.length, 15);\n }\n return sum;\n }", "public static int ulam(int n) {\n\n List<Integer> list = new ArrayList<>();\n list.add(1);\n list.add(2);\n\n int i = 3;\n while (list.size() < n) {\n\n int count = 0;\n for (int j = 0; j < list.size() - 1; j++) {\n\n for (int k = j + 1; k < list.size(); k++) {\n if (list.get(j) + list.get(k) == i)\n count++;\n if (count > 1)\n break;\n }\n if (count > 1)\n break;\n }\n if (count == 1)\n list.add(i);\n i++;\n }\n return list.get(n - 1);\n }", "private static int f(int n, int complete, int other, int[] arr) {\n if(n<=0)\n return 0;\n int res=0;\n ArrayList<Integer>list=new ArrayList<Integer>();\n for(int a:arr)\n if(a>0)\n list.add(a);\n int brr[]=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n while(brr.length!=0){\n int index=0;\n for(int i=1;i<brr.length;i++)\n if(brr[index]<brr[i])\n index=i;\n for(int i=0;i<brr.length;i++){\n if(index==i)\n brr[i]-=complete;\n else\n brr[i]-=other;\n }\n list=new ArrayList<Integer>();\n for(int a:brr)\n if(a>0)\n list.add(a);\n brr=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n res++;\n }\n return res;\n }", "public static int bestApproach(int n) {\n \n if(n<=2){\n return n;\n }\n int a = 0;\n int b = 1;\n int c = 2;\n \n while(n-->2){\n a = b+c;\n b = c;\n c = a;\n }\n return a;\n }", "public static int f3(int N) {\n \n // O(1)\n if (N == 0) return 1;\n else{ \n \n int x = 0;\n // O(N)\n for(int i = 0; i < N; i++)\n x += f3(N-1);\n return x;\n }\n }", "@Override public short getComplexity() {\n return 0;\n }", "static public int solve(int n,int A[])\n {\n int freqArr[] = new int[1001];\n int dp[] = new int[1001];\n\n for(int i=0; i<n; i++){\n freqArr[A[i]]++;\n }\n\n dp[0] = 0;\n dp[1] = freqArr[1] > 0 ? freqArr[1] : 0;\n\n for(int i=2; i<=1000; i++){\n dp[i] = Math.max(dp[i-2] + i*freqArr[i], dp[i-1]);\n }\n return dp[1000];\n }", "static int recursiva2(int n)\n\t\t{\n\t\t\tif (n==0)\n\t\t\treturn 10; \n\t\t\tif (n==1)\n\t\t\treturn 20;\n\t\t\tif (n==2)\n\t\t\treturn 30;\n\t\t\t\n\t\t\treturn recursiva2(n-1) + recursiva2 (n-2) * recursiva2 (n-3); \n\t\t}", "public static void main(String[] args) {\nScanner s=new Scanner(System.in);\nint n=s.nextInt();\nint a[]=new int[n];\nint x=0;\nfor(int i=1;i<=n;i++)\n{\n\tif(i%2!=0)\n\t{\n\t\ta[x++]=i;\n\t}\n}\nint sum=0;\nsum=a[0];\nfor(int i=0;i<x;i++)\n{\n\tif((i+1)<x)\n\t{\n\tif(i%2==0)\n\t\tsum=sum+a[i+1];\n\telse\n\t\tsum=sum-a[i+1];\n\t}\n}\nSystem.out.println(sum);\n\t}", "public static int example4(int[] arr) { // O(1)\r\n\t\tint n = arr.length, prefix = 0, total = 0; // O(1), O(1), (1)\r\n\t\tfor (int j = 0; j < n; j++) { // loop from 0 to n-1 // O(n)\r\n\t\t\tprefix += arr[j];\r\n\t\t\ttotal += prefix;\r\n\t\t}\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: The method contains a (for) loop and it runs (n) times.This loop\r\n\t\t * dominates the runtime.We always aim for the worse-case and maximum time. The\r\n\t\t * answer is it is linear time of O(n) notation.\r\n\t\t * \r\n\t\t */\r\n\t}", "public int numTrees(int n) {\n if(n<=1)\n return 1;\n int[] dp = new int[n+1];\n dp[0] = 1;\n dp[1] = 1;\n dp[2] = 2;\n \n for(int i=3;i<=n;i++){\n int sum = 0;\n for(int a=0;a<i;a++){\n sum+=dp[0+a]*dp[i-1-a];\n }\n dp[i] = sum;\n //if i is odd then add the i/2 dp after you multiply by 2\n }\n return dp[n];\n }", "private final int m()\n\t { int n = 0;\n\t int i = 0;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break; i++;\n\t }\n\t i++;\n\t while(true)\n\t { while(true)\n\t { if (i > j) return n;\n\t if (cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t n++;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t }\n\t }", "public static void main(String[] args) \n {\n int[] numOfPoints = { 1000, 10000, 7000, 10000, 13000 };\n for(int count = 0; count < numOfPoints.length; count++)\n {\n List<Point> pointsTobeUsed = new ArrayList<Point>();\n int current = numOfPoints[count];\n int inc = 0;\n \n //creating list of points to be used\n for(int x = 0; x <= current; x++)\n {\n \n if(x <= current/2)\n {\n pointsTobeUsed.add(new Point(x,x));\n \n }\n else\n {\n pointsTobeUsed.add(new Point(x, x - (1 + 2*(inc)) ) );\n inc++;\n }\n }\n \n //n logn implementation of Pareto optimal\n long timeStart = System.currentTimeMillis();\n \n // n logn quicksort\n pointsTobeUsed = quickSort(pointsTobeUsed, 0, pointsTobeUsed.size() -1 );\n \n \n \n ParetoOptimal(pointsTobeUsed);\n \n \n long timeEnd = System.currentTimeMillis();\n System.out.println(\"final:\" + \" exper: \" + (timeEnd - timeStart) + \" N: \" + current ); \n }\n }", "public static int log(int n)\t\t\t\t\t\t\t\t\t\t// for a given n, compute log n by continually dividing n by 2 and counting the number of times\n\t{\n\t\tint count=0;\n\t\twhile(n>0) {\n\t\t\tcount++;\n\t\t\tn=n/2;\n\t\t}\n\t\treturn count;\n\t}", "static int recursiva1(int n)\n\t\t{\n\t\tif (n==0)\n\t\t\treturn 10; \n\t\tif (n==1)\n\t\t\treturn 20; \n\t\treturn recursiva1(n-1) - recursiva1 (n-2);\t\t\n\t\t}", "static long findSum(int N)\n\t{\n\t\tif(N==0) return 0;\n\t\treturn (long)((N+1)>>1)*((N+1)>>1)+findSum((int)N>>1);\n\t\t\n\t}", "public static int getBetterApproach(int n){\n\t\t\n\t\tint t[] = new int[n+1];\n\t\t\n if(n<=2)\n return n;\n \n\t\tt[0] = 0;\n\t\tt[1] = 1;\n\t\tt[2] = 2;\n\t\tfor(int i = 3;i<=n;i++){\n\t\t\tt[i] = t[i-1] + t[i-2];\n\t\t}\n\t\treturn t[n];\n\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int T = sc.nextInt();\n for(int i = 0 ; i < T; i++) {\n int n = sc.nextInt();\n int a = sc.nextInt();\n int b = sc.nextInt();\n PriorityQueue<Integer> queue = new PriorityQueue<Integer>();\n int[][] m = new int[n][n];\n //n^2 * log(n)\n for(int row = 0; row < n; row++) {\n for(int col = 0; col < n; col++) {\n if(row == 0 && col == 0 && n != 1) {\n continue;\n }else if(row == 0) {\n m[row][col] = m[row][col - 1] + a;\n }else if(col == 0) {\n m[row][col] = m[row-1][col] + b;\n }else {\n m[row][col] = m[row-1][col-1] + a + b;\n }\n\n if(row + col == (n -1)) {\n pool.add(m[row][col]); //log(n)\n }\n }\n }\n //O(n*log(n))\n for (Integer item:pool) {\n queue.add(item); //O(logn)\n }\n while(!queue.isEmpty()) {\n System.out.print(queue.poll() + \" \"); //O(1)\n }\n System.out.println();\n queue.clear();\n pool.clear();\n }\n }", "public static void solve(int n, List<Integer> a) {\n Collections.sort(a);\n Collections.reverse(a);\n double sum = a.stream().mapToDouble(num -> Double.valueOf(num)).sum();\n double currentN = Double.valueOf(n);\n double currentSum = sum;\n for(Integer next : a)\n {\n double nextDouble = Double.valueOf(next);\n if(nextDouble<=currentSum/currentN)\n {\n break;\n }\n currentSum -= nextDouble;\n currentN--;\n }\n System.out.println(currentSum/currentN);\n\n\n }", "public static int example1(int[] arr) { // O(1)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j++) // loop from 0 to n-1 // O(n)\r\n\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\t}", "public long iterativeSum(long n){\n long result = 0;\n for(long i = 1L; i <= n; i++){\n result += i;\n }\n return result;\n }", "public int numTrees(int n) {\n if (n==0) return 1;\n int[] dp = new int[n+1];\n dp[0] = dp[1] = 1;\n for (int i=2;i<=n;i++) {\n for (int j=1;j<=i;j++) {\n dp[i] += dp[j-1] * dp[i-j];\n }\n }\n return dp[n];\n }", "void h(List<List<Integer>> r, List<Integer> t, int n, int s){ \n for(int i = s; i*i <= n; i++){\n if(n % i != 0) continue; \n t.add(i);\n t.add(n / i);\n r.add(new ArrayList<>(t));\n t.remove(t.size() - 1);\n h(r, t, n/i, i);\n t.remove(t.size() - 1);\n }\n }", "static int logTime(int[] n, int start, int end, int val) {\n if(n == null || n.length == 0) return -1;\n int mid = (start + end) / 2;\n if(val < n[mid]) logTime(n, 0, mid, val);\n if(val > n[mid]) logTime(n, mid + 1, n.length, val);\n return n[mid];\n }", "public static long sb(long a[], long n, long x) {\n long len = Long.MAX_VALUE;\n int p1 = 0;\n int p2 = 0;\n long sum = 0l;\n while(p1<=p2 && p2<n) {\n sum = sum + a[p2];\n p2++;\n while(sum >= x) {\n len = len > (p2-p1) ? (p2-p1) : len;\n sum = sum - a[p1];\n p1++;\n }\n }\n return len == Long.MAX_VALUE ? -1 : len;\n }", "static int[] OnepassSol1(int[]a, int n){\r\n Map<Integer, Integer> map = new HashMap<>();\r\n for (int i = 0; i < a.length; i++) {\r\n int complement = n - a[i];\r\n if (map.containsKey(complement)) {\r\n return new int[] { map.get(complement), i };\r\n }\r\n map.put(a[i], i);\r\n }\r\n int[] ans = {-1,-1};\r\n return ans;\r\n }", "static int gen(int n)\n{ \n int []S = new int [n + 1];\n \n S[0] = 0;\n if(n != 0)\n S[1] = 1;\n \n for (int i = 2; i <= n; i++)\n { \n \n // S(2 * n) = 4 * S(n)\n if (i % 2 == 0)\n S[i] = 4 * S[i / 2];\n \n // S(2 * n + 1) = 4 * S(n) + 1\n else\n S[i] = 4 * S[i/2] + 1;\n }\n \n return S[n];\n}", "static int sum(int n) {\n\t\tif(n==1) \n\t\t\treturn 1;\n\t\treturn n+sum(n-1);\n\t}", "static public void findPossibleTrianglesCount_V2(int[] arr, int n){\n \r\n int i,j,k; //loop or index variables\r\n int nTriangles = 0;\r\n \r\n Arrays.sort(arr);\r\n \r\n for(i=0; i<n-2; i++){\r\n k = i+2;\r\n for(j=i+1; j<n-1; j++){\r\n while(k<n && arr[i]+arr[j]>arr[k])\r\n k++;\r\n nTriangles+= k-j-1;\r\n }\r\n }\r\n \r\n System.out.println(\"Number of possible triangles \" + nTriangles);\r\n }", "public static void generateRandomNumbers(int n)\n\t{\n\t\t\tlong startTime = 0;\n\t\t\tlong endTime = 0;\n\t\t\tlong timeTaken = 0;\n\t\t\tint minimum = -20;\n\t\t\tint maximum = 20;\n\t\t\t//maximum subarray\n\t\t\tint maximumSum=0;\n\t\t\t// initialize length of array of integers to n\n\t\t \tint A [] = new int[n];\n\t\t \t// get instance of Random() to generate random numbers between -20 and 20\n\t\t \tRandom rand = new Random();\n\t for(int k =0;k<n;k++)\n\t {\n\t \tint randomNum = minimum + rand.nextInt((maximum - minimum) + 1);\n\t \t\tA [k]= randomNum;\n\t \t}\n\t startTime = System.currentTimeMillis();\n\t maximumSum = jKadaneAlgo(A,n);\n\t // System.out.println(\"Maximum Subarray: \"+maximumSum);\n\t // time in milliseconds after completion of J Kadane Algorithm logic\n\t endTime = System.currentTimeMillis();\n\t // calculate total time taken\n\t timeTaken = endTime-startTime;\n\t System.out.println(\"Total time - J Kadane dynamic programming algo: \"+timeTaken+\"ms\");\n\t // time in milliseconds before calling J Kadane Algorithm logic\n\t startTime = System.currentTimeMillis();\n\t \n\t}", "private static long calc1()\n {\n final int min = 1000;\n final int max = 10000;\n\n // initialize\n List<List<Integer>> m = new ArrayList<>();\n for (int k = 0; k < end; k++) {\n List<Integer> list = new ArrayList<Integer>();\n int n = 1;\n while (k >= start) {\n int p = pkn(k, n);\n if (p >= max) {\n break;\n }\n if (p >= min) {\n list.add(p);\n }\n n++;\n }\n m.add(list);\n }\n\n boolean[] arr = new boolean[end];\n arr[start] = true;\n\n List<Integer> solutions = new ArrayList<>();\n List<Integer> list = m.get(start);\n for (Integer first : list) {\n LinkedList<Integer> values = new LinkedList<>();\n values.add(first);\n f(m, arr, values, 1, solutions);\n // we stop at the first solution found\n if (!solutions.isEmpty()) {\n break;\n }\n }\n\n // solutions.stream().forEach(System.out::println);\n int res = solutions.stream().reduce(0, Integer::sum);\n return res;\n }", "private static int runBenchmark(int n) {\n int result = 0;\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) {\n result = benchmarkedMethod();\n }\n }\n return result;\n }", "public static int numTrees(int n){\n int[] dp = new int[n+1];\n dp[0] = 1;\n for (int i = 1; i <= n; i++){\n for (int j = 0; j < i; j++){\n dp[i] += dp[j] * dp[i-1-j];\n }\n }\n\n return dp[n];\n }", "@Override\r\n\tpublic Complexity_Class get_expected_complexity_class()\r\n\t{\r\n\t\treturn Complexity_Class.N_log_N;\r\n\t}", "public int numTrees(int n) {\n int[] dp = new int[n+1];\n dp[0] = 1;\n dp[1] = 1;\n for (int i=2; i<=n; i++) {\n for (int j=0; j<i; j++) {\n dp[i] = dp[i] + dp[j]*dp[i-j-1];\n }\n }\n \n return dp[n];\n }", "static long findNumberOfTriangles(int arr[], int n)\n {\n\n long count=0;\n\n for(int i=0;i<n;i++){\n for(int j=i;j<n;j++){\n if(arr[i]>arr[j]){\n int temp=arr[j];\n arr[j]=arr[i];\n arr[i]=temp;\n }\n }\n }\n\n int k =n-1;\n for(int i=n-2;i>=0;i--){\n for(int j=i-1;j>=0;j--){\n if(arr[k]<arr[j]+arr[i]){\n count++;\n }\n }\n k--;\n }\n\n return count;\n }", "private static int numTrees(int n) {\n int[] counts = new int[n + 2];\n counts[0] = 1;\n counts[1] = 1;\n for (int i = 2; i <= n; i++) {\n for (int j = 0; j < i; j++) {\n counts[i] += counts[j] * counts[i - j - 1];\n }\n }\n return counts[n];\n }", "public static List<Integer> solution2(int n) {\n List<Integer> rs=new ArrayList<Integer>();\n rs.add(0);\n for(int i=0;i<n;i++){\n int size=rs.size();\n for(int k=size-1;k>=0;k--)\n rs.add(rs.get(k) | 1<<i);\n }\n return rs;\n }", "public static void main(String[] args) {\nScanner sc=new Scanner(System.in);\r\nint n=sc.nextInt();\r\n\r\nList<Integer> l=new ArrayList<Integer>();\r\nfor(int i=1;i<=n;i++){\r\n\tif(i%2!=0)\r\n\t{\r\n\t\tl.add(i);\r\n\t}\r\n}\r\n\tSystem.out.println(l);\r\n\tint n1=l.get(0);\r\n\tfor(int i=0;i<l.size();i++){\r\n\tif(i%2==0)\r\n\t\r\n\t\tn1=n1-l.get(i);\r\n\t//System.out.println(s);\r\n\telse\r\n\t\tn1=n1+l.get(i);\r\n\t}\r\n\tSystem.out.println(n1+1);\r\n\t}", "public void triplet(int[] b,int n){\r\n\t\tint count=0;\r\n\t\tfor(int i=0;i<n;i++){\r\n\t\t\tfor(int j=i+1;j<n-1;j++){\r\n\t\t\t\tfor(int k=j+1;k<n-2;k++){\r\n\t\t\t\t\tif(b[i]+b[j]+b[k]==0){\r\n\t\t\t\t\t\tSystem.out.println(b[i]+\" \"+b[j]+\" \"+b[k]);\r\n\t\t\t\t\t\tcount++;\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\tSystem.out.println(\"no of distinct triplet is:\"+count);\t\r\n\r\n\t}", "public static int efficientOne(int n) {\r\n\t\tif (n < 2)\r\n\t\t\treturn n;\r\n\t\tint prevPrev = 0;\r\n\t\tint prev = 1;\r\n\t\tint fib = 0;\r\n\t\tfor (int i = 2; i <= n; i++) {\r\n\t\t\tfib = prev + prevPrev;\r\n\t\t\tprevPrev = prev;\r\n\t\t\tprev = fib;\r\n\t\t}\r\n\t\treturn fib;\r\n\t}", "private int A(int n, int m) {\n int res = 1;\n for (int i = 0; i < m; n++)\n res *= n;\n return res;\n }", "public int[] fix34(int[] nums) {\r\n\tint i=0; // O(1)\r\n while(i<nums.length && nums[i]!=3) // O(n)\r\n i++; // n+1\r\n int j=i; // O(1)\r\n while(j+1<nums.length && nums[j+1]!=4) // O(n)\r\n j++; // n+1\r\n while(i<nums.length){ // O(n)\r\n if(nums[i]==3){ // O(1)\r\n int temp=nums[i+1]; // O(1)\r\n nums[i+1]=nums[j+1]; //O(1)\r\n nums[j+1]=temp; // O(1)\r\n while(j+1<nums.length && nums[j+1] != 4) //O(n)\r\n j++; // n+1\r\n }\r\n i++; // n+1\r\n }\r\n return nums; //O(1)\r\n}", "int catalan(int n) { \n int res = 0; \n \n // Base case \n if (n <= 1) { \n return 1; \n } \n for (int i = 0; i < n; i++) { \n res += catalan(i) * catalan(n - i - 1); \n } \n return res; \n }", "private static int[] computePermutations(int n) {\n final int[] indexes = new int[n];\n for (int i = 0; i < n; i++) {\n indexes[i] = i;\n //indexes[i] = i + 1;\n }\n\n final int total = computePermutations(indexes, 0, n);\n System.out.println(\"# \" + np + \"; total = \" + total);\n\n return indexes;\n }", "static int countWaysUtil(int n, int m) \n\t { \n\t int res[] = new int[n]; \n\t res[0] = 1; res[1] = 1; \n\t for (int i=2; i<n; i++) \n\t { \n\t res[i] = 0; \n\t for (int j=1; j<=m && j<=i; j++) \n\t res[i] += res[i-j]; \n\t } \n\t return res[n-1]; \n\t }", "public static int solutionN2(int[] A) {\n\n\t\tclass Pair {\n\t\t\tpublic int start;\n\t\t\tpublic int end;\n\n\t\t\tpublic Pair(int start, int end) {\n\t\t\t\tthis.start = start;\n\t\t\t\tthis.end = end;\n\t\t\t}\n\t\t}\n\n\t\tPair[] pairs = new Pair[A.length];\n\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tpairs[i] = new Pair(i - A[i], i + A[i]);\n\t\t}\n\n\t\tArrays.sort(pairs, new Comparator<Pair>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Pair o1, Pair o2) {\n\t\t\t\treturn o1.start - o2.start;\n\t\t\t}\n\t\t});\n\n\t\tint countIntersection = 0;\n\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tPair current = pairs[i];\n\n\t\t\tfor (int j = i + 1; j < A.length; j++) {\n\t\t\t\tPair p = pairs[j];\n\t\t\t\tif (current.end >= p.start) {\n\t\t\t\t\tcountIntersection++;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (countIntersection > 10000000)\n\t\t\treturn -1;\n\n\t\treturn countIntersection;\n\t}", "public static void process(int n){\n\t\tint right, left, i;\n\n\t\tright = i = 0;\n\t\twhile(i < n){\n\t\t\twhile (right < n && c[i] == c[right]) right++;\n\t\t\tfor(int j = i; j < right; ++j) max_right[j] = right;\n\t\t\ti = right;\n\t\t}\n\n\t\tleft = i = n-1;\n\t\twhile(i >= 0){\n\t\t\twhile (left >= 0 && c[i] == c[left]) left--;\n\t\t\tfor (int j = i; j > left; --j) max_left[j] = left;\n\t\t\ti = left;\n\t\t}\n\t}", "static public void findPossibleTrianglesCount_V1(int[] arr, int n){\n \r\n int i,j,k; //loop or index variables\r\n int nTriangles = 0;\r\n \r\n for(i=0; i<n-2; i++){\r\n for(j=i+1; j<n-1; j++){\r\n for(k=j+1; k<n; k++){\r\n if(arr[i] != arr[j] && arr[i] != arr[k] && arr[j] != arr[k]){\r\n if(arr[i]+arr[j] > arr[k] && arr[i]+arr[k] > arr[j] && arr[j]+arr[k] > arr[i] ){ //a+b > c \r\n System.out.println(arr[i] + \" , \" + arr[j] + \" , \" + arr[k]);\r\n nTriangles+=1;\r\n }\r\n } //if\r\n } //innermost for k\r\n } //inner for j\r\n } //outer for i\r\n \r\n System.out.println(\"Number of possible triangles: \" + nTriangles);\r\n }", "static long[] radixsort(int arr[], int n)\r\n\r\n {\n\r\n int m = getMax(arr, n);\r\n\r\n long st = System.nanoTime();\r\n\r\n\r\n\r\n for (int exp = 1; m/exp > 0; exp *= 10)\r\n\r\n countSort(arr, n, exp);\r\n\r\n \r\n\r\n long et = System.nanoTime();\r\n\r\n threeVals[2] = et - st;\r\n\r\n return threeVals;\r\n\r\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\r\n\t\tint n = sc.nextInt();\r\n\t\tint[] a = new int[n];\r\n\t\tfor(int i = 0; i < n; i++){\r\n\t\t\ta[i] = sc.nextInt();\r\n\t\t}\r\n\t\tint res = 0, p = 0, t = 0;\r\n\t\twhile(true){\r\n\t\t\tp = 0; t = 0;\r\n\t\t\tfor(int i = 0; i < a.length; i++){\r\n\t\t\t\t\r\n\t\t\t\tif(i == a.length-1){\r\n\t\t\t\t\ta[i] /= 2;\r\n\t\t\t\t\tt = a[i];\r\n\t\t\t\t\ta[i] += p;\r\n\t\t\t\t\tp = t;\r\n\t\t\t\t\ta[0] += p;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\ta[i] /= 2;\r\n\t\t\t\t\tt = a[i];\r\n\t\t\t\t\ta[i] += p;\r\n\t\t\t\t\tp = t;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tboolean flag = true;\r\n\t\t\tint temp = a[0];\r\n\t\t\tfor(int j = 1; j < a.length; j++){\r\n\t\t\t\tif(a[j] != temp){\r\n\t\t\t\t\tflag = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(flag){\r\n\t\t\t\tSystem.out.println(res);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tfor(int j = 0; j < a.length; j++){\r\n\t\t\t\tif(a[j] % 2 != 0){\r\n\t\t\t\t\ta[j] += 1;\r\n\t\t\t\t\tres++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static int frog(int n, int [] h){\n\n int dp[] = new int [n];\n\n dp[0] = 0;\n dp[1] = Math.abs(h[1] - h[0]);\n\n for(int i = 2; i < n ; i ++){\n\n dp[i] = Math.min(dp [i - 2] + Math.abs(h[i] - h[i - 2]), dp[i - 1] + Math.abs(h[i] - h[i - 1]));\n\n\n\n }\n //print(dp);\n return dp[n - 1];\n }", "public int numTrees(int n) {\n if(n == 0 || n == 1 || n == 2)\n return n;\n int[] c = new int[n + 1];\n c[2] = 2;\n c[3] = 5;\n for(int i = 4; i < n + 1; i++){\n for(int j = 2; j < i; j++)\n c[i] += 2 * (c[j]);\n }\n return c[n];\n }", "public void log(int[] numbers) {\n\t\tSystem.out.println(); // O(1)\n\t\tfor (int number: numbers) // O(n)\n\t\t\tSystem.out.println(number);\n\t\tSystem.out.println(); // O(1)\n\t\t\n\t\t// O(2n), O(n+n)\n\t\t// We can drop 2* constant, O(n). Both represent linear growth\n\t\t// as we care only about input size\n\t\tfor (int number: numbers) // O(n)\n\t\t\tSystem.out.println(number);\n\t\tfor (int number: numbers) // O(n)\n\t\t\tSystem.out.println(number);\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tint sum = sc.nextInt();\n\t\tHashMap<Integer,Integer> map = new HashMap<>();\n \t\tArrays.sort(arr);\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint reqSum = sum-temp;\n\t\t\tarr[i]=0;\n\t\t\tint l=0;\n\t\t\tint r = n-1;\n\t\t\twhile(l<r) {\n\t\t\t\t//System.out.println(\"l \" + l + \" r \" + r + \" i = \"+ i);\n\t\t\t\tif(arr[l] + arr[r]==reqSum && arr[l]!=0 && arr[r]!=0 ) {\n\t\t\t\t\tint arr2[] = new int[3];\n\t\t\t\t\tarr2[0] = temp;\n\t\t\t\t\tarr2[1] = arr[l];\n\t\t\t\t\tarr2[2] = arr[r];\n\t\t\t\t\tif(map.containsKey(arr2[0]) || map.containsKey(arr2[1]) || map.containsKey(arr2[2])) {\n\t\t\t\t\t\t\n\t\t\t\t\t}else {\n\t\t\t\t\t\tArrays.sort(arr2);\n\t\t\t\t\t\tSystem.out.println(arr2[0] + \" \" + arr2[1] + \" \" + arr2[2]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tl++;\n\t\t\t\t}else if(arr[l] + arr[r] < reqSum) {\n\t\t\t\t\tl++;\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tr--;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tarr[i] = temp;\t\n\t\t\tmap.put(arr[i], 1);\n\t\t}\n\t}", "static void subsetSums(int arr[], int n)\n {\n \n // There are totoal 2^n subsets\n int total = 1 << n;\n \n // Consider all numbers from 0 to 2^n - 1\n for (int i = 0; i < total; i++) {\n int sum = 0;\n \n // Consider binary reprsentation of\n // current i to decide which elements\n // to pick.\n for (int j = 0; j < n; j++)\n if ((i & (1 << j)) != 0)\n sum += arr[j];\n \n // Print sum of picked elements.\n System.out.print(sum + \" \");\n }\n }", "private int d(final int n) {\r\n Set<Long> set = new Factors(n).getProperDivisors();\r\n long sum = 0;\r\n for (long i : set) {\r\n sum += i;\r\n }\r\n return (int) sum;\r\n }", "static int[] find2(int a[]){\r\n int sum = a[0];\r\n int pro = a[0];\r\n for(int i=1;i<a.length;i++){\r\n sum += a[i];\r\n pro += a[i]*a[i];\r\n }\r\n int s = (n*(n+1))/2 - sum;\r\n int p = (n*(n+1)*(2*n+1))/6 - pro;\r\n return solveSP(s, p);\r\n }", "protected int t(int n) {\r\n\t\treturn Math.floorDiv(n * (n - 1), 2);\r\n\t}", "public static int numTrees(int n) {\n\n int[] count = new int[n + 1];\n\n count[0] = 1;\n count[1] = 1;\n count[2] = 2;\n\n if (count[n] != 0) return count[n];\n\n // Get from count[1] to count[n]\n // G(n) = ∑ i=1ton, G(i−1)⋅G(n−i)\n for (int j = 3; j <= n; j++) {\n int total = 0;\n for (int i = 1; i <= j; i++) {\n int llen = i - 1;\n int rlen = j - i;\n total += (count[llen] * count[rlen]);\n }\n count[j] = total;\n }\n\n return count[n];\n }", "private static int lucas_cost(int n, double v) {\r\n\t\tint c, d, e, r;\r\n\r\n\t\td = n;\r\n\t\tr = (int) ((double) d / v + 0.5);\r\n\t\tif (r >= n)\r\n\t\t\treturn (ADD * n);\r\n\t\td = n - r;\r\n\t\te = 2 * r - n;\r\n\t\tc = DUP + ADD; /* initial duplicate and final addition */\r\n\t\twhile (d != e) {\r\n\t\t\tif (d < e) {\r\n\t\t\t\tr = d;\r\n\t\t\t\td = e;\r\n\t\t\t\te = r;\r\n\t\t\t}\r\n\t\t\tif (4 * d <= 5 * e && ((d + e) % 3) == 0) { /* condition 1 */\r\n\t\t\t\tr = (2 * d - e) / 3;\r\n\t\t\t\te = (2 * e - d) / 3;\r\n\t\t\t\td = r;\r\n\t\t\t\tc += 3 * ADD; /* 3 additions */\r\n\t\t\t} else if (4 * d <= 5 * e && (d - e) % 6 == 0) { /* condition 2 */\r\n\t\t\t\td = (d - e) / 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d <= (4 * e)) { /* condition 3 */\r\n\t\t\t\td -= e;\r\n\t\t\t\tc += ADD; /* one addition */\r\n\t\t\t} else if ((d + e) % 2 == 0) { /* condition 4 */\r\n\t\t\t\td = (d - e) / 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d % 2 == 0) { /* condition 5 */\r\n\t\t\t\td /= 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d % 3 == 0) { /* condition 6 */\r\n\t\t\t\td = d / 3 - e;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if ((d + e) % 3 == 0) { /* condition 7 */\r\n\t\t\t\td = (d - 2 * e) / 3;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if ((d - e) % 3 == 0) { /* condition 8 */\r\n\t\t\t\td = (d - e) / 3;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if (e % 2 == 0) { /* condition 9 */\r\n\t\t\t\te /= 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (c);\r\n\t}", "static int padovan(int n){\n if(n>=0 && n<=2)\n return 1;\n return padovan(n-2) + padovan(n-3);\n }", "public int numTrees(int n) {\n int[] G = new int[n + 1];\n G[0] = 1;\n G[1] = 1;\n\n for (int i = 2; i <= n; ++i) {\n for (int j = 1; j <= i; ++j) {\n G[i] += G[j - 1] * G[i - j];\n }\n }\n return G[n];\n }", "static int nthPolyTime(int n) {\n if(n <= 0) return -1;\n if(n == 1) return 1;\n return nthPolyTime(n - 1) + nthPolyTime(n - 2);\n }", "public int R_M(){\n\t\tBigInteger nminus1=n.subtract(BigInteger.ONE);\n\t\tdo{\n\t\t\tif(nminus1.mod(two.pow(a)).equals(BigInteger.ZERO)){\n\t\t\t\ttable.add(a);\n\t\t\t}\n\t\t\titerator++;\n\t\t\ta++;\n\t\t}while(!(two.pow(a).compareTo(n)>0));\n\t\t\n\t\ta=table.get(table.size()-1);\n\t\tBigInteger m=nminus1.divide(two.pow(a));\n\t\tint wlen=n.bitLength();\n\t\tBigInteger b;\n\t\tBigInteger z;\n\t\tfor(int i=0;i<iterations;i++){\n\t\t\tint straznik=0;\n\t\t\tint straznik1=0;\n\t\t\tdo{\n\t\t\t b=new BigInteger(wlen,new Random());\n\t\t\t}while(!(b.compareTo(BigInteger.ONE)>0) && !(b.compareTo(nminus1)<0));\n\t\t\tz=b.modPow(m, n);\n\t\t\tif(z.equals(BigInteger.ONE) || z.equals(nminus1)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfor(int j=0;j<a-1;j++){\n\t\t\t\t\tz=z.pow(2).mod(n);\n\t\t\t\t\tif(z.equals(nminus1)){\n\t\t\t\t\t\tstraznik++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif(z.equals(BigInteger.ONE)){\n\t\t\t\t\t\tstraznik1++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(straznik==1){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(straznik1==1){\n\t\t\t\t\tgetComposite();\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\t}\n\t\t\tgetComposite();\n\t\t\treturn 0;\n\t\t}\n\t\tgetProbablyPrime();\n\t\treturn 1;\n\t\t}", "public int numSquaresII(int n) {\n // build a hashset contains all i from 1 to sqrt(n) which have i^2 <= n\n Set<Integer> set = new HashSet<>();\n for (int i = 1; i * i <= n; i++) {\n set.add(i * i);\n }\n // start from 1 to n, test possible condition\n int count = 1;\n while (count <= n) {\n if (isDivided(n, count, set)) {\n return count;\n }\n count++;\n }\n return count;\n }", "public static int jKadaneAlgo(int A[], int n)\n\t{\n\t\t // initialize variables as first value in array\n\t\t int currentMax=A[0]; \n\t\t int maxSubarray=A[0]; \n\t\t for(int i=1; i<n; i++) \n\t\t { \n\t\t\t //compare the first element of array with the sum of first element of array and the iterating value of array\n\t\t\t currentMax=Math.max(A[i],(currentMax+A[i])); \n\t\t\t //keep updating the maxSubarray with highest value by comparing currentMax and maxSubArray\n\t\t\t maxSubarray=Math.max(maxSubarray,currentMax); \n\t\t }\n\t\t return maxSubarray;\n\t}", "static int solveMemo(int n) \n\t{ \n\t // base case \n\t if (n < 0) \n\t return 0; \n\t if (n == 0) \n\t return 1; \n\t \n\t // checking if already calculated \n\t if (dp[n]!=-1) \n\t return dp[n]; \n\t \n\t // storing the result and returning \n\t return dp[n] = solveMemo(n-1) + solveMemo(n-3) + solveMemo(n-5); \n\t}", "public int fib(int n) {\n// // 法一:记忆化递归\n// if (n <= 1) {\n// return n;\n// }\n// if (cache[n] != 0) {\n// return cache[n];\n// }\n// cache[n] = (fib(n - 1) + fib(n - 2)) % 1000000007;\n// return cache[n];\n// // 法二:动态规划\n// if (n == 0 || n == 1) {\n// return n;\n// }\n// int[] dp = new int[n + 1];\n// dp[0] = 0; dp[1] = 1;\n// for (int i = 2; i <= n; i++) {\n// dp[i] = dp[i - 1] + dp[i - 2];\n// dp[i] = dp[i] % 1000000007;\n// }\n// return dp[n];\n // 动态规划,优化空间\n if (n == 0 || n == 1) {\n return n;\n }\n int a = 0, b = 1, sum = 0;\n for (int i = 2; i <= n; i++) {\n sum = (a + b) % 1000000007;\n a = b;\n b = sum;\n }\n return sum;\n }", "public static int[] answer(int[] data, int n) {\n\t\tHashMap <Integer, Integer> h = new HashMap<Integer, Integer>();\r\n\t\t\r\n\t\tfor (int i=0; i<data.length; i++){\r\n\t\t\tif (!h.containsKey(data[i])){\r\n\t\t\t\th.put(data[i], 0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\th.put(data[i], h.get(data[i])+1);\r\n\t\t\t//h[data[i]]++;\r\n\t\r\n\t\t\tif (h.get(data[i]) > n){\r\n\t\t\t\th.put(data[i], Integer.MIN_VALUE);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tArrayList<Integer> r = new ArrayList<Integer>();\r\n\t\t\r\n\t\tfor(int i=0; i<data.length; i++){\r\n\t\t\t\r\n\t\t\tif (h.get(data[i])>0){\r\n\t\t\t\tr.add(data[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//pp(h);\r\n\t\t//System.out.println(h);\r\n\t\t\r\n\t\tint [] rr = new int [r.size()];\r\n\r\n\t\tfor(int k=0; k<r.size(); k++){\r\n\t\t\trr[k] = r.get(k);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn rr;\r\n }", "public static void findTriplets(int[] arr,int n)\n {\n boolean found = false;\n for (int i=0;i<n-2;i++)\n {\n for (int j=i+1; j<n-1; j++)\n {\n for(int k=j+1; k<n;k++)\n {\n if(arr[i]+arr[j]+arr[k] == 0)\n {\n System.out.println(arr[i]);\n System.out.println(\" \");\n System.out.println(arr[j]);\n System.out.println(\" \");\n System.out.println(arr[k]);\n System.out.println(\"\\n\");\n found = true;\n }\n }\n }\n }\n //if no triplet with 0 sum found in arrat\n if(found == false)\n System.out.println(\"not exist\");\n }", "public static void main(String[] args) {\n\t\tArrays.fill(arr, 1);\n\t\tlong startTime = System.nanoTime();\n\t\t// Traverse till square root of MAX\n\t\t// Using logic similar to sieve of eratosthenes to\n\t\t// populate factor sum array\n\t\tint limit = (int)Math.sqrt(MAX);\n\t\tfor (int i = 2; i <= limit; ++i) {\n\t\t\tint j = i+i;\n\t\t\tint count = 2;\n\t\t\twhile (j <= MAX){\n\t\t\t\t// As we already add count (j/i) to the factor sum when adding i,\n\t\t\t\t// we don't add when i is equal to or greater than count\n\t\t\t\tif (i < count) {\n\t\t\t\t\t// Adding i and count (j/i) to the factor sum of j\n\t\t\t\t\tarr[j] += i;\n\t\t\t\t\tarr[j] += count;\n\t\t\t\t}\n\t\t\t\tj += i;\n\t\t\t\tcount++;\n\t\t\t} \n\t\t}\n\t\t\n\t\tint count = 0;\n\t\tSystem.out.println(\"The following are amicable numbers\");\n\t\tfor (int i = 2; i <= MAX; ++i) {\n\t\t\tint num = arr[i];\n\t\t\tif (num <= MAX && num > i) {\n\t\t\t\tif (arr[num] == i) {\n\t\t\t\t\tSystem.out.println(count+\": \"+i+\" and \"+num);\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tlong endTime = System.nanoTime();\n\t\tdouble duration = timeInSec(endTime,startTime) ;\n\t\tSystem.out.println(\"Run time \" + duration + \" : secs\");\t\t\n\t}", "public int count(int n, int k)\n {\n\n long MOD = 1000000007;\n long res;\n\n res = (long)Math.pow(k, n);\n Map<Integer, Integer> divisor = new HashMap<>();\n\n long count = 0;\n for(int i = 2; i <= k; i++) {\n if(!(i % 2 == 0 && divisor.containsKey(i / 2))) {\n int div = divisorCount(i);\n divisor.put(i, div);\n count += div - 1;\n }\n else{\n int log2 = 31 - Integer.numberOfLeadingZeros(i);\n int div;\n if(Math.pow(2, log2) == i){\n div = divisor.get(i / 2) + 1;\n\n }\n else\n div = divisor.get(i / 2) * 2;\n\n divisor.put(i, div);\n count += div - 1;\n\n }\n\n }\n\n res -= (n - 1) * Math.pow(k, n - 2) * count;\n return (int)(res % MOD);\n }", "private static int maxSubSumN2(int[] a) {\n int maxSum = 0;\n\n for (int first = 0; first < a.length; first++) {\n int thisSum = 0;\n for (int i = first; i < a.length; i++) {\n thisSum += a[i];\n\n if (thisSum > maxSum) {\n maxSum = thisSum;\n }\n }\n }\n\n return maxSum;\n }", "private int siguientePrimo(int n)\r\n {\r\n if (n%2 == 0) n++;\r\n for (; !esPrimo(n); n+=2);\r\n return n;\r\n }", "static BigInteger findSum(BigInteger n) {\n if (n.equals(BigInteger.ZERO))\n return BigInteger.ZERO;\n BigInteger TWO = BigInteger.valueOf(2);\n\n BigInteger sum = BigInteger.ZERO;\n sum = sum.add(\n n.multiply(n.add(BigInteger.ONE))\n .divide(TWO)\n );\n\n BigInteger flooredN = findFraction(n);\n sum = sum.add(\n n.multiply(flooredN)\n );\n\n sum = sum.subtract(\n flooredN.multiply(flooredN.add(BigInteger.ONE))\n .divide(TWO)\n );\n\n sum = sum.subtract(findSum(flooredN));\n\n return sum;\n }", "private int getCondensedIndex(int n, int i, int j) {\n if (i < j) {\n return n * i - (i * (i + 1) / 2) + (j - i - 1);\n }\n else if (i > j) {\n return n * j - (j * (j + 1) / 2) + (i - j - 1);\n }\n else{\n return 0;\n }\n }", "public int nthUglyNumber2(int n) {\n Queue<Long> choushu = new PriorityQueue<>();\n if (n == 1)\n return 1;\n choushu.offer((long) 1);\n int[] factor = {2, 3, 5};\n for (int i = 2; i <= n; i++) {\n long num = choushu.poll();\n for (int f : factor) {\n long tmp = f * num;\n if (!choushu.contains(tmp))\n choushu.offer(tmp);\n }\n System.out.println(MessageFormat.format(\"num:{0},list:{1}\", num, printQueue(choushu)));\n }\n return choushu.poll().intValue();\n }", "@Override\n public long getComplexity() {\n final long[] complexity = {0};\n getChecks().forEachRemaining(element -> {\n complexity[0] += element.getComplexity();\n });\n return complexity[0];\n }", "public static int lg(int n){\n int result = 0;\n if( n > 0){\n while( n >= 2){\n n /= 2;\n result ++;\n } \n return result - 1;\n }else{\n return -2;\n }\n }", "public boolean linearIn(int[] outer, int[] inner) {\r\n int comp=0; // O(1)\r\n int count=0; // O(1)\r\n if(inner.length==0) // O(1)\r\n return true; // O(1)\r\n for(int i=0; i<outer.length; i++) { // O(n)\r\n if(outer[i]==inner[count]) { // O(1)\r\n comp++; // O(1)\r\n count++; // O(1)\r\n } else if(outer[i]>inner[count]) // O(1)\r\n return false; // O(1)\r\n if (comp==inner.length) // O(1)\r\n return true; // O(1)\r\n }\r\n return false; // O(1)\r\n}", "public int findIntegers(int n) {\n int[][]template=new int[32][2];\n\n //when the max length the array is one, we know that whether the max bit is one or zero, the arr value is 1\n template[1][0]=1;\n template[1][1]=1;\n\n for (int i = 2; i < 32; i++) {\n template[i][0]=template[i-1][0]+template[i-1][1];\n template[i][1]=template[i-1][0];\n }\n\n int answ=0;\n int pre=0;\n\n //we need to change n to binary expression\n List<Integer>binaryExpression=new ArrayList<>();\n int current=n;\n while (current!=0)\n {\n binaryExpression.add(current&1);\n current=current>>1;\n }\n for (int i = binaryExpression.size()-1; i>=0; i--) {\n Integer currentBit = binaryExpression.get(i);\n for (int j = 0; j < currentBit; j++) {\n answ+=template[i+1][j];\n }\n if (currentBit==1&&pre==1)\n {\n break;\n }\n pre=currentBit;\n if (i==0)\n {\n answ++;\n }\n }\n return answ;\n }", "public String run() {\r\n\t// divisorSum[n] is the sum of all the proper divisors of n\r\n int divisorSum[]= new int[LIMIT+1];\r\n for(int i=1;i<=LIMIT;i++)\r\n {\r\n for(int j=i+i;j<=LIMIT;j+=i)\r\n divisorSum[j]+=i;\r\n }\r\n // Analyze the amicable chain length for each number in ascending order\r\n int maxChainLen=0;\r\n int minChainElem=-1;\r\n for(int i=0;i<=LIMIT;i++){\r\n Set<Integer> visited=new HashSet<>();\r\n for(int count=1,cur=i;;count++){\r\n visited.add(cur);\r\n int next=divisorSum[cur];\r\n if(next==i)\r\n {\r\n if(count>maxChainLen){\r\n minChainElem=i;\r\n maxChainLen=count;\r\n \r\n }\r\n break;\r\n }\r\n // Exceeds limit or not a chain (a rho shape instead)\r\n else if(next>LIMIT || visited.contains(next))\r\n break;\r\n else\r\n cur=next;\r\n }\r\n }\r\n return Integer.toString(minChainElem);\r\n }", "private static int getTotient(int n) {\n int result = n;\n for(int i=2; i*i <=n; i++) {\n if(n % i == 0) {\n while(n % i == 0) n /= i;\n result -= result/i;\n }\n }\n if(n > 1) result -= result/n;\n return result;\n }", "public int numTrees(int n) {\n int[] table = new int[n+1];\n table[0] = 1;\n table[1] = 1;\n for (int i=2; i<=n ;i++) {\n for (int j=0; j<i; j++) {\n table[i] = table[i] + table[j] * table[i-j-1];\n }\n \n }\n \n return table[n];\n }" ]
[ "0.75540406", "0.7213416", "0.674471", "0.66593415", "0.66478616", "0.6585524", "0.6566015", "0.65655226", "0.6504032", "0.64850265", "0.6316463", "0.6275747", "0.6186475", "0.6096684", "0.60862505", "0.60699815", "0.60645646", "0.6049371", "0.6028631", "0.60229355", "0.6019066", "0.6018727", "0.6004761", "0.5979118", "0.59783113", "0.5976256", "0.59644485", "0.5912585", "0.58705634", "0.5842701", "0.5815004", "0.58084136", "0.5799109", "0.5797778", "0.57966226", "0.5794372", "0.575651", "0.5756291", "0.5750837", "0.574474", "0.57310903", "0.56930447", "0.56906456", "0.5688479", "0.5682069", "0.56769305", "0.5674588", "0.56733954", "0.5669932", "0.5656979", "0.5653386", "0.5651312", "0.5625506", "0.562155", "0.5603277", "0.55918324", "0.5591675", "0.55728877", "0.557123", "0.55707324", "0.55680436", "0.5567161", "0.55602837", "0.55598485", "0.5559332", "0.55488753", "0.55460846", "0.5539145", "0.55377346", "0.5528969", "0.55247796", "0.5522696", "0.55213743", "0.551424", "0.55142224", "0.5505994", "0.5498446", "0.5496971", "0.54947954", "0.5491466", "0.54864174", "0.54716295", "0.54646754", "0.546237", "0.54560876", "0.5451673", "0.5451447", "0.5447228", "0.5441636", "0.5439658", "0.5438289", "0.54328173", "0.5426584", "0.5422408", "0.54214394", "0.5419006", "0.5417366", "0.541617", "0.54161614", "0.54154515", "0.5414794" ]
0.0
-1
timecomplexity o(n), 1 pass
public int[] twoSum3(int[] nums, int target) { int[] res = new int[2]; int n = nums.length; Map<Integer, Integer> map = new HashMap<>(); for (int i = 0; i < n; i++) { int key = target - nums[i]; if (map.containsKey(key) && map.get(key) != i) { res[0] = map.get(key); res[1] = i; return res; } map.put(nums[i], i); } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int f2(int N) { \n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n)\n // O(n)`\n for(int j = 0; j < i; j++) \n x++;\n return x;\n }", "public static int f1(int N) {\n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n) \n x++; \n return x; \n \n }", "public static int f5(int N) { \n int x = 0;\n // log(n)\n for(int i = N; i > 0; i = i/2)\n // O(n) + O(n/2) + O(n/4)\n x += f1(i);\n \n return x; \n \n }", "public static int solveEfficient(int n) {\n if (n == 0 || n == 1)\n return 1;\n\n int n1 = 1;\n int n2 = 1;\n int sum = 0;\n\n for (int i = 2; i <= n; i++) {\n sum = n1 + n2;\n n1 = n2;\n n2 = sum;\n }\n return sum;\n }", "static long nPolyNTime(int[] n) {\n int temp = n.length;\n long sum = 0;\n if(n == null || n.length == 0) return -1;\n for(int i = 0; i < n.length; ++i) {\n while(temp --> 0) {\n for(int j = 0; j < n.length; ++j) {\n sum += n[i] + n[j];\n }\n }\n }\n return sum;\n }", "public static int example2(int[] arr) { // O(1)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j += 2) // note the increment of 2 // O(1)\r\n\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Once Again, we have a (for) loop and it runs (n) times and this\r\n\t\t * for loop dominates the runtime.So this is linear time and the answer is O(n).\r\n\t\t * \r\n\t\t */\r\n\t}", "public static void main(String args[] ) throws Exception {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n int[] seqArray = new int[n];\n for (int i = 0; i < n; i++) {\n seqArray[i] = scanner.nextInt();\n }\n // getSeqValue(seqArray); //this method is an accepted one on Hackerrank but time complexity is not order n; i.e. !O(n);\n getLinearOrderY(seqArray); // trying to get O(n) time complexity;\n }", "public static int example3(int[] arr) { // O(n)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j++) // loop from 0 to n-1 // O(n^2)\r\n\t\t\tfor (int k = 0; k <= j; k++) // loop from 0 to j\r\n\t\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Since we have nested for loop which dominates here and it is\r\n\t\t * O(n^2) and we always take the maximum. so the answer is quadratic time O(n^2)\r\n\t\t * \r\n\t\t */\r\n\t}", "public int[] squareUp(int n) {\r\n int[]arreglo=new int[(n*n)]; // O(1)\r\n if(n==0){ // O(1)\r\n return arreglo; // O(1)\r\n }\r\n for(int i=n-1;i<arreglo.length;i=i+n){ // O(n)\r\n for (int j=i;j>=i-(i/n);j--){ // O(1)\r\n arreglo[j]=1+(i-j); // O(1)\r\n }\r\n }\r\n return arreglo; // O(1)\r\n}", "public void sum2(int n){\n int sum =0; //1\n for (int j = 0; j < n; j++) //2n+2\n for (int k = 0; k < n; k++) //2n+2\n sum += k + j; //1\n for (int l = 0; l < n; l++) //2n+2\n sum += l; //1\n }", "private static int betterSolution(int n) {\n return n*n*n;\n }", "public void sum(int n) {\n int sum = 0;\n for (int j = 0; j < n; j++) // 2n+2\n sum += j;\n for (int k = 0; k < n; k++) // 2n+2\n sum += k;\n for (int l = 0; l < n; l++) //2n+2\n sum += l;\n }", "static int[] sol1(int[]a, int n){\r\n\t\tMap <Integer,Integer> map= new HashMap();\r\n\t\tfor (int i = 0; i< a.length; i++){\r\n\t\t\tmap.put(a[i],i);\r\n\t\t}\r\n\t\tArrays.sort(a);\r\n\t\tint i = 0; \r\n\t\tint j = a.length -1;\r\n\t\twhile (i <= j){\r\n\t\t\tif(a[i]+a[j]>n) j--;\r\n\t\t\telse if (a[i]+a[j]<n) i++;\r\n\t\t\telse break;\r\n\t\t}\r\n\t\tint[] ans= {map.get(a[i]),map.get(a[j])};\r\n\t\treturn ans;\r\n\t}", "static int solve(int n) \n\t{ \n\t // base case \n\t if (n < 0) \n\t return 0; \n\t if (n == 0) \n\t return 1; \n\t \n\t return solve(n-1) + solve(n-3) + solve(n-5); \n\t}", "static int linearLogTime(int[] n, int[] m) {\n if(n == null || n.length == 0 || m == null || m.length == 0) return -1;\n int sum = 0;\n for(int i = 0; i < n.length; ++i) {\n sum += logTime(m, 0, m.length, 15);\n }\n return sum;\n }", "@Override public short getComplexity() {\n return 0;\n }", "public static void main(String[] args) {\n\t\tint a[]= {15,3,7,1,9,2};\n\t\tsubarraysum(a,11);//Time complexity O(n^2) space O(1)\n\n\t\tsubarraysum_reducecomplexity(a,11,a.length); //Time complexity O(n) space O(1)\n\n\t}", "public static int bestApproach(int n) {\n \n if(n<=2){\n return n;\n }\n int a = 0;\n int b = 1;\n int c = 2;\n \n while(n-->2){\n a = b+c;\n b = c;\n c = a;\n }\n return a;\n }", "public static int f3(int N) {\n \n // O(1)\n if (N == 0) return 1;\n else{ \n \n int x = 0;\n // O(N)\n for(int i = 0; i < N; i++)\n x += f3(N-1);\n return x;\n }\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}", "public static int ulam(int n) {\n\n List<Integer> list = new ArrayList<>();\n list.add(1);\n list.add(2);\n\n int i = 3;\n while (list.size() < n) {\n\n int count = 0;\n for (int j = 0; j < list.size() - 1; j++) {\n\n for (int k = j + 1; k < list.size(); k++) {\n if (list.get(j) + list.get(k) == i)\n count++;\n if (count > 1)\n break;\n }\n if (count > 1)\n break;\n }\n if (count == 1)\n list.add(i);\n i++;\n }\n return list.get(n - 1);\n }", "static public int solve(int n,int A[])\n {\n int freqArr[] = new int[1001];\n int dp[] = new int[1001];\n\n for(int i=0; i<n; i++){\n freqArr[A[i]]++;\n }\n\n dp[0] = 0;\n dp[1] = freqArr[1] > 0 ? freqArr[1] : 0;\n\n for(int i=2; i<=1000; i++){\n dp[i] = Math.max(dp[i-2] + i*freqArr[i], dp[i-1]);\n }\n return dp[1000];\n }", "public int numTrees(int n) {\n if(n<=1)\n return 1;\n int[] dp = new int[n+1];\n dp[0] = 1;\n dp[1] = 1;\n dp[2] = 2;\n \n for(int i=3;i<=n;i++){\n int sum = 0;\n for(int a=0;a<i;a++){\n sum+=dp[0+a]*dp[i-1-a];\n }\n dp[i] = sum;\n //if i is odd then add the i/2 dp after you multiply by 2\n }\n return dp[n];\n }", "private static int f(int n, int complete, int other, int[] arr) {\n if(n<=0)\n return 0;\n int res=0;\n ArrayList<Integer>list=new ArrayList<Integer>();\n for(int a:arr)\n if(a>0)\n list.add(a);\n int brr[]=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n while(brr.length!=0){\n int index=0;\n for(int i=1;i<brr.length;i++)\n if(brr[index]<brr[i])\n index=i;\n for(int i=0;i<brr.length;i++){\n if(index==i)\n brr[i]-=complete;\n else\n brr[i]-=other;\n }\n list=new ArrayList<Integer>();\n for(int a:brr)\n if(a>0)\n list.add(a);\n brr=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n res++;\n }\n return res;\n }", "static int recursiva2(int n)\n\t\t{\n\t\t\tif (n==0)\n\t\t\treturn 10; \n\t\t\tif (n==1)\n\t\t\treturn 20;\n\t\t\tif (n==2)\n\t\t\treturn 30;\n\t\t\t\n\t\t\treturn recursiva2(n-1) + recursiva2 (n-2) * recursiva2 (n-3); \n\t\t}", "public static void main(String[] args) {\nScanner s=new Scanner(System.in);\nint n=s.nextInt();\nint a[]=new int[n];\nint x=0;\nfor(int i=1;i<=n;i++)\n{\n\tif(i%2!=0)\n\t{\n\t\ta[x++]=i;\n\t}\n}\nint sum=0;\nsum=a[0];\nfor(int i=0;i<x;i++)\n{\n\tif((i+1)<x)\n\t{\n\tif(i%2==0)\n\t\tsum=sum+a[i+1];\n\telse\n\t\tsum=sum-a[i+1];\n\t}\n}\nSystem.out.println(sum);\n\t}", "public static int log(int n)\t\t\t\t\t\t\t\t\t\t// for a given n, compute log n by continually dividing n by 2 and counting the number of times\n\t{\n\t\tint count=0;\n\t\twhile(n>0) {\n\t\t\tcount++;\n\t\t\tn=n/2;\n\t\t}\n\t\treturn count;\n\t}", "public static int example4(int[] arr) { // O(1)\r\n\t\tint n = arr.length, prefix = 0, total = 0; // O(1), O(1), (1)\r\n\t\tfor (int j = 0; j < n; j++) { // loop from 0 to n-1 // O(n)\r\n\t\t\tprefix += arr[j];\r\n\t\t\ttotal += prefix;\r\n\t\t}\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: The method contains a (for) loop and it runs (n) times.This loop\r\n\t\t * dominates the runtime.We always aim for the worse-case and maximum time. The\r\n\t\t * answer is it is linear time of O(n) notation.\r\n\t\t * \r\n\t\t */\r\n\t}", "private final int m()\n\t { int n = 0;\n\t int i = 0;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break; i++;\n\t }\n\t i++;\n\t while(true)\n\t { while(true)\n\t { if (i > j) return n;\n\t if (cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t n++;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t }\n\t }", "public int numTrees(int n) {\n if (n==0) return 1;\n int[] dp = new int[n+1];\n dp[0] = dp[1] = 1;\n for (int i=2;i<=n;i++) {\n for (int j=1;j<=i;j++) {\n dp[i] += dp[j-1] * dp[i-j];\n }\n }\n return dp[n];\n }", "public static void solve(int n, List<Integer> a) {\n Collections.sort(a);\n Collections.reverse(a);\n double sum = a.stream().mapToDouble(num -> Double.valueOf(num)).sum();\n double currentN = Double.valueOf(n);\n double currentSum = sum;\n for(Integer next : a)\n {\n double nextDouble = Double.valueOf(next);\n if(nextDouble<=currentSum/currentN)\n {\n break;\n }\n currentSum -= nextDouble;\n currentN--;\n }\n System.out.println(currentSum/currentN);\n\n\n }", "static int recursiva1(int n)\n\t\t{\n\t\tif (n==0)\n\t\t\treturn 10; \n\t\tif (n==1)\n\t\t\treturn 20; \n\t\treturn recursiva1(n-1) - recursiva1 (n-2);\t\t\n\t\t}", "public static void main(String[] args) \n {\n int[] numOfPoints = { 1000, 10000, 7000, 10000, 13000 };\n for(int count = 0; count < numOfPoints.length; count++)\n {\n List<Point> pointsTobeUsed = new ArrayList<Point>();\n int current = numOfPoints[count];\n int inc = 0;\n \n //creating list of points to be used\n for(int x = 0; x <= current; x++)\n {\n \n if(x <= current/2)\n {\n pointsTobeUsed.add(new Point(x,x));\n \n }\n else\n {\n pointsTobeUsed.add(new Point(x, x - (1 + 2*(inc)) ) );\n inc++;\n }\n }\n \n //n logn implementation of Pareto optimal\n long timeStart = System.currentTimeMillis();\n \n // n logn quicksort\n pointsTobeUsed = quickSort(pointsTobeUsed, 0, pointsTobeUsed.size() -1 );\n \n \n \n ParetoOptimal(pointsTobeUsed);\n \n \n long timeEnd = System.currentTimeMillis();\n System.out.println(\"final:\" + \" exper: \" + (timeEnd - timeStart) + \" N: \" + current ); \n }\n }", "public long iterativeSum(long n){\n long result = 0;\n for(long i = 1L; i <= n; i++){\n result += i;\n }\n return result;\n }", "public static int getBetterApproach(int n){\n\t\t\n\t\tint t[] = new int[n+1];\n\t\t\n if(n<=2)\n return n;\n \n\t\tt[0] = 0;\n\t\tt[1] = 1;\n\t\tt[2] = 2;\n\t\tfor(int i = 3;i<=n;i++){\n\t\t\tt[i] = t[i-1] + t[i-2];\n\t\t}\n\t\treturn t[n];\n\t}", "@Override\r\n\tpublic Complexity_Class get_expected_complexity_class()\r\n\t{\r\n\t\treturn Complexity_Class.N_log_N;\r\n\t}", "public static int example1(int[] arr) { // O(1)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j++) // loop from 0 to n-1 // O(n)\r\n\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\t}", "static long findSum(int N)\n\t{\n\t\tif(N==0) return 0;\n\t\treturn (long)((N+1)>>1)*((N+1)>>1)+findSum((int)N>>1);\n\t\t\n\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int T = sc.nextInt();\n for(int i = 0 ; i < T; i++) {\n int n = sc.nextInt();\n int a = sc.nextInt();\n int b = sc.nextInt();\n PriorityQueue<Integer> queue = new PriorityQueue<Integer>();\n int[][] m = new int[n][n];\n //n^2 * log(n)\n for(int row = 0; row < n; row++) {\n for(int col = 0; col < n; col++) {\n if(row == 0 && col == 0 && n != 1) {\n continue;\n }else if(row == 0) {\n m[row][col] = m[row][col - 1] + a;\n }else if(col == 0) {\n m[row][col] = m[row-1][col] + b;\n }else {\n m[row][col] = m[row-1][col-1] + a + b;\n }\n\n if(row + col == (n -1)) {\n pool.add(m[row][col]); //log(n)\n }\n }\n }\n //O(n*log(n))\n for (Integer item:pool) {\n queue.add(item); //O(logn)\n }\n while(!queue.isEmpty()) {\n System.out.print(queue.poll() + \" \"); //O(1)\n }\n System.out.println();\n queue.clear();\n pool.clear();\n }\n }", "static int logTime(int[] n, int start, int end, int val) {\n if(n == null || n.length == 0) return -1;\n int mid = (start + end) / 2;\n if(val < n[mid]) logTime(n, 0, mid, val);\n if(val > n[mid]) logTime(n, mid + 1, n.length, val);\n return n[mid];\n }", "static int sum(int n) {\n\t\tif(n==1) \n\t\t\treturn 1;\n\t\treturn n+sum(n-1);\n\t}", "public static int numTrees(int n){\n int[] dp = new int[n+1];\n dp[0] = 1;\n for (int i = 1; i <= n; i++){\n for (int j = 0; j < i; j++){\n dp[i] += dp[j] * dp[i-1-j];\n }\n }\n\n return dp[n];\n }", "public int numTrees(int n) {\n int[] dp = new int[n+1];\n dp[0] = 1;\n dp[1] = 1;\n for (int i=2; i<=n; i++) {\n for (int j=0; j<i; j++) {\n dp[i] = dp[i] + dp[j]*dp[i-j-1];\n }\n }\n \n return dp[n];\n }", "private static int runBenchmark(int n) {\n int result = 0;\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) {\n result = benchmarkedMethod();\n }\n }\n return result;\n }", "public static long sb(long a[], long n, long x) {\n long len = Long.MAX_VALUE;\n int p1 = 0;\n int p2 = 0;\n long sum = 0l;\n while(p1<=p2 && p2<n) {\n sum = sum + a[p2];\n p2++;\n while(sum >= x) {\n len = len > (p2-p1) ? (p2-p1) : len;\n sum = sum - a[p1];\n p1++;\n }\n }\n return len == Long.MAX_VALUE ? -1 : len;\n }", "private static int numTrees(int n) {\n int[] counts = new int[n + 2];\n counts[0] = 1;\n counts[1] = 1;\n for (int i = 2; i <= n; i++) {\n for (int j = 0; j < i; j++) {\n counts[i] += counts[j] * counts[i - j - 1];\n }\n }\n return counts[n];\n }", "public static void generateRandomNumbers(int n)\n\t{\n\t\t\tlong startTime = 0;\n\t\t\tlong endTime = 0;\n\t\t\tlong timeTaken = 0;\n\t\t\tint minimum = -20;\n\t\t\tint maximum = 20;\n\t\t\t//maximum subarray\n\t\t\tint maximumSum=0;\n\t\t\t// initialize length of array of integers to n\n\t\t \tint A [] = new int[n];\n\t\t \t// get instance of Random() to generate random numbers between -20 and 20\n\t\t \tRandom rand = new Random();\n\t for(int k =0;k<n;k++)\n\t {\n\t \tint randomNum = minimum + rand.nextInt((maximum - minimum) + 1);\n\t \t\tA [k]= randomNum;\n\t \t}\n\t startTime = System.currentTimeMillis();\n\t maximumSum = jKadaneAlgo(A,n);\n\t // System.out.println(\"Maximum Subarray: \"+maximumSum);\n\t // time in milliseconds after completion of J Kadane Algorithm logic\n\t endTime = System.currentTimeMillis();\n\t // calculate total time taken\n\t timeTaken = endTime-startTime;\n\t System.out.println(\"Total time - J Kadane dynamic programming algo: \"+timeTaken+\"ms\");\n\t // time in milliseconds before calling J Kadane Algorithm logic\n\t startTime = System.currentTimeMillis();\n\t \n\t}", "void h(List<List<Integer>> r, List<Integer> t, int n, int s){ \n for(int i = s; i*i <= n; i++){\n if(n % i != 0) continue; \n t.add(i);\n t.add(n / i);\n r.add(new ArrayList<>(t));\n t.remove(t.size() - 1);\n h(r, t, n/i, i);\n t.remove(t.size() - 1);\n }\n }", "public static int efficientOne(int n) {\r\n\t\tif (n < 2)\r\n\t\t\treturn n;\r\n\t\tint prevPrev = 0;\r\n\t\tint prev = 1;\r\n\t\tint fib = 0;\r\n\t\tfor (int i = 2; i <= n; i++) {\r\n\t\t\tfib = prev + prevPrev;\r\n\t\t\tprevPrev = prev;\r\n\t\t\tprev = fib;\r\n\t\t}\r\n\t\treturn fib;\r\n\t}", "static int[] OnepassSol1(int[]a, int n){\r\n Map<Integer, Integer> map = new HashMap<>();\r\n for (int i = 0; i < a.length; i++) {\r\n int complement = n - a[i];\r\n if (map.containsKey(complement)) {\r\n return new int[] { map.get(complement), i };\r\n }\r\n map.put(a[i], i);\r\n }\r\n int[] ans = {-1,-1};\r\n return ans;\r\n }", "static int gen(int n)\n{ \n int []S = new int [n + 1];\n \n S[0] = 0;\n if(n != 0)\n S[1] = 1;\n \n for (int i = 2; i <= n; i++)\n { \n \n // S(2 * n) = 4 * S(n)\n if (i % 2 == 0)\n S[i] = 4 * S[i / 2];\n \n // S(2 * n + 1) = 4 * S(n) + 1\n else\n S[i] = 4 * S[i/2] + 1;\n }\n \n return S[n];\n}", "private static long calc1()\n {\n final int min = 1000;\n final int max = 10000;\n\n // initialize\n List<List<Integer>> m = new ArrayList<>();\n for (int k = 0; k < end; k++) {\n List<Integer> list = new ArrayList<Integer>();\n int n = 1;\n while (k >= start) {\n int p = pkn(k, n);\n if (p >= max) {\n break;\n }\n if (p >= min) {\n list.add(p);\n }\n n++;\n }\n m.add(list);\n }\n\n boolean[] arr = new boolean[end];\n arr[start] = true;\n\n List<Integer> solutions = new ArrayList<>();\n List<Integer> list = m.get(start);\n for (Integer first : list) {\n LinkedList<Integer> values = new LinkedList<>();\n values.add(first);\n f(m, arr, values, 1, solutions);\n // we stop at the first solution found\n if (!solutions.isEmpty()) {\n break;\n }\n }\n\n // solutions.stream().forEach(System.out::println);\n int res = solutions.stream().reduce(0, Integer::sum);\n return res;\n }", "private int A(int n, int m) {\n int res = 1;\n for (int i = 0; i < m; n++)\n res *= n;\n return res;\n }", "int catalan(int n) { \n int res = 0; \n \n // Base case \n if (n <= 1) { \n return 1; \n } \n for (int i = 0; i < n; i++) { \n res += catalan(i) * catalan(n - i - 1); \n } \n return res; \n }", "static long findNumberOfTriangles(int arr[], int n)\n {\n\n long count=0;\n\n for(int i=0;i<n;i++){\n for(int j=i;j<n;j++){\n if(arr[i]>arr[j]){\n int temp=arr[j];\n arr[j]=arr[i];\n arr[i]=temp;\n }\n }\n }\n\n int k =n-1;\n for(int i=n-2;i>=0;i--){\n for(int j=i-1;j>=0;j--){\n if(arr[k]<arr[j]+arr[i]){\n count++;\n }\n }\n k--;\n }\n\n return count;\n }", "static public void findPossibleTrianglesCount_V2(int[] arr, int n){\n \r\n int i,j,k; //loop or index variables\r\n int nTriangles = 0;\r\n \r\n Arrays.sort(arr);\r\n \r\n for(i=0; i<n-2; i++){\r\n k = i+2;\r\n for(j=i+1; j<n-1; j++){\r\n while(k<n && arr[i]+arr[j]>arr[k])\r\n k++;\r\n nTriangles+= k-j-1;\r\n }\r\n }\r\n \r\n System.out.println(\"Number of possible triangles \" + nTriangles);\r\n }", "public int numTrees(int n) {\n if(n == 0 || n == 1 || n == 2)\n return n;\n int[] c = new int[n + 1];\n c[2] = 2;\n c[3] = 5;\n for(int i = 4; i < n + 1; i++){\n for(int j = 2; j < i; j++)\n c[i] += 2 * (c[j]);\n }\n return c[n];\n }", "private int d(final int n) {\r\n Set<Long> set = new Factors(n).getProperDivisors();\r\n long sum = 0;\r\n for (long i : set) {\r\n sum += i;\r\n }\r\n return (int) sum;\r\n }", "public int numTrees(int n) {\n int[] G = new int[n + 1];\n G[0] = 1;\n G[1] = 1;\n\n for (int i = 2; i <= n; ++i) {\n for (int j = 1; j <= i; ++j) {\n G[i] += G[j - 1] * G[i - j];\n }\n }\n return G[n];\n }", "protected int t(int n) {\r\n\t\treturn Math.floorDiv(n * (n - 1), 2);\r\n\t}", "static int nthPolyTime(int n) {\n if(n <= 0) return -1;\n if(n == 1) return 1;\n return nthPolyTime(n - 1) + nthPolyTime(n - 2);\n }", "public void log(int[] numbers) {\n\t\tSystem.out.println(); // O(1)\n\t\tfor (int number: numbers) // O(n)\n\t\t\tSystem.out.println(number);\n\t\tSystem.out.println(); // O(1)\n\t\t\n\t\t// O(2n), O(n+n)\n\t\t// We can drop 2* constant, O(n). Both represent linear growth\n\t\t// as we care only about input size\n\t\tfor (int number: numbers) // O(n)\n\t\t\tSystem.out.println(number);\n\t\tfor (int number: numbers) // O(n)\n\t\t\tSystem.out.println(number);\n\t\t\n\t\t\n\t\t\n\t}", "public static int numTrees(int n) {\n\n int[] count = new int[n + 1];\n\n count[0] = 1;\n count[1] = 1;\n count[2] = 2;\n\n if (count[n] != 0) return count[n];\n\n // Get from count[1] to count[n]\n // G(n) = ∑ i=1ton, G(i−1)⋅G(n−i)\n for (int j = 3; j <= n; j++) {\n int total = 0;\n for (int i = 1; i <= j; i++) {\n int llen = i - 1;\n int rlen = j - i;\n total += (count[llen] * count[rlen]);\n }\n count[j] = total;\n }\n\n return count[n];\n }", "public void triplet(int[] b,int n){\r\n\t\tint count=0;\r\n\t\tfor(int i=0;i<n;i++){\r\n\t\t\tfor(int j=i+1;j<n-1;j++){\r\n\t\t\t\tfor(int k=j+1;k<n-2;k++){\r\n\t\t\t\t\tif(b[i]+b[j]+b[k]==0){\r\n\t\t\t\t\t\tSystem.out.println(b[i]+\" \"+b[j]+\" \"+b[k]);\r\n\t\t\t\t\t\tcount++;\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\tSystem.out.println(\"no of distinct triplet is:\"+count);\t\r\n\r\n\t}", "private static int lucas_cost(int n, double v) {\r\n\t\tint c, d, e, r;\r\n\r\n\t\td = n;\r\n\t\tr = (int) ((double) d / v + 0.5);\r\n\t\tif (r >= n)\r\n\t\t\treturn (ADD * n);\r\n\t\td = n - r;\r\n\t\te = 2 * r - n;\r\n\t\tc = DUP + ADD; /* initial duplicate and final addition */\r\n\t\twhile (d != e) {\r\n\t\t\tif (d < e) {\r\n\t\t\t\tr = d;\r\n\t\t\t\td = e;\r\n\t\t\t\te = r;\r\n\t\t\t}\r\n\t\t\tif (4 * d <= 5 * e && ((d + e) % 3) == 0) { /* condition 1 */\r\n\t\t\t\tr = (2 * d - e) / 3;\r\n\t\t\t\te = (2 * e - d) / 3;\r\n\t\t\t\td = r;\r\n\t\t\t\tc += 3 * ADD; /* 3 additions */\r\n\t\t\t} else if (4 * d <= 5 * e && (d - e) % 6 == 0) { /* condition 2 */\r\n\t\t\t\td = (d - e) / 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d <= (4 * e)) { /* condition 3 */\r\n\t\t\t\td -= e;\r\n\t\t\t\tc += ADD; /* one addition */\r\n\t\t\t} else if ((d + e) % 2 == 0) { /* condition 4 */\r\n\t\t\t\td = (d - e) / 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d % 2 == 0) { /* condition 5 */\r\n\t\t\t\td /= 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d % 3 == 0) { /* condition 6 */\r\n\t\t\t\td = d / 3 - e;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if ((d + e) % 3 == 0) { /* condition 7 */\r\n\t\t\t\td = (d - 2 * e) / 3;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if ((d - e) % 3 == 0) { /* condition 8 */\r\n\t\t\t\td = (d - e) / 3;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if (e % 2 == 0) { /* condition 9 */\r\n\t\t\t\te /= 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (c);\r\n\t}", "public static List<Integer> solution2(int n) {\n List<Integer> rs=new ArrayList<Integer>();\n rs.add(0);\n for(int i=0;i<n;i++){\n int size=rs.size();\n for(int k=size-1;k>=0;k--)\n rs.add(rs.get(k) | 1<<i);\n }\n return rs;\n }", "static public void findPossibleTrianglesCount_V1(int[] arr, int n){\n \r\n int i,j,k; //loop or index variables\r\n int nTriangles = 0;\r\n \r\n for(i=0; i<n-2; i++){\r\n for(j=i+1; j<n-1; j++){\r\n for(k=j+1; k<n; k++){\r\n if(arr[i] != arr[j] && arr[i] != arr[k] && arr[j] != arr[k]){\r\n if(arr[i]+arr[j] > arr[k] && arr[i]+arr[k] > arr[j] && arr[j]+arr[k] > arr[i] ){ //a+b > c \r\n System.out.println(arr[i] + \" , \" + arr[j] + \" , \" + arr[k]);\r\n nTriangles+=1;\r\n }\r\n } //if\r\n } //innermost for k\r\n } //inner for j\r\n } //outer for i\r\n \r\n System.out.println(\"Number of possible triangles: \" + nTriangles);\r\n }", "public static void main(String[] args) {\nScanner sc=new Scanner(System.in);\r\nint n=sc.nextInt();\r\n\r\nList<Integer> l=new ArrayList<Integer>();\r\nfor(int i=1;i<=n;i++){\r\n\tif(i%2!=0)\r\n\t{\r\n\t\tl.add(i);\r\n\t}\r\n}\r\n\tSystem.out.println(l);\r\n\tint n1=l.get(0);\r\n\tfor(int i=0;i<l.size();i++){\r\n\tif(i%2==0)\r\n\t\r\n\t\tn1=n1-l.get(i);\r\n\t//System.out.println(s);\r\n\telse\r\n\t\tn1=n1+l.get(i);\r\n\t}\r\n\tSystem.out.println(n1+1);\r\n\t}", "private static int[] computePermutations(int n) {\n final int[] indexes = new int[n];\n for (int i = 0; i < n; i++) {\n indexes[i] = i;\n //indexes[i] = i + 1;\n }\n\n final int total = computePermutations(indexes, 0, n);\n System.out.println(\"# \" + np + \"; total = \" + total);\n\n return indexes;\n }", "static long[] radixsort(int arr[], int n)\r\n\r\n {\n\r\n int m = getMax(arr, n);\r\n\r\n long st = System.nanoTime();\r\n\r\n\r\n\r\n for (int exp = 1; m/exp > 0; exp *= 10)\r\n\r\n countSort(arr, n, exp);\r\n\r\n \r\n\r\n long et = System.nanoTime();\r\n\r\n threeVals[2] = et - st;\r\n\r\n return threeVals;\r\n\r\n }", "public int numTrees(int n) {\n long now = 1;\n for (int i = 0; i < n; i++) {\n now *= 2*n-i;\n now /= i+1;\n }\n return (int)(now/(n+1));\n }", "public int numSquaresII(int n) {\n // build a hashset contains all i from 1 to sqrt(n) which have i^2 <= n\n Set<Integer> set = new HashSet<>();\n for (int i = 1; i * i <= n; i++) {\n set.add(i * i);\n }\n // start from 1 to n, test possible condition\n int count = 1;\n while (count <= n) {\n if (isDivided(n, count, set)) {\n return count;\n }\n count++;\n }\n return count;\n }", "@Override\n public long getComplexity() {\n final long[] complexity = {0};\n getChecks().forEachRemaining(element -> {\n complexity[0] += element.getComplexity();\n });\n return complexity[0];\n }", "static int countWaysUtil(int n, int m) \n\t { \n\t int res[] = new int[n]; \n\t res[0] = 1; res[1] = 1; \n\t for (int i=2; i<n; i++) \n\t { \n\t res[i] = 0; \n\t for (int j=1; j<=m && j<=i; j++) \n\t res[i] += res[i-j]; \n\t } \n\t return res[n-1]; \n\t }", "public int R_M(){\n\t\tBigInteger nminus1=n.subtract(BigInteger.ONE);\n\t\tdo{\n\t\t\tif(nminus1.mod(two.pow(a)).equals(BigInteger.ZERO)){\n\t\t\t\ttable.add(a);\n\t\t\t}\n\t\t\titerator++;\n\t\t\ta++;\n\t\t}while(!(two.pow(a).compareTo(n)>0));\n\t\t\n\t\ta=table.get(table.size()-1);\n\t\tBigInteger m=nminus1.divide(two.pow(a));\n\t\tint wlen=n.bitLength();\n\t\tBigInteger b;\n\t\tBigInteger z;\n\t\tfor(int i=0;i<iterations;i++){\n\t\t\tint straznik=0;\n\t\t\tint straznik1=0;\n\t\t\tdo{\n\t\t\t b=new BigInteger(wlen,new Random());\n\t\t\t}while(!(b.compareTo(BigInteger.ONE)>0) && !(b.compareTo(nminus1)<0));\n\t\t\tz=b.modPow(m, n);\n\t\t\tif(z.equals(BigInteger.ONE) || z.equals(nminus1)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfor(int j=0;j<a-1;j++){\n\t\t\t\t\tz=z.pow(2).mod(n);\n\t\t\t\t\tif(z.equals(nminus1)){\n\t\t\t\t\t\tstraznik++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif(z.equals(BigInteger.ONE)){\n\t\t\t\t\t\tstraznik1++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(straznik==1){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(straznik1==1){\n\t\t\t\t\tgetComposite();\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\t}\n\t\t\tgetComposite();\n\t\t\treturn 0;\n\t\t}\n\t\tgetProbablyPrime();\n\t\treturn 1;\n\t\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\r\n\t\tint n = sc.nextInt();\r\n\t\tint[] a = new int[n];\r\n\t\tfor(int i = 0; i < n; i++){\r\n\t\t\ta[i] = sc.nextInt();\r\n\t\t}\r\n\t\tint res = 0, p = 0, t = 0;\r\n\t\twhile(true){\r\n\t\t\tp = 0; t = 0;\r\n\t\t\tfor(int i = 0; i < a.length; i++){\r\n\t\t\t\t\r\n\t\t\t\tif(i == a.length-1){\r\n\t\t\t\t\ta[i] /= 2;\r\n\t\t\t\t\tt = a[i];\r\n\t\t\t\t\ta[i] += p;\r\n\t\t\t\t\tp = t;\r\n\t\t\t\t\ta[0] += p;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\ta[i] /= 2;\r\n\t\t\t\t\tt = a[i];\r\n\t\t\t\t\ta[i] += p;\r\n\t\t\t\t\tp = t;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tboolean flag = true;\r\n\t\t\tint temp = a[0];\r\n\t\t\tfor(int j = 1; j < a.length; j++){\r\n\t\t\t\tif(a[j] != temp){\r\n\t\t\t\t\tflag = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(flag){\r\n\t\t\t\tSystem.out.println(res);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tfor(int j = 0; j < a.length; j++){\r\n\t\t\t\tif(a[j] % 2 != 0){\r\n\t\t\t\t\ta[j] += 1;\r\n\t\t\t\t\tres++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void process(int n){\n\t\tint right, left, i;\n\n\t\tright = i = 0;\n\t\twhile(i < n){\n\t\t\twhile (right < n && c[i] == c[right]) right++;\n\t\t\tfor(int j = i; j < right; ++j) max_right[j] = right;\n\t\t\ti = right;\n\t\t}\n\n\t\tleft = i = n-1;\n\t\twhile(i >= 0){\n\t\t\twhile (left >= 0 && c[i] == c[left]) left--;\n\t\t\tfor (int j = i; j > left; --j) max_left[j] = left;\n\t\t\ti = left;\n\t\t}\n\t}", "public int numTrees(int n) {\n int[] table = new int[n+1];\n table[0] = 1;\n table[1] = 1;\n for (int i=2; i<=n ;i++) {\n for (int j=0; j<i; j++) {\n table[i] = table[i] + table[j] * table[i-j-1];\n }\n \n }\n \n return table[n];\n }", "static int solveMemo(int n) \n\t{ \n\t // base case \n\t if (n < 0) \n\t return 0; \n\t if (n == 0) \n\t return 1; \n\t \n\t // checking if already calculated \n\t if (dp[n]!=-1) \n\t return dp[n]; \n\t \n\t // storing the result and returning \n\t return dp[n] = solveMemo(n-1) + solveMemo(n-3) + solveMemo(n-5); \n\t}", "public static int frog(int n, int [] h){\n\n int dp[] = new int [n];\n\n dp[0] = 0;\n dp[1] = Math.abs(h[1] - h[0]);\n\n for(int i = 2; i < n ; i ++){\n\n dp[i] = Math.min(dp [i - 2] + Math.abs(h[i] - h[i - 2]), dp[i - 1] + Math.abs(h[i] - h[i - 1]));\n\n\n\n }\n //print(dp);\n return dp[n - 1];\n }", "public int[] fix34(int[] nums) {\r\n\tint i=0; // O(1)\r\n while(i<nums.length && nums[i]!=3) // O(n)\r\n i++; // n+1\r\n int j=i; // O(1)\r\n while(j+1<nums.length && nums[j+1]!=4) // O(n)\r\n j++; // n+1\r\n while(i<nums.length){ // O(n)\r\n if(nums[i]==3){ // O(1)\r\n int temp=nums[i+1]; // O(1)\r\n nums[i+1]=nums[j+1]; //O(1)\r\n nums[j+1]=temp; // O(1)\r\n while(j+1<nums.length && nums[j+1] != 4) //O(n)\r\n j++; // n+1\r\n }\r\n i++; // n+1\r\n }\r\n return nums; //O(1)\r\n}", "static int padovan(int n){\n if(n>=0 && n<=2)\n return 1;\n return padovan(n-2) + padovan(n-3);\n }", "static void subsetSums(int arr[], int n)\n {\n \n // There are totoal 2^n subsets\n int total = 1 << n;\n \n // Consider all numbers from 0 to 2^n - 1\n for (int i = 0; i < total; i++) {\n int sum = 0;\n \n // Consider binary reprsentation of\n // current i to decide which elements\n // to pick.\n for (int j = 0; j < n; j++)\n if ((i & (1 << j)) != 0)\n sum += arr[j];\n \n // Print sum of picked elements.\n System.out.print(sum + \" \");\n }\n }", "public static int jKadaneAlgo(int A[], int n)\n\t{\n\t\t // initialize variables as first value in array\n\t\t int currentMax=A[0]; \n\t\t int maxSubarray=A[0]; \n\t\t for(int i=1; i<n; i++) \n\t\t { \n\t\t\t //compare the first element of array with the sum of first element of array and the iterating value of array\n\t\t\t currentMax=Math.max(A[i],(currentMax+A[i])); \n\t\t\t //keep updating the maxSubarray with highest value by comparing currentMax and maxSubArray\n\t\t\t maxSubarray=Math.max(maxSubarray,currentMax); \n\t\t }\n\t\t return maxSubarray;\n\t}", "public static int solutionN2(int[] A) {\n\n\t\tclass Pair {\n\t\t\tpublic int start;\n\t\t\tpublic int end;\n\n\t\t\tpublic Pair(int start, int end) {\n\t\t\t\tthis.start = start;\n\t\t\t\tthis.end = end;\n\t\t\t}\n\t\t}\n\n\t\tPair[] pairs = new Pair[A.length];\n\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tpairs[i] = new Pair(i - A[i], i + A[i]);\n\t\t}\n\n\t\tArrays.sort(pairs, new Comparator<Pair>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Pair o1, Pair o2) {\n\t\t\t\treturn o1.start - o2.start;\n\t\t\t}\n\t\t});\n\n\t\tint countIntersection = 0;\n\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tPair current = pairs[i];\n\n\t\t\tfor (int j = i + 1; j < A.length; j++) {\n\t\t\t\tPair p = pairs[j];\n\t\t\t\tif (current.end >= p.start) {\n\t\t\t\t\tcountIntersection++;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (countIntersection > 10000000)\n\t\t\treturn -1;\n\n\t\treturn countIntersection;\n\t}", "private static int getTotient(int n) {\n int result = n;\n for(int i=2; i*i <=n; i++) {\n if(n % i == 0) {\n while(n % i == 0) n /= i;\n result -= result/i;\n }\n }\n if(n > 1) result -= result/n;\n return result;\n }", "public String run() {\r\n\t// divisorSum[n] is the sum of all the proper divisors of n\r\n int divisorSum[]= new int[LIMIT+1];\r\n for(int i=1;i<=LIMIT;i++)\r\n {\r\n for(int j=i+i;j<=LIMIT;j+=i)\r\n divisorSum[j]+=i;\r\n }\r\n // Analyze the amicable chain length for each number in ascending order\r\n int maxChainLen=0;\r\n int minChainElem=-1;\r\n for(int i=0;i<=LIMIT;i++){\r\n Set<Integer> visited=new HashSet<>();\r\n for(int count=1,cur=i;;count++){\r\n visited.add(cur);\r\n int next=divisorSum[cur];\r\n if(next==i)\r\n {\r\n if(count>maxChainLen){\r\n minChainElem=i;\r\n maxChainLen=count;\r\n \r\n }\r\n break;\r\n }\r\n // Exceeds limit or not a chain (a rho shape instead)\r\n else if(next>LIMIT || visited.contains(next))\r\n break;\r\n else\r\n cur=next;\r\n }\r\n }\r\n return Integer.toString(minChainElem);\r\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tint sum = sc.nextInt();\n\t\tHashMap<Integer,Integer> map = new HashMap<>();\n \t\tArrays.sort(arr);\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint reqSum = sum-temp;\n\t\t\tarr[i]=0;\n\t\t\tint l=0;\n\t\t\tint r = n-1;\n\t\t\twhile(l<r) {\n\t\t\t\t//System.out.println(\"l \" + l + \" r \" + r + \" i = \"+ i);\n\t\t\t\tif(arr[l] + arr[r]==reqSum && arr[l]!=0 && arr[r]!=0 ) {\n\t\t\t\t\tint arr2[] = new int[3];\n\t\t\t\t\tarr2[0] = temp;\n\t\t\t\t\tarr2[1] = arr[l];\n\t\t\t\t\tarr2[2] = arr[r];\n\t\t\t\t\tif(map.containsKey(arr2[0]) || map.containsKey(arr2[1]) || map.containsKey(arr2[2])) {\n\t\t\t\t\t\t\n\t\t\t\t\t}else {\n\t\t\t\t\t\tArrays.sort(arr2);\n\t\t\t\t\t\tSystem.out.println(arr2[0] + \" \" + arr2[1] + \" \" + arr2[2]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tl++;\n\t\t\t\t}else if(arr[l] + arr[r] < reqSum) {\n\t\t\t\t\tl++;\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tr--;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tarr[i] = temp;\t\n\t\t\tmap.put(arr[i], 1);\n\t\t}\n\t}", "public int nthUglyNumber2(int n) {\n Queue<Long> choushu = new PriorityQueue<>();\n if (n == 1)\n return 1;\n choushu.offer((long) 1);\n int[] factor = {2, 3, 5};\n for (int i = 2; i <= n; i++) {\n long num = choushu.poll();\n for (int f : factor) {\n long tmp = f * num;\n if (!choushu.contains(tmp))\n choushu.offer(tmp);\n }\n System.out.println(MessageFormat.format(\"num:{0},list:{1}\", num, printQueue(choushu)));\n }\n return choushu.poll().intValue();\n }", "public int fib(int n) {\n// // 法一:记忆化递归\n// if (n <= 1) {\n// return n;\n// }\n// if (cache[n] != 0) {\n// return cache[n];\n// }\n// cache[n] = (fib(n - 1) + fib(n - 2)) % 1000000007;\n// return cache[n];\n// // 法二:动态规划\n// if (n == 0 || n == 1) {\n// return n;\n// }\n// int[] dp = new int[n + 1];\n// dp[0] = 0; dp[1] = 1;\n// for (int i = 2; i <= n; i++) {\n// dp[i] = dp[i - 1] + dp[i - 2];\n// dp[i] = dp[i] % 1000000007;\n// }\n// return dp[n];\n // 动态规划,优化空间\n if (n == 0 || n == 1) {\n return n;\n }\n int a = 0, b = 1, sum = 0;\n for (int i = 2; i <= n; i++) {\n sum = (a + b) % 1000000007;\n a = b;\n b = sum;\n }\n return sum;\n }", "private static int maxSubSumN2(int[] a) {\n int maxSum = 0;\n\n for (int first = 0; first < a.length; first++) {\n int thisSum = 0;\n for (int i = first; i < a.length; i++) {\n thisSum += a[i];\n\n if (thisSum > maxSum) {\n maxSum = thisSum;\n }\n }\n }\n\n return maxSum;\n }", "static BigInteger findSum(BigInteger n) {\n if (n.equals(BigInteger.ZERO))\n return BigInteger.ZERO;\n BigInteger TWO = BigInteger.valueOf(2);\n\n BigInteger sum = BigInteger.ZERO;\n sum = sum.add(\n n.multiply(n.add(BigInteger.ONE))\n .divide(TWO)\n );\n\n BigInteger flooredN = findFraction(n);\n sum = sum.add(\n n.multiply(flooredN)\n );\n\n sum = sum.subtract(\n flooredN.multiply(flooredN.add(BigInteger.ONE))\n .divide(TWO)\n );\n\n sum = sum.subtract(findSum(flooredN));\n\n return sum;\n }", "static int[] find2(int a[]){\r\n int sum = a[0];\r\n int pro = a[0];\r\n for(int i=1;i<a.length;i++){\r\n sum += a[i];\r\n pro += a[i]*a[i];\r\n }\r\n int s = (n*(n+1))/2 - sum;\r\n int p = (n*(n+1)*(2*n+1))/6 - pro;\r\n return solveSP(s, p);\r\n }", "public static void main(String[] args) {\n\t\tArrays.fill(arr, 1);\n\t\tlong startTime = System.nanoTime();\n\t\t// Traverse till square root of MAX\n\t\t// Using logic similar to sieve of eratosthenes to\n\t\t// populate factor sum array\n\t\tint limit = (int)Math.sqrt(MAX);\n\t\tfor (int i = 2; i <= limit; ++i) {\n\t\t\tint j = i+i;\n\t\t\tint count = 2;\n\t\t\twhile (j <= MAX){\n\t\t\t\t// As we already add count (j/i) to the factor sum when adding i,\n\t\t\t\t// we don't add when i is equal to or greater than count\n\t\t\t\tif (i < count) {\n\t\t\t\t\t// Adding i and count (j/i) to the factor sum of j\n\t\t\t\t\tarr[j] += i;\n\t\t\t\t\tarr[j] += count;\n\t\t\t\t}\n\t\t\t\tj += i;\n\t\t\t\tcount++;\n\t\t\t} \n\t\t}\n\t\t\n\t\tint count = 0;\n\t\tSystem.out.println(\"The following are amicable numbers\");\n\t\tfor (int i = 2; i <= MAX; ++i) {\n\t\t\tint num = arr[i];\n\t\t\tif (num <= MAX && num > i) {\n\t\t\t\tif (arr[num] == i) {\n\t\t\t\t\tSystem.out.println(count+\": \"+i+\" and \"+num);\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tlong endTime = System.nanoTime();\n\t\tdouble duration = timeInSec(endTime,startTime) ;\n\t\tSystem.out.println(\"Run time \" + duration + \" : secs\");\t\t\n\t}", "public static long h (int n)\n\t{\n\t\tif (n == 1)\n\t \treturn 0;\n\t else if (n == 2)\n\t \treturn 1;\n\t else \n\t \treturn (n-1)*(h(n-1)+h(n-2));\n\t}", "public static boolean ipot(long n) {\n\t\treturn n+(n-1) == (n^(n-1));\n\t}", "public static int[] answer(int[] data, int n) {\n\t\tHashMap <Integer, Integer> h = new HashMap<Integer, Integer>();\r\n\t\t\r\n\t\tfor (int i=0; i<data.length; i++){\r\n\t\t\tif (!h.containsKey(data[i])){\r\n\t\t\t\th.put(data[i], 0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\th.put(data[i], h.get(data[i])+1);\r\n\t\t\t//h[data[i]]++;\r\n\t\r\n\t\t\tif (h.get(data[i]) > n){\r\n\t\t\t\th.put(data[i], Integer.MIN_VALUE);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tArrayList<Integer> r = new ArrayList<Integer>();\r\n\t\t\r\n\t\tfor(int i=0; i<data.length; i++){\r\n\t\t\t\r\n\t\t\tif (h.get(data[i])>0){\r\n\t\t\t\tr.add(data[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//pp(h);\r\n\t\t//System.out.println(h);\r\n\t\t\r\n\t\tint [] rr = new int [r.size()];\r\n\r\n\t\tfor(int k=0; k<r.size(); k++){\r\n\t\t\trr[k] = r.get(k);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn rr;\r\n }", "public int count(int n, int k)\n {\n\n long MOD = 1000000007;\n long res;\n\n res = (long)Math.pow(k, n);\n Map<Integer, Integer> divisor = new HashMap<>();\n\n long count = 0;\n for(int i = 2; i <= k; i++) {\n if(!(i % 2 == 0 && divisor.containsKey(i / 2))) {\n int div = divisorCount(i);\n divisor.put(i, div);\n count += div - 1;\n }\n else{\n int log2 = 31 - Integer.numberOfLeadingZeros(i);\n int div;\n if(Math.pow(2, log2) == i){\n div = divisor.get(i / 2) + 1;\n\n }\n else\n div = divisor.get(i / 2) * 2;\n\n divisor.put(i, div);\n count += div - 1;\n\n }\n\n }\n\n res -= (n - 1) * Math.pow(k, n - 2) * count;\n return (int)(res % MOD);\n }", "private int siguientePrimo(int n)\r\n {\r\n if (n%2 == 0) n++;\r\n for (; !esPrimo(n); n+=2);\r\n return n;\r\n }", "public static int lg(int n){\n int result = 0;\n if( n > 0){\n while( n >= 2){\n n /= 2;\n result ++;\n } \n return result - 1;\n }else{\n return -2;\n }\n }", "public static void Perfectpower(int n) {\n\t\tlong valuecheck = 0;\n\t\t\n\t\tPriorityQueue<PerfectNumber> pq = new PriorityQueue<>(new Comparator<PerfectNumber>() {\n\t\t\t@Override\n\t\t\tpublic int compare(PerfectNumber o1, PerfectNumber o2) {\n\t\t\t\treturn (int) (o1.value - o2.value);\n\t\t\t}\n\t\t});\n\n\t\t//base condition\n\t\tpq.add(new PerfectNumber(2, 2));\n\t\t\n\t\twhile (!pq.isEmpty()) {\n\t\t\t\n\t\t\tPerfectNumber z = pq.remove();\n\t\t\t\n\t\t\t//return when a^b >n \n\t\t\tif(Math.pow(z.a, z.b)>n){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t//to avoid duplicacy\n\t\t\tif(valuecheck!=z.value){\n\t\t\t\tresult.add(z.value);\n\t\t\t\tvaluecheck = z.value;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// add next elements in priorrity queue\n\t\t\tif (z.a == 2) {\n\t\t\t\tpq.add(new PerfectNumber(2, z.b + 1));\n\t\t\t\tpq.add(new PerfectNumber(3, z.b));\n\n\t\t\t} else {\n\t\t\t\tpq.add(new PerfectNumber(z.a + 1, z.b));\n\t\t\t} \n\t\t}\n\n\t}" ]
[ "0.7479313", "0.7225663", "0.6784904", "0.6668255", "0.6602834", "0.65659463", "0.6544435", "0.65185237", "0.64167666", "0.6392589", "0.6290618", "0.6255823", "0.61544806", "0.6108323", "0.6096053", "0.60724777", "0.60719323", "0.6053215", "0.605134", "0.6014717", "0.6008136", "0.6006378", "0.599337", "0.5990131", "0.5916534", "0.5904419", "0.5884899", "0.5874675", "0.58381367", "0.5826087", "0.58228475", "0.5821596", "0.581426", "0.58108354", "0.5798212", "0.57981086", "0.57840395", "0.57636625", "0.57418215", "0.5733522", "0.57263094", "0.5726002", "0.57208544", "0.57194644", "0.57151645", "0.56756645", "0.5672829", "0.56669575", "0.5658093", "0.56473094", "0.5644569", "0.5627881", "0.56146634", "0.56102115", "0.5598677", "0.55957454", "0.5572932", "0.5569087", "0.5564258", "0.5561401", "0.5553155", "0.5549979", "0.55491686", "0.5534588", "0.55318475", "0.5530598", "0.552615", "0.5521178", "0.5520139", "0.55179197", "0.5511992", "0.5505712", "0.5504638", "0.5493862", "0.54919857", "0.5487331", "0.54827017", "0.5479211", "0.5474817", "0.5467937", "0.5465545", "0.546493", "0.54648024", "0.54645216", "0.54629135", "0.54567313", "0.54415154", "0.5432407", "0.5430475", "0.54221815", "0.541389", "0.54107636", "0.5410608", "0.5409677", "0.54084265", "0.54065204", "0.5402472", "0.54001087", "0.53901196", "0.5389316", "0.537739" ]
0.0
-1
handle passed in arguments
public static void main(String[] args) throws Exception { handleArguments(args); // grab current to timestamp in order // to label collected data with time Date collectionTime = new Date(System.currentTimeMillis()); if(initIndexesOnlyOption) { initIndexesOnly(collectionTime); // no need to go further return; } if(relativeObjectModifiedSinceOption) { // collect object data collectObjectDataModifiedSinceDate(collectionTime, objectModifiedSinceNoOfDays); } else { // check if secret day shifting testing option was specified if( relativeDayShift != 0 ) { Long epochTime = collectionTime.getTime(); Long daysShift = TimeUnit.DAYS.toMillis(relativeDayShift); collectionTime = new Date(epochTime - daysShift); } if(collectData.equals(ECS_COLLECT_BILLING_DATA) ){ // collect billing data collectBillingData(collectionTime); } else if(collectData.equals(ECS_COLLECT_OBJECT_DATA) ) { // only collection all object if the modified since option has been specified if(!relativeObjectModifiedSinceOption){ // collect object data collectObjectData(collectionTime); } } else if(collectData.equals(ECS_COLLECT_OBJECT_VERSION_DATA)) { // collect object data collectObjectVersionData(collectionTime); } else if(collectData.equals(ECS_COLLECT_ALL_DATA)) { // collect billing data collectBillingData(collectionTime); // only collection all object if the modified since option has not been specified if(!relativeObjectModifiedSinceOption) { // collect object data collectObjectData(collectionTime); } collectNamespaceDetails(collectionTime); collectNamespaceQuota(collectionTime); } else if(collectData.equals(ECS_COLLECT_NAMESPACE_DETAIL)) { // collect namespace details collectNamespaceDetails(collectionTime); } else if(collectData.equals(ECS_COLLECT_NAMESPACE_QUOTA)) { // collect namespace quota collectNamespaceQuota(collectionTime); } else if(collectData.equals(ECS_COLLECT_BUCKET_OWNER)) { // collect bucket owner collectBucketOwnership(collectionTime); } else if(collectData.equals(ECS_COLLECT_ALL_VDC)) { // collect vdc list collectVdcList(collectionTime); } else if(collectData.equals(ECS_COLLECT_OBJECT_DATA_NAMESPACE)) { // collect namespace collectObjectDataByNamespace(collectionTime); } else if(collectData.equals(ECS_COLLECT_OBJECT_DATA_BUCKET)) { // collect bucket collectObjectDataByBucket(collectionTime); } else { System.err.println("Unsupported data collection action: " + collectData ); System.err.println(menuString); System.exit(0); } } // wait for all threads to complete their work while ( !futures.isEmpty() ) { try { Future<?> future = futures.poll(); if(future != null){ future.get(); } } catch (InterruptedException e) { logger.error(e.getLocalizedMessage()); } catch (ExecutionException e) { e.printStackTrace(); logger.error(e.getLocalizedMessage()); } } Long objectCollectionFinish = System.currentTimeMillis(); Double deltaTime = Double.valueOf((objectCollectionFinish - collectionTime.getTime())) / 1000 ; logger.info("Collected " + objectCount.get() + " objects"); logger.info("Total collection time: " + deltaTime + " seconds"); // take everything down once all threads have completed their work threadPoolExecutor.shutdown(); // wait for all threads to terminate boolean termination = false; do { try { termination = threadPoolExecutor.awaitTermination(2, TimeUnit.MINUTES); } catch (InterruptedException e) { logger.error(e.getLocalizedMessage()); termination = true; } } while(!termination); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void handleArgument(ArrayList<String> argument) {\n\t\t\n\t}", "protected abstract void handle(Object... params);", "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 }", "@Override\n public void doExeception(Map<String, Object> args)\n {\n \n }", "@Override\n public void doExeception(Map<String, Object> args)\n {\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}", "protected abstract void parseArgs() throws IOException;", "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}", "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 handleArguments(String[] args, EquationManipulator manipulator) {\n \n // Grab the arguments\n Fraction firstFraction = manipulator.getFraction(args[0]);\n String operator = args[1];\n Fraction secondFraction = manipulator.getFraction(args[2]);\n \n // Perform the operation and get the results\n Fraction result = manipulator.performOperation(firstFraction, secondFraction, operator);\n \n // Report the result to the user\n printResult(result);\n }", "@Override\n public void process(Object[] args) throws HiveException {\n \n }", "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}", "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 }", "private void processArgs(String[] args) throws MalformedURLException, JAXBException, IOException, URISyntaxException, Exception {\n Options options = cli.getOptions(); \n options.addOption(\"collection\", true, \"Data Collection that this Fulfillment request applies to. Defaults to 'default'.\");\n Option idOpt = new Option(\"result_id\", true, \"The result_id being requested.\");\n idOpt.setRequired(true);\n options.addOption(idOpt);\n options.addOption(\"result_part_number\", true, \"The part number being requested. Defaults to '1'.\");\n \n cli.parse(args);\n CommandLine cmd = cli.getCmd();\n\n // Handle default values.\n String collection = cmd.hasOption(\"collection\") ? cmd.getOptionValue(\"collection\") : \"default\";\n int part = cmd.hasOption(\"result_part_number\") ? Integer.parseInt(cmd.getOptionValue(\"result_part_number\")) : 1;\n \n taxiiClient = generateClient(cmd);\n \n // Prepare the message to send.\n PollFulfillment request = factory.createPollFulfillment()\n .withMessageId(MessageHelper.generateMessageId())\n .withCollectionName(collection)\n .withResultId(cmd.getOptionValue(\"result_id\"))\n .withResultPartNumber(BigInteger.valueOf(part)); \n\n doCall(cmd, request);\n \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 }", "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}", "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}", "public void processArgs(String[] args){\n\t\tPattern pat = Pattern.compile(\"-[a-z]\");\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 'a': ucscGeneTableFileAll = new File(args[i+1]); i++; break;\n\t\t\t\t\tcase 'g': ucscGeneTableFileSelect = new File(args[i+1]); i++; break;\n\t\t\t\t\tcase 'b': barDirectory = new File(args[i+1]); i++; break;\n\t\t\t\t\tcase 'r': rApp = new File(args[i+1]); i++; break;\n\t\t\t\t\tcase 's': threshold = Float.parseFloat(args[i+1]); i++; break;\n\t\t\t\t\tcase 'e': extension = Integer.parseInt(args[i+1]); i++; break;\n\t\t\t\t\tcase 'f': extensionToSegment = Integer.parseInt(args[i+1]); i++; break;\n\t\t\t\t\tcase 'x': bpPositionOffSetBar = Integer.parseInt(args[i+1]); i++; break;\n\t\t\t\t\tcase 'y': bpPositionOffSetRegion = Integer.parseInt(args[i+1]); i++; break;\n\t\t\t\t\tcase 'h': printDocs(); System.exit(0);\n\t\t\t\t\tdefault: Misc.printExit(\"\\nError: 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\t//parse text\n\t\tselectName = Misc.removeExtension(ucscGeneTableFileSelect.getName());\n\n\t}", "public void parseUserInput(String[] args)\n {\n this.args = args;\n// Class cls = this.getClass();\n Method method;\n String parameter;\n int parameterPrefix = USER_OPTION.length();\n\n for (int parameterIndex=0; parameterIndex<args.length; parameterIndex++)\n {\n // Parse the input to find the corresponding function\n try\n {\n parameter = args[parameterIndex].substring(parameterPrefix);\n method = UserInput.class.getDeclaredMethod(parameter, Integer.class);\n parameterIndex = (int) method.invoke(this, parameterIndex);\n }\n catch (NoSuchMethodException | IllegalAccessException e )\n {\n throw new RuntimeException(\"Unhandled parameter: \" + args[parameterIndex] + \"\\n\" + e);\n }\n catch (InvocationTargetException e)\n {\n// e.printStackTrace();\n throw new RuntimeException(\"Missing or wrong parameters for the option: \" + args[parameterIndex] + \"\\n\" + e);\n }\n }\n }", "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 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 }", "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 }", "public Object HandleMethod(Object... args)\r\n {\r\n //throw new Exception();\r\n \treturn null;\r\n }", "public void handleCommand(String command, String args[], Player player){\n\t}", "public void processArguments(String[] _args) {\r\n\t\tboolean stateRead = false;\r\n\t\tif (_args != null && _args.length > 0) {\r\n\t\t\tfor (int i = 0; i < _args.length; i++) {\r\n\t\t\t\tif (_args[i].toLowerCase().endsWith(\".xml\")) {\r\n\t\t\t\t\tstateRead = readState(resetFile = _args[i]);\r\n\t\t\t\t} else if (_args[i].equals(\"-_initialState\")) {\r\n\t\t\t\t\tstateRead = readState(resetFile = _args[++i]);\r\n\t\t\t\t} else if (_args[i].equals(\"-_noDescription\")) {\r\n\t\t\t\t\tshowDescriptionOnStart = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "void doHandle()\n\t{\n\t\t// should be at least on arg\n\t\tif (!hasMoreTokens())\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"argumentRequired\")); //$NON-NLS-1$\n\t\telse\n\t\t{\n\t\t\t// poor man's fix for supporting 'all' option\n\t\t\tString faultName = nextToken();\n\t\t\tObject[] names = new Object[] { faultName };\n\n\t\t\t// replace the single name with all of them\n\t\t\tif (faultName.equalsIgnoreCase(\"all\")) //$NON-NLS-1$\n\t\t\t\tnames = m_faultTable.names();\n\n\t\t\t// make sure we know about at least one\n\t\t if (!m_faultTable.exists((String)names[0]))\n\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedFault\")); //$NON-NLS-1$\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (!hasMoreTokens())\n\t\t\t\t\tlistFault((String)names[0]);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tString action = null;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\twhile(hasMoreTokens())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taction = nextToken();\n\t\t\t\t\t\t\tfor(int i=0; i<names.length; i++)\n\t\t\t\t\t\t\t\tm_faultTable.action((String)names[i], action);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(IllegalArgumentException iae)\n\t\t\t\t\t{\n\t\t\t\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\t\t\t\targs.put(\"action\", action); //$NON-NLS-1$\n\t\t\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedAction\", args)); //$NON-NLS-1$\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n public final int parseArguments(Parameters params) {\n return 1;\n }", "@Override\n public void verifyArgs(ArrayList<String> args) throws ArgumentFormatException {\n super.checkNumArgs(args);\n _args = true;\n }", "public void processArgs(String[] args){\n\t\t//look for a config file \n\t\targs = appendConfigArgs(args,\"-c\");\n\t\t\n\t\tPattern pat = Pattern.compile(\"-[a-z]\");\n\t\tFile forExtraction = null;\n\t\tFile configFile = 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': forExtraction = new File(args[++i]); break;\n\t\t\t\t\tcase 'v': vcfFileFilter = args[++i]; break;\n\t\t\t\t\tcase 'b': bedFileFilter = args[++i]; break;\n\t\t\t\t\tcase 'x': appendFilter = false; break;\n\t\t\t\t\tcase 'c': configFile = new File(args[++i]); break;\n\t\t\t\t\tcase 'd': dataDir = new File(args[++i]); break;\n\t\t\t\t\tcase 'm': maxCallFreq = Double.parseDouble(args[++i]); break;\n\t\t\t\t\tcase 'o': minBedCount = Integer.parseInt(args[++i]); break;\n\t\t\t\t\tcase 's': saveDirectory = new File(args[++i]); break;\n\t\t\t\t\tcase 'e': debug = true; break;\n\t\t\t\t\tcase 'h': printDocs(); System.exit(0);\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//config file? or local\n\t\tif (configLines != null && configFile != null){\n\t\t\tif (configLines[0].startsWith(\"-\") == false ) {\n\t\t\t\tHashMap<String, String> config = IO.loadFileIntoHashMapLowerCaseKey(configFile);\n\t\t\t\tif (config.containsKey(\"queryurl\")) queryURL = config.get(\"queryurl\");\n\t\t\t\tif (config.containsKey(\"host\")) host = config.get(\"host\");\n\t\t\t\tif (config.containsKey(\"realm\")) realm = config.get(\"realm\");\n\t\t\t\tif (config.containsKey(\"username\")) userName = config.get(\"username\");\n\t\t\t\tif (config.containsKey(\"password\")) password = config.get(\"password\");\n\t\t\t\tif (config.containsKey(\"maxcallfreq\")) maxCallFreq = Double.parseDouble(config.get(\"maxcallfreq\"));\n\t\t\t\tif (config.containsKey(\"vcffilefilter\")) vcfFileFilter = config.get(\"vcffilefilter\");\n\t\t\t\tif (config.containsKey(\"bedfilefilter\")) bedFileFilter = config.get(\"bedfilefilter\");\n\t\t\t}\n\t\t}\n\t\t//local search?\n\t\tif (queryURL == null){\n\t\t\tif (dataDir == null || dataDir.isDirectory()== false) {\n\t\t\t\tMisc.printErrAndExit(\"\\nProvide either a configuration file for remotely accessing a genomic query service or \"\n\t\t\t\t\t\t+ \"set the -d option to the Data directory created by the GQueryIndexer app.\\n\");;\n\t\t\t}\n\t\t}\n\n\t\tIO.pl(\"\\n\"+IO.fetchUSeqVersion()+\" Arguments:\");\n\t\tIO.pl(\"\\t-f Vcfs \"+forExtraction);\n\t\tIO.pl(\"\\t-s SaveDir \"+saveDirectory);\n\t\tIO.pl(\"\\t-v Vcf File Filter \"+vcfFileFilter);\n\t\tIO.pl(\"\\t-b Bed File Filter \"+bedFileFilter);\n\t\tIO.pl(\"\\t-m MaxCallFreq \"+maxCallFreq);\n\t\tIO.pl(\"\\t-o MinBedCount \"+minBedCount);\n\t\tIO.pl(\"\\t-x Remove failing \"+(appendFilter==false));\n\t\tIO.pl(\"\\t-e Verbose \"+debug);\n\t\tif (queryURL != null){\n\t\t\tIO.pl(\"\\tQueryUrl \"+queryURL);\n\t\t\tIO.pl(\"\\tHost \"+host);\n\t\t\tIO.pl(\"\\tRealm \"+realm);\n\t\t\tIO.pl(\"\\tUserName \"+userName);\n\t\t\t//check config params\n\t\t\tif (queryURL == null) Misc.printErrAndExit(\"\\nError: failed to find a queryUrl in the config file, e.g. queryUrl http://hci-clingen1.hci.utah.edu:8080/GQuery/\");\n\t\t\tif (queryURL.endsWith(\"/\") == false) queryURL = queryURL+\"/\";\n\t\t\tif (host == null) Misc.printErrAndExit(\"\\nError: failed to find a host in the config file, e.g. host hci-clingen1.hci.utah.edu\");\n\t\t\tif (realm == null) Misc.printErrAndExit(\"\\nError: failed to find a realm in the config file, e.g. realm QueryAPI\");\n\t\t\tif (userName == null) Misc.printErrAndExit(\"\\nError: failed to find a userName in the config file, e.g. userName FCollins\");\n\t\t\tif (password == null) Misc.printErrAndExit(\"\\nError: failed to find a password in the config file, e.g. password g0QueryAP1\");\n\n\t\t}\n\t\telse IO.pl(\"\\t-d DataDir \"+dataDir);\n\t\tIO.pl();\n\n\t\t//pull vcf files\n\t\tif (forExtraction == null || forExtraction.exists() == false) Misc.printErrAndExit(\"\\nError: please enter a path to a vcf file or directory containing such.\\n\");\n\t\tFile[][] tot = new File[3][];\n\t\ttot[0] = IO.extractFiles(forExtraction, \".vcf\");\n\t\ttot[1] = IO.extractFiles(forExtraction,\".vcf.gz\");\n\t\ttot[2] = IO.extractFiles(forExtraction,\".vcf.zip\");\n\t\tvcfFiles = IO.collapseFileArray(tot);\n\t\tif (vcfFiles == null || vcfFiles.length ==0 || vcfFiles[0].canRead() == false) Misc.printExit(\"\\nError: cannot find your xxx.vcf(.zip/.gz OK) file(s)!\\n\");\n\n\t\t//check params\n\t\tif (vcfFileFilter == null) Misc.printErrAndExit(\"\\nError: provide a vcf file filter, e.g. Hg38/Somatic/Avatar/Vcf \");\n\t\tif (bedFileFilter == null) Misc.printErrAndExit(\"\\nError: provide a bed file filter, e.g. Hg38/Somatic/Avatar/Bed \");\n\t\tif (saveDirectory == null) Misc.printErrAndExit(\"\\nError: provide a directory to save the annotated vcf files.\");\n\t\telse saveDirectory.mkdirs();\n\t\tif (saveDirectory.exists() == false) Misc.printErrAndExit(\"\\nError: could not find your save directory? \"+saveDirectory);\n\n\t\tuserQueryVcf = new UserQuery().addRegExFileName(\".vcf.gz\").addRegExDirPath(vcfFileFilter).matchVcf();\n\t\tuserQueryBed = new UserQuery().addRegExFileName(\".bed.gz\").addRegExDirPath(bedFileFilter);\n\t}", "public void argumentOrginazer(String[] args){\n\t\tfor(String arg:args) {\n\t\t\t\n\t\t\tif(arg.toLowerCase().contains(\"-s\")) {// The -s argument will make a starters plot\n\t\t\t\tif(!player.isOp()){\n\t\t\t\t\tplayer.sendMessage(\"You need to be op to create a starters plot!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else if( arg.toLowerCase().contains(\"h:\") || arg.toLowerCase().contains(\"height:\")) {\n\t\t\t\t// the h:<number> or height:<number> argument can set a custum height for the given plot\n\t\t\t\tint temp = arg.indexOf(\":\") + 1;\n\t\t\t\theigth = Integer.valueOf((String) arg.subSequence(temp, arg.length()));\n\t\t\t\t\n\t\t\t} else if( arg.toLowerCase().contains(\"d:\") || arg.toLowerCase().contains(\"depth:\")) {\n\t\t\t\t// the d:<number> of depth:<number> will set a custum depth for the plot and also\n\t\t\t\t// places bedrock at the proper places\n\t\t\t\tint temp = arg.indexOf(\":\") + 1;\n\t\t\t\tdepth = Integer.valueOf((String) arg.subSequence(temp, arg.length()));\n\t\t\t\t\n\t\t\t} else if ( arg.toLowerCase().contains(\"n\") || arg.toLowerCase().contains(\"name:\")) {\n\t\t\t\t// The N:<name of plot> or name:<name of plot> will specify the name of the plot that\n\t\t\t\t// is about to be made. The plugin will terminate this action if no name is put in.\n\t\t\t\tint temp = arg.indexOf(\":\") + 1;\n\t\t\t\tname = (String) arg.subSequence(temp, arg.length());\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// Error catching for yet unknow arguments :P\n\t\t\t\tplayer.sendMessage(ChatColor.RED + \"The argument: \" + arg + \"does not exist.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t// Error catching for the 2 posistions the player selected\n\t\tposition1 = PlayerCords.getPlayerCords(player.getName())[0];\n\t\tposition2 = PlayerCords.getPlayerCords(player.getName())[1];\n\t\tif(position1 == null || position2 == null) {\n\t\t\tplayer.sendMessage(\"You did not select 2 points to create the plot from\");\n\t\t\treturn;\n\t\t}\n\t\t//debug\n\t\tplayer.sendMessage(position1.getBlockY() + \" 2nd \" + position2.getBlockY());\n\t\t\n\t\t//You need to give a plot name.\n\t\tif (name == null){\n\t\t\tplayer.sendMessage(ChatColor.RED + \"You forgot to give a plot name\");\n\t\t}\n\t\t\n\t\t// return more propper vectors for the plot creation so the region can be set\n\t\tVector[] temp = CreatePhysicalPlot.getProperVectors(position1, position2, heigth, depth);\n\t\tposition1 = temp[0];\n\t\tposition2 = temp[1];\n\t\t\n\t\t//makes the region and checks if this is legal on the given position and returns null\n\t\t//if an error occures\n\t\tProtectedRegion plotRegion = setRegion();\n\t\t\n\t\tif(plotRegion == null){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//gets the region form the just created plot\n\t\tList<String> regionIds = Arrays.asList(plotRegion.getId());\n\t\t\n\t\t//Searches the region for any city and returns null if it fails\n\t\tCityPlot cityPlot = getCityPlot(plotRegion);\n\t\tif(cityPlot == null){\n\t\t\tplayer.sendMessage(\"You need to be in a city plot to make a residence plot\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Builds the plot in the game world.\n CreatePhysicalPlot.CreatePlot(position1, position2, heigth, depth, player.getWorld(), player);\n // Instantates the plot object for the server to store and work with\n\t\tcreateResidentPlot(name, player.getWorld(), regionIds, cityPlot);\t\t\n\t}", "public static void main(String[] args) throws IOException {\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));\n String URL = \"\";\n URL = bufferedReader.readLine();\n\n if (URL.isEmpty() || URL.indexOf(\"?\") == -1 || URL.indexOf(\"?\") == URL.length()-1)\n return;\n\n ArrayList<String> params = getParams(URL);\n\n if (params == null)\n return;\n\n printParams(params);\n processObj(params);\n// for (String s : params)\n// if (s.contains(\"obj=\")) {\n// callAlert(params);\n// break;\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}", "protected void handleArgs(String[] argv) throws IOException {\n String url = null, path = null, com = null;\n char c;\n boolean got_com = false;\n boolean error = false;\n edu.hkust.clap.monitor.Monitor.loopBegin(750);\nfor (int i = 0; i < argv.length; i++) { \nedu.hkust.clap.monitor.Monitor.loopInc(750);\n{\n if (argv[i].charAt(0) != '-' || argv[i].length() != 2) {\n error = true;\n break;\n }\n c = argv[i].charAt(1);\n switch(c) {\n case 'c':\n if (i == argv.length - 1) {\n System.err.println(\"Missing argument for -\" + c);\n error = true;\n break;\n }\n com = argv[++i].toUpperCase() + \"\\0\";\n got_com = true;\n break;\n case 'u':\n if (i == argv.length - 1) {\n System.err.println(\"Missing argument for -\" + c);\n error = true;\n break;\n }\n url = argv[++i];\n break;\n case 'p':\n if (i == argv.length - 1) {\n System.err.println(\"Missing argument for -\" + c);\n error = true;\n break;\n }\n path = argv[++i];\n break;\n case 's':\n if (i == argv.length - 1) {\n System.err.println(\"Missing argument for -\" + c);\n error = true;\n break;\n }\n _host_name = argv[++i];\n break;\n case 'P':\n if (i == argv.length - 1) {\n System.err.println(\"Missing argument for -\" + c);\n error = true;\n break;\n }\n try {\n _port = Integer.parseInt(argv[++i]);\n } catch (Exception e) {\n System.err.println(\"Invalid port number \\\"\" + argv[i] + \"\\\"\");\n _port = -1;\n error = true;\n }\n break;\n case 'v':\n ++_verbose;\n break;\n case 'h':\n usage();\n System.exit(OK);\n case 'V':\n version();\n System.exit(OK);\n default:\n error = true;\n }\n }} \nedu.hkust.clap.monitor.Monitor.loopEnd(750);\n\n if (!got_com) {\n System.err.println(\"No command specified\");\n error = true;\n }\n if (error) {\n usage();\n System.exit(FAILED);\n }\n if (_port == -1) {\n _port = PushCacheFilter.DEFAULT_PORT_NUM;\n }\n if (_host_name.length() == 0) {\n _host_name = DEFAULT_SERVER;\n }\n int ev = 0;\n try {\n switch(PushCacheProtocol.instance().parseCommand(com)) {\n case PushCacheProtocol.ADD:\n add(path, url);\n break;\n case PushCacheProtocol.DEL:\n del(url);\n break;\n case PushCacheProtocol.PRS:\n if (!isPresent(url)) {\n ev = 1;\n }\n break;\n default:\n simpleCommand(com);\n }\n } catch (IllegalArgumentException e) {\n System.err.println(e.getMessage());\n usage();\n ev = FAILED;\n }\n sendBye();\n System.exit(ev);\n }", "public static void main(String[] args) {\n\t\thandler();\r\n\r\n\t}", "private static void process(String... args) throws Exception {\n Deque<String> params = new LinkedList<>(Arrays.asList(args));\n String command = params.pop().toUpperCase(Locale.ROOT);\n valueOf(command).run(params);\n }", "public static void main(String[] args) {\n\t\t\tmeth(args);\r\n\t\t\targument_test:meth(args);\r\n\t}", "protected void handleInput(String input) {}", "java.lang.String getArg();", "public abstract void execute(CommandSender sender, String[] args);", "private static String[] processArgs(String[] args) {\r\n if (args.length == 0) {\r\n args = new String[1];\r\n args[0] = config.getProperty(ConfigParam.inputTrace.name());\r\n System.out.println(\"Args:\"+args[0]);\r\n } else if (args.length > 1) {\r\n System.out.println(\"Usage: [Trace_File]\");\r\n System.out.println(\"Example: ./traces/fdct_trace_without_optimization.txt\");\r\n System.out.println(\"If no arguments are given, the trace file defined in \" +\r\n configFile + \" is used.\");\r\n System.exit(1);\r\n }\r\n\r\n return args;\r\n }", "private void processArgs(String[] args)\n\t{\n\t\tboolean verbose = _verbose.getMatched();\n\n\t\t// disable console echo\n\t\t_writer.println(\"@echo off\");\n\n\t\tfor(int i = 0; i < args.length; ++i)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// try and expand any wildcards not handled by DOS/Windows\n\t\t\t\tString[] xargs = expandArg(args[i]);\n\n\t\t\t\tfor(int j = 0; j < xargs.length; ++j)\n\t\t\t\t{\n\t\t\t\t\tif(verbose)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.err.println(Strings.format(\"fProcessArg\", new Object[] { xargs[j] }));\n\t\t\t\t\t}\n\n\t\t\t\t\tFile pc = new File(xargs[j]);\n\t\t\t\t\t_writer.print(\"set CLASSPATH=%CLASSPATH%;\");\n\t\t\t\t\t_writer.println(pc.getCanonicalPath());\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(IOException e)\n\t\t\t{\n\t\t\t\tSystem.err.println(Strings.format(\"fGeneralError\", new Object[] { e.getMessage() }));\n\t\t\t\t\n\t\t\t\tif(verbose)\n\t\t\t\t{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\tSystem.exit(-1);\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n if(args==null||args.length == 0 || args[0] == null)\n {\n notRecognized();\n return;\n }\n else\n {\n if(args[0].equals(\"update\"))\n {\n update();\n return;\n }\n else if(args[0].equals(\"help\")) \n {\n help();\n return;\n }\n else if(args[0].equals(\"access\")&&args.length>=2)\n {\n access(args[1]);\n return;\n }\n else\n {\n notRecognized();\n }\n }\n }", "private void handleCommandLineArgs(final String[] args) {\n if (args.length == 1) {\n final String value;\n if (args[0].startsWith(ToolArguments.MAP_FOLDER)) {\n value = getValue(args[0]);\n } else {\n value = args[0];\n }\n final File mapFolder = new File(value);\n if (mapFolder.exists()) {\n mapFolderLocation = mapFolder;\n } else {\n log.info(\"Could not find directory: \" + value);\n }\n } else if (args.length > 1) {\n log.info(\"Only argument allowed is the map directory.\");\n }\n // might be set by -D\n if (mapFolderLocation == null || mapFolderLocation.length() < 1) {\n final String value = System.getProperty(ToolArguments.MAP_FOLDER);\n if (value != null && value.length() > 0) {\n final File mapFolder = new File(value);\n if (mapFolder.exists()) {\n mapFolderLocation = mapFolder;\n } else {\n log.info(\"Could not find directory: \" + value);\n }\n }\n }\n }", "protected void doExecute(String[] arguments, ContextStatus contextStatus) {\n // no action to do\n }", "public Map<String, Object> processArgs(String[] args)\n {\n for (int ii=0; ii<args.length; ii++) {\n String token = args[ii];\n char firstC = token.charAt(0);\n if (firstC != '-' && firstC != '+') {\n return null;\n }\n // look up the token\n token = token.substring(1);\n String type = _meta.get(token);\n if (type == null) {\n return null;\n }\n\n // most types expect a following token - check\n Object argument = null;\n if (StringArg.equals(type) || ListArg.equals(type) || IntegerArg.equals(type)) {\n if (args.length < ii+2) {\n return null;\n }\n if (firstC != '-') {\n // these types all expect a - in front of the token\n return null;\n }\n argument = args[ii+1];\n ii++;\n }\n if (DoubleListArg.equals(type)) {\n if (args.length < ii+3) {\n return null;\n }\n if (firstC != '-') {\n return null;\n }\n String[] a2 = new String[2];\n a2[0] = args[ii+1];\n a2[1] = args[ii+2];\n argument = a2;\n ii += 2;\n }\n\n Object old;\n if (StringArg.equals(type)) {\n old = _result.put(token, argument);\n if (old != null) {\n return null;\n }\n }\n else if (ListArg.equals(type)) {\n List<String> oldList = (List<String>)_result.get(token);\n if (oldList == null) {\n oldList = new ArrayList<String>();\n _result.put(token, oldList);\n }\n oldList.add((String)argument);\n }\n else if (DoubleListArg.equals(type)) {\n List<String[]> oldList = (List<String[]>)_result.get(token);\n if (oldList == null) {\n oldList = new ArrayList<String[]>();\n _result.put(token, oldList);\n }\n oldList.add((String[])argument);\n }\n else if (IntegerArg.equals(type)) {\n Integer val = Integer.parseInt((String)argument);\n old = _result.put(token, val);\n if (old != null) {\n return null;\n }\n }\n else if (FlagArgFalse.equals(type) || FlagArgTrue.equals(type)) {\n // note that we always have a default value for flag args\n Boolean val = (firstC == '-');\n _result.put(token, val);\n }\n }\n\n return _result;\n }", "private int handleOptions(String[] args) {\r\n\r\n int status = 0;\r\n\r\n if ((args == null) || (args.length == 0)) { return status; }\r\n\r\n for (int i = 0; i < args.length; i++) {\r\n if (status != 0) { return status; }\r\n\r\n if (args[i].equals(\"-h\")) {\r\n displayUsage();\r\n status = 1;\r\n } else if (args[i].equals(\"-d\") || args[i].equals(\"-discourse\")) {\r\n if (++i < args.length) {\r\n try {\r\n this.discourseId = Long.parseLong(args[i]);\r\n if (discourseId < 0) {\r\n logger.error(\"Invalid discourse id specified: \" + args[i]);\r\n status = -1;\r\n }\r\n } catch (Exception exception) {\r\n logger.error(\"Error while trying to parse discourse id. \"\r\n + \"Please check the parameter for accuracy.\");\r\n throw new IllegalArgumentException(\"Invalid discourse id specified.\");\r\n }\r\n } else {\r\n logger.error(\"A discourse id must be specified with the -discourse argument\");\r\n displayUsage();\r\n status = -1;\r\n }\r\n } else if (args[i].equals(\"-e\") || args[i].equals(\"-email\")) {\r\n setSendEmailFlag(true);\r\n if (++i < args.length) {\r\n setEmailAddress(args[i]);\r\n } else {\r\n logger.error(\"An email address must be specified with this argument\");\r\n displayUsage();\r\n status = -1;\r\n }\r\n } else if (args[i].equals(\"-b\") || args[i].equals(\"-batchSize\")) {\r\n if (++i < args.length) {\r\n try {\r\n this.batchSize = Integer.parseInt(args[i]);\r\n if (batchSize <= 0) {\r\n logger.error(\"The batch size must be greater than zero.\");\r\n displayUsage();\r\n status = -1;\r\n }\r\n } catch (NumberFormatException exception) {\r\n logger.error(\"Error while trying to parse batch size: \" + args[i]);\r\n throw new IllegalArgumentException(\"Invalid batch size specified.\");\r\n }\r\n } else {\r\n logger.error(\"A batch size must be specified with the -batchSize argument\");\r\n displayUsage();\r\n status = -1;\r\n }\r\n } else if (args[i].equals(\"-p\") || args[i].equals(\"-project\")) {\r\n if (++i < args.length) {\r\n try {\r\n this.projectId = Integer.parseInt(args[i]);\r\n if (projectId < 0) {\r\n logger.error(\"Invalid project id specified: \" + args[i]);\r\n status = -1;\r\n }\r\n } catch (Exception exception) {\r\n logger.error(\"Error while trying to parse project id. \"\r\n + \"Please check the parameter for accuracy.\");\r\n throw new IllegalArgumentException(\"Invalid project id specified.\");\r\n }\r\n } else {\r\n logger.error(\"A project id must be specified with the -project argument\");\r\n displayUsage();\r\n status = -1;\r\n }\r\n }\r\n }\r\n\r\n return status;\r\n }", "public static void main(String[] args) {\n EquationManipulator manipulator = new EquationManipulator();\n \n if (args.length == 3) {\n // arguments were passed in from the command line\n System.out.println(\"It looks like you passed in some arguments. Let me fetch those for you.\");\n checkPassedInArguments(args, manipulator);\n } else if (args.length != 0) {\n // User passed in an incorrect number of arguments\n printErrorMessage();\n handleUserInput(manipulator);\n } else { \n // User did not pass in any arguments\n handleUserInput(manipulator);\n }\n\n }", "void processCommandLineArguments(String[] args) throws ConfigurationException;", "public static void main(String[] args) {\nSystem.out.println(\"you passed...\"+args.length);\r\nfor(int i=0;i<args.length;i++)\r\n{\r\n\tSystem.out.println(\"data is\"+args[i]);\r\n}\r\n\t}", "public void processArguments(PrintWriter writer, String[] args) {\n TableMetaData tbMetaData = new TableMetaData();\n int karg = evaluateOptions(args, config, tbMetaData);\n // System.err.println(\"main action=\" + mainAction + \", argsSql=\" + argsSql);\n process(writer, karg, args, config, tbMetaData);\n }", "protected void parseArgs(String[] args) throws BuildException {\n for (int i = 0; i != args.length; ++i) {\n String arg = args[i];\n boolean parsed = parseArg(arg, args, i);\n if (!parsed) {\n String message = \"Unknown option: \" + arg;\n usage(message, System.out);\n throw new BuildException(message);\n }\n }\n }", "protected abstract Value execute(final State state, final HashMap<ParameterDef, Value> args) throws SetlException;", "Object[] args();", "public abstract String run(String args);", "@Override\n\tpublic void traverseArg(UniArg node) {\n\t}", "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}", "protected abstract void go(CommandLine line) throws Exception;", "public static void main(String... args) {\n int status;\n try {\n process(args);\n status = 0;\n } catch (IllegalArgumentException | NoSuchElementException ex) {\n printUsage(ex);\n status = 1;\n } catch (NoSuchMethodException ex) {\n log.error(\"Method not found \", ex);\n status = 2;\n } catch (Throwable ex) {\n ex.printStackTrace();\n status = 3;\n }\n System.exit(status);\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}", "@Override\n\tpublic void entry(Object... params) {\n\n\t}", "private String parseArgs(String args[])\n {\n String fpath = null;\n \n for (String arg : args)\n {\n if (arg.startsWith(\"-\"))\n {\n // TODO: maybe add something here.\n }\n else // expect a filename.\n {\n fpath = arg;\n }\n }\n \n return fpath;\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 }", "@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 }", "private static void parseArgs (String[] args) {\n\t\tint n = args.length;\n\t\tif (n != 4) {\n\t\t\tSystem.out.println(\"Usage: BuildTranslations in dbname username password\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tinPath = args[0];\n\t\tdbname = args[1];\n\t\tusername = args[2];\n\t\tpassword = args[3];\n\t}", "public void processArgs(final String args[]) throws OptionsException {\n\t\tOptionContainer option = null;\n\t\tint quant = -1;\n\t\tint qcount = 0;\n\t\tboolean moreData = false;\n\t\tfor (int i = 0; i < args.length; i++) {\n\t\t\tif (option == null) {\n\t\t\t\tif (args[i].charAt(0) != '-')\n\t\t\t\t\tthrow new OptionsException(\"Unexpected value: \" + args[i]);\n\n\t\t\t\t// see what kind of argument we have\n\t\t\t\tif (args[i].length() == 1)\n\t\t\t\t\tthrow new OptionsException(\"Illegal argument: '-'\");\n\n\t\t\t\tif (args[i].charAt(1) == '-') {\n\t\t\t\t\t// we have a long argument\n\t\t\t\t\t// since we don't accept inline values we can take\n\t\t\t\t\t// everything left in the string as argument, unless\n\t\t\t\t\t// there is a = in there...\n\t\t\t\t\tfinal String tmp = args[i].substring(2);\n\t\t\t\t\tfinal int pos = tmp.indexOf('=');\n\t\t\t\t\tif (pos == -1) {\n\t\t\t\t\t\toption = opts.get(tmp);\n\t\t\t\t\t\tmoreData = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\toption = opts.get(tmp.substring(0, pos));\n\t\t\t\t\t\t// modify the option a bit so the code below\n\t\t\t\t\t\t// handles the moreData correctly\n\t\t\t\t\t\targs[i] = \"-?\" + tmp.substring(pos + 1);\n\t\t\t\t\t\tmoreData = true;\n\t\t\t\t\t}\n\t\t\t\t} else if (args[i].charAt(1) == 'X') {\n\t\t\t\t\t// extra argument, same as long argument\n\t\t\t\t\tfinal String tmp = args[i].substring(1);\n\t\t\t\t\tfinal int pos = tmp.indexOf('=');\n\t\t\t\t\tif (pos == -1) {\n\t\t\t\t\t\toption = opts.get(tmp);\n\t\t\t\t\t\tmoreData = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\toption = opts.get(tmp.substring(0, pos));\n\t\t\t\t\t\t// modify the option a bit so the code below\n\t\t\t\t\t\t// handles the moreData correctly\n\t\t\t\t\t\targs[i] = \"-?\" + tmp.substring(pos + 1);\n\t\t\t\t\t\tmoreData = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// single char argument\n\t\t\t\t\toption = opts.get(\"\" + args[i].charAt(1));\n\t\t\t\t\t// is there more data left in the argument?\n\t\t\t\t\tmoreData = args[i].length() > 2 ? true : false;\n\t\t\t\t}\n\n\t\t\t\tif (option != null) {\n\t\t\t\t\t// make sure we overwrite previously set arguments\n\t\t\t\t\toption.resetArguments();\n\t\t\t\t\tfinal int card = option.getCardinality();\n\t\t\t\t\tif (card == CAR_ONE) {\n\t\t\t\t\t\tif (moreData) {\n\t\t\t\t\t\t\toption.addArgument(args[i].substring(2));\n\t\t\t\t\t\t\toption = null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tquant = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (card == CAR_ZERO_ONE) {\n\t\t\t\t\t\toption.setPresent();\n\t\t\t\t\t\tqcount = 1;\n\t\t\t\t\t\tquant = 2;\n\t\t\t\t\t\tif (moreData) {\n\t\t\t\t\t\t\toption.addArgument(args[i].substring(2));\n\t\t\t\t\t\t\toption = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (card == CAR_ZERO_MANY) {\n\t\t\t\t\t\toption.setPresent();\n\t\t\t\t\t\tqcount = 1;\n\t\t\t\t\t\tquant = -1;\n\t\t\t\t\t\tif (moreData) {\n\t\t\t\t\t\t\toption.addArgument(args[i].substring(2));\n\t\t\t\t\t\t\tqcount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (card == CAR_ZERO) {\n\t\t\t\t\t\toption.setPresent();\n\t\t\t\t\t\toption = null;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow new OptionsException(\"Unknown argument: \" + args[i]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// store the `value'\n\t\t\t\toption.addArgument(args[i]);\n\t\t\t\tif (++qcount == quant) {\n\t\t\t\t\tquant = 0;\n\t\t\t\t\tqcount = 0;\n\t\t\t\t\toption = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void readArgs(String[] args)\n {\n for (int i = 0; i < args.length; i++)\n {\n open(args[i]);\n }\n setTitle();\n }", "void setArguments(String arguments);", "protected void parseArgs(String args[]) throws IllegalArgumentException, NumberFormatException\n\t{\n\t\tif(args.length != 1)\n\t\t{\n\t\t\tthrow new IllegalArgumentException(this.getClass().getName()+\n\t\t\t\t\" <temperature (degrees C)>\");\n\t\t}\n\t\ttemperature = Double.parseDouble(args[0]);\n\t}", "@Override\n protected void handleCommand(String[] args) throws CommandException, IOException, JSONException, UnexpectedHttpStatusCodeException {\n if (args.length == 0) {\n this.displayUsage();\n return;\n }\n\n // verify arguments count\n checkArgumentsCount(args, 1);\n\n // parse arguments\n Date date = parseStringToDate(args[0]);\n\n // verify arguments\n checkDate(date);\n\n // create analyser\n JSONAnalyser analyser = new JSONAnalyser(\n new DataProvider<JSONObject>(\n new JSONSingleFetcher(\n new NBPConnector(),\n String.format(\"exchangerates/tables/c/%tF\", date),\n \"/0/rates\"\n )\n )\n );\n\n // get value\n JSONObject lowest = analyser.findTheSmallestNumber(jsonObject -> jsonObject.getNumber(\"bid\"));\n\n // display\n System.out.format(\"The currency with the lowest buy price on day %tF was %s worth %s%n\",\n date,\n ANSIColors.highlite(lowest.getString(\"code\").toUpperCase()),\n ANSIColors.highlite(lowest.getNumber(\"bid\") + \" PLN\")\n );\n\n }", "protected void readArguments(Bundle bundle) {\n\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 abstract void exec(CommandSender sender, String[] args);", "public PluginResult performAction(Map<String, String> args) {\n\t\tFile file = null;\n\t\ttry {\n\t\t\tSystem.out.println(\"FilePath : \"+args.get(AttPluginConstants.ARG_FILEPATH));\n\t\t\tfile = AttPluginUtils.getFile(args.get(AttPluginConstants.ARG_FILEPATH));\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn new PluginResult(PluginResult.Status.ERROR, AttPluginUtils.prepareMessage(AttPluginConstants.ERR_FILE_NA_CODE, AttPluginConstants.ERR_FILE_NA_MSG));\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\treturn new PluginResult(PluginResult.Status.ERROR, AttPluginUtils.prepareMessage(AttPluginConstants.ERR_PROCESS_AUDIO_CODE, AttPluginConstants.ERR_PROCESS_AUDIO_MSG));\n\t\t}\n\n\t\t// Http Processing\n\t\tDefaultHttpClient httpclient = new DefaultHttpClient();\n\n\t\tboolean isChunked=false;\n\t\tString transferEncoding=args.get(AttPluginConstants.ARG_HEADER_TRANSFER_ENCODING);\n\t\tif(transferEncoding!=null && transferEncoding.equalsIgnoreCase(AttPluginConstants.VAL_TRANSFER_ENCODING_CHUNKED))\n\t\t{\n\t\t\tisChunked=true;\n\t\t}\n\t\t\n\t\tHttpPost httppost = AttPluginUtils.prepareRequest(file, args.get(AttPluginConstants.ARG_URL),isChunked);\n\n\t\thttppost.addHeader(\"Authorization\", args.get(AttPluginConstants.ARG_TOKEN));\n\t\thttppost.addHeader(\"Accept\", args.get(AttPluginConstants.ARG_HEADER_ACCEPT));\n\n\t\tif (args.containsKey(AttPluginConstants.ARG_HEADER_CONTENT_TYPE)) {\n\t\t\thttppost.addHeader(\"Content-Type\", args.get(AttPluginConstants.ARG_HEADER_CONTENT_TYPE));\n\t\t}\n\n\t\tif (args.containsKey(AttPluginConstants.ARG_HEADER_XSPEECH_CONTEXT)) {\n\t\t\thttppost.addHeader(\"X-SpeechContext\", args.get(AttPluginConstants.ARG_HEADER_XSPEECH_CONTEXT));\n\t\t}\n\t\t\n\t\tif(args.get(AttPluginConstants.ARG_HEADER_XSPEECH_CONTEXT).equalsIgnoreCase(\"Generic\")){\n\t\t\tif (args.containsKey(AttPluginConstants.ARG_CONTENT_LANGUAGE)) {\n\t\t\t\thttppost.addHeader(\"Content-Language\", args.get(AttPluginConstants.ARG_CONTENT_LANGUAGE));\n\t\t\t}\n\t\t}else{\n\t\t\tif(args.containsKey(AttPluginConstants.ARG_XARG)){\n\t\t\t\thttppost.addHeader(\"X-Arg\", args.get(AttPluginConstants.ARG_XARG));\n\t\t\t}\n\t\t}\n\n\t\tif (args.containsKey(AttPluginConstants.ARG_HEADER_CONTENT_LENGTH)) {\n\t\t\thttppost.addHeader(\"Content-Length\", args.get(AttPluginConstants.ARG_HEADER_CONTENT_LENGTH));\n\t\t}\n\n\t\tif (args.containsKey(AttPluginConstants.ARG_HEADER_TRANSFER_ENCODING)) {\n\t\t\thttppost.addHeader(\"Transfer-Encoding\", args.get(AttPluginConstants.ARG_HEADER_TRANSFER_ENCODING));\n\t\t}\n\t\t\n\t\tString result = null;\n\t\ttry {\n\t\t\tresult = AttPluginUtils.processResponse(httpclient.execute(httppost));\n\t\t\tSystem.out.println(\"result : \"+result);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tString message = null;\n\t\t\tString code = null;\n\t\t\tif (e.equals(AttPluginConstants.ERR_INV_STATUS_MSG)) {\n\t\t\t\tcode = AttPluginConstants.ERR_INV_STATUS_CODE;\n\t\t\t\tmessage = AttPluginConstants.ERR_INV_STATUS_MSG;\n\t\t\t} else {\n\t\t\t\tcode = AttPluginConstants.ERR_PROCESS_REQ_CODE;\n\t\t\t\tmessage = AttPluginConstants.ERR_PROCESS_REQ_MSG;\n\t\t\t}\n\t\t\treturn new PluginResult(PluginResult.Status.ERROR, AttPluginUtils.prepareMessage(code, message));\n\t\t} finally {\n\t\t\targs.clear();\n\t\t\targs = null;\n\t\t}\n\n\t\treturn new PluginResult(PluginResult.Status.OK, result);\n\t}", "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 }", "public static void main(String[] args) {\n\t\tstringhandler obj=new stringhandler();\r\n\t\tobj.input();\r\n\t\tobj.display();\r\n\r\n\t}", "void visitArgument(Argument argument);", "public static void main(String[]args) {\n\t\n\t \n\tArgsHandler handler = new ArgsHandler(args);\n if (!handler.empty()) {\n handler.execute();\n }\n \n final int exit = 0;\n final int setValues = 1;\n final int getValues = 2;\n final int execute2 = 3;\n final int printResult = 4;\n String word = null;\n \n /**\n * Our dialog menu with checking of input argumet's of program \n */\n do {\n UI.mainMenu();\n UI.enterChoice();\n switch (UI.getChoice()) {\n case exit:\n if (ArgsHandler.isDebug()) {\n System.out.println(\"\\nYou chosen 0. Exiting...\");\n System.out.format(\"%n############################################################### DEBUG #############################################################\");\n }\n break;\n case setValues:\n if (ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n System.out.println(\"\\nYou chosen 1. Setting values...\");\n }\n word = UI.enterValues();\n break;\n case getValues:\n if (ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n System.out.println(\"\\nYou chosen 2. Getting values...\");\n }\n if (word != null ) {\n UI.printText(word);\n } else {\n System.out.format(\"%nFirst you need to add values.\");\n }\n break; \n case execute2:\n if (ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n System.out.println(\"\\nYou chosen 3. Executing task...\");\n }\n if (word != null) {\n \t final String []lines = NewHelper.DivString(word);\n \t System.out.println(\"\\nTask done...\");\n \t if (ArgsHandler.isDebug()) {\n \t System.out.format(\"%n############################################################### DEBUG #############################################################\");\n \t }\n } else {\n System.out.format(\"%nFirst you need to add values.\");\n }\n break;\n case printResult:\n if (ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n System.out.format(\"%nYou chosen 4. \"\n + \"Printing out result...%n\");\n }\n if (word != null) {\n \tfinal String[] lines2 = NewHelper.DivString(word);\n \tfor (final String line2 : lines2) {\n NewHelper.printSymbols(line2);\n NewHelper.printSymbolNumbers(line2);\n \t}\n \tif(ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n } \n \telse {\n System.out.format(\"%nFirst you need to add values.\"); \n }\n break;\n }\n default:\n System.out.println(\"\\nEnter correct number.\");\n }\n } while (UI.getChoice() != 0);\n}", "public CommandArguments parse(String[] args) {\n ErrorSupport command = new ErrorSupport();\n command.checkLength(args);\n\n //parsing arguments\n CommandArguments arguments = new CommandArguments();\n for (int i = 0; i < args.length; i++) {\n if ((i == args.length - 1) && !args[i].equals(\"--help\")) {\n throw new IllegalArgumentException(\"Incorrect argument, --help for more information about app syntax\");\n }\n switch (args[i]) {\n case (\"--help\"):\n System.out.println(\"\\nHELP MENU \\nAvailable options and arguments: \\n \\t--latitude x \\t-enter latitude coordinate \\n \\t--longitude x\\t-enter longitude coordinate \\n \\t--sensorid x \\t-enter sensor's Id \\n \\t--apikey x \\t\\t-enter API key \\n \\t--history x \\t-enter number of hours to display from history data\\n\");\n System.exit(0);\n case (\"--latitude\"):\n i++;\n arguments.setLatitude(command.checkIsDouble(args[i]));\n break;\n case (\"--longitude\"):\n i++;\n arguments.setLongitude(command.checkIsDouble(args[i]));\n break;\n case (\"--sensorid\"):\n i++;\n arguments.setSensorId(command.checkIsInt(args[i]));\n break;\n case (\"--apikey\"):\n i++;\n arguments.setApiKey(command.checkApiKey(args[i]));\n break;\n case (\"--history\"):\n i++;\n arguments.setHistory(command.checkIsInt(args[i]));\n break;\n default:\n throw new IllegalArgumentException(\"Incorrect option, --help for more information about app syntax\");\n }\n }\n\n //checking environment API_KEY if there was no apikey in command line entered\n if (!arguments.hasApiKey() && System.getenv(\"API_KEY\") == null) {\n throw new IllegalArgumentException(\"No API Key found, check if you have entered the correct key or if there is a suitable environment variable ( API_KEY ), --help for more information about app syntax\");\n } else if (!arguments.hasApiKey()) {\n arguments.setApiKey(command.checkApiKey(System.getenv(\"API_KEY\")));\n }\n return arguments;\n }", "public static void handleTerminalArguments(String[] args) {\n // Used to parse command line\n CommandLineParser parser = new DefaultParser();\n\n // Used to display help and errors from the parsing\n HelpFormatter formatter = new HelpFormatter();\n\n // Options\n Options options = new Options();\n\n Option helpOption = new Option(\"h\", \"help\", false, \"Show this help message \");\n Option portOption = new Option(\"p\", \"port\", true, \"Port for the server, defaults to 2000\");\n Option clientOption = new Option(\"c\", \"client\", false, \"Start client\");\n \n options.addOption(helpOption);\n options.addOption(portOption);\n options.addOption(clientOption);\n \n try {\n CommandLine commands = parser.parse(options, args);\n\n // display help\n if (commands.hasOption(\"help\")) {\n formatter.printHelp(\"GuessingGame\", options);\n System.exit(1);\n }\n \n // Handle client\n if (commands.hasOption(\"client\")) {\n ClientGUI.run();\n } else {\n // Handle server\n if (commands.hasOption(\"port\")) {\n if (!commands.getOptionValue(\"port\").matches(\"[0-9]+\")) {\n throw new ParseException(\"Port must be a number\");\n }\n int portNumber = Integer.parseInt(commands.getOptionValue(\"port\"));\n runServer(portNumber);\n } else {\n runServer(DEFAULT_PORT);\n }\n }\n \n } catch (ParseException e) {\n // Display error if there's missing parameters\n // or some parameters don't match.\n System.out.println(e.getMessage() + \"\\n\");\n formatter.printHelp(\"GuessingGame\", options);\n System.exit(1);\n }\n }", "public void handleArg(String arg) {\n\ttry {\n\t sound = new URL(parent.getDocumentBase(), arg);\n\t} catch (MalformedURLException e) {\n\t sound = null;\n\t}\n\thasPlayed = false;\n }", "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 }", "@Override\n public int getNumberArguments() {\n return 1;\n }", "private static void parseCommandLine(String[] args) throws Exception {\n int i;\n // iterate over all options (arguments starting with '-')\n for (i = 0; i < args.length && args[i].charAt(0) == '-'; i++) {\n switch (args[i].charAt(1)) {\n // -a type = write out annotations of type a.\n case 'a':\n if (annotTypesToWrite == null)\n annotTypesToWrite = new ArrayList();\n annotTypesToWrite.add(args[++i]);\n break;\n\n // -g gappFile = path to the saved application\n case 'g':\n gappFile = new File(args[++i]);\n break;\n\n // -e encoding = character encoding for documents\n case 'e':\n encoding = args[++i];\n break;\n\n default:\n System.err.println(\"Unrecognised option \" + args[i]);\n usage();\n }\n }\n\n // set index of the first non-option argument, which we take as the first\n // file to process\n firstFile = i;\n\n // sanity check other arguments\n if (gappFile == null) {\n System.err.println(\"No .gapp file specified\");\n usage();\n }\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 static void main(String[] args) {\n stringhandler obj=new stringhandler();\r\n obj.transform(\"Greety\");\r\n }", "Object[] getArguments();" ]
[ "0.7407294", "0.7329224", "0.71868765", "0.7124378", "0.7124378", "0.6884152", "0.6833146", "0.66601396", "0.6488895", "0.64847136", "0.6453911", "0.64322054", "0.64025956", "0.63713485", "0.6259709", "0.6240963", "0.6238977", "0.62381375", "0.62313616", "0.621386", "0.6208448", "0.6206697", "0.6196056", "0.61828375", "0.61122495", "0.6105275", "0.60985506", "0.60665864", "0.60626304", "0.6051329", "0.59759223", "0.5963086", "0.59538156", "0.5953114", "0.5952828", "0.59480745", "0.593744", "0.5936894", "0.5921302", "0.59194547", "0.59194446", "0.59158313", "0.59145784", "0.591363", "0.5906837", "0.590639", "0.5865178", "0.58641994", "0.5859345", "0.5856995", "0.58517474", "0.58393097", "0.5828048", "0.5821997", "0.57911855", "0.5789981", "0.5786936", "0.5775057", "0.5763109", "0.5749881", "0.5735932", "0.5727718", "0.5727718", "0.5727718", "0.5727718", "0.5727718", "0.5727718", "0.5727718", "0.5727718", "0.5727718", "0.5727718", "0.5727718", "0.5727718", "0.5727718", "0.5727718", "0.5727718", "0.5727718", "0.5727718", "0.57210225", "0.57147264", "0.5705136", "0.569763", "0.56956196", "0.56874704", "0.5687311", "0.56821114", "0.56727135", "0.5667918", "0.56622607", "0.5659849", "0.56541383", "0.5650509", "0.5641909", "0.5638342", "0.5631179", "0.56297773", "0.5627249", "0.5622368", "0.5606325", "0.56032544", "0.560116" ]
0.0
-1
Handles passed in arguments
private static void handleArguments(String[] args) { if ( args.length > 0 && args[0].contains("--help")) { System.err.println (menuString); System.err.println("Example queue name are: *"); System.exit(0); } else { int i = 0; String arg; while (i < args.length && args[i].startsWith("--")) { arg = args[i++]; if (arg.contains(ECS_HOSTS_CONFIG_ARGUMENT)) { if (i < args.length) { ecsHosts = args[i++]; } else { System.err.println(ECS_HOSTS_CONFIG_ARGUMENT + " requires hosts value(s)"); System.exit(0); } } else if (arg.contains(ECS_MGMT_ACCESS_KEY_CONFIG_ARGUMENT)) { if (i < args.length) { ecsMgmtAccessKey = args[i++]; } else { System.err.println(ECS_MGMT_ACCESS_KEY_CONFIG_ARGUMENT + " requires an access-key value"); System.exit(0); } } else if (arg.equals(ECS_MGMT_SECRET_KEY_CONFIG_ARGUMENT)) { if (i < args.length) { ecsMgmtSecretKey = args[i++]; } else { System.err.println(ECS_MGMT_SECRET_KEY_CONFIG_ARGUMENT + " requires a secret-key value"); System.exit(0); } } else if (arg.equals(ECS_MGMT_PORT_CONFIG_ARGUMENT)) { if (i < args.length) { ecsMgmtPort = Integer.valueOf(args[i++]); } else { System.err.println(ECS_MGMT_PORT_CONFIG_ARGUMENT + " requires a mgmt port value"); System.exit(0); } } else if (arg.equals(ECS_ALT_MGMT_PORT_CONFIG_ARGUMENT)) { if (i < args.length) { ecsAlternativeMgmtPort = Integer.valueOf(args[i++]); } else { System.err.println(ECS_ALT_MGMT_PORT_CONFIG_ARGUMENT + " requires an alternative mgmt port value"); System.exit(0); } } else if (arg.equals(ECS_COLLECT_MODIFIED_OBJECT_CONFIG_ARGUMENT)) { if (i < args.length) { relativeObjectModifiedSinceOption = true; objectModifiedSinceNoOfDays = Integer.valueOf(args[i++]); } else { System.err.println(ECS_COLLECT_MODIFIED_OBJECT_CONFIG_ARGUMENT + " requires a specified number of days value"); System.exit(0); } } else if (arg.equals(ECS_COLLECT_DATA_CONFIG_ARGUMENT)) { if (i < args.length) { collectData = args[i++]; } else { System.err.println(ECS_COLLECT_DATA_CONFIG_ARGUMENT + " requires a collect data value"); System.exit(0); } } else if (arg.contains(ELASTIC_HOSTS_CONFIG_ARGUMENT)) { if (i < args.length) { elasticHosts = args[i++]; } else { System.err.println(ELASTIC_HOSTS_CONFIG_ARGUMENT + " requires hosts value(s)"); System.exit(0); } } else if (arg.equals(ELASTIC_PORT_CONFIG_ARGUMENT)) { if (i < args.length) { elasticPort = Integer.valueOf(args[i++]); } else { System.err.println(ELASTIC_PORT_CONFIG_ARGUMENT + " requires a port value"); System.exit(0); } } else if (arg.equals(ELASTIC_CLUSTER_CONFIG_ARGUMENT)) { if (i < args.length) { elasticCluster = args[i++]; } else { System.err.println( ELASTIC_CLUSTER_CONFIG_ARGUMENT + " requires a cluster value"); System.exit(0); } } else if (arg.equals(ECS_COLLECTION_DAY_SHIFT_ARGUMENT)) { if (i < args.length) { relativeDayShift = Integer.valueOf(args[i++]); } else { System.err.println(ECS_COLLECTION_DAY_SHIFT_ARGUMENT + " requires a day shift value port value"); System.exit(0); } } else if (arg.equals( ECS_INIT_INDEXES_ONLY_CONFIG_ARGUMENT)) { initIndexesOnlyOption = true; } else if (arg.equals( XPACK_SECURITY_USER_ARG)) { if (i < args.length) { xpackUser = args[i++]; } else { System.err.println( XPACK_SECURITY_USER_ARG + " requires a value"); System.exit(0); } } else if (arg.equals( XPACK_SECURITY_USER_PASSWORD_ARG)) { if (i < args.length) { xpackPassword = args[i++]; } else { System.err.println( XPACK_SECURITY_USER_PASSWORD_ARG + " requires a value"); System.exit(0); } } else if (arg.equals( XPACK_SSL_KEY_ARG)) { if (i < args.length) { xpackSslKey = args[i++]; } else { System.err.println( XPACK_SSL_KEY_ARG + " requires a value"); System.exit(0); } } else if (arg.equals( XPACK_SSL_CERTIFICATE_ARG)) { if (i < args.length) { xpackSslCertificate = args[i++]; } else { System.err.println( XPACK_SSL_CERTIFICATE_ARG + " requires a value"); System.exit(0); } } else if (arg.equals( XPACK_SSL_CERTIFICATE_AUTH_ARG)) { if (i < args.length) { xpackSsslCertificateAuth = args[i++]; } else { System.err.println( XPACK_SSL_CERTIFICATE_AUTH_ARG + " requires a value"); System.exit(0); } } else if (arg.equals(ECS_COLLECT_OBJECT_DATA_NAMESPACE_ARGUMENT)) { if (i < args.length) { objectNamespace = args[i++]; } else { System.err.println(ECS_COLLECT_OBJECT_DATA_NAMESPACE_ARGUMENT + " requires namespace"); System.exit(0); } } else if (arg.equals(ECS_COLLECT_OBJECT_DATA_NAME_ARGUMENT)) { if (i < args.length) { bucketName = args[i++]; } else { System.err.println(ECS_COLLECT_OBJECT_DATA_NAME_ARGUMENT + " requires bucket"); System.exit(0); } } else { System.err.println("Unrecognized option: " + arg); System.err.println(menuString); System.exit(0); } } if (bucketName!=null) { if (objectNamespace==null || "".equals(objectNamespace)) { System.err.println(ECS_COLLECT_OBJECT_DATA_NAMESPACE_ARGUMENT + " requires namespace, " + ECS_COLLECT_OBJECT_DATA_NAME_ARGUMENT + " requires bucket"); System.exit(0); } } } if(initIndexesOnlyOption) { // Check hosts if(elasticHosts.isEmpty()) { System.err.println("Missing Elastic hostname use " + ELASTIC_HOSTS_CONFIG_ARGUMENT + "<host1, host2> to specify a value" ); return; } } else { // Check hosts if(ecsHosts.isEmpty()) { System.err.println("Missing ECS hostname use " + ECS_HOSTS_CONFIG_ARGUMENT + "<host1, host2> to specify a value" ); return; } // management access/user key if(ecsMgmtAccessKey.isEmpty()) { System.err.println("Missing managment access key use" + ECS_MGMT_ACCESS_KEY_CONFIG_ARGUMENT + "<admin-username> to specify a value" ); return; } // management access/user key if(ecsMgmtSecretKey.isEmpty()) { System.err.println("Missing management secret key use " + ECS_MGMT_SECRET_KEY_CONFIG_ARGUMENT + "<admin-password> to specify a value" ); return; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void handleArgument(ArrayList<String> argument) {\n\t\t\n\t}", "protected abstract void handle(Object... params);", "@Override\n public void doExeception(Map<String, Object> args)\n {\n \n }", "@Override\n public void doExeception(Map<String, Object> args)\n {\n \n }", "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 }", "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}", "void doHandle()\n\t{\n\t\t// should be at least on arg\n\t\tif (!hasMoreTokens())\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"argumentRequired\")); //$NON-NLS-1$\n\t\telse\n\t\t{\n\t\t\t// poor man's fix for supporting 'all' option\n\t\t\tString faultName = nextToken();\n\t\t\tObject[] names = new Object[] { faultName };\n\n\t\t\t// replace the single name with all of them\n\t\t\tif (faultName.equalsIgnoreCase(\"all\")) //$NON-NLS-1$\n\t\t\t\tnames = m_faultTable.names();\n\n\t\t\t// make sure we know about at least one\n\t\t if (!m_faultTable.exists((String)names[0]))\n\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedFault\")); //$NON-NLS-1$\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (!hasMoreTokens())\n\t\t\t\t\tlistFault((String)names[0]);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tString action = null;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\twhile(hasMoreTokens())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taction = nextToken();\n\t\t\t\t\t\t\tfor(int i=0; i<names.length; i++)\n\t\t\t\t\t\t\t\tm_faultTable.action((String)names[i], action);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(IllegalArgumentException iae)\n\t\t\t\t\t{\n\t\t\t\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\t\t\t\targs.put(\"action\", action); //$NON-NLS-1$\n\t\t\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedAction\", args)); //$NON-NLS-1$\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void handleArguments(String[] args, EquationManipulator manipulator) {\n \n // Grab the arguments\n Fraction firstFraction = manipulator.getFraction(args[0]);\n String operator = args[1];\n Fraction secondFraction = manipulator.getFraction(args[2]);\n \n // Perform the operation and get the results\n Fraction result = manipulator.performOperation(firstFraction, secondFraction, operator);\n \n // Report the result to the user\n printResult(result);\n }", "protected abstract void parseArgs() throws IOException;", "public Object HandleMethod(Object... args)\r\n {\r\n //throw new Exception();\r\n \treturn null;\r\n }", "@Override\n public void process(Object[] args) throws HiveException {\n \n }", "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}", "public void parseUserInput(String[] args)\n {\n this.args = args;\n// Class cls = this.getClass();\n Method method;\n String parameter;\n int parameterPrefix = USER_OPTION.length();\n\n for (int parameterIndex=0; parameterIndex<args.length; parameterIndex++)\n {\n // Parse the input to find the corresponding function\n try\n {\n parameter = args[parameterIndex].substring(parameterPrefix);\n method = UserInput.class.getDeclaredMethod(parameter, Integer.class);\n parameterIndex = (int) method.invoke(this, parameterIndex);\n }\n catch (NoSuchMethodException | IllegalAccessException e )\n {\n throw new RuntimeException(\"Unhandled parameter: \" + args[parameterIndex] + \"\\n\" + e);\n }\n catch (InvocationTargetException e)\n {\n// e.printStackTrace();\n throw new RuntimeException(\"Missing or wrong parameters for the option: \" + args[parameterIndex] + \"\\n\" + e);\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 void handleCommand(String command, String args[], Player player){\n\t}", "public static void main(String[] args) {\n\t\thandler();\r\n\r\n\t}", "protected void handleInput(String input) {}", "public abstract void execute(CommandSender sender, String[] args);", "public void processArgs(String[] args){\n\t\tPattern pat = Pattern.compile(\"-[a-z]\");\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 'a': ucscGeneTableFileAll = new File(args[i+1]); i++; break;\n\t\t\t\t\tcase 'g': ucscGeneTableFileSelect = new File(args[i+1]); i++; break;\n\t\t\t\t\tcase 'b': barDirectory = new File(args[i+1]); i++; break;\n\t\t\t\t\tcase 'r': rApp = new File(args[i+1]); i++; break;\n\t\t\t\t\tcase 's': threshold = Float.parseFloat(args[i+1]); i++; break;\n\t\t\t\t\tcase 'e': extension = Integer.parseInt(args[i+1]); i++; break;\n\t\t\t\t\tcase 'f': extensionToSegment = Integer.parseInt(args[i+1]); i++; break;\n\t\t\t\t\tcase 'x': bpPositionOffSetBar = Integer.parseInt(args[i+1]); i++; break;\n\t\t\t\t\tcase 'y': bpPositionOffSetRegion = Integer.parseInt(args[i+1]); i++; break;\n\t\t\t\t\tcase 'h': printDocs(); System.exit(0);\n\t\t\t\t\tdefault: Misc.printExit(\"\\nError: 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\t//parse text\n\t\tselectName = Misc.removeExtension(ucscGeneTableFileSelect.getName());\n\n\t}", "protected void doExecute(String[] arguments, ContextStatus contextStatus) {\n // no action to do\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 void processArgs(String[] args) throws MalformedURLException, JAXBException, IOException, URISyntaxException, Exception {\n Options options = cli.getOptions(); \n options.addOption(\"collection\", true, \"Data Collection that this Fulfillment request applies to. Defaults to 'default'.\");\n Option idOpt = new Option(\"result_id\", true, \"The result_id being requested.\");\n idOpt.setRequired(true);\n options.addOption(idOpt);\n options.addOption(\"result_part_number\", true, \"The part number being requested. Defaults to '1'.\");\n \n cli.parse(args);\n CommandLine cmd = cli.getCmd();\n\n // Handle default values.\n String collection = cmd.hasOption(\"collection\") ? cmd.getOptionValue(\"collection\") : \"default\";\n int part = cmd.hasOption(\"result_part_number\") ? Integer.parseInt(cmd.getOptionValue(\"result_part_number\")) : 1;\n \n taxiiClient = generateClient(cmd);\n \n // Prepare the message to send.\n PollFulfillment request = factory.createPollFulfillment()\n .withMessageId(MessageHelper.generateMessageId())\n .withCollectionName(collection)\n .withResultId(cmd.getOptionValue(\"result_id\"))\n .withResultPartNumber(BigInteger.valueOf(part)); \n\n doCall(cmd, request);\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}", "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}", "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 abstract void onInvoked(CommandSender sender, String[] args);", "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}", "@Override\n\tpublic void entry(Object... params) {\n\n\t}", "public static void main(String[] args) {\n\t\t\tmeth(args);\r\n\t\t\targument_test:meth(args);\r\n\t}", "@Override\n public final int parseArguments(Parameters params) {\n return 1;\n }", "public void argumentOrginazer(String[] args){\n\t\tfor(String arg:args) {\n\t\t\t\n\t\t\tif(arg.toLowerCase().contains(\"-s\")) {// The -s argument will make a starters plot\n\t\t\t\tif(!player.isOp()){\n\t\t\t\t\tplayer.sendMessage(\"You need to be op to create a starters plot!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else if( arg.toLowerCase().contains(\"h:\") || arg.toLowerCase().contains(\"height:\")) {\n\t\t\t\t// the h:<number> or height:<number> argument can set a custum height for the given plot\n\t\t\t\tint temp = arg.indexOf(\":\") + 1;\n\t\t\t\theigth = Integer.valueOf((String) arg.subSequence(temp, arg.length()));\n\t\t\t\t\n\t\t\t} else if( arg.toLowerCase().contains(\"d:\") || arg.toLowerCase().contains(\"depth:\")) {\n\t\t\t\t// the d:<number> of depth:<number> will set a custum depth for the plot and also\n\t\t\t\t// places bedrock at the proper places\n\t\t\t\tint temp = arg.indexOf(\":\") + 1;\n\t\t\t\tdepth = Integer.valueOf((String) arg.subSequence(temp, arg.length()));\n\t\t\t\t\n\t\t\t} else if ( arg.toLowerCase().contains(\"n\") || arg.toLowerCase().contains(\"name:\")) {\n\t\t\t\t// The N:<name of plot> or name:<name of plot> will specify the name of the plot that\n\t\t\t\t// is about to be made. The plugin will terminate this action if no name is put in.\n\t\t\t\tint temp = arg.indexOf(\":\") + 1;\n\t\t\t\tname = (String) arg.subSequence(temp, arg.length());\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// Error catching for yet unknow arguments :P\n\t\t\t\tplayer.sendMessage(ChatColor.RED + \"The argument: \" + arg + \"does not exist.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t// Error catching for the 2 posistions the player selected\n\t\tposition1 = PlayerCords.getPlayerCords(player.getName())[0];\n\t\tposition2 = PlayerCords.getPlayerCords(player.getName())[1];\n\t\tif(position1 == null || position2 == null) {\n\t\t\tplayer.sendMessage(\"You did not select 2 points to create the plot from\");\n\t\t\treturn;\n\t\t}\n\t\t//debug\n\t\tplayer.sendMessage(position1.getBlockY() + \" 2nd \" + position2.getBlockY());\n\t\t\n\t\t//You need to give a plot name.\n\t\tif (name == null){\n\t\t\tplayer.sendMessage(ChatColor.RED + \"You forgot to give a plot name\");\n\t\t}\n\t\t\n\t\t// return more propper vectors for the plot creation so the region can be set\n\t\tVector[] temp = CreatePhysicalPlot.getProperVectors(position1, position2, heigth, depth);\n\t\tposition1 = temp[0];\n\t\tposition2 = temp[1];\n\t\t\n\t\t//makes the region and checks if this is legal on the given position and returns null\n\t\t//if an error occures\n\t\tProtectedRegion plotRegion = setRegion();\n\t\t\n\t\tif(plotRegion == null){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//gets the region form the just created plot\n\t\tList<String> regionIds = Arrays.asList(plotRegion.getId());\n\t\t\n\t\t//Searches the region for any city and returns null if it fails\n\t\tCityPlot cityPlot = getCityPlot(plotRegion);\n\t\tif(cityPlot == null){\n\t\t\tplayer.sendMessage(\"You need to be in a city plot to make a residence plot\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Builds the plot in the game world.\n CreatePhysicalPlot.CreatePlot(position1, position2, heigth, depth, player.getWorld(), player);\n // Instantates the plot object for the server to store and work with\n\t\tcreateResidentPlot(name, player.getWorld(), regionIds, cityPlot);\t\t\n\t}", "private static void process(String... args) throws Exception {\n Deque<String> params = new LinkedList<>(Arrays.asList(args));\n String command = params.pop().toUpperCase(Locale.ROOT);\n valueOf(command).run(params);\n }", "private void processArgs(String[] args)\n\t{\n\t\tboolean verbose = _verbose.getMatched();\n\n\t\t// disable console echo\n\t\t_writer.println(\"@echo off\");\n\n\t\tfor(int i = 0; i < args.length; ++i)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// try and expand any wildcards not handled by DOS/Windows\n\t\t\t\tString[] xargs = expandArg(args[i]);\n\n\t\t\t\tfor(int j = 0; j < xargs.length; ++j)\n\t\t\t\t{\n\t\t\t\t\tif(verbose)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.err.println(Strings.format(\"fProcessArg\", new Object[] { xargs[j] }));\n\t\t\t\t\t}\n\n\t\t\t\t\tFile pc = new File(xargs[j]);\n\t\t\t\t\t_writer.print(\"set CLASSPATH=%CLASSPATH%;\");\n\t\t\t\t\t_writer.println(pc.getCanonicalPath());\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(IOException e)\n\t\t\t{\n\t\t\t\tSystem.err.println(Strings.format(\"fGeneralError\", new Object[] { e.getMessage() }));\n\t\t\t\t\n\t\t\t\tif(verbose)\n\t\t\t\t{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\tSystem.exit(-1);\n\t\t\t}\n\t\t}\n\t}", "@Override public void run(ApplicationArguments args) {\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 }", "@Override\n public void verifyArgs(ArrayList<String> args) throws ArgumentFormatException {\n super.checkNumArgs(args);\n _args = true;\n }", "public static void main(String[] args) {\n EquationManipulator manipulator = new EquationManipulator();\n \n if (args.length == 3) {\n // arguments were passed in from the command line\n System.out.println(\"It looks like you passed in some arguments. Let me fetch those for you.\");\n checkPassedInArguments(args, manipulator);\n } else if (args.length != 0) {\n // User passed in an incorrect number of arguments\n printErrorMessage();\n handleUserInput(manipulator);\n } else { \n // User did not pass in any arguments\n handleUserInput(manipulator);\n }\n\n }", "public static void main(String[] args) throws IOException {\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));\n String URL = \"\";\n URL = bufferedReader.readLine();\n\n if (URL.isEmpty() || URL.indexOf(\"?\") == -1 || URL.indexOf(\"?\") == URL.length()-1)\n return;\n\n ArrayList<String> params = getParams(URL);\n\n if (params == null)\n return;\n\n printParams(params);\n processObj(params);\n// for (String s : params)\n// if (s.contains(\"obj=\")) {\n// callAlert(params);\n// break;\n// }\n }", "public static void main(String[] args) {\n if(args==null||args.length == 0 || args[0] == null)\n {\n notRecognized();\n return;\n }\n else\n {\n if(args[0].equals(\"update\"))\n {\n update();\n return;\n }\n else if(args[0].equals(\"help\")) \n {\n help();\n return;\n }\n else if(args[0].equals(\"access\")&&args.length>=2)\n {\n access(args[1]);\n return;\n }\n else\n {\n notRecognized();\n }\n }\n }", "public static void main(String[] args) {\n\t\tstringhandler obj=new stringhandler();\r\n\t\tobj.input();\r\n\t\tobj.display();\r\n\r\n\t}", "public void handleCommand(String command);", "public void processArguments(String[] _args) {\r\n\t\tboolean stateRead = false;\r\n\t\tif (_args != null && _args.length > 0) {\r\n\t\t\tfor (int i = 0; i < _args.length; i++) {\r\n\t\t\t\tif (_args[i].toLowerCase().endsWith(\".xml\")) {\r\n\t\t\t\t\tstateRead = readState(resetFile = _args[i]);\r\n\t\t\t\t} else if (_args[i].equals(\"-_initialState\")) {\r\n\t\t\t\t\tstateRead = readState(resetFile = _args[++i]);\r\n\t\t\t\t} else if (_args[i].equals(\"-_noDescription\")) {\r\n\t\t\t\t\tshowDescriptionOnStart = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public static void handleTerminalArguments(String[] args) {\n // Used to parse command line\n CommandLineParser parser = new DefaultParser();\n\n // Used to display help and errors from the parsing\n HelpFormatter formatter = new HelpFormatter();\n\n // Options\n Options options = new Options();\n\n Option helpOption = new Option(\"h\", \"help\", false, \"Show this help message \");\n Option portOption = new Option(\"p\", \"port\", true, \"Port for the server, defaults to 2000\");\n Option clientOption = new Option(\"c\", \"client\", false, \"Start client\");\n \n options.addOption(helpOption);\n options.addOption(portOption);\n options.addOption(clientOption);\n \n try {\n CommandLine commands = parser.parse(options, args);\n\n // display help\n if (commands.hasOption(\"help\")) {\n formatter.printHelp(\"GuessingGame\", options);\n System.exit(1);\n }\n \n // Handle client\n if (commands.hasOption(\"client\")) {\n ClientGUI.run();\n } else {\n // Handle server\n if (commands.hasOption(\"port\")) {\n if (!commands.getOptionValue(\"port\").matches(\"[0-9]+\")) {\n throw new ParseException(\"Port must be a number\");\n }\n int portNumber = Integer.parseInt(commands.getOptionValue(\"port\"));\n runServer(portNumber);\n } else {\n runServer(DEFAULT_PORT);\n }\n }\n \n } catch (ParseException e) {\n // Display error if there's missing parameters\n // or some parameters don't match.\n System.out.println(e.getMessage() + \"\\n\");\n formatter.printHelp(\"GuessingGame\", options);\n System.exit(1);\n }\n }", "@Override\n public void run(ApplicationArguments args) {\n }", "public void processArguments(PrintWriter writer, String[] args) {\n TableMetaData tbMetaData = new TableMetaData();\n int karg = evaluateOptions(args, config, tbMetaData);\n // System.err.println(\"main action=\" + mainAction + \", argsSql=\" + argsSql);\n process(writer, karg, args, config, tbMetaData);\n }", "public abstract void exec(CommandSender sender, String[] args);", "protected void handleArgs(String[] argv) throws IOException {\n String url = null, path = null, com = null;\n char c;\n boolean got_com = false;\n boolean error = false;\n edu.hkust.clap.monitor.Monitor.loopBegin(750);\nfor (int i = 0; i < argv.length; i++) { \nedu.hkust.clap.monitor.Monitor.loopInc(750);\n{\n if (argv[i].charAt(0) != '-' || argv[i].length() != 2) {\n error = true;\n break;\n }\n c = argv[i].charAt(1);\n switch(c) {\n case 'c':\n if (i == argv.length - 1) {\n System.err.println(\"Missing argument for -\" + c);\n error = true;\n break;\n }\n com = argv[++i].toUpperCase() + \"\\0\";\n got_com = true;\n break;\n case 'u':\n if (i == argv.length - 1) {\n System.err.println(\"Missing argument for -\" + c);\n error = true;\n break;\n }\n url = argv[++i];\n break;\n case 'p':\n if (i == argv.length - 1) {\n System.err.println(\"Missing argument for -\" + c);\n error = true;\n break;\n }\n path = argv[++i];\n break;\n case 's':\n if (i == argv.length - 1) {\n System.err.println(\"Missing argument for -\" + c);\n error = true;\n break;\n }\n _host_name = argv[++i];\n break;\n case 'P':\n if (i == argv.length - 1) {\n System.err.println(\"Missing argument for -\" + c);\n error = true;\n break;\n }\n try {\n _port = Integer.parseInt(argv[++i]);\n } catch (Exception e) {\n System.err.println(\"Invalid port number \\\"\" + argv[i] + \"\\\"\");\n _port = -1;\n error = true;\n }\n break;\n case 'v':\n ++_verbose;\n break;\n case 'h':\n usage();\n System.exit(OK);\n case 'V':\n version();\n System.exit(OK);\n default:\n error = true;\n }\n }} \nedu.hkust.clap.monitor.Monitor.loopEnd(750);\n\n if (!got_com) {\n System.err.println(\"No command specified\");\n error = true;\n }\n if (error) {\n usage();\n System.exit(FAILED);\n }\n if (_port == -1) {\n _port = PushCacheFilter.DEFAULT_PORT_NUM;\n }\n if (_host_name.length() == 0) {\n _host_name = DEFAULT_SERVER;\n }\n int ev = 0;\n try {\n switch(PushCacheProtocol.instance().parseCommand(com)) {\n case PushCacheProtocol.ADD:\n add(path, url);\n break;\n case PushCacheProtocol.DEL:\n del(url);\n break;\n case PushCacheProtocol.PRS:\n if (!isPresent(url)) {\n ev = 1;\n }\n break;\n default:\n simpleCommand(com);\n }\n } catch (IllegalArgumentException e) {\n System.err.println(e.getMessage());\n usage();\n ev = FAILED;\n }\n sendBye();\n System.exit(ev);\n }", "public void processArgs(String[] args){\n\t\t//look for a config file \n\t\targs = appendConfigArgs(args,\"-c\");\n\t\t\n\t\tPattern pat = Pattern.compile(\"-[a-z]\");\n\t\tFile forExtraction = null;\n\t\tFile configFile = 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': forExtraction = new File(args[++i]); break;\n\t\t\t\t\tcase 'v': vcfFileFilter = args[++i]; break;\n\t\t\t\t\tcase 'b': bedFileFilter = args[++i]; break;\n\t\t\t\t\tcase 'x': appendFilter = false; break;\n\t\t\t\t\tcase 'c': configFile = new File(args[++i]); break;\n\t\t\t\t\tcase 'd': dataDir = new File(args[++i]); break;\n\t\t\t\t\tcase 'm': maxCallFreq = Double.parseDouble(args[++i]); break;\n\t\t\t\t\tcase 'o': minBedCount = Integer.parseInt(args[++i]); break;\n\t\t\t\t\tcase 's': saveDirectory = new File(args[++i]); break;\n\t\t\t\t\tcase 'e': debug = true; break;\n\t\t\t\t\tcase 'h': printDocs(); System.exit(0);\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//config file? or local\n\t\tif (configLines != null && configFile != null){\n\t\t\tif (configLines[0].startsWith(\"-\") == false ) {\n\t\t\t\tHashMap<String, String> config = IO.loadFileIntoHashMapLowerCaseKey(configFile);\n\t\t\t\tif (config.containsKey(\"queryurl\")) queryURL = config.get(\"queryurl\");\n\t\t\t\tif (config.containsKey(\"host\")) host = config.get(\"host\");\n\t\t\t\tif (config.containsKey(\"realm\")) realm = config.get(\"realm\");\n\t\t\t\tif (config.containsKey(\"username\")) userName = config.get(\"username\");\n\t\t\t\tif (config.containsKey(\"password\")) password = config.get(\"password\");\n\t\t\t\tif (config.containsKey(\"maxcallfreq\")) maxCallFreq = Double.parseDouble(config.get(\"maxcallfreq\"));\n\t\t\t\tif (config.containsKey(\"vcffilefilter\")) vcfFileFilter = config.get(\"vcffilefilter\");\n\t\t\t\tif (config.containsKey(\"bedfilefilter\")) bedFileFilter = config.get(\"bedfilefilter\");\n\t\t\t}\n\t\t}\n\t\t//local search?\n\t\tif (queryURL == null){\n\t\t\tif (dataDir == null || dataDir.isDirectory()== false) {\n\t\t\t\tMisc.printErrAndExit(\"\\nProvide either a configuration file for remotely accessing a genomic query service or \"\n\t\t\t\t\t\t+ \"set the -d option to the Data directory created by the GQueryIndexer app.\\n\");;\n\t\t\t}\n\t\t}\n\n\t\tIO.pl(\"\\n\"+IO.fetchUSeqVersion()+\" Arguments:\");\n\t\tIO.pl(\"\\t-f Vcfs \"+forExtraction);\n\t\tIO.pl(\"\\t-s SaveDir \"+saveDirectory);\n\t\tIO.pl(\"\\t-v Vcf File Filter \"+vcfFileFilter);\n\t\tIO.pl(\"\\t-b Bed File Filter \"+bedFileFilter);\n\t\tIO.pl(\"\\t-m MaxCallFreq \"+maxCallFreq);\n\t\tIO.pl(\"\\t-o MinBedCount \"+minBedCount);\n\t\tIO.pl(\"\\t-x Remove failing \"+(appendFilter==false));\n\t\tIO.pl(\"\\t-e Verbose \"+debug);\n\t\tif (queryURL != null){\n\t\t\tIO.pl(\"\\tQueryUrl \"+queryURL);\n\t\t\tIO.pl(\"\\tHost \"+host);\n\t\t\tIO.pl(\"\\tRealm \"+realm);\n\t\t\tIO.pl(\"\\tUserName \"+userName);\n\t\t\t//check config params\n\t\t\tif (queryURL == null) Misc.printErrAndExit(\"\\nError: failed to find a queryUrl in the config file, e.g. queryUrl http://hci-clingen1.hci.utah.edu:8080/GQuery/\");\n\t\t\tif (queryURL.endsWith(\"/\") == false) queryURL = queryURL+\"/\";\n\t\t\tif (host == null) Misc.printErrAndExit(\"\\nError: failed to find a host in the config file, e.g. host hci-clingen1.hci.utah.edu\");\n\t\t\tif (realm == null) Misc.printErrAndExit(\"\\nError: failed to find a realm in the config file, e.g. realm QueryAPI\");\n\t\t\tif (userName == null) Misc.printErrAndExit(\"\\nError: failed to find a userName in the config file, e.g. userName FCollins\");\n\t\t\tif (password == null) Misc.printErrAndExit(\"\\nError: failed to find a password in the config file, e.g. password g0QueryAP1\");\n\n\t\t}\n\t\telse IO.pl(\"\\t-d DataDir \"+dataDir);\n\t\tIO.pl();\n\n\t\t//pull vcf files\n\t\tif (forExtraction == null || forExtraction.exists() == false) Misc.printErrAndExit(\"\\nError: please enter a path to a vcf file or directory containing such.\\n\");\n\t\tFile[][] tot = new File[3][];\n\t\ttot[0] = IO.extractFiles(forExtraction, \".vcf\");\n\t\ttot[1] = IO.extractFiles(forExtraction,\".vcf.gz\");\n\t\ttot[2] = IO.extractFiles(forExtraction,\".vcf.zip\");\n\t\tvcfFiles = IO.collapseFileArray(tot);\n\t\tif (vcfFiles == null || vcfFiles.length ==0 || vcfFiles[0].canRead() == false) Misc.printExit(\"\\nError: cannot find your xxx.vcf(.zip/.gz OK) file(s)!\\n\");\n\n\t\t//check params\n\t\tif (vcfFileFilter == null) Misc.printErrAndExit(\"\\nError: provide a vcf file filter, e.g. Hg38/Somatic/Avatar/Vcf \");\n\t\tif (bedFileFilter == null) Misc.printErrAndExit(\"\\nError: provide a bed file filter, e.g. Hg38/Somatic/Avatar/Bed \");\n\t\tif (saveDirectory == null) Misc.printErrAndExit(\"\\nError: provide a directory to save the annotated vcf files.\");\n\t\telse saveDirectory.mkdirs();\n\t\tif (saveDirectory.exists() == false) Misc.printErrAndExit(\"\\nError: could not find your save directory? \"+saveDirectory);\n\n\t\tuserQueryVcf = new UserQuery().addRegExFileName(\".vcf.gz\").addRegExDirPath(vcfFileFilter).matchVcf();\n\t\tuserQueryBed = new UserQuery().addRegExFileName(\".bed.gz\").addRegExDirPath(bedFileFilter);\n\t}", "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 int handleOptions(String[] args) {\r\n\r\n int status = 0;\r\n\r\n if ((args == null) || (args.length == 0)) { return status; }\r\n\r\n for (int i = 0; i < args.length; i++) {\r\n if (status != 0) { return status; }\r\n\r\n if (args[i].equals(\"-h\")) {\r\n displayUsage();\r\n status = 1;\r\n } else if (args[i].equals(\"-d\") || args[i].equals(\"-discourse\")) {\r\n if (++i < args.length) {\r\n try {\r\n this.discourseId = Long.parseLong(args[i]);\r\n if (discourseId < 0) {\r\n logger.error(\"Invalid discourse id specified: \" + args[i]);\r\n status = -1;\r\n }\r\n } catch (Exception exception) {\r\n logger.error(\"Error while trying to parse discourse id. \"\r\n + \"Please check the parameter for accuracy.\");\r\n throw new IllegalArgumentException(\"Invalid discourse id specified.\");\r\n }\r\n } else {\r\n logger.error(\"A discourse id must be specified with the -discourse argument\");\r\n displayUsage();\r\n status = -1;\r\n }\r\n } else if (args[i].equals(\"-e\") || args[i].equals(\"-email\")) {\r\n setSendEmailFlag(true);\r\n if (++i < args.length) {\r\n setEmailAddress(args[i]);\r\n } else {\r\n logger.error(\"An email address must be specified with this argument\");\r\n displayUsage();\r\n status = -1;\r\n }\r\n } else if (args[i].equals(\"-b\") || args[i].equals(\"-batchSize\")) {\r\n if (++i < args.length) {\r\n try {\r\n this.batchSize = Integer.parseInt(args[i]);\r\n if (batchSize <= 0) {\r\n logger.error(\"The batch size must be greater than zero.\");\r\n displayUsage();\r\n status = -1;\r\n }\r\n } catch (NumberFormatException exception) {\r\n logger.error(\"Error while trying to parse batch size: \" + args[i]);\r\n throw new IllegalArgumentException(\"Invalid batch size specified.\");\r\n }\r\n } else {\r\n logger.error(\"A batch size must be specified with the -batchSize argument\");\r\n displayUsage();\r\n status = -1;\r\n }\r\n } else if (args[i].equals(\"-p\") || args[i].equals(\"-project\")) {\r\n if (++i < args.length) {\r\n try {\r\n this.projectId = Integer.parseInt(args[i]);\r\n if (projectId < 0) {\r\n logger.error(\"Invalid project id specified: \" + args[i]);\r\n status = -1;\r\n }\r\n } catch (Exception exception) {\r\n logger.error(\"Error while trying to parse project id. \"\r\n + \"Please check the parameter for accuracy.\");\r\n throw new IllegalArgumentException(\"Invalid project id specified.\");\r\n }\r\n } else {\r\n logger.error(\"A project id must be specified with the -project argument\");\r\n displayUsage();\r\n status = -1;\r\n }\r\n }\r\n }\r\n\r\n return status;\r\n }", "@Override\n protected void handleCommand(String[] args) throws CommandException, IOException, JSONException, UnexpectedHttpStatusCodeException {\n if (args.length == 0) {\n this.displayUsage();\n return;\n }\n\n // verify arguments count\n checkArgumentsCount(args, 1);\n\n // parse arguments\n Date date = parseStringToDate(args[0]);\n\n // verify arguments\n checkDate(date);\n\n // create analyser\n JSONAnalyser analyser = new JSONAnalyser(\n new DataProvider<JSONObject>(\n new JSONSingleFetcher(\n new NBPConnector(),\n String.format(\"exchangerates/tables/c/%tF\", date),\n \"/0/rates\"\n )\n )\n );\n\n // get value\n JSONObject lowest = analyser.findTheSmallestNumber(jsonObject -> jsonObject.getNumber(\"bid\"));\n\n // display\n System.out.format(\"The currency with the lowest buy price on day %tF was %s worth %s%n\",\n date,\n ANSIColors.highlite(lowest.getString(\"code\").toUpperCase()),\n ANSIColors.highlite(lowest.getNumber(\"bid\") + \" PLN\")\n );\n\n }", "@Override\n\tpublic void traverseArg(UniArg node) {\n\t}", "void processCommandLineArguments(String[] args) throws ConfigurationException;", "public static void main(String[]args) {\n\t\n\t \n\tArgsHandler handler = new ArgsHandler(args);\n if (!handler.empty()) {\n handler.execute();\n }\n \n final int exit = 0;\n final int setValues = 1;\n final int getValues = 2;\n final int execute2 = 3;\n final int printResult = 4;\n String word = null;\n \n /**\n * Our dialog menu with checking of input argumet's of program \n */\n do {\n UI.mainMenu();\n UI.enterChoice();\n switch (UI.getChoice()) {\n case exit:\n if (ArgsHandler.isDebug()) {\n System.out.println(\"\\nYou chosen 0. Exiting...\");\n System.out.format(\"%n############################################################### DEBUG #############################################################\");\n }\n break;\n case setValues:\n if (ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n System.out.println(\"\\nYou chosen 1. Setting values...\");\n }\n word = UI.enterValues();\n break;\n case getValues:\n if (ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n System.out.println(\"\\nYou chosen 2. Getting values...\");\n }\n if (word != null ) {\n UI.printText(word);\n } else {\n System.out.format(\"%nFirst you need to add values.\");\n }\n break; \n case execute2:\n if (ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n System.out.println(\"\\nYou chosen 3. Executing task...\");\n }\n if (word != null) {\n \t final String []lines = NewHelper.DivString(word);\n \t System.out.println(\"\\nTask done...\");\n \t if (ArgsHandler.isDebug()) {\n \t System.out.format(\"%n############################################################### DEBUG #############################################################\");\n \t }\n } else {\n System.out.format(\"%nFirst you need to add values.\");\n }\n break;\n case printResult:\n if (ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n System.out.format(\"%nYou chosen 4. \"\n + \"Printing out result...%n\");\n }\n if (word != null) {\n \tfinal String[] lines2 = NewHelper.DivString(word);\n \tfor (final String line2 : lines2) {\n NewHelper.printSymbols(line2);\n NewHelper.printSymbolNumbers(line2);\n \t}\n \tif(ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n } \n \telse {\n System.out.format(\"%nFirst you need to add values.\"); \n }\n break;\n }\n default:\n System.out.println(\"\\nEnter correct number.\");\n }\n } while (UI.getChoice() != 0);\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}", "private void handleCommandLineArgs(final String[] args) {\n if (args.length == 1) {\n final String value;\n if (args[0].startsWith(ToolArguments.MAP_FOLDER)) {\n value = getValue(args[0]);\n } else {\n value = args[0];\n }\n final File mapFolder = new File(value);\n if (mapFolder.exists()) {\n mapFolderLocation = mapFolder;\n } else {\n log.info(\"Could not find directory: \" + value);\n }\n } else if (args.length > 1) {\n log.info(\"Only argument allowed is the map directory.\");\n }\n // might be set by -D\n if (mapFolderLocation == null || mapFolderLocation.length() < 1) {\n final String value = System.getProperty(ToolArguments.MAP_FOLDER);\n if (value != null && value.length() > 0) {\n final File mapFolder = new File(value);\n if (mapFolder.exists()) {\n mapFolderLocation = mapFolder;\n } else {\n log.info(\"Could not find directory: \" + value);\n }\n }\n }\n }", "public abstract CommandResponse onCommand(CommandSender sender, String label, String[] args);", "private void cmdHandler(JSONArray parameter, String cmd) {\n switch (cmd) {\n case \"login\":\n signIn(parameter);\n break;\n case \"time\":\n Date d = new GregorianCalendar().getTime();\n clientResponse(d.toString());\n break;\n case \"ls\":\n listFiles(parameter);\n break;\n case \"who\":\n clientResponse(MailboxServer.getUsersAsString());\n break;\n case \"msg\":\n sendMessage(parameter);\n break;\n case \"exit\":\n signOut();\n break;\n }\n }", "public abstract String run(String args);", "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 }", "@Override\r\n\tpublic void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) {\n\t\t\r\n\t}", "@Override\n\t\t\t\t\tpublic Parameter handleParameter(Method parent,\n\t\t\t\t\t\t\tEParamType direction, FArgument src) {\n\t\t\t\t\t\treturn super.handleParameter(parent, direction, src);\n\t\t\t\t\t}", "@Override\n\tpublic void handleInput() {\n\t\t\n\t}", "protected abstract void go(CommandLine line) throws Exception;", "@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 }", "@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 }", "public static void main(final String[] args) {\n IHandler handler = new ExecutionStrategy(args).getHandler();\n // Print the handler name for reference.\n System.out.println(\"Strategy: \" + handler.getClass().getSimpleName());\n // Invoke the execution strategy.\n handler.handle();\n }", "public static void main(String[] args) {\nSystem.out.println(\"you passed...\"+args.length);\r\nfor(int i=0;i<args.length;i++)\r\n{\r\n\tSystem.out.println(\"data is\"+args[i]);\r\n}\r\n\t}", "public static void main(String[] args) \n\t{\n\t\t\t\tHandler h1 = new Handler1();\n\t\t\t\tHandler h2 = new Handler2();\n\t\t\t\tHandler h3 = new Handler3();\n\t\t\t\th1.setNextHandler(h3);\n\t\t\t\th3.setNextHandler(h2);\n\t\t\t\th2.setNextHandler(null);\n\n\t\t\t\th1.handleRequest(new Request(\"Value \", 4));\n\t\t\t\th1.handleRequest(new Request(\"Value \", -5));\n\t\t\t\th1.handleRequest(new Request(\"Value \", 45));\n\n\t}", "public static void main(String... args) {\n int status;\n try {\n process(args);\n status = 0;\n } catch (IllegalArgumentException | NoSuchElementException ex) {\n printUsage(ex);\n status = 1;\n } catch (NoSuchMethodException ex) {\n log.error(\"Method not found \", ex);\n status = 2;\n } catch (Throwable ex) {\n ex.printStackTrace();\n status = 3;\n }\n System.exit(status);\n }", "public abstract boolean commandExecution(CommandSender sender, String label, String[] args);", "protected abstract Value execute(final State state, final HashMap<ParameterDef, Value> args) throws SetlException;", "public PluginResult performAction(Map<String, String> args) {\n\t\tFile file = null;\n\t\ttry {\n\t\t\tSystem.out.println(\"FilePath : \"+args.get(AttPluginConstants.ARG_FILEPATH));\n\t\t\tfile = AttPluginUtils.getFile(args.get(AttPluginConstants.ARG_FILEPATH));\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn new PluginResult(PluginResult.Status.ERROR, AttPluginUtils.prepareMessage(AttPluginConstants.ERR_FILE_NA_CODE, AttPluginConstants.ERR_FILE_NA_MSG));\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\treturn new PluginResult(PluginResult.Status.ERROR, AttPluginUtils.prepareMessage(AttPluginConstants.ERR_PROCESS_AUDIO_CODE, AttPluginConstants.ERR_PROCESS_AUDIO_MSG));\n\t\t}\n\n\t\t// Http Processing\n\t\tDefaultHttpClient httpclient = new DefaultHttpClient();\n\n\t\tboolean isChunked=false;\n\t\tString transferEncoding=args.get(AttPluginConstants.ARG_HEADER_TRANSFER_ENCODING);\n\t\tif(transferEncoding!=null && transferEncoding.equalsIgnoreCase(AttPluginConstants.VAL_TRANSFER_ENCODING_CHUNKED))\n\t\t{\n\t\t\tisChunked=true;\n\t\t}\n\t\t\n\t\tHttpPost httppost = AttPluginUtils.prepareRequest(file, args.get(AttPluginConstants.ARG_URL),isChunked);\n\n\t\thttppost.addHeader(\"Authorization\", args.get(AttPluginConstants.ARG_TOKEN));\n\t\thttppost.addHeader(\"Accept\", args.get(AttPluginConstants.ARG_HEADER_ACCEPT));\n\n\t\tif (args.containsKey(AttPluginConstants.ARG_HEADER_CONTENT_TYPE)) {\n\t\t\thttppost.addHeader(\"Content-Type\", args.get(AttPluginConstants.ARG_HEADER_CONTENT_TYPE));\n\t\t}\n\n\t\tif (args.containsKey(AttPluginConstants.ARG_HEADER_XSPEECH_CONTEXT)) {\n\t\t\thttppost.addHeader(\"X-SpeechContext\", args.get(AttPluginConstants.ARG_HEADER_XSPEECH_CONTEXT));\n\t\t}\n\t\t\n\t\tif(args.get(AttPluginConstants.ARG_HEADER_XSPEECH_CONTEXT).equalsIgnoreCase(\"Generic\")){\n\t\t\tif (args.containsKey(AttPluginConstants.ARG_CONTENT_LANGUAGE)) {\n\t\t\t\thttppost.addHeader(\"Content-Language\", args.get(AttPluginConstants.ARG_CONTENT_LANGUAGE));\n\t\t\t}\n\t\t}else{\n\t\t\tif(args.containsKey(AttPluginConstants.ARG_XARG)){\n\t\t\t\thttppost.addHeader(\"X-Arg\", args.get(AttPluginConstants.ARG_XARG));\n\t\t\t}\n\t\t}\n\n\t\tif (args.containsKey(AttPluginConstants.ARG_HEADER_CONTENT_LENGTH)) {\n\t\t\thttppost.addHeader(\"Content-Length\", args.get(AttPluginConstants.ARG_HEADER_CONTENT_LENGTH));\n\t\t}\n\n\t\tif (args.containsKey(AttPluginConstants.ARG_HEADER_TRANSFER_ENCODING)) {\n\t\t\thttppost.addHeader(\"Transfer-Encoding\", args.get(AttPluginConstants.ARG_HEADER_TRANSFER_ENCODING));\n\t\t}\n\t\t\n\t\tString result = null;\n\t\ttry {\n\t\t\tresult = AttPluginUtils.processResponse(httpclient.execute(httppost));\n\t\t\tSystem.out.println(\"result : \"+result);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tString message = null;\n\t\t\tString code = null;\n\t\t\tif (e.equals(AttPluginConstants.ERR_INV_STATUS_MSG)) {\n\t\t\t\tcode = AttPluginConstants.ERR_INV_STATUS_CODE;\n\t\t\t\tmessage = AttPluginConstants.ERR_INV_STATUS_MSG;\n\t\t\t} else {\n\t\t\t\tcode = AttPluginConstants.ERR_PROCESS_REQ_CODE;\n\t\t\t\tmessage = AttPluginConstants.ERR_PROCESS_REQ_MSG;\n\t\t\t}\n\t\t\treturn new PluginResult(PluginResult.Status.ERROR, AttPluginUtils.prepareMessage(code, message));\n\t\t} finally {\n\t\t\targs.clear();\n\t\t\targs = null;\n\t\t}\n\n\t\treturn new PluginResult(PluginResult.Status.OK, result);\n\t}", "@Override\n\t public void run(ApplicationArguments args) throws Exception {\n\n\t }", "java.lang.String getArg();", "public static void main(String[] args) {\n InputHandler.inputs();\n }", "private static String[] processArgs(String[] args) {\r\n if (args.length == 0) {\r\n args = new String[1];\r\n args[0] = config.getProperty(ConfigParam.inputTrace.name());\r\n System.out.println(\"Args:\"+args[0]);\r\n } else if (args.length > 1) {\r\n System.out.println(\"Usage: [Trace_File]\");\r\n System.out.println(\"Example: ./traces/fdct_trace_without_optimization.txt\");\r\n System.out.println(\"If no arguments are given, the trace file defined in \" +\r\n configFile + \" is used.\");\r\n System.exit(1);\r\n }\r\n\r\n return args;\r\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}", "protected void parseArgs(String[] args) throws BuildException {\n for (int i = 0; i != args.length; ++i) {\n String arg = args[i];\n boolean parsed = parseArg(arg, args, i);\n if (!parsed) {\n String message = \"Unknown option: \" + arg;\n usage(message, System.out);\n throw new BuildException(message);\n }\n }\n }", "private void handleActionFoo(String param1, String param2){\n\t// TODO: Handle action Foo\n\tthrow new UnsupportedOperationException(\"Not yet implemented\");\n }", "void setArguments(String arguments);", "Object handle(Object request);", "@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 }", "void visitArgument(Argument argument);", "@Override\n public int getNumberArguments() {\n return 1;\n }" ]
[ "0.7505958", "0.73209107", "0.70690227", "0.70690227", "0.7028491", "0.65349096", "0.63855493", "0.6384049", "0.63309014", "0.63118297", "0.62488586", "0.62216043", "0.62025565", "0.6188382", "0.617088", "0.61045027", "0.60923153", "0.6069765", "0.6036577", "0.6007893", "0.6000143", "0.5993754", "0.5980514", "0.5956444", "0.5916745", "0.59019935", "0.58940345", "0.58476067", "0.5845898", "0.5827348", "0.5795795", "0.5794618", "0.57897455", "0.578895", "0.5780829", "0.57804656", "0.57797575", "0.57711947", "0.5758231", "0.57571155", "0.5751671", "0.5750288", "0.5750165", "0.5744926", "0.57341975", "0.57289004", "0.5716691", "0.5715903", "0.5706286", "0.5705693", "0.5696878", "0.569687", "0.56884307", "0.56732863", "0.56698334", "0.56668407", "0.566672", "0.5664023", "0.56537676", "0.56401587", "0.5622405", "0.56161284", "0.56149304", "0.5614891", "0.5612803", "0.5612803", "0.5612803", "0.5612803", "0.5612803", "0.5612803", "0.5612803", "0.5612803", "0.5612803", "0.5612803", "0.5612803", "0.5612803", "0.5612803", "0.5612803", "0.5612803", "0.5612803", "0.5612803", "0.5602725", "0.5596036", "0.55903006", "0.5584892", "0.55843544", "0.5582993", "0.55825746", "0.5580311", "0.55721915", "0.55686706", "0.55606633", "0.55588675", "0.55551916", "0.5550985", "0.55501103", "0.5548796", "0.5541457", "0.55398726", "0.55145013" ]
0.6720719
5