python – Multiple conditional statement in a column

I want a column "PRI / TEN".
When the PRIMARY RESOURCE column contains "BERIX", PRI / TEN should have "TBC".
When the PRIMARY RESOURCE column contains "BERIXTVX", PRI / TEN must have "TEN". When the PRIMARY RESOURCE column contains "BERIXVX", PRI / TEN should have "PRI".

data1[‘PRI/ TEN’] = np.where (data1[‘First’]! = & # 39; BERIXVX & # 39 ;, & # 39; PRI & # 39 ;, & # 39; TEN & # 39;)

This is my original column

Primary resource
BERIX_MYANMAR ONLY
BERIXTVX_BOOST IPV
BERIXTVX_BOOST IPV
BERIXVX_ENCEPUR TO AD
BERIXVX_ENCEPUR ADVERTISEMENT
BERIXTVX_BOOST IPV
BERIXTVX_BEXSERO

This is what I want

PRI / TEN main resource
BERIX_MYANMAR ONLY TBC
BERIXTVX_BOOST IPV TEN
BERIXTVX_BOOST IPV TEN
BERIXVX_ENCEPUR A AD PRI
BERIXVX_ENCEPUR AD PRI
BERIXTVX_BOOST IPV TEN
BERIXTVX_BEXSERO TENZ

Google Sheets – Run multiple scripts at the same time

I'm very new to this, so I'm not sure what to do. I currently have a spreadsheet that runs a script that allows the rows to move according to the Cell Value in column H (State)

I want to execute a long side of an automatic sort function that will also be sorted by the same H (state) column

Here is a link to the Excel file:
https://docs.google.com/spreadsheets/d/1U9LulscZNKiMd_kv9McZEGdZYbjQNhjCUcr5uWcAabo/edit?usp=sharing

I've been trying for hours ūüėē

onEdit (e) {function

var ss = e.source,
sheet = ss.getActiveSheet (),
range = e.range,
objectives sheet,
columnNumberToWatch = 8; // column A = 1, B = 2, etc.
if (sheet.getName () === "Call Present" && e.value === "Call Completed" && e.range.columnStart === columnNumberToWatch) {
targetSheet = "Call completed"
} else if (sheet.getName () === "Call sent" && e.value === "Creating link" && e.range.columnStart === columnNumberToWatch) {
targetSheet = "Creating link"
} else if (sheet.getName () === "Call sent" && e.value === "Unlock sent" && e.range.columnStart === columnNumberToWatch) {
targetSheet = "Buy / Unlock"
} else if (sheet.getName () === "Call completed" && e.value === "Call sent" && e.range.columnStart === columnNumberToWatch) {
targetSheet = "Call sent"
} else if (sheet.getName () === "Call completed" && e.value === "Creating link" && e.range.columnStart === columnNumberToWatch) {
targetSheet = "Creating link"
} else if (sheet.getName () === "Call complete" && e.value === "Unlock sent" && e.range.columnStart === columnNumberToWatch) {
targetSheet = "Buy / Unblockoxa"
} else if (sheet.getName () === "Call Completed" && e.value === "Faded" && e.range.columnStart === columnNumberToWatch) {
targetSheet = "Faded"
} else if (sheet.getName () === "Call Present" && e.value === "Faded" && e.range.columnStart === columnNumberToWatch) {
targetSheet = "Faded"
} else if (sheet.getName () === "Creating link" && e.value === "Call sent" && e.range.columnStart === columnNumberToWatch) {
targetSheet = "Call sent"
} else if (sheet.getName () === "Creating link" && e.value === "Call completed" && e.range.columnStart === columnNumberToWatch) {
targetSheet = "Call completed"
} else if (sheet.getName () === "Creating link" && e.value === "Faded" && e.range.columnStart === columnNumberToWatch) {
targetSheet = "Faded"
} else if (sheet.getName () === "Creating link" && e.value === "Unlock sent" && e.range.columnStart === columnNumberToWatch) {
targetSheet = "Buy / Unlock"
} else if (sheet.getName () === "Buyout / Unlock" && e.value === "Ported" && e.range.columnStart === columnNumberToWatch) {
targetSheet = "portado"
} else if (sheet.getName () === "Faded" && e.value === "Call Present" && e.range.columnStart === columnNumberToWatch) {
targetSheet = "Call sent"
} else if (sheet.getName () === "Faded" && e.value === "Call Completed" && e.range.columnStart === columnNumberToWatch) {
targetSheet = "Call sent"
} else if (sheet.getName () === "Faded" && e.value === "&& e.range.columnStart === columnNumberToWatch) {
targetSheet = "Call sent"
}
ss.getSheetByName (targetSheet)
.appendRow (sheet.getRange (e.range.rowStart, 1, 1, sheet.getLastColumn ())
.getValues ‚Äč‚Äč()[0])
sheet.deleteRow (e.range.rowStart);
}

This was the script I was planning to use to sort this (IDK if it is correct).

Is it possible to execute this script only on the first 3 pages, and have it automatically classified in descending order on the 4th sheet (Buy / Unlock)? The last 2 does not matter?

onEdit () {function
var sheet = SpreadsheetApp.getActiveSheet ();
var range = sheet.getRange (3, 1, sheet.getLastRow () - 2, sheet.getLastColumn ());
range.sort ({column: H, ascending: false});
}

AND / OR Conditional format for Google Sheets with multiple criteria

I am trying to write a custom formula for the conditional format column E referring to the different tenure level objectives in column D to indicate if they are reaching their base of objectives outside of their tenure level. I wrote the following formula and it did not work out. Any help would be greatly appreciated.

I try to say: If D3 = "new" or "beginner" or "intermediate" or "veteran",
Then F3> = D24 or F3> = D25 or F3> = D26 or F3> = D26
.

= yes (or ($ D4 = "new", $ D4 = "beginner", $ D4 = "intermediate", $ D4 = "veteran"), O ($ E4> = $ D24, $ E4> = $ D25, $ E4> = $ D26, $ E4> = $ D27))

c # – Unbalanced search tree to compare multiple string arrays

I have a system that stores resources. A resource contains a string that represents a user role, for example, "3".
With this user role "3", you can retrieve a list of permissions for the user role, for example [“1”, “2”, “3”]. This list represents actions that a user can perform (1 = read, 2 = write, etc.).

Then, given the user role "3", you know that you can perform the action "1", "2" and "3".

The problem: the users of my system do not directly store a security level number. They only store the actions they are allowed to perform. Given a set of allowed actions, I need to find the correct user role. This part of the code is used a lot, so I have to create a solution that works quickly and efficiently.

My solution: create an unbalanced search tree and navigate through it to get the right level of security for a set of permissions.

Summary: for three sets of permissions:

  • [ “1”, “2”, “3”, “4” ] level 1
  • [ “1”, “2”, “3”, “5” ] Level 2
  • [“6”, “8”, “10”, “11” ] level 3
  • [ “2”, “1” ] level 4

Create a tree that looks like this:
enter the description of the image here

Then a matrix is ‚Äč‚Äčgiven [ “6”, “8”, “10”, “11” ], create a function that returns "3", or "-1" if the corresponding level was not found. The search tree is cached, so creating it does not have to be very efficient. However, looking for it should be quick. My code:

    Public class TreeSearcher
{
Static private dictionary documentSearchTrees = new dictionary();

/// 
/// Create a search tree for the different levels of rights of a document type.
/// 
/// The type of document (arbeidsrecht, cao, etc.)
/// A tuple that contains an int (rights level) and a string[] (rights)
public static empty CreateSearchTree (string documentType, params Tuple[]    documentRights)
{
if (string.IsNullOrEmpty (documentType))
throw the new exception ArgumentNullException (nameof (documentType), $ "{nameof (documentType)} can not be null.");

if (documentRights? .Length == 0)
throw the new exception ArgumentNullException (nameof (documentRights), $ "{nameof (documentRights)} can not be null or empty.");

// Only insert rights if they have not been inserted before.
// Use the DeleteSearchTree (documentType) method to explicitly remove the rights from the document.
if (documentSearchTrees.ContainsKey (documentType) == false)
{
SearchTree searchTree = new SearchTree ();
foreach (rights of var in documentRights)
{
searchTree.AddNode (rights.Item1, rights.Item2);
}

documentSearchTrees.Add (documentType, searchTree);

}
}

/// 
/// Returns the level of a pass in the user rights matrix.
/// 
/// The type of document to compare user rights for.
/// The rights of the user.
/// The authorization level for the user, or -1 if none was found.
public static int GetAuthorizationLevel (string documentType, string[] user rights)
{
Array.Sort (userRights);

if (documentSearchTrees.TryGetValue (documentType, out var searchTree) == true)
{
returns searchTree.GetAuthorizationLevel (userRights);
}
plus
{
returns -1;
}
}

/// 
/// Delete the search tree of a document type.
/// 
/// 



public static void DeleteSearchTree (string documentType)
{
if (string.IsNullOrEmpty (documentType))
throw the new exception ArgumentNullException (nameof (documentType), $ "{nameof (documentType)} can not be null.");

documentSearchTrees.Remove (documentType);
}


/// 
/// The entire search tree.
/// 
private class SearchTree
{
Private dictionary Nodes = new dictionary();

Empty internal AddNode (int permissionLevel, string[] rights)
{
// We need the rights to be ordered, otherwise the tree will not work.
Array.Sort (rights);

// Add the nodes recursively.
if (Nodes.TryGetValue (rights[0].ToString (), out TreeNode nodeToAdd) == false)
{
nodeToAdd = new TreeNode (authorityLevel, rights.Skip (1) .ToArray ());
Nodes.Add (rights[0].ToString (), nodeToAdd);
}
plus
{
nodeToAdd.AddNode (authorityLevel, rights.Skip (1) .ToArray (), new TreeNode (authorityLevel, rights.Skip (1) .ToArray ()));
}
}

internal int GetAuthorizationLevel (string[] user rights)
{
int arrayStartPosition = 0;
if (Nodes.TryGetValue (userRights[arrayStartPosition], out var treeNode) == true)
{
returns treeNode.GetAuthorizationLevel (userRights, arrayStartPosition + 1);
}
plus
{
returns -1;
}
}
}

/// 
/// A single node with all the subnodes of the tree.
/// 
TreeNode private class
{
Private dictionary Nodes = new dictionary();
internal int AuthorizationLevel {obtain; set; }

Internal TreeNode (int permissionLevel, string[] rights)
{
if (rights.Length <= 0)
{
AuthorizationLevel = permissionLevel;
he came back;
}

if (Nodes.TryGetValue (rights[0].ToString (), out TreeNode existingNode) == false)
{
if (rights.Length == 1)
AuthorizationLevel = permissionLevel;

existingNode = new TreeNode (authorityLevel, rights.Skip (1) .ToArray ());
Nodes.Add (rights[0].ToString (), existingNode);
}
plus
{
existingNode.AddNode (permissionLevel, rights, new TreeNode (permissionLevel, rights.ToArray ()));
}
}

Empty internal AddNode (int permissionLevel, string[] rights, TreeNode treeNode)
{
if (rights.Length <= 0)
{
he came back;
}
if (rights.Length == 1)
{
treeNode.AuthorizationLevel = permissionLevel;
}

if (Nodes.TryGetValue (rights[0].ToString (), out TreeNode existingNode) == false)
{
Nodes.Add (rights[0].ToString (), treeNode);
}
plus
{
existingNode.AddNode (authorityLevel, rights.Skip (1) .ToArray (), treeNode);
}
}

internal int GetAuthorizationLevel (string[] userRights, int offset)
{
if (userRights.Length == offset)
back AuthorizationLevel;

if (Nodes.TryGetValue (userRights[offset], out var treeNode) == true)
{
returns treeNode.GetAuthorizationLevel (userRights, offset + 1);
}
plus
{
returns -1;
}
}
}
}

Adding permissions by resource type works like this:

                var list = new List <Tuple>
{
new tuple(1, new chain[] {"1", "2", "3", "4"}),
new tuple(2, new chain[] {"1", "2", "3", "5"}),
new tuple(3, new chain[] {"6", "8", "10", "11"}),
new tuple(4, new chain[] {"1", "8", "11", "12"}),
new tuple(5, new chain[] {"one",}),
new tuple(6, new rope[] {"1", "2"}),
new tuple(7, new rope[] {"30", "28", "123"}),
};

CreateSearchTree ("aCoolResource", list.ToArray ());

Finding a user permission is like this:

                                var userRights1 = new string[] {"1", "2", "3", "5"};
var userRights2 = new string[] {"123", "30", "28"};

int userLevel1 = AuthorizationHelper.GetAuthorizationLevel ("aCoolResource", userRights1);
int userLevel2 = AuthorizationHelper.GetAuthorizationLevel ("aCoolResource", userRights2);

This works as planned. What I look for most are tips on how to improve performance.

JuneDataplace -EU Dedicated Servers from $ 100 / m – Quad-core CPU – 1 TB of HDD – 4 GB of RAM – Multiple Iv4 | Proxies123.com


It does not matter if you are a business-level company, a small company or even someone who needs a server or web hosting for personal use, we have an appropriate package for you. Our range of high performance services in dedicated servers. June Dataplace's reputation will be based on trust, cordiality and high-level support for all customers around the world. Combine that with 24/7 technical support and a 99.99% uptime guarantee, you're in good hands with us. We are proud of our first class support and are always happy to help our clients.

Payment methods
We currently accept PayPal and bank transfer.

Single CPU, multiple cores
(Better suited for developers / testers or small-scale companies).

Intel Quadcore X3430 for $ 100.50 / m

  • Intel Quadcore X3430
  • 4GB DDR3 ECC RAM
  • 1TB SATAII HDD
  • 1 Gbps uplink port
  • Bandwidth of 10TB
  • Location: The Netherlands (EU)

Register now

Intel Quadcore X3430 for $ 125.50 / m

  • Intel Quadcore X3430
  • 8GB DDR3 ECC RAM
  • 2TB SATAII HDD
  • 1 Gbps uplink port
  • Bandwidth of 25TB
  • Location: The Netherlands (EU)

Register now

Intel Xeon E3-1230 for $ 145.50 / m

  • Intel Xeon E3-1230
  • 8GB DDR3 ECC RAM
  • 2TB SATAII HDD
  • 1 Gbps uplink port
  • Bandwidth of 25TB
  • Location: The Netherlands (EU)

Register now

Intel Xeon E3-1270v5 for $ 180.50 / m

  • Intel Xeon E3-1270v5
  • 8GB DDR3 ECC RAM
  • 1TB SATAII HDD
  • 1 Gbps uplink port
  • Bandwidth of 100TB
  • Location: The Netherlands (EU)

Register now

Multiple CPUs, multiple cores
(Best suited for large scale or business websites.)

2 x E5520 2.26GHz for $ 185 / m

  • 2 x E5520 2.26GHz
  • 24GB DDR3 ECC RAM
  • 1TB SATAII HDD
  • 1 Gbps uplink port
  • Bandwidth of 25TB
  • Location: USA

Register now

2 x E5620 2.4GHz for $ 199 / m

  • 2 x E5620 2.4GHz
  • 24GB DDR3 ECC RAM
  • 1TB SATAII HDD
  • 1 Gbps uplink port
  • Bandwidth of 25TB
  • Location: USA

Register now

Intel Quadcore X3430 for $ 399 / m

  • Intel Quadcore X3430
  • 64GB ECC RAM
  • 960GB SSD + 2TB SATA
  • 1 Gbps uplink port
  • Bandwidth of 200TB
  • Location: USA

Register now

2 x E5-2650 v3 2.3GHz for $ 999 / m

  • 2 x E5-2650 v3 2.3GHz
  • 96GB DDR3 ECC RAM
  • HDD 4X480GB SSD
  • 1 Gbps uplink port
  • Unmetered bandwidth
  • Location: USA

Register now

* If you need something that has a little more power request a quote today.
Not allowed

  • Illegal child content
  • Virus / Exploitation Activities
  • Terrorist activities
  • Email Spamming
  • Flood
  • Fraud
  • Identity theft
  • Port scanning

Contact Us
If you have any questions about our services or want to request a customized package, send us a ticket or send us an email to [email protected]
We also have a live chat link on the side of our website.

Search multiple keywords with wp_query using a query

I use this wp_query to get results for a specific keyword and sort by price. I need to search several keywords at the same time and return results and sort them by product price. How is it possible to use a wp_query? Any appreciated example.

    $ args = array (

& # 39; s & # 39; s => "t",
& # 39; post_type & # 39; => & # 39; post & # 39 ;,
& # 39; post_status & # 39; => & # 39; publish & # 39 ;,
& Phrase # & # 39; => true,
& # 39; paged & # 39; => $ paged,
& # 39; meta_query & # 39; => [

            'product_price'  => [ 'key' => 'product_price', 'value' => '0', 'compare' => '>' , 'type'=>'NUMERIC'],


],

& # 39; orderby & # 39; => & # 39; product_price & # 39 ;,
& # 39; order & # 39; => & # 39; ASC & # 39;
);

