« first day (3321 days earlier)      last day (1610 days later) » 

1:39 AM
dictionary<T, List<U>>
where is the best way to support lazy initialization for new keys
 
1:54 AM
When you add a new list?
I don't understand the question
 
 
1 hour later…
mr5
3:04 AM
o/
@cubesnyc are you planning to make a Multimap? (dictionary that can have duplicate keys)
 
yes
lookuptable
never heard of a multimap before
 
mr5
Incidentally, we're doing the same thing
This is how I did it:
internal class Multimap<TValue> : List<KeyValuePair<string, TValue>>
{
    public void Add(string key, TValue value)
    {
        var entry = new KeyValuePair<string, TValue>(key, value);
        Add(entry);
    }
}
@cubesnyc I was also planning to use it but I find it more complex
 
4:02 AM
i dont think this is a good implementation
because what do you do when you need to reference the values by key
you need to loop through the entire list
also, keyvaluepairs are immutable
which may or maynot be ok for you
but not for me
@mr5
 
mr5
Well, my requirements is as simple as that.
 
Dictionary<Tkey,List<TValue>>? maybe
 
yes
that what im using
but you cant do dict[key] = value when key doesnt exist
need to check if the list exists and then initialize it if it doesnt
which is obviously annoying
 
That is why Extension Method is evolved
 
mr5
4:18 AM
Or you know, through composition
 
4:45 AM
@mr5 just be careful that immutability is truly what is desired.
i fell into that trap in a big project and refactoring was really a pain in the ass
 
5:37 AM
Ben Popper on November 19, 2019

Our guest this week is Kent C Dodds, a developer who makes a terrific impact on the community through his workshops, talks, and newsletter. We chat about why he loves React and how he automated his way from a business analyst to a full fledged software engineer.  Plus, the value of execution versus intelligence, and how version control worked in the days before Git.

The crew chats about how Paul and Sara made the transition from individual contributors to managers overseeing teams of engineers. Sara used to see this transition as a form of selling out, but has a new perspective after having mad …

 
 
2 hours later…
7:15 AM
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
 
Morning
Nixie tubes are a scam
170v input and 3mA
2 tubes can hardly last a whole day with a standard battery
I'm so sleepy today
and I slept for 8 hours
whyyyy
 
because you suck!
there I've said it
 
cries in Spanish
 
sue me
(sent 3 mins ago but stopped due to spam protection)
 
V.7
Mornin o/
@HéctorÁlvarez IN18 are great enough, but hard to find such
 
7:25 AM
Mornin \o
 
V.7
@HéctorÁlvarez 'cause
 
@V.7 Those are too big to build a watch
I checked Numitron as well
they work under 5v like normal stuff
but still not what I wanted
 
V.7
@HéctorÁlvarez ... but seems legit
 
yes but that's very big for a wrist watch
 
V.7
Oh, the wrist ...
 
7:36 AM
now this is high tech
 
A watch for year?
 
hell yeah
don't give me any of that smartwatch crap. I want a watch that gives me the year. Period.
 
Not paying 1300€ for one
xd
that's why I'm looking for a way to make my own instead
but it looks complicated
 
"When's the meeting? I suspect it'll be at 2020"
 
this is the one I wanted
but too expensive
I'm poor
 
7:41 AM
Did it still need battery?
 
Yes, but this one lasts for a month
 
a month
 
and can be charged wirelessly
 
overkilled to the Pluto from Earth
 
The nicest smartwatchy-thing I've seen was the Nokia Steel HR.
 
8:02 AM
I don't honestly understand why you'd pay more than 200 euros for a watch honestly
it seems that beyond a certain amount, it's mostly just a status symbol
it's already mostly a status symbol as it is, since you can determine the time fairly easily these days
Someone off the street asked me the other day what time it was, and I couldn't help but think how bizarre that was until I realized that I hadn't heard anyone ask me that for a good long while
 
That. And being constantly interrupted by notifications on your watch is a bad thing for your mental health, in my opinion. I like the hybrid watches that monitor health for cardio and whatnot, but not the full smartwatch things with 10h battery life.
@Neil Lol, that's like someone asking you the way... rarely anyone asks that anymore because we all have navigation software
 
