HTML Renderers

:: browser, emacs

By: Maciej Barć

How it should be?

I imagine that a web browser should have been a "window" to the Internet world that provides easy and efficient way to graphically access resources exposed by multiple protocols: HTTP(S), (S)FTP, Gopher, Gemini, etc…

How it is?

Only few protocols are supported!

Recently FTP support got "deprecated" in Firefox. It can still be enabled in by setting network.ftp.enabled to true.

FTP support is announced to be completely gone in FF 90.

Chrome dropped FTP some time ago.

BUT!

Luckily we have Emacs!

GNU Emacs has packages to support all kinds of protocols.

  • eww which is a simple HTTP(S) browser like w3m (also renders images)
  • tramp allows you to access files by SSH
  • elpher allows you to access Gemini and Gopher sites (graphically)
  • ange-ftp allows you to connect to FTP servers
  • and finally net-utils which wraps around system utilities to provide interactive mode for many protocols, ie.: gopher, irc, ntp, pop3, www

Awesome Racket language features

:: racket, programming language

By: Maciej Barć

Also see: Fast-Racket at Racket's GitHub Wiki

Creating binaries

You can create portable binaries with Racket's raco command! Use raco exe and raco distribute.

More -> https://docs.racket-lang.org/raco/exe.html

Sample games

Racket provides a executable plt-games, when ran (from console) it opens a menu of miscellaneous games, among them: jewel, minesweeper, aces, spider, checkers. & more (20 games total).

Plots

You can plot data in 2d & 3d forms.

2D

Sample code:

1
2
3
4
5
6
#lang racket/base
(require racket/gui/base racket/math plot)

