« first day (1711 days earlier)      last day (3463 days later) » 

13:07
I love hunting for duplicates. Note how similar the titles are :)
The duplicate also contains my most controversial answer, apparently.
anyway
I've decided to not add any new features to Hate right now
user1804599
@fredoverflow link
and to add another, bigger sample
11
Q: rand() generating the same number – even with srand(time(NULL)) in my main!

Nick SweetSo, I'm trying to create a random vector (think geometry, not an expandable array), and every time I call my random vector function I get the same x value, though y and z are different. int main () { srand ( (unsigned)time(NULL)); Vector<double> a; a.randvec(); cout << a << endl;...

Curiously, I didn't get a single downvote on basically the same answer for this question:
4
Q: Mysterious random number - wanting to be the same even after "srand()"

太極者無極而生 Possible Duplicate: Rand generating same numbers The following is tried when answering another question on StackOverflow: #include <time.h> #include <iostream> using namespace std; main() { srand ( time(NULL) ); cout << (float) rand() / RAND_MAX << endl; cout << ((float) rand...

My most controversial answer is "read binary to struct"
user1804599
13:14
@fredoverflow lol
@rightfold lol
3
A: Parsing a binary file. What is a modern way?

Mr. kbokThe C way, which would work fine in C++, would be to declare a struct: #pragma pack(1) struct contents { // data members; }; Note that You need to use a pragma to make the compiler align the data as-it-looks in the struct; This technique only works with POD types And then cast the read...

Train wreck
user1804599
-1 for endianness.
@buttifulbuttefly just sayin
user1804599
You first have to write a C++ library for this, since there isn't one yet, such as this one: github.com/rightfold/baka/blob/master/include/baka/binary.hpp
13:16
@Mr.kbok That's not a modern way, that's an extremely brittle way
user1804599
And then write a sane I/O library, which doesn't exist yet either.
user1804599
And only then you can start worrying about parsing binary files.
@rightfold Usage plz
@CatPlusPlus What is though
user1804599
@Mr.kbok github.com/rightfold/baka/blob/master/test/binary.cpp (pipe returns a reader and a writer in a pair).
What is what
13:21
@fredoverflow rand is Hitler
@milleniumbug That reminds me of modules not making it into C++17 :)
also Kung Fury
Talking about fury, I wathed this movie called "Fury" over the weekend
Kung Fury was great
I didn't see that
I wonder when us regulars will be in our 50's whether any of us will still frequent this place
or whether we'll have gotten something resembling a real life...
user1804599
@Mr.kbok Baka's I/O and binary encoding libraries are pretty much C++ translations of golang.org/pkg/io and golang.org/pkg/encoding/binary.
13:25
I doubt SO will be still alive in 30 years
it probably will be in one form or another
@milleniumbug yea, perhaps only under archive.internet.com or something
@TonyTheLion We won't all be 50 at the same time though.
but I don't think we will still be here on this chat in 20-30 years time ... knowing how internet works
@Nooble well I never...
13:27
Heh.
what will C++ look like in 30 years?
it will probably have turned into Jabbascript
No, only Perl
@milleniumbug Do you think programmers will know what "stack overflow" even means in 30 years?
notMember :: Ord k => k -> Map k a -> Bool
god
Haskell might be really dead by then
13:28
why.
why the fuck
who would do that
or maybe it will thrive?
@fredoverflow Good point.
god knows assembly language may have monads in 30 years
:P
@fredoverflow right
@rightfold It sucks. It's not any better than 90's binary Java API
13:29
Will we even need programmers in 30 years? Aren't managers supposed to be able to draw UML diagrams and generate the code from that? ;-)
Countless companies tried that.
We still deal with that stupid idea here.
> draw UML diagrams and generate the code from that
oh god why
ugh fuck autoconf and the rest of the gnu garbage
fuck libtool
@TonyTheLion billion dollar idea
lets do it
13:31
@TonyTheLion I wonder why people assume monads are so arcane
its a terrible idea
Fucking hell, LISP is unreadable
horrible shit
@BartekBanachewicz I never said they were arcane
they are just a mean of putting a common interface on things
13:32
Why are you writing in LISP
@BartekBanachewicz I have nothing against monads
user1804599
@Mr.kbok yet way better than everything C++ has.
The language's name is Lisp now
@rightfold Boost has this already. We need a way to serialize data, not write bytes one-by-one.
Lisp is a language family
LISP is the first dialect
hth
13:33
it helps
thanks cat
In other news this project is going to explode
@milleniumbug Have to read it
@TonyTheLion Big cat is thanking the improved cat
In other news my code is shit
@milleniumbug us cats must stand up for each other
@CatPlusPlus Seriously, what is a modern way. rightfold's 10-line function doesn't count.
13:35
Can I borrow a LISP to C++ translator
> modern
I'm tired and there's still shitload to do and apparently I'm responsible for the switch from old site to new and I'm gonna die
> endianess
choose one
@CatPlusPlus Finally some good news
3
13:35
@Mr.kbok There is only one way, get an actual parser
Port of Python's struct to C++ would be great
user1804599
GAMMA_SOURCE: _('γ Source'),
user1804599
look how cool I am greek letters
One could write a constexpr function that creates a parser
@CatPlusPlus Define a grammar based on binary elements?
Is that the modern way
user1804599
13:37
Use Parsec.
Yes that is how you parse things
user1804599
Or actually use a parser combinator library that doesn't specialize 90% of combinators for Char.
It doesn't matter if you're parsing bytes that correspond to letters or not
BREAKING NEWS: Parsers parse things.
sdd
sdd
No shit sherlock
13:38
This dumb "omg binary" thing is dumb
user1804599
TIL dumb things are dumb.
Parsec? It's a C++ question
You're just trolling.
13:40
> mit godverdammten Lasern
maybe it's time to plonk pantoona
@rightfold Good. Now go be bored
@Griwes who is that?
@TonyTheLion pantoona.
@TonyTheLion a.k.a. райтфолд
rightfold from the time he used these funny cyrilic letter transliteration of his name
13:42
What does cond ((< n k) n) mean in lisp
What Lisp
@Griwes is that rightfold in a previous incarnation?
@Columbo (< n k) is n < k
@milleniumbug I deduced that
I mean the fact that cond is called with two parameters or some shit
@TonyTheLion yes
13:43
(cond
  ((< n k) n)
  (t k))
