Assign n people to m rooms of different sizes, such that noone is alone and people are in largest rooms possible

I’m looking for an efficient way to assign n people to m rooms in a very specific way.


The program receives two sets of people (set of males and set of females), as well as a set of available rooms (rooms can have different sizes, ranging from 2 to 6).


The algorithm must assign people to the rooms in a way, that:

  • Males can be in a room with only males (same for females)
  • Noone can be alone
  • The algorithm must maximize groups (one room of 4 is preferred over 2 rooms of 2, etc)


The algorithm must return the assignment

I’ve tried to do it, but all of the sollutions I come up with are at least O(n^3). Does anyone know an efficient way to do this?

Base64 decode/encode results are different

This is a base64 encoded weblink I have:


I run it in a decoder ( and I get this:


The site warns me that: It seems that the result of decoding is a binary data (MIME type detected as “application/octet-stream”) and because of this the data from “Text” may be damaged during the output. To get the original data, click “Download” next to this field.

Then I download the file, and open it up in Notepad++, and there is a null field between every single visible character. I’m not sure what that means. I don’t alter the file in any way, reupload it to, and I get a different base64 encoding:


I see the very end highlighted in bold is different. The rest is the same. Why would this happen if I just decode and then encode the exact same thing with no modifications? I’m not very familiar with computer science so this is something I’m very curious about (for example I have no idea what the “null” even means).


different types of machine learning, what is the difference?

I’m currently working as computer science developer. I created few projects that are using neural networks, but I just can’t get sense of terminology in this science.

Can somebody please help me understand the basic difference between machine learning and deep machine learning or artificial neural networks and deep neural network. I have read definition, but still I have trouble understanding difference.

For example, random forest alogrithm is part of machine learning, or deep machine learning?

And neural network with 7 linear layers, 2 convolutional layers, and dropout is a deep or artificial neural network?

Or what exacly term “artificial inteligence” refers to? etc.

Which version of A/B do i show if you happen to get different versions in two instances?

Let’s say I’m doing A/B testing, and this one particular user gets randomly assigned into group B for example. I have a choice right away to either store that on their account in my database, or on their browser. Then tomorrow, that same person visits the website from another device, and randomly gets group A assigned, and sees the A-version of the website. And then, from this new device where they were viewing version A so far, they now sign into their account.

Would it be correct to now load everything B, which has potentially been stored on their account? Or would it be correct to persist the current visit, and keep showing A in this local browser? Or, go so far with persisting the new visit to actually store this new version A onto their account for any further page renders from their first device.

This is all assuming that the different versions of the site differ visually, and significantly, so, what the user expects is therefore quite important.

Can two Cloud of Daggers be cast in the same area by different spell casters?

Quick overview of the situation, the party is 3rd level and the warlock and the bard can now both cast cloud of daggers. We were in a lizardfolk den and they saw us and came running down a 5-foot corridor. The bard was first in initiative and threw out the cloud of daggers right on them. The warlock went next and wanted to do the same. Is there any ruling against this? The lizardfolk were next and would take the 4d4 from the bard at the start of their turn. Would they also take the warlock’s 4d4 (A grand total of 8d4), or do these effects need to be staggered?

Different ways to rotate an object. Which is best?

I’m a developer on the long way to learn design so please forgive me if I’m not into design jargon 🙏.

I have to design an interface to rotate a 2D object. The rotation is discrete by fixed step: the object can be rotated by 0°, 45°, 90°, …, 180° degrees (in this example the step is 45° but it can be parametrised by configuration).

I have few ideas, and I’d like to discuss which could be the best one.

Standard slider:

enter image description here

Standard slider are everywhere, easy to implement, easy to use. There a slider over the object and my moving it the user can control the rotation of the object.

Circular arc slider handle

enter image description here

There is the object surrounded by a circular arc slider with an handle that the user can drag to rotate.

I think that the circular shape of the slider can be functional to advice the purpose of the slider (a rotation), but I think that moving by fixed step can be not so intuitive both in the implementation and the use.

What can be the best one? Any considerations/ideas/advice? Is there some other ways to do it? Maybe simpler ways?

is there any way to use Label and Goto in different loops?

What are the conditions for using Label and Goto commands? In writing an algorithm I have to return to a point several times and in a different steps (and different loops), when I run the code I get

Goto::nolabel: Label start not found. Hold[Goto[start]] 

Unfortunately there is no enough information about these commands in help. So can anyone help me to use them correctly or provide me an alternative?

IKEv2 Using Different PSKs

We’re setting up some new tunnels and have been told to use IKEv2. I understand that IKEv2 allows different authentication methods, e.g. one side using PSK and the other using a certificate. We don’t have a PKI so it’ll have to be PSK for now.

I can see it’s possible to use the same PSK (like IKEv1) or different PSKs on either end such that:

  • Device1: local psk = Key1, remote psk = Key2
  • Device2: local psk = Key2, remote psk = Key1

So Q1: does this actually add any extra security? I guess not since both sides need to know both keys somebody getting access to Device1, say, could discover Key1 and Key2 anyway.

Just trying to figure out the point of using two different ones? Are both PSKs are used to set up a connection and both must be right? Or is only the initiator’s OR responder’s PSK used?

I guess we will just configure them all the same but the question came up and I had no idea what the answer was. I’ve looked through what I think are the relevant RFCs (6617 and 7296) but I can’t find an answer to this.

Different application of arden theorem leads to different answers

So, I have to solve for the following set of equations

$ q_1$ = $ q_1$ a + $ q_2$ b + $ \epsilon$

$ q_2$ = $ q_1$ a + $ q_2$ b + $ q_3$ a

$ q_3$ = $ q_2$ a

There are two ways to do this

I did this

$ q_1$ = $ q_2$ b + $ \epsilon$ + $ q_1$ a

$ q_1$ = ($ q_2$ b + $ \epsilon$ )a* Applying ardens theorem

Now substituting in $ q_2$ the values of $ q_1$ and $ q_3$

$ q_2$ = $ q_2$ ba*a + a*a + $ q_2$ b + $ q_2$ aa

$ q_2$ = a*a + $ q_2$ (ba*a+b+aa)

$ q_2$ = a*a(ba*a+b+aa)* Applying ardens theorem

$ q_2$ = a*a(ba*+aa)*

Now substituting in $ q_3$ , the answer should be

$ q_3$ = a*a(ba*+aa)*a

However, the correct answer is

(a + a(b+aa)*b)*a(b+aa)*a

which can be obtained by first substituting $ q_3$ in $ q_2$ , and then substituting $ q_2$ in $ q_1$ , and finally solving $ q_2$ , $ q_3$ from the obtained regular expression for $ q_1$ .

Can someone tell where I have gone wrong in the above method, or am I applying ardens theorem in the wrong way ?