-2
votes
0answers
21 views

Python lambda vs Functional programming's lambda [on hold]

Could someone explain the basic difference between Python's lambda and functional programming's lambda?
0
votes
0answers
5 views

fixed point and head normal form

I have this question, given the lambda term s = [ Lambda xy.y(xy) ] , fixed points can be found by applying fixed point combinators such as y and theta, then get for example t = ys or t = theta(s), ...
0
votes
1answer
23 views

Is the following a legit successor function for lambda calculus ? (Church Numeral)

I have read from the books that, the successor for Church Numerals is of the form: (\lambda n f x. f (n f x) ) Last night I came up with this: (\lambda a b c. (a b) (b c) ) I believe it also ...
-2
votes
1answer
61 views

How to make Lambda real

So I use a command to save variables into a serialized file. I save the following data: data.Save("ships", this.ships.Select(x => x.Name)); This is supposed to output an IEnumerable but instead ...
1
vote
1answer
83 views

Comparing Two lists of Different Objects without for loop

I have two lists: List<ObjA> AList; List<ObjB> BList; Now I have a method to compare individual Obj A to Obj B: void CompareObjAToObjB(ObjA a, ObjB b) { .... } where it asserts ...
2
votes
3answers
43 views

Concatenating strings in two lists to create a third list

I have two lists of items, can you please guide me how I can concatenate values of both and add concatenated value into third list as a value. For example if List<string> From has A,B,C and ...
2
votes
2answers
50 views

Explaination of this lambda function please?

I sorted a list of tuples using sorted(list_of_tuples, key = lambda tup: tup[1]) from code I found on the internet. I don't understand how the lambda function works in this command. Is the lambda ...
0
votes
1answer
36 views

query a dictionary by a data member of a class in C# by LINQ

I am working on C# Win 7. I need to get a query from a dictionary. Dictionary<string, myClass> myDict; public class myClass { public int myId; public Dictionary<string, ...
0
votes
1answer
24 views

Prevent code replication with lambda functions when using out parameters

I have to parse the content of many TextBox that contain various numeric data types (int, double, ...). To be valid, the text does not only have to be parsable as int, or dobule or whatever, it also ...
1
vote
0answers
78 views

How to write group by query in dynamic linq query

