« first day (843 days earlier)      last day (4107 days later) » 

3:00 AM
@jerryCoffin: fair enough. The first time I looked at C++, it was cfront, and it didn't strike me as very interesting. Times change :)
not that i'm advocating go, or anything. rust does look interesting.
 
> Please don't close my question without being answered. I really need answers to proceed my project. I am a newb to c++. I have done research before I ask here. Thanks!
 
lol
 
I ponder a C++front someday.
good luck with that when there isn't even a tool to take a template with all inline definitions and put them out-of-line
 
@rici So they do -- my problem (if you want to call it that) is that (despite my best efforts to prevent it) I keep getting "promoted" to the point that writing code isn't part of my job any more...
 
@JerryCoffin that's the nice thing about retirement.
 
3:08 AM
@JerryCoffin tell them you want to write code. if they fear you'll leave you'll be in front of a keyboard pretty quick :)
 
@rici With my wife, and her spending habits, I won't get to retire unless I outlive her by several decades.
@doug65536 I already left, and do consulting now. Hard to earn enough to support the family by just cranking out code though.
 
@JerryCoffin: also the nice thing about retiring to live in Perú
although technically, i'm only semi-retired.
still, lots of time for random hackery.
 
@rici My wife's been (sort of) trying to talk me into retiring to the Philippines (where she's from). Given the weather (always hot) I can't say I'm excited, but the cost of living is definitely a lot lower.
 
yeah, hot sucks. Fortunately, we live in Lima, where it's basically always temperate, never raining, and always overcast. Once you get used to the greyness and the earthquakes, it's ideal.
 
Hello
Does anybody know, what architecture so is based on?
eg. RoR, python, php, asp.net, java ?
 
3:18 AM
good isn't it. I wonder too. SO has really good web devs
 
I'm drunk you guys
 
i got that out of a google search, by the way.
 
@rici thank you
 
@rici I'm not sure which is worse -- I'm not very good with constant grey either. I should add: there are places in the Philippines (in the mountains) that aren't nearly as hot, so that might work. Costs are somewhat higher, but still cheap compared to the US.
 
@JerryCoffin: it was actually nice and sunny today. in summer, the cloud lifts.
although, to be fair, I've lived here long enough that I don't really notice anymore.
otoh, housing in lima is no longer as cheap as it was when we bought ours. probably today, we'd need to go to Trujillo or somewhere like that, which has a nicer climate but less work.
 
3:28 AM
@DavidFrank lol, I'm surprised nobody jumped when you said maybe SO is made in php
not a big fanbase in this chat room from what I've seen
 
@doug65536 Actually, I was a bit worried about it, because currenty I've seen an open source php q&a engine, which looked just the same as so
Thats where my question came from
 
Anyone up for a challenge probelm?
 
What kind?
 
A deciphering challenge
 
eh
 
3:35 AM
I'll give it anyway
Try to decrypt this:
rhua ua a RWAR
I'll give a hint: I did something when I typed it wiht my hands
 
@CCInc Dyslexic angry dinosaur.
 
today on funday monday, learn about grahm's number
 
this is a TEST
 
@MarcusStuhr Nice!
How'd you know?
 
that cipher doesn't make sense
you're horrible :(
 
3:37 AM
wait
 
ua => is but a is used again and it's just a?
 
I've solved Notpron/Zest so that kind of cipher stands out a certain way
 
your hands are shifted one key to the left
 
@Rapptz Yeah, because the "a" key shifted to the right is the caps lock button
@MarcusStuhr Is there a name for this?
 
left?
 
3:37 AM
i don't know the name of it, it's just a keyboard cipher
 
yjod od s yrdy
 
technically also a cryptogram and could be solved that way too
 
when he pressed A, it turned on caps lock
 
@MarcusStuhr Hmm, is it good for passwords?
 
not in particular, no
 
3:38 AM
Aww
what kind of attack can break it?
 
substitution cipher - not strong
 
frequency analysis
and yeah it's a sub cipher
substitution ciphers are inherently weak
 
the caps lock thing adds a bit of complexity and ambiguity, but not much
 
here's a fun/abstract one for you:
 
z is shift. so z'd are lost
 
3:39 AM
QAZSEDC TYUHBNM
 
did someone say the 1st one yet? it was this is a test
 
