« first day (269 days earlier)      last day (4669 days later) » 

sbi
12:16 AM
Irradiation of food kills the E. Coli bacteria. Radiophobia kills.
"They're looking for evil, thinking they can trace it, but evil don't look like anything" I love this line (in Westfall #okkervilriver)
The near-future is comprised of three parts: 90% like the present, 9% new but foreseeable innovations, and 1% utterly bizarre and unexpected
 
sbi
> I only retweet stuff.
Not true.
 
Ok, almost.
And only one of those is my own. The others are quotes.
Whatever.
 
Updated the pretty printer -- now with automatic recognition of static arrays, and with complete container typetrait check (checks for T::const_iterator and T::const_iterator begin/end() const). Yay :-)
 
 
3 hours later…
3:22 AM
hi guys, anyone have experience with using portaudio?
 
3:37 AM
no, never heard of it...
 
OH OK
 
what is it?
 
do you have any exp with reading audio from microphone (using C) and processing it
its basically a Audio library-coded in C
 
ummm... no
you should check out the source code for audacity. Its free and open source sound recording program (from mic and speakers). Its one of the best free programs of it's type...
 
how is the licence for comercial use?
 
3:40 AM
well I think it licensed under GNU GPL... let me get you a link to their website...
It says it is licensed under GNU GPL v2 (or 3 if you choose)...
 
Hi all
 
 
1 hour later…
4:48 AM
hi
 
 
2 hours later…
6:24 AM
So !t doesn't count as an explicit boolean context or what?
 
6:39 AM
Heh I can't track where that is in the standard
 
 
2 hours later…
8:42 AM
@LucDanton I think it does.
5
A: Conversion function for error checking considered good?

Martinho FernandesIn C++03, you need to use the safe bool idiom to avoid evil things: int x = my_object; // this works In C++11 you can use an explicit conversion: explicit operator bool() const { return is_valid; } This way you need to be explicit about the conversion to bool, so you can no longer do crazy ...

It is mentioned in the section for the ! operator.
§5.3.1/9 of N3242.
No FDIS here, not sure if it changed places there (probably not).
 
8:57 AM
Morning
 
Morning.
 
9:18 AM
> Due to an unfortunate error in the language grammar, the implementation of ?: in PHP uses the incorrect associativity when compared to other languages.
Gosh.
 
Hmpf. Any hints on why is VS 2010 rebuilding relinking stuff excessively?
 
Did you change a header used everywhere?
 
Nope.
I mean when run MSBuild or hit F7 twice in a row it still rebuilds some parts, always.
 
@MartinhoFernandes Thanks for the heads-up
 
@MartinhoFernandes Surprised? :P
 
9:32 AM
They made the thing associate on the true-part! How can that be? That's middle associativity!
You need to be very stupid or very sick to do something like that.
Or both.
 
I'm leaning on the former.
 
How I hate it when exceptions break under GCC.
 
Break?
 
break;
 
try { throw std::runtime_error("Boom"); } catch(...) {} Go directly to std::terminate. Do not catch the exception.
 
9:43 AM
What? Why?
Shouldn't that just ignore it? shudder
 
