Norbert Lebenthal

Ranch Hand
+ Follow
since Sep 23, 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
8
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Norbert Lebenthal

Sharma Ashutosh wrote:It depends upon person to person-experience as well as how many things he/she already knew.



yep, making the question very tricky: thanks a lot for answering

Sharma Ashutosh wrote:
For part 1- i will say around 2 hours per day and extra work on weekends-close to 7-8 hours and you should be ready within 2-2.5 months. Go for at least one mock test-Sun's ePractice.


so (2*5 + 7)*10 = 170 hours there

Sharma Ashutosh wrote:
After that it can take around 100-120 hours for part 2 and part 3.


of which I've to add 120 hours. Really a lot, then

by reading you, it feels like only the first part is needed before the 1st of August. However, when reading oracle Important Changes to Java, and Oracle Solaris Certifications page stating:


I started my Java Developer or Java Architect Master certification path before August 1, 2011. Do I have to complete the certification by August 1, or will the training requirement be waived since I started the process before the deadline?
Anyone who does not completely finish the current track requirements before August 1, 2011, regardless of when they started the certification path, will be required to meet the new requirements, which will include a mandatory course attendance requirement.



it feels like all of it should be done before the 1st of August, am I wrong there?

Sharma Ashutosh wrote:
SCJD is a good exam and you already have 7+ years of experience.



could be worse indeed ;)
hi

I was just ask about my team lead to see about doing OCMJEA this year, and I realized this issue with the training. The training cost would make prohibitive for my company to pay for this certification, hence the usual question... how long to do this on a selft training kind of way?

I did the SCJD5 in about 100h, having 7 years of IT experience...

If you could provide some time estimate, I could then see how it matches with my possibilities (12h/week + potentially a bit of free work time on it)

thanks in advance...

best
norbert

David Byron wrote:
If the application hangs, that's a severe bug (likely an error in logic) that ought to be fixed, not hidden.



informing the user a severe bug happened and letting him choose what to do know (like trying again or going at his IT staff) doesn't fell like hiding, does it ? It's really about getting the bug fixed and letting the user knows what's happening.

anyway, I want to finish this stuff, so I won't add this feature, since it looks like none did it and some got 100% right.

in the end, it feels surprising to me: showing user friendly error page rather than a stack trace or, worse, hanging, is considered a good practice in web applications and web application frameworks (like wicket for example).
hello again you both

thanks for your answers!

I agree it would be protecting the user about developer errors.... But then isn't it the core of IT anyway? The user isn't responsible if testing wasn't done properly enough, the application should always, at least, inform about the issue.

When a web application fails because something has gone wrong, do you like to see the stack trace in your browser ? Or an Error 505 message ? Or even worse, and closer from the current situation, do you like to do something and then that nothing happens, no knowing whether it's intended or not ?
hi all

@Roberto:
I use it as well for the record number, so it's used twice, once centralized somewhere (DRY principle).
Regarding the static aspect, while I deeply agree, Java doesn't offer us much choices here, furthermore this util class is a spin off from the UUID one, where the user is expected to do exactly the same.

