« first day (492 days earlier)      last day (4439 days later) » 

5:00 PM
Interesting, my corp filter only blocks when there's a login session. I doesn't block the domain when not logged in.
 
Frequency works in mysterious ways.
 
@CatPlusPlus Oh, I forgot. I lost room owner status during my vacation. Disfrequented.
@RMartinhoFernandes Wait... there's a math to it? I thought it was someone's personal decision.
 
Ownership is personal decision, frequency is automated.
 
@CatPlusPlus Ah...
 
@Xaade The chat keeps a frequent users list here: chat.stackoverflow.com/rooms/info/10/…
 
5:02 PM
room topic changed to Lounge<C++>: [c++] [c++11] [c++-faq]
 
I must have upset someone ?
 
Oops.
 
@CatPlusPlus Hey, any topic is better than no topic.
 
Premature <CR>.
 
room topic changed to Lounge<C++>: Any topic is better than no topic. [c++] [c++11] [c++-faq]
 
5:03 PM
@RMartinhoFernandes I knew that much. @Cat implied (in my head, wrongfully) that frequented automated room ownership.
 
Hey, the wiki is 164 days old.
 
Ok, crap, I got to get in here during weekends. I don't show up on mondays.
 
Where did 164 days go?
 
5:04 PM
Well, okay, not 164. But it feels last month-y.
 
room topic changed to Lounge<C++>: You can always pretend to change the topic. [c++][c++11][c++-faq]
 
Just like the old days, huh?
 
@CatPlusPlus Gonna attempt to make a wiki page. Anything I should know before doing so?
 
Don't drink before driving.
 
Thanks for the tip!
 
5:09 PM
Anytime.
 
Don't drink while driving either. It will make a mess of your clothes.
 
@CatPlusPlus drinking before coding is allowed, and pretty standard.
 
Don't code before drinking.
 
Usually, that's what causes it.
Coding implies a cause of drinking.
 
Good morning guys.
I have a quick question. I hope you guys help me here.

if i have a base classA and base class has a friend classB.Also there is class which is derived(C) from the friend classB, will the derived classC be able to access base class.
 
5:11 PM
Life implies a cause of drinking.
 
Good evening.
 
@Leoheart Only if they belong to a university. Colleges don't accept those kinds of credits.
 
what?
 
Does your friend know you're talking about their classes?
 
@Leoheart It's like one of those ordering questions, where they don't let you draw the pictures.
@Leoheart ideone.com Go try it.
 
5:13 PM
:( i don't have time to try right now. Sorry thats why came here to know the straight answer. Otherwise would have tried.

thanks anyways
 
Anyway, friendship in C++ is not inherited, if that's what you're asking about.
And not two-way.
 
Sounds like an answer. Should work. Thanks..... a ton Cat plus.
 
Julie doesn't like Mary so Julie wants to be first in line. Tommy likes Mary, and wants to stand behind her, so she doesn't notice him. Mary doesn't like Julie, but Julie gets angry easy, so she doesn't want to upset Julie, but doesn't want to stand behind Bobby cause he stinks. Jimmy is the oldest and should go first, but he has a broken leg, so he wants to go last so he doesn't get pushed. Bobby doesn't care where he stands. How do you order them.
 
Has anyone here ever implemented a lexer in C++ for a programming language?
 
The puppy.
 
5:17 PM
@Leoheart I don't have time to test my projects, I need to submit them now. Wow, sounds like a school project. Hope it doesn't carry over into your job.
 
I wonder how the Windows folks here do GUIs..
 
@Nils Something about databinding?
 
MFC? Win32 API?
 
actually, i have an interview in 1 hour. if this doubt struck me yesterday, i would have sureshot found it myself.
i have to revise few topics thats why i dont have enough time for solving this mystery.
 
Great, my bedroom's lamp just blew up. Literally. In two weeks it's the third piece of hardware I own that goes bananas.
 
5:19 PM
@Leoheart This question will be in the interview?
 
who knows... trying to be prepared as much as i can
 
@Leoheart Sounds like you need to find another company.
 
@daknøk I have as well, three times
 
@Leoheart Any company that's more concerned over whether a person can solve a problem in their head that the compiler can solve in two seconds, rather than ensuring the person can design well and implement good concepts that maintain well, is a horrible workplace for a programmer wishing to advance their skills and career.
 
@Xaade I don't htink that's the purpose of the test:codinghorror.com/blog/2007/02/why-cant-programmers-program.html
 
5:22 PM
@MooingDuck I'm going to implement one, but I'm not sure if I got the overall design right.
 
You'll have nothing on your resume from a job like that. And the next time you look for a job, will have nothing to show for the five years you spent there. Leaving you at ground zero again.
 
@daknøk if it's simple, recursive descent
 
Recursive lexer?
 
@CatPlusPlus oh, did he say lexer? So he did
 
@daknøk String goes in, tokens go out. That's the overall design.
 
5:23 PM
@CatPlusPlus :)
 