@doug65536 Yeah
still workin on that other one
 
WZ
AZ?
 
qaz wsx edc rfv tgb yhn ujm ik, ol.
none of those look to start a word
 
I was looking for it drawing letters in the sequence
and thought maybe flipped horizontally
 
3:46 AM
azq sxw dce fvr tgb yhn ujm ik, ol.
zqa xws ced vrf brg nyh muj
and of course all the opposites
aqz swx dec frv gtb hyn jum | qza swx dec frv gtb hyn jum | zaq xsw cde vfr bgt nhy mju
 
Is anyone here professional in DirectX?
I'm... pretty much at the end of my rope with these graphical glitches.
I've exhausted all potential routes. I've checked every single error code and step-through'd all of the code, and I've been staring at more PIX debugging pictures than I would ever need for a lifetime.
 
I had major glitches in opengl when I was trying to use legacy stuff and new stuff. only fix was to use all new stuff and not use anything deprecated
 
If I can't solve this bug, I am going to have to blow up my entire codebase and start rebuilding from scratch >_<
 
and had that behavior I think you're seeing, it works and intermittently goes nuts
 
It's not intermittently going nuts.
The whole Pipeline goes balls-first into-to-the-void after the Input Assembler stage.
On the very first frame.
All the time.
 
3:52 AM
I'm guessing you can't ask on SO?
 
lol, but you built your way up to that right? what caused the regression
 
@m
I give up @MarcusStuhr
 
trying to make geometry shader work?
 
It's "HI"
 
@Borgleader I dont' know where the problem starts, so I can't pinpoint and be like "Okay guys, I got the problem, here it is, I can't solve it."
 
3:53 AM
@MarcusStuhr Explain?
 
Imagine that each character listed is lit up on your keyboard, then look down
 
that actually made me lol
 
maybe say what part of the API or what shader technique you're mentioning so people can tell if they can help
 
In hindsight that was an odd phrasing
 
3:54 AM
@doug65536 I didn't build my way up. I implemented a DirectX windowing and graphics system, testing my 3-D polygons and stuff by drawing simple flat planes and drawing textures on top of them.
 
that seems like a decent cypher
 
I then tried rendering a full 3-D model, because the polygon drawing for a flat plane was working perfectly.
Then, boom. It went to all kinds of shit.
 
btw TIL about boost::program_options
 
It's not even like it's throwing exceptions or bad error codes are happening: every single D3D function is returning S_OK.
 
made me want to make something with command line args
 
3:55 AM
you have to implement a matrix stack and get your camera transforms working first. once you can fly around you can debug a bit
 
How about an oldie-but-goodie: 55566622777783377
 
@doug65536 I checked those, from top to bottom.
I have a camera, which correctly computes a World View Projection matrix (tested against glm and DirectXMath).
It accurately computes then seperately and together.
What freaks out is the drawing, which is about as far down as I've gotten.
 
and you can WASD+mouse fly around? you can't debug until you can look around and move
 
@doug65536 I don't have input working right now.
=l
WASD + fly-around doesn't help that when I compute the view from several different places, it doesn't look right at all.
 
stick in a hack that does (GetAsyncKeyState('W') & 0x8000) != 0 etc - for debugging to bootstrap
 
3:58 AM
~Sigh~
Fine, I'm all over it.
 
can you show the code that sets the shader states for the matrices? I wouldn't depend on some magical implicit transform input. relying on those is legacy AFAIK
In my opengl engine, all renders are inserted into a set that orders the scene by state. The transforms are gathered and all repetition of the same geometry is gathered and rendered with instancing, delivering an array of matrices in one call. all instances of the same geometry are rendered at blazing speed
"state" means what shader it uses and what vertex arrays it uses. the set orders it so that the cheapest-to-change states change most frequently. everything with the same shader is rendered before switching, for example. shader switch is most expensive
I know you're using DX but they are similar if you forget all the legacy opengl and use opengl 3.3 or higher
 
4:29 AM
using those old implicit shader variables usually puts the driver into a compatibility code path and isn't good for performance either
 
// how come this works without `return std::move(n);`?
std::unique_ptr<int> get() { std::unique_ptr<int> n(new int()); return n; }
Is this an "implicit" move?
 
rvo right?
 
RVO should not affect semantics.
 