Classic scenario is when writing a shared library and toying with visibility. The fix is to use -rdynamic.
When it's not the classic scenario well there isn't much documentation about it.
(I believe it's also an instance of undefined behaviour, just to spice things up)
Haha linking statically gets me an infinite std::terminate called recursively loop.
 
Is there a bug (or a boatload of bugs) registered?
 
Well I think I'm not using the UTF right, I'm double-checking the docs.
 
Pfft, UB. I have to deal here with a webapp so AJAXified, it glows at night.
 
No, it's a possible instance of UB. That doesn't mean that it happens because I have UB.
Given that the whole program is essentially the above try-catch one-liner, I don't quite think I have UB.
 
10:03 AM
This sort of thing just seem to be the most common way Boost Test fails :(
 
Oh, did I mention that JS functions are happy to be called with any number of arguments, regardless of the signature? :.
 
@CatPlusPlus I wouldn't expect any less!
 
Well, they do. I don't think I know word strong enough to describe this behaviour.
 
'dynamic'?
 
More like 'utterly moronic'.
 
10:15 AM
It's variadic.
Whether you want it or not.
Or "pass by local array variable" (something.arguments).
 
Yeah, that's the point.
 
funny, I haven't even used Hg, even so, I'm starting to prefer it over Git
 
BTW, someone was looking for a C++ bignum library with templates: ttmath.org
 
@jalf How come?
 
Well, git sucks, duh.
 
10:17 AM
I know git is horrendous, but hg could turn out the same, no?
(It doesn't.)
 
But really, I have to change something in some of the 50KLOC of JavaScript and not break anything, and the language is not. fucking. helping.
 
No unit tests (which in JS, have to do the compiler's job) I guess?
 
@MartinhoFernandes just reading through hginit.com again because I need to write up a git tutorial or handbook for our developers, and I figured I'd draw some inspiration from hginit
 
Haha good luck.
 
10:20 AM
and it strikes me how much simpler, cleaner and more sane hg is ;)
I'm still happy with bzr for my own use, but the next time I have to choose between git and hg... ;)
 
I wouldn't think twice. And I still have to try out bzr. The installation is gathering dust here.
 
I feel that at the end of this maintenance duty, my hatred towards JavaScript will surpass even my hatred towards PHP.
 
@CatPlusPlus really? JS is a far better language
even if it has some funny quirks
 
Definitely.
 
but yeah, having to maintain bad code can really make you hate everything related to it, including the language it was written in
 
10:23 AM
At least ?: is not middle associative in JS.
 
@jalf Not really, no.
The server side is in Python/Django, and it's manageable.
This... this is not.
 
Any moron can write crap code in any language.
Well, maybe not in Malbolge.
You have to be a genius to write crap code in Malbolge.
 
Greetings to all pros out there,
 
You have to be a genius to write any code in Malbolge.
 
What, we have pros here?
Where?
 
10:28 AM
hi
 
Can anybody suggest a good book on data structures???
 
Let's sharpen our pitchforks and kick them out.
 
@Martinho: I believe that I just arrived
 
Cheap torches! Selling cheap!
 
pros: a synonym to genius..;)
 
10:29 AM
room topic changed to Lounge<C++>: No pros here. We have torches and pitchforks and we will lynch them on sight.
 
2
Q: Can static storage (mostly data segment) cause segmentation fault ?

iammilindstatic storage is decided at compilation time. However, consider the scenario where we have lot of lazy initialization in functions: void foo () { static int a[1000]; } I am not discussing the coding practice here, but the technical aspect. As many such other functions like foo() are execute...

am I the only one who thinks that this question really has nothing to do with C or C++?
it basically says "What happens if you put too much in the data segment", and that's an x86 construction, not C or C++
 
I don't know. I find the question a bit silly.
It assumes the compiler is just damn stupid and does not allocate space for all the static data that is required.
Which makes absolutely no sense to me.
 
+1 for stupid question. Also, hello.
 
Well, there is no data segment any more, really.
With pagination, all segments point to start of the address space and extend to the end.
 
no, the data segment is a part of a binary file
at least, I'm pretty sure that it actually still exists
 
10:37 AM
Well, that's not x86-specific then, it's executable-format-specific.
And it's called "section", usually, not segment.
 
honestly, I don't really know
but what I do know is that neither C or C++ speaks of a data segment
 
Segmentation fault is kind of an outdated term that we will go on using for historical reasons. But paging fault is a bit misleading.
 
that's why I prefer Windows's Access Violation
 
Me too, because AV in Portuguese also stands for the medical term "Acidente Vascular", aka stroke.
Which kinda fits :)
 
@CatPlusPlus That is correct.
 
11:20 AM
Well, I have fixed the excessive rebuilds with VS 2010.
The problem was that some projects were sharing Intermediate Files directory.
They apparently need to be distinct for things to work well.
Just FYI.
 
Yay, first rep increase in three days.
@DeadMG: You should make your expressions look something like this: pastebin.com/23gS0REy
That makes you precedence and associativity rules free.
 
I've taken a glance at the slides of the BoostCon presentation.
 
What? No do-notation equivalent?
 
11:51 AM
Heh that recent article gets suddenly interesting when it mentions a monadic Boost.Proto rewrite.
I can see it now: Proto 3 released, Proto 3 gets obsolete
 
12:19 PM
lol
 
oooh nice. gcc 4.6.1 actually compiles my code without errors
guess they fixed a few bugs since 4.6.0
 
12:48 PM
whats so hot about 4.6.x?
 
nullptr and less ICEs
 
ICEs?
 
@hexa internal compiler errors
 
It's gcc-speak for when something goes wrong
 
I see
 
12:50 PM
"ICE: your code is just too goddamn good for me to compile"
 
but yeah, for me it was mainly nullptr
my code worked fine in 4.5, but I wanted to upgrade to 4.6 so I could replace all my NULLs with nullptr
but 4.6.0 choked on my code
 
yeah, I think that nullptr is such a simple addition, I'm amazed it wasn't one of the first things added
 
yeah
 
I don't think changing a C++ frontend counts as simple.
 
@LucDanton but compared to so many other parts of C++0x, nullptr seems like a pretty minor thing
 
12:57 PM
Well, there's a big part of tr1 that comes for free isn't it?
Variadic templates were also an extension (hence the standardization), too
and so on
 
I just used a nullptr class in VS2008, had most of the functionality and no porting required to switch to the keyword in VS2010
 
I love the sci-fi pirate look he's got going with his eye
 
Hehe ya
 
Mmmh BOOST_CHECK( !empty ); might not be the most self-documenting way to check for an empty optional object...
 
1:12 PM
@LucDanton I just got an ICE in GCC 4.6.0 while compiling 4.6.1 with it.
I hit "make" again and it went through.
 
@KerrekSB I chose to get binary builds to not be exposed to such things.
 
Me, I'd like to see regex implemented, and template aliases. Then it'd be bundle of joy.
 
Why can't you use a regex lib?
 
I don't have root access, so building from source is the less-hassle approach for me. It usually works like a charm, too. Just got to remember to make-install the library as well as the compiler binaries.
It's not implemented. The headers are there, but not the code.
You can drop in boost.regex almost verbatim, but why be boostful if you can do it in stdc++...
 
Oh, I always assumed it was working.
 
1:16 PM
wasn't regex in tr1 too?
 
Yeah
At least there are headers there, too.
 
I really would like that regex was not included in any standard lib
 
It's just that GCC is lagging behind with the implementation. I'm sure they could just lift the entire codebase from boost... which is why I'd be thrilled if they managed to get it into 4.7.
Why not?
 
regex sux dude
 
That's no reason not to have it.
 
1:18 PM
Hmm. <debatable/>
And nobody forces you to use it.
 
exactly
but people will use it
 
@KerrekSB I think the libstdc++ is one of those GNU project that requires that all of the codebase have their copyrights assigned to the FSF.
 
so i will have to learn it
 
I'd be more concerned if an XML parser became part of the standard
Isn't Boost FSF?
 
and regex leads to unintelligible globs of wtf
 
1:19 PM
(I'm not sure I'm on board here; you may have been asking hexa a question and not been rhetorical)
 
Hexa: When you'll have learnt regexes, you'll look back at today's transcript and weep.
 
REs are easy.
 
@Luc: No, this is getting away from me, too.
 
Featureful standard library is not a problem.
 
Yeah
 
1:20 PM
Quite the opposite.
 
I agree
I just don't like regex being standard
 
Generic features are a great thing.
 
tell me how regex is generic
 
I have no problem with iconv and image processing and networking not being part of the standard. That's fine.
 
i mean, more generic than by hand string parsing. using conventional methods
 
1:22 PM
if you wanted to prevent regex from becoming standard, you should've objected 15 years ago
they are standard, whether or not they get added to the C++ stdlib
 
Regexes are a powerful string manipulation tool. Think of them as strtok done right.
Just look at how much bad string parsing code is being written.
 
and if you're worried about unintelligible globs of wtf, what the heck are you doing in C++ in the first place? ;)
 
Look at Python's stdlib. Batteries included is a good thing.
 
OK, going to read Mielewski's article now.
 
@jalf good point :)
 
