java

java

  • All Sites

4 answers

Understanding synchronization with multiple processors

In JCIP Section 15.2 B. Goetz mentioned that in modern processors there was a set of instructions like compare-and-swap (CAS) which allowed us to perform non-blocking update operations. In ...

2 answers

Extract File Hierarchy from Google Drive in Java

I need to read the folders, subfolders and files from a Google Drive and create the respective hierarchy (of folders, subfolders and files) in my file system, with empty files (I only want to keep the ...

8 answers

android: Instantly start an activity and then load content

I've looked into other questions, blogs and the documention and can't seem to find the right answer to my needs. I have two activities, A and B. When I start activity B (from A) I want it to open ...

2 answers

How to get an instance of SuperClass in java?

Let me explain my situation: public class Car extends Vehicle{ public Car() { } public Car(String model){ super(model); AutoParts autoParts=new ...

2 answers | 3 mins ago by Irshu on Stack Overflow stackoverflow.com
1 answer

sending ios voip notification using java-apns(notnoop)

I am trying to implement voip notification server using java. I tried javapns and java-apns.The problems I am facing are: 1.With javapns I am able to send voip notification but unable to receive it ...

1 answers | 3 mins ago by nikhil on Stack Overflow stackoverflow.com
32 answers

Can't start Eclipse - Java was started but returned exit code=13

I am trying to get my first taste of Android development using Eclipse. I ran into this problem when trying to run Eclipse, having installed version 4.2 only minutes ago. After first trying to start ...

32 answers | 3 mins ago by Ben E. on Stack Overflow stackoverflow.com
4 answers

How to pick up only integer data from an ArrayList of String

I read a text file and put the data into an ArrayList of String. The data is like China 12351235123 Korea 123532523 USA 12341235123 I just need those integer data as an integer to find the first ...

1 answer

How junit this obvserable async method

I have repo that tests an async execution using java8 and reactive: interface of zadd: Observable<Long> zadd(K key, double score, V member); public void executeMethod(List<String> ...

0 answers

How should I choose to create application session key or browser session key

I use Tomcat8 to be web application, and I need to create session key to identify the log data from client. How should I choose to make server light weight and security?

1 answer

I am not able to insert data to sqlite database in JavaFx using MVC pattern

This is the UserModel.Class with insert function public boolean isInsert(String userNew, String passNew) throws SQLException{ PreparedStatement preparedStatement=null; ResultSet ...

1 answers | 8 mins ago by Shaikh Sakib on Stack Overflow stackoverflow.com
0 answers

windows.open /updated safari new tab not working

Please help me how can be possible to make a link where another link will open in new tab it self. for example if i open a website www.yahoo.com same time on New tab another domain will get opened ...

2 answers

How to create a healthbar in Libgdx?

I have been wondering how I would go by making a health bar in libgdx/java. I am looking into a Shape Renderer thinking I can use a filled shape to create a health bar, though I am not sure on how to ...

0 answers

Send email in android without user interaction

I am trying to create application which sends email without user interaction using this solution. I am getting the following error E/AndroidRuntime: FATAL EXCEPTION: main Process: ...

0 answers

return from method, in the “try” block or aftwer “catch” block?

Is there any difference between following two methods? Which one is preferable and why? Prg1: public static boolean test() throws Exception { try { doSomething(); return true; ...

8 answers

Get specific ArrayList item

public static ArrayList mainList = someList; How can I get a specific item from this ArrayList? mainList[3]?

8 answers | 12 mins ago by KJW on Stack Overflow stackoverflow.com
2 answers

Adding a class to the manifest in Android

I ran into this problem just now, scratching my head on how to tackle this problem. Basically, I have MainActivity, and a lot of classes in my app, such as RootUtils, LegalProsecution, ...

2 answers | 12 mins ago by ideaman924 on Stack Overflow stackoverflow.com
0 answers

Estimate Release of Sufficient Nvidia GPU drivers in Ubuntu 16.04?

I need GPU computation for training neural networks. I need to think where to design the rest of the system. I would really like to use Ubuntu for the problem. System: i7 2013, 32 GB DDR3, Nvidia ...

1 answer

Spring Boot Data REST, HATEOAS not working with a custom Controller

I use MongoRepository in Spring boot data rest and it is working just fine without implementing my own controller. But I want to put "Register Date" in my newly created objects and default ...

2 answers

can we use jaxws-rt.jar as runtime implementation though it includes sun libraries?

Many recommend not to use sun packages for various reasons. Detailed answers are provided here. However I am using jaxws-rt.jar which uses sun library. I am wondering if I should jaxws-rt.jar or ...

2 answers

Implimenting OSGi plugins into an existing source

I am looking to make plugins of various tools for an existing project (Minecraft client) and it seems peple suggest OSGi the most, is it possible to add OSGi plugins to the source. Aka a plugin loaded ...

2 answers | 17 mins ago by Cacoon on Stack Overflow stackoverflow.com
2 answers

Java - extending the whole class hierarchy

I have a class hierarchy like that: abstract class BaseThing { public abstract void doSomething(); } class Thing1 extends BaseThing { @Override public void doSomething() { ...

3 answers

How can I replace a for loop with a lambda and stream in Java?

How can I convert the following for loop to use a Java lambda with streams? List<Fruit> fruits = createFruitArrayList (); // creates a list of fruits Fruit largeApple = null; // holds the ...

3 answers | 17 mins ago by DamiAbiola on Stack Overflow stackoverflow.com
0 answers

How can I test for multiple intersections on a rectangle in java

I am currently making a tower defense game. Put very simply it works like this: green circles (enemies) move across the screen. By clicking, you can place a tower. The enemy has a rectangle hidden ...

1 answer

How to add an Imageview to a string

Hello guys i have a little issue.,im making a signup form which will include a profile picture.i have added everything to a string except the imageview,how can i add it so that when someone clicks on ...

1 answers | 21 mins ago by Nicky Niq on Stack Overflow stackoverflow.com
1 answer

Problems parsing forwarded emails as attachment in imaps java

I have implemented an email client in java using imaps. While parsing the received emails I am fetching the text and the attachments using the following functions: public String getText(Part p) { ...

0 answers

SPNEGO / ActiveDirectory / AES256: Checkfum failed

I am trying to use SPNEGO / Kerberos5 authentication with Active Directory 2008 and Java. I followed this guide: http://spnego.sourceforge.net/ - "preflight" went well, but later I get the famous ...

0 answers

mediator design pattern implemented in java

is this correct way to implement Mediator design pattern in java ? public class chat { public static void showMesg(Color c , String msg){ System.out.println(new Date().toString() +" "+c + " " ...

0 answers

ThreadExecutor method

I want to make a method in Java 8 that allows me to execute a DB connection on a different thread. For this I want to use ExecutorService pool = Executors.newCachedThreadPool(); Now I would ...

0 answers

Java MAVEN: Could not find or load main class stigastatistics.stigastatistics.StatisticsGUI

I know, it was written here many times, but I tried solutions, but with no success. I have netbeans maven project with dependencies. I want to make executable jar file with dependencies. This is my ...

1 answer

Draw a Java christmas tree with tabs and asteriks

I need to draw a java xmas tree with given n numbers of rows, but not how it is commonly being drawn like this: * *** ***** ******* but like this, with seperation tabs: ...

1 answers | 25 mins ago by Mher Harutyunyan on Stack Overflow stackoverflow.com
15 30 50 per page
1 2 3