it elides. that affects semantics right?
my understanding is it constructed that unique pointer right where the return value goes
it was already there when it returned
 
It's still a "copy" for the compiler. The optimizer may elide it, but semantically it's a copy.
AFAIK
 
4:37 AM
Apple Clang 4.1 (= plain Clang 3.1 apparently) is giving me this: error: initialization of non-aggregate type 'string' (aka 'basic_string<char, char_traits<char>, allocator<char>>') with an initializer list
 
I know about (N)RVO. But RVO actually required a copy constructor in C++03. (I need to check for C++11. Probably a move constructor is sufficient.)
 
there is a hidden parameter that points to where the return goes. it just put the local variable already there (in symantic analysis). right?
 
It seems odd that would be missing from near-complete C++11 support… is that really so?
 
@Potatoswatter all compilers have a chart that shows what isn't done. everyone isn't finished some part of it
 
@StackedCrooked: the returned value from that function is an xvalue
 
4:40 AM
@doug65536 Yeah, but this is a minor feature that wouldn't go onto such a list — dispatching from a braced-init-list to a constructor. The major feature this belongs to is certainly "implemented."
 
"[ Example: The result of calling a function whose return type is an rvalue
reference is an xvalue. —end example ]" (3.10p1, 2nd dash)
 
And xvalues can be moved implicitly?
 
yes, they're "expiring values"
 
aah, it looks like it's an error in the code, just a misleading error message.
@StackedCrooked "xvalue" is the value category corresponding to a return value of rvalue reference type and nothing else that I recall offhand. Thte only thing that typically returns an rvalue reference is std::move. So it's better to say "xvalues have been moved explicitly."
 
4:44 AM
@potatoswatter, there are other examples
 
@rici Such as?
 
@Potatoswatter So it's an rvalue reference which means it will always be moved rather than copied?
 
1
A: Array of Comparables in C++

billzYou need to specify const array size, array size must be known at compile time. Something like this should fix: Comparable data[MAX_SIZE]; More generic, if you want dynamic size of Comparable, you could use STL container: std::vector<Comparable> data;

 
An expression is an xvalue if it is:
— the result of calling a function, whether implicitly or explicitly, whose return type is an rvalue reference
to object type,
— a cast to an rvalue reference to object type,
— a class member access expression designating a non-static data member of non-reference type in which
the object expression is an xvalue, or
— a .* pointer-to-member expression in which the first operand is an xvalue and the second operand is
a pointer to data member.
 
seems like my answer make others angry, is it really bad answer?
 
4:45 AM
@billz Yeah
 
I could delete it if another one agrees it's a bad answer. :)
 
ISO C++ doesn't support variable length arrays
You can only use a const with a C-array if you do a dynamic array allocation
 
C++11 is hard.
 
I wouldn't say it's bad though.
 
@rici So, just a return value of rvalue reference type, or the cast expression which produces such a value (if you hardcode std::move yourself as a static_cast), or a member access expression from the result. That doesn't add anything meaningful.
 
4:47 AM
you can explicitly return an && too; you don't have to cast
 
@billz I don't think it's bad.
 
Is an rvalue reference always moved when passed as a function argument or returned from a function?
 
Thanks @AndreiTita @Rapptz let me remove the vector suggestion first :D
 
@StackedCrooked rvalue references just match certain overloads. If it matches a function that moves, which is selected over the one that copies, then yes.
 
@Potatoswatter So it prefers move constructors over copy constructors during overload resolution?
It's starting to make sense.
 
4:50 AM
@StackedCrooked Yes, so if the move constructor isn't declared, the call resolves to a copy.
 
if you want to really learn move semantics, try making a complete std::vector template. when finished you will understand it perfectly
 
declared implicitly or explicitly
 
0
A: Array of Comparables in C++

RapptzA probable fix for this is to use a second template parameter that accepts a size_t. template<typename Comparable, size_t MAX_SIZE = 100> class OrderedCollection { private: Comparable data[MAX_SIZE]; //Error should be gone int _size; int _current;

 
@doug65536 When finished doing it correctly. Don't know if that's a good exercise.
 
I think it has become less intuitive though. I originally didn't expect there would be any difference between a() and b() here.
 
4:51 AM
@Potatoswatter yeah, hadn't considered that :)
 
GCC y u include the Java libraries in the SVN?
 
yeah I checked that out yesterday too.
going to see if I can contribute something to the buggy mingw-w64 effort. they're almost there
it helps windows developers escape non-c++ compilers :)
 
