« first day (883 days earlier)      last day (4071 days later) » 

Ell
7:00 PM
@Zoidberg so they are sort of like checked error codes?
 
user142019
You return a value of type Either ErrorDescription AST.
 
right.
 
user142019
If you don't check that somewhere, you get type error at compile-time.
 
That case above is really do { ast <- parse definition code; processAST ast; ... } and it does propagate automatically and you don't have to duplicate anything
 
user142019
You can just return the Either if you don't want to check it immediately.
 
7:01 PM
@DeadMG I would say that you are right, in that an exception system is essentially like @CatPlusPlus said. Stack unwinding and such, which can be useful. But, what will make it a better model than that of C++ or Java, if it is about the same?
 
Yeah you can't use the value without checking if it's actually there or an error was encountered
 
so if your function which calls parse returns Either ErrorDescription SomeT, then if parse returns ErrorDescription, the compiler will insert code to return that description automatically.
 
user142019
But you have to check it some time somewhere. Same as exceptions except (pun not intended) it's at compile-time instead of at runtime.
 
user142019
So superior. (Y)
 
so what you're saying is
 
7:02 PM
If you have parse that returns ErrorDescription and you want to lift it to Either ErrorDescription whatever then you do return . parse and poof
 
user142019
(Or you are dumb and you match only on of the possible patterns and you get a pattern match failure but compiler should emit warning.)
 
if I want to use the AST value, then I have to explicitly check for error?
 
I don't get it. Do you catch any error inside parse and wrap it into ErrorDescription ?
 
Ell
@Zoidberg I don't see how that differs from java's checked exceptions
 
Yes, because it might not be there to use?
 
7:02 PM
@CatPlusPlus So every single caller of parse will always have to check for error.
 
user142019
Depends on what you want to do with the result of parse.
 
user142019
If you want the AST, you have to check for error, but you have to do that anyway since there may be no AST.
 
Ell
@DeadMG only if the caller wants to use the result of the function
 
Xeo
7:03 PM
@DeadMG You can just defer it to top-level or something.
 
You can unpack the value and propagate the error upwards if you don't want to handle it
 
user142019
If you don't want the AST, you can just return the Either.
 
Which monadic bind does
If there's an error, it propagates it
If there's a value, it runs the code that uses the value
 
Xeo
monadic computation chains are awesome when you have Either or Maybe. No need for continuous checks.
 
so, it's like exceptions, except I have to always remember to call monadic bind manually at every call site.
 
user142019
7:04 PM
Oh right, Either is a monad. :)
 
No
Well, yes, because that's how you chain actions
 
right.
 
But there's a sugar syntax for it so no
 
user142019
@DeadMG you need to call monadic bind anyway (or fmap or other related functions).
 
so actually, it's exactly like error codes, because you have to check it every single time.
 
7:04 PM
No
Jesus
 
user142019
The checks are implicit.
 
user142019
>>= does the checks for you.
 
Xeo
@DeadMG do{ ast <- parse definition code; processAST ast; } taking cat's code from before.
 
you just said, "I have to call monadic bind every time".
 
Ell
Is it only for functional stuff? I don't really understand still xD
 
7:05 PM
so do I or don't I?
 
Xeo
If ast is indeed an AST, it executes the processAST ast part - otherwise, it propagates the error
 
In the same way you have to call statement separator in C++
 
Xeo
something like that, anyways.
 
also
 
user142019
data Either a b = Left a | Right b

Left x  >>= _ = Left x
Right x >>= f = f x
 
user142019
7:06 PM
>>= is monadic bind.
 
user142019
Somewhat kind of similar to overloadable operator; depending on the monad. :v
 
I'm reading this conversation thinking: "I'm a fucking idiot, I don't understand a thing of what they're talking about."
 
meh... it looks unreadable anyway.
 
so... if (auto p = boost::get<Left>(&arg)) { ... } else { auto p = boost::get<Right>(&arg); ... }
 
What's unreadable :psyduck:
 
7:10 PM
>>==
 
except you're fucked if you try to do something like std::vector<decltype(f)>.
 
user142019
do
    a <- foo // if foo returns Left then cut off, if it returns Right then continue
    b <- bar // if bar returns Left then cut off, if it returns Right then continue
    c <- baz // if baz returns Left then cut off, if it returns Right then continue
    return c
 
Xeo
Monadic computation chains <3
 
user142019
do inserts calls to >>= for you.
 
@Zoidberg what if I have 10 types of errors?
 
7:11 PM
or indeed, that.
 
You use a sum type
 
user142019
^ That.
 
