« first day (2860 days earlier)      last day (2080 days later) » 
00:00 - 10:0010:00 - 21:00

12:28 AM
if a nugget is targeted for .net standard, is there a way to make it compatible to .netframework?
 
posted on August 15, 2018 by Scott Hanselman

I've been loving Application Insights ever since I hooked it up to my Podcast Site. Application Insights is stupid cheap and provides an unreal number of insights into what's going on in your site. I hooked it up and now I have a nice dashboard showing what's up. It's pretty healthy. Here's an interesting view that shows the Availability Test that's checking my site as well as outbound call

 
@cubesnyc .NET Standard NuGet packages are compatible with .NET Framework
(e.g. .NET Standard 2.0 packages can run under .NET Framework 4.6.1)
 
ok so why am i getting this message: Severity Code Description Project File Line Suppression State
Error Could not install package 'vtortola.WebSocketListener 3.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.7.1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. 0
 
what is your Visual Studio version
 
2017
the free one
whatever that is
 
12:41 AM
Help -> About Microsoft Visual Studio, and what does it say on the second line
Should say sth like "Version 15.x.y"
 
one second
i am updating visual studio installer
15.2 26430.15
 
yeah you may want to upgrade
I have 15.7.6 on my machine
 
ok lets try it out
i am trying to use this websocket library
websocketlistener
 
whats the best way to gauge the legitimacy of a git project?
or rather the integrity
thanks mill, will try updating and hopefully taht works
 
12:47 AM
probably not much you can do unless the commit authors were themselves signing the commits (which is rare)
(i.e. nothing that will let you know whether the code was authored from the programmer you trust)
 
 
1 hour later…
2:01 AM
hey millenium
the update made it work
thanks for the help
 
mr5
o/
 
2:43 AM
hey all
glad to be back
 
2:59 AM
dosho
 
@KendallFrey hey man!
youre still here!
hi
 
hey bud hows it going
 
Its my morning. You all havent sleep? Room usually silent in this time.
 
Oh yea I should go to bed soon
 
mr5
it's usually me talking alone here this time
 
3:05 AM
No, youre with me.
 
3:19 AM
been away from c# for so long
its saddening
@mr5 not now that im back
:p
anyone here using unity
 
mr5
3:59 AM
which Unity is it?
 
unity c#?
3d
is that what yer askin
@nyconing its morning where i am
 
mr5
4:19 AM
The Unity framework or the Unity IoC?
Can someone tell me how this issue has been closed: github.com/dotnet/cli/issues/6926
Okay. I'm following the wrong command
 
lol on that
 
mr5
5:12 AM
Why is Web Services called Web API in Microsoft world?
 
mr5
5:23 AM
109
Q: What is the difference between a web API and a web service?

sanshIs there any difference between a web API and a web service ? Or are they one and the same ?

 
5:39 AM
Gooood morniiing CeeShaaaarp!
 
coz microsoft wants a custom everything for all things
- microsoft
notive how vs has its proj explorer on the left by default
 
5:59 AM
Mine was always on the right o.O
I think the default when I installed it first like 3 years ago was solution explorer pinned to the right and properties windows below that.
 
oh yeah i got it the other way around
theirs is on the right
and most ides are on the left
 
Good point, I remember eclipse having it on the left. Android Studio too.
 
Good morning.
 
6:16 AM
pretty much the whole world has theirs on the left
and how IE messes every design compatible to all other browsers lol
 
tbf how many people use VS and other IDEs in parallel?
Also I imagine it being a nice context switch when actually using several IDEs for diffrent things.
Probably helps changing the mindset to the respective language/framework/platform
 
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
@Squirrelkiller I do
 
@Squirrel you're kinda insane, you don't count.
 
@Squirrelkiller All in one days of work :proud:
 
its a breathe of air going from vs to others
 
6:27 AM
I just spent 3 days writing unit tests for a new day counting convention calculator. 43 test cases. That was fun. FInaly something I can actually test properly.
 
WAT
Turns out, I indeed have to rewrite 3 methods.
 
@Squirrelkiller I use VSCode a lot.
 
i feel lacking lol
ive never used test cases in my life
 
Since that also startsWith VS, I assume it has the solution explorer on the right.
 
6:30 AM
Moorning!
 
lol @Squirrelkiller
 
Convention program officially up, now I have to actually prepare my two talks. Yay.
 
6:37 AM
@c0dem0nkey @Squirrelkiller you know you coul jsut dock it to the left right?
@AvnerShahar-Kashtan If you feel that stage firght popping up, then you just got to imaigine everybody beeing naked.
 
