HNHacker News
TopNewBestAskShowJobs

sirn

3,953 karma · joined October 25, 2009

Contact: sirn@ogsite.net

Software developer living in Tokyo, Japan

Previous: Oozou (BKK), Omise (BKK→TYO), Varnish Software (TYO), EnergyRoute Japan (TYO)

I run a small IT consulting business in Japan; feel free to email.

submissionscomments
sirn··on Raspberry Pi 4: Hardware accelerated video decoding (GPU) in Chromium
Raspberry Pi 3 also has OpenMX Hardware Encoder/Decoder. It should be able to do H264 720p at reasonable speed. If you're using ffmpeg just make sure to use h264_omx instead of libx264 (needs to be on Raspbian, though, since it requires libomx_core.so blob and enabled via a flag).
sirn··on 4x4 Macro Pad Kit
Controlling scenes while live streaming (e.g. live / "AFK" / switch to "I'm dead" mode during multiplayer live stream / ...) is the most common use case for this type of keyboard I'm aware of. It's much less error prone than pressing a shortcut since it's a single button press. One of the most common commercial product for this particular use case is Elgato Stream Deck.
sirn··on Hotel guest in Thailand jailed for defamation after posting bad online reviews
Disclaimer: IANAL / I'm Thai but not currently living there.

I can't comment about the guest vs the hotel, but this one is also filed under Section 14(1) in Thailand's Computer-Related Crime Act in addition to Defamation by advertising, so it is another chapter in a long and ongoing story of Section 14(1) abuse, which says:

"Section 14: Whoever commits the following offences shall be liable to an imprisonment [...]: (1) Dishonestly or by deception, entering wholly or partially distorted or false computer data into a computer system in a manner likely to cause damage to the general public; which is not a defamation under the Criminal Code" (unofficial translation)

The original intention for this Section was to be used for _phishing and fraud_ (as it was originally based on Budapest Convention), but it is worded so loosely that it applicable to anything deemed "false information" as long as it is not directly a defamation. This is mainly due to the use of word "false information" instead of "forgery" in the Thai version. This Section (and the whole Section 14) has been used by government to suppress any political differences for a long time, and never once actually be used for phishing or fraud as it was intended.

It also doesn't help that this Section 14(1) actually has higher fine/jail time than the relevant Criminal Code and cannot be withdrawn, unlike the Criminal Code. Group of lawyers at iLaw[1] has been pushing to amend this Act for a long time, but lawmaker only respond to them by making it worse (to the point that it cannot actually be used for phishing or fraud[2]).

Right now the push to amend Section 14(1) kinda stalled, as Thailand has much bigger problem that need to be fixed (including amending the constitution so Army-tied party no longer get automatically elected, of which a signature of 100k Thai people with a hard copy of their National ID card recently been dismissed in favor for "100k" names in Google Forms from the pro-government side).

[1]: http://ilaw.or.th/

[2]: http://ilaw.or.th/node/5705 (in Thai)

sirn··on Studio Ghibli releases 400 free-to-use images
IANAL, some will say it is OK under the private use cause in Article 30 as long as you print it yourself, but some will say it's not since you're wearing it in public thus it no longer become private use. I'm not aware if the private use cause in situation like this ever been tested on court. Ghibli saying "within common sense" doesn't help clear this case either.
sirn··on Studio Ghibli releases 400 free-to-use images
Japan has a very limited fair use law (see also Article 30[1]) to the point that a single frame capture from an anime is considered gray area unless it was used as a reference (引用) with a proper copyright attribution in the format of "(c) <Year> <Author>" usually obtained by visiting that work's home page^1. Though there's no clear line what is counted as a reference.

I think this is just Ghibli open up the possibility of using these images in those gray area (e.g. posting these shots on social media, referencing from a blog, etc.)

[1]: https://www.cric.or.jp/english/clj/cl2.html

