« first day (1382 days earlier)      last day (1857 days later) » 
01:00 - 17:0017:00 - 23:00

Sam
5:01 PM
@rene Is it implemented?
 
No, I'm still figuring out how to calc the value of the current rate
for a given number of messages
so I can compare that with the outcome of your function
 
user456814
@rene I see, thanks!
 
user456814
 
Sam
@rene Right, I see.
@ProgramFOX Any ideas?
 
@Sam About what?
 
user456814
5:15 PM
Woah, hold up, I just figured out that this is not a duplicate: stackoverflow.com/questions/18216991/… of the canonical that I picked anyways.
 
user456814
My bad.
 
user456814
Sorry.
 
Sam
@ProgramFOX Calculating the current message rate.
To compare it against the rate limit function.
 
Hmm...
 
@Cupcake yes
 
5:17 PM
message_count / time_in_seconds perhaps?
 
user456814
@rene thank you.
 
Sam
Maybe, but how many messages? All of them?
 
No idea, actually.
 
This gist is the start point : gist.github.com/rschrieken/5b7306450eb9ea74eaaa
The array holds seconds
 
Why not keeping it simple and make sure that there will always be at least 2 seconds between two messages?
 
5:19 PM
Will that still hold for 100 messages?
 
Sam
I did suggest using a linear function before...
 
Yes... that ^^^^
 
Not sure, but anyway, if someone wants to run a lot of commands within a short time range, he will also be rate limited.
Then, if you also wait two or three seconds before responding, I don't think your messages will be rate limited.
 
But I will also be rate limited :)
Which can be good though
 
Sam
Why not double it then? (Go with 4 secs.)
 
5:21 PM
Chance you start hammering it...
 
We cannot really hammer it, because if we would try, we would get rate limited...
 
No worries... I'll have a brainwave somewhere tonight...
Technically you can if everybody tries another command...
 
Sam
@rene You could try calculating the current rate over all messages.
 
That is what the gist tries to accomplish
 
Sam
Oh, I didn't actually look. And what happens?
 
5:25 PM
I suggest this: if you haven't posted a message for 20 seconds, 'reset' the count of messages.
 
Sam
Sounds like a good idea.
 
I think I interpret the rate limiting chart differently than you do...
 
Sam
How are you interpreting it then?
 
I read the outcome of 20 seconds for the 100 messages as: If you send 100 messages they shouldn't have been sent at a rate higher than 20 seconds
It is afterall rate limiting...
 
So, you mean that they shouldn't have been sent faster than 1 message per 20 seconds?
 
5:30 PM
if you send 100 messages, yes
 
Yes, I interpret it like that, but I think the message count should reset after some time.
 
Sam
I thought it was saying: 1 second should be between 2 messages, 10 seconds between 10 messages, and 20 seconds between 100 messages...
 
@ProgramFOX I'm holdig 100 message timestamps in the array
 
         if (ce.user_id === thisuser) {
                            if (ownmsg.length > 100) {
                                ownmsg.shift();
                            }
                            ownmsg.push(Date.now());
                        }
anyway...dinner first...brb
 
5:35 PM
See you!
 
Sam
Alright, see you later.
I'm just going to see if a linear function would work. Theoretically, if I post one message every 2 secs I shouldn't reach 10 messages.
1
2
3
4
5
 
@Sam In the chat.SE sandbox, I got rate limited at my 5th message if I waited 2 seconds every time before posting.
 
Sam
I only got to #4 before the limit kicked in.
 
Do you mean that you couldn't immediately post your 4th or 5th message?
 
Sam
Yes.
I had to wait 1 second for #4, and 2 seconds for #5.
 
5:42 PM
Ah, I had to wait one second for #5.
Manually counting seconds is probably not the most accurate way :P
 
Sam
That's why I used my watch...
 
Ah, that'll be more accurate then.
 
6:00 PM
Gtg now, see you!
 
Sam
@rene I think I've got it. If message 1 and message 2 are 1 second apart, fine; if message 10 and message 11 are 10 seconds apart, fine; but, if message 11 is submitted less than 10 seconds from message 10, then your throttled (I assume you'll have to wait how many seconds are left in order to resubmit). Then if you wait more than the minimum period, the message count resets.
Oh and, evening everyone!
 
 
1 hour later…
Sam
7:22 PM
Anyone know why Resharper is saying I'm going to get an overflow when doing (decimal)(float.MaxValue)?
Oh wait, according to MSDN float has a larger range than decimal, never mind.
 
@Sam Let me think about that...
 
Sam
@rene Ok, while I let you think that through I'm doing to have dinner ;)
Brb...
 
user456814
 
@Sam check this
@Cupcake done...
 
user456814
@rene thank you.
 
@Sam If my implementation is OK-ish I make it such that if for any of the 100 messages the ratelimit is reached I wait for.....how long? Just 2 seconds? Or for ther value you're limited for?
anyway, I need some sleep, so I'm out...
 
Sam
@Cupcake Flagged it.
@rene I'll check it out.
 
 
2 hours later…
Sam
10:12 PM
@rene I've almost finished rewriting the whole function. I'm going to bed though, so I'll ping you tomorrow when I've completed it.
 
@ProgramFOX that works, just hadd to change one thing, ArraySegment<byte> resp = new ArraySegment<byte>(); to ArraySegment<byte> resp = new ArraySegment<byte>(new byte[1024]);
that's more low-level than I was hoping for though
but thanks
 
01:00 - 17:0017:00 - 23:00

« first day (1382 days earlier)      last day (1857 days later) »