« first day (387 days earlier)      last day (4576 days later) » 

Als
5:14 PM
hello @RMartinhoFernandes
 
Als
whats up?
 
lol reading a BS interview from 1993: "Q: When C++ is standardised, do you have plans to extend it further? (ANSI 2010 C++ Std perhaps)

A: My immediate reaction is "No way!""
 
At first I thought you meant "bullshit interview".
@Als Same old, same old.
 
I want an std::string but I have and LPWSTR
What do I do?
 
5:18 PM
Is a std::wstring ok?
 
I take that back
 
If not, you need to use one of those tomb functions or whatever they're called.
 
I'm trying to port some code from someone writing something for Linux (the binary was compiled in 16-bit... :| ) and make it native Win32
But it was written to do something to a wine emulated program
 
In Win32 people usually prefer std::wstring because it plays nicer with Win32.
 
if (GetWindowText(window_handle,buffer,512) > 0)
                {
                        std::string title = (std::string)buffer;                 //This conversion doesn't exsist

                        std::string::size_type pos1 = title.find('-');
                        std::string::size_type pos2 = title.find(static_cast<char>(-106));

                        if (pos1 != std::string::npos && pos2 != std::string::npos)
                        {
                                pos1 += 2;
                                artistName = title.substr(pos1, pos2 - pos1 - 1);
 
Als
5:23 PM
I feel a little weird today :(
 
AFAICS, using std::wstring would not break that code.
@Als What's wrong?
 
@RMartinhoFernandes Ahh it's all working nice
 
Als
@RMartinhoFernandes: I ate a lot of pizza yesterday, I couldn't get much work done at work, spilled coffee over myself and now I am feeling not so well.....
 
Just It was breaking because I forgot to use TEXT("{stuff}") in my initialisation
 
Sounds like you're having a really bad day :(
 
Als
5:26 PM
Yes:(
 
5:38 PM
I'm writing highly compressible code. Freaking typename is all over the place.
I guess it's time to start using macros.
 
5:49 PM
SFINAEing with std::enable_if is painful. This thing should be built into the language.
 
Well porting all that was completely useless -.-
Today I got asked why you should probably never write a whole website in Flash
 
Because I'll go to your house and cut all the fingers from your children's hands.
 
@RMartinhoFernandes shouldn't you cut the fingers of flash coder rather than of his children's?
 
Obviously, you suck at being Jack Bauer.
 
6:05 PM
> A few people on a message board said that if you microwave the book for a certain number of seconds, it opens. Against my better judgement, I tried it, and it worked!
lol
 
Wow that's pretty impressive
 
Luckily it's fiction and no books were actually harmed in the process.
 
lol?
That thing is awesome!
 
Thought you guys would like it
 
Als
6:11 PM
burp...
JaredPar names seems heard of..
 
He's on StackOverflow.
 
Als
with few 100k rep if I remember correctly
 
Als
@RMartinhoFernandes: Damn! You are a real archivist!
Nothing slips past you in SO, does it?
 
Well, sometimes I am asleep.
Gotta go buy some supplies now. See you.
 
Als
6:14 PM
Modesty from a bot ehh
I-Bot it seems
 
6:34 PM
And I'm back.
room topic changed to Lounge<C++>: Toto, I've a feeling it's not Friday anymore. [c++] [c++11] [c++-faq]
 
6:55 PM
int* T = new int[5]; , what could be mean or interest of doing this : &(T[-1]) ?
 
Nothing but trouble.
 
@RMartinhoFernandes and if do free(&(T[-1]) ?
 
Gosh, even worse.
Where are you getting this from?
Burn it!
 
7:20 PM
Leaking rep again. ;_;
0
Q: Returning a formatted string from a time structure

user1017443I wrote a little structure for getting certain time information. This structure is a helper, for my logging class im planning to write. Here is the code: struct UTime { char Month [4]; char DayOfMonth [3]; char DayOfWeek [4]; char Year [5]; char Time [9]; char Full ...

 
7:53 PM
Time to do some real work
Eugh I cannot be asked to port some crappy, messy VB code to a better language right now
 
Hi grp members
Anybody having idea how can i use to traverse nat for p2p media app?
 
nat punching
if you have a 3rd party that can see the public side of both peers without firewalling it's fairly straightforward to do in a number of cases
nat punching is also quite aptly named because if you ever have to do it you will want to punch nat
(the table at the end is quite a good argument against the "but NAT is a firewall" argument too)
 
sbi
8:12 PM
Blog post: C&B 2012!:   There will be a C++ and Beyond in 2012! It will probably be in early August, but keep r... http://bit.ly/vuQRxF
 
@sbi cool
 
sbi
@FredOverflow Except I again will not be able to afford being there.
 
But we can watch the videos afterwards.
 
sbi
@FredOverflow As if this was even nearly the same...
 
Hmm with any luck I'll have a US trip around then anyway
 
8:18 PM
yeah i have been through the link you mentioned. However, i wish to see how can i use public STUN servers using bsd socket to do this
http://www.voip-info.org/wiki/view/STUN
 
sbi
I love to read whatever Scott writes (sometimes I think he could write cooking recipes and it would be fun to read):
> You can help us figure out where to hold it. [...] Bonus points if there are likely to be fireflies present during the event, because (1) I like fireflies, (2) they don’t exist where I live (near Portland, Oregon, and my entomology friend tells me that we actually do have fireflies here, they simply don’t glow, but, please, like that counts…), and (3) it’s my turn to choose where to hold C&B. (Herb chose in 2010, and Andrei chose last year.) tinyurl.com/czb4cjk
 
@FredOverflow Like E3. You can watch it on this show that's supposed to tour it for you. But then you'll only get to see it from one corner, and the show will be unusually interested in only one booth, venturing out with occasional highlights. Returning back to the booth to go "Yar yar yar.... yadda yadda", with a bunch of costumed peeps paid to stand in the background like statues (when they really just look around, then text on their phone about how they're paid to waste their E3 trip very bored).
 
sbi
@awoodland That would cut the costs considerably. Or would it? That seminar comes with a very hefty price tag.
 
@sbi - maybe I underestimated the registration fees for it
 
@awoodland Easy to underestimate "your left leg".
 
8:24 PM
@abhinav looks like there's quite a few libraries around that implement STUN
 
sbi
@awoodland Found it: cppandbeyond2011.eventbrite.com. It was US$3k this year.
 
@sbi woah I was out by an order of magnitude!
 
@sbi geez.... I hope the ticket is gilded in gold. And the bathrooms have gold crappers.
 
sbi
Well, you got three of the top-notch C++ speakers in the same room for several days. What did you expect?
 
@sbi Yeah, I get three guys in the same room all the time.... for football and coke. But I don't charge 3k.
Nobody is worth that much.
We should do like futurama. Clone their heads, and stick them in a fishbowl together.
 
8:32 PM
I can convert from degrees to radians by multiplying with pi/180. Is there a standard library function that does this, so my code becomes more readable?
 
sbi
@Xaade I have been to seminars with Scott twice (he's in Germany every fall). From what I remember (I didn't have to pay it myself), the price for Scott alone in a one-day course was a reasonable fraction of those 3k, and IMO it was worth every penny. YMMV.
@FredOverflow I doubt it, but your code also becomes more readable when you introduce your own, well-named function for that.
 
@sbi You know, it doesn't help my belief when you preface with "I didn't have to pay".
 
Hey there, C++... noob here. Any way to reduce the amount of template <class T> in a .cpp file?
 
That's like a wal-mart checker saying all those taxes we pay are worth it.
@IvoWetzel Rewrite in C.
 
8:36 PM
I'm curious for the reason why the template hate?
 
@IvoWetzel - you could do it all with specializations which would change the line, but is probably counter productive :)
 
@FredOverflow depends on the reader. Math junkies prefer everything explicit.
 
or you could declare and define it all at the same time
 
just looking for a approach that's a bit more less noisy in terms of syntax
 
@awoodland #define StringList List<String>
@IvoWetzel @awoodland I prefer noise if it tells me exactly what I'm looking at. It's more noisy to have comments explaining the hidden code.
 
8:39 PM
@IvoWetzel

template <typename T>
struct foo {
void bar(T& t) { /* ... */ }
};

No need to write `template <typename T>` more than once like that
 
sbi
@Xaade The companies I worked for at that time did it.
 
ok now I'm confused how I broke that markup
 
sbi
@Xaade There's an important difference: You do not have to go to a C++ seminar, but you do have to pay taxes.
@awoodland It's all explained in the newbie hints. :)
 
@sbi Reread "we" as in "other richer people"
 
sbi
@IvoWetzel Why would you even consider that? What's your actual problem??
 
8:42 PM
@sbi - oh it has to be all lines of the multi line message, not just a select few
 
@sbi lazy programmers do more work.
 
@sbi Actual problem is me trying to use C++ >_> No! I won't hurt it! At least... not that much
Trying to port some WebGL thing over to C++ because I like my little tech demo, but it will be really limited with JS and it's capabilities in the long run
 
sbi
@Xaade Shrug. I have no idea what you're getting at and how that is a reply to my message.
 
@IvoWetzel The only way to do what you want is a macro.
 
sbi
@awoodland Indeed.
 
8:44 PM
GL part is not the problem, it's more about trying to port the logic
 
@sbi Meaning, it's easier to say something is worth its value, if you didn't pay for it. Hence, it's easy for a checker (who doesn't pay taxes) to say to everyone paying taxes, that the money is worth it.
 
sbi
@Xaade That depends on what he really wants to do. For example, if he wants to get it more readable, then the macro will not do what he want, but the opposite. That's why I asked what the underlying problem is.
 
See, I've got "Object pools" for pooling all sorts of objects, there are different version of the pools which all derive from a base class which has most of the pooling logic, now these need to handle the different Object Types so - unless I'm completely mistaken - using a template for the Pool is a "good" idea here
 
@IvoWetzel - sounds like the boost object pool is getting re-invented
 
@IvoWetzel template is generally better than the old void* method.
@awoodland Oh, I forgot. Boost is god.
 
8:48 PM
boost has a lot of handy wheels
 
@awoodland I'm not deep into C++ at all, but quick google says it won't meet the requirements of this bullet hell shooter thing
 
@IvoWetzel Bullet hell, all about not looking at anything in particular, and spray-n-pray.
It's a blind man's game.
 
> Where else will I get a chance of a fair fight where I have the advantage? — Dominar Rygel XVI
Stupid Intel drivers blow my second screen's resolution down to 1024x768 if I toggle my WiFi on/off.
Ooh moderator nominations. Will @DeadMG apply again? ;)
 
sbi
9:05 PM
@Xaade Oh, for paying it with your own money it's terribly expensive, I'm all on your side. But with corporate money, that's a totally different story. Those 3k are, what?, half a month' payment? A mere 24th of a year's salary? Shrug. Every company that isn't in dire financial troubles should be eager to spend that amount per year on educating and motivating an employee.
Note: I said should. I know that Companies are run (into ground) by the bean counters.
@RMartinhoFernandes Ah, that explains Kate's tweet, which had me puzzled.
 
@RMartinhoFernandes They're afraid to make anyone in this chat a mod, for the mere reason that we'd be a liability. And, Jeff doesn't like @sbi
 
I believe @sbi doesn't like Jeff either.
Anyway, I was joking about @DeadMG applying. Just like he was joking when he applied for the last elections.
 
@RMartinhoFernandes Mostly, when you have a small number of people controlling something, it inevitably leads to the point where said group no longer feels a need to explain their logic.
Logic tends to degrade when not held accountable.
 
sbi
@Xaade I don't think Jeff cares enough about me to go to the trouble of not liking me.
 
@sbi He tends to get annoyed when he smells you; often he doesn't notice it's you that's the bother.
 
sbi
9:16 PM
@Xaade And what do you have to back this up?
 
@sbi meta
 
sbi
@Xaade And what is it on meta that backs you up on this?
 
IOW, linky.
 
Don't worry, I'm sure you'll come up with something else to be deeply offended about in due time.. – Jeff Atwood♦
 
hmm I was thinking about going for it this time
 
9:22 PM
10
A: Is mentioning sex ok or is it not?

Adam DavisIt's worth pointing out that the conversation about sex started here: http://chat.stackoverflow.com/transcript/message/573133#573133 The ongoing C++ discussion where Tina was asking for some programming help was railroaded. Further, when she requested that they stop talking about it, they refu...

 
@awoodland Going for what? Modness?
 
Sounds pretty much like.... "I don't like you." to me.
 
@RMartinhoFernandes yeah
 
One of my votes goes for Tim Post.
(I expect him to reapply.)
 
reapply?
 
sbi
9:23 PM
@Xaade But that wasn't about disliking me at all. He could have said the very same to any other SO user expressing offence about one of his discussions.
 
Does have a mod proper?
 
@awoodland He is currently a mod.
 
why would he reapply?
 
@sbi Yeah, that's just Jeff being Jeff.
 
because he dropped out of the list from last time?
 
9:24 PM
@sbi Ok ok.... Jeff doesn't like anyone who disagrees with him.
 
sbi
@RMartinhoFernandes Really, I bet that, if you ask Jeff "Who is sbi?", he might not even know. And I have opposed him quite ferociously on several.
 
@awoodland No, but he needs to be reelected if he is to continue being one, no?
 
He has a very "Put the foot down" attitude.
 
@RMartinhoFernandes - I assumed the elections added to the set of moderators
 
sbi
@Xaade There's a very important difference between "do not like the opinion you expressed" and "I do not like you".
 
9:26 PM
@sbi Maybe I read things wrong, but watching Jeff, I don't think there's that distinction in his book.
Have opinions he doesn't like often enough, and he will not like you. Often enough to where he remembers, and he'll remember not liking you.
 
Well, have opinions that I don't like often enough, and I will not like you.
 
sbi
@Xaade As I said, I bet that, if you ask Jeff "Who is sbi?", he might not even know. And if that's true, he's not disliking me, but only some opinions I once expressed.
 
@RMartinhoFernandes There's people I like, respect even, that have remarkably different opinions than me.
 
sbi
I believe that's the case.
 
@Xaade Everyone has their own value of "often enough".
 
9:28 PM
What do you think of this program of mine? :)
 
OMG, it's full of stars tricks!
 
that is quite neat
the problem is it makes me wonder how to make it more obscure
 
sbi
@Xaade Here's another important distinction: the one between "that opinion differs from mine" and "I don't like that opinion". (Do you really need to be told those or are you just slaughtering them for rhetoric reasons?)
 
@FredOverflow You didn't center it right!
 
@Xaade Just put it in an HTML and put <div align=center> or whatever the syntax is around it ;)
 
9:31 PM
Are quote-less attributes valid on sane HTML?
 
sbi
Anyway, I'm off to bed. Have fun!
 
Good night.
 
Hello
 
@FredOverflow - you ought to swap the index and the pointer for: (x & 1)[" *"]
 
Oooh, like a map :)
 
9:31 PM
@awoodland That's the first thing that came to my mind, too ;)
 
and I'd be tempted to make it recursive
 
go ahead
 
@sbi There are people I respect who have opinions I hate and would like to burn.
 
And then do it with the Y-combinator!
 
I didn't think I'd have to be that pedantic.
@awoodland I like that it can do without recursion.
 
9:37 PM
hi
 
I'm never gonna say hi/hello again lol
@jalf hi
 
Ah, it's a growing bitswitch, and then you XOR it and it shifted left
 
@LewsTherin Why?
 
Then you rely on the size limit of unsigned int.
 
9:39 PM
@FredOverflow - are you happy to rely on ASCII?
 
@RMartinhoFernandes I said hello and no one replied rofl
 
@awoodland You mean like 32 + 10 * (x & 1)? ;)
 
