How to use ALPN in Netty with OpenJDK 1.8.0_252

I am trying to use ALPN in Netty with OpenJDK 1.8.0_252 and I get the following exception:

java.lang.NoClassDefFoundError: org/eclipse/jetty/alpn/ALPN$Provider
    at io.netty.handler.ssl.JettyAlpnSslEngine.newServerEngine(JettyAlpnSslEngine.java:60)
    at io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator$AlpnWrapper.wrapSslEngine(JdkAlpnApplicationProtocolNegotiator.java:141)
    at io.netty.handler.ssl.JdkSslContext.configureAndWrapEngine(JdkSslContext.java:360)
    at io.netty.handler.ssl.JdkSslContext.newEngine(JdkSslContext.java:330)

According to https://github.com/jetty-project/jetty-alpn-agent :

“Starting with OpenJDK 1.8.0_252 the use of jetty-alpn-agent is not strictly required anymore since the standard ALPN APIs have been backported to OpenJDK 1.8.0_252 from Java 9.”

So it seems that the Jetty ALPN extensions shouldn’t be necessary. Any thoughts on how to configure Netty so the Jetty ALP agent isn’t required when I know I am running on open JDK 1.8.0_252?

mysql 5.5 – Performance at finding all foreigns with 3 one-to-many relation

Basically, I have 2 tables : user and object. One user can be associated to one object by three ways (roles). I want to list all users associated at least to one business object by any role.

This query works, but it takes 5 seconds !

SELECT u.id
FROM user u
LEFT JOIN translation_revision t1
    ON u.id = t1.translator_id
LEFT JOIN translation_revision t2
    ON u.id = t2.proofreader_id
LEFT JOIN translation_revision t3
    ON u.id = t3.reviewer_id
wHERE t1.id IS NOT NULL
    OR t2.id IS NOT NULL
    OR t3.id IS NOT NULL
GROUP BY u.id   

Complete fiddle with creation and data here : https://www.db-fiddle.com/f/nojYaUsWicKJDuRQk1Nqd2/7

Any idea on how to improve perf here ?

multi signature – How do Bitcoin balances work when an address is controlled by multiple parties together?

Bitcoin balances conceptually are not like bank account balances, but more akin to banknotes: uniquely identifiable, good for a specific amount, and can only be spent in full. The “account balance” shown by your wallet is simply the sum of funds that the wallet knows how to spend. In the case of your multisig example, if user1, user2, and user3 each have their own wallet but each wallet keeps tracks of the multisig unspent transaction output (utxo) as its own, they would each see it as part of their balance.

Basically, it’s up to the users to decide how to interpret the spendability of their shared funds. The network would enforce that they would only be able to spend the UTXO once in total, though. Alternatively, it’s possible that they share one “watch-only” wallet to track the balance, but each hold their own separate key. In that case this shared watch-only wallet would track the balance only once, but they’d each hold their own key independently.

So, concretely, the users’ balances after the transaction from user4 would be:

user1, pubkey1, 1.1 BTC
user2, pubkey2, 1.2 BTC
user3, pubkey3, 1.3 BTC
user4, pubkey4, 1.0 BTC
{user1,user2,user3}, 2-of-{pk1,pk2,pk3}, 0.4 BTC

Where the last UTXO is controlled by the multi-party address as described and has different spending properties than the individual balances of the the users.

animation – Animating 1D cellular automata with the entire grid in sight

You can use PadRight and PadLeft to pad the matrix with zeroes.

One possible solution is

Module({rule = 20, max = 20, ca},
 ca = CellularAutomaton(rule, {{1}, 0}, {max, All});
 Animate(
  ArrayPlot(
   (* Display only the first n rows of ca and pad the rest with zeroes *)
   PadRight(ca((;; n)), {max + 1, 2 max + 1}),
   Mesh -> True
   ), {n, 1, max, 0}, AnimationRunning -> False)
 )

Why people overrated over coronavirus when there have been worst pandemics within a life time ago?

Because there were eventually vaccines for those.  This one is a long way from being done, it’s already past halfway to a million deaths and cases around the world per day are double what they were at the end of May – 100,000 a day then, 200,000 a day now. And there is no vaccine on the horizon. Might be a year before there is one AND it can be distributed to the whole world.

A also do not believe the death numbers from China, Russia, Brazil, Ecuador, India and other countries are anywhere near the actual numbers, and of course, North Korea doesn’t tell the truth about anything. Not one death?

