« first day (4269 days earlier)      last day (664 days later) » 

2:25 AM
oh the issue finally had identified
 
 
2 hours later…
 
2 hours later…
7:01 AM
Good morning
 
7:38 AM
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
 
[Captain Obvious] Morning nerds
 
8:18 AM
[Captain Obvious] Are ya ready kids
 
yaaay
 
[Captain Obvious] Just need squit to come in here so he can make the required config change
[Captain Obvious] And ensure that his server is running .net 6
[Captain Obvious] <@739935030910124042>
[Squirrel in Training] it has net 5 i tinks
[Squirrel in Training] Also me not home so me not can access now
 
8:37 AM
how is Botler hosted?
 
> public record TaggedNumber(int Number, List<string> Tags)
...
var original = new TaggedNumber(1, new List<string> { "A", "B" });
var copy = original with { Tags = new List<string> { "A", "B", "C"} };
Good afternoon. I have a question. How do I append the list of tags, without writing out { "A", "B", "C"} explicitly?
 
[Captain Obvious] He's just a console app with a config.json and (new!) an SqLite db
 
I think I'll ask on the main site.
 
9:10 AM
@CopperKettle prolly with original.Tags.Concat(new[] {"C"}).ToList() but performant is sth else
 
Botler looks cool
 
[Captain Obvious] Of course he does
[Captain Obvious] ALthough I'm unsure what exactly uou mean
 
@Botler so it just runs on a server?
 
Don't believe the serverless claims, it's just someone else's server
 
9:23 AM
 
so it just runs on a managed* server?
actually do you consider your laptop a server?
@Squirrelkiller it appears people have a lot of different definitions for serverless
recently: "AWS introduces Aurora Serverless V2"
peeps: "it ain't free, so it ain't serverless, rééêêèè"
^ some definitions are completely stupid...
 
well we have a joke for serverless but it may not be appropriate to share here lol
 
pls refrain from posting nsfw content... and if you work in the p*rn industry, pls also refrain from posting sfw content :)
 
If he does work the porn industry, can he then post nsfw content again? What even is nsfw in that case, gore?
 
