« first day (2734 days earlier)      last day (2215 days later) » 

2:00 PM
@Hypersapien first start with modularizing them if you goal is refactoring
then write unit tests against them
you will get what is doing what
 
Question: Why is it hard to get info on system diagrams: deseng.ryerson.ca/dokuwiki/_detail/…
 
@RonaldMunodawafa Getting info is pretty straightforward, the problem comes when you want to know how the whole system works, becuase nobody tells you where it actually starts.
 
@HéctorÁlvarez I ran into that problem recently
I don't think system diagrams are time-sensitive with respect to processes involved but you can have a sequence diagram to figure that out
You repeatedly do this until the coding is not part of the design process
 
What a delicious word salad. I must have the recipe.
 
2:06 PM
How do you test a design?
 
How do you want to test a design?
 
To test a design, first you must design a test.
 
@Wietlol I am asking how that is done.
 
You look at it defiantly. Stare with your eyes almost shut.
 
So how do you know your design is correct?
Before you start acquiring the necessary resources to implement the project
 
2:08 PM
@RonaldMunodawafa You mentioned Sequence Diagram and State Flow Diagram. Are things like that built into VS? I don't see them in the item type list.
 
@RonaldMunodawafa your design is never "correct"
but it can be good
 
@Hypersapien You need Visio for that
 
it is good if you can change it
 
@HéctorÁlvarez ≖_≖
 
2:10 PM
for which you must first have something that uses the design
then you can test if you can change the design without changing how it is used
if so, you had a good design before you changed it
so now you must test the new design
 
Can Visio analyze the code itself, or do you have to create the diagram manually?
 
iDunno what Visio is
 
@Wietlol Diagramming software
 
@Wietlol Vision without the n, duh
 
I've used it before, years ago. But mainly for making diagrams of physical objects.
 
2:12 PM
@Neil that'd be "a Vision"
 
I hate that all this Enterprise software has gone to subscription models
 
Visio is not enterprise software as far as I know
It's available for single users
 
Our India branch just got a new office complete with a freakin' game room
 
You can still buy it for a lot more
 
2:14 PM
Why can't I get a game room?
 
Just get a PS4
 
@RudiVisser I'm sure they'll let me put it next to the coffee machine ಥ_ಥ
 
Under your desk, HDMI switch to your monitor, sorted
 
@RudiVisser was here:
        foreach (var propertyInfo in typeof(T).GetProperties(BindingFlags.Public |
                                                         BindingFlags.NonPublic |
                                                         BindingFlags.Instance |
                                                         BindingFlags.DeclaredOnly))
    {
 
ah good ol' enum flags
 
2:18 PM
Woop
 
I've had an easier time decompiling 3rd party libraries and editing them to suit my needs than reading through all this typeless text.
 
Bah, make it dynamic
 
@Neil PS4? You have a PC. Have you ever heard of www.steampowered.com? ;-)
 
Actually it's typed, just the type is anonymous to me.
 
@HéctorÁlvarez Types can be imposed on previously untyped paradigms when the definitions are inherited from the base concepts.
 
2:19 PM
I finally played through Inside. That shit got weird and creepy near the end.
 
meh, if only I had my own office
 
What typeless text are you reading?
 
Like, Body Horror weird and creepy
 
@Squiggle read below
!!moonowl
 
2:21 PM
@Squiggle I wish there was a key to replace T with a sample type automatically at design time.
 
That is exactly what I meant
 
code.Replace("T", "object")
 
@Neil Are enum flags bad?
 
@RonaldMunodawafa Well nothing is strictly bad.. except maybe gotos, non-tail recursion, singletons, .. well okay.. lots of bad things
 
That's "forged" as in forging money, not like forging a sword, right?
 
2:23 PM
But enum flags aren't strictly bad.. depends on what you need to do
 
@Neil gotos are great
 
10 HOME
20 SWEET
30 GOTO 10
 
@Neil Why are singletons bad?
 
@RudiVisser 265 words and a nearby cow have been replaced. Error: objectestData data... wrong syntax.
 
2:24 PM
No structure is bad in and of itself. Whether it is good or bad is in how it's used.
 
@Neil My point exactly
 
@RonaldMunodawafa Because it separates the usage of a class from the calling class in such a way as it makes it difficult to deal with later
It's like having a global variable
 
Is there any use of a singleton that wouldn't work equally well by making it a static class?
 
@Neil Need to check which of the players in a turn-based game have had their turn
Is that a good enough reason
@Hypersapien Forging in as in forging money
 
@RonaldMunodawafa there are better patterns for that. If it's about managing concurrency, singletons are still terrible.
 
