News for hackers. Stuff that matters.

gyf304

Re:Getting arrested in Japan on Saturday May 09, 2026 @09:05PM (#48079946)
That’s a thing as well in some US states called duty to retreat.
Look great, a few nits:

- For the convert page, the tool seems to conflate codec and container format. For example, for MKV option, the tool specifies libx264, when MKV is capable of many more codecs. In addition, a lot of the times when people want to "convert", e.g. from MP4 to MKV, they mean to remux - i.e. "-c copy", which doesn't seem like an option here.

- For the compress page, the tool allows you to specify the target size, however the command output limits bitrate instead of target size. This means that the output size will vary depending on how long the input is, and will almost never be the specified target size.

I would suggest merge the "Convert" and "Compress" tabs, and allow specifying:

- video bitrate (-b:v)

- video codec (-c:v)

- audio bitrate (-b:a)

- audio codec (-c:a)

- container format

I found handbrake to be a good GUI-based alternative if ffmpeg commands are overwhelming.

It’s worth noting that this same restriction of not being able to do perspective transformations is also one of the defining characteristics of PlayStation 1 graphics. And the workaround of subdivision is also the same workaround PS1 games used.

More reading: https://retrocomputing.stackexchange.com/questions/5019/why-...

Re:Local Peer-to-Peer API Draft Community Group Report on Tuesday November 05, 2024 @06:58AM (#42050829)
I made something that achieved similar results with existing technologies by abusing STUN/TURN. It does not handle discovery but it does allow local communication without a server.

https://blog.yifangu.com/2024/07/16/crossing-the-mixed-conte...

Re:SQLite FTS5 Extension on Friday August 09, 2024 @03:33AM (#41199587)
If you want to index HTML documents using SQLite FTS5, I have a HTML (pseudo) tokenizer plugin https://github.com/gyf304/sqlite3-fts5-html
I usually copy the built library from a Chrome/Chromium installation, saves me from building the library myself.
Re:I made a new backplane for my consumer NAS on Monday April 29, 2024 @01:59PM (#40201742)
This is an awesome solution.

I have the 5-bay variant of the same NAS. I decided to put TrueNAS Scale on it using a Samsung USB stick using the internal USB. I chose one that’s widely used for Tesla dashcam, so I know it is at least somewhat durable.

I’m happy with it so far. I still find the CPU performance very lacking so I’m planning on upgrading to something beefier.

Re:Show HN: Dotenv, if it is a Unix utility on Sunday April 28, 2024 @08:14PM (#40193158)
This is a very neat project that seems to accomplish the same goal and have some extra features.
Re:Show HN: Dotenv, if it is a Unix utility on Sunday April 28, 2024 @08:12PM (#40193146)
* Memory allocation NULL check: this is a bona-fide bug introduced by my refactoring

* MAX_FILE_SIZE: I don't think this is true.

* skip_until_charset, skip_charset bound check bug: I don't think this is true

* Uninitialized value_end: I don't think this is true - and if true should be caught by -Wall -Werror flags.

* argc < 1 check not being necessary: This is not true, you can make argc == 0 by using the exec family of libc functions.

* Error Handling: Currently all parsing errors should cause the program to exit, which I think is the desired behavior.

* Unsanitized input for .env: Intended behavior.

* Unsanitized input for execvp: Intended behavior.

Show HN: Dotenv, if it is a Unix utility

https://github.com/gyf304/dotenv

I like the idea of using dotenv files, but I dislike having to use different language-specific libraries to read them.To solve this, I created a small utility that lets you prefix any command with "dotenv" to load the ".env" file.This is how I imagine dotenv would work if it had started as a UNIX utility rather than a Node.js library.

( Read More... | 101 comments | 69 points | on HN )
The reason I think is that GM is multinational. And while Buick is not doing well in the US, it’s doing very well in China (80%+ of sales of the brand is in China).
Re:I Always Hit the Crosswalk Button (2015) on Thursday November 30, 2023 @01:00PM (#38476676)
The crosswalk button my city uses has an LED that illuminates if the button was pressed before. It’s a great UX improvement over the ones without the LED.
Does anyone remember X3D[1] / VRML? X3D is roughly the same concept, 20-some years ago.

Here's a hello world for X3D: https://www.web3d.org/x3d/content/examples/Basic/X3dSpecific...

And here's a hello world for OpenUSD: https://www.openusd.org/release/tut_helloworld.html

Although X3D is a bit more verbose, a lot of parallels can be drawn between the two, 20 years apart.

[1] https://en.wikipedia.org/wiki/X3D

Re:Civic honesty around the globe on Friday July 07, 2023 @07:07PM (#36639453)
Thank you for your reply.

Here are my thoughts on your 2 points.

(1) Noted. The main graphic emphasizes reporting rate over the delta, in both the axes selection and the ranking - and indeed the ranking is the main takeaway from many of the readers. If you rank by percentage delta of report rate, the graphic would be drastically different. This newer graphic wouldn't be "fair" either, as countries with higher control (no money) report rate would have a relatively low percentage delta.

(2) The World Bank Enterprise Survey data is listed under the title "Percent of firms using e-mail to interact with clients/suppliers" (for which China is at 85%) which I think is not the same as email penetration rate (which in the above reference in my parent comment, is at <40%). I understand your reasoning that cross country data is hard to come across.

I also read your reply in Science. I believe that while there are multiple limitations conducting the research - all perfectly reasonable - the limitations nonetheless affected the credibility of Fig. 1 - the main figure of the paper.

It is also mentioned in the reply that creating new social accounts is unfeasible. While I think this is true, wouldn't a single account per platform suffice? Most social platforms allow anonymity for display names / handles. If the social account name does not bear resemblance to an actual name, I don't think the participants would notice.

Re:Civic honesty around the globe on Friday July 07, 2023 @12:22PM (#36634069)
I believe the methodology is flawed.

> The business cards displayed the owner’s name and email address and we used fictitious but commonplace male names for each country.

This is assuming that email is a ubiquitous communication method in all countries, which is not true. USA has a very high email penetration rate, so does Japan (where all phones use email instead of SMS). On the other end of the spectrum, China's email penetration rate is less than 40% [1]. Business in China is conducted over WeChat and phone calls instead of email. If the person receiving the wallet does not have an email account, or doesn't even know what email is, I'd imagine the email contact rate to be quite low.

[1] https://www.twinova.com/email-dead-long-live-wechat/#:~:text....

Re:Mischievous NPM Publications on Friday May 05, 2023 @06:19PM (#35835790)
I know exactly where this is from. This has been floating around the Chinese Internet for a bit. The repo is originally at https://github.com/wheatup/evil.js but has been made private since then. A few variants of this was made and uploaded to NPM.

Here's a English translation of the README.md in that specific repo.

> What? The notorious 996 company wants you to hit the road?

>

> Do you want to leave a small "gift" for your project before you go?

>

> Let's sneak this project into yours, and your project will have, but not limited to, the following magical effects:

>

> - When the length of the array is divisible by 7, Array.includes will always return false.

> - When it's Sunday, the result of the Array.map method always loses the last element.

> - There is a 2% chance that the result of Array.filter will lose the last element.

> - setTimeout will always trigger one second slower than expected.

> - 10% of Promise.then will not register on Sundays.

> - JSON.stringify will change uppercase I to lowercase l.

> - The result of Date.getTime() will always be one hour behind.

> - There is a 5% chance that localStorage.getItem will return an empty string.

see: https://juejin.cn/post/7133134875426553886

Re:Show HN: I built a custom USB Trackball on Saturday February 18, 2023 @05:12PM (#34851650)
Something about the use billiard balls immensely amuses me. I'm impressed.
Re:TinyPilot: Build a KVM over IP for Under $100 on Sunday May 29, 2022 @06:47PM (#31553642)
Such a device exists and can be bought from Amazon for less than 20 dollars. Keyword USB HDMI Capture.
Re:The silenced deaths of the Shanghai 2022 lockdown on Friday April 15, 2022 @05:19PM (#31045977)
We must protect human lives at all costs, even at the cost of human lives.

Jokes aside, what we really want to know is that - what are the human lives lost lockdown v.s. no lockdown, maybe also factor in the possible economic downturns. The government did a not-so-good job convincing people that doing a lockdown is indeed better than the alternative - "We ran the numbers, it seems like doing a lockdown at this stage is beneficial" sounds better than doing a lockdown just for the sake of it.

And: limiting information to people doesn't help boost confidence.

Re:Mining Ethereum on M1 Mac GPU on Saturday February 27, 2021 @01:56AM (#26283233)
You can see this line from the log. Using Device : Intel GPU 0.0 Apple M1 OpenCL 1.2 Memory : 10.67 GB (11453251584 B)
Re:Mining Ethereum on M1 Mac GPU on Saturday February 27, 2021 @01:49AM (#26283212)
I suspected that as well. Since M1 CPU and GPU shares memory, this also means you really can't do anything else while mining. You can't even scroll a webpage smoothly.
Re:Uxn is a 8-bit virtual stack machine on Thursday February 25, 2021 @08:25PM (#26270528)
There’s also ZPU. Which is straightforward enough to write an emulator for in an afternoon.

https://en.m.wikipedia.org/wiki/ZPU_(microprocessor)

Re:Ask HN: Are you experiencing kernel panics on your M1 Mac? on Monday February 22, 2021 @06:19PM (#26231994)
Yes. Mounting WebDAV and creating a directory in it causes immediate kernel panic on M1 Macs. Fun.
I would like to plop this link here.

Bloomberg News Pays Reporters More If Their Stories Move Markets: https://www.businessinsider.com/bloomberg-reporters-compensa...

Bloomberg reporters have every incentive to publish a story like this, even if it's nonsense.

Re:Show HN: Go-style JSON Marshal / Unmarshal for C structs on Monday February 15, 2021 @01:23AM (#26139726)
CMarshal brings Go style JSON marshaling / unmarshaling to C.

You can generate cJSON based JSON serializers and deserializers by adding a /* cmarshal:`true` */ comment to your C struct.

Potential use cases:

* Auto-generated JSON config parsers

* Simple struct printer (as a debugging mechanism, my goal in mind for this project)

* Introspecting C structs using cJSON API

* Easily bloat your program line count! (not the intended use case, of course)

Let me know how you think about this.*

Re:Show HN: LAN Party VPN – Run a VPN on Top of Discord on Tuesday February 02, 2021 @06:50AM (#25999883)
I’ve been in lock down in a while (haven’t we all?). One of my major past times is to play games with my friends on Discord, and after a year we’ve ran out of games to play and started to look at classic games. Those games (namely SWAT4) are old enough to not support Steam multiplayer. However installing and setting up a VPN is quite a non-trivial process for non-techies.

So I took some time and wrote this application that uses Wintun and Discord SDK to encapsulate and transport IP packets (i.e. a layer 3 VPN running on Discord infra). It works reasonably well with my friends so I want to share it here.

Older »