« first day (417 days earlier)      last day (4533 days later) » 

12:00 AM
Dunno.
 
no, I can debug with the default compiler. I just want G++ for performance/portability testing
I doubt it, they keep the symbol files in completely different formats
 
it probably could without symbols, but better to use the built-in compiler for that
 
This is all the VS setup you need to mess with.
 
although it kinda is irritating that when I do a global replace in MSVC the "replace" window moves, frequently mostly off-screen.
 
12:04 AM
Mine gets ginormous.
 
yeah, that too
 
@jalf Yes. In the Windows world, there is a standardised way to control symbol visibility. That's what I, and some people the C++ committee, call the Windows way (or the Windows dynamic "library" approach, as opposed to the Unix way).
 
wait, does GCC not understand nullptr still? Even MSVC got that one!
 
What version?
4.5 doesn't.
 
the ideone version :( 4.5.1
 
12:11 AM
It's 4.5 :(
 
(...) A programming language needs to deal with such issues. Not just at the file (well, TU) level, also at the package level.
 
that's the first thing I found that MSVC compiles that GCC won't
 
Meanwhile, 4.7 is going to be released soonish.
 
@curiousguy: that was 9 hours ago, wasn't it?
 
12:12 AM
Mmh, March/April may not be soonish enough for everyone.
 
Syntax coloring for the English language would be interesting.
 
@MooingDuck Maybe.
I am asynchronous.
 
Let's hope you're not racy ;)
 
that would actually be pretty awesome, verbs in blue nouns in green, punctuation in ...
 
@Maxpm noun/adjective(sp)/pronoun/verb/etc?
 
12:14 AM
it would definitely help anyone who's trying to learn the language
 
@MooingDuck Mmhmm.
 
Also, brackets. I have a pointer to (an array (of pointers (to integers))).
 
Anyone knows where I can find a large battery of tests for sorting algorithms?
(I know I could generate it. I'm tired.)
 
Xeo
Guys, someone help me with this guy >_>
 
My ((neighbor Lisa's) dog's) hair is ugly
@Xeo: I'm busy using IDEOne to compile my code since MSVC just crashes.
 
Xeo
12:16 AM
@MooingDuck What code?
 
@Xeo a learner's version of boost::any_iterator
 
@MooingDuck lol
 
MSVC is convinced I have a recursive template somewhere, and just dies.
 
Wow, that's "one big TU".
> warning: #pragma once in main file
lol
 
class any_iterator : public full(any_iterator,void)
wut?
Oh yeah, lowercase macro.
 
12:19 AM
Ugh.
 
any thoughts on
0
Q: Making boost serialization aware of pre-existing instances

awoodlandI've been prototyping some code to maintain state between two nodes on a network. I'm using boost serialization and boost asio in the real code. The changes in state are actually fairly simple, currently I'm only interested in "added a new object to a collection". The real code is rather complica...

 
I'm removing the macros, they're just making things harder
 
Xeo
I'm giving up on him
Seems like he doesn't want to understand my comments
 
Can you flag an answer for being completely wrong and couterproductive
 
link or it didn't happen
 
12:24 AM
-1
A: array of counters in C

trinithisYou don't even need to read the file. Here's the code to do it. int count[26] = {}; for (int i = 0; i < 26; ++i) { if (i < 6 || i == 25) { count[i] = i + 1; } }

 
@SethCarnegie Yes.
 
What should I flag it as
 
actually, does it answer the question even if it's wrong?
you can't flag wrong answers
 
@SethCarnegie low quality.
@Mysticial It's noise.
 
just downvote a few more times
 
12:26 AM
@RMartinhoFernandes ok thanks, flagged
the OP would be mystified by that I think, if he didn't know better it would just severely confuse him
 
given that the answerer has almost 3k, if it gets downvoted into oblivion, it tends to solve itself
unless he/she
is trying to not get the badge
 
okay, I have a completely unthought-out question:
 
user406009
Those are the best kind.
 
can I use the compiler versus the preprocessor to select an implementation generically? For example, while c++11 support is incomplete, nicely use new standard library stuff when available and hacked version if not.
 
sure, boost has done that for years
 
12:33 AM
I guess I should emphasize the "not implemented" part
 
sbi
@RMartinhoFernandes Yeah, but that doesn't mean you won't be caught. :)
 
can you use traits on generic algorithms?
or something like that?
 
@sbi Damn, I knew you would see it.
 
Xeo
@keithlayne #if __cplusplus == 199711L /* not C++11 */
 
what sort of traits? like std::iterator_traits<>? That's what it's for
 
Xeo
12:34 AM
or #if __cplusplus > 199711L /* C++11 */
 
@Xeo not exactly what I mean
 
@Xeo Or GCC before a few months back.
 
sbi
@RMartinhoFernandes I got a lot of kids to herd, which makes for practice catching culprits.
 
Yes, GCC has been all these years with #define __cplusplus 1
 
Why aren't LMGTFY links allowed in comments?
 
Xeo
12:35 AM
@keithlayne Oh, only the compiler?
 
besides, I tested that with vs10 today and __cplusplus was not as expected
 
#if GCC_VERSION > 30200
 
sbi
@RMartinhoFernandes You're kind of obsessed over this term tonight, aren't you?
 
@SethCarnegie I suspect they were banned.
 
Also why did I receive two -1s for a downvote on the same answer
 
sbi
12:36 AM
@SethCarnegie Because some thought they were impolite. It's easy to circumvent, though, if you use an URL shortener.
@SethCarnegie Presumably because you received two downvotes?
 
@sbi yeah I just did the bit.ly link
 
@Xeo vs10 for example has __cplusplus > 199711L but is missing at least one algo from the new standard
 
Downvotes take away 2 rep.
 
@sbi no you get -2 for a downvote on your own answer
 
@keithlayne #if _MSC_VER > 1600 // newer than MSVC10
 
12:37 AM
@sbi I got two -1s for a single downvote on someone elses answer
 
don't GAF about compiler versions in that fine-grained a way
 
sbi
@SethCarnegie Misdemeanant!
 
-1 9 mins ago downvoted array of counters in C
-1 14 mins ago downvoted array of counters in C
 
Xeo
@keithlayne I hate it when such stuff isn't correctly defined
 
@SethCarnegie Oh, that would be a bug.
 
12:38 AM
@RMartinhoFernandes can I get my 1 rep back?
 
@SethCarnegie Are you sure it's the same answer? Maybe two answers on the same question?
 
sbi
@SethCarnegie Ah, that's right! I blame it on the beer I have just emptied. And on the late hour.
 
what does your rep audit show?
 
maybe I should reformulate the question, I think I was leading you guys off the track
 
sbi
@SethCarnegie If that's true, you might want to flag for a mod or ask about it on meta.
 
12:39 AM
@RMartinhoFernandes oh nevermind nevermind, you're right it was two answers
stupid
 
"Hey guys! I'm missing one imaginary Internet dollar point! I want it back."
 
@RMartinhoFernandes :)
 