@stackedCrooked: Intuitively, the static value cannot be implicitly modified by returning it, since it continues to exist. The automatic object can because it doesn't.
 
@StackedCrooked = delete;: For when you absolutely, positively gotta kill every use of the function in the program.
 
4:55 AM
did you change the font for coliru
 
@rici But but look like regular copies.
@Potatoswatter Yes, when learning about it :D
 
"in a return statement in a function with a class return type, when the expression is the name of a
non-volatile automatic object (other than a function or catch-clause parameter) with the same cvunqualified
type as the function return type, the copy/move operation can be omitted by constructing
the automatic object directly into the function’s return value"
 
Hey @doug65536! :)
 
That's just NRVO.
 
yeah, exactly. The standard calls it "copy elision"
 
4:58 AM
"the copy/move operation can be omitted" -> my question was why it selected the move operation instead of the copy operation. Now I know thanks to @Potatoswatter.
 
@rici hmm, lambda-captures should probably be added to that list.
 
@Potatoswatter, good point.
I don't think that list was exhaustive. it's a note.
 
Who flagged that?
 
I didn't.
 
Any french speakers here?
 
5:10 AM
Somebody flagged this:
7 hours ago, by Zoidberg
FUCKFUCKFUCK
2
 
1
Q: Mysterious Floating Point Exception

David SaxonMy friend and I were messing round trying to come up with the worst for loops we could think of (so don't tell me this is terrible code, because it's supposed to be!). My friend came up with this for loop: for (int i = 0; i++ & ++i % (++i % 2) ? --i : i++; i++); It looks ok but it fails t...

 
It's cleared now.
 
@Pubby Not on the currently active list
 
@Pubby Etienne does.
 
do you believe that fp exception is real?
 
5:12 AM
Some french guy said this to me:
> parcompte mec prend le pas mal mais tu joues trés trés mal
I think he's saying, "you play badly," but google translate isn't great
 
i don't see where he says anything about google translate :)
 
^^
 
microsoft translator says: parcompte guy is wrong but you are playing very very evil
 
the last bit is definitely "you play very very badly"
 
but he's definitely saying that that you play badly
 
5:14 AM
I think the first bit is "don't take it bad, but..."
 
@Pubby bing.com/translator gives similar result
 
@Pubby je parle un peu
 
moi aussi
but mostly other romance languages.
 
mec = dude
tu joues trés trés mal = you play vey vey badly
 
:(
 
5:16 AM
mec prend le pas mal = dude, don't take it the wrong way but
 
compte = account ???
 
@user1690130 that sounds right, thanks!
 
haha, @Pubby tell us, what do you play :D ?
 
@Pubby thank :)
( please tell mooingduck that i helped :))
3
 
@doug65536 The FP exception comes from integer division by zero.
Yeah, it's a misnomer.
 
5:18 AM
@billz it was some video of old genesis game called gain ground
 
don't rule out the likelihood that the spelling was not perfect - from the other words, I believe he is simply saying "hey man - don't take it bad, but you play very very badly"
 
in a particular implementation it is handled through the fp exception handling system?
 
Can someone explain why this code prints "copy" in MSVC10?
 
hi GM @all
 
...and nothing at all if I delete the copy constructor?
 
5:19 AM
@MooingDuck bug probably
 
@doug65536 i think posix mandates SIGFPE for divide by zero
 
@Pubby that's vaguely expected at this point, do you know how I'm triggering it, or how to work around it?
 
@MooingDuck confirming it does print copy. bad!
 
@doug65536 seriously!
 
@MooingDuck just write move ctor yourself
 
5:21 AM
(oddly, GCC on my machine prints nothing at all)
@Pubby ...well that's blatantly obvious. Don't I feel foolish?
 
did you try adding a move assignment and copy assignment? shouldn't matter I know
 
@doug65536 I did, no change
 
Does =default work?
 
@MooingDuck sounds like you have yourself a really nice connect.microsoft.com bug to file!
 
@Pubby in MSVC? no
 
5:23 AM
@doug65536 again :/
@Pubby not in MSVC10
 
