« first day (3461 days earlier)      last day (1481 days later) » 
00:00 - 17:0017:00 - 22:00

12:11 AM
 
 
3 hours later…
mr5
2:51 AM
@Hypersapien if the repository is in remote, you have to git clone first. git checkout is used when you already have the branch in your local storage and is used for switching branches.
just to for the record, I wasn't high because of drugs but due to lack of sleep
@Hypersapien I highly suggest you create your branches in your local machine only and just push it in the remote if it is really needed. As for merging to your working branch, you have to commit first the files you've changed in your testing branch then switch to the working branch, and finally, proceed to merge it with your testing branch.
 
 
2 hours later…
4:44 AM
Ben Popper on April 07, 2020
Programming may teach you about the law of large numbers, but that doesn’t mean you’ll always have the answer.
 
5:22 AM
Buenos dias
 
said soneub
 
mr5
hola
soy Dora
tsu tsu rutsu tsu dora
tsu tsu rutsu tsu dora
dora dora dora the explorer
 
Dora: do you see mr5?
Dora: Where is mr5?
 
6:31 AM
morning :)
 
6:53 AM
o/
 
7:08 AM
@mr5 Can you say delicioso?
 
mr5
@Hozuki muy bien!
 
@Hozuki drink mineral water regularly and eat each type of fruits that benefits vitamins a,b,c,e .. to enhance body immune system while your area lack of medical supports
 
@nyconing W.. what?
 
mr5
delis siyoso! nom nom nom nom!
 
@nyconing What about simple supplements instead? They make delicious juices!
 
mr5
7:11 AM
you should be well ventilated especially when you're not living alone
 
Oh, now I get it. You misunderstand. I didn't say my area lacks medical support, I said it lacked Covid-19 tests, and testing doesn't happen on a large scale. That's changing now. Either way, if your symptoms are mild enough to not warrant a hospital visit, knowing if it's Covid-19 or not doesn't matter at all because the follow-up doesn't change: stay at home and rest. That's it. Hospitals can't do much more anyway until you need medical help.
 
My living room, in which I work from home, basically has two verandas, one to my left one to my right.
As soon as I open both doors I am **very** well venitlated.
 
mr5
I can't explain it well but I've seen that video on FB where the Japanese explains how the virus spreads through the air whenever you talk or sneezes
 
<3
what are your hobbies?
 
Programming and gaming^^
 
mr5
7:17 AM
And as soon as you open the windows in your house, those microbes in the air will be swept along in the air. But they didn't explain how long those microbes will survive outside
same ^
+ skating
 
nice nice
 
Software, playing music instruments, archery, gaming, dog (training), anime/manga, hiking, cycling...
 
wowow
 
Oh shit great Idea! I have a garden now, so I can put up a practise target for archery now :D
 
mr5
you can say Hozuki Roel is adventurous and doesn't fit the typical programmer ^^
 
7:23 AM
I perfectly fit the typical programmer since I busted my knee. Basically can't do anything that means moving too quickly :/
 
@Squirrelkiller Damn, I want a garden big enough for that!
@mr5 lol, I didn't know we were to adhere to the stereotype
 
@Squirrelkiller I busted my knee as well!
which knee?
I am hemophiliac so that is a bleeding joint
 
Damn. I busted my left knee. Kneecap was basically ripped off the one side. Looked eery.
 
@Hozuki ok. take care
@Squirrelkiller I do not believe
 
7:57 AM
my left knee as well xD
ooh
what happened?
 
8:26 AM
Different topic for a moment:
Say I have a WebApp. Usually I sit with a customer and click through the WebApp, using the things the customer tells me.

Now instead, I'd like to do this remote: Send the customer a link, so he can see what I'm doing, basically his browser starts the same WebApp, and our Browsers are synchronized: What I do happens in his browser, and maybe even he can do stuff nd it happens in my browser too.

I need ideas about where to start. Are there libraries I can incorporate into my javascript to sync two browsers?
 
@Squirrelkiller SignalR, just send commands or action object messages. {selector: "#editButton", event: "click"} and then replay them on the remote browser and vice versa.
Goto Meeting, Zoom, MSTeams all have screenshare. Windows RDP has a remote support feature.
 
