You might consider the int_fastN_t types a sort of spiritual successor to this with fewer downsides since they purposefully guarantee a minimum width.
1,171 karma · joined October 17, 2011
You might consider the int_fastN_t types a sort of spiritual successor to this with fewer downsides since they purposefully guarantee a minimum width.
I wonder if typeof in c23 has changed this at all. Previously there was no sense in defining an anonymous struct as a function's return type. You could do it, but those structs would not be compatible with anything. With typeof maybe that's no longer the case.
e.g. with clang 16 and gcc 13 at least this compiles with no warning and g() returns 3. But I'm not sure if this is intended by the standard or just happens to work.
struct { int a; int b; } f() {
return (typeof(f())){1,2};
}
int g() {
typeof(f()) x = f();
return x.a + x.b;
}
edit: though I suppose this just pushes the problem onto callers, since every function that does this now has a distinct return type that can only be referenced using typeof(yourfn).Did you have any questions in particular?
The site contained a pretty amazingly comprehensive detailing of the game's mechanics and various algorithms scattered throughout the articles, to the point where it seemed to me like it'd be possible to implement a lot of the game's engine using it.
Some good examples of the more detailed articles:
The economy https://community.simtropolis.com/omnibus/other-games/the-ec...
Land value specifics https://community.simtropolis.com/omnibus/other-games/land-v...
Traffic and transportation specifics https://community.simtropolis.com/omnibus/other-games/traffi...
Zone development rules https://community.simtropolis.com/omnibus/other-games/zone-d...
void *x = malloc(...);
free(x);
if(x); // undefined behavior
Note that this isn't about dereferencing x after free, which is understandably not valid. Rather the standard specifies that any use of the pointer's value itself is undefined after being used as an argument to free, even though syntactically free could not have altered that.This special behavior is also specifically applied to FILE* pointers after fclose() has been called on them.
If there is some historical reason / architecture that could explain this part of the specification I would be interested to hear the rationale, this has been present in mostly the same wording since C89.
clang --analyze --analyzer-output text ...
Will print the entire analysis tree in the same format as regular diagnostics.There was an analysis of this and the C++11 lambda specification done shortly after at http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1483.htm, but it was inconclusive and there doesn't seem to have been any followup since then.
void f(char (*n)[255]);
char array[6];
f(&array);
warns of "incompatible pointer types passing 'char (* )[6]' to parameter of type 'char (* )[255]'"This won't produce a diagnostic for f(NULL) like "static" does, but does have two properties that might be considered benefits:
1) The length is exact rather than a minimum.
2) The type of "* n" is still char[255], whereas a char[static 255] parameter is still a decayed pointer-to-char. Thus with the former sizeof(* n) behaves as expected inside of "f", yielding 255.
These are true of the array-in-struct method as well.
Since this as a whole is among the least consistently implemented and (arguably based on the number of questions it generates) least well understood aspects of the standard it's nice to see some authoritative efforts to clarify the intended behaviors.
- Supply multiple makefiles targeting different implementations
- Bring in autotools in all its glory (at this point you are depending on an external GNU package anyway)
- Or explicitly target GNU Make, which is the default make on Linux and macOS, is very commonly used on *BSD, and is almost certainly portable to every platform your software is going to be tested and run on. The downside being that BSD users need a heads up before typing "make" to build your software. But speaking as a former FreeBSD user, this is pretty easy to figure out after your first time seeing the flood of syntax errors.
The name re-use was a bit confusing.
This was true of gif until the mid 2000s, well after it became popular.
So this does not do anything to manage different sessions clobbering each others' histories. The solution posted by zootboy will work together with this script however.
It's extremely simple but it allows me to do things like plot a color coded calendar of app usage, which can provide very revealing info about things like productivity spikes and lulls or sleep schedules.
I have a companion Safari extension for tracking active tabs which I did not release since it seemed like such a niche and strange thing to use, but the main code to do that is simply https://gist.github.com/0x09/d1220a7b0a0bda64b4f542067cd43ec...
USB-C to DisplayPort -> DisplayPort to HDMI -> Monitor - doesn't work
USB-C to DisplayPort -> DisplayPort to DVI-D -> Monitor - doesn't work
USB-C to Ethernet - doesn't work
I'm actually planning to just go to Best Buy today and try to find anything that will let me plug this into my old monitor here even if it has to be the official USB-C to VGA cable from Apple since I don't have time to wait for shipping at this point.
I suppose this is my own fault but somehow I've never had this kind of problem in ~20 years of using a computer.
Edit: There are also currently very few resources about compatibility between all these new adapters and Apple hasn't done anything to help in their spec info so it's really just a guessing game right now.
Edit: I emphasize this mainly because the terms have a specific meaning in standards jargon but also because it places the blame for software patent abuses on the wrong parties (the standards developers rather than the lawyers and legislators).
How certain?
http://appft.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=H...
wyager accurately described why in terms of the DCT though -- cosines naturally "ring" and the only way a non-sinusoid can be represented is through the combination of many other terms, so any time a coefficient contributing to this shape is eliminated, the structure "decays" so to speak and the underlying sinusoids become part of the reconstruction.
http://port70.net/~nsz/c/c11/n1570.html
http://port70.net/~nsz/c/c11/n1570.pdf
http://stackoverflow.com/questions/tagged/c
A good way to casually browse SO for interesting information is filtering by questions in the last <time period> and ordering by votes.
http://stackoverflow.com/search?tab=votes&q=%5bc%5d%20is%3aq...
float* samples = ... //load audio samples here
int len = ...
fftwf_plan p = fftwf_plan_r2r_1d(len,samples,samples,FFTW_REDFT10,FFTW_ESTIMATE);
fftwf_execute(p);
RDResolution* res;
size_t count;
RDMethod* m = resdet_methods();
m->func(samples,len,1,1,&res,&count,12,m->threshold);Usually multiple results are a misdetection -- for example heavily compressed JPEGs will mess it up pretty badly:
$ convert Lenna.png -quality 50 Lenna.jpg
$ resdet Lenna.jpg
given: 512x512
best guess: 448x384
all width height
448 (77.49%) 384 (90.19%)
384 (66.99%) 448 (89.78%)
320 (60.68%) 320 (72.54%)
388 (55.92%) 256 (56.43%)
445 (55.49%)
345 (55.47%)
242 (55.06%)
(the block-based nature of JPEG compression/quantization creates a similar zeroing effect along every 1/8 of the spectrum)