#ot1-perplexing-regexing
1 messages · Page 55 of 1
import asyncio
async def count():
print("One")
await asyncio.sleep(1)
print("Two")
async def main():
await asyncio.gather(count(), count(), count())
if __name__ == "__main__":
import time
s = time.perf_counter()
asyncio.run(main())
elapsed = time.perf_counter() - s
print(f"{__name__} executed in {elapsed:0.2f} seconds.")
try running this on your own PC and you wil\l get it :)
stolen from realpython ofc
Thank you, I'll try it out this evening
isn't everything depending on the dose
the deepest innermost workings of asyncio scare me, but the basic idea of "awaiting something lets your event loop go off and run something else while waiting" is probably the shortest summary of it
Shortest depending on how many terms you want to define
You could go into coroutines but not as concisely
i think the clocks went back an hour @glossy niche
Can you imagine a battle rap being shared and it gets removed because it’s too offensive?
Eh, where have you seen that?
Then are you just saying stuff hoping to elicit responses?
No. I’m asking a binary question.
It is a chemical irritant and neurotoxin for mammals, including humans, and produces a sensation of burning in any tissue with which it comes into contact.
Who makes up these off topic channel names?
everyone
I want to make one up please
Humour is subjective
true
i should clarify
make sure it's funny enough to the mods to get added to the rotation*
we rotate off topic names every day
!otn
hm
!otn-names

i recall there being a command
everyone laugh at this user for failing to use the bot properly
they're added by staff, if somethings funny, we'll add one
perms issue >.>
I don’t endorse gambling

If you are a gambler, I think you should stop.
I suppose sports betting falls under that category.
gamblers are only one more try before winning big on average
People have lost their lives over gambling
Or they could lose
That’s why I think it’s bad
after they lose, they're due for a win. bet double the next time
Crazy how some governments fund these casinos in their nations
Really goes to show you have high impulses
If you are a compulsive gambler
Impulsivity is not good
By "average" do you mean the arithmetic mean?
They just messed up an old joke
"fun fact, most gamblers quit right before their big win" paraphrase
this fun fact inspires me to gamble my life savings 😃
Monte Carlo

Rolled black 17 times in a row, keep betting double
Like when guy who invented chess wanted to be paid grains of rice doubled per square on the chess board 
When you've already lost 10 times in a row your chance to lose this time is still the same as the first time 
So I'm playin with a loaded deck
Writing an algorithm with techno music on in a cyberpunk blue room
my phone's charging port is broken so i'm going to get a new one do you all think that this one for morotola edge 20 pro would work https://nl.aliexpress.com/item/1005005795964038.html
Remind me to never join the colleges esports club it’s filled with toxic musty people that’ve never touched a blade of grass in their life and only have ever had a social life in Valorant
People literally got mad over tier lists and muted me when I suggested ideas and activities for the club
Jesus
expected value 😩
!off-topic-names
There are three off-topic channels:
• #ot0-psvm’s-eternal-disapproval
• #ot1-perplexing-regexing
• #ot2-never-nester’s-nightmare
The channel names change every night at midnight UTC and are often fun meta references to jokes or conversations that happened on the server.
See our off-topic etiquette page for more guidance on how the channels should be used.
I wonder who programmed it to rotate every midnight
you can easily check
Bagel sandwiches are actually really good. Can taste better than bread sandwiches if you’re eating tasteful bagel like four cheese
My bagel sandwich
Four cheese bagel
Two slices of bacon
Fried Potato crumbs
Lettuce
Tomato
Fried Egg
Sprinkle salt and pepper
Maple Syrup
That's what we're doing
We're just using our own paste bin
Nah, we have our own, that means, we are hosting it with money
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
Well lol, why not the normal pastebin? Why we have to create our own?
more control presumably
I was checking if it redirected or something
Better than being at the whim of someone else
Lol there is literally no problem using thiers lol
Custom pastries
we do upstream most, if not all, of our changes to pinnwand (the software that powers our pastebin)
Yeah, having our own hosted instance gives us a lot more flexibility
if the official instance goes down, we'd be affected too
so we host our own instance
Having our logo on the pastebin
User analytics 
plus, || there's plenty available compute on the cluster ||
the cluster must grow
Well lol, thanks for answering, I'm currently doing a presentation for the code jam
adorable
@distant hazel have you considered a job in photography?
nah, this is just iphone's portrait mode working well
This requires a lot of documentation reading
So many modules and decorators that I don’t understand
what a cutie
Or.... you could.... just click on the button in my screenshot to see the full list of contributors
That answers your question
But if you want to understand the actual code, yeah, Discord.py is a bit much
#discord-bots could help explain pieces of it
our semi-daily routine is sitting in the driveway and watching the birds, squirrels, people, dogs and cars

I wish I had time to do that
And like, there were actually squirrels and cars around
she's shifted my schedule to be a morning person lol
i live in such a quiet neighborhood it's quite nice
If I try to sit down with my dog, she quite literally starts crying because she's so upset we're not walking anymore
aw, i can't wait to walk more with penny. she gets too excited and either zooms forward or in circles, or doesn't want to move from a spot she's sniffing
Well that was dumb

