Error xhr.send( ( options.hasContent && options.data ) || null ); al enviar datos POST en Php

Salduos a todos.

Primero que todo, comento, que casi no sé nada de JavaScript y Ajax, por favor paciencia.

Tengo el siguiente código para insertar datos por Post en php:

function editar_aparatos(id) {             var parametros = {                 "action": "ajax",                 "id": id             };             $  .ajax({                 url: '../modal/editar/editar_aparatos.php',                 data: parametros,                 beforeSend: function(objeto) {                     $  ("#loader3").html("<img src='../../img/ajax-loader.gif'> Cargando...");                 },                 success: function(data) {                     $  (".outer_div3").html(data).fadeIn('slow');                     $  ("#loader3").html("");                 }             })         } 

Y al analizar el envío me presenta el siguiente error: xhr.send( ( options.hasContent && options.data ) || null );

Solo para llegar al error fue una odisea. No tengo ni idea de qué hacer.

Tengo otro código solo cambia la ruta y el objeto y funciona perfecto. (Lo coloco solo para fines de referencia):

function editar(id) {             var parametros = {                 "action": "ajax",                 "id": id             };             $  .ajax({                 url: '../modal/editar/consulta.php',                 data: parametros,                 beforeSend: function(objeto) {                     $  ("#loader2").html("<img src='../../img/ajax-loader.gif'> Cargando...");                 },                 success: function(data) {                     $  (".outer_div2").html(data).fadeIn('slow');                     $  ("#loader2").html("");                 }             })         } 

Gracias de antemano por la ayuda brindada.

How to parse JSON to return null as default if complex object empty/null/undefined?

Using HTTP Request to get SP item, having trouble parsing JSON to return anything for null object.

Can return null for an empty string column as shown below, how to do so for a more complex object like a lookup if no value selected?

