« first day (3411 days earlier)      last day (1520 days later) » 

mr5
3:52 AM
@CaptainObvious J1010
 
 
1 hour later…
5:05 AM
 
user12870752
5:37 AM
Anyone? I need help with Linq query
 
mr5
6:11 AM
o/
 
mr5
6:26 AM
fuck
this Android Studio still suck
 
Android Studio produces more bugs when they fixing them
Im headache everytime when I update
 
mr5
I just restarted it serveral times this day ugghh
and I thought Xcode sucks
AS is even more suckier now than ever
 
hehe
 
6:50 AM
so I have different areas of my application which I need to stop things like tasks or long running operations on shutdown, is it a good idea to share a cancellation token for every class so everything can stop and dispose after I cancel that cancellation token?
My other option is to have some kind of static bool IsShuttingDown and to read it on each iteration of the long running task.
 
mr5
7:03 AM
Do you have several tasks that you want to shutdown in one go?
 
morning
 
@mr5 not all tasks, some while loops in different threads etc.
 
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' squirrelerinos!
 
mr5
@AshKetchum yes. several = not all
 
7:15 AM
Just wanted to make that clear, yeah several @mr5
 
@Feeds I don't get it
 
mr5
but can you categorize these tasks so that you can shutdown them at once?
passing CancellationToken across methods is not at all expensive and thread safe.
having a static global variable is not thread safe
 
I mean I can fetch the classes from my DI container - that's another option.
 
mr5
what for? @AshKetchum
 
so when I'm shutting down I fetch each class that needs to be "shutdown" and I can maybe call Dispose() or something similar.
 
mr5
7:28 AM
does each class have its own running task(s)?
 
yes
 
mr5
yes. you can do that also.
but I think it's much better if those classes conform to a protocol so you just call the same method name
 
Do you mean something like IStoppableService to make them implement Stop() and then call Stop on all of them? @mr5
 
mr5
yep. but then, it doesn't really help that much if those instances are not in a collection. you could store them but it defeats its purpose.
 
@AshKetchum If it were up to me, I'd have some method Stop() on some class representing all the tasks being performed, and when called, that class deals with individually setting each task's Stop method
In other words, have full control to stop whichever tasks you want, and then have some higher level method simplify that to a single call
simple but with max flexibility and you don't have to worry about threads reading from shared memory
 
7:45 AM
At this stage I my-swell code my own TaskScheduler.
 
don't reinvent the wheel, but it would make sense to manage all tasks pertaining to some common goal in a single class
so you can easily start and stop them on command
 
maybe not a full blown TaskScheduler then but maybe some sort of TaskHandler
Thanks I'll keep it in mind.
 
if you have more than one, then you could probably generalize a lot of that functionality by adding tasks to a collection in an abstract class
then the concrete class can override or micromanage where necessary
 
mr5
Android Studio is even lacking the most basic and common feature: to launch a command prompt/terminal with adb en vars setup already. /sigh
now I need to start VS just to launch this terminal because I'm too lazy to find where the SDKs are located
 
8:02 AM
@mr5 surely there are environment variables
 
mr5
yes there are
 
then not sure I follow
 
mr5
There is this adb cli tool where every Android dev needs.
It is located along with the Android SDK folder once you install Android Studio or VS with Xamarin.
To say that Android Studio is the official tool to create apps for Android is an overstatement since this basic feature is missing.
this basic feature = launch command prompt/terminal with environment variables setup already
 
8:19 AM
finding a car is harder than I thought
 
If someone could give this a look over I would highly appreciate it, thanks.
0
Q: Server only processes the first message from the client?

Ash KetchumSo I've written my first ever asynchronous network server and this is my first real experience with async and await so I could have seriously messed up somewhere. The client gets accepted, sends a message but doesn't send any more. I'm guessing it does send more but my server isn't handling it p...

 
requires more reviewing than copy-pasting 100 lines of code from some random indian website
 
