« first day (1058 days earlier)      last day (3897 days later) » 

12:01 AM
does removing left recursion from a CFG change associativity of operators ?
 
@Pawnguy7 Is that Cinder?
 
Nope. SFML.
And abnormally slow for some reason.
 
@A.H. You can normally maintain associativity, but sometimes doing so isn't obvious.
 
SFML is nicer than Cinder
 
12:10 AM
Found it. I was making a circle for every particle :D
 
@JerryCoffin I find it hard to figure out how to do that :<
 
@A.H. It's been a while since I played with it, so I'm not sure I could do it at all any more.
 
12:37 AM
@Mysticial poke
 
@Borgleader I don't quite understand what they are trying to do...
 
generate phone numbers ?
 
Something like that. What is significant about the sum being 33?
 
No clue, magic constants ftl
 
I remember the first way I "improved" from magical numbers was #defining them instead. Those were the days...
 
1:06 AM
I just noticed, they had a //begin main. Do people really mark the beginning of a function? Like, rather after you began it?
 
Not sane people, no.
 
Do you do the end of braces thing? (I see this mostly on namespaces).
 
End of braces? Example?
 
} // namespace foo::baz::bar::foo_again::baz
 
^
For example, here, line 63.
 
1:20 AM
wtf purpose does that have
 
Might help in a situation like this:
 
@Pawnguy7 I used to denote the end of deeply nested ones, but eh. Start with namespace x { namespace y {, indent the body once, end with } }, no problem.
(Or use a language that does away with the silly manual namespacing)
 
Like C#?
 
C# has manual namespaces, too.
 
Oh. Have a language in mind?
 
1:34 AM
@Pawnguy7 Applesoft. No manual namespacing, just nice clean line numbers.
 
Why does VS2012 let me move a shared_ptr into a unique_ptr?
What does that even do?
 
@Mysticial That's an excellent question. The obvious (though uninformative) answer would be "no good".
 
1:55 AM
7zip's command line version isn't so bad
lol
Everything is Ok
Nice way to return 0 I guess
 
2:09 AM
I don't like getting compile errors in the standard library :\
Well, VS implementation, anyway.
 
Spoiler: It's not the standard library
 
Does VS implementation count? :D
 
Yes
 
Might a const variable make it no longer generate operator=?
 
@Pawnguy7: C++11 12.8p24: A defaulted copy/move assignment operator for class X is defined as deleted if X has:
— a non-static data member of const non-class type (or array thereof), or
 
2:25 AM
0
Q: string variable as haskell command

user2758028when I do following it works print [1..5] and result [1,2,3,4,5] but why following is not working let x = "[1..5]" print x I want to process a string variable as haskell command. can someone please help me in it.

lol
 
@VaughnCato why the non-class type part?
 
@Pawnguy7: It applies to class types as well, but the rule is more complicated:
— a non-static data member of class type M (or array thereof) that cannot be copied/moved because
overload resolution (13.3), as applied to M’s corresponding assignment operator, results in an ambiguity
or a function that is deleted or inaccessible from the defaulted assignment operator, or
Most likely a const member of class type will not have a copy assignment operator that is const.
 
I don't know how it could.
Does a foreach use operator= for some reason?
 
Yes
 
Oh. What for?
Oh right.
 
2:35 AM
to assign it to whatever you are using
 
@Pawnguy7: There's nothing preventing it technically:
struct A {
A &operator=(const A &) const { }
};
 
I still find it being a copy confusing.
 
Make it move-assignable
 
@VaughnCato True, but of what use would this be?
 
class_name& operator=(class_name&&) noexcept = default;
 
2:36 AM
@Pawnguy7: not much in practice -- that's why I said "probably"
 
@VaughnCato Missing return *this; :P
 
Actually I said "most likely"
@Rapptz: true
 
I cannot think of any circumstance for its use.
@Rapptz Perhaps I was thinking incorrectly. for (T & t : tVector) still errors.
 
with what error
 
'operator =' function is unavailable in
Worked fine with something very similar, I think the const is making it not make one though.
I don't know why I need a copy anywhere.
Oh.
I think I found it. I am putting it in a vector somewhere else.
Or does that use the copy ctor?
 
2:44 AM
@Pawnguy7 Yup -- and for that it needs to be assignable (either move or copy assignment, with a new library/compiler).
sorry 'bout the ding-fest there.
 
