Questions tagged [definition]

A generic tag for topics providing definitions.

A generic tag for topics providing definitions.

1574 questions
-1
votes
1 answer

what is wrong with the if statement in the code below?

can someone explain what's wrong with the below code? def factorial(num): if num == 0 or 1: return 1 else: result = num * factorial(num-1) return result #print(factorial(30)) #output: 1 & on…
Sahas
  • 259
  • 2
  • 12
-1
votes
1 answer

vNext Build definition to build Visual Studio 2005 solution in TFS 2017

I need to configure a build definition in TFS 2017 for a solution that is developed in VS 2005. The agent server that execute Build tasks is configured with Windows Server 2012 R2, and it's installed VS 2005. In a build definition, I have tried with…
Audberto
  • 11
  • 3
-1
votes
1 answer

Having trouble with using functions in for loop

X=[1,2,1,0,1] def f(x): return {1:'car',2:'bike',0:'bus'}.get(x,'default') for i in X: print(i) f(i) output: 1 2 1 0 1 The problem with the above code is, its not executing the function f(x)
Durairaj s
  • 193
  • 3
  • 13
-1
votes
1 answer

What is the Syntactical Function of Nested Defintion in Python?

Following is a model given by a module. If you look inside of it, you can check two definitin of functions are defined in a nested depth. I've never seen this before. How's it working? def load(filepath, shape_only=False): def readpca(f, nv): …
Beverlie
  • 461
  • 1
  • 6
  • 19
-1
votes
1 answer

Java class definition in runtime

Possible Duplicate: How do I programmatically compile and instantiate a Java class? How to create a new java class at runtime?
dheeps
  • 163
  • 1
  • 4
  • 13
-1
votes
1 answer

Implementation details of scheme library procedures?

As per my understanding scheme procedures like map,apply,append etc are written in scheme itself. Is there an easy way to see the implementation of these procedues right inside the REPL ?
sudhirc
  • 125
  • 2
  • 12
-1
votes
1 answer

Why do the if/else statements not work within my function?

I am using if/else statements for the user to choose a customer option (Resident or Business), type in how many kilowatts they have used and the program will calculate the power bill. This must be used within functions (a chapter that we are…
-1
votes
2 answers

How can I return with a local variable in definition in Python?

I am trying to create a simple AI program which plays stick game. The problem is that I would like to subtract chosen stick from the total stick number. This simple code shows some error such as nonexisting value. I could not assign returning value…
vrd.gn
  • 198
  • 1
  • 18
-1
votes
1 answer

C++ multiple definition of struct functions

Sorry for the noob question.. devf.h #ifndef DEVF_H #define DEVF_H #include struct A { int ax(); std::string ay(std::string jj); }; struct B { struct A* f; int bx() { return f->ax(); } …
LeAdErQ
  • 45
  • 10
-1
votes
1 answer

Regular expression that matches java method definition

I am trying to find lines with methods definitions in a file. For example, the line is: // line has TAB indent public Stream requestDifferences(List commitIds) { The regular expression that I'm trying to use…
-1
votes
1 answer

What is a clean way to have function1 call function2 and have function2 call function1?

My question is about recursion, but is slightly more complicated than than the typical case. Usually, a recursive function calls itself: int functionName(int x) { if (x meets condition) { return x; } else { x =…
Toothpick Anemone
  • 4,290
  • 2
  • 20
  • 42
-1
votes
1 answer

Understanding what php daemons are

I just Google "What is a php daemon" but I only recieved result on how to create php daemon. Please can someone clearly explain to me the concept behind it? It will help me for my test. Thank in advance...
Kamga Simo Junior
  • 1,679
  • 2
  • 16
  • 30
-1
votes
1 answer

Is a prefix or postfix operator in the global scope a side effect?

From Wikipedia: In computer science, a function or expression is said to have a side effect if it modifies some state outside its scope or has an observable interaction with its calling functions or the outside world. From You Don't Know JS There…
Gwater17
  • 2,018
  • 2
  • 19
  • 38
-1
votes
2 answers

About the method "select" and "join"

so I posted a question earlier about displaying factors of non-prime numbers and got this as a solution. Below is a part of the code, but I have a little bit trouble understanding a few terms in them (since I am relatively new to ruby). def…
Vroryn
  • 125
  • 6
-1
votes
1 answer

Gang of Four - definition help!

I've got a question about the following terms..what do they mean in terms of a strategy pattern? Algorithm Interface Context Interface Class Strategy Class Context Attribute Strategy Concrete Strategy And their hierarchy... In other words, what…
D. Spigle
  • 541
  • 2
  • 5
  • 15
1 2 3
99
100