Japanese Speaker. I can read/write some English but not well, so corrections are always appreciated.
プログラミングや音楽に興味があります。いまはkbinのソースやActivityPubの仕様を読んだりしています。
One of the reasons is it makes moderation (including soft moderation by users like downvotes or reports) harder. Users not familiar with Japanese can’t decide whether the post follows the rule and is on topic.
Thanks for the clarification. I switched from Xfce4 to GNOME many years ago because the former doesn’t support Wayland at that time, but I still miss the manual quarter tiling with the shortcut keys.
IIRC Xfce4 supports quad manual tiling like that.
Strong focus on privacy and security (all authentication with the Lemmy API is done through secure httpOnly cookies, user IP addresses are not leaked to external image hosts, etc)
Awesome. The current lemmy-ui sends a lot of traffic to other Lemmy instances to get pictrs-cached images, so this is huge improvement. On the other hand, on next.lemm.ee those requests seems to be gone. As feedback, I noticed this page still seems to send a request to imgur, and the text is difficult to read because of the low-contrast theme. (edit: fixed and now completely readable. thank you @[email protected] )
If I understood correctly, the first match
expression doesn’t take the ownership of the prev_data.kind
because the prev_data.kind
is a place expression:
https://doc.rust-lang.org/stable/reference/expressions.html#place-expressions-and-value-expressions
A place expression is an expression that represents a memory location.
https://doc.rust-lang.org/stable/reference/expressions/match-expr.html#match-expressions
When the scrutinee expression is a place expression, the match does not allocate a temporary location; however, a by-value binding may copy or move from the memory location.
I’m not sure what “a by-value binding may copy or move from the memory location” does mean, but I beleive no allocation means no move.
For the second match
, move happens. The tuple (prev_data.kind, new_data.kind)
tries
to take an ownership of the prev_data.kind
, but the prev_data
is
(borrowed from the vec
data
), so the tuple can’t take the ownership.
Oh I didn’t know the book is freely available under the CC license; I bought the Japanese translated version just a week ago. The book is quite difficult for me but the first chapter was very good read.
Can you run another distro on VirtualBox? (vanilla Fedora, Debian, Arch, etc.)
Oh I was completely wrong. cmp()
takes a number (not Ordering) and returns Ordering. Sorry for bothering you.
The Enum Ordering
provides compile-time safety. For example, if cmp() takes a string or int, the compiler can’t catch invalid inputs (“less”, “equal”, -123, …) at compile time and crash at runtime.
I think it’s a really good candidate for code reading for understanding how Lemmy API client works. I’d try to write some toy program with the crate in this week.
I think you’re right. In CGI, web server spawns a process for each incoming request to the CGI app, so the author provide static files for visitors to reduce the overhead.
Edit: here is the repository: https://codeberg.org/seppo/seppo and written in OCaml, so the single file CGI app is a compiled binary.
Hosting Lemmy instances on a localhost has these advantages: 1) no TLS required (right?), 2) can sniff the network traffic between the instances, 3) can change codes and settings of the all instances without asking to anyone, and more importantly, 4) no maintance cost. But if someone want to learn Web app deployment (TLS certs, hosting, etc.), your option would be a good idea.
For learning real Lemmy stuff, I’d run multiple Lemmy instances on LAN without internet connection to ensure the testing won’t pollute the fediverse.
Hi, thanks for setting up this community. I’m not a Lemmy source contributer but I like to read open sources. Here is a very simplified web application (including Lemmy) architecture overview and I hope this text helps for some newbies:
To find an controller from a path in the router, just grep (or a similar search function you use) the Lemmy source. For example, if I want to know how GET /user/export_settings
works, I’ll run these commands:
$ git clone https://github.com/LemmyNet/lemmy/ # if you haven't download the source yet
$ cd lemmy
$ rg export_settings
src/api_routes_http.rs
131: user_settings_backup::{export_settings, import_settings},
274: web::resource("/user/export_settings")
276: .route(web::get().to(export_settings)),
crates/apub/src/api/user_settings_backup.rs
68:pub async fn export_settings(
301: use crate::api::user_settings_backup::{export_settings, import_settings};
366: let backup = export_settings(export_user.clone(), context.reset_request_count()).await?;
402: let mut backup = export_settings(export_user.clone(), context.reset_request_count()).await?;
So we got the relevant route and the controller definitions very quickly. Settings to be exported are defined as a struct UserSettingsBackup
. The controller is defined as pub async fn export_settings
and it converts the struct to a JSON.
Rust might not be a easy programming language but the official text (calld The Book is very friendly for newbies, so don’t hesitate to read and to write a simple program like guessing game.
Some applications can’t display some Unicode strings like s̵t̵r̵o̵k̵e̵, so replacing Markdown element like
~strike~
with Unicode equivalent (s̵t̵r̵o̵k̵e̵ ) may not be a good idea if you want portability. I opened your post in text editors and noticed that neovim-qt drops s̵t̵r̵o̵k̵e̵’s combining characters (issue on Github) and just displays stroke instead of s̵t̵r̵o̵k̵e̵; GUI Emacs with my font settings (Noto) doesn’t combine the characters and displayss-t-r-o-k-e-
(as I said, this may depends on font settings).