Hi all,
In my application i have to access to access my iPhone Address book and i have to get only favorites from my contacts. How can i do this?
please help me.
Thanks in advance.
Hi.
I have a text file of URLs, about 14000. Below is a couple of examples:
http://www.domainname.com/pagename?CONTENT_ITEM_ID=100¶m2=123
http://www.domainname.com/images?IMAGE_ID=10
http://www.domainname.com/pagename?CONTENT_ITEM_ID=101¶m2=123
http://www.domainname.com/images?IMAGE_ID=11
http://www.domainname.com/pagename?CONTENT_ITEM_ID=102¶m2=123
I have loaded the text file into a Python list and I am trying to get all the URLs with CONTENT_ITEM_ID separated off into a list of their own. What would be the best way to do this in Python?
Cheers
I have a List where element is:
struct element {
double priority;
int value;
}
How can I implement my own comparer which allow me sort List by priority ? I try with SortredList... but it don't allow douplicated keys :(
Big thanks for help!
Hello,
if you have a function "test a b" which returns true if a and b are connected directly and if you have a given unordered list of things, what would be an elegant and fast solution to filter all connected things from given list?
Example:
let test a b = let diff = a - b in diff == 0 ;;
let lst = [4;1;7;3;8;9;2;0] ;;
filter_connected 2 lst ;;
- [4;1;3;2;0]
Any hints?
Basically im creating a list which contains names(strings), but as i add a struct to my list, i want to place it alphabetically.
im just having trouble especially with reassigning the pointers as i add
How can i do this in C?
thanks.
I've got a List that contains duplicates and I need to find the indexes of each.
What is the most elegant, efficient way other than looping through all the items. I'm on .NET 4.0 so LINQ is an option. I've done tons of searching and connect find anything.
Sample data:
var data = new List{"fname", "lname", "home", "home", "company"}();
I need to get the indexes of "home".
Hi
I have found this code in the internet and it was for arrays ,I want to change it for doubly linked list(instead of index we should use pointer) would you please help me that how can i change merge method(I have changed sort method by myself) also this is not my home work ,I love working with linked list!!
public class MergeSort {
private DoublyLinkedList LocalDoublyLinkedList;
public MergeSort(DoublyLinkedList list) {
LocalDoublyLinkedList = list;
}
public void sort() {
if (LocalDoublyLinkedList.size() <= 1) {
return;
}
DoublyLinkedList listOne = new DoublyLinkedList();
DoublyLinkedList listTwo = new DoublyLinkedList();
for (int x = 0; x < (LocalDoublyLinkedList.size() / 2); x++) {
listOne.add(x, LocalDoublyLinkedList.getValue(x));
}
for (int x = (LocalDoublyLinkedList.size() / 2) + 1; x < LocalDoublyLinkedList.size`(); x++) {`
listTwo.add(x, LocalDoublyLinkedList.getValue(x));
}
//Split the DoublyLinkedList again
MergeSort sort1 = new MergeSort(listOne);
MergeSort sort2 = new MergeSort(listTwo);
sort1.sort();
sort2.sort();
merge(listOne, listTwo);
}
private void merge(DoublyLinkedList a, DoublyLinkedList b) {
int x = 0;
int y = 0;
int z = 0;
while (x < first.length && y < second.length) {
if (first[x] < second[y]) {
a[z] = first[x];
x++;
} else {
a[z] = second[y];
y++;
}
z++;
}
//copy remaining elements to the tail of a[];
for (int i = x; i < first.length; i++) {
a[z] = first[i];
z++;
}
for (int i = y; i < second.length; i++) {
a[z] = second[i];
z++;
}
}
}
Greetings,
I have a FlowDocument where List control is placed. Inside this list I have some ListItem. Is there any way to set some kind of Visibility for specific ListItem? I don't see a coressponding Property like Visibility for ListItem. When I set fontsize="0.1" then application hangs (it goes into infinite loop).
I want to make a component that includes a list of integers as one of its serialized properties. I know I can't declare a TList<integer> as a published property, because it doesn't descend from TPersistent. I've read that you can define "fake" published properties if you override DefineProperties, but I'm not quite sure how that works, especially when it comes to creating a fake property that's a list, not a single value.
Can someone point me in the right direction?
I have:
L1 = ['11', '10', '13', '12', '15', '14', '1', '3', '2', '5', '4', '7', '6', '9', '8']
this is a list of strings, right?
I need to make it a list of integers as follows:
L2 = [11, 10, 13, 12, 15, 14, 1, 3, 2, 5, 4, 7, 6, 9, 8]
finally I will sort it like below:
L3 = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] by L2.sort()
please let me know how I can get to L3 from L1
I need help with my application where i save a bunch of words like more than 4000 words or more in a List<[class name].
My problem is, as the number of words increases, the process in saving it in the list seems to go slower and the application uses a lot more of memory. Can you give me an advise or alternative to do this without affecting the speed of the process?
Hi, Python newbie here.
I have a list L = [a, b, c] and I want to generate a list of tuples :
[(a,a), (a,b), (a,c), (b,a), (b,b), (b,c)...]
I tried doing L * L but it didn't work. Can someone tell me how to get this in python.
I want to get use of dictionary items like I do in List generic class,
e.g;
foreach(item in ItemList)
{
item.BlaBla;
}
but in dictionary there s no chance, like e method above...
Dictionary<string, HtmlInputImage> smartPenImageDictionary;
I mean I got to know the key item for the dictionary item.. but what I want, I want to travel from beginning of the list till the end..
What's the idiomatic way to do maximumBy (higher order function taking a comparison function for the test), on a list of lists, where the comparison we want to make is the sum of the list, in Python?
Here's a Haskell implementation and example output:
> maximumBy (compare `on` sum) [[1,2,3],[4,5,6],[1,3,5]]
> [4,5,6]
So I have a list of tuple like:
[(1,"juca"),(22,"james"),(53,"xuxa"),(44,"delicia")]
I want this list for a tuple whose number value is equal to something.
So that if I do search(53) it will return 2
Is is an easy way to do that?
Hello i want to remove duplicates from a list
i do this but not working
List<Customer> listCustomer = new ArrayList<Customer>();
for (Customer customer: tmpListCustomer)
{
if (!listCustomer.contains(customer))
{
listCustomer.add(customer);
}
}
I have a list like this:
[["str1","str2"],["str3","str4"],["str5","str6"]]
And I need to convert it to
["str1", "str2", "str3", "str4", "str5", "str6"]
How do I do this?
The problem is that I'm dealing with lists of strings, so when I do
lists:flatten([["str1","str2"],["str3","str4"],["str5","str6"]])
I get
"str1str2str3str4str5str6"
However, if the elements of the original list where just atoms, then lists:flatten would have given me what I needed. How do I achieve the same with strings?
Hello,
I've just discovered Sikuli, and would like to see a comprehensive functions list without digging through the online-examples and demos.
Has anyone found such a list?
Furthermore, apparently Sikuli supports more complex loops and function calls as well, and seems to be based in Python(!!). Examples would be great.
Thanks.
How would you write a list comprehension in python to generate a series of n-1 deltas between n items in an ordered list?
Example:
L = [5,9,2,1,7]
RES = [5-9,9-2,2-1,1-7] = [4,7,1,6] # absolute values
Using the Twitter REST API Method: favorites for a user, this returns a list of statuses of each favourite. Is there a way to get the favourite count other than calling users/show, and accessing the property this way? Seems an ineffecient way of determining if there are more than 20 favourites for paging purposes.
a=[1,2,3,4]
b=a.index(6)
del a[b]
print a
it show error:
Traceback (most recent call last):
File "D:\zjm_code\a.py", line 6, in <module>
b=a.index(6)
ValueError: list.index(x): x not in list
so i have to do this :
a=[1,2,3,4]
try:
b=a.index(6)
del a[b]
except:
pass
print a
but this is not simple,has any simply way ?
thanks
Hey,
I've been reading the documentation, but this is appears to be impossible. Does anyone know how to search the favorites of a user, using the youtube search api?
Pretty much we'll have a user favoriting videos, and we want to be able to use the youtube search api, to search only on those videos.
/thanks
Is there a singular regular expression that can be used in, say, a text editor's search/replace dialog to reverse the order of the items in a list?
For instance, take this list:
First item
Second item
Third item
Select it in a text editor like EditPad, bring up the search and replace box, apply a regex (run as a loop or not) and turn it into:
Third item
Second item
First item
Can this be done?