Questions tagged [methods]
A method is a block of code that performs a task and is associated with a class or an object. It is related to the non-object-oriented concepts of functions and procedures.
methods
30,473
questions
0
votes
1
answer
40
views
How do I run a python file from another python file [duplicate]
I am trying to run a python file from another python but when, when it comes to calling a method in another python file it just reruns the current python file.
I tried this code. I put the import ...
0
votes
1
answer
21
views
Python - Better way to run external methods with similar, but different, names?
Currently in my project, I have some code like this in a method, where param1 and param2 are guaranteed to be the same for every function call:
def run_funct(self):
if self.my_type == "a&...
0
votes
1
answer
31
views
The GET method is not supported for route registrar-articulo. Supported methods: POST - axios post
I am working on a project with laravel 9.
I have a problem with a request in axios, I get the following error:
405 Method Not Allowed
I have already applied the following commands in my project:
php ...
0
votes
0
answers
23
views
How to modify a "Name+2nd name+Surname without touch 2nd name? Phyton
I want to change 2 characters in a variable in phyton but when I fix one the other change again.
I have this variable.
name= " rIana Danyela RodrYguez "
I don't want to touch the name &...
-3
votes
0
answers
30
views
Python development strategy : How to visibly indicate dev code is active or commented? [closed]
Any ideas how to achieve this strategy, I don't really care about the complexity of what happens under the hood (as long as I don't have to install weird packages), I just want the code to read ...
0
votes
0
answers
31
views
How to open "send this server message to my contacts" menu in telegram mini app
Good afternoon, i now working on telegram mini app project, and cant find way to open send message menu in that telegram app. User press button, then he see his contats, choose one and send to that ...
-5
votes
1
answer
35
views
Calculating the volume of a square
package Pyramid;
import java.util.Scanner;
public class SquareVolume {
public static void main(String[] args) {
double length = 0;
double width = 0;
double height = 0;
...
0
votes
0
answers
30
views
How do I use import for built-in modules for node.js
I am making a webapp to send emails using node.js. In accordance to the ECMAScript 2015 standards, I have not been using require(), but import/export.
import url from "url";
import path from ...
1
vote
1
answer
43
views
Inherit override-equivalent as different methods
Several methods from interface, super class or new method are override equivalent. I need to make different realization for each. Example:
public interface A {
int f();
}
public interface B {
...
-2
votes
0
answers
32
views
Why do we declare public class at the start of Java code? [duplicate]
In java, whenever we write a program, the first line of the program always starts with public class name_of_class{}
When I googled the reason of why we have to mention public class at the start of ...
-1
votes
1
answer
64
views
Write a method that takes 3 integer as parameters, return true if they are equal, return false otherwise without using if statement [closed]
I am trying to write a method that compares three integers without using the if statement. I tried the switch statement, but it wouldn't work. Eclipse shows case expressions must be constants.
Here is ...
1
vote
2
answers
39
views
C# reflection: Get static method with multiple generic overloads [duplicate]
How we can get a method such as Tuple.Create that has multiple generic overloads through reflection and use it with our custom generic type arguments?
usecase: the generic type arguments are known ...
1
vote
1
answer
45
views
Unable to update the currentIndex to the one where the selected modal is opened
I have a class where I can open the gallery. The problem is that this line of code doesn't reflect to the currentIndex. As a result, whenever you click a gallery img, it opens the gallery and its ...
0
votes
0
answers
32
views
Calling methods from array of method pointers not executing [duplicate]
This doesn't execute any suggestions:
void (CClient::*pMethod[CNetwork::ClientEvent::E_CE_MAX_EVENTS])();
pMethod[CNetwork::ClientEvent::E_CE_ACCEPTED] = &CClient::Accepted;
pMethod[CNetwork::...
-2
votes
0
answers
34
views
What is the need of having different types of request methods(get,post,put,delete)?
I can achieve whatever a get/put/delete request achieves using a post request (by writing whatever the logic is inside the method). Then what is the point of having different methods.
There must ...