Skip to main content
Filter by
Sorted by
Tagged with
0 votes
3 answers
60 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 with the if else condition. Also, if ...
Edy's user avatar
  • 13
0 votes
0 answers
26 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
140 views

I want to pass a QString into a lambda slot-function to modify it further. Unfortunately the QString goes out of scope before reaching the slot, so I cannot append text. How can I ensure that the ...
Me3nTaL's user avatar
  • 505
1 vote
1 answer
138 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
  • 83
-1 votes
0 answers
36 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
42 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
55 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() functions and replace them with ...
pbuchheit's user avatar
  • 1,839
1 vote
1 answer
45 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. This is similar to what Python or ...
Petr 's user avatar
  • 23
-1 votes
1 answer
113 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? template<typename Callable> int foo(Callable callable) { static_assert(callable()); return 0; } static const auto r = foo([] { return true; }); Compiler ...
Teskann's user avatar
  • 163
2 votes
2 answers
131 views

=LET( Business,B6, All_nationalities,FILTER(Data[Nationality],Data[Business]=Business), Unique_nationalities,UNIQUE(All_nationalities), freq,BYROW(Unique_nationalities,LAMBDA(x,COUNTIF(...
neg's user avatar
  • 21
1 vote
2 answers
105 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 std::...
bers's user avatar
  • 6,309
1 vote
0 answers
53 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
31 views

We are using pg Pool in our Lambda function. Our connectDb function looks like this: const config = { database, user: username, password, max: max_pool, idleTimeoutMillis, ...
krishnadev's user avatar
0 votes
0 answers
41 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
119 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
143 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
141 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
368 views

Why does this code output garbage on GCC like there is a UB? auto data = std::vector{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; auto output = [data](this auto self, size_t i) { if (i >= 10) { ...
Sprite's user avatar
  • 4,147
2 votes
0 answers
59 views

I just learned that in rust if you want to pass a reference in lambda: let player_scores = [ ("Jack", 20), ("Jane", 23), ("Jill", 18), ("John", 19), ...
Holiday Tom's user avatar
1 vote
1 answer
82 views

Since I learnt to use Google Test/Mock framework, I allways used the form to setup an expectation as following: EXPECT_CALL( mock_obj, mock_method ).WillOnce( Invoke( []() { do_things; } ) ); Few ...
Leon's user avatar
  • 2,165
0 votes
1 answer
122 views

Is there a simple way to return 0 with a lambda function using and and or operators? For example, consider this function to sum elements in an array: sum = lambda tab: tab == [] and 0 or tab[0] + sum(...
david's user avatar
  • 1,593
0 votes
0 answers
134 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
142 views

So I was trying to come up with a way to split a given parameter pack args... into two separate packs args1... and args2... (at some specified index, 3 in this case). I also wanted to minimize the ...
Orbit's user avatar
  • 23
0 votes
1 answer
57 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
105 views

This is my aws config code //config/aws.js import dotenv from "dotenv"; dotenv.config(); import AWS from "aws-sdk"; if (process.env.NODE_ENV === "development") { AWS....
nafhaf's user avatar
  • 11
3 votes
3 answers
228 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 triggers auto type deduction, but is ...
Dean's user avatar
  • 7,034
0 votes
1 answer
184 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 translated into the following code: int ...
xmllmx's user avatar
  • 44.6k
-3 votes
1 answer
102 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
134 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] 7.5.6.2/6 (emphasis mine): The ...
xmllmx's user avatar
  • 44.6k
-2 votes
1 answer
98 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 the last return: private static ...
Architek's user avatar
  • 135
0 votes
2 answers
73 views

How to use EF Core Fluent API to get inheritance properties? I have a base class and 2 inherited children classes: class BaseClass { public string Name { get; set; } } class Child1 : BaseClass { ...
Dongdong's user avatar
  • 2,538
-2 votes
1 answer
61 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
120 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 JButton and JTextField almost always ...
jinzōningen's user avatar
0 votes
0 answers
127 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: def lambda_handler(event, context)...
thecodingaviator's user avatar
-3 votes
1 answer
55 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
53 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? const stream = require('stream'); ...
Ryan W's user avatar
  • 11
0 votes
1 answer
139 views

BigDecimal rate = BigDecimal.ZERO; BigDecimal fixedCost = BigDecimal.ZERO; int SCALE = 16; fees. stream.forEach(fee -> { switch (fee.FeeRateCode) { case POINT -> rate =rate.add(fee....
Pat's user avatar
  • 649
1 vote
1 answer
61 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
90 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 there is an error in compile time but ...
Ayşenur Bolat's user avatar
4 votes
1 answer
151 views

int main() { auto fn = []<typename T>(this auto&& self, T n) { if (n > 0) { self(n - 1); } }; fn(3); } Compiled with clang-20 -std=c++23 but ...
xmllmx's user avatar
  • 44.6k
14 votes
4 answers
1k views

I'm building a low-latency system, in which I have functions with more than one enum value as template parameters. Sometimes I need to resolve the enum values at runtime, but I don't want to check for ...
Osama Ahmad's user avatar
  • 2,368
0 votes
2 answers
87 views

How can I convert an EntityQueryable to an IIncludableQueryable? I get this error... Object of type 'Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable1[Extenso.TestLib.Data.Entities....
Matt's user avatar
  • 7,015
1 vote
2 answers
115 views

I once read this Python implementation of Y-combinator in a legacy code deposit: def Y_combinator(f): return (lambda x: f(lambda *args: x(x)(*args)))( lambda x: f(lambda *args: x(x)(*args))...
PkDrew's user avatar
  • 2,301
2 votes
2 answers
112 views

I have encountered a lambda with static variable in the following answer https://stackoverflow.com/a/79631994/2894535 : EXPECT_CALL(my_mock, foo(_)) .WillRepeatedly(InvokeWithoutArgs([](){ ...
Dominik Kaszewski's user avatar
0 votes
0 answers
86 views

I have the following: public Func<MyObj, bool> GetFilter(Status status) => status switch { Status.Active => x => x.Status == Status.Active && x.ValidFrom <= DateTime....
Ivan Debono's user avatar
  • 1,016
0 votes
1 answer
96 views

I'm having this trouble: I have a minio instance on kubernetes with my minio-dev.example.io dominio, I also have my object lambda to transform some files but this one is on Knative pod: http://object-...
Emmanuel_Arreola's user avatar
5 votes
2 answers
293 views

I have the following code - template <typename T, typename F> struct unique {}; template <auto F> struct ltype { using type = decltype(F); }; using p = unique<int, ltype<[](){}&...
Ajay Brahmakshatriya's user avatar
2 votes
1 answer
192 views

I am using LocalStack Docker and AWS CDK v2 image and I want to hot reload Lambda functions after file saves services: backend: container_name: "${LOCALSTACK_DOCKER_NAME:-backend}" ...
Sofienne Lassoued's user avatar
-2 votes
1 answer
197 views

Why in the following code we have implicit capture of this in foo1? How is it different from foo2 for the compiler? #pragma warning (default : 4855) struct S { float f = 0.0f; void foo1() { ...
Damir Tenishev's user avatar

1
2 3 4 5
607