« first day (203 days earlier)      last day (4762 days later) » 
00:00 - 22:0022:00 - 00:00

12:25 AM
Huh a chat that allows editing. I've seen that feature in Skype before, I still think it's pretty strange.
 
it is strange; it's only limited to around 3 minutes though
there's a sandbox room if you want to test :P
 
Oh cool, where is it?
 

Sandbox

Where you can play with regular chat features (except flagging...
 
Thanks
@FredNurk How do you do that thing where you link something without inlining it?
 
just put some text before it: chat.stackoverflow.com/rooms/1/sandbox
 
12:38 AM
Yeah but you did it without putting any text before it above.
 
without text, the chat "one boxes" many kinds of links
that's what you saw the first time I gave that link (it was the same link both times in my recent messages)
 
Ah I see, it's smart enough to know not to inline stackoverflow links.
 
actually, the stackoverflow.com link I gave before isn't one the one-boxer can understand
it was a direct link to a comment rather than a question or specific answer
 
Ah I get it, it can't do links with anchors.
 
12:58 AM
Considering the current sad state of our computer programs, software development is clearly still a black art, and cannot yet be called an engineering discipline. -- Bill Clinton, former President of the United States
no idea on when that's from, but it's interesting to see that view from an outsider
at least, I think he doesn't program... :)
The problem with using C++ ... is that there's already a strong tendency in the language to require you to know everything before you can do anything. -- Larry Wall
 
I've often said C++ is the second worst beginner's programming language (after Managed C++).
Definitely has lots of powerful features you can't find elsewhere though, like the template system.
 
1:19 AM
I don't know if I could go that far
but I really, really wish there was a language that fixed c++'s faults that I also liked. python comes really close in many ways, but it's just not suitable sometimes
 
D is an attempt at such a language
 
I know, but I really don't like D
 
I don't know D enough to either like or dislike it. I've never used it in production code...
I have a friend who loves it though
D and Obj-C -- loves of his life
(and then there's his girlfriend)
 
I strongly resisted python at first, mainly because of the whitespace issue
 
I'm still resisting it because of that
 
1:24 AM
it took two friends to sit down with me and hash over (which required me to first verbalize) why that seemed wrong in order for me to see it really wasn't a problem
maybe there's something similar with me and D
 
I don't like syntax forcing me to structure code in a certain way
and I find it confusing
 
@RonaldLandheerCieslak I have since seen a quote from, I think, S. Lott (who is active on SO) along the lines of "properly indented code in other languages may or may not work, but in Python, it always does what it looks like it does"
or maybe it was something like "everyone, in any language, tells you to at least get your indentation correct to make your code readable. you can't avoid that aspect of readability in Python"
both seem poor rephrasings
 
both have a point, though -- but it still doesn't sit right to have my hand forced to indent a certain way
 
if you had a new c++ programmer on your team who couldn't indent properly, how pissed off would you be?
     int main()
{
          cout <<
    blah
;
              }
 
Ok, that code is very badly indented
But indenting wouldn't piss me off (though your example is pretty bad) - it would be the topic of a discussion
 
Anyways, I just spent some spare hours learning brainfuck, so I guess Python shouldn't be worse :-)
 
"Most folks who beef about whitespace are meticulous indenters in Java or C++. I don't know why they complain about Python when they already indent perfectly in other languages."
I guess I read a lot more into it in my memory :)
 
:-)
OK, you convinced me. Python will be the next language I learn
 
I actually wasn't trying to be convincing this time, just relating my experience getting over this particular hump :)
 
At least I'll understand Boost.Python from both sides...
Well, you did convince me - I guess you're more convincing when you're not trying ;-)
G'night - gotta go
 
1:49 AM
@RonaldLandheerCieslak often that's how that goes :)
 
 
2 hours later…
Tek
4:08 AM
Where does ifstream open() search for the file?
 
4:29 AM
@FredNurk This reminds me of Picasso.
 
5:14 AM
Cubism code style.
 
 
2 hours later…
6:45 AM
good morning :)
 
6:58 AM
Hi Nils
 
I want to add a class (or a struct) of which there is one instance and every object should have access to it. It's for storing debug data, what's the way to do it?
 
7:15 AM
@Nils: sounds a lot like a global -- if you're sure everything else needs access to it.
 
probably not the proper solution, however I just need to extract some debug data
I also tried to attach it to some of the base classes, but they are sometimes used as const, so it didn't work
 
