web part – Time complexity issue in fetching list items from 2 lists in React Sharepoint?

I am trying to fetch common items from two lists. For eg:- I am displaying full items from first list but there is no name column in the first list, it is in the second list which is of Person or Group type column so I also cannot use expand. So on the basis of ID column (lookup column in First list) I am fetching name from second list but there is issue of time complexity in that. Does anyone know how to reduce time complexity of my code or any alternate might work as well as long as time complexity is less:
I am using REST API call in my code below:

this.state = {healthScreening: (
        {
          Author: "",
          BookingID: "",
          Temperature: "",
          Measured_x0020_In: "",
          Result: "",
          Kit: "",
        },
      ),
};

public function = () => {
$.ajax({
      url: `${this.props.siteUrl}/_api/Web/Lists/GetByTitle('APP_NAME1')/items?$select=*,Temperature,Measured_x0020_In,Result,BookingID/ID&$expand=BookingID`,
      type: "GET",
      dataType: "json",
      headers: {
        accept: "application/json;odata=verbose",
      },
      success: (resultData) => {
        var listdata = {
          accounting: (),
        };
        var listdata2 = ()
        console.log(resultData.d.results);
        $.each(resultData.d.results, (index, value) => {
            listdata.accounting.push({
              BookingID: value.BookingID.ID,
              Temperature: value.Temperature,
              MeasuredIn: value.Measured_x0020_In,
              Result: value.Result,
              Kit: value.Kit ? "Yes" : "No",
            });        
        });
        console.log(listdata.accounting);
        $.ajax({
          url: `${this.props.siteUrl}/_api/Web/Lists/GetByTitle('APP_NAME2')/items?$select=Author/Title,ID,BookingStatus&$expand=Author&$filter=startswith(Author/Title,'${this.state.temp}')`,
          type: "GET",
          dataType: "json",
          headers: {
            accept: "application/json;odata=verbose",
          },
          success: (resultData) => {
            var listdata1= {
              accounting: (),
            };

            $.each(resultData.d.results, (index, value) => {
              
             
                var data = listdata.accounting.filter(
                  (index) => index.BookingID == value.ID,
                  
                )
                if (data.length > 0) {
                  console.log(data)
                  listdata2.push({
                    Author: value.Author.Title,
                    BookingID: value.ID,
                    BookingStatus: value.BookingStatus,
                    Temperature: data(0).Temperature,
                    Result: data(0).Result,
                    MeasuredIn: data(0).MeasuredIn,
                    Kit: data(0).Kit,
                   })
                }
             
            });
            
            this.columns1 = (
              {
                name: "Name",
                selector: "Author",
              },
              {
                name: "ID",
                selector: "BookingID",
              },
              {
                name: "Temperature",
                selector: "Temperature",
              },
              {
                name: "MeasuredIn",
                selector: "MeasuredIn",
              },
              {
                name: "BookingStatus",
                selector: "BookingStatus",
              },
              {
                name: "Result",
                selector: "Result",
              },
              {
                name: "Kit",
                selector: "Kit",
              },
            );
            this.rows1 = listdata2;
            console.log(listdata2)
            this.setState({ healthScreening: listdata2 }, () => {});
          },
          error: (jqXR, textStatus, errorThrown) => {
            console.log("error");
          },
        })
      },
      error: (jqXHR, textStatus, errorThrown) => {
        console.log("error");
      },
    });
}

this.rows and this.columns are the field properties of react-data-table-component from npm package.

Email issue

Hi,

Cpanel + Roundcube

My client having issue. User using imap setting in microsoft outlook. The mailbox size from cpanel show less th… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1830120&goto=newpost

Very Strange Issue on Server – Not accessable from multiple location

Hello,
I am currently facing a stage issue on my VPS server. I have some clients hosted on the server, but suddenly they started reporting t… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1830098&goto=newpost

magento2 – Watermark issue – Magento Stack Exchange

Currently we are running on Magento 2.2.6.
We have added a watermark for the base, thumbnail, swatch & small.

The watermark is appearing on the productlist page, but not in a good manner, see image.

But the worse thing is, it isn’t even showing on the productdetail page. Yes I see the image but not a watermark. Herefore i’m searching a solution. The first issue will be related to this older version of magento we are running.

enter image description here

Hopefully anyone has some experience for this topic and thanks for the help.

Regards,
Pascal

Regards,
Pascal

c++ – Frustum culling issue at oblique angles

I am using the following algorithm to test if my camera frustum contains an axis-aligned bounding box:

bool is_box_visible(vec4 planes(6), vec3 aabb_center, vec3 half_extents)
{
    for(int i = 0; i < 6; i++)
    {
        vec4 plane = planes(i);
        float aabb_radius = abs(plane.x * half_extents.x) + abs(plane.y * half_extents.y) + abs(plane.z * half_extents.z);
        float to_center = dot(plane.xyz, half_extents) + plane.w;

        if(to_center <= -aabb_radius) return false;
           return false;
    }
    return true;
}

Usage code:

matrix to_view = cam->view;
vec4 planes(0) = cam.bottom_plane * to_view;
vec4 planes(1) = cam.top_plane * to_view;
vec4 planes(2) = cam.right_plane * to_view;
vec4 planes(3) = cam.left_plane * to_view;
vec4 planes(4) = cam.near_plane * to_view;
vec4 planes(5) = cam.far_plane * to_view;

vec3 aabb_center = vec3(0.5f, 0.5f, 0.5f);
vec3 aabb_half_extents = vec3(0.5f, 0.5f, 0.5f);

is_visible = is_box_visible(planes, aabb_center, aabb_half_extents);

It works correctly in most situations, as can be seen here (notice the is_visible checkbox is correctly checked):
enter image description here

But when looking from certain angles the function returns incorrect results:
enter image description here

Is this a limitation of this particular algorithm or is there a bug in my code?

My ranking dropped on google after DNS issue | NewProxyLists

I had a issue with my DNS on njal.la where 5 days did not answered and my ranking dropped on google (alexa), my domain was on the first places of google search and now its on the last. How i can improve this? Any cheap services could help me to do the ranking raise and the google page place? Please help me someone if knows.

 

8 – Webform clone translation and caching issue

when i clone a webform programmatically i loose the translation.
This is my code.


//Load webform to duplicate
  $webform = Drupal::entityTypeManager()->getStorage('webform')->load($default_template);

  //Create duplicate
  $webform_duplicate = $webform->createDuplicate();

  $webform_duplicate->set('id',$id);
  $webform_duplicate->set('title',$title);
  // $webform_duplicate->set('langcode','en');
  $webform_duplicate->set('description','Event Registration GR Form for '.$title);

  //Save duplicate
  $webform_duplicate->save();
?>

Webform is created with out any problems but there is no translation and when i check in the config db table there is nothing there too.
When i search for the template i can see that there is a config row-record / collection : language.el that corresponds to the translated version of the default template.
I tried to add programmatically a translation with this code


  $result = Drupal::database()->select('config', 'c')
  ->fields('c', ('collection', 'name', 'data'))
  ->condition('c.name', 'webform.webform.event_registration_gr')
  ->condition('c.collection', 'language.el', 'LIKE')
  ->execute();

  while ($record = $result->fetchAssoc()) {
    $record('name') = 'webform.webform.' . $webform_duplicate->id();
    Drupal::database()->insert('config')
      ->fields(('collection', 'name', 'data'))
      ->values($record)
      ->execute();
  }

Which works fine too but there is an important issue with caches.
If i do not run drush cr there is no translation for my webform.
What am i missing here?
Please can you help?
Thank you in advance!

Powerapps Gallery Paging issue in Gallery.Height and Gallery.TemplateHeight

I have created pagination for the gallery which is placed on the screen. I have followed the below link to get it done.

https://powerusers.microsoft.com/t5/News-Announcements/Pagination-Features-Esp-for-PC-or-Tablet-Mode…

The problem I facing here is my gallery height is 350 and the template height is 10(if i change the template height the gallery is not looking good with the gap between cells ). where ever the gallery height and gallery template height is required I am giving the above values, but the records which we are binding in the gallery are coming in a single page with scroll and it’s not splitting and binding in the upcoming pages.

i am attaching the images for your reference with the gallery and it’s properties. What should I do to split the records into multiple pages. any help would be appreciated. Thanks in advance!

Gallery Properties

Gallery Grid

SharePoint 5000 List View Threshold Limit Issue in CSOM

I have an issue with Sharepoint CSOM when I am trying to get subfolder with the following code

public void LoadFolders(Folder folder, SharePointFolder sharePointFolder)
{
  Context.Load(folder.Folders);
  Context.ExecuteQuery();

  foreach (var subFolder in folder.Folders)
  {
    var subRootFolder = new SharePointFolder(sharePointFolder, subFolder);
    sharePointFolder.SubFolders.Add(subRootFolder);
  }
}

I get the error below when trying to load subfolders of a folder that has an itemCount of more than 5000.

