lately I was working with open flash chart (OFC 1.x) to add some sexy statistics showings. it’s really cool tool and easy to work with.

the charts was set right in, and everything is good, when moved to HTTPS domain it crashed on IE (6 and 7).

after a few minutes googling I found the solution that you need to add two response headers for IE to show the chart.

in JSP

response.addHeader(“Cache-Control”,”cache, must-revalidate”);

here is the forum I benefit from: http://forums.codecharge.com/posts.php?post_id=97771



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>



what can jquery do for you with this list, some is follow:

iterate on all elements

<script language=”javascript”>

$(“my-ml-list option”).each (

function () {

// this object is the current option HTML object.

alert(“current option value is: ” + this.value); // show message of it’s value.




Software doesn’t just appear on the shelves by magic. That program shrink-wrapped inside the box along with the indecipherable manual and 12-paragraph disclaimer notice actually came to you by way of an elaborate path, through the most rigid quality control on the planet (well, not exactly). Here you can see the cycle:

  1. Programmer produces code he believes is bug-free.
  2. Product is tested. 20 bugs are found.
  3. Programmer fixes 10 of the bugs and explains to the testing department that the other 10 aren’t really bugs.
  4. Testing department finds that five of the fixes didn’t work and discovers 15 new bugs.
  5. See 3.
  6. See 4.
  7. See 5.
  8. See 6.
  9. See 7.
  10. See 8.
  11. Due to marketing pressure and an extremely premature product announcement based on an overly optimistic programming schedule, the product is released.
  12. Users find 137 new bugs.
  13. Original programmer, having cashed his royalty check, is nowhere to be found.
  14. Newly-assembled programming team fixes almost all of the 137 bugs, but introduce 456 new ones.
  15. Original programmer sends underpaid testing department a postcard from Fiji. Entire testing department quits.
  16. Company is bought in a hostile takeover by competitor using profits from their latest release, which had 783 bugs.
  17. New CEO is brought in by board of directors. He hires programmer to redo program from scratch.
  18. Programmer produces code he believes is bug-free.

That is why software projects fail (or don’t get to their target)

See Also:

Phone Regexp

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


below is a ruby code snippet:


if phone_no =~ /^00+\d{0,9}$/

puts “match”


puts “No match”


a quick explain is

^ start from the beginning of the string

+\d{9,17} should include digits with at least 9 digits and at most 17 digits (excluded the leading 00)

$ indicates the end of the string

well, that was not much, but I wish it save someone’s 10 minutes!


Note: I don’t use either Apple nor Microsoft Products – I use my lovely Linux!

IPhone is just a great piece, but I came across this movie that shows how Microsoft would redesign (or marketing) IPhone – well, IPhone should have such way of marketing ­čÖé

by the principal of knowledge sharing, I wish this would save someone’s time.

I installed ubuntu and tried installing some packages, then I got: please insert cdrom …. bla bla. while I want apt to look on the remote servers!

well, to solve the problem: go to /etc/apt/sources.list and comment the line talking about cdrom.

That is it!

Reading .. Grails

Grails is an open source MVC and full-stack framework, and uses Groovy for views – you have Rails capabilities with Java’s Taste and Capabilities.

super-productivity┬á – what a framework!

I am now reading Getting Started with Grails, and will be writing some useful, real-world tutorials soon.