python – Tkinter opens multiple windows

I am trying to generate processes outside of the Tkinter window that I have open. Achieve the goal but in addition to the processes I open as many Tkinter windows as I have processes.

from tkinter import *
imports
import multiprocessing
from tkinter import ttk
import tkinter as tk


def multi ():
    all_ingestas = [0, 0, 0]
    for i in all_ingestas:
        p = multiprocessing.Process ()
        p.start ()
        while True:
            os.system ("start python whilee.py")
            break


def account_csv_tk ():
    global entry
    ll = tk.Label (window, text = 'Account Name', font = ("Arial Bold", 15))
    ll.place (x = 50, y = 90, anchor = 'sw')
    entry = ttk.Entry (window, width = 30)
    entry.place (x = 50, y = 100, height = 20)
    button = ttk.Button (
        window,
        text = "Process",
        command = lambda: multi ()
    )
    button.place (x = 50, y = 130)


def first_window ():
    global window
    window = Tk ()
    ventana.title ("Ingesta")
    window.config (width = 900, height = 700)
    windowWidth = window.winfo_reqwidth ()
    windowHeight = window.winfo_reqheight ()
    positionRight = int (window.winfo_screenwidth () / 2 - windowWidth / 2)
    positionDown = int (window.winfo_screenheight () / 2 - windowHeight / 2)
    window.geometry ("+ {} + {}". format (positionRight, positionDown))
    window.resizable (0, 0)


