B4J Code Snippet [PyBridge] Non-linear regression with SciPy - Erel    May 13, 2025   (9 reactions) https://www.b4x.com/basic4android/images/java_XLOnwdMrvc.gif New implementation similar to: https://www.b4x.com/android/forum/threads/playing-with-linear-regression.110759/#content Using SciPy (https://www.b4x.com/android/forum/threads/pybridge-finding-local-minimum-of-a-function-with-scipy.166881/#content) to find the best fit function parameters. It is based on scipy.optimize.curve_fit which takes as an input a function and X and Y values, and tries to find the parameters that minimize... B4J Code Snippet [PyBridge] Finding local minimum of a function with SciPy - Erel    May 5, 2025   (14 reactions) SciPy is a very powerful scientific library with a vast range of features: https://scipy.org/. This code snippet provides a tiny glimpse to this library. Imports: pip install scipy pip install matplotlib It uses the optimize module to find a local minimum of a n-dimension function. First example: Dim func As PyWrapper = Py.Lambda("x: (x - 3) ** 2 + 2 * x - 1") '** is the power op... B4J Tutorial [PyBridge] Text to speech with Pocket TTS - Erel    Jan 14, 2026   (12 reactions) https://github.com/kyutai-labs/pocket-tts "A lightweight text-to-speech (TTS) application designed to run efficiently on CPUs. Forget about the hassle of using GPUs and web APIs serving TTS models. With Kyutai's Pocket TTS, generating audio is just a pip install and a function call away." 169366 Using it is quite simple and the results are good. The dependencies and models are qui... B4J Library [PyBridge] Docling - parse and convert many types of documents - Erel    Jan 11, 2026   (10 reactions) This is a small example, that uses the open source Docling project to convert various file types, including OCR features, to html. https://docling-project.github.io/docling/ Supported formats: https://docling-project.github.io/docling/usage/supported_formats/ https://www.b4x.com/basic4android/images/java_s70Lty3L7u.gif Docling is a large library. It requires VC++ 14 toolchain to be installed: ... B4J Code Snippet [PyBridge] Create pdf with fpdf2 - Erel    Mar 26, 2025   (13 reactions) https://py-pdf.github.io/fpdf2/index.html
This is a console app, based on the console template: Co... B4J Tutorial [PyBridge][server] Using PyBridge in web apps - Erel    Mar 16, 2025   (11 reactions) PyBridge must be accessed from a single thread. In server solutions, each handler runs in its own thread so we need to add some barriers to ensure proper usage. The way to implement it is by adding a background worker dedicated to PyBridge. Other handlers make requests to this worker using CallSubDelayed and the worker responds with CallSubDelayed as well. This way the correct thread handles each part of the task. The attached example, uses python ascii magic (https://github.com/LeandroBarone... B4J Library [PyBridge] Console (non-ui) project template - Erel    Mar 12, 2025   (10 reactions) Simple template for console apps. There is an assumption that the global Python will be used. Put in the additional libraries folder. 162491 Right click inside the libraries tag and choose refresh.... B4J Code Snippet [PyBridge] Windows 10/11 notifications - Erel    Mar 12, 2025   (14 reactions) 162485 Based on: https://github.com/GitHub30/win11toast Many options. Install: pip install win11toast Code: Private Sub ShowNotification(Title As String, Body As String, AppId As String) As PyWrapper Dim toast As PyWrapper = Py.ImportModuleFrom("win11toast", "toast") Return toast.Call.Arg(Title).Arg(Body).ArgNamed("app_id", AppId) End Sub Private Sub Show... B4J Tutorial [B4X] [PyBridge] Desktop - Mobile Communication based on BLE (Bluetooth Low Energy) - Erel    Mar 9, 2025   (9 reactions) : https://www.b4x.com/android/forum/threads/pybridge-bleak-bluetooth-ble.165982 And B4J v10.2 beta #4... B4J Code Snippet [PyBridge] Visualization of hierarchical data with Plotly - Erel    Jul 29, 2025   (10 reactions) /android/forum/threads/pybridge-server-online-charts-with-plotly.167983/... Page: 1   2   3   4   5   6   7   |