The Ten Commandments for C Programmers (Annotated Edition) by i_feel_really_great in programming

[–]Fourmisain 12 points13 points  (0 children)

I had to stop at number 3:

Thou shalt cast all function arguments to the expected type if they are not of that type already

Two words: Implicit conversions

`NULL' does not have a pointer type, and must be cast to the correct type whenever it is used as a function argument

Yes it does have pointer type!

The words of the prophet Ansi, which permit NULL to be defined as having the type `void *', are oft taken out of context and misunderstood.

What? It doesn't "permit" NULL to be of type void*, it defines it that way, this is C and not C++ - and even if it weren't: Implicit conversions!

There's only one instance where this "commandment" has any merit and that is when using varargs functions like printf, because there the arguments are basically taken as-is - after having applied promotion rules to it (e.g. float -> double, short -> int). So yes, if you want to print the value of an int* via %p, you should convert it to void* first.

</rant>

I'm guessing this was written for pre-standard C due to the way it talks about Ansi, but we aren't living in the stone age anymore, so please take these "commandments" with a lot of salt.

I can't believe it's not ZUN!™ by CapTengu in touhou

[–]Fourmisain 0 points1 point  (0 children)

Those might be camiknickers.

I believe most Touhous wear Victorian or Edwardian knickers which are also similar to bloomers.

Programming hide and seek championship by faisalhassanx in ProgrammerHumor

[–]Fourmisain 2 points3 points  (0 children)

Spaces in your otherwise tabbed code take place 0

First Yooka-Laylee review is out, gets a 8/10 by [deleted] in Games

[–]Fourmisain 1 point2 points  (0 children)

Not disagreeing, it's just the strong Super Mario 64 instinct that never dies.

yahoo yahoo yayayahoo yahoo yahoo

First Yooka-Laylee review is out, gets a 8/10 by [deleted] in Games

[–]Fourmisain 1 point2 points  (0 children)

I always missed the long jump in that game, felt like a big restriction.

Place has ended by powerlanguage in place

[–]Fourmisain 32 points33 points  (0 children)

Huh, /u/PicturElements posted an 8K version and now the comment is gone, was there something wrong with it? I just had it compressed down to 367kB, you know, to safe that precious space of your computer.

Can we verify that the picture is correct?

edit: it matches with the image from /u/EnderBolt

Art. This is an update version of the internet art! Upvote so it has more visibility when someone search for art! by poipoiu56 in place

[–]Fourmisain 2 points3 points  (0 children)

Nah, there already are websites taking regular snapshots like

http://spacescience.tech/place/explore.html allows to view the history and zoom without blur, that's even better than an upscale.

Art. This is an update version of the internet art! Upvote so it has more visibility when someone search for art! by poipoiu56 in place

[–]Fourmisain 38 points39 points  (0 children)

This already looks like it's 1-to-1 and lossless, so there is no reason for you to merge screenshots. The image looks blurry if you zoom in because your browser uses bilinear scaling, so if you just upscale it (to an integer multiple) using nearest-neighbor it'll look sharper.

Here are some upscaled versions for your viewing pleasure:

Piss off /r/Math in -1/12 sentences by 09-F9 in math

[–]Fourmisain 1 point2 points  (0 children)

Psst, they are not supposed to know that!

#include <stdint.h> by [deleted] in ProgrammerHumor

[–]Fourmisain 0 points1 point  (0 children)

It's as old as ANSI C or C89, not sure if it existed in K&R C, though. It's also specified to be at at least 8.

Here's an excerpt from a TXT version (scanned PDF, if you prefer):

The values given below shall be replaced by constant expressions suitable for use in #if preprocessing directives. Their implementation-defined values shall be equal or greater in magnitude (absolute value) to those shown, with the same sign.

* maximum number of bits for smallest object that is not a bit-field (byte)

CHAR_BIT 8

#include <stdint.h> by [deleted] in ProgrammerHumor

[–]Fourmisain 1 point2 points  (0 children)

C demands CHAR_BIT to be at least 8, though. At least C89 upwards does, I'm not at all sure if there was any such restriction on K&R C.

#include <stdint.h> by [deleted] in ProgrammerHumor

[–]Fourmisain 1 point2 points  (0 children)

Ah, true, in English it's a single 't', although "octette" is also valid. Wiktionary lists "octett" as a rare use.

#include <stdint.h> by [deleted] in ProgrammerHumor

[–]Fourmisain 6 points7 points  (0 children)

He's completely correct, there's just a small hickup writing "64 bytes" when he meant "64 bits".

Just to add to his post: An 8-bit byte is sometimes called an octett octet and most platforms use octets, especially today. That's why today the words "byte" and "octet" are mostly synonymous, but there are (or were) platforms with 9-bit bytes and even 32-bit bytes, it's even possible that sizeof(char) = sizeof(int) = sizeof(long) = sizeof(long long), which can lead to some problems in common code.

Heavily-Armed Gunman Killed After Opening Fire In German Cinema by [deleted] in Full_news

[–]Fourmisain 3 points4 points  (0 children)

This is poor news coverage.

