« first day (3694 days earlier)      last day (1237 days later) » 

1:50 AM
 
 
2 hours later…
4:10 AM
@Botler up
@CaptainObvious, errm, what happened to botler?
 
 
2 hours later…
6:14 AM
Buenos dias
How about that 100% up time and reliability
 
7:02 AM
Hey guys, what would be a decent way to handle client timeouts?
Run a single event and check all clients at the same time for a timeout by sending a message every say minute or 2 or something else?
Since TcpClient.Connected only updates after I/O requests.
 
7:16 AM
Yeah that's a good way, just send pings every now and then
Why are you building your own tcp server anyway?
 
@Squirrelkiller why not?
I wrote one on Github, now I am updating it to modern async/await paradigms.
 
Ah nice. Just thought maybe there is a bigger thing you're building it for.
 
@Squirrelkiller possibly, I'd like to use it with a game, but I'm not trying to be that ambitious.
Might try some time/tick synchronization stuff (like Runescape) and what not, but that's about it.
 
 
2 hours later…
9:09 AM
Oh shit google docs also has anonymous nyancat
 
9:31 AM
morning
 
Good morning.
 
Sup.
 
Im fine, you?
 
Doing good, just doing some server programming.
 
9:35 AM
Is this like a programmer's discord or something???
 
Kinda, but for C# only.
 
Oh nice. I gtg bye!
 
9:46 AM
Morning all 0/
 
Well that was a quick visit
 
That's what she said
:D
 
Haha, good morning.,
What's everyone up to?
 
Document Printing Microservice atm
how about your fine self?
 
mr5
That moment when eth fee is higher that your available balance to transfer :|
 
9:55 AM
unlucky
what you buying?
 
mr5
I bought ~0.04 ethereum just today because the market just crashed low. Unlucky for me again, the transfer fee cost ~0.07
 
I am trying to write serialization/deserialization functionality for structs for packets for networking.
It's slow. :(
 
@FatalSleep Sounds like fun, what format are you serializing to?
 
byte[]
With data alignment.
(byte packing)
 
@mr5 I just can't get into virtual currency, feels like a con to me lol not that real currency is much better
@FatalSleep can you parallelise the process maybe to speed it up?
 
10:04 AM
@DAustin unfortunately no not much can be done.
 
what's wrong with protobuf? (same data alignment serializer)
you already have a NetworkStream to work with. Protobuf can just use it to output the data to
 
Protobuf is slow too.
Well relatively so.
 
just FTP it
/s :P
 
when was Protobuf slow?
 
@ntohl relatively compared to just rolling a custom serializer per struct.
 
Right, yeah it's quick, but how could it be quicker than a per-struct implementation?
 
Speaking of which, are you on .Net 5?
 
The latest one?
 
aye
 
Yeah.
 
10:19 AM
bugger, that takes out the easiest performance booster option :P
 
well if you were using .net core 3.1 still, youd get a massive performance boost by just updating the framework
but you already have so nvm
 
LOL.
 
worth checking :P
 
Definitely haha, way ahead of you.
 
10:24 AM
worth a punt
The problem with learning on the job is that every time you go back to add to old code you end up refactoring most of it going "God damn, I was an idiot to do it that way..."
coffee time while I rethink this shit
 
mr5
@DAustin I think the concept is the same as stock prices but crypto market values oscillates very fast.
 
@mr5 Yeh I think you're right, I just missed the boat really
 
mr5
I don't know much about real stocks though so I can't explain more.
 
@mr5 I think my dad's attempts at stocks over the years has put me off investing that way for life
he didnt lose his money, but he hardly made anything and the amount of hours he must have spent doing it makes me think its not worth it lol
I did it once and made some profit thanks to having some info not publically available, but im talking like £300 lol
got out while i was ahead xD
brb
 
mr5
oh well, then I think crypto is much less hassle. You can download an app an make it notify about the price drops/raise every hour and you decide when you will pull it out of the market.
@DAustin nice. that's a decent amount. how long did it take you to gain it?
 
10:40 AM
about a month, id go into detail but technically id get into a lot of trouble lol
not as if I could pull it off again anyway
just got lucky
 
mr5
you probably stake a lot of money also. rk.
 
10:53 AM
@mr5 nah i put in like £150ish, doubled my money basically
 
