Categories
User Help

In Excel, how do i check if cell contains at least twice the same character from a list

I have a list: "2","3","4","5","6","7","8","9","A","K","J","Q","T" Then I have cells: 6s 3d 3c yes (2) 6s 3s 2d no 6s 3s 2s no 2s 2d 2c yes (3) ….. I want to check if the cell A6 (here 6s 3d 3c) contains at least 2 times the same character from the list above and returns yes […]

Categories
Mastering Development

Python numpy groupby multiple columns

Is there a way to make a group by aggregation by multiple columns in numpy? Im trying to do it with this module: https://github.com/ml31415/numpy-groupies Goal is to get a faster groupby than pandas. for example: group_idx = np.array([ np.array([4, 3, 3, 4, 4, 1, 1, 1, 7, 8, 7, 4, 3, 3, 1, 1]), np.array([4, […]

Categories
Arduino Ask Engineering

loop once per startup for stepper motor

First of all sorry that i dont know much about programming, most of my codes are just copy paste. And of course, i know this question has been asked before, but while using this code: #include <AccelStepper.h> AccelStepper stepper (1,7,6); void setup() { // put your setup code here, to run once: stepper.setMaxSpeed(100); stepper.setAcceleration(20); stepper.runToNewPosition(100); […]

Categories
Arduino Ask Engineering

Send custom HID values instead of keys

I’ve been building a small macro keypad based on the ATmega32U4. So far, I’ve been able to send standard key presses to the host. But since I want a program on the host system to react to the key presses, I only send the keys to serial to avoid typing anything. For now, this does […]

Categories
Mastering Development

numpy.linalg.LinAlgError: Singular matrix Error When Trying to Solve

import numpy as np A = np.array([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]) B = np.array([[1, 2], [3, 4], [5, 6], [7, 8]]) C = np.array([[1, 2, 3], [4, 5, 6]]) D = np.array([[1], [2], [3]]) prod_AB = np.matmul(A, B) E = np.matmul(prod_AB, C) x = np.linalg.solve(E, D) Traceback (most […]

Categories
Arduino Ask Engineering

Communication b/w Arduinos, master(M) and slave(S) via Tx Rx pins. M sends query to S which shows the data in serialmonitor. S fails to send data to M

Slave code int arr[10] = {0,1,2,11,4,5,6,7,8,9}; char id = ‘1’; char re[2]; void setup() { // Begin the Serial at 9600 Baud Serial.begin(9600); } int ia; void loop() { Serial.readBytes(re,2);// slave gets the query ia = re[1] – ‘0’; if (re[0] == id){ Serial.println(arr[ia]);// slave print in serial monitor } delay(500); } Master Code char […]

Categories
Mastering Development

find the position of the next highest of the given element in an array

I have a descending order sorted array, where I need to get the position of the given element if found in an array, if not found then return the position of the next higher element. For example if we pass [10,11,10], the expected result is [12, 12, 12] because 10<12 && 11<12 && 10<12 Hence […]

Categories
Mastering Development

pandas test with true / false logic to whole dataframe

I have a dataframe as follows: df = pd.DataFrame({‘Jan’:[80,5,21],’Feb’:[85,7,19],’Mar’:[75,15,25]}) Jan Feb Mar 0 80 85 75 1 5 7 15 2 23 18 25 I would like to return True or False if the values are > 20 Jan Feb Mar 0 True True True 1 False False False 2 True False True How would […]

Categories
CMS Mastering Development Wordpress

Print sum of custom fields value if another custom field date is equal to today’s date

I want to print the sum of recent 10 posts custom field value of a specific category/tag. The recent 10 posts also have a custom field key named (Validdate), so how to print sum of the 10 posts if their Validdate CF value is equal to today’s date? Example – Category Id – 520 1st […]

Categories
Mastering Development

Create a prolog program that finds the culprit of a crime given the following facts

Zebra Technique Example – https://www.eecs.yorku.ca/course_archive/2020-21/F/3401/slides/zebra.prolog I believe the suspects can be organized as follows: **- suspect(Angela, _, _, female) suspect(Mary, _, _, female) suspect(David, _, _, male)** also i know that the ages are arranged as follows: **- suspect( _, Leung, 5, _) suspect(_, Diamond, 7, _) suspect(_, Grant, 8, _)** this is where i […]