HNHacker News
TopNewBestAskShowJobs

maple3142

1,632 karma · joined October 26, 2017

Personal Blog(in Chinese): https://blog.maple3142.net/
submissionscomments
maple3142··on System76 Pangolin Linux-first laptop with AMD internals now in stock
The digits in my email are "741852963", which is much easier to type on a numpad compared to top row. IIRC, I used a numpad to type those digits when I registered my email.
maple3142··on System76 Pangolin Linux-first laptop with AMD internals now in stock
I really hate using laptop without numpad because there are 9 digits in my email address. It is much faster to enter it using a numpad.
maple3142··on Docker Desktop no longer free for large companies
Enable WSL2, then you can just install the docker provided by your distro package manager. For example, I am using docker packaed by Arch Linux, and it works as expected.

If you need to use `docker` command under Powershell, maybe exposing docker socket to Windows host would probably work. I didn't try it as I don't need it.

maple3142··on Tech-savvy audiences block Google Analytics
IIRC, It is possible to serve Google Analytics script on your server if you really insisted in doing it: https://www.freecodecamp.org/news/save-your-analytics-from-c...
maple3142··on Canistilluse.com
> They're working on it: https://wicg.github.io/file-system-access/

It seems it need user to manually select a file/folder to be used, like Android or iOS does.

> While local apps are getting sandboxed properly: https://docs.flatpak.org/en/latest/sandbox-permissions.html

It looks good, but it seems many applications still require filesystem=host to run (https://flatkill.org/2020/). Also, its sandbox solution isn't going to work on Windows, Mac and BSDs.

maple3142··on Canistilluse.com
At least I know a website couldn't read my id_rsa, as opposed to native executables. Unless there is a very serious browser exploit.
maple3142··on Perhaps WSL2 Should Be a Wake-Up Call
I use ArchWSL https://github.com/yuk7/ArchWSL
maple3142··on Bringing the Unix philosophy to the 21st century (2019)
Parsing ad-hoc text formats always seem very fragile, as single spacr character (or even newline character) could easily break the pipeline. Using a proper data structure could make scripts works more "properly" when encountering these edge cases.

Which format to use a as representation of data structure might be debatable, but I think JSON is a reasonable choice. (Formatted) JSON is readable by human and could be easily parsed by programs.

maple3142··on Perhaps WSL2 Should Be a Wake-Up Call
I currently run Arch Linux under WSL2 for development. Project files are stored in WSL for performance, and I am using VSCode Remote WSL extension for editing. This setup is basically perfect for my use case: development and playing CTFs.

I am using WSL because I want games and Windows-only applications. Dual boot seems too inconvenient. Using a regular VM works too, but it isn't as seamless as WSL2. It can boot in seconds, sharing files with host by default, automatic memory reclaim...

maple3142··on Git password authentication is shutting down
The is also a JavaScript programming environment that almost every PC has, the browser. Just open any page and press F12, click the "Console" tab and type `console.log("Hello World")` and you just write your first Hello World.
maple3142··on ZeroVer: 0-Based Versioning
I think it is meant to be a joke like ZeroVer.
maple3142··on Show HN: Lona – Framework for responsive web apps in full Python without JS
How well does this work in a high network lentency environment? If I understand correctly, it requires every user interaction to have a round-trip between client and server.
maple3142··on Tesseract OCR
Is there a good OCR is good for some weird data (not natural language), such as a screenshot of a base64 encoded file. There was a CTF challenge requiring you to recover full RSA private key from a partially redacted screenshot of a RSA private (pem). I tried serveral OCR tools to try to extract the remaining base64 characters. I did tried to use Tesseract too, but the result is quite bad. I used GCP's OCR service eventually, the result is almost perfect for this task, but I wonder is there some non cloud-based tools are good for this task?
maple3142··on 80% of my traffic is excluded from Google Analytics
Hosting a (static) website on GitHub pages means you put all your resources including html files into a repo, then the whole website will be served from GitHub's server. You don't even have a server to view your access log. Netlify is pretty similar.

As for CloudFlare, all the requests will go through CloudFlare's server for caching, so some request won't reach your server.

maple3142··on 80% of my traffic is excluded from Google Analytics
It doesn't work if the website is hosted on GitHub Pages or Netlify. Having a CDN such as CloudFlare will make log files on your server useless too.
maple3142··on A Docker footgun led to a vandal deleting NewsBlur's MongoDB database
Maybe it is more convenient to developer so that they don't have to touch the firewall? Docker is not only used by sysadmin.
maple3142··on DenoDB
I think one reason is using native C/C++ SDK makes it harder to install (compared to pure JavaScript/TypeScript), because you can't assume that compiler is always available. For example, you need to install extra tools to use install node modules with native dependencies on Windows.
maple3142··on The modern web on a slow connection (2017)
Not supporting SNI is the browser's problem IMO, because SNI are required to enable a single IP to host multiple HTTPS websites. SNI is not just for CloudFlare.
maple3142··on WebContainers: Run Node.js natively in the browser
Because many node.js api are written in C/C++, it might be easier to implements OS features instead of rewriting in JS. This is just my assumption.
maple3142··on WebContainers: Run Node.js natively in the browser
I think it is more complicated to emulate those api in normal browser environment compared to emulating some OS api for running node.js.
maple3142··on Google Docs will now use canvas based rendering
Same experience on my Android phone. I just tried to unfold 75 comment, it has a noticeable latency in both chrome and firefox.
maple3142··on ClearURLs – automatically remove tracking elements from URLs
I usually removes those parameters manually when I want to share the url to my friends, so it is quite useful for me.
maple3142··on My Current HTML Boilerplate
But not everyone wants to give money to apple to be able to deploy their apps, so the "sensible" way is to use hacks[1] to have a normal html5 behavior.

[1]: https://stackoverflow.com/q/37808180/6885801

maple3142··on Show HN: Diffie-Hellman exchange for the layman
I think it should also explain why this is secure. It may not be obvious that why you can't just compute the logarithm and get the shared key.
maple3142··on Adoption of Mypy for Python type checking: 45% already use it, 40% don't plan to
> what does async vs blocking even mean in this context? all languages have the same problem, just use the libraries that are non-blocking.

Maybe Node.js? Although it does have some sync function to do io, most of them are still unblocking, and the ecosystem is unblocking by default too. It is harder to find a blocking library than finding a non-blocking ones.

maple3142··on Reflections on IDEA vs VS Code
In my opinion, one killer feature of VSCode is the ability to connect to WSL, remote server and Docker container. As someone mainly developing on WSL2, I use this feature everyday. I only use Idea when I need to use Java or Kotlin, because its language support is really good.
maple3142··on Accidentally quadratic: When Python is faster than C++
Summation from 1 to n: https://godbolt.org/z/673hTr

clang seems to optimize it to (n-1)(n-2)/2+2n-1, which is O(1).

maple3142··on The Whole Web Pays for Google and Facebook to Be Free
Although I agree a simple system to make it easier to pay small amount of money would help, I think $1 is not everyone would accept easily. Maybe regional pricing is necessary.
maple3142··on Semantic Versioning Will Not Save You
IIRC, npm already does the same thing. If A and C depends on two compatible version of B, it will make them use the same package. If two version aren't compatible, it will use two package and it still works.
maple3142··on jQuery 3.6.0
BTW, NodeList.prototype.forEach is not available on every browsers that supports querySelector/querySelectorAll, such as IE11: https://caniuse.com/mdn-api_nodelist_foreach

So you need to be careful about writing code like that if you want to avoid jQuery.

← PreviousPage 4 of 9Next →