wp query – Meta_query on the same meta key with different values

I try to get users with the meta_query where I have to find users who either have the meta key missing or are empty.

It seems like I'm looking everywhere, I should be able to use the OR for the relation and then use the same meta key, but whatever I set it up, it will not work.

My code:

$ors() = array(
   'key'   => 'death_date',
   'compare' => '=',
   'value' => '',
   'type' => 'NUMERIC'                    
);
$ors() = array(
   'key'   => 'death_date',
   'compare' => 'NOT EXISTS'                    
);

$args = array(
   'meta_query' => array(
   'relation' => 'or',
   $ors,
));

$return = get_users($args);

Both work separately, but not together.

postgresql – Efficient storage of key values ​​in Postgres

I want to use Postgres (11 in CloudSQL) as an efficient key-value store. I have about 200 GB of dictionaries. I'm thinking about using improved hash indexes. Here is the scheme:

        CREATE EXTENSION IF NOT EXISTS "uuid-ossp";

        CREATE TABLE IF NOT EXISTS key_val (
            id uuid DEFAULT uuid_generate_v4(),
            value jsonb,
            EXCLUDE using hash (id with =)
        );

        CREATE INDEX IF NOT EXISTS idx_key_val ON key_val USING hash (id);

Getting, updating, and pasting are pretty straightforward, but I'm not sure how to implement efficient upserting.

INSERT INTO key_val VALUES ($1, $2) ON CONFLICT ON CONSTRAINT key_val_id_excl DO UPDATE SET value = ($2)

Results in WrongObjectTypeError ON CONFLICT DO UPDATE not supported with exclusion constraints

Possible solution:

  1. Upsert https://stackoverflow.com/a/8702291/336186
  2. Use hstore, but i would lose json query improvements and a single tail can have 20kb +
  3. Use btree – lookups would be slower (estimate 2x-3x) and the index would be much larger.
  4. Other option

Measurement – How to find surface roughness values ​​in Mathematica

Thank you for your reply to Mathematica Stack Exchange!

  • Please be sure too answer the question, Provide details and share your research!

But avoid

  • Ask for help, clarify or respond to other answers.
  • Make statements based on opinions; Cover them with references or personal experience.

Use MathJax to format equations. Mathjax reference.

For more information, see our tips for writing great answers.

Response to the reactive operator for unique values ​​that must change by amount

I would like feedback on this DistinctUntilChangedBy Operator for System.Reactive These are only output if the current value deviates from the last value by a certain amount. Is there a better implementation?

I want to avoid multiple transmissions when the stream looks like this: 0.80, 0.81, 0.80, 0.81, and so on.

Use the operator as follows:

stream.DistinctUntilChangedBy(0.01).Subscribe(x => Console.WriteLine(x));

Should this spend:

0.80

The operator looks like this and can also be found on GitHub:

using System;
using System.Collections.Generic;
using System.Reactive.Linq;

namespace Gists.Reactive.Linq
{
    public static partial class ObservableExtensions
    {
        ///
        ///Only emit when the current value is different than the last by the specified amount.
        ///    
        public static IObservable DistinctUntilChangedBy(this IObservable source, decimal amount)
        {
            return source.DistinctUntilChanged(new DistinctUntilChangedByEqualityComparer(amount));
        }

        private class DistinctUntilChangedByEqualityComparer : IEqualityComparer
        {
            private readonly decimal amount;

            public DistinctUntilChangedByEqualityComparer(decimal amount)
            {
                this.amount = amount;
            }

            public bool Equals(decimal x, decimal y)
            {
                var diff = Math.Abs(x - y);
                return diff <= Math.Abs(amount);
            }

            public int GetHashCode(decimal obj)
            {
                throw new NotSupportedException();
            }
        }
    }
}

Average values ​​of column values ​​that are either placed in a separate column or in a workflow variable

I've been investigating – and although I've found a lot of helpful articles nearby, nothing is exactly what I need.

I'm trying to either populate a variable in a workflow OR a column with the average values ​​of all numbers in an existing column (ie, multiple list items). I can not use the "sum", etc. above (or below) on the page. This must be a real value that I can work with and display.

Excel – VBA – Copying values ​​as you type into one column and pasting into another worksheet – Where am I wrong?

As the title implies, I try to copy and paste values ​​to save as a log because these values ​​are deleted shortly after they are entered.

In short, a user scans a barcode and a unique string corresponding to the scanned barcode is automatically entered into the selected cell (usually A2). These strings are parent barcodes, so immediately after scanning into A2, the user begins to scan their subordinate barcodes in B2, B3, and so on. This depends on how many substrings there are (always a completely random number).

I have so far:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim ws As Worksheet
Dim intRow As Integer
Dim intCount As Integer

Set ws = Worksheets("log")
intRow = ws.Range("A1").CurrentRegion.Rows.Count + 1

'Check if WandID exist in log.
If Target.Address = "$A$2" Then
    intCount = Application.WorksheetFunction.CountIf(ws.Range("D:D"), Target.Value)
    If intCount <> 0 Then
        Target.Interior.Color = RGB(255, 0, 0)
        MsgBox "this wandID has already been used, please try a different barcode"
        Range("A2").ClearContents
        End
    Else
        Target.Interior.Color = xlNone
        ws.Cells(intRow, "D") = Target.Parent.Range("A2")
        ws.Cells(intRow, "E") = Target
    End If
End If

End Sub

On the target worksheet (named "Log") I set up a simple spreadsheet to organize the copied / scanned data and added some dummy data as the first entry. As this workbook is used regularly, this process should continue. Scanned codes below the previous code (dummy parent code in D2, dummy child codes in E2: E9). So, if I put a new parent code in A2 of the source sheet, it should ideally be copied to D10 of the target sheet. Corresponding child codes added to B2, etc. of the source sheet should be copied to E10, etc. of the target sheet. Instead, the parent code is added to D10: E10.

I have a feeling for the line

"ws.Cells (intRow," E ") = Target"

is the problem, but not sure what to change.
Any help or advice would be very grateful!

Chromium – capture Delphi input values ​​(TChromium)

Good Morning

I'm using HTML, CSS, and JavaScript to create a chat layout for a messaging system I'm developing. All right, but due to a caveat problem I found in TWebBrowser, I switched to TChromium. It helped me in many ways, but I'm wondering how I can get the values ​​of an input my HTML code. With TWebBrowser I used the following code arqID := Browser.OleObject.Document.All.Tags('input').item('arqID').value;

Does anyone know what equivalent function I have used in TWebBrowser (OleObject) in TChromium?

Formulas – Multiple unique values ​​in worksheets in Google Sheets

I rarely use spreadsheets, but I thought creating a workbook for a contest would be really helpful. I'm not sure if what I ask for is possible without a custom function. I am grateful for any help that is offered.

I'm trying to create a template that tracks a weekly writing contest. Each week is evaluated individually and added at the end of the month. I wanted to have a hand holding the grand total. I thought I could do a UNIQUE () search on every spreadsheet and print a single column. After this answer I tried

=UNIQUE({'Week1'!B2:B,'Week2'!B2:B,'Week3'!B2:B,'Week4'!B2:B})

This retrieves unique values ​​for each leaf, but arranges them in multiple columns. I was hoping to get just all the usernames in column A and then add the sums of each week in column B with a search formula. Here's the proof of concept workbook, if anyone can take a look.

Again, I appreciate any suggestions or instructions to get this going. If this is not possible, I can manually tabulate the grand totals, but I was hoping to streamline my workflow.