« first day (3897 days earlier)      last day (1034 days later) » 
00:00 - 17:0017:00 - 19:00

12:37 AM
 
 
2 hours later…
2:32 AM
Hello,
I am looking to contribute to any github public repo if anyone needs a contributor. I have too much free time. I prefer projects that are not too popular (i.e. would prefer up-and-coming projects instead rather than an already popular repo with thousands of stars).
Thank you
 
 
2 hours later…
4:12 AM
When using asp.net core, is it true that with angular the server load becomes lighter than with page-based server-side-rendered one?
 
 
1 hour later…
5:41 AM
Good morning
 
happy timezone
to ya
 
@TheShortestMustacheTheorem Yes, because everything angular does it does in the frontend - it renders and computes stuff via javascript in the browser. Opposed to page-based server-side rendering like Razor, which will try to compute as many things as possible on the server, render static html there and send that to the client with minimal javascript.
 
Hello All,
Happy to be here and looking forward for some great knowledge sharing!!
 
@Deepak There is a nice Gitlab App which is in need of contributors, both small and big changes, and I'm not versed enough in Android development to do more than just adding a string here and there^^ gitlab.com/Commit451/LabCoat
 
 
2 hours later…
7:27 AM
[Captain Obvious] Got my 5g installed last night
[kesarling] Great!
[kesarling] How's the speed?
 
Noice
Headache yet?
 
[Captain Obvious] But my arm is in pain
[Captain Obvious] Well, it is if I do anything that lifts my shoulder up
 
mr5
@CaptainObvious great! now I can control you with my covid vaccine.
 
[Captain Obvious] Thanks nill
[kesarling] lol
 
mr5
sending virus
 
7:44 AM
[kesarling] You don't really believe that though, do you?
 
sup all
 
Hi
I want to use tryparse inside setter of a property
can I do it?
 
you stupid dog you make me look bad. aboloobloobloo!
 
lol
 
[Captain Obvious] Don't see why not, although it depends on what your fallback plan is if it doesn't parse
 
7:57 AM
I want to return false to the boolean property
 
[Captain Obvious] Hold on what are you trying to parse and to what
 
can you => { tryparse here ?}
i dunno im talking through my arse
 
[Captain Obvious] You can't return anything in a setter
 
take a look here
4
Q: Using TryParse for Setting Object Property Values

Godless667I'm currently refactoring code to replace Convert.To's to TryParse. I've come across the following bit of code which is creating and assigning a property to an object. List<Person> list = new List<Person>(); foreach (DataRow row in dt.Rows) { var p = new Person{ RecordID = Convert.ToInt32...

 
let me tell my problem
currently I have class
inside 3 method I am doing this
var isAllowExternalMail = false;
                Boolean.TryParse(ConfigurationManager.AppSettings["AllowExternalEmail"], out isAllowExternalMail);

                if (isAllowExternalMail)...
so it feels redundant
 
8:01 AM
[Captain Obvious] That looks terrible
 
huh?
 
[Captain Obvious] In that example, I would just assume ContactId is an int and explicitly cast it as such
[Captain Obvious] Problem solved
[Captain Obvious] And if it's not, you've got other problems
 
if (Boolean.TryParse(ConfigurationManager.AppSettings["AllowExternalEmail"], out var isAllowExternalMail) && isAllowExternalMail)
 
^nthol yes okay
but I paste this 2 more times in 2 different methods
I was thinking I could make this as a property of the class
 
[Captain Obvious] Imagine not binding your appsettings
 
8:03 AM
or what do you suggest?
 
[Captain Obvious] Well if it's a case of what ntohl is saying, bind your config to a concrete type and DI it properly
 
a static class handling config stuff. Having a GetParamWithDefault("AllowExternalEmail", false)
 
