Quantcast
Browsing latest articles
Browse All 203 View Live

window.opener.returnValue in Chrome with showModalDialog

I am trying to use window.opener.returnValue with showModalDialog. There are numerous references to a technique which can be used to workaround window.returnValue not working. However it just doesn’t...

View Article


is it possible to return two vectors from a function?

Im trying to do a merge sort in cpp on a vector called x, which contains x coordinates. As the mergesort sorts the x coordinates, its supposed to move the corresponding elements in a vector called y,...

View Article


React to return value of a function not working properly

I'd like to react to return value of a function, but my code is not working properly:#!/bin/bashclearecho $(sudo pacman -Rcs "$(pacman -Qdtq)")if [[ $(sudo pacman -Rcs "$(pacman -Qdtq)") == "Error:"*...

View Article

In C++, is the overloading of the arrow operator an exceptional case or does...

I have a question regarding the arrow operator's overload process. The overloading makes it seem like it is a unary operator, while the usage makes it appear as a binary operator. The return value...

View Article

Why the method doesn't work, however the same algorithm in another method works?

I have a database with Entity Framework, using a repository design pattern. There's a method in my repository which gets two inputs, an entity and an IQueryable<Entity> collection. The method...

View Article


Can a specific element from the array returned from a function be directly...

If myFunction returns an array, is there a simpler way of doing this?$result = myFunction($parameters);$result = $result[4];

View Article

jQuery Ajax returns the whole page

I have a jquery-ajax function that sends data to a php script and the problem is with the return value, it returns the whole page instead of single value.$("#ajaxBtn").click(function(){ var inputText =...

View Article

How to force compilation error if function return value is not checked?

I want the compiler to emit an error if I'm using a specific function without checking its return value.I'm using GCC in eclipse.For example :int fun (){ return 3;}void main (){ printf("%d",fun ());}I...

View Article


How to detect QObject::moveToThread() failure in Qt5?

The documentation on QObject::moveToThread() for Qt5.3 explains that the moveToThread() method can fail if the object has a parent. How would I detect this failure in my code?I realize that simply...

View Article


import script value in different script with new results (diceroller)

I'm learning to write python to create scripts to automate stuff for DD.And I'm positive that there most likely is a built in solution for this.I have certain functions from external scripts that I...

View Article

Ruby quirk: Using 'return' to get a nil value

I am doing a problem at Rubymonk where I have to test if an array is 'nil' before doing an operation (adding items inside a nested array but that is not really relevant to the question). I notice,...

View Article

Return type for *this in a builder-class method - lvalue vs rvalue refence

Suppose I have a "builder" class B which builds a class C, and looks somewhat like the following:class B {public: // ... B& set_foo(Foo a_foo) { foo_ = std::move(a_foo); return *this; } C build()...

View Article

How is the return value of a method ignored in Java? [closed]

I'm trying to understand how the return value of the HashSet.add() method is handled in Java when it's not used in a condition or assigned to a variable. Here's an example of what I...

View Article


What should main() return in C and C++?

What is the correct (most efficient) way to define the main() function in C and C++—int main() or void main()— and why? And how about the arguments?If int main() then return 1 or return 0?

View Article

What's does a bash function return when there is no “return” statement?

Is the return value of a bash function the status of the last executed command?I wrote this test and it looks like it's so. I just want to verify. No one has asked this question before apparently and...

View Article


Are two dictionary lookups triggered when assigning and returning a...

Consider this C# example:public sealed class TestClass { private Dictionary<string,int> myDictionary = []; public int TestMethod() => myDictionary["foo"] = 3;}Internally, when TestMethod() is...

View Article

Creating a custom filter [duplicate]

I am wanting some help with inputting a value into a filter line. The variable in the raw dataset changes it's name each year to the corresponding year and I don't want to replace it in all the code...

View Article


Return multiple values from a function, sub or type?

So I was wondering, how can I return multiple values from a function, sub or type in VBA?I've got this main sub which is supposed to collect data from several functions, but a function can only return...

View Article

How to call a function and return data from a function to the global scope?

I created an HTML form that, on submit, opens submit_form.php. Inside, I process the data entered into the form and send a confirmation email. I wrote a function for the mail-sending-process.Inside the...

View Article

Platform dependent implementations with return values do not work in MAUI

I have problems to implement any platform dependent classes in a MAUI project. The compiler produces errors if I use a method which has a return value.I implemented the function first for each platform...

View Article

Return a QString from a function - thread safe?

I'm new to Qt - but this may be a very basic c++ issue. I have a simple function that returns a QString:QString testclass::myfunc(int i){ QString result; switch (i) { case 1: result = "one"; break;...

View Article


Best practice: ref parameter or return value?

Actually I am doing a list as a reference parameter as follows:public static List ListMethod(List result)I saw some people doing in this way too:public static void ListMethod(ref List result)If I'm not...

View Article


Return multiple values from a C# asynchronous method

I have worked with asynchronous methods and the methods which return multiple values, separately. In this specific situation, following "GetTaskTypeAndId()" method should be asynchronous and should...

View Article

Should accessors return values or constant references?

Suppose I have a class Foo with a std::string member str. What should get_str return?std::string Foo::get_str() const{ return str;}orconst std::string& Foo::get_str() const{ return str;}What is...

View Article

Return value in a Bash function

I am working with a bash script and I want to execute a function to print a return value:function fun1(){ return 34}function fun2(){ local res=$(fun1) echo $res}When I execute fun2, it does not print...

View Article


What does it mean to return a value?

I'm fairly new to programming, and I'm confused about what it means exactly to return a value. At first, I thought it meant to output what value is being returned, but when I tried that in my own code,...

View Article

Android Bluetooth - createBond return value

I am working on a Bluetooth application. It consists, among other things, of a list view displaying the paired and visible devices. Long clicking on the unpaired ones opens up the pairing dialog which...

View Article

How to catch the duration and return value of many python parallel sub-process

I need to write some code in python that launches 8 processes in parallel and that, for each process, is able to report their return value and their duration in microseconds.Unfortunately I don't know...

View Article

Is there a "return NULL" equivalent for return-by-reference functions?

I'm working with existing code that returns a reference, something like this:int &func(){ static int i = 5; return i;}I would like to return an error case as "NULL" but of course NULL doesn't work...

View Article



Return instance by value from a method stack compilation

Can you explain why this won't compile:(this is the error: ../Man.cpp:33:9: error: conversion from ‘Man (*)()’ to non-scalar type ‘Man’ requested)Code:Man goo(){ Man m(); return m;}but this does:Man...

View Article
Browsing latest articles
Browse All 203 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>