@daknøk I've never yet made a lexer that made me happy. Got one I was kinda happy with for C (including preprocessor!)
 
I've got this right know but I'm not sure if the design will work well. It's probably horrible.
 
Any ideas for my windows GUI problem?
 
@MooingDuck Again, that's a stupid concept. If someone can't code it, they can't speak it. Really the only thing that example looked for is if someone has knowledge of the "mod" expression.
 
5:24 PM
@daknøk what's Cursor?
 
@Nils Qt? That's what people sometimes suggest for GUIs.
 
yeah well that would be quite a heavy lib
 
Someone without knowledge of mod, yet can write maintainable code, wouldn't get the job. Someone with knowledge of mod, yet can't write their way out of a hole, would get the job.
 
@MooingDuck a struct that has index, line and column so that the parser can give error messages that include line and column numbers. index is the location in the buffer ignoring newlines.
 
GUI is a heavy problem.
 
5:25 PM
Can I use MFC w/o that resource crap?
 
And Qt beats MFC.
 
How long does it take to learn about "mod". How long does it take to learn how to write maintainable code.
 
@daknøk you probably want to add Token peekToken();
 
It's called nextToken here, but peekToken seems to be better indeed.
 
@daknøk Also, I'm dubious/unsure about using `std::string to contain the entire file
 
5:27 PM
that's what I ended up with
 
The only possible drawback of that interface I can foresee is that you can't read the source lazily.
 
@Nils screen class { init() { new edit(); edit.setwindowpos(...); } }
 
@daknøk nono, you need both. next "pops", while peek returns the same token again and again until you call "next"
 
@MooingDuck You can implement either model on top of the other.
 
ah
 
5:29 PM
 
Well MFC should not be completely dead since there is also Ribbon, but I really don't have experience with windows programming.
 
Ell
hi guys
 
@Ell hi Ell
 
I just unicornified myself
 
What.
 
5:32 PM
Applied a (preferably blessed) unicorn horn to cure sickness?
 
Just waiting for my Gravatar to update on here
 
@MooingDuck My favorite question is, "Describe the worst mistake you ever made." It's impossible to totally fail and mess everything up if you never work on anything important.
 
@Xaade "I thought I made a mistake once, but it turned out to be right."
 
What's a mistake?
 
5:37 PM
heh doesn't seem to have gui in it
 
what the? stackoverflow.com/questions/9365692/… was tagged Java despite having no mention of Java or Java code or anything to do with Java. :/
 
Ell
if I had a map that when accessing an element doesnt create a new one, what kind of exception should I throw? Is std::range_error appropriate?
 
@MooingDuck Because they use Turbo C++. Duh.
 
Ell
@MooingDuck howcome you can't overload by return type? That would seem useful to me
 
@Ell what R.Martinho says
 
5:39 PM
Because.
 
@Ell It would be nice, but it doesn't play nice with other things in the language.
 