{ "type": "object", "properties": {     "Area": {         "type": "object",         "properties": {             "Id": {                 "type": "integer"             }         }     },     "Package": {         "type": ["string","null"]     } } 

If object doesn’t exist in JSON output, can’t run logic against it (if null do this, else do that)

null inesperado en system.out.println

Pidiendo nombre, apellido y año de nacimiento al usuario se genera una clave provisoria, primero se separan las consonantes y las vocales de cada cadena por separado (nameC consonante, lastnC consonante, nameV vocales, lastnV vocales) luego se estima una edad restando el año ingresado a 2019.

La clave que genera esta compuesta por las consonantes de la cadena mas larga en mayúscula (nombre o apellido), las vocales en orden inversa de la cadena mas corta, también en mayúsculas y a lo ultimo la edad estimada.

Si ingreso para name = “Luis” lastname = “Espinoza” yearbirth = 1995 la clave debería ser: SPNZIU24 Sin embargo, la salida muestra: NULLSPNZIUNULL24 ¿Porque aparecen esos NULL?

import java.util.Scanner;  public class Key{  private Scanner sc = new Scanner(System.in); private String name; private String lastName; private String nameC; private String nameV; private String lastnC; private String lastnV; private String key; private int years; private int yearbirth = 0;  private void registration(){      System.out.println("Bienvenido a codigoJava, para ingresar necesitaremos unos pocos datos...");     System.out.println("Porfavor ingresa tu nombre");     name = sc.nextLine();     System.out.println("Porfavor ingresa tu apellido");     lastName = sc.nextLine();     System.out.println("Y para terminar año de nacimiento");     while(yearbirth<1900 || yearbirth>2019){         yearbirth = sc.nextInt();     } }  public int years(int yearbirth){     years = 2019 - yearbirth;     return years; }  private void keyBuilder(){      for(int i = 0; i < name.length(); i++){         if(name.charAt(i) == 'a' || name.charAt(i) == 'e' || name.charAt(i) == 'i' || name.charAt(i) == 'o' || name.charAt(i) == 'u' ){             nameV = name.charAt(i) + nameV;         }else{             nameC = nameC + name.charAt(i);         }     }     for(int o = 0; o < lastName.length() ; o++){         if(lastName.charAt(o) == 'a' || lastName.charAt(o) == 'e' || lastName.charAt(o) == 'i' || lastName.charAt(o) == 'o' || lastName.charAt(o) == 'u' ){             lastnV = lastName.charAt(o) + lastnV;         }else{             lastnC = lastnC + lastName.charAt(o);         }     }      if(lastnC.length() > nameC.length()){         key = lastnC.toUpperCase() + nameV.toUpperCase() + years(yearbirth);         System.out.println(key);     }else{         key = nameC.toUpperCase() + lastnV.toUpperCase() + years(yearbirth);         System.out.println(key);     } }    public static void main(String[]args){      Key newUser = new Key();     newUser.registration();     newUser.keyBuilder();  } 

}

Filter icon for “include null”

I’m designing an e-commerce site that allows for filtering on items based on attributes such as weight, size, price, etc. The problem is for certain attributes, like “weight”, some items have data, and others do not.

A user filtering by “weight” may want to be strict (only include items whose weight is known and in the desired range), or they may want to be lenient (include items whose weight is in the desired range, or unknown).

I could provide a checkbox that says “Include items with unknown weight”, but would much rather have this be a tooltip on some sort of icon button. The problem is, I’m unsure of what icon to use.

I’ve looked through Google’s Material Icons and cannot find anything that fits, nor can I even conceptualize what a good icon would look like. I’m hesitant to even mention the word “null” anywhere.

I’m stuck with three options:

  1. Make an button that says “n/a”, which is either pressed down, or not. The tooltip will will say “Including items with unknown weight”

    • Pros: Provides the user with the option.
    • Cons: Not simple. Another thing for the user to think about.

  1. Avoid this choice altogether and have no option. But what would the expected behavior be if the user is filtering by weight — hide items with unknown weights, or show items with unknown weights?

    • Pros: Simple.
    • Cons: May not meet user’s expectations. If hiding null values, may hide items the user cares about. If showing null values, may show too many null-weight items and give the appearance the filter is not working.

  1. Avoid the choice and have no options — if they are filtering by weight, then show items with unknown weights, but also include some sort of warning symbol on the item indicating the weight is unknown.

    • Pros: Simple.
    • Cons: Results may contain too many items with no weights and cause the user to scan too much.

Call to a member function store() on null

Estoy haciendo un formulario que envia un logo de empresa a almacenar pero recibo el error Call to a member function store() on null que segun entiendo es porque el campo se encuentra vacio, revise mi consola y en la url note que el archivo si se envia pero con este formato empresa_logo=%5Bobject%20File%5D ya intente mil formas y no almacena la fotografia espero puedan ayudarme, PD: los demas campos si los almacena solo falta el archivo.

La ruta esta configurada de la siguiente forma: Route::get('empresas', 'EmpresasController@store')->name('empresas.store');

Este es mi controlador en el metodo Store:

public function store(Request $  request)     {         $  empresa = new Empresa([             'nombreempresa' => $  request->get('nombreempresa'),             'nombrecomercial' => $  request->get('nombrecomercial'),             'idfiscal' => $  request->get('idfiscal'),             'adminid' => auth()->id(),             'tel' => $  request->get('tel'),             'calleynumero' => $  request->get('calleynumero'),             'colonia' => $  request->get('colonia'),             'ciudad' => $  request->get('ciudad'),             'estado' => $  request->get('estado'),             'codigopostal' => $  request->get('codigopostal'),             'pais' => $  request->get('pais'),             'email' => $  request->get('email'),             'acceso' => '1',             'sector' => $  request->get('sector'),             'tipo' => $  request->get('tipo'),             'sitioweb' => $  request->get('sitioweb'),             'empresa_logo' => $  request->file('empresa_logo')->store('empresas-logo', 'public'),             'serial' => 'XEVB-TBMN-KHKL-YB2JI89J',             'wizard' => '1'         ]);         $  empresa->save();         $  relacionempresa = new Empleado([             'nombres' => auth()->user()->FirstName,             'ApellidoPaterno' => auth()->user()->LastName,             'ApellidoMaterno' => auth()->user()->LastName2,             'is_verified' => '0',             'puesto' => $  request->get('puesto'),             'email' => auth()->user()->email,             'empresa_id' => $  empresa->id,             'empresa_name' => $  empresa->nombrecomercial,             'empresa_logo' => $  empresa->empresa_logo,             'sector' => $  empresa->sector         ]);         $  relacionempresa->save();         return redirect()->route('dashboard')->with('success', 'Gracias hemos recibido tu informacion!');     } 

Este es el modelo:

<?php  namespace App;  use Illuminate\Database\Eloquent\Model;  class Empleado extends Model {     /**      * The database table used by the model.      *      * @var string      */     protected $  table = 'empleados';      /**     * The database primary key value.     *     * @var string     */     protected $  primaryKey = 'id';      protected $  hidden = [      'api_token'     ];     /**      * Attributes that should be mass-assignable.      *      * @var array      */     protected $  fillable = ['id', 'nombres',     'ApellidoPaterno',     'ApellidoMaterno',     'is_verified',     'email',     'bio',     'puesto',     'ubicacion',     'status',     'picture',     'sector',     'empresa_id',     'empresa_name',     'created_at',     'empresa_logo',     'updated_at']; } 

y por ultimo este es mi formulario en blade:

<form method="PUT" enctype="multipart/form-data" action="{{ route('empresas.store') }}" id="kt_form" class="kt-form kt-form--fit kt-form--label-right" >                                             @csrf                                             <!--begin: Form Wizard Step 1-->                                             <div class="kt-wizard-v2__content" data-ktwizard-type="step-content" data-ktwizard-state="current">                                                 <div class="kt-heading kt-heading--md">{{ __('forms.Account_Details') }}</div>                                                 <div class="kt-form__section kt-form__section--first">                                                     <div class="kt-wizard-v2__form">                                                             <div class="col-lg-4">                                                                 <label class="">{{ __('forms.Nombre_Comercial') }}</label>                                                                 <div class="input-group">                                                                 <input type="file" class="form-control" name="empresa_logo" id="empresa_logo">                                                                 <label class="custom-file-label" for="empresa_logo"></label>                                                                 </div>                                                                 <span class="form-text text-muted">{{ __('forms.Indication_NC') }}</span>                                                             </div>                                              <!--end: Form Actions -->                                         </form> 

Query string argument of EXECUTE is null

Estoy haciendo una función para que me de indicaciones un servicio de rutas y me lo devuelva en formato XLM. Saca algo la query pero no todo y me salta un error que una de las query que se ejecuta es NULL. Esta es la query:

-- Function: xml_directions(integer, integer, text)  DROP FUNCTION xml_directions(integer, integer, text);  CREATE OR REPLACE FUNCTION xml_directions(source_id integer, target_id integer, tab_name text)   RETURNS xml AS $  BODY$  DECLARE  start_point geometry; --geometria del punto inicial tab_name text :=$  3; -- nombre de la tabla (ways) s_id integer :=$  1; -- source id t_id integer :=$  2; -- target id _first boolean :=true; --primer paso del algoritmo fc real:= 111073.2835905824; -- factor de conversión multiplicativo para distancias _A geometry; _B geometry; _C geometry; _D geometry; a1 float; -- azimuth de la primera geometria a2 float; -- azimuth de la segunda geometria angoli real[]; -- matriz de angulos (diferencia) i integer; -- entero para desplazar: NB se define fuera del bucle, porque tambien sirve para obtener la longitud de las matrices  the_route CURSOR FOR SELECT rt.gid, rt.the_geom as geom, length(rt.the_geom) as length, ways.name::text AS NAME_1 FROM (SELECT ways.gid, dijkstra.*, ST_AStext(ways.the_geom) as the_geom FROM              (SELECT * FROM pgr_dijkstra             ('SELECT gid as id, source, target, cost, reverse_cost FROM ' || $  3, $  1, $  2, true)) as dijkstra             LEFT JOIN ways on ways.gid = dijkstra.edge) as rt           LEFT JOIN ways ON ways.gid = rt.gid; --variables que hay que buscar GID_1 integer; GID_2 integer; GEOM_1 geometry; GEOM_2 geometry; LENGTH_1 real; LENGTH_2 real; NAME_1 text; NAME_2 text;     directions text[]; --variable que contiene los codigos relacionados con las maniobras lengths real[]; --vector que contiene las longitudes de las secciones a recorrer streets text[]; --vector que contiene los nombres de las rutas geoms geometry[]; --vector de las geometrias individuales line geometry; --geometria de la ruta general tot_len real :=0; tot_time real:=0; tlu text := 'm'; -- tipo de unidad distancia  -- variable para la ejecucion de la consulta para la composición del xml pre_string text;   steps_fragment text:='XMLELEMENT(NAME step,XMLELEMENT(NAME text,''Start from '; line_fragment text;  xml_result xml;  BEGIN  angoli[0] :=0; -- la primera indicación es siempre "continuar por ...". El relleno del vector de ángulos debe comenzar desde ángulos [1] i:=0; OPEN the_route; FETCH the_route INTO GID_1, GEOM_1, LENGTH_1, NAME_1;  IF NAME_1 IS NOT NULL THEN streets[0]:= replace(trim(both from NAME_1),'''',''''''); ELSE streets[0]:='Missing Street Name'; END IF;  lengths[0]:= LENGTH_1*fc; tot_len := tot_len + lengths[0]; line:=ST_Union(GEOM_1); RAISE NOTICE ' STREET [0] = %',streets[0]; RAISE NOTICE ' LENGTHS [0] = %',lengths[0]; LOOP FETCH the_route INTO GID_2, GEOM_2, LENGTH_2, NAME_2; EXIT WHEN NOT FOUND;  -- caso primer segmento  IF _first THEN -- Averiguando punto de partida _A :=ST_PointN(GEOM_1,1); _B :=ST_PointN(GEOM_1,ST_NumPoints(GEOM_1)); _C :=ST_PointN(GEOM_2,1); _D :=ST_PointN(GEOM_2,ST_NumPoints(GEOM_2)); IF (ST_Equals(_A, _C)) THEN start_point := _B;  ELSIF (ST_Equals(_A, _D)) THEN start_point := _B;  ELSE start_point := _A;  END IF;  --Calculo que punto final de la primera geometria está conectado al punto de inicio y si es necesario, volteo la geometría IF NOT(ST_Equals(start_point,ST_PointN(GEOM_1,1))) THEN -- El punto de inicio no coincide con el primer punto del segmento, por lo que el segmento debe voltearse GEOM_1 := ST_Reverse(GEOM_1);  END IF; geoms[i]:= GEOM_1;  start_point:= ST_PointN(Geom_1,ST_NumPoints(GEOM_1)); --Actualizo el punto de inicio como el ùltimo punto de la primera geometria  --Calculo que punto final de la segunda geometria está conectado al último punto de la primera geometria, si es necesario inserto la segunda geometria IF NOT(ST_Equals(start_point, ST_PointN(GEOM_2,1))) THEN GEOM_2 := ST_Reverse(GEOM_2);  END IF; start_point:= ST_PointN(Geom_2,ST_NumPoints(GEOM_2)); -- Actualizar el punto de inicio para el siguiente paso del bucle  --Los segmentos esán orientados. Calculo el azimuth y defino la direccion a1 := trunc(ST_Azimuth(ST_PointN(GEOM_1,ST_NumPoints(GEOM_1)-1),ST_PointN(GEOM_1,ST_NumPoints(GEOM_1)))/(2*pi())*360);  a2 := trunc(ST_Azimuth(ST_PointN(GEOM_2,1),ST_PointN(GEOM_2,2))/(2*pi())*360); --La diferencia de los dos angulos define la maniobra a realizar, por lo que debe ser devuelta de cualquier manera angoli[i+1] := (a1 - a2); IF (angoli[i+1] >180.0) THEN angoli[i+1]:=angoli[i+1]-360; END IF; IF (angoli[i+1]< -180) THEN angoli[i+1]:=angoli[i+1]+360; END IF; IF NAME_2 IS NOT NULL THEN streets[i+1]:= replace(trim(both from NAME_2),'''',''''''); ELSE streets[i+1]:='nome strada mancante'; END IF; --Si las calles tienen el mismo nombre  IF ((streets[i+1] =streets[i])) THEN  geoms[i]:=ST_Union(geoms[i],GEOM_2); lengths[i]:=lengths[i]+(LENGTH_2 * fc); line:=ST_Union(line,GEOM_2); GEOM_1 := GEOM_2; NAME_1 := NAME_2;  ELSE lengths[i+1]:= LENGTH_2 * fc;  geoms[i+1]:= GEOM_2; line:=ST_Union(line,GEOM_2);  i:= i+1;  GID_1 := GID_2; GEOM_1 := GEOM_2; LENGTH_1 := LENGTH_2 * fc; NAME_1 := NAME_2; END IF;  _first := false;  --Segmentos que siguen la orientacion del primero ELSE IF NOT(ST_Equals(start_point, ST_PointN(GEOM_2,1))) THEN GEOM_2 := ST_Reverse(GEOM_2);  END IF; start_point:= ST_PointN(Geom_2,ST_NumPoints(GEOM_2)); -- aggiorno lo start point per lo step successivo del loop  -- Los segmentos estn orientados. Calculo azimuth y defino la direccion a1 := trunc(ST_Azimuth(ST_PointN(GEOM_1,ST_NumPoints(GEOM_1)-1),ST_PointN(GEOM_1,ST_NumPoints(GEOM_1)))/(2*pi())*360);  a2 := trunc(ST_Azimuth(ST_PointN(GEOM_2,1),ST_PointN(GEOM_2,2))/(2*pi())*360); --la diferencia de los angulos define la maniobra a realizar  angoli[i+1] := (a1 - a2); IF (angoli[i+1] >180) THEN angoli[i+1]:=angoli[i+1]-360; END IF; IF (angoli[i+1]< -180) THEN angoli[i+1]:=angoli[i+1]+360; END IF;  IF NAME_2 IS NOT NULL THEN streets[i+1]:= replace(trim(both from NAME_2),'''',''''''); ELSE streets[i+1]:='nome strada mancante'; END IF;  --Si las calles tienen el mismo nombre IF ( (streets[i+1] =streets[i])) THEN  geoms[i]:=ST_Union(geoms[i],GEOM_2); lengths[i]:=lengths[i]+(LENGTH_2 * fc); line:=ST_Union(line,GEOM_2); GEOM_1 := GEOM_2; NAME_1 := NAME_2;  ELSE   lengths[i+1]:= LENGTH_2 * fc; tot_len := tot_len + lengths[i+1]; geoms[i+1]:=GEOM_2;  line:=ST_Union(line,GEOM_2);  i:= i+1; GID_1 := GID_2; GEOM_1 := GEOM_2; LENGTH_1 := LENGTH_2 * fc; NAME_1 := NAME_2; END IF;  END IF;  END LOOP;   CLOSE the_route;  --Codigo angulos en maniobras for k in 0..i LOOP CASE WHEN angoli[k]>=-5 AND angoli[k]<=5 THEN directions[k]:='Sigue recto'; RAISE NOTICE'RAMO 1    %',directions[k]; WHEN angoli[k]>=-45 AND angoli[k]<-5 THEN directions[k]:='Gira levemente a la derecha'; RAISE NOTICE'RAMO 2    %',directions[k]; WHEN angoli[k]>=-100 AND angoli[k]<-45 THEN directions[k]:='Gire a la derecha'; RAISE NOTICE'RAMO 3    %',directions[k]; WHEN angoli[k]>=-135 AND angoli[k]<-100 THEN directions[k]:='Doblar a la derecha en '; RAISE NOTICE'RAMO 4    %',directions[k]; WHEN angoli[k]>=-180 AND angoli[k]<-135 THEN directions[k]:='Gire en U hacia la derecha'; RAISE NOTICE'RAMO 5    %',directions[k]; WHEN angoli[k]>5 AND angoli[k]<=45 THEN directions[k]:='Gire levemente a la izquierda hacia '; RAISE NOTICE'RAMO 6    %',directions[k]; WHEN angoli[k]>45 AND angoli[k]<=100 THEN directions[k]:='Gire a la izquierda en '; RAISE NOTICE'RAMO 7    %',directions[k]; WHEN angoli[k]>100 AND angoli[k]<=135 THEN directions[k]:='doblar a la izquierda en'; RAISE NOTICE'RAMO 8    %',directions[k]; WHEN angoli[k]>135 AND angoli[k]<=180 THEN directions[k]:='Gire en U hacia la izquierda'; RAISE NOTICE'RAMO 9    %',directions[k]; ELSE RAISE NOTICE' ELSE%',directions[k]; END CASE; tot_len := tot_len + lengths[k]; END LOOP; tot_len := trunc(tot_len); tot_time := trunc(tot_len/833.33333); -- Se asume la velocidad media  IF (tot_len >= 1000) THEN tot_len := tot_len/1000; tlu := 'km'; END IF; pre_string:='XMLROOT(XMLELEMENT(NAME result, XMLELEMENT(NAME route, XMLELEMENT(NAME total_length, ''circa '||tot_len||' '||tlu||'''), XMLELEMENT( NAME total_estimated_time, ''about '||tot_time||' min''), XMLELEMENT(NAME directions,'; steps_fragment := steps_fragment||streets[0]||'''))'; for j in 0..i LOOP RAISE NOTICE'geometria ------- %/',ST_AsText(geoms[j]); steps_fragment := steps_fragment||',XMLELEMENT(NAME step,XMLELEMENT(NAME text,'||''''||directions[j]||' '||streets[j]||' (about '||trunc(lengths[j])||' m)'||''''||'),XMLELEMENT(NAME line,'''||ST_AsText(geoms[j])||'''))'; END LOOP;  line_fragment:='),XMLELEMENT(NAME complete_line,'''||ST_AsText(line)||'''))),VERSION 1.0,STANDALONE YES)'; RAISE NOTICE'geometria -----------------------\n --------------------------------------- \n\n%\n\n----------------------------------------',ST_AsText(line);  EXECUTE  'SELECT  '||pre_string||steps_fragment||line_fragment INTO xml_result;  RETURN xml_result;  END;  $  BODY$     LANGUAGE 'plpgsql' VOLATILE   COST 100; ALTER FUNCTION xml_directions(integer, integer, text) OWNER TO postgres;  

