#voice-chat-text-1
1 messages Β· Page 10 of 1
Is it like python, but bit sized?
Ok...
it has built-in berkley db implementation, surprisingly
(or something like that)
aaahhh
A Rube Goldberg machine, named after American cartoonist Rube Goldberg, is a chain reactionβtype machine or contraption intentionally designed to perform a simple task in an indirect and (impractically) overly complicated way. Usually, these machines consist of a series of simple unrelated devices; the action of each triggers the initiation of t...
@north shadow
these depending on the task
https://github.com/PyO3/pyo3
https://github.com/RustPython/RustPython
if it's a service, those should probably be two separate services, I guess
oh
it's an app
(hypothetically you can launch a subprocess if you can't get direct bindings working)
@misty sinew π
"FSB"
Anybody here into flipper zero?
seems like more general-purpose
(but does include some potentially less legal capabilities)
they say you can write programs for it in c, micro python, and c#
AF hows minesweeper btw
not much progress this season (peak was top 948)
was spending way less time on it
as for coop minesweeper remake, it's at 0 lines of code written so far
that would be cool
still muted
!voice
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
I need to get my msgs up
The planet is your limpet.
I'll be back on in a sec, I have to check on a copier
Because anything that puts toner on paper hates me
haha
@delicate wren :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | -2
002 | -2
003 | -2
what does this do?
Yes yes I totally understand what you're talking about π
Ah right
Mahjong seems pretty complicated π€
Oh right
Ah right yeah
I was a little surprised to find out it's free
https://www.jetbrains.com/mps/
it's Java specifically, yes
AST seems more useful to modify/analyse existing python code
not sure if it's useable for DSLs
Yeah, for that you'd probably want something like Lark.
disclaimer just overlays part of the site
I'm watching a video about the rules of mahjong π
I'm not getting it tbh
Oh yeah, that was the top-comment on the video lol
"POV: you're trying to get 100% completion in yakuza"
The tiles look kind of edible, like blocks of fudge or something
I'd probably just describe the rules using classes
(and mostly in declarative way rather than imperative)
maybe add priorities to rules or something like that
not necessarily numerical
accidental speedrunning in minesweeper
(100 beginner games)
where are you running python?
on the server?
you're probably looking for RPC if you want "function calls"
FastAPI good
Flask is worse for large application
far worse
Ah Hemlock just left I think
it's not async
that's quite an important factor
GPT is not a tutor in any way
that's like
the opposite
it's irresponsible
and dumb
weight != mass
there's, like, too much nuance to phrase that riddle correctly
it's probably overinferring the context to be about 1kg vs 1kg
Haskell looks like magic sometimes
Haskell doesn't like mutability or side effects
syntax like that
f Just x = ...
f Nothing = ...
Haskell actually tries to avoid referencing that "whole machine" object
Monad
that sounds like trolling
"simple"
> read C.T. definition instead
> C.T. definition: monad is a monoid in the category of endofunctors
guess what is a monoid?
it's not a monoid
in Haskell morphisms would usually be functions and objects would usually be types
you can define monads on higher-level objects (e.g. functors)
but I'm not sure Haskell allows that
probably doesn't
I mean
generics over Functors
Haskell does have other categories
(... for example, Functors)
classes are like categories in Haskell
it is possible both in Haskell and in Rust
but
Rust has at least three different primitive categories
and category theory analogue for algebraic monoid is called monoidal category, not monoid
"get confused"
=> The natural numbers and + are a monoid
(corresponding morphisms)
FnOnce(A) -> B
Clone + Fn(A: Clone) -> B: Clone
Copy + Fn(A: Copy) -> B: Copy
I pretend FnMut doesn't exist
"if computer complains about your maths proof, your proof might have some issues"
yolo-oriented programming
Prolog
wget http://.../install.sh && chmod +x ./install.sh && yes | sudo ./install.sh
http instead of https to complete the joke
I should
implement Monad for stackless evaluation
enum Stackless<T> {
Done(T),
Pending(Box<dyn FnOnce() -> Stackless<T>>),
}
Rust
I have a similar thing in Python
dynamic dispatch
in more pythonic description (if only python allowed enums or generic type aliases)
Stackless[T] = (Literal['Done'], T) | (Literal['Pending'], Callable[[], Stackless[T]])
you just call on Pending until you get Done
3.12?
I had to do that because I was making a parser
for quite large files
and I was kind of too lazy to rewrite recursive code with a proper data structure
no mutable stuff, perfect loop
while True:
pass
def f(): f()
or in Rust:
loop {}
there is some very long one
oh, it refuses
spaces doesn't work
doesn't C require main?
depends on flags yes
one of IOCCCs was won by an empty C file
and compiler flags
that model was wrong
I'm slowly starting to realise how much difficult the thing I'm trying to do actually is
error! returns ! probably
(Infallible)
or never
The ! type, also called βneverβ.
I need a deque which looks something like
[FnOnce(A) -> B, FnOnce(B) -> C, ..., FnOnce(Y) -> Z]
it is common on Rust discord
would probably have to use trees
"leak memory properly"
https://doc.rust-lang.org/std/boxed/struct.Box.html#method.leak
Iβve seen the code.
nice
yeah
reading through this
https://learnyousomeerlang.com/
Learn you some Erlang for great good! An Erlang tutorial for beginners and others too.
did you guys know this?
In recent years, there has been a movement to change the name of the default Git branch from "master" to "main" or another more neutral term. This is because the term "master" has been criticized as being insensitive to the history of slavery and oppressive power dynamics.
That being said, there is no technical reason why you cannot use either "master" or "main" as your default branch. It's largely a matter of personal preference and cultural sensitivity.
If you decide to switch to "main" as your default branch, here's how you can do it:
Create a new branch called "main" based on your current "master" branch: git branch main master.
Switch to the "main" branch: git checkout main.
Push the "main" branch to the remote repository: git push -u origin main.
On GitHub or other Git hosting service, change the default branch for the repository to "main".
Delete the "master" branch: git branch -d master.
Note that if you have any integrations or scripts that rely on the "master" branch name, you may need to update them accordingly.
very interesting
I was like... why use main or master.. lol
yah totally not a big deal at all, just interesting
parent child in my house is master/slave LOL
jp
oh man that is the truth.. I am the slave aren't I LOL
perhaps bad terminology
I don't use words like that around the little ones fyi
this is a little bit of bs but, eh, no much really wrong with changing it
I've been exploring the wonderful world of git via wsl
I cleared all the old garbage out of my github, prettied it up a bit and now I'm happily pushing commits directly from wsl π
I'm gearing up to be able to work with people who have actually coded in groups, its all new to me and we have SVN in place now I think?
SVL ? ....
like git but old school
no it is SVN
subversion
they're all PLC and FB and mySQL
and SVN for version control
although frankly, they're not terribly excellent with that
I should go to bed its too late.
talk to you fine individuals on another day
https://wiki.python.org/moin/GlobalInterpreterLock @candid garnet
Hello
i
need
to send
50
messages so i can
talk to ppl
π¦
its so weird
when
ppl are talking
and i cant talk to
them
lmao
thats just something they implemented to prevent abuse in the vc I think
everyone has to meet the requirements if I recall correctly idk
lol
same
here
I can't
talk
on
voice
chat
but
anyways
how's
everyones
day?
@quaint cape @floral lagoon I've watched people have to wait for two weeks because of trying to do it that way.
You do you, though.
:ok_hand: applied timeout to @floral lagoon until <t:1680858346:f> (10 minutes) (reason: burst spam β sent 8 messages).
The <@&831776746206265384> have been alerted for review.
Let it not be said I didn't warn you.
i didnt realise i would get muted lul i only did it cause they were doing it i was verfied for vc a while ago
who came up with 50 message for speaking permission?
like why not 49
or 51
so basically I need 47 now right?
ops it got to 46
may I continue to 0?
is it against the rules that I'm doing this?
by the way it's 43
@late raptor@misty sinewπ
!voice
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voice
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
hii
bro the system is so bad
why i need 50 msg to tallk
we are free
Alas, it's something that became necessary on account of voice trolls who would come in and scream.
freedom
yes your true
π thers another sulotions
anyway i hope i get the acces soon as possible
Yes. There are solutions. This is a speedbump, not a brick wall.
This system requires that people engage in some social investment and have a measure of patience. This is something that is generally repulsive to the sorts of people who come in here to scream and make arseholes of themselves.
Having voice trolls come in every ten minutes is not pleasant and this system puts a stop to 99% of it.
While still allowing people in.
It means that you can't just do all 50 messages in 10 minutes.
Or less.
There has to be three ten minute windows in which there is activity and a total of 50 messages over those three periods and possibly beyond.
My suggestion is that you don't try to race toward it. Just slow down, smell the flowers, chat casually with people and enjoy yourself.
It will happen on its own, organically.
hello sohaib
Hiii @mild flume 
i was already verified yesterday
Morocco
hmm
tbh I don't know
@light blaze Perhaps your server needs to respond differently. Web browsers typically expect to be served up webpages.
I would talk to #web-development, because they'll be more practiced at doing this stuff.
Well, help post, then.
The one time I wrote anything webservery, it was a Frankenstein's monster.
@misty sinew good?? hbu
@wanton flume Could you please say that again?
Hello Jay,
I hope this email finds you well. I am a big fan of your work and I admire your mission to spread wisdom and positivity to the world.
I am writing to offer you my thumbnail design services for your YouTube channel. I am Milki Wasihun, a professional thumbnail designer and the founder of Oropyt, a creative agency that specializes in YouTube optimization.
I can work with various niches, such as personal development, health, and spirituality. I have noticed that you donβt change your thumbnails very often and I think I can help you attract more viewers with some eye-catching and engaging designs. I can also help you test different thumbnails and see which ones perform better.
I would love to work with you and help you grow your audience and impact. If you are interested, I can offer you a special deal: I will change 10 thumbnails for you every month for 50% off!
This is a limited time offer, so donβt miss this opportunity. If you want to see some samples of my previous work and my portfolio, please let me know and I will send them to you.
If you prefer, we can also hop on a voice call and discuss your needs and preferences in more detail. Just let me know what time works best for you and I will be happy to talk to you.
Thank you for your time and attention. I look forward to hearing from you soon.
Sincerely, Milki Wasihun
Your microphone is at decent volume, you don't have any noise, your audio is a little bit muffled when you speak, but the main issue is not all of the audio seems to be coming through.
looks like a scam?
β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β
β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β
which ones should i change exactly
great tnx for asking
Well, I can hear you fine, so. One sec.
You look like you're writing at a level where I'm not going to be able to tell you anything you don't already know.
Why wouldn't a company want people?
People mean opportunity.
What about up?
Yeees?
I am.
@unique raptor
No it is not.
Took you long enough.
I only go out for medical reasons.
I don't discuss that.
What percentage of the year needs to be completed before it's "almost the next year"?
What percentage?
Or number of months.
So....January, February, March, April...so three and change.
Three and change out of twelve months, Kemal.
Ta ta.
Hey hi.
@barren steppe π
Which word?
Ah, yes.
It's a Britishism.
One ta is thanks.
Spoken.
That's right.
@misty sinewπ
@cursive pierπ
?
My message was intended as greeting.
I can speak, but the rain might have caused my internet to be a bit shitty. I can hear people fine, but other people were complaining, so I'm just listening and typing.
The voice verification command needs to be performed in the voice verification channel.
It will tell you that you haven't met the requirements.
@supple orbitπ
i need to be at least 3 days
right
ty for the help
appreciate it
Yo, 80.
Yahoy.
Mic check successful, 8080.
@pseudo raven
@ivory rampartHey hi. You're really noisy.
@wheat ravenπ
There was something familiar about the noise pattern, though.
@pseudo raven If you get disappeared, I'll be sad.
I've not been talking because the rain might have fucked things up. People were complaining.
So I'm just listening.
and typing
@dire caveπ
"How do I shot web?"
@night quarryπ
hey
Sorry
@candid wolfπ
80, I'm always genuinely surprised you don't already have one.
There is an alternative to fracking on people's land.
Eminent domain.
Then it's not happening on their land.
Yes, I'm being facetious.
Oh, what, fracking reduced the value of your property? So sad.
anyone intersted in clash of codes
I am pleased.
Cooking.
Risotto.
i have heard of it
don't get offened
is it mashed rice
and seasoned to perfection
Not mashed, no.
why
Not that I make a habit of watching Masterchef.
people have it before death
Because it trips up a lot of the contestants.
why
It takes a practiced hand to do it well.
There's a fine line between soggy and chalky.
ok so you get that fine line
But you can still have it soupy without being soggy.
Depending on the region of Italy you're in, you may or may not want it soupy.
i wnat to have it
It won't be anything special to look at.
i will take a print out on edible paper and then have it
I don't claim mastery of the dish, but I can do it a way I enjoy.
@rancid moth π
Ok
OK
(it's not an easy one)
((alegedly))
!code
I'll be back in a couple of minutes
(need to stare into the abyss of fractals for some time)
whats im doing ?????????
dude explain me whats you ant exaclty ?
i swear my god im not trolling
dude
just explain me whats your proplem is ? @crystal aurora
just type your proplem
thats is it
i dont understand english man
then i can copy your proplem and i will go to google traduction
is everything fine here?
feel free to submit a @crisp hazel report with more context
idk whats happends with this guy
they want mute me for no reseon
there a staff here explain your proplem ! @crystal aurora
is it just me or is gofek's voice robot-like
just tell me mute yourself thats is it
@crystal aurora a |= b for dictionaries shows more serious differences
(because it shows how it's not a = a | b)
I made an O(NlogN) solution
now I'll try to make it O(N)
ChatGPT is very good at proving wrong statements.
!e
def iadd(a, b):
a += b
example = 0
iadd(example, 1)
print(example)
example = [0]
iadd(example, [1])
print(example)
@delicate wren :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 0
002 | [0, 1]
every Python object is passed "by reference" in C context and "by value" in Python context
__iadd__ for list/dict returns self
was that the answer
or is that for something else
and mutates the value
lol
something else
oh ok
"+" -> operator.add?
there are two things that are usually correlated for __iadd__
mutability and returning self
yeah, it's quite good at lying about programming concepts
it wasn't python syntax
oh
that sounded like chat gtp
!e
def iadd(a, b):
a += b
class C:
def __init__(self, x):
self.x = x
def __repr__(self):
return f'C({self.x})'
def __iadd__(self, other):
self.x += other
return self
class D:
def __init__(self, x):
self.x = x
def __repr__(self):
return f'D({self.x})'
def __iadd__(self, other):
return D(self.x + other)
example = C(0)
iadd(example, 1)
print(example)
example = D(0)
iadd(example, 1)
print(example)
@delicate wren :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | C(1)
002 | D(0)
@candid garnet
the whole difference is __iadd__ implementation
fuck ChatGPT. no one cares what it says.
think for your fucking self.
oh wow.... wtf i just learned something
thanks but how do i use it
there is no concept in python of "passing by reference vs passing by value"
@candid garnet look there.
I'm relatively new to programming, and went briefly into memory efficiency, but never really seen an application appear like that. So kinda wild
the difference is only whether or not __iadd__ mutates the object
object can be mutable in both cases
for immutable objects, __iadd__ can't be mutating
for mutable objects, it is not guaranteed to be mutating
class CustomList(list):
def __iadd__(self, other):
return self.__add__(other)
just to display it
!e
class C:
def __repr__(self):
return 'C()'
print(C())
@delicate wren :white_check_mark: Your 3.11 eval job has completed with return code 0.
C()
@delicate wren :white_check_mark: Your 3.11 eval job has completed with return code 0.
<__main__.C object at 0x7fe65d828110>
this is not recursive
a += b
a = a.__iadd__(b)
!d operator.iadd
operator.iadd(a, b)``````py
operator.__iadd__(a, b)```
`a = iadd(a, b)` is equivalent to `a += b`.
@crystal aurora could you repeat?
I'd probably look into how TikZ does geometry in PDFs
(although it lives several layers of abstraction above PDF itself)
some suggest this
https://xournalpp.github.io/
it's GPL 2
I completed the kata
(no spoilers because it's quite good and other people should attempt it)
there exists such thing as a selection bias.
weaker in what sense
I know what's more powerful than C++
C
even in C you can "pass by value" but still have the structure mutated
because it may have pointers
@candid garnet :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1 ['a', 'b']
002 | 1 ['a', 'b']
basically just brute-forced the solution without much thinking
!e
from os import urandom
s = urandom(32).hex()
print(id(s))
s += "a"
print(id(s))
@delicate wren :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 140333271212848
002 | 140333271212720
I forgot how to do that
@candid garnet :white_check_mark: Your 3.11 eval job has completed with return code 0.
1 ['a']
sometimes ids are the same
sometimes
because
strings are mutable
if there is only one reference
this shatters any idea of trying to apply principles of mutability/"passing by reference" to __iadd__ behaviour
if you want something that has strict += semantics, use Rust
which requires owning being able to mutate the value
!e
def real_pass_by_reference(__reference, __locals):
__locals[__reference] += 1
example = 0
real_pass_by_reference("example", locals())
print(example)
@delicate wren :white_check_mark: Your 3.11 eval job has completed with return code 0.
1
idk how to make it better
@pastel rapids colab is free with limitations
I just use JupyterHub
(self-hosted)
apache httpd?
Rust broke everything
who the hell now knows what's low-level, what's high-level when it exists
interesting type signature, tbh
https://www.codewars.com/kata/54e6533c92449cc251001667/train/rust
T is not Copy/Clone
@pastel rapids the whole point of colab is the VM that you can access from anywhere
if you want something similar locally, you'd probably use JupyterLab
i am trying to make a subprogram which loops through an array
to try and find the corresponding grade
But i cant seem to find what my error is
it would be great if someone could help
sup
["A", 83]
it throws an error because you compare 50 to "83" instead of 83
also, you don't need range
you can do
for grade_letter, grade_score in grades:
if user_in >= grade_score:
return grade_letter
:incoming_envelope: :ok_hand: applied timeout to @misty sinew until <t:1681260954:f> (10 minutes) (reason: burst spam - sent 8 messages).
The <@&831776746206265384> have been alerted for review.
!tvmute 473940630716940299 2w don't spam to get voice verified, as the guidelines clearly state.
:incoming_envelope: :ok_hand: applied voice mute to @misty sinew until <t:1682470090:f> (14 days).
Why I cant speak in the voice chat?
!voice
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Do you know why my nickname is 'Dobro Opt'?
It is because 'Dobro' in Russian Language means 'goodless'
did you mean "goodness"?
yes
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@delicate wren i want to connect domain can you help me out to web site
DNS configuration?
that usually depends on the specific registry you use
i will share the screen
no
ok
usually there are per-domain settings on the provider's site
i get confuse in that lot
yes
you would probably need A record if you have IPv4
if you use something like AWS, there might be simpler options
If you already own a domain, please make these 2 changes in your DNS settings (should be found on your registrar's account):
Add an empty (@) A record with the value 34.96.116.138 (delete any other A records you have)
Add a 'www' CNAME with the value of im-router-service.com (without the http:// prefix)
If you are still not sure what to do you can just forward this email to your domain registrar and ask them to make the changes for you.
If you have any questions or need assistance, please do not hesitate to contact us by with your domain name, and 'Editor URL' (copy the URL from address bar while in the editor).
i have to do this
i have go daddy domain
i have domain name
you have IP already, right?
of that form, yes
if i able to share screen then we can do it easly
there are two different types of a record
i see some video on that but it didn't work
(mentioned there)
A and CNAME
A is domain -> IP
CNAME is domain -> domain
@runic knoll Come test here?
how to test it here?
The other voice channel.
ooh ok lol
i thought you meant test the match/switch, I was confused lol
I'm thinking about whether I should publish the data base thing I was building on PyPI
idk if it would be useful to anyone
though it might be
the main thing that goes for it was the ease of use
it's just a key-value store which requires almost zero configuration
"just use json" easily fails on power cuts
and also that it's python-native in-memory data base storing everything in the same process
basically, it's just a dictionary backed up on disk
"Building compilation database compile_commands.json"
works very good for small projects
works very bad for big projects
ig
setting up the Db is just one async with statement
import pathlib
from library import DbFactory, KVJson
async def main():
async with DbFactory(pathlib.Path('example.db'), kvfactory=KVJson()) as connection:
await _main(connection)
it doesn't even have proper name yet
another appealing thing is that all reads are sync
and writes can be either sync or async
async def _main(connection: DbConnection):
value0 = connection.get('increment-0', 0)
await connection.set('increment-0', value0 + 1)
value1 = connection.get('increment-1', 0)
connection.set_nowait('increment-1', value1 + 1)
await connection.commit()
sync writes don't guarantee consistency until commit exits
it's kind of used for the specific niche of one-process small applications/services
hypothetically, a more robust, distributed solution could be built on top of it
another difficulty is that I'd have to maintain two separate versions of docs
because the current one has some specific details that aren't perfectly suitable for public docs
history of development and projects that use the that library
Erlang's built-in DB has quite a good name
Mnesia
as in opposite of amnesia
should attempt porting it to Rust in some capacity
(that would help improving the Python implementation too)
the implementation I currently have is not as far away from clean state-machine-like code as it was in the early stages of development
unions are rare due to extreme unsafety
Yeah that's a lot nicer.
brb
What are we doing π
oh
i was muted π
Poor foreign women, who are actually for real π
In computing, endianness is the order or sequence of bytes of a word of digital data in computer memory. Endianness is primarily expressed as big-endian (BE) or little-endian (LE). A big-endian system stores the most significant byte of a word at the smallest memory address and the least significant byte at the largest.
A little-endian system, ...
that
@misty sinew
What projects you working on? π
I work on my website & networking security...
https:// for secure...
& working on my own API
For twitch etc... in Python π
cool story
What projects you doing? What you doing?
What you say about API? π
sorry the cool story wasnt to you. was to the talkers
didnt mean to b rude
What you doing mate?
What you progamming?
You in school?
Self study?
I self-studied myself...
no i just code for fun
Ah, i dont do it for fun, i'm a developer π
nuffin right now
What you going call the language π
Set the API headers and parameters
headers = {
'Client-ID': 'client',
'Authorization': 'auth'
}
params = {
'user_id': user_id
}
Check if the user is currently streaming
streams_response = requests.get(streams_endpoint, headers=headers, params=params).json()
if 'data' in streams_response and streams_response['data']:
# If the user is streaming, get information about the most recent video from that stream
video_params = {
'user_id': user_id,
'first': '1',
'sort': 'time',
'type': 'archive'
}
videos_response = requests.get(videos_endpoint, headers=headers, params=video_params).json()
if 'data' in videos_response and videos_response['data']:
# If the user has recent videos from their stream, you can use the URL of the first video to broadcast it
video_url = videos_response['data'][0]['url']
print(f"The user is streaming and their most recent video is available at {video_url}")
else:
print("The user is streaming, but there are no available videos from their stream")
else:
print("The user is not currently streaming")
thats where im at related to python π
i have auth key but it dont work...
i have another code, it works if i put helix/stream
but not if i put my own client /stream
If i have 2 computers only & 1laptop...
What i do i need 2 linux, i want windows on laptop for school...
Harddrive! π
I don't follow, are you asking what you would need to do to install Linux onto one of the computers?
Noo, im just considering how to set my eniovrement i have ubuntu but want a kali...
But there is so much data on the ubuntu now...
yeah...
Where i put kali, on my laptop?
Can i use it for web development school then?
Not my gaming PC...
Ninjas are for Halloween, not for the workplace.
You have Kali as a virtual machine or installed on a flashdrive or something
Don't develop on Kali.
Kali works for school?
I might start in august...
& wouldnt it be difficult getting windows back?
I dont have bootable windows...
Learn how to create installation media for installing or reinstalling Windows 7, Windows 8.1, or Windows 10.
Easy enough to make an install flashdrive for Windows
Kali is something you throw onto a bootable usb or dvd and you boot up into it when you want to use its tools.
Okay i get my USB tomorrow π
i have a sata disk, i just change disk on my gamer?
Or virtual box in my opinion
Or virtual box.
not a fan of virtual box
Yeah it's easier I'm my case I don't have to carry anything
Diffferent OS, different hardware...
Yeah good point
QEMU, then. Virtualbox is easier.
I have dozens for that reason
They leaving to focus on progamming...
Yes every man needs an usb pen π
Bakers' or standard?
Perspective.. π
@terse osprey I might bend your ear about some SNES stuff
I so want to travel like my father...
Tech, that's easy enough, aren't it...
You know, chill...
Looking into doing that as well, ideally being able to read from my carts to run from them directly
But now adays, alot is stationairy isnt it, home work...
I could put a kali on laptop...
It's just data, what if i need to reset on school...
They should teach in linux..
That's exspectations raised...
We raise the wrong exspectations probably
Sauce-pouring emulation comes in two distinct forms: Open sauce and closed sauce.
If youre not willing to reinstall your pc...
Or maybe they dont know, country matters..
Nobody knows what a linux are..
Of course they dont learn it where i go...
!e ```py
class MyBool(bool):
pass
MyBool()```
@stuck bluff :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 | class MyBool(bool):
004 | TypeError: type 'bool' is not an acceptable base type
π
@candid garnet what are you making? i am not allowed to voice chat yet
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
yeah, i dont have enough of the criteria met
it was working for me
@ornate cobalt can you explain what a bucket is in this context, i feel like i understood this at one point but forgot.
ahh okay so normally does it just remake the entire map if it needs more buckets?
@ornate cobalt ahh okay so normally does it just remake the entire map if it needs more buckets?
@ornate cobalt is it fast tho
@ornate cobalt yeah but is it fast c
@ornate cobalt millions of things per second or ur not even C plus plussing
@ornate cobalt i agree with Krzystof, we need bucketception
@sly pond stream some python for us
like the srvr wont let you?
Besides, I don't have anything to do with Python anyways, I use it like 2x a year for PyWeek
and occasionally for some automation of a boring process
what do you normally program in?
flutter and php
β€οΈ SQL too
I generally try to stay away from the PHP, but when something needs done
i only know python, just started programming 4 months ago
i hope these messages count towards my 50 messages needed to enable voice chat
ai gonna take over the world soon, then all we need is python to program the ai
some1 needs to make a voice changer that mimics the robot lag voice
if it isnt already out
Yea, it's a strange effect
earlier you said something about intellij and it didnt sound positive, is there something i should know? i use pycharm
ahh i see
i genuinely havent seen anything that impressive about vim but im still new so : /
I love the console
and the fact that vi is accessible in near every terminal you ssh into is convenient
i'v watched some videos where people are like: "look at this think you can do really fast in vim" and i can do it pretty much just as fast in pycharm
once you know how to maneuver in vim it's quite fun
just like CI then something
to swap out a string, contents of a function
it's a whole different way to navigate your code
it's like code surfing instead of just walking
sorry for asking this so suddenly, i'm learning python so i can get a job ( currently i'm 15yo, next month i will be 16yo ), can i get a job just with python if i'm good at it?
never heard about it
learn containers, learn git, learn the tools as well
but i'll be taking notes
how to deploy and maintain projects
but if you stick with it, you can definitely find yourself a jobnn
I highly recommend trying pyweek, every 6 months the server hosts a weeklong game jam
just wrapped one up
how long have you been programming DINO?
i'm learning through a book, i think the english name is "Think Python", i've been saving my version of every exercise in the book so i maybe publish them on git for future purposes
3-4 days but i'm very pleased with the results
am i allowed to send some scripts i made here?
i have no idea, i would assume so. it is a python discord and i see code linked in other places
!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.
easiest way to share lots of code
k
!code if they're short feel free to embed
pls don't mind the language, i'm brazilian
you're doing great
def draw_line(x):
if x > 1:
print("+ - - - - "*x + "+")
else:
print("+ - - - - +")
def vertical_line(x,y):
while y >= 1:
if x > 1:
print("| "*x + "|")
y -= 1
else:
print("| |")
y -= 1
def draw_square(x):
y = (x)
if x == 1:
draw_line(x)
vertical_line(x,x*3)
draw_line(x)
elif x >= 1:
draw_line(x)
while y >= 1:
vertical_line(x,3)
draw_line(x)
y -= 1
while True:
x = (input('Escolha um valor: '))
if x.find('.') == 1 or x.find(',') == 1:
print ("VocΓͺ precisa definir um valor inteiro")
break
x = int(x)
if x <= 0:
print ("VocΓͺ precisa definir um valor positivo.")
else:
draw_square(x)
break
that was the first code i've created
it generates proportional squares with a value you give it ( the code refuses the value if it's a float or a negative )
Wonder if I can find my first scripts
the first language i've tried to learn was Java but i was taking so long to learn so little
being able to build this by myself in the first day with Python pleases me a lot
Ooh, found one of my really old ones
may i see it?
i only really make stuff that helps me understand python better
oh, like docs?
im not sure what you mean by docs, what i mean is for example, i recently realized i didnt understand how slicing with negative indices worked so i make a function to visualize it
def get_initial(name, force_upper=True):
if force_upper:
initial = name[:1].upper() # Gets first from name, upper cases it
else:
initial = name[:1]
return initial # Returns the initial
print(get_initial('john'))```
the oldest script I found on this computer
now i get it, i should follow your example and do the same, but i'm trusting myself not to forget what everything does XD
from datetime import * # Calls datetime Library
now = datetime.now()
day = now.day
hour = now.hour
minute = now.minute
second = now.second
micro = now.microsecond``` has this gem of a comment
that rlly isn't bad for a first script
where did you started learning?
I used automate the boring stuff, kaggle, Real Python
to start
went through until I got stuck, then moved to the next one
then went until I was stuck and moved to the next one
then went until I was stuck and went back to where I left off on the first one
at which point I would wonder why I even got stuck at all, and push forward a few more chapters
automate the boring stuff was too boring for me :*(
then get stuck and move to kaggle, then brush up on Real Python
and repeat
Utilizing multiple resources really hammered the concepts in
my problem is that i know the code, but i dont know what to do with it, so i need the book to give me exercises
Make a game
i'v been doing stuff in pygame
have you done hangman / tic tac toe / connect 4 in the terminal yet?
i was thinking about making a full ASCII game with Python while taking a shower
good ones to do
but that's a good idea
start with rock paper scissors
but drawing and managing the tic tac toe / connect 4 board is fun
drawing a stick figure is a lot of fun too
I recommend raw strings, but you do what you want π
i think i can code this one rn
yea, that one shouldn't take too long
You can also make an ATM / bank
no need for persistent storage
but let people make accounts
deposit money
withdraw money
check balances
give em a pin
or let em pick
not so sure how i would make tic tac toe, i don't know how to make an app interface, neither a good control for selecting the square on the console
i will be taking note of these so i can have something to post on my git when i start using it xd
look into it
I'd do it in the console firsrt
just draw the board on multiple lines
>>> x = ' | | \n-----\n | |\n-----\n | |'
>>> print(x)
| |
-----
| |
-----
| |
>>>```
Then there's the fancy box characters
understood
probably the user would choose the input on a to c, 1 to 3 format
That'll work
if i'm allowed to ask, how would you do it? ( the selection part )
I went with numbers
like x, y?
displayed 1-9 initially in the grid
ooooh
then replaced em with X's and O's as you play
that's neat
I felt it was pretty intuitive
like a dial from an old phone
yea
yea it is
that's the exercise i'm doing rn
def uses_only(palavra,lista_negra):
for letter in palavra:
if lista_negra.find(letter) == -1:
return False
break
return True
You should try naming things in English, it's easier to collaborate, and then you'll be brushing up your English while programming
the keywords are all English anyways, it's the defacto language of code
yea, since i'm on a english server that would be the best way to go
I speak english fluently, been speaking all my life, and even I struggle naming variables
come suffer with us in English π
You'll learn a lot of fun words along the way
TheLocationWhereICanFindGoodCoffeButPayingLow = 0
although_python_likes_snake_case
PascalCase for classes
I think the rest goes snake_case
whereas Dart, what I normally work with is camelCase for variables, PascalCase for classes, and snake_case for files...
def uses_only(word,black_list):
for letter in word:
if black_list.find(letter) == -1:
return False
break
return True
can u understand it better now?
it returns True if only the black_list letter is used in the word? aaaaa returns true with a
is anyone aware of any japanese coding languages?
absolutely
Who is familiar with Dolittle?
π π₯
I guess it looks like black_list could be a list even
or a longer string
can you pass ab into 34?
if it looks like a π¦
you've got me confuse now
line 34
Oh
print(uses_only('aaaaaaab', 'ab'))``` would that return true?
it would
!e```py
def uses_only(word,black_list):
for letter in word:
if black_list.find(letter) == -1:
return False
break
return True
print(uses_only('bananas', 'ba'))
print(uses_only('bananas', 'bans'))```
β€οΈ this server
so fun
i get rlly happy by spending time solving exercises on it
Yea, the AI makes it even more fun, but you gotta learn what you're doing first
then you can let the computer do it for you
i will be working hard on Python this year, i live on a small city, so if i find a job it needs to be a remote one
It is a worthwhile endeavor
and i think that having the privilege to work from home must be only to good developers
You can be self employed, help local people with programmatic solutions
automate processes
that's a valid option too
as long as i'm getting paid, i would accept it
yes xd
You can automate many processes
that people who don't quite know how to use a computer take hours, to take seconds or less
I bet using the word spam in more messages will help your situation
will it -_-
i will be heading to bed rn, i need to wake up at 5am for school so i need some zzz's
bye π
sleep is critical
pce
goodnight
goodnight y'all
board = [["_"] * 3 for _ in range(3)]
map_commands = {
"top left": board[0][0],
"top": board[0][1],
"top right": board[0][2],
"left": board[1][0],
"middle": board[1][1],
"right": board[1][2],
"bottom left": board[2][0],
"bottom": board[2][1],
"bottom right": board[2][2],
}
while True:
player_input = input("choose: top, bottom, left, right or top left, top right, bottom left, bottom right: ")
map_commands[player_input] = "X"
for row in board:
for char in row:
print(f'{char: >3}', end="")
print()
i think it doesnt work the way i planned because the char is immutable
i think it should work if the value in the map is a mutable datatype
but then its not simple
@keen magnet mCoding has a good video on generators and the yield from keyword: https://youtu.be/tmeKsb2Fras?t=785
Python generators are lazy sequences and pausable functions.
β mCoding with James Murphy (https://mcoding.io)
Source code: https://github.com/mCodingLLC/VideosSampleCode
Generators as coros: https://peps.python.org/pep-0342/
For loops vid: https://youtu.be/Xd760PcgfPg
SUPPORT ME β
Patreon: h...
board = [[list("_") for _ in range(3)] for _ in range(3)]
map_commands = {
"top left": board[0][0],
"top": board[0][1],
"top right": board[0][2],
"left": board[1][0],
"middle": board[1][1],
"right": board[1][2],
"bottom left": board[2][0],
"bottom": board[2][1],
"bottom right": board[2][2],
}
player = 0
while True:
player_input = input("choose: top, bottom, left, right or top left, top right, bottom left, bottom right: ")
if player % 2 == 0:
map_commands[player_input][0] = "X"
else:
map_commands[player_input][0] = "O"
player += 1
for row in board:
for char in row:
print(f'{char[0]: >3}', end="")
print()
finished
@pale pivot the way you are showing them the yield from keyword is just a substitute for a for loop, which is not what it was introduced into the language for, according to mCoding. i linked a video earlier if you want to watch it.
I wasn't implying that, I showed off some coroutines with it so I'm not sure what you mean
@pale pivot maybe i missed that, also im new to programming so i could be wrong.
your wild man this shit is impressive, how long have you been coding?
what r u coding ?
@ornate cobalt what are you trying to build?
!stream 500168097852948482
β @terse osprey can now stream until <t:1681789501:f>.
oh, times up lol
a game fellas?
didn't notice it's vc1 not vc0
@misty sinew @ornate cobalt next will be JS only
or JS, Python, Ruby, so no complaints
I'm not risking adding Perl to the list
are this settings OK for the next one?
Ruby is so cursed
it's way better for code golf than Python
oh
both are imperfect then
ik how to make it 42
now
I'm going to lose to Ruby
I haven't used Ruby in a while, am a bit rusty, don't you worry