« first day (743 days earlier)      last day (4222 days later) » 

7:04 AM
@Rapptz like MFC or QT?
 
No. Fuck Qt and MFC.
 
@Rapptz it seems that you don't like MFC or QT.
 
I don't. I used Qt once and I hated it.
MFC is even worse.
 
I have just started with Qt, and I am loving it.
 
I was just thinking of a neat one, something like..
 
7:06 AM
@Rapptz then, how about BCG?
 
GTK is my favorite from a users perspective
 
wxWidgets anyone?
 
    sd::button button;
    button.setPosition(40,40);
    if(button.isPressed()) {
        // do stuff
    }
something dumb like that, it probably exists everywhere but for now I can dream about it.
 
user142019
@Rapptz Polling? Or does button.isPressed() block?
 
user142019
I’d go for a callback.
 
7:08 AM
@Rapptz great
 
user142019
button.onPress = [] { /* do stuff */ };
 
Event based. So yeah polling.
 
user142019
ugh
 
@Rapptz when will you start to develop it?
 
Never because I suck at OOP.
 
7:09 AM
put the source on SourceForge or GoogleCode?
 
@Zoidberg'-- I like your idea though. Either one seems less painful than what I've dealt with.
 
user142019
I wouldn’t focus too much on OOP.
 
It should probably use callbacks instead of isPressed
 
Well the way I conceptualized it was that every object inherited from a template that handled how it looked.
 
user142019
2 mins ago, by Zoidberg'--
button.onPress = [] { /* do stuff */ };
 
7:11 AM
I should probably read
1
Q: Game architecture and design

Hans WassinkOver years of non-game programming I learned a lot about neat programming. MVC, OOP etc... And now im very dedicated to making my code clean, reusable etc... But now Im facing a new challenge: game programming. Suddenly Everything feels dirty again. Dozens of different timers, redrawing everyth...

 
There were other things that bugged me too like how I was going to.. actually do it visually. Would I rely on an API like SDL or SFML?
 
user142019
sd::window window;
window.title = "Hello, world!";
sd::button button;
button.label = "Click me!";
button.onClick = [&] {
    button.label = "Clicked!";
};
window.addSubview(button);
button.setRect(window.rect);
 
sd was a fake namespace because I'm used to std lol and sf from SFML.
@Pubby How strangely relevant.
But why the fuck is it tagged with PHP?
 
Now it's not
 
Should probably be noted that Game Development sucks.
 
user142019
7:15 AM
Man.
 
user142019
I love partial application and function composition.
 
I read that as partial fractions.
 
Holy shit assignment and properties, go back to Python. Use braced lists with named parameters if you have to.
 
user142019
How are you going to update the button without a setter?
 
user142019
Well you cannot since you need to call an API for that.
 
user142019
7:17 AM
So you need a setter.
 
user142019
And setting the window title also needs a setter, by the way.
 
See? That worked itself out.
 
I'm confused, was that directed towards my idea?
Because I'm not sure of how to do it any other way in my mind o.o
 
user142019
But for a GUI library, yeah. Python is much better anyway.
 
I find that C++ really doesn't lend itself to public members unless there's a very, very real lack of invariants. std::pair<T, U> with its first and second members are a good example.
 
7:20 AM
My idea involved getters and setters.
12 mins ago, by Rapptz
    sd::button button;
    button.setPosition(40,40);
    if(button.isPressed()) {
        // do stuff
    }
It was silly anyway.
 
I recommend a good constructor, keeping in mind that you can reassign.
 
Make it possible to be able to express the layout using operators
 
user142019
T_T
 
auto b = button { "Hello" }; b = { "World" };.
 
----=x
|____|
 
7:21 AM
Yeah obviously you could have other constructors.
lol
I don't like the inverted x,y axis people do. I don't wanna rebel against it though because it seems standard.
 
user142019
The only decent GUI library I’ve ever seen was Cocoa.
 
I always considered the origin to be bottom left, not top left.
 
user142019
It’s logical and simple.
 
user142019
And it works well.
 
user142019
I prefer origin bottom left because that’s what also happens in typical coordinate systems.
 
user142019
7:23 AM
When you draw a graph, origin is usually bottom left.
 
