Search Results

Search found 2 results on 1 pages for 'e shindler'.

Page 1/1 | 1 

  • Storm Trident 'average aggregator

    - by E Shindler
    I am a newbie to Trident and I'm looking to create an 'Average' aggregator similar to 'Sum(), but for 'Average'.The following does not work: public class Average implements CombinerAggregator<Long>.......{ public Long init(TridentTuple tuple) { (Long)tuple.getValue(0); } public Long Combine(long val1,long val2){ return val1+val2/2; } public Long zero(){ return 0L; } } It may not be exactly syntactically correct, but that's the idea. Please help if you can. Given 2 tuples with values [2,4,1] and [2,2,5] and fields 'a','b' and 'c' and doing an average on field 'b' should return '3'. I'm not entirely sure how init() and zero() work. Thank you so much for your help in advance. Eli

    Read the article

  • dynamically changing setRequired to false

    - by E Shindler
    Hi, I'm new to wicket, can someone please tell me how to dynamically setRequired to false. Here is my code: AjaxButton cancel=new AjaxButton("cancel"){ public void onSubmit(AjaxRequestTarget target, Form form){ passwrd.setRequired(false); nameField.setRequired(false); usernameField.setRequired(false); LecturerPage lecturer=new LecturerPage(); setResponsePage(lecturer); } }; addstud.add(cancel); Tomcat is telling me that my feedback panel is being left unrendered(my ok button makes use of a feedback panel). Thank you!

    Read the article

1