Microsoft.SharePoint.Client.ServerException
  HResult=0x80131500
  Message=The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator.
  Source=Microsoft.SharePoint.Client.Runtime
  StackTrace:
   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
   at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
   at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
   at ..SharePointApi.SharepointSdkAccessMethod.LoadFolders(Folder folder, SharePointFolder sharePointFolder) in ....SharePointApiSharepointSdkAccessMethod.cs:line 435
   at ..SharePoint.ViewModels.SharePointFoldersViewModel.<>c__DisplayClass30_0.<GetFolderAsync>b__0() in ....ViewModelsSharePointFoldersViewModel.cs:line 183
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()

Is there a way to resolve this issue or a CamlQuery that can give the same result as my function above?

magento2 – Issue with Algolia Search

I started using algolia search.

Our root catalog magento is PUB. So path to images in our case is: website.com/media/catalog... but Algolia search generate url to image with pub so

website.com/pub/media/catalog

Image get 404

I found file: image.php

<?php

namespace AlgoliaAlgoliaSearchHelper;

use MagentoCatalogModelProductImageFactory;
use MagentoConfigurableProductModelProductTypeConfigurable as ProductTypeConfigurable;
use MagentoFrameworkAppHelperContext;
use MagentoFrameworkViewAssetRepository;
use MagentoFrameworkViewConfigInterface;

class Image extends MagentoCatalogHelperImage
{
    /**
     * @var ConfigHelper
     */
    protected $configHelper;
    private $logger;

    /**
     * Image constructor.
     *
     * @param Context $context
     * @param ImageFactory $productImageFactory
     * @param Repository $assetRepo
     * @param ConfigInterface $viewConfig
     * @param Logger $logger
     * @param ConfigHelper $configHelper
     */
    public function __construct(
        Context $context,
        ImageFactory $productImageFactory,
        Repository $assetRepo,
        ConfigInterface $viewConfig,
        Logger $logger,
        ConfigHelper $configHelper
    ) {
        parent::__construct($context, $productImageFactory, $assetRepo, $viewConfig);
        $this->logger = $logger;
        $this->configHelper = $configHelper;
    }

    public function getUrl()
    {
        try {
            $this->applyScheduledActions();

            $url = $this->_getModel()->getUrl();
        } catch (Exception $e) {
            $this->logger->log($e->getMessage());
            $this->logger->log($e->getTraceAsString());

            $url = $this->getDefaultPlaceholderUrl();
        }

        $url = $this->removeProtocol($url);
        $url = $this->removeDoubleSlashes($url);

        if ($this->configHelper->shouldRemovePubDirectory()) {
            $url = $this->removePubDirectory($url);
        }

        return $url;
    }

    protected function initBaseFile()
    {
        $model = $this->_getModel();
        $baseFile = $model->getBaseFile();
        if (!$baseFile) {
            if ($this->getImageFile()) {
                $model->setBaseFile($this->getImageFile());
            } else {
                $model->setBaseFile($this->getProductImage($model));
            }
        }

        return $this;
    }

    /**
     * Configurable::setImageFromChildProduct() only pulls 'image' type
     * and not the type set by the imageHelper
     *
     * @param MagentoCatalogModelProductImage $model
     *
     * @return mixed|string|null
     */
    private function getProductImage(MagentoCatalogModelProductImage $model)
    {
        $imageUrl = $this->getProduct()->getData($model->getDestinationSubdir());
        if (($imageUrl === null || $imageUrl == '') && $this->getProduct()->getTypeId() == ProductTypeConfigurable::TYPE_CODE) {
            $imageUrl = $this->getType() !== 'image' && $this->getConfigurableProductImage() ?
                $this->getConfigurableProductImage() : $this->getProduct()->getImage();
        }

        return $imageUrl;
    }

    private function getConfigurableProductImage()
    {
        $childProducts = $this->getProduct()->getTypeInstance()->getUsedProducts($this->getProduct());
        foreach ($childProducts as $childProduct) {
            $childImageUrl = $childProduct->getData($this->getType());
            if ($childImageUrl && $childImageUrl !== 'no_selection') {
                return $childImageUrl;
            }
        }

        return null;
    }

    public function removeProtocol($url)
    {
        return str_replace(('https://', 'http://'), '//', $url);
    }

    public function removeDoubleSlashes($url)
    {
        $url = str_replace('//', "https://magento.stackexchange.com/", $url);
        $url = "https://magento.stackexchange.com/" . $url;

        return $url;
    }

    public function removePubDirectory($url)
    {
        return str_replace('/pub/', "https://magento.stackexchange.com/", $url);
    }
}

At the bottom of this code are the references to the pub folder. How can I rewrite this code so that paths point to /media/catalog without pub?