11:08 AM
I lost 3K euro in crypto because I was a dumb fuck. A lil' word of warning :-)
 
ouch
some guy here in the uk lost over 100K in bitcoin because he forgot he bought a load before it took off
then remembered after he threw out his old computer that they were on that hard drive xD
 
mr5
Roel can get it back in just a minute.
 
mr5
11:30 AM
"-t text -a test"
"--type text --alias test"
what would be an elegant way to parse these cli options?
I'm thinking of using string.Substring and mutate the string after I'm done parsing a single option. That way, I need not to worry of adjusting the string indices. Then I'd put it in a structure like this: class Options { Type, Value }
 
rootCommand.Children["--input"].AddAlias("-i");
 
mr5
nice.
 
12:07 PM
@mr5 In a minute? How? Tell me.
 
Getting one value from one specific entity in EF: entities.Entity.SingleAsync(e => e.Id == id).Value; ? This would pull the whole entity and then take the value. .Single is Linq and not EF, so it returns an entity directly for me to get the .Value from.
 
mr5
@Hozuki if there's a will, there's a way. sorry that was just a joke.
 
12:24 PM
Do we have extension properties yet?
 
12:34 PM
May I present my Task extension that would be much nicer as an extension property: gist.github.com/Regenhardt/b84046504b19db36b2b530a0763b612c
Or as a language feature
 
I don't see the reason for that.
Also you can mimic extension propertier already with "GetSet"
Where you haz a static dic<mytype, myvalue> to regulate the get set things
 
This is the reason:
 
mr5
Is Result a built-in type?
 
With my extension:
var teamId = await this.teamRepository.GetTeamIdByName(teamName).Data();
Without it:
var teamId = (await this.teamRepository.GetTeamIdByName(teamName)).Data;
Without it, I have to put parens around the whole awaiting and then call the data.
I use Result<T> for returns, which holds a boolean and optionally data. Basically like Wietlol's beloved Maybe or whatsitcalled
 
mr5
Because it is wrapped in Result, await just unwraps the T of Task. Maybe, unwrapped the Result inside that method?
 
12:41 PM
IOptional
 
mr5
oic
 
No, because I want the outside method to unwrap the result.
That's the point of Result.
 
mr5
I also do that. I normally check for the status first before unwrapping the data.
 
Right, maybe was Haskell I think? Where's Frendall anyway?
@mr5 Me too, I just ditched it for readability here
 
the point of Result is not to unwrap, it is to resolve
given a Result (or in my case, an Optional), you have various methods to resolve it
for example, you can take the value .OrElse(otherValue)
 
12:43 PM
lol i mixed up my 2 paths and accidentally overwrote an image in production with a pdf, whooops
 
or you can take the value .OrThrow(() => new Exception())
or you can just execute a function only when it was successful
 
that sounds pretty neat actually Wiet
 
.IfSuccess(it => Console.WriteLine(it))
just getting the value has to implicitly take an approach
my IOptional does have a .GetOrThrow() (in which case, I think it is an illegal state exception or something along those lines)
but generally speaking, you would rather throw a more meaningful error
but in basic terms, the goal of a Result/Optional monad is not to get the value out, but to pass behavior in
 
1:00 PM
C# has a Maybe<T> lib
I just didnt think it was good enough :D
 
A Maybe<T> is not necessary anymore? The compiler has nullables now.
MyClass? Prop
 
most of the libs dont use interfaces, and C# interfaces have a few advantages over classes
for example... IOptional<out T>
@Hozuki ye... except it sucks...
 
@Wietlol ... Why?
 
there are so many problems with it
 
Like what?
 
1:03 PM
it doesnt work well with System.Nullable,
it doesnt work well with generics,
it doesnt work well with extension methods,
it doesnt have ways of explicitly specifying a non-null as opposed to implicitly null capable,
etc
for example
public T? Foo<T>() {...}
gives an error because it is ambiguous between nullable references and nullable structs
you have to do
public T? FooStruct<T>() where T : struct {...}
public T? FooClass<T>() where T : class {...}
also
public void Foo<T>() {...} where T is not nullable is not possible
 
Okay. I haven't needed that, but that's a nice edge case. But does that make the entire thing 'suck'?
 
