« first day (947 days earlier)      last day (3991 days later) » 

11:00 AM
@rightfold so you define a function that works on a set of type instances, basically?
 
@TonyTheLion this code gives my cancer cancer
 
Uh
@melak47 Are you around?
 
user142019
@TonyTheLion type class contains a set of methods and you overload them for instances of the typeclass.
 
@thecoshman hahaha
 
I need you to test something in my D3D app for me.
 
11:01 AM
@rightfold hmmm
 
Looks like today is a tea day. Boiling my second pot.
 
One more summoning, and then I can go Black Knight hunting.
@LucDanton Yay, Tea. <3
 
Hi everyone
 
What is the -> operator called in Haskell?
 
user142019
11:02 AM
They differ from C# interfaces in that methods can have default implementations and in that you can make existing types instances of newer type classes.
 
user142019
@TonyTheLion a -> b is called "function from a to b"
 
user142019
It's syntax for function types.
 
user142019
send :: Serializable a => Socket -> a -> IO () means: "for all a such that Serializable a, the type of send is Socket -> a -> IO ()."
 
user142019
=> is like C# where.
 
@TonyTheLion (->) :P
 
user142019
11:10 AM
@thecoshman dat pun.
 
@rightfold Could have made an easier example imo
 
@jalf Mildly cool, I'd say.
 
user142019
@Rapptz even simpler?
 
sort :: Ord a => [a] -> [a]
 
... I'm now concerned that you might be mad scientist software engineer on the look-out for a prospective lair.
 
11:11 AM
Yeah, you know something to get the idea for someone who's never seen it.
Yeah the cat's example of even just fact :: (Integral a) => a -> a
 
add :: Num a => a -> a -> a
 
Is there something like explicit template type parameter?
So that I can turn off deduction?
 
user142019
Yes.
 
user142019
Don't have function parameters containing template types.
 
11:12 AM
...
 
You can make a wrapper or something that can't be deduced, but what do you need that for
If the type can be deduced, it usually should be
 
@rightfold ah right
 
it's an utility random <0,max> generation
 
Only exceptions so far are magic library-language workarounds like std::forward
 
I am afraid that someone might use integer constant and expect double overload
right now I just made two separate functions.
 
11:14 AM
Not your problem
 
well, kinda mine, because I am afraid I might do that too.
 
Also it's already in the stdlib so why are you writing it
 
std::uniform_distribution
 
I am wrapping that one ^
 
user142019
11:15 AM
typename<typename T, typename U>
void foo(U a, U b) {
    static_assert(std::is_same<T, U>(), "fuck you noob");
}
 
lol.
still no.
 
Or yeah two template arguments
 
I thought about using just struct
 
tuple?
 
One for uniform_distribution<T> and another for arguments to be deduced
 
11:15 AM
but imho there should be something like template<explicit typename T>
@CatPlusPlus hm
 
user142019
Write proposal, try to convince commitee, problem solved.
 
But really I don't know what you're wrapping there
 
what would that do?
 
Don't use C++ all problems solved
 
double get_random_double (double max) {
    return std::uniform_real_distribution<double>(0.0, max)(std::random_device());
}
whoever starred that is retarded
 
11:16 AM
It was Zoidberg probably but still true
 
user142019
@BartekBanachewicz Thank you. I don't feel offended at all.
 
user142019
@CatPlusPlus You know me way too well.
 
Quite obvious tbh
 
user142019
:..<
 
@BartekBanachewicz So.. what is your problem?
 
11:17 AM
And why are you using std::random_device here
 
And use mt
 
user142019
static std::mt19937 gen{std::random_device{}()};
 
Unless you're doing crypto with this (ahahah you're not) then you don't really want random_device
 
random_device is short for "I don't care where does the number come from"
IIRC.
 
11:19 AM
random_device is strongest OS random source if possible
 
user142019
random_device is for crypto and for seeding PRNGs.
 
So it's either non-deterministic or useless
 
anyway using mt19937 is weird. There's something like default_engine
 
You probably don't even need MT
 
11:20 AM
oh yes, std::default_random_engine
 
user142019
Use std::rand.
 
LCG is lean and mean
 
rand() % max
 
user142019
@Mikhail Modulo bias.
 
rand sucks for reasons related to being libc
 