user142019
Positive is upwards.
 
Yeah, the Cartesian Coordinate System is the one usually taught. It's why I think it's weird that it's inverted. Though technically it still lies on that coordinate plane, it's just that the Y values are absolute valued and the other quadrants are ignored.
 
user142019
MacRuby was always awesome for doing GUIs. Problem is that it is implemented using the Objective-C garbage collector, which is deprecated. :<
 
I suspect that the indexing from top left is partly technological inertia at work.
 
0
Q: wpf coordinate system

carlosI am starting to work with images in WPF and I am using the next pice of code ... ...

Apparently this answer says it's because of the way we read from the top left, though that isn't even true for all languages.
 
user142019
7:30 AM
Cocoa does bottom up.
 
DirectX does top left, OGL does bottom
 
user142019
Unless you implement -[NSView isFlipped] and return YES from it.
 
user142019
Then it’s top down.
 
@Pubby OpenGL?
 
user142019
OpenGL does bottom up by default.
 
7:31 AM
OGL = opengl
 
user142019
But yeah, just change the matrix and it goes top down.
 
Really? TIL.
 
@Zoidberg'-- IIRC stuff like texture coords use it upsidedown too though
 
user142019
Oh yeah.
 
and by upsidedown I mean bottom-left origin
top-left is clearly superior
 
user142019
7:33 AM
Nope. It isn’t.
 
user142019
bottom-left FTW
 
bottom-left is for plotting graphs
 
It's how I learned math. It's kind of annoying to switch my coordinate thinking. Especially after taking so many classes in 2D and 3D space.
 
user142019
And for like anything involving the Cartesian coordinate system.
 
user142019
I once made a Twitter client using MacRuby and Cocoa.
 
user142019
7:35 AM
Also had to do some custom drawing.
 
TV CRT displays are, (were), scanned/displayed from the top/left. Exercises (a) - design a terminal display, using minimal numbers of logic gates and RAM chips or minimum size, to display an 80*24 array of chars. (b) Expand on (a) to allow pixel graphics.
 
@MartinJames Yeah, I read that as an answer.
 
@LucDanton That's actually true for most languages. Public fields give no invariants. What's stupid is when you slap a pair of functions around those and add no invariant.
 
@R.MartinhoFernandes Yes, a pair isn't too great. I find the hate towards just one misplaced however.
 
@LucDanton Oh, I would agree with you.
 
7:40 AM
I'm not surprised.
The context of my previous remark had future extension and maintainability in mind though. If you need to do some processing/computing before e.g. actually changing the internal state, you are hosed in C++ with a public member. Not necessarily so in other languages.
 
@LucDanton The problem is that there aren't many things you can do that don't change preconditions.
When I change preconditions on a function, I want the code to break.
 
Caching, logging, enforcing an as of yet unchecked precondition, compressing/decompressing (i.e. encoding/decoding when the stored value is in a different form than that of the interface) to name a few.
That last one is pretty important I would think. I'd rather deal with an interface that presents booleans than manipulate flags myself.
 
Yes, but... why was the interface providing flags from the start?
 
No that's the alternative with public members.
 
Yes, but what I'm saying is that that is not an example of evolution.
That's an example of needing accessors from the start.
 
7:47 AM
Can't someone be curious without it being a homework problem? Asking a question like this on SO many times allows people to get a baseline understanding of what something is quickly, to enable them to understand if they want to / need delve into it further. Other resources often provide a very lengthy explanation which can be confusing to understand (a book which discusses this in chapter 9 may assume you have read chapters 1 - 8 first). — BSchlinker Jul 20 at 20:11
 
Well maybe you start with just one boolean.
 
@LucDanton Hmm. Maybe. I still don't think it's worth writing two extra functions (one of them potentially templated for perfect forwarding) for every public member variable just in case I need to change it in the future.
 
Well, don't?
 
We've discussed public vs private in this chat at least 5 times since I've joined. lol
 
Actually, considering how often I use public member variables, that actually would not be much trouble. hehe
 
7:53 AM
I commented against public data members.
 
@LucDanton Then, what's your point?
 
@R.MartinhoFernandes I recommend against public data members.
 
