Categories
Mastering Development

Why does calling this function as follows not result in sendNotification being called severy 60 seconds exactly on the minute?

I want to execute a database query every whole minute. How can I do this accurately? I have an attempt at this below, but it does not work correctly. The first call is accurate, but the subsequent calls are not on the correct time. const db_days = require(‘./models/dayOfWeek’); const db_meds = require(‘./models/medicine’); async function hourlyEligibleNotifications() […]

Categories
Mastering Development System & Network

New-ScheduledTaskTrigger using variable for -DaysofWeek

I’m writing a script that takes the user’s input to then Register-ClusteredScheduledTask I’m trying to use a string for the -DaysOfWeek, but am only receiving various errors… New-ScheduledTaskTrigger -Weekly -WeeksInterval $recur -DaysOfWeek $day -At $starttime New-ScheduledTaskTrigger: Cannot process argument transformation on parameter ‘DaysOfWeek’. Cannot convert value “[dayofweek]Sunday,Wednesday,Saturday” to type “System.DayOfWeek[]”. Error: “Cannot convert value “[dayofweek]Sunday,Wednesday,Saturday” […]

Categories
Mastering Development

How to filter an unknown element in a list python

I’m trying to make a program that is given abbreviations of the days of the week (Mon, Tue, Wed etc.) and replaces these with the full word (Monday, Tuesday, Wednesday). The program creates a list full of strings and outputs it as a string. I have this working except for when something that isn’t a […]

Categories
Mastering Development

how to use grep function for search?

I want to build build a function which allows me to identify days from any string. My days directory is: days<-c(“Sunday”, “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”) The search should be case insensitive but should not include partial matches such as Mon for Monday or Tues for Tuesday. For example, below mentioned string should give […]

Categories
Mastering Development

Validate integer

This is a program that allows the user to build a high school schedule. I would like to validate an integer as a high school class number in my String method. Here’s the name of my method with the parameters. public static String addClass(String name, String day, String momentOfDay, int group){ The user has to […]

Categories
Development

React hooks rendering cause

I’m playing with simple React components to understand when rendering occurs. Sample 1 – Initially renders once. Regardless of the number of times the button is clicked, it doesn’t render. This is expected. import React, { useState } from “react”; import “./styles.css”; export default function App() { const [state, setState] = useState([ { id: 1, […]

Categories
Development

Want to use a floating action button that adds an item to a recyclerview in a specific fragment that is contained in a ViewPager2

I have been having a lot of trouble trying to implement multiple recyclerviews across multiple pages(represented by fragments) in a viewpager2, and I want to use a floating action button that when clicked, props up a page where the user can input data that can eventually be added to the recyclerview within a specific page […]

Categories
Development

Why my routerLink is not showing my CalendarComponent

I have an app hooked up with a backend. Whenever I run the project and then press ng serve, everything works as planned. I can even see the routerlink that i created and when I hover the mouse over the link it shows the correct path- localhost:4200/Calendar When clicked however, it renders the Sunday through […]

Categories
Development

Sort items in a list

I have a string list in a C# ASP.net project i am working on. the contents in the list look something like below: Apple,1,monday Banana,5,monday Pear,4,tuesday Apple,2,tuesday, Banana,7,tuesday Orange,6,wednesday Apple,9,thursday, Banana,2,friday The list contains a type of fruit item, the quantity of that particular fruit and the day that fruit and quantity is needed. What […]

Categories
Development

What JavaScript code would I use to plot a trend line?

Assuming that I have the following values that I’m going to plot on a Line chart (these are values and not coordinates – the coordinates are calculated by my software and are shown below): [4,4,3,2,5,5] How would I turn those values into a set of trendline values/coordinates? (BTW I don’t really have any Maths expertise […]