He doesn't rely on a particular size, just on the fact that it has a limit and overflows sanely (which are both guaranteed).
 
@FredOverflow - better than that I was going to use`__func__` as the string
 
what?
 
9:41 PM
so rename the function to AKprint_line
 
And rely on compiler-specific stuff?
 
static_cast<char>((x & 1)[__func__] - '!')
 
I think it's best if you just post an ideone link :)
lol
 
It's not as pretty now :(
 
You could replace while (x != 1) with while (x - 1). But why bother making it obscure in the first place?
 
__func__ is standard C - unmangled name of the current function
 
I don't get it, is this an obfuscated C contest? :)
 
Of course not. There's insignificant whitespace.
 
Also, std::cout is not C :)
 
9:46 PM
oh hai
 
> The function-local predefined variable __func__ is defined as if a definition of the form static const char __func__[] = "function-name"; had been provided, where function-name is an implementation-defined string.
 
I modified it to 64bit
 
lol trigraphs
 
9:58 PM
@Xaade Couldn't you just have replaced unsigned with unsigned long long?
 
At work today, I thought for a moment someone was actually using a trigraph
 
Dammit ideone, compile my snippet!
 
@awoodland Nice, templates :)
 
@jalf That must have been scary.
 
false alarm, of course. But on the upside, it was pretty cool to hear that some of my other team members know what they are too
 
