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
-
1
votes1
answer37
viewsHow to declare a class and how to define its values?
I’m trying to make a Pokemon simulator similar to Pokémon Showdown, but I’m doing it from scratch. In addition to having the functions of a common Pokemón game, you’ll have some customized. I would…
-
1
votes0
answers18
viewsWhat is the point of defining the type of an argument in a function in python?
I imagined that previously defining the type of argument in a function in python would automatically cause the program to return a Typeerror if the user added an argument with different typing than…
-
1
votes0
answers11
viewsHow to call a new frame after checking an input box entry in Tkinter?
Good morning! I’m making a game where the user needs to enter the passwords he discovers in the course of the game to unlock new screens. However, I’m not getting my password-checker button to work…
-
1
votes0
answers28
viewsupdate sql function + php not working properly
i needed to do something very basic, I am creating a customer site and I need to create the function of decreasing in 1 the client portion in db, follows below the function that I set up function…
-
1
votes0
answers40
viewsDifficulty in javascript with the return button of a rotary image banner
Hey, community, I’m new. I come to ask for help from more experienced people regarding the following problem: I want to make a banner of images on a site where images pass every 4 seconds, but there…
-
1
votes1
answer56
viewsHow to reduce the size of this function that contains multiple if?
I wanted to think of a logic that would decrease the size of this code, because it ends up repeating itself. It is an experience calculator for a game. You set your current level and the level you…
-
1
votes0
answers66
viewsActivity Lists in C
I received the following activity in the topic of Lists in physical contiguity: "Complete the attributes of the contact list structure in the file list_contacts.h. Create a contact list file. c and…
-
1
votes2
answers99
viewsfind intersections in two graphs in python
I have a very simple but functional code. It obeys two mathematical functions, testing different values of x and returning the coordinates of the point if the result of the two functions is the same…
-
1
votes1
answer50
viewsProblem rendering the Component that has a function in useEffect
I created in my project a "Slide show" component that has the function below to perform the automatic slide. However, when going to another page using the useHistory push function…
-
1
votes0
answers33
views -
0
votes1
answer593
viewsPHP: Function as a condition for an if
I would like to know if it is possible to use a function as a condition for a if. Example: function estaParaExpirar($data, $dias) { return(strtotime($data) < strtotime("+".$dias."days") ); } if…
-
0
votes1
answer2350
viewsJavascript accessibility (contrast)
I have a website that I have to have the following methods: Increase source, Decrease source, Contrast. I already got the first two, I now need to contrast with pure javascript. Has anyone ever done…
-
0
votes1
answer94
viewsHow to get all function calls from a php script?
Example: index php. <?php foo(); bar(); print_r(getCalledFunctions(__FILE__)); Print: array 0 => 'foo' 1 => 'bar' Question: Can someone return me the getCalledFunctions function?…
-
0
votes1
answer246
viewsPHP: Functions, Parameters, SOAP
I have the following code with two functions: public function getClientTemplates(){ $client_id = 31; $this->Send('client_get', compact(array('client_id'))); } public function Send($action,…
-
0
votes1
answer640
viewsPass pointer as C++ function parameter
Good morning guys, I have the following problem: I have a class that represents a List, and from it I created three objects (I don’t know which one to give) list1(5), Lista2(5), list3(10).…
-
0
votes1
answer397
viewsArduino - invalid operands of types 'double' and 'double' to Binary 'Operator'
#include <DHT.h> #include <math.h> #include <stdlib.h> #include <stdafx.h> #include <iostream> #define DHT1PIN 2 #define DHT2PIN 3 #define DHT3PIN 4 #define DHT4PIN 5…
-
0
votes0
answers55
viewsCreate function for formatting from (X-1, X-2, X-3) to ('X-1', 'X-2', 'X-3')
I have a query that returns some char type keys like this X-1, X-2, X-3. The problem is that now I need to use with where chaves in( ... ) and would have to format the values to 'X-1', 'X-2', 'X-3'.…
-
0
votes2
answers2429
viewsIs it possible to call Function without being by onclick?
It’s a cycle, where every round the function has to be executed, I’ve been researching and just found how to call by onclick. I believe it’s done by a script, but I can’t find the code.…
-
0
votes1
answer61
viewsProblem using function with truncated file
On another topic I did a question and a friend of the site helped me. I tried to use the function with the truncated file, however the result was: Code that I used: <script> function…
-
0
votes2
answers1947
viewsHow to use function return in Scilab or Matlab?
I’m doing a simple numerical program. But I can’t use return of functions in Scilab someone can help me? The function has to solve a calculation and then return the value for this variable to…
-
0
votes1
answer98
viewsExcerpt post wordpress
What’s wrong? I did the function to excerpt in wordpress posts and import to another site, however it is not cutting with what I set. Someone can give a light? <?php while (have_posts()):…
-
0
votes0
answers58
viewsHow to use boost::Function with variable parameter number function?
In a library I use, a function Z expects a pointer to function with the following signature: typedef void (*func)(double, ...). I want to write a class in such a way that I can pass an object from…
-
0
votes1
answer58
viewsIs the Regexp validity test correct?
I am trying to validate a password through Regexp, in javascript, but it only returns false when it should actually return true, for having given match value, someone would know if there is…
-
0
votes1
answer163
viewsjquery element change with time interval
I would like to make 3 or more animation blocks that, when clicking, keep changing according to the seconds, until someone clicks on one of the objects. The function is working to click. Clicking…
-
0
votes2
answers564
viewsWhy function is returning Undefined
I am trying to get a return json of the function and associate it to a variable, because so I take the need to structure the received data with page from within this function and I can work in…
-
0
votes1
answer332
viewsWhy does a script work within HTML and not in JS?
I am making use of toggle to change an icone and noticed that the script I made did not work at all, I played it inside html and it worked smoothly, but when I play it back to his js file, where it…
-
0
votes3
answers664
viewsProblem with window.open() JS
I have a table composed of 3 columns: link, status, action. In the action column, I have 2 links that will serve as "buttons": VIEW & DISCARD This table has on average +100 lines... I need that…
-
0
votes0
answers29
viewsEmail always falls into PHP spam box
Hello. Whenever I send an email with the function mail() PHP mail arrives in the SPAM box. How can I fix this?
-
0
votes1
answer71
viewsOne Function interferes with another
What I do when executing a function in javascript, it causes the previous function to start again, not accepting the changes made? <html> <script> function criartabela() { n =…
-
0
votes1
answer81
viewsReceive character in C
How do I do a function in C equal to the function Readkey of Pascal or equal to the function Lastkey of the old man Clipper? I want to receive only one character separately for each key pressed.…
-
0
votes0
answers20
viewsParameters sent after function is over
It’s probably a beginner’s question, but I’d like to understand what it’s for, with an even better example, what parameters are sent after a function is executed. For example, in this piece of code:…
-
0
votes1
answer545
viewscontrol forward and back from browser
I need to make the system not allow moving forward or backward when pressed to Backspace, someone can help me please? Look forward to!
-
0
votes0
answers99
viewsHow to send only one row of a multidimensional array to a Function?
I need to send only one line of a array multidimensional as a parameter of a Function, without having to transfer this line to another array. for example: calling for: var UmArray : array [0..4,…
-
0
votes1
answer688
viewsIs there any way of knowing where the function was called?
If I have a huge project and I realize that somewhere in the code, a function is being called, but I don’t know where it is, is there any way to find out? Example: #index.php // nada aqui nesse…
-
0
votes0
answers34
viewsHow to solve the logic problem of this php code block?
In this piece of code, I take what the url is sending and save the parameters in variáveis to subsequently pass them into a function. if(isset($_GET['funcao']) && $_GET['funcao'] ==…
-
0
votes0
answers37
viewsRedirect or remove Function.include with . htaccess in Wordpress
I wonder if there is how I redirect error 404 of various articles that has been going on, the example is the following: http://meu-site.com/artigo-1/function.include…
-
0
votes1
answer139
viewsDoubts about pointer pointers and function returns
Hello, folks. I’d like to know why the function below would need a pointer to pointer, in case a **root, for the line /1/ could modify the *root, while the line /2/ can modify it without having to…
-
0
votes1
answer1107
viewsWorking with Factory
I am developing a system for a snack bar, where she will have to register the cities and within the cities the neighborhoods with their due freight, the problem is occurring the first time that…
-
0
votes0
answers123
viewsHow to receive an indeterminate number of variables in a C function?
I’m studying lists in c, and I have a function to remove element, Lista* retira(Lista* l, int v), how do I get an indeterminate number of variavas v to remove? similar to varagars in java.…
-
0
votes0
answers58
viewsProblems with a function calling another function in javascript
I am working on a system that, when entering the data in the fields it checks through a javascript function if the data entered has already been registered in the database. If true, it blocks the…
-
0
votes0
answers37
viewsCannot read Array data
I’m having problems in the code below is not able to read the value $Scope.ids[i]. id, follows code: $scope.carregarEnderecos = function (id) { $scope.repeateEnderecos = []; $http.post(url_sistema +…
-
0
votes3
answers350
viewsData of an Array
I’m having a little bit of a problem here, the logic I should use for this kind of procedure is a bit complicated. Well, here’s the thing: I have an array with the following data: var dados = […
-
0
votes1
answer733
viewsReturning an array of a function in Postgresql
I’m having a question here that I need to solve with a postgresql database function. The problem is this, I need to cross a table that’s called stocking with a view called stockpile. In this table…
-
0
votes1
answer47
viewsFunction result JAVA Android
I have a simple question for those who already understand Java but this breaking my head. Being direct, I have my Mainactivity and a layout with two Edittext’s and a button, and a Systemshttp Class.…
-
0
votes1
answer134
viewsC++ smart pointers and functions
I am reading an article on msdn about smart pointers. In the article there is this example: class LargeObject { public: void DoSomething(){} }; void ProcessLargeObject(const LargeObject& lo){}…
-
0
votes1
answer210
viewsBecause input does not appear in php Function output
I created a function (I’m doing some experiments) to generate input, textarea, select, etc, through Function. But the result is partial. There is no error in the function, but only what is text…
-
0
votes1
answer2935
viewsHow to generate a sequential number in a PHP form without using a database?
Today in my form, I have the mail.php file where to read the form data and send by email. This form is an online order form, where users already registered Ogan and place orders. Well, I’ve…
-
0
votes0
answers25
viewsHow can I change an HTML page dynamically?
Good morning! I am creating an html page, which will serve to make feedback, that is to say to report specific situations or under certain conditions ask for help. It turns out that this page…
-
0
votes1
answer172
viewsTraverse an array of a php function
I have this function, I would like to go through its values separately but I’m stuck here and I can’t think straight to do a foreach for example. <?php function numeros_pequenos($zero, $um,…
-
0
votes0
answers26
viewssql stored Update Value With value from the previous record in the same table
I have a table with several repeated names sequenced by another column called id2 where each 1 of these records has a column with a quantity Example : Name-Quantity-Value2-id2 teste1-1000-0-1…
sql-server function select-sql sql-update stored-proceduresasked 7 years, 10 months ago Bruno Almeida 39