« first day (3901 days earlier)      last day (1030 days later) » 

Lab leaks is the first thing people believe in china, but it was proved to be false
 
mr5
but news about lab leak theory is spiraling again recently
 
 
2 hours later…
5:54 AM
Hi
 
6:09 AM
@sq
@Squirrelkiller how are you?
do you have experience with windows service?
 
Good morning
I have not
But I'd appreciate a simple template if you find one
Or of course if you built one yourself after finding out how windows services work^^
 
it's nothing complex you can have a console app and have it run as a service
346
Q: Install a Windows service using a Windows command prompt?

Vikash PandeyI want to install a Windows service using a Windows command prompt (not the Visual Studio command prompt). How do I do this?

 
Huh
Can I do that with an asp.net core app?
 
no
for that its diffeerent
 
mr5
7:15 AM
when should you reply to an email of your boss?
it says "thank you for your valuable contribution", it sounds to me that I'm about to get fired 😅 and I'm not sure what to reply.
 
"cool story bro"
"nice and short"
 
nice story bro cool and short
 
short story bro nice and cool
you guys don't compare yourself to others?
I am constantly reminded I am a lazy idiot
 
7:39 AM
Never compare yourself to others unless it's productive
If you want to compare yourself to somebody, compare yourself to your former self.
6
 
<3
 
@mr5 self-esteem problems... Always making problem out of lack of feedback. Then when it's a positive one, thinking boss gona fire you...
 
[Captain Obvious] Morning frens
 
lol why not? dont deceive yourself, you do compares others, even monkey dolphin did compare each other
 
But only if it's procutive
 
7:54 AM
No, it should be everything
 
Go ahead dolphins with monkey if oyu wanna figure out what to test medicine on, but don't compare them on their abilities to swim
 
compare != upset
Even though you tell yourself you dont compare to others, you still do comparing physiologically deep in your mind, accept it
 
Things like Facebook/Instagram taught us to always compare outselves to others - except it doesn't help our mental health. Suddenly people do things so they can please or trump others. Not becuase they want to experience great things.
 
[Squirrel in Training] GoOoOoOoOoOoOoOoOoOoOoOd Mornin' pleberinos!
[Squirrel in Training] Gues who's back
[Squirrel in Training] Back again
 
^ :D
squirrel in training shady
 
8:00 AM
And of course I sometimes compare myself to others, but just to clarify things. I'm an introvert, yet I have no problem to talk to random people in the street. My girlfriend OTOH is an extrovert, but can under no circumstances talk to people in the street. Strange things, so I compare myself to other people I know to understand these things.
@Squirrelintraining yoyoyo welcome back bro
 
Hello All
can anyone help me with this problem
Page.ClientScript... is in code-behind I hope? Looks like it's in the HTML. — wazz 16 hours ago
any clue or any idea?
InnerText error 'Cannot get inner content of because the contents are not literal'
 
i mean 'you should' isnt you really should, everyone has a unique personality that result how a person do decide, for me, you should face defect and do compares to others, so you can improving. BUT you must not gain a sense of superiority by comparing your advantage, after becoming a habit, gradually becoming unhappy
 
8:31 AM
@muniya no idea sozzy
 
