Categories
Arduino Ask Engineering

6 buttons useless box

i want to make a useless box with 6 buttons MY CODE // steppmm*moveX=240 #include <Stepper.h> int BUTTON_PIN[7] = {26, 27, 22, 23, 24, 25, 10}; int lastState = LOW; int currentState; float Stepmm = 250 ; float A = 0; float B = 0; int S1[0]; const int stepsPerRevolution = 200 ; int switchPos[9] […]

Categories
Mastering Development

Need to generate output in the following format year, q1,q2,q3,q4 in the MS SQL server for below data

CREATE TABLE acquisition ( id INT PRIMARY KEY IDENTITY, company_name VARCHAR(100), cost_amount INT NOT NULL, acquired_at DATE NOT NULL ); INSERT INTO acquisition(company_name, cost_amount, acquired_at) VALUES (1,’HOFA’, 6850, ‘2010-01-17′), (2,’POGA’, 9256, ‘2019-09-04′), (3,’CUPU’, 9329, ‘2012-08-21′), (4,’BULO’, 5162, ‘2020-11-21′), (5,’GICE’, 5301, ‘2012-10-04′), (6,’TOSE’, 1790, ‘2018-09-30′), (7,’POWU’, 7183, ‘2019-05-21′), (8,’YEJO’, 1491, ‘2010-12-12′), (9,’XAMO’, 5974, ‘2010-03-23′), (10,’TEFA’, 9456, […]

Categories
Mastering Development

Gurobi/Python Syntax for print commands to get a specific result?

I’m trying to figure out the syntax to print the following optimization problem. It’s supposed to look like this when printed: The minimum workers for Scheduling: 14 Shift 1: workers starting = 0, total working = __, required = __ Shift 2: workers starting = 6, total working = __, required = __ Shift 3: […]

Categories
Mastering Development

how does this concat command work with this array?

I came across this JS problem but I can’t figure out the syntax of how it’s working, could someone please help to explain? I don’t understand the empty square bracket syntax at the start and then how the concat is being applied with another empty square bracket? it’s just quite confusing for me. Appreciate any […]

Categories
Mastering Development

Javascript Sorting Matrix Diagonally

There is an algorithm question asking to sort a matrix diagonally. I’m not finding a solution for this quesiton. const matrix = [ [1, 3, 9, 4], [9, 5, 7, 7], [3, 6, 9, 7], [1, 2, 2, 2] ] Should output: [ [1, 9, 9, 7], [3, 5, 6, 9], [3, 4, 7, 7], […]

Categories
User Help

How do I count how many times I have columns that are populated?

I have a decent sized spreadsheet (9,000 rows, and 150 columns). The columns indicate the various weeks of a year a product (the row) generated a sale. I want to count how many instances there are with consecutive weeks where a sale is recorded. For instance, let’s say a product has generated a sale in […]

Categories
Mastering Development

What is the efficient way to find an array inside an array?

Find an Array of Values Inside an Array Lets say I have an array [1,2,3,8,2,3,4,5,6,7,8] and I want to find the first occurrence of the values [3,4,5,6] together, how might I do that? I can use Array.prototype.findIndex, but when I am looking for a large amount of values in a large array, it doesn’t feel […]

Categories
Mastering Development

Recursive AWS Lambda function calls – Best Practice

I’ve been tasked to look at a service built on AWS Lambda that performs a long-running task of turning VMs on and off. Mind you, I come from the Azure team so I am not familair with the styling or best practices of AWS services. The approach the original developer has taken is to send […]

Categories
Ask Geographic Information System (GIS)

Remapping image values in Google Earth Engine Python API

I am trying to remap some values on an image using the python API but I am struggling to understand the syntax. In javascript I would do it like this: var image = image.remap({from: [1, 2, 3, 4, 5, 6, 7, 8 , 9 , 10 , 11, 12, 13], to: [1, 0, 0, 0, […]

Categories
Ask Geographic Information System (GIS)

How can the GeoKeyDirectoryTag byte string be decoded from a las header vlrs?

I am currently reading a .las file with laspy and transforming the points to a custom state plane coordinate system. I would like to update the GeoKeyDirectoryTag but cannot find information on how it is encoded. The sample I have results in the following: User ID LASF_Projection Record ID 34735 Description = GeoKeyDirectoryTag (mandatory) VLR_body […]