return Questions
6
Solved
I am a Ruby programmer who has ended up developing a code generate for C. Its like asking a Limo to tow a 1960s truck. Any way.
Here is what I thought should work but doesnt work.
float[][] pixel...
9
Solved
I am told to
Write a function, square(a), that takes an array, a, of numbers and returns an array containing each of the values of a squared.
At first, I had
def square(a):
for i in a: print i...
4
Solved
I am writing library which wraps a lot of functions and methods from other library. To avoid coping of return values I am applying std::forward like so:
template<class T>
T&& wrapper...
Portwin asked 18/10, 2012 at 6:4
8
Solved
I was wondering if it was possible to do a ternary operation but without returning anything.
If it's not possible in Java is it possible in other languages, if so which ones apply?
name.isChecked...
10
I'm still new to python and have been trying to get the hang of it. I've been trying to learn simple return methods but I can't seem to get the hang of it.
I have been trying to find the distance ...
5
Solved
I am currently in a personal learning project where I read in an XML database. I find myself writing functions that gather data and I'm not sure what would be a fast way to return them.
Which is g...
Brockway asked 15/8, 2010 at 14:34
5
Solved
I’m using Spring 3.2.11.RELEASE and JUnit 4.11. Using the Spring mockMvc framework, how do I check if a method returning JSON data contains a particular JSON element? I have
mockMvc.perform(get("...
8
Solved
Consider the following snippet:
void Foo()
{
// ...
}
void Bar()
{
return Foo();
}
What is a legitimate reason to use the above in C++ as opposed to the more common approach:
void Foo()
{
/...
3
Solved
It's fairly well documented that foreach processing speed varies depending on the way a foreach loop is carried out (ordered from fastest to slowest):
.ForEach() method
foreach ($item in $collecti...
Votive asked 15/12, 2023 at 4:50
8
I can't understand exactly how return works in try, catch.
If I have try and finally without catch, I can put return inside the try block.
If I have try, catch, finally, I can't put return in the...
4
Solved
I have browsed around and other solutions don't seem to be working for me here. I keep getting a 'No return found for function' error when trying to create this function in MySQL. Any idea why?
CRE...
Ballman asked 17/9, 2012 at 1:11
10
Solved
JavaScript:
function getValue(){
var num1 = document.getElementById("firstNum").value;
var num2 = document.getElementById("secondNum").value;
return (num1, num2);
}
function add(){
getVal...
Odelle asked 14/3, 2015 at 1:26
21
Solved
13
Solved
I have a number of functions which either return something or throw an error. In a main function, I call each of these, and would like to return the value returned by each function, or go on to the...
Proceeds asked 23/4, 2011 at 12:15
52
Solved
Considering this code, can I be absolutely sure that the finally block always executes, no matter what something() is?
try {
something();
return success;
}
catch (Exception e) {
return fai...
Gridley asked 15/9, 2008 at 17:43
2
Solved
I would like to write an R function that returns silently, like what I get from the barplot function for example.
I mean that I can store an output in a variable if I do output = myfunction(), but...
1
Solved
If I am not mistaken, it is allowed to write return void() in function templates to avoid unnecessary specializations and overloads for void type.
At the same time, a similar syntax return vo...
Literator asked 20/6, 2023 at 19:10
9
I have this piece of code which creates a new note. When I try to print, I get the following error even though it prints the output:
Error:
C:\Python27\Basics\OOP\formytesting>python notebook.py...
Holy asked 8/8, 2012 at 18:53
10
I want to get a return value from Javascript in Android. I can do it with the iPhone, but I can't with Android. I used loadUrl, but it returned void instead of an object. Can anybody help me?
1
Solved
I have a program that behaves differently in GCC and Clang. After simplification the minimal reproducible example is
struct A {
int i;
};
struct Finisher {
A & a;
~Finisher() { a.i = 1; }
}...
Tocsin asked 2/6, 2023 at 18:26
8
Solved
I'm looking at a path finding tutorial and I noticed a return statement inside a void method (class PathTest, line 126):
if ((x < 0) || (y < 0) || (x >= map.getWidthInTiles()) || (y >=...
10
Solved
Is there a way to return several values in a function return statement (other than returning an object) like we can do in Go (or some other languages)?
For example, in Go we can do:
func vals() (...
4
Solved
I have this function that calls itself:
def get_input():
my_var = input('Enter "a" or "b": ')
if my_var != "a" and my_var != "b":
print('You didn\'t type "a" or "b". Try again.')
get_input()
...
3
Solved
I'm writing a function that returns a serde_json::Value upon success (and failure). Previously in Rust I have been omitting the semicolon to return data from a function, like in the code example be...
Neume asked 23/11, 2019 at 23:52
7
I have an issue with a textarea that is defined on an asp.net page. The textarea is populated in the back end with text read directly from an mssql database.
<div id="emailForm" runat="server" ...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.