Category "lambda"

How to Sort a Model Based on a Property in IList<T> within that Model

This is a bit more complex than other questions. I have a Model that encapsulates an IList. Within each IList item there are multiple Lists. This makes it VERY

Improving (shortening) my list comprehension with lambda x function?

!!! I know I could use Counter() here, but that's not the point !!! Giving the code below: test =[['a',1],['a',2],['b',3], ['c',5],['a',7],['c',9]] {i:[test[x]

Boolean values list to integer in Python

I'm having trouble with this lambdas syntax. I'm trying to translate a list of booleans to an integer value, but I'm getting an error, I don't understand why.

UpdateFunctionCode in lambda does not update the code

I have followed this blog to update the code of a lambda function using a jar file stored in a S3 bucket. the execution was succeded, but it is not updating the

Return a lambda from a lambda

I want to use a lambda to evaluate (switch-case) some conditions and return a lambda accordingly. const auto lmb1 = []() { printf("1\n"); }; const auto lmb

Overload a lambda function

How to overload a simple local lambda function? SSE of original problem: #include <iostream> #include <map> void read() { static std::string

LINQ Expression GroupBy Select First

I've got a question on LINQ Expression. I need to replicate the following lambda: var result = processRevisions OrderByDescending(pr => pr.CreatedAt) G

Writing a Factorial function in one line in Python

I am looking to improve my coding by performing the same code in different ways, this not only is to help me become better at coding but also understand differe

How can I reverse a single String in Java 8 using Lambda and Streams?

I have one string say "Aniruddh" and I want to reverse it using lambdas and streams in Java 8. How can I do it?

append or extend using Lambda in Python

I want to do this: def my_func(x): x.extend('\n') return x var1 = [['a', 'b'], ['c', 'd']] for item in var1: var2 = my_func(item) print(var2)

AWS Lambda Error: Unzipped size must be smaller than 262144000 bytes

I am developing one lambda function, which use the ResumeParser library made in the python 2.7. But when I deploy this function including the library on the AWS

Cannot delete AWS Lambda@Edge replicas

This question already exists here but I think it will have more impact on SO. I created an AWS Lambda@Edge function in order to rewrite Cloudfront URLs befo

Cannot delete AWS Lambda@Edge replicas

This question already exists here but I think it will have more impact on SO. I created an AWS Lambda@Edge function in order to rewrite Cloudfront URLs befo

How to write Repository method for .ThenInclude in EF Core 2

I'm trying to write a repository method for Entity Framework Core 2.0 that can handle returning child collections of properties using .ThenInclude, but I'm havi

Search an array list inside another array and return a new object combined

I am using typescript and I have two objects: export interface Module { moduleId: String name: String } export interface Model { id: number name

Java 8 optional: ifPresent return object orElseThrow exception

I'm trying to make something like this: private String getStringIfObjectIsPresent(Optional<Object> object){ object.ifPresent(() ->{

How to deploy multiple functions using serverless cli?

From the doc, I can deploy a function like this serverless deploy function -f functionName https://www.serverless.com/framework/docs/providers/aws/cli-refer

Conditional branches of a function raise false circle reference errors

I have a big function with lots of branches of IFS; each branch uses different references of the worksheet: MYFUN = LAMBDA(i, IFS( i = 1, // a formu

Simplifying code - perform mathematical operations based on operator

Here is the code for a calculator in Python: import time #Returns the sum of num1 and num2 def add(num1, num2): return num1 + num2 #Returns the difference

Added VPC endpoint but Lambda still timing out

Goal: Lambda function needs to retrieve RDS password from Secret Manager via VPC Endpoint (using AWS-SDK in Lambda). Problem: The Lambda function and RDS are i