Wednesday 28 March 2012

Comparing files of two folders in UNIX

Normally you can't find how many files are different in two folders.It is possible only less amount of  files inside of two folders.If number of file increase means we can't compare whether present in both folders.For that we use below the command .It shows how many files are present in folder1 not in folder2 same as vice-versa


 diff  -r  pathOfFolder1   pathOfFolder2

Example :
folder1 constains t1,t2 and
folder2 contains t1,t4  means that output will like this

Only in pathOfFolder1 : t2
Only in pathOfFolder2 : t4

Monday 26 March 2012

callback function use in Ext.data.Store


        In ExtJs some application displaying value only at combobox sometime.Because of it take long time fetch label for that value from store .For that we can use setTimeout  function to solve this issue.But it is not proper way to solve this issue.Because time delay  differs based on different browser and browser version.
        Instand of setTimeout function we use "callback" function in "store.load" .This quickly fetch label for that value and displaying label value.

EXAMPLE:
         var testStore = new Ext.data.Store({
                 autoLoad: true,
                proxy: new Ext.data.HttpProxy({
                url: 'applicationURL'}),
                reader: new Ext.data.JsonReader({ root: 'rootElementOfJson'}, [{ name: 'value' }, { name: 'label'}])
     });

testStore.load({
callback: function(rec, options, success) {
Ext.getCmp('comboFieldId').setValue(document.getElementById('fileldId').value);
}

callback function is applicable for only proxy method of store loading