~cnx

Ulsan, South Korea

https://cnx.gdn

Vietnamese free software enthusiast

Join the FSF

~cnx/misc

Last active 22 days ago

~cnx/loang

Last active a month ago

~cnx/blackshades

Last active 4 months ago

~cnx/ipwhl-discuss

Last active 6 months ago

~cnx/ipwhl-announce

Last active 1 year, 2 months ago

~cnx/ipwhl-devel

Last active 1 year, 3 months ago

~cnx/site

Last active 1 year, 8 months ago

~cnx/tzigame

Last active 1 year, 10 months ago

~cnx/palace

Last active 2 years ago

~cnx/nwsim

Last active 2 years ago
View more

Recent activity

Warn on uncrypted reply to encrypted message 10 days ago

From Nguyễn Gia Phong to ~rjarry/aerc-discuss

Inspired by true events [*] and referencing 7647dfb8b47e
(compose: warn before sending without attachment),
it might be a good idea to warn before sending
an unencrypted response to an encrypted email.

It'd also be useful to have TOFU opportunistic E2EE
as supported by gpg --auto-key-locate as an option.
What do y'all think?

[*] https://larkspur.one/notice/AZe4NEropKpMrSgN3Q

Re: [PATCH fead v2] Add option to skip errors 22 days ago

From Nguyễn Gia Phong to ~cnx/misc

On 2023-08-30 at 14:39+07:00, Huy wrote:
> On 2023-08-30 11:42, Nguyễn Gia Phong wrote:
> > Would be nice if thou canst come up
> > with something less ironic than ErrorWarning but I can rename it
> > before application.
>
> How about FailureWarning huh? I already uses "fail" in the previous 
> phrase.

Eh I have a very curesed idea of extracting the name from the exception.
I will implement the magic once I get home.

On 2023-08-30 at 14:39+07:00, Huy wrote:
> (resent because previous one was not plain text and not delivered)

Re: [PATCH fead v2] Add option to skip errors 22 days ago

From Nguyễn Gia Phong to ~cnx/misc

> -async def fetch_all(urls):
> +async def fetch_skip_error(url):
> +    try:
> +        return await fetch(url)
> +    except Exception as e:
> +        warn(f'fail to fetch {url}: {e}', type('ErrorWarning', (Warning,), {}))

Please return None explicitly.  Would be nice if thou canst come up
with something less ironic than ErrorWarning but I can rename it
before application.

> +async def fetch_all(urls, skip_error):
>      """Fetch all given URLs asynchronously and return them parsed."""
> -    tasks = gather(*map(fetch, urls))

Re: Array or Slice of [_]u8{...} 25 days ago

From Nguyễn Gia Phong to ~andrewrk/ziglang

On 2023-08-27 at 10:58+02:00, Peter Bridge wrote:
> const step1:[]u8 = &[_]u8{1,2,3,4};
> 
> Anyway a slice is a pointer to an array that I would no longer have a 
> reference to?? So even if it works it feels wrong...

I am not sure if there's a more concise way to write this,
but I'd go with something like

const step1 = [_]u8{1,2,3,4};
const step2 = [_]u8{1,2,3,4,5,6,7,8};
const sequence1 = [_][]u8{ step1[0..], step2[0..] };

Re: []u8{...} formatting escapes? 28 days ago

From Nguyễn Gia Phong to ~andrewrk/ziglang

On 2023-08-24 at 09:47+02:00, Peter Bridge wrote:
> I have a lot of const arrays of u8 bytes with pre-defined sequences
> that I need to send for things like initialising LCD.

Not answering thy original question,
but thou might want to use @embedFile for microcodes:
https://ziglang.org/documentation/master#embedFile

Re: AI scrapping bot ban a month ago

From Nguyễn Gia Phong to ~cnx/loang

On 2023-08-16 at 16:19+02:00, Adolfo Santiago wrote:
> I write to the list in order to propose a wide-block
> of AI bots scrapping anything from loang services.
>
> Recently I came accross the GPTBot[1] documentation,
> where it says how to block the bot
> if you don't want it to scrap anything.
>
> The idea would be to not allow the bot the posibility
> of scrapping anything, regardless of the loang service(s)
> you're using.
>
> [1]: https://platform.openai.com/docs/gptbot

Re: Queries using `me` by not logged-in users should return error a month ago

From Nguyễn Gia Phong to ~sircmpwn/sr.ht-discuss

On 2023-08-15 at 18:21+02:00, Jackson wrote:
> On 2023-08-11 20:53, Haowen Liu wrote:
> > 2. Search for from:me
>
> Which service specifically?

Looks like an email header, and I can reproduce on lists.sr.ht.
Ticket search does not accept the key `from'.

Re: [PATCH mepo 0/5] Port to Zig 0.11 a month ago

From Nguyễn Gia Phong to ~mil/mepo-devel

On 2023-08-11 at 17:26-04:00, Miles Alan wrote:
> On Tue, Aug 8, 2023, at 8:06 AM, Nguyễn Gia Phong wrote:
> > Reference: https://ziglang.org/download/0.11.0/release-notes.html
> >
> > Nguyễn Gia Phong (5):
> >   Specify build for Zig 0.11
> >   Refactor redundant pin cycling logic
> >   Replace deprecated std cstr.cmp with mem.orderZ
> >   Use Zig 0.11 syntax for captured index in for loop
> >   Port to Zig 0.11 builtins with type inference
> >
> >  31 files changed, 313 insertions(+), 336 deletions(-)
>
> Awesome - gave it a read through and all looks good. Thanks for taking

[PATCH mepo 4/5] Use Zig 0.11 syntax for captured index in for loop a month ago

From Nguyễn Gia Phong to ~mil/mepo-devel

---
 src/Mepo.zig              | 10 +++++-----
 src/api/filedump.zig      |  2 +-
 src/api/pin_activate.zig  |  2 +-
 src/api/pin_delete.zig    |  2 +-
 src/api/pin_transfer.zig  |  4 ++--
 src/blit/blit.zig         |  4 ++--
 src/util/utilmepolang.zig | 30 +++++++++++++++---------------
 src/util/utilprefs.zig    |  6 +++---
 8 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/src/Mepo.zig b/src/Mepo.zig
index cd5323152369..cbe53351605d 100644
--- a/src/Mepo.zig
[message trimmed]