7:49 AM
humm seems like I still don't understand all the implications of const
if you need to modify a const class just cast the const away lol
 
8:10 AM
Hi everyone
 
jjj
hi
 
hi @jjj
any netbeans user !?
I can't see where I can add the devpaks
 
lol
 
what is funny @Nils ?
?)
 
I wouldn't recommend netbeans for C++
 
8:14 AM
that makes sense, but not for my situation, but still that is not my answer.
 
yet no
but anyways
even in visual studio how can i use a devpak ?
 
what devpak?
 
openglut
 
just like any other libraries ensure that the path to the includes and to the dlls are set correctly
 
8:29 AM
a devpak, something.devpak
 
Coding C++ on Saturday morning, guess I need some vacation youtube.com/watch?v=eWUC5Q0RCAA
 
8:44 AM
I am so drunk rifgr now LOL
whos wt me
whos with*m me
 
sry
 
for wat
 
:D
 
what*
:D
brb more whostkey
whiskey*
 
hi @Gman
 
9:13 AM
0
A: Favorite music to listen to while coding

NilsCurrent favorite DJ Peaceful- The Dream Weaver (Live Set)(kaZantip)

 
@Nils hahaha, everyone got they are own test of music that question super subjective !
 
of course, just paste yours as answer and maybe somebody likes it..
 
9:29 AM
Morning
 
afternoon
 
hi all
 
Hello @OmeidHerat @Miss
 
how to use this website
 
anyone using OpenGLut outhere ?
 
9:40 AM
what is the use of that website?
 
 
1 hour later…
11:04 AM
hi
 
@deadMg hi
how to use this website ?
i mean what is the use of that website
?
@deadMg do you know that website?
 
11:48 AM
hi there
bogus boy arriveth
ETBOOLEAN operator==(const ECField &rhs) const;
what does this mean
?
 
it overloads the == (comparision) operator
 
What C++ knowledge should i have to create simple (pong) game?
 
Als
@BogusBoy: Its an overloaded == operator for class type ECField
 
I can create pong for now but i think the code will be one big mess...
 
hey I am having trouble with ECField type
@Als
can you help me out
it's not a big deal but I am only conversant with obj-C
 
11:56 AM
what is the use of this website googlingyou.com/…
 
I've asked it wrong... What things/knowledge could be usefull when creating a game in c++?
 
see the "=" in my code is overloaded
and then there is a pFld->data which is eFTNULL
 
@Miss no idea, why do you care?
 
well i just want to know ..
 
now how can I do this if (pFld->data == eFTNULL) writing this code tells ambiguous overloading of "==";
 
11:59 AM
i am feeling not good. i catched cold.. :(
 
@Robik For a simple pong game I would use something like openframeworks or cinder. In this case you need 2d geometry and vectors. So I would write or use some vector classes and overload the operators you need. Then you can try to implement simple geometrical stuff like specular reflection..
 
go get some medicine
 
@Miss sry to hear about that
 
martin arriveth
 
@Nils Pong game! Ping
 
12:01 PM
Martin arriveth
 
@Nils I'm currently working on SFML, know classes and some patterns, anything that could be usefull or it's enough?
 
@Robik I have much stuff to code, but I never wrote a pong game myself, will probably do it when I have time.
@Robik Never heard of that before, but looks useful.. Well personally I first learned plain C and then C++.. but some basics of OOP and maybe operator overloading for the vectors should be enough..
 
Thanks! I've asked because i don't wanna start writing games too early (and be noob that writes games without enough knowledge)
 
@Robik: You can't, really
the fact is that you write a game, you utterly fail at it because you suck, then you know that you suck
trust me, I did it
 
It's all about logic and preformance
 
12:06 PM
Humm wondering what some simple things are one can do when starting coding with C++..
writing a text based adventure game?
 
anybody
going to assist me in sorting out the ECField predicament
?
 
@Nils Or super advanced MMORPG :)
 
if you do something simple, then you won't learn from it
jump in to DirectX, that's my advice
Bogus Boy, just post a question, you moron, that's what it's for
 
I will stay in 2D for a moment
3D maths are to advanced for me
 
:)
 
12:08 PM
// if ( iRet == RETCODE_Success )
// iRet = SqlBindTextCapped( g_pUpdateEmailStatement, 33, pEmailItem->pcHtmlBody );
see the "==" in my code is overloaded
and then there is a pFld->data which is eFTNULL
 
