Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!

Mukesh Ranjan

Greenhorn
+ Follow
since Jun 24, 2009
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 Mukesh Ranjan

Disagreed!!
why not to think for optimization at the time of development itself rather than after having the system crash,

I request people to maintain himself before putting their words at public forum
10 years ago
Shankar,
More you restrict the scope of variabe, more will be the memory management, because it will be soon collected by garbage collector and it will improve performance,
so think before declaring variable, like here if the variable is required only within try block then it should not be declared outside try block.
10 years ago
Currently IE-8 also came up with developer tools where you can debug code and can run profiler also.
It is quite interesting stuff from IE-8.
10 years ago
Try http://www.pourbrain.com , good for core java interview question & answers
10 years ago
It is true that you cannot control the memory size allocation for an object but you can use Runtime class to use available memory and maz memory and can implement logic based on that, but but but it is not a perfect way of handling memory.
10 years ago

Greg Charles wrote:True, Good explanation

10 years ago
It is always better to have modular approach even for properties files, having a single file will create issue in future when your application grows, and also performanace and feasability issue.
So i will suggest to have multiple bundle based on module,
10 years ago
Which exception you are getting exxactly,

Check if it OutOfMemory Exception or StackOverflowException,

If you are doing it inside some thread or if it is a local variable then try to look for stack size, rather than heap size..


For more detail you can look at site: www.pourbrain.com
10 years ago
It is almost a bad idea to remove duplicate and using loops for that.

Its better to use hashset then, below is the example code;

ArrayList<String> al1 = new ArrayList<String>();
al1.add("raja");
al1.add("raja");
al1.add("tendulkar");
al1.add("prakash");
al1.add("sachin");
al1.add("sachin");
al1.add("zaheer");
al1.add("asin");
al1.add("surya");

HashSet<String> set = new HashSet<String>(al1);

Iterator iterator = set.iterator();
while (iterator.hasNext()) {
System.out.println(iterator.next());
}

Answer:
asin
prakash
tendulkar
surya
sachin
zaheer
raja
10 years ago
why don't you try fileinputstream instead of URL and if you are using URL , which class you are using,

Below code also works, you can use that also where i have used FileInputStream class

try {
URL url = new URL("D://a.txt");
ResourceBundle b = new PropertyResourceBundle(url.openStream());
System.out.println(b.getString("34545_NameExit"));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
10 years ago
You have to use Unicode here to insert Arabic data into the database as mysql supports binary.
while viewing of data you have to read it in binary and have to keep encoding as utf-8

May it will help you
You have to read property file and then have to do setproperties and then have to use either save or store method for persistent storage

1. Load Properties first
2. props.setProperty(propertyName, NewValue);
3. props.save(new FileOutputStream(new File(propertyFilePath)), "");

May this will help you
11 years ago
Please share your experience. which book you followed etc
11 years ago