^1: e.g. for http://www.ghibli.jp/works/chihiro/ it is "© 2001 Studio Ghibli・NDDTM"

sirn··on Creating a Home IPv6 Network
My ISP in Japan (NTT Flets) is even weirder. They have sort-of static IPv6 (due to MAP-E[1] require static prefix) and assigns customer a /64, but don't do Prefix Delegation unless a customer also pay for a Fiber landline (Hikari Denwa) in which they will assign /56 and do proper PD. This has been a huge hindrance for anyone wanting to run their own home router their router must bridge IPv6 to ISP router (and thus not able to do their own firewall/DHCPv6/SLAAC)

The only workaround is to use ndppd[1] set to proxy to the upstream router. However ndppd is undergoing a rewrite right now and latest stable release (0.2.5) has few bugs causing ndppd to stop working after a while. So far, the only way to get everything work for me was to build ndppd from master (which was deprecated in favor for a new 1.0, which is still in development).

OpenWRT seems to include a working version of ndppd out of the box, but its MAP-E supports is somewhat broken.

[1]: https://tools.ietf.org/html/draft-mdt-softwire-map-encapsula...

[2]: https://github.com/DanielAdolfsson/ndppd

sirn··on FreeCAD: A free and open source multiplatform 3D parametric modeler
I'm new to FreeCAD (and have never used other CAD software), but I think in your case, you can click the face on Part Design view, then click New Sketch. It will auto-select that plane with placement automatically set to the selected plane. The UI/UX wasn't very intuitive, though, as it won't work if you click New Sketch first, then select a plane.
sirn··on Designing an Overkill workbench for home office
CAD is operated based on constraint, e.g. make a square box and say "I want this to be 30mm x 45mm with this point, add a fillet (rounded corner) then make it coincident with this point" and let the software figure out how to shape/position the object. While Blender is more of a free-hand drawing, e.g. make a square box, make it certain size, make a corner rounded, then move it to the a certain point.

Blender has ability to do simple constraint, but it's not its primary uses. FreeCAD can also be used the Blender way but the software will warn about being under-constraint. Both FreeCAD and Blender can export to STL file (used by CAD softwares), but Blender's STL usually need to be scaled to real world measurements. In case of 3D printing, this STL file can be imported into a slicer software such as PrusaSlicer, which outputs GCode to control the printer (e.g. X, Y, Z coordinates, extrusion temperature, etc.)

sirn··on Designing an Overkill workbench for home office
As a beginner (have been learning CAD since a week ago), I tried OpenSCAD then FreeCAD and found FreeCAD to be simple enough to get started. I followed the tutorial in FreeCAD Wiki[1], particularly the Toothbrush Head Stand[2] one (since my primary use was 3D printing) and could get comfortable with the software within a day or two.

[1]: https://wiki.freecadweb.org/Tutorials

[2]: https://wiki.freecadweb.org/Toothbrush_Head_Stand

