« first day (473 days earlier)      last day (4461 days later) » 

3:00 AM
@LearningC Only in your dreams
 
@EtiennedeMartel What? When? Why? How? By whom?
 
Ever considered switching to C++? C is crap.
@RMartinhoFernandes Last time I shared some TVTropes, some people were less than happy about it.
 
Well my school only teaches C for electrical engineering
 
Xeo
http://xkcd.com/1009/
http://tvtropes.org/pmwiki/pmwiki.php/Main/EvilOverlordList
http://icanhascheezburger.com/
 
If you're doing embedded stuff, then it makes sense.
 
3:00 AM
@EtiennedeMartel They never are. But they usually are too busy opening new tabs to complain.
 
"I'm just gonna check this link real quick. What can possibly go wrong?"
 
@Xeo are the links safe for work?
 
Are you at work?
 
In the sense that there's no NSFW stuff in them, yes.
 
Xeo
Depends. Is it safe that you will completely abandon working?
 
3:01 AM
no, its 10pm no one works at this time
unemployed
 
You probably won't be able to wank with the stuff that's in these links, no.
 
But if you open the TVTropes one you will probably not do any work for the next three hours. Or more.
 
wow
will my hand be doing work?
 
My first TVTropes binge started after dinner and ended when I realized the sun was rising.
 
ouch. your hand must be broken after that...
 
3:03 AM
Depends on what you mean by "work".
 
you know.... typing and clicking
 
It's mostly just slowly scrolling while you read and click on links.
 
I have to work hard to get my hands do what it is supposed to.
8 year old mouse
 
Xeo
XKCD and TVTropes in a single link. It's the worst thing to post here, imho.
 
Exactly that.
 
Thing is, I saw that comic after discovering TVTropes.
(Because I'm soooo cool)
And, let's say it struck a chord.
 
Xeo
@EtiennedeMartel Did you notice that it directly links to TVTropes?
Oh, and I noticed that my question asking to onebox TVTropes links got deleted.
 
Bastard Randall.
 
@Xeo What.
 
@Xeo Oh, you asked that? lol
 
3:08 AM
I got rickrolled.
 
Xeo
Hey, it's just another wiki. :(
 
@Xeo No, it's The Wiki. Another wiki is The Other Wiki.
 
Xeo
hrhr
 
Wikipedia is The Other Wiki.
 
For anyone interested, Howard posted a link to nice chrono docs in a comment to my latest answer: open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2661.htm
 
Xeo
3:09 AM
Hm. Is there any way to find my own deleted questions?
 
where is your answer?
 
Not that I know of.
 
SO's search is lacking.
 
so where is your answer in the docs?
 
I'm confused.
 
3:11 AM
Maybe I'm the one confused. What is a chrono docs?
 
It's documentation about the <chrono> library from C++.
 
(Which was mostly lifted from Boost)
Without Boost, there would have been no new library in C++11.
 
Xeo
@EtiennedeMartel Think so?
 
@R. Martinho very nice.
Boost the phone company?
 
3:13 AM
@EtiennedeMartel Without the desire to have new libraries in C++11, there would have been no Boost!
 
Xeo
@EtiennedeMartel Afaik, that's not true at all. stackoverflow.com/questions/307596/time-difference-in-c/…
It was added to Boost after Howard implemented it.
 
Ha, take that.
 
I stand corrected.
 
std::ifstream file("log.txt"); char ar[256]; while( fStrm.getline(ar,256) ) { ... }. Now is there any way to get rid of the char array and use std::string instead.
 
Xeo
@Mahesh std::getline(fStrm, str)
 
3:15 AM
What he said.
std::getline is declared in <string>.
 
Usually not a problem if you plan to use std::strings.
 
Which is the whole point, I guess.
 
@Xeo Why don't the std::ifstream::getline(std::string & str) is not present ? Is there any specific why this overload wasn't present ?
 
Cat ate your sentence.
 
Cat is not here.
And he's not really a cat.
@Mahesh std::string was introduced after iostream.
That's why fstream's ctor takes a const char *.
 
Xeo
3:19 AM
One advantage of Boost.Chrono is that it will adopt chrono::date before C++1y will (last point). :)
 
