« first day (239 days earlier)      last day (4694 days later) » 

12:00 AM
perhaps I just don't see many that I would actively describe as cute
 
Everyone has preferences. Not being quickly satisfied is probably better that the opposite.
 
I didn't think that you said anything about that
anyway
it's way past my bedtime
 
I'm spouting random stuff really. Sleep deprivation I tell ya.
It does things.
 
trust me, I know
 
Official world record is 10 days. Random meth junkie interviewed by Louis Theroux: 16 days.
 
12:34 AM
Air fricton can be used as a poor man's towel.
But a towel is better. Don't forget.
Holy crap! I am the nr1 listener to Kajiura Yuki according to last.fm.
So that's what people do on Saturday nights. They go to sleep.
 
1:07 AM
@StackedCrooked A towel is always better.
A towel can save your life.
 
I read that somewhere too :)
And trying to dry your body by means of air friction makes you look like a lunatic.
 
@StackedCrooked Specially if you're doing it in public. Naked.
But then, you can argue the same about drying yourself with a towel in public naked.
You just look a tiny bit less lunatic, but still...
 
@MartinhoFernandes Yeah, I always have that problem. Jeez, people these days..
There's always something they fuss about.
#define new new(__FILE__, __LINE__)
^ What is that supposed to mean
0
Q: C++ Memory Debugger?

B3tturTh3nUCan anyone recommend a quality C++ memory debugging API or software for Windows(specifically, one that works with MinGW)? I'm nearly positive there's a memory leak in my program, but I have no idea where to start looking. Also, on a related note, I previously tried overloading the global new and...

>I have no idea where to start looking.
Valgrind on Linux/Mac, Shark on Mac, Windows:??
 