There could already be well over a million dead.

dnd 5e – Does the spell Rope Trick fail if the rope is longer than the height of the room?

The entirety of the rules for this spell are in the spell description. The first paragraph reads:

You touch a length of rope that is up to 60 feet long. One end of the rope then rises into the air until the whole rope hangs perpendicular to the ground. At the upper end of the rope, an Invisible entrance opens to an extradimensional space that lasts until the spell ends.

You touch a length of rope. It rises into the air (and continues to rise until the whole rope is perpendicular to the ground). The upper end of the rope has an invisible entrance to an extradimensional space. Nowhere does it say that the spell fails under any circumstances.

It’s a judgment call by the DM what the rope actually does if the spell is cast in a space with not enough room for the whole rope. But “at the upper end of the rope, an Invisible entrance opens” regardless.

It doesn’t say that the extradimensional space opens after the “whole rope” has risen into the air. It just says that it opens at the top end of the rope.

The way I’ve always seen this played is that the rope simply rises to the ceiling and the door to the extradimensional space is in the ceiling. There’s good precedent for that in previous editions of D&D. In AD&D 1st edition, the Rope Trick spell description reads as follows:

The caster causes a rope from 5′ to 30′ in length to vertically straighten, rising into the air as if afixed by its upper end. The upper end is fastened to an extradimensional space that the caster and up to 5 others can enter, one at a time.

In this version of the spell, it’s much more clear that the extradimensional space is already open when the rope begins to rise. This provides a resolution to the ambiguity of the 5th edition version. The DM could simply rule that this is how the spell still works in 5e. There’s nothing in the 5e spell description to contradict that.

macos – Karabiner: How to remap keyboard shortcut on non-English keyboard to work as on US English keyboard

For a MacOS app I use (Notion), I wish to toggle the sidebar via the app-designated keyboard shortcut + . This shortcut works fine on US English keyboard layouts, but not on the Swedish keyboard I’m using.

The key that is reserved for (next to Return) on US English keyboards, instead types ' on Swedish keyboards.

I presumed that Karabiner-Elements could potentially solve this problem by remapping the shortcuts.

However, when inspecting Karabiner-EventViewer, it shows that pressing ' appears as in the event log:

type:key_down        code:49         name:backslash       misc:
type:key_up          code:49         name:backslash       misc:

If Karabiner-Elements interprets the key ' as , then it would seem I’m out of luck to remap these keys, since I’m assuming the script would essentially build on being able to discern between these two keys.

I’m not experienced with Karabiner, but below is roughly how I intended to solve the problem using a Complex Modification in karabiner.json. Please note that I have copied bits from other sources and adapted them – I don’t know if the structure and options are correct as they are untested.

As you can see, it probably doesn’t make sense to rebind from "key_code":"backslash" to "key_code":"backslash".

{
   "manipulators":(
      {
         "description":"Notion: Remap CMD + ' to CMD + Backslash",
         "from":{
            "key_code":"backslash",
            "modifiers":{
               "mandatory":(
                  "right_command"
               )
            }
         },
         "to":(
            {
               "key_code":"backslash",
               "modifiers":(
                  "right_command"
               )
            }
         ),
         "conditions":(
            {
               "type":"frontmost_application_if",
               "bundle_identifiers":(
                  "^notion.id"
               )
            }
         ),
         "type":"basic"
      }
   )
}

How can I solve this problem? Can Karabiner-elements be made to accurately interpret ' in its EventViewing capacity, or can I use some key designation in the JSON specific to '? Or use some other solution entirely?

Architect website ordering without authentication

I am trying to design a website where a visitor can order food without having to authenticate. Here is the workflow I am hoping to achieve:

  • User visits website /food to see menu items. The webpage would show a cart symbol clicking which should take the user to their selected items.

  • Once the user has added items and clicks on the cart, the user should now see a prompt for a valid phone number. We will validate it using an OTP number(one time password) similar to what Amazon has in the U.S and many websites in India.

  • After validating phone number, we redirect the user to a payment gateway landing page from where they do the payment.

  • After a successful payment, we redirect the user back to our website with confirmation. We could either show a QR code or just sms an order number.

Some of the roadblocks I see around the workflow:

  • We need to find a way to save the cart selection for some time(5 mins) even if the user closes the browser. Is it possible without any sort of user information?
  • Can we generate a unique QR code for (every order placed and every phone number) combination?
  • Is it possible to be able to identify the user device and associate to phone number in the future?