Categories
Mastering Development

Amazon AWS OAuth2 example in .netcore

I’m trying to implement a simple OAuth2 authentication access for Web API’s using .netcore 3.1. I can’t seem to find any examples of how to implement this. Does anyone have any c# examples on how to do this or any good tutorials? Thanks in advance, Richard

Categories
Development

Custom login / redirect from WordPress website

I am looking to find a way for customers to log in to their customer account hosted at an external site but to be able to sign up and log in from our customer WordPress website. e.g. Tom signs into his account using a login box at www.abc123.co.uk He is then redirected to his customer […]

Categories
Development

ProgrammingError: Not all parameters were used in the SQL statement

Need a little help here, think I have tried everything to fix this issue but keep getting the same error message ProgrammingError: Not all parameters were used in the SQL statement CODE: mydb = mysql.connector.connect(host=”localhost”, user=”xx”, passwd=””, database=”xx”) mycursor = mydb.cursor() sql = “INSERT INTO authors(id, first_name, last_name, photo) VALUES(%s, %s, %s,%s)” values = [”'(1,’Herbert’,’Methley’,’NULL’), […]

Categories
Development

Count the occurrences of a symbol and return a column with the count, but only in certain cases, in R

I have data that looks like this: structure(list(Age = c(“25”, “22”, “54”, “62”, “86”, “25”, “44”, “54”, “48”, “50”), full_name = c(“DOE, MARTIN”, “SMITH, RYAN E”, “JOHN, KENNETH”, “DOE, LAWRENCE A”, “FU, EDGAR”, “ALEXANDER, AL”, “BARR, DONALD”, “STEVENS, RICHARD”, “LUIGI, MARIO”, “SMITH, GLEN” ), ems_interventions = c(“Oxygen – Prehospital Cervical Collar – Prehospital Long Spine […]

Categories
Development

How to Make a Powershell Invoke-WebRequests Script Interactively Pass Off Variables in Where-Object Strings

So I have two scripts that operate within Powershell 1903 Update. One of the Works and one of them is Failing when I pass Variables within the Where-Object {} string. The working Script will download the file in the Downloads directory #!/bin/powershell # ==================================================================================================== # Author: Richard Barrett # Organization: Del Valle ISD # Date: […]

Categories
Development

Spring Boot Service Junit Mockito issue

I have written Junit for the service. mocking dao. Service method return type in EmployeeDTO. Dao return type is Employee. problem is employee to employeeDto conversion failed in test case. when(dao.method()).thenReturn(new Employee), so on call od service.method() I am facing issue since dozer is in between to convert employee to employeedto in the actual code. […]

Categories
Development JSON Laravel

Laravel: Unable to JSON encode payload. Error code: 5

I’m working on Laravel (v5.7) app that converts uploaded CSV (with contacts) into array that is then passed as argument when job class is being dispatched. Here is the example of CSV file (format that is supported): 123456,Richard,Smith 654321,John,Doe Uploaded (CSV) file is handled like this: $file_path = $request->file_name->store(‘contacts’); $file = storage_path(‘app/’ . $file_path); $contactsIterator […]

Categories
Development

Why does Spark run 5 jobs for a simple aggregation?

I use Spark in local mode from an IDE/eclipse. I can see Spark UI creating many jobs for a simple aggregation. Why? import org.apache.spark.sql.SparkSession trait SparkSessionWrapper { lazy val spark: SparkSession = { SparkSession .builder() .master(“local[2]”) .appName(“Spark Me”) .getOrCreate() } spark.sparkContext.setLogLevel(“WARN”) } The Spark application is as follows: object RowNumberCalc extends App with SparkSessionWrapper { […]

Categories
Development

Spark Creating REDUNDANT Jobs?

Local Mode Spark App is run from an IDE/eclipse and I see Spark UI creating **So Many Jobs ** for a simple Aggregation. I expect to see 1 Job with 2 stages what is happening here ?!! Is it for the SparkSession Settings ? Code trait => // import org.apache.spark.sql.SparkSession trait SparkSessionWrapper { lazy val […]

Categories
Development

Spark Creating REDUNDANT Jobs?

Local Mode Spark App is run from an IDE/eclipse and I see Spark UI creating **So Many Jobs ** for a simple Aggregation. I expect to see 1 Job with 2 stages what is happening here ?!! Is it for the SparkSession Settings ? Code trait => // import org.apache.spark.sql.SparkSession trait SparkSessionWrapper { lazy val […]