11:21 AM
this ^
 
You will never beat the C out of C++
 
user142019
::arc4random_uniform(max) ( Í¡° ͜ʖ Í¡°)
 
@CatPlusPlus There are such situations?
 
@jalf Wanna join tomorrow? foocafe.org/event/javaforum I will attend at least the first one.
 
If you want LCG then use minstd_rand or minstd_rand0
 
user142019
11:22 AM
> JavaForum
 
@LucDanton Sure, LCG works fine for many things and doesn't require humongous state to be kept around
 
user142019
@BartekBanachewicz y u no (double min, double max)
 
wtf, 624 words according to Wikipedia? What's a typical implementation?
 
user142019
min + random(max - min) is annoying.
 
3 mins ago, by Bartek Banachewicz
oh yes, std::default_random_engine
 
user142019
11:23 AM
> LCGs are fast and require minimal memory (typically 32 or 64 bits) to retain state.
 
@LucDanton I don't think you can get down from that
MT really is huge
That 2^19937 period doesn't come from the air
 
I can't numbers either.
 
ooh, this is clever, pear.warosu.org/c++filtjs
4
 
@jalf hey, nice
 
Emscripten is scary
 
11:26 AM
> _UIntType _M_x[state_size];
That is indeed 624 for std::mt19937 with libstdc++.
Fun!
 
@ManofOneWay ah, probably not. Got a ton of stuff to do tomorrow :/
 
It's defined that way
 
@jalf Ah ok. Too bad!
 
Damn, I wish I remembered why my zip_iterator has an is_end_iterator member.
 
11:33 AM
std::copy_if(a.path.begin(), a.path.end(), cross_a.path.end(), [&prefix_a](unsigned p){ return prefix_a.find(p) == prefix_a.end(); });
look ma, no loops.
sigh and probably I will have to shred it anyway because msvs 2010
 
user142019
Why are you copying starting from the end of cross_a.path?
 
hm, now I think of it.
 
user142019
inb4 UB
 
cross_a.path.begin() + div_point
thanks lobster.
I wonder if I am not off-by-1 anyway
 
user142019
Off-by-one's a bitch.
 
11:36 AM
I will find it easy in testing
It's a genetic algorithm btw
 
user142019
easily
 
solving traveling salesman.
 
user142019
Solving traveling salesman using DNA?
 
not exactly DNA
but it uses genetic-like manipulation of results to optimize paths
 
Ugh GA
So many nights wasted on GA
Fuck uni
Anyway, I want Arch alternatives suggestions
(Except Gentoo)
 
11:43 AM
@BartekBanachewicz: Visual Studio 2010 does support lambdas.
 
user142019
@CatPlusPlus LFS ( Í¡° ͜ʖ Í¡°)
 
LFS yourself
 
user142019
Android.
 
Ugh I used to know my way around Linux distros
 
user142019
Take some EPO.
 
11:46 AM
I don't even want to know
Maybe I should give Debian another try
 
user142019
You'll end up like Lance Armstrong: win exactly as many Tour de Frances as I won.
 
But it's Debian
 
user142019
Mint.
 
Just rebranded Ubuntu with more crap preinstalled
 
Gentoo is the distro of the gods
 
yiz
11:48 AM
would you rather prefer windows or mac?
 
Windows
 
yiz
and that's not because you want to play games on it, or is it?
 
Mostly because OSX is a piece of shit
 
My favorite game is Microsoft Office
 
user142019
OS X is great.
 
11:50 AM
You're on drugs Zoidberg
 
Did you try Fedora?
 
I tried Fedora
 
I don't know anyone who has lol
Now I do!
 
Noticeably better than Ubuntu.
 
I don't remember
 
user142019
11:50 AM
Ubadtu
 
Maybe
 
At least when Ubuntu was still being Ucuntu.
 
Oh, Red Hat
I think I've used Red Hat for a while long time ago
 
user142019
openSUSE
 
user142019
Chromium OS
 
11:51 AM
I used openSUSE for a bit too.
It was horrible.
 
yiz
But most web hosts offer Ubuntu not fedora
 
user142019
openSUSE was my first Linux distro and I can't remember anything about it.
 
It's good you don't remember.
It's horrible.
Or, it was.
I remember having it like 6 years ago.
 
