« first day (300 days earlier)      last day (4650 days later) » 

7:00 PM
Ohla @Als
How are you?
I'm struggling with templates
meh
 
Als
@TonyTheTiger: I am well, Thanks, Ahh..templates not my strong area too :(
I struggle with them often
 
meh
I have a 'T* a', can I do 'a[idx]' ?
 
sure
 
where T is a integer or double or float
 
Als
a[i] = *(a+i)
 
7:03 PM
a[idx] expands to *(a + idx) that's why idx[a] is the same
 
Als
@Nils: Beat you to it :P
 
@als yes
contrats :P
 
Als
@Nils: Yes, congrats will do, Since I reached rep limit already
:D
 
arl.wustl.edu/~lockwood/class/cs306/books/artofasm/Chapter_16/… Why is there no translating CFGs to C code?
heh there is a rep limit?
 
Als
@Nils: Yes 200 per day, Bonus votes & accepted answer votes excluded
 
7:06 PM
If you've probably noticed, I've been missing for some time now.
 
Als
@Xaade: Even if we had missed it, you already made us notice, so whats the story?
 
I finally figured out how to call that stupid DLL.
 
I mean context free grammar not control flow graph with cfg
 
@Nils You mean like, how every parser generator and it's dog can generate a C parser?
 
C++ cannot be parsed.....
 
Als
7:09 PM
@Xaade: I am out of context
 
yes
 
There was a dll that needed a pointer to a struct which contained pointers to byte arrays.
Took me a while to learn how to marshal that.
 
what languages?
 
and I did so with safe code.
C# calling C++
 
C#. I must learn this crap.
 
7:11 PM
It's a complex thing, but when you know it, it's rather simple.
 
Oh rly?
 
Yeah, once you know WHAT to do, it goes rather quickly.
Sample incoming
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
public struct myStruct
{
    [MarshalAs(UnmanagedType.LPStr)]
    public String pSource;
    [MarshalAs(UnmanagedType.LPStr)]
    public String pDest;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 42)]
    public byte[] filler;
}
Then
    [DllImport("THEDLL.dll")]
    internal static extern bool THEDLL(ref myStruct callArgs);
So, to send a pointer of the struct, I simply use ref. Not sure how I was supposed to figure that out without SO.
 
Als
@Xaade: C# not my flavor as well I am afraid
 
sbi
C++0x FDIS was just unanimously approved by ISO members! We have a new standard (coming)! Congrats to all. #cpp #wg21
Ha! I'm first!
 
In other news, America voted to raise the debt ceiling.
 
Als
7:16 PM
@sbi: When does that get officially released? Feb 2012 I heard.
 
There's your star.
 
sbi
@Als Really, I dunno.
 
A Pin EVEN?
That's an @sbi official pin. Which means it won't get garbage collected.
 
sbi
Oh, c'mon, @Xaade, what if not the news of a new version of the C++ standard would warrant to be pinned in the C++ room?
 
Als
7:18 PM
@Anyone any idea?
2 mins ago, by Als
@sbi: When does that get officially released? Feb 2012 I heard.
 
I got it.
Thanks to @sbi, at least our pins will be on topic.
2
 
sbi
@Xaade It will, latest in two weeks, but I suspect I'd unpin it before that.
room topic changed to Lounge<C++>: FDIS approved, we have a new standard (coming)! [c++] [c++11]
 
It ruins the fun when I can star my own messages. I don't have to work on my sarcasm so hard.
 
sbi
@Xaade That's ridiculous.
In this room off-topic is what's on-topic. If you want on-topic discussions, please go somewhere else!
 
18 secs ago, by sbi
In this room off-topic is what's on-topic. If you want on-topic discussions, please go somewhere else!
QFT
 
user457812
7:21 PM
I want kittens.
 
I just came up with a meta idea.
 
Als
@nil: We don't have kittens at the moment but we have a puppy @DeadMG and a tiger @TonyTheTiger
 
I'll post link in a sec.
 
sbi
@Xaade Uh oh, I fear for the worst.
 
