Categories
Mastering Development

Putting a “in list” into an if statement

I am currently in the process of creating a hangman game. My problem is in the 2nd for loop, for x in wordlist. This for loop is supposed go through the wordlist (in this example [‘H’, ‘E’, ‘L’, ‘L’, ‘O’]) and: if x in newwordlist or x==guessedletter, then x is printed onto the new list […]

Categories
Database Development

How to extract certificate attributes from a single column and split into many?

In my table I’ve a field (let say cert_attr) which stores Certificate X.509 Attributes, such as: CN=User1, OU=Eng, O=Company Ltd, L=D4, S=Dublin, C=IE CN=User2, OU=Eng, O=Company Ltd, L=D2, S=Dublin, C=IE OU=Eng, O=Company Ltd and I’m trying to split this field into separate columns using SELECT in the following way: SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(cert_attr, "CN=", -1), ", ", […]

Categories
Mastering Development

error building app with hermes: ‘..’ is not recognized as an internal or external command

Building the react-native app on Windows 10. The error is printed for line 165 of node_modules\react-native\react.gradle: ‘..’ is not recognized as an internal or external command, operable program or batch file Line 165 is the 5th line in the following, starting with exec: if (enableHermes) { doLast { def hermesFlags; def hbcTempFile = file("${jsBundleFile}.hbc") exec […]

Categories
CMS Magento Mastering Development

Edit/modify Google Analytics code from core module, not working – Magento 2.4.1

I want to edit the default Google Analytics code from the core module Magento_GoogleAnalytics, that is build in Magento 2.4.1. I want to add the line; setTimeout("ga(‘send’,’event’,’Profitable Engagement’,’time on page more than 30 seconds’)",30000); Therefore I copied the file to /app/design/frontend/theme/theme/Magento_GoogleAnalytics/web/js/google-analytics.js With the following entire js code, see below. But for some reason that does […]

Categories
Mastering Development

How to run this tsduck shell command containing quotes with subprocess.run in Python

Here is the command as written in the tsduck manual: tsp -I dvb -a 1 @ts1028.txt \ -P svremove -s AlJazeeraEnglish \ -P merge "tsp -I dvb -a 0 @ts1022.txt -P zap TV5MondeEurope" \ -P analyze -i 30 -o merged.txt \ -O dektec @modulation.txt Here is my version: import sys import subprocess mod_values = { […]

Categories
Mastering Development

Can not compile FFTW3 library in vscode but same command works in mac terminal

My first test with FFTW library looks like this. #include<iostream> #include<complex> #include<fftw3.h> #include<stdlib.h> using namespace::std; int main(){ fftw_complex* x; complex<double> y; y.real(1.0);y.imag(-1.0); x = reinterpret_cast<fftw_complex*>(&y); cout << (*x)[0] << endl << (*x)[1] << endl; double y1[2]; y1[0] = 2.0;y1[1] = -2.0; x = &y1; cout << (*x)[0] << endl << (*x)[1] << endl; fftw_complex x1; […]

Categories
Mastering Development

How can I validate data to be posted on a table with reference to the same table?

While creating donation I want to check whether the data with same donor_id exists or not. If data don’t exists then create donation else if there is data then get the latest donated date and validate whether the latest donated is greater then 3 months or not (if latest donated date exceeds three month then […]

Categories
Mastering Development

Validate a string of certain characters and numeric of exact length using Regex

Objective:match exact 10 of mixed uppercase characters (except I,O, and space) and numeric from 2 to 9: To be exact, here is the valid set the value must be coming from: {‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’, ‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’, ‘H’, ‘J’, ‘K’,’L’, ‘M’, ‘N’, ‘P’, ‘Q’, ‘R’, ‘S’, […]

Categories
Mastering Development

how to display user input into 4 by 4 array? C++

I have this void main(int argnum, char** input) { int a=0, b=0, c=0, d=0, e=0, f=0, g=0, h=0, i=0, j=0, k=0, l=0, m=0, n=0, o=0, p=0; printf("Enter the numbers from 1 to 16, in any order(separate by comma) : "); scanf_s("%d" "%d" "%d" "%d" "%d" "%d" "%d" "%d" "%d" "%d" "%d" "%d" "%d" "%d" "%d" […]

Categories
Mastering Development

Remove null from old 2d array and put the not null elements in a new 2d array

I am trying to remove the null elements from the old 2d array and put it in a new 2d array, but the new 2d array is outputting all null elements. String[][] status = new String[P][M]; String[][] newStatus = new String[P][M]; for (int i = 0; i < status.length; i++){ for (int j = 0; […]