The "replaceAll" method of the String Class can't work, if a "?" character is in the value of an att

W

Wildemar Wildenburger

Ian said:
Just my EUR 0.02 worth.

That is the most subtle way of saying "My response is worthless" that I
have ever seen. I mean you guys have the pound AFAIK.

;)

/W
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Ed said:
I don't need more info! If I need more info, I could have spent hours
surfing the internet, and reading all about the String class and the
XML specification.
I am not a Student and don't have a time, I am a Programmer, and
wanted to resolve my current task!

Why ?

If you are not able to lookup some methods in the Java API docs
quicker than posting to usenet, then there are no point in
writing any code - the result should go directly to the trash bin.

Arne
 
E

Ed

From Sun's Java Coding Convention, which you should study.

Arne

I know that, I can study it, but I don't have to follow some of the
nonsense rules which may be in it! Arne, you don't have to always be a
follower, sometimes, you need to act as aa leader and not fucking
conformist!
Now, you wonder why linux is a much better OS than any other!
 
E

Ed

Why ?

If you are not able to lookup some methods in the Java API docs
quicker than posting to usenet, then there are no point in
writing any code - the result should go directly to the trash bin.

Arne

That is your opinion, jackass!
 
D

Daniel Pitts

Ed wrote:
The sample code below doesn't work, but if you take out the Question
Mark character, "?" in front of the value "Print" of the "action"
attribute, it does work!
Does anyone here know an other workaround? Thanks in advance!
You need to watch where line breaks go in source posts to Usenet. You got a
stray greater-than character ('>', a.k.a., "right angle bracket") that
belonged with the xml PI, but was somehow moved to a different line.
Come on, dude! Are you so stupid, to not understand that the code
works, and you may need to move the bracket, where it supposes to be,
when running it!
Also, the variable "XMLString", being a variable, should start with a
lower-case letter, by convention.
Where did you get that rule, Mr. Conformist!
Don't lecture to anyone here, your nonsense rule! Try to think out of
the box sometime!
public class Questionmark_TEST{
public Questionmark_TEST(){}
public static void main(String [] args){
String XMLString =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+
"<categories><NodeOne action='Print?'/></categories>";
String OldNode = "<NodeOne action='Print?'/>";
String NewNode = "<NodeOne action='Print?'>empty</NodeOne>";
XMLString = XMLString.replaceAll(OldNode,NewNode);
System.out.println("new XMLString : "+XMLString.toString());
}
}
Did you read the Javadocs on the replaceAll() method?
<http://java.sun.com/javase/6/docs/api/java/lang/String.html#replaceAl...)>
The first argument is a regular expression, in which the question mark has
special significance.
But you never answered my question though! Take a look what Roedy
replied to me! That's kind of an answer, I was looking for!

Lew's reply contain the same information as Roedy's post.

According to you?!?
To be fair,
Lew's reply contains *more* information than Roedy's.

I don't need more info! If I need more info, I could have spent hours
surfing the internet, and reading all about the String class and the
XML specification.
I am not a Student and don't have a time, I am a Programmer, and
wanted to resolve my current task!