Cuando hago la consulta:

SELECT * FROM xml_directions(26929, 7926, 'ways')

Me salta con el error de PL/pgSQL function xml_directions(integer,integer,text) line 249 at EXECUTE

A ver si alguien puede averiguar el error. Le he dado bastantes vueltas y no encuentro el fallo. Supongo que el fallo puede estar por la variable pre_string:=’XMLROOT(XMLELEMENT(NAME result, XMLELEMENT(NAME route, XMLELEMENT(NAME total_length, ”circa ‘||tot_len||’ ‘||tlu||”’), XMLELEMENT( NAME total_estimated_time, ”about ‘||tot_time||’ min”), XMLELEMENT(NAME directions,’;

Display templates, managed properties showing null

In Sharepoint Online,trying to display one site collection list columns in another site collection using search and dispaly templates List:/sites/UAT/Lists/SearchTestList/AllItems.aspx enter image description here

1.Mapped the crawled properties with managed properties in both the site collections enter image description here same mapping in /sites/UAT and /sites/Classic

2.Created a basic search center in /Sites/Classic and through query rules I am able to get the results

enter image description here

=>In Item_Default display template , I have added these Properties as ‘RefinableString148′:’RefinableString148′,’RefinableString149′:’RefinableString149′,’RefinableString150′:’RefinableString150’

=>In display templates, I am displaying as below

 <ul> <li>    _#= ctx.CurrentItem.RefinableString148 =#_ </li> <li>    _#= ctx.CurrentItem.RefinableString149 =#_ </li> <li>    _#= ctx.CurrentItem.RefinableString150 =#_ </li> <li>    _#= ctx.CurrentItem.Title =#_ </li> <li>    _#= ctx.CurrentItem.LastModifiedTime =#_ </li> </ul> 

But the output is only displaying Title and LastModifiedTime of items enter image description here

But the same properties are showing in Refiners enter image description here

Am I missing anything or doing anything wrong? Any help would be appreciated.

Is a Buffer Overflow / NOP Slide possible for memory addresses that contain null bytes?

I have been reading up on Buffer Overflows and NOP Sleds. I tried to use the exploit on an example target and I got stuck because I needed to inject a null byte in the return address for my BP so that my program does not crash. I have become aware of the fact that it is not possible to call a C program from command-line with a string that contains null bytes.

So, my questions is how to perform a buffer overflow in case the target memory address contains null bytes? Also, this would make NOP sleds as useless because the return address would contain null bytes as well, right?

Because I am completely new to C programming and exploitation in general it might be that I overlooked something obvious like zeroing out a part of memory after injection to construct a valid memory address but google search did not yield any understandable results for me.

At last, it is always the case that a stored memory address in memory ends with a null byte? Based on my observations I assume this is necessarily the case but there might be other options to interpret stored data as memory addresses without a null byte at the end.

How to build search query to filter data based on null value?

I have configured the people browser based on Search service. I want to show only those employees who have some value in user profile property. I have created the managed property for that custom property in user profile. How should I configure the search query which will show only those names who have some value in the managed property?

My current query is:

{?{searchTerms} ContentClass=urn:content-class:SPSPeople} -xyz:''

In the query, xyz is the managed property mapped with custom user profile property. The query is not working correctly. What am I missing?