(plot-new-window? #true)

(plot (function sin (- pi) pi #:label "y = sin(x)"))

3D

Sample code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#lang racket/base
(require racket/gui/base racket/math plot)

(plot-new-window? #true)

(plot3d
 (surface3d (lambda (x y) (* (cos x) (sin y)))
            (- pi) pi (- pi) pi)
 #:title "An R × R → R function"
 #:x-label "x" #:y-label "y" #:z-label "cos(x) sin(y)")

Browser

There's a included library to render web pages, just "(require browser)".

Sample code:

1
2
3
4
#lang racket
(require browser)

(open-url "https://xgqt.gitlab.io/")

FFI

You can use Racket's Foreign Function Interface to interact with non-Racket libraries to make use of very fast libraries written in (mainly) FORTRAN & C.

For example sci uses FFI for CBLAS & LAPACK.

Parallelism

For greater speed up with parallel execution there are futures, places and distributed places (for distributed programming).

Sage Math on Gentoo

:: gentoo, tutorial, mathematics

By: Maciej Barć

Intro

Sage may be available on your distro but on Gentoo such frivolities for students are not there yet, so I had to install it the manual way.

User

I went to the Sage website, to the "download-source" link. The source mirror I picked was France.

Ok, so let's follow Sage Math build instructions and get it going

1
2
3
4
5
wget www-ftp.lip6.fr/pub/math/sagemath/src/sage-9.2.tar.gz
tar xvf sage-9.2.tar.gz
cd sage-9.2
./configure
make

And now, let's wait…

Portage

After a long, long, long time waiting I remembered that there existed a Gentoo overlay for Sage. And in the meantime I thought I'd try that solution instead since some good Gentoo people already did most of the effort.

Just a few files to edit…

File: /etc/portage/repos.conf/sage-on-gentoo.conf

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# -*- conf -*-


[sage-on-gentoo]

auto-sync = yes
location = /var/db/repos/sage-on-gentoo
priority = 999
sync-git-clone-extra-opts = --depth=999999999 --no-shallow-submodules --verbose
sync-git-pull-extra-opts = --verbose
sync-type = git
sync-umask = 022
sync-uri = https://github.com/cschwan/sage-on-gentoo.git
sync-user = root:portage

File: /etc/portage/package.accept~keywords~/zz-sage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# -*- conf -*-


sci-mathematics/sage                    **

*/*::sage-on-gentoo

dev-python/cvxopt

media-gfx/tachyon

sci-libs/bliss
sci-libs/dsdp
sci-libs/fflas-ffpack
sci-libs/fplll
sci-libs/libhomfly
sci-libs/linbox
sci-libs/m4rie

sci-mathematics/glpk

File: /etc/portage/package.use/zz-sage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# -*- conf -*-


sci-mathematics/sage                    -doc-html -doc-html-bin
sci-mathematics/sage                    -doc-pdf -doc-pdf-bin
sci-mathematics/sage                    -jmol
sci-mathematics/sage                    X bliss meataxe

dev-python/pplpy                        doc

sci-libs/cddlib                         tools
sci-libs/pynac                          -giac

sci-mathematics/eclib                   flint
sci-mathematics/flint                   ntl
sci-mathematics/glpk                    gmp
sci-mathematics/gmp-ecm                 -openmp
sci-mathematics/lcalc                   pari
sci-mathematics/maxima                  ecls
sci-mathematics/pari                    gmp doc

Now - let's build Sage with Portage!

>>> Emerging (1 of 100) sci-mathematics/cliquer–1.21::gentoo

At least I know more or less how long I'm going to wait and know what exactly fails to build, if anything does.

Final

Build

$ qlop -tv sage

> 2021–03–23T20:49:12 >>> sci-mathematics/sage–9999: 55′04″

Git stats

Overlays

This info we can easily gather with executing:

1
emerge --info

Gentoo' HEAD: 33f2d770c28307b1e9a1199c681e1c543602c6d4

Sage-on-Gentoo's HEAD: f7eac5b7e1a844132164b7593dab85cd87918664

Sage

Sage repository's HEAD (because we are using the live (9999) ebuild):

1
cat /var/cache/distfiles/git3-src/sagemath_sage.git/refs/heads/develop

Which returns: 5cb72aade9b297c10bb0f1ae8529466e5b5eb41d

MTG alter-art collection

:: art, card games, games, mtg

By: Maciej Barć

Story

In 2013–2017 I was very interested in Trading card game “Magic: the Gathering”. I started playing during the release of Theros and quit somewhere during Shadows over Innistrad. I still keep a small collection of alternative artwork that I have painted on the cards.

Binder

Those are pages from the binder I store the card in. Also a lone “Obsession” resource card from The Spoils.

Cards

This list is sorted by the time I created the alter-art. I do this from memory so it’s probably not accurate.

Mastodon

:: fediverse

By: Maciej Barć

I has decentralization

So, yea, I’m on Fosstodon. https://fosstodon.org/@xgqt

Hope I don’t get banned ;^)

But in all seriousness, it’s been pretty great. My colleagues warned me that there’s a lot of SJWs but only one person I spoke with wanted to be addressed “differently” + didn’t express that aggressively, so whatever.

Se yall on mastodon ;D

How to read this blog

:: git, rss

By: Maciej Barć

Git

Because contents of this blog are stored in a git repository you can just

1
git clone --verbose --recursive https://gitlab.com/xgqt/blog

then, read the "raw" ORG files in 'posts' directory or make the HTML version executing the 'dev.sh' script (remember that you will need GNU Emacs to render the posts into HTML files).

Then, you can just git pull to read the news whenever you wish, maybe do it with cron or a script that will pull many repos at once, for example with this script.

RSS

Org-Static-Blog creates a RSS Feed file rss.xml, so to subscribe add the link https://xgqt.gitlab.io/blog/rss.xml to your favorite RSS reader.

You can also subscribe to the GitLab repository Atom feed.

EmojiD

:: joke

By: Maciej Barć

Short story long

We were discussing some vulnerabilities on the src~prepare~ group's [matrix] channel and when we're talking about systemd errors. I just felt like opening their GitHub and browsing the code. I was just reading the comments… and I saw a comment about kernel APIs and there a emoji. My feeling is probably best expressed my common "KEK". I chuckled. The "Abstract" in 0.0.1 is the original idea I typed on [matrix]. The funniest part of this "development" for me is probably that Emacs on my system doesn't display properly ANY of the emojis in emojid. I had to go back and forth between the source and log files opened in FF (because it renders the emojis properly), emojipedia and "broken" Emacs.

0.0.1 "😃 ️ 🌍 🍞 🚗 📞 🎉 ♥️ 🏁"

What you do is clone the repository, execute make and run the binary. Read your log and see if your system is "affected" :P.

👋

And remember emoticons made of the symbols found on the keyboard will always look better ;)