10:00 PM
@RMartinhoFernandes Is ??/ continuation of line or something?
 
@FredOverflow - I can't see a better way to hide the end of the recursion though
@FredOverflow - it's a trigraph for `\`
 
@FredOverflow Yes, it's the trigraph of \ .
 
@awoodland explicit specialization?
 
> prog.cpp:7:27: warning: trigraph ??/ ignored, use -trigraphs to enable
:(
Me sad.
ideone sucks.
 
@FredOverflow - but that's the normal way of ending template recursions :)
 
10:01 PM
> use -trigraphs
@awoodland right :)
 
@FredOverflow Can't do that on ideone.
There's also:
 
argh, fuck you Visual Studio and your compiler bugs
 
> prog.cpp:8: warning: operation on ‘x’ may be undefined
Which is rather neat.
 
@RMartinhoFernandes which one?
 
@FredOverflow ideone.com/yWz2p
The supposedly commented line.
 
10:03 PM
right :)
 
I wasn't aware that GCC had those warnings (I never saw them!)
 
You only see them at high warning levels.
 
@FredOverflow I suppose
 
I always compile at high warning levels.
 
It's a hipster warning. You probably never heard of it.
 
10:04 PM
And in the winter, you should compile at high warming levels!
 
I just naturally don't write that kind of stupid code.
 