first_window ()
account_csv_tk ()
window.mainloop ()

JuneDataplace -EU Dedicated servers starting at $ 100 / m ‚ėÖ Quad-core CPU ‚ėÖ 1 TB hard drive ‚ėÖ 4GB of RAM ‚ėÖ Multiple Iv4 | Proxies123.com


It does not matter if you are a business-level company, a small company or even someone who needs a server or web hosting for personal use, we have an appropriate package for you. Our range of high performance services in dedicated servers. June Dataplace's reputation will be based on trust, cordiality and high-level support for all customers around the world. Combine that with 24/7 technical support and a 99.99% uptime guarantee, you're in good hands with us. We are proud of our first class support and are always happy to help our clients.

Payment methods
We currently accept PayPal and bank transfer.

Single CPU, multiple cores
(Better suited for developers / testers or small-scale companies).

Intel Quadcore X3430 for $ 100.50 / m

  • Intel Quadcore X3430
  • 4GB DDR3 ECC RAM
  • 1TB SATAII HDD
  • 1 Gbps uplink port
  • Bandwidth of 10TB
  • Location: The Netherlands (EU)

Register now

Intel Quadcore X3430 for $ 125.50 / m

  • Intel Quadcore X3430
  • 8GB DDR3 ECC RAM
  • 2TB SATAII HDD
  • 1 Gbps uplink port
  • Bandwidth of 25TB
  • Location: The Netherlands (EU)

