« first day (1023 days earlier)      last day (3940 days later) » 

8:00 PM
I wonder if I could devise one that would generate some useful error recovery
 
Xeo
@not-rightfold [...] |> filter id
 
user1804599
Well.
 
Xeo
You have to transform that into a lambda first? What's the |> useful for, then? :P
 
@Xeo filter id xs !!
 
user1804599
@Xeo I don't have partial application syntax yet.
 
8:04 PM
hm, is there some sort of identity function?
 
Xeo
@BartekBanachewicz id
 
user1804599
It'll be something like [...] |> filter(id, &1); similar to std::placeholders.
 
ewww.
@not-rightfold doo eeet
partial applicationsis super awsum
 
user1804599
Or [...] |> for x in &1 where x { x }. :P
 
Xeo
8:08 PM
Hm.. can you also use |> for composition?
Or only for application?
 
user1804599
Application. I'll add composition operator right now.
 
Xeo
Not specifically in Gear, I mean
Also Elixier
 
user1804599
It would be weird to use the same operator for both.
 
Xeo
Well, if you see values as nullary functions, it's not that different, is it?
 
Can someone help me find the dupe of this?
0
Q: c++ vectors and push_back

CodeKingPlusPlusI am getting a strange c++ error: main.cpp:81:9: error: request for member ‘push_back’ in ‘points’, which is of non-class type ‘std::vector<std::vector<float> >()’ I am reading this like c++ is trying to tell me that the function push_back is not part of the vector class. Here is my relevant c...

It's MVP.. but I can't find it :(
 
user1804599
8:14 PM
Hmm.
 
Xeo
50
Q: Default constructor with empty brackets

Martin BeckettIs there any good reason that an empty set of round brackets (parentheses) isn't valid for calling the default constructor in C++? MyObject object; // ok - default ctor MyObject object(blah); // ok MyObject object(); // error I seem to type "()" automatically everytime. Is there a good r...

?
 
user1804599
Should |> be left-associative or right-associative? What about <|?
 
Xeo
Wait, why would |> be right-associative?
 
@Xeo Perfect.
 
user1804599
@Xeo I'm always confused when it comes to associativity.
 
8:15 PM
Okay voted.
 
user1804599
I think |> should be left-associative and <| should be right-associative?
 
Xeo
@not-rightfold left-associative means it groups from the left. Right-associative opposite.
a |> b |> c == (a |> b) |> c
 
user1804599
a <| b <| c == a <| (b <| c) makes sense I guess.
 
Xeo
Actually, if |> (or <|) is transitive, it doesn't matter in that specific example
What matters is if other operators are involved which have the same precedence
Let's say + has the same precedence as |>, a |> b + c == (a |> b) + c or a |> (b + c)?
 
I just closed a question that has 4 duplicates listed.
I've never seen that before
 
user1804599
8:18 PM
@Xeo Oh, right.
 
user1804599
Well nothing has the same precedence as |> and <| except <| and |>.
 
Xeo
(Obviously, all operators with the same precedence should have the same associativity, or not be allowed to be mixed in the same expression.)
 
@Rapptz Doesn't matter, had 4 upboats ;)
how else am i supposed to catch up to you in rep =/ :P
 
@Borgleader I actually spent my time looking for the dupe, and when someone answered it I said "Ugh, who would answer this?"
 
Hahahaha xD
I actually think it's hard to search for
 
8:19 PM
Yeah it is, I thought it was in the
it is actually, wonder why I couldn't find it.
 
Xeo
> let (|>) = flip ($)
> [True, True, False, True] |> filter not.id

<interactive>:103:1:
    Precedence parsing error
        cannot mix `|>' [infixl 9] and `.' [infixr 9] in the same infix expression
 
Ell
I just broke my brothers bb gun :O
 
Xeo
@not-rightfold ^ an example from Haskell
 
user1804599
Ah, right.
 
@Rapptz i like how one of the faq questions is a dupe?
 
Xeo
8:21 PM
@Rapptz I just searched for "[c++-faq] most-vexing parse", which brought up the answer to that question.
 
@CodeKingPlusPlus This example has nothing to do with ambiguous grammar or syntax. The Standard clearly defines the meaning of it, but it's different to what you think. I think it's an example of context-dependence. — DyP 1 min ago
 
@Borgleader I don't even know why it's an FAQ.
 
Most Vexing Parse is not due to ambiguous grammar? TIL
 
Xeo
Erm, it is.
 
@Borgleader It's due to the way the compiler is required to resolve constructs that could be interpreted two different ways by the standard.
 
Xeo
8:23 PM
Well, the grammar is ambiguous, and the standard resolves it by saying "if it can be parsed as a function decl, it is parsed as a function decl".
 
Yes but in the end the reason this is MVP is because the grammar was ambiguous in the first place. Had it not been there would be no need to resolve the conflict
 
Xeo
As I said.
 
user1804599
@Xeo I motherfucking love Parsec.
 
user1804599
42 |> (alert << prompt >> foo)
// "ambiguous use of a left associative operator"
 
Xeo
@not-rightfold Interestingly, filter not.id $ [True, True, False, True] is not an error :)
 
