sensor – Calculation to obtain the dimension of the object in the image

I am trying to calculate the dimensions of an object in an image. This is a sample image that I took to get the height of the brown box. I have this white box that measures 16 cm and I would like to know the height of the brown box (in meters). This uses only the focal length and sensor size of my phone's camera.
Focal length: 3.99mm
Focal length in 35 mm Size: 29 mm
Sensor size: 4.8mm * 3.5mm
Height of the image: 4032px.
Size of the brown box in pixels: 1459px
Distance between the sensor and the box: 1.8m
enter the description of the image here
I did this:
enter the description of the image here
enter the description of the image here
So I found boxheight = 0.78m
Actually, this brown box measures 0.75m, so I want to know if it is possible to get a more accurate result using the fact that I know the exact size of the white box next to it.
Someone knows ? Thank you

shaders – OpenGL textures: the texture contains colored lines when the object is further away than a certain distance

I tried searching the web but I could not find a reason for this. When you render an object near the camera, the object and texture are processed well. But farther from a fixed distance, it begins to show strange colored lines in the texture.

Near the camera, without lines:

Further, lines of color appear in the texture:

enter the description of the image here

My shaders are quite simple.

#version 330 core

design (location = 0) in vec3 pos;
design (location = 1) in vec2 tex;

uniform mat4 projMatrix;
uniform mat4 viewMatrix;

out vec2 uvCoord;

main vacuum ()
{
gl_Position = projMatrix * viewMatrix * vec4 (pos.xyz, 1.0f);
uvCoord = tex;
}

#version 330 core

outside vec4 FragColor;

sampler uniform2D texture1;

in vec2 uvCoord;

main vacuum ()
{
FragColor = texture (texture1, uvCoord);
}

My texture parameters are:

glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

Any help would be appreciated!

Edit: I generated mipmaps using glGenerateMipmap (GL_TEXTURE_2D)

node.js – How can I update the object array of a recovery response?

I tried many things based on the other questions, but I did not think how to do it.

I have this matrix in my constructor component:

    testDependeciesArr:[]

When the user clicks on the "test dependencies" button of my reaction component, I call this function:

testDependencies () {
axios.get (process.env.REACT_APP_HOST + & # 39; / testDependencies & # 39;)
.then (resp => {
this.setState (
{testDependeciesArr: how to update this matrix}
)

})
.catch (function (error) {
console.log (error)
})
}

That function makes a request to nodejs and returns this:

{0: {...}, 1: {...}, 2: {...}}
0:
Response time: "21ms"
responseStatus: "OK"

one:
Response time: "2739ms"
statusText: "OK"

two:
responseError: {message: "error in the request to http: url, reason: connect ECONNREFUSED 100.100.100.100:80", type: "system", errno: "ECONNREFUSED", code: "ECONNREFUSED"}
Response time: "10 ms"

So, how can I update the testDependeciesArr array with the 3 objects I get from the node's response?

java – How to solve this problem that does not recognize as a JSON object using WebService in PHP?

doinBackground …
StringBuilder result = new StringBuilder ();
String line = null;
while ((line = reader.readLine ())! = null) {}
result.append (line);
}
return result.toString ();

The post executes is the one where it does not accept the JSONObjet ..

protected void onPostExecute (String result) {

                                try {
JSONObject jsonObject = new JSONObject (result);
yes (jsonObject.getBoolean ("deleted")) {

Log.i ("APIListar", "onPostExecute () -> Deletion service");
}} else {..... 

PHP code to delete the element in the table using Webservice

…..
$ response = array ();

                if (mysqli_stmt_affected_rows ($ stmt)> 0) {}
$ answer["deletado"] = true;
echo json_encode ($ response);
}} else .........

Reply from Log.i ….
onPostExecute () -> Value

javascript – Is there any way to import a dependency within an object? Node.js

I am developing an application in Electron together with Node.js, and I can not import a dependency within an object.

insert the description of the image here

Is it possible to do this, import a dependency within an object?

In this case,

** // I think the problem is here. **
msql = require (& # 39; mysql & # 39;),

connection = msql.createConnection ({
host: & # 39; localhost & # 39 ;,
user: & # 39; root & # 39 ;,
Password: & # 39; root & # 39 ;,
Database: & # 39; bd_barbaria & # 39;
}),

createConnection: function () {
connection.connect ();
},

closeConnection: function () {
connection.end ();
},

Check: function (name, password) {
"connect.query (" call checkClient (& # 39; "+ this.name +" & # 39 ;, & # 39; "+ this.senha +" & # 39;) ", function (error, results) {
(error) throw error;
list = JSON.parse (JSON.stringify (results[0]));
answer = String (list[0].alert);

return response;
});
}

};

module.exports = connection;

java – problem of writing and reading an object in a binary file

I have an application that should allow me to register doctors and list them, these doctors will be added to a file that can be read.

