« first day (1385 days earlier)      last day (3557 days later) » 

8:00 AM
some of them might have nice personalities
 
@Puppy 'can' it's not happened yet
well, it may not happen :P
@BartekBanachewicz lol, smart
 
ohhh
I thought you said, "results from a little chat with a manager".
 
@Mikhail that looks unpleasant
 
@Mikhail yeah, not Angler fish :P
 
8:02 AM
@StackedCrooked all deep sea creatures look weird tbh
 
@thecoshman I don't have an ID yet.
my desk looks weird :D
 
moral is don't stick your hand in a fish
 
I'd really like to use a remote controlled sub one day and explore the deep sea
to see all of the creatures there
 
anglerfish, definitely not angel fish
also, bare hand fishing might not be a good idea ...
 
@BartekBanachewicz is it in the bathrom?
@Mikhail gigidy
 
8:04 AM
@thecoshman looks like it :D
 
@AlexM. I read that as 'room mate controlled sub'
@BartekBanachewicz is it full on cubical?
 
@AlexM. Sadly, what you'll most likely to see first are plastics and garbage.
 
@thecoshman aye
 
@MarkGarcia they float
 
8:05 AM
@thecoshman Nope, not all. Not even styro.
 
@BartekBanachewicz at first I didn't like the move to more open plan desks, but now I don't think I'd like the idea of cubes
 
It's my first time in a cube
so far I like it
 
@BartekBanachewicz oh god, at first I thought that was just a stock image
That looks like a fucking padded cell
who you whoring for now?
 
Quantum Lab Co.
 
@BartekBanachewicz no cubicles here but the colleagues are okay-ish, so I don't mind
 
8:07 AM
I think people think cubes are good because people can't see what you are upto. Which is nice, but what's really nice is when people don't care what you are upto, they just trust you to know how to get shit done whilst also keep your marbles with a bit of slacking here and there.
 
at the old job however, I would have really loved cubicles because oh my god annoying people around me
 
@thecoshman meh. Lack of distractions is nice
 
how do cubicles stop annoying people from getting to you?
 
The white all around is soothing
it's like staring at a white sheet
creativity overflow :D
 
8:09 AM
^ that too
 
@BartekBanachewicz cubes make no difference, people can still just come over
 
I wonder if l'Oreal has programmers.
 
also cubicle walls provide some isolation from outside sounds
 
and again, working with people who are nice to work with make cubicles bad
@AlexM. I just listen to music
 
@thecoshman I don't mind that
 
8:10 AM
@thecoshman yeah that works for me here, but before it didn't
people were so noisy I could hear them through the headphones
 
@thecoshman being nice to work with doesn't imply you have to see the other guy for 8 hours straight
 
1 min ago, by Bartek Banachewicz
@thecoshman meh. Lack of distractions is nice
 
@thecoshman it's different
 
@StackedCrooked lol. The cosmetics company?
 
if someone comes to me with something important, then it's ok
 
8:10 AM
@StackedCrooked most likely, for their web stuff
 
@BartekBanachewicz oh, we have partitions around the desks so you are not locked eye to eye
 
or wants my help
 
and those who need to analyze their market stuff
and work with the databases
 
@thecoshman my "cube" doesn't have back wall
 
@BartekBanachewicz sure, but cubicles don't stop people coming over for stupid shit
 
8:11 AM
@thecoshman nothing stops that
except a secretary
 
@BartekBanachewicz we just have desks with short panels around them
 
@MarkGarcia yeah, it was just a totally random thought :)
 
@thecoshman Yeah I know what they are
ours are just a bit more bulky
well ok
time to build shit out of this project
 
upy-downy desks are fun :P
 
In addition to is_polymorphic it would be nice to have a has_virtual_destructor trait.
Oh, it exists.
C++11 is infinitely more cool than C++98.
 
Ell
8:28 AM
yeah
 
Xeo
YaY, got my gamescom ticket \o/
 
heh weird
we're using Slack at work
 
@StackedCrooked Huh. Old naming scheme. Interesting.
It's the only has_* left it seems
is_virtually_destructible :3
 
fuck
I need opencv libs
and pacman only installed headers
 
is there a well known platform under which sizeof(int) == 8?
 
8:36 AM
x64?
 
any x64?
 
@BartekBanachewicz If you build from source, it by default wants to build itself for like 6 versions of cuda, which increase the build time by 6
 
@AlexM. no
@AlexM. no
 
I seem to find a lot of people saying on some platforms int's size is 8 bytes but none of them actually give examples
 
on mingw x64 it's 4
 
8:38 AM
I can't think of a single platform where sizeof(int) is 8
Google doesn't help either
 