2:27 PM
@RonaldMunodawafa No. Why wouldn't you have a game board class with that info?
you may have one instance of game board class, but that doesn't mean it should be a singleton
 
@Neil Because you have a GameSession class that contains that info. The board just contains the coordinates and manages the placing and displacing of tokens onto and from it
 
If it's turn based, you can just loop through the players in a determined order and not check if someone's turn has been had.
 
@RonaldMunodawafa So make the game board contain a GameSession instance
or vice versa depending on what's most comfortable for you
if you're not using a singleton, it must depend and be depended by other classes
This isn't a bad thing
 
@RoelvanUden Very true!!!
@Neil Why would the board contain a GameSession instance when a Board instance part of the former's state?
You don't want circular dependency
 
2:35 PM
Circular dependencies are the best type
 
Circular dependencies are a special case of circular reasoning and if expressible they can lead you to stackoverflow
 
@RonaldMunodawafa The Board instance does not contain player positions and whatnot, just the board dimensions and tiles? In that case, yeah, a singleton is fine.
 
or the world is immutable, and throw the baby out with the bathwater. Board have a private value of who is coming. When that person did it's action, the whole board changes state (who is coming included), and replaces the previous board state.
 
@RoelvanUden The Board instance contains player token positions. It is just not aware of whose turn it is
In the real world, a board does not keep track of whose turn it is
 
@RonaldMunodawafa Yeah, then your board cannot be a singleton.
 
2:38 PM
why coming up with real world? It's a model of real world.
 
No, I would think the Board just contains all positions, and the GameSession contains references to those positions for each player.
 
But can you have multiple GameSessions pointing to the same Board?
 
Or the player contains references to his own positions?
 
In a turn-based RPG, for example, you could share a 'Map' between many instances of a 'Battle'. The player/character positions would be stored in the 'Battle', rather than the 'Map'. The 'Map' contains all the landmarks, etc.
 
Or even better you message the board to ask it whose piece occupies a given position
And what piece it is
 
2:40 PM
dynamic position = Board.Hi2U(BoardOperation.WhereIsMaPieceBro)
 
@RonaldMunodawafa, that's a good point
Especially in games where each player controls multiple pieces.
 
We must respect the single responsibility principle
 
I'm thinking something like Settlers of Catan where you not only have to keep track of the tiles, but the corners AND edges between the tiles.
 
@RoelvanUden map would be static
characters would have a Battle state
which held battle specific properties
 
@Hypersapien It's the responsibility of the board
 
2:45 PM
Settlers 3 was a great game
 
@Hypersapien it would be easier than that
 
And remember OOP ultimately is about messaging, encapsulation, late binding and dynamic dispatch
 
Tile would have a list of edges and a list of corners in play
 
no, it's about objects
it's sort of in the name
 
no, its about forging relationships where none previously existed
 
2:46 PM
OOP is about concealing complexity
 
OOP is not a smoke bomb
 
@RonaldMunodawafa so is literally every programming language and design pattern
 
@KendallFrey FP removes complexity
 
by concealing it
 
I read this on reddit the other day
 
2:47 PM
hahaha
 
le reddit
 
@KendallFrey No
By using functions
 
which are an abstraction
that conceals complexity
 
A very good abstraction
 
You talk about single responsibility but i guarantee none of your code is SOLID
 
2:50 PM
@Failsafe I know
It's like ACID
I used to think a lot of databases were ACID compliant
Until I realised MongoDB is not
@KendallFrey Can you explain software transactional memory?
In one sentence
 
MongoDB literally released a post saying they were dropping acid support
 
@KendallFrey in one sentence or less
 
In computer science, software transactional memory (STM) is a concurrency control mechanism analogous to database transactions for controlling access to shared memory in concurrent computing.
 
2:52 PM
i, too, can copy google search results
 
@KendallFrey Thank you
 
If you actually wanted that you could have just pulled up wikipedia
 
I know
!!wiki STM
I am sure she used to bring up wikipedia if you asked her
!!wiki software transactional memory
Oh well
 
!!are you alive
 
@KendallFrey Yes!
 
2:54 PM
is moonowl in prison
!!unban RonaldMunodawafa
 
@Failsafe I'm afraid I can't let you do that, Failsafe
 
!!wiki STM
!!help wiki
 
@Failsafe wiki: Search Wikipedia. /wiki term
 
/wiki STM
 
@rlemon wiki command borked
 
2:56 PM
!!wiki rick roll
 
Where is the GitHub page?
 
no github page lol
 
So where can we post issues?
 
!!tell Ron help
 
@Ron Information on interacting with me can be found at this page
 
2:58 PM
Hey look its the github page
 