lol
 
@FredOverflow it didn't work
unsigned long long, still 32 bit.
 
@RMartinhoFernandes header? cstdint?
 
10:07 PM
Yes.
 
works beautifully
 
Needs C++11.
Now make 128 bit!
 
(hint: there's no std::uint128_t)
 
I tried to left shift more than 31 on an ulonglong and it warns, then fails to do so.
 
10:08 PM
@RMartinhoFernandes too large for my console ;)
 
@Xaade My program only shifts by 1.
 
If there are only 32 bits in unsigned long long (what kind of crappy compiler do you have?), it won't work!
Though on ideone, it's fine. ideone.com/QFIQP
 
10:11 PM
<3 cstdint
 
Oh, it saw the literal 1 as an int
Here's 128 bit version
 
Nice, it overflows the ideone console :)
 
tempted to abuse std::iota and std::transform now
 
Yeah, so you can extend it as long as you like.
need to make a new type that's 256 bits.
 
std::bitset<256>?
 
16384 would be an even number for this pattern, and be over 9000....
@FredOverflow So buy trojan.
 
here's a question
 
@FredOverflow ha ha
 
what do I do when I encounter a crippling compiler bug?
 
Smash your keyboard.
 
10:19 PM
ugh
 
Yell at the compiler vendor.
 
