node.js – Make one column dependent on association Sequelize

I have a table called HOUSE. And it has a column named STATUS.

I also have a table called TASK and it also has a column named STATUS.

Each house has many tasks. And if there’s one task that has a status of inProgress, the house status shall be inProgress. And if all of the tasks are done, then house is done.

I want this status column of the house be dependent on the status of its all tasks.

When I call /getHouses, here’s what I do to add a property called status to each house object, because currently I have no STATUS column in the HOUSE table.

exports.getMyHouses = (req, res) => {
  const page = myUtil.parser.tryParseInt(, 0)
  const limit = myUtil.parser.tryParseInt(req.query.limit, 10)

    where: { userId: },
    include: (
        model: db.Task,
        as: "task",
        include: (
            model: db.Photo,
            as: "photos"
        model: db.Address,
        as: "address"
    offset: limit * page,
    limit: limit,
    order: (("id", "ASC")),
    .then(data => {
      let newData = JSON.parse(JSON.stringify(data))
      const houses = newData.rows

      for (let house of houses) {
        house.status = "done"

        const tasks = house.task
        for (let task of tasks) {
          if (task.status == "inProgress") {
            house.status = "inProgress"

      res.json(myUtil.response.paging(newData, page, limit))
    .catch(err => {
      console.log("Error get houses: " + err.message)
        message: "An error has occured while retrieving data."

object oriented – Are inheritance, abstraction and polymorphism regarded as association in OOP?

In the realm of OOP, inheritance, abstraction and polymorphism are basic concepts of the paradigm.

On top of that, there also have the concept called “associations” which I understand is that one object associates (uses) another object. There are also specialized forms of “associations” – aggregation and composition.

What I’m really confused about is that some sites on the Internet (even some university slides) mixing all these terms and sometimes refer “Inheritance”, “Polymorphism”, “Abstraction” as the associations.

So the relationships between objects forming because of “Inheritance”, “Abstraction” and “Polymorphism” are included in the concept of “association” (or at least in terms) ?

2013 – How can I get item’s workflow details/workflow history where workflow association has been deleted?

We have lots of list items where workflow instance is not showing on workflow details page. After researching i found that in sharepoint 2013, completed/suspended/terminated workflow instances will be automatically removed by auto clean up timer job and workflow manager after 30 days.

Due to this we can’t able to get log history/error details of that items. So my question is, Can we get item’s workflow details/history where workflow association has been deleted?

Any help will be appreciated. Thanks

Why association pattern unmatched when using variable

I have association and want to replace integer in specific element in this association. I’m trying to build pattern to be used by ReplaceAll command. When number is explicitly provided in pattern match occurs, but when I put number in a variable and provide number from variable match fails.

In[1]:= MatchQ[<|id -> 6, dur -> 10, skill -> 1, succ -> {7}, 
  dl -> 250|>, <|la___, succ -> {l___, 7, r___}, ra___|>]

Out[1]= True

In[2]:= last = 7

Out[2]= 7

Out[3]= Integer

In[4]:= MatchQ[<|id -> 6, dur -> 10, skill -> 1, succ -> {7}, 
  dl -> 250|>, <|la___, succ -> {l___, last, r___}, ra___|>]

Out[4]= False

As shown in this example first match occurs, but second fails with number in variable.

api design – Controller responsibility to support methods with association

We are designing an API with multiple controllers and having discussion on where should we put one of the functionality and which controller should take responsibility to hold that. Will try to explain our use case by taking the example of Flight, Schedules, and Pilots. (consider all are having dedicated Controller and Service)

Flight will have multiple Schedules and each schedule have pilots. We have a method in Schedule controller which is returning schedule details along with pilots.
What if we need a method to get all the schedules of pilot. Does it makes sense to keep this in Pilot Controller and invoke ScheduleService from there? Are we deviating from principles?

Appending an Association to a List of Associations

I like working with Associations and use them quite often because it keeps things tidy but haven’t found any questions on here covering this exact situation I’m having trouble with. I have data that will be streamed into a list for later graphing/visualization but I can’t figure out a way to Append the list. I’ve tried various combinations of Join and brackets too. Some sample code is below. Is there a better way to do this?

listOfAssoccations = {};

makeassociation := Module[{var},
  var = RandomInteger[10, {4}];
  AssociationThread[{"A", "B", "C", "D"}, var]

Do[Append[listOfAssoccations, makeassociation], 5]

I’m expecting:

{<|"A" -> 7, "B" -> 8, "C" -> 1, "D" -> 1|>, <|"A" -> 10, "B" -> 7, 
  "C" -> 0, "D" -> 7|>, <|"A" -> 0, "B" -> 4, "C" -> 9, 
  "D" -> 10|>, <|"A" -> 0, "B" -> 3, "C" -> 7, "D" -> 2|>, <|"A" -> 6,
   "B" -> 2, "C" -> 8, "D" -> 0|>}

database theory – Association Tables

I can use an association (or ‘linking’) table to model a many-to-many relationship, eg Student -> Enrolment <-Course, where an enrolment describes an essential relationship between students and courses.

I can also have Course -> Department and Course -> Language, where language and department are both attributes of a course, but there’s no special relationship between them.

These two scenarios look similar, but I wouldn’t call Course an association table… is there another name for it? Is there a logical way to distinguish between the two cases?

amazon web services – Use single network inerface on AWS Client VPN association

I’ve configured a Client VPN with the purpose of routing all the traffic from multiple external hosts through a static IP address that can then be whitelisted. To accomplish this I’ve run the standard setup from the AWS guides and also allocated an elastic IP address which I allocate to the network interface used by the ClientVPN Endpoint. This worked fine.

On Friday I found that there was at least another network interface created for this VPN association,(same associacion, multiple network interfaces) which I removed in order to prevent the external IP address to be randomly using it. This morning there seems to be 2 extra network interfaces, in addition to the one that I’m using with the elastic IP. I’ve read through the documentation but didn’t find a requirement to have multiple network interfaces or some sort of configuration to prevent it.

Has anyone faced the same problem or know what could be the issue?


List manipulation – The fastest way to change the values ​​of an association

I have an association of the following form:

assoc = Association(a -> {1, 2, 3}, b -> {5, 6, 7})

<|a -> {1, 2, 3}, b -> {5, 6, 7}|>

(The size of the actual lists in Assoc is 30).

If I want to change the value of the list associated with a as follows: assoc(a)((1)) = 2, it doesn't work. I understand why I looked it up most of the time (some change matters e_e)!

While browsing the forum, I found nothing better than:


I have two questions :

Between the change in place the value of a very large list (very) or changing the value of a very large association as shown above, which is faster?

Second, there is a better way to change the value of items in the list associated with the key a in assoc, i.e. without the copying process.

Thanks a lot.