Would you go to a doctor that said they didn't have time to study
medicine before treating you? You are not a programmer.
Nope, he was not polite! But Roedy was polite, the other guy was kind
of arrogant, and stupid conformist!
Actually, its more than just conformity, there is a real reason to do
that. When I first saw your code snippet, I assumed you were using
proper convention, so I thought that XMLString was a class that I
didn't know about, so wasn't sure that XMLString.replaceAll used
regex, even though I know xmlString.replaceAll probably would.
Globally accepted java coding convention?!?!? Sometimes, you need to
break stupid nonsense rules!
I am a Programmer and I care less of those little nonsense rules which
are not that big deal at all to me, and to anyone who is not too much
conformist!
Again, you are not a programmer, you are at this point a troll. If
you keep up the flaming any longer, I'd also consider you an idiot
(although, you don't yet have that distinction).

Would you call a carpenter a conformist because he used "standard"
tools and measurements? It amounts to the same thing, it makes it
easier to communicate if everyone's speaking the same language.
No, Roedy explained intelligently, in a few words, what replaceAll
method is all about, and the other guy, fucking mine as he is, he just
started tell
me the code I copied and pasted did not end with a bracket and the
bracked was on the next line! What a stupid and arrogant answer! And
he went on, pasting a link and telling me to read the link, and spend
hours reading all those shit, while I don't have even enough time, to
finish my current task!
You're current task is never more important than learning to improve
your performance on the next 10 tasks.

Also, apparently your current task isn't that high a priority, since
you're spending so much time trolling.
 
E

Ed

I find it useful to read this occasionally -http://www.catb.org/~esr/faqs/smart-questions.html#keepcool


By prefixing the code with ">" symbols you do make it a tiny bit harder
for people who want to help you. Speaking for myself, when posting
problems, I expend extra effort to try and make it easy for people to
help me.

Just my EUR 0.02 worth.

That's what I did! I posted here a small sample class! I told all,
that my class runs just fine, ***BUT*** if you take out the ? in front
of the value "Print", the class would not work! So, what's your point!
Please read my posting again, and see how I was very clear, on my
question!
 
D

Daniel Pitts

I know that, I can study it, but I don't have to follow some of the
nonsense rules which may be in it! Arne, you don't have to always be a
follower, sometimes, you need to act as aa leader and not fucking
conformist!
Now, you wonder why linux is a much better OS than any other!
What's with calling people a conformist?

Linux is a better OS because the designer and architect decided on
good coding style, where as Microsoft decided to do it their own way
despite an existing convention.

I agree that *blindly* following rules can be a bad thing. Some rules
DO have a reason behind them, and naming conventions tend to help one
programmer understand the code written by another.

Remember, you're writing the source code for a human, not the
computer. The computer could understand terribly obfuscated code, and
it couldn't care less. You, on the other hand, would be able to
debug, edit, and improve code which was clear and followed a
convention you already understand.

This is especially true when you ask for help. If aren't able to
communicate what you want, then people aren't going to be able to get
it to you.

I hereby strip you of your "Programmer" title, and deem you a
"Trolling Liar".

You're a Liar, because you claim to be a programmer, but obviously
know nothing of the art and science of programming.
 
E

Ed

You mean behave, right?
Well, the same goes for you, and as far as I recall, you were the one to
open the curseword-toolbox.

Yes, he needs to behave, and when helping anyone here, he needs to
act as a Servant, and not as a fucking arrogant!

For your info, why do you think Roedy still answered my question even
if the other guy just posted a java doc here?!?! Because Reody knew
that it's fucking simple question, and I don't need to look in Java
Doc, for a fucking one hour!

If at least, he could point out to me, the "replace" method, and
provide me the JavaDoc link, to study the difference between replace
and replaceAll, that would have been very nice!


He just provided me, a JavaDoc link, without even mentioning the
"replace" method, even if he knew that was my answer, I was looking
for! Fucking Jackass!
 
E

Ed

Ed wrote:
The sample code below doesn't work, but if you take out the Question
Mark character, "?" in front of the value "Print" of the "action"
attribute, it does work!
Does anyone here know an other workaround? Thanks in advance!
You need to watch where line breaks go in source posts to Usenet. You got a
stray greater-than character ('>', a.k.a., "right angle bracket") that
belonged with the xml PI, but was somehow moved to a different line.
Come on, dude! Are you so stupid, to not understand that the code
works, and you may need to move the bracket, where it supposes to be,
when running it!
Also, the variable "XMLString", being a variable, should start with a
lower-case letter, by convention.
Where did you get that rule, Mr. Conformist!
Don't lecture to anyone here, your nonsense rule! Try to think out of
the box sometime!
public class Questionmark_TEST{
public Questionmark_TEST(){}
public static void main(String [] args){
String XMLString =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+
"<categories><NodeOne action='Print?'/></categories>";
String OldNode = "<NodeOne action='Print?'/>";
String NewNode = "<NodeOne action='Print?'>empty</NodeOne>";
XMLString = XMLString.replaceAll(OldNode,NewNode);
System.out.println("new XMLString : "+XMLString.toString());
}
}
Did you read the Javadocs on the replaceAll() method?
<http://java.sun.com/javase/6/docs/api/java/lang/String.html#replaceAl...)>
The first argument is a regular expression, in which the question mark has
special significance.
But you never answered my question though! Take a look what Roedy
replied to me! That's kind of an answer, I was looking for!
Tsk.
Lew's reply contain the same information as Roedy's post.
According to you?!?
I don't need more info! If I need more info, I could have spent hours
surfing the internet, and reading all about the String class and the
XML specification.
I am not a Student and don't have a time, I am a Programmer, and
wanted to resolve my current task!

Would you go to a doctor that said they didn't have time to study
medicine before treating you? You are not a programmer.


Nope, he was not polite! But Roedy was polite, the other guy was kind
of arrogant, and stupid conformist!

Actually, its more than just conformity, there is a real reason to do
that. When I first saw your code snippet, I assumed you were using
proper convention, so I thought that XMLString was a class that I
didn't know about, so wasn't sure that XMLString.replaceAll used
regex, even though I know xmlString.replaceAll probably would.
Globally accepted java coding convention?!?!? Sometimes, you need to
break stupid nonsense rules!
I am a Programmer and I care less of those little nonsense rules which
are not that big deal at all to me, and to anyone who is not too much
conformist!

Again, you are not a programmer, you are at this point a troll. If
you keep up the flaming any longer, I'd also consider you an idiot
(although, you don't yet have that distinction).

Would you call a carpenter a conformist because he used "standard"
tools and measurements? It amounts to the same thing, it makes it
easier to communicate if everyone's speaking the same language.
No, Roedy explained intelligently, in a few words, what replaceAll
method is all about, and the other guy, fucking mine as he is, he just
started tell
me the code I copied and pasted did not end with a bracket and the
bracked was on the next line! What a stupid and arrogant answer! And
he went on, pasting a link and telling me to read the link, and spend
hours reading all those shit, while I don't have even enough time, to
finish my current task!

You're current task is never more important than learning to improve
your performance on the next 10 tasks.

Also, apparently your current task isn't that high a priority, since
you're spending so much time trolling.



- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -

You are not on my level, fucking dumbass! Tell me since when have you
been a Programmer?
**** off!
 
E

Ed

What's with calling people a conformist?

Linux is a better OS because the designer and architect decided on
good coding style, where as Microsoft decided to do it their own way
despite an existing convention.

I agree that *blindly* following rules can be a bad thing. Some rules
DO have a reason behind them, and naming conventions tend to help one
programmer understand the code written by another.

Remember, you're writing the source code for a human, not the
computer. The computer could understand terribly obfuscated code, and
it couldn't care less. You, on the other hand, would be able to
debug, edit, and improve code which was clear and followed a
convention you already understand.

This is especially true when you ask for help. If aren't able to
communicate what you want, then people aren't going to be able to get
it to you.

I hereby strip you of your "Programmer" title, and deem you a
"Trolling Liar".

You're a Liar, because you claim to be a programmer, but obviously
know nothing of the art and science of programming.- Hide quoted text -

- Show quoted text -

Fucking idiot, you are not on my level! Not only, I have been a
Programmer for a few decades, but I programm in more than two
languages as we speak! C++, JAVA, C#. Do you get it?!?

For your info, you may even be using a Java IDE Compiler written by my
friends!
 
K

kcwong

<snip endless stream of uncalled for insults from Ed>

At this point, one has to wonder that if Ed really has a question to
ask, or is he started this thread just to troll.

In any case I don't think Ed will get any more answers from this group.
 
E

Ed

Ed skrev:



The problem with the bracket was that if it starts a line, the line is
interpreted as part of a citation, and in my newsreader and many other
newsreaders, it is shown as a (coloured) vertical bar, not as ">". Lew
did not tell you about it to be *mean* ("mine" is another word entirely,
and I did not understand what you meant with it until your last post).
You are not coping well with English. The word is "copying".



(behave then)
He did behave. You don't behave very well, to say the least.





Nobody but you has been arrogant.

**** off, jackass!
 
E

Ed

Ed said:
Ed wrote:
The sample code below doesn't work, but if you take out the Question
Mark character, "?" in front of the value "Print" of the "action"
attribute, it does work!
Does anyone here know an other workaround? Thanks in advance!
You need to watch where line breaks go in source posts to Usenet. You got a
stray greater-than character ('>', a.k.a., "right angle bracket") that
belonged with the xml PI, but was somehow moved to a different line.
Come on, dude! Are you so stupid, to not understand that the code
works, and you may need to move the bracket, where it supposes to be,
when running it!
Also, the variable "XMLString", being a variable, should start with a
lower-case letter, by convention.
Where did you get that rule, Mr. Conformist!
Don't lecture to anyone here, your nonsense rule! Try to think out of
the box sometime!
public class Questionmark_TEST{
public Questionmark_TEST(){}
public static void main(String [] args){
String XMLString =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+
"<categories><NodeOne action='Print?'/></categories>";
String OldNode = "<NodeOne action='Print?'/>";
String NewNode = "<NodeOne action='Print?'>empty</NodeOne>";
XMLString = XMLString.replaceAll(OldNode,NewNode);
System.out.println("new XMLString : "+XMLString.toString());
}
}
Did you read the Javadocs on the replaceAll() method?
<http://java.sun.com/javase/6/docs/api/java/lang/String.html#replaceAl...)>


The first argument is a regular expression, in which the question mark has
special significance.
But you never answered my question though! Take a look what Roedy
replied to me! That's kind of an answer, I was looking for!
Tsk.
Lew's reply contain the same information as Roedy's post.
According to you?!?

and me.


I don't need more info! If I need more info, I could have spent hours
surfing the internet, and reading all about the String class and the
XML specification.

So, you're lazy and can't be bothered to do the necessary research yourself. You
come to Usenet, ask a poorly worded question and when you get politely
corrected you become offensive. You are Twisted AICMFP.

That really is not the way to behave if you with to get help in future.
I am not a Student and don't have a time, I am a Programmer, and
wanted to resolve my current task!

You're a programmer? Really?

and you think we should use our time to help lazy people who can't be bothered
to help themselves?


Nope, he was not polite! But Roedy was polite, the other guy was kind
of arrogant, and stupid conformist!

Yes he was polite. But you can't see that.


Globally accepted java coding convention?!?!? Sometimes, you need to
break stupid nonsense rules!

Fine, be stupid and break the "stupid" rules. Don't expect any help here.
I am a Programmer and I care less of those little nonsense rules which
are not that big deal at all to me, and to anyone who is not too much
conformist!

I doubt very much you really are a programmer. Maybe a programmer wannabe, but
if you really were a programmer those "little nonsense rules" would be quite
important to you.


No, Roedy explained intelligently, in a few words, what replaceAll
method is all about, and the other guy, fucking mine as he is, he just
started tell
me the code I copied and pasted did not end with a bracket and the
bracked was on the next line! What a stupid and arrogant answer! And
he went on, pasting a link and telling me to read the link, and spend
hours reading all those shit, while I don't have even enough time, to
finish my current task!

So, once again you tell us how lazy you are, and expect that we should do your
work for you.

I think not.

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : (e-mail address removed)
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555- Hide quoted text -

- Show quoted text -


Please, look this Stupid "System Administrator", Nigel Wade, talk that
I am not a Programmer. Fucking idiot, are you kind of PC Technician/
Window Admin at the University?
 
E

Ed

<snip endless stream of uncalled for insults from Ed>

At this point, one has to wonder that if Ed really has a question to
ask, or is he started this thread just to troll.

In any case I don't think Ed will get any more answers from this group.

Why? Do you run this group? Do you think I am here to only get
answers? How about if I am here too, to provide answers? Why do you
think I am here to get answers only, fucking arrogant!
 
E

Ed

<snip endless stream of uncalled for insults from Ed>

At this point, one has to wonder that if Ed really has a question to
ask, or is he started this thread just to troll.

In any case I don't think Ed will get any more answers from this group.

**** off, stupid jackass!
 
B

Bent C Dalager

What's with calling people a conformist?

My guess is he's a kewl rebel and "conformist" is probably the worst
swear word he's been taught so far.

Cheers
Bent D
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top