« first day (1607 days earlier)      last day (2007 days later) » 

10:15 AM
@Micrified well, it works at least sometimes and at least on one machine!
 
 
3 hours later…
1:16 PM
wow...
Olaf suspended. Tim suspended...
what's happening :D
 
well, I get a lot of comment deleted because I simply say "don't make sense" or "this API is bad"
SO is dying
but be nice
hvd has deleted his account
so many people are leaving
 
Who suspended?
Think I know user Olaf.
But not Tim.
(know as in "seen on the site". Don't actually know the person).
 
egh... Last week I've got suspended from Facebook :D
I'm not giving my photo ID to those bastards.
 
@Kamiccolo LUL
 
You get suspended if you do not have photo?
Can't you just put one of a cat.
Or some kind of humanoid (if they have recognition stuff).
 
1:27 PM
@Micrified *photo of an ID.
Probably someone reported me, 'cause I was criticizing some politicians, etc.
 
@Kamiccolo This is a requirement? lol
Wow.
 
@Micrified well, it is not. But if someone would suspect that You're not using Your real name/surname. Suspect or just want to mess with You...
 
Hm that is a shame. I didn't know that. Seems kind of an overreaction from FB side.
 
@Micrified they introduce this few years ago
look totally stupid for me
I will just create another account if needed
next time they will ask you some ADN sample
 
@Stargateur agreed. PhotoShop!
 
1:39 PM
I was going to suggest this as a profile picture.
I wonder if it would fool a ML recognition app.
It might.
 
1:50 PM
@Stargateur it is for a long time now
very sad if you ask me..
first it started with the huge amount of terrible questions (irrelevant ones, poor quality ones, do-my-homework ones, etc.)
then came this new hyper-sensitivity bullshit
and in the mean time loads of users gained too much power (e.g. becoming mods) who shouldn't have
one of the many reasons why I don't care about SO as much as I used to :/
 
That is why we should all learn French and migrate to the new hot place for developers: developpez.net.
 
@Micrified HAHAHAHAHAHAHA
however developpez has some "good" (not so bad) ressource
but the forum...
NO
 
 
4 hours later…
5:53 PM
   int pipefd[2];
   pipefd[0] = 0;
   pipefd[1] = 0;
   pipe(pipefd);
1
Q: Pipe guarantee to close after the child has exited

the constant gardenerIn the code below, is it safe to rely on read() failure to detect termination of child? int main(void) { int pipefd[2]; pipefd[0] = 0; pipefd[1] = 0; pipe(pipefd); pid_t pid = fork(); if (pid == 0) { // child close(pipefd[0]); // close unused read end ...

that amazing how people are brain washed
ALWAYS INIT TO ZERO NO MATTER WHAT
but don't check if function is successful
 
 
2 hours later…
7:37 PM
@Stargateur Specifying the zero value sometimes help at the time of debugging. gdb p shows arbitrary value.
 
@Biswapriyo it absolutely does not help
if you initialize to zero then your debugger can't find out it is actually uninitialized
 
@AnttiHaapala Depends on breakpoint.
 
@PeterVaro come visit room 6 too :D
 
One query, Does C allow type casting with structs?
 
7:59 PM
Please don't angry with me. I tried one code (with a struct pointer) in gcc and it doesn't show any error:

#include <stdio.h>

typedef struct Example {
int a;
int b;
} example;

void func(example *var)
{
printf("a: %d\n", var->a);
printf("b: %d\n", var->b);
}

int main()
{
func(&(example){7,8});
}
 
@Biswapriyo this code is perfectly ok, and don't contain any cast
also I have a rule, a cast is 99% not needed or undefined behavior
 
well, that's not exactly true... but almost :P
 
@Stargateur Yes I know that there is no casting. I am doubtful with this func(&(example){7,8});
 
@Biswapriyo not it's ok this struct will live as automatic storage in your main function so not problem here
 
there are 4 places where you need casts: explicit integer conversions to widen, struct pointer to the first member, access a bytes of variable and to backcast void* so that you don't need a silly intermediate variable :D
 
8:03 PM
indeed
 
2 of 4 are just shortcuts, you could use intermediate variables for these
but it is a good rule... always check thrice if you think you need to have a pointer cast...
 
@Biswapriyo This is not a cast, this is a compound literal expression preceded by a & operator
 
One more: If you're dealing with an API that accepts non-const pointers when it should be accepting const pointers
 
well, you shouldn't need that cast, the api is wrong :P
 
basically casts often imply:
- the code that uses the cast is shitty
- the code that uses the cast works around shitty code written by others
 
8:11 PM
In particular, properly dealing with a char *const [] when calling execv can be a bit messy.
 
@dbush strchr take a char const * return a char *, this still annoying me.
 
ah :D
nothing in the ansi c rationale
 
well, that to avoid duplicate function one for const and one for mut
but that is error prone
 
8:18 PM
int i = ++(int) { 1 }; funny, but if I see this in a code I deleted it without regret.
 
@Stargateur Well, I can see that if what was passed in was actually a char *
 
@Stargateur Quote from that page: "You can also construct an array, though this is dangerous in C++".
 

« first day (1607 days earlier)      last day (2007 days later) »