WooCommerce IF statements not working

I am trying to use the WooCommerce Conditional Tags to only include a template into specific product pages. https://docs.woocommerce.com/document/conditional-tags/

However my statements aren’t working, and they show on all pages. I’d like to NOT display my template in a specific category and its product pages:

// Show in Shop Page OR NOT in Products IDs 15852,15859,15863,15866 OR NOT Category Archive Gift Cards

I’ve also tried the opposite:

Can you please advise how to get it to work?

Our website: https://grindersforlife.com/shop


Can I write portable SQL statements?

I am wondering if it is possible to write SQL statements that are 100% interoperable with most or all databases including:

  • MariaDB/MySQL/Percona
  • Postgres
  • Microsoft SQL
  • Oracle
  • SQLite

(Eg, can I just follow a specific SQL standard? Eg, is there something similar to POSIX compliance standards for SQL?)

If so, are there any linting tools available that I can use in a git post-receive hook to reject SQL usage that doesn’t follow such a standard or non-compliant SQL code without having to try to commit the code on all DBs?

Trouble with or statements and short circuiting

I’ve my code as follows:

class Main { public static void main(String[] args) { boolean s; boolean x = true; System.out.println(x || s); } }

I’ve learned that or statements in java short-circuit once the computer finds any value to be true. Here, I’ve declared but not initialized s, but I’ve done both with x. I put an or statement with x at the front, but the computer displays an error, citing that s hasn’t been initialized. Why’s this occurring? Shouldn’t it automatically display a true once it realizes that x is true, and satisfies the or statement? Thanks.

Removing multiple values using if else statements?

I have a program that downloads raw data from a sensor. Due to to some specifications made in the SQL code, there are values that are duplicated which needs to be deleted to maintain data integrity.

Below is a snapshot of the dataset: enter image description here

Do note that is is just a snapshot of july 10th. I have 33 other devices all of them have data dates from july 10th all the way through october.

Is there a way for me to traverse the whole dataset and find a way to set conditional statements. For example, if there are 2 values that share the same timing, take the row that has the “1” value.

At the same time, i would like to point out that this dataset is data that is collected 24/7.

How do I prove or disprove the following statements?

I have to prove or disprove the following statements.

a) ≈(L(X)) ⊆ ≈(L(Y)) ⇒ ~(X) ⊆ ~(Y)

b) L(X) ⊆ L(Y) ⇒ ~(X) ⊆ ~(Y)

Definitions:  DFA:M=(K,Σ,q0,δ,F) x~y : ∃q∈Q (q0,x) |-- (q,λ) and (q0,y) |-- (q,λ) x≈y : ∀z∈Σ* xz∈L ⇔ yz∈L 

My problem is the formal proof.

I could show that L(X) ⊆ L(Y) ⇒ ~(X) ⊆ ~(Y) with the help of an exmaple, but that doesn’t show that it applies to all.

And the main problem is to show ~(X) ⊆ ~(Y) or ≈(L(X)) ⊆ ≈(L(Y)), because I don’t really get what that means and when or why it is a subset.

Maybe on of you has an idea to prove or disprove the statements.

Bypass prepared statements

I know that prepared statements are used to handle input at the front end. However I was wondering how do you bypass a prepared statement? I have seen some people talk about string concentration but I’m not sure.

The language I’m using is java so I was wondering how someone can bypass a prepared statement. I know it’s possible but not sure how exactly. An example would be nice to clarify.


Scaffold context efcore does not generate .HasIndex statements

Given any schema (here’s one below). When running efcore scaffold-context, all goes well but the HasIndex statements are missing. Why ? Also, if efcore does not have those .HasIndex() will run queries differently ?

Scaffold-DbContext "Server=$  YourServer;Database=ContosoUniversity1;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Force   CREATE TABLE [Instructor] (     [ID] int NOT NULL IDENTITY,     [LastName] nvarchar(50) NOT NULL,     [FirstMidName] nvarchar(50) NOT NULL,     [HireDate] datetime2 NOT NULL,     CONSTRAINT [PK_Instructor] PRIMARY KEY ([ID]) ); 

