#!/usr/bin/perl my ($x,$a)=(0,1); if ($a || $x++) { print “foon”; } print “$x”; At last, it will print 0 because, during the evaluation of if statement, since $a = 1, the next part of ‘or’ wont be evaluated. So $xContinue reading… Evaluation of if statements
$_ will hold the reference, not the copy of variable
#!/usr/bin/perl @list=qw(one two three); foreach(reverse @list) { print “$_n”; $_=”foo”; } print “$list[0]n”; Finally it will pring ‘foo’ not ‘one’. Because $_ isn’t a copy of the list element, it’s a reference. Modifying it will change the list.
Disable wildcard epansion in Bash shell
set -f This disables the wildcard expansion in bash shell. Example: $ ksh $ ls -c Tom t tt ufaq $ set -f $ echo t* will output t*
Detect cycle in a linked list
ptr1 = ptr2 = head; do{ ptr1 = ptr1 -> next; ptr2 = ptr2 -> next -> next; }while(ptr1 != ptr2); ptr2 is iterating along the list with double the speed of ptr1. If there is any cycle, then ptr1Continue reading… Detect cycle in a linked list
How to Delete the Windows 2000 and XP Pagefile
Delete the scraps and leftovers on your hard drive. RAM, your computer’s temporary storage area, loses all stored data when the power is turned off. Your pagefile is extra, RAM-like storage on your hard drive. It maintains its data evenContinue reading… How to Delete the Windows 2000 and XP Pagefile
Managing disk quotas in Linux
Table of Contents 1. Setting quotas 2. Enabling and disabling quotas 3. Checking and updating quotas Summary 1. Setting quotas Linux enables you to limit the amount of space that a user or group can consume on a given partition.Continue reading… Managing disk quotas in Linux
Creating partitions and file systems in Linux
Table of Contents 1. Disk types, units, and partitions 2. Creating partitions 3. Using fdisk 4. Creating file systems with mkfs Summary 1. Disk types, units, and partitions Before partitioning a disk in Linux, it is useful to have someContinue reading… Creating partitions and file systems in Linux
The role of partitions in a Linux file system
Table of Contents 1. The role of partitions in Linux 2. Planning Linux partitions 3. Repartitioning Summary 1. The role of partitions in Linux Before they can be used, hard drives must be divided into sections called partitions. Partitions areContinue reading… The role of partitions in a Linux file system
Let me start with Hello World of Blogging!
Hey guys, after so many trails and so many discontinued bloggers ….started blogging on my own machine :-D. Hope you’ll be entertained continuously.
GOOGLE PAPER – Sept, 2006 – CHENNAI
Test consist of 15 question based on C, C++, and Data Structure and two C programs. So i am listing some of the question as i remembered. Q1) What is the value of i after execution of the following program.Continue reading… GOOGLE PAPER – Sept, 2006 – CHENNAI