key_error.
 
@MooingDuck Wtf. I suddenly feel sorry for recruiters.
 
@Ell I think it's because it's nigh impossible to implement compiler to work in that way. (Maybe: speculation)
 
Just Haskell.
 
5:40 PM
But there is one place in the language where you can overload on return type.
 
@RMartinhoFernandes oh? SFINAE?
 
Well, kind of.
 
So, in your experiences, does having a portfolio of previous programs you've written help to get you a job?
 
@KianMayne Yes
 
Because I get told by people to keep a record of the stuff I've built
 
5:41 PM
@KianMayne Yes.
 
Which I do
 
@KianMayne that's how I got my job
 
Ahh right (: Good, I'm not doing it for nothing then
 
@Ell it's usually not needed, and there are ways to work around it
 
@MooingDuck class proxy { operator int() const; operator double() const; }; int foo_int(); double foo_double(); proxy foo(); int x = foo(); /* calls overload that returns ints */. Implementations are left as an exercise for the reader.
 
5:42 PM
Also, polymorphic constants are cool.
 
@RMartinhoFernandes yeah, that's the workaround. I sorta question what foo_int and foo_double are for. Does that really need name conversions?
 
@MooingDuck Those are the actual overloads.
Though they could just be the proxy operators.
Silly me.
 
@RMartinhoFernandes I missed the }; at the end o fthe class
But then as you move down that path eventually you run into boost::Variant
 
Also, there's a site, Code Academy, that teaches people Javascript, would I get bonus points for contributing a course to that?
 
@MooingDuck Not quite as pretty on the call site.
WOOOT! New DF is out!
 
5:51 PM
@RMartinhoFernandes no, but a lot less errors and problems
It's kinda weird that when I google "Dwarf Fortress" this always comes up:
 
@MooingDuck Sure. That thing with the conversions is called a hack for a reason :)
 
In the year 252525...
 
@MooingDuck That's from some third-party tool that renders stuff from the game.
 
...Dwarf Fortress still not beta.
 
5:52 PM
@RMartinhoFernandes I don't they ever got it to work
 
Stonesense works, but mostly for visualisation, not interaction.
It pokes around in the game memory.
Like a drunk unlicensed surgeon.
 
Someone wrote a library with the sole purpose of messing around in DF's memory.
 
Ell
I don't understand the mindset of unit tests
how do you know if the unit tests work? unit test them?
 
@Ell In the extreme, yes :P
 
@Ell yes, there is that problem. But consider the alternatives: no or manual tests
 
Ell
6:00 PM
oh gee :S
 
You make the unit tests small and simple.
 
Ell
is c++ usually unit tested? For some reason i have a preconception that only dynamic languages are
 
Complex tests are prone to errors, so you avoid them.
 
@Ell on the other hand, test code is rarely production code. This means that you will very often write test code that sucks and is full of bugs but just works for what you want to test, which is fine in most testing environments
 
@Ell for quality products yes
 
Ell
6:01 PM
and I just don't understand how they work - surely you are just duplicating code you have written - in reverse - and so are equally prone to bugs?
 
@MooingDuck There are actually some layers in between where you can do automation. I do that as a full-time job :(
 
@Ell Just to be sure, I'm going to double-check the definition of a unit test
 
Got the lexer to work!
 
@Ell sure. But if they agree, that's a really good sign that they're both right. If there's a 5% chance of an error in your code, and a 5% chance of an error in the test, and they agree, then the odds both are right is 99.75%
 
@Ell They're much simpler than the tested code. So you can easily spot a mistake in a failing unit test.
But if unit test is good, and it's still failing, then the code is borked.
 
user406009
6:02 PM
But how would you unit test highly linked code in C++?
 
@Ell It's client code.
 
user406009
Mocks only work on abstract classes, so you can't really use mocks as much.
 
@EthanSteinberg don't write highly coupled code
 
So you can validate externally visible behaviour.
 
Ell
I have never written any kind of test - I've been meaning to start but it looks so boring :O
 
6:03 PM
@Ell agreed :/
 
Oh, it is.
But it's also necessary if you don't want bugs to overrun you.
 
Ell
Is it really necessary? Can't I just fix bugs when I find them?
 
@Ell what if a later change reintroduces the bug and you forget to check for them?
 
user406009
Yeah, but how would you mock stuff in C++. I have looked at google mocks, but they require virtual functions and inheritence, practically requiring you to use dynamic memory.
 
You can but a) you have to find them b) you have no guarantee of not reintroducing them.
Unit tests secure you from regressions.
 