just buy a banger and have done with it
 
what's a banger
 
UK term for a very cheap car that will likely break the same day you bought it.
 
8:23 AM
Oh, no I don't want that
 
mr5
btw @AshKetchum underscore is too 2000sh
 
I'm looking for a sports car
 
@mr5 underscore?
 
mr5
drop the _ and name your private fields just like a normal person would
 
oh my question
I disagree, its the recommended convention atm
 
mr5
8:25 AM
welp, some comments may come along ^^
 
Since when is _ for private attributes with public accessors regarded as old?
It was still standard back in 2019
 
mr5
welp, not in our community (XF)
 
oh but XF is a whole different world
Xamarin is like the South American version of programming languages.
.NET arrived at Android and said "hold my beer". Now you have a mixture where neither Java for Android, nor .NET for Windows can understand 100% without assuming the background
 
XF or not its still C# - and the recommended convention is _camelCase ( as far as I know )
 
Yeah and South Americans also speak Spanish, but nobody in Spain can understand them.
 
mr5
8:29 AM
because private fields in XF are rarely used. The only thing where it gets confusing is when your IDE doesn't provide syntax highlighting that differentiates the two, or your method is too big that you can't differentiate local parameter from method and private fields (but this is where the design patterns and following of standards come along)
 
I must be asking more challenging questions recently because their usually answered by now.
 
mr5
@AshKetchum did you consider those async Task throws exception?
 
I wrapped the call in a Task.Run and it worked fine, I'm 99% sure its a blocking issue but I'm not sure where.
I have UnhandledException set up anyway and it doesn't throw anything.
 
mr5
public async Task WaitForData()
{
    while (true)
    {
        if (!_tcpClient.GetStream().DataAvailable)
        {
        	// mmm frying the CPU atm 😋
            continue;
        }

        await ProcessDataAsync();
    }
}
 
If you have a better way let me know
 
mr5
8:36 AM
how about this?
 
I'm still new and learning, open to recommendations
I guess a Task.Delay would work
 
mr5
I'm thinking of the Java's wait & notify. I'm looking for the C# equivalent atm
 
just read from the stream
 
mr5
92
A: C# equivalent to java's wait and notify?

Jon SkeetThe equivalent functionality (including the normal locking) is in the Monitor class. foo.notify() => Monitor.Pulse(foo) foo.notifyAll() => Monitor.PulseAll(foo) foo.wait() => Monitor.Wait(foo) The lock statement in C# is equivalent to calling Monitor.Enter and Monitor.Exit with an appropriat...

 
it will block until new data arrives
 
mr5
8:38 AM
try the Monitor.Pulse/Monitor.Wait
or that from ntohl
 
_tcpClient.GetStream().ReadAsync is enough. No need for active waiting of DataAvailable
 
mr5
also, avoid loops like that. it will fry your CPU
 
also try to avoid Monitor.Pulse/Monitor.Wait
 
mr5
not really sure but I think it will block the whole thread
 
usually there is fundamentally different way to solve it
 
mr5
8:40 AM
yeah. my suggestion is just an alternative to his current logic
@ntohl anyway, what's the reason?
I haven't had the need to use this since I started C#
 
@mr5 Why not just read the data you need using an await?
 
mr5
@RoelvanUden it's not my code
 
Oh. Nevermind then.
 
mr5
I inserted my comment there only
@RoelvanUden do you use underscores with your private fields in C#?
 
mr5
8:45 AM
ew
 
I don't care about your opinion :-D
 
@mr5 I dont :D
I use private properties
:)
 
like when I used select() for the first time in C. It dropped my jaws. Avoiding all kind of low level locking, by using the right standard
 
mr5
Wiet is always on another level
 
@mr5 I use _ also
 
mr5
8:49 AM
I hate u all
 
💛
 
@ntohl do you have more than one jaw?
 
What he means by that is he uses fields
 