but I really need to keep working
 
Unless it's your own compiler. Then yell at yourself.
 
:(
 
Fails with SIGXFSZ :)
 
10:20 PM
lol
 
> XFSZ is an abbreviation for exceeded file size
POSIX naming conventions are ridiculous.
 
abbreviating them is ridiculous
what, are characters in headers expensive?
 
They were, once.
 
I doubt they were that expensive
 
ideone.com/B6PO9 - although actually it's UB I think
 
10:25 PM
considering the number of functions the POSIX Standard offers
 
also
 
I mean, it's not even working correctly for 64: ideone.com/2foXi
 
I decided that literals, especially strings, should be part of the parser, not the lexer
multiple-token constructs are parsed, not lexed
 
Well, if you define a string literal to be a single token...
:P
 
10:29 PM
it's not
 
Lexer transforms code into a tree structure right?
 
it's ", n tokens, "
 
no, that's parser
 
@StackedCrooked A lexer transforms text into a stream of tokens.
 
10:29 PM
Lexer converts text to token stream
Parser converts token stream to AST
 
So Lexer is tokenizer.
 
Code generator converts AST to x86
 
my old lexer structure was better
now that I come to think of it
 
10:31 PM
well
 
I like to get rid of the escapes from literals during lexing.
 
the new design violates DRY
and to be quite fkin' honest, I only had to refactor part of it to fix the error messages and such so that they would actually refer correctly
 
