Search:

Type: Posts; User: Snafuist

Page 1 of 13 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    58,042

    I'm having trouble understanding your problem....

    I'm having trouble understanding your problem. Please summarize the problem in one or two sentences while adhering to commonly accepted rules of English grammar.

    Greets,
    Philip
  2. From my own experience, I can confirm that...

    From my own experience, I can confirm that Graphviz is an extremely useful tool for graph visualization. I have tested several other tools, and just before I was about to give up and write my own, I...
  3. Replies
    64
    Views
    7,918

    Some bogus statements: This is a recursive...

    Some bogus statements:



    This is a recursive definition. "A string is something in which the string is stored". I like the following definition: a string is a null-terminated array of chars....
  4. Replies
    48
    Views
    219,930

    Poll: By the way, when I had to change the password for...

    By the way, when I had to change the password for my university account yesterday, the system reported "Error: password too long".

    How's that supposed to increase security?

    Greets,
    Philip
  5. Replies
    85
    Views
    11,768

    Now I have a very space efficient solution: the...

    Now I have a very space efficient solution: the length of an unsigned binary number x is determined by L = ceil(log2(x)) + 1. Hence, CHAR_BITS - L is what the OP is looking for.

    Somebody might...
  6. Replies
    85
    Views
    11,768

    It's detecting the least significant bit set, but...

    It's detecting the least significant bit set, but the OP wants to detect the most significant bit set.

    Greets,
    Philip
  7. Replies
    85
    Views
    11,768

    You're of course right, I should have been more...

    You're of course right, I should have been more explicit. A full lookup table is the most time efficient way to do it.

    Greets,
    Philip
  8. Replies
    85
    Views
    11,768

    Oops, you're right. I concluded that from his...

    Oops, you're right. I concluded that from his examples, but it is certainly not a requirement. In this case, my solution is crap :-)

    Greets,
    Philip
  9. Replies
    85
    Views
    11,768

    But your lookup table will waste memory, as it...

    But your lookup table will waste memory, as it will have 256 entries.

    Here's a proof-of-concept code that does (not quite) exactly what the OP wanted to achieve:



    int ffc(char c)
    {
    c = ~c;
  10. Replies
    85
    Views
    11,768

    Computing the number of trailing zeros takes...

    Computing the number of trailing zeros takes exactly 5 operations (independent of the size of the input number). Consider the following code (for computing the NTZ in 32 bits)



    unsigned int v; ...
  11. Replies
    85
    Views
    11,768

    Do a bitwise negation of the value and use my...

    Do a bitwise negation of the value and use my Computing Trailing Zeros HOWTO for a constant time check.

    Greets,
    Philip
  12. Replies
    13
    Views
    2,930

    You should look up finite state automata reading...

    You should look up finite state automata reading character by character. ;-)

    Greets,
    Philip
  13. Replies
    13
    Views
    2,930

    Some more hints: Here are some more URIs that...

    Some more hints:

    Here are some more URIs that you won't recognize (stolen from the German Wikipedia)

    ldap://[2001:db8::7]/c=GB?objectClass?one...
  14. Replies
    13
    Views
    2,930

    - your regexp catches a lot of invalid URLs, e.g....

    - your regexp catches a lot of invalid URLs, e.g. xyzxyzxyz://foo.com
    - a valid DNS name may end in ".", e.g. http://www.google.com./
    - URLs may contain username/password, e.g....
  15. Thread: 100000 women

    by Snafuist
    Replies
    36
    Views
    174,807

    Yesterday (May 26), the court which is...

    Yesterday (May 26), the court which is responsible for this area (Østre Landsret) decided the evacuation of Christiania.

    Makes me sad and angry.

    Greets,
    Philip
  16. Replies
    2
    Views
    1,218

    Note that both chess and Go are two-person zero...

    Note that both chess and Go are two-person zero sum games with full information. Hence, there's always an optimal algorithm. In particular, there's the Minimax-algorithm, which is always optimal, but...
  17. Thread: 100000 women

    by Snafuist
    Replies
    36
    Views
    174,807

    No, it's a nuanced slant in German as well. But...

    No, it's a nuanced slant in German as well. But the German mind is arguably more prone to spotting those nuances: in German, it's hard to formulate simple statements and not sound like a moron.


    ...
  18. Thread: 100000 women

    by Snafuist
    Replies
    36
    Views
    174,807

    Probably not. The test shows the correct...

    Probably not.

    The test shows the correct result in 99.99% of all cases. There are 10 pregnant women. 99.99% of 10 pregnant women is more or less 10 pregnant women.

    Greets,
    Philip
  19. Thread: 100000 women

    by Snafuist
    Replies
    36
    Views
    174,807

    No, the 20 with a positive result: 50% are...

    No, the 20 with a positive result:
    50% are pregnant and hence get a positive result
    50% are not pregnant, but get an incorrect and hence positive result

    Greets,
    Philip
  20. Thread: 100000 women

    by Snafuist
    Replies
    36
    Views
    174,807

    It's perfectly valid. The surprising answer is a...

    It's perfectly valid. The surprising answer is a result of the tricky question: it selects a very small subset of the original 100000 women, namely those 20 with a positive test result, and then asks...
  21. Thread: 100000 women

    by Snafuist
    Replies
    36
    Views
    174,807

    100000 women

    A funny example from probability calculus:

    Consider a set of 100000 women, all of which are regularly taking the birth control pill (probability of success: 99.99%). Furthermore, they all do a...
  22. Replies
    96
    Views
    21,082

    Poll: I use both: #2 for functions #1 for anything...

    I use both:

    #2 for functions
    #1 for anything else

    Citing from /usr/src/linux/Documentation/CodingStyle:



    Greets,
  23. Replies
    148
    Views
    17,232

    Poll: Send me a PM containing your email address. ...

    Send me a PM containing your email address.

    Does anybody else have the same problem?

    Greets,
    Philip
  24. Replies
    148
    Views
    17,232

    Poll: Valgrind on steroids sounds a like a great idea....

    Valgrind on steroids sounds a like a great idea. We may even implement array bounds checking.

    Greets,
    Philip

    PS: I suggest that we move the whole discussion to our new forum.
  25. Converting Pascal To C is wirth-less. Greets,...

    Converting Pascal To C is wirth-less.

    Greets,
    Philip
Results 1 to 25 of 314
Page 1 of 13 1 2 3 4