« first day (1843 days earlier)      last day (3332 days later) » 

Ell
Ell
16:00
> solve :: Puzzle -> Maybe [CompassDirection]
> solve start = runST $ do
>   closed <- newSTRef $ Set.empty
>   open <- newSTRef $ Set.singleton start
>   cameFrom <- newSTRef $ Map.empty
>   g <- newSTRef $ Map.singleton start (Just 0)
>   f <- newSTRef $ Map.singleton start (Just 0)
>
>   while (((Set.empty) /=) <$> readSTRef open) mainLoop where
>     mainLoop = do
>       current <- head $ min $ filter (\(_, x) -> Set.member x open) f
>       return []
here is my attempt at A* so far
user1804599
Now get rid of ST.
Ell
Ell
yeah it doesn't work because you can't access outer variable from inside do apparently
Idk how to write A* in a functional way though :V
maybe I should try a regular state monad
@sehe indeed :D
user1804599
Yeah, where doesn't work like that.
Ell
Ell
@Elyse how would you proceed?
user1804599
16:03
f x = g y where g z = z has three scopes, here delimited by imaginary brackets: f x = [ [ g y ] where g z = z ].
@Ell Are you using int maps to represent graphs by hand?
Warner Bros is offering refunds to all Batman: Arkham Knight PC owners
...
Can you get a refund if you got it for free with the Nvidia promo of a purchase of a GTX 980?
Ell
Ell
@LucDanton No, the int map is from node -> cost
well
how do people like this even remember to breathe
Ell
Ell
I have a function neighbours Puzzle -> [Puzzle]
I suppose a Puzzle represents the data and neighbours neighbours
user1804599
16:06
@Ell what is while?
Ell
Ell
> while :: Monad m => m Bool -> m a -> m ()
> while condition body = do
>   conditionValue <- condition
>   if conditionValue
>     then body >> (while condition body)
>   else
>     return ()
my feeble attempt at writing imperative code in haskell
user1804599
@Ell start here:
user1804599
solve :: Puzzle -> Maybe [CompassDirection]
solve start = go Set.empty (Set.singleton start) Map.empty (Map.singleton start (Just 0)) (Map.singleston start (Just 0))
  where
    go closed open cameFrom g f = ... -- recursive function
