Data structures – number of different binary search treasures with minimal height

Thank you for sending an answer to Computer Science Stack Exchange!

  • Please be sure to 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; Provide them with references or personal experience.

Use MathJax to format equations. Mathjax reference.

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

c ++ – optimization of two parameters by binary search

I want to do 1076C problem of code forces through binary search.
However, it only works with multiplication and not with optimization for addition. I tried the limits.
Here is my code:

        #include
        using namespace std;
        typedef long long ll;
        int main()
        {

            ios_base::sync_with_stdio(0);cin.tie(0);
            cout.tie(0);

            double d;
           double j,k,a,b;
                cin>>d;
                 double lo1=0,lo2=0,hi1=d,hi2=1.2;
                while(hi1-lo1>1e-10&&hi2-lo2>1e-12)
                {
                    a=lo1+(hi1-lo1)/2;
                    b=lo2+(hi2-lo2)/2;
                    j=a*b;
                    k=a+b;
                    if(j==d&&k==d)
                    {
                        break;
                    }
                    if(j>d||k>d)
                    {
                      hi1=a;
                      hi2=b;
                    }
                    else
                    {
                        lo1=a;
                        lo2=b;
                    }
                }


            cout<

Please check and give me a hint that I can solve this problem in other ways, but I just want to do it through binary search.

Is Google Search Personalized? – Computer Science Stack Exchange

Thank you for sending an answer to Computer Science Stack Exchange!

  • Please be sure to 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; Provide them with references or personal experience.

Use MathJax to format equations. Mathjax reference.

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

magento2 – two magento sites in an elastic search

Is it possible to do an elastic search on two different Magento 2 sites?

Elastic search is currently running smoothly on one Magento site, but now I need to add elastic search on another Magento site as well.

Does it contradict the results? if so, how should this be solved?

What role does the prefix index name play in elastic search?

Please help me do elastic search with two Magento sites.

angle – Failed to pass an empty parameter during a search

I have a little problem: I created a search engine with a text field in a "navigation bar" by passing the text to be searched as a parameter when calling a route in the route file. If I don't enter anything in the text to be searched (an empty string), I get an error message because the last parameter does not exist:

ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'buscar'

Error: No routes can be found. URL segment: "Search"

First I attach a capture of the route file:
Enter image description here

My navbar.component.html file is as follows:

  

and my navbar.component.ts file is as follows:

    import { Component, OnInit } from '@angular/core';
//import {HeroesService} from '../../servicios/heroes.service';
import {Router} from '@angular/router';


@Component({
  selector: 'app-navbar',
  templateUrl: './navbar.component.html',
  styleUrls: ('./navbar.component.css')
})

export class NavbarComponent implements OnInit {

  heroes: any() = ();

  constructor(private _router: Router) {

   }

  ngOnInit() {

      //this.heroes = this._heroeService



  }

  buscarHeroe(termino: string) {

    console.log(termino);

    console.log("hola cara de cola");

  }


  buscarHeroe_2(parametro: string){


    if(parametro==""){

      alert("es una cadena vacía");
      //parametro=" ";

    }else{

      alert("es una cadena llena");
    }

    alert("el valor es" + parametro);
    console.log("-----------EL VALOR PASADO ES: " + parametro);

    this._router.navigate(('/buscar',parametro));

  }

}

My route file is "routing.module.ts":

   import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';
import {HomeComponent} from './components/home/home.component';
import {NavbarComponent} from './components/navbar/navbar.component';
import {HeroesComponent} from './components/heroes/heroes.component';
import {AboutusComponent} from './components/aboutus/aboutus.component';
import { HeroeComponent } from './components/heroe/heroe.component';
//import { BuscadorComponent } from './component/buscador/buscador.component';
import {BuscadorComponent} from './components/buscador/buscador.component';

const routes: Routes =(
    {path: '', component: HomeComponent},
    {path: 'home', component: HomeComponent},
    {path: 'heroes', component: HeroesComponent},
    {path: 'navbar', component: NavbarComponent},
    {path: 'aboutus', component: AboutusComponent},
    {path: 'heroe', component: HeroeComponent},
    {path: 'heroe/:id', component: HeroeComponent},
    {path: 'buscar/:termino', component: BuscadorComponent},

    {path: '**', pathMatch: 'full', redirectTo: 'Home'}
);


@NgModule({
 imports: (RouterModule.forRoot(routes)),
 exports: (RouterModule)
})

export class AppRoutingModule{


}

My browser.component.ts file is as follows:

    import { Component, OnInit } from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {HeroesService} from '../../servicios/heroes.service'; 

@Component({
  selector: 'app-buscador',
  templateUrl: './buscador.component.html',
  styleUrls: ('./buscador.component.css')
})
export class BuscadorComponent implements OnInit {

  valor: boolean = false;

  longitud: number ;

  parametro: string;

  public listadoDeHeroes: Heroe() = ();

  constructor(private _activatedroute: ActivatedRoute, private _miservicio: HeroesService) { }


  ngOnInit() {

    console.clear();
    console.log("INICIAMOS!!!! ");

    console.log("buscar");

    this._activatedroute.params.subscribe(params => {
      console.log("el parametro es:  " + params('termino'));

      this.parametro = params( 'termino' );

      alert("parametro pasado es" + this.parametro + "_");

      this.listadoDeHeroes = this._miservicio.localizarHeores(params('termino'));

      console.log("el listado de héroes es" + this.listadoDeHeroes);

      console.log("la longitus del listadode Héroes es de " + this.listadoDeHeroes.length);

      this.longitud = this.listadoDeHeroes.length;

    })




  }

}


export interface Heroe {
  nombre: string;
  bio: string;
  img: string;
  aparicion: string;
  casa: string;
}

My service file "heroes.service.ts":

    import {Injectable, ɵɵupdateSyntheticHostBinding} from '@angular/core';
import { ɵELEMENT_PROBE_PROVIDERS } from '@angular/platform-browser';

@Injectable()
export class HeroesService {


    private heroes: Heroe() =(
        {
          nombre: "Aquaman",
          bio: "El poder más reconocido de Aquaman es la capacidad telepática para comunicarse con la vida marina, la cual puede convocar a grandes distancias.",
          img: "assets/recursos/aquaman.png",
          aparicion: "1941-11-01",
          casa:"DC"
        },
        {
          nombre: "Batman",
          bio: "Los rasgos principales de Batman se resumen en «destreza física, habilidades deductivas y obsesión». La mayor parte de las características básicas de los cómics han variado por las diferentes interpretaciones que le han dado al personaje.",
          img: "assets/recursos/batman.png",
          aparicion: "1939-05-01",
          casa:"DC"
        },
        {
          nombre: "Daredevil",
          bio: "Al haber perdido la vista, los cuatro sentidos restantes de Daredevil fueron aumentados por la radiación a niveles superhumanos, en el accidente que tuvo cuando era niño. A pesar de su ceguera, puede "ver" a través de un "sexto sentido" que le sirve como un radar similar al de los murciélagos.",
          img: "assets/recursos/daredevil.png",
          aparicion: "1964-01-01",
          casa: "Marvel"
        },
        {
          nombre: "Hulk",
          bio: "Su principal poder es su capacidad de aumentar su fuerza hasta niveles prácticamente ilimitados a la vez que aumenta su furia. Dependiendo de qué personalidad de Hulk esté al mando en ese momento (el Hulk Banner es el más débil, pero lo compensa con su inteligencia).",
          img: "assets/recursos/hulk.png",
          aparicion: "1962-05-01",
          casa:"Marvel"
        },
        {
          nombre: "Linterna Verde",
          bio: "Poseedor del anillo de poder que posee la capacidad de crear manifestaciones de luz sólida mediante la utilización del pensamiento. Es alimentado por la Llama Verde (revisada por escritores posteriores como un poder místico llamado Starheart), una llama mágica contenida en dentro de un orbe (el orbe era en realidad un meteorito verde de metal que cayó a la Tierra, el cual encontró un fabricante de lámparas llamado Chang)",
          img: "assets/recursos/linterna-verde.png",
          aparicion: "1940-06-01",
          casa: "DC"
        },
        {
          nombre: "Spider-Man",
          bio: "Tras ser mordido por una araña radiactiva, obtuvo los siguientes poderes sobrehumanos, una gran fuerza, agilidad, poder trepar por paredes. La fuerza de Spider-Man le permite levantar 10 toneladas o más. Gracias a esta gran fuerza Spider-Man puede realizar saltos íncreibles. Un "sentido arácnido", que le permite saber si un peligro se cierne sobre él, antes de que suceda. En ocasiones este puede llevar a Spider-Man al origen del peligro.",
          img: "assets/recursos/spiderman.png",
          aparicion: "1962-08-01",
          casa: "Marvel"
        },
        {
          nombre: "Wolverine",
          bio: "En el universo ficticio de Marvel, Wolverine posee poderes regenerativos que pueden curar cualquier herida, por mortal que ésta sea, además ese mismo poder hace que sea inmune a cualquier enfermedad existente en la Tierra y algunas extraterrestres . Posee también una fuerza sobrehumana, que si bien no se compara con la de otros superhéroes como Hulk, sí sobrepasa la de cualquier humano.",
          img: "assets/recursos/wolverine.png",
          aparicion: "1974-11-01",
          casa: "Marvel"
        }
      );



    //listaHeroes: Heroe() = ();

    constructor(){
        console.log('Servicio listo!!!');
    }


    getHeroes(){
        return this.heroes;
    }

    visualizarHeroe(idx: number){
        console.log(idx);

        return this.heroes(idx);


    }

    localizarHeores( nombre: string ): Heroe() {
      let listaHeroes: Heroe() = ();

      console.log("localizando heroes" + nombre);

      nombre = nombre.toLowerCase();

      console.log("longitud de la lista de heroes antes:" + listaHeroes.length);

      for(let heroe of this.heroes)
      {
        let nom = heroe.nombre.toLowerCase();

        if(nom.indexOf(nombre) >= 0)
        {

          listaHeroes.push(heroe);

          console.log("BIENNNNN");
        }

        console.log(nom + "   " + nombre);
      }

      console.log("longitud de la lista de heroes después:" + listaHeroes.length);
      console.log("imprimiendo lista final de heroes" + listaHeroes);

      console.log(listaHeroes.length);

      console.log("RECORRIENDO: ");
      for(let elemento of listaHeroes){

        //console.log(elemento.nombre);
        //console.log(elemento.bio);
        console.log(elemento.img);
        //console.log(elemento.casa);

      }

      return listaHeroes;
      //console.log("listado de heroes" + this.listaHeroes);




    }

}

export interface Heroe{
  nombre: string;
  bio: string;
  img: string;
  aparicion: string;
  casa: string;
  idx?: number;
};

Change image in mobile search results

When searching my company "Tattini Boots" on a mobile device, the following cut-out image is displayed next to the search result (see image below). This is not the image that I set in Yoast or in "Selected Image for Search Results" on my index page. Can anyone dive into the source and assign why this image is selected? This image is simply a slider overlay on the main page: www.TattiniBoots.com

Enter image description here

Sell ​​- porn search engine

Why are you selling this site?
I don't have time to worry about it, I need money.
So I'm selling it for a pretty low price.
More information can be found here: http://www.cumsh.com/buy-cumsh

How is it monetized?

it is not, but it could (by belonging to other websites and by selling links)

Does this page come with any social media accounts?
SEMrush

no None

How long does it take to run this website?

What are the challenges of running this website?

There are many things to do and it can be fun (fun is one of the reasons I did it, I wanted to program another scrapper bot too)
The management of video links dealing with the database contains approximately 600,000 references!
There is plenty of room for creativity

Tag images for quick search

I have tons of pictures that I don't have time to scroll when I have to show something, and I'm considering tagging them to identify them.

For example, I have a photo of a receipt. I want to add tags with the name of the store I bought, the name of the brand, and the name of the item. So if I have to show an accountant or helmsman, I can quickly get the picture using their tags.

Is there a way to tag photos and search for them later? Third-party apps are also allowed.