I have a method that does a lookup of some elements and returns them to the user:
List<DailyPrayer> dailyPrayers = (List<DailyPrayer>) query.execute();
return dailyPrayers;
These are daily prayers so I want the user to see a different prayer each time so they do not get bored with seeing the same content in the same order over and ove...
We have variable $menu with HTML inside (there is no loop, it comes from a function).
On echo it gives the code like this:
<ul id="menu">
<li id="some-id" class="many classes one"><a href="#">text</a></li>
<li id="some-id" class="many classes second active"><a href="#">text</a></li>
<li id="some-id" class="many classes thre...
So , i still don't completely understand how lists and recursion work in prolog, could be why i am having trouble with this, but i don't even know how to begin this problem.
There is a list of friends.
f(a,b).
f(a,c).
f(a,d).
f(b,c).
f(b,e).
f(b,f).
f(c,e).
f(c,g).
f(g,e).
etc..
I have to find if someone is a friend through someone e...
im getting a weird problem when refreshing my listview it works fine until the device is rotated and then when refreshing it again it goes completely blank. can only be fixed by rotating the device again (as it is also refreshed in onCreate()) but then whenever its refreshed again it goes blank. problem persists until app is restarted.
...
Hi experts,
I was wondering what the most computationally efficient Python way of cracking this problem would be.
Say you have two strings (or lists from splitting those strings--doesn't matter), "this is the right string" vs. "this is right the string."
We're assuming that the first string is always right, and a score will be assigne...
Hi, this question might have similars in SO but my case is a bit different. and I tried to adapt those answers to my problem but couldn't.
so here is the thing:
I have this list :
[(['c', 'a', 'b'], 10), (['c', 'a', 'b'], 9),(['h','b'],2)] for example.
I want to remove the duplicates in this list by keeping tuple that has the larger nu...
I've worked out how to read in the file and it works using the following code:
(define p (read(open-input-file "starbucks4.sxml")))
But how do i store p as a list with elements separated by \n characters.
Thanks.
...
Hi,
I am trying to make an integer into a binary:
543 = <<"543">>
How can I do this without
integer_to_list(list_to_binary(K)).
...
I have a static List in a class that will be accessed by different threads, each one adding, reading and removing its own unique item from the list. I would like to know if I have to worry about making this variable thread safe, as even though the same List object is shared between threads, they only modify their own unique items
...
I'm having some trouble with a couple of hmwk questions and i can't find th answer-
How would you write an expression that removes the first or last element of a list?
i.e. One of my questions reads "Given a list named 'alist' , write an expression that removes the last element of 'alist'"
...
Hey everybody, I was wondering where, or what is the methods used in the batch uninstaller programs? I know how to pull up lists of the applications, and the icons in a listview.. getting them into the right lists and whatever, but how do I actually uninstall the application? Thanksa
...
I need to build a new list with a "loop". Basically i can't use recursion explicitly, so i am using append to go through lists of list.
I can get the element. Problem is i need to check this element and if something is true it returns another element i need to put back into the list. It does check correctly and it changes correctly.
Pr...
Because SO is a bit slow lately, I'm posting an easy question. I would appreciate it if big fishes stayed on the bench for this one and give rookies a chance to respond.
Sometimes we have objects that have a ridiculous amount of large list elements (vectors). How would you "unlist" this object into a single vector. Show proof that your ...
Hey,
I have a method which I will accept either a single object or a list of objects. I want to add whatever is passed to another list. Currently, my method looks like this:
def appendOrExtend(self, item):
if type(item).__name__ == "list":
self.list.extend(item)
else:
self.list.append(item)
It seems to me that there shoul...
Hey guys,
I need to do a project at the college, it needs to use list/tree/stack to perform any task. I was thinking on the Google's algorithm to recognize the phrase while the guy is typing.
Does anyone has this algorithm? Or any other better idea that use list/tree/stack?
Thanks
...
Hi,
I'm looking for a function in Scheme to replace a element in an equation by a value.
Exemple : '(+ a b c a) with (1 2 3) should give me '(+ 1 2 3 1). (I don't want to resolve the equation, it was just an exemple)
Basically, I want to say that a=1, b=2, c=3
To proceed, I extract the variables of my first list in another list.
The...
How can I take a dictionary and split it into two lists, one of keys, one of values. For example take:
{'name': 'Han Solo', 'firstname': 'Han', 'lastname': 'Solo', 'age': 37, 'score': 100, 'yrclass': 10}
and split it into:
['name', 'firstname', 'lastname', 'age', 'score', 'yrclass']
# and
['Han Solo', 'Han', 'Solo', 36, 100, 10]
An...
I have a dummy list here:
> x <- c("a", "b", "c")
> y <- c("d", "e", "f")
> z <- list(x,y)
> z
[[1]]
[1] "a" "b" "c"
[[2]]
[1] "d" "e" "f"
If I want to assign another variable (e.g. w) to hold the last item (i.e. "c", "f") of all vectors (i.e. x, y) inside the list (i.e. z), how can I do that?
Thanks!
...
Hello,
in my code I obtain two different lists from different sources, but I know they are in the same order. The first list ("names") contains a list of keys strings, while the second ("result_values") is a series of floats. I need to make the pair unique, but I can't use a dictionary as only the last value inserted would be kept: inst...
In this other question it shows how to get all days of a month. I need the same thing, but I only want to list days of week (I want to exclude weekends).
How can I get a list of days of a month excluding weekends?
...