## From a pool of n questions generate as many quizzes as possible

From a pool of n questions generate as many quizzes as possible Each question contain questionId,difficulty level and tag.

conditions:

• questionId in 1 to n and unique
• question tag in(tag1,tag2,tag3,tag4,tag5,tag6)
• difficulty level in(easy,medium,hard)
• 300<=n<= 1000
• A question can be used only once in any quiz

CRITERIA TO GENERATE A QUIZ

• minimum 1 question from each tag

• minimum 2 question from each difficulty level

• 10 question per quiz.

Input

• a Single line containing n
• next n lines containing 1 question description each(as shown below)
• questionId difficulty_level tag

Output

• no of quizzes possible

## How to generate trusted SSL certificate for secure MQTT?

I am a beginner with information security and everything about SSL just goes over my head.

Currently I’m trying to get an IoT device(ESP32) to connect to an MQTT broker, broker.losant.com:8883 in my case, over TLS. The device has been flashed with Mongoose OS which relies on mbedTLS library to secure MQTT.

The issue which I face is that mbedTL says that “The certificate is not correctly signed by the trusted CA” when I use a self signed certificate. Where can I get this trusted certificate or how am I supposed to generate it? I’ve been digging the internet for quite some time now but sadly, nothing is present in the Mongoose-OS docs.

Please tell me the steps I need to follow to get my secure MQTT connection up and running.

## How would you generate files with several different rules?

Okay, the title is kind of cryptic because I’m lacking terminology (part of the problem).

## Situation

Let’s say you want to generate data corresponding to one specific, standardized paper document. But you have millions of people filling out this document, some of them are lying — but there’s several different ways (possibly hundreds) of lying, and many of the document’s fields are interdependent. I want to generate all these types of lies via some randomized distribution.

Additionally, with respect to this form, it’s impossible to go through each field of the form in a sequential order and capture the nuance and inter-dependency of the data/lie relationship. Instead, you could (the path I see) opt for a method where each type of fraudulent form has hard and fast rules for its generation — logic and static values contained in some config file — and then just boil it down to copy and pasting the function into function_1, function_2 etc, which are almost identical besides the small changes which capture the characteristic of whatever lie they correspond to.

But then it’s sort of ridiculous to write a function for each of those “lie rules”, even if you’re almost copy-pasting. But I’ve never encountered a situation where there’s so many and unique cases (some with large differences and logic) for creating the same piece of data. Is there well-known approach/name to this problem? Or does anybody have any suggestions?

At Daani we have a different department which is totally devoted to the advancement of the latest affiliates marketing ideas for affiliate software.

Increase your Affiliate Marketing business and revenue by 400% with our affiliate software. Raise your business website traffic, network belts, and sales. Our marketing tools enable you the power to grow your network in almost no time.

## Generate triangular surface mesh of convex hull spanned by 8 points in 3D-Space

I am looking for a numerically efficient algorithm to get a triangular surface mesh of the convex hull given by 8 points in three-dimensional space.

For context, the use case is the following:

I have a numerical Simulation calculating the time evolution of a field with three components on a lattice. Say we have lattice coordinates $$(i,j,k)$$, then every lattice point $$(i,j,k)$$ has a field vector $$(\phi_1, \phi_2 , \phi_3)$$ attached.

For relevant physics, I need to now take unit cells on my lattice, so the 8 corners of a little cube of my lattice. I take the field vectors $$(\phi_1, \phi_2 , \phi_3)$$ of every corner of my unit cell and then interpret their convex hull as a closed volume in $$\phi$$-space, with $$\phi$$-space being the 3D space given by the $$(\phi_1,\phi_2,\phi_3)$$ coordinates.

I am now interested if the volume spanned by these 8 points in $$\phi$$-space does the following things:

1. If it contains the origin, $$(0 ,0 ,0 )$$

2. If a Ray traveling from the origin in $$(-1,0,0)$$-direction pierces my given volume

