Search:

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

Page 1 of 10 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    650

    Re: trying to learn c

    Database_open is not a pointer. It's a function that returns a pointer.

    char *f()
    From the identifier, f, Look right then left, then right then left and so on so: f is a function () whose return...
  2. Replies
    12
    Views
    10,186

    Re: Why does "hexdump" reverse bytes?

    A traditional hard drive has typically two or four read heads each scanning a different surface. Older examples may have eight so not having consecutive bits on the same drive platter is the norm....
  3. Re: Python not doing what I expect, no response. Help me, I`m new to Python

    As Euroman pointed out, the code might hang due to limitations of the available numerical precision and rounding behaviours of the system as a whole. It may run perfectly on your machine for all...
  4. [SOLVED] Re: Python regular expressions; en dashes between number ranges

    .
  5. Replies
    2
    Views
    633

    Re: Change FG color on label text

    self.label1.set_markup('<span foreground="red">label text</span>')

    All label text must be escaped html style e.g. < = &lt;
  6. Replies
    9
    Views
    24,635

    Re: Comparing floats for equality in Python

    You might find the fractions module useful.


    >>> from fractions import Fraction
    >>> Fraction(1.1) - Fraction(11, 10)
    Fraction(1, 11258999068426240)
  7. Thread: Idjc

    by StephenF
    Replies
    2
    Views
    398

    [ubuntu] Re: Idjc

    Run alsamixer in a console.

    Check the capture source is set to microphone and is unmuted.
  8. Replies
    15
    Views
    974

    Re: Doubt in pointer arithmetic, char** argv

    Overwriting string literals is not permitted by the language.


    char *sl1 = "foo";
    char *sl2 = "foo";
    strcpy(sl1, "bar"); // wrong
    sl1 = "bar"; // right

    String literals on some architectures...
  9. Replies
    4
    Views
    434

    Re: Question for the math majors out there

    Some computers will have the CPU throttle down when idle then go faster when under load. This is a power management feature which might explain why you get more efficiency in subsequent seconds.

    ...
  10. Replies
    10
    Views
    605

    [SOLVED] Re: Stuck in an if loop

    Going off on a tangent for non zero values of n: floor(log10(abs(n))) + 1
  11. Replies
    22
    Views
    1,644

    Re: Why does my program require sudo to run?

    stephen@tmb /tmp $ echo hi >/tmp/hi
    stephen@tmb /tmp $ cat /tmp/hi
    hi

    Wrong
  12. Replies
    5
    Views
    722

    [ubuntu] Re: Jack, Skype and IDJC

    The guides on the IDJC homepage are for the latest version of IDJC.

    What you want is the source code for the version you are using from sourceforge.net then point your web browser at...
  13. Replies
    4
    Views
    4,331

    [SOLVED] Re: Casting float to unsigned char

    Gleaned from your code this amused me.

    128 * 255 = 128 * 256 - 128

    Multiples of 256 cancel modulo 256 (modular arithmetic 101!)

    = 0 - 128 = (0 + 256) - 128 = 128
  14. Replies
    4
    Views
    4,331

    [SOLVED] Re: Casting float to unsigned char

    You are not using a float within the margins.
    128.0 * 255 = 32640.0

    Also, cout prints char variables as characters. If you need the value simply cast it to an int.
  15. Re: Why isn't there a static, compiled version of Python?

    Or something that isn't even a list.
  16. Replies
    4
    Views
    1,407

    [SOLVED] Re: GTK - sorting items in a combobox

    You want one of these I think.

    http://developer.gnome.org/pygtk/2.24/class-gtktreemodelsort.html


    Apply it to the liststore then apply the treemodelsort to the combobox widget instead using...
  17. Replies
    2
    Views
    1,291

    [ubuntu] Re: Sound set-up for broadcasting.

    The Ubuntu .10 releases use JACK2. The .04 releases use JACK1 which is generally less problematic. I guess you could wait for the next Ubuntu release.
  18. Replies
    13
    Views
    3,075

    [ubuntu] Re: internet dj console and icecast2

    The login is probably meant to be 'source'.
  19. Replies
    2
    Views
    3,156

    Re: PYTHON: list index out of range

    This program performs a binary search. If the data is not perfectly in order it can fail.


    #!/usr/bin/python3

    import itertools

    def checkvalue(val, matrix):
    """Perform a binary search...
  20. Replies
    10
    Views
    2,917

    [SOLVED] Re: Makefile shell Problem Question

    This script will run on any machine not just yours.



    a="" ; for f in $(find /lib -maxdepth 1 -name "libc*") ; do a="$a $f" ; done ; echo $a


    Outputs on my machine:
    /lib/libcrack.so.2.8.1...
  21. Replies
    10
    Views
    2,917

    [SOLVED] Re: Makefile shell Problem Question

    $f will expand from the Makefile variable rather than be fed literally to the subshell.
    Example Makefile.


    f = "hello"

    all:
    @f="goodbye" ; echo "$f $$f"
  22. Replies
    6
    Views
    3,468

    [SOLVED] Re: Exclude some matches with sed

    Wanting to know < wanting to learn. Here is your know.

    $ perl -pe 's|/sbin/(?!modprobe)|/usr/bin/|g' in.txt >out.txt

    sed < perl

    Here is the in-place version.

    $ perl -pi'.bak' -e...
  23. Replies
    6
    Views
    3,468

    [SOLVED] Re: Exclude some matches with sed

    You want a negative lookahead assertion.
  24. Replies
    4
    Views
    577

    [SOLVED] Re: Python script symplification

    $ awk -F: '{print $1}' /etc/passwd

    Quick and dirty.
  25. Replies
    2
    Views
    1,314

    Re: Python gtk3 Drag and drop

    Adapted from one of my programs:


    droptargets = [
    ('text/plain', 0, 0),
    ('TEXT', 0, 1),
    ('STRING', 0, 2),
    ('text/uri-list', 0, 3)
    ]
Results 1 to 25 of 250
Page 1 of 10 1 2 3 4