I never got that. Wouldn't a room full of naked people be more stressful?
But nah, I'm fine with stage fright. Been doing this for a while. I mean, do still get that nausea and stress before going up on stage, it's just that I've learned to accept and embrace it.
 
I like my solution explorer collapsed on the right M'Kay
 
@AvnerShahar-Kashtan Depends on your primal instincts
 
For me it's more anticipation. At some point I started to like talking in front of many people, given I kinda know what I'm gonna talk about.
 
ill move to the dark side when i get tired
i keep mine left.
 
6:43 AM
I keep mine right... BECAUSE I AM GERMAN!
 
wtf
hahahahaha
 
Anyone have any idea what to do in Xamarin.Forms when a GestureRecognizer is added to a grid, but that grid can be empty, thus making the gesturerecognizer not work?
 
mr5
uhm wat
 
If you add a Grid.GestureRecognizer, it will naturally only work if that grid is there. For it to be there it needs content. But what if it doesn't have content and we need it to work nonetheless?
 
@Squirrelkiller Oh, I love public speaking. It's fun, there's a lot of adrenaline, I love to get feedback, and I think I'm pretty good at it. But the stress never entirely goes away, and it's fine.
 
6:58 AM
Good thing about being german - we're always right.
@Xariez Why would the grid not be there without content?
ALso if you can't change that. just put some spaces in there?
 
mr5
@Xariez why not set the vertical&horizontal optioons?
 
You know, even if i try setting some fake data, its not hitting the recognizer
So I feel like somethings more wrong than i thought initially
Okay yeah, its working now. Had accidentally subtracted something incorrectly, so what i thought was becoming a positive value was negative
 
mr5
7:19 AM
@Xariez I think I know what you have missed when the data does not reflect when you're working on the View side. Have you implemented your ViewModel with INotifyPropertyChanged?
 
I just looked at the test explorer again. It's actually 110 test cases I made in the last 3 days.
 
@Squirrelkiller Nothing to be proud of ^^
 
I'm proud anyway
Also because they're all green now :D
 
I read "german" at the beginning :D
So you got 110 test classes wich correlates to 110 classes i assume?
 
One test class for one class, 21 test methods for 4 methods, 112 test cases
112 now
PM came through with another case to implement
 
mr5
7:33 AM
Creating local db in ASP.NET Core is a pain in the ass
 
It's all ike "What happens if I start on 1.1.? WHat if I start on 29.2.2020 but have to pretend every month has 30 days? What if I start on 1.3.2020 andh ave to exclude the first day?"
@mr5 EF Core?
Also @Squirrel might be able to help
(With the localDB thing)
 
mr5
I'm just trying to setup a local database and leading me to variety of stacks: EFCore > Code First > Docker
@Squirrelkiller I'm not sure which stack I am using right now
I'd say, ASP.NET Core to be safe
I don't even know what the hell is this docker for
ASP.NET is very abstracted
Creating this manually would be easier
 
@mr5 You can use EF Core with SQLite and have a nice little embedded DB.
 
mr5
@RoelvanUden how do I configure my EF Core?
plz tell
 
