google sheets – How to link to source cell from filter output

I have a simple query that outputs columns A and B of a project dataset, when the value in column A is not empty:

QUERY(Projects!A2:B, “SELECT A,B WHERE A<>””)

This creates an easy to scan highlight of the important project data (in my case, project name and next action item). However, the project details are in another tab, so if I want to examine the project, I have to copy the name, go to the tab, and search for the project.

It would be super nice if the output of the QUERY could automatically hyperlink to the source data. Or maybe there is a hotkey I can press to jump to the source. Does this feature exist?

output – Why does vout sometimes not have address?

I am trying to parse all transactions.

I found that some transactions do not have addresses in their vout.

There are two situations that vout does not have addresses.

The first one is the miner reward.

For example, run this:

bitcoin-cli getrawtransaction 4bec1175f9682fc10118bbb146d1def8fd82fdffdf27da8beea327469f79b2b0 true.

Here is the result:

{

  "txid": "4bec1175f9682fc10118bbb146d1def8fd82fdffdf27da8beea327469f79b2b0",

  "hash": "4bec1175f9682fc10118bbb146d1def8fd82fdffdf27da8beea327469f79b2b0",

  "version": 1,

  "size": 135,

  "vsize": 135,

  "weight": 540,

  "locktime": 0,

  "vin": [

    {

      "coinbase": "048521131a028d00",

      "sequence": 4294967295

    }

  ],

  "vout": [

    {

      "value": 50.25892368,

      "n": 0,

      "scriptPubKey": {

        "asm": "04994b2548a865ad7e786c691bb9cac7d15afc60b8b4500e24e79ec1cd910830b7dd799defdfdc1a7136e4976d2086daa319a7923f633987905a86aaece612ab9b OP_CHECKSIG",

        "hex": "4104994b2548a865ad7e786c691bb9cac7d15afc60b8b4500e24e79ec1cd910830b7dd799defdfdc1a7136e4976d2086daa319a7923f633987905a86aaece612ab9bac",

        "type": "pubkey"

      }

    }

  ],

  "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff08048521131a028d00ffffffff011008912b01000000434104994b2548a865ad7e786c691bb9cac7d15afc60b8b4500e24e79ec1cd910830b7dd799defdfdc1a7136e4976d2086daa319a7923f633987905a86aaece612ab9bac00000000",

  "blockhash": "00000000000009e63c0dc84756b1f535b0c8d7c51b849e60b6ce893a9c6a4d51",

  "confirmations": 506698,

  "time": 1308295622,

  "blocktime": 1308295622

}

You can see there is no addresses field in the first and only object of vout.

The second one is not a miner reward.

For example, run this:

bitcoin-cli getrawtransaction 4caea993e7caa859840a8ebac457c31420bb4fb79b528d870556c5a2eec5da7a true.

Here is the result:

{

  "txid": "4caea993e7caa859840a8ebac457c31420bb4fb79b528d870556c5a2eec5da7a",

  "hash": "4caea993e7caa859840a8ebac457c31420bb4fb79b528d870556c5a2eec5da7a",

  "version": 1,

  "size": 234,

  "vsize": 234,

  "weight": 936,

  "locktime": 0,

  "vin": [

    {

      "txid": "c245fbf8c03de1ab3372f72cafbd40ef47882fc0aba02c424e70cb4b44c65241",

      "vout": 0,

      "scriptSig": {

        "asm": "304502200eee831084af8de8ebac477d3c56b5a4d428522df0ccaed41ede77570eac27a5022100af5786d35cdef15a97a775542217a7e9ee85b06d4f07c50bab768bce189e3d9e[ALL]",

        "hex": "48304502200eee831084af8de8ebac477d3c56b5a4d428522df0ccaed41ede77570eac27a5022100af5786d35cdef15a97a775542217a7e9ee85b06d4f07c50bab768bce189e3d9e01"

      },

      "sequence": 4294967295

    }

  ],

  "vout": [

    {

      "value": 115.00000000,

      "n": 0,

      "scriptPubKey": {

        "asm": "OP_DUP OP_HASH160 208bbec311f62e7881ee746d7f3a6ba097203815 OP_EQUALVERIFY OP_CHECKSIG",

        "hex": "76a914208bbec311f62e7881ee746d7f3a6ba09720381588ac",

        "reqSigs": 1,

        "type": "pubkeyhash",

        "addresses": [

          "13y62oZbRtF4SJx2sezC3PvvDBfXx42jJb"

        ]

      }

    },

    {

      "value": 2.00000000,

      "n": 1,

      "scriptPubKey": {

        "asm": "0405d71f20e493a0721e705944e7151a1d7c1b9a9cd546cc44c2f348fa6e27b588ddfdd7b3e52c9af208598f3b2ac519af9d7ee78cea4f237ee5028020e33633c9 OP_CHECKSIG",

        "hex": "410405d71f20e493a0721e705944e7151a1d7c1b9a9cd546cc44c2f348fa6e27b588ddfdd7b3e52c9af208598f3b2ac519af9d7ee78cea4f237ee5028020e33633c9ac",

        "type": "pubkey"

      }

    }

  ],

  "hex": "01000000014152c6444bcb704e422ca0abc02f8847ef40bdaf2cf77233abe13dc0f8fb45c2000000004948304502200eee831084af8de8ebac477d3c56b5a4d428522df0ccaed41ede77570eac27a5022100af5786d35cdef15a97a775542217a7e9ee85b06d4f07c50bab768bce189e3d9e01ffffffff02001374ad020000001976a914208bbec311f62e7881ee746d7f3a6ba09720381588ac00c2eb0b0000000043410405d71f20e493a0721e705944e7151a1d7c1b9a9cd546cc44c2f348fa6e27b588ddfdd7b3e52c9af208598f3b2ac519af9d7ee78cea4f237ee5028020e33633c9ac00000000",

  "blockhash": "000000000000098444048edc683a41d26be975e302019a51a7ca3c2cc21d4813",

  "confirmations": 506676,

  "time": 1308309497,

  "blocktime": 1308309497

}

