Preetish Panda

Greenhorn
+ Follow
since May 10, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Preetish Panda

Please suggest me an IDE . Currently I'm using JBuilder and I've one simple requirement.The IDE must be able to create a JAR file of my project and the dependent libraries of the class files must be included in the JAR file.
I resolved it using jdom and inbuilt SAXBuilder class .
I'm trying to parse XML file in order to update a node value

<abc>
<def>/home/setup</def>
<fgh>encrypted</fgh>
<hij>configuser</hij>
</abc>

I need to update node value of <fgh>

Here is my code .. I'm able to read node value .. but can't update it.Because, for some reason setNodevalue is not working.
Any help is highly appreciated.

This code is working fine :
13 years ago
I've two string which are delimited by ;

list1="abc;cd;ef;xyz"

list2="asd;ght;ef;xyz"

Now I've to create list3 which will have tokens as a result of list1-list2

list3 will be "abc;cd"

Please check out my code



This results in list3=cd;
13 years ago

Ritesh Pareek wrote:

For the directories given by you ... according my algorithm it will be
c:\checko~1\foo
c:\checko~1\foo



No, This must be like


c:\checko~1\foo
c:\checko~2\foo

java.lang.String API having this solution. Algo should be look like this

loop1 while mainStr not null
resArr[count++] = mainStr.slice(indexof("\\"))
end Loop2


loop2 while resArr

1. you can use selection/binary sorting here
2. truncate tailing chars with ~1
3. do compare array element for 8 char similar string.
4. if similar truncate tailing chars with ~2,3,4... so on



You are not getting me .In my case there will be only one string and only ~1 has to be appended.
No question of ~2,~3,...

Thanks for your suggestion.
13 years ago

David Newton wrote:Right, what I'm saying is that the two different directories would map to the same shortened string, which is a Bad Thing.



Ok.. In my case this kind of scenario won't arise.
13 years ago

David Newton wrote:Seems like you have all the steps--what, specifically, are you having a problem with?

Be careful with this algorithm, though--what would happen if you had these two directories?

c:\check out\foo
c:\check out this\foo



For the directories given by you ... according my algorithm it will be
c:\checko~1\foo
c:\checko~1\foo

As foo is devoid of space.

I was just looking for some tip or approach that will be quite easy.
13 years ago
Hello.. this is my first post here ..I'll explain what I want to accomplish using an example

Suppose I have a string C:\check out\checking out\BACKUPER

Now I'll split it using delimiter as \ .
So it will become

  • C:

    check out

    checking out

    BACKUPER


  • "check out" and "checking out" contain space.The code will remove the space and convert
    them into "checkout" and "checkingout".

    Then truncate them into strings of 6 characters and append ~1.

    Finally they will be become checko~1 and checki~1.

    BACKUPER doesn't contain space.So, it will remain as it is.

    Finally all will be appended and result will be C:\checko~1\checki~1\BACKUPER


    Can any one suggest me an approach or any function that will make this adventure like a cake walk ??

    Thanks in advance ..
    13 years ago