user457812
Fear and kittens are a good combo
 
sbi
7:26 PM
C++11 unanimously APPROVED. We have a new standard!
 
Als
Okay so it is approved, what happens next?
 
user457812
Sit and wait for 20 years.
 
0
Q: Chat rooms for imported comment threads, no way to sort out

XaadeI love the new feature, however I have one small problem. If I go to the chat page to see which rooms are available, then I see a mess of "Discussion between N... (cut off)" Not only do these rooms give no adequate description of what's going on, they've flooded the chat page. There's ~15-18 pag...

 
@nil TR2 comes first ;-)
 
@sbi It wasn't that bad, was it?
 
Als
7:29 PM
@FredOverflow: Do you mean they will roll out a TR2 and then the actual c++0x?
 
sbi
@Als It's C++11!
 
It made it in time.
 
sbi
@Xaade No idea. I didn't understand it.
 
I was anticipating a C++12
 
Als
@sbi: Okay, It's C++11
 
7:30 PM
@sbi Go to chat.stackoverflow.com. Look at the chat rooms available.
Used to I could see every prominent room.
 
Als
but that still doesn't answer my question, what happens next? when does it release?
 
@Xaade You have 1k rep exactly
 
However, now I see mostly "Discussion between" imported threads.
 
sbi
@Xaade Which link?
 
@hexa 1002 rep now.
 
7:32 PM
downvote 2 answers fast!
 
Als
@Xaade: The grumpy man has 50times of that
 
@hexa why?
 
sbi
@Als I don't know the bureaucracy involved, but from the few scraps I have picked up here and elsewhere I seem to remember that it will now take a few months until the bureaucratic mills have grounded everything.
 
1000 is cool
 
sbi
@hexa Ach, it's a very odd number in both binary and hexadecimal. Nothing special about it here.
 
7:33 PM
It's a threshold, but not something to loiter about.
 
@sbi 1000 is not odd at all
 
1k, its my first k on the way to 10k
 
Als
@sbi: I see, so maybe what i heard was correct Feb 2012
@Xaade: hmm...10 times
 
binary has appeared in history more often than just recently.
 
sbi
@Als Maybe. I suspect @Johannes or @James might know better than that.
Or maybe @jalf knows?
 
7:36 PM
In China, binary appears in their technique to predict things (8 something or another). In each 8 parts, there are three lines, with a closed and open state. Binary.
 
Woo, happy C++11-day, everyone!
what do I know?
 
sbi
20 mins ago, by Als
@sbi: When does that get officially released? Feb 2012 I heard.
 
oh, all I know about it is what I've read various committee members say on blogs and such
 
It would've been so cool if the standard was approved yesterday, 11
 
I'm pretty sure Herb Sutter outlined the timelines on his blog a while back
 
sbi
7:38 PM
@jalf Well, would you mind spreading it here.
 
I think he said that with the current schedule, we should look at a a november'ish final release
with FDIS in march (or whenever it was), he figured they'd still be able to manage a release late this year
I think (not sure though) that feb 2012 was their fallback, if they had to delay everything by one meeting
 
But in practical terms, nothing will change from now to then, right?
So if I am an implementer I can start working without the fear stuff will change
 
Als
I see, So November it is
 
yeah, as I understand it, the remaining time is just for bureaucracy, filling out paperwork and getting everything ready to publish the spec
@Als well, if you want to trust my memory of what I read on a blog a year ago, sure ;)
 
I'd just wait and officially make it a standard at 11/11/11
 
Als
7:41 PM
@jalf: I will take that as for now, since I remember someone saying feb 2012 and tha t matches the fallback date you said
 
@Als oh, it matches because I saw you said feb 2012, and I remembered Sutter outlined a fallback plan, so I figured that must be around then :p
 
Als
@jalf: Ah lulz
 
ah, found one of the blog posts
according to that, their fallback plan was to add a full year to the process
> vote on the Final Draft International Standard (FDIS) for C++0x standard after the Madrid meeting in March. If that happens and that ballot succeeds, the C++0x standard will be published in 2011
 