The idea to evaluate both 1.) and 2.) at the same time is to decompose the surface of the convex hull into triangles. For a triangle in 3-Dimensional space, it is easy to evaluate whether it is pierced by my given Ray in $$(-1,0,0)$$ direction. I can then count how many triangles are pierced. If exactly two triangles are pierced (because of convexity), I know the cell satisfies condition 2.). If exactly one triangle is pierced, I know the origin has to lie inside my volume, that is condition 1.) is satisfied. Lastly, when no triangles are pierced, none of the above apply.

I think this approach is probably relatively fast. Speed is critical, because I have approximately $$10^6 … 10^9$$ cells to evaluate per sweep across my lattice.

I’d be interested in any other approaches as well, though.

Update: So, I think possibly a 3D-Gift-Wrapping algorithm would atleast produce the required result, because it creates the convex hull by consecutively finding triangles on the surface? I will have to try that out tomorrow.

Can I do better than that in terms of efficiency?

## Generate random matrix and its inverse

I want to randomly generate a pair of invertible matrices $$A,B$$ that are inverses of each other. In other words, I want to sample uniformly at random from the set of pairs $$A,B$$ of matrices such that $$AB=BA=\text{Id}$$.

Is there an efficient way to do this? Can we do it with expected running time approaching $$O(n^2)$$?

Assume we are working with $$n\times n$$ boolean matrices (all entries 0 or 1, arithmetic done modulo 2). I am fine with an approximate algorithm (say, it samples from a distribution exponentially close to the desired distribution). My motivation is solely curiousity; I have no practical application in mind.

The obvious approach is to generate a random invertible matrix $$A$$, compute its inverse, and set $$A=B^{-1}$$. This has running time $$O(n^\omega)$$, where $$\omega$$ is the matrix multiplication constant — something in the vicinity of $$O(n^3)$$ in practice. Can we do better?

An approach that occurred to me is to choose a set $$T$$ of simple linear transformations on matrices such that, for each $$t \in T$$, we can apply the modifications $$M \mapsto tM$$ and $$M \mapsto Mt^{-1}$$ in $$O(1)$$ time. Then, we could set $$A_0=B_0=\text{Id}$$, and in step $$i$$, sample a random $$t$$ from $$T$$, set $$A_{i+1}=tA_i$$ and $$B_{i+1}=B_it^{-1}$$, and repeat for some number of steps (say $$O(n^2 \log n)$$ iterations). However I’m not sure how we would prove how quickly this approaches the desired distribution.

## Generate aerial image based on images taken on ground

I am trying to reconstruct aerial(top view) image of small area with photos taken by mobile device. Such as part of a street or other flat scenes. I want to use 3D reconstruction tools to process images then map the result to top view. How do I avoid error from highly dynamic environment (cars, people)? Or is there any other ways to do this?

## Is there a way to cycle through levels of a filter and generate outputs in R?

I am trying to generate report card outputs using R, but have over 200 agents (levels in my factor) that require their own report (tibble output that I can write to .csv or html).

I have included a reproducible example below.

library(tidyverse) Agents <- c("A", "B", "C") Month <- c("May", "June", "July") Score1 <- c(5,7,1) Score2 <- c(7,8,3)  df <- cbind(Agents, Month, Score1, Score2) df2 <- as.data.frame(df)  df2$Score1 <- as.numeric(as.character(df2$  Score1)) df2$Score2 <- as.numeric(as.character(df2$  Score2))  Report <- df2 %>%             group_by(Month) %>%            summarise(Skill = mean(Score1), Attitude = mean(Score2)) 

I would like to loop through my agents, using each as a filter on the Report, and then save it as Report_agentname. I took a look at purr but can’t quite get my head around the map function and my needs here.

## Generate thumbnails after csv import (Magento 2.3.1)

I imported a csv with only base_image. If I check the products after reindex and cache flush, I can see my products photos in frontend, but not in list/grid (they only show default “M” image).

Then I tried with

bin/magento catalog:image:resize as well as bin/magento setup:static-content:deploy -f

I can see images in pub/media/catalog/product but they are not being called.

Any ideas on how to generate / link properly?