Anonymous functions or closures in programming languages such as Lisp, C#, C++ or Python. (Also, lambda expression.)
2
votes
0answers
37 views
Calling std::any_of with conditional operator on lambda gives unexpected results
Here is some code I recently wrote in VS2012:
///<summary>Lambda: Returns true if the field is significant within a baseline context</summary>
const auto ...
0
votes
0answers
4 views
Strange scooping rules in for loop with lambda in Visual Studio 2012
How come this does not compile:
for(size_t i;;)
auto Lambda = [](size_t i) {};
1>application_src\general_experiments.cpp(96): error C2365: 'i' : redefinition; previous definition was 'data ...
2
votes
1answer
39 views
Is it possible to use a lambda function inside of a vector's constructor?
Is there a way to initialize all values of some container using a lambda function like one would do using std::for_each? I need a 3-dimensional std::vector of random ints, and it would be nice if I ...
0
votes
2answers
27 views
lambda contains in array
My array A may be returns array of age likes
int [] A = {11,12,13} or
int [] A = {14,15} or
int [] A = {11,14}
My Person table has column likes
ID Name Age
---------------------
1 ...
1
vote
2answers
20 views
C# Getting a column value with lambda and read the value on code behind
my database table looks like this
i trying to retrieve the FileURL in the CRUD class file like this :
public IList<string> GetSorted(int listAct)
{
...
7
votes
3answers
231 views
Overhead of recursive lambdas
Do recursive lambda functions induce any overhead comparing to regular recursive functions (since we have to capture them into a std::function) ?
What is the difference between this function and a ...
0
votes
2answers
41 views
Use appguid if available otherwise use hardcoded guid in LINQ
How can I write below lambda expression so it can check for a matching appguid and if it won't find any, then it will look for hardcoded guid instead?
public static string ActiveDirectory(string ...
14
votes
2answers
315 views
How to compare two functions for equivalence, as in (λx.2*x) == (λx.x+x)?
Is there a way to compare two functions for equality? For example, (λx.2*x) == (λx.x+x) should return true, because those are obviously equivalent.
-1
votes
0answers
8 views
Anonymous Method in Object initializer
I am creating a quiz in which have followign class
Quiz with properties CorrectOption, WrongOption1, WrongOption2, WrongOption3.
in its DTO i have the List<String> Options that will contain ...
1
vote
1answer
61 views
C# passing a list of strongly typed property names
I'm looking for a way to pass in a list of strongly typed property names into a method that I can then dissect and get the properties that the caller is interested in. The reason I want to do this is ...
1
vote
7answers
74 views
Selecting from set of enum values
I have collection of items which are having one enum property list.
Original property looks like
public class Content {
List<State> States {get; set;}
}
where 'State' is enum with almost ...
0
votes
1answer
21 views
how to implement sql like casting selection in lambda expressions
how to convert this sql statement into linq or lambda expression
SELECT Month,Year FROM Tbl_OrderDetails Order by cast(Year as int) ,cast(Month as int)
Here Month and Year are in VARCHAR type
...
0
votes
2answers
33 views
SQL statement to linq lambda
i have this sql statement : Select FileURL from story where ActivityID = ' " listACt " ' ;
How do i convert this to linq lambda?
i have this but its not working :
public ...
1
vote
1answer
56 views
Modify array with Array.Foreach and lambda expresion
I'm trying to modify the values of the array but it doesn't get modified:
string buzones = File.ReadAllText("c:\\Buzones");
string[] buzoneslist = buzones.Split(',');
Array.ForEach(buzoneslist, x ...
0
votes
1answer
64 views
C++11 lambda array of pointers initialization
Consider the following code. What I am trying to do is initialize an array of pointers from a supplied array of values. I'm trying to figure out the best way to copy those values into the pointers, ...