All Questions

4
answers

Avoiding the error "Can not read property 'c' of undefined"

Considering the following code: var a = {}; if (a.b.c !== undefined) { console.log("definido!"); } else { console.log("indefinido!"); } Is there any way to check each property without having to test one by one? What I...
asked on 20.02.2017 / 19:20
3
answers

How to give a Regex before a string? And select?

What I need to do is this: let's assume the string is - > : . However, I want to select "only" the string before : using Regex . To get clearer: " select this word : another word here" Remembering that :...
asked on 09.01.2018 / 18:44
4
answers

Difference between syntax for declaring a function

this response, I realized different forms of call a function using the jQuery. The first form would be this: $('#dois').on("click", testar); function testar() { console.log('Teste Dois'); } And the second one is this: $('#um').o...
asked on 17.11.2016 / 14:00
6
answers

What does it mean to increase?

I would like to know what the term increment means, and in what situation I should use it. I'm learning programming logic and I hear a lot about it, but I do not understand exactly what it means.     
asked on 03.04.2014 / 05:49
3
answers

What are the functions of an ORM? [closed]

What actions should an ORM provide? What should it or should not it provide the developer, or what role does it play within a system?     
asked on 05.07.2016 / 18:56
6
answers

Gradient color transition automatically smoothly

Hello, I have a div with the following css : background: linear-gradient(to right, #3e42e4, #e53472); And I would like colors to change through JavaScript. Similar to the top of this site: Pixelapse How can I do this?...
asked on 26.03.2015 / 19:48
4
answers

Subtraction of hours in php

When I subtract the time the result is "0" I want it to be in the time format, for example: 19:38:20 - 19:37:00 = 00:01:20. Note: The "time" values of the database I'm assigning to "$ time1" and "$ time2" are in varchar format. I have already...
asked on 25.04.2016 / 00:46
7
answers

Mapping an array with possible subarrays as elements

I'm trying to create a function that maps an array to another newArray. If one of the array elements is a array , I want to map all of its subelements to newArray. Therefore: var array = [1,2,3,4,5, [1,3,2,4,1]] Should return   ...
asked on 18.06.2015 / 19:38
5
answers

Remove last comma from an array

In this code below I have an array that returns me a comma at the end  exe: '98602', '98603', '98604', How can I remove this comma? if (isset($_POST['checkbox'])) { foreach ($_POST['checkbox'] as $key => $value) { $id = mysql_re...
asked on 06.03.2015 / 16:09
2
answers

Is it possible to further simplify this asterisked pyramid code?

I'm having a simple exercise where I need to make a pyramid using a repeat structure. The pyramid has 17 columns and 9 rows. My program displays it correctly, Is it possible to reduce some line or some for ? #include <stdio.h>...
asked on 24.06.2016 / 01:22