Pull to refresh
256K+

Python *

Interpreted high-level programming language for general-purpose programming

375,91
Rating
Show first
Rating limit
Level of difficulty
Format

START: how to defeat hallucinations and teach LLMs accurate calculations

Level of difficultyEasy
Reading time3 min
Reach and readers12K

START is an open-source LLM designed for precise calculations and code verification. It addresses two major issues that most standard models face: hallucinations and errors in multi-step calculations. This article explains why these problems arise and how START solves them.

Read more

Docling in Working with Texts, Languages, and Knowledge

Level of difficultyMedium
Reading time20 min
Reach and readers14K

DocLing in Working with Texts, Languages, and Knowledge — an in-depth overview of the open-source DocLingtoolkit for extracting, structuring, and analyzing data from documents. The article covers approaches to processing multilingual texts, building language- and domain-specific knowledge models, and integrating DocLing into AI and NLP projects. Includes practical examples and recommendations for developers working with large volumes of unstructured data.

Read more

Google ADK: Easiest Way to Build an AI Agent

Level of difficultyEasy
Reading time7 min
Reach and readers8.1K

In this tutorial, I’ll explain in simple terms what AI, AI agents, and workflows are, and then I’ll walk you through building your very first AI agent in Python using Google’s Agent Development Kit (ADK). By the end, you’ll understand the differences between these concepts and have a working content-assistant agent you can run from your terminal or a web interface.

Read more

Top Web Parsers and API Services for Data scraping: A Comparison of Speed, Scalability, and Bypassing Protections

Level of difficultyEasy
Reading time22 min
Reach and readers4.7K

Automatic data scraping (parsing) has become an essential practice for developers, analysts, and automation specialists. It is used to extract massive amounts of information from websites—from competitors’ prices and reviews to social media content. To achieve this, numerous “scrapers” have been developed—libraries, frameworks, and cloud services that enable programmatic extraction of web data. Some solutions are designed for rapid parsing of static pages, others for bypassing complex JavaScript navigation, and yet others for retrieving data via APIs.

In this article, I will review the top scraping tools—both open source libraries and commercial SaaS/API services—and compare them according to key metrics: • Speed and scalability; • Ability to bypass anti-bot protections; • Proxy support and CAPTCHA recognition; • Quality of documentation; • Availability of APIs and other important features.

Read more

3D Interactive Rubik's Cube in Python / Matplotlib interactive 3D Rubik's cube simulator in python using...

Reading time1 min
Reach and readers15K

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

Читать дальше →

Confusion with Reddit I've had a Reddit account since 2016. I only read and posted in the Python forum (1 million...

Reading time2 min
Reach and readers11K

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.

Читать дальше →

Fantastic ! Look at >> source code (or take it from my telegram) of the Ping-Pong game prototype on MatPlotLib...

Reading time1 min
Reach and readers8.7K

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...

Reading time2 min
Reach and readers12K

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:

Читать дальше →

Based on the heated discussions and criticism regarding the slow code and poor FPS in the test for displaying the...

Reading time1 min
Reach and readers12K

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:

Читать дальше →

The State of Caravel: the First Look [Мучения в проектировании чипов из-за Докера и Питона]

Reading time47 min
Reach and readers4.8K

Написал лонгрид на английском о текущем состоянии открытых средств проектирования ASIC-ов. Заодно познакомил англоязычных читателей с практиками шаманов Сибири и фигурой Ивана Сусанина. Упомянул планируемые семинары в Мексике и Армении.

A text on the current state of Open-source ASIC design tools. Includes side discussions of the upcoming hackathons in Mexico and Armenia, Docker and Python, Static Timing Analysis and RISC-V, Siberian shamans and treacherous swamps in Belarus.

Read more

Google Keyword Scraping: A Detailed Guide to Building a Free Google Scraper

Level of difficultyEasy
Reading time8 min
Reach and readers3.4K

Any SEO expert knows the pain of collecting Google keyword data. It’s one thing if you can count all the queries on one hand, but what if they number in the thousands? How do you check the search volume in Google for each keyword? Frankly, once you hit tens of thousands of keywords, it’s enough to make your head spin. You’ll be tempted to reach for outdated, familiar tools, only to find modern reality throwing a curveball: the old formula of Key Collector + Google Ads + a few proxies simply doesn’t cut it anymore. We’re entering a new era, and without direct access to the official API, things get grim and complicated fast.

Read more

The Implicit Reparameterization Trick in Action: Python Library for Gradients Computation

Level of difficultyMedium
Reading time3 min
Reach and readers2.2K

The explicit reparameterization trick is often used to train various latent variable models due to the ease of calculating gradients of continuous random variables. However, due to its peculiarities, explicit reparameterization trick is not applicable to several important continuous standard distributions, such as mixture, Gamma, Beta and Dirichlet.

An alternative method for calculating reparameterization gradients relies on implicit differentiation of cumulative distribution functions. The implicit reparameterization trick is much more expressive and applicable to a wider class of distributions

This article provides an overview of various reparameterization tricks and announces a new Python library, irt.distributions, for sampling from various distributions using the implicit reparameterization trick.

Read more

Python Clean Code: Stop Writing Bad Code — Lessons from Uncle Bob

Level of difficultyEasy
Reading time4 min
Reach and readers17K

Are you tired of writing messy and unorganized code that leads to frustration and bugs? You can transform your code from a confusing mess into something crystal clear with a few simple changes. In this article, we'll explore key principles from the book "Clean Code" by Robert C. Martin, also known as Uncle Bob, and apply them to Python. Whether you're a web developer, software engineer, data analyst, or data scientist, these principles will help you write clean, readable, and maintainable Python code.

Read more

From Scratch to AI Chatbot: Using Python and Gemini API

Level of difficultyEasy
Reading time3 min
Reach and readers4.7K

In this article, we are going to do something really cool: we will build a chatbot using Python and the Gemini API. This will be a web-based assistant and could be the beginning of your own AI project. It's beginner-friendly, and I will guide you through it step-by-step. By the end, you'll have your own AI assistant!

Read more

Building blocks in programming languages

Level of difficultyMedium
Reading time5 min
Reach and readers1.7K

Practically all programming languages are built either on the principle of similarity (to make like this one, only with its own blackjack) or to realize some new concept (modularity, purity of functional calculations, etc.). Or both at the same time.


But in any case, the creator of a new programming language doesn't take his ideas randomly out of thin air. They are still based on his previous experience, obsession with the new concept and other initial settings and constraints.


Is there a minimal set of lexemes, operators, or syntactic constructs that can be used to construct an arbitrary grammar for a modern general-purpose programming language?

Read more →