@MooingDuck Not in any.
 
that bug is 100% embarassing. how is that not hit in unit tests within 300ms of the test launch
 
@AndreiTita MSVC12 with the November CRT ought to
 
@MooingDuck Nope.
 
@doug65536 seriously
@AndreiTita wait really?
 
5:25 AM
@MooingDuck Been using it since December.
 
@AndreiTita the one with variadic templates?
 
@MooingDuck Yep.
 
@doug65536 do you have MSVC11 (2012)? Could you test it in that one?
@AndreiTita huh
 
I don't
I wouldn't mind getting express though if there is one
 
@MooingDuck I'm testing it atm.
 
5:26 AM
I can only find the bug report form for MSVC11
@AndreiTita thanks
 
@MooingDuck Without a move contstructor in the track class it outputs "copy" and with a move constructor defined it outputs "move"
 
@AndreiTita the code as I posted it prints "move" in MSVC11? They must have fixed the bug then :(
 
@MooingDuck No
As posted it prints "copy"
 
@AndreiTita oh, you meant in the track class
 
just put the version there, they'll route it
 
5:29 AM
Why does gcc print move anyway?
 
because he forced it to move with std::move
 
@AndreiTita because it's supposed to be moved
 
Not my point.
 
@AndreiTita because that's what's supposed to happen?
 
Is a move constructor defined by default for the track class? Is that standard or does it just happen for pod types?
I thought move constructors and assignment were not defined by default.
 
5:31 AM
@AndreiTita standard says if there's no explicit move constructor, copy constructor, destructor, and all members are movable, (and another requirement I forgot), then a move constructor should be implicitly defined.
 
oh crap
I see why now
track doesn't have a move constructor
 
@MooingDuck Ok, TIL that then.
 
@doug65536 it should have an implicit one
 
really? that's asking a lot from the compiler
implicit = bad IMHO
 
@doug65536 works exactly like copy constructors for C structs.
 
5:32 AM
the standard requires that? (implicit move when everything contained has move)
 
@MooingDuck What's the relevant part in the standard?
 
§ 12.8/9 "9 If the definition of a class X does not explicitly declare a move constructor, one will be implicitly declared as defaulted if and only if
— X does not have a user-declared copy constructor,
— X does not have a user-declared copy assignment operator,
— X does not have a user-declared move assignment operator,
— X does not have a user-declared destructor, and
— the move constructor would not be implicitly defined as deleted.
[ Note: When the move constructor is not implicitly declared or explicitly supplied, expressions that otherwise would have invoked the move constructor may i
 
I know what their answer will be: get vc11, we fixed it
 
@doug65536 Andrei confirmed it's not fixed in VC11
 
that's the eternal answer
tell 'em to learn cmake and get mingw-w64 workin'
that is an example of why I'm migrating to gcc
 
5:35 AM
@MooingDuck Yeah. Well I knew already that VC11 was not providing default move constructor and assignment, I just thought that was standard.
 
s/11/(n+1)/
 
not that i have anything against gcc, but isn't "we fixed that, upgrade" a standard response from them, too? Or any other similar product?
 
@rici usually with GCC it's "you made <such and such> typo, works fine"
 
gcc doesn't just leave it and make you wait a long time for the next release to fix it. like the fake emplace methods copied/pasted from push_back in msvc 10
 
actually, my gcc bug reports are just hanging around in the bug queue. But to be fair, they're not earth-shattering bugs.
does libstdc++ now have emplace for associative containers?
 
5:40 AM
one person can sit down one evening and put emplace all through the containers. why is it such a big deal?
 
@doug65536 ah, but can you do it right?
 
no variadic templates in msvc 10, so I just pounded out 10 overloads, beyond that who cares
my point is, as the compiler manufacturer, leaving that unfinished for years is unacceptable
 
looks like it took more than an afternoon, though.
 
@doug65536 passed your test cases, but if it were really that easy there's probably some corner-cases you missed
 
a container is already taking complete control of constructor and destructor calls. it is trivial to add code paths that are consistent with the regular ones for rvalues.
 
5:52 AM
Magic numbers are bad. Use std::vector<Comparable> instead. — bames53 20 mins ago
What is he talking about?
 
@Rapptz copy paste error?
@Rapptz oh, he's misusing the term.
 
I think he means that you shouldn't make a container class with any arbitrary ("magic") size limit; just use std::vector, which doesn't have an arbitrary limit.
and if so, I agree.
 
Well, I'd suggest vector too but what if OP doesn't want a dynamic container?
 
why no diagnostics on this - no Wall Wextra etc?
 
@rapptz: std::array ?
 
5:56 AM
@doug65536 that's a really good question
 
@rici yeah I guess that works too
 
but if he doesn't want a dynamic container, what's the point of _size and _current members?
 
I don't know, OP didn't really provide enough context.
In fact that code snippet is the only thing he provided, I have no idea what they do
 
true, but it's possible to guess. I doubt whether _current is the phase of the moon.
 
@MooingDuck if you cite the standard in your bug, I think your bug will be routed better.
 
5:58 AM
@doug65536 stacked-crooked.com/view?id=d241b9a6b9ca8a5e69551e5df073f17f this has -pedantic but it doesn't have -Wall
 
good. at least you get a diag for really really bad typo bugs that are valid, like that one
 
You can probably ask @StackedCrooked if he can turn on -Wall
 
@doug65536 it's not valid C++
 
right, it makes no sense. essentially, it's like a label that points to that offset - which isn't meaningful in c++
you could probably setup the compiler to assume horrible aliasing (or not use optimizations) and have that array be the rest of the members :) hacks!
 
That wouldn't work in c99 either. "flexible array member not at end of struct"
 
6:02 AM
My tree-based vector class is complete! And passes my initial tests! ideone.com/mTrPYX (requires a value_iterator: ideone.com/xjFGrz)
 
@MooingDuck "tree-based vector"???
 
@Pubby sure
"This container matches the same interface with the following exceptions
The elements are non-contiguous.
There is no capacity(), reserve(), shrink_to_fit(), or data() member functions.
Iterators and references are never invalidated, unless the element has been erased/cleared
Virtually all operations are logarithmic. (including iterator advancement)"
 
@MooingDuck nice! have you pounded the hell out of it with some unit tests yet?
 
@doug65536 well, it compiles, and passes a whole bunch of simple asserts, but no.
I figured I'd post it here, and someone may or may not try to use it and find bugs for me :D
Also I'm happy that it passed a bunch of asserts.
Alright, bedtime. See you all tomorrow
well, probably not, due to your estimated time zones. See you later!
 
goodbye friend
 
6:25 AM
@MooingDuck good night! :)
@MooingDuck je t'aime
 