> error: command line option '-fvisibility-inlines-hidden' is valid for C++/ObjC++ but not for C [-Werror]
Is that a difference due to C99 inline?
 
Uh oh. No idea.
@Rapptz And you're new-ish.
The protagonist not only ends up living in a mountain village in the Alps, but also discovers traits
Sounds like a story about a C++ programmer.
 
7:57 AM
Kinda. 4 months-ish. I have 5k messages here, cool. Ooh.. 5252. Don't wanna mess that up. Yes.
 
lol
 
@Rapptz After two minutes you'll be silent forever! Mwhahahaha.
I like how none of the three answers on my question has a single upvote.
 
RIP 5252.
 
Chat is getting close to 6M messages.
 
We had 1M a couple months ago.. Oh, total chat.
It'll probably pass by the time I go to sleep.
 
8:01 AM
What's with topic? Did Tony put that up?
 
Xeo did.
 
Foreveralonia is the 51st state of USA
which reminds me, is there a term for people from USA that isn't "american"?
 
immigrants
 
@R.MartinhoFernandes Oh, is that what that means?
sbi says it often but I always thought he was talking about these:
 
8:05 AM
(I'm probably the person here that is most vocal against the use of the "American" or "American" words to mean "USAian" or "USA")
 
 
@Pubby No, he was not.
lol
 
I am having a hard time identifying the gender.
 
I'd say he is as well.
 
8:06 AM
Gut says female, but I've seen some weird shit
 
Different languages use different terms for citizens of the United States, who are known in English as Americans. All forms of English refer to these people as "Americans", derived from "The United States of America", but there is some linguistic ambiguity over this due to the other senses of the word American, which can also refer to people from the Americas in general. Other languages, including French, Japanese, Chinese, and Russian, use cognates of "American" to refer to people from the United States, but others, like Spanish and Italian, primarily use terms derived from "United States"...
 
@Rapptz No grammatical gender, a merkin is an 'it'.
 
Those hips are clearly male
Except that bulge (or lack of it) seems kind of small
 
Yeah that's why I'm so conflicted
What about the lack of.. hair
 
Well if you are the type of guy who wears merkins then I wouldn't be surprised if you shaved.
 
8:08 AM
So.. is the way to write callback functions in C++11 using std::function?
 
@Pubby Colonials
 
IIRC callbacks are nicer with std::function
 
@Rapptz It's one tool that is available, but it deals with a very specific problem.
 
@MartinJames I guess that works better from the UK.
(From this here POV, "colonials" evokes images of Africa)
 
8:09 AM
I like "yankee"
 
I think that's what Chavez uses too.
 
@LucDanton Well, I meant as a member function such as daknok pointed out earlier with a button click event.
 
If your design involves "I need to store some functors, and add and/or remove some of them depending on runtime conditions" then in all likeliness std::function would help.
@Rapptz If you just need to store the callback but not remove/replace it you don't necessarily need std::function -- however that would turn the button into a class template.
auto b = make_button(label = "whatever", on_event = [](foo, bar, baz) { /* callback stuff */ }); /* no std::function required */
 
"look ma, no std::function!" sounds better.
 
Damn it's hard to make something look pretty in C++. Might as well give up.
 
8:15 AM
lol
@Rapptz Just change your definition of pretty. It's easier.
 
I could go back to the old approach of if(button.isPressed())
I like Lua's approach to callbacks at least =/
button.onClick =
function(object)
    button.label = "Clicked!"
end
 
Doing that in a constructor call/factory call too hard for you? :p
 
fancy, gcc 4.8 will have -std=c++1y
 
2 hours ago, by Rapptz
I'm not good at templates or OOP. I guess that translates as horrible in here.
The fuck is C++1y?
 
++(C++0x)
2
Seriously.
 
8:23 AM
I don't think that compiles
 
@Rapptz Well, you can put a lot of std::decay and copy stuff around to make lifetime considerations simpler. Then it's a very data-directed/procedural approach.
 
I'd rather just learn more about C++11 but resources seem a bit limited.
 
E.g. "a button is a callback and a label" -> template<typename Callback> struct button { std::string label; Callback onClick; }; template<typename Callback> button<Decay<Callback>> make_button(std::string label, Callback callback) { return { std::move(label), std::move(callback) }; }
You can dispense with the std::move if you find it confusing.
 
A button is not a callback and a label! What about buttons that are pictures?
 
A label is a picture
 
8:26 AM
Different class?
 
Don't mind me.
 
I am going to mind you
 
@Pubby Not as a std::string, though :P
 
std::string will store bgr bytes
 
8:27 AM
(bgr to make it more confusing)
 
_/\(0_°)/\_ , I dunno lol
@Pubby Interlaced!
 
Would making an imageButton be idiotic then
 
Anyway, carry on with the explanation. That was just my PTSD kicking in.
 
I'm not even sure if that's more confusing.
 
@Rapptz If you really want to ask that... Well, I think so. A button is a thing where the user can click/press Enter or Space when focused and something happens.
 
8:30 AM
buttons inherit Clickable which inherits Doable
 
Welp.
 
There are a lot of things I was thinking about when hypothetically making this in my head, like skins and customizations.
Seemed like a neat idea, tbh. Though I wasn't sure how to pan out the inheritance.
 
When I think of skins I think of this:
 
Random C++ library titbit of the day: std::thread::join doesn't synchronize, so the following contains a data race: int i; std::thread { [&i] { i = 42; } }.join(); std::cout << i;
 
8:36 AM
By skin I meant changing how it looks aesthetically, like when you click, the colour of the border etc.
 
@LucDanton Oh ffs.
Really?
WTF.
 
> titbit
2
 
Is that a defect?
 
lol
 
Well, that was the case when I read the specs a long, long time ago. Never brought it up.
 
8:37 AM
That has to be a defect.
 
(*) = true
 * = false
 
@R.MartinhoFernandes I hold it as an example that std::async really is the abstraction that should be preferred.
 
> Synchronization: The completion of the thread represented by *this synchronizes with (1.10) the corresponding successful join() return.
@LucDanton Mwahaha, you're outdated.
 
I'mma take a look at the defect list.
 
I was expecting boobs. OP did not deliver.
Oh, wait, this is not reddit.
 
@Pubby lmao that is an amazing definition.
 
That's a titbit.
 
WTF is that
 
Is that a close-up shot of a nipple?
 
it reminds me of fruit
 
8:43 AM
Downloading a defect list takes so much time.
 
What kind of fruits do you eat that look like nipples?
 
Raspberries?
 
:This article is about the plant Solanum mammosum, described by Carl Linnaeus. For other Solanum described under this name, see below. :"Cow's Udder" and variants redirect here. You may be looking for information found in Cow and Udder. Solanum mammosum is commonly known as Nipplefruit, Titty Fruit, Cow's Udder, or, ambiguously, "Apple of Sodom". It is an annual or tender perennial plant in the Solanaceae family, part of the Solanum or nightshade genus, and a relative of the tomato and potato. This poisonous fruit is native to South America, but has been naturalized in the Greater Antille...
titty fruit
 
While grepping for that picture in the chat transcript, I also found this:
Jul 4 at 18:21, by R. Martinho Fernandes
@Cicada Use the nipples.
 
AZERTY?
 
8:45 AM
@LucDanton where can I find it?
 
@bamboon Start here, pick latest mailing, find 'List'.
 
    |' .-'-/  \_./   .'    .--.   `\  \`-.            \
   .\''_/./ `-     -'    ,' _.      \ \\  `-           :
   /_.-./ //  `-. -'    ' .'o-'     || \|   |          \
   `--/ // \-../ /' _-.   `'         \| | \ |           \
    :|  \`\  /_ | ,'o;`               | | \\\            \
     /`\.  `\  `|\`-'  '  `)          \||  \ |            :
     \_\=`\- `\ \\\    `--'          . ||  | |            \
     \ ----``;.`\ \`.     .----.    .  /|\ / |             :
      `| | | || |||  .   /.-''/    .   ||\\ / \            :