I must haz arbitrary points!
 
sbi
Someone stole cables from under an operating Belin city train line. Almost an admirably stunt, but I'm gonna be home late. :(
 
arbidollars
 
12:40 AM
@sbi Oh.
 
Xeo
@sbi *Berlin
 
as in a happy function object templated on the existence of a standard library algorithm at compile time...somehow take advantage a compile failure for great good
 
@keithlayne SFINAE?
 
yes
 
sbi
@Xeo Oh well. I sent this from my dumb phone. A first.
 
12:42 AM
I can't SFINAE :(
 
sbi
I am now contemplating adding a "Sent from my dumb phone" to my email sig.
 
I mean, can I make a substitution fail based on a nonexistent template function?
 
sbi
@keithlayne You cannot put code that wouldn't compile into a template and hope the compiler will totally disregard it if the template is not instantiated. VC might actually accept some of that, but other compilers won't be as forgiving.
2
Does that answer your question?
 
@sbi that is definitely where I was going with that question, thanks.
 
sbi
12:46 AM
@RMartinhoFernandes Yeah, took me 1.5hrs rather than 1hr to get home. That's not funny at all around midnight. :(
 
so am I stuck with CPP?
 
I'm not laughing.
 
Xeo
@sbi Especially since the trains stop around 1am on weekdays
 
@sbi If I didn't have kids to look after I'd sleep at work. I've done it a million times anyway. But you seem more civilized than me.
 
sbi
@RMartinhoFernandes I didn't say you were. I still didn't think it's funny while I was freezing on the platform, though.
@Xeo I could always walk 15mins to the N2 night bus, which runs all night every 30mins and takes me to the M1, which I can take home. But compared to the Ringbahn the night bus takes forever...
@keithlayne Another theory says I'm much older. :-/
 
12:51 AM
Ah, now I'll just look up those train codes and find out where you live!
Or not.
 
sbi
@RMartinhoFernandes I live in Berlin Pankow, close to the M1 metro tram line.
Well, I guess I'd better sleep now. I need to be awake tomorrow^Wlater today. Sigh.
 