1:23 PM
Regexes have legitimate uses.
 
@CatPlusPlus but often abused
 
@KerrekSB Be warned that there is a void main() lurking in there.
 
You can do horrible things with anything.
 
@CatPlusPlus yep, they're extremely handy
even if you can also abuse them to write evil evil unreadable code
 
I think templates are more abusable in C++ than regexes ever will. :P
And preprocessor.
 
1:24 PM
But seriously
C++ is confusing as it is
why add regex to it
 
With complete power, comes regex and templates.
 
@KerrekSB Boost.Tokenizer is strtok done right. :P
 
Do you guys agree that if regex makes into the stdlib, it will be more used, right?
 
Well said!
 
yeah, but i don't see how adding a widely-known and widely used standard for simplifying a lot of string processing makes C++ more confusing
 
1:25 PM
It won't magically be more used, why would it be.
 
I'd rather have <regex> than trying to do the same things using C++'s normal string handling tools
 
@CatPlusPlus Yeah, sorry, I was looking for a good analogy but failed.
 
It'll be easier to use, not requiring external libraries.
 
@CatPlusPlus new editions of C++ books used in schools would have regex in chapter 2
 
@hexa: It is just a library. You do not have to use it if you can be less confused and more effective with pure strings.
 
1:26 PM
Well, bad books, what can I say. Regexes deserve their own books. ;)
It sure as hell is better than even mentioning libc.
 
