#voice-chat-text-0
1 messages ยท Page 37 of 1
โ @velvet urchin can now stream until <t:1670339514:f>.
ai inside a plant :<
while (getline(((*goods)[*gCount].items[(*goods)[*gCount].itCount] = NULL, &(*goods)[*gCount].items[(*goods)[*gCount].itCount]), &capacity, stdin) > 0) {
if ((*goods)[*gCount].items[(*goods)[*gCount].itCount][0] == '\n') { return 0; }
https://www.datasciencecentral.com/a-guide-to-how-text-to-speech-works/#:~:text=The text-to-speech (,driven%20algorithms%20as%20the%20input.
Speech synthesis is the artificial production of human speech. A computer system used for this purpose is called a speech synthesizer, and can be implemented in software or hardware products. A text-to-speech (TTS) system converts normal language text into speech; other systems render symbolic linguistic representations like phonetic transcripti...
No hardcoded session ID
Well at least they caught it
what the hell?
Byee, may or may not come back tonight.
whats all of this about am I missing something here
I'll be here for some for time
Yusssssss
๐ฅบ
Making a lot of assumptions about the contents of the JSON lol
use .get() instead, it's safer
well surely [x][0] => x
@willow light :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | NameError: name 'x' is not defined
well the point is they are creating a list containing one element then indexing into that first element, the assumptions about the JSON here don't matter
it's assuming the elements are present in the first place.
In my experience, that means assuming whoever wrote the API in the first place was competent, which is a very risky assumption
but thats not the point I was getting at
You can make the assumption only if you also wrote the API. Otherwise, never assume. Always write your code the safest way possible.
You're not understanding what I am getting at
brb
you were looking at the list index. I was looking at the keys.
yes
the fact remains, the code assumes the keys will always be present
and that just ain't so
indexing like this is almost always a bad idea
or just read the docs, if their docs are shit, find some other api
indexing should be do by returning an Option in the case of how languages like Rust do it
and PureScript iirc
people use PureScript?!?
I have messed with it
I know more people who use Rockstar in production than have dabbled in PureScript
Never a language I really enjoyed that much
I had a purely functional phase
I tried
I'm now just in my functional phase
does rust give option for division?
it can certainly be divisive
I'm not quite sure on the specifics of how it handles division but imo a NaN would make more sense than an Option
i would take option or error over nan anyday
you would take a panic over a nan?
at least you can catch one
WHY can I not restore these in bulk
Fucking....
Check box, restore, wait 10 minutes
!voice
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@sterile jasper #voice-verification ; !voice
fn main() {
dbg!(4_i32.checked_div(0));
}
None
you get the same problems as null... here is some value, we give when something fails
heyy
option doesn't mean panic - it means you can treat the error once it happens
still, better than a panic but because div is such a primitive function it feels unnecessary to be putting an Optional there
I know what it means
You are not allowed to use that command here. Please use the #bot-commands channel instead.
nope
yes
result, i should have used
for float rust is giving inf and for int it's throwing a panic
checked_ exists for all number types iirc
polymorphism
46
@crisp raven modular arthemetic
import os
file_path = os.path.realpath(os.path.dirname(__file__)) + "/input.txt"
ROCK, PAPER, SCISSOR = 0, 1, 2
key = {
"A": ROCK,
"B": PAPER,
"C": SCISSOR,
"X": ROCK,
"Y": PAPER,
"Z": SCISSOR
}
def game(a, b):
if (a+1) % 3 == b:
return 6 + b + 1
if a == b:
return 3 + b + 1
return 0 + b + 1
def game(a, b):
if b == 2:
return (a + 1) % 3 + 1 + 6
if b == 1:
return a + 1 + 3
return (a - 1) % 3 + 1
def solve(lines):
score = 0
for line in lines:
a, b = map(lambda x: key[x], line.split())
score += game(a, b)
return score
lines = open(file_path).read().strip().split('\n')
print(solve(lines))
explain?
0 -> rock, 1 -> paper, 2 -> scissor
3 = 0 (mod 3) = rock
@sterile jasper are you doing advent of code
Advent of Code - Day 2 - 2016
with open("Day_2_input.txt") as file:
data: list[str] = [line.strip() for line in file.readlines()]
position: int = 5
combo: list[int] = []
for line in data:
for char in line:
match char:
case 'U' if position not in (1, 2, 3):
position -= 3
case 'D' if position not in (7, 8, 9):
position += 3
case 'L' if position not in (1, 4, 7):
position -= 1
case 'R' if position not in (3, 6, 9):
position += 1
combo.append(position)
print(*combo)
I was kind of proud of that one
print(*combo) That was smoother than Still Austin Gin
@sterile jasper text me here!
lol yeah sure
ooh whats that?
@gentle flint
where
outside voices
I'll reinvite you
I am not there oops
okay
verboof, vc?
ok
maybe after the board game
ohh, my uni has one of those
holy shit
๐
Someone's parents
holy shit thats a holy shit
@faint ermine u the guy that recommended me to mimic3?
mind helping me figure this out?
go ahead and ask
Mit diesem Online-Tool kann man Individuelle Steuerberechnungen, historische Steuerbelastungsstatistiken und kantonale Steuerdaten interaktiv generieren.
we are now in sets ed
I do it on a temporary basis. Typically grant it for folks who are getting or giving help, live coding, code reviews etc.
@crisp raven Also, we're getting either echo or background noise from your mic
Can you mute when you're not speaking?
for sure
@coarse turret In here
meh, if it works, it works
I've certainly written far worse in Prod
Styles and Themes: Part of a Modern Tk Tutorial for Python, Tcl, Ruby, and Perl
Not 100% sure if that's what you're meaning
@faint ermine hey do you mind if we get in a call real quick to setup mimic3? or is there a tutorial online?
i recommend using docker if you can
I type fast lol
?
I made a script that finds the most used words on a webpage im trying to tie it into selenium i already wanna yawn
cant use visual studio code?
def separateSports(all_clubs: List[SportClub]) -> Iterable[List[SportClub]]:
"""Separate a list of SportClubs into their own sports
For example, given the list [SportClub("LA", "Lakers", "NBA"), SportClub("Houston", "Rockets", "NBA"), SportClub("LA", "Angels", "MLB")],
return the iterable [[SportClub("LA", "Lakers", "NBA"), SportClub("Houston", "Rockets", "NBA")], [SportClub("LA", "Angels", "MLB")]]
Args:
all_clubs: A list of SportClubs that contain SportClubs of 1 or more sports.
Returns:
An iterable of lists of sportclubs that only contain clubs playing the same sport.
"""
# TODO: Complete the function
clubs_by_sport = {
sport: [
club
for club
in all_clubs
if sport in club.sport
] for sport
in set([
clubs.sport
for club
in all_clubs
])
}
return [clubs_by_sport.values()]
Oops, I replied to wrong post, sorry.
vscode doesn't install anything? its a editor?
I think this is functionally identical
Marketplace extensions might've been what they meant?
it sure is, but it'll be confusing for those who don't know how comprehensions work. I use them for myself, but when I'm coding for others, I stick to for-loops because then I spend less time answering their "wait, wtf?" questions
cant i use terminal inside?
or just terminal itself?
which terminal you use doesn't matter at all
Hmm, I wonder how black would format that....
kk
@faint ermine first code sudo apt-get install libespeak-ng1 it starts with sudo
whats that
how would i install that?
mimic3 only works on linux
oh...
API documentation for the Rust fibers crate.
don't you mean "Fibres"?
I feel like on the premise of this server, whose intent (unless I'm mistaken) is meant to be a resource for those who want to learn python, I must say I dislike the notion that I refrain from showing someone how to use builtins.
If the argument is "something is not known therefore its confusing" (a tautology that goes for anything I'd argue, not just programming/python) is the fright that they might not know it and therefore want to ask about comprehensions/learn them.
Me too
Don't get me wrong, I agree 100%, but sometimes you need to prioritize your time and energy according to what will get the job done fastest
def separateSports(all_clubs: List[SportClub]) -> Iterable[List[SportClub]]:
"""Separate a list of SportClubs into their own sports
For example, given the list [SportClub("LA", "Lakers", "NBA"), SportClub("Houston", "Rockets", "NBA"), SportClub("LA", "Angels", "MLB")],
return the iterable [[SportClub("LA", "Lakers", "NBA"), SportClub("Houston", "Rockets", "NBA")], [SportClub("LA", "Angels", "MLB")]]
Args:
all_clubs: A list of SportClubs that contain SportClubs of 1 or more sports.
Returns:
An iterable of lists of sportclubs that only contain clubs playing the same sport.
"""
# TODO: Complete the function
clubs_by_sport = {
sport: [club for club in all_clubs if sport in club.sport]
for sport in set([clubs.sport for club in all_clubs])
}
return [clubs_by_sport.values()]
So what you had previously
The code will run faster, but it'll take longer to explain.
@faint ermine any tts works with windows? or how can i make this work without a vm?
On a volunteer-only open-for everyone/public community? How do you argue that you need to prioritize your time and energy? I see it in a job situation, but not a volunteer one.
WSL2
The way I do it is do it the non-pythonic way first, just to get the code working, and then show them ways they can improve if they wish to see ways to improve. after all, you can only teach someone who wants to be taught.
Works for me, I just think the intent of comprehensions is more easily understood with the line-breaks I utilized.
Preferences being like assholes, and therefore unique and they all stink, etc/ofc.
=)
focus on getting the person's code working first. then offer to show them how they can make it better. If they are in favor, go for it. If they don't want it, don't force it. It'll make it less likely they'll actually learn something if you do.
A less serious argument, is that your approach (while for some/many more pedagogic), does not follow the Zen of Python.
There should preferably only be one good way of doing it
(not exact quote)
we both know that is true, but that doesn't mean that people who are learning will or want to attempt to follow that.
So in essence, you're spending time/effort trying to help someone to learn, who don't want to learn following the design philosophy of the language they want to learn? =)
Welcome to the corporate teaching process
what about other tts? you know anymore?
Even a small improvement is better than no improvement.
I'm pretty sure I limited my arguments/side of the discussion to
volunteer-only open-for everyone/public community
!zen there should be
There should be one-- and preferably only one --obvious way to do it.
Here
Oh my god
(I'll answer in a sec, I just have to be mad for a moment)
I have to import 66 files individually
One at a time
And it will get imported into the wrong folder
path.glob()?
So I have to then copy it, paste the copy to the right folder, than delete the first one
Nope
It's in a program
I don't have that kind of control
I just have to hurt
My point still stands: "Even a small improvement is better than no improvement."
Besides, purely out of habit I will make the code as Pythonic as I can within the energy constraints of my own disability, and usually end up hoping they absorb the habits through osmosis.
I don't have the energy or time to devote to teaching in a volunteer community the same amount of effort as I devote to my job. So I do what I can, and am satisfied with knowing I helped at all.
i hate doing null checks everywhere in java, just to be sure it's not null
#DontYouWishYouWereOnLinuxAndYouCouldInvokeTheProgramFromTerminalAndThenAlsoScriptTheProcess ๐
Wouldn't help
It's Accounting CS
It's so walled off that I'd need an acetylene torch
Okay, but then I'll be honest and tell you I found your "yes but it'll be confusing for those who don't know comprehensions" disheartened me.
What was the point of pointing that out? Everything is confusing when you don't know it.
Doesn't feel as safe/welcome to try to help others when not specifically/individually asked if that's the feedback I'd get.
forgot to add Java in that joke list
I agree 100%, but sometimes that is the reality we must face. I wasn't trying to say it was a bad thing, just that that's the response you will get sometimes. Also, several times you will get people who simply refuse to learn.
hey, fortran is still useful. try writing the WRF in any other language
Sure, but that doesn't mean you shouldn't use best practice.
You don't shoot yourself in the foot like
yes, [still useful] as all the other ones, but no single language is universal enough
Are you defending your feedback with this? Or moving the goal-post/topic to a new one (that sometimes people don't want to put in the required effort).
Could be you meant something else, but I struggle to interpret it in another way than the first mentioned alternative.
Given the choice, and even more so the energy, I will use best practice every time, yes.
It seems you misinterpreted what I was saying.
Are you saying turing complete is not complete enough? /abject horror /heresy
My teacher gave me homework, can anyone help me? HOMEWORK The function we will write shows that we can reach a sum from the pennies we have with at least how many coins.
will calculate. First of all, our pennies are 1.5, 10, 25 and 50 cents (0,01, 0.05, 0.10, 0.25, and 0.50 cents).
For example: We can reach 1 TL with 2 50 cents or 10 10 cents or 4 25 cents.
The one with the least possible distortion should return us as follows: ๐ฆ
The grammar seems incomplete, and there's no explanation to what "TL" stands for/means.
Do you have any more info to go by?
if anyone want to make some money ๐
๐ฆ
Hฤฐ bro - My teacher gave me homework, can anyone help me? HOMEWORK The function we will write shows that we can reach a sum from the pennies we have with at least how many coins.
will calculate. First of all, our pennies are 1.5, 10, 25 and 50 cents (0,01, 0.05, 0.10, 0.25, and 0.50 cents).
For example: We can reach 1pound with 2 - 50 cents or 10 -10 cents or 4 pieces of 25 cents.
The one with the least possible distortion should return us as follows: ๐ฆ(python) @willow light
@faint ermine brooo ?
"ruby will kill php"
"node will kill php"
"go will kill php"
"deno will kill php"
bye sam
pound
but mark my words, "rust will kill php" ๐
What does this mean? Is it one or two incomplete sentence?
The function we will write shows that we can reach a sum from the pennies we have with at least how many coins.
will calculate.
sorry we use metric here
It is metric, by the definition of currencies not having equivalent SI units.
pounds is imperial measure of weight though
we use newtons
Sterling (abbreviation: stg; ISO code: GBP) is the currency of the United Kingdom and nine of its associated territories. The pound (sign: ยฃ) is the main unit of sterling, and the word "pound" is also used to refer to the British currency generally, often qualified in international contexts as the British pound or the pound sterling.Sterling is...
For example: You have 10.75 pounds of money, when you divide this 10 pound coin by 50 cents, how many 50 cents remain 0.75 cents and how many 0.25 cents are there?
"Error 428"
pound is a currency you can think of it as euro
only one type of coin is allowed to be used simultaneously?
I know, that's what I proved to Clari
Rockstar will kill PHP
๐ซ
"Brainfuck will kill php"

it really should
This is what you want I think: https://brilliant.org/wiki/backpack-problem/
The backpack problem (also known as the "Knapsack problem") is a widely known combinatorial optimization problem in computer science. In this wiki, you will learn how to solve the knapsack problem using dynamic programming. The backpack problem can be stated as follows: Concretely, imagine we have the following set of valued items and the given ...
No, that's 412
okey ,can you help me
well, it's turing complete
"my mom will kill php"
Your mom would kill php ;D
why would anyone carry around 4.88 kg of coins anyway?
no
I don't feel like programming the knapsack problem for you right now, but if you give it a shot/write some code, I'd be happy to give feedback/suggestions.
If you want to know "how many of X can I divide Y into", that sounds like a "dynamic programming" problem to me.
mad one's path: recursion + caching
i can not writing codeeeeeeeee ๐ฆ
found the godel escher bach enthusiast
Modified client or blatant ripoff?
better version
someone help me in #code-help-voice-text ?

prove it
still ill
selfhostable
i prefer elf-hostable. perfect for advent of code
You have my attention
isn't discord, "slack but gamers"?
Though I don't want my infra to be the single point of failure for all my friends
its apparently not quite federated, you can join multiple servers at the same time like in discord, but they're individual instances
Do you have to make an account with each one?
i dont know, haven't tested it

@crisp raven Your video audio is coming through your mic. When you're not speaking, can you please mute your mic so that we don't hear it?
sorry someone told me it was fine before
idk why its leeching through
Fair enough
That's why I moved you down, you're not in trouble it was just easier to do that
all good
You cannot use your existing Revolt login on third-party instances and must create a new account if you wish to use it.
i just need help with a piece of code before heading out #code-help-voice-text
sounds revolting
Already used it
wouldn't that just be a remake of a chevy though
(yes that's a stretch)
lil' bit
For some reason now I'm thinking of a joke I saw... I think it was in MAD magazine? "The Pontiac Actually-On-Firebird"
well, i'm good with stretches. after all, the "come in three days per month" policy only says you have to come in three days per month, but it doesn't specify how long you have to spend in the office during those three days.
so I go in, have lunch, and leave.
Open source user-first chat platform.
Cool
That's what I always hated about federation -- every site being on its own domain so you need a new page for each one
A centralized location where they're all together makes it much easier to grasp
i might be wrong about that, i should probably try things like this before making claims
I'm way to lazy to actually work on it
I was just curious
@late lantern You can talk in here and we'll see it
hello
hmmm
just a thing with my forned
friends
can you help me with python?
await client.tree.sync()
This is not working
works from time to time or never?
@client.event
async def on_ready():
prfx = (Back.BLACK + Fore.GREEN + time.strftime("%H:%M:%S GMT+2", time.localtime()) + Back.RESET + Fore.WHITE + Style.BRIGHT)
synced = await client.tree.sync()
print(prfx + " Logged in as: " + Fore.YELLOW + client.user.name)
print(prfx + " Bot ID: " + Fore.YELLOW + str(client.user.id))
print(prfx + " Discord Version: " + Fore.YELLOW + discord.__version__)
print(prfx + " Python Version: " + Fore.YELLOW + str(platform.python_version()))
print(prfx + " Command synced" + Fore.YELLOW + str(len(synced)) + 'Commands')
never
Ignoring exception in on_ready
Traceback (most recent call last):
File "C:\Users\aviab\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "d:\python\discord bots\NewBot.py", line 14, in on_ready
synced = await client.tree.sync()
AttributeError: 'Bot' object has no attribute 'tree'
what discord.py version?
you need 2.1
I need to make a bot for my fiends so i am using this https://www.youtube.com/watch?v=1geg9VTKhDE
About the Series:
Welcome to my "How to make a discord bot" discord.py bot development series. We will learn how to create a full featured discord bot utilizing the discord.py library. Hope you stick along!
About the Video:
In this discord.py bot development tutorial, you will learn how to use Slash Commands! By the end of this tutorial, you w...
and in this video its working
also, for slash commands you need @bot.hybrid_command not @bot.command
because they have either a new version or an add-on
in the video he is saying that he is using only discord.py
update discord.py
i am trying bit it is saying that i have the last vertion
how do you update?
well
no it's not saying it
The one I have
py -m pip install --upgrade discord.py
not that I can uninstall discord.py from another person's pip on my wish
@vocal basinWorked Thanks
i like having most things in global, so we can use in python repl, but i have like 10 versions of python.. it's annoying
(and, as was suggested, don't use global pip)
!pep 517
@rugged root how can i talk in the VC?
Check out the #voice-verification channel. That'll tell you what you need to know about our voice gate
@vocal basin can you check DMs for a sec?
I'm biting my tongue so hard right now
don't hurt yourself
because of pyproject.toml
how bad?
Python Enhancement Proposals (PEPs)
Python Enhancement Proposals (PEPs)
Python Enhancement Proposals (PEPs)
This was something that could have been solved in Py2 -> 3
the fun part will be (badly) ordering in spanish, because I speak spanish better than they speak english
Hello
hi
don't use threading, use multiprocessing
or write GIL-releasing C extensions
JS is faster than most interpreted langs
interpretable?
also, considering passing your workload off to messaging system and having that process
JS is compiled so yea, not shocked
(yes, my comment was mostly about comparing things like Ruby to things like JS being not really fair)
like, ruby from ~2000 not actual versions
(don't know much about modern ruby performance)
gg dG
build once crash everywhere
one thousandth?
from Austria
same as with Napoleon not being French
well, not Austria
Austria-Hungary
no, quantum are not inaccurate
they're unreliable in different ways
@thin breach
quantum allows running amount of tasks exponentially proportional to qbit count
not linearly
quantum encryption is very old, especially symmetric
reliable post-quantum asymmetric requires using quantum
attempts at making traditional encryption for post-quantum generally fail
SIDH, for example
what do people mean when they say you have to be competitive in software engineering? i thought that right now it wasnt hard to land a job becuase there is a high demand
it matters a little i think
@wintry wasp we don't allow racism in our community
it wasnt racism sir
that book in particular is discredited bunk
that was copy pasted from the internet and was relevant to our conversation
not racism
@graceful grail https://sci-hub.se/https://doi.org/10.1017/S0021932005027069
no somebody else did
Weโve trained a model called ChatGPT which interacts in a conversational way. The dialogue format makes it possible for ChatGPT to answer followup questions, admit its mistakes, challenge incorrect premises, and reject inappropriate requests. ChatGPT is a sibling model to InstructGPT, which is trained to follow an instruction in
i feel like its gonna plateau in popularity
how do you do it
imma do it when i get better
Back in a bit
there are both lower and higher speed limits
Europe is only 15 times larger than Texas
o wait i think i know
I got it
this is the answer to "increase by 12%"
- correct answer
- increase by (14-12)%
- increase by 12%
- increase by 14%
weird; answer 3 is basically the worst
oh whoops
sorry
didnt know you were there
idk some people just go afk
i mustve not heard sorry
can i watch?
was unsure
looked complicated
@pastel jackal ๐
!voice
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@unborn jetty ๐
!voice
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
got it!
may i share something i am working on, would love to hear thoughts, insights, critiques. It is quite small what i am trying to build
I'd like to hear about it!
import tkinter as tk
import secrets as scrt
from PIL import ImageTk, Image
import card_to_image as cti
import poker_generator as pg
root = tk.Tk()
root.title("This is the GUI")
root.iconbitmap("d:/defypoker/logos/DefyPoker_7_.ico")
# get size of the window
width = root.winfo_screenwidth()
height = root.winfo_screenheight()
# set gui size to size of window
root.geometry(f"{width}x{height}")
# make gui background #000c12
root.configure(bg="#000c12")
# start gui maximized
root.state("zoomed")
# display_image()
# display card when button3 is clicked
def display_card():
# get card
card = pg.generate_card()
# get image
image = ImageTk.PhotoImage(Image.open(cti.card_deck_dict[card]))
# display image
image_label = tk.Label(root, image=image)
image_label.grid(row=0, column=0)
# create button
button3 = tk.Button(root, text="Click me to get a card", command=display_card)
button3.grid(row=1, column=0)
# get gui size variable
width = root.winfo_width()
height = root.winfo_height()
# make gui window resizable
root.resizable(width=True, height=True)
display_card()
root.mainloop()
Video game dev is really good to learn OOP aswell
brb
Data science channel is under databases
tyt bro
Opal you working on anything cool atm?
I work at a daycare:
I am trying to make my job easier lol.
The goal of the program is to keep track of supply and demand of an object (aka, diapers).
Each child has a MAIN Storage for the diapers and a backup storage as well.
This object can be called by the name of the CHILD (i guess a list of names).
Not especially.
This object is dynamic. the state changes depending on an input (is the child_name; wet, dry or dirty)
So depending on the state of the object, i will store the result in a dict. Either True or False; or 1 and 0s
True == wet or dirty/ False == dry. 1 == wet or dirty/ 0 == dry.
from the result of the state of the object, a loop will run through the dict and tell the user how many times child_name diaper was changed and also, if more diapers are needed or not once the storage hits a certain level
it will also place timestamps each time the state of the object is updated by the user's input.
Thank you for taking the time to read this, i am new to python but have been enjoying it. I have found programming with lots of IF, ELSE and ELIF limits my ability to implement more functionality in a way that is clean and efficient
how to get permission to speak in voice channel?
!voice
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
one thing with the logic here if wet and dirty are both 'true' you could just make them one variable
got it!
the goal is to be able to know the WHEN of the state of a child's diaper in order to keep track of the supply and demand in that CHILD's main and back up storage of diapers
One thing to add to what opal is saying to simplify -/ when dealing with concept or blueprint use class. If your only performing actions classes may not be need. Also size of program may also determine whether or not its worth it to use classes or not.
for example; Child_X has 10 diapers in MAIN_S and 50 in BackUp_S. If the state of X == dirty 3x, wet 4x, dry 5x in a week then that data should allow a loop to determine how many diapers to subtract , therefore telling the user how many diapers are needed in MAIN_S and BackUp_S
@somber heath so with classes i can create attributes for objects ?
the attributes can be the state of the object ?
mhm interesting
what do you make of this LOL
LOL
Yes lol
it actually is
i want to do it for a classroom of 20 children
then scale it to the entire
school
Corey Schafer, YouTuber, playlists
its mostly for my learning experience. I noticed to know the amount of diapers of a child, one must count manually or wait till there is 0. What if i can automate that with a simple interface
so classes is not the only or ultimately best approach to this issue?
YES!
thank you
SQL?
got it
so first i should design the database
i know the basics
ill get on that this weekend!
if i can make this work and have a simple interface, my co workers will love it!
how do you spell that?
tkinter, pyqt
got it
so Tkinter/django/flask for a web interface hosted on a server
they use apple laptops
i think the app sounds better
ok ok
i think the web based can work, a simple login per classroom
noo i want to go with python
apple lost me as a customer
im going to android
Here is my dilemma, i doubt co workers will utilize the web based program since they already utilize an app called Himama for this purpose, only thing this app doesnt have
is what im trying to program
so either i make easy for them to create entries
or
i pitch it to the Himama corp
as a new feature
present a working prototype LOL
might get a job too LOL
apple
yes
apple phones
apple laptops
this is the app
i will be happy with a web based app for myself at first
thank you!
you gave me something to think about for sure
since i dont have access to the data within the classrooms at all times, i must find a way for them to 1) input the data into my program and the one the school uses(very unlikely) or 2) have them write on a piece of paper for me and i do it myself then tell them the output in a weekly basis. Output being- supply and demand of the diapers
LOL
AHAH
i mean
likes
rt
i have to make it this way: CHILD - ENTRY - 1 == WET OR DIRTY AND 2 == DRY
LOL
true
Is interesting because since i started to learn python, i try to solve inefficiencies with python LOL
like i serve the lunches and i noticed there are lots of leftover food, so thats another program i want to write
with that, i have access to the data ALWAYS
i mean i have thought about using google forms and google spreadsheets
google forms is the interface and spreadsheets is the database + functionality
LMFAOOO
Well it was nice meeting you! thank you for the conversation
i have to get going!
have a great morning, night, afternoon
@idle light ๐
!d typing.Counter
class typing.Counter(collections.Counter, Dict[T, int])```
A generic version of [`collections.Counter`](https://docs.python.org/3/library/collections.html#collections.Counter "collections.Counter").
New in version 3.5.4.
New in version 3.6.1.
Deprecated since version 3.9: [`collections.Counter`](https://docs.python.org/3/library/collections.html#collections.Counter "collections.Counter") now supports subscripting (`[]`). See [**PEP 585**](https://peps.python.org/pep-0585/) and [Generic Alias Type](https://docs.python.org/3/library/stdtypes.html#types-genericalias).
Sorry, an unexpected error occurred. Please let us know!
In emoji_id: Value "trashcan" is not snowflake.```
!d collections.Counter
class collections.Counter([iterable-or-mapping])```
A [`Counter`](https://docs.python.org/3/library/collections.html#collections.Counter "collections.Counter") is a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "dict") subclass for counting hashable objects. It is a collection where elements are stored as dictionary keys and their counts are stored as dictionary values. Counts are allowed to be any integer value including zero or negative counts. The [`Counter`](https://docs.python.org/3/library/collections.html#collections.Counter "collections.Counter") class is similar to bags or multisets in other languages.
Elements are counted from an *iterable* or initialized from another *mapping* (or counter):
```py
>>> c = Counter() # a new, empty counter
>>> c = Counter('gallahad') # a new counter from an iterable
>>> c = Counter({'red': 4, 'blue': 2}) # a new counter from a mapping
>>> c = Counter(cats=4, dogs=8) # a new counter from keyword args
Sorry, an unexpected error occurred. Please let us know!
In emoji_id: Value "trashcan" is not snowflake.```
Hey @bleak bison!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
!e py from collections import Counter things = ["apples", "apples", "pears", "oranges", "pears", "apples"] count = Counter(things) print(count.keys()) print(count.values()) print(count.items())
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | dict_keys(['apples', 'pears', 'oranges'])
002 | dict_values([3, 2, 1])
003 | dict_items([('apples', 3), ('pears', 2), ('oranges', 1)])
!e py from collections import Counter things = ["apples", "apples", "pears", "oranges", "pears", "apples"] count = Counter(things) result = sorted(count.keys(), key = count.__getitem__, reverse = True) print(result)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
['apples', 'pears', 'oranges']
!e py things = {"apple": 5, "pear": 8} a = things["apple"] b = things.__getitem__("apple") print(a) print(b)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 5
002 | 5
!e ```py
class MyClass:
def add(self, _):
return "Hello, world."
mc = MyClass()
print(mc + 7)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello, world.
print(mc.__add__(7))```
hi person
I dont really know what im doing
i just put things together until they work
what are you working on
hi
@narrow nexus ๐
weird. If I open the chat from the voice chat 0, it is read only.
Because we use here, instead.
No.
l=[]
enc=input("Enter Text To Encrypt $:")
key=input("Enter Key for Encryption $:")
for i in range(0,len(enc)):
dec=int(ord(enc[i]))
for c in range(0,len(key)):
deck=int(ord(key[c]))
paskl=(dec*deck)
hexcon=hex(paskl)
l.append(hexcon)
print(l[i],end="")```
!code
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
!indent
Indentation
Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.
Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.
Example
def foo():
bar = 'baz' # indented one level
if bar == 'baz':
print('ham') # indented two levels
return bar # indented one level
The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.
Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines
More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation
a=input("Enter Text To Encrypt $:")
k=input("Enter Key for Encryption $:")
for i in range(0,len(a)):
e=int(ord(a[i]))
for c in range(0,len(k)):
f=int(ord(k[c]))
n=(e*f)
h=hex(n)
l.append(h)
print(l[i],end="")```
!e
l = []
enc = "name"
key = ""
for i in range(0, len(enc)):
dec = int(ord(enc[i]))
for c in range(0, len(key)):
deck = int(ord(key[c]))
paskl = dec * deck
hexcon = hex(paskl)
l.append(hexcon)
print(l[i], end="")
@forest zodiac :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 8, in <module>
003 | NameError: name 'deck' is not defined. Did you mean: 'dec'?
I now know
@olive storm ๐
hello
my friend drew this is school
lol
can you give reccomondation for an easy open source project?
its was first thought of as assasins creed symbol, i think and then he added flowers, but we liked it and i made it my discord profile picture
i want to gain more coding experience, and contributing to github in the process
ohh i did that
sort of haha
are you talking about the discord.py even loop?
event*
ok
ohh ok
yea i worked with asyncio for the first time with when creating discord bots
alright i guess ill be on my way now
Your program will generate output until the user enters a stop word or a number of iterations have happened.
Ask the user for 5 pieces of info:
A stop word that will end the output
A maximum number of iterations that your loop will run
A minimum number for your list of numbers
A maximum number for your list of numbers
A modulo value for your list of numbers
Create a list that has only values that are multiples of your modulo value. The smallest number should be the next multiple of your modulo value that is greater than the minimum number the user submitted, and the largest number should be the largest multiple of your modulo value that is smaller than your maximum number. Note that you can do this all in one command
So if we have these values:
Minimum = 11
Maximum = 28
Modulo value = 5
Your list would be
[15,20,25]
With these values:
Minimum = 14
Maximum = 51
Modulo value = 7
Your list would be
[14,21,28,35,42,49]
After getting the info from the user, output your list
Run a loop that exits if the maximum number of iterations is met, or if the user enters their stop word. The stop word can be case sensitive (i.e., if the stop word is 'done', then 'DONe' does not have to stop your loop). Each time through the loop, choose a number at random from your list and print it. Also print how many runs are left and ask the user if they want to stop.
If the loop runs the maximum number of iterations, print "We are out of runs". If the user stopped the loop, print "You are the boss"
Sample output is below:
Please tell me what word stops the loop: done
Provide a minimum for your list: 4
Provide a maximum your list: 19
Provide a modulo your list: 6
How many runs? 4
List = [6, 12, 18]
Want to start the loop (enter your stop word to not enter the loop): yep
Random list entry is 12
Runs to go 3
Want to keep going? y
Random list entry is 12
Runs to go 2
Want to keep going? ok
Random list entry is 12
Runs to go 1
Want to keep going? yep
We are out of runs
To complete this task, you can use the following code:
# Get input from the user
stop_word = input("Please tell me what word stops the loop: ")
min_num = int(input("Provide a minimum for your list: "))
max_num = int(input("Provide a maximum for your list: "))
mod_val = int(input("Provide a modulo for your list: "))
num_runs = int(input("How many runs? "))
# Create the list of numbers
num_list = [x for x in range(min_num, max_num+1) if x % mod_val == 0]
# Print the list
print("List =", num_list)
# Run the loop
for i in range(num_runs):
# Choose a random number from the list and print it
rand_num = random.choice(num_list)
print("Random list entry is", rand_num)
# Print the number of runs remaining and ask the user if they want to stop
runs_left = num_runs - i - 1
print("Runs to go", runs_left)
cont = input("Want to keep going? ")
# Check if the user wants to stop
if cont.lower() == stop_word.lower():
print("You are the boss")
break
# Print a message if the loop is finished
if i == num_runs - 1:
print("We are out of runs")```
This code will first get the input from the user, then create the list of numbers using a list comprehension. Next, it will print the list and run a loop that chooses a random number from the list and prints it, along with the number of runs remaining. The loop will also ask the user if they want to continue, and will stop if the user enters the stop word. If the loop finishes without being stopped, it will print a message saying that it is out of runs.
# Get input from user
stop_word = input("Please tell me what word stops the loop: ")
minimum = int(input("Provide a minimum for your list: "))
maximum = int(input("Provide a maximum your list: "))
modulo = int(input("Provide a modulo your list: "))
runs = int(input("How many runs? "))
# Generate list of multiples as described above
start = minimum + (modulo - (minimum % modulo))
end = maximum - (maximum % modulo)
numbers = range(start, end + 1, modulo)
# Print list of numbers
print("List =", numbers)
# Start loop
keep_going = input("Want to start the loop (enter your stop word to not enter the loop): ")
while keep_going != stop_word and runs > 0:
# Generate and print random number
random_number = random.choice(numbers)
print("Random list entry is", random_number)
# Print number of runs remaining and prompt user
runs -= 1
print("Runs to go", runs)
keep_going = input("Want to keep going? ")
# Print message
from random import choice
stop_word = input('Please tell me what word stops the loop: ')
min_num = input('Provide a minimum for your list: ')
max_num = input('Provide a maximum your list:')
modulo = input('Provide a modulo your list: ')
iterations = int(input('How many runs? '))
numbers = [number for number in range(int(min_num), int(max_num)+1) if number % int(modulo) == 0]
print(f'List = {numbers}')
finish = input('Want to start the loop (enter your stop word to not enter the loop): ')
for i in range(iterations-1, 0, -1):
if finish == stop_word:
print('You are the boss')
quit()
print(f'Random list entry is {choice(numbers)}')
print(f'Runs to go {i}')
finish = input('Want to keep going? ')
print('We are out of runs')
def factorial(n):
# If n is 0 or 1, the factorial is 1
if n == 0 or n == 1:
return 1
# Otherwise, the factorial is n * the factorial of n - 1
else:
return n * factorial(n - 1)
it took me 3 minutes
why did it take you a month
wow
thats terrible
kindda slow
sounds like ur a boomer
zzz
print out
lol
its 2022
we don't use printers
๐ฟ <- I bet you used these back in your day scrublord
im 14
LOL imagine being over 2 digits old
๐ช this is my impression of you ^^^^^^^^^^^^^^^^^^^^^^^^
@safe pumice @whole bear here is a fun and easy one around 10 lines of code https://www.codewars.com/kata/521c2db8ddc89b9b7a0000c1
def snail(array):
result = []
while array:
# Take the top row of the array
result.extend(array.pop(0))
# Take the right column of the remaining array
if array and array[0]:
for row in array:
result.append(row.pop(-1))
# Take the bottom row of the remaining array
if array:
result.extend(reversed(array.pop(-1)))
# Take the left column of the remaining array
if array and array[0]:
for row in reversed(array):
result.append(row.pop(0))
return result
array = [[1,2,3],
[8,9,4],
[7,6,5]]
# Take the top row
result = [1,2,3]
array = [[8,9,4],
[7,6,5]]
# Take the right column
result = [1,2,3,4]
array = [[8,9],
[7,6]]
# Take the bottom row
result = [1,2,3,4,5,6]
array = [[8,9]]
# Take the left column
result = [1,2,3,4,5,6,7,8,9]
array = []
# Return the result
return [1,2,3,4,5,6,7,8,9]
fast
2005 version @whole bear
@stray niche
LOOK AT THIS @stray niche
Genau
just use for ideas ok sam pls do dis
Yes thanks
@lethal thunder no Sir for Canadians
oh my godddddd
stoppppp
canadianism
Fm
stoppppppppp
brb
cya
hoy
@robust leaf ๐
@fallen heron ๐
!voice
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
to speak
@sharp urchin Down here. ๐
!voice
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@sharp urchin Type down here.
yeh my bad
m actually new to this server
cool.... i get you
i actually am new to pragramming
and learning C at the moment
thank you!:}}
is it?
what language u know?
apart from python?
umm hmmm
yeh....its just that i wanted to hear to what u guys have to talk abt
as m just a beginner
compared to yall
yo
hi
heyyy
bro
keep chat
i mean most of my frnds do be learning python rather than c
Iโm noob
do u study
yehh tru
in college
m from india
i from iran\
compared to C
india for me
you my brother
m learning languages
same 2 u brother
@somber heath are you working in a MNC at the moment sir?
why u donโt want go to Europe for study
alright
or USA
How many languages u Know ?
Where
i am learning C at the moment
u build
i will soon shift to PYTHON once m done with C
What Score your college ?
US
i am cuurent in a uni with qs ranking arnd 1300
Keep your chat with me brother
so maybe i can call u a master in python? @somber heath
u Wants to go Big Company
it would be bttr if u msg me?
So Hard
you sound so philosophical !!!! which is really nice @somber heath
Not Good
Iโm Noob
i belong to a country where we talk abt being a master or a professional @somber heath
I Think ๐ญ not here
I think therefore I derp
Ayo
On in a sec, having to restart my rig
How was your project
Talk more in a sec
agree
Woo what
Bro how old are you?
What do you mean brother?
well if you see the world population then there is a Z graph
You back
where it satrts to decrease after some time
Glad to see you. Again
i can assure that
For a given value of back
@whole bear You can talk to us in here
Who is this guy
What project were you referring to, Hat?
How are u bro!?
Yes
Hey
Me
Bro
Yes?
Glad to see u bro
wdym?
@limpid night ๐
Happy to see u bro
I'm okay I think
What happened bro
Ok
Just busy at work
That's hard to send 50 message
yall work?
Who
Do you work as a software engineer?
People manage.
I do not. I'm administrative support at an accounting firm.
Most of what I do lately is IT
Anyway i try
Oh, I see
๐ญ
What's your country
I'm in the US
Ooo very Nice my freind
How u become software engineer
Self study
Or college
No idea. We've got people who've done it from both angles
Although in most cases, having a degree is going to give you a slightly better chance
Which is better my friend!!
Depends where you are, how much experience you have, etc. #career-advice will have more info than I
U first finish the university
I am still studying in middle school
After u self stydy
cool
Bro what's your country
Could I please asking u
Malaysia, I am actually about to move to Canada
How old are you
How many time u in Canada
14
WIth Family
Cool chance you have
Thanks, I gtg and sleep its nighttime at my place now
Why sleep
Could i Please send you friend request
Sure
TNX alot
And could i please i have you. Number!?
uhhh
Why are you asking for someone's number?
Not really appropriate
hi vc0
Suuuup
It is not
hemlock dis ur car?
u sure?
Jeremy Clarkson puts Toyota's claim that their Hilux pick-up is virtually indestructible to the ultimate test. Top Gear series 3, episode 5. Subscribe: http://bit.ly/SubscribeToTopGear
WATCH MORE:
Chris Harris Drives: http://bit.ly/ChrisHarrisDrives
Drag Races: http://bit.ly/TGDragRaces
Car Walkarounds: http://bit.ly/CarWalkarounds
Welcome ...
Part two of three. Having been drowned, bashed, smashed and set on fire, is there anything that can kill the seemingly indestructible Toyota Hilux? Well, James has an idea...
Subscribe for more awesome Top Gear videos: http://www.youtube.com/subscription_center?add_user=Topgear
Top Gear YouTube channel: http://www.youtube.com/topgear
TopGear.c...
Part three of three. It's the moment of truth as the final countdown begins. Can the Toyota Hilux possibly survive a 23-storey drop?
Subscribe for more awesome Top Gear videos: http://www.youtube.com/subscription_center?add_user=Topgear
Top Gear YouTube channel: http://www.youtube.com/topgear
TopGear.com website: http://www.topgear.com
Top Ge...
ur car scrublord
5 0 8 6 5 0
thats a good car
Thought this was your car, Scrub
dis ur car hemlock?
those doors were hard to open
Mr Hemlock have you been doing this years Advent of code?
dis ur car @trail mural
seems compact
dis u @trail mural
cursed๐
kinda like this
I did the first one, I haven't had time to do the other ones. Hoping to knock some out later today
I am enjoying the stories
We are the weirdest podcast
@gentle flint What's up?
Sorry
Linky?
it's in Dutch
I've got google translate
So it can absolutely butcher it
read the reason why they refused it in the first place
Volgens RTV Oost weigerden verschillende huurders de apparaten uit vrees voor spionage of straling, omdat ze binnen wilden roken of omdat ze de ernst ervan niet inzagen.
i understand noiw
dis urs?
https://en.wikipedia.org/wiki/Alice's_Adventures_in_Wonderland @lethal thunder
virus?
sus
Uh.... huh
"girl named Alice who falls through a rabbit hole into a fantasy world"
scsry link
It occurs to me that "rust" can be pronunced both "rust" and "rusty".
what?
ants?
that does not make sense @somber heath
It's a reference
@gentle flint back so soon?
Hey Sammy
Heyyy
Got your phone calls out of the way?
all fingers and toes intact?
10 more, but it's 9pm, so will continue tmw
Eh, joint is swollen on the finger. Think it's a weather thing this time around
ahh
did you know Elon musk founded OpenAI
I asked wrt not having your jacket and freezing off
It's a weather pressure not temperature thing
ah
We've got storms and rain coming in, so low pressure front
handy knees!
Yooo
hehehe 9 am :3
whut
Yooooo
when did you wake up
I was trying to tire myself out so
hmm
12 pm
you shouldve tried harder
whut. 3 hours
Just make sure you don't try it on a bike. Otherwise you'll end up two tired
I tried not to laugh..i really did but these are too good xD
is alrighttt, I can sleep early tonighttt
ye
hemlocks jokes 10/10
yes
๐ฏ
Jesus it really has been a long time since I had to take my driver's test
You only take the once right?
unless you drive very recklessly
hehe, you might have to redo it then
I meant you as in specifically you
not the general you
old man
i convinced chatGPT it's the hitler, it went completely of the rails
it started rapping kanye
Not having that garbage, even as a joke, on the server
yes, mine too
messed up
Why? You're the one who took your time to create it in the first place
i never imagined it would go that far
well no shit
it does what you tell it to
what is chatGPT
i couldn't recreate again... it has pretty good protections
You should come to Indian prison
have you been?
A phrase I didn't think I'd read today
Yes
it just went off the rails...
cool
your point being, dunnu?
nothing tbh