Are there rules (or at least relevant statements) in 5e about conservation of mass with magic?

Since some spells (such as enlarge/reduce) seem to reduce or increase the amount of mass that is present in game-play with no explanation as to how this happens, some interpret that to mean that conservation of mass is “thrown out the window” in 5e.

However, another view is that the RAW is silent on how those spells work, which leaves it up to the DM to either enforce or discard conservation of mass. The detailed mechanics of enlarge, for example, might be that it draws molecular matter from deep within the earth and/or from the environment or atmosphere, or even from another plane, such that conservation of mass holds true. Or then again, it might not. The spell description doesn’t say.

In a couple of answers about 3.5e (such as this one and this one), it has been softly asserted that conservation of mass is not really respected in D&D, and the topic was touched upon in comments to an answer to a 5e question, but the issue has not been definitively put to rest, that I can see.

Is this indeed ambiguous according to RAW, perhaps intentionally (perhaps the rules authors are avoiding over-managing the campaign settings of various tables)? To put it differently: Is the RAW silent on conservation of mass? Or is there a definitive RAW answer to this somewhere that I have not come across?

Prepared statements and terrible performances

There was an application that was changed, so that all queries are performed using prepared statements, rather than regular statements. What happens is that, for every query, the prepared statement is created, used once, dumped.
This is obviously bad for performances, but it is much worse than I could expect.
Please tell me why this query takes 12 seconds on average to execute as prepared statement:

select top 1 * from Object1 where (Column1 = ?) 

You can see the plan here:


The table is about one million rows, a few kbytes every row, has a PK and only 4 indexes, including a non-clustered, non-unique index on Column1

What can I do to improve the performances, without returning to regular statements?

How to use case statements in BASH?

I have code which extracts the time stamping’s by matching a key word/sentence of a .log file which is existing in several folders of the form log_Job_*. It calculates time duration’s of different processes and write the output to a .CSV file.

What columns I want to have in my .csv:

  1. FileName
  2. ProcessType
    • Import
    • Validate
  3. . .
  4. MainPartionDuration

Now the problem is, I have 2 types of process under 2. Process Type. So, thought of using case statements here. And did as following:

#!/bin/bash  Header="Filename1,ProcessType1,TotalDuration1,Initialization1,MPEProcessDuration1,TotalPartitionDuration1,WaitPartitionDuration1,MainPartionDuration1" echo $  Header >>OutputFile_Validate.csv  cd /path/to/manoj/version_2019_logs/ for file in log_Job_*/manoj.log; do     ProcessType1="$  (grep -F 'Running process mpeXbrlImport.xml' "$  file" | awk '{print $  5}' | cut -c 4-)" #echo "$  ProcessType" ProcessType2="$  (grep -F 'Running process mpeXbrlValidate.xml' "$  file" | awk '{print $  5}' | cut -c 4-)" #echo "$  ProcessType" ProcessType="$  ProcessType1","$  ProcessType2" case $  ProcessType in  $  ProcessType1)  set of commands to get other variaqbles  Var="$  Filename","$  ProcessType","$  TotalDuration","$  Initialization","$  MPEProcessDuration","$  TotalPartitionDuration","$  WaitPartitionDuration","$  MainPartionDuration" echo $  Var >>OutputFile_Import.csv ;; *)  repeat the set of commands and this time save with different variable names Var1="$  Filename1","$  ProcessType1","$  TotalDuration1","$  Initialization1","$  MPEProcessDuration1","$  TotalPartitionDuration1","$  WaitPartitionDuration1","$  MainPartionDuration1" echo $  Var1 >>OutputFile_Validate.csv ;; esac     done 

With this my plan is to create two seperate .CSV files based on the Processtype and then concatenate both the files.

Problem: The script is getting executed successfully, but at the end it is generating only one file i.e. OutputFile_Validate.csv

I have verified the script carefully, am not using any variables repeatedly. Can someone tell me, what could be the reason for this!!