Wednesday, December 25, 2013

jQuery : clear file input field

Use this to reset the form fields:

$('#form_id').each(function(){
    this.reset();
});

Reference:
http://stackoverflow.com/questions/7769489/clear-file-input-field-using-jquery

Friday, December 13, 2013

.Net: WCF Download file

There is the link of a nice to tutorial to download file from WCF service using stream:

http://www.dotnetcurry.com/showarticle.aspx?ID=723

Wednesday, December 11, 2013

Java: intersect two arrays


int a[] = {3, 10, 4, 2, 8};
int[] b = {10, 4, 12, 3, 23, 1, 8};
List<Integer> aList =  Arrays.asList(a);
List<Integer> bList =  Arrays.asList(b);
aList.retainsAll(bList);
System.out.println(" a intersection b "+aList);

Reference:
http://stackoverflow.com/questions/12919231/finding-the-intersection-of-two-arrays

Jquery: get element by name attribute

Monday, December 9, 2013

Jquery: async form submit plugin

Here is a nice and simple jquery plugin to work with async from submits:

http://malsup.com/jquery/form/