I should probably learn how to move stuff :\
 
Greetings fellas.
 
@MohammadAliBaydoun hello.
@Pawnguy7 Probably. Next time I'm going to move, I'll give you a call...
 
5/0 with AD Lulu.
So much fuuun.
 
Rockfeller = rockfella = the guy who ran into Medusa?
 
2:51 AM
Haha. Although, now that I think of it, maybe it doesn't need to be const at all. I see no reason to change it, but... what would anyway? Member of a struct.
 
@Pawnguy7 What kind of object are you talking about exactly
 
@MohammadAliBaydoun Firework rocket.
 
@Pawnguy7 And here I am, messing with lame stuff like gui::radio_button ;P
 
@MohammadAliBaydoun haha. It is pretty basic. Just started it two hours ago or so.
 
2:59 AM
@Pawnguy7 I created the source file yesterday and sat down thinking of a name for this GUI object I wanted to have. It took me quite a while to realize that it's the equivalent of a cascade of radio buttons. I fell asleep shortly after and here I am.
 
Haha.
I am not getting much done either :\
Night.
 
I'm almost done this engine though. The only major component that's left is the Lua API that exposes my functions to Lua directly. Also, Good night.
Oh wait, he left already ;_;
 
3:23 AM
:Hello! Is there now a Vim expert here?
 
If looks can kill ... then medusa was the hottest man slaughter according to those drawings ...
 
The one who make that makes Medusa hot.
 
Well it was said Medusa was punished for her looks in the myth. She used to be a priestess of Athena
 
I think she is not real..
 
she isn't
 
3:32 AM
What's the story of her?
 
if you look her in the eyes you get candy
trust me
 
No, I mean how did she became like that.
 
@Servant There are lots of versions of the story. The oldest stories have Medusa as some sort of ancient monster that predated the gods and probably even the Titans (and started out ugly). Around 500 BC the stories started to change -- that she was terrifying and beautiful. Somewhere along the line, she was also re-invented as originally beautiful, and made ugly as a punishment.
In the latter versions, she was generally either human or some sort of demi-god.
 
How do people know she's beautiful?
Look through mirrors or something?
 
@JerryCoffin A Gorgon
 
3:37 AM
@nightcracker The idea of looking at her in a mirror (his shield) was supposed to be original with ummm....the guy who killed her. Can't think of his name right now. Other than that...well, lots of myths don't make much sense if you think too hard about them.
 
@JerryCoffin Think about vampires being invisible in mirrors. Think about it.
@JerryCoffin Then think about a laser being pointed at the vampire.
 
@nightcracker Yet always clean shaven and perfectly groomed. Yeah. :-)
 
@JerryCoffin does the laser go through the vampire or not?
 
@nightcracker I guess it's fortunate (?) that most real belief in vampires predates lasers.
 
any decently bundled light source will do, don't worry - lanterns existed for a long time
now an observer through the mirror would say yes, and an observer through the real world would say no
but sadly we can combine those observerse through tactical mirror placement
hilarity ensues
 
3:41 AM
user image
6
 
@chris lol
I usually hate memes but that was good.
 
@Rapptz One could say it has a double meaning.
 
@chris "double entendre" would be the accepted term for that.
 
@JerryCoffin I guess. They don't really go together such that both make sense.
 
0
Q: python to javasript function

user2758162i search a way to convert this python function to javascript if len(s) == 92: return s[25] + s[3:25] + s[0] + s[26:42] + s[79] + s[43:79] + s[91] + s[80:83] elif len(s) == 90: return s[25] + s[3:25] + s[2] + s[26:40] + s[77] + s[41:77] + s[89] + s[78:81] elif len(s) == 88...

 
3:50 AM
@chris Double entendre often doesn't -- in fact, it seems to be considered particularly cute when the two meanings are (nearly) exact opposites of each other.
 
@JerryCoffin <3 Yay for learning the technical explanation of more useful English techniques here than in school.
 
@nightcracker You need to include a warning before you dump a link like that. What kind of bleach removes the image of magic numbers?
 
results not guaranteed
 
@nightcracker Well, thanks for at least trying...
 
4:04 AM
0
Q: c++ #include (what functions are in what)

