3D Interactive Rubik's Cube in Python / Matplotlib
interactive 3D Rubik's cube simulator in python using only matplotlib for all the graphics and interaction. Check out the demonstration here github.com \ davidwhogg \ MagicCube or follow me telegram
Interpreted high-level programming language for general-purpose programming
3D Interactive Rubik's Cube in Python / Matplotlib
interactive 3D Rubik's cube simulator in python using only matplotlib for all the graphics and interaction. Check out the demonstration here github.com \ davidwhogg \ MagicCube or follow me telegram
We developed very fast scientific graphics using matplotlib and python >>source at my x.com/twitter
Confusion with Reddit
I've had a Reddit account since 2016. I only read and posted in the Python forum (1 million subscribers!). Yesterday, I unexpectedly received a shadow ban. This means that my comments and posts are invisible to others. Essentially, it's read-only.
I created several new accounts from different IPs and devices. It turned out that email verification is no longer required. This process takes 15 seconds. On some accounts, I verified the email, but it didn't help. Here's an example of a newly created account without email verification, and it's still active because nothing has been done on it: https://www.reddit.com/user/No-Half8140/
If you have the ability to receive a verification code via email like dff35fghf@hfhlltgf.com, you'll automatically get a free PRO version of the account, which includes advanced statistics and other perks. However, the account remains in a "pre-ban" state.
Upon testing, I found that all new accounts are in this "pre-ban" state. This means you can change your avatar, read, vote, and the accounts are visible when logged out or from a private browser window.
However, attempting to post on your own wall (which automatically appears upon registration), write any comment in any discussion thread (even in /askReddit and /NewToReddit), create a post in any group, invite someone as a moderator to your wall, or follow someone without karma results in an instant shadow ban. The account becomes invisible from a private window and logged-out devices, the avatar turns red, and it cannot be changed.
The symptoms are the same for all IPs and languages (English, Polish, Russian). ChatGPT says that this is how it is now, and a ban is very likely. However, I see some activity in groups about Moscow and St. Petersburg, which means people somehow manage to pass this test... But how?
AI Reddit is going wild!
Fantastic ! Look at >> source code (or take it from my telegram) of the Ping-Pong game prototype on MatPlotLib (scientific graphics on python) with high FPS=40.
Previously, in my >>article on Habr, the application of PyGame for graph plotting was reviewed, and now, conversely, we're creating a game on a system designed for scientific graph plotting. In the previous version, attempting to output text with high FPS resulted in significant "lag"; in the current version, this issue is resolved.
In the code for rendering all game elements, only MatPlotLib objects are used: tennis rackets are represented as bar charts, the ball as a scatter plot, the game field itself as a figure object from MatPlotLib, and text is also output using built-in MatPlotLib functions. For animation, the built-in MatPlotLib Animation object + update() is used. FPS=40 (forty!).
P.S. The yellow bar chart represents the distribution of Y-axis coordinates where the racket hits the ball. It updates with every hit of the racket on the ball.
Python: Using PyGame for real-time visualization of audio signals with a 44100 Hz sampling rate
PyGame is a popular library for developing 2D games in Python. The initial version of PyGame was presented by Pete Shinners in October 2000, and since then, the library has gradually gained popularity due to its ease of use, good documentation, and active community. Initially designed to work with early versions of Python (including Python 2), PyGame was based on the SDL 1 library. SDL is a cross-platform library in C that provides low-level access to audio devices, keyboard, mouse, and graphical functions via OpenGL, DirectX, etc.
The current versions 2.x fully support Python 3 (from 3.7 and above) and include a range of updates, such as improved OpenGL support, hardware acceleration, and the ability to work with vertical synchronization on monitors (VSync).
This article discusses an unconventional application of PyGame - the rapid display of graphs, for example, data streams with a 44100 Hz sampling rate from a sound card, which may be necessary for visualizing audio signals.
For such a task, the following functions and capabilities of PyGame are well-suited:
pygame.display.flip() - quickly updates the screen content after changes
#have been made.
#
Using pygame.time.Clock() - allows you to control FPS,
which enables the system to request updates
at up to 60 frames per second or more, which is
important for displaying signals in real-time.
#
The new vsync flag (for example, passed to set_mode with
the pygame.RESIZABLE or pygame.OPENGL parameter)
can be used to synchronize screen updates with
the display's vertical refresh rate.
The main loop (typical in PyGame):
running = True
while running:
# Обработка событий
# Генерация шума и обновление данных графика
# Очистка экрана
# Отрисовка сетки и графика
# Подсчет и отображение FPS
# Обновление экрана
pygame.display.flip()
clock.tick(FPS)
pygame.quit()
Based on the heated discussions and criticism regarding the slow code and poor FPS in the test for displaying the sin()+noise graph using Python Matplotlib, improvements were made, and AI was employed to refine the code. The original article and code have undergone the following enhancements:
Abandoning the slow text output.
Utilizing FuncAnimation instead of a simple loop.
Implementing the magic command to connect the PyQT backend
As a result, the FPS increased from 12 to 100. For more details,
please refer to the original article. https://habr.com/ru/articles/878002/
Вышел Python 3.13. Что в этом для не знакомых с Python?
Куй железо не отходя от кассы
Иными словами, Вы тут же захотите его попробовать - самое время, это стало (много) приятнее чем когда-либо.
Что делать и кто виноват
Виноват, очевидно, Гугол - запоздал с увольнениями в команде Python. А делать придётся компиляцию из сорцов - даже в AUR сейчас RC1. Как - на примере Arch в форме EndeavourOS.
Python часть системы, но он 12, поэтому 13 нужно держать отдельно. Скачав с python.org и распаковав
./configure --enable-optimizations --with-lto --enable-experimental-jit=yes --prefix=/home/andy/.python
make
Конечно, чего-то да не хватит, но об этом будет чётко сказано, поэтому и например
yay clang
yay llvm
make
Будет чётко сказано чего не получилось, за 12 такого не помню, у меня - без tkinter. Ну и ладненько. Поскольку make test придумали трусы,
make install
~/.python/bin/python3 -m venv Python13Env
cd Python13Env
python
И наслаждаемся новыми фишками - редактируем процедуры и выходим легко, как по мне - самое очевидное. И да, на первом же (дурацком) тесте - на 10% быстрее.
Каково ваше мнение о https://proofcheck.org? Это cmd-инструмент, который позволяет проверять TEX-овые доказательства на математическую (!) корректность. Но на русском статей о нём нет, хотя он прост в использовании и по своему принципу функционирования. Прилагаю также proof-of-concept от авторов: https://tug.org/TUGboat/tb30-2/tb95neveln.pdf
Суть в том, что до этого существовало много proof assistant-ов, но эти предложили принципиально новый стандарт парсинга логики, который уложился в скрипт на питоне. В отличие от семейства HOL, основные идеи которого восходят аж к 1970-м. Я считаю, что нужно популяризировать ProofCheck и в рунете.