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
Type: Posts; User: Snafuist
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
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...
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....
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
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...
It's detecting the least significant bit set, but the OP wants to detect the most significant bit set.
Greets,
Philip
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
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
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;
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; ...
Do a bitwise negation of the value and use my Computing Trailing Zeros HOWTO for a constant time check.
Greets,
Philip
You should look up finite state automata reading character by character. ;-)
Greets,
Philip
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...
- 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....
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
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...
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.
...
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
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
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...
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...
I use both:
#2 for functions
#1 for anything else
Citing from /usr/src/linux/Documentation/CodingStyle:
Greets,
Send me a PM containing your email address.
Does anybody else have the same problem?
Greets,
Philip
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.
Converting Pascal To C is wirth-less.
Greets,
Philip