#voice-chat-text-0
1 messages · Page 162 of 1
it wont let me talk lol
.latex $\sigma$
@lunar haven no sound?
VC
today started only 2 hours ago, so the answer is nothing
for later -- idk
I don't remember
my genuine reaction to that information: ^
DM IF U CAN MAKE A YOUTUBE VIDEO UPLOADER BOT IL PAY
nah
not allowed! #rules
@pulsar cobalt Specifically, your request will at least be in conflict with rule nine, prohibition against soliciting paid work. 🙂
"live coding" -> "die coding" when someone starts speaking German?
(I don't actually remember how that article/preposition/whatever is used properly)
confusing
firefox is customizable and i love it
its usually slower than most browsers
idc
lacks extensions
i mean i use firefox but the only reason is bc im too lazy to install chrome
hate to brake it to you but google already knows alot about you
you using firefox will prob make no difference
also who said anything about chrome? if your really into not using google install brave or chromium
yea and i use gmail
im just stopping them from knowing more
😂 sure is effective
@remote bridge 👋
hi
could anyone help me with connecting mysql to python?
no
its fine
@lucid blade u sure this isnt just domestos bleach?
Can anyone tell me what I would need to include when making a portfolio ina github repository
content
projects
also Triton
but they somewhat reduced their open-source work since acquisition, afaik
sparc64 compat?
use https://cock.li
"Yeah it's mail with cocks" what is that even supposed to mean
Exactly what u read is what they means
why would i want mail with cocks
Cuz ready the "transparency" and "how can I trust" sections
Sweeney Todd, The Demon Barber of Fleet St.
Sweeney Todd: The Demon Barber of Fleet Street: The Motion Picture Soundtrack is a soundtrack to the film of the same name, released on December 18, 2007.
In a change from the original, Sondheim cut the show's famous opening number, "The Ballad of Sweeney Todd", explaining, "Why have a chorus singing about 'attending the tale of Sweeney Todd' wh...
hello
import tkinter as tk
root = tk.Tk()
root.title("Inventory Editor")
root.geometry("400x300")
# Create a listbox to display the items
listbox = tk.Listbox(root)
listbox.pack(side=tk.LEFT, fill=tk.BOTH, expand=True)
# Create a label to show the quantity of the selected item
quantity_label = tk.Label(root, text="Quantity: ")
quantity_label.pack(side=tk.TOP)
# Create an entry to enter a new quantity
quantity_entry = tk.Entry(root)
quantity_entry.pack(side=tk.TOP)
# Create some buttons to add, remove, or update items
add_button = tk.Button(root, text="Add")
add_button.pack(side=tk.BOTTOM)
remove_button = tk.Button(root, text="Remove")
remove_button.pack(side=tk.BOTTOM)
update_button = tk.Button(root, text="Update")
update_button.pack(side=tk.BOTTOM)
# Create a dictionary to store the items and their quantities
inventory = {}
# Define a function to update the label and entry values based on the listbox selection
def update_selection(event):
# Get the selected item from the listbox
item = listbox.get(listbox.curselection())
# Get the quantity of the item from the dictionary
quantity = inventory[item]
# Update the label and entry values with the item and quantity
quantity_label.config(text=f"Quantity: {item}")
quantity_entry.delete(0, tk.END)
quantity_entry.insert(0, quantity)
# Bind the listbox selection event to the update_selection function
listbox.bind("<<ListboxSelect>>", update_selection)
# Define a function to add a new item to the inventory
def add_item():
# Get the item and quantity from the entry widgets
item = quantity_label.cget("text").split(": ")[1]
quantity = int(quantity_entry.get())
# Check if the item is already in the inventory
if item in inventory:
# If yes, show an error message
tk.messagebox.showerror("Error", "Item already exists")
else:
# If no, add the item and quantity to the dictionary and the listbox
inventory[item] = quantity
listbox.insert(tk.END, item)
# Clear the entry widgets
quantity_label.config(text="Quantity: ")
quantity_entry.delete(0, tk.END)
# Bind the add button command to the add_item function
add_button.config(command=add_item)
# Define a function to remove an item from the inventory
def remove_item():
# Get the selected item from the listbox
item = listbox.get(listbox.curselection())
# Check if the item is in the inventory
if item in inventory:
# If yes, remove the item and quantity from the dictionary and the listbox
inventory.pop(item)
listbox.delete(listbox.curselection())
# Clear the entry widgets
quantity_label.config(text="Quantity: ")
quantity_entry.delete(0, tk.END)
else:
# If no, show an error message
tk.messagebox.showerror("Error", "Item does not exist")
# Bind the remove button command to the remove_item function
remove_button.config(command=remove_item)
# Define a function to update an item in the inventory
def update_item():
# Get the selected item from the listbox
item = listbox.get(listbox.curselection())
# Get the new quantity from the entry widget
quantity = int(quantity_entry.get())
# Check if the item is in the inventory
if item in inventory:
# If yes, update the item and quantity in the dictionary
inventory[item] = quantity
# Clear the entry widgets
quantity_label.config(text="Quantity: ")
quantity_entry.delete(0, tk.END)
else:
# If no, show an error message
tk.messagebox.showerror("Error", "Item does not exist")
# Bind the update button command to the update_item function
update_button.config(command=update_item)
# Start the main loop
root.mainloop()
hey
guys i have a question regarding possiblities and probabilities
I'm trying to make a python script that will calculate all possible variations for a given Title. Here are some requirements: The title must be between 8-64 chars. And you can only add or remove "extra" spaces to make it unique. Another thing is that 2 titles that are generated one after the other cannot have the same character length.
Now here are some example:
Original Title: Used 2011 Honda Civic
Possible new titles (you can only add or remove "extra spaces")
- Used 2011 Honda Civic
- Used 2011 Honda Civic
- Used 2011 Honda Civic
- Used 2011 Honda Civic
- Used 2011 Honda Civic
- Used 2011 Honda Civic
- Used 2011 Honda Civic
Reminder
a) total title length must be between 8-64 characters
b) two consecutive titles should note have the same character length
my questions:
How many possibilities for a given title depending on
a) Original titles character count
b) Original titles word count
does the chances of duplicate ad increase or decrease as the number of words increase?
does the chances of duplicate ad increase or decrease as the number of characters increase?
it did not 😭
it gives me incorrect possibilities
you can ask in chat?
can you help me understand the math behind this ?
@jolly terrace
because if the original title has 64 character in it, then automatically the possibility for a duplicate ad is 100% no? @jolly terrace
you cant change the words do
we dont have to go to 64 characters. the max is 64 and the min is 8
our new title can have 35 chars too
or 63 or 26 etc...
whats your solution?
ok
thats not true do @jolly terrace
because more words = more possibilties no?
2011 Honda Civic
New 2011 Honda Civic
more options
for example:
Happy Dog (9 characters long)
hello world
helloworld
hello world
yes, but if it has more words, then more possibilites
so this has a total of 64-9 possibilites
so 55 possibilities?
but
new example:
Cute Happy Dog (14 characters)
you cant remove the minimum spaces
thats not ture
true*
because we can do different possible ways
like :
Cute Happy Dog
Cute Happy Dog
Cute Happy Dog
Cute Happy Dog
Cute Happy Dog
all the way till:
Cute (...) Happy Dog
64 chars
hey i am beginer can any body guide me for my college
or you can do this:
Cute Happy Dog
Cute Happy Dog
Cute Happy Dog
Cute Happy Dog
Cute Happy Dog
Cute Happy Dog
Cute Happy Dog
Cute Happy Dog
....
you get it ?
so more possibilities with more words?
its a mix of word counts and character lenght in original title
ok
bye
can u help me @whole bear
Oh my bad
10 is infact 16 chars
hey can anyone help me here?
hello hello
@lunar haven Hello bro
Hi
can you help me with a discord token post request
its not working for the bot dashboard
@lunar haven I cant talk for some reason
hello
can you help?
Youd need to join my discord server cause I cant stream here
@scarlet osprey @lunar haven
what do you mean?
is the first error displayed on your site?
yes
what's the error traceback?
lemme check
- Running on all addresses (0.0.0.0)
- Running on http://127.0.0.1:8080
- Running on http://172.31.196.116:8080
Press CTRL+C to quit
172.31.196.1 - - [08/Jul/2023 20:31:01] "GET / HTTP/1.1" 200 -
172.31.196.1 - - [08/Jul/2023 20:31:01] "GET /style.css HTTP/1.1" 404 -
2023-07-08 20:31:01 INFO discord.gateway Shard ID None has connected to Gateway (Session ID: 179f131874d39b4762f77b48a08c2009).
172.31.196.1 - - [08/Jul/2023 20:31:01] "HEAD / HTTP/1.1" 200 -
Successfully logged in as Echo AI#4570
2IarSthcu9OA8H4tD3fgJlhPYZczRR
[2023-07-08 20:31:12,853] ERROR in app: Exception on /login [GET]
Traceback (most recent call last):
File "/home/runner/Echo-AI/venv/lib/python3.10/site-packages/flask/app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()
File "/home/runner/Echo-AI/venv/lib/python3.10/site-packages/flask/app.py", line 1822, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/runner/Echo-AI/venv/lib/python3.10/site-packages/flask/app.py", line 1820, in full_dispatch_request
rv = self.dispatch_request()
File "/home/runner/Echo-AI/venv/lib/python3.10/site-packages/flask/app.py", line 1796, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/home/runner/Echo-AI/keep_alive.py", line 40, in login
exchange = exchange_code(param1)
File "/home/runner/Echo-AI/keep_alive.py", line 22, in exchange_code
r.raise_for_status()
File "/home/runner/Echo-AI/venv/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://discord.com/api/v10/oauth2/token
172.31.196.1 - - [08/Jul/2023 20:31:12] "GET /login?code=REDACTED HTTP/1.1" 500 -
[2023-07-08 20:31:12,854] INFO in _internal: 172.31.196.1 - - [08/Jul/2023 20:31:12]
remove last two lines for safety
are you using any pre-existing packages for oauth?
don't store the secret key publicly
how do I do it then?
you should probably reset it and enter it in some different way
can you just join my server we vc
does replit support input?
so I can livestream
idk...
yes it does
IDR 😭
% string formatting is deprecated
if you took that from old codebase/old tutorial, it might not work anymore
so what do I replace it with
f'{API_ENDPOINT}/oauth2/token' in modern python
(but that won't really change anything)
other thing that might be happening is that v10 API handles oauth differently from v6
but I wouldn't expect it to
what does IDR mean?
I dont reemember\
k
IDR = I Dont Remember
k\
I have this in my code and it seems basically same
data = {
"client_id": str(client_id),
"client_secret": self.secret(),
"grant_type": "authorization_code",
"code": code,
"redirect_uri": self.redirect(),
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
async with aiohttp.ClientSession() as session:
async with session.post("https://discord.com/api/oauth2/token", data=data, headers=headers) as response:
return await response.json()
you can try removing /v10 just to check whether that's the reason
hm...
but I doubt it'll change much
do you have REDIRECT_URI added as a redirect url on the bot's configuration in developer portal?
oh
so I have to set final destination to login
@vocal basin now what
cheese!
wait, how are you voice verified
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
thnx
first, security
- disconnect the app because you leaked the token
- reset client secret on the bot
i can't talk
ok and then?
!voiceverify
yeah i think
what I can do
do the command in there'
.
for example, you can access /oauth2/@me endpoint
https://discord.com/developers/docs/topics/oauth2#get-current-authorization-information
async def token_client(access_token: str) -> dict | None:
headers = {"Authorization": f"Bearer {access_token}"}
async with aiohttp.ClientSession() as session:
async with session.get("https://discord.com/api/oauth2/@me", headers=headers) as response:
return await response.json()
or use this to get what user is logged in
https://discord.com/developers/docs/resources/user#get-current-user
where would I put that in the code
witch command please??!
!voiceverify
you probably can't verify yet
requirements are written in #voice-verification
yes
.
they say I should write 50 message is that true?
for now, just a separate function by analogy to how you have exchange_code
translated to requests from aiohttp
a
🥹
Grind
def auth_info(access_token):
headers = {"Authorization": f"Bearer {access_token}"}
r = requests.get(f'{API_ENDPOINT}/oauth2/@me', headers=headers)
r.raise_for_status()
return r.json()
or, mostly, wait
wrong
I forgot to change url
skull
fixed
now you can put token you got from exchange_code into auth_info to get various information
so I should wait until the 3 days pass ?
full 72 hours
how?
and 50 messages outside #bot-commands total
You can tell Im out of my territory here with dashboard code
okey thank you soooo much guys
you need to somehow store the token either server-side or client-side
I don't know which way is safer/better in your case
can I just store it in the code
not really
you can use cookies and/or localstorage on the browser side
how would i do that
how would I use that for Python
localStorage is browser-side (it's accessed by JavaScript)
hey everyone
yoo
what up
Im about to go to a coffee shop to code an app
Coding in public just makes you look more leet
I like this girl at the shop...
Shes a data analyst...
shes still on her way
she really likes math
Both
I know I wont get much coding done
but im coding something from a tutorial
So I dont wanna show up....
looking like I dont know what Im doing
Im going to be coding a NextJS app
she only knows python...
Bro..you dont even know
I even cleaned my pc
I cleaned the screen really nice
just in case she sholder surfs me
Idk...this girl is smart
can I drop a photo here
yea
she is in school for the data anaylst stuff
I wonder if she likes me tho
its so hard to tell
so I always try show my interest in coding to her
I can code better than her tho
yea
i help her w hers
right
wait
look at this
I gifted her a flipper zero
its a little micro controller
palm sized
yea
just like pi
multi-tool purpose
hmm
wanna see something
hacking tool really
watch this
im going to release this later
Im the hacker
not her
she is just sweet girl
because you have to know the mindset to be better than me
I wanna make this go viral
you have to a winning mindset to hack me
thats what i meant
yes yes
That video is going to scare people
Imagine talking shit
and hiding behind that door
no encryption
but imagine
talkin shit
i could maybe use different method
but look
ppl talk shit and try to run
and flip you off behind that door
and then boom
you brute force the door
hahaha
and they have no where to run
lmaooo
people who hide behind doors
after talkin shit
lmaooo
noo
verify!
!verify
yeaaa
im gonna smoke a joint
then change my clothes
i dont want her to smell the weed
on my clothes
and the shower will relax me
Yes
I need a gf
Noo
I know I need a girl in tech
she will help me find my role in cyber sec
@lunar haven
Look I like her ok
tired of girls who play me all the time
Im really gonna try
I need to show me bm
show my bm
that I dont need her
lol
baby momma
american slang
ex gf that has your kid
no
i have a bm
life is complicated
No
Well
maybe
I need to show my bm that im better without her
she didnt want me to enter tech
yea normally i dont pick them
but i like this one
she is perfect
and fun
yea she wanted me to quit coding
so now im single dad coder guy
and living my best dev life
tryin to find a dev shorty
lol its a saying
yes
black guy slang
like my lil baby
bitch is harsh
shorty is friendly way of sayin my girl
but I call everything my shorty
yes
that too
short girl with fatt butt
yes
bm = parent relationship
child support no joke
i hate it
yes
i do
and she lies
and says i dont give it to her
but lookim going afk
👋
i need to smoke the joint
Whats good homie
but i can hear you
in my airpods
yea spark up bro
indicaaa
Hell yeah
We talking about whether or not plant makes you sleep or hyper
Sativa = hyper
Indica = sleep

me too
damn nice
not much better
But I made a decision to leave
you like sf more?
Hell yeah
Are the prices better at disp in sf compared to chicago
Expression college for digital arts
I’m kinda connected to the black market
For weed
But judging from bill boards
parrotverse
Haha
So what are you doing gofek
it was typo dead ass
wait what
lmfao
fuck elon musk
gofeka = elon muust?
fuck
Elon musk*
Elon Musk isn't smart
It’s his money. Not here to say how he should spend it, but buying out Twitter, just to fire the staff and then not even understand running a huge application such as twitter
He doesn’t benefit
And that’s what I’m perplexed by
At least he doesn’t benefit in ways that make readily apparent
hey
It’s just kinda screams: “I have money and also impulsive”
sorry i got totally high
u good
no
yes u are
now im too high to go code in public
Failed to get response.
Stack (abstract data type)
checking for underflow, and returns the item that was previously the top one: procedure pop(stk : stack): if stk.top = 0: report underflow error else:
Integer overflow
term underflow is most commonly used for floating-point math and not for integer math. However, many references can be found to integer underflow. When
naw just brush teeth and make sure you don’t smoke on your clothes
and you’ll be good 👍
You working on data structures?
gofek?
bruh i could explain
i bought new gear from ross
i figured I should open my vs code and get my hands wet
think like a stack of plates …
you put them on the same order you take but opposite
or rather
sure
lol
remove from empty stack
uh
I never it knew to have a name tbh
its arbitrary name?
A stack exception?
just say what it is
underflow?
i never heard anyone refer to it as underflow
not saying they don’t lol
nice
Its a queue
Naw i did an algo a while ago called shunting yard and queues were necessary to preserve paranthesis
that exact question was used
its a queue
Queues preserve the order
example
“ ( 2 * 6 ) “ would be pushed onto a queue and read the same way when removing from queue
some operations are left / right associative
stack is LIFO so it will give you opposite order
he asking why its a queue to preserve parenthesis
Last In First Out
and not staxk
the name says itself
I know
but we have different types of queues
stacks are easy
priority queues, circular, dequeues ...etc
those are easy too
not for me
wanna code it for me in Python?
and what about Linked Lists? Singly, Doubly, Circular ...
no, you should do that so you can learn and gain intuition and ezperience
Those are easy too
i’ll tell you whats fun
no man, I need help
Hash tables
why should I help if you quit learning?
help me
rhetorical
code it for me
no
I wanna see how easy it is
i can give guidance
come on
okay okay
I’m choosing the language
What lang?
C++, but I write easy to read c++
I’ll show you linked list and hash table
what are you even stuck on
#include <iostream>
int main()
{
std::cout << "Hello" << std::endl;
return 0;
}
xD
That's all I know xD
std == sexually transmitted disease
queues, types of queues man
I am stuck there
struct Node {
int data;
Node* next;
};
struct LinkedList {
Node* head = nullptr;
}
int main(int argc* char* argv[]) {
LinkedList list;
list.head = new Node;
list.head->data = 1;
list.head->next = new Node;
list.head->next->data = 2;
return 0;
}
less than 25 lines
easy peasy
now traverse through the list
insert at the end and at the beginning
and insert at specific position + a function to remove a specific element from a list
xD
you can do that
void traverse(LinkedList &l) {
Node* current = l.head;
while (current != nullptr) {
std::cout << current->data << std::endl;
current = current->next;
}
}
ok
nah, i'm smoking
dont wanna ruin my vibe
what are you stuck on
like what they do?
just how to write one?
cuz if you know how they work you can just write it
like i'm saying cuz i wanna know what you're stuck with g
you stuck on the logic of the function(s) you wanna add?
what do you smoke?
life
yes
I am stuck on everything man
come on
let's code together 😄
what are you writing this in
we can use whatever language
C++ is a terrible language
man, you just started using it 😄
hahaaha
@lunar haven
watching some crap
wbu
what?
xD
what languages you know?
C/C++, JavaScript, Python
and little bit of golang
what xD
asm
adopts
use
stacks
mmmmmmmmmm
what what
lol
ok @lunar haven
how I can talk here damn???
LOL
ahhaaaahaahha
nah how I can talk here
I am bored
can't type all the time
chil
You chill
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
oh I see now
I need to wait one more day
ok
@lunar haven do you code in C++?
C you know?
and Python?
niceee
what's that
nice
how? I am using linux
idk man
I am using a laptop without a mouse
LOL
I need a mouse
it'a hard like this xD
@lunar haven you are still here?
ahahah where are u from @lunar haven
where??
I am from Serbia
I didn't hear you
lol
xD
tf man
cat
🙂
so where are u from
nah, I don't have animals
www?
lol
esta bien
entiendo
ok
me? I don't use netflix
I don't watch movies
depends
movies are stupid
ok
it's like watching coding videos
easier to do that, than to read sometimes
hi
what
ahh
i watch for entertainment
nice
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voiceverify
need help with a project!
@lunar haven
i got voice but it dont want to work
@lunar haven
can you hear me
are you looking at that or are you working on it
Hello
this part?
{{current_user.username}}#{{current_user.discriminator}}
(speculative fix)
{{current_user.username}}#{{current_user.discriminator}}
{{current_user.username}#{current_user.discriminator}}
second one tries to parse this as Python-like code:
current_user.username}#{current_user.discriminator
E
Cheese.
.topic
Hii @lunar haven
@whole bear 👋
@north agate 👋
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@autumn fog 👋
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
# imported.py
class MyClass:
def greet(self):
print('Hello, world.')```
```py
# main.py
import imported
instance = imported.MyClass()
instance.greet()```
!d str.isdigit
str.isdigit()```
Return `True` if all characters in the string are digits and there is at least one character, `False` otherwise. Digits include decimal characters and digits that need special handling, such as the compatibility superscript digits. This covers digits which cannot be used to form numbers in base 10, like the Kharosthi numbers. Formally, a digit is a character that has the property value Numeric\_Type=Digit or Numeric\_Type=Decimal.
!d str.isnumeric
str.isnumeric()```
Return `True` if all characters in the string are numeric characters, and there is at least one character, `False` otherwise. Numeric characters include digit characters, and all characters that have the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH. Formally, numeric characters are those with the property value Numeric\_Type=Digit, Numeric\_Type=Decimal or Numeric\_Type=Numeric.
3x ` would help
@near flint 👋
yeah
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
hey umm is this DS? i see stacks up there
yea a lil bit
just entered my 2nd yr in uni but we still dont have DSA untill 3rd yr
nono an offline indian uni
its pretty shit
we dont learn
exactly i took cs50 it was soo good
they get into maths?
our local uni really shit
you need previous knowledge right?
not really
shit
just basic logical thinking is enough
i'm looking for a place to learn maths
for cs or just in general?
focused on cs
but
general too
hi @somber heath
learn linear algebra then get into matrices
then go for stats but dont go in too much
linear reg is enough
mmmm i'm a little lazy, i'm looking for a course where they have a way
and with problems
dabble a little in discreet maths and u are all set
thanks
well ur welcome
u can try english indian youtube channels
accent is shit but good shit
ahahh okay i'm going to look it
yes
ahhhh okhh
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
i just joined the server for like 30mins
What is?
nvm
just the entire convo
I feel like you are trolling at this point bro...
that's way out of context from trolling...
what?
wattup
how should I speak in voice chat??
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
okh I got it
sayonara ppl
also str.isdecimal
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Provided to YouTube by CDBaby
Bring Out Your Dead · Skittish
The Perfect Shade of Green
℗ 2010 Jeffrey Noller
Released on: 2010-10-12
Auto-generated by YouTube.
yes?
had to look up lyrics for some other song today to understand why the hell it was picked for the video
turned out the reason was that it mentioned "Swan Lake"
it's a nice song
you can have a reversed stack
(push to front, pop from front)
It's got a charm.
actually double a means the letter ع in arabic so my name is 'عقرب' which is scorpion in arabic
iv always been
wym now ? xD
idk how local that reference is
what are you doing gofek ?
double ended queue
anyone here that worked with discord.py?
what's the question?
literally just asked...
does it work with from views import views?
no it says no module named views
does views.py define anything named views?
./website/views.py, right?
yeah i think
if there are multiple views.py files, there might be issues
theres only one view file
Ctrl+S
what does that do
BRUH THATS THE PROBLEM
that's what that circle indicates
there's auto-save in File
!voice @whole bear
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
can't unmute
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Where's hemlock
hiii
@somber heath they didn't hear (not in VC)
Hello @somber heath
He tends to be here around this time US weekdays.
Though if you're asking about physical location, then Missouri, probably.
yes
@vocal basin what're you up to?
time to write the most dumb solution for this:
https://leetcode.com/problems/find-the-pivot-integer/
Can you solve this real interview question? Find the Pivot Integer - Given a positive integer n, find the pivot integer x such that:
- The sum of all elements between 1 and x inclusively equals the sum of all elements between x and n inclusively.
Return the pivot integer x. If no such integer exists, return -1. It is guaranteed that there wil...
I'm still working on my take home >.<
how about just using random.choice(range(1, n)) then checking it it's right?
it's guaranteed to work eventually :)
ah wait
I didn't finish reading
@wind raptor
||```py
class Solution:
def pivotInteger(self, n: int) -> int:
return {1: 1, 8: 6, 49: 35, 288: 204}.get(n, -1)
yes
those are only possible ones
just very unlikely
idk if there's a proof that the count grows logarithmically
!e
print(.5**.5)
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
0.7071067811865476
provably
pivot=sqrt((n*n+n)/2) always when it's valid
such a useless plot
this was kind of unexpected
Y: logarithm of N
X: index of pivot
I may try to guess the next pivot number based on the ratio, maybe
Python and C++
differences between points
ratio seems to approach 3+sqrt(8)
@lunar haven venv?
python -m venv venv
and PyCharm does that automatically
@lunar haven ctrl+shift+P select interpreter
@lunar haven
also this influences it
sometimes needs re-selection
idk why
Pylance broken
I don't have it selected
it works most of the time
re-opening the terminal also works if Pylance takes long too load
or just Python extension
it's not guaranteed to activate venv if you open the terminal before the extension is done loading
generally, selecting interpreter shouldn't change anything if you use it more than once in a workspace
something went wrong
it crashed
pivot and the n it's a pivot of
this, hypothetically, is 4096th n-pivot pair
@midnight agate
4096th
currently generating 65536th
I can speed it up by skipping steps, I guess
just a number less and that's the total no of ports can exist in a network
it should be way faster but I don't know the proper coefficient yet
@lunar haven u finished your course yet?
are you makeing prediction
or I can delegate guessing to WA
I improved the generation algorithm a little
print is now almost the main performance bottleneck
it's actually 1'000'001st because of off-by-one error
!e
i = 9
print(int((3 + 8 ** .5) ** i / 4))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
1940449
with the nuance that it all must be integer arithmetic
Chrome can't even wrap it anymore properly
1: 76861
2: 76770
3: 76177
4: 76271
5: 76755
6: 76915
7: 76429
8: 76653
9: 76512
iirc, all irrational algebraic numbers have the same amount of each digit
both is not rational and is a root of some polynomial
this applies to fractional component mostly, yes
so doesn't necessarily translate to distribution of these digits
Hi @lunar haven
"algebraic numbers" is likely the most easily defined of all those sets
I don't remember any alternative definitions for it
@proud gull help with what?
@proud gull did you add routes that act as if they point to an image?
same way as if you'd have with file response
!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 floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
other two options are:
base64 url
JS blob url
pfp = db.Column(db.LargeBinary, default=open('D:\IRead\static\profile_pic\default_pfp.png', 'rb').read())
profile_picture = base64.b64encode(current_user.pfp).decode('utf-8')
return render_template('profile_sample.html', username=username, email=email, profile_picture=profile_picture)
<img src="data:image/png;base64,{{ profile_picture|safe }}" alt="Profile Picture" style="width:100%">
The error message:
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) Could not decode to UTF-8 column 'users_pfp' with text '�PNG
'
[SQL: SELECT users.id AS users_id, users.username AS users_username, users.email AS users_email, users.password AS users_password, users.pfp AS users_pfp
FROM users
WHERE users.id = ?]
[parameters: (1,)]
did you encode it using base64 module?
hi
Source code: Lib/base64.py
This module provides functions for encoding binary data to printable ASCII characters and decoding such encodings back to binary data. It provides encoding and decoding functions for the encodings specified in RFC 4648, which defines the Base16, Base32, and Base64 algorithms, and for the de-facto standard Ascii85 and Base85 encodings.
The RFC 4648 encodings are suitable for encoding binary data so that it can be safely sent by email, used as parts of URLs, or included as part of an HTTP POST request. The encoding algorithm is not the same as the uuencode program.
before putting it into the response it needs to be encoded
profile_picture = base64.b64encode(current_user.pfp).decode('utf-8')
error seems to happen in a different place, actually
in pfp = line?
like, not in templating/decoding
last three lines are irrelevant
pfp = db.Column(db.LargeBinary, default=open('D:\IRead\static\profile_pic\default_pfp.png', 'rb').read())
if it the whole traceback?
!paste <-- you can put it in this
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 floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) Could not decode to UTF-8 column 'users_pfp' with text '�PNG
'
[SQL: SELECT users.id AS users_id, users.username AS users_username, users.email AS users_email, users.password AS users_password, users.pfp AS users_pfp
FROM users
WHERE users.id = ?]
[parameters: (1,)]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
Traceback (most recent call last)
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\site-packages\sqlalchemy\engine\base.py", line 1964, in _exec_single_context
self.dialect.do_execute(
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\site-packages\sqlalchemy\engine\default.py", line 747, in do_execute
cursor.execute(statement, parameters)
The above exception was the direct cause of the following exception:
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 2548, in call
return self.wsgi_app(environ, start_response)
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 2528, in wsgi_app
response = self.handle_exception(e)
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1822, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1820, in full_dispatch_request
just random letters
@tepid edge that line is correct, mostly
b64encode returns bytes
template wants str
error happens in User.query.get, allegedly
what type do you have for users_pfp column?
UTF-8 column 'users_pfp'
why does it say it's UTF-8 column then?
pfp = db.Column(db.LargeBinary, default=open('D:\IRead\static\profile_pic\default_pfp.png', 'rb').read())
is pfp column mentioned anywhere else?
profile_picture = base64.b64encode(current_user.pfp).decode('utf-8')
@tepid edge I joined because of the event that was a week ago
this line never gets reached, I'd expect
error happens in load_user function
I can open DMs temporarily
(did)
I did a genius move and opened DMs for that server
Flask is weird in terms of how it handles everything
Django is similar, so might be easy to switch to that
I doubt that
the thing about Flask is that it's less powerful and simpler
that's why it's a good fit for small projects
I'd say that PFP logic should almost certainly should be a separate service
obviously
Django has its own ORM
sqlalchemy analogue
Django's templates are similar to jinja2 (what Flask uses)
https://docs.djangoproject.com/en/4.2/topics/templates/
it can use jinja2 itself
Hi
how many users is that project expected to serve?
then Flask definitely doesn't fit it
Is your project a social network ?