you already explained it once
 
now how can I do this if (pFld->data == eFTNULL) writing this code tells ambiguous overloading of "==";
 
www.stackoverflow.com - use it
 
ok
 
@DeadMG Disagree DirectX is quite difficult for a beginner.. if you want to show somebody how some algorithm works you can do that with a plain simple programming language/framework like processing. It's algorithmic thinking that beginners should learn I think.
 
12:09 PM
not here then
 
@Nils: That's the point.
 
Deaddog
what is that
?
 
you won't learn any C++ apart from std::vector::push_back doing some text-based adventure game
 
okay I will post it
 
it won't push your skills, it won't give meaningful feedback on where you suck
 
12:10 PM
bogus buy leaveth this forsaken chat room
no good
 
@DeadMG ok
 
can possible come of discussing here
 
when you try to write the next Unreal Engine and you utterly fail, then it shows you the holes in your programming
 
implementing your own vector class and do something with it (and use templated vectors) will help you more learning c++
 
implementing your own vector class is trivial, really
you already have a class design and specification thanks to the Standard
 
12:12 PM
@DeadMG Unreal Engine: You will utterly fail anyway unless you have a team of highly skilled coders
 
Well, I've written Pong when i didn't know about std::Vector existence :D
 
there is that
 
no I mean vectors as in math
 
Oh
 
oh
 
12:13 PM
Ah these...
 
then why would you do that? every 3D API comes with a mathematical support library
 
Still dunno what's Vector normalization
 
@Robik making a vector that points in the same direction, but with the length of 1
 
But you have still 2 ints?
 
sure a two dimensional vector has two components
 
12:15 PM
float, more commonly
 
yes
 
What it is for?
I guess it may be usefull when saving vector to file
 
usually for vectors that represent directions
 
But only when unnormalization is possible..
 
not positions
 
@Robik You are worrying about performance of a Pong clone? Really?
 
A bit
 
:)
 
Especially when using primitives ^^
Every micro-second is rare
Trying to keep FPS over 1 :) </sarcasmOrWhatever>
 
> It's algorithmic thinking that beginners should learn I think.
@Nils I totally agree!
 
12:20 PM
you kidding? you can render 300k verts in 3D and get 1800FPS
and I've got a relatively weak graphics card
a Pong clone would easily get thousands of frames per second
 
you kidding? well, yes :)
 
@Robik Maybe you can look at some of the examples on processing.org once you understand how they work you can port them to C++
 
Thanks.
 
12:48 PM
and what about making c++11 a synonym of c++ ?
or is this too early
 
They could add parseInt equivalent to core :/
 
 
2 hours later…
2:42 PM
there's atoi
 
I've heard it's evil (dunno why) :)
 
Writing lexical_cast is trivial (but it's already in Boost, so why bother).
 
boost is evil :P
@Robik because it uses c strings instead of the C++ string from the STL
 
Well, writing C++ and not using Boost is stupid. :P
atoi can't report input error reliably.
It returns 0 for invalid input, but 0 can also be returned for a valid one.
 
Boost is already "included" to c++?
 
2:55 PM
And atoi doesn't support other bases. strtol does, but it still sucks.
@Robik It's not distributed with compilers, if that's what you mean.
Some parts of it made it into standard library already, though.
 
Lke lexical_cast?
 
no
I don't think lexical_cast is in the next Standard
 
So i will need download and "install" boost?
Like other libraries?
 
3:15 PM
how the hell else are you gonna get Boost's features?
 
Just wonna be sure ^^
 
it would have been faster for you to just try it
 
I'm slow at these things for real... :|
 
3:33 PM
anyone used openglut out there ?
 
4:06 PM
@OmeidHerat what form of self abuse would compel one to use openglut for anything?
 
@ChrisBecke someone else is bad test of Graphic Library.
 
glut I can understand. its already installed everywhere. and it lets you quickly write openGL samples...
but using OpenGlut is akin to saying you have actually chosen a framework to develop & deploy your OpenGL using application.
 
not glut, openglut.
 
in which case you would be far far more better off using SDL, or Ogre, or even just writing the app in the framework native to your target platform.
 
4:32 PM
hmm.. my browser apparently stalled for several hours
 
5:14 PM
hey guys
I've been thinking of using a quadtree or something as a UI layout tool
 
I am sick of looking around, does anyone know a working 15-puzzle solver in GNU C/C++ ?
 
on earth is 15-puzzle?
and are you in C, or C++?
 
anything will do C or C++
N-Puzzle
@DeadMG
 
 
2 hours later…
7:05 PM
folks
 
Hello @JohannesSchaublitb
 
cpx
@JohannesSchaublitb hello
 
7:28 PM
@DeadMG U mean for the automatic arrangement of the gui components?
interesting
 
7:38 PM
hello
 
hi
 
@Nils how are you today?
 
fine
well I was running we have a city run once a year.. figured out that I was in better shape last year ;)
 