3
A: How do I append values when copying a "record" (C#) to a different "record" using the "with" expression?

canton7You can create a copy of a list, with an extra element, by doing something like: with { Tags = original.Tags.Append("C").ToList() } However, if you want your records to be immutable (and you probably should, if you're following the approach of doing modifications by creating a copy), then you pr...

I got this reply
 
9:46 AM
I wonder how do I create an ImmutableList with some values
> var original = new TaggedNumber(1, new ImmutableList<string> { "A", "B" });
This doesn't seem to work. Produces an error
Compiler Error CS1729
 
because the collection initializer uses Add()
also, the constructor is internal
> ImmutableList.Create<string>("", "", "");
probably to prevent people from using the collection initializer
 
Thank you! It worked. I should read up on the rest (collection initializers, constructor is internal), because it's unclear. )))
Found this - "Object and collection initializers", will read up.
 
generally speaking, we use List and just pretend it is immutable
 
Could at least pass the object as IReadOnlyList when you treat it as immutable
 
not really
because a lot of stuff has IList as input
and as we all know, a readonly list definitely is not a list
because MsLogic.exe
 
10:01 AM
But if that lot of stuff treat it as immutable too, why not change it to IReadOnlyList?
Oh wait you mean framework/external stuff?
 
because IList is the base type of the set of lists
therefor, it is used as both parameter and return type in many places
and it is an unrelated type to IReadOnlyList
so neither parameter nor return type can change to IReadOnlyList without breaking changes
 
Oh damn, thought it'd be an IReadOnlyList too
 
IList and IReadOnlyList are parallel, unrelated types in their complete parallel trees
> IReadOnlyList<T> : IReadOnlyCollection<T> : IEnumerable<T>
> IList<T> : ICollection<T> : IEnumerable<T>
only the concrete types would combine them
IROL also doesnt have IndexOf()
because C# generics suuuucc
 
[Captain Obvious] I don't think that's C#'s fault
 
yes, yes it is
 
10:09 AM
[Captain Obvious] I think that's the crpa implementation of the readonly lists
 
I cant even change my Windowed() function to return an IEnumerable<IReadOnlyList<E>> without making significant breaking changes
 
@Botler iShares Global Corp Bond UCITS ETF USD Acc?
California Rifle and Pistol Association?
 
[Captain Obvious] I wish I knew what that was a reply to 🤔
[milleniumbug] IndexOf deserves to be in an extension method
 
crpa
 
10:11 AM
[Captain Obvious] obviously
 
ah
google said it was the shares stuff
 
[Captain Obvious] If the bot was updated I could have edited the message
[Captain Obvious] And it would be edited for you
[milleniumbug] and not in the fucking interface
[Captain Obvious] What would it extend though
 
depends though...
different list types would implement it differently
 
[milleniumbug] IReadOnlyList<T>?
[Captain Obvious] Exactly what I was thinking wiet
 
how would you provide different implementations if it was an extension method?
 
10:13 AM
[milleniumbug] why is the responsibility to provide an implementation of an algorithm the class responsibility
[milleniumbug] you wouldn't, the same way you can't safely substitute a linear search with binary search, even in sorted collections
 
@Botler because that is why the class exists
the different list types provide different structure to support different approaches to access the data
 
[milleniumbug] there is an arbitrary set of possible operations on collections
[milleniumbug] heck, the user can write their own ones
[milleniumbug] but noooo, the all possible operations have to be put in the common base class
[milleniumbug] the common base class is also written by someone who is the most vulnerable to the fragile base class problem because it's the standard library so literally everyone adds their own shit there
[milleniumbug] in their own subclasses
[Squirrel in Training] FUNFRIDAY KIDS
 
10:48 AM
[Captain Obvious] Nice try
 
11:20 AM
@milleniumbug generally speaking, almost all of the IEnumerable extension methods should have been member methods
but use default method implementations in order for all the implementations to not care
 
[milleniumbug] no, that's moronic
 
that way, all the implementations could just override the "extension methods"
 
[milleniumbug] I write my extension methods all the tome
[milleniumbug] *time
[Captain Obvious] what no that's not how extensions work
 
take for example IEnumerable<E>.Last()
// returns the last element of a sequence
 
[Captain Obvious] IEnumerable has very few methods by default because depending on how the collection is enumerated, there may not even be an option
[Captain Obvious] So the extension methods that exist allow you to do some of the things on a base IENumerable, but that doesn't mean it's a good idea
 
11:22 AM
IEnumerable can implement it as
E last = null;
foreach (var e in this) { last = e; }
return last;
 
[milleniumbug] a collection is free to implement its own .Last() method
 
IList can override it as
return this[size - 1];
 
[Captain Obvious] Except that it could result in the collection being enumerated multiple times
 
and a LinkedList would then override that by using the Tail node
 
[Captain Obvious] Which can be expensive and/or dangerous
 
11:24 AM
Last() is supposed to be a terminating function, so you assume it consumes the sequence feed
in case of a generated enumerable, generating it
therefor, using it in combination with any other terminating function, enumerating the source multiple time
 
[milleniumbug] if I call a generic last function then by definition I'm fine with O(n) impl
 
First() generally speaking would not have that many different implementaitons though
as GetEnumerator().MoveNext + Current is basically always fine
 
[Captain Obvious] That's a bold assumption right there
[milleniumbug] this mindset results in a Java .get(int) which is either O(n) or O(1) and let's hope no one passes me a collection which has O(n) .get to my function which assumes O(1) get
 
0
Q: Abstract Datastore class

Behnam FaghihI have this interface: public interface IDataStore { Guid Create(string name); bool SaveObject(Guid transcationId,Guid id); T LoadObject<T>(Guid transcationId,Guid id); bool DeleteObject<T>(Guid t, Guid id, object obj); //void Dump(Guid t); bool Close(Guid t); } what is b...

 
[Captain Obvious] oh right yeah, oneboxes also need better support in the bot
[milleniumbug] thankfully I can do if(collection instanceof RandomAccess) throw RuntimeException("lol fuck off");
 
11:27 AM
I see no problem with get(index) ranging between O(1) and O(n)
actually RandomAccessCollection and RandomAccessList still have a problem in Wietlang's design
and I dont know how to fix :(
 
[milleniumbug] you better have an actual method there instead of having a ~~tag interface~~
[milleniumbug] \~\~tag interface\~\~
 
~o~
what do you mean with an actual method?
public bool IsRandomAccess() ?
 
[milleniumbug] tag interface has no methods
[milleniumbug] a method that gets the element
[milleniumbug] by index
[milleniumbug] In Java given an instance of RandomAccess or however it is called, I can't actually access a random element
 
So like, myArray[rand.next()] or what?
Ah ok, just an array
 
[milleniumbug] Squirrelkiller, imagine if C# had no ICollection<T> class and LinkedList<T> implemented IList<T> where the indexer would do a linear search
[milleniumbug] well, okay, Java has Collection<T>. Why Java LinkedList is implementing List<T>
[milleniumbug] what were they thinking
 
11:41 AM
A linked list has an order, so it's more list than collection?
In a linked list or array, an element is definitely after another element. In a collection, I don't expect this relationship to exist.
 
[milleniumbug] oh that's another funny thing in both languages actually
[milleniumbug] why is the list interface allowing for random access
[milleniumbug] why there isn't another one for that
[milleniumbug] dunno, IArray<T>
 
the difference between a List and Collection is that in List, the elements are ordered
myHashSet[15] makes no sense
myLinkedList[15] does
even though it is an O(n) operation
it is only the api that matters
algorithms can check if their input list is random access by the marker interface
if the input does not support it, then the algo can convert it to new ArrayList(input) for example
what is missing in both languages, and even kotlin, is the distinction between structural mutation and element mutation collections
for example, Array<E> : ElementMutableList<E> and ArrayList<E> : StructureMutableList<E>
where you can set elements in the array to other values, but you cant add or remove elements
 
[milleniumbug] I don't want myLinkedList[15]
 
in an arraylist, you can add and remove
 
[milleniumbug] I'll be fine with myLinkedList[15] non-existing and myList.SlowAsShitAt(15) working and potentially being implemented as myArray[15] where it's fast
 
11:54 AM
so:
class ArrayList<E> : StructureMutableList<E>
interface StructureMutableList<E> : ElementMutableList<E>
interface ElementMutableList<E> : List<E>
interface List<E> : ...
but generally speaking, no one cares between that distinction
 
[milleniumbug] which is, btw, what .ElementAt(...) does, except it suffers from the other angle of the so called "expression problem"
 
expression problem?
 
[milleniumbug] it's a silly name for the language inability of being able to both extend types and operations
 
extend operations?
 
[milleniumbug] you can't add your own operation to the Collection<T> abstract class
[milleniumbug] which then the subclasses can extend
 
11:56 AM
ah, yes
 
[milleniumbug] with extension methods you can add new operations, but you can't have them be easily override-able
 
meanwhile, the creator of ElementAt() did have the option to add it to the IEnumerable interface :D
 
[milleniumbug] by subtypes
[milleniumbug] this would merely mean some operations are "special"
 
I wouldnt consider extension methods new operations on the type of their first parameter
just because their usage looks like a method invoke
 
[milleniumbug] they are, though
 
12:03 PM
They're syntactic sugar for static methods
Really, really tasty syntactic sugar
 
[Captain Obvious] Very convienient
 
mr5
I got "stuck" on a tech design wherein it should already be done but CTO is insisting for more info that is out of scope. PO agrees it met all of the requirements but I somehow got convinved with the CTO that what he said is still within scope (although initially I disagreed). Lead dev came in to the rescue and re align us all like a boss.
Question, how do you become like that lead dev?
 
[milleniumbug] again, I ain't gonna have every possible operation in the interface just so someone can potentially come up with a better implementation, this adds extra complexity in "holy shit just look at all the methods when I use resharper implement interface shortcut"
 
not all operations should be
 
[Captain Obvious] Argue the toss
 
12:09 PM
operations that just rely on an iterable probably shouldnt
but most things that are collection based, probably should
 
lead dev have seen it 100 times. Got fed up, and just sais no.
 
mr5
but we have the same years of xp I think
he's just wiser :D
I think one of the reason I am afraid to disagree/say no is I lack the skill to counter argue on the spot, but after a few days, I would come up with a good response but the decision has already been made
> chiefly British, informal. : to argue or disagree about something that is not important, that cannot be changed, etc.
argue the toss ^
izz dotka time
 
12:35 PM
defense of the kubernetes ancients?
@milleniumbug there is one more interesting thing about lists...
primarily LazyList<E>
basically, you can turn your IEnumerable<E> into a LazyList<E> and it consumes the enumerable only as far as you need it
that way, it gives you the list api without consuming the Enumerable eagerly
however, there is one operation that the LazyList cannot implement
public int Count { get; }
if you use the count, you require it to consume the entire enumerable
what I have instead is a function CompareCountTo which is the operation I need on the count
but what would be a better approach?
 
 
1 hour later…
2:50 PM
why is there LazyList? IEnumerable missing those operators exactly because of the nature of not knowing when to finish (eg no Count property, which doesn't iterate through) Use IEnumerable as is
 
because LazyList has other interesting properties
such as, unable to enumerate the source twice, as the values are cached
and being able to refer to earlier elements
it is my default implementation for the Windowed() function
 
well. That's reasonable
 
input: [ a, b, c, d, e, f]
output: [
    [ a, b ],
    [ b, c ],
    [ c, d ],
    [ d, e ],
    [ e, f ],
]
^ basic summary of input.Windowed(2)
if I were to refactor to a List<T> implementation instead, it becomes really messy if I want to retain the lazy evaluation
for example, I can have an infinite sequence of positive integers (1, 2, 3...) in an enumerable, and window over that lazily
 
[milleniumbug] enumerate over source, create a queue, remove first element, add current element, yield the copy of the queue
 
2:56 PM
LazyList+SubList implementation is super performant tho
 
good stuff
 
wow, 766 lines...
30 lines for my implementation :(
I will never be as good cough as MS :(
 
with the scheduler there time can be injected into the implementation
you can check a Window operation running for years with a TestScheduler in milliseconds
 
0.o?
 
3:36 PM
great news, it is now illegal to remove a parasite from your body
poor Eddie Brock
 
You guys really work hard on becoming a 3rd world country don't you
 
I've already accepted we're a 3rd world country and there's nothing I can do. People give me crap for deciding to stop voting for people I think would be better off hanging than standing at a podium, but I just sit back and silently laugh at their hopeless optimism.
 
3:55 PM
[Captain Obvious] You could move to a superior country
 
no, I'm not gonna be like my dad and just run away
 
 
2 hours later…
5:55 PM
anyone ever made a subcontainer within asp.net mvc?
 
 
5 hours later…
10:40 PM
 
mr5
11:24 PM
@Wietlol are you referring to user interface Window?
 

« first day (4269 days earlier)      last day (664 days later) »