Skip to main content

Questions tagged [lambda]

DO NOT USE FOR THE AWS SERVICE (use [aws-lambda] for those questions!) Lambdas are anonymous functions or closures in programming languages such as Lisp, C#, C++, Lua, Python, Ruby, JavaScript, Java, Excel or Google sheets. (Also, lambda expression.)

Filter by
Sorted by
Tagged with
3 votes
0 answers
86 views

If a lambda is capture-less, its closure type has conversion operator to function pointer. For example, ...
Fedor's user avatar
  • 25.2k
0 votes
0 answers
48 views

In an effort to simplify some of my code, I tried using a switch expression to create a selector for sorting on an EF Core 10 query: ...
theodinspire's user avatar
5 votes
1 answer
147 views

I wrote the following program that is accepted by MSVC, but is rejected by both GCC and CLANG. What is the standard compliant behavior? Live Demo ...
Richard's user avatar
  • 49k
5 votes
1 answer
148 views

A colleague of mine showed me a program with explicit object parameter in a lambda function. The program is accepted by two compilers, but produces a strange result: ...
Fedor's user avatar
  • 25.2k
1 vote
1 answer
128 views

These two examples accomplish the same thing: # using eval var=hello eval "some_func() { echo $var; }" some_func # "hello" ...
Caleb Foster's user avatar
3 votes
1 answer
109 views

I'm trying to pass a click handler to a child function that sends a string back to the parent and updates a mutable value based on the string. I'm getting an error on the function: Assignment type ...
SmellydogCoding's user avatar
0 votes
1 answer
74 views

Snowflake supports higher order functions like FILTER or TRANSFORM. A lambda expression that defines the filter condition on each array element. The lambda expression must have only one argument ...
Lukasz Szozda's user avatar
4 votes
3 answers
351 views

Consider the code below: for (T &t : some_vector_) { futures.push_back(thread_pool.submit([&t] { t.do_something(); })); } On some iteration ...
Jack Humphries's user avatar
Advice
0 votes
2 replies
85 views

Following is a part of the execution sequence when a middleware gets configured in ASP.NET Core - ...
atiyar's user avatar
  • 8,405
2 votes
3 answers
145 views

I have a dataFrame with columns Age, Salary and others, if I used: df['Age'] = df['Age'].apply(lambda x : x+100 if x>30 else 0) Then I can modify the Age column ...
Edy's user avatar
  • 33
0 votes
0 answers
97 views

Problem I'm trying to set up Datadog APM tracing for my AWS Lambda functions (Node.js/TypeScript), but traces are not appearing in the Datadog APM UI. Custom metrics are being collected successfully, ...
Rami Rosenblum's user avatar
1 vote
3 answers
153 views

I want to pass a QString into a lambda slot-function to modify it further. Unfortunately the QString goes out of scope before ...
Me3nTaL's user avatar
  • 535
1 vote
1 answer
152 views

I'm trying to implement a lambda function (for educational purposes) to initiate an array to append to the front of potentially encrypted data to save information like salt and initiation vector, ...
Lucy's user avatar
  • 125
-1 votes
1 answer
55 views

I have a Lambda@Edge function which has 2 versions. Version 1 has non-functional code and version 2 has the latest operational code. What that function does is it fetches an object from an S3 bucket ...
ShanWave007's user avatar
0 votes
1 answer
59 views

I'm trying to provision a lambda on a free localstack instance. As such, I cannot build the lambda as an image and push it into localstack's ECR because ECR is a paid resource. So I'm taking the ...
QuisEs99's user avatar
1 vote
1 answer
58 views

I'm working on updating some Kotlin code that depends on arrow-kt. As part of the migration process from arrow 1.2 to 2.x, I need to get rid of arrow partiallyN() ...
pbuchheit's user avatar
  • 1,839
1 vote
1 answer
59 views

I want to use a function in my orderBy clause. To my great surprise I can't find a way in the official documentation to do this without executing raw SQL in Prisma. ...
Petr 's user avatar
  • 23
-1 votes
1 answer
128 views

I'm trying to caputure a variable by value into a lambda, and I want to point out the nature of the by-value capture explicitly, as it is essential for my code to work the way it is intended. My code ...
Michael Karcher's user avatar
15 votes
1 answer
1k views

Why does this code compile? ...
Teskann's user avatar
  • 163
2 votes
2 answers
142 views

...
neg's user avatar
  • 21
1 vote
2 answers
134 views

SONAR's cpp:S5213 rule says that Template parameters should be preferred to "std::function" when configuring behavior at compile time We have tried implementing that by replacing ...
bers's user avatar
  • 6,341
1 vote
0 answers
57 views

I have tried to import mongodb into my lambda function and I keep getting an error message when I attempt to test it. All the recommended resolutions I have seen assume I am working in an environment ...
Daniel DeLuca's user avatar
0 votes
0 answers
37 views

We are using pg Pool in our Lambda function. Our connectDb function looks like this: ...
krishnadev's user avatar
0 votes
0 answers
44 views

I'm doing a programming assignment for my class. One of my programs includes creating a BST with Python within a BST class, and I'm trying to display using preorder() and inorder() functions. My ...
selena's user avatar
  • 1
