Jul 30, 2013 14:46
using eclipse?
Jul 30, 2013 14:44
all it does it to call trim() on all entries.
Jul 30, 2013 14:44
that method transforms each entry in the list
Jul 30, 2013 14:41
@stacktome: That is a bad idea. Use an XML parsing library, not a String.
Jul 30, 2013 14:41
@stacktome: then what's wrong with the answer I posted above? Any reason for not accepting it?
Jul 30, 2013 14:41
@stacktome: you can also do that with Guava, see my updated answer.
 
Jul 2, 2013 11:53
Anyway, If I were you, I'd build a trie, where each node is step of your path. Then you can do with it what you want,
Jul 2, 2013 11:52
@RahulBorkar I didn't downvote, but just look at this chat, you hardly explained anything in your question. Also your example was only easy to understand for you - not for anyone else...
Jul 2, 2013 11:42
and if cat and dog were folders?
Jul 2, 2013 11:40
first 4 are the same as before
Jul 2, 2013 11:40
and for
/root/abc/foo
/root/abc/bar
/root/abc/foo/bar/
/root/abc/foo/baz/
/root/def/animal/cat
/root/def/animal/dog
Jul 2, 2013 11:38
and for
`/root/abc/foo`
`/root/abc/bar`
`/root/abc/foo/bar/`
`/root/abc/foo/baz/`
Jul 2, 2013 11:36
/root/abc/foo/bar/
Jul 2, 2013 11:36
/root/abc/bar
Jul 2, 2013 11:36
/root/abc/foo
Jul 2, 2013 11:35
What should the output be for /root/abc/foo, /root/abc/bar, /root/abc/foo/bar/
Jul 2, 2013 11:30
do the files in your example exist?
Jul 2, 2013 11:26
@RahulBorkar: now we're getting closer... How do you distinguish between file and folder?
Jul 2, 2013 11:26
The code would be good (to show you made some effort). But you have to make clear (in words) what are the rules for the output.
Jul 2, 2013 11:26
@RahulBorkar: Still very unclear. In your new example "/root/test" is a prefix of "/root/test1", so why should both be in the result list?
Jul 2, 2013 11:26
Sorry, this makes no sense to me. Using your argument again, "/etc/rahul/test" and "/root/rahul/e?ee/asasa/" also have a common prefix: "/". Actually, "/" is the longest common prefix of all of your inputs.
Jul 2, 2013 11:26
The main problem is: Nobody understands the rule, why this input leads to that output. As long as this is not clear nobody will try to answer the question.
Jul 2, 2013 11:26
@RahulBorkar: "/root/test/bbb/ccc" is also unique. Why's that not in the list?
Jul 2, 2013 11:26
@RahulBorkar: Using your argument, "/etc/rahul/te" should be in the result list also.
Jul 2, 2013 11:26
@RahulBorkar: in your example, why is "/etc/rahul" a common prefix? It's only there once.
 

 Android Era with Kotlin and Java

Important: Read dos and don'ts here: androidera.github.io . Ma...
May 15, 2013 07:05
I posted a link in this question: WhitespaceAfter conflict with GenericWhitespace
May 15, 2013 07:05
is it appropriate here to ask to answer a simple java code style poll?
May 15, 2013 07:05
Hi everyone
 
Jan 30, 2013 14:01
and delete the old ones
Jan 30, 2013 14:01
ones
Jan 30, 2013 14:01
you can solely use the new oe
Jan 30, 2013 14:01
and you verified the data integrity of the new tables
Jan 30, 2013 14:00
once it's done
Jan 30, 2013 14:00
that reads from old tables and inserts into new tables
Jan 30, 2013 14:00
you'll have to write a program
Jan 30, 2013 13:19
google does a lot of stuff ;)
Jan 30, 2013 13:19
different use cases, different tools
Jan 30, 2013 13:16
sure they access some stuff by files, also
Jan 30, 2013 13:15
you can read about it, they publish research papers on that topic
Jan 30, 2013 13:15
it's their own database
Jan 30, 2013 13:14
google uses BigTable
Jan 30, 2013 13:14
not possible with a flat file
Jan 30, 2013 13:14
with a DB you can and should use indexes
Jan 30, 2013 13:13
Can't be more wrong
Jan 30, 2013 13:13
no no no no no no no no
Jan 30, 2013 13:12
or else, we could just use flat files
Jan 30, 2013 13:12
that's what DBs are for
Jan 30, 2013 13:11
querying one large (many rows) table is quicker than 3 queries to small (few rows) tables
Jan 30, 2013 13:10
so yes, it would be definitely be faster
Jan 30, 2013 13:09
that would be one single lookup with my db design