Victor M. Pereira

Ranch Hand
+ Follow
since Mar 02, 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
1
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Victor M. Pereira

You mean the resourcebundle of spring or by JMS?
11 years ago
Well is not really for form validation, I couldn't think of a better way of automatized messages.
11 years ago
I don't know if it's possible but I would like to handle exceptions in the same page of the form to avoid creating new pages just for exception handling.

For example I have business method: findByLastVisit(Date date);

That returns data or throws an exception if no data is found. On my jsp I have:


I would like to display those exceptions in the same place as errorInForm. How can I do this? Do I have to modify the web.xml to add the same page for exceptions?
11 years ago
Well the catch on line 10 is for trapping all exceptions that come of java.lang.reflection API. While the exception thrown by the methods that are invoked are the ones I need to throw.
Well I think I have spotted a small mistake on my code example. I'll try it and report on it.
11 years ago
By simple curiosity, do you want to create your implementation of a standard encryption algorithm or are you trying to make a playfair cypher or viginere cypher?

From what I read it seems to be closest to the second one. If it is you could create a alphabet class that obtains the ascii code and compares it to the values acceptable.
11 years ago
Well you could use jasperReports that can write to pdf and rtf and different presentation data.
11 years ago
Ok right now I have several methods that follow the next repetition.

Search throughout a list use a method to see if an object is the one required and return an unmodifiable value of the method if it isn't throw an exception.

Example:


What I'm looking is through a method encapsulate this common repetition.

SortOfCode:


Unfortunately, I can't throw the exception through the throwable.

How can I pull it off?
11 years ago
I'm studying the gang of four book to add more patterns to what I know. And I've stumbled across the chain of responsibility pattern.

From what I read from the book and the internet. I saw two different approaches:

1) Traverses whole tree of successions and applies every handle that can do something with the data. This seemed like a if applicable decorate.

2) This one was traverse the tree until someone can do something about it, if it ends have a default.

The main problem is that I can't see myself using them. Since, most internet examples aren't really CoR but some mock of Strategy. In what cases can I really say
this is without a doubt CoR (Chain of Responsibility).
Why don't you extract methods from the getScores()?

some isValid() method and some getValueUntilCorrect() method?

The isValid method could have different methods that check for different things.

And after you check it correct you could extract class Validator. That will have all validation related methods.
11 years ago
what do you mean with cleaner approach?

It seems a sort of maven class hierarchy for building? If that is what you want you can check Apache Ivy.
How do you search for these objects?

Do you search them through transactions or batches?

Depending on your answer you might or might not remove the two-way into one-way.

And from this point of view, the check class seems to be an aggregate from transaction, so is there really a need to have batchId and tranId?
Can there be several checkDate of the batchId in the same day?

Is there a real need to have a history of checks or would saving the last done check be enough?

So in reality, I don't have enough information to know if you can do two-way directionality into one-way and do an inline class refactoring.
I only found a page that claims the following:

"Before you switch to UTF-8 under Linux, update your installation to a recent distribution with up-to-date UTF-8 support. This is particular the case if you use an installation older than SuSE 9.1 or Red Hat 8.0. Before these, UTF-8 support was not yet mature enough to be recommendable for daily use.

Red Hat Linux 8.0 (September 2002) was the first distribution to take the leap of switching to UTF-8 as the default encoding for most locales. The only exceptions were Chinese/Japanese/Korean locales, for which there were at the time still too many specialized tools available that did not yet support UTF-8. This first mass deployment of UTF-8 under Linux caused most remaining issues to be ironed out rather quickly during 2003. SuSE Linux then switched its default locales to UTF-8 as well, as of version 9.1 (May 2004). It was followed by Ubuntu Linux, the first Debian-derivative that switched to UTF-8 as the system-wide default encoding. With the migration of the three most popular Linux distributions, UTF-8 related bugs have now been fixed in practically all well-maintained Linux tools. Other distributions can be expected to follow soon. " (UTF - 8 and Unicode FAQ for Unix/Linux)
12 years ago
No what I mean is the code I showed you is junit Assertion code implementation that I found in the net. (i.e. not mine but from the library that people download to use junit)

You did see the assertNotNullsOnArray passing the reference for the thing I just converted right?

If there were any nulls on the conversion the test would fail. Since any uncatched exception is a red bar.

Sometimes I wonder how did we end in a testing framework argument.
12 years ago
May sound dumb, but could you try deleting <load-on-startup>1</load-on-startup> line from your DD. Is a running theory bu tjust try it.
12 years ago
I agree, does your authentication has to be speech recognition? Can't you use tokens as the second level of security?

A thing they know, A thing they have.
12 years ago