Move the item to the top of listview when a new message arrives

I am working on a XMPP based chat in android.. and I am struck at a point where I need to update the position of an item in the listview to the top in case a new.message arrives. The use case is.. I am on Contacts screen of the app and a new message

Iterator problem using Java creating exceptions

String input from keyboard Vector<String> myVector = new Vector<String>(someArray.length); //assume Vector is populated Iterator<String> itr = myVector.iterator(); for loop begins while(itr.hasNext() &&{

Pop3 in Android

How can I use POP3 for to read the letters in Android with POP3 or IMAP? Guide me, maybe can I use some libraries and other? I must to read some letters in my app. Thanks, Roman Sytnik.The Javamail-Android project should help:

Import and extend

This question already has an answer here: What's the difference between importing and extending a class? 10 answers can any one explain " While we are importing a package we can use its all public functions, Then what is the use of extending a class

How can I use asynchronous functions in C ++?

I'm a beginner C++ programmer. As i know statements will be executed line by line so if i call a function inside main,the body of called function will be executed first then the rest of the code... As shown in following code: int main() { ABC(); // .

How to get context in an intent service

Here's the scenario: I have a WakefulBroadcastReceiver that does a backup to a network computer or the cloud. It's set to go off in the middle of the night, when I know the tablet will have access to the LAN. The backup will store the data to a locat

UWP: Calling Frame.Navigate () of a Page.OnNavigatedTo Event

Into an Universal windows app I want to check user's authentication during page load, or after that an user as navigated to. This permits me to offer a navigation filtered by authorizations with a single page granularity. For example, if an user didn

Use JavaScript to compare time intervals

I have a collection of time ranges in the form of Date objects. I need to compare those time ranges against a new time range to make sure I don't add a time range that overlaps or duplicates an existing time range. Here's an example of the collection

Stopping xcode from indexing

I've been working with xCode 4.5.2, and have noticed that if you are indexing, you need to stop everything and let it do it's job, or else you'll get bogged down. It's become a bit of a problem, as the project is a large one, and indexing has been ta

Windows 7/8, Direct3D9, 10 and 11 - Effects / Shaders

Currently, i'm developing an app for the Windows 8 Store, Windows 8 Desktop and also Windows 7. The App should run smoothly on a Tablet and also on a "normal" Windows 7/8 Device. So, i got a tablet from my work and installed Windows 8 on it, jus

Casting Sets on Subtypes

I'm trying to create my own subclass of socket.socket that will be able to handle custom messages. So far my code looks like this: self._sockets.append(s) logging.debug("Waiting for incoming connections on port %d" % (port)) while not self.shutd

Magento: images disappear when creating a new product

I'm using Magento,. When I want to create a new product, I can upload the images, but when I save the product, the images I uploaded are gone, as if I had never uploaded them- I upgraded Magento from to and the products alread

Improvement of LWP :: Simple Perl Performance

Alas, I have yet another question: I have been tasked with reading a webpage and extracting links from that page (easy stuff with HTML::TokeParser). He (my boss) then insists that I read from these links and grab some details from each of those pages

How to analyze JSON in node js

I have this JSON array, and what I want is to get the password field alone var user = [ { _id: 5902086ecbc0dd11e4870fd9, password: '$2a$08$FIpkmFT1WDZggQYyBA4CVuop6pelbKBfUEJ1/KAVIV2Si9Ho1EYhi', email: '[email protected]', lastName: 'v', firstName: 'j'

How to add RecyclerView in ScrollView

I need to add a RecyclerView in ScrollView. The RecyclerView should wrap its contents and shouldn't be be scrollable, but the entire scroll view should be scrollable. Can this be done an how?If you look at the Recycler view adpater class you will be

How to close the service activity?

I am launching activity from the service based on some value got from the server and the activity will be displayed for the some time and after getting close instruction from the server i need to close that activity,so for that i used following appro mvc controller method - & gt; soap web service

I am quite familiar with ASP.NET MVC and know that a controller's method can respond with XML and JSON apart from other things (i.e. behave like a restful webservice). I am just wondering whether I can make a controller method behave like a soap web

Downloading files does not work in IE and Firefox

I have the following code to upload a file to the server. For some weird reason, it does not work in IE and Mozilla Firefox but works perfect in Chrome. What is the problem? PHP: // Check post_max_size (

php endsWith function fails on one server but works on another?

I have a script which is essentially a crawler to index news articles. The script works fine on one server (main http server), but I am trying to move it to a dedicated platform and one section will not function. The part that fails uses a simple fun

Is Java (Java EE) not good for building a wordpress like CMS?

I observed that generally all good CMS, forums and portals are written in PHP only. Some of them are written with the help of Python, Ruby, etc. Some of the CMS which were build in Java, were not so flexible as wordpress is. Is Java (Java EE) not goo

Decrease the first and last row of an RDD with Spark

I'm reading in a text file using spark with sc.textFile(fileLocation) and need to be able to quickly drop the first and last row (they could be a header or trailer). I've found good ways of returning the first and last row, but no good one for removi