I do use _
 
mr5
jaws == fields now?
 
8:51 AM
for lambda parameters that I dont use
 
@Harry looks like. If I said it, it's true. Other case see rule no.1
man.he.net/?topic=select&section=all <- that's the real deal
 
mr5
@Wietlol yeah. that's the only use of _ for me too
 
check out my code for April's fool's day> DateTime.Today.Day > 0 && DateTime.Today.Day * DateTime.Today.Day == DateTime.Today.Day && (1 << 2 ^ DateTime.Today.Month) == 0 ? ...
 
mr5
_ = unused
therefore, _ for private fields will be deprecated soon
 
@mr5 Compilation error: variable '_' already declared.
FFFFFFFUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
also... C# is very inconsistent about redeclaration and shadowing
I have yet to find out what causes the difference, but I assume fake lambdas are the problem
 
mr5
8:57 AM
hmm I think I remember there are instances where I assigned multiple _ for different types but it compiles fine
 
_ = unused for lambda's parameter?
 
I have two code examples where I have the same name for lambda parameters and in one case, it complains and in the other case, it is fine
same project
 
mr5
use incrementing underscore then
 
it does matter if you use like .Where(x => ...Select(x => ... or .Where(x => ...).Select(x => ...
 
!~>()=>{
Func<string,string> foo =_=>_+":/";
return foo("ironman");
}
!=>"ironman:/"
 
9:00 AM
.Where(it => it.MailFrom == address
    || it.MailOrigin == address
    || it.MailTo.Any(it => it.MailAddress == address)
    || it.MailCc.Any(it => it.MailAddress == address)
    || it.MailBcc.Any(it => it.MailAddress == address))
perfectly fine
shadows everywhere
 
r# warns you if you do same param name in nested lambdas
 
no... no it doesnt
> [SuppressMessage("ReSharper", "VariableHidesOuterVariable")]
 
mr5
> [SuppressAny(User.Emotions)]
 
for me, unclear param name like x,c in nested lambda is dangerous
 
Surpressing the error doesnt make it go away.
In my lambdas I usually use a (or occasionally 2) letter parameter names but they usually line up with the thing inside
 
9:07 AM
I want "it" for a very specific reason
 
Buenos dias
 
For example, I have a list of Warehouse so I could do warehouses.Select(w => w.WarehouseName) or something
 
@ntohl thanks I didn't know it was as simple as ReadAsync
So this is enough?
private async Task WaitForData()
{
    while (true)
    {
        await ProcessDataAsync();
    }
}
 
mr5
@nyconing I always use one letter name in lambdas exp
 
I always use "it" by default
I think it is nicer than single char identifiers
 
mr5
9:10 AM
"it" for it's about time to off with Wiet's head
 
I prefer abbreviations of the entity in question.
 
@AshKetchum yes. I guess. Tho you shouldn't remove the post, someone already put some effort in answering
 
my opinion might have been affected by Groovy and Kotlin
and probably makes more sense in their context
 
specify it when there is a nested
 
because they have more awesome lambdas
 
9:11 AM
warehouses.SelectMany(warehouse => warehouse .ContactPersons.All(person => person.Active))
 
as long as it's not too long I usually use the actual desciption, like warehouses.Select(warehouse => warehouse.Name)
 
if "it" is not sufficient, say nesting where both are accessable, I still prefer names rather than abbreviations
 
Also a Warehouse shouldn't have a property "WarehouseName", just "Name" sicne it's part of the warehouse anyway.
 
@mr5 I mean, he is an inbred moron. I think that was an executable offence in the days gone by
2
 
Enumerable.Repeat(Enumerable.Range(1, 10).ToList(), 3).Where(x => x.Any(x => x == 2)) error CS0412: 'x': a parameter or local variable cannot have the same name as a method type parameter
 
9:12 AM
@nyconing I'd be fine with wh here, because it's very tightly scoped to the warehouses.SelectMany call, the meaning is clear.
 
but always try to avoid additional information on the name, like .ContactPersons.All(contactPerson => contactPerson.Active))
 
@AvnerShahar-Kashtan That's why I do it, the scope is tiny and it's very rarely ambiguous. If it is I usually extend it so it's not
 
mr5
@CaptainObvious agree
 
I would favor names over abbreviations as long as it doesnt hurt reading it
 
mr5
I have a quston plz.
Let's say, I have this shared Project (VS context) from across different projects. It's included in multiple solutions also. If I modify this shared project solution properties, does it also affect the other project that includes this shared project?
 
9:15 AM
writing wh and warehouse takes the same time anyway
 
mr5
[+] Solution
	[+] Project X
	[+] Shared Project
		[+] SharedProject.X

[+] Solution
	[+] Project Y
	[+] Shared Project
		[+] SharedProject.Y

[+] Solution
	[+] Project Z
	[+] Shared Project
		[+] SharedProject.Z

[+] Solution
	[+] Project Bayabas
	[+] Shared Project
		[+] SharedProject.X
		[+] SharedProject.Y
		[+] SharedProject.Z
 
assuming you have an actual IDE
 
how can I swap 2 chars in a string by index? Like "Foo".Swap(0, 1) == "oFo"
 
@mr5 just use nuget?
@ntohl use a temp variable?
 
I need an expression
 
9:16 AM
@ntohl I fixed it myself, the person answering answered a totally different question, seemed like his own issues with my code.
 
oh wait, perhaps string -> char[] -> swap -> string
 
mr5
@Wietlol we could but it's a hassle to update it since this shared project always keeps updated
 
since you cant mutate the string directly
I dont like the idea of your cross shared projects tho
 
blech.. I hate that word "mutate"
 
@mr5 the more you should rely on nuget. After some time the Bayabas may want to keep the old functionality, and you are screwed if you can't force version
 
9:18 AM
we have better words for that like "change", "alter", "edit"
 
Mutations often occur as a result of inbreeding.
3
 
mr5
@AshKetchum have you gone asking him about your thoughts? I think I've read it and he has a point though
@ntohl oh right
 
I used to have a wonderful vb project shared between basically all of our other prohects, it was essentially our core library
Now we build it in Devlops and use it through nuget instead. Much easier
 
^ everybody have that
 
Still written in vb tho
 
mr5
9:20 AM
devlops?
 
I mean he commented on a totally unrelated issue, which I had put in place on purpose.
@mr5
 
Azure Devops
typing is hard
 
@Wietlol I tried, but it's not fine for compiler Enumerable.Repeat(Enumerable.Range(1, 10).ToList(), 3).Where(x => x.Any(x => x == 2))
 
@ntohl wouldn't that just repeat 2 three times?
 
@ntohl ye, some times it accepts it and other times it doesnt
@Neil meaning of the code is meaningless when you have a syntax example
I think
@ntohl I think it has something to do with fake lambdas
the ones that require being an expression rather than just a normal lambda
 
9:23 AM
also, love the new Satisfactory update. Anybody play that game?
I literally sat down early saturday morning to play the new update and 5 minutes later, it was already time to eat dinner
I should call that game the "time machine"
 
I tried Rimworld yesterday
 
how'd you like it?
 
I want to give satisfactory a go
 
@Neil it just returns all three 1..10's, because all of them have a 2 in them
 
@ntohl ah, I suppose it would
 
9:28 AM
@Neil I continued the tutorial in easy mode. It's quiet boring since I have 3 ppl, and plenty of everything I need
 
@CaptainObvious it's got exploratory elements, but it is in its core essence, a 3d factorio game
 
I just want someone to play ARK with me :(
 
mr5
@Neil I played DOTA2 last Saturday morning (11am), 10 minutes later, it's 9am of Sunday
 
Exactly, I kinda like factorio but it's a pain because I'm not good at planning and having the ability to run stuff over other stuff would be ideal
 
I tried to make a freezer room, but it didn't go below 16 C .
 
9:30 AM
there are a lot of frustrating bottlenecks in Satisfactory that come from conveyer belt speeds
 
Sounds like you had a leak
 
@CaptainObvious oh. That's the challenge...
 
@mr5 gotta love a good time machine game
 
mr5
I can't see what you see in this kind of game Factorio
 
@CaptainObvious I have a vent. Should I close it?
 
9:30 AM
Yes
 
also satisfactory is a grindy game if you're not playing it properly
@mr5 have you tried it?
 
The vent will attempt to level the temperature between either side, so if you're venting yout freezer into your main base then you're just cooling the main base
 
@CaptainObvious try to make a modular base
 
I suppose the same could be said for factorio for that matter. You could be making eveyrthing by hand if you're not doing it right
I tried something different this time around.. rather than just send as much resources as I could at everything, I tried sending exactly the amount required to having a set number of assembly machines running at 100% effiicency
still couldn't quite get it right.. I need 40 iron rods per minute and each constructor takes 15 ingots and makes 15 iron rods per minute, so I build three
 
I would just make sure logistics arent a problem
and then buffer up
 
mr5
9:34 AM
@Neil just saw the video
 
@CaptainObvious ok. Than I somehow misunderstood the tutorial
 
@mr5 the video doesn't do it justice though. looks like a game made in the 90s or something
 
You want to use vents between areas you want to be the same temperature
 
making the total buffer (on which you set the limit) to be consumed approx twice the time the system takes to refill the buffer
 
buffers are nice for resources, but ideally you should be making exactly what you need, no more, no less
 
9:36 AM
Generally I have 1 cooler (@ -5) in the freezer and 1 cooler & 1 heater in the rest of the base to start with, targeting 23 and 19 respectively and go from there
 
@CaptainObvious Yet I have no connected rooms. All surrounded by air
 
Adding more as required until I can afford climate control hardware
 
you'd probably like Oxygen Not Included if you like rimworld
 
Something like that is what I always start with
 
cooler next to a heater? are you mad, sir?
 
9:42 AM
MY god, I've spent 3 hours trying to figure out why my call wasn't working, turns out the API is just bugged AF
 
Offset the temperatures and its fine. Ideal for highly variable climates
Target 19 with the heater and 23 with the cooler and you're golden
 
I'll admit, I wouldn't know. I've only seen people play it
 
ahoy mateys o/
 
\o
 
9:43 AM
@Squirrelkiller indeed, i'll try to merge into master & deploy today
 
@CaptainObvious I'll think I'll go freezer with unconnected walls
 
Nice
Wait you mean it doesnt auto deploy when merged into master?
 
nah, i didn't set any fancy smansy auto deploy up for it
all i do is copy the contents of the bin folder to the server and start the exe
 
Oh god that'd be an awful idea for us
 
Is code review a thing this chatroom can help with?
 
9:46 AM
Fucking shit myself, we just had a fire alarm test which I was informed of less than 20 seconds prior
 
@AshKetchum We absolutely like to tell you how awful your code is
 
@AshKetchum just put it in a pastebin (pastebin.com) if it's more than 4 lines
 
i get told about my terrible code all the time
 
@CaptainSquirrel Your own server or some Azure VM?
 
9:46 AM
@CaptainSquirrel ur code suk
 
mr5
Why it's so hard to configure a VPN by DNS in Android Samsung
 
So I'm good to just paste it here?
 
Better gist or pasteofcode
 
No bang it in a gist
 
They got syntax highlighting
 
9:47 AM
49 secs ago, by Neil
@AshKetchum just put it in a pastebin (pastebin.com) if it's more than 4 lines
 
paste.mod.gg okay?
I've already sent this link to a few so the same link would be good
as you can update it for everyone
 
I've never heard od that one
 
paste.mod.gg/ovonuwalup.cs - my first ever attempt at an asynchronous TCP server
I'm probably going to regret this once the criticism floods in, and it will.
 
Oh it's hastebin
 
mr5
hatesbin*
 
9:48 AM
nonononono
 
@Neil well... you still make exactly what you need, no more, no less
 
@Ash you're gonna be creating about a bazillion tasks all trying to listen
 
+ x
 
Until you OOM
 
where x is negligible
 
9:49 AM
@Wietlol then the buffers do nothing
 
I'm open to ideas of improvements, I simply didn't know a better way to do it
 
what I use is a train system
 
if anything it's a false sense of security that everything is working fine, when in fact it's simply retrieving pieces from a buffer instead
 
choo choo
 
trains deliver resources to factories
when the trains are gone to get more resources, the factory should still be up
so, that is what the buffers are for
 
mr5
9:50 AM
oh so it's train now
last time I checked it was called bus
 
Trains are no fun
 
factories stop when they overproduce (also a very small buffer)
 
they all sort of have their own natural buffer anyway
 
so, in the long run, the buffers are negligible
 
@CaptainObvious the other way blocked the NetworkHandler so that I couldn't listen for new connections
 
9:51 AM
@Squirrelkiller own server
 
abeit just two stacks
 
would one task in network handler, checking for messages on all connected clients be better?
 
ye, two stacks are often not enough tho
 
depends on what you're making I suppose
 
9:52 AM
keeping in mind where the trains have to get their resources from
 
@CaptainSquirrel I wonder if you can have it listen to the master branch and pull&deploy on a new push
 
I do wonder why you're thinking of this yourself when there's ready-made production-ready solutions for this.
 
If you set it up that with the resources you're getting, you can support n assembly machines running at full capacity, nothing needs a buffer
except the final product
 
I bet Azure DevOps supports webhooks for that
 
trains arent smooth logistics tho
when trains are moving, your input stops
or your output cannot get rid of its resources
 
9:53 AM
I wish they could allow an option to just ride a train and not command it
 
dont they have that already?
just go inside a train
 
you become the driver when you enter the train
 
if the train is on automatic, it just follows its schedule
oh, then make it manual, then you can drive the train
 
maybe they corrected it later
 
@AshKetchum What you want is 1 listener which when a new connection comes in spawns a new listener to continue listening and respond through that one (or create a new thread to respond and keep listening
 
9:55 AM
when they released it, getting in the train = driving the train
 
Either way though, fiddling with trying to manage your connections yourself is always a bad time
 
@Wietlol I'm not sure if you're talking about a video game or a painfully convoluted metaphor for software systems.
 
@Squirrelkiller I'm pretty sure there's actually a function for that in devops
 
I'll take a look later
 
9:56 AM
@AvnerShahar-Kashtan It's called the "train" pattern, get with it, man
 
@AvnerShahar-Kashtan a video game :D
 
Satisfactory to be precise
 
I dont make painfully convoluted stuff
especially for software systems
 
though probably not a big coincidence that you could confuse the two concepts
 
@Wietlol Lie of the decade
 
9:57 AM
conceptually very similar things
 
I think i pulled a muscle in my neck yesterday because oh boy do I have the pain
Help, i'm falling apart
 
omg stop breaking yourself
 
@CaptainSquirrel I've started biking to work, and today I've started using the gym at work, and let me tell you - that satisfying feeling of endorphins flowing through your body giving you an almost euphoric sense of well being? That hasn't happened yet, dammit.
3
 
I CAN'T HELP
@AvnerShahar-Kashtan Well i'm glad to see you are alive
And tbh, that's one of the things that scares me about going to the gym on the regular
 
Ah yes the google memes
 
9:59 AM
everyone says "you'll get the bug etc"
 

« first day (3411 days earlier)      last day (1520 days later) »