MariaDB views: I want to replace repeated multi-table joins in my queries with a view – are there any issues to watch out for?

Rather than

SELECT a.pk, b.pk, c.pk, d.name  FROM a JOIN b on b.pk = a.fk JOIN c on c.pk = b.fk JOIN d on d.pk = c.fk 

I can do

SELECT a_pk, b_pk, c_pk, d_name  FROM view_a_b_c_d 

I have a lot of this sort of thing through my code.

I’ve done a performance test, and the differences seem to be negligible, and I feel it would greatly tidy my codebase up and remove a lot of repetition.

But before I commit to that (as it’d be a big change with a lot of work and testing), I want to check that this IS a good thing to do. I didn’t study computer science and have no formal DBA training. I’m also a sole dev working on my own closed-source product. So I don’t get much input from the outside world, unless I strike out and ask for it.

Thank you – any opinions/experience appreciated.

How to avoid creating repeated links on the same site?

Hello guys! In a new campaign with the help of a premium list, I am getting repeated links, for example now GSA SER has just created 3 links from the same country and from the same site, on the wordpress articles platform.
– The links were created at different times.
However, they are the same links because they are on the same website.
– The content is different.
– The links / anchors are different.
Could you help me see if something in the configuration generates this problem.

List of tuples without duplicates & repeated values

Given some number nand set of values vals, I want to obtain all the tuples/permutations of size n for the values in vals, but without any repeated tuples. So e.g. n=2 and vals={3,6} should give

 n = 2, vals = {0,1}   --> { {0,0}, {0,1}, {1,1} }  n = 2, vals = {0,1,2} --> { {0,0}, {0,1}, {0,2}, {1,1}, {1,2}, {2,2} }  n = 3, vals = {0,1}   --> { {0,0,0}, {0,0,1}, {0,1,1}, {1,1,1} }  n = 3, vals = {0,1,2} --> { {0,0,0}, {0,0,1}, {0,0,2}, {0,1,1}, {0,1,2}, {0,2,2}, {1,1,1}, {1,1,2}, {1,2,2}, {2,2,2} } 

I’ve tried the following commands:

 n    = 2;  vals = {0, 1};  Tuples[vals, {n}]        (* gives { {0, 0}, {0, 1}, {1, 0}, {1, 1} } *)  Permutations[vals, {n}]  (* gives { {0, 1}, {1, 0} } *)  Subsets[vals, {n}]       (* gives { {0, 1} } *) 

Permutations and Subsets are incomplete. Tuples contains all the right combinations, but also contains duplicates like {0, 1} and {1, 0}. Since I do not care about order, I’d like to remove those.

How do I achieve the behavior of Tuples, but without duplicates?

Repeated microsoft password reset requests


Background

Since the middle of last month, I have started recieving multiple microsoft password reset e-mails a day, sent to my secondary e-mail address, regarding my primary e-mail address.

These e-mails have no phishing-like links in. I believe them to be a legiitimate password reset e-mails. Which means someone is repeatedly trying to reset my password.

There appear to be no (recognizable) attempts to break into my secondary e-mail account.

Both accounts have 2FA enabled, and have randomly generated 30+ character passwords generated by and stored in a password manager. The primary account has enforced 72-day password changes enabled.

Questions

1.) Is it likely the attacks are just trying to guess the 7 digit security code each time. Or is something more sinsiter likely going on?

2.) In cases like this, is it any way to say that, no, I did NOT request such a reset. (Note: I’m wary that it is possible that only someone working at Microsoft might be able to answer this. If this IS the case, please ignore this part of the question)

How can i find the binary tree search given strings with 3 letters and out of which some are repeated?

The question: A list with 12 elements is given as the following: (Ari, Tau, Gem, Cnc, Leo, Vir, Lib, Sco, Sgr, Cap, Aqr, Psc). Find a sequence of the elements such that using that sequence to insert the elements to generate a binary search tree according to the alphabetical order of the elements, the resultant binary search tree will also be a complete binary tree. Draw the resultant binary search.