I've only used Ubuntu and Mint
 
Jesus fuck, I wanted to shoot myself.
 
11:52 AM
we use suse at the office, runs nice and stable
 
yiz
no redhat?
 
Nope.
 
user142019
I used openSUSE, Ubuntu, Debian, Arch and Gentoo.
 
redhat is for 2001
 
user142019
Gentoo is fav so-far.
 
11:52 AM
Red Hat doesn't exist outside RHEL which is a server thing
 
or an office thing?
 
Maybe, dunno
 
yiz
linux is mostly used for server hosting nowadays anyways
 
user142019
Windows is an office thing.
 
yiz
windows are used for PC
Mac are for apple fans :x
 
user142019
11:53 AM
Try The GNU Operating System.
 
Thank you for this detailed market analysis
 
A PC is a personal computer.
 
yiz
I use all three @ the moment
 
A PC can run Linux too.
 
@rightfold Did that ever come out, hurd?
 
11:54 AM
@Rapptz No, really
 
I'm just saying those PC vs Mac commercials are fucking dumb
 
user142019
@Mikhail It started in 1983 and its kernel still isn't suited for actual use.
 
They're commercials
Also made by Apple
They're dumb by definition
 
user142019
Probably because no person in the world contributes to it since Linux exists.
 
yiz
Bill gates and Steve jobs were frienemies
 
11:56 AM
Microsoft saved Apple from going bankrupt.
 
yiz
freaking google just hates everything (i.e. MS, FB etc)
 
google knows everything
 
@rightfold there is no pun there. Irony yes, pun no.
 
user142019
@thecoshman chicken and egg problem.
 
11:57 AM
LOL this undergraduate has a bug in his code that will make our hardware device repeatedly slam against the table
 
yiz
I am sure my bank doesn't share my financial info with google
 
use google wallet
 
user142019
@Mikhail subtract points for him destroying your hardware.
 
He works in our lab
 
yiz
I use paypal personally
 
11:57 AM
Nothing of value was lost
 
Paypal is crud
 
except about 20 dollars of optics
 
@rightfold a) I don't think that is really part of the joke, but I guess I see your point there b) there is no problem, eggs came first.
 
user142019
Sue him for him trying to destroy your property.
 
user142019
@thecoshman eggs obviously came first.
 
yiz
11:58 AM
More sites accept paypal than google wallet
 
@rightfold indeed, hence no problem... other then idiots
 
Doesn't mean Paypal isn't shitty
 
user142019
Nobody said it was only about chicken eggs.
 
user142019
And chicken were surely not the first creatures to lay eggs.
 
yiz
it does what it's supposed to do
 
11:59 AM
@Rapptz but at least it's accepted
@rightfold s/surely//
 
PayPal can be problematic to sellers
There's little worry when you're just buying through them
 
@yiz "oh, thank you very much for paying for that item, I'll just mark it as shipped for you, should be there in a few days; oh... what's that, you decided to reclaim the payment now that I have sent the item, and paypal fully support your right to do this, and will not consider the fact I have never had a complaint against me after thousands of sails, and you seem to have done this to every seller you have dealt with?"
 
I think I have a problem.
 
Go see a doctor
Or call the police
 
It has to do with commenting.
 
12:02 PM
Depending on the nature
 
meta
 
user142019
@AvoidComments, The Whole Friggin’ Internet
This will tweet periodic reminders to not read the comments sections for, well, pretty much anything, ever. An @OptimistPanda production. (Now in reruns.)
177 tweets, 18.4k followers, following 0 users
 
@jalf I think my toolchains come with c++filt.
 
yiz
well, I usually investigate the other party before I transact with them
 
I.e. I've never had to install it manually.
 
12:03 PM
Thing is, I use to never comment. I just could never seem to remember to do it, or, when in the zone, it just seemed to take to long to document it. Not to mention, when I commented, I REALLY commented - to much. But I don't think no comments are good either.
 
yiz
one of the reasons why I choose to use paypal not my credit card in the first place
 
user142019
Write code that isn't bad.
 
I don't think it is so bad, and by that I mean it is self explanatory. But I still think its purpose needs a bit of explanation.
 
Comments aren't bad, just a lot of them aren't good.
And by a lot I mean about ~99%
 
The other fear I have is that I make them, then refactor, and forget to change them.
 