cond is like if/else ladder
user1804599
(cond ...) is just select (true) { ... }
Oh look you can google it
13:44
Fuck LISP, too stupid for infix notation
there's nothing wrong with prefix notation
Fuck infix
I'd go out on a limb here and say Wide is better
user1804599
Use Nok.
it's the parens that complicate shit
13:44
It's inconsisent with the rest of the language
RPN was made precisely to avoid having parens
so what lisp did was obviously to take prefix notation and require parens everywhere
@Griwes The only reason I don't turn rightfold into plonkfold is because there's good giggles to be had.
RPN doesn't work with variable arity
fuck variable arity
@TonyTheLion rarely :F
13:45
use lists
user1804599
Use Nok.
here we go again
And why the fuck do they use defun to define functions. Use define, deffun or somethin', but not that
fuck zip, zip3, zip4, zip............
user1804599
It has prefix notation and few parentheses!
13:45
@Columbo because it takes the fun out of the language
2
@BartekBanachewicz You'll go to pun hell for that
Use Vapor, it doesn't exist yet!
Because it's a historical thing who the fuck cares
@Griwes amazing
jesus christ you people whine about the most irrelevant things I swear
13:46
@Columbo It's fun
the interview was pretty fun
said cat who whines all the time
@CatPlusPlus It's weird that you're the guy to call it out
@CatPlusPlus then stop swearing irrelevant things
@BartekBanachewicz Oh, so you did not plonk me? :D
13:46
first in-person interview where I had to solve things :\
@Griwes for that discussion
before I only got tests and was left alone
May 21 at 13:15, by Tony The Lion
lol rightfold's opinions
3
@Columbo Yeah no
@BartekBanachewicz serious square(x: Int) = x * x
13:47
lel
also Haskell is annoying WTB a better language
Elixir looks fun but fuck me lack of static typing
@CatPlusPlus it's not better
Use Agda or Idris
@BartekBanachewicz Vapor... though it doesn't exist yet.
hides
13:48
@CatPlusPlus it has implicit state, implicit IO, requires you to write shitloads of useless code, no function composition, no monads, requires parens on calls
ADTs are shit, optionals are fucking joke
types are nullable by default
oh no not the parents
it's still a pretty nice language, which only shows how shit the languages are in general
Does C# have class parameters yet? like class Rational(int num, int den)?
13:49
languages are irrelevant
What's class parameters
but yeah no it's still worse than Haskell by a long shot
@fredoverflow scala
@milleniumbug yeah no
13:50
REQUIRES PARENS
@milleniumbug I dare you to write your next project in Brainfuck, then.
every tool is relevant, be it language, ide, compiler, analyzer whatever
@milleniumbug Then fuck off and join the Java room.
The fuck is implicit state anyway
Or implicit I/O
@fredoverflow C#6 does
13:51
@CatPlusPlus implicit context
@CatPlusPlus Implicit FOO is FOO not explicit in the type system.
@Fred they're called primary constructors and yes
I like my functions to be pure if I don't say they aren't TYVM
@fredoverflow Java isn't that bad, frankly. The language itself is bad, but IDEs and frameworks actually work.
13:51
does C# even have a "pure" specifier
@milleniumbug framekindaworks
The important things
or they didn't think it's useful enough
@BartekBanachewicz Not even F# has that, why would C# have it?
@CatPlusPlus they're important for me.
13:52
Because you're clinging to stupid things
@fredoverflow who said F# is a perfect language
@CatPlusPlus your stupid
Sure, libraries and frameworks matter, languages not so much
@CatPlusPlus lel
Pole battle, engage!
13:52
e.g. most C++ libraries are shit
@milleniumbug I wish you could feel the pain I currently feel trying to write my compiler thingy in C++.
The main source of that pain is the language itself.
Did anything change in reference collapsing rules or something?
C++14
@Griwes then why do you use C++ :o
@BartekBanachewicz because templates
Because he's clinging to stupid things too
13:53
also I wanted a language I know
@R.MartinhoFernandes Nope, they're still the main cause of collapsing while programming C++
> Kim Jong-un claims to have cured Aids, Ebola and cancer with single miracle drug
:O
If I were to write this in Haskell I would be much behind what I have now, because I'd have to be constantly learning the language.
user1804599
Hero.
it's easier than you think vOv
13:54
@sehe the philosophy related to AIs is always good but don't destroy the wonders of the world :A
those are dreams
now for real, what really really annoys me in Haskell are records
other than that...
user1804599
use Go <3
@CatPlusPlus I like how you assume you're not clinging to stupid things
I never said that
Forget that. C++14 breaking changes is what I'm concerned with.
13:56
@rightfold if i were to use anything else I'd use Swift
user1804599
I don't know Swift.
@BartekBanachewicz No, not really. I could rewrite all my programs in imperative languages to Haskell and use RWS + IO all the time, but that wouldn't be a good Haskell code.
but Swift has no open compiler yet
user1804599
I should learn it.
13:56
+        public void Start() {
+            lock (_lock) {
+                foreach (var daemon in _daemons) {
+                    Start(daemon);
+                }
+            }
+        }
this is the kind of shit that would drive me crazy
Because see above
user1804599
Then you're a really bad programmer, since this code is really simple.
5
It's simple, it doesn't need to be anything else
it's primitive, not simple
@BartekBanachewicz people/languages cannot into fmap :F
13:57
No, it's simple
@Griwes people equals cat here
also yeah star rightfold calling others for being bad programmers
6
You just need to get down from your pedestal.
@BartekBanachewicz Yeah, that brace placement is horrendous.
It's readable and immediately understandable
13:58
Do explain what's primitive about that code.
@R.MartinhoFernandes and what, write C?
Writing myself an fmap was the best thing I did in C++ recently.
@BartekBanachewicz What would you do instead? Rewriting it to use map would be a horrible choice if there are side effects
This is not a map, so using fmap here would be dumb
It would also not change a thing.
13:59
(these are daemons, of course there are side effects)
@milleniumbug map doesn't imply concurrency
It would make it less readable, that's a change right?
@CatPlusPlus it would make it more readable, dummy
@Griwes No it implies pure functions
Concurrency is irrelevant
13:59
@R.MartinhoFernandes it uses explicit, manual thread locking and unnecessary iteration
@milleniumbug wat
lol unnecessary iteration
@BartekBanachewicz This is the kind of attitude that drives you crazy :/
That's why you have map and forEach in Java 8 streams

« first day (1711 days earlier)      last day (3463 days later) »