maybe bit size?
bits in a byte?
 
afaik sizeof(long) is the only one that is different on 32-bit vs 64-bit gcc (at this time)
 
sizeof(long long)?
isn't there some x87 crap that is 80bits?
 
I got noticed by senpai today for writing clean code
squee
 
> I'm looking to implement something similar to the deferred IEnumerable concept in C++, but without template implementations. (My question is very similar to this other question, except for the deal-breaking templates.)
 
8:42 AM
@AlexM. the world needs more clean code
 
recyclable code?
 
@chmod711telkitty Like code written from garbage?
 
well you have your normal garbage, then you have your recyclable garbage :x
 
@BartekBanachewicz spent a few hours without the script on; I can't say I feel like I need it now
and I don't lift the mouse anymore
 
@Mikhail long double but most compilers don't bother.
 
8:51 AM
sizeof(long double) in GCC is 16.
 
does a call to a method with an empty body usually get removed after optimizations?
I should learn to disassemble my programs
IIRC there was a site that showed you the asm of your program, let me google that
 
LLVM demo page.
it's broken now I believe.
 
@Puppy that or this gcc.godbolt.org
found it :D
 
@AlexM. Depends on the plat. IIRC GCC had a bug where it did that, but ELF permits replacing method bodies later.
 
int b;

void someMethod(int a)
{
  b = a + a;
}

int main()
{
  someMethod(5);
  return 0;
}
gets optimized with g++4.8 to b = 10 (movl $10, b(%rip))
lol
@Puppy yeah I guess I need to check for each platform I use
anyway, it doesn't matter that much, I wanted to write a function that had a body only when a certain flag was defined, and if that flag wasn't defined I wanted to essentially remove all superfluous calls to the function
 
9:02 AM
easier done with a macro
#if USE_FUNCTION func(...) { ... } #define FUNCTION_CALL(...) ... #else #define FUNCTION_CALL(...) #endif.
 
will vc12 libs work with g++ 4.9?
 
lol no
hmm, maybe if they're C only
I don't remember exactly how much of the VS stuff MinGW supports.
 
@Puppy so essentially if I want to use the function, I define the function call itself to do something, otherwise I define it to do nothing?
 
@AlexM. right.
 
makes sense, didn't think of this
thanks
 
9:07 AM
@R.MartinhoFernandes nope. How well does that work?
 
Half as well?
 
Hey, is there a way to store STL containers in the same variable? Like x could be either a vector or a set? The reason I ask is because I have two identical transform statements, which do the exact same thing except they operate on different containers. It'd be nice if I could just if/else the right container into a pointer, and then use that in a single transform.
 
No.
 
hey, did you know there's a part of the website dedicated to Q&A?
 
Don't start shitting on him.
The answer is literally 2-3 characters.
 
9:16 AM
2 characters too many
 
Yet you typed a sentence.
 
and a question too many
 
@David template
 
beware the dog
 
@rubenvb I luv you. MSYS working great so far.
@David yes.
however, it's achieved in a bit different way than what you'd like, most probably
 
9:22 AM
I like Java & C# way of dealing things, everything is of the type 'object'
so everything can be casted to objects
 
That's a stupid way of dealing with things.
Just use a template.
 
@chmod711telkitty Why don't you use a dynamically typed language then?
@Rapptz templates are not the ultimate answer
 
Ell
@chmod711telkitty objects are useless though, right?
 
yep
well it has ToString or something in C# IIRC
but in general they are useless
 
Ell
yeah
 
9:26 AM
that's really akin to dynamic typing
 
Ell
Not really
 
yes, really.
 
Ell
In dynamic typing you can call any method you want
 
That's duck dynamic typing.
 
Ell
in static typing with an Object you have to know a type you want
 
9:27 AM
no, that's still dynamic typing
in a runtime/dynamic cast, that is
 
Ell
What? :P
 
static casts and type erasure are a different thing, alright
 
Ell
I don't understand
 
@BartekBanachewicz like ... perl?
 
@Ell dynamic casts are dynamic, static casts are static :P
 
9:28 AM
@Puppy found a possible bug source using the empty function call thing, I think
 
Ell
@BartekBanachewicz I don't see your point though :P
 
say, if the flag is not defined and someone does this
 
@chmod711telkitty There are better dynamic languages than perl
 
you say that as if I particularly care
 
@Ell if the resolution of cast happens at the runtime, it's dynamic typing
 
9:29 AM
if (condition)
    ThatFunction();
a = 5;
 
@Ell I think there is a reason why everything in Java/C# is an extension of the type object
 