You could also just go for linq2db w/ sqlite (you create the structure yourself, and just scaffold the models in c#)
 
mr5
7:37 AM
I want to stick with EF Core as much as possible
 
ef core basically mandates to be in charge of your model, if that's fine, go for it.
otherwise use linq2db :p
 
mr5
oh right
 
basically, model-first doesn't exist in ef core.
only code-first
 
mr5
hmm
 
@mr5 That issue is, like previously said, fixed. It did have INotifyPropertyChanged but we still needed a OnPropertyChanged() (that raises a given property) for it to work
 
mr5
7:40 AM
why is there two places for setting up what kind of repository should be used?
 
@mr5 two places?
 
mr5
@RoelvanUden appsettings.json and DbContext.OnConfiguring
 
@mr5 I haven't used appsettings.json tbh. Just OnConfiguring for the db context config
 
mr5
services.AddDbContext<TodoContext>(options => {
    options.UseSqlServer("DefaultConnection");
});
But I want to use the more abstracted way. It seems to be norm
 
7:58 AM
afk, lunch
 
@mr5 docker is nice to have brainfocckery wich is easy when you understood linux and the core principals
 
mr5
8:22 AM
> InvalidOperationException: Unable to resolve service for type 'TodoApi.Repositories.ITodoContext' while attempting to activate 'TodoApi.Controllers.TodoController'.
TodoController(ITodoContext context)
 
Looks like it's not registered in the DI container.
 
mr5
Where can I find that container?
 
So the number of japanese passenger cars sold in the US correlates with the number of suicides by car crash.
I love spurious correlations
 
I think you usually register it in the ConfigureServices() section of your Startup.
@Squirrelkiller It's well established that A) cancel causes cellphones, and B) autism causes vaccines.
 
lol
good ones
 
8:29 AM
Cancel causes cellphones? Oh shit. Are we all the yes-man now?
 
mr5
@AvnerShahar-Kashtan is it part of options.AddDbContext?
 
can somebody help me with singleton?
https://imgur.com/a/mVxRE1a
i'm confused
'Cart' does not contain a definition for 'Add' and the best extension method overload 'SettersExtensions.Add(IList<Setter>, BindableProperty, object)' requires a receiver of type 'IList<Setter>'
 
mr5
// version 1
services.AddDbContext<TodoContext>((options) => {
	options.UseSqlite(Configuration.GetConnectionString("DefaultConnection"));
});

// version 2
services
	.AddEntityFrameworkSqlite()
	.AddDbContext<ITodoContext>((options) => {
		options.UseSqlite(Configuration.GetConnectionString("DefaultConnection"));
});
 
why do people always make these nested classes when they try to make a singleton?
 
mr5
my version 2 seems redundant
neither one works
 
8:35 AM
No idea, doing that with a nested class seems way too complicated. That's not the question though, although I'm not entirely sure what the question is.
 
public sealed class Cart
{
    public static Cart Instance { get; } = new Cart();

    private Cart() { }

    // other stuff
}
 
mr5
@JeremyPaul can you edit your link with the image extension on it?
 
what is wrong with this?
 
You are right @Jeremy, Cart does indeed not contain an Add method.
 
(apart from people being able to create their own instances because of reflection)
@JeremyPaul where is the Add method that you want to call?
 
Just don't overdo it with the singletons. I started with a singleton and ended up with a god object.
 
mr5
just do your singleton on DI
 
Variant #4 in that article is basically what @Wietlol stated, and is the simplest and clearest and safest implementation.
 
How does singleton+DI work?
 
@AvnerShahar-Kashtan thanks
 
8:38 AM
Variant #5, with the inner nested class, can make it a bit more lazy in certain scenarios, but I wouldn't go there unless I specifically have a problem with that.
@Squirrelkiller You simply take a regular instance and register it in DI as a singleinstance/singleton dependency. That way anyone who resolves the dependency will get the same instance -> problem solved.
 
@AvnerShahar-Kashtan i find their reason for #5 rather annoying
 
so which one is best?
 
"what if you use this class for other purposes? then you lose the lazy initialization"
 
1 min ago, by Avner Shahar-Kashtan
Variant #4 in that article is basically what @Wietlol stated, and is the simplest and clearest and safest implementation.
 
im like "dude, its a frigging singleton!"
> C# and beforefieldinit
this is something I should prolly read at some point in time
 
8:41 AM
@JeremyPaul Just create a private constructor, a public Instance getter, and that's it. No need for locking, double-locking or quadruple locking.
 
@mr5 i find there is a difference between having a class that practically only needs a single instance and having a class of which you only want a single instance in the scope of your application
Singleton is the first, DI is the second
@JeremyPaul back to the original issue, where is your .Add method?
you try to call .Add but it is nowhere in the code you shared
 
mr5
@Wietlol yes. DI can act as a Factory also
 
there's none i'm confused where to put it
 
where is hector when you need him
can someone quote !!wietlol ? (i think)
 
mr5
What do you usually do, esp EF Core guys, when you encounter this SqliteException: SQLite Error 1: 'no such table: <TableNameHere>'.
 
8:44 AM
@mr5 we rant... usually for hours
 
mr5
dotnet gives up
 
@JeremyPaul depends on what you want to do with it
 
!!wietlol
 
Oct 6 '17 at 14:56, by Wietlol
i have no idea where to put it
 
3
A: Xamarin Forms - How to populate ListView from the data you entered?

Paul KertscherYour issue is quite simple, but occluded by the heaps of code you presented. The next time you should try to boil it down to a Minimal, Complete, and Verifiable example. The test collection is an instance variable, that means that a new variable will be created of each instance of the containing...

here's my question btw
 
8:45 AM
i'd place it in the Cart class (because that makes perfect sense to me)
 
I'm gone for 5 minutes and people forget the most important quotes
 
also, be very careful about giving singletons a mutable or non-constant state
imho, those arent singletons, but rather a mess
and mess has to be cleaned up at some point
 
sorry for my noob question lol i'm new to C#
 
have you done programming in other languages before?
like... kotlin maybe?
hides in the bunker
 
I'm guessing he hasn't. Because, you know, no-one actually uses Kotlin.
 
8:51 AM
nope
 
first programming language?
 
c#
i
2
i'm still a student
this is my first language
 
i C
 
typo srry
 
^^ (i see)
 
mr5
8:54 AM
@AvnerShahar-Kashtan I have changed the Controller's parameter to a concrete type and now it's working. Also, there doesn't seem to be any "container" in services
 
@JeremyPaul in basic terms, you define methods in your Cart class, then you can use those methods on the instance of the Cart
 
mr5
@JeremyPaul wasn't Tagalog your first language?
 
@mr5 ASP.NET Core has an implicit DI container - that's the "Services" collection.
 
public sealed class Cart
{
    public static Cart Instance { get; } = new Cart();
    static Cart() { } // for some reason I dont yet know
    private Cart() { }

    public void HelloWietlol()
    {
        // some body
    }
}
like that
then you can do
Cart.Instance.HelloWietlol()
 
@mr5 good one ahahaha of course but my first programming language is C#
@Wietlol can you put the list?
 
8:56 AM
in HelloWietlol (or any other name), you can add stuff to a list, sure
 
i'm literally confuse to that .
 
you could also be a hipster and make Cart extend a List, but that will be horrible later on
 
@Wietlol No, no, no. Don't do that.
 
maybe he is a hipster
 
A cart isn't a list of items.
 
8:57 AM
i know
a cart is also not a singleton
but i guess we can let it slip for now
school prolly says it has to be a singleton because school assignments usually dont make any sense
like... "your solution to this must have at least 10 classes"
im like "say no more"
 
what should i do to make a simple cart?
should i use singleton?
 
I got them a solution with 111 classes, and they were still not happy
 
Yes, a singleton cart makes perfect sense. I also love to see what other people are doing to their/my/our cart. A nice game of 'who can add and order before some fucks up my cart' is always appreciated.
 
Basically what i'm trying to do in this cart is to store my orders and later on i will POST it in my server
 
@JeremyPaul First things first, don't rush to change everything just because @Wietlol says. He's a purist. He's right about singletons often being a bad idea, but it's not necessarily a bad idea now.
 
9:01 AM
@JeremyPaul a singleton is basically a class with a single instance, in your application, you probably want one cart and one cart only
 
@Wietlol Hell fucking no, dude.
 
its common to make those classes a singleton then
because everywhere in your code, you can get that single cart without having to pass the reference over everywhere
 
On a single-user client, a singleton cart won't be too terrible. It should probably still not be a singleton but a single-instance object, accessed via a DI container, and thus be able to switch it out seamlessly if you switch users, but that's a more advanced scenario.
 
however, this brings some issues when you change the application design (which happens 5 (or 6) times a week normally)
for school however, that never happens
so you should be fine using anything
 
ok thanks!
 
9:07 AM
@AvnerShahar-Kashtan i miss Jaba enums now though
 
Is Wiet trying to help about things he doesn't know again?
 
what?
 
mr5
What would be my predicate in TodoItems.Where(e => ??) such that e.Id is one of the values produced in the formula 4N + 1?
 
Java, or even better, kotlin which has language support for singletons
 
i'm still confused btw .. i'm f*cking stupid lol ..
2
 
9:12 AM
@mr5 how many values does that formula produce?
or is N any number?
 
@mr5 I'm more concerned that an ID is calculated...
 
you never use the id to calculate say, the average age of people?
 
But otherwise, TodoItems.Where(e => e.Id==(4*<n>+1))
 
.Where(e => e.Id / 4. - 1 == 0)
 
I don't massively recommend the use of those magic numbers, but it will achieve what you're looking for
 
9:15 AM
i think thiss is what he means
 
just introduce a constant named MagicConstant = 4;.
 
public static const int Zero = 0;
public static const int One = 1;
public static const int Two = 2;
public static const int Three = 3;
...
 
What about if you need them as decimals?
 
public static const decimal ZeroD = 0.0m;
public static const decimal OneD = 1.0m;
public static const decimal TwoD = 2.0m;
public static const decimal ThreeD = 3.0m;
...
pls dont ask me what if you need them as doubles
 
If only there was a library that did things like this
 
9:26 AM
JS ew
 
mr5
@LeeButler what's N here?
 
I don't know, you said it in your formula
 
mr5
@LeeButler I'm just playing with EF Core ^^
 
i see i made a meth mistake
 
mr5
@Wietlol N is any number, preferably a sequence starting from 0
 
9:28 AM
.Where(e => (e.Id - 1) % 4 == 0)
this is the formula you need I think
 
The Pentium FDIV bug is a computer bug affecting the floating point unit (FPU) of the early Intel Pentium processors. Because of the bug, the processor might return incorrect binary floating point results when dividing a number. Discovered in 1994 by Professor Thomas R. Nicely at Lynchburg College, Intel attributed the error to missing entries in the lookup table used by the floating-point division circuitry.The severity of the FDIV bug is debated. Intel, producer of the affected chip, claims that the common user would experience it once every 27,000 years while IBM, manufacturer of a chip competing...
 
mr5
holyfuck
EF Core is super slow
 
constant not always friendly
 
@mr5 So is EF :-P
 
@nyconing Oh no, gotta work around a bug that might exist in a 24 year old cpu
 
mr5
9:31 AM
@Wietlol yis that works!
@RoelvanUden basically, all Microsoft stack ^^
 
Who know
 
mr5
I would never make a personal project using EF
 
what would you use then?
 
@mr5 There's definitely something wrong with your setup
 
Hello everyone.
 
9:38 AM
oh, that is me
hya
hides in bunker
 
haha
I need to run certain methods at set intervals, for multiple projects. Would it be a good idea to use a task for this? It will act as a checker for the whole C# solution.
 
Aand back from lunch!
Yum!
 
I heard that game servers use this method, by using one thread and executing the work for all the projects, and my project is similar to a game server. Mainly processing queues, remove expired classes from dictionary's and things like every 60 seconds or 10 minutes for some
 
@LeeButler @mr5 Yeah I was going to say. EF might not be the fastest thing out there, but it's not that slow unless you got HUGE queries
 
"similar" how?
 
9:41 AM
well its a server that provides data to clients
although this checking is for server sided resources, not really anything to do with the client
 
Well if it's a server, it shouldn't need to be doing stuff regularly unless people are requesting and/or posting data
 
you want to make a garbage collector?
 
Sort of, I need to process items in queues like every 10 minuted for some classes, other parts of my project may require shorter intervals.
the queue thing is just one of many things
I also need to remove class instances from dictionary's when a property datetime is met and their expired.
 
*skepticism face*
 
lots of small things, for different areas on the solution
why skeptical?
I guess all of this stuff should run asynchronously too, so probably need a thread or task
but not sure if a threading timer would work better
but with a timer it would be 1 set interval, so maybe not
although my initial idea was to run it every 60 seconds, and check in on everything
things that needed longer intervals would just return until its time
 
9:47 AM
make different queues?
a timer for each queue
 
yeah I was thinking of just coding a class to do it all for me.
the class would have a list of methods that needed to be called, along with an interval
 
why have a class for it?
 
I'm going to be using it a lot, it just seems logical to have a class to do a lot of the under the hood work.
in a lot of different places
 
if you want a class for it, make that class have one timer and one queue
then make a set of instances from it
 
mr5
@LeeButler this is my first use of EF. Debugging is enabled also so that might be the culprit?
 
9:51 AM
Debugging always slows things down. For a best case scenario, Build it as release and don't have a debugger attacked
 
Yeah, never attack the debugger
@Wietlol Me at a few occassions in college
 
?
 
4 mins ago, by Wietlol
why have a class for it?
 
ah
 
We had a course where we learnt how to make good and bad user interfaces and user experiences
 
9:53 AM
of course
 
About 60% of that course was the teacher being sick, 20% was him talking about why he was sick, and 20% was learning things I already know
I shit you not
 
traditional school
 
But the teacher was cool as fuck, dont get me wrong
I slept through the final exam and he allowed me to do it via skype instead lol
 
I wish people would learn how to make good UI
 
It's not that i don't know how to make a good UI, it's that I'm fucking shit at design unless I can take inspiration from something
 
9:55 AM
 
mr5
still slow. ew
 
As far as I know I'm the only person who can make a decent UI here
 
@Wietlol That is so true holy fucking shit
Example? @LeeButler
 
@mr5 that looks like postman
 
Hold on I'm getting one
 
9:56 AM
can have several reasons, where EF is only one
 
Yeah I think it is postman
 
mr5
@LeeButler yes it's postman
but I'm using PUT
so PUTMAN
 
i dont GET it
 
I mean, i've seen much worse
But also much better
 
9:58 AM
Thats the improved version
 
I mean, we talked about postman just now. Their UI is fantastic
 
mr5
Also, you guys at least, look on existing themes
 
The reddit-redesign is also quite nice, apart from the newly introduced bugs
 
@Xariez Is it? Have you seen a CRM app made by Google or Apple?
 
00:00 - 10:0010:00 - 21:00

« first day (2860 days earlier)      last day (2080 days later) »