Tuesday, 22 April 2014
Saturday, 11 January 2014
Automatically Refresh/Reload a Web Page at fixed Interval of Time (Using VB Script)
Copy the code below to notepad and save it as refresh.vbs
Double click on the file to run the script.
On Error Resume Next
Set objExplorer = CreateObject("InternetExplorer.Application")
objExplorer.Navigate "http://www.youtube.com/watch?v=81MV1agQMG4"
objExplorer.Visible = 1
Wscript.Sleep 5000
Set objDoc = objExplorer.Document
Do While True
Wscript.Sleep 5000
objDoc.Location.Reload(True)
If Err <> 0 Then
Wscript.Quit
End If
Loop
Double click on the file to run the script.
On Error Resume Next
Set objExplorer = CreateObject("InternetExplorer.Application")
objExplorer.Navigate "http://www.youtube.com/watch?v=81MV1agQMG4"
objExplorer.Visible = 1
Wscript.Sleep 5000
Set objDoc = objExplorer.Document
Do While True
Wscript.Sleep 5000
objDoc.Location.Reload(True)
If Err <> 0 Then
Wscript.Quit
End If
Loop
TEXT TO SPEECH (Using VB Script)
Copy the code below to notepad and save it as filename.vbs
Double click on the file to run the script.
dim m, s
m=inputbox("Enter text","Text2Speech")
set s=createobject("sapi.spvoice")
s.Speak m
Double click on the file to run the script.
dim m, s
m=inputbox("Enter text","Text2Speech")
set s=createobject("sapi.spvoice")
s.Speak m
Monday, 23 December 2013
Program to invert 'n' alternate bits of a number (Asked in APPLIED MATERIALS coding round)
// initial 30 = 11110
// final 11 = 01011
#include<stdio.h>
int invert_alternate_bit(int,int);
int main()
{
printf("NEW num : %d\n",invert_alternate_bit(30,3));
return 0;
}
int invert_alternate_bit(int num,int n)
{
int c = 0;
printf("OLD num : %d\n",num);
for(int i=1; i<= n ; i++)
{
c = c << 2;
c = c ^ 1;
}
num = num ^ c;
return num;
}
// final 11 = 01011
#include<stdio.h>
int invert_alternate_bit(int,int);
int main()
{
printf("NEW num : %d\n",invert_alternate_bit(30,3));
return 0;
}
int invert_alternate_bit(int num,int n)
{
int c = 0;
printf("OLD num : %d\n",num);
for(int i=1; i<= n ; i++)
{
c = c << 2;
c = c ^ 1;
}
num = num ^ c;
return num;
}
Sunday, 22 December 2013
Program to initialize the array as a pyramid of alphabets (Asked in APPLIED MATERIALS coding round)
#include<stdio.h>
void print_in(int,int,char);
void show(int,int);
void initialize(int,int);
char a[4][9];
int main()
{
char ch='A';
initialize(5,9);
print_in(0,4,ch);
show(5,9);
}
void print_in(int row,int col,char ch)
{
int count=1;
while(count<=25) // till Y
{
if(count==1)
{
a[row][col] = ch;
ch++;
}
if(count>1 && count<=4)
{
a[row][col] = ch;
col++;
ch++;
}
if(count>4 && count<=9)
{
a[row][col] = ch;
col++;
ch++;
}
if(count>9 && count<=16)
{
a[row][col] = ch;
col++;
ch++;
}
if(count>16 && count<=25)
{
a[row][col] = ch;
col++;
ch++;
}
if(count==1)
{
row++; // 1
col--; // 3
}
if(count==4)
{
row++; // 2
col = col-4;// 2
}
if(count==9)
{
row++; // 3
col = col-6;// 1
}
if(count==16)
{
row++; // 4
col = col-8;// 0
}
count++;
}
}
void show(int row,int col)
{
for(int i=0;i<row;i++)
{
for(int j=0;j<col;j++)
{
printf("%c ",a[i][j]);
}
printf("\n");
}
}
void initialize(int row,int col)
{
for(int i=0;i<row;i++)
{
for(int j=0;j<col;j++)
{
a[i][j] = ' ';
}
}
}
Sample Output:
void print_in(int,int,char);
void show(int,int);
void initialize(int,int);
char a[4][9];
int main()
{
char ch='A';
initialize(5,9);
print_in(0,4,ch);
show(5,9);
}
void print_in(int row,int col,char ch)
{
int count=1;
while(count<=25) // till Y
{
if(count==1)
{
a[row][col] = ch;
ch++;
}
if(count>1 && count<=4)
{
a[row][col] = ch;
col++;
ch++;
}
if(count>4 && count<=9)
{
a[row][col] = ch;
col++;
ch++;
}
if(count>9 && count<=16)
{
a[row][col] = ch;
col++;
ch++;
}
if(count>16 && count<=25)
{
a[row][col] = ch;
col++;
ch++;
}
if(count==1)
{
row++; // 1
col--; // 3
}
if(count==4)
{
row++; // 2
col = col-4;// 2
}
if(count==9)
{
row++; // 3
col = col-6;// 1
}
if(count==16)
{
row++; // 4
col = col-8;// 0
}
count++;
}
}
void show(int row,int col)
{
for(int i=0;i<row;i++)
{
for(int j=0;j<col;j++)
{
printf("%c ",a[i][j]);
}
printf("\n");
}
}
void initialize(int row,int col)
{
for(int i=0;i<row;i++)
{
for(int j=0;j<col;j++)
{
a[i][j] = ' ';
}
}
}
Sample Output:
| A | ||||||||
| B | C | D | ||||||
| E | F | G | H | I | ||||
| J | K | L | M | N | O | P | ||
| Q | R | S | T | U | V | W | X | Y |
Wednesday, 18 December 2013
CISCO CERTIFIED NETWORKING WORKSHOP @CUSAT
ACM IIT Delhi
Sponsored- National Network Security Championship (NNSC-2014) @ School of
Engineering, Cochin University of Science and Technology
About NNSC
NNSC-2014 is National Network Security Championship with
workshop series jointly being organized by Association for Computer
Machinery-IIT Delhi and Network Bulls, Gurgaon. This championship, which is
sponsored by ASIA’s Biggest Cisco Training Labs- Network Bulls - Gurgaon, will
help students across the country to meet at same grounds and to learn about
Cisco/Networking Technologies.
Event Details
Workshop Date@CUSAT: 18 & 19 January, 2014.
Eligible Branches: ALL Branches (Expecting large participation from CSE,
IT and EC) & ALL Semesters
Participation Fees: ₹ 1190
Seats: Limited seats according to the equipments available for
each students. (Nearly 50). So Hurry, grab this golden opportunity.
Event Coordinator (Faculty): Mr. Vinod Kumar P.P. & Mr. V. Damodaran
Event Coordinator (Faculty): Mr. Vinod Kumar P.P. & Mr. V. Damodaran
Register: HERE
Stage 1 (WORKSHOP ROUND to be held at Zonal Centers)
A two day hands-on Network
Implementation workshop will be held all across India
All the participants who want
to participate in NNSC-2014 are required to attend the workshops at any Zonal
Center and participate in the competition after the workshop.
The Duration of the Networking
workshop will be of 2 Days (7-8 hrs each day).
The workshop will be delivered
by Cisco Certified Professionals working with Network Bulls, Gurgaon.
Stage 2 (ZONAL ROUND to
be held at Zonal Center)
Just after the workshop a Mega
Competition of NNSC-2014 on the basis of the two day workshop will be held.
Winners will be awarded
Certificate of Merit, and are required to participate in Final Rounds which
will be held in the month of March 2014 at IIT Delhi.
Stage 3 (FINAL ROUND to
be held at IIT Delhi)
Winners of all Zonal Centers
will be competing against each other at NNSC-2014 in March 2014 in association
with ACM-IIT Delhi.
Winner of this Final Round will
win The National Network Security Champion title and will be awarded and
honored by ACM-IIT Delhi with prizes worth 1 lakh rupees.
For further details please
visit:
Thursday, 12 December 2013
Program to find Maximum Run of a Character in a String (Asked in APPLIED MATERIALS coding round)
//program to find the maximum run count of a character
#include<stdio.h>
int main()
{
int count = 0, count_max = 0;
char ch[100],s;
int i=0;
gets(ch);
while(ch[i]!='\0')
{
s = ch[i];
while(ch[i]==s)
{
count++;
i++;
}
if(count_max<count)
{
count_max = count;
count = 0;
}
}
printf("MAX RUN = %d\n",count_max);
return 0;
}
#include<stdio.h>
int main()
{
int count = 0, count_max = 0;
char ch[100],s;
int i=0;
gets(ch);
while(ch[i]!='\0')
{
s = ch[i];
while(ch[i]==s)
{
count++;
i++;
}
if(count_max<count)
{
count_max = count;
count = 0;
}
}
printf("MAX RUN = %d\n",count_max);
return 0;
}
Subscribe to:
Posts (Atom)