3 votes
1 answer
144 views

I've created this LAMBDA function and called it STR2ARR (note: yes, I know there are other functions in Excel that can do this, but I'm trying a concept that I want to use in a bigger LET/LAMBDA ...
Koen Rijnsent's user avatar
-4 votes
3 answers
151 views

I'm learning about higher-order functions, specifically lambda functions in Python. I understand lambda functions to an extent, but a little confused about this lambda higher-order function example. ...
Cordev87's user avatar
3 votes
3 answers
162 views

I am trying to write a lambda function for use in a groupby, which counts the total number of failed grades (grades below 6) for each store. However I cannot seem to figure it out. It seems that there ...
Jelmer's user avatar
  • 41
14 votes
1 answer
409 views

Why does this code output garbage on GCC, like there is UB? ...
Sprite's user avatar
  • 4,169
2 votes
0 answers
63 views

I just learned that in rust if you want to pass a reference in lambda: ...
Holiday Tom's user avatar
1 vote
1 answer
107 views

Since I learnt to use Google Test/Mock framework, I allways used the form to setup an expectation as following: ...
Leon's user avatar
  • 2,165
0 votes
1 answer
126 views

Is there a simple way to return 0 with a lambda function using and and or operators? For ...
david's user avatar
  • 1,593
0 votes
0 answers
153 views

I'm facing an issue related to MongoDB connections while sending push notifications to users three times a day — morning, noon, and evening. I have a Lambda-based service that uses SQS and MongoDB. A ...
Muhammed Ladeed's user avatar
1 vote
2 answers
152 views

So I was trying to come up with a way to split a given parameter pack args... into two separate packs args1... and ...
Orbit's user avatar
  • 23
0 votes
1 answer
72 views

I've been facing an issue deploying AWS Lambda Step Functions with sst. I created this minimal GitHub Project to demonstrate the issue. It's not clear to me if this is a bug in the SST implementation ...
Chris Hanson's user avatar
  • 2,083
0 votes
1 answer
108 views

This is my aws config code ...
nafhaf's user avatar
  • 11
3 votes
3 answers
251 views

If I assign a lambda in C++ with this: auto&& mylambda = [&](int someparam) { some_function(); return 42; }; Is this wrong? I know that this ...
Dean's user avatar
  • 7,044
0 votes
1 answer
193 views

Consider the following code: int main() { int n = 0; return [n] { return n; }(); // ok } According to https://cppinsights.io, the code above will be ...
xmllmx's user avatar
  • 44.7k
-3 votes
1 answer
111 views

I'm updating a tracking spreadsheet for a stock portfolio and would like to dynamically pull the holdings of the portfolio at specific time periods so that I can view the holdings at any point in time,...
Gimics's user avatar
  • 11
0 votes
2 answers
145 views

Consider the following code: int main() { auto const fn = [] mutable {}; fn(); // ok, why? } As per the latest C++ standard draft [expr.prim.lambda.closure]...
xmllmx's user avatar
  • 44.7k
-2 votes
1 answer
101 views

I was looking through the code of AutoMapper ASP.NET Core dependency injection, and in the AddAutoMapperClasses, I saw that they declared a lambda expression after ...
Architek's user avatar
  • 135
0 votes
2 answers
78 views

How to use EF Core Fluent API to get inheritance properties? I have a base class and 2 inherited children classes: ...
Dongdong's user avatar
  • 2,538
-2 votes
1 answer
68 views

I have a list of Objects which have a location [Rect]. I then select from this list, all Rects that fall inside a 'Column' (Left>x1 && Right<x2) What I need to to now is find all Rects ...
Richard Harrison's user avatar
2 votes
1 answer
123 views

I'm designing a P2P messaging application using Swing, and have been running into serious issues when it comes to organizing my GUI component ActionListeners. Each <...
jinzōningen's user avatar
0 votes
0 answers
135 views

I'm working with AWS Lambda function that serves as the backend for an API Gateway endpoint using Lambda Proxy Integration. My Lambda handler is structured like this: ...
thecodingaviator's user avatar
-3 votes
1 answer
56 views

I am working on lambda project; I am fetching data from a SQL Server database and passing it to an API, and then that data is saved to another SQL Server database table through AWS lambda. The issue ...
Pratex's user avatar
  • 127
1 vote
1 answer
57 views

I'm streaming a remote pdf to an S3 bucket, but the binary is rendering on the client. Any idea how I modify this code so it doesn't display the pdf on the client? ...
Ryan W's user avatar
  • 11
1 vote
1 answer
65 views

Apply a lambda function while appending to a list pretty much asks exactly what I want, and the solution there is fine, but I wanted to know if there was a way to directly get the result of a lambda ...
Draven Dracuss's user avatar
1 vote
1 answer
93 views

In this example; const int x = 10; auto y = [x=x]() {++x;}; When using init capture in a lambda, does it drop the const qualifier of the captured variable? Here ...
Ayşenur Bolat's user avatar
4 votes
1 answer
164 views

int main() { auto fn = []<typename T>(this auto&& self, T n) { if (n > 0) { self(n - 1); } }; fn(3); } ...
xmllmx's user avatar
  • 44.7k

1
2 3 4 5
607