buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
public InternalFacet buildFacet(String facetName) { List<InternalFullHistogramFacet.FullEntry> fullEntries = new ArrayList<>(entries.v().size()); boolean[] states = entries.v().allocated; Object[] values = entries.v().values; for (int i = 0; i < states.length; i++) { if (...
public InternalFacet buildFacet(String facetName) { List<InternalFullHistogramFacet.FullEntry> fullEntries = new ArrayList<>(entries.v().size()); boolean[] states = entries.v().allocated; Object[] values = entries.v().values; for (int i = 0; i < states.length; i++) { if (...
public Facet reduce(ReduceContext context) { List<Facet> facets = context.facets(); if (facets.size() == 1) { // need to sort here... InternalCountHistogramFacet histoFacet = (InternalCountHistogramFacet) facets.get(0); Arrays.sort(histoFacet.entries, histoFacet.c...
public Facet reduce(ReduceContext context) { List<Facet> facets = context.facets(); if (facets.size() == 1) { // need to sort here... InternalCountHistogramFacet histoFacet = (InternalCountHistogramFacet) facets.get(0); Arrays.sort(histoFacet.entries, histoFacet.c...
public Facet reduce(ReduceContext context) { List<Facet> facets = context.facets(); if (facets.size() == 1) { // we need to sort it InternalFullHistogramFacet internalFacet = (InternalFullHistogramFacet) facets.get(0); List<FullEntry> entries = internalFacet.getEn...
public Facet reduce(ReduceContext context) { List<Facet> facets = context.facets(); if (facets.size() == 1) { // we need to sort it InternalFullHistogramFacet internalFacet = (InternalFullHistogramFacet) facets.get(0); List<FullEntry> entries = internalFacet.getEn...
public InternalFacet buildFacet(String facetName) { List<InternalFullHistogramFacet.FullEntry> entries1 = new ArrayList<>(entries.v().size()); final boolean[] states = entries.v().allocated; final Object[] values = entries.v().values; for (int i = 0; i < states.length; i++) { ...
public InternalFacet buildFacet(String facetName) { List<InternalFullHistogramFacet.FullEntry> entries1 = new ArrayList<>(entries.v().size()); final boolean[] states = entries.v().allocated; final Object[] values = entries.v().values; for (int i = 0; i < states.length; i++) { ...
public InternalFacet buildFacet(String facetName) { List<InternalFullHistogramFacet.FullEntry> entries1 = new ArrayList<>(entries.v().size()); final boolean [] states = entries.v().allocated; final Object[] values = entries.v().values; for (int i = 0; i < states.length; i++) { ...
public InternalFacet buildFacet(String facetName) { List<InternalFullHistogramFacet.FullEntry> entries1 = new ArrayList<>(entries.v().size()); final boolean [] states = entries.v().allocated; final Object[] values = entries.v().values; for (int i = 0; i < states.length; i++) { ...
public Facet reduce(ReduceContext context) { List<Facet> facets = context.facets(); if (facets.size() == 1) { Facet facet = facets.get(0); // can be of type InternalStringTermsFacet representing unmapped fields if (facet instanceof InternalDoubleTermsFacet) { ...
public Facet reduce(ReduceContext context) { List<Facet> facets = context.facets(); if (facets.size() == 1) { Facet facet = facets.get(0); // can be of type InternalStringTermsFacet representing unmapped fields if (facet instanceof InternalDoubleTermsFacet) { ...
public Facet reduce(ReduceContext context) { List<Facet> facets = context.facets(); if (facets.size() == 1) { Facet facet = facets.get(0); // facet could be InternalStringTermsFacet representing unmapped fields if (facet instanceof InternalLongTermsFacet) { ...
public Facet reduce(ReduceContext context) { List<Facet> facets = context.facets(); if (facets.size() == 1) { Facet facet = facets.get(0); // facet could be InternalStringTermsFacet representing unmapped fields if (facet instanceof InternalLongTermsFacet) { ...
public Facet reduce(ReduceContext context) { List<Facet> facets = context.facets(); if (facets.size() == 1) { InternalStringTermsFacet facet = (InternalStringTermsFacet) facets.get(0); facet.trimExcessEntries(); return facet; } InternalStringTerms...
public Facet reduce(ReduceContext context) { List<Facet> facets = context.facets(); if (facets.size() == 1) { InternalStringTermsFacet facet = (InternalStringTermsFacet) facets.get(0); facet.trimExcessEntries(); return facet; } InternalStringTerms...
public void run() { try { latch.await(); } catch (InterruptedException e) { return; } while (recycles.getAndDecrement() > 0) { final Recycler.V<?> v = r...
public void run() { try { latch.await(); } catch (InterruptedException e) { return; } while (recycles.getAndDecrement() > 0) { final Recycler.V<?> v = r...
public void duel() { final DoubleObjectOpenHashMap<Object> map1 = new DoubleObjectOpenHashMap<>(); final DoubleObjectPagedHashMap<Object> map2 = new DoubleObjectPagedHashMap<>(randomInt(42), 0.6f + randomFloat() * 0.39f, BigArraysTests.randombigArrays()); final int maxKey = randomIntBetween(...
public void duel() { final DoubleObjectOpenHashMap<Object> map1 = new DoubleObjectOpenHashMap<>(); final DoubleObjectPagedHashMap<Object> map2 = new DoubleObjectPagedHashMap<>(randomInt(42), 0.6f + randomFloat() * 0.39f, BigArraysTests.randombigArrays()); final int maxKey = randomIntBetween(...
public void duel() { final LongObjectOpenHashMap<Object> map1 = new LongObjectOpenHashMap<>(); final LongObjectPagedHashMap<Object> map2 = new LongObjectPagedHashMap<>(randomInt(42), 0.6f + randomFloat() * 0.39f, BigArraysTests.randombigArrays()); final int maxKey = randomIntBetween(1, 10000...
public void duel() { final LongObjectOpenHashMap<Object> map1 = new LongObjectOpenHashMap<>(); final LongObjectPagedHashMap<Object> map2 = new LongObjectPagedHashMap<>(randomInt(42), 0.6f + randomFloat() * 0.39f, BigArraysTests.randombigArrays()); final int maxKey = randomIntBetween(1, 10000...
@Override public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); boolean cache = true; // default to true, usually same range are used, I think.... String fieldName = null; String from = null; ...
@Override public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); boolean cache = true; // default to true, since anyhow NumericRangeFilter and TermFilter construct an OpenBitSet String fieldName = null; ...
public TextureAttribute (Texture texture, int unit, String name, TextureFilter minFilter, TextureFilter magFilter, TextureWrap uWrap, TextureWrap vWrap) { this(texture, unit, name, texture.getTextureFilter(minFilter), texture.getTextureFilter(magFilter), uWrap == TextureWrap.ClampToEdge?GL10.GL_CLAMP_TO_EDGE:GL10.GL...
public TextureAttribute (Texture texture, int unit, String name, TextureFilter minFilter, TextureFilter magFilter, TextureWrap uWrap, TextureWrap vWrap) { this(texture, unit, name, minFilter.getGLEnum(), magFilter.getGLEnum(), uWrap.getGLEnum(), vWrap.getGLEnum()); }
public static TextureRef loadTexture(String path, TextureFilter minFilter, TextureFilter magFilter, TextureWrap uwrap, TextureWrap vwrap) { if(sDictionary.containsKey(path)) { TextureRef ref = sDictionary.get(path); ref.addRef(); return ref; } // load new texture FileHandle texFile = Gdx.app.get...
public static TextureRef loadTexture(String path, TextureFilter minFilter, TextureFilter magFilter, TextureWrap uwrap, TextureWrap vwrap) { if(sDictionary.containsKey(path)) { TextureRef ref = sDictionary.get(path); ref.addRef(); return ref; } // load new texture FileHandle texFile = Gdx.app.get...
public void create () { // lightShader = ShaderLoader.createShader("vertexpath", "vertexpath"); lightManager = new LightManager(LIGHTS_NUM, LightQuality.FRAGMENT); shader = ShaderFactory.createShader(null, lightManager); for (int i = 0; i < 8; i++) { PointLight l = new PointLight(); l.position.set(Math...
public void create () { // lightShader = ShaderLoader.createShader("vertexpath", "vertexpath"); lightManager = new LightManager(LIGHTS_NUM, LightQuality.FRAGMENT); shader = ShaderFactory.createShader(null, lightManager); for (int i = 0; i < 8; i++) { PointLight l = new PointLight(); l.position.set(Math...
public Matrix4 setToLookAt (Vector3 position, Vector3 target, Vector3 up) { tmpVec.set(target).sub(position); setToLookAt(tmpVec, up); this.mul(tmpMat.setToTranslation(position.tmp().scl(-1))); return this; }
public Matrix4 setToLookAt (Vector3 position, Vector3 target, Vector3 up) { tmpVec.set(target).sub(position); setToLookAt(tmpVec, up); this.mul(tmpMat.setToTranslation(position.tmp().mul(-1))); return this; }
public void update (float deltaTime) { if (state == FLYING) { // if(pos.dst(map.bob.pos) < pos.dst(map.cube.pos)) vel.set(map.bob.pos); // else vel.set(map.cube.pos); vel.set(map.bob.pos); vel.sub(pos).nor().scl(VELOCITY); pos.add(vel.x * deltaTime, vel.y * deltaTime); bounds.x = pos.x + 0.2f; bounds....
public void update (float deltaTime) { if (state == FLYING) { // if(pos.dst(map.bob.pos) < pos.dst(map.cube.pos)) vel.set(map.bob.pos); // else vel.set(map.cube.pos); vel.set(map.bob.pos); vel.sub(pos).nor().mul(VELOCITY); pos.add(vel.x * deltaTime, vel.y * deltaTime); bounds.x = pos.x + 0.2f; bounds....
public Array<Vector2> generatePositions(int n) { Array<Vector2> positions = new Array<Vector2>(); for (int i = 1; i <= n; ++i) { positions.add(new Vector2(MathUtils.cos(i / n), MathUtils.sin(i / n)).scl(200)); } return positions; }
public Array<Vector2> generatePositions(int n) { Array<Vector2> positions = new Array<Vector2>(); for (int i = 1; i <= n; ++i) { positions.add(new Vector2(MathUtils.cos(i / n), MathUtils.sin(i / n)).mul(200)); } return positions; }
public void draw(SpriteBatch spriteBatch) { super.draw(spriteBatch); delta = Math.min(0.06f, Gdx.graphics.getDeltaTime()); since_alive += delta; facing.rotate((SPEED + random_speed) * delta).nor(); position.add(facing.scl((SPEED + random_speed) * delta)); this.setPosition(position.x, position.y); if ...
public void draw(SpriteBatch spriteBatch) { super.draw(spriteBatch); delta = Math.min(0.06f, Gdx.graphics.getDeltaTime()); since_alive += delta; facing.rotate((SPEED + random_speed) * delta).nor(); position.add(facing.mul((SPEED + random_speed) * delta)); this.setPosition(position.x, position.y); if ...
public Bomb(int id, Vector2 position, Vector2 facing) { super(id, position, facing); bulletSpeed = 150; this.velocity = new Vector2().set(facing).scl(bulletSpeed); damage = 300; this.set(Resources.getInstance().bomb); this.setOrigin(this.getWidth()/2, this.getHeight()/2); }
public Bomb(int id, Vector2 position, Vector2 facing) { super(id, position, facing); bulletSpeed = 150; this.velocity = new Vector2().set(facing).mul(bulletSpeed); damage = 300; this.set(Resources.getInstance().bomb); this.setOrigin(this.getWidth()/2, this.getHeight()/2); }
public void retarget() { target = Targeting.getNearestOfType(frigate, 0); if (target == null) { target = Targeting.getNearestOfType(frigate, 1); } if (target == null) { target = Targeting.getNearestOfType(frigate, 2); } if (target == null) { target = Targeting.getNearestOfType(frigate, 3); } ...
public void retarget() { target = Targeting.getNearestOfType(frigate, 0); if (target == null) { target = Targeting.getNearestOfType(frigate, 1); } if (target == null) { target = Targeting.getNearestOfType(frigate, 2); } if (target == null) { target = Targeting.getNearestOfType(frigate, 3); } ...
public Missile(int id, Vector2 position, Vector2 facing) { super(id, position, facing); turnSpeed = 300f; accel = 300.0f; bulletSpeed = 50; this.velocity = new Vector2().set(facing).scl(bulletSpeed); damage = 50; this.set(Resources.getInstance().missile); this.setOrigin(this.getWidth()/2, this.getH...
public Missile(int id, Vector2 position, Vector2 facing) { super(id, position, facing); turnSpeed = 300f; accel = 300.0f; bulletSpeed = 50; this.velocity = new Vector2().set(facing).mul(bulletSpeed); damage = 50; this.set(Resources.getInstance().missile); this.setOrigin(this.getWidth()/2, this.getH...
public Vector2 predict() { relativeVel.set(missile.velocity).sub(target.velocity); toTarget.set(target.collisionCenter).sub(missile.collisionCenter); if (missile.velocity.dot(toTarget) != 0) { float time_to_target = toTarget.dot(toTarget) / relativeVel.dot(toTarget); return new Vector2(target.collisionCent...
public Vector2 predict() { relativeVel.set(missile.velocity).sub(target.velocity); toTarget.set(target.collisionCenter).sub(missile.collisionCenter); if (missile.velocity.dot(toTarget) != 0) { float time_to_target = toTarget.dot(toTarget) / relativeVel.dot(toTarget); return new Vector2(target.collisionCent...
private void updateParticle(Particle particle) { delta = Math.min(0.06f, Gdx.graphics.getDeltaTime()); if (particle.life > 0) { particle.life -= delta; particle.position.add(particle.velocity.x * delta*10,particle.velocity.y * delta*10); particle.velocity.scl((float) Math.pow(damping, delta)); parti...
private void updateParticle(Particle particle) { delta = Math.min(0.06f, Gdx.graphics.getDeltaTime()); if (particle.life > 0) { particle.life -= delta; particle.position.add(particle.velocity.x * delta*10,particle.velocity.y * delta*10); particle.velocity.mul((float) Math.pow(damping, delta)); parti...
public void updateControls (float delta) { presenter.setController(0.0f, 0.0f); if (Gdx.input.justTouched()) { worldCam.unproject(touchPoint.set(Gdx.input.getX(), Gdx.input.getY(), 0)); if (world.isPaused()) { presenter.resume(); } else if (touchPoint.y >= worldMaxY) { presenter.pause(); } } ...
public void updateControls (float delta) { presenter.setController(0.0f, 0.0f); if (Gdx.input.justTouched()) { worldCam.unproject(touchPoint.set(Gdx.input.getX(), Gdx.input.getY(), 0)); if (world.isPaused()) { presenter.resume(); } else if (touchPoint.y >= worldMaxY) { presenter.pause(); } } ...
private float calculateAngle (float a) { Vector3 camPos = calculateDirection(a); position.set(camPos.scl(30)); lookAt(0, 0, 0); normalizeUp(); update(); Vector3 orig = new Vector3(0, 0, 0); Vector3 vec = new Vector3(1, 0, 0); project(orig); project(vec); Vector2 d = new Vector2(vec.x - orig.x, -(v...
private float calculateAngle (float a) { Vector3 camPos = calculateDirection(a); position.set(camPos.mul(30)); lookAt(0, 0, 0); normalizeUp(); update(); Vector3 orig = new Vector3(0, 0, 0); Vector3 vec = new Vector3(1, 0, 0); project(orig); project(vec); Vector2 d = new Vector2(vec.x - orig.x, -(v...
public BoundingBox set (Vector3 minimum, Vector3 maximum) { min.set(minimum.x < maximum.x ? minimum.x : maximum.x, minimum.y < maximum.y ? minimum.y : maximum.y, minimum.z < maximum.z ? minimum.z : maximum.z); max.set(minimum.x > maximum.x ? minimum.x : maximum.x, minimum.y > maximum.y ? minimum.y : maximum.y, ...
public BoundingBox set (Vector3 minimum, Vector3 maximum) { min.set(minimum.x < maximum.x ? minimum.x : maximum.x, minimum.y < maximum.y ? minimum.y : maximum.y, minimum.z < maximum.z ? minimum.z : maximum.z); max.set(minimum.x > maximum.x ? minimum.x : maximum.x, minimum.y > maximum.y ? minimum.y : maximum.y, ...
public void update (float deltaTime) { dist += dir.len() * deltaTime; if (dist > maxDist) { dir.scl(-1); dist = 0; } platform.setLinearVelocity(dir); } }
public void update (float deltaTime) { dist += dir.len() * deltaTime; if (dist > maxDist) { dir.mul(-1); dist = 0; } platform.setLinearVelocity(dir); } }
public void render () { Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); int steps = 100; int size = 200; int x = Gdx.graphics.getWidth() / 2 - size / 2; int y = Gdx.graphics.getHeight() / 2 - size / 2; renderer.setProjectionMatrix(stage.getCamera().combined); renderer.begin(ShapeType.Line); renderer.box(x...
public void render () { Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); int steps = 100; int size = 200; int x = Gdx.graphics.getWidth() / 2 - size / 2; int y = Gdx.graphics.getHeight() / 2 - size / 2; renderer.setProjectionMatrix(stage.getCamera().combined); renderer.begin(ShapeType.Line); renderer.box(x...
public void create () { texture = new Texture(Gdx.files.internal("data/badlogicsmall.jpg")); float unitsOnX = (float)Math.sqrt(2) * TARGET_WIDTH / (UNIT_TO_PIXEL); float pixelsOnX = Gdx.graphics.getWidth() / unitsOnX; float unitsOnY = Gdx.graphics.getHeight() / pixelsOnX; cam = new OrthographicCamera(unitsOn...
public void create () { texture = new Texture(Gdx.files.internal("data/badlogicsmall.jpg")); float unitsOnX = (float)Math.sqrt(2) * TARGET_WIDTH / (UNIT_TO_PIXEL); float pixelsOnX = Gdx.graphics.getWidth() / unitsOnX; float unitsOnY = Gdx.graphics.getHeight() / pixelsOnX; cam = new OrthographicCamera(unitsOn...
public static final List<Class<? extends GdxTest>> tests = new ArrayList<Class<? extends GdxTest>>(Arrays.asList( AnimationTest.class, AccelerometerTest.class, ActionTest.class, ActionSequenceTest.class, GroupTest.class, AlphaTest.class, AtlasIssueTest.class, AssetManagerTest.class, FilterPerformanceTest.class, ...
public static final List<Class<? extends GdxTest>> tests = new ArrayList<Class<? extends GdxTest>>(Arrays.asList( AnimationTest.class, AccelerometerTest.class, ActionTest.class, ActionSequenceTest.class, GroupTest.class, AlphaTest.class, AtlasIssueTest.class, AssetManagerTest.class, FilterPerformanceTest.class, ...
public static void defaultNearCallback(btBroadphasePair collisionPair, btCollisionDispatcher dispatcher, btDispatcherInfo dispatchInfo) { CollisionJNI.btCollisionDispatcher_defaultNearCallback(collisionPair, btCollisionDispatcher.getCPtr(dispatcher), dispatcher, btDispatcherInfo.getCPtr(dispatchInfo), dispatchInf...
public static void defaultNearCallback(btBroadphasePair collisionPair, btCollisionDispatcher dispatcher, btDispatcherInfo dispatchInfo) { CollisionJNI.btCollisionDispatcher_defaultNearCallback(btBroadphasePair.getCPtr(collisionPair), collisionPair, btCollisionDispatcher.getCPtr(dispatcher), dispatcher, btDispatch...
public boolean processOverlap(btBroadphasePair pair) { return CollisionJNI.btOverlapCallback_processOverlap(swigCPtr, this, pair); }
public boolean processOverlap(btBroadphasePair pair) { return CollisionJNI.btOverlapCallback_processOverlap(swigCPtr, this, btBroadphasePair.getCPtr(pair), pair); }
public void toJson (Object object, Class knownType, Class elementType, FileHandle file) { Writer writer = null; try { writer = file.writer(false); toJson(object, knownType, elementType, writer); } catch (Exception ex) { throw new SerializationException("Error writing file: " + file, ex); } finally { ...
public void toJson (Object object, Class knownType, Class elementType, FileHandle file) { Writer writer = null; try { writer = file.writer(false, "UTF-8"); toJson(object, knownType, elementType, writer); } catch (Exception ex) { throw new SerializationException("Error writing file: " + file, ex); } fi...
public JsonValue parse (FileHandle file) { try { return parse(file.read()); } catch (Exception ex) { throw new SerializationException("Error parsing file: " + file, ex); } }
public JsonValue parse (FileHandle file) { try { return parse(file.reader("UTF-8")); } catch (Exception ex) { throw new SerializationException("Error parsing file: " + file, ex); } }
public void draw (SpriteBatch batch, float parentAlpha) { validate(); super.draw(batch, parentAlpha); }
public void draw (SpriteBatch batch, float parentAlpha) { validate(); super.drawChildren(batch, parentAlpha); }
public boolean overlaps (Sphere sphere) { return center.dst2(sphere.center) < radius * radius + sphere.radius * radius; }
public boolean overlaps (Sphere sphere) { return center.dst2(sphere.center) < (radius+sphere.radius)*(radius+sphere.radius); }
public boolean needsGL20 () { return false; }
public boolean needsGL20 () { return true; }
private void createUI () { Skin skin = new Skin(Gdx.files.internal("data/uiskin.xml"), Gdx.files.internal("data/uiskin.png")); ui = new Stage(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), false); String[] filters = new String[TextureFilter.values().length]; int idx = 0; for (TextureFilter filter : Text...
private void createUI () { Skin skin = new Skin(Gdx.files.internal("data/uiskin.json"), Gdx.files.internal("data/uiskin.png")); ui = new Stage(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), false); String[] filters = new String[TextureFilter.values().length]; int idx = 0; for (TextureFilter filter : Tex...
public boolean shouldRender () { synchronized (this) { boolean rq = requestRendering; requestRendering = false; return rq || isContinuous; } }
public boolean shouldRender () { synchronized (this) { boolean rq = requestRendering; requestRendering = false; return rq || isContinuous || Display.isDirty(); } }
@Test public void testIndexActions() throws Exception { logger.info("Running Cluster Health"); ClusterHealthResponse clusterHealth = client1.admin().cluster().health(clusterHealth().waitForGreenStatus()).actionGet(); logger.info("Done Cluster Health, status " + clusterHealth.status()); ...
@Test public void testIndexActions() throws Exception { logger.info("Running Cluster Health"); ClusterHealthResponse clusterHealth = client1.admin().cluster().health(clusterHealth().waitForGreenStatus()).actionGet(); logger.info("Done Cluster Health, status " + clusterHealth.status()); ...
public static void main (String[] args) throws Exception { new NativeCodeGenerator().generate("src/", "bin/", "jni/"); BuildConfig buildConfig = new BuildConfig("gdx-controllers-desktop"); BuildTarget win32home = BuildTarget.newDefaultTarget(TargetOs.Windows, false); win32home.buildFileName = "build-windows32h...
public static void main (String[] args) throws Exception { new NativeCodeGenerator().generate("src/", "bin/", "jni/"); BuildConfig buildConfig = new BuildConfig("gdx-controllers-desktop"); BuildTarget win32home = BuildTarget.newDefaultTarget(TargetOs.Windows, false); win32home.buildFileName = "build-windows32h...
public void onDrawFrame (javax.microedition.khronos.opengles.GL10 gl) { long time = System.nanoTime(); deltaTime = (time - lastFrameTime) / 1000000000.0f; lastFrameTime = time; mean.addValue(deltaTime); boolean lrunning = false; boolean lpause = false; boolean ldestroy = false; boolean lresume = false...
public void onDrawFrame (javax.microedition.khronos.opengles.GL10 gl) { long time = System.nanoTime(); deltaTime = (time - lastFrameTime) / 1000000000.0f; lastFrameTime = time; mean.addValue(deltaTime); boolean lrunning = false; boolean lpause = false; boolean ldestroy = false; boolean lresume = false...
import org.robovm.apple.foundation.NSObject; /******************************************************************************* * Copyright 2013 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain ...
import org.robovm.apple.foundation.NSObject; /******************************************************************************* * Copyright 2013 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain ...
public void draw(GLKView view, CGRect rect) { if(!created) { app.graphics.makeCurrent(); app.listener.create(); app.listener.resize(width, height); created = true; } if (paused) { if (!wasPaused) { Array<LifecycleListener> listeners = app.lifecycleListeners; synchronized (listeners) { ...
public void draw(GLKView view, CGRect rect) { if(!created) { app.graphics.makeCurrent(); app.listener.create(); app.listener.resize(width, height); created = true; } if (paused) { if (!wasPaused) { Array<LifecycleListener> listeners = app.lifecycleListeners; synchronized (listeners) { ...
@Test public void testSimpleMapper() throws Exception { DocumentMapperParser mapperParser = MapperTests.newParser(); DocumentMapper docMapper = doc("test", rootObject("person") .add(object("name").add(stringField("first").store(YES).index(Field.Index.NO))) ...
@Test public void testSimpleMapper() throws Exception { DocumentMapperParser mapperParser = MapperTests.newParser(); DocumentMapper docMapper = doc("test", rootObject("person") .add(object("name").add(stringField("first").store(YES).index(Field.Index.NO))) ...
public AtomicNumericFieldData loadDirect(AtomicReaderContext context) throws Exception { AtomicReader reader = context.reader(); Terms terms = reader.terms(getFieldNames().indexName()); if (terms == null) { return PackedArrayAtomicFieldData.empty(reader.maxDoc()); } ...
public AtomicNumericFieldData loadDirect(AtomicReaderContext context) throws Exception { AtomicReader reader = context.reader(); Terms terms = reader.terms(getFieldNames().indexName()); if (terms == null) { return PackedArrayAtomicFieldData.empty(reader.maxDoc()); } ...
public void testSnapshotMoreThanOnce() throws ExecutionException, InterruptedException, IOException { Client client = client(); logger.info("--> creating repository"); assertAcked(client.admin().cluster().preparePutRepository("test-repo") .setType("fs").setSettings(Immutabl...
public void testSnapshotMoreThanOnce() throws ExecutionException, InterruptedException, IOException { Client client = client(); logger.info("--> creating repository"); assertAcked(client.admin().cluster().preparePutRepository("test-repo") .setType("fs").setSettings(Immutabl...
public boolean FinishedLaunching (UIApplication uiApp, NSDictionary options) { this.uiApp = uiApp; // enable or disable screen dimming UIApplication.get_SharedApplication().set_IdleTimerDisabled(config.preventScreenDimming); // fix the scale factor if we have a retina device (NOTE: iOS screen sizes are in "p...
public boolean FinishedLaunching (UIApplication uiApp, NSDictionary options) { this.uiApp = uiApp; // enable or disable screen dimming UIApplication.get_SharedApplication().set_IdleTimerDisabled(config.preventScreenDimming); // fix the scale factor if we have a retina device (NOTE: iOS screen sizes are in "p...
protected AnimationDesc setAnimation(final AnimationDesc anim) { if (updating) // FIXME Remove this? Just intended for debugging throw new GdxRuntimeException("Cannot change animation during update"); if (current == null) current = anim; else { if (!allowSameAnimation && anim != null && current.animatio...
protected AnimationDesc setAnimation(final AnimationDesc anim) { if (updating) // FIXME Remove this? Just intended for debugging throw new GdxRuntimeException("Cannot change animation during update"); if (current == null) current = anim; else { if (anim != null && current.animation == anim.animation) ...
public void run () { graphics.setVSync(graphics.config.vSyncEnabled); try { LwjglApplication.this.mainLoop(); } catch (Throwable t) { if (audio != null) audio.dispose(); if (t instanceof RuntimeException) throw (RuntimeException)t; else throw new GdxRuntimeException(t); ...
public void run () { graphics.setVSync(graphics.config.vSyncEnabled); try { LwjglApplication.this.mainLoop(); } catch (Throwable t) { if (audio != null) audio.dispose(); if (t instanceof RuntimeException) throw (RuntimeException)t; else throw new GdxRuntimeException(t); ...
public Matrix4 setToLookAt (Vector3 position, Vector3 target, Vector3 up) { tmpVec.set(target).sub(position); setToLookAt(tmpVec, up); this.mul(tmpMat.setToTranslation(position.tmp().mul(-1))); return this; }
public Matrix4 setToLookAt (Vector3 position, Vector3 target, Vector3 up) { tmpVec.set(target).sub(position); setToLookAt(tmpVec, up); this.mul(tmpMat.setToTranslation(position.tmp().scl(-1))); return this; }
public void update (float deltaTime) { if (state == FLYING) { // if(pos.dst(map.bob.pos) < pos.dst(map.cube.pos)) vel.set(map.bob.pos); // else vel.set(map.cube.pos); vel.set(map.bob.pos); vel.sub(pos).nor().mul(VELOCITY); pos.add(vel.x * deltaTime, vel.y * deltaTime); bounds.x = pos.x + 0.2f; bounds....
public void update (float deltaTime) { if (state == FLYING) { // if(pos.dst(map.bob.pos) < pos.dst(map.cube.pos)) vel.set(map.bob.pos); // else vel.set(map.cube.pos); vel.set(map.bob.pos); vel.sub(pos).nor().scl(VELOCITY); pos.add(vel.x * deltaTime, vel.y * deltaTime); bounds.x = pos.x + 0.2f; bounds....
public Array<Vector2> generatePositions(int n) { Array<Vector2> positions = new Array<Vector2>(); for (int i = 1; i <= n; ++i) { positions.add(new Vector2(MathUtils.cos(i / n), MathUtils.sin(i / n)).mul(200)); } return positions; }
public Array<Vector2> generatePositions(int n) { Array<Vector2> positions = new Array<Vector2>(); for (int i = 1; i <= n; ++i) { positions.add(new Vector2(MathUtils.cos(i / n), MathUtils.sin(i / n)).scl(200)); } return positions; }
public void draw(SpriteBatch spriteBatch) { super.draw(spriteBatch); delta = Math.min(0.06f, Gdx.graphics.getDeltaTime()); since_alive += delta; facing.rotate((SPEED + random_speed) * delta).nor(); position.add(facing.mul((SPEED + random_speed) * delta)); this.setPosition(position.x, position.y); if ...
public void draw(SpriteBatch spriteBatch) { super.draw(spriteBatch); delta = Math.min(0.06f, Gdx.graphics.getDeltaTime()); since_alive += delta; facing.rotate((SPEED + random_speed) * delta).nor(); position.add(facing.scl((SPEED + random_speed) * delta)); this.setPosition(position.x, position.y); if ...
public Bomb(int id, Vector2 position, Vector2 facing) { super(id, position, facing); bulletSpeed = 150; this.velocity = new Vector2().set(facing).mul(bulletSpeed); damage = 300; this.set(Resources.getInstance().bomb); this.setOrigin(this.getWidth()/2, this.getHeight()/2); }
public Bomb(int id, Vector2 position, Vector2 facing) { super(id, position, facing); bulletSpeed = 150; this.velocity = new Vector2().set(facing).scl(bulletSpeed); damage = 300; this.set(Resources.getInstance().bomb); this.setOrigin(this.getWidth()/2, this.getHeight()/2); }
public void retarget() { target = Targeting.getNearestOfType(frigate, 0); if (target == null) { target = Targeting.getNearestOfType(frigate, 1); } if (target == null) { target = Targeting.getNearestOfType(frigate, 2); } if (target == null) { target = Targeting.getNearestOfType(frigate, 3); } ...
public void retarget() { target = Targeting.getNearestOfType(frigate, 0); if (target == null) { target = Targeting.getNearestOfType(frigate, 1); } if (target == null) { target = Targeting.getNearestOfType(frigate, 2); } if (target == null) { target = Targeting.getNearestOfType(frigate, 3); } ...
public Missile(int id, Vector2 position, Vector2 facing) { super(id, position, facing); turnSpeed = 300f; accel = 300.0f; bulletSpeed = 50; this.velocity = new Vector2().set(facing).mul(bulletSpeed); damage = 50; this.set(Resources.getInstance().missile); this.setOrigin(this.getWidth()/2, this.getH...
public Missile(int id, Vector2 position, Vector2 facing) { super(id, position, facing); turnSpeed = 300f; accel = 300.0f; bulletSpeed = 50; this.velocity = new Vector2().set(facing).scl(bulletSpeed); damage = 50; this.set(Resources.getInstance().missile); this.setOrigin(this.getWidth()/2, this.getH...
public Vector2 predict() { relativeVel.set(missile.velocity).sub(target.velocity); toTarget.set(target.collisionCenter).sub(missile.collisionCenter); if (missile.velocity.dot(toTarget) != 0) { float time_to_target = toTarget.dot(toTarget) / relativeVel.dot(toTarget); return new Vector2(target.collisionCent...
public Vector2 predict() { relativeVel.set(missile.velocity).sub(target.velocity); toTarget.set(target.collisionCenter).sub(missile.collisionCenter); if (missile.velocity.dot(toTarget) != 0) { float time_to_target = toTarget.dot(toTarget) / relativeVel.dot(toTarget); return new Vector2(target.collisionCent...
private void updateParticle(Particle particle) { delta = Math.min(0.06f, Gdx.graphics.getDeltaTime()); if (particle.life > 0) { particle.life -= delta; particle.position.add(particle.velocity.x * delta*10,particle.velocity.y * delta*10); particle.velocity.mul((float) Math.pow(damping, delta)); parti...
private void updateParticle(Particle particle) { delta = Math.min(0.06f, Gdx.graphics.getDeltaTime()); if (particle.life > 0) { particle.life -= delta; particle.position.add(particle.velocity.x * delta*10,particle.velocity.y * delta*10); particle.velocity.scl((float) Math.pow(damping, delta)); parti...
public void updateControls (float delta) { presenter.setController(0.0f, 0.0f); if (Gdx.input.justTouched()) { worldCam.unproject(touchPoint.set(Gdx.input.getX(), Gdx.input.getY(), 0)); if (world.isPaused()) { presenter.resume(); } else if (touchPoint.y >= worldMaxY) { presenter.pause(); } } ...
public void updateControls (float delta) { presenter.setController(0.0f, 0.0f); if (Gdx.input.justTouched()) { worldCam.unproject(touchPoint.set(Gdx.input.getX(), Gdx.input.getY(), 0)); if (world.isPaused()) { presenter.resume(); } else if (touchPoint.y >= worldMaxY) { presenter.pause(); } } ...
private float calculateAngle (float a) { Vector3 camPos = calculateDirection(a); position.set(camPos.mul(30)); lookAt(0, 0, 0); normalizeUp(); update(); Vector3 orig = new Vector3(0, 0, 0); Vector3 vec = new Vector3(1, 0, 0); project(orig); project(vec); Vector2 d = new Vector2(vec.x - orig.x, -(v...
private float calculateAngle (float a) { Vector3 camPos = calculateDirection(a); position.set(camPos.scl(30)); lookAt(0, 0, 0); normalizeUp(); update(); Vector3 orig = new Vector3(0, 0, 0); Vector3 vec = new Vector3(1, 0, 0); project(orig); project(vec); Vector2 d = new Vector2(vec.x - orig.x, -(v...
public BoundingBox set (Vector3 minimum, Vector3 maximum) { min.set(minimum.x < maximum.x ? minimum.x : maximum.x, minimum.y < maximum.y ? minimum.y : maximum.y, minimum.z < maximum.z ? minimum.z : maximum.z); max.set(minimum.x > maximum.x ? minimum.x : maximum.x, minimum.y > maximum.y ? minimum.y : maximum.y, ...
public BoundingBox set (Vector3 minimum, Vector3 maximum) { min.set(minimum.x < maximum.x ? minimum.x : maximum.x, minimum.y < maximum.y ? minimum.y : maximum.y, minimum.z < maximum.z ? minimum.z : maximum.z); max.set(minimum.x > maximum.x ? minimum.x : maximum.x, minimum.y > maximum.y ? minimum.y : maximum.y, ...
public void update (float deltaTime) { dist += dir.len() * deltaTime; if (dist > maxDist) { dir.mul(-1); dist = 0; } platform.setLinearVelocity(dir); } }
public void update (float deltaTime) { dist += dir.len() * deltaTime; if (dist > maxDist) { dir.scl(-1); dist = 0; } platform.setLinearVelocity(dir); } }
public void render () { Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); int steps = 100; int size = 200; int x = Gdx.graphics.getWidth() / 2 - size / 2; int y = Gdx.graphics.getHeight() / 2 - size / 2; renderer.setProjectionMatrix(stage.getCamera().combined); renderer.begin(ShapeType.Line); renderer.box(x...
public void render () { Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); int steps = 100; int size = 200; int x = Gdx.graphics.getWidth() / 2 - size / 2; int y = Gdx.graphics.getHeight() / 2 - size / 2; renderer.setProjectionMatrix(stage.getCamera().combined); renderer.begin(ShapeType.Line); renderer.box(x...
public void create () { texture = new Texture(Gdx.files.internal("data/badlogicsmall.jpg")); float unitsOnX = (float)Math.sqrt(2) * TARGET_WIDTH / (UNIT_TO_PIXEL); float pixelsOnX = Gdx.graphics.getWidth() / unitsOnX; float unitsOnY = Gdx.graphics.getHeight() / pixelsOnX; cam = new OrthographicCamera(unitsOn...
public void create () { texture = new Texture(Gdx.files.internal("data/badlogicsmall.jpg")); float unitsOnX = (float)Math.sqrt(2) * TARGET_WIDTH / (UNIT_TO_PIXEL); float pixelsOnX = Gdx.graphics.getWidth() / unitsOnX; float unitsOnY = Gdx.graphics.getHeight() / pixelsOnX; cam = new OrthographicCamera(unitsOn...
public TokenStream create(TokenStream tokenStream) { ShingleFilter filter = new ShingleFilter(tokenStream, maxShingleSize, minShingleSize); filter.setOutputUnigrams(outputUnigrams); filter.setOutputUnigramsIfNoShingles(outputUnigramsIfNoShingles); filter.setTokenSeparator(tokenSepara...
public TokenStream create(TokenStream tokenStream) { ShingleFilter filter = new ShingleFilter(tokenStream, minShingleSize, maxShingleSize); filter.setOutputUnigrams(outputUnigrams); filter.setOutputUnigramsIfNoShingles(outputUnigramsIfNoShingles); filter.setTokenSeparator(tokenSepara...
public float getAngleAroundRad (final float axisX, final float axisY, final float axisZ) { final float d = Vector3.dot(this.x, this.y, this.z, axisX, axisY, axisZ); final float l2 = Quaternion.len2(axisX * d, axisY * d, axisZ * d, this.w); return MathUtils.isZero(l2) ? 0f : (float)(2.0 * Math.acos(this.w / Math....
public float getAngleAroundRad (final float axisX, final float axisY, final float axisZ) { final float d = Vector3.dot(this.x, this.y, this.z, axisX, axisY, axisZ); final float l2 = Quaternion.len2(axisX * d, axisY * d, axisZ * d, this.w); return l2 == 0f ? 0f : (float)(2.0 * Math.acos(this.w / Math.sqrt(l2))); ...
public void render () { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); batch.begin(); if (screenshot == null) { int width = Gdx.graphics.getWidth(), height = Gdx.graphics.getHeight(); for (int i = 0; i < 100; i++) batch.draw(badlogic, MathUtils.random(width), MathUtils.random(height)); batch.flush(); ...
public void render () { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); batch.begin(); if (screenshot == null) { int width = Gdx.graphics.getWidth(), height = Gdx.graphics.getHeight(); for (int i = 0; i < 100; i++) batch.draw(badlogic, MathUtils.random(width), MathUtils.random(height)); batch.flush(); ...
public static EsThreadPoolExecutor newCached(long keepAliveTime, TimeUnit unit, ThreadFactory threadFactory) { return new EsThreadPoolExecutor(0, Integer.MAX_VALUE, keepAliveTime, unit, new SynchronousQueue<Runnable>(), threadFactory); }
public static EsThreadPoolExecutor newCached(long keepAliveTime, TimeUnit unit, ThreadFactory threadFactory) { return new EsThreadPoolExecutor(0, Integer.MAX_VALUE, keepAliveTime, unit, new SynchronousQueue<Runnable>(), threadFactory, new EsAbortPolicy()); }
public void touchMoved(NSSet touches, UIEvent event) { toTouchEvents(touches, event); } void processEvents() { synchronized(touchEvents) { justTouched = false; if(inputProcessor != null) { for(TouchEvent event: touchEvents) { currentEvent = event; switch(event.phase) { case UITouchPhas...
public void touchMoved(NSSet touches, UIEvent event) { toTouchEvents(touches, event); } void processEvents() { synchronized(touchEvents) { justTouched = false; if(inputProcessor != null) { for(TouchEvent event: touchEvents) { currentEvent = event; switch(event.phase) { case UITouchPhas...
public CheckBox (String text, CheckBoxStyle style) { super(text, style); clearChildren(); add(image = new Image(style.checkboxOff)); Label label = getLabel(); add(label); label.setAlignment(Align.left); setWidth(getPrefWidth()); setHeight(getPrefHeight()); }
public CheckBox (String text, CheckBoxStyle style) { super(text, style); clear(); add(image = new Image(style.checkboxOff)); Label label = getLabel(); add(label); label.setAlignment(Align.left); setWidth(getPrefWidth()); setHeight(getPrefHeight()); }
public void render(Application app) { GL10 gl = app.getGraphics().getGL10(); gl.glClear( GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT ); gl.glEnable( GL10.GL_DEPTH_TEST ); gl.glPolygonMode( GL10.GL_FRONT_AND_BACK, GL10.GL_FILL ); camera.setMatrices( app.getGraphics() ); angle+=app.getGraphi...
public void render(Application app) { GL10 gl = app.getGraphics().getGL10(); gl.glClear( GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT ); gl.glEnable( GL10.GL_DEPTH_TEST ); gl.glPolygonMode( GL10.GL_FRONT_AND_BACK, GL10.GL_FILL ); camera.setMatrices( app.getGraphics() ); angle+=app.getGraphi...
@Override public void run() { File file = new File(path, blobName); RandomAccessFile raf = null; try { raf = new RandomAccessFile(file, "rw"); } catch (FileNotFoundException e) { listener.onFailure(e); ...
@Override public void run() { File file = new File(path, blobName); RandomAccessFile raf; try { raf = new RandomAccessFile(file, "rw"); } catch (FileNotFoundException e) { listener.onFailure(e); ...
public static XContentBuilder restContentBuilder(RestRequest request) throws IOException { XContentType contentType = XContentType.fromRestContentType(request.header("Content-Type")); if (contentType == null) { // try and guess it from the body, if exists if (request.hasConte...
public static XContentBuilder restContentBuilder(RestRequest request) throws IOException { XContentType contentType = XContentType.fromRestContentType(request.param("format", request.header("Content-Type"))); if (contentType == null) { // try and guess it from the body, if exists ...
@Test public void testSimpleRecovery() throws Exception { startNode("server1"); client("server1").admin().indices().create(createIndexRequest("test")).actionGet(5000); logger.info("Running Cluster Health"); ClusterHealthResponse clusterHealth = client("server1").admin().cluster().h...
@Test public void testSimpleRecovery() throws Exception { startNode("server1"); client("server1").admin().indices().create(createIndexRequest("test")).actionGet(5000); logger.info("Running Cluster Health"); ClusterHealthResponse clusterHealth = client("server1").admin().cluster().h...
public static void main (String[] argv) { new JoglApplication(new com.badlogic.gdx.tests.MeshMultitextureTest(), "Debug Test", 480, 320, false); }
public static void main (String[] argv) { new JoglApplication(new com.badlogic.gdx.tests.StagePerformanceTest(), "Debug Test", 480, 320, false); }
public void testHasChildQueryWithMinimumScore() throws Exception { client().admin().indices().prepareCreate("test") .setSettings(ImmutableSettings.settingsBuilder().put("index.number_of_shards", 1).put("index.number_of_replicas", 0)) .execute().actionGet(); client().a...
public void testHasChildQueryWithMinimumScore() throws Exception { client().admin().indices().prepareCreate("test") .setSettings(ImmutableSettings.settingsBuilder().put("index.number_of_shards", 1).put("index.number_of_replicas", 0)) .execute().actionGet(); client().a...
public void rotate( Vector3 vec ) { inv.x = -x; inv.y = -y; inv.z = -z; inv.w = w; inv.normalize(); tmp.set( this ); tmp.multiply( vec ); tmp.multiply( inv ); vec.x = tmp.x; vec.y = tmp.y; vec.z = tmp.z; }
public void rotate( Vector3 vec ) { inv.x = -x; inv.y = -y; inv.z = -z; inv.w = w; // inv.normalize(); tmp.set( this ); tmp.multiply( vec ); tmp.multiply( inv ); vec.x = tmp.x; vec.y = tmp.y; vec.z = tmp.z; }
private final static InetAddress localAddress; static { InetAddress localAddressX = null; try { localAddressX = InetAddress.getLocalHost(); } catch (UnknownHostException e) { logger.warn("Failed to find local host", e); } localAddress = localAddre...
private final static InetAddress localAddress; static { InetAddress localAddressX = null; try { localAddressX = InetAddress.getLocalHost(); } catch (UnknownHostException e) { logger.trace("Failed to find local host", e); } localAddress = localAddr...
public static void main (String[] args) throws Exception { // generate C/C++ code new NativeCodeGenerator().generate("src", "bin", "jni"); // Flags to accomodate SWIG generated code String cppFlags = ""; // SWIG doesn't emit strict aliasing compliant code cppFlags += " -fno-strict-aliasing"; // SWIG di...
public static void main (String[] args) throws Exception { // generate C/C++ code new NativeCodeGenerator().generate("src", "bin", "jni"); // Flags to accomodate SWIG generated code String cppFlags = ""; // SWIG doesn't emit strict aliasing compliant code cppFlags += " -fno-strict-aliasing"; // SWIG di...
public Matrix4 toMatrix4(final Matrix4 out) { out.idt(); out.translate(translation); out.rotate(rotation); out.scl(scale); return out; }
public Matrix4 toMatrix4(final Matrix4 out) { out.idt(); out.translate(translation); out.rotate(rotation); out.scale(scale.x, scale.y, scale.z); return out; }
public void create () { ObjLoader objLoader = new ObjLoader(); model = objLoader.loadModel(Gdx.files.internal("data/cube.obj")); BoundingBox bbox = new BoundingBox(); model.getBoundingBox(bbox); Gdx.app.log("ObjTest", "obj bounds: " + bbox); texture = new Texture(Gdx.files.internal("data/badlogic.jp...
public void create () { ObjLoader objLoader = new ObjLoader(); model = objLoader.loadModel(Gdx.files.internal("data/cube.obj")); BoundingBox bbox = new BoundingBox(); model.calculateBoundingBox(bbox); Gdx.app.log("ObjTest", "obj bounds: " + bbox); texture = new Texture(Gdx.files.internal("data/badlo...
public BulletConstructor (final Model model, final float mass) { final BoundingBox boundingBox = new BoundingBox(); model.getBoundingBox(boundingBox); final Vector3 dimensions = boundingBox.getDimensions(); create(model, mass, dimensions.x, dimensions.y, dimensions.z); }
public BulletConstructor (final Model model, final float mass) { final BoundingBox boundingBox = new BoundingBox(); model.calculateBoundingBox(boundingBox); final Vector3 dimensions = boundingBox.getDimensions(); create(model, mass, dimensions.x, dimensions.y, dimensions.z); }
protected BulletEntity ground;
public void dispose () { super.dispose(); ground = null; } }
public interface Vector<T extends Vector<T>> { /******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtai...
public interface Vector<T extends Vector<T>> { /******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtai...
@Inject public RestNodesInfoAction(Settings settings, Client client, RestController controller) { super(settings, client); controller.registerHandler(RestRequest.Method.GET, "/_cluster/nodes", this); controller.registerHandler(RestRequest.Method.GET, "/_cluster/nodes/${nodeId}", this); ...
@Inject public RestNodesInfoAction(Settings settings, Client client, RestController controller) { super(settings, client); controller.registerHandler(RestRequest.Method.GET, "/_cluster/nodes", this); controller.registerHandler(RestRequest.Method.GET, "/_cluster/nodes/{nodeId}", this); }...
@Override public void run() { try { metaDataService.createIndex(indexMetaData.index(), indexMetaData.settings(), indexMetaData.mappings(), timeValueMillis(10)); } catch (Except...
@Override public void run() { try { metaDataService.createIndex("gateway", indexMetaData.index(), indexMetaData.settings(), indexMetaData.mappings(), timeValueMillis(10)); } ca...
public static void generateMipMap (int target, Pixmap pixmap, int textureWidth, int textureHeight, boolean disposePixmap) { if (!useHWMipMap) { generateMipMapCPU(target, pixmap, textureWidth, textureHeight, disposePixmap); return; } if (Gdx.app.getType() == ApplicationType.Android) { if (Gdx.graphics.i...
public static void generateMipMap (int target, Pixmap pixmap, int textureWidth, int textureHeight, boolean disposePixmap) { if (!useHWMipMap) { generateMipMapCPU(target, pixmap, textureWidth, textureHeight, disposePixmap); return; } if (Gdx.app.getType() == ApplicationType.Android || Gdx.app.getType() == ...
public static void main(String[] args) { System.out.println("ElasticSearch Version: " + Version.CURRENT + ", JVM: " + JvmInfo.jvmInfo().version() + "(" + JvmInfo.jvmInfo().vmVersion() + ")"); }
public static void main(String[] args) { System.out.println("Version: " + Version.CURRENT + ", Build: " + Build.CURRENT.hashShort() + "/" + Build.CURRENT.timestamp() + ", JVM: " + JvmInfo.jvmInfo().version()); }
public void translate (float velocityX, float velocityY) { /** If velocities squares summed is shorter than Epsilon it could lead ~0 length rayCast that cause nasty c++ assertion * inside box2d. This is so short distance that moving particle has no effect so this return early. */ if ((velocityX * velocityX ...
public void translate (float velocityX, float velocityY) { /** If velocities squares summed is shorter than Epsilon it could lead ~0 length rayCast that cause nasty c++ assertion * inside box2d. This is so short distance that moving particle has no effect so this return early. */ if ((velocityX * velocityX ...
public void initialize (ApplicationListener listener, AndroidApplicationConfiguration config) { if (DEBUG) Log.d(TAG, " > AndroidLiveWallpaperService - initialize()"); app.initialize(listener, config); if (config.getTouchEventsForLiveWallpaper && Integer.parseInt(android.os.Build.VERSION.SDK) < 9) linke...
public void initialize (ApplicationListener listener, AndroidApplicationConfiguration config) { if (DEBUG) Log.d(TAG, " > AndroidLiveWallpaperService - initialize()"); app.initialize(listener, config); if (config.getTouchEventsForLiveWallpaper && Integer.parseInt(android.os.Build.VERSION.SDK) >= 7) link...
public static String VERSION = "0.91"; }
public static String VERSION = "0.9.1"; }
protected int numDocs() { return 50000; }
protected int numDocs() { return 10000; }
public void testSortLongMVField() throws Exception { try { client.admin().indices().prepareDelete("test").execute().actionGet(); } catch (Exception e) { // ignore } client.admin().indices().prepareCreate("test") .setSettings(ImmutableSettings.s...
public void testSortMVField() throws Exception { try { client.admin().indices().prepareDelete("test").execute().actionGet(); } catch (Exception e) { // ignore } client.admin().indices().prepareCreate("test") .setSettings(ImmutableSettings.setti...
private String routing; String script; @Nullable String scriptLang; @Nullable Map<String, Object> scriptParams; int retryOnConflict = 1;
private String routing; String script; @Nullable String scriptLang; @Nullable Map<String, Object> scriptParams; int retryOnConflict = 0;
@Inject public ByteBufferStore(ShardId shardId, @IndexSettings Settings indexSettings) { super(shardId, indexSettings); this.bufferSize = componentSettings.getAsSize("bufferSize", new SizeValue(1, SizeUnit.KB)); this.cacheSize = componentSettings.getAsSize("cacheSize", new SizeValue(20, Siz...
@Inject public ByteBufferStore(ShardId shardId, @IndexSettings Settings indexSettings) { super(shardId, indexSettings); this.bufferSize = componentSettings.getAsSize("bufferSize", new SizeValue(100, SizeUnit.KB)); this.cacheSize = componentSettings.getAsSize("cacheSize", new SizeValue(20, S...
@Inject public HeapStore(ShardId shardId, @IndexSettings Settings indexSettings) { super(shardId, indexSettings); this.bufferSize = componentSettings.getAsSize("bufferSize", new SizeValue(1, SizeUnit.KB)); this.cacheSize = componentSettings.getAsSize("cacheSize", new SizeValue(20, SizeUnit....
@Inject public HeapStore(ShardId shardId, @IndexSettings Settings indexSettings) { super(shardId, indexSettings); this.bufferSize = componentSettings.getAsSize("bufferSize", new SizeValue(100, SizeUnit.KB)); this.cacheSize = componentSettings.getAsSize("cacheSize", new SizeValue(20, SizeUni...
public PolygonRegion (TextureRegion region, float[] vertices, short[] triangles) { this.region = region; this.vertices = vertices; this.triangles = triangles; float[] textureCoords = this.textureCoords = new float[vertices.length]; float u = region.u, v = region.v; float uvWidth = region.u2 - u; float u...
public PolygonRegion (TextureRegion region, float[] vertices, short[] triangles) { this.region = region; this.vertices = vertices; this.triangles = triangles; float[] textureCoords = this.textureCoords = new float[vertices.length]; float u = region.u, v = region.u; float uvWidth = region.u2 - u; float u...
package com.badlogic.gdx.graphics.g3d.lights; package com.badlogic.gdx.graphics.g3d.environment; import com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor; import com.badlogic.gdx.math.Matrix4; public interface ShadowMap { Matrix4 getProjViewTrans(); TextureDescriptor getDepthMap(); }
package com.badlogic.gdx.graphics.g3d.lights; package com.badlogic.gdx.graphics.g3d.lights; import com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor; import com.badlogic.gdx.math.Matrix4; public interface ShadowMap { Matrix4 getProjViewTrans(); TextureDescriptor getDepthMap(); }