(I mean, you cant make a condition that you cannot do Foo<String?>() which is very common in actual null aware languages)
Nullable values arent easy to keep in scope in a method chain, causing chaining
with nullable extension methods to often be useless
casts with a nullable are also not always possible
and I am sure I forgot a few cases
 
Hello friends!
 
I recently ported a library of mine from Kotlin to C#
considering it was designed with null awareness and cross platform, it should've been easy
 
[Captain Obvious] Botler back
 
1:09 PM
I ended up having to disable the nullable references to not get a headache
and to avoid duplication of code
@CaptainObvious you know... if you use Wietbot's listener, you dont have to worry about disconnecting from SO
 
[Captain Obvious] Looks like stack chat went down again last night
 
:p
 
[Captain Obvious] Based on there being a message from Oakbot in the sandbox saying he just came back online
[Captain Obvious] At around 18:55 last night
 
dunno if it runs on aws, but they had an outage yesterday
 
[Captain Obvious] I think SE run their own servers?
 
1:13 PM
@Hozuki I use Result to deliver a message in case of failure
> 18:55 last night
What kinda sleeping schedule do you have
 
transcript doesnt require sleep
 
@Botler Probably, just saw it come up in my news feed and thought the 2 might be connected
 
@Wietlol I mean him calling 18:55 "night"
 
[Captain Obvious] "last night" refers to anything after midday
[Captain Obvious] Although sometimes I am asleep at that time
[kesarling] How does one get it online if its offline? As in what command?
[Captain Obvious] At the moment you can't, I have to teamviewer on to the server
[kesarling] umm, will you please gimme the repo link?
 
isnt it in pinned messages
 
1:24 PM
[Captain Obvious] check the welcome channel
[kesarling] I want to fork it
[kesarling] will that be fine?
[kesarling] thanks a lot 🙂
[Captain Obvious] Send PRs with useful code
[Captain Obvious] If somebody adds processing commands from discord then they should be able to get it reset
[kesarling] Definitely 👍
[kesarling] Want me to do that?
[kesarling] Done
[Captain Obvious] If you can get it to process commands from Discord, then when somebody sends it a "Botler, shutdown" it'll shut itself down, update itself and then start back up
[kesarling] okay
[kesarling] although, will it be easy to import it into VS?
[kesarling] If it has been made using VS IDE, that will be fairy easy
[kesarling] @butler1233
[kesarling] You kinda need a neat README
[kesarling] Umm... something's wrong. I can't clone 😦
[kesarling] @butler1233
[mr5] use the cli
[mr5] git clone repo-url
[kesarling] I downloaded it instead
[kesarling] Now it's gonna be hard to push it
[mr5] GitHub also have a VS integration. You can automatically fork the repo in their website.
[kesarling] Yes, that's what I used
[mr5] You should really fork it tbh.
[kesarling] Wait
[kesarling] Yeah, I forked it
 
Then just clone the new repo now
 
[kesarling] Yeah, I am cloning the new Repo! I have used Git and GitHub extensively! lol
[kesarling] What I'll do instead is, I'll clone the original, and then fork it using VS
[mr5] uhm
[kesarling] Cloning stops exactly at 487/748
[mr5] what's wrong with just forking it using gh?
[kesarling] Will try
[mr5] fork and clone is basically the same thing. fork lets you reference where you get the original source from while clone ...idk.
[kesarling] This you mean?
[kesarling] Fork creates a new branch
[kesarling] Cloning is like remotely connecting, downloading and making commits and Pushing stuff
[mr5] no. the UI stuff from GitHub website. There's a button to fork the repo there.
[kesarling] Yeah, that's how I forked
[mr5] I'm not sure about the commits & pushing stuffs, but yeah.
[kesarling] done!
[kesarling] yay!!
[kesarling] Ermm... I seem to be missing some packages
[kesarling] What extra packages do I need?
[kesarling] @butler1233 @markiel
[kesarling] Any special reason to not implement ICommandProcessor? @butler1233
[mr5] is this the so-chatbot you're talking about?
[kesarling] ofc
[mr5] in doesn't compile?
[kesarling] No, it does now
[kesarling] I had messed up a bit 😅
[kesarling] Am I not allowed to run it if I don't have a stack exchange account?
[kesarling] I log in from Google SSO
[mr5] ah. go to your profile > login & details
[mr5] then add more logins.
[mr5] tis I learn from butler
[kesarling] Something's wrong
[Squirrel in Training] why u grills chatting here instead of the #general-csharp channel?
[kesarling] idk
[mr5] you also need to have your own datcord bot id and edit the config.json
[mr5] why tf 😛 is :yum:. what's wrong with you datcord.
[mr5] the readme is reserved for fluent English speakers. careful with that thing 😄
[kesarling] me me me!!
 