8:25 PM
user image
4
 
user1804599
@Xeo You didn't specify a precedence for |> so it takes some default which happens to be the same for ..
 
Xeo
@not-rightfold nice.
 
okay you guys I have a real programming question for once
 
Xeo
@not-rightfold Ah, true, $ actually has lowest precedence, doesn't it?
 
user1804599
Yes.
 
8:26 PM
@DyP The example has everything to do with ambiguous grammer. The C++ standard recognizes this, and provides additional rules outside the grammar in order to resolve such ambiguities. — James Kanze 1 min ago
hehe i like this reply xD (i plinked myself for context)
 
user1804599
<| and |> have the lowest precedence in Gear too after ;.
 
Xeo
... my nipple fucking hurts. This can't be good.
 
user1804599
; is like , in C++.
 
inb4 NIPPLE SALADS
 
Xeo
Well, robot isn't here, so I don't think that's gonna happen
 
user1804599
8:28 PM
@Xeo I just implemented function as >> and <<: 42 |> (prompt >> alert) produces (function(){return alert((prompt).apply(null, arguments))})(42).
 
Xeo
Ah, so left and right composition?
 
user1804599
Yup.
 
Xeo
(aka >>> and <<<)
 
user1804599
. won't work since that is the syntax for attribute access.
 
user1804599
@Xeo I took >> and << from F#.
 
user1804599
8:29 PM
As well as |> and <|. :)
 
Xeo
Yeah, I find the triple operators to be a bit tedious actually
But, do you actually need composition and such to be built-in things?
Well, valid question only if you allow names like >>
 
user1804599
@Xeo No.
 
user1804599
I could support custom operators but meh.
 
user1804599
Maybe in Gear 2. :P
 
Xeo
@not-rightfold Wait, that production looks strange. function() is nullary, or general lambda syntax?
 
8:33 PM
@Xeo ...
 
user1804599
> arguments
 
Xeo
Mh
Weird.
 
user1804599
JavaScript doesn't check the number of arguments you give to a function.
 
user1804599
arguments is an array-like object (but for some moronic reason not an array) that contains all the arguments.
 
Xeo
8:34 PM
Oh, right, Gear compiles to JS
Forgot that.
 
user1804599
I also use arguments in pattern matching. gist.github.com/rightfold/cc7d815fe446db4eac71
 
@wilx relatively fresh. I haven't seen it before
 
Xeo
@not-rightfold That's a lot of generated code.
 
user1804599
I know.
 
user1804599
I have a code generator for each kind of AST node. They always generate code in the same format no matter what context they're in. Hence a lot of redundant lambdas and parentheses. But it works!
 
8:38 PM
dude, per AST node? owch.
 
goddamnit
Daisy has finally started to grow up
 
Xeo
@not-rightfold telling tales of code, eh
 
@sehe Upvoting that until my mouse breaks! :D (probably tomorrow, run out of comment votes today :/ ) — H2CO3 35 secs ago
lol. I should probably credit the source of that joke (@Robot)
 
user1804599
@Xeo Writer <3
 
Xeo
8:43 PM
I like how simple Writer conceptually is.
 
What do you call a woman who stands between two goal posts? Annette.
 
I wish my puns were that clever
 