1:24 AM
new T() becomes new(__FILE__, __LINE__) T() which calls new(const char*, int, std::size_t)`
The same way new (std::nothrow) T() calls new(std::nothrow_t, std::size_t)
 
Can you re#define new?
 
I didn't know that
 
Isn't it illegal to do that with keywords?
Yep, it is. #define accepts an identifier.
 
I think that's one of the oft-decried evils of the preprocessor
@MartinhoFernandes Also apparently the OP did just what you're suggesting in your answer
 
@Luc Oh, thanks. I'll edit.
@StackedCrooked Huh, you really need to get some sleep, man.
You're getting worse than the @Cat.
 
1:39 AM
How so? :D
What about @CatPlusPlus ?
 
I'm talking about the rambling nonsense.
 
Ah, ok.
I'm not tired enough yet, but I'm nearing.
@MartinhoFernandes it's 3:42 at your place too!
You have to go to bed or you won't be up for church tomorrow!
What would the priest say?
I don't even wanna think about it.
 
@StackedCrooked Nah, I'm on GMT :P It's just 2:43.
 
You are in Portugal, no?
 
Yep, which runs on GMT.
No, Portugal's timezone is GMT.
Really.
 
1:45 AM
Wow, that's different that it's surrounding countries then?
Being, Spain
 
Yep, they're on Central European Time.
Which is just silly.
Being that they're definitely not on Central Europe.
 
I am GMT+1
 
That's CET.
But it makes sense for Belgium.
 
CET? Never heard of that...
 
"Central European Time"
 
1:46 AM
Ah, I see.
 
Portugal is just about 6ºW longitude, which clearly means GMT is the best.
 
It would be nice if the chat avatar would show more broken eyes when sleep deprived.
@MartinhoFernandes I seee.
I think West-European countries opted for GMT+1 because they like the longer evenings.
 
But then you get the sunrise later.
 
Have you noticed that this chat is really dead during the nighttime?
 
Well, when I'm awake.
 
1:51 AM
It makes me doubt if the world is really round like they say.
 
Which is probably far too many times.
Pretty much everyone I know in this chat is from Europe.
 
@MartinhoFernandes yeah
 
And a big part from Germany.
 
It's strange. Because this is an American website after all:)
Even at night it's the Europeans :D
 
Yeah, we have to stay awake to keep the chat alive...
The sacrifices we make.
 
1:53 AM
Yep, I'm doing a good job at that.
 
How long have you been awake?
 
I have slept 2 hours on the night between thursday and friday.
Sleep had been going downhill before that.
 
When I do that, I tend to "skip" weekends.
By skip I mean, sleep straight through them.
 
I'll probably sleep most of the day tomorrow and monday though
Monday is holiday here, so.
I've got it all planned out.
And on thuesday the start of a new downward spiral :)
Sleep is overrated anyway.
 
8 hours ago, by DeadMG
I'm a moron
Interesting how this got 3 stars.
 
2:00 AM
:)
 
:845986 Just testing.
Hmm, can't reply to removed messages.
 
Hah
Good.
@MartinhoFernandes the deleted message are still visible there?
 
Nah, just a grey "(removed)" stub.
 
2:08 AM
When I click your link I can see them :)
Or is that because I am the user that owns them?
 
Hmm, maybe because it's your own, or you're an owner.
I'd hope for the former.
All I can see are "some guys with an even more serious problem."
 
Hehe, I landed on such page as well.
 
2:24 AM
Ugh, I think I'll have to stop and rethink the design of my BitTorrent client.
These async parts are really making a mess out of my code.
 
Seems like an interesting project.
 
Well, it's still in its infancy. I had to learn C++ before I started :)
I'm still wondering what I'll use for the UI.
And all the asynchronous communication stuff is killing me now.
 
What do you consider your options for the GUI?
 
2:40 AM
I'm hoping to move to Linux soon (as soon as I can get time to install Gentoo correctly), so anything tied to Windows is out.
I heard GTK uses a C API, so no.
I find QT too much for what I want.
I heard of many lightweight frameworks (fltk, wxWidgets, and others), but I haven't tried any.
 
Hm..
I tried wxWidgets a few times but never really liked it.
I have used XULRunner because I thought it was a cool concept.
WinAPI also for my work.
In then end I settle with Qt.
 
You like it?
 
Yeah, I'm amazed also by the performance.
 
I hadn't given it a good enough look, I admit.
So I'm open to be convinced.
 
The regular Window toolkit, without special opengl features gives you 60fps.
You can't get this on native Windows.
Qt has the drawback that it adds 10 MB to you binary.
Unless you require the user to install Qt.
For the rest it's really good.
Actually my knowlegde of Qt is very limited. It's just that the little I have seen made a good impression.
I've got most experience on Win32.
 
2:47 AM
What put me off was having to use a special tool to compile something (moc I think it was called) that needed special compilation.
Or maybe I misunderstood completely.
I usually do.
 
@MartinhoFernandes yeah, you just have to make a clear distinction between the view code and the rest of the application.
Qt uses code generation to add introspection to objects etc.
I try to keep the Qt part very thin
The moc shouldn't bother you too much. For high applicaiton level code a little more dynamicism is welcome.
I don't know of any other GUI framework worthy of being called decent.
 
I'll put it back in my list of options. When I get the protocol algorithms running, I'll make a decision.
 
@MartinhoFernandes you should try to make it a server application with a webview.
 
HTML5 + JavaScript is where it's at :)
 
2:53 AM
Now you got me thinking.
HTML5 + JavaScript are in my To-Learn list too.
But what can I use to make a web application in C++?
 
JavaScript is an interesting language. You'll hate it at first, and later come to appreciate its first class functions. :)
 
@StackedCrooked Actually I'm already past that phase.
 
@MartinhoFernandes I have used the Poco HTTPServer class to build a REST api
 
Mostly, I need practice.
 
@MartinhoFernandes Good! :)
You should have a look at the sample projects included in the Poco sources.
It's not too hard to get started.
However, this solution will be more work than using a native GUI. Keep it in mind!
 
3:01 AM
@StackedCrooked I will. For now I'm not yet in decision-making mode. Just gathering ideas.
 
curses would also be an option :)
 
A problem I have in C++, is the difficulty I have to find good libraries for stuff I need (unless it's already in boost, of course).
A while ago, I needed to use SHA-1 (it's used to identify the torrents and to validate the downloaded data).
 
For me Poco provides most of the stuff that boost doesn't provide.
 
I ended up grabbing the RFC and implementing it from their example code :(
 
@MartinhoFernandes coding straight from the RFC is tempting :D
 
3:07 AM
Thanks for bringing Poco to my attention. Lots of interesting stuff there.
 
@MartinhoFernandes @StackedCrooked hey!
 
@MartinhoFernandes hey, I need your help later with that directx problem.
hey, you guys wanna join my google code project?
 
@cyberrog I'm sorry, but can we work that out tomorrow, perhaps? It's past 4AM here. I'm just going to finish some code and then I'm going to sleep :(
 
3:19 AM
@MartinhoFernandes no, dont worry, its for monday Im saying. just asking you if you can help me.
@MartinhoFernandes @StackedCrooked so, you guys wanna make part of my google code project?
 
What, exactly?
 
@cyberrog heh, ask me tomorrow, right now I can barely keep my eyes open..
 
@StackedCrooked LOL!!!!
@MartinhoFernandes so?
 
Sorry, I'm already trying to squeeze time to contribute to NodaTime, to boo, and to a bunch of personal projects.
 
3:25 AM
@MartinhoFernandes tudo bem.
 
(And I'm secretly working on a game engine for Magic: the Gathering, but don't tell Wizards of the Coast about it ;)
 
@MartinhoFernandes LOL
 
The end result is that I never get anything done :(
 
@MartinhoFernandes LOL.
well im gonna watch an episode of camelot and then go back to work. see ya!
 
Bye.
@StackedCrooked You're finally about to crack, huh? :P
 
3:27 AM
Yep seems so
Just as I had planned lol
I had planned for 24h earlier actually, but that are details
 
My plans for sleeping/not sleeping always go through the roof.
7
A: What to watch out for when converting a std::string to a char* for C function?

James KanzeFirst, whether const reference or value doesn't change anything. You then have to consider what the function is expecting. There are different things which a function can do with a char* or a char const*---the original versions of memcpy, for example, used these types, and it's possible that th...

> so correctly dimensioning the std::string first (using std::string::resize(), then passing &s[0], and afterwards redimensionning the string to the resulting length
Is this supposed to work? I mean, does &s[0] point to the internal buffer?
 
@MartinhoFernandes It's not guaranteed for C++03 and it is considered a defect
 
And C++11?
 
C++0x guarantees contiguous storage
 
The FDIS says this about the indexing operators:
> Returns: *(begin() + pos) if pos < size(), otherwise a reference to an object of type T with value charT(); the referenced value shall not be modified.
What does that last part about no modification mean?
 
3:38 AM
Is that the const overload?
 
It has both signatures, then this.
 
Oh right
Notice the 'otherwise'
That's ... odd
Does that guarantee success for s[-1]?
 
@LucDanton I noticed, but then the semicolon confused me.
@LucDanton pos is size_t, which is unsigned (right?). So s[-1] is not a problem.
 
I think so
Sorry about the -1 I was being clever
I mean e.g. s[s.size()]
 
That, yes, seems like.
But not for s[s.size()+1], because there's a "Requires pos <= size()".
 
3:42 AM
Ah! makes a bit more sense then
 
Which makes s[s.size()] always a null-terminator.
 
It's guaranteed to be 0?
Oh yeah
charT()
 
Given that s[0] = 'x'; modifies the internal buffer, I think it's safe to assume that the reference returned by the non-const version of operator[] points to the internal buffer.
But the wording there is rather confusing.
It's probably meant just for the null-terminator.
Because at() does not allow s.at(s.size()), and there's no such mention of no-modification about at().
 
4:07 AM
It's weird but apparently the Standard provides no facilities to go from, say, std::u32string to std::wstring.
There is a wealth of conversions available from any pair of encoding among utf-8, utf-16, utf-32 and of char types among char, char16_t, char32_t to any other one (sometimes being a bit roundabout), but you can't get to the narrow or wide character set.
 
I never understood what the wide characters were good for.
 
You can convert to a std::wstring but it won't be encoded to the wide set
It's a customization point for the implementation to provide some form of international encoding
So if an implementation uses a wchar_t that is as wide as, say, char32_t but doesn't use utf-32, you can get lulled into a sense of security by using std::codecvt_utf8<wchar_t> to go from (utf-8, char) to (wchar_t, X)
But X will be utf-32, not the encoding used by the wide set
 
has anybody here made a facebook app, need help?
 
Can you make Facebook apps in C++?
 
yes
@MartinhoFernandes
 
4:14 AM
@LucDanton Sorry, I'm not very well versed in this character sets/Unicode stuffs.
I tend to keep myself on UTF-8, and constantly tell myself I should look into that someday. :)
 
@MartinhoFernandes I have to admit that I'm not either. I happened to stumble on it in the draft and started an answer to a question about such things.
The same happens with std::string s = u8"Blah";
You can pass it to std::cout but I don't see how it's going to do the right thing
 
What? That doesn't work?
 
Unless, of course, the narrow set uses utf-8
 
Let me check
Well gcc generates an executable that outputs utf-8, when targeted for windows
So on a e.g. latin-1 console this will be garbage
 
4:21 AM
Well, "Blah" won't.
 
Not surprising given that std::string is encoding agnostic
Oh yeah in my test I have asian characters
 
But, "Bláh" probably will.
 
std::string string = u8"按字节计数还是按字符个数"; in fact
 
 
6 hours later…
9:59 AM
not exactly new, but still interesting
LOL, who keeps starring and un-starring the video? :)
 
@FredOverflow Hi Fred, I come with good-ish news
 
Okay, then I won't decapitate you. What are the good news?
 
Some BoostCon 2011 slides are available.
It's not ultra convenient but they're there
 
The Haskell video is still unavailable for me :(
As are some 2010 videos...?!?
 
And I'm afraid the uploader is on vacation right now
 
10:06 AM
Boost.Generic: Concepts without Concepts is up, on the other hand. Strange.
 
guys, I need your help
I’m searching a micro unit testing framework for C++ that was published on GitHub
the framework allowed me to write something alike to ASSERT(x < y) and would output a pretty-printed diagnostic on failure, using a rather clever trick to retrieve the operation that had been performed
it’s unfortunately not linked on the Wikipedia “List of Unit Testing Frameworks”
anybody knows what I’m looking for?
 
#include <cassert>
 
can you give the link to the wiki page?
 
@Fred That would be too easy. ;-)
This page is a list of tables of code-driven unit testing frameworks for various programming languages. Some but not all of these are based on xUnit. Columns (Classification) * Name: This column contains the name of the framework and will usually link to it. * xUnit: This column indicates whether a framework should be considered of xUnit type. * TAP: This column indicates whether a framework can emit TAP output for TAP-compliant testing harnesses. * Generators: Indicates whether a framework supports data generators. Data generators generate input data for a test and the test is run for ...
 
Xeo
@KonradRudolph What exactly do you mean with "retrieve the operation"?
 
10:16 AM
@Xeo I mean that, on failure, the library is able to output a diagnostic that would read as follows" Assertion 5 < 3 failed at line … in file …"
 
hi
 
that is, the framework reads ASSERT(x < y) and is able to infer the operation. In contrast, most other frameworks require you to use separate macros ASSERT_EQ, ASSERT_LT
 
Xeo
So ASSERT(val1 < val2) would substitute val1 and val2 for actual values? Or would it print "Assertion val1 < val2 failed at line...." ?
 
@Xeo it would substitute the actual values
 
Xeo
That's interesting
I have no idea how that could work. :)
 
10:20 AM
@Xeo essentially, operator overloading: internally, the macro would substitute the macro text inside an expression of type AssertMsgType, which overloads each of the operators and uses them to print the diagnostics
 
That sounds pretty cool!
 
@KonradRudolph Unless you pass (x)(<)(y) to the macro I'm curious to see how it works
 
Aha, it's based on expression templates. This should be fun to re-implement :)
Expression templates is a C++ template metaprogramming technique in which templates are used to represent part of an expression. Typically, the template itself represents a particular type of operation, while the parameters represent the operation to which the operation applies. The expression template can then be evaluated at a later time, or passed to a function. The technique was invented independently by Todd Veldhuizen and David Vandevoorde. For example, consider a library representing vectors with a class Vec. It is natural to want to overload operator- and operator* so you could ...
 
Xeo
10:41 AM
#define INTERNAL_CATCH_TEST( expr, isNot, stopOnFailure, macroName ) \
    INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ResultBuilder( __FILE__, __LINE__, macroName, #expr, isNot )->*expr ), stopOnFailure ); \
    if( Catch::isTrue( false ) ){ bool dummyResult = ( expr ); Catch::isTrue( dummyResult ); }
so this is the magical macro
(#define REQUIRE(expr) INTERNAL_CATCH_TEST(expr, false, true, "REQUIRE") later on)
What I don't really understand....
Catch::ResultBuilder( __FILE__, __LINE__, macroName, #expr, isNot )->*expr
after expansion with REQUIRE(1 == 2) would look like
 
@Xeo yup, such a REQUIRE doesn’t work – the lhs has to be an identifier!
 
Reading from the link given by FredOverflow however there is a more recent version. This one evaluates expr twice
 
Xeo
Catch::ResultBuilder( 0, 0, "REQUIRE", "1 == 2", true )->*1 == 2
mhm
 
Nevermind nothing changed
 
What I don’t really understand is how to use the single-header version
 
Xeo
10:46 AM
@KonradRudolph Include it, done?
 
the tutorial doesn’t use it, and somehow I fail to see how to distinguish between the main-function version and the non-main-function version
 
Xeo
It's just all other headers stuffed into one
@KonradRudolph That's a very interesting idea to take apart such expressions
So he takes advantage that ->* has a higher precedence than the relational operators, but is lower than the other access operators
That's clever!
Still, I can imagine a horrible, horrible template error message should one forget the parens around member function pointer calls
REQUIRE( myval->*the_func() == "special value" );
aside from evaluating the expression twice
 
Xeo
11:28 AM
@DeadMG, you really don't like PIMPL, huh?
 
Xeo
11:55 AM
Am I the only one not understanding the already 4 close votes on this question ?
 
@FredOverflow i wonder. on that "Expression Templates" wikipedia preview - where did the chat have that picture from?
there isn't such a picture in the wiki article
and it doesn't really fit :)
 

« first day (239 days earlier)      last day (4694 days later) »