mysql.connector.errors.ProgrammingError: Not enough parameters for the SQL statement

# script de carga 
import csv 
import mysql.connector

# conexao com o banco 
mysql = mysql.connector.connect(
    host='0.0.0.0',
    user='root',
    passwd='mysql',
    database='mydesenv',
    port=3306
)
cur=mysql.cursor()
sql = """insert into mydesenv.tb_load (id, nm_name, dt_load) values (%s, %s, %s)"""
#passo01 - Ler arquivo .csv
csv_data = csv.reader('/Users/eduardoaandrad/Dropbox/Desenv/Script/csv/carga_teste.csv',delimiter=';')
for row in csv_data:
    print(row)
    cur.execute(sql,row)

mysql.commit()
cur.close()

Google sheets – Exception: the parameters (null) do not correspond to the method signature for FormApp.Form.getItemById. (line 38, "Code" file)

when i run the script below i get the message – Exception: The parameters (null) don't match the method signature for FormApp.Form.getItemById. (line 38, file "Code")
so far, it works. I don't know what happened but it started to show this error:

var ssID = "1Z7uUBnzS5zKnxGswKKNAgn2XbRunqIzQZMATDl7skoE";
var formID = "1LxORhL2WgU6teJ11ax7_HsFxhbpXbjtFXiuPH5qfEfA";

var wsData = SpreadsheetApp.openById(ssID).getSheetByName("Questions#1");
var form = FormApp.openById(formID);

function updateDropdown(id,values) {
  var item = form.getItemById(id);
  item.asListItem().setChoiceValues(values);
}

Help us find the problem and solve it!

postgresql 11 – Need a function to execute different requests depending on the parameters sent

New for advanced sql stuff. I store constants. The constants have three possible ranges: local, users, global. Two tables: s0constants_user contains the defined values ​​of the constants, s0constants contains the definitions and the values ​​of the constants.

    CREATE TABLE public.s0constants_user (
    constant_name bpchar(15) NOT NULL,
    empfkey int2 NOT NULL,
    constant_value bpchar(255) NULL,
    locality_name bpchar(30) NULL,
    id serial NOT NULL,
    CONSTRAINT s0constants_user_pk PRIMARY KEY (id)
);
CREATE INDEX s0constants_user_constant_name_idx ON public.s0constants_user USING btree (constant_name, empfkey, locality_name);

