« first day (3323 days earlier)      last day (1619 days later) » 

10:00 AM
That's also an issue because I have 600 Mbps at home, so in order to compensate you need at least 12 people without internet at home to compensate for me
 
mr5
@HéctorÁlvarez watch the progress bar until in finishes downloading. should be productive
 
Yeah, the US extremely unbalanced. Very fast connections in San Francisco and other large cities connected to tech hubs, but terrible speeds in small rural areas, because it's a lot more expensive to cover large rural areas with cables.
 
Fun fact though, I get the ads of what other coworkers are browsing thanks to the power of the Romanian proxy, lipstick and car brakes are on my screen at the moment.
 
lool
 
mr5
you guys browse unrelated things at work?
 
10:04 AM
I follow John Scalzi, the SF author, on twitter, and he occasionally complains that where he lives, in rural Ohio, the only internet he can get is with a crappy ISP that offers 6Mb DSL connections, tops.
 
mr5
I mean, completely unrelated to programming
 
@mr5 We're here, aren't we? :)
But yeah, I do.
 
@mr5 I read a lot of articles
although, it's tech related news, but not per se programming
 
@mr5 is this a serious question ?
 
I've got a 40Mbps DSL connection, but that's because I'm in a relatively old part of town with older infrastructure. I'm waiting for fiber to come my way.
 
10:06 AM
once you start googling unreleated things you cant stop
it becomes a life of its own
 
HAMMERTIME!
 
exactly
 
Hey, today was my first time using TypeDescriptor to dynamically emit a type at runtime. That's pretty nice, though the API isn't as straightforward as I'd like it to be.
There are probably wrapper libs around it.
 
fastmember isn't it?
 
mr5
@Hans1984 not really. That sounded like I'm so concerned about the company lol
 
10:10 AM
nope never mind
 
mr5
@AvnerShahar-Kashtan isn't that the alternative for Activator.CreateInstance?
 
@mr5 No, I'm not just instantiating a type, I'm defining a brand new type.
 
mr5
"I'm not just" which means you also instantiate it using it, right?
 
Sure, but I do that with Activator.CreateInstance.
 
mr5
gah
I thought I could copy the code
 
10:13 AM
Basically, we have some infrastructure that generates a logger class from an interface. A module might define IMyModuleLogger with app-specific logging calls, and then the infrastructure creates an ad-hoc class that implements that interface, with a method implementation that forwards the logging call to our logging infrastructure.
 
mr5
I've read somewhere that there's a faster way to instantiate a type using that "emit" thing
 
@AvnerShahar-Kashtan hey, that's pretty cool!
was it hard?
 
But we aren't actually hooked up to the infrastructure yet, so I just wrote a method that takes an interface and creates a null implementation for it that does nothing.
@Default Nah, it's about 10 lines of code, but that's because I don't actually do anything in my type, just have empty method to implement the interface.
 
what's the use case?
 
@Default As I mentioned above - every module defines a logger interface, but it's a waste of time and a lot of boilerplate to actually implement that interface with nothing but calls to MyLoggingProvider.GetLogger(loggerName).Log(severity, message). So we simply dynamically create a class that implements the interface, fill every method with that boilerplate code, and register it in our DI container as the interface.
 
mr5
10:17 AM
@AvnerShahar-Kashtan isn't that like analytics or event tracking?
 
That way my class simply gets IMyModuleLogger injected to it and can call _logger.ActionStarted("blah") and it gets logged, and no-one cares about the implementation.
 
@AvnerShahar-Kashtan ah, sorry, missed it above. Sounds interesting!
 
mr5
sorry. stupid comment. forget about that
 
It's an alternative to doing compile-time code generation, with a T4 template or something like that.
 
mr5
tier4?
 
10:26 AM
n
 
Text Template Transformation Toolkit.
(First time I actually bothered to check out what T4 stood for)
 
mr5
I never heard that before
it sounds adobeish
 
I've seen very little of T4 and never really cared for it. To me it was pretty hard to work with
 
It's a templating system built into Visual Studio that lets you write T4 templates that have C# code mixed with template placeholders, and convert those templates to code at compile-time.
We had one T4 template in our last project, I think, which dynamically inserted some machine-specific data into a constant in a code file and compile-time.
 
this is so extreme and I dont understand anything
 