^ that is a shot from dwarf fortress and not ascii pornography
 
Man, NSFW!
 
Also I couldn't find any defect, so it might be the case that I imagined the whole thing. I'm fairly sure this was a big motivation in my finding/writing a CSP-style queue.
 
@LucDanton lol
@LucDanton Rest assured I know the feeling.
 
8:48 AM
@LucDanton are you sure that is the right link?
 
I always copy but fail to paste.
 
@LucDanton lol, you messed up the link.
 
Next mailing in a few days! Well, reception of the papers end in a few days, publication comes later as usual.
 
I wonder if MS will have great C++11 support when C++14 comes out.
 
I thought it was C++1y
 
8:50 AM
<filesystem> support already started. Where's your god sarcasm now?
 
@Rapptz Current plan is: small update, mostly annoyance-busting and bug-fixing in C++14, then big update with one major feature in C++17.
@LucDanton What sarcasm? I was truly wondering.
 
Last plan didn't work out so well.. Finishing C++11 during 0x..
 
Well, yeah.
 
What's the newer version of TRs that is supposed to help now?
 
@Rapptz But given how non-ambitious C++14 is, I don't have much doubt it can be done.
@LucDanton TS. Technical Specifications.
 
8:54 AM
google code is so lame
 
Thanks. Is releasing things that won't make it to C++14 in time as TS's before C++17 part of the plan as well? Or keep small language changes for the Standard, put library things into TS's
 
