Reading a bit of Javascript code I have come across this:
router.route('/:id')
.put((...args) => controller.update(...args))
.get((...args) => controller.findById(...args));
Does anyone know what ...args means?
Reading a bit of Javascript code I have come across this:
router.route('/:id')
.put((...args) => controller.update(...args))
.get((...args) => controller.findById(...args));
Does anyone know what ...args means?
My code is:
<select>
<option value="" disabled>seleccione la marca</option>
<option value="saab">Saab</option>
<option value="vw">VW</option>
<option value="audi">Audi</option>
</select>
How do I make it appear in the select seleccione la marca
, but not be selectable?
I tried disabled
but it doesn't show up.
I would like to know if there is any way to know the first free record of mysql, but not the last one, if not the first free one that exists.
Ex:
I have busy registration 1,2,3,6,7,8,9 the first free one would be 5
At the moment I have a code that tells me the last one, which would be this:
$CIdmaxFact = "SELECT MAX(CAST(codfactura AS UNSIGNED)) AS ultimocod FROM Facturas WHERE empresa='".$_SESSION['Empresa_Id']."' AND serie='".$_POST["Infactura_serie"]."' "; //miramos de nuevo el ultimo codigo por si aca
$RIdmaxFact = mysqli_query($Conectar ,$CIdmaxFact); //pongo un resultado de la consulta
$DIdmaxFact=mysqli_fetch_array($RIdmaxFact); $idmaxFact = trim($DIdmaxFact["ultimocod"]); $idmaxFact ++;
$idmaxFact = str_pad($idmaxFact, 4, "0", STR_PAD_LEFT);
But it doesn't work for me at all, since it only tells me the last one. Any ideas?
Hi to the whole community. I have written this POST in order to improve the understanding of class and instance variables . I have searched the Internet, and what has become clear to me is that:
I don't know if I have interpreted it correctly or if I need something more to know or understand and if I have interpreted correctly what I have written before.
My idea of the C++17 feature Template Parameter Induction for Template Classes was that it was intended to homogenize the behavior of template functions and template classes in cases of parameter induction. But I think there is something I have not understood.
If we have this template object:
template <std::size_t S, typename T>
struct test
{
static constexpr auto size = S;
using type_t = T;
test(type_t (&input)[size]) : data(input) {}
type_t (&data)[size]{};
};
I usually use a helper function to make object creation easier test
:
template <std::size_t S, typename T>
test<S, T> helper(T (&input)[S]) { return input; }
Which can be used in the following way:
int main()
{
int buffer[5];
auto a = helper<5, int>(buffer); // Sin deduccion.
auto b = helper<5>(buffer); // Tipo deducido.
auto c = helper(buffer); // Tipo y tamanyo deducidos.
std::cout << a.size << b.size << c.size;
return 0;
}
The above code shows 555
as expected. I have tried the same thing on Wandbox using newer compilers 1 :
int main()
{
int buffer[5];
test<5, int> a(buffer); // Sin deduccion: Funciona.
test<5> b(buffer); // Tipo deducido: FALLO.
test c(buffer); // Tipo y tamanyo deducidos: Funciona.
std::cout << a.size << b.size << c.size;
return 0;
}
It seems that parameter deduction for template classes only works when all parameters are deducted, I was expecting both behaviors (per-function and per-class deduction) to be the same, is there something I misunderstood?
1 The latest compilers available on Wandbox are gcc HEAD 7.0.1 201701 and clang HEAD 5.0.0 (trunk) .