#voice-chat-text-0
1 messages Β· Page 78 of 1
β @glad sandal can now stream until <t:1676132228:f>.
Btw, once you start streaming you can keep going after the permissions have ended, as long as you don't close the stream.
are you still angry?
no?
"look at my bio."
My ears are burning π
well for that we need to have a look
and then judge accordingly
isnt it?
i agree
i see no "insult"
i guess
i mean i agree tht we are uncertain if aliens exist or not
if you find an insult then ban me.
but if you don't gets the opposite effect
bc your are accusing me of insulting you for some reason....
@glad sandal
what time control?
Maro is just wide
rap and phonk are nice
thats statically typed languages
not even rust specific
"Patterns"?
thats very vague
Rate my ai art
i'd think that about AF tbf
so chill
very good cut
drippy capy bara
?
(do I miss any context?)
more capybara please 
i'd say something but i fear you getting offended
it was abt trying to fully learn a topic
I'll leave that here
https://lichess.org/Y6Qf8zqH
Join the challenge or watch the game here.
coconut doggie
.capybarafact
"brb", "u", disgusting. Dima posted* that.
what this mean?
You better know if you are posting it.
What am i post?
confuse
which topic?
(I was afk for some time so might have missed something)
capybara
i completely forgot you could get it
generally anything
man that was a stupid endgame lol
3+0 sucks
I can confirm memes lose brain.
3+2 β
i agree
CapyBara was a very smol meme
hows a capybara funny
it didnt get popular
its so lame
it was the song
embed fail
OK i pull up to the after party song
and a braindead thing to find funny
have you seen the humor lately
its so broken
na you guys just dont have good memes
random person screaming
capybara
i have non-english memes that are great
and ppl laughing
memes are funny?
capybara is soo old
good memes are
yo you know these bars that are supposed to stop people from sleeping on the rounds and stuff. i saw a meme , there was someone sitting on it..... very dark
ppl would argue on it too
yup
and in tdys time
i have dark humor some times
memes are offensive
i know you have sometimes heard some dark things from me lol
we should exchange thoughts in dm
there was this angry bird 911 meme
π .
such a stupid thing
its a conversation starter at times
they make sense at least
than random animal pics
lmao
saw it 2312489423 years back
:{}
bullet forever
!stream @glad sandal
β @glad sandal can now stream until <t:1676134552:f>.
bullet: purely make random moves
i had like 900 rapid games on chess.com
20 bullets π
@glad sandal try # usermod -a -G wheel rootcaty
is that a minion ?
this is a wierdo minion
i would've liked to see some bananas , blue bananas like on the mountain or smth
tor experience
who uses tor to access chess websites
Karjakin got offended
alireza is good player
on a previous account::
- 634 rapid 51% win 6% draw rate
- 855 bullet 56% win 9% draw
i used to play a lot more bullet it seems
Elon Musk
2b2t by far best minecraft server
the insane builds people had there
this dude had built the milky way on 2b2t
waking at 10?
would get belted in here for waking up at 10
@vocal basin umm i am ready to shift to another vc for a smoll talk if you are
ohh nvmm
@formal ember
wait, what again do you use for persistence?
@verbal zenith
what durability requirements do you have?
i.e. how much do you avoid data loss?
are you okay with losing data?
so, SQLite is a simple-ish version
won't lose data
!d sqlite3
Source code: Lib/sqlite3/
SQLite is a C library that provides a lightweight disk-based database that doesnβt require a separate server process and allows accessing the database using a nonstandard variant of the SQL query language. Some applications can use SQLite for internal data storage. Itβs also possible to prototype an application using SQLite and then port the code to a larger database such as PostgreSQL or Oracle.
The sqlite3 module was written by Gerhard HΓ€ring. It provides an SQL interface compliant with the DB-API 2.0 specification described by PEP 249, and requires SQLite 3.7.15 or newer.
This document includes four main sections:
built-in
the library itself is included
to make pickle work correctly, you'd effective have to write serialisation anyway
just connect to it
it will make the file
db = SQLAlchemy(app)
class blogpost(db.Model):
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(50))
subtitle = db.Column(db.String(50))
author = db.Column(db.String(20))
date_posted = db.Column(db.DateTime)
content = db.Column(db.Text)```
SQLAlchemy may be an overkill for this thing
there isn't much query complexity
if you just need to store config, you don't need sqlalchemy
in its inner structure it's a dictionary
it's not faster than dict for retrieving a single item
but it is more efficient for retrieving narrow ranges of values
all values between 0 and 1000, for example
dict isn't sorted
sqlite probably doesn't use a hash table
@vocal basin any idea about nginx
it most certainly uses b or b+ trees
I'm currently using httpd instead of it, but will be switching over eventually
from what I've seen, nginx has better performance and simpler configureability at the cost module integrations that httpd has had developed for it over the years
ok , im getting 502 error
config file ```upstream backend {
server 192.168.120.13:5000;
server 192.168.120.6:5000;
}
This server accepts all traffic to port 80 and passes it to the upstream.
server {
listen 80;
listen [::]:80;
location / {
proxy_pass http://backend;
}
}```
i can curl and ping to backend server but cant make nginx work.
does the backend show any errors?
is httpd good for just proxy and loadbalancing?
the server being proxied
related to nginx?
no, the thing that you put behind proxy
no, i guess
backend works good.
{
"message": "Hello world! Example setting is: foobar"
}```
yes
{
"message": "Hello world! Example setting is: foobar"
}```
this from the server where nginx is.
and 192.168.120.13?
does it show the same for 192.168.120.13?
yes
is this the whole config?
are you running nginx inside a container?
no
did you restart it or reload it after changing the config?
yes, i'm on this for past 2 days.π
yes
.
from sqlalchemy import create_engine
from sqlalchemy import Column, String, Integer, Boolean
from sqlalchemy.orm import declarative_base
from sqlalchemy.orm import sessionmaker
engine = create_engine('sqlite:///test.db', echo=True)
base = declarative_base()
class Replacement(base):
__tablename__ = 'replacements'
id = Column(Integer, primary_key=True)
replaced = Column(String)
replacement = Column(String)
def __init__(self, replaced: str, replacement: str):
self.replaced = replaced
self.replacement = replacement
def __repr__(self):
return f"Replacement: '{self.replaced}' -> '{self.replacement}'"
class Namespace(base):
__tablename__ = 'namespaces'
id = Column(Integer, primary_key=True)
name = Column(String)
primary = Column(Boolean)
def __init__(self, name: str, primary: bool):
self.name = name
self.primary = primary
def __repr__(self):
return f"Namespace: '{self.name}' (primary: {self.primary})"
base.metadata.create_all(engine)
session = sessionmaker(bind=engine)()
?
they're that racist person that Opal responded to one other day
anyone know how to use pygames ?
people know how to use ctrl+f and memory even if you can't.
We are both Australians, and I did not say anything
"We are both Australians"
and?
it doesn't excuse anything
you don't understand it? grow up
Why would I say something like that?
Iβve already reported him to the moderators
@somber heath you are a creepy old man who is rude races, and makes people feel uncomfortable
I've asked you to stop contacting me.

@formal ember Python indices begin at zero. π
:{}
messes up my counting sumtimes:[
@sharp urchin
I think Opal can help with the whole "where to start learning python" too
I'll never be completely used to it. Slicing, depending on how complicated it gets, I will always be testing first.
ha what did i say?
As in 'come on up to vc0'
@somber heath Maybe download docs locally? i do that myself.
yeah, agree on that. though I use HTML
there are things described in the tutorial
those can be considered basics, I guess
so, quite unstructured, sounds like?
may be a wide range but I myself wouldn't sort even those items in that order
lol
I wonder, are there any prepared problems online for @sharp urchin to do @somber heath ? Things like read-to-use data sets, given problems to solve and find out using the data set, etc.
I'd probably expect a beginner to know roughly that (without the inverted items)
whatever it is later in the tutorial is quite easy to fail to learn correctly
break/continue/loop-else is, arguably, also questionable
not how it should be but what I've experienced
well, file management is one of the easiest from that tutorial to fail
file handling = file management
almost each time open() is used outside of with ...: is a failure
bye everyone.π π
"management" as in "context management"
lemme just chk the contexts of it real quick
!d typing.ContextManager
class typing.ContextManager(Generic[T_co])```
A generic version of [`contextlib.AbstractContextManager`](https://docs.python.org/3/library/contextlib.html#contextlib.AbstractContextManager "contextlib.AbstractContextManager").
New in version 3.5.4.
New in version 3.6.0.
Deprecated since version 3.9: [`contextlib.AbstractContextManager`](https://docs.python.org/3/library/contextlib.html#contextlib.AbstractContextManager "contextlib.AbstractContextManager") 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).
why does it even work though? never felt natural to me. It's convenient and useful, but as a beginner, I wouldn't know to precede open() with with unless explicitly told to
YU i couldnt find any topic related to file handling in there
but i am pretty sure, that i have learned it as well
well but i am still confused tbh on what to do next?
should i stick to leetcode and learn other things? related to data sci?
open/close come from C
historically, the simpler way to move from file.close() to with file: was to keep the open() behaviour as is and add close-on-exit
although, yes, the more proper representation would probably be to open the file on __enter__ and close it on __exit__
@vocal basin to further simplify my question , i wanna say that i have 2 major concerns at the moment
1)What should i do now? should i stick to solving leetcode by learning new libraries or languages?
2)how do i make my logic building better and stronger(at least in case of python)?
if you can address them this
1)solve dataset issues? go see if you can get your hands on some CSV files and problem descriptions. Stuff like "find out what pattern the people listed here follow"
2)leetcode, and just doing project of your own.
- solve problems leetcode and other sites --> this helps with algorithms problem solving in general
- take free university courses on data science if you have access to such --> this helps with theory and knowing how to use libraries
- just write software --> this helps with architecture and being interested in software development
3.0) write software you want to write
3.1) maybe to optimise routine tasks
3.2) maybe write chat bots
3.3) maybe make websites
write software!!!!???
:{
but i dont even know how to start
and how to write
software!!!?
(as for 3.2/3.3, docs are more important than tutorials)
yeah, you honestly should try figuring out something you could AND want to do. Are you interested in something you'd like to analyze data-wise?
"Euclid wrote software and he didn't even have a computer"
populations, maybe what the actual demographic for a game is by parsing some list of registered players, SOMETHING
:{}
go get your hands dirty with data
yeh i would love to
A
parse it, sort it, analyze it, learn to visualize it with modules like tkinter and matplotlib
good saying given in how unclean form the data comes in usually
when you say figuring out you mean tutorials on how to write one software....is it?
NO
when we were learning csv in school, we had to deal with garbage like extra newlines mid-row
Erik Rose
If you've ever wanted to get started with parsers, here's your chance for a ground-floor introduction. A harebrained spare-time project gives birth to a whirlwind journey from basic algorithms to Python libraries and, at last, to a parser f
then how am i supposed to learn it?
go find a dataset, and analyze it
i can do/ will try to do most of these
HOW you do it isn't too important, but do it
I have a playlist which has quite a lot of good lectures on software engineering, but it's mixed in with other stuff
(I can make a cleaner version of the playlist)
hmm i would love to see it if you wanna share it
:}
but as for the time being i am pretty clear of what to do
look, learning X module won't magically make you a super programmer, and focusing on learning X then Y then Z modules will just make you forget what you learned over time.
You want to do data science. Go get some CSV files or XLSX files to parse through. The hardest part will be finding ready-to-use data sets that are intentionally dirty and have problem descriptions you can solve. Alternatively, you need to find one yourself to analyze.
umm i still havent dived in data science or data handling
i still have to learn it
data sets and stuff is not something i have faced yet...
but i am clear now....will return to yall once i am done with the tasks given
I should probably filter out stuff like this or, like, put that at the end
i thank you all for the time and advice yall gave :} @somber heath @verbal zenith @vocal basin @whole bear
π
"if you ban people in one place, when will they commit it next?"
np, wish I could have given you some data sets myself, but i ain't got any
yeh regarding data sets i will come to it once i am done with data science tutorials from unis
ask your University to give you some if they have any
"I'm in an infinite loop"
they ought to have something lying around, I would be surprised if they didn't
i am not in a uni
still high school
way ahead of me then, I'm a full grown adult
hmm
i just started my programming journey 2-3months back
i was earlier an ex med student
but then i never had interest in med so i finally thought to change it
@rancid slateπ
Hello
I cant hear anything u all talk now becuz im on a trip for studying
So loyd
Loud
I hope Microsoft NEVER buys discord, I hate their ecosystem (excluding VS Code).
- github
not using it atm, fortunately
@whole bear π
... or that
gtg to bed, it's like 5am, take care
the actual thing in settings that's important is two/three auto-adjustments
those all should probably be off
I've filtered the playlist; but it's unsorted and on the wrong account
{key: self[key] for key in self}
class dict(**kwargs)``````py
class dict(mapping, **kwargs)``````py
class dict(iterable, **kwargs)```
Return a new dictionary initialized from an optional positional argument and a possibly empty set of keyword arguments.
Dictionaries can be created by several means:
β’ Use a comma-separated list of `key: value` pairs within braces: `{'jack': 4098, 'sjoerd': 4127}` or `{4098: 'jack', 4127: 'sjoerd'}`
β’ Use a dict comprehension: `{}`, `{x: x ** 2 for x in range(10)}`
β’ Use the type constructor: `dict()`, `dict([('foo', 100), ('bar', 200)])`, `dict(foo=100, bar=200)`
class Configs(dict):
def __init__(self, default_path: str):
self.use_custom_directory = False
self._custom_directory_path = ""
self._directory_path = None
self._default_path = default_path
self._namespace = None
self.copy_ores = {
"copper": (5, 2),
"lapis": (9, 4),
"redstone": (5, 4),
"nether_gold": (6, 2)
}
super().__init__()
@property
def custom_directory_path(self):
if self.use_custom_directory and self.custom_directory_path:
return self._custom_directory_path
else:
return self._directory_path
def set_custom_directory_path(self, path: str):
self._custom_directory_path = path
@property
def namespace(self):
if self._namespace:
return self._namespace
else:
return "minecraft"
def save(self, _engine):
_session = sessionmaker(bind=_engine)()
for key in self:
_session.add(Config(key, self.__getattribute__(key)))
_session.commit()
def load(self, _engine):
_session = sessionmaker(bind=_engine)()
for config in _session.query(Config).all():
self.__setattr__(config.key, config.value)
Config.this = that
I would pass all as values to __init__ in a classmethod-factory deserialise and have a serialise method
it's more strict
but I understand why it may not always be appropriate
hows the education we got till senior secondary school of any use to what we learn now and apply?
isnt it?
dont you guys feel the same?
that allows, for example, for easier introduction of asynchronous (de)serialisation
def __repr__(self):
return self.__dict__.__repr__()
@decorator
... something:
...
... something:
...
something = decorator(something)
!e ```def greet(fx):
def mfx(*args, **kwargs):
print("Good Morning")
fx(*args, **kwargs)
print("Thanks for using this function")
return mfx
@greet
def hello():
print("Hello world")
@greet
def add(a, b):
print(a+b)
greet(hello)()
hello()
greet(add)(1, 2)
add(1, 2)```
@sharp urchin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Good Morning
002 | Hello world
003 | Thanks for using this function
004 | Good Morning
005 | 3
006 | Thanks for using this function
doesn't enforce well-working serialisation unlike json
def parent(num):
def first_child():
return "Hi, I am Emma"
def second_child():
return "Call me Liam"
if num == 1:
return first_child
else:
return second_child ```
__repr__ is almost always only for debug, yes
This is storing functions as an object
!e ```py
class MyClass:
def init(self):
self.a = 1
self.b = 2
self.c = 3
mc = MyClass()
print(mc.dict)```
although you'd expect it to output Config({}) or something
but it seems similar to oop's attributes
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
{'a': 1, 'b': 2, 'c': 3}
it is a dict and without __slots__ you access it each time you do .
the meaning of __repr__ is to be almost eval-able
:{}
!e
class MyClass:
__slots__ = ('a', 'b', 'c')
def __init__(self):
self.a = 1
self.b = 2
self.c = 3
mc = MyClass()
print(mc.__dict__)
@vocal basin :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 10, in <module>
003 | AttributeError: 'MyClass' object has no attribute '__dict__'. Did you mean: '__dir__'?
class Random:
hello = 'hi'
import Random
greet = hello + bye```
you can't do using static like in C# in python
also, your class isn't static
so wouldn't make sense
there is static variables in python as well
yes you can
C# has this for classes
however
python's meaning of import is different to that of C#'s using
#Static/class variable
__counter = 1
#Instance variables
def __init__(self): #This is a constructor
self.__pin = ""
this is an example of a famous static var in python
though
__ prefix has no relevance to being static
when you import, the namespace doesn't get exposed to the current namespace
!e ```py
class Text:
a = 1
b = 2
print(Text.a)
print(Text.b)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1
002 | 2
iirc, instances of type always have __dict__
I wonder if there's a way to break it
π
!e ```py
class A:
bee = 123
class B:
bee = 456
print(A.bee)
print(B.bee)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 123
002 | 456
#mymodule.py
class B:
pizza = 456```
```py
#main.py
import mymodule
class A:
pizza = 123
print(A.pizza)
print(mymodule.B.pizza)```
123
456```
#mymodule.py
class B:
pizza = 456```
```py
#main
from mymodule import B
class A:
pizza = 123
print(A.pizza)
print(B.pizza)```
123
456```
from mymodule import *```
there is from ... import * to import everything but, in most cases, you shouldn't use it
!if-name-main
if __name__ == '__main__'
This is a statement that is only true if the module (your source code) it appears in is being run directly, as opposed to being imported into another module. When you run your module, the __name__ special variable is automatically set to the string '__main__'. Conversely, when you import that same module into a different one, and run that, __name__ is instead set to the filename of your module minus the .py extension.
Example
# foo.py
print('spam')
if __name__ == '__main__':
print('eggs')
If you run the above module foo.py directly, both 'spam'and 'eggs' will be printed. Now consider this next example:
# bar.py
import foo
If you run this module named bar.py, it will execute the code in foo.py. First it will print 'spam', and then the if statement will fail, because __name__ will now be the string 'foo'.
Why would I do this?
β’ Your module is a library, but also has a special case where it can be run directly
β’ Your module is a library and you want to safeguard it against people running it directly (like what pip does)
β’ Your module is the main program, but has unit tests and the testing framework works by importing your module, and you want to avoid having your main code run during the test
unlike statically linked languages, for python it actually takes extra time in runtime
- write code in such a way that it doesn't break if someone used
import * - don't use
import *
there's __all__ to designate what's exported by the module
MyClass.__dict__['method'].__get__(...)
same as far as ik
there are objects defined in C
they are called built-in or something
they are different
it's not user defined vs python provided
yes
it's defined in python vs defined in C
yes
syntax is an object too to some extent
match type(value):
case z if z==str:
return Config(key, value)
case int:
return IntConfig(key, value)
case float:
return FloatConfig(key, value)
case bool:
return BoolConfig(key, value)
!d ast
Source code: Lib/ast.py
The ast module helps Python applications to process trees of the Python abstract syntax grammar. The abstract syntax itself might change with each Python release; this module helps to find out programmatically what the current grammar looks like.
An abstract syntax tree can be generated by passing ast.PyCF_ONLY_AST as a flag to the compile() built-in function, or using the parse() helper provided in this module. The result will be a tree of objects whose classes all inherit from ast.AST. An abstract syntax tree can be compiled into a Python code object using the built-in compile() function.
int() not int
not call
it's like
match it as if it's a some result of calling int()
oh wait
!e ```py
class MyClass:
def foo(self):
pass
my_instance = MyClass()
print(type(MyClass.foo))
print(type(my_instance.foo))```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | <class 'function'>
002 | <class 'method'>
match value:
case str():
return Config(key, value)
case int():
return IntConfig(key, value)
case float():
return FloatConfig(key, value)
case bool():
return BoolConfig(key, value)
int isn't a keyword
int
!d keyword
Source code: Lib/keyword.py
This module allows a Python program to determine if a string is a keyword or soft keyword.
!e
x = 1
print(type(x)==int)
!e
import keyword
print(keyword.iskeyword('int'))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
False
!e
x = 1
print(type(x) is int)
@verbal zenith :white_check_mark: Your 3.11 eval job has completed with return code 0.
True
match 1:
case int():
...
case 1:
...
case _:
...
so the meaning of int() in match is:
matched value can be represented as int(...)
!e
x = 1
print(type(x) is int)
@verbal zenith :white_check_mark: Your 3.11 eval job has completed with return code 0.
True
OH
That's cool, I still need it's true type though
and the attribute matching works as if it assumes that all types are initialised like self.__dict__ |= kwargs
so calling type with it will do just that afaik
!e
import keyword
print(keyword.iskeyword('int'))
print(keyword.iskeyword('type'))
print(keyword.iskeyword('print')) # True in python 2
print(keyword.iskeyword('is'))
print(keyword.iskeyword('class')) # this is why libraries have to use class_
print(keyword.iskeyword('match'), keyword.issoftkeyword('match')) # not enforced; see: re module
print(keyword.iskeyword('case'), keyword.issoftkeyword('case')) # not enforced; common, like match
print(keyword.iskeyword('async'), keyword.iskeyword('await')) # enforced since around 3.5~3.6, I guess?
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | False
002 | False
003 | False
004 | True
005 | True
006 | False True
007 | False True
008 | True True
I found the "dunder" in the docs
!e py import keyword kw = 'True', 'False', 'None' for k in kw: print(k, keyword.iskeyword(k))
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | True True
002 | False True
003 | None True
!e
import keyword
print(keyword.softkwlist)
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
['_', 'case', 'match']
_
Wut?
in match
those are one whole group for now
keyword.softkwlist was ['async', 'await']
!e
match 5:
case _:
print(_)
@vocal basin :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 3, in <module>
003 | NameError: name '_' is not defined
!e
match 5:
case __:
print(__)
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
5
C# since around 7~8 has _ as a keyword
3.10
3.11 added speed
this is one of the things I've waited for quite a long time
this one allows variadic now
SomeType[*SomeTypeTuple]
@whole bear π
hey
havent been active enough to talk yet sadly
yup
yeah got to talk more
have a question bit idk how to ask it without showing u
cause i cant steam
!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.
!paste
Pasting large amounts of code
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.
I've recently realised a thing I might be missing in Rust to convince me to write it more
a type system way of denoting that the instance of a type can't be implicitly dropped
and asynchronous context managers (as something related to that)
new to this btw
these are the instructions:
Download ZIP here and extract the ZIP
Install requirements.txt by typing pip install -r requirements.txt in Command Prompt
Run the run.bat file and enter the amount of threads
when i type "pip install -r requirements.txt" into the command prompt it just gives me an error
idk if thats enough info
what error?
SyntaxError: invalid syntax
pip install -r requirements.txt
File "<stdin>", line 1
pip install -r requirements.txt
^^^^^^^
a command prompt, not the python interpreter
where would i find that, i appologize im very new
open the directory that you have requirements.txt in
select the address bar; clear it; type "cmd"; press enter
im checking if that was the problem
makes sense, where outside of python
im on windows
that should open the command prompt in the correct location
k
(click here to select the address bar)
im not sure should i reinstall
ok
yes
web
where is the option for repair install again
uninstalling
about to reinstall, just checking "Latest Python 3 Release - Python 3.11.2" is correct?
aha
that box i assume
just making sure, this is fine
worked, will keep updated
Groovy bananas.
thanks man
is tht the same case with me as well? @somber heath
i believe tht i do not have a good mic as well
yeh
ohk...my fnrds say so
tht i have a lil bit of interference
I have the mic/discord configured for scream/growl recording lol
@whole bear π
i do not like to hear anyone on 100%
i usually set ppl at 50% or so
i hate parties in general
echo cancellation is therefore off
also, because it's garbage
back smh
why does it need proxies?
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
sorry man
type anything, and it's a valid html
@cedar solar #media-processing message
it's going to change anyway
Django, FastAPI
@flint torrent π
"and it is still a joke"
Flask's simplicity doesn't work for it always
and the same for WSGI in general
FastAPI is in some sense superior due to it being built with async in mind
and with its dependency injection capabilities
if I wasn't writing tiny apps for which the only viable choice is aiohttp, I'd probably use FastAPI
its docs are great
@twilit ridge π
if you compare benchmarks, it;s
Flask <<< Django <<< FastAPI
links are more dangerous than voice chat
with quite wide performance gaps between those
however
the async flask is faster than django
(quart being the async flask)
So Im trying to make a script that can detect walls, windows, and floors from a 2d image
Like from a floor plan
Ou I see what you mean
Thats actually really interesting
The wonders of AI
β€οΈ Check out Weights & Biases and sign up for a free demo here: https://www.wandb.com/papers
β€οΈ Their mentioned post is available here: https://app.wandb.ai/sweep/nerf/reports/NeRF-β-Representing-Scenes-as-Neural-Radiance-Fields-for-View-Synthesis--Vmlldzo3ODIzMA
π The paper "NeRF in the Wild - Neural Radiance Fields for Unconstrained ...
This is a cool channel
Those models are really going to change the world and jobs forever
My friend Jeremy cried until he blacked out when he saw chatgpt producing code when he was just starting his computer science degree
βControversial thought detectedβ
I am in class 11th and want to learn computer science but don't know how to start . Any suggestions?
@covert hedge make something you already like but by urself
ve must estavlish a collavoration in zis fragmented vorld
to what extent did you learn programming before?
1 year
did you build any software or was it only courses and problem solving?
Only courses and problem solving I don't know what software to build
I accept you
Well lets think
What industry can AI not get into as fast
or will be the last industry that AI will automate
maybe getting into AI is the answer
hiiii
thats it im gonna stop programming and start a steampower mill for job security
Imagine having a system of capitalism and removing the basic right to boycott which makes capitalism ethical
so, I'd say, if you don't know what software to build, that may hold you back from progressing in software engineering
look around for what software you might create and might want to create
look at what others people do, try to find where you can or want to improve on their work
watch talks about programming, they may inspire you/educate you on what software can be made
doing this in addition to courses and problem solving, I think, may be helpful
great person once said:- you wanna know who is ruling you
see the person whom you are not able to criticize
^
Can you give me some software examples?
i feel people have become too soft nowadays!!
I hate shrimp on the bobby π‘
dont you all feel the same?
goes to Australia
screams "kill emus"
gets silent nods in return
"no, you do that"
Huh what is this?
I can just use print function for that
war on emus
some consider it lost
That is a software?
a website tracking emus
"in Arctic
I even have the code ready:"
<div></div>
garyπ‘
(it's all just white, it's all just snow, no emus)
Just one question that should I pursue software developer journey as my only interest is coding?
sometimes I
@vocal basin
that depends on to what extent the "coding" in an interest
(both "coding to what extent" and "interest to what extent")
def my_decorator(func):
def wrapper():
print("Something is happening before the function is called.")
func()
print("Something is happening after the function is called.")
return wrapper
def say_whee():
print("Whee!")
say_whee = my_decorator(say_whee)```
Can you guess what happens when you call say_whee()?
I thought outcome would be print('Whee!')
!e ```py
def dec(func):
def f():
print('a')
func()
print('c')
return f
@dec
def func():
print('b')
func()```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | a
002 | b
003 | c
ports on a computer are opened by default, if there's no firewall
!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 code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside of them.
By default your code is run on Python's 3.11 beta release, to assist with testing. If you run into issues related to this Python version, you can request the bot to use Python 3.10 by specifying the python_version arg and setting it to 3.10.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
def func():
print(b)
func = dec(func)
func()```
@twilit ridge use edwards curve instead
Ed25519
Edwards curves are equivalent to elliptic curves but have simpler maths
equivalent as in isomorphic
!e```py
def my_decorator(func):
def wrapper():
print("Something is happening before the function is called.")
func()
print("Something is happening after the function is called.")
return wrapper
def say_whee():
print("Whee!")
say_whee = my_decorator(say_whee)```
elliptic curves are more geometric in nature whereas edwards curves are more algebraic
!e```py
def my_decorator(func):
def wrapper():
print("Something is happening before the function is called.")
func()
print("Something is happening after the function is called.")
return wrapper
def say_whee():
print("Whee!")
say_whee = my_decorator(say_whee)```
@civic zephyr :warning: Your 3.11 eval job has completed with return code 0.
[No output]
!e```py
def my_decorator(func):
def wrapper():
print("Something is happening before the function is called.")
func()
print("Something is happening after the function is called.")
return wrapper
def say_whee():
print("Whee!")
say_whee = my_decorator(say_whee)
say_whee()```
@civic zephyr :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Something is happening before the function is called.
002 | Whee!
003 | Something is happening after the function is called.
(finally, a question related to my specialisation)
!e```py
def my_decorator(func):
def wrapper():
print("Something is happening before the function is called.")
func()
print("Something is happening after the function is called.")
return wrapper
@my_decorator
def say_whee():
print("Whee!")
say_whee()```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Something is happening before the function is called.
002 | Whee!
003 | Something is happening after the function is called.
def my_decorator(func):
@functools.wraps(func)
def wrapper():
print("Something is happening before the function is called.")
func()
print("Something is happening after the function is called.")
return wrapper
a decorator to make decorators
!d functools.wraps
@functools.wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES)```
This is a convenience function for invoking [`update_wrapper()`](https://docs.python.org/3/library/functools.html#functools.update_wrapper "functools.update_wrapper") as a function decorator when defining a wrapper function. It is equivalent to `partial(update_wrapper, wrapped=wrapped, assigned=assigned, updated=updated)`. For example...
that is "the proper way"
anagram of incursion
why are there just random double letters
say_whee = my_decorator(say_whee)
say_whee()
def my_decorator(func):
def wrapper():
print("Something is happening before the function is called.")
func()
print("Something is happening after the function is called.")
return wrapper
@my_decorator
def say_whee():
print("Whee!")
say_whee = my_decorator(
def say_whee():
print("Whee!")
)
say_whee = (
def wrapper():
print("Something is happening before the function is called.")
(
def say_whee():
print("Whee!")
)()
print("Something is happening after the function is called.")
)
say_whee = (
def wrapper():
print("Something is happening before the function is called.")
print("Whee!")
print("Something is happening after the function is called.")
)
this is an actual important question for class decorators
because, for example, sqlalchemy's decorator typing is broken
with the decorator syntax,
the global namespace ever has only one say_whee
wrapped is only accessible globally
original is only accessible locally by the wrapper/decorator
!e
@__import__("contextlib").contextmanager
def foo(s):
yield print("hi", s)
print("bye", s)
with foo("slick"): print("sup")
@lavish rover :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | hi slick
002 | sup
003 | bye slick
;
oh, wait, can it do (yield, None)?
!e
from __future__ import braces
@verbal zenith :x: Your 3.11 eval job has completed with return code 1.
001 | File "<string>", line 1
002 | SyntaxError: not a chance
don't know, not exactly trying to ultra golf
but yield is a statement so don't think so
tuples only consist of expressions
!e
def foo(s):
(yield print("hi", s), print("bye", s))
def foo(s):
yield print("hi", s); print("bye", s)
@vocal basin :warning: Your 3.11 eval job has completed with return code 0.
[No output]
it's an expression
next(iterator)``````py
next(iterator, default)```
Retrieve the next item from the [iterator](https://docs.python.org/3/glossary.html#term-iterator) by calling its [`__next__()`](https://docs.python.org/3/library/stdtypes.html#iterator.__next__ "iterator.__next__") method. If *default* is given, it is returned if the iterator is exhausted, otherwise [`StopIteration`](https://docs.python.org/3/library/exceptions.html#StopIteration "StopIteration") is raised.
next doesn't have it
@lavish rover https://gist.github.com/12966c804764f0185a63faf2eef8c3a3
what am i looking at
my stupid sqlite stuff
ive sqlite once in my life 6 years ago idk what any of this means
I'm saving config data in a weird way that lets me be lazy
Configs.save and configs.load
i am simple man i just use json/yml files
def my_decorator(func):
2 def wrapper():
3 print("Something is happening before the function is called.")
4 func()
5 print("Something is happening after the function is called.")
6 return wrapper
7
8 def say_whee() print("Whee!")
say_whee = my_decorator(say_whee)
say_whee()
def my_decorator(func):
def wrapper():
print("Something is happening before the function is called.")
func()
print("Something is happening after the function is called.")
return wrapper
def say_whee():
print("Whee!")
say_whee = my_decorator(say_whee)
say_whee()```
x = 5
x = ...
print(x)
my_decorator refers to an old function by func (local)
say_whee() refers to a new function by say_whee (global)
i guess Yu has a bttr explaination
func gets stored in the my_decorator context (closure)
its more abt global and local vars
!e
def foo(func): return 5
@foo
def bar(): pass
print(bar)
@lavish rover :white_check_mark: Your 3.11 eval job has completed with return code 0.
5
thats not a decorator
@prime spindle π
"now make it callable"
!e ```py
def my_decorator(func):
def wrapper():
print("Something is happening before the function is called.")
print("Something is happening after the function is called.")
return wrapper
def say_whee():
print("Whee!")
say_whee = my_decorator(say_whee)
say_whee()```
@civic zephyr :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Something is happening before the function is called.
002 | Something is happening after the function is called.
!e
def foo(func): return lambda: 5
@foo
def bar(): pass
print(bar())
@lavish rover :white_check_mark: Your 3.11 eval job has completed with return code 0.
5
OOP is used when the code needs to interact with different(multiple users) at a time @civic zephyr
and to store different values
wha
!e ```py
def decorator(_):
return 5
@decorator
def func():
print("Hello, world.")
print(func)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
5
@foo
def bar(...): pass
def bar(...): pass
bar = foo(bar)
!e ```def greet(fx):
def mfx(*args, **kwargs):
print("Good Morning")
fx(*args, **kwargs)
print("Thanks for using this function")
return mfx
@greet
def hello():
print("Hello world")
@greet
def add(a, b):
print(a+b)
greet(hello)()
hello()
greet(add)(1, 2)
add(1, 2)```
@sharp urchin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Good Morning
002 | Hello world
003 | Thanks for using this function
004 | Good Morning
005 | 3
006 | Thanks for using this function
!e ```def foo(func): return 5
@foo
def bar(): pass
print(bar)
@civic zephyr :warning: Your 3.11 eval job has completed with return code 0.
[No output]
!e
class C(int):
def __call__(self): self.five()
def five(func):
c = C(5); c.five = func; return c
@five
def hello(): print('hi')
print(hello)
hello()
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 5
002 | hi
I meant that by "make it callable"
def foo(func): return 5
@foo
def bar(): pass
print(bar)```
the returned value is expected to be callable usually
or, broadly speaking, usable in the same way as the decorated thing
!e
def decorator(funct):
def inner(text):
print(text)
funct()
return inner
@decorator("Hello world!")
def say_whee()
print("whee!")
say_whee()
!e
def decorator(funct):
def inner(text):
def printer()
print(text)
funct()
return inner
@decorator("Hello world!")
def say_whee():
print("whee!")
say_whee()
@verbal zenith :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 7, in <module>
003 | TypeError: decorator() missing 1 required positional argument: 'text'
!e
def decorator(text):
def dec(funct):
def inner():
print(text)
funct()
return dec
return inner
@decorator("Hello world!")
def say_whee():
print("whee!")
say_whee()
decorator, wrapper, wrap
@lavish rover :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 9, in <module>
003 | File "<string>", line 7, in decorator
004 | NameError: name 'inner' is not defined. Did you mean: 'iter'?
!e
def decorator(funct):
def inner(text):
def printer():
print(text)
funct()
return inner
@decorator("Hello world!")
def say_whee():
print("whee!")
say_whee()
@verbal zenith :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 | File "<string>", line 5, in inner
004 | TypeError: 'str' object is not callable
!e
def decorator(text):
def dec(funct):
def inner():
print(text)
funct()
return inner
return dec
@decorator("Hello world!")
def say_whee():
print("whee!")
say_whee()
@lavish rover :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello world!
002 | whee!
!e
def decorator(text):
def inner(funct):
def printer():
print(text)
funct()
return printer
return inner
@decorator("Hello world!")
def say_whee():
print("whee!")
say_whee()
@decorator("Hello world!")
def say_whee(): ...
def say_whee(): ...
say_whee = decorator("Hello world!")(say_whee)
@verbal zenith :white_check_mark: Your 3.10 eval job has completed with return code 0.
001 | Hello world!
002 | whee!
!e ```py
def decorator(text):
def dec(funct):
def inner():
print(text)
funct()
return inner
return dec
@decorator("Hello world!")
def say_whee():
print("whee!")
say_whee()```
@civic zephyr :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello world!
002 | whee!
I just realised I'm not sure which part is a decorator exactly
def decorator_factory(...): # can be called a decorator
def wrapper(func): # can be called a decorator
@functools.wraps(func)
def wrap(...): # not a decorator
...
return wrap
return wrapper
@decorator_factory(...) # this line has a decorator
def global_func(...):
...
def decorator(text):
def dec(funct):
def inner():
print(text)
funct()
return inner
return dec
@decorator("Hello world!")
def say_whee():
print("whee!")
say_whee()
def plus_one(x):
return x+1
x = 1
x = plus_one(x)
print(x)
my take:
def foo(): # function used to decorate
...
@foo # decorator
def bar(): ...
for me decorate is just the syntax sugar
everything else is emergent behaviour
that is the most strict and most understandable
but I've seen the something part called decorator too
@something()
!e ```py
def decorator(text):
def dec(funct):
def inner():
print(text)
funct()
return inner
return dec
@decorator("Hello world!")
def say_whee():
print("whee!")
say_whee()```
@civic zephyr :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello world!
002 | whee!
yeah my take is that @xxx is a decorator
!e ```py
def greetify(cls):
class C(cls):
def init(self, *args, **kwargs):
super().init(*args, **kwargs)
print("Hello, world.")
return C
@greetify
class MyClass:
pass
foo = MyClass()```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello, world.
@ syntax is decorator syntax
if @ is used for wrapping functions/classes, then there's at least one decorator involved
you can use the "decorating function" without the actual @... syntax, so would that then not be a decorator? why should what I function is change based on something external to the function?
I also remember there being some weird limitations on the syntax
I believe some of those were lifted at some point
yes
you couldn't do @a.b before
which might have deepened the inclusion of decorator factories into the decorator class of functions
@verbal zenith #media-processing message
I've been making simulations of waves in JS
but I've lost the code
although I didn't introduce any mechanisms to reduce waves that are too small so it was bad somewhat
I remembered this thingy I was making when tried to understand opencl
(frame from a dynamic changing pattern)
2GB gif
Worley Noise base.
oh, wow, this actually works
there's also, like, different types of random to use with it
normal with .8 scale
the same but bigger
with shuffle at some iterations
.01% shuffle at larger scale
it starts to look weirdish
i have to go now, it was fun listening in
@somber heath this might be an interesting variation of the algorithm
I'm watching.
also, different mappings from source space to colours
now there's a challenge to remove the artefacts
#1 Icecream!
Python Enhancement Proposals (PEPs)
!d map
map(function, iterable, *iterables)```
Return an iterator that applies *function* to every item of *iterable*, yielding the results. If additional *iterables* arguments are passed, *function* must take that many arguments and is applied to the items from all iterables in parallel. With multiple iterables, the iterator stops when the shortest iterable is exhausted. For cases where the function inputs are already arranged into argument tuples, see [`itertools.starmap()`](https://docs.python.org/3/library/itertools.html#itertools.starmap "itertools.starmap").
!d itertools.zip_longest
itertools.zip_longest(*iterables, fillvalue=None)```
Make an iterator that aggregates elements from each of the iterables. If the iterables are of uneven length, missing values are filled-in with *fillvalue*. Iteration continues until the longest iterable is exhausted. Roughly equivalent to:
!e py letters = 'abc' numbers = '123' characters = '!@#' for a, b, c in zip(letters, numbers, characters): print(a, b, c)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | a 1 !
002 | b 2 @
003 | c 3 #
!e py import itertools letters = 'abc' numbers = '12345' for a, b in itertools.zip_longest(letters, numbers, fillvalue="!"): print(a, b)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | a 1
002 | b 2
003 | c 3
004 | ! 4
005 | ! 5
I guess, the errors can filtered out by stopping the process after a certain iteration
(didn't try yet)
those are just very biased towards going left
same bias but less severe
@sinful spear π
@somber heathhey
different distribution
I didn't expect that to happen
@buoyant cradle Hi hi, I'd come back, but I'm giving my ears a rest from my headphones.
oh okay.
Actually, I could do speakers.
Rainbow croissant.
trying to make it more round-ish
It's reminding me of cell culture slides or something. Or like view into cells.
Amoebas.
offset to one direction
those arcs in the top right are more or less what I'm trying to achieve
Those are some harsh knittings.
I recently updated python and there is some error with numpy
def visualizer(self):
try:
wf_data = self.stream.read(self.CHUNK)
wf_data = struct.unpack(str(2 * self.CHUNK) + 'B', wf_data)
wf_data = np.array(wf_data, dtype='b')[::2] + 128
self.set_plotdata(name = "waveform", data_x=self.x, data_y=wf_data,)
except:
pass
DeprecationWarning: NumPy will stop allowing
conversion of out-of-bound Python integers to integer arrays. The conversion of 211 to int8 will fail in the future.
For the old behavior, usually:
np.array(value).astype(dtype)`
will give the desired result (the cast overflows).
wf_data = np.array(wf_data, dtype='b')[::2] + 128
@somber heath do you know how to fix it??
basically the thing is working
but printing this error
wf_data seems to be out of bounds of dtype='b'
does it error/warn with dtype=np.uint8?
Hey @chrome pewter!
You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.
(and, like, without + 128, I guess?)
this is just warning
B is working
thanks
but printing this
result2:
[]
automatically
Fordite vibes.
more segments
colour = np.zeros(3)
angle = np.random.uniform(-np.pi, np.pi)
delta = 0
def mutate():
global colour, angle, delta
colour += np.random.normal(0, .0002, size=3)
colour = colour.clip(0, 1)
delta += np.random.normal(0, .0001)
delta = np.clip(delta, -.02, .02)
angle += delta * .01
angle represents the direction it attempts to move towards
delta represents the derivative of the angle
haven't
Fordite, also known as Detroit agate or Motor City agate, is old automotive paint which has hardened sufficiently to be cut and polished. It was formed from the buildup of layers of enamel paint slag on tracks and skids on which cars were hand spray-painted (a now automated process), which have been baked numerous times. In recent times the mate...
and then it sorts the offsets based on which is the closest to the angle
a = angle + np.random.uniform(-np.pi / 4, np.pi)
offsets.sort(key=lambda t: (np.cos(a) - t[0]) ** 2 + (np.sin(a) - t[1]) ** 2)
@surreal grotto π
!voice
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
the noise is different in each segment too
it's not so hard to understand why noise appears, but I really don't know how to deal with it properly
it is correlated with how smooth the result is
I lowered the amount by which it changes the angle, and now it separates into segments like this
this reminds of the game If Found
it walks over individual pixels
the noise happens when two fragments happen to go around a small segment
ohhh
that code had a bug
I missed /4
no
well...
the noise is expected to be there
like, I understand why it happens, I just can't explain it
not only the palette; the game too had visual noise in it; a lot
@ashen wasp π
Hi
Namaste @somber heath !
High defination??
graphics in python using numpy+pillow
what do u want to make or do?
just experimenting for now
is it only color conversion u r giving a source image,or its fully genereted?
everything (except, like, config values) is generated algorithmically
oo Thats Cool!
emerald cave?
2 and 16 stacks competing for territory
16 stacks with x2 and x4 colour variation
16 stacks, 2048x2048
I broke something
https://paste.pythondiscord.com/esidasobuq.py What do I have to do to make my images move? Because with my code I have no error and yet no image moves when I press my keys.
arcs are back;
also, less square images now
Where do you call Jeu?
How you can solve your next problem: The global keyword.
How you should solve your next problem: The class keyword.
@knotty flint π
!voice @knotty flint
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@whole bear π
four stacks
@open lantern π
three stacks
@high acorn π
hello. I am suppressed
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voice
Hello opal
@smoky rose @untold star π
hi
when the noise is pixel-small, it looks like stars
hi
skill based matchmaking please @rapid chasm
i suffer a lot
:[
π .
thts sum beautiful voice ryt there
:}
if len(current_players) >= 10 and member not in current_players:
if member not in queue:
queue.append(member)
await member.move_to(None)
elif member not in current_players:
current_players.append(member)```
yuss
:}now add skill based matchmaking
we know tht
but a third person wont know tht
!!!!!