The file in question is a serializable file.

The problem I have is that when I give the doctor to save the file does not contain data and when I give to show does not show anything, the file when I open it contains a null.

I have a doubt, and I do not know if it's the interface or the implementation of the methods.

I think the problem is that I do not write to the file the object I'm creating.

I attached code:

1) I pass the class "medicos" (There is a problem because although I give serializable implements I do not attach a serial version specific ID)

package tarea07grafica;

import java.io.Serializable;



public class medicos implements Serializable {

private static final long serialVersionUID = 1L;

// declare the attributes
private String NIF;
private String name;
private String last names;
private int telephone;
private String sex;
private boolean guards;
Private String specialty;

// we create the default constructor
public medical () {

}

// we create the constructor
public doctors (String NIF, String name, String surname, int phone, String sex, Boolean guards, String specialty) {
    this.NIF = NIF;
    this.name = name;
    this.surname = surnames;
    this.phone = telephone;
    this.sexo = sex;
    this.guards = guards;
    this.especialidad = specialty;
}


// we create the getter and setter
public String getNIF () {
    return NIF;
}

public void setNIF (String NIF) {
    this.NIF = NIF;
}

public String getName () {
    return name;
}

public void setName (String name) {
    this.name = name;
}

public String getAúmero () {
    return last;
}

public void setAlast (String last name) {
    this.surname = surnames;
}

public int getTelefono () {
    return phone;
}

public void setTelefono (int telefono) {
    this.phone = telephone;
}

public String getSexo () {
    return sex;
}

public void setSexo (String sex) {
    this.sexo = sex;
}

public boolean isGuardias () {
    return guards;
}

public void setGuardias (boolean guards) {
    this.guards = guards;
}

public String getSpeciality () {
    return specialty;
}

public void setSpeciality (String specialty) {
    this.especialidad = specialty;
}


// we create the toString method
@Override
public String toString () {
    return "doctors =" + "NIF:" + NIF + ", name:" + name + ", surnames:" + surnames + ", phone:" + telefono + ", sex:" + sex + ", guards:" + guards + ", specialty:" + specialty;
}

}

2) Now I pass the class where I handle the files (I do not know if it is raised correctly by the errors that I get in reading)

public class Tarea07Grafica {


    private void readFile () {

        doctors m;
        String NIF, name, surnames, telephone, sex, guards, specialty;

        try {
            FileInputStream file = new FileInputStream ("medicos.txt"); // open the input stream
            ObjectInputStream read = new ObjectInputStream (file); // we use the ObjectInputStream to read objects from the file
            // we go through the file
            while (true) {
                m = (doctors) reading.readObject ();
                NIF = m.getNIF ();
                name = m.getName ();
                surname = m.getSurname ();
                telephone = String.valueOf (m.getTelephone ());
                sex = String.valueOf (m.getSexo ());
                guards = String.valueOf (m.isGuards ());
                specialty = String.valueOf (m.getSpeciality ());

            }
            // we capture the exceptions
            } catch (EOFException ex) {
            System.err.println ("Error" + ex);
            } catch (FileNotFoundException ex) {
                System.err.println ("Error," + ex);
            } catch (IOException | ClassNotFoundException ex) {
            System.err.println ("Error," + ex);
        }
    }

    public void addData () {

        try {
           FileOutputStream file = new FileOutputStream ("medicos.txt", true); // open the output stream
            try (ObjectOutputStream script = new ObjectOutputStream (file)) {// we use the ObjectOutputStream to write objects to the file
                doctors m = new doctors (); // create the object
                escritura.writeObject (m); // we write objects in the file
                escritura.close (); // close the file
            }
        // we capture the exceptions
        } catch (FileNotFoundException ex) {
            System.err.println ("Error," + ex);
        } catch (IOException ex) {
            System.err.println ("Error," + ex);
        }

    }

    public static void main (String[] args) {

        Task07Graphic file = new Task07Graphic ();
        Interface Interface = new Interface ();
        Interface.setLocationRelativeTo (null);
        Interface.setTitle ("Main Window");
        Interface.setVisible (true);


    }
}

