Most voted "function" questions
The function (also called procedure, method, subprogram, or routine) is a portion of code intended to perform a single, specific task.
Learn more…1,309 questions
Sort by count of
-
0
votes1
answer71
views2 functions in javascript in the same div
I have Ivs in my html code (there are 3 menu bars), when I click, it turns (as if it were an animation) into an x, however, I want when it turns and I click on it to perform another function other…
-
0
votes1
answer84
viewsCreate user using a Function
someone could help me, she keeps giving error when saved '-' Error(19,5): PLS-00103: Encountered the Symbol "CREATE" when expecting one of the following: ( start case declare quit for goto if loop…
-
0
votes0
answers156
viewsButton loads all instead of filtering by group
I have a problem, where if I press the button to load more blocks through the database, it will load all in the ID order, however if I have in some filter it keeps loading all instead of only that…
-
0
votes1
answer744
viewsUsing search and pagination field with Function Based View in Django
I have the following code: #decorators.py from django.contrib.auth.decorators import user_passes_test def superuser_required(func): return user_passes_test( lambda u: u.is_authenticated() and…
-
0
votes1
answer388
viewsPHP; Mysql; calculate/ insert data automatically according to certain parameters
Good afternoon, I have 3 tables. I want to calculate and automatically insert the schedules in the scales table according to some parameters. ex: 4 days working mornings, 2 days off, 4 days working…
-
0
votes1
answer577
viewspostgres compare time extracted from a timestamp
I need to extract the hours and minutes of a timestamp in mysql, I tried to use maketime(); CREATE OR REPLACE FUNCTION agendar(dia timestamp) returns bool as $$ declare hora time := extract(hour…
-
0
votes1
answer708
viewsI want to save a return of a function in php within a variable
Hello, I have the following problem, I have a code in php, where I declare a function to search for zip on the mail server, in this function returns me a json depending on the zip I report. now I…
-
0
votes1
answer178
viewsNotify current Activity which background function has finished running Android
I have a class that looks for a list of clients in the background with a AsyncTask. She can be called any Activity, and returns nothing, just looks for the list of customers that comes in json and…
-
0
votes1
answer348
viewsReferenceerror: ... is not defined
Hello, I’m having a problem with the Javascript I’m using, I’ll put the practical example I’m using, in the head of my HTML I have 3 different tag openings. follow: <script type="text/javascript"…
-
0
votes1
answer247
viewsReceive a string from a PHP array for a Javascript variable?
I have a PHP array with a certain string, Ex.: $matriz[2][2] = "texto"`. Hence I want to pass this matrix to a Javascript variable. Ex.: `var v_php = "<?php echo $matriz[2][2]; ?>";` When I…
-
0
votes2
answers1283
viewsHow to exchange values of two variables without using a third one in php
My question is very objective. I need to exchange values of two variables without using a third one in php. NOTE: Using array/array is not an option. Researching I found a solution in linguagem c…
-
0
votes1
answer505
viewsCreate a sequence of useful days in R
I have a data frame the following columns: Date (Only days of the week and without holidays, of several years) Month Year ... I want to create a sequence of business days. So I wanted a function…
-
0
votes1
answer50
viewsAdjust function with Laplacesdemon
i am trying to make the function adjustment y ~ o/(x*(x+t)^k) through a Bayesian technique through the function LaplacesDemon. However, the values obtained for the parameters are considered good, as…
-
0
votes1
answer262
viewsCalling an Array from a Public Codeigniter View function
I have this public service in Controller: public function faturar() { $this->load->library('form_validation'); $this->data['custom_error'] = ''; if…
-
0
votes2
answers80
viewsDoubt about JS function
I have the myFunction function that calculates the product of two numbers and displays them on the screen. I would like to shift this function to the Listen function when the value of P1=10. The way…
-
0
votes2
answers756
viewsCreating a regex for vowels in C
I need to create a regex check if a word contains vowels, and after creating this check, I will cut out the vowel parts of this word, but I don’t know how to create a regex in C. I saw some codes so…
-
0
votes1
answer265
viewsOutput of a void function
I’m programming a word hunt and a problem in the void function is making it difficult. In the code I use functions to scan the matrix in all directions and returns me the initial and final…
-
0
votes0
answers39
viewsHow to copy string from one vector to another vector in C?
I’m trying to create a program that will have a function called substring where the user will place the index position of an origin vector in which it will copy and the size of how many letters it…
-
0
votes1
answer65
viewsProblem with Struct Research
In my code, I can enter and delete normally, but in the searches it does not print, what could be the problem? I thought it would work the way I did. I’m doing the 'if' correctly? struct fichacarro…
-
0
votes1
answer41
viewsFunction for matching points
In an exercise, I need to create a function that returns TRUE if the points are identical. For the points, a structure was implemented as follows: typedef struct //Estrutura definida para os pontos.…
-
0
votes1
answer35
viewsFunction to change Height with errors
184 function bannerPrincipal(){ 185 var bannerHolder = document.getElementById("banner-principal"); 186 var windowSize = window.innerHeight; 187 bannerHolder.css.height == windowSize+"px"; 188…
-
0
votes1
answer101
viewsHow to call one function together with another
Good evening guys I’m having a problem to call a class i want when the file button is with some file an icon appears (so to indicate that the button is not empty). This function only works on the…
-
0
votes2
answers104
viewsHow does this function work within for?
var del = document.getElementsByClassName("del"); if (del != null) { for (var i=0; i<del.length; i++) { (function(i) { var id_cliente = del[i].getAttribute('value'); if (del[i].addEventListener)…
-
0
votes1
answer113
viewsExtract returns Undefined variable on the detail page
I am with the following variable indefinite error, I am developing a shopping cart using Friendly Url. Everything was going fine until I got to the part of returning all the contents of my product…
-
0
votes0
answers50
viewsInvert Number
What logic could I employ to make a program where I insert a number and then be reversed. ex: 123 to 321 PS: has to be a function.
-
0
votes1
answer74
viewsProblems with PHP POST
add-product.log. <?php include("header.php"); include("conexao.php"); include("banco-produtos.php");?> <?php $nome = $_POST["nome"]; $preco = $_POST["preco"]; $descricao =…
-
0
votes1
answer1909
viewsHow to concatenate the records of two columns?
Let’s say I have a table with two columns name and surname, for example: Nome | Sobrenome -------+----------- João | Silva Mike | Corin Carlos | Rodrigues And I want to join the column of the name…
-
0
votes0
answers44
viewsturn Procedure into Function
I’m trying to turn this procedure in function, to use inside another procedure, but I can’t evolve: CREATE PROCEDURE bancodados.sp_calculo(param_id_cnpj varchar(14)) BEGIN SELECT id_cnpj,…
-
0
votes2
answers54
viewsVector in C- Program Received Signal, Segementation fault
Hello, I designed a function that checks whether a number is present in a vector. A function takes as parameters the vector, the value to be checked and the number of existing elements in it. E…
-
0
votes1
answer1360
viewsCall any function of another class of the same type
I need to pass as a parameter to a member function another member function (but of another class). I can do this for same class functions, but from another #include <iostream> using namespace…
-
0
votes2
answers1098
viewsRun automatic click on form input
I have a search form, and it lists details. when accessing the details it saves session, but when returning the list saves the query in the session but does not execute the query. What I thought is…
-
0
votes2
answers51
viewsVariable zeroed in javascript
//Nosso time var nomeTime = prompt("Qual o nome do seu time ?"); var vitorias = parseInt(prompt("Quantas vitórias seu time teve ?")); var empates = parseInt(prompt("Quantos empates seu time teve…
-
0
votes2
answers1127
views -
0
votes2
answers259
viewsHow to return a vector to another vector in Java?
I’m doing a program that applies hill climbing, but the value I need to compare to see if the previous one is better than the next one is a vector double My method to find the best value returns an…
-
0
votes2
answers682
viewsAutomatically close browser after alert
How do I get the browser to automatically close after the alert? <html> <head> </head> <body> <div onmouseover="showText();" onmouseout="javascript:alert('my alert');"…
-
0
votes1
answer215
viewsError while creating mysql function
I’m trying to create the following function: DELIMITER // FUNCTION DISTANCIA ( lat1 DOUBLE, long1 DOUBLE, lat2 DOUBLE, long2 DOUBLE ) RETURNS DOUBLE DETERMINISTIC BEGIN DECLARE d2r DOUBLE; DECLARE…
-
0
votes1
answer307
views -
0
votes1
answer868
viewsHow to do an action in jquery wait for another to finish to start?
I am trying to create a menu where the search bar appears only after the li's of the menu vanish, for that, I recommended the function .delay() of jquery, but I am not able to realize these effects,…
-
0
votes1
answer79
viewsglobal $var does not work in PHP
I have the following code: <?php $_this =& get_instance(); function ConfiguracoesSistema($coluna){ global $_this; $configuracoes = $_this->db->get('configuracao');…
-
0
votes2
answers135
viewsReturn all constructor parameters of a function in Javascript
Imagine the following situation: I have several "classes" built from javascript functions where their properties are defined within the constructor. So: var Pessoa = function(data) { this.nome =…
-
0
votes1
answer40
viewsCalling Javascript function at the wrong time
Good evening, I’m trying to create a page that displays an image in a fashionlBox with the zoom function, but I’m facing the problem that even clicking outside the image thumbnail, the zoom function…
-
0
votes1
answer85
viewsPass value to 2 different paths
I would like to pass the variable var data = 'codreq=' + id; for two ways. Is that possible? If so, someone can teach me. I can only go this way: url: "<?=…
-
0
votes1
answer41
viewsSequence of execution of tasks
I have a question about the execution sequence. For example, in the code below, because it prints y=2.0 and not y=4.0 and because it prints w=0.5 and not w=2.2. y=2.0 understands that it looks for…
-
0
votes1
answer750
viewsTypeerror: 'float' Object is not iterable in 2D CHOICE function
I have the code below and I can’t make it work. For, I need an array from my 2D list to be chosen randomly with the CHOICE function and perform the sum of values that are less than 85.0 and subtract…
-
0
votes2
answers119
viewsChained List C does not insert new node
I started making a chained list program, but when I use the print function, it wasn’t printing anything, so I discovered that the LISTA after leaving the function inserts, it again has the value…
-
0
votes1
answer27
viewsReversing the process of a function
I was thinking about a project for testing Skills, about a load bar and I thought, we can undo a modification on a page normally, but and do the opposite process ? for example, we have an automatic…
-
0
votes2
answers410
viewsNeed to declare variables in a Javascript function
Hello. I’m starting to learn programming logic. When I create a Javascript function, I declare and ask to return its value. function exemplo(teste){ var saida = teste + 4; return saida; } Well, when…
-
0
votes1
answer32
viewsCompare to remove_if in c++ does not accept char
Hello, I’m trying to use a remove_if in c++ but when it gets to the input part I can’t determine for it to detect if the string I’m pointing has a char. Follows my code:…
-
0
votes1
answer9363
viewsRun function that returns multiple values and based on these make the main SELECT - SQL Server
I have the following function in SQL Server that returns the name of each column of my table: CREATE FUNCTION dbo.FiltraNomeColunas(@FiltroColuna VARCHAR(200)) RETURNS VARCHAR AS BEGIN DECLARE…
-
0
votes1
answer50
viewsReactivate jquery function after function call
Good afternoon, I have the following code that inserts inputs into a div when it is clicked on a "NEW" button that also takes direct focus to the first field on the line and that can also happen…