NLP with python

Install rar in linux:
$ cd /tmp
$ wget http://www.rarlab.com/rar/rarlinux-3.6.0.tar.gz
$ tar -zxvf rarlinux-3.6.0.tar.gz
$ cd rar
$ ./unrar
# cp rar unrar /bin

Determing filetype:
file xxxx

How to count the top items in txt files?
awk ‘{ print $1}’ /path/to/input.txt sort| uniq -c | sort -nr > /path/to/top-get-ips.txt

Detect the checkbox value and onchange action in Jquery:
$(“#chkBox”).click(function(){
if ($(“#chkBox”).is(“:checked”)) {
alert(“Stopping…”);
} else {
alert(“Starting…”);
}
});

1. Create new menu root for example *merchant*

2. Override function hook_preprocess_page(&$vars) in templete.php and add the following code:

global $user;
if (in_array(‘Merchant’, $user->roles)) {
$vars['nav_links'] = menu_navigation_links(“menu-merchant”);
} elseif (in_array(‘…’, $user->roles)) {

}

3. Add the following code in your tpl file:

<?php print theme(‘links’, $nav_links) ?>

That is all.