« first day (2980 days earlier)      last day (1951 days later) » 

12:57 AM
Morning O/
here's snowing.
 
1:34 AM
@Sinjai the things you find out after the fact
 
1:51 AM
It's a little obscure, but it seems like something they should have thought of.
 
2:14 AM
Well usually a PK is the First thing you make in a table, even if it's just for ref/show
 
 
5 hours later…
6:58 AM
good morning
 
Gooooood moorniiiiing CeeeeShaaaarp! Have you tried any new combinations for breakfast lately?
 
7:14 AM
Good morning.
 
Yeah, my combination: breakfast + lunch = lunch.
 
7:25 AM
pretty sure breakfast + lunch = brunch
 
7:40 AM
ohayou
 
posted on December 12, 2018 by Scott Hanselman

ASP.NET Core 2.2 is out and released and upgrading my podcast site was very easy. Once I had it updated I wanted to take advantage of some of the new features. For example, I have used a number of "health check" services like elmah.io, pingdom.com, or Azure's Availability Tests. I have tests that ping my website from all over the world and alert me if the site is down or unavailable. I've wa

 
7:59 AM
Hello
Container.RegisterType<IToolTipService, ToolTipService>(
                new ContainerControlledLifetimeManager(),
                new InjectionFactory(c => new ToolTipService(c.Resolve<IConfigReader>())));
If I have this in the main service
how can I reuse it in my classes?
Exactly the ToolTipService
 
put an IToolTipService in the constructor. It will be resolved, if your set up is correct
 
9:08 AM
IMO the MEF DI was cooler than the way it's done in ASP.NET core and with M.E.DependencyInjection. I liked that the classes themselves could define what they wanted to be exposed as, instead of having to set it up in every project..
 
MEF is PITA to use
I'll look at M.E.DI to C (see) what changed
 
do you feel that MEDI is better then?
I can't really see the benefits with it
compared to mef that is :)
 
I'm looking at dotnetthoughts.net/using-mef-in-dotnet-core at the moment
I don't see details like how to switch .dll runtime
which was a great pain in MEF
 
you can switch dlls in .net core?
 
I don't know
 
9:18 AM
I've read that once a dll is loaded it's kind of stuck with the executable
oh, sorry, I might have misunderstood you.
I don't see details like how to switch .dll runtime wanna elaborate?
 
I mean the page is really basic
no interesting topics
like is it possible to switch .dll runtime
 
I get it that using mef in .net core might not work (well), but what I liked with mef was that I could control in the export and import attributes what should be in the container. IIUC you have to define all of that in your app startup in .net core
still not following, sorry
 
all topic about .net core's MEF don't go into details. Common problems which could be upgraded from the previous MEF
they are all happy case examples
 
Good morningish.
 
yo
 
9:28 AM
@QuicoLlinaresLlorens Why set it up like this? Why not just RegisterType<IToolTipService, ToolTipService> If all the injection factory does it resolve the IConfigReader and pass it into the constructor, the DI container should be able to do that automatically.
 
hey, look at that. the last yo from november got pushed of the board
 
I do not know why
It was already done
and suposely well
 
@Default Yeah, MEF's attribute-based export/import was nice, but it's really not that hard to implement manually. Chances are your DI container of choice has a "LoadAndRegisterFromAssemblies" method or equivalent that it passed a list of DLLs and automatically registers types in it by convention.
 
@AvnerShahar-Kashtan hey, that would be sweet. Gonna look into that, thanks!
 
And we simply wrote a couple of extension methods for more fine-grained control.
 
9:33 AM
I've been using Microsofts DependencyInjection package.. i figured that was somewhat of a standard?
 
It's trying to be, I think.
 
mr5
little did they know, it uses Activator.CreateInstance
 