2:55 PM
Having a noodle with azure app configuration for the first time. Anyone know if it's possible to set these via code, as opposed to just get them?
 
3:18 PM
For a web app?
 
a nuget called azure management
or something
no?
 
Yes, in a web app. You can read the values with the nuGet package but I can't find anything about whether you can set them
you can do it with powershell which is what I'm trying right now but that's messy
 
its the same principle but try azure cli
 
Yeah I was hoping for some neat c# wrappers like we get for reading stuff :(
 
3:38 PM
its barely used like this
 
4:16 PM
Ho to prevent the connection string in Web.config to be synced in TFS please?
 
there is an excluded list
 
link please, or any reference, but does this exclude the whole file or only portions of it?
 
if you right click in VS on the file, it allows you to put it into the other bracket
 
Ah, I use it already, but the problem is that I want only to exclude the connection string
 
4:34 PM
there is no way for exclude a portion of a file in any subversion system
 
[misha] dont put your connection string in the web.config file, simple as that
 
 
1 hour later…
6:00 PM
SQUIRREL!
thanks to you guys now people are sending Rebecca Black disguised links around work!
 
[Li] What
 
click it, its not rebecca black i promise :D
 
[Li] You mean other than the fact the discord embed shows Rebecca Black's Friday
[Li] Lmao
[Li] But ic
 
6:17 PM
lol outlook 2016 doesnt do that by default :P
so my designer just got me
cheeky sod
a war has been started i might not win, but ill put up a damn good fight!
anyways have fun all tatty byes xoxoxox
 
[Li] Just hit them with that Rick Roll like it's 2008
 
 
3 hours later…
9:42 PM
So this is neat, instead of using Marshal you can create a union-style struct without labeling the struct as "unsafe."
    [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Ansi, Size = 8, Pack = 4)]
    struct TcpAsyncDataPacket : TcpPacketInter {
        #region BYTES
        [FieldOffset(0)] private unsafe fixed byte bytes[8];
        #endregion
        [FieldOffset(0)] public byte Header;
        [FieldOffset(4)] public int Size;

        public void Serialize(ref byte[] buffer, int startIndex) {
            unsafe {
                for (int i = 0; i < 8; i++) buffer[startIndex + i] = bytes[i];
            }
 
10:06 PM
hello
 
Hey.
 
            // 1
            Dispatcher.Invoke(new Action(() => { }), System.Windows.Threading.DispatcherPriority.ContextIdle, null);
            // 2
            var a = new Action(delegate (){ });
            Dispatcher.Invoke(a, System.Windows.Threading.DispatcherPriority.ContextIdle, null);
I want to write this code and my solution compiles.
 
Okay.
 
But I have a managed C++ project from another solution which depends on this, and it does not compile due to this
 
Well... not really enough context here to help out.
 
10:08 PM
error C3225: generic type argument for 'T' cannot be 'MyLibrary::Tools::Tool1::<>c', it must be a value type or a handle to a reference type
//1 and //2 were two different manners of me trying to achieve the same goal
is there a way less dependent on lambdas /delegates for to write that code?
is there something I can pass into the Action's constructor which is not a delegate / lambda?
this also fails:
//3
Action ac = delegate {};
Dispatcher.Invoke(ac, System.Windows.Threading.DispatcherPriority.ContextIdle, null);
//4
Dispatcher.Invoke(null, System.Windows.Threading.DispatcherPriority.ContextIdle, null);
compiles, but fails.
in runtime: System.ArgumentNullException: 'Value cannot be null.
Parameter name: method'
 
11:21 PM
Now I got more insight on what was the cause: It has to do with the var I was using in the line where the compile error was triggered: It was declaring a member variable Collection<MyStruct>^. MyStruct is a struct, which is a value type. I changed it to a class, changed the Collection to Collection<MyClass^>^ and did other changes accordingly.
Now everything is working.
But still can not see what is the relation with the delegate.
 

« first day (3694 days earlier)      last day (1237 days later) »