CREATE TABLE public.s0constants (
constant_name bpchar(15) NOT NULL,
constant_value bpchar(255) NULL,
constant_data_type bpchar(1) NULL,
cttype int4 NULL,
displayname bpchar(30) NULL,
actiontype int4 NULL,
note text NULL,
const_scopefk int4 NOT NULL DEFAULT 3, -- 1=local¶2- user¶3=global
CONSTRAINT "S0CONSTANTS_pkey" PRIMARY KEY (constant_name),
CONSTRAINT scope_fk FOREIGN KEY (const_scopefk) REFERENCES s0constants_scopelk(id)

I realize that I could do it with separate tables for each staff, but I would love to do this work even if it is just a learning exercise.
I need a function to return a constant value and data type given the constant name and empfkey. There are different queries for each constant scope.
local – constant_name, empfkey, locality_name
user – constant_name, empfkey
global – constant_name
The constant names are unique across the three ranges. I thought a case declaration could do this, but I'm having trouble limiting it to one row of data and setting up subqueries.
This is my first pass to that, but I can't figure out how to get the "cdt" column in the subqueries or if so, the right track:

public.const_get( stname text, empid INT, locality text ) returns TABLE(cvalue text, ctype text)
    LANGUAGE sql
     STABLE PARALLEL SAFE
AS $$

   select c.const_scopefk, c.constant_data_type as cdt
     ,case 
       when const_scopefk = 1 then
       ( select scu.constant_value, c.cdt
        from s0constants_user scu 
        where (scu.constant_name = constant_name 
           and scu.empfkey = empid
           and scu.locality_name = locality))

       when const_scopefk  = 2 then 
        (select scu.constant_value, c.cdt
        from s0constants_user scu 
        where (scu.constant_name = constant_name 
           and scu.empfkey = empid))

      when const_scopefk  = 1 then 
        (select scu.constant_value, c.cdt
        from s0constants_user scu 
        where (scu.constant_name = constant_name ))
    end 
   from public.s0constants c
   where  c.constant_name = UPPER(constname);

python – Error passing numpy.core._exceptions.UFuncTypeError parameters: ufunc & # 39; subtract & # 39; did not contain matching loop signature types (dtype (& # 39; <U21 & # 39;)

Basically I have the following code:

import numpy as np

def localize(aux1, aux2, aux3, aux4, aux5, aux6):

    search = np.array(((aux1,aux2,aux3,aux4,aux5,aux6)))

    B1A = np.array(((-46,-78,-72,-70,-81,-59)))     #B1A
    B1B = np.array(((-100,-82,-85,-100,-76,-55)))   #B1B
    B1C = np.array(((-100,-100,-100,-78,-100,-58))) #B1C
    B2A = np.array(((-100,-88,-100,-100,-100,-60)))  #B2A
    B2B = np.array(((-100,-78,-79,-80,-80,-59)))     #B2B

    candidatos = (B1A, B1B, B1C, B2A, B2B)
    margem_erroP = 10.0
    margem_erroN = -10.0

    distancias = candidatos(::) - search

    avaliar_dist = np.where(np.absolute(distancias) < margem_erroP, True, False) 
    avaliar_distN = np.where(np.absolute(distancias) < margem_erroN, True, False)

    vetores_aprovados = avaliar_dist.all(axis=2)
    vetores_aprovados += avaliar_distN.all(axis=2)

    posicao_aprovados = np.array(np.where(vetores_aprovados== True)(0))

    print("---- Resultado ----")
    print()
    print("Busca: {}".format(search))
    print("Resultado: ")
    for x in posicao_aprovados:
        print(candidatos(x))

        here = candidatos(x)(-1)
        print("Aquii")
        print(here)

        if posicao_aprovados(0) == 0:
            print("Local: B1A")
            local = "B1A"
        elif posicao_aprovados(0) == 1:
            print("Local: B1B")
            local = "B1B"
        elif posicao_aprovados(0) == 2:
            print("Local: B1C")
            local = "B1C"
        elif posicao_aprovados(0) == 3:
            print("Local: B2A")
            local = "B2A"
        elif posicao_aprovados(0) == 4:
            print("Local: B2B")
            local = "B2B"
        else:
            local = "não encontrado"

    x = {
        "search" : search.tolist(),
        "locale" : local,
        "result" : here.tolist()
    }
    json.dumps(x)
    return x

So far so good, it works as it should!

The problem is when I try to execute this function from another location. For example:

I have a variable find which contains the following string: '-100,-67,-63,-49,-53,-48'

Since I have to pass 6 values ​​and in this case I only pass 1 (a string), I separate my string into whole numbers using the following command:
valores = find.split(",")

Now my list becomes this: ('-100', '-67', '-63', '-49', '-53', '-48')

To make my function work, I did it as follows: aux = localize.localize(valores(0),valores(1),valores(2),valores(3),valores(4),valores(5))

In other words, what I'm doing is basically: localize.localize(-100 -67 -63 -49 -53 -48)

However, this does not work by returning the error:
distancias = candidatos(::) - search numpy.core._exceptions.UFuncTypeError: ufunc 'subtract' did not contain a loop with signature matching types (dtype(' dtype('

IMPORTANT TO MENTION THAT
If I call my function passing the values ​​directly like this: aux = localize.localize(-100,-70,-68,-55,-53,-55)
It works perfectly but going in that other direction, which I need, won't work at all.

I came to think that it didn't work because there was no comma separating each integer value, so I did it as follows: localize.localize(valores(0)+',',valores(1)+',',valores(2)+',',valores(3)+',',valores(4)+',',valores(5))

What came to pass:

localize.localize(-100,-67,-63,-49,-53,-48) which didn't work either.

I would like help to understand how I can pass values ​​functionally and across variables as I have described it. Thanks in advance for any help

If that helps, I leave the function I am trying to perform underneath. It is a POST of an API that comes with certain parameters (coordinates) and the algorithm will help me tell where the coordinates are closest. It is only after receiving the data and checking the location that the data is saved in the bank. I was printing everything to see how the data got there hehe

@app.route('/api/v1/resources/positions/app', methods=('POST'))
def positions_post_app():
    conn = sqlite3.connect('locale.db')
    conn.row_factory = dict_factory
    cur = conn.cursor()
    users = request.get_json()
    for user in users:
        user_id = user('user_id')
        find = user('search')
        date = user('date')

#        print("valor que chega!")
#        print(find)
#        valores = find.split(",")
#        print("lista de inteiros")
#        print(valores)
#        print("Tabela atualizada:")
#        print(valores(0)+',',valores(1)+',',valores(2)+',',valores(3)+',',valores(4)+',',valores(5))

#        aux = localize.localize(-100,-70,-68,-55,-53,-55) #FUNÇÃO FUNCIONANDO
         aux = localize.localize(valores(0),valores(1),valores(2),valores(3),valores(4),valores(5))

        locale = aux('locale')
        result = aux('result')
        print("insert into positions values(NULL, '{}','{}', {}, {}, '{}')".format(user_id, find, result, locale, date)) #PRINT PARA VER COMO FICARIA O SQL 

#        cur.execute("insert into positions values(NULL, '{}','{}', {}, {}, '{}')".format(user_id, search, result, locale, date))
#        conn.commit()
    return {'Status' : 'Success'}

Unity – How to manipulate the parameters of post-processing effects during execution with C #?

I need to change the intensity value of my current Vignette effect according to specific conditions.
So far, I have not been able to achieve this. Help me!

Image of what I want to achieve:
enter description of image here

My configuration:

  • Unity 2019.3.5f1 with URP implemented
  • Post-processing package (v2) installed
  • Scene with a GameObject + Volume component with Vignette and Bloom effect overrides added
  • A single behavior component script in the same GameObject from above

My monobehavior script:

using UnityEngine;
 using UnityEngine.Rendering.PostProcessing;

 public class PostProcessingHandler : MonoBehaviour
 {
   private PostProcessVolume _ppv;
   private Vignette _vignette;

   // Vignette intensity values
   (SerializeField, Range(0f, 1f))
   private float _lowIntensity = 0.25f;
   (SerializeField, Range(0f, 1f))
   private float _highIntensity = 0.5f;

   private void Start()
   {
     Debug.Log("PostProcessingHandler");
   }
 }

When I try to get the PostProcessingVolume component to get its profile (and other layer manipulations), I always get "no".

Image of my configuration:
enter description of image here

I have seen several guides / publications and even Unity documentation but I cannot go beyond this starting point to get the PostProcessingVolume component, what am I missing?

asymptotic – How to approach Big O evidence that involves multiple parameters

I am becoming more and more familiar with the whole concept of temporal complexity but I have never come across an example where more than one parameter is involved. Therefore, is it possible (well, I'm sure: ")) and how to prove

a ^ n = Θ (logn)

or any other expression of similar appearance?

c1 * logn ≤ a ^ n ≤ c2 * logn

where, for example c1 = 1 and c2 = 2,

logn ≤ a ^ n ≤2 * logn.

Can I go further and define n, to be equal, for example 2? This way i will

log (2) ≤ a ^ 2 ≤ log (4)

Which is surely true (for one between ~ 0.55 and 0.77) …

… but isn't it too specific and does it interfere too much with inequality? Sorry if the answer is trivial but Google does not help and I have no one to ask for an explanation.

seo – Impact on Google Shopping of the blocking of UTM parameters in the Robots.txt file

I am optimizing the website crawling experience because a large part of the site is not crawled.

Much of the "crawl budget" is used for crawling URLs with utm parameters for Google Shopping.

If I block crawling of these settings in the robots.txt file, will this have an impact on Google Shopping ads?

I am having trouble finding confirmation of uses of Googlebot Google Merchant. I think if it is using Adsbot – Google, I will block the settings only for normal Googbot, but allow Adsbot.

My question;

  • Does Google Merchant use Adsbot?
  • If not, will blocking these Googlebot pages have a negative impact on the purchase campaign?
  • If this is the case, are there any other alternatives to prevent Googlebot from wasting time on these
    pages?

group theory – How to use Mathematica to prove that isotropic materials have only two independent parameters

Articles on related issues can be found here or here.


Index Symmetries:

A stiffness tensor $ C $ is a fourth order tensor with components $ c_ {ijkl} $ which maps second order symmetric tensors to second order symmetric tensors, that is, $ sigma_ {ij} = c_ {ijkl} varepsilon_ {kl} $ (linear elastic law), $ sigma $ (stress) and $ varepsilon $ (deformation) being arbitrary symmetric tensors of the second order. Due to the symmetry of the second order tensors, $ C $ is allowed to be symmetric minor, that is to say, $ c_ {ijkl} = c_ {jikl} = c_ {ijlk} $. The non-minor symmetrical part of $ C $ is not relevant for the elastic law and is deleted. If the stress $ sigma $ must be linked to an elastic energy potential $ W $ (called hyperelastic behavior), that is, $ sigma = partial W / partial varepsilon $, then, due to Schwarz's theorem, the stiffness tensor $ c_ {ijkl} = partial ^ 2 W / partial varepsilon_ {ij} partial varepsilon_ {kl} $ must have major symmetry, that is to say $ c_ {ijkl} = c_ {klij} $.

Material symmetry:

Rigid material $ C $ is supposed to have the material symmetry group $ G $ (for example, triclinical, orthotropic, transversely isotropic, …) if

start {equation}
C = Q star C qquad Q in G
end {equation}

holds where $ Q $ are second order tensors, called symmetry transformations of $ C $. The product $ hat {C} = Q star C $ (here called Rayleigh product) is defined in the components as

start {equation}
hat {c} _ {ijkl}
= Q_ {im} Q_ {jn} Q_ {ko} Q_ {lp} c_ {mnop}
end {equation}

For solids, $ G $ is a subset of the orthogonal group. In solid mechanics, it suffices to consider the rotation matrices $ Q $ of the rotation group $ N / A (3) $. Yes $ G = {I } $, $ I $ being the identity matrix, then $ C $ is said to be triclinical. Yes $ G $ has more than identity transformation, so different classes of materials can be defined (different types of anisotropy). Yes $ G = N / A (3) $, the $ C $ is said to be isotropic (no directional dependence).


I want to use Mathematica to get the number of independent parameters necessary for the fourth-order tensor to do $ C = Q star C (Q in SO (3)) $ under group rotation $ N / A (3) $.

Right now, I can only get 30 independent variables using the following method:

SymmetrizedIndependentComponents({3, 3, 3, 3}, 
  Symmetric({1, 2, 3})) // Length

However, I still cannot use group rotation $ N / A (3) $ to further reduce the number of independent variables. What should I do?

Call to a method with empty parameters in Python

I am implementing a recursive method which checks if the chain What happened to the method is a palindrome or not.

  def recursivePal(self, string):
  if string==None or len(string)==1:
      return True
  else:
      n=0
      x=len(string)
      if len(string)==1:
          return True
      else:
          if string(n)==string(len(string)-1):
              return self.recursivePal(string(n+1:x-1:))
          else:
              return False

As you can see, I have a check when the field is No (which I think would be the equivalent in java when I check a no) but I would like to know how to check that the field is completely empty, that is to say:

print(l.recursivePal())

without Python returning the error to me:

TypeError: recursivePal() missing 1 required positional argument: 'string'

Is it possible?
Thanks in advance.