« first day (3797 days earlier)      last day (1134 days later) » 

1:46 AM
@mr5 9years old G600
 
 
2 hours later…
3:40 AM
 
 
1 hour later…
mr5
4:46 AM
my document delivery going round trip πŸ€¦πŸ½β€β™‚οΈ
 
 
1 hour later…
6:51 AM
[ntohl (MR.TaNk)] You need shopping cart mechanism. Locking the object on add to cart, and recheck if it's still available at checkout. Servers generally doesn't get message sent from SQL
[ntohl (MR.TaNk)] I'd try fiddler or postsharp
 
7:15 AM
[Squirrel in Training] GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
 
7:42 AM
Any y'all smart farts know a whole lot about threadlocal<t>? I'm trying to grok it. Sounds kind of like lazy<t> except whenever a thread starts, the value is uninitialized, then presumably after the thread ends the value gets gc'd. Do I not need to call any thread management code, it just knows "I'm in thread xyz, better use the xyz-thread-instance" or "I'm in thread abc, guess I'll use the abc instance" transparently to me?
 
@Sidney It's just a value storage with a unique storage per thread. So if you have two threads both using the same threadlocal storage, they both have their own values in there, and don't affect each other in any way.
 
8:01 AM
@Deathspike So if I have a singleton that's actually a threadlocal object, each thread has it's own version? (This is what I want for this particular use case)
 
@Sidney If each thread access the ThreadLocal<Singleton> and creates it if it doesn't exist, then yes.
 
Feels like black magic, but I'll give it a shot. Thank you!
 
[Squirrel in Training] Roel to rule the world πŸ‘‘
 
class Singleton {
	private Singleton() {}

	private static ThreadLocal<Singleton> Instance = new ThreadLocal<Singleton>();
	static Singleton GetInstance() {
		if (Instance.IsValueCreated) return Instance.Value;
		Instance.Value = new Singleton();
		return Instance.Value;
	}
}
Something like that would work.
 
the GC part of the ThreadLocal stuff is indeed interesting
but I doubt it would introduce a memory leak when you keep creating threads
it would probably have been spotted before if it were
 
8:06 AM
I mean, it feels like every time I need to do something crazy with threads or app domains or other black magic microsoft has already made a way to do it better than I possibly could have. I do kinda like being able to develop software without knowing shit about developing software.
 
@Wietlol Pretty sure you can. ThreadLocal works on the ManagedThreadId and if you arbitrarily keep creating new threads rather than using the existing threads from the thread pool, you can clog up a ThreadLocal very easily.
 
hmm
 
Just just use the thread pool and not roll your own shit. That's enough to make it relatively safe to use
 
I would expect ThreadLocal to use weak references of the threads
or be stored in memory private to the threads
using either technology, when the thread object gets gc'ed, it would clean the ThreadLocal data
 
I don't think it does, at least it didn't a few years back.
 
9:12 AM
[kesarling] umm... my ef core is generating empty up and down methods. Is this an ef core error, or is something wrong with my model class? (ASP.NET Core MVC)
 
depends
can you share your code?
 
