How do I minimize sbox while the extra screen is active?

Of course, I can minimize the program if it's all like everything else.

But if I'm running an addon, or if I'm browsing through a list of URLs that retrieve information, or whatever has a secondary screen, then I can not minimize either. I can pull the second screen out of the way, but I'm not feeling well if the main sbox program screen is still stuck and blocking part of my desktop

I just swear the other day, I accidentally did something that minimized both, but I can not replicate

How can I do that?

Many thanks

boot – Long boot time with is screen uu

When I try to install Ubuntu 19.04 from USB, a pink screen with a fast blinking Ubuntu logo and text is displayed on the left side of the screen. This screen was displayed for 15 minutes and the installation menu was displayed. During the installation, however, graphical errors occurred on process and after installation, when I try to boot the same screen, appear for 15 minutes

applescript – lock screen with terminal? Javascript prevents keystrokes

I want to lock the screen of my Mac remotely. I do not want to sleep my Mac. Only the screen. I do not want to request a password every time I put my monitor into sleep mode (system settings / password required). And I definitely do not want to suspend the current user (CGSession -suspend) because my Mac also serves as the Media Control Center.

I tried to create an App with an Applescript that I could start remotely, but this command in the Applescript fails:

 tell application "System Events"
      key code 12 using {command down, control down}
 end tell

When I start the applescript from the terminal, I get the error message that Javascript is not allowed to send keystrokes.

Here's what I'm trying to achieve: I have a Philips Hue dimmer remote near the front door of my house. I've reprogrammed the keys to do different things (light up, replay everything I've heard in iTunes recently, etc.). It's great, besides, I want the OFF button to turn off my lights, iTunes, etc., and lock my Mac's monitor. Everything works, except for the last step.

I can sleep with the monitor of my Mac

do shell script "pmset displaysleepnow"

I resigned myself for the time being, but that sleeps the monitor. I want to lock the monitor.

I know I can go to system settings and request a password after hibernating, but I do not want to use a password every time I put my monitor to sleep. That would drive me crazy. I also know that I could do something like this:

do shell script "/System/Library/CoreServices/Menu\ Extras/ -suspend"

This will break the current user's session, so my remote can not control my Mac. I just want to lock my monitor (Command Control Q) without using a hotkey so I can trigger it remotely.

How can I remotely lock the screen of my Mac?

android – How do I save a Boolean value when I turn the screen?

In my code I want to get a random number and apply a color to the background of the application depending on the generated number.
The problem is that rotating the screen generates a different random number. I noticed online that the onSaveInstanceState and onRestoreInstanceState usage was saved in the activity and later restored, but this does not work for me.


private var numAleatorio: Int? = null   //GENERA UN NÚMERO ALEATORIO
private var generarColor: Boolean = true

override fun onCreate(savedInstanceState: Bundle?) {

    clInicio = findViewById(
    tvJugadores = findViewById(
    // ----

    if (numAleatorio==null && generarColor) {
        numAleatorio = null ?: (0..4).shuffled().first()

private fun obtenerColor (num: Int?) {
    when(numAleatorio) {   //Obtengo un número random y lo parseo a int
        0 -> {
            darColor = Color.parseColor("#FF5252")
            //tvJugadores?.setTextColor(Color.parseColor("#115911")) PONER LOS BOTONES DEL COLOR COMPLEMENTARIO

        1 -> {
            darColor = Color.parseColor("#FFFD6B")

        2 -> {
            darColor = Color.parseColor("#2D8FCC")

        3 -> {
            darColor = Color.parseColor("#21282E")

        4    -> {
            darColor = Color.parseColor("#FF9F1C")

override fun onSaveInstanceState(outState: Bundle?) {
    outState?.run {
        putBoolean("NUMRANDOM", false)

override fun onRestoreInstanceState(savedInstanceState: Bundle) {

     generarColor = savedInstanceState?.getBoolean("NUMRANDOM")


Display – The screen of the MacBook Pro is broken and the second monitor was fine until I started to turn on FileVault

I have a MacBook Pro 2015 with a broken screen (most of it is black and not visible).

Before I set it up where I just wanted to turn it on, I plugged my HDMI cable into a TV or monitor and it showed up on the second monitor and I entered my username and password and logged in.

I made the big mistake turning on FileVault, and when I saw that it took hours, I turned off the computer to continue the next morning. In the morning I came to connect the HDMI cable to the TV and nothing – it means the signal was not detected and I can not see the login screen on the second monitor or type in my password or username to get into the laptop reach.

I tried to type blindly, and nothing happens. I also tried a remote keyboard and a USB keyboard.

What can I do to have my laptop appear on the second screen and log in?

Unity – How do I keep UI texts in their relative position on all screen resolutions?

I have to position several UI texts on the screen.

I do this with a canvas with Screen Space Overlay.

In addition, these UI texts must remain at their relative positions for different screen sizes.

Here is a screenshot in which the texts are highlighted in green:

Enter image description here

You can see that they do not follow a latticed pattern.

How can I keep them in relative position at different screen resolutions?

Many thanks.

django – Two classes on a registration screen


I start in Django and have some questions:

1 ° As you can see, the following code has a class called Student, which is related to the Responsible class. College student. I did it with the following code, but I do not know if there is a better way. Here's a picture of how I want it ( But my question is, is there a better way to accomplish this task?

2º I also wanted to determine the size and weight of the student to perform his BMI. How do I do this When I perform the function that measures the size and weight and compares with EX: 18.5, it means that it is not possible to compare the function with the value. I've also tried to write the value of the calculation to a variable, and also an error that says it's not possible to compare a float input with Float. Any solution for that?

3º How do I put there in the form of "sex" put options instead of the type of person?

NOTE: In it becomes clear that there are Respform and Cadform, question number 1, can I only do this in 1? As in cadform, do I also perform the respform?

Thanks in advance!


class Responsavel(models.Model):
    nome_responsavel = models.CharField(max_length=50)
    telefone_responsavel = models.CharField(max_length=15)
    endereco_responsavel = models.CharField(max_length=50)

    def __str__(self):
        return self.nome_responsavel

class Aluno(models.Model):
    nome_aluno = models.CharField(max_length=50)
    idade_aluno = models.DateField()
    peso_aluno = models.FloatField()
    altura_aluno = models.FloatField()

    sexo = models.CharField(max_length=10)

    aluno_responsavel = models.ForeignKey(Responsavel, on_delete=models.CASCADE)

    def __str__(self):
        return self.nome_aluno


class cadform(ModelForm):
    class Meta:
        model = Aluno
        fields = ('nome_aluno', 'idade_aluno', 'peso_aluno', 'altura_aluno', 'sexo')

    class respform(ModelForm):
    class Meta:
        model = Responsavel
        fields = ('nome_responsavel', 'telefone_responsavel', 'endereco_responsavel')

    def cadastrar_aluno(request, template_name='contas/cadform.html'):
    resp = respform(request.POST or None)
    form = cadform(request.POST or None)
    if resp.is_valid() and form.is_valid():
        return redirect('index')
    return render(request, template_name, {'form': form, 'resp': resp} )

Registry HTML

   {% extends 'contas/base.html' %}
{% block title %}
Cadastro de Aluno
{% endblock title %}

{% block nav %}
Cadastrar Aluno
{% endblock  %}

{% block content %}
{% csrf_token %} {{ form.as_p }} {{ resp.as_p }}
{% endblock content %}