You can see there is no addresses field in the second object of vout.

Please explain this or provide some keyword for me to search! Thank you guys!

terminology – Is it preferable to describe a computer’s ephemeral visual data output device as a “monitor”, “display”, “screen”, or something else?

In English language UIs, is it preferable to describe a computer’s ephemeral data visual data output device as a “monitor”, “display”, “screen”, or something else?

All three of those English words can be used as verbs and nouns, leading to a little potential confusion.

Is there a standard or commonly accepted recommendation?

neural networks – Using the features embedding of the output from a transformers to represent probabilities of categorical data

I was considering using a transformer, on input data which can be represented as an embedding, so I can use the attention mechanism in the transformer architecture. As my data is of variable input and output length and the input is sequential. My question is that my output data is suppose to be either numerical or probabilities for each output variable. The output was originally supposed to 13 numerical outputs but I decided to use a probability score as way of normalizing the output. My question is can I use two output vectors with 7 features each instead of 13 numeric outputs. Each feature would map to one of the original output vectors and the the last feature would always be 0. As PyTorch expects your output to be the same number of features as your input. My input variables are embedded as 7 features. Should this approach work, as I am unsure of how the loss function works or is there a loss function that would allow for this.

Blockchain transaction change output

I’m very new to this.
It’s hard to know for sure, but what’s most likely the case with the below transaction:

enter image description here

  1. Someone sent 25.99 bitcoin to another person/organization
  2. Someone sent 1 bitcoin to another person/organization
  3. Someone sent 26.99 bitcoin to another person/organization

utxo – What happens if 2 transaction spend to the same output?

I’m looking though the blockchain, and I’ve found 2 transactions in different blocks, which have the same hash:

block 91812:

    "result": {
        "hash": "00000000000af0aed4792b1acee3d966af36cf5def14935db8de83d6f9306f2f",
        "confirmations": 545294,
        "strippedsize": 616,
        "size": 616,
        "weight": 2464,
        "height": 91812,
        "version": 1,
        "versionHex": "00000001",
        "merkleroot": "49991d7653bec6efebee7d11f27ca2dffcc35ebe95ee5eebd602916b2f2fa665",
        "tx": [
            {
                "txid": "d5d27987d2a3dfc724e359870c6644b40e497bdc0589a033220fe15429d88599",
                "hash": "d5d27987d2a3dfc724e359870c6644b40e497bdc0589a033220fe15429d88599",
                "version": 1,
                "size": 133,
                "vsize": 133,
                "weight": 532,
                "locktime": 0,
                "vin": [
                    {
                        "coinbase": "0456720e1b00",
                        "sequence": 4294967295
                    }
                ],
                "vout": [
                    {
                        "value": 50.00000000,
                        "n": 0,
                        "scriptPubKey": {
                            "asm": "046896ecfc449cb8560594eb7f413f199deb9b4e5d947a142e7dc7d2de0b811b8e204833ea2a2fd9d4c7b153a8ca7661d0a0b7fc981df1f42f55d64b26b3da1e9c OP_CHECKSIG",
                            "hex": "41046896ecfc449cb8560594eb7f413f199deb9b4e5d947a142e7dc7d2de0b811b8e204833ea2a2fd9d4c7b153a8ca7661d0a0b7fc981df1f42f55d64b26b3da1e9cac",
                            "type": "pubkey"
                        }
                    }
                ],
                "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff060456720e1b00ffffffff0100f2052a010000004341046896ecfc449cb8560594eb7f413f199deb9b4e5d947a142e7dc7d2de0b811b8e204833ea2a2fd9d4c7b153a8ca7661d0a0b7fc981df1f42f55d64b26b3da1e9cac00000000"
            },
            {
                "txid": "777ed67c58761dcaf3762e64576591c8d39317bcbebf0cb335e138d6ea438ce2",
                "hash": "777ed67c58761dcaf3762e64576591c8d39317bcbebf0cb335e138d6ea438ce2",
                "version": 1,
                "size": 402,
                "vsize": 402,
                "weight": 1608,
                "locktime": 0,
                "vin": [
                    {
                        "txid": "f98b11a5f11d08c3ac31c465092bb5d4c09bd2c815fa23959d654ef9b91414f1",
                        "vout": 0,
                        "scriptSig": {
                            "asm": "3044022068b2a587ec9374325c17c79f9102358fdd0574eeb3bebea08affab3e07afd93c0220248ac15de4e2b6391ff12c348ba6cc024448dba20611a40a35f8b67b6f966cd5[ALL] 046d337916441e20c469623303b47fd0c23326956a183e3274801f1a863e04b7f1dc2bee3388292571955955f8a24445ae35781dd9e39e8472bff623d3375f490e",
                            "hex": "473044022068b2a587ec9374325c17c79f9102358fdd0574eeb3bebea08affab3e07afd93c0220248ac15de4e2b6391ff12c348ba6cc024448dba20611a40a35f8b67b6f966cd50141046d337916441e20c469623303b47fd0c23326956a183e3274801f1a863e04b7f1dc2bee3388292571955955f8a24445ae35781dd9e39e8472bff623d3375f490e"
                        },
                        "sequence": 4294967295
                    },
                    {
                        "txid": "0c4d26699fbd1dd2ecc564ee3f02afd2e5f1837e03044fffa838b1283a2f7cb3",
                        "vout": 0,
                        "scriptSig": {
                            "asm": "304402206ccc7e10f33ed2e73c000780e972c479cf0a74d4a5825d74eebb8ec87d31da3202207a945ff0062c9df5d7a9c51483f0d8fc9d0cad1670319c8fbebde2198f8eea22[ALL] 0450a6524d0f7519571e8fb761ac8285f88c5ad9976454ee2148db5e0d13caa534f6bc56678a328dab8319fd62feabc977e478776c9cf0e705575be61dccdf8383",
                            "hex": "47304402206ccc7e10f33ed2e73c000780e972c479cf0a74d4a5825d74eebb8ec87d31da3202207a945ff0062c9df5d7a9c51483f0d8fc9d0cad1670319c8fbebde2198f8eea2201410450a6524d0f7519571e8fb761ac8285f88c5ad9976454ee2148db5e0d13caa534f6bc56678a328dab8319fd62feabc977e478776c9cf0e705575be61dccdf8383"
                        },
                        "sequence": 4294967295
                    }
                ],
                "vout": [
                    {
                        "value": 20.00000000,
                        "n": 0,
                        "scriptPubKey": {
                            "asm": "OP_DUP OP_HASH160 dda4521a9cd99e92323ae4762467dab928b65f45 OP_EQUALVERIFY OP_CHECKSIG",
                            "hex": "76a914dda4521a9cd99e92323ae4762467dab928b65f4588ac",
                            "reqSigs": 1,
                            "type": "pubkeyhash",
                            "addresses": [
                                "1MCwBbhNGp5hRm5rC1Aims2YFRe2SXPYKt"
                            ]
                        }
                    }
                ],
                "hex": "0100000002f11414b9f94e659d9523fa15c8d29bc0d4b52b0965c431acc3081df1a5118bf9000000008a473044022068b2a587ec9374325c17c79f9102358fdd0574eeb3bebea08affab3e07afd93c0220248ac15de4e2b6391ff12c348ba6cc024448dba20611a40a35f8b67b6f966cd50141046d337916441e20c469623303b47fd0c23326956a183e3274801f1a863e04b7f1dc2bee3388292571955955f8a24445ae35781dd9e39e8472bff623d3375f490effffffffb37c2f3a28b138a8ff4f04037e83f1e5d2af023fee64c5ecd21dbd9f69264d0c000000008a47304402206ccc7e10f33ed2e73c000780e972c479cf0a74d4a5825d74eebb8ec87d31da3202207a945ff0062c9df5d7a9c51483f0d8fc9d0cad1670319c8fbebde2198f8eea2201410450a6524d0f7519571e8fb761ac8285f88c5ad9976454ee2148db5e0d13caa534f6bc56678a328dab8319fd62feabc977e478776c9cf0e705575be61dccdf8383ffffffff0100943577000000001976a914dda4521a9cd99e92323ae4762467dab928b65f4588ac00000000"
            }
        ],
        "time": 1289757588,
        "mediantime": 1289756309,
        "nonce": 1166692788,
        "bits": "1b0e7256",
        "difficulty": 4536.353723275037,
        "chainwork": "00000000000000000000000000000000000000000000000001b349c8e6a815b0",
        "nTx": 2,
        "previousblockhash": "000000000002afe839294d4e038b5c831bc09632fd717c0980f8f216dc2b360f",
        "nextblockhash": "0000000000006626b8604240c5bb5305830e67fcfa8bae10d64cea0e2eb121d4"
    },
    "error": null,
    "id": "183626"
}

