sql server – Foreign keys to primary tables or nested table

In this hypothetical example should the foreign key constraint setup for the ProductId and UserId columns in the ProductUserCommentAction table be referencing the Product/User tables as shown in the first diagram OR is it OK for those columns to reference the ProductUserComment table as shown in the second diagram?

I like how it’s setup in the second diagram as it reduces the spider web in visualizations.

Are there any downsides to this second approach?

enter image description here

Versus

enter image description here

macos – Send keys to app in background / send keys to other app without losing focus of current app

How can I make some automated service type something in a non-focussed application without making that other application the frontmost?

I found a StackOverflow answer which suggests using AppleScript:

tell application "System Events"
    tell process "Google Chrome"
        set frontmost to true
        key code 4
        key code 14
        key code 37
        key code 35
    end tell
end tell

Unfortunately at the time of that answer in 2018 there were apparently no ways to make this AppleScript and its target application run in the background.

How can I simulate keyboard input to a background application on macOS Catalina 10.15.5?

input fields – Forbid and deactivate alphanumeric keys in a form?

scenario: form validation

I ask myself the question: in a special input form for postcode for example, in which only numbers (integer) are allowed. In a usability view I would say, you should be allowed to input all keys (abcd, 1234), the logic should fit it in the background. Would you forbid and deactivate alphanumeric keys, that the user cannot put the wrong keys into the input field?
I think the user would be confused. What is your opinion?

The HTML-Input for numbers: no way. It is a desktop application on Windows.

Thank you!

shortcut keys – how to force gsettings change layout to work

i have a problem when i switching layout with Alt + Shift in some applications.
Using alt+shift not only changes the language, but also looses focus from the app text input area (in skype, slack, postman and some other apps)

according to this thread:

I have unchecked the checkbox in gnome-tweak-tool
and run two these commands:
gsettings set org.gnome.desktop.wm.keybindings switch-input-source "('<Shift>Alt_L')"
gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward "('<Alt>Shift_L')"

but they doesnt work and i cant switch the layout, looks like gsettings doesnt taken into consideration

keyboard – Why are names for Super, Meta and Hyper keys still in use?

As far as I know these keys were present on some keyboard that is extinct nowadays. I have to confess to have never seen any other keyboards in real life (save computer museums here) but standard 104/105 ones (as well as localised flavours of it) and Mac keyboards.

I am sure enthusiasts have some fancy keyboards with enormous amounts of extra buttons and it is probably true that computers that are neither PC, nor Mac come with their own keyboards. That being said, all these keyboards can hardly be called mainstream. Why are people in *nix world still sticking with these obsolete key names as though they corresponded to real keys?

All right, Super has a direct equivalent in what they call the Windows key in MS world, but the other two seem to belong to the time long past. I remember seeing instructions with phrases like «Meta is Alt» and in some cases it was «Meta is the same as Super». Hyper is even more enigmatic beast. I’d like to know if there are any reasons to use these names except for historical ones.

Are HD wallets private keys any different than regular private keys

Aside from the fact that HD wallets derive them deterministically, is it correct to state that keys driven at any path or index under BIP32 isn’t any different from a private key that’s derived randomly in a non-HD wallet?

In other words, its theoretically possible for someone to derive a private key that’s at a particular node under your master key in HD wallets, irrespective of how small the probability is, and actually the same probability that there is for generating a private key (non-deterministically) that’s already in use by someone else?

Essentially, private key being just a number in a specific range, you can either guess it randomly every single time or have a mechanism of generating random numbers, it essentially means the same thing and is possible to arrive at the same number from either of the ways.

Correct?

How to exchange public keys between two servers in a secure way?

I have 2 servers with pair of RSA public and private keys.

I need to establish a trust between 2 servers: I need to copy a public key form the first server to the second server and the public key from the second server to the first server.

Note that it is not Diffie–Hellman key exchange (that explained very well here “Diffie-Hellman Key Exchange” in plain English).

The simplest way is just manually copy the public keys from one server to another.
Additional option is to use the following homegrown flow:

  1. Generate a one-time token on the first server
  2. Copy the token manually to the second server
  3. The first servers accesses the second server via API. Ase the token for the API authentication. The API implementation exchanges public keys between servers

Any suggestions to improve the flow?

Do we have some best practices flow since homegrown flows usually bad for security?

pgp – GPG issues with sending and receiving keys

I’ve experimented a lot with GPG the last couple days and one issue persists:

Someone signed my GPG key and published it to a keyserver X. I can see on the webpage that his signature is shown under my key, so that worked. But my local PGP doesn’t understand:

gpg --keyserver (X) —refresh-keys (myKey)
gpg: refreshing 1 key from (X)
gpg: key (myKey): (...) not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

If I check my signatures, that new signature doesn’t appear.

gpg --list-sigs (myKey)
=> only outputs the signatures I already had before (either manually imported or signed by other keys that belong to me)

Also, when signing a key and performing a --send-keys, it throws no errors but the key just never arrives on the servers. This only happens with some keyservers. I read something about ports maybe being closed by the firewall, but didn’t find any concise answer for what to check and how to fix.

Thanks in advance!

PS: Sometimes, the webinterfaces of the keyservers I’m using just load forever or are generally very slow or unreachable, is this normal?

Is there a database of wallet addresses with lost private keys?

Hi is there a database of wallet addresses that have lost the private keys?

hash tables – Does making the keys of a hashtable the same length make the hashtable any better?

Thanks for contributing an answer to Computer Science Stack Exchange!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.

To learn more, see our tips on writing great answers.