« first day (860 days earlier)      last day (4081 days later) » 

user142019
10:00 PM
@Xeo yes if is expression.
 
user142019
\x -> if y then z else w is fine syntax.
 
Xeo
Ah, no semicolons required like if x; then y; else z even though it's all on the same line? I think I had some problem like that before when playing around.
 
user142019
Of course not, why would it be needed? :P
 
Forget about semicolons.
 
user142019
else and then are never optional so there's never an ambiguity.
 
10:01 PM
@Zoidberg I bet you don't even know how to use it
but no, I have to hand wash dishes... well, when I have to that is
 
Xeo
ask >>=
    \dbHandle -> (liftIO $ getUserFromDB dbHandle username) >>=
        \user -> if authenticate user password then (return $ Just user) else return Nothing
Then, I hope the parens make sense.
 
user142019
@thecoshman you put dishes in it, put a lozenge in it and turn it on.
 
user142019
@Xeo That should work, yes. :)
 
user142019
The parens around return $ Just user are optional, though I'd add them for readability but that's purely my taste.
 
Xeo
Ah, but for the liftIO part they're required?
 
10:03 PM
@Zoidberg oh, I see mummy is quick to answer questions in a way you can understand :P
 
@Xeo Semicolons are for making do-one-liners.
 
Xeo
@R.MartinhoFernandes k
 
user142019
@Xeo Yes because $ and >>= precedences. I think.
 
user142019
$ has lower precedence than >>=.
 
user142019
If you omit the parens it would be liftIO $ (getUserFromDB dbHandle username >>= ...).
 
user142019
10:05 PM
Which is a semantical error.
 
Xeo
Btw, is there really no function in the stdlib for [(a -> b)] -> [a] -> [b]?
 
user142019
map or fmap?
 
Xeo
@Zoidberg Any way to easily get rid of the parens?
 
Xeo
Wait, I think I got the signature wrong
 
10:05 PM
Oh, Haskell.
 
user142019
@Xeo do-notation.
 
Xeo
Okay, corrected.
 
user142019
@Xeo or you can do this:
 
Xeo
I could leave the parens out of [(a -> b)], right?
 
user142019
10:06 PM
let shit = getUserFromDB dbHandle username
  in ask >>=
       \dbHandle -> liftIO shit >>=
           \user -> if authenticate user password then (return $ Just user) else return Nothing
-- but this is fucking ugly don't do it please
 
Yes.
 
user142019
@Xeo yes.
 
@Xeo Wait, what's that supposed to do?
 
user142019
@LucDanton epic win.
 
Xeo
10:08 PM
@R.MartinhoFernandes mapL = zipWith ($)
 
@Xeo Then you already have an answer?
 
Xeo
aka apply every function in a to every element in b
 
@Xeo That's not accurate enough.
What's length $ f [g,h] [a,b], where f is your function?
 
Xeo
@R.MartinhoFernandes Ah, I see what you mean. 2. It's not inner product.
@R.MartinhoFernandes I got to that solution after playing around with FredO's "FizzBuzz in Haskell". I was just wondering if mapL already existed like that.
Hm... A list isn't a monad, right? Else ap would work, I think.
 
It is.
No, ap doesn't work.
ap fs xs = do { f <- fs; x <- xs; return (f x) }
 
Xeo
10:13 PM
Oh, damn. The signature looked so good if you replaced m T with [T].
 
@Xeo The signature is exact.
 
Xeo
So, what does x <- xs do for lists? Extract first element or ... ?
 
>>= for lists is concatMap.
 
user142019
instance Monad [] where
    m >>= k             = foldr ((++) . k) [] m
    m >> k              = foldr ((++) . (\ _ -> k)) [] m
    return x            = [x]
    fail _              = []
 
So, x <- xs for lists... grabs all elements of the list.
But one by one.
It's like nested loops.
 
10:15 PM
its like foreach
sorta
 
user142019
It's like from in LINQ. :P
 
