bogomips . Linux kernel

commandline session

root@debian:~# cat /proc/cpuinfo
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 15
model		: 127
model name	: AMD Sempron(tm) Processor LE-1150
stepping	: 1
microcode	: 0x83
cpu MHz		: 1000.000
cache size	: 256 KB
fpu		: yes
fpu_exception	: yes
cpuid level	: 1
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow up rep_good nopl extd_apicid pni cx16 lahf_lm extapic cr8_legacy 3dnowprefetch
bogomips : 2009.14
TLB size : 1024 4K pages clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts fid vid ttp tm stc 100mhzsteps root@debian:~#

one sentence

"the number of million times per second a processor can do absolutely nothing."

lshw . list hardware

commandline session

root@debian:~# lshw
debian
    description: Desktop Computer
    product: M61SME-S2 ()
    vendor: Gigabyte Technology Co., Ltd.
    width: 64 bits
    capabilities: smbios-2.4 dmi-2.4 vsyscall32
    configuration: boot=normal chassis=desktop uuid=30303141-3444-4632-3731-4236FFFFFFFF
  *-core
       description: Motherboard
       product: M61SME-S2
       vendor: Gigabyte Technology Co., Ltd.
       physical id: 0
       version: x.x
       serial: Sat Sep 01 22:38:46 2007
     *-firmware
          description: BIOS
          vendor: Award Software International, Inc.
          physical id: 0
          version: F4
          date: 06/21/2007
          size: 128KiB
          capacity: 448KiB
          capabilities: pci pnp apm upgrade shadowing cdboot bootselect socketedrom edd int13floppy360 int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int9keyboard int14serial int17printer int10video acpi usb ls120boot zipboot biosbootspecification
     *-cpu:0
          description: CPU
          product: AMD Sempron(tm) Processor LE-1150
          vendor: Hynix Semiconductor (Hyundai Electronics)
          physical id: 3
          bus info: cpu@0
          version: AMD Sempron(tm) Processor LE-1150
          slot: Socket M2
          size: 1GHz
          capacity: 3200MHz
          width: 64 bits
          clock: 200MHz
          capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp x86-64 3dnowext 3dnow up rep_good nopl extd_apicid pni cx16 lahf_lm extapic cr8_legacy 3dnowprefetch cpufreq
        *-cache:0
             description: L1 cache
             physical id: 9
             slot: Internal Cache
             size: 128KiB
             capacity: 128KiB
             capabilities: synchronous internal write-back
        *-cache:1
             description: L2 cache
             physical id: b
             slot: External Cache
             size: 256KiB
             capacity: 256KiB
             capabilities: synchronous internal write-back
     *-cpu:1 DISABLED
          description: CPU
          vendor: Unknown
          physical id: 4
          bus info: cpu@1
          version: AMD Sempron(tm) Processor LE-1150
          slot: Socket M2
          size: 2GHz
          capacity: 3200MHz
          clock: 200MHz
        *-cache
             description: L1 cache
             physical id: a
             slot: Internal Cache
             size: 128KiB
             capacity: 128KiB
             capabilities: synchronous internal write-back
     *-memory:0
          description: System Memory
          physical id: 19
          slot: System board or motherboard
          size: 2GiB
        *-bank:0
             description: DIMM 400 MHz (2.5 ns) [empty]
             physical id: 0
             slot: A0
             width: 64 bits
             clock: 400MHz (2.5ns)
        *-bank:1
             description: DIMM 400 MHz (2.5 ns)
             physical id: 1
             slot: A1
             size: 2GiB
             width: 64 bits
             clock: 400MHz (2.5ns)
     *-memory:1 UNCLAIMED
          description: RAM memory
          product: MCP61 Memory Controller
          vendor: nVidia Corporation
          physical id: 5
          bus info: pci@0000:00:00.0
          version: a1
          width: 32 bits
          clock: 66MHz (15.2ns)
          capabilities: ht bus_master cap_list
          configuration: latency=0
     *-isa
          description: ISA bridge
          product: MCP61 LPC Bridge
          vendor: nVidia Corporation
          physical id: 1
          bus info: pci@0000:00:01.0
          version: a2
          width: 32 bits
          clock: 66MHz
          capabilities: isa bus_master
          configuration: latency=0
     *-serial
          description: SMBus
          product: MCP61 SMBus
          vendor: nVidia Corporation
          physical id: 1.1
          bus info: pci@0000:00:01.1
          version: a2
          width: 32 bits
          clock: 66MHz
          capabilities: pm cap_list
          configuration: driver=nForce2_smbus latency=0
          resources: irq:5 ioport:c000(size=64) ioport:1c00(size=64) ioport:c800(size=64)
     *-memory:2 UNCLAIMED
          description: RAM memory
          product: MCP61 Memory Controller
          vendor: nVidia Corporation
          physical id: 1.2
          bus info: pci@0000:00:01.2
          version: a2
          width: 32 bits
          clock: 66MHz (15.2ns)
          configuration: latency=0
     *-usb:0
          description: USB controller
          product: MCP61 USB Controller
          vendor: nVidia Corporation
          physical id: 2
          bus info: pci@0000:00:02.0
          version: a2
          width: 32 bits
          clock: 66MHz
          capabilities: pm ohci bus_master cap_list
          configuration: driver=ohci_hcd latency=0 maxlatency=1 mingnt=3
          resources: irq:22 memory:f5005000-f5005fff
     *-usb:1
          description: USB controller
          product: MCP61 USB Controller
          vendor: nVidia Corporation
          physical id: 2.1
          bus info: pci@0000:00:02.1
          version: a2
          width: 32 bits
          clock: 66MHz
          capabilities: debug pm ehci bus_master cap_list
          configuration: driver=ehci_hcd latency=0 maxlatency=1 mingnt=3
          resources: irq:23 memory:f5004000-f50040ff
     *-pci:0
          description: PCI bridge
          product: MCP61 PCI bridge
          vendor: nVidia Corporation
          physical id: 100
          bus info: pci@0000:00:04.0
          version: a1
          width: 32 bits
          clock: 66MHz
          capabilities: pci ht subtractive_decode bus_master cap_list
          resources: ioport:b000(size=4096)
     *-multimedia
          description: Audio device
          product: MCP61 High Definition Audio
          vendor: nVidia Corporation
          physical id: 9
          bus info: pci@0000:00:05.0
          version: a2
          width: 32 bits
          clock: 66MHz
          capabilities: pm msi ht bus_master cap_list
          configuration: driver=snd_hda_intel latency=0 maxlatency=5 mingnt=2
          resources: irq:23 memory:f5000000-f5003fff
     *-ide:0
          description: IDE interface
          product: MCP61 IDE
          vendor: nVidia Corporation
          physical id: 6
          bus info: pci@0000:00:06.0
          version: a2
          width: 32 bits
          clock: 66MHz
          capabilities: ide pm bus_master cap_list
          configuration: driver=pata_amd latency=0 maxlatency=1 mingnt=3
          resources: irq:0 ioport:1f0(size=8) ioport:3f6 ioport:170(size=8) ioport:376 ioport:f000(size=16)
     *-bridge
          description: Ethernet interface
          product: MCP61 Ethernet
          vendor: nVidia Corporation
          physical id: 7
          bus info: pci@0000:00:07.0
          logical name: eth0
          version: a2
          serial: 00:1a:4d:f2:71:b6
          size: 100000000
          capacity: 100000000
          width: 32 bits
          clock: 66MHz
          capabilities: bridge pm msi ht bus_master cap_list ethernet physical mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
          configuration: autonegotiation=on broadcast=yes driver=forcedeth driverversion=0.64 duplex=full ip=10.0.0.3 latency=0 link=yes maxlatency=20 mingnt=1 multicast=yes port=MII speed=100Mbit/s
          resources: irq:40 memory:f5006000-f5006fff ioport:cc00(size=8)
     *-ide:1
          description: IDE interface
          product: MCP61 SATA Controller
          vendor: nVidia Corporation
          physical id: 8
          bus info: pci@0000:00:08.0
          logical name: scsi2
          logical name: scsi3
          version: a2
          width: 32 bits
          clock: 66MHz
          capabilities: ide pm msi ht bus_master cap_list emulated
          configuration: driver=sata_nv latency=0 maxlatency=1 mingnt=3
          resources: irq:20 ioport:9f0(size=8) ioport:bf0(size=4) ioport:970(size=8) ioport:b70(size=4) ioport:e000(size=16) memory:f5007000-f5007fff
        *-disk
             description: ATA Disk
             product: ST3250318AS
             vendor: Seagate
             physical id: 0
             bus info: scsi@2:0.0.0
             logical name: /dev/sda
             version: CC38
             serial: 9VMKRZJD
             size: 232GiB (250GB)
             capabilities: partitioned partitioned:dos
             configuration: ansiversion=5 signature=00093360
           *-volume:0
                description: EXT3 volume
                vendor: Linux
                physical id: 1
                bus info: scsi@2:0.0.0,1
                logical name: /dev/sda1
                logical name: /
                version: 1.0
                serial: 26cca090-8a72-4443-859f-7a67b7188357
                size: 227GiB
                capacity: 227GiB
                capabilities: primary bootable journaled extended_attributes large_files recover ext3 ext2 initialized
                configuration: created=2010-10-12 21:39:52 filesystem=ext3 modified=2012-04-23 16:21:52 mount.fstype=ext3 mount.options=rw,relatime,errors=remount-ro,barrier=1,data=ordered mounted=2012-05-10 16:02:01 state=mounted
           *-volume:1
                description: Extended partition
                physical id: 2
                bus info: scsi@2:0.0.0,2
                logical name: /dev/sda2
                size: 5707MiB
                capacity: 5707MiB
                capabilities: primary extended partitioned partitioned:extended
              *-logicalvolume
                   description: Linux swap / Solaris partition
                   physical id: 5
                   logical name: /dev/sda5
                   capacity: 5707MiB
                   capabilities: nofs
        *-cdrom
             description: DVD-RAM writer
             product: DRW-24B3ST
             vendor: ASUS
             physical id: 1
             bus info: scsi@3:0.0.0
             logical name: /dev/cdrom1
             logical name: /dev/cdrw1
             logical name: /dev/dvd1
             logical name: /dev/dvdrw1
             logical name: /dev/sr0
             version: 1.00
             capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram
             configuration: ansiversion=5 status=nodisc
     *-display
          description: VGA compatible controller
          product: C61 [GeForce 6150SE nForce 430]
          vendor: nVidia Corporation
          physical id: d
          bus info: pci@0000:00:0d.0
          version: a2
          width: 64 bits
          clock: 66MHz
          capabilities: pm msi vga_controller bus_master cap_list rom
          configuration: driver=nvidia latency=0
          resources: irq:22 memory:f2000000-f2ffffff memory:e0000000-efffffff memory:f3000000-f3ffffff memory:80000000-8001ffff
     *-pci:1
          description: Host bridge
          product: K8 [Athlon64/Opteron] HyperTransport Technology Configuration
          vendor: Hynix Semiconductor (Hyundai Electronics)
          physical id: 101
          bus info: pci@0000:00:18.0
          version: 00
          width: 32 bits
          clock: 33MHz
     *-pci:2
          description: Host bridge
          product: K8 [Athlon64/Opteron] Address Map
          vendor: Hynix Semiconductor (Hyundai Electronics)
          physical id: 102
          bus info: pci@0000:00:18.1
          version: 00
          width: 32 bits
          clock: 33MHz
     *-pci:3
          description: Host bridge
          product: K8 [Athlon64/Opteron] DRAM Controller
          vendor: Hynix Semiconductor (Hyundai Electronics)
          physical id: 103
          bus info: pci@0000:00:18.2
          version: 00
          width: 32 bits
          clock: 33MHz
     *-pci:4
          description: Host bridge
          product: K8 [Athlon64/Opteron] Miscellaneous Control
          vendor: Hynix Semiconductor (Hyundai Electronics)
          physical id: 104
          bus info: pci@0000:00:18.3
          version: 00
          width: 32 bits
          clock: 33MHz
          configuration: driver=k8temp
          resources: irq:0