10:32 AM
@misha130 Interesting code comment there about Hashtable vs. Dictionary.
 
mr5
It's like writing IL in C#
 
marc gravell is an interesting guy in general
 
@mr5 That's exactly what it is.
I've used IL Emit once, back in... oh, 2006 or so, and I can't remember exactly why.
 
mr5
so I'm in the middle of writing my memoization using Dictionary. Perhaps I should consider hashtable also?
 
It was something similar, I think. We wanted to create a fast wrapper over a type known only at runtime.
@mr5 As a general rule, don't.
 
mr5
10:35 AM
this doesn't throw in hashtable, does it? hashtable[a_key_that_does_not_exit_yet]
 
Marc Gravell seems to have had a specific and very low-level reason to use it here, one I don't know so can't comment on, but it's clearly commented as an exception to the general rule.
@mr5 Don't remember. I would expect it to throw.
 
mr5
but it's on the code!
 
I always have a GetOrDefault() extension method if I want it not to throw.
 
mr5
no check
 
Marc Gravell is a beast
protobuf and stuff
 
10:37 AM
7
A: .NET HashTable Vs Dictionary - Can the Dictionary be as fast?

NullReferenceAnother important difference is that Hashtable is thread safe. Hashtable has built in multiple reader/single writer (MR/SW) thread safety which means Hashtable allows ONE writer together with multiple readers without locking. In the case of Dictionary there is no thread safety, if you need thread...

 
mr5
@ntohl he created the protobuff?
 
Protobuf is by google, isn't it?
 
it is
 
there are 2 versions
 
mr5
protobuff.marcgravell and protobuff.google
 
10:40 AM
damn ok
 
when I first found out protobuf, I haven't seen the Google one
 
I fixed an error where I couldn't open .MSG files
If someone runs into it, make sure you installed the 64b version
 
Ah, it's a client library for .NET, to generate protobuf-formatted messages.
 
@mr5 actually what is that
is that the sponsor thing?
 
mr5
@misha130 from Marc's github profile
 
10:45 AM
yea but isnt it part of github?
like github assigns people PRO status or something?
 
mr5
I think when you receive too many stars, you get badges
 
Ok, I've finished importing our non-trivial Event Sourcing framework from the previous project, embedding it in the new project, removing unused dependencies, updating the CosmosDB SDK from v2 to v3 and replacing all the DI hooks to use ASP.NET Core's DI rather than AutoFac. And then I ran all the unit tests.
 
I got a 100 stars where is my badge :(
 
mr5
@AvnerShahar-Kashtan hey hey hey. I like to ask you about event sourcing
 
damn it all to hell
 
mr5
10:46 AM
that's actually my task right now since the other project is pending
 
wait whats wrong with autofac?
 
mr5
@misha130 I've got 4 github stars
 
@misha130 We'd rather use ASP.NET (actually, .NET Core's) DI abstractions instead of taking on a 3rd party dependency.
 
lol. There is also Jon Skeet version of proto-buf, which is the base of Google's C# port
 
10:47 AM
@mr5 Ask away.
 
V.7
Hey all o/
@AvnerShahar-Kashtan Nice collection mb
 
I mean I guess you could replace extension methods with the autofac modules
and assembly scanning is meh
 
mr5
@AvnerShahar-Kashtan first icon: potion for stamina, second: potion for poison cure, third: potion for heal, fourth: potion for???
 
love, potion for love.
 
mr5
@AvnerShahar-Kashtan How do you guys persist the event logs, or what is the logic before storing it in database vs store it temporarily in memory?
 
10:48 AM
21 enenies approaching
 
V.7
4th for strength
 
27 enemies killed
 
@mr5 We go immediately to database. The events are the canonical source of data. Persisting them is critical.
 
V.7
Nah: 59 potions of health, 11 frags, 27 deaths, 21 assists
 
11 lives left and 59 health potions
 
10:50 AM
@mr5 We're a running microservices on Kubernetes. The service that writes events isn't necessarily the one who reads them. The DB is the central repository.
For instance, our configuration service has a UpdateConfiguration endpoint which (eventually) creates a new ConfigurationUpdated event in the event store.
We have (for now) two different places that listen to that event store - the configuration service itself which listens for the events, reads the new data, and updates the in-memory cached copy of the configuration (this happens separately on each container in the cluster), and the data service, which needs to know about updated configurations to know how to process incoming data.
Both services use CosmosDB's change feed notifications to get notified when a new event is added, read it from the DB, and process it.
 
