Selenium – Python script to parse the link optimization?

I've written a test that analyzes links from a webpage and then clicks on each of them in a loop and then returns to the main page. However, every iteration repeatedly parses the entire webpage and overwrites the links array. However, only one link is required per iteration. I understand that this is inefficient. How can I optimize this?

I tried to parse the links only once and then loop them through. After the first iteration, it returns (to the main page) and tries to click on the second link, but it's not interactive (I think it's because of the web elements that are stored in the links array and change each time, though) You to switch page).

def setUp(self):
    self.driver = webdriver.Chrome()
    self.driver.get('https://yandex.ru')

def test_01(self): 
    driver = self.driver
    links = ()
    time.sleep(3)
    links = driver.find_elements_by_css_selector("a")
    for i in range(len(links)):
        links = driver.find_elements_by_css_selector("a")
        links(i).click()
        driver.get('https://yandex.ru')
        time.sleep(3)

I expect a more efficient solution.

Optimization – How do I use cookie-free domains with the Microsoft Azure portal?

My website was installed on the Azure portal from Microsoft. My website with asp.net and framework (Sitecore CMS). It's C #.

I checked my website with gtmetrix. It is recommended to use cookie-free domains.

I'd like to try, but I'm confused as to how to set it up on the Azure portal. I'm afraid that will crash the server. How do I do that?

Optimization – How do I use cookie-free domains in Portal Azure?

My site was installed on the Azure portal (http://portal.azure.com). My website with asp.net and framework (Sitecore CMS). It is C #

When I check my website with gtmetrix (https://gtmetrix.com/). It is recommended to use cookie-free domains

I'm trying to search for references and recommend creating separate domains and subdomains to deliver cookies

I want to try it. But I am confused to set up in the portal Azure

I'm afraid that will shut down the server. So I ask for help here. How do I do that?

magento2.3.2 – Magento 2 Apptrian Image Optimization Extension only works for GIF!

I have installed the Apptrian Image Optimizer Extension in Magento 2.3.2.

I have installed the utility on the server according to the instruction manual and configured the utility path in the configuration, but only the optimization of GIF images works.

Has anyone used this extension? Can you please suggest me where I am wrong?

Please check the screenshot that can help you understand my configuration.

Complexity theory – finding f (x) with a BPP algorithm (optimization problem to decision problem)

Suppose there is a function $ f: mathcal {X} mapsto {1, 2, …, n } $, We want to solve a particular instance of $ f (x) $,

We have black box access to a BPP algorithm that is needed $ T $ Time to answer $ {YES, NO } $ to $ LessThan (x, k): = f (x) <k $ and has error probability of $ 1/3 $,

1) How can you solve $ f (x) $ in time $ O (T log n log log n) $ with error probability $ 1/3 $ With $ LessThan $?

2) How can you use $ LessThan (x, k) $ to implement a new algorithm called $ ImprovedLessThan (x, L, H) $ where it comes back:

    HIGH when (L+H)/2 < f(x) < H
    LOW when L < f(x) < (L+H)/2
    OUT OF RANGE when f(x) is outside of (L,H)

and has error probability $ 1/3 $ and run inside $ O (T) $ Time.

3) How can you use $ ImprovedLessThan $ to solve $ f (x) $ in the $ O (T log n) $ Time with high probability?

[GET][NULLED] – SEOPress PRO – Go ahead in your website SEO Optimization v3.6.5

(IMG)
(IMG)

(GET) (NULLED) – SEOPress PRO – Go ahead in your website SEO Optimization v3.6.5

Database Optimization – May I get help with optimizing the performance of MySQL 5.5?

Can I post my Mysql configuration and VPS data here and just make a suggestion to vote?

I have inherited a VPS and an old webapp, but I have no knowledge of MySQL Administrator and we have a lot of performance issues.

Sorry if this is a meta-question and should probably be avoided here, but I have to ask … before I ask ….

Optimization – maximizing a function over a subset of data?

I am looking for an algorithm for maximizing an accuracy function for $ N / 2 $ out of a total of $ N $ Sets of samples:

  • function: F1-score (Binary Classification, Neural Networks)
  • rehearse: aims (0 or 1) and predict $ Re in (0,1) $

The main problem is to find such a subset for an optimum Prediction threshold. $ P $ – d. H. the rounding value, which is 0.5 by default, but is not always optimal. So it's probably a double optimization.

What is a computationally efficient. scalable Algorithm for determining or exact approximation of such a subset and threshold?


Solutions considered:

  • Raw violence: $ N choose N / 2 $not scalable
  • skip: find the best $ P $ to the $ N $, Omit sample with highest F1 score, repeat for $ (N-1) $ Samples – and on and on. problem: Best $ P $ for subset $ n $ can not be the best $ P $ for subset $ (n + 1) $

Below are my Python scripts and toy data for reference:

Toy data, N = 10:

import numpy as np

targets = np.random.randint(0,2,(5,32))  # 0's and 1's array w/ shape (10,32)
preds   = np.random.randn(5,32)          # float32 array     w/ shape(10,32)
preds   = np.abs(preds)/np.max(np.abs(preds)) # scaled to (0,1)

F1 score script (simplified):

def f1_score(targets,preds_probabilities,pred_threshold=0.5):
    preds = np.array(((pred > pred_threshold) for pred in preds_probabilities))

    TP=(); TN=(); FP=()
    for (t, p) in zip(targets, preds):
        TP.append(1 if (t == 1) and (p == 1) else 0)
        TN.append(1 if (t == 0) and (p == 0) else 0)
        FP.append(1 if (t == 0) and (p == 1) else 0)
    TP, TN, FP = np.sum(TP), np.sum(TN), np.sum(FP)

    precision   = TP / (TP + FP) if not (TP == 0 and FP == 0) else 0
    recall      = TP / (TP + FN) if not (TP == 0 and FN == 0) else 0
    return precision*recall/(precision + recall)

Prediction Threshold Search (Brute Force):

def get_best_predict_threshold(targets,preds,search_interval=0.01):
    th, best_th, best_acc = 0, 0, 0

    while (th >= 0) and (th < 1):
        acc = f1_score(labels,preds,th)
        if acc >= best_acc:
            best_th = round(th,2)           
            best_acc = acc
        th += search_interval

    return best_th