How to check if a column in a query can produce NULL?

I am scheming how to implement a type generator for arbitrary SQL queries.

I found that for any query, the simplest way to get the types of every column is to create a temporary table and then inspect that table. However, this tells nothing about which columns can be NULL.

I am interested to find a solution to identifying which columns can be NULL for any arbitrary query with the goal of generating types for that query.

What’s the way to go about it?

Can a Wish produce a paradox?

I have an idea for a cool chaotic BBEG. His/her ultimate goal is to completely destroy existence.

Could a Wish be cast in such a way as to create a paradox, allowing me to destroy existence? Or does the wish “altering reality” part of the spell indicate that it cannot produce a paradox?

For example, “I wish I was never born”?

Does Flock of Familiars produce endless wealth in the same manner as Find Familiar

With the most recent Sage Advice errata, find familiar can produce 27.5 gp more in sales of Sprite equipment than its own cost. Unfortunately, it takes an hour to cast and ~25 gp/hr is hardly an impressive amount of gp production.

Flock of Familiars can produce thrice the familiars in one-sixtieth the time, but I’m unsure if the equipment it creates is now permanent, real objects that stick around after the spell ends like with Find Familiar, or if the equipment created will vanish when the spell ends, thus rendering it useless for mass production.

Given that find familiar does, in fact, produce the above-stated wealth, what textual arguments can be made for and against flock of familiars similarly producing piles of equipment?

Can produce flame do damage on unarmed strike?

So I have seen previous questions regarding this situation, but all of them appeared to be for fun and silly one shots. What’s different in this case is I’m trying to run a long and intense campaign. The monk of the party recently gained the feat magic initiate and took the Druid cantrip produce flame. He asked me about when he used an unarmed strike while his hand was on fire if the damage from the fire would be added. I wasn’t sure so I just added a small amount of fire damage at the time. After doing f some research I understand that the flaming hand can do other things like holding a sword or a shield, but I don’t know if I should allow him to add damage. By the way I am new to DnD so I’m sorry if I missed something obvious which would answer my question.

Thank you for your time.

How can a wizard in d&d 5e produce effects that cannot be avoided?

I have been playing a wizard in a fairly long running campaign, at least by my standards. There have been a lot of good moments but after my third attempt to make disintegrate work, I have realised something: everything worth using a big spell on probably has a good enough save that the big spell won’t work.

Obviously, I don’t like that, so I have come to ask, what ways can a wizard use spells that are guaranteed to have at least some effect?

The suggestions are ideally achievable by 15th level, since that is the goal of the campaign,and should not require more than a dip into another class, hopefully keeping pure wizard.

Can you cast and hold Produce Flame and then wield a weapon and shield?

The text of the produce flame spell reads:

A flickering flame appears in your hand. The flame remains there for the duration and harms neither you nor your equipment. The flame sheds bright light in a 10-foot radius and dim light for an additional 10 feet. The spell ends if you dismiss it as an action or if you cast it again.

Emphasis mine. The druid in our party asked our DM if he is able to cast produce flame in a dark cave, then opt not to attack with it, and wield a shield and sword. The goal is to continue emitting light, since he doesn’t have the light spell. He claims that since the flame does not harm his equipment, he is able to hold a shield or sword with the fiery hand with no problem.

Is this okay to do RAW, or are we missing something?

This is specifically not asking about casting spells with a sword in hand. He wants to draw his weapon after casting and holding the flames.

Related, but not the same question: 1, 2, 3.

How do i produce keypairs for my users while implementing json web token

I want to check the integrity of my user information; that the information which my website server receives was indeed sent by them. From what I understand, json web tokens (jwt) is the way to go.

I want to use asymmetric keys for the signing. I know that key pairs can be generated using these commands:

openssl genrsa -out private.pem 2048 openssl rsa -in private.pem -outform PEM -pubout -out public.pem 

But how do I produce key pairs from javascript code for my users when they sign in. And how do I store the private key at the user end and the public key at the server end ?

AES encryption (in Java) of different JSON strings always produce same encrypted string as result. Why?

I have a program written in Java which takes JSON string as argument, encrypts it using AES then encodes it using Base64. JSON string is like:

{"a": "b"} or {"a": "n"} or {"a": "k"}  

I.e related object would have one property a. Value part is randomly generated.

Program outputs for above JSON inputs looks like

UBNvKoRoGqk0PTQQL5K4Sw== bKwlToSND3HkceDExEDXSw== u/yKJq1FdoifBM+AnadC3A== 

i.e. they are unique.

Same goes for {"a":"gn"} — random string with length 2. Same for 3 and so on.

But starting from 7 program produces the same encoded string for different inputs. I mean following JSON strings taken as input:

{"a": "pzfovvs"} {"a": "bqwuvck"} 

produces same string as output:


Same goes for length 8 and 9. Starting from 10 results became unique again.

What is the explanation of this strange phenomenon?

(I can post code if needed.)

Ok, here is the code:

import; import; import java.util.Base64; import javax.crypto.Cipher; import javax.crypto.KeyGenerator;  public class JWTEncryptor {  private static String algorithm = "AES"; private static Key key; private static KeyGenerator keyGenerator; private static Cipher cipher;  public static String encrypt(String jwt) throws Exception {     if (key == null || cipher == null) {         setUp();     }     cipher.init(Cipher.ENCRYPT_MODE, key);     return Base64.getEncoder().encodeToString(cipher.doFinal(jwt.getBytes("UTF-8"))); }  private static void setUp() {     try {         cipher = Cipher.getInstance(algorithm);     } catch (Exception e1) {         e1.printStackTrace();     }     if (keyGenerator != null) {         key = keyGenerator.generateKey();         return;     }     try {         keyGenerator = KeyGenerator.getInstance(algorithm);         key = keyGenerator.generateKey();     } catch (NoSuchAlgorithmException e) {         e.printStackTrace();     } }  public static String decrypt(String encryptedJWT) throws Exception {     cipher.init(Cipher.DECRYPT_MODE, key);     return new     String(cipher.doFinal(Base64.getDecoder().decode(encryptedJWT))); }   }