Home >

java

Advertisement
  • Sort stack in ascending orderJune 10

    I am using two more helper stacks to sort. Kindly suggest improvements in terms of space and time. import java.util.ArrayDeque; import java.util.Deque; public class SortStackAscendingOrder { Deque<Integer> stackhelper1 = new ArrayDeque<>(); De

  • PageeTabStrip with icon drawable selectorJune 7

    I implement PagerTabStrip with icon it will working fine. But i need when i change tab the current tab icon change selected image. Below my code my drawable icon selector code <selector xmlns:android="http://schemas.android.com/apk/res/android&quo

  • Does mongo-hadoop support replacing documents?June 6

    I'm trying to replace (not update with $set) documents in MongoDB using mongo-hadoop in Spark (mongo-hadoop-core-1.4.2.jar & mongo-java-driver-3.2.1.jar) : BasicDBObject query = new BasicDBObject(); query.append("_id", 6972); BasicDBObject u

  • Difference between ++ and +1June 5

    When I had startIndex++ in the last line of the while loop it caused an infinite loop, but using startIndex + 1, the program worked fine. I was wondering why this is so? public static int numOccurrences(String src, String q) { int startIndex = src.in

  • Created sendgrid email template, how to call it and give body and subject paramerters from JavaJune 5

    i m creating a template on sendGrid site (now i have an Id for the template) and i try to call it from my java servlet but i dont know how i can call it and give here parametrs like body and subject can you help me please ?

  • How to override Glassfish timeout configuration programmatically for a method or bean?June 4

    I have a bean dedicated to export a CSV and due to the big amount of data it takes around 15 minutes o more and I get a timeout. In order to solve this I thought about adding some kind of configuration only for this bean, as I mustn't increase Glassf

  • no such a method found error when trying to mockJune 4

    I am using power mockito and I am trying to mock the generator method in the following code: public class Asset{ public void todo() { some lines of code Generator generator=getGeneratorFromAnotherClass(); int id=generator.generate(id); }} also in the

  • Linux screen(or java) with different date of systemMay 29

    I having a problem with screen on Centos 7. The system time is correct but on screen application theres a diference of 3 hours. The system output(correct): [[email protected] ~]# date Ter Fev 23 01:27:11 BRT 2016 And the screen outputs running a java appli

  • Implement MyQueue using two stacksMay 7

    I am taking a helper stack, which is used during dequeue. Kindly suggest improvement or some solution with less complexity. import java.util.ArrayDeque; import java.util.Deque; public class MyQueueUsingTwoStack { Deque<Integer> mainStack = new Array

  • Listing the user privilèges in a specific folder alfresco cmis javaMay 5

    i want to know if there is any java methode or any topics about how to know user role on a specific folder (Consumer, Contributor, Collaborator...) For my project i use differentes methode's ex : uploadfile, create folder ... and now i want to manage

  • Call java methods from PhythonMay 3

    I need to find a way of communication between java and python program. My application is Java, and another application ( python) will request me some data and trigger some process in my Java Application. For first release, I do not have enough time t

  • LibGdx Tiled Map Rendering Problem

    LibGdx Tiled Map Rendering ProblemApril 17

    Im trying to study a book to learn LibGDX game engine but i have a problem with rendering tiled maps. i think i wrote the same code with book but i couldnt get the same result. its a simple game with a character and a map. When i rendered my characte

  • Cancelling job in ExecutorServiceMarch 19

    I wrote code which demonstrates how to cancel a job in Executor: ExecutorService executor = Executors.newFixedThreadPool(4); Future<Void> future = executor.submit(new Callable<Void>() { @Override public Void call() { // // do some long running

  • Why my equals method is returning true for some equivalent fractions and false for others?March 16

    So I have an overridden equals method, and a program where I allow the user to input multiple integer fractions, and then check to see if f1(f2 - f3) = f1f2 - f1f3 . This is a necessary truth, and comes back true for most valid inputs. Here is my equ

  • Run my mongodb command from java programMarch 15

    How to run multiple mongodb commands from a java code. I need the mongodb commands to get executed in background when i run the java program. This program throws some exception "Exception in thread "main" java.io.IOException: Cannot run pro

  • How to run/make spring cloned from Github in Intellij?March 14

    I'm new to spring and IntellIj IDEA, and I've been trying to learn new sample projects for spring mvc from github, spring-mvc-showcase. I've cloned it from github but cannot seems to run it in the browser. So how do I run it from IntellIJ, or do I ha

  • What's the difference between JdbcCursorItemReader and ItemReader/JdbcTemplate?March 11

    I want to confirm my understanding about the difference between JdbcCursorItemReader and a class that implements ItemReader that uses JdbcTemplate for querying the db. Is this the difference? Normally ItemReader finishes fetching everything before It

  • Create an Eclipse template to println a variable in scopeMarch 10

    In programming, I often have situations where I want to print a variable to the console. int myVar = 23; System.out.println("myVar" + myVar); I'd like to automate the task by outsourcing it to an Eclipse template. So far, this is the template I

  • Reverse number using only loops;no Arrays,convert to String just beginner-Bug:ZeroMarch 6

    first sorry about my English(not my native language). I am new in programming (currently learning Java) and just finishing lecture about looping. I had a task to reverse random number from 1 to 9999, and got stuck with a bug zero: example: 23100 outp

  • Deserialization of evolving modelFebruary 16

    I'm currently using XStream to serialize/deserialize the state of my model hierarchy and starting to have problems because the model is still evolving and the structure keeps changing. I'm searching for alternative: easy to use backward compatibility

Copyright (C) 2018 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 13 q. 0.303 s.