emoji-award-marseywholesome
emoji-award-marseynotes
emoji-award-marseyannoyed
emoji-award-marseytrollcrazy
emoji-award-marseyplushieswinging
emoji-award-marseyhotep
emoji-award-marseyhotep
emoji-award-gay
emoji-award-gay
emoji-award-marseytrain2
emoji-award-marseyhotep
Unable to load image
Reported by:
  • Sneed : (changelog) carpathianflorist is a b-word butt neighbor
  • THOMAS : mypoc <3
  • british : change: dont ban for spam (dramaphobic). Let bans be appealled (let me ping you pls). Bardfinn.
  • MOONTEP : Hotep wuz here and we wuz kangz
  • Roll : Imagine wrote something funny here. Now laugh. :marseyrofl:
  • ManBearFridge : Lmao

changelog megathread :marseynotes:

a lot of days, I make a shitton of changes in successsion, and I don't wanna make the whole frontpage my changelog posts, so I don't post about them

this thread solves that, so from now on instead of making changelog posts, I'll make changelog comments here

click subscribe on this thread to get notified of changes :wolfnoticeme:

on desktop:

https://i.rdrama.net/images/16559206177532556.webp

on mobile:

https://i.rdrama.net/images/16559206537045796.webp

Edit: I'm still not gonna post about bugfixes tho, theres way too many

183
Jump in the discussion.

No email address required.

this is the fricking actual code

Jump in the discussion.

No email address required.

:#marseyfacepalm:

Jump in the discussion.

No email address required.

how would u write it then

Jump in the discussion.

No email address required.

Share a bit more of the context?

Jump in the discussion.

No email address required.

	@property
	@lazy
	def user_name(self):
		if self.earlylife:
			expiry = int(self.earlylife - time.time())
			if expiry > 86400:
				name = self.username
				for i in range(int(expiry / 86400 + 1)):
					if i < 5:
						name = f'((({name})))'
					elif i < 10:
						name = f'(({name}))'
					else:
						name = f'({name})'
				return name
			return f'((({self.username})))'
		return self.username
Jump in the discussion.

No email address required.

Am I right in thinking that you're looping through for every instance of the award (shenanigans with time, expiry and earlylife)? If so just determine a single multiplier and do something like

name = f"{'('*mult}{name}{')'*mult}"

To save yourself rewriting the string hundreds of times whenever a tard with 400 awards appears.

Jump in the discussion.

No email address required.

i think this would probably save like 0.01ms lol

Jump in the discussion.

No email address required.

Depends how well cached the award system is and how many people spam the award. It's the sort of thing that works well with sensible numbers but might be vulnerable to dramatards.

I'll stop being pedantic now

Jump in the discussion.

No email address required.

ty for trying to help, i appreciate it :@prophet_pinnaclelove#::@prophet_pinnaclelove#::@prophet_pinnaclelove#:

Jump in the discussion.

No email address required.

code obfuscation contest award

Jump in the discussion.

No email address required.

This is why I hate writing code on a phone at midnight.

:#marseysleep:

Jump in the discussion.

No email address required.

i didn't test this

	@property
	@lazy
	def user_name(self):
		if self.earlylife:
			expiry_days = ceil((self.earlylife - time.time()) / 86400)
			if expiry_days < 5:
				earlylife_mult = 3 * expiry_days
			elif expiry_days < 10:
				earlylife_mult = 15 + (expiry_days - 5) * 2
			else:
				earlylife_mult = 25 + (expiry_days - 10)
			return ('(' * earlylife_mult) + self.username + (')' * earlylife_mult)
		return self.username

completely removes the O(n) nonsense and saves a shitload of string allocations/copies. if you wanted to parameterize it so you can easily change the multipliers you could do that as well but since it's hardcoded in the existing code I figure it might as well be hardcoded here.

I even used tabs for you even though I think using tabs in python code is evil incarnate.

Jump in the discussion.

No email address required.

ty king, even though i think this change is fricking pointless and makes the fricking code harder to read, i added it anyway since u took the fricking time to write it

Jump in the discussion.

No email address required.

i think this change is fricking pointless and makes the fricking code harder to read

:marseyhe#sright:

Jump in the discussion.

No email address required.

Even simpler:

@property
@lazy
def user_name(self):
    if self.earlylife:
        expiry_days = ceil((self.earlylife - time.time()) / 86400)
        earlylife_mult = min(5, expiry_days) + min(10, expiry_days) + expiry_days
        return ('(' * earlylife_mult) + self.username + (')' * earlylife_mult)
  return self.username
Jump in the discussion.

No email address required.

this is fucking pretty creative i rly like it

but where is '); DROP TABLE Users;--

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.