David Jason

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

Recent posts by David Jason

Seetharaman Venkatasamy wrote:thanks Bear. dont know where you get all these my lovable pictures



Look at the picture carefully.
11 years ago

Bear Bibeault wrote:



Time !!!

The guys who draw such stuff must be having lots of it. Good though.
11 years ago
My Windows pc started slowing down and even hanging frequently after about a year. All my software is genuine (yay !), I have a paid antivirus. I surf safely.
Then, why does my system get messed up every now and then ?

I am thinking of doing all my development work in linux soon. Windows is really expensive - it costs money to buy and then you lose hours formatting the trash
and reinstalling tons of important software. And then backing all that stuff up because you might have to format your hard disk again.
How is mac ? I hear good things about it, but it is too expensive for now.

Is there any platform where i can do my development work in peace without having to pay, pay, pay and still get trash in the end ?
11 years ago
Each database has its own characteristics and the same SQL statements will not necessarily work on all of them.
In that case, it it seems better to write code for each database instead of one big class that can handle all databases.
Is it possible to make your code database agnostic ? If so, how can we do that ?

11 years ago

Vishal Shaw wrote:Hi,
I did not get it, why do you want to work with 10,000+ String all at a time. If they are not going to be used all at once, try using a few ,work with them make the objects null, notify gc() , then take another bunch.

Still if you want to work with a huge bunch of String object, I would suggest you to use either StringBuffer / StringBuilder. For concat, you can use append() while for replace you can follow the given steps
1> convert the object to String using toString() ,
2> perform replace() on the converted String
3> reinitialize the Builder/Buffer object with the replaced String.
4> Make the String object/s null and notify gc().

Now you have to choose.

Vishal.



Thanks. I think I will do that. Looks like there is no class for my requirements.
I want to execute some test SQL statements in a batch vs one at a time. When done as a single statement,
Strings can be used. What about a huge 10000 word statement all executed at once ?
I have about 10,000+ strings. There are also many replace and concatenation operations on each string.
I want my code to use minimum memory. StringBuilder, does not have a convenient method like replace
of String Class.

I am looking for something like String class which has the characteristics mentioned below.

a) It is modifiable or mutable and uses minimum memory.
b) Has easy methods like concat, repace etc.
c) It is reliable and maybe even popular.

I see that there is a Ropes class. I don't know if that is good.
http://ahmadsoft.org/ropes/

11 years ago

Steve Luke wrote:Are you asking if more memory is consumed by holding the value returned from a method (boolean bool = getABoolean();) versus not holding the value returned from the method (getABoolean();)?

If the answer is yes, the amount of memory being 'saved' would be so inconsequential as to not be worth thinking about. If you need the returned value, store it in a variable. If you don't care about the returned value and just call the method for another affect, then don't store the returned value in a variable. But the memory consideration shouldn't come into the picture.



I understand that the amount of memory consumed will be too small/insignificant. I was interested in knowing if there would be a difference, no matter how small.
11 years ago

William P O'Sullivan wrote:Start here for the tools ...

http://developer.android.com/tools/sdk/tools-notes.html

This also contains samples, emulators etc..

WP



Thanks, will look at it. But, i get jittery when I hear about official docs. They are generally not the best for beginners.
Any more sources as an alternative ?
11 years ago
I already know the so called "core java" topics. Now, i thought i will try a little android for fun.
I am not sure what books are the best or which is a better method of study.

Is is good to learn by seeing other people's code, modifying it and later making your own thing using
some of the code taken from various sources ?

Or just pick up a book and do the projects there ?
11 years ago
returnAboolean();
//do something else

or

boolean boo = returnAboolean();
//do something else

Does the 2nd one consume a little more memory ?

11 years ago
I have some questions about the Java garabage collector -
1- Is it "perfect" or has someone made something better ?
2- Is it improved every once in a while ?
3- How much should one rely on GC ?

11 years ago

Paul Clapham wrote:Well, anything in the Java API which needs to interface with features of the operating system ultimately has to involve native code. And since these features include basic things like working with threads and allocating memory, that means that Java programs couldn't run without using native methods.



For that reason, I think C++, C or even assembly are better because they let you see how things work at low-level or system level.
You also learn things like garbage handling.

The only advantage of java which makes it more attractive would be security and portability ?
11 years ago
What are the tasks/functionality provided to Java by its native methods ?
Would Java be severely crippled if it was not allowed to use native methods ?

11 years ago

Prasad prap wrote:Do have a look at this Stackoverflow


Yes, excellent post and good answers. Especially this:

Chris Cudmore wrote:
Take a look at the java API, and you'll see many classes and interfaces with the same name in different packages.

For example:

java.lang.reflect.Array
java.sql.Array

So, if you import java.lang.reflect.* and java.sql.* you'll have a collision on the Array type, and have to fully qualify them in your code.

Importing specific classes instead will save you this hassle.



Thanks for that link prasad.
11 years ago

Campbell Ritchie wrote:I found that old thread confusing to read. Our FAQ is more helpful.


Thanks, just read that now. Got what I was looking for. On the side,
I wish they could also give some info about how the compiling process is affected.
11 years ago