hey its me ur github page
 
Anyone know when the Windows update with the new "Sets" feature is supposed to be released? I thought it was supposed to be yesterday.
 
2022
 
June 31st
 
2022-06-31? That's paddlin'.
 
3:20 PM
It's in the next double-leap year.
 
I mean you can have it now if you run insider builds
 
** vent ** I'm sick and tired of marketing people not understanding the difference between a CMS and a scratch-built set of pages for a piece of online software ** end vent **
 
Are you saying you don't like the worlds best CMS, the FileSystem™
 
s/ the difference between a CMS and a scratch-built set of pages for a piece of online software//
s/not understanding//
 
Haha. I'm not. But other people seem to have difficulty with the concept
 
3:26 PM
anyone here use syncfusion controls?
 
"Why can't we just move all the code from this complex, year-long development project into Umbraco and have it just work?"
 
ShippingMethodPriceBandConditionTypeEnum Oh god
 
"Just" is the most dangerous word in software development
 
@MattThrower i disagree
"assume"
 
@Wietlol A close contender :D
I have eaten too many chocolate bourbons as an ineffectual means of assuaging my frustration.
Ineffectual, but tasty
 
3:31 PM
Wait, chocolate bourbons?
 
@Hypersapien Biscuits
 
Oh
Never mind.
 
The Bourbon biscuit (; sometimes referred to as a Bourbon cream) is a sandwich style biscuit consisting of two thin rectangular dark chocolate–flavoured biscuits with a chocolate buttercream filling. The biscuit was introduced in 1910 (originally under the name "Creola") by the biscuit company Peek Freans, of Bermondsey, London, originator of the Garibaldi biscuit. The new name was taken from the European royal House of Bourbon. A 2009 survey found that the Bourbon biscuit was the fifth most popular biscuit in the UK to dunk into tea. Many other companies make their own version of the biscuit under...
 
Not particularly nice ones at that
 
@Butler1233 That's a matter of opinion.
 
3:34 PM
"Chocolate flavoured" aka not even close to tasting like chocolate
 
I was thinking it was whiskey flavored chocolate or something.
 
biscuits.stackexchange.com
@Hypersapien You used to be able to buy whiskey-infused chocolate milk.
Or rather I used to be able to
That was nice
Nicer than the biscuits, certainly
 
I'm out
Bye
 
C'mon, they're not so disgusting as to drive people from chat rooms
 
how can I make it work?
https://gist.github.com/mrNo0b/5102998711b09deca38d53468ed73ef4
I got confused with this interfaces :\
 
3:44 PM
Instantiate PayClientView, make sure CI gets instantiated, and call MyPayClientView.CI.ID
 
Error	CS0535	'PayClientView' does not implement interface member 'IClientView.CI'
 
Same way you would do it without the interfaces
 
@Mr.Noob its a limitation of C# overriding
you cant do it that way
 