I want better strings.
 
@LucDanton I think most libraries are going into TS's.
 
I hope the TS are really ambitious and experimental
 
"Better strings" is not an accurate description, unfortunately.
 
8:55 AM
I know. It's supposed to let the imagination flow
 
I want proof-of-Concepts before C++17.
 
I know you want better unicode.
 
To be honest, all I want from standard C++ is char8_t. I don't think it will happen. (Oh, and possibly a replacement c32rtomb and friends if it is not what I want it to be)
The rest can come from Boost.
 
We can defer all the big language changes for C++17 and be disappointed then when it comes out late and under-specified.
 
I want C++11 support in Boost
 
8:58 AM
@LucDanton I want modules && concepts for C++17, i.e., modules first.
 
Maybe by the time C++17 comes out, Python would have already ruled the world.
 
@Pubby Yeah, lazy fuckers.
 
@R.MartinhoFernandes Yes, those are perfect for being late and badly specified!
 
Modules seemed like an interesting idea. I didn't read up on concepts much aside from the vague "better errors"
 
For me the big thing about concepts is less SFINAE.
 
9:00 AM
Well if you use std::function you might end up longing for them. (Kidding -- implementations are already taking care of std::function.)
 
I want no SFINAE tricks
 
Curiously recurring template complaint.
 
Oh, it's a joke.
 
"Less SFINAE"!
 
@Pubby Ideally concepts would reduce usage of those to zero, or close to zero.
 
9:03 AM
It replaces them with concept tricks
 
I wouldn't call them tricks.
 
I put up with SFINAE because I have fun writing self-documenting EnableIf<is_callable<Foo, Sig>>... 'clauses'.
 
You have fun with that? Hmm.
Did you pick the right words?
 
I want new type scoping operator so I don't have to write typename and template so damn much
 
9:05 AM
aliases are for jerks
 
template <typename T>
using Invoke = typename T::type;
 
template<
    typename Functor
    , typename Tuple
    , int... Indices
    , Requires<
        concepts::Callable<Functor, void(TupleElement<Indices, Tuple>...)>
    > = _
>
ResultOf<
    Functor(TupleElement<Indices, Tuple>...)
>
uncurry(Functor&& functor, Tuple&& tuple, indices<Indices...>);
Look at that glorious signature, it leaves so little to the imagination.
Oh shit, that's an implementation detail.
 
uncurry?
Does that make it less spicy?
 
uncurry is another name for anticurry
 
9:06 AM
Yeah, great example, the 'primary' template has a signature that simply delegates to the implementation detail.
 
when anticurry and curry combine they explode or something
I saw it on rice trek
 
Mmh, I don't have much of a choice with tuples. Need to express things with indices.
 
D has a tuple-based for loop.
It's awesome.
 
Okay, the variant signatures are horrible and full of implementation detail.
 
@LucDanton Is that a theme :P?
 
