Construct a dfa and nfa for a set of strings on{0,1} : the left most symbol differs from the right most one and odd length string

Construct dfa and nfa for a set of string 0,1 such that left most and right most element are different and odd length string
Can you plss draw it

magento2 – Odd behavior with Magento 2 color swatches

When I use the quick search on my Magento 2 store for a Configurable SKU and hit ENTER, the search_results page displays only the product image with its description without any JS or CSS. But when I do the same step through searching a Simple product, the search_result page displays normally with the product query.

I investigated the matter, and found out that if I delete the COLOR attribute Swatches i.e. Green, Blue… from the color attribute page, then the Configurable product displays normally once I search for it through its SKU.

My Catalog Search engine is MySQL and my Magento version is 2.3.4

Has anybody had a similar issue?

Would the possible solution be oriented toward the Catalog_Search phtml or XML as it looks like a corrupted code?

co.combinatorics – A conjecture on circular permutations of n elements in an abelian group of odd order

In 2013 I formulated the following conjecture in additive combinatorics.

Conjecture. Let $G$ be an additive abelian group of odd order, and let $A$ be a subset of $G$ with $|A|=n>2$. Then, there is a circular permutation $(a_1,ldots,a_n)$ of all the elements of $A$ such that all the adjacent sums $ a_1+a_2,ldots,a_{n-1}+a_n,a_n+a_1$
are pairwise distinct.

Recently, Mr. Yu-Xuan Ji, a student at Nanjing Univ., verified this conjecture for $|G|<30$.

I’m even unable to show the conjecture for $G=mathbb Z/pmathbb Z$ with $p$ an odd prime.

Any ideas towards the solution of this conjecture? Your comments are welcome!

context free – Design a CFG that generates the language { x in {a,b}* | the length of x is odd and its middle symbol is a b }

I am trying to design a context-free grammar that generates the language { x in {a,b}* | the length of x is odd and its middle symbol is a b }.

This is really confusing me, I’m having trouble with making sure that b is always in the middle. Any help?

Check if array has the same number of even and odd values in Python

Task:
Complete the following function that determines if the number of even and odd values in an list of Integers is the same.

| In               | Out   |         Why            |
|------------------|-------|------------------------|
| (5, 1, 0, 2)     | true  | two evens and two odds |
| (5, 1, 0, 2, 11) | false | too many odds          |
| ()               | true  | both have 0            |

The function should not affect the contents of the list.

My code:

def balanced(lst):
    n = len(lst)
    if n % 2 != 0:
        return False
    if n % 2 == 0:
        count_1 = 0
        count_2 = 0
        for item in lst:
            if item % 2 == 0:      #even
                count_1 += 1
            if item % 2 != 0:       #odd
                count_2 += 1
    if count_1 == count_2:
        return True
    else:
        return False
def result(lst):
     if balanced(lst):
         print("Your list is successfully balanced! It has same number of evens and odds!!")
     else:
         print("Oh no! Sorry! Your list seems to be not balanced! Try another list please!")
def main():
     lst_1 = (1,2,3,5,6,8,5,9)
     lst_2 = ()
     lst_3 = (2,4,5,7)
     lst_4 = (1,2,4,4)
     lst_5 = (1,2,3)
     result(lst_1)
     result(lst_2)
     result(lst_3)
     result(lst_4)
     result(lst_5)
main()

javascript – Countdown from 100 to the number (N) and separate even and odd numbers. Show even numbers in the first line and odd numbers in the second line

<div id="counter">100</div>
  <script>

    function myFunction() {
  var person = prompt("Please enter One number (N) where (N) is a positive integer.", "");
  if (person != null) {
    document.getElementById("demo").innerHTML =
    "Hello " + person + "! How are you today?";
  }
}
function countdown() {
    var i = document.getElementById('counter');
    i.innerHTML = parseInt(i.innerHTML)-1;
    if (parseInt(i.innerHTML)==95) {
       clearInterval(timerId);
    }
}
var timerId = setInterval(function(){ countdown(); },1000);
  </script>
  <p id="demo"></p>

Example Test Cases :
Input Output
10 100 98 96 94 92
99 97 95 93 91
5 100 98 96
99 97

windows 10 – Has anyone seen the output of the command "net time" display odd characters?

I have started to see this on many Windows 10 systems, including my professional and personal PC. Essentially, the time output of the NET TIME \ LOCALHOST command, which generally looks like "the current time at \ localhost is 4/2/2020 12:11:15 PM" now contains some kind of odd character preceding the DD, MM and YYYY parts of the output string. I can't seem to copy the strange characters, which makes me think that they are some sort of terminal control character, perhaps.

This broke some pieces of code that my company uses to determine remote datetime information.

This didn't happen before on my work PC or my personal computer, so I suspect that a Windows 10 update has broken this command somewhat. You are wondering if anyone else has seen this and if there is anything I can do about it, other than solving the problem in the parsing code.

This is what the output looks like on my personal PC

theory of elementary numbers – Let a, b, c, d be odd integers

Let a, b, c, d be odd integers where 0 <a <b <c <d. We know that ad = bc while a + d and b + c are powers of 2, i.e. there are positive integers x, y such that a + d =$ 2 ^ x $ and b + c =$ 2 ^ y $. Show that a = 1

I tried to replace d =$ frac {bc} {a} $ etc., but it doesn't work.

Can anyone give me a hint?

python 3.x – Given an array, find the integer that appears an odd number of times. There will always be a single integer that appears an odd number of times

def find_it(seq):
    counter = {}

    for num in seq:
        if num in counter:
            counter(num)+=1
        else:
            counter(num) = 1


    for k in counter:
        if counter(k) % 2 != 0:
            return counter(k)

    print(counter)