sum of what? of unspecified-error-type-derived-from-std::exception?
 
@CatPlusPlus But.. you're going to have to explicitly enumerate every one of them in your pattern.
 
7:13 PM
What
@Abyx If you don't know what your error types are then I guess you can't write a code that typechecks yeah I guess
 
lets say I have int a = floatVar;, if I change it to int a = numeric_cast<int>(floatVar); should I propagate bad_numeric_cast up to main?
 
user142019
@DeadMG no you can match _ (anything) if you want.
 
Xeo
_ is awesome
 
Why am I even participating in this conversation when you obviously have never written any functional code
@CatPlusPlus Stop talking you fucking idiot
 
user142019
data MyCustomType = SomeError | SomeOtherError | SomeOtherOtherError | Success SomeType

case foo of
    Success a -> print a
    SomeError -> meh
    SomeOtherError -> moo
    _ -> anythingElse
 
7:15 PM
What a moron jesus
 
user142019
Jesus was indeed a moron.
 
@Borgleader Deus Ex: Human Revolution?
 
so, if I have 100KLOC, a single change will lead to 500 changes in that data types and cases.
ok, that's really useful feature.
 
Yeah we get it, you're not used to real type systems
@CatPlusPlus Stop talking
I want to get drunk again
 
Ell
So it's only for functional?
 
7:18 PM
yeah, I really dunno what "real type system" is.
@Ell it's only for 100 LOC snippets.
 
Ell
@Abyx I think it translates to "Haskell"
 
user142019
@CatPlusPlus Why not strunk?
 
user142019
@Abyx Haskell's.
 
How many times do you add new error types
 
user142019
Seldom.
 
7:19 PM
And how many times is that not a fucking breaking change
 
user142019
Often.
 
Side effects (including goddamn errors) encoded in type signatures is a good thing
 
@wilx Yep.
 
And yes if you do something stupid like that you'll have a lot of code to fix
 
@CatPlusPlus Nah.
 
user142019
7:20 PM
@DeadMG Yah.
 
