By alignment I mean that the predicate takes in two lists, well three with the alignment list. And then check that every item in the alignment list is indeed an element in both the other lits. And there is a requirement about order, so that rules out just checking that every item in the alignment list is a member of both the other input ...
Hi,
I have a binary tree in unordered list that looks like this:
<ul>
<li>1
<ul>
<li>2
<ul>
<li>4
<ul>
<li>8</li>
<li>--</li>
</ul>
</li>
<li>5</li>
</ul>
</li>
<li>3
<ul>
<li>6</li>
<li>7</li>
</ul>
</li>
</ul>
</li>
Where -- is a empty space (to differ ...
This may seem like the worlds simplest python question... But I'm going to give it a go of explaining it.
Basically I have to loop through pages of json results from a query.
the standard result is this
{'result': [{result 1}, {result 2}], 'next_page': '2'}
I need the loop to continue to loop, appending the list in the result key to...
[SOLVED]: Applying proper list iteration procedure fixed problem. (Shown below)
I currently have a program in which elements of a list are iterated through and erased if they meet certain conditions. Due to the nature of the program, this can be visually seen.
Objects on screen that are being iterated through sometimes flicker on and o...
I have a list:
l = [['en', 60, 'command'],['sq', 34, 'komand']]
I want to search for 'komand' or 'sq' and get l[1] returned.
Can I somehow define my own matching function for list searches?
...
I have a list of tuples:
L = [{1, [a, b, c]}, {2, [d, e, f]}, {3, [[h, i, j], [k, l, m]]}]
this is what I have
lists:map(fun({_, B}-> B end, L).
the output is
[[a, b, c], [d, e, f], [[h, i, j], [k, l, m]]]
what I want is:
[[a, b, c], [d, e, f], [h, i, j], [k, l, m]]
it seems a pretty easy problem, but I can't figure out how ...
I have a list of lists, and I need to find the longest one of them. If there are more than one with the same length it's the same which it returns. Thanks.
...
I'd like to add a value to a struct
if (!existISDNteilnehmer(split))
{
isdnObjs.Add(new ISDN() { name = split, number = "",
channels = new List<string>()});
}
ISDN? actualISDN = getISDN(split);
if (index < ISDN_teilnehmer.Count())
{
var numbers =
from num in xISDN.XPathSelect...
Hi!
I have multiple volumes (as nearly everybody nowadays): on Windows they end up specified as C:, D: and so on. How do I list these all like on a Unix machine with "ls /mnt/" with Powershell?
...
Given the following Scala List:
val l = List(List("a1", "b1", "c1"), List("a2", "b2", "c2"), List("a3", "b3", "c3"))
How can I get:
List(("a1", "a2", "a3"), ("b1", "b2", "b3"), ("c1", "c2", "c3"))
Since zip can only be used to combine two Lists, I think you would need to iterate/reduce the main List somehow. Not surprisingly, the f...
Hello all,
I am working with a custom anouncements list, and I am allowing users to upload documents as file attachments to list items (pretty standard SharePoint functionality, I know). What I would like to do is limit the kinds of files a user is able to attach to a list item. Specifically, when a user makes a new anouncement, I only ...
Yesterday I asked ("A case of outwardly equal lists of sets behaving differently under Python 2.5 (I think …)") why list W constructed as follows:
r_dim_1_based = range( 1, dim + 1)
set_dim_1_based = set( r_dim_1_based)
def listW_fill_func( val):
if (val == 0):
return set_dim_1_based
else:
return set( [val])
W...
Hello, I have a list of library filenames that I need to filter against regular expression and then extract version number from those that match. This is the obvious way to do that:
libs = ['libIce.so.33', 'libIce.so.3.3.1', 'libIce.so.32', 'libIce.so.3.2.0']
versions = []
regex = re.compile('libIce.so\.([0-9]+\.[0-9]+\.[0-9]+)')
for l ...
Hey,
in my DAL I have 3-5 Lists of something:
List<User>, List<Items>, List<bla>
Now I want to modify these Lists generic in a method.
How can I write a method with parameters allowed of all of this? (I tried var but don't allowed in the method head)
P.s.: Don't care about type, I will cast it back easily:
List<User> user; user = ...
I have a List and the item renderer displays an image and text from xml (news rss).
Not all news have an image. Whenever you scroll the list, and the item renderer refreshes, it move images of news of a position, so the news "1" have the image of news "2", and the news "2" have the image of news "3" ecc., but the text (the title of news...
I have a list like
<ul>
<li> hgh55jjj </li>
<li> abc99xyz </li>
<li> hgf88hjk </li>
<li> ........ </li>
<li> ........ </li>
<li> def99bnb </li>
<li> gjj77hkj </li>
<li> hgh55fhj </li>
</ul>
I want this to be formatted to a grouped list based on the two digits inside the text in such a way that all 99 items come together. And I also w...
Hello,
I'm trying to rewrite code I've written in matlab in C++ instead.
I have a long cell in matlab containing 256 terms where every term is a 2x2 matrix. In matlab i wrote it like this.
xA = cell(1,256);
xA{1}=[0 0;3 1];
xA{2}=[0 0;13 1];
xA{3}=[0 0;3 2];
and so on...
What would be the easiest thing to use in c++?
Can I give ...
Here we go, bear with me. The over-all goal is to return the max alignment between two lists. If there are more than one alignment with the same length it can just return the first.
With alignment I mean the elements two lists share, in correct order but not necessarily in order. 1,2,3 and 1,2,9,3; here 1,2,3 would be the longest alignm...
We have a part of an application where, say, 20% of the time it needs to read in a huge amount of data that exceeds memory limits. While we can increase memory limits, we hesitate to do so to since it requires having a high allocation when most times it's not necessary.
We are considering using a customized java.util.List implementatio...
I have a list that is frequently insertion sorted. Is there a good position (other than the end) for adding to this list to minimize the work that the insertion sort has to do?
...