Erick MooreI am a fairly seasoned Java programmer, so i understand what including does, and why to do it, BUT, I am using java for a example, When i need a method i can go to the structure and open the jars and see what is there, but i have been watching some tut's and they say you are going to need to incl...

what o.o
 
Ah, another ingenious question exploring the depths of C/C++
What a treacherous language that is, C/C++
 
@Borgleader "I don't understand. Therefore it must suck."
 
@JerryCoffin I almost VTCed as rant, but after reading it 3 times I noticed theres was a question burried deep in there
 
I want to provide split functionality for both predicates and elements, so e.g. split_pred(even, { 1, 2, 3, 4, 5 }) == { { 1 }, { 3 }, { 5 } } and split_element(-1, { 1, -1, 3 }) == { { 1 }, { 3 } }. Suggestions for actual names?
 
@LucDanton split_if (for pred, it goes in line with find_if, remove_if, ...), and split_on for the element version
 
4:15 AM
I'm thinking naming the one split and the other split_on, but I'm not sure which one which.
 
It,s the second time I chime in on this, even though he plonked me xD (I think)
If anyone agrees with my suggestion feel free to just "repost it" :P I'll be afk for a bit, workout time
 
Haha Andrei.
> Gosh, thank you so much. I mean, come on folks! This was it! Oh, that's what he said?
 
@LucDanton split_if for predicate, split_on for element-wise.
 
I'm leaning towards split(-1, r) and split_on(pred, r) atm.
split_if certainly is appealing though... I forgot about std::find_if and the like.
 
replace split_on with split_if and it's good
split(-1, r) seems good
 
4:30 AM
Originally I wanted to keep the scheme of foo and foo_[preposition], such as group/group_by but it's occurred to me that for split it's reversed: whereas group_by is a special case of group, split_element is a special case of split_pred. Decisions, decisions...
Oh um. My join is a -> [[a]] -> [a], Haskell's intercalate is [a] -> [[a]] -> [a]. This is proving troublesome.
 
4:52 AM
Dang it this question is confusing. I just figured out half of what the OP is trying to do.
 
Which question?
 
Row polymorphism is hard. Let's go specialize common_type!
 
5:10 AM
How come I get some SFINAE in a base list :|
 
0
Q: using dbms_pipe to insert data coming from heavy transaction

Programming_crazyI have an application where very frequently data is coming. Data is string[word] and int value, which i am inserting into database for further processing. Insort I am using mysql C++ connection. I am accessing mysql from c++ envioronment. Initially I though to call insert query for each in comi...

 
> If E2 is an xvalue: E1 can be converted to match E2 if E1 can be implicitly converted to the type “rvalue reference to T2”, subject to the constraint that the reference must bind directly. [emphasis mine]
wtf :|
So you can't b ? std::move(a) : std::move(b) if a and b are of different types (and aren't related), or am I misreading that?
Eh, it's complicated. Bulletpoints with fallthrough.
 
5:25 AM
@LucDanton What would the result of that be?
 
@DeadMG e.g. a functor and std::function<Sig>.
 
hm.
o btw
are you up for discussing type inference and general type system stuff?
 
"error| operands to ?: have different types" is quite the unhelpful error message.
@DeadMG Yup.
 
I've been trying to consider how to remove implicit conversions from Wide
 
I recommend polymorphic literals, if at all possible.
 
5:28 AM
yeah I considered that.
but it doesn't really cover all the bases
for example, what is decltype(5)?
 
That will depend on the type system, ye.
 
@DeadMG hey, did you try that LLVM Snapshot build of clang for VS?
 
The naivest of naivest attempts is to make the literals have a special type each, and the only implicit conversion ever allowed are from literal to non-literal. (You can separately decide whether user-define types can play along literals, and how.)
 
@Borgleader Yes.
 
The less naive attempts will depend on your type system. I.e. you'll have to go beyond monomorphic types, I think.
 
5:30 AM
hmm.
well I'm definitely not going to go for the naivest of naivest attempts, because the entire point is to simplify my implementation by scrapping the implicit conversion code.
 
@DeadMG How is it?
 
if I have to implement something that's very similar to implicit conversions, I may as well just keep implicit conversions.
@Borgleader Unusable.
 
Oh =/
 
really
they needed a couple more weeks, I'm guessing, to work on it.
 
