Categories
Mastering Development

How to skip __mock__ folder while running strapi

I am working on writing unit tests for API written in strapi. So I create a mocks folder to mock firebase API call. This code works well when I am running the test with jest but when I run the application with npm run develop it gives me below error Is there any way to […]

Categories
Mastering Development

Alternative to creating views in SQL read only database

I have some longish queries that creates views to simplify the queries a lot but the underlying DB I’m reading from has been changed to read-only. The views, of course, are no longer created, but I am dreading the huge refactor and the way these select statements are going to look without it. Am I […]

Categories
Mastering Development

Magento 2.3.4: How to address repetitive task of generating advanced JS bundling as and when a new extension is added that will bring its own JS files

With the complexity of JS bundling process in Magento in mind, I like to know if there is a way not to repeat the JS re-bundling all over again whenever a new extension on our online store is installed. Magento devdoc is still incomplete with the guidance to even successfully address JS bundling. The entire […]

Categories
Mastering Development

How to mock a https server by pact-python, could you give me a example

I can’t mock a https serve according to API,please give me some advice python version: 3.6.5 pact-python: 1.0 pytest:5.3.5 platform:windows Error message: urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=’localhost’, port=1234): Max retries exceeded with url: / (Caused by SSLError(SSLError(“bad handshake: Error([(‘SSL rou tines’, ‘tls_process_server_certificate’, ‘certificate verify failed’)],)”,),)) process: I try to mock a https server by pact-python so I set […]

Categories
Mastering Development

Which design pattern to use to iterate over request attributes in spring boot

I have a requirement to save the request entity into multiple data sources. My request can have one or more request objects and they should be saved in respective databases. Which design patterns suits the requirement? HTTP Request { “params” : [ { “id”: “AB”, “data”: //some object }, { “id”: “CD”, “data”: //some object […]

Categories
Mastering Development

Using AWK to extracting 2 Fields from each Line in a Data File and Inserting into a External Program

I have a data file which has 3 fields (sample data shown below, file saved as rail_only.txt): 10104,-31.9,115.8 12782,-31.9,115.8 12931,-31.9,115.8 13059,-32.1,116.0 For each line I need to extract the last two fields (which represents the latitude and longitude and use it into an input of some external script (ie ./calculate lat long). I have managed […]

Categories
Mastering Development

ARKit capturedImage and snapshot are not same

I am trying to get an image without 3D models and 3D models at the same time. I use session.currentFrame!.capturedImage and then I take a snapshot using sceneView.snapshot() when both are done. the images look different, how do I get same image twice, one with and without 3D content. preferably in high res. taken on […]

Categories
Mastering Development

How can I create an On-Demand DynamoDB table in C#?

I cannot seem to find an example of creating an On-Demand DynamoDB table in C#. The C# examples on AWS only describes how to create a table with provisioned throughput.

Categories
Mastering Development

To check whether a web element is loaded on a webpage in python selenium

I want to scrape ‘href’ tags from a webpage which includes profile URL of the name searched on the website. Sometimes, it might even give a null result if the profile of a particular doesn’t exist. I am using python selenium wherein I am inputting names from a csv file and sending the keys to […]

Categories
Mastering Development

How to create an array of custom class type, each containing the class?

I would like to implement a matrix class named “Matrice”, using a custom vector class named “Vecteur”, by using a vector “Vecteur” of pointers, and defining each element of the “Vecteur” as a “Vecteur”. test.cpp #include <iostream> #include <cmath> #include “test.h” using namespace std; Vecteur::Vecteur(int m_dim=1) { dim = m_dim; tab= new float [m_dim]; for(int […]