Xeo
@R.MartinhoFernandes Oh, so length $ f [g,h] [a,b] would be 4?
 
Xeo
k
 
user142019
do { x <- xs; y <- ys; return $ x + y }
// would be
from x in xs
from y in ys
select x + y
// in C#
 
user142019
10:17 PM
I think. :L
 
the guy actually implemented all the parts in WebGL o.O
I'm pretty impressed
 
user142019
@BartekBanachewicz yay no glBegin.
 
@Zoidberg I wouldn't post a tutorial which contains glBegin -.-
 
user142019
xD
 
user142019
Oh awesome MathJax.
 
10:19 PM
@Zoidberg Nice, huh?
 
@BartekBanachewicz Oh. I looked at that a while back. Looked ok, but was still very small back then.
 
@R.MartinhoFernandes I hope the guy keeps working at it
I also have to post that to Nicol Bolas some way, hue hue hue
 
user142019
@BartekBanachewicz saturation saturation saturation
 
@Zoidberg what do you mean by this word in this context?
 
user142019
@BartekBanachewicz HSV/HSL
 
10:21 PM
@Zoidberg aaaand?
 
user142019
hue hue hue saturation saturation saturation value value value
 
user142019
IT WAS A TERRIBLE PUN OKAY *goes cry in corner*
 
@Zoidberg you deserve it.
 
user142019
Oh well.
 
anyway, I am actually writing that font class
I am a bit stuck on sampler specification
 
10:24 PM
wtf is going on here
 
@LightnessRacesinOrbit umm, nothing?
 
@BartekBanachewicz Are you going to support ligatures?
Muhahahahahah
 
user142019
lol
 
39 mins ago, by Bartek Banachewicz
and fucking_fonts::draw("shit");
guess by yourself.
 
10:26 PM
How's that an answer?
 
user142019
Use Core Text.
 
@R.MartinhoFernandes Hint: It isn't
 
well, it's an answer basing on my usual thoughts about displaying text in modern OpenGL
 
Xeo
@LucDanton: Btw, re the "asking for response" - if I pose some question, I usually want to learn from it, so it wouldn't do me any good to just run away from it. It's just, as I said, that I'm rather easily distracted, so please remind me of my own question if I went of on a tangent and never came back.
 
"shit" has no ligatures, but "effing shit" has.
 
10:27 PM
@R.MartinhoFernandes hm?
 
Xeo
@BartekBanachewicz That evil ffi
 
user142019
 
Xeo
with reaaaally close letters.
 
Xeo
Yeah, that one.
 
10:27 PM
so why does erasing from a std::vector not require erase-remove?
 
user142019
Foreign Function Igature.
 
it's looking at me!
 
v.erase(v.begin()+5) <--- erase 5th element
 
Is there an FFS ligature?
 
@BartekBanachewicz On which font?
 
Xeo
10:28 PM
@TonyTheLion Uh, erase-remove is only needed if you erase a (potential) range as far as I'm aware.
 
@R.MartinhoFernandes dunno, generally?
 
Also that's not the usual erase overload that is used for erase-remove.
 
user142019
I have never seen FFI as a ligature, only ffi.
 
fuck
 
user142019
lol
 
10:28 PM
Clang gives a different type to LLVM :(
 
Xeo
@BartekBanachewicz Make your own font that has it.
 
@R.MartinhoFernandes ligatures being?
 
@BartekBanachewicz No, that's not common at all if it even exists.
 
user142019
@thecoshman gluing letters in a beautiful way, roughly. chat.stackoverflow.com/transcript/message/7880095#7880095
 
Xeo
@thecoshman Look 3 lines below.
 
10:29 PM
@thecoshman Oh gosh. Lemme see if I find the appropriate part of the transcript.
 
FFS, why does C++ have to have all these special cases? Seriously can't it just have one idiom that applies in all cases for erase
 
user142019
@TonyTheLion because C++ is FUBAR.
 
erase doesn't have to be used just for erase-remove. It stands on its own, too. None of those overloads are 'special cases'.
 
@TonyTheLion It does in C++11.
 
¬_¬ because a proper definition is never wanted is it
 
10:30 PM
In writing and typography, a ligature occurs where two or more graphemes are joined as a single glyph. Ligatures usually replace consecutive characters sharing common components and are part of a more general class of glyphs called "contextual forms", where the specific shape of a letter depends on context such as surrounding letters or proximity to the end of a line. History At the origin of typographical ligatures is the simple running together of letters in manuscripts. Already the earliest known script, Sumerian cuneiform, includes many cases of character combinations that over the ...
 
Feb 10 at 19:31, by Bartek Banachewicz
@R.MartinhoFernandes I forgot to thank you. If you weren't mentioning ligatures here, I wouldn't ace my graphics exam. Now I have A :)
 