Ell
I thought dynamic typing is when the type a variable refers to can change
 
@Puppy vOv
 
Ell
@BartekBanachewicz So c++ is dynamically typed wrt polymorphism?
 
@Ell yes. dynamic_cast can fail.
there's a limited checking of what dynamic_cast can do
 
Ell
9:32 AM
I don't think that is dynamic typing :P
The variable still has a static type
meh
I just have the wrong definition of dynamic typing
 
@Ell in javascript, variables have a static type too
typeof 'test'; // "string"
doesn't mean it's static typing
 
Ell
I don't think that is a static type
you can get the type of any object in python too
but that is a runtime type
 
isn't dynamic typing when the same thing takes multiple types depending on its value?
static typing is when a variable X has to have values of X's initial type throughout the execution of the program
so you can't make X an int now, and seconds later a string
 
Ell
> Dynamic type-checking is the process of verifying the type safety of a program at runtime.
I guess dynamic_cast is dynamic typing :P
 
@BartekBanachewicz, what did you have in mind?
 
Xeo
9:38 AM
lolz. Amazon now started offering me 50 euros starting credit if I take their credit card.
the normal is 30, and they've been offering me 40 for a while
 
Ell
@David can I see code?
 
`transform(m_people.begin(), m_people.end(), back_inserter(data),
[&](const Person* p) { return PairResults(p->getTime(stage), p->getName()); }
);`
The only thing that changes is the m_people.
 
why are you capturing everything there?
you don't seem to be using anything that's captured
 
Alex, is that question to me, or a previous conversation?
 
@David depends on what you want
@Ell yep
 
9:45 AM
@David you
 
@Ell told you
go figure why it's called a dynamic cast
 
@AlexM. I have a container of class instances, and I'm pulling data from the member variables and putting them into a pair.
 
Xeo
We have a feature with something called a "nomad". I always want to type "monad" :(
 
@David is PairResults actually this->PairResults?
does [&] autocapture this?
 
9:47 AM
@AlexM. no
[&, this]
 
I must be missing something then
the guy doesn't use anything that's captured
right?
 
@AlexM. no, it's another class. Those go into data which is just a list.
Stage is captured.
 
@BartekBanachewicz great to hear that. I like it as well :-p
 
oooh
didn't notice stage
thanks
 
Comes from the function parameters.
 
9:49 AM
you should [&stage]
mainly because of such events
when others try to find out whatever you use in your lambda and is captured
 
Fair enough. Although, I like things short. :)
It'd be nice if I could use auto, but the problem is that auto has to know what it is at declaration, where I would need to do something like auto var; if(x) var = n; else var = m;
 
Xeo
@AlexM. yes
@BartekBanachewicz you suck
 
Seriously man.
Use a template.
This is a solved problem
 
@Rapptz I've never seen a template used on a variable that was automatically deduced by the assignment. Can you show a quick example?
 
@David yeah auto is not variant; it is just type deduction
 
Xeo
10:02 AM
caaaaake
 
template<typename Container> void func(const Container& c) { /* .. */ }
Just use a function
 