12:06 PM
@Pawnguy7 for the most part, if you think you need to comment your code, it is not well written. The only normal time you should comment is when you have 'magic values', just to explain why they are set to what they are set to.
 
user142019
Write a tool that integrates with Git and warns you when you have changed code near an unchanged comment.
 
@rightfold lol, there are easier ways to waste your time
 
user142019
I can't not waste my time.
 
@LucDanton sure, but still nice to have a lite version available online as well :)
 
@thecoshman Well, I don't think I can accurately tell what parts need explanation, because I wrote it. Comments are for everybody else, or a year later.
 
12:08 PM
'lite' meaning you don't have to put -t I suppose.
 
@wilx oh thanks heavens
 
@Pawnguy7 try rubber ducking it
 
@thecoshman sorry, can you expand on the meaning of that term?
 
rubber duck debugging
 
@Pawnguy7 explain your code to a rubber duck. It's a technique usually used to help debug code. The idea is that by trying to explain it in simple terms, stupid mistakes will become more obvious.
In your case, where you find that you have explain why you call a function, or what the function does because the name does not make it obvious, you know you are doing something wrong.
 
12:14 PM
I hadn't considered that, but that makes sense. Although, I think the last time I heard something like this, you told it your grandma.
 
yeah, same principle
 
I cannot remember what that was for. I think it was to ensure you had correctly learned scientific concepts or something.
 
the problem that I think a lot of people have when working out what really needs commenting, is they think they need to explain things like velocity += a / t; // add an amount of gravity to acceleration proportional to the time difference since the last update. where as really, if they just wrote velocity += gravity / deltaTime; it would be clear all on it's own.
 
Variable names are helpful. Although, I think I probably lean closer to the to long side.
 
@Pawnguy7 yeah, it's just trying to explain something to someone who does not understand your problem. If you can though, have someone else look through your code. If they find it hard to understand, you have to ask your self why, 99% of the time, it is badly written.
@Pawnguy7 you mean, you would rather have the comment?
 
12:21 PM
No, I just meant that people that advocate shorter variables name might not like my code.
Well, actually, I guess it isn't that bad, but sometimes picks up a bit of... smurf naming.
 
@Pawnguy7 well, you should aim to keep variable names short, but more important is that they are semantic. Favour 'acceleration' over 'a' for example
 
