Skip to content

Instantly share code, notes, and snippets.

View shenlebantongying's full-sized avatar

shenleban tongying shenlebantongying

View GitHub Profile
@shenlebantongying
shenlebantongying / cjkpad.c
Last active January 19, 2023 08:05
add space between cjk & other chars
/*
gcc ./cjkpad.c -o cjkpad `pkg-config --libs --cflags icu-uc icu-io` && ./cjkpad
*/
#include <stdio.h>
#include <string.h>
#include <unicode/utext.h>
#include <unicode/ustdio.h>
static UErrorCode err = U_ZERO_ERROR;
language languageLabel iso audios
http://www.wikidata.org/entity/Q150 French fra 245883
http://www.wikidata.org/entity/Q809 Polish pol 84447
http://www.wikidata.org/entity/Q9610 Bengali ben 59964
http://www.wikidata.org/entity/Q33810 Odia ory 51558
http://www.wikidata.org/entity/Q143 Esperanto epo 34315
http://www.wikidata.org/entity/Q1860 English eng 24321
http://www.wikidata.org/entity/Q7913 Romanian ron 19406
http://www.wikidata.org/entity/Q8798 Ukrainian ukr 19084
http://www.wikidata.org/entity/Q1321 Spanish spa 17907
We couldn’t find that file to show.
@shenlebantongying
shenlebantongying / timing_function.py
Created May 11, 2021 02:27
Measure function run time with "with" statement
#!/usr/bin/env python3
import time
class Timer:
"""
A hack to measure function runtime with some hacking
https://preshing.com/20110924/timing-your-code-using-pythons-with-statement/
"""
def __enter__(self):

Linux gui toolkits that is still "usable" today:

TK of Tcl

Swing of Java

EFL of Enlightment (the E desktop, full wayland support)

GNUStep from GNU guru used for objective-C (Wayland support in alpha version)

@shenlebantongying
shenlebantongying / A true free software distro.md
Last active May 9, 2021 04:02
Notes on what a true free software distro should be.

I think a TRUE free software distro must provide easy-to-use tools to fork, modify, replace, and share "system" or "official" software packages.

Even though some distros are open source, but it is hard for a fork to get into the main repository. Forks usually don't have a place for shining. Any package in your system should behave like a git repo: you can branch it easily, and your system still works (providing that your code is correct). When update, your branch stays still.

Debian provides src package to build locally, but it doesn't work very well, because Debian src pkg usually old, and you cannot easily share it efficiently. So, A distro that supports easy forking must update frequently to make sure everything is new without many distro-specific modifications. There should also be a hub to collect all kinds of forks and show statistics about them (like popularity).

The system's base/meta package must have very minimum dependencies so that if you dislike a component, you can choose any alternatives

Right about now, Free Software court is in full effect
Judge Whax presiding
In the case of Free Software vs. the GNOME Foundation;
prosecuting attorneys are: Satoshi, YYY, and ZZ-motherfucking-Z
Order, order, order
Satoshi, take the motherfucking stand
Do you swear to tell the truth, the whole truth
and nothing but the truth so help your nerd ass?
@shenlebantongying
shenlebantongying / Programming Language Checklist.txt
Created March 14, 2021 05:00
Programming Language Checklist
Backup of
https://www.famicol.in/language_checklist.html
Programming Language Checklist
by Colin McMillen, Jason Reed, and Elly Fong-Jones, 2011-10-10.
You appear to be advocating a new:
[ ] functional [ ] imperative [ ] object-oriented [ ] procedural [ ] stack-based
[ ] "multi-paradigm" [ ] lazy [ ] eager [ ] statically-typed [ ] dynamically-typed
@shenlebantongying
shenlebantongying / projectexcalibur.ipynb
Created November 2, 2020 13:46
ProjectExcalibur.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.