usability – Let users choose a value’s unit next to the value input field

In our application users/developers are able to build their own web layouts via editor. Therefor, they need to define container sizes with either percentage (%) or pixels (px).
Currently, this choice can be made within the input field. I did not even know this until a co-worker told my about it – the placement of the unit choice within the input field was just not obvious to me and is difficult to learn for new users.

Current solution:

enter image description here

I came up with two alternative solutions:

(1) Choose the value’s unit via toggle switcher

(2) Choose the value’s unit via dropdown

enter image description here

One drawback I’m aware of is that the form starts to look more cluttered.

What are your experiences with use cases like this?
What are your thoughts about these alternatives?

calculus and analysis – Numerical Mixed Partial Derivatives: How to Choose Scale?

For illustration purposes, consider the function
$$ f(x, y) = (x – 1)^2 + (y – 1)^2 + sin(25(x+y)) . $$
The mixed partial derivatives at the origin are $f^{(x,x)}(0,0) = f^{(y,y)}(0,0) = 2$ and $f^{(x,y)}(0,0) = 0$ (the $sin$-term does not give any contribution).

I want to determine these derivatives numerically.
That is, let’s imagine I have only access to the function

f((x_)?NumericQ, (y_)?NumericQ) := (x - 1)^2 + (y - 1)^2 + Sin(25*(x + y))

as a numerical black box.
I would first try to solve the problem as follows:

N(D(f(x, y), {x}, {x}) /. x -> 0 /. y -> 0)
(* 2. *)

N(D(f(x, y), {y}, {y}) /. x -> 0 /. y -> 0)
(* 2. *)

N(D(f(x, y), {x}, {y}) /. x -> 0 /. y -> 0)
(* Derivative(1, 1)(f)(0., 0.) *)

In the first two cases, it just works.
However, for the mixed derivative, it is well known that the simple approach fails and one must use nested calls to ND instead. (To keep it short, I will do that the simple way, not using the trick described here to reduce the number of function calls.) Let’s try it:

Needs("NumericalCalculus`");
ND(f(x, 0), {x, 2}, 0)
(* 54.6838 *)

ND(f(0, y), {y, 2}, 0)
(* 54.6838 *)

ND(ND(f(x, y), x, 0), y, 0)
(* -8.40318 *)

Disaster!

The problem, of course, lies in the “scale” used for the differentiation.
We can explore how the results change as a function of the employed scale:

Table({
   ND(f(x, 0), {x, 2}, 0, Scale -> 10^-s),
   ND(f(0, y), {y, 2}, 0, Scale -> 10^-s),
   ND(ND(f(x, y), x, 0, Scale -> 10^-s), y, 0, Scale -> 10^-s)
   }, {s, 0, 6}
)

(*
{{54.6838, 54.6838, -8.40318},
 {2.00013, 2.00013, 7.46312*10^-6},
 {2., 2., -1.89464*10^-7},
 {2.00001, 2.00001, 9.40594*10^-6},
 {2.00063, 2.00063, 0.00106619},
 {2.08502, 2.08502, -0.0788629},
 {-5.68049, -5.68049, -20.9135}}
*)

As we can see, there is only a very narrow window for Scale where ND yields great results.
Yet, using N(D(...) /. ...) in the first example, the results for the non-mixed derivatives were perfect.
My question is: how does Mathematica manage to choose the scale perfectly using that approach?
Is there a way to make Mathematica automatically choose the correct scale also for the mixed derivatives?


Bonus question: could someone explain why the accuracy of the results starts to get worse at a scale of $10^{-3}$ already? I would have expected the accuracy to increase until we get close to the machine precision.
This works, for example:

h = 10^-8;
(f(h, 0) + f(-h, 0) - 2*f(0, 0))/h^2
(* 2 *)

dual boot – I can’t choose primary or logical partition on Kubuntu

So I’ve been trying to install Kubuntu, my computer is a bit weird. My BIOS is UEFI apparently (it shows “Press F1 to Enter UEFI BIOS”) but my Windows is on Legacy and MBR, now this wouldn’t matter but I just can’t install Kubuntu.
The first thing I did was prepare a 120GB unallocated space for Kubuntu, then I ran the Kubuntu installation, things were going smooth, I created the 4 partitions it asked for (root, home, swap and efi) until I got to the final part, in which it gave me a Fatal Error, where it said something along the lines “Failed to execute install GRUB on dev/sda/ THIS IS A FATAL ERROR” and then I got kicked out of the installation with the bug reports and yeah.