root@debian:~#

grep . quantifiers. regular expressions.

commandline session

$ 4.2.20 10 510---> cat worked
Bubble sort
Selection sort
Insertion sort
Shell sort
Comb sort
Merge sort
Heapsort
Quicksort
Counting sort
 Bucket sort
 Radix sort
 Distribution sort
 Timsort
$ 4.2.20 11 511---> cat worked | grep -E ?sort
Bubble sort
Selection sort
Insertion sort
Shell sort
Comb sort
Merge sort
Heapsort
Quicksort
Counting sort
 Bucket sort
 Radix sort
 Distribution sort
 Timsort
$ 4.2.20 12 512---> cat worked | grep  ?sort
$ 4.2.20 13 513--->

$ 4.2.20 17 517---> echo "(555) 123-4567" | grep -E '^(?[0-9][0-9][0-9])? [0-9]
[0-9][0-9]$'
(555) 123-4567
$ 4.2.20 18 518---> echo "(555) 123-4567" | grep -E '^([0-9][0-9][0-9])? [0-9]
[0-9][0-9]$'
(555) 123-4567
$ 4.2.20 19 519---> echo "(555) 123-4567" | grep -E '^([0-9][0-9][0-9]) [0-9]
[0-9][0-9]$'
(555) 123-4567
$ 4.2.20 20 520--->