:(
 
CI in PayClientView must be of type IClientData
(also, you need a { get; set; } with it
otherwise, its a field
 
3:50 PM
VS can fix it to:
IClientData IClientView.CI { get; set; }
 
anyone can fix it to that
 
but ClientPayLogData class has more variables that i dont need to access
 
CI needs to be a property, not just a class variable
 
@Mr.Noob you could try having the type as generic
 
    public partial class PayClientView : UserControl, IClientView {
        public IClientData IClientView.CI
        {
            get
            {
                throw new NotImplementedException();
            }

            set
            {
                throw new NotImplementedException();
            }
        }
    }
 
3:53 PM
they're discussing it for C# 8 IIRC
 
@Default what?
 
covariant return types
 
@Mr.Noob
public partial class PayClientView : UserControl , IClientView
{
    public ClientPayLogData CI { get; set; }

	public IClientData ClientData => CI;
}

Class:
public class ClientPayLogData : IClientData
{
    public int ID { get; set; }
}

public interface IClientView
{
    IClientData ClientData { get; }
}

public interface IClientData
{
    int ID { get; set; }
}
this is your best shot i think
 
allowing to override an interfaces return type with something more derived
 
i hope they also ad contravariance then
interface I {
    B Foo(B b);
}

class Impl : I {
	public C Foo(A a) {
		// works
	}
}

class A {}

class B : A {}

class C : B {}
//works as in "should work"
works in Java :D
 
3:59 PM
have a nice evening everyone, same time tomorrow?
 
if you take it a step further, you could even say that I::Foo could have more parameters than Impl::Foo
and, if C# had multiple return values, that Impl::Foo could return more values than I::Foo
 
maybe I can do it like this:
public ClientPayLogData CI;
IClientData IClientView.CI { get => CI; }
 
or, for example, have I::Foo return void and Impl::Foo return anything
@Mr.Noob im not familiar with that syntax
 
VS add '=>' idk what it does... I will check if it works now
 
but yea, IClientData IClientView.CI => CI; also works
=> means its a getter
 
4:02 PM
ah
 
I just wasnt familiar with IClientView.CI
Rider explained it to me quite nicely :D
but, this does mean that the IClientView.ID must be readonly
aka, not have a setter
if you also want to have a setter, you probably want to pass the type as type argument
since at that point you lose any variance
in any case, im off
 
ok Thank you!
I dont need to set it there so only getter
hmm, seem to work now
 
5:03 PM
im ussually for the concept of never changing existing state of objects
so, i rarely have setters
at best, mutable collections where I only ever add things to
for ui stuff its different though
 
I'm reading up on asynchronous programming with async and await from Microsoft documentation. I find this bit "Typically, you await the call to an asynchronous method immediately". I'm confused because all along in the examples there's a method call that does work between declaring the task and the await keyword. Can anyone help me understand how this is the typical flow of asynchronous programming?
 
War
await and async are used together
you mark the method async and within in it you await async calls you make
async is mostly useful for IO bound operations (e.g file IO, networking, db calls) ... the sort of stuff that means our cpu will be kept waiting for data to come from something else for a period of time
the use of async will allow the OS to do other things whilst the thread waits
@JoeCuevas does that about cover it ?
 
5:20 PM
Thank you War, I understand that but as I'm looking at examples of control flow of async it states that there's work done between a declared task and the await keyword. for example: 1. Task<string> getStringTask = client.GetStringAsync("url");
2. DoIndependentWork(); 3. string urlContents = await getStringTask; Documentation states that you typically awai the call to an aysnchronous method immediate as such: string urlContents = await client.GetStringAsync = client.GetStringAsync("ur"); So if I follow the documentation, when does my independent work get done if it's called immediately?
Excuse my formatting, it's a mess.
 
@JoeCuevas it gets run after the url is returned
await essentially suspends the function until the task completes
 
So my step 2 from the example above would have to be completed after: string urlContents = await client.GetStringAsync = client.GetSTringAsync("url"); DoIndependentWork() ?
I see the benefit from the example with labels 1,2,3 but I don't see how independent work is performed if I immediate await the call to an async method via string urlContents = await client.GetStringAsync = client.GetSTringAsync("url");
I mean via string urlContents = await client.GetSTringAsync("url"); **
 
The async method (task) is awaited inside the client.GetStringAsync(), whereas you only await the urlContents after IndependenWork() is done.
Inside GetStingAsnyc, there is somewhere a await GetHttpResponse()or something. When that happens, your outer method starts working on IndependentWork();
 
5:36 PM
How would I make this process: Task<string> getStringTask = client.GetStringAsync("url");
DoIndependentWork(); string urlContents = await getStringTask; into this formatting: string urlContents = await client.GetSTringAsync("url"); Where do I place DoIndependentWork();
That's what I'm trying to understand from this scenario.
 
your first placement was exactly right:
// Start web requests (maybe on another thread, maybe not, you don't care):
Task<string> getStringTask = client.GetStringAsync("url");
// Do some stuff so the cpu isnt idling:
DoIndependentWork();
// Get the string from the web request. Wait for it in case it isn't here yet:
string urlContents = await getStringTask;
Whats the best way to build a server application? For getting and sending json? TcpListener? HttpClient or something?
Also, when I have a website in my server, do I have to hardcode the url into the website and send requests there, or is there a kind of shortcut?
 
Got it, so DoIndependentWork(); only works out in the first placement.
@Squirrelkiller, you can use ASP.NET MVC to build an API Controller that will respond to HTTP POST and GET requests to consume and serve JSON content. Publish to IIS server and send your requests to the application url via the MVC routes you specify.
 
6:19 PM
@Squirrelkiller do you kill squirrels or are you a squirrel that kills?
 
@Mike everyone forgets I might kill using squirrels
@Joe i have an existing blazor project, can I just add a controller to that, or do I have to make a separate project?
And also, how does the controller get built? In a normal application, the .exe starts Main() and from there everything starts. For a website, IIS looks at the web.config or sends the index.html to the client sending a request.
How does the API controller work?
 
6:48 PM
@Squirrelkiller, I believe you should be able to add a controller to your blazor project. I found the following resource: talkingdotnet.com/… As for how it works: tutorialspoint.com/asp.net_mvc/asp.net_mvc_life_cycle.htm
 
7:06 PM
Woah, that's exactly what I need, thanks @Joe!
 
8:03 PM
Hey all. Anyone work with HttpClient at all?
I posted a question that's getting negative votes :( So I thought I'd see if anyone in the chat knew. I'm just trying to hit an API endpoint with basic authentication. I can do it in postman but having trouble in code.
 
@DanielJackson it's getting downvoted because there's a lot of noise in it
Word of warning it's already got 2 close votes
 
What do you mean by noise?
 
And screenshots of basically anything are almost always gonna get downvotes
 
I only added it in hopes to not get negative. Should I have just linked the document?
 
@DanielJackson lots of stuff about how frustrated this is making you
And yes
 
8:07 PM
hey my c# is a bit rusty after working with typescript for over a year... why can't I assign values to a list at a particular index?
 
@DanielJackson also you've got code that commented out in the question which is always a giant red flag. My advice? Delete the question before it gets any more negative attention, make an MCVE, then edit and undelete the question
@StevenLiekens code plox
 
probably would have worked if I used an array
 
I read that pics were a no no of code, I didn't relate that to docs but I should have. I removed the two mentions of it frustrating me as it's irrelevant.
@MikeTheLiar What red flag does comments leave? So I know? I thought it would be good to show what else I had tried, it's only a few lines of code total. Also what's MCVE so I know?
 
@StevenLiekens interestingly enough, if you initialize it as new int[20].ToList()it appears to work
 
Thanks @MikeTheLiar
 
8:15 PM
@StevenLiekens the List<T>(int) constructor creates a list with a specified capacity, not size
 
MCVE is a Minimal, Complete, Verifiable, Example. The bare minimum of code required to illustrate your problem.
 
Ok that makes sense. Thanks for the help @MikeTheLiar
 
right so why doesn't it just grow when I assign to it like arrays do in javascript lol
my mind is twisted after doing frontend for so long
 
Because Javascript's behaviour is dumb lol
4
 
@DanielJackson not the comments per se, but the commented out code. It means that you're just trying random stuff (no offense meant, we've all been there) which is fine, but it indicated that there's going to be cruft in there that isn't relevant to the problem at hand.
 
8:16 PM
and for a serious answer, well
if you were to assign a l[5000] = something;, the list would actually have to reserve 5001 slots
 
Ok I understand that now. Yea for sure tried everything I could find.
 
@milleniumbug yep I think js does that
 
OTOH, JS actually doesn't have true arrays, they're emulated with objects
at least, as far as I know, I may be wrong
and assigning the l[5000] = something; wouldn't be a performance problem because it's sparse
 
yeah I think in js when you assign to l[5000] it just sets the l.length property to 5001 without actually reserving memory for all the empty slots
 
OTOH, C# list is backed by an array which makes access to a random element really fast
that is, bound check, followed by a dereference at a specific address
 
8:22 PM
so anyway can I make a c# list with a predefined size, not capacity?
 
@StevenLiekens that's an array
 
and hash tables (including JS objects) are slow in comparison
 
@KendallFrey well I still want it to be able to grow
 
@milleniumbug Depends what you mean by true arrays. Typically arrays are stored sequentially. There are also typed arrays (distinct from normal arrays) that are more optimized and specific
@StevenLiekens So then List
maybe I don't understand the question
 
I want it to start at a specific size where all the slots are default(T)
 
8:27 PM
I'd guess new List(new T[size])
 
13 mins ago, by MikeTheLiar
@StevenLiekens interestingly enough, if you initialize it as new int[20].ToList()it appears to work
 
typical use of List<T> involves .Adding elements to it in a loop
 
var myList<T> = new T[size].ToList() but that's stupid
 
in particular, your code fits the pattern perfectly
also, if C# were to actually resize at "index too large", it would make your loop O(n^2)
 
Oh I looked at the code, and you very much do not need to pre-initialize the list
 
8:31 PM
@KendallFrey so, given var l = []; l[5001] = thing;, do we "create a new array of size 5001 or larger and copy everything to it"? because if so, JS's behaviour is even more moronic than I thought it was
 
@milleniumbug No this is probably an exception to the rule and triggers a different storage heuristic
 
9:23 PM
What should a source version control system ignore for a dotnet core app
 
@RonaldMunodawafa here you go gitignore.io/api/aspnetcore
 
Isn't that for aspdotnetcore
But thanks
 
well you can remove stuff you don't need
but aspnet core is dotnet core
 
I need it for console apps
Rather than ASP.NET
That'
That app gitignore.io is everything
 
they have other templates at gitignore.io
maybe try this one gitignore.io/api/visualstudio
 
9:42 PM
Thank you very much
 

« first day (2734 days earlier)      last day (2215 days later) »