Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mansr
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
17 ms
·
121.
▲
by
mansr
15y ago
This is standard fare on trade shows. It is probably done, one hopes, not as much to outright mislead as to avoid embarrassing malfunctions on the show floor.
122.
▲
by
mansr
15y ago
The Tegra3 has an ARM CPU and (presumably) an Nvidia GPU. The announcement from ARM is about a new GPU in the MALI family. SoC designers are free to mix CPU and GPU from any vendors they choose. While ARM is currently by far the most popula
123.
▲
by
mansr
15y ago
AMD is not "moving up"; they do not dominate in any segment. Whatever ARM's outlook, a comparison with AMD is meaningless. As for fabs, IBM will gladly fab your ARM chip.
124.
▲
by
mansr
15y ago
Large parts of Europe have free university education and free medical care.
125.
▲
by
mansr
15y ago
They missed air travel too, even dismissing it.
126.
▲
by
mansr
15y ago
It seems to me like you've fallen in a well and are trying to get out by digging it deeper.
127.
▲
by
mansr
15y ago
People like the author of this should be banned from the Internet. Almost everything in that post is wrong or misleading. 1) In C, a struct maps to memory A struct maps to memory, sure, but not in a defined way. For popular machine archi
128.
▲
by
mansr
15y ago
I presume this service is only targeting the USA. Here in Europe, any bank will do immediate domestic transfers for free.
129.
▲
by
mansr
15y ago
This is not valid C99. In C99, arrays must have at least one element. Also, what is err.h? Whatever it is, it is not C99. As for speed, if asprintf() does something clever to avoid rendering the string twice, this is actually slower unle
130.
▲
by
mansr
15y ago
That will only set as many bits as are in an int, which is wrong if the type of the variable you are setting is wider than int. For a long, you could of course use ~0ul, and so on for other types, but then you'd have to find and update eve
131.
▲
by
mansr
15y ago
I wonder why "long long" is 40 bits? The immediate reason is that the ALU is 40 bits wide. The reason it has this particular size is probably a tradeoff between computational power vs silicon area and power consumption. A non-function-p
132.
▲
by
mansr
15y ago
The Texas Instruments C55x DSP has 16-bit bytes. See the compiler documentation at http://www.ti.com/litv/pdf/spru281f section 5.3 if you do not believe me. This DSP has more unusual properties: type size (bits) -----
133.
▲
by
mansr
15y ago
Your logging example is invalid. A variadic macro must be invoked with at least one argument matching the ellipsis. GCC is forgiving here, but some other compilers are not.
134.
▲
by
mansr
15y ago
Even with 8-bit bytes, the layout of the bit-fields is unspecified. Using char as the declared type of a bit-field is also not defined by the standard (although may be supported by an implementation).
135.
▲
by
mansr
15y ago
This construct does not depend on byte order since both sides are using the same (unsafe) type-punning.
136.
▲
by
mansr
15y ago
That is a gcc extension. The construct as a whole has the value of the last statement executed within. Usually an inline function is preferable since it achieves the same thing using only standard syntax.
137.
▲
by
mansr
15y ago
Extensions have occasionally been dropped from gcc, sometimes because of conflicts with updated standards, sometimes for other reasons.
138.
▲
by
mansr
15y ago
The -E flag is specified by POSIX. Non-POSIX compilers sometimes support it, sometimes not.
139.
▲
by
mansr
15y ago
That's all very well, except that it's wrong. The last line needs to do "(buffer + mask) & ~mask" or you'll end up pointing outside the array. You also violated the C standard in a less severe way. According to the standard, any ident
140.
▲
by
mansr
15y ago
There are much more subtle differences that will wreak total havoc without the compiler emitting a single squeak. For example, compare this compiled as C or C++: #include <stdio.h> int foo; int main(void) { st
141.
▲
by
mansr
15y ago
It's an old gcc extension. Don't use it.
142.
▲
by
mansr
15y ago
I have run into errors caused by weird uses of inline, I think it was with the MIPSpro compiler, in code happily swallowed by gcc.
143.
▲
by
mansr
15y ago
Range initialisers are a gcc extension. They should not be used in portable code.
144.
▲
by
mansr
15y ago
In your first example you must take care not to run afoul of alignment or aliasing rules. This is not always easy. Using "extern inline" is a bad idea since no two compilers implement it the same way and none according to spec (that I know
145.
▲
by
mansr
15y ago
No. ~0 has type signed int, which on a one's complement machine is a negative zero. Converting this to an unsigned type yields zero. On a sign-magnitude machine, ~0 is -0x7fffffff (assuming 32-bit for simplicity). Conversion to unsigned
146.
▲
by
mansr
15y ago
And if it is not a power of 2, the % operation will be anything but fast. If a size not a power of 2 is strictly required, a simple increment and compare is almost certainly faster.
147.
▲
by
mansr
15y ago
I think you meant int value = c - '0'; Also, remember that sizeof("string") includes the null terminator while strlen() does not.
148.
▲
by
mansr
15y ago
A C programmer posting that kind of nonsense is even more stupid than a non-C programmer doing it.
149.
▲
by
mansr
15y ago
The author of that (badly timed, btw) post probably does not know that Python is implemented in C.
150.
▲
Integer Overflow Checker
(embed.cs.utah.edu)
4 points
by
mansr
15y ago
|
0 comments
More ›