Now it takes std::strings too!
> Include Stopwatches.
Neat.
 
@RMartinhoFernandes I am using VS 2010 and they boast of most C++11 features are implemented. Isn't the case ?
 
Yay, I got my second tag gold badge :-)
 
Xeo
@Mahesh No.
 
What tag? ?
 
3:20 AM
@Mahesh Define "most".
AFAIK, even VC++11 has only a few C++11 features.
 
most: some
 
@RMartinhoFernandes Indeed!
 
Xeo
@EtiennedeMartel #define most almost_none
 
@EtiennedeMartel Not all
 
I would say that the biggest three C++11 features are variadics, rvalues, and lambdas
 
Xeo
3:21 AM
@RMartinhoFernandes Well, aren't those just two calls to chrono::some_clock::now() and a diff?
 
and VC++ does have rvalues and lambdas
 
Xeo
I'd make big 4 of it and add type inference.
 
@Xeo But stopwatches are neater.
 
An updated memory model is nice, also.
 
well, it does have auto and decltype, mostly
 
3:22 AM
@Kerrek has one in the FPAs.
 
@RMartinhoFernandes The what now?
 
@KerrekSB A stopwatch. We built it together.
 
"What what the the fuck fuck", said Day9.
 
@RMartinhoFernandes Ah, indeed. I was actually trying to poach that earlier to answer that epoch question.
But I wasn't fast enough.
 
3:26 AM
Is there any standard that says a line in a file can have a maximum count of characters ?
 
don't people usually advise 80 characters per line
 
Xeo
I don't think he's talking about code files here
 
Otherwise it won't fit on a punched card.
 
3:27 AM
Are you trying to justify using getline with char arrays?
 
Xeo
Anyways, my head's gonna esplode from the headache if I don't lay down soon, so g'night everyone.
 
@RMartinhoFernandes If no, how would std::getline behave for a text file has 80 chars and a doc file that has 85 chars ?
 
Xeo
@Mahesh It reads until \n
Or whatever you specify as a "linebreak" in the second argument
 
It gets you a line. Lines are separated by line terminators.
 
3:28 AM
@EtiennedeMartel I thought it would get a child after the f**k :)
 
Yeah, well, what the fuck do you think getline gets?
 
@Xeo Good night.
 
It gets a line. And what is a line? A bunch of characters that ends with an end-of-line character (or characters in the case of Windows).
 
@EtiennedeMartel I forgot about the line endings that each line in a file has.
 
I'm confuzzled.
 
3:31 AM
@RMartinhoFernandes There, that'll fix your confusion.
 
line-terminated strings are like C-strings
they should be size-prefixed
 
std::getline just works.
 
And that's why it's used.
 
@DeadMG What do you mean by size-prefixed ?
 
storing the size of the string along with the string itself
 
3:50 AM
ala Pascal
 
I forgot what I was planning to do.
 
Me too.
I just went to TVTropes.
Now everything is a blur.
I think I'm gonna go make myself a sandwich.
 
@EtiennedeMartel no
I hate you
was gonna get some work done
 
It's not like I shared a link or something.
 
Here's a link for anyone that needs one: tvtropes.org/pmwiki/pmwiki.php/Main/MegaCorp
 
4:05 AM
Thanks.
 
4:15 AM
Alright, I'm gonna get some shuteye.
See ya everybody.
 
I've never seen tvtropes before... ...looks interesting

Remember the site the other day that wrote fake scientific papers?

I wonder if you could use the same kind of algorithm on tvtropes to write fake manuscripts...
 
a thought: macros tend to use things like "do {} while(0)" to get single statements. Wouldn't just enclosing the stuff in curly braces accomplish the same thing, since (at least in c++, idk about c) they create their own scope without any accompanying logic constructs?
I mean, I assume there's something I'm missing otherwise it would already be done that way.
 