6:05 PM
automated tests (be it unit tests or higher level) are perfect for regression, so they catch regressing (reocurring) bugs
 
Or at least inform you about them.
 
Ell
I think this is one of those things where I have to learn from my mistake of not using unit tests :D
I will just not use unit tests until I find I get overrun with bugs and then after that, i will get enough enthusiasm to write them :P
 
Next to that, writing testing code for an application makes you write code as your client (your api user) would need it. You'd be surprised how many bugs/shortcomings you find you didn't think of before testing
 
@Ell or quit
 
Ell
6:07 PM
:S
 
@Ell No, first you'll have to scrap the entire codebase.
 
Scrapping whole codebases is fun.
 
Ell
I scrap ever single codebase I start. I'm not kidding. I can't programme. Yet :D
 
If you don't have to still have them afterwards.
 
Anyone want to do a DF succession game?
 
6:08 PM
I suck too much.
 
@CatPlusPlus And that's bad?
 
@Ell really don't underestimate testing, quality can make all the difference between being a dead product in a year or being market lead in a few years
 
Losing is fun!
 
It's DF. Part of the fun comes from things going terribly, terribly wrong.
@Pubby Sure. You can count me in.
 
@Pubby ever since they revamped the military, I haven't been able to figure it out :/
 
6:10 PM
You mean, since two years ago?
 
Also, UI makes me stay away lately.
 
That long ago? Wow. I haven't really played since 2008
 
@RMartinhoFernandes about that yeah. I keep downloading the new versions though for some reason
 
I didn't play before, so I don't know how the military worked before.
 
@CatPlusPlus yeah, the UI is a big obstacle. The game would be like minecraft if more people could figure out how to play
@RMartinhoFernandes you assigned units to squads and had a key to select a squad and could order them to move here, patrol there, kill that.
 
6:12 PM
@MooingDuck You will play?
 
@MooingDuck That's how it works now.
 
Then he added schedules and I couldn't figure out how to make them train
@RMartinhoFernandes no I mean, select a dwarf, select add to squad, select a squad: he's now military. When doing stuff, press m(?), select a squad, select a place on the map, and they go there/kill that.
it was really simple to use
 
Military system before 2010 was muuuuuuuuuuuuuuch simpler.
Also the new one didn't work for like a year after release.
 
@MooingDuck That part still works like that.
 
@RMartinhoFernandes also, squads without commands would just train. With the new system, I gave up when I couldn't figure out how to make squads train, or kill specific enemies, or virtually anything at all.
 
6:14 PM
Woo! My gravatar has updated!
 
I just realised I've never played with invasions enabled.
 
@KianMayne nice!
 
@CatPlusPlus That's no fun! How do you collect goblins for your dungeons without invasions?
 
@daknøk Why aren't you generating the lexer?
 
@CatPlusPlus because I want a decent lexer.
And generating lexers isn't fun.
 
6:16 PM
lol
 
Writing it by hand kinda tells otherwise.
 
Decent lexer = generated lexer
 
Also, use Haskell, it's great for compilers.
Parsec FTW.
2
 
Dec 3 '11 at 7:18, by R. Martinho Fernandes
Parsec is awesome.
 
Ell
can this lex string tokens? o.O
 
6:18 PM
<3 parsec
 
@Ell string tokens?
 
