Search Results

Search found 28 results on 2 pages for 'bozho'.

Page 2/2 | < Previous Page | 1 2 

  • How is the result of openssl_sign() encoded?

    - by Bozho
    The docs about openssl_sign() say that the signature is returned in the passed string argument. My question is - how is it encoded? Base64, Hex-string, anything else? I don't have php installed and I have to use this PHP code I was given simply in order to verify whether my Java implementation is correct, so don't ask me "have you tried it" ;)

    Read the article

  • How to work with varargs and reflection

    - by PeterMmm
    Simple question, how make this code working ? public class T { public static void main(String[] args) throws Exception { new T().m(); } public // as mentioned by Bozho void foo(String... s) { System.err.println(s[0]); } void m() throws Exception { String[] a = new String[]{"hello", "kitty"}; System.err.println(a.getClass()); Method m = getClass().getMethod("foo", a.getClass()); m.invoke(this, (Object[]) a); } } Output: class [Ljava.lang.String; Exception in thread "main" java.lang.IllegalArgumentException: wrong number of arguments at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597)

    Read the article

  • Refactor a link and an image

    - by Mihail Stoynov
    I have to write an link with an image inside. Instead of explaining, here's the code I have now: <c:if test="${userSession.loggedUser eq null and company.image != null}"> <a onclick="${rich:component('loginPanel')}.show()"> <img src="/download.do?hash=#{company.image.hash}" /> </a> </c:if> <c:if test="${userSession.loggedUser eq null and company.image == null}"> <a onclick="${rich:component('loginPanel')}.show()"> <img src="${request.contextPath}/img/icons/logo_default.jpg" /> </a> </c:if> <c:if test="${userSession.loggedUser ne null and company.image != null}"> <a href="company.xhtml?${company.name}"> <img src="/download.do?hash=#{company.image.hash}" /> </a> </c:if> <c:if test="#{userSession.loggedUser ne null and company.image == null}"> <a href="company.xhtml?${company.name}"> <img src="${request.contextPath}/img/icons/logo_default.jpg" /> </a> </c:if> This code looks awful - there are two exact links with two exact images but combined in all possible combinations. Is there a better way? Is there a way to avoid c:if - it created tables? Update: Bozho proposes: You can replace <c:if and <a with <h:outputLink rendered="#{..}". Apart from that I don't see any other optimization. But it doesn't work. This does not render correctly: <a href=> <h:outputLink rendered="#{..} <h:outputLink rendered="#{..} </a> (the image is outside the anchor) This does render fine: <h:outputLink value=> <h:outputLink rendered="#{..} <h:outputLink rendered="#{..} </a> , but it always adds href and in two of the cases I don't want href when rendered.

    Read the article

< Previous Page | 1 2