Xeo
@sbi The M1 runs at night? Interesting
 
@sbi It's more (I think) that I have been conditioned to austere environments...I see things like beds, showers, and toilets as more of a luxury than most people in the first world. Not that I'm assuming anything about your background.
 
@sbi Good night.
 
sbi
@Xeo Only every 30mins, though.
 
12:54 AM
0
Q: What's wrong with vb?

CosmoSince I started programming I have always heard rant's on vb, on how bad it is, or how only skids use it,etc. But for the first time I saw it, and to be honest, it seems way more productive then a lot of main steam language's out there. If you just want to make a program and not devote hours of y...

 
Xeo
Still interesting, now I atleast know a difference between metro tram and normal tram.
@SethCarnegie Answer: vb
 
VB is TRWTF.
 
sbi
@Xeo The metro lines run every 10mins during the day. That, I think, is the main difference.
 
Xeo
@sbi G'night
 
sbi
12:55 AM
@keithlayne BTDT.
Night!
 
Is C++ a main steam (sic) language?
 
Xeo
@sbi Well, out here in Friedrichshagen I don't see many metro trams and it's not that often that I travel into the center of Berlin :)
 
@RMartinhoFernandes probably
 
Wasn't there some syntax for arrays that let you specify the index you wanted to assign to in initialiser lists, like int a[3] = { [1] = 4 }; or something
 
That's C.
Designated initializers.
 
1:04 AM
@RMartinhoFernandes ah ok
C++ needs it :)
 
no, it doesn't
 
If it could be made to work for any type. I don't really like adding abilities just to raw arrays.
 
never understood anyone's desire for initializer lists, they're no better than int a[3]; a[1] = 4;
 
They're much shorter
 
bwahahaha
and what real usefulness is that?
 
1:06 AM
to type less
 
Xeo
@DeadMG they aren't? It's the same with SomeType x; x = some_value; vs SomeType x(some_value);
 
congratulations, on the incredibly-rare offchance that I might initialize a native array, I might be able to save a couple of seconds
you've made a massive difference to my life
 
@Xeo are you sure it's like that for arrays of intrinsic types?
actually yeah it would be
@DeadMG you're welcome
 
that was sarcasm
initializer lists are worthless
like range-based for
 
No it wasn't sarcasm, it was a Freudian slip
you really like them deep down
 
1:08 AM
no
 
Xeo
@DeadMG There you go with your range-for hate again
 
it's a pointless piece of crap
 
@DeadMG Range-based for can be used for locking!
 
so can regular libraries
 
Xeo
It's not pointless, you just hate it because it ties ranges to begin and end
 
1:10 AM
no, I hate it because it's pointless
 
@DeadMG While true, that was sarcasm, not an attempt at an argument.
 
the Committee won't fix the actual problem, which is that iterators suck and lambda support is incomplete
so they band-aid on ranged-for because other languages have a dedicated foreach statement
 
How is lambda support incomplete and how do iterators suck?
 
no polymorphic lambdas, and iterators suck because they're uncomposable
in a better-designed Standard library, you could do std::for_each(vector, [&](obj) { });
which would be just fine
 
I agree on both counts.
 
1:12 AM
or even vector.for_each([&](obj) { });
 
Why didn't they make that possible?
 
and unlike range-based for, polymorphic lambdas and better ranges are useful for things other than that one single use case
polymorphic lambdas were cut, IIRC, because they didn't play well with Concepts, which are a cut feature now anyway
and the better ranges weren't adopted, probably because the Committee are thick
 
Non-composability of iterators really shows when you want to return a (non-physical) sequence from a function.
 
composition is very important
 
Pardon my ignorance, but what does non-composability mean?
 
Xeo
1:15 AM
I don't quite understand the composability argument. Mind showing a little example?
 
@SethCarnegie Composability is the ability to do f(g(x)), basically.
Regarding iterators...
 
it means that you cannot create a function f so that you can do for_each(f(...), function_object)
 
Isn't that a problem with for_each rather than iterators?
 
no, it's a problem with iterators
 
Here's a contrived example: write a function that generates the fibonacci sequence and call it passing the result to std::copy.
 
1:16 AM
because "a pair of iterators" cannot be encapsulated
you can only ever have a pair of iterators
you cannot convert to a pair of iterators
you cannot return a pair of iterators
 
You can't just do std::copy(fib(), somewhere);.
 
> Only wimps use tape backup: *real* men just upload their important stuff
on ftp, and let the rest of the world mirror it.
- Linus Torvalds
 
So the problem is that you need two of them instead of just one
 
