#voice-chat-text-0
1 messages · Page 97 of 1
Dr. Awkward
LOL I remember this guy, but forgot his name
@uncut bloom 👋
looks an awful lot like !rule 5, tbh
generally shouldn't slowdown but things happen
if you call the script often, it will slow it down
(so, like, don't do CGI with python)
#! is also good at causing trouble
"do #!/usr/bin/env python3+import aiohttp and enjoy 1 second startup time"
Django REST framework? or something else?
yeah Django rest framework
haven't used it yet
this isn't "Django's answer", it's a third party toolkit on top of Django, if I understand correctly
Django on its own has quite a lot of API capabilities, afaik
yeah what is u used for ur job?
and DRF provides web-browsable things to it
do you have any react experience
nope. But i think react is easy and css is hard
I participated in debugging React routes once, and that's probably all
(and I did write some simple app very long time ago just to understand JSX/TSX syntax)
https://fastapi-crudrouter.awtkns.com/
I think this with react, is nice
@app.get("/pp/poo/poo")
Any tool for writing css
css is pain
tailwind
in which technology u work
manufacturing
arduino
great!
never run it => never fails
Vlsi design
write tests and verify whether it actually works
or always have more tests than you have code to make sure they always fail
Great!
TDD moment
You are electronics enginer
testing not experimenting
Electronics and communication
I'm not an electrical eng or automation specialist, but my title is field service engineer. my interest in python web apps and api's is to expedite processes in manufacturing for qms reasons
unit tests, integration tests, etc.
import re
import json
import requests
from bs4 import BeautifulSoup
def get_stream(server_url):
server_id = re.search(r"/([^/]+)$", server_url).group(1)
csrf_token = lambda server_url: str(
BeautifulSoup(
requests.get(f"https://sltube.org/e/{server_url}").text, "html.parser"
)
.find("meta", {"name": "csrf-token"})
.get("content")
)
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; rv:109.0) Gecko/20100101 Firefox/109.0",
"Referer": f"https://sltube.org/e/{server_id}",
"X-Requested-With": "XMLHttpRequest",
"X-CSRF-TOKEN": csrf_token(server_id),
"Content-Type": "application/json;charset=utf-8",
}
response = requests.post(
"https://sltube.org/api/video/stream/get", headers=headers, data=f'{{"id":"{server_id}"}}'
)
return json.loads(response.content)
def main(server_url: str):
urls = get_stream(server_url)
return urls
import random
lower = 'abcdefghijklmnopqrstuvwxyz'
upper = lower.upper()
num = '0123456789'
symbols = '!@#$%^&*.'
HOW = int(input("Howmuch Length would you like your password (5-30): "))
if 30 > HOW <= 4:
print("Please Choose Another Number")
HOW = int(input("Howmuch Length would you like your password (1-30): "))
length = HOW
string = lower + upper + num +symbols
password = ''.join(random.sample(string,length))
print(f'Your new password is : {password}')``` anything else I can add
with this password generator
Sir Terry Pratchett.
The World Turtle, also called the Cosmic Turtle or the World-bearing Turtle, is a mytheme of a giant turtle (or tortoise) supporting or containing the world. It occurs in Hindu mythology, Chinese mythology, and the mythologies of the indigenous peoples of the Americas. The comparative mythology of the World-Tortoise discussed by Edward Burnett T...
Discworld is a comic fantasy book series written by the English author Terry Pratchett, set on the Discworld, a flat planet balanced on the backs of four elephants which in turn stand on the back of a giant turtle. The series began in 1983 with The Colour of Magic and continued until the final novel The Shepherd's Crown, which was published in 2...
@tired atlas👋
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@upper edge👋
@somber heath hello
🙌
@amber raptor I had an idea for a business. It'd be one of those corporate/company retreat BS things. The name is MTTaP, which stands for "Motivation Through Teamwork and Pizza"
You have the dumb corpo bullshit for the c-suite folks, and then pizza for everyone else
I'll need about a 5 mil seed fund
All of said fund would be spent on pizza
And the teamwork part is just bringing $5 mil worth of pizza inside
@shy swift👋
@spiral sierra👋
Something or nothing.
😐 XD
In fairness that's as far as I understood as well
I don’t see synergy enhancements here.
Hi @somber heath
@whole bear If you're wondering why you can't talk, check out the #voice-verification channel
That'll tell you what you need to know about the voice gate system
Hello Guys!
Hey how goes it
Why we use tree data structure?
Tree Data structure has lot of complexities and worst time complexity recursion
@whole bear This channel.
@stuck furnace Sup
@whole bear 👋
yes
Ah right

@rugged root
Forgot to relock the VC0 and VC1 channels
Already...
One sec
A conspiracy is just when people conspire to do something 😄
A conspiracy theory is a theory that a conspiracy exists.
You don't appear to meet the verification criteria. Are you talking about another account?
- def get_current(*args) -> None:
+ def get_current() -> None:
Right but it didn't work as you don't currently meet the criteria.
Please read the message in #voice-verification
You haven't posted any messages in this server prior to 5 minutes ago 
dude
LPE exploit for CVE-2023-21768
Errrm, I think JSON or XML or something 😄
Script kitties 
dude just tell how can i check my messages count
Just do !user in the #bot-commands channel. Also, you'll have to wait 3 days regardless because you only joined today
Is it possible that you were here on a different account before?
maybe
Because like LX was saying, you didn't have many if any messages on the server, so there's no way you verified
If you spam to get your messages, I'll extend the time it takes
It says it in #voice-verification
As a side note, I typically extend the time requirement by two weeks
Just be patient, properly interact with the community, and you'll get verified before you know it
means
ohk
can u help me
in
Why does a jupyter file not named .py
@rugged root
Because it's not a python file
k
It's a different kind of file, different format
i thought it is hard to understand
You can't run it by just putting it through the python interpreter
Try opening it with a text editor. It contains python code, but also lots of other information.
k
@rugged root dude why u not banning who are abusing
Because I'm too kind for my own good
@whole bear Talk in here
I'm going to relock the built in voice/text channel. It got unlocked by accident

https://www.psychologytoday.com/us/articles/201906/why-female-psychopaths-are-different-breed#:~:text=Psychopaths exist across cultures and,in diagnostic instruments and methods. There are 2 to 3 times more male sociopaths than female
Sorry. I stopped listening for a second. How did we end up on this topic?
He spins a narrative 
If you are voice chat to learn Python, you got lost.
I did an oopsie
Lets take a moment from our sponsors... Media Bias Charts, Primary, Secondary, and Bias Sources.
Ooh
lol.. i think python gets talked about in the low 10% of voice chat
Cya Rab 
Oh speaking of that emoji, my wife got a like Funko Pop sized figure of that
What kind of company is it?
Any data scientist in here? if so how'd you get into it? (what job did you start with?)
healthcare, dunno if you heard
i think i have a pretty good chance of getting it
not to jinx myself but
var angular_speed = 4
func _process(delta):
rotate(angular_speed * delta)
func set_angular_speed(new_angular_speed):
angular_speed = new_angular_spee
Nice, I sold security cameras/access control. Worked next to the It guy, had to learn a bit. Im trying to start working 100% remotely.
Delta's just the time from one frame to the next?
yeah that's what i thought, but this action has to be run before the next frame, right?
Games run in a loop. Each frame, you need to update the state of your game world before drawing it on screen. Godot provides two virtual methods in the Node class to do so: Node._process() and Node...
I guess it's just measured between the same point on subsequent ticks.
Mostly matters that it adds up to the right amount of time in the long-run.
A lot of old games actually assumed the frame-rate is constant 😄
So if you run them on a faster computer, time goes faster.
Oh 
Sorry, Indi.
mdn docs
¯_(ツ)_/¯
🙌
hi
hi
Shakespeare apparently 😄
Sounds right
One sec
Yeah, shit, back in a sec, have to dig in the garage for a moment
@crisp bobcat 👋
Hi
@whole bear 👋
Yo 
@honest pier I'm curious how you would solve this: #algos-and-data-structs message
Sorry wrong link: #algos-and-data-structs message

Yeah essentially.
Because it's manchester coded, the maximum run length (decoded) is 2, which makes things a bit easier.
01 is 0, and 10 is 1
Errrm, maybe 🤔
It's not really an error-correcting/detecting code.
The idea is that the receiver can infer the clock speed and phase I think.
Yeah, because there's a flip on every bit.
"Grandfather, it's not just a phase!"
I don't know the right terminology lol
Yeah something like that 😄
Yeah I never did electrical engineering.
Mhm. The alternative is sending the clock separately, and I think they can get out of phase or something idk.
Oh yeah 😄
Race condition? 🤔
Non-atomic write?
Non-serialisability?
My understanding of serialisability is "if you do A and B at the same time, the result is the same as if you did A then B or B then A".
Databases course flashbacks 
Actually I liked that course lol
Right. I've got to get dinner ready. Cya 
@shadow hawk 👋
@stuck furnace it's TOCTTOU :O
always forget it lol
It's not a great name imo lol
hey
i am beginner
can you suggest some apps or yt channels to learn it in a good way?
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Corey Schafer's YouTube playlists.
oh ok
am using his django stuff now
Ooo neat
the amount of stuff i don't understand is off the chart 😅
A thrice-weekly webcomic written and illustrated by Reza Farazmand. New comics every Monday, Wednesday, and Friday.
You're not alone there
can't sleep?
just that you'd go off in the time about
not to be rude
@ruby tartan 👋
hello
Where can I go to join a beginner friendly community project?
!kindling
The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.
!voiceverify
thank you
Happy to help
which websites would you recommend?
https://up-for-grabs.net/#/filters?tags=python
can look in these too
tho i haven't find anything easy for myself yey
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Thanks Ill check out all of these
Anyone know of any software or plugins that can generate a UML diagram of your project?
That's a good question
https://github.com/codecrafters-io/build-your-own-x
also this
but you'd need some knowladge of python
!e py class MyClass: def __imod__(self, _): print('Hello, world.') v = MyClass() v %= ...
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello, world.
Whats WYSIWYG editor?
What you see is what you get.
Would You Say I Was Your God
bad
Oh that makes more sense
Seriously
how I get the promission
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
I thought its some thing related to html
hello
!e ```py
class MyClass:
def radd(self, value):
return value * 2
print(5 + MyClass())```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
10
!e
class MyClass:
def __imod__(self, _):
pass
v = MyClass()
v %= ...
print(v)
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
None
girlfriend_count = 0
while True:
command = input("Enter a command (gym/video games/anime): ")
if command == "gym":
girlfriend_count += 1
print("You now have", girlfriend_count, "girlfriend(s)")
elif command == "video games":
girlfriend_count -= 1
print("You now have", girlfriend_count, "girlfriend(s)")
elif command == "anime":
print("Goodbye!")
break
else:
print("Invalid command!")
that breaks the code
no EOF handling
input can raise an exception
some companies pay for employees' higher education
it's not fully free
free option is limited
OpenAI sells use of its models
(they need to get money somehow, anyway)
it sometimes happens after ctrl+R
(because reloading is now broken)
@flint silo If you're wondering why you can't talk, check out the #voice-verification channel. That'll tell you what you need to know about the voice gate
Provided to YouTube by TuneCore
Passing Through (Can't the Future Just Wait) · Kaden MacKay
Passing Through (Can't the Future Just Wait)
℗ 2021 Kaden MacKay
Released on: 2021-12-11
Auto-generated by YouTube.
Sophie's World
Novel by Jostein Gaarder
If you are full then only there is philosophy.
यह डॉ. विकास दिव्यकीर्ति का निजी व प्रामाणिक चैनल है। उद्देश्य है - जीवन के विभिन्न पहलुओं पर अपनी राय साझा करना। अगर आप दर्शन, अध्यात्म, तर्क, मनोविज्ञान, साहित्य, समाज, इतिहास, क़ानून या तकनीक में गहरी रुचि रखते हैं तो मुमकिन है कि आपको यहॉं आना और ठहरना अच्छा लगे! आइये, एक-दूसरे से सीखकर बेहतर होने की कोशिश करते हैं। शुभम् अस्तु!
This is the...
Hello Guys!!
whats happening now
@rugged root
Has anyone used stack social for learning python?
I'm practising writing Rust by translating some Haskell code and making tests for it
it's surprisingly easy (although quite verbose, because (obviously) it's a different language with different syntax and principles)
maybe one day python will have typing like this too:
class SomeClass(Generic[M]):
def some_method(self, ints: M[int]) -> M[str]: ...
or I may be missing something and it already exists
so, like, M could be Optional, list, set, etc.
oh, typo
I missed the name
although, I guess, it'd be closer to how Rust does it
this should work even for such Ms that SomeClass doesn't know exist
(so unions aren't the way here)
I have no idea what I'm doing but at least it makes Pylance angry
class Functor:
def tmap(self, t: type) -> type:
raise NotImplementedError
def def_fmap(self, ta: type, tb: type):
tfa, tfb = self.tmap(ta), self.tmap(tb)
def fmap(f: Callable[[ta], tb]) -> Callable[[tfa], tfb]:
raise NotImplementedError
return fmap
and those things should probably be classmethods
!d sqlite3
Source code: Lib/sqlite3/
SQLite is a C library that provides a lightweight disk-based database that doesn’t require a separate server process and allows accessing the database using a nonstandard variant of the SQL query language. Some applications can use SQLite for internal data storage. It’s also possible to prototype an application using SQLite and then port the code to a larger database such as PostgreSQL or Oracle.
The sqlite3 module was written by Gerhard Häring. It provides an SQL interface compliant with the DB-API 2.0 specification described by PEP 249, and requires SQLite 3.7.15 or newer.
This document includes four main sections:
to play around with no persistence:
sqlite3.connect
connection = sqlite3.connect(':memory:')
(or if you just need queriable in-memory storage)
MySQL is a widely used, open-source relational database management system (RDBMS).
according to @bcantrill, "the (only) right way" to deploy this sort of databases is to use containers
if you care about open-source more than Oracle does, use this instead:
https://hub.docker.com/_/mariadb
MariaDB Server is a high performing open source relational database, forked from MySQL.
(for Oracle the numerical value of "how much it cares for open-source" is defined and it is negative)
The PostgreSQL object-relational database system provides reliability and data integrity.
postgres has a simple CLI thing packaged with it
postgres was probably the first DB I was introduced to
(and quite a long time ago compared to most other programming things in general)
but I can't remember the exact year
Hello
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Hii guys love from india
I am coder .. Currently in 3rd year of my clg
Very eager to learn some stuffs here
@upper edge👋
@somber heath namaste
@spice kernel👋
Heya
does xp even run newer games?
What game?
Newer games aren’t fun anymore, it just doesn’t feel fun anymore.
@pallid hazel
There are three off-topic channels:
• #ot0-psvm’s-eternal-disapproval
• #ot1-perplexing-regexing
• #ot2-never-nester’s-nightmare
The channel names change every night at midnight UTC and are often fun meta references to jokes or conversations that happened on the server.
See our off-topic etiquette page for more guidance on how the channels should be used.
.topic
Suggest more topics here!
@silent willow👋
that's great keep it
fine
@torn pier👋
Hiiii
@somber heath you're always here you're Legend
lol
!u
You are not allowed to use that command here. Please use the #bot-commands channel instead.
😩
hello
my vpn needs an update. but in order to update it i need a vpn 
Google play doesnt work here....
i presume
:cute: makes sense
Hey @whole bear!
You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.
Google play works here just filtered
One sec
dont know what ur talkin about since dsc basically does nothing so ya couldnt care
they're supposed to
tell them that not me lol
You may not download or use our services if you are located in a country or region subject to U.S. or E.U. government embargo (including Cuba, Iran, North Korea, Syria, and the Crimea region) unless that use is authorized by the United States and other relevant authorities.
¯_(ツ)_/¯
isn't this trivial?
I suggest doing it in Rust without allocations, because there you own the value and no one can judge you for mutability
class Solution:
def reverseList(self, head: Optional[ListNode]) -> Optional[ListNode]:
prev = None
curr = head
while curr != None:
next = curr.next
curr.next = prev
prev = curr
curr = next
return prev
Linked lists in rust? Blasphemy
to pass tests without over-engineering, yes; but there is more to it than just passing the tests, as with most tasks
not doubly linked
details
I just don't think it fits well
I don't like to think of nodes in a linked list "owning" the next nodes
Just pointing to them
Blasphemy? More like blaspheyour.
depends on the specific use case, as with most things;
thankfully, Rust allows to express different variants of such concepts
there are some brute-force approaches to emulating doubly linked lists; trees, for example
b-trees containing (id)->(node) entries
idk how bad the performance will be but some people (@bcantrill) claim it's not impactful
a minute of using VC on the phone convinced me not to attempt again
each UI action takes several seconds to complete
was about to say "that rare type of insects that I don't hate" but then I double-checked and it turned out not to be an insect
should've probably known that based on the number of legs
in Russian those animals are called "40-legged"
not true..ig
very yes
I think you can theoretically accidentally get generalised models to do such specialised things competently
wouldn't rely on it anyway yet
at some point it may be "easier" for an AI to learn programming from examples and somehow "understand" general programming principles instead of just mimicking the code less intelligently
the problem with generalised is that it tries to generate what people make
people are far far far from perfect and reliable themselves
The programming thing just needs more specific models
I once talked to a school student who was just re-selling news articles for 10-50x prices (for memes rather than profit)
even without AI publishing was quite far away from fair and effortful
generalised models can develop some sort of enclave of specialised knowledge
or something that could be interpreted as such, rather
Can, sure
maybe putting some sort of "rating of how good, quality-wise, result is" can accelerate moving towards such results
although
!rule 3
maybe this one
"so insult with respect"
"that way you will get an AI that can convince you 2*2=5"
copyright?
ok, I don't know what happened in the case
Yeah trying to remember
using APIs is under ToS/licence
replicating APIs may be under copyright, I guess
although there are ways to say "you can't use it, because we're authors and we choose whatever we want"
The Baby! 1 is a transportable microcomputer released by STM Systems Inc. of Mont Vernon, New Hampshire, in late 1976. The computer was based on the MOS Technology 6502 microprocessor and came in a small enclosure that fit inside an attaché briefcase that came shipped with the computer. Byte magazine in 1985 called it the first portable microcom...
The Didaktik was a series of 8-bit home computers based on the clones of Intel 8080 and Zilog Z80 processors produced by Didaktik in Skalica, in the former Czechoslovakia.Initially the company produced PMD 85 compatible machines aimed at schools, then switching to the home market with ZX Spectrum clones.
Didaktik's glory diminished with the fall...
roadmap
Singapore 
Yooo
all you need is a big pair of boots
Well that's A solution
I suspect it would cause other problems
Arm fall off disease
turkey dinner for 20 ?
Do unmute.
jonny can go anywhere and make money - for another studio - disney fucked him over - he more or less said so
Hobo with a chainsaw - rutger hauer
ohh was it
can some one unlock the chat of the stream, i can not see the stream from the voice chat
well pirate of the caribean might come in 5 years
when there is money
to make the movie
here, list
I feel as though I've Kindling'd you already.
!kindling
The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.
it's built-in
!d tkinter
Source code: Lib/tkinter/__init__.py
The tkinter package (“Tk interface”) is the standard Python interface to the Tcl/Tk GUI toolkit. Both Tk and tkinter are available on most Unix platforms, including macOS, as well as on Windows systems.
Running python -m tkinter from the command line should open a window demonstrating a simple Tk interface, letting you know that tkinter is properly installed on your system, and also showing what version of Tcl/Tk is installed, so you can read the Tcl/Tk documentation specific to that version.
pyqt and pyside for Qt
at school we used PySide2, iirc
(so I have some random knowledge of it)
isn't it smoothed out rather than just jumping to a higher percentage?
or is it really that bad?
Peighwrole.
it should be A% on amount below threshold and B% on above threshold, not B% on all if total's above threshold
go startup/compile time is extremely fast
for go for some framework:
https://github.com/cosmtrek/air
there are ways to properly gradually update the app
there's something about it integrated in how Erlang is used
well i have to force my self to learn at least one programming language and check if i can get a job
built for near-100% uptime
How can we build large self-healing scalable systems?
In this talk I will outline the architectural principles needed for building scalable fault-tolerant systems. I'll talk about building systems from small isolated parallel components which communicate though well-defined protocols.
Programs will have errors in them and will fail so I'll tal...
what do you mean it's scary
"it's cute just like spiders"
also
why is it 100-legged and 40-legged depending on the language?
was 40 just a better and better sounding approximation but English/Latin didn't have it?
I had three spiders in my room at one point and they're all gone by now, sad moment
did not used to opportunity to become spiderman
we had a weird spider in the house which I saw, like, only once in my life
use slowo, make all your speech uwu
i am wondering who modify the world
the european countries is a teenager
or have the shape of a teenager
"the real uwuification hasn't been tried yet"
what if da weal uwufication was da fwiends we made awong da way?
"so much lost potential" in LP's words
this empty space on the new Wikipedia interface looks cursed
The C4 model is a lean graphical notation technique for modelling the architecture of software systems. It is based on a structural decomposition of a system into containers and components and relies on existing modelling techniques such as the Unified Modelling Language (UML) or Entity Relation Diagrams (ERD) for the more detailed decomposition...
they just hid menu behind the button
Hi
Can someone explain this in simple words?
class Node:
def int(self,data):
self.data=data
self.next=None
class Linkedlist:
def init(self):
self.head=None
self.tail=None
def append(self,data):
new_node=Node(data)
if self.head=None:
self.head=new_node
self.tail=new_node
else:
self.tail.next=new_node
self.tail=new_node
do you know how linked lists work?
What part is confusing you specifically?
Like why do we create a Node class and the pointer is something which is messing with my brain
this "self.data=data
self.next=None"
the elements in a linked list have a pointer and data
ergo head and tail
yes
@rugged root I they have leading from?
I thought only to
oh but common ones arent
yeah
or not doubly
ye
just tail as a thing pointing to None
yeah so long story short, element in a linked list has two parts
body: which is essentially data
pointer: which points to the next node in the linked listt
yeah
dw I'm just writing this all out to get to 50 messages im not dissing u bro

I too need to write 50 messages! so that I can ask my doubts in a better way via voice chat
1->2->3->4->5->None
head: 1->...
tail: 5->None
nonillions
I know a great example of linked list
cs50 from harvard
The magazine with first paper as head and last paper as tail
Thanks everyone for your inputs on linked list
CTRL R
"I've not talked to this person since the last time I talked to this person."
Definitive.
How do you explain "Next". what is it in python? self.next?
Linked lists? Next node in the chain.
yes but is it a keyword like def?
No, it'll be a attribute of the instance.
oh! I see
next is a builtin function, but that's entirely distinct from self.next
- not literary
docker swarm kubernetes
10 messages
to go
time to linebreak
unnecessary
during all my messag
es
I just build monitors and scrapers
funfun
website monitors
it's supersupersupersuper fun when it has to do with web3
wait lemme see
if i can use mic
class animal:
def init(self,name):
self.name=name
self.**__**age=3
def showage(self):
return self.**__**age
class dog(animal):
def speak(self):
return "woof woof"
class cat(animal):
def speak(self):
return "meow meow"
a=dog('joy')
c=cat('kitty')
print(a.name+" says "+a.speak()+" and my age is "+str(a.showage()))
print(c.name+" says "+c.speak())
!code
It's got built in codeblocks
Interesting
ham = "pork"
print(ham)
def __init__(self,name):
self.name=name
self.__age=3
def showage(self):
return self.__age
class dog(animal):
def speak(self):
return "woof woof"
class cat(animal):
def speak(self):
return "meow meow"
a=dog('joy')
c=cat('kitty')
print(a.name+" says "+a.speak()+" and my age is "+str(a.showage()))
print(c.name+" says "+c.speak())
Need to add the py after the first 3 backticks with no whitespace after
what's the use of self.__age?
So that's an odd way to do it
i can simply use self.age
The double underscores before hand are used for namespace mangling. Usually it means that you're trying to indicate that this should only be used within this class or function or what have you
There's single underscore and double
single is just a convention, it doesn't do anything
Double actually does some namespace mangling to make it harder to do things like animal().__age
It is actually a double
It's probably just to keep it from being easily accessible directly
Normally I'd see this with parameters
One sec, making an example
wow, ok
If you're familiar with other languages, you may have seen getters and setters. Specific methods that you would need to call if you wanted to modify an object's attributes (self.name and self.__age in this case)
Python lets you do it directly without the need of those
yeah
However sometimes you want to do some checks before letting a new value being set
And Python has a handy way of doing it via the @property decorator
Writing out the example now, one sec
okay and also I see py super().__init__(v1,v2,v3)
I am curious to understand the implementation of super()
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
@property # The first property is always the getter
def age(self):
print("Getting age")
return self._age
@age.setter
def age(self, value):
print("Setting age")
if value < 0:
print("You can't have someone who is less than 0 years old")
self._age = 0
else:
self._age = value
HOKAY, so
Properties let us control how the we retrieve or set values
so, what would be the difference when we use self.age instead of self.__age above?
Testing something to make sure I'm not going to tell you wrong
Yeah I borked something, one moment
oops, ok
I see some error when I am trying to set age to a different value
!e Going to run this to show what I'm meaning:
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
@property # The first property is always the getter
def age(self):
print("Getting age")
return self._age
@age.setter
def age(self, value):
print("Setting age")
if value < 0:
print("You can't have someone who is less than 0 years old")
self._age = 0
else:
self._age = value
tim = Person("Tim", -5)
print()
print(tim.age)
@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Setting age
002 | You can't have someone who is less than 0 years old
003 |
004 | Getting age
005 | 0
FROM python:2.7
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
EXPOSE 8080
ENTRYPOINT ["python"]
CMD ["app.py"]
Yes this is a shitpost
So for our purposes, anytime someone wants to modify tim's age the normal way tim.age = 4, that would instead call the setter, having it go through the check
requests? that's soooo 2020, we use httpx now
And since we have the self.age = age at the beginning, we tell it to do that check even upon object creation
Unavailable. Sorry.
BUT, Python knows that since you're using a property, it knows to actually store the value into tim._age
@somber heath ok
This keeps it from being modified without the check unintentionally
However, with it being _age instead of __age, you can still specifically get and set tim._age directly
However if you use tim.__age, it becomes more difficult
can anyone help me how to fix this
It throws in some complications to make it not that easy
so, we cannot modify the age when we use double underscores?
We can, but it's more effort
It's not as easy as tim.__age
!e Ah, found the example I was looking for:
class ExampleClass:
def __init__(self):
self.var1 = 11
self._baz = 23
self.__foo = 23
exampleObj = ExampleClass()
print(dir(exampleObj))
@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.
['_ExampleClass__foo', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_baz', 'var1']
dir just lets us see all the methods and attributes tied to the class/object
We can see _baz and var1 are both there at the end of the list
However, __foo isn't anywhere to be found. Except it is, just made funky
It's now stored as _ExampleClass__foo internally
So we would have to access it by doing exampleObj._ExampleClass__foo
ethics are in the eye of the beholder
It's not impossible to do it, but it makes it difficult to accidentally stumble into it
Nothing in Python is truly hidden
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
@property # The first property is always the getter
def age(self):
print("Getting age")
return self.age
@age.setter
def age(self, value):
print("Setting age")
if value < 0:
print("You can't have someone who is less than 0 years old")
self.age = 0
else:
self.age = value
p=Person('ram',20)
print(p.age)
print(p.name)
This doesn't run and some error is present
except for a "real" for-loop
So after the initialization, Python will store the self.age value as self._age
So you'd need to return self._age, or assign values to self._age
self.age now points to those getter and setter methods under the hood
so, why my kernel is restarting when I remove the encapsulation?
Can you paste the error?
Sure, one sec
"It works on my machine"
just use docker podman
So those properties modify how python handles assigning to those objects. In this case, since we are setting values by doing self.age, it's running it through the set method over and over and over and over
Which is why we need to assign it to self._age
So the kernel is crashing due to an infinite loop bug
yeah! Very interesting
Oh so you were also asking about super(), right?
wow! your memory!
So I'm going to use the same Person class but strip out all the property stuff, since it's not needed for this example
super() is used when you're dealing with inheritance, which is when you have one class inherit methods and attributes from another one. Usually the one that is being inherited is called the parent class. Let me scratch out a quick example
!e
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
class Student(Person):
def __init__(self, name, age, favorite_subject):
super().__init__(name, age)
self.favorite_subject = favorite_subject
tim = Person("Tim", 5)
sally = Student("Sally", 6, "Math")
print(sally.name)
print(sally.favorite_subject)
print()
print(tim.name)
print(tim.favorite_subject)
@rugged root :x: Your 3.11 eval job has completed with return code 1.
001 | Sally
002 | Math
003 |
004 | Tim
005 | Traceback (most recent call last):
006 | File "/home/main.py", line 18, in <module>
007 | print(tim.favorite_subject)
008 | ^^^^^^^^^^^^^^^^^^^^
009 | AttributeError: 'Person' object has no attribute 'favorite_subject'
HOKAY, so
how do we run a code here?
You do either !e or !eval before your code block
!e print
@grand plover :warning: Your 3.11 eval job has completed with return code 0.
[No output]
class Student(Person): indicates that the Student class inherits attributes and methods from the Person class. But in order to properly initialize those attributes we get from Person (age and name) we need some way to call its __init__ function
Enter, the super() function
!e print("helo wolrd")
@grand plover :white_check_mark: Your 3.11 eval job has completed with return code 0.
helo wolrd
super()'s job is to let you access the methods of the parent class more easily.
!e ```py
class Person:
def init(self, name, age):
self.name = name
self.age = age
class Student(Person):
def init(self, name, age, favorite_subject):
super().init(name, age)
self.favorite_subject = favorite_subject
tim = Person("Tim", 5)
sally = Student("Sally", 6, "Math")
print(sally.name)
print(sally.favorite_subject)
print()
print(tim.name)
print(tim.favorite_subject)
@scenic quiver :x: Your 3.11 eval job has completed with return code 1.
001 | Sally
002 | Math
003 |
004 | Tim
005 | Traceback (most recent call last):
006 | File "/home/main.py", line 18, in <module>
007 | print(tim.favorite_subject)
008 | ^^^^^^^^^^^^^^^^^^^^
009 | AttributeError: 'Person' object has no attribute 'favorite_subject'
So in order for us to set the age and name, we have to do super().__init__()
!e
code
!eval [python_version] <code, ...>
Can also use: e
Run Python code and get the results.
This command supports multiple lines of code, including formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.
By default, your code is run on Python 3.11. A python_version arg of 3.10 can also be specified.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
class Student(Person):
def __init__(self, name, age, favorite_subject):
self.name=name
self.age=age
self.favorite_subject = favorite_subject
tim = Person("Tim", 5)
sally = Student("Sally", 6, "Math")
print(sally.name)
print(sally.favorite_subject)
print()
print(tim.name)
print(tim.favorite_subject)
what's the difference?
!e while
@grand plover :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 1
002 | while
003 | ^
004 | SyntaxError: invalid syntax
I removed super().Init
!e Let's run it and see
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
class Student(Person):
def __init__(self, name, age, favorite_subject):
self.name=name
self.age=age
self.favorite_subject = favorite_subject
tim = Person("Tim", 5)
sally = Student("Sally", 6, "Math")
print(sally.name)
print(sally.favorite_subject)
print()
print(tim.name)
print(tim.favorite_subject)
@rugged root :x: Your 3.11 eval job has completed with return code 1.
001 | Sally
002 | Math
003 |
004 | Tim
005 | Traceback (most recent call last):
006 | File "/home/main.py", line 19, in <module>
007 | print(tim.favorite_subject)
008 | ^^^^^^^^^^^^^^^^^^^^
009 | AttributeError: 'Person' object has no attribute 'favorite_subject'
So in this case, nothing. BUT
Meanwhile,Any advice for a chemical engineer trying to switch to datascience?
I've got the basics of python/r in hand but confused with what to do next
Should I learn basics of stats/calculus
Can anyone give me any suggestions?
Lets say that Person inherits from something as well
so, Basically to save time?
You can use super() to chain your way through inheritance
!e class Person:
def init(self, name, age):
self.name = name
self.age = age
class Student(Person):
def init(self, name, age, favorite_subject):
self.name=name
self.age=age
self.favorite_subject = favorite_subject
tim = Person("Tim", 5)
sally = Student("Sally", 6, "Math")
print(sally.name)
print(sally.favorite_subject)
print()
print(tim.name)
print("holo word")
@grand plover :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Sally
002 | Math
003 |
004 | Tim
005 | holo word
@scenic quiver
!e i = 0 while i < 1000: print("the matrix")
@grand plover :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 1
002 | i = 0 while i < 1000: print("the matrix")
003 | ^^^^^
004 | SyntaxError: invalid syntax
can some one print a 1000 printing
print("a 1000 printing")
!e ```py
print("a 1000 printing")
@scenic quiver :white_check_mark: Your 3.11 eval job has completed with return code 0.
a 1000 printing
!e
print("a\t\t\t\t\t\t\t1000\t\t\t\t\t\t\t\t\tprinting")
@willow light :white_check_mark: Your 3.11 eval job has completed with return code 0.
a 1000 printing
SQLBolt provides a set of interactive lessons and exercises to help you learn SQL
SVB going into receivership UPVOTE PARTY!
best youtuber for hacking
https://j-h.io/plextrac || PlexTrac makes pentest reporting a breeze -- try their premiere reporting & collaborative platform in a FREE one-month trial! https://j-h.io/plextrac 😎
00:00 - SCManager Persistence
00:27 - Explaination
01:21 - How it works
05:18 - Demo begin
08:00 - Changing security descriptor
12:12 - Creating a service
...
Jim Cramer said Silicon Valley Bank was a buy last month at $320
Today it is being closed by California regulators
9144
1830
hey
@somber heath hello
yesterday i was getting error with installation of mongodb
yes
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@amber pagoda 👋
hi guys! it´s a pleasure to meet and learn with all
i get it
i was apart of intell the worst place on discord
but 3 days tho?
okay lol
I´m brazilian trying to improve my english, excuse me if I can´t understand
yeah i was just looking for a community to inspire me to code outside of academia we are a rare breed
see yeah im looking to learn about that side of python
yes in academia we only get basic knowledge
I´m 40 years old. I started my second university (course) in Technology of information. English bad 🙂
i really get that im hard stuck on day 17 of my udmey course and i know theres a better way to learn
how many years (experience) do you have?
@somber heath in kotlin or java?
i cannot aford collage and im sick of people who pretend to understand tech
@stuck goblet I study in a public university and I don´t know nothing about I.T. I´m starting from 0, learning my first language python
in college i have to use java and kotlin
@thick pulsar 👋
@willow gate java or kotlin it´s for special and high Qi
link up with me im gonna try to learn till i die and i need friends with the same mindset
@amber pagoda have started a course at all ?
I know only html and css
this are some of practical which i have to peform in college for practical examination
@stuck goblet yes... in a public university in Brazil, called univesp.br
@amber pagoda doc if you like we can go through my Udemy course together
@whole bear 👋
hi
@somber heath i have one question?
@stuck goblet I would like very much
like we can we use python in anroid studio?
what languages do you program?
@amber pagoda add me i work on it everyday im not working and since im ahead i can help explain anything you are having a hard time with
@somber heath can you gave me one small tutorial to a basic app with python means whenever you have time
from my understanding python is great for prototyping
ok
@stuck goblet sure, thanks
what is prototyping?
Kivy, Tkinter, Flask, Django, Beeware.
@somber heath uauuuuuuuu
its for app development
like getting code built for production code
first Python, and after, Django for me 🙂
👋 hi opal
I was gonna do python then move to java
Django is the best framework for python?
django is decent for sure
@somber heath do you like? or prefer other?
shh people here don't like java
@somber heath I understand
like swift ?
kivy is mostly used when you want to do cross platform
I am a 40-year-old young man who is facing a heavy bar and facing a career transition and finding it difficult to learn. But I can't complain about anything, I have willpower and that's the most important thing 🙂
What was the biggest difficulty you faced in the beginning? When did you start studying programming?
so what are dream projects people want to work on ?
i do like to work on things that helps with education and culture and things like this
like a library app
finding good source to study
yup oop is kinda hard
@somber heath classes and functions, object is difficult for me too
@somber heath do you think java and kotlin is similar to python?
[:] 🙂
python is my first language, it´s difficult but I´m falling in love
today i saw something interesting and i would like to share it with you
import antigravity
python is lovely
@somber heath what project are you most proud of ?
may i offer
import cowsay
what is being difficult is understanding functions and when to use while, if elif, else
i'm proud of your work 🙂
i show it to everyone
function is for when you have a code that you gonna use more than once
you make it inside a function so you can repeat it easily
okay
@golden sonnet like a piece of code
@somber heath I loved your pictures
I´m studying with Hyperskills
my notes.... and even so I feel difficult lol
like lets say
you get input peoples name
then you split the input into two part to get the first name and last name
you can do that easily
but if you have to work with 10 people
you'd have to write the same code 10 times
so you make it a function
and instead of writing the code 10 times
you write it 1 time and run it 10 times
truthy falsey ?
like kinda false kinda true?
!e py if True: print('A')``````py if False: print('B')
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
A
yes you can write it as a function
and keep runing it whenever you want
!e py if 'abc': print('A')``````py if '': print('B')
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
A
def people_name(first_name, last_name)
i > 20
print(name)
I don´t know lol
but if you don't make it a function
you have to write the whole code again and again
whoa there's python built into the server so cool
!e py if 1 + 1 == 2: print('A') print(1 + 1 == 2)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | A
002 | True
im learning!!!
!e
print(1 + 1 == 3)
@golden sonnet :white_check_mark: Your 3.11 eval job has completed with return code 0.
False
the basics are just oop
@golden sonnet :white_check_mark: Your 3.11 eval job has completed with return code 0.
<class 'function'>
so other languages aren't like that ?
how to write code like that? here
!code
it kinda makes things easier
under the hood object
its like a sleeper car
or the steve jobs shirt oop explanation
how do i use the bot to write python ?
!e
code
!code
!resources also check out this
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
good stuff in there
py print(Hello world)
I guess type is only strings and numbers
yup ("hello world") is the right way
print('hello world')```
print("hello Opal")
i'm too used to doubles
i like " more 🥺
less shift
not sure why that was a reply to !fernandodoc 😛
wait more shift
anyone use wsl and vs code here
be real tho are you pressing enter three times ?
pycharm for me
I'm loving learning with you
using ' and " is purely up to the user if i remember right'
@somber heath the convention you say PEP?
it's vs code
vs is different

