HNHacker News
TopNewBestAskShowJobs

CyberShadow

2,126 karma · joined June 21, 2009

I am Vladimir Panteleev, a D hacker from Moldova, Eastern Europe.

https://github.com/CyberShadow

[ my public key: https://keybase.io/cybershadow; my proof: https://keybase.io/cybershadow/sigs/iQOqJAZGCVN0DykK2PLwcTGU247dIo3aZnm6s6VOgjk ]

submissionscomments
CyberShadow··on The weight of the clipboard
Thanks for sharing! As I understood, I think many clipboard managers already allow this, or at least, CopyQ and Ditto do. The approach is to just copy all the items you need, and then press "Win+V 5" five times. 5 would paste the fifth item in the history, but every time you did that, it is pulled to the top of the list, putting the next item in that spot.

Would this work, or is there more to it?

CyberShadow··on The weight of the clipboard
I'm working on a clipboard manager, because I'm not happy with any of the ones currently available. Here are my design goals:

- The system should be able to efficiently store, manipulate, and search an unlimited number of clipboard entries with reasonable performance.

- The software should be cross-platform, and should have implementations for major desktop platforms (Windows, X11, Wayland, macOS).

- Non-text data (images) and rich text (e.g. HTML) should be supported.

- Clipboard history can be shared across instances using a network connection.

- Instances may temporarily go offline, and sync up with other instances once a connection is re-established.

- - All functionality should continue to be available when offline (other than sync).

- Deletions must be propagated across instances.

- Deleted clips must not be trivially recoverable.

- Deleted clips must be deleted everywhere, including any copies in OS clipboards.

- Sync should be incremental (and otherwise generally efficient).

- When connected, actions should propagate across instances in real time (instantly, as opposed to polling, and with no unnecessary roundtrips).

- Relaying should be supported (in a `A <-> B <-> C` scheme, A should be able to see C's actions).

- Network topology cycles should not result in a feedback loop.

- It should be safe and easy to simply copy the database file to another host, "pre-seeding" the clipboard history.

- Support "portable installs" (carrying the software, configuration, and database on portable storage).

- It should be easy to write interoperable implementations of bridges/clients in most programming languages.

- Non-GUI functionality should be separated (or separatable) from GUI functionality, so that a GUI toolkit doesn't need to be loaded at all times.

Any suggestions?

CyberShadow··on Japan HP accidentally deleted 77TB data in Kyoto U. supercomputing system
If you mean as a shebang (#!/bin/sh -eu), I would suggest switching to using "set" instead, because the shebang will not be interpreted if the script is ran as "sh script.sh" (as opposed to ./script.sh).
CyberShadow··on Japan HP accidentally deleted 77TB data in Kyoto U. supercomputing system
That's quite a number of bad-faith assumptions in your comment, which are also incidentally wrong.

> e makes it super annoying

I rest my case?

CyberShadow··on Japan HP accidentally deleted 77TB data in Kyoto U. supercomputing system
> e doesn’t work for (subshell | commands)

That's not an argument against enabling it.

In bash, -o pipefail addresses this.

> and u is inconvenient when appending to PATHs

PATH should always be set. Try: env -i sh -c 'echo $PATH'

If you're prioritizing convenience over correctness, prepare to face the consequences.

> Every tool has its place, and dogma is often unhelpful.

Visual Basic's "ON ERROR RESUME NEXT" perhaps also had its place. That doesn't mean that using it is good advice.

If anything, I would consider the often cited wooledge etc. advice of not using -e/-u as dogma. Case in point: no one lost 77TB of data because they should not have used -e/-u.

CyberShadow··on Emfy: Emacs for You – Quickly set up vanilla Emacs for editing
I have not tried the multiple cursors package, but regarding the problem of manipulating several lines at once with instant preview, you could look at the visual-regexp package:

https://github.com/benma/visual-regexp.el

CyberShadow··on Emfy: Emacs for You – Quickly set up vanilla Emacs for editing
Fighting against idiomatic Emacs keybindings is an uphill battle, but the hill is not very steep. The recipe that works for me:

1. Bind the behavior you want in the global map. (global-set-key (kbd "<key-here>") #'the-action-you-want)

2. Any time you encounter a mode which overrides this key, press C-h k <key-here>. It will tell you the name of the map in which the key is bound (usually foo-mode-map). Then, add: (define-key foo-mode-map (kbd "<key-here>") nil). This will unmap the key from the mode's map, revealing the binding in the global map.

CyberShadow··on Emfy: Emacs for You – Quickly set up vanilla Emacs for editing
That's very cool, but I've personally greatly enjoyed learning and programming in Emacs Lisp. Not only does its ability to immediately evaluate and hot-patch anything work very well with the way it's used in Emacs, but also it was a learning path to a family of languages which is very interesting and unlike mainstream Algol-based ones.
CyberShadow··on Emfy: Emacs for You – Quickly set up vanilla Emacs for editing
When I was choosing the next editor to settle on and invest into, what convincingly swayed me towards Emacs was the number of reports of vim users who later moved to Emacs, vs. the number of reports of users who moved in the other direction.
CyberShadow··on Gobolinux : Redefining Linux filesystem hierarchy
> For example, comparing two URLs in Java is not deterministic.

Well, it does network access, so it would excluded.

> For another example, iterating through a set in Python will give you the elements in a different order on 32- versus 64-bit systems.

This is a good counter-point.

> Brainfuck does not standardize overflow behaviour and so the same program may behave differently on different systems.

Different implementations of Nix might have the same issue in some places. In this case, whether the language is fully defined is orthogonal to whether its behavior is deterministic; here, a particular implementation will continue to be as such.

As far as I know, Nix doesn't have a formal specification; it is defined by its reference implementation.

CyberShadow··on Gobolinux : Redefining Linux filesystem hierarchy
Most programming languages are already generally deterministic.

Pick any programming language. Now, remove access to I/O (except standard input and output), networking, time, random number generators, threads, OS syscalls, etc.

Given an input, the program will always generate the same output, i.e. it is deterministic. However, the program is still allowed to have global mutable state; the state is just encapsulated to the program's memory and execution time.

A trivial example is Brainfuck. It is most certainly not a functional programming language, but it is deterministic.

CyberShadow··on Gobolinux : Redefining Linux filesystem hierarchy
You can use pretty much any Turing complete language to achieve this constraint, as long as its inputs and execution are deterministic. The language itself doesn't have to be purely functional.
CyberShadow··on You block ads in your browser, why not in your city?
> it would be infuriating if you had to view an ad before being able to use the subway ticketing system

What about using a gas pump?

https://www.reddit.com/r/assholedesign/comments/ozu1up/havin...

Seems that the trend is going in this direction.

CyberShadow··on Microsoft forked MIT licensed repo and changed the copyright [fixed]
No. I am not in the program nor requested access.

This is my last reply in this subthread; feel free to assume the same answer for all questions along the same line.

I also invite you to review the HN comment guidelines: https://news.ycombinator.com/newsguidelines.html

CyberShadow··on What the Hell Is This Company the 76ers Just Partnered With?
"The 76ers" is the name of a professional basketball team in the United States. (Not related to System76.)
CyberShadow··on Microsoft forked MIT licensed repo and changed the copyright [fixed]
I own zero shares of anything directly or indirectly.
CyberShadow··on Microsoft forked MIT licensed repo and changed the copyright [fixed]
I am not, and have never been a Microsoft employee.

You can search online for my name / username to find my open-source contribution history, if you would like.

I hope that sufficiently answers your query.

CyberShadow··on Microsoft forked MIT licensed repo and changed the copyright [fixed]
If I were to guess, it would be that the action performed here (or the basis of the code implementing this action) was intended to be done on internal Microsoft repositories that should be open-sourced.
CyberShadow··on Microsoft forked MIT licensed repo and changed the copyright [fixed]
> It works for everyone except you. The Content-Type is right there, in the header.

I don't know what to tell you. It's not there.

https://dump.cy.md/9b2a31fa5184397159fe42a85c197242/16404476...

It is there if I check with cURL, though.

Edit: looks like this bug is triggered by the absence of Accept-Encoding in the request. When the server compresses the response, it neglects to include the Content-Type of the compressed content.

> You defend Microsoft, here and in other parts of this thread, as they sell the work of open source authors without attribution and in violation of explicit license statements in the code.

I did no such thing. Please stop.

CyberShadow··on Microsoft forked MIT licensed repo and changed the copyright [fixed]
> Here is an example. This Go program (a compiler) generates and serves its own website: https://NN-512.com

Not a very good one - clicking the link produces a download dialog on Firefox (I'm guessing because the website neglects to indicate a Content-Type).

Ironically this is an argument against trying to do everything yourself - you might waste time chasing the long tail of thousands of little details that had been solved many times over elsewhere.

CyberShadow··on Microsoft forked MIT licensed repo and changed the copyright [fixed]
> An accident still needs to be flagged, and still needs to be corrected.

Yes. Additionally, the way such actions are performed is not great because the mechanism used does not provide any way to provide feedback - if the change was done by a user account, then they would have received notifications about the comments posted under the commit, but the ones received by the service account probably go nowhere.

CyberShadow··on Microsoft forked MIT licensed repo and changed the copyright [fixed]
The account which did the change has this description:

> This is the open source management service account used for performing key GitHub operations on behalf of Microsoft employees and users.

Combined with the nonsense README change, this looks like a bot mis-use accident.

Edit: to clarify, in no way am I saying that this is a "honest mistake" which does not deserve scrutiny.

CyberShadow··on SpeedCrunch
It's by design. The option calc-multiplication-has-precedence controls this behavior.
CyberShadow··on SpeedCrunch
Emacs Calc (not unlike much of the rest of Emacs) is a little ... special. By default, it calculates 4/2*2 as 1, because multiplication has a higher precedence than division.

https://orgmode.org/manual/Formula-syntax-for-Calc.html

CyberShadow··on Fq: Jq for Binary Formats
This related project, on the other hand, embraced it (for better or for worse):

https://github.com/jzelinskie/faq

CyberShadow··on Exa - A Modern Replacement for ls
I think, except for very large volumes, automated paging is inferior to terminal scrollback. It is conditionally modal (thus conflicts with muscle memory) and you can't see previous output and the paged output at the same time (quitting the pager restores the terminal contents). I turned mine off in Git.
CyberShadow··on Exa - A Modern Replacement for ls
I'm finding the website much more exciting than the tool itself. Which is not a criticism of the tool - the website is just really neat!
CyberShadow··on YouTube-dl's first release since June 2021
No. Also, I tried that with youtube-dl but it doesn't work reliably (throttling still takes effect, with all but one connection simply timing out). [1]

yt-dlp uses a different method than youtube-dl (I believe it uses the API used by the Android app, instead of by the youtube.com website).

[1]: https://github.com/CyberShadow/turbotuber

CyberShadow··on Apple Helps Asahi Linux
Some context: "Asahi Linux is a project and community with the goal of porting Linux to Apple Silicon Macs, starting with the 2020 M1 Mac Mini, MacBook Air, and MacBook Pro."

https://asahilinux.org/about/

CyberShadow··on Show HN: 10-40% faster LZMA decoder using x86 CMOVcc
> I don’t really understand the point you’re trying to make. Figuring out if a value is unused is most definitely the purview of an optimizer.

If the conditional move doesn't happen, then the source (insofar as the move is concerned) is unused.

Consider this pseudocode:

    int value = some_nontrivial_function_with_no_side_effects();
    if (condition)
        *target = value;
Note that the function can be as simple as a memory read.

The compiler could compile this in two ways:

1. Observing that the function's result is used only if condition is true, move the function call inside the if block.

2. Always call the function, as in the source code, but compile the if block to a conditional move.

In such situations, it would make sense to allow programmers to indicate the desired strategy to the compiler.

I suppose CPUs might elide calculating the value even with a conditional move if they can predict the condition is [likely to be] false; I don't know how true that is in practice.

> Also, the “calculating a value” isn’t really the trade off being made between cmov and branching.

Depending on the situation and interpretation of terms, I also agree.

← PreviousPage 4 of 15Next →