Questions tagged [lambda]
Use this tag if you would like to discuss the appropriateness of a lambda (anonymous) function in your code.
219 questions
3
votes
1
answer
98
views
Adding Lambda to Path
Previously I wrote a very generic HTTP handler.
But in real life the server needs to be able to handle different functions on different paths. i.e. /rest/addUser ...
5
votes
0
answers
89
views
Excel Lambdas for Filtration Lookup
Background
I have an ongoing challenge in Excel, where I must match differing descriptions of the same object. Originally, there were only two alternatives:
Use a dropdown list in Excel, which pulls ...
2
votes
0
answers
49
views
A recursive_replace_copy_if Template Function with Unwrap Level Implementation in C++
This is a follow-up question for A recursive_replace_copy_if Template Function Implementation in C++. I am trying to implement recursive_replace_copy_if template ...
3
votes
1
answer
122
views
In Java, replace for loop with condition with lambdas [closed]
I want to replace a for loop with a break/return condition inside with a lambda.
I think I have a good replacement, but I want ...
1
vote
1
answer
130
views
Find Method Implementation for Multidimensional Array in C#
I found that Array.Find(T[], Predicate) Method is only support one dimensional array. I am trying to generalize it to multi-dimensional array in this post.
The experimental implementation
The ...
3
votes
1
answer
134
views
Portable lambda emulation in C
For fun I decided to try to emulate lambda functions in plain old C. It turns out it can be easily done with a bit of macro abuse.
CLambda struct stores function ...
2
votes
2
answers
143
views
Find all line numbers of prefix duplicates with streams
All line indices of lines from a text that begin with the same line prefix should be found. The prefixes and the corresponding line numbers should be returned. Streams and lambdas should be used as ...
3
votes
2
answers
208
views
Add offset to all filenames
From all the files in a directory, the method shiftFilenamesOffset is to increment the numeric part (int) of the alphanumeric filename by offset each time, and ...
2
votes
1
answer
88
views
Lazy evaluation vs strict one applied to fib
I have this OCaml problem:
Recall the polymorphic type lazy seen in class, the function delay which transforms a ...
4
votes
0
answers
108
views
Print columns of text without hard coding the width (attempt 5)
If you'd like to print this:
...
0
votes
3
answers
324
views
Print columns of text without hard coding the width (attempt 4)
If you'd like to print this:
One Two Three Four
1 2 3 4
using this:
...
4
votes
1
answer
309
views
Print columns of text without hard coding the width (attempt 2)
If you'd like to print this:
One Two Three Four
1 2 3 4
using this:
...
4
votes
2
answers
577
views
2D Matrix in C++
I wanted to play with a two-dimensional generic data container in C++ and explore different methods of traversals: using closures and iterators. I'd like a review of it.
...
3
votes
1
answer
235
views
Finger Exercise: Update book cipher by creating new book
I'm working my way through the finger exercises in John Guttag's book Introduction to Python Programming, third edition. The following finger exercise on page 143 describes encryption/decryption with ...
0
votes
1
answer
592
views
Compute the goals scored by football teams in their matches in a season, from json data
Please look at the Java Stream methods in the for each loop.
This method totals the score for when the your desired team is playing during the football season - input param teamKey - it is either ...