About the javadoc, it starts with "Generate a long UUID". However this is partly misleading (it's a weak UUID), hence the big comment about it.

Regarding the way to generate this UUID, IMHO, I would prefer a proper long UUID mechanism than to rely on some artifact hopefully good enough, like nanoTime or currentTimeMillis, with no formal/mathematical backing since it's explicitly said to *not* use for this purpose.

Using the current thread id feels even weaker. What if someone decides to use Data class in a monothreaded way but with multiple logical clients? Or if someone is doing thread pooling for performance reason on the calling side ? If two locks happen in the same thread, one could even reuse the first lock cookie to unlock the second lock, breaking severely the contract for the logical lock.

In the end, using the thread id looks like solving a logical record lock issue with a solution based on how it will be use outside of its scope, which feels bad to me, especially since it could backfire if not use the pre supposed way.

Maybe a solution might be there http://stackoverflow.com/questions/325443/generate-uuid-in-java => using UUID.randomUUID().getLeastSignificantBits() it would take 2^32 UUIDs to get a collision. However I'm unsure whether there is a minimum time between each call to UUID.randomUUID(), but then the issue is the same for nanoTime or currentTimeMillis.


hi

the last point I stumble upon in my code is that I don't handle at all RuntimeException and its sub classes. So if some NPE or IllegalStateException or whatever is thrown anywhere, the ui just feels stuck (nothing happens, for no visible reason, while something is written in the standard error output).

Have you done something for it?

Personally, I'm pondering to write in each of my business servicer something like:


with UnexpectedProgramException being a checked exception.

On the ui side I could then display a proper message for it, like "An error occurred, please try again. If the error persists, please contact support".

I've the risk of such RuntimeException because I throw IllegalStateException there and there, and so I would prefer to handle them somehow rather than to let the user in the dark with an unresponsive app.

:$

++

Roel De Nijs wrote:

Norbert Lebenthal wrote:What's your pick on that ?


You wrote a whole lot of documentation for just 1 single line of code. I used the same System.nanoTime() to get my client identification number and just added in the choices.txt that in the future this "algorithm" could get improved (make more unique) if necessary. That's it!



well, that's the biggest comment in my app by far... however it's also the less clean stuff I do I think... Having done a bit more research, at work I would even consider using the least significant half of a generated UUID (cf http://stackoverflow.com/questions/325443/generate-uuid-in-java ), however I guess it's a bit over the top for SCJD!

thanks again though, reading all these long posts is quite an endeavor...
while fine tuning my choices.txt, I stumbled upon this topic of record id generation and, similarly, the logical lock cookie generation.

In the end, for both the record id and the cookie, what I really want is for these numbers is to be unique, like the same record id or cookie shouldn't be created twice over the application life span. The goal is to have no one asking for some record/cookie with some stale value and still get some result.

This is a bit tricky to achieve, IMHO, since we don't persistently store the record id or cookies, so caring for restart is a bit hard.

So, the need is for an UUID.

However, AFAIK, Java doesn't provide a facility to generate UUID as long by default. The UUID.randomUUID().timestamp() calls throwing exception by default since the JVM generated UUID isn't a time based one.

So, what I'm about to do is the following: having an util class to generated UUID and, in the first instance, to just do System.nanoTime() (and documenting this choice for sure).

Edit bis, to make the matter clearer, the code is the following:

What's your pick on that ?
Thanks for the congratulation! I leave my children future up to them... but then I won't be able to spare them totally from IT, that's for sure ;)

Regarding this logging issue, I'm quite annoyed... I guess I'll let the code as it is, I don't want to change it a lot (since it is in a shippable state)
thanks again roel

sorry for the delay, but my 2nd child is born in between, so...

well, happy to read you couldn't reproduce the issue.

On my side, it did happen again with the joined mock file:


startingThread thread main
31 janv. 2011 11:06:37 test.log.LogExample run
INFO: about to disable the log
DatabaseBrowseAction outcome thread AWT-EventQueue-0
31 janv. 2011 11:07:14 test.log.LogExample$1 actionPerformed
INFO: file selected /home/zedros/Bureau/mock.db
closeButton ActionPerformed thread AWT-EventQueue-0



The exact workflow was the following:
- launching the app
- click on the browse button
- selection of the home button then click on desktop
- selection of the joined file
- click on the close button

btw, it only happens when I use the .db filter to choose a .db file. With the other filter it doesn't happen.

I'm a on ubuntu 9.10 (more precisely 2.6.31-22-generic #70-Ubuntu SMP Wed Dec 1 23:51:13 UTC 2010 i686 GNU/Linux), using this java:
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.4) (6b20-1.9.4-0ubuntu1~9.10.1)
OpenJDK Server VM (build 19.0-b09, mixed mode)

overall, it feels like a JVM/logging bug to me...
hi Roel

thanks for your blazing fast answer

however, even with your line, I still have some issue with logging: even if turned off at init time, when someone select a file in the browse dialog then the logging in the FileDatabaseManager is outputted.

When I don't select a file in the same dialog, then the logging in the FileDatabaseManager isn't done

in fact I'm seriously considering dumping all logging because of the time I've lost in this turning off business.

I even wrote an example for it:


=> launching it, using the browse dialog to select a file (using the filter on .db file) triggers some logging to be seen afterwards. Using the default filter (all files ok) doesn't trigger this behavior. Feels really buggy and crazy to me...
I'm not allowed to use SwingUtils in what I do, so... but good to know though.
13 years ago
hi

I've been using a bit of jdk logging and I would like to disable it for the "final" version

up to now I did something like this in my code:


I then call it with the various logger I've.

Yet I'm not happy with it:
- enabling logging means changing the code (and figuring out where first)
- it doesn't work in all cases, I suspect it to handle badly multithreaded access to the logger

In the end, do you think it's possible to just include some logging configuration file in the jar provided ?

thanks in advance
best
norbert
hi

A little boy after, I'm back (and mum at the hospital as it should be )

@Tom

I tried both, plus extra stuff, to no success.

I guess Rob finding explains it.

Anyway, I let the code setting the mnemonic, maybe some other L&F could make use of it.

a pity it doesn't work but it isn't such a big deal
13 years ago
hi

I'm displaying a JFileChooser this way


yet the Ok button's k isn't underlined and hitting alt + k doesn't trigger it...

what am I missing ?

thanks in advance
13 years ago