How to import import Msn contact in our application?
I want to learn about importing msn contact list in my java appication.
Need help on this and where can i find the sample java code for achieving this?
What is the best practice, even in general programming, when you have an undefined, possibly infinite, amount of items that you need in an array but don't have defined bounds. Can you define an endless array in objective c that you can keep pushing items onto, like other lanaguages have a list item.
Thanks for any help.
In my other ask You can see code of my arr structure and PriorityQueue collection. I normally add items to this collection like that:
arr.PriorityQueue.Add(new element((value(item, endPoint) + value(startPoint, item)),item));
I am curious that is other way to do this (add element(which is struct) object to List) ? In lambda way for example ? I just eager for knowledge :)
Hi
I have a question about how to catch the exception in the initialization list.
For example, we have a class Foo derived from Bar
class Foo {
public:
Foo(int i) {throw 0; }
}
class Bar : public Foo{
public:
Bar() : Foo(1) {}
}
Hello
I have a "List" in the main application and I am trying to access its elements from within a thread. I am getting this exception:
{"The calling thread cannot access this object because a different thread owns it."} System.SystemException {System.InvalidOperationException}
Thanks
Hi,
I have a nested list comprising ~30,000 sub-lists, each with three entries, e.g.,
nested_list = [['x', 'y', 'z'], ['a', 'b', 'c']].
I wish to create a function in order to output this data construct into a tab delimited format, e.g.,
x y z
a b c
Any help greatly appreciated!
Thanks in advance,
Seafoid.
I have a particular scenario below. The code below should print 'say()' function of B and C class and print 'B says..' and 'C says...' but it doesn't .Any ideas..
I am learning polymorphism so also have commented few questions related to it on the lines of code below.
class A
{
public:
// A() {}
virtual void say() { std::cout << "Said IT ! " << std::endl; }
virtual ~A(); //why virtual destructor ?
};
void methodCall() // does it matters if the inherited class from A is in this method
{
class B : public A{
public:
// virtual ~B(); //significance of virtual destructor in 'child' class
virtual void say () // does the overrided method also has to be have the keyword 'virtual'
{ cout << "B Sayssss.... " << endl; }
};
class C : public A{
public:
//virtual ~C();
virtual void say () { cout << "C Says " << endl; }
};
list<A> listOfAs;
list<A>::iterator it;
# 1st scenario
B bObj;
C cObj;
A *aB = &bObj;
A *aC = &cObj;
# 2nd scenario
// A aA;
// B *Ba = &aA;
// C *Ca = &aA; // I am declaring the objects as in 1st scenario but how about 2nd scenario, is this suppose to work too?
listOfAs.insert(it,*aB);
listOfAs.insert(it,*aC);
for (it=listOfAs.begin(); it!=listOfAs.end(); it++)
{
cout << *it.say() << endl;
}
}
int main()
{
methodCall();
retrun 0;
}
I'd like to iterate over a list in Python several (say, 10) elements at a time, processing each slice one by one. I can think of a few ways to do this, but none seems obvious and clean. What is the most Pythonic way to do this?
I have hierarchical data that I represent using the adjacency list model.
TABLE
ID
parentID
title
I am wondering, what is the simplest way to SELECT the number of immediate children for each node? If possible, I'd like to do this in a single select, yielding a resultset like so...
RESULTS...
ID title childCount
1 test1 10
2 test2 2
3 test3 0
etc...
Thanks for your advice!
In my other question You can see code of my arr structure and PriorityQueue collection. I normally add items to this collection like that:
arr.PriorityQueue.Add(new element((value(item, endPoint) + value(startPoint, item)),item));
I am curious that is other way to do this (add element(which is struct) object to List) ? In lambda way for example ? I just eager for knowledge :)
Hi everyone,
how to display record of the list in different line
['0 , INDIVS08 , ODI_TEMP', '1 , C$_0EMPLOYEES , ODI_TEMP', '2 , C$_0PACS08 , ODI_TEMP']
i want to display as
'0 , INDIVS08 , ODI_TEMP' ,
'1 , C$_0EMPLOYEES , ODI_TEMP',
'2 , C$_0PACS08 , ODI_TEMP'
Thanks for all of your help
Hi guys
I'm looking for an equivalent in python of dictionary.get(key, default) for lists. Is there any one liner idiom to get the nth element of a list or a default value if not available?
Thanks!
I occasionally see the list slice syntax used in Python code like this:
newList = oldList[:]
Surely this is just the same as:
newList = oldList
Or am I missing something?
Hi,
I ask a question and receive answer. Should I thanks to mailing list (Reply-All) or just private to answer-sender?
Question: Hi. Where is problem? Thanks
Answer: Line 32. Regards.
Is there a situation where the use of a list leads to an error, and you must use a tuple instead?
I know something about the properties of both tuples and lists, but not enough to find out the answer to this question. If the question would be the other way around, it would be that lists can be adjusted but tuples don't.
I have two models device and log setup as such:
class device(models.Model):
name = models.CharField(max_length=20)
code = models.CharField(max_length=10)
description = models.TextField()
class log(model.Model):
device = models.ForeignKey(device)
date = models.DateField()
time = models.TimeField()
data = models.CharField(max_length=50)
how do I get a list which contains only the most recent record/log (based on time and date) for each device and combine them in the format below:
name,code,date,time,data
being a Django newbie I would like to implement this using Django's ORM. TIA!
I need to transform a list into dictionary as follows.
The odd elements has the key, and even number elements has the value.
x = (1,'a',2,'b',3,'c') - {1: 'a', 2: 'b', 3: 'c'}
def set(self, val_):
i = 0
for val in val_:
if i == 0:
i = 1
key = val
else:
i = 0
self.dict[key] = val
My solution seems to long, is there a better way to get the same results?
I am new to struts2.I am unable to populate value in side a table in my jsp page from my Action class.I have a List in my Action class.Can any body help me.
I want to sort a list of strings based on the string length. I tried to use sort as follows, but it doesn't seem to give me correct result.
xs = ['dddd','a','bb','ccc']
print xs
xs.sort(lambda x,y: len(x) < len(y))
print xs
['dddd', 'a', 'bb', 'ccc']
['dddd', 'a', 'bb', 'ccc']
What might be wrong?
Can any one please guide me to look in depth about the Data Structures used and how is it implemented in the List, Set and Maps of Util Collection page.
In Interviews most of the questions will be on the Algorithms, but I never saw anywhere the implementation details, Can any one please share the information.
What i want to do is
for (list<cPacket *>::iterator i = cache.begin(); i != cache.end(); i++){
if( strcmp(i->getName(),id) == 0 ){
return true;
}
}
where getName is function of the class cPacket, But it does not work, i tries also
i.operator->()->getName(), and again nothing.
Can anybody help me?
Given a list of numbers how to find differences between every (i)-th and (i+1)-th of its elements? Should one better use lambda or maybe lists comprehension?
My professor provided me with a file called CursorList.cpp that implements a "Cursor Linked List". The problem is - I have no idea what that even is!
Could anybody give me the gist of it?
Thanks!