« first day (3152 days earlier)      last day (2021 days later) » 
04:00 - 11:0011:00 - 22:00

11:00
when was sex outlawed?
@Wietlol Wait, 'ave I lived me'ole life finkin' dis is co-rekt?
under what church
Me feel loik utter moron
@HéctorÁlvarez ok... theory time... in england, there are x people...
and there is 1 king
given that having coitus was outlawed, everyone wanted it to be legal
that 1 king, would have to approve of it for approximately a third of all the people
how many requests would he get per year?
x = population/3
That would be for people legally having sex, what about people illegally doing so?
But yeah you have a point, waste of time
"Oh ew, Johnson? No way! His lineage ends on him!"
I could buy most theories, history is sick around those details.
11:09
but again its so weird historically there is no church that would agree to outlaw COITUS
unless we are talking about post henry the 8th england and age of absolutionism
Here in Spain there was a time where landlords had something called "derecho de pernada" which consisted on having a legitimate right by law to take a girl's virginity the day before said girl would be married to one of his tenants.
oh yes I saw that netflix series
Wanna get married? Hol' up! Ima fuck your girl first!
@HéctorÁlvarez it was quiet common I think
Side question without sexual stuff, for the wise men around here, can you explain class covariance in layman terms? I've read about how Animal and Cat are covariant and contravariant because Animal > Cat and all that suff. It makes sense in math when you measure 2 quantities, but it's not that clear for classes.
11:16
I can never remember which way around they are
Are you talking about C# covariant and contravariant type parameters or more general than that?
I didn't know there were several ways to look at it.
My example was about C# because that's what I saw out there
But please enlighten me
Covariant is what we all want for List<T> but we can't have: A list<Animal> may contain Cats, because they're animals. But you can't put a LIst<Cat> into a List<Animal>'s reference, because they aren't covariant.
Covariance is basically saying (type of another type) -> (type of yetAnotherType) "inherits" the relation of anotherType -> yetAnotherType.
IEnumerable is covariant. You can stuff an IEnumerable<Cat> into a reference for IEnuemrable<Animal>, because the IEnumerbale<Cat> "is a subclass" of IEnumerable<Animal>. Note the "".
brb
// Assignment compatibility.
string str = "test";
// An object of a more derived type is assigned to an object of a less derived type.
object obj = str;

// Covariance.
IEnumerable<string> strings = new List<string>();
// An object that is instantiated with a more derived type argument
// is assigned to an object instantiated with a less derived type argument.
// Assignment compatibility is preserved.
IEnumerable<object> objects = strings;

