Google Docs
#voice-chat-text-0
1 messages Β· Page 972 of 1
time to execute this sussy exe in a vm, thank you π
extreme sus levels
this is code from a project called LithicRivers that just defines some game objects
@whole bear you can see https://github.com/HenryFBP/LithicRivers/blob/master/lithicrivers/game.py#L125 if interested further
lithicrivers/game.py line 125
class Tiles:```
just a funny minecraft meem
wow, that bot is cool
also most of the 3d engine was coded on a chromebook so if it rotates at lightspeed youll know its just because of how slow those chromebooks are
this is really cool!!!!!
did you make a renderer?
like wdym
like what do you mean by render in this context
a thing that shoots a bunch of rays onto a surface to see what color pixel it should be, in a box viewport
like a raycast renderer
oh no thats not how it works
it uses algorithms to determine the lighting, not raytracing
also if you are wondering its full true 3d
its not a raycaster
(also raycast lighting and raycasting are 2 different things)
also if you do want the source code i might post it
dett + debit == debt
yeeeeeeeeeeea boyeeee, post dat code
.copy()
@mortal crystal
from copy import deepcopy
my_dict = {'one': 1, 'two': 2}
new_dict_deepcopy = deepcopy(my_dict)```
that deepcopy removes all references
thank you mate, ill try the .copy methon and if it doesn't work ill try yours
Guys I asked help in one of the channels and the assistant hasnt helped me yet. Please if smn can help me, I I appreciate it
My problem is drawing a square in turtle using for loops
It is like that but it is hard
Yes?
I have tried and this is what I got
It looks so bad lol
this is my code
import turtle
import math
squareLength = 36
t = turtle.Turtle()
screen = t.getscreen()
pentagonLength = 2squareLength/1.539
pentagonLengthHalf = pentagonLength/2
innerPentagonLength = math.sqrt(2(pentagonLengthHalf2) - (2*pentagonLengthHalf2*math.cos(math.radians(108))))
for i in range(4):
t.forward(squareLength)
t.right(90)
t.forward(squareLength)
t.fillcolor('black')
t.begin_fill()
for i in range(4):
t.forward(35)
t.right(90)
t.forward(5)
t.end_fill()
does the t.right(x) rotates x grades?
Yes
lemme try
alright
can u also send me a capture of your code please
sure
u got to be verified
you have to be active in the channel for a certain time and then go to verification chat and write something
No it doesnt crash, it actually runs
you mean it closes by it self?
Hmmm!
Oh alright
yea
yea but the problem I draw the black square is bigger and it is in the right side,however I need it in the left up corner
just how exactly in the pic
alright
alight
r
Ohhh I got what you mean
yes
kinda
I changed the code and I got this!
nice!
you still have the tolerance problem with the thickness of the drawing
but... you can work on that latter
import math
squareLength = 36
t = turtle.Turtle()
screen = t.getscreen()
pentagonLength = squareLength/1.539
pentagonLengthHalf = pentagonLength/2
innerPentagonLength = math.sqrt(2 * (pentagonLengthHalf) - (2*pentagonLengthHalf*math.cos(math.radians(108))))
for i in range(4):
t.forward(squareLength)
t.right(90)
t.forward(squareLength)
t.fillcolor('black')
t.begin_fill()
for i in range(4):
t.right(90)
t.forward(36)
t.right(90)
t.forward(squareLength * 2)
for i in range(4):
t.left(90)
t.forward(36)
t.end_fill()```
wait I ll try
broo!!! I cant believe it I almost getting it lol
Brother you are smart!!!!!!!!!! Thanks mate
See what you can learn from my code and try the triforce one. Let me know if you can't get it
and @mortal crystal I wont forget for helping me I really appreciate it
dw mate
Thanks guys have a good one
How do I talk in the channel?
Ah been a member for a while, but guess I gotta write a lot more.
yeah not enough messages
Dang I want to talk
Maybe I just write 50 messages here
I think I've been here for more than a year for sure
I'm playing League, but after I'll get my quota of messages
Cool
:incoming_envelope: :ok_hand: applied mute to @weak harbor until <t:1644637241:f> (9 minutes and 59 seconds) (reason: burst rule: sent 8 messages in 10s).
Oh yeah, that's a nice fact π
Although it's more surprising that the Aztec empire was so recent.
π
Yep π
Don't arrest me :C
mute @stuck furnace
:C
I once wore hat that was made by a Python.
<></> π oh wait that's not python!
was supposed to do the smiley face via text which looks like a hat
sorry sir
Pglet
ships = {"Aircraft Carrier": "1,1","1,2","1,3","1,4","1,5", "Battleship":"2,1","2,2","2,3","2,4"} # etc
ships = {"Aircraft Carrier": [(1,1),(1,2),(1,3),(1,4),(1,5)], "Battleship":[(2,1)(2,2)(2,3)(2,4)]} # etc
!e ```py
x = True, True, True
y = True, True, True
z = (True, True, True == x)
print(x,y,z)
@velvet urchin :white_check_mark: Your eval job has completed with return code 0.
(True, True, True) (True, True, True) (True, True, False)
I want so much to unlock voice in the channels
!voice @light python
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Ty
Intelligence X is a search engine and data archive. Search Tor, I2P, data leaks and the public web by email, domain, IP, CIDR, Bitcoin address and more.
ships = {"Aircraft Carrier": [(1,1),(1,2),(1,3),(1,4),(1,5)], "Battleship":[(2,1)(2,2)(2,3)(2,4)]} # etc
x,y = tuple
ships = [[(1,1),(1,2),(1,3),(1,4),(1,5)],[(2,1)(2,2)(2,3)(2,4)]]
ships = {"0": [(1,1),(1,2),(1,3),(1,4),(1,5)], "1":[(2,1)(2,2)(2,3)(2,4)]} # etc
x,y = ships[0][0]
x,y=ships["Aircraft Carrier"][0]
!eval
!eval [code]
Can also use: e
*Run Python code and get the results.
This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*
!eval
ships = [[(1,1),(1,2),(1,3),(1,4),(1,5)],[(2,1)(2,2)(2,3)(2,4)]]
x,y = ships[0][0]
@tall cloak :x: Your eval job has completed with return code 1.
001 | <string>:1: SyntaxWarning: 'tuple' object is not callable; perhaps you missed a comma?
002 | Traceback (most recent call last):
003 | File "<string>", line 1, in <module>
004 | TypeError: 'tuple' object is not callable
!eval
ships = [[(1,1),(1,2),(1,3),(1,4),(1,5)],[(2,1),(2,2),(2,3),(2,4)]]
x,y = ships[0][0]
@tall cloak :warning: Your eval job has completed with return code 0.
[No output]
!eval
ships = [[(1,1),(1,2),(1,3),(1,4),(1,5)],[(2,1),(2,2),(2,3),(2,4)]]
x,y = ships[0][0]
print(f"X: {x}, Y: {y}")
@tall cloak :white_check_mark: Your eval job has completed with return code 0.
X: 1, Y: 1
I think saying you prefer Bash to Python a bannable offence /dev/null π
Go join BashDiscord if you love it so much :C
π€£
Now that I've learned most of its quirks, I have to admit, Bash isn't too bad.
But definitely not great for more structured programming.
Oh right
Ah yeah. Pipelines in Python are more complicated than they need to be.
optimalizatoin
coin it
buy a dictionary
it's a book reccomendation
I dunno man. optimization seems like something a bash genius would know about
maybe know how to pronounce, would have read it a few times
yeah
ptt takes 3 tons of force
right now, making a dataset of sites that allow scraping π
I'm not scraping anything, just making it more as a reference since a lot of people don't like to dive into the terms of sites
only site I've come across that explicitly allows scraping in some way is github
gotta block the nsa
they can't do anything now π€·ββοΈ
Β―_(γ)_/Β―
but yeah like github actually allows scraping and I think that's pretty cool
Wouldn't it be funny if you scraped their terms of service to find out if they allow scraping π
I think they've been working on the code search stuff but idk
π€«
trivia is exciting, sad I can't make it
really fun to see all the work that was put into the code behind the scenes though
pr open since october
sir-lancebot#910
welcome back lx
Β―_(γ)_/Β―
it grabs attention
I mean, you could answer the questions as if they're about JS, but you probably won't score very highly.
JS has some nice trivia actually π
It was created by one guy in a week.
Oh yeah, but you're kind of forced to learn all the history of Unix, just to understand how it works.
I should head off too π
@wind raptor π
π€

