#voice-chat-text-0
1 messages · Page 194 of 1
@elfin bone
ya what
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
T
@ebon mist how do you get video role
i dont have that
oh
@ebon mist you shouldnt name a variable _
name it something else, _ indicates that you are not gonna use it
i good name
im going insane guysssss
it is?
def falling_piece(picked_piece, displayed_board, x, y):
row_of_picked_piece = picked_piece[0]
coll_of_picked_piece = row_of_picked_piece[0]
n_row = len(picked_piece)
n_coll = len(row_of_picked_piece)
x_piece = 0
y_piece = 0
for a in range(n_row):
for b in range(n_coll):
displayed_board[x][y] = picked_piece[a][b]
y += b
x += a
def falling_piece(picked_piece, displayed_board, x, y):
n_row = len(picked_piece)
n_col = len(picked_piece[0])
for a in range(n_row):
for b in range(n_col):
if x + a < len(displayed_board) and y + b < len(displayed_board[0]):
displayed_board[x + a][y + b] = picked_piece[a][b]
Try this
Sorry
I am on ios
def falling_piece(picked_piece, displayed_board, x, y):
n_row = len(picked_piece)
n_col = len(picked_piece[0])
for a in range(n_row):
for b in range(n_col):
if x + a < len(displayed_board) and y + b < len(displayed_board[0]):
displayed_board[x + a][y + b] = picked_piece[a][b]
It’s a skill issue by me
I thought you were trying to print a group of 0 in a board form or something
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
And what are you doing here?
i think ive done figured it out
i needed to sort via the hashes
is there a way to get the active bot develoepr role legitly
post some code and ask a question
what are you working on guys?
check @whole bear 's problem in #1035199133436354600
def falling_piece(picked_piece, displayed_board, x, y):
s_y = y
row_of_picked_piece = picked_piece[0]
coll_of_picked_piece = row_of_picked_piece[0]
n_row = len(picked_piece)
n_coll = len(row_of_picked_piece)
x_piece = 0
y_piece = 0
for a in range(n_row):
for b in range(n_coll):
if picked_piece[a][b] == 1:
print(x,y)
displayed_board[x][y] = 1
else:
displayed_board[x][y] = 0
y += 1
y = s_y
x += 1
could someone help?
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
your request is against Discord ToS.
you should not receive help with it.
sorry.
!e ```py
def falling_piece(picked_piece, displayed_board, x, y):
s_x = x
s_y = y
n_row = len(picked_piece)
n_coll = len(picked_piece[0])
x_piece = 0
y_piece = 0
for a in range(n_row):
for b in range(n_coll):
if picked_piece[a][b] == 1:
print(s_x,s_y)
displayed_board[s_x][s_y] = 1
else:
displayed_board[s_x][s_y] = 0
s_y += 1
s_y = y
s_x += 1
board = [[0 for _ in range(10)] for _ in range(20)]
pick_piece = [[0, 1, 1],
[1, 1, 0]]
falling_piece(pick_piece, board, 1, 1)
for line in board:
print(line)```
@alpine crow :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1 2
002 | 1 3
003 | 2 1
004 | 2 2
005 | [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
006 | [0, 0, 1, 1, 0, 0, 0, 0, 0, 0]
007 | [0, 1, 1, 0, 0, 0, 0, 0, 0, 0]
008 | [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
009 | [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
010 | [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
011 | [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/EOQATLARPHURIDRDBAT4OXLBBQ
the joseph stalin code is fixed type Joseph and a question for the leader
( 0 0 0
1 1 1
222)
linear algebra
Mao Zedong: "I’m not afraid of nuclear war. There are 2.7 billion people in the world; it doesn’t matter if some are killed. China has a population of 600 million; even if half of them are killed, there are still 300 million people left.”
1964
Here is a translation of the transcript of the conversation between Capt. Francesco Schettino, commander of the grounded Costa Concordia, and Capt. Gregorio De Falco of the Italian coast guard in Livorno.
In the conversation, De Falco repeatedly orders Schettino to return to the ship to oversee the evacuation, while Schettino resists, making ex...
Dmytro
my real name
!tos
» tools
» off-topic-names
» microsoft-build-tools
SSH is the cryptographic network protocol that runs on port 22 and allows you to connect to the shell of a remote machine. On the other hand, SSH tunneling/port forwarding is a mechanism that creates a secure SSH connection between a local and remote computer. Because of its encrypted nature, you can use SHH tunneling to transmit messages that use unencrypted protocols such as IMAP, VNC, or IRC.```
Reverse SSH solves this issue by simulating an SSH to the remote server. In this case, the remote machine listens on the local computer’s network port. It relays SSH connection requests to that port back to itself, which establishes a new connection between the local and remote computers. In other words, you use a tunnel inside a tunnel to connect a server, remote machine and your machine (see Figure 1).```
I'm relatively bad at chess, as far as rating goes
Idc
Join the challenge or watch the game here.
and I still can't access chess.com
(chess.com is banned here for different reasons)
Some things in life are mysteries.
Ok
Karjakin and Ukraine
Is your room talking to you?
Sometime's it is an oven and sometimes it is antarctica
temperatures can be weird at times
around a month ago, here the most warm (as perceived) time of the day was midnight (for, like a week)
iirc, humidity influences that
Not going to school tomorrow so yeah
project, that I'm working on, just hit 10K lines of code
what is rust
I don't remember if any of my Python projects got even close to being that large
I had a 40k line html
one might've been
what do you want to use Python for?
For helping streamers
In what way?
How?
I checked, largest is no more than 8K lines
(this is text count, not cloc)
If that doesn't work I can get a real job
Oh, you mean offering yourself as a source of knowledge.
sure
Sorry, I was stuck on application development.
for general knowledge -- I don't know what the course of learning would be
requires extra research to figure out what is relevant nowadays
Ik str, variable, int
apart from general advice, like
"learn to read documentation"
"make things"
"revisit and retry what you already did before"
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
^ this has some links
You see I want start writing my own codes
And looking at codes my brain gets tired easily
I used mostly this when I was starting to learn Python
https://docs.python.org/3/tutorial/index.html
but this tutorial isn't interactive enough
it's more of an overview of the language
I mean you wanna create a project together?
That could teach me something
Sry I am being weird
I'm already busy with Rust work, and I generally don't collaborate on projects outside of some temporary occasions
if you start a GitHub repo, I can watch it for changes/issues, but I can't contribute to it regularly
Ok I understand
making projects is quite good at accelerating learning process
but "theoretical" part is very important too, IMO
there might be some books on general principles of how to program stuff,
but I tend not to recommend any specific ones as many of them are either questionable or non-beginner-friendly
There was a book in the resource command right?
these are Python-specific
https://www.pythondiscord.com/resources/?type=book
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
Yeah automate the boring stuff
it's outdated but still a good book, as far as I've heard
one possible way to approach this would be to try to replicate what's described in a book,
but in a way that's more idiomatic for newer versions of Python (if such change is appropriate)
there are some external packages mentioned in the book which have moved on with how their interfaces are implemented
and upgrading examples to newer versions may serve as a valuable experience
in part also because the reasons the things changed in the language/libraries are what you can learn
Ok I understand
I don't remember if the selenium was one of the things from the book, but, as an example:
the package used to have each browser engine have its options passed in as keyword argument
but in newer versions those are all collected into a single Options type
"why was that change made? what became easier to do? what became harder to do?" -- these and other questions is what you can explore
using PyCharm as an IDE might've helped too
who me?
i tried talikng did anyone hear me
yes
Yes
oh
specifically for it showing formatting errors
I don't know if it's possible to enable that in VSC
Python extensions which aren't included with ms-python.python by default
https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter
https://marketplace.visualstudio.com/items?itemName=ms-python.isort
(they might be "slightly" broken but when they work they're useful)
thank you so much
where did everyone go
ok
i'm trying to findout how many messages i sent so far
because its telling me to send atleast 50
a year i would say
your voice sounds very tired
@somber heath
im at school now i do have a micro but
i cant talk
Hello....I am new to here ... can anyone tell me ...what are we talking about
yo
@frozen echo youve entered a python server if u know what python is we are here to help each other and be better together
@calm burrow thanks man.. really appreciate your help
no prob how lomg u been working on python @frozen echo
@calm burrow .. I can't say working..I say I learn it.. in my college it start teaching about python ... So I here to make friends and help each other.. around python geek people 😁
lol i get u hey i work on tkinter (which is opening window and haveing things pop up) but may i ask what u know abt python
@frozen echo
@calm burrow I know about basics of all... And little bit of pygame library
so like print("hello world!")
@thin trellis 👋
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@calm burrow https://pip.pypa.io/en/stable/installation/
it says voicegate failed
@somber heath
so i cant speak with you for help
i have an assignment for python that i need help with
i was wondering if you are able to help if possible
yes it doe4s
i will send
elementary_school_quiz: This function has two parameters, namely an integer flag that takes only values 0 or 1 and
an integer n that takes only values 1 or 2. If flag is 0, elementary_school_quiz helps practice subtraction. But if
flag is 1, elementary_school_quiz helps practice exponentiation. The function, elementary_school_quiz then
generates n math problems that a pupil must answer in turn. For each question, it generates two random positive,
single-digit numbers (check out python’s random module to see if there’s a useful function in there) and asks the
pupil for the answer to the math problem with those two numbers (either subtract the second number from the first,
or raise the first number to the power of the second number). elementary_school_quiz then prompts the pupil for
the answer, and checks if her answer is correct. At the end of n questions, elementary_school_quiz returns the
number of questions answered correctly.
high_school_quiz: This function has three parameters representing three real numbers for the coefficients of the quadratic
equation ax2 +bx+c = 0. The function displays/prints the equation frist and then prints its solutions. The function
must display correct and meaningful solutions given any three real numbers for coefficients a, b and c. See examples
in Section 3 to understand what that means. Please consider the examples to be a part of the function/program
specifications that must be followed.
Note that to solve this problem, you do not need to use Python’s complex numbers.
i already finished the elementary_school_quiz: i just need help on the high_school_quiz:
really streesed out about it its due tommorow at 8:00 AM
section 3 is the examples i can send
it is currently 1:37 am for me
you want me to send it?
''''def elementary_school_quiz(flag, n):
# Your code for elementary_school_quiz function goes here (instead of keyword pass)
# Your code should include dosctrings and the body of the function
#
# Preconditions: flag is 0 or 1, n is 1 or 2
if n==0:
return 0
right_answer=0
n1=random.randint(0,9)
n2=random.randint(0,9)
if flag==0:
answer=n2-n1
operator="-"
elif flag==1:
answer=n2**n1
operator="^"
print("Question 1: ")
pupil_answer=int(input("What is the result of"+" "+(str(n2)+ operator+(str(n1))+"?"+" ")))
if pupil_answer==answer:
right_answer +=1
if n==2:
n1=random.randint(0,9)
n2=random.randint(0,9)
if flag==0:
answer=n2-n1
operator="-"
elif flag==1:
answer=n2**n1
operator="^"
print("Question 2: ")
pupil_answer=int(input("What is the result of"+" "+(str(n2)+ operator+(str(n1))+"?"+" ")))
if pupil_answer==answer:
right_answer +=1
return right_answer'''
there
!code
@white shale 👋
Hello @white shale
im not sure how to do so
i pressed on the python bot to pastebin
is that it
oh okay so i should use backtiks
okay
# Your code for elementary_school_quiz function goes here (instead of keyword pass)
# Your code should include dosctrings and the body of the function
#
# Preconditions: flag is 0 or 1, n is 1 or 2
if n==0:
return 0
right_answer=0
n1=random.randint(0,9)
n2=random.randint(0,9)
if flag==0:
answer=n2-n1
operator="-"
elif flag==1:
answer=n2**n1
operator="^"
print("Question 1: ")
pupil_answer=int(input("What is the result of"+" "+(str(n2)+ operator+(str(n1))+"?"+" ")))
if pupil_answer==answer:
right_answer +=1
if n==2:
n1=random.randint(0,9)
n2=random.randint(0,9)
if flag==0:
answer=n2-n1
operator="-"
elif flag==1:
answer=n2**n1
operator="^"
print("Question 2: ")
pupil_answer=int(input("What is the result of"+" "+(str(n2)+ operator+(str(n1))+"?"+" ")))
if pupil_answer==answer:
right_answer +=1
return right_answer```
''''.py def elementary_school_quiz(flag, n):
# Your code for elementary_school_quiz function goes here (instead of keyword pass)
# Your code should include dosctrings and the body of the function
#
# Preconditions: flag is 0 or 1, n is 1 or 2
if n==0:
return 0
right_answer=0
n1=random.randint(0,9)
n2=random.randint(0,9)
if flag==0:
answer=n2-n1
operator="-"
elif flag==1:
answer=n2**n1
operator="^"
print("Question 1: ")
pupil_answer=int(input("What is the result of"+" "+(str(n2)+ operator+(str(n1))+"?"+" ")))
if pupil_answer==answer:
right_answer +=1
if n==2:
n1=random.randint(0,9)
n2=random.randint(0,9)
if flag==0:
answer=n2-n1
operator="-"
elif flag==1:
answer=n2**n1
operator="^"
print("Question 2: ")
pupil_answer=int(input("What is the result of"+" "+(str(n2)+ operator+(str(n1))+"?"+" ")))
if pupil_answer==answer:
right_answer +=1
return right_answer'''
''''.py def elementary_school_quiz(flag, n):
# Your code for elementary_school_quiz function goes here (instead of keyword pass)
# Your code should include dosctrings and the body of the function
#
# Preconditions: flag is 0 or 1, n is 1 or 2
if n==0:
return 0
right_answer=0
n1=random.randint(0,9)
n2=random.randint(0,9)
if flag==0:
answer=n2-n1
operator="-"
elif flag==1:
answer=n2**n1
operator="^"
print("Question 1: ")
pupil_answer=int(input("What is the result of"+" "+(str(n2)+ operator+(str(n1))+"?"+" ")))
if pupil_answer==answer:
right_answer +=1
if n==2:
n1=random.randint(0,9)
n2=random.randint(0,9)
if flag==0:
answer=n2-n1
operator="-"
elif flag==1:
answer=n2**n1
operator="^"
print("Question 2: ")
pupil_answer=int(input("What is the result of"+" "+(str(n2)+ operator+(str(n1))+"?"+" ")))
if pupil_answer==answer:
right_answer +=1
return right_answer'''
like thta?
that?
i cant
use f strings
im not allowed
@somber heath
im not allowed to use f strings or loops
i dont know he kinda bailed out
@somber heath In descending order of importance (subjective):
Software Design by Example https://gvwilson.github.io/sdxpy/
Python Design Patterns https://python-patterns.guide/
The Architecture of Open Source Applications Vol I + Vol II + 500 Lines or Less https://aosabook.org/en/
Web Browser Engineering https://browser.engineering/
Obey the Testing Goat! https://www.obeythetestinggoat.com/pages/book.html
Software Design by Example https://third-bit.com/sdxjs/
The Fuzzing Book: Tools and Techniques for Generating Software Tests https://www.fuzzingbook.org/
https://www.cosmicpython.com/book/preface.html
Goodnight @somber heath catch u later!
@rotund dragon 👋
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
!e py variable
@somber heath :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | variable
004 | NameError: name 'variable' is not defined. Did you mean: 'callable'?
!e py variable = ... variable
@somber heath :warning: Your 3.11 eval job has completed with return code 0.
[No output]
@gentle flint sorry my discord has a seizure
Exclusive kits, consoles, controllers, ... Find the Recalbox selection of products dedicated to emulation and retro-gaming, available only on Kubii!
Oh, no.
hello theree
overly cursed
what is wrong with it? genuinely asking
SD turned into eMMC for the rest of its, likely short, life
with e meaning only embedded and no benefits of that
have a good day ahead! must get going
restart the plastic box, new ports might appear
That'd be magical
Hi all, why am I muted?
tap it gently with a magical wand
@lethal rivet 👋
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
"open ports"
"sorry the sesame was finished"
The one I have
got it, thanks
Anyone going to pycon recently
My crow ewes bee.
Interested to do so, but sadly no
"active cooling? I'm gonna go deaf from noise"
It's pretty quiet, actually
Gtg
I'm okay sleeping with the amount of noise my PC produces, so that's not really an issue for me
but I try to keep my home server quiet
with no moving parts
rpi is ARM, right?
Gm yall
at worst it was 95 degrees
but that was 1) summer 2) closed window 3) 100% CPU use
CPython works on ARM well enough
and many other languages do too
it throttles at around 105
rpi throttles at 80
this is Celeron
2017 CPU
also, slightly more doubled letters
Fucking christ this day that's what I get for orocrastination
@ebon mist
nethack
Procrastination
didn't know nethack supported all these
what that??
game
will likely run on rpi
(it works)
time to game (all parameters auto-picked)
this game truly is an interactive manual page
bundled code likely, i.e. "unintentionally" obfuscated
though, if you had the code, would it really be readable enough to understand?
bun?
there were some earlier alternatives, around when node.js appeared
so, we have C++ runtime of JS, Rust runtime of JS and Zig runtime of JS
Rust has proc-matro attributes instead of decorators
Damn it, forgot they have limited Windows support
That's why I wasn't playing with it yet
bun?
Yeah
but
does it have
Solaris support?
put bun into docker
put docker into LX-branded zone
put the zone into illumos
I understood none of what you just said, AF, but it scares me still
LX-branded zones are techonology used by illumos (Solaris) to run Linux containers
this existed before Docker, iirc
basic Gitea setup is a monolith
it's literally one big executable
"you just chmod +x gitea and ./gitea and it works"
well, almost
proper Gitea setup would actually be around 3~5 services, I think?
database and cache at least
that's +2
Right
then +1 for Gitea Actions
and +1 if you're insane enough to render Jupyter notebooks
don't stuff Jupyter into the same container, it will pain
official docs for integrating Jupyter are not production-ready
pay per empty lines
HELP
def game_loop():
x = 0
y = 4
picked_piece = []
is_falling_piece = False
m_piece = False
update_displayed_board()
if m_piece != True:
picked_piece = pick_piece(pieces_list)
m_piece = True
is_falling_piece = True
if is_falling_piece:
falling_piece(picked_piece, displayed_board, x, y)
if x != 19:
x += 1
is_falling_piece = True
m_piece = True
else:
is_falling_piece = False
m_piece = False
draw_grid()
pygame.display.flip()
Pay per line, and then they just minify it and it's all on one line
if people don't game the metric, it actually tracks progress quite well,
because it correlates to code improvement (due to both refactoring and feature addition)
unless code improvement is just cutting code
which it often is
@whole bear Suuuuuuup
missing global?
x = 0
y = 4
picked_piece = []
is_falling_piece = False
m_piece = False
def game_loop():
global x, y, picked_piece, is_falling_piecce, m_piece
update_displayed_board()
if m_piece != True:
picked_piece = pick_piece(pieces_list)
m_piece = True
is_falling_piece = True
if is_falling_piece:
falling_piece(picked_piece, displayed_board, x, y)
if x != 19:
x += 1
is_falling_piece = True
m_piece = True
else:
is_falling_piece = False
m_piece = False
draw_grid()
pygame.display.flip()
but a class would be better
@ebon mist declare outside of the function
if you want to change it
suggesting to disable unused lint is so evil lmao
!epy for\ i\ in\ range\ ( 5)\ : print(i)Pay me per line. I am great developer.
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
inside a function, deleting is okay;
if a variable represents some state that might be useful later in development,
refactor the state into a class that holds that variable as a field
!e
# I wonder if this parses
for\
i\
in\
range\
(
5
)\
:
print\
(
i
)```
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
Oh, bugger, I forgot to draw out the print, didn't I?
also 5) is a line lost
I am humbled and unworthy!
!e
for \
i \
in \
range\
( #
5 #
) \
: #
print\
( #
i #
) #
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
Nice.
still can't inverse indentation because python
print needs to be to the right of for
x is Falseis more idiomatic- if you're checking for falsyness, use
not x
if blah == True:
# can be written as
if blah:
# likewise
if blah == False:
# can be
if not blah:
PEP 8 is the official style guide for Python. It includes comprehensive guidelines for code formatting, variable naming, and making your code easy to read. Professional Python developers are usually required to follow the guidelines, and will often use code-linters like flake8 to verify that the code they're writing complies with the style guide.
More information:
• PEP 8 document
• Our PEP 8 song! :notes:
!e py a = [] b = [] c = a print(a == b) print(a is b) print(a is c)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | True
002 | False
003 | True
True/False, just like None, have only one instance per value
https://docs.python.org/3/c-api/bool.html
is True and is False is to check whether the object is exactly True or exactly False
just stuff everything into a class
stop using functions when you're dealing with state
to avoid globals everywhere
I know TLA+ exists, but haven't looked into what it actually does
why is this opening a popup
@scarlet torrent 👋
I sometimes forget popups exist in browsers
@thorn cedar 👋
hisss
if you don't want to structurize:
!e
class State:
pass
state = State()
state.x = 0
def f():
state.x += 1
print(state.x)
f()
f()
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1
002 | 2
TLA+
the proper spelling is with + lifted
but fonts usually don't allow that so TLA+ is okay
both the site and wikipedia have it with special formatting
or, no
TIL about TLA
wikipedia has TLA⁺ in title
Russian Wikipedia
not English
why
here it's ⁺ even in URL
https://ru.wikipedia.org/wiki/TLA⁺
It's used to verify that programs work the way they should.
It's a model checker, meaning you define a model, a system of checks and balances (many invariants).
And then the model checker tries to find cracks in your assumptions, it searches through a lot of possible inputs and identifies states where your program's invariants are violated, aka bugs.
Software that has a model and TLA+ doesn't find such a state is called "verified software".
It increases the confidence that your code works correctly beyond what software testing can.
This is my current understanding of what it does.
I hate my brain. Read it as refactoring.uwu
lol'
ooO
slightly "done" project
TLA+ is not easy
and from what I've seen requires learning Temporal Logic and some other types of logics
Rust has its own approach to invariants/memory correctness/etc.
mostly assisted by types
one of the examples of invariants as types
https://doc.rust-lang.org/stable/std/num/struct.NonZeroUsize.html
An integer that is known not to equal zero.
I am curious how do you idiomatically represent states in rust
do you use the enums?
yes
Rust has like asserts and whatnot built into the language.
But a Model Checker is something else. There are model checkers written in Rust too, you don't have to use TLA+
(but TLA+is the most advanced of all)
https://github.com/stateright/stateright
https://github.com/model-checking/kani
units structs are sometimes useful too
with like Password<Locked>, Password<Unlocked>
what are they otherwise generally used for
@vague saddle 👋
bc idrk any use yet lol
strongly typed languages won't eliminate bugs
// Instantiate a unit struct
let _unit = Unit;
// Instantiate a tuple struct
let pair = Pair(1, 0.1);
// Access the fields of a tuple struct
println!("pair contains {:?} and {:?}", pair.0, pair.1);
// Destructure a tuple struct
let Pair(integer, decimal) = pair;
println!("pair contains {:?} and {:?}", integer, decimal);
the example in the book doesnt even show the usage lol
instead of sending () into a queue
another use is no-data Error type
because Result<T, ()> is unidiomatic
oh yeah
@eager estuary @toxic niche 👋
hy
#[derive(Debug)]
struct Error;
type Result<T, E = Error> = std::result::Result<T, E>;
c++ >>
my fellow programmer
whats new?
Average performance increase of 5% as well
something something GIL in C APIs
thats nice
altough i dont see it as a big advantage
@somber heath 👋
because of the fact that python is an interpreter language
so its purpose is not to be fast
but easy to code and
it looks good the ordered list looks a bit off center to me but I think its just bc of the number idk it might just be my preferences
The ordered list takes into account the number as well but i could move it over if need
Python has tricks up its sleeves for speed, including the power of friendship and cooperation.
I can't load the image in higher quality
some of the solutions to this use unit structs too
https://parrrate.github.io/exercises/
fast relative to what 😉
some stuff made/collected by me, rarely updated
Moss. Argument.
well, Python is compiled too
not too machine code but still
idk if there's a proper term for that
AAß12
statically linked is a subset of what's commonly viewed as fast languages
AA-12
@dry jasper so if your CLI program at work is accessing the remote MySQL database, you can set up SSL authentication such that only those users that have an SSL certificate on their machines can authenticate to the database. all the traffic between your program and the database will be encrypted.
https://dev.mysql.com/doc/refman/8.0/en/using-encrypted-connections.html
Recoil or reek oil? You decide!
@lavish rover Hey buuuuuuuuuuuudddddddddddy
hello fren
How's it going
pain
What's breaking?
I can't begin to explain the bullshit
F
well, at least it was React
I started with Angular
with those 8 minute compile times
lol
How
I have only one website running that's written by me
and it's pure JS (because it's smaller and there's no real need for a framework)
this
I think it doesn't really cache much for release build
or didn't
that was in 2020/2021
on Celeron
idk if Angular became faster in newer versions
God you'd hope so
for dev builds it's quite okay
Tracks
oh give me a home, where the elite never roam, and i have peace and quite all day
That means I wouldn't have it aliased to bun right?
I'd have to do that some other way?
log into the container
docker exec -it <name> bash
docker run -it --rm oven/bun bash
it actually just runs bun itself, so you can bind a volume into it
<form action="#">
<table>
<tr>
<td class="tdLabel"><label for="register_name" class="label">Enter name:</label></td>
<td><input type="text" name="name" value="" id="register_name" style="width:160px"/></td>
</tr>
<tr>
<td class="tdLabel"><label for="register_password" class="label">Enter password:</label></td>
<td><input type="password" name="password" id="register_password" style="width:160px"/></td>
</tr>
<tr>
<td class="tdLabel"><label for="register_email" class="label">Enter Email:</label></td>
<td
<input type="email" name="email" value="" id="register_email" style="width:160px"/></td>
</tr>
<tr>
<td class="tdLabel"><label for="register_gender" class="label">Enter Gender:</label></td>
<td>
<input type="radio" name="gender" id="register_gendermale" value="male"/>
<label for="register_gendermale">male</label>
<input type="radio" name="gender" id="register_genderfemale" value="female"/>
<label for="register_genderfemale">female</label>
</td>
</tr>
<tr>
<td class="tdLabel"><label for="register_country" class="label">Select Country:</label></td>
<td><select name="country" id="register_country" style="width:160px">
<option value="india">india</option>
<option value="pakistan">pakistan</option>
<option value="africa">africa</option>
<option value="china">china</option>
<option value="other">other</option>
</select>
</td>
</tr>
<tr>
<td colspan="2"><div align="right"><input type="submit" id="register_0" value="register"/>
</div></td>
</tr>
</table>
</form>
How to css this?
people seem to really like bun ,idk what it does
yeah, that; site I found it on is blocked here for some reason
linear extrapolation
I don't what it is
I think this person is delusional
Same
it's a just joke, I hope
According to the 3.12 "what's new", the average performance increase was 5%
So not too shabby
But not approaching C++
also generally when you start optimizing, you get decent gains because you trash crud
"how not to use linear extrapolation"
but it's low hanging fruit
source of the image might even be from somewhere else
Set-Alias -Name "bun" -Value "docker run --rm --init --ulimit memlock=-1:-1 oven/bun"
"use dev containers"
The Set-Alias cmdlet creates or changes an alias for a cmdlet or a command, such as a function, script, file, or other executable. An alias is an alternate name that refers to a cmdlet or command. For example, sal is the alias for the Set-Alias cmdlet. For more information, see about_Aliases. A cmdlet can have multiple aliases, but an alias can ...
it would still not be a proper alias
because arguments to bun won't be provided properly
oh mah gah
yeah, alias will work but it won't do correct things
docker run --rm --init --ulimit memlock=-1:-1 oven/bun argument
will run argument in the container instead of bun argument
docker run --rm --init --ulimit memlock=-1:-1 oven/bun
docker run --rm --init --ulimit memlock=-1:-1 oven/bun
this will run the correct command but will fail to find the file
docker run --rm --init --ulimit memlock=-1:-1 oven/bun bun <file>
something like this to make it see the current directory
docker run -v $PWD:/home/bun/app:ro --rm --init oven/bun bun <file>
def ham(*args):
This is god awful behavior from python, I know all languages support it but it makes life hell
there's also Lua with its ... which is more cursed
idk what equivalent of $PWD would be for Windows
*args and **kwargs are okay-ish for decorators
but analysers still struggle
or generally stuffing all the input into something else
if it's not automated via something like decorator, better use a class with parameters, I guess?
like how selenium introduced Options
yeah, but might as well just pass in the Movie instead (in the example)
so, like, it's more for typing what's already in variadic format, I'd expect
wait, why are examples with double-space indentation
oh, they did asyncio improvements again
has had a number of performance improvements, with some benchmarks showing a 75% speed up.
and 3.11 added timeouts/taskgroups
Remove the distutils package
rip
wait, what was imp module
importlib precursor, ig
"Weird Al" Yankovic Constipated lyrics. Parody of Complicated by Avril Lavigne. Video made by Windows Movie Maker.
Please solution my problem
where from and what to are you copying what?
I am trying to install Ubuntu in my Dell laptop
what are you installing it from? USB? CD? DVD? SD?
Micro SD card
Have you heard of Rufus ? https://rufus.ie/en/
Rufus: Create bootable USB drives the easy way
I had use to make my usb bootable
or even better.. Ventoy
https://www.ventoy.net/en/download.html
Ventoy is an open source tool to create bootable USB drive for ISO files. With ventoy, you don't need to format the disk again and again, you just need to copy the iso file to the USB drive and boot it.
1.6 year old ssd
@wise loom
It is not a problem to make bootable USB
Problem is pop up when installing it in system
Perform some health checks on your SSD, smartctl can do it.
If your storage is broken, buy a new one and replace it (find instructions on https://www.ifixit.com/ in order to learn how to replace it).
It's unclear whether your bootable USB or your SSD is the problem.
Please clarify. Or perfom some checks and come back with more information.
I've provided plenty of information on how to address this above.
Hi guys, im a italina boy and i want lear python from zero , its possible here? ( my english is bad sorry)
italian*
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
yes
@wise loom
I Have bootup this laptop with debian 12 before it
But when I am trying to install mint Linux or Ubuntu Linux then it show me this error but in case of windows and Garuda Linux it works perfectly
losing sanity trying to reformat old python code
from __annotations__ import future
I've made this mistake at least thrice in the last 10 minutes
Recover your data and do a backup using Debian Live or GpartED Live (use an external disk to store it).
Wipe out your entire SSD disk and reinstall Ubuntu.
The Ubuntu installer allows you to make this choice of wiping out the entire SSD.
I backuped my data and formatted entire disk
But after all these stuffs it show same error
Now my entire disk cleanup and I have not any os in my system
The installer is telling you that either your bootable USB or your SSD has physical defects.
This means one of those two devices is no longer reliable and must be replaced.
The next natural step is to find out which of the two has physical defects and replace it.
If I try to install windows with same config then it doesn't give any kind of error
If some physical error os there the it doesn't allow to install windows
And I had tried to install Ubuntu in my friends system them it give me same error
I have tried this on 3 to 4 laptops
With different usb pendrives
If it is physical drive problem then all that pc are dameged ?
But they are working fine
Have you checked how dusty/dirty your USB port actually is?
You may use some qtips or some type of alcohol-based stick to clean it.
All other things like writing read data mirroring phone display in pc mouse supported keyboard supported are working good but when I install Ubuntu then it becomes dirty 😀
Take a pic of your USB port, I'm really curious how it looks like
Make sure you have good lighting
Also, if that USB port is fried, have you tried a different port instead?
this is your USB stick, I was asking for the port
the actual place where you insert it
Ohh
I Did it Finally i Voice Verified
very strong signs of usage, almost looks like someone rammed and jammed things into it, it's also a bit dirty
you better get some qtips/toothpicks and alcohol and start cleaning it
make sure it's powered off when you do that
Outer surface is covered by lamination layout which is contained by scratch that why it looking dirty on out side
But you are saying then I will clean this and after that I will try
Thanks
hello
hello
@scarlet torrent any news?
I will do this tomorrow because it's night and I don't have alcohol yet
i used to actually use this
WHO CAN WORK WITH OPENCV ?
but what is your question
you're already receiving assistance regarding this.
pleas answer my questions in the thread.
@fervent grail let's move back here since the original issue was handled
what's your experience with Python
A lot
have you studied computer vision?
do you like compitative programming?
I do but not finished yet
do you feel you have a good grasp of OpenCV's API and what its capabilities are?
Yes, i do
@fervent grail have you ever used cv2.matchTemplate ?
Nah
is it what you need?
u have a hard time understanding my accent right??xD @wise loom
I'm glad you agree. I am of the same opinion.
Thank you very much @wise loom
You're welcome @fervent grail
@toxic meadow #pedagogy message
But, What you can do with python like, Can you work with pytorch ?
I believe you can. I've never used pytorch tho.
May I have a recommendation on what to download to start learning python?
How about tensorflow?
These are intermmediate-advanced books #pedagogy message
Thank you
Sure, you can use Tensorflow as well.
I mean, Can you work with it ?
Can I personally work with it? No, I have not used it.
K
codechef
What are you doing with python like, Web scraping or something else ? @wise loom
I mean why you working with python and what you love at python ?
You can do web scraping with Python, and many other things.
It's a general purpose language with a very large eco-system of libraries and modules.
have u tried any ml modules in pyth?
Oh I have some small posts written on my blog about Python and what I do with it (you can find the link in my profile).
I'll refer you to those.
So far no. Maybe in the future.
What is the most unique usage of python you have seen?
its hard T_T
Is that webpage made of you ?
u know i dont really like the front end development although i like dsa and compprog so any suggestions for me i couldnt find anything to learn all projects i could find are based on development and UI stuff
u can tell me on vc
Too many examples. Everything from controlling robots, breaking captchas, computing optimal shapes of payloads dropped from aircraft, physics simulations, chemistry simulations, financial optimization, symbolic mathematics, graphics.. a lot a lot of things.
Yes.
Do you use python to make it ?
I write it in a type of markup language and Hugo renders it whenever I push to a repo.
K
Also can you send your website's repo link
What type of skillsets should I develop to help with how I learn python?
Allow me to rephrase that
Which skillsets do you find to be the most useful for it?
Do you have job as a programmer ? @wise loom
Yes, I work as a devops currently.
Why do you ask?
Then i can ask a question about getting job
Are you recommend to learn AI engineering ?
Or what you recommend to learn ?
If you've learned an entire programming language doesn't that already give you lots of job opportunities?
It's all the rage right now, very popular and well-paid
I suppose that's one part of the preparation. Pick up a book about interviews. Gayle Laakmaan has a good one I heard.
Thank you for your time
!kindling @toxic meadow
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.
if you need to pick a project to do
@toxic meadow #pedagogy message
list of lists
(I've attempted almost nothing from that list)
you can apply regular software engineering standards to competitive programming tasks
but the field itself doesn't force you to
like testing for example
knowing how to test and how to isolate defects is very important
competitive programming is also very algorithms-centred
even within that competitive niche, moving towards datastructure-centred approach may increase how much you learn
any suggestions how i can improve my communication skills its not like i dont know english but i get really nervous speaking (in text i have no problem) i have confidence issues i think
im trying out those the algos and structures
unless speaking causes actual harm to you, "just practice" would be the main advice
where TwT
!e
import tkinter as tk
from tkinter import messagebox
def win():
while True:
root = tk.Tk()
root.withdraw()
root.attributes('-topmost', True)
massage.showerror("{,שתוק")
root.destroy()
win()
@robust swift :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | import tkinter as tk
004 | File "/lang/python/default/lib/python3.11/tkinter/__init__.py", line 38, in <module>
005 | import _tkinter # If this fails your Python may not be configured for Tk
006 | ^^^^^^^^^^^^^^^
007 | ImportError: libtk8.6.so: cannot open shared object file: No such file or directory
שתוק
חחחחחחחחח
אני לומד תכנות כמעט שנה
!rule 4
4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.
sorry
Please only English on the server. It's hard to moderate other languages
הוא שקרן אני איתו בשיחה
מי אתה
אני מתכנת הוא הרגע לקח לי את הקוד
lets talk in the dms
איזה קוד
I mentioned in an earlier video that programming a Tetris clone is a good way to get going with programming as it makes you think about algorithms. Putting my money where my mouth is, I went ahead and did just that.
GitHub: https://github.com/OneLoneCoder/Javidx9/blob/master/SimplyCode/OneLoneCoder_Tetris.cpp
Blog: ...
this prolly will help u out
its not in python but this guy has hella good explanations
ya
criminal
hi
@valid sonnet 👋
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
says you dont have perm to speak in that channel
oh
!voice
nbm
nvm
how are you opa
cant hear you😂
wot did you said
Disconnect, reconnect.
owkie
It takes joining the voice channel with the role to unmute.
GUYS I NEED HELP
so i will race in soming that the winer will get 40k$ so i want to win the age is from 13 to 18 and im 13 so i wat to make a cool web so i win sooooo how do i make a web by using javescript html and python and I NEED HELP I HAVE ONLY 3 MOUTH
hi
That's two more mouths than a regular person has, so what are you worried for?
#web-development is not my wheelhouse. That said, there are a few things you may wish to investigate, in addition to anything else you come across: Django, Flask and FastAPI.
The elif needs to align with the if.
Same with the else.
@whole sparrow Yo
Bro, I have to send 50 messages here to talk in voice chat? And be active x amount of time. That's cool, but to send 50 messages? I was just trying to talk to someone. Anyone able to help me out or just get through it?
What does it mean to be active within a 10 minutes block? Like be active 8:01, 8:11, and 8:21?
You can take it as meaning, roughly, 50 messages and don't spam it.
Don't stress over it. Just engage naturally and you'll be groovy.
It's a regrettable system, but, alas, one that became necessary.
Three 10 minute blocks simply means at the very least a half hour conversation
But that can be spread over a larger period of time
No problem. I was looking to hop in a call and see if anyone would be willing to give some advice on a challenge I have gotten myself put into with one of my projects.
Is there another place here I could ask that in chat? I'm not great at using discord so I'm not comfortable making like a "Forum" post if that is how it's set up here.
I understand there is code-help-voice-text, but I am not a part of the cool kids just yet.
there are topical channels, if your project/question fits into any of those
I'm essentially trying to figure out how to parse data from a 280k entry json/CSV. Eh I don't want to talk about it too much and clog it up here.
280k lines, right?
#data-science-and-ml is usually where CSV/data discussion happens
simple way to parse something is csv module
more advanced option is pandas
!d csv
Source code: Lib/csv.py
The so-called CSV (Comma Separated Values) format is the most common import and export format for spreadsheets and databases. CSV format was used for many years prior to attempts to describe the format in a standardized way in RFC 4180. The lack of a well-defined standard means that subtle differences often exist in the data produced and consumed by different applications. These differences can make it annoying to process CSV files from multiple sources. Still, while the delimiters and quoting characters vary, the overall format is similar enough that it is possible to write a single module which can efficiently manipulate such data, hiding the details of reading and writing the data from the programmer.
!d pandas
Okay, is there any other place? To further explain the scope, the purpose will be for JavaScript to determine if the browser version is within range of a CVE. I am doing a server side vulnerability detection project.
this would like require parsing the file and then putting it into a database
for easier querying
do you have enough RAM to load the entire file?
Okay, pandas is interesting.
I believe I may try to cut down the list of CVEs into only ones that mention browsers, that way it will be easier for HS to sort through it in the browser. I am not planning to transmit the data of the browser version that's why I'd like JS to determine if the environment is contained in the description of a CVE using RE.
The purpose could be to kick vulnerable clients off of my wifi network by putting this code on a captive portal. (Splash page)
I can load the whole file, yes.
^I figured rather than a database (requiring a packet to be sent containing user information) JS in the browser can compare it's variable to the contents in a file. That's where it gets tough though, if I were planning on just using python and a database then it would be more simple for me.
though it might be easier to pre-generate results for every version possible
(* every version known so far)
I wrote a thread in
#1158766992434679888 message
If anyone wants to read about shell commands 🙂
I figured, I could take the two variables of the browser, such as "browser flavor such as Firefox or Chrome", and "version number"
Then using regular expressions compare those results and see if the version of the browser falls within the range they list in the descriptions. An example is like Firefox 99.0 <, safari 109.7 <
The csv I grabbed was off the mitre CVE website. I just don't need the 280k results either. I would first need to parse down the results to only results that have browser flavors in the description.
This challenge has came last minute, as this challenge is the finishing piece to share some interesting information about the privacy of wireless networks. I am trying to do it this complicated way with the database to rather than showing straight exploitation to show how the server can detect vulns in a safe manner to the clients. This means not transmitting the data. Keeps it CFAA friendly if I am to share a presentation about it and that is the goal to keep ethics the focus.
Maybe I can show you. I've played around with it a bit already. Give me a moment.
At the moment I have something set up that will give me output similar to this:
Given the clients version (browser/version) they may be suspectable to # CVEs:
CVE-6942023 - Description: browser/version susceptible to buffer overflow.......
CVE.......
Which then can be used as a trigger to kick them off of the network.
This information is collected and there are many events that trigger when a client first joins the network. A lot is going on and this is just the last little part that needs added to complete the whole. I was just looking to hopefully talk to someone and seek advice on my challenge. I usually don't seek advice but I would like to for this ':)
how many different browser versions do you expect to receive from clients?
if you have enough memory, you can pre-generate results
I plan on at least a few basic common ones, to show the PoC in the proper light.
Chrome, Firefox, Safari
Maybe Opera, Maybe Edge?
I mean number of versions per browser
I plan on using the "Ranges" described in the descriptions. There they will mention the last known version to be affected usually followed by a < sign to show and versions earlier.
only <, right? (i.e. introduction date is ignored)
So if I can find the keyword for the browser which is in the description too, like Firefox, then I can check each entry that is returned by seeing if my current version number is that version or before.
if the main filter is <version, then you can sort all CVEs by what version they were resolved in
Here is a representation of the dataset I have.
Elysian
I don't speak that frenchy french moon language
I'm hopping on my Linux box to try to pull some extra info.
moon runes :D
there is this without n
https://github.com/elysiajs/elysia
express is built on top of node