Bye guys.
 
oic, the semicolon. makes sense.
 
4:39 AM
damn, I'm getting an error : Cannot find -lgcc_eh
???
 
could you elaborate a bit?
 
yeah, it was in allegro's docs that you need to link to gcc_eh for a static build.
if I don't link, I get Undefined reference to _Unwind_Resume
 
Ah.
Try gcc_s
 
okay.
still getting it. :(
 
check under /usr/lib/gcc/$compiler_id_blahblah
 
4:44 AM
Are you using g++?
 
yeah, with MinGW.
 
my install has libgcc_eh.a there.
 
mingw is gcc
just the windows port
what distro are you on?
 
I'm on Windows...
 
4:46 AM
I mean invoking the compiler with g++ (i.e the C++ frontend), not gcc (the C frontend).
 
oh
@RMartinhoFernandes oh also
search in your gcc install directory for anything with gcc_eh in it
 
@RMartinhoFernandes I'm using CodeBlocks, I think it does that automatically.
 
no, I mean to verify that it exists
 
okay.
it doesn't exist.
there's only a libgcc.a and a libgcc_s.a
 
and -lgcc_s didn't work either?
 
4:48 AM
nope. :(
I thought it would.
 
they spit out the same error?
 
Hmm, none of my MinGW builds have any of libgcc nor libgcc_s.
 
but the thing works fine with dynamic linkage?
 
yeah. dynamic link is working fine.
but it's 23 DLLS. O_O
 
4:50 AM
haha
 
plus OpenGL.dll and zlib.dll etc.
 
what happens when you try building without gcc_*?
statically, I mean.
 
the same thing.
 
Do you have ALLEGRO_STATICLINK defined?
 
undefined reference to _Unwind_Resume
@RMartinhoFernandes wait, no. should I define it before including allegro.h?
 
4:52 AM
That kind of thing is to define on the command-line.
-DALLEGRO_STATICLINK
 
There's an option in Code::Blocks project options.
 
yes, I added it to #defines.
not working. :'(
 
What's your GCC version?
 
4:57 AM
And the Allegro binaries you have are for...?
 
wait, ill check
I think they are work 4.4
It's not mentioned. It's just written they are for MinGW.
 
Oh, you didn't get them from here? allegro.cc/files
 
no, I'm an idiot. currently downloading.
hope they work. :)
 
lol.
damn the questions I hate most on forums and sometimes they appear even on SO, are, Is X language as fast as Z ?
 
5:02 AM
Is Spanish as fast as French?
 
or, X Language vs Z Language for Game Dev ?
lol, Gibberish is the fastest.
 
Need some help with using circular dependencies in C++. Anyone?
 
Forward declarations are probably the solution. But you may want to explain the problem first :)
 
I have two classes in the same cpp file
class A
{};

class B
{};
Need to access an object of B from A
Tried putting
class B;
at the top
Actually class B is declared like this:
 
downloaded the binaries. now if this doesn't working, I'll be going to the asylum in a straight-jacket pretty soon.
 
5:05 AM
class B : public SomeClass
What can be wrong?
 
And does class B depend on class A?
 
yes
 
Show me how the parts where you have dependencies look like.
 
Declaring it as:
class B : public SomeClass;
at the top doesn't seem to work
 
@thameera Works fine for me; cannot reproduce.
 
5:08 AM
Mmm... an object of B creates an object of A.
That A object needs a reference back to the B object it was created in.
Any ideas?
 
class B; should be fine.
You need a proper test case for more details.
 
In particular where you put the definitions of the A member functions.
 
The code's too large to put in here :S
I'll think of something...
 
it LIVES!!!!
 
@thameera A proper test case, it doesn't have to be the code you have.
 
5:13 AM
now to start coding. thanks all, especially @RMartinhoFernandes
 
I pasted the relevant pieces of code here: codepad.org/Qie2ypRX
Will that help?
 