Als
@jalf: So November 2011 it is then
 
I'm pretty sure he said something more specific somewhere
 
7:46 PM
Evidence of binary in chinese history
The bagua () are eight diagrams used in Taoist cosmology to represent the fundamental principles of reality, seen as a range of eight interrelated concepts. Each consists of three lines, each line either "broken" or "unbroken," representing yin or yang, respectively. Due to their tripartite structure, they are often referred to as "trigrams" in English. The trigrams are related to taiji philosophy and the wu xing, or "five elements". The relationships between the trigrams are represented in two arrangements, the Primordial (先天八卦), "Earlier Heaven" or "Fuxi" bagua (伏羲八卦), and the Man...
 
rather than simply "in 2011"
 
Can I tell strtok to also return delimiters?
 
So I have to write my own tokenizer
wondering if that is actually hard
 
Boost?
But a tokenizer shouldn't be hard.
 
7:54 PM
will do it myself
 
sbi
@Nils Usually using std::getline() (which, contrary to its name, accepts other delimiters than EOL) makes it rather easy.
I must have shown code for this in at least a dozen answers on SO...
 
@sbi getline will consume the delimitor, Nils wants to get access to it.
 
aha but it can only use one delimiter, not more like a tokenizer?
 
sbi
@Nils Ah, no, that it can't. (Can std::strtok()??)
 
@sbi no. That's how the thread started ;)
 
7:59 PM
There is no C++ equivalent for strtok, right?
 
sbi
@AProgrammer You sure?
7 mins ago, by Nils
Can I tell strtok to also return delimiters?
Doesn't seem to ask for multiple delimiters.
Anyway, you might want to look into std::string::find_first_of().
 
Als
okay, calling it a day, have fun, and have a good weekend folks
 
sbi
@Als So do you!
 
@sbi I should put down that bottle of champagne. And that does change the answer: yes.
 
sbi
@AProgrammer I'm confused.
 
8:04 PM
strtok has a second argument which is a string of characters to be used as delimitor (in the same was as find_first_of).
 
sbi
@AProgrammer Maybe, I wouldn't know, and never claimed to, but this is not how this thread started.
 
8:16 PM
 
If you had a method that performed tests, and only one test needed a specific argument, would it be reasonable to create an enum of all tests and create a method that doesn't have that argument, and throw an exception if the test needed the argument?
 
If I iterate over the a string and dereference the iterator what exact type is the dereferenced iterator?
 
char?
 
@Nils The value_type of the string, IIRC
 
which is?
my string is also const
 
8:20 PM
So, char for a string and wchar_t for a wstring
 
again, char?
 
sbi
@Nils std::iterator_tag<Iterator>::value_type
 
If your string is const, then you'll probably get a const char &.
 
ah and I can't convert it to a string by calling string(<const char>)?
 
@Nils No, because there's no constructor that matches that
 
sbi
8:22 PM
@Nils There's a ctor taking a value_type and a size_type (for the number of such chars, set it to 1)
 