On another topic, I learned this week that xsd files can be used to "quickly" get up to speed with your code files. After generating the files (including `InsertNameHereCollection`s) (extra points of you're not using xsd.exe) you can add more functionality with partial classes. No need to maintain the xsd file! It doesn't even have to relate to the database when that changes. You just edit the files!
repeat for ~5-10 years and you have an easy life of maintaining your code
 
9:57 AM
@mr5 I'm fine with that
 
mr5
10:21 AM
not when you're in Xamarin and you're developing for Android
that shit is noticeably slow
 
ah. that sucks
 
10:40 AM
Not really. It is actually not slow as you thought.
 
ah first winterbasher
 
mr5
11:04 AM
what is winterbasher?
bashing the winter?
"hey you winter faggot"
 
the first one wearing a winterbash hat
 
11:26 AM
Anyone mucked around with generic registrations in Autofac? I'm trying to do something and I'm not sure I'm going at it correctly.
I have an interface ICacheBehavior<T>, and a class DefaultCacheBehavior<T> that implements it, which sets default behavior for a cache of a given type.
So I registered it using builder.RegisterGeneric(typeof(DefaultCacheBehavior<>)).As(typeof(ICacheBehavio‌​r<>)), which means that if I request any concrete behavior, say ICacheBehavior<Building>, I'll get an instance of DefaultCacheBehavior<Building>.
 
And that compiles?
 
I expected <> to not work
 
But I want to be able to register exceptions, so let's say I create a BuildingCacheBehavior : ICacheBehavior<Building> with specific behavior. Now I want to register that on top of the default behavior.
(typeof(TypeName<>) returns the Type object for the open generic type.)
Now, if I simply register BuildingCacheBehavior as ICacheBehavior<Building>, it'll work fine and override the default behavior.
But now I'm wondering the best way to scan all assemblies and load all implementations of ICacheBehavior<T> that aren't the default behaviors and register them, after the default behavior, so that they override with a specific behavior.
Something that will catch BuildingCacheBehavior and FloorplanCacheBehavior (who implement ICacheBehavior<Building> and ICacheBehavior<Floorplan>, respectively) without having to specify the specific types in my registration.
Hmm. There might be an autofac command for that.
builder.RegisterAssemblies(myAssemblies).AsClosedTypesOf(typeof(ICacheBehavior<‌​>))
Yup. That works. Cool.
 
11:46 AM
No problem bro
 
12:17 PM
I am spending way too much time on deciding how to store a directory on disk that's derived from a type name.
A symptom of Thursdays and the impending weekend.
Let's open it up: let's say you want to create a folder on disk for an arbitrary type name. How will you make sure you create a valid folder name that's also non-ambiguous?
The naive choice would be to name if typeof(T).FullName, which is nice, except for generic types.
Which A) contain a backtick for each generic parameter, which is easy enough to replace, but which also specify the generic parameter type way too verbosely.
 
@AvnerShahar-Kashtan just make a deterministic hash calculation based off of the type :P
joking aside, is there no FullName without the generic types added?
 
That won't be unique enough. You want to be able to differentiate between List<int> and List<string>, right?
 
you tell me.. why do you need this?
you could have a List<Anything> potentially
 
I think I'm just going to go with the basic, naive approach here.
I'm writing a generic cache handler for storing items to the local filesystem.
So if I get an ICache<T>, I cache save Ts to disk.
 
try the naive approach and give it a good run.. if it doesn't crash, it's probably not such a terrible approach
 
12:31 PM
Oh, it'll certainly work. I only need it for 4-5 types, and none of them have generic parameters or anything.
If it'll crash, it'll crash 3 versions from now when someone adds something that I'm not expecting today.
 
you could also just write an xml with meta data that describes the class you're serializing
 
Yeah, I can just use guids or some other opaque format for the files and folders, and keep metadata to map it to the actual type. I was hoping to avoid that to make it easier for humans to inspect the cache and skip the intermediate step of reading the metadata.
 
human readable gets you into trouble when you're relying on that to be unique as well
but you're right, ideally it would be better if it worked
 
12:51 PM
i just cannot work immediately after lunch break
i just sit for an hour or two
boring myself
 
