Category "lambda"

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

coding reduceByKey(lambda) in map does'nt work pySpark

I can't understand why my code isn't working. The last line is the problem: import findspark findspark.init() from pyspark import SparkConf, SparkContext from p

What do the parenthesis following a lambda expression mean?

I am new to Python and I am wondering why this doesn't work for lambda: for person in people: print(lambda person:person.split()[0] + ' ' + person.split()[-

Why does it matter if I use a method reference or a lambda here?

When I try to compile this code import java.util.Optional; public class GenericTest { public static void main(String[] args) { Optional.empty().m

INDIRECT and OFFSET in the function body make a name special

I would like to write a user-defined function CHOOSERANGE that returns a range from 4 coordinates. The first version is as follows: CHOOSERANGE = LAMBDA(row_min

What's the VB.NET equivalent of async delegate in C#?

I'm trying to convert the following extension method (source) from C# to VB: public static Task ForEachAsync<T>(this IEnumerable<T> source,

error: no viable conversion from '(lambda at A.cpp:21:22)' to 'int'

What am I missing? Lambda declaration error. Marked in comment. void solve() { int charCount, time; cin>> charCount >> time; // Generat