indu sharma


{ City } bangalore
< Country > india
* Profession * engineer
User No # 45944
Total Questions Posted # 4
Total Answers Posted # 8

Total Answers Posted for My Questions # 36
Total Views for My Questions # 105714

Users Marked my Answers as Correct # 78
Users Marked my Answers as Wrong # 31
Questions / { indu sharma }
Questions Answers Category Views Company eMail

How do you check whether a string is palindrome or not using TCL script?

10 Tcl 35468

How do you find the length of a string without using string length command in TCL??

Hexaware,

6 Tcl 24423

How to Swap 30 & 40 in IP address 192.30.40.1 using TCL script?

HCL, ONGC,

8 Tcl 27235

How to extract "information" from "ccccccccaaabbbbaaaabbinformationabcaaaaaabbbbbbbccbb" in tcl using a single command?

Wipro,

12 Tcl 18588




Answers / { indu sharma }

Question { HCL, 20729 }

What is the difference between sanity testing and smoke testing


Answer

Smoke testing is system level testing of a build like installation,compatibility,launching application etc.

sanity testing is feature testing i.e major functionalities of the product/software.

Is This Answer Correct ?    1 Yes 0 No

Question { 12771 }

What is the difference bt QA and QC


Answer

QA=> Activities done to ensure that process is good enough to make product inline with requirements,develop and maintain the product effectively in a given span of time.

QC=>Activities done to ensure that product is inline with the requirement.Testing product,detecting the bugs & fixing the bugs come under this category.

Is This Answer Correct ?    0 Yes 0 No


Question { TCS, 7574 }

can anybody tell me that what is a build note and what it
contains? And build note is released to testing team with
every new build or it release only when bugs are fixed by
the developer?


Answer

Build note is the note released to the test team along with the build which contains the informations like current version of product,key limitations of the build,known issues, features supported/not supported,installation procedure,list of fixed bugs,compatibility information,build in which non-supported features are going to be implemented etc.

Is This Answer Correct ?    7 Yes 1 No

Question { 19014 }

Set ip address as 10.30.20.1
write a script to replace the 30 with 40 ?


Answer

In above answer if you have IP like 10.30.30.1 then it replace for all 30 with 40.But here i guess intention is just to replace one octet with 40.So following solves that issue:


set a 10.30.2.1
set b [ string replace $a 3 4 40 ]
puts $b

Is This Answer Correct ?    4 Yes 1 No

Question { 35468 }

How do you check whether a string is palindrome or not using TCL script?


Answer

Pseudo code:
>>Find the length of string
>>Then Compare character at index i with "i+string length"
If all character at index position i and "i+ string length" are same then it is a palindrome string.

Any better solutions???

Is This Answer Correct ?    3 Yes 3 No

Question { 35468 }

How do you check whether a string is palindrome or not using TCL script?


Answer

Hi!! i have written code for the above pseudo code.Check if it works!!!!!

gets stdin a
set len [ string length $a ]
set n [ expr $len/2 ]

for { set i 0 } { $i < $n } { incr i 1 } {
set b [ string index $a $i ]
set c [ expr $len - 1 - $i ]
set d [ string index $a $c ]

if {$b != $d} {
puts "not a palindrome"
exit

}

}
puts "Palindrome"

Is This Answer Correct ?    30 Yes 13 No

Question { Hexaware, 24423 }

How do you find the length of a string without using string
length command in TCL??


Answer

set str "lenghtofthisstring"
set list1 [ split $str "" ]
foreach value $list1 {
incr len
}
puts $len

Is This Answer Correct ?    14 Yes 9 No

Question { HCL, 27235 }

How to Swap 30 & 40 in IP address 192.30.40.1 using TCL
script?


Answer

There are three solutions.

set a 192.30.40.1
set b [ string range $a 3 4 ]
set c [ string range $a 6 7 ]
set d [ string replace $a 3 4 $c ]
set e [ string replace $d 6 7 $b]
puts $e

===OR=====
set a 192.30.40.1
set b [ split $a .]
set u [lindex $b 0]
set v [lindex $b 3]
set x [lindex $b 1]
set y [lindex $b 2]
set z [join "$u $y $x $v" .]
puts $z

====OR====
set ip 192.30.40.1
regexp {([0-9]+\.)([0-9]+\.)([0-9]+\.)([0-9]+)} $ip match 1st 2nd 3rd 4th
append new_ip $1st $3rd $2nd $4th
puts $new_ip

Is This Answer Correct ?    19 Yes 4 No