Linus is a moron and he can say whatever he likes
 
two iterators that is
 
1:17 AM
yes
if you have one object, you can inherit from it, template it, do a lot of things
 
You need to auto pair = fib(); std::copy(pair.first, pair.second, somewhere);
 
but if you need two objects, you can never abstract that
 
So then the correct design would be to make iterators know when they are at the end?
 
@DeadMG Oh no you di-dn't!
 
1:18 AM
I'd prefer that range objects are composed of two iterators and possibly more
 
One of the reasons they are how they are is probably so that you can use C arrays with stdlib functions right
 
Yep, C crippled C++.
 
@RMartinhoFernandes again
 
It workses!
Now, is 200ms too much to sort a 10000-element array?
 
real men sleepsort it
 
1:20 AM
@RMartinhoFernandes Nice!
 
@DeadMG I don't care about real men, I'm a robot.
 
I don't care about real men either, it's an expression :P
 
It would be easy now to write a function that takes a C array and returns a single "improved" iterator that knows its own bounds, but I guess back then they couldn't do that or something?
Seems like a big sacrifice for a small gain
 
a lot of the potential power of templates was unknown at the time
 
Ah yeah, template power was "discovered"
 
1:24 AM
So? No one knows how long it takes to sort 10000 numbers?
 
@RMartinhoFernandes no, no idea
Write a C++ version
 
with an nlogn algorithm? 200ms is obscenely long
 
Damn. I'll have to write it.
 
Anyways, well even without templates, it could take the pointer and the size of the array and return the iterator
 
but remember, ideone probably runs the code in a super-sandbox
 
1:25 AM
True
 
so I doubt that it reflects the real execution time
 
@DeadMG Yeah, I think so too. But I also need a better measurement. That 200ms includes startup, termination, printing, and a few copies.
 
also valid reasons that your previous question regarding the runtime was idiotic
 
@SethCarnegie But that would not maintain C syntax.
That was a design goal.
 
a dumb design goal
 
1:27 AM
Dumb
yeah
 
"compatibility" did not have to mean source compatibility
C# has enough C compatibility
 
Ben
yea I wish C++ hadn't adopted C's syntax so it wouldn't have caught on
 
What's the package name for Haskell on Arch?
 
C syntax != keeping C compatibility like C++ did
 
@SethCarnegie Try haskell-platform.
 
1:28 AM
@RMartinhoFernandes perfect, thanks very much
 
1:41 AM
Hmm. C++ takes about 10 ms. Now, how would I go about timing the Haskell code... Timing is not pure :(
20x is too much.
 
maybe haskell sucks? :P
 
@DeadMG Nah, I'm pretty sure it's my code.
 
lol
 
I'm using boxed arrays, and converting them to/from lists,... I'm doing a lot of slow stuff.
I have a lot of margin to optimize. Once I get it timed correctly.
 
Does anyone happen to know if, in Lua, where a is not a local, is a looked up twice in _G in this code: print(a) print(a)
actually I can figure it out myself, nevermind
 
1:49 AM
yes it is
and I'm a lua_Expert so feel free to ask
 
Hello all :)
 
@DeadMG You are? awesome
 
that's why you often find things like
local sin = math.sin at the top of files
 
Yeah, knew that
 
to improve access speed, since math.sin will always be looked up as _G.math.sin
 
1:51 AM
hmm
In a theoretical language that you designed, in this code:
if (a) { print(a); a = 3; print(a) }
 
I did design a language, and am currently implementing it
 
Cool
so in that snippet, what is the scope of a each time it is accessed
well, twice accessed, once written to
 
the scope?
 
For instance
 
the scope is defined when it was originally defined
scope doesn't change with use
 
1:53 AM
Oh sorry, where a isn't defined
 
then error
 
Then pretend the language is like lua where there's no such thing as "defining a variable"
but each file has its own namespace
initially
 
well, in Lua, then a does not have a scope
it's an object in a table, namely _G
only variables, e.g. locals, have scope
 
Well I'll tell you what I was thinking and see if it makes sense
in if (a) and print(a) the variable a will be looked up in the namespace and found to be nil, but then in assigning a = 1, a becomes a local variable because variables assigned should become part of the most immediate scope
Where ifs have their own scope, like in C++
Does that seem to be consistent behaviour?
 
no
variable scope should be constant and unchanging, else you're begging for confusion
 
1:59 AM
Then all variable assignments, unless declared local or global should create that variable name in the file's namespace? (pretend like global makes a name global and local makes a name the most local that it can be)
 

« first day (417 days earlier)      last day (4533 days later) »