-1
Q: Declaring variables via macros in C

SunnyI have a struct: typedef struct{ int a; int b; } MYSTRUCT; MYSTRUCT newName; Then I pass this to a function requiring argument of type MYTRUCT: callFunction(newName); Is there a way I could replace MYSTRUCT newName; with a macro and then pass that macro to this function and then automatica...

 
@MooingDuck nite
 
@doug65536 hey!
 
Hi
Anyone familiar with IPIP tunnels here?
 
@Bruce i might be
 
6:37 AM
I have set up an IPIP tunnel between two endpoints. There is a telnet server listening on the tunnel interface IP at one endpoint. The detunneled SYN packet reaches this tunnel interface (with no MAC header?) but the server does not send a SYN ACK. Do you know how to fix this?
I had to enable forwarding for the detunneled packet to reach the tunnel interface echo 1 > /proc/sys/net/ipv4/conf/tun1/forwarding
I think there is some kernel option I am missing somewhere..
 
Hi, super noob question from a student studying for a test. How do I make a char array on the heap?
 
@Deekor: Use malloc/calloc
sorry use new
 
@bruce that what i thought but char arr[100] = new char[100]; isnt working
whoops meant char[100] arr = new char[100];
 
char * arr = new char[100];
 
ah ok. But that wont work for an int correct?
 
6:42 AM
use int * for int
 
and the call delete arr; to release memory right?
then
 
yep
 
Perfect. Thank you
 
delete [] arr;
 
0
Q: Issues with homemade keylogger in C++?

user1998492As I am new to C++, I decided to further my skills by creating a simple key logger. However I am having many difficulties with the program. I am aware that my while loop is causing most of the problems, but am unsure on how to fix it. My goal is that when a user presses the up arrow key, the whil...

^^ err...
 

« first day (843 days earlier)      last day (4107 days later) »