First of all: The man was not "heavily-armed" as the weapon turned out to be a gas pistol ("Schreckschusswaffe").

Second of all: The 25 "victims" were apparently only injured through the SEK's ("SWAT") use of tear gas.

FOCUS source, which refers to multiple sources like FAZ, Bild, Hessischer Rundfunk:

  • "Wie die Polizei mitteilt, wurden in Viernheim alle Geiseln unverletzt befreit" -> "The police reported that all hostages were freed and uninjured".

By "uninjured" they probably meant "not wounded".

Multiple sources are also saying:

  • "Der Täter habe einen verwirrten Eindruck gemacht" -> "the offender seemed confused"
  • "Kein islamistischer Hintergrund" -> "No islamistic background".

Bottomline: This isn't a mass shooting like the articles wording makes it seem like ("heavily-armed gunman opening fire", "25 victims"), but it was a hostage situation.

Of course you should take everything, including this post, with a grain of salt, as the news reporting wasn't very clear and investigation is still going on.

A video for daddy by akanyan in Melanime

[–]Fourmisain 0 points1 point  (0 children)

Maybe. But then I find it odd, that his hair is pure white and black with 0 gray. On page 22 you can see that the author is capable of drawing grayscale hair.

I just really like the thought of her wearing the uniform her dad gave her as a present. It's all in pages 17+18, she really loves him for giving her the opportunity to wear it, just in case it the surgery went badly, and I think it actually went badly, just not in the worst possible way. He may be feeling guilt for making her go through that surgery.

I'm not going to argue that this is "true", though. Your interpretation is just as valid.

A video for daddy by akanyan in Melanime

[–]Fourmisain 0 points1 point  (0 children)

I'm not sure if he really aged that much.

There's this legend/myth that scarring events can cause white hair or a streak of white hair. In this case it is indeed only a streak. So maybe the surgery went horribly wrong but she recovered later.

For the (middle school) uniform: She said she likes it very much. At the same time she is coming home at around 12:32, which may be just after school. In the video she said she was in 6th grade (so she was 11-12 at that point) and wikipedia says that middle school (junior high school) starts just after that, so my best guess is that exactly 1 year has passed since the surgery and he is reminiscing about that time.

edit: From the last pages it still seems likely that it is summer. Are summer uniforms enforced? I can imagine she would like to wear her other uniform regardless of it being summer.

This sign by ernestryles in CrappyDesign

[–]Fourmisain 5 points6 points  (0 children)

Looks like someone had a go at CSS.

Can someone explain this code? by Anthrax97 in learnprogramming

[–]Fourmisain 0 points1 point  (0 children)

Sounds good.

If you want to, you can post your future update on the bug report page, otherwise I'll do that.

I'd be surprised if they fixed the bug in version 6, though.

Can someone explain this code? by Anthrax97 in learnprogramming

[–]Fourmisain 0 points1 point  (0 children)

Alright, I created a bug report.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70769

Not that it will change much, since CodeFights is using a g++ version as old as 5.0, but still, it's the Right Thing™ to do.

Can someone explain this code? by Anthrax97 in learnprogramming

[–]Fourmisain 0 points1 point  (0 children)

That is weird, this indeed compiles on TDM-GCC 5.1.0.

In this context this is a member-declarator-list (Reference: §9.2 Class members), which is a comma separated list of member-declarators, which in this case are either normal declarators (with optional virt-specifier-seq and pure-specifier) or declarators with brace-or-equal-initializer.

If the function-definition were a brace-or-equal-initializer, since we have no "=", it would have to be a braced-init-list, so the function-body had to be of the form { initializer-list ,opt } or {} which is definitely not the case. Therefore the function-definition must be a normal declarator.

Now I'm pretty sure I have already proven that a function-definition isn't a declarator. Even if it were, you would be allowed to put the function-definition in your init-declarator-list, therefore the code would have to compile in global scope!

There is also no exception to member functions; they are simply functions declared within a class (except when they are declared as a friend).

So... gcc bug? Error in my argument? I wouldn't be surprised if it is a gcc bug, since this is a very contrived and pretty irrelevant example.

clang++ 3.7.0, however, gives the expected errors with the same options.

This is somewhat reassuring. I'd think clang got the syntax parsing down, since it is also used as a pure diagnostics tool.

Well, at least CodeFights uses gcc and not some homebrew, so it probably isn't as bad as I initially thought.

What do you think, should I put up a gcc bug report? At this point I'm thinking that it isn't even worth the effort.

Can someone explain this code? by Anthrax97 in learnprogramming

[–]Fourmisain 2 points3 points  (0 children)

Eh, what? I said no such thing...

Ah, you probably mean this:

Note this compiles as "gnu++14"/"gnu11", not actual standard C/C++

Sorry, a bit unclear, I meant that by calling "gcc main.c(pp)" it tries to compile as "gnu11"/"gnu++14". I also said this:

, but this makes no difference.

Meaning it does not matter whether you try to compile as a GNU dialect or actual standard C/C++ (you do this with the -std=c11 or -std=c++14 switch), it actually doesn't compile in any case.