Yuri Sforza

Greenhorn
+ Follow
since Apr 15, 2002
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 Yuri Sforza

Best practices for custom components.

For example: how to reuse several standard components in one custom?
The following approach is often used to switch between view/edit modes
for the same page:

<h:inputText value="#{var.text}" rendered="#{var.editable}" />
<h:outputText value="#{var.text}" rendered="#{not var.editable}"/>

How to combine the above in one custom component like

<x:myText value="#{var.text}" mode="#{var.editable}" />

and do it with minimum coding?

--
Y. Sforza
[ December 15, 2004: Message edited by: Yuri Sforza ]
19 years ago
When configuring datasource in Tomcat's server.xml, the login/password
values are saved in plain text. Are there any options to apply
encryption or use smth like reference to external user profile?

TIA,
Y. Sforza
19 years ago
Thanks. Seems to be enough direction to start experimenting.
Will also check your example when ready.
--
Y. Sforza
20 years ago
JSP
Is it possible to make rendering of standard JSF html components role-dependent? Smth like disabling input for some fields in the form for some roles.
[ March 04, 2004: Message edited by: Yuri Sforza ]
20 years ago
JSP
How JSF handles file uploads (i.e. forms submitted with multipart/form-data encoding)? What if there are "normal" parameters (key=value pairs) sent together with file data, will they be lost for further processing?
TIA
--
Y. Sforza
20 years ago
JSP

... have never thought about trying this out, until now, I am going to have to go over my bitshift operators again to figure out why this happens. ...


Well, sometimes not so obvious things happen "behind the scene".
As JLS (�15.19) says "... [for int type of the left-hand operand] only the five lowest-order bits of the right-hand operand are used as the shift distance... The shift distance actually used is therefore always in the range 0 to 31, inclusive."
Also you should be very carefull when using types "smaller" than int.
Example:
byte b = -128; // So bits are 10000000
byte >>>= 2; // 10000000 >>>2 -> 00100000 that is 32
Correct isn't it? No, the result is -32.
It was quite confusing to me first time (I think it would be
confusing for everyone with C/C++ background). The trick here
is byte being promoted to int.
--
Y. Sforza
20 years ago

What would be the result?


To me more interesting would be:

What is the result (i.e. value of b after executing)?
--
Y. Sforza
20 years ago
Yes, of course. This means that there is no correct answer
(which is ALWAYS true) for the question #108.
--
Y. Sforza
20 years ago
Well, the topic was not about right-shift operator,
but about mock-exam error. Applying right-shift with
values like 0, 32, 64, ... will NOT change int variables,
so the imposed answer "change its sign" is not correct
as this is NOT ALWAYS the case.
--
Y. Sforza
20 years ago

Given x=y--; Which of these will be true AFTER execution?

x == y
x < y
x > y


Supposed answer is x>y but what about the following:


--
Y. Sforza
20 years ago

What does the unsigned right-shift operator
do to a negative number?
- keep it negative
- change its sign


Supposed answer is "change its sign", but what about
the following:
x >>> 0 (or 32, 64,...) ?

--
Y. Sforza
20 years ago

Originally posted by Frank Carver:
Are you sure this isn't a due to a browser problem? I've seen several bits of code where the author added extra characters to short output to bring it over some threshold, because IE can be reluctant to display very short pages.


Well, never can I be sure with such things. I have run another simple test
on Tomcat and it worked. So it looked like the problem is more probably
located at web-container. Though it was different jsp than original
one. To clarify situation more I have checked the behaviour by connecting
to server through telnet (do not have other than IE browser).
And yes, you are right -- the output is seen to be flushed correctly.
So it is IE to blame.
[ December 11, 2003: Message edited by: Yuri Sforza ]
[ December 11, 2003: Message edited by: Yuri Sforza ]
20 years ago
JSP
I have found that flushing just response is not enough,
but it works OK when using combination:

Another thing I have found out by hard experience
is that if you currently have less than 256 bytes
in the buffer it will not be flushed. So I wander:
does spec say anything about such behaviour
(implementation-dependent or like?) or is it a bug?
I am using Websphere 5 server which comes with WSAD.
--
Y. Sforza
20 years ago
JSP

Can a private method of a superclass
be declared within a subclass?


The answer given is YES and explanation says
that "Private methods cannot be overriden,
but they can be re-declared/redefined in the
subclass..."
OK, but the question was about declare,
not about re-declare. For me they are
different terms. I think that method (whether
private or not) may be declared only once
(in the class in question or somewhere higher
in the inheritance hierarchy). When talking
about subclass, what you can do (or try to do)
is re-declaring, overriding, "declaring method
with the same signature as in superclass", ...
but you cannot say that you are "declaring method
of a superclass".
Am I missing something? Comments anybody?

--
Y. Sforza
20 years ago
As tehir FAQ (http://www-1.ibm.com/certify/process/faq_gen.shtml) says, there is no such list:

...
Q. Is there a Web site where my "personal" information can be viewed?
A. A candidate's certification and demographic data is confidential. There is no "public" site for such a listing ...


AFAIK there is no "private" kind of such site.
This is very strange as there seems to be no way to prove that you really have passed the exam.
Especially now, when the certificate is sent as PDF file to be printed yourself. So it is not too hard to falsify these papers, and on the other hand there is no proof for your certificate. I find this very frustrating, it means that IBM certification's worth is almost zero.