12466
Offtopic group for casual talking about anything. @rules_for_python still apply (except for the ontopic rule)
Nice work and good for you! Surely some will find the time to read!
Читать полностью…
If you know any programming language, you can start using those Data Structures you learned instead of just consuming information or knowledge. What do you know so far?
Читать полностью…
maybe you'd take some practice on codewars before further learning
Читать полностью…
if you mean to get used to common data structure concepts and not only to use them
Читать полностью…
It could help yes. My personal experience is that my study partners always quit and I end up having to finishing it alone anyway
Читать полностью…
Hello everyone
how much will it cost for a website for a learning center
single page with language switcher without backend
most programs embedding it don't care for sandboxing it so that's why probably
Читать полностью…
This was my experience building a Python-based solution to run Mermaid.js code. In the end, it turned into the MermaidX package – which even caught the attention of the Doxygen maintainer (he was opening issues on my repo!).
Sorry for making it so long, I know I went overboard 😅
Hope you found it useful.
From a simple idea to becoming a core programming infrastructure – the story of MermaidX.
Back in 2014, a JavaScript library called MermaidJS was born. It was basically a new pseudo-code language for generating engineering diagrams. It supported all kinds of charts, and you could draw beautiful diagrams with almost zero effort. It got so popular that it even made its way into the Markdown spec, and platforms like GitHub started supporting it natively. You can check out the live demo here:
https://mermaid.live/
But it had one major flaw: heavy reliance on JavaScript and the browser. To run, it absolutely needed access to the browser's DOM. What's the problem with that? Well, in a lot of use cases, we actually need a CLI that works on servers or headless environments. The official repo does provide something called mermaid-cli, but it's stuck in the Node.js/npm ecosystem and uses Puppeteer – which installs a full Chromium browser on your system, eats up hundreds of MBs of memory, and causes all sorts of trouble on headless/graphics-less servers.
Personally, I really didn't want to install Node at all. I wanted everything to live inside the Python ecosystem. Unfortunately, Python didn't have any clean, straightforward solution for this.
So, I wrote my first package called Phasma. I bundled a fully headless PhantomJS browser inside it and gave it a Playwright-like API (similar to Microsoft's Playwright). The coolest part? The wheel file for my Phasma package was only about 20MB – with the browser included! Meanwhile, the official Playwright package is 45MB without any browser. This solved a huge chunk of the problem, and I was able to create my own mmdc package in Python.
But there was a catch: because PhantomJS was outdated, it couldn't support Mermaid.js v8 and above. At first, I thought about writing a lightweight, super-fast browser from scratch. Then I realized that using a full browser for this was actually total overkill. All I really needed was a minimal DOM environment to generate the SVG output – not to take screenshots. I could just use a separate package to convert the SVG to PNG later.
So, in the new version, I completely ditched the browser approach. Instead, I used a lightweight JavaScript engine called QuickJS. I rebranded the whole thing and named it MermaidX. Later on, I added even more backends, including one fully written in Rust that's incredibly fast and runs without executing any JavaScript at all. Right now, MermaidX supports 4 different backends, and its total size ranges from 5MB to 25MB, depending on which optional dependencies you install.
Now here's where things got really interesting. Out of nowhere, the maintainer of the super popular Doxygen library started opening issues on my repo – almost 5 to 6 per day! In one of the issues, I jokingly told him that his speed at opening issues was way faster than my speed at fixing them. He then introduced himself and said he was actually evaluating MermaidX (from the Python ecosystem) to replace the official mermaid-cli for Doxygen, because he personally prefers Python over Node.
Honestly, that felt incredible. From a simple side idea, my work is slowly turning into a core infrastructure tool – maybe even surpassing the original one day. It's a really sweet feeling.
I just wanted to share this experience with you all. If you found it interesting or useful, I'd really appreciate a star on the repo:
https://github.com/mohammadraziei/mermaidx
https://github.com/mohammadraziei/phasma
I'm interested as well. I've worked through Grokking Algorithms (a bit oversimplified), Algorithms, 4th Edition (pretty balanced), and Introduction to Algorithms, which requires the strongest math background and isn't organized in a beginner-friendly progression.
Читать полностью…
pylings, afaik, unfortunately cannot provide progressive experience like rustlings,, and the quiz are way too abstract than emulated "real problem" in codewars
Читать полностью…
sometimes I get lost in my learning because cs and programming contains so much info and concepts
Читать полностью…
Any one interested in joining me unto data structures and algorithms in python
Читать полностью…
I just get emotional sometimes. If you haven't seen, he was promoting his "unban" services.
Читать полностью…
That's reasonable, as sandboxing may cause ~ half of exising ecosystem non available
Читать полностью…
I would just load it as WASM if you need sandboxing.
Check out PyOdide
https://pyodide.org/en/stable/