Register now

Intel Xeon E3-1230 for $ 145.50 / m

  • Intel Xeon E3-1230
  • 8GB DDR3 ECC RAM
  • 2TB SATAII HDD
  • 1 Gbps uplink port
  • Bandwidth of 25TB
  • Location: The Netherlands (EU)

Register now

Intel Xeon E3-1270v5 for $ 180.50 / m

  • Intel Xeon E3-1270v5
  • 8GB DDR3 ECC RAM
  • 1TB SATAII HDD
  • 1 Gbps uplink port
  • Bandwidth of 100TB
  • Location: The Netherlands (EU)

Register now

Multiple CPUs, multiple cores
(Best suited for large scale or business websites.)

2 x E5520 2.26GHz for $ 185 / m

  • 2 x E5520 2.26GHz
  • 24GB DDR3 ECC RAM
  • 1TB SATAII HDD
  • 1 Gbps uplink port
  • Bandwidth of 25TB
  • Location: USA

Register now

2 x E5620 2.4GHz for $ 199 / m

  • 2 x E5620 2.4GHz
  • 24GB DDR3 ECC RAM
  • 1TB SATAII HDD
  • 1 Gbps uplink port
  • Bandwidth of 25TB
  • Location: USA

Register now

Intel Quadcore X3430 for $ 399 / m

  • Intel Quadcore X3430
  • 64GB ECC RAM
  • 960GB SSD + 2TB SATA
  • 1 Gbps uplink port
  • Bandwidth of 200TB
  • Location: USA