aboose
use an embeddable format smh
It's what it gives me
put it through the churner
Test
Running human in their natural habitat
can barely see dog, 4/10
🏃♂️
I hate doing this
If I stay behind she pulls as hard as she can to be with everyone else
But if I get in front she trips over herself trying to look back
Yes walking a dog is hard I never figured it out
AHA!
Here is my crybaby!
dog too slow to qualify for zoomies NA/10
aww why she cryin
More crybaby
Because we're not moving
is that a kid jogging with perfect stride with adults lol
Yeah
We're uh... Not athletic
idk he seems pretty athletic, how old is he?
…
He'll be 4 in December, that was a few months ago
kid vs dog
who will win
dogs and sticks
Me
kid with steel vs dog with steel
who will win?
it's really difficult to capture crazy moments bc there's no time for phone
so the photos and videos i post online are definitely one-sided
the solution is to use a gopro
Still me
gopro like $300
did I stutter
Even more for the bigger ones
oh hey
is this new?
@jaunty wraith where's your dog?
no
never had one
no
1.5 years is ages ago
How can you live like that??
Don't you want to know what it's like to be happy???
I live with my family and they don't want pets
Do you?
apparently mom's family had a dog when she was a child, which is why she doesn't want us to have pets
I mean everyone has pets die if that's what happened
ikr
Oh hey, I know that guy
source?
apparently my mom's family has had parrots for a couple generations
I'm totally getting a parrot when I'm older
theyre loud af, they smell
I see
and demand a lot of attention
and yea they'll outlive you lmao
but they're so cute
and also theyre very social, you need a pair or more
my grandmother has like six lol
get a pigeon or something
a couple of parrots and a few smaller lovebirds
they cute
but they don't talk
cats are very based
you dont want talking parrots
doubles as a pillow
peak pet
they wont shut up
cat
dogs fking suck i hate them so much
unbased and cringe opinion
i hate things that are loud
my grandmother's old parrot, which has since died, had like, a nicotine addiction
not to mention, they scare the cats >:(
dogs aren't bad, cats are just better
bro was addicted to nic
sounds like an anecdotal bad experience
it is 
my grandfather used to eat this thing called paan with tobacco in it, and he'd feed it to the parrot
but i guess thats what opinions are about
and the parrot started asking for it like, daily
i have an uncle that had 2 grey macaws and one cool original flavour
whenever you visited you left with a headache
mfs were so loud
flavour?
my brother got his parrot a wife and he proceeded to fking beat her :((((
bunnies get pretty smelly too, yeah?
eh?
the blue one idk what its called
we literally had to separate them
.wiki blue parrot
Blue parrot
Blue parrot or Blue Parrot may refer to: Bird: Blue-backed parrot, a parrot endemic to the Philippines, Sulawesi and nearby islands in Indonesia Blue-bellied
Dead Parrot sketch
Monty Python's Flying Circus about a non-existent species of parrot, called a "Norwegian Blue". A satire on poor customer service, it was written by John
lmaooooo
birds apparently get aggressive?????????????????????????????????????? 
Wait, macaw has an original flavour? How do you know thier taste 🤨
my grandmother got a couple of bunnies, but had to give them away since they got smelly
https://en.wikipedia.org/wiki/Hyacinth_macaw
i think it was one of these guys
ifu want a bird, parakeets r nice and cute, and not loud
yeah bunnies have a stink problem 😭
they pee everyWHERE
aboocat
bruh
there are hypoallergenic cats
hmm
i remember one time my a hole neighbours kid decided to break into my backyard to try and steal my bunny
i saw him and told him, and proceeded to take my bunny away, then the bunny FKING PEED ON ME
apparently siamese cats are hypoallergenic
one of my dad's friends had a persian cat
the bingus species is actually based, you dont have to clean their fur
it was fluffy, but didn't do much of anything
i also heard from friends taht they r actualyl really soft
sure
apparently hypoallergenic cats aren't completely hypoallergenic 😔
perhaps there's medication I can use
❌
Get a ancient common predecessor of cats and dogs 👍
get a lizard
bingus
Crocodile?
they need a tank and a light
but thats about it
unless youre too grossed out to feed them insects
Arent reptiles high maintainance
like snakes?
get a plant
I assumed the opposite
geckos are pretty entry level
Yea
hmm
Excuse you
they seem fairly low maintenance, at least
great idea
Cold area, hot area, humidity yada2 idk some of them are more high maintainance than me
I see
we can use them as a mascot
I had a pet dragonfly lol
How do you keep it from flying away
Well you need to train them ofc
i want a bunny
How tf do you train a dragonfly
Do they even live long enough to survive the training period
Lol if you train them with food, they will hang around
Based
And you would need a insect box, a bigger one
Ooh u had a box
ask chris
Chris has very cute bunnies
my friend bought 2 bunnies and ended up with 24 shortly after
They'll find a way
My grandfather had lots of bunnies lol
he kept them on the roof of his house (roofs here are flat and have fences around them so you dont fall off)
and then an eagle ate them
my grandmother bought two bunnies, but they were babies
😃
and then gave them away cuz of the smell
Typical bunny problem
bunnies are farm animals, you dont want them in an apartment
bunny zeus 💀
beus
My grandfather had like a large free area, so he grew goose, bunnies, pigeons and many more
neat
dogs aslo require a lot of space, if you get a dog, you will need to walk them often, this is harder if you dont have a backyard or sth
or just zeus
have you learned anything about greek mythology?
because a lot of stories start with zeus
sometimes, he doesn't
Either way animals are involved
Hell naw, what he have done
Sometimes
Most normal day in Zeus's routine
The one true pick up artist
…
Is that how centaurs came to be
More like *** offender

theres honestly a lot of overlap between the 2
The centaurs were usually said to have been born of Ixion and Nephele.[6] As the story goes, Nephele was a cloud made into the likeness of Hera in a plot to trick Ixion into revealing his lust for Hera to Zeus. Ixion seduced Nephele and from that relationship centaurs were created.
What in the fuck
wild
Cannon story 👍
💀
Guy does cloud and out come horse man hybrids
did greeks belibe this stuff or did we dig up someones fan fic and just assume it was a belief
The guy who came up with this story is the best pickup artist
Big if tru
It's cannon lol
new head cannon
explosion noises
I prefer the latter
Try not to get banned challenge 👍
Id rather it be made up shiz by some drunkard high on whatever was trending at that time
Are horses #### content huh
greek lore thickens
Bet a lot of things were fair game at the time
😨
Try not to seduce challenge 🔥
Nvm i can't believe those people who say that older times were great
sanpchat
never used slapscat before 
this reminds me of that population map xkcd
Yeah lol this is real
what on earth is wechat
.xkcd 1138
chinese everything app that does payments, instant messaging, etc
yeah i guess that makes sense 
🗿
the chart is basically inversely proportional to the growth of internet users worldwide
it doesn't tell you anything about the quality of any of those platforms
(they're all garbage)
new daycare place and she's having fun
caught while zooming
yup
omg the ears on the left picture
Straight jumping off the table
dogs don't like me, they bark at me every time they see me
some of them are even scared
idk why
what's an example of a function, let's say on [0, ∞], that's roughly exponential at the start but approaches linearity afterwards?
hmm, I think ln((1+exp(x))/2) would do
wait, no, that's not really... hmm.
Maybe your energy?
e^x when x<10, x otherwise
forgot to mention, should be monotonic and continous
I basically want a hybrid of np.geomspace (at the start) and np.linspace (at most of the interval)
Linkedin is kinda nice, it's like social media but you just see cool stuff companies are up to 👀
companies are never up to anything cool
you could interpolate between an exponential and a linear function
x e^(x/(x+a) - 1) is a fun function
how simple do you want it? e^-x -x is already pretty good
.wa s plot 20e^(-x/2) - x from x = 0 to x = 20
Failed to get response.
Not for its users
It's uncool, and highlights the problems of non-FOSS software
Anything that happens is at a whim of companies
If I get to speak about Elysia at JSConf Asia, I’ll literally cosplay Elysia to speak.
this is why elysia is the best framework
BETH stack ftw
bun getting so much love while it doesn't even work well on Windows 😔
good
btw ive heard ppl running it via WSL successfully so i guess you can use that? 
im a filthy windows user as well so ia ctually havent tried it yet lol
What? no windows support??
it also uses zig, which hasnt reached version 1.0
funnily enough, bun has VC money in it

but the dev team seem like sensible ppl so i hope they dont chase the bag too hard
Bun provides a limited, experimental native build for Windows. At the moment, only the Bun runtime is supported.
bun <file>
bun run <file>The test runner, package manager, and bundler are still under development. The following commands have been disabled.
bun test
bun install/add/remove
bun link/unlink
bun build
nah i don't think bun will replace anything fr
What is bun
It's impossible to Google that name
Oh man
The shipping estimate says it'll get here on the start of my work week
Yikes
It's like nodejs, but better 🤔
Oh it's javashit crap?
node JS compaitible, but with some tools built in for convinience
Ah, shipping... It's like printers, smells that you're in a hurry
the big thing about it is that its node API compaitible for the most part, but a lot faster
They have thier own religion lol
so for some, its a drop in replacement for faster performance
It's blazing fast than other existing ones lol
Shipping a high demand low volume item from china
blazingly faster!!!!!!!111!!!
Shipping alone was $57 US
🚀
Anyone to willing use JavaScript for backend is no friend of mine

(not me lol)
JS for backend is pretty nice if its next JS or a similar framework
simplifies work a lot
Omg 😮
but if its just a rest API, its probably not as good as its competitors
I forgot the youtuber's name, he explained how bun is better than others lol
lots of ytubers did just that but JS ytbers have goldfish memory
a lot of them have techbro syndrome
Real lol
like 80% of their content is nice and then they go off and start dropping weird takes that you usually only see in second year CS classes
Yeah.. kinda sucked but what's 60 extra on a 280 dollar order tbh
It's all credit card debt
🤣
I buy from the US mainly when there are any promos, two times the promo code basically only offset the shipping costs... And then customs and vat on entry...
Well niche hobby items are rarely US based I've found
;
are you trying to get voice verified?
if so, please don't spam - if you spam to meet the requirements, you'll be voice muted.
contribute meaningfully, you'll get there.
ok i will contribute meaningfully
hello sir, are you a moderator?
it appears as if so
.8ball am I a moderator
Signs point to yes
you heard em
.8ball is aboo a good moderator?
You may rely on it
it has spoken
That's not how that should be read
That's "you may rely on the fact he is a good moderator"
snuday?
not quite
.8ball is shananigans a doggo?
Yes
.8ball is shenanigans a good doggo?
Signs point to yes
.8ball is shananigans a catto?
Concentrate and ask again
.8ball is shananigans a fuckin cat?
It is decidedly so
ok then
sheesh
@vale raven it is confirmed you are a cat dog
It's also confirmed that you eat octopus
Spitting out random heckery is ezpz
Also your mother was a hamster. And your father smelt of elderberry
lol
Octopus is actually good
there’s something wrong with you
It’s too chewy!!
Depends on how you do it, I guess. 🤷 I generally don't eat seafood (not my taste), but my partner cooks and sometimes uses mixed seafood and there's octopus there
If octopus is chewy you overcooked it
Same with calamari
My grandma used to make this wine braised octopus dish, its so good
I’m reminiscing about the golden days of me playing San Andreas Roleplay. They had an official Ventrilo server and my gang had our own gang channel in it. I kicked a General Admin out of our channel because I didnt want him in it. His ego got hurt so he temporarily banned me.
Youre roleplaying as a gang member and you "disrespected" one of the seniors
Sounds on-brand
I never claimed this was me lol
I’m reminiscing about the golden days of me playing San Andreas Roleplay. They had an official Ventrilo server and my gang had our own gang channel in it. I kicked a General Admin out of our channel because I didnt want him in it. His ego got hurt so he temporarily banned me.
That sounds like its you
Ohhh I thought you were talking about the video. Reply next time lol
But what if I do eat octopi??!
You must have a big jaw from all that chewing
I love octopus balls
Cancel Culture is basically collective sadism; a collection of people virtually getting together to find dirt on somebody of what they did in the past. It’s disgusting.
They are really obsessed with harming people’s reputation.
I kicked a General Admin out of our channel because I didnt want him in it.
that's literally cancel culture
"general admin"
"general + admin"? Like the S1 got a promotion?
Or "generic admin"?
What would a "specialized admin" look like?
In the official roleplaying ventrilo server, the following ranks of administrators are: junior , general , senior , head and executive.
Can I be an executive?
you think cancel culture is disgusting yet you're also a part of it, can't have it both ways
I’m talking about something that happened in the past tense. That server is no more.
Where'd it go?
Kicking someone out of my channel because I don’t want them there is cancel culture?
Apparently, the roleplaying server got revived this year I think
"Why did it get canceled?"*
in which someone is thrust out of social or professional circles – whether it be online, on social media, or in person.
sure fits the bill to me
Cancel Culture is a manifestation of collective sadism. They simply attempt to cancel people out of pleasure and think they hold a higher moral ground than the people who are trying to cancel people. I kicked the admin out of the channel because I didn’t like him.
sounds like you're adapting the meaning of what cancel culture means to something that you want it to mean to fit your purposes
I’m not publicly defaming the admin’s character in anyway by kicking him out of the channel.
Okay, I'm sorry, but I'm going to have to cancel you
Using BING is COMPLETELY UNACCEPTABLE
you don't need to defame someone in order to cancel them
But that’s also a symptom of cancel culture
no, that's a sympton of trash human beings if they're in reality defaming,
but you dont need to defame people in order to cancel them
in fact most "cancel" culture i've seen has been without defaming
the few times i've seen someone defame in order to cancel, it turned out to be a lie (which is defamation) or simply someone who didn't have all the facts
You bring up a fair argument that the admin I kicked is ostracism which is what Cancel Culture creates. But my motives of kicking him out my channel were completely different.
it sounds like "cancel culture" was just a "sympton" of you disliking that person
your words.
By that logic. Anybody who dislikes somebody creates cancel culture.
no, you took actions to ostracize them from your surroundings, you kicked them out of your server, that was the cancel culture in your actions
First of all, A user can’t kick an admin out of a server lol. I kicked him out of my channel.
okay, that doesn't change much
No clue

that's like, not much better than calling them dumb
or they are all substantially more intelligent than everyone else
which in turn is calling everyone else dumb
I mean, not really
We will sound dumb anyway at some point so better do it now
how many tries does it take maximum to solve a random number generator of numbers between 1 and 1000 using the cut in half kinda thing
because it seems like it only takes a maximum of 10 tries
It should be ceil(log2(1000)) = 10
i think that depends slightly on your implementation of binary search?
because when you compare you partition it into 3 sections not 2 since you can exclude the element you're comparing against from subsequent searches
I think that the ceil handles that
if you have an odd sized array, you end up with a half when dividing the size by 2
oh wait, that would néed a floor not a ceil 
not really, that interpretation usually comes from thinking in inclusive-inclusive intervals
if you're looking for the transition from true to false in the predicate you have an interval [l, r) where pred(l) = true and pred(r) = false, if you look at the midpoint pred(mid) you'll find that the new interval is either [l, mid) or [mid, r)
yeah but that's implementing it as
if num < arr[middle]:
r = middle - 1
else:
l = middle
isn't it?
why no -1?
l is the largest known value with the predicate being true, r is the smallest known value with the predicate being false
so if pred(middle) = true it's the new largest known true, if false the new smallest knowm false
the beauty of phrasing in terms of inclusive-exclusice

and you would continue searching while r - l > 1
and when you finish you have an l and r that straddle the transition true→false
i also have to pithink this one
🤔
def bs(l, r, pred):
"""
Precondition:
pred(l) == True
pred(r) == False
"""
while r - l > 1:
mid = (l + r)//2
if pred(mid):
l = mid
else:
r = mid
return l, r
Whats this binary search lol?
this is ignoring trichotomy though
What's trichotomy?
Hmm, what does it actually do?
... search in a sorted array 😛
Well lol "in" operator is looking tasty rn
since the array is sorted, you know that if you compare an element in the array and it doesn't satisfy a condition, all the elements before or after it also don't satisfy the condition
If we are talking about algorithms then 🤔
in is O(n) on a list
If you want a fast way to find a element in sorted array 🤔 maybe use a datastructure
Binary tree? 🤔
a sorted array is a data structure 🥴
why build a binary tree?
wasted effort if you have a sorted list
binary search is equivalent to building a binary tree anyway
other than having to build the tree
Yeah both are O(logn)
you build it as you split into left and right. that's the same as deciding the branches and also automatically going down a branch
it's equivalent
it's a binary search tree so it's basically a treeless binary search tree yeah
Maybe a hashmap?
this ignores that the list is already sorted
what is the problem here?
it's equivalent sure, it's an implicit data structure
the original point was stickie saying that, due to trichotomy, in special cases, binary search can be a little faster than ceil(log2(N))
trichotomy would usually require more than one check, no?
it would
so you lose a factor of two
Then what's stopping us from "n" partitions?
what do you mean?
unless you have more rich comparisons, e.g. returning -1, 0, 1
I remember implementating bs for an interactive problem at an acm icpc style.contest and it it took precisely ceil(log2(n)) to find an element as a worst case 
Trichotomy is 3 partions, if we have a log(length) partitions 🤔
like the judge would fail my submission if I did one query too many
trichotomy of natural/real numbers. two natural numbers satisfy exactly one of a<b, a>b, or a=b
I just came up with random
the argument being that you can discard one extra element at some comparisons in the binary search
Python has a bisect module that implements bs in most useful shapes
saving one iteration doesn't help much if every iteration is double as expensive 🥴
the transistors in my computer have 3 states
Huh, shouldn't it be 2?
bisect requires you to work on some sequence iirc
i spice my serious discussions with a healthy amount of shitposting
well cereal's question was "how many tries"
Lol
not "how many comparisons"
Ye, but you can magic it into existence with some class and a custom getitem
binary search is much more general than that
define what a try is and we can say better
But ye, there are cases where you need even different binary search
Than what bisect can do
what info do you get out?
define define
Try and comparison is same in this case, as they tell about the number of loops we are doing
the result of the comparison matters
A loop will contain 2 comparisons, and one try
I'm assuming he was asking "a random number from 1 to 1000 is generated, and you can guess the number and either get it correct, or be told if the number is less than or greater than your guess, how many tries is needed at maximum"
that gives you richer info than just a true/false yeah, in which case you can so slightly fewer queries
Well, 🤔 maximum means decrementing or incrementing one until you reach the target
And the first choice would be either ends
no like how many tries do you need in the worst case scenario if you're playing optimally
if you allow me do two arbitrary comparisons in one loop iteration I can do even better, that's why I'm saying that specifying the queries you can make matters
If the 1-1000 is imagined as a sorted array, binary search should give the same number of tries however we do it🤔
again, depends on what the query you can make is
Maybe we should actually test it out lol
if you get <, == or > as a result of one query you can do slightly more
if you only get < or >= you can't
🤔
and you have the pretty generic binary seach code I shared
I actually feel like, if the sorted array is 1-1000, we can find the target number in 2 tries
First try gives the distance between the target and our assumption
Second try, we increment or decrement the assumption by the distance
again...the query you can make matters
you can't if you don't know how the numbers were generated
the only way to compute the distance in this case would be to test all elements of the list
Yeah, but like I said, if it's 1-1000 integers
yes, but which integers?
1,2,3,4,....1000
then the problem is trivial, you already know the list
there is no need to compare anything, you already know the indices
you need 0 checks
Yeah lol
we don't care about the trivial case
But random numbers 🤔
"arbitrary" is a better word than "random" here
Yeah you are right
Or can we use properties of the target number?
Like 🤔 0 has some properties
Still it's bad ig
Idk why, but if we can make like a complete graph of nodes of the elements, we can find the number in two tries maybe ¯_(ツ)_/¯
Like a mesh network
Each node is connected by all other nodes, so we can find any number of it exists
it's great to see you have interest in these problems and a creative mind. i would encourage you to try out a book on data structures and algorithms
you can always try to stuff things into some data structure, but building such a data structure isn't free
Thanks
Yes, but each node we add will only take O(1)
putting your elements in a set would allow super cheap membership checks, but costs you O(n) up front
there are at least N nodes though, so it's actually O(N)
Hmm, how much time will it take to create our array?
in the current problem, you already receive a sorted list. there is no cost to that
if you want to change it into anything else, you incur a cost
We would need to find a way of accessing the elements, like we were able to make binary search without making the actual tree
Would it be actually possible 🤔
as i said earlier, the two things are equivalent
binary search is equivalent to building traversing a binary tree
they have the same cost
building a tree will make it slower necessary
you can actually do the two things at the same time tbh
Here, in binary search, we are able to traverse a non existent tree
at best it'll be the same complexity, at worst it'll be slower
My take is, is it possible to traverse a non existent complete graph?
that sounds like the travelling salesman problem
sure you could, would it help?
Each element in a complete graph knows all of its neighbours
What is that?
a very difficult problem there is no good solution for
just checking all neighbors would be expensive
you have O(n) neighbors
Maybe I'm mixing hashmap and graph theory lol
Using hashmap to access the Neighbors
In a graph
that would require constructing a hashmap
Yeah, I'm just trying to find if we can do it, without constructing anything
Like in binary search
the binary search works because of a property of the array, that it is sorted
Maybe because binary tree has a logic of "left elements < middle element< right element"
that's kinda the only useful property we really have
Binary search with linear probing 🤔 nvm lol I'm thinking of imaginary stuff
Ig, we only get 3 types of comparison in our number system
,<,==
What if we used principle of radix sort?
Like if the target is 34
We can skip numbers with 2,4 in tens place
that's effectively doing several binary searches
first you binary search to get the range of numbers with the correct leading digit, then binary search the second digit
sorting isnt actually necessaary, it just has to be partitioned around that element 
you can also use it on a non sorted array to find a "hill"
or an element larger than its 2 neighbours
its kind of trippy but it works
What do you guys think the maximum percentage of income people should spend on their hobbies?
100%
I mean that depends on your situation really, I'm a student who doesn't have many responsibilities, all I really spend money on is car things, food, random stuff I want to buy, and hobby stuff
At the moment hobby stuff probably makes up around 50% of my weekly spending 👀 (which is only about maybe 20-30% of my weekly income, I tend to just shove >=25% in savings)
Bouldering do be expensive
i think it depends on both your situation and the situation of the people around you 
Well, in ideal world everyone would be able to live comfortably, so the money earled would be spent on doing what you want. So max would really be 100%.
It's sad that all this automation etc in the world is used to pad the pockets of wealthy, instead of making the world easier for everyone :c
this realisation is actually what initially got me into politics
i was looking at things like chatGPT with fear of technological unemployment
and then it dawned on me:
"I fucking hate javascript just take my job already"
Frontend web dev moment
get a cooler job fr
recently ive been going backend so thats nice
FP shilling o'clock
https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/ really like this blog post or essay or whatever
tl;dr: instead of putting guards everywhere for validation, parse your data into a datastructure that cannot possibly represent an invalid state, this means that you can be 100% sure at any given moment that a certain object is valid, its kind of like pydantic but a little more general
I think my phone's settings "app" got fucked up. Battery settings show this.
Will a GET request response be 400 if there’s literally no data to grab on the server?
wouldnt that be a 404 instead? 
400 indicates that your response is not correctly formed
so either a 404 or a 5xx if the server is supposed to have content but doesnt for some reason
i imagine a 503 would be correct here if its supposed to have data but doesnt atm
No there’s no data at all in the sandbox
But I was still sending GET requests
To see if my keys would work
400 Bad Request
The server cannot or will not process the request due to an apparent client error
which does not seem like your case at all
eben something weird like 501 might be apt for this weird scenario
Damn I should have tried a POST request instead after all this time since the sandbox is empty
Maybe not.
if the request doesn't make sense, at least return some error
if it makes complete sense that the request is empty, then maybe it's fine
Shopping for food and saw this:
"wild caught" "this product comes from a fishery"
Endpoint doesn't exist: 404
Endpoint exists but data is empty: 204.
Endpoint exists but data is "empty" (e.g. empty list, empty dictionary, dictionary with "data" key that is null/empty list): 200
are you still guessing at what requests to do?
By no endpoint it can mean like /something/123 where the endpoint is /something/<id> but 123 doesn't exist
404 for that is kinda weird though
Why? That particular resource doesn't exist then
404 is specifically for resource (e.g. page) not found. But wrong endpoint, server going "idk what you mean with this url" is generalisation
meh. i guess
I’m trying to guess what the possible outcomes for why the response is 400.
All I literally did was change keys. Everything else is the same.
maybe your request is actually malformed, who knows
or whatever you're querying are returning bad status codes
We'll never know
there is literally no way to guess the correct answer
||if only we had all the info||
That’s what I did. They didn’t get back to me yesterday. I’m quite annoyed.
better yet, send them your request body, headers and params and tell them to send you a .json back
Biggest technical mystery
Email based transfer protocol
you know, you could share the request sent, the one that works and the one that doesn't
None of them ever worked
that way we could actually start to reason about whether 400 seems reasonable or if it's bad behavior on the server
One is a 400 and the other is a 401
My old keys worked before the sandbox reset. During the sandbox reset, I was getting a 401 response code with the old keys.
which makes sense if the key is no longer valid
I’m off work on weekends so I won’t be able to show you until Monday
Smh not dedicated enough to the grind
I don’t get paid on a salary
yet you're looking into this on a weekend
Make sure to tell your boss you were working on it on the weekends
Preferably during lunch
🫢
Maybe if you see them doing a hallway
Right after you greet them
You know how it goes
A senior developer once told me a 9 to 5 in software development isn’t actually a 9 to 5. There will be times where I would need to spend my free time researching new technologies, modules, softwares and etc is what they claimed.
do that during work
make a motivational post on linkedin telling everyone how dedicated you are to seeing your company achieve great things and how invested you are in giving it your all lest your contributions are not enough to elevate your organisation to the place it so deserves
Its most likely in your contract
fk i have linkedin disease from writing all thsoe cover lettesr
So you’re telling me software development is simply a clock in and clock out kind of job? Don’t Doctors of medicine also spend their free time researching illnesses and diseases? That was also the comparison the senior developer made.
theres some truth to what you say, but id rather i get paid for the shit i do 
if you want it to be, sure
and no, doctors don't do that
your office doesn't have good tech? rip
bad screen: displays JS
good screen: displays JS
Doctors having free time? Lmao
they do need to undergo training and that is on their free time
Students or residents
I dont think it counts
Its like thinking of your degree as a 9-5
I was seriously under the impression that people spend free time researching material for any career their in as oppose to a job
this is true for job seekers, new hires, etc 
but in general:
boss makes a dollar
I make a dime
thats why i shit
on company time
Based
it's a choice people make. you can, or you could choose not to
And toiletpilled
its not like the SaaS suite im working on is going to revolutionalise software
i could not care any less for my job
im only there because i get paid to scold ppl on bitbucket
i think the bad/good screen meme references that the thing you enjoy workking on and the thing you get paid to work on are different, but you're always on a computer either way
true for me because i WFH
cant wait to close the BAD vscode workspace so that i can open the GOOD vscode workspace
for wfh you need a good work life balance fr
yeah :/
WFH is hard when you r pea brain and have an attention span of 2 picoseconds
i do
Real
so I messaged this discord scammer that was soliciting get rich on crypto bs and played stupid hoping I would get a domain out of him, but he instead wants me to join his trading telegram. idk enough about telegram to feel comfortable following him into there.
then dont
ye
telegram is full of unhinged shit, dont go there if you dont know what you are stepping into
yeah I know that much.
I was hoping to get a domain that I could report but yeah its not worth it.
It would be one thing if I knew the platform very well
probably best to just block and move on tbh
yeah
report the telegram group if you dont mind jumping into a gore video fest just to get a report
🍋
right
well what concerns me the most I guess is I dont know what kinda information a telegram server owner has about its users and all that shit, and I know its 100% the shadiest platform on the internet.
so im definitely not willing to do it
telegram is more private than most other apps, recently they even added anonymous accounts that dont require a phone number
so its not that bad
but its thinly split on
- gay furry groups
- nazis
middle ground is as thin as a blade
oh right you dont like furries lmao
Im pretty sure its way worse than that even. It has a reputation for hosting everything that used to only be on the dark web. drug dealing, etc
mostly scams probably
ive been using it for years
haha
yes its full of scams
but it doesnt force you to particpate in social media stuff like facebook for example, so i never have weirdos DM me
not even once
i dont dislike furries, i dont have any interest in furry art and I dont want it mixed into my stuff.
But other than that its not that i dont like them

I generally dont trust platforms that are like, "our services are encrypted :)" because time and time again people say that and its not true.
*don't join random group chats, in any chatting app
true.
tg is safe than most, but yes they arent super trust worthy
you can run into some really uncomfortable stuff on discord just by doing that
ive heard stories of them sahring info with authorities
and their serverside code is not open source, unlike the client, so we have to take them at their word
signal on the other hand, seem to actually store nothing 
They had audits. They got roasted first because they implemented their own encryption, but after first audits many years ago it actually got addressed and new audits actually show it's safe
Just remember that normal chats are encrypted using your account key, and group chats are stored in some pretty plain way. Secret chats are the ones that have end-to-end encryption
one time i was looking for servers about this music group i listen to, and I found a server of people pretending to be the rappers in the group, and faking that its an official discord, and no one in there knows its not real. If you say its not real, your messsages get deleted and you're banned. And the majority demographic of people in there are kids. I reported it but i never checked up on if anything happened as a result
I see.
that would be a funny prank if it wasnt so shady
I heard stories of them not sharing info with authorities. It's one of the reasons Russian government doesn't like them and tried to ban it. But on the other hand, since the Russian invasion it's been really useful for Ukrainians
the russia one is true, yeah
afaik the CEO went to great lengths to avoid sharing info with the gov
anyway, audits are good. If they submit to third party audits and do them yearly, thats not bad.
Its about as good as you can do anyway
i think that there was an incident with german law enforcement where they did share info tho
Signal has end-to-end encryption. It was great when it still used to be basically alternative texting app (if someone had signal, it was sent using signal, otherwise it was just normal texting). But shitty group chat stuff.
i should probably invest in using apps like those more, you never know what happens 
I have tg. Got it originally to chat with some friends, they also played Ingress and I started playing Ingress later... So I have joined a bunch of ingress chats as well.
And partner's family has tg, although they don't use it really actively, but we have a group chat to share photos 😄
i initially got it because i thought it was safer, also because whats app and FB fking SUCK, and it had large file uploads which is super handy to me
it makes yeeting around ML projects easy
no more filling up my uni email drive with pickled models
I had a friend upload movies in parts there. XD I'm in some chat with books
i had a bunch of book chats but then telegram started to crack down on copyrighted things harder 
even tho most of the books were public domain
moderation on tg has tightened a lot over the past 3 years
they nuked a large portion of the NSFW channels that covered the global search
This one chat I'm in has occult/pagan/witch stuff because I wanted to check something and while looking for the book online, I found the link to tg server
telegram is actually one of the things that introduced me to leftism lol
NSFW channels, especially as groups instead of "announcement" type of channel, could have illegal stuff there
and its all because i looked up "memes" on the global search and ended up in a network of lefty channels
I tried telegram once and immediately removed it. It had this feature where it would just connect you to local groups. This was at least 3 years ago. And it was nothing except bots advertising prositution and drugs. I assume its a mixture of real and scams. But I left the same day I installed because it didnt feel like anyone but bots were using it.
they absolutely have stuff like theat there and i always report it to be safe, they did actually remove a couple things i reported
oh yeah one time i tried to look up the name of my town on telegram because i wanted to see if it had a news channel there and all i could find were 10 illegal weed channels lol
i WISH they let me block channels so that i cant enter them by accident or see them in global search
for some reason, they dont have that feature
which pisses me off because im rather trigger happy with my block button >:(
This wasnt a weed channel, it was just a normal innocuous channel name that would get spammed by prostitutes and drug dealers.
And it wasnt just weed being offered, everything
So yeah... it seems like a cool idea that is just ruined because they wont do anything about the botting and scamming.
It seems like the users they are targetting are in fact bots and scams lol
so I just left the same day i installed it
That's why you just need to have someone to chat with before you install. Like I had friends or people joined because Ingress. I don't think I ever looked anything in global search, other than for osint (checking tg names from malicious stuff we found)
i wish they let me block the fking global search
it seems to only work on certain clients
I kinda wish Discord had a similar thing that was like, "Show me channels and users that are logged in in this geographicr area" -- but I suppose having such a feature would require another layer of responsibility for what goes on on your app, something I dont think the telegram devs care about lol
By "global search", yoink didn't mean geo search, but rather "search whole userbase/all public chats for this name"
mm
i reallly like leetcode, i did codeforces for 3 years but got really bored afterwards
codewars didnt seem appealing to me, seemed to be too basic
leetcodes problem set is very nicely curated
how long did u do leetcode for?
no
skill issue
i bought warranty for my backpack @vale raven
also 3 years, but now I do only leet code and not other sites
yes? I avoid recommending it for absolute begginers, there are easier sites, easy codeforces problems can be very trivial too
https://youtu.be/hDek2cp0dmI?t=1142 suddenly i like vtubers wtf
PROMO SHORT: https://youtube.com/shorts/ToulgVAofw8
Join me and @cyannyan6 in an epic collab where we tell the story of how I found a bug in macOS and got a bug bounty from Apple! 💰
Learn all about page tables, weird machines, and return oriented programming with us!! It's going to be super fun~ ✨✨
Cyan Nyan is on Twitter! @cyannyan6
▶︎ http...
catgirl GPU programming anyone?
long double operator ""_wtf(long double x){ return x; };
i love c++
the "" is an operator? 
ohhhhh its a user defined literal
long double operator ""_w(long double);
std::string operator ""_w(const char16_t*, size_t);
unsigned operator ""_w(const char*);
int main()
{
1.2_w; // calls operator ""_w(1.2L)
u"one"_w; // calls operator ""_w(u"one", 3)
12_w; // calls operator ""_w("12")
"two"_w; // error: no applicable literal operator
}
its not actually that insane imo, i think julia has a similar thing
it's insane
its not really an operator tho, its called that but it seems to only be there to create those literals
which exist all over the langauge btw
like 11L for example

is it possible to dump the memory/cpu/state of a process, then load that back into an empty dummy process
this might sound dumb but
it's worth a shot
does the scheduler not do that already?
there might be a syscall for this somewhere
dog
i underestimated how much ram multithreading eats up
the code using mljar
automl = aml.AutoML(mode="Perform")
automl.fit(X, y)
and the dataset is only 250kb here
💀
!ban
00:00 Bun is here
00:31 porting to Bun
01:05 log import perf
02:40 MariaDB perf
03:21 reporting perf
03:50 bun install on dev
06:14 macOS disk usage
06:37 bun install on CI
07:19 porting the website
09:30 bun test
12:08 bun --watch
12:54 page load speed
14:32 CI builds
15:55 more testing
16:27 pros and cons of Bun
17:26 me and Bun
Benchmark cod...
finally
some good fking benchmarks
this channel is good btw
wot
Has Python done either of these?
Any way to see it without using the garbage Reddit app
Python has never provided prebuilt linux binaries outside of package managers to my knowledge, which is actually indeed unusual, most languages do have binary downloads for linux.
I do agree that it's strange
Considering python's strong point is backend and that is pretty much always Linux
IG a statically linked python binary would be quite unwieldy, you would need to embed a tcl/tk interpreter.
for future reference, that'd be a libreddit/teddit instance, e.g. https://libreddit.privacydev.net/
Fr ong what bussin todizz @reef geyser ?
You chowin onsum brefizz?
Nah, just doing some research on language design.
so u wnet to that blind date with him or not
Er, no?
LoL
I wasn't setting up the blind date for myself btw.
It was for someone much more angry than myself
we will never know
You should design a dialect of Gciriku
USA ON TOP!!!
