Hello. The title is self-explanatory. How can I build a new list X from another list Y (same structure), but the resulting list pointing somewhere else in memory area, practically, another object? I tried with make-list :initial-element Y or appending to an empty list, but I still get the same object. Thanks!
...
I've just started learning about Functional Programming, using Haskel.
I'm slowly getting through Erik Meijer's lectures on Channel 9 (I've watched the first 4 so far) and in the 4th video Erik explains how tail works, and it fascinated me.
I've tried to write a function that returns the middle of a list (2 items for even lengths, 1 fo...
I'm new in haskell and I'm looking for some standard functions to work with lists by indexes.
My exact problem is that i want to remove 3 elements after every 5. If its not clear enough here is illustration:
OOOOOXXXOOOOOXXX...
I know how to write huge function with many parameters, but is there any clever way to do this?
...
I have 4 elements:List[List[Object]] (Objects are different in each element) that I want to zip so that I can have a List[List[obj1],List[obj2],List[obj3],List[obj4]]
I tried to zip them and I obtained a nested list that I can't apply flatten to because it says: no implicit argument matching parameter type.
How can I solve this? should...
How can I determine if any of the list elements are a key to a dict?
The straight forward way is,
for i in myList:
if i in myDict:
return True
return False
but is there a faster / more concise way?
...
Hi,
I got following class:
public class Action
{
public Player player { get; private set; }
public string type { get; private set; }
public decimal amount { get; private set; }
}
Which is used in a List:
public List<Action> Action
Depending on type I display some custom text. But if type = "folds" I just display 1 Fo...
I have a class (Node) which has a property of SubNodes which is a List of the Node class
I have a list of Nodes (of which each Node may or may not have a list of SubNodes within itself) I need to be able to find a Node within the Node list/subNodes.
I have tried to do Find on the list but that will only search the Node classes within t...
Hi !
I'm trying to make a listbox that display pictures from internet. The items are provided by binding itemsource to a model that contain the URL of the image and some other properties (title, desc, etc...).
Unfortunately, the list is very slow to load because WPF is trying to download all pictures from the web before showing the lis...
How can I efficiently implement a list data structure where I can have 2 views to the head and end of the list, that always point to a head a tail of a list without expensive calls to reverse.
i.e:
start x = []
end x = reverse start -- []
start1 = [1,2,3] ++ start
end start1 -- [3,2,1]
end should be able to do this without invoking 'r...
Hi
i have set of 2D arrays and i want store all 2D arrays into single list how can do this in java?
...
Anyone know an R function that will return the number of items in a list?
Thanks
Karl
...
Hi Have a List of array, like
[[{x509Cert=x509cert.pem, accountNumber=652827, serviceProviderName=Sun, privateKey=pk, userName=0BS0Y72NBN, passWord=VuXYG4hZPS}], [{x509Cert=x509cert.pem, accountNumber=698000, serviceProviderName=Sun, privateKey=my.key, userName=0BS0Y72NAWWSS, passWord= VuXYG4hZPS}]]
This was stored in an object, i got ...
I understand how to make a multiple-select list box using JLists but I want to add JCheckBoxes to the list and make it dropdown like. The best visual representation I have found online is dropdown-check-list.
What would be the best way to accomplish the above?
I was thinking of a TableList. Any suggestions?
...
Hi guys,
I've got a problem with my VBA (you guessed it).
I took code from this post:
vbaexpress.com/kb/getarticle.php?kb_id=405
and added in:
wilmott.com/messageview.cfm?catid=10&threadid=40372
Basically, first code would output to a worksheet, but as I theoretically could breach the 65k rows limit, I'd like to output to a csv inste...
Interview question!
This is how you normally define the member relation in Prolog:
member(X, [X|_]). % member(X, [Head|Tail]) is true if X = Head
% that is, if X is the head of the list
member(X, [_|Tail]) :- % or if X is a member of Tail,
member(X, Tail). % ie. if member(X, Tail) is true.
D...
Hi all,
I am writing a storage allocator using the First Fit Algorithm and would like to free up memory I have obtained from the system before quitting. So I have this list of 'free' memory which is obtained from the system and remains unused with me. At the end of the program when I try to free the list using the code , my program is...
How to determine whether two list have same element in prolog?
If i have two list A and B, i want to know whether they have the same element.
...
While my program is running it receives messages with Id's and data in one message.
I want to make a new List for every Id where I can store the data from that Id.
The problem is that I don't know how many Id's I wil receive until my program is running. The only thing I know is that it's a lot. So I don't know if it is possible or how I...
I seem to remember an older version of F# allowing structural decomposition when matching sequences just like lists. Is there a way to use the list syntax while keeping the sequence lazy? I'm hoping to avoid a lot of calls to Seq.head and Seq.skip 1.
I'm hoping for something like:
let decomposable (xs:seq<'a>) =
match xs with
|...
If I have an Action like this:
public ActionResult DoStuff(List<string> stuff)
{
...
ViewData["stuff"] = stuff;
...
return View();
}
I can hit it with the following URL:
http://mymvcapp.com/controller/DoStuff?stuff=hello&stuff=world&stuff=foo&stuff=bar
But in my ViewPage, I have this code:
<%= Html.ActionLi...