mr5
@AvnerShahar-Kashtan what do you mean when you say "canonical"?
I'm thinking cannon
@AvnerShahar-Kashtan this is too much in our case. but I think I grasped the basic idea.
 
@mr5 Canonical, meaning it's the "true" state of data. You can have cached copies of calculated entities, but if someone were to ask "what's the current state of entity X in the system", the real, actual state would be the one calculated by all events for entity X. If you were to delete some events, the state would be different.
(Which is why you never delete events in an event sourced system. At most, you migrate them to a colder storage for archived entities)
 
mr5
What do you think of implementing a mobile app driven by Event Sourcing?
especially Xamarin.Android?
Do you think it's too much?
 
I think these things are orthogonal. Event sourcing is about how you store your data in the backend (whether you persist only the deltas for each event, or whether you store the latest state of each entity).
In our previous app, we had a first version which wasn't event-source, and a second version where we moved to event-sourcing. But that didn't change the front-end connection.
 
mr5
Our software architecture told me we could use it to sync data. Let's say the user's are offline and he does a lot of things while waiting to be online.
Syncing of events would be just a matter of reading the events and executing it.
 
11:00 AM
There's a similar concept in frontend-backend communications which you might be talking about, where instead of having the front-end work in a pull model (client calls server to pull data when it needs it), you work with a push model, where the server constantly pushes events with updates to all entities, and the client keeps track of local entities and updates them.
@mr5 Yeah, those two approaches can play well together - if you need to "backfill" the client with everything that happened since last time they were online, the fact that your data is event sourced makes it easier to create a list of update messages.
 
mr5
also, he also tells me we could just check of the last event id, compare it against the server. If unequal, means there's need a synchronization, if not, no API request should be done since everything is in sync.
 
But they're not linked. You can have a pull model client to a back-end that uses event sourcing (the controller would build the entities requested from cache or directly from events, and send them to the client), and you can have a push model without it.
 
where are the squirrels ?
where is the roach ?
 
@mr5 Again, you don't need event sourcing to do ETag/version based caching optimization.
Even if you simply store your entities in a DB without event sourcing, you can store a timestamp/version field for each entity, and the client can avoid pulling the data if the version they have matches.
 
mr5
11:04 AM
@AvnerShahar-Kashtan but that would require executing all services and check for themselves?
 
lets see..
 
mr5
 
thats for harry ?
 
@mr5 Not necessarily. When you make a REST call to get your entity, you either get the version as a field, or as part of the ETag HTTP header. You store it locally, and the next time you request the data, send the version as part of your request (say, using the HTTP header If-None-Match: <etag>. The service receives the etag/version, checks if there's a newer version, and if not simply returns a 204 No Content response, or something like that.
 
mr5
@Hans1984 for all of them insects
 
11:06 AM
hahaha
 
Ah, it should be 304 Not Modified, apparently.
 
fkng insects !
 
mr5
@AvnerShahar-Kashtan unfortunately, we don't honor http codes so much. only unauthorized, bad request, and >= 200 && <= 299
what I mean by >= 200 && <= 299 is the HttpClient returns true for IsSuccessStatusCode
brb, going home
 
but srly not a single rodent was seen that day(today)
aswell as no insects
hmmm
I think they are plotting something
cpt on the right
meanwhile harry..
 
11:33 AM
I dont like your avatar
new user
 
have you no sensitivity? If that was James Cameron, you'd have offended him
 
Bosses arrived
2 hours and 35 minutes late.
Time to pretend I'm good value.
BRB
 
later
 
11:52 AM
@HéctorÁlvarez good luck o7
 
@Neil well he had hitler as his avatar
im surprised it made it through the avatar-check
very weird
 
Honestly I didn't even see his avatar image
I can't load half the images
 
@Hans1984 lel
 
he had hitler with all the symbols as a south park figure
@Squirrelintraining :D
 
Jack, are you alive?
 
12:06 PM
Is that even English?
 
Looks like he's fine
 
I had a ping he was bork
oh well
 
he is bork
 
Although it did error on mr5 for some reason
why is bork?
 
12:08 PM
Wietbot is birk
Well, that too, but also bork
 
in Sandbox, yesterday, by Wietlol
@CaptainSquirrel I think its bork
 
Oh right yeah
 
He doesn't forget. Or maybe he just doesn't for Wiet
 
two wietlol commands?
huh
 
12:09 PM
it sais it forgot
 
learn and forget are both bork
 
Maybe it'll only forget commands you made
I could look at the code but it's food oclock
 
Command wietloltest has been forgotten
 
....what's the issue?
 
12:11 PM
Test my theory
Jack, learn elephant <>https://chat.stackoverflow.com/transcript/message/47811905#47811905
 
He learn da command, he output da command, he forget da command
 
I've learned the command elephant
 
Now try and forget it wiet
 
SANDBOX KIERAN
 
12:11 PM
Jack, forget elephant
 
@Wietlol You don't have permission to do that
 
WHO EVEN ASKED YOU @Harry
 
hmm...
that is different
 
@CaptainObvious UR MOM GAYE
 
That's new
 
12:12 PM
Yeah, i fixed that a while ago
 
Not yesterday
 
"a while ago" is today?
Jack, wietlol
 
Nov 11 at 16:15, by Héctor Álvarez
Fun fact: Did you know that elephants are born at 100Kg? That makes them the 2nd biggest babies in the world, only after Wietlol arguing other languages. :)
 