@DeadMG Given the costs of implicit conversions, I don't think that conclusion readily follows.
 
5:32 AM
but felt they had to release to coincide with GN
 
Note that if you want to prohibit implicit conversions there's also the consideration of subtyping. You can't be monomorphic and have no implicit conversions and subtyping, I would say.
 
Any Vim expert here?
 
@DeadMG How about simplifying by just having (for one example) only one integer type, one floating point type, one string type, etc.
 
@LucDanton I agree. The entire point, as it were, of inheritance is that a Derived* implicitly converts to a Base*.
 
Well, that's one way of implementing it.
 
5:34 AM
@JerryCoffin Aside from any other consideration, it would make it rather difficult for me to describe C++ functions in Wide terms.
 
What is the problem we're solving?
A bit hard to search for "Wide"
 
@DavidStone It is a language I am constructing.
 
@DeadMG True -- if you want much interop with C++, you're going to be pretty much stuck with some ugliness (unless you keep it pretty deeply buried, so to speak).
 
@JerryCoffin I don't really think of having multiple integer or floating-point types as ugliness.
I feel that it's a necessity for the problem domain C++ typically targets
 
5:36 AM
@DeadMG A necessary evil is still an evil.
 
probably
 
@JerryCoffin I wrote that down as something to consider for mine (if I ever go through with it). I want to discuss this issue with Mysticial to make sure you can take full advantage of the CPU with only those.
 
I guess in an ideal world, all integers and floats would be arbitrary-precision
 
Okay, I think I got it. Conditional operator fails because both conversions path are available, which likely means there's a constructor somewhere that's not constrained enough.
 
I guess that I could just make decltype(x) illegal.
 
5:38 AM
Oh btw 0 :: something has the semantics of fromInteger (0 :: Integer) :: something in Haskell, where Integer is arbitrary precision. No implicit conversions going on in that second snippet.
It makes particular sense in a Hindney-Miller infering system but maybe it can work in some other way, I don't know. (I.e. that :: something in the first snippet can be tricky.)
 
type inference is something where Wide could really use an upgrade.
right now I've basically just got auto everywhere.
 
s/Hindney-Miller/Hindley–Milner ?
 
@DeadMG Maybe. Ada also have some fairly interesting methods for defining types for direct machine interaction.
 
@LucDanton Well, I think that the core issue here is two things. 1. How do I handle concrete-type-required requests on polymorphic-type objects, such as decltype() and size()? 2. The limitations of Wide's type inference compared to something like Haskell.
 
template<typename Other, typename... Ops, int... J>
any_base(any_base<Other, meta::list<Ops...>, indices<J...>> const& other)
 
5:42 AM
for example
 
^ that doesn't look constrained.
 
in Wide I couldn't even do template<typename T> f(Optional(T) arg).
 
@DeadMG What does size perform that it requires a mono type?
 
apparently, Haskell could infer something like f(x) { var := std.vector(); var.push_back(x); } and infer the vector's template parameter, which I certainly can't match.
@LucDanton sizeof.
 
@DeadMG That sounds like the wrong example, type-wise it shouldn't need anything. (Implementation wise though that begs a question.)
 
5:46 AM
@LucDanton Not really. You can't get the size required to store an instance of a type, when you don't have a type.
 
@DeadMG Well, there's no free lunch. Type systems and inference have huge trade-offs -- as I understand it F#'s has very real limitations even though it's ML-derived as well.
 
@LucDanton That's quite true.
 
@DeadMG Yeah, that's the implementation (i.e. what to return), not the type inference (assuming you return some kind of size_t for all types).
Type-inference becomes 'interesting' in the middle: e.g. consume(modify(produce()))
 
ok, well think of it on another level.
the function sizeof is size_t sizeof(Type t).
but a polymorphic type isn't a Type.
 
^ depends on type system
 
5:48 AM
ok
then consider f(x) { var := std.vector(decltype(x))(); var.push_back(x); } Main() { f(0); }.
 
Haskell's 0 :: Num a => a is a real type. It's not a monomorphic type, but a polymorphic type. Then Just 0 becomes Num a => Maybe a.
@DeadMG Assuming 0 is polymorphic, then yeah there's an ambiguity.
 
yep.
 