This happened some time ago when trying to install Mint, and what I did to fix it was set some partitions (iirc it was just the root partition) as primary, and it worked fine. But on Kubuntu I just can’t find a way to choose “primary” or “logical” partition type! On the installation partition setup I can only choose the size, the beginning or end of the thing, the filesystem and the mount point! Please help, I just need to know how to do this on Kubuntu and it will much probably fix my issue.
Also, I tried installing the bootloader at dev/sda8 for the first time (sda8 was the efi partition), but that was just the first time and I got the error, then I tried again, this time on dev/sda/ which is the default (and I think it’s also the most correct one) and it gave me the same thing. I doubt this is related though

EDIT: It did make my system unusable after the error, I tried to restart and GRUB rescue couldn’t find a system or something like that. So after some time I just used Boot Repair on Kubuntu Live USB and I’m now using Windows, waiting for an answer so that I can install Kubuntu. And I didn’t get the option to “Install alongside Windows 10”, I only got some GUIDED options and the Manual one, which was what I used

How do I choose new lightning channels in order to minimize hops when rebalancing?

Currently my fees are quite high when I try to rebalance and I noticed that I can’t rebalance some channels from any of my other channels. I have only six or seven channels and would like to expand to at least 10 for now.

Up until now my strategy for choosing nodes to open channels with was to use https://moneni.com/mcb/nodematch to maximise for the total number of nodes my node can reach with the least hops.

How do I choose new channels in order to minimize hops when rebalancing?

Currently my fees are quite high when I try to rebalance my channels and I noticed that I can’t rebalance some channels from any of my channels. I have only six or seven channels with capacities between 500.000 and 1.500.000 sats each and would like to expand to at least 10 channels for now.

Up until now my strategy for choosing nodes to open channels with was to use https://moneni.com/mcb/nodematch to maximise for the total number of nodes my node can reach with the least hops.

color – Why did eBay choose to go white over their yellow background?

Not that I liked the old yellow background, that was just straining on my eyes as well when I saw how the old site looked like. And I know their strategy was to make the change subtle. However, was there any reason for the change aside from the designer-of-the-day’s preference?

Is a pure white background generally better (if the user preference is “light mode” that is)? Over say something with a lower color temperature.

How choose a k for k-anonymity?

I have manually scraped multiple pages of search results on Google and haven’t found a single suggestion as to how to find an optimal k when you are trying to “k-anonymize” your dataset. All I can find is the obvious fact that “higher k = more security but more loss of information”, but not a single idea is given as to how to tackle this problem.

Shouldn’t a k of 2 suffice (as long as an l-diversity of at least l=2 is given)? Or should we go as high as 15, 20, 30, 100? I am fairly new to this topic and online materials offer no intuition whatsoever.

Do you know of any publicly available guidelines by organizations/companies/universities which discuss what value k to choose? Or any other resource?

How to choose printer when using chromes headless and kiosk-printing?

I want to use chromium to print html to a specific printer. I am currently using chromiums binary with the following command line switches: --headless and --kiosk-printing. I can’t however choose which printer it uses. This need to do that on linux and windows. Setting the default printer by hand is not an option since I need different printers for different types of print.

What PDF file format alternative should I choose if I am looking for more security in my document files?

There are tons of exploits being created using the PDF file format for most PDF viewers out there every year. PDF files have lots of power and can utilize things such as JavaScript. This is really good but comes with the cost that there is a lot of attack surface. The company “owning” PDF is also very restrictive about how we, the people, can use it (e.g. create our own PDF viewer isn’t going to make Adobe happy).

Is there a file format that can match the PDF file format’s capabilities of formatting documents but is more secure?

By more secure I mean: what I am looking for is a document file format that has <2% number of exploits published each year as PDF (e.g. top 3 PDF viewers combined), smaller code base, no JavaScript functionality because JavaScript is inherently insecure (look at why and how it was made and you’ll see very quickly JS is insecure). A good post about why PDF is inherently insecure: What are the security risks associated with PDF files?

This is not an “opinionated post” because I’ve seen lots of posts on “best C book out there” or “What are some good Game Engines?” and other posts. This is not a software recommendation post, but rather I want people to post options so there is at least one place on the internet where PDF File format competitors are set against the PDF file format.

Is there a site out there that lets you choose your own crypto (wallet) address?

As a crypto newbie, I did something very foolish. I transferred a fairly large amount of money to what I thought was my ETH address. However, it was not. Checking Etherscan, if I did it correctly, it looks like that address has never been involved in a transaction before.

Yes, I know… It was incredibly careless and ignorant of me to make such a mistake.

What I’m wondering now is this: Is there a site out there that would let me choose my own crypto address? My hope is that if I create the same wallet I sent to, my money would be there.