@RoelvanUden that's true, you don't hear that often these days either
The guy asking me for the time was a street performer btw
I suppose it would make sense that he wouldn't be in an environment where he could easily check such things
 
Hi, I have a statistics question :)
I have some timestamps. Now I want to make a grouping of close/near timestamps.
Do I have to use something like clustering?
or should I slide my interval over the timestamps an look how many timestamps are in this interval?
 
@kame I think the only way to do this properly would be to slide the interval to the beginning of each timestamp and count the number of timestamps included in that interval
once you've found the highest, you remove all those timestamps and repeat
though admittedly, a greedy algorithm may not be optimal
 
@Neil This was my first idea. Could you imagine a second way?
 
8:15 AM
that's a tricky question
 
@Neil did you hear/use of 1-D clustering?
 
hmm, let me think
 
k-means data clustering
 
what are you trying to optimize is probably a better question
you could arbitrarily use as many groupings as required to evenly cover the data set
you're trying to minimize groupings?
you could imagine the entire data range of timestamps as being covered with these intervals.. so like if you have 100 timestamps in the range 0 to 10 in 1 second intervals, then you start with the assumption that you subdivide the data from 0-1, 1-2, 2-3, etc.
Then you count the number of groupings with 0 timestamps in it
then you shift it to 0.5-1.5, 1.5-2.5, 2.5-3.5, etc.
you do the same count of groupings with 0 timestamps
 
@Neil It is a difficult to explain. But I am in the search of groups and could throw away values which are not fitting in a group.
 
8:20 AM
you use simulated annealing to obtain the ideal range that would minimize groupings
well there's a way to calculate outliers
 
I want to use a variable time slot to see how much groups I get.
 
how can you optimize that? your algorithm would tell you that a single interval including all timestamps is the best solution :P
you have to determine a non-trivial formula that determines an ideal grouping
 
@Neil Good question :)
 
probably a good start is to figure that out
 
@neil Thank you
 
8:23 AM
no sweat :)
 
8:36 AM
@RoelvanUden Watch notifications aren't a problem for me because nobody speaks to me
 
@CaptainObvious I'm happy for you... I think...?
 
