1,151 questions
2
votes
3
answers
275
views
Why void() redefines a function in C++?
Given this function:
int f() {return 10;}
void(f()) defines a void f() and doesn't compile with the following error:
'void f(void)': overloaded function differs only by return type from 'int f(void)'...
-1
votes
1
answer
79
views
Node / express / ejs / Uncaught SyntaxError: missing ] after element list
I'm running a express server and render a list.
This is the code of the route:
try {
let result = await servCollections.prepareDataForListCollections();
let colls = result.data;
let ...
0
votes
1
answer
146
views
In Spring AI version 1.0.0-M6, the stream() method fails to trigger function calls
function call not OK
@GetMapping(value = "/tools", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<String> chat() {
System.out.println("tools...");
...
0
votes
1
answer
55
views
Test event handler registration using pytest
Consider a module that allows to register event handlers and fires them at some condition:
# mymodule/myfile.py
_event_handlers = []
def register_event_handler(handler):
_event_handlers.append(...
0
votes
2
answers
87
views
How to return the COUNT of two different parameters?
I'm trying to return how many 'males' or 'females' are counted in each specific event for the products brand name column.
I tried to use subqueries and use the same syntax for both genders. Since I ...
3
votes
0
answers
255
views
File Search tool stops working when I enable custom function calling
I'm building a chatbot using OpenAI's Assistant (beta) and want to combine:
File Search – so the assistant can retrieve information from my uploaded PDF/manual (stored in a vector store).
Function ...
2
votes
1
answer
419
views
What is the better way to pass a hashmap as Argument?
Currently learning zig, but I am stuck with a problem about passing a hashmap into a fucntion. Although I have a working solution, I am not satisfied with using the anytype keyword, and I am seeking ...
3
votes
0
answers
509
views
Vertex AI Function Calling (using response)
I need to implement a chatbot that uses helpful functions for calling to interact with the database. This is a sandbox task from the laboratory
I have a problem sending the model a ready API response ...
8
votes
2
answers
2k
views
Llama3.2 fails to respond to simple text inputs when bounded with tool calling on LangGraph
I am following along a LangChain tutorial for LangGraph. They are using OpenAI models in the tutorial. However, I want to use my local Ollama models. I am using Llama 3.2 as that supports tool ...
1
vote
1
answer
92
views
Why is my Apps Script Trigger Not Working when it works manually?
I am trying to rename file names in a google drive folder as they appear.
It works completely fine when I run this manually but when the automatic trigger is triggered, it fails every time.
Manually ...
0
votes
1
answer
85
views
a float function returning 1.#QUAN0 instead of the actual values
I have written this program to give me the value of i exposed to the power of j using recursion. As I am a student, practicing different methods of solving the same problem might be beneficial for me. ...
1
vote
1
answer
121
views
Why do I get a syntax error using the ternary operator with function calls?
I'm writing a code in SystemVerilog, and I'm trying to use the ternary operator to decide between two function calls. Here's my code:
module tb;
int a = 1, b = 4;
initial begin
b > a ? $...
0
votes
1
answer
97
views
How to query the vector database in LangChain AgentExecutor, invoice before summarizing the 'Final Answer' after all tools have been called?
How to query the vector database in LangChain AgentExecutor, invoice before summarizing the 'Final Answer' after all tools have been called?
LangChain AgentExecutor code:
llm = ChatOpenAI()
tools = [...
0
votes
3
answers
121
views
Convert a complex string representation of a list (containing tuples, which look like function calls) into a list
I am trying to create a fixture for unit testing. I retrieve data from an API and need data that looks like what I get from the API without making the call to the API. I need to create a number of ...
2
votes
0
answers
68
views
The EVM executes a part of the bytecode instruction
Recently, I have been working on inserting a function call into an existing smart contract function at the assembly level. I successfully inserted the function call (b) into an existing function (a), ...
2
votes
1
answer
55
views
js rewrite prototype.call, but why did "RangeError: Maximum call stack size exceeded" appear
Function.prototype.call = function(point,...arg){
console.log('ok');
const key = Symbol('key')
point[key] = this
const data = point[key](...arg)
delete point[key]
return data
}
...
1
vote
1
answer
163
views
iframe postMessage alternatives existing? Eg. bind functions to iframe?
Context
Accessing a document in an iframe from a parent window and accessing a parent window's document from an iframe is possible without CORS or when each iframe's document's origin is the same as ...
0
votes
0
answers
58
views
Why can inconsistent function names be called correctly in the scenario of calling functions defined by c++in python code?
I saw a project on GitHub that involved Python code to call functions defined in C++.
Strangely, the function name defined in C++ is A, but it can be called through the name B in Python, where A and B ...
2
votes
2
answers
349
views
How to build when __builtin_va_arg_pack() is used
For purely educational purposes, I am trying to write examples with the "Constructing Function Calls builtins" (https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/Constructing-Calls.html#index-...
1
vote
0
answers
111
views
How to get an array of custom-typed objects, returned by a function, with IDA Appcall
let assume we have a structure defined in local types:
struct Human {
char* name;
int age;
double height;
};
and the prototype of the function i need to call:
const Human**__fastcall ...
0
votes
1
answer
48
views
How do I iterate over a vector's index if calling it using a function handle when solving with ODE15s?
I'm trying to solve for a vector k (reaction constant) that gets updated every time T is updated, and that new value of k is used to find the next T and so on. But the first time T is called for each ...
-1
votes
2
answers
203
views
too few arguments provided to function-like macro invocation (in included file) [closed]
I have a Qt project
Got this error in file "lab2.h" next to the line with the include directive (signed next to it)
#ifndef LAB2_H
#define LAB2_H
#include <QWidget>
#include <...
0
votes
1
answer
104
views
How to resolve this loop call caused by property changed in qml, can I stop binding somewhere?
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
Window {
width: 640
height: 480
visible: true
title: qsTr("Hello World")
property int anum: ...
0
votes
2
answers
162
views
Global variable isn't being recognized across functions in python with tkinter
So I'm pretty new to python so this could be an easy issue that I just don't understand what's going on here. But essentially I have a dropdown that allows you to choose a character, and then display ...
3
votes
1
answer
101
views
Does extracting values from a multiple Value return in Haskell invoke the function more than once?
For disclosure, I'm rather new to Haskell and am figuring out the syntax. Let me illustrate my question with an example. Let's say you have a function which returns a tuple of several values or a data ...
0
votes
0
answers
27
views
How to trigger a function both at click on an element and while landing on a page, preserving $(this) selector [duplicate]
I have a set of Accordion(s) (better say, a set of expandable sections in a single page), each of one could be identified by a custom ID (as side note, is a Liferay 7.4 custom fragment).
I'd need to ...
0
votes
0
answers
41
views
function calls itself multiple times in javascript when come back to same option in select dropdown
this is for particular index i.e.(index == 2).
first time when page loads then it will works normally(function calls itself only one time).
when I come back to same option by changing the select ...
0
votes
1
answer
525
views
Issue with @azure/openai npm package - Empty toolCalls in response
I am currently using the @azure/openai npm package for Node.js to interact with the GPT-4 model. I have noticed that the toolCalls in the response are empty, even though I have included tools in my ...
0
votes
1
answer
84
views
How do I create a macro that will run multiple already created macros
So if I have the following macros:
Pmoney
Psteel
Ptitanium
Pplant
Ppower
Pheat
and I would like to create a new function/Macro that will run all of the above at once.
I understand there is a Call ...
1
vote
0
answers
811
views
OpenAI Function Call using Langchain returns inconsistent response
I have a question for folks who have already tried out OpenAI function calling with Langchain. I am not getting a consistent response from Langchain.
Sometimes I get the below response, where the ...
1
vote
1
answer
1k
views
openai.error.InvalidRequestError: 'type' is a required property - 'tools.0' in openai function calling
I am trying to use function calling of openai. However, it throws an error. The code is given below:
import openai
def fetch_weather_with_openai(location, unit='celsius'):
"""
...
0
votes
0
answers
240
views
Why does far call "call far ptr label" MASM syntax not work as intended?
I have been trying to set up a 0x9A, absolute far call using MASM syntax in 32 bit mode and despite my code assembling succesfully, the result will always be call far 0:0. The valid MASM syntax call ...
0
votes
1
answer
800
views
WPF: can I call a method from the xaml file that is in another class?
I am working on a WPF project, and I implemented the MVC -Pattern for my application .
So I have the MainWindow.xaml and MainWindow.xaml.cs as the View, and then a Controller and a Model class (first ...
1
vote
1
answer
90
views
R function call in error using mixR package
I have a dataframe and I want to fit a mixR model for each column and print the plot. The code without using function without any problem, but when it was called in a function, an error happened. I ...
0
votes
1
answer
665
views
'openai' function_calling not execute the function
Using function calling, 'openai' does not execute the function, but it prints the function with parameters. Please see below:
I am using a local LLM (LLaMA 2) in Colaboratory.
'openai' version ...
0
votes
1
answer
47
views
return value not matching loop
my code is split into two pydev files. Functions.py and t12.py. My problem is that when I call the function and the for loop runs, the final value of the loop and the value I call from the t12 ...
0
votes
0
answers
23
views
How does CALL in Assembly work? Does it return again to execute the further instructions? [duplicate]
start:
mov $0, %eax
jmp two
one:
mov $0x1234, %eax
two:
cmp $0x1234, %eax
je done
call one
mov $10, %eax
done:
jmp done
I have a doubt that when cmp in two is ...
0
votes
2
answers
160
views
Does/can C++ optimize away call to a function argument?
Let's assume this function template:
template <typename F>
void foo(F&& f) {
f("foo");
}
void to_optimize() {
foo([](std::string_view s) {
std::cout << s <&...
0
votes
1
answer
662
views
Nested use of RET instruction in ARMv8
Let label1, label2 be two set of instructions both ending with a RET instruction, and such that label2 branches to label1 with a link. In other words, we have a code that looks like this (I will ...
2
votes
0
answers
64
views
How to call shared object function (loaded dynamically) from pointer in Go?
I try to call few shared object functions from Go. I don't want to write a C commented code to build a CGO interface for all functions.
I write my shared object like that:
#include <stdio.h>
...
0
votes
1
answer
81
views
Why does the result come out like this when I use a function? [duplicate]
#include <stdio.h>
int apple(int total, int ate);
int main(void) {
printf("If you eat %d out of %d apples, there will be %d left.\n",
4, 10, apple(10, 4));
...
-2
votes
1
answer
614
views
binding reference of type 'type' to value of type 'const type' drops 'const' qualifier
This issue looks like known one. but i have no any const in types.
What I am missing?
I have the following code:
class PlanForBlock
{
public:
void registerExtraIterator(DummyLoadIterator *...
-2
votes
2
answers
94
views
Function return a string and frintf() behavior in C language
I am learning how to function return a string in C. It has 2 ways: use static char array or use malloc. I have some experiments with source code be like:
#include <stdio.h>
#include <stdlib.h&...
0
votes
2
answers
122
views
C++ "Undefined" vs "Unspecified" behavior for function calls: f(i=-2, i=-2) is no longer undefined vs f(++i, ++i) is unspecified [duplicate]
I know this is one of those "undefined behavior" questions, but a current cppreference page on the subject (as of C++23) itself gives two example's that I'm having trouble understanding from ...
1
vote
2
answers
145
views
Adding/deleting the first element in a linked list
I am trying to insert/delete the first element in a linked list but in case of insertion it is not adding it and in case of deletion it starts a infinite chain, I am unable to identify the issue.
I am ...
1
vote
2
answers
316
views
why is strtok() not working properly in my C program?
I'm trying to develop a small console program that spits a string into separate words (i.e. tokens). Most of the program is working but I'm having a problem with the strtok() function. I have reviewed ...
1
vote
2
answers
88
views
Use Prolog to bind a letter to a given integer such as in class grades
I need to use Prolog to bind a letter grade for a given integer grade value (>= 90 is a, >= 80 is b, and so on.)
I am trying to write a function such as this:
evaluate_grade( X , F ) :- X \&...
0
votes
1
answer
275
views
Using Excel Spreadsheetdata to import ( ,move and resize) shapes into Visio
I'm a little stuck at the moment. I try to use excel data to import and move/resize shapes into visio.
I have a running gui to let the user select all the things he need, but the code did not run ...
3
votes
1
answer
265
views
How does Rust return large types (before optimisation)?
With a function signature such as:
pub fn hash(input: &[u8]) -> [u8; 32]
how do those 32 bytes get passed to the calling function? (Before optimisation, which might place some parts in ...
1
vote
3
answers
157
views
Why does the execution order of function call arguments not follow the specified order?
I am reading the book of CPP-Concurrency-In-Action-2ed-2019. In chapter 5.3.2, the author gives a simple example:
#include <iostream>
void foo(int a, int b)
{
std::cout << a << &...