Advanced

Great feature - let's play with it

Story: LXer now speaks MarkdownTotal Replies: 7
Author Content
linuxguru

Oct 29, 2026
5:10 AM EDT

As a software engineer, I find the history of markup languages fascinating—it's essentially the evolution of abstraction layers. I've performed a quick "formal verification" of the efficiency gains provided by this update:


Analysis of Syntactic Overhead

If we define E as the cognitive effort required to author a post, and S as the syntactic density (tags per character), we can model the transition from the "Old Regime" (BBCode/HTML) to the "New Regime" (Markdown) as follows:

\lim_{S \to 0} \text{Readability}(E) = \infty

Where the complexity of maintaining a readable plain-text version of the post is minimized. In the old system, the overhead was often non-linear:
E_{\text{BBCode}} \approx \sum_{i=1}^{n} (\text{content}_i + \text{tags}_i) \gg E_{\text{Markdown}}

Comparative Complexity Matrix

Metric BBCode / HTML Markdown + LaTeX
Verbosity \mathcal{O}(n^2) \mathcal{O}(n)
Human Readability Low (Tag heavy) High (Clean)
Mathematical Precision \approx 0 \approx 1
Parsing Overhead High Minimal

Implementation Test Case

I ran a quick check on the parser's ability to handle standard Unix-style input within the new block:

# Testing the integration of Markdown within the LXer ecosystem
if [[ "$EDITOR" == "Markdown" ]]; then
    echo "Efficiency increased."
    uptime | awk '{print "System Load: " $1}'
else
    echo "Regression detected."
fi
tuxgirl

Oct 29, 2026
5:17 AM EDT

Someone call a debugger, we've got a math professor in the comments! 🤓 All those \sum symbols and limits... are you trying to calculate the efficiency of the post or just trying to make my brain crash? Go touch some actual grass (and not just the ~/grass directory)!

But hey, since we're all playing with the new toys, I might as well use them.

The Plain Text Way

A kernel robust, a penguin so bold,
In stories of Linux, the legends are told.
No more heavy tags, no more HTML mess,
Just Markdown and magic, we must all confess.

With *asterisks* and **bold** to play,
LXer shines brighter in a brand new way.
From the bash command to the math in our heart,
It's a beautiful, plain-text, open-source art.

Love the new update! 🐧✨

gus3

Oct 29, 2026
11:08 AM EDT

tuxgirl wrote:

are you trying to calculate the efficiency of the post or just trying to make my brain crash?

Um... yes?

penguinist

Oct 29, 2026
2:45 PM EDT

tuxgirl wrote:

Love the new update! 🐧✨

Very cool. Where did you get those emojis?

tuxgirl

Oct 29, 2026
3:16 PM EDT

@penguinist

There is a "Symbols and emoji" icon on the editor toolbar. It looks like \Omega. Click on that and the Tux icon is first in the list (of course it is first).

PythonPete

Oct 29, 2026
8:50 PM EDT

Ok, since we are playing with this new toy, let's try this with some code. Here is something fun, a mandelbrot set with an interesting end point.

Copy this code to a file like mandel.py and run it with python mandel.py. Have fun!

🐍 PythonPete 🐍

import time
import sys

def mandelbrot_zoom(total_frames):
    chars = "@#W$9876543210?!abcdeFGABCDE"
    center = complex(-0.743643887, 0.1318259)
    scale, max_iter = 2.0, 50 
    
    try:
        # The loop runs for a fixed number of iterations provided by the user
        for frame in range(total_frames):
            sys.stdout.write("\033[H\033[J")
            lines = []
            
            for y in range(40):
                im = center.imag + (y/40 - 0.5) * scale
                row = ""
                for x in range(80):
                    re = center.real + (x/80 - 0.5) * scale * 2.0
                    c, z, n = complex(re, im), 0j, 0
                    while abs(z) <= 2 and n < max_iter:
                        z = z*z + c
                        n += 1
                    idx = int((n / max_iter) * (len(chars) - 1))
                    row += chars[idx]
                lines.append(row)
            
            sys.stdout.write(f"Frame: {frame+1}/{total_frames}\n" + "\n".join(lines) + "\n")
            sys.stdout.flush()
            
            scale *= 0.98 
            time.sleep(0.03)
            
        print("\n[!] Sequence complete. Zoom finished.")
            
    except KeyboardInterrupt:
        print("\n[!] Zoom halted by user (Ctrl+C).")

if __name__ == "__main__":
    # Use the first command line argument as the number of frames. 
    # Default to 300 if no argument is provided.
    try:
        frames_to_run = int(sys.argv[1]) if len(sys.argv) > 1 else 300
        mandelbrot_zoom(frames_to_run)
    except ValueError:
        print("Usage: python mandel.py [number_of_frames]")
tuxgirl

Oct 31, 2026
2:59 PM EDT

PythonPete wrote:

Here is something fun, a mandelbrot set with an interesting end point.