test.assert_equals(find_it((20,1,-1,2,-2,3,3,5,5,1,2,4,20,4,-1,-2,5)), 5)
test.assert_equals(find_it((1,1,2,-2,5,2,4,4,-1,-2,5)), -1); 
test.assert_equals(find_it((20,1,1,2,2,3,3,5,5,4,20,4,5)), 5);
test.assert_equals(find_it((10)), 10);
test.assert_equals(find_it((1,1,1,1,1,1,10,1,1,1,1)), 10);
test.assert_equals(find_it((5,4,3,2,1,5,4,3,2,10,10)), 1);

So he wants me to know which integer appears an odd number of times in a list, so I created a dictionary and counted the values ​​of the number of times it was counted and I all noted, but the only thing i need to do is print the key & # 39; 5 & # 39; which has been counted 3 times but I don't know how to return it. I am a beginner, so I may be overestimating this problem and I am sure there is an easier way to solve this problem, but I would also like to know how to solve this problem than I have . Thank you!

java – How to print only the odd numbers in the form of a pyramid?

How could I print the odd pyramid numbers and the sum between them?

In order to add the odd numbers, we need to know the index and the maximum and final position of each line in the pyramid.

for example, there may be some initial clues:

             1     <- i = 0    

          3        <- i = 1 

       7           <- i = 3

   13              <- i = 6

21                 <- i = 10

So the variable i represents the initial index of each element of the pyramid ({1, 3, 7, 13, 21}).

However, we need to know what is the final index of X row of pyramid.

The final clues would be:

           Indice:           Inicial   Final
             1               (i = 0,   n = 1)

          3     5            (i = 1,   n = 3)

       7     9    11         (i = 3,   n = 6)

   13    15    17    19      (i = 6,   n = 10)

21    23    25    27    29   (i = 10,  n = 15)

What is the use of knowing these clues?

This helps us to go through each row of the pyramid and that way we can know which are the even or odd numbers. An analogy would be an array of integers, each row has X elements, in which, we could get the sum of all even numbers. This is similar to a pyramid of elements. The difference is that in a matrix, the final index is always constant (the size of the column is the same for each row) and in a pyramid of elements, it varies.

The million dollar question: How the hell can I get the final index for each row?

With this simple formula:

N = row + i;

Or:

  • N is the final clue.
  • row is the line number.
  • i is the initial clue.

Let's start by evaluating certain lines:

  • 1st row i = 0 y row = 1, when replacing in the formula gives us as a result: N = 1 + 0 = 1.

  • 2nd row i = 1 y row = 2, during the replacement gives us: N = 2 + 1 = 3.

  • 3rd i = 3 y row = 3, when replacing, N = 3 + 3 = 6.

And so on, we replace the values ​​for each row.

With this, we have already solved the problem. Now let's start modeling our classes.

The first class we will have will be PyramidRow. In this class we will have the necessary attributes to be able to store the initial and final index of X row.

Example:

class PyramidRow
{
    private int begin; //índice inicial
    private int max;//índice final

    public PyramidRow(int begin, int max)
    {
        this.begin = begin;
        this.max = max;
    }

    public int getBegin()
    {
        return begin;
    }

    public void setBegin(int begin)
    {
        this.begin = begin;
    }

    public int getMax()
    {
        return max;
    }

    public void setMax(int max)
    {
        this.max = max;
    }
}

Then we will create another class called PyramidRowList in which it will be used to create a list of type objects PyramidRow. This way, we will have the information (initial and final index) of each row in a list.

class PyramidRowList
{
    private List listRows;

    public PyramidRowList()
    {
        listRows = new ArrayList<>();
    }

    public List getListRows()
    {
        return listRows;
    }

    public void setListRows(List listRows)
    {
        this.listRows = listRows;
    }
    //El parámetro length es para guardar el tamaño del vector
    public void calculateRow(int length)
    {
        int i = 0, n, row = 1;
        while(true)
        {
            n = row + i;
            if(n > length)
                break;
            listRows.add(new PyramidRow(i, n));
            for(; i < n; i++){}
            row++;
        }
    }
}

In the method calculateRow is where we will calculate the start and end index of each line of the pyramid, then we will save it as an object in the list.

Finally, just browse the list of objects and have access to the initial and final index of each row:

public class Program 
{
    public static void main(String() arg)
    {
        int impares = 0;
        int lengthPyramid;
        int() nums = new int(){1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29};
        //Creamos el objeto
        PyramidRowList listRows = new PyramidRowList();
        //Calculamos los índice iniciales y finales de cada fila
        listRows.calculateRow(nums.length);
        //Almacenamos la cantidad de filas que tenga la piramide
        lengthPyramid = listRows.getListRows().size();
        //Recorremos la lista
        for(PyramidRow row : listRows.getListRows())
        {
            for(int i = lengthPyramid - 1; i != 0; i--)
                System.out.print("t");
            for(int i = row.getBegin(); i < row.getMax(); i++)
            {
                System.out.print(nums(i) + "tt");
                if(nums(i) % 2 != 0)
                    impares += nums(i);
            }
            System.out.print("= "+ impares);
            System.out.println("");
            lengthPyramid--;
            impares = 0;
        }
    }
}


class Program 
{
    public static void main(String() arg)
    {
        int suma = 0;
        int() nums = new int(){1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29};
        for(int i = 0; i != nums.length; ++i)
        {
            if(nums(i) % 2 != 0)
            {
                suma += nums(i);
                System.out.println(nums(i));
            }
        }
        System.out.println("La suma de los numeros impares es: "+ suma);
    }
}

And ready, on the screen, you need to give us this:
img1