// Contravariance.
// Assume that the following method is in the class:
That's for C# attribute properties
@Squirrelkiller Basically this, but not layman's enough
It's important to start from the concept of Assignment compatibility
Now, what does it mean that Assignment compatibility is reversed for contravariant arguments?
11:33
It means it goes the other direction as in IEnumerable
Covariant: You can stuff an IEnuemrable<Cat> into an IEnumerable<Animal>
right so it should be able to handle the cat passed when expecting an animal
Contravariant: You can stuff an Action<Animal> into an Action<Cat>
Now explain this shit
I don't understand why
I can accept it, but I don't understand the reasonning
I think I understand the idea. Working with cats and animals, contravariance means you should be able to provide a more generic definition of the data, which will be handled as the more concrete one
so if you do (Animal)myCrocodile and pass it, it will still be treated like a cat
The covariance example is easier to understand because it's innate to the language, every type is itself and all its ancestors by polymorphism you can understand all cats are animals.
contravariance on the other hand means you can do something like a method that asks for a string, but pass it an object
Gotta find some real examples
11:46
@Squirrelkiller I guess you're telling the compiler "I know this could break, let me do it anyway"
i.e. allows explicit casting. Whereas you wouldn't be able to cast one Action to another in any other way without it because different Action types don't have an inheritance relationship
Ah no
oh my
it makes total sense
It's like a way of telling the compiler to project the inheritance relationship up to the generic type that it parameterizes
Read this carefully
I think?
Great answer
@HéctorÁlvarez I got your laymens terms now
Covariance is for outputs
Contravariants is for inputs
BOOM
Covariant output: I want anything, but you can give something special if you like, I'll stil ltrat it like anything else
11:49
Ooh
Contravariant input: I can't make this into words properly yet
I need to read that a few more times
It's genius
It makes os much sense
ok input = "i want this"
Contravariant input: I want something specific. You give me a method that can handle anything. You can still only give me something specific, because the method below handless it like anything else anyway.
That one is tricky.
I jsut realized that answer is by Jon Skeet. Brilliant man.
Contravariant is like covariance with a twist
> So basically Action<T> is contravariant - whereas Func<T> is covariant:
That's where my brain explodes, how the hell does he jump to this conclussion?
Action<T> uses it as parameter, Func<T> uses it as return type
11:55
The T in Action<T> is an input. The T in Func<T> is an output.
input = contravariant, output = covariant
class generics are non-variant
invariant
We do have a word for that
nani-variant?
@Wietlol OOOOOOOOOOOH
That was the actual layman's
It all clicked in a split second
So covariance is when you can provide a subtype that inherits from the required one, while contravariance is the opposite, returning a subtype of the instance type we're expecting.
11:59
And invariance is when you can't apply neither covariance nor contravariance
No wait, I'm not 100% sure of what I just said about invariance.
and Task<T> is in-non-variant
Hi guys! I'm getting a timeout error in a Linq to Entities query when comparing two bytes array. I know I should compare by an guid or something but it is a bad design error I think and I can't change it now. Any possible workaround?
It is. invariant: fuck you all just use the thing I told you to use.
also, Int32 is not a subtype of Object
structs are all in-non-variant
Int32 was a primitive type last time I checked.
12:01
and Nullable<T> is invertariant
@HéctorÁlvarez but the boxed version isnt
Object x = 42;
this is valid
Well the boxed version is an object
You and your boxes
think outside the box
IEnumerable<Object> x = IEnumerable<Int32>.Empty();
this is not
phew both are ugly
But I'd go with the first one
Method expression always looks cleaner
btw how comes first is optional, and throws error if missing?
@Squirrelkiller by the way, I've never, or almost never used "Emparedado" and I believe everyone calls it sandwich around here.
@Wietlol Definitely the first one
@ntohl Because you can never trust external input to be present?
12:24
@HéctorÁlvarez or the third
@Wietlol Still the first one.
> both are ugly
what would you write?
or would you also write ugly code?
:p
@ntohl if collection is empty, there is no first
Optional is maybe a wrong word
... but still better than Maybe
Now I'm not sure anymore. Probably the first one. The third seems...easier to read for the guy who comes after me, but I just like the first one.
Maybe<String>
I think it is a string, but maybe it isnt
Option<String>
Stringn't
12:27
this also exists
Is that c# btw? Doesn't look like C#.
it's plain misleading. FirstOptional is exactly you want to describe it it can be empty
maybe in C#8, we would use String? but jon said not to trust the system
@ntohl exactly
You mean string?
First() makes it required, and fail if it is missing
FirstOptional() will not throw if it is missing
12:28
So you really want First()
it will give you an optional value in return
or throw is water can be empty is fire
then, it is up to you to deal with it how you want
they doesn't read well next to each other
@Squirrelkiller except that I want to have a better exception
FirstOptional().OrThrow() is certainly interesting from a linguistic point of view
but it is better than to use First() and do a try catch around it and throwing the ArgumentException when an IllegalOperationException is thrown
12:29
we have FirstOrDefault
except that the default value is sometimes a valid value
and not specifying one is invalid
FirstOrDefault() == 0
now, was it 0 or nothing?
ParseInt() returns an IResult<T>
I'd go with the third
which is an IOptional<T>, with the addition of information of the error if the value isnt present
12:32
> FirstOptional().OrThrow() is certainly interesting from a linguistic point of view

^ it's just wtf
Wiet sure loves his Optional
imo, it should have been named First
Just as Kendall his Maybe
but that name is already taken
so with every name, you get this weirness
FirstMaybe().OrThrow()
IMO First() should have an optional parameter for a different exception message
12:33
but what do you do if you dont want to throw?
but instead assume a default
First().OrElse(42)
@Squirrelkiller you could do an extension method for all Exceptions to rephrase the error message
What do you mean for all exceptios?
@ntohl but extension methods arent polymorphic
whatever First would throw is one type of exception. You could do a wrapper around Actions, so whenever a <this type of exceptions happens>("My exception message")
Try(() => DoStuff()).OrThrow(() => someException)
12:36
hmm. That's not easy.
that is easy
just not beautiful
no. That's not what I want
also that
try
{
    ... some stuff
}
catch (T exception)
{
	throw new T("my message");
}
> new T
ew
12:38
save the type of the exception
its horrific
just rephrase the message
new T("I pity the fool who catches this exception.")
it has more assumptions than json deserialization
however, if you get better lambda syntax, what I wrote above becomes really familiar
ah. It's not ok
12:40
Try { DoStuff() }.OrThrow { new ArgumentException("someStuff") }
try
{
    ... some stuff
}
catch (Exception ex)
{
    ex.Message = "my message";
	throw ex;
}
or like that
Try {
    ... some stuff
}.Catch<Exception> {
    it.Message = "myMessage";
    throw it;
}
I don't know if you make it an expression method
and when you use java naming convention
try {
    ... some stuff
}.catch<Exception> {
    it.message = "myMessage";
    throw it;
}
12:42
I dont understand this line :
IList<T> communicates "I need to get and set the elements of this sequence in arbitrary order".
142
A: why use IList or List?