Hello everyone! I'm (very) new to C++ and this is my (very) first project: github.com/ForceBru/Matrix . It's about matrices and operations with them (eg, you can add/multiply/square them, etc). I was just curious whether it's written OK, whether the code is too ugly or not. Any tips & tricks are appreciated
@ForceBru you want to open up a new question on codereview.stackexchange.com
user406009
16:08
@Ell that function already exists. It's called mfix.
that way you will get exhaustive reviews
@Ell How comfortable are you with Maybe?
something that you just won't get here for a whole project
it sure looks sexy but I'm not a C++ programmer :P
Ell
Ell
@LucDanton Not comfortable enough for this, I think
I will go with@Elyse advise
user1804599
@ForceBru Don't define classes and functions in the global namespace. Derive exceptions from std::exception (usually std::runtime_exception, which can already store a string). this-> is often redundant. Random need not be a member function of Matrix.
Ell
Ell
16:10
I think my professor will be happier to see that anyway
@AlexM. I doubt anyone will want to examine the code closely. I just thought someone would be interested or something.
people do examine code closely on codereview.se, they do it for reputation
but if you can find opinions here, sure
@EtiennedeMartel The test(aaa); is equivalent to test aaa;
@JerryCoffin Yeah, that's what I realized. Fuck that grammar.
@Elyse i tried to derive an exception from std::exception, but I wanted to make an alternative constructor that'd accept char * as argument and failed. So here you are an ugly workaround :)
BTW, I'm not so sure what container to use: std::vector or std::valarray. Both seem to be almost identical...
Any advice?
user1804599
16:14
class SizeException : public std::exception {
public:
    SizeException() : msg("Size mismatch") { }
    explicit SizeException(const char * msg) : msg(msg) { }
    const char* what() const noexcept override { return msg.c_str(); }
private:
    std::string msg;
};
Use std::valarray only if you want to use its indexing/slicing capabilities.
user1804599
You don't need the destructor at all.
user1804599
It is generated by the compiler.
@Elyse , wow, cool, seems difficult to me, I still have a lot to learn. Thanks, though
16:16
@EtiennedeMartel Yeah--hard to tell where to draw the line though. The compiler tolerates unnecessary parens a lot of places. In something like a = (b + c) << 8;, the parens are unnecessary--but few have memorized full precedence to be sure whether the inner ones are or not (and I'd guess most would prefer they were left in). At the same time, you're right that it does lead to allowing some things almost nobody really wants or likes (such as you've shown).
const char* what() const noexcept override that function signature
lol C++
@TonyTheLion , that's a trick I've seen that frees the memory associated with M. I've heard that shrink_to_fit() may not do its work properly
@TonyTheLion That is pretty awful. Should obviously be char const *...
user1804599
std::vector automatically frees memory.
user1804599
You don't have to worry about it.
16:18
@ForceBru std::vector takes care of its own memory when destroyed though
@JerryCoffin this
@ForceBru There’s clear(), shrink_to_fit does something else.
should be ptr<const char>
Um, really? Didn't know about this.
@milleniumbug should be std::string because fuck const char*
16:19
Ugh, silly pointer shit
user1804599
should be not there at all because fuck exceptions :P
@Elyse Google will agree with you there
should be not at all because fuck C++
:P
user1804599
Total function master race.
16:20
@LucDanton and clear is said to be lazy shit that doesn't free memory as well
@ForceBru you don't need that dtor
vector will take care of itself
you haven't newed anything explicitly
so leave the compiler to generate your dtor
@ForceBru Oh yeah. It does destruct all elements though, which shrink_to_fit doesn’t.
@ForceBru This is a little like saying you've decided to buy a pet dog because you heard some cars with automatic transmissions will shift out of first gear, even if you move the selector to "1". The latter is actually true, but seems quite unrelated to pet dogs.
hi chinatsu
16:22
hi chicicadatsu
@milleniumbug I hope you don't remember me
Neither you @AlexM.
it's vague but I remember your name
were you that guy?
@JerryCoffin maybe. I've come from C and now trying to free everything I can and cannot in C++
@AlexM. I'm that guy. That. Guy.
16:24
ok it's clear then, you're that guy
@ForceBru That explains things. C holdovers can get in the way. I suggest a book.
Oh yeah, I remember that guy
@AlexM. wait, aren't ya an user of A&M SE?
Jun 13 at 20:08, by Lucas Henrique
@NateKerkhofs These guys are very smart and funny. Sometimes annoying :P.
@LucasHenrique I did chat a bit two years ago
but I rarely visit now
16:26
Jun 13 at 19:56, by Lucas Henrique
What's the main difference between modules and a big function that call others functions?
ahahahah
Damn you @Jefffrey ugggh :p
:D
The interwebs are forevers
@LucDanton I've read a lot of blogs that were saying it's very freaking bad to start learning c++ when u already know (some) C
Jun 13 at 19:59, by Lucas Henrique
jesus fucking christ
why would jesus fuck christ
16:28
Jun 13 at 19:59, by Lucas Henrique
i'm out of this shit
lol
Not even 5 minutes in this chatroom
"I was too childish"
@ForceBru Not learning C++ is indeed always an option.
I'm glad luc doesn't have you plonked yet
@LucasHenrique two months ago or so
@ForceBru My advice would be to ignore the fact that new and delete exist at all for at least the next six months. Anytime you think you need to allocate something dynamically, chances are at least 100:1 that you're wrong. On the rare occasion that you really can't avoid it, you probably want to use a unique_ptr with make_unique (or possibly shared_ptr with make_shared, but that's even less common).
16:29
( please try to get the ' " ' @AlexM.)
@LucDanton but why not? I already know some Python and C, so why not try some C++
I was just in a bad mood
@ForceBru Why not what?
bad moose
I was just I robot
16:31
@Mr.kbok @Jefffrey too late
@LucDanton - why not learn some C++
@LucasHenrique it never is
@ForceBru I don’t know. Do what you want.
@LucasHenrique it always is
@LucDanton , so do I
16:32
@ForceBru lol
mooseblown
or so I do?
is this guy some kind of a lesser abyx
softcore mode abyx
@copy paste
@ForceBru If you want to learn C++, go for it (but be aware that, yes, to use C++ at all well, you'll have to actively unlearn things you've learned in C. Despite the similarity in syntax, well-written C++ rarely looks much like well-written C for the same task.
16:33
How you doing buddy?
'Do what you want' -> 'so do I' should be nonsense, to my mind. It should be 'so I do', am I right?
@Jefffrey hi
@Jefffrey Good, you?
hey copy hi
@ForceBru Yes.
lol, I am using the cellphone (can't see active users) and I did not expect someone called @copy
16:35
@JerryCoffin I'm learning C++ and English at the same time
@copy Good enough
anyways hi @copy
@ForceBru that's a hard tho
@LucasHenrique but interesting. Just because of such situations as above (with 'so I do' & 'so do I')
@ForceBru it should be actually "do so I"
@LucasHenrique Learning English is hard enough without distracting him with nonsense.
16:39
@JerryCoffin man sorry am I
@JerryCoffin it's also cool to actually understand nonsense
It should have been "I so do (your mum)"
I'm my mum and I find this offensive
@Jefffrey do english-speaking ppl also have this expression? No, that can't be true...
Ell
Ell
okay I need to order a Data.Map by some particular function
16:41
Or am mistaken I
@LucasHenrique The biology involved in "I'm my mum" seems quite far-fetched.
You should have seen your mum's expression last night
Ell
Ell
I feel like doing instance Ord where (Puzzle, Int) is either impossible or ill-advised
@Ell That ain't valid syntax
Ell
Ell
Ah there you go :V
16:43
And defining specializations of (a, b) requires at least 1 compiler extension, because ordering for (a, b) is already lexicographically defined
@Ell newtype could be a lesser evil there
Ell
Ell
meh maybe I should just give up
newtype is the way to go, yes
Thanks Luc
Ell
Ell
I have 1.25 hours
In 1864, Boole walked two miles in the drenching rain and lectured wearing his wet clothes. He soon became ill, developing a severe cold and high fever. As his wife believed that remedies should resemble their cause, she put her husband to bed and poured buckets of water over him – the wet having brought on his illness.[17] Boole's condition worsened and on 8 December 1864, he died of fever-induced pleural effusion.
Ell
Ell
16:45
there is no way :/
too much logic
A pleural effusion is an abnormal amount of fluid around the lung.
Can you imagine the guys at Vevo?
They bought Rick Astley's song
And they are making sweet sweet money over it
Like around $152'418,44
didn't they buy it after rickrolling became a thing?
16:50
Yes
@Mr.kbok Pretty sure they didn't exist before it became "a thing"...
@Ell You should have asked Bartek to help you. His expertise in Haskell could surely have saved you time doing that exercise :P
@JerryCoffin what do you mean? I'm no expert meme historian there
a meme expert
surely thats a job description already?
@Mr.kbok I mean I'm pretty sure rickrolling was happening long before Vevo existed. Certainly long before I'd heard of Vevo, anyway.
16:52
It might sound crazy, but Vevo might have existed before you heard of it
Xeo
Xeo
Hey @Mr.kbok, you needed a MeetingCpp ticket? jetbrains.com/cpp/meetingcpp
@Jefffrey Founded: December 8, 2009
@Xeo lol sure
@TonyTheLion An expert is a person who learns more and more about less and less until he knows everything about nothing. Given that nearly all memes are nothing to start with, it would appear that anybody who knew anything about memes (at all) would probably qualify as an expert (n/0 = infinity, or any positive value of n).
10
@Jefffrey Impossibru!
@JerryCoffin hahaha
16:55
@Xeo Maybe I should just work at jetbrains, where they pay meeting c++ tickets to their employees
@JerryCoffin nice
@JerryCoffin Is 0 positive? Because 0.0/0.0 is NaN, not infinity ;)
I moved all my documentation to the GitHub wiki. It seems so much cleaner now :D
@Morwenn Neat
I guess I can also hide the images in the not-seen folders of the documentation repository instead of uploading them on imgur too.
Yeey more UI work
17:09
@Xeo No. I'm quite behind on the Gundam stuff.
Fuck, I can't checkout the documentation repository because there are colons in the name of one of the articles.
@fredoverflow No. Zero is non-negative, but not positive, though I realize some languages (e.g., French) do a poor job of separating the two.
Colons are valid in filenames
@CatPlusPlus Lol, not on Windows.
17:13
Oh, right, drive separator
even if it was the implication is useless
Yeah, that's annoying.
Report it as a bug, the wiki software should sanitise the filename
Regarding code by @Elyse: GCC is failing to compile this :(
@CatPlusPlus Not just that. c:/junk.txt:trash is a valid path too. In this case, trash is a secondary stream that's part of the junk.txt file. Only woks on NTFS though.
@ForceBru gcc 4.6.3? Did you find that in some ancient archive, or did you personally transcribe it from the original Egyptian hieroglyphics?
17:17
other compilers perform well, including GCC on Mac OS
@JerryCoffin that's what Travis CI offers
@CatPlusPlus Good idea. I might just do that.
@JerryCoffin maybe there's some option to configure to get the latest compiler?
@ForceBru Force it to use another compiler.
@ForceBru If it doesn't support newer compilers (though that seems ridiculous), you might as well throw it away and use something else that does. The point of a CI product is to improve productivity, not destroy it by restricting you to an ancient dialect of C++.
The addons and install parts are probably what you're looking for.
17:23
@Morwenn okay, I'll try it, thanks
I never work with networking in C++, almost always use Python
@Elyse Guy Steele - 50 in 50 is supposed to be super funny.
But I'm going to use it in a big project
something like “Everything/anything else” What do you need "anything else" for if presumably "everything" covers everything... — Borgleader 18 secs ago
17:25
@ElimGarak What's the best Star Trek movie? First Contact?
@ElimGarak NOooooooooooooooooooooooooooooooooooooooooooooooooooooooo
Hey @AllPros, what do you use for networking in C++?
I tried boost once... linking errors
15
Q: Networking with C++

TopGunCoderHey, I'm a newcomer to using C++ but have got a general Idea of its syntax and useability. I want to learn how to communicate over networks through C++ programming though but I can't seem to find any tutorials for C++ specifically. Does anyone know any good resources to learn about networking wit...

78
Q: Best C/C++ Network Library

HortitudeI haven't done work in C/C++ for a little bit and was just wondering what people's favorite cross platform libraries are to use. I'm looking for something that is a good quick and dirty library as well as a library that is a little more robust. Often those are two different libraries and that...

@fredoverflow Probably, but it is not merely about the movies. It's about being wrecked by idiots, moving off to alternate timelines, the death fetish. The movies have barely been a thing for 5 years and they've already destroyed primary timeline Romulus, alternate timeline Vulcan and alternate timeline San Franicsco.
@ElimGarak Its just shorter to say that they've ruined all of it =/
17:27
yup, fuck them all /cc @R.MartinhoFernandes
Also the ship looks like it came out of a fucking apple store
iEnterprise
@fredoverflow are these even valid question?
@ElimGarak Can't you simply not watch the new movies and pretend they don't exist? :)
@LucasHenrique If it's not a valid question, why are you asking it here?
@ElimGarak i don't like star wars
@CatPlusPlus I thought this was about Star Trek?
17:28
@fredoverflow Had CBS retconned the movie bullshit and just continued a the show 20 years from DS9, that would be okay.
@fredoverflow Cat is gonna cat. :P
@fredoverflow yes i don't like star wars
@ElimGarak Not any worse than any other reboot
@fredoverflow it's obvious.
Forget it's related to anything with the same name problem solved
The problem is that JJ Abrams openly stated that he is a Star Wars fanboy and absolutely hates Star Trek and that he wants to create something that will appeal to his retarded sensibilities. But yeah, in essence, I agree. I am done with Star Trek as of Enterprise.
17:30
Jul 6 '14 at 18:58, by Borgleader
@AaronKyleKilleen Public service announcement
Not valid for SO because it's opinion only. That's is why I ask it here
the only star wars i watched was voyager
**Star Trek:** Spends millions on well known scientific advisors to ensure that even if technology shown isn't available or even likely to ever exist, at least its plausible.
**Star Wars:** Fuck science! So what if our ships travel at light speed (meaning hundreds or thousands of years for a one-way trip) and we're too stupid to know what "parsec" means! We've got light-sabers, man! The nerds love us!
Haha plausible
Written without a hint of bias
Or irony
There's a big difference!!! In one they occasionally war while on a trek; in the other they occasionally trek while always at war.
parsec is a parser library
Also, what the fuck does this mean?
It will also "be distributed concurrently for television and multiple platforms around the world by CBS Studios International."
They mean streaming
hmm, think I dumbed it :)
Yeah, that's dead after one season.
17:32
@Borgleader I have been using chat for months or years. I'm on mobile. Not like I can use the reply button
Good eve @all from Antarctica.
6 seasons and a movie
They already have a moive
Both SW and ST are equally bad and anyone arguing which one is better is a ridiculous nerd anyway
Star Trek is better because there's more of it ;)
Star Wars is just 6 movies, right?
17:34
No
Star wars is bearable, star trek is not.
5 movies? 7 movies? Something like that...
@fredoverflow There were 2 tv series
There's shitton of books spinoffs and whatevers
@Borgleader Really? Never heard of it.
17:35
@decltype_auto Pics or it didn't happen :)
Successful franchises don't stop
ever
Franchise gonna franch?
@fredoverflow Star Wars: gets the science all ridiculously wrong and thoroughly implausible. Star Trek: Spends millions on advisers, and still gets the science all ridiculously wrong and thoroughly implausible.
I comes down to orion women episode of Archer's ENT vs Leia's gold bikini .
Does Star Trek actually have scientific advisors? I thought they just made all that stuff up.
17:36
@fredoverflow Unfortunately, no. It's also an animated series, and a bunch of other crap.
@JerryCoffin But uses more fancy sounding words!
Nope, writers basically pick a social issue of today and leave [cinch here] placeholders. Literally, I am not joking.
in essence star trek is cinch
5
who cares though if the science is wrong, its about entertainment.
@TonyTheLion pics of what, pls?
17:37
Yes, and the TNG/DS9/VOY era has been great and still is, this 2409 bullshit is bullshit.
Nerds care, that's what makes them ridiculous
@decltype_auto Antarctica.
@fredoverflow Honestly, I doubt it. A guy who a decent grade in a high school physics class would know enough to toss out at least 95% of the crap they toss around.
my favourite sci fi space opera is hercules
@TonyTheLion: I contributed the background image.
17:39
SW focus more on the "Fiction" part of "Science Fiction" and ST fans focus more on the "Science" part
Every high budget sci-fi production has science advisors
Science Fapping
They mostly make up words that sound scientific and important
@CatPlusPlus I'm thinking of 'interstellar'
The best advisors are the ones that worked for "Mr. Robot"
17:40
Science advisors and scientist advisors being two separate concepts.
Interstellar had some horribly silly stuff in it too
@decltype_auto what?
Still better than SW and ST combined
ST "science" would go with Gach better w/o Heisenberg Compensators
Interstellar was progressively more a piece of shit the more the movie went on. But dat soundtrack.
17:40
@CatPlusPlus like?
@TonyTheLion: don't u c the white background image of the page? That's Antarctica.
@ElimGarak Culminating in "Love is the fifth dimension" or something
@decltype_auto What are you on? What background image? Where?
@JohanLarsson The fucking tesseract powered by love?
A movie is not a paper for peer review you know.
17:41
@JohanLarsson this ^^
That WTF moment were you see two space cops approaching
Its SCIENCE FICTION, you must remember the FICTION part guise.
@JohanLarsson Unlike papers, movies are subject to criticism from everyone and their grandma, tho.
@CatPlusPlus People in general care about all sorts of ridiculous crap. My wife cares that I remember what she was wearing on our first date. Sports geeks care about who got what score in some stupid game decades ago. Car nuts care about the top speed and acceleration of their cars, even though they're in city traffic, moving slightly slower than a fast bicyclist. Life goes on.
@JohanLarsson So? Nobody asks for 100% accuracy
Ell
Ell
17:42
okay 20 minutes to go
@ElimGarak yeah true
3 mins ago, by milleniumbug
Science Fapping
If they were 100% accurate then none of the film would happen
Ell
Ell
> main = do
>   putStrLn "Random puzzle:"
>   gen <- getStdGen
>   (puzzle, newGen) <- (randomPuzzle gen)
>   putStrLn "Solution:"
@TonyTheLion It can still be overdone into 'what the fuck' territory
Ell
Ell
17:43
this is wrong because expected IO
@milleniumbug Just standard Lounge discussions about trivialities which Loungers love to masturbate over endlessly.
Suspension of disbelief is important concept
Ell
Ell
I'm being a vampire I understand but 20 mins pls guise I will repay somehow
Also not sure how a fucking tesseract would be powered if not with love :)
@Ell Fap more
17:43
Interstallar had Kip Thorne as consultant; "Thorne" as in "Misner, Thorne, Wheeler" en.wikipedia.org/wiki/Gravitation_%28book%29
@Ell What?
@Ell let (puzzle, newGen) = randomPuzzle gen
@TonyTheLion Fiction, yes. The "science" should, however, be plausible (or at least self-consistent) enough that it doesn't distract from the story (and both ST and SW fail badly in this respect).
Ell
Ell
@CatPlusPlus thank you v much
As far as I'm concerned hand-waving everything as "wizard did it" is better than silly fancy word vomit that tries to explain things
And then pretend it's accurate somehow
17:46
@JerryCoffin huh, well it never distracted me in ST. I just watched it purely for entertainment. Switch off mind, watch ST. That's normally how I do it. If I want to think about things, I'll write code or something, or study actual science. I suppose I don't fanboy over these SciFi shows.
Like Farscape states "here's a living ship and it can do ftl sometimes" and I'm like 'okay'
Watch Farscape instead of star wars trek
In summary nerds are the worst
Says a nerd.
I am the worst
@TonyTheLion What I found distracting what that they somehow always found nearly the worst possible solution to every problem presented, and (in lots of cases) the solution they'd used in some episode over the last month or two would have fixed the current problem so efficiently the show would have lasted only 10 minutes.
Yes, I realize that would sort of ruin the show from their perspective, but it still pretty much ruined the experience at least for me.
Long-running endless shows have a problem with power balance
17:57
dragon ball z

« first day (1843 days earlier)      last day (3332 days later) »