Off Topic: Para reirse un rato con Worse Than Faliure
Una de ventanas:
En Oracle Discover:

Otras:
Dejanos tu FeedBack ;)
Y el algoritmo de la semana:
final private static String andvariants[]=
{"AND", "aND", "AnD", "ANd", "anD", "and", "And", "aNd"};
final private static String notvariants[]=
{"NOT", "nOT", "NoT", "NOt", "noT", "not", "Not", "nOt"};
final private static String orvariants[]=
{"OR", "Or", "oR", "or"};
/* Returns the index of the next occurrance of "AND" in
* <code>expression</code>starting from <code>begin</code>,
* without regard to case, or -1 if "AND" cannot be found.
*/
private static int findAnd(String expression, int begin)
{
boolean found=false;
int min=expression.length();
for (int i=0; i<andvariants.length; i++)
{
if (expression.indexOf(andvariants[ i ], begin)!=-1
&& expression.indexOf(andvariants[ i ], begin)<min)
{
found=true;
min=expression.indexOf(andvariants[ i ], begin);
}
}
return (found ? min : -1);
}
/* Returns the index of the next occurrance of "OR" in
* <code>expression</code>starting from <code>begin</code>,
* without regard to case, or -1 if "OR" cannot be found.
*/
private static int findOr(String expression, int begin)
{
boolean found=false;
int min=expression.length();
for (int i=0; i<orvariants.length; i++)
{
if (expression.indexOf(orvariants[ i ], begin)!=-1
&& expression.indexOf(orvariants[ i ], begin)<min)
{
found=true;
min=expression.indexOf(orvariants[ i ], begin);
}
}
return (found ? min : -1);
}
/* Returns the index of the next occurrance of "NOT" in
* <code>expression</code>starting from <code>begin</code>,
* without regard to case, or -1 if "NOT" cannot be found.
*/
private static int findNot(String expression, int begin)
{
boolean found=false;
int min=expression.length();
for (int i=0; i<notvariants.length; i++)
{
if (expression.indexOf(notvariants[ i ], begin)!=-1
&& expression.indexOf(notvariants[ i ], begin)<min)
{
found=true;
min=expression.indexOf(notvariants[ i ], begin);
}
}
return (found ? min : -1);
}
Salu2