I’m quite new to data structure and I have been struggling with making binary tree search with strings. I am given strings such as Ari, Tau, Gem, Cnc, Leo, Vir, Lib, Sco, Sgr, Cap, Aqr, Psc. To make the binary tree do I number the letters like since there are two a’s I’ll ignore that and go to the next letter so I’ll go to ‘r’ and ‘q’, which means ‘r’ would be 18 and ‘q’ would be 17. For Tau it would be 20 since there are two c’s I’ll ignore the c and pick ‘n’ from Cnc and ‘a’ from Cap.

Could someone help me clear the concept please?

What is the most unique data identifier for a phone user that cannot be repeated?

I’m currently developing an android (and probably iOS in the future) application for my company.

I was wondering what is the most unique data identifier to authenticate the users. A data that cannot be repeated through users.

For example:

Email? That user can log in with another phone using the email and password

Phone number? Could be the most unique one but it would required to verify the phone and I will have to setup a SMS validation service like WhatsApp

IMEI? It pretty much validates the unique phone but it can be spoofed or replaced. Although I don’t know if the application required permissions for this.

EDIT: Maybe a mix of all this methods?

My main goal is to save this data as a database and make it the primary key of it and with this know exactly who’s the user that it’s really using the company web services.

I hope you guys can help me.

Thank you.

How is repeated use of Illusory Reality limited?

I’m planning on creating an advanced Illusionist for a high level campaign. When reading through the rules for said school of wizardry, I came across this:

When you cast an illusion spell of 1st level or higher, you can choose one inanimate, nonmagical object that is part of the illusion and make that object real. You can do this on your turn as a bonus action while the spell is ongoing. The object remains real for 1 minute.

This seems ridiculously overpowered, even for a level 14+ character, given that one can combine it with the action of Minor Illusion, a cantrip, so the uses are near infinite. Is there a limit on the number of times this can be done?

For example, if a ceiling were falling, couldn’t I just cast and recast all sorts of barriers and objects to stop its descent?

Can the spells combine, or is there an unexpected consequence or something entirely different? If there isn’t, this campaign will be a breeze, which won’t be nice for a one-shot (you can’t keep treasure, so it has to be about the journey, not the reward).

How to prove a recursive’s function Big-Theta without using repeated substitution, master theorem, or having the closed form?

I have a function defined: $ V(j, k)$ where $ j, k \in \mathbb{N}$ and $ t > 0 \in \mathbb{N}$ and $ 1 \leq q \leq j – 1$ . Note $ \mathbb{N}$ includes $ 0$ .

$ V(j, k) = \begin{cases} tj & k \leq 2 \ tk & j \leq 2 \ tjk + V(q, k/2) + T(j – q, k/2) & j, k > 2\end{cases}$

I am not allowed to use repeated substitution and supposed to prove it by induction. I can’t seem to use the master theorem because the recursive part is not in that form. Any ideas on how I can solve it with the given restrictions?

If I start with induction: I fix $ j, q$ and induct on $ k$ . Then the base case is $ k = 0$ . Then $ V(j, 0) = tj$ . The question hinted that the function can be $ \Theta(jk)$ or maybe $ \Theta(j^2k^2)$ (but it doesn’t necessarily have to be one of the two).

I choose $ \Theta(j, k)$ . In the base case, this would mean I would have to prove that $ tj = \Theta(j, k)$ when $ j = 0$ . However, when I start with the Big-Oh, I would have to show that $ km \leq mn = m\cdot0 = 0$ which right now I see not to be possible.

I am not sure if I did the base case wrong or if there is another approach to this.

Repeated unnecessary password prompts

My Ubuntu 18.04 desktop keeps throwing up password prompts which are clearly unnecessary, since I can just Cancel them and continue working without trouble. This happens immediately after I login and continues sporadically throughout my session, whenever I start Chrome or Remmina or several other applications.

Following the advice here I can temporarily stop this happening by removing or renaming .Xauthority and logging out and in again, but that’s a hassle and I’d like to automate it somehow.

Any ideas or other helpful comments?

Repeat elements in list, but the number of times each element is repeated is provided by a separate list

I’m trying to repeat each element of a list x number of times, where x is the corresponding element of the same position in another list.

For example, I have list A = {1,2,3,4} and another list B = {3,1,4,2} and I’m trying to get C = {1,1,1,2,3,3,3,3,4,4}.

How do I get C from A and B?

Thanks.