Xeo
@not-rightfold lol, tell $ "text"
 
user1804599
Which line?
 
Xeo
93, 100
 
user1804599
8:48 PM
olol
 
@JamesKanze @Xeo I'm not exactly sure, but I think () is not a valid initializer. Therefore, the () is part of the declarator, and the whole thing unambiguously declares a function. (An initializer is a brace-or-equal-initializer or a ( expression-list ), where the expr-list is not optional.) — DyP 2 mins ago
 
In other news, this is an excellent album and you should all get it.
 
expression-list is not optional but it can be empty, can't it? or does that count as "optional"?
 
Xeo
initializer-list:
  initializer-clause ...opt
  initializer-list , initializer-clause ...opt
expression-list:
  initializer-list
 
Ell
In other news, I'm eating a delicious lasagna
I don't know how to spell. I mix up with spanish :3
 
8:52 PM
delicious lasagna is redundant :3
 
:<
Delicious lasagna is crucial ;_;
 
user1804599
In other news, for some weird reason let expressions yield a parse error.
 
user1804599
Oh wait, it works. :| Weird.
 
user1804599
Oh well, hurray!
 
9:01 PM
@EtiennedeMartel AntiJoke is better
 
I answered a three year old question today, think it will give a silver badge in time
 
user1804599
@Borgleader I'm still getting answers on this question.
 
user1804599
0
A: Placeholder in UITextView