(Though much of that can be inferred really and you're just bad)
 
@CatPlusPlus nope.
 
JESUS
 
@Zoidberg Name one benefit.
 
user142019
You want the compiler to be able to check as much as possible without it being annoying.
 
7:20 PM
You can deduce ALL DEPENDENCIES from a type signature?
 
@DeadMG: Weren't the helicopters in the first two Deus Ex games invisible/stealth and also silent ones?
 
void f(); // what does f depend on
Maybe some singletons
 
@wilx Dunno.
 
Oh right I forgot you love singletons
 
@CatPlusPlus I don't need it.
 
7:21 PM
Please kill me now
 
user142019
I should write a globals library for Haskell just for teh lulz.
 
IORef
 
@CatPlusPlus So, every time the function's implementation changes slightly, then type mismatch.
 
user142019
That's not global.
 
user142019
It must be accessible from ANYWHERE! :D
 
7:21 PM
@CatPlusPlus What the fuck, just get out.
 
I can't do this kill me
 
then leave.
 
user142019
/kickban 16102
2
 
Mmm.
I wish I could learn something new and exciting. Like a new language etc.
 
user142019
Haskell! Or Erlang!
 
7:23 PM
But I cannot find any strong driving force to do so
 
@wilx Ruby!
 
@TonyTheLion rather
 
Ruby is useful
 
Haskell is hard. I ain't no math genius.
 
user142019
Haskell is simple.
 
7:23 PM
I still have this mindset of wanting to help people write more correct code, but none of the patience to actually get through discussions like this
 
Ruby is like Python, I know Python enough.
 
Many people like Python for its efficient-ness, and Ruby is even more efficient than Python
 
@CatPlusPlus look, if I have add(vector, vector), I might want to use AMP, PPL, what ever without changing any other code. I don't want to propagate information about dependencies just because I changed some_parallel_for to other_parallel_for.
 
as in LoC
or ease of use
 
user142019
7:24 PM
@CatPlusPlus I don't mind.
 
@Zoidberg: I have tried to get into the Haskell coding like since 2001, unsuccessfuly.
 
user142019
@wilx What is the source of the unsuccess?
 
it's fucking OCP, you change one thing and don't touch other code.
 
Ell
@CatPlusPlus can't you infer what exceptions are thrown from a function too?
 
Back to horribly hilarious let's plays
 
7:25 PM
Once you get beyond simple stuff you get hit by monads or arrows and that is where I break.
 
@wilx It's on invitation only
 
I don't want to talk about programming ever again
 
Apologies accepted
 
user142019
inb4 burnout
 
Yay, my HTML5 game worked! Unfortunately, the player can't move
 
7:26 PM
Yesterday and today I have been looking at Scala. It seems interesting for the functional approach and for the Java interoperability possibilities.
 
user142019
@wilx a monad is just a composition of two adjoint functors where the second one is right-adjoint to the first one.
 
user142019
(Okay, no kidding. Monads are easy.)
 
But I do not have anything really useful to do in it to actually learn it.
 
@Zoidberg um, English please? :P
 
Does anyone know how we manage to get this kind of question every once in a while?
 
user142019
7:28 PM
A monad is any type that satisfies a specific set of laws.
 
Does FB somehow link to SO for support?
 
@Cicada Lol, closed
 
@Zoidberg Kidneys are easy
 
Dear Joshua, please add your credit card number & bank account number to this post so we can further study your case. Thank you. — Cicada 1 min ago
^ ahahaha :D
 
user142019
 
7:28 PM
llolololol
 
> You were asked to verify your identity because our security systems think you might not be using your real name or might have more than one account.
 
user142019
@wilx what part of monads don't you understand?
 
Teehee
 
I wish there was something (useful) between 3k and 10k rep. :(
 
user142019
@CatPlusPlus Systems don't think.
 
7:29 PM
Depends
The system thinks
 
@Zoidberg: That is hard to pinpoint.
 
And I'm not part of it
oh my god
 
AHAHAHAHA
 
OMFG LOL
 
:D :D :D
REALLY?!
he posted his address and bank account number as well
 
7:33 PM
oh my, @Cicada tried to steal money from our fellow SO user!
 
I can't believe this. Are they fake? XD
 
Awww man, I missed people again being clueless about functional programming.
 
they got deleted
but I has a screenshot XD
 
I has too
Time to buy stuff on GW2
 
I'm not actually going to use it... :P
 
7:34 PM
I'll post it on 5chin
 
How stupid can people get
 
stupider
 
How bad can you be at sarcasm
Oh a random person asked me to give them my credit card details I BETTER DO IT
4
 
:D
 
user142019
@CatPlusPlus not as stupid as me, at least.
 
7:35 PM
Why do those people have access to money at all
 
Xeo
@R.MartinhoFernandes You can still try to teach the puppy about monadic computations!
 
How do they keep being alive
 
Xeo
And @Abyx, for that matter
 
I MEAN HOW
How is that even possible
 
@CatPlusPlus magic. or... something. or... I HAVE NO CLUE
 
7:36 PM
No, they don't seem interested in learning.
 
Please don't restart that discussion
 
Xeo
aw
 
@R.MartinhoFernandes You should make a blog post about monads, id read it :P
 
No, I won't.
 
I need a blog
maybe
I would update it about once a year though :(
 
7:37 PM
I mean how can you survive in this world for more than 10 minutes if you lack the basic self-preservation instinct
 
Xeo
@R.MartinhoFernandes But I am! :P
 
I tried to have a blog
About 10 times now
It never works
 
user142019
I liked Let's Mock PHP Users.
 
blog~ i need a blog~
sick of being single~
i think I need a blog~
i need a blog like~
 
@Zoidberg It was retarded
 
7:38 PM
um... okay?
 
user142019
@CatPlusPlus It was funny.
 
blog you need me too
 
user142019
I had a good laugh.
 
@CatPlusPlus yeah, too much effort to keep them updated
 
Nah, it's just not interesting enough
 
user142019
7:39 PM
I never know what to blog about.
 
@Zoidberg programming?
 
user142019
@Doorknob Yes, very helpful. The broadest fucking topic ever.
 
Lol, okay. Um... C++ programming? XD
 
@Zoidberg Narrow topics are better, because there's less to write about, right?
 
user142019
Meh C++ isn't interesting enough.
 
7:41 PM
Ahahaha, will he do this also:
Don't forget your social security number too. — Tommy Crush 1 min ago
:D
 
user142019
@R.MartinhoFernandes Yup.
 
0
Q: reducing memory usage of program

MABI am trying to solve a problem that has a memory usage limit of 0.75 mb I can't make arrays of size 100 000 since it is not within 0.75 mb My program is the following: #include <iostream> #include <String> using namespace std; void main() { char temp; int temp1, num, k, z...

 
(about the guy who gave his credit card num, address, and bank account)
@Cicada "how do i compress a 1gb file into 1 kb" :P
 
@R.MartinhoFernandes that and people know what to expect from your blog
 
easy, you replace the binary 0 and 1 with letters of the alphabet
and it divides the size by 26
even more if you use chinese alphabet
 
7:42 PM
hahahaha
 
@thecoshman Cobwebs?
 
user142019
Coshwebs FTFY
 
@Cicada Chinese don't use alphabets.
 
Thanks for biting
 
user142019
lololol
 
7:43 PM
(I knew someone would :) )
 
user142019
In a movie on TV they use StuffIt Expander.
 
Ell
Does anyone here have an anonymous/guy fawkes/v for vendetta mask?
 
user142019
Does that crap still exist?
 
well, I can't be bothered with this tonight ¬_¬
 
You said a movie? As in, MovieOS?
 
7:46 PM
help plz howto put stuff on screen???????? i dont want 2 "print"......... evry1 tell me to use "print"
 
evry5
 
user142019
@Pawnguy7 wtf
 
user142019
I am watching a movie on TV.
 
user142019
Bellicher; de Macht van meneer Miller is een VPRO-televisieminiserie uit 2010 naar het boek De Macht van meneer Miller van Charles den Tex uit 2005. De serie werd in november 2010 in Nederland uitgezonden door de VPRO. Bellicher; Cel is een VPRO-televisieminiserie uit 2013 naar het boek Cel van Charles den Tex uit 2008. Dit tweede seizoen werd in 2012 opgenomen. De zes delen werden begin 2013 uitgezonden. In 2012 verscheen ook de film Cel, eveneens naar het boek Cel van Charles den Tex. Personages {| class="wikitable" ! rowspan="2" width="25%" | Personage ! rowspan="2" width="25%" |...
 
user142019
This movie.
 
7:47 PM
I have a makefile which is working with OpenGL and it has as linkers -lglut -lGLU -lGL . What should the linkers be when I run in on windows OpenGL ????
 
@Zoidberg Oh the rowspan=2 part is great I've seen it
 
user142019
@Pawnguy7 oh. No just Windows.
 
I am trying tomake it work with MinGW
 
22 hours ago, by Xeo
Hands Stars up for moving all future help-vampire messages over to the Real C++ Room?
 
7:48 PM
@Cicada lol
 
user142019
@Cicada lol
 
@Zoidberg Ah. I thought you were referring to such things, like how in "hacker" movies, you hack people real-time, all secure things have 3d models, etc etc
 
Lol
 
user142019
@Pawnguy7 No this one is decent.
 
C# makes me do some funny things.
Almost 100 overloads for this function. :3c
 
user142019
7:49 PM
This movie was made by people who actually knew what they were doing.
 
A rare find, for hollywood.
 
@georgemano use MSVC.
 
@ThePhD What does this function do?
 
@Pawnguy7 Save the world, 100 different ways.
 
@Pawnguy7 It's not a Hollywood movie.
 
user142019
7:50 PM
@ThePhD /save-all
 
user142019
@Pawnguy7 it's a Dutch movie.
 
user142019
Not from Hollywood.
 
Ah. I am not sure if it is common in movie-making business or just Hollywood to be honest.
@ThePhD Not void SaveWorld(SaveType type) ?
 
Ell
How do you think I'd look in this guise? amazon.co.uk/CAPTAIN-FULL-LENGTH-Helsing-Duster-Leather/dp/…
 
user142019
@Ell how do I know.
 
7:51 PM
@Ell Get matching boots and Yeee~
 
user142019
I have never seen you.
 
Too bad it costs like
400 USD.
 
> Made from Genuine Real Soft Lambskin™
 
@Doorknob Bad.
 
Hm.
Looks like I'm gonna need RectangleF.
 
7:54 PM
@CCI ?
 
I hate using those prefixes though.
and Suffixes.
Wonder if there's another naming scheme I can get...
 
user142019
Oh this movie has a sad end. Cool.
 
@ThePhD as I hate using -webkit-transition, -moz-transition, and ten million other prefixes for CSS :(
 
@Doorknob :D
 
0
Q: Java - How do i select elements from this div?

user2160958I want to get the date from this div: <div class="pandatacontcol" style=" width:160px;"> <h6>Date Qualified</h6> <p id="QualDate34868684">2013-03-08 12:04:01</p> </div> so output would be ...

 
7:56 PM
Webdev is a nightmare. Until they do a clean-sweep nuke, it will always be a messy hodgepodge, like all long-standing software that didn't think it'd have a future.
 
user142019
@Doorknob Use LESS and LESS Prefixer you noob.
 
@Zoidberg 1.) I don't like libraries though 2.) I'm Dork noob ! (anagram of Doorknob) :P
 
user142019
CSS is terrible.
 
user142019
LESS is less terrible, hence the name.
 
Lol
 

« first day (883 days earlier)      last day (4071 days later) »