Not ideal, since said WebApp is already in use, has been developed 6 years ago, and has like a thousand form fields and buttons. Can't really change all of those to also send a signalR mesage.
Thinking about just finding somthing with screen share in the browser
Like screanleep uses
 
You only need the SignalR library, a hub class server side. Two js methods client side. One to serialize all browser events and send, one to receive and execute remote events.
web searches screenleap ...
 
8:48 AM
I could only think of give him access to your remote desktop. -_-
 
Imagine the customer I'm trying to show this is in his fifties and knows nothing about what a "Desktop" is. I send an E-Mail, he clicks a link, Browser opens a tab and shows my application.
Looking into WebRTC
 
9:17 AM
discord
g classroom
most company dont want to use zoom because they dont like /trust chinese software, so discord or g classroom or both
 
@Hozuki me too
 
Do note zoom just got discovered a security vulnerability in his windows client
Yesterday received a corporate email saying "we dont use zoom, but those who do to contact with clients, use the web version"
 
@ntohl The envy is real :3
 
yeah. I have restarted practicing archery approx 3-5 years ago
in 2005 I shot really well
 
AFAIK zoom was also caught literally selling user data to facebook?
 
9:25 AM
I'm a total newbie. I've just started having completed the fundamentals of shooting (4 months) and then we got a lockdown
 
@nyconing So this one is totally valid
 
my arm wont allow me to take more shoot after 5-10 shoots, on regular toy bow
 
I lacked any type of "course". I just shot.
 
does anyone know why this locks my wpf app?
theCounter += 1;
                            debugBox.Text = theCounter.ToString();
when i remove 'theCounter += 1;' , the code runs smoothly
 
more accuracy will cost stamina
 
9:29 AM
it's under a void async task.run
 