(java) bubble sort testing… 0.00002 Ver — 13 No.’s Related

$ 4.2.20 5 505---> time java BubbleSort

real	0m0.218s
user	0m0.160s
sys	0m0.040s
$ 4.2.20 6 506---> time java BubbleSort

real	0m0.214s
user	0m0.148s
sys	0m0.044s
$ 4.2.20 7 507---> time java BubbleSort

real	0m0.210s
user	0m0.140s
sys	0m0.052s
$ 4.2.20 8 508---> time java BubbleSort

real	0m0.206s
user	0m0.156s
sys	0m0.032s
$ 4.2.20 9 509---> time java BubbleSort

real	0m0.209s
user	0m0.152s
sys	0m0.036s
$ 4.2.20 10 510---> time java BubbleSort

real	0m0.394s
user	0m0.124s
sys	0m0.052s
$ 4.2.20 11 511---> time java BubbleSort

real	0m0.308s
user	0m0.128s
sys	0m0.016s
$ 4.2.20 12 512--->

POSIX character classes in relation to regular expressions

commandline session

$ 4.2.20 43 543---> export LANG=en_IN
$ 4.2.20 44 544---> ls Algorithms/[A-Z]*
Algorithms/filereading.c  Algorithms/wordmatch.c
$ 4.2.20 45 545---> export LANG=POSIX
$ 4.2.20 46 546---> echo $LANG
POSIX
$ 4.2.20 47 547---> locale
LANG=POSIX
LANGUAGE=en_IN:en
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
$ 4.2.20 48 548---> ls Algorithms/[A-Z]*
ls: cannot access Algorithms/[A-Z]*: No such file or directory
$ 4.2.20 49 549---> export LANG=en_IN
$ 4.2.20 50 550---> ls Algorithms/[A-Z]*
Algorithms/filereading.c  Algorithms/wordmatch.c
$ 4.2.20 51 551---> ls Algorithms/[[:upper:]]*
ls: cannot access Algorithms/[[:upper:]]*: No such file or directory
$ 4.2.20 52 552---> echo $LANG
en_IN
$ 4.2.20 53 553---> export LANG=POSIX
$ 4.2.20 54 554---> echo $LANG
POSIX
$ 4.2.20 55 555---> ls Algorithms/[[:upper:]]*
ls: cannot access Algorithms/[[:upper:]]*: No such file or directory
$ 4.2.20 56 556---> export LANG=en_IN
$ 4.2.20 57 557---> ls Algorithms/[[:upper:]]*
ls: cannot access Algorithms/[[:upper:]]*: No such file or directory
$ 4.2.20 58 558---> export LANG=en_IN
$ 4.2.20 59 559---> ls Algorithms/[A]*
ls: cannot access Algorithms/[A]*: No such file or directory
$ 4.2.20 60 560---> ls Algorithms/[A-Z]*
Algorithms/filereading.c  Algorithms/wordmatch.c
$ 4.2.20 61 561---> export LANG=POSIX
$ 4.2.20 62 562---> ls Algorithms/[A-Z]*
ls: cannot access Algorithms/[A-Z]*: No such file or directory
$ 4.2.20 63 563---> echo $LANG
POSIX
$ 4.2.20 64 564---> ls Algorithms/[[:lower:]]*
Algorithms/algorithm.c	Algorithms/filereading.c  Algorithms/wordmatch.c
$ 4.2.20 100 5100--->