I ran it and it was fun, but I'd like to see that implemented in full graphics and with an infinite depth while staying centered on an edge.

PythonPete

Nov 01, 2026
9:16 AM EST

tuxgirl wrote:

I ran it and it was fun, but I'd like to see that implemented in full graphics and with an infinite depth while staying centered on an edge.

I'll accept that challenge tuxgirl. Yes, it’s possible to do what you ask. Here is mandel_deep.py with 74 lines, uses only numpy and pygame, and opens a full-color window that zooms with no end. Run it with python mandel_deep.py [speed] where speed defaults to 0.03 (the \log_2 of zoom per frame). Esc quits or just close the window.

#!/usr/bin/env python3
"""Endless Mandelbrot zoom, in a window, into a point that lies exactly on the boundary.
Usage: python mandel_deep.py [zoom_speed]      (Esc or close window to quit; needs numpy, pygame)
The centre is a Misiurewicz point c0: its orbit lands exactly on a repelling cycle, so c0 is on
the boundary and its reference orbit Z_n is known in plain floats forever. The first N
iterations of every pixel are replaced by z_N = Z_N + a_N*dc (a_n = dz_n/dc, kept as
mantissa*2^exponent), so frame cost stays flat while the depth passes 1e-308 and keeps going."""
import sys, math
import numpy as np
import pygame

W, H, EXTRA = 800, 600, 400          # window size, iterations computed after the skip
SPEED = float(sys.argv[1]) if len(sys.argv) > 1 else 0.03   # log2 of zoom per frame
GUESS, PRE, PER = complex(-0.1011, 0.9563), 4, 1            # M(4,1): 3-armed spiral

def misiurewicz(c):                  # Newton on z_{PRE+PER}(c) - z_PRE(c) = 0
    for _ in range(60):
        z, dz, zs, dzs = 0j, 0j, [], []
        for _ in range(PRE + PER + 1):
            zs.append(z); dzs.append(dz)
            z, dz = z * z + c, 2 * z * dz + 1
        c -= (zs[-1] - zs[PRE]) / (dzs[-1] - dzs[PRE])
    return c, zs

def Zn(Z, n):                        # reference orbit: preperiod, then the cycle forever
    return Z[n] if n < PRE else Z[PRE + (n - PRE) % PER]

def skip(t, Z):                      # largest N with |a_N * 2^-t| < 1e-6, and b = a_N * 2^-t
    m, e, n = 0j, 0, 0               # a_n = m * 2^e
    while True:
        m2 = 2 * Zn(Z, n) * m + 2.0 ** -e
        f = math.frexp(abs(m2))[1]
        m2, e2 = m2 * 2.0 ** -f, e + f
        if abs(m2) * 2.0 ** (e2 - t) > 1e-6:
            return n, m * 2.0 ** (e - t)
        m, e, n = m2, e2, n + 1

def render(t, c0, Z, w):
    N, b = skip(t, Z)
    z = (Zn(Z, N) + b * w).ravel()
    c = (c0 + 2.0 ** -t * w).ravel()  # offset underflows to 0 when deep; harmless by then
    idx, mu = np.arange(z.size), np.full(z.size, np.nan)
    for k in range(EXTRA):
        z = z * z + c
        out = z.real * z.real + z.imag * z.imag > 1e6
        if out.any():                # smooth (continuous) escape count, then drop escapees
            mu[idx[out]] = N + k + 1 - np.log2(np.log(np.abs(z[out])))
            idx, z, c = idx[~out], z[~out], c[~out]
        if idx.size == 0:
            break
    x = 2 * np.pi * np.nan_to_num(mu) / 32   # linear in total count: stays continuous as N grows
    rgb = 0.5 + 0.5 * np.cos(x[:, None] + np.array([0.0, 2.1, 4.2]))
    rgb[np.isnan(mu)] = 0            # never escaped: treat as inside
    return N, (255 * rgb).reshape(H, W, 3).astype(np.uint8)

def main():
    c0, Z = misiurewicz(GUESS)
    y, x = np.mgrid[0.5:-0.5:H * 1j, -W / H / 2:W / H / 2:W * 1j]
    w = x + 1j * y                   # pixel offsets in units of the view height
    pygame.init()
    screen, clock, t = pygame.display.set_mode((W, H)), pygame.time.Clock(), -math.log2(3)
    while True:
        for ev in pygame.event.get():
            if ev.type == pygame.QUIT or (ev.type == pygame.KEYDOWN and ev.key == pygame.K_ESCAPE):
                return pygame.quit()
        N, img = render(t, c0, Z, w)
        pygame.surfarray.blit_array(screen, img.swapaxes(0, 1))
        pygame.display.set_caption(f"Mandelbrot  view height 10^-{t * math.log10(2):.1f}  skip N={N}")
        pygame.display.flip()
        t += SPEED
        clock.tick(60)

if __name__ == "__main__":
    main()

Have fun!


Post a reply to this thread:

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post