buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
public java.util.Set<net.minecraft.util.math.BlockPos> generateTrunk(net.minecraft.world.World world, java.util.Random rand, forestry.arboriculture.worldgen.TreeBlockTypeLog wood, net.minecraft.util.math.BlockPos startPos) { forestry.core.worldgen.WorldGenHelper.generateTreeTrunk(world, rand, wood, startPos, height...
public java.util.Set<net.minecraft.util.math.BlockPos> generateTrunk(net.minecraft.world.World world, java.util.Random rand, forestry.arboriculture.worldgen.TreeBlockTypeLog wood, net.minecraft.util.math.BlockPos startPos) { forestry.core.worldgen.WorldGenHelper.generateTreeTrunk(world, rand, wood, startPos, height...
public void pingResponseDataPartShouldContainPingForConfigurationResponse() throws java.io.IOException, java.lang.InterruptedException { mockTestShs2Riv.expectedMinimumMessageCount(1); mockTestShs2Riv.expectedMessagesMatches(org.apache.camel.builder.xml.XPathBuilder.xpath("/ping:PingForConfigurationResponse/pin...
public void pingResponseDataPartShouldContainPingForConfigurationResponse() throws java.lang.Exception { context.start(); mockTestShs2Riv.expectedMinimumMessageCount(1); mockTestShs2Riv.expectedMessagesMatches(org.apache.camel.builder.xml.XPathBuilder.xpath("/ping:PingForConfigurationResponse/ping:pingDateT...
public int compare(android.location.Location t1, android.location.Location t2) { if ((t1.getTime()) > (t2.getTime())) { return 1; } if ((t2.getTime()) > (t1.getTime())) { return -1; } return 0; }
public int compare(android.location.Location t1, android.location.Location t2) { if ((t1.getTime()) > (t2.getTime())) { return -1; } if ((t2.getTime()) > (t1.getTime())) { return 1; } return 0; }
public static play.mvc.Result postPage(java.lang.String postName) { if ((controllers.Application.currentClient) == null) { return redirect(routes.Application.landing()); } java.util.List<controllers.Post> posts = controllers.Post.getPostsWithPostName(postName); controllers.Application.currentPos...
public static play.mvc.Result postPage(java.lang.String postName) { java.util.List<controllers.Post> posts = controllers.Post.getPostsWithPostName(postName); controllers.Application.currentPost = posts.get(0); java.util.List<controllers.Comment> comments = controllers.Comment.findComments(postName); ret...
public org.jowidgets.api.model.item.IMenuModel editMenu(final org.jowidgets.cap.ui.api.widgets.IBeanTable<BEAN_TYPE> table, final int columnIndex, final org.jowidgets.api.model.item.IMenuModel menuModel) { if ((model.getUpdaterService()) == null) { return null; }else if (hasDefaultEditAction) { ...
public org.jowidgets.api.model.item.IMenuModel editMenu(final org.jowidgets.cap.ui.api.widgets.IBeanTable<BEAN_TYPE> table, final int columnIndex, final org.jowidgets.api.model.item.IMenuModel menuModel) { if ((model.getUpdaterService()) == null) { return null; }else if (hasDefaultEditAction) { ...
public void importConcept_shouldRetireConcept() throws java.lang.Exception { org.openmrs.module.openconceptlab.client.OclConcept oclConcept = newOclConcept(); org.junit.Assert.assertFalse(oclConcept.isRetired()); importer.importConcept(new org.openmrs.module.openconceptlab.CacheService(conceptService), null...
public void importConcept_shouldRetireConcept() throws java.lang.Exception { org.openmrs.module.openconceptlab.client.OclConcept oclConcept = newOclConcept(); org.junit.Assert.assertFalse(oclConcept.isRetired()); importer.importConcept(new org.openmrs.module.openconceptlab.CacheService(conceptService), upda...
public int getPower(double speed, int resistance) { double power = 0.0; if (speed > 0) { power = ((3.05 + (4.577 * speed)) + ((0.01798 * speed) * speed)) + ((((-2.038E-5) * speed) * speed) * speed); } return ((int) (power)); }
public int getPower(double speed, int resistance) { double power = 0.0; if (speed > 0) { power = ((3.05 + (4.577 * speed)) + ((0.01798 * speed) * speed)) + (((2.038E-5 * speed) * speed) * speed); } return ((int) (power)); }
protected void setResultActivityError(java.lang.String srvStr, java.lang.Exception e) { resultActivityError = ((e.getClass().getName()) + " : Cannot connect to ") + srvStr; java.lang.String msg = e.getMessage(); if (msg != null) resultActivityError.concat((" : " + (e.getMessage()))); }
protected void setResultActivityError(java.lang.String srvStr, java.lang.Exception e) { resultActivityError = ((e.getClass().getName()) + " : Cannot connect to ") + srvStr; java.lang.String msg = e.getMessage(); if (msg != null) resultActivityError = ((resultActivityError) + " : ") + (e.getMessage()...
public char getGrid(int x, int y) throws java.io.IOException { outToServer.writeBytes((((("GRID " + x) + " ") + y) + "\n")); java.lang.String response = inFromServer.readLine(); return response.charAt(0); }
public char getGrid(int x, int y) throws java.io.IOException { outToServer.writeBytes((((("GRID " + x) + " ") + y) + "\n")); java.lang.String response = inFromServer.readLine(); java.lang.System.out.print((response + " ")); return response.charAt(0); }
public edu.aku.hassannaqvi.mapps_form2.LHWsContract Sync(org.json.JSONObject jsonObject) throws org.json.JSONException { this._ID = jsonObject.getLong(edu.aku.hassannaqvi.mapps_form2.LHWsContract.singleLhw._ID); this.lhwId = jsonObject.getString(edu.aku.hassannaqvi.mapps_form2.LHWsContract.singleLhw.COLUMN_LHWI...
public edu.aku.hassannaqvi.mapps_form2.LHWsContract Sync(org.json.JSONObject jsonObject) throws org.json.JSONException { this.lhwId = jsonObject.getString(edu.aku.hassannaqvi.mapps_form2.LHWsContract.singleLhw.COLUMN_LHWID); this.lhwName = jsonObject.getString(edu.aku.hassannaqvi.mapps_form2.LHWsContract.single...
public synchronized void advance(long duration, java.util.concurrent.TimeUnit unit) { if (duration <= 0) throw new java.lang.IllegalArgumentException(("Duration must be positive; was " + duration)); this.nanos += unit.toNanos(duration); for (; ;) { co.paralleluniverse.vtime.ManualClock....
public synchronized void advance(long duration, java.util.concurrent.TimeUnit unit) { if (duration <= 0) throw new java.lang.IllegalArgumentException(("Duration must be positive; was " + duration)); this.nanos += unit.toNanos(duration); for (; ;) { co.paralleluniverse.vtime.ManualClock....
public void factorial() { java.lang.Double num1 = ((java.math.BigDecimal) (numbers.pop())).doubleValue(); java.lang.System.out.println(num1); num1 = CalcModel.fact(num1); java.lang.System.out.println(num1); addToExpressionList("!"); updateRounding(num1.toString()); java.math.BigDecimal b = j...
public void factorial() { java.lang.Double num1 = ((java.math.BigDecimal) (numbers.pop())).doubleValue(); java.lang.System.out.println(num1); num1 = CalcModel.fact(num1); java.lang.System.out.println(num1); addToExpressionList("!"); updateRounding(num1.toString()); java.math.BigDecimal b = j...
public static java.lang.String _readString(java.lang.String prompt) { java.io.BufferedReader userInput = new java.io.BufferedReader(new java.io.InputStreamReader(java.lang.System.in)); java.lang.System.out.print(prompt); try { java.lang.String inputStr = userInput.readLine(); return inputStr...
public static java.lang.String _readString(java.lang.String prompt) { java.io.BufferedReader userInput = new java.io.BufferedReader(new java.io.InputStreamReader(java.lang.System.in)); java.lang.System.out.print(prompt); try { java.lang.String inputStr = userInput.readLine(); if (inputStr ==...
protected com.example.petr.myapplication.FilterResults performFiltering(java.lang.CharSequence charSequence) { com.example.petr.myapplication.FilterResults filterResults = new com.example.petr.myapplication.FilterResults(); java.util.List<java.lang.String> results = findSuggestions(charSequence.toString()); ...
protected com.example.petr.myapplication.FilterResults performFiltering(java.lang.CharSequence charSequence) { com.example.petr.myapplication.FilterResults filterResults = new com.example.petr.myapplication.FilterResults(); if (charSequence != null) { java.util.List<java.lang.String> results = findSugge...
public void actionPerformed(java.awt.event.ActionEvent e) { try { model.deleteCropLocationTrayLocation(blockID.getText(), bedID.getText(), cropName.getText(), varietyField.getText()); errorLabel.setText(""); repaint(); revalidate(); } catch (java.sql.SQLException e1) { er...
public void actionPerformed(java.awt.event.ActionEvent e) { try { model.deleteCropLocationTrayLocation(blockID.getText(), bedID.getText(), cropName.getText(), varietyField.getText()); errorLabel.setText(""); } catch (java.sql.SQLException e1) { errorLabel.setText("Invalid Field"); } ...
public void deleteStudy(java.lang.String username, java.lang.String studyUID) throws java.lang.Exception { edu.stanford.epad.epadws.models.Study study = getStudy(studyUID); if (study == null) return ; edu.stanford.epad.epadws.models.ProjectToSubjectToStudy projSubjStudy = ((edu.stanford.epad.ep...
public void deleteStudy(java.lang.String username, java.lang.String studyUID) throws java.lang.Exception { edu.stanford.epad.epadws.models.Study study = getStudy(studyUID); if (study == null) return ; new edu.stanford.epad.epadws.models.ProjectToSubjectToStudy().deleteObjects(("study_id=" + (st...
private void loginButtonPressed(javafx.event.ActionEvent __) { EmployeeContracts.IWorker worker = UtilsImplementations.InjectionFactory.getInstance(EmployeeImplementations.Worker.class, new EmployeeDI.WorkerDiConfigurator()); try { worker.login(username, password); EmployeeApplicationScreen.isEm...
private void loginButtonPressed(javafx.event.ActionEvent __) { EmployeeContracts.IWorker worker = UtilsImplementations.InjectionFactory.getInstance(EmployeeImplementations.Worker.class, new EmployeeDI.WorkerDiConfigurator()); try { worker.login(username, password); } catch (SMExceptions.SMException ...
public static void main(final java.lang.String[] args) throws java.lang.InterruptedException { final long runtime = ((args.length) > 1) ? java.lang.Long.parseLong(args[1]) : com.awesome.BaseExamplePeriod.DEFAULT_RUN_TIME_MSEC; com.awesome.ex1_2.Ex1_2 ex = new com.awesome.ex1_2.Ex1_2(runtime); ex.run(); ...
public static void main(final java.lang.String[] args) throws java.lang.InterruptedException { final long runtime = ((args.length) > 0) ? java.lang.Long.parseLong(args[0]) : com.awesome.BaseExamplePeriod.DEFAULT_RUN_TIME_MSEC; com.awesome.ex1_2.Ex1_2 ex = new com.awesome.ex1_2.Ex1_2(runtime); ex.run(); ...
public void onActivityResult(int requestCode, int resultCode, android.content.Intent data) { super.onActivityResult(requestCode, resultCode, data); if ((data != null) && ((data.getStringExtra(it.jaschke.alexandria.AddBook.ISBN_RESULT)) != "-1")) { ean.setText(data.getStringExtra(it.jaschke.alexandria.Ad...
public void onActivityResult(int requestCode, int resultCode, android.content.Intent data) { super.onActivityResult(requestCode, resultCode, data); if ((data != null) && (!(data.getStringExtra(it.jaschke.alexandria.AddBook.ISBN_RESULT).equals("-1")))) { ean.setText(data.getStringExtra(it.jaschke.alexand...
public void onClick(android.view.View v) { com.juntcompany.godandgod.Login.SignIn.SignInPolicyFragment f = new com.juntcompany.godandgod.Login.SignIn.SignInPolicyFragment(); SignInActivity.fNum = getActivity().getSupportFragmentManager().getBackStackEntryCount(); android.support.v4.app.FragmentTransaction f...
public void onClick(android.view.View v) { com.juntcompany.godandgod.Login.SignIn.SignInPolicyFragment f = new com.juntcompany.godandgod.Login.SignIn.SignInPolicyFragment(); SignInActivity.fNum = getActivity().getSupportFragmentManager().getBackStackEntryCount(); android.support.v4.app.FragmentTransaction f...
public void queryPOIListUpdate() { if ((((currentLocation) == null) || ((currentCompassValue) < 0)) || ((settingsManager.getPresetIdInRouterFragment()) < 1)) { return ; } org.walkersguide.utils.POIPreset preset = settingsManager.getPOIPreset(settingsManager.getPresetIdInRouterFragment()); boolea...
public void queryPOIListUpdate() { org.walkersguide.utils.POIPreset preset = settingsManager.getPOIPreset(settingsManager.getPresetIdInRouterFragment()); if ((((currentLocation) == null) || ((currentCompassValue) < 0)) || (preset == null)) { return ; } boolean isInsidePublicTransport = false; ...
public void itemStateChanged(java.awt.event.ItemEvent ie) { switch (ie.getStateChange()) { case 1 : emailInputField.setVisible(true); emailInputField.setEnabled(true); useEmail = true; break; case 2 : emailInputField.setVisible(false); ...
public void itemStateChanged(java.awt.event.ItemEvent ie) { switch (ie.getStateChange()) { case 1 : emailInputField.setEnabled(true); useEmail = true; break; case 2 : emailInputField.setEnabled(false); useEmail = false; break; ...
void killDepletedAgents() { for (Agents.Agent agent : agents) { if ((agent.food) <= 0) { GameLogic.Position deathPlace = agent.position; agents.remove(agent); tiles[deathPlace.x][deathPlace.y].agents.remove(agent); } } }
void killDepletedAgents() { if ((agents.size()) > 0) { for (Agents.Agent agent : agents) { if ((agent.food) <= 0) { GameLogic.Position deathPlace = agent.position; agents.remove(agent); tiles[deathPlace.x][deathPlace.y].agents.remove(agent); ...
public void checkJoin(java.lang.String id, java.lang.String password, java.lang.String checkPassword) { if (password.equals(checkPassword)) { com.project.snake.database.SnakeDTO data = new com.project.snake.database.SnakeDTO("join", id, password, 0, 0, 0, 0); data = network.sendData(data); i...
public void checkJoin(java.lang.String id, java.lang.String password, java.lang.String checkPassword) { if (password.equals(checkPassword)) { com.project.snake.database.SnakeDTO data = new com.project.snake.database.SnakeDTO("join", id, password, 0, 0, 0, 0); data = network.sendData(data); j...
private java.util.ArrayList<frogger.ObstacleRow<frogger.Car>> initializeCarRows() { java.util.ArrayList<frogger.ObstacleRow<frogger.Car>> newCars = new java.util.ArrayList<>(); frogger.ObstacleRow<frogger.Car> car1 = new frogger.ObstacleRow((-75), 150, 500, 50, 2, 500, new java.util.ArrayList<>(), 1, 3, java.aw...
private java.util.ArrayList<frogger.ObstacleRow<frogger.Car>> initializeCarRows() { java.util.ArrayList<frogger.ObstacleRow<frogger.Car>> newCars = new java.util.ArrayList<>(); frogger.ObstacleRow<frogger.Car> car1 = new frogger.ObstacleRow((-75), 150, 500, 50, 2, 500, new java.util.ArrayList<>(), 2, 3, java.aw...
public void computeDemoRectangle(float viewWidth, float viewHeight) { float centerX = viewWidth / 2; float centerY = viewHeight / 2; float deltaX = viewWidth / ((float) (de.peterloos.beziersplines.utils.ControlPointsHolder.NumDemoEdges)); float deltaY = viewHeight / ((float) (de.peterloos.beziersplines....
public void computeDemoRectangle(float viewWidth, float viewHeight) { if (((demoData) != null) && ((demoData.size()) == 0)) { float centerX = viewWidth / 2; float centerY = viewHeight / 2; float deltaX = viewWidth / ((float) (de.peterloos.beziersplines.utils.ControlPointsHolder.NumDemoEdges)...
public java.nio.file.FileVisitResult visitFile(java.nio.file.Path file, java.nio.file.attribute.BasicFileAttributes attrs) throws java.io.IOException { final java.lang.String path_temp = file.toString(); final java.lang.String path_name = omnikryptec.util.AdvancedFile.getName(path_temp); if (((advancedFileF...
public java.nio.file.FileVisitResult visitFile(java.nio.file.Path file, java.nio.file.attribute.BasicFileAttributes attrs) throws java.io.IOException { final java.lang.String path_temp = file.toString(); final java.lang.String path_name = omnikryptec.util.AdvancedFile.getName(path_temp); if (((advancedFileF...
public void onDataFetchComplete(java.lang.Throwable throwable, java.lang.String parser) { if (parser.equals(AppState.MOD_NEWS)) { if ((!(this.isDetached())) && (this.isVisible())) { this.loadPages(); } com.untappedkegg.rally.data.DbUpdated.open(); com.untappedkegg.rally.d...
public void onDataFetchComplete(java.lang.Throwable throwable, java.lang.String parser) { if (parser.equals(AppState.MOD_NEWS)) { if ((!(this.isDetached())) && (this.isVisible())) { this.loadPages(); } com.untappedkegg.rally.data.DbUpdated.open(); com.untappedkegg.rally.d...
private java.lang.String getFinalValue(java.lang.String newVal, java.lang.String oldVal) { if (com.breadwallet.tools.util.Utils.isNullOrEmpty(newVal)) return null; if (com.breadwallet.tools.util.Utils.isNullOrEmpty(oldVal)) return newVal; if (newVal.equals(oldVal)) { return...
private java.lang.String getFinalValue(java.lang.String newVal, java.lang.String oldVal) { if (newVal == null) return null; if (oldVal == null) return newVal; if (newVal.equals(oldVal)) { return null; }else { return newVal; } }
public double getMinY() { double minY = points.get(0).y; for (int i = 1; i < (points.size()); i++) { double pY = points.get(i).y; if (pY < minY) { if ((points.get(i).z) <= 0) { return (-(TheLittleEngineThatCould.windowHeight)) / 2; } minY = pY;...
public double getMinY() { double minY = points.get(0).y; for (int i = 1; i < (points.size()); i++) { double pY = points.get(i).y; if (pY < minY) { minY = pY; } } return minY; }
public void save() { try (Connection con = DB.sql2o.open()) { java.lang.String sql = "INSERT INTO persons (name, email) VALUES (:name, :email)"; con.createQuery(sql).addParameter("name", this.name).addParameter("email", this.email).executeUpdate().getKey(); } }
public void save() { try (Connection con = DB.sql2o.open()) { java.lang.String sql = "INSERT INTO persons (name, email) VALUES (:name, :email)"; this.id = ((int) (con.createQuery(sql, true).addParameter("name", this.name).addParameter("email", this.email).executeUpdate().getKey())); } }
private void setDimensions() { if ((java.lang.Double.toString(value).length()) < 15) { width = java.lang.Double.toString(value).length(); height = 1; }else { width = 15; height = ((java.lang.Double.toString(value).length()) / (width)) + 1; } }
public void setDimensions() { if ((java.lang.Double.toString(value).length()) < 15) { width = java.lang.Double.toString(value).length(); height = 1; }else { width = 15; height = ((java.lang.Double.toString(value).length()) / (width)) + 1; } }
public void onRefresh() { if (SimpleOperations.INSTANCE.isNetworkAvailable(getApplicationContext())) { swipeRefreshLayout.setRefreshing(true); new com.raccoonapps.pricemanager.app.client.task.ProductsUpdateTask(null, productsFile, storeFile, getApplicationContext()).execute(); }else { sw...
public void onRefresh() { if (SimpleOperations.INSTANCE.isNetworkAvailable(getApplicationContext())) { swipeRefreshLayout.setRefreshing(true); new com.raccoonapps.pricemanager.app.client.task.ProductsUpdateTask(null, productsFile, storeFile, false, getApplicationContext()).execute(); }else { ...
public void onMessageReceived(@android.support.annotation.NonNull com.criptext.comunication.MOKMessage message) { com.criptext.monkeychatandroid.models.MessageItem newItem = processNewMessage(message); boolean isMyOwnMsg = newItem.isIncomingMessage(); updateConversation(newItem.getConversationId(), com.crip...
public void onMessageReceived(@android.support.annotation.NonNull com.criptext.comunication.MOKMessage message) { com.criptext.monkeychatandroid.models.MessageItem newItem = processNewMessage(message); boolean isMyOwnMsg = !(newItem.isIncomingMessage()); updateConversation(newItem.getConversationId(), com.c...
public com.jomm.terroir.business.model.AbstractUser update(com.jomm.terroir.business.model.AbstractUser user) throws com.jomm.terroir.util.InvalidEntityException, java.lang.NullPointerException { if (user == null) { throw new java.lang.NullPointerException(); }else if ((user.getId()) == null) { ...
public com.jomm.terroir.business.model.AbstractUser update(com.jomm.terroir.business.model.AbstractUser user) throws com.jomm.terroir.util.InvalidEntityException, java.lang.NullPointerException { if (user == null) { throw new java.lang.NullPointerException(); }else if ((user.getId()) == null) { ...
public static java.util.List<cascading.tuple.TupleEntry> getAllTupleEntries(cascading.tap.Tap<org.apache.hadoop.mapred.JobConf, ?, ?> t) throws java.io.IOException { cascading.tuple.TupleEntryIterator iter = t.openForRead(com.liveramp.cascading_ext.CascadingUtil.get().getFlowProcess()); java.util.List<cascading...
public static java.util.List<cascading.tuple.TupleEntry> getAllTupleEntries(cascading.tap.Tap<org.apache.hadoop.mapred.JobConf, ?, ?> t) throws java.io.IOException { cascading.tuple.TupleEntryIterator iter = t.openForRead(com.liveramp.cascading_ext.CascadingUtil.get().getFlowProcess()); java.util.List<cascading...
protected synchronized void onProgressUpdate(java.lang.Void... values) { if ((SoundActivity.seekBar) != null) { SoundActivity.seekBar.setMax(org.gtlp.yasb.SoundActivity.soundPlayerInstance.getDuration()); SoundActivity.seekBar.setProgress(org.gtlp.yasb.SoundActivity.soundPlayerInstance.getCurrentPos...
protected synchronized void onProgressUpdate(java.lang.Void... values) { if ((org.gtlp.yasb.SoundActivity.soundPlayerInstance.get()) != null) { if ((SoundActivity.seekBar) != null) { SoundActivity.seekBar.setMax(org.gtlp.yasb.SoundActivity.soundPlayerInstance.get().getDuration()); So...
public void editRecipe9() { coffeeMaker.addRecipe(coffee); edu.pjatk.inn.coffeemaker.impl.Recipe newMocha = new edu.pjatk.inn.coffeemaker.impl.Recipe(); newMocha.setName("Mocha"); newMocha.setPrice(50); newMocha.setAmtCoffee(java.lang.Integer.parseInt("a")); org.junit.Assert.assertFalse(coffeeMa...
public void editRecipe9() { coffeeMaker.addRecipe(coffee); edu.pjatk.inn.coffeemaker.impl.Recipe newMocha = new edu.pjatk.inn.coffeemaker.impl.Recipe(); newMocha.setName("Mocha"); newMocha.setPrice(50); newMocha.setAmtCoffee("a"); org.junit.Assert.assertFalse(coffeeMaker.editRecipe(coffee, newMo...
private java.lang.String getTransitTitle(org.opentripplanner.api.model.Leg leg) { java.lang.String[] possibleTitles = new java.lang.String[]{ leg.tripShortName , leg.routeShortName , leg.route , leg.routeId }; for (int i = 0; i < (possibleTitles.length); i++) { if (!(android.text.TextUtils.isEmpty(possi...
private java.lang.String getTransitTitle(org.opentripplanner.api.model.Leg leg) { java.lang.String[] possibleTitles = new java.lang.String[]{ leg.routeShortName , leg.route , leg.routeId }; for (int i = 0; i < (possibleTitles.length); i++) { if (!(android.text.TextUtils.isEmpty(possibleTitles[i]))) { ...
public void applyTo(double[] xs, int offset, int length, mikera.vectorz.AVector ys) { for (int i = 0; i < length; i++) { xs[i] = ((java.lang.Number) (fn.invoke(xs[i], ys.unsafeGet(i)))).doubleValue(); } }
public void applyTo(double[] xs, int offset, int length, mikera.vectorz.AVector ys) { for (int i = 0; i < length; i++) { xs[(offset + i)] = ((java.lang.Number) (fn.invoke(xs[(offset + i)], ys.unsafeGet(i)))).doubleValue(); } }
public static double norm2(float[] x, int dim) { double dot = 0; for (int i = 0; i < dim; ++i) { dot += (x[i]) * (x[i]); } return java.lang.Math.sqrt(dot); }
public static double norm2(float[] x, int dim) { double dot = 0; for (int i = 0; i < dim; ++i) { dot += (x[i]) * (x[i]); } return dot; }
private static int checkSum(java.lang.String zip) { int checkDigit = 0; for (int i = 0; i < 5; i++) { checkDigit += java.lang.Integer.parseInt(("" + (zip.charAt(i)))); } checkDigit = checkDigit % 10; return checkDigit; }
private static int checkSum(java.lang.String zip) { int checkDigit = 0; for (int i = 0; i < (zip.length()); i++) { checkDigit += java.lang.Integer.parseInt(("" + (zip.charAt(i)))); } checkDigit = checkDigit % 10; return checkDigit; }
public void testInvalidNullURI() { try { java.net.URL url = mastsh.toURL(null); org.junit.Assert.fail(("expected IllegalArgumentException, got " + url)); } catch (java.lang.IllegalArgumentException expected) { ca.nrc.cadc.caom2.artifact.resolvers.MastResolverTest.log.debug(("IllegalArgum...
public void testInvalidNullURI() { try { java.net.URL url = mastsh.toURL(null); org.junit.Assert.fail(("expected IllegalArgumentException, got " + url)); } catch (java.lang.IllegalArgumentException expected) { ca.nrc.cadc.caom2.artifact.resolvers.MastResolverTest.log.info(("IllegalArgume...
public boolean add(E e) { java.lang.Object[] arr2 = new java.lang.Object[(arr.length) + 1]; for (int x = 0; x < (arr.length); x++) { arr2[x] = arr[x]; } arr2[arr.length] = e; return true; }
public boolean add(E e) { java.lang.Object[] arr2 = new java.lang.Object[(arr.length) + 1]; for (int x = 0; x < (arr.length); x++) { arr2[x] = arr[x]; } arr2[arr.length] = e; arr = arr2; return true; }
public java.util.ArrayList pendingBids() { java.util.ArrayList<com.ismailmare.warondemand.WarItem> itemsBeingBidOn = new java.util.ArrayList<>(); for (int i = 0; i < (inventory.size()); i++) { if ((inventory.get(i).getStatus()) == "BidOn") { itemsBeingBidOn.add(inventory.get(i)); } ...
public java.util.ArrayList pendingBids() { java.util.ArrayList<com.ismailmare.warondemand.WarItem> itemsBeingBidOn = new java.util.ArrayList<>(); for (int i = 0; i < (inventory.size()); i++) { if ((inventory.get(i).getStatus()) == 1) { itemsBeingBidOn.add(inventory.get(i)); } } ...
public void run() { for (org.bukkit.entity.Player player : this.plugin.playersToCheck) { if (!(this.plugin.checkWorld(player.getWorld().getName()))) { player.sendMessage(("This world is currently restricted.\n" + (DimRestrictor.plugin.info(player.getWorld().getName())))); net.kaikk.m...
public void run() { synchronized(this.plugin.playersToCheck) { for (org.bukkit.entity.Player player : this.plugin.playersToCheck) { if (!(this.plugin.checkWorld(player.getWorld().getName()))) { player.sendMessage(("This world is currently restricted.\n" + (DimRestrictor.plugin.in...
public void testNextExecutionEveryTwoWeeksStartingWithFirstDayOfYear() throws java.lang.Exception { com.cronutils.model.time.ZonedDateTime now = com.cronutils.model.time.ExecutionTimeQuartzWithDayOfYearExtensionIntegrationTest.truncateToDays(com.cronutils.model.time.ZonedDateTime.now()); int dayOfYear = now.get...
public void testNextExecutionEveryTwoWeeksStartingWithFirstDayOfYear() { com.cronutils.model.time.ZonedDateTime now = com.cronutils.model.time.ExecutionTimeQuartzWithDayOfYearExtensionIntegrationTest.truncateToDays(com.cronutils.model.time.ZonedDateTime.now()); int dayOfYear = now.getDayOfYear(); int dayOfM...
public void ParseJSONObject() { int code = 0; try { code = jsonObj.getInteger("cod"); } catch (java.lang.Exception e) { } if (code == 200) { org.vertx.java.core.json.JsonObject newData = CreateCorrectJSONObject(); CreateCorrectResponseString(newData); }else { resp...
public boolean ParseJSONObject() { int code = 0; try { code = jsonObj.getInteger("cod"); } catch (java.lang.Exception e) { } if (code == 200) { org.vertx.java.core.json.JsonObject newData = CreateCorrectJSONObject(); CreateCorrectResponseString(newData); return true; ...
public void setForeground(java.awt.Color color) { if ((foreground) == null) { super.setForeground(color); } if ((module) != null) for (java.awt.Component c : getComponents()) { c.setForeground(color); } }
public void setForeground(java.awt.Color color) { if ((foreground) == null) { super.setForeground(color); if ((module) != null) for (java.awt.Component c : getComponents()) { c.setForeground(color); } } }
private int getColumn() { int x; java.util.Scanner scanner = new java.util.Scanner(java.lang.System.in); while (true) { java.lang.System.out.print("Please enter the column number (1-10):"); x = scanner.nextInt(); if ((x >= 1) & (x <= 10)) return x; } }
private int getColumn() { int x; java.util.Scanner scanner = new java.util.Scanner(java.lang.System.in); while (true) { java.lang.System.out.print("Please enter the column number (1-10):"); x = scanner.nextInt(); if ((x >= 1) & (x <= 10)) return x - 1; } }
private java.lang.Long fetchSearchKeyId(java.lang.String suggestedField) { javax.persistence.Query query = mgr.createQuery("select f from MetadataEntity f where f.value = :value"); query.setParameter("value", suggestedField); java.util.List<org.esbtools.message.admin.common.orm.MetadataEntity> queryResult =...
private java.lang.Long fetchSearchKeyId(java.lang.String suggestedField) { javax.persistence.Query query = mgr.createQuery("select f from MetadataEntity f where f.value = :value"); query.setParameter("value", suggestedField); java.util.List<org.esbtools.message.admin.common.orm.MetadataEntity> queryResult =...
private static java.lang.String _getParentMessageIdFromSubject(javax.mail.Message message) throws java.lang.Exception { if ((message.getSubject()) == null) { return null; } java.lang.String parentMessageId = null; java.lang.String subject = message.getSubject(); int pos = subject.lastIndexOf...
private static java.lang.String _getParentMessageIdFromSubject(javax.mail.Message message) throws java.lang.Exception { if ((message.getSubject()) == null) { return null; } java.lang.String parentMessageId = null; java.lang.String subject = message.getSubject(); int pos = subject.lastIndexOf...
public <T> T loadClass(java.lang.Class<T> pluginClass) { java.lang.String id = classToBeanMap.get(pluginClass.getCanonicalName()); if (id != null) { return osgiPluginTracker.getBean(pluginClass, this, id); }else { try { return pluginClass.newInstance(); } catch (java.lang...
public <T> T loadClass(java.lang.Class<T> pluginClass) { java.lang.String id = classToBeanMap.get(pluginClass.getName()); if (id != null) { return osgiPluginTracker.getBean(pluginClass, this, id); }else { try { return pluginClass.newInstance(); } catch (java.lang.Exceptio...
public java.util.LinkedList<com.compomics.util.experiment.identification.matches.SpectrumMatch> getAllSpectrumMatches(com.compomics.util.waiting.WaitingHandler waitingHandler, com.compomics.util.experiment.identification.identification_parameters.SearchParameters searchParameters, com.compomics.util.preferences.Sequenc...
public java.util.LinkedList<com.compomics.util.experiment.identification.matches.SpectrumMatch> getAllSpectrumMatches(com.compomics.util.waiting.WaitingHandler waitingHandler, com.compomics.util.experiment.identification.identification_parameters.SearchParameters searchParameters, com.compomics.util.preferences.Sequenc...
private void setPlaceGuess(java.lang.String placeGuess) { placeGuess = placeGuess.trim(); if ((placeGuess != null) && ((placeGuess.length()) > 0)) { mLocationGuess.setText(placeGuess); mObservation.place_guess = placeGuess; }else { mLocationGuess.setText(R.string.set_location); ...
private void setPlaceGuess(java.lang.String placeGuess) { if (placeGuess != null) { placeGuess = placeGuess.trim(); } if ((placeGuess != null) && ((placeGuess.length()) > 0)) { mLocationGuess.setText(placeGuess); mObservation.place_guess = placeGuess; }else { mLocationGue...
public boolean isHelpValid(java.lang.String[] arguments) { if ((arguments.length) == 0) { return true; }else if ((arguments.length) == 1) { return !(commandList_.getHelpArgumentList().contains(arguments[0])); }else { return false; } }
public boolean isHelpValid(java.lang.String[] arguments) { if ((arguments.length) == 0) { return true; }else if ((arguments.length) == 1) { return commandList_.getHelpArgumentList().contains(arguments[0]); }else { return false; } }
public void setFakeHash() { if ((this.hash.length()) == 0) { this.hash = this.pack.getId(); if ((this.hash.length()) == (org.spongepowered.common.resourcepack.SpongeResourcePack.HASH_SIZE)) { this.hash += " "; } } }
public java.lang.String setFakeHash() { if ((this.hash.length()) == 0) { this.hash = this.pack.getId(); if ((this.hash.length()) == (org.spongepowered.common.resourcepack.SpongeResourcePack.HASH_SIZE)) { this.hash += " "; } } return this.hash.trim(); }
public void addMeal(ru.javawebinar.topjava.model.Meal m) { if (ru.javawebinar.topjava.DAO.MealDao.mealInMemory.containsKey(m.getId())) { ru.javawebinar.topjava.DAO.MealDao.mealInMemory.put(m.getId(), m); }else { m.setId(ru.javawebinar.topjava.DAO.MealDao.getNewId()); ru.javawebinar.topja...
public void addMeal(ru.javawebinar.topjava.model.Meal m) { if (ru.javawebinar.topjava.DAO.MealDao.mealInMemory.containsKey(m.getId())) { ru.javawebinar.topjava.DAO.MealDao.mealInMemory.put(m.getId(), m); }else { m.setId(getNewId()); ru.javawebinar.topjava.DAO.MealDao.mealInMemory.put(m.g...
private void postConvert(final short[] inPixels, final byte[] outPixels, final int begin, final int end) { int q = begin; for (int p = begin; p < end;) { final short f = inPixels[(p++)]; outPixels[(q++)] = (f <= (-16257)) ? 0 : f >= 16256 ? -1 : ((byte) ((f + 16384) >> 7)); } }
private void postConvert(short[] inPixels, byte[] outPixels, int begin, int end) { int q = begin; int p = begin; while (p < end) { short f = inPixels[(p++)]; outPixels[(q++)] = (f <= (-16257)) ? 0 : f >= 16256 ? -1 : ((byte) ((f + 16384) >> 7)); } }
public void run() { while ((hitQueue.size()) > 0) { org.bukkit.event.entity.EntityDamageByEntityEvent e = hitQueue.remove(); org.bukkit.Bukkit.getPluginManager().callEvent(e); if (!(e.isCancelled())) ((org.bukkit.entity.Damageable) (e.getEntity())).damage(e.getDamage(), e.getDama...
public void run() { while ((hitQueue.size()) > 0) { org.bukkit.event.entity.EntityDamageByEntityEvent e = hitQueue.remove(); ((org.bukkit.entity.Damageable) (e.getEntity())).damage(e.getDamage(), e.getDamager()); } }
private org.atlasapi.equiv.results.scores.Score score(java.util.List<java.lang.Integer> subjSeriesSizes, org.atlasapi.media.entity.Container cand, org.atlasapi.equiv.results.description.ResultDescription desc) { if (!(cand instanceof org.atlasapi.media.entity.Brand)) { desc.appendText("%s: not Brand -> %.2f...
private org.atlasapi.equiv.results.scores.Score score(java.util.List<java.lang.Integer> subjSeriesSizes, org.atlasapi.media.entity.Container cand, org.atlasapi.equiv.results.description.ResultDescription desc) { if (!(cand instanceof org.atlasapi.media.entity.Brand)) { desc.appendText("%s: not Brand -> %.2f...
public static bar.f0o.jlisp.lib.Net.IPPacket fromByteArray(byte[] packet) throws java.lang.RuntimeException { if ((packet.length) < 20) throw new java.lang.RuntimeException("Payload too short for IP"); if (((packet[0]) >> 4) == 4) return new bar.f0o.jlisp.lib.Net.IPv4Packet(packet); els...
public static bar.f0o.jlisp.lib.Net.IPPacket fromByteArray(byte[] packet) throws java.lang.RuntimeException { if ((packet.length) <= 20) throw new java.lang.RuntimeException("Payload too short for IP"); if (((packet[0]) >> 4) == 4) return new bar.f0o.jlisp.lib.Net.IPv4Packet(packet); el...
private org.eclipse.jface.viewers.StyledString getStyledString(com.boothen.jsonedit.outline.NodeType type, java.lang.String key, java.lang.String value) { java.lang.String fgColor = type.getForegroundColor(); java.lang.String bkColor = type.getBackgroundColor(); org.eclipse.jface.viewers.StyledString text =...
private org.eclipse.jface.viewers.StyledString getStyledString(com.boothen.jsonedit.outline.NodeType type, java.lang.String key, java.lang.String value) { java.lang.String fgColor = type.getForegroundColor(); java.lang.String bkColor = type.getBackgroundColor(); org.eclipse.jface.viewers.StyledString text =...
public static java.util.Calendar parseDateTime(java.lang.String dateTimeString) throws java.text.ParseException { helper.CalendarHelper.FORMAT_DATE_TIME.setLenient(false); dateTimeString = dateTimeString.trim(); java.util.Calendar datetime = java.util.Calendar.getInstance(); datetime.setTime(helper.Cale...
public static java.util.Calendar parseDateTime(java.lang.String dateTimeString) throws java.text.ParseException { helper.CalendarHelper.FORMAT_DATE_TIME.setLenient(false); dateTimeString = dateTimeString.trim(); java.util.Calendar datetime = java.util.Calendar.getInstance(); datetime.setTime(helper.Cale...
private void handleFoundAllFiles(final java.util.Set<java.io.File> allFiles) throws java.io.IOException { if ((wildcardExpanderHandler) != null) { try { wildcardExpanderHandler.transform(allFiles); } catch (final java.lang.Exception e) { throw new java.io.IOException(("Except...
private void handleFoundAllFiles(final java.util.Set<java.io.File> allFiles) throws java.io.IOException { if ((wildcardExpanderHandler) != null) { try { wildcardExpanderHandler.transform(allFiles); } catch (final java.lang.Exception e) { if (e instanceof java.io.IOException) ...
private net.es.oscars.helpers.RequestedVlanFlowE buildRequestedFlow(java.util.Set<net.es.oscars.helpers.RequestedVlanJunctionE> junctions, java.util.Set<net.es.oscars.helpers.RequestedVlanPipeE> pipes, java.lang.Integer minPipes, java.lang.Integer maxPipes, java.lang.String connectionId) { return net.es.oscars.help...
private net.es.oscars.helpers.RequestedVlanFlowE buildRequestedFlow(java.util.Set<net.es.oscars.helpers.RequestedVlanJunctionE> junctions, java.util.Set<net.es.oscars.helpers.RequestedVlanPipeE> pipes, java.lang.Integer minPipes, java.lang.Integer maxPipes, java.lang.String connectionId) { return net.es.oscars.help...
public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState) { final android.view.View view = inflater.inflate(R.layout.movie_detail_view, container, false); mUnbinder = butterknife.ButterKnife.bind(this, view); if ((getA...
public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState) { final android.view.View view = inflater.inflate(R.layout.movie_detail_view, container, false); mUnbinder = butterknife.ButterKnife.bind(this, view); if ((getA...
private wyal.lang.Formula extractDeclarationInvariant(wyal.util.Declaration.Named decl, wyal.util.Tuple<wyal.util.Expr> arguments) { if (decl instanceof wyal.util.Declaration.Named.Type) { wyal.util.Declaration.Named.Type td = ((wyal.util.Declaration.Named.Type) (decl)); return expandTypeInvariant(t...
private wyal.lang.Formula extractDeclarationInvariant(wyal.util.Declaration.Named decl, wyal.util.Tuple<wyal.util.Expr> arguments) { if (decl instanceof wyal.util.Declaration.Named.Type) { wyal.util.Declaration.Named.Type td = ((wyal.util.Declaration.Named.Type) (decl)); return expandTypeInvariant(t...
public void handle(javafx.scene.input.MouseEvent event) { if (digitsim.DigitSimController.isLocked()) { return ; } Gestures.NodeGestures.draggedAnchorPoint = true; aP.setCoords(toolbox.GenFunctions.getXYAdaptGrid(new general.Vector2i(((int) (event.getX())), ((int) (event.getY()))))); c.moveA...
public void handle(javafx.scene.input.MouseEvent event) { if (digitsim.DigitSimController.isLocked()) { return ; } Gestures.NodeGestures.draggedAnchorPoint = true; aP.setCoords(toolbox.GenFunctions.getXYAdaptGrid(new general.Vector2i(((int) (event.getX())), ((int) (event.getY()))))); c.drawD...
public boolean equals(java.lang.Object o) { return o instanceof West.Math.ComplexNumber ? (((West.Math.ComplexNumber) (o)).real.equals(real)) && (((West.Math.ComplexNumber) (o)).imag.equals(imag)) : false; }
public boolean equals(java.lang.Object o) { return ((o instanceof West.Math.ComplexNumber) && (((West.Math.ComplexNumber) (o)).real.equals(real))) && (((West.Math.ComplexNumber) (o)).imag.equals(imag)); }
public void render(float delta) { clearingScreen(); viewportRender(); game.batch.begin(); game.batch.draw(sprite_title, 100, (((com.jsl.babytrader.Data.ConstData.SCREEN_HEIGHT) - (sprite_title.getHeight())) - 50)); stage.act(Gdx.graphics.getDeltaTime()); stage.draw(); game.batch.end(); }
public void render(float delta) { clearingScreen(); viewportRender(); stage.act(Gdx.graphics.getDeltaTime()); stage.draw(); game.batch.begin(); game.batch.draw(sprite_title, 0, 0); game.batch.end(); }
public static int maxInBounds(int[] A, int lowerBound, int upperBound) { int max = 0; int[] bounds = new int[]{ lowerBound , upperBound }; for (int i = MyMath.min(bounds); i < ((MyMath.max(bounds)) + 1); i++) { java.lang.System.out.format("%d is between %d and %d%n", i, lowerBound, upperBound); ...
public static int maxInBounds(int[] A, int lowerBound, int upperBound) { int max = 0; int[] bounds = new int[]{ lowerBound , upperBound }; for (int i = MyMath.min(bounds); i < ((MyMath.max(bounds)) + 1); i++) { max = java.lang.Math.max(A[i], max); } return max; }
private void exportSubmission() { java.lang.String tableId = tableIds[tableSpin.getSelectedItemPosition()]; org.opendatakit.tables.tasks.ExportTask task = new org.opendatakit.tables.tasks.ExportTask(org.opendatakit.tables.utils.ImportExportDialog.newInstance(ImportExportDialog.EXPORT_IN_PROGRESS_DIALOG, this), ...
private void exportSubmission() { java.lang.String tableId = tableIds[tableSpin.getSelectedItemPosition()]; org.opendatakit.tables.utils.ImportExportDialog.newInstance(ImportExportDialog.EXPORT_IN_PROGRESS_DIALOG, this); org.opendatakit.tables.tasks.ExportTask task = new org.opendatakit.tables.tasks.ExportT...
public com.codecool.neighbrotaxi.model.SerializableSessionStorage loggedInUser() { sessionStorage.clearAllErrorMessages(); sessionStorage.clearAllInfoMessages(); if (java.util.Objects.equals(sessionStorage.getLoggedInUser().getName(), "anonymous")) { sessionStorage.addErrorMessage("Nobody is logged ...
public java.lang.Object loggedInUser() { sessionStorage.clearAllErrorMessages(); sessionStorage.clearAllInfoMessages(); if (java.util.Objects.equals(sessionStorage.getLoggedInUser().getName(), "anonymous")) { sessionStorage.addErrorMessage("Nobody is logged in!"); return new com.codecool.nei...
private void startScanning() { android.bluetooth.le.ScanSettings settings = neew; android.bluetooth.le.ScanSettings.Builder().setScanMode(ScanSettings.SCAN_MODE_LOW_POWER).build(); mBluetoothLeScanner.startScan(new java.util.ArrayList<android.bluetooth.le.ScanFilter>(), settings, mScanCallback); if (com...
private void startScanning() { android.bluetooth.le.ScanSettings settings = new android.bluetooth.le.ScanSettings.Builder().setScanMode(ScanSettings.SCAN_MODE_LOW_POWER).build(); mBluetoothLeScanner.startScan(new java.util.ArrayList<android.bluetooth.le.ScanFilter>(), settings, mScanCallback); if (com.fooda...
public void changed(javafx.beans.value.ObservableValue<? extends java.lang.Boolean> observable, java.lang.Boolean oldValue, java.lang.Boolean newValue) { if (newValue) { if (!(getChildren().contains(closeButton))) getChildren().add(closeButton); }else { getChildren().removeI...
public void changed(javafx.beans.value.ObservableValue<? extends java.lang.Boolean> observable, java.lang.Boolean oldValue, java.lang.Boolean newValue) { if (newValue) { if (!(getChildren().contains(closeButton))) { getChildren().add(closeButton); } }else { getChildren().remo...
private void labelCpuInventory() { if (game.getCpu()) if ((game.getCpuPlayer()) == (Player.BLUE)) { blueInvLabel.setVisible(true); redInvLabel.setVisible(false); }else { blueInvLabel.setVisible(false); redInvLabel.setVisible(true); } }
private void labelCpuInventory() { if (game.getCpu()) if ((game.getCpuPlayer()) == (Player.BLUE)) { blueInvLabel.setVisible(true); redInvLabel.setVisible(false); }else { blueInvLabel.setVisible(false); redInvLabel.setVisible(true); } else {...
public org.json.JSONObject toJSON() { org.json.JSONObject json = new org.json.JSONObject(); org.json.JSONArray a = new org.json.JSONArray(); for (com.whizzosoftware.hobson.dto.ErrorDTO error : errors) { a.put(error); } json.put("errors", a); return json; }
public org.json.JSONObject toJSON() { org.json.JSONObject json = new org.json.JSONObject(); org.json.JSONArray a = new org.json.JSONArray(); for (com.whizzosoftware.hobson.dto.ErrorDTO error : errors) { a.put(error.toJSON()); } json.put("errors", a); return json; }
private javax.swing.JMenu initImportMenu() { javax.swing.JMenu importMenu = new javax.swing.JMenu("Импорт/Экспорт"); javax.swing.JMenuItem importMenuItem = new javax.swing.JMenuItem("Импорт/Экспорт данных"); importMenu.add(importMenuItem); importMenuItem.addActionListener(( ae) -> { new diplom.i...
private javax.swing.JMenu initImportMenu() { javax.swing.JMenu importMenu = new javax.swing.JMenu("Импорт/Экспорт"); javax.swing.JMenuItem importMenuItem = new javax.swing.JMenuItem("Импорт/Экспорт данных"); importMenu.add(importMenuItem); importMenuItem.addActionListener(( ae) -> new diplom.importexpor...
public com.tsystems.javaschool.db.entities.Contract addNew(com.tsystems.javaschool.db.entities.Contract contract, java.util.List<java.lang.Integer> optionsIds) { javax.persistence.EntityTransaction transaction = contractDao.getTransaction(); com.tsystems.javaschool.business.services.interfaces.OptionService opt...
public com.tsystems.javaschool.db.entities.Contract addNew(com.tsystems.javaschool.db.entities.Contract contract, java.util.List<java.lang.Integer> optionsIds) { javax.persistence.EntityTransaction transaction = contractDao.getTransaction(); com.tsystems.javaschool.business.services.interfaces.OptionService opt...
public org.eclipse.jface.text.contentassist.IContentAssistant getContentAssistant(final org.eclipse.jface.text.source.ISourceViewer sourceViewer) { final org.eclipse.jface.text.contentassist.ContentAssistant assistant = new org.eclipse.jface.text.contentassist.ContentAssistant(); assistant.setContentAssistProce...
public org.eclipse.jface.text.contentassist.IContentAssistant getContentAssistant(final org.eclipse.jface.text.source.ISourceViewer sourceViewer) { final org.eclipse.jface.text.contentassist.ContentAssistant assistant = new org.eclipse.jface.text.contentassist.ContentAssistant(); assistant.setContentAssistProce...
private void catchTheGift() { if (gift.getRect().intersects(paddle.getRect())) { gift = null; for (brickbreaker.source.Ball ball : balls) { if ((ball.getSpeed()) >= 3) { ball.setSpeed(brickbreaker.source.BALL_SPEED); ball.setImage(brickbreaker.source.BALL)...
private void catchTheGift() { if (gift.getRect().intersects(paddle.getRect())) { gift = null; for (brickbreaker.source.Ball ball : balls) { if ((ball.getSpeed()) >= 3) { ball.setSpeed(brickbreaker.source.BALL_SPEED); ball.setImage(brickbreaker.source.BALL)...
public void followUser() { com.firebase.client.Firebase fb = com.stazo.project_18.Project_18.getFB(); if (Project_18.me.getUserTrails().contains(user_ID)) { Project_18.me.removeTrail(fb, user_ID); setFollowButton(false); }else { Project_18.me.addTrail(fb, user_ID); com.stazo....
public void followUser() { com.firebase.client.Firebase fb = com.stazo.project_18.Project_18.getFB(); if (Project_18.me.getUserTrails().contains(user_ID)) { Project_18.me.removeTrail(fb, user_ID); setFollowButton(false); }else { Project_18.me.addTrail(fb, user_ID); setFollowB...
public void testFindAll() throws java.lang.Exception { populateData(); int expectedSize = 12; int actualSize = 0; java.util.List<net.smartcosmos.dto.things.ThingResponse> response = persistenceService.findAll(tenantUrn); org.junit.Assert.assertFalse(response.isEmpty()); actualSize = response.siz...
public void testFindAll() throws java.lang.Exception { populateData(); int expectedSize = 12; int actualSize = 0; java.util.List<net.smartcosmos.dto.things.ThingResponse> response = persistenceService.findAll(tenantUrn); assertFalse(response.isEmpty()); actualSize = response.size(); assertTr...
private int getStartIndex(tspUtil.Node[] randomPath) { int start = 0; double MAX = 0; for (int i = 0; i < (numOfCity); i++) { for (int j = 0; j < (numOfCity); j++) { if ((distance[i][j]) > MAX) { MAX = distance[i][j]; start = i; } } ...
private int getStartIndex() { int start = 0; double MAX = 0; for (int i = 0; i < (numOfCity); i++) { for (int j = 0; j < (numOfCity); j++) { if ((distance[i][j]) > MAX) { MAX = distance[i][j]; start = i; } } } return start; }
public void run() { try { if (!(chatManager.getContacts().isEmpty())) { specialfilldatabase(); updatevalues(); adapter.refreshEvents(infochat, imgid); }else { android.widget.Toast.makeText(getActivity(), "No Contact now", Toast.LENGTH_SHORT).show(); ...
public void run() { try { if (!(chatManager.getContacts().isEmpty())) { updatevalues(); adapter.refreshEvents(infochat, imgid); }else { android.widget.Toast.makeText(getActivity(), "No Contact now", Toast.LENGTH_SHORT).show(); } } catch (java.lang.Exce...
public java.lang.String printJobs() { java.lang.StringBuilder out = new java.lang.StringBuilder(); out.append("\nJob ID\tJob name\tStatus\n"); for (java.lang.String job : mappedJobs.keySet()) { out.append(job).append("\t").append(mappedJobs.get(job)[0]).append("\t").append(mappedJobs.get(job)[1]); ...
public java.lang.String printJobs() { java.lang.StringBuilder out = new java.lang.StringBuilder(); out.append("\nJob ID\tJob name\tStatus\n"); for (java.lang.String job : mappedJobs.keySet()) { out.append(job).append("\t").append(mappedJobs.get(job)[0]).append("\t").append(mappedJobs.get(job)[1]).ap...
public void baseExpectations() { new tests.unit.com.microsoft.azure.iothub.transport.amqps.NonStrictExpectations() { { mockConfig.getIotHubHostname(); result = hostName; mockConfig.getIotHubName(); result = hubName; mockConfig.getDeviceId(); ...
public void baseExpectations() { new tests.unit.com.microsoft.azure.iothub.transport.amqps.NonStrictExpectations() { { mockConfig.getIotHubHostname(); result = hostName; mockConfig.getIotHubName(); result = hubName; mockConfig.getDeviceId(); ...
protected void onPause() { super.onPause(); rc.stop(); pauseTime = java.lang.System.currentTimeMillis(); totalForgroundTime = (tinydb.getLong("TotalForegroundTime", 0)) + ((pauseTime) - (resumeTime)); tinydb.putLong("TotalForegroundTime", totalForgroundTime); }
protected void onPause() { super.onPause(); if ((rc) != null) { rc.stop(); pauseTime = java.lang.System.currentTimeMillis(); totalForgroundTime = (tinydb.getLong("TotalForegroundTime", 0)) + ((pauseTime) - (resumeTime)); tinydb.putLong("TotalForegroundTime", totalForgroundTime); ...
public void onClick(android.view.View v) { if ((v.getId()) == (R.id.upload_files_btn_cancel)) { setResult(com.owncloud.android.ui.activity.RESULT_CANCELED); finish(); }else if (((v.getId()) == (R.id.upload_files_btn_upload)) && ((mBehaviourSpinner.getSelectedItemPosition()) == 0)) { ...
public void onClick(android.view.View v) { if ((v.getId()) == (R.id.upload_files_btn_cancel)) { setResult(com.owncloud.android.ui.activity.RESULT_CANCELED); finish(); }else if ((v.getId()) == (R.id.upload_files_btn_upload)) { new com.owncloud.android.ui.activity.UploadFilesAc...
private boolean matchesContract(net.nikr.eve.jeveasset.gui.tabs.contracts.MyContractItem contractItem, boolean add) { return (contractItem != null) && (matches(add, contractItem.getTypeID(), (contractItem.getContract().isForCorp() ? contractItem.getContract().getIssuerCorpID() : contractItem.getContract().getIssuer...
private java.lang.Long matchesContract(net.nikr.eve.jeveasset.gui.tabs.contracts.MyContractItem contractItem, boolean add) { if (contractItem != null) { return matches(add, contractItem.getTypeID(), (contractItem.getContract().isForCorp() ? contractItem.getContract().getIssuerCorpID() : contractItem.getCont...
public void categorySelected(org.unpidf.univmobile.data.entities.Category cat) { onBackPressed(); android.app.FragmentManager manager = getFragmentManager(); org.unpidf.univmobile.ui.fragments.GeoCampusFragment f = ((org.unpidf.univmobile.ui.fragments.GeoCampusFragment) (manager.findFragmentByTag(org.unpidf...
public void categorySelected(org.unpidf.univmobile.data.entities.Category cat) { super.onBackPressed(); android.app.FragmentManager manager = getFragmentManager(); org.unpidf.univmobile.ui.fragments.GeoCampusFragment f = ((org.unpidf.univmobile.ui.fragments.GeoCampusFragment) (manager.findFragmentByTag(org....
public boolean remove(int index) { if ((index < 1) || (index > (size()))) return false; com.seb.research.algorithms.LinkedList.Node current = head; for (int i = 1; i < index; i++) { if ((current.getNext()) == null) { return false; } } current.setNext(current....
public boolean remove(int index) { if ((index < 1) || (index > (size()))) return false; com.seb.research.algorithms.LinkedList.Node current = head; for (int i = 1; i < index; i++) { if ((current.getNext()) == null) { return false; } current = current.getNext(...
protected mmt.uit.placehelper.models.Direction doInBackground(java.lang.String... params) { mmt.uit.placehelper.models.Direction direct = new mmt.uit.placehelper.models.Direction(); direct = mmt.uit.placehelper.services.SearchPlace.getDirection(curLoc.getLat(), curLoc.getLng(), plDetail.getGeometry().getLocatio...
protected mmt.uit.placehelper.models.Direction doInBackground(java.lang.String... params) { mmt.uit.placehelper.models.Direction direct = new mmt.uit.placehelper.models.Direction(); direct = mmt.uit.placehelper.services.SearchPlace.getDirection(curLoc.getLat(), curLoc.getLng(), plDetail.getGeometry().getLocatio...
public void onConnected(android.os.Bundle bundle) { android.os.Debug.waitForDebugger(); route = new com.polsl.roadtracker.database.entity.RouteData(); route.start(); routeDataDao.insert(route); startLocationUpdate(); sensorReader.startSensorReading(route.getId(), this.getSharedPreferences("Senso...
public void onConnected(android.os.Bundle bundle) { route = new com.polsl.roadtracker.database.entity.RouteData(); route.start(); routeDataDao.insert(route); startLocationUpdate(); sensorReader.startSensorReading(route.getId(), this.getSharedPreferences("SensorReaderPreferences", Context.MODE_PRIVAT...
protected T create() { java.lang.String subType = getPropertyValue(com.oculusinfo.factory.UberFactory.FACTORY_TYPE); try { return produce(subType, com.oculusinfo.factory.UberFactory.getFactoryType()); } catch (com.oculusinfo.factory.ConfigurationException e) { com.oculusinfo.factory.UberFact...
protected T create() { java.lang.String subType = getPropertyValue(com.oculusinfo.factory.UberFactory.FACTORY_TYPE); try { return super.produce(subType, com.oculusinfo.factory.UberFactory.getFactoryType()); } catch (com.oculusinfo.factory.ConfigurationException e) { com.oculusinfo.factory.Ub...
public void onRequestPermissionsResult(int requestCode, java.lang.String[] permissions, int[] grantResults) { if (requestCode == 0) { if ((((grantResults.length) > 0) && ((grantResults[0]) == (android.content.pm.PackageManager.PERMISSION_GRANTED))) && ((grantResults[1]) == (android.content.pm.PackageManager...
public void onRequestPermissionsResult(int requestCode, java.lang.String[] permissions, int[] grantResults) { if (requestCode == 0) { if ((((grantResults.length) > 0) && ((grantResults[0]) == (android.content.pm.PackageManager.PERMISSION_GRANTED))) && ((grantResults[1]) == (android.content.pm.PackageManager...
public java.util.Calendar calcDataCobranca(java.util.Calendar dataCompra) { java.util.Calendar dataCobranca = java.util.Calendar.getInstance(); dataCobranca.setTime(dataCompra.getTime()); if ((dataCobranca.get(java.util.Calendar.DAY_OF_MONTH)) >= (diaVirada)) { dataCobranca.add(java.util.Calendar.MO...
public java.util.Calendar calcDataCobranca(java.util.Calendar dataCompra) { java.util.Calendar dataCobranca = java.util.Calendar.getInstance(); dataCobranca.setTime(dataCompra.getTime()); if ((diaVirada) > (diaVencimento)) { dataCobranca.add(java.util.Calendar.MONTH, 1); } if ((dataCobranca....
public void notifyRegistrationError() { android.util.Log.v(com.plugin.gcm.NotificationService.TAG, ("GCM Registration Failed for webview " + (getWebView()))); if ((getRegisterCallBack()) != null) { setNotifiedOfRegistered(false); getRegisterCallBack().error(mNotificationService.mRegistrationErro...
public void notifyRegistrationError() { android.util.Log.v(com.plugin.gcm.NotificationService.TAG, ("GCM Registration Failed for webview " + (getWebView()))); if ((getRegisterCallBack()) != null) { setNotifiedOfRegistered(false); getRegisterCallBack().error(mNotificationService.mRegistrationErro...
public void run() { while (connected) { try { java.lang.String message = in.readLine(); java.lang.System.out.println(("ici : " + message)); player.getMessageFromClient(message); } catch (java.io.IOException ex) { connected = false; player.g...
public void run() { while (connected) { try { java.lang.String message = in.readLine(); player.getMessageFromClient(message); } catch (java.io.IOException ex) { connected = false; player.getMessageFromClient("disconnected"); } } }