Register now

2 x E5-2650 v3 2.3GHz for $ 999 / m

  • 2 x E5-2650 v3 2.3GHz
  • 96GB DDR3 ECC RAM
  • HDD 4X480GB SSD
  • 1 Gbps uplink port
  • Unmetered bandwidth
  • Location: USA

Register now

* If you need something that has a little more power request a quote today.
Not allowed

  • Illegal child content
  • Virus / Exploitation Activities
  • Terrorist activities
  • Email Spamming
  • Flood
  • Fraud
  • Identity theft
  • Port scanning

Contact Us
If you have any questions about our services or want to request a customized package, send us a ticket or send us an email to [email protected]
We also have a live chat link on the side of our website.

seo – How to mark canonical labels for multiple versions of the same product?

We have a car research website where we have product pages. In addition, few products have some different variants with subtle differences. The case is similar to that of amazon iphone.

If you click on a different size (64, 128 and 256), they have three different URLs with different canonical characters. The content of these 3 pages is very identical, is it not duplicate content? Why does not Google penalize you for this duplicity?

Also, if I write ranges of iphone pages XR – 64 gb, if I write ranges of pages iphone xr 64 gb – again 64 gb, if I write ranges of iphone pages xr 128 gb – 128 gb. How do you identify that 64 GB should be prioritized?

