Quantcast
Browsing all 206 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Assigning points based on quartiles (percentiles) according to a grouped...

Good day to all!I have a table with tasks that one or another counterparty (person) performsMy task is:Group the data by counterparty and how many tasks he completedFind the value of 25% 50% 75%...

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


Javascript .test regex not work in some cases [closed]

I have given html and these two functions. Idea is I need to display alert when user type non latin characters<div id="card-personalize-text" contenteditable="true" spellcheck="false"...

View Article

How to use objects in C++ correctly

After finally having learnt most of the basics of C++, there is still on puzzle part which is missing. Let's take for example:class MyClass {/// ...};void f1(MyClass& cl) {}void main() { MyClass...

View Article

function returning a reference [duplicate]

I am a bit puzzled about why one can safely writegetValue() = 5;in the below. The left hand side is a function. Why can we set that to 5? int& getValue() { static int value = 10; return value;}int...

View Article


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

Returning different data type depending on the data (C++)

Is there anyway to do something like this?(correct pointer datatype) returnPointer(void* ptr, int depth){ if(depth == 8) return (uint8*)ptr; else if (depth == 16) return (uint16*)ptr; else return...

View Article

Image may be NSFW.
Clik here to view.

Excel return Price based on invoice date

I need help with returning a product price based on its invoice date.F.e. I have a product that has been sold on 2023-11-27 for 50 Eur. There are two different pricelists: EUR and USD. Since it has...

View Article


Check if child exist in firebase database and return true or false [duplicate]

I want to create method that will check if a child is present or not in firebase database and returns the value true or false accordingly. here's my codepublic boolean...

View Article


Why return a negative errno? (e.g. return -EIO)

Another simple example:if (wpa_s->mlme.ssid_len == 0) return -EINVAL;Why the unary minus? Is this (usually) done for functions that return >0 on success and <(=)0 on failure, or is there some...

View Article

Buffer Overflow Exploit to Redirect Execution to Another Function Causes...

I am working on a security engineering assignment where I need to create a buffer overflow exploit to change the execution flow of a C program. The goal is to overwrite the return address and redirect...

View Article

Python ctypes return values question

Why if i have this simple codevoid voidFunct() { printf("voidFunct called!!!\n");}I compile it as a dynamic library withgcc -c LSB.c -o LSB.o gcc -shared -Wl -o libLSB.so.1 LSB.o And i call function...

View Article

Golang closure not storing captured variables?

In this block of code below, I expect the output to be 0, 1, 2, 3,..., 9. However, only the output 10, 10,...,10 is produced.package mainimport "fmt"func adder() []func() { out := []func(){} for i :=...

View Article


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

Return value from specific javascript function in Playwright

I need to extract value that was created after running some script. My tests are written in Playwright.So, I have a javascript that return some id from locator on page. it looks...

View Article


Python Dict returned from Method has same ID if not assigned [duplicate]

I need more clarification on how python handles the mutable objects when used in return statement. def dict_return(): d = {'a': "1234"} return dd1 = dict_return()print("d1 ID: ", id(d1))d2 =...

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


Get UpTime from powershell into a usable way, but can't get it to work

I've been making this program where i need to send a command to powershell and in return it gives me the sys UpTime (minutes work better but not mandatory)As i'm still not used to using powershell, i'm...

View Article

Store result of json request in a variable [duplicate]

I need to store a value of json response to use in another function.I have this code:const url_moodle = "https://xxxxx/xxxxx/app/appmoodlejson.php";var moodleEmail = function (email){ $.post(...

View Article

Return value only

I want to print the mean and the median calculated from an array of integers. Here is my code:// I create and populate the int arraypublic static int[] populateArray(Scanner input) { int[] array = new...

View Article
Browsing all 206 articles
Browse latest View live


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