^ I am not good enough :(
 
private Boolean AllowExternalMail => Boolean.TryParse(ConfigurationManager.AppSettings["AllowExternalEmail"], out var flag) && flag;
 
[Captain Obvious] That also works
 
8:05 AM
the static class would use caching hidden while reading config values
 
mr5
if (bool.TryParse(ConfigurationManager.AppSetting["AllowExternalEMail"], out var isAllowExternalEmail))
 
[Captain Obvious] Using the bind though will read the whole thing on startup and expose any shit values right off the bat
 
and if the static class is not really a static class, but a singleton DId, than you can mock it in tests
 
thank you
 
mr5
Any C++ dev here in C# chat? lol
 
8:13 AM
||justask
 
Aug 28 '17 at 15:53, by mikeTheLiar
Don't ask if you can ask, it creates an infinite recursive loop. Just ask your question. If someone is around who can help, they will.
 
mr5
I mean, I didn't ask if I can ask a question lol
or C++ dev that have worked on websocketpp before
 
We're getting closer ;)
 
@Squirrelkiller Does it mean that all front end contents are downloaded from Angular'cdn (for example)?
 
8:33 AM
Depends actually. You could put everything except for the actually living data into the angular frontend - like default values, options for dropdowns, algorithms for calculating things etc.
But you could also keep al these values and algorithms in the backend and just load them via http call.
 
@Squirrelkiller: Thank you very much!
 
We have a mix of both currently, trying to get more stuff to the backend because our frontend is bloated: Lots of default values in the frontend, lots of algorithms about when something gets selected what other things to load or how to compute them, some long ass texts for warnings and such in the frontend
All this means our frontend, on opening the webapp, has to load 7mb
Which is much
 
OK. I am teaching math now. :-)
 
Hello teaching math now, I am Wietlol.
 
mr5
hello Wietlol, can you teach me Math now.
 
8:49 AM
The area of a rectangle is 144. Find the range of its possible perimeter.
 
48-infinite
 
@Squirrelkiller Oh my ghost. You are so intelligent! What do you eat everyday?
 
Coffee!
 
[Captain Obvious] Crunchy
 
mr5
crunchy coffee?
 
8:53 AM
@Squirrelkiller Excellent. I drink pizza everyday.
Next problem: I have a wire of 100 cm long. I want to make a circle and a square such that the sum of both areas reaches a maximal value. Find the perimeter of the square.
 
Haha that's one hell of a nutritious drink :D
Without actually crunching numbers I'd have to say the perimeter of the square should be 0+ε
 
mr5
googles perimeter
googles circle area and square area
oh sh...
 
4*a for a square, 2*pi*r for a circle
In general though, the more "uniform" a shape is, the more area you get with less perimeter.
So with the same perimeter, a square has more area than an uneven rectangle
imagine having a really long straw - massive perimeter, almost no area
 
mr5
without using my brain, I think it's much better to give the other half with greatest length for the square?
 
Make a line that is 1m long - its area will be theoretically zero, yet perimeter will be 1m*2
@mr5 I'm afraid I don't understand the question
other half?
greatest length?
 
9:06 AM
i am teaching, i will check your answer later.
 
mr5
oh I actually used 100% of my brain =P
@Squirrelkiller my understanding is that he wants to create circle and square from a wire so I thought wire will be cut in 2 pieces.
 
Basically, yes
Question is, how long is each piece?
 
mr5
idk
 
My intuitive answer: Square zero
 
mr5
but my guess would be to give the square the greatest length
 
9:09 AM
As a circle is (which I thought is commonly known) the biggest area per perimeter, the best you can do is give all of that perimeter to the circle.
 
mr5
oh shit you're right
 
@TheShortestMustacheTheorem q: if I have formula A * B^2, how can I calculate C so that C^2 would be the equivalent?
 
You can do the maths:
Square perimeter: 4*a
Square Area: a*a
Square proportion: (4*a)/(a*a)
Circle perimeter: 2*pi*r
Circle area: r*r*pi
Go ahead and compare the proportions
 
pi*(perimeter/tau)^2 = (perimeter/4)^2
this is how far I got :D
 
wait... i am online teaching....
it is about money, no teaching no money
 
9:15 AM
I suppose C = sqrt(A) * B in my question above
 
You mean to solve C^2 = A * B^2 by C?
 
Third problem: Given a circular metal plate of radius r. You are asked to make a single cone with maximal volume. Find the maximal volume.
 
