Design of the first NoSQL database (MongoDB). I have questions about a simple example

I have many years of experience with RDBMS. I am relatively new to NoSQL. And in the current project I am doing, I have to use MongoDB (as suggested by my client).

In this there are tens of thousands of students and hundreds of exams. I will receive information about students and exams in JSON format. So I plan to have these two collections in MongoDB:

  1. Exams:

Each document in this collection will have information about each exam. Together with all other fields related to exams, the document will have a field ExaminationName That could be referred to in other collections.

  1. Students:

In this collection we will store information for all students. There will be one document per student. Together with all other fields in the document, you will have ExaminationName (Blank if there is no associated exam) as a mandatory field in this collection. Therefore, each student is associated with one or no exam.

The questions are:

  1. Is this design approach correct? If the name of the exam is given, can I get a collection of those students associated with the exam? (that is, search for documents by one of the values ​​in the Student collection)

  2. One suggestion I received is that I do not need to worry about duplication of data in NoSQL and in the collection of Exams, I must store the information of the associated students (and it will also be there in the Students). In this way, it is quick to obtain information from students associated with a particular exam. However, I thought that if I needed to change the information of a particular student (for example, the student's name), I will have to make those changes in two places. Is there any solution that MongoDB provides to avoid this? (when they say Duplicate the data (but limited) because disk space is cheap compared to the calculation time)

Earn 100 BMF points: simple task

Earn 100 BMF points just by joining a group of telegrams and completing 1-2 easy social networking tasks (twitter) through my REFERENCE LINK !!

STEPS –

1) Go to this link below and start the telegram bot

2) Once started, the bot will ask for a simple verification captcha, complete it to prove that it is human.

