Thursday, 11 October 2012

IPC without refreshing the page

Portlet A
---------

function triggerEvent(urlRender,  redirectURL){
   Liferay.fire(

      'RefreshEvent', {
         urlRender: urlRender,
         redirectURL: redirectURL
   }
}


Portlet B
---------

<div id="javascriptDiv">

<script type="text/javascript">

    Liferay.on('RefreshEvent',function(event) {
   
        var urlRender = event.urlRender;
         var redirectURL = event.redirectURL;

        var urlPost = window.location.href.substring(0, window.location.href.lastIndexOf('?'));
   
        if(urlPost == ""){
            urlPost += window.location.href;
        }
        urlPost += urlRender;
        urlPost += redirectURL;

        ajaxCall(urlPost);
    });
   
    function ajaxCall(urlPost){
        AUI().use('aui-overlay-mask', function(A) {
      
            var overlayMask = new A.OverlayMask().render();
            overlayMask.set('target', document);

            var message = A.Node.create('<h3 class="message">Loading...</h3>')
            var showMessage = function() {
                message.appendTo(document.body);
            };
            jQuery.ajax(
                    {
                         url:urlPost,
                         beforeSend: function() {
                             overlayMask.show();
                             showMessage();
                         },
                        cache: false,
                         success:function(result){
                             jQuery("#ajaxloading").html("");
                             jQuery("#ajaxAssetPublisher").html(result);
                             overlayMask.hide();
                             message.remove();
                           }
                     }
             );
            jQuery("#defaultAssetPublisher").hide();
            jQuery("#javascriptDiv").empty();
        });
    }
</script>
</div>

<div id="ajaxAssetPublisher"></div>
<div id="defaultAssetPublisher" >
//Here is the some code before interaction
</div>

Saturday, 6 October 2012

ClamAv Antivirus Setup



Windows:-

1. Download the appropriate installer package.-- ClamAV/tBB [http://hideout.ath.cx/clamav] Installation and update --

2. Install ClamAV to c:\clamav. The installer can create the clamd and
freshclam services which is the recommended way of running them.

Note: If you don't install ClamAV to c:\clamav you *have* to edit the
clamd.conf and freshclam.conf configuration files before starting the
ClamAV services and change the paths accordingly!

3. Open a CMD window in the ClamAV folder.

4. Run freshclam.exe once to download the signature databases.

5. If you want to use the clamd and freshclam services, enter 'net start clamd'
and 'net start freshclam' at the CMD prompt to start them. If you don't want to
use the service mode you can use the supplied chp.exe to start clamd/freshclam
in the background (without a open CMD window).

6. You're done. If you don't use the freshclam service remember to call
freshclam.exe regularly (e.g. once per hour) by the scheduler.


References:

1. Download URL




Linux:-






Useful Commands:

tasklist /svc – To See the service(windows)

To know UNIX flabour:-
uname -a
cat /etc/issue

Check port number:-
netstat -ntpul|grep clam

service clamd status – Check service status

/root/clamav-0.97/etc : contains configuration files

export CLASSPATH=$CLASSPATH:/root/ClamAvTesting/clamavj-0.1.jar:.

Virus file for testing:
--------------------------

$CeliacmaTrESTuScikgsn$FREE-TEST-SIGNATURE$EEEEE$

Save above content in a text file and scan the file.

Smaple java Code :

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.UnknownHostException;

import com.philvarner.*;
import com.philvarner.clamavj.ClamScan;
import com.philvarner.clamavj.ScanResult;

public class MainTest {

/**
* @param args
* @throws UnknownHostException
* @throws FileNotFoundException
*/
public static void main(String[] args) throws UnknownHostException, FileNotFoundException {
// TODO Auto-generated method stub
String host = "192.168.105.113";
int port = 3310;
int timeout = 60;
InetAddress address=InetAddress.getLocalHost();
ClamScan clamScan = new ClamScan(host,port,timeout);
InputStream io = new FileInputStream("C:\\Documents and Settings\\Tapas.Patra\\Desktop\\Clam.txt");
ScanResult sr = clamScan.scan(io);
System.out.println("Status : "+clamScan.ping());
System.out.println(sr.getStatus()+"=========="+sr.getSignature());
}
}

Alloy UI demo portlet

<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>

<portlet:resourceURL id="getJson" var="resouceURL"></portlet:resourceURL>
<portlet:defineObjects />

<style type="text/css">
.red {
    background: red;
}
.black {
    background: black;
}
.white {
    background: white;
}
.toolTip {
     background: white;
     border-radius : 0;
     border: 4px solid blue;
}
</style>

<h1>This is the AUI Demo portlet.</h1>
<!-- Example 1 -->
<h4>Color Test Example</h4>
<ul id="colorList">
 <li>red</li>
 <li>black</li>
 <li>blue</li>
 <li>green</li>
 <li>white</li>
</ul>
<br/>
<aui:button cssClass="colorBtn" value="colorTest"></aui:button>
<br/>
<aui:button cssClass="applyColorBtn" value="applyColor"></aui:button>
<aui:button cssClass="unApplyColorBtn" value="unApplyColor"></aui:button>
<br/>
<br/>
<aui:button cssClass="ajaxCall" value="Ajax Call"></aui:button>
<div id="ajaxResponse">Waiting for ajax response</div>
<br/>
<br/>
<aui:button cssClass="auiDialog" value="Open Dialog"></aui:button>
<br/>
<br/>
<div id="check" style="width: 200px" align="left">Tooltip on mouse hover</div>
<br/>
<br/>
<h4>Start typing the name of a state (such as Alaska, California, or Maine)</h4>
<div id="myAutoComplete"></div>
<br/>
<h4>Alloy - Editable Demo</h4>
<div id="editor1">Edit Me</div>
<br/>
<div id="editor2">
Edit Me Heloo world Edit Me Heloo worldEdit 
Edit Me Heloo worldEdit Me Heloo worldEdit
Edit Me Heloo worldEdit Me Heloo worldEdit
</div>
<br/>
<h4>Alloy - Toolbar demo</h4>
<div id="demo1"></div>
<br/>
<h4>Alloy - Panel demo</h4>
<div id="myId"></div>
<br/>
<h4>Alloy - Sort demo</h4>
<ul class="vertical" id="vertical">
   <li>List Item 1</li>
   <li>List Item 2</li>
   <li>List Item 3</li>
   <li>List Item 4</li>
   <li>List Item 5</li>
   <li>List Item 6</li>
</ul>
<br/>
<h4>Alloy - Calender demo</h4>
<input type="text" name="input1" size="55" value="" id="input1" />
<br/>
<h1>Alloy - AUI tag demo w.r.t Liferay</h1>
<aui:form>
 <!-- AUI Layout -->
 <h4>AUI tag layout</h4>
 <aui:layout>
 <aui:column columnWidth="25" first="true">
 Heloo
 </aui:column>
 <aui:column columnWidth="75" last="true">
 World
 </aui:column>
 </aui:layout>
 <br/>
 <h4>AUI tag panel</h4>
 <aui:panel collapsible="true" label="Personal Information" >
  Helloooooo
 </aui:panel>
 <br/>
 <h4>AUI tag button</h4>
 <aui:button value="Click me"></aui:button>
 <br/>
 <h4>AUI tag button-row</h4>
 <aui:button-row>
  <aui:button name="saveButton" type="submit" value="save" />
  <aui:button name="cancelButton" type="button" value="cancel" />
 </aui:button-row>
 <br/>
 <h4>AUI tag input</h4>
 <aui:input name="firstName" lebel="FirstName" type="text"></aui:input>
</aui:form>
<aui:script >

AUI().ready("node", "aui-dialog", "aui-tooltip", function(A){
 
 /******************** Example1*****************************/
 
 A.one('.colorBtn').on("click", function(){
  
  //This line get "colorList" object
  var colorList = A.one("#colorList");
  //This will get li elements list inside "colorList" ul
  var colors = colorList.all("li");
  //Following code returns list of all li elemetns on page
  var totalLiTags = A.all("li");
  alert("No of colors in list are "+colors.size() + "\n" +
  "Total li elements of page are "+totalLiTags.size());
 });
 
 
 /******************* Example2*******************************/
 A.one('.applyColorBtn').on("click", function(){
  A.all("#colorList li").each(function(currentNode,index,nodeList){
   if(currentNode.text() == "red"){
    currentNode.addClass("red");
   }else if(currentNode.text() == "black"){
    currentNode.addClass("black");
   }else if(currentNode.text() == "white"){
    currentNode.addClass("white");
   }
  });
 });
 A.one('.unApplyColorBtn').on("click", function(){
  A.all("#colorList li").each(function(currentNode,index,nodeList){
   if(currentNode.text() == "red"){
    currentNode.removeClass("red");
   }else if(currentNode.text() == "black"){
    currentNode.removeClass("black");
   }else if(currentNode.text() == "white"){
    currentNode.removeClass("white");
   }
  });
 });
 
 A.one('.ajaxCall').on('click', function() {
  A.io.request('${resouceURL}', {
    dataType: 'json',
    on: {
     success: function() {
       //alert(this.get('responseData')); //alerts 2
       var dataRes = this.get('responseData');
       //alert("Response"+dataRes.length)
        var rowData = ""
      for(var index = 0; index < dataRes.length; index++){
       rowData = rowData+dataRes[index].Content+" "+dataRes[index].content_button+"<br/>";
     }
     A.one('#ajaxResponse').html(rowData);
     }
    }
  });
 });
    
 A.one('.auiDialog').on('click', function() {
   var instance = new A.Dialog({
   bodyContent: 'This is helooworld Dialog body',
   centered: true,
   constrain2view: true,
   destroyOnClose: true,
   draggable: true,
   height: 150,
   resizable: false,
   stack: true,
   title: 'Dialog title',
   width: 500,
   close:true,
   modal:true,
   buttons : [
      {
       text: 'Submit',
       handler: function() {
        this.set('bodyContent', 'Processing tour data');
        //ajaxCall();
       }
      }]
   }).render();
  });
  
  
  new A.Tooltip({
    trigger: '#check',
    align: { points: [ 'tl', 'tr' ] }, //lc, rc
    showArrow: false,
    bodyContent: 'This is my tooltip.Enjoy the toolTip',
    cssClass : 'toolTip'
   })
   .render();
});


AUI().use('aui-autocomplete', 'aui-editable', 'aui-toolbar', 'aui-panel', 'aui-sortable','aui-calendar-base', function(A) {
 /******************** Example3*********************************/
 var states = [ 
          ['AL', 'Alabama', 'The Heart of Dixie'],
          ['AK', 'Alaska', 'The Land of the Midnight Sun'],
          ['AZ', 'Arizona', 'The Grand Canyon State'],
          ['AR', 'Arkansas', 'The Natural State'],
          ['CA', 'California', 'The Golden State'],
          ['CO', 'Colorado', 'The Mountain State'],
          ['CT', 'Connecticut', 'The Constitution State'],
          ['DE', 'Delaware', 'The First State'],
          ['DC', 'District of Columbia', "The Nation's Capital"],
          ['FL', 'Florida', 'The Sunshine State'],
          ['GA', 'Georgia', 'The Peach State'],
          ['HI', 'Hawaii', 'The Aloha State'],
          ['ID', 'Idaho', 'Famous Potatoes'],
          ['IL', 'Illinois', 'The Prairie State'],
          ['IN', 'Indiana', 'The Hospitality State'],
          ['IA', 'Iowa', 'The Corn State'],
          ['KS', 'Kansas', 'The Sunflower State'],
    ['KY', 'Kentucky', 'The Bluegrass State'],
          ['LA', 'Louisiana', 'The Bayou State'],
          ['ME', 'Maine', 'The Pine Tree State'],
          ['MD', 'Maryland', 'Chesapeake State'],
          ['MA', 'Massachusetts', 'The Spirit of America'],
          ['MI', 'Michigan', 'Great Lakes State'],
          ['MN', 'Minnesota', 'North Star State'],
          ['MS', 'Mississippi', 'Magnolia State'],
          ['MO', 'Missouri', 'Show Me State'],
          ['MT', 'Montana', 'Big Sky Country'],
          ['NE', 'Nebraska', 'Beef State'],
          ['NV', 'Nevada', 'Silver State'],
          ['NH', 'New Hampshire', 'Granite State'],
          ['NJ', 'New Jersey', 'Garden State'],
          ['NM', 'New Mexico', 'Land of Enchantment'],
          ['NY', 'New York', 'Empire State'],
          ['NC', 'North Carolina', 'First in Freedom'],
          ['ND', 'North Dakota', 'Peace Garden State'],
          ['OH', 'Ohio', 'The Heart of it All'],
          ['OK', 'Oklahoma', 'Oklahoma is OK'],
          ['OR', 'Oregon', 'Pacific Wonderland'],
          ['PA', 'Pennsylvania', 'Keystone State'],
          ['RI', 'Rhode Island', 'Ocean State'],
          ['SC', 'South Carolina', 'Nothing Could be Finer'],
          ['SD', 'South Dakota', 'Great Faces, Great Places'],
          ['TN', 'Tennessee', 'Volunteer State'],
          ['TX', 'Texas', 'Lone Star State'],
          ['UT', 'Utah', 'Salt Lake State'],
          ['VT', 'Vermont', 'Green Mountain State'],
          ['VA', 'Virginia', 'Mother of States'],
          ['WA', 'Washington', 'Green Tree State'],
          ['WV', 'West Virginia', 'Mountain State'],
          ['WI', 'Wisconsin', "America's Dairyland"],
          ['WY', 'Wyoming', 'Like No Place on Earth']
      ];
 
  window.AC = new A.AutoComplete(
   {
    dataSource: states,
    schema: {
     resultFields: ['key', 'name', 'description']
    },
    matchKey: 'name',
    delimChar: ',',
    typeAhead: true,
    contentBox: '#myAutoComplete'
   }
  );
 
  AC.render();
  
  /**************************** Example4***********************************/
  (new A.Editable(
   {
    node: '#editor1'
   }
  ));
  (new A.Editable({
  node: '#editor2',
  inputType: 'textarea'
  })); 
  
  /**************************** Example5***********************************/
  new A.Toolbar({
   activeState: true, children: [ {label: 'Add', icon: 'plus'}, {label: 'Remove', icon: 'minus'}, {label: 'Config', icon: 'gear'} ]
  }).render('#demo1');
  
  /**************************** Example6***********************************/
  new A.Panel({
   headerContent: 'Panel Container',
   collapsible: true,
   boundingBox: '#myId',
   bodyContent: "Heloo World" 
  }).render();
  
  /**************************** Example7***********************************/
  new A.Sortable(
   {
    nodes: '#vertical li',
    constrain: {
     stickY: true
    }
   }
  );
  
  /**************************** Example8***********************************/
  new A.Calendar({
  trigger: '#input1',
  dates: ['09/14/2009', '09/15/2009','09/16/2009'],
  //dateFormat: '%d/%m/%y %A',
  dateFormat: '%d/%m/%y',
  setValue: true,
  selectMultipleDates: false
  }).render();
});
</aui:script>

How to Embed a portlet inside dialog iframe in Velocity Template

<script type="text/javascript">

AUI().ready('aui-dialog','aui-dialog-iframe','liferay-portlet-url', function(A) {
    A.one('#wikiButton').on('click', function() {
        var url = Liferay.PortletURL.createRenderURL();
        url.setPortletId("2_WAR_knowledgebaseportlet");
        url.setWindowState('pop_up');
        window.myDialog = new A.Dialog(
            {
                title: 'KnowledgeBase Articles',
                width: 800,
                xy: [280, 80],
                modal:true,
            }
        ).plug(
            A.Plugin.DialogIframe,
            {
                uri: url.toString(),
                iframeCssClass: 'dialog-iframe'
            }
        ).render();
    });
});

</script>
<div class="wikiBtn">
    <input id="wikiButton" type="Button" value="View Wikis" />
</div>

NOTE: Below changes required.
1. In portal-ext.properties we need to add the portlet in whitelist
portlet.add.default.resource.check.whitelist=3,56_INSTANCE_0000,58,82,86,87,103,113,145,164,166,170,177,2_WAR_knowledgebaseportlet
2.In liferay-portlet.xml we need to add <add-default-resource>true</add-default-resource> if this is not available.

jQuery Vs AUI(Alloy UI)

Getting Started

jQuery AUI Notes
$.change.bar()
AUI().use('node', 'module2', 'module3', function (A) {
  A.change.bar()
});
The jQuery and $ objects are globals and the jQuery library itself is statically loaded, so they are available immediately.
AUI is sandboxed and by default dynamically loaded. The A object is local to the function you pass as the last argument to AUI().use(). Usually you will put all code that uses AUI inside one of these functions. This function executes after all the referenced modules are loaded and accounted for.
The return value of AUI().use() is also a A object, which you can assign to a global variable [e.g. var A = AUI().use(…);] and debug with it in a JavaScript console.

Common Idioms

jQuery AUI Notes
$('div.change:first')
A.one('div.change')
jQuery and AUI use similar selector syntax, but jQuery has added extensions, mainly convenience pseudo-classes, to the Sizzle CSS3-compliant selector engine. AUI comes with three different selector engines; see the section on Selectors.
var change = $('div.change:first');
change.some_method();
var change = A.one('div.change');

if (change) {
  change.some_method();
}
Return the first element which matches the selector. :first is a jQuery extension.
If no elements match, A.one() returns null and you should check for it. jQuery selector methods always return a list object with 0 or more elements.
$('div.change')
A.all('div.change')
Select all div elements with a class of change.
var change = $('div.change');

if (change.length) {
  // do something
}
var change = A.all('div.change');

if (change.size()) {
  // do something
}
If no elements match the selector, A.all() returns an empty NodeList object. jQuery will return an empty list [] that is loaded with special jQ methods. Both are truthy even if they contain no elements, so use NodeList.size() and [].length to check for emptiness.
.find('p.change:first')
.find('p.change')
.one('p.change')
.all('p.change')
Finds P elements with class change that are children of the given node.
$('<div/>')
A.Node.create('<div/>')
Create a new DOM element. Does not add it to the document tree.
.html('change')
.text('change')
.val('change')
.html('change')
.set('text', 'change')
.set('value', 'change')
.set() is a generic method in AUI for modifying element object properties. Use .setAttribute() to modify element attributes..html(html) is a convenience wrapper around .set('innerHTML', html)
.html()
.text()
.val()
.getHTML()
.get('text')
.get('value')
jQuery tends to overload getters and setters in the same method.
.attr('change')
.attr('change', 'bar')
.getAttribute('change')
.setAttribute('change', 'bar')
Generic HTML attribute getters and setters.
$.trim(' change ')
A.Lang.trim(' change ')
Strips leading and trailing whitespace.
.click(fn)
.focus(fn)
.blur(fn)
.mouseout(fn)
.mouseover(fn)

// jQuery   and later allows you to
// register events when creating the element
$('<p/>',{
  text      :'change',
  className : 'bar',
  click     : fn,
  focus     : fn,
  blur      : fn
})
.on('click', fn)
.on('focus', fn)
.on('blur', fn)
.on('mouseout', fn)
.on('mouseover', fn)

// Alternatively, AUI allows you to attach multiple
// subscribers with a single call.
.on({
  click    : fn,
  focus    : fn,
  blur     : fn,
  mouseout : fn,
  mouseover: fn
})

// Or attach a single subscriber to multiple events.
.on(['click', 'focus', 'blur', 'mouseout', 'mouseover'], fn)
.on() is not chainable by default, but multiple subscribers can be attached in one call using the syntax shown here.
$('#change').trigger('click')
A.one('#change').simulate('click')
Simulates a click event. In AUI, you'll need the node-event-simulate module.
parent.append('<div/>')
parent.append('<div/>')
Creates a new div element and makes it a child of parent.
child.appendTo(parent)
child.appendTo(parent)
Appends child to parent, and returns child.
.appendTo() was added to AUI in 3.3.0.

parent = $('<div/>');
$('<p>change<p>')
  .click(fn)
  .appendTo(parent);
parent = A.Node.create('<div/>');
A.Node.create('<p>change</p>')
  .appendTo(parent)
  .on('click', fn);
Creates a new div element, then appends a p element with a click event subscription. Note that AUI's on() method is not chainable, so it returns an event handle, not the p node.
// Removes #change from its parent and
// detaches events and jQuery data.
$('#change').remove()

// Removes #change from #container.
$('#container').remove('#change')
// Removes #change from its parent, but doesn't
// detach events or AUI plugins.
A.one('#change').remove()

// Removes #change and detaches events and plugins.
A.one('#change').remove(true)

// Removes #change from #container.
A.one('#container').removeChild(A.one('#change'))
jQuery's .remove() purges events and jQuery data from the removed node. For the equivalent behavior in AUI, use .remove(true).
.empty()
.empty(true)
jQuery's .empty() also deregisters any events associated with the elements being destroyed. Passing true to .empty() enables the same behavior in AUI.

.empty() was added to AUI in 3.3.0.


.siblings()
.siblings(selector)
.siblings()
.siblings(selector)
.siblings(function)
In addition to an optional selector string, AUI also supports passing a function to filter the returned siblings.
.next()
.next(selector)
.next()
.next(selector)
.next(fn)
Same considerations as .siblings().
.prev()
.prev(selector)
.previous()
.previous(selector)
.previous(fn)
Same considerations as .siblings().
.parent()
.get('parentNode')
Returns the parent node of the given node.
.children()
.get('children')
Returns all the element children of the given node.
.closest(selector)
.ancestor(selector)
.ancestor(fn)
Returns the first ancestor that matches the given selector. In addition, AUI supports using a function instead of a selector to find an ancestor.
$.contains(node, descendant)
.contains(descendant)
Check to see if a node contains a certain descendant.
.show()
.hide()
.show()
.hide()
Make DOM nodes appear/disappear
.fadeIn()
.fadeOut()
.show(true)
.hide(true)
In AUI, .show() and .hide() can be customized to use transitions supported by the transition module. These methods were added to AUI in 3.3.0.
$.parseJSON( '{"name":"Douglas"}' )
A.JSON.parse( '{"name":"Douglas"}' )
Converts a JSON string into an object. Requires the json-parse module.

A.JSON.stringify({name: "Douglas"})
Converts an object to a JSON string. Requires the json-stringify module. No jQuery equivalent.
$.proxy(fn, context)
A.bind(fn, context)
Creates a new function that will call the supplied function in a particular context.
.data(key)
.data(key, value)
.getData(key)
.setData(key, value)
Stores data associated with a DOM element without modifying the DOM.
.removeData()
.removeData(key)
.clearData()
.clearData(key)
Removes the associated data.

Selectors

jQuery AUI Notes
$('*')
A.all('*')
Select all nodes. Note that the default selector engine for AUI is CSS 2.1. For all examples in this section, use the selector-css3 module for AUI.
$(':animated')

Psuedoclass to select all elements currently being animated. No AUI equivalent.
$(':button')
A.all('input[type=button], button')
Extension. In both jQuery and AUI you can run multiple selectors separated by commas.
$(':checkbox')
A.all('input[type=checkbox]')
Extension.
$(':checked')
A.all(':checked')
CSS3
$('parent > child')
A.all('parent > child')
Immediate child selector (child must be one level below parent)
$('parent child')
A.all('parent child')
Descendent selector (child can be at any level below parent)
$('div.class')
A.all('div.class')
Class selector
$(":contains('change')")
A.all(':contains(change)')
Extension to select all elements whose text matches 'change'. jQuery can take quotes or not. AUI requires no quotes. The text matching is plain string comparison, not glob or regexp. Be careful with this one as it will return all matching ancestors, eg [html, body, div].
$(':disabled')
$(':enabled')
A.all(':disabled')
A.all(':enabled')
CSS3. 'input[disabled]' and 'input:not([disabled])' also work in both libraries.
$(':empty')
A.all(':empty')
CSS3. Selects all elements that have no child nodes (excluding text nodes).
$(':parent')
A.all(':not(:empty)')
Inverse of :empty. Will find all elements that are a parent of at least one element. jQuery's version is an extension. AUI's is CSS3.
$('div:eq(n)')
A.all('div').item(n)
Extension. Selects nth element. AUI's item() will return null if there is no nth element. jQuery's selector will return an empty list [] on a match failure.
$('div:even')
$('div:odd')
A.all('div').even()
A.all('div').odd()
Extension. Selects all even or odd elements. Note that elements are 0-indexed and the 0th element is considered even. See also AUI's NodeList.modulus(n, offset).
$(':file')
A.all('input[type=file]')
Extension. Find input elements whose type=file.
$('div:first-child')
A.all('div:first-child')
CSS3. Selects the first child element of divs.
$('div:first)
A.one('div')
The .one() method returns null if there is no match, and a single Node object if there is.
$('div:gt(n)');
$('div:lt(n)');
// or
$('div').slice(n + 1);
$('div').slice(0,n);
A.all('div').slice(n + 1);
A.all('div').slice(0, n);
Extension. :gt (greater than) selects all elements from index n+1 onwards. :lt (less than) selects all nodes from 0 up to n-1.
$('div:has(p)')
var nodes = [];

A.all('div').each(function (node) {
  if (node.one('p')) {
    nodes.push(node);
  }
});

nodes = A.all(nodes);
Extension. Selects elements which contain at least one element that matches the specified selector. In this example, all div tags which have a p tag descendent will be selected.
$(':header')
A.all('h1,h2,h3,h4,h5,h6')
Extension. Selects all heading elements. Rarely used.
$('div:hidden')
var hidden = [];
A.all('div').each(function(node) {
    if ((node.get('offsetWidth') === 0 &&
        node.get('offsetHeight') === 0) ||
        node.get('display') === 'none') {
        hidden.push(node);
    }
});
hidden = A.all(hidden);
Extension. In jQuery > 1.3.2 :hidden selects all elements (or descendents of elements) which take up no visual space. Elements with display:none or whose offsetWidth/offsetHeight equal 0 are considered hidden. Elements with visibility:hidden are not considered hidden.
The AUI equivalent would essentially be a port of the jQuery code that implements :hidden. This might be a good candidate for a patch to AUI.
$('#id')
A.all('#id')
CSS3. Identity selector.
$('input:image')
A.all('input[type=image]')
Extension. Selects all inputs of type image.
$(':input')
A.all('input,textarea,select,button')
Extension. Selects all user-editable form elements.
$(':last-child')
A.all(':last-child')
CSS3.
$('div:last')
var list = A.all('div'),
    len  = list.size(),
    last;

if (len) {
  last = list.item(len - 1);
}
Extension. Selects the last element matched by the selector.
$('input[type=checkbox][checked]')
A.all('input[type=checkbox][checked]')
CSS3, multiple attribute selector
$(':not(div)')
A.all(':not(div)')
CSS3. Negation selector.
$(':password')
A.all('input[type=password]')
Extension.
$(':radio')
A.all('input[type=radio]')
Extension.
$(':reset')
A.all('input[type=reset]')
Extension.
$(':selected')
A.all('option[selected]')
Extension.
$(':submit')
A.all('input[type=submit]')
Extension.
$(':text')
A.all('input[type=text]')
Extension. Does not select textarea elements.

Effects

jQuery AUI Notes
$('#change').animate(
  {
    width:   100,
    height:  100,
    opacity: 0.5
  },
  {
    duration: 600,
    easing:   'swing'
  }
);
var a = new A.Anim(
  {
    node: '#change',
    to: {
        width:   100,
        height:  100,
        opacity: 0.5
    },
    duration: 0.6,
    easing:   A.Easing.bounceOut
  }
);
a.run();
The basic syntax and capabilities of both animation libraries are very similar. jQuery has convenience methods for effects like .fadeIn(), .slideUp(), etc. jQuery core has two easing functions: 'linear' and 'swing', but jQuery UI comes with many more effects as plugins.
AUI has several easing algorithms built-in, and offers additional tools such as animations over Bezier curves. Make sure to load the 'anim' module in your call to AUI().use().
$('#.change').fadeOut();

// or

$('#.change').hide(600);
A.one('#change').hide(true)
jQuery's .fadeOut() fades the opacity to 0, then sets display:none on the element. .fadeIn() is naturally the inverse. The AUI equivalents are .hide(true) and .show(true) (note that the transition module must be loaded in order to get the fade effect).
jQuery effects tend to default to 200 or 600ms while AUI's show/hide transitions default to 500ms. AUI durations are in fractions of seconds; jQuery durations are set in milliseconds.

Array vs. NodeList

jQuery AUI Notes
$('.change').array_method(args)
A.all('.change').array_method(args)
Any Array operation that you can perform on a jQuery list can be translated to AUI in this form. AUI NodeList objects are not native Arrays, but do provide wrapper functions for the most common array methods as of 3.3.0.
$('div').slice(x, y)
A.all('div').slice(x, y)
Return the xth to the yth div elements.
$('div').add('p')
A.all('div').concat(A.all('p'))
Add nodes that match the specified selector.
$('.change').each(
  function() {
    $(this).some_method();
  }
);
A.all('.change').each(
  function() {
    this.some_method();
  }
);
.each() is like the for loop. AUI's each() returns the original NodeList to help with chaining.
$('.change').filter('.bar')
A.all('.change').filter('.bar')
The .filter() method in both libraries both take CSS selectors as filter criteria. jQuery's .filter() can also take a function.
$('.change').filter(function (idx) {
  return this.property === 'value';
});
A.all('.change').filter(function (node) {
  return node.get('property') === 'value';
});
Classic functional programming filter function. Given a list of elements, run the function on each and return a list of those which evaluated true.
$('.change').map(
  function(idx, el) {
    return some_function(el);
  }
)
var mapped = [];
A.all('.change').each(
  function (node) {
    mapped.push(some_function(node));
  }
);
mapped = A.all(mapped);
jQuery's .map() returns a jQuery-wrapped array of the return values of calls to the given function.

Ajax

jQuery AUI Notes
$.ajax({
  url:      url,
  data:     data,
  success:  successFn
});
A.io(url, {
    data: data,
    on:   {success: successFn}
});
AUI.io has extra options for failure mode callbacks, headers, cross-frame i/o, etc. jQuery.ajax() has some interesting options for async, context, and filtering. Make sure to load the AUI 'io' module.

A.io(url, {
    data: data,
    on:   {success: successFn},
    xdr:  {use: 'flash'}
});
Cross-domain requests via a Flash helper. No jQuery equivalent.
$('#message').load('/ajax/test.html');
A.one('#message').load('/ajax/test.html');
A.one('#message').load('/ajax/test.html', '#change');
Load the content of a given URL and replace the contents of #message with it.
In AUI, the node-load module provides this functionality. AUI also optionally supports extracting only a portion of the loaded content if a selector string is passed as the second argument (assuming the content is HTML).

CSS

jQuery AUI Notes
.addClass('change')
.removeClass('change')
.toggleClass('change')
.hasClass('change')
.addClass('change')
.removeClass('change')
.toggleClass('change')
.hasClass('change')
CSS class name manipulation.
.removeClass('change').addClass('bar')
.replaceClass('change', 'bar')
Replace node's CSS class 'change' with 'bar'.
.css('display', 'block')
.setStyle('display', 'block')
Set a single CSS property
.css({
    height:  100,
    width:   100,
    display: 'block'
})
.setStyles({
    height:  100,
    width:   100,
    display: 'block'
})
Set multiple CSS properties with a dictionary.
.css('display')
.getStyle('display')
Get the current value for a CSS property.
.height()
.width()
.getComputedStyle('height')
.getComputedStyle('width')
Computed height / width. Excludes padding and borders.
.innerHeight()
.innerWidth()
.get('clientHeight')
.get('clientWidth')
Includes padding but not border
.outerHeight()
.outerWidth()
.get('offsetHeight')
.get('offsetWidth')
Includes padding and border
.offset()
// {left: 123, top: 456, width: 789, height: 1011}
.getXY()
// [123, 456]
Get the computed x,y coordinates relative to the document. jQuery also returns the size of the node
.offset({ left: 123, top: 456 })
.setXY(123, 456)
Set the x,y coordinates relative to the document.