@Hexa: What's your paranoia about? If you haven't been parsing strings in the past, you won't suddenly be forced to do so, and if you have, chances are you'll be writing better code now.
 
I just don't like regex. It looks like complete crap. More often than not i have to spend 10 minutes to decode one line
 
I'm not very productive today. :.
 
then 1 week later, i have to spend another 10 minutes
just because i forgot about that regex
and i suspect it might be the trouble
i always suspect regex
 
If you use it where it's not necessary then it's your fault.
 
1:28 PM
yes
all the code i use
is code that i made
it's not remotely possible that i use other people's code
 
@hexa but the same can be said about templates. So would you rather they weren't in the language either?
 
it's not remotely possible that the same string parsing can be written in 100 different ways, one more terrible than the other
@jalf I appreciate of templates a lot
specially because I tried to do that type of stuff and plain C, and it was hell
 
otherwise, it seems that it is simply a case of "I don't want features I'm not intimately familiar with to be added to the standard library"
which is silly
@hexa and how are regexes different?
 
I just scanned our codebase for re, and it's used nowhere.
Look, a stdlib feature that's not used!
 
for many common string operations, the exact same is true. It can be done without a regex library, and it's hell. Or it can be done in a not-very-complex regex
just because it can be abused to produce unreadable code doesn't mean it shouldn't be available for the cases where it's beneficial
 
1:32 PM
Besides, if something is already using regexes, then putting the library into stdlib changes nothing.
 
It's like buying a box of candy. If you buy the big box, nothing is telling you to eat the whole thing, nothing. but you will, eventually
 
You buy boxes of candy not to empty them?
What do you do with the leftover stuff?
 
Plus, many people don't use that much of stdlib.
I just really can't see the problem here.
 
@hexa a better analogy would be that it's like the store selling boxes of candy
 
me neither
 
1:35 PM
No one is forcing you to buy them, and you often won't, and it's perfectly possible to abuse it
but it's also super handy when you're preparing a children's birthday and need a lot of candy
and once again, I don't see why you don't apply the same logic to templates. Haven't you seen what template code can end up looking like?
 
I just would like to keep stuff that can make horrible lines of code out of any standard, unless it is REALLY needed.
 
And if something is in stdlib, you can use it in limited environments that have nothing except stdlib.
 
You should be far more scared of that
 
It is needed. Any modern standard library should come with common tools like regex engine.
 
It is desperately needed
just because you haven't needed it, that doesn't change the fact that for literally decades, vast numbers of programmers have needed regex libraries
 
1:38 PM
okay then
 
many people haven't needed templates either :)
 
I have needed it many times
 
@CatPlusPlus regex engine s :)
 
@hexa but you just implied that it wasn't needed
 
Now I'll get to use all those different flavors I have learned in the past.
 