I got a new game for my VR set yesterday and all my muscles are sore and hurt now :-(
 
@Wietlol Looks like she fixed one of our ways in
in Sandbox, 5 hours ago, by nyconing
@nyconing Error: InvalidOperationDetected: typeof
 
@CaptainObvious foreveralone.jpg
 
8:45 AM
hmm
gotta find more ways
 
@RoelvanUden I'd imagine VR games could be quite physical
which game was it?
 
@Neil Synth Riders.
Thought it wouldn't be much of a problem 'cause I'm already used to other rythm games, but it was very physical lol
 
the gameplay looks intense
it's a freakin' workout video
 
Yeah, and there's a "Force" mode where you don't just need to touch the orbs, but punch them with force.
The bigger punch, the higher score. :-P
 
My idea is that to build a "level" is basically just some guy making the exact same moves, just rather than moving the orbs to touch, actually creates them instead
 
8:54 AM
Not sure how they do, but there's a lot of song mappings out there. I think they need to manually place them, but just moving in VR seems like a better solution :P
 
i think that would be ideal at least
just make up some decent choreography and then use your hands to create the orbs at each position
 
Yeah that'd make the most sense, record hands in VR, place notes on the beat on were the hands were afterwards.
 
I like how most games nowadays use real actors to do the motion capture for cutscenes or even just normal game animation
you can tell a difference in quality when they do that
 
Captain Price on MW looks photorealistic as fuck
and so do the other actors, I mean
but that guy and his beard wtf
 
It's because cg modelling artists are not as fast as just scanning a guy's face
Bonus if you actually want the character model to look like the guy you scan because then youi don't need to do a whole lot
 
9:06 AM
well that does make a lot of sense to do it that way
hire the actor, and throw him in the game basically
 
As long as they sign the release for their likeness it's good
 
it's a lot more straightforward than creating a model from scratch and making the animation of the actor fit the model
No reason why they wouldn't. I think putting your face out there as an actor is sometimes more important than the money you earn doing it
 
Well once the model is created and bound to the "limbs" (There's a real name for it but I can't remember for the life of me what it is and Google isn't helping) it doesn't really matter who does the mocap
Obviously it's ideal if the person being captured acts similarly to the model. If you modelled a fat dude and then used Usain Bolt for the animations it might look a bit odd
 
\o
 
would be interesting to see what that would look like
Watching a fat dude sprint that fast like a professional athlete
 
9:15 AM
@Neil I really love how they did that for games like Detroit: Become Human
The animations and facial expressions are just sublime. The actors really performed.
 
I saw a documentary on how they did Last of Us, and a lot of it was about the acting and how they went about it
interestingly, the characters are quite different from the actors who play them
 
Some games these days are more turning into interactive movies
 
@Neil Cool, got a link to that?
 
I'm a sucker for that kind of thing. A lot of people don't like the cutscenes, but I love it
Sec, I'll go look for it
 
9:18 AM
Around the 24 minute mark they talk a lot about the actual acting part
@RoelvanUden that motion capture is insane
no wonder it looks so real
 
Yeah, and Detroit (newer) is even more insane.
I'll be watching that making of tonight :-D
 
mr5
How to properly cast a Class<T> from Class<object>?

Below is an example where the cast fails:

// T is object
// but valueInterface<T> is User
var value = valueInterface as SourceEventWithMode<T>; // failed
this is what SourceEventWithMode<T> looks like:
internal class SourceEventWithMode<T> : ISourceEventWithMode
{
    public Action<object, SourceEventArgs<T>> Action { get; set; }

    public Func<object, SourceEventArgs<T>, Task> ActionAsync { get; set; }
}
 
9:33 AM
@mr5 a Class<object> isn't a Class<T> though
unless T were object of course
seems like casting to Class<T> is a bad idea even if it is allowed
 
is T supposed to be primitive?
 
mr5
T doesn't have constraint
 
@mr5 you need interfaces ;)
and variance
 
like ICommand
 
mr5
@Wietlol it does have interface though but the interface is empty
 
9:35 AM
Class<object> isn't Class<Turnip>
it makes sense that you can't simply cast from one to another
 
oh yay, marker interfaces
you need interfaces that describe your class
hmm... Action and Func cant be variant either
 
mr5
I have this type declared as a member variable of class:
Multimap<object, ISourceEventWithMode> eventListeners = new Multimap<object, ISourceEventWithMode>();
which gets problematic if I want to have ISourceEventWithMode that has different T
 
in your case, it is invariant
similar to how IList<Object> list = (IList<Object>) myUserList; is not going to work
(where myUserList is IList<User>)
you cant use Func and Action that way
or getters ánd setters
 
mr5
I am thinking I could cast each property to it's <T> but I doubt it would also work
@Wietlol what do you mean by I can't use it?
 
what happens in C# if you attempt to cast object to something it isn't?
is that an exception or is null pointer returned?
 
mr5
9:41 AM
with `as` it's just null
with direct cast (C style) it throws
 
@mr5 Func and Action are invariant
 
your computer will explode
 
Action<String> x = (Action<Object>) y;
simply wont work
even though it theoretically should work fine
 
it'll throw an exception invalidcast
 
internal interface SourceEventWithMode<in T>
{
    void Action(object obj, ISourceEventArgs<T> args);
    Task ActionAsync(object obj, ISourceEventArgs<T> args);
}

internal interface ISourceEventArgs<out T>
{
    // ...
}
 
mr5
9:42 AM
but is there any way I could make it work? Perhaps reflection or dynamic?
 
can you hammer a square peg into a circle hole? maybe, with enough force
you should probably try to avoid that situation entirely though
 
@mr5 you need interfaces like that
perhaps swap the in/out
but that depends on the contract of ISourceEventArgs
dont you just love C#?
at least C#'s generics arent as bad as Java's </sarcasm>
also, perhaps you should only allow the async version
remove the non-async one entirely
 
Neil is right, it seems forced
 
whenever I'm met with a situation like that, I just assume I screwed up somewhere
 
oh man I just sneezed and that link came out
what a shocker
 
9:48 AM
you should very rarely need to cast
 
I cast spells all the time
 
so is it vingardium veliosa or veluusa
 
its leviooooosa
not leviosaaaaaaa
 
proper expert i see
 
I cast when I go fishing
 
9:50 AM
also, wingardium
 
good morning
 
I hate case sensitivity
 
I hate case overriding
 

« first day (3321 days earlier)      last day (1610 days later) »