@daknøk char* t = "char* t = \"\";";
 
Ell
sorry I'm a noob at this stuff, as in a string in ""s
 
not yet
 
room topic changed to Lounge<C++>: We love Parsec. [c++] [c++11] [c++-faq]
@Ell String literals, we call 'em.
 
Ell
6:20 PM
@CatPlusPlus of course >.< silly me :P
 
en.wikipedia.org/wiki/Parsec_(disambiguation) Parsec (parser), a Parser combinator for Haskell (has no page)
 
@MooingDuck That's because it's too awesome to be on Wikipedia.
 
Wikipedia sucks. See "Write yourself a Scheme" or something.
 
It's also too awesome to have up-to-date docs x_x
 
"Why is my programming crashing?" I like that title
 
6:22 PM
@Pubby Yeah, that sucks. I had to piece information together from a collection of good, but outdated docs and poor, but up-to-date docs.
 
Write new docs!
 
Writing docs is no fun!
 
Too busy basking in Parsec's awesomeness.
3
 
Ell
The TileWidthInPixels and TileHeightInPixels are both unsigned int because that is what the underlying library use for images, should I use int (because I dont need to use unsigned) or unsigned int (for consistency) for TileCount?
 
What's negative width?
Width in the other direction?
 
Ell
6:25 PM
you can't have that, the width is the width as in number of pixels in the image
 
Not that this makes any sense.
 
Ell
the underlying library doesn't support negative widths
 
Always use unsigned over int for width.
 
@Pubby So, are you doing the embark?
 
Because there is no such thing as negative width.
 
user406009
6:25 PM
Ell, what if there is a pictures with a width of 2**32-1?
 
user406009
Then regular ints would fail.
 
So, don't use a signed type.
 
Ell
well - SFML's sd::Image returns an unsigned type
I thought using unsigned stuff was... not good :P
 
@EthanSteinberg What if there is one with a width of 2^64 - 1?
 
Ell
6:26 PM
dont know why I thought that, I just thought it was frowned upon or something :P
 
@RMartinhoFernandes Well I'm generating a world right now, although it's more for testing than actual playing. If you want to embark then go ahead.
 
Ell
So I guess using unsigned isn't... frowned upon? :L
 
Some people are afraid of unsigned stuff because looping backwards over them something. Or something else.
 
Implemented string literals, complete with escaping. (:
 
Ell
I don't even know where I get these ideas from :l
 
6:30 PM
@RMartinhoFernandes Hi!
 
We had one of those discussions yesterday regarding what to name some things. I was wondering what's your take on it.
 
Missed that, can you link?
 
What do you call a utility that takes a tuple, a functor, and returns a tuple of the functor applied to the different elements of the tuple?
 
As in misteryFunc f (x, y) = (f x, f y)?
 
6:34 PM
Yep, although I really meant std::tuple here.
 
user406009
Shoot, that had a fancy name, but I forgot it.
 
user406009
Something like Reduce, but different.
 
misteryFunc f g (x, y) = (f x, g y), is a product.
 
user406009
It was transform.
 
@LucDanton A mapping operation?
 
user406009
 
@KillianDS That was my original intent, yes.
 
I don't like map (or alternatives) because it's not really the same function being applied here, right?
 
@RMartinhoFernandes yes I understand but "less accessible" in what sense? , due to private inheritance ?
 
I'd probably go with apply, like with a boost::static_visitor (which is the same but for coproducts).
 
@RMartinhoFernandes I like like transform, which draws a parallel to std::transform
 
6:38 PM
@RMartinhoFernandes Discussion started here.
@RMartinhoFernandes Well, it's a polymorphic functor. It can still have state that can be accessed by each application, even if the element types are different.
Although the discussion starts with what to call the operation that applies a functor to the active element of a variant.
 
@MrAnubis Yes. The injected name is accessed across private inheritance, while the name in the global scope is accessed directly.
 
@RMartinhoFernandes aah , now got it , Thanks :)
 