lol watching coupling
 
Xeo
8:10 PM
4
Q: Casting pointer to reference?

AfiefhHello, I've been reading some OSS code lately and stumbled upon this peculiar piece: class Foo { ..... }; void bar() { Foo x; Foo *y=new Foo(); x=(const Foo &) y; } For the life of me I can't find documentation about the behavior of casting a pointer to a const reference. Is the...

 
8:23 PM
< stretches out> Hello every one... I have almost made it out of University shit... So much frigging work!
Did I miss much?
 
8:51 PM
@Xeo I didn't even know your code would compile if you cast a pointer to a reference
@JohannesSchaublitb we can't, not without an admin's help. SO won't let you turn a tag into a synonym of a less-used tag, and there are a lot more C++0x questions than C++11 ones. I thought about posting on meta, but figured we might as well wait a few months until C++11 is 100% official
 
sbi
@jalf I actually flagged for a mod on that "question" by Howard Hinnant. Since my FF lost its session (again!) I can't find it anymore.
 
Shouldn't be hard to find. It's tagged c++11 after all :D
28
Q: When will C++0x be finished?

Howard HinnantOk, this is the first question I've asked and I didn't know you couldn't answer your own question. Answer: March 25, 2011. :-) I'm not kidding, it's official. Well, at least as far as the committee is concerned.

one of 8 questions with that tag ;)
 
sbi
@jalf I meant I can't find it among my open tabs. :)
 
Xeo
0
A: Casting pointer to reference?

XeoInterestingly, the misread code could still be possible, if Foo has a non-explicit constructor that takes a Foo* pointer. #include <iostream> class Foo{ public: Foo() {} Foo(Foo*) { std::cout << "Aha!\n"; } }; int main(){ Foo* pf = new Foo; Foo f = (const Foo&)pf; st...

 
@Xeo: the misread code compiles without defining a single constructor, which surprised me
 
Xeo
8:58 PM
@jalf Well, that's the power of C-style casts
 
@Xeo where does it say, though? I couldn't find anything in the standard that'd allow it
 
Xeo
But my answer shows a well-defined way to make it work :)
 
C-style casts don't allow you to convert between completely arbitrary types. But apparently, X* to X& is allowed. How come?
 
Xeo
@jalf Urm.. they do. They allow you to cast from a pointer type to anything other pointer type
maybe it works because references are (mostly) implemented as pointers?
 
sbi
@jalf C++ is a democratic language. Whatever isn't explicitly forbidden, is allowed. :)
 
9:01 PM
@Xeo Where does it say? (Also, casting from a pointer type to std::string fails. So obviously not to "anything else")
 
Xeo
@jalf edited :)
 
@Xeo but since when is a reference a pointer type?
ah, guess I'll call for reinforcements... @JohannesSchaublitb, why can I C-style cast from X* to X&?
 
@jalf a C-style cast is the first that succeeds out of some ordering (I forget the order) of static_cast, const_cast, reinterpret_cast, const_cast+static_cast, const_cast+reinterpret_cast
reinterpret_cast is implementation-defined, and I could see it allowing X* to X&
 
@FredNurk yeah, but which one of those allows this particular conversion?
@FredNurk No, the result of reinterpret-casting is implementation-defined. But it's very well-defined which conversions are well-formed
 
@jalf at worst, you can try each cast allowed by C-style casts and see which your compiler accepts; iirc there's only one loop hole C-style casts get through that new style casts can't
and that loophole is related to accessibility
 
9:06 PM
the (c++0x, only one I have at hand) standard says, re. reinterpret-cast, "Conversions that can be performed explicitly using reinterpret_cast are listed below. No other conversion can be performed explicitly using reinterpret_cast. So it's not implementation-defined whether a conversion is allowed under reinterpret_cast
@FredNurk what is that loophole again, btw? I've been told a million times, and I keep forgetting it
 