mr5
let totalShare = 100
let squareShare = 0
let circleShare = totalShare
var maxSum = -1
while (circleShare > 0) {
    let squareArea = calcSquareArea(squareShare)
    let circleArea = calcCircleArea(circleShare)
    circleShare -= 1
   if (squareArea + circleArea > maxSum)
        maxSum = squareArea + circleArea
}
 
Because then you'd have to pull the root across the whole thing
 
mr5
brute force =P
 
9:21 AM
surface of square by perimeter(p) = (p*0.25)^2
surface of circle by perimeter(p) = (p*0.2821)^2
circle has higher perimeter to surface area ratio
 
Ah, now we have it in numbers too :D
 
where 0.2821 = sqrt(pi) * (1/tau)
@Squirrelkiller yes
unless im mistaken, C = sqrt(A) * B
 
If you want to sqrt the whole C, you'll have to sqrt the whole (A*B^2)
Ah I see
 
as C*C = A*B*B
A = sqrt(A)*sqrt(A)
A*B*B = sqrt(A)*B * sqrt(A)*B = (sqrt(A)*B)^2
C = sqrt(A)*B
converting
pi*(perimeter/tau)^2
to
(sqrt(pi) * (perimeter/tau))^2
 
Makes sense
 
mr5
9:25 AM
it doesn't to me though
I can't understand it
 
that is why I hide this mess in a function and you only have to call the function :)
 
you guys dont have work to do?
 
hehe
 
mr5
work is already over duh
don't tell me you're still working
 
I have like 3 people I'm waiting for answers from
 
mr5
9:29 AM
I feel like I have lost billions of neurons this past months
 
That's what alcohol does to you duh
 
mr5
but I don't drink for the past 2 years already
back then, I only drink for like 4 times a year
 
wow
I so want to become like you guys :')
 
mr5
you want to feel like you lost billions of neurons also? :D
 
Hello
I just ran into a problem which must be so common I cannot believe it won't be a duplicate, so I am wary of asking a question on main
 
9:35 AM
I know that feeling^^
 
but I can't seem to find older questions about it, or solutions outside of SO
maybe I am missing some specialized search term
maybe you guys can help me find such a term, or the older question
 
Or generalized
Turns out, the problem I had for a few days would have had in instant answer if I only know to search literally anything including "oracle udt" lol
 