Xeo
Unfortunately this cake means that our intern is leaving :(
 
you get cake when interns leave?
 
Xeo
We get cake at all kinds of opportunities
Somebody joins, somebody leaves, birthdays, marriages, other random occasions
 
sooooo, how fat do employees get after joining the company, on average?
lol
 
Xeo
10:11 AM
heh
At times the amount of cake can be a bit overwhelming :D
but it's usually just 1 / 2 (small) pieces per employee
 
it's fine then, I think
we're getting ice cream this month
1 per week
 
o_0 Chrome is only just getting 64bit builds
 
Xeo
We got a shitton of ice pops in our fridge
 
How is 64bit not the norm these days?!
 
I have a x32 tablet.
 
10:13 AM
> If the program is specifically designed for the 64-bit version of Windows, it won't work on the 32-bit version of Windows.
 
there are a lot of old WinXP x32 PC
 
probably because there are still people running 32 bit OSes
32 bit builds work on 64 bit OSes
but not vice-versa
 
I said norm, not exclusive ಠ_ಠ obviously we still have to support shitty mac shitty pants with his 30 year old hunk of junk, but why are we not building 64bit as standard?
 
@Xeo oh, I remembered wrong as it seems
 
ah, you mean why they didn't make 64 builds sooner
 
10:15 AM
@Abyx really?
weird
I thought all Atoms are x64
 
@BartekBanachewicz yeah. Win8.1 x32
 
you mean x86. But maybe that's just the OS.
 
it is a x64 CPU, but OS is x32
 
exactly.
 
and I'm not sure that x64 OS would work better with 2Gb RAM
 
10:40 AM
@Abyx I don't see why it should be worse
while we're at it, Chrome is using around 3.5GB for me now
this is getting ridiculous
 
when I used to have leaks in chrome, a single tab would go up to 2GB
I think a plugin caused it
 
stunning Defiance this week
 
funny, now that I disabled cursor wrapping on the two screens, I feel like doing something completely else
not allowing the cursor to move to the 2nd screen unless I hold a key
sometimes I move the cursor to the 2nd screen accidentally
 
@BartekBanachewicz I was getting similar weird behavior in Chromium lately.
But it's still not as bad as this one time when KMix used to leak about 50KiB of memory (wtf) every time your music player switched a song.
 
Ell
xorg is so bad
 
10:58 AM
 
> Knuth’s famous quote about premature optimization was never meant to be a stick to beat people over the head with. It’s a witty remark he tossed off in the middle of a keen observation about leverage, which itself is embedded in a nuanced, evenhanded passage about, of all things, using gotos for fast and readable code.
 
lol, the quote came from an article in defense of goto
 
make is trying to compile dlls for some reason
 
Ell
you're on windoze right?
 
11:06 AM
I'm using Microsoft Windows, yes.
 
@StackedCrooked Not only goto!
> Not only goto statements are being questioned; we also hear complaints about floating-point calculations, global variables, semaphores, pointer variables, and even assignment statements. Soon we might be restricted to only a dozen or so programs that are suffi- ciently simple to be allowable; then we will be almost certain that these programs cannot lead us into any trouble, but of course we won't be able to solve many problems.
 
lol dumb fuckers.
 
seriously Knuth wrote that?
I'll read the whole thing later
but smells really bad
 
@Rapptz Haskell proved him wrong
 
11:12 AM
The paper's pretty old.
 
I expect that Haskell does have floating-point calculations though.
@Rapptz Yeah.
 
1974.
40 years old.
 
11:31 AM
Okay
can I dereference a singular pointer (one-past-end)?
I cannot find the wording in the standard prohibiting this
in fact, the standard only mentions singular iterators, not singular pointers
 
user image
4
haha
 
Ell
> Nobody wants to say how this works. Maybe nobody knows ...
That's helpful -.-
 
@KonradRudolph Since pointers are iterators, I think that implicitly, the same rules apply. I'm pretty sure that it's illegal to de-reference a one-past-the-end pointer.
 
@Puppy I’m pretty sure too, but this wording is clearly not enough to be binding. Pointers are not iterators (unless somebody can find a statement to that effect), random-access iterators are just modelled after pointers
 
11:35 AM
@R.MartinhoFernandes I should have expected a relevant xkcd
one always exists
 
They are. Hang on.
 
@KonradRudolph I'm not sure if the Standardese says it explicitly, but a bunch of the interfaces in the stdlib are explicitly designed that way for the explicit purpose of accepting pointers as RA iterators. But I'd try looking in the basic object stuff- it's probably in that (&obj) + 1 wording.
 
@KonradRudolph If there's no object there, no.
 
Xeo
@KonradRudolph No. it's not pointing to a valid object
 
imagine ... a spaceship controlled by your smart phone app ...
 
11:36 AM
@Xeo To clarify, I’m talking about a case where no memory access is happening, akin to &(arr[1])
 
I have a non-binding footnote: ‘267) This definition applies to pointers, since pointers are iterators. The effect of dereferencing an iterator that has been
invalidated is undefined.’
 
And here is somebody claiming (through some very convoluted and bullshitty logic) that it’s legal:
the comment doesn’t convince me, but I’m hard-pressed to find a binding statement in the standard forbidding such use
 
Xeo
@KonradRudolph C allows that. C++ doesn't.
 
The footnote in turns elucidates 24.2.1/10: ‘An invalid iterator is an iterator that may be singular.’
 
Hey man. You're opening up a huge can of worms.
 
11:38 AM
@Xeo Ah, fuck.
@LucDanton That would be the relevant passage then, okay. Interesting to know that C has no such restriction.
 
Last time this conversation took place, LRiO and I think Loki had like a 45 comment war about the definition of "dereferencing"
5
 
@KonradRudolph I would as well. Those kind of things (memory, lifetimes etc.) are normally worded to explicitly say painstakingly under what circumstances so-and-so is allowed, meaning anything else isn’t. Prohibiting is rare.
Well, rarer.
 
Oh, somebody else did their homework, it’s illegal in C as well
 
@KonradRudolph Well it doesn’t have iterators!
 
(C99 6.5.6.3.8)
 