and block 91842

{
    "result": {
        "hash": "00000000000a4d0a398161ffc163c503763b1f4360639393e0e4c8e300e0caec",
        "confirmations": 545263,
        "strippedsize": 214,
        "size": 214,
        "weight": 856,
        "height": 91842,
        "version": 1,
        "versionHex": "00000001",
        "merkleroot": "d5d27987d2a3dfc724e359870c6644b40e497bdc0589a033220fe15429d88599",
        "tx": [
            {
                "txid": "d5d27987d2a3dfc724e359870c6644b40e497bdc0589a033220fe15429d88599",
                "hash": "d5d27987d2a3dfc724e359870c6644b40e497bdc0589a033220fe15429d88599",
                "version": 1,
                "size": 133,
                "vsize": 133,
                "weight": 532,
                "locktime": 0,
                "vin": [
                    {
                        "coinbase": "0456720e1b00",
                        "sequence": 4294967295
                    }
                ],
                "vout": [
                    {
                        "value": 50.00000000,
                        "n": 0,
                        "scriptPubKey": {
                            "asm": "046896ecfc449cb8560594eb7f413f199deb9b4e5d947a142e7dc7d2de0b811b8e204833ea2a2fd9d4c7b153a8ca7661d0a0b7fc981df1f42f55d64b26b3da1e9c OP_CHECKSIG",
                            "hex": "41046896ecfc449cb8560594eb7f413f199deb9b4e5d947a142e7dc7d2de0b811b8e204833ea2a2fd9d4c7b153a8ca7661d0a0b7fc981df1f42f55d64b26b3da1e9cac",
                            "type": "pubkey"
                        }
                    }
                ],
                "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff060456720e1b00ffffffff0100f2052a010000004341046896ecfc449cb8560594eb7f413f199deb9b4e5d947a142e7dc7d2de0b811b8e204833ea2a2fd9d4c7b153a8ca7661d0a0b7fc981df1f42f55d64b26b3da1e9cac00000000"
            }
        ],
        "time": 1289768691,
        "mediantime": 1289767893,
        "nonce": 3778549762,
        "bits": "1b0e7256",
        "difficulty": 4536.353723275037,
        "chainwork": "00000000000000000000000000000000000000000000000001b55d6596dd0790",
        "nTx": 1,
        "previousblockhash": "00000000000a1e92acbcbdf594cac25d1095544d5fbf5113bfec85a9eb4b1120",
        "nextblockhash": "0000000000016ca756e810d44aee6be7eabad75d2209d7f4542d1fd53bafc984"
    },
    "error": null,
    "id": "183686"
}

Both have coinbase transactions, which spend to d5d27987d2a3dfc724e359870c6644b40e497bdc0589a033220fe15429d88599-0. Also, first transaction output is not spent by the time second transaction is added to blockchain.

What does this mean? If d5d27987d2a3dfc724e359870c6644b40e497bdc0589a033220fe15429d88599-0 is ever one of the inputs, how much bitcoin does it contain? 50 or 100?

utxo – How can I create a transaction that spends an anyonecanspend output using btc-lib?

I managed to create an UTXO that only contains “OP_TRUE” as script:

{
"value": 0.00000546,
"n": 1,
"scriptPubKey": {
    "asm": "1",
    "hex": "51",
    "type": "nonstandard",
    "isTruncated": false
}

I have the txid and the vout number. Now I would like to create a tx that spends this utxo but I can’t manage to do it using btc-lib.

this is what I tried:

    var utxodata = {}
    utxodata.txid = mytxid
    utxodata.vout = 1
    utxodata.script= "0x51"
    utxodata.satoshis = 546
    var tx = new btc.Transaction().from(utxodata)
    tx = tx.to(myaddress, 546)
    tx = tx.sign(myprivateKey)

which gives:

Error: Invalid script: "0x51"

Can you provide some help please?

python – Output shape of keras.layers.Embedding

I was watching a video on datacamp to learn about Keras, and the instructor used layers.Embedding with keras.layers.Flatten, but he did not really explain the output of the Embedding function properly. I have googled it for like 3-4 hours and could not find anything that could help me.

Objective explained in words: So here is what he was trying to do in normal English. The input data consists of a bunch of college basketball team IDs. Since the ID does not really tell us anything about the team, he used Embedding with an input shape of 1, output shape of 1, and an input dimension equal to the number of teams. He then said that our neural network would “learn” in such a way to associate this new output from embedding as a rating of the basketball team which would be helpful to predict the outcome if two teams had not previously played against each other. Then, (and here is where I got lost) he said that Embedding would actually add an extra dimension to the array so we would have to flatten using keras.layers.flatten().

As I understand it, if I input a team id into Embedding, the output (once the neural network has learned all its parameters) would be ((team_id),(team_rating)), and after flattening, it would be ((team_id,team_rating)). However, the way he described it, after flattening, there would be only one output number: the team_rating. This was especially implied when he added a subtracting layer which would subtract two outputs from this flattened layer (giving the team_rating difference) which would be used to predict the outcome of the game.

Here is the full code from input layer to output layer (Note you probably don’t need to read the code to answer the question, but it helps add context)

n_teams = unique(games_season('team_1')).shape(0)

# Create an embedding layer
team_lookup = Embedding(input_dim=n_teams,
                        output_dim=1,
                        input_length=1,
                        name='Team-Strength')

# Create an input layer for the team ID
teamid_in = Input(shape=(1,))

# Lookup the input in the team strength embedding layer
strength_lookup = team_lookup(teamid_in)

# Flatten the output
strength_lookup_flat = Flatten()(strength_lookup)

# Combine the operations into a single, re-usable model
team_strength_model = Model(teamid_in, strength_lookup_flat, name='Team-Strength-Model')

# Input layer for team 1
team_in_1 = Input((1,),name='Team-1-In')

# Separate input layer for team 2
team_in_2 = Input((1,),name='Team-2-In')

# Lookup team 1 in the team strength model
team_1_strength = team_strength_model(team_in_1)

# Lookup team 2 in the team strength model
team_2_strength = team_strength_model(team_in_2)

# Create a subtract layer using the inputs from the previous exercise
score_diff = Subtract()((team_1_strength, team_2_strength))

# Subtraction layer from previous exercise
score_diff = Subtract()((team_1_strength, team_2_strength))

# Create the model
model = Model((team_in_1, team_in_2), score_diff)

What I don’t get is

A. The input into Embedding/Flatten is a team ID, but isn’t the output a list consisting of both the team_id AND the team_rating (since embedding adds an extra dimension(team_rating), and flatten brings the value in that dimension to the same dimension as the original input(team_id) . The instructor was passing it off as if there would only be one output: the team_rating

B. If the output actually is a list of both the team_id and the team_rating, wouldn’t we want to pick out ONLY the team_rating for future processing such as subtraction of team_rating between different teams?

python – How to get code for this output for coding of receipt

Thanks for contributing an answer to Code Review 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.

plotting – Display `Table` output as a 3D bar chart

You could try using some Cuboid‘s:

f[i_, j_] := i*j;
data = Table[f[i, j], {i, 1, 25}, {j, 1, 25}];

bar[{i_, j_}, h_] := 
 Cuboid[{i - 0.5, j - 0.5, 0}, {i + 0.5, j + 0.5, h}]
Graphics3D[{
  MapIndexed[bar[#2, #1] &, data, {2}]
  }, BoxRatios -> 1
 ]

cuboid chart

… and here I’ve spiced it up with colour, axes, and cylinders:

huescale = MinMax[data];
bar[{i_, j_}, h_] := {Hue[Rescale[h, huescale]], 
  Cylinder[{{i, j, 0}, {i, j, h}}, 0.5]}
Graphics3D[{
  MapIndexed[bar[#2, #1] &, data, {2}]
  }, BoxRatios -> 1, Axes -> True, AxesLabel -> {i, j, f}, 
 Lighting -> "Neutral"
]

cylinders chart