Skip to main content

Posts

Showing posts with the label tcl

TCL Smartphone Stock ROM

TCL Smartphone Stock ROM Stock Roms Original TCL All Model for Free This page contains all type of stock rom TCL original for all free , please download TCL stock rom that you want to repair your beloved smartphone TCL A510 TCL_A510_V2.5_121204 Download TCL H916T TCL_H916T_vAAI  Download TCL I708U TCL_i708U_MP_Flash_14.12.12  Download TCL I709M TCL_i709M_MP_ROM_14.12.24.18_Flash  Download TCL I718M TCL_i718M_CMCC_MP_Flash_15.07.23.14  Download TCL J600T TCL_J600T_SW_G97512A4_V006_M11  Download TCL J620 TCL_J620_V1.5_130528  Download TCL J630T TCL_J630T_SW_G97512B1_V013_M11  Download TCL J636D TCL_J636D_msm8610_W7_V2_09_4.3_20151211202645  Download TCL_J636D_V2_08_20140513_4.3_20151211202622  Download TCL J706D TCL_J706D_msm8610_S3_V1_04_user_4.3_20151211202549  Download TCL J900 TCL_J900_V2.8_130801  Download TCL J900T TCL_J900T_V2.0_130730_CN_CMCC  Down...

Tcl and OTcl Tutorial For NS2 variables and arrays

Tcl and OTcl Tutorial For NS2 variables and arrays Variables and arrays Defining a variable in Tcl is very simple: set var1 1 set var2 "Tcl Variable 2" The variables can be referenced by prefixing the variable name with a $. For example to print the above variables, we can use puts "var1=$var1, var2=$var2" Any situation in which you require that the value of the variable be used is one in which the $ prefix should be added to the variable name. In some situations, it is necessary to use the variable name directly. For example incr var1 can be used to increment var1. I guess you can think of it as the difference between call-by-reference and call-by-value: in the former case you use the variable name on its own, while in the latter you prefix it with a $. An alternative is to assign the results of a function to a variable. This can be done as follows: set var3 [expr 5*10] This sets the variable var3 to the result of calling the  expr  function with the parameter  5*1...

Tcl and OTcl Tutorial for NS2 Program to find Factorial

Tcl and OTcl Tutorial for NS2 Program to find Factorial  Fractorial Computation:  tcl script to obtain the value of 10! = 10 * 9 * ... * 1. get factorial.tcl and run the script; write a function to compute 2^x, test your answer. Execute the script as: $ tclsh lab1a.tcl or $ ns lab1a.tcl ################################################################################ #filename : factorial.tcl # define function to compute Factorial X! proc Factorial {x} {     # define variable     set result 1         # for loop     for {set i 1} {$i <= $x} {incr i} { set result [expr $result * $i]     }         # return computation result     return $result } ############################################################################# # define function to compute 2^x proc 2pow {x} {     # define variable     set result 1         # for loop   ...

Tcl and OTcl Tutorial For NS2 Loops and Conditional Statements

Tcl and OTcl Tutorial For NS2 Loops and Conditional Statements For loops For loops are very useful in ns and can be used in conjunction with arrays to easily create larger network topologies. To generate 100 nodes, the following code can be used: for {set i 0}{$i < 100}{incr i} {     set n($i) [$ns node] } While loops These are very similar to for loops. The syntax is set i 0 while {$i < 10} {     set n($i) [new Node]     incr i } If statements If statements are very simple if {$i < 10} {     puts "i is less than 10" } if {$var2 == "Tcl Variable 2"} {     puts "var2 = Tcl Variable 2" } download  file  now

Tcl Expect Scripts Auto SSH Logins

Tcl Expect Scripts Auto SSH Logins When automating tasks with shell scripts, you may stumble at points that require user interaction, such as password authentication when checking out an SVN repository. One can handle these events by creating expect scripts. Below is an example script that I put together for SSHing into another computer using a password. Be careful how you use this script, e.g. I dont recommend storing passwords in files on your computer, but asking the user their details at the beginning of your installation script and passing them to this script later isnt a bad idea. #!/usr/bin/expect # Set the time allowed to wait for a given response. SEt to 30 seconds because it can take a while # for machines to respond to an ssh request. set timeout 30000 proc connectToServer { user host password port } { set address $user append address "@" append address $host puts "Connecting to server: $host" spawn ssh $address -p $port expect { {*password: } {...

Tcl and OTcl Tutorial For NS2 Procedures

Tcl and OTcl Tutorial For NS2 Procedures Procedures Procedures are an essential component of Tcl and can be used to make programming ns simpler. As in any functional programming language, procedures can be used for repetitive tasks, or simply to logically break down the tasks in the program. Procedures are defined in Tcl as follows: proc proc1 {} {     puts "in procedure proc1" } This defines a procedure that takes no parameters and prints out "in procedure proc1". To call this procedure proc1 can be used. A procedure with parameters can be defined as follows: proc proc2 {parameter1} {     puts "the value of parameter1 is $parameter1" } This procedure can be invoked as follows: proc2 10 A procedure that returns a value can be defined as follows: proc proc3 {min max} {     set randomvar [rand $min $max]     return $randomvar } This procedure generates a random variable and returns it to the calling function. This can be invoked ...