Eric LippertThere are three questions here: what type should I use for a formal parameter? What should I use for a local variable? and what should I use for a return type? Formal parameters: The principle here is do not ask for more than you need. IEnumerable<T> communicates "I need to get the elements of ...

because it is wrong
@ILoveStackoverflow it does NOT communicate that
do we have IRandomAccessList in C#?
It does though
not really
12:44
You can stuff anything into the IList, as long as it lets you add or remove stuff
it means "I need a collection with an explicit order"
if you want to read/write a list in arbitrary order, you need a random access list (which doesnt have a marker interface in C# afaik)
a LinkedList for example does not
you can, but its sad
as I'm googling ICollection might better communicate unorderization
> unorderization
that makes less sense than FirstOptional().OrThrow()
googles unorderization
> found 2 results
oh well...
Tries to google firstoptionsl().orthrow()
oh snap
12:52
It seems parenthesis are allowed in domain names?
Internet.Search(stuff)
googles firstoptional().orthrow()
finds findFirst()
oh shit, that name actually made more sense than FirstOptional
refactors entire code base
:D
FindFirst().OrThrow()
happy?
yes
yay
continues refactoring
12:54
See you in a year
you overestimate my refactoring skill...
or you underestimate my codebase
either work
I have to do some work stuff for a few minutes and come back to 120 messages
HECTOR
> both are ugly
what would you write?
@ILoveStackoverflow IList<T> is meant to be a mutable collection, you can add and remove elements at leisure so doing myList[3] may not return the same result at 2 different places. You can remove the 3rd element and suddenly your whole list has changed, none of the indexes point at the same data any more. An IEnumerable however is inmutable, it will keep the same amount of elements and all you can do is enumerate them.
a list is an IEnumerable
13:07
In other words, IList<T> doesn't guarantee the order of elements.
hence IEnumerable is not necessarily immutable
> inmutable
we have a word for that
non-mutable
immutable
@HéctorÁlvarez IList<T> does guarantee the order of elements
that is the only thing it does compared to an ICollection<T>
if you add stuff to the end, the order wont change
if you add stuff to the beginning, the order wont change
in the middle... guess what? it wont change
only new items get added
but item at index 3 will still be before item at index 4
Where does it guarantee the order of elements?
13:10
in how the implementations work
What implementation?
if you add element in the 3rd position the 4th element will be the one which were 3rd position.
It's an interface
unlike a HashSet for example, if you keep adding items, the order changes now and then
When I read IList<T> I understand I can do whatever I want with this list, I can add and remove elements as much as I want, whereas when I see IEnumerable<T> I understand I have to work with that very sequence. After that you can run any transformations you want, but semantically it makes sense to me.
13:10
@ntohl but then the items at 3 and 4 are now 4 and 5
and their order remains the same
I tell the same
@Squirrelkiller List, LinkedList, someotherlistihaveneverheardabout
Array
(it is also a list, just not a structure-mutable one)
System.Collections.ArrayList
System.Collections.CollectionBase
System.Collections.Generic.List<T>
System.Collections.ObjectModel.Collection<T>
System.Collections.ReadOnlyCollection<T>
System.Collections.SortedList
System.Collections.Sepcialized.StringCollection
> ArrayList
oh yes
anyway, they all behave the same in terms of ordering
@Wietlol I believe you're confusing the term "arbitrary order" with "random order". It's not that the caller will pass the elements in a random order, just your operation doesn't care about this particular order.
13:17
What if I make my own IList implementaion that shuffles on every add or remove?
If my function asks for an IList<T> chances are I'm going to mutate it, and I don't care what kind of list it is as long as it knows how to .Add() or something like that. If it asks for an Enumerable<T> I'm only going to read from that collection and do something that doesn't involve it. If I have a List<T> I want exactly this invariant type. (see what I did there)
@Squirrelkiller than you should feel bad. And you ruin someone's whole day
@HéctorÁlvarez how comes covariance into the play?
@Squirrelkiller sounds like trying to develop for PS3 Cell chipset
@ntohl invariance, and it has nothing to do with that, but we spent some time learning that a couple hours ago
@HéctorÁlvarez you used the right word "immutable", but now it's a wrong word "invariance"
which is other topic. I read that
List<T> is invariant
IList<T>...no idea
13:22
@HéctorÁlvarez and then Jaba comes into play
List<? super T> for add()
@ntohl List<T> is invariant.
List<? extends T> for get()
In C# generic collections are invariant.
oh
ohhh
IReadOnlyCollection is covariant :D
And IReadOnlyList
but IList doesnt extend that :(
13:25
> IReadOnlyList<object> irol = new List<string>();
>
No compile error!
> IList
void Foo(IList<T> list) {
    IReadOnlyList<T> irol = list; // << error
}
kek my lovely boys and girls
I'm off, out, and beyond.
à démain
14:09
toodels
I don't write much here in chat, but when I do, it's messages that won't be read by those they are intended for
@Squirrelkiller you usually wrap the list in a ReadOnlyCollection, since otherwise the evil-caller can just type it back to a List<T>. It's fine to wrap it in a ReadOnlyCollection though, because it still uses the existing list as a backing field more info
so IReadOnlyList<object> = new ReadOnlyCollection(myList); should be better
14:41
I always used AsReadOnly()
WHAT IS UP NERDS
o/
> WHAT IS UP
15:00
lee
I demand you change your name back!
lmao
I did say he should be named that
mr5
mr5
15:16
squirel buttler
You sir are a disgrace to the squirrel family!
mr5 on the other had.. he is a pure geni
mr5
mr5
uine
motion?
ration?
rous?
mand?
ange?
ame?
mr5
mr5
genimand
geniange
geniame
wth are these nyc?
does anyone here procrastinate before eating?
it's like eating is a chore for me
procrastinate before eating? what?
When I see meat, I ate it in seconds.
mr5
mr5
15:24
@Wietlol you might find the word instantialization useful
yeah, when I see food, I'm just like meh...
I can eat it tomorrow
wait what
why
mr5
mr5
@Wietlol why not just copy the Linq convention: .Single()
> Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.
Eating is excellent if it's nice
It's a chore if it's shit
mr5
mr5
I'm almost not eating during weekends.
Eating takes much of my time.
Preparing food is crap
Eating it is fine though
15:34
mr5
mr5
do you mean, this:
> Well in my humble opinion, without the desire to offend those who think different from my point of view, but looking at it in depth, taking into account the characteristics of each person, the biological construction and physical ability I honestly think... I forgot what i was going to say...
15:47
Hey, I have this line of code in my webpage but it runs when the page renders, not when the textbox with id='lname' loses focus as I would like. What am I doing wrong?

$(document).ready(function(){$('#lname').change(UpdateFields());});
$(document).ready(function(){$('#lname').on('change', UpdateFields);});
You want to attach listener for change events, not fire the change event.
Thanks, the parenthesis set was the problem.
@mr5 because Single and First are different
and yes, we also have SingleOptional()
(or FindSingle())
mr5
mr5
> FindSingle in your area
nice ad slip there
16:08
.Advocate(int,Func<TA,bool>)
mr5
mr5
"Would there be any IP violation filed by my employer..." what does IP mean here?
'Will my employer submit any Intellectual Property violations?'
mr5
mr5
oh
thanks
Thanks on translator too
mr5
mr5
so translator have that acronym context-aware word breakdown feature as well
16:14
My first though is the who employee make same IP on LAN as boss computer
'IP violation' lol
17:16
posted on June 03, 2019 by ericlippert

Last time on FAIC I showed why our naïve implementation of computing the expected value can be fatally flawed: there could be a “black swan” region where the “profit” function f is different enough to make a big difference in … Continue reading →

StorageException: the remote server returned an error (403) forbidden azure storage
Any idea on this error message ?
17:33
do you have to authenticate with the azure storage account you're trying to use
 
2 hours later…
19:25
Yeah that sounds like a malformed SAS token
Or forgetting to supply one
19:44
what do you guys think the future is for apple?
mr5
mr5
why do you ask?
20:11
posted on June 03, 2019 by Phil Haack

When you see a small bug or error in a repository, a common refrain is to submit a pull request to fix it. To submit a pull request with a correction is an act of kindness to the maintainers. It allows the maintainers to review the change and accept it with a click.

If I have like 3 million customer records in a database, what is my best option for associating all of their addresses with a FIPS number?
20:33
void Attempt(ISet<Person> myArea) {
    var target = myArea.FindSingle();
}
@mr5 ^
21:25
sounds like you only have to do it once, right
you could write a little C# program that attached to the database, looks up all the addresses, and writes your number in
Wouldn't even take that much code with entity framework, and linq you could even do a little async magic
04:00 - 11:0011:00 - 22:00

« first day (3152 days earlier)      last day (2021 days later) »