@Adan Need more context
 
  await Task.Run(async () => {

                while (!quit)
            {
                    await Task.Run(() => {
                        //Thread.Sleep(100);

                        lastPrice = (decimal)NTClient.MarketData(inst, 0);
                        this.Dispatcher.Invoke(() =>
                        {

                            textBoxLastPrice.Text = lastPrice.ToString();
                            tbBoundaryPrice.Text = boundaryPrice.ToString();
                            investmentTypeBox.Text = investmentType;
 
What happens before this? What does the method prototype look like, async void or async Task?
 
when i remove 'theCounter += 1;'
the wpf app does not lock
 
That is...one hell of a construct
 
9:31 AM
something with incrementing locks the app
+= 1 locks the app
 
omg
 
im a home developer, non work related project, and i am not employed in a software dev company
so my coding is garbage
 
why thread sleep?
 
 
lose the thread.sleep
 
9:33 AM
just bragging
 
If you want delay, use Task.Delay
 
yes i know, even with task.delay my app still locks
 
Maybe is not locking the +=1 but the debugBox.Text = theCounter.ToString();
 
@ntohl So you got a 3D printer? Nice.
 
mr5
@ntohl are you an olympian?
 
9:34 AM
@bradbury9 i remove += 1 and it does not lock
 
@mr5 no. These are all traditional archery competitions
 
i remove .text = and still locks
2
Q: Updating a single value from multiple threads

JL.I have a counter - let's just call it : ItemsRemaining. I will have a dynamic amount of threads, but for this example, let's say I have 10 threads..... each thread will contain a loop, and each iteration in the loop does a unit of work, then should update the ItemsRemaining variable on GUI thr...

is this the issue?
this what's locking the app?
 
I'm too lazy to read AND understand that right now, but have you tried making the counter volatile?
 
not sure what making the counter volatile means
il try google
maybe the concept is that
my while loop running async, is running in parallel?
so it should have issues when i am incrementing a global variable
 
Nope, the await makes the loop wait at that point
 
9:40 AM
I think the problem is closure around the theCounter
 
Interlocked.Increment(ref this.counter);
something like this then?
663
Q: Volatile vs. Interlocked vs. lock

coreLet's say that a class has a public int counter field that is accessed by multiple threads. This int is only incremented or decremented. To increment this field, which approach should be used, and why? lock(this.locker) this.counter++;, Interlocked.Increment(ref this.counter);, Change the acce...

 
yeah sounds good. Although I did only read the title.
 
ok i am warm ;)
now i just need to think what to do next to my code
 
try adding the parameter theCounter at the Task creation. So it's passed. You will eliminate delegate creation
26
A: How can I capture the value of an outer variable inside a lambda expression?

Panagiotis KanavosThis has more to do with lambdas than threading. A lambda captures the reference to a variable, not the variable's value. This means that when you try to use i in your code, its value will be whatever was stored in i last. To avoid this, you should copy the variable's value to a local variable ...

 
oh thanks, so to take this?
The best solution is to pass the loop parameter as a state parameter:

for (var i = 0; i < 50; ++i) {
    Task.Factory.StartNew(o => {
        var i1=(int)o;
        Debug.Print("Error: " + i1.ToString());
    }, i);
}
 
9:47 AM
yes
 
how do i re-work my code for that?
do i scrap task.run and use task.factory.startnew?
 
instead of await Task.Run(, await Task.Factory.StartNew(o => { var theCounter = (int)o; ... }, theCounter);
this way you see is what is the problem. This is not a solution, but a warning about what are you trying to do
 
AFAIK Task.Run is just a short form for Task.Factory.StartNew?
 
in every lambda the theCounter++ accesses a variable from delegate. I don't know if it's making a new delegate every time or not
 
*scratches head
 
9:53 AM
@Squirrelkiller not exactly. Task.Run gives Task.Factory.StartNew important default params
 
I see.
Where is theCounter declared? Instance var?
 
   public int theCounter { get; set; }
 
WinForms?
 
can you check the await Task.Factory.StartNew(o => { var theCounter = (int)o; ... }, theCounter); locks or not?
WPF
 
wpf
@ntohl sure, give me 1 sec
 
9:56 AM
Then why not use databinding and NPC?
 
so the thread stops
it increments 1, and then it stops
while (!quit)
            {
                    await Task.Run(() => {
                        //Thread.Sleep(100);

                        lastPrice = (decimal)NTClient.MarketData(inst, 0);
                        this.Dispatcher.Invoke(async () =>
                        {

                            textBoxLastPrice.Text = lastPrice.ToString();
                            tbBoundaryPrice.Text = boundaryPrice.ToString();
                            investmentTypeBox.Text = investmentType;
                            positionSizeBox.Text = positionCounter.ToString();
 
Task.Factory.StartNew Does not understand async delegates!! beware of that also if you say "Task.Run is just a short form for Task.Factory.StartNew". So for example Task.Run(async () => should be working
 
wait what?
 
await Task.Factory.StartNew(o => { var theCounter = (int)o; should be not there
it should be at the beginning Task.Run
await Task.Run(() => {
//Thread.Sleep(100);
anyway. The whole thing is wrong :D
you have to diff around the code that should run on the background, and the updating of the UI
 
10:06 AM
ok
it runs once
and that's it
it incremented 1 time, 0 to 1
nvm
now it stilll locks the app
 await Task.Factory.StartNew(o => {
                var theCounter = (int)o;


                while (!quit)
                {

                        lastPrice = (decimal)NTClient.MarketData(inst, 0);
                        this.Dispatcher.Invoke(() =>
                        {

                            textBoxLastPrice.Text = lastPrice.ToString();
                            tbBoundaryPrice.Text = boundaryPrice.ToString();
                            investmentTypeBox.Text = investmentType;
 
so you store the UI context, create a Task doing the background work, than .ContinueWith(x => <using x to update UI>, uiThreadContext)
wtf
previously the Task creation was inside the loop
 
i appreciate the help, im pretty bad at coding, i think i misunderstood you
 
Run4 Run5 are also doing hard work?
 
they use this:
await Task.Run(() => {
but dont have 'while' loops in them
they do increment
@ntohl so running what i posted, it still locks the ui
 
wait
 
10:23 AM
.. what if you can build a wpf app
and do a while loop where it increment asynchronously?
 
@Adan the problem is the app not responding?
 
it's incrementing but while it's incrementing the ui has a loading circle
i cant press any buttons
im creating a new wpf app
with 1 while loop incrementing asynchronously
and tweak it until it does not block the ui
 
 await Task.Factory.StartNew(o => {
                while (!quit)
                {
                        try{
                            lastPrice = (decimal)NTClient.MarketData(inst, 0);
                            o += 1;
                            this.Dispatcher.Invoke(() =>
                            {
                                textBoxLastPrice.Text = lastPrice.ToString();
                                tbBoundaryPrice.Text = boundaryPrice.ToString();
                                investmentTypeBox.Text = investmentType;
try this, and placing a breakpoint, see if breakpoint is hit?
 
public class Counter
{
public int Value { get; set; }
}

//...

var counter = new Counter();

await Task.Run(() =>{
while (!quit)
{
lastPrice = (decimal)NTClient.MarketData(inst, 0);

this.Dispatcher.Invoke(() =>
{

textBoxLastPrice.Text = lastPrice.ToString();
tbBoundaryPrice.Text = boundaryPrice.ToString();
investmentTypeBox.Text = investmentType;
positionSizeBox.Text = positionCounter.ToString();
tbsboundaryPrice.Text = sboundaryPrice.ToString();

counter.Value++;

debugBox.Text = theCounter.ToString();
 
i'll try both
thank you
 
10:26 AM
Try that to rule out local variable causing the issue. Counter might not be incrementing properly due to local variables being dragged into a new tawk
task*
 
then you try daniel's solution and ignore me if you cant take focus on me, im rushing my project...
 
@DanielFowler still locks
 
@nyconing You seem a little on edge today, curfew hit you hard?
 
Now I have you name, Mr Tank!
 
10:32 AM
nah i just rushing my project, due date is approaching and I DONE NOTHING
 
shit. I'm exposed
 
24 hours ago, by nyconing
fuck project
 
24 hours ago, by nyconing
go rest
 
How many times does it go into that while loop?
 
?
i think what would help the most
is a simple while loop while trying to increment a value
and just that.. asynchronously
if i can see a working example for that, i can do the rest
 
10:42 AM
@ntohl what are those? Darwin awards?
 
and Golden Raspberry Awards
 
var counter = 0;

await System.Threading.Tasks.Task.Run(() => {
while(counter < 5)
{
counter++;
}
});
Dont know if that helps then?
 
here's the simplest replication
  public MainWindow()
        {
            InitializeComponent();

            test();
        }
        public int counter { get; set; }
        public async void test()
        {
            while(true)
            {
                await Task.Run(() =>
                {

                    counter += 1;

                    this.Dispatcher.Invoke(() =>
                    {
                        textBox.Text = counter.ToString();
                    });


                });
            }
run this, it locks the ui
 
I have updated the gist. Please check.
 
thank you, i did look at it
would i be able to implement it in the above ex? ^
 
10:48 AM
yes.
 
@DanielFowler still locks
 
your example will lock anyway. You are updating UI without long running process
so it's actively sets UI with infinite speed
await Task.Delay is needed before counter += 1
 
Yep what ntohl is saying. Im not famliar with windows apps but i think Dispatcher.Invoke wil run on the UI thread. Its doing this in a while(true) loop so its going to lock the ui
 
it's not the loop, but the speed of update is the problem
 
10:52 AM
how do i place text on the ui without using a main thread?
 
You cant as far as im aware, you just have to do it less frequently
 
I'll make a gist with Delay
and yes. You can't
 
Only the Main thread can alter the UI.
 
hmm
so task delay is the answer...
and it's true
just confirmed it
ui is not blocked when i delay for 500ms
thanks guys!!!
 
No worries :)
 
mr5
11:04 AM
@nyconing same same
 
is individual group by better or a group join with all tables?
 
11:58 AM
Pretty sure Task.Delay is ALWAYS better than Thread.Sleep.
Disclaimer: This presumes you're in an async context.
 
12:13 PM
!~+()=>{Task.Delay.Wait(3000);return "ironman";}
<!>'Task.Delay(TimeSpan)' is a method, which is not valid in the given context
!>>CodeWorker complete in 4034ms
 
lol. You are timouting Delay
 
lol
 
!~+() => {Task.Delay(3000).Wait(); return "ironman";}
 
!=>"ironman"
!>>CodeWorker complete in 7106ms
 
That's a lot of overhead
!~+ return "ironman";
 
12:16 PM
!=>"ironman"
!>>CodeWorker complete in 4248ms
 
not that much :D
 
Really, my simple return statement needs longer than the one inside the action with a task delay in front?!
 
!~+() => {Task.Delay(3000).Wait(1500); return "sad ironman :(";}
 
!=>"sad ironman :("
!>>CodeWorker complete in 5735ms
 
wait. That's actually correct
 
12:18 PM
4.2+1.5=5.7
 
yeah. I cancelled the delay after 1.5 sec
but I thought there will be a TaskCancelled exception or something
and there will be no output
 
@Wietbot evalcs return this;
 
javax.script.ScriptException(<eval>:1:0 Invalid return statement
return this;
^ in <eval> at line number 1 at column number 0)
 
java lol
 
java c# lol
 
12:21 PM
C#-Interactive confirms:
 
javax.script.ScriptException(<eval>:1:0 Invalid return statement
return this;
^ in <eval> at line number 1 at column number 0)
 
@Wietbot evalCs return this;
 
@Wietbot shut up
 
I don't know this command, did you mean any of the following? join, shutdown
 
tempting..
 
12:22 PM
@Wietbot commands
 
I don't know this command, did you mean any of the following? listcommands
 
@Hans1984 It won't work
 
hmmm
 
@Wietbot listcommands
 
evalJs, evalKotlin, evalNode, evalCSharp, evalSql, listCommands, join, leave, barrelRoll, shutdown, slowpoke
 
12:22 PM
@Wietbot evalcsharp return this;
 
javax.script.ScriptException(<eval>:1:0 Invalid return statement
return this;
^ in <eval> at line number 1 at column number 0)
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,8): error CS0027: Keyword 'this' is not available in the current context)
 
play in the sandbox plz
 
@Wietbot evalCsharp return GetExecutingAssembly().Name
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,35): error CS1002: ; expected)
 
12:24 PM
imtoo bigfor the sandbox
i would take up the whole space
unless its a BIG sandbox
 
ha
fluffy bed
 
A mother so fat, the son is too big for a virtual room.
 
talking to me?
watch your mouth you lil f.cker
better not mention my mother
;)
 
1:11 PM
hans' mother is not a squirrel
 
how do we generate a Bearer Token so that it can be used in appsettings.json?
 
she's far too big
I'm sorry @Hans1984 i couldn't resist
ilu
 
shes not a squirrel indeed
 
i am doing a hunger
for i am
the fat squirrel
 
or maybe I am asking the wrong question. How do i create a token that can be used as a bearer token? does the answer depend on what kind of encryption?
 
1:15 PM
 
cute :)
 
there it is
 
the final boss of dark squirrels 3
 
the phatsquirrel
 
hes summoning those guys as his allies in the fight
they have mushroom shields
in need to watch sports
im losing it
yesterday i watched a 18year old basketball game on youtube
:(
 
1:26 PM
does anyone know how I generate a Token to be used as a bearer token in a .net core app? If i need a basic understanding of what I am asking, I was wondering if someone could direct me to a link. Thank you.
Or is this something that will be done when adding an Authentication header? swagger.io/docs/specification/authentication/…
 
2:22 PM
@Hans1984 LOL
shutdown is actually a quite nice recommendation for shut up
but that join is just becoming a meme now
 
;[
 
@JoJo In .NET Core Microsoft Identity contains everything to create, sign, and validate JWTs
For your authenticate API, create+sign a new JWT. When doing something on an auth provided in HTTP header, validate the JWT.
 
@Hozuki thank you for this information. I guess I am supposed to put the bearer token string in the appsettings.json according to my architect. Isn't there some random generator on the net for this?
 
@JoJo The 'Bearer Token' is the JWT. It's what you receive from the API.
The private key (or 'secret') in your appsettings is what is used to sign and validate a JWT.
If it leaks, you're in trouble.
 
@Hozuki I see. "The shared key will live in the appsettings.*.json" means "secret" here, not the other appsettings Bearertoken value i am seeing that is what is confusing me.
"TokenSettings": {
// ENTROPY: between 427bits & 886bits blind & 208bits with full knowledge
"Secret": "put a new value in here"
},
got it
thank you
 
2:38 PM
"Bearer" is terminology from the HTTP specification. It's just the mechanism HTTP prescribes to pass in a value. You can quickly forget it.
What's in the 'bearer' is the JWT, the authentication token.
And yep, the secret is your private key
 
Okay will do a full dive on this today. I have an example project.
 
Good luck and enjoy ^^'
 
I am going to ask heresy, but bear with me.
 
Just need to figure out how to come up with a phrase to put in the secret.
thank you
 
How do I select an array range? E.g.: array with 10 values, select positions 3-9
The heresy part is... how do I do it in JS? hiss
 
2:42 PM
arr.Drop(3).Take(6)
or just do a sub array
or sub list
 
@HéctorÁlvarez items.slice(3, 9)
 
Actually I came across something called slice()
 
mr5
wow
the room has revived!
 
@Hozuki we are so in-sync.
 
mr5
have or has?
 
2:44 PM
had
 
@mr5 has
 
dang it
 
Wietlol, you troll.
 
mr5
boo!
I chose 'has' using my instincts ^^
 
I suppose "is" is also a fine option
 
mr5
2:45 PM
the room is revived?
 
with has, you imply that the room has the property of being revived
with is, you imply that a revive operation has been applied on the room
not sure which is more common
 
I think it's the other way around Wietlol.
 
i love Slice
 
The room is revived
The room has been revived
 
@HéctorÁlvarez now who is a troll?
 
2:48 PM
Has implies past tense. Is implies its present status.
 
mr5
the room is revived sounds awkward :/
 
posted on April 07, 2020 by Phil Haack

In a recent post about remote work, I noted the importance of writing things down.

 
@Wietlol Always you. Also you just trolled yourself because you have omitted the past participle, which is the correct form to be used in that sentence
@Feeds Shup up.
 
mr5
shop up*
 
the page I looked at doesnt have a past particle
these are my favorites
 
mr5
2:52 PM
wut
r dows grammatically korek?
 
The apple she had had had had no genetic alterations, solid sentence.
 
iDunno
but they are my favorites
 
let me fetch buffalo one
 
mr5
noo
 
"Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo" is a grammatically correct sentence in American English, often presented as an example of how homonyms and homophones can be used to create complicated linguistic constructs through lexical ambiguity. It has been discussed in literature in various forms since 1967, when it appeared in Dmitri Borgmann's Beyond Language: Adventures in Word and Thought. The sentence employs three distinct meanings of the word buffalo: as a proper noun to refer to a specific place named Buffalo, the city of Buffalo, New York, being the most notable...
 
2:53 PM
dont let me pull up dutch sentences
 
mr5
I only know buffalo as a noun
which is the buffed up cow
 
although I like that site... I am quite bothered by the fact that they do show all examples using "have revived" instead of "are revived"
while both are perfectly fine
 
If I am adding Middleware authentication, will I still want app.UserAuthorization() in Startup.cs?
            app.UseAuthorization();
            app.UseMiddleware<AuthorizationMiddleware>();
 
3:22 PM
@mr5 I was talking about the new Git branch yesterday. Can you explain what you were talking about?
After I do a checkout and fetch, it lets me do a pull, but then pull (in the VS ui) becomes unavailable again.
 
mr5
3:36 PM
you can only pull when there's still available commits not yet merged in the same branch.
 
cant pull if there's nothing to hold on to
 
 
1 hour later…
4:58 PM
If I do a pull request onto that remote branch, shouldn't I able to pull those changes onto the local branch that's tracking it?
 
00:00 - 17:0017:00 - 22:00

« first day (3461 days earlier)      last day (1481 days later) »