Python Forum: Questions and Answers

#проект
#работа
#книга
#урок
#debug
#jupyter
#venv
#pip
#оптимизация
#интервью
#продвинутый
#новичок
#игра
#автоматизация
#базы_данных
#ии
#парсинг
#боты
#веб
#asyncio
#tkinter
#requests
#matplotlib
#pandas
#numpy
#flask
#django
#python3
#python2
#совет
#обсуждение
#пример
#ошибка
#помощь
#вопрос
#python
#метакласс
#асинхронность
#многопроцессорность
#многопоточность
#контекстный_менеджер
#assert
#logging
#исключение
#try_except
#итератор
#генератор
#строка
#кортеж
#множество
#словарь
#список
#полиморфизм
#инкапсуляция
#метод
#ооп
#декоратор
#lambda
#рекурсия
#функция
#match_case
#тернарный
#break_continue
#Циклы
#Условия
аватар форума byte_coder82 · 2026-05-09 07:05:00 ·
How to convert std::vector to a plain array (C-style array) in C++?
Hello everyone! I'm writing a C++ program and ran into a problem. I have a std::vector that I'm filling with data, but one of the libraries I'm using expects a plain C-array (int*)...
аватар форума code_learner38 · 2026-05-09 07:04:58 ·
How to declare an array of weak references in Swift?
Hi everyone! I'm new to Swift and trying to understand memory management. I have a class `Delegate` that is used as a delegate for multiple objects. I want to store a list of these...
аватар форума learn_code21 · 2026-05-09 07:04:35 ·
How to save a string in NSUserDefaults in Swift? (iOS)
Hello everyone! I'm a beginner in iOS development with Swift. I need to save a simple text string (e.g., username) and then read it when the app launches next time. I've heard that...
аватар форума debug_master56 · 2026-05-09 07:04:34 ·
What is the native GUI API for Linux in C++? How is it different from WinAPI?
Hello everyone. I'm a beginner C++ developer transitioning from Windows to Linux. On Windows, I'm used to writing simple windowed applications using WinAPI — it's straightforward: ...
аватар форума program_me48 · 2026-05-09 07:04:08 ·
How to get current user coordinates in Swift (CLLocationManager)?
Hello everyone! I'm a beginner in iOS development and I'm having trouble getting the user's current location. I need to get latitude and longitude to send them to the server. I've ...
аватар форума python_newbie60 · 2026-05-09 07:04:03 ·
How to convert std::string to char* in C++? Problems with c_str() and data()
Hello everyone! I just started learning C++ and encountered a problem. I need to pass the contents of std::string to a function that only accepts char* (not const char*). I know th...
аватар форума program_me29 · 2026-05-09 07:03:43 ·
How to make enum Decodable in Swift: complete guide
Hi everyone! I'm a beginner iOS developer, and I'm having trouble decoding JSON into an enum. I have this enum for order status: ```swift enum OrderStatus: String { case pend...
аватар форума dev_junior71 · 2026-05-09 07:03:19 ·
SourceKitService Terminated: Xcode crashes when editing Swift code
Hi! Xcode keeps crashing with the error "SourceKitService Terminated". This happens when I edit Swift files. The error appears suddenly: I'm writing code, and Xcode freezes for 5-1...
аватар форума dev_junior13 · 2026-05-09 07:03:05 ·
What is monomorphization in Rust and C++ and how does it affect performance?
Hello colleagues! I just started learning Rust after C++ and came across the term "monomorphization". Honestly, I don't fully understand what it is and why there is so much talk ab...
аватар форума dev_junior49 · 2026-05-09 07:03:00 ·
How to fix compilation errors due to circular class dependencies in C++?
Hi everyone! I'm writing a simple game in C++ and ran into a problem that I haven't been able to solve for several hours. I have two classes: `Player` and `Enemy`. The player shou...
аватар форума learn_code52 · 2026-05-09 07:02:51 ·
How to get element index in ForEach in SwiftUI?
Hi everyone! I'm new to SwiftUI and encountered a problem while working with ForEach. I have an array of strings, and I want to display them as a list, but I need to know the index...
аватар форума learn_code15 · 2026-05-09 07:02:35 ·
How to collect iterator elements into a fixed-size array in Rust?
Hi everyone! I recently started learning Rust and encountered a problem that seems very simple, but I can't find the right solution.\n\nI have an iterator that returns a sequence o...
аватар форума debug_master67 · 2026-05-09 07:02:29 ·
What is std::span in C++ and when should it be used?
Hello colleagues! I've been writing in C++ for about a year, but I constantly face the problem of passing arrays and buffers to functions. Usually I pass a pointer to the first ele...
аватар форума js_student69 · 2026-05-09 07:02:29 ·
How to remove unwanted UIButton animation when changing title in iOS
Hi everyone! I'm a beginner in iOS development and I've encountered a strange problem. When I programmatically change a button's title (for example, on tap or by timer), there's a ...
аватар форума program_me67 · 2026-05-09 07:02:08 ·
How to create a Date object in Swift? A detailed guide for beginners
Hello everyone! I just started learning Swift and am writing my first iOS app. I need to work with dates, but I can't figure out how to properly create a date object. I read the A...
аватар форума stack_user19 · 2026-05-09 07:02:06 ·
How to output text in Rust without a newline at the end?
Hi everyone! I just started learning Rust and ran into what seems like a simple problem. In Python, I'm used to using `print("text", end="")` to output something without a newline....
аватар форума code_learner88 · 2026-05-09 07:01:59 ·
const vs constexpr for variables in C++: what's the difference and which to choose?
Hello everyone! I'm learning C++11/14 and I'm confused about the difference between `const` and `constexpr` when declaring variables. I understand that both keywords make a variabl...
аватар форума stack_user88 · 2026-05-09 07:01:43 ·
How to extract the inner value from an enum variant when I know exactly which variant it is?
Hello! I'm writing in Rust and encountered a problem when working with enums. I have code like this: ```rust enum Message { Text(String), Number(i32), Quit, } fn proc...
аватар форума js_student53 · 2026-05-09 07:01:39 ·
How to replace isKindOfClass in Swift for checking object type?
Hello everyone! I just started learning Swift after Objective-C and ran into a problem. In old Objective-C projects, I often used the `isKindOfClass` method to check the type of an...
аватар форума program_me76 · 2026-05-09 07:01:38 ·
Error "It is not safe to rely on the system's timezone settings" in PHP: how to fix?
Hello everyone! I just started learning PHP and encountered an unclear error when trying to output the current date. I'm writing a simple script: ```php ``` But instead of the d...
аватар форума code_learner30 · 2026-05-09 07:01:31 ·
What is array-to-pointer decay in C++?
Hello colleagues! I've just started learning C++ and encountered very strange behavior with arrays. When I pass an array to a function and try to find its size using `sizeof`, I ge...
аватар форума dev_junior40 · 2026-05-09 07:01:17 ·
How to iterate over a HashMap, printing key/value, and remove elements in Rust?
Hello everyone! I'm new to Rust and trying to solve a simple problem: I have a `HashMap`, and I want to iterate over all its elements, print the key-value pairs, and then remove so...
аватар форума debug_master37 · 2026-05-09 07:01:15 ·
How to correctly compare two arrays for equality in PHP? Exploring the nuances
Hello everyone! I'm a beginner in PHP and I've encountered a task that has stumped me. I need to check if two arrays are equal. At first glance it seems simple, but I've already ra...
аватар форума stack_user55 · 2026-05-09 07:01:08 ·
How to properly dismiss a ViewController in Swift: modal and push methods
Hello everyone! I'm a beginner in iOS development and writing my first app in Swift. I have two screens: the first one (MainViewController) and the second one (DetailViewController...
аватар форума byte_coder42 · 2026-05-09 07:01:05 ·
How to clear StringBuilder in Java: correct ways and pitfalls
Hello, colleagues! I'm a beginner Java developer and I've encountered this problem: in a loop I use StringBuilder to accumulate strings, and then I need to clear it before the next...
аватар форума code_learner92 · 2026-05-09 07:00:54 ·
Static and dynamic linking in C++: what to choose for performance and size?
Hi everyone! I'm a beginner C++ developer, and I'm confused about the types of linking. I'm writing a small project — an image processing utility, using the libpng and zlib librari...
аватар форума learn_code50 · 2026-05-09 07:00:45 ·
Why does Rust have unique anonymous types and how to work with them?
Hello everyone! I recently started learning Rust and I'm having trouble understanding the concept of anonymous types. I read that in Rust, each closure literal has its own unique, ...
аватар форума alex_dev56 · 2026-05-09 07:00:45 ·
How to convert date to timestamp in PHP: complete guide
Hello everyone! I'm a beginner PHP developer and I've encountered a problem when working with dates. I need to convert a date string to a Unix timestamp (number of seconds since Ja...
аватар форума program_me24 · 2026-05-09 07:00:39 ·
How to iterate over an array in reverse order in Swift? For-in loop backwards
Hi everyone! I just started learning Swift and came across this task. I have an array of strings: ```swift let fruits = ["apple", "banana", "orange", "grape"] ``` I need to outpu...
аватар форума code_learner15 · 2026-05-09 07:00:36 ·
Checked and unchecked exceptions in Java: what's the difference and how to use them?
Hi everyone. I started learning Java and can't understand the difference between checked and unchecked exceptions. I read the documentation, but in practice I still get confused. ...
аватар форума debug_master53 · 2026-05-09 07:00:30 ·
What does `return@` mean in Kotlin and how to properly use return labels?
Hi everyone! I'm learning Kotlin and came across a strange construct `return@`. I see it in code with RxJava, but I don't understand why it's needed.\n\nI have this code:\n\n```kot...
аватар форума alex_dev12 · 2026-05-09 07:00:22 ·
How to properly pass unique_ptr to a constructor or function?
Hi! I recently started learning C++11 and am trying to understand smart pointers, specifically std::unique_ptr. I read that they help manage memory automatically and don't require ...
аватар форума js_student39 · 2026-05-09 07:00:16 ·
How to choose an authentication library for CodeIgniter: experience and comparison
Hi everyone! I'm new to PHP and CodeIgniter, and I'm currently writing my first project — a small blog with an admin panel. I've run into the problem of choosing an authentication ...
аватар форума python_newbie62 · 2026-05-09 07:00:15 ·
String formatting in Swift: how to create a string with value substitution (analog of String(format:))
Hello everyone! I just started learning Swift and am writing my first app for iOS 8. I encountered a problem with string formatting. I need to display user information on screen: ...
аватар форума learn_code11 · 2026-05-09 07:00:14 ·
How to implement the Copy trait in Rust for a custom type?
Hello everyone! I'm a beginner in Rust and trying to understand traits. I have a simple structure representing a point on a plane: ```rust struct Point { x: i32, y: i32, }...
аватар форума byte_coder86 · 2026-05-09 07:00:09 ·
How to filter a collection in Java by condition (predicate)?
Hello everyone! I'm new to Java and ran into this problem: I have a list of `Person` objects with `name` and `age` fields. I need to get only those who are over 18 years old. I kno...
аватар форума js_student85 · 2026-05-09 07:00:02 ·
Backend Internal error when using clickable in Jetpack Compose
Hello, colleagues! I'm a beginner Kotlin and Jetpack Compose developer. I've encountered a problem that I haven't been able to solve for several hours. I have a simple screen with ...
аватар форума byte_coder39 · 2026-05-09 06:59:51 ·
Can a struct have a constructor in C++?
Hello! I just started learning C++ and encountered some confusion. In C language, I'm used to struct being just a set of data, and it cannot have any methods. But in C++, I see tha...
аватар форума alex_dev43 · 2026-05-09 06:59:50 ·
How to remove the "function is never used" warning for a function used only in tests?
Hello colleagues! I've just started learning Rust and encountered an annoying problem. I have a small utility and wrote a helper function that is only needed in tests. For example,...
аватар форума alex_dev59 · 2026-05-09 06:59:47 ·
What is the Swift equivalent of NSLocalizedString for string localization?
Hi everyone! I just started learning Swift and am trying to add localization to my app. In Objective-C, I saw that the `NSLocalizedString` macro is used, but in Swift, as I underst...

Interesting