I am struggling to write 'Group by query' in dynamic linq query. public IEnumerable<DashboardReport> GetDashTransactionsReports(string dimensionColumn) { var result = (from t in ...
0
votes
2answers
154 views

Haskell Applying 2 lambda expressions to list of tuples

I'm struggling to understand lambda expressions in Haskell. He is the problem: I have a list of tuples [(a,b),(c,d),(e,f)...] (it can be of any length) I want to apply two functions f1 and f2 to ...
-1
votes
1answer
40 views

I don't understand lambda in Scheme. Can someone please explain Thanks

Can someone please explain how lambda works in scheme? For example how it works here: (define (prepend-every prefix sent) (every (lambda (wd) (word prefix wd)) sent)) Or here: (define ...
0
votes
2answers
63 views

filling an object from list using Lambda?

I m new to Lambda and from a list of object want to filter a list and an individual object. Two types are as below: Users Id,Name,Password, EmailAddress Credentials Id,Password Can you ...
0
votes
1answer
75 views

OrderBy with Linq.Expression

I have a problem to create a sort expression. I have an expression of type Expression<Func<Products, bool>> that already contains a query expression. I am wanting to do the query ...
1
vote
0answers
67 views

Indent code when using lamba expressions in vb.net

By default, intellisense in visual studio reorganize and indent your code when you create a lamba sub() in vb.net. Something like the code example below (example 1). I always try to organice it but I ...
1
vote
2answers
451 views

Haskell - Lambda calculus equivalent syntax?

While writing some lambda functions in Haskell, I was originally writing the functions like: tru = \t f -> t fls = \t f -> f However, I soon noticed from the examples online that such ...
0
votes
2answers
127 views

Ruby and Lambda calculus

I'm trying to understand lambda calculus with procs and ruby. Here is some code: puts -> x { -> y {x.call(y) } } # => #<Proc:0x2a3beb0@C:/first-ruby.rb:1 (lambda)> puts -> x { x + ...
1
vote
2answers
76 views

error when storing a reference to a method in C++11

I want to work with lambda functions but I have a problem: If I want to store a reference to a function declared in the "global scope" as std::function, there is no problem: int myFunction() { ...
3
votes
3answers
122 views

lambda functions and memory in scheme

I don't understand why if I write (define (iter-list lst) (let ((cur lst)) (lambda () (if (null? cur) '<<end>> (let ((v (car cur))) (set! cur ...
0
votes
1answer
37 views

List<dynamic>.Find and List<dynamic>.FindAll

I am trying to do this but unable to find a workaround. I have a list of dynamic objects and its like ObjectList : List<dynamic> its filled with objects that have a dynamic property LastName. ...
1
vote
2answers
256 views

Duplicate values using linq

I have the Input format in following way S.no Name wages 1 Tom $200 1 Tom $300 1 Tom $400 2 Rob $500 2 Rob $600 Result set should be in ...
0
votes
1answer
101 views

Anonymous Method in Object initializer

I am creating a quiz in which have following class Quiz with properties CorrectOption, WrongOption1, WrongOption2, WrongOption3. in its DTO i have the List<String> Options that will contain ...
2
votes
1answer
397 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 ...
0
votes
0answers
46 views

How to update the record in linq

I will be having the records for the rows. The records will be like rowid rowname 1 first 1 second 2 third 3 fourth 3 fifth 4 sixth 5 ...
1
vote
1answer
606 views

How to compare array of elements with the linq query result in c#

How can i compare array of elements with the linq query. I will pass array of elements to the controller and i want to compare and display the records that only contains the passed elements. I will ...
3
votes
1answer
1k views

Lambda Expression for “not in”?

well i have a collection as it detailcollection which every detail have code,price,name now i have a string with some codes string codes="1,2,3" i know i can get a array using split string[] ...
3
votes
5answers
271 views

How can I create dynamic Lambda Expressions

I have a question, how do I add another filter and this I have to validate that was selected? private Expression < Func < Entity.Modelos.Flux, bool >> Filter() { var dateStart = ...
0
votes
5answers
133 views

using lambda to verify all elements in list

i have a list of foods called "my_foods". i would like to use a lambda function to verify that all elements from the list "good_foods" appear in the list "my_foods", and also verify that none of the ...
1
vote
1answer
243 views

Find a normal form using beta reduction

Given the following expression : ((λx.λx.xx) (λx.xzx)) (λy.yy) I want to find its normal form using beta reduction. My calculation : ((λx.λx.xx) (λx.xzx)) (λy.yy) -> ((λx.xzx)(λx.xzx)) ...
0
votes
1answer
133 views

Passing parameters to a slot function using lambda

#!/usr/bin/python # -*- coding: utf-8 -*- import sys from PyQt4 import QtGui, QtCore class Example(QtGui.QMainWindow): def __init__(self): super(Example, self).__init__(); ...
-3
votes
1answer
46 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 ...
28
votes
1answer
3k 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 ...
12
votes
2answers
471 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 ...
1
vote
2answers
296 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 ...
0
votes
5answers
1k 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
1answer
1k 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 ...
5
votes
5answers
2k views

Get Value and Count of that value using LINQ or lambda expression

A list of data object in the below format Col1 Col2 Col3 B 45 36 B 12 69 A 46 76 C 89 09 B 451 37 D 435 46 A 450 50 D 98 ...
0
votes
2answers
143 views

Dynamic lambda expression [closed]

I have created an expression like: expression = x => x.CustomerName.StartsWith(comboParams.ParamValueText, true, null); I would like access customer name as generic something like this: ...
0
votes
1answer
745 views

LINQ Queries with dynamic OrderBy on property and complex object

With the code below, I don't have any problem to sort on FirstName and LastName but I'd like be able to sort on Name and Code too. Is there a solution to sort on a property and this property is a ...
0
votes
5answers
104 views

C# Possible lambda in array's content declaration

I have such piece of code: string suffix = "wallpapers\\"; string extenstion = ".jpg"; string[] wallpapers; ..... void SetWallPapers() { wallpapers = new string[] { ...
1
vote
2answers
145 views

Lambda implementation for OR expression concatenation

I am new to lambda expressions; I am learning by implementing them. I have a question on how to convert a for-loop into a lambda expression. EnumHelper.GetEnumFromString is a helper method that ...
1
vote
1answer
401 views

Lambdaj: Loop through Map and get the values and put in other Map

I'm new to lambdaj so trying to get more used to it. I want to update this code using lambdaj: Passed in parameter Map<String, Device> devices; final Map<String, String> resultHash = ...
0
votes
2answers
640 views

Why std::generate will work with lambda generator and std::fill will not?

I have stumbled across this website : http://www2.research.att.com/~bs/C++0xFAQ.html#lambda where they explain lambda functions. I have tried to use the provided examples, namely : ...
2
votes
5answers
1k views

Lambda Max and Max and Max

Quick and probably easy Lambda question: I have a restaurant with reviews. I want to query for the one with the: Max(AverageRating) And the Max(ReviewCount) And the Max(NewestReviewDate) And the ...
1
vote
2answers
236 views

Why are lambda expressions called lambda expressions? [closed]

I may be showing my ignorance here, but why are lambda expressions called lambda expressions. I understand how to use them, but I'm curious if there is any significance to the term "lambda".
3
votes
1answer
575 views

Using lambdas as asynchronous callbacks

I have a program, where I cannot use the standard std::async and threading mechanisms. Instead I have to code the program like so: void processor( int argument, std::function<void(int)> ...
6
votes
1answer
238 views

Syntax tree for lambda calculus

I'm trying to figure out how I would draw a syntax tree for the expression below. First, how exactly is this behaving? It looks like it takes 1 and 2 as parameters, and if n is 0, it will just return ...
11
votes
1answer
255 views

How can I use lambda function within itself?

I have this code and don't know if what I would like to achieve is possible. _acceptor.async_accept( _connections.back()->socket(), [this](const boost::system::error_code& ec) { ...
8
votes
5answers
2k views

In lambda functions syntax, what purpose does a 'capture list' serve?

Taken from an answer to this question, as an example, this is a code that calculates the sum of elements in a std::vector: std::for_each( vector.begin(), vector.end(), [&](int n) { ...
0
votes
4answers
539 views

Python: to wrap functions via lambda

I have some code like class EventHandler: def handle(self, event): pass def wrap_handler(handler): def log_event(proc, e): print e proc(e) handler.handle = lambda ...

15 30 50 per page