Feeds:
Posts
Comments

Archive for the ‘code snippet’ Category

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 [...]

Read Full Post »

solving open flash chart 1.x issue on IE behind HTTPS

Read Full Post »

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 [...]

Read Full Post »

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 [...]

Read Full Post »