Also, I do not see anything defined as such in the structured data.

Can someone tell me how this is happening? Also, what should be URL and canonical for such products?

Performance adjustment – Optimization of the Do loop with multiple variables

I am quite new to Mathematica and would like to optimize a Do loop with several variables that I have.

I have three lists of three elements each, with the proviso that the first element must be larger than the second and so on. From them, I build arrays and do operations on them; since I want to scan all the possible matrices, I have this great loop Do:

l1 = {a, b, c}; l2 = {d, e, f}; l3 = {g, h, i};
Do[
m1=Table[(l1[[i]]+ l2[[j]]), {i, 3}, {j, 3}]; (* only as an example, not the actual operations *)
m2 = table[(l1[[i]]+ l3[[j]]), {i, 3}, {j, 3}];
{vl, m1d, vr} = SingularValueDecomposition[m1];
{ul, m2d, ur} = SingularValueDecomposition[m2];
...
{a, 2,5}, {b, a-1}, {c, 0, b-1}, {d, 2,5}, {e, d-1}, {f, 0, e- 1}, {g, 2,5}, {h, g-1}, {i, 0, h-1}
]

The operations within the loop are much more difficult, and this loop would take too long to complete. How can I improve my situation? I have read something about the use of Map but I did not understand very well how it should be applied to my case.