I would just use accel :(
 
well yeah, that's a an acceptable shorthand
 
and vel instead of velocity
 
pos vel accel
all good
 
12:23 PM
well, it does really depend on context.
 
Yes, I think I often don't use shorthand.
 
I either go one letter variable if the type gives enough information and there's not too much ambiguity (e.g. velocity v;) or go full name (i.e. velocity_type velocity;). I don't like abbreviations, but I don't mind formulae. Although I don't like v1/v2 and so on, I'd rather use a long name.
 
if you are on about something like a particle, 'pos' is rather obvious what it is supposed to be, especially as you would have it's type as 'Maths::Vector' (or what ever). But this is the sort of example where perhaps just putting a quick comment for what this is short hand for might not hurt Maths::Vector pos;// position
 
You could do position' for velocity and position'' for acceleration if you wanted to mess with people.
 
@LucDanton ergh, nah. I would not appreciate seeing one letter variable names
@Rapptz is ' valid for the name?
 
12:27 PM
I don't think so.
 
shame
 
f = m * a; kind of deals I find explicit enough.
 
Hmm..
Are those vector quantities or integrals?
 
What difference does it make?
 
None, was a nonsensical question.
 
12:28 PM
@Rapptz you should know that :P
 
@LucDanton see, I think despite being rather obvious what that equations is, I would still rather see force = mass * acceleration (or accel)
 
@Rapptz oh, don't forget position''' as well :P
 
@thecoshman Ya I don't mind that either. It depends on whether I find the formula documentation enough or not.
 
No one likes jerks.
 
12:28 PM
if the context is obvious, code should be shorter where it's reasonably possible
 
@Rapptz :P
 
I don't expect the reader/reviewer to know all formulae in advance. Doesn't make sense, some of those will be very domain specific.
f = m * a though...
 
a**2 + b**2 == c**2
 
o_0
are we just throwing random maths around now?
 
Xeo
a `pow` 2 + b `pow` 2 == c `pow` 2!
 
yiz
12:31 PM
you mean a^2 + b^2 = c^2
 
^ is power in Haskell so it's valid I guess
** is too (though it would return a floating point vs integer from ^)
 
There's (^^) as well.
 
does that just do power or <insert the term that I have forgotten>
 
Ye. Not tower exponentiation or such nonsense :p
 
^^ does power too?
 
yiz
12:34 PM
how about ^_^ then?
 
@Rapptz Say, how much was your record output from C++ compiler errors again?
@Rapptz Ye, on a Fractional context.
 
It was about 15.1 MB
 
In mathematics, tetration (or hyper-4) is the next hyper operator after exponentiation, and is defined as iterated exponentiation. The word was coined by Reuben Louis Goodstein, from tetra- (four) and iteration. Tetration is used for the notation of very large numbers. Shown here are examples of the first four hyper operators, with tetration as the fourth (and succession, the unary operation denoted a' = a + 1 taking a and yielding the number after a, as the 0th): #Addition #:a + n = a\!\underbrace{{}^{\cdots}{}'}_n #::a succeeded n times. #Multiplication #:a \times n = \underbrace{a + ...
that be what I was thinking of :P
 
I've just got 2.5M which is peanuts but quite unexpected frankly.
 
@Rapptz you must be a master of template wankery :O
 
12:35 PM
It was ~30 LOC lol
I was just missing a comma 'tis all.
 
@thecoshman Oh, towers are more general I think.
 
i.e. template<> Class<AB,C> instead of template<> Class<A,B,C>
 
@LucDanton yeah, tower is to let you do crazy shit, crazy crazy shit
 
Stack around runtime variable was corrupted....
Always nice to read that.
 
yiz
1^1^1^1^1.... = 1
 
12:38 PM
@yiz depends on your definition of 1
 
yiz
how would you define it?
 
1^1^1^1^1... = 2, for very large values of 1.
 
yiz
can't be, because if it is
 
¬_¬ I was joking
 
yiz
then 1^1^1^1... = 2, but 1^1^1^1^1^1^1^1... = 1^1^1^1... ^1^1^1... = 2^2^2...
 
12:40 PM
Were you really, I wonder?
 
yiz
= infinite
 
@yiz 2^2^2^2^2^2... = 1, for very small values of 2.
 
@ThePhD ¬_¬ it seems to go over people's heads... either that or they enjoy being pedantic wankers too much
 
@thecoshman Wouldn't be surprised in this rooom. :D
 
Do the Boost.Range metafunctions work on iterators as well? That would explain why I have typename std::iterator_traits<RemoveReference<Range>>::value_type strewn about my code :s
 
12:41 PM
Never used boost range
 
They don't appear to.
 
@thecoshman tetration notation is ugly.
 
@Rapptz aye
 
yiz
1^1^1^1^1.... = sarcasm by your definition :'(
 
I like a^^n notation more
 
12:43 PM
Yeah
 
easier to expand (if you have a reason ungodly enough to need it)
m.y-n^^^^r
:P
 
haha~ I found a bug in gcc
 
no you didn't
one does not just 'find a bug in gcc'
 
Hm.
Need to once more redesign my file system monitor..
This runtime variable corruption stuff is quite annoying.
 
12:46 PM
You posted that before.
 
that was for cosh
 
std::tuple<
    Invoke<boost::range_value<RemoveReference<Range>>>
    , meta::DependOn<typename std::iterator_traits<RemoveReference<Range>>::value_type, Int<Indices>>...
>
I wrote that and I have no idea what it's supposed to mean.
 
o.0
 
well, my point was more that you can never find a bug, they are nothing more then a concept, or trivial details that do not matter. What does matter and is worth looking at, is proof of a bug. A valid test case that can be used to reproduce this so called bug.
 
You and your template invocations.
 
12:49 PM
Starting to suspect that it's buggy but dead and untested code.
 
Hm.
Internally, I need to keep a list of every class that's been created and is still alive.
 
@LucDanton remove it and see what happens
 
Oh I get it. I misread where the pack expansion happens.
Thought it returned a 2-tuple at first.
optional<T> const& fill = emplace()
I question that parameter as well...
 

« first day (947 days earlier)      last day (3991 days later) »