#voice-chat-text-1
1 messages Β· Page 36 of 1
i got it; I will come back here and will let you guys know how i did it
you guys are really awesome
i really appreciate the support!
what are your thoughts on current market?
yeah
job
where are you from?
wait, you're not employed yet?
bro, you sounds like 30
bruhh, fr
def factorial(number):
for x in range(1,number):
number = number * x
return number
i am a science dude:)
going to AI/ML?
i dont have any idea about that currently i am just trying to figure out how i can learn "a programming language"
I see, have you ever tried before?
from what did you start?
fr he is
i am learning basic py from YT
programming
okay there's one stupid question:
how is this going to work, let's say i know a language now, how do I implement it?
i want to start with simple and then go on
yeah i get
i think I eventually will get it, will i?
no bro
i really want to do it, but then i dont know anything:(
what do you mean by, "then I don't know anything"
i wanted to be a programmer i wish i work but considering the current downfall and recession i am afraid and that's the reason i am kinda delusional
i have started writing a code in vscode from last week
that's python
bro, see this type of situation will come and go, if you're distracted by these things then that obvious you won't be able to concentrate on learning.
so first of all clear these assumptions, and concentrate on learning ik its harder, I've faced this too but focusing on learning first its faar better than first focusing on how much I can earn it with that.
start from basics, ig a course from freecodecamp maybe helpful, where the dr chuck teaches the python
let me see if I can find it
are you a dev?
just joined several months ago
Here it is, https://www.youtube.com/watch?v=8DvywoWv6fI
Ik this one is old, but believe me this will be helpful
yup
I am learning python from a national dev
aah that's good
and I feel like he also does explain better
then at what point you're feeling that you're lost?
im just confused with my uni and my own learning
I want to learn python first
and then I will focus on java
i feel like i will be left behind if i learn java as they say
Aah this syllabus sucks, fr me it was same, ig Java and (CPP or C#) both were in one semester
you won't, if programming concepts are clear.
the languages are just medium to connect with it. each and every language has its own unique value you've to find it what will be useful what will be not and at what point.
in simple words, have you played valorant?
yeah
counter strike?
:)))
call of duty?
see if you know shooting on head, then you can do it in every game, but each and every game has different layout and different sensitivity you've to know and learn to control it.
are you employed?
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
class Admin:
def __init__(self):
self.name = "Shayan"
self.age = "23"
self.__access = "root"
def get_access(self):
return self.__access
def set_access(self, new):
self.__access = new
admin = Admin()
print(admin.name)
print(admin.age)
print(admin.get_access())
print("-------------------------")
age = 25
name = "Borzu"
Admin().set_access("user")
print(admin.name)
print(admin.age)
print(admin.get_access())
Likewise, have a nice day!
class Name:
def __init__(self, first_name, last_name):
self.first_name = first_name
self.last_name = last_name
def answer(self):
return f"{self.first_name} {self.last_name}"
@classmethod
def splitter(cls, strng):
first_name, last_name = strng.split()
return cls(first_name, last_name)
name = Name.spliter("Shin Ryuko")
print(name.answer())
class = cls
tnq
def _non_parameterized_single_qubit_gate(self,
gate: Literal["I", "X", "Y", "Z", "H", "S", "T"],
qubit_indices: int | Collection[int]) -> None:
# Define the gate mapping for the non-parameterized single qubit gates
gate_mapping = {
"I": I,
"X": X,
"Y": Y,
"Z": Z,
"H": H,
"S": S,
"T": T
}
# Apply the gate to the specified qubit(s)
if isinstance(qubit_indices, Collection):
for index in qubit_indices:
self.circuit.append(gate_mapping[gate](self.qr[index]))
else:
self.circuit.append(gate_mapping[gate](self.qr[qubit_indices]))
def _parameterized_single_qubit_gate(self,
gate: Literal["RX", "RY", "RZ"],
angle: float,
qubit_index: int) -> None:
# Define the gate mapping for the parameterized single qubit gates
gate_mapping = {
"RX": Rx(rads=angle),
"RY": Ry(rads=angle),
"RZ": Rz(rads=angle),
}
# Apply the gate to the specified qubit
self.circuit.append(gate_mapping[gate](self.qr[qubit_index]))
def _single_qubit_gate(self,
gate: Literal["I", "X", "Y", "Z", "H", "S", "T", "RX", "RY", "RZ"],
qubit_indices: int | Collection[int],
angle: float=0) -> None:
# Define the gate mapping for the non-parameterized single qubit gates
gate_mapping = {
"I": I,
"X": X,
"Y": Y,
"Z": Z,
"H": H,
"S": S,
"T": T,
"RX": Rx(rads=angle),
"RY": Ry(rads=angle),
"RZ": Rz(rads=angle)
}
# Apply the gate to the specified qubit(s)
if isinstance(qubit_indices, Collection):
for index in qubit_indices:
self.circuit.append(gate_mapping[gate](self.qr[index]))
else:
self.circuit.append(gate_mapping[gate](self.qr[qubit_indices]))
I've been thinking about the consequences of the "wrong abstraction." Β My RailsConf 2014 "all the little things" talk included a section where I asserted: > duplication is far cheaper than the wrong abstraction And in the summary, I went on to advise: >
@delicate wren alisa, is the new abstraction a good change or did I overdo it?
It works, and passes mypy, but as you mentioned before it's not an indicator of good code.
why doees the second one not have the if?
Why would it have an if?
You know German right?
Does it come with the flashy nose?
Dried reindeer meat. It is a traditional food and a delicacy of Northern Finland, prepared at springtime. Like jerky, of which kuivaliha is a variant of, its origins lie in the need for food preservation. Kuivaliha is a very useful snack when camping, etc., for its light weight and good nutrition values.
All I want for Christmas is one of Santa's reindeer π
Back in a bit. Gotta bathe these grubby kids.
Metal detector use here requires a mining license.
Use.
I may be misinformed.
Premium Burials.
It would have to be a bit of an indictment against the competency of doctors of the time.
Well don't they have that hammer thing with the pope? Or is it a spoon? i can't remember.
The corpse is placed in a cypress wood coffin, meant to signify humility and refer to the fact that the pope was an ordinary man first. Papal items, including palliums, or lambswool stoles, coins and medals minted during the individual's pontificate, are also placed in the casket
Why would it have an if?
We have a number of night noise animals here.
Foxes, possums and alpacas.
Bats, occasional birds.
A species of owl.
Which I've never seen, but heard.
I'm gonna take a break, brb.
very noisy
Didn't hear it, felt the air. The air felt soft.
also noisy
You see some images of these birds on logs and stuff, and unless you know they're there, they can be very difficult to spot.
Looks fast.
Dusks and dawns often are graced by a chorus of kookaburras, where I am.
Also Australian magpies.
...and all the others, of course.
Sometimes the magpies get confused at the moon.
Bye bye
@delicate wren I put the help ticket here, if you could have a look I'd deeply appreciate it.
https://discord.com/channels/267624335836053506/1261658498471559168
I am so stupid that I half-read your message and for a second thought dusks and dawns are actual bird species and patted myself on the back for thinking Dusk till Dawn could be a cute wordplay.
it's so silence
qubit
qubits
morning
us
it's early
take out the z's
a lot easier
then think about hte movie frozen
π
it's early
I'm gonna go make coffee, I do have an earbud in, so I am listening
it is life
so cybersec, what drew you in?
Yea, coffee maker is downstairs
Yea, I'm pretty quiet in the morning, it's why I'll often just type
gotta have the coffe and wake up
Ooh, permanent besties!
Geopolitical dance rivals
Did you see break is in the olympics?
I wonder if India and Pakistan entered, and if they did, it would be an amazing final
The lowering of the flags ceremony at the AttariβWagah border is a daily ceremony that the security forces of India (Border Security Force) and Pakistan (Pakistan Rangers) have jointly followed since 1959. The drill is characterized by elaborate and rapid dance-like manoeuvres and raising legs as high as possible, which have been described as "c...
no
rarely
Have you changed your diet?
new medicines?
stopped anything?
well then...
I think that's the cause, you're not comfortable in your sleeping environment
Yes it is a fact
What he said?
same
Is your profile pic a solar eclipse?
Nice
That cloud didnt go
The cloud came in at like noon
and got thicker and thicker
and ruined things, but in 2017 it was a sunny sky
though totality was nearly a minute shorter
Went to Charlotte for that one, and that's where I took my profile pic
editing
then completed the edit
though maybe I was typing, I do sometimes hit the key and delete
everyone do this
I missed that
Are you proggamming or not that is what he said
yeah
there are elections in us?
there will be later this year
but my US news tab is very empty
only one story in there
Apparently nothign else has happened in the US this weekend
Evening.
Already gone? I imagine not.
Is a fire over when someone stops lighting it?
What actually happened almost doesn't matter. What we need to look at is what effect it will have.
Hm. I don't know what happened. I have thoughts.
Tbf, they make conspiracy theories very easy.
Sorry, the shooter was what?
You're right, you don't even need a sniper to see the guy. I'm sort of wondering how he missed the shot from that close.
Also, what was with the secret service just letting Trump just stand around pumping his fist? Like, your guy just got shot and you're not forcing him off the stage?
Did they know it was the only one?
In that moment.
Did they know?
"Yeah, it's cool, just let your face stick out."
How was his reaction normal?
Like, if I get shot at, I'm pissing my pants and freezing.
I imagine. I've never been shot at.
Or maybe not. I might just blank. I don't hope to ever find out.
β€οΈ bingbot
herschel walker
The Republican candidate for the US Senate seat in Georgia, Herschel Walker, says during a speech in the town of McDonough that 'vampires are cool people'. Subscribe to Guardian News on YouTube βΊ http://bit.ly/guardianwiressub
The former football star says during rambling remarks: ''I donβt want to be a vampire any more. I want to be a werewolf...
gonna run
@fast path hi
@sly pond i know where you're from as long as your nickname is your name
are you from
P-O-L-A-N-D
did I guess?
kinda
You are not from US?
maybe he comes from Poland, but he lives in the US
maybe
Live in the US, most my life
Just vibing?
yessir
The SCP Foundation's 'top-secret' archives, declassified for your enjoyment.
huh
Russian SCP fork uses Rust+Python for the backend
fork of this
https://github.com/scpwiki/ftml
The SCP Foundation's 'top-secret' archives, declassified for your enjoyment.
if anyone is interested for whatever reason
https://github.com/SCPru/RuFoundation
Wannabe filmmaker man.
To support this channel and receive extra perks, please visit my Patreon page: https://www.patreon.com/EvanRoyalty
My Music: https://soundcloud.com/evan-royalty
Our discord server: https://discord.gg/FT6vt8d
For business inquiries, contact: EvanRoyalty123@Gmail.com
@cursive glen π
#scp #scpfoundation #forlornfoundry
Only ethically sourced, Non-GMO, Organic sugar was used in the making of these cookies.
Consider supporting us on Patreon to receive exclusive channel perks(Such as seeing our videos a day earlier!), as well as help the channel's production quality grow!
https://www.patreon.com/ForlornFoundry
Also check out ...
@gusty ether π
π
hola
I'm not useful, there.
can i screen share
!stream 1115939192141266954
β @grand iris can now stream until <t:1721060823:f>.
!e
import random
random_choice = random.randint(0, 1)
if random_choice == 1:
print("Heads")
elif random_choice == 0:
print("Tails")
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Tails
thanks ppl
!e
names = ["Angela", "Ben", "Jenny", "Michael", "Chloe"]
import random
# Get the total numbers of items in list.
num_items = len(names)
# Generate random numbers between 0 and the last index.
random_choice = random.randint(0, num_items - 1)
# Choose and print a random name.
print(f"{names[random_choice]} is going to buy the meal today!")
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Chloe is going to buy the meal today!
@raven orbit
!d random.choice
random.choice(seq)```
Return a random element from the non-empty sequence *seq*. If *seq* is empty, raises [`IndexError`](https://docs.python.org/3/library/exceptions.html#IndexError).
I was not allowed to use random.choice in my course π
random.randrange(stop)``````py
random.randrange(start, stop[, step])```
Return a randomly selected element from `range(start, stop, step)`.
This is roughly equivalent to `choice(range(start, stop, step))` but supports arbitrarily large ranges and is optimized for common cases.
The positional argument pattern matches the [`range()`](https://docs.python.org/3/library/stdtypes.html#range) function.
Keyword arguments should not be used because they can be interpreted in unexpected ways. For example `randrange(start=100)` is interpreted as `randrange(0, 100, 1)`.
Changed in version 3.2: [`randrange()`](https://docs.python.org/3/library/random.html#random.randrange) is more sophisticated about producing equally distributed values. Formerly it used a style like `int(random()*n)` which could produce slightly uneven distributions.
!e
import random
names = ["Angela", "Ben", "Jenny", "Michael", "Chloe"]
# Get the total number of items in the list.
num_items = len(names)
# Generate a random number.
random_choice = random.randrange(num_items)
# Choose and print a random name.
print(f"{names[random_choice]} is going to buy the meal today!")
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Chloe is going to buy the meal today!
!e
import random
names = ["Angela", "Ben", "Jenny", "Michael", "Chloe"]
random_choice = random.randrange(len(names))
print(f"{names[random_choice]} is going to buy the meal today!")
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Angela is going to buy the meal today!
hey!
yea, I do...
oh god, I forgot your username... I can't ping you...
I'm new to the server so can't speak in the VC right now...
come back...π
hello @stuck bluff
I can't speak ;-;
Yea, I gotta spend more time here ig...
bruh, I can't even type in the VC room 1 chat lol!
should I share my screen? You guys can help me correct my mistakes... @stuck bluff @proper ridge
@misty sinew π
ah! I see... So how do I "interact" with the returned value?
oooh... I wrote a code which does not require the return keyword but I can interact with the defined functions regardless.... Can you explain ti me why does that work?
wait, I'll copy and paste the code
def happy_bday():
print("HAPPY BDAY!")
print(f"enjoy being X years old")
print() # <=====to leave a line... makes the code look tidy, nothing else.
happy_bday()
happy_bday()
#So. What did we do here?
#Well, we "defined" a functin called happy bday since we had to compile it multiple times(Don't ask why, I don't fucking know.)
#How to define a function: def function():
# print("whatever u want it to say")
def happy_bday(name, age): #here, we've defined a perameter
print(f"HAPPY BDAY, {name}")
print(f"enjoy being {age} years old")
print()
happy_bday("Pranjal",19) #here, we've assinged the name parameter a "value"
happy_bday("Samarth",19)
happy_bday("some random guy",1000000)
#----------------------------------------------------------------------------------------------------------------------------------
#Let's fuck it up a little, shall we? π
def happy_bday(age, name):
print(f"HAPPY BDAY, {name}")
print(f"enjoy being {age} years old")
print()
.
I make my notes in VS code so it's elaborated...
yep
I mean, I can call and change the defined functions by doinf this too... wait.., what do you mean by that? "it is meant to print somethin and not get info out of it" I didn't get that.... @stuck bluff
I'm so dumb... ;-;
ah... I see
hmmm
ok... I'll need some time to figure that out... Bruh, you guys are so smart! me scared :3
πββοΈ yup right...me scared too
I shall apply myself.
Damn, you sound so wise! It's nice to find ppl who can guide me!
Thank you so much! β€οΈ
haha!
you read philosophy?
Are you a professor at some uni? You sound like one... Most of the ppl I've asked help from just ignore me or laugh at my face.... or, my screen... ok, that was a bad joke
I'm sure that I won't be the last lol
abyway, gtg... let's hope that the next time I'm here, my voice wouldn't be supressed by the evils of this world....
[Lightning strike to make it look more dramatic]
k, bye!
No worries π
Let me take a quick look at the code, one sec.
So the wrapping function just checks some stuff before calling the wrapped method?
Why do you use Sequence? Just for generality?
Do the methods mutate the data?
def _single_qubit_gate(self,
gate: Literal["I", "X", "Y", "Z", "H", "S", "T", "RX", "RY", "RZ"],
qubit_indices: int | Sequence[int],
angle: float=0) -> None:
# Define the gate mapping for the non-parameterized single qubit gates
gate_mapping = {
"I": I,
"X": X,
"Y": Y,
"Z": Z,
"H": H,
"S": S,
"T": T,
"RX": Rx(rads=angle),
"RY": Ry(rads=angle),
"RZ": Rz(rads=angle)
}
# Apply the gate to the specified qubit(s)
if isinstance(qubit_indices, Sequence):
for index in qubit_indices:
self.circuit.append(gate_mapping[gate](self.qr[index]))
else:
self.circuit.append(gate_mapping[gate](self.qr[qubit_indices]))
__len__, __getitem__, and __iter__.
No mic today, in a quiet zone
Final goal is to have the qubit_indices of the decorated methods to be int | Sequence[int].
The gate methods themselves don't mutate the qubit_indices. I only need mutability for self.circuit_log because I mutate that in self.vertical_reverse() for instance.
Hey Opal
Hey Opal
I am confused sorry π
The wrapper returned by the decorator doesn't have a different signature from the function it's wrapping right?
def X(self,
qubit_indices: int | Sequence[int]):
...
@gatemethod
def X(self,
qubit_indices: int | list[int]):
...
Vc0 is full of streamer brainrot lol
Some of these books aren't as useful as others lol
And some I kinda want a copy for myself lol
It usually gets taught alongside sed
Oh boy
Some of these books are OLD
Hello
@gusty ether @misty sinew π
Pretty sure this is pre-json
π
π
Trying to see if they have a copy of "Hating on Languages You Don't Use"
Settled on these three for this week. The library card is such an unsung hero when you are on a budget.
So as I understand it, your intention with the decorator is to return a wrapper function (with the same signature as the wrapped function) that basically checks some stuff and does some logging, and then calls the wrapped function? It shouldn't matter what the wrapping function does to values it's passed, as long as it's not trying to do things that can't be done to values of their type π€ Have you learned about using ParamSpec to type hint decorators? https://www.youtube.com/watch?v=fwZoxWyMGM8
today I talk about the relatively new PEP 612 and how it can be used to accurately type decorators!
- decorators: https://youtu.be/WDMr6WolKUM
playlist: https://www.youtube.com/playlist?list=PLWBKAf81pmOaP9naRiNAqug6EBnkPakvY
==========
twitch: https://twitch.tv/anthonywritescode
dicsord: https://discord.gg/xDKGPaW
twitter: https://twitter.c...
But I agree with Opal. Keep it simple π
!zen
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
if the decorator is the same as we talked about earlier, you'd typehint qubit_indices as list[int]. the @gatemethod would then return something expecting a int | Sequence[int]
(to be fair, i think just having it inside the method definition could be easier, because then you dont need decorators for each signature. but its an interesting problem anyways)
is there a situation where you can say typing is additional work and slows you down in development when you need to move fast?
Type hinting should be secondary when writing Python code in my opinion.
Although it can help guide the design of your code
i am used to statically typed languages so not having a typehint somewhere (where it cant be inferred) makes me confused. type stubs also allow to chart out stuff
Yes, it's that. I was trying to see if there were other ways around it. You're absolutely right about it being a list.
This is because as you saw if I type hint the decorator (with the callable), it would only be applicable to one signature as opposed to how I have it now which works with any signature.
Type hinting can be fun though. It's like solving little puzzles π
You know, since it's just a checker for values, and just logs the params, what if I just put it inside instead of using it as a decorator?
^ yeah, i suggested that right now. i think thats the least complex approach. maybe will look a bit repetitive and copy-pastish but whatever
Yes, thank you so much. Still trying to wrap my head around what wouldn't make people barf.
I honestly want to write this in a clean manner.
Yeah sorry @proper ridge I'm not really familiar enough with the code, so I don't really understand what's going on. I recommend watching that video I linked if you're generally usure about how to go about type-hinting decorators with wrapping functions.
use haskell for 10 minutes will learn more than from any video about typehinting
Please don't apologize. I have to apologize for wasting your time (and Lambda's and others) with my question.
nah solving type problems is my hobby
Sorry, just going to check in on vc0 for a sec
I truly wish I could ask you to have a look at the full module (basically just the ABC and the 4 subclasses) and let me know what you think, but I don't dare ask.
Thank you so much LX!
typing vs comments: maybe we use typing if we don't want to add comments on small chunks of functions? hehe
!e
target = 100
for number in range(1, target + 1):
if number % 3 == 0 and number % 5 == 0:
print("FizzBuzz")
elif number % 3 == 0:
print("Fizz")
elif number % 5 == 0:
print("Buzz")
else:
print(number)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 1
002 | 2
003 | Fizz
004 | 4
005 | Buzz
006 | Fizz
007 | 7
008 | 8
009 | Fizz
010 | Buzz
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/MDIWC4A2VWBTH6BYCOJU2QSYOY
!zen
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
The code I wrote 2-3 years ago, now whenever I read that code. I'm like when did I write this code huh, it can be done in this in the easiest and shortest way.
it's true we need practice
i cannot speaketh
!e
#Password Generator Project
import random
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+']
print("Welcome to the PyPassword Generator!")
# nr_letters = int(input("How many letters would you like in your password?\n"))
nr_letters = 12
# nr_symbols = int(input(f"How many symbols would you like?\n"))
nr_symbols = 8
# nr_numbers = int(input(f"How many numbers would you like?\n"))
nr_numbers = 4
password_list = [""]
for char in range(1, nr_letters + 1):
password_list.append(random.choice(letters))
for char in range(1, nr_symbols + 1):
password_list.append(random.choice(symbols))
for char in range(1, nr_numbers + 1):
password_list.append(random.choice(numbers))
random.shuffle(password_list)
password = ""
for char in password_list:
password += char
print(f"Your password is: {password}")
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | Welcome to the PyPassword Generator!
002 | Your password is: n+s5V(gtU++ez+U8D*lT($08
!pypi qoin
HELLUUUUU
π₯Ή Hi! I just wanna listen
guess whos baccc
cute lady bug?
@obtuse valve Everyone say pytorch is best
depends on your compute limits i guess
eg you can have a "jetson nano" and you can claim that it's a "tensor processing unit"
alternately you can use distillation i guess
but then again, what is your compute requirements
"edge compute"
reinforcemen tklearning whoohohohohohohohohohoohjohohhoho
See ya guys
seeya
GN
gn
lol the wifi in the attic sucks
iirc mr hemlock told me that it was default in rotterdam
.
Run the !u command in #bot-commands
But make sure not to spam messages!
@south flame π
okey
@rough pasture π
Hi @stuck bluff
i leave 30min
I don't have a permission to speak! How can get that?
there @rough pasture
Thanks man @south flame
your welcome
@fiery sage π
π
@paper raptor π
@stuck bluff π
text[:,1] = [x-min(text[:,1]) for x in text[:,1]]
text[:,1] = [x/max(text[:,1]) for x in text[:,1]]```
import numpy as np
create an array
data = np.array([[12, 29], [33, 50],
[5, 15], [0, 10]])
normalized_data = (data-np.min(data))/(np.max(data)-np.min(data))
normalized data using min max value
print(normalized_data)
!e py import numpy as np arr = np.array([50, 2, 12]) arr = arr - arr.min() arr = arr / arr.max() print(arr)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
[1. 0. 0.20833333]
yo
@proper junco If your low-income in the Us it helps 10000%
college affordability eu vs us
I joined late mb
I dont have vc unlocked yet xd
@dry pendant whats the startup concept?
you can talk i can hear you if you want or you can type
break up courses into individual concepts. https://conceptual.fyi/ (eventually)
it's what I'm working on tonight and for the last 3 years.
ah I see interesting
Ignore my non-sense messages trying to get up to 50 without spamming chats
yes
I'm trying to find out what people want and how much they would pay for on-demand concept based learning.
@dry pendant keyboard sounds are quite loud; do you have Krisp enabled?
hi @delicate wren
didn't know that was a thing.
We love the asmr keyboard
I'll see
got a headset instead of the laptop mic.
@dry pendant keep the same settings you had before and just lower ur sensitivity
your mic got worse
you can go into voice settings and just lower the bar to where you keyboard isnt picked up
I don't think sensitivity would help there
the mic is muffled somewhat
would stop the keyboard no?
not if it's that loud
maybe
i see what youre saying
my keyboard is super loud but discord normally can tell since its farther from the mic
@proper junco live coding may be able to?
or no
it's restricted similarly everywhere
ah rip
I can't stream in any channel..
its just global disabled
!source video
Unable to convert 'video' to valid command, tag, or Cog.
hmm
!d numpy.fft.fft
fft.fft(a, n=None, axis=-1, norm=None, out=None)```
Compute the one\-dimensional discrete Fourier Transform.
This function computes the one\-dimensional *n*\-point discrete Fourier Transform (DFT) with the efficient Fast Fourier Transform (FFT) algorithm \[CT].
quite simple yes π€
I gotta get back to work. Take care guys :p
byebye
FFT sounds like a dumb and straightforward way to estimate the offset
(though ig that's not the problem being solved)
is there a reason screenshot isnt enabled anywhere? @delicate wren
there's also a problem that it's different scale, right?
as in count of points
they don't align, right?
interpolation is needed anyway
The San Diego Python User Group is a programming language special interest group with hundreds of active members and regular meetups. It is free to join and open to members of all skill levels.
Oh im not trying to screenshare
I was just wondering why its disabled
feel like it could be useful to help etc
prior incidents
assumed so yeah
you can make a function that does that
!e
def try_(f, except_):
try:
return f_()
except Exception:
return except_
print(try_(lambda: 1/0, "error"))
:white_check_mark: Your 3.12 eval job has completed with return code 0.
error
!e
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-np.pi, np.pi, 100)
xp = np.linspace(-np.pi, np.pi, 10)
fp = np.sin(xp)
f = np.interp(x, xp, fp)
plt.plot(x, f)
plt.savefig('out.png')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
!e
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-4, 4, 100)
xp = np.linspace(-np.pi, np.pi, 10)
fp = np.sin(xp)
f = np.interp(x, xp, fp)
print(f)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | [-1.22464680e-16 -1.22464680e-16 -1.22464680e-16 -1.22464680e-16
002 | -1.22464680e-16 -1.22464680e-16 -1.22464680e-16 -1.22464680e-16
003 | -1.22464680e-16 -1.22464680e-16 -1.22464680e-16 -2.80651313e-02
004 | -1.02467186e-01 -1.76869241e-01 -2.51271296e-01 -3.25673351e-01
005 | -4.00075406e-01 -4.74477460e-01 -5.48879515e-01 -6.23281570e-01
006 | -6.71997169e-01 -7.11585676e-01 -7.51174182e-01 -7.90762689e-01
007 | -8.30351195e-01 -8.69939702e-01 -9.09528208e-01 -9.49116715e-01
008 | -9.83454176e-01 -9.69705232e-01 -9.55956288e-01 -9.42207344e-01
009 | -9.28458400e-01 -9.14709456e-01 -9.00960512e-01 -8.87211568e-01
010 | -8.73462624e-01 -8.38181399e-01 -7.77528288e-01 -7.16875177e-01
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/6EMNALDTJYK5USYSRREDMPZCEQ
hmm
ah, it just copied
!e
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-4, 4, 100)
xp = np.linspace(-np.pi, np.pi, 10)
fp = np.sin(xp)
f = np.interp(x, xp, fp)
plt.plot(x, f)
plt.savefig('out.png')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
How much are you paying for education materials in the last year? (learning python, university etc..)
from pathlib import Path
for line in Path("myfile.txt").read_text().splitlines():
if line.startswith('#'):
print(line)
if you already have the file read in then:
[line for line in line_array]
password_list = []
for char in range(1, nr_letters + 1):
password_list.append(random.choice(letters))
for char in range(1, nr_symbols + 1):
password_list.append(random.choice(symbols))
for char in range(1, nr_numbers + 1):
password_list.append(random.choice(numbers))
password = ""
random.shuffle(password_list)
password = ''.join(password_list)
check out the video: https://www.youtube.com/watch?v=EnSu9hHGq5o
Ned Batchelder
Python provides powerful primitives for iterating over your data in ways that let you express yourself clearly and directly. But even programmers familiar with the tools don't use them as fully as they could. This talk will cover Pyt
There will be coding in the future
and people code today, they also coded yesterday
So I guess I don't understand the question
the future is the future
Here
!pypi qoin
love that
hey
@still warren hello
Hello
I am muted by default
what is the voice chat about
Now i meant even if i tried to talk the app doesnt let me
Where ?
Discords gui is confusing to me
Too much elements in the same pace
You are not currently eligible to use voice inside Python Discord for the following reasons:
You have sent less than 50 messages.
I must send 50 messages guess
Does that count ?
:incoming_envelope: :ok_hand: applied timeout to @still warren until <t:1721313093:f> (10 minutes) (reason: burst spam - sent 8 messages).
The <@&831776746206265384> have been alerted for review.
In this video kaggle grandmaster Rob Mulla takes you through an economic data analysis project with python pandas. We walk through the process of pulling down the data for different economic indicators, cleaning and joining the data. Using the Fred api you can pull up to date data and compare, analyze and explore.
Copy and edit the notebook fro...
hello
HI
whatsup
All Good! wbu
I'm good what do you do
Learning python
ok
u?
I also started to learn for some work purpose
prior to this was a js developer
now switching
Okay
yes
are you a student ?
yes
which course you are pursuing
Doing projects
okay got it
yes
what you are developing
For now a chat bot
nice
No
my nickname
India
Happy throwback Thursday from 2014!
#GabrielIglesias
this one?
I watched this two times
π
When I drive I don't break signal, but what I do is turn left then turn right then again I turn left
same
π
whenever its possible
I follow rules!! ahhahahahahah
what???
80%-20%??!!!
oh I see, i get that
bro achieved everything ig
bro how many years of experience do you have?
bruhhh
you sound older
tell me how old I'm from my voice
you are muted.
i'll go have dinner guys, ttyl
Hey guy's
Looking for fast and reliable Wifi plans? Airtel Xstream Fiber Wi-Fi Connection has you covered! Choose from a variety of plans and enjoy lightning-fast internet speeds @1Gbps.
Amrika may work ni krna ye
send the global one
?
.in
But why?
Hi @misty sinew
Hi
Are you a developer?
I guess so,
Which language are you using? Python!?
Yes I am
Have you ever done programming before?
Yeah! I'm a front-end web developer...
Oh so you just want to enter the backend, right?
Yeah that's right
cz majority of the public is
north american / amriki
I use JavaScript for the frontend
The person with I was in VC, we were discussing the internet plans of countries, that's why I shared an India specific link.
I see, if you're just planning to create APIs and this stuff.
Then start with the basics of python, once you're done then go for the database, learn the basics of SQL and database. Now when you're done picking up a web framework, meanwhile learning it learn how things work internally. You don't have to learn the whole framework at once but when you're sure you're able to build APIs for CRUD with full confidence, then go for advanced part learn async and more database concepts, meanwhile you should also explore how to deploy the backend, going through the flow you won't need a roadmap you'll learn concepts one by one by learning and exploring it, also however if your goal is still building APIs you should also build web apps that aren't consuming APIs at first but from using template engine to doing CRUD.
Okay @misty sinew thanks for this information... Appreciate it man...
@rotund bough yeah it is working but how?
idk
idk
@distant nova ?
had to go srry
@mild flume
Retired wrestler Hulk Hogan ripped off his shirt to reveal a Trump-Vance tank top during his speech at the Republican National Convention, where he also praised former President Trump, calling him an "American Hero."
Β» Subscribe to NBC News: http://nbcnews.to/SubscribeToNBC
Β» Watch more NBC video: http://bit.ly/MoreNBCNews
NBC News Digital is ...
..
:incoming_envelope: :ok_hand: applied timeout to @hexed sentinel until <t:1721411256:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
@misty sinew I dont have ability to use voice chat yet
do you think you could help me with a quick python related question?
From Idiocracy.
@lapis matrix
Have we considered the footwear that women typically wear in slippery winter climates? There is often less surface friction, and the quality of these shoes is usually not designed for winter activities.
I think it's just the curse of dimensionality it's going to take a longer Time to find the consistencies between different data points or understand which data points contribute the most towards finding a good prediction on A model That's backs up the data
@crude void Hello
Β¨'
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
@proud chasm
Sue Vlaki.
oof
Support the band buying the album: https://amzn.to/2Avjg46 and us by joining Amazon Prime Music: https://amzn.to/2QRcDBH
Band Ghost
Album Prequelle
Song Life Eternal
Released June 1, 2018
Recorded 2017
Can you hear me say your name forever?
Can you see me longing for you forever?
Would you let me touch your soul forever?
Can you see me long...
A Plague Tale: Innocence is an action-adventure stealth game developed by Asobo Studio and published by Focus Home Interactive. The game was released for PlayStation 4, Windows, and Xbox One in May 2019. It was made available on the cloud-based service Amazon Luna in November 2020. The PlayStation 5 and Xbox Series X/S versions of the game were ...
A Plague Tale: Requiem is an action-adventure stealth video game developed by Asobo Studio and published by Focus Entertainment. The game is the sequel to A Plague Tale: Innocence (2019), and follows siblings Amicia and Hugo de Rune who must look for a cure to Hugo's blood disease in Southern France while fleeing from soldiers of the Inquisition...
pretty regis @stuck bluff
Opal, battleship?
https://battleship-game.org/en/id42890869
Battleship β online game for 2 players. Arrange ships, wait for opponent and start playing.
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
@midnight dagger check those keys exist in the db
all_results = []
for myid in unemp_df.index:
results = fred.get_series(myid)
results = results.to_frame(name=myid)
all_results.append(results)
unemp_df.tail(2)
pd.concat(all_results, axis=1).drop(['LNS14000150','LRUN25TTUSM156S'])
i dont understand what u r saying
@proper ridge
the error is telling you these dont exist 'LNS14000150','LRUN25TTUSM156S' or you're referencing them incorrectly
Send your full code.
And any dataset you're importing.
What should I do to turn on the microphone?
thx
Pleasure!
I believe the issue is you're trying to drop a row but using drop column command.
drop usually removes columns.
You're trying to remove a row.
Isnβt the specification for opening a microphone too strict?
how to convert it into a code thing
!code
PICO CTF
No, many people join and scream or cuss and leave. This is to ensure quality of the vc.
If you want to be part of the community, the requirement is not being strict by any means.
Ok, I understand
!pip install fredapi > /dev/null
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import plotly.express as px
plt.style.use('fivethirtyeight')
pd.set_option('display.max_columns', 500)
color_pal = plt.rcParams["axes.prop_cycle"].by_key()["color"]
from fredapi import Fred
fred_key = '551bda501958d4184e31f14ded34986d'
from kaggle_secrets import UserSecretsClient
user_secrets = UserSecretsClient()
secret_value_0 = user_secrets.get_secret("fred-api")
fred = Fred(api_key=fred_key)
sp_search = fred.search('S&P', order_by='popularity')
sp500 = fred.get_series('SP500')
sp500.plot(figsize=(10, 5), title='S&P 500', lw=1) #lw means line width
unemp_df = fred.search('Unemployment rate state', filter=('frequency','Monthly'))
unemp_df = unemp_df.query('seasonal_adjustment == "Seasonally Adjusted" and units == "Percent"')
unemp_df = unemp_df.loc[unemp_df['title'].str.contains('Unemployment Rate')]
all_results = []
for myid in unemp_df.index:
results = fred.get_series(myid)
results = results.to_frame(name=myid)
all_results.append(results)
unemp_df.tail(2)
pd.concat(all_results, axis=1).drop(['LNS14000150','LRUN25TTUSM156S'])
@proper ridge
Bubye
@tacit jetty Many companies fail, but there are tons of employed people in the industry
As far as I can see, you're trying to drop a column instead of a row.
Check out the method for dropping rows.
k
@tacit jetty Break the cycle.
It will help if you carefully read the documentation for pandas. It gives alot of examples.
Do you want to get a grip on the basic programming concepts from scratch? Do you feel the need to have a better and enhanced understanding of how it all works? Well, you've come to the right place. This course outlines data types, control flow, functions, input/output, memory, compilation, debugging and other advanced topics in a comprehensive,...
yeah
@eternal beacon π
hey guys, any chance I can be granted permission to share my screen?
I'd love to pass my knowledge to everyone who's interesting in learning python and other technologies
Screen sharing permissions can be requested of voice-regular admin-and-above level users, ideally when they're already in the voice chat.
a few of us joined the code / help channel eager to learn but I'm unable to screen sharing
In practice, this usually means Mr. Hemlock, but Mindful Dev, LX and sometimes some others may be available.
Discouraged, but nobody is able to really stop you.
sure, I won't do it then
I'll keep an eye on the server until I spot one of the admins are available
thanks for your help my G
It's the weekend period, during which Mr. Hemlock is usually unavailable, and Mindful Dev, who sometimes is in on weekends has been drawn away to other duties of late.
got you! that makes sense
I'll wait
no big deals
just want point out to the fact that you look like a really good person
thanks ma man
can't thank you enough for your kindness in using your time to help me
Cool
What happened?
hi
no
no
Yaw
Yeah sorry
Is it Python code? @royal seal
Whoops, sorry for the ping
I meant to ping @obtuse valve
Oh ok
Yeah
So the beauty of Q-learning is that you don't need to look ahead. You update the Q-value of a transition each time you make that transition.
In practice, you learn a model for the Q-value that hopefully generalises to transitions you havent seen.
Online, I think. If I remember what that term means
Yeah, so as an RL agent, you get a reward (possibly zero) each time you make a transition.
Right π€
So, you're not training your agent in a simulation?
s_0 -> a_0 -> state transition -> s_1
but idk what s_1 is, unless i make action a_0
That's true, but that's how you learn right?
I guess you start off with random values, and take kind of random actions.
Then tend towards taking actions that more-and-more exploit what you've learned.
1000000 random simulations
- label all "winning" ones 1.0
- label all "losing" ones 0.0
like all states within the simulation
Yeah that's a different kind of thing, that's search.
But when you do Q-learning, you're kind of implicitly searching.
I DONT UNDERSTAND THIS :(
It doesn't have to be a table.
Yeah
So, I think the term you're looking for is temporal difference learning possible?
I'm not current on ML techniques though (like, I literally did this stuff ten years ago before the current AI boom
).
Errrr
let me do some reading
Do you have a university library? I recommend getting your hands on a copy of AIMA if you can. The chapters on MDPs and RL are pretty good and clearly written.
Oh right ok
It's alright π
your pfp π
it's smth from aardman studios
i can recognise it
machiavellian penguin
i forogt his name
massive baddie
Yeah, it's Feathers McGraw π
from the wrong trousers
They're releasing a sequel later this year I think
hmm
Oh ok
bc of shit wifi in the attic
so how does it work in q learning (dont mind the td learning)
i will get shit sorted hopefully
interesting shit
i heard of dqn before
PERFECT
another mujoco sim
and tutorial from pyotrch???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????/////////////
OMG
yk dqn? it was "novel" about 10 years ago
yeah, just RL stuff
Haven't heard of it
hm
Brb while I do some reading
Deep q-learning I assume is just q-learning using deep neural nets
yes
q learning sounds a lil fucked imho, i STILL think that i need to sort of "simulate" the next state
or somehow have the agent to "learn" the environemtn
and the state transition function
Hi @hearty heath ! Yeah I can't unmute unfortunately but we chat here at least
yk any RL algs that learn the state transition function itself?
that could be VERY powerful
or even better, learn the env
muzero is what im thinking of
iirc DQN was a big deal in 2012
like it played atari games from what ive read
That would be "model-based" reinforcement learning. Q-learning is "model-free", in the sense that the agent doesn't know or learn the transition model explicitly; what it knows about state transitions is implicitly part of the q-values.
Nice quote from AIMA:
[...] Reinforcement learning differs from "just solving an MDP" because the agent is not given the MDP as a problem to solve; the agent is in the MDP. It may not know the transition model or the reward function, and it has to act in order to learn more. Imagine playing a new game whose rules you don't know; after a hundred or so moves, the referee tells you "You lose". That is reinforcement learning in a nutshell. [...]
With monopoly, you could go with a model-based approach, because you already know the rules of the game.
iirc some ai has learnt driving on gta
like it was wild
like the nn was outputting like frames of driving etc
fucked up
i couldnt find it
v
Oh I think sentdex did some videos on that
Python Programming tutorials, going further than just the basics. Learn about machine learning, finance, data analysis, robotics, web development, game development and more.
I have ~1000 videos, all of which do not fit on the front page. Try searching on the channel page, or via https://pythonprogramming.net. If you cannot find something, just ...
was about to say
was it him or was it yannic kilcher
but yeah ik sentdex made a series on it
goated rich boi that gets sponsored all the time
but he's quite knowledgeable
Ok, so there's "passive reinforcement learning" where the policy of the agent is fixed and you're learning the utilities of the states under that policy. And there's "active reinforcement learning" where the agent is simultaneously trying to figure out a policy.
perfect timing
i still dont't understand utility
like u value
like it's obv in alphazero
(ish)
sounds so similar to q value
(sorry im presently distracted by my alphazero run)
alright back
So this would be the utilities you get by just "solving the MDP"; it's the utilities of the states under the optimal policy:
Oh really? π It's an example from that book.
it tells me the expected return, which is the cumulative rewards, of an action in a specific state?
i guess youtube likes ripping off from textbooks
not this particular example but yeah
hello
Yeah exactly. It's how much reward you expect to get starting in a state and following the optimal policy (with rewards being exponentially discounted as they go further into the future).
Hey π
that's the q value right
the u value sounds sus
like what else can it tell me that i would find useful that isnt alr described by
- policy
- value
- action value (q)
fuck all it seems
Q-value is the same thing, but for a state and a tentative action, whereas the u-value/v-value/utility is the maximum over all possible actions you could take from that state.
U(s) = max(Q(s, a) for a in actions)
damn so im right
ok so it's "value" but for q
very fucking interesting
since "value" is technically the expected return of a state following pi
Do you know python language?
as in, the best actions taken from pi directly from the state, as opposed to q where its goal is to measure the "action value" specifically
sure
like "how good is this action if i were to follow the policy from this action onwards"
like that sounds so fucking complete now
rl is now full circle
i get a function/cool abstraction for every little thing
where are you from?
instead of max(Q(s,a) for a in actions) β:
U(s) β
genius
we RL bros are so excessive and i like it :D
ty for clarifying though :p
im happy
Yes, I'm talking about the value of the state under the optimum policy. I think under a particular policy Ο(s): U(s) = Q(s, Ο(s)) (assuming your policy is deterministic and not random)
It's a bit harder going the other way (getting the Q-value from the U-value) because you need a transition model.
brb
ok so in theory, with perfect V*:
a* = argmax(pi*(s))
Q(s,a*) = U(s)
im trying to process this
shit backticks no work
well hm, you can use the "advantage function"
which is, iirc:
A(s,a) = Q(s,a) - V(s)
see you soon
you can do:
u_val = U(s)
a_star = None
q_vals = {}
for a in actions:
if u_val == Q(s,a):
a_star = a
advantage = A(s,a)
q_vals[(s,a)] = advantage
idk im thinking on top of my head
Well it's because you'd have to derive the Q-values by looking one step forward to the U-values of the successor states.
Btw, u-value and v-value and "utility" are the same thing. Different books use different terminology. Just in case that wasn't clear.
well they are a bit nuanced
like the exact thing that they are measuring arent exactly the same
is it
eg they use distinctly different formulae
No I think they're the same thing generally:
In this chapter we use U for the utility function [...] but many works about MDPs use V (for value) instead.
Oh, I hadn't heard of that π
interesting
they describe the nn as a "q network"
i wonder if nns output values or q values
since in alphazero they output values
and more speficially, values that are clipped from -1 to 1
using softmax
@hearty heath this is what i think i dont get
i see some subtraction in a ()^2, ig somehting to do with mse???
are you back lol
Yeah
hmm expected value of some mse? sussy baka
idk how that works, like i thought expected values = p_1 * w_1 + p_2*w_2 ...
Err, I think theta_i represents the parameters of your model in iteration i, and that's the loss function. It would help if I could see the preceding text tbh π
So like Q(s, a; theta) is your neural net or whatever, with parameters theta, and its meant to approximate Q*(s, a).
loss = MSELoss()
for i in dataset:
q_i = model(i)
loss(preds_i - q_i)
loss.backward()
model.zero_grad()
optim.step()
or something
restarted stream
and iirc the optim is sgd
In the reinforcement learning community this is typically a linear function approximator...
I guess this is not the case anymore π
i was thinking of this, like were people using like excel regression shits to play games???????????????????
like hmm what's the best y=mx+c for this game π€
They probably used like a weighted sum of features model.
you can argue that this is still true today
Like where you hand-craft the features.
yeah ik handcrafted stuff
still very much alive in the chess community
even though there are nnues
which are basically cpu nn
but it can incrementally update the outputs
which makes it viable on cpu
anyways
it seems like this formula uses Q values as targets
so this nn outputs "state action values" and not "state values"
i shouldve seen it coming
"Q-Network"
π€¦
Β―_(γ)_/Β―
THIS SHIT LOOKS SCARY
like the one that says "differentiating..."
is this just regular backprop
ive read it a few times
like dL/dy right
or more precisely, the gradients of each weight i in nn theta
Yeah I think so. I'm still wrapping my head around the notation actually. I don't understand what a subscript on an expectation is supposed to denote.
i think it's a shit way of saying "given", ik it's weird
im still guessing
like E[...|s=s, a=a...]
that's the only logical shit
ugh dinner is late tonight
so i might have dinner in ~10 mins
fuck
right in the middle of a focus sesh
Oh right ok.