:-(
 
8:55 AM
[Captain Obvious] Pictures don't send when sent as attachments
[Captain Obvious] Just comes up as a blank message
 
9:06 AM
That's why you should stop the Spaltung!
 
[Squirrel in Training] If plebs wana see then need to come 😄
[Squirrel in Training] Any1 know how I can see all the changes between now and when I left in the default visual studio diff tool?
\[**[Squirrel in Training](https://discord.gg/PNMq3pBSUe)**] Ok I haz it
select 2 commits out of history and click CoPaRE
 
9:43 AM
i want to refactor this , how can i do it :)

```if (filter && paymentType < 0)
{
return activeParkings.Where(x => x.Betalningstyp >= (int)paymentType && x.Betalningstyp <= (int)PaymentType.SmsInvoice);
}
if (filter && paymentType >= 0)
{
return activeParkings.Where(x => x.Betalningstyp <= (int)paymentType && x.Betalningstyp >= (int)PaymentType.CreditCard);
}

return activeParkings.Where(x => x.Betalningstyp >= (int)PaymentType.CreditCard && x.Betalningstyp <= (int)PaymentType.SmsInvoice);```
 
any particular reason?
also... "Betalningstyp"?
what language is this?
or just typos?
for one, you can split this up in different methods
one with the paymentType and one without
then you can remove the filter parameter too
perhaps some information about the payment type logic would be useful too
generally speaking, your payment types are not numbers
comparing them using >= <= > < is assuming that you have them mapped as integers to implement business logic that is currently not obvious to the person reading this function
also, having them being negative too, doesnt help with understanding it either
 
10:10 AM
[Captain Obvious] For once I agree with Wiet
[Captain Obvious] Occasionally doing GT/LT comparisons on enums casted to ints makes sense, but more often than not it doesn't
[Captain Obvious] Like the cost that I posted last night in here
[Captain Obvious] if ((int) Android.OS.Build.VERSION.SdkInt >= 28)
[Captain Obvious] It makes sense because SdkInt (which isn't an int) has a value which represents it's API level, which as it increases for newer APIs I can do mathy comparisons on it
 
"It makes sense" "SdkInt (which isn't an int)" ...
 
[Captain Obvious] For the wondering, SdkInt is actually an enum which all of the keys are the names of the associated android versions
[Captain Obvious] Yeah that's the framework's fault. My enum casting restores normalilty
 
Version should be the model, the major version part should be an int
why do people not model things nicely? :(
I had a similar case with connection strings for sql recently
havent actually checked if there is a model for it
 
[Captain Obvious] Because google are dumb
[Captain Obvious] Connection strings are really easy
[Captain Obvious] ConnectionStringBuilder is your friend
 
depends
what we used to do is put the connectionstring in the secrets store
then we load it in via the configuration of our application
nothing too complex
but recently some colleagues started to split the connection string up into its various parts in the secrets store
so, you get separated host, database, username, password, etc
in the code, we now build the connection string from that
but considering we are not reusing the stored variables and compose the connection string based on only the values we needed at the time, it is hardly any improvement
the only improvement is that you dont have to care about escaping of values
but we lost the ability to just add certain values on the fly when we realize we need some of them
for example by specifying the timeout
if connection string was a proper model, containing properties for host, database, username, password, timeout, zero datetime, port, pooling, etc
then we could just deserialize the config section into the model
 
10:59 AM
[Captain Obvious] You can stick a full connection string into a ConnectionStringBuilder, then tweak timeouts out whatever, then get the updated string out of it
 
still, I would have to write the timeouts setting in the code
what I would want is a configuration section:
{
    timeout: "30000"
}
and then in the code:
var connection = section.GetValue<ConnectionModel>();
var connectionString = connection.ToString();
currently, our configuration isnt structured as such... which is just our fault
but the major problem is that there is no ConnectionModel class
and if we write one ourselves, it would probably not include all the connection string properties anyway
 
11:57 AM
guys guys I'm finally modernizing
got two new phones coming in the mail, and they're both Windows Phone Nokias. These will last me til I'm dead. woohoooo
 
12:18 PM
"modernizing"
"Windows Phone"
I will just leave this here
 
I don't want to spoil the fun, but almost no app comes for Win Phone.
you have to androidize it
 
[Captain Obvious] Wiet you can put timeouts in the connection string you know
 
i know
but not if we dont use a string
 
[Captain Obvious] Well how do you get your connectionstring in now?
 
12:28 PM
[Captain Obvious] <@226165836899942410> somebody sent a bunch of phones here one time for some unknown reason
[Captain Obvious] 2 iPhone 5Cs and a 5S
[Captain Obvious] Turns out the 5Cs are useless because they were only supported up to iOS10
[Captain Obvious] At least the S got up to 12
 
@CaptainObvious they just put them in the mail?
@ntohl I don't want to spoil the fun, but there's this thing called sarcasm
 
[Captain Obvious] Like this:
[Captain Obvious] Ended up coming back to us because they reused an envelope we used to send them stuff in and it had our return address on
 
I always wondered why nobody scammed delivery services by throwing something in a mailbox with just a return address on it.
 
12:44 PM
@Botler we currently load the configuration as json, extract the values that we normally use and then build the string
so, in the code, we explicitly only read/set/support server, database, uid and password
 
[Captain Obvious] Thats dumb
[Captain Obvious] Why not just put an entire connection string in one of them at that point
 
we used to
 
[Captain Obvious] Then why did you stop? And is it backwards compatible?
 
it was new code, so... sure
as for why we stopped... I still have no clue
 
[Captain Obvious] Backwards compatibility is fun
 
12:57 PM
on a side note
 
[Captain Obvious] EXCEPT FOR WHEN DUMB FUCKS KEEP USING OLDER VERSIONS THEN COMPLAIN THAT IT DOESN@T WORK
 
anyone ever dealt with recursive EF models?
 
[Captain Obvious] What do you mean recursive
[Captain Obvious] for clarification I mean older versions of an application which has bugs which have been fixed in newer ones, which are just as compatible with the service API as the newer version
 
modelBuilder
    .Entity<MyModel>()
    .HasMany(it => it.SubModel)
    .WithMany(it => it.SuperModel)
    .UsingEntity(it => it.ToTable("ModelSubModels"));
public class MyModel
{
    public ICollection<MyModel> SuperModel { get; set; }
    public ICollection<MyModel> SubModel { get; set; }
}
recursive models
or at least... a tree
 
[Captain Obvious] Ohhhhhhh
 
1:01 PM
it wont be like... fully recursive
 
it can never be A -> B -> A
only A -> B -> C -> ...
 
[Captain Obvious] Wait what
 
it is basically an n-ary tree
 
1:02 PM
yesyesyes
 
[Captain Obvious] That code is A -> B -> A
 
well... potentially
but that gets covered to never happen
 
[Captain Obvious] If you want A -> A -> A -> then it would be one table with many-many where both ends are the same table
 
the validator would throw an exception
 
hello guys
I wanted to ask a question about Apache web server
I have an app where instead of getting host:port/staticfile I want to have all the URLs as host:port/app_name/staticfile,
how can I add "app_name" in all the app URLs by default?
 
1:03 PM
oh, then I mean A -> A -> A
 
[Captain Obvious] No idea
 
all the same type
but never the same instance
 
[Captain Obvious] Oh well uh
[Captain Obvious] Yeah I've done that a couple times
[Captain Obvious] Not as a many-many though
 
how do you query the entire tree?
loading MyModel and all SubModels recursively
in one query
 
[Captain Obvious] I don't think you could in a single query
[Captain Obvious] Actually maybe you could if you recursed the IQueryable
[Captain Obvious] That would be dirty though
 
1:05 PM
but there are no functions to recurse the IQueryable
 
[Captain Obvious] Sure there are
 
such as?
 
[Captain Obvious] Soemthing like this
[Captain Obvious] `public IQueryable<A> Bad (this IQueryable<A> above){ return above.ThenInclude(a => a.RecusiveField).Bad()}
[Captain Obvious] That might work
 
no, that doesnt work
 
[Captain Obvious] But I wouldn't do it, you'd want a base limit on how deep you can go in a single query, and if you need to go deeper later on you can
 
1:08 PM
that is direct infinite recursion
 
-_-
 
[Captain Obvious] You have to bottom out at some point
 
meh
 
[Captain Obvious] You will never know how deep to go without querying and finding out at some point
[Captain Obvious] You can always fill in the blanks after you've queried
 
1:09 PM
I can do an sql query (not sure how well that works) with recursion
and load in all the records
 
[Captain Obvious] Loading in all the records is easy
 
but that would still be a pain to convert it to models
 
[Captain Obvious] It's just linking them up that's the problem
[Captain Obvious] You could just query the entire table once and attach the references manually
[Captain Obvious] But the change tracker would probably have a fit
 
with a recursive cte, you can just query the records you need
not the entire table
 
[Captain Obvious] What query would you fo then
 
1:17 PM
just a normal parent-child tree recursive cte
something like this
16
A: Getting all the children of a parent using MSSQL query

lc.Assuming you want to get siblings of the value @p0, you can use a simple self-join: SELECT p.Child FROM Table1 c INNER JOIN Table1 p ON c.Parent = p.Parent WHERE c.Child = @p0 AND p.Child <> @p0 The not-equal clause here makes sure you get siblings not including the value you searched for. Rem...

 
[Captain Obvious] That would only get one level though
 
the second query
 
[Captain Obvious] Oh that didn't come through
[Captain Obvious] one sec
 
Wouldn't ithat just return the relationships between them?.
 
yes
that is the problem
sql can only return records
I would have to join them with the actual data
and then merge the resulting list to a tree in C#
 
1:30 PM
Anyone try out Maui yet?
Since we are on a SQL Train here, how would you delete all FK attached to a record?
one table has several FK relationships
 
[Captain Obvious] What do you mean
[Captain Obvious] Like delete the children which are attached to that item?
[Captain Obvious] Because if you were deleting the parent too then you can just cascade the delete for ezpz
 
Ya for some reason that didn't work
Thought it would, maybe I have the constraint wrong
 
[Captain Obvious] Probably, that should work just fine
 
1:52 PM
Ahh maybe, I have multiple refs to that FK, it will only delete on the last one.
Thought my test case was a singleton tho..
 
2:04 PM
Ryan Donovan on June 21, 2021
Open source won. Now, the OSS way of working is making inroads into new territories: the corporate engineering department.
 
 
2 hours later…
3:52 PM
Hi all, what is a friendly encoding format to convert byte array to?
base 64 sometimes causes this error: "The request filtering module is configured to deny a request that contains a double escape sequence."
 
[Captain Obvious] B64 doesn't contain an escape sequence
[Captain Obvious] Wait what is the "request filtering module"?
 
 
2 hours later…
5:46 PM
client: do you have any updates for me? 😃
me: would I have given you nothing but silence today if I had any updates for you? 😀
 
 
4 hours later…
9:32 PM
 

« first day (3901 days earlier)      last day (1030 days later) »