Andrea FI was able to do add a "place holder" to a UITextView with ALOT less code. This is what I did: UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(60, 800, 200, 60)]; textView.text = @"Write characters here..."; textView.textColor=[UIColor grayColor]; textView.font = [UIFont fon...

 
Holy crap o.O ok...
 
Ell
Hmm. What is the algorithmic complexity of something if random is involved?
 
9:04 PM
It's raining so hard outside.
 
All sunny down here i am a bit far from mtl though
 
@Ell take the worst case and the best case
 
Ell
Well constant time is always possible with random
so best case is O(1)
 
@CaptainObvlious are you sure? — sehe 5 secs ago
^ WTFLOL
 
Ell
Worst case is... how can you tell? o.O
 
9:07 PM
@Borgleader Of course
 
@Ell I'd have to look at the code :p
You might be able to describe it as O(n)
I don't know the context though
If you're producing a random number x and doing x iterations, it's O(n) where n is the random number, right?
 
Ell
well let's take the example of a sudoku board
so a 9 * 9 board
and you have 20 squares filled in
 
@Ell A* or complete cover algorithms?
 
Ell
and this algorithm takes data from /dev/random and for each byte, clamps it and puts it in a cell. It does this until the correct solution is found
@sehe I'm not sure what you mean :S I know A* is a pathfinding algorithm, but that's it :S
 
@Ell Well, there's usually random involved in the actual constraints, not in the algorithm. If you use... random starting points for Sudoku's it'll depend on whether you brute force even though you know there's no posisble solutions, or whether you have to find all possible valid solutions
 
Ell
9:12 PM
Oh right, well if you had to find only one solution, the best case is 1 guess, and the worst case is that it never finishes?
 
@Borgleader Huh. I wonder where was he interviewing to. That question, at least the 2 or more missing numbers part is insane for normal kind of programming job.
 
Ell
So I guess you can't classify things involving random?
 
@wilx google maybe?
 
9:26 PM
Rensselaer Polytechnic Institute seems to be quite interested in me for some reason :|
 
Xeo
Oh fuck me
I left the window open in my kitchen
But forgot to turn the light off
Now I got an immigrant-group of moths there.
 
Don't know if I should go for it and send an application
I want to go to an American University because Lebanon is a dead-end
My dad tells me to try my luck with MIT because I'm "different"
Frankly, I don't have the confidence to introduce myself
Schools in Lebanon don't give you the opportunities that schools in the UK or the US give you. There are no cool classes here, only what the government asks us to take.
And they stress quite a lot on Social Studies for some reason >.<
 
You should have moved earlier.
Like I did.
 
@CatPlusPlus I’ve created a monster.
capitalize <-
    p(lapply,
        p(paste, collapse = '') %.%
        p(fanout, toupper %.% p(substring, 1, 1), p(substring, 2))) %|>%
    unlist
 
I don't make such decisions
 
9:32 PM
@MohammadAliBaydoun I know.
 
Hmm, git doesn't want to push my shit.
 
My dad's income makes him rich in Lebanon
but in the United States, it's trash
 
@MohammadAliBaydoun My dad had to make the same decision and for some reason he chose my schooling over his income.
I really hated the schools in Lebanon.
 
You were living in Lebanon?
 
I've moved a lot when I was younger.
I was in Lebanon for 3 years worth of school though.
 
9:35 PM
Worst case scenario, I introduce myself and apply, then get rejected
but I still get to go to the American University of Beirut
or possibly a lot of other colleges I could apply to
 
Overseas tuition is expensive here.
And.. well.. regular tuition is expensive too so you can only imagine how bad overseas tuition is.
 
I'm not worried at all about money, my grandfather will cover everything
 
It was cool when my dad did it forever ago.. but I don't think it's worth the $300k+ now.
School's nearing that small window of being "not worth the money".
 
Xeo
Okay, Operation "Abandon Ship" just started. Turned off the light in the kitchen, opened the window and got my ass out of there, closing the door behind me.
 
I have this feeling inside my gut
that I can learn computer science better on my own
 
9:38 PM
@Xeo What
 
rather than in a college.
 
user1804599
@MohammadAliBaydoun You can.
 
Xeo
If they're not gone in the morning, I will commence Operation "Vacuum Death"
 
Bugs?
 
user1804599
I've learned more in a weekend of Lounge<C++> than in a year in college.
6
 
Xeo
9:39 PM
Moths
 
user1804599
 
Xeo
11 mins ago, by Xeo
Now I got an immigrant-group of moths there.
 
It's the only reason I'm not applying to any college, but only the best out there, and I need to prove that I'm not like all the other people applying who do "community service" and have "2400 SAT scores"
 
It'd be cool if it worked like that.
(Sadly it isn't, nor do I really think it will be for a long time)
 
user1804599
Implementing &1, &2 etc is going to be a bitch.
 
9:43 PM
I once told my dad that I don't think going to college is the best idea
especially for CS
 
Ell
There is a high chance I won't go to college
 
Man D is weird.
So many strings.
 
user1804599
@Rapptz The language?
 
Yeah.
 
user1804599
Many strings where?
 
9:45 PM
// a[0] = 1, a[1] = 1, and compute a[n+1] = a[n-1] + a[n]
auto fib = recurrence!("a[n-1] + a[n-2]")(1, 1);
// print the first 10 Fibonacci numbers
foreach (e; take(fib, 10)) { writeln(e); }
// print the first 10 factorials
foreach (e; take(recurrence!("a[n-1] * n")(1), 10)) { writeln(e); }
 
@Xeo 60000 rep /o/
 
user1804599
Metaprogramming in D is wonderful.
 
Screenshot, quickly
 
Xeo
Already have one
Been at 60k the whole day
 
user1804599
9:47 PM
@Rapptz You can generate strings at compile-time and have the compiler compile them as D code.
 
I'd expect this Sehe guy to do something better than encouraging PO... Yeah, one can be ignorant even with 82k rep. http://stackoverflow.com/questions/18024492/tradeoffs-when-returning-a-collection?noredirect=1#comment26362952_18024492
5
^ Oh wow. Look mam! I'm on twitter. What even is "PO"?
 
lol.
 
lol
 
@sehe PO?
 
No clue
 
user1804599
9:48 PM
> H2CO3
 
Xeo
@KonradRudolph Premature Optimization, apparently
Also, that guy's a fuckwad, so eh
 
@Xeo That's it! He was just being very narrowminded and selfrighteous in the (now deleted) comments. Basically dismissing the whole question.
So tempted
 
Xeo
Just ignore
 
@Xeo Mmm. Maybe I'll get a chat room. He's a decent guy. He's just quite narrow-minded on particular points. And the communication style doesn't help
 
9:53 PM
Jesus Clipboarding Christ.
 
user1804599
@KonradRudolph How's Streampunk going? Got something working?
 
Xeo
@Rapptz That code is... what
 
What's Streampunk?
 
@not-rightfold No time for that unfortunately :/
 
user1804599
OIC. That's unfortunate.
 
9:58 PM
@sehe That code, by the way, will not benefit from RVO, nor will the move constructor make it more efficient, since D3DXVECTOR4 is just a struct of four floats.
@not-rightfold Been working on my PhD pretty much 24/7 the last two months. This weekend was the first where I did anything else on the computer (last weekend I took free as well, but spent outside)
 
user1804599
OIC.
 
Thanks for explaining what the read function is supposed to do! — Rapptz 6 secs ago
 
Xeo
haha
 
So what's Streampunk? :(
 
user1804599
I should add floating point number literals, arithmetic operators and string literals to Gear.
 
10:03 PM
@KonradRudolph It's been pointed out and replied-to
 
@sehe Tell him that your code is bigger than his
 
@MohammadAliBaydoun It isn't. That's actually irrelevant
 
@MohammadAliBaydoun Is that supposed to be a dick joke?
 
Obviously
 
Yes
Dijkstra
 
10:06 PM
Just wanted to tell you it's a bad one.
 
It is.
I tend to make very terrible jokes
more often than good ones
well, actually, I never make good ones
 
@MohammadAliBaydoun Tomato correlation twip quantizer level
 
@sehe ;_; This fable drove me to tears ;_;
 
@not-rightfold aw... I'm afraid you're overstating things. Either that, or missing out on the non-tech side of things. Again
@MohammadAliBaydoun (pro tip: I'm not an assembler, you don't need to use ; characters to make me ignore your lines)
5
 
lol
I rarely meet people who make jokes like that
This is why I love this place
 
Ell
10:11 PM
Haha
 
Does it make sense to pop_front on an infinite range?
 
@Rapptz of course. unless it's an infinite range of equivalent values
 
If it makes a difference, sure
 
@MohammadAliBaydoun pop_front just advances the range by one.
 
@Rapptz Well, if the range is [1..), then, obviously pop_front changes the results quite dramatically. So, I'd say it makes sense
 
10:18 PM
My ranges are [1..] but yeah, in an infinite range of [1..] it'd go to [2..] like D ranges (I think..)
 
Then sure, it's about what's at the front
 
Well, I'm catching something, but not quite what I intended:
Oh, kind request for any lurkers, don't go and escalate anything, please. I sincerely want to defuse this
Perhaps I should make the room gallery. So the user list doesn't intimidate /cc @TonyTheLion
 
Go ahead. I'm just lurking
 
@TonyTheLion Cheers
lol at wall of text. Check the file permissions. Private keys may not be world readable. Public/private keys must be writable by the owner only. — sehe 5 secs ago
 
escalate what?
 
10:29 PM
@Rapptz No problem anymore. In case he shows up.
 
Xeo
10:41 PM
@Rapptz Think of D ranges as (bi-directional) streams
 
What kind of streams?
 
Xeo
Since acting on the ranges directly is destructive.
With the [1..] example, you have a stream that yields, in order, "1, 2, 3, 4, ...". If you pop_front on that, you consume the first value, leaving the rest.
 
Yeah that's exactly what I'm doing
So front on that would yield 2 right? After pop_back?
> r.front returns the current element in the range. It may return by value or by reference. Calling r.front is allowed only if calling r.empty has, or would have, returned false.
Ah yeah.
 
:lol: Fable got meta
 
10:53 PM
fuck my stomach
 
I named this irange even though it seems it's not close to boost::irange.
 
Xeo
Why not?
 
From what I read boost::irange doesn't allow infinite lists.
 
Xeo
boost::irange can also be infinite, with steps, etc.
 
I only saw these in the docs, so I might be wrong.
 
Xeo
10:58 PM
Atleast I remember it being able to do that
 
template<class Integer>
iterator_range< range_detail::integer_iterator<Integer> >
irange(Integer first, Integer  last);

template<class Integer, class StepSize>
iterator_range< range_detail::integer_iterator_with_step<Integer, StepSize> >
irange(Integer first, Integer last, StepSize step_size);
Seems like a finite range to me, but I've never used it.
 
Xeo
hm
Maybe it was the Boost.Iterator's counting_iterator, or something
 

« first day (1023 days earlier)      last day (3940 days later) »