Like, you know why there's /bin as well as /usr/bin?
It's because they ran out of space on their main hard drive π
And had to move some stuff over to /usr
But people have kind of rationalised it after the fact.
Erm, yep, I'll find the source...
I think on most systems now one is a symlink to the other.
Ah yea, on Ubuntu /bin is a symlink to /usr/bin.
Yeah, Nix does everything its own way.
I have been meaning to give it a try.
There's a guy in the voice chat here frequently, who is like obsessed with NixOS π
π
Oh yeah, like "deterministic"
Still not sure I know what that means exactly π
Yep
Wait what?
Oh 
Don't you mean dynamically linked?
I'll try it out in Docker.
!stream 319509382889209866
β @velvet urchin can now stream until <t:1644645646:f>.
helloooo
that sounds nice
i am suffering trying to figure out how to code something
im coding a dbms
yas
Hey
yes
since im doing it from scratch
i decided to make a
parser for sql
as well as like execute sql commands
@somber heath you cna use he/him for me
@zenith radish develop a parser
import random
import turtle
pen = turtle.Turtle(shape='turtle')
screen = pen.getscreen()
pen.setheading(random.randrange(-180, 180))
while 1:
pen.forward(1)
pen.setheading(pen.heading() - random.randrange(-18, 18))
pos_x, pos_y = pen.pos()
if not -(screen.window_width() / 2) < pos_x < screen.window_width() / 2:
pen.setheading(180 - pen.heading())
if not -(screen.window_height() / 2) < pos_y < screen.window_height() / 2:
pen.setheading(-pen.heading())
I accidentally joined the call..
π π
I was wondering about what in Python π€
Was discussed
Langton's art.
!voice
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Traceback (most recent call last):
File "a:\Alve\Hottiti\Documents\First file\test.py", line 2, in <module>
playsound("A://Alve//Hottiti//Documents//try.py//Sounds//Thanos.mp4")
File "C:\Python10\lib\site-packages\playsound.py", line 34, in _playsoundWin
winCommand('open "' + sound + '" alias', alias)
File "C:\Python10\lib\site-packages\playsound.py", line 27, in winCommand
exceptionMessage = ('\n Error ' + str(errorCode) + ' for command:'
TypeError: can only concatenate str (not "bytes") to str
PS A:\Alve\Hottiti\Documents>
I am getting this error can anybody help me to fix this
@dire folio 853291821173702677 this guy is coming to vc n abusing n leaving
F
ao bhai pubg khelte hei
@stuck sky
mera bap snake charmer hai
ye python ko dudh mila mila kai
mardega
hindi mai bolo na bhai @warm vapor
kya ye chinese rakha hai nam mai?
kitna ummar ka hai @stuck sky
how old are you mister
?
mera bap iit mai kam karta hai
firak nahi
tum log kiska bat kar rahe ho?
hindi mai bolne se kya jata hai
mere se karlo
mai to pro hu
pubg mai 10+ kills
t2 player
@stuck sky
kaun gali karke gaya tha kya?
@warm vapor mai bhi 14 years old but much more smarter
@warm vapor
yes
@stuck sky
ok π
u're just a noob @edgy echo
make like an education platform
it will help with course book studies and this websites thing too
ik javascript to php everything
your mom noob
wait i come from another acc
boostrap ez
bootsrap is just css but easier
so ezier
btw what are your guys wpm?
haha
going to flex now
def name(name: str) -> dict:
100 maybe
def xyz():
learn react.js guys
depends if typing syntax
@compact yacht join vc first(xD)
ok cool
he said
r u a web d?
are you web developer
smart people π€
but i use arch btw
@stuck sky make discord bot and impress girls
kya bola? @warm vapor
backend ke liya kya use karta hai @stuck sky ?
he said u sound advance
me noob
ig
he is lying
very advanced for your age
@compact yacht how much salary can you get from data science?
where you from?
.au
ig computer vision , ai , ml ,deep learning
How long is this going to take?
@stuck sky make a website that has like homeworks and ADS
you get money
i did that
that will help in your studies
and coding too
Hard to feel like you are making progress with coding without seeing results. But hearing people talk about it makes it more feasible.
Like this 50 message limit for talking....
I don't feel like it will ever end.
it won't.
you will learn new things for your life - life long learning.
just take at relaxed pace
so you don't burn out.
in 20 years the technology will be completely different than today.
Yeah, gotta make it part of your life but with a job, side hustle, gym, and hardly any social life, it's harder to set aside time.
True true, do you think Golang is a good investment to learn?
Or is Python the future?
why r u thinking of 20 years later
and very powerful.
I feel like Python is harder to get a job for some reason everyone lists Python as their coding.
Mostly i just use Python, R , and unix shell commands.
which programming language is good for getting a job?
Yeah Aryan
react.js
Is 30 too old to make a career shift for programming? I have so much experience with marketing but coding just seems more valuable and more fun things to do.
But coding friends of mine get burnt out of coding.
definitely not, 30 - you still have 40 years of working life, if you work hard, you can have a high level of profficiency in 1 year.
Whereas marketing I think I could do forever with no worries.
Which is better to do something you enjoy and can not get burnt out but not so rewarding or something that challenges you but is rewarding and can get burnt out?
ozycon - you definitely can be successful if you have the aptitude and are willing to put in 1-2 hours per day
ozycon - personal choice. life quality generally better
from fastapi import FastAPI
from fastapi.middleware.wsgi import WSGIMiddleware
from django.core.wsgi import get_wsgi_application
import os
from importlib.util import find_spec
from fastapi.staticfiles import StaticFiles
from django.conf import settings
# Export Django settings env variable
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
# Get Django WSGI app
django_app = get_wsgi_application()
# Import a model
# And always import your models after you export settings
# and you get Django WSGI app
from accounts.models import Account
# Create FasatAPI instance
app = FastAPI()
# Serve Django static files
app.mount('/static',
StaticFiles(
directory=os.path.normpath(
os.path.join(find_spec('django.contrib.admin').origin, '..', 'static')
)
),
name='static',
)
# Define a FastAPI route
@app.get('/fastapi-test')
def read_main():
return {
'total_accounts': Account.objects.count(),
'is_debug': settings.DEBUG
}
# Mount Django app
app.mount('/django-test', WSGIMiddleware(django_app))```
Do you feel that Python is only valuable for backend?
no lol
you learn from university or yourself?
you already have the skills to be successful. today.
i did a mathematics degree, but the concepts are similar.
you made my motivation double
thanks
btw how old are you clone?
old lol
it's from a yelp data set. - reviews of restuarants.
logistic regression uses a log link function to link sum of squares to discrete outcomes
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
@zealous blade
Don't mind me just doing my homework
Getting closer and closer to 50 comments so I can speak
What's fresh OpalMist?
Are y'all talking about produce?
Green tea or Vanilla ice cream
See this is the trouble with no mic, many don't even look at chat but I'm trying to add to the convo.
Feels like I'm watching a Twitch Chat but just the voice.
I just want to speak T_T
Tea all the way.
Coffee is addiction, Tea is a choice.
Farina is a form of milled wheat popular in the United States.
I'm well aware of that
Just need 50 messages
You are not currently eligible to use voice inside Python Discord for the following reasons:
β’ You have sent less than 50 messages.
β’ You have an active voice infraction. (wut...)
I wrote too many messages is all to reach 50
I also said the name Vold ... emort
There should be an option to see how many messages you have left
So close
@zenith radish can you talk about GO?
Career wise and tech future?
Isn't it super fast?
Pros and Cons?
So hiring wise Java or C# is better than Go and Python?
Thanks btw
Do you feel the same way about Go?
Cool cool, yeah I hear it's good for NFT and Crypto.
So my website went from PHP to Golang. So it's so much easier and faster but looking back maybe I should have done Python?
Do people even hire Golang Developers or better to find others? Not to mention the frontend.
But like easily and aggresively
Degree? not in tech
I have ninety degrees.
Which niche?
L
Ah gotcha
I had trouble learning it in an hour
Granted I learned via udemy. Still in the course. I really like Python, but my website where I have a dev who I pay is in Golang.
But my skills in Python isn't good enough to build a website y'know?
Ok lol
Can you say anyone can just build an NFT marketplace and video site?
Tyy, I'm just explaining why I have to hire a dev, that's not being negative. I can hire someone if I need.
If you think no one should hire a developer, that's like saying no devs should have jobs lol.
Yup yup
omg sorry i went to sleep
Enough about me, that was a cute cat
hewwos. nom noms for now
ughh.. I'm trying to make this more efficient, but I've had good and bad results at lower run counts also.
Run Counts || Run1 1 || Run2 6 || Run3 3 || Run4 3 || Run5 0
plans - (202, 125, 92)
Run Counts || Run1 1 || Run2 18 || Run3 9 || Run4 9 || Run5 0
plans - (102, 125, 92)
Run Counts || Run1 1 || Run2 40 || Run3 20 || Run4 20 || Run5 0
plans - (203, 128, 89)
Run Counts || Run1 1 || Run2 12 || Run3 6 || Run4 6 || Run5 0
plans - (204, 128, 89)
Run Counts || Run1 1 || Run2 64 || Run3 32 || Run4 32 || Run5 0
plans - (302, 126, 91)
Run Counts || Run1 1 || Run2 58 || Run3 29 || Run4 29 || Run5 0
plans - (103, 128, 89)
Run Counts || Run1 1 || Run2 22 || Run3 11 || Run4 11 || Run5 0
plans - (205, 125, 92)
Run Counts || Run1 1 || Run2 6 || Run3 3 || Run4 3 || Run5 0
plans - (206, 128, 89)
Run Counts || Run1 1 || Run2 38 || Run3 19 || Run4 19 || Run5 0
plans - (303, 125, 92)
Run Counts || Run1 1 || Run2 24 || Run3 12 || Run4 12 || Run5 0
Run Counts || Run1 1 || Run2 18 || Run3 9 || Run4 9 || Run5 0
plans - (111, 128, 89)
not very efficient atm, cant seem to get it as a pool atm, so is running run number 100,200,300 per core.. unused cores if a run finishes.. pool keeps doubling the run, so some work to do when I persure that more.
i prefer to only use builtins, so if I need to construct anything additionally.. i dont have to contend with an imported lib
!e ```py
from dataclasses import dataclass, asdict
import json
@dataclass
class Test:
name: str
age : int
bob = Test('bob', 15)
print(bob)
print(asdict(bob))
getting a string to jam over the socket
serialised = json.dumps(asdict(bob))
Turning the received thing back into an object
deserialised = Test(**json.loads(serialised))
print(deserialised)
ized
@quasi condor :white_check_mark: Your eval job has completed with return code 0.
001 | Test(name='bob', age=15)
002 | {'name': 'bob', 'age': 15}
003 | Test(name='bob', age=15)
!e ```py
from dataclasses import dataclass
@dataclass
class Test:
name: str
age : int
t = Test('a', 20)
print(eval(repr(t)))
@quasi condor :white_check_mark: Your eval job has completed with return code 0.
Test(name='a', age=20)
i was playing with your code @quasi condor
!e
from dataclasses import dataclass
@dataclass
class Test:
name: str
age : int
adict = {1:10, 2:20, 3:30}
for key, value in adict.items():
for x in range( len(adict)):
t = Test(key, value)
print(eval(repr(t)))
@pallid hazel :white_check_mark: Your eval job has completed with return code 0.
001 | Test(name=1, age=10)
002 | Test(name=2, age=20)
003 | Test(name=3, age=30)
Battleship β online game for 2 players. Arrange ships, wait for opponent and start playing.
why cant i speak?
!voice
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
what do u study?
that could be an xkcd diagram
candidate := ve.localCandidates[len(ve.localCandidates) - 1]
ve.localCandidates = ve.localCandidates[:len(ve.localCandidates) - 1]
candidate := pop(ve.localCandidates, 1)
G2g cheers
π
candidate := ve.localCandidates[0]
ve.localCandidates = ve.localCandidates[1:]
@zenith radish i fell out of the shower and hit my head off of the wall as a landing if that makes you feel better
ive been coding to try and heal
its life long man
@zenith radish is the 7 foot 2 guy a good coder?
triangulate?
π
@zenith radish have a good night
the code looked good
π
interesting
ok talk later man
!voice @timid creek
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
π³
import turtle
from itertools import cycle
def rgb_to_hex(r, g, b):
return f'#{hex(r)[2:].zfill(2)}{hex(g)[2:].zfill(2)}{hex(b)[2:].zfill(2)}'
pen = turtle.Turtle()
turtle.bgcolor('#000000')
width = 1
rgb_colours = []
# Making a ROY G BIV fade
for num in range(255 // 3 + 1):
rgb_colours.append((255, num * 3, 0))
for num in range(255 // 5):
rgb_colours.append((255 - (num + 1) * 5, 255, 0))
for num in range(255 // 5):
rgb_colours.append((0, 255 - (num + 1) * 5, 0 + (num + 1) * 5))
for num in range(255 // 5 - 1):
rgb_colours.append((0 + (num + 1) * 5, 0, 255 - (num + 1) * 5))
# Convert all the RGB values into Hex values
hex_colours = []
for colour in rgb_colours:
hex_colours.append(rgb_to_hex(*colour))
colour_cycle = cycle(hex_colours)
radius = 100
for _ in range(len(hex_colours)):
pen.color(next(colour_cycle))
pen.circle(radius, 180)
pen.left(185)
pen.circle(-radius, 180)
pen.left(360 / len(hex_colours) / 2)
!e py import numpy as np start = 0,128,255 end = 255,0,128 steps = 10 endpoint = True gradient = np.linspace(start, end, steps, endpoint).astype(int) print(gradient)
@somber heath :white_check_mark: Your eval job has completed with return code 0.
001 | [[ 0 128 255]
002 | [ 28 113 240]
003 | [ 56 99 226]
004 | [ 85 85 212]
005 | [113 71 198]
006 | [141 56 184]
007 | [170 42 170]
008 | [198 28 156]
009 | [226 14 142]
010 | [255 0 128]]
data[..., :-1]
@somber heath :white_check_mark: Your eval job has completed with return code 0.
ab
Source: https://stackoverflow.com/a/3753428 ```py
data = np.array(im) # "data" is a height x width x 4 numpy array
red, green, blue, alpha = data.T # Temporarily unpack the bands for readability
# Replace white with red... (leaves alpha values alone...)
red_areas = (red == 255) & (green == 0) & (blue == 0)
data[..., :-1][red_areas.T] = (255, 255, 255) # Transpose back needed
So.
np.where
import numpy as np
shape = 5, 5, 3 #5 units by 5 units in size, three colour channels
arr = np.zeros(shape, int)
arr[0,0] = 128,128,128 #Set position 0,0 colour to grey
print(arr)
arr = np.where(arr == (128, 128, 128), (255, 0, 0), arr) #Wherever the colour is grey, change it to red
print(arr)```
yo
!pastebin
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
π
What're you making? π
Hello cat π
Soo, what is everyone up to?
I had a stare down with it until it left π
Probably the biggest fox I've ever seen π€
Yep
Oh, they're like everywhere here.
Usually at night.
But this one was pretty brazen.
Have you seen those Russian domesticated foxes?
Oh yeah. It's a really long-running experiment.
Mhm, and their appearance changed to be more dog-like.
But apparently they still don't make very good pets yet π
Got to decide if I want to spend today productively...
And then figure out how to spend it productively π€
Hey @willow lynx π
Yikes
Hello π
hey
I'm going to get on with some work π
id join voice chat but i haven't sent enough messages working on class workshops for boot camp this week
@thorn magnet hi
very quiet
Um yes who are you
anybody paly Lost Ark?
youve said enough
what are you guys talking about ;-;
random.shuffle()
oh
!d random.shuffle
random.shuffle(x[, random])```
Shuffle the sequence *x* in place.
The optional argument *random* is a 0-argument function returning a random float in [0.0, 1.0); by default, this is the function [`random()`](https://docs.python.org/3/library/random.html#random.random "random.random").
To shuffle an immutable sequence and return a new shuffled list, use `sample(x, k=len(x))` instead.
Note that even for small `len(x)`, the total number of permutations of *x* can quickly grow larger than the period of most random number generators. This implies that most permutations of a long sequence can never be generated. For example, a sequence of length 2080 is the largest that can fit within the period of the Mersenne Twister random number generator.
Deprecated since version 3.9, will be removed in version 3.11: The optional parameter *random*.
@wind raptor are you buddhist?
muhahha.. I've done it..
I just dont like the output very much
Run Counts || Run1 1 || Run2 24 || Run3 24 || Run4 24 || Run5 0
plans - (<Synchronized wrapper for c_int(510)>, 130, 87)
Finished SM MOCK Initial Moves, It took 64.2278368473053 seconds.
Will look into changing up (<Synchronized wrapper for c_int(510)>
but it's down to 64seconds from 1250..
No.. it's more Go... my brain hurt already :/
Yes
noo.. i have a bug π¦
anybody good at mysql?
mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
docker run -it --rm -v $PWD:/workspace -w /workspace golang /bin/bash
@zenith radish https://github.com/fullstorydev/grpcurl
@uncut meteor can I stream, trying to resolve a race condition
!stream @pallid hazel
β @pallid hazel can now stream until <t:1644763338:f>.
im interested
my mic needs to be cycled, but I cannot figure this out. π¦
my mic is muted
!voice
Voice verification
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
seems i may have solved the race condition, but oddly by making up something that probablly shouldnt work, as all the examples I could find are people trying to keep the initial number the same..
like who would want that in a counter, makes no sense.
brb
hey
hi
Server side code:
hey
ohh, one wonders what goes on in the "super secret staff meetings" ... although I imagine mostly horse playing..
tough decisions like, should we go back to the animated icon or leave the pink one? ...
def alphabet_position(text):
alphabet = ['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 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26']
my_dict = {char: number for char, number in zip(alphabet, numbers)}
for character in text:
num = str(my_dict.get(character.lower()))
good = text.replace(character,num)
return good
!code
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
def alphabet_position(text):
alphabet = ['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 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26']
my_dict = {char: number for char, number in zip(alphabet, numbers)}
for character in text:
num = str(my_dict.get(character.lower()))
good = text.replace(character,num)
return good
`py
!e
alpha = ['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']
for i, val in enumerate(alpha, start=1):
print(i, val)
@uncut meteor :white_check_mark: Your eval job has completed with return code 0.
001 | 1 a
002 | 2 b
003 | 3 c
004 | 4 d
005 | 5 e
006 | 6 f
007 | 7 g
008 | 8 h
009 | 9 i
010 | 10 j
011 | 11 k
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/omecomovuk.txt?noredirect
!docs enumerate - don't forget to set the start keyword to 1.
enumerate(iterable, start=0)```
Return an enumerate object. *iterable* must be a sequence, an [iterator](https://docs.python.org/3/glossary.html#term-iterator), or some other object which supports iteration. The [`__next__()`](https://docs.python.org/3/library/stdtypes.html#iterator.__next__ "iterator.__next__") method of the iterator returned by [`enumerate()`](https://docs.python.org/3/library/functions.html#enumerate "enumerate") returns a tuple containing a count (from *start* which defaults to 0) and the values obtained from iterating over *iterable*.
```py
>>> seasons = ['Spring', 'Summer', 'Fall', 'Winter']
>>> list(enumerate(seasons))
[(0, 'Spring'), (1, 'Summer'), (2, 'Fall'), (3, 'Winter')]
>>> list(enumerate(seasons, start=1))
[(1, 'Spring'), (2, 'Summer'), (3, 'Fall'), (4, 'Winter')]
``` Equivalent to...
a quick improvement -
from string import ascii_lowercase as alphabet_letters
# alphabet_letters = "abcdefgh..."
def alpha_to_pos(text: str) -> str:
# could use '.translate()' instead.
for n, v in enumerate(alphabet_letters, start=1):
text = text.replace(v, str(n))
return text
gimme a sec need to fix my audio
!code
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
print("Hello world!")
damn, thought my current script was done.. retested again before moving to the next section and found an anomalie... grrr..
Hello
I'm don't speak english
which Language you do speak ?
I live in Russia, and you
Better, perhaps, than you hitting me.
Israel my body
ok 
In Russian
link to chat
voice chat
please
Does Hebrew have a sister language named Shebrew?
?
this new
no
A pity. Linguists usually have a keener sense for wordplay.
ΠΡΡΡ ΠΊΡΠΎ ΠΈΠ· Π ΠΎΡΡΠΈΠΈ ΡΠΎΠ΄Π½ΠΎΠΉ
I do not know what to say
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
its lively in this voice call
The editor war is the rivalry between users of the Emacs and vi (now usually Vim, or more recently Neovim) text editors. The rivalry has become a lasting part of hacker culture and the free software community.
The Emacs versus vi debate was one of the original "holy wars" conducted on Usenet groups, with many flame wars fought between those insi...
yo sup
Fine man
!e py class MyClass: def __init__(self): self.__ = None mc = MyClass() mc.__
@somber heath :warning: Your eval job has completed with return code 0.
[No output]
!e ```py
class A:
def init(self):
self.__a = 1
class B(A):
def init(self):
super().init()
self.__b = 2
x = B()
print(sorted(set(dir(x)).union(object.dir(x))))
@primal yacht :white_check_mark: Your eval job has completed with return code 0.
['_A__a', '_B__b', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__']
!e py class MyClass: def __init__(self): self.__foo__ = None #Yes. I'm aware. mc = MyClass() mc.__foo__
@somber heath :warning: Your eval job has completed with return code 0.
[No output]
!e py class MyClass: def __init__(self): self.__foo = None mc = MyClass() mc.__foo
@somber heath :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 5, in <module>
003 | AttributeError: 'MyClass' object has no attribute '__foo'
mc._MyClass__foo
Thus, starting an attribute with __ does namespace scrambling, unless it also ends with __. They can be the same __.
!e ```py
class A:
def init(self):
self.__ = 2
self.___ = 3
self.____ = 4
self._____ = 5
x = A()
for name in sorted(set(dir(x)).union(object.dir(x))):
y = getattr(x, name, None)
if type(y) is int:
if 1 < y < 5:
print(repr(name), '->', repr(y))
But, of course, dundering things that aren't dunders which govern sugar syntax can be confusing.
@primal yacht :white_check_mark: Your eval job has completed with return code 0.
001 | '__' -> 2
002 | '___' -> 3
003 | '____' -> 4
.
!e ```py
class A:
def init(self):
self.__ = 2
self.___ = 3
self.____ = 4
self._____ = 5
x = A()
for name in sorted(set(dir(x)).union(object.dir(x))):
y = getattr(x, name, None)
if type(y) is int:
if 1 < y < 6:
print(repr(name), '->', repr(y))
@primal yacht :white_check_mark: Your eval job has completed with return code 0.
001 | '__' -> 2
002 | '___' -> 3
003 | '____' -> 4
004 | '_____' -> 5
If the class name consists only of underscores, no transformation is done.
π
hiii >w<
π€¨
Β―_(γ)_/Β―
Just like "Teen Titans Go" .... just ... ...... weird
Back in a bit
Apparently he put a lot of effort into the colour of the bricks at Pixar HQ π
Gotta install the phone Desktop app on someone's rig
Can you remote in? @rugged root
I mean he's here
And...
Easier if I walk in there and step him through it if need be
Lol
He's one of the partners, he deserves that much
Fair
Pfft, partner shmartner
Partner shartner
Did you see that Mark Rober experiment with the wallets?
Erm, @wind raptor you've got background noise.
Ah yeah good idea!
@wind raptor moved you to AFK.
Someone did actually leave when you were away Katie.
Wait, free candy? 
This is a thing?
Oh nice π
Oh, new Boston Dynamics video: https://www.youtube.com/watch?v=Jq0GknnKvXM
What do our robots really get up to after hours? Go behind the scenes of our collaboration with @SamuelAdams to find out.
Watch the full collaboration: https://youtu.be/SUQnduNzsw8
#BostonDynamics #Robots #Robotics
Yep π
I feel like it would be really fun to work there.
Also Disney's robotics/animatronics division.
They do some interesting stuff.
E.g.
The robot acrobats can flip through the air and stick a landing every time
Read more: https://techcrunch.com/2018/06/28/disney-imagineering-has-created-autonomous-robot-stunt-doubles/
But in that case it's more about making it look good than actual useful robots.
I love how the first one is literally just a stick π
Venturing off into the wilderness?
Itβs more that special effects have gotten cheap enough that robots are good enough
Oh yeah. I guess they might use them at the theme parks as well π€·ββοΈ
Linux Command Line Books by William Shotts
@wind raptor I'm an idiot
I was testing to make sure that annotations did cover the global generics
And I mistyped the future import, and it errored
Ohh, apparently 'potato milk' is a thing now.
Oooooo that sounds good
Actually kind of does π
In a JavaScript Discord server:
Does anyone knows the error
https://cdn.discordapp.com/attachments/591124248039260170/904045719931981884/2021-10-30_2.png
Tried to do the thing def test(bam: list[int]):, got an error, and was super confused
Derp
Take mashed potato, add water. Shake vigorously.
Should use Brawndo. It's got what plants crave.
Electrolytes
A surprisingly watchable movie.
Ah, yeah just got rejected.
If you're talking about what I think you're talking about.
Callable[[...], Any]
Oh yeah, sorry nvm.
Rejected, projected, ejected. When you turn up for a job interview, get turned down, and get slingshot out of the skylight.
@zenith radish https://github.com/pglet/pglet
Go is weird
Go's a great language to learn (apparently)
Eh
Have you met Microsoft's documentation?
I hate Microsoft's documentation when I'm trying to learn something
fair fair
@amber raptor
Swagger?
They have the runner builtin
pglet/utils.py lines 100 to 111
def open_in_browser(url: str) -> None:
"""Open the passed URL in a browser
:param url: The URL to open
:type url: str
:return: None
:rtype: None
"""
if get_system() == "windows":
# FIXME: explorer.exe is the file explorer. Should this be MS Edge instead?
subprocess.run(["explorer.exe", url])
else:
subprocess.run(["open", url])```
Is there not an edge.exe on PATH that could be used instead?
@stuck furnace Can't control either while on mobile with this headset
It's not on %PATH%
Then where is it?
Windows and its Registry handles the finding of it ... lemme check
64-bit Win10 has it located here:
"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
I have the base executable pinned on my Start Menu
why straight copy?
... Why is the 64bit in the 32bit folder?
umm.. who would do that
There is the built in browser module
I don't know ... but it is located there
low level it with marcium
Hmm
What percentage of people still have old Edge?
!docs webbrowser
Source code: Lib/webbrowser.py
The webbrowser module provides a high-level interface to allow displaying web-based documents to users. Under most circumstances, simply calling the open() function from this module will do the right thing.
Under Unix, graphical browsers are preferred under X11, but text-mode browsers will be used if graphical browsers are not available or an X11 display isnβt available. If text-mode browsers are used, the calling process will block until the user exits the browser.
That seems like it's a built in thing doing that but better
But I'm also probably missing context and being unhelpful
webbrowser uses an environment variable by default
Says what?
... err ... maybe not on Windows
#
# Platform support for Windows
#
if sys.platform[:3] == "win":
class WindowsDefault(BaseBrowser):
def open(self, url, new=0, autoraise=True):
sys.audit("webbrowser.open", url)
try:
os.startfile(url)
except OSError:
# [Error 22] No application is associated with the specified
# file for this operation: '<URL>'
return False
else:
return True
can someone briefly share screen and review strings for pythong real quicvk for like 5 minuyes?
Like just introduct strings i have a lesson for strings in 20 minutes for it
i want to know it before i do my class
I do, but i want to know in advance
yea
sure
and whats it used for?
oh so for like an input
input()
yeaa
but only in ""
oh so say you do, name = input ("What is your name")
print (name)
wait what you say?
name = input("What is your name? ")
print(name)
For my parentisis?
Oh...
i make it cleaner...
;-;
i thought it was clean
no im saying this
print()
print ()
can i do either
why tho?>
is there a reason
oh...
okok makes sense
ty
A songification of that most holiest of Python Enhancement Proposals, the PEP 8.
Based on an idea by Daniel "Mr. Hemlock" Brown.
Written and performed by Leon SandΓΈy, A.K.A. lemonsaurus.
Music and melody from Mad World by Roland Orzabal. This version was inspired by the version released by Gary Jules.
π Website: https://pythondiscord.com/ β
π¬ ...
immutable - cannot directly manipulate
ok
mutable - can be manipulated
i doubt that
but ok.
Cause my teahcer is stupid
lol
oh shoot, we are doing string methods
whats the difference
is there an example?
!e
name = "Hemlock"
combined = "Hello " + name + "."
print(combined)
@rugged root :white_check_mark: Your eval job has completed with return code 0.
Hello Hemlock.
!e
normal = "spam"
big = normal.upper()
print(normal)
print(upper)
@rugged root :x: Your eval job has completed with return code 1.
001 | spam
002 | Traceback (most recent call last):
003 | File "<string>", line 4, in <module>
004 | NameError: name 'upper' is not defined. Did you mean: 'super'?
!e
combined = "Hello " + name + "."
print(combined)```
@shut hill :white_check_mark: Your eval job has completed with return code 0.
Hello Mr. Hemlock.
!e
normal = "spam"
big = normal.upper()
print(normal)
print(big)
@rugged root :white_check_mark: Your eval job has completed with return code 0.
001 | spam
002 | SPAM
!e
big = normal.upper()
print(normal)
print(big)```
@shut hill :white_check_mark: Your eval job has completed with return code 0.
001 | spam
002 | SPAM
wait
how did it set 1 and 2?
like how are there numbers
ohh
lol
yeayea
The upper is same as HTML
yeyeya
i like to get aheadof the class so i can get a 98 π
Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.
>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."
Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.
surprise meeting
i will give you print statments
π
π
hemlock
not one on one
im sayin in a vc
π
!e
name = "Mr. Hemlock"
combined_concat = "Hello " + name + "."
combined_format = "Hello {}.".format(name)
combined_fstring = f"Hello {name}."
print(combined_concat)
print(combined_format)
print(combined_fstring)
@rugged root :white_check_mark: Your eval job has completed with return code 0.
001 | Hello Mr. Hemlock.
002 | Hello Mr. Hemlock.
003 | Hello Mr. Hemlock.
WOAH
wait
hold u
p
wiaitiiwiawiittiwiait
oml
floaT?
can u explain float
i know
but im wondering
im so lost
;-;
yea
lol
ok
and int
yea
lol
and that thing
ok mmbbmb
for format what does it do?
and what doesthe curly braces do?
Like what tho
# integer `int`
12345
-12345
# floating point / decimal number `float`
123.456
-12.0
1e20
oh so name
so u can also do "Hello (name). "
???
Ohhh
so wehat u did was 3 diffeeent methods
ohhhh
wait what is the easiest one
u said?
whats good abiut it
can u give me an excersie for me to do?
tytyt
dw take ur time. π
where do ui work?
!e
number = 5
example = "The number is: " + number
@rugged root :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 2, in <module>
003 | TypeError: can only concatenate str (not "int") to str
number = 5
example = "The number is: " + str(number)
so would you put it inside the string with curly parentisis?
!eval
x=22
print(f"{x=}")
oh
@sweet lodge :white_check_mark: Your eval job has completed with return code 0.
x=22
My new favorite thing
!e
example = "The number is {number}"
print(example)```
@shut hill :white_check_mark: Your eval job has completed with return code 0.
The number is {number}
@shut hill :white_check_mark: Your eval job has completed with return code 0.
The number is 5
coool
and how about urs?
which one do u prefer
The one i did?
what do u mean
!e
example = f"The number is {}"
print(example)```
@shut hill :x: Your eval job has completed with return code 1.
001 | File "<string>", line 2
002 | example = f"The number is {}"
003 | ^
004 | SyntaxError: f-string: empty expression not allowed
do u have to put stuff in it?
whats that
!e
example = "The number is {}"
print(example)```
@shut hill :white_check_mark: Your eval job has completed with return code 0.
The number is {}
@shut hill :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 2, in <module>
003 | TypeError: can only concatenate str (not "dict") to str
oop
example = "The number is {}".format(number)
!e
example = "The number is {}".format(number)
print(example)```
@shut hill :white_check_mark: Your eval job has completed with return code 0.
The number is 5
!e ```py
code goes here
```
oh ok...
my class is starting....
but imma mute my teacher π
okok lol
yea ok thank you.
thanks!
Waitttt
Can you guys gimme answers π
on my test lol
;-;
π
okok
lol
noo
im not cheating
im learning
!rule 8
8. Do not help with ongoing exams. When helping with homework, help people learn how to do the assignment without doing it for them.
help people learn how to do the assignment without doing it for them.
Oh ok.
No, im saying homework.
Of course test.
im saying homework...
okok
sounds good ill be back aftrer class maybe.
Bye!!
is it normal to do tests on paper... ;-;
Yes
In fact that's how things have been for decades
when doing interviews do they tell you to write code on paper too?
Long before COVID even happened.
You need to put forth your best effort first.
yea ofc
Only if you're super stuck
how would i make an input from a user and replace the vowels or any letter to something else?
have a look at the input and replace functions
okok
input function, replace method *
!e
my_string = "Hello World!"
print(my_string.replace("e", "a"))
@terse needle :white_check_mark: Your eval job has completed with return code 0.
Hallo World!
would this work?
word = input("Enter a word: ")
word = word.replace("a", "")
word = word.replace("e", "")
word = word.replace("i", "")
word = word.replace("o", "")
word = word.replace("u", "*")
print(word)
word = word.replace("a", "*")
word = word.replace("e", "*")
word = word.replace("i", "*")
word = word.replace("o", "*")
word = word.replace("u", "*")
print(word)```
also got to do uppercase
Apple -> Appl*