9:08 AM
template<
    typename Functor
    , typename Option
    , typename R = ResultOf<Functor(ValueType<Option>)>
    , typename Result = optional<R>
    , Requires<
        concepts::Callable<Functor, void(ValueType<Option>)>
    > = _
    , EnableIf<
        is_optional<Bare<Option>>
    > = _
>
Result
apply(Functor&& functor, Option&& option);
Isn't that glorious?
Third time's the charm.
Ignore the > = _, it's GCC being dumb. It's supposed to be >....
Anyway, I like self-documenting code. Isn't it obvious what the function does from the signature alone? Parametricism and all that.
(Which is a good thing because the name of the function isn't as self-documenting.)
lol, the definition could fit on two lines easily.
 
GCC changes 3 periods into an underscore? That sounds annoying.
 
lol
 
It's not "3 periods", it's "dah dah dah".
 
I'd like to use >... but sometimes GCC explodes. So I use > = _ when it does.
 
dot dot dot? You pronounce the t as silent? Or is it because it's done in a fast fluid repetition.
 
9:18 AM
@Rapptz Not me, Alexandrescu.
Ok, now all I need for NFD is to sort by ccc. Somewhere within the iterator. Holy titty fruits, this is going to be nasty.
I feel bad for having to keep vectors within iterators.
 
Whoah
 
@LucDanton There's no limit to the amount of combining marks you can have on a base character.
 
std::vector<char32_t> he_comes;?
 
Yeah.
In the future I could possibly try some SSO and tune for some common size.
Because heap allocation on iterators is really nasty.
 
variant<std::array<char32_t, magic_number>, std::vector<char32_t>> he_strolls_around;!
 
9:28 AM
Yeah, sounds good.
But first, I need to actually get it working, which by itself will be nasty already.
Either I'm missing something, or my decomposing end iterators have UB.
Fuck.
The worst part is tests are passing.
 
I had an issue with variant that manifested itself in just one circumstance. Worst part is I don't remember what was the issue.
I used to worry a lot about silent UB when starting on C and C++, but that went away after some time. It's still somewhat of a haunting fear.
 
Ha, now that I think I fixed the UB, tests fail. Needs more investigation.
 
9:43 AM
@LucDanton A looming "you'll never know" feeling, right?
@Rapptz Oh yeah, good old hack.
 
Yes, and no. Yes, because the house of cards could fall down at any point. No, because I'm fairly sure any program exhibits UB due to the way the Standard is specified. It's schizophrenic!
 
Argh, it seems I can never properly define equality for complex iterators at first try. Now this thing is decomposing things into infinite ranges (because equality is fucked up).
 
> Otherwise, you can't, since most doubles/floats can't be exactly represented and are approximated.
?!
 
Where's that from?
I.e., what can't you do otherwise?
 
0
A: How to read the entire value of a double using cin?

Luchian GrigoreIf I/O is your only concern, use a std::string: string m; cout << "enter double: "; cin >> m; cout << "m = " << m <<endl; Otherwise, you can't, since most doubles/floats can't be exactly represented and are approximated.

Someone needs coffee.
 
9:48 AM
Yup.
 
lol I just imagined Luchian having a hangover for some reason
 
What reason other than drinking too much would he have for having a hangover?
 
Ah, I can't explain exactly why I imagined him having one.
 
@R.MartinhoFernandes Drinking too little.
 
@Rapptz Oh. How silly of me.
 
9:51 AM
Mmmh, the previous tenant left tons of candles behind. I'd light one or two for ambiance but I don't have matches or a lighter.
 
You don't need matches to make fire!
Go wild!
 
/r/gonewild
 
Well that is where I live, so not too wild.
 
I just asked myself, "What does iomanip mean?" until I realised it meant input/output manipulation. I think I need to rest.
 
@Cicada Ok, not that kind of going wild.
 
9:53 AM
Have you never been there?
 
lol
 
@Rapptz No, I meant that I am not interested in seeing pictures of Luc naked.
No offense, Luc.
 
He just insulted your manhood.
 
I need to light those candles for the atmosphere before anyway.
I have batteries but no steel wool.
 
Candles are pretty seductive depending on context so I'm surprised how relevant the /r/gonewild link is.
 

« first day (743 days earlier)      last day (4222 days later) »