@jalf then perhaps your compiler is allowing a non-standard reinterpret_cast conversion
 
@FredNurk that's what I thought, but I've tested with GCC, Comeau's online thingy, and VC10
 
@jalf I'd have to look it up, all I remember is a C-style cast can ignore accessibility in some situations where a new style cast cannot
 
with the strictest options I could come up with for all 3
and they all accept it
 
but I have to go now
 
9:09 PM
@jalf i mean, does it make sense to make c++11 a synonym to c++ ?
probably not..
yes, it doesn't make sense
it would be the hierarchy kind of thing not the synonym thing
 
can you guys do a brother a favor?
 
@JohannesSchaublitb ah that, yeah, probably not. The c++ tag is used to refer to pre-C++11 questions as well, after all
 
evening all
 
@JohannesSchaublitb so, any idea on the cast thing? I won't be able to sleep before someone's figured it out ;)
and I'm super tired :(
@TonyTheTiger howdy
 
@jalf ive not followed the discussions :(
 
9:14 PM
@jalf howdy! How are you?
 
@jalf ohh!
"why can I C-style cast from X* to X&?"
 
Well, someone on SO misread some code, and asked what it meant when you C-style cast a pointer type to a reference type X* p; X v; v = (const X&)p;
 
you shouldn't be able to!
 
Yeah, that's what I'd have said too. But it compiles under every compiler I can thnik of
 
well that can work
if X has a ctor for X*
or X is void*
but it cannot work if you use a non-const ref
 
9:16 PM
I tested it with a dummy class with a single default constructor, but it still compiles
under gcc, comeau online and vc10
 
testcase or it didn't happen xD
 
oh, it's a reinterpret_cast
 
@JohannesSchaublitb I don't get what the const in that cast is all about?
 
yeah that works
if you would replace p by a +p it will fail
@TonyTheTiger yes, it is of no significance here. i was confused
 
9:21 PM
why does reinterpret_cast allow it?
 
because that's what it'S for
 
converting pointers to references?
 
reinterpret_cast<U&>(t) is equivalent to *reinterpret_cast<U*>(&t)
(with the built-in meaning of '&')
no, type punning
 
@JohannesSchaublitb hmmm interesting
 
Yeah, but that just says you can convert between reference types just like you can convert between pointer types
 
9:22 PM
casts still confuse me, when you can and cannot cast
 
it doesn't say you can convert pointer to reference
 
i don't understand
you just treated a X* as if it were an X
the spec says "No temporary is created, no copy is made, and constructors (12.1) or conversion functions (12.3) are not called."
 
In the test case, I'm casting from a pointer type to a reference type. The equivalence you mentioned just says that if you can convert from U* to V* then you can also convert from U& to V&. It doesn't say you can convert from U* to U&, which is what happens here
unless I'm missing something obvious
 
@jalf a pointer variable is an object. there is nothing special about it. you can reinterpret its bits like you can reinterpret everything else
from an lvalue of type U. your "p" is an lvalue of type X*
 
so you'd be allowed to cast it to type X*&, sure'
 
9:26 PM
i don't understand
i think you need to get a coffee about that, and then approach it again
 
:(
@JohannesSchaublitb what do you mean?
 
struct A { A *p; }; int main() { A *a; A&b = (A&)a; b.p = 0; /* now a is a null pointer */ }
 
I still don't get why the cast is allowed
 
perhaps it's clearer if you replace "A&" by "char&"
 
hmm, sec
oooooh
so, going back to the equivalence you mentioned before, what's effectively happening is a cast from U** to U*
which is then dereferenced
that's evil
ok, I get it :D
thanks
 
Xeo
9:57 PM
0
Q: Why is it allowed to cast a pointer to a reference?

XeoOriginally being the topic of this question, it emerged that the OP just overlooked the dereference. Meanwhile, this answer got me and some others thinking - why is it allowed to cast a pointer to a reference with a C-style cast or reinterpret_cast? // disregard the leak please. int main(){ ...

and with that, I'm leaving for today. :)
(Note: I didn't follow your conversation, was busy typing the question.)
 
00:00 - 22:0022:00 - 00:00

« first day (203 days earlier)      last day (4762 days later) »