3) Complete all the tasks specified by the bot (joining the telegram group, channel, main channel, following Twitter …

Earn 100 BMF points: simple task

In clojure, how to structure a simple inverse file search function to make the unit verifiable

I have the following pair of functions used to search upwards For a configuration file:

(defn has-config? (path)
  contains? (set (.list path)) "my-config")

(defn find-config-path (path)
  (cond
    (has-config? path) path
    (= "/" path) (throw (Exception. "File not found"))
    :else (recur(.getParentFile path))))

Here the argument road is a return value of clojure.java.io/file

To make the unit testable, it would generally separate the side effects, in this case of I / O, from the logic. Following this approach, the last function would receive the contents of the directory instead of generating them within.

My problem is in the recursion call, which must pass the contents of the main directory. To do this, I / O is necessary and I can't seem to find a good way to decouple this from logic. Is this the right approach or am I missing something obvious here?

Simple method for beginners to benefit from the Binance Bitmex cryptocurrency trade 2019 – Advertising, offers

Visit the community for Free Crypto Signal, Bitcoin Bot, Bitmex Leverage Trade and Gdax Trading – https://t.me/freebitmexsignals

8cUqAu3.jpg? one KjCL4DQ.jpg? one

The Bitmex bonus signal n. 72 was published in the Bitmex Premium group. Again, it has reached the profit target.

These are outstanding signals that are known as Bonus Bitmex Signals. These are ONLY sent to Premium Members.

The accuracy of these signals is excellent and a large number of Bitmex merchants follow them.

Crypto Trading is growing, you must be with the right group to get the maximum benefit through it. We offer support in Bitmex, commercial leverage, Bitmex Dynamic bot, guaranteed daily earnings signals and many more.

.

Theory of complexity: algorithm to find a simple route with a maximum weight less than a constant in DAG

Given a weighted directed acyclic graph $ G = (V, E, W) $, where the weights are at the vertices. I am looking for a simple route of maximum total weight, but this total weight should not exceed a given constant $ K $.

Maybe my question is elementary, but I can't find any solution. In fact, it is well known that finding a simple path with maximum weight in $ G $ It is polynomial, but by adding the fact that this total weight should not exceed a given constant $ K $Will the problem remain polynomial? because we need to maintain in each node the set of route lengths that can reach the next vertices.

What is the graphic model for this simple generative model?

Let's say I have an exponential distribution, a sample that comes out of it, let's say $ x $, this sample determines the mean for a normal distribution. That's.

How can I express this?
I know about nodes, shaded nodes, bold dots and plates. I still don't know how to repress this idea.

postgresql – The simple "SELECT" query takes too much time

I am trying to execute a SELECT query in our postgreSQL database using pgadmin3. Does it look like this:

SELECT
    tstamp AS "time"
    dvalue AS "Weight"
  FROM tablename
  WHERE
    tstamp BETWEEN 'time1' AND 'time2' AND description = "exp_weight"
  ORDER BY 1

Our database tracks metrics for much more than just weight, so we have approximately 30 million rows to analyze to find all "exp_weight" rows. When I run this, it takes about a minute and a half to add all the data. Any idea how I can speed this up?

Algorithms – Temporary complexity of simple functions related to bits

I wonder about Right Answer this task from a test yesterday:

A function Pow that calculates $ y = a ^ k $ it occurs where $ k $ is a
integer length $ n $ bits:

function Pow(a, k)     { k >= 0 }
    z := a;
    y := 1;
    m := k;
    while m != 0 do
        if m mod 2 = 1 then
            y := y * z;
        end if
        m := m div 2;
        z := z * z;
    end while
    return y;
end function

Calculate the complexity of the weather in the worst case and the average time
complexity of this function. The dominant operation is a comparison
operation performed on line 6. Briefly describe the value of $ k $ when
The worst case occurs.

So, I think the number of comparisons depends on the length of $ k $ in terms of its bits.

Leave $ k = 0 $: (binary $ 0 $ also what is $ 1 $ little bit):

$ Rightarrow 0 $ comparisons

Leave $ k = 1 $: (binary $ 1 $ also what is $ 1 $ little bit):

$ Rightarrow 1 $ comparison

Leave $ k = 8 $: (binary $ 1000 $ which $ 4 $ bits)

$ Rightarrow 4 $ comparisons

Leave $ k = $ 15: (binary $ 1111 $ which $ 4 $ bits)

$ Rightarrow 4 $ comparisons

Leave $ k = $ 16: (binary $ 10,000 which $ 5 $ bits)

$ Rightarrow 5 $ comparisons

I think you can see a pattern.


Any set number 2 h, 2 ^ h + 1, cdots, 2 ^ h + 1} – 2, 2 h + 1} – 1 } quad land quad h> 0 $ $, is $ h + $ 1 long pieces and therefore $ h + $ 1 comparison.


Then i think $ T_ {avg} (n) = T_ {worse} (n) = n in O (n) $

But $ n $ is the number of bits of $ k $ number. Take function $ k $ as a parameter, no $ n $. So, my solution is not the desired one, I think.


In terms of $ k $ I think it would look like this:

$ T_ {worse} (k) = lfloor log_ {2} (2k) rfloor in O ( log k) $

$ T_ {avg} (k) = lfloor log_ {2} (2k) rfloor in O ( log k) $


Questions:

  1. It is the solution in terms of $ k $ Right?
  2. The solution in terms of $ n $: How would you rate that, personally? Know the task description of the above.

I have published a similar thread in the mathematical stack exchange, but I would like to get more opinions on this from the CS experts themselves.

EasyEngine v4 Nginx Reverse Proxy: Please give a simple work example

The EasyEngine v4 gives me difficulties with the reverse proxy.

Can you give an example of a simple reverse proxy:

Let's say the domain is test.com and I want the subfolder wiki to be proxy to wikipedia.com (https://test.com/wiki).

How to do it? (It should be easy but it doesn't work in EE v4 because it uses docker).

P.S (if you can): if you can also give an example of how to reverse the proxy to localhost (https://test.com/mylocal to: https: // localhot: 5984)

Detect positions and rotations of simple objects with Deep Learning [on hold]

How can I detect these objects? object to detect
at
image containing objects
with deep learning

in a classical way, we have done it and it works but I want to do it with deep learning
no problem with training data