7 messages moved to Trash
No, a while ago is a while ago
 
Jack, forget wietlol
 
12:12 PM
@Wietlol There's no command called wietlol, Savvy?
 
bork
 
Try forget Wietlol
 
Yeah
its a capital W
 
12:13 PM
maybe the forget is case sensitive
 
bork,bork,bork !
 
Jack, forget Wietlol
 
@Wietlol You don't have permission to do that
 
But the command matcher I know isn't
AYYY
 
ah
I see
 
12:13 PM
{"command":"Wietlol","response":" https://chat.stackoverflow.com/transcript/message/47811905#47811905","createdBy":"Captain Obvious","createdById":3033062,"createdTime":"2019-11-20T09:33:53.9799649+00:00"}
I'll patch that
 
+1 for case sensitivity
 
Case sensitivity is hard
 
Even tho i'm ill and you asses haven't even asked where i am T_T
 
consistency is hard
it appears
 
ONLY @Hans1984 ASKED
Thank you hans.
 
12:14 PM
where are you @CaptainSquirrel
 
You should also patch the adding commands
Because it added wietlol when Wietlol already existed
 
i think that's just the case sensetivo bit
 
true
 
yeah I was worried
 
12:15 PM
But then presumably when it looked up wietlol it found my Wietlol first
 
kind of...
but now all squirrels have arrived
\o/
 
oh wait lmao
 
Because it ToUppers them
 
except black squirrel
 
or somehting
 
12:15 PM
It doesn't even check
wow i'm dumb
 
Jack, learn Wietlol wot?
 
I've learned the command Wietlol
 
haha
 
Jack, wietlol
 
Ok he's off now
 
12:16 PM
oh boo
 
oh there he is
 
I am surprised if it doesnt know !!wietlol2 or !!wietlol3 yet
 
Thats's because nobody's bothered to add the commands cap saved
 
I would write a converter to import them
but am lazy
 
do you have the database?
 
12:17 PM
lets go with that
 
There's a backup floating around somewhere
 
or an export of some sorts
 
In the java chat I think
or js
They're the same thing
 
!~>class A {
public static string Run(){
return JsonConvert.SerializeObject(new Vm{Name="nyconing", Address="Mimikkyu", Time=DateTime.Now});
}
class Vm{
public string Name;
public string Address;
public DateTime Time;
}
}
@nyconing {"Name":"nyconing","Address":"Mimikkyu","Time":"2019-11-21T20:19:18.8202063+08:00"}
 
Wait why are you using a method called Run
Why not use Main() like everyone else
 
12:24 PM
There
He's fixed
Jack, learn wietlol
 
I don't understand mate
 
Jack, learn wietlol <>https://chat.stackoverflow.com/transcript/message/47909656#47909656
 
@CaptainSquirrel That command already exists mate
 
ahoy mates ! @JackSparrow
no
Jack, in the box
 
....Come Again?
 
12:26 PM
ok bye again o/
 
bye
 
Wait what
 
\o
 
