WordPress – Custom SQL query on wp_users with the addition of wp_usermeta

I am trying to query a list of user id’s in WordPress using SQL IN() with the addition of them having a meta_value value of “Yes” on the meta_key “is_registered” in the wp_usermeta table but I can’t seem to get this to work. It just returns 0 results. If I use just the IN() with the array of ID’s, it works fine.

Here is what I am using:

SELECT DISTINCT wp_users.ID FROM wp_users LEFT JOIN wp_usermeta ON ( wp_users.ID = wp_usermeta.user_id ) WHERE wp_users.ID IN(23,643,574,617,26) AND wp_usermeta.meta_key = 'is_registered' AND wp_usermeta.meta_value = 'Yes' 

Can anyone see what I am doing wrong here as I’ve been racking my brain with it for what feels like forever now!


Why is validating the integrity of the plaintext necessary in addition to validating the integrity of the cipher text?

Reading the iOS Security Guide’s description of the iMessage encryption protocol I’m trying to figure out why they included a mechanism for verifying the integrity of the plaintext as well as verifying the integrity of the final cipher text (emphasis added).

For each receiving device, the sending device generates a random 88-bit value and uses it as an HMAC-SHA256 key to construct a 40-bit value derived from the sender and receiver public key and the plaintext. The concatenation of the 88-bit and 40-bit values makes a 128-bit key, which encrypts the message with it using AES in CTR mode. The 40-bit value is used by the receiver side to verify the integrity of the decrypted plaintext. This per-message AES key is encrypted using RSA-OAEP to the public key of the receiving device. The combination of the encrypted message text and the encrypted message key is then hashed with SHA-1, and the hash is signed with ECDSA using the sending device’s private signing key.

What does this additional signature component add to the authenticity of the message?

Python: My program is unable to perform addition correctly

I was trying to solve a problem which stated:

Calculate the first 10 digit prime found in consecutive digits of e.

I was able to solve the problem but I did it by using some 10k digits of e available online. So I tried to write a program which calculates digits of e. The problem is that it simply gives the incorrect answer.

The code and the formula I used are:

enter image description here

import math  e=0  x=int(input()) #larger this number, more will be the digits of e  for i in range(x):     e+=(1/(math.factorial(i)))  print(e) 

When the user inputs 10, the digits returned are 2.7182815255731922 which is not correct.

Can someone explain why is my code buddy?

matlab: addition of symbolic matrices along an unused dimension

How can symbolic matrices collected in a cell array be summed along an unused dimension? Assume, for reasons beyond the scope of this post, that the matrices must be the elements of a cell array, rather than planes of a higher-dimensional matrix. What follows is a brief demonstration of the problem.

Suppose we have a cell array of 2D sym vectors prepared as follows:

a = vpa(ones(2,2)); c = {a; 2*a; 3*a}; 

Despite the fact that it is possible to make multidimensional symbolic matrices with newer versions of matlab (e.g., sym('c', [2 2 2])), addition of 2D sym matrices along a third dimension fails

sum(cat(3, c{:}), 3)     Error using symengine     Arguments must be 2-dimensional. 

With numeric inputs, the operation is successful:

a = ones(2,2); c = {a; 2*a; 3*a}; sum(cat(3,c{:}), 3)     6    6     6    6 

Algorithm: Calculate every number in a given list using addition and numbers you’ve created

I’m creating an algorithm to calculate every number in an array using only addition and numbers we’ve created – in the shortest amount of steps. That’s confusing so here is an example:

input: [5, 11], used numbers (start with 1): [1] 1+1=2, used: [1, 2] 2+2=4, used: [1, 2, 4] 1+4=5, [1, 2, 4, 5] 5+5=10, [1, 2, 4, 5, 10] 10+1=11, [1, 2, 4, 5, 10, 11] 

We have hit 5 and 11 so we are done in 5 steps. There are other ways to get [5, 11], eg. [1, 2, 3, 5, 6, 11]. They are the same amount of steps. Imagine we have input [5, 11, 20]. Now it matters which we choose above because [1, 2, 4, 5, 10, 11] only requires one more step, 10+10.