Ell
ugh -.- why doesn't SFML have z-ordering? I might have to switch to gosu :O
 
@LucDanton Well, count me in with @Xeo as another vote for apply.
 
There's no z-ordering when there's no z.
SFML is designed for 2D.
 
6:44 PM
@MooingDuck Yeah, "transform" seems to be the C++ synonym for "map".
 
@CatPlusPlus It actually has some OpenGL functionality in it's graphics library (in sfml 2 at least)
 
@RMartinhoFernandes map is mapping an object to another object. transform applies a function to all data in a container.
 
@RMartinhoFernandes I've embarked, so I guess we'll use this game?
 
You can always access GL, that's not the point.
If you use orthogonal projection in GL there's no z, either.
 
@MooingDuck map (Haskell), transform (C++), select (C#, SQL), are the same operation (which is similar but not quite the operation described here).
 
6:46 PM
Well, I never managed to get it work. But still.
 
@MooingDuck He means map from the functional world. Just like C++ uses accumulate for functional folds.
 
@RMartinhoFernandes yes, I was referring to C++ terminology,
 
Oh yeah I also have that tuples::zip_with
 
@CatPlusPlus Well you can use 3d Orthogonal projection for that, but indeed, if you simply use the 2D functions you don't have it :)
I don't know the exact semantics, I do know the author refused a patch of me that proposed to allow creation of a forward-compatible context because it could break the internal usage of OpenGL by SFML (which made no sense at all to me)
 
They probably use silly deprecated stuff.
That's why most libraries that wrap around OpenGL are crap.
 
6:50 PM
indeed they are :)
 
@RMartinhoFernandes I had the chat swallows one of my messages but you meant for the variant visitation right?
 
Well, I'd use it for tuples as well.
 
Ell
why is there no Z in 2d?
 
I find it intuitive because the two operations are the dual of each other: one for products (aka tuples), another for coproducts (aka variants).
 
Ell
what about one sprite appearing infront of another?
 
6:52 PM
Showcase time! If you have any fun projects, list them on teh wiki!
17
@Ell Reread this question aloud.
 
@RMartinhoFernandes I guess that's a neat argument.
 
@Ell that's usually solved (actually even in 3D) by rendering in the right order :P
 
Ell
okay x & y are the 2 dimensions
 
"Why is there no third dimension in two dimensions."
 
Although what did you expect the return type of visiting a variant to be?
 
Ell
6:54 PM
@CatPlusPlus oops :P
 
You can do "logical z", and just draw the sprites in the right order.
 
rebooting
 
The top one will be drawn last.
 
@LucDanton Depends. If all the functions return the same type, it would be neat to have that be the result. Otherwise, a variant.
 
You can do common(apply(functor, variant)) to reduce that to the std::common_type.
 
Ell
6:56 PM
@CatPlusPlus thats what I will have to do, its just annoying :L
 
@LucDanton Sounds good.
 
Well, then go 3D.
But it won't be easier.
 
15 hours ago, by Luc Danton
@Xeo Can't find what is usually used with Either in Haskell.
In Haskell you would use (+++) from Control.Arrow (also note (|||), aka either, below, which is the common return type case).
 
Although I could special-case something like apply<request_for_common_type>(functor, variant) just like I special-cased apply<void>.
 
either f g e
 
6:57 PM
@RMartinhoFernandes I don't think I ever saw that before, so I'm not sure what I was thinking of.
 
@CatPlusPlus That's for the common return type case.
 
Yeah.
 
But yeah I probably was thinking of either to begin with.
 
Arrows are still way over my head.
 
I once again find myself in this part of stack overflow :)
 
6:59 PM
My teacher called (+++) a sum. I think that's a bad name for the C++ equivalent though.
 
I guess one of the neat thing about apply is that at least there's no question when it comes to the order of the parameters.
 

« first day (492 days earlier)      last day (4439 days later) »