Let me find a somewhat language-agnostic example of those polytypes in the middle.
e.g. print(genericLength(sequence)) -- if genericLength(sequence) has polymorphic type, then there's no telling what to print.
 
yeah, overload resolution has a similar issue.
if you have f(int32 x) {} f(int64 x) {} Main() { f(0); }.
 
^ print is 'overloaded' here. It can accept any argument type that's printable, presumably.
In Haskell you disambiguate with type assertions.
 
5:52 AM
so basically an explicit cast?
 
If I write 0 :: Int, then it's the same as if I had written foo :: Int -> Int; foo i = i; foo 0
@DeadMG It's hard to answer. 'Cast' as a term tends to mean different things to different people.
 
ok
 
If I write foo 0 in a Hindney-Miller infering system then 0 must have type Int, otherwise there's an obvious type error.
 
well I would argue that a cast is a purely type-level operation; and a conversion generally implies a run-time computation of a new value.
 
Thanks to that use of foo (i.e. that's a key feature of Hindney-Miller) then the type of 0 is deduced.
 
5:54 AM
yeah
 
@DeadMG Okay, then it's not a cast. Nothing is operated on. The relevant type is chosen amongst the original family of types (a.k.a polymorphic type), to speak informally.
(This begs more and more questions come implementation time.)
 
yeah
 
Note that the chosen type need not be a monotype. (Here comes subtyping!)
 
I usually prefer to describe this problem in terms of None and Optional rather than integers because ultimately, if I wanted to, I could special-case the fuck out of integers.
whereas I have no intention of special-casing optional
 
I'm accustomed to the empty optional being an inhabitant of the relevant type.
 
5:57 AM
yeah.
 
In Haskell Nothing :: Maybe a (rule of thumb: lowercase type variable means polytype down the line).
 
well I can just make all of the concrete-type functionality illegal when dealing with a polymorphic type.
the real question is inference
namely that it's basically impossible for me to go from f(x) { x = float32(); } Main() { f(None); } to deducing that x is an Optional(float32).
 
Um, putting type-inference aside, wouldn't that assignment be an implicit conversion?
 
nah
if you know in advance that x is Optional(float32), then that type has an operator=(float32).
hmm.
what I could do is look into allowing the user to define the inference.
 
Anyway, from the top-down direction (let's call that push), None means that x must have type Optional(T) for some T. In the other direction, assign(x, float32()) means that assign must be a function that accepts a float32. In the middle, you can perhaps hope to notice that Optional(T)::assign for some T has type (Optional(T), T) -> whatevs, then you can unify T with float32.
 
6:04 AM
I can't notice it, really.
for simple example, imagine that I defined Optional to invoke some Turing-Complete type metafunction from C++.
 
That kind of scheme already puts some restriction on how to write something like Optional(T). E.g. no mechanism for explicit specializations.
@DeadMG Oh I took it to be a data type.
 
@LucDanton Optional(T) is a type. But that's pretty much all the guarantees I've got.
and since the implementation of Optional(T) can be TC, I've got no way in general to infer the argument from the return value, if you get my drift.
 
If it's a straight alias it works, but that's due to an alias, well, not doing anything.
If it's not, yes it's not tractable.
 
which is why I was thinking
perhaps allow the user to define the inference.
for example, I might say polymorphic type None { operator=(x) { this = Optional(x); } }.
 
Some systems allow the user to annotate variance. Those systems typically put an emphasis on OOP though.
There's also type-theoretic jargon regarding variables that are in a positive or negative position. I think it's the same thing.
> In type theory, a positive type is one whose constructors are regarded as primary. Its eliminators are derived from these by the rule that “to use an element of a positive type, it is necessary and sufficient to specify what should be done for all possible ways that element could have been constructed”.
Nope, different notion.
I think that's the stuff to unify Foo a b c with Bar d e and the like.
@DeadMG So far I've assumed a type-system that only works on types. This scheme would work only if the type system had access not just to the type of operator= but also the implementation to notice the Optional(x) use.
 
6:11 AM
@LucDanton Perhaps return would be better.
operator=(x) { return Optional(x); }.
 
(None, a) -> Optional(a), sure.
Weird semantics though no?
 
hmm
well, you'd also have to deal with stuff like x := 0; x = 4;.
where you could make a reasonable argument that the polymorphic type is not stateless.
unlike None which definitely carries no state.
unless you made a new one for every integer literal.
especially if I did something like f() { x := 0; if(cond) { x = 4; } else { x = 5; } }.
I guess that
if I have x := 0, then I can have a "preferred" type.
well
at least I can look into the polymorphic type thing.
 
6:27 AM
I think I should stop feeding the magpies - the pie saw me had meat in my hand, put a worm in its mouth aside, came for the meat. Now I have a dead worm in front of the house & the magpie went away with the meat :/
 
I'm torn right now anyway between implementing more features, and working more on my IDE integration stuff
 
 
2 hours later…
8:04 AM
Hurray, I unbroke the code.
 
congratulations :P
 
@LucDanton Don't worry about it, I'm sure it will revert to its normal state soon.
 
oh, shit.
the need to unify Clang overload sets and Wide overload sets.
 
Um, what does std::istream_iterator<char> iterate over again?
Successive char c; stream >> c; kind of deal? That skips over whitespace, doesn't it?
 
all the char in the istream before extraction fails.
@LucDanton Yes, but you can add noskipws to the stream beforehand.
 
8:08 AM
Damn, the result looks weird.
Pretty sure my istream_range is implemented wrong.
 
what's the sample stream input and output?
 
I run it on main.cpp that starts with #include <foo/bar/baz> and I get include<foo/bar/baz>. I'm not sure if the munging is consistent.
 
8:24 AM
hot damn
I've got so much stuff I need to do on Wide, I'm kinda overwhelmed.
 
k the stream stuff works alright
Alright the bug is in split.
 
alright, let's consider how we are going to handle more advanced type inference.
 
Oh. split takes a peek at the front but for an istream_range no peeking is allowed.
 
you can putback at least one character
 
Well by the time I'm in split it's too late :p I'm operating on a generic range.
Idle thought: maybe it's worth getting rid of lvalue/rvalue ranges (modelled after lvalue iterators) in favour of peekable ranges. @R.MartinhoFernandes
Well, the two notions don't exactly match one to one.
 
8:42 AM
well
your concept modelling does seem deficient here
 
That's a damn tempting idea. I'm really uncomfortable with the present situation where I need to keep track which composite range needs to visit an end more than once, plus that frontback_cache business.
 
Ell
What is a polymorphic type in this conversations context?
 
@DeadMG I'm actually really glad I got rid of lvalue/rvalue. In my mind those things are way too focused on syntax rather than semantics.
 
@Ell Consider None- i.e., the empty optional<T>. It's the <T> that makes it polymorphic.
 
It's all in the T.
 
8:44 AM
@LucDanton Lvalue/Rvalue is a semantic distinction, not syntactic. At least, last time I checked.
 
Is a range which element type is int const& lvalue or rvalue?
 
Ell
Ahh right I think I get it
 
lvalue.
 
What's one thing you can do for sure with an lvalue range, that you can't do with an rvalue range, that's useful?
 
well, my first bet is taking pointers to the result and not having them die on you.
 
8:46 AM
There are going to be so many caveats with such a thing that's it's more a problem-specific situation than something generic.
 
Storing them in a class without issues?
 
wat.
boost::variant, you can't do a kind of contains<T>()?
 
was that directed to me?
 
oh, well, I guess I could use variant.type() == typeinfo(T).
@Rapptz No.
 
which()
 
8:48 AM
do I have someone plonked
 
Enjoy brittleness in the type index lol
 
@LucDanton I was just about to say, that's suck.
 
that just seemed way out of context to me
 
in fact
Visitors suck too.
I'm obviously going to require helpers for this.
 
Yeah when I was making a variant I really disliked the visitor pattern.
 
8:50 AM
Anyway, things like readable/writable/lvalue are of little value. I'd rather have a range over some elements, as whether you can apply an operation (whether it's addressof, increment, what have you) over elements of a range depends on more than just whether front(r) is an lvalue or rvalue. For once, whether it's actually a compatible type.
Admittedly this relies a lot on the decltype-style sillyness where you encode value category in the type.
i.e. Element<R> is int& for something like a range over an std::vector<int>.
 
I agree there's not much useful you can do with a const lvalue range that you cannot do with an rvalue range.
hmmmm.
adding expressions which aren't yet fully known is going to be a headache.
 

« first day (1058 days earlier)      last day (3897 days later) »