Re: Math captcha with Wicket?

2010-05-06 Thread nino martinez wael
http://java.sun.com/docs/books/tutorial/2d/overview/rendering.html

:)

2010/5/4 Thomas Götz t...@richmountain.de:
 Thanks for your input, Igor! Looks nice, but I'd also like to have that as a
 rendered image, rather than plain text (security risk?).

   -Tom

 Igor Vaynberg wrote:

 off the top of my head

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Math captcha with Wicket?

2010-05-06 Thread Thomas Götz

nino martinez wael schrieb:

http://java.sun.com/docs/books/tutorial/2d/overview/rendering.html


Well, tanks ;-)
I was hoping to find some ready-to-be-used library/components that 
already does that ...


   -Tom

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Math captcha with Wicket?

2010-05-06 Thread Josh Glassman
Take a look at

http://wicket.apache.org/docs/1.4/org/apache/wicket/extensions/markup/html/captcha/CaptchaImageResource.html

You might need to override some of it, or make your own customized version
to get the text and look you want.  Looks like a good starting point at
least.

On Thu, May 6, 2010 at 10:08 AM, Thomas Götz t...@richmountain.de wrote:

 nino martinez wael schrieb:

  http://java.sun.com/docs/books/tutorial/2d/overview/rendering.html


 Well, tanks ;-)
 I was hoping to find some ready-to-be-used library/components that already
 does that ...

   -Tom


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Math captcha with Wicket?

2010-05-06 Thread Thomas Götz

Thanks for the pointer!

   -Tom


Josh Glassman schrieb:

Take a look at

http://wicket.apache.org/docs/1.4/org/apache/wicket/extensions/markup/html/captcha/CaptchaImageResource.html

You might need to override some of it, or make your own customized version
to get the text and look you want.  Looks like a good starting point at
least.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Math captcha with Wicket?

2010-05-06 Thread nino martinez wael
I know it was a dry spirited answer.. But have a look at jcaptcha or
simplecaptcha.. Both are built around servlets as far as I can see,
but they might offer a question / image engine also (so you can use it
directly with wicket)..

regards Nino

2010/5/6 Thomas Götz t...@richmountain.de:
 nino martinez wael schrieb:

 http://java.sun.com/docs/books/tutorial/2d/overview/rendering.html

 Well, tanks ;-)
 I was hoping to find some ready-to-be-used library/components that already
 does that ...

   -Tom

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Math captcha with Wicket?

2010-05-04 Thread Thomas Götz
Thanks for your input, Igor! Looks nice, but I'd also like to have that 
as a rendered image, rather than plain text (security risk?).


   -Tom

Igor Vaynberg wrote:

off the top of my head


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Math captcha with Wicket?

2010-05-03 Thread Thomas Götz
Did anyone ever integrate some kind of math capture with Wicket (please 
solve the following simple equation ...)? How would I do this, someone 
got a code pointer for me?


   -Tom


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Math captcha with Wicket?

2010-05-03 Thread Igor Vaynberg
off the top of my head

class question { int lhs, int rhs, boolean plus;
void randomize() { lhs=math.random()*10, rhs=math.random()*10;
plus=math.random()0.5;}
string tostring() { return +lhs+ +((plus)?+:-)+ +rhs; }
boolean check(int answer) { if (plus) return answer==lhs+rhs else
return answer==lhs-rhs; }


class answerfield extends textfieldinteger {
  private final imodelquestion question;
  public answerfield(string id, imodelquestion question) {
 super(id, new modelinteger());
 this.question=question;
 add(new ivalidatorinteger {
  public void validate(validatableinteger validatable) {
if (!question.check(validatable.getvalue()) {
  validatable.error(new validationerror(are you
smarter then a first grader?));
   });
   }

   protected void ondetach() { question.detach(); super.ondetach(); }
}

class mathcaptchapanel extends panel {
  private final question question=new question();

  public mathcaptchapanel(string id) {
 add(new label(question, new propertymodel(this, question));
 add(new answerfield(answer, new propertymodel(this, question));
   }

   protected void onbeforerender() { question.randomize();
super.onbeforerender(); }
}

-igor




On Mon, May 3, 2010 at 1:13 PM, Thomas Götz t...@richmountain.de wrote:
 Did anyone ever integrate some kind of math capture with Wicket (please
 solve the following simple equation ...)? How would I do this, someone got
 a code pointer for me?

   -Tom


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org