sirn··on Emacs-Helm development is now stalled
Oh, that is nice. Thank you for testing!
sirn··on Emacs-Helm development is now stalled
The last time I tried rg with pcre2 disabled (OpenBSD 6.4?), it SEGFAULT even with wxallowed :(
sirn··on Emacs-Helm development is now stalled
I recently switched from ivy to selectrum as well. I miss some stuff like ivy-rich, but I found integration with prescient.el[1] more important than an eye candy (where ivy-prescient breaks every few version). I still haven't got a chance to rewrite ivy-ag with selectrum^note1, but it has been working great so far.

My only issue with selectrum was, back when I'm using ivy, I rebind forward direction keys (<right>/C-l/C-f) to `ivy-partial-or-done` which either complete the input with the selection or visit a file depending on the context. Selectrum doesn't have equivalent implementation, but it's easy enough to implement. Reposting in here in case anybody needs it:

    (defun gemacs--selectrum-insert-or-submit-current-candidate ()
     "Insert current candidate or forward to `selectrum-select-current-candidate'
    if input text hasn't changed since last completion."
     (interactive)
     (let ((prev-input (selectrum-get-current-input)))
       (when (> (length (selectrum-get-current-candidates)) 0)
         (selectrum-insert-current-candidate))
       (when (string= prev-input (selectrum-get-current-input))
         (selectrum-select-current-candidate))))
[1]: https://github.com/raxod502/prescient.el

^note1: I don't use rg due to dependency on PCRE2 which doesn't play nice on my OpenBSD machine.

sirn··on Magit – A Git Porcelain inside Emacs
I would suggest a step further: start with Spacemacs/Doom, but if you decide to stick around, try to build your own Emacs configuration based on the part of Spacemacs/Doom that you like.

Thanks to the amazing use-package[1] macro (which Spacemacs/Doom also uses) most configurations are self-contained to a certain extent. Searching for use-package in GitHub[2] will yields plenty of results which can be mostly be taken as a reference for your own liking. It should be relatively easy to port part of Spacemacs/Doom to vanilla use-package, e.g. starting with this (which sets up use-package alongside with evil):

    (require 'package)
    (setq package-enable-at-startup nil)
    (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))

    (package-initialize)
    (unless (package-installed-p 'use-package)
      (package-refresh-contents)
      (package-install 'use-package))

    (eval-when-compile
      (require 'use-package))

    (use-package evil
      :ensure t
      :config
      (evil-mode t) 

    (use-package evil-leader
      :after evil
      :ensure t
      :config
      (evil-leader/set-leader "<SPC>")
      (global-evil-leader-mode t))
To add Magit, one could take a look at Spacemacs's git/packages.el[2], search documentation on what each package does, and proceed on porting configuration, only the part that you actually uses, e.g.:

    (use-package evil-magit
      :ensure t
      :after (magit evil))

    (use-package magit
      :ensure t
      :config
      (evil-leader/set-key ("gs" #'magit-status))
Since most configurations based on use-package are self-contained, when stuck I also like to use GitHub search to look on how other people configure a certain package[3]. In most cases the configuration should be reusable as-is.

Finally, use-package is highly extensible. There is straight.el[4] which adds extension to use-package to fetch from Git and pin a version in a lockfile, which adds reproducibility to Emacs configuration. There's also el-patch[5] from the same author that allows patching package on the fly without the need to maintain separate forks.

[1]: https://github.com/jwiegley/use-package

[2]: https://github.com/syl20bnr/spacemacs/blob/d46eacd83842815b2...

[3]: https://github.com/search?l=Emacs+Lisp&p=4&q=use-package&typ...

[4]: https://github.com/raxod502/straight.el

[5]: https://github.com/raxod502/el-patch

sirn··on Pass the Payment Choice Act
Network Tokenization (Apple Pay/Google Pay) exchange a token unique to {card, device, merchant}. This token is sent from device, to merchant, to acquirer, to card network, and to issuer without the need to resolve token to PAN in the middle (unlike PCI tokenization most payment gateway provides).

AFAIK, three parties that are aware of a purchase history of tokenized cards are: Token Service Provider who provides the token, Token Requester who offer the tokenized service (Apple/Google in this case) and a card issuer. Apple Pay for example, uses First Data as its Token Service Provider. (I'm pretty sure Google Pay does as well)

sirn··on I can't believe I'm praising Tcl (2008)
MacPorts' Portfile[1], maybe? Portfile is being evaluated entirely within interp[2] with only few functions exposed inside the environment

[1]: https://github.com/macports/macports-ports/blob/master/lang/...

[2]: https://www.tcl.tk/man/tcl8.4/TclCmd/interp.htm

sirn··on Apple to kill Epic’s accounts on Friday the 28th
Few years ago before Apple implemeted Night Shift, F.lux used to use an ability for non-paid developer accounts to compile and run an app on their phone to distribute. They provided a source code for a small program that serve as a shim to F.lux. User need to compile this code with Xcode and put it on their phone.

People followed tutorial videos downloading Xcode, making a developer account, figure out how to get signing profile works, etc. just to get F.lux installed on their phone. Searching for "Flux iOS 9" on YouTube yields some video with over 100k views. In some community there are people who are willing to do it for you (by VNC into user's machine) at $10 per installation.

sirn··on "Much" of the Rust/Wasmtime team hit by layoffs at Mozilla
Yes for LLVM, but Clang was made entirely while Chris Lattner was employed by Apple[1]. Before Clang you have to use LLVM GCC frontend (llvm-gcc) to compile C code under LLVM, which was the default in Xcode until 5.x (although Clang was added in Xcode 4.x, I remembered it being quite unstable at the time).

[1]: https://lists.llvm.org/pipermail/cfe-dev/2007-July/000000.ht... (announcement)

sirn··on Poetry – Python dependency management and packaging
I was not aware of platform support (probably because two of my systems are FreeBSD and linux-musl, which nobody made a binary dist for). I stand corrected. Thank you.
sirn··on Poetry – Python dependency management and packaging
Pipenv tries to do so much (e.g. a pipenv command involve poking around procfs to detect shell via shellingham to display colors), used to introduce breaking changes between releases (before they switched the scheme to CalVer), and takes a really long time between each releases (longer for bugs to get fixed).

Most people that switched from Pipenv to Poetry were probably done so during the end of 2018 throughout 2019, of which Pipenv has no releases at all[1] (non-alpha/beta version were only released in November 2018 then May 2020).

There were a rant from few years ago[2][3] regarding other issues (performance, etc.).

[1]: https://news.ycombinator.com/item?id=21781421

[2]: https://chriswarrick.com/blog/2018/07/17/pipenv-promises-a-l...

[3]: https://news.ycombinator.com/item?id=18612590

sirn··on Poetry – Python dependency management and packaging
Old-style Python sdist/egg is exactly the same and it has the two issues mentioned in my original reply. Python sdist/Ruby extconf/mkmf also has an issue of executing code from the package itself to install a package and can be a huge security issue (which Python wheels were supposed to solve).

The reason this has never become a problem in Ruby world is because Ruby community is centered around Rails, of which a requirement to deploy on non-x86_64/ARM64 is pretty much non-existent. Ruby itself doesn't even support non-glibc (e.g. compiling Ruby on musl requires a patch).

sirn··on Poetry – Python dependency management and packaging
RubyGem doesn't do binary distribution of C extension at all. Gem with C extension is usually built at install time (via extconf/mkmf) which side-stepped the whole shipping .so for 10 different arches issue but it create few other issues of requiring build tool to be installed on production server to install a Gem (so you're back to the Python's manylinux issue, but applies to all arches instead of only edge cases), and any Gem that need to use pre-built .so need to do it themselves (including differentiating between arches).
sirn··on Apple does not keep the 30% commission on a refund
The fee is usually not returned to the merchant from payment provider in case of chargeback (in this case, merchant is Apple, but payment gateway may also not get the fee returned from acquiring bank also). In this case, Apple returning the fee result in them paying the refund out of their own pocket, which may be a source of abuse. This varies by payment provider, and some do charge extra in case this happens. I've posted a bit more about this in other subthread.[1]

[1]: https://news.ycombinator.com/item?id=23996366

sirn··on Apple does not keep the 30% commission on a refund
In my understanding (IANAL), the TOS actually talks about two scenarios, "In the event that Apple receives any notice or claim from any End-User", e.g. a case where user asked Apple Support for a refund and "In the event that Apple receives any notice or claim from a payment provider that an End-User has obtained a refund for a Licensed Application", e.g. a case where user asked their credit card company for a refund (e.g. a chargeback).

The "right to retain its commission on the sale" clause may cover both, but at least in the chargeback case it makes sense to have such a clause.

sirn··on Apple does not keep the 30% commission on a refund
You can asked for refund via Apple Support. I've done this several times. The refund have to go through payment gateway in any case, but when a refund request comes from payment gateway (or notified by, in the TOS' wording), it is a chargeback and there's a fee associated with it.

From the customer side of things, calling their credit card company to have a refund and calling the merchant to have a refund may have the same result, however in the merchant side of things they are completely different with the former result in a penalty for the merchant (chargeback ratio).

sirn··on Apple does not keep the 30% commission on a refund
I used to work in payment industry (I kinda still do, but no longer involved in the talking with Visa/Mastercard part), and I can see why they could be doing this if they do. I know this is an unpopular opinion, but I _personally_ do not think 30% is outrageous as many people believe so although I also do hold an opinion that App Store should allows the app to use their own payment infrastructure if they have one (currently only possible for physical goods).

Stripe and other modern payment gateway makes pricing simple, but it's far from simple behind the scene. Most people on HN are probably using credit card for App Store, so it's easy to overlook that App Store offers different kinds of APMs: carrier payment[1], local wallet, stored value card, and local payment services[2]. I don't think Stripe supports half or even third of what App Store supports.

I've worked on local integration for few countries for different kind of payment methods. In some payment method they simply don't refund your fee. In some cases where currency conversion happens it's not possible to refund using the exact rate the charge was made. In some cases the fee is prohibitively high (e.g. 12% for carrier payment). In many cases there are contract fees, connection fee, infrastructure ("nah you have to have your own server cage and a direct fiber line from us") fee and many more. This, plus CDN, maintenance and everything, is one of the reasons why I don't think 30% is outrageous and will probably found it acceptable if they don't refund this fee, taking operational costs involved into account.

[1]: https://support.apple.com/en-us/HT205102

[2]: https://support.apple.com/en-us/HT202631

sirn··on Apple does not keep the 30% commission on a refund
I'm not a lawyer (e.g. I don't know how far "In such cases" clause applies in the statement), and simply want to provide a justification for the clause I'm personally familiar with (a chargeback)
sirn··on Apple does not keep the 30% commission on a refund
> In the event that Apple receives any notice or claim from a payment provider [...] Apple will have the right to retain its commission on the sale of that Licensed Application, notwithstanding the refund of the price to the End-User.

"From a payment provider" means a chargeback, e.g. a customer calls their credit card company the charge was fraudulent, and the credit card company files a dispute code against payment provider (usually Visa 83/JCB 546/Mastercard 4853/Mastercard 4863 depending on the case). In this case it's not uncommon to not refund the fee. In fact, many payment providers will also charge you extra fee for the dispute (e.g. Stripe charges $15[1]).

There's also filing fee in case the merchant trying to fight the dispute and lose. The fee varies by network: $500 for Visa, at least $600 for Mastercard.

[1]: https://stripe.com/docs/disputes

sirn··on Big Sur is both 10.16 and 11.0
I’m curious what is this graphic bug?
sirn··on A man trying to automate Thailand’s hospitals
It has been mentioned in Thai mainstream media, but not really a top headline[1][2][3][4], but "national treasure" definitely sounds like a hyperbole.

[1] https://www.thairath.co.th/news/tech/technology/1836736

[2] https://www.mcot.net/viewtna/5eccba21e3f8e40af8448090

[3] https://www.bangkokbiznews.com/news/detail/888783?ans=

[4] https://www.bangkokpost.com/business/1896230/fibo-unveils-ro...

sirn··on New iOS privacy feature may end an era of personalized ads
WKWebView cannot use any of Safari extensions, unfortunately. I just use DNSCloak connecting to my private VPS instance to do adblocking over DNS which kinda works fine, but leaves out a lot of blank canvas in the page.
← PreviousPage 7 of 29Next →