This week's book giveaway is in the Open Source forum.
We're giving away four copies of Programmers Guide to Apache Thrift and have Randy Abernethy on-line!
See this thread for details.
Win a copy of Programmers Guide to Apache Thrift this week in the Open Source forum!

Mike Dalton

Greenhorn
+ Follow
since Dec 30, 2013
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
3
Received in last 30 days
3
Total given
15
Given in last 30 days
12
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mike Dalton

I got it.



Now changing the last part to get the file read in successfully.

EDIT: Also changed it and it is working now.
Thanks all for the support!
6 days ago
That could be it!
Could someone help me to convert it?

6 days ago
I checked and I got the same structure.
6 days ago
@Randy
That wouldn't solve it. The file should go in the resources folder. When running the application in my IDE it works perfectly. No errors.

@Jasper
The txt file is inside the jar file. I can see it.
6 days ago
I implemented a > 1 counter and it works perfectly.
6 days ago
I've a simple maven project and which I have successfully packaged on the terminal (mvn package)
When executing the jar file it gives an error that a text file can't be found which contains the data to be read in.
I'm using OS X.

My project structure is:
NameOfProject
src
   main
       java

    resources
        data.txt
        data2.txt
    META-INF
        MANIFEST.MF

The MANIFEST.MF contains:
Manifest-Version: 1.0

After running the jar file it gives the following error:
File could not be found file:/Users/Mike/Projects/NameOfProject/target/application-app-1.0-SNAPSHOT.jar!/data.txt (No such file or directory)Exception in thread "main" java.lang.NullPointerException

When I run the application from my ide it works fine.
When I look inside the jar file I can see both data.txt files.

I'm not sure but I see a ! at the end of  the name of the jar file.
What causes this error and how can I solve this?
6 days ago
The requirements are:
-all phone numbers should be unique
-At the end display both the phone numbers with the name of the person and the address of each of the failed records
1 week ago

Carey Brown wrote:It's hard to help you without a complete set of requirements.

Have you read the tutorial on Set ?


Yes I have read it.

The requirements are all phone numbers should be unique.
1 week ago
Thanks all. I'll use the compareTo method.
1 week ago
I've external data read in to my java program and there is a value for example 23.4 which I create a BigDecimal value of how ever further up in the program when doing comparison it will fails because 23.4 and 23.40 aren't the same.
What is the best way to have this fixed? Should I add a 0 to 23.4 so its new value will become 23.40 ? or should I use the compareTo() method to ignore 0 ? Are there any other solutions?
1 week ago
I understand what you mean but I want to challenge myself to perfectly understand this.
1 week ago
Yes it will show 33, 34, 35, 36, 37, 29, 40 in the Set and 34, 34 will be printed.
I want to remove the first 34 from the Set. Your suggestion is to use a Map?
1 week ago
I've added the implementation Carey (will refactor later) if I want to print also the phone number which it conflict with how can I do that?
Example I've in my list the values: 33, 34, 35, 36, 37, 34, 34, 29, 40

Now it will add the 2 times number 34 that they are not unique and it adds the first 34 to the unique list. If I want also to show that the first 34 conflicts with the 2nd and 3rd 34. How can I achieve that?
1 week ago
Thanks all. I'll try it out tomorrow and post the outcome.
1 week ago