$times 0m0.348s 0m0.052s 0m0.560s 0m0.112s $ $times 0m0.348s 0m0.052s 0m0.560s 0m0.112s $times 0m0.348s 0m0.052s 0m0.560s 0m0.112s $times 0m0.348s 0m0.052s 0m0.560s 0m0.112s $times 0m0.348s 0m0.052s 0m0.560s 0m0.112s $times 0m0.348s 0m0.052s 0m0.560s 0m0.112s $times 0m0.348s 0m0.052s 0m0.560s 0m0.112s $times 0m0.348s 0m0.052s 0m0.560s 0m0.112s $times 0m0.352s 0m0.052s 0m0.560s 0m0.112s $times 0m0.352s 0m0.052s 0m0.560s 0m0.112s $times 0m0.352s 0m0.052s 0m0.560s 0m0.112s $
commandline combination
commandline session
$ls fell ls: cannot access fell: No such file or directory $cat fell || "echo no such file" ; touch fell cat: fell: No such file or directory bash: echo no such file: command not found $ls fell fell $rm fell $ls fell ls: cannot access fell: No such file or directory $cat fell || echo "no such file" ; touch fell cat: fell: No such file or directory no such file $ls fell fell $rm fell $> fell $cat fell || echo "no such file" ; echo hello hello $rm fell $cat fell || echo "no such file" ; touch fell cat: fell: No such file or directory no such file $ls tell ls: cannot access tell: No such file or directory $ls fell fell $
example working with scala 4 ( Commonly Used Types )
commandline session
$ 4.2.29 1 2---> scala
Welcome to Scala version 2.9.2 (OpenJDK 64-Bit Server VM, Java 1.6.0_24).
Type in expressions to have them evaluated.
Type :help for more information.
scala> 1.toString
res0: java.lang.String = 1
scala> 33.to(40).toString
res1: String = Range(33, 34, 35, 36, 37, 38, 39, 40)
scala> Jeffrin.intersect(Jose)
:8: error: not found: value Jeffrin
Jeffrin.intersect(Jose)
^
scala> "Jeffrin".intersect("Jose")
res3: String = Je
scala>
How does && and || operators combination Work ?
commandline session
$ 4.2.29 10 510---> [ -f wordmatc.c ] || echo hello hello $ 4.2.29 11 511---> [ -f wordmatc.c ] || cat baty && echo hello cat: baty: No such file or directory $ 4.2.29 12 512---> [ -f wordmatc.c ] && echo hello || echo kitten kitten $ 4.2.29 13 513---> [ -f wordmatch.c ] && echo hello || echo kitten hello $ 4.2.29 14 514---> ls wor wordmatch.c worked wordpress-functions-outside-wordpress.html work-selection.php $ 4.2.29 14 514---> ls wordmatch.c wordmatch.c $ 4.2.29 15 515---> ls wordmatc.c ls: cannot access wordmatc.c: No such file or directory $ 4.2.29 16 516--->
logical OR operator in shell
$ [ -f wordmatch.c ] $ [ -f wordmatchtest.c ] $ echo $? 1 $ [ -f wordmatch.c ] $ echo $? 0 $ [ -f wordmatch.c ] || echo hello $ [ -f wordmatchtest.c ] || echo hello hello $
& – Forking operator(AND operator)
commandline session
$ 4.2.29 11 511---> ping -c5 google.com &
[1] 4376
$ 4.2.29 12 512---> PING google.com (173.194.38.1100) 56(84) bytes of data.
64 bytes from sin04s02-in-f5.1e100.net (173.194.38.1100): icmp_req=1 ttl=54 time=75.8 ms
64 bytes from sin04s02-in-f5.1e100.net (173.194.38.1100): icmp_req=2 ttl=54 time=75.3 ms
64 bytes from sin04s02-in-f5.1e100.net (173.194.38.1100): icmp_req=3 ttl=54 time=75.4 ms
64 bytes from sin04s02-in-f5.1e100.net (173.194.38.1100): icmp_req=4 ttl=54 time=75.0 ms
64 bytes from sin04s02-in-f5.1e100.net (173.194.38.1100): icmp_req=5 ttl=54 time=76.1 ms
--- google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 75.095/75.573/76.101/0.405 ms
[1]+ Done ping -c5 google.com
$ 4.2.29 12 512--->
( GNU size ) examples
commandline session
$ 4.2.29 2 502---> ./a.out found in: htop-0.9 found in: . $ 4.2.29 3 503---> size a.out $ 4.2.29 3 503---> size a.out text data bss dec hex filename 2401 608 16 3025 bd1 a.out $ 4.2.29 4 504---> man size $ 4.2.29 5 505---> size --format=SysV a.out a.out : section size addr .interp 28 4194816 .note.ABI-tag 32 4194844 .note.gnu.build-id 36 4194876 .hash 80 4194912 .gnu.hash 28 4194992 .dynsym 360 4195024 .dynstr 143 4195384 .gnu.version 30 4195528 .gnu.version_r 32 4195560 .rela.dyn 24 4195592 .rela.plt 312 4195616 .init 24 4195928 .plt 224 4195952 .text 776 4196176 .fini 14 4196952 .rodata 50 4196968 .eh_frame_hdr 44 4197020 .eh_frame 164 4197064 .ctors 16 6294384 .dtors 16 6294400 .jcr 8 6294416 .dynamic 416 6294424 .got 8 6294840 .got.plt 128 6294848 .data 16 6294976 .bss 16 6294992 .comment 57 0 Total 3082 $ 4.2.29 6 506--->
example working with scala 3
Get The Hang
$ 4.2.29 2 502---> scala
Welcome to Scala version 2.9.2 (OpenJDK 64-Bit Server VM, Java 1.6.0_24).
Type in expressions to have them evaluated.
Type :help for more information.
scala> va a, b = 10
:1: error: ';' expected but ',' found.
va a, b = 10
^
scala> val a, b = 10
a: Int = 10
b: Int = 10
scala> a*b
res0: Int = 100
scala> val a, b :String = hello
:7: error: not found: value hello
val a, b :String = hello
^
scala> var a, b :String = hello
:7: error: not found: value hello
var a, b :String = hello
^
scala> var a, b :String = "hello"
a: String = hello
b: String = hello
scala> echo a
:8: error: not found: value echo
echo a
^
scala> a
res2: String = hello
scala>
example working with scala 2 (declaring values and variables)
Get The Hang
$ 4.2.29 1 501---> scala
Welcome to Scala version 2.9.2 (OpenJDK 64-Bit Server VM, Java 1.6.0_24).
Type in expressions to have them evaluated.
Type :help for more information.
scala> val stat = data + ticks
:7: error: not found: value data
val stat = data + ticks
^
scala> val stat = data
:7: error: not found: value data
val stat = data
^
scala> val stat = 1
stat: Int = 1
scala> val plot = 3
plot: Int = 3
scala> val out = data + plot
:8: error: not found: value data
val out = data + plot
^
scala> val out = stat + plot
out: Int = 4
scala>
example working with scala 1 (include auto-completion)
Get The Hang
$ 4.2.29 2 502---> scala
Welcome to Scala version 2.9.2 (OpenJDK 64-Bit Server VM, Java 1.6.0_24).
Type in expressions to have them evaluated.
Type :help for more information.
scala> 6/3
res0: Int = 2
scala> res0.
% & * + - / >
>= >> >>> ^ asInstanceOf isInstanceOf toByte
toChar toDouble toFloat toInt toLong toShort toString
unary_+ unary_- unary_~ |
scala> res0.*
def *(x: Byte): Int def *(x: Char): Int def *(x: Double): Double
def *(x: Float): Float def *(x: Int): Int def *(x: Long): Long def *(x: Short): Int
scala> res0.*
:9: error: ambiguous reference to overloaded definition,
both method * in class Int of type (x: Char)Int
and method * in class Int of type (x: Short)Int
match expected type ?
res0.*
^
scala> res0.to
toByte toChar toDouble toFloat toInt toLong toShort toString
scala> res0.to
toByte toChar toDouble toFloat toInt toLong toShort toString
scala> res0.toS
toShort toString
scala> res0.toString
res2: java.lang.String = 2
scala> res2*2
res3: String = 22
scala>