The input can be hundreds of numbers. Certainly I can’t attempt every possibility. I was thinking about an “elegant” solution using prime factors. If my input is [16, 30, 36, 40], does it help me to think about this as [2*2*2*2, 2*3*5, 2*2*3*3, 2*2*2*5]? I’m not sure. I’ve also thought about using the differences of each input, eg. [16, 30, 36, 40] would give me [14, 6, 4, 20, 24, 10], but I’m not sure how to use that either.

Any thoughts?

Is the +10 Stealth bonus of pass without trace in addition to a characters current strength bonus? (DnD 5e)

I know pass without a trace is strong, but it seems absolutely ridiculous if characters can add +10 to their already high stealth bonus. For instance, with a stealth bonus of 8 (which is perfectly achievable for a rogue) you can not physically roll stealth under 19. So is this even the way you should play pass without a trace?

Is the sequence $\left(\pi\left(\frac{n(n+1)}2+1\right)\right)_{n\ge1}$ an addition chain?

A (finite or infinite) strictly increasing sequence with the initial term $ 1$ is called an addition chain if each term after the initial one can be written as the sum of two earlier (not necessarily distinct) terms. For example,

$ $ a_1=1,\ a_2=1+1=2,\ a_3=2+2=4, \ a_4=4+2=6,\ a_5=4+4=8,\ a_6=8+6=14$ $

is an addition chain for $ 14$ . For the basic knowledge about addition chains, one may consult the wiki article on addition chains available from http://en.wikipedia.org/wiki/Addition_chain .

For $ x > 0$ let $ \pi(x)$ denote the number of primes not exceeding $ x$ . Let us consider the sequence $ $ s_n = \pi\left(\frac{n(n+1)}2+1\right)\ \ (n = 1,2,3,…) \tag{$ *$ }.$ $ The first 20 terms of this sequence are

$ $ 1,\, 2,\, 4,\, 5,\, 6,\, 8,\, 10,\, 12,\, 14,\, 16,\, 19,\, 22,\, 24,\, 27,\, 30,\,33,\, 36,\, 39,\, 43,\, 47.$ $

Question. Is the sequence $ (*)$ an addition chain?

I formulated this question in 2015 (cf. http://oeis.org/A262446), and verified that for each $ n=4,5,\ldots,10^5$ we have $ s_n=s_k+s_m$ for some $ 1\le k<m<n$ .

Your comments (including further check via a computer) are welcome!

Squared Relative and Square Absolute Addition

I am writing a typed math library in Haskell and have separate types for relative and absolute coordinates.

The addition operator can add:

  • a relative to a relative resulting in a relative
  • a relative to an absolute resulting in an absolute
  • an absolute to a relative resulting in an absolute

The subtraction operator can subtract:

  • an absolute from an absolute resulting in a relative
  • a relative from a relative resulting in a relative

If I start considering squared relatives and squared absolutes, will allowing the addition and subtraction operators operate between squared relative and squared absolute ever result in a meaningful value for euclidean geometry? I suspect not but have no way to prove it.

Identify row or column addition or deletion in excel

I’m looking for a solution which can able to identify the any row or column addition or deletion in a excel file.

What I have thought of as of now by using the LCS i.e. “Longest common sub-sequence” algorithm I can find out the common sub-sequence between two versions of a excel file, but this method is not 100% correct.

For e.g.

Excel version 1

 1 2 4 5 9 3  4 9 3 7 5 3  8 2 7 9 3 8  9 7 2 8 2 4 

After update, I remove 1 row (2nd row) and added 1 row (at same place i.e. 2nd).

Excel Version 2

 1 2 4 5 9 3  4 9 5 7 5 3  8 2 7 9 3 8  9 7 2 8 2 4 

Added row is almost similar except 1 cell item. In this case LCS would not work as it most of the cell items would be similar and I can’t able to identify row was removed first and a new row was added.

Is there a mirror actuation count limit in addition to shutter actuation count limit in DSLRs?

Every time you take a picture on a DSLR, not only does the shutter actuate but also the mirror actuates.

If using the LCD preview, and using phase detect autofocus, the mirror actuates too: the phase detect autofocus works only when the mirror is directing the light to the viewfinder. This time, the mirror is actuated when focusing, so if you need to focus multiple times before taking a photograph, the mirror actuates multiple times.

My questions are:

  • Is the mirror actuation count limited like the shutter actuation count?
  • Can you read the mirror actuation count somehow in modern DSLRs?
  • Which is a more limiting factor: a limited mirror actuation count or a limited shutter actuation count?