#voice-chat-text-0
1 messages Β· Page 340 of 1
File Type: DLL
Image has the following dependencies:
api-ms-win-core-synch-l1-2-0.dll
kernel32.dll
ntdll.dll
python311.dll
VCRUNTIME140.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
also VCRUNTIME140_1.dll is there
whatever that is
hmm
they're depending on different python dlls
wait is there like a pip but for this stuff?
but that might be because of the feature
what does Cargo.toml section for pyo3 currenlty look like?
in tz_rust
[package]
name = "tz_rust"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "tz_rust"
crate-type = ["cdylib", "rlib"]
[dependencies.pyo3]
version = "0.22.2"
features = ["extension-module", "auto-initialize", "abi"]
# [tool.maturin]
# python-source = "python"
[profile.release]
debug = true
it looks different from this
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed while importing tz_rust: The specified module could not be found.
like where?
like check if they exist on my computer?
the same way you found these
ah
okay so need to check the path then
shit
$env:PATH should contain that LLVM directory
i really dont want to do anything with path tbh, im so scared of wiping everyshit
C:\Program Files\LLVM\bin
do you think its bc of my file structure
here
unlikely
there's a random suggestion on stackoverflow, but sounds a bit suspicious too
pip install msvc-runtime
well do i have to start over for maturin
like init doesnt really quite work?
damn, trace seems to be the default here
like a fuckton of messages
can you comment out as much as possible leaving basically just an empty Python module export?
with python -v
>>> import tz_rust
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 676, in _load_unlocked
File "<frozen importlib._bootstrap>", line 573, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 1233, in create_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
ImportError: DLL load failed while importing tz_rust: The specified module could not be found.
? but that would mean that my rust build would fail?
like tz_rust needs deps
if empty builds, then at least it's not some more broad issue
in same project
just comment out dependencies and modules
except for pyo3
yeah, comment out the code too
@frozen owl in lib.rs itself
no need to comment inside nested
what else is there in Cargo.toml?
all that's left
[package]
name = "tz_rust"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "tz_rust"
crate-type = ["cdylib", "rlib"]
[dependencies.pyo3]
version = "0.22.2"
# features = ["extension-module", "auto-initialize", "abi"]
# [tool.maturin]
# python-source = "python"
[profile.release]
debug = true
so something like is wrong with venv
like now the traceback is just
>>> import tz_rust
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed while importing tz_rust: The specified module could not be found.
i think so?
like i told you, for this project i just did maturin develop
like no init
is there a way to restart
remake the venv, without system packages enabled
ye venv is a lil messed up
(and try building the emptied project again)
maturin develop?
no init?
β οΈ Warning: Couldn't find the symbol PyInit_tz_rust in the native library. Python will fail to import this module. If you're using pyo3, check that #[pymodule] uses tz_rust as module name
π¦
it still shows the warning?
idk what else could be broken there
pls can you help me test the code, ive sent you the files alr
trying
[build-system]
requires = ["maturin>=1.7,<2.0"]
build-backend = "maturin"
[project]
name = "tz_rust"
requires-python = ">=3.8"
dynamic = ["version"]
[tool.maturin]
features = ["pyo3/extension-module"]
remove everything venv-related
hm?
also from the . venv run
./Scripts
./lib
./include
and whatever else
oh it's different lib
hmm
can you show what subdirectories lib has, again?
remove site-packages
then
./pyvenv.cfg
delete that one too
now create the venv again
pip install maturin
inside venv
but i didnt need to?
still no
i tried to install inside venv
and then rebuilt
still no
given that it worked for you on the same machine but for a different project shows that's something project-specific is happening
I ran that on Linux
you should try running the thing in that test project
should be src
@frozen owl cargo.toml
you're not building --release
@frozen owl as in that's why that section doesn't matter
just copy the other cargo.toml into there
and pyproject.toml
classifiers is just tags for searching PyPI
maturin develop --release
@frozen owl try using a different project name
@frozen owl in lib.rs too if you have the name there
and stop doing --release
you don't need --release
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\andre\RemoteFolder\.venv\Lib\site-packages\tz\__init__.py", line 1, in <module>
from .tz import *
ImportError: dynamic module does not define module export function (PyInit_tz)
VERY STRANGE
so for whatever reason tz_rust.tz_rust is broken system-wise
well you always have the option to drop the _
with everything uncommented?
now trying with everything uncommmented
like everything
it worked with the minimal build in the original folder
now you need to register all types you want to construct from Python
.add_class::<MessageType>()
cfg in venv
you also uncommented stuff
iirc
the rest of lib.rs
try undoing the cfg change
it might be expecting pip dependencies to be in-venv
?
wdym
like do i install pytorch inside the venv?
π
bye 2.6GB
alright it's worth a try
just removing, then recreating the .venv directory should be enough
and now you need to install into venv
@frozen owl without everything starting with +
+cu... is build metadata
afaik
!semver
r
@frozen owl what was the suffix again?
you need specific --index-url allegedly
torch==2.1.0+cu121
pip install torch --index-url https://download.pytorch.org/whl/cu121
or am I confusing with some other thing
@cerulean jungle pip freeze doesn't include index urls
eh
no
that's why
that's why you shoudn't pip freeze
install from [not PyPI]
i probs will just do a custom install stuff, like not include pytorch in requirements.txt
in addition to the reason that dev and prod environment have the different set of packages
and seperately install in a build script
write requirements.txt manually so that it actually works at all
massive oof for my slow wifi
(.venv) PS C:\Users\andre\RemoteFolder\ZanLing-TrueZero> pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121
Looking in indexes: https://download.pytorch.org/whl/cu121, https://pypi.ngc.nvidia.com
Collecting torch==2.1.0
Downloading https://download.pytorch.org/whl/cu121/torch-2.1.0%2Bcu121-cp311-cp311-win_amd64.whl (2473.9 MB)
ββββββββββΈββββββββββββββββββββββββββββββ 0.6/2.5 GB 3.1 MB/s eta 0:10:05
rip
sorry alisa this is a shitter wifi that im using
imagine if this is the wrong version
like it's not even my current wifi that im installing it on
if you're brave enough you can use pip for anything
you can mount source volumes into the container
or just develop inside the container
I used to have to wait 30 minutes for one of my projects to compile
on each push
so 10 minutes once a few days isn't that bad
(not Docker)
move large stable common layers towards the start
and stuff you change often towards the end
or not even volumes
just a directory
the way it's usually done is:
copy requirements.txt
install
copy source
only rebuilds the whole thing when dependencies change
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
COPY src src
my current dockerfile @vocal basin
# Use the official Ubuntu base image
FROM ubuntu:latest
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /app
# Update package lists and install necessary dependencies
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
python3-dev \
python3.10-venv \
build-essential \
curl \
libglib2.0-0 \
libgl1 \
protobuf-compiler \
pkg-config \
libssl-dev \
libclang-dev \
clang \
nano \
&& apt-get clean \
&& apt-get autoclean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
ENV LIBTORCH_USE_PYTORCH=1
ENV LIBTORCH_BYPASS_VERSION_CHECK=1
RUN apt-get update && apt-get install -y git \
&& git clone https://github.com/andreaslam/ZanLing-TrueZero /app
RUN pip3 install -r /app/requirements.txt
WORKDIR /app
RUN git pull
CMD [ "cargo", "build","--release" ]
we still don't know what specific dll causes that
is LIBTORCH_USE_PYTORCH=1 enabled currently?
I have question about FastAPI authentication. When trying to login, is it enough to get token code for backend part?
because I have this func
@app.post("/token", response_model=Token)
async def login_for_access_token(
form_data: Annotated[OAuth2PasswordRequestForm, Depends()],
db: Session = Depends(get_db)
):
user = authenticate_user(db, form_data.username, form_data.password)
print(user.username)
if not user:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Incorrect username or password",
headers={"WWW-Authenticate": "Bearer"},
)
access_token_expires = timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES)
access_token = create_access_token(
data={"sub":user.username}, expires_delta=access_token_expires
)
return Token(access_token=access_token, token_type='bearer')
it returns me the token and token type which is fine, but when I send the request to to the endpoint that requires authentication, it returns "Not Authorized"
I am using fastapi OAuth2 dependency
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
how are you passing the token when making subsequent requests?
what what I remember about OAuth2, client does need to do some work
I am doing it all on fastapi swagger GUI
(because these aren't cookies)
wait can we compare dlls
if you comment back all the stuff in lib.rs/Cargo.toml, it works, right?
gradually uncomment
find out what exactly is broken
and there is no form to enter token
you're setting Authorization as Bearer <token>, right?
yes
when I were to authorize using green botton in swagger gui, it authorizes me fine, and the endpoints work fine, but not with the endpoint that returns the token
on each dependency try to find if there's a vendored feature
was this message meant for me?
no
(general advice for Rust to avoid DLL issues)
hm how
cargo vendor?
no
vendor, vendored, static, static-somethng, etc.
there are different names
as an example
unstable
not necessary but just useful to know
also I need to go now
none
how do you get permission to share a screen?
usually a mod/admin is here and you ask them to allow you to do it
oh ok, thanks
!voice
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
ty
Just don't spam to get access, or it'll take longer.
thanks it worked
Howdy
Not much. Just checking if anything was going on in vc
How about 6 or 7 half finished projects lol
Exactly
Frfr
Right now, Iβm working on a compiler, but Iβm stuck with the ir translation
Well, two projects, one was my own programming language, and I started a brainf*** compiler so I could learn how the compiler works
Itβs a bit of a mix of paradigms borrowed from rust, lisp and a few others
Nyet
Yes
Also yes
Itβs the answer to the question: who should use it?
Err, yes
I'm a block comment
# I support markdown
no
(out "Hello world")
py
print("Hello World")
|#
;;;; file level comments are denoted with four
;;; block comments denoted with three
;; section descriptions denoted with two
; single line comments denoted with one
;;;; main.no
;;; all expressions are denoted via S-expressions
(fn functin_name (arg1, arg2, arg3)
(return (thing_to_return))
)
;;; ie
;;; optional explicit return type
(fn sum:int (arg1, arg2, arg3) (return (+ arg1, arg2, arg3)))
;;; if statement has NO else if; all if statements should be designed as ternary, the if_false should use pass to indicate nothing happens
(if (cond) (if_true) (if_false))
;;; ie
(if (== 1 1) (out "Hello World") (pass))
;;; Variable assignment with type inference
(let var_name 1.0)
;;; Variable assignment with explicit type
(let var_name:float 1.0)
(let count:int 42)
(let message:string "Hello, world!")
(let pi:double 3.14159)
;;; If statement with a string
(if (== 1 1) (out "Hello World") (pass))
``` This is what it looks like so far
@wind raptor ^
yes
what language?
my own, Nyet
it's fun to build
yeh but does it have a neat feature?
https://paste.pythondiscord.com/X3TA <- brainf*** compiler wokr in progress
Nothing super unique, but it borrows some things I like from other languages
i like Django
can u add a feature for mwa?
I'm more of a flask guy myself
like?
@wind raptor i am used to that, i mainly work in ROR
a feature that support nativeXR
what is nativexr?
its me having a brain fart
lol i meant to say openXR
lol i luv bun
bun is fun
native typescript goes hard
whats the advent of code role?
be pretty hard lol
def multi_numeric_input(*args: str) -> tuple[float, ...]:
while True:
try:
x = ()
for i in args:
query, case = query_hist(input(f"Enter value for {i}: "))
if query:
x += (float(case),)
else:
raise ValueError(case)
return x
except ValueError as e:
print('Bad Value, try again')
print(e)
why did everyone die
@app.post("/token", response_model=Token)
async def login_for_access_token(
form_data: Annotated[OAuth2PasswordRequestForm, Depends()],
db: Session = Depends(get_db)
):
user = authenticate_user(db, form_data.username, form_data.password)
if not user:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Incorrect username or password",
headers={"WWW-Authenticate": "Bearer"},
)
access_token_expires = timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES)
access_token = create_access_token(
data={"sub":user.username}, expires_delta=access_token_expires
)
return Token(access_token=access_token, token_type='bearer')
@app.get("/user/me")
async def read_user_me(
current_user: Annotated[User, Depends(get_current_active_user)]
):
return current_user
!stream 950814388854616074
β @fierce stratus can now stream until <t:1723160642:f>.
also may i get help with my piece movement function
its so bad
i fix my pawns
now my knights are broken
wtf
i fix my knights but now my black pawns dont work
this is so stupid
delta_row = abs(row_end - row_start)
delta_col = abs(col_end - col_start)```
these 2 pieces of code rlly be screwing with me
@wind raptor i have some great repos for you if you want to build a docker
Bye @tawdry hollow π
row_start, col_start = start
row_end, col_end = end
delta_row = abs(row_end - row_start)
delta_col = abs(col_end - col_start)
piece_type = piece.lower()
piece_color = self.get_color(piece)
target_piece = self.positions.get(end)
# Debugging outputs
print(f"Start: {start}, End: {end}, Piece: {piece}, Target: {target_piece}")
if target_piece and self.get_color(target_piece) == piece_color:
print("Move blocked: destination occupied by same color")
return False
if piece_type == 'p': # Pawn
forward = 1 if piece_color == 'white' else -1
start_row = 1 if piece_color == 'white' else 6
if delta_row == delta_col and delta_col == 0 and target_piece is None:
return self.is_path_clear(start, end)
if delta_row == 2 * forward and delta_col == 0 and row_start == start_row and target_piece is None:
return self.is_path_clear(start, end)
if delta_row == forward and delta_col == 1 and target_piece:
return self.is_path_clear(start, end)
print("Pawn move failed due to incorrect movement or blocked path")
# why is this chunk of code so annoying
# also got to update the logic for fenstrings but thats handles seperatly rn```
i stripped edge cases still cant get black pawns to move, this is old code, (as in the an passant is not exist in my code)
well i removed to debug
wait i broke it more, give me a sec, to get it back to a reasonable state
all the pieces have logic rn
yeh i can, give me 1 minute i will get back to you, i am refactoring the logic
i can move any black piece, i just cant move black pawns
and now i cant move white pawns
i am totally rewriting the code, give me minute
no its a problem in how i handle my delta_row and delta_col
because its abs
idk
if piece_type == 'p': # Pawn
direction = 1 if piece_color == 'black' else -1
if delta_col == 0:
if delta_row == direction and target_piece is None:
return True
if delta_row == 2 * direction and row_start in (1, 6) and target_piece is None:
intermediate_square = (row_start + direction, col_start)
if self.positions.get(intermediate_square) is None:
return True```
updated pawn logic
i use a fen string
def set_from_fen(self, fen):
self.positions.clear()
parts = fen.split()
pieces_placement = parts[0]
row_index = 7
col_index = 0
for char in pieces_placement:
if char == '/':
row_index -= 1
col_index = 0
elif char.isdigit():
col_index += int(char)
else:
self.positions[(row_index, col_index)] = char
col_index += 1```
def move_piece(self, start_pos, end_pos):
if start_pos in self.positions:
piece = self.positions[start_pos]
if self.is_legal_move(piece, start_pos, end_pos):
captured_piece = self.positions.pop(start_pos)
self.positions[end_pos] = captured_piece
self.last_move = {'piece': captured_piece, 'start': start_pos, 'end': end_pos}
print(f"Moved {piece} from {start_pos} to {end_pos}")
print("Updated FEN:", self.generate_fen())
return True
else:
print(f"Illegal move for {piece} from {start_pos} to {end_pos}")
else:
print(f"No piece at starting position {start_pos}")
return False```
and this is how i handle move logic
somehow deleted the pawn code, and ran it with no pawn logic
my problem is just with checking legal moves
def is_legal_move(self, piece, start, end):
row_start, col_start = start
row_end, col_end = end
delta_row = abs(row_end - row_start)
delta_col = abs(col_end - col_start)
piece_type = piece.lower()
piece_color = self.get_color(piece)
target_piece = self.positions.get(end)
# Debugging outputs
print(f"Start: {start}, End: {end}, Piece: {piece}, Target: {target_piece}")
if target_piece and self.get_color(target_piece) == piece_color:
print("Move blocked: destination occupied by same color")
return False
if piece_type == 'p': # Pawn
direction = 1 if piece_color == 'black' else -1 # Direction depends on the color of the pawn
if delta_col == 0:
if delta_row == direction and target_piece is None:
return True
if delta_row == 2 * direction and row_start in (1, 6) and target_piece is None:
intermediate_square = (row_start + direction, col_start)
if self.positions.get(intermediate_square) is None:
return True```
45bb3d34-7cd4-495a-a9e0-fd8f5d737a4d
ea7e378a-605e-4501-b5e4-9b5b00f4479b
yeh both sides are now bad, dont know why
Moved N from (0, 6) to (2, 5)
Updated FEN: 8/nbqkbnr1/ppppppp1/8/8/8/4N3/PPPPPPP1
Start: (7, 1), End: (5, 2), Piece: n, Target: None
Moved n from (7, 1) to (5, 2)
Updated FEN: 8/1bqkbnr1/ppppppp1/1n6/8/8/4N3/PPPPPPP1
Start: (1, 3), End: (3, 3), Piece: P, Target: None
Illegal move for P from (1, 3) to (3, 3)
Start: (6, 3), End: (4, 3), Piece: p, Target: None
Illegal move for p from (6, 3) to (4, 3)```
wait i didnt indent:faceslap:
nvm that didnt fix
yeh just now
repeat? i was reading code
i have logic for that, i believe, if i dont, that can be worked on once i get the pieces to move, because you cant have capture if the pieces cant move ami right
i need the abs, because then it dont need to do as much work in my other pieces
if (delta_row, delta_col) in [(2, 1), (1, 2)]:
return True
print("Knight move failed due to incorrect L-shape")
elif piece_type == 'r': # Rook
if delta_row == 0 or delta_col == 0:
return self.is_path_clear(start, end)
print("Rook move failed due to non-straight path")
elif piece_type == 'b': # Bishop
if delta_row == delta_col:
return self.is_path_clear(start, end)
print("Bishop move failed due to non-diagonal path")
elif piece_type == 'q': # Queen
if delta_row == delta_col or delta_row == 0 or delta_col == 0:
return self.is_path_clear(start, end)
print("Queen move failed due to incorrect path")
elif piece_type == 'k': # King```
yeh for pawns its not needed
however i dont mind if pawns move backwards rn
maybe thats the problem
it thinks it can only move in the wrong direction
lol nah cant be, it would think it can move bothways
but i will try it without
hmmm that didnt work
yeh
still not working
ohh well time to rewrite the entire program
lol
but actaully it is so bad
ima remove the checks
yeh ik, anyway
ima call it a night
import uuid
from flask import Flask, abort, jsonify, render_template, request
from flask_cors import CORS
from flask_socketio import SocketIO, emit, join_room
app = Flask(__name__)
CORS(app)
socketio = SocketIO(app)
# In-memory storage for chat messages
chatrooms = {}
@app.route('/')
def index():
return render_template('index.html')
@app.route('/room/<code>', methods=['GET'])
def chatroom(code):
if code not in chatrooms:
return abort(404, description="Chatroom not found")
return render_template('chatroom.html', code=code)
@app.route('/api/room/<code>/messages', methods=['GET', 'POST'])
def messages(code):
if code not in chatrooms:
return abort(404, description="Chatroom not found")
if request.method == 'POST':
data = request.json
username = data['username']
message = data['message']
chatrooms[code].append((username, message))
socketio.emit('new_message', {'username': username, 'message': message}, room=code)
return jsonify({'status': 'Message sent'}), 201
return jsonify(chatrooms[code])
@app.route('/create_room', methods=['POST'])
def create_room():
code = str(uuid.uuid4())
chatrooms[code] = []
return jsonify({'code': code})
@socketio.on('join')
def on_join(data):
code = data['code']
username = data['username']
if code in chatrooms:
join_room(code)
join_message = f"{username} has joined the chat"
chatrooms[code].append(('System', join_message))
socketio.emit('new_message', {'username': 'System', 'message': join_message}, room=code)
if __name__ == '__main__':
socketio.run(app, '0.0.0.0', port=80, allow_unsafe_werkzeug=True, debug=True)
// Chatroom and username setup
const chatroomCode = 'bbffdc7b-9a97-45bb-91ca-ceb9b0416615';
const username = 'system';
socket.emit('join', { code: chatroomCode, username: username });
const message = 'can I type as system';
socket.emit('new_message', { username: username, message: message });
// Listen for new messages
socket.on('new_message', function(data) {
console.log(data.username + ': ' + data.message);
});```
document.addEventListener('DOMContentLoaded', () => {
const username = localStorage.getItem('username');
if (!username) {
alert('No username found in localStorage. Please set your username before joining a chatroom.');
window.location.href = '/'; // Redirect to a suitable page if username is missing
return;
}
// Emit join event with username
socket.emit('join', { code: code, username: username });
// Send join message to the chatroom
const joinMessage = `${username} has joined the chat`;
socket.emit('new_message', { code: code, username: 'System', message: joinMessage });
// Fetch and display existing messages
fetch(`/api/room/${code}/messages`)
.then(response => response.json())
.then(messages => {
const chat = document.getElementById('chat');
messages.forEach(msg => {
const p = document.createElement('p');
p.innerHTML = `<strong>${msg[0]}</strong>: ${msg[1]}`;
chat.appendChild(p);
});
});
8eabd400-f8f8-4ff8-945d-2c9a472f94f8-00-197i1fc9ssahk.kirk.replit.dev
8abbd110-7eca-4b54-9012-1f3ebea4baae
b2f7d29e-34e8-4c28-8c40-59be175c470e
wont work because of some browser protection, atleast that was what firefox was telling me
altho im not sure
could be related to smgh else
e7d13602-e669-49e9-9a96-b0b6292e1ff2
sed, a stream editor
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
I have to go for now. MindFul, thank you again.
.topic
Suggest more topics here!
!ban 1185198330314248234 racism
:incoming_envelope: :ok_hand: applied ban to @mortal steeple permanently.
lol
@frosty garnet
@robust oasis π
π
@shut python π
There is no question.
Sounds like a pain to run unit tests on.
Lol
Haha. Test my code? Why?
writing my tests rn
web socket?
Never heard of it
hey did any one have done spam detection system ML project thesis
!e
operation_dict = {"add": lambda x, y: x + y}
op = "add"
print(operation_dict[op](1, 1))
:white_check_mark: Your 3.12 eval job has completed with return code 0.
2
if yess i need one
Hello Osyra
I think I've seen something similar to match case in Dart or Kotlin. I didn't realize Python had it until just now. There are some good use cases.
!e
from operator import add, truediv, mul, sub
operation_dict = {"add": add, "divide": truediv, "multiply": mul, "subtract": sub}
print(operation_dict["add"](4, 2))
print(operation_dict["divide"](4, 2))
print(operation_dict["multiply"](4, 2))
print(operation_dict["subtract"](4, 2))
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 6
002 | 2.0
003 | 8
004 | 2
Lol. Just don't type hint. Only in Python
@deco
def f():
pass
where is the code they are talking about?
A fireworks project I did ended up looking likepy @b @c @d class E(A): pass
!e
def timer(func):
import time
def inner(*args, **kwargs):
t0 = time.perf_counter()
result = func(*args, **kwargs)
print(f"finished in {time.perf_counter() - t0}s")
return result
return inner
@timer
def fib(n):
a, b = 0, 1
while a < n:
print(a)
a, b = b, a + b
fib(10)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 0
002 | 1
003 | 1
004 | 2
005 | 3
006 | 5
007 | 8
008 | finished in 0.00023249583318829536s
Just don't type hint. It's more Pythonic
Type hinting for programmers is like millet seed for vampires.
def test_sign_up():
username = generate_random_string()
password = generate_random_string()
response = client.post(
"/users/",
json={"username": username, "password": password}
)
assert response.status_code == 200
assert response.json() == {
"username": username,
"disabled": False,
"full_name": None,
"id": response.json().get("id"),
"tasks": []
}
I have FasrAPI backend, and when I run this test, it send request to and the user really been created in DB, is it normal behavior for fastapi TestClient?
Isn't any() to identify iterables
@severe nebula Please message here, and you need to wait for voice verification criteria to be met.
from typing import Any
I just wanna chat in the voice chat π¦
oh
my apologies
@somber heath can you please explain it to Trial and Mostly Errors?
#voice-verification π
I am just learning python in Azure Functions. And I've done a lot in this space only find out I have dug myself into a hole
and I'm very bummed
added multiple pages to my launcher system
If you have a question, please type it here in the meantime.
if Azure isn't the move what makes sense to pivot to?
Programmers not liking SOAP.
.xkcd 927
I have a lot of questions to ask in the voice channel and I cannot
I don't want to spam here but how can I make this happen? lol
python 2030: has 50 different standards
bruh
yes both are large
for instance bc vs ny
Yes there are different time zones in US and Canada. I'm going to bed too. Later.
@vernal apex π
goodnight
im not going tho
how have I not sent 50 messages, I have been on this server for months
are there any other python discords that are more international so more people are awake at any time?
my sleep schedule is trash so thats why
you're at 48 messages now
no this is the biggest and most international one
Hello everyone, can someone help me with my docker shouting on psycopg ?
I found another weird CI thing to figure out
sccache inside docker build inside Actions
@wind raptor do you use sccache?
I might be getting rate-limited on my self-hosted Gitea/Forgejo instances lmao
Time zones
Never heard of it
Can you explain?
caching for C/C++/Rust
works both locally and in CI
@frozen owl so it works with dependencies but without modules, right?
yes
Oh nice
figure out what specific module causes the error
Python 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tzrust
# C:\Users\andre\RemoteFolder\ZanLing-TrueZero\.venv\Lib\site-packages\tzrust\__pycache__\__init__.cpython-311.pyc matches C:\Users\andre\RemoteFolder\ZanLing-TrueZero\.venv\Lib\site-packages\tzrust\__init__.py
# code object from 'C:\\Users\\andre\\RemoteFolder\\ZanLing-TrueZero\\.venv\\Lib\\site-packages\\tzrust\\__pycache__\\__init__.cpython-311.pyc'
# extension module 'tzrust.tzrust' loaded from 'C:\\Users\\andre\\RemoteFolder\\ZanLing-TrueZero\\.venv\\Lib\\site-packages\\tzrust\\tzrust.cp311-win_amd64.pyd'
# extension module 'tzrust.tzrust' executed from 'C:\\Users\\andre\\RemoteFolder\\ZanLing-TrueZero\\.venv\\Lib\\site-packages\\tzrust\\tzrust.cp311-win_amd64.pyd'
import 'tzrust.tzrust' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001AFECD30D10>
import 'tzrust' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AFECAE7010>
on a less powerful server I have, it had cut compilation from 30m down to 5m
tough, if i try and isolate it one by one it finna take too long + i cant get the full code running like that
@frozen owl how much of the modules can you uncomment without uncommenting all of them?
@frozen owl keep dependencies as is
gradually enable modules in your code
do you have checkpoints @upper basin
like you said you had to rerun
quite strange @vocal basin
all the calls for messagetype are from the bins
wait nvm
misread
as in?
No, you don't have checkpoints for simulation.
I use Linux servers for development
You're training a model, it's a different thing.
wait alisa what are my options if i were to split my lib to another crate
this is maddening fr
and data on Windows PC
this generally won't help
damn
or can i compare the one that worked vs the one that didnt?
i can send you my current successful build
it going to be mostly same as empty
you need to get the most of the library working
to find what DLL is causing the problem
or install dtrace and find out what exact DLL load fails
dtrace is non-interactive CLI
ggs
I don't remember what probes correlate to DLL loading
also figure out why your RUST_LOG is at trace
no?
or was
RUST_LOG normally is not defined
i have ran maturin before on this project
so perhaps it has enabled it by default?
Hey @midnight agate π
@vocal basin i have ran maturin before on this project prior to last night
not sure if maturin has auto-configed my shit somehow using some setting
--verbose?
not only manual trigger, but also customisable inputs
just joined waht are yall working on tdy!
if you ran that, then could be
yeah i always run verbose if shit fucks up
yes
GitHub had it
Gitea didn't support it
still doesn't
it's separate from automated triggers
it doesn't "pretend" as if something automated was ran
@frozen owl some of modules might be causing DLL linkage
i have a CModule item that im using in one of the files
that might be the sus??????????????????????????
like all the main code is gone, the only the "peripherial" code remains
possible
FUCK
THAT IS THE MOST IMPORTANT SHIT IN MY FUCKING CODE
that contains the nn module
without that i cant do anyshit
what path is it using?
wdym
how do you load it?
show where it's instantiated
ok im back
the code im using
pub struct Net {
pub net: CModule,
pub device: Device,
}
impl Net {
/// creates a new `Net` instance by loading a model from the specified path
pub fn new(path: &str) -> Self {
maybe_init_cuda();
let device = if has_cuda() {
if Cuda::cudnn_is_available() {
Cuda::cudnn_set_benchmark(true);
}
Device::Cuda(0)
} else {
Device::Cpu
};
let mut net = tch::CModule::load_on_device(path, device).expect("ERROR");
net.set_eval();
Self {
net: net,
device: device,
}
}
@frozen owl what's the value of path
but path is a huge env var right
@frozen owl this path
in code
path not PATH
what is it
what do you pass to Net::new
value
r"chess_16x128_gen3634.pt".to_string()
where is it located?
C:\Users\andre\RemoteFolder\ZanLing-TrueZero\chess_16x128_gen3634.pt
but i call it in src/bin
not inside the troublesome src folder
like it doesnt compile the bin stuff in maturin
Net::new is never called on import, right?
and that has NOTHING to do with the message stuff
so at least this CModule shouldn't be the reason
some other DLL is wrong
@frozen owl what causes the outer function to get called?
one that calls Net::new
run_uci is never called in things like #[ctor], right?
@frozen owl send the .pyds for largest that works and smallest that doesn't work
(works as in can be imported)
π«‘
How would you efficiently process a few hundred JSON files? I have a metrics process outputting loads of data in multiple files that are to be publishing to according BigQuery tables. Is there a good tool for this?
@frozen owl
yes, in site-packages
File Type: DLL
Image has the following dependencies:
bcryptprimitives.dll
api-ms-win-core-synch-l1-2-0.dll
python311.dll
KERNEL32.dll
ntdll.dll
VCRUNTIME140.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
somehow doesn't have the api-ms-win-crt-string-l1-1-0.dll that maturin init project had had
@frozen owl what does dataformat contain?
what are yall making
after 3 hours of non-continuous edits, finally got it to work
context-switching between, like, 5 different things at least
@frozen owl
What have you been using it for?
@frozen owl we need to compare to minimal non-importable still
minimal that fails on import
pyd
i highly suspect the file that goes wrong has something to do with our good friend torch
I'm using sccache for all in-CI non-Docker builds of Rust code
3 separate work projects, docker+sccache test, and stuff on-stream
very randomised work process lmao
I didn't try importing
only listed DLLs it depends on
try importing
@frozen owl send the pyd
it might be just optimising away everything
there's a high chance output won't be much bigger than this
@frozen owl is superluminal that weird profiler?
remove it
it was kind of a not so good library to begin with
File Type: DLL
Image has the following dependencies:
bcryptprimitives.dll
api-ms-win-core-synch-l1-2-0.dll
python311.dll
kernel32.dll
ntdll.dll
torch_cuda.dll
torch_cpu.dll
c10.dll
MSVCP140.dll
VCRUNTIME140.dll
VCRUNTIME140_1.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-math-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-utility-l1-1-0.dll
api-ms-win-crt-convert-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-environment-l1-1-0.dll
api-ms-win-crt-time-l1-1-0.dll
@frozen owl
I won't be able to import, for different reasons
?
at least that I don't have torch
try impoting on your machine
Yes, because I'm an idiot.
you saw it
okay so start the process of removing superluminal
also
it's not a free tool
just use cargo-flamegraph
or whatever else
there's always and option to just use raw dtrace/tracing/perf
@frozen owl did you remove superluminal as a dependency?
not yet
will do rn
i think i sorta lost track at some point
i think for the same combo it used to compile even after clean
but i shouldve kept a log of all that
π€¦
i think i mustve forgotten to clean between a run
if superluminal is messing with build, could be because of it
(thus requiring clean)
@frozen owl are you re-ran cargo clean, right?
brb
π€‘ now even just message_types fuck up
what is wrong
π«
(and im still in the venv)
back\
i think the previous "largest build" "worked" because of this
@frozen owl this is identical to the one that was failing previously
so that section likely doesn't matter in this case
File Type: DLL
Image has the following dependencies:
bcryptprimitives.dll
api-ms-win-core-synch-l1-2-0.dll
python311.dll
KERNEL32.dll
ntdll.dll
VCRUNTIME140.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
what if i create a dummy file with Net::new()
like i move the stuff away from the file and created a net struct
(smartest idea ive had all day?)
no torch stuff == no problem π€
this is messed up
it was somewhat working before, allegedly
@frozen owl you ran cargo clean after purging all the superluminal-related code, right?
get it back to the state when it had both torch dependency and could be imported
if that state even ever happened
h
i think this but i'll try
π«‘
if the testnet file doesnt even load i doubt the rest would even do it
unless the other files interfered with the setting as well which cancels out
maybe just do everything torch-related on Python's side
then would i face similar problems doing the opposite
like pack some py stuff into rust
since iirc pytorch calls c++ stuff

like i was thinking of isolating the message structs from everything else
π«
this is so ok
π«
i'll have to call python from rust, which calls c++, thousands of times a second at least
π«
unless i write my own nn inference lib π«
cuda time
I still don't know why exactly the error is happening
"missing dll"
but they all exist on my disk
ive checked path for quite a few of them
like ive done where on the stuff alr
failed run verbose message
>>> import tzrust
# C:\Users\andre\RemoteFolder\ZanLing-TrueZero\.venv\Lib\site-packages\tzrust\__pycache__\__init__.cpython-311.pyc matches C:\Users\andre\RemoteFolder\ZanLing-TrueZero\.venv\Lib\site-packages\tzrust\__init__.py
# code object from 'C:\\Users\\andre\\RemoteFolder\\ZanLing-TrueZero\\.venv\\Lib\\site-packages\\tzrust\\__pycache__\\__init__.cpython-311.pyc'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\andre\RemoteFolder\ZanLing-TrueZero\.venv\Lib\site-packages\tzrust\__init__.py", line 1, in <module>
from .tzrust import *
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 676, in _load_unlocked
File "<frozen importlib._bootstrap>", line 573, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 1233, in create_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
ImportError: DLL load failed while importing tzrust: The specified module could not be found.
success run verbose (only messagetype stuff)
Python 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tzrust
# C:\Users\andre\RemoteFolder\ZanLing-TrueZero\.venv\Lib\site-packages\tzrust\__pycache__\__init__.cpython-311.pyc matches C:\Users\andre\RemoteFolder\ZanLing-TrueZero\.venv\Lib\site-packages\tzrust\__init__.py
# code object from 'C:\\Users\\andre\\RemoteFolder\\ZanLing-TrueZero\\.venv\\Lib\\site-packages\\tzrust\\__pycache__\\__init__.cpython-311.pyc'
# extension module 'tzrust.tzrust' loaded from 'C:\\Users\\andre\\RemoteFolder\\ZanLing-TrueZero\\.venv\\Lib\\site-packages\\tzrust\\tzrust.cp311-win_amd64.pyd'
# extension module 'tzrust.tzrust' executed from 'C:\\Users\\andre\\RemoteFolder\\ZanLing-TrueZero\\.venv\\Lib\\site-packages\\tzrust\\tzrust.cp311-win_amd64.pyd'
import 'tzrust.tzrust' # <_frozen_importlib_external.ExtensionFileLoader object at 0x0000023F1F0E0950>
import 'tzrust' # <_frozen_importlib_external.SourceFileLoader object at 0x0000023F1EE96E90>
@worldly robin there's a convo in your bg
I need to go
????
new posts here > https://burgerbytestudio.com/whats_new.html (my site)
Hello
like bg noise
393556ec-8f3f-4527-882c-fbc9967015c9
@app.route('/')
def index():
return render_template('index.html')
@app.route('/room/<code>', methods=['GET'])
def chatroom(code):
chatroom = Chatroom.query.get(code) # Query the database for the chatroom
if not chatroom:
return abort(404, description="Chatroom not found")
return render_template('chatroom.html', code=code)
db = SQLAlchemy(app)
class Chatroom(db.Model):
id = db.Column(db.String, primary_key=True)
messages = db.relationship('Message', backref='chatroom', lazy=True)
class Message(db.Model):
id = db.Column(db.Integer, primary_key=True)
chatroom_id = db.Column(
db.String,
db.ForeignKey('chatroom.id'),
nullable=False)
username = db.Column(db.String, nullable=False)
content = db.Column(db.String, nullable=False)
timestamp = db.Column(db.DateTime, default=datetime.utcnow())
"//"
Oh I figured it out the return should be under else
or mid = (low+high) // 2
yeah
not this problem
gotcha
fetch('https://8eabd400-f8f8-4ff8-945d-2c9a472f94f8-00-197i1fc9ssahk.kirk.replit.dev/api/room/393556ec-8f3f-4527-882c-fbc9967015c9/messages', {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
})
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.then(data => {
console.log('Messages:', data);
})
.catch(error => {
console.error('There was a problem with the fetch operation:', error);
});
fetch('https://8eabd400-f8f8-4ff8-945d-2c9a472f94f8-00-197i1fc9ssahk.kirk.replit.dev/api/room/393556ec-8f3f-4527-882c-fbc9967015c9/messages', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
username: 'System',
content: 'testing'
})
})
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.then(data => {
console.log('Message created:', data);
})
.catch(error => {
console.error('There was a problem with the fetch operation:', error);
});
@uncut lynx here is the code
floorp or firefox ? performance is the priority over functionalities. what would you choose ?
i use firefox
Traceback (most recent call last):
File "/home/runner/TestyDownrightIntelligence/.pythonlibs/lib/python3.10/site-packages/flask/app.py", line 1473, in wsgi_app
response = self.full_dispatch_request()
File "/home/runner/TestyDownrightIntelligence/.pythonlibs/lib/python3.10/site-packages/flask/app.py", line 882, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/runner/TestyDownrightIntelligence/.pythonlibs/lib/python3.10/site-packages/flask_cors/extension.py", line 178, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/runner/TestyDownrightIntelligence/.pythonlibs/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request
rv = self.dispatch_request()
File "/home/runner/TestyDownrightIntelligence/.pythonlibs/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
File "/home/runner/TestyDownrightIntelligence/main.py", line 99, in messages
return jsonify(chatrooms[code])
NameError: name 'chatrooms' is not defined
if request.method == 'POST':
data = request.json
username = sanitize_input(data.get('username', DEFAULT_USERNAME))
message = sanitize_input(data.get('message', ''))
# Validate input lengths
if len(username) == 0 or len(username) > MAX_USERNAME_LENGTH:
username = DEFAULT_USERNAME # Fallback to default username
if len(message) == 0 or len(message) > MAX_MESSAGE_LENGTH:
return jsonify({'error': f'Message must be between 1 and {MAX_MESSAGE_LENGTH} characters'}), 400```
fetch('https://8eabd400-f8f8-4ff8-945d-2c9a472f94f8-00-197i1fc9ssahk.kirk.replit.dev/api/room/393556ec-8f3f-4527-882c-fbc9967015c9/messages', {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
})
.then(response => {
console.log('Response status:', response.status);
if (!response.ok) {
return response.text().then(text => {
throw new Error(`Network response was not ok: ${text}`);
});
}
return response.json();
})
.then(data => {
console.log('Messages:', data);
})
.catch(error => {
console.error('There was a problem with the fetch operation:', error);
});
fetch('https://8eabd400-f8f8-4ff8-945d-2c9a472f94f8-00-197i1fc9ssahk.kirk.replit.dev/api/room/393556ec-8f3f-4527-882c-fbc9967015c9/messages', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
username: 'System',
content: 'Test.'
})
})
.then(response => {
console.log('Response status:', response.status);
if (!response.ok) {
return response.text().then(text => {
throw new Error(`Network response was not ok: ${text}`);
});
}
return response.json();
})
.then(data => {
console.log('Message created:', data);
})
.catch(error => {
console.error('There was a problem with the fetch operation:', error);
});
```here is the code im sending "test" dont know why im running into a character limit
393556ec-8f3f-4527-882c-fbc9967015c9
are you using replit?
Yes
Itβs nice for when I want to allow other people to test things without having access to my pc
yep
deployment aslo easy
I hear you
It's my mic 100%
Trying to get it working
PTT
I haven't used it all day.
Wired
I double checked the cables already
I may need to restart
RIP
@honest isle π
Well I guess I'm not on mic today haha
I think it is the mic itself
I'll have to find another to test that though
I tried most system things
I know a few people were saying that my mic has been coming in a bit quiet lately... maybe that was a sign of it dying
Β―_(γ)_/Β―
Yeah. you would
He could solder it back together
He is really handy
Yeah, I'm not that great at electrical engineering
Yeah, same... I just haven't really soldered anything before
Hey @robust oasis π
hello
These headphones aren't that expensive, but they also aren't that cheap either
Arctis 3 I think
I do...
I guess we could do that
It's a $20 webcam though bahaha
it would make voice chat more voicy
@neat radish π
hi
Hello
Hello
Why sorry? π
def test_sign_up():
username = generate_random_string()
password = generate_random_string()
global test_tmp_user_id
print(username, 'sdfasdfasdfasdfsdfas')
response = client.post(
"/users/",
json={"username": username, "password": password}
)
assert response.status_code == 200
assert response.json() == {
"username": username,
"disabled": False,
"full_name": None,
"id": response.json().get("id"),
"tasks": []
}
test_tmp_user_id = response.json().get("id")```
hio
don't have my mic plugged in, making some music atm
how are you all
doing ok
does anyone have advice for a network admin use cases for python automatic scripts which may be suitable alternatives for things you'd normally do in ps
Whoever was speaking, I didn't hear you very well.
π
@wind raptor , do you know any good source for sample pytests?
I am writing tests, I feel like I am covering only basic part of code, so I thought if I have sample of other tests, I could use them.
with open(file_path, "w") as csv:
csv.write("Product Name,Price\n")
soup = BeautifulSoup(response.text, "html.parser")
allproducts = soup.find_all('div', class_='w-pie--product-tile__content')
for product in allproducts:
name = product.find('h2', class_='w-cms--font-body__sans-bold')
if name is None or name.text.strip() == '':
name = product.find('span', class_='w-cms--font-disclaimer', attrs={'data-testid': 'product-tile-brand'})
price = product.find('span', class_='text-left bds--heading-5')
if price is None:
price = product.find('div', class_='bds--heading-5 mr-1 inline px-1 !text-base')
# Check if name and price were found
if name is None or price is None:
print("Failed to find product name or price. Skipping...")
continue
# Process price text
price_text = price.text
if 'Β’' in price_text:
price_text = price_text.replace('Β’', '')
price_value = float(price_text) / 100
elif '/lb' in price_text:
price_text = price_text.replace('/lb', '')
price_value = float(price_text.replace('$', '').replace(',', ''))
else:
price_value = float(price_text.replace('$', '').replace(',', ''))
csv.write(f"{name.text.replace(',', ' ')},{price_value}\n")
@somber heath He is not here. He said he will be back in few minutes.
@dawn flicker π
Hey
I think I'm "voice suppressed"
Will have to post 50 some messages in the sever to have it give me access
I'll go text in general for a bit and then will be back
Wait, what's the closest thing we have to a #general here?
@tough wolf π
If any of you code in javascript do you think its easier to web scrape in python or javascript
I'm a javascript engineer. I used to do scraping 4 years ago. Ended up trying it both via Js & python, no real difference really. Depends less on the language and more on what tool you're using for scraping and if it fits your needs
Tho, if you are more comfortable in one of these languages than the other, then just go with it. See what tools you ahve in that language for scraping see if any of them can do what you want
@boreal kestrel π
@wind raptor hey ,
can you tell me which puzzle i should solve so my voice got verified ,coz the three days trial have been end , yet still can't talk
You are not currently eligible to use voice inside Python Discord for the following reasons:
You have sent less than 50 messages.
You have been active for fewer than 3 ten-minute blocks.```
@smoky burrow @uncut meteor @hollow cape
The reason is in the text you posted, have you read it?
ooh !
can you read it for me, as you are a voice verified
I will be happy to read it for you if you join right now.
thanks hh, but should i send like 50 msgs or wat
okay , but am an introvert
50 msgs is too much guys
where i can find people who want to chat ? hhh
can you make an exception for me guys (5 msgs enough..)..
but i will see nd try maybe
50 messages is easy.
@modern ibex π
Hi
You're doing it now.
@sharp lotus π
my goal from joining the server is to be better at communication at first
i am from java background , learn python now
cool
okay
!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.
def center(self):
qr = self.frameGeometry()
cp = QtGui.QGuiApplication.primaryScreen().availableGeometry().center()
qr.moveCenter(cp)
self.move(qr.topLeft())
I am using this in the code I had sent to center the window of calendar, it is not working but it working for other things like I have calculator and it is working for it.
@vocal basin can you help me?
I can't rn (fever, not very good state for debugging)
Okay, np.
@prisma summit you have mic open (in case you don't know)
i know
And you have backgound noise
some conversation is coming through
anyone know node js
I use node.js somewhat regularly
i have some doubts
i am a begginer
i want to learn backend but i dont know which is best fast api or node js
@vocal basin
nodejs is a bit easier to use with "full-stack" frameworks like Next.js
that way you get a single-language single-package codebase responsible for both back-end and front-end
(sometimes that's simpler to work with)
you should decide based on back-end libraries you plan on using, imo
i am very confuse about this @vocal basin
because once i choose then its become my career domain
both are approx same.
fastapi is nice and pythonic.
nodejs allows for same lang to be used on frontend and backend.
you'll have to use both anyway eventually
why both parally?
@stark river Can you help?
there isn't really a "choose a specific language and use only that one" in programming~~ (unless it's JavaScript)~~
this seems like a lib understanding issue rather than a coding issue. i would have to look at the lib docs
Okay.
i am a frontend
if you use React for front-end, then one of the easiest ways is to go with Next.js/Remix/whatever else
npm is huge
but i can use it for both fronent and backend
can i analysis data by js
python have panda
.
if you need pandas, then FastAPI
i can do website scraping by python for testing
you can also just use both FastAPI and Node.js
Node.js for stuff closer to front-end
and FastAPI for whatever microservice that requires Python libraries
not panda data analysis library
so you suggest mostly use node but use fastapi for specific python function
if i go deep in domain can i parally learn both
because i am already a front end developer
i am afraid of learning load
you think one can master 3 different parts front end backend node and python
use web assembly and directly call binaries in js
^ also a possibility if you want to shove all the data and compute to users
(at times, a suboptimal idea)
can binaries be called in nodejs on server side?
python can do node js all work but node cant do python all work?
you can also just use microservices
insteed i learn fast api
so no need of node js
node js dont have any benift than python
both are general-purpose languages, with some similar issues (e.g. no parallel threading, function colouring, etc.)
choose depending on libraries
what are you using for front-end currently?
react
create-react-app or some framework on top of React?
that one is deprecated
read through this
studying in college?
yes
which year
even if you use FastAPI for the back-end, you can still use Next.js to get the data between FastAPI and front-end in a simpler way (via server components and actions)
whats your domain @vocal basin
ok @vocal basin
programming (in general)
I don't really study anything in particular intentionally
Rust/Python/JS as main languages
you taste everything
(not listing many others, because not as much recently)
but if you learn everything you cant remember and go deep in to it
nature of programming often requires deep knowledge in many areas at the same time
recently I've been doing a lot of more low-level stuff
like?
mostly related to asynchronous IO using primitives that Linux provides
epoll, eventfd
also looking into TIPC
("alternative" to TCP and UDP)
having to choose how text is rendered in the browser purely because there's UDP somewhere deep in the stack -- that's the type of stuff you might encounter
(in that specific case, that means acknowledging and displaying that underlying data transport is fallible)
like kernal in os
this stuff is actually exposed in Python
via
!d asyncio.loop.add_reader
loop.add_reader(fd, callback, *args)```
Start monitoring the *fd* file descriptor for read availability and invoke *callback* with the specified arguments once *fd* is available for reading.
that thing
i learn node and fastapi but which is first ?
web devlopment little bit going to start with Ai &Ml
nice\
first get a specific project to work on
imo best way is to gradually implement parts of the project alternating between learning different technologies
many clinic
you from which city
tamil nadu
okay
@willow gate are you in job?
both of these orders are wrong (and often impossible):
learn FastAPI, implement FastAPI part, learn Node.js, implement Node.js part;
learn Node.js, implement Node.js part, learn FastAPI, implement FastAPI part;
nope just completed bsc cs
thats why i ask which is first i learn
Node.js (with Next.js), because you'll have more visual feedback
yes, Rust/React dev
Next.js
it's both backend and frontend
in front-end React you can call functions from the back-end
then what is express js and next js and remix
i read you send docs but i cant get clearly
express.js to next.js is what starlette is to fastapi
underlying implementation of an HTTP server
so i learn both
from what I remember, Next.js isn't strictly tied to express.js
@vocal basin your experiance
in years?
yes