#voice-chat-text-0
1 messages ยท Page 115 of 1
Ah right. Leetcode?
Btw, is anyone speaking? I can't hear anything.
Thanks
What kind of math? ๐
Depends on the context I think.
Cya
I miss the context, can you explain why that's different than common python syntax
Moostafa ๐
logger := log.New(os.Stdout, "INFO: ", log.Ldate|log.Ltime)
You can then use the logger to write log messages using the Print, Printf, and Println functions. Consider this PrintIn log message:
logger.Println("This is an info message.")
It will produce this output:
INFO:2023/02/17 14:30:15 This is an info message.
@limpid cove
Llongfile
logger := log.New(os.Stdout, "INFO: ", log.Ldate|log.Ltime|log.Llongfile)
@whole bear That happened like, what, a decade ago?
2020
@somber heath
This is a rhetorical question, but what the fuck happened to time?
A 2017 documentary, The Problem with Apu, written by and starring comedian Hari Kondabolu, criticized the character as a South Asian stereotype. In January 2020, Azaria reacted to this by announcing that he and the production crew of the series agreed for him to step down as the voice of Apu. The final time that Azaria voiced Apu was in the season 29 premiere "The Serfsons" in 2017; since then, Apu has appeared as a background character.
anyway
i guess not fully cancelled.
why i cant talk
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
lol I don't have enough messages to voice verify
how do i check my message amount lol
not that I know of
it says less than 50 messages
huh, I swore I had more than 6 lol
no
Yeah, I'm pretty sure I only talked in help channels
In old ones
I don't really use the help channels anymore because I'm smart enough to read docs lol
big cringe lol
Can you give me the role?
It's probably just the role that gives perms
Twisty has the strat
@lavish rover what lang is that?
I don't recognize .ae
!e ```py
class MyClass:
def enter(self):
print('Enter')
def exit(self, exception_type, exception_message, traceback):
print('Exit', exception_type, exception_message, traceback)
with MyClass() as thing:
pass```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Enter
002 | Exit None None None
It's Python.
Everything is an object.
Except for the syntax and whatnot, and even some of that is objects in disguise.
I need to get on mustafa's level
Hello
That's crazy
Are you implying that you're not supposed to leak classified documents for minecraft clout?
rip
I feel that. I'm old too
I feel younger building apps though. Programming keeps the brain stronk
That's pretty variable.
I'm in my 30s OOF. That's like ancient in Discord
Hello guys
@verbal zenith , @somber heath hello
@lunar haven hello
i didn't notice you
doing not grrat
the first sha with a but the next one a is not spelt
a more of a int the first one
first one
yup
my delivery partener is not giving my cod remmitance
he is such BI&&h
The delivery partner collects in the from of cash of delivery and giving it to mer
will like to compete in some clash of code
then please create a link all languages and reverse
here you go
any one else coming
don't do that @lunar haven
@lavish rover will you like to join
so i start @verbal zenith
i will not do
the quesiton scared me
yup
do anyone listen to neffex
share your code
@verbal zenith
@whole bear wanna join
yeah
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
first time i play this game
@verbal zenith can you share the code
what the hell is that
one liner
just have a look at my code ans score
!e
x = "1001"
y = "0110"
print("".join([max(a,b) for a, b in zip(x,y)]))
and
@verbal zenith :white_check_mark: Your 3.11 eval job has completed with return code 0.
1111
!e
code
!eval [python_version] <code, ...>
Can also use: e
Run Python code and get the results.
This command supports multiple lines of code, including formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.
By default, your code is run on Python 3.11. A python_version arg of 3.10 can also be specified.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
no i will know
don't do that
i can not understand python often then you
will do that in cc
should i start next
should i start
that was stupid
i was sumb
that was so fucking stu[id
i am fucking mad
who made the code
challenge
there no way to increase the dificult
no
becaus i want to do that
from the next one
you con't
@Yu/AF
yup
golf meaning
my browser lagged like hello
hell
i gave up
i forgot to remove the comment also
@lavish rover @verbal zenith how long have you two been in vc
I have gone to sleep and woke up and you two are still in vc
Hey guys, i've been listening for a few hours, since mustafa was playing with what looked like a raytracer or some other nifty algorithms.. I'd say stuff, just don't have anything particularly fruitful atm (as I need to sleep lol)... Did want to say hello though ๐
I woke up
oh, it's shortest
yes, I didn't optimise lol
map is shortest, as far as I remember
I have an idea
but it doesn't work
I'm too unable to think further for now
oh, didn't think of that
because it breaks the behaviour
some testing systems will kill you for that
you get an exception but it accepts it anyway ๐
:= is making it worse
(I was assuming that)
oh, it shows code size in the editor
isn't it UB in C?
I don't remember what specs say
(bitshifting negatives)
it is
it's defined in python
properly
!e
print(-3<<2)
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
-12
next one after you're done: https://www.codingame.com/clashofcode/clash/30282901b29ed54be764bad6b7846ea41f7a4c6
it would be 49 if not for )for
idk where it went wrong on the server
ohno
I know maybe
how to improve mine
such a dumb way
nvm it's same number
wait
I'll try
it's not
print(f"{m} 1 12 7\n11 8 {m-1} 2\n5 10 3 {m+2}\n4",m+1,6,9)
this is closer
commas not spaces
also, one {} less
print(f"{m} 1 12 7\n11 8 {m-1} 2\n5 10 3 {m+2}\n4",m+1,6,9)
print(m,f"1 12 7\n11 8 {m-1} 2\n5 10 3 {m+2}\n4",m+1,6,9)
so do you guys like know how to make a python app a .app or a .exe file
if you do let me know
and ping me
still need "" for \n
what is """ and \n
print(m,f"1 12 7\n11 8 {m-1} 2\n5 10 3 {m+2}\n4",m+1,6,9)
print(m,1,12,7,"\n",11,8,m-1,2,"\n",5,10,3,m+2,"\n",4,m+1,6,9)
so do you guys like know how to make a python app a .app or a .exe file
if you do let me know
and ping me
print(m,"1 12 7\n11 8",m-1,"2\n5 10 3",m+2,"\n4",m+1,6,9)
so do you guys like know how to make a python app a .app or a .exe file
if you do let me know
and ping me
there was a clever solution
but
it's 35
print(581-sum(input().encode())<<2)
because it strips
this passes tests
but it's long
omg it's equal
input().encode()
map(ord,input())
so do you guys like know how to make a python app a .app or a .exe file
if you do let me know
and ping me
if x is "s":
i wrote this
and it was not case sensitive
still worked
didn't know that
in short, don't
so how me make script a app
i dont get it
Hi guys, can you share the link which question you are trying?
can't speak have to send 50 + msg
.
oh we have to do in shortest line, does next line count's as a character?
as found out earlier
Clash of code... what is that? Is that like a coding game or something
yes
Sounds fun. Is it competitive?
questions are not like real world problems but looks fun.
there are three modes
fastest: first to solve
reverse: same but you only know the tests not the problem statement
shortest: solution with least bytes
reverse sounds interesting
so do you guys like know how to make a python app a .app or a .exe file
if you do let me know
and ping me
some are more realistic
but, yeah, competitive programming is quite detached
stop spamming.
So it encourages test driven development in conjunction with optimized development practices. That's like a wet dream got damn
this is not TDD
converting python to one single exe is wrong
I suppose so, I'm on linux tho so i haven't really got that good of an idea
you're probably right; i have no idea what clash of code is
TDD is quite a specific technique
red-green-refactor loop with smallest steps possible
clash of code doesn't encourage "best practices" in any way
I played 4 in the open pool
I suppose I got the whole 'best practices' thing because I thought less means more efficient. It's now I realize that's not the smartest thing to say
4/4 might be affecting it
I suppose though in some ways, less can be better, but not in all cases.
grammar error in the task
is 1231 counts 2 changes or 3
no, but the idea for this chat is that if you don't have voice perms you talk here.
for voice chat.
not for general convo
it's normal for voice regulars to have generic/offtopic text conversations in chats associated with VCs
is 1231 counts 2 changes or 3 anyone?
I haven't the slightest idea what you mean
(this one is python-only)
i want to make a python app into a exe or a .app file so it can be run as a file or a normal app
Please stop spamming. If you need help, please create a thread and wait patiently, but do not spam
haha, had to search how to print integer last time coded in C was in cllg.
epic restart for some reason
@knotty echo๐
yo
could have saved more (left a space and extra colon)
waiting for yuu answer with assist.
i think i should have taken time( forgot that we could take input like that)
welcome to c
it takes more time to remove code and spaces then to actually write
it's ascii so can make it at least 13% smaller
there was an attempt in python earlier
my most of the time went into how you guys did into 64 and mine was 66 then realized the extra char in formula
closer to 18% actually
after this i am gonna compress production code into 1 line no space
go hell with readability haha.
well one question how the program was compiling when we remove stdio.
it is required for input?
oh understood.
how sad will this be
never did in Rust.
oh, now I realise I never implemented taking input in Rust
ig there will be template code
In this video we learn how to do fingerprint matching in Python.
Apply For AI Camp: https://ai-camp.org/partner/neuralnine/
Kaggle Dataset: https://www.kaggle.com/ruizgara/socofing
โพโพโพโพโพโพโพโพโพโพโพโพโพโพโพโพโพ
๐ Programming Books & Merch ๐
๐ The Python Bible Book: https://www.neuralnine.com/books/
๐ป The Algorithm Bible Book: https://www.neuralnine.com/bo...
i gave up.
have you guy ever tried the bot challenge looks interesting?
.unwrap on readline is unnecessary
should try something like Perl or Haskell/Clojure at some point
how many language do you know
I know nothing about actual Perl programming
besides regex
2:42 timing wasn't intentional
I did think about sep
(but 42 character count was)
how my one is going above 42._.
print("\n".join(["+"*n]*n))
join is too verbose
I knew about sep being smaller than join
join is better when you have to have generator comprehension
forgot could use sep._.
because generator comprehensions sometimes don't require extra parentheses
"lwoisness", state of beng lwoisous
hmm
else " could be else"
well you would be still ahead
it works when length differ by at most one
* lengths
usually applied to Yes/No
ig there might be some benefit from input being an integer
but I don't see any
if if there's only 1000 tests, they are varied enough to catch inaccuracies
@whole bear๐
how do you come up with this
lol I didn't think of //
could improve what I did ig
print(round(.5+int(input())**2*3**.5/4))
print(-int(int(input())**2*3**.5//-4))
print(int(1+int(input())**2*3**.5/4))
or just int(1+...)
I did consider it
but I forgot it actually works
because intermediate result can't be an integer
both inside and outside should be fine
hard-coding 3**.5/4 doesn't save enough characters
0 was excluded from the input space
everything else is rational (because integer)
rational (!=0) times irrational is guaranteed to be irrational
therefore ceiling is always higher than the floor
so, conceptually, +1 solution is correct
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
mine is at 26 dk how to get it to 24
@hot roost๐
bit shifts have different priority compared to **, quite inconvenient for some code golf problems and helpful for other ones
no useful information in these embeds
I forgot
can't see how can i beat you.
how do I resign this challenge, I failed
I=input
I(int(I())*int(I())//60)
this is smaller by 4 bytes
damm
print(int(input())*int(input())//60)
i=input;i(int(i())*int(i())//60)
where is the 4th byte?
wait
/60)
nvm I can't count
haha
I think I'm dyslexic I saw the second / as being on top the paren
idk if it's GPT 3 or 4 but the way it's wrong might be interesting
https://gist.github.com/afeistel/4536a26fe2aed76b6127c62692e5c2f6
@steel plume๐
I will wait for it to auto-start
JS bundlers do code-golfing in some sense
without losing performance, though
this produces mistakes similar to how a person might misunderstand same concepts
this is output of some model idk which one
whatever phind.com uses
I saw someone use the site and decided to test how it would respond
at least code golf allows to put an extra newline at the end
there needs to be some sort of analogue to rustlings but for software architecture problems
with problems being more proper services or parts of those (in containerised form)
but that takes some time to prepare
the a real way to get this experience except for containerisation is:
go to GitHub
pick any project
experiment with it
this is an option, at least
this isn't smart, it's clever
codewars, for example, has two ways to rate a solution
best practices
clever
I prefer expressive one-liners over cryptic one-liners
like, the code should read as an obvious solution to the problem
or, at least, an obviously valid one
an important goal of programming is to simplify the systems we build
to express solution as some clear primitive thing, not as an unthinkable mess
how did you do that "yneos" forgot
another reason why introducing AI into this requires precautions
like
teaching AI to understand this too is important
or demanding this from AI-produced solutions
"roughly somewhat passing tests" shouldn't be the only metric of acceptance for software
AI on its own might start thinking so too
map returns a object right, it unpacks too oh ok did not know that
Python map? Yeah. It returns a lazy iterator.
if this view benefit human programmers, it might benefit AI "programmers"
* benefits
A lazy iterator doesn't compute the elements until the for loop or list/tuple/set/etc casting asks for each next element.
"lazy iterator = iterator" generally
well normal iterator also does not compute unless next is called
Mm. Fair point.
lazy:
objects yielded are created during next() call
this is a very unreliable definition but still
Hello there!
there is a better and shorter solution for higher powers
sadly, too long for this problem
should be optimal (in size) starting with 4
or with arbitrary power
haha
yes, for **2 it's more optimal just to self-multiply
I don't put a lot of faith in higher powers.
Well, I suppose it depends on your definition.
this is how it'd look for the current task
print((x**4-x)//(x-1))
more confusing, object are created during next call well then how the iterator object was made which contained next method
i read it wrong i guess
this gives 36 total
:= generally doesn't help
what is the command to verify voice?
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
for _ in'_'*int(input()):print((x:=int(input()))+~x%2) i give up what is this wizardry
~x%2 gives 1 for even, 0 for odd
c|((c&1)^1) made it complex lol
I started participating in clash of code a month ago, I think
before that I was a competitive programmer for something like 4 years
there performance and correctness matters more than speed of writing and length of code
i guess from cp you are getting the calculation tricks
there are some optimisations which help to pass tests at the cost of general correctness
also, those competitions usually allowed submitting code something like 50 times
limitation was only because of compute power the servers had
~ takes precedence over % seems like
!e
print((~4)%2)
print(~(4%2))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1
002 | -1
usually required knowing C++ and Python
never used walrus in python
i=input() wastes space if you call i less than three times
input();input();
i=input();i();i();
it helps if and only if you can use it without extra ()
so, mostly, single-argument function calls
I can start it later with all languages
right now it's only python
this one is targeted at languages like C
certified "addict" in two games
minesweeper has more valid requirements for that achievement
(not completed yet because it's seasonal)
doing [-2:] doesn't matter
because python is fast enough with this
if(len(n)> 2): too
if len(n) > 2:
n = n[-2:]
is equivalent to
n = n[-2:]
comments don't really improve readability
better function/variable/class names are better
comments are not universally good
write documentation not comments
if code cannot be understood without comments, it's usually bad code
there are some exceptions to that
(for example, complex algorithms)
or books
at least, examples of how to use the code
!d docstring
A string literal which appears as the first expression in a class, function or module. While ignored when the suite is executed, it is recognized by the compiler and put into the __doc__ attribute of the enclosing class, function or module. Since it is available via introspection, it is the canonical place for documentation of the object.
math.fsum(iterable)```
Return an accurate floating point sum of values in the iterable. Avoids loss of precision by tracking multiple intermediate partial sums:
```py
>>> sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1])
0.9999999999999999
>>> fsum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1])
1.0
``` The algorithmโs accuracy depends on IEEE-754 arithmetic guarantees and the typical case where the rounding mode is half-even. On some non-Windows builds, the underlying C library uses extended precision addition and may occasionally double-round an intermediate sum causing it to be off in its least significant bit.
For further discussion and two alternative approaches, see the [ASPN cookbook recipes for accurate floating point summation](https://code.activestate.com/recipes/393090/).
this has usage examples
from what I understand those don't come from docstrings
they come from the external tool used for docs
Sphinx specifically
docstring goes only as far as this
!e
print(int.__doc__)
eh
not enough lines
!e
doc = int.__doc__
print(doc[doc.find('>>>'):])
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | >>> int('0b100', base=0)
002 | 4
I wonder if Sphinx knows how to parse it
@somber heath hello
idk how it works then
@whole bear๐
hello
@whole bear hi
why i can't speak
it's different from many other social platforms
this is your real room
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
then can you give me one mointor
.5 of a monitor
!voiceverify
naw. somehow i need them
now reconnect
ok
all of them
nice
five on fve
@somber heath just want to ask one thing
how to tell my parents that
i am talking to stranger on internet
and if they don't know even the I of internet
then will they not listen when i talk
they are in same house
the mentality of them is this
that i must be talking to some terrorists
online
> mostly safe
of al-kayda or something
@somber heath how do you know that
the risk of telling my parents is that maybe they will allow me to talk or they will stop me from texting also
@somber heath
so what sould i so
explain benefits of such communication to them
@whole bear๐
i will tell them 1 and half year later or something
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voice
here i showed them
they said that it was not something they would like
gui version
yup
where do i type it ?
well, that seems like specific issue of the game
if this version of this word game isn't accepted locally, should probably avoid that
anyways gonna drink some energy drink and then tell thme
that
i wnat to talk to some strange people
can i or not
i am a 14 year old boy
yup
that's the only problem
they are the geneartion of no technology
the problem is that
my mom is asleeop
i will ask them after showing them the term one result and scoring good marks in themn
for being capable in India you need only one thing
money
and i don't have that now
that was a good advice
already started from my lifetime pocket money
and they are angry at that alo
they are angry that i spent money
the investment
yup
have a look
impressive
yeah
that was funny
just started the firsst pay check coming tomorrow
it is like rs. 2202
$27
this not the matter
they are not going to check that if it is good
agreed
i am going to die there are mosquitoes everywhere
so how the website performance @whole bear
Elon Musk has entered the chat.
quite a lot of people pulling out don't even know that
so no
also, he's very fond of stealing others' success
@faint magnet๐
if anything, he's inherited wealth from people who'd exploited African people
so eh
Yaas.
@somber smelt https://i.imgur.com/S6iW9Kw.png
@whole bear๐
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
```
Stuff goes here
```
This, then.
how do i do that?
open this
paste code there
then save button
then copy the URL and send here
import speech_recognition as aa
import pyttsx3
import pywhatkit
import datetime
import wikipedia
listener = aa.Recognizer()
machine = pyttsx3.init()
def talk(text):
machine.say(text)
machine.runAndWait()
def input_instruction():
global instruction
try:
with aa.Microphone() as origin:
print('listening...')
speech = listener.listen(origin)
instruction = listener.recognize_goggle(speech)
instruction = instruction.lower()
if 'akai' in instruction:
instruction = instruction.replace('akai', '')
print(instruction)
except:
pass
return instruction
def play_akai():
instruction = input_instruction()
print(instruction)
if 'play'in instruction:
song = instruction.replace('play', '')
talk('playing' + song)
pywhatkit.playsonyt(song)
elif'time' in instruction:
time = datetime.datetime.now().strftime('%I:%M%p')
talk ('รurrent time'+ time)
elif 'date' in instruction:
date = datetime.datetime.now().strftime('%d /%m /%Y')
talk('Today the date is'+ date)
elif 'how are you' in instruction:
talk('I am having some trouble with renewing my code but do not worry, how are you doing if you do not mind me asking?')
elif 'WHat is your name' in instruction:
talk('My name is Akai, What can I do for you?')
elif 'who is' in instruction:
human = instruction.replace('who is', '')
info = wikipedia.summary(human, 1)
print(info)
talk(info)
else:
talk('Could you please repeat that, I did not receive your comment very well')
play_akai()
is this all code?
yep
import speech_recognition as aa
import pyttsx3
import pywhatkit
import datetime
import wikipedia
listener = aa.Recognizer()
machine = pyttsx3.init()
def talk(text):
machine.say(text)
machine.runAndWait()
def input_instruction():
global instruction
try:
with aa.Microphone() as origin:
print('listening...')
speech = listener.listen(origin)
instruction = listener.recognize_goggle(speech)
instruction = instruction.lower()
if 'akai' in instruction:
instruction = instruction.replace('akai', '')
print(instruction)
except:
pass
return instruction
def play_akai():
instruction = input_instruction()
print(instruction)
if 'play'in instruction:
song = instruction.replace('play', '')
talk('playing' + song)
pywhatkit.playsonyt(song)
elif'time' in instruction:
time = datetime.datetime.now().strftime('%I:%M%p')
talk ('รurrent time'+ time)
elif 'date' in instruction:
date = datetime.datetime.now().strftime('%d /%m /%Y')
talk('Today the date is'+ date)
elif 'how are you' in instruction:
talk('I am having some trouble with renewing my code but do not worry, how are you doing if you do not mind me asking?')
elif 'WHat is your name' in instruction:
talk('My name is Akai, What can I do for you?')
elif 'who is' in instruction:
human = instruction.replace('who is', '')
info = wikipedia.summary(human, 1)
print(info)
talk(info)
else:
talk('Could you please repeat that, I did not receive your comment very well')
play_akai()```
!code
try:
...
except: #"Bare except"
...```
try:
...
except IndexError: #Just as example
...```
wait so all exceptions are not working?
!d traceback.print_exc
traceback.print_exc(limit=None, file=None, chain=True)```
This is a shorthand for `print_exception(sys.exception(), limit, file, chain)`.
got it i think
try:
...
except Exception:
traceback.print_exc()
if exception happens, it should later fail with NameError
so idk if the issue is with except: if there's no output
there is absolutely no output at all and the program just stops, right?
yea
not even "listening...", right?
yea
how are you launching the code?
yes, what do you do to run it?
is it by calling python script.py (or whatever filename there might be) from CMD?
@glass ferry๐
nope
what IDE are you using?
(if any)
import datetime
from logging.config import listen
import traceback
import speech_recognition as sr
import pyttsx3
import webbrowser
import wikipedia
import wolframalpha
these
I don't mean how your program begins
I mean how do you run it
how do you make it run
do you press a start button?
what IDE is this?
visual studio code
the program you sent before seems to have different imports
if you move print('listening...') before with block, does it print anything then?
so, it says something at least
def input_instruction():
try:
with aa.Microphone() as origin:
print('listening...')
speech = listener.listen(origin)
instruction = listener.recognize_goggle(speech)
instruction = instruction.lower()
if 'akai' in instruction:
return instruction.replace('akai', '')
else:
print('no instruction recognised')
exit(-1)
@calm hearth๐
spiders
oh
IndentationError: unindent does not match any outer indentation level
indentation error means " " error u need to add some space
terminal-based - look at things like ansi escape sequences/colorama
tkinter - ux/ui development. standard library. It comes with Python
pygame - For purpose game dev framework
why we can print space
oh I see
why your keyborad is not able to print only space button
what space needs to be added?
!e py print(len('\n'))
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
1
actually what's the purpose of using 'f' here?
!f-string
Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.
>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."
Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.
!e py age = 20 name = 'Peter' print('Hello, ' + name + '. You are ' + str(age) + ' years old.') print(f'Hello, {name}. You are {age} years old.')
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello, Peter. You are 20 years old.
002 | Hello, Peter. You are 20 years old.
lol how do u know about that i am 20 yrs old
!e py 'abc' + 123
@somber heath :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | 'abc' + 123
004 | ~~~~~~^~~~~
005 | TypeError: can only concatenate str (not "int") to str
what does that suppost to mean
!e py 'abc' + str(123)
@somber heath :warning: Your 3.11 eval job has completed with return code 0.
[No output]
We see here the operation worked without errors.
Any questions?
math is not a function
it's a module/package/library, not a function
oh
!d math
This module provides access to the mathematical functions defined by the C standard.
These functions cannot be used with complex numbers; use the functions of the same name from the cmath module if you require support for complex numbers. The distinction between functions which support complex numbers and those which donโt is made since most users do not want to learn quite as much mathematics as required to understand complex numbers. Receiving an exception instead of a complex result allows earlier detection of the unexpected complex number used as a parameter, so that the programmer can determine how and why it was generated in the first place.
Unless of course you write a function and name it math.
I was asking if you had any questions about f-strings.
there isn't any particular "how to use it" besides how to import it
import math
anything more concrete involving specific functions is very usecase-dependent
I had cleared them out
ofc
but
I don't understand.
!random
(Yuu trying very hard not to repeat the word "specific" but failing)
I mean I don't have any problem regarding the "f" string
Yes.
But it is not a standard library module.
Meaning you have to first install it into your environment before you can import it and use it in Python.
for simple applications pygame provides access mainly to the following two things:
event handling
image/sound output
event handling is responsible for keyboard, mouse, etc.
okay
and "image output" being game screen
can it be related with game developing sort of things like that?
most "game engines" are more general than just game development tools
this two things aren't the whole extent of pygame functionality
what do you mean by general?
some visualisation/modelling which isn't exactly a game can be done with game engines
what you find can there, for example, is some tools responsible for loading assets
okay
Unity/Unreal are often used for physic simulations, for example
those are engines,right?
Unity and Unreal Engine
yea
how to add exceptions in python
raise existing ones or declare new ones?
declare
class CustomException(Exception):
pass
class CustomError(Exception):
pass
@whole bear๐
okay
cause its a part to talk instead writing maybe?
it could've been 8...
most of the hard parts of minesweeper is just probability theory
with keyboard args
kwargs may be somewhat complicated in python compared to some other languages
def example(
postional_only_argument,
postional_only_argument_with_default_value=default_value,
/,
argument_that_can_be_used_both_positionally_and_via_keyword_with_default_value=default_value,
*,
keyword_only_argument,
keyword_only_argument_width_default_value=default_value,
):
pass
def example(
postional_only_argument,
/,
argument_that_can_be_used_both_positionally_and_via_keyword,
argument_that_can_be_used_both_positionally_and_via_keyword_with_default_value=default_value,
*,
):
pass
def example(
*variadic_arguments,
keyword_only_argument,
):
pass
def example(
*,
keyword_only_argument,
**variadic_keyword_arguments,
):
pass
"keyword arguments" refers both to optionally positional arguments and keyword-only arguments
i.e. it is more about how you pass the arguments
Comprehensive.
and not how you declare the function
nothing bro!
Sleep
why
(that was a response to VC question not the text chat)
for good sleep
and this too was response to VC
this has nothing to do with time.
mustafa has experience with Clash of Code
he has 1000 games at least
I have around 130
minutes not hours
depending on round length
i just got scared at first, cuz i thought it was py as i started learning recently and couldnt read the code
nvm
lol
how long have u been coding for?
sorry i didnt hear u , how long have u been coding for?
repeat, implementing debugging or debugging something already existing?
namespaces then debugging
namespaces will make things easier
e
power cut
brb
back
does Video have any other functionality?
good way to refactor this architecture would be to avoid doing IO in the initialiser
fields currently set during __init__ and set_boxes should probably be arguments passed to __init__ intead
with current implementation of __init__ being transformed into a factory method
and set_boxes returning a value instead of setting the field(s)
it's probably not performing better, it's just doing different things
taking this as a principle should be able to guide the development process
What's the problem at hand?
where are you calling Video methods outside Video class itself?
sorry for my bad english :((
so, nowhere, I guess
that shouldn't be a class construction
that should be a function call
if user_confirmation == 'yes' or user_confirmation == 'y':
i think it
what does Video(inpf, outf) do?
!d in
6.10.2. Membership test operations
The operators in and not in test for membership. x in s evaluates to True if x is a member of s, and False otherwise. x not in s returns the negation of x in s. All built-in sequences and set types support this as well as dictionary, for which in tests whether the dictionary has a given key. For container types such as list, tuple, set, frozenset, dict, or collections.deque, the expression x in y is equivalent to any(x is e or x == e for e in y).
For the string and bytes types, x in y is True if and only if x is a substring of y. An equivalent test is y.find(x) != -1. Empty strings are always considered to be a substring of any other string, so "" in "abc" will return True.
it's copying samples from one file to another, right?
then it should be copy_samples(inpf, outf)
Video(...) doesn't mean "copy samples from one place to another"
In short...
a in b```
then copy_video_samples()
thanks ;))
or .startswith
or whatever it is
I forgot
!d str.startswith
str.startswith(prefix[, start[, end]])```
Return `True` if string starts with the *prefix*, otherwise return `False`. *prefix* can also be a tuple of prefixes to look for. With optional *start*, test string beginning at that position. With optional *end*, stop comparing string at that position.
"Yeah, nah."
"Yuck"
Mine is a stupid dissent.
Will your classes ever be going to the lavatory?
@lunar haven
Toilet.
Loo.
def copy_video_samples(ipath: pathlib.Path, opath: pathlib.Path) -> None:
with ipath.open("rb") as ifile, opath.open("wb") as ofile:
VideoCopyContext.from_files(ifile, ofile).copy()
oof
Hello
class VideoCopyContext:
@classmethod
def from_files(cls, ifile: IO[bytes], ofile: IO[bytes]) -> Self:
return cls(ifile, ofile, Boxes.from_file(ifile))
!d classmethod
@classmethod```
Transform a method into a class method.
A class method receives the class as an implicit first argument, just like an instance method receives the instance. To declare a class method, use this idiom:
```py
class C:
@classmethod
def f(cls, arg1, arg2): ...
``` The `@classmethod` form is a function [decorator](https://docs.python.org/3/glossary.html#term-decorator) โ see [Function definitions](https://docs.python.org/3/reference/compound_stmts.html#function) for details.
A class method can be called either on the class (such as `C.f()`) or on an instance (such as `C().f()`). The instance is ignored except for its class. If a class method is called for a derived class, the derived class object is passed as the implied first argument.
uwu-as-a-service / uwuification-as-a-service
!e ```py
def times_two(func):
def f(value):
return func(value) * 2
return f
@times_two
def func(value):
return value
result = func(50)
print(result)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
100
when are we getting Rabbit vs LP fight over Dev Containers
or was there already one?
can we jump from code to code in python ?
as in goto?
!e ```py
def times_two(func):
def f(value):
return func(value) * 2
return f
def func(value):
return value
func = times_two(func)
result = func(50)
print(result)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
100
there isn't a goto
but for calling code from other part of the code, there are functions
using def right ?
yes
aagmn
order them correctly
what is there to see in Dubai
sand, slavery, skyscrapers
oil ;))
yup
Iลก mokyklos suolo โ tiesiai ฤฏ Baltijos Technologijลณ Instituto (BIT) studijas, o po jลณ โ jauniausio specialisto startuolyje โInteractioโ pozicija ir darbas โMicrosoftโ ฤฏmonฤje Taline. Tokฤฏ akademinฤฏ bei profesinฤฏ keliฤ jau nuฤjo 24-eriลณ BIT absolventas Gintautas. ล iandien jis sako โ norฤdamas sฤkmingai baigti mokyklฤ , patyrฤ ne vienฤ iลกลกลซkฤฏ, todฤ...
Guitars are cool...
im dutch
very good food
@zenith radish can you make a nutrient analyser for a hydroponic system
30 dolar
ohhh Donairs .... mmm
is that food or clothes?
Tex Mex - you can blend your own , i assume same with Cajun , ingredients list common spices
tex mex pork roast slow cookes is so tender , tasty
Hello
hello
Can I ask why is my speaker suppressed 
need 50 meesages
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
awww.. moist left
โข Have been active for over 3 ten-minute blocks. This means you need to have sent your messages over a span of at least 30 minutes.
Can you explain this?
I think compilation vs transpilation difference isn't in "what it turns into from what"
more about intent, meaning of the process and how much structure-heavy the process is
stuff like TypeScript does kind of both
I got perms
.wa s define transpilation
Failed to get response.
(reconnect if still suppressed)
.wa define transpilation
done already ๐
A source-to-source translator converts between programming languages that operate at approximately the same level of abstraction, while a traditional compiler translates from a higher level programming language to a lower level programming language.
> Opal not found

hello guyzz, i am new here looking for passionate folks to look up!!
"describe" implies a long answer
like mapping virtual memory to physical memory?
physical real memory chips have a absolute address - software can use the real address or use a translation of those addresses

@whole bear please, refrain from using slurs in your nickname.
:incoming_envelope: :ok_hand: applied timeout to @whole bear until <t:1681673937:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
(in response to this, they made their nickname even worse before changing to the current one)
anyone have files of explainign machine learning with tensorflow?
scki-kit is also good
๐
you got some files LX?
Nope sorry. But there may be some resources linked in the channel pins of #data-science-and-ml
thx
Yeah I never remember what that bit does for directories ๐
You mean /tmp?
Oh nvm
But writing secure suid programs is tricky!
oh, the last thing discussed with XML was SOAP not HATEOAS
Hey folks, just wanted to say hi and introduce myself.
Developing Engineering tools to solve problems for silicon verification and exploration
@zenith radish this also
for async
poll on a future requires it pinned
well, for Russia it's quite expected
that's like
party line
(as in political party)
#facts