@Squirrelkiller yes, that's the problem, exactly - people who have discovered the same thing before us have given it names, and I am drawing a blank for a name in this case!
I must admit I have not done any C# in the last 7-8 years
but right now, I have to use a C# script to do a piece of ETL
so, I have to go through a collection of objects representing documented records, and decide which I can keep and which I should throw out (because they are a duplicate or something else)
I created an enum which tells me what to do with each record
public enum Action
{
Keep,
Remove,
ThrowError,
NeedsChecking
}
I initialize it with "NeedsChecking" for each record
and then I go through subsets of objects, make a decision what happens with them, and replace their action property with the proper one
for the next condition, I do something like
var selected = from r in records where (//some condition) && r.action = Action.NeedsChecking select r
then I go through `selected' with a foreach loop and set the action to whatever it needs to be, according to some logic
and what I realized is that selected keeps changing under my nose
apparently, the moment I set the action of a record to something other than NeedsChecking, it no longer fulfills the initial condition of the selection, and disappears from my selected collection
I don't even know the word for this behavior, so I don't know how to search for ways to prevent it
I tried terms like "linq dynamic update collection" but all I found was ways to update a dataset within a Linq expression
any ideas what it is actually called?
 
Unfortunately not, but I may have a solution or something
Are you familiar with LINQ method syntax yet?
var selected = records.where(//someCondition);
Would be your selection process
 
9:50 AM
how do you determine if a record is in selected?
 
If you already know what to do, you don't even need the enums
 
> disappears from my selected collection
 
Also ctrl+k to format code in chat
 
@Wietlol there are conditions determined by the business logic. For example, the first thing I do is to see if I have duplicated recordId in the list, and if I do, I mark the first record with that ID as Keep, and the others as ThrowError.
@Wietlol the disappearing happens because I am changing the Action, I already was able to determine that
 
I mean, how do you validate it?
 
9:57 AM
You can just .Distinct the whole thing
 
do you use the debugger?
do you use a function and throw an exception?
do you show it in a user interface?
 
I am using LinqPad and dumping the contents of the collection as I need it
 
Chain the intended actions in a LINQ chain and it should work without strange effects
 
@Squirrelkiller it is not strange
it just isnt a collection
 
Depends on whether or not he's expecting it
 
9:58 AM
@rumtscho you are evaluating a pipeline multiple times
@Squirrelkiller that is just because his expectation is wrong
 
Would searching for "killing all children" be strange? Not as a web developer.
 
@rumtscho you do not have a collection
you have an IEnumerable
 
I am actually casting it to a List
 
the enumerable you use is a pipeline of operations and a source, when you load it, you load the source and apply the operations
 
You're thinking too object oriented - think a bit more functional and it's gonna be easier
 
9:59 AM
@rumtscho are you though?
can you show the code?
 
	var sameDayExams = (from r in records
	where r.PatNr == pDate.PatNr && r.ExamDate == pDate.ExamDate && r.action == Action.NeedsChecking
	select r).ToList();
This is the real expression from which the records start disappearing when I change their action
 
they cant disappear from that list
you are still making new lists as you go
to me, it is not yet obvious how, but that is what happens
can you write a unit test to reproduce the issue?
 
How about we XY his problem and solve it in a single pipeline?
 
@Wietlol OK, I'll try making an example now where it is isolated
@Squirrelkiller we cannot solve it with a single pipeline, because the real problem is more complex
the decision has to be done in multiple passes for multiple conditions
and if there exists some code which can do it all at once, it will be so complex that a year from now, neither me nor a putative colleague would be able to maintain it
 
Then there would be more questions
Are the records in a database? Do you need intermediate results to be stored? Do you want ot change the actual records?
 
10:06 AM
@Squirrelkiller possibly yes. But actually, if I can find a way to stop this re-evaluation from happening all the time, I will be able to solve the rest myself.
 
How many records are there, can it happen in memory or do you need something that can do a few thousand at a time?
 
This will later be executed with SSIS, in a Script task
 
If you do .ToList(), it's impossible to be reevaluated
 
@Squirrelkiller I also thought that .ToList();is creating an entirely new collection, but apparently I was wrong
 
It creates an entirely new List
 
10:08 AM
I am now writing a smaller example to reproduce it
 
10:39 AM
Anyone has a game plan on how to make an executable that launches a browser, like pgAdmin?
Would like to make a Blazor application that behaves like that
 
Have you tried Windows 11?
 
I have not
 
10:52 AM
I'm absolutely stumped now
ToList() indeed gives the behavior I wanted
The strangest thing is, I tried it before I came here to ask!
at least it gives that behavior in my minimal example, maybe I have to look deeper into the real code
 
You see, this is exactly what I was expecting your reproduction to yield.
And now you learned that usually, it's not a bug in the framework
 
@Squirrelkiller I never said it was a bug in the framework :)
 
You said that it changed after you did a .ToList - which would be a bug in the framework
 
@Squirrelkiller I actually thought that, if ToList doesn't change it, then I must have misunderstood how ToList is intended to work.
If anybody is interested, here the reproduced example
List<Record> allRecords = new List<Record>();
for(int i = 1; i <= 10; i++)
{
	allRecords.Add(new Record() {recordId = i, action = Action.NeedsChecking});
}

allRecords.Add(new Record() {recordId = 1, action = Action.NeedsChecking});

// in reality, here would be code which recognizes duplicates before marking all but one of them as "ThrowError". Just marking one here differently so the situation is more like real life, where not all records have a NeedsChecking.
allRecords.Last().action = Action.ThrowError;
Now that I went through all the trouble to create the example, maybe I should record it on the main page as a self-answered question
again, any suggestions what terms to use so it will be discoverable?
"prevent reevaluation of the pipeline"?
 
You might get a lot of people XY'ing you
 
11:03 AM
> I am actually casting it to a List
 
That was your problem with the whole thing?
 
I think so
generally speaking, you should avoid evaluating an IEnumerable multiple times
 
@Squirrelkiller yes, that's indeed a problem. Really, the one piece of the puzzle I was missing was how to stop this re-evaluation from happening. I realize that this stupid reduced example looks like it could be solved in different ways, but since my actual problem is more complex, there are reasons why I am going exactly this way.
 
and always keep in mind that using a debugger or repl, evaluating it multiple times is a very easy mistake
 
Or maybe you just think your actual problem is too complex
Good think about LINQ is, it lets you break down complex things in a chain of simple things
 
11:07 AM
<3
 
@Squirrelkiller oh yes, certainly, fully with you on this one.
As for the whole thing I am trying to do, I have been sitting on it for several days, and it is several hundred lines of code already. I certainly don't want to stick it into a single Linq expression, even if that is theoretically possible.
@Wietlol thank you, I didn't realize that this might be happening.
I actually had the problem even before reevaluating it through the Dump(), I first recognized it when my code threw an error
I was using a for loop with an int counter and trying to update an element at some position, and kept getting the error that the index is out of bounds
 
Oh the LINQ expression should of course not have the whole code - it can however nicely chain several method calls
If you do that, and your calls are pure or at least thread safe, you can even have LINQ parallelize the whole thing
 
@Wietlol so is the IEnumerable some kind of exhaustible generator? I must admit I didn't look too deeply into the different kind of collections.
 
IEnumerable is basically "something that you can enumerate over"
however, that "something" is divided in two parts
it is either a collection, or a pipeline
a collection is pretty simple, you can enumerate over a list or a tree without any issue
a pipeline is a bit different
 
IEnumerable can theoretically be infinite too, like a GetNextPrimeNumber
Or rather GetPrimeNumbers
Or in a very simple way a counter:
 
11:15 AM
it defines the source of it's data, such as a collection, or database or function with yield returns
it can be expanded with intermediate operations, such as Where, Select, etc
when you enumerate over that (using GetEnumerator()), you receive an enumerator that lazily asks the source and the operations to load the next item
until there are no items any more
 
IEnumerable<int> Numbers()
{
  int counter = 0;
  while(true)
  {
    yield return counter;
    counter++;
  }
}
 
or until you stop loading more items
enumerating that twice (getting 2 enumerators) could introduce a lot of annoying side effects
 
Yes, I know that kind of lazy loading from other languages - I just never stopped to think that this might be what a Linq expression is returning.
 
what language are you familiar with that has this kind of stuff?
 
Basically LINQ doesn't start evaluating until you terminate it with something like .ToList
So in theory you could built a webservice accessing a database via entity framework, where the service just defines these pipelines via LINQ and when called, the whole thing is just a pipeline piping records from the database through the pipe one after another.
 
11:19 AM
I actually recognized that the reevaluation must be happening, too. But for some reason, when I tried to stuff the results into a List, I didn't see the needed results. I must have done something wrong there.
@Wietlol I have briefly seen something similar in Python. But actually I code mostly in R, with nice well-defined dataframes, and rarely have to care about this kind of behavior.
If R has a construct that does this kind of thing (it probably does, it has a library for everything, I feel!), I have never had the need to use it.
 
!~shiba
 
no kissing!
!~shiba
 
now THATS a good boi
 
hello dog
awww
hope hes not dead
!~shiba
 
aahhh
 
how are you Hans
it's so nice to see familiar names here...I know I have said this before
but I like you guys very much
<3
 
11:28 AM
thats great
Im doing fine
what about you ?
 
fine indeed :3
 
:3
!~cat
 
:o
 
!~cat
 
11:31 AM
 
!~cat
 
This is getting dangerous - the bot could cost me several work hours!
 
est un chat blanc
 
@rumtscho :D
 
11:36 AM
did anyone see what happened to discord yesterday? media didn't embed at all
 
russian hackers ?
;)
 
@Wietlol How automatically can I convert a WPF view to JavaFX?
 
not?
 
Cuz I wrote this baby in C# but prof still wants it in java
Damn
 
I dont use either ui libraries
 
11:41 AM
Discord is becoming more broken every day; how long before our passwords are leaked?
 
@Freerey I have a reminder to send out the passwords next friday, just hold on tight until then
 
Anyone know a nice "learn JavaFX if you know wpf" tutorial?
Like "here she stackpanel is called stackpane but works the same"
 
Ha! When I have problems programming, I usually assume it is my fault and not a bug. But now I might have ran into some kind of LinqPad caching bug after all.
 
when i have problems programming I watch cat vids
for the rest of the day
just kidding
damn 32° already
 
I intentionally used an IEnumerable again, then added ToList() and it kept re-evaluating
 
11:45 AM
way too hot
 
@Squirrelkiller be a rebel ;)
 
then I commented out the line that changes the Action, ran the code again, then enabled that line again
and it stopped re-evaluating and started behaving like a List
 
I assume that is a VS "feature"
running older builds because everyone always wants that
 
@Wietlol lol that would be hilarious
 
if this happened before, it explains why I thought that ToList is not the correct solution
 
11:47 AM
@Wietlol Except they're on linqpad
 
@Squirrelkiller not sure how well it works tho, again, I dont use either WPF or JavaFX
ah, well... iDunno about all these tools
I thought linqpad was the repl thingy in VS
:D
 
From how it begins, I like this one, itt has a very german accent lol youtube.com/watch?v=Rcb4JbUFvl0
Or maybe eastern european, not sure yet
 
@Wietlol I didn't even know that VS has a repl. Linqpad is a third party software, very convenient - but obviously made with fewer resources than VS.
For me, it is an ideal tool for rapid prototyping. I can just open it and start writing, without caring about projects and architecture and stuff.
 
just found a question on string_split in SQL Server and the accepted answer is "oh, just change a constant of the database; no problem!"
 
lol EZ
 
11:53 AM
@Squirrelkiller his first thing is weird though
he talks about the difference between lambdas, but misses the point
@rumtscho I just write either a unit test to test my code or dump it in a special sandbox project
 
Yeah but it did actually teach me java doesn't capture variables but values :D
 
for 2 reasons:
1, I get an actual representation of what I will get
2, it has the support of all the tools I use, I dont have to figure out how to add a nuget package or how to make a clean build, it is all the same as all the other projects
@Squirrelkiller but it doesnt
Java also captures variables
the problem is, the example code simply will not compile because Java says "oh, my dear friend, you are using a variable that changes, please be wise and dont use mutating variables in your lambdas"
 
wpf is much larger "because it's actually used by people" lol
 
omggg I haven't updated my art insta in 2 months ._.
 
shame on you
 
12:07 PM
It's not that I haven't been drawing at all; I just haven't finished anything
 
Yeah shame on you for using instagram
 
surprised Chiaki face
what, you seriously expect me to still be using deviantart?
 
@Freerey This is a common thing. Surprisingly, the best name for it I know comes from knitters - they call it "Second Sock Syndrome".
 
orly? most people I know call it art block
like writers' block
 
It happens when you start a cool project, and at the time you have done enough of it to know exactly what it will look like when it is finished, you lose interest in it and don't finish
OK, art block would be a different reason, I guess - I must have jumped to assumptions here
 
12:10 PM
what you described is what I worry about happenign to every writing project I've ever done
 
Eh, I wouldn't worry too much. If it happens all the time, it is an important sign that you have to develop self-motivation skills, and a great playground to train those skills without pressure. And if it happens rarely, then probably the project wasn't that important for you and played out its role before it came to finish, and you can just leave it alone.
 
only thing I'm slightly worried about now is people thinkin I dead 😂
 
I like you all <3
 
aw thanks courage <3
 
 
3 hours later…
 
2 hours later…
4:55 PM
just bought a nokia lumia 1020 because it's 2013 in my head
 
what the fuck is windows 11
didnt they say they stopped with this numbering thing?
 
00:00 - 17:0017:00 - 19:00

« first day (3897 days earlier)      last day (1034 days later) »