In programming language theory,a lambda function is a function defined, and possibly called, without being bound to an identifier.
-3
votes
1answer
28 views
How to get arguments names in a list and create in lambda python?
argsneeded = ["dividend","divisor"]
lambda ?????: a/b
What should I put in the ????s?
I'm creating a record and replay tool 4 python, argsneeded is an arbitrary list gained by sys.traceit to get ...
19
votes
1answer
924 views
Can lambda functions be recursive? [duplicate]
Possible Duplicate:
Recursive lambda functions in c++0x
Here is a plain old recursive function:
int fak(int n)
{
return (n <= 1) ? 1 : n * fak(n - 1);
}
How would I write such a ...
0
votes
1answer
43 views
Is there a way to search two different collection and fill another collection using LINQ?
I have two different collections like below
public class Student
{
public int StudentID { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
...
5
votes
1answer
182 views
Passing an element to a lambda by reference-to-const
Inside an algorithm, I want to create a lambda that accepts an element by reference-to-const:
template<typename Iterator>
void solve_world_hunger(Iterator it)
{
auto lambda = [](const ...
1
vote
2answers
52 views
Linq - drill down with find
I am completely new to linq and need help.
These are my poco classes:
public class User {
public User()
{
this.Profiles = new List<Profile>();
}
public Guid ID { get; set; } ...
2
votes
3answers
31 views
LINQ query help: searching for data in a Many to Many using Entity Framework
I've poked around and seen a bunch of similar questions, but I still can't figure this out. I've got two classes Assets and Tags. Here are their definitions:
public class Asset
{
[Key]
public ...
10
votes
2answers
104 views
JDK8 lambdas to begin with conceived as no true closures? [closed]
I had a look at JDK8 lambdas recently and discovered that the old problem with variables handed over from the outer context into an anonymous class still exists with JDK8 lambdas (the var then has to ...
0
votes
2answers
47 views
Using a template Lambda expression inside a std::accumulate c++?
Is there to templatize the "ints" in the lambda function below in the case that there was a standard container of doubles or floats, etc.? I have searched the world over for help with this. I even ...
1
vote
2answers
43 views
Lambdas and sums Python
def summation(calc_termo, linf, prox, lsup):
soma = 0
while linf <= lsup:
soma = soma + calc_termo(linf)
linf = prox(linf)
return soma
summation(lambda x: ...
0
votes
0answers
82 views
Parallel for: not the same result on my computer and ideone? [duplicate]
Possible Duplicate:
A parallel for using std::thread?
Consider the following code that implements a parallel_for:
// parallel_for.cpp
// compilation: g++ -O3 -std=c++0x parallel_for.cpp -o ...
3
votes
1answer
70 views
Hello world with Expression Trees
I am trying to get to grips with Expression Trees. I thought I'd start by writing a simple helloWorld function that creates a StringBuilder, appends "Helloworld", and then outputs the string. This is ...
4
votes
2answers
140 views
Using arrow functions in TypeScript: how to make them class methods?
I'm fairly experienced programming but quite new to TypeScript.
Trying to use it with jQuery and immediately ran into the 'this' issue with callbacks (such as $(document).ready.
Using $.proxy() is ...
1
vote
1answer
60 views
create dynamic query in EF in multi layer architecture and repository pattern
i want to create dynamic linq query or dynamic linq or lambda expression.
i am using this article
for example i want to tell to repository get products that their names start with 'computer' and (and ...
1
vote
2answers
47 views
Hierarchical Structures Database Select By Lambda Expression
Hierarchical Structures Database Select By Lambda Expression
Hi My Table Structure is recursive
ID
ParentID
UserGROUPNAME
How Can I select Subset an Id from my contex By Lambda Expression ...
16
votes
3answers
1k views
Java 8 and Scala
This article, very well summarizes the similarities between the upcoming Java 8 and Scala.
Given the improvements to Java 8, what are the features in Scala that would still motivate me to adopt ...
1
vote
1answer
68 views
How to handle exceptions in a lambda expression within a Task?
I am trying to convert an application to use Tasks instead of Microsoft's multithreaded framework, but I'm having trouble with the error handling. From Microsoft's documentation ( ...
3
votes
2answers
126 views
Good practice for passing a function as a parameter : copy, reference, const reference? [duplicate]
Possible Duplicate:
template pass by value or const reference or…?
What is the good practice in the following for a function taking a function as a parameter :
template<class ...
2
votes
2answers
97 views
Calling std::make_tuple with lambdas in a variadic template - is this supposed to work in C++11?
in C++11 a lambda function is an object, and it should be possible to call make_tuple with it, right?
void foobar() {
auto t = std::make_tuple([](){ std::make_shared<int>(); });
}
This ...
1
vote
2answers
95 views
Lambda of a lambda : the function is not captured
The following program do not compile :
#include <iostream>
#include <vector>
#include <functional>
#include <algorithm>
#include <cstdlib>
#include <cmath>
void ...
-3
votes
3answers
99 views
1
vote
3answers
110 views
writing a recursive function using foldr
I am new in Haskell programming.
While practicing I was asked to make a recursive function that looks like this:
repeat1 5 [1,2,3] = [[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3]]
which is
repeat1 ...
0
votes
5answers
165 views
Split a list into multiple lists using lambda expression
class order {
Guid employeeId;
DateTime time;
}
I need to filter a list of orders into 4 lists based on the time range. 0-9AM to 1st list, 9AM-2PM to 2nd, 2-6PM to 3rd and 6-12PM to a 4th ...
0
votes
5answers
77 views
I am newbie on Lambda
public TEntity GetSingle(Func<TEntity, bool> predicate)
{
try
{
var teste = _context.Set<TEntity>().Single(predicate);
}
catch (Exception)
{
return ...
8
votes
1answer
157 views
Writing lambda expressions in common lisp
I am currently reading ANSI Common Lisp by Paul Graham, and I have a question about writing lambda expressions.
Do we need to prefix a lambda expression with #'?. If I write something like this in ...
0
votes
1answer
219 views
Mapping entities with fluent api on entity framework 5
I have a question.
I have these two tables:
The principal table is User with Customer dependence.
The reverse engineer code first generated classes as follows:
public class User
{
public ...
0
votes
1answer
119 views
order by in lambda expressions
I'm trying to sort the data in lambda expression in the following case.
if (Directory.Exists(Server.MapPath(System.Configuration.ConfigurationManager.AppSettings["ErrorLogPath"].ToString())))
{
...
0
votes
1answer
63 views
Lambda OrderBy method
I have a graphing class to detect circular dependencies in some business logic I am writing. My graphing class builds nodes that knows the relationship to other nodes.
I have nodeList as List(of ...
2
votes
2answers
31 views
Linq - isolate lambda as a delegate
Given a Linq sample like this:
myObject.firstOrDefault(o => o.propertXyz == otherObj.propertyXyz);
How would I extract lambda expression and hold it in a delegate so that it can be passed in?
...
1
vote
1answer
51 views
Making expressions from lambda functions that are not for comparison
I'm currently building a UI that builds up queries and I would like to be able to store other expressions in the form of a lambda function (as it makes it easy to add them with intellisense etc). ...
0
votes
1answer
49 views
How can I pass a variable into a lambda function? Dynamic Lambda functions
In the last line, how can I ensure that the "this" i'm referring to is the instantiated k8rModal object and NOT the object running the function?
For other items in the future I'll need to dynamically ...