@Proxy No, it's hard. That's what I spend that time writing pointless code for turning full tpye names into filesystem-compatible names.
I'm still not sure I'll actually use it in production, but it came out like this:
private static string BuildName(this Type type)
{
    StringBuilder nameBuilder = new StringBuilder();
    if (!string.IsNullOrWhiteSpace(type.Namespace))
        nameBuilder.Append($"{type.Namespace}.");
    if (type.DeclaringType != null)
        nameBuilder.Append($"{type.DeclaringType.BuildName()}+");
    nameBuilder.Append(type.Name.Replace('`', '@'));
    if (type.GenericTypeArguments.Any())
        nameBuilder.Append($"({string.Join(",", type.GenericTypeArguments.Select(BuildName))})");
    return nameBuilder.ToString();
I might replace the string extrapolation calls to separate Append calls if it turns out it defeats the whole point of the StringBuilder.
 
1:07 PM
also yesterday i got a great new task. We need to implement some kind of payment system into the mobile app. The deadline is supposed to be 30.12
 
yikes
 
Lemme guess, those were the exact specs. "Implement some kind of payment system".
And over the holiday season, no less.
Are Christmas vacations a standard where you're at?
 
pff, there are a full 11 days until Christmas.. how long would it take to implement some kind of payment system?
 
yeah exactly like that.
i told them it is impossible and that will take around 2 months to check and implement everything
well at least i submitted it to then, have not heard anything back yet
 
2 months to implement payment?
 
1:20 PM
yeah
well it is an estimation
 
What kind of joke is it?
 
what is a joke?
 
Is it a custom payment system?
 
it is a type of "implement payment"
 
So still i dont get a joke
 
1:22 PM
no, you dont
 
Yes, you are right
 
basically they said nothing besides implement payment as a requirement. No plan or anything is made what we are even going to sell.
the best thing nobody ever mentioned this is a planed requirement in the near future.
 
@Proxy Do you even have an account set up with a payment service provider? Do you want to support PayPal or just credit cards? What's the accepted practice in your country and/or industry?
Do you have some sort of security review process to make sure you're not accidentally storing customer payment information insecurely, or at all? Has the legal department checked to see that you're not in violation of anything here?
 
nobody has defined that or thought of that. We don't have anything set up. I have no idea idea what they are planing, neither do i know the regulatives
that is why i submitted the paper to them and told them that nothing will come out this year.
 
1:30 PM
i need to check myself how usually mobile payments are set up. So far i never bought anything over a mobile app
 
Is this app on Android? iOS? both? Are you expected to interface with the phone's Google Wallet/ApplePay?
 
yeah too many questions. The app is on both platforms
 
Mobile is actually probably easier than web if you can simply access the Google Wallet/Apple Pay APIs, but it means that the user can only pay with that wallet, not any generic payment system.
 
yeah i have research to do on that front. But i assume credit cards will be allowed, since our "app" is now also available online.
 
So that's some initial product work to do before development gets started.
 
1:34 PM
yup
 
 
4 hours later…
5:08 PM
Last message 4 hours ago??
 
you broke it!
 
5:38 PM
So regarding my current employment, can I get some feedback and advice?
I'm in an office where the people are really nice, but it's very small, because there has recently been an upset.
I'm playing a key role in some new projects, but they aren't mostly coding.
And other coders in the org have used a lot of shortcuts in projects and data structures that aren't best practice...
The job has a lot of perks, which I won't get into.
But it's not good for my coding skills overall, which were't stellar to begin with.
Last piece of the puzzle, I'm getting old now. So do I just be grateful I'm employed? Or do I worry about trying to work in a more structured environment where I can learn more?
Like, the devil I know or...?
C'mon there's gotta be some opinionated assholes here willing to weigh in...
 
are you happy at work?
do you feel like you're missing out on something work related?
btw, what's an upset?
 
5:54 PM
I'm happy. Good people, great work-life balance. Yes, missing out on progressing my career, possibly stunting my ability to work elsewhere if things go south here.
Upset = company split from major client, people laid off
We aren't doing MVC, LINQ, any JS libraries, etc. The tech here is old, except I'm doing some data reporting which isn't my career, but it's on a modern platform.
My last job was the opposite, I was working on some inherited code that taught me a lot, but the environment/management was a bit toxic.
OK, for example, on a project I recently worked on, there is no normalization. The original coder said it was "just your opinion" that it's bad that all the data was in a single table. And the boss, who is old school, said he wanted to "avoid a bunch of joins."
 
6:38 PM
Alright, let's change the topic...
Anyone know any good resources for data normalization in SQL server?
Or we could discuss politics, or religion, lol.
Is everyone on Discord now or what? This chat used to be hopping : )
How about Donald Trump, what a great leader, amiright?
Sigh. My trolling skills are obviously rusty.
 
7:34 PM
You're just trolling a very small audience. lol
If there's a programming Discord out there, do tell...
 
8:04 PM
If I have a table with an int identity PK, how bad of an idea is it to sort by PK rather than adding a timestamp column?
 
The PK is usually in order because of inserting
It depends on what the question is
How often is a new user added? not going to be able to answer
How many were added in 2018 - not going to be able to answer
How many users you have, you can answer
 
At this point, just need to order.
Ordering by PK just sounds like trouble. I'm gonna avoid it.
And as you've noted, I'll have access to other metrics if needed.
Moment of silence for the 50 rep I spent on a bounty the other day, btw.
Knowing this room, though, it'll be more than a moment.
 
You answered your own question.
 
Doesn't mean others can't answer as well.
 
But it depends on what the goal of the sort is, I would think.
You're better off asking int he SQL room maybe.
But it's not more active than here.
 
8:17 PM
This room is about as active as my deceased grandmother. And it's one of the most active rooms.
 
8:34 PM
lol
It used to be better damnit!
I want my Yahoo chat back!!!
Yes, Yahoo actually used to host a decent programming chat about 12 years ago.
Every time I go to the SQL chat to get an answer it's easier to just figure it out myself by the time I explain the problem. Rubber-ducking at work, if you will.
 
Hey, why do Java developers wear glasses?
They don't *C#*.
oh c'mon
No markdown here? :C
 
It refuses to cater to jokes that have been told a thousand times
 
Even Kendall's name gets to be italicized. This is discrimination.
 
u mad bro?
 
What's the object-oriented way to get wealthy?
 
8:42 PM
Furious
 
Inheritance.
 
Wow.
 
Why did the programmer quit his job?
 
Oh my.
 
He didn't get arrays.
 
8:43 PM
Too many lame puns?
 
His performance was sub-par compared to his colleagues?
 
sigh
arrays = a raise, get it? lol, I kill me.
 
Yeah, we get it...
Your jokes are okay, but you could use some pointers.
Test Test Test Test# Test# Test# C# C# C#
wat
C#.
 
There are 10 kinds of people in the world, those who understand binary, and those who don't.
 
8:59 PM
@SeaCharp you seem bored. Go make some unicorns.
 
If i have a call back function
in a c# method
whose return value is the return value of the outer function
the stuff I put "after" the callback function occurs synchronously after getting the result of the callback right?
so like
public int foo(){
var bar = FooBar.Function( x=> {
return 3
})

Console.WriteLine("Stuff");
return bar;
}
trivial example but "stuff" gets written before foo returns right?
 
9:16 PM
Seems trivial enough to test yourself, eh?
 

« first day (2980 days earlier)      last day (1951 days later) »