What is the best way to know when an array traversal ends in javascript with any of these functions?
Johnny Pachecp's questions
I know that the use of ; in GOlang, but for the Golang compiler which is more efficient, should we put it or not?
I'm using a react-navigation StackNavigation in react-native, but I need my header component to be very custom according to the route, the custom heade component will be placed, but I can't get the name of the route I'm on or something that identify in the header.
Developing my app with react-native , I must obtain the phone number of the cell phone the app is running on. Does anyone have any ideas for that? How would you do it and why?
I know that the use of ; in JS, but for the JS interpreter which is more efficient, should we put it or not?
I'm new to docker, I need to have a container that is running a mysql server, and when I modify the data in the db, do a commit and push to docker hub, my partner downloads it and has the same data as me.
In a project it is already defined that we are going to use Golang for the Backend and its Siris framework, but for the Frontend react is going to be used. I have not seen that integration before.
This is my db model in terms of users
It turns out that I need the user to be able to log in with the same credentials, the intention is to create a procedure where the server returns its user data, and the teacher and administrative data if it is, the dilemma is that a user can be a teacher in several institutions, or administrative in several, or be a teacher and administrative in different institutions. What would be your solution? What language would the procedure be in? It doesn't matter what type of data it returns, as long as it can be used on the server.
I'm starting with ionic and I have a menuToggle that is shown only if the user is logged in, the conditional is in the menu template and I use *ngIf="login" to condition whether it is shown or not, but I haven't been able to make a Once the user logs in, the menu is displayed. I come from the world of react, where when making a change in the state of the component it was rendered according to its changes, but in angular, how do I get the view to update when changing values?
I have a model made with sequelize , I can not delete the data from the institution table , but now I must add a day field to it .
I already tried sequelize.sync
but it does not modify the structure of the table. and sequelize.sync({force:true}) would delete all the data.
It is important that you do not delete anything since it is a database that must be modified as the project grows.
I must work from two different places with the same database, being in the development stage I need something free (free). Where you can mount a potgresql database and access it from anywhere.
I am programming with an online IDE in node.JS, but it is not saving the changes I make in the main execution file, I stop and restart the server and my page receives the same, it does not even print to the server console un console.log
, will it have to do with the IDE?
I have this structure and I need a data entry in the name field, but I have that data in a string.
typedef struct cliente{
int cedula;
int numCuenta;
char nombre[100];
cliente *izq, *der;
}cliente;
I am creating a website where the use of javascript is a priority, so I would like to know how to detect if the browser is running javascript when visiting my site, and if not, address it or give it the option to activate it immediately.
I want to mimic the effect placeholder
of the inputs
in Wix login , when the focus is placed on a input
, its text placeholder
is placed above the input
and in a smaller font.
I am creating a web system, and I would like to ensure that my pages load as youtube does, or easy code, that the footer and the menu or other sections remain the same, they do not reload, only the main part and the url change, I would like to achieve this Could someone tell me with what technology, library or method? Thanks in advance.
I am performing a login, and the user type is a different object, that object in the code that queries if it works fine, use a var_dump to the session variable where I used it and it works fine, but when I send it it no longer works.
Login.php
<?php
session_start();
require_once '../Modelo/PDOConex.php';
if((!$nameUser = trim($_POST['user'])) || (!$password = md5(trim($_POST['pass']) ) ) ){
header('location:../');
}
try{
$stmt = $db_con->prepare("SELECT
idUsuarios,
Cuenta,
Contra
FROM
Usuarios
WHERE
Cuenta=:usuario");
$stmt->execute(array(":usuario"=>$nameUser));
$fila = $stmt->fetch(PDO::FETCH_ASSOC);
if($fila['Contra']==$password){ //Credenciales correctas
require_once 'Log/getTipo.php';
switch (getTipo($fila['idUsuarios'], $db_con)){
case 'Administrativo':
require_once 'Log/LoginAdmin.php';
$_SESION['Usuario'] = serialize(logAdmin($fila['idUsuarios'], $db_con));
$_SESION['Tipo']= 'Administrativo';
break;
case 'Docente':
require_once 'Log/LoginDocente.php';
$_SESION['Usuario'] = logDocente($fila['idUsuarios']);
$_SESION['Tipo']= 'Docente';
break;
case 'Estudiante':
require_once 'Log/LoginEstud.php';
$_SESION['Usuario'] = logEst($fila['idUsuarios']);
$_SESION['Tipo']= 'Estudiante';
break;
case 'Acudiente':
require_once 'Log/LoginAcud.php';
$_SESION['Usuario'] = logAcud($fila['idUsuarios']);
$_SESION['Tipo']= 'Acudiente';
break;
default:
echo "0";
break;
}
}else{
echo '0'; // Credenciales incorrectas
}
}catch(PDOException $e){
echo $e->getMessage();
}
?>
index.php
<?php
require_once 'Controlador/Usuarios/Acudientes.php';
require_once 'Controlador/Usuarios/Administrativos.php';
require_once 'Controlador/Usuarios/Docentes.php';
require_once 'Controlador/Usuarios/Estudiantes.php';
session_start();
// Error does not receive the object, here var_dump prints false...
$_SESSION['Usuario'] = unserialize($_SESSION['Usuario'])
if(isset($_SESSION['Usuario'])){
header('location:Pages/login.php');
}else{
switch($_SESSION['Tipo']){
case 'Administrativo':
if(count($_SESSION['Usuario']->getId_Colegio())>1){
header('location:preAdmin.php');
}else{
header('location:indexAdmin.php');
}
break;
case 'Docente':
if(count($_SESSION['Usuario']->getId_Colegio())>1){
header('location:preDocente.php');
}else{
header('location:indexDocente.php');
}
break;
case 'Estudiante':
header('location:indexEstudiante.php');
break;
case 'Acudiente':
header('location:indexAcudiante.php');
break;
default:
header('location:Controlador/logout.php');
break;
}
}
What am I doing wrong?
I want to develop a website that works with MySQL, but at the same time I want that platform to be able to be used from desktop software. I'm doing it with java, and I'm new to it, I want to know how I could use a completely local database with java, which is MySQL, in such a way that I can use it as a mirror database, of which the website uses.
It happens that I use I am recently testing java, and I installed eclipse on my computer, it is not high performance, I decided to install the plugin to program android apps with eclipse and after finishing the installation of the jdk, when trying to make the first app, the typical hello world this message appears in the console and eclipse crashes...
What should I do then? Thank you in advance for your help.