@sbi Yeah, that would be the closest one (but I think it's size_type then value_type, in that order)
 
sbi
@EtiennedeMartel Oh, I didn't try to imply any order. I would have to look it up.
 
humm
 
So, it would be std::string whatever(1, *your_iterator);
 
being a Const Nazi isn't much fun
 
8:26 PM
@Nils Hmm
You should pass your string by const reference instead of const value.
 
sbi
@Nils Not being a const nazi is no fun at all. Because you will still have to fix the code, only you need to do this through debugging rather than error messages.
 
And initializing a string to "" is unecessary.
Call empty instead of comparing to ""
 
sbi
@EtiennedeMartel Reading a book explaining these basics, however, is necessary.
 
@sbi I've never read any C++ book.
But I understand their importance.
@Nils What the hell is this: tokens.push_back(string(*const_cast<char*>(delimIt)));
 
The line that doesn't work.
@EtiennedeMartel sure I should pass by reference
 
8:29 PM
Yes
But what are you trying to doooo?
 
sbi
@Nils No, it's the line that doesn't make sense.
 
This line is an ugly mess.
 
yes I know
 
So how can I convert that iterator into a string object?
 
8:30 PM
SOMEONE SAID STRTOK.
 
What are you trying to do? Substring the string?
@Nils Depends on exactly why you are trying to do that conversion
 
@CatPlusPlus Yes it's not suitable, I also need the delimiters as tokens, read above
I want to append it to the vector<string>
 
strtok shouldn't ever be even considered.
 
Append the character?
(Also, inputIt<input.end() should be inputIt != input.end())
 
In this case I want to convert the char into a string with just a single char.
 
8:32 PM
Also use Boost.Tokenizer.
 
@Nils Okay, so just do string(1, *delimIt)
 
no
 
std::string(1, 'a') gives you "a"
 
humm wtf?
 
@Nils Eh?
Dereferencing a string iterator gets you a character, and you can then use that constructor to get a string that has N times a certain character.
 
8:33 PM
Why does string(1, *delimIt) and string(*delimIt) not?
 
@Nils Because there's no constructor for string that takes just a char
No magic involved.
 
ok
thx @EtiennedeMartel and @FredOverflow
 
auto sep = boost::char_separator<char>("", "|");
auto tokenizer = boost::tokenizer<boost::char_separator<char>>(input, sep);
for (auto it = tokenizer.begin(); it != tokenizer.end(); ++it) { /* here are your tokens, including separators (here |) */ }
Reinventing the wheel is a waste of time.
 
I don't do productive work now.
Is there any reason to use iterators instead of just iterate with indices?
 
@Nils Try using a std::list with indices
Iterators are an abstraction.
 
sbi
8:43 PM
@Nils Sounds reasonable. IIRC, it's Friday night for you, too.
 
Now I get a segfault and don't know why.
 
sbi
@Nils It's usually because you grab someplace you shouldn't. So the machine slaps your fingers saying "Don't!"
 
I know what a segfault is :) But not why it happens here. Technically it's the OS and not the machine.
hrmm maybe I should just go to bed
meh forgot to set found to false again
 
9:05 PM
@Nils Look carefully at: for(input.begin(); inputIt != input.end(); inputIt++), especially the initialization part -- and take note that you're getting an iterator,but not assigning it to anything.
 
@JerryCoffin thx
 
@Nils Surely. Exactly the kind of thing that happens to all of us -- having looked at it often enough you can't see what's right in front of you any more.
 
9:23 PM
For the tag-specific badges, do votes only contribute if they cause reputation gain (i.e. when you're below the cap), or do all upvotes count towards the badge?
 
sbi
Now Herb realized it, too:
Blog post: We have an international standard: C++0x is unanimously approved: The final ISO ballot on C++0x close... http://t.co/eNQcXm3
He still has to work on the standard's version's name, though.
 
@sbi C++11 will do, I guess.
 
I'm still calling it 0x.
 
sbi
9:43 PM
@CatPlusPlus That's because your backwards.
 
10:01 PM
@CatPlusPlus It's technically C++1x.
And it originally was supposed to be C++08.
Gotta love design by committee.
 
10:20 PM
@sbi My backwards what?
 
sbi
@CatPlusPlus Yeah, I noticed that immediately - after the 2mins were gone...
 
10:59 PM
lol
 
sbi
The @Feeds guy will be here in a few minutes (I suppose he will, anyway), pointing out that I turned this into an FAQ entry. Can you guys please check whether this makes sense? Feel free to rollback if I overdid.
What are you doing here, @Tony, we haven't spoken of sex for hours.
 
thats why im here to remind you
 
sbi
Anyway, I'm off to bed. Good night to whoever is still here!
 
11:24 PM
@TonyTheTiger that's so hilarious
 
hehe :)
 
Dennis Ritchie?
 
11:54 PM
@FredOverflow freddy how are you baby?
 

« first day (300 days earlier)      last day (4650 days later) »