1:39 PM
@MartinhoFernandes Don't be greedy.
 
So it's not needed, and yet you've needed it many times?
 
does not compute
 
The difficult part will be picking which one I'll use most.
 
@jalf I don't need it EVERY day.
 
1:41 PM
PCRE, the worst one, of course.
 
@jalf I've been coding for quite a while
 
My favorite is .NET's and it's not included :(.
 
@hexa I don't need templates EVERY day either. So they should be cut from the language?
 
No...
 
You were talking about whether it was needed at all, not whether it was needed every day
 
1:41 PM
@jalf I am pretty sure you use templates every day, even if indirectly
 
Cut away placement new. I've only used it once.
 
@hexa not at all. Some days I code in other languages
anyway, I'm sure you use regex every day too, if only indirectly
 
... every day you are coding in C++. We are still talking about regex in C++ right
 
how many compilers do you think are written without using regex?
 
That would be madness.
 
1:43 PM
you're moving from an illogical claim into an absurdly contrived strawman argument
 
Madness.
 
I can go for days writing C++ code without writing a simple template. And I can go for days writing C++ code without writing a single regex. But when I need the feature, I'm really glad it's there
and sure, even on days when I don't write code that uses the feature directly, I rely on it indirectly. Again, that's true for both templates and regexes. Without them, I wouldn't have the tools at my disposal that I have
 
okay, you guys won this one. I really don't like regex tho ;)
 
Me either
But I hate string processing without regex even more
 
I don't like headers. Why don't you don't like headers instead?
 
1:45 PM
Is it possible to specify a constructor for an anonymous class ?
 
and when I meant indirectly, i meant in stuff like: std::vector<int> and stuff
 
it's a painful tool for solving painful tasks which would be far more painful without that tool
 
not as in: hey I bet you use cobol, because you use your credit card.
 
Dinosaurs don't use credit cards, silly.
 
But you don't write templates when write std::vector<int>. The horribleness lies in the writing part.
 
1:46 PM
agreed, make regex like that then i will love it
 
@hexa isn't it like that already?
if someone else defines a regex, it's easy enough for you to use
just like if someone else defines a vector, it's easy enough to use
 
std::basic_regex<char>.
Zing.
 
@kbok According to VS05, "cannot have constructors".
 
Libpng is not a good example of C++ code, really.
 
Isn't libpng like, a C library?
 
1:48 PM
libpng says : "no constructors"
 
Yeah, that might be why.
Funny how that works, eh.
 
@Hexa: Think about it that way. Suppose you want to parse a string. If you write your own long-winded logic loop, who can look at that, inspect it and say, "I know what's being parsed here"? On the contrary, with one single regex, you've clearly described your parsing pattern for everyone to see and understand uniformly, without mixing code (the parser) and data (the pattern).
@kbok Sorry! Linux copy paste! Thank god I didn't paste my online shopping list by accident!
 
In an horrible way of describing one, but yes.
@KerrekSB What's so embarrassing about your online shopping list?
 
Or you can write a grammar and generate 1MB of parsing code.
That works too.
 
Here is the real page, http://msdn.microsoft.com/en-us/library/a3bbz53t(v=vs.80).aspx
 
1:51 PM
You can edit messages.
 
@KerrekSB Thanks
 
For up to 2 minutes.
 
@MartinhoFernandes I regularly order void pointers to my office for casting parties.
I figured that wouldn't go down well in a C++ chat room.
OK, back to monads. I still don't know what those are. In category theory they're half of an adjunction, but who knows how programmers have been abusing maths terminology this time.
 
@KerrekSB There is a nice wikipedia article with links to examples on several languages
This was helpful for me since I don't know any pure-functional language.
 
1:57 PM
I think monads as a mathematical concept haven't been abused much.
They're still a triple of (type functor, unit, multiplication).
 
In programming, too?
 
At least in Haskell.
 
Oh OK. Interesting. Wait, what's a "functor" in Haskell?
It has to be an endofunctor to make sense.
 
I think that's the major distinction between Haskell and mathematical theory
 
Mathemagicians strike again.
 

« first day (269 days earlier)      last day (4669 days later) »