[kesarling] yep
\[**[kesarling](https://discord.gg/PNMq3pBSUe)**] using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace AdminPortal.Web.Models
{
public class Asset
{
[Display(Name = "Asset ID")]
public int Id { get; set; }

[Display(Name = "State")]
public AssetState State { get; set; }

[Display(Name = "Current Temperature")]
public decimal Temperature { get; set; }

[Display(Name = "Current Mosture")]
public decimal Moisture { get; set; }

public IList<Alert> Alerts { get; set; }
 
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace AdminPortal.Web.Models
{
	public class Asset
	{
		[Display(Name = "Asset ID")]
		public int Id { get; set; }

		[Display(Name = "State")]
		public AssetState State { get; set; }

		[Display(Name = "Current Temperature")]
		public decimal Temperature { get; set; }

		[Display(Name = "Current Mosture")]
		public decimal Moisture { get; set; }

		public IList<Alert> Alerts { get; set; }

		public Location Location { get; set; }
@Wietlol
 
and your db context?
 
using Microsoft.EntityFrameworkCore;

namespace AdminPortal.Web.Data
{
	public class DatabaseContext : DbContext
	{
		public DatabaseContext(DbContextOptions<DatabaseContext> options) : base(options)
		{

		}

		public DbSet<Models.Asset> Assets { get; set; }
		public DbSet<Models.Alert> Alerts { get; set; }
		public DbSet<Models.Location> Locations { get; set; }
	}
}
 
9:25 AM
dotnet ef migrations cant even make an instance of that DatabaseContext
 
[kesarling] It was working will I added address property
[kesarling] *till
 
@Wietlol true, you need that Contxt builder IDesignTimeDbContextFactory<Context>
 
[kesarling] But why now?
[kesarling] Why did it work fine till now?
 
we just use a parameterless constructor that creates an in-memory connection
@d4rk4ng31 how do you create the migrations?
 
[kesarling] but, the question is, why did it work till now?
[Squirrel in Training] Maybe cuz 2 or more context?
[kesarling] Add-Migration <MigrationName> -Context <contextname>
[kesarling] nope, only 1
\[**[Squirrel in Training](https://discord.gg/PNMq3pBSUe)**] I think I always needed to add the ContextBuilder
Cuz else how can he build the context if the contextes ctor has parameters?
[kesarling] Idk, till now, I never needed those
 
9:31 AM
hmm...
 
[Squirrel in Training] and I can't remembe rthe last time i did it without
[kesarling] that's really weird
[kesarling] okay, let's try your way
 
I use the cli though...
so it might work differently
 
[kesarling] how do you add all that? @Noobi
[kesarling] this is my connection string: "LocalDatabase": "Server=(localdb)\\mssqllocaldb;Database=LocalDatabase;Trusted_Connection=True;MultipleActiveResultSets=true"
[kesarling] "LocalDatabase": "Server=(localdb)\\mssqllocaldb;Database=LocalDatabase;Trusted_Connection=True;MultipleActiveResultSets=true"
[kesarling] @Noobi ?
[kesarling] @Wietlol ?
 
I use dotnet ef migrations add
 
[kesarling] from cmd, or ps?
 
9:34 AM
a special terminal
 
[kesarling] mmm
[kesarling] the dev one?
[kesarling] for vs
 
the one from Rider
 
[kesarling] never used that
 
the one with glitter and animated unicorns /s
 
[kesarling] eh>
[kesarling] huh?
[Squirrel in Training] sorry am at work so i have a high ping response time
[kesarling] the options builder
[Squirrel in Training] Like this roguhly
[Squirrel in Training] Either where u do the migrations or somewhere else you define the ContextFactories
[kesarling] can you walk me through it? I mean, what is supposed to go in the file?
[Squirrel in Training] It's a class wich inherits from IDesignTimeDbContextFactory<T>
[kesarling] mhmm
[kesarling] and?
[kesarling] Also, why do we need it, and why was it working till now?
[Squirrel in Training] Dun't know, maye www.gidf.de knows πŸ˜›
[kesarling] Oh! You german>
[kesarling] anyways, what goes in the class?
 
9:42 AM
if you remove the address part again, does it work again?
 
[kesarling] let's see
[kesarling] Gut!
[Squirrel in Training] just inherit from the interface and you'll see πŸ™‚
[Squirrel in Training] so is haaans
[kesarling] oh! so nothing (aka blank class)?
[kesarling] Nice πŸ™‚
[Squirrel in Training] Also what are you doing in voice chat @kesarling ?^^
[kesarling] errm, no idea πŸ˜†
[kesarling] wanna join?
[kesarling] So we found out!
[kesarling] but... those columns were never there!!
[Squirrel in Training] @butler1233 lee voice chat party!
 
 
3 hours later…
12:19 PM
!~catcollision
 
:o
 
1:07 PM
question for anyone who understands Asp.net gridviews…..
<asp:TemplateField Visible="false">
<ItemTemplate>
<asp:Label ID="lblID" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>

I want to give lblID the potential to have the same value as "ID" -- but if ID is blank during the databind, a different value is bound to the label. Is this something that can be done?
 
mr5
2:07 PM
can you determine the event that ID is not blank?
 
that's what I wanna know..but in any case I may not need this anwyay
 
mr5
maybe a client-side script could be a workaround.
 
2:30 PM
I already found a workaround
 
 
3 hours later…
5:05 PM
@Freerey You should be able to use some Razor code to do that. I'm coming from .NET Framework but you can use a var to hold the value and use some conditional logic to set it to what you need
@Freerey Good for you
 
 
3 hours later…
7:45 PM
Hey all, for a SQL Database Table, I am facing a case where I wanted to put a unique constraint over 3 foreign key IDs fields from a different table. However, I was also was planning on making said foreign key IDs fields into a composite primary key. But, would said practice be a good practice? Or is it better practice to create a new separate id field(either a int or a guid type), and use the new separate id field as a primary field?
Essentially, when should a developer consider a composite primary key as being too many, and just opt to create a new separate id field, and use said id field as the primary key?
 
8:34 PM
Ben Popper on March 09, 2021
Rather than dig into complex math or over-simplify by using a pre-written function, we’ll write our own binomial test function, primarily using base Python. In the process, we’ll learn more about how hypothesis testing works and build intuition for how to interpret a p-value.
 
9:00 PM
[juanvan] Konsole - well that gets around the Console problem
 
@crazyTech best to Search on it's PK
 
@juanvan Thanks. I actually decided to create a dedicated new separate primary key id. It's awkward to have too many keys making up a composite primary key--leads to ugly lengthy sql code search queries
 
The best example of a Composite Key is the VIN of a car, Each Digit is a FK to some PK - be it mean it's a Honda/Ford or a 6 cylinder or 4
When you make a composite key, I believe the sql server creates that as an index
Outside the table, in a PK format to the row
Ya it creates a B-Tree Index
 
@juanvan Never knew that. That's a pretty interesting system.
 
Taking a look at your anime app - like the UI
diving more in xaml >_<
 
9:14 PM
[Squirrel in Training] im german ima allowed to do that
[Squirrel in Training] (it's german aswell)
 
9:29 PM
@juanvan Thank you :3
 

« first day (3797 days earlier)      last day (1134 days later) »