Click here to Skip to main content
15,887,349 members
Home / Discussions / Java
   

Java

 
AnswerRe: [EDIT] CLASS cannot be resolved to a type Pin
alexey_s22-Jan-15 8:15
alexey_s22-Jan-15 8:15 
QuestionGabor Patch Generator Pin
amirsharifzadeh20-Dec-14 22:01
amirsharifzadeh20-Dec-14 22:01 
SuggestionRe: Gabor Patch Generator Pin
Richard MacCutchan20-Dec-14 22:14
mveRichard MacCutchan20-Dec-14 22:14 
QuestionHow to Use Delimiters in my program(Does not work and Crashes) Pin
Kaytlyn Grace Lau20-Dec-14 7:44
Kaytlyn Grace Lau20-Dec-14 7:44 
AnswerRe: How to Use Delimiters in my program(Does not work and Crashes) Pin
Richard MacCutchan20-Dec-14 21:06
mveRichard MacCutchan20-Dec-14 21:06 
AnswerRe: How to Use Delimiters in my program(Does not work and Crashes) Pin
Richard MacCutchan21-Dec-14 4:01
mveRichard MacCutchan21-Dec-14 4:01 
GeneralRe: How to Use Delimiters in my program(Does not work and Crashes)(SOLVED) Pin
Kaytlyn Grace Lau21-Dec-14 9:18
Kaytlyn Grace Lau21-Dec-14 9:18 
GeneralRe: How to Use Delimiters in my program(Does not work and Crashes)(SOLVED) Pin
Richard MacCutchan21-Dec-14 22:44
mveRichard MacCutchan21-Dec-14 22:44 
Firstly, if you create a delimiter string (as you did in your code) you still need to apply it to the scanner so that the scanner applies it to every line it reads. The default for the scanner is to ignore all whitespace characters (as described in http://docs.oracle.com/javase/7/docs/api/java/lang/Character.html#isWhitespace(char)[^]). If that does not control the input data that you are working with then you need to set a custom delimiter, which can be a simple string of characters, or a regular expression pattern, as described in http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html[^].

The pattern I suggested ("\\s*[,\\s*]\\s*") breaks down as follows:
Actual pattern is: \s*[,\s*]\s*

\s*     : 0 or more whitespace characters (e.g. spaces, tabs etc)
[,\s*]  : a comma or 0 or more whitespace characters
\s*     : 0 or more whitespace characters (e.g. spaces, tabs etc)

I'm not an expert in RegEx patterns so I am sure this can be improved upon. But what you have in your input file is:
25.0, 37.1, 10

So the the basic pattern is:
0 or more whitespace characters
0 or more comma characters
0 or more whitespace characters
a number
0 or more whitespace characters

Question[SOLVED] Does not redirect properly Pin
Django_Untaken14-Dec-14 20:52
Django_Untaken14-Dec-14 20:52 
QuestionRe: Does not redirect properly Pin
Richard MacCutchan14-Dec-14 22:19
mveRichard MacCutchan14-Dec-14 22:19 
QuestionLogin Details Authentication Pin
JayantiSh13-Dec-14 12:08
JayantiSh13-Dec-14 12:08 
AnswerRe: Login Details Authentication Pin
Richard MacCutchan13-Dec-14 21:33
mveRichard MacCutchan13-Dec-14 21:33 
GeneralRe: Login Details Authentication Pin
JayantiSh16-Dec-14 3:27
JayantiSh16-Dec-14 3:27 
GeneralRe: Login Details Authentication Pin
TorstenH.17-Dec-14 2:19
TorstenH.17-Dec-14 2:19 
Generaljava Pin
Member 109275319-Dec-14 1:48
Member 109275319-Dec-14 1:48 
GeneralRe: java Pin
Richard MacCutchan9-Dec-14 6:11
mveRichard MacCutchan9-Dec-14 6:11 
GeneralRe: java Pin
TorstenH.11-Dec-14 22:14
TorstenH.11-Dec-14 22:14 
QuestionPassing JTextField Values to MouseListener Interface Pin
Django_Untaken2-Dec-14 3:37
Django_Untaken2-Dec-14 3:37 
AnswerRe: Passing JTextField Values to MouseListener Interface Pin
Richard MacCutchan2-Dec-14 5:27
mveRichard MacCutchan2-Dec-14 5:27 
GeneralRe: Passing JTextField Values to MouseListener Interface Pin
Django_Untaken3-Dec-14 5:52
Django_Untaken3-Dec-14 5:52 
GeneralRe: Passing JTextField Values to MouseListener Interface Pin
Richard MacCutchan3-Dec-14 6:26
mveRichard MacCutchan3-Dec-14 6:26 
QuestionAuthentication and Encryption Pin
Anele Ngqandu2-Dec-14 2:26
Anele Ngqandu2-Dec-14 2:26 
AnswerRe: Authentication and Encryption Pin
Richard Deeming2-Dec-14 2:38
mveRichard Deeming2-Dec-14 2:38 
GeneralRe: Authentication and Encryption Pin
Anele Ngqandu2-Dec-14 2:44
Anele Ngqandu2-Dec-14 2:44 
AnswerRe: Authentication and Encryption Pin
ZurdoDev2-Dec-14 2:41
professionalZurdoDev2-Dec-14 2:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.