it = cont.erase(it);
 
user142019
v
 
@LucDanton so what is the typical use case for erase-remove?
 
Meh, screw the transcript. Wikipedia is good enough.
 
Xeo
10:30 PM
@TonyTheLion If you want to remove something completely from a container on a condition, you also need to erase it because remove can only operate on the iterators.
 
user142019
The principle of good enough (sometimes abbreviated to POGE) is a rule for software and systems design. It favours quick-and-simple (but potentially extensible) designs over elaborate systems designed by committees. Once the quick-and-simple design is deployed, it can then evolve as needed, driven by user requirements. Ethernet, the Internet protocol and the World Wide Web are good examples of this kind of design. This kind of design is not appropriate in systems where it is not possible to evolve the system over time, or where the full functionality is required from the start. Quantitati...
 
@R.MartinhoFernandes ah
 
@TonyTheLion c.erase(/* some flavour of std::remove, applied on c */, c.end()) IIRC.
 
Xeo
@DeadMG With that, you could actually do a fold over the sequence with erase_if, I think!
 
@Xeo You'd need a sequence of iterators then, wouldn't you?
 
Xeo
10:32 PM
Dammit, I can't stop thinking in maps and folds. Dammit, you functional people.
 
so the question then really is, what's the advantage of having a std::remove that really doesn't remove anything?
 
@Xeo Tis awesome, ain't it?
Oooh, never seen that rendering of "platz".
 
@TonyTheLion needs to be called "bring_to_front" or something
 
Yup. What's in a name, anyway?
 
Xeo
@R.MartinhoFernandes Woah, that must be old.
 
10:33 PM
yea
 
@R.MartinhoFernandes Yes you have
 
Hmm, that's in Friedrichshain.
 
@TonyTheLion Usual reasoning for having <algorithm> at all. M+N instead of M*N.
 
@Xeo Meh, I don't want to take the U5 to check it out.
 
@LucDanton not entirely sure what you mean by that?
 
Xeo
10:36 PM
@TonyTheLion remove works on any iterator pair, not on specific containers.
 
Do you know the answer to 'why do we have e.g. std::find instead of having std::vector<T>::find' in the first place? Your question seems to amount to that.
 
Xeo
And to actually erase something from a container, you need access to it.
 
@LucDanton no I don't know the answer
 
Xeo
That's where the erase-remove idiom comes from.
 
@Xeo so actual erase can only be done by a member function?
 
Xeo
10:37 PM
Yes
 
that makes sense
 
Xeo
@TonyTheLion What's better: reimplement find for every container, or have generic find that work on anything iterable?
 
@Xeo ah right, yes I get that. It's separating the algorithms from the containers
 
Xeo
Exactly.
However, by that you lose the ability to actually remove (as in, throw it out of the container) things with an algorithm.
 
right
 
Xeo
10:39 PM
After all, only the container knows how to keep itself correct.
 
right
 
Xeo
@LucDanton Err, yeah. I somehow had in mind chain(value, f), but you'd need a stopping condition for that... aka f would need to return an optional<T> ... wait, that kinda reminds me of your concat_map.
Hmm... my internet will go out in ~15mins
 
@Xeo quick! go watch some boobies!
 