No. That won't help. That code works: ideone.com/YW0FW
You need to isolate a piece of code that exhibits your problem.
 
@thameera That code works fine.
 
This one doesn't work: http://ideone.com/iUxvN
What's wrong with it?
 
5:25 AM
> prog.cpp:8:29: error: invalid use of incomplete type 'struct MyServer'
 
> You've earned the "vector" badge.
Badges keep coming lately...
 
@LucDanton I don't understand that error :S
 
Ah, good :) You can't call the function DataFromZerclient with just a declaration of class MyServer.
 
@thameera The definitions of the member functions of Zerclient have to appear after the definition for MyServer.
 
5:28 AM
It works!
Thanks a lot guys! Really appreciated. :)
 
In general there's not much you can do with a class declaration (that is not also a definition) like class foo; other than have pointers and references to that type, but you can't use members just yet since they are not visible in a sense.
 
@LucDanton Wasn't familiar with this concept earlier. Learned it now. Thanks! :)
 
3
A: How to use pointers in for loops to count characters?

Seth CarnegieVery good try. There's just one tiny thing wrong, which is this: p <= 3 Pointers are just some number which represents a memory address. When you do p = alph, you're not setting p to 0, you're setting it to point to the same address as alph. When looping over an array with pointers, you hav...

lol at last paragraph.
 
>>Also good job SO, you properly syntax-highlighted my ASCII-Art-Chart.
nice...
 
> We also have real quotes.
 
5:36 AM
Where is that?
 
@FredOverflow How do you do them? I can't find it in the newbie hints...
 
2 mins ago, by R. Martinho Fernandes
3
A: How to use pointers in for loops to count characters?

Seth CarnegieVery good try. There's just one tiny thing wrong, which is this: p <= 3 Pointers are just some number which represents a memory address. When you do p = alph, you're not setting p to 0, you're setting it to point to the same address as alph. When looping over an array with pointers, you hav...

@Mysticial like > this
 
> blah blah
oh, just one >
 
@RMartinhoFernandes Oh wait, you posted that. What exactly did you mean by "Where is that?"?
 
5:37 AM
What a mess.
 
The "We also have real quotes" quote was made up.
 
@FredOverflow I didn't get the fact that "We also have real quotes" was a jab at @Mysticial's inability to quote properly.
 
And I didn't get that you didn't get that, but now I get it :)
 
Would someone mind upvoting the question stackoverflow.com/questions/9057121/… so I can get 5 rep in a tag to propose a tag synonym
You can remove the upvote later if you want
 
lol, sure.
I like to circumvent silly system restrictions.
4
 
5:43 AM
What's the restriction in this case?
 
You need five upvotes in a tag to propose synonyms.
 
ah
 
@RMartinhoFernandes oh, so "score" means upvotes, not rep?
 
@SethCarnegie What's the tag btw?
@SethCarnegie Yeah.
Guess your plan didn't work yet then...
 
I want to propose gdiplus as a synonym for gdi+
I am a trusted user now but I still can't propose tag synonyms freely
:/
 
5:46 AM
Btw, it's "answer score".
Guess what that means.
 
That's even worse
I just saw "Sorry, creating a tag synonym requires 5 score in this tag."
 
So just ask something stupid, write a one-sentence answer, and plead for upvotes.
 
That's really ambiguous
 
Retag an old question.
 
Will it recalculate it when I retag it?
 
5:48 AM
The recalc is on a cron job or something, so you'll have to wait.
 
You can trigger recalcs manually.
 
@FredOverflow who has the capability of triggering a recalc?
 
There's a secret button at the bottom of stackoverflow.com/reputation
Not sure if that recalcs tag scores.
 
@RMartinhoFernandes What exactly is secret about the button? :)
 
@FredOverflow Well, there's no interface to reach that page.
 
5:59 AM
Okay so the button is secret by transitivity? ;)
 
Hmm
Seems I lost 200 reputation on a recalculation :)
 

« first day (473 days earlier)      last day (4461 days later) »