[SOLVED][bash] read and tab character

Hello archers!
I'm trying to write simple script for mysql query results parsing. And I got that `read` command "eats" tab-characters:
$ echo -e "foo\tbar\nbaz\tquuix\nfin" | while read L; do echo -e $L; done
foo bar
baz quuix
fin
i.e. tab characters were replaced with spaces.
So, I can't perform the following:
mysql -e "SELECT title,summary,body,added,modified FROM news" \
| while IFS=\t read TITLE SUMMARY BODY ADDED MODIFIED
do
echo $TITLE
done
How can I prevent such behavior?
Thanks!
Last edited by pshevtsov (2012-05-23 09:42:13)

pshevtsov wrote:
So, I can't perform the following:
mysql -e "SELECT title,summary,body,added,modified FROM news" \
| while IFS=\t read TITLE SUMMARY BODY ADDED MODIFIED
do
echo $TITLE
done
How can I prevent such behavior?
Thanks!
If you want to use \t as IFS you have to quote it
mysql -e "SELECT title,summary,body,added,modified FROM news" \
| while IFS=$'\t' read TITLE SUMMARY BODY ADDED MODIFIED
do
echo $TITLE
done

Similar Messages

  • [SOLVED] Surf-hg and tabbed-hg from aur fail to build

    Hi,
    I'm trying to install surf-hg and tabbed-hg from aur and when I makepkg -i this happens:
    ==> ERROR: A failure occurred in build().
    Aborting...
    I've tried to apply this patch to surf's config.mk but it fails anyway.
    diff -paur surf/config.mk surf.new/config.mk
    --- surf/config.mk 2012-01-29 11:46:00.851597838 +0100
    +++ surf.new/config.mk 2012-01-29 11:46:36.633503895 +0100
    @@ -15,7 +15,7 @@ GTKLIB = `pkg-config --libs gtk+-2.0 web
    # includes and libs
    INCS = -I. -I/usr/include -I${X11INC} ${GTKINC}
    -LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${GTKLIB} -lgthread-2.0
    +LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${GTKLIB} -lgthread-2.0 -ljavascriptcoregtk-1.0
    # flags
    CPPFLAGS = -DVERSION=\"${VERSION}\"
    Can anyone help me please?
    Last edited by whooper (2012-03-01 21:42:10)

    Yes they both fail to build, manually or with packer.
    I deleted the src directory but it still fails.
    packer -S surf-hg
    Aur Targets (1): surf-hg
    Proceed with installation? [Y/n] y
    Edit surf-hg PKGBUILD with $EDITOR? [Y/n] n
    ==> Determining latest hg revision...
    pulling from http://hg.suckless.org/surf
    searching for changes
    no changes found
    -> Version found: 238
    ==> Making package: surf-hg 238-1 (Thu Mar 1 00:27:47 WET 2012)
    ==> Checking runtime dependencies...
    ==> Checking buildtime dependencies...
    ==> Retrieving Sources...
    ==> Extracting Sources...
    ==> Removing existing pkg/ directory...
    ==> Entering fakeroot environment...
    ==> Starting build()...
    cleaning
    pulling from http://hg.suckless.org/surf
    searching for changes
    no changes found
    ==> ERROR: A failure occurred in build().
    Aborting...
    The build failed.

  • Partially [SOLVED] SD reader and touchpad won't work in AAO D260

    Hi people, I recently bought my new netbook with the shiny W7. Funny because the first thing I did is plugin in my Arch pen drive and wipe the entire HDD. I installed Arch easily and I could make work almost all of the hardware except the SD card reader and the touchpad.
    Actually, the touchpad does work but the synaptic features don't (two-finger scrolling, middle-click emulation, etc.). I've followed the instructions from the wiki but for some reason, it won't work.
    The SD card reader seems to be up, but when I insert a card in it, dmesg shows me this:
    usb 1-5: new high speed USB device using ehci_hcd and address 3
    hub 1-0:1.0: unable to enumerate USB device on port 5
    And there is no new block (sd*) apart from sda which is my HDD.
    If you want to know, this is the output of lspci:
    00:00.0 Host bridge: Intel Corporation Pineview DMI Bridge
    00:02.0 VGA compatible controller: Intel Corporation Pineview Integrated Graphics Controller
    00:02.1 Display controller: Intel Corporation Pineview Integrated Graphics Controller
    00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)
    00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)
    00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)
    00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02)
    00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02)
    00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02)
    00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)
    00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)
    00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
    00:1f.0 ISA bridge: Intel Corporation Tigerpoint LPC Controller (rev 02)
    00:1f.2 SATA controller: Intel Corporation 82801GR/GH (ICH7 Family) SATA AHCI Controller (rev 02)
    00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)
    01:00.0 Ethernet controller: Atheros Communications AR8152 v1.1 Fast Ethernet (rev c1)
    02:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)
    Ah, my Arch is 64bits but I don't think it makes any difference in these problems.
    Thanks in advance!
    Last edited by sironitomas (2011-01-31 01:29:45)

    whitethorn wrote:
    I think the problem you have with the touchpad is the same one I have.  I have an acer aspire one 721, the touchpad is a new alps touchpad. I haven't been able to get mine working yet. I've haven't spent much time on getting it to run.
    Have a look here maybe it'll help.
    https://bbs.archlinux.org/viewtopic.php?pid=250490
    My touchpad doesn't get identified as an alps touchpad.  It get identified as a PS/2 Generic Mouse
    Currently I'm trying to figure out why hibernate and suspend aren't working.  I'll follow your thread maybe someone has a clue.
    It must be the same touchpad. If you want to compare, below is the output of "hwinfo --mouse"
    33: USB 00.0: 10503 USB Mouse
    [Created at usb.122]
    Unique ID: FKGF.gRjmE_XIt35
    Parent ID: pBe4.v+N+B0xY+P6
    SysFS ID: /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0
    SysFS BusID: 2-1:1.0
    Hardware Class: mouse
    Model: "KYE Optical Mouse"
    Hotplug: USB
    Vendor: usb 0x0458 "KYE Systems"
    Device: usb 0x003a "Optical Mouse"
    Revision: "1.00"
    Compatible to: int 0x0210 0x0013
    Driver: "usbhid"
    Driver Modules: "usbhid"
    Device File: /dev/input/mice (/dev/input/mouse1)
    Device Files: /dev/input/mice, /dev/input/mouse1, /dev/input/event10, /dev/char/13:74, /dev/input/by-id/usb-Genius_Optical_Mouse-event-mouse, /dev/input/by-path/pci-0000:00:1d.0-usb-0:1:1.0-event-mouse, /dev/char/13:33, /dev/input/by-id/usb-Genius_Optical_Mouse-mouse, /dev/input/by-path/pci-0000:00:1d.0-usb-0:1:1.0-mouse, /dev/char/13:63
    Device Number: char 13:63 (char 13:33)
    Speed: 1.5 Mbps
    Module Alias: "usb:v0458p003Ad0100dc00dsc00dp00ic03isc01ip02"
    Driver Info #0:
    Buttons: 3
    Wheels: 1
    XFree86 Protocol: explorerps/2
    GPM Protocol: exps2
    Config Status: cfg=new, avail=yes, need=no, active=unknown
    Attached to: #26 (Hub)
    35: PS/2 00.0: 10500 PS/2 Mouse
    [Created at input.183]
    Unique ID: AH6Q.oV6xZUCQFf1
    Hardware Class: mouse
    Model: "ImPS/2 Generic Wheel Mouse"
    Vendor: 0x0002
    Device: 0x0005 "ImPS/2 Generic Wheel Mouse"
    Compatible to: int 0x0210 0x0013
    Device File: /dev/input/mice (/dev/input/mouse0)
    Device Files: /dev/input/mice, /dev/input/mouse0, /dev/input/event6, /dev/char/13:70, /dev/input/by-path/platform-i8042-serio-1-event-mouse, /dev/char/13:32, /dev/input/by-path/platform-i8042-serio-1-mouse, /dev/char/13:63
    Device Number: char 13:63 (char 13:32)
    Driver Info #0:
    Buttons: 3
    Wheels: 1
    XFree86 Protocol: explorerps/2
    GPM Protocol: exps2
    Config Status: cfg=new, avail=yes, need=no, active=unknown
    Could you get the SD card reader working? Here is the data from "hwinfo --redasd" as well. It seems the manufacter is MPX.
    01: IDE 00.0: 10600 Disk
    [Created at block.245]
    Unique ID: 3OOL.uvOtdmgvZE3
    SysFS ID: /class/block/sda
    SysFS BusID: 0:0:0:0
    SysFS Device Link: /devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0
    Hardware Class: disk
    Model: "Hitachi HTS54502"
    Vendor: "Hitachi"
    Device: "HTS54502"
    Revision: "PB2O"
    Driver: "ahci", "sd"
    Driver Modules: "ahci"
    Device File: /dev/sda
    Device Files: /dev/sda, /dev/block/8:0, /dev/disk/by-id/ata-Hitachi_HTS545025B9A300_100604PBN2033SDWG3HT, /dev/disk/by-id/scsi-SATA_Hitachi_HTS5450100604PBN2033SDWG3HT, /dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0, /dev/disk/by-id/wwn-0x5000cca5f4da9280
    Device Number: block 8:0-8:15
    BIOS id: 0x80
    Drive status: no medium
    Config Status: cfg=new, avail=yes, need=no, active=unknown
    02: SCSI 500.0: 10600 Disk
    [Created at block.245]
    Unique ID: uI_Q.rzrXVB8WAiE
    SysFS ID: /class/block/sdb
    SysFS BusID: 5:0:0:0
    SysFS Device Link: /devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/host5/target5:0:0/5:0:0:0
    Hardware Class: disk
    Model: "MPX Memory Slot - 1"
    Vendor: "MPX"
    Device: "Memory Slot - 1"
    Revision: "0.00"
    Driver: "usb-storage", "sd"
    Driver Modules: "usb_storage"
    Device File: /dev/sdb
    Device Files: /dev/sdb, /dev/block/8:16, /dev/disk/by-id/usb-MPX_Memory_Slot_-_1_MP600-0:0, /dev/disk/by-path/pci-0000:00:1d.7-usb-0:3:1.0-scsi-0:0:0:0
    Device Number: block 8:16-8:31
    BIOS id: 0x81
    Drive status: no medium
    Config Status: cfg=new, avail=yes, need=no, active=unknown
    03: SCSI 500.1: 10600 Disk
    [Created at block.245]
    Unique ID: LUEV.6sZ8Ft89QY2
    SysFS ID: /class/block/sdc
    SysFS BusID: 5:0:0:1
    SysFS Device Link: /devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/host5/target5:0:0/5:0:0:1
    Hardware Class: disk
    Model: "MPX Memory Slot - 2"
    Vendor: "MPX"
    Device: "Memory Slot - 2"
    Revision: "0.00"
    Driver: "usb-storage", "sd"
    Driver Modules: "usb_storage"
    Device File: /dev/sdc
    Device Files: /dev/sdc, /dev/block/8:32, /dev/disk/by-id/usb-MPX_Memory_Slot_-_2_MP600-0:1, /dev/disk/by-path/pci-0000:00:1d.7-usb-0:3:1.0-scsi-0:0:0:1
    Device Number: block 8:32-8:47
    BIOS id: 0x82
    Drive status: no medium
    Config Status: cfg=new, avail=yes, need=no, active=unknown
    Let me know if you have some info.

  • [SOLVED] Bash prompts and bell characters

    Hello
    This is kinda hard to explain, but I'll give a shot - with a couple of screenshots.
    Notice the terminal on the left, and also at the bottom.. whenever I type in a command (or paste from somewhere) that's longer than xx characters, and hit "END" to edit the command, it goes all the way to the start of the line - but visually it's leaving the character behind, so it's impossible to see where you're editing. I suppose it has something to do with my terminal size (even tho "fullscreen" in Xmonad).
    Other than that, I can't figure out why it does it, but it's really anoying.
    .Xdefaults
    http://codepad.org/U2VSyAUR
    Thanks for any help.
    Last edited by valvet (2010-11-07 18:30:05)

    linux-ka wrote:That's strange. I am using xmonad and rxvt-unicode-256color too, but there's no problem. I am running the current version of both of 'em. Have you upgraded xmonad/-contrib? or try to build your rxvt version on your own machine.
    Also, yes - my xmonad stuff should be up to date.
    Name : xmonad-darcs
    Version : 20101103-1
    URL : http://hackage.haskell.org/package/xmonad
    Licenses : custom:BSD3
    Groups : None
    Provides : None
    Depends On : gmp libxinerama ghc haskell-x11>=1.5.0.0 haskell-mtl
    Optional Deps : None
    Required By : xmonad-contrib-darcs
    Conflicts With : xmonad
    Replaces : None
    Installed Size : 4404.00 K
    Packager : Unknown Packager
    Architecture : i686
    Build Date : Wed 03 Nov 2010 11:13:51 PM CET
    Install Date : Wed 03 Nov 2010 11:14:03 PM CET
    Install Reason : Explicitly installed
    Install Script : Yes
    Description : A tiling window manager
    Name : xmonad-contrib-darcs
    Version : 20101103-1
    URL : http://hackage.haskell.org/package/xmonad-contrib
    Licenses : custom:BSD3
    Groups : None
    Provides : None
    Depends On : haskell-x11-xft xmonad-darcs
    Optional Deps : None
    Required By : None
    Conflicts With : xmonad-contrib
    Replaces : None
    Installed Size : 26100.00 K
    Packager : Unknown Packager
    Architecture : i686
    Build Date : Wed 03 Nov 2010 11:16:53 PM CET
    Install Date : Wed 03 Nov 2010 11:17:21 PM CET
    Install Reason : Explicitly installed
    Install Script : Yes
    Description : Third party extensions for xmonad
    Could you try with my Xdefaults file above, see if you can reproduce it? Also try using the font I am (Droid).
    Thanks
    Last edited by valvet (2010-11-07 02:04:57)

  • [solved] bash: difference `` and $()?

    Hey,
    i'm new to bash scripting but I'm using both of the syntaxes `` and $() quite often and they seem to do the same thing.
    I believe `` just evaluates and with $() i can do an array of evaluating sequences but i'm not sure and i didn't want to dig in too deep into some bash guides right now.
    Can you tell me where the difference is?
    Last edited by demian (2010-05-14 13:16:52)

    Trent wrote:I don't think $() is portable outside of bash.  That's what I've heard, anyway.
    $() is adopted and recommended by POSIX, so protability should not be a problem.
    Search for command substitution in google and see by yourself
    Last edited by eirika (2010-05-14 20:24:57)

  • [Solved] Bash scripting and sed substitution

    Hello!
    I am writing a script in order to substitute strings from one array to another one in texts.
    For only one case it is working as the following :
    sed '/ā/s/\(.*\)ā\(.*\)/\1a\21/g' temp.txt > temp2.txt
    which converts ā in a word by the same word with a normal "a" and the number 1 at the end of the word (māng > mang1)
    For many cases i've made some arrays and containing the rules in a srcipt file :
    # These are the 4 databases containing the strings that are suposed to be replaced
    data1[1]=ā
    data1[2]=ē
    data1[3]=ī
    data1[4]=ō
    data1[5]=ū
    data1[6]=ǖ
    data2[7]=á
    data2[8]=é
    data2[9]=í
    data2[10]=ó
    data2[11]=ú
    data2[12]=ǘ
    data3[13]=ǎ
    data3[14]=ě
    data3[15]=ǐ
    data3[16]=ǒ
    data3[17]=ǔ
    data3[18]=ǚ
    data4[19]=à
    data4[20]=è
    data4[21]=ì
    data4[22]=ò
    data4[23]=ù
    data4[24]=ǜ
    # This is the data base of output correspondances
    data[1]=a
    data[2]=e
    data[3]=i
    data[4]=o
    data[5]=u
    data[6]=ü
    count=1
    for base in {1..4} # For each database
    do
    for case in {1..6} # For each case
    do
    sed "/${data${base}[$count]}/s/\(.*\)${data${base}[$count]}\(.*\)/\1${data[$case]}\2$base/g" temp.txt > temp2.txt
    let "count+=1" #go to the next case in the database
    cat temp2.txt > temp.txt
    done
    done
    I have a substitution issue in the sed line. In fact I am trying to make a double substitution and it doesn't works.
    Like the first substitution ${data${base}[$count]} make 3 substitutions at a time… but I can't make it to work.
    In that case it would give me, for instance, the string contained in data2[3].
    I hope you understand what i mean. And i'd like to know how to deal with that substitution issue if you have an idea…
    Last edited by jiehong (2010-09-26 07:49:25)

    I've implemented what Procyon told in the part 2 and it's working with a small adaptation, which is great!!
    I've just an issue now because the number will go right after a word but at the end of the ligne… even if words are spaced by a space… like :
    hǎo
    hào
    wō wó wǒ wò wo
    become :
    hao3
    hao4
    wo wo wo wo wo1234
    my sed ligne is now :
    sed "/$(eval echo \$\{data$base[$count]\})/s/\(.*\)$(eval echo \$\{data$base[$count]\})\(.*\)/\1${data[$case]}\2$base/g" temp.txt > temp2.txt
    Last edited by jiehong (2010-09-25 20:27:57)

  • I have the latest Mac Air 13" and I have a Seagate 500MB external hard disk I cant copy or Cut any files on the hard disk and I cant even delete any files. I have the settings as Read and Write in the get info tab. Please help

    I have the latest Mac Air 13" and I have a Seagate 500MB external hard disk I cant copy or Cut any files on the hard disk and I cant even delete any files. I have the settings as Read and Write in the get info tab. Please helpand also note that my hard drive was formatted on a Windows 7 Laptop.

    thats the problem, its in MSDos (Fat) or NTFS for Windows.
    Options.....
    1. offload all that data on the HD onto your PC, THEN format the HD in EXFAT for use on BOTH PC and Mac for read/write.....then reload all (or as you need) that data back onto the HD
    2. get another HD, and format it for Mac OSX extended journaled.
    FAT32 (File Allocation Table)
    Read/Write FAT32 from both native Windows and native Mac OS X.
    Maximum file size: 4GB.
    Maximum volume size: 2TB
    You can use this format if you share the drive between Mac OS X and Windows computers and have no files larger than 4GB.
    NTFS (Windows NT File System)
    Read/Write NTFS from native Windows.
    Read only NTFS from native Mac OS X
    To Read/Write/Format NTFS from Mac OS X, here are some alternatives:
    For Mac OS X 10.4 or later (32 or 64-bit), install Paragon (approx $20) (Best Choice for Lion)
    Native NTFS support can be enabled in Snow Leopard and Lion, but is not advisable, due to instability.
    AirPort Extreme (802.11n) and Time Capsule do not support NTFS
    Maximum file size: 16 TB
    Maximum volume size: 256TB
    You can use this format if you routinely share a drive with multiple Windows systems.
    HFS+     ((((MAC FORMAT)))  (Hierarchical File System, a.k.a. Mac OS Extended (Journaled) Don't use case-sensitive)
    Read/Write HFS+ from native Mac OS X
    Required for Time Machine or Carbon Copy Cloner or SuperDuper! backups of Mac internal hard drive.
    To Read HFS+ (but not Write) from Windows, Install HFSExplorer
    Maximum file size: 8EiB
    Maximum volume size: 8EiB
    You can use this format if you only use the drive with Mac OS X, or use it for backups of your Mac OS X internal drive, or if you only share it with one Windows PC (with MacDrive installed on the PC)
    EXFAT (FAT64)    ------Can read/write from both PC and Mac
    Supported in Mac OS X only in 10.6.5 or later.
    Not all Windows versions support exFAT. 
    exFAT (Extended File Allocation Table)
    AirPort Extreme (802.11n) and Time Capsule do not support exFAT
    Maximum file size: 16 EiB
    Maximum volume size: 64 ZiB
    You can use this format if it is supported by all computers with which you intend to share the drive.  See "disadvantages" for details.

  • I have tried to install office for mac and an iWork trial and each time I go to install my "terminal" opens with the heading bash-80X24 and in the box reads Joel$-office installer.mpkg joel$ . nothing further happens

    I have tried to install office for mac and an iWork trial and each time I go to install after downloading my "terminal" opens with the
    heading
    bash-80X24 and
    in the box reads Joel$-office installer.mpkg joel$ .
    nothing further happens

    This is thread from Apple discussions.
    Look for the suggestion from Shootist007 towards the end of the 2nd page.
    It is just may be useful.
    https://discussions.apple.com/thread/3709115?start=15&tstart=0

  • [Solved] Bash and Floating point arithmetic

    I didn't realize how troublesome floating point numbers can be until now.
    What I want to do should be simple I dare say:
    properRounding( ( currentTime - downloadTime ) / ( dueTime - downloadTime ) * 100 )
    however best I've been able to achieve so far is this:
    echo "($currentTime-$downloadTime)/($dueTime-$downloadTime)*100" | bc -l
    Which prints the correct floating point value.
    I've tried to put the result in a variable, but I must be doing it wrong as I get the most peculiar error. I can live without it, but it would make life easier.
    As for the rounding, that is a must. I've read that if you remove the -l param from bc, then it will round, but in my case something goes wrong as I just get the value 0 in return and besides, concluded after a simple test, bc always rounds down as in integer division, which I can not use.
    So of course I'll continue reading and hopefully someday arrive at a solution, but I would very much appreciate if someone could lend me a hand.
    This after all is not just a learning experience, I'm trying to create something useful.
    Best regards.
    edit:
    nb:
    all variables are integers.
    Last edited by zacariaz (2012-09-09 14:50:18)

    Just for the fun of it, here's my progress thus far... Well, there really isn't much more to do. The rest is a conky thing.
    #!/bin/bash
    # Variables from unitinfo.txt - date as unix timestamps.
    dueTime="$(date +%s -d "$(grep 'Due time: ' ~/unitinfo.txt | cut -c11-)")"
    if [ "$1" = "end" ]
    then echo $dueTime
    fi
    downloadTime="$(date +%s -d "$(grep 'Download time: ' ~/unitinfo.txt | cut -c16-)")"
    if [ "$1" = "start" ]
    then echo $downloadTime
    fi
    progress="$(grep 'Progress: ' ~/unitinfo.txt | cut -c11-12 | sed 's/ *$//')"
    if [ "$1" = "prog1" ]
    then echo $progress
    fi
    # The rest
    #progress valued 0-1 for use with conky proress bars
    progress2=$( echo 2k $progress 100 / f | dc )
    if [ "$1" = "prog2" ]
    then echo $progress2
    fi
    # Current time - unix timestamp.
    currentTime="$(date +%s)"
    # Remaining time - unix timestamp
    remainingTime=$(( dueTime-$currentTime ))
    if [ "$1" = "remain" ]
    then echo $remainingTime
    fi
    # Elapsed time - unix timestamp
    elapsedTime=$(( currentTime-downloadTime ))
    if [ "$1" = "elap1" ]
    then echo $elapsedTime
    fi
    # Total amount of time available - unix timestamp
    totalTime=$(( dueTime-downloadTime ))
    if [ "$1" = "total" ]
    then echo $totalTime
    fi
    # How much time has elapsed in percent
    progress3="$(echo 3k $elapsedTime $totalTime / 100 \* 0k 0.5 + 1 / f | dc)"
    if [ "$1" = "elap2" ]
    then echo $progress3
    fi
    # Like the above bur 0-1
    progress4=$( echo 2k $progress3 100 / f | dc )
    if [ "$1" = "elap3" ]
    then echo $progress4
    fi
    # In percent, expected completion vs $dueTime - less than 100 is better.
    expectedCompletion="$( echo 3k $elapsedTime 10000 \* $progress / $totalTime / 0k 0.5 + 1 / f | dc )"
    if [ "$1" = "exp1" ]
    then echo $expectedCompletion
    fi
    # Same as above, but unix timestamp
    expectedCompletion2=$(( downloadTime+(expectedCompletion*totalTime/100) ))
    if [ "$1" = "exp2" ]
    then echo $expectedCompletion2
    fi
    #efficiency
    if [ "$1" = "ef1" ]; then
    if [ $progress -lt $progress3 ]
    then echo "you're behind schedule."
    elif [ $progress -eq $progress3 ]
    then echo "You're right on schedule."
    else
    echo "You're ahead of schedule."
    fi
    fi
    if [ "$1" = "ef2" ]; then
    if [ $expectedCompletion -gt 100 ]
    then echo "You're not going to make it!"
    else
    echo "You're going to make it!"
    fi
    fi

  • Urgent: Please help. how to solve the time delay during buffer read and write using vc++

    I need to continuously acquire data from daqmx card, write into a file and at the same time corelate (in terms of time) the data with signals from other instruments. The current problem is that there is time delay during read and write data into buffer,thus causing misalignment of the data from multiple instruments. Is there a way to solve  the delay? or Is there a way to mark the time of the data acquisition in the buffer?  If I know the starting time (e.g. 0) of data acquisition and sampling rate (e.g. 1kHz), can I simply add 1ms to each data sample in the buffer? The current code is shown below.
    void DataCollectionWin::ConnectDAQ()
    DAQmxErrChk(DAQmxCreateTask ("", &taskHandle));
        DAQmxErrChk(DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai0,Dev1/ai1,Dev1/ai2,Dev1/ai3,Dev1/ai4,Dev1/ai5,Dev1/ai16,Dev1/ai17,Dev1/ai18,Dev1/ai19,Dev1/ai20,Dev1/ai21,Dev1/ai6,Dev1/ai7,Dev1/ai22","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL));
      DAQmxErrChk(DAQmxCfgSampClkTiming(taskHandle,"",1000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,60000));
      DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(taskHandle,DAQmx_Val_Acquired_Into_Buffer,50,0,EveryNCallback,NULL));// Every 50 samples the EveryNSamplesEvent will be trigured, to reduce time delay.
      DAQmxErrChk (DAQmxRegisterDoneEvent(taskHandle,0,DoneCallback,NULL));
      DAQmxErrChk (DAQmxStartTask(taskHandle));
    int32 CVICALLBACK EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData)
     DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,50,10.0,DAQmx_Val_GroupByScanNumber,data,50*15,&read,NULL));
       //memcpy(l_data,data,6000);
      SetEvent(hEvent);
    l_usstatus_e[0]=g_usstatus[0];// signals from other instruments that need to be corelated with the data from daq cards.
     l_optstatus_e[0]=g_optstatus[0];
     if( read>0 ) // write data into file
       //indicator=1;
     for (i=0;i<read;i++)
     {  //fprintf(datafile,"%d\t",i);
      fprintf(datafile,"%c\t",l_usstatus_s[0]);
      fprintf(datafile,"%c\t",l_usstatus_e[0]);
            fprintf(datafile,"%c\t",l_optstatus_s[0]);
      fprintf(datafile,"%c\t",l_optstatus_e[0]);
              fprintf(datafile,"%.2f\t",data[15*i]);
     //   sprintf( pszTemp, "%f", data[6*i]);
     // pListCtrl->SetItemText(0, 2, pszTemp);
        //pWnd->m_trackinglist.SetItemText(0, 2, pszTemp);
         fprintf(datafile,"%.2f\t",data[15*i+1]);
         fprintf(datafile,"%.2f\t",data[15*i+2]);

    Hello kgy,
    It is a bit of a judgment call. You should just choose the board that you think has the most to do with your issue. For example, this issue was much more focused on setting up your data acquisition task than the Measurement Studio environment/tools, so the MultifunctionDAQ board would have been the best place for it. As for moving your post to another board, I do not believe that is possible.
    Regards,
    Dan King

  • In Files, How to read and write spaces,tabs and newlines

    Love..........
    After having read a file into a string, when
    I use this string in TextArea's setText()      
    method. Text Area do not care for spaces,tabs,
    newlines. if I print same string using println()
    out put has lines,spaces and tabs
    ----why-------
    Similarly when I write to a file getting text
    from Aextarea,out put file also produce same
    result .

    First, if you would like to create a text area that wraps the text, instead of just running on and on, you need to specify, when creating the text area, that you do not want a horizontal scroll bar. For instance:
    textArea = new TextArea("", 30, 60, TextArea.SCROLLBARS_VERTICAL_ONLY);
    Why does println() cause a newline? Because println means print line... as in, it will print the text, then give a carriage return and line feed value, causing a new line to be created.

  • Find a word and read until a character found

    Hi,
    I am trying to find a keyword in the string and read until a character is found. Given that the keyword is available in the string several times, so all found keywords will go into an array.
    In following example: I will look for keyword "module" and will read the sentence until a space (" ") found.
    Results:
    module=pngBasicInventory.dll
    module=pngNetComms.dll
    etc..will go into an array
    Any help please?
    date=May 29 06:56:29 severity=2 hostName=STPACCESS source=EventTransport module=pngnsagent.exe process=pngnsagent.exe pid=1888 thread=4780 tickCount=759631date=May 29 06:56:33 severity=2 hostName=STPACCESS source=BasicInventory module=pngBasicInventory.dll
    process=pngnsagent.exe pid=1888 thread=1928 tickCount=763890date=May 29 06:56:36 severity=2 hostName=STPACCESS source=pngNetworkTransport module=pngNetComms.dll process=pngnsagent.exe pid=1888 thread=1928 tickCount=766869date=May 29 06:56:36 severity=2 hostName=STPACCESS
    source=CoNetworkTransport(347) module=pngNetComms.dll process=pngnsagent.exe pid=1888 thread=1928 tickCount=766869date=May 29 06:56:36 severity=1 hostName=STPACCESS source=ConfigServer module=pngnsagent.exe process=pngnsagent.exe pid=1888 thread=1928 tickCount=766869date=May
    29 06:56:36 severity=4 hostName=STPACCESS source=ServerSettings module=pngnsagent.exe process=pngnsagent.exe pid=18 thread=1928 tickCount=766869date=May 29 06:56:36 severity=4 hostName=STPACCESS source=ScheduleEngine module=AgentScheduler.dll process=pngnsagent.exe
    pid=1888 thread=1960 tickCount=766932

    Assuming this is in a file, you can use this.
    #PowerShell V3+ approach
    $Keyword = "module"
    $Content = Get-Content .\list.txt
    [regex]::Matches($Content,"\b$Keyword\=\S+\b").value
    Or if running V2
    #PowerShell V2 approach
    $Keyword = "module"
    $Content = Get-Content .\list.txt
    [regex]::Matches($Content,"\b$Keyword\=\S+\b") | ForEach {$_.value}
    Boe Prox
    Blog |
    Twitter
    PoshWSUS |
    PoshPAIG | PoshChat |
    PoshEventUI
    PowerShell Deep Dives Book

  • [svn] 3313: Fix for SDK-16981 - @ param tag does not recognize tab character as delimiter between paramName and paramDescription

    Revision: 3313
    Author: [email protected]
    Date: 2008-09-23 10:02:50 -0700 (Tue, 23 Sep 2008)
    Log Message:
    Fix for SDK-16981 - @param tag does not recognize tab character as delimiter between paramName and paramDescription
    QA: Yes
    Doc:
    Tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-16981
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va

  • [SOLVED] urxvt colors and moc theme

    Hello!
    I am a KDE user and usually i am using Konsole. For some applications (like htop and moc) i use urxvt (patched version from AUR). The problem is in colors. When i launch moc in Konsole the theme colours are right but not in urxvt too. That happens with htop also. URxvt doesn't follow theme backrground color (uses its own) and foreground colors too.
    Here is my .Xresource file:
    ! urxvt
    ! URxvt*termName: string
    !URxvt*geometry: 80x40
    ! URxvt*chdir: string
    ! URxvt*reverseVideo: boolean
    ! URxvt*loginShell: boolean
    ! URxvt*jumpScroll: boolean
    ! URxvt*skipScroll: boolean
    ! URxvt*pastableTabs: boolean
    ! URxvt*scrollstyle: mode
    URxvt*scrollBar: false
    ! URxvt*scrollBar_right: boolean
    ! URxvt*scrollBar_floating: boolean
    ! URxvt*scrollBar_align: mode
    !URxvt*thickness: 20
    ! URxvt*scrollTtyOutput: boolean
    ! URxvt*scrollTtyKeypress: boolean
    ! URxvt*scrollWithBuffer: boolean
    ! URxvt*inheritPixmap: boolean
    ! URxvt*transparent: boolean
    ! URxvt*tintColor: color
    ! URxvt*shading: number
    ! URxvt*blurRadius: HxV
    ! URxvt*fading: number
    ! URxvt*fadeColor: color
    ! URxvt*utmpInhibit: boolean
    ! URxvt*urgentOnBell: boolean
    ! URxvt*visualBell: boolean
    ! URxvt*mapAlert: boolean
    ! URxvt*meta8: boolean
    ! URxvt*mouseWheelScrollPage: boolean
    ! URxvt*tripleclickwords: boolean
    ! URxvt*insecure: boolean
    ! URxvt*cursorUnderline: boolean
    ! URxvt*cursorBlink: true
    ! URxvt*pointerBlank: boolean
    URxvt*background: #171717
    URxvt*foreground: #B2B2B2
    URxvt*color0: #171717
    URxvt*color1: #3D3D3D
    URxvt*color2: #ffffff
    ! URxvt*color3: color
    ! URxvt*color4: color
    ! URxvt*color5: color
    ! URxvt*color6: color
    ! URxvt*color7: color
    ! URxvt*color8: color
    ! URxvt*color9: color
    ! URxvt*color10: color
    ! URxvt*color11: color
    ! URxvt*color12: color
    ! URxvt*color13: color
    ! URxvt*color14: color
    ! URxvt*color15: color
    ! URxvt*colorBD: color
    ! URxvt*colorIT: color
    ! URxvt*colorUL: color
    ! URxvt*colorRV: color
    ! URxvt*underlineColor: color
    ! URxvt*scrollColor: color
    ! URxvt*troughColor: color
    ! URxvt*highlightColor: color
    ! URxvt*highlightTextColor: color
    ! URxvt*cursorColor: color
    ! URxvt*cursorColor2: color
    ! URxvt*pointerColor: color
    ! URxvt*pointerColor2: color
    URxvt*borderColor: #171717
    URxvt.font: xft:Ubuntu Mono:size=11
    !URxvt*iconFile: /usr/share/icons/oxygen/128x128/apps/utilities-terminal.png
    ! URxvt*boldFont: fontname
    ! URxvt*italicFont: fontname
    ! URxvt*boldItalicFont: fontname
    ! URxvt*intensityStyles: boolean
    ! URxvt*inputMethod: name
    ! URxvt*preeditType: style
    ! URxvt*imLocale: string
    ! URxvt*imFont: fontname
    ! URxvt*title: string
    ! URxvt*iconName: string
    ! URxvt*saveLines: number
    ! URxvt*buffered: boolean
    URxvt*depth: 32
    ! URxvt*visual: number
    ! URxvt*transient-for: windowid
    ! URxvt*override-redirect: boolean
    ! URxvt*hold: boolean
    ! URxvt*externalBorder: 20
    ! URxvt*internalBorder: 7
    ! URxvt*borderLess: true
    ! URxvt*lineSpace: number
    ! URxvt*letterSpace: number
    ! URxvt*skipBuiltinGlyphs: true
    ! URxvt*pointerBlankDelay: number
    ! URxvt*backspacekey: string
    ! URxvt*deletekey: string
    ! URxvt*print-pipe: string
    ! URxvt*modifier: modifier
    ! URxvt*cutchars: string
    ! URxvt*answerbackString: string
    ! URxvt*secondaryScreen: boolean
    !URxvt*secondaryScroll: boolean
    ! URxvt*perl-lib: string
    ! URxvt*perl-eval: perl-eval
    ! URxvt*perl-ext-common: tabbed
    ! URxvt*perl-ext: string
    ! URxvt*iso14755: boolean
    ! URxvt*iso14755_52: boolean
    ! URxvt*xrm: string
    ! URxvt*keysym.sym: keysym
    ! URxvt*background.border: true
    ! URxvt*background.expr: string
    ! URxvt*background.interval: seconds
    ! URxvt*bell-command: string
    ! URxvt*matcher.button: string
    ! URxvt*matcher.launcher: string
    ! URxvt*matcher.launcher.*: string
    ! URxvt*matcher.pattern.*: string
    ! URxvt*matcher.rend.*: string
    ! URxvt*remote-clipboard.fetch: string
    ! URxvt*remote-clipboard.store: string
    ! URxvt*searchable-scrollback: string
    ! URxvt*selection-autotransform.*: string
    ! URxvt*selection-pastebin.cmd: string
    ! URxvt*selection-pastebin.url: string
    ! URxvt*selection.pattern-0: string
    ! URxvt*tab-bg: 1
    ! URxvt*tab-fg: 2
    ! URxvt*tabbar-bg: 0
    ! URxvt*tabbar-fg: colour
    ! URxvt*url-launcher: string
    Moc config file:
    # This is a configuration file for the MOC player. It should be named
    # 'config' and placed in the ~/.moc directory. As this file can specify
    # commands which invoke other applications, MOC will refuse to start if it
    # is not owned by either root or the current user, or if it is writable by
    # anyone other than its owner. All options are given with their default
    # values, and therefore commented.
    # Comments begin with '#'.
    # You can use quotes and escape ('\') in parameters.
    # You can have variable values substituted by enclosing the variable name
    # as "${...}". (This only applies to the portion of the option following
    # the ' ='.) Variables are substituted first from the environment then,
    # if not found, from the configuration options. (Note that the value of
    # a configuration option substituted is that which it has at the time the
    # substitution variable is encountered.) If there is a naming conflict
    # between an environment and configuration variable, you may be able to
    # resolve it by using lowercase as the environment variable matches are
    # case-sensitive whereas the configuration variables are not.
    # You can also use the form "${...:-...}" where the value in the second
    # position will be substituted if the variable name given in the first
    # position is unset or null.
    # So, for example:
    # MusicDir = /music/${USER:-public}
    # Fastdir1 = ${MusicDir}/mp3/rock
    # Fastdir2 = ${MusicDir}/mp3/electronic
    # Fastdir3 = ${MusicDir}/mp3/rap
    # Fastdir4 = ${MusicDir}/mp3/etc
    # Variable names are limited to those accepted by the BASH shell; that
    # is, those comprising the upper- and lowercase ASCII characters, digits
    # and the underscore.
    # If you need to use the "${" sequence for any other purpose, write "$${"
    # and it will be replaced by "${" and not treated as a substitution.
    # Some options take lists of strings as their values. The strings are
    # separated by colons. Additional strings can be appended to the list
    # using "+ =" in place of a plain "=" to assign the value. For an example,
    # see the XTerms option.
    # You can override any configuration option when you run MOC using the
    # '-O' command line option:
    # mocp -O AutoNext =no -O messagelingertime=1 -O XTerms+=xxt:xwt
    # This command line option can be repeated as many times as needed and
    # the configuration option name is not case sensitive. (Note that MOC
    # does not perform variable substitution on the value of such overridden
    # configuration options.) Most option values are set before the
    # configuration file is processed (which allows the new values to be
    # picked up by substitutions), however list-valued options are overridden
    # afterwards (which gives the choice of whether the configured values are
    # replaced or added to).
    # Remember that the client and server are separate processes and the
    # server will retain the configuration values formed from the environment
    # within which it was originally started.
    # Show file titles (title, author, album) instead of file names?
    #ReadTags = yes
    # In which directory do you store your music files? If you specify it
    # you will be able to jump straight to this directory with the '-m'
    # parameter or the 'm' command. This can also point to a playlist.
    # Example: MusicDir = "/home/joe/music"
    #MusicDir = "My folder"
    # Start in the music directory by default? If set to 'no', start
    # in the current directory by default. A single directory on
    # the command line takes precedence.
    #StartInMusicDir = no
    # How to sort? FileName is the option's only value for now.
    #Sort = FileName
    # Show errors in the streams (for example, broken frames in MP3 files)?
    #ShowStreamErrors = no
    # Ignore CRC errors in MP3 files? Most players do that, so the default
    # value is 'yes'.
    #MP3IgnoreCRCErrors = yes
    # Set playback toggles.
    #Repeat = no
    #Shuffle = no
    #AutoNext = yes
    # Default FormatString:
    # %n - Track number
    # %a - Artist
    # %A - Album
    # %t - Title
    # %(X:TRUE:FALSE) - Ternary expression: if X exists, do TRUE,
    # otherwise FALSE. The escape character must
    # be doubled (i.e., '\\'). (See zshmisc
    # documentation for more information.)
    #FormatString = "%(n:%n :)%(a:%a - :)%(t:%t:)%(A: \(%A\):)"
    # Input and output buffer sizes (in kilobytes).
    #InputBuffer = 512 # Minimum value is 32KB
    #OutputBuffer = 512 # Minimum value is 128KB
    # How much to fill the input buffer before playing (in kilobytes)?
    # This can't be greater than the value of InputBuffer. While this has
    # a positive effect for network streams, it also causes the broadcast
    # audio to be delayed.
    #Prebuffering = 64
    # Use this HTTP proxy server for internet streams. If not set, the
    # environment variables http_proxy and ALL_PROXY will be used if present.
    # Format: HTTPProxy = PROXY_NAME:PORT
    #HTTPProxy =
    # Sound driver - OSS, ALSA, JACK, SNDIO (on OpenBSD) or null (only for
    # debugging). You can enter more than one driver as a colon-separated
    # list. The first working driver will be used.
    #SoundDriver = JACK:ALSA:OSS
    # Jack output settings.
    #JackClientName = "moc"
    #JackStartServer = no
    #JackOutLeft = "system:playback_1"
    #JackOutRight = "system:playback_2"
    # OSS output settings.
    #OSSDevice = /dev/dsp
    #OSSMixerDevice = /dev/mixer
    #OSSMixerChannel1 = pcm # 'pcm', 'master' or 'speaker'
    #OSSMixerChannel2 = master # 'pcm', 'master' or 'speaker'
    # ALSA output settings.
    #ALSADevice = default
    #ALSAMixer1 = PCM
    #ALSAMixer2 = Master
    # Save software mixer state?
    # If enabled, a file 'softmixer' will be created in '~/.moc/' storing the
    # mixersetting set when the server is shut down.
    # Note that there is a "hidden" 'Amplification' setting in that file.
    # Amplification (0-200) is used to scale the mixer setting (0-100). This
    # results in a higher signal amplitude but may also produce clipping.
    #Softmixer_SaveState = yes
    # Save equalizer state?
    # If enabled, a file 'equalizer' will be created in '~/.moc/' storing the
    # equalizer settings when the server is shut down.
    # Note that there is a "hidden" 'Mixin' setting in that file.
    # Mixin (0.0-1.0) is used to determine how much of the original signal is
    # used after equalizing. 0 means to only use the equalized sound, while 1
    # effectively disabled the mixer. The default is 0.25.
    #Equalizer_SaveState = yes
    # Show files with dot at the beginning?
    #ShowHiddenFiles = no
    # Hide file name extensions?
    #HideFileExtension = no
    # Show file format in menu?
    #ShowFormat = yes
    # Show file time in menu? Possible values: 'yes', 'no' and 'IfAvailable'
    # (meaning show the time only when it is already known, which often works
    # faster).
    #ShowTime = IfAvailable
    # Show time played as a percentage in the time progress bar.
    #ShowTimePercent = no
    # Values of the TERM environment variable which are deemed to be xterms.
    #XTerms = xterm
    #XTerms + = xterm-colour:xterm-color
    #XTerms + = xterm-256colour:xterm-256color
    #XTerms + = rxvt:rxvt-unicode
    #XTerms + = rxvt-unicode-256colour:rxvt-unicode-256color
    #XTerms + = eterm
    # Theme file to use. This can be absolute path or relative to
    # /usr/share/moc/themes/ (depends on installation prefix) or
    # ~/.moc/themes/ .
    # Example: Theme = laras_theme
    Theme = yellow_red_theme
    # The theme used when running on an xterm.
    # Example: XTermTheme = transparent-background
    #XTermTheme = yellow_red_theme
    # Should MOC try to autoload the default lyrics file for an audio? (The
    # default lyrics file is a text file with the same file name as the audio
    # file name with any trailing "extension" removed.)
    #AutoLoadLyrics = yes
    # MOC directory (where pid file, socket and state files are stored).
    # You can use ~ at the beginning.
    #MOCDir = ~/.moc
    # Use mmap() to read files. mmap() is much slower on NFS.
    #UseMMap = no
    # Use MIME to identify audio files. This can make for slower loading
    # of playlists but is more accurate than using "extensions".
    #UseMimeMagic = no
    # Assume this encoding for ID3 version 1/1.1 tags (MP3 files). Unlike
    # ID3v2, UTF-8 is not used here and MOC can't guess how tags are encoded.
    # Another solution is using librcc (see the next option). This option is
    # ignored if UseRCC is set to 'yes'.
    #ID3v1TagsEncoding = WINDOWS-1250
    # Use librcc to fix ID3 version 1/1.1 tags encoding.
    #UseRCC = yes
    # Use librcc to filenames and directory names encoding.
    #UseRCCForFilesystem = yes
    # When this option is set the player assumes that if the encoding of
    # ID3v2 is set to ISO-8859-1 then the ID3v1TagsEncoding is actually
    # that and applies appropriate conversion.
    #EnforceTagsEncoding = no
    # Enable the conversion of filenames from the local encoding to UTF-8.
    #FileNamesIconv = no
    # Enable the conversion of the xterm title from UTF-8 to the local encoding.
    #NonUTFXterm = no
    # Remember the playlist after exit?
    SavePlaylist = yes
    # When using more than one client (interface) at a time, do they share
    # the playlist?
    #SyncPlaylist = yes
    # Choose a keymap file (relative to '~/.moc/' or using an absolute path).
    # An annotated example keymap file is included ('keymap.example').
    # Example: Keymap = my_keymap
    #Keymap =
    # Use ASCII rather than graphic characters for drawing lines. This
    # helps on some terminals.
    #ASCIILines = no
    # FastDirs, these allow you to jump directly to a directory, the key
    # bindings are in the keymap file.
    # Examples: Fastdir1 = /mp3/rock
    # Fastdir2 = /mp3/electronic
    # Fastdir3 = /mp3/rap
    # Fastdir4 = /mp3/etc
    #Fastdir1 =
    #Fastdir2 =
    #Fastdir3 =
    #Fastdir4 =
    #Fastdir5 =
    #Fastdir6 =
    #Fastdir7 =
    #Fastdir8 =
    #Fastdir9 =
    #Fastdir10 =
    # How fast to seek (in number of seconds per keystroke). The first
    # option is for normal seek and the second for silent seek.
    #SeekTime = 1
    #SilentSeekTime = 5
    # PreferredDecoders allows you to specify which decoder should be used
    # for any given audio format. It is a colon-separated list in which
    # each entry is of the general form 'code(decoders)', where 'code'
    # identifies the audio format and 'decoders' is a comma-separated list
    # of decoders in order of preference.
    # The audio format identifier may be either a filename extension or a
    # MIME media type. If the latter, the format is 'type/subtype' (e.g.,
    # 'audio/flac'). Because different systems may give different MIME
    # media types, any 'x-' prefix of the subtype is ignored both here and
    # in the actual file MIME type (so all combinations of 'audio/flac' and
    # 'audio/x-flac' match each other).
    # For Internet streams the matching is done on MIME media type and on
    # actual content. For files the matches are made on MIME media type
    # (if the 'UseMimeMagic' option is set) and on filename extension. The
    # MIME media type of a file is not determined until the first entry for
    # MIME is encountered in the list.
    # The matching is done in the order of appearance in the list with any
    # entries added from the command line being matched before those listed
    # here. Therefore, if you place all filename extension entries before
    # all MIME entries you will speed up MOC's processing of directories
    # (which could be significant for remote file systems).
    # The decoder list may be empty, in which case no decoders will be used
    # for files (and files with that audio format ignored) while Internet
    # streams will be assessed on the actual content. Any decoder position
    # may contain an asterisk, in which case any decoder not otherwise listed
    # which can handle the audio format will be used. It is not an error to
    # list the same decoder twice, but neither does it make sense to do so.
    # If you have a mix of audio and non-audio files in your directories, you
    # may wish to include entries at top of the list which ignore non-audio
    # files by extension.
    # In summary, the PreferredDecoders option provides fine control over the
    # type of matching which is performed (filename extension, MIME media
    # type and streamed media content) and which decoder(s) (if any) are used
    # based on the option's list entries and their ordering.
    # Examples: aac(aac,ffmpeg) first try FAAD2 for AACs then FFmpeg
    # mp3() ignore MP3 files
    # wav(*,sndfile) use sndfile for WAV as a last resort
    # ogg(vorbis,*):flac(flac,*) try Xiph decoders first
    # ogg():audio/ogg() ignore OGG files, and
    # force Internet selection by content
    # gz():html() ignore some non-audio files
    # Any unspecified audio formats default to trying all decoders.
    # Any unknown (or misspelt) drivers are ignored.
    # All names are case insensitive.
    # The default setting reflects the historical situation modified by
    # the experience of users.
    #PreferredDecoders = aac(aac,ffmpeg):m4a(ffmpeg)
    #PreferredDecoders += mpc(musepack,*,ffmpeg):mpc8(musepack,*,ffmpeg)
    #PreferredDecoders += sid(sidplay2):mus(sidplay2)
    #PreferredDecoders += wav(sndfile,*,ffmpeg)
    #PreferredDecoders += wv(wavpack,*,ffmpeg)
    #PreferredDecoders += audio/aac(aac):audio/aacp(aac):audio/m4a(ffmpeg)
    #PreferredDecoders += audio/wav(sndfile,*)
    # The following PreferredDecoders attempt to handle the ambiguity surrounding
    # container types such as OGG for files. The first two entries will force
    # a local file to the correct decoder (assuming the .ogg file contains Vorbis
    # audio), while the MIME media types will cause Internet audio streams to
    # be assessed on content (which may be either Vorbis or Speex).
    #PreferredDecoders += ogg(vorbis,ffmpeg):oga(vorbis,ffmpeg):ogv(ffmpeg)
    #PreferredDecoders += opus(opus,ffmpeg)
    #PreferredDecoders += spx(speex)
    #PreferredDecoders += application/ogg(vorbis):audio/ogg(vorbis)
    # Which resampling method to use. There are a few methods of resampling
    # sound supported by libresamplerate. The default is 'Linear') which is
    # also the fastest. A better description can be found at:
    # http://www.mega-nerd.com/libsamplerate/api_misc.html#Converters
    # but briefly, the following methods are based on bandlimited interpolation
    # and are higher quality, but also slower:
    # SincBestQuality - really slow (I know you probably have an xx GHz
    # processor, but it's still not enough to not see
    # this in the top output :) The worst case
    # Signal-to-Noise Ratio is 97dB.
    # SincMediumQuality - much faster.
    # SincFastest - the fastest bandlimited interpolation.
    # And these are lower quality, but much faster methods:
    # ZeroOrderHold - really poor quality, but it's really fast.
    # Linear - a bit better and a bit slower.
    #ResampleMethod = Linear
    # Always use this sample rate (in Hz) when opening the audio device (and
    # resample the sound if necessary). When set to 0 the device is opened
    # with the file's rate.
    #ForceSampleRate = 0
    # By default, even if the sound card reports that it can output 24bit samples
    # MOC converts 24bit PCM to 16bit. Setting this option to 'yes' allows MOC
    # to use 24bit output. (The MP3 decoder, for example, uses this format.)
    # This is disabled by default because there were reports that it prevents
    # MP3 files from playing on some soundcards.
    #Allow24bitOutput = no
    # Use realtime priority for output buffer thread. This will prevent gaps
    # while playing even with heavy load. The user who runs MOC must have
    # permissions to set such a priority. This could be dangerous, because it
    # is possible that a bug in MOC will freeze your computer.
    #UseRealtimePriority = no
    # The number of audio files for which MOC will cache tags. When this limit
    # is reached, file tags are discarded on a least recently used basis (with
    # one second resolution). You can disable the cache by giving it a size of
    # zero. Note that if you decrease the cache size below the number of items
    # currently in the cache, the number will not decrease immediately (if at
    # all).
    #TagsCacheSize = 256
    # Number items in the playlist.
    #PlaylistNumbering = yes
    # Main window layouts can be configured. You can change the position and
    # size of the menus (directory and playlist). You have three layouts and
    # can switch between then using the 'l' key (standard mapping). By default,
    # only two layouts are configured.
    # The format is as follows:
    # - Each layout is described as a list of menu entries.
    # - Each menu entry is of the form:
    # menu(position_x, position_y, width, height)
    # where 'menu' is either 'directory' or 'playlist'.
    # - The parameters define position and size of the menu. They can
    # be absolute numbers (like 10) or a percentage of the screen size
    # (like 45%).
    # - 'width' and 'height' can have also value of 'FILL' which means
    # fill the screen from the menu's position to the border.
    # - Menus may overlap.
    # You must describe at least one menu (default is to fill the whole window).
    # There must be at least one layout (Layout1) defined; others can be empty.
    # Example: Layout1 = playlist(50%,50%,50%,50%)
    # Layout2 = ""
    # Layout3 = ""
    # Just one layout, the directory will occupy the whole
    # screen, the playlist will have 1/4 of the screen size
    # and be positioned at lower right corner. (Note that
    # because the playlist will be hidden by the directory
    # you will have to use the TAB key to make the playlist
    # visible.)
    # Example: Layout1 = playlist(0,0,100%,10):directory(0,10,100%,FILL)
    # The screen is split into two parts: playlist at the top
    # and the directory menu at the bottom. Playlist will
    # occupy 10 lines and the directory menu the rest.
    #Layout1 = directory(0,0,50%,100%):playlist(50%,0,FILL,100%)
    #Layout2 = directory(0,0,100%,100%):playlist(0,0,100%,100%)
    #Layout3 = ""
    # When the song changes, should the menu be scrolled so that the currently
    # played file is visible?
    #FollowPlayedFile = yes
    # What to do if the interface was started and the server is already playing
    # something from the playlist? If CanStartInPlaylist is set to 'yes', the
    # interface will switch to the playlist. When set to 'no' it will start
    # from the last directory.
    #CanStartInPlaylist = yes
    # Executing external commands (1 - 10) invoked with key commands (F1 - F10
    # by default).
    # Some arguments are substituted before executing:
    # %f - file path
    # %i - title made from tags
    # %S - start block mark (in seconds)
    # %E - end block mark (in seconds)
    # Data from tags can also be substituted:
    # %t - title
    # %a - album
    # %r - artist
    # %n - track
    # %m - time of the file (in seconds)
    # The parameters above apply to the currently selected file. If you change
    # them to capital letters, they are taken from the file currently playing.
    # Programs are run using execv(), not a shell, so you can't do things like
    # redirecting the output to a file. The command string is split using blank
    # characters as separators; the first element is the command to be executed
    # and the rest are its parameters, so if you use "echo Playing: %I" we run
    # program 'echo' (from $PATH) with 2 parameters: the string 'Playing:' and
    # the title of the file currently playing. Even if the title contains
    # spaces, it's still one parameter and it's safe if it contains `rm -rf /`.
    # Examples: ExecCommand1 = "cp %f /mnt/usb_drive"
    # ExecCommand2 = "/home/joe/now_playing %I"
    #ExecCommand1 =
    #ExecCommand2 =
    #ExecCommand3 =
    #ExecCommand4 =
    #ExecCommand5 =
    #ExecCommand6 =
    #ExecCommand7 =
    #ExecCommand8 =
    #ExecCommand9 =
    #ExecCommand10 =
    # Display the cursor in the line with the selected file. Some braille
    # readers (the Handy Tech modular series ZMU 737, for example) use the
    # cursor to focus and can make use of it to present the file line even
    # when other fields are changing.
    #UseCursorSelection = no
    # Set the terminal title when running under xterm.
    #SetXtermTitle = yes
    # Set the terminal title when running under screen.
    #SetScreenTitle = yes
    # Display full paths instead of just file names in the playlist.
    #PlaylistFullPaths = yes
    # The following setting describes how block markers are displayed in
    # the play time progress bar. Its value is a string of exactly three
    # characters. The first character is displayed in a position which
    # corresponds to the time marked as the start of a block and the last
    # character to the time marked as the end of the block. The middle
    # character is displayed instead if both the start and the end of the block
    # would fall in the same position (within the resolution of the interface).
    # You can turn off the displaying of these block marker positions by using
    # three space characters.
    #BlockDecorators = "`\"'"
    # How long (in seconds) to leave a message displayed on the screen.
    # Setting this to a high value allows you to scroll through the messages
    # using the 'hide_message' key. Setting it to zero means you'll have to
    # be quick to see any message at all. Any new messages will be queued up
    # and displayed after the current message's linger time expires.
    #MessageLingerTime = 3
    # Does MOC display a prefix on delayed messages indicating
    # the number of queued messages still to be displayed?
    #PrefixQueuedMessages = yes
    # String to append to the queued message count if any
    # error messages are still waiting to be displayed.
    #ErrorMessagesQueued = "!"
    # Self-describing ModPlug options (with 'yes' or 'no' values).
    #ModPlug_Oversampling = yes
    #ModPlug_NoiseReduction = yes
    #ModPlug_Reverb = no
    #ModPlug_MegaBass = no
    #ModPlug_Surround = no
    # ModPlug resampling mode.
    # Valid values are:
    # FIR - 8 tap fir filter (extremely high quality)
    # SPLINE - Cubic spline interpolation (high quality)
    # LINEAR - Linear interpolation (fast, good quality)
    # NEAREST - No interpolation (very fast, extremely bad sound quality)
    #ModPlug_ResamplingMode = FIR
    # Other self-describing ModPlug audio characteristic options.
    # (Note that the 32 bit sample size seems to be buggy.)
    #ModPlug_Channels = 2 # 1 or 2 channels
    #ModPlug_Bits = 16 # 8, 16 or 32 bits
    #ModPlug_Frequency = 44100 # 11025, 22050, 44100 or 48000 Hz
    #ModPlug_ReverbDepth = 0 # 0 (quiet) to 100 (loud)
    #ModPlug_ReverbDelay = 0 # Delay in ms (usually 40-200ms)
    #ModPlug_BassAmount = 0 # 0 (quiet) to 100 (loud).
    #ModPlug_BassRange = 10 # Cutoff in Hz (10-100).
    #ModPlug_SurroundDepth = 0 # Surround level 0(quiet)-100(heavy).
    #ModPlug_SurroundDelay = 0 # Surround delay in ms, usually 5-40ms.
    #ModPlug_LoopCount = 0 # 0 (never), n (times) or -1 (forever)
    # Self-describing TiMidity audio characteristic options.
    #TiMidity_Rate = 44100 # Between 8000 and 48000
    #TiMidity_Bits = 16 # 8 or 16
    #TiMidity_Channels = 2 # 1 or 2
    #TiMidity_Volume = 100 # 0 to 800
    # You can setup a TiMidity-Config-File here.
    # Leave it unset to use library defaults (/etc/timidity.cfg mostly).
    # Setting it to 'yes' also uses the library defaults.
    # Set it to 'no' if you don't have any configuration file.
    # Otherwise set it to the name of a specific file.
    #TiMidity_Config =
    # Self-describing SidPlay2 audio characteristic options.
    #SidPlay2_DefaultSongLength = 180 # If not in database (in seconds)
    #SidPlay2_MinimumSongLength = 0 # Play at least n (in seconds)
    #SidPlay2_Frequency = 44100 # 4000 to 48000
    #SidPlay2_Bits = 16 # 8 or 16
    #SidPlay2_Optimisation = 0 # 0 (worst quality) to 2 (best quality)
    # Set path to a HVSC-compatible database (if not set, database is disabled).
    #SidPlay2_Database =
    # SidPlay2 playback Mode:
    # "M": Mono (best for many SIDs)
    # "S": Stereo
    # "L"/"R": Left / Right
    #SidPlay2_PlayMode = "M"
    # Use start-song information from SID ('yes') or start at first song
    # ('no'). Songs before the start-song won't be played. (Note that this
    # option previously took the values 1 and 0; these are now deprecated
    # in favour of 'yes' and 'no'.)
    #SidPlay2_StartAtStart = yes
    # Play sub-tunes. (Note that this option previously took the values 1
    # and 0; these are now deprecated in favour of 'yes' and 'no'.)
    #SidPlay2_PlaySubTunes = yes
    # Run the OnSongChange command when a new song starts playing.
    # Specify the full path (i.e. no leading '~') of an executable to run.
    # Arguments will be passed, and you can use the following escapes:
    # %a artist
    # %r album
    # %f filename
    # %t title
    # %n track
    # %d file duration in XX:YY form
    # %D file duration, number of seconds
    # No pipes/redirects can be used directly, but writing a shell script
    # can do the job.
    # Example: OnSongChange = "/home/jack/.moc/myscript %a %r"
    #OnSongChange =
    # If RepeatSongChange is 'yes' then MOC will execute the command every time
    # a song starts playing regardless of whether or not it is just repeating.
    # Otherwise the command will only be executed when a different song is
    # started.
    #RepeatSongChange = no
    # Run the OnStop command (full path, no arguments) when MOC changes state
    # to stopped (i.e., when user stopped playing or changes a song).
    #OnStop = "/home/jack/.moc/myscript_on_stop"
    # This option determines which song to play after finishing all the songs
    # in the queue. Setting this to 'yes' causes MOC to play the song which
    # follows the song being played before queue playing started. If set to
    # 'no', MOC will play the song following the last song in the queue if it
    # is in the playlist. The default is 'yes' because this is the way other
    # players usually behave. (Note that this option previously took the
    # values 1 and 0; these are now deprecated in favour of 'yes' and 'no'.)
    #QueueNextSongReturn = yes
    I read wiki but didn't find anything useful. Thanks for any info.
    Last edited by Shark (2014-12-17 12:31:30)

    bleach wrote:
    i see these
    URxvt*background: #171717
    URxvt*foreground: #B2B2B2
    URxvt*color0: #171717
    URxvt*color1: #3D3D3D
    URxvt*color2: #ffffff
    are not commented out
    3d3d3d is for red but you have a blackish and color2 is for green but you have it white the rest should be the default colors. it uses the same colors only it changes the vairiant of the color you choice there or normally moc uses colors such as green blue and such which will call your console colors for those respective fields I know moc has /user/share/moc/themes/ that you can edit or make your own for instance copy one and edit it. I think htop uses the same color count which is 8 but with so green will be white when you use urxvt. 8 for normal colors 16 for bright dark and urxvt is 256 which is 16 but can use any of the 256 colors for 16.
    just to clarify you have commented out your colors 4-15 and your green and red is weird, and htop aswell as moc is 8 bit. moc theme_yellow_red is default for background so it will use urxvts background
    Haahaha, that is simple. And it works!!!
    I didn't bother with commenting that because i thought they are not applied. Anyway, thanks man. My urxvt terminal si grateful to you and your thorough explanation. SOLVED!

  • I noticed when I restart Firefox 4, it opens my previous tabs even I set the option "Open a blank page" and it opens blank page when I have "Show my windows and tabs from last time". Please ignore my question if you're already aware of this issue. Thanks.

    I noticed when I restart Firefox 4, it opens my previous tabs even I set the option "Open a blank page" and it opens blank page when I have "Show my windows and tabs from last time". Please ignore my question if you're already aware of this issue. Thanks.

    Your previous tabs will not re-open or be available to re-open when starting Firefox if:
    *your previous session was in Private Browsing mode; see --> http://support.mozilla.org/en-US/kb/Private+Browsing
    *you use Clear Recent History (''Firefox button > History > Clear Recent History'' or ''Tools > Clear Recent History''); see --> https://support.mozilla.org/en-US/kb/Clear%20Recent%20History#w_how-do-i-clear-my-history
    *you clear History automatically when closing Firefox; see --> https://support.mozilla.org/en-US/kb/Clear%20Recent%20History#w_how-do-i-make-firefox-clear-my-history-automatically
    NOTE: Your third-party Plugins (Add-ons > Plugins) are not in the "Application Basics" (Troubleshooting Information) in the "More system details" of your original post. Third-party Plugins are categorized separately in "Installed Plugins" under "More system details". You should review but not change the Plugins as detected automatically by the software on this forum when posting a question.
    If you problem still exists after checking the above, the problem could be caused by one or more of your Extensions or Plugins:
    *See --> [http://support.mozilla.org/en-US/kb/Troubleshooting+extensions+and+themes Troubleshooting extensions and themes]
    *See --> [http://support.mozilla.org/en-US/kb/Troubleshooting+plugins Troubleshooting plugins]
    *See --> [http://support.mozilla.org/en-US/kb/Basic+Troubleshooting Basic Troubleshooting]
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

Maybe you are looking for

  • Getting BPM Deployement Exception

    Hi Experts, can you please help me in resolving the below issue we are getting while deploying the BPM. I have created the split mappings in PI and imported to BPM. While importing no issues occured . But while deploying  we are getting below error.

  • Will apple tv connect to scientific atlanta explorer 8300 hdc through hdmi?

    Will apple tv connect to scientific atlanta explorer 8300 hdc through hdmi cable?

  • Sdo.relate error

    Hello, I'm trying to select all points from POINTABLE that are within a polygon (AAAMAY00) that exist in a HDW_POLYGONS table. I'm using Oracle Spatial 8.1.5. and I'm using the following statement: select a.GEOM.SDO_point.x, a.GEOM.SDO_point.Y, a.DEP

  • WebService Endpoint URI expected not found endpoint with URI DigitalSignatu

    Dear Experts,      When we try to test webservice deployed  with wsdl  url http://satder:52000/DigitalSignature/ws?style=document in  ws navigater, getting the following  error The call fails with error 404 as shown below       Error : Web Service En

  • Tabs (JSPTabContainer) to call other URLs

    Hi, I have created several tabs using JSPTabContainer as my provider. Some of the tabs only requires link to internal application server so it is just like a URL link. Where can I modify the link? I tried looking under JSPTabContainer/tabs.jsp but I