I have no idea what was the old design, nor what is the new one, so I can't really agree or disagree.
 
it was dumb of me to re-design the rest
well
in the new design, I split the string up into multiple sections, then I decided on the meaning of each section individually
i.e., from "namespace identifier {" to "namespace" "identifier" "{" to enumerated token values
whereas the other one went from "namespace" to TokenType::Namespace in one step
 
I prefer this last one.
 
10:34 PM
me too
the first one, which is my newer design, violates DRY
because you have to list the punctuation twice
plus, I have a perfectly good lambda in which to do the conversion
plus, it would give me the option of processing string literals etc in the lexer
plus, I realized that I was goddamn stupid about processing it, and I already invented a much cleaner way of dealing with punctuation and stuff and just forgot to move that over
 
Isn't dealing with punctuation just matching it and producing the corresponding token value?
 
yep
for some reason, I decided to match it, and then go back and match it again later
I mean, I listed them, like
if (check(L'.', TokenType::Dot)) continue;
which was dumb, instead, I decided to stick them in a hash map like I did with reserved words, and then look it up
 
Sounds sane.
 
10:53 PM
argh
I just refactored the whole damn thing to make it more sane, and the compiler is still giving me a stupid error
 
This is what my lexer for a C-like language (teacher made it up for the assignment) looks like: ideone.com/gvmYR. I'm still missing string literals. Tell me it's not glorious!
 
uh
it's definitely not glorious
how is your parser going to give reasonable errors if you don't propagate line and column information through the lexer to the parser?
 
I do.
getPosition <^(,)^> (ignored *> tok <* ignored) does that.
 
@RMartinhoFernandes OMG it looks like EBNF
 
ok
well I really can't read Haskell, so I really can't comment on gloriousness
 
10:56 PM
<^(,)^> is the happy pig operator.
 
I see nothing to do with macros in VS11?
 
why would you?
 
I want macros
 
Screw macros.
 
But they aren't there
 
10:59 PM
What macros.
 
1
Q: Strange compiler error in MSVC10

DeadMGI've got the following code: std::for_each(tokens.begin(), tokens.end(), [&](Token& t) { static const std::unordered_map<std::wstring, Wide::Lexer::TokenType> mapping([]() -> std::unordered_map<std::wstring, Wide::Lexer::TokenType> { // Maps strings to Toke...

 
@KianMayne I'm pretty sure they are there.
 

« first day (387 days earlier)      last day (4576 days later) »