3) And now I attach the code of the methods of the graphical interface that I think are giving me problems (what I want the show button to implement the addData in the file management window, that is, write me.

private void btnShowActionPerformed (java.awt.event.ActionEvent evt) {


    File file = new File ("medicos.dat"); // initialize the File type object

    doctors m = null; // initialize the created object to null

    try {
    FileInputStream fis = new FileInputStream (file); // we open the data entry flow

    if (file! = null) {// we put the conditional to check if the file is empty or not
        while (fis.available ()> 0) {
            ObjectInputStream input = new ObjectInputStream (fis); // we set the data entry in the object
            m = (medical) input.readObject (); // we read the data of the object
            System.out.println (m.toString ()); // print the results on the screen
        }
        fis.close (); // we closed the inflow
    }
 // we capture the exceptions
} catch (IOException e) {
    System.out.println ("End of file");

} catch (ClassNotFoundException ex) {
        System.err.println ("Error" + ex);
    }
}

private void btnAceptarActionPerformed (java.awt.event.ActionEvent evt) {

// first we validate the data
String data = "";

if (txtNIF.getText (). equals ("")) {
JOptionPane.showMessageDialog (null, "Enter the NIF");
return;
}

if (txtName.getText (). equals ("")) {
JOptionPane.showMessageDialog (null, "Enter the name");
return;
}

if (txtAlast.getText (). equals ("")) {
JOptionPane.showMessageDialog (null, "Enter surnames");
return;
}

if (txtTelefono.getText (). equals ("")) {
JOptionPane.showMessageDialog (null, "Enter the phone");
return;
}

// we record the data
data = txtNIF.getText () + txtName.getText () + txtName.getText () + txtTelephone.getText () + "" + buttonGroup1.getSelection ();
if (rbtnMujer.isSelected ())
    data + = "Woman";
else
    data + = "Man";
cbxGuardias.isSelected ();
JcbxSpeciality.setSelectedItem (data + " n");


}                                       

I attached a visual of the graphic interface:

enter the description of the image here

oracle: How can I verify that the object count works correctly in prod and in other lower environments?

How can I verify that the object count works correctly in production and in other lower environments?

We had just updated the preprod environment with a copy of the prod data. As the full backup did not run correctly the day before the update, we took the backup manually and copied it into preprod.

Now users are facing performance problems that indicate that this table does not exist in preprod.
Is there any way to compare the counts of production objects with the preprod environment

php – Error: count (): Parameter must be an array or an object that implements Countable

When I save a form record, I get the following error:

"count (): Parameter must be an array or an object that implements Countable"

I have two models created and the same controller and FormRequest for both since one model is "Reassignment", the other "Detailrea" which is the entry detail of the other, I leave capture:

enter the description of the image here

I think the error is caused by something from the function store, my intention in the first field of the income detail, is to select the name of the surplus and not its ID. And by selecting this field I also bring the name of the custody and the stock. The data brings them well and also they add well to the detail but at the moment of saving I skipped the aforementioned error.

Next I detail the code of the controller, below the field of the form of the view create and the code js.

public function store (ReasignacionFormRequest $ request)
    {
        try {
            DB :: beginTransaction ();
            $ reassignment = new Reassignment;
            $ reassignment-> idpmed = $ request-> get ('idpmed');
            $ reassignment-> idler = $ request-> get ('idder');
            $ reassignment-> Medication = $ request-> get ('Medication');
            $ reassignment-> Type_Request = $ request-> get ('Type_Request');
            $ reassignment-> Comments = $ request-> get ('Comments');
            $ reassignment-> Total = $ request-> get ('Total');

            $ mytime = Carbon :: now ('America / Montevideo');
            $ reassignment-> date_time = $ mytime-> toDateTimeString ();
            $ reassignment-> status = 'Active';
            $ reassignment-> save ();

            $ idexcedente = $ request-> get ('idexcedente');
            $ amount = $ request-> get ('amount');

            $ cont = 0;

            while ($ cont < count($idexcedente)){
                $detallerea = new Detallerea();
                $detallerea->idreasignacion = $ reassignment-> idreasignacion;
                $ detailrea-> idexcedente = $ idexcedente[$cont];
                $ detailrea-> amount = $ amount[$cont];
                $ detailrea-> save ();
                $ cont = $ cont + 1;
            }

            DB :: commit ();

        }
        catch ( Exception $ e)
        {
            dd ($ e-> getMessage ());
            DB :: rollback ();
        }

        return Redirect :: to ('/ reassignments');
    }

And here I leave the form field of the create view:

'+excedente+''; cont++; limpiar(); totales(); evaluar(); $('#detalles').append(fila); } else { alert ('La cantidad a reasignar supera el stock'); } } else { alert("Error al ingresar el detalle de reasignacion, revise los datos del excedente"); } } function limpiar(){ $("#pcantidad").val(""); } function totales() { $("#totalex").html(total + " Comp/Amp"); $("#Total").val(total + " Comp/Amp"); } function evaluar() { if (total>0) { $("#guardar").show(); } else { $("#guardar").hide(); } } function eliminar(index){ total=total-parseInt(cantidad); totales(); $("#fila" + index).remove(); evaluar(); } @endpush

I appreciate your answers

Near terminal object

There is a whole $ n> 2 $ in such a way that there is an integral scheme that exists exactly $ n $ Different morphisms to it from any separate integral noetic scheme?

Exactly two maps of each object

Is there an integral scheme such that there are exactly 2 different morphisms of any integral scheme of Noetherian?