Xeo
11:41 AM
@KonradRudolph Really? I remember an explicit exemption for &*ptr
 
> [...] If the result points one past the last element of the array object, it shall not be used as the operand of a unary * operator that is evaluated.
 
So int x; int y = x; is legal, right?
 
nope.
 
I don’t have the C standard handy, but I’m assuming that the user didn’t deliberately quote-mine
 
I believe that unsigned char has a special exemption but it's certainly not legal in the general case.
 
11:42 AM
@Jefffrey wrong
@Puppy orly
 
Xeo
@Jefffrey No, reading from an indeterminate value is UB
 
I see
 
(where UB of course doesn't just mean "you don't know what value you'll get in y")
 
@LightnessRacesinOrbit Pretty sure that last time, I said it was plain illegal, then someone owned me with Standard quotes explicitly stating the opposite for something like unsigned char. Might have been char or signed char.
 
Xeo
@KonradRudolph Hm, yeah, I'd have to check through the C standard to look for the passage saying &*ptr is a no-op or something
 
11:43 AM
@Xeo there isn't one
 
@Jefffrey Actually I'm pretty sure that's legal.
 
On my C11 draft the reference looks more like 6.5.6/8 but it’s otherwise accurate.
 
There was a question about it
 
@Rapptz lol yes. the idiot didn't understand that * is a dereference, because the standard doesn't use the word to the degree he'd like, and he thinks it should therefore have more to do with references
 
@Xeo Even then, why would this apply to &(arr[1])? That’s a decidedly different operation.
 
11:44 AM
Apr 3 at 14:01, by Jefffrey
because unsigned chars are special
 
@Rapptz Definitely not.
 
that was a dejavu
 
&*ptr is obviously valid if ptr is valid, but &(arr[1]) is invalid even if arr is valid.
 
Oh yeah. It was unsigned char.
 
18
Q: Dereferencing an invalid pointer, then taking the address of the result

Lightness Races in OrbitConsider: int* ptr = (int*)0xDEADBEEF; cout << (void*)&*ptr; How illegal is the *, given that it's used in conjunction with an immediate & and given that there are no overloaded op&/op* in play? (This has particular ramifications for addressing a past-the-end array element &myArray[n], an e...

43
Q: Take the address of a one-past-the-end array element via subscript: legal by the C++ Standard or not?

Zan LynxI have seen it asserted several times now that the following code is not allowed by the C++ Standard: int array[5]; int *array_begin = &array[0]; int *array_end = &array[5]; Is &array[5] legal C++ code in this context? I would like an answer with a reference to the Standard if possible. It w...

 
11:45 AM
Also while it is allowed in that specific case it still produces indeterminate results, so beware.
 
Opinion varies wildly, as you can see, but I believe most SO experts nowadays treat it as UB, to be safe if nothing else because the standard as of C++11 is still ambiguous in this.
 
Xeo
@KonradRudolph It's effectively the same, since arr[1] is *(arr+1), yielding &*ptr where ptr = (arr+1)
 
@LightnessRacesinOrbit Well I definitely now that it fails on some compilers (well, at least on one) so it’s really not up for discussion in C++. But in C the situation could be very different
 
In C++-land, I’m fairly sure that ‘The unary * operator performs indirection: the expression to which it is applied shall be a pointer to an object type, or a pointer to a function type and the result is an lvalue referring to the object or function to which the expression points.’ is enough to rule out C-style tricks. As I recall, a past-the-end pointer simply doesn’t refer to an object. Most of the time.
 
11:50 AM
@LightnessRacesinOrbit Actually, that accepted answer there is utter bullshit, I can’t believe jalf ever wrote this.
> &array[5] dereferences array+5 (which as far as I can see is legal, and results in "an unrelated object of the array’s element type", as the above said)
uhm, just no.
 
If the whole of a program is int main() { int a[5]; &a[5]; } it is very obviously invalid, as there are exactly five int (sub)objects and a + 5 cannot possibly refer to one of them. Ergo, invalid dereference.
 
nice
our classifiers are training
so I can answer on SO in the meantime :P
 
> show 86 more comments
 
@LucDanton Isn't the one past the end guaranteed to exist?
 
you can't dereference it
 
11:56 AM
Therefore leading to a valid but useless pointer.
 
@BartekBanachewicz Is that the machine learner’s 303?
 
&a[5] -> &(*(a + 5))
 
Oh right, subscript operator.
 
@KonradRudolph heheh
 
(And should that be “machine teacher”?)
 
11:58 AM
Well I am not teaching it myself
it's just chewing on the prepared data sets
 

« first day (1385 days earlier)      last day (3557 days later) »