Java Annotations provide Java developers full potential of doing things in more easy and nice way. I will not go explaining Java annotations pros, cons, and the definitions; you can find out here http://java.sun.com/docs/books/tutorial/java/javaOO/annotations.html
instead I will add some piece which I hardly found: how can I write my own Annotation class and make use of [...]
Archive for the ‘code snippet’ Category
Java Annotations, First Step
Posted in 1, Java, code snippet, howto, tagged annotations, Java, tutorial on May 20, 2009 | Leave a Comment »
open-flash-chart, IE and SSL
Posted in Open Source, code snippet, howto, troubleshooting, tagged https, ie, open flash chart, response headers, ssl on January 15, 2009 | 1 Comment »
solving open flash chart 1.x issue on IE behind HTTPS
JQuery and SELECT tag howto
Posted in Markup Languages, code snippet, javascript, tagged howto, html, javascript, jquery, select on January 7, 2009 | Leave a Comment »
following is a JavaScript code snippet using Powerful JQuery library for dealing with select HTML tag (which is – by the way – pain to deal with core javascript language).
the html code
…..
<select id=”my-ml-list” name=”my-ml-list”>
<option value=”java”>XML</option>
<option value=”java”>HTML</option>
<option value=”java”>XHTML</option>
<option value=”java”>HAML</option>
<option value=”java”>YAML</option>
<option value=”java”>YASL</option>
</select>
…..
what can jquery do for you with this list, some is follow:
iterate on all elements
<script language=”javascript”>
$(“my-ml-list [...]
Phone Regexp
Posted in Ruby and Ruby On Rails, code snippet, tagged number, phone, regexp, ruby on April 22, 2008 | Leave a Comment »
I was working with struts validators and need to test a phone number to be digits and starts with a leading 00, I wanna share it here
^00+\d{9,17}$
below is a ruby code snippet:
phone_no=”009621111111″
if phone_no =~ /^00+\d{0,9}$/
puts “match”
else
puts “No match”
end
a quick explain is
^ start from the beginning of the string
+\d{9,17} should include digits with at [...]