#voice-chat-text-0
1 messages ยท Page 227 of 1
yeah but its not really usefull for someone to use for themselves
its cool
but i dont think someone needs a 8 bit cpu emu
for some reason emus for me are associated (apart from Australia) with India
(but I don't fully remember what happened there)
Bunch of emu and ostrich farming in India, apparently.
around 2012, quite recent
hello @idle vector
is there anyone streaming?
doing good, about to sleep how are you confused raptor?
k ima go sleep now
good night
good morning @somber heath @obsidian dragon
hi
osyra42's site -> It's okay to look around. I won't tell.
@spice quarry ๐
hello
@ionic jungle ๐
Hello
@obtuse falcon ๐
Yo
@stable anchor ๐
hi
hello @obsidian dragon and @stark river
how are u all doing
have you updated to the latest version of discord
i kinda not like the new icons
of microphone and deafen end call
exam sucks a lot
a lot and a lot
it's tomorrow and that also offline no google
sometimes I think
I should just go like
fuck this i will just chill
what's going in your life
@obsidian dragon
see you all later
!pypi python-dotenv @earnest crag
actual_reason = str(lowercase_preset_reasons.get(reason.lower()), str(reason))
<!1182259904761835540>
user = "John";
console.log(`hello ${user}`);
def run_query(sql: LiteralString) -> None:
...
def caller(arbitrary_string: str, literal_string: LiteralString) -> None:
run_query("SELECT * FROM students") # OK
run_query(literal_string) # OK
run_query("SELECT * FROM " + literal_string) # OK
run_query(arbitrary_string) # type checker error
run_query( # type checker error
f"SELECT * FROM students WHERE name = {arbitrary_string}"
)
from typing import LiteralString
preset_reasons = {
"NSFW": "No NSFW or inappropriate content. This includes pornographic material, foul language, violence, and any other content that is widely found to be offensive and not suitable for public environments.",
"Spam": "Do not spam or otherwise misuse any channels. Keep content in their respective channels. Prevent yourself from splitting words or use several lines to say very little (line splitting)."
}
@client.command(name='warn')
async def warn(ctx, member: discord.User = None, *, reason: str = None):
# Create a new dictionary where all the keys are lowercase
lowercase_preset_reasons = {key.lower(): value for key, value in preset_reasons.items()}
# Use the preset reason if the user provided one of the keys in the dictionary, otherwise use the user-provided reason
actual_reason = lowercase_preset_reasons.get(reason.lower(), reason)
Might be a bit scarce today. Got lots of stuff I have to be away from my desk for
preset_reasons: dict[LiteralString: str] = ...
r"Profane"
actual_reason = lowercase_preset_reasons.get(reason.lower(), reason)
And profane accessories
ive been here
No worries ๐
@client.command(name='warn')
async def warn(ctx, member: discord.User = None, *, reason: str = None):
if member is None:
# Create the embed
return
if reason is None:
# Create the embed
return
@wind raptor this is the model in game thing I was talking about
reson : str | None = None
async def warn(ctx, member: discord.User | None = None, *, reason: str | None = None):
Because None is not a User.
@rapid chasm
outside of the discord.py specific stuff
typehinting isn't actual code its just a hint for any person reading the code or an IDE to see what type that member variable in this case is which they couldn't tell without is as python isn't strongly typed
member: discord.User = None is perfectly valid code but the type hint might make your IDE give you a warning that you hinted that member is a type of discord.User but gave it a value of None which doesn't match
meanwhile member: discord.User | None = None means that the member's type is either discord.User or None and then you give it a default value of None which now makes it so your IDE is now aware that this member variable can be of type None so if you try to use any properties or methods of the discord.User class it will warn you that you need to check if it isn't None before you can use it otherwise it could cause a runtime error
hai reaper
hello
@rugged root
The final results from the Code you provided
Drum roll please
have to send it in bits
!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.
Just use the haste bin
def double(value: int) -> int:
return value * 2
print(double("1")) # Valid but type checker screams at you.
next step write a wsgi compatible server using sockets???
https://www.youtube.com/watch?v=WqrCnVAkLIo
WSGI is the foundation of most Python web frameworks, but there's a good chance you've never had to interact with it directly. In this talk we'll explore why it exists, how it works, and what the heck it's doing in your stack.
A great web framework abstracts away all the low-level stuff so that you can focus on the core functionality of your ap...
!e print(-5 % 10)
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
5
have i showed you this btw @wind raptor ?
cuz you'd probably be interested
are you from the Czech Republic?
hello everyone
hello
solnishko
yep
u right
i`m lazy to change it
but i will just for u
u got it bro
thanks google translate solnishko
Here are the results all green checks mean code passed @rugged root

!stream 444818787737272321
โ @idle vector can now stream until <t:1701963681:f>.
can anyone help i keep getting 0xc0000135 - status_dll_not_found (not python but i need help)
generally in css we prefer to only modify the min-height and max-width rather than height and width
like giving more specific part to the GPT e.g. which section to read / summarize / extracting key takeaways ...etc
hey
for copilot the thing i don't like is that it gets forced on your taskbar with windows update
why cant i run pip install command in cmd, . its not recogonised as internal or external command?
@rugged root i told this to mustafa but i think i didn't tell you this but haskell gave me so much pain that even i had to stoop to asking chatgpt to help and it made me spend 1 hour extra for no reason after which i had to just rewrite the entire thing myself again
if you have just installed python than try to restart your terminal
if you already had python installed then open your python installer again, select modify and look for an option that says add Python to Environment variables or add Python to path and tick that and finish then restart your terminal
!stream 386307484740222987
โ @rapid chasm can now stream until <t:1701966027:f>.
btw @rugged root F# has the worst editor support outside of visual studio that i've ever seen
the neovim versions of its tree-sitter module and its lsp don't work well and vscode extension also doesn't highlight it properly or give proper autocomplete
christmas
santa
spooky
0xC0000135 - STATUS_DLL_NOT_FOUND
just get the dll from the net
I'm wary about that
yes that is true
DayZ Troubleshooting Report
Sorry for the inconvenience.
Please report this on DayZ Feedback Tracker (https://feedback.dayz.com). Thanks to you we may fix the issue faster.
----------------------
Process exit
----------------------
Exit code: 0xC0000135 - STATUS_DLL_NOT_FOUND
Running time: 00:00:13.6063940
----------------------
System information
----------------------
Date: 2023-12-07 16:08:35 / 2023-12-07 16:08:35 +00
Current dir: D:\steam\steamapps\common\DayZ
Command line: D:\steam\steamapps\common\DayZ\DayZLauncher.exe
CLR version: 4.0.30319.42000
OS Version: 10.0.19045.0 (Microsoft Windows NT 10.0.19045.0)
OS 64 bit: True
Process 64 bit: False
Culture: en-GB
UI Culture: en-GB
----------------------
Last game report
----------------------
not provided
@woeful salmon
Your code looks much better now! However, thereโs still one more optimization you can make. Currently, youโre checking if a member is in the users_queue_sorted list for every member in voice_channel.members. This results in a time complexity of O(n^2), which can be inefficient if both lists are large.
To improve this, you can convert users_queue_sorted to a set, which allows for O(1) membership tests. Hereโs how you can do it:
# Sort users_queue by ready_time
users_queue_sorted = sorted(users_queue, key=lambda x: x.get("ready_time", datetime.datetime.min))
# Convert users_queue_sorted to a set for efficient membership tests
users_queue_set = set(user["member"] for user in users_queue_sorted)
True or false?
# Get the voice channel
voice_channel = ctx.guild.get_channel(712072729406472374)
# Sort users_queue by ready_time
users_queue_sorted = sorted(users_queue, key=lambda x: x.get("ready_time", datetime.datetime.min))
# Separate users into "Ready" and "Not ready"
ready_users = []
not_ready_users = []
for member in voice_channel.members:
if member in [user["member"] for user in users_queue_sorted]:
ready_users.append(member)
else:
not_ready_users.append(member)
# Create strings for "Ready" and "Not ready" users
ready_string = '\n'.join([f'{member.mention}' for member in ready_users])
not_ready_string = '\n'.join([f'{member.mention}' for member in not_ready_users])```
does the order of the members matter?
iirc sets don't keep order
if not then this does make sense
users_queue_set = set(user["member"] for user in users_queue_sorted)
yep a set is just a hashmap / dictionary without the values
so what its doing under the hood is just hashing the value and then using the hash to determine where in the internal array its going to store the value for that hash
making the order completely random
definitely faster than an array lookup then
yep
Yes I want the the list to be first ordered by ready time
Sets are awesome
then you need an array
its not making the entire array randomly ordered but only this comprehension that you are using in the if statement so it should be fine i think still
So there is no need to convert users_queue_sorted to a set?
what's the point of sorting the users_queue btw?
This results in a time complexity of O(n^2), which can be inefficient if both lists are large. it says
i dont know why but i just remembered bogosort ๐คฃ
yeah so using a set like it says makes sense but it will make the order random, but at the same time in your code i don't see you using the order of the queue in any place
users_queue_sorted = sorted(users_queue, key=lambda x: x.get("ready_time", datetime.datetime.min))
``` should make the list in order right? Oldest first
yep it should
pass off the sorting to another process
also to summarize my answer here is basically yes do use the set like it says it does not modify the order of your sorted queue and creates a separate structure so you are fine there, the thing i was curious about is just that in the lines of code you have sent you are not using the dates at all that you sorted with which i assume you do later on
Code:
# Get the voice channel
voice_channel = ctx.guild.get_channel(712072729406472374)
# Sort users_queue by ready_time
users_queue_sorted = sorted(users_queue, key=lambda x: x.get("ready_time", datetime.datetime.min))
# Separate users into "Ready" and "Not ready"
ready_users = []
not_ready_users = []
for member in voice_channel.members:
if member in [user["member"] for user in users_queue_sorted]:
ready_users.append(member)
else:
not_ready_users.append(member)
# Create strings for "Ready" and "Not ready" users
ready_string = '\n'.join([f'{member.mention}' for member in ready_users])
not_ready_string = '\n'.join([f'{member.mention}' for member in not_ready_users])```
# Get the voice channel
voice_channel = ctx.guild.get_channel(712072729406472374)
# Sort users_queue by ready_time
users_queue_sorted = sorted(users_queue, key=lambda x: x.get("ready_time", datetime.datetime.min))
users_queue_set = set(user["member"] for user in users_queue_sorted)
# Separate users into "Ready" and "Not ready"
ready_users = []
not_ready_users = []
for member in voice_channel.members:
if member in users_queue_set:
ready_users.append(member)
else:
not_ready_users.append(member)
# Create strings for "Ready" and "Not ready" users
ready_string = '\n'.join([f'{member.mention}' for member in ready_users])
not_ready_string = '\n'.join([f'{member.mention}' for member in not_ready_users])
this is better like the gpt said
i was just being curious about where the actual users_queue_sorted["ready_time"] was actually being used which is not relavant
when memory piles up, specially if the software uses some sort of cloud function, it can become expensive
for hashmaps?
the speed hashmaps provide can really help sometimes
1 of the 2 main optimization that improved GTA V's loading time by 70% (by a non-rockstar employee) was just replacing an array they were using with a hashmap
but memory is ineed a tradeoff you have to keep in mind
also, Insertion sort / merge sort is advantageous when the 'write' operation is expensive, all sorts are good, just depends on use case
there must be some use for that too
@peak depot
title=f"1 player is currently in the queue" if len(
users_queue) == 1 else f'{len(users_queue)} players are currently in the queue',```
```py
title=f"{len(users_queue)} player{' is' if len(users_queue) == 1 else 's are'} currently in the queue",
maybe i haven't seen one yet maybe i will in the future xD you never know
probably because merge sort and quicksort are better alternative in every case
maybe if you're like super limited on memory where an in-place replacement is better?
idk
quicksort uses inplace swap, and its faster...
i meant stack memory included
so you can't call more functions
btw, everytime i look at your profile pic, it reminds me of..
i don't know about that
I know, its odd, but just a illusion I gues
only when view in the zoomed out circle beside your name
๐ no way i see it now
its the hair
ah, thank god, I was feeling embarrased
right, and the gap betweeen the hand and face resembles nose
yeah
i gotta go for now cya guys ๐
one of the twin kitties, their father is also orange
Sometimes I feel cats are the derpiest animals out there, but other times I see centuries old calmness and wisdom in their eyes
gotta go, zonk
https://www.codium.ai/blog/codiumai-or-codeium-which-are-you-looking-for/ Oh good, this was screwing me up
Stupid similar name bs
@peak depot
https://www.ebay.com/itm/195360397128?hash=item2d7c631748:g:NA4AAOSwE9VjKK0j&var=495215242719
@willow light https://arstechnica.com/gadgets/2023/08/turning-my-framework-laptop-into-a-tiny-desktop-was-fun-now-it-needs-a-job/
Peer reviewed journals please
everyone loves peer review until they try to publish ๐ญ
@brittle flame ๐
!code
what that
?
is too long
can you ask me question about the code
?
course i have presentation
and my teachers going ask me some questions
i want to see if im ready
what the qeustion can you type
you answer
is really heavy for me
english not my best leaguage
"Given that wildcard imports are considered, by convention, best avoided, why have you elected to use one?"
"Given that use of the global keyword is generally discouraged, why have you elected to use it? What alternatives exist to the use of the global keyword?"
course im a new to progaming and tkinker it was the easy for me to use
i just globa course i have to use the varible in the functions for other part of the code
"What does PEP8 prescribe for name conventions, and does your code adhere to them? If not, why not?"
well i didnt' falllow pep8 form i dont really good at cooding so this my first project i hope next time i do it better
"What is truthiness and falsiness? How could you use it to simplify some of your conditionals?"
i use my own style so it can easy to read the code and understand my code
yooo
wtf this stuuff questions
omg
"When comparing objects to True and False, what is the preferred comparison operator?"
thanks
Python Enhancement Proposals (PEPs)
thanks
i know it dosent look like a clear code
this my first project
i did that with basic concepts of pythons
thabnks brother
you are god
<33
thanks you i have to study those questions
@violet thorn ๐
Hello just looking around can you still make tickets to get coding help here
@elder knot
https://www.vice.com/en/article/3dap8k/the-secret-nuclear-history-of-cat-videos One of my favourite article titles ever.
Behind every Rickroll is a technology designed at the height of the Cold War to guarantee nuclear annihilation.
โโโโโโโNetworkNH owns and operates the high-speed USNH IBEAM statewide fiber network. NetworkNH also works with multiple vendors to lease long-haul transport, internet, and Internet2 services on behalf of our clients, both locally and regionally. NetworkN
@brave thicket ๐
Phycology, the study of algae, a large heterogeneous group of chiefly aquatic plants ranging in size from microscopic forms to species as large as shrubs or trees. The discipline is of immediate interest to humans because of algaeโs importance in ecology. Certain algae, especially planktonic (i.e.,
@carmine sentinel @whole bear you guys are Abe and Aaron from Primer
be careful, though, you may trigger a self involving paradox ๐ฎ
(make sure to turn your phone off)
you can use the variable in other parts of the code if you pass them as arguments into functions with parameters. that is how you should share state between sections of your codebase: functions are pipes that you pass data throughout. almost never use globals
totally normal beginner behavior so no worries though
truthiness means values that are not literally "true", but are still considered true.
the number "1" is considered true. "hello" is considered true, because it is a positive thing
true typically is synonymous with "exists"
0 doesn't really exist, so its falsy
1 exists, so its true
objects, like the desk in front of you or a player in mario, exist, so they are true
You understand I wasn't asking this for myself.
ah I clicked reply to the wrong message
I meant to reply to this
Hello everyone,
What is the practical application of recursion ?
to re-express an iterative algorithm
that'd be stack-overflowing not practical
some languages actually will force to use recursion but those normally have optimisations to avoid stack overflow
I mean, Is it something that is still used in the industry or is it something that was used earlier but now we have found workarounds this approach?
do you mean recursion as function call recursion or type recursion?
type recursion
used for data structures; for example, trees
and algorithms on those data structures would often involve function call recursion because:
execution structure follows data structure,
easier to write,
sometimes faster because data for backtracking is on call stack (not requiring heap allocations)
latter can be achieved with iterative algorithms too, but it would require knowing the stack size in advance
I see, that's really helpfull!
Thanks!
it is used all the time and it's not something that is seen as an issue requiring a workaround. it is the right tool for the job often
try drawing a tree
that is a naturally recursive task
you draw a branch that has a branch that has a branch that has a branch
try scanning a file system
that is a naturally recursive task
you look at a folder. then for each of its sub folders, you look at their subfuolders, of whom for each of their subfolders, you look at their subfolders, etc.
I see, Thanks!
good morning
Hello!
i havent been here in a while. Howve you been opal!
whys that
ahh so life
i lost my motivation to code for a bit so i left for 2 monthes
so im just here picking up from where i left off
yes exactly
quite happy to know im not the only one losiing slight motiation
๐ฅฑ good morning
thought I'd chat for a bit till client wakes up for a update
c#
is their a command that looks up a certain lib in this server, i cannot remember it to save my life.
yes Pypi
kinda true
@silent plume ๐
hrllo
!voice ๐
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
=> [worker builder 7/7] RUN mkdir __pypackages__ && pdm sync --prod --no-editable 1506.2s
hi hemlock
FROM python:3.11-slim-buster as builder
RUN pip install -U pip setuptools wheel
RUN pip install pdm
COPY pyproject.toml pdm.lock /project/
COPY src/ /project/app
WORKDIR /project
RUN mkdir __pypackages__ && pdm sync --prod --no-editable
FROM python:3.11-slim-buster
ENV PYTHONPATH=/project/pkgs
COPY --from=builder /project/__pypackages__/3.11/lib /project/pkgs
COPY --from=builder /project/__pypackages__/3.11/bin/* /bin/
ENTRYPOINT ["python", "-m"]
CMD ["app"]
# This is the amount of classifications the model will output,
# why it doesn't just output them all by default I don't fucking know.
TOP_K = 9
pipe = pipeline(
"text-classification", model="KoalaAI/Text-Moderation", top_k=TOP_K,
)

aint no way he's 12
?
!e ```py
print(2023-2011)
@oblique ridge :white_check_mark: Your 3.12 eval job has completed with return code 0.
12
!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.
@pure token
import java.util.HashMap;
public class Customer {
private HashMap<Integer, CustomerInformation> customers;
private static int id = 0;
public Customer() {
customers = new HashMap<>();
}
public void createCustomer(int ssn, String name, String address, int phoneNumber) {
CustomerInformation customer = new CustomerInformation(id, ssn, name, address, phoneNumber);
customers.put(ssn, customer);
id += 1;
}
public CustomerInformation getCustomerSSN(int ssn) {
return customers.get(ssn);
}
public CustomerInformation getCustomerID(int id) {
return customers.get(id);
}
}
class CustomerInformation {
private int id;
private int ssn;
private int pNumber;
private String name;
private String address;
public CustomerInformation(int id, int ssn, String name, String address, int pNumber) {
this.id = id;
this.ssn = ssn;
this.name = name;
this.address = address;
this.pNumber = pNumber;
}
}
```java
{java}
```
you don't need the curlies, that's just where the code goes
sign tax
i noticed that too, i was in a game and was like ๐ค
lol
||syntax||
:hemshake:
tbf dictionary is a nice word to use for the data type
dict["deez"] = "nutz"

fhttps://projects.raspberrypi.org/en/projects/noobs-install
@faint ermine
This Tutorial gives an introduction Raspberry PI and how to use Python in combination with Raspberry Pi
Blog:
https://www.halvorsen.blog/
YouTube Channel @Industrial IT and Automation โ
https://www.youtube.com/IndustrialITandAutomation
Raspberry Pi Resources:
https://www.halvorsen.blog/documents/technology/iot/raspberry_pi.php
Python Progra...
@cinder dawn is a scammer.
!stream 193219019292016641
โ @pure token can now stream until <t:1702049018:f>.
You paid me $20 via fiverr nearly 6 monthes ago to make you a sneaker bot. I did this but you wanted more and more out of it (like making it buy shoes from nike, adidas, etc which I told you wasn't possible) that wasn't part of the contract. I sent you the bot that you asked for and you gave me the $20. This conversation is over.
Hi, finally.
You sent me a file that didnโt work.
@white canopy Keep off server beef off the server
Itโs my only way of communication after they block you.
Objects/dictobject.c line 1926
PyDict_SetItem(PyObject *op, PyObject *key, PyObject *value)```
@cinder dawn right, Iโll apologise.
I understand what I was asking for was a lot for little money. I completely understand that.
I also understand that there was a lot of miscommunication from both parties.
All the best.
I think that's the most civil resolution to something I've seen on this server
Itโs not all about the arguments, itโs about moving on.
Glad to hear it
glad to hear this resolved :))
All the best on your development journey ๐
C# is better XD
Hey gang, in this MERN auth tutorial, you'll learn how to protect certain API routes from unauthenticated users.
โญโญ Get the full course now (without ads) on the Net Ninja Pro site:
https://netninja.dev/p/mern-auth-tutorial/
โญโญ Get access to all free & PREMIUM courses on Net Ninja Pro:
https://net-ninja-pro.teachable.com/p/net-ninja-pro/
๐ฑโ๐ป A...
can u relate much to "the it crowd" @rugged root
๐
as you say that I just sent a message to chatgpt
@uncut meteor sorry to ping
does your email button on your site work for you?
cause i click it and nothing happens
looks like it does on my side, what browser you on?
chrome
It may be a system default issue, too
maybe cause i don't have a email app installed?
i work at apple but not the good kind of working
It's a mailto: link
works for me.
Which will try to open your email app
so doesn't work with gmail web client
I don't think so, not without some preferences or settings set in gmail
unless you set gamil on browser as your default mail client
unless you have it as your OS default mail app
But I'm not 100% sure, I use Outlook
ok then
so it's a me problem
at my college my photoshop wasn't working. I put a ticket in through
to IT
6 monthes later they respond with "turn it off and on"
that works 90% of the time :p
Meeting time
the computers were turned off and on MULTIPLE times during that 6 monthes
idk why but i remembered this dumbass shortcut again
well at least you didn't have to do graphic work in that time
if you're on windows, please do Ctrl + Shift + Alt + Win + L
unless you're streaming
linkedin?
they put their time into that instead of providing us with basic sdk ๐คฆโโ๏ธ
!project
The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.
!project
^
there are basic stuff there
but if you want problems to solve cs50p has a good set
switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
}
!tvmute 482873542099206154 2w don't spam to meet #voice-verification requirements. you can listen but you need legitimate text and membership activity before you can voice verify
:incoming_envelope: :ok_hand: applied voice mute to @sick dove until <t:1703263402:f> (14 days).
i am infinitely thankful for mr. hemlock for telling me about the blessed module
is my skill section good enough?
i like it
but dont put that on every job app
change it up for every job depending on what they're looking for
it's a pita but it's what you gotta do
!e
fprintf('fprintf is a dumb function')
@pine depot :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | fprintf('fprintf is a dumb function')
004 | ^^^^^^^
005 | NameError: name 'fprintf' is not defined. Did you mean: 'print'?
what u guys talking abt
i dont typically put skills on my resume but yeah it looks good
!e
print(f"this is much better")
@pine depot :white_check_mark: Your 3.12 eval job has completed with return code 0.
this is much better
sorry im stupid but what is matlab
programming language
cool
prog language
y == -1 + 2 * x
if not you can rent a server from AWS ๐
idk but you help pay me
Hey which coc extension would you prefer for python code interpretation for nvim
well come to vc 0
We're up here in #751591688538947646
ru server muted
Yes but i can't talk because i didnt reach the message threshold of 50 messages
Yeah just chill up here and talk with us in text
ull get there pretty quick
We pay attention to the text channel so no one gets left out of the convo
Ah ok
Well i joined the channel
I'm so bad meeting any requirements in discord servers like this
i never even got around using midjourney because of this lmao
I didnt get the ajar joke. its just not funny is it
whats going on
it's not a door, it's a jar
If a door is partly open, it's said to be ajar
ohh
i wonder how many messages i still have to type
Do !user in #bot-commands
@rugged root [char[]]([char]'a'..[char]'z')
I will not leave until i reached the 50 messages
but it is kinda hard haha. is it best to chat here, in this channel? or is there an even more general one?
#ot2-never-nesterโs-nightmare
Please read our off-topic etiquette before participating in conversations.
But there's tons of channels. Topical ones for subjects you might be interested in
!e ```py
[chr(i)for i in range(97,123)]
@oblique ridge :warning: Your 3.12 eval job has completed with return code 0.
[No output]
lorem1
lorem2
print gdi
#python-discussion for just general python chat
!e ```py
print([chr(i)for i in range(ord('a'),ord('z'))])
@oblique ridge :white_check_mark: Your 3.12 eval job has completed with return code 0.
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
Yooh any one using Nvim
yes
$letters = "A", "E", "I", "M", "Q", "U", "Y", "Z"
$parentFolder = "C:\ParentFolder"
foreach ($letter in $letters) {
$start = [char]::Parse($letter)
$end = [char]::Parse($letter) + 3
$folderName = "$($start)-$($end)"
$folderPath = Join-Path $parentFolder $folderName
New-Item -ItemType Directory -Path $folderPath
}
Sure, Python could do it as well. Bash however will not have easy way to do this
you using coc
well there is no difference in functionality they both do kinda the same thing
right??
mm never got the idea of lazy loading
while read dirname others; do
mkdir "$dirname"
done < list.txt
shoot now i have to remove everything i have with coc
are you using lua or vimscript
lua
$a=[char[]]([char]'a'..[char]'z')
$a[0..3]
a
b
c
d```
well i use vimscript but it's quite a hassel getting new pluggins since they all tend to use lua
have no knowledge of lua at all
$a=[char[]]([char]'a'..[char]'z')
$a[0..3]
a
b
c
d
$start = 0
"Folder$($a[$start]) - Folder$($a[$start+3])"
Foldera - Folderd```
okey
mind sharing your link to your config
one sec
'a'..'Z'
a
`
_
^
]
\
[
Z
can use a GUI to automate scripts
Oh for sure
?
kinda like a BATMAN tool belt of pre-defined BASH , other scripts needed at a instant
Huh. Also forgot that if you do 'z'..'a', it'll give you the alphabet in reverse
LM = compartmentalization
uhhhh
nice
did you just commit right now
listen to the sounds
the sounds area amazing
are
id like an apology for having to play this
whats up with UNITY , is it the new standard or will it just be PAYWARE
i made a separate repo because my orig has other personal stuff
ive taught myself to teleport
neato @lavish rover
shoot my best score so far
use my highly optimized keyboard layout as well ๐ซฃ
https://github.com/sazk07/ORNATE-Optimized-Keyboard-Layout-Project
@rugged root why are there not 100 soundboards in this room

mosquitos size of spitfires in Florida ?
hey @lavish rover having trouble with linked list and memory leak issue while learning c
mind helping out with resources
does this overwrite my keyboard layout of my os
Code from video: https://editor.p5js.org/BarneyCodes/sketches/SYf2Ull48
Mandelbrot Wikipedia: https://en.wikipedia.org/wiki/Mandelbrot_set
When the Mandelbrot set is visualised it produces some amazing fractal patterns. A while ago I made a Mandelbrot plotter using P5js but it was too slow to let me explore the fractal in real time, so in this...
Coding a mandelbrot visualization using GLSL in shadertoy.
Source code: https://www.shadertoy.com/view/ssdfDS
Mandelbrot set article: https://en.wikipedia.org/wiki/Mandelbrot_set
it adds a new keyboard layout (your computer already has qwerty and dvorak.. and more if you have linux)
๐ถ He was a shader toy, I'll render you later boy ๐ถ
wait i had no idea this was already there
Avril Lavine @rugged root
This is a Python/Pandas vs Julia cheatsheet and comparison. You can find what is the equivalent of Pandas in Julia or vice versa. You can find links to the documentation and other useful Pandas/Julia resources.
The table below show the useful links for both:
Pandas
Julia
data analysis
is money scars all over
@rugged root can i screen cast my page?
!stream 999482770957021204
โ @golden sonnet can now stream until <t:1702062468:f>.
you want height: 100vh; ?
height for what?
what do you want
i want the white part that i show to not be :p
use
.about {
height: 100vh;
}
.about being the <body>?
about is the about page assuming you used something like div class="about"
it's a <section> actually
inside <main>
you can use main or section for 100vh depending on what you want
o that did actually work
if you don't know view port height you need to learn css again . your fundamentals are not strong
i didn't really take anything on css
just learnd some stuff on the go
then learn css.. it is tricky and without learning it, you're going to run into many problems again and again.. basic ones
gym time over
Gym is good
who's jim
there should be a mcgym
is that guy whos really into aliens stil here
eat a mcchicken in one hand, dumbbell in the other
!e
def foo(x): x += x
a = 5
b = [10, 11]
foo(a)
foo(b)
print(a)
print(b)
@lavish rover :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 5
002 | [10, 11, 10, 11]
Why are people in wheelchairs always right?
Because they never stand corrected.
the rite of passage of every programmer:
ray tracer for me as well, maybe after my chess engine
i need to up my physics and math
@cinder dawn Are you able to unblock me? ๐
progression of insanity:
in mine
yeah
it can render individual frames and you can stitch them together
how about draggable 3d scenes
like blender
like 3d models with shit
i wanna build one
Object animated with Finite Elements Method dancing to FEM by Davido
Original music video: https://www.youtube.com/watch?v=lta5go9P-go
from my ray tracer
diy blender any%
no I don't have any user interaction
{}
i wanna lol
source
@brazen gazelle I thought you were kidding but you're genuinely not using any classes in your code.
I suppose it's fine..
https://github.com/search?q=owner%3AV01Ddev+class&type=code
probably much more involved
print("{source}")
i was thinking of a good ambitious physics project with code
what
!e ```py
spam = 'eggs'
print(f'i can now add {spam} in here without concatonating with +')
@oblique ridge :white_check_mark: Your 3.12 eval job has completed with return code 0.
i can now add eggs in here without concatonating with +
im dumb didn't use the variable name lol
kk, so just add the f
i have persevered with my AI project for over a year and i think i will start to see the fruits of it in a few months, i want something to do and look forward to after that
They say learning languages is best from the natives then i started learning python
๐
do you have a FEN string
imma paste this into my chess engine
rook a1?
lemme try to grab it for you
then what
5qk1/7p/4p1p1/3pP3/2p1P1Q1/1pP1P2P/rP4P1/2KR4 b - - 1 29
then what
Ra1+ Kd2 Qf2+ is correct so far
how? rook's on a1 rn no?
oh yeah mb
thanks
@brazen gazelle if you wanna do the moves yourself instead of in head
https://lichess.org/analysis/standard/5qk1/7p/4p1p1/3pP3/2p1P1Q1/1pP1P2P/rP4P1/2KR4_b_-_-_1_29
thank you
!stream 745015733238497330
โ @terse garden can now stream until <t:1702069173:f>.
yeah mate
@brazen gazelle ||i mispoke in vc about the rook trade. it's not queen trade definitely||
oh
solution: ||Ra1+ Kd2 Qf2+ Qe2 Rxd1+ Kxd1 Qg1+ Qe1 Qxg2||
here's a fun one to make ya feel better
last one was rated 2361
this one is 2215
but puzzle ratings are also kinda trash af
this one is much easier imo
anyone able to explain this to me
like a baby Not good at chess at all
if you want to see the code
shoot refactor it to python
i dont know how to do that its better in c++ anyway
and the way they structured it, there result, is weird it shouldnt be in that form
i have no idea in c++ just toss in the explanation
int main (int argc, char * const argv[])
{
Board x;
int board_size;
sscanf (argv[1], "%d", &board_size);
x.nQueens(board_size);
return 0;
}
initialize board like this
bool solve(int col)
{
if (col >= size) // the board is complete
{
number_of_solutions++;
std::cout << std::endl << size << "x" << size << " Solution #: " << number_of_solutions;
print_board();
}
else
{
bool found_at_least_one_solution = false;
// try placing a queen in each row.
for (int row = 0; row < size; row++)
{
if (is_this_position_safe(row, col))
{
chess_board[row][col] = 1;
if (solve(col+1)) // recursion
found_at_least_one_solution = true;
else
chess_board[row][col] = 0;
}
}
if (found_at_least_one_solution)
return true;
}
return false;
}
solve like this
leave the rest to you / hack your way through the problem and convert that to python
gl!
I am not bot
def count_parameters(model):
return sum(p.numel() for p in model.parameters() if p.requires_grad)
Total number of parameters: 4905357
A very simple way to improve the performance of almost any machine learning algorithm is to train many different models on the same data and then to average their predictions. Unfortunately, making predictions using a whole ensemble of models is cumbersome and may be too computationally expensive to allow deployment to a large number of users, e...
@topaz beacon ๐
@flint valley ๐
@harsh bough Here
!code
! paste
!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.
!paste
!zen
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
@verbal zenith@somber heath
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@hollow otter ๐
only now noticed this
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@tidal moth ๐
global
what WSGI server runner are you using?
is it multiprocessed?
global does not guarantee that it's only one instance
I use Gunicorn...
i need a therapist
@whole bear ๐
three different ten-minute blocks
using save in post_save at all seems suspicious
because this way you may end up with partially correct state
for example, if you successfully committed the first part, but the second failed
another option is to check whether any changes would happen
โญMain Menuโฎ
โ Start Test โ
โ Settings โ
โ Exit โ
โฐโโโโโโโโโโโโโฏ
whyyyyyy
!e
print(f"{123:-^10}")
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
---123----
@severe wasp ๐
def spaceout(value,length,space=' '):
if (len(value) % 2) != 0:
b = 1
else:
b = 0
return space * ((length - len(value)) // 2) + str(value) + space * ((length - len(value) + b) // 2)
``` ive made this function that should space it out
works for other things
tbh, that probably shouldn't be with f-strings, since those have fixed width
I'd expect it to be dynamic instead (with least width possible)
I don't think so
maybe yes
print(spaceout(f"โญ{spaceout(term.bold + title + term.normal,long,'โ')}โฎ",term.width + len(term.normal) + len(term.bold) - 2)) this is a mess
!e
x = 2
print(f"{123: ^x}")
@verbal zenith :white_check_mark: Your 3.12 eval job has completed with return code 0.
7b
7b
!e
x = 10
print(f"{123: ^x}")
@verbal zenith :white_check_mark: Your 3.12 eval job has completed with return code 0.
7b
!e
x = 2
print(f"{123:x}")
@verbal zenith :white_check_mark: Your 3.12 eval job has completed with return code 0.
7b
!e
x = 10
print(f"{123: ^{x}}")
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
123
highlighting is not happy about it
this works in 3.7
(I don't have 3.6 installed to test)
!e
def centered(text, length, space=" "): print(f"{text:{space}^{length}}")
centered("Hello world", 15)
centered("123", 10, "-")
@verbal zenith :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | Hello world
002 | ---123----
snekbox
works in 3.6, i.e. since the introduction of f-strings
wait should i bring out MY snake?
the same way as that
the one on my profile
!e
print("{: ^{}}".format(123, 10))
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
123
time to binary-search versions
(downloading 3.3)
works on 3.3
I don't think I can run 3.0
shes here!
not even 3.1
@verbal zenith :x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 3
002 | print(f"{txt: {sym}10}"
003 | ^
004 | SyntaxError: '(' was never closed
3.2 docker image is outdated
!e
sym = "^"
txt = "Hello"
print(f"{txt: {sym}10}")
@verbal zenith :white_check_mark: Your 3.12 eval job has completed with return code 0.
Hello
@verbal zenith :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 2, in <module>
003 | print(f"{txt:->10=<4}")
004 | ^^^^^^^^^^^^^
005 | ValueError: Invalid format specifier '->10=<4' for object of type 'str'
@high mantle ๐
!e
txt = "Hello world!"
print(f"{txt:->10'='<4}")
@verbal zenith :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 2, in <module>
003 | print(f"{txt:->10'='<4}")
004 | ^^^^^^^^^^^^^^^
005 | ValueError: Invalid format specifier '->10'='<4' for object of type 'str'

!e
txt = "Hello"
print(f"{txt:f'{'#'*10}'^10}")
@ionic jungle :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 2, in <module>
003 | print(f"{txt:{'#'*10}^10}")
004 | ^^^^^^^^^^^^^^^^^
005 | ValueError: Invalid format specifier '##########^10' for object of type 'str'
and works on 2.7
!e
txt = "Hello"
print(f"{txt:[-^10}")
@verbal zenith :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 2, in <module>
003 | print(f"{txt:[-^10}")
004 | ^^^^^^^^^^^
005 | ValueError: Invalid format specifier '[-^10' for object of type 'str'
!e
txt = "Hello"
print(f"{txt:'#'*10^10}")
@ionic jungle :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 2, in <module>
003 | print(f"{txt:f'{'#'*10}'^10}")
004 | ^^^^^^^^^^^^^^^^^^^^
005 | ValueError: Invalid format specifier 'f'##########'^10' for object of type 'str'
@somber heath How is it going ? โจ
!e
txt = "Hello"
print(f"{txt:{{^10}")
@verbal zenith :x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 2
002 | print(f"{txt:{{^10}")
003 | ^
004 | SyntaxError: f-string: expecting a valid expression after '{'
!e
txt = "Hello"
print(f"{txt:{^10}")
@verbal zenith :x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 2
002 | print(f"{txt:{^10}")
003 | ^
004 | SyntaxError: closing parenthesis ')' does not match opening parenthesis '{'
!e
txt = "Hello"
print(f"{txt:'#'*10^10}")
@ionic jungle :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 2, in <module>
003 | print(f"{txt:'#'*10^10}")
004 | ^^^^^^^^^^^^^^^
005 | ValueError: Invalid format specifier ''#'*10^10' for object of type 'str'
!e
txt = "Hello"
print(f"{txt:\{^10}")
@verbal zenith :x: Your 3.12 eval job has completed with return code 1.
001 | /home/main.py:2: SyntaxWarning: invalid escape sequence '\{'
002 | print(f"{txt:\{^10}")
003 | File "/home/main.py", line 2
004 | print(f"{txt:\{^10}")
005 | ^
006 | SyntaxError: closing parenthesis ')' does not match opening parenthesis '{'
>>> "".ljust(10, "12")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: ljust() argument 2 must be char, not str
>>> "".ljust(10, "12")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: The fill character must be exactly one character long
in 2.7 and in 3.11
๐ What's going on ? Should I call the fire department ? ๐
!e
txt = "Hello"
cursed = '#'*10
print(f"{txt:{cursed}^10}")
@ionic jungle :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 3, in <module>
003 | print(f"{txt:{cursed}^10}")
004 | ^^^^^^^^^^^^^^^^^
005 | ValueError: Invalid format specifier '##########^10' for object of type 'str'
!e
txt = "Hello"
cursed = '#'
print(f"{txt:{cursed}<10}")
@ionic jungle :white_check_mark: Your 3.12 eval job has completed with return code 0.
Hello#####
@scarlet halo
def spaceout(value,length,space=' '):
if (len(value) % 2) != 0:
b = 1
else:
b = 0
return space * ((length - len(value)) // 2) + str(value) + space * ((length - len(value) + b) // 2)
!e
txt = "Hello"
cursed = '#'
print(f"{cursed*10}{txt}")
@ionic jungle :white_check_mark: Your 3.12 eval job has completed with return code 0.
##########Hello
f"{s:#<10}"
s.ljust(10,"#")
โญโMain Menuโโโฎ
โ Start Test โ
โ Settings โ
โ Exit โ
โฐโโโโโโโโโโโโโฏ
``` fixed it!
now theres only this ```
โญโTest Completed!โโฎ
โ Redo Test โ
โ wpm: 232.0 โ
โ raw_wpm: 232.0 โ
โฐโโโโโโโโโโโโโโโโโโฏ
!e
s = "test"
print(f"{s:#<10}")
print(s.ljust(10,"#"))
print((s+10*"#")[:10])
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | test######
002 | test######
003 | test######
only took three attempts
@ionic jungle :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | f"{s:='poop'}{'#'*10-len(s)}"
004 | ^
005 | NameError: name 's' is not defined
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | ##########
002 | ###abc####
003 | ###test###
!e
s = 'poop'
f"{s}{'#'*10-len(s)}"
@ionic jungle :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 2, in <module>
003 | f"{s}{'#'*10-len(s)}"
004 | ~~~~~~^~~~~~~
005 | TypeError: unsupported operand type(s) for -: 'str' and 'int'
!e
for s in ["", "abc", "test"]:
print(((5*"#"+s)*2)[(len(s)+1)//2:][:10])
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | ##########
002 | ###abc####
003 | ###test###
@verbal zenith :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | ---text---
002 | --text--
@ionic jungle :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 2, in <module>
003 | f"{s}{'#'*((10-len(s))/2)}"
004 | ~~~^^~~~~~~~~~~~~~~
005 | TypeError: can't multiply sequence by non-int of type 'float'
where length?
!e
s = 'poop'
f"{s}{'#'*int((10-len(s))/2)}"
@ionic jungle :warning: Your 3.12 eval job has completed with return code 0.
[No output]
!e
s = 'poop'
print(f"{s}{'#'*int((10-len(s))/2)}")
@ionic jungle :white_check_mark: Your 3.12 eval job has completed with return code 0.
poop###
!e
print(f"{'text':-^10}")
def center_pad(text, pad, length):
length -= len(text)
left_length = length // 2
right_length = left_length + length % 2
print(pad*left_length + text + pad*right_length)
center_pad("text", "-", 10)
@verbal zenith :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | ---text---
002 | ---text---
!e
s = 'poop'
print(f"{'#'*int((10-len(s))/2)}{s}{'#'*int((10-len(s))/2)}")
@ionic jungle :white_check_mark: Your 3.12 eval job has completed with return code 0.
###poop###
!e
s = "abc"
print(f"{'#'*int((10-len(s))/2)}{s}{'#'*int((10-len(s))/2)}")
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
###abc###
9
!e
s = "abc"
print(f"{'#'*int((10-len(s))/2)}{s}{'#'*int((11-len(s))/2)}")
s = "abcd"
print(f"{'#'*int((10-len(s))/2)}{s}{'#'*int((11-len(s))/2)}")
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | ###abc####
002 | ###abcd###
.
that one, though, fails for >10 length
cut off instead of padding
!e
s = 'poop'
w = 10
print(f"{'#'*int((w-len(s)+w%2)/2)}{s}{'#'*int((w-len(s))/2)}")
@ionic jungle :white_check_mark: Your 3.12 eval job has completed with return code 0.
###poop###
!e
s = 'poops'
w = 10
print(f"{'#'*int((w-len(s)+w%2)/2)}{s}{'#'*int((w-len(s))/2)}")
@ionic jungle :white_check_mark: Your 3.12 eval job has completed with return code 0.
##poops##
you just need to use w+1 on the right instead of w, I think
s = 'poops'
w = 10
print(f"{'#'*int((w-len(s))/2)}{s}{'#'*int((w+w%2-len(s))/2)}")
!e
code
!e
s = 'poops'
w = 10
print(f"{'#'*int((w-len(s))/2)}{s}{'#'*int((w+w%2-len(s))/2)}")
@ionic jungle :white_check_mark: Your 3.12 eval job has completed with return code 0.
##poops##
s = 'poops'
w = 10
print(f"{'#'*int((w-len(s))/2)}{s}{'#'*int((w+len(s)%2-len(s))/2)}")
!e
s = 'poops'
w = 10
print(f"{'#'*int((w-len(s))/2)}{s}{'#'*int((w+len(s)%2-len(s))/2)}")
@ionic jungle :white_check_mark: Your 3.12 eval job has completed with return code 0.
##poops###
!e
c = '#'
w = 10
for s in ["", "abc", "test"]:
print((w-(n:=len(s))>>1)*c+s+c*(w+1-n>>1))
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | ##########
002 | ###abc####
003 | ###test###
!e
c = '#'
w = 10
for s in ["", "abc", "test"]:
print(((n:=w-len(s))>>1)*c+s+c*(n+1>>1))
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | ##########
002 | ###abc####
003 | ###test###
!e
print(bin(426))
print(bin(426>>1))
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 0b110101010
002 | 0b11010101
equivalent to //2 but has lower precedence
@ionic jungle You've pulled me out of what I was doing with your explanation of life as a single python script ๐

!e
print(10+10//2)
print(10+10>>1)
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 15
002 | 10
how did you make that??
&1 gives the same as %2 (modulo, which is remainder for positive inputs)
wth how is Steven Seagal a member of SRZP
(fake opposition party in Russia)
keyword fake
so i used some ascii round box symbols and made a function that takes in a title, and some values in a dictionary consisting of label:command and then rendered it with print statements and used the blessed module for input and colors and terminal width and height information. made a function to space out a string with spaces.
show me the code
def spaceout(value,length,space=' '):
if (len(value) % 2) != 0:
b = 1
else:
b = 0
return space * ((length - len(value)) // 2) + str(value) + space * ((length - len(value) + b) // 2)
def menuloop(title, options):
key = term.inkey(0)
default = term.inkey(0)
pos = 0
while key.code != 361:
if key.code == 258:
pos += 1
key = default
elif key.code == 259:
pos -= 1
key = default
elif key.code == 343 or key == ' ':
cmd = list(options.values())[pos]
cmd()
if key.code == 361:
break
pos = pos % len(options.keys())
keys = list(options.keys())
vals = list(options.values())
print(term.clear)
long = len(max(options.keys(), key = len))
if len(title) > long:
long = len(title)
long += 2
print("\n" * ((term.height // 2) - (3 + len(options.keys()))))
print(spaceout(f"โญ{ spaceout(term.bold + title + term.normal,long + len(term.bold) + len(term.normal),'โ') }โฎ",term.width + len(term.bold) + len(term.normal)))
# print(spaceout(f"โ{ + spaceout(title,long) + term.normal}โ",term.width + len(term.bold) + len(term.normal)))
for i in range(len(options.keys())):
if pos == i:
col = term.black_on_white + term.bold
else:
col = term.normal
print(spaceout(f"โ{col + spaceout(keys[i],long) + term.normal}โ",term.width + len(col) + len(term.normal)))
print(spaceout(f"โฐ{'โ' * long}โฏ",term.width))
key = term.inkey(1)
continue
``` you will also need to import Terminal from blessed and make a variable called term pointing to Terminal()
example of it's use case
menuloop("Main Menu",{"Start Test":starttest,"Settings":settings, "Exit":exit})
planning on adding tabs.
maybe inputs
pretty nice
print(str(1))
String(1)?
f{1}?
1
where do i place this part of the Code
Traceback (most recent call last):
File "c:\Users\Administrator\MK-0-wan\Mk-0-wan\terminal.py", line 52, in <module>
menuloop("Main Menu",{"Start Test":starttest,"Settings":settings, "Exit":exit})
^^^^^^^^^
NameError: name 'starttest' is not defined
!e
print(f"{1}")
@ionic jungle :white_check_mark: Your 3.12 eval job has completed with return code 0.
1
!e
print(str(1))
@ionic jungle :white_check_mark: Your 3.12 eval job has completed with return code 0.
1
@rapid chasm I have an idea / request ! 
is it hard first of all
well i have no idea but would love to learn from you guys on how to create one
Wait you are a voice actor or something like that
what does that mean. And you sound really different
@drifting echo ๐
title=f"1 player is currently in the queue" if len(
users_queue) == 1 else f'{len(users_queue)} players are currently in the queue',
like you need to define the function starttest() to make it work
and settings()
title=f"{len(users_queue)} player{' is' if len(users_queue) == 1 else 's are'} currently in the queue",`
title = ( f"1 player is currently in the queue" if len(users_queue) == 1 else f"{len(users_queue)} players are currently in the queue", )
001 | 3 player(s) in queue
002 | User1
003 | User2
004 | User3
users_queue = ["User1", "User2", "User3"]
title = f"{len(users_queue)} player(s) in queue"
print(title)
for user in users_queue:
print(user)
how can i avoid this repetition
@property
def width(self) -> int:
"""Simple width getter"""
return self.__width
@property
def height(self) -> int:
"""Simple height getter"""
return self.__height
@property
def x(self) -> int:
"""Simple x getter"""
return self.__x
@property
def y(self) -> int:
"""Simple y getter"""
return self.__y
okey
anyone mind helping out
# Get the voice channel
voice_channel = ctx.guild.get_channel(712072729406472374)
# Sort users_queue by ready_time
users_queue_sorted = sorted(users_queue, key=lambda x: x.get("ready_time", datetime.datetime.min))
# Convert users_queue_sorted to a set for efficient membership tests
users_queue_set = set(user["member"] for user in users_queue_sorted)
# Separate users into "Ready" and "Not ready"
ready_users = []
not_ready_users = []
for member in voice_channel.members:
if member in users_queue_set:
ready_users.append(member)
else:
not_ready_users.append(member)
# Create strings for "Ready" and "Not ready" users
ready_string = '\n'.join([f'{member.mention}' for member in ready_users])
not_ready_string = '\n'.join([f'{member.mention}' for member in not_ready_users])
# Get the voice channel
voice_channel = ctx.guild.get_channel(712072729406472374)
# Sort users_queue by ready_time
users_queue_sorted = sorted(users_queue, key=lambda x: x.get("ready_time", datetime.datetime.min))
# Separate users into "Ready" and "Not ready"
ready_users = [member for member in voice_channel.members if member in [user["member"] for user in users_queue_sorted]]
not_ready_users = [member for member in voice_channel.members if member not in [user["member"] for user in users_queue_sorted]]
# Create strings for "Ready" and "Not ready" users
ready_string = '\n'.join([f'{member.mention}' for member in ready_users])
not_ready_string = '\n'.join([f'{member.mention}' for member in not_ready_users])
users_queue = ["User1", "User2", "User3", "User4", "User5", "User6", "User7", "User8", "User9", "User10"]
users_queue = ["User1", "User2", "User3", "User4", "User5", "User6", "User7", "User8", "User9", "User10"]
voice_channel = ["User10", "User2", "User5", "User44", "User5", "User6", "User75", "User8", "User96", "User10"]
# Sort users_queue by ready_time
users_queue_sorted = sorted(users_queue, key=lambda x: x.get("ready_time", datetime.datetime.min))
# Convert users_queue_sorted to a set for efficient membership tests
users_queue_set = set(user["member"] for user in users_queue_sorted)
# Separate users into "Ready" and "Not ready"
ready_users = []
not_ready_users = []
for member in voice_channel.members:
if member in users_queue_set:
ready_users.append(member)
else:
not_ready_users.append(member)
# Create strings for "Ready" and "Not ready" users
ready_string = '\n'.join([f'{member.mention}' for member in ready_users])
not_ready_string = '\n'.join([f'{member.mention}' for member in not_ready_users])
print(ready_string)
print(not_ready_string)
users_queue = ["User1", "User2", "User3", "User4", "User5", "User6", "User7", "User8", "User9", "User10"]
voice_channel = ["User10", "User2", "User5", "User44", "User5", "User6", "User75", "User8", "User96", "User10"]
# Sort users_queue by ready_time
users_queue_sorted = sorted(users_queue, key=lambda x: x.get("ready_time", datetime.datetime.min))
# Separate users into "Ready" and "Not ready"
ready_users = [member for member in voice_channel.members if member in [user["member"] for user in users_queue_sorted]]
not_ready_users = [member for member in voice_channel.members if member not in [user["member"] for user in users_queue_sorted]]
# Create strings for "Ready" and "Not ready" users
ready_string = '\n'.join([f'{member.mention}' for member in ready_users])
not_ready_string = '\n'.join([f'{member.mention}' for member in not_ready_users])
print(ready_string)
print(not_ready_string)
!d time.time
time.time() โ float```
Return the time in seconds since the [epoch](https://docs.python.org/3/library/time.html#epoch) as a floating point number. The handling of [leap seconds](https://en.wikipedia.org/wiki/Leap_second) is platform dependent. On Windows and most Unix systems, the leap seconds are not counted towards the time in seconds since the [epoch](https://docs.python.org/3/library/time.html#epoch). This is commonly referred to as [Unix time](https://en.wikipedia.org/wiki/Unix_time).
Note that even though the time is always returned as a floating point number, not all systems provide time with a better precision than 1 second. While this function normally returns non-decreasing values, it can return a lower value than a previous call if the system clock has been set back between the two calls.
import datetime
users_queue = ["User1", "User2", "User3", "User4", "User5", "User6", "User7", "User8", "User9", "User10"]
voice_channel = ["User10", "User2", "User5", "User44", "User5", "User6", "User75", "User8", "User96", "User10"]
# Separate users into "Ready" and "Not ready"
ready_users = [member for member in voice_channel if member in users_queue]
not_ready_users = [member for member in voice_channel if member not in users_queue]
print("Ready Users:", ready_users)
print("Not Ready Users:", not_ready_users)
import datetime
users_queue = ["User1", "User2", "User3", "User4", "User5", "User6", "User7", "User8", "User9", "User10"]
voice_channel = ["User10", "User2", "User5", "User44", "User5", "User6", "User75", "User8", "User96", "User10"]
# Separate users into "Ready" and "Not ready"
ready_users = []
not_ready_users = []
for member in voice_channel:
if member in users_queue:
ready_users.append(member)
else:
not_ready_users.append(member)
print("Ready Users:", ready_users)
print("Not Ready Users:", not_ready_users)


