split query
16 Message(s) by 7 Author(s) originally posted in java programmer
| From: Nicole.Winfrey |
Date: Friday, October 26, 2007
|
I know that the
split method is used to produce an
array of
string s
separated by the
argument .
I'm confused about the split string method in the following cases.
String test = "ABC";
String[] arr = test.split(",");
What's the value of arr? Is it
null or it has arr[0] with the value of
"ABC"?
String test2 = "";
String[] arr2 = test2.split(",");
What's the value of arr2? Is it null or it has arr[0] with the value
of ""?
| From: Andrew Thompson |
Date: Friday, October 26, 2007
|
wrote in message:
I know that the split method is used to produce an array of strings
separated by the argument.
I'm confused about the split string method in the following cases.
Somebody
posting to c.l.j.p.'d normally be expected
to have enough nouse to
write a short test
program that could
answer the very questions you ask.
Why not try that?
--
Andrew Thompson
http://www.athompson.info/andrew/
Message posted via
http://www.JAVAkb.com
| From: Lew |
Date: Friday, October 26, 2007
|
wrote in message:
... a short test program that could
answer the very questions you ask.
Why not try that?
One of the benefits of writing and deploying an SSCCE
<http://www.physci.org/code s/sscce.html>
is that it very often answers the question for you.
--
Lew
| From: Andrew Thompson |
Date: Friday, October 26, 2007
|
| From: Roedy Green |
Date: Friday, October 26, 2007
|
wrote in message,
quoted or indirectly quoted someone who said :
I'm confused about the split string method in the following cases.
String test = "ABC";
String[] arr = test.split(",");
The usual problem people have with split in this:
The split argument isn't a simple String, but rather a regex
expression. $ ( ) * + - . < = ? [ \ ] ^ { | } characters have magic
meaning. They need to be quoted when you mean them literally. See
http://mindprod.com/jgloss/regex.html#QUOTING
This baffles people. However, your question
String test = "ABC";
String[] arr = test.split(",");
What's the value of arr? Is it null or it has arr[0] with the value of
"ABC"?
Should be solved easily with a simple experiment.
It baffles me when people ask questions like yours. It'd be less
work, less typing and much faster to do the experiment than to post a
question.
I wonder what inhibits people from experimenting.
1. too many Star Trek episodes where computers explode given the
"wrong" inputs.
2. punishment as a
child for asking questions.
3. punishment as a child for curiosity.
4. lack of confidence in your ability to perform experiments or lack
of confidence in the generality of experimental results. You prefer
the authority of another human.
I recall teaching a computer course to some women reentering the work
force as part of a government program. I asked them to
pound some
random
key s to prove to themselves the computer wouldn't explode. I
meant this as a joke, and to ease the fear of making mistakes.
One
woman asked "Which key should I
hit ". I said, "Any you like..
Close your eyes. Just hit any keys you like."
She burst into tears. She then reported me for abusing her by giving
her inadequate direction on what to do.
She was an extreme example of someone afraid to experiment, someone
terrified of making a mistake or doing something without explicit
permission.
At the opposite end are kids who are itching to press every
button to
see if they can figure out what it does.
The kindest thing a
parent can do is avoid squashing his children's
curiosity. That was one thing my parents did well.
"The reason is, that I'm doubtful about the temper of your flamingo.
Shall I try the experiment?'"
~ The Dutchess,
Alice In Wonderland.
--
Roedy
Green Canadian Mind Products
The JAVA Glossary
http://mindprod.com
| From: John W. Kennedy |
Date: Friday, October 26, 2007
|
wrote in message:
have enough nouse
"nous" (or "νους"). Greek word.
--
John W. Kennedy
"But now is a new thing which is very old--
that the rich make themselves richer and not poorer,
which is the true Gospel, for the poor's sake."
-- Charles Williams. "Judgement at Chelmsford"
| From: Daniel Pitts |
Date: Friday, October 26, 2007
|
wrote in message:
wrote in message,
quoted or indirectly quoted someone who said :
I'm confused about the split string method in the following cases.
String test = "ABC";
String[] arr = test.split(",");
The usual problem people have with split in this:
The split argument isn't a simple String, but rather a regex
expression. $ ( ) * + - .
< = ? [ \ ] ^ { | } characters have magic
meaning. They need to be quoted when you mean them literally. See
http://mindprod.com/jgloss/regex.html#QUOTING
This baffles people. However, your question
String test = "ABC";
String[] arr = test.split(",");
What's the value of arr? Is it null or it has arr[0] with the value of
"ABC"?
Should be solved easily with a simple experiment.
It baffles me when people ask questions like yours. It'd be less
work, less typing and much faster to do the experiment than to post a
question.
I wonder what inhibits people from experimenting.
1. too many Star Trek episodes where computers explode given the
"wrong" inputs.
Hah, had not considered that.
2. punishment as a child for asking questions.
3. punishment as a child for curiosity.
me thinks 2 and 3 amount to the same thing.
4. lack of confidence in your ability to perform experiments or lack
of confidence in the generality of experimental results. You prefer
the authority of another human.
I'm mostly self taught. I always experimented with everything, except
when I *first* started learning about multithreaded programming. I had
heard so many people say that its so difficult to get right, and that
the code could appear to work, but not be "correct". This put me off of
the subject for a while until I realized that there was a finite
(actually small) set of rules which you could reason with. This gave me
the ability to "mentally" experiment with such scenarios.
Experimentation is definitely an invaluable process.
I recall teaching a computer course to some women reentering the work
force as part of a government program. I asked them to pound some
random keys to prove to themselves the computer wouldn't explode. I
meant this as a joke, and to ease the fear of making mistakes.
One woman asked "Which key should I hit". I said, "Any you like..
Close your eyes. Just hit any keys you like."
She burst into tears. She then reported me for abusing her by giving
her inadequate direction on what to do.
This sounds like an exaggeration, but I believe it. Many of my past
students have known the solution to a problem, but would not attempt it
until I told them it was correct.
If someone has to tell you that you're correct, then you will never
produce anything original.
She was an extreme example of someone afraid to experiment, someone
terrified of making a mistake or doing something without explicit
permission.
At the opposite end are kids who are itching to press every button to
see if they can figure out what it does.
The kindest thing a parent can do is avoid squashing his children's
curiosity. That was one thing my parents did well.
Agreed, There is a fine line between protecting the wellbeing of your
children and possessions, and causing harm in the form of fear of
experimenting.
--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
| From: Andrew Thompson |
Date: Saturday, October 27, 2007
|
wrote in message:
wrote in message:
> have enough nouse
"nous" (or " "). Greek word.
Oops! My bad. Bad enough that I am using obscure
words, worse that they are neither English*, nor
correctly spelt!
Since the definitions point out that the word
'nous' has many different meanings, I'll
clarify that I actually meant 'common sense'.
* If only for the reason that people might be
expecting 'English' here.
Andrew T.
| From: Roedy Green |
Date: Saturday, October 27, 2007
|
On Fri, 26 Oct 2007 12:03:22 -0700, Daniel Pitts
wrote in message, quoted or indirectly
quoted someone who said :
2. punishment as a child for asking questions.
3. punishment as a child for curiosity.
me thinks 2 and 3 amount to the same thing.
Curiosity'd
include taking things apart, poking around in parent's
belongings, attempting to use tools, wandering off to explore, wanting
to take large amounts of time to study
interesting phenomena, interest
in things parents consider morbid like insects, road kill, books of
tropical diseases ...
Asking questions can sometimes just be a way to pass time. The answers
aren't important. It is just something to do with a parent. I can
remember asking questions I already knew the answers to when I ran out
of new ones. It was almost like asking for a familiar bedtime story.
--
Roedy Green Canadian Mind Products
The JAVA Glossary
http://mindprod.com
| From: Roedy Green |
Date: Saturday, October 27, 2007
|
On Fri, 26 Oct 2007 12:03:22 -0700, Daniel Pitts
wrote in message, quoted or indirectly
quoted someone who said :
This sounds like an exaggeration, but I believe it.
Strangely it isn't. What is odd is the other women in the
class
chastised me as well. I was dumbfounded. Their point was I should
haven'ticed how stressful this was for her and backed off, and that I
should apologise for giving her an impossible ill-defined task. I gave
her no
algorithm to decide which key to kit. Her reluctance for me
made no sense. It wasn't as though I was asking her to
jump out of a
plane.
I had taught university level and children before, but never a group
such as this. It was completely different.
I talked about this with various people trying to understand what was
happening.
One person said, that older adults are extremely afraid of making a
mistake, especially a public mistake.. They'd find it humiliating.
(I hadn'ticed teaching university students a few'd refuse to work
at the black board.) They want to know exactly what to do. They want
assurance the odds of making a mistake are extremely low.
It seems to me, you can not learn anything in computers until you are
willing to make hundreds of mistakes. You've to keep trying thing
after thing until you find something that works. If you punish
yourself for failing to guess the right answer the first time, you
will become paralysed and incapable of solving any but the simplest
problems.
--
Roedy Green Canadian Mind Products
The JAVA Glossary
http://mindprod.com
| From: Roedy Green |
Date: Saturday, October 27, 2007
|
On Fri, 26 Oct 2007 12:03:22 -0700, Daniel Pitts
wrote in message, quoted or indirectly
quoted someone who said :
This sounds like an exaggeration, but I believe it.
The fact I left out was these women had been out of the work force for
a very long time, and were having minor psychological problems
reintegrating. They were a very timid group, possibly abuse survivors.
My course was supposed to give them a gentle, low-pressure
introduction to computers. I was known for teaching in a light
humorous way.
--
Roedy Green Canadian Mind Products
The JAVA Glossary
http://mindprod.com
| From: Patricia Shanahan |
Date: Saturday, October 27, 2007
|
wrote in message:
...
It seems to me, you can not learn anything in computers until you are
willing to make hundreds of mistakes. You've to keep trying thing
after thing until you find something that works. If you punish
yourself for failing to guess the right answer the first time, you
will become paralysed and incapable of solving any but the simplest
problems.
...
I'd
delete "in computers" from the first
sentence of this paragraph.
Learning almost any skill involves trying to exercise the skill before
you've acquired it.
Patricia
| From: Lew |
Date: Saturday, October 27, 2007
|
wrote in message:
Since the definitions point out that the word
'nous' has many different meanings, I'll
clarify that I actually meant 'common sense'.
If you do not get /nous/ into your head, you might get your head into a noose.
--
Lew
| From: John W. Kennedy |
Date: Saturday, October 27, 2007
|
wrote in message:
wrote in message:
wrote in message:
have enough nouse
"nous" (or " "). Greek word.
Oops! My bad. Bad enough that I am using obscure
words, worse that they are neither English*, nor
correctly spelt!
Since the definitions point out that the word
'nous' has many different meanings, I'll
clarify that I actually meant 'common sense'.
* If only for the reason that people might be
expecting 'English' here.
The sense you meant is sufficiently known (as a British slang
expression) to be in larger dictionaries, and I, though an 'umble Yank,
already knew it from somewhere or other.
--
John W. Kennedy
"You can, if you wish, class all science-fiction together; but it is
about as perceptive as classing the works of Ballantyne, Conrad and W.
W. Jacobs together as the 'sea-story' and then criticizing _that_."
-- C. S. Lewis. "An Experiment in Criticism"
| From: Daniel Pitts |
Date: Saturday, October 27, 2007
|
wrote in message:
On Fri, 26 Oct 2007 12:03:22 -0700, Daniel Pitts
wrote in message, quoted or indirectly
quoted someone who said :
This sounds like an exaggeration, but I believe it.
Strangely it isn't. What is odd is the other women in the class
chastised me as well. I was dumbfounded. Their point was I should
haven'ticed how stressful this was for her and backed off, and that I
should apologise for giving her an impossible ill-defined task. I gave
her no algorithm to decide which key to kit. Her reluctance for me
made no sense. It wasn't as though I was asking her to jump out of a
plane.
I had taught university level and children before, but never a group
such as this. It was completely different.
I talked about this with various people trying to understand what was
happening.
One person said, that older adults are extremely afraid of making a
mistake, especially a public mistake.. They'd find it humiliating.
(I hadn'ticed teaching university students a few'd refuse to work
at the black board.) They want to know exactly what to do. They want
assurance the odds of making a mistake are extremely low.
It seems to me, you can not learn anything in computers until you are
willing to make hundreds of mistakes. You've to keep trying thing
after thing until you find something that works. If you punish
yourself for failing to guess the right answer the first time, you
will become paralysed and incapable of solving any but the simplest
problems.
Man, I would've apologized. I'm sorry you're too stupid to learn
computers. Just kidding.
Although, my with my personality I would've apologized, not for my
methodology, but because I did not notice/realize the distress I was
causing. I can see how most people in your situation would not
apologize. I do not think you're wrong.
I also agree that the fear of mistakes is debilitating to'd-be
students. Even I fall prey to that fear at times. As soon as I get
over it, I tend to do better than many of my peers.
--
Daniel Pitts' Tech Blog:
<http://virtualinfinity.net/wordpress/>
| From: Daniel Pitts |
Date: Saturday, October 27, 2007
|
wrote in message:
wrote in message:
wrote in message:
wrote in message:
have enough nouse
"nous" (or " "). Greek word.
Oops! My bad. Bad enough that I am using obscure
words, worse that they are neither English*, nor
correctly spelt!
Since the definitions point out that the word
'nous' has many different meanings, I'll
clarify that I actually meant 'common sense'.
* If only for the reason that people might be
expecting 'English' here.
The sense you meant is sufficiently known (as a British slang
expression) to be in larger dictionaries, and I, though an 'umble Yank,
already knew it from somewhere or other.
Yeah, but you're into reading lit., so you've a wider experience than
the average American. (Does not Yank mean something else in British en_UK?)
From context, I simply took it as a word I did not understand that meant
something that someone *should* have. Being clarified as common sense,
it turns out I was right.
--
Daniel Pitts' Tech Blog:
<http://virtualinfinity.net/wordpress/>
Next Message: Amazing Matches Creation
Blogs related to split query
I need a query to order some Topics based on popularity which ...
Wow… it must suck to develop on MySQL when you have to document every little change you make. is it possible to use a spit() type function in mysql on the
query line? ie, select * from blah wehre field=
split('user.shit', '.');
...
Im struggling to make a query to find the active topics for a ...
we're way too lazy to
split it up into separate states. i bet most states have significantly different regions. yeah. time for dinner. goodnight. bye. see ya. idaho is either desert or trees or mountains great fishing though. hi sfannan
...
Hi all Im trying to change the default value of a column and I ...
INSERT INTO bans (ip) VALUES ('195.138.78.40 ','193.17.208.229'); perhaps. INSERT INTO bans (ip) VALUES ('195.138.78.40 ','193.17.208.229') - Column count doesn't match value count at row 1. my bad you will have to
split your
query into
...
java programming tool
... example
java quartz scheduler
java quartz timer
java queen
java query java query api
java query builder
java query class
java query database
java query language
java query ldap
java query object
java query run script sql
java query ...
Re: Running query text through an Analyzer without QueryParser?
For example, 00:14:da:81:21:4f will be
split by the StandardTokenizer as the tokens "00", "14", "da", "81", "21", and "4f". Suppose I want to search for 00:14:da:81:21:4f. In the search box, I type 00:14:da:81:21:4f.
...
Re: Scoring algorithm suggestion?
Using a Boolean
query with a slope I get most of the time the correct documents. For example: The Bigramm
split for "document" is do oc cu um me en nt If a user searches the misspelled "documnts" I use a Boolean
query with a slope
...