You can't just come in for like 10 minutes and leave
 
yeah why you leaving
are you trying to be productive and abandon us ?
:'(
 
12:29 PM
fiiiine
@Hans1984 nah mans is ill
 
oh you too ?
I also been feeling ill for a while
but today its a lil better
get well
 
I have the rumblies in my tumblies
 
oh
 
So you can rumbly tumbly from home
 
Aye normally i would
But there are no plugs in the bathroom
Sooooo
 
12:33 PM
Extension leads my friend
 
I have none long enough lmao
 
Alternatively a laptop with a functional battery
 
Yeah i have one of those
 
What do you live in a mansion or some shit
 
But when i run VM's the battery tanks
@CaptainObvious no the nearest plug is like 6+ meters away from the bathroom
 
12:34 PM
Oh god why are you running VMs on your laptop
 
I didn't make this decision
I think we are moving to docker or azure vm's soon
 
The nearest socket to my bathroom is less than 2 feet away
 
I also don't own this shithole of a house so
can't even add them
 
Renting?
 
yup
We've been "looking to move" for the past 3 years lmao
 
12:38 PM
Ooof
 
The issue is, this house is crap
But the location of it is perfect
 
@CaptainObvious It get first method
 
Oh christ
 
hey guys
 
!~>classtemplate
reply nyconing
!~>class A {
static object Run(){ return Foo(); }
static object Foo(){ return "Hello World! :)"; }
}
!~>class A {
static object 貓毛喵(){ return Foo(); }
static object Foo(){ return "Hello World! :)"; }
}
@nyconing Hello World! :)
@CaptainObvious Hello World! :)
!~>class A{
}
 
12:44 PM
!~>class A {
static object 👊👊💦(){ return Foo(); }
static object Foo(){ return "🎉 :)"; }
}
 
@nyconing Index was outside the bounds of the array.
@CaptainObvious Invalid token '' in class, struct, or interface member declaration
 
@CaptainObvious Invalid token '' in class, struct, or interface member declaration
no? It cant compile on visual studio too
 
Worth a try
 
!~>"🎉"
@nyconing 🎉
actually I dont even know what is the encoding behind transportation
It works on most language btw
 
12:50 PM
Is there a way to declare that a variable should never be null? I want the program to refuse to compile if I try to assign literal null to it, and/or crash at runtime if my_never_null_value = function_that_sometimes_returns_null() tries to assign null.
 
use C#8?
 
tickles @BlackSquirrel
 
wait, that doesnt crash at runtime
I forgot, C#8 was bad, sorry
 
^elephant
 
you can try to use the [NotNull] attribute
I think Resharper provides one
 
12:53 PM
"That sounds dumb. What would that accomplish?" you ask. The static code analysis tool we're using marks the code if (x != null){console.log(x.y);} as "possible null reference exception` and customer support says "just deal with it lol" so I'm looking for a nuclear option. If x is a nevernull, surely the analysis tool will stop wasting my time.
 
@nyconing still, I cant believe Hector thinks im a blue whale :(
while I am clearly a green lion
 
Wait, you are not an orange leopard?
 
@Kevin that "possible null reference exception" doesnt really look right tho
at least, x is not null
 
I cant see Wietlol's avatar from the beginning of the time
 
proxy?
 
12:55 PM
> https://i.stack.imgur.com/Se7jX.png?s=128&g=1
> i.stack.imgur.com unexpectedly closed the connection
Others can
 
@Kevin my approach is to not use nulls
make "null" a compilation warning
 
Maybe I may try at my home internet
 
encapsulate all null returning functions with IOptional<T>
that is a nuke... that doesnt always work
but at some point, not using nulls becomes really nice
C#8 could nuke it for you tho
 
I bet the tool will cry even if I do if (optionalX != null & optionalX.HasValue)
Oh well. Thanks guys. Just making sure I'm not missing an obvious solution.
 
12:58 PM
if the tool cries on that, perhaps the tool is wrong
 
Few years ago I deal with nullable data, Im thinking null was bad and I make a ext method to deal with it and after few months suddenly DBNull jumps in.....
 
I dont think null is bad tho
I just think making everything nullable without any distinction is bad
 
yes, now Im think null isnt bad. But DBNull is still rubbish
 

« first day (3323 days earlier)      last day (1619 days later) »