Search:

Type: Posts; User: stroyan; Keyword(s):

Page 1 of 10 1 2 3 4

Search: Search took 0.04 seconds; generated 52 minute(s) ago.

  1. Replies
    3
    Views
    4

    Re: application code error

    The original question was posted back in Februrary, before 22.04 was released.
    The problem may have gone away when upgrading to 22.04, which is listed in cmcanulty's current profile.
    It looks like...
  2. [SOLVED] Re: How would I determine where a filesystem is mounted in bash?

    You can use "${BASH_SOURCE[0]}" to get the file that bash is reading the script from.
    You may want to then follow symlinks with "readlink -f" and
    strip off the file name with "dirname".
    ...
  3. Re: who automatically starts syndaemon in karmic 9.10?

    It is actually started by gnome-settings-daemon.
    But you can disable that copy of syndaemon from being started.
    Use the "System" menu.
    Choose "Preferences" and "Mouse".
    Switch to the "Touchpad"...
  4. Replies
    2
    Views
    240

    Re: How to search the table bash

    You can use the bash "[[ ]]" test and the "=~" operator.


    #!/bin/bash
    array=("c211z091009" "c212z091029" "c213z091011" "c214z091012" "c215z091013"
    "c216z091014" "c217z091015" "c217z091016")...
  5. Replies
    5
    Views
    19,578

    Re: multiplying and dividing hexadecimal numbers

    If the hex digit multiplication tables are too big for comfort, you could easily convert from hex to binary and back. Then the multiplication and long division operations are very simple. But you...
  6. Replies
    7
    Views
    1,807

    Re: Moderately complex java program question

    The java double type is a 64 bit floating point number using IEEE standard types.
    http://en.wikipedia.org/wiki/IEEE_754-2008
    The representation is actually a binary number with 53 bits of precision...
  7. Replies
    2
    Views
    365

    Re: How to solve this problem with sed

    Assuming that the targets that you want to change all consist of alphanumeric characters and periods followed by an optional group of spaces and a colon, use-

    sed -e 's/^[[:alnum:].]\+...
  8. Re: Where to start in order to learn how to program an Emulator?

    You get very familiar with a system by digging around collectors' groups and assorted garages for original developer's documentation.
    (Somebody had to design that system and the games for it.)
    And...
  9. Replies
    10
    Views
    9,576

    Re: How can I get a list of open windows?

    It is listing many unmapped windows.
    You can look at get_attributes and check for a map_state value of X.IsViewable.
    You can also see more about windows that are transient for other windows, such...
  10. Re: Find out how long an X session has been idle?

    It seems that the gnome dbus method reports the time since gnome decided the screen was idle.
    That varies with the gnome screensaver time setting.
    This reports a 2 second idle time. But it turns...
  11. Replies
    2
    Views
    1,456

    Re: syntax highlighting in terminal

    You could try vimpager.
    It is a vim wrapper that uses vim to act like less, with the addition of vim's color syntax highlighting.
    http://www.vim.org/scripts/script.php?script_id=1723
  12. Re: Ideas on how to extract variables from filenames for a bash script

    You can use bash alone to parse strings.
    Here is an example that uses read and ${Var:Offset:Length} to parse them.


    #!/bin/bash
    for f in *.bmp
    do
    read j d t<<<"$f"
    t=${t:0:8}
    ...
  13. Re: Multi-threaded SHA512 checksum supporting sub-directories

    You can use sysconf() to inquire the number of processors in linux.
    While sysconf() is posix standard, the feature that reports processor counts is not standard.


    #include <stdio.h>
    #include...
  14. Re: How do I concatenate a defines and a string in the C Programming Language

    You can just put two string constants next to eachother to concatenate them.


    #define CONFIG_PATH "/etc/openvpn/conf"

    glob_t gl;

    /* These three lines are equivalent. */...
  15. Replies
    10
    Views
    13,956

    Re: ld cannot find -l(library)

    True. librt pulls in libpthread, so linking with it works.
    But libpthread actually provides the pthread functions.
  16. Replies
    4
    Views
    351

    Re: update window title

    The gnome-terminal documentation is very weak at covering escape sequences.
    The best approach is to look at the xterm escape sequences.
    gnome-terminal attempts to match xterm (unless a feature has...
  17. Replies
    4
    Views
    351

    Re: update window title

    You can just echo an escape sequence to set a gnome-terminal title.
    These title changes will go by too quickly to see them all.
    You could add a sleep command if you want to slow them down.

    ...
  18. Replies
    10
    Views
    13,956

    Re: ld cannot find -l(library)

    The pthread functions are in "-lrt".
    The semaphore functions such as semget and semop are in libc, "-lc".
    It is really odd that your linking is not getting libc functions.
    I see that you link...
  19. Replies
    1
    Views
    2,863

    Re: Errors making Synergy

    The error is probably caused by a missing build dependency.
    It is best to use apt-get and debuild to build a package.
    Add this line to /etc/apt/sources.list, (if it is not already present.)...
  20. Replies
    14
    Views
    3,858

    Re: `expr` shell script problem

    Have a look at http://manpages.ubuntu.com/manpages/hardy/man1/bash.1.html#toptoc11 under Arithmetic Expansion.
  21. Replies
    14
    Views
    3,858

    Re: `expr` shell script problem

    "man bash" does warn that-
    "The old format $[expression] is deprecated and will be removed in upcoming versions of bash."
  22. Re: A question about the system call mount in a C program

    I would not expect the "rw,nosuid,nodev" options to be parsed from the data parameter string. They are bits in the mountflags parameter.


    if (mount("/dev/sdg1", "/media/flashCorsaire/",...
  23. Replies
    14
    Views
    3,858

    Re: `expr` shell script problem

    In bash you can use

    let b=$b+1
    or
    let b+=1
    or
    b=$(($b+1))
    or
    ((b+=1))
  24. Replies
    3
    Views
    1,274

    Re: Formatting numbers with printf

    You could use the bash ${v%pattern} feature to remove the trailing "." and "0"s.
    You need to control the locale to make sure printf does thousands grouping.

    p ()
    {
    local...
  25. Replies
    2
    Views
    1,158

    Re: Bash declare command

    The "declare" or "typeset" builtin is seldom used except when it is needed to give a variable an attribute.
    If you want to you could declare all variables as a style requirement.
    The declare...
Results 1 to 25 of 250
Page 1 of 10 1 2 3 4