grep . Traditional Character Ranges.

commandline session

$ 4.2.20 2 502---> cat worked
Bubble sort
Selection sort
Insertion sort
Shell sort
Comb sort
Merge sort
Heapsort
Quicksort
Counting sort
 Bucket sort
 Radix sort
 Distribution sort
 Timsort
$ 4.2.20 3 503---> grep -h '^[A-Z]' worked
Bubble sort
Selection sort
Insertion sort
Shell sort
Comb sort
Merge sort
Heapsort
Quicksort
Counting sort
$ 4.2.20 4 504---> grep -h '^[-AZ]' worked
$ 4.2.20 5 505---> grep -h '^[-IZ]' worked
Insertion sort
$ 4.2.20 6 506--->

How does bracket expression and negation [^ ] work with grep ?

commandline session

$ 4.2.20 19 519---> grep '[^b  ]sort' worked
Heapsort
Quicksort
 Timsort
$ 4.2.20 20 520---> cat worked
Bubble sort
Selection sort
Insertion sort
Shell sort
Comb sort
Merge sort
Heapsort
Quicksort
Counting sort
 Bucket sort
 Radix sort
 Distribution sort
 Timsort
$ 4.2.20 21 521--->

grep . bracket expressions [ ]

commandline session

$ 4.2.20 14 514---> grep '[bg]zip' worked
$ 4.2.20 15 515---> grep '[bg]sort' worked
$ 4.2.20 16 516---> grep '[b ]sort' worked
Bubble sort
Selection sort
Insertion sort
Shell sort
Comb sort
Merge sort
Counting sort
 Bucket sort
 Radix sort
 Distribution sort
$ 4.2.20 17 517---> grep '[b  ]sort' worked
Bubble sort
Selection sort
Insertion sort
Shell sort
Comb sort
Merge sort
Counting sort
 Bucket sort
 Radix sort
 Distribution sort
$ 4.2.20 18 518---> cat worked
Bubble sort
Selection sort
Insertion sort
Shell sort
Comb sort
Merge sort
Heapsort
Quicksort
Counting sort
 Bucket sort
 Radix sort
 Distribution sort
 Timsort
$ 4.2.20 19 519--->