Navigation

Get 10 digit phone number and replay that entered number

Below code snippet working fine in the http://evolution.voxeo.com/

<?php
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
?>

ivr sample code

IVR Application

DTMF SAMPLE

dtmf working sample

<?php
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
?>

[dtmf-1 dtmf-2 dtmf-3 dtmf-4 dtmf-5 dtmf-6 dtmf-6 dtmf-7 dtmf-8 dtmf-9]

Guess what the computer is thinking! Pick a number between 0 and 9.

combine two block into one block

display two block into one block

here one view block and another is content slider block


<?php
$content = '';
$block = '';
$module = 'views';
$delta = 'image_slider-block_1';
$block = module_invoke($module, 'block', 'view', $delta);
$content .= "";
$content .= "$block[subject]";
$content .= "$block[content]";
$content .= "";
$module = 'content_slider';
$delta = '1';
$block = module_invoke($module, 'block', 'view', $delta);

print array key and value

print array key and value


#!/usr/bin/perl

$array[0] = 'Monday';
$array[1] = 'Tueday';
$array[2] = 'Wedday';
$array[3] = 'Friday';

foreach $val (keys @array) {
print $val."=>".$array[$val]."\n";
}

step by step themeing for create content type story

In this example, i am going to theme the content type story

1. open template.php,
2. find function called
phptemplate_preprocess_page
3. add below code in that


function phptemplate_preprocess_page(&$vars) {
$vars['tabs2'] = menu_secondary_local_tasks();

// Hook into color.module
if (module_exists('color')) {
_color_page_alter($vars);
}
if ($vars['node']->type == "story" && ( arg(2)=='edit' || arg(1) =='add')) {
$vars['template_files'][] = 'page-node-add-story';
}
}

vitual host config in WAM

please use the below URL,

for configure the WAMP virtual host

http://cesaric.com/?p=255

Expect function in shell expect bash example, expect sample

expect shell sample


#!/bin/bash
PASS="password123"
VAR=$(expect -c "
spawn scp sample.pl hostname:/desctination
expect {
password: { send \"$PASS\r\"; exp_continue }
:~$ { send \"ls\r\"; }
}
exit
")

Create Spread Sheet


#!/usr/bin/perl
use strict;
use warnings;
use Spreadsheet::WriteExcel;

# Create a new workbook called simple.xls and add a worksheet.
my $workbook = Spreadsheet::WriteExcel->new('simple.xls');
my $worksheet = $workbook->add_worksheet('Weekly Report');

# The general syntax is write($row, $column, $token).
# Note that row and column are zero indexed.

# Write some text. in write function First Argument for ROW, Second Argument for COLUMN, Third Argument for Title/Text to display
$worksheet->write(0, 0, 'Date');
$worksheet->write(0, 1, 'Time');

PERL, Get current date and time

PERL, Get current date and time


#!/usr/bin/perl
use strict;
use warnings;
use POSIX qw(strftime);
my $get_cur_ts = time;
my $now_string = strftime "%a %b %e %d %m %Y %H:%M:%S %Y", localtime;
print $now_string."\n";

PERL:


#!/usr/bin/perl
use strict;
use warnings;
use POSIX qw(strftime);
my $get_cur_ts = time;
my $prev_ts = 1317489940;
my $cur_dt=strftime("%m/%d/%y %H:%M",localtime($get_cur_ts));-------->Get current timestamp and passing timstamp into strftime function to get current date and time

Syndicate content