How to decide max-width in XD?

I have seen old questions about this subject but they are quite old. I guess things change so that is why I ask this. I want to be updated.

I am about to design a web page mockup in Adobe XD. I will only design in XD – coders will then transform my designs into a webpage. I don’t have any data of the users since it is a new project.

The page will be responsive of course. I don’t want it to be full-width design but rather a fixed width webpage with different breakpoints all the way from large monitors all the way down to smartphones.

I am trying to find where these breakpoints should be. I want to start designing the maximum width page and then move my way down when it comes to size.

However, what should the max-width be for people with 4k screens? It is so confusing because of different scalings and different monitors. Where should the breakpoints be? I have seen that Google’s recommends breakpoints but it is all in dp instead of px. AdobeXD does not work with dp. I just wish someone could tell me what breakpoints to use in XD so that I can start designing.

Any tips would be greatly appreciated!

What pattern lets each of multiple “voters” decide on a central status?

Imagine there’s a boolean status variable that is either running or stopped.

This variable is running by default and comes together with a deactivator function.

When a client calls the deactivator function, the status changes to stopped.

Calling the deactivator function returns a cancel function, which, when called, reverts the status back to running again.

If multiple clients call the deactivator function, each receives a separate cancel function. As soon as the first client calls the deactivator, the status is stopped and remains so until the last caller to deactivate has called its cancel function.

In other words, every caller can trigger a stopped, and only when no-one is voting stopped, it is running.

What is the name of that pattern?

Update: while I can implement this, I believe it has been done numerous times in the language I use (nodejs), that’s why I’m looking for the name.

Update 2: I’ve implemented this in the meantime, but still looking for a name!

Survey System DDD Design – If I decide to remove a Question from a Section how do I ensure that any Answer associated with a Question gets removed?

I’m currently working on doing a re-design of a legacy survey system and trying to implement DDD principles. I’ve included a simple diagram to layout the current design choices I’ve made.

enter image description here

This is very much like a tree structure because:

  • Each Survey can have multiple Sections.
  • Each Section can have multiple Questions.
  • Each Question can have multiple Answers.

At first, I thought about creating one big aggregate root with multiple nested entities but I realized that It doesn’t scale well if I have multiple sections, with multiple questions and answers.

So I decided to split them up into seperate aggregate roots where they would now hold only an id reference to other roots.

The question I have here is if I decide to remove a Question from a Section how do I ensure that any Answer associated with a Question gets removed. I thought about creating an event called QuestionRemoved and having a handler handle this event. It would get the QuestionId and remove all the answers that had that Id.

What if I remove a Survey and want to ensure that everything that’s associated get’s removed. Do I then create multiple events like SurveyRemoved, SectionRemoved, etc.?

Is this the right way to do it? Do you have any suggestions?

Given graph with some unknown weights decide for every edge if in the MST .

I got this question : Given G graph with some unknown weights ,decide for every edge if its in MST , not in MST or we dont have enough information to decide.

I know that are few terms to decide for ever edge :

1.If the edge is the heaviest in a circle so it is not in the MST.

2.If the edge is the minimun in a cut so it is in the MST.

I tried to use prim algorithm and to use those terms but my problem if that i dont know which edge to choose in every step if there is an unknown wheighted edge in the cut.


How to decide on which bluetooth device I want to recieve incoming call?

Sounds easy, but not so. My workplace is my car and I go in and out all day. So, I connect my iPhone for handsfree communication via the radio AND a bluetooth in-ear-device. When inside and driving I call and answer calls by radio, when outside (and close to!!) the car I answer by ear. BUT what happens is that the moment the call is connected, the radio takes over and I need to open the phone and toggle back to my ear device. Every time, incoming or outgoing. And it drives me crazy when I have my hands full. Does anyone know how to control this?

What can I consider to help me decide whether the refactoring process of legacy code towards using modern OOP framework principles is worth it? [on hold]

I am refactoring old legacy code as part of my job. My chosen framework is Zend Expressive that runs on PHP, where I am using Zend Expressive Skeleton app (app provided by the maintainers) as a guideline. Zend Expressive among other coding constructs uses config, factories, handlers, view templates. I am then free to provide my own architecture, where I use repository and service layers.

In my case, what I mean by legacy code, is code with it’s own framework of sorts that in comparison to Zend Expressive mixes the following concepts into one file:

  • service creation
  • factories creation
  • request handler creation
  • repository calls in a form of global functions, which call the database
  • view templates, aka html/js/css is in the same file


What I do is a transformation of that described one file into the separate concepts (as ones above). This creates lots of separate files. It’s a sort of surgery-like extraction, where it takes time, and work and cognitive work – understanding how to name each file/class/object, how they are to connect, wire them up together and fix up any bugs that are created either due to incorrect extraction or due to the upgrades to the layer. i.e. I usually use new database layer that returns typed data rather than just strings. Some methods need to be updated to accept typed data that is not always a string.

I am trying to figure otu if doing so is “worth it”, since such transformation takes time, while functionality of the software effectively remains the same.


What factors can I consider when making a decision on whether such transformation (refactoring process) is worth doing?

Alternative to refactoring is to keep this legacy code as-is, and make changes to it without disturbing its original cohesive one-file structure.

Can you decide to counterspell after another counterspell has failed?

Imagine the following situation: Bobby and Tommy, 2 characters with the Counterspell spell prepared, face against Freddy, an evil priest (who does not have Counterspell). Freddy casts a high level spell. Bobby attempts to counterspell it (and must roll to do so) and Tommy does not react, believing that Bobby will be successful in his roll. But Bobby rolls too low and his Counterspell fails. At that moment, Tommy wants to attempt a Counterspell himself, after seeing his friend fail.

Considering that the reaction must be taken precisely when the spell is cast, is it possible for Tommy to actually wait for another Counterspell to fail before attempting his own Counterspell ?