Mike Thon

Greenhorn
+ Follow
since May 12, 2010
Mike likes ...
Mac Linux
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 Mike Thon

Hi Rogers - I learned some basic java 6 a few years ago using one of your books (the 21 days book, I think) and now I want to return to java for a new project. I have a couple of questions:

1) Is this new book appropriate for someone that already knows the basics, and that has experience with other programming languages?

2) What book would you recommend for someone after finishing this book?

3) Does your book cover JavaFX?

Thanks!
Mike
10 years ago

Andrey Kozhanov wrote:Why not to read log level from command line or some configuration file?



Of course, why didn't I think of that? The other problem is that the docs recommend creating a separate logger for each class. Then I would need to ensure that the log level is set for each class. Seems like a lot of lines of code to write to set up logging and control the level of verbosity, so it seem like I'm doing it wrong.
13 years ago
I'm learning how to user java.util.logging. I can log messages to the console but I would like to suppress the messages when a user runs my program. Is there a way to set a different default logging level for development vs deployment? I can see how to change the log level with logger.setLevel() but if I use this then I have to change code in each class with a logger when I want to deploy my project. Obviously not the way to do it.
Thanks
13 years ago
I would be interested to hear from anyone who is doing development on both Android and iOS any comparisons of the two platforms, both from the development point of view and from a business point of view. From what I've read, it seems easier to sell apps for iOS but easier to develop apps for Android. I guess since this is an android forum the replies to my question will be biased!
13 years ago
I need to search for a string of text, ideally using a regular expression, and then highlight the string by changing the background color (probably using a <span> tag). I have found solutions that will highlight individual words, but none seem to search across tags and apply the span tag in a way that doesn't corrupt the html. Any ideas?
Thanks.
Why not use == for comparing strings? I used the following code to test == versus .equals()



for .equals()
$ time java Cas
1726

real 0m2.005s
user 0m1.981s
sys 0m0.053s

for ==

$ time java Cas
3

real 0m0.413s
user 0m0.288s
sys 0m0.060s

I ran each test a couple of times. From this it would seem that == is several fold faster than .equals(). I learned somewhere that strings should always be compared with .equals() in java. I suspect the difference here is in the way that the compiler can optimize the loop, so this might not represent the performance you would find in real world code.
14 years ago