@Xeo std::erase ought to have been designed to take a container as well as iterators and a predicate.
 
Xeo
@BartekBanachewicz Not with 8KB/s down.
 
10:43 PM
@Xeo you might get at least one :P
 
@Xeo That sounds like ana, I think.
 
Xeo
@MooingDuck And then you'd still need an std::erase for every container, unless you have it just call the member function... at which point, why have it at all?
 
Xeo
@R.MartinhoFernandes Except it doesn't build something up. It's just repeatedly doing f(f(f(f(f(value))))) untill f returns Nothing.
Although..
 
@Xeo std::erase have a template variation should take any container with an erase(iterator, iterator) member. I fail to see an issue. Or a callback or something
 
Xeo
10:44 PM
If value was a range, it would build something up.
@MooingDuck How is that usefull? Why not call the member directly?
 
@Xeo std::erase_if then
 
Xeo
Write a proposal! :)
Not that I have any problem with the idea of the free function, but it goes against the original idea of the STL - take iterators into something, operate on them.
Also, prior to C++11, it would've been hard to impossible to actually make std::erase(_if) check if the container has such a member function, I think.
 
user142019
delete n xs = let (ys, zs) = splitAt n xs in ys ++ (tail zs)
 
Shit, I'm trapped within wikipedia's typography section.
 
user142019
Typography is wonderful.
 
Xeo
10:48 PM
@R.MartinhoFernandes Forgot your Rope?
 
user142019
@Xeo the hyperlinks between the articles make cycles and now he's in an infinite loop.
 
@Xeo iterators can't erase, std::erase_if should have been called std::move_to_back then, since it can't actually erase.
 
Xeo
Anyways, to renew the flat or not to?
 
There, closed all the tabs.
 
Whoa. This is way cool:
 
10:50 PM
@Xeo shouldn't need a SFINAE, should just error, no C++11 needed there.
 
user142019
@sehe awesome xD
 
@sehe didn't tomalak post that today's morning?
 
@BartekBanachewicz Possibly
 
but yeah, coool
 
I'm kinda bored. Maybe I should go to sleep.
 
Ell
10:51 PM
Ahh that opengl tut is kewl
geometry shader making cubes out of vertexes is very clever :3
 
@sehe And I've turned down the guy from Google who wanted me to interview for job in Zurich :(
 
user142019
@sehe I'd love to see a show with like ten of those things IRL.
 
@Ell which tut?
 
Ell
@BartekBanachewicz open.gl/drawing
 
@Ell tesselator works better, actually
 
Ell
10:54 PM
@BartekBanachewicz I don't know what a tesselator is, I've only seen it on the unigine heaven benchmark haha
 
@BartekBanachewicz Hmm. Did you actually reply that to me?
 
@sehe yea. The movie was made by guys in Zurich, right? ;p
 
@MooingDuck ooooooooooold. And a lot less spetacular in the Real Time department, IYAM
 
user142019
AESOME
 
Xeo
10:54 PM
Okay guys, brb in 10 mins. :3
 
@Ell A tesselation unit, controlled by the tesselation shaders
 
@BartekBanachewicz Oh. Aha. I didn't realize
 
@sehe well sure, but it's exactly what he asked for
 
@MooingDuck Oh. Man, I'm missing contexts all over the place. Sorry about that.
 
user142019
@MooingDuck I actually meant an acrobatics show like in sehe's video.
 
user142019
10:56 PM
But longer and with more drones.
 
zomg
But yeah, demand that. You have every right. That should make the guys work harder
 
user142019
But the James Bond one is also cool. :)
 
It would be cool to write something for such a project
I think that C++ would be a nice language for it
 
user142019
s/C\+\+/Haskell/
 
@Zoidberg why don't you go to the Haskell room instead then?
 
user142019
10:58 PM
Because like the only active user in the Haskell room is